@popsure/dirty-swan 0.57.8 → 0.57.9
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/cjs/index.js +38 -37
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/lib/components/input/checkbox/index.d.ts +2 -1
- package/dist/cjs/lib/components/input/checkbox/index.stories.d.ts +11 -7
- package/dist/cjs/lib/components/input/radio/index.d.ts +3 -1
- package/dist/cjs/lib/components/input/radio/index.stories.d.ts +10 -2
- package/dist/esm/components/chip/index.js +2 -2
- package/dist/esm/components/chip/index.js.map +1 -1
- package/dist/esm/components/input/checkbox/index.js +16 -16
- package/dist/esm/components/input/checkbox/index.js.map +1 -1
- package/dist/esm/components/input/checkbox/index.stories.js +24 -20
- package/dist/esm/components/input/checkbox/index.stories.js.map +1 -1
- package/dist/esm/components/input/radio/index.js +23 -21
- package/dist/esm/components/input/radio/index.js.map +1 -1
- package/dist/esm/components/input/radio/index.stories.js +12 -3
- package/dist/esm/components/input/radio/index.stories.js.map +1 -1
- package/dist/esm/components/input/radio/index.test.js +1 -0
- package/dist/esm/components/input/radio/index.test.js.map +1 -1
- package/dist/esm/lib/components/input/checkbox/index.d.ts +2 -1
- package/dist/esm/lib/components/input/checkbox/index.stories.d.ts +11 -7
- package/dist/esm/lib/components/input/radio/index.d.ts +3 -1
- package/dist/esm/lib/components/input/radio/index.stories.d.ts +10 -2
- package/package.json +1 -1
- package/src/lib/components/chip/index.tsx +1 -0
- package/src/lib/components/chip/style.module.scss +5 -0
- package/src/lib/components/input/checkbox/index.stories.tsx +81 -58
- package/src/lib/components/input/checkbox/index.tsx +5 -2
- package/src/lib/components/input/checkbox/styles.module.scss +4 -0
- package/src/lib/components/input/radio/index.stories.tsx +17 -2
- package/src/lib/components/input/radio/index.tsx +11 -2
- package/src/lib/components/input/radio/styles.module.scss +5 -1
package/dist/cjs/index.js
CHANGED
|
@@ -8537,13 +8537,13 @@ var Badge = function (_a) {
|
|
|
8537
8537
|
return (jsxRuntime.jsx("div", { role: "status", className: classNames$1(className, 'px16 br8 d-inline-block ai-center fw-bold p-p', { 'p-p--small': size === 'small' }, styles$y["badge--".concat(size)], getVariantClassNames(variant)), children: children }));
|
|
8538
8538
|
};
|
|
8539
8539
|
|
|
8540
|
-
var css_248z$y = ".styles-module_container__3zJJC {\n max-width: 100%;\n}\n\n.styles-module_narrow__2p34b {\n max-width: 424px;\n}";
|
|
8540
|
+
var css_248z$y = ".styles-module_container__3zJJC {\n max-width: 100%;\n border: 0;\n margin: 0;\n min-width: 0;\n padding: 0.01em 0 0 0;\n}\n\n.styles-module_narrow__2p34b {\n max-width: 424px;\n}";
|
|
8541
8541
|
var styles$x = {"container":"styles-module_container__3zJJC","narrow":"styles-module_narrow__2p34b"};
|
|
8542
8542
|
styleInject(css_248z$y);
|
|
8543
8543
|
|
|
8544
8544
|
var Checkbox = function (_a) {
|
|
8545
8545
|
var _b;
|
|
8546
|
-
var options = _a.options, _c = _a.value, value = _c === void 0 ? [] : _c, onChange = _a.onChange, _d = _a.wide, wide = _d === void 0 ? false : _d, _e = _a.inlineLayout, inlineLayout = _e === void 0 ? false : _e, _f = _a.bordered, bordered = _f === void 0 ? true : _f, classNamesObj = _a.classNames;
|
|
8546
|
+
var options = _a.options, _c = _a.value, value = _c === void 0 ? [] : _c, onChange = _a.onChange, _d = _a.wide, wide = _d === void 0 ? false : _d, _e = _a.inlineLayout, inlineLayout = _e === void 0 ? false : _e, _f = _a.bordered, bordered = _f === void 0 ? true : _f, classNamesObj = _a.classNames, _g = _a.fieldLegend, fieldLegend = _g === void 0 ? 'Select one or more options' : _g;
|
|
8547
8547
|
var hasNoneValue = Object.keys(options).includes('NONE');
|
|
8548
8548
|
var handleOnChange = function (newValue) {
|
|
8549
8549
|
if (value === null || value === void 0 ? void 0 : value.includes(newValue)) {
|
|
@@ -8568,56 +8568,57 @@ var Checkbox = function (_a) {
|
|
|
8568
8568
|
var isCheckboxLabelObject = function (label) {
|
|
8569
8569
|
return label.title !== undefined;
|
|
8570
8570
|
};
|
|
8571
|
-
return (jsxRuntime.
|
|
8571
|
+
return (jsxRuntime.jsxs("fieldset", { className: classNames$1(classNamesObj === null || classNamesObj === void 0 ? void 0 : classNamesObj.container, styles$x.container, 'd-flex gap8', (_b = {},
|
|
8572
8572
|
_b[styles$x.narrow] = !wide,
|
|
8573
8573
|
_b['fd-row'] = inlineLayout,
|
|
8574
8574
|
_b['f-wrap'] = inlineLayout,
|
|
8575
8575
|
_b['fd-column'] = !inlineLayout,
|
|
8576
|
-
_b)), children: entries.map(function (_a) {
|
|
8577
|
-
|
|
8578
|
-
|
|
8579
|
-
|
|
8580
|
-
|
|
8581
|
-
|
|
8582
|
-
|
|
8583
|
-
|
|
8584
|
-
|
|
8585
|
-
|
|
8586
|
-
|
|
8587
|
-
|
|
8576
|
+
_b)), children: [jsxRuntime.jsx("legend", { className: "sr-only", children: fieldLegend }), entries.map(function (_a) {
|
|
8577
|
+
var currentValue = _a[0], label = _a[1];
|
|
8578
|
+
var checked = value === null || value === void 0 ? void 0 : value.includes(currentValue);
|
|
8579
|
+
var customIcon = label === null || label === void 0 ? void 0 : label.icon;
|
|
8580
|
+
return (jsxRuntime.jsxs("div", { className: classNamesObj === null || classNamesObj === void 0 ? void 0 : classNamesObj.option, children: [jsxRuntime.jsx("input", { className: classNames$1('p-checkbox', {
|
|
8581
|
+
'p-checkbox--no-icon': customIcon,
|
|
8582
|
+
}), id: currentValue, type: "checkbox", value: currentValue, onChange: function () { return handleOnChange(currentValue); }, checked: checked, "data-testid": "checkbox-input-".concat(currentValue) }), jsxRuntime.jsxs("label", { htmlFor: currentValue, className: classNames$1(classNamesObj === null || classNamesObj === void 0 ? void 0 : classNamesObj.label, 'p-label pr16', {
|
|
8583
|
+
'p-label--bordered': bordered,
|
|
8584
|
+
'jc-center': customIcon,
|
|
8585
|
+
'fd-column': customIcon,
|
|
8586
|
+
}), "data-cy": "checkbox-".concat(currentValue), "data-testid": "checkbox-".concat(currentValue), children: [customIcon && jsxRuntime.jsx("div", { className: "mt8", children: customIcon === null || customIcon === void 0 ? void 0 : customIcon(checked) }), isCheckboxLabelObject(label) ? (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("p", { className: "p-p", children: label.title }), jsxRuntime.jsx("span", { className: "d-block p-p p-p--small tc-grey-600", children: label.description })] })) : (label)] })] }, currentValue));
|
|
8587
|
+
})] }));
|
|
8588
8588
|
};
|
|
8589
8589
|
|
|
8590
|
-
var css_248z$x = ".styles-module_container__3M-sc {\n max-width: 100%;\n}\n\n.styles-module_narrow__3VUzp {\n max-width: 424px;\n}\n\n.styles-module_wide__3nLhz {\n max-width: 736px;\n}";
|
|
8590
|
+
var css_248z$x = ".styles-module_container__3M-sc {\n max-width: 100%;\n border: 0;\n margin: 0;\n min-width: 0;\n padding: 0.01em 0 0 0;\n}\n\n.styles-module_narrow__3VUzp {\n max-width: 424px;\n}\n\n.styles-module_wide__3nLhz {\n max-width: 736px;\n}";
|
|
8591
8591
|
var styles$w = {"container":"styles-module_container__3M-sc","narrow":"styles-module_narrow__3VUzp","wide":"styles-module_wide__3nLhz"};
|
|
8592
8592
|
styleInject(css_248z$x);
|
|
8593
8593
|
|
|
8594
8594
|
var Radio = function (_a) {
|
|
8595
8595
|
var _b;
|
|
8596
|
-
var options = _a.options, value = _a.value, onChange = _a.onChange, _c = _a.wide, wide = _c === void 0 ? false : _c, _d = _a.inlineLayout, inlineLayout = _d === void 0 ? false : _d, _e = _a.inlineIcon, inlineIcon = _e === void 0 ? false : _e, classNamesObj = _a.classNames, _f = _a.bordered, bordered = _f === void 0 ? true : _f, _g = _a.disabled, disabled = _g === void 0 ? false : _g;
|
|
8596
|
+
var options = _a.options, value = _a.value, onChange = _a.onChange, _c = _a.wide, wide = _c === void 0 ? false : _c, _d = _a.inlineLayout, inlineLayout = _d === void 0 ? false : _d, _e = _a.inlineIcon, inlineIcon = _e === void 0 ? false : _e, classNamesObj = _a.classNames, _f = _a.bordered, bordered = _f === void 0 ? true : _f, _g = _a.disabled, disabled = _g === void 0 ? false : _g, _h = _a.fieldLegend, fieldLegend = _h === void 0 ? 'Select an option' : _h, groupName = _a.groupName;
|
|
8597
8597
|
var entries = Object.entries(options);
|
|
8598
|
-
|
|
8598
|
+
var name = groupName !== null && groupName !== void 0 ? groupName : generateId();
|
|
8599
|
+
return (jsxRuntime.jsxs("fieldset", { className: classNames$1(classNamesObj === null || classNamesObj === void 0 ? void 0 : classNamesObj.container, styles$w.container, 'd-flex gap8', (_b = {},
|
|
8599
8600
|
_b[styles$w.wide] = wide,
|
|
8600
8601
|
_b[styles$w.narrow] = !wide,
|
|
8601
8602
|
_b['fd-row'] = inlineLayout,
|
|
8602
8603
|
_b['f-wrap'] = inlineLayout,
|
|
8603
8604
|
_b['fd-column'] = !inlineLayout,
|
|
8604
|
-
_b)), children: entries.map(function (_a) {
|
|
8605
|
-
|
|
8606
|
-
|
|
8607
|
-
|
|
8608
|
-
|
|
8609
|
-
|
|
8610
|
-
|
|
8611
|
-
|
|
8612
|
-
|
|
8613
|
-
|
|
8614
|
-
|
|
8615
|
-
|
|
8616
|
-
|
|
8617
|
-
|
|
8618
|
-
|
|
8619
|
-
|
|
8620
|
-
|
|
8605
|
+
_b)), children: [jsxRuntime.jsx("legend", { className: "sr-only", children: fieldLegend }), entries.map(function (_a) {
|
|
8606
|
+
var currentValue = _a[0], label = _a[1];
|
|
8607
|
+
var checked = value === currentValue;
|
|
8608
|
+
var customIcon = label === null || label === void 0 ? void 0 : label.icon;
|
|
8609
|
+
var hideIcon = label === null || label === void 0 ? void 0 : label.hideBox;
|
|
8610
|
+
var isRadioLabelObject = function (label) {
|
|
8611
|
+
return label.title !== undefined;
|
|
8612
|
+
};
|
|
8613
|
+
return (jsxRuntime.jsxs("div", { className: classNamesObj === null || classNamesObj === void 0 ? void 0 : classNamesObj.option, children: [jsxRuntime.jsx("input", { className: classNames$1('p-radio', {
|
|
8614
|
+
'p-radio--no-icon': customIcon || hideIcon,
|
|
8615
|
+
'p-radio--centered': !label,
|
|
8616
|
+
}), id: currentValue, type: "radio", value: currentValue, onChange: function () { return onChange(currentValue); }, checked: checked, "data-testid": "radio-input-".concat(currentValue), disabled: disabled, name: name }), jsxRuntime.jsxs("label", { htmlFor: currentValue, className: classNames$1(classNamesObj === null || classNamesObj === void 0 ? void 0 : classNamesObj.label, 'p-label', {
|
|
8617
|
+
'jc-center': customIcon && !inlineIcon,
|
|
8618
|
+
'fd-column': customIcon && !inlineIcon,
|
|
8619
|
+
'p-label--bordered': bordered,
|
|
8620
|
+
}), "data-cy": "radio-".concat(currentValue), "data-testid": "radio-".concat(currentValue), children: [customIcon && (jsxRuntime.jsx("div", { className: classNames$1('d-inline-flex ai-center jc-center', inlineIcon ? 'mr8' : 'mt8'), children: customIcon === null || customIcon === void 0 ? void 0 : customIcon(checked) })), isRadioLabelObject(label) ? (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("p", { className: "p-p", children: label.title }), jsxRuntime.jsx("span", { className: "d-block p-p p-p--small tc-grey-600", children: label.description })] })) : (label)] })] }, currentValue));
|
|
8621
|
+
})] }));
|
|
8621
8622
|
};
|
|
8622
8623
|
|
|
8623
8624
|
var css_248z$w = "@keyframes style-module_appear-in__3U2lu {\n 0% {\n transform: translateY(100%);\n }\n 80% {\n transform: translateY(-2%);\n }\n 100% {\n transform: translateY(0);\n }\n}\n@keyframes style-module_disappear-out__6pOVr {\n 0% {\n transform: translateY(0);\n }\n 100% {\n transform: translateY(100%);\n }\n}\n.style-module_wrapper__200Xu {\n position: relative;\n top: 0;\n overflow: hidden;\n}\n\n.style-module_container__aOENo {\n border-top-left-radius: 8px;\n border-top-right-radius: 8px;\n overflow: auto;\n max-height: 90vh;\n bottom: 0;\n position: fixed;\n animation-name: style-module_appear-in__3U2lu;\n animation-duration: 0.4s;\n animation-fill-mode: both;\n animation-timing-function: ease-in;\n}\n.style-module_containerClose__3-nqc {\n animation-name: style-module_disappear-out__6pOVr;\n animation-duration: 0.4s;\n animation-delay: 0s;\n animation-fill-mode: both;\n animation-timing-function: ease-out;\n}\n\n@media (max-width: 34rem) {\n .style-module_body__3yNly {\n padding-bottom: 48px;\n }\n}";
|
|
@@ -11604,13 +11605,13 @@ var associatedClassForCardState = function (state, dropshadow) {
|
|
|
11604
11605
|
return baseClass;
|
|
11605
11606
|
};
|
|
11606
11607
|
|
|
11607
|
-
var css_248z$o = ".style-module_chip__3LMgV {\n background: var(--ds-primary-100);\n border: 2px solid var(--ds-primary-100);\n border-radius: 8px;\n padding: 4px 8px;\n width: fit-content;\n width: -moz-fit-content;\n display: flex;\n align-items: center;\n animation-name: style-module_appearInAnimation__33Ebn;\n animation-duration: 0.5s;\n animation-fill-mode: both;\n}\n\n.style-module_chip__3LMgV:hover {\n transition: 0.2s ease-in;\n border: 2px solid var(--ds-primary-500);\n}\n\n.style-module_chip-image__2vVqF {\n width: 24px;\n height: 14px;\n}\n\n.style-module_chip-button-container__3gSRY {\n color: #b1b0f5;\n position: relative;\n width: 16px;\n height: 16px;\n background: none;\n border: none;\n padding: 0;\n margin: 0;\n text-align: inherit;\n outline: none;\n box-shadow: none;\n appearance: none;\n -webkit-appearance: none;\n -moz-appearance: none;\n cursor: pointer;\n}\n.style-module_chip-button-container__3gSRY:hover {\n color: #8e8cee;\n}\n\n.style-module_chip-remove-button__3LK7e {\n margin: 0;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.style-module_chip-remove-button__3LK7e svg {\n vertical-align: top;\n}\n\n@keyframes style-module_appearInAnimation__33Ebn {\n from {\n opacity: 0;\n transform: translateX(16px);\n }\n to {\n opacity: 1;\n }\n}";
|
|
11608
|
+
var css_248z$o = ".style-module_chip__3LMgV {\n background: var(--ds-primary-100);\n border: 2px solid var(--ds-primary-100);\n border-radius: 8px;\n padding: 4px 8px;\n width: fit-content;\n width: -moz-fit-content;\n display: flex;\n align-items: center;\n animation-name: style-module_appearInAnimation__33Ebn;\n animation-duration: 0.5s;\n animation-fill-mode: both;\n}\n\n.style-module_chip__3LMgV:hover {\n transition: 0.2s ease-in;\n border: 2px solid var(--ds-primary-500);\n}\n\n.style-module_chip-image__2vVqF {\n width: 24px;\n height: 14px;\n}\n\n.style-module_chip-button-container__3gSRY {\n color: #b1b0f5;\n position: relative;\n width: 16px;\n height: 16px;\n background: none;\n border: none;\n padding: 0;\n margin: 0;\n text-align: inherit;\n outline: none;\n box-shadow: none;\n appearance: none;\n -webkit-appearance: none;\n -moz-appearance: none;\n cursor: pointer;\n}\n.style-module_chip-button-container__3gSRY:hover {\n color: #8e8cee;\n}\n.style-module_chip-button-container__3gSRY:focus-visible {\n outline: 2px solid var(--ds-primary-500);\n border-radius: 2px;\n}\n\n.style-module_chip-remove-button__3LK7e {\n margin: 0;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.style-module_chip-remove-button__3LK7e svg {\n vertical-align: top;\n}\n\n@keyframes style-module_appearInAnimation__33Ebn {\n from {\n opacity: 0;\n transform: translateX(16px);\n }\n to {\n opacity: 1;\n }\n}";
|
|
11608
11609
|
var styles$n = {"chip":"style-module_chip__3LMgV","appearInAnimation":"style-module_appearInAnimation__33Ebn","chip-image":"style-module_chip-image__2vVqF","chip-button-container":"style-module_chip-button-container__3gSRY","chip-remove-button":"style-module_chip-remove-button__3LK7e"};
|
|
11609
11610
|
styleInject(css_248z$o);
|
|
11610
11611
|
|
|
11611
11612
|
var Chip = (function (_a) {
|
|
11612
11613
|
var className = _a.className, value = _a.value, onRemove = _a.onRemove;
|
|
11613
|
-
return (jsxRuntime.jsxs("div", { className: "p-p mr8 mb8 d-flex ".concat(className, " ").concat(styles$n['chip']), children: [value.leftIcon && (jsxRuntime.jsx("img", { className: "mr8 ".concat(styles$n['chip-image']), src: value.leftIcon, alt: value.value })), jsxRuntime.jsx("div", { className: "mr8", children: value.value }), jsxRuntime.jsx("button", { className: "c-pointer ".concat(styles$n['chip-button-container']), type: "button", onClick: function () { return onRemove(value); }, children: jsxRuntime.jsx(XIcon, { className: styles$n['chip-remove-button'] }) })] }));
|
|
11614
|
+
return (jsxRuntime.jsxs("div", { className: "p-p mr8 mb8 d-flex ".concat(className, " ").concat(styles$n['chip']), children: [value.leftIcon && (jsxRuntime.jsx("img", { className: "mr8 ".concat(styles$n['chip-image']), src: value.leftIcon, alt: value.value })), jsxRuntime.jsx("div", { className: "mr8", children: value.value }), jsxRuntime.jsx("button", { className: "c-pointer ".concat(styles$n['chip-button-container']), type: "button", onClick: function () { return onRemove(value); }, "aria-label": "Remove ".concat(value.value, " option"), children: jsxRuntime.jsx(XIcon, { className: styles$n['chip-remove-button'] }) })] }));
|
|
11614
11615
|
});
|
|
11615
11616
|
|
|
11616
11617
|
var Autosuggest = {};
|