@commercetools-uikit/select-utils 16.12.1 → 17.0.1
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-select-utils.cjs.d.ts +1 -1
- package/dist/commercetools-uikit-select-utils.cjs.dev.js +13 -3
- package/dist/commercetools-uikit-select-utils.cjs.prod.js +13 -3
- package/dist/commercetools-uikit-select-utils.esm.js +13 -3
- package/dist/declarations/src/create-select-styles.d.ts +6 -2
- package/package.json +7 -7
- package/dist/commercetools-uikit-select-utils.cjs.d.ts.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from "./declarations/src/index";
|
|
2
|
-
//# sourceMappingURL=
|
|
2
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tbWVyY2V0b29scy11aWtpdC1zZWxlY3QtdXRpbHMuY2pzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuL2RlY2xhcmF0aW9ucy9zcmMvaW5kZXguZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9
|
|
@@ -255,6 +255,14 @@ var messages = reactIntl.defineMessages({
|
|
|
255
255
|
|
|
256
256
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
257
257
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context8, _context9; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context8 = ownKeys(Object(source), !0)).call(_context8, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context9 = ownKeys(Object(source))).call(_context9, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
258
|
+
const getHorizontalConstraintValue = value => {
|
|
259
|
+
switch (value) {
|
|
260
|
+
case 'auto':
|
|
261
|
+
return 'initial';
|
|
262
|
+
default:
|
|
263
|
+
return designSystem.designTokens["constraint".concat(value)] || designSystem.designTokens.constraintScale;
|
|
264
|
+
}
|
|
265
|
+
};
|
|
258
266
|
const getInputBackgroundColor = props => {
|
|
259
267
|
if (props.appearance === 'quiet') {
|
|
260
268
|
return designSystem.designTokens.backgroundColorForInputAsQuiet;
|
|
@@ -370,7 +378,8 @@ const menuStyles = props => base => {
|
|
|
370
378
|
return base.borderColorForInput;
|
|
371
379
|
})(),
|
|
372
380
|
width: props.horizontalConstraint === 'auto' ? 'auto' : '100%',
|
|
373
|
-
minWidth: designSystem.designTokens.constraint3
|
|
381
|
+
minWidth: props.minMenuWidth ? getHorizontalConstraintValue(props.minMenuWidth) : designSystem.designTokens.constraint3,
|
|
382
|
+
maxWidth: props.maxMenuWidth ? getHorizontalConstraintValue(props.maxMenuWidth) : designSystem.designTokens.constraintScale
|
|
374
383
|
});
|
|
375
384
|
};
|
|
376
385
|
const indicatorSeparatorStyles = () => base => {
|
|
@@ -496,8 +505,9 @@ const groupHeadingStyles = () => base => {
|
|
|
496
505
|
return _objectSpread(_objectSpread({}, base), {}, {
|
|
497
506
|
color: designSystem.designTokens.fontColorForInputWhenReadonly,
|
|
498
507
|
fontSize: designSystem.designTokens.fontSizeSmall,
|
|
508
|
+
borderBottom: "1px solid ".concat(designSystem.designTokens.borderColorForGroupHeadingSelectInputOptions),
|
|
499
509
|
textTransform: 'none',
|
|
500
|
-
fontWeight:
|
|
510
|
+
fontWeight: designSystem.designTokens.fontWeight500,
|
|
501
511
|
padding: _concatInstanceProperty__default["default"](_context4 = "".concat(designSystem.designTokens.spacing20, " ")).call(_context4, designSystem.designTokens.paddingForGroupHeadingSelectInputOptions),
|
|
502
512
|
'&:empty': {
|
|
503
513
|
padding: 0
|
|
@@ -604,7 +614,7 @@ const warnIfMenuPortalPropsAreMissing = props => {
|
|
|
604
614
|
};
|
|
605
615
|
|
|
606
616
|
// NOTE: This string will be replaced on build time with the package version.
|
|
607
|
-
var version = "
|
|
617
|
+
var version = "17.0.1";
|
|
608
618
|
|
|
609
619
|
exports.ClearIndicator = ClearIndicator$1;
|
|
610
620
|
exports.CustomSelectInputOption = CustomSelectInputOption;
|
|
@@ -255,6 +255,14 @@ var messages = reactIntl.defineMessages({
|
|
|
255
255
|
|
|
256
256
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
257
257
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context8, _context9; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context8 = ownKeys(Object(source), !0)).call(_context8, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context9 = ownKeys(Object(source))).call(_context9, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
258
|
+
const getHorizontalConstraintValue = value => {
|
|
259
|
+
switch (value) {
|
|
260
|
+
case 'auto':
|
|
261
|
+
return 'initial';
|
|
262
|
+
default:
|
|
263
|
+
return designSystem.designTokens["constraint".concat(value)] || designSystem.designTokens.constraintScale;
|
|
264
|
+
}
|
|
265
|
+
};
|
|
258
266
|
const getInputBackgroundColor = props => {
|
|
259
267
|
if (props.appearance === 'quiet') {
|
|
260
268
|
return designSystem.designTokens.backgroundColorForInputAsQuiet;
|
|
@@ -370,7 +378,8 @@ const menuStyles = props => base => {
|
|
|
370
378
|
return base.borderColorForInput;
|
|
371
379
|
})(),
|
|
372
380
|
width: props.horizontalConstraint === 'auto' ? 'auto' : '100%',
|
|
373
|
-
minWidth: designSystem.designTokens.constraint3
|
|
381
|
+
minWidth: props.minMenuWidth ? getHorizontalConstraintValue(props.minMenuWidth) : designSystem.designTokens.constraint3,
|
|
382
|
+
maxWidth: props.maxMenuWidth ? getHorizontalConstraintValue(props.maxMenuWidth) : designSystem.designTokens.constraintScale
|
|
374
383
|
});
|
|
375
384
|
};
|
|
376
385
|
const indicatorSeparatorStyles = () => base => {
|
|
@@ -496,8 +505,9 @@ const groupHeadingStyles = () => base => {
|
|
|
496
505
|
return _objectSpread(_objectSpread({}, base), {}, {
|
|
497
506
|
color: designSystem.designTokens.fontColorForInputWhenReadonly,
|
|
498
507
|
fontSize: designSystem.designTokens.fontSizeSmall,
|
|
508
|
+
borderBottom: "1px solid ".concat(designSystem.designTokens.borderColorForGroupHeadingSelectInputOptions),
|
|
499
509
|
textTransform: 'none',
|
|
500
|
-
fontWeight:
|
|
510
|
+
fontWeight: designSystem.designTokens.fontWeight500,
|
|
501
511
|
padding: _concatInstanceProperty__default["default"](_context4 = "".concat(designSystem.designTokens.spacing20, " ")).call(_context4, designSystem.designTokens.paddingForGroupHeadingSelectInputOptions),
|
|
502
512
|
'&:empty': {
|
|
503
513
|
padding: 0
|
|
@@ -601,7 +611,7 @@ const warnIfMenuPortalPropsAreMissing = props => {
|
|
|
601
611
|
};
|
|
602
612
|
|
|
603
613
|
// NOTE: This string will be replaced on build time with the package version.
|
|
604
|
-
var version = "
|
|
614
|
+
var version = "17.0.1";
|
|
605
615
|
|
|
606
616
|
exports.ClearIndicator = ClearIndicator$1;
|
|
607
617
|
exports.CustomSelectInputOption = CustomSelectInputOption;
|
|
@@ -235,6 +235,14 @@ var messages = defineMessages({
|
|
|
235
235
|
|
|
236
236
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
237
237
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context8, _context9; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context8 = ownKeys(Object(source), !0)).call(_context8, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context9 = ownKeys(Object(source))).call(_context9, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
238
|
+
const getHorizontalConstraintValue = value => {
|
|
239
|
+
switch (value) {
|
|
240
|
+
case 'auto':
|
|
241
|
+
return 'initial';
|
|
242
|
+
default:
|
|
243
|
+
return designTokens["constraint".concat(value)] || designTokens.constraintScale;
|
|
244
|
+
}
|
|
245
|
+
};
|
|
238
246
|
const getInputBackgroundColor = props => {
|
|
239
247
|
if (props.appearance === 'quiet') {
|
|
240
248
|
return designTokens.backgroundColorForInputAsQuiet;
|
|
@@ -350,7 +358,8 @@ const menuStyles = props => base => {
|
|
|
350
358
|
return base.borderColorForInput;
|
|
351
359
|
})(),
|
|
352
360
|
width: props.horizontalConstraint === 'auto' ? 'auto' : '100%',
|
|
353
|
-
minWidth: designTokens.constraint3
|
|
361
|
+
minWidth: props.minMenuWidth ? getHorizontalConstraintValue(props.minMenuWidth) : designTokens.constraint3,
|
|
362
|
+
maxWidth: props.maxMenuWidth ? getHorizontalConstraintValue(props.maxMenuWidth) : designTokens.constraintScale
|
|
354
363
|
});
|
|
355
364
|
};
|
|
356
365
|
const indicatorSeparatorStyles = () => base => {
|
|
@@ -476,8 +485,9 @@ const groupHeadingStyles = () => base => {
|
|
|
476
485
|
return _objectSpread(_objectSpread({}, base), {}, {
|
|
477
486
|
color: designTokens.fontColorForInputWhenReadonly,
|
|
478
487
|
fontSize: designTokens.fontSizeSmall,
|
|
488
|
+
borderBottom: "1px solid ".concat(designTokens.borderColorForGroupHeadingSelectInputOptions),
|
|
479
489
|
textTransform: 'none',
|
|
480
|
-
fontWeight:
|
|
490
|
+
fontWeight: designTokens.fontWeight500,
|
|
481
491
|
padding: _concatInstanceProperty(_context4 = "".concat(designTokens.spacing20, " ")).call(_context4, designTokens.paddingForGroupHeadingSelectInputOptions),
|
|
482
492
|
'&:empty': {
|
|
483
493
|
padding: 0
|
|
@@ -584,6 +594,6 @@ const warnIfMenuPortalPropsAreMissing = props => {
|
|
|
584
594
|
};
|
|
585
595
|
|
|
586
596
|
// NOTE: This string will be replaced on build time with the package version.
|
|
587
|
-
var version = "
|
|
597
|
+
var version = "17.0.1";
|
|
588
598
|
|
|
589
599
|
export { ClearIndicator$1 as ClearIndicator, CustomSelectInputOption, DoublePropertySelectInputOption, DropdownIndicator$1 as DropdownIndicator, MultiplePropertiesSelectInputOption, SELECT_DROPDOWN_OPTION_TYPES, SearchIconDropdownIndicator$1 as SearchIconDropdownIndicator, TagRemove$1 as TagRemove, WrapperWithIcon$1 as ValueWrapperWithIcon, createSelectStyles, customComponents as customComponentsWithIcons, messages, version, warnIfMenuPortalPropsAreMissing };
|
|
@@ -11,6 +11,8 @@ type TProps = {
|
|
|
11
11
|
hasValue?: boolean;
|
|
12
12
|
controlShouldRenderValue?: boolean;
|
|
13
13
|
appearance?: 'default' | 'quiet';
|
|
14
|
+
minMenuWidth?: 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 'scale' | 'auto';
|
|
15
|
+
maxMenuWidth?: 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 'scale' | 'auto';
|
|
14
16
|
horizontalConstraint?: 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 'scale' | 'auto';
|
|
15
17
|
};
|
|
16
18
|
type TBase = {
|
|
@@ -65,7 +67,8 @@ export default function createSelectStyles(props: TProps): {
|
|
|
65
67
|
margin: string;
|
|
66
68
|
borderColor: string | undefined;
|
|
67
69
|
width: string;
|
|
68
|
-
minWidth:
|
|
70
|
+
minWidth: string;
|
|
71
|
+
maxWidth: string;
|
|
69
72
|
fontColorForInput?: string | undefined;
|
|
70
73
|
borderColorForInput?: string | undefined;
|
|
71
74
|
color?: string | undefined;
|
|
@@ -275,8 +278,9 @@ export default function createSelectStyles(props: TProps): {
|
|
|
275
278
|
groupHeading: (base: TBase) => {
|
|
276
279
|
color: "var(--font-color-for-input-when-readonly, hsl(232, 18%, 40%))";
|
|
277
280
|
fontSize: "var(--font-size-small, 0.9231rem)";
|
|
281
|
+
borderBottom: string;
|
|
278
282
|
textTransform: string;
|
|
279
|
-
fontWeight:
|
|
283
|
+
fontWeight: "var(--font-weight-500, 500)";
|
|
280
284
|
padding: string;
|
|
281
285
|
'&:empty': {
|
|
282
286
|
padding: number;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-uikit/select-utils",
|
|
3
3
|
"description": "Utilities for working with select components.",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "17.0.1",
|
|
5
5
|
"bugs": "https://github.com/commercetools/ui-kit/issues",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@babel/runtime": "^7.20.13",
|
|
23
23
|
"@babel/runtime-corejs3": "^7.20.13",
|
|
24
|
-
"@commercetools-uikit/accessible-button": "
|
|
25
|
-
"@commercetools-uikit/design-system": "
|
|
26
|
-
"@commercetools-uikit/icons": "
|
|
27
|
-
"@commercetools-uikit/spacings": "
|
|
28
|
-
"@commercetools-uikit/text": "
|
|
29
|
-
"@commercetools-uikit/utils": "
|
|
24
|
+
"@commercetools-uikit/accessible-button": "17.0.1",
|
|
25
|
+
"@commercetools-uikit/design-system": "17.0.1",
|
|
26
|
+
"@commercetools-uikit/icons": "17.0.1",
|
|
27
|
+
"@commercetools-uikit/spacings": "17.0.1",
|
|
28
|
+
"@commercetools-uikit/text": "17.0.1",
|
|
29
|
+
"@commercetools-uikit/utils": "17.0.1",
|
|
30
30
|
"@emotion/react": "^11.10.5",
|
|
31
31
|
"@emotion/styled": "^11.10.5",
|
|
32
32
|
"lodash": "4.17.21",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"commercetools-uikit-select-utils.cjs.d.ts","sourceRoot":"","sources":["./declarations/src/index.d.ts"],"names":[],"mappings":"AAAA"}
|