Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@zendeskgarden/container-field

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zendeskgarden/container-field - npm Package Compare versions

Comparing version 1.3.0 to 1.3.1

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

## [1.3.1](https://github.com/zendeskgarden/react-containers/compare/@zendeskgarden/container-field@1.3.0...@zendeskgarden/container-field@1.3.1) (2020-02-14)
### Bug Fixes
* **build:** apply babel to all bundles ([#160](https://github.com/zendeskgarden/react-containers/issues/160)) ([826735b](https://github.com/zendeskgarden/react-containers/commit/826735bba881d5247b423ffb61cf9643c6599d16))
# [1.3.0](https://github.com/zendeskgarden/react-containers/compare/@zendeskgarden/container-field@1.2.0...@zendeskgarden/container-field@1.3.0) (2020-02-12)

@@ -8,0 +19,0 @@

223

dist/index.cjs.js

@@ -18,45 +18,192 @@ /**

function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly) symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread2(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys(Object(source), true).forEach(function (key) {
_defineProperty(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys(Object(source)).forEach(function (key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null) return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0) continue;
target[key] = source[key];
}
return target;
}
function _objectWithoutProperties(source, excluded) {
if (source == null) return {};
var target = _objectWithoutPropertiesLoose(source, excluded);
var key, i;
if (Object.getOwnPropertySymbols) {
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
for (i = 0; i < sourceSymbolKeys.length; i++) {
key = sourceSymbolKeys[i];
if (excluded.indexOf(key) >= 0) continue;
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
target[key] = source[key];
}
}
return target;
}
function _slicedToArray(arr, i) {
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
}
function _arrayWithHoles(arr) {
if (Array.isArray(arr)) return arr;
}
function _iterableToArrayLimit(arr, i) {
if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
return;
}
var _arr = [];
var _n = true;
var _d = false;
var _e = undefined;
try {
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
_arr.push(_s.value);
if (i && _arr.length === i) break;
}
} catch (err) {
_d = true;
_e = err;
} finally {
try {
if (!_n && _i["return"] != null) _i["return"]();
} finally {
if (_d) throw _e;
}
}
return _arr;
}
function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance");
}
function useField(idPrefix) {
const seed = reactUid.useUIDSeed();
const [prefix] = react.useState(idPrefix || seed(`field_${'1.3.0'}`));
const inputId = `${prefix}--input`;
const labelId = `${prefix}--label`;
const hintId = `${prefix}--hint`;
const getLabelProps = ({ id = labelId, htmlFor = inputId, ...other } = {}) => {
return {
id,
htmlFor,
'data-garden-container-id': 'containers.field',
'data-garden-container-version': '1.3.0',
...other
};
};
const getInputProps = ({ id = inputId, ...other } = {}, { isDescribed = false } = {}) => {
return {
id,
'aria-labelledby': labelId,
'aria-describedby': isDescribed ? hintId : null,
...other
};
};
const getHintProps = ({ id = hintId, ...other } = {}) => {
return {
id,
...other
};
};
return {
getLabelProps,
getInputProps,
getHintProps
};
var seed = reactUid.useUIDSeed();
var _useState = react.useState(idPrefix || seed("field_".concat('1.3.1'))),
_useState2 = _slicedToArray(_useState, 1),
prefix = _useState2[0];
var inputId = "".concat(prefix, "--input");
var labelId = "".concat(prefix, "--label");
var hintId = "".concat(prefix, "--hint");
var getLabelProps = function getLabelProps() {
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var _ref$id = _ref.id,
id = _ref$id === void 0 ? labelId : _ref$id,
_ref$htmlFor = _ref.htmlFor,
htmlFor = _ref$htmlFor === void 0 ? inputId : _ref$htmlFor,
other = _objectWithoutProperties(_ref, ["id", "htmlFor"]);
return _objectSpread2({
id: id,
htmlFor: htmlFor,
'data-garden-container-id': 'containers.field',
'data-garden-container-version': '1.3.1'
}, other);
};
var getInputProps = function getInputProps() {
var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
_ref3$isDescribed = _ref3.isDescribed,
isDescribed = _ref3$isDescribed === void 0 ? false : _ref3$isDescribed;
var _ref2$id = _ref2.id,
id = _ref2$id === void 0 ? inputId : _ref2$id,
other = _objectWithoutProperties(_ref2, ["id"]);
return _objectSpread2({
id: id,
'aria-labelledby': labelId,
'aria-describedby': isDescribed ? hintId : null
}, other);
};
var getHintProps = function getHintProps() {
var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var _ref4$id = _ref4.id,
id = _ref4$id === void 0 ? hintId : _ref4$id,
other = _objectWithoutProperties(_ref4, ["id"]);
return _objectSpread2({
id: id
}, other);
};
return {
getLabelProps: getLabelProps,
getInputProps: getInputProps,
getHintProps: getHintProps
};
}
const FieldContainer = ({ children, render = children, id }) => {
return render(useField(id));
var FieldContainer = function FieldContainer(_ref) {
var children = _ref.children,
_ref$render = _ref.render,
render = _ref$render === void 0 ? children : _ref$render,
id = _ref.id;
return render(useField(id));
};
FieldContainer.propTypes = {
children: PropTypes.func,
render: PropTypes.func,
id: PropTypes.string
children: PropTypes.func,
render: PropTypes.func,
id: PropTypes.string
};

@@ -63,0 +210,0 @@

@@ -12,47 +12,194 @@ /**

function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly) symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread2(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys(Object(source), true).forEach(function (key) {
_defineProperty(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys(Object(source)).forEach(function (key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null) return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0) continue;
target[key] = source[key];
}
return target;
}
function _objectWithoutProperties(source, excluded) {
if (source == null) return {};
var target = _objectWithoutPropertiesLoose(source, excluded);
var key, i;
if (Object.getOwnPropertySymbols) {
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
for (i = 0; i < sourceSymbolKeys.length; i++) {
key = sourceSymbolKeys[i];
if (excluded.indexOf(key) >= 0) continue;
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
target[key] = source[key];
}
}
return target;
}
function _slicedToArray(arr, i) {
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
}
function _arrayWithHoles(arr) {
if (Array.isArray(arr)) return arr;
}
function _iterableToArrayLimit(arr, i) {
if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
return;
}
var _arr = [];
var _n = true;
var _d = false;
var _e = undefined;
try {
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
_arr.push(_s.value);
if (i && _arr.length === i) break;
}
} catch (err) {
_d = true;
_e = err;
} finally {
try {
if (!_n && _i["return"] != null) _i["return"]();
} finally {
if (_d) throw _e;
}
}
return _arr;
}
function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance");
}
function useField(idPrefix) {
const seed = useUIDSeed();
const [prefix] = useState(idPrefix || seed(`field_${'1.3.0'}`));
const inputId = `${prefix}--input`;
const labelId = `${prefix}--label`;
const hintId = `${prefix}--hint`;
const getLabelProps = ({ id = labelId, htmlFor = inputId, ...other } = {}) => {
return {
id,
htmlFor,
'data-garden-container-id': 'containers.field',
'data-garden-container-version': '1.3.0',
...other
};
};
const getInputProps = ({ id = inputId, ...other } = {}, { isDescribed = false } = {}) => {
return {
id,
'aria-labelledby': labelId,
'aria-describedby': isDescribed ? hintId : null,
...other
};
};
const getHintProps = ({ id = hintId, ...other } = {}) => {
return {
id,
...other
};
};
return {
getLabelProps,
getInputProps,
getHintProps
};
var seed = useUIDSeed();
var _useState = useState(idPrefix || seed("field_".concat('1.3.1'))),
_useState2 = _slicedToArray(_useState, 1),
prefix = _useState2[0];
var inputId = "".concat(prefix, "--input");
var labelId = "".concat(prefix, "--label");
var hintId = "".concat(prefix, "--hint");
var getLabelProps = function getLabelProps() {
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var _ref$id = _ref.id,
id = _ref$id === void 0 ? labelId : _ref$id,
_ref$htmlFor = _ref.htmlFor,
htmlFor = _ref$htmlFor === void 0 ? inputId : _ref$htmlFor,
other = _objectWithoutProperties(_ref, ["id", "htmlFor"]);
return _objectSpread2({
id: id,
htmlFor: htmlFor,
'data-garden-container-id': 'containers.field',
'data-garden-container-version': '1.3.1'
}, other);
};
var getInputProps = function getInputProps() {
var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
_ref3$isDescribed = _ref3.isDescribed,
isDescribed = _ref3$isDescribed === void 0 ? false : _ref3$isDescribed;
var _ref2$id = _ref2.id,
id = _ref2$id === void 0 ? inputId : _ref2$id,
other = _objectWithoutProperties(_ref2, ["id"]);
return _objectSpread2({
id: id,
'aria-labelledby': labelId,
'aria-describedby': isDescribed ? hintId : null
}, other);
};
var getHintProps = function getHintProps() {
var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var _ref4$id = _ref4.id,
id = _ref4$id === void 0 ? hintId : _ref4$id,
other = _objectWithoutProperties(_ref4, ["id"]);
return _objectSpread2({
id: id
}, other);
};
return {
getLabelProps: getLabelProps,
getInputProps: getInputProps,
getHintProps: getHintProps
};
}
const FieldContainer = ({ children, render = children, id }) => {
return render(useField(id));
var FieldContainer = function FieldContainer(_ref) {
var children = _ref.children,
_ref$render = _ref.render,
render = _ref$render === void 0 ? children : _ref$render,
id = _ref.id;
return render(useField(id));
};
FieldContainer.propTypes = {
children: PropTypes.func,
render: PropTypes.func,
id: PropTypes.string
children: PropTypes.func,
render: PropTypes.func,
id: PropTypes.string
};
export { FieldContainer, useField };

4

package.json

@@ -11,3 +11,3 @@ {

},
"version": "1.3.0",
"version": "1.3.1",
"main": "dist/index.cjs.js",

@@ -44,3 +44,3 @@ "module": "dist/index.esm.js",

"zendeskgarden:src": "src/index.ts",
"gitHead": "54aeb7846e6b34c5003229fedf8f4c5132babfa9"
"gitHead": "81501ce8b32df63d3ffaa086c9a359a9fcf42d9a"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc