@drivenets/design-system 0.0.3 → 0.0.4
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/CHANGELOG.md +6 -0
- package/dist/components/ds-alert-banner/ds-alert-banner.cjs +157 -52
- package/dist/components/ds-alert-banner/ds-alert-banner.d.cts +5 -5
- package/dist/components/ds-alert-banner/ds-alert-banner.d.cts.map +1 -1
- package/dist/components/ds-alert-banner/ds-alert-banner.js +157 -52
- package/dist/components/ds-alert-banner/ds-alert-banner.js.map +1 -1
- package/dist/components/ds-alert-banner/ds-alert-banner.types.d.cts.map +1 -1
- package/dist/components/ds-alert-banner/ds-alert-banner.types.js.map +1 -1
- package/dist/components/ds-breadcrumb/ds-breadcrumb.cjs +59 -16
- package/dist/components/ds-breadcrumb/ds-breadcrumb.js +59 -16
- package/dist/components/ds-breadcrumb/ds-breadcrumb.js.map +1 -1
- package/dist/components/ds-button/ds-button.cjs +18 -2
- package/dist/components/ds-button/ds-button.d.cts +2 -2
- package/dist/components/ds-button/ds-button.d.ts +2 -2
- package/dist/components/ds-button/ds-button.js +18 -2
- package/dist/components/ds-button/ds-button.js.map +1 -1
- package/dist/components/ds-button/versions/ds-button-legacy/ds-button-legacy.cjs +79 -10
- package/dist/components/ds-button/versions/ds-button-legacy/ds-button-legacy.js +79 -10
- package/dist/components/ds-button/versions/ds-button-legacy/ds-button-legacy.js.map +1 -1
- package/dist/components/ds-button/versions/ds-button-new/ds-button-new.cjs +78 -10
- package/dist/components/ds-button/versions/ds-button-new/ds-button-new.js +78 -10
- package/dist/components/ds-button/versions/ds-button-new/ds-button-new.js.map +1 -1
- package/dist/components/ds-checkbox/ds-checkbox.cjs +89 -18
- package/dist/components/ds-checkbox/ds-checkbox.js +89 -18
- package/dist/components/ds-checkbox/ds-checkbox.js.map +1 -1
- package/dist/components/ds-chip/ds-chip.cjs +100 -30
- package/dist/components/ds-chip/ds-chip.js +100 -30
- package/dist/components/ds-chip/ds-chip.js.map +1 -1
- package/dist/components/ds-chip-group/ds-chip-group.cjs +6 -6
- package/dist/components/ds-chip-group/ds-chip-group.js +6 -6
- package/dist/components/ds-chip-group/ds-chip-group.js.map +1 -1
- package/dist/components/ds-chip-group/hooks/use-chip-row-calculation.js.map +1 -1
- package/dist/components/ds-confirmation/ds-confirmation.cjs +210 -56
- package/dist/components/ds-confirmation/ds-confirmation.d.cts +8 -8
- package/dist/components/ds-confirmation/ds-confirmation.d.cts.map +1 -1
- package/dist/components/ds-confirmation/ds-confirmation.d.ts +8 -8
- package/dist/components/ds-confirmation/ds-confirmation.js +210 -56
- package/dist/components/ds-confirmation/ds-confirmation.js.map +1 -1
- package/dist/components/ds-dialog/ds-dialog.js.map +1 -1
- package/dist/components/ds-drawer/ds-drawer.cjs +261 -61
- package/dist/components/ds-drawer/ds-drawer.d.cts +9 -9
- package/dist/components/ds-drawer/ds-drawer.d.ts +9 -9
- package/dist/components/ds-drawer/ds-drawer.js +261 -61
- package/dist/components/ds-drawer/ds-drawer.js.map +1 -1
- package/dist/components/ds-dropdown-menu/ds-dropdown-menu.cjs +481 -135
- package/dist/components/ds-dropdown-menu/ds-dropdown-menu.js +481 -135
- package/dist/components/ds-dropdown-menu/ds-dropdown-menu.js.map +1 -1
- package/dist/components/ds-expandable-text-input/ds-expandable-text-input.cjs +146 -56
- package/dist/components/ds-expandable-text-input/ds-expandable-text-input.d.cts +2 -2
- package/dist/components/ds-expandable-text-input/ds-expandable-text-input.d.ts +2 -2
- package/dist/components/ds-expandable-text-input/ds-expandable-text-input.js +146 -56
- package/dist/components/ds-expandable-text-input/ds-expandable-text-input.js.map +1 -1
- package/dist/components/ds-file-upload/components/file-upload/file-upload.cjs +190 -69
- package/dist/components/ds-file-upload/components/file-upload/file-upload.js +190 -69
- package/dist/components/ds-file-upload/components/file-upload/file-upload.js.map +1 -1
- package/dist/components/ds-file-upload/components/file-upload-item/file-upload-item.cjs +273 -132
- package/dist/components/ds-file-upload/components/file-upload-item/file-upload-item.js +273 -132
- package/dist/components/ds-file-upload/components/file-upload-item/file-upload-item.js.map +1 -1
- package/dist/components/ds-file-upload/ds-file-upload.cjs +96 -16
- package/dist/components/ds-file-upload/ds-file-upload.js +96 -16
- package/dist/components/ds-file-upload/ds-file-upload.js.map +1 -1
- package/dist/components/ds-file-upload/errors/file-upload-errors.js.map +1 -1
- package/dist/components/ds-file-upload/hooks/use-file-upload.cjs +93 -93
- package/dist/components/ds-file-upload/hooks/use-file-upload.js +93 -93
- package/dist/components/ds-file-upload/hooks/use-file-upload.js.map +1 -1
- package/dist/components/ds-file-upload/types/accept-types.js.map +1 -1
- package/dist/components/ds-file-upload/utils/accept-utils.js.map +1 -1
- package/dist/components/ds-file-upload/utils/constants.js.map +1 -1
- package/dist/components/ds-file-upload/utils/file-factory.js.map +1 -1
- package/dist/components/ds-file-upload/utils/format-file-size.js.map +1 -1
- package/dist/components/ds-file-upload/utils/generate-helper-text.js.map +1 -1
- package/dist/components/ds-file-upload/utils/get-error-message.js.map +1 -1
- package/dist/components/ds-file-upload/utils/is-file-equal.js.map +1 -1
- package/dist/components/ds-form-control/ds-form-control.cjs +119 -34
- package/dist/components/ds-form-control/ds-form-control.d.cts +7 -7
- package/dist/components/ds-form-control/ds-form-control.d.ts +7 -7
- package/dist/components/ds-form-control/ds-form-control.d.ts.map +1 -1
- package/dist/components/ds-form-control/ds-form-control.js +119 -34
- package/dist/components/ds-form-control/ds-form-control.js.map +1 -1
- package/dist/components/ds-form-control/ds-form-control.types.js.map +1 -1
- package/dist/components/ds-grid/ds-grid.js.map +1 -1
- package/dist/components/ds-icon/ds-icon.cjs +84 -13
- package/dist/components/ds-icon/ds-icon.js +84 -13
- package/dist/components/ds-icon/ds-icon.js.map +1 -1
- package/dist/components/ds-icon/ds-icon.types.d.cts.map +1 -1
- package/dist/components/ds-icon/ds-icon.types.js.map +1 -1
- package/dist/components/ds-modal/ds-modal.cjs +222 -55
- package/dist/components/ds-modal/ds-modal.d.cts +8 -8
- package/dist/components/ds-modal/ds-modal.d.cts.map +1 -1
- package/dist/components/ds-modal/ds-modal.d.ts +8 -8
- package/dist/components/ds-modal/ds-modal.d.ts.map +1 -1
- package/dist/components/ds-modal/ds-modal.js +222 -55
- package/dist/components/ds-modal/ds-modal.js.map +1 -1
- package/dist/components/ds-number-input/ds-number-input.cjs +136 -49
- package/dist/components/ds-number-input/ds-number-input.js +136 -49
- package/dist/components/ds-number-input/ds-number-input.js.map +1 -1
- package/dist/components/ds-panel/ds-panel.cjs +111 -19
- package/dist/components/ds-panel/ds-panel.d.cts +2 -2
- package/dist/components/ds-panel/ds-panel.d.cts.map +1 -1
- package/dist/components/ds-panel/ds-panel.js +111 -19
- package/dist/components/ds-panel/ds-panel.js.map +1 -1
- package/dist/components/ds-password-input/ds-password-input.cjs +108 -41
- package/dist/components/ds-password-input/ds-password-input.js +108 -41
- package/dist/components/ds-password-input/ds-password-input.js.map +1 -1
- package/dist/components/ds-popover/ds-popover.cjs +50 -12
- package/dist/components/ds-popover/ds-popover.js +50 -12
- package/dist/components/ds-popover/ds-popover.js.map +1 -1
- package/dist/components/ds-radio-group/ds-radio-group.cjs +209 -53
- package/dist/components/ds-radio-group/ds-radio-group.js +209 -53
- package/dist/components/ds-radio-group/ds-radio-group.js.map +1 -1
- package/dist/components/ds-select/ds-select.cjs +198 -89
- package/dist/components/ds-select/ds-select.d.cts +2 -2
- package/dist/components/ds-select/ds-select.d.cts.map +1 -1
- package/dist/components/ds-select/ds-select.js +198 -89
- package/dist/components/ds-select/ds-select.js.map +1 -1
- package/dist/components/ds-select/select-items-chips.cjs +73 -22
- package/dist/components/ds-select/select-items-chips.js +73 -22
- package/dist/components/ds-select/select-items-chips.js.map +1 -1
- package/dist/components/ds-smart-tabs/ds-smart-tabs.cjs +208 -46
- package/dist/components/ds-smart-tabs/ds-smart-tabs.d.cts +2 -2
- package/dist/components/ds-smart-tabs/ds-smart-tabs.d.cts.map +1 -1
- package/dist/components/ds-smart-tabs/ds-smart-tabs.d.ts +2 -2
- package/dist/components/ds-smart-tabs/ds-smart-tabs.d.ts.map +1 -1
- package/dist/components/ds-smart-tabs/ds-smart-tabs.js +208 -46
- package/dist/components/ds-smart-tabs/ds-smart-tabs.js.map +1 -1
- package/dist/components/ds-smart-tabs/ds-smart-tabs.types.js.map +1 -1
- package/dist/components/ds-spinner/ds-spinner.cjs +90 -20
- package/dist/components/ds-spinner/ds-spinner.js +90 -20
- package/dist/components/ds-spinner/ds-spinner.js.map +1 -1
- package/dist/components/ds-spinner/ds-spinner.types.js.map +1 -1
- package/dist/components/ds-status-badge/ds-status-badge.cjs +54 -11
- package/dist/components/ds-status-badge/ds-status-badge.js +54 -11
- package/dist/components/ds-status-badge/ds-status-badge.js.map +1 -1
- package/dist/components/ds-stepper/components/ds-step-content.cjs +59 -13
- package/dist/components/ds-stepper/components/ds-step-content.d.cts +2 -2
- package/dist/components/ds-stepper/components/ds-step-content.d.ts +2 -2
- package/dist/components/ds-stepper/components/ds-step-content.js +59 -13
- package/dist/components/ds-stepper/components/ds-step-content.js.map +1 -1
- package/dist/components/ds-stepper/components/ds-step-description.cjs +14 -5
- package/dist/components/ds-stepper/components/ds-step-description.js +14 -5
- package/dist/components/ds-stepper/components/ds-step-description.js.map +1 -1
- package/dist/components/ds-stepper/components/ds-step-label.cjs +14 -5
- package/dist/components/ds-stepper/components/ds-step-label.js +14 -5
- package/dist/components/ds-stepper/components/ds-step-label.js.map +1 -1
- package/dist/components/ds-stepper/components/ds-step-next-button.cjs +23 -6
- package/dist/components/ds-stepper/components/ds-step-next-button.d.cts +2 -2
- package/dist/components/ds-stepper/components/ds-step-next-button.d.ts +2 -2
- package/dist/components/ds-stepper/components/ds-step-next-button.js +23 -6
- package/dist/components/ds-stepper/components/ds-step-next-button.js.map +1 -1
- package/dist/components/ds-stepper/components/ds-step.cjs +106 -25
- package/dist/components/ds-stepper/components/ds-step.d.cts +2 -2
- package/dist/components/ds-stepper/components/ds-step.d.ts +2 -2
- package/dist/components/ds-stepper/components/ds-step.js +106 -25
- package/dist/components/ds-stepper/components/ds-step.js.map +1 -1
- package/dist/components/ds-stepper/ds-stepper.cjs +62 -15
- package/dist/components/ds-stepper/ds-stepper.d.cts +2 -2
- package/dist/components/ds-stepper/ds-stepper.d.cts.map +1 -1
- package/dist/components/ds-stepper/ds-stepper.d.ts +2 -2
- package/dist/components/ds-stepper/ds-stepper.js +62 -15
- package/dist/components/ds-stepper/ds-stepper.js.map +1 -1
- package/dist/components/ds-stepper/hooks/use-stepper.js.map +1 -1
- package/dist/components/ds-stepper/hooks/use-steps.cjs +29 -9
- package/dist/components/ds-stepper/hooks/use-steps.js +29 -9
- package/dist/components/ds-stepper/hooks/use-steps.js.map +1 -1
- package/dist/components/ds-system-status/ds-system-status.cjs +37 -7
- package/dist/components/ds-system-status/ds-system-status.js +37 -7
- package/dist/components/ds-system-status/ds-system-status.js.map +1 -1
- package/dist/components/ds-system-status/ds-system-status.types.js.map +1 -1
- package/dist/components/ds-table/components/core-table/core-table.cjs +281 -48
- package/dist/components/ds-table/components/core-table/core-table.js +281 -48
- package/dist/components/ds-table/components/core-table/core-table.js.map +1 -1
- package/dist/components/ds-table/components/ds-table-bulk-actions/ds-table-bulk-actions.cjs +134 -50
- package/dist/components/ds-table/components/ds-table-bulk-actions/ds-table-bulk-actions.js +134 -50
- package/dist/components/ds-table/components/ds-table-bulk-actions/ds-table-bulk-actions.js.map +1 -1
- package/dist/components/ds-table/components/ds-table-cell/ds-table-cell.cjs +140 -43
- package/dist/components/ds-table/components/ds-table-cell/ds-table-cell.js +140 -43
- package/dist/components/ds-table/components/ds-table-cell/ds-table-cell.js.map +1 -1
- package/dist/components/ds-table/components/ds-table-header/ds-table-header.cjs +37 -6
- package/dist/components/ds-table/components/ds-table-header/ds-table-header.js +37 -6
- package/dist/components/ds-table/components/ds-table-header/ds-table-header.js.map +1 -1
- package/dist/components/ds-table/components/ds-table-row/ds-table-row.cjs +272 -100
- package/dist/components/ds-table/components/ds-table-row/ds-table-row.js +272 -100
- package/dist/components/ds-table/components/ds-table-row/ds-table-row.js.map +1 -1
- package/dist/components/ds-table/context/ds-table-context.js.map +1 -1
- package/dist/components/ds-table/ds-table.cjs +15 -15
- package/dist/components/ds-table/ds-table.d.cts +2 -2
- package/dist/components/ds-table/ds-table.js +15 -15
- package/dist/components/ds-table/ds-table.js.map +1 -1
- package/dist/components/ds-table/hooks/use-drag-and-drop.cjs +126 -38
- package/dist/components/ds-table/hooks/use-drag-and-drop.js +126 -38
- package/dist/components/ds-table/hooks/use-drag-and-drop.js.map +1 -1
- package/dist/components/ds-table/utils/column-styling.js.map +1 -1
- package/dist/components/ds-table/utils/create-columns-grid-template.js.map +1 -1
- package/dist/components/ds-table/utils/merge-refs.js.map +1 -1
- package/dist/components/ds-text-input/ds-text-input.cjs +128 -43
- package/dist/components/ds-text-input/ds-text-input.js +128 -43
- package/dist/components/ds-text-input/ds-text-input.js.map +1 -1
- package/dist/components/ds-text-input/ds-text-input.types.js.map +1 -1
- package/dist/components/ds-textarea/ds-textarea.cjs +66 -22
- package/dist/components/ds-textarea/ds-textarea.js +66 -22
- package/dist/components/ds-textarea/ds-textarea.js.map +1 -1
- package/dist/components/ds-toast/ds-toast-context.cjs +62 -17
- package/dist/components/ds-toast/ds-toast-context.js +62 -17
- package/dist/components/ds-toast/ds-toast-context.js.map +1 -1
- package/dist/components/ds-toast/ds-toast.cjs +90 -26
- package/dist/components/ds-toast/ds-toast.js +90 -26
- package/dist/components/ds-toast/ds-toast.js.map +1 -1
- package/dist/components/ds-tooltip/ds-tooltip.cjs +51 -13
- package/dist/components/ds-tooltip/ds-tooltip.js +51 -13
- package/dist/components/ds-tooltip/ds-tooltip.js.map +1 -1
- package/dist/components/ds-typography/ds-typography.cjs +51 -7
- package/dist/components/ds-typography/ds-typography.config.js.map +1 -1
- package/dist/components/ds-typography/ds-typography.js +51 -7
- package/dist/components/ds-typography/ds-typography.js.map +1 -1
- package/dist/components/ds-vertical-tabs/ds-vertical-tabs.cjs +91 -30
- package/dist/components/ds-vertical-tabs/ds-vertical-tabs.d.cts +5 -5
- package/dist/components/ds-vertical-tabs/ds-vertical-tabs.d.ts +5 -5
- package/dist/components/ds-vertical-tabs/ds-vertical-tabs.js +91 -30
- package/dist/components/ds-vertical-tabs/ds-vertical-tabs.js.map +1 -1
- package/dist/index.min.css +1 -1
- package/package.json +7 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
const require_ds_icon = require('../../../ds-icon/ds-icon.cjs');
|
|
3
3
|
const require_ds_button_new_module = require('./ds-button-new.module.cjs');
|
|
4
|
+
let react_compiler_runtime = require("react/compiler-runtime");
|
|
4
5
|
let classnames = require("classnames");
|
|
5
6
|
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
6
7
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -15,18 +16,85 @@ const isIconOnly = (children) => {
|
|
|
15
16
|
/**
|
|
16
17
|
* Design system Button component
|
|
17
18
|
*/
|
|
18
|
-
const DsButton = (
|
|
19
|
+
const DsButton = (t0) => {
|
|
20
|
+
const $ = (0, react_compiler_runtime.c)(26);
|
|
21
|
+
let buttonType;
|
|
22
|
+
let children;
|
|
23
|
+
let className;
|
|
24
|
+
let contentClassName;
|
|
25
|
+
let props;
|
|
26
|
+
let t1;
|
|
27
|
+
let t2;
|
|
28
|
+
let t3;
|
|
29
|
+
if ($[0] !== t0) {
|
|
30
|
+
({buttonType, variant: t1, size: t2, disabled: t3, className, contentClassName, children, ...props} = t0);
|
|
31
|
+
$[0] = t0;
|
|
32
|
+
$[1] = buttonType;
|
|
33
|
+
$[2] = children;
|
|
34
|
+
$[3] = className;
|
|
35
|
+
$[4] = contentClassName;
|
|
36
|
+
$[5] = props;
|
|
37
|
+
$[6] = t1;
|
|
38
|
+
$[7] = t2;
|
|
39
|
+
$[8] = t3;
|
|
40
|
+
} else {
|
|
41
|
+
buttonType = $[1];
|
|
42
|
+
children = $[2];
|
|
43
|
+
className = $[3];
|
|
44
|
+
contentClassName = $[4];
|
|
45
|
+
props = $[5];
|
|
46
|
+
t1 = $[6];
|
|
47
|
+
t2 = $[7];
|
|
48
|
+
t3 = $[8];
|
|
49
|
+
}
|
|
50
|
+
const variant = t1 === void 0 ? "filled" : t1;
|
|
51
|
+
const size = t2 === void 0 ? "medium" : t2;
|
|
52
|
+
const disabled = t3 === void 0 ? false : t3;
|
|
19
53
|
const type = buttonType ?? (variant === "ghost" ? "secondary" : "primary");
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
54
|
+
let t4;
|
|
55
|
+
if ($[9] !== children || $[10] !== className || $[11] !== disabled || $[12] !== size || $[13] !== type || $[14] !== variant) {
|
|
56
|
+
t4 = (0, classnames.default)(require_ds_button_new_module.default.button, { [require_ds_button_new_module.default.iconButton]: isIconOnly(children) }, require_ds_button_new_module.default[`${type}-${variant}`], require_ds_button_new_module.default[size], { [require_ds_button_new_module.default.disabled]: disabled }, className);
|
|
57
|
+
$[9] = children;
|
|
58
|
+
$[10] = className;
|
|
59
|
+
$[11] = disabled;
|
|
60
|
+
$[12] = size;
|
|
61
|
+
$[13] = type;
|
|
62
|
+
$[14] = variant;
|
|
63
|
+
$[15] = t4;
|
|
64
|
+
} else t4 = $[15];
|
|
65
|
+
const buttonClass = t4;
|
|
66
|
+
let t5;
|
|
67
|
+
if ($[16] !== contentClassName) {
|
|
68
|
+
t5 = (0, classnames.default)(require_ds_button_new_module.default.content, contentClassName);
|
|
69
|
+
$[16] = contentClassName;
|
|
70
|
+
$[17] = t5;
|
|
71
|
+
} else t5 = $[17];
|
|
72
|
+
let t6;
|
|
73
|
+
if ($[18] !== children || $[19] !== t5) {
|
|
74
|
+
t6 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
75
|
+
className: t5,
|
|
27
76
|
children
|
|
28
|
-
})
|
|
29
|
-
|
|
77
|
+
});
|
|
78
|
+
$[18] = children;
|
|
79
|
+
$[19] = t5;
|
|
80
|
+
$[20] = t6;
|
|
81
|
+
} else t6 = $[20];
|
|
82
|
+
let t7;
|
|
83
|
+
if ($[21] !== buttonClass || $[22] !== disabled || $[23] !== props || $[24] !== t6) {
|
|
84
|
+
t7 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
85
|
+
type: "button",
|
|
86
|
+
className: buttonClass,
|
|
87
|
+
disabled,
|
|
88
|
+
...props,
|
|
89
|
+
children: t6
|
|
90
|
+
});
|
|
91
|
+
$[21] = buttonClass;
|
|
92
|
+
$[22] = disabled;
|
|
93
|
+
$[23] = props;
|
|
94
|
+
$[24] = t6;
|
|
95
|
+
$[25] = t7;
|
|
96
|
+
} else t7 = $[25];
|
|
97
|
+
return t7;
|
|
30
98
|
};
|
|
31
99
|
var ds_button_new_default = DsButton;
|
|
32
100
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import ds_icon_default from "../../../ds-icon/ds-icon.js";
|
|
2
2
|
import ds_button_new_module_default from "./ds-button-new.module.js";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
3
4
|
import classNames from "classnames";
|
|
4
5
|
import { jsx } from "react/jsx-runtime";
|
|
5
6
|
import { Children, isValidElement } from "react";
|
|
@@ -13,18 +14,85 @@ const isIconOnly = (children) => {
|
|
|
13
14
|
/**
|
|
14
15
|
* Design system Button component
|
|
15
16
|
*/
|
|
16
|
-
const DsButton = (
|
|
17
|
+
const DsButton = (t0) => {
|
|
18
|
+
const $ = c(26);
|
|
19
|
+
let buttonType;
|
|
20
|
+
let children;
|
|
21
|
+
let className;
|
|
22
|
+
let contentClassName;
|
|
23
|
+
let props;
|
|
24
|
+
let t1;
|
|
25
|
+
let t2;
|
|
26
|
+
let t3;
|
|
27
|
+
if ($[0] !== t0) {
|
|
28
|
+
({buttonType, variant: t1, size: t2, disabled: t3, className, contentClassName, children, ...props} = t0);
|
|
29
|
+
$[0] = t0;
|
|
30
|
+
$[1] = buttonType;
|
|
31
|
+
$[2] = children;
|
|
32
|
+
$[3] = className;
|
|
33
|
+
$[4] = contentClassName;
|
|
34
|
+
$[5] = props;
|
|
35
|
+
$[6] = t1;
|
|
36
|
+
$[7] = t2;
|
|
37
|
+
$[8] = t3;
|
|
38
|
+
} else {
|
|
39
|
+
buttonType = $[1];
|
|
40
|
+
children = $[2];
|
|
41
|
+
className = $[3];
|
|
42
|
+
contentClassName = $[4];
|
|
43
|
+
props = $[5];
|
|
44
|
+
t1 = $[6];
|
|
45
|
+
t2 = $[7];
|
|
46
|
+
t3 = $[8];
|
|
47
|
+
}
|
|
48
|
+
const variant = t1 === void 0 ? "filled" : t1;
|
|
49
|
+
const size = t2 === void 0 ? "medium" : t2;
|
|
50
|
+
const disabled = t3 === void 0 ? false : t3;
|
|
17
51
|
const type = buttonType ?? (variant === "ghost" ? "secondary" : "primary");
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
52
|
+
let t4;
|
|
53
|
+
if ($[9] !== children || $[10] !== className || $[11] !== disabled || $[12] !== size || $[13] !== type || $[14] !== variant) {
|
|
54
|
+
t4 = classNames(ds_button_new_module_default.button, { [ds_button_new_module_default.iconButton]: isIconOnly(children) }, ds_button_new_module_default[`${type}-${variant}`], ds_button_new_module_default[size], { [ds_button_new_module_default.disabled]: disabled }, className);
|
|
55
|
+
$[9] = children;
|
|
56
|
+
$[10] = className;
|
|
57
|
+
$[11] = disabled;
|
|
58
|
+
$[12] = size;
|
|
59
|
+
$[13] = type;
|
|
60
|
+
$[14] = variant;
|
|
61
|
+
$[15] = t4;
|
|
62
|
+
} else t4 = $[15];
|
|
63
|
+
const buttonClass = t4;
|
|
64
|
+
let t5;
|
|
65
|
+
if ($[16] !== contentClassName) {
|
|
66
|
+
t5 = classNames(ds_button_new_module_default.content, contentClassName);
|
|
67
|
+
$[16] = contentClassName;
|
|
68
|
+
$[17] = t5;
|
|
69
|
+
} else t5 = $[17];
|
|
70
|
+
let t6;
|
|
71
|
+
if ($[18] !== children || $[19] !== t5) {
|
|
72
|
+
t6 = /* @__PURE__ */ jsx("span", {
|
|
73
|
+
className: t5,
|
|
25
74
|
children
|
|
26
|
-
})
|
|
27
|
-
|
|
75
|
+
});
|
|
76
|
+
$[18] = children;
|
|
77
|
+
$[19] = t5;
|
|
78
|
+
$[20] = t6;
|
|
79
|
+
} else t6 = $[20];
|
|
80
|
+
let t7;
|
|
81
|
+
if ($[21] !== buttonClass || $[22] !== disabled || $[23] !== props || $[24] !== t6) {
|
|
82
|
+
t7 = /* @__PURE__ */ jsx("button", {
|
|
83
|
+
type: "button",
|
|
84
|
+
className: buttonClass,
|
|
85
|
+
disabled,
|
|
86
|
+
...props,
|
|
87
|
+
children: t6
|
|
88
|
+
});
|
|
89
|
+
$[21] = buttonClass;
|
|
90
|
+
$[22] = disabled;
|
|
91
|
+
$[23] = props;
|
|
92
|
+
$[24] = t6;
|
|
93
|
+
$[25] = t7;
|
|
94
|
+
} else t7 = $[25];
|
|
95
|
+
return t7;
|
|
28
96
|
};
|
|
29
97
|
var ds_button_new_default = DsButton;
|
|
30
98
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ds-button-new.js","names":["DsIcon","DsButton
|
|
1
|
+
{"version":3,"file":"ds-button-new.js","names":["classNames","React","Children","isValidElement","styles","DsButtonProps","DsIcon","isIconOnly","children","ReactNode","count","childArray","toArray","onlyChild","type","DsButton","FC","t0","$","_c","buttonType","className","contentClassName","props","t1","t2","t3","variant","size","disabled","undefined","t4","button","iconButton","buttonClass","t5","content","t6","t7"],"sources":["../../../../../src/components/ds-button/versions/ds-button-new/ds-button-new.tsx"],"sourcesContent":["import classNames from 'classnames';\nimport type React from 'react';\nimport { Children, isValidElement } from 'react';\nimport styles from './ds-button-new.module.scss';\nimport type { DsButtonProps } from './ds-button-new.types';\nimport DsIcon from '../../../ds-icon/ds-icon';\n\nconst isIconOnly = (children: React.ReactNode) => {\n\tif (Children.count(children) !== 1) {\n\t\treturn false;\n\t}\n\n\tconst childArray = Children.toArray(children);\n\tconst onlyChild = childArray[0];\n\n\treturn isValidElement(onlyChild) && onlyChild.type === DsIcon;\n};\n\n/**\n * Design system Button component\n */\nconst DsButton: React.FC<DsButtonProps> = ({\n\tbuttonType,\n\tvariant = 'filled',\n\tsize = 'medium',\n\tdisabled = false,\n\tclassName,\n\tcontentClassName,\n\tchildren,\n\t...props\n}) => {\n\tconst type = buttonType ?? (variant === 'ghost' ? 'secondary' : 'primary');\n\tconst buttonClass = classNames(\n\t\tstyles.button,\n\t\t{ [styles.iconButton]: isIconOnly(children) },\n\t\tstyles[`${type}-${variant}`],\n\t\tstyles[size],\n\t\t{ [styles.disabled]: disabled },\n\t\tclassName,\n\t);\n\n\treturn (\n\t\t<button type=\"button\" className={buttonClass} disabled={disabled} {...props}>\n\t\t\t<span className={classNames(styles.content, contentClassName)}>{children}</span>\n\t\t</button>\n\t);\n};\n\nexport default DsButton;\n"],"mappings":";;;;;;;;AAOA,MAAMO,cAAcC,aAA8B;AACjD,KAAIN,SAASQ,MAAMF,SAAS,KAAK,EAChC,QAAO;CAIR,MAAMK,YADaX,SAASU,QAAQJ,SAAS,CAChB;AAE7B,QAAOL,eAAeU,UAAU,IAAIA,UAAUC,SAASR;;;;;AAMxD,MAAMS,YAAoCE,OAAA;CAAA,MAAAC,IAAAC,EAAA,GAAA;CAAA,IAAAC;CAAA,IAAAZ;CAAA,IAAAa;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;AAAA,KAAAR,EAAA,OAAAD,IAAA;AAAC,GAAA,CAAAG,YAAAO,SAAAH,IAAAI,MAAAH,IAAAI,UAAAH,IAAAL,WAAAC,kBAAAd,aAAAe,SAAAN;AAS1CC,IAAA,KAAAD;AAAAC,IAAA,KAAAE;AAAAF,IAAA,KAAAV;AAAAU,IAAA,KAAAG;AAAAH,IAAA,KAAAI;AAAAJ,IAAA,KAAAK;AAAAL,IAAA,KAAAM;AAAAN,IAAA,KAAAO;AAAAP,IAAA,KAAAQ;QAAA;AAAAN,eAAAF,EAAA;AAAAV,aAAAU,EAAA;AAAAG,cAAAH,EAAA;AAAAI,qBAAAJ,EAAA;AAAAK,UAAAL,EAAA;AAAAM,OAAAN,EAAA;AAAAO,OAAAP,EAAA;AAAAQ,OAAAR,EAAA;;CAPA,MAAAS,UAAAH,OAAAM,SAAA,WAAAN;CACA,MAAAI,OAAAH,OAAAK,SAAA,WAAAL;CACA,MAAAI,WAAAH,OAAAI,SAAA,QAAAJ;CAMA,MAAAZ,OAAaM,eAAeO,YAAY,UAAZ,cAAA;CAA+C,IAAAI;AAAA,KAAAb,EAAA,OAAAV,YAAAU,EAAA,QAAAG,aAAAH,EAAA,QAAAW,YAAAX,EAAA,QAAAU,QAAAV,EAAA,QAAAJ,QAAAI,EAAA,QAAAS,SAAA;AACvDI,OAAA/B,WACnBI,6BAAM4B,QACN,GAAG5B,6BAAM6B,aAAc1B,WAAWC,SAAQ,EAAG,EAC7CJ,6BAAO,GAAGU,KAAI,GAAIa,YAClBvB,6BAAOwB,OACP,GAAGxB,6BAAMyB,WAAYA,UAAU,EAC/BR,UACA;AAAAH,IAAA,KAAAV;AAAAU,IAAA,MAAAG;AAAAH,IAAA,MAAAW;AAAAX,IAAA,MAAAU;AAAAV,IAAA,MAAAJ;AAAAI,IAAA,MAAAS;AAAAT,IAAA,MAAAa;OAAAA,MAAAb,EAAA;CAPD,MAAAgB,cAAoBH;CAOlB,IAAAI;AAAA,KAAAjB,EAAA,QAAAI,kBAAA;AAIiBa,OAAAnC,WAAWI,6BAAMgC,SAAUd,iBAAiB;AAAAJ,IAAA,MAAAI;AAAAJ,IAAA,MAAAiB;OAAAA,MAAAjB,EAAA;CAAA,IAAAmB;AAAA,KAAAnB,EAAA,QAAAV,YAAAU,EAAA,QAAAiB,IAAA;AAA7DE,OAAA,oBAAA;GAAiB,WAAAF;GAA+C3B;IAAgB;AAAAU,IAAA,MAAAV;AAAAU,IAAA,MAAAiB;AAAAjB,IAAA,MAAAmB;OAAAA,MAAAnB,EAAA;CAAA,IAAAoB;AAAA,KAAApB,EAAA,QAAAgB,eAAAhB,EAAA,QAAAW,YAAAX,EAAA,QAAAK,SAAAL,EAAA,QAAAmB,IAAA;AADjFC,OAAA,oBAAA;GAAa,MAAA;GAAoBJ,WAAAA;GAAuBL;GAAQ,GAAMN;aACrEc;IACQ;AAAAnB,IAAA,MAAAgB;AAAAhB,IAAA,MAAAW;AAAAX,IAAA,MAAAK;AAAAL,IAAA,MAAAmB;AAAAnB,IAAA,MAAAoB;OAAAA,MAAApB,EAAA;AAAA,QAFToB;;AAMF,4BAAevB"}
|
|
@@ -2,6 +2,7 @@ const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
|
2
2
|
const require_ds_icon = require('../ds-icon/ds-icon.cjs');
|
|
3
3
|
require('../ds-icon/index.cjs');
|
|
4
4
|
const require_ds_checkbox_module = require('./ds-checkbox.module.cjs');
|
|
5
|
+
let react_compiler_runtime = require("react/compiler-runtime");
|
|
5
6
|
let classnames = require("classnames");
|
|
6
7
|
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
7
8
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -13,38 +14,108 @@ __radix_ui_react_checkbox = require_rolldown_runtime.__toESM(__radix_ui_react_ch
|
|
|
13
14
|
/**
|
|
14
15
|
* Design system Checkbox component
|
|
15
16
|
*/
|
|
16
|
-
const DsCheckbox = (
|
|
17
|
+
const DsCheckbox = (t0) => {
|
|
18
|
+
const $ = (0, react_compiler_runtime.c)(28);
|
|
19
|
+
let checked;
|
|
20
|
+
let className;
|
|
21
|
+
let defaultChecked;
|
|
22
|
+
let id;
|
|
23
|
+
let label;
|
|
24
|
+
let labelInfo;
|
|
25
|
+
let onCheckedChange;
|
|
26
|
+
let props;
|
|
27
|
+
if ($[0] !== t0) {
|
|
28
|
+
({id, label, labelInfo, className, checked, defaultChecked, onCheckedChange, ...props} = t0);
|
|
29
|
+
$[0] = t0;
|
|
30
|
+
$[1] = checked;
|
|
31
|
+
$[2] = className;
|
|
32
|
+
$[3] = defaultChecked;
|
|
33
|
+
$[4] = id;
|
|
34
|
+
$[5] = label;
|
|
35
|
+
$[6] = labelInfo;
|
|
36
|
+
$[7] = onCheckedChange;
|
|
37
|
+
$[8] = props;
|
|
38
|
+
} else {
|
|
39
|
+
checked = $[1];
|
|
40
|
+
className = $[2];
|
|
41
|
+
defaultChecked = $[3];
|
|
42
|
+
id = $[4];
|
|
43
|
+
label = $[5];
|
|
44
|
+
labelInfo = $[6];
|
|
45
|
+
onCheckedChange = $[7];
|
|
46
|
+
props = $[8];
|
|
47
|
+
}
|
|
17
48
|
const generatedId = (0, react.useId)();
|
|
18
49
|
const checkboxId = id || generatedId;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
50
|
+
let t1;
|
|
51
|
+
if ($[9] !== className) {
|
|
52
|
+
t1 = (0, classnames.default)(require_ds_checkbox_module.default.container, className);
|
|
53
|
+
$[9] = className;
|
|
54
|
+
$[10] = t1;
|
|
55
|
+
} else t1 = $[10];
|
|
56
|
+
const t2 = checked === "indeterminate" ? "check_indeterminate_small" : "check_small";
|
|
57
|
+
let t3;
|
|
58
|
+
if ($[11] !== t2) {
|
|
59
|
+
t3 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
60
|
+
className: require_ds_checkbox_module.default.checkboxWrapper,
|
|
61
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__radix_ui_react_checkbox.Indicator, {
|
|
62
|
+
className: require_ds_checkbox_module.default.checkboxIndicator,
|
|
63
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ds_icon.default, {
|
|
64
|
+
icon: t2,
|
|
65
|
+
size: "small",
|
|
66
|
+
variant: "outlined"
|
|
67
|
+
})
|
|
68
|
+
})
|
|
69
|
+
});
|
|
70
|
+
$[11] = t2;
|
|
71
|
+
$[12] = t3;
|
|
72
|
+
} else t3 = $[12];
|
|
73
|
+
let t4;
|
|
74
|
+
if ($[13] !== checkboxId || $[14] !== checked || $[15] !== defaultChecked || $[16] !== onCheckedChange || $[17] !== props || $[18] !== t3) {
|
|
75
|
+
t4 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__radix_ui_react_checkbox.Root, {
|
|
22
76
|
className: require_ds_checkbox_module.default.checkboxRoot,
|
|
23
77
|
id: checkboxId,
|
|
24
78
|
checked,
|
|
25
79
|
defaultChecked,
|
|
26
80
|
onCheckedChange,
|
|
27
81
|
...props,
|
|
28
|
-
children:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
82
|
+
children: t3
|
|
83
|
+
});
|
|
84
|
+
$[13] = checkboxId;
|
|
85
|
+
$[14] = checked;
|
|
86
|
+
$[15] = defaultChecked;
|
|
87
|
+
$[16] = onCheckedChange;
|
|
88
|
+
$[17] = props;
|
|
89
|
+
$[18] = t3;
|
|
90
|
+
$[19] = t4;
|
|
91
|
+
} else t4 = $[19];
|
|
92
|
+
let t5;
|
|
93
|
+
if ($[20] !== checkboxId || $[21] !== label || $[22] !== labelInfo) {
|
|
94
|
+
t5 = label && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
40
95
|
className: require_ds_checkbox_module.default.label,
|
|
41
96
|
htmlFor: checkboxId,
|
|
42
97
|
children: [label, labelInfo && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
43
98
|
className: require_ds_checkbox_module.default.labelInfo,
|
|
44
99
|
children: labelInfo
|
|
45
100
|
})]
|
|
46
|
-
})
|
|
47
|
-
|
|
101
|
+
});
|
|
102
|
+
$[20] = checkboxId;
|
|
103
|
+
$[21] = label;
|
|
104
|
+
$[22] = labelInfo;
|
|
105
|
+
$[23] = t5;
|
|
106
|
+
} else t5 = $[23];
|
|
107
|
+
let t6;
|
|
108
|
+
if ($[24] !== t1 || $[25] !== t4 || $[26] !== t5) {
|
|
109
|
+
t6 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
110
|
+
className: t1,
|
|
111
|
+
children: [t4, t5]
|
|
112
|
+
});
|
|
113
|
+
$[24] = t1;
|
|
114
|
+
$[25] = t4;
|
|
115
|
+
$[26] = t5;
|
|
116
|
+
$[27] = t6;
|
|
117
|
+
} else t6 = $[27];
|
|
118
|
+
return t6;
|
|
48
119
|
};
|
|
49
120
|
var ds_checkbox_default = DsCheckbox;
|
|
50
121
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import ds_icon_default from "../ds-icon/ds-icon.js";
|
|
2
2
|
import "../ds-icon/index.js";
|
|
3
3
|
import ds_checkbox_module_default from "./ds-checkbox.module.js";
|
|
4
|
+
import { c } from "react/compiler-runtime";
|
|
4
5
|
import classNames from "classnames";
|
|
5
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
7
|
import { useId } from "react";
|
|
@@ -10,38 +11,108 @@ import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
|
10
11
|
/**
|
|
11
12
|
* Design system Checkbox component
|
|
12
13
|
*/
|
|
13
|
-
const DsCheckbox = (
|
|
14
|
+
const DsCheckbox = (t0) => {
|
|
15
|
+
const $ = c(28);
|
|
16
|
+
let checked;
|
|
17
|
+
let className;
|
|
18
|
+
let defaultChecked;
|
|
19
|
+
let id;
|
|
20
|
+
let label;
|
|
21
|
+
let labelInfo;
|
|
22
|
+
let onCheckedChange;
|
|
23
|
+
let props;
|
|
24
|
+
if ($[0] !== t0) {
|
|
25
|
+
({id, label, labelInfo, className, checked, defaultChecked, onCheckedChange, ...props} = t0);
|
|
26
|
+
$[0] = t0;
|
|
27
|
+
$[1] = checked;
|
|
28
|
+
$[2] = className;
|
|
29
|
+
$[3] = defaultChecked;
|
|
30
|
+
$[4] = id;
|
|
31
|
+
$[5] = label;
|
|
32
|
+
$[6] = labelInfo;
|
|
33
|
+
$[7] = onCheckedChange;
|
|
34
|
+
$[8] = props;
|
|
35
|
+
} else {
|
|
36
|
+
checked = $[1];
|
|
37
|
+
className = $[2];
|
|
38
|
+
defaultChecked = $[3];
|
|
39
|
+
id = $[4];
|
|
40
|
+
label = $[5];
|
|
41
|
+
labelInfo = $[6];
|
|
42
|
+
onCheckedChange = $[7];
|
|
43
|
+
props = $[8];
|
|
44
|
+
}
|
|
14
45
|
const generatedId = useId();
|
|
15
46
|
const checkboxId = id || generatedId;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
47
|
+
let t1;
|
|
48
|
+
if ($[9] !== className) {
|
|
49
|
+
t1 = classNames(ds_checkbox_module_default.container, className);
|
|
50
|
+
$[9] = className;
|
|
51
|
+
$[10] = t1;
|
|
52
|
+
} else t1 = $[10];
|
|
53
|
+
const t2 = checked === "indeterminate" ? "check_indeterminate_small" : "check_small";
|
|
54
|
+
let t3;
|
|
55
|
+
if ($[11] !== t2) {
|
|
56
|
+
t3 = /* @__PURE__ */ jsx("div", {
|
|
57
|
+
className: ds_checkbox_module_default.checkboxWrapper,
|
|
58
|
+
children: /* @__PURE__ */ jsx(CheckboxPrimitive.Indicator, {
|
|
59
|
+
className: ds_checkbox_module_default.checkboxIndicator,
|
|
60
|
+
children: /* @__PURE__ */ jsx(ds_icon_default, {
|
|
61
|
+
icon: t2,
|
|
62
|
+
size: "small",
|
|
63
|
+
variant: "outlined"
|
|
64
|
+
})
|
|
65
|
+
})
|
|
66
|
+
});
|
|
67
|
+
$[11] = t2;
|
|
68
|
+
$[12] = t3;
|
|
69
|
+
} else t3 = $[12];
|
|
70
|
+
let t4;
|
|
71
|
+
if ($[13] !== checkboxId || $[14] !== checked || $[15] !== defaultChecked || $[16] !== onCheckedChange || $[17] !== props || $[18] !== t3) {
|
|
72
|
+
t4 = /* @__PURE__ */ jsx(CheckboxPrimitive.Root, {
|
|
19
73
|
className: ds_checkbox_module_default.checkboxRoot,
|
|
20
74
|
id: checkboxId,
|
|
21
75
|
checked,
|
|
22
76
|
defaultChecked,
|
|
23
77
|
onCheckedChange,
|
|
24
78
|
...props,
|
|
25
|
-
children:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
79
|
+
children: t3
|
|
80
|
+
});
|
|
81
|
+
$[13] = checkboxId;
|
|
82
|
+
$[14] = checked;
|
|
83
|
+
$[15] = defaultChecked;
|
|
84
|
+
$[16] = onCheckedChange;
|
|
85
|
+
$[17] = props;
|
|
86
|
+
$[18] = t3;
|
|
87
|
+
$[19] = t4;
|
|
88
|
+
} else t4 = $[19];
|
|
89
|
+
let t5;
|
|
90
|
+
if ($[20] !== checkboxId || $[21] !== label || $[22] !== labelInfo) {
|
|
91
|
+
t5 = label && /* @__PURE__ */ jsxs("label", {
|
|
37
92
|
className: ds_checkbox_module_default.label,
|
|
38
93
|
htmlFor: checkboxId,
|
|
39
94
|
children: [label, labelInfo && /* @__PURE__ */ jsx("div", {
|
|
40
95
|
className: ds_checkbox_module_default.labelInfo,
|
|
41
96
|
children: labelInfo
|
|
42
97
|
})]
|
|
43
|
-
})
|
|
44
|
-
|
|
98
|
+
});
|
|
99
|
+
$[20] = checkboxId;
|
|
100
|
+
$[21] = label;
|
|
101
|
+
$[22] = labelInfo;
|
|
102
|
+
$[23] = t5;
|
|
103
|
+
} else t5 = $[23];
|
|
104
|
+
let t6;
|
|
105
|
+
if ($[24] !== t1 || $[25] !== t4 || $[26] !== t5) {
|
|
106
|
+
t6 = /* @__PURE__ */ jsxs("div", {
|
|
107
|
+
className: t1,
|
|
108
|
+
children: [t4, t5]
|
|
109
|
+
});
|
|
110
|
+
$[24] = t1;
|
|
111
|
+
$[25] = t4;
|
|
112
|
+
$[26] = t5;
|
|
113
|
+
$[27] = t6;
|
|
114
|
+
} else t6 = $[27];
|
|
115
|
+
return t6;
|
|
45
116
|
};
|
|
46
117
|
var ds_checkbox_default = DsCheckbox;
|
|
47
118
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ds-checkbox.js","names":["
|
|
1
|
+
{"version":3,"file":"ds-checkbox.js","names":["React","useId","CheckboxPrimitive","classNames","styles","DsCheckboxProps","DsIcon","DsCheckbox","FC","t0","$","_c","checked","className","defaultChecked","id","label","labelInfo","onCheckedChange","props","generatedId","checkboxId","t1","container","t2","t3","checkboxWrapper","checkboxIndicator","t4","checkboxRoot","t5","t6"],"sources":["../../../src/components/ds-checkbox/ds-checkbox.tsx"],"sourcesContent":["import type React from 'react';\nimport { useId } from 'react';\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox';\nimport classNames from 'classnames';\nimport styles from './ds-checkbox.module.scss';\nimport type { DsCheckboxProps } from './ds-checkbox.types';\nimport { DsIcon } from '../ds-icon';\n\n/**\n * Design system Checkbox component\n */\nconst DsCheckbox: React.FC<DsCheckboxProps> = ({\n\tid,\n\tlabel,\n\tlabelInfo,\n\tclassName,\n\tchecked,\n\tdefaultChecked,\n\tonCheckedChange,\n\t...props\n}) => {\n\tconst generatedId = useId();\n\tconst checkboxId = id || generatedId;\n\n\treturn (\n\t\t<div className={classNames(styles.container, className)}>\n\t\t\t<CheckboxPrimitive.Root\n\t\t\t\tclassName={styles.checkboxRoot}\n\t\t\t\tid={checkboxId}\n\t\t\t\tchecked={checked}\n\t\t\t\tdefaultChecked={defaultChecked}\n\t\t\t\tonCheckedChange={onCheckedChange}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t<div className={styles.checkboxWrapper}>\n\t\t\t\t\t<CheckboxPrimitive.Indicator className={styles.checkboxIndicator}>\n\t\t\t\t\t\t<DsIcon\n\t\t\t\t\t\t\ticon={checked === 'indeterminate' ? 'check_indeterminate_small' : 'check_small'}\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\tvariant=\"outlined\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</CheckboxPrimitive.Indicator>\n\t\t\t\t</div>\n\t\t\t</CheckboxPrimitive.Root>\n\t\t\t{label && (\n\t\t\t\t<label className={styles.label} htmlFor={checkboxId}>\n\t\t\t\t\t{label}\n\t\t\t\t\t{labelInfo && <div className={styles.labelInfo}>{labelInfo}</div>}\n\t\t\t\t</label>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\nexport default DsCheckbox;\n"],"mappings":";;;;;;;;;;;;;AAWA,MAAMO,cAAwCE,OAAA;CAAA,MAAAC,IAAAC,EAAA,GAAA;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;AAAA,KAAAT,EAAA,OAAAD,IAAA;AAAC,GAAA,CAAAM,IAAAC,OAAAC,WAAAJ,WAAAD,SAAAE,gBAAAI,oBAAAC,SAAAV;AAS9CC,IAAA,KAAAD;AAAAC,IAAA,KAAAE;AAAAF,IAAA,KAAAG;AAAAH,IAAA,KAAAI;AAAAJ,IAAA,KAAAK;AAAAL,IAAA,KAAAM;AAAAN,IAAA,KAAAO;AAAAP,IAAA,KAAAQ;AAAAR,IAAA,KAAAS;QAAA;AAAAP,YAAAF,EAAA;AAAAG,cAAAH,EAAA;AAAAI,mBAAAJ,EAAA;AAAAK,OAAAL,EAAA;AAAAM,UAAAN,EAAA;AAAAO,cAAAP,EAAA;AAAAQ,oBAAAR,EAAA;AAAAS,UAAAT,EAAA;;CACA,MAAAU,cAAoBnB,OAAO;CAC3B,MAAAoB,aAAmBN,MAAAK;CAAkB,IAAAE;AAAA,KAAAZ,EAAA,OAAAG,WAAA;AAGpBS,OAAAnB,WAAWC,2BAAMmB,WAAYV,UAAU;AAAAH,IAAA,KAAAG;AAAAH,IAAA,MAAAY;OAAAA,MAAAZ,EAAA;CAY5C,MAAAc,KAAAZ,YAAY,kBAAZ,8BAAA;CAAyE,IAAAa;AAAA,KAAAf,EAAA,QAAAc,IAAA;AAHlFC,OAAA,oBAAA;GAAgB,WAAArB,2BAAMsB;aACrB,oBAAA,kBAAA;IAAwC,WAAAtB,2BAAMuB;cAC7C,oBAAC;KACM,MAAAH;KACD,MAAA;KACG,SAAA;MAEV;KACD;IAAM;AAAAd,IAAA,MAAAc;AAAAd,IAAA,MAAAe;OAAAA,MAAAf,EAAA;CAAA,IAAAkB;AAAA,KAAAlB,EAAA,QAAAW,cAAAX,EAAA,QAAAE,WAAAF,EAAA,QAAAI,kBAAAJ,EAAA,QAAAQ,mBAAAR,EAAA,QAAAS,SAAAT,EAAA,QAAAe,IAAA;AAhBPG,OAAA,oBAAA,kBAAA;GACY,WAAAxB,2BAAMyB;GACbR,IAAAA;GACKT;GACOE;GACCI;GAAe,GAC5BC;aAEJM;IASwB;AAAAf,IAAA,MAAAW;AAAAX,IAAA,MAAAE;AAAAF,IAAA,MAAAI;AAAAJ,IAAA,MAAAQ;AAAAR,IAAA,MAAAS;AAAAT,IAAA,MAAAe;AAAAf,IAAA,MAAAkB;OAAAA,MAAAlB,EAAA;CAAA,IAAAoB;AAAA,KAAApB,EAAA,QAAAW,cAAAX,EAAA,QAAAM,SAAAN,EAAA,QAAAO,WAAA;AACxBa,OAAAd,SACA,qBAAA;GAAkB,WAAAZ,2BAAMY;GAAiBK,SAAAA;cACvCL,OACAC,aAAa,oBAAA;IAAgB,WAAAb,2BAAMa;cAAaA;KAAe;IAEjE;AAAAP,IAAA,MAAAW;AAAAX,IAAA,MAAAM;AAAAN,IAAA,MAAAO;AAAAP,IAAA,MAAAoB;OAAAA,MAAApB,EAAA;CAAA,IAAAqB;AAAA,KAAArB,EAAA,QAAAY,MAAAZ,EAAA,QAAAkB,MAAAlB,EAAA,QAAAoB,IAAA;AAxBFC,OAAA,qBAAA;GAAgB,WAAAT;cACfM,IAkBCE;IAMI;AAAApB,IAAA,MAAAY;AAAAZ,IAAA,MAAAkB;AAAAlB,IAAA,MAAAoB;AAAApB,IAAA,MAAAqB;OAAAA,MAAArB,EAAA;AAAA,QAzBNqB;;AA6BF,0BAAexB"}
|
|
@@ -4,6 +4,7 @@ require('../ds-icon/index.cjs');
|
|
|
4
4
|
const require_ds_typography = require('../ds-typography/ds-typography.cjs');
|
|
5
5
|
require('../ds-typography/index.cjs');
|
|
6
6
|
const require_ds_chip_module = require('./ds-chip.module.cjs');
|
|
7
|
+
let react_compiler_runtime = require("react/compiler-runtime");
|
|
7
8
|
let classnames = require("classnames");
|
|
8
9
|
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
9
10
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -12,36 +13,73 @@ let react_jsx_runtime = require("react/jsx-runtime");
|
|
|
12
13
|
/**
|
|
13
14
|
* Design system Chip component
|
|
14
15
|
*/
|
|
15
|
-
const DsChip = (
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
};
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
16
|
+
const DsChip = (t0) => {
|
|
17
|
+
const $ = (0, react_compiler_runtime.c)(29);
|
|
18
|
+
const { ref, label, className, style: t1, onClick, onDelete, size: t2, deleteIcon, selected: t3 } = t0;
|
|
19
|
+
let t4;
|
|
20
|
+
if ($[0] !== t1) {
|
|
21
|
+
t4 = t1 === void 0 ? {} : t1;
|
|
22
|
+
$[0] = t1;
|
|
23
|
+
$[1] = t4;
|
|
24
|
+
} else t4 = $[1];
|
|
25
|
+
const style = t4;
|
|
26
|
+
const size = t2 === void 0 ? "medium" : t2;
|
|
27
|
+
const selected = t3 === void 0 ? false : t3;
|
|
28
|
+
const t5 = onClick !== void 0;
|
|
29
|
+
const t6 = size === "small";
|
|
30
|
+
let t7;
|
|
31
|
+
if ($[2] !== className || $[3] !== t5 || $[4] !== t6) {
|
|
32
|
+
t7 = (0, classnames.default)(require_ds_chip_module.default.chip, {
|
|
33
|
+
[require_ds_chip_module.default.clickable]: t5,
|
|
34
|
+
[require_ds_chip_module.default.small]: t6
|
|
35
|
+
}, className);
|
|
36
|
+
$[2] = className;
|
|
37
|
+
$[3] = t5;
|
|
38
|
+
$[4] = t6;
|
|
39
|
+
$[5] = t7;
|
|
40
|
+
} else t7 = $[5];
|
|
41
|
+
const chipClass = t7;
|
|
42
|
+
let t8;
|
|
43
|
+
if ($[6] !== onDelete) {
|
|
44
|
+
t8 = (event) => {
|
|
45
|
+
event.stopPropagation();
|
|
46
|
+
onDelete?.(event);
|
|
47
|
+
};
|
|
48
|
+
$[6] = onDelete;
|
|
49
|
+
$[7] = t8;
|
|
50
|
+
} else t8 = $[7];
|
|
51
|
+
const handleDeleteClick = t8;
|
|
52
|
+
let t9;
|
|
53
|
+
if ($[8] !== onDelete) {
|
|
54
|
+
t9 = (event_0) => {
|
|
55
|
+
if (onDelete && (event_0.key === "Backspace" || event_0.key === "Delete")) {
|
|
56
|
+
event_0.preventDefault();
|
|
57
|
+
onDelete(event_0);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
$[8] = onDelete;
|
|
61
|
+
$[9] = t9;
|
|
62
|
+
} else t9 = $[9];
|
|
63
|
+
const handleKeyDown = t9;
|
|
64
|
+
const t10 = ref;
|
|
65
|
+
const t11 = onClick || onDelete ? "button" : void 0;
|
|
66
|
+
const t12 = onClick || onDelete ? 0 : void 0;
|
|
67
|
+
const t13 = onClick && selected ? "true" : void 0;
|
|
68
|
+
const t14 = size === "small" ? "body-xs-reg" : "body-sm-reg";
|
|
69
|
+
let t15;
|
|
70
|
+
if ($[10] !== label || $[11] !== t14) {
|
|
71
|
+
t15 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ds_typography.default, {
|
|
72
|
+
variant: t14,
|
|
42
73
|
className: require_ds_chip_module.default.label,
|
|
43
74
|
children: label
|
|
44
|
-
})
|
|
75
|
+
});
|
|
76
|
+
$[10] = label;
|
|
77
|
+
$[11] = t14;
|
|
78
|
+
$[12] = t15;
|
|
79
|
+
} else t15 = $[12];
|
|
80
|
+
let t16;
|
|
81
|
+
if ($[13] !== deleteIcon || $[14] !== handleDeleteClick || $[15] !== onDelete) {
|
|
82
|
+
t16 = onDelete && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
45
83
|
type: "button",
|
|
46
84
|
className: require_ds_chip_module.default.deleteButton,
|
|
47
85
|
onClick: handleDeleteClick,
|
|
@@ -51,8 +89,40 @@ const DsChip = ({ ref, label, className, style = {}, onClick, onDelete, size = "
|
|
|
51
89
|
icon: deleteIcon || "cancel",
|
|
52
90
|
size: "tiny"
|
|
53
91
|
})
|
|
54
|
-
})
|
|
55
|
-
|
|
92
|
+
});
|
|
93
|
+
$[13] = deleteIcon;
|
|
94
|
+
$[14] = handleDeleteClick;
|
|
95
|
+
$[15] = onDelete;
|
|
96
|
+
$[16] = t16;
|
|
97
|
+
} else t16 = $[16];
|
|
98
|
+
let t17;
|
|
99
|
+
if ($[17] !== chipClass || $[18] !== handleKeyDown || $[19] !== label || $[20] !== onClick || $[21] !== style || $[22] !== t10 || $[23] !== t11 || $[24] !== t12 || $[25] !== t13 || $[26] !== t15 || $[27] !== t16) {
|
|
100
|
+
t17 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
101
|
+
ref: t10,
|
|
102
|
+
className: chipClass,
|
|
103
|
+
style,
|
|
104
|
+
onClick,
|
|
105
|
+
onKeyDown: handleKeyDown,
|
|
106
|
+
role: t11,
|
|
107
|
+
tabIndex: t12,
|
|
108
|
+
"aria-label": label,
|
|
109
|
+
"aria-pressed": t13,
|
|
110
|
+
children: [t15, t16]
|
|
111
|
+
});
|
|
112
|
+
$[17] = chipClass;
|
|
113
|
+
$[18] = handleKeyDown;
|
|
114
|
+
$[19] = label;
|
|
115
|
+
$[20] = onClick;
|
|
116
|
+
$[21] = style;
|
|
117
|
+
$[22] = t10;
|
|
118
|
+
$[23] = t11;
|
|
119
|
+
$[24] = t12;
|
|
120
|
+
$[25] = t13;
|
|
121
|
+
$[26] = t15;
|
|
122
|
+
$[27] = t16;
|
|
123
|
+
$[28] = t17;
|
|
124
|
+
} else t17 = $[28];
|
|
125
|
+
return t17;
|
|
56
126
|
};
|
|
57
127
|
var ds_chip_default = DsChip;
|
|
58
128
|
|