@yuno-payments/dashboard-design-system 0.0.167 → 0.0.170
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/components/atoms/access-denied-alert/access-denied-alert.d.ts +0 -16
- package/dist/components/atoms/accordion/accordion.d.ts +0 -66
- package/dist/components/atoms/alert/alert.d.ts +1 -26
- package/dist/components/atoms/alert/alert.js +8 -9
- package/dist/components/atoms/avatar/avatar-group.d.ts +0 -28
- package/dist/components/atoms/avatar/avatar.d.ts +0 -25
- package/dist/components/atoms/avatar/avatar.js +9 -9
- package/dist/components/atoms/badge/badge.d.ts +2 -30
- package/dist/components/atoms/badge/badge.js +11 -27
- package/dist/components/atoms/button/button.d.ts +0 -44
- package/dist/components/atoms/card/card.d.ts +3 -137
- package/dist/components/atoms/card/card.js +28 -56
- package/dist/components/atoms/checkbox/checkbox.d.ts +2 -38
- package/dist/components/atoms/checkbox/checkbox.js +27 -61
- package/dist/components/atoms/combobox/combobox.d.ts +0 -18
- package/dist/components/atoms/combobox/combobox.js +41 -41
- package/dist/components/atoms/combobox/types.d.ts +1 -90
- package/dist/components/atoms/currency-field/currency-field.d.ts +0 -38
- package/dist/components/atoms/currency-field/currency-field.js +19 -22
- package/dist/components/atoms/date-picker/date-picker.d.ts +0 -15
- package/dist/components/atoms/date-range-picker/date-range-picker.d.ts +0 -15
- package/dist/components/atoms/dots-menu/dots-menu.d.ts +0 -16
- package/dist/components/atoms/dots-menu/dots-menu.js +8 -8
- package/dist/components/atoms/dots-menu/dots-menu.types.d.ts +0 -52
- package/dist/components/atoms/dropdown-menu/dropdown-menu.d.ts +0 -50
- package/dist/components/atoms/field/field.d.ts +0 -55
- package/dist/components/atoms/field/field.js +46 -53
- package/dist/components/atoms/filter/filter-date-range.d.ts +2 -12
- package/dist/components/atoms/filter/filter-date-range.js +168 -203
- package/dist/components/atoms/filter/filter.d.ts +0 -6
- package/dist/components/atoms/filter/filter.js +76 -91
- package/dist/components/atoms/filter/index.d.ts +1 -1
- package/dist/components/atoms/filter-dropdown/filter-dropdown.d.ts +2 -208
- package/dist/components/atoms/filter-dropdown/filter-dropdown.js +160 -214
- package/dist/components/atoms/icon/icon-list.d.ts +0 -5
- package/dist/components/atoms/icon/icon-list.js +384 -394
- package/dist/components/atoms/icon/icon.d.ts +0 -29
- package/dist/components/atoms/index.d.ts +2 -3
- package/dist/components/atoms/label/index.d.ts +1 -1
- package/dist/components/atoms/link/link.d.ts +0 -20
- package/dist/components/atoms/multi-select/multi-select.d.ts +1 -1
- package/dist/components/atoms/multi-select/multi-select.js +6 -6
- package/dist/components/atoms/multi-values-field/multi-values-field.d.ts +0 -16
- package/dist/components/atoms/multi-values-field/multi-values-field.js +87 -109
- package/dist/components/atoms/multi-values-field/multi-values-field.types.d.ts +0 -81
- package/dist/components/atoms/otp-field/otp-field.d.ts +0 -32
- package/dist/components/atoms/password-field/password-field.d.ts +0 -23
- package/dist/components/atoms/password-field/password-field.js +1 -1
- package/dist/components/atoms/progress/progress.d.ts +0 -15
- package/dist/components/atoms/protected-field/protected-field.d.ts +0 -10
- package/dist/components/atoms/protected-field/protected-field.types.d.ts +0 -14
- package/dist/components/atoms/radio-group/radio-group-option.js +11 -11
- package/dist/components/atoms/radio-group/radio-group.d.ts +1 -50
- package/dist/components/atoms/radio-group/radio-group.js +12 -13
- package/dist/components/atoms/search-field/search-field.d.ts +0 -14
- package/dist/components/atoms/search-field/search-field.js +17 -17
- package/dist/components/atoms/search-field/search-field.types.d.ts +0 -57
- package/dist/components/atoms/select/index.d.ts +0 -2
- package/dist/components/atoms/select/select.d.ts +1 -83
- package/dist/components/atoms/select/select.js +21 -21
- package/dist/components/atoms/separator/separator.d.ts +0 -17
- package/dist/components/atoms/skeleton/index.d.ts +0 -9
- package/dist/components/atoms/switch/switch.d.ts +2 -56
- package/dist/components/atoms/switch/switch.js +32 -64
- package/dist/components/atoms/tabs/index.d.ts +0 -16
- package/dist/components/atoms/textarea/textarea.d.ts +0 -32
- package/dist/components/atoms/textarea/textarea.js +1 -1
- package/dist/components/atoms/time-picker/time-picker.d.ts +2 -73
- package/dist/components/atoms/time-picker/time-picker.js +3 -218
- package/dist/components/atoms/toaster/index.d.ts +0 -15
- package/dist/components/atoms/toggle-group/toggle-group.d.ts +1 -26
- package/dist/components/atoms/toggle-group/toggle-group.js +14 -15
- package/dist/components/atoms/tooltip/tooltip.d.ts +2 -53
- package/dist/components/atoms/typography/typography.d.ts +0 -18
- package/dist/components/molecules/breadcrumb/breadcrumb.d.ts +0 -50
- package/dist/components/molecules/breadcrumb/breadcrumb.js +17 -17
- package/dist/components/molecules/dialog-content/dialog-content.d.ts +0 -16
- package/dist/components/molecules/dialog-footer/dialog-footer.d.ts +0 -20
- package/dist/components/molecules/dialog-header/dialog-header.d.ts +0 -31
- package/dist/components/molecules/empty/empty-icon.js +6 -6
- package/dist/components/molecules/empty/empty.d.ts +1 -16
- package/dist/components/molecules/empty/empty.js +34 -37
- package/dist/components/molecules/highlight-banner/highlight-banner.d.ts +0 -17
- package/dist/components/molecules/pagination/pagination.d.ts +0 -49
- package/dist/components/organisms/data-table/components/cells/data-table-list-cell.d.ts +0 -41
- package/dist/components/organisms/data-table/components/column-header/data-table-column-header-content.js +1 -1
- package/dist/components/organisms/data-table/components/column-header/data-table-column-header-menu.js +18 -18
- package/dist/components/organisms/data-table/components/column-header/data-table-column-header.d.ts +0 -18
- package/dist/components/organisms/data-table/components/column-header/data-table-column-header.js +10 -10
- package/dist/components/organisms/data-table/components/data-table-body.d.ts +0 -18
- package/dist/components/organisms/data-table/components/data-table-header.d.ts +0 -12
- package/dist/components/organisms/data-table/components/data-table-header.js +7 -7
- package/dist/components/organisms/data-table/components/states/data-table-loading.d.ts +0 -24
- package/dist/components/organisms/data-table/components/states/data-table-loading.js +6 -6
- package/dist/components/organisms/data-table/data-table.d.ts +4 -133
- package/dist/components/organisms/data-table/data-table.js +100 -132
- package/dist/components/organisms/data-table/data-table.types.d.ts +26 -35
- package/dist/components/organisms/data-table/hooks/use-data-table-columns.js +41 -57
- package/dist/components/organisms/data-table/hooks/use-data-table-state.d.ts +2 -8
- package/dist/components/organisms/data-table/hooks/use-data-table-state.js +47 -82
- package/dist/components/organisms/data-table/utils/data-table-constants.d.ts +2 -8
- package/dist/components/organisms/data-table/utils/data-table-constants.js +10 -16
- package/dist/components/organisms/data-table/utils/data-table-styles.d.ts +0 -1652
- package/dist/components/organisms/data-table/utils/data-table-styles.js +14 -29
- package/dist/components/organisms/dialog/dialog.d.ts +1 -67
- package/dist/components/organisms/dialog/dialog.js +61 -78
- package/dist/components/organisms/index.d.ts +0 -2
- package/dist/components/organisms/sheet/sheet.d.ts +0 -69
- package/dist/components/organisms/sheet/sheet.js +33 -34
- package/dist/index.css +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.js +162 -173
- package/dist/vendor/shadcn/avatar.js +19 -19
- package/dist/vendor/shadcn/badge.js +15 -15
- package/dist/vendor/shadcn/card.js +7 -7
- package/dist/vendor/shadcn/date-picker.d.ts +2 -2
- package/dist/vendor/shadcn/date-picker.js +1 -1
- package/dist/vendor/shadcn/date-range-picker.d.ts +2 -2
- package/dist/vendor/shadcn/date-range-picker.js +1 -1
- package/dist/vendor/shadcn/dialog.js +2 -2
- package/dist/vendor/shadcn/input-group.js +17 -17
- package/dist/vendor/shadcn/input.js +7 -7
- package/dist/vendor/shadcn/popover.js +1 -1
- package/dist/vendor/shadcn/select.js +2 -2
- package/dist/vendor/shadcn/sonner.d.ts +1 -26
- package/dist/vendor/shadcn/sonner.js +8 -12
- package/dist/vendor/shadcn/table.js +30 -30
- package/dist/vendor/shadcn/textarea.js +9 -9
- package/dist/vendor/shadcn/time-picker.d.ts +2 -1
- package/dist/vendor/shadcn/time-picker.js +23 -17
- package/dist/vendor/shadcn/toggle.js +13 -13
- package/dist/vendor/shadcn/tooltip.js +15 -25
- package/package.json +1 -1
- package/dist/components/atoms/icon/aida-logo.d.ts +0 -3
- package/dist/components/atoms/icon/aida-logo.js +0 -64
- package/dist/components/atoms/label/label.d.ts +0 -11
- package/dist/components/atoms/label/label.js +0 -28
- package/dist/components/atoms/loading/index.d.ts +0 -1
- package/dist/components/atoms/loading/loading.d.ts +0 -39
- package/dist/components/atoms/loading/loading.js +0 -37
- package/dist/components/atoms/select/search-select.d.ts +0 -22
- package/dist/components/atoms/select/search-select.js +0 -201
- package/dist/components/organisms/tutorial/index.d.ts +0 -2
- package/dist/components/organisms/tutorial/tutorial.d.ts +0 -16
- package/dist/components/organisms/tutorial/tutorial.js +0 -114
- package/dist/components/organisms/tutorial/tutorial.types.d.ts +0 -15
- package/dist/hooks/index.d.ts +0 -3
- package/dist/hooks/use-body-scroll-lock.d.ts +0 -13
- package/dist/hooks/use-escape-key.d.ts +0 -14
- package/dist/hooks/use-media-query.d.ts +0 -20
- package/dist/hooks/use-media-query.js +0 -21
- package/dist/lib/notification-alert.d.ts +0 -42
- package/dist/lib/notification-alert.js +0 -75
- package/dist/node_modules/@phosphor-icons/react/dist/csr/File.es.js +0 -8
- package/dist/node_modules/@phosphor-icons/react/dist/csr/Microphone.es.js +0 -8
- package/dist/node_modules/@phosphor-icons/react/dist/csr/Stop.es.js +0 -8
- package/dist/node_modules/@phosphor-icons/react/dist/csr/Table.es.js +0 -8
- package/dist/node_modules/@phosphor-icons/react/dist/defs/File.es.js +0 -30
- package/dist/node_modules/@phosphor-icons/react/dist/defs/Microphone.es.js +0 -36
- package/dist/node_modules/@phosphor-icons/react/dist/defs/Stop.es.js +0 -36
- package/dist/node_modules/@phosphor-icons/react/dist/defs/Table.es.js +0 -30
|
@@ -1,38 +1,23 @@
|
|
|
1
1
|
import { cn as o } from "../../../../lib/utils.js";
|
|
2
|
-
import { getPinnedStyles as
|
|
3
|
-
import { PINNED_SHADOW_CLASS as
|
|
4
|
-
function
|
|
5
|
-
const
|
|
2
|
+
import { getPinnedStyles as s } from "./data-table-utils.js";
|
|
3
|
+
import { PINNED_SHADOW_CLASS as S } from "./data-table-constants.js";
|
|
4
|
+
function p(t, n, r) {
|
|
5
|
+
const i = t.getIsPinned();
|
|
6
6
|
return {
|
|
7
7
|
style: {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
} : {
|
|
17
|
-
width: `${e}px`
|
|
18
|
-
},
|
|
19
|
-
...p(
|
|
20
|
-
s,
|
|
21
|
-
(n) => t.getStart(n),
|
|
22
|
-
(n) => t.getAfter(n),
|
|
23
|
-
d
|
|
8
|
+
width: `${t.getSize()}px`,
|
|
9
|
+
// Don't set minWidth/maxWidth in CSS as TanStack Table handles this internally
|
|
10
|
+
// Setting these can interfere with the resize functionality
|
|
11
|
+
...s(
|
|
12
|
+
i,
|
|
13
|
+
(e) => t.getStart(e),
|
|
14
|
+
(e) => t.getAfter(e),
|
|
15
|
+
r
|
|
24
16
|
)
|
|
25
17
|
},
|
|
26
|
-
className: o(
|
|
27
|
-
r,
|
|
28
|
-
s && l,
|
|
29
|
-
// Add a class to identify fixed-size columns
|
|
30
|
-
a && "data-table-fixed-column",
|
|
31
|
-
// Hide spacer column visually
|
|
32
|
-
i && "data-table-spacer"
|
|
33
|
-
)
|
|
18
|
+
className: o(n, i && S)
|
|
34
19
|
};
|
|
35
20
|
}
|
|
36
21
|
export {
|
|
37
|
-
|
|
22
|
+
p as getCellStyles
|
|
38
23
|
};
|
|
@@ -7,88 +7,22 @@ declare const dialogVariants: (props?: ({
|
|
|
7
7
|
export type VerticalAlign = "start" | "center" | "end";
|
|
8
8
|
export type VariantButtonType = "primary" | "secondary" | "tertiary" | "text" | "outlined" | "contained";
|
|
9
9
|
export type SizeButtonType = "small" | "large" | "medium";
|
|
10
|
-
/**
|
|
11
|
-
* Props for the Dialog component
|
|
12
|
-
*/
|
|
13
10
|
export interface DialogProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title">, VariantProps<typeof dialogVariants> {
|
|
14
|
-
/**
|
|
15
|
-
* Dialog title (text or custom element)
|
|
16
|
-
*/
|
|
17
11
|
title?: React.ReactElement | string;
|
|
18
|
-
/**
|
|
19
|
-
* Whether the dialog is open
|
|
20
|
-
*/
|
|
21
12
|
open: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Callback fired when the dialog should close
|
|
24
|
-
*/
|
|
25
13
|
closeIcon: () => void;
|
|
26
|
-
/**
|
|
27
|
-
* Array of button configurations to display in the footer
|
|
28
|
-
*/
|
|
29
14
|
buttons?: ButtonProps[];
|
|
30
|
-
/**
|
|
31
|
-
* Custom width for the dialog container
|
|
32
|
-
*/
|
|
33
15
|
widthContainer?: number | string;
|
|
34
|
-
/**
|
|
35
|
-
* Custom height for the dialog container
|
|
36
|
-
*/
|
|
37
16
|
heightContainer?: number | string;
|
|
38
|
-
/**
|
|
39
|
-
* Callback fired when the back button is clicked
|
|
40
|
-
*/
|
|
41
17
|
backButtonAction?: () => void;
|
|
42
|
-
/**
|
|
43
|
-
* Whether to show the footer with action buttons
|
|
44
|
-
* @default true
|
|
45
|
-
*/
|
|
46
18
|
showActions?: boolean;
|
|
47
|
-
/**
|
|
48
|
-
* Additional action elements to display in the header
|
|
49
|
-
*/
|
|
50
19
|
otherActions?: React.ReactNode;
|
|
51
|
-
/**
|
|
52
|
-
* Whether to show the header
|
|
53
|
-
* @default true
|
|
54
|
-
*/
|
|
55
20
|
withHeader?: boolean;
|
|
56
|
-
/**
|
|
57
|
-
* Content to display in the dialog body
|
|
58
|
-
*/
|
|
59
21
|
children: React.ReactNode;
|
|
60
|
-
/**
|
|
61
|
-
* Additional CSS classes for the header
|
|
62
|
-
*/
|
|
63
22
|
headerClassName?: string;
|
|
64
|
-
/**
|
|
65
|
-
* Additional CSS classes for the content area
|
|
66
|
-
*/
|
|
67
23
|
contentClassName?: string;
|
|
68
|
-
/**
|
|
69
|
-
* Additional CSS classes for the footer
|
|
70
|
-
*/
|
|
71
24
|
footerClassName?: string;
|
|
72
25
|
}
|
|
73
|
-
/**
|
|
74
|
-
* Modal dialog component with header, content, and footer sections.
|
|
75
|
-
* Features backdrop click to close, ESC key support, and body scroll locking.
|
|
76
|
-
* Responsive: fullscreen on mobile, centered modal on desktop.
|
|
77
|
-
*
|
|
78
|
-
* @example
|
|
79
|
-
* ```tsx
|
|
80
|
-
* <Dialog
|
|
81
|
-
* open={isOpen}
|
|
82
|
-
* closeIcon={() => setIsOpen(false)}
|
|
83
|
-
* title="Confirm Action"
|
|
84
|
-
* buttons={[
|
|
85
|
-
* { children: 'Cancel', variant: 'outline', onClick: handleCancel },
|
|
86
|
-
* { children: 'Confirm', onClick: handleConfirm }
|
|
87
|
-
* ]}
|
|
88
|
-
* >
|
|
89
|
-
* <p>Are you sure you want to proceed?</p>
|
|
90
|
-
* </Dialog>
|
|
91
|
-
* ```
|
|
92
|
-
*/
|
|
93
26
|
declare const Dialog: React.ForwardRefExoticComponent<DialogProps & React.RefAttributes<HTMLDivElement>>;
|
|
94
27
|
export { Dialog };
|
|
28
|
+
export type { DialogProps };
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { j as e } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import * as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"fixed inset-0 z-dialog flex items-center justify-center p-4",
|
|
2
|
+
import * as l from "react";
|
|
3
|
+
import { cva as m } from "../../../node_modules/class-variance-authority/dist/index.js";
|
|
4
|
+
import { cn as n, normalizeDimension as d } from "../../../lib/utils.js";
|
|
5
|
+
import { useBodyScrollLock as E } from "../../../hooks/use-body-scroll-lock.js";
|
|
6
|
+
import { useEscapeKey as V } from "../../../hooks/use-escape-key.js";
|
|
7
|
+
import { DialogHeader as L } from "../../molecules/dialog-header/dialog-header.js";
|
|
8
|
+
import { DialogContent as M } from "../../molecules/dialog-content/dialog-content.js";
|
|
9
|
+
import { DialogFooter as S } from "../../molecules/dialog-footer/dialog-footer.js";
|
|
10
|
+
const A = m(
|
|
11
|
+
"fixed inset-0 z-50 flex items-center justify-center p-4",
|
|
13
12
|
{
|
|
14
13
|
variants: {
|
|
15
14
|
verticalAlign: {
|
|
@@ -22,7 +21,7 @@ const H = x(
|
|
|
22
21
|
verticalAlign: "center"
|
|
23
22
|
}
|
|
24
23
|
}
|
|
25
|
-
),
|
|
24
|
+
), B = m(
|
|
26
25
|
"relative bg-background rounded-lg shadow-lg border border-border max-h-[90vh] overflow-hidden flex flex-col",
|
|
27
26
|
{
|
|
28
27
|
variants: {
|
|
@@ -38,96 +37,80 @@ const H = x(
|
|
|
38
37
|
size: "default"
|
|
39
38
|
}
|
|
40
39
|
}
|
|
41
|
-
),
|
|
40
|
+
), C = l.forwardRef(
|
|
42
41
|
({
|
|
43
|
-
className:
|
|
44
|
-
verticalAlign:
|
|
45
|
-
title:
|
|
46
|
-
open:
|
|
47
|
-
closeIcon:
|
|
48
|
-
buttons:
|
|
49
|
-
widthContainer:
|
|
50
|
-
heightContainer:
|
|
51
|
-
backButtonAction:
|
|
52
|
-
showActions:
|
|
53
|
-
otherActions:
|
|
54
|
-
withHeader:
|
|
55
|
-
children:
|
|
56
|
-
headerClassName:
|
|
57
|
-
contentClassName:
|
|
58
|
-
footerClassName:
|
|
59
|
-
...
|
|
60
|
-
},
|
|
61
|
-
const [
|
|
62
|
-
if (
|
|
63
|
-
const
|
|
64
|
-
|
|
42
|
+
className: f,
|
|
43
|
+
verticalAlign: c,
|
|
44
|
+
title: u,
|
|
45
|
+
open: r,
|
|
46
|
+
closeIcon: a,
|
|
47
|
+
buttons: x = [],
|
|
48
|
+
widthContainer: s,
|
|
49
|
+
heightContainer: o,
|
|
50
|
+
backButtonAction: g,
|
|
51
|
+
showActions: w = !0,
|
|
52
|
+
otherActions: v,
|
|
53
|
+
withHeader: p = !0,
|
|
54
|
+
children: h,
|
|
55
|
+
headerClassName: b,
|
|
56
|
+
contentClassName: j,
|
|
57
|
+
footerClassName: z,
|
|
58
|
+
...N
|
|
59
|
+
}, k) => {
|
|
60
|
+
const [i, y] = l.useState(!1);
|
|
61
|
+
if (l.useEffect(() => {
|
|
62
|
+
const t = () => {
|
|
63
|
+
y(window.innerWidth <= 599);
|
|
65
64
|
};
|
|
66
|
-
return
|
|
67
|
-
}, []),
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
d(!1);
|
|
74
|
-
}, 600);
|
|
75
|
-
return () => clearTimeout(i);
|
|
76
|
-
}
|
|
77
|
-
}, [a, l]), T(a), B(a, o), !l) return null;
|
|
78
|
-
const A = {
|
|
79
|
-
width: r && !s ? f(r) : void 0,
|
|
80
|
-
height: m && !s ? f(m) : void 0
|
|
81
|
-
}, L = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
65
|
+
return t(), window.addEventListener("resize", t), () => window.removeEventListener("resize", t);
|
|
66
|
+
}, []), E(r), V(r, a), !r) return null;
|
|
67
|
+
const D = {
|
|
68
|
+
width: s && !i ? d(s) : void 0,
|
|
69
|
+
height: o && !i ? d(o) : void 0
|
|
70
|
+
};
|
|
71
|
+
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
82
72
|
/* @__PURE__ */ e.jsx(
|
|
83
73
|
"div",
|
|
84
74
|
{
|
|
85
|
-
className:
|
|
86
|
-
|
|
87
|
-
c ? "opacity-100" : "opacity-0"
|
|
88
|
-
),
|
|
89
|
-
onClick: o,
|
|
75
|
+
className: "fixed inset-0 z-50 bg-black/25",
|
|
76
|
+
onClick: a,
|
|
90
77
|
"aria-hidden": "true"
|
|
91
78
|
}
|
|
92
79
|
),
|
|
93
|
-
/* @__PURE__ */ e.jsx("div", { className: n(
|
|
80
|
+
/* @__PURE__ */ e.jsx("div", { className: n(A({ verticalAlign: c })), children: /* @__PURE__ */ e.jsxs(
|
|
94
81
|
"div",
|
|
95
82
|
{
|
|
96
|
-
ref:
|
|
83
|
+
ref: k,
|
|
97
84
|
className: n(
|
|
98
|
-
|
|
99
|
-
size:
|
|
85
|
+
B({
|
|
86
|
+
size: i ? "fullscreen" : "default"
|
|
100
87
|
}),
|
|
101
|
-
|
|
102
|
-
c ? "opacity-100 scale-100 translate-y-0" : "opacity-0 scale-98 -translate-y-2",
|
|
103
|
-
r && !s && "max-w-none",
|
|
104
|
-
g
|
|
88
|
+
f
|
|
105
89
|
),
|
|
106
|
-
style:
|
|
90
|
+
style: D,
|
|
107
91
|
role: "dialog",
|
|
108
92
|
"aria-modal": "true",
|
|
109
|
-
...
|
|
93
|
+
...N,
|
|
110
94
|
children: [
|
|
111
|
-
|
|
112
|
-
|
|
95
|
+
p && /* @__PURE__ */ e.jsx(
|
|
96
|
+
L,
|
|
113
97
|
{
|
|
114
|
-
title:
|
|
115
|
-
onClose:
|
|
116
|
-
onBack:
|
|
117
|
-
otherActions:
|
|
118
|
-
className:
|
|
98
|
+
title: u,
|
|
99
|
+
onClose: a,
|
|
100
|
+
onBack: g,
|
|
101
|
+
otherActions: v,
|
|
102
|
+
className: b
|
|
119
103
|
}
|
|
120
104
|
),
|
|
121
|
-
/* @__PURE__ */ e.jsx(
|
|
122
|
-
|
|
105
|
+
/* @__PURE__ */ e.jsx(M, { className: j, children: h }),
|
|
106
|
+
w && /* @__PURE__ */ e.jsx(S, { buttons: x, className: z })
|
|
123
107
|
]
|
|
124
108
|
}
|
|
125
109
|
) })
|
|
126
110
|
] });
|
|
127
|
-
return M(L, document.body);
|
|
128
111
|
}
|
|
129
112
|
);
|
|
130
|
-
|
|
113
|
+
C.displayName = "Dialog";
|
|
131
114
|
export {
|
|
132
|
-
|
|
115
|
+
C as Dialog
|
|
133
116
|
};
|
|
@@ -5,90 +5,21 @@ declare const sheetVariants: (props?: ({
|
|
|
5
5
|
side?: "left" | "right" | "bottom" | "top" | null | undefined;
|
|
6
6
|
isOpen?: boolean | null | undefined;
|
|
7
7
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
|
-
/**
|
|
9
|
-
* Props for the Sheet component
|
|
10
|
-
*/
|
|
11
8
|
export interface SheetProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title">, VariantProps<typeof sheetVariants> {
|
|
12
|
-
/**
|
|
13
|
-
* Sheet title (text or custom element)
|
|
14
|
-
*/
|
|
15
9
|
title?: React.ReactElement | string;
|
|
16
|
-
/**
|
|
17
|
-
* Optional description displayed below the title
|
|
18
|
-
*/
|
|
19
10
|
description?: React.ReactElement | string;
|
|
20
|
-
/**
|
|
21
|
-
* Whether the sheet is open
|
|
22
|
-
*/
|
|
23
11
|
open: boolean;
|
|
24
|
-
/**
|
|
25
|
-
* Callback fired when the sheet should close
|
|
26
|
-
*/
|
|
27
12
|
onClose: () => void;
|
|
28
|
-
/**
|
|
29
|
-
* Array of button configurations to display in the footer
|
|
30
|
-
*/
|
|
31
13
|
buttons?: ButtonProps[];
|
|
32
|
-
/**
|
|
33
|
-
* Custom width for the sheet (applies to left/right sides)
|
|
34
|
-
*/
|
|
35
14
|
width?: number | string;
|
|
36
|
-
/**
|
|
37
|
-
* Custom height for the sheet (applies to top/bottom sides)
|
|
38
|
-
*/
|
|
39
15
|
height?: number | string;
|
|
40
|
-
/**
|
|
41
|
-
* Whether to show the header section
|
|
42
|
-
* @default true
|
|
43
|
-
*/
|
|
44
16
|
showHeader?: boolean;
|
|
45
|
-
/**
|
|
46
|
-
* Whether to show the footer section
|
|
47
|
-
* @default true
|
|
48
|
-
*/
|
|
49
17
|
showFooter?: boolean;
|
|
50
|
-
/**
|
|
51
|
-
* Content to display in the sheet body
|
|
52
|
-
*/
|
|
53
18
|
children: React.ReactNode;
|
|
54
|
-
/**
|
|
55
|
-
* Additional CSS classes for the header
|
|
56
|
-
*/
|
|
57
19
|
headerClassName?: string;
|
|
58
|
-
/**
|
|
59
|
-
* Additional CSS classes for the content area
|
|
60
|
-
*/
|
|
61
20
|
contentClassName?: string;
|
|
62
|
-
/**
|
|
63
|
-
* Additional CSS classes for the footer
|
|
64
|
-
*/
|
|
65
21
|
footerClassName?: string;
|
|
66
|
-
/**
|
|
67
|
-
* Whether to disable buttons during loading state
|
|
68
|
-
* @default false
|
|
69
|
-
*/
|
|
70
22
|
loading?: boolean;
|
|
71
23
|
}
|
|
72
|
-
/**
|
|
73
|
-
* Slide-out panel component that appears from the sides (or top/bottom) of the screen.
|
|
74
|
-
* Features smooth animations, backdrop overlay, ESC key support, and body scroll locking.
|
|
75
|
-
*
|
|
76
|
-
* @example
|
|
77
|
-
* ```tsx
|
|
78
|
-
* <Sheet
|
|
79
|
-
* open={isOpen}
|
|
80
|
-
* onClose={() => setIsOpen(false)}
|
|
81
|
-
* side="right"
|
|
82
|
-
* title="Edit Profile"
|
|
83
|
-
* description="Update your personal information"
|
|
84
|
-
* buttons={[
|
|
85
|
-
* { children: 'Cancel', variant: 'outline', onClick: handleCancel },
|
|
86
|
-
* { children: 'Save', onClick: handleSave }
|
|
87
|
-
* ]}
|
|
88
|
-
* >
|
|
89
|
-
* <form>...</form>
|
|
90
|
-
* </Sheet>
|
|
91
|
-
* ```
|
|
92
|
-
*/
|
|
93
24
|
declare const Sheet: React.ForwardRefExoticComponent<SheetProps & React.RefAttributes<HTMLDivElement>>;
|
|
94
25
|
export { Sheet };
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { j as e } from "../../../_virtual/jsx-runtime.js";
|
|
2
2
|
import * as i from "react";
|
|
3
|
-
import { createPortal as H } from "react-dom";
|
|
4
3
|
import { cva as g } from "../../../node_modules/class-variance-authority/dist/index.js";
|
|
5
4
|
import { normalizeDimension as p, cn as r } from "../../../lib/utils.js";
|
|
6
|
-
import { useBodyScrollLock as
|
|
7
|
-
import { useEscapeKey as
|
|
8
|
-
import {
|
|
9
|
-
import { Button as
|
|
10
|
-
import {
|
|
11
|
-
const
|
|
12
|
-
"fixed z-
|
|
5
|
+
import { useBodyScrollLock as H } from "../../../hooks/use-body-scroll-lock.js";
|
|
6
|
+
import { useEscapeKey as M } from "../../../hooks/use-escape-key.js";
|
|
7
|
+
import { Typography as x } from "../../atoms/typography/typography.js";
|
|
8
|
+
import { Button as b } from "../../atoms/button/button.js";
|
|
9
|
+
import { Icon as R } from "../../atoms/icon/icon.js";
|
|
10
|
+
const W = g(
|
|
11
|
+
"fixed z-50 bg-background shadow-lg transition-transform duration-300 ease-in-out",
|
|
13
12
|
{
|
|
14
13
|
variants: {
|
|
15
14
|
side: {
|
|
@@ -38,8 +37,8 @@ const D = g(
|
|
|
38
37
|
isOpen: !1
|
|
39
38
|
}
|
|
40
39
|
}
|
|
41
|
-
),
|
|
42
|
-
"fixed inset-0 z-
|
|
40
|
+
), C = g(
|
|
41
|
+
"fixed inset-0 z-50 bg-black/50 transition-opacity duration-300",
|
|
43
42
|
{
|
|
44
43
|
variants: {
|
|
45
44
|
isOpen: {
|
|
@@ -51,10 +50,10 @@ const D = g(
|
|
|
51
50
|
isOpen: !1
|
|
52
51
|
}
|
|
53
52
|
}
|
|
54
|
-
),
|
|
53
|
+
), D = i.forwardRef(
|
|
55
54
|
({
|
|
56
55
|
className: y,
|
|
57
|
-
side:
|
|
56
|
+
side: t = "right",
|
|
58
57
|
title: l,
|
|
59
58
|
description: o,
|
|
60
59
|
open: a,
|
|
@@ -72,25 +71,26 @@ const D = g(
|
|
|
72
71
|
...V
|
|
73
72
|
}, E) => {
|
|
74
73
|
const [I, f] = i.useState(!1), [u, h] = i.useState(!1);
|
|
75
|
-
if (
|
|
74
|
+
if (H(a), M(a, n), i.useEffect(() => {
|
|
76
75
|
if (a) {
|
|
77
76
|
f(!0);
|
|
78
|
-
const
|
|
79
|
-
return () => clearTimeout(
|
|
77
|
+
const s = setTimeout(() => h(!0), 10);
|
|
78
|
+
return () => clearTimeout(s);
|
|
80
79
|
} else {
|
|
81
80
|
h(!1);
|
|
82
|
-
const
|
|
83
|
-
return () => clearTimeout(
|
|
81
|
+
const s = setTimeout(() => f(!1), 300);
|
|
82
|
+
return () => clearTimeout(s);
|
|
84
83
|
}
|
|
85
84
|
}, [a]), !I) return null;
|
|
86
85
|
const d = p(j), m = p(v), A = {
|
|
87
|
-
...d && (
|
|
88
|
-
...m && (
|
|
89
|
-
}
|
|
86
|
+
...d && (t === "left" || t === "right") ? { width: d, maxWidth: d } : {},
|
|
87
|
+
...m && (t === "top" || t === "bottom") ? { height: m, maxHeight: m } : {}
|
|
88
|
+
};
|
|
89
|
+
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
90
90
|
/* @__PURE__ */ e.jsx(
|
|
91
91
|
"div",
|
|
92
92
|
{
|
|
93
|
-
className:
|
|
93
|
+
className: C({ isOpen: u }),
|
|
94
94
|
onClick: n,
|
|
95
95
|
"aria-hidden": "true"
|
|
96
96
|
}
|
|
@@ -99,7 +99,7 @@ const D = g(
|
|
|
99
99
|
"div",
|
|
100
100
|
{
|
|
101
101
|
ref: E,
|
|
102
|
-
className: r(
|
|
102
|
+
className: r(W({ side: t, isOpen: u }), y),
|
|
103
103
|
style: A,
|
|
104
104
|
role: "dialog",
|
|
105
105
|
"aria-modal": "true",
|
|
@@ -117,7 +117,7 @@ const D = g(
|
|
|
117
117
|
children: [
|
|
118
118
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
119
119
|
l && /* @__PURE__ */ e.jsx(
|
|
120
|
-
|
|
120
|
+
x,
|
|
121
121
|
{
|
|
122
122
|
id: "sheet-title",
|
|
123
123
|
as: "h2",
|
|
@@ -127,7 +127,7 @@ const D = g(
|
|
|
127
127
|
}
|
|
128
128
|
),
|
|
129
129
|
o && /* @__PURE__ */ e.jsx(
|
|
130
|
-
|
|
130
|
+
x,
|
|
131
131
|
{
|
|
132
132
|
id: "sheet-description",
|
|
133
133
|
variant: "muted",
|
|
@@ -137,14 +137,14 @@ const D = g(
|
|
|
137
137
|
)
|
|
138
138
|
] }),
|
|
139
139
|
/* @__PURE__ */ e.jsx(
|
|
140
|
-
|
|
140
|
+
b,
|
|
141
141
|
{
|
|
142
142
|
variant: "ghost",
|
|
143
143
|
size: "icon",
|
|
144
144
|
onClick: n,
|
|
145
145
|
"aria-label": "Close",
|
|
146
146
|
className: "h-6 w-6",
|
|
147
|
-
children: /* @__PURE__ */ e.jsx(
|
|
147
|
+
children: /* @__PURE__ */ e.jsx(R, { name: "X", size: "md" })
|
|
148
148
|
}
|
|
149
149
|
)
|
|
150
150
|
]
|
|
@@ -158,13 +158,13 @@ const D = g(
|
|
|
158
158
|
"flex items-center justify-end gap-3 border-t border-border p-6",
|
|
159
159
|
z
|
|
160
160
|
),
|
|
161
|
-
children: c.map((
|
|
162
|
-
|
|
161
|
+
children: c.map((s, B) => /* @__PURE__ */ e.jsx(
|
|
162
|
+
b,
|
|
163
163
|
{
|
|
164
|
-
disabled: T ||
|
|
165
|
-
...
|
|
164
|
+
disabled: T || s.disabled,
|
|
165
|
+
...s
|
|
166
166
|
},
|
|
167
|
-
|
|
167
|
+
B
|
|
168
168
|
))
|
|
169
169
|
}
|
|
170
170
|
)
|
|
@@ -172,10 +172,9 @@ const D = g(
|
|
|
172
172
|
}
|
|
173
173
|
)
|
|
174
174
|
] });
|
|
175
|
-
return H(B, document.body);
|
|
176
175
|
}
|
|
177
176
|
);
|
|
178
|
-
|
|
177
|
+
D.displayName = "Sheet";
|
|
179
178
|
export {
|
|
180
|
-
|
|
179
|
+
D as Sheet
|
|
181
180
|
};
|