impact-nova 0.1.13 → 1.1.0
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/layout/dashboard-layout.d.ts +21 -6
- package/dist/components/ui/accordion-nested-list/accordion-nested-list.js +32 -33
- package/dist/components/ui/accordion.js +25 -23
- package/dist/components/ui/ag-grid-react/cell-renderers/date-display-renderer.js +32 -21
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/date-cell-editor.d.ts +3 -5
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/date-cell-editor.js +57 -55
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.d.ts +5 -0
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.js +50 -52
- package/dist/components/ui/ag-grid-react/cell-renderers/input-display-renderer.d.ts +1 -1
- package/dist/components/ui/ag-grid-react/cell-renderers/split-cell-renderer.js +34 -34
- package/dist/components/ui/ag-grid-react/headers/advanced-filter/column-filter-section.js +8 -11
- package/dist/components/ui/ag-grid-react/headers/column-menu/column-settings-menu.js +17 -17
- package/dist/components/ui/ag-grid-react/headers/header-search-input.js +3 -3
- package/dist/components/ui/alert-dialog.js +45 -40
- package/dist/components/ui/alert.d.ts +21 -4
- package/dist/components/ui/alert.js +45 -25
- package/dist/components/ui/avatar.js +19 -16
- package/dist/components/ui/badge.js +8 -1
- package/dist/components/ui/breadcrumb.js +1 -0
- package/dist/components/ui/button-group.d.ts +1 -1
- package/dist/components/ui/button-group.js +27 -32
- package/dist/components/ui/button-variants.d.ts +1 -1
- package/dist/components/ui/button.d.ts +11 -0
- package/dist/components/ui/button.js +11 -9
- package/dist/components/ui/calendar.d.ts +14 -2
- package/dist/components/ui/calendar.js +443 -376
- package/dist/components/ui/card.js +7 -6
- package/dist/components/ui/checkbox.js +64 -48
- package/dist/components/ui/chips.d.ts +1 -0
- package/dist/components/ui/chips.js +27 -19
- package/dist/components/ui/data-table/data-table-column-list.d.ts +4 -1
- package/dist/components/ui/data-table/data-table-column-list.js +58 -54
- package/dist/components/ui/data-table/data-table-sheet.d.ts +1 -1
- package/dist/components/ui/data-table/data-table-sheet.js +43 -40
- package/dist/components/ui/data-table/data-table-view-options.js +17 -17
- package/dist/components/ui/data-table/data-table.js +21 -20
- package/dist/components/ui/date-picker/date-picker.js +93 -93
- package/dist/components/ui/date-picker/date-range-picker.js +142 -133
- package/dist/components/ui/date-picker/month-picker.js +96 -93
- package/dist/components/ui/date-picker/month-range-picker.js +144 -134
- package/dist/components/ui/date-picker/multi-date-picker.js +43 -45
- package/dist/components/ui/date-picker/multi-month-picker.js +37 -39
- package/dist/components/ui/date-picker/multi-week-picker.js +56 -46
- package/dist/components/ui/date-picker/week-picker.js +119 -109
- package/dist/components/ui/date-picker/week-range-picker.js +170 -147
- package/dist/components/ui/dialog.js +15 -6
- package/dist/components/ui/drawer.js +16 -13
- package/dist/components/ui/dropdown-menu.js +4 -2
- package/dist/components/ui/dynamic-layout.d.ts +2 -2
- package/dist/components/ui/dynamic-layout.js +18 -15
- package/dist/components/ui/empty-container.js +69 -64
- package/dist/components/ui/file-upload.js +113 -106
- package/dist/components/ui/filter-panel/filter-panel.js +49 -46
- package/dist/components/ui/filter-strip/filter-strip.js +41 -37
- package/dist/components/ui/header.js +26 -25
- package/dist/components/ui/horizontal-scroller/horizontal-scroller.js +43 -40
- package/dist/components/ui/hover-card.js +6 -5
- package/dist/components/ui/input.d.ts +1 -1
- package/dist/components/ui/input.js +79 -68
- package/dist/components/ui/loader.d.ts +1 -0
- package/dist/components/ui/loader.js +23 -13
- package/dist/components/ui/nested-list/components/NestedListContent.d.ts +1 -3
- package/dist/components/ui/nested-list/components/NestedListContent.js +16 -15
- package/dist/components/ui/nested-list/components/SortableItem.js +116 -80
- package/dist/components/ui/nested-list/hooks/useNestedListDragDrop.d.ts +13 -1
- package/dist/components/ui/nested-list/hooks/useNestedListDragDrop.js +162 -112
- package/dist/components/ui/nested-list/nested-list.js +182 -189
- package/dist/components/ui/notification-panel/notification-item.js +19 -17
- package/dist/components/ui/notification-panel/notification-list.js +21 -21
- package/dist/components/ui/notification-panel/notification-panel.js +25 -25
- package/dist/components/ui/popover.js +37 -34
- package/dist/components/ui/progress.js +12 -10
- package/dist/components/ui/prompt.js +29 -27
- package/dist/components/ui/radio-group.js +55 -46
- package/dist/components/ui/select/components/Submenu.d.ts +1 -2
- package/dist/components/ui/select/components/Submenu.js +52 -48
- package/dist/components/ui/select/select.js +321 -324
- package/dist/components/ui/sheet.js +18 -15
- package/dist/components/ui/sidebar.d.ts +2 -2
- package/dist/components/ui/sidebar.js +3 -3
- package/dist/components/ui/skeleton.d.ts +2 -1
- package/dist/components/ui/skeleton.js +12 -11
- package/dist/components/ui/slider.js +39 -12
- package/dist/components/ui/smart-input.js +44 -39
- package/dist/components/ui/stepper.js +33 -29
- package/dist/components/ui/switch.js +6 -4
- package/dist/components/ui/tabs.js +50 -45
- package/dist/components/ui/tag-group.d.ts +2 -1
- package/dist/components/ui/tag-group.js +29 -25
- package/dist/components/ui/tag.d.ts +1 -0
- package/dist/components/ui/tag.js +26 -20
- package/dist/components/ui/textarea.js +18 -17
- package/dist/components/ui/toast.d.ts +1 -1
- package/dist/components/ui/toast.js +47 -41
- package/dist/components/ui/toaster.js +42 -42
- package/dist/components/ui/tooltip.js +18 -16
- package/dist/components/ui/types/date-picker.types.d.ts +33 -0
- package/dist/components/ui/types/empty-container.types.d.ts +5 -0
- package/dist/components/ui/types/nested-list.types.d.ts +1 -0
- package/dist/components/ui/types/select.types.d.ts +0 -1
- package/dist/icons/assets/bookmark.svg.js +4 -0
- package/dist/icons/assets/bookmark.svg2.js +5 -0
- package/dist/icons/assets/bookmarkFilled.svg.js +4 -0
- package/dist/icons/assets/bookmarkFilled.svg2.js +5 -0
- package/dist/icons/assets/download.svg.js +4 -0
- package/dist/icons/assets/download.svg2.js +5 -0
- package/dist/icons/index.d.ts +20 -6
- package/dist/icons/index.js +398 -370
- package/dist/impact-nova.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +318 -314
- package/dist/lib/fiscal-calendar.d.ts +62 -0
- package/dist/lib/fiscal-calendar.js +99 -0
- package/dist/lib/utils.d.ts +2 -1
- package/dist/lib/utils.js +29 -13
- package/package.json +5 -5
- package/dist/components/ui/select/hooks/useClickOutside.d.ts +0 -15
- package/dist/components/ui/select/hooks/useClickOutside.js +0 -43
- package/dist/components/ui/select/hooks/useMenuPosition.d.ts +0 -2
- package/dist/components/ui/select/hooks/useMenuPosition.js +0 -89
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
1
|
+
import { jsx as a, jsxs as d } from "react/jsx-runtime";
|
|
2
2
|
import * as n from "react";
|
|
3
3
|
import * as o from "@radix-ui/react-dialog";
|
|
4
4
|
import { cva as x } from "class-variance-authority";
|
|
@@ -12,7 +12,7 @@ const p = n.createContext({
|
|
|
12
12
|
o.Overlay,
|
|
13
13
|
{
|
|
14
14
|
className: i(
|
|
15
|
-
"fixed inset-0 z-
|
|
15
|
+
"fixed inset-0 z-50 bg-black/40 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
16
16
|
e
|
|
17
17
|
),
|
|
18
18
|
...t,
|
|
@@ -21,7 +21,7 @@ const p = n.createContext({
|
|
|
21
21
|
));
|
|
22
22
|
f.displayName = o.Overlay.displayName;
|
|
23
23
|
const w = x(
|
|
24
|
-
"fixed z-
|
|
24
|
+
"fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
25
25
|
{
|
|
26
26
|
variants: {
|
|
27
27
|
side: {
|
|
@@ -35,20 +35,21 @@ const w = x(
|
|
|
35
35
|
side: "right"
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
), C = n.forwardRef(({ side: e = "right", className: t, children: s, expandable:
|
|
39
|
-
const [
|
|
38
|
+
), C = n.forwardRef(({ side: e = "right", className: t, children: s, expandable: l = !1, ...c }, m) => {
|
|
39
|
+
const [r, h] = n.useState(!1), u = n.useCallback(() => {
|
|
40
40
|
h((g) => !g);
|
|
41
41
|
}, []);
|
|
42
|
-
return /* @__PURE__ */ a(p.Provider, { value: { isExpanded:
|
|
42
|
+
return /* @__PURE__ */ a(p.Provider, { value: { isExpanded: r, onExpandToggle: u, expandable: l, side: e || void 0 }, children: /* @__PURE__ */ d(S, { children: [
|
|
43
43
|
/* @__PURE__ */ a(f, {}),
|
|
44
44
|
/* @__PURE__ */ a(
|
|
45
45
|
o.Content,
|
|
46
46
|
{
|
|
47
47
|
ref: m,
|
|
48
|
+
"data-component": "sheet-content",
|
|
48
49
|
className: i(
|
|
49
50
|
w({ side: e }),
|
|
50
51
|
"flex flex-col p-0 transition-all duration-300",
|
|
51
|
-
e === "bottom" && (
|
|
52
|
+
e === "bottom" && (r ? "h-[96vh]" : "h-[40vh]"),
|
|
52
53
|
t
|
|
53
54
|
),
|
|
54
55
|
...c,
|
|
@@ -63,32 +64,33 @@ const k = ({
|
|
|
63
64
|
children: t,
|
|
64
65
|
...s
|
|
65
66
|
}) => {
|
|
66
|
-
const { isExpanded:
|
|
67
|
-
return /* @__PURE__ */
|
|
67
|
+
const { isExpanded: l, onExpandToggle: c, expandable: m, side: r } = n.useContext(p);
|
|
68
|
+
return /* @__PURE__ */ d(
|
|
68
69
|
"div",
|
|
69
70
|
{
|
|
70
71
|
className: i(
|
|
71
72
|
"flex px-4 py-4 shrink-0 items-center justify-between bg-light-blue border-b",
|
|
72
|
-
|
|
73
|
+
r === "bottom" && "rounded-t-lg",
|
|
73
74
|
e
|
|
74
75
|
),
|
|
75
76
|
...s,
|
|
76
77
|
children: [
|
|
77
78
|
/* @__PURE__ */ a("div", { className: "flex flex-col space-y-1 text-center sm:text-left", children: t }),
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
m && /* @__PURE__ */
|
|
79
|
+
/* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
|
|
80
|
+
m && /* @__PURE__ */ d(
|
|
80
81
|
"button",
|
|
81
82
|
{
|
|
82
83
|
type: "button",
|
|
84
|
+
"data-component": "sheet-expand-toggle",
|
|
83
85
|
onClick: c,
|
|
84
86
|
className: "rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none",
|
|
85
87
|
children: [
|
|
86
|
-
|
|
87
|
-
/* @__PURE__ */ a("span", { className: "sr-only", children:
|
|
88
|
+
l ? /* @__PURE__ */ a(y, { className: "h-4 w-4" }) : /* @__PURE__ */ a(b, { className: "h-4 w-4" }),
|
|
89
|
+
/* @__PURE__ */ a("span", { className: "sr-only", children: l ? "Collapse" : "Expand" })
|
|
88
90
|
]
|
|
89
91
|
}
|
|
90
92
|
),
|
|
91
|
-
/* @__PURE__ */
|
|
93
|
+
/* @__PURE__ */ d(v, { "data-component": "sheet-close", className: "rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none", children: [
|
|
92
94
|
/* @__PURE__ */ a(N, { className: "h-4 w-4" }),
|
|
93
95
|
/* @__PURE__ */ a("span", { className: "sr-only", children: "Close" })
|
|
94
96
|
] })
|
|
@@ -128,6 +130,7 @@ const R = n.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a(
|
|
|
128
130
|
o.Title,
|
|
129
131
|
{
|
|
130
132
|
ref: s,
|
|
133
|
+
"data-component": "sheet-title",
|
|
131
134
|
className: i("text-sm font-bold leading-none tracking-tight", e),
|
|
132
135
|
...t
|
|
133
136
|
}
|
|
@@ -68,7 +68,7 @@ declare const SidebarMenuButton: React.ForwardRefExoticComponent<Omit<React.Clas
|
|
|
68
68
|
tooltip?: string | React.ComponentProps<typeof TooltipContent>;
|
|
69
69
|
} & VariantProps<(props?: {
|
|
70
70
|
variant?: "default" | "outline";
|
|
71
|
-
size?: "
|
|
71
|
+
size?: "sm" | "lg" | "default";
|
|
72
72
|
} & import('class-variance-authority/types').ClassProp) => string>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
73
73
|
declare const SidebarLogout: React.ForwardRefExoticComponent<Omit<Omit<React.ClassAttributes<HTMLButtonElement> & React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
74
74
|
asChild?: boolean;
|
|
@@ -76,7 +76,7 @@ declare const SidebarLogout: React.ForwardRefExoticComponent<Omit<Omit<React.Cla
|
|
|
76
76
|
tooltip?: string | React.ComponentProps<typeof TooltipContent>;
|
|
77
77
|
} & VariantProps<(props?: {
|
|
78
78
|
variant?: "default" | "outline";
|
|
79
|
-
size?: "
|
|
79
|
+
size?: "sm" | "lg" | "default";
|
|
80
80
|
} & import('class-variance-authority/types').ClassProp) => string>, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
81
81
|
declare const SidebarMenuAction: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLButtonElement> & React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
82
82
|
asChild?: boolean;
|
|
@@ -153,7 +153,7 @@ const ee = i.forwardRef(({ className: a, onClick: r, ...e }, n) => {
|
|
|
153
153
|
},
|
|
154
154
|
...e,
|
|
155
155
|
children: [
|
|
156
|
-
d === "expanded" ? /* @__PURE__ */ t(H, { size:
|
|
156
|
+
d === "expanded" ? /* @__PURE__ */ t(H, { size: "3xl" }) : /* @__PURE__ */ t(j, { size: "3xl" }),
|
|
157
157
|
/* @__PURE__ */ t("span", { className: "sr-only", children: "Toggle Sidebar" })
|
|
158
158
|
]
|
|
159
159
|
}
|
|
@@ -313,7 +313,7 @@ const de = i.forwardRef(({ className: a, routes: r, activeValue: e, isActive: n,
|
|
|
313
313
|
ref: v,
|
|
314
314
|
"data-sidebar": "content",
|
|
315
315
|
className: l(
|
|
316
|
-
"flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
|
|
316
|
+
"flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto overflow-x-hidden group-data-[collapsible=icon]:overflow-hidden",
|
|
317
317
|
a
|
|
318
318
|
),
|
|
319
319
|
...b,
|
|
@@ -392,7 +392,7 @@ const B = i.forwardRef(({ className: a, children: r, ...e }, n) => {
|
|
|
392
392
|
/* @__PURE__ */ t("div", { className: "text-[#3bb273]", children: /* @__PURE__ */ t(
|
|
393
393
|
I,
|
|
394
394
|
{
|
|
395
|
-
size:
|
|
395
|
+
size: "lg",
|
|
396
396
|
className: l("transition-transform duration-200", d ? "-rotate-90" : "rotate-90")
|
|
397
397
|
}
|
|
398
398
|
) }),
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const Skeleton: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
2
3
|
export { Skeleton };
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
...
|
|
6
|
-
}) {
|
|
7
|
-
return /* @__PURE__ */ m(
|
|
2
|
+
import * as r from "react";
|
|
3
|
+
import { cn as t } from "../../lib/utils.js";
|
|
4
|
+
const n = r.forwardRef(
|
|
5
|
+
({ className: e, ...o }, a) => /* @__PURE__ */ m(
|
|
8
6
|
"div",
|
|
9
7
|
{
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
ref: a,
|
|
9
|
+
"data-component": "skeleton",
|
|
10
|
+
className: t("animate-pulse rounded-md bg-primary/10", e),
|
|
11
|
+
...o
|
|
12
12
|
}
|
|
13
|
-
)
|
|
14
|
-
|
|
13
|
+
)
|
|
14
|
+
);
|
|
15
|
+
n.displayName = "Skeleton";
|
|
15
16
|
export {
|
|
16
|
-
|
|
17
|
+
n as Skeleton
|
|
17
18
|
};
|
|
@@ -1,23 +1,50 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
1
|
+
import { jsxs as n, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import * as s from "react";
|
|
3
3
|
import * as e from "@radix-ui/react-slider";
|
|
4
|
-
import { cn as
|
|
5
|
-
const
|
|
4
|
+
import { cn as t } from "../../lib/utils.js";
|
|
5
|
+
const d = s.forwardRef(({ className: a, ...o }, i) => /* @__PURE__ */ n(
|
|
6
6
|
e.Root,
|
|
7
7
|
{
|
|
8
|
-
ref:
|
|
9
|
-
className:
|
|
8
|
+
ref: i,
|
|
9
|
+
className: t(
|
|
10
10
|
"relative flex w-full touch-none select-none items-center",
|
|
11
|
-
|
|
11
|
+
a
|
|
12
12
|
),
|
|
13
|
-
|
|
13
|
+
"data-component": "slider-root",
|
|
14
|
+
...o,
|
|
14
15
|
children: [
|
|
15
|
-
/* @__PURE__ */ r(
|
|
16
|
-
|
|
16
|
+
/* @__PURE__ */ r(
|
|
17
|
+
e.Track,
|
|
18
|
+
{
|
|
19
|
+
className: "relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20",
|
|
20
|
+
"data-component": "slider-track",
|
|
21
|
+
children: /* @__PURE__ */ r(
|
|
22
|
+
e.Range,
|
|
23
|
+
{
|
|
24
|
+
className: "absolute h-full bg-primary",
|
|
25
|
+
"data-component": "slider-range"
|
|
26
|
+
}
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
),
|
|
30
|
+
Array.isArray(o.value || o.defaultValue) ? (o.value || o.defaultValue || []).map((c, l) => /* @__PURE__ */ r(
|
|
31
|
+
e.Thumb,
|
|
32
|
+
{
|
|
33
|
+
className: "block h-4 w-4 rounded-full border border-primary/50 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
|
|
34
|
+
"data-component": "slider-thumb"
|
|
35
|
+
},
|
|
36
|
+
l
|
|
37
|
+
)) : /* @__PURE__ */ r(
|
|
38
|
+
e.Thumb,
|
|
39
|
+
{
|
|
40
|
+
className: "block h-4 w-4 rounded-full border border-primary/50 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
|
|
41
|
+
"data-component": "slider-thumb"
|
|
42
|
+
}
|
|
43
|
+
)
|
|
17
44
|
]
|
|
18
45
|
}
|
|
19
46
|
));
|
|
20
|
-
|
|
47
|
+
d.displayName = e.Root.displayName;
|
|
21
48
|
export {
|
|
22
|
-
|
|
49
|
+
d as Slider
|
|
23
50
|
};
|
|
@@ -4,26 +4,26 @@ import { Input as Y } from "./input.js";
|
|
|
4
4
|
const re = ({
|
|
5
5
|
value: D = "",
|
|
6
6
|
onChange: V,
|
|
7
|
-
onBlur:
|
|
7
|
+
onBlur: P,
|
|
8
8
|
onFocus: W,
|
|
9
|
-
isNumeric:
|
|
9
|
+
isNumeric: l = !1,
|
|
10
10
|
allowNegative: g = !0,
|
|
11
11
|
min: s,
|
|
12
12
|
max: u,
|
|
13
13
|
min_operator: I = ">=",
|
|
14
|
-
max_operator:
|
|
15
|
-
maxIntegerDigits:
|
|
16
|
-
decimalPlaces:
|
|
14
|
+
max_operator: v = "<=",
|
|
15
|
+
maxIntegerDigits: w,
|
|
16
|
+
decimalPlaces: f,
|
|
17
17
|
enforceDecimal: z = !1,
|
|
18
18
|
allowDecimal: C = !0,
|
|
19
|
-
maxLength:
|
|
19
|
+
maxLength: a,
|
|
20
20
|
trimLeadingSpaces: M = !0,
|
|
21
|
-
customValidator:
|
|
21
|
+
customValidator: y,
|
|
22
22
|
onValidationError: h,
|
|
23
23
|
disabled: p = !1,
|
|
24
24
|
...F
|
|
25
25
|
}) => {
|
|
26
|
-
const [
|
|
26
|
+
const [c, $] = Q(String(D ?? "")), K = U(null);
|
|
27
27
|
X(() => {
|
|
28
28
|
$(String(D ?? ""));
|
|
29
29
|
}, [D]);
|
|
@@ -43,7 +43,7 @@ const re = ({
|
|
|
43
43
|
}
|
|
44
44
|
}, j = (t) => {
|
|
45
45
|
if (u === void 0) return !0;
|
|
46
|
-
switch (
|
|
46
|
+
switch (v) {
|
|
47
47
|
case ">":
|
|
48
48
|
return t > u;
|
|
49
49
|
case ">=":
|
|
@@ -62,7 +62,7 @@ const re = ({
|
|
|
62
62
|
e = Math.max(e, r);
|
|
63
63
|
}
|
|
64
64
|
if (u !== void 0) {
|
|
65
|
-
const r =
|
|
65
|
+
const r = v === "<" ? u - 0.01 : u;
|
|
66
66
|
e = Math.min(e, r);
|
|
67
67
|
}
|
|
68
68
|
return e;
|
|
@@ -81,67 +81,67 @@ const re = ({
|
|
|
81
81
|
return t.replace("-", "");
|
|
82
82
|
return t;
|
|
83
83
|
}, q = (t) => {
|
|
84
|
-
if (
|
|
84
|
+
if (f === void 0 || !t.includes(".")) return t;
|
|
85
85
|
const [e, r] = t.split(".");
|
|
86
|
-
return r && r.length >
|
|
86
|
+
return r && r.length > f ? `${e}.${r.slice(0, f)}` : t;
|
|
87
87
|
}, A = (t) => {
|
|
88
|
-
if (
|
|
88
|
+
if (w === void 0) return t;
|
|
89
89
|
const [e, r] = t.split("."), n = e.replace("-", "");
|
|
90
|
-
if (n.length >
|
|
91
|
-
const
|
|
92
|
-
return r !== void 0 ? `${d}${
|
|
90
|
+
if (n.length > w) {
|
|
91
|
+
const i = n.slice(0, w), d = e.startsWith("-") ? "-" : "";
|
|
92
|
+
return r !== void 0 ? `${d}${i}.${r}` : `${d}${i}`;
|
|
93
93
|
}
|
|
94
94
|
return t;
|
|
95
|
-
},
|
|
96
|
-
if (!
|
|
95
|
+
}, S = (t) => {
|
|
96
|
+
if (!l) return t;
|
|
97
97
|
let e = String(t ?? "");
|
|
98
98
|
return M && (e = e.replace(/^\s+/, "")), e = R(e), e = O(e), e = T(e, t), e = q(e), e = A(e), C || (e = e.replace(".", "")), e;
|
|
99
99
|
}, E = (t) => {
|
|
100
|
-
if (!
|
|
100
|
+
if (!l || !t || t === "-") return t;
|
|
101
101
|
let e = t;
|
|
102
102
|
const r = parseFloat(e);
|
|
103
103
|
if (isNaN(r)) return "";
|
|
104
104
|
const n = k(r);
|
|
105
|
-
if (z &&
|
|
106
|
-
e = n.toFixed(
|
|
107
|
-
else if (
|
|
108
|
-
const [
|
|
109
|
-
e = `${
|
|
105
|
+
if (z && f !== void 0)
|
|
106
|
+
e = n.toFixed(f);
|
|
107
|
+
else if (f !== void 0 && e.includes(".")) {
|
|
108
|
+
const [i, d = ""] = e.split("."), B = d.padEnd(f, "0");
|
|
109
|
+
e = `${i}.${B}`;
|
|
110
110
|
} else
|
|
111
111
|
e = String(n);
|
|
112
112
|
return e;
|
|
113
113
|
}, G = (t) => {
|
|
114
114
|
if (!t) return !0;
|
|
115
|
-
if (
|
|
115
|
+
if (y && !y(t))
|
|
116
116
|
return h?.("Custom validation failed"), !1;
|
|
117
|
-
if (
|
|
117
|
+
if (l) {
|
|
118
118
|
const e = parseFloat(t);
|
|
119
119
|
if (isNaN(e))
|
|
120
120
|
return h?.("Invalid number"), !1;
|
|
121
121
|
if (!b(e))
|
|
122
122
|
return h?.(`Value must be ${I} ${s}`), !1;
|
|
123
123
|
if (!j(e))
|
|
124
|
-
return h?.(`Value must be ${
|
|
124
|
+
return h?.(`Value must be ${v} ${u}`), !1;
|
|
125
125
|
}
|
|
126
|
-
return
|
|
126
|
+
return a && t.length > a ? (h?.(`Maximum length is ${a}`), !1) : !0;
|
|
127
127
|
};
|
|
128
128
|
return /* @__PURE__ */ J(
|
|
129
129
|
Y,
|
|
130
130
|
{
|
|
131
131
|
...F,
|
|
132
|
-
value:
|
|
132
|
+
value: c,
|
|
133
133
|
onChange: (t) => {
|
|
134
134
|
if (p) return;
|
|
135
135
|
let r = t.target.value;
|
|
136
|
-
|
|
136
|
+
l ? r = S(r) : M && (r = r.replace(/^\s+/, "")), a && r.length > a && (r = r.slice(0, a)), $(r), V?.(r, t);
|
|
137
137
|
},
|
|
138
138
|
onBlur: (t) => {
|
|
139
|
-
let e =
|
|
140
|
-
|
|
139
|
+
let e = c;
|
|
140
|
+
l && e && (e = E(e), G(e) && ($(e), e !== c && V?.(e))), P?.(t);
|
|
141
141
|
},
|
|
142
142
|
onFocus: W,
|
|
143
143
|
onKeyDown: (t) => {
|
|
144
|
-
if (p || !
|
|
144
|
+
if (p || !l) return;
|
|
145
145
|
const e = t.key;
|
|
146
146
|
if (e === "e" || e === "E") {
|
|
147
147
|
t.preventDefault();
|
|
@@ -151,11 +151,11 @@ const re = ({
|
|
|
151
151
|
t.preventDefault();
|
|
152
152
|
return;
|
|
153
153
|
}
|
|
154
|
-
if (e === "-" &&
|
|
154
|
+
if (e === "-" && c.includes("-")) {
|
|
155
155
|
t.preventDefault();
|
|
156
156
|
return;
|
|
157
157
|
}
|
|
158
|
-
if (e === "." && (!C ||
|
|
158
|
+
if (e === "." && (!C || c.includes("."))) {
|
|
159
159
|
t.preventDefault();
|
|
160
160
|
return;
|
|
161
161
|
}
|
|
@@ -163,12 +163,17 @@ const re = ({
|
|
|
163
163
|
onPaste: (t) => {
|
|
164
164
|
if (p) return;
|
|
165
165
|
t.preventDefault();
|
|
166
|
-
const e = t.clipboardData.getData("text"), r =
|
|
167
|
-
let
|
|
168
|
-
|
|
166
|
+
const e = t.clipboardData.getData("text"), r = l ? S(e) : e, n = t.target, i = n.selectionStart || 0, d = n.selectionEnd || 0, B = c.slice(0, i), H = c.slice(d);
|
|
167
|
+
let o = B + r + H;
|
|
168
|
+
l && (o = S(o)), a && o.length > a && (o = o.slice(0, a)), $(o), V?.(o);
|
|
169
169
|
},
|
|
170
170
|
disabled: p,
|
|
171
|
-
ref: K
|
|
171
|
+
ref: K,
|
|
172
|
+
"data-component": "smart-input",
|
|
173
|
+
"data-numeric": l || void 0,
|
|
174
|
+
"data-decimal-places": f,
|
|
175
|
+
"data-min": s,
|
|
176
|
+
"data-max": u
|
|
172
177
|
}
|
|
173
178
|
);
|
|
174
179
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as t, jsxs as d } from "react/jsx-runtime";
|
|
2
2
|
import * as x from "react";
|
|
3
|
-
import { cva as
|
|
3
|
+
import { cva as c } from "class-variance-authority";
|
|
4
4
|
import { Check as w } from "lucide-react";
|
|
5
|
-
import { cn as
|
|
6
|
-
const N =
|
|
5
|
+
import { cn as a } from "../../lib/utils.js";
|
|
6
|
+
const N = c("flex w-full gap-0", {
|
|
7
7
|
variants: {
|
|
8
8
|
orientation: {
|
|
9
9
|
horizontal: "flex-row items-center",
|
|
@@ -13,7 +13,7 @@ const N = d("flex w-full gap-0", {
|
|
|
13
13
|
defaultVariants: {
|
|
14
14
|
orientation: "horizontal"
|
|
15
15
|
}
|
|
16
|
-
}), y =
|
|
16
|
+
}), y = c(
|
|
17
17
|
"relative flex items-center transition-all duration-200",
|
|
18
18
|
{
|
|
19
19
|
variants: {
|
|
@@ -66,7 +66,7 @@ const N = d("flex w-full gap-0", {
|
|
|
66
66
|
status: "default"
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
-
), z =
|
|
69
|
+
), z = c(
|
|
70
70
|
"flex h-6 w-6 shrink-0 items-center justify-center rounded-[8px] text-xs font-extrabold transition-all",
|
|
71
71
|
{
|
|
72
72
|
variants: {
|
|
@@ -81,46 +81,50 @@ const N = d("flex w-full gap-0", {
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
), V = x.forwardRef(
|
|
84
|
-
({ className: u, currentStep:
|
|
84
|
+
({ className: u, currentStep: f, steps: p, orientation: e = "horizontal", onStepClick: m, ...h }, v) => /* @__PURE__ */ t(
|
|
85
85
|
"div",
|
|
86
86
|
{
|
|
87
87
|
ref: v,
|
|
88
|
-
className:
|
|
88
|
+
className: a(N({ orientation: e }), u),
|
|
89
|
+
"data-orientation": e,
|
|
89
90
|
...h,
|
|
90
|
-
children:
|
|
91
|
-
const
|
|
92
|
-
return /* @__PURE__ */
|
|
93
|
-
/* @__PURE__ */
|
|
91
|
+
children: p.map((l, s) => {
|
|
92
|
+
const o = typeof l == "string" ? { label: l } : l, i = s + 1, g = i === f, b = i < f, n = o.disabled, r = b ? "completed" : g ? "active" : "default";
|
|
93
|
+
return /* @__PURE__ */ d(x.Fragment, { children: [
|
|
94
|
+
/* @__PURE__ */ d(
|
|
94
95
|
"div",
|
|
95
96
|
{
|
|
96
|
-
onClick: () => !
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
97
|
+
onClick: () => !n && m?.(s),
|
|
98
|
+
"data-step": i,
|
|
99
|
+
"data-status": r,
|
|
100
|
+
"data-disabled": n || void 0,
|
|
101
|
+
className: a(
|
|
102
|
+
y({ orientation: e, status: r }),
|
|
103
|
+
e === "horizontal" && "min-w-[140px]",
|
|
104
|
+
n ? "opacity-80 cursor-not-allowed" : m ? "cursor-pointer" : "cursor-default"
|
|
101
105
|
),
|
|
102
106
|
children: [
|
|
103
|
-
/* @__PURE__ */
|
|
104
|
-
/* @__PURE__ */
|
|
105
|
-
/* @__PURE__ */
|
|
107
|
+
/* @__PURE__ */ t("div", { className: a(z({ status: r }), "mr-2"), children: b ? /* @__PURE__ */ t(w, { className: "h-4 w-4 stroke-[3px]" }) : /* @__PURE__ */ t("span", { children: o.icon || i }) }),
|
|
108
|
+
/* @__PURE__ */ d("div", { className: "flex flex-col justify-center overflow-hidden", children: [
|
|
109
|
+
/* @__PURE__ */ t("div", { className: a(
|
|
106
110
|
"text-[14px] leading-tight font-medium truncate max-w-[200px]",
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
), children:
|
|
110
|
-
|
|
111
|
+
r === "completed" ? "text-[#3bb273]" : "text-foreground",
|
|
112
|
+
r === "active" && e === "vertical" ? "text-primary" : ""
|
|
113
|
+
), children: o.label }),
|
|
114
|
+
o.description && /* @__PURE__ */ t("div", { className: a(
|
|
111
115
|
"text-[12px] leading-tight mt-0.5 truncate max-w-[200px]",
|
|
112
|
-
|
|
113
|
-
), children:
|
|
116
|
+
r === "completed" ? "text-[#3bb273]" : "text-muted-foreground"
|
|
117
|
+
), children: o.description })
|
|
114
118
|
] })
|
|
115
119
|
]
|
|
116
120
|
}
|
|
117
121
|
),
|
|
118
|
-
s <
|
|
122
|
+
s < p.length - 1 && /* @__PURE__ */ t(
|
|
119
123
|
"div",
|
|
120
124
|
{
|
|
121
|
-
className:
|
|
125
|
+
className: a(
|
|
122
126
|
"border-t border-dashed border-[#d9dde7] transition-colors",
|
|
123
|
-
|
|
127
|
+
e === "horizontal" ? "flex-1 min-w-[24px] mx-1 self-center" : "h-6 w-0 border-l ml-[12px] my-[-4px]"
|
|
124
128
|
)
|
|
125
129
|
}
|
|
126
130
|
)
|
|
@@ -2,21 +2,23 @@ import { jsx as t } from "react/jsx-runtime";
|
|
|
2
2
|
import * as s from "react";
|
|
3
3
|
import * as e from "@radix-ui/react-switch";
|
|
4
4
|
import { cn as a } from "../../lib/utils.js";
|
|
5
|
-
const c = s.forwardRef(({ className:
|
|
5
|
+
const c = s.forwardRef(({ className: o, ...r }, i) => /* @__PURE__ */ t(
|
|
6
6
|
e.Root,
|
|
7
7
|
{
|
|
8
8
|
className: a(
|
|
9
9
|
"peer inline-flex h-[16px] w-[24px] shrink-0 cursor-pointer items-center rounded-full border transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-[#eceefd] data-[state=checked]:border-accordion-bg data-[state=unchecked]:bg-white data-[state=unchecked]:border-light-blue",
|
|
10
|
-
|
|
10
|
+
o
|
|
11
11
|
),
|
|
12
|
-
...
|
|
12
|
+
...r,
|
|
13
13
|
ref: i,
|
|
14
|
+
"data-component": "switch-root",
|
|
14
15
|
children: /* @__PURE__ */ t(
|
|
15
16
|
e.Thumb,
|
|
16
17
|
{
|
|
17
18
|
className: a(
|
|
18
19
|
"pointer-events-none block h-[10px] w-[10px] rounded-full shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-[10px] data-[state=unchecked]:translate-x-[2px] data-[state=checked]:bg-primary data-[state=unchecked]:bg-tertiary-border"
|
|
19
|
-
)
|
|
20
|
+
),
|
|
21
|
+
"data-component": "switch-thumb"
|
|
20
22
|
}
|
|
21
23
|
)
|
|
22
24
|
}
|