@yuno-payments/dashboard-design-system 0.0.166 → 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 +3 -115
- package/dist/components/organisms/data-table/data-table.js +104 -131
- package/dist/components/organisms/data-table/data-table.types.d.ts +24 -23
- 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 -7
- package/dist/components/organisms/data-table/hooks/use-data-table-state.js +46 -80
- 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,64 +1,10 @@
|
|
|
1
1
|
import { Switch as ShadcnSwitch } from '../../../vendor/shadcn/switch';
|
|
2
|
-
import { ComponentProps
|
|
3
|
-
|
|
4
|
-
* Props for the Switch component
|
|
5
|
-
*/
|
|
6
|
-
export interface SwitchProps extends Omit<ComponentProps<typeof ShadcnSwitch>, "children" | "onCheckedChange" | "className" | "onChange"> {
|
|
7
|
-
/**
|
|
8
|
-
* Label text displayed next to the switch
|
|
9
|
-
*/
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
export interface SwitchProps extends Omit<ComponentProps<typeof ShadcnSwitch>, "children"> {
|
|
10
4
|
label: string;
|
|
11
|
-
/**
|
|
12
|
-
* Optional description text displayed below the label
|
|
13
|
-
*/
|
|
14
5
|
description?: string;
|
|
15
|
-
/**
|
|
16
|
-
* Position of the switch relative to the label
|
|
17
|
-
* @default "left"
|
|
18
|
-
*/
|
|
19
6
|
side?: "left" | "right";
|
|
20
|
-
/**
|
|
21
|
-
* Visual variant of the switch container
|
|
22
|
-
* - "default": minimal layout without background
|
|
23
|
-
* - "box": contained layout with background, border, and padding
|
|
24
|
-
* @default "default"
|
|
25
|
-
*/
|
|
26
7
|
variant?: "default" | "box";
|
|
27
|
-
/**
|
|
28
|
-
* Callback fired when the switch state changes
|
|
29
|
-
* Provides a synthetic ChangeEvent compatible with react-hook-form
|
|
30
|
-
*/
|
|
31
|
-
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
32
|
-
/**
|
|
33
|
-
* Additional CSS classes to apply to the wrapper container
|
|
34
|
-
*/
|
|
35
|
-
className?: string;
|
|
36
|
-
/**
|
|
37
|
-
* Additional CSS classes to apply to the switch element itself
|
|
38
|
-
*/
|
|
39
|
-
switchClassName?: string;
|
|
40
|
-
/**
|
|
41
|
-
* Additional CSS classes to apply to the label element
|
|
42
|
-
*/
|
|
43
|
-
labelClassName?: string;
|
|
44
|
-
/**
|
|
45
|
-
* Optional info icon with tooltip
|
|
46
|
-
*/
|
|
47
|
-
info?: string;
|
|
48
8
|
}
|
|
49
|
-
/**
|
|
50
|
-
* Toggle switch component with label and optional description.
|
|
51
|
-
* Supports left/right positioning and box variant for emphasized display.
|
|
52
|
-
*
|
|
53
|
-
* @example
|
|
54
|
-
* ```tsx
|
|
55
|
-
* <Switch
|
|
56
|
-
* label="Enable notifications"
|
|
57
|
-
* description="Receive email notifications for updates"
|
|
58
|
-
* checked={isEnabled}
|
|
59
|
-
* onChange={(e) => setIsEnabled(e.target.checked)}
|
|
60
|
-
* />
|
|
61
|
-
* ```
|
|
62
|
-
*/
|
|
63
9
|
declare const Switch: import('react').ForwardRefExoticComponent<Omit<SwitchProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
64
10
|
export { Switch };
|
|
@@ -1,79 +1,47 @@
|
|
|
1
1
|
import { j as e } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import { Switch as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { Label as
|
|
6
|
-
const
|
|
2
|
+
import { Switch as p } from "../../../vendor/shadcn/switch.js";
|
|
3
|
+
import { forwardRef as f, useId as h } from "react";
|
|
4
|
+
import { cn as w } from "../../../lib/utils.js";
|
|
5
|
+
import { Label as u } from "../../../vendor/shadcn/label.js";
|
|
6
|
+
const j = f(
|
|
7
7
|
({
|
|
8
|
-
label:
|
|
9
|
-
description:
|
|
10
|
-
side:
|
|
11
|
-
variant:
|
|
12
|
-
id:
|
|
13
|
-
name:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
labelClassName: p,
|
|
19
|
-
...h
|
|
20
|
-
}, u) => {
|
|
21
|
-
const g = y(), r = d || t || g, w = (s) => {
|
|
22
|
-
if (!n) return;
|
|
23
|
-
n({
|
|
24
|
-
target: {
|
|
25
|
-
name: t || r,
|
|
26
|
-
checked: s,
|
|
27
|
-
type: "checkbox",
|
|
28
|
-
value: s ? "on" : "off"
|
|
29
|
-
},
|
|
30
|
-
currentTarget: {
|
|
31
|
-
name: t || r,
|
|
32
|
-
checked: s,
|
|
33
|
-
type: "checkbox",
|
|
34
|
-
value: s ? "on" : "off"
|
|
35
|
-
},
|
|
36
|
-
preventDefault: () => {
|
|
37
|
-
},
|
|
38
|
-
stopPropagation: () => {
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
}, b = /* @__PURE__ */ e.jsx(
|
|
42
|
-
v,
|
|
8
|
+
label: t,
|
|
9
|
+
description: s,
|
|
10
|
+
side: o = "left",
|
|
11
|
+
variant: a = "default",
|
|
12
|
+
id: i,
|
|
13
|
+
name: l,
|
|
14
|
+
...c
|
|
15
|
+
}, m) => {
|
|
16
|
+
const x = h(), r = i || l || x, d = /* @__PURE__ */ e.jsx(
|
|
17
|
+
p,
|
|
43
18
|
{
|
|
44
|
-
ref:
|
|
19
|
+
ref: m,
|
|
45
20
|
id: r,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
onCheckedChange: w,
|
|
49
|
-
...h
|
|
21
|
+
className: "cursor-pointer",
|
|
22
|
+
...c
|
|
50
23
|
}
|
|
51
|
-
),
|
|
52
|
-
"flex
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
m
|
|
58
|
-
);
|
|
59
|
-
return /* @__PURE__ */ e.jsxs("div", { className: j, children: [
|
|
60
|
-
b,
|
|
24
|
+
), n = w("flex gap-3 items-start", {
|
|
25
|
+
"flex-row-reverse": o === "right",
|
|
26
|
+
"bg-white box-border justify-start p-4 rounded-lg border shadow-xs": a === "box"
|
|
27
|
+
});
|
|
28
|
+
return /* @__PURE__ */ e.jsxs("div", { className: n, children: [
|
|
29
|
+
d,
|
|
61
30
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2 flex-1", children: [
|
|
62
|
-
/* @__PURE__ */ e.jsx(
|
|
63
|
-
|
|
31
|
+
/* @__PURE__ */ e.jsx(
|
|
32
|
+
u,
|
|
64
33
|
{
|
|
65
34
|
htmlFor: r,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
children: c
|
|
35
|
+
className: "text-sm leading-[18.39px] cursor-pointer",
|
|
36
|
+
children: t
|
|
69
37
|
}
|
|
70
|
-
)
|
|
71
|
-
|
|
38
|
+
),
|
|
39
|
+
s && /* @__PURE__ */ e.jsx("p", { className: "text-sm text-neutral-500", children: s })
|
|
72
40
|
] })
|
|
73
41
|
] });
|
|
74
42
|
}
|
|
75
43
|
);
|
|
76
|
-
|
|
44
|
+
j.displayName = "Switch";
|
|
77
45
|
export {
|
|
78
|
-
|
|
46
|
+
j as Switch
|
|
79
47
|
};
|
|
@@ -1,17 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tabs components for organizing content into switchable panels.
|
|
3
|
-
* Composed of Tabs (root), TabsList, TabsTrigger, and TabsContent.
|
|
4
|
-
*
|
|
5
|
-
* @example
|
|
6
|
-
* ```tsx
|
|
7
|
-
* <Tabs defaultValue="tab1">
|
|
8
|
-
* <TabsList>
|
|
9
|
-
* <TabsTrigger value="tab1">Tab 1</TabsTrigger>
|
|
10
|
-
* <TabsTrigger value="tab2">Tab 2</TabsTrigger>
|
|
11
|
-
* </TabsList>
|
|
12
|
-
* <TabsContent value="tab1">Content 1</TabsContent>
|
|
13
|
-
* <TabsContent value="tab2">Content 2</TabsContent>
|
|
14
|
-
* </Tabs>
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
1
|
export { Tabs, TabsList, TabsTrigger, TabsContent } from '../../../vendor/shadcn/tabs';
|
|
@@ -3,44 +3,12 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
3
3
|
declare const textareaWrapperVariants: (props?: ({
|
|
4
4
|
layout?: "horizontal" | "vertical" | null | undefined;
|
|
5
5
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
|
-
/**
|
|
7
|
-
* Props for the Textarea component
|
|
8
|
-
*/
|
|
9
6
|
export interface TextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "className">, VariantProps<typeof textareaWrapperVariants> {
|
|
10
|
-
/**
|
|
11
|
-
* Label text displayed above or next to the textarea
|
|
12
|
-
*/
|
|
13
7
|
label?: string;
|
|
14
|
-
/**
|
|
15
|
-
* Helper text displayed below the textarea
|
|
16
|
-
*/
|
|
17
8
|
description?: string;
|
|
18
|
-
/**
|
|
19
|
-
* Error message displayed below the textarea (overrides description)
|
|
20
|
-
*/
|
|
21
9
|
error?: string;
|
|
22
|
-
/**
|
|
23
|
-
* Additional CSS classes for the container
|
|
24
|
-
*/
|
|
25
10
|
className?: string;
|
|
26
|
-
/**
|
|
27
|
-
* Additional props to pass to the textarea element
|
|
28
|
-
*/
|
|
29
11
|
textareaProps?: TextareaHTMLAttributes<HTMLTextAreaElement>;
|
|
30
12
|
}
|
|
31
|
-
/**
|
|
32
|
-
* Multiline text input component with label, description, and error handling.
|
|
33
|
-
* Supports vertical and horizontal layouts.
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* ```tsx
|
|
37
|
-
* <Textarea
|
|
38
|
-
* label="Comments"
|
|
39
|
-
* placeholder="Enter your comments..."
|
|
40
|
-
* description="Max 500 characters"
|
|
41
|
-
* rows={4}
|
|
42
|
-
* />
|
|
43
|
-
* ```
|
|
44
|
-
*/
|
|
45
13
|
declare const Textarea: import('react').ForwardRefExoticComponent<TextareaProps & import('react').RefAttributes<HTMLTextAreaElement>>;
|
|
46
14
|
export { Textarea };
|
|
@@ -3,7 +3,7 @@ import { forwardRef as p, useId as h } from "react";
|
|
|
3
3
|
import { cva as d } from "../../../node_modules/class-variance-authority/dist/index.js";
|
|
4
4
|
import { Textarea as j } from "../../../vendor/shadcn/textarea.js";
|
|
5
5
|
import { cn as s } from "../../../lib/utils.js";
|
|
6
|
-
import { Label as N } from "
|
|
6
|
+
import { Label as N } from "../../../vendor/shadcn/label.js";
|
|
7
7
|
const b = d("flex gap-2 w-full", {
|
|
8
8
|
variants: {
|
|
9
9
|
layout: {
|
|
@@ -1,75 +1,4 @@
|
|
|
1
1
|
import { TimePickerProps as TimePickerPrimitiveProps } from '../../../vendor/shadcn/time-picker';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* Props for the TimePicker component
|
|
5
|
-
*/
|
|
6
|
-
export interface TimePickerProps extends Omit<TimePickerPrimitiveProps, "onChange"> {
|
|
7
|
-
/**
|
|
8
|
-
* Label text displayed above the input
|
|
9
|
-
*/
|
|
10
|
-
label?: string;
|
|
11
|
-
/**
|
|
12
|
-
* Error message displayed below the input
|
|
13
|
-
*/
|
|
14
|
-
error?: string;
|
|
15
|
-
/**
|
|
16
|
-
* Helper text displayed below the input
|
|
17
|
-
*/
|
|
18
|
-
description?: string;
|
|
19
|
-
/**
|
|
20
|
-
* Layout orientation
|
|
21
|
-
* @default "vertical"
|
|
22
|
-
*/
|
|
23
|
-
orientation?: "vertical" | "horizontal" | "responsive";
|
|
24
|
-
/**
|
|
25
|
-
* Callback fired when the time value changes
|
|
26
|
-
*/
|
|
27
|
-
onChange?: (value: string) => void;
|
|
28
|
-
/**
|
|
29
|
-
* Picker mode
|
|
30
|
-
* - "native": HTML5 native input (default)
|
|
31
|
-
* - "dropdown": Custom dropdown with columns
|
|
32
|
-
* @default "native"
|
|
33
|
-
*/
|
|
34
|
-
mode?: "native" | "dropdown";
|
|
35
|
-
/**
|
|
36
|
-
* Minute intervals (only for mode="dropdown")
|
|
37
|
-
* 0 = all minutes, 15 = every 15 minutes, etc.
|
|
38
|
-
* @default 0
|
|
39
|
-
*/
|
|
40
|
-
divisorMinutes?: number;
|
|
41
|
-
/**
|
|
42
|
-
* Width of the picker (only for mode="dropdown")
|
|
43
|
-
* @default 140
|
|
44
|
-
*/
|
|
45
|
-
width?: number | string;
|
|
46
|
-
/**
|
|
47
|
-
* Use 24-hour format (military time) instead of 12-hour with AM/PM
|
|
48
|
-
* @default false
|
|
49
|
-
*/
|
|
50
|
-
use24Hour?: boolean;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Time input picker with label, description, and error handling.
|
|
54
|
-
* Supports two modes: native HTML5 input or custom dropdown.
|
|
55
|
-
*
|
|
56
|
-
* @example
|
|
57
|
-
* ```tsx
|
|
58
|
-
* // Native mode (default)
|
|
59
|
-
* <TimePicker
|
|
60
|
-
* label="Select time"
|
|
61
|
-
* value={time}
|
|
62
|
-
* onChange={(value) => setTime(value)}
|
|
63
|
-
* />
|
|
64
|
-
*
|
|
65
|
-
* // Dropdown mode with 15-minute intervals
|
|
66
|
-
* <TimePicker
|
|
67
|
-
* mode="dropdown"
|
|
68
|
-
* divisorMinutes={15}
|
|
69
|
-
* value={time}
|
|
70
|
-
* onChange={(value) => setTime(value)}
|
|
71
|
-
* />
|
|
72
|
-
* ```
|
|
73
|
-
*/
|
|
74
|
-
declare const TimePicker: React.ForwardRefExoticComponent<TimePickerProps & React.RefAttributes<HTMLInputElement>>;
|
|
2
|
+
export type TimePickerProps = TimePickerPrimitiveProps;
|
|
3
|
+
declare const TimePicker: import('react').ForwardRefExoticComponent<TimePickerPrimitiveProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
75
4
|
export { TimePicker };
|
|
@@ -1,220 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { useId as J, useState as $, useRef as C, useEffect as E } from "react";
|
|
4
|
-
import { cn as c } from "../../../lib/utils.js";
|
|
5
|
-
import { Icon as K } from "../icon/icon.js";
|
|
6
|
-
import { TimePicker as Q } from "../../../vendor/shadcn/time-picker.js";
|
|
7
|
-
import { Field as R, FieldLabel as T, FieldDescription as O, FieldError as _ } from "../../../vendor/shadcn/field.js";
|
|
8
|
-
const X = Array.from({ length: 12 }, (e, n) => n + 1), Y = Array.from({ length: 24 }, (e, n) => n), Z = ["AM", "PM"], H = (e) => {
|
|
9
|
-
if (e === 0)
|
|
10
|
-
return Array.from({ length: 60 }, (o, i) => i);
|
|
11
|
-
const n = 60 / e;
|
|
12
|
-
return Array.from({ length: n }, (o, i) => i * e);
|
|
13
|
-
}, d = (e) => e.toString().padStart(2, "0"), ee = (e) => {
|
|
14
|
-
const n = e >= 12 ? "PM" : "AM";
|
|
15
|
-
return { hour: e === 0 ? 12 : e > 12 ? e - 12 : e, meridiem: n };
|
|
16
|
-
}, te = (e, n) => e === 12 ? n === "AM" ? 0 : 12 : n === "PM" ? e + 12 : e, re = G.forwardRef(
|
|
17
|
-
({
|
|
18
|
-
className: e,
|
|
19
|
-
label: n,
|
|
20
|
-
error: o,
|
|
21
|
-
description: i,
|
|
22
|
-
orientation: x = "vertical",
|
|
23
|
-
id: m,
|
|
24
|
-
onChange: f,
|
|
25
|
-
mode: y = "native",
|
|
26
|
-
divisorMinutes: j = 0,
|
|
27
|
-
width: s = 140,
|
|
28
|
-
value: l,
|
|
29
|
-
disabled: p,
|
|
30
|
-
use24Hour: w = !1,
|
|
31
|
-
...h
|
|
32
|
-
}, P) => {
|
|
33
|
-
const S = J(), u = m || S, v = !!o;
|
|
34
|
-
if (y === "native") {
|
|
35
|
-
const k = /* @__PURE__ */ r.jsx(
|
|
36
|
-
Q,
|
|
37
|
-
{
|
|
38
|
-
ref: P,
|
|
39
|
-
id: u,
|
|
40
|
-
value: l,
|
|
41
|
-
disabled: p,
|
|
42
|
-
className: c(
|
|
43
|
-
v && "border-destructive focus-visible:border-destructive",
|
|
44
|
-
!(n || o || i) && e
|
|
45
|
-
),
|
|
46
|
-
"aria-invalid": v ? !0 : void 0,
|
|
47
|
-
"aria-describedby": i || o ? `${u}-description` : void 0,
|
|
48
|
-
...h,
|
|
49
|
-
onChange: (a) => {
|
|
50
|
-
f?.(a.target.value);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
);
|
|
54
|
-
return n || o || i ? /* @__PURE__ */ r.jsxs(
|
|
55
|
-
R,
|
|
56
|
-
{
|
|
57
|
-
orientation: x,
|
|
58
|
-
"data-invalid": v,
|
|
59
|
-
className: c("w-full", e),
|
|
60
|
-
children: [
|
|
61
|
-
n && /* @__PURE__ */ r.jsx(T, { htmlFor: u, children: n }),
|
|
62
|
-
/* @__PURE__ */ r.jsxs("div", { className: "flex flex-col gap-2 flex-1", children: [
|
|
63
|
-
k,
|
|
64
|
-
i && !o && /* @__PURE__ */ r.jsx(O, { id: `${u}-description`, children: i }),
|
|
65
|
-
o && /* @__PURE__ */ r.jsx(_, { id: `${u}-description`, children: o })
|
|
66
|
-
] })
|
|
67
|
-
]
|
|
68
|
-
}
|
|
69
|
-
) : k;
|
|
70
|
-
}
|
|
71
|
-
return /* @__PURE__ */ r.jsx(
|
|
72
|
-
ne,
|
|
73
|
-
{
|
|
74
|
-
value: l || (w ? "00:00" : "12:00"),
|
|
75
|
-
onChange: f,
|
|
76
|
-
divisorMinutes: j,
|
|
77
|
-
width: s,
|
|
78
|
-
label: n,
|
|
79
|
-
error: o,
|
|
80
|
-
description: i,
|
|
81
|
-
disabled: p,
|
|
82
|
-
className: e,
|
|
83
|
-
use24Hour: w
|
|
84
|
-
}
|
|
85
|
-
);
|
|
86
|
-
}
|
|
87
|
-
);
|
|
88
|
-
re.displayName = "TimePicker";
|
|
89
|
-
const ne = ({
|
|
90
|
-
value: e,
|
|
91
|
-
onChange: n,
|
|
92
|
-
divisorMinutes: o,
|
|
93
|
-
width: i,
|
|
94
|
-
label: x,
|
|
95
|
-
error: m,
|
|
96
|
-
description: f,
|
|
97
|
-
disabled: y,
|
|
98
|
-
className: j,
|
|
99
|
-
use24Hour: s = !1
|
|
100
|
-
}) => {
|
|
101
|
-
const [l, p] = $(!1), w = C(null), h = C(null), P = (t) => {
|
|
102
|
-
const [g, B] = t.split(":"), N = parseInt(g, 10) || 0, A = parseInt(B, 10) || 0;
|
|
103
|
-
if (s)
|
|
104
|
-
return { hour24: N, minute: A, hour: N, meridiem: "AM" };
|
|
105
|
-
const { hour: W, meridiem: q } = ee(N);
|
|
106
|
-
return { hour24: N, minute: A, hour: W, meridiem: q };
|
|
107
|
-
}, { hour: S, hour24: u, minute: v, meridiem: k } = P(e), [a, D] = $(s ? u : S), [b, F] = $(v), [M, L] = $(k), U = H(o);
|
|
108
|
-
E(() => {
|
|
109
|
-
let t;
|
|
110
|
-
s ? t = a : t = te(a, M);
|
|
111
|
-
const g = `${d(t)}:${d(b)}`;
|
|
112
|
-
n?.(g);
|
|
113
|
-
}, [a, b, M, n, s]), E(() => {
|
|
114
|
-
const t = (g) => {
|
|
115
|
-
h.current && !h.current.contains(g.target) && p(!1);
|
|
116
|
-
};
|
|
117
|
-
if (l)
|
|
118
|
-
return document.addEventListener("mousedown", t), () => document.removeEventListener("mousedown", t);
|
|
119
|
-
}, [l]);
|
|
120
|
-
const V = s ? `${d(a)}:${d(b)}` : `${d(a)}:${d(b)} ${M}`, z = s ? Y : X, I = /* @__PURE__ */ r.jsxs(
|
|
121
|
-
"div",
|
|
122
|
-
{
|
|
123
|
-
ref: h,
|
|
124
|
-
className: c("relative inline-block", j),
|
|
125
|
-
style: { width: typeof i == "number" ? `${i}px` : i },
|
|
126
|
-
children: [
|
|
127
|
-
/* @__PURE__ */ r.jsxs(
|
|
128
|
-
"button",
|
|
129
|
-
{
|
|
130
|
-
type: "button",
|
|
131
|
-
disabled: y,
|
|
132
|
-
onClick: () => !y && p(!l),
|
|
133
|
-
className: c(
|
|
134
|
-
"flex items-center justify-between w-full h-9 px-3 py-2",
|
|
135
|
-
"text-sm rounded-md border border-input bg-background",
|
|
136
|
-
"hover:bg-accent hover:text-accent-foreground",
|
|
137
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
138
|
-
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
139
|
-
m && "border-destructive"
|
|
140
|
-
),
|
|
141
|
-
children: [
|
|
142
|
-
/* @__PURE__ */ r.jsx("span", { children: V }),
|
|
143
|
-
/* @__PURE__ */ r.jsx(
|
|
144
|
-
K,
|
|
145
|
-
{
|
|
146
|
-
name: l ? "CaretUp" : "CaretDown",
|
|
147
|
-
size: "sm",
|
|
148
|
-
className: "ml-2"
|
|
149
|
-
}
|
|
150
|
-
)
|
|
151
|
-
]
|
|
152
|
-
}
|
|
153
|
-
),
|
|
154
|
-
l && /* @__PURE__ */ r.jsxs(
|
|
155
|
-
"div",
|
|
156
|
-
{
|
|
157
|
-
ref: w,
|
|
158
|
-
className: c(
|
|
159
|
-
"absolute z-50 mt-1 bg-popover border border-border rounded-md shadow-lg",
|
|
160
|
-
"flex divide-x divide-border"
|
|
161
|
-
),
|
|
162
|
-
style: { width: "fit-content", minWidth: s ? "140px" : "200px" },
|
|
163
|
-
children: [
|
|
164
|
-
/* @__PURE__ */ r.jsx("div", { className: "flex flex-col overflow-y-auto max-h-[200px] min-w-[60px]", children: z.map((t) => /* @__PURE__ */ r.jsx(
|
|
165
|
-
"button",
|
|
166
|
-
{
|
|
167
|
-
type: "button",
|
|
168
|
-
onClick: () => D(t),
|
|
169
|
-
className: c(
|
|
170
|
-
"px-3 py-2 text-sm text-left hover:bg-accent",
|
|
171
|
-
a === t && "bg-primary text-primary-foreground hover:bg-primary"
|
|
172
|
-
),
|
|
173
|
-
children: d(t)
|
|
174
|
-
},
|
|
175
|
-
t
|
|
176
|
-
)) }),
|
|
177
|
-
/* @__PURE__ */ r.jsx("div", { className: "flex flex-col overflow-y-auto max-h-[200px] min-w-[60px]", children: U.map((t) => /* @__PURE__ */ r.jsx(
|
|
178
|
-
"button",
|
|
179
|
-
{
|
|
180
|
-
type: "button",
|
|
181
|
-
onClick: () => F(t),
|
|
182
|
-
className: c(
|
|
183
|
-
"px-3 py-2 text-sm text-left hover:bg-accent",
|
|
184
|
-
b === t && "bg-primary text-primary-foreground hover:bg-primary"
|
|
185
|
-
),
|
|
186
|
-
children: d(t)
|
|
187
|
-
},
|
|
188
|
-
t
|
|
189
|
-
)) }),
|
|
190
|
-
!s && /* @__PURE__ */ r.jsx("div", { className: "flex flex-col min-w-[60px]", children: Z.map((t) => /* @__PURE__ */ r.jsx(
|
|
191
|
-
"button",
|
|
192
|
-
{
|
|
193
|
-
type: "button",
|
|
194
|
-
onClick: () => L(t),
|
|
195
|
-
className: c(
|
|
196
|
-
"px-3 py-2 text-sm text-left hover:bg-accent",
|
|
197
|
-
M === t && "bg-primary text-primary-foreground hover:bg-primary"
|
|
198
|
-
),
|
|
199
|
-
children: t
|
|
200
|
-
},
|
|
201
|
-
t
|
|
202
|
-
)) })
|
|
203
|
-
]
|
|
204
|
-
}
|
|
205
|
-
)
|
|
206
|
-
]
|
|
207
|
-
}
|
|
208
|
-
);
|
|
209
|
-
return x || m || f ? /* @__PURE__ */ r.jsxs(R, { orientation: "vertical", className: c("w-full", j), children: [
|
|
210
|
-
x && /* @__PURE__ */ r.jsx(T, { children: x }),
|
|
211
|
-
/* @__PURE__ */ r.jsxs("div", { className: "flex flex-col gap-2 flex-1", children: [
|
|
212
|
-
I,
|
|
213
|
-
f && !m && /* @__PURE__ */ r.jsx(O, { children: f }),
|
|
214
|
-
m && /* @__PURE__ */ r.jsx(_, { children: m })
|
|
215
|
-
] })
|
|
216
|
-
] }) : I;
|
|
217
|
-
};
|
|
1
|
+
import { TimePicker as e } from "../../../vendor/shadcn/time-picker.js";
|
|
2
|
+
const r = e;
|
|
218
3
|
export {
|
|
219
|
-
|
|
4
|
+
r as TimePicker
|
|
220
5
|
};
|
|
@@ -1,16 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Toast notification container component (based on Sonner).
|
|
3
|
-
* Place once at root level to enable toast notifications globally.
|
|
4
|
-
* Use with toast() function from sonner.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```tsx
|
|
8
|
-
* // In root layout:
|
|
9
|
-
* <Toaster />
|
|
10
|
-
*
|
|
11
|
-
* // Anywhere in app:
|
|
12
|
-
* import { toast } from 'sonner';
|
|
13
|
-
* toast.success('Operation successful!');
|
|
14
|
-
* ```
|
|
15
|
-
*/
|
|
16
1
|
export { Toaster } from '../../../vendor/shadcn/sonner';
|
|
@@ -2,35 +2,10 @@ import { ToggleGroup as ShadcnToggleGroup, ToggleGroupItem as ShadcnToggleGroupI
|
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
3
|
import { toggleVariants } from '../../../vendor/shadcn/toggle';
|
|
4
4
|
import * as React from "react";
|
|
5
|
-
|
|
6
|
-
* Props for the ToggleGroup component
|
|
7
|
-
*/
|
|
8
|
-
export interface ToggleGroupProps extends Omit<React.ComponentPropsWithoutRef<typeof ShadcnToggleGroup>, "onValueChange">, VariantProps<typeof toggleVariants> {
|
|
9
|
-
/**
|
|
10
|
-
* Callback fired when the selected value changes
|
|
11
|
-
*/
|
|
12
|
-
onChange?: (value: string) => void;
|
|
5
|
+
export interface ToggleGroupProps extends React.ComponentPropsWithoutRef<typeof ShadcnToggleGroup>, VariantProps<typeof toggleVariants> {
|
|
13
6
|
}
|
|
14
|
-
/**
|
|
15
|
-
* Props for the ToggleGroupItem component
|
|
16
|
-
*/
|
|
17
7
|
export interface ToggleGroupItemProps extends React.ComponentPropsWithoutRef<typeof ShadcnToggleGroupItem>, VariantProps<typeof toggleVariants> {
|
|
18
8
|
}
|
|
19
|
-
/**
|
|
20
|
-
* Group of toggle buttons for single or multiple selection.
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* ```tsx
|
|
24
|
-
* <ToggleGroup type="single" value={selected} onChange={setSelected}>
|
|
25
|
-
* <ToggleGroupItem value="left">Left</ToggleGroupItem>
|
|
26
|
-
* <ToggleGroupItem value="center">Center</ToggleGroupItem>
|
|
27
|
-
* <ToggleGroupItem value="right">Right</ToggleGroupItem>
|
|
28
|
-
* </ToggleGroup>
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
9
|
declare const ToggleGroup: React.ForwardRefExoticComponent<ToggleGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
32
|
-
/**
|
|
33
|
-
* Individual toggle button within a ToggleGroup
|
|
34
|
-
*/
|
|
35
10
|
declare const ToggleGroupItem: React.ForwardRefExoticComponent<ToggleGroupItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
36
11
|
export { ToggleGroup, ToggleGroupItem };
|
|
@@ -1,33 +1,32 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import * as
|
|
3
|
-
import { ToggleGroup as
|
|
1
|
+
import { j as s } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import * as a from "react";
|
|
3
|
+
import { ToggleGroup as l, ToggleGroupItem as u } from "../../../vendor/shadcn/toggle-group.js";
|
|
4
4
|
import { cn as t } from "../../../lib/utils.js";
|
|
5
|
-
const
|
|
6
|
-
|
|
5
|
+
const f = a.forwardRef(({ className: o, variant: r, size: e, children: m, ...g }, p) => /* @__PURE__ */ s.jsx(
|
|
6
|
+
l,
|
|
7
7
|
{
|
|
8
|
-
ref:
|
|
8
|
+
ref: p,
|
|
9
9
|
className: t(o),
|
|
10
10
|
variant: r,
|
|
11
11
|
size: e,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
children: a
|
|
12
|
+
...g,
|
|
13
|
+
children: m
|
|
15
14
|
}
|
|
16
15
|
));
|
|
17
|
-
|
|
18
|
-
const G =
|
|
19
|
-
|
|
16
|
+
f.displayName = "ToggleGroup";
|
|
17
|
+
const G = a.forwardRef(({ className: o, variant: r, size: e, children: m, ...g }, p) => /* @__PURE__ */ s.jsx(
|
|
18
|
+
u,
|
|
20
19
|
{
|
|
21
|
-
ref:
|
|
20
|
+
ref: p,
|
|
22
21
|
className: t(o),
|
|
23
22
|
variant: r,
|
|
24
23
|
size: e,
|
|
25
24
|
...g,
|
|
26
|
-
children:
|
|
25
|
+
children: m
|
|
27
26
|
}
|
|
28
27
|
));
|
|
29
28
|
G.displayName = "ToggleGroupItem";
|
|
30
29
|
export {
|
|
31
|
-
|
|
30
|
+
f as ToggleGroup,
|
|
32
31
|
G as ToggleGroupItem
|
|
33
32
|
};
|