@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,5 +1,5 @@
|
|
|
1
1
|
import { DsConfirmationProps } from "./ds-confirmation.types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime27 from "react/jsx-runtime";
|
|
3
3
|
import { CSSProperties, ReactNode } from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/components/ds-confirmation/ds-confirmation.d.ts
|
|
@@ -13,7 +13,7 @@ declare const DsConfirmation: {
|
|
|
13
13
|
style,
|
|
14
14
|
className,
|
|
15
15
|
children
|
|
16
|
-
}: DsConfirmationProps):
|
|
16
|
+
}: DsConfirmationProps): react_jsx_runtime27.JSX.Element;
|
|
17
17
|
Header: ({
|
|
18
18
|
style,
|
|
19
19
|
className,
|
|
@@ -22,7 +22,7 @@ declare const DsConfirmation: {
|
|
|
22
22
|
style?: CSSProperties;
|
|
23
23
|
className?: string;
|
|
24
24
|
children: ReactNode;
|
|
25
|
-
}) =>
|
|
25
|
+
}) => react_jsx_runtime27.JSX.Element;
|
|
26
26
|
Title: ({
|
|
27
27
|
style,
|
|
28
28
|
className,
|
|
@@ -31,14 +31,14 @@ declare const DsConfirmation: {
|
|
|
31
31
|
style?: CSSProperties;
|
|
32
32
|
className?: string;
|
|
33
33
|
children: ReactNode;
|
|
34
|
-
}) =>
|
|
34
|
+
}) => react_jsx_runtime27.JSX.Element;
|
|
35
35
|
CloseTrigger: ({
|
|
36
36
|
style,
|
|
37
37
|
className
|
|
38
38
|
}: {
|
|
39
39
|
style?: CSSProperties;
|
|
40
40
|
className?: string;
|
|
41
|
-
}) =>
|
|
41
|
+
}) => react_jsx_runtime27.JSX.Element;
|
|
42
42
|
Body: ({
|
|
43
43
|
style,
|
|
44
44
|
className,
|
|
@@ -47,7 +47,7 @@ declare const DsConfirmation: {
|
|
|
47
47
|
style?: CSSProperties;
|
|
48
48
|
className?: string;
|
|
49
49
|
children: ReactNode;
|
|
50
|
-
}) =>
|
|
50
|
+
}) => react_jsx_runtime27.JSX.Element;
|
|
51
51
|
Footer: ({
|
|
52
52
|
style,
|
|
53
53
|
className,
|
|
@@ -56,7 +56,7 @@ declare const DsConfirmation: {
|
|
|
56
56
|
style?: CSSProperties;
|
|
57
57
|
className?: string;
|
|
58
58
|
children: ReactNode;
|
|
59
|
-
}) =>
|
|
59
|
+
}) => react_jsx_runtime27.JSX.Element;
|
|
60
60
|
Actions: ({
|
|
61
61
|
style,
|
|
62
62
|
className,
|
|
@@ -65,7 +65,7 @@ declare const DsConfirmation: {
|
|
|
65
65
|
style?: CSSProperties;
|
|
66
66
|
className?: string;
|
|
67
67
|
children: ReactNode;
|
|
68
|
-
}) =>
|
|
68
|
+
}) => react_jsx_runtime27.JSX.Element;
|
|
69
69
|
};
|
|
70
70
|
//#endregion
|
|
71
71
|
export { DsConfirmation };
|
|
@@ -2,6 +2,7 @@ import ds_icon_default from "../ds-icon/ds-icon.js";
|
|
|
2
2
|
import "../ds-icon/index.js";
|
|
3
3
|
import ds_typography_default from "../ds-typography/ds-typography.js";
|
|
4
4
|
import ds_confirmation_module_default from "./ds-confirmation.module.js";
|
|
5
|
+
import { c } from "react/compiler-runtime";
|
|
5
6
|
import classNames from "classnames";
|
|
6
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
8
|
import { Portal } from "@ark-ui/react/portal";
|
|
@@ -11,63 +12,216 @@ import { Dialog } from "@ark-ui/react/dialog";
|
|
|
11
12
|
/**
|
|
12
13
|
* Composable confirmation modal dialog.
|
|
13
14
|
*/
|
|
14
|
-
const DsConfirmation = (
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
15
|
+
const DsConfirmation = (t0) => {
|
|
16
|
+
const $ = c(15);
|
|
17
|
+
const { open, onOpenChange, style, className, children } = t0;
|
|
18
|
+
let t1;
|
|
19
|
+
if ($[0] !== onOpenChange) {
|
|
20
|
+
t1 = (details) => {
|
|
21
|
+
onOpenChange(details.open);
|
|
22
|
+
};
|
|
23
|
+
$[0] = onOpenChange;
|
|
24
|
+
$[1] = t1;
|
|
25
|
+
} else t1 = $[1];
|
|
26
|
+
const handleOpenChange = t1;
|
|
27
|
+
let t2;
|
|
28
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
29
|
+
t2 = /* @__PURE__ */ jsx(Dialog.Backdrop, { className: ds_confirmation_module_default.overlay });
|
|
30
|
+
$[2] = t2;
|
|
31
|
+
} else t2 = $[2];
|
|
32
|
+
let t3;
|
|
33
|
+
if ($[3] !== className) {
|
|
34
|
+
t3 = classNames(ds_confirmation_module_default.modal, className);
|
|
35
|
+
$[3] = className;
|
|
36
|
+
$[4] = t3;
|
|
37
|
+
} else t3 = $[4];
|
|
38
|
+
let t4;
|
|
39
|
+
if ($[5] !== children || $[6] !== style) {
|
|
40
|
+
t4 = /* @__PURE__ */ jsx("div", {
|
|
41
|
+
style,
|
|
42
|
+
className: ds_confirmation_module_default.content,
|
|
43
|
+
children
|
|
44
|
+
});
|
|
45
|
+
$[5] = children;
|
|
46
|
+
$[6] = style;
|
|
47
|
+
$[7] = t4;
|
|
48
|
+
} else t4 = $[7];
|
|
49
|
+
let t5;
|
|
50
|
+
if ($[8] !== t3 || $[9] !== t4) {
|
|
51
|
+
t5 = /* @__PURE__ */ jsxs(Portal, { children: [t2, /* @__PURE__ */ jsx(Dialog.Positioner, { children: /* @__PURE__ */ jsx(Dialog.Content, {
|
|
52
|
+
className: t3,
|
|
53
|
+
children: t4
|
|
54
|
+
}) })] });
|
|
55
|
+
$[8] = t3;
|
|
56
|
+
$[9] = t4;
|
|
57
|
+
$[10] = t5;
|
|
58
|
+
} else t5 = $[10];
|
|
59
|
+
let t6;
|
|
60
|
+
if ($[11] !== handleOpenChange || $[12] !== open || $[13] !== t5) {
|
|
61
|
+
t6 = /* @__PURE__ */ jsx(Dialog.Root, {
|
|
62
|
+
open,
|
|
63
|
+
onOpenChange: handleOpenChange,
|
|
64
|
+
modal: true,
|
|
65
|
+
closeOnEscape: true,
|
|
66
|
+
closeOnInteractOutside: true,
|
|
67
|
+
children: t5
|
|
68
|
+
});
|
|
69
|
+
$[11] = handleOpenChange;
|
|
70
|
+
$[12] = open;
|
|
71
|
+
$[13] = t5;
|
|
72
|
+
$[14] = t6;
|
|
73
|
+
} else t6 = $[14];
|
|
74
|
+
return t6;
|
|
75
|
+
};
|
|
76
|
+
const Header = (t0) => {
|
|
77
|
+
const $ = c(6);
|
|
78
|
+
const { style, className, children } = t0;
|
|
79
|
+
let t1;
|
|
80
|
+
if ($[0] !== className) {
|
|
81
|
+
t1 = classNames(ds_confirmation_module_default.header, className);
|
|
82
|
+
$[0] = className;
|
|
83
|
+
$[1] = t1;
|
|
84
|
+
} else t1 = $[1];
|
|
85
|
+
let t2;
|
|
86
|
+
if ($[2] !== children || $[3] !== style || $[4] !== t1) {
|
|
87
|
+
t2 = /* @__PURE__ */ jsx("div", {
|
|
88
|
+
style,
|
|
89
|
+
className: t1,
|
|
90
|
+
children
|
|
91
|
+
});
|
|
92
|
+
$[2] = children;
|
|
93
|
+
$[3] = style;
|
|
94
|
+
$[4] = t1;
|
|
95
|
+
$[5] = t2;
|
|
96
|
+
} else t2 = $[5];
|
|
97
|
+
return t2;
|
|
98
|
+
};
|
|
99
|
+
const Title = (t0) => {
|
|
100
|
+
const $ = c(8);
|
|
101
|
+
const { style, className, children } = t0;
|
|
102
|
+
let t1;
|
|
103
|
+
if ($[0] !== className) {
|
|
104
|
+
t1 = classNames(ds_confirmation_module_default.title, className);
|
|
105
|
+
$[0] = className;
|
|
106
|
+
$[1] = t1;
|
|
107
|
+
} else t1 = $[1];
|
|
108
|
+
let t2;
|
|
109
|
+
if ($[2] !== children) {
|
|
110
|
+
t2 = /* @__PURE__ */ jsx(ds_typography_default, {
|
|
111
|
+
variant: "heading4",
|
|
112
|
+
children
|
|
113
|
+
});
|
|
114
|
+
$[2] = children;
|
|
115
|
+
$[3] = t2;
|
|
116
|
+
} else t2 = $[3];
|
|
117
|
+
let t3;
|
|
118
|
+
if ($[4] !== style || $[5] !== t1 || $[6] !== t2) {
|
|
119
|
+
t3 = /* @__PURE__ */ jsx(Dialog.Title, {
|
|
120
|
+
className: t1,
|
|
121
|
+
style,
|
|
122
|
+
asChild: true,
|
|
123
|
+
children: t2
|
|
124
|
+
});
|
|
125
|
+
$[4] = style;
|
|
126
|
+
$[5] = t1;
|
|
127
|
+
$[6] = t2;
|
|
128
|
+
$[7] = t3;
|
|
129
|
+
} else t3 = $[7];
|
|
130
|
+
return t3;
|
|
131
|
+
};
|
|
132
|
+
const CloseTrigger = (t0) => {
|
|
133
|
+
const $ = c(4);
|
|
134
|
+
const { style, className } = t0;
|
|
135
|
+
let t1;
|
|
136
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
137
|
+
t1 = /* @__PURE__ */ jsx(ds_icon_default, {
|
|
138
|
+
icon: "close",
|
|
139
|
+
size: "small"
|
|
140
|
+
});
|
|
141
|
+
$[0] = t1;
|
|
142
|
+
} else t1 = $[0];
|
|
143
|
+
let t2;
|
|
144
|
+
if ($[1] !== className || $[2] !== style) {
|
|
145
|
+
t2 = /* @__PURE__ */ jsx(Dialog.CloseTrigger, {
|
|
146
|
+
style,
|
|
147
|
+
className,
|
|
148
|
+
children: t1
|
|
149
|
+
});
|
|
150
|
+
$[1] = className;
|
|
151
|
+
$[2] = style;
|
|
152
|
+
$[3] = t2;
|
|
153
|
+
} else t2 = $[3];
|
|
154
|
+
return t2;
|
|
155
|
+
};
|
|
156
|
+
const Body = (t0) => {
|
|
157
|
+
const $ = c(6);
|
|
158
|
+
const { style, className, children } = t0;
|
|
159
|
+
let t1;
|
|
160
|
+
if ($[0] !== className) {
|
|
161
|
+
t1 = classNames(ds_confirmation_module_default.body, className);
|
|
162
|
+
$[0] = className;
|
|
163
|
+
$[1] = t1;
|
|
164
|
+
} else t1 = $[1];
|
|
165
|
+
let t2;
|
|
166
|
+
if ($[2] !== children || $[3] !== style || $[4] !== t1) {
|
|
167
|
+
t2 = /* @__PURE__ */ jsx("div", {
|
|
168
|
+
style,
|
|
169
|
+
className: t1,
|
|
170
|
+
children
|
|
171
|
+
});
|
|
172
|
+
$[2] = children;
|
|
173
|
+
$[3] = style;
|
|
174
|
+
$[4] = t1;
|
|
175
|
+
$[5] = t2;
|
|
176
|
+
} else t2 = $[5];
|
|
177
|
+
return t2;
|
|
178
|
+
};
|
|
179
|
+
const Footer = (t0) => {
|
|
180
|
+
const $ = c(6);
|
|
181
|
+
const { style, className, children } = t0;
|
|
182
|
+
let t1;
|
|
183
|
+
if ($[0] !== className) {
|
|
184
|
+
t1 = classNames(ds_confirmation_module_default.footer, className);
|
|
185
|
+
$[0] = className;
|
|
186
|
+
$[1] = t1;
|
|
187
|
+
} else t1 = $[1];
|
|
188
|
+
let t2;
|
|
189
|
+
if ($[2] !== children || $[3] !== style || $[4] !== t1) {
|
|
190
|
+
t2 = /* @__PURE__ */ jsx("div", {
|
|
191
|
+
style,
|
|
192
|
+
className: t1,
|
|
193
|
+
children
|
|
194
|
+
});
|
|
195
|
+
$[2] = children;
|
|
196
|
+
$[3] = style;
|
|
197
|
+
$[4] = t1;
|
|
198
|
+
$[5] = t2;
|
|
199
|
+
} else t2 = $[5];
|
|
200
|
+
return t2;
|
|
201
|
+
};
|
|
202
|
+
const Actions = (t0) => {
|
|
203
|
+
const $ = c(6);
|
|
204
|
+
const { style, className, children } = t0;
|
|
205
|
+
let t1;
|
|
206
|
+
if ($[0] !== className) {
|
|
207
|
+
t1 = classNames(ds_confirmation_module_default.actions, className);
|
|
208
|
+
$[0] = className;
|
|
209
|
+
$[1] = t1;
|
|
210
|
+
} else t1 = $[1];
|
|
211
|
+
let t2;
|
|
212
|
+
if ($[2] !== children || $[3] !== style || $[4] !== t1) {
|
|
213
|
+
t2 = /* @__PURE__ */ jsx("div", {
|
|
214
|
+
style,
|
|
215
|
+
className: t1,
|
|
216
|
+
children
|
|
217
|
+
});
|
|
218
|
+
$[2] = children;
|
|
219
|
+
$[3] = style;
|
|
220
|
+
$[4] = t1;
|
|
221
|
+
$[5] = t2;
|
|
222
|
+
} else t2 = $[5];
|
|
223
|
+
return t2;
|
|
33
224
|
};
|
|
34
|
-
const Header = ({ style, className, children }) => /* @__PURE__ */ jsx("div", {
|
|
35
|
-
style,
|
|
36
|
-
className: classNames(ds_confirmation_module_default.header, className),
|
|
37
|
-
children
|
|
38
|
-
});
|
|
39
|
-
const Title = ({ style, className, children }) => /* @__PURE__ */ jsx(Dialog.Title, {
|
|
40
|
-
className: classNames(ds_confirmation_module_default.title, className),
|
|
41
|
-
style,
|
|
42
|
-
asChild: true,
|
|
43
|
-
children: /* @__PURE__ */ jsx(ds_typography_default, {
|
|
44
|
-
variant: "heading4",
|
|
45
|
-
children
|
|
46
|
-
})
|
|
47
|
-
});
|
|
48
|
-
const CloseTrigger = ({ style, className }) => /* @__PURE__ */ jsx(Dialog.CloseTrigger, {
|
|
49
|
-
style,
|
|
50
|
-
className,
|
|
51
|
-
children: /* @__PURE__ */ jsx(ds_icon_default, {
|
|
52
|
-
icon: "close",
|
|
53
|
-
size: "small"
|
|
54
|
-
})
|
|
55
|
-
});
|
|
56
|
-
const Body = ({ style, className, children }) => /* @__PURE__ */ jsx("div", {
|
|
57
|
-
style,
|
|
58
|
-
className: classNames(ds_confirmation_module_default.body, className),
|
|
59
|
-
children
|
|
60
|
-
});
|
|
61
|
-
const Footer = ({ style, className, children }) => /* @__PURE__ */ jsx("div", {
|
|
62
|
-
style,
|
|
63
|
-
className: classNames(ds_confirmation_module_default.footer, className),
|
|
64
|
-
children
|
|
65
|
-
});
|
|
66
|
-
const Actions = ({ style, className, children }) => /* @__PURE__ */ jsx("div", {
|
|
67
|
-
style,
|
|
68
|
-
className: classNames(ds_confirmation_module_default.actions, className),
|
|
69
|
-
children
|
|
70
|
-
});
|
|
71
225
|
DsConfirmation.Header = Header;
|
|
72
226
|
DsConfirmation.Title = Title;
|
|
73
227
|
DsConfirmation.CloseTrigger = CloseTrigger;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ds-confirmation.js","names":["styles","DsTypography","
|
|
1
|
+
{"version":3,"file":"ds-confirmation.js","names":["CSSProperties","ReactNode","Dialog","Portal","classNames","DsIcon","DsConfirmationProps","styles","DsTypography","DsConfirmation","t0","$","_c","open","onOpenChange","style","className","children","t1","details","handleOpenChange","t2","Symbol","for","overlay","t3","modal","t4","content","t5","t6","Header","header","Title","title","CloseTrigger","Body","body","Footer","footer","Actions","actions"],"sources":["../../../src/components/ds-confirmation/ds-confirmation.tsx"],"sourcesContent":["import type { CSSProperties, ReactNode } from 'react';\nimport { Dialog } from '@ark-ui/react/dialog';\nimport { Portal } from '@ark-ui/react/portal';\nimport classNames from 'classnames';\nimport { DsIcon } from '../ds-icon';\nimport type { DsConfirmationProps } from './ds-confirmation.types';\nimport styles from './ds-confirmation.module.scss';\nimport DsTypography from '../ds-typography/ds-typography';\n\n/**\n * Composable confirmation modal dialog.\n */\nexport const DsConfirmation = ({ open, onOpenChange, style, className, children }: DsConfirmationProps) => {\n\tconst handleOpenChange = (details: { open: boolean }) => {\n\t\tonOpenChange(details.open);\n\t};\n\n\treturn (\n\t\t<Dialog.Root\n\t\t\topen={open}\n\t\t\tonOpenChange={handleOpenChange}\n\t\t\tmodal={true}\n\t\t\tcloseOnEscape={true}\n\t\t\tcloseOnInteractOutside={true}\n\t\t>\n\t\t\t<Portal>\n\t\t\t\t<Dialog.Backdrop className={styles.overlay} />\n\t\t\t\t<Dialog.Positioner>\n\t\t\t\t\t<Dialog.Content className={classNames(styles.modal, className)}>\n\t\t\t\t\t\t<div style={style} className={styles.content}>\n\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</Dialog.Content>\n\t\t\t\t</Dialog.Positioner>\n\t\t\t</Portal>\n\t\t</Dialog.Root>\n\t);\n};\n\nconst Header = ({\n\tstyle,\n\tclassName,\n\tchildren,\n}: {\n\tstyle?: CSSProperties;\n\tclassName?: string;\n\tchildren: ReactNode;\n}) => (\n\t<div style={style} className={classNames(styles.header, className)}>\n\t\t{children}\n\t</div>\n);\n\nconst Title = ({\n\tstyle,\n\tclassName,\n\tchildren,\n}: {\n\tstyle?: CSSProperties;\n\tclassName?: string;\n\tchildren: ReactNode;\n}) => (\n\t<Dialog.Title className={classNames(styles.title, className)} style={style} asChild>\n\t\t<DsTypography variant=\"heading4\">{children}</DsTypography>\n\t</Dialog.Title>\n);\n\nconst CloseTrigger = ({ style, className }: { style?: CSSProperties; className?: string }) => (\n\t<Dialog.CloseTrigger style={style} className={className}>\n\t\t<DsIcon icon=\"close\" size=\"small\"></DsIcon>\n\t</Dialog.CloseTrigger>\n);\n\nconst Body = ({\n\tstyle,\n\tclassName,\n\tchildren,\n}: {\n\tstyle?: CSSProperties;\n\tclassName?: string;\n\tchildren: ReactNode;\n}) => (\n\t<div style={style} className={classNames(styles.body, className)}>\n\t\t{children}\n\t</div>\n);\n\nconst Footer = ({\n\tstyle,\n\tclassName,\n\tchildren,\n}: {\n\tstyle?: CSSProperties;\n\tclassName?: string;\n\tchildren: ReactNode;\n}) => (\n\t<div style={style} className={classNames(styles.footer, className)}>\n\t\t{children}\n\t</div>\n);\n\nconst Actions = ({\n\tstyle,\n\tclassName,\n\tchildren,\n}: {\n\tstyle?: CSSProperties;\n\tclassName?: string;\n\tchildren: ReactNode;\n}) => (\n\t<div style={style} className={classNames(styles.actions, className)}>\n\t\t{children}\n\t</div>\n);\n\nDsConfirmation.Header = Header;\nDsConfirmation.Title = Title;\nDsConfirmation.CloseTrigger = CloseTrigger;\nDsConfirmation.Body = Body;\nDsConfirmation.Footer = Footer;\nDsConfirmation.Actions = Actions;\n"],"mappings":";;;;;;;;;;;;;;AAYA,MAAaS,kBAAiBC,OAAA;CAAA,MAAAC,IAAAC,EAAA,GAAA;CAAC,MAAA,EAAAC,MAAAC,cAAAC,OAAAC,WAAAC,aAAAP;CAAuE,IAAAQ;AAAA,KAAAP,EAAA,OAAAG,cAAA;AAC5EI,QAAAC,YAAA;AACxBL,gBAAaK,QAAON,KAAM;;AAC1BF,IAAA,KAAAG;AAAAH,IAAA,KAAAO;OAAAA,MAAAP,EAAA;CAFD,MAAAS,mBAAyBF;CAEvB,IAAAG;AAAA,KAAAV,EAAA,OAAAW,OAAAC,IAAA,4BAAA,EAAA;AAWCF,OAAA,oBAAA,OAAA,YAA4B,WAAAd,+BAAMiB,UAAY;AAAAb,IAAA,KAAAU;OAAAA,MAAAV,EAAA;CAAA,IAAAc;AAAA,KAAAd,EAAA,OAAAK,WAAA;AAElBS,OAAArB,WAAWG,+BAAMmB,OAAQV,UAAU;AAAAL,IAAA,KAAAK;AAAAL,IAAA,KAAAc;OAAAA,MAAAd,EAAA;CAAA,IAAAgB;AAAA,KAAAhB,EAAA,OAAAM,YAAAN,EAAA,OAAAI,OAAA;AAC7DY,OAAA,oBAAA;GAAYZ;GAAkB,WAAAR,+BAAMqB;GAClCX;IACI;AAAAN,IAAA,KAAAM;AAAAN,IAAA,KAAAI;AAAAJ,IAAA,KAAAgB;OAAAA,MAAAhB,EAAA;CAAA,IAAAkB;AAAA,KAAAlB,EAAA,OAAAc,MAAAd,EAAA,OAAAgB,IAAA;AANTE,OAAA,qBAAC,qBACAR,IACA,oBAAA,OAAA,wBACC,oBAAA,OAAA;GAA2B,WAAAI;aAC1BE;IAIF,GACD,IAAS;AAAAhB,IAAA,KAAAc;AAAAd,IAAA,KAAAgB;AAAAh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ACtB3B,eAAe6B,SAASA;AACxB7B,eAAe+B,UAAUA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ds-dialog.js","names":["
|
|
1
|
+
{"version":3,"file":"ds-dialog.js","names":["React","RadixDialog","Root","VisuallyHidden","classNames","styles","DsDialogProps","DsDialog","FC","open","onOpenChange","title","hideTitle","description","hideDescription","children","className","anchorRef","customPosition","modal","style","CSSProperties","position","current","rect","getBoundingClientRect","top","bottom","left","overlay","dialog","customPlacement","undefined"],"sources":["../../../src/components/ds-dialog/ds-dialog.tsx"],"sourcesContent":["import type React from 'react';\nimport * as RadixDialog from '@radix-ui/react-dialog';\nimport { Root as VisuallyHidden } from '@radix-ui/react-visually-hidden';\nimport classNames from 'classnames';\nimport styles from './ds-dialog.module.scss';\nimport type { DsDialogProps } from './ds-dialog.types';\n\nconst DsDialog: React.FC<DsDialogProps> = ({\n\topen,\n\tonOpenChange,\n\ttitle,\n\thideTitle,\n\tdescription,\n\thideDescription,\n\tchildren,\n\tclassName,\n\tanchorRef,\n\tcustomPosition,\n\tmodal = true,\n}) => {\n\tlet style: React.CSSProperties = {};\n\tif (customPosition) {\n\t\tstyle = { position: 'fixed', ...customPosition };\n\t} else if (anchorRef?.current) {\n\t\tconst rect = anchorRef.current.getBoundingClientRect();\n\t\tstyle = { position: 'fixed', top: rect.bottom, left: rect.left };\n\t}\n\n\treturn (\n\t\t<RadixDialog.Root open={open} onOpenChange={onOpenChange}>\n\t\t\t<RadixDialog.Portal>\n\t\t\t\t{modal && <RadixDialog.Overlay className={styles.overlay} />}\n\t\t\t\t<RadixDialog.Content\n\t\t\t\t\tclassName={classNames(styles.dialog, className, {\n\t\t\t\t\t\t[styles.customPlacement]: customPosition || anchorRef,\n\t\t\t\t\t})}\n\t\t\t\t\tstyle={customPosition || anchorRef ? style : undefined}\n\t\t\t\t>\n\t\t\t\t\t<RadixDialog.Title asChild>\n\t\t\t\t\t\t{hideTitle ? (\n\t\t\t\t\t\t\t<VisuallyHidden>\n\t\t\t\t\t\t\t\t<RadixDialog.Title className={styles.title}>{title}</RadixDialog.Title>\n\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<RadixDialog.Title className={styles.title}>{title}</RadixDialog.Title>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</RadixDialog.Title>\n\t\t\t\t\t{description && (\n\t\t\t\t\t\t<RadixDialog.Description asChild>\n\t\t\t\t\t\t\t{hideDescription ? (\n\t\t\t\t\t\t\t\t<VisuallyHidden>\n\t\t\t\t\t\t\t\t\t<RadixDialog.Description className={styles.description}>\n\t\t\t\t\t\t\t\t\t\t{description}\n\t\t\t\t\t\t\t\t\t</RadixDialog.Description>\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<RadixDialog.Description className={styles.description}>\n\t\t\t\t\t\t\t\t\t{description}\n\t\t\t\t\t\t\t\t</RadixDialog.Description>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</RadixDialog.Description>\n\t\t\t\t\t)}\n\t\t\t\t\t{children}\n\t\t\t\t</RadixDialog.Content>\n\t\t\t</RadixDialog.Portal>\n\t\t</RadixDialog.Root>\n\t);\n};\n\nexport default DsDialog;\n"],"mappings":";;;;;;;AAOA,MAAMO,YAAqC,EAC1CE,MACAC,cACAC,OACAC,WACAC,aACAC,iBACAC,UACAC,WACAC,WACAC,gBACAC,QAAQ,WACH;CACL,IAAIC,QAA6B,EAAE;AACnC,KAAIF,eACHE,SAAQ;EAAEE,UAAU;EAAS,GAAGJ;EAAgB;UACtCD,WAAWM,SAAS;EAC9B,MAAMC,OAAOP,UAAUM,QAAQE,uBAAuB;AACtDL,UAAQ;GAAEE,UAAU;GAASI,KAAKF,KAAKG;GAAQC,MAAMJ,KAAKI;GAAM;;AAGjE,QACC,oBAAC,YAAY;EAAWnB;EAAoBC;YAC3C,qBAAC,YAAY,qBACXS,SAAS,oBAAC,YAAY,WAAQ,WAAWd,yBAAOwB,UAAW,EAC5D,qBAAC,YAAY;GACZ,WAAWzB,WAAWC,yBAAOyB,QAAQd,WAAW,GAC9CX,yBAAO0B,kBAAkBb,kBAAkBD,WAC5C,CAAC;GACF,OAAOC,kBAAkBD,YAAYG,QAAQY;;IAE7C,oBAAC,YAAY;KAAM;eACjBpB,YACA,oBAAC,kBACA,oBAAC,YAAY;MAAM,WAAWP,yBAAOM;gBAAQA;OAAyB,GACtD,GAEjB,oBAAC,YAAY;MAAM,WAAWN,yBAAOM;gBAAQA;OAC7C;MACiB;IAClBE,eACA,oBAAC,YAAY;KAAY;eACvBC,kBACA,oBAAC,kBACA,oBAAC,YAAY;MAAY,WAAWT,yBAAOQ;gBACzCA;OACuB,GACT,GAEjB,oBAAC,YAAY;MAAY,WAAWR,yBAAOQ;gBACzCA;OAEF;MAEF;IACAE;;IACmB,IACF;GACF;;AAIrB,wBAAeR"}
|