@commercetools-uikit/radio-input 19.20.1 → 19.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commercetools-uikit-radio-input.cjs.dev.js +37 -26
- package/dist/commercetools-uikit-radio-input.cjs.prod.js +31 -20
- package/dist/commercetools-uikit-radio-input.esm.js +37 -26
- package/dist/declarations/src/index.d.ts +2 -6
- package/dist/declarations/src/radio-group.d.ts +4 -5
- package/dist/declarations/src/radio-option.d.ts +1 -4
- package/package.json +9 -9
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
6
|
+
var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
6
7
|
var _pt = require('prop-types');
|
|
7
8
|
var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
|
|
8
9
|
var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
@@ -177,19 +178,23 @@ const RadioOptionLabel = /*#__PURE__*/_styled__default["default"]("label", proce
|
|
|
177
178
|
width: fit-content;
|
|
178
179
|
}` : '', " ", props => getHoverStyles(props), ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJhZGlvLW9wdGlvbi5zdHlsZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBcUptRCIsImZpbGUiOiJyYWRpby1vcHRpb24uc3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuaW1wb3J0IHsgZGVzaWduVG9rZ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mZzZXQ6IDJweDtcbiAgICAgIHdpZHRoOiBmaXQtY29udGVudDtcbiAgICB9YFxuICAgICAgOiAnJ31cblxuICAkeyhwcm9wcykgPT4gZ2V0SG92ZXJTdHlsZXMocHJvcHMpfVxuYDtcblxuZXhwb3J0IHtcbiAgTGFiZWxUZXh0V3JhcHBlcixcbiAgUmFkaW9JbnB1dFdyYXBwZXIsXG4gIEFkZGl0aW9uYWxUZXh0V3JhcHBlcixcbiAgUmFkaW9PcHRpb25Lbm9iLFxuICBSYWRpb09wdGlvbkJvcmRlcixcbiAgUmFkaW9PcHRpb25MYWJlbCxcbiAgUmFkaW9PcHRpb25Db250YWluZXIsXG59O1xuIl19 */"));
|
|
179
180
|
|
|
181
|
+
const _excluded$1 = ["components"];
|
|
180
182
|
function ownKeys$1(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
181
183
|
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
182
|
-
const Option =
|
|
184
|
+
const Option = _ref => {
|
|
185
|
+
let _ref$components = _ref.components,
|
|
186
|
+
components = _ref$components === void 0 ? {} : _ref$components,
|
|
187
|
+
props = _objectWithoutProperties(_ref, _excluded$1);
|
|
183
188
|
const labelProps = props.id ? {
|
|
184
189
|
htmlFor: props.id
|
|
185
190
|
} : {};
|
|
186
191
|
if (!props.isReadOnly) {
|
|
187
192
|
process.env.NODE_ENV !== "production" ? utils.warning(typeof props.onChange === 'function', 'RadioOption: `onChange` is required when input is not read only.') : void 0;
|
|
188
193
|
}
|
|
189
|
-
if (
|
|
190
|
-
process.env.NODE_ENV !== "production" ? utils.warning(typeof
|
|
191
|
-
process.env.NODE_ENV !== "production" ? utils.warning(
|
|
192
|
-
process.env.NODE_ENV !== "production" ? utils.warning( /*#__PURE__*/react$1.isValidElement(
|
|
194
|
+
if (components.wrapper) {
|
|
195
|
+
process.env.NODE_ENV !== "production" ? utils.warning(typeof components.wrapper === 'function', `Invalid prop 'components.wrapper' supplied to 'RadioInput.Option': the prop is not a function`) : void 0;
|
|
196
|
+
process.env.NODE_ENV !== "production" ? utils.warning(components.wrapper.length === 1, `Invalid prop 'components.wrapper' supplied to 'RadioInput.Option': the supplied function should expect one argument`) : void 0;
|
|
197
|
+
process.env.NODE_ENV !== "production" ? utils.warning( /*#__PURE__*/react$1.isValidElement(components.wrapper(jsxRuntime.jsx(jsxRuntime.Fragment, {}))), `Invalid prop 'components.wrapper' supplied to 'RadioInput.Option': the function supplied should return a valid react element`) : void 0;
|
|
193
198
|
}
|
|
194
199
|
const stylesProps = {
|
|
195
200
|
isDisabled: props.isDisabled,
|
|
@@ -253,21 +258,21 @@ Option.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
253
258
|
isHovered: _pt__default["default"].bool
|
|
254
259
|
} : {};
|
|
255
260
|
Option.displayName = 'RadioOption';
|
|
256
|
-
Option.defaultProps = {
|
|
257
|
-
components: {}
|
|
258
|
-
};
|
|
259
261
|
var Option$1 = Option;
|
|
260
262
|
|
|
263
|
+
const _excluded = ["horizontalConstraint", "direction", "directionProps"];
|
|
261
264
|
function ownKeys(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
262
265
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
263
|
-
const
|
|
264
|
-
horizontalConstraint
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
266
|
+
const Group = _ref => {
|
|
267
|
+
let _ref$horizontalConstr = _ref.horizontalConstraint,
|
|
268
|
+
horizontalConstraint = _ref$horizontalConstr === void 0 ? 'scale' : _ref$horizontalConstr,
|
|
269
|
+
_ref$direction = _ref.direction,
|
|
270
|
+
direction = _ref$direction === void 0 ? 'stack' : _ref$direction,
|
|
271
|
+
_ref$directionProps = _ref.directionProps,
|
|
272
|
+
directionProps = _ref$directionProps === void 0 ? {
|
|
273
|
+
scale: 'm'
|
|
274
|
+
} : _ref$directionProps,
|
|
275
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
271
276
|
react$1.useEffect(() => {
|
|
272
277
|
// NOTE: We allow mixed children rendered as (e.g. spacers)
|
|
273
278
|
// as a result we need to filter out children of the correct type.
|
|
@@ -290,17 +295,21 @@ const Group = props => {
|
|
|
290
295
|
onFocus: props.onFocus,
|
|
291
296
|
onBlur: props.onBlur
|
|
292
297
|
});
|
|
293
|
-
const
|
|
298
|
+
const _ref2 = child.props.components || {},
|
|
299
|
+
wrapper = _ref2.wrapper;
|
|
294
300
|
return wrapper ? wrapper(clonedChild) : clonedChild;
|
|
295
301
|
}
|
|
296
302
|
return child;
|
|
297
303
|
});
|
|
298
|
-
if (
|
|
304
|
+
if (direction === 'inline') {
|
|
299
305
|
return jsxRuntime.jsx("div", {
|
|
300
306
|
"aria-labelledby": props.id,
|
|
301
307
|
"aria-invalid": props['aria-invalid'],
|
|
302
308
|
"aria-errormessage": props['aria-errormessage'],
|
|
303
|
-
children: jsxRuntime.jsx(Inline__default["default"], _objectSpread(_objectSpread(_objectSpread({},
|
|
309
|
+
children: jsxRuntime.jsx(Inline__default["default"], _objectSpread(_objectSpread(_objectSpread({}, directionProps), utils.filterDataAttributes(_objectSpread({
|
|
310
|
+
horizontalConstraint,
|
|
311
|
+
direction
|
|
312
|
+
}, props))), {}, {
|
|
304
313
|
children: optionElements
|
|
305
314
|
}))
|
|
306
315
|
});
|
|
@@ -310,8 +319,11 @@ const Group = props => {
|
|
|
310
319
|
"aria-invalid": props['aria-invalid'],
|
|
311
320
|
"aria-errormessage": props['aria-errormessage'],
|
|
312
321
|
children: jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
|
|
313
|
-
max:
|
|
314
|
-
children: jsxRuntime.jsx(Stack__default["default"], _objectSpread(_objectSpread(_objectSpread({},
|
|
322
|
+
max: horizontalConstraint,
|
|
323
|
+
children: jsxRuntime.jsx(Stack__default["default"], _objectSpread(_objectSpread(_objectSpread({}, directionProps), utils.filterDataAttributes(_objectSpread({
|
|
324
|
+
horizontalConstraint,
|
|
325
|
+
direction
|
|
326
|
+
}, props))), {}, {
|
|
315
327
|
children: optionElements
|
|
316
328
|
}))
|
|
317
329
|
})
|
|
@@ -328,19 +340,18 @@ Group.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
328
340
|
isReadOnly: _pt__default["default"].bool,
|
|
329
341
|
hasError: _pt__default["default"].bool,
|
|
330
342
|
hasWarning: _pt__default["default"].bool,
|
|
331
|
-
horizontalConstraint: _pt__default["default"].oneOf([7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 'scale', 'auto'])
|
|
332
|
-
direction: _pt__default["default"].oneOf(['stack', 'inline'])
|
|
333
|
-
directionProps: _pt__default["default"].shape({})
|
|
343
|
+
horizontalConstraint: _pt__default["default"].oneOf([7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 'scale', 'auto']),
|
|
344
|
+
direction: _pt__default["default"].oneOf(['stack', 'inline']),
|
|
345
|
+
directionProps: _pt__default["default"].shape({}),
|
|
334
346
|
children: _pt__default["default"].node.isRequired,
|
|
335
347
|
'aria-invalid': _pt__default["default"].bool,
|
|
336
348
|
'aria-errormessage': _pt__default["default"].string
|
|
337
349
|
} : {};
|
|
338
350
|
Group.displayName = 'RadioGroup';
|
|
339
|
-
Group.defaultProps = defaultProps;
|
|
340
351
|
var Group$1 = Group;
|
|
341
352
|
|
|
342
353
|
// NOTE: This string will be replaced on build time with the package version.
|
|
343
|
-
var version = "19.
|
|
354
|
+
var version = "19.22.0";
|
|
344
355
|
|
|
345
356
|
const RadioInput = {
|
|
346
357
|
Group: Group$1,
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
6
|
+
var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
6
7
|
require('prop-types');
|
|
7
8
|
var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
|
|
8
9
|
var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
@@ -144,14 +145,18 @@ const RadioOptionLabel = /*#__PURE__*/_styled__default["default"]("label", {
|
|
|
144
145
|
width: fit-content;
|
|
145
146
|
}` : '', " ", props => getHoverStyles(props), ";" + ("" ));
|
|
146
147
|
|
|
148
|
+
const _excluded$1 = ["components"];
|
|
147
149
|
function ownKeys$1(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
148
150
|
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
149
|
-
const Option =
|
|
151
|
+
const Option = _ref => {
|
|
152
|
+
let _ref$components = _ref.components,
|
|
153
|
+
components = _ref$components === void 0 ? {} : _ref$components,
|
|
154
|
+
props = _objectWithoutProperties(_ref, _excluded$1);
|
|
150
155
|
const labelProps = props.id ? {
|
|
151
156
|
htmlFor: props.id
|
|
152
157
|
} : {};
|
|
153
158
|
if (!props.isReadOnly) ;
|
|
154
|
-
if (
|
|
159
|
+
if (components.wrapper) ;
|
|
155
160
|
const stylesProps = {
|
|
156
161
|
isDisabled: props.isDisabled,
|
|
157
162
|
hasError: props.hasError,
|
|
@@ -196,21 +201,21 @@ const Option = props => {
|
|
|
196
201
|
};
|
|
197
202
|
Option.propTypes = {};
|
|
198
203
|
Option.displayName = 'RadioOption';
|
|
199
|
-
Option.defaultProps = {
|
|
200
|
-
components: {}
|
|
201
|
-
};
|
|
202
204
|
var Option$1 = Option;
|
|
203
205
|
|
|
206
|
+
const _excluded = ["horizontalConstraint", "direction", "directionProps"];
|
|
204
207
|
function ownKeys(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
205
208
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
206
|
-
const
|
|
207
|
-
horizontalConstraint
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
209
|
+
const Group = _ref => {
|
|
210
|
+
let _ref$horizontalConstr = _ref.horizontalConstraint,
|
|
211
|
+
horizontalConstraint = _ref$horizontalConstr === void 0 ? 'scale' : _ref$horizontalConstr,
|
|
212
|
+
_ref$direction = _ref.direction,
|
|
213
|
+
direction = _ref$direction === void 0 ? 'stack' : _ref$direction,
|
|
214
|
+
_ref$directionProps = _ref.directionProps,
|
|
215
|
+
directionProps = _ref$directionProps === void 0 ? {
|
|
216
|
+
scale: 'm'
|
|
217
|
+
} : _ref$directionProps,
|
|
218
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
214
219
|
react$1.useEffect(() => {
|
|
215
220
|
// NOTE: We allow mixed children rendered as (e.g. spacers)
|
|
216
221
|
// as a result we need to filter out children of the correct type.
|
|
@@ -232,17 +237,21 @@ const Group = props => {
|
|
|
232
237
|
onFocus: props.onFocus,
|
|
233
238
|
onBlur: props.onBlur
|
|
234
239
|
});
|
|
235
|
-
const
|
|
240
|
+
const _ref2 = child.props.components || {},
|
|
241
|
+
wrapper = _ref2.wrapper;
|
|
236
242
|
return wrapper ? wrapper(clonedChild) : clonedChild;
|
|
237
243
|
}
|
|
238
244
|
return child;
|
|
239
245
|
});
|
|
240
|
-
if (
|
|
246
|
+
if (direction === 'inline') {
|
|
241
247
|
return jsxRuntime.jsx("div", {
|
|
242
248
|
"aria-labelledby": props.id,
|
|
243
249
|
"aria-invalid": props['aria-invalid'],
|
|
244
250
|
"aria-errormessage": props['aria-errormessage'],
|
|
245
|
-
children: jsxRuntime.jsx(Inline__default["default"], _objectSpread(_objectSpread(_objectSpread({},
|
|
251
|
+
children: jsxRuntime.jsx(Inline__default["default"], _objectSpread(_objectSpread(_objectSpread({}, directionProps), utils.filterDataAttributes(_objectSpread({
|
|
252
|
+
horizontalConstraint,
|
|
253
|
+
direction
|
|
254
|
+
}, props))), {}, {
|
|
246
255
|
children: optionElements
|
|
247
256
|
}))
|
|
248
257
|
});
|
|
@@ -252,8 +261,11 @@ const Group = props => {
|
|
|
252
261
|
"aria-invalid": props['aria-invalid'],
|
|
253
262
|
"aria-errormessage": props['aria-errormessage'],
|
|
254
263
|
children: jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
|
|
255
|
-
max:
|
|
256
|
-
children: jsxRuntime.jsx(Stack__default["default"], _objectSpread(_objectSpread(_objectSpread({},
|
|
264
|
+
max: horizontalConstraint,
|
|
265
|
+
children: jsxRuntime.jsx(Stack__default["default"], _objectSpread(_objectSpread(_objectSpread({}, directionProps), utils.filterDataAttributes(_objectSpread({
|
|
266
|
+
horizontalConstraint,
|
|
267
|
+
direction
|
|
268
|
+
}, props))), {}, {
|
|
257
269
|
children: optionElements
|
|
258
270
|
}))
|
|
259
271
|
})
|
|
@@ -261,11 +273,10 @@ const Group = props => {
|
|
|
261
273
|
};
|
|
262
274
|
Group.propTypes = {};
|
|
263
275
|
Group.displayName = 'RadioGroup';
|
|
264
|
-
Group.defaultProps = defaultProps;
|
|
265
276
|
var Group$1 = Group;
|
|
266
277
|
|
|
267
278
|
// NOTE: This string will be replaced on build time with the package version.
|
|
268
|
-
var version = "19.
|
|
279
|
+
var version = "19.22.0";
|
|
269
280
|
|
|
270
281
|
const RadioInput = {
|
|
271
282
|
Group: Group$1,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime-corejs3/helpers/esm/defineProperty';
|
|
2
|
+
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/esm/objectWithoutProperties';
|
|
2
3
|
import _pt from 'prop-types';
|
|
3
4
|
import _filterInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/filter';
|
|
4
5
|
import _mapInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/map';
|
|
@@ -155,19 +156,23 @@ const RadioOptionLabel = /*#__PURE__*/_styled("label", process.env.NODE_ENV ===
|
|
|
155
156
|
width: fit-content;
|
|
156
157
|
}` : '', " ", props => getHoverStyles(props), ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJhZGlvLW9wdGlvbi5zdHlsZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBcUptRCIsImZpbGUiOiJyYWRpby1vcHRpb24uc3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuaW1wb3J0IHsgZGVzaWduVG9rZW5zIH0gZnJvbSAnQGNvbW1lcmNldG9vbHMtdWlraXQvZGVzaWduLXN5c3RlbSc7XG5pbXBvcnQgdHlwZSB7IFRTdHlsZXNQcm9wcyB9IGZyb20gJy4vcmFkaW8tb3B0aW9uJztcblxuY29uc3QgTGFiZWxUZXh0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ZWxUZXh0V3JhcHBlcixcbiAgUmFkaW9JbnB1dFdyYXBwZXIsXG4gIEFkZGl0aW9uYWxUZXh0V3JhcHBlcixcbiAgUmFkaW9PcHRpb25Lbm9iLFxuICBSYWRpb09wdGlvbkJvcmRlcixcbiAgUmFkaW9PcHRpb25MYWJlbCxcbiAgUmFkaW9PcHRpb25Db250YWluZXIsXG59O1xuIl19 */"));
|
|
157
158
|
|
|
159
|
+
const _excluded$1 = ["components"];
|
|
158
160
|
function ownKeys$1(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
159
161
|
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys$1(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$1(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
160
|
-
const Option =
|
|
162
|
+
const Option = _ref => {
|
|
163
|
+
let _ref$components = _ref.components,
|
|
164
|
+
components = _ref$components === void 0 ? {} : _ref$components,
|
|
165
|
+
props = _objectWithoutProperties(_ref, _excluded$1);
|
|
161
166
|
const labelProps = props.id ? {
|
|
162
167
|
htmlFor: props.id
|
|
163
168
|
} : {};
|
|
164
169
|
if (!props.isReadOnly) {
|
|
165
170
|
process.env.NODE_ENV !== "production" ? warning(typeof props.onChange === 'function', 'RadioOption: `onChange` is required when input is not read only.') : void 0;
|
|
166
171
|
}
|
|
167
|
-
if (
|
|
168
|
-
process.env.NODE_ENV !== "production" ? warning(typeof
|
|
169
|
-
process.env.NODE_ENV !== "production" ? warning(
|
|
170
|
-
process.env.NODE_ENV !== "production" ? warning( /*#__PURE__*/isValidElement(
|
|
172
|
+
if (components.wrapper) {
|
|
173
|
+
process.env.NODE_ENV !== "production" ? warning(typeof components.wrapper === 'function', `Invalid prop 'components.wrapper' supplied to 'RadioInput.Option': the prop is not a function`) : void 0;
|
|
174
|
+
process.env.NODE_ENV !== "production" ? warning(components.wrapper.length === 1, `Invalid prop 'components.wrapper' supplied to 'RadioInput.Option': the supplied function should expect one argument`) : void 0;
|
|
175
|
+
process.env.NODE_ENV !== "production" ? warning( /*#__PURE__*/isValidElement(components.wrapper(jsx(Fragment, {}))), `Invalid prop 'components.wrapper' supplied to 'RadioInput.Option': the function supplied should return a valid react element`) : void 0;
|
|
171
176
|
}
|
|
172
177
|
const stylesProps = {
|
|
173
178
|
isDisabled: props.isDisabled,
|
|
@@ -231,21 +236,21 @@ Option.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
231
236
|
isHovered: _pt.bool
|
|
232
237
|
} : {};
|
|
233
238
|
Option.displayName = 'RadioOption';
|
|
234
|
-
Option.defaultProps = {
|
|
235
|
-
components: {}
|
|
236
|
-
};
|
|
237
239
|
var Option$1 = Option;
|
|
238
240
|
|
|
241
|
+
const _excluded = ["horizontalConstraint", "direction", "directionProps"];
|
|
239
242
|
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
240
243
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
241
|
-
const
|
|
242
|
-
horizontalConstraint
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
244
|
+
const Group = _ref => {
|
|
245
|
+
let _ref$horizontalConstr = _ref.horizontalConstraint,
|
|
246
|
+
horizontalConstraint = _ref$horizontalConstr === void 0 ? 'scale' : _ref$horizontalConstr,
|
|
247
|
+
_ref$direction = _ref.direction,
|
|
248
|
+
direction = _ref$direction === void 0 ? 'stack' : _ref$direction,
|
|
249
|
+
_ref$directionProps = _ref.directionProps,
|
|
250
|
+
directionProps = _ref$directionProps === void 0 ? {
|
|
251
|
+
scale: 'm'
|
|
252
|
+
} : _ref$directionProps,
|
|
253
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
249
254
|
useEffect(() => {
|
|
250
255
|
// NOTE: We allow mixed children rendered as (e.g. spacers)
|
|
251
256
|
// as a result we need to filter out children of the correct type.
|
|
@@ -268,17 +273,21 @@ const Group = props => {
|
|
|
268
273
|
onFocus: props.onFocus,
|
|
269
274
|
onBlur: props.onBlur
|
|
270
275
|
});
|
|
271
|
-
const
|
|
276
|
+
const _ref2 = child.props.components || {},
|
|
277
|
+
wrapper = _ref2.wrapper;
|
|
272
278
|
return wrapper ? wrapper(clonedChild) : clonedChild;
|
|
273
279
|
}
|
|
274
280
|
return child;
|
|
275
281
|
});
|
|
276
|
-
if (
|
|
282
|
+
if (direction === 'inline') {
|
|
277
283
|
return jsx("div", {
|
|
278
284
|
"aria-labelledby": props.id,
|
|
279
285
|
"aria-invalid": props['aria-invalid'],
|
|
280
286
|
"aria-errormessage": props['aria-errormessage'],
|
|
281
|
-
children: jsx(Inline, _objectSpread(_objectSpread(_objectSpread({},
|
|
287
|
+
children: jsx(Inline, _objectSpread(_objectSpread(_objectSpread({}, directionProps), filterDataAttributes(_objectSpread({
|
|
288
|
+
horizontalConstraint,
|
|
289
|
+
direction
|
|
290
|
+
}, props))), {}, {
|
|
282
291
|
children: optionElements
|
|
283
292
|
}))
|
|
284
293
|
});
|
|
@@ -288,8 +297,11 @@ const Group = props => {
|
|
|
288
297
|
"aria-invalid": props['aria-invalid'],
|
|
289
298
|
"aria-errormessage": props['aria-errormessage'],
|
|
290
299
|
children: jsx(Constraints.Horizontal, {
|
|
291
|
-
max:
|
|
292
|
-
children: jsx(Stack, _objectSpread(_objectSpread(_objectSpread({},
|
|
300
|
+
max: horizontalConstraint,
|
|
301
|
+
children: jsx(Stack, _objectSpread(_objectSpread(_objectSpread({}, directionProps), filterDataAttributes(_objectSpread({
|
|
302
|
+
horizontalConstraint,
|
|
303
|
+
direction
|
|
304
|
+
}, props))), {}, {
|
|
293
305
|
children: optionElements
|
|
294
306
|
}))
|
|
295
307
|
})
|
|
@@ -306,19 +318,18 @@ Group.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
306
318
|
isReadOnly: _pt.bool,
|
|
307
319
|
hasError: _pt.bool,
|
|
308
320
|
hasWarning: _pt.bool,
|
|
309
|
-
horizontalConstraint: _pt.oneOf([7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 'scale', 'auto'])
|
|
310
|
-
direction: _pt.oneOf(['stack', 'inline'])
|
|
311
|
-
directionProps: _pt.shape({})
|
|
321
|
+
horizontalConstraint: _pt.oneOf([7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 'scale', 'auto']),
|
|
322
|
+
direction: _pt.oneOf(['stack', 'inline']),
|
|
323
|
+
directionProps: _pt.shape({}),
|
|
312
324
|
children: _pt.node.isRequired,
|
|
313
325
|
'aria-invalid': _pt.bool,
|
|
314
326
|
'aria-errormessage': _pt.string
|
|
315
327
|
} : {};
|
|
316
328
|
Group.displayName = 'RadioGroup';
|
|
317
|
-
Group.defaultProps = defaultProps;
|
|
318
329
|
var Group$1 = Group;
|
|
319
330
|
|
|
320
331
|
// NOTE: This string will be replaced on build time with the package version.
|
|
321
|
-
var version = "19.
|
|
332
|
+
var version = "19.22.0";
|
|
322
333
|
|
|
323
334
|
const RadioInput = {
|
|
324
335
|
Group: Group$1,
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
declare const RadioInput: {
|
|
2
2
|
Group: {
|
|
3
|
-
(props: import("./radio-group.js").TGroupProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
3
|
+
({ horizontalConstraint, direction, directionProps, ...props }: import("./radio-group.js").TGroupProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
4
4
|
displayName: string;
|
|
5
|
-
defaultProps: Pick<import("./radio-group.js").TGroupProps, "direction" | "horizontalConstraint" | "directionProps">;
|
|
6
5
|
};
|
|
7
6
|
Option: {
|
|
8
|
-
(props: import("./radio-option.js").TOptionProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
7
|
+
({ components, ...props }: import("./radio-option.js").TOptionProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
9
8
|
displayName: string;
|
|
10
|
-
defaultProps: {
|
|
11
|
-
components: {};
|
|
12
|
-
};
|
|
13
9
|
};
|
|
14
10
|
};
|
|
15
11
|
export default RadioInput;
|
|
@@ -11,12 +11,12 @@ export type TGroupProps = {
|
|
|
11
11
|
isReadOnly?: boolean;
|
|
12
12
|
hasError?: boolean;
|
|
13
13
|
hasWarning?: boolean;
|
|
14
|
-
horizontalConstraint
|
|
14
|
+
horizontalConstraint?: 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 'scale' | 'auto';
|
|
15
15
|
/** Pick the desired layout. Possible values are `stack` or `inline`, (= Radio.Option items will be
|
|
16
16
|
* wrapped with the `Spacing.Stack` or `Spacing.Inline` component)*/
|
|
17
|
-
direction
|
|
17
|
+
direction?: 'stack' | 'inline';
|
|
18
18
|
/** Props uesed to configue the selected layout component that was picked via the `direction` property */
|
|
19
|
-
directionProps
|
|
19
|
+
directionProps?: {
|
|
20
20
|
scale?: TInlineProps['scale'];
|
|
21
21
|
alignItems?: TInlineProps['alignItems'];
|
|
22
22
|
justifyContent?: TInlineProps['justifyContent'];
|
|
@@ -32,8 +32,7 @@ export type TGroupProps = {
|
|
|
32
32
|
'aria-errormessage'?: string;
|
|
33
33
|
};
|
|
34
34
|
declare const Group: {
|
|
35
|
-
(props: TGroupProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
35
|
+
({ horizontalConstraint, direction, directionProps, ...props }: TGroupProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
36
36
|
displayName: string;
|
|
37
|
-
defaultProps: Pick<TGroupProps, "direction" | "horizontalConstraint" | "directionProps">;
|
|
38
37
|
};
|
|
39
38
|
export default Group;
|
|
@@ -21,10 +21,7 @@ export type TOptionProps = {
|
|
|
21
21
|
};
|
|
22
22
|
export type TStylesProps = Pick<TOptionProps, 'isDisabled' | 'hasError' | 'hasWarning' | 'isHovered' | 'isReadOnly' | 'isChecked'>;
|
|
23
23
|
declare const Option: {
|
|
24
|
-
(props: TOptionProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
24
|
+
({ components, ...props }: TOptionProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
25
25
|
displayName: string;
|
|
26
|
-
defaultProps: {
|
|
27
|
-
components: {};
|
|
28
|
-
};
|
|
29
26
|
};
|
|
30
27
|
export default Option;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-uikit/radio-input",
|
|
3
3
|
"description": "A RadioInput represents a group of options where only one option can be selected at a time.",
|
|
4
|
-
"version": "19.
|
|
4
|
+
"version": "19.22.0",
|
|
5
5
|
"bugs": "https://github.com/commercetools/ui-kit/issues",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@babel/runtime": "^7.20.13",
|
|
23
23
|
"@babel/runtime-corejs3": "^7.20.13",
|
|
24
|
-
"@commercetools-uikit/constraints": "19.
|
|
25
|
-
"@commercetools-uikit/design-system": "19.
|
|
26
|
-
"@commercetools-uikit/icons": "19.
|
|
27
|
-
"@commercetools-uikit/input-utils": "19.
|
|
28
|
-
"@commercetools-uikit/spacings-inline": "19.
|
|
29
|
-
"@commercetools-uikit/spacings-inset": "19.
|
|
30
|
-
"@commercetools-uikit/spacings-stack": "19.
|
|
31
|
-
"@commercetools-uikit/utils": "19.
|
|
24
|
+
"@commercetools-uikit/constraints": "19.22.0",
|
|
25
|
+
"@commercetools-uikit/design-system": "19.22.0",
|
|
26
|
+
"@commercetools-uikit/icons": "19.22.0",
|
|
27
|
+
"@commercetools-uikit/input-utils": "19.22.0",
|
|
28
|
+
"@commercetools-uikit/spacings-inline": "19.22.0",
|
|
29
|
+
"@commercetools-uikit/spacings-inset": "19.22.0",
|
|
30
|
+
"@commercetools-uikit/spacings-stack": "19.22.0",
|
|
31
|
+
"@commercetools-uikit/utils": "19.22.0",
|
|
32
32
|
"@emotion/react": "^11.10.5",
|
|
33
33
|
"@emotion/styled": "^11.10.5",
|
|
34
34
|
"prop-types": "15.8.1",
|