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,55 +1,59 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as n, jsxs as h } from "react/jsx-runtime";
|
|
2
2
|
import * as e from "react";
|
|
3
|
-
import * as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { Tooltip as
|
|
6
|
-
const
|
|
3
|
+
import * as o from "@radix-ui/react-tabs";
|
|
4
|
+
import { cn as p } from "../../lib/utils.js";
|
|
5
|
+
import { Tooltip as v, TooltipTrigger as y, TooltipContent as N } from "./tooltip.js";
|
|
6
|
+
const x = e.createContext({
|
|
7
7
|
variant: "line",
|
|
8
8
|
size: "default"
|
|
9
|
-
}),
|
|
10
|
-
const [
|
|
9
|
+
}), w = e.forwardRef(({ variant: t = "line", size: a = "default", hideInactiveLabel: i = !1, tooltipClassName: s, value: r, defaultValue: l, onValueChange: m, ...u }, c) => {
|
|
10
|
+
const [b, d] = e.useState(r || l);
|
|
11
11
|
e.useEffect(() => {
|
|
12
12
|
r !== void 0 && d(r);
|
|
13
13
|
}, [r]);
|
|
14
|
-
const
|
|
14
|
+
const f = (g) => {
|
|
15
15
|
r === void 0 && d(g), m?.(g);
|
|
16
16
|
};
|
|
17
|
-
return /* @__PURE__ */
|
|
18
|
-
|
|
17
|
+
return /* @__PURE__ */ n(x.Provider, { value: { variant: t, size: a, activeValue: b, hideInactiveLabel: i, tooltipClassName: s }, children: /* @__PURE__ */ n(
|
|
18
|
+
o.Root,
|
|
19
19
|
{
|
|
20
20
|
ref: c,
|
|
21
21
|
value: r,
|
|
22
22
|
defaultValue: l,
|
|
23
|
-
onValueChange:
|
|
23
|
+
onValueChange: f,
|
|
24
|
+
"data-component": "tabs",
|
|
25
|
+
"data-variant": t,
|
|
24
26
|
...u
|
|
25
27
|
}
|
|
26
28
|
) });
|
|
27
29
|
});
|
|
28
|
-
|
|
29
|
-
const C = e.forwardRef(({ className:
|
|
30
|
-
const { variant:
|
|
31
|
-
return /* @__PURE__ */
|
|
32
|
-
|
|
30
|
+
w.displayName = o.Root.displayName;
|
|
31
|
+
const C = e.forwardRef(({ className: t, ...a }, i) => {
|
|
32
|
+
const { variant: s } = e.useContext(x);
|
|
33
|
+
return /* @__PURE__ */ n(
|
|
34
|
+
o.List,
|
|
33
35
|
{
|
|
34
|
-
ref:
|
|
35
|
-
|
|
36
|
+
ref: i,
|
|
37
|
+
"data-tabs": "list",
|
|
38
|
+
className: p(
|
|
36
39
|
"inline-flex items-center justify-center rounded-lg",
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
s === "line" && "h-10 bg-white border w-full justify-start gap-2 px-2 shrink-0 py-0",
|
|
41
|
+
s === "pill" && "h-10 p-1 bg-[#eceefd] text-[#4259ee] gap-1",
|
|
42
|
+
s === "outline" && "bg-transparent gap-2 p-0 w-full justify-start",
|
|
43
|
+
t
|
|
41
44
|
),
|
|
42
|
-
...
|
|
45
|
+
...a
|
|
43
46
|
}
|
|
44
47
|
);
|
|
45
48
|
});
|
|
46
|
-
C.displayName =
|
|
47
|
-
const T = e.forwardRef(({ className:
|
|
48
|
-
const { variant: l, size: m, activeValue: u, hideInactiveLabel: c, tooltipClassName:
|
|
49
|
-
|
|
49
|
+
C.displayName = o.List.displayName;
|
|
50
|
+
const T = e.forwardRef(({ className: t, icon: a, children: i, ...s }, r) => {
|
|
51
|
+
const { variant: l, size: m, activeValue: u, hideInactiveLabel: c, tooltipClassName: b } = e.useContext(x), d = u === s.value, f = /* @__PURE__ */ h(
|
|
52
|
+
o.Trigger,
|
|
50
53
|
{
|
|
51
54
|
ref: r,
|
|
52
|
-
|
|
55
|
+
"data-tabs": "trigger",
|
|
56
|
+
className: p(
|
|
53
57
|
"relative inline-flex items-center justify-center whitespace-nowrap text-sm font-medium transition-all focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50",
|
|
54
58
|
l === "line" && [
|
|
55
59
|
"h-full rounded-none border-b-2 border-transparent px-1 text-[13px] font-medium capitalize text-[#60697d] -mb-[1px]",
|
|
@@ -67,35 +71,36 @@ const T = e.forwardRef(({ className: n, icon: t, children: a, ...i }, r) => {
|
|
|
67
71
|
"data-[state=active]:border-[#4259ee] data-[state=active]:text-[#4259ee]",
|
|
68
72
|
m === "sm" ? "h-[24px] px-[8px] py-[2px] text-xs" : "h-9 px-4 py-2"
|
|
69
73
|
],
|
|
70
|
-
|
|
74
|
+
t
|
|
71
75
|
),
|
|
72
|
-
...
|
|
76
|
+
...s,
|
|
73
77
|
children: [
|
|
74
|
-
|
|
75
|
-
(
|
|
78
|
+
a && /* @__PURE__ */ n("span", { className: p("h-4 w-4 shrink-0", !c || d ? "mr-2" : "mr-0"), children: a }),
|
|
79
|
+
/* @__PURE__ */ n("span", { className: p(c && !d && "sr-only"), children: i })
|
|
76
80
|
]
|
|
77
81
|
}
|
|
78
82
|
);
|
|
79
|
-
return c && !d ? /* @__PURE__ */ v
|
|
80
|
-
/* @__PURE__ */
|
|
81
|
-
/* @__PURE__ */
|
|
82
|
-
] }) :
|
|
83
|
+
return c && !d ? /* @__PURE__ */ h(v, { children: [
|
|
84
|
+
/* @__PURE__ */ n(y, { asChild: !0, children: f }),
|
|
85
|
+
/* @__PURE__ */ n(N, { variant: "tertiary", className: b, children: i })
|
|
86
|
+
] }) : f;
|
|
83
87
|
});
|
|
84
|
-
T.displayName =
|
|
85
|
-
const R = e.forwardRef(({ className:
|
|
86
|
-
|
|
88
|
+
T.displayName = o.Trigger.displayName;
|
|
89
|
+
const R = e.forwardRef(({ className: t, ...a }, i) => /* @__PURE__ */ n(
|
|
90
|
+
o.Content,
|
|
87
91
|
{
|
|
88
|
-
ref:
|
|
89
|
-
|
|
92
|
+
ref: i,
|
|
93
|
+
"data-tabs": "content",
|
|
94
|
+
className: p(
|
|
90
95
|
"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
91
|
-
|
|
96
|
+
t
|
|
92
97
|
),
|
|
93
|
-
...
|
|
98
|
+
...a
|
|
94
99
|
}
|
|
95
100
|
));
|
|
96
|
-
R.displayName =
|
|
101
|
+
R.displayName = o.Content.displayName;
|
|
97
102
|
export {
|
|
98
|
-
|
|
103
|
+
w as Tabs,
|
|
99
104
|
R as TabsContent,
|
|
100
105
|
C as TabsList,
|
|
101
106
|
T as TabsTrigger
|
|
@@ -2,7 +2,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
2
2
|
import { TagProps } from './tag';
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
declare const tagGroupVariants: (props?: {
|
|
5
|
-
spacing?: "
|
|
5
|
+
spacing?: "sm" | "md" | "lg" | "none";
|
|
6
6
|
orientation?: "horizontal" | "vertical";
|
|
7
7
|
wrap?: "nowrap" | "wrap";
|
|
8
8
|
} & import('class-variance-authority/types').ClassProp) => string;
|
|
@@ -17,6 +17,7 @@ export interface TagGroupProps extends React.HTMLAttributes<HTMLDivElement>, Var
|
|
|
17
17
|
removable?: TagProps["removable"];
|
|
18
18
|
onRemove?: TagProps["onRemove"];
|
|
19
19
|
}>;
|
|
20
|
+
asChild?: boolean;
|
|
20
21
|
}
|
|
21
22
|
declare const TagGroup: React.ForwardRefExoticComponent<TagGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
22
23
|
export { TagGroup, tagGroupVariants };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import * as c from "react";
|
|
3
|
+
import { Slot as f } from "@radix-ui/react-slot";
|
|
4
|
+
import { cva as d } from "class-variance-authority";
|
|
5
|
+
import { cn as v } from "../../lib/utils.js";
|
|
6
|
+
import { Tag as h } from "./tag.js";
|
|
7
|
+
const w = d("flex", {
|
|
7
8
|
variants: {
|
|
8
9
|
spacing: {
|
|
9
10
|
none: "gap-0",
|
|
@@ -25,32 +26,35 @@ const v = s("flex", {
|
|
|
25
26
|
orientation: "horizontal",
|
|
26
27
|
wrap: "nowrap"
|
|
27
28
|
}
|
|
28
|
-
}),
|
|
29
|
-
({ className:
|
|
30
|
-
"div",
|
|
29
|
+
}), g = c.forwardRef(
|
|
30
|
+
({ className: n, spacing: a, orientation: r, wrap: p, tags: t, asChild: i = !1, ...m }, l) => /* @__PURE__ */ e(
|
|
31
|
+
i ? f : "div",
|
|
31
32
|
{
|
|
32
33
|
ref: l,
|
|
33
|
-
className:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
className: v(w({ spacing: a, orientation: r, wrap: p }), n),
|
|
35
|
+
"data-component": "tag-group",
|
|
36
|
+
"data-spacing": a ?? "md",
|
|
37
|
+
"data-orientation": r ?? "horizontal",
|
|
38
|
+
...m,
|
|
39
|
+
children: t.map((o, s) => /* @__PURE__ */ e(
|
|
40
|
+
h,
|
|
37
41
|
{
|
|
38
|
-
variant:
|
|
39
|
-
size:
|
|
40
|
-
shape:
|
|
41
|
-
leftIcon:
|
|
42
|
-
rightIcon:
|
|
43
|
-
removable:
|
|
44
|
-
onRemove:
|
|
45
|
-
children:
|
|
42
|
+
variant: o.variant,
|
|
43
|
+
size: o.size,
|
|
44
|
+
shape: o.shape,
|
|
45
|
+
leftIcon: o.leftIcon,
|
|
46
|
+
rightIcon: o.rightIcon,
|
|
47
|
+
removable: o.removable,
|
|
48
|
+
onRemove: o.onRemove,
|
|
49
|
+
children: o.label
|
|
46
50
|
},
|
|
47
|
-
|
|
51
|
+
s
|
|
48
52
|
))
|
|
49
53
|
}
|
|
50
54
|
)
|
|
51
55
|
);
|
|
52
|
-
|
|
56
|
+
g.displayName = "TagGroup";
|
|
53
57
|
export {
|
|
54
|
-
|
|
55
|
-
|
|
58
|
+
g as TagGroup,
|
|
59
|
+
w as tagGroupVariants
|
|
56
60
|
};
|
|
@@ -11,6 +11,7 @@ export interface TagProps extends React.HTMLAttributes<HTMLSpanElement>, Variant
|
|
|
11
11
|
rightIcon?: React.ReactNode;
|
|
12
12
|
removable?: boolean;
|
|
13
13
|
onRemove?: () => void;
|
|
14
|
+
asChild?: boolean;
|
|
14
15
|
}
|
|
15
16
|
declare const Tag: React.ForwardRefExoticComponent<TagProps & React.RefAttributes<HTMLSpanElement>>;
|
|
16
17
|
export { Tag, tagVariants };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
1
|
+
import { jsxs as s, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import * as m from "react";
|
|
3
|
+
import { Slot as x } from "@radix-ui/react-slot";
|
|
4
|
+
import { cva as h } from "class-variance-authority";
|
|
5
|
+
import { X as u } from "lucide-react";
|
|
6
|
+
import { cn as v } from "../../lib/utils.js";
|
|
7
|
+
const y = h(
|
|
7
8
|
"inline-flex items-center justify-center rounded-full transition-colors whitespace-nowrap focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
8
9
|
{
|
|
9
10
|
variants: {
|
|
@@ -36,18 +37,22 @@ const u = x(
|
|
|
36
37
|
shape: "pill"
|
|
37
38
|
}
|
|
38
39
|
}
|
|
39
|
-
),
|
|
40
|
-
({ className:
|
|
41
|
-
"span",
|
|
40
|
+
), w = m.forwardRef(
|
|
41
|
+
({ className: d, variant: r, size: t, shape: o, leftIcon: a, rightIcon: n, removable: i, onRemove: l, asChild: f = !1, children: c, ...p }, b) => /* @__PURE__ */ s(
|
|
42
|
+
f ? x : "span",
|
|
42
43
|
{
|
|
43
|
-
ref:
|
|
44
|
-
className:
|
|
45
|
-
|
|
44
|
+
ref: b,
|
|
45
|
+
className: v(y({ variant: r, size: t, shape: o }), d),
|
|
46
|
+
"data-component": "tag",
|
|
47
|
+
"data-variant": r ?? "default",
|
|
48
|
+
"data-size": t ?? "md",
|
|
49
|
+
"data-shape": o ?? "pill",
|
|
50
|
+
...p,
|
|
46
51
|
children: [
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
52
|
+
a && /* @__PURE__ */ e("span", { className: "mr-1.5 flex shrink-0 items-center justify-center", children: a }),
|
|
53
|
+
c,
|
|
54
|
+
n && /* @__PURE__ */ e("span", { className: "ml-1.5 flex shrink-0 items-center justify-center", children: n }),
|
|
55
|
+
i && /* @__PURE__ */ s(
|
|
51
56
|
"button",
|
|
52
57
|
{
|
|
53
58
|
type: "button",
|
|
@@ -55,8 +60,9 @@ const u = x(
|
|
|
55
60
|
g.stopPropagation(), l?.();
|
|
56
61
|
},
|
|
57
62
|
className: "ml-1.5 flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-full hover:bg-black/10 transition-colors",
|
|
63
|
+
"data-component": "tag-remove",
|
|
58
64
|
children: [
|
|
59
|
-
/* @__PURE__ */ e(
|
|
65
|
+
/* @__PURE__ */ e(u, { className: "h-3 w-3" }),
|
|
60
66
|
/* @__PURE__ */ e("span", { className: "sr-only", children: "Remove" })
|
|
61
67
|
]
|
|
62
68
|
}
|
|
@@ -65,8 +71,8 @@ const u = x(
|
|
|
65
71
|
}
|
|
66
72
|
)
|
|
67
73
|
);
|
|
68
|
-
|
|
74
|
+
w.displayName = "Tag";
|
|
69
75
|
export {
|
|
70
|
-
|
|
71
|
-
|
|
76
|
+
w as Tag,
|
|
77
|
+
y as tagVariants
|
|
72
78
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as d, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import * as c from "react";
|
|
3
3
|
import { cva as p } from "class-variance-authority";
|
|
4
|
-
import { cn as
|
|
4
|
+
import { cn as i } from "../../lib/utils.js";
|
|
5
5
|
const v = p(
|
|
6
6
|
"flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-[#dfe2e7] focus-visible:outline-none focus-visible:border-primary hover:border-primary disabled:cursor-not-allowed disabled:bg-disabled-secondary-bg disabled:text-disabled-text disabled:border-border md:text-sm",
|
|
7
7
|
{
|
|
@@ -20,25 +20,25 @@ const v = p(
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
), y = c.forwardRef(
|
|
23
|
-
({ className: u, label:
|
|
24
|
-
const [g,
|
|
23
|
+
({ className: u, label: x, helperText: n, characterLimit: o, isError: t, disabled: a, value: r, onChange: m, ...e }, f) => {
|
|
24
|
+
const [g, l] = c.useState(0);
|
|
25
25
|
c.useEffect(() => {
|
|
26
|
-
r ?
|
|
26
|
+
r ? l(String(r).length) : e.defaultValue && l(String(e.defaultValue).length);
|
|
27
27
|
}, [r, e.defaultValue]);
|
|
28
|
-
const h = (
|
|
29
|
-
|
|
28
|
+
const h = (b) => {
|
|
29
|
+
l(b.target.value.length), m?.(b);
|
|
30
30
|
};
|
|
31
31
|
return /* @__PURE__ */ d("div", { className: "w-full space-y-1.5 min-w-[240px]", children: [
|
|
32
|
-
|
|
32
|
+
x && /* @__PURE__ */ d(
|
|
33
33
|
"label",
|
|
34
34
|
{
|
|
35
|
-
className:
|
|
35
|
+
className: i(
|
|
36
36
|
"text-xs font-medium leading-[18px] text-[#60697d]",
|
|
37
37
|
a && "opacity-70",
|
|
38
38
|
t && "text-destructive"
|
|
39
39
|
),
|
|
40
40
|
children: [
|
|
41
|
-
|
|
41
|
+
x,
|
|
42
42
|
" ",
|
|
43
43
|
e.required && /* @__PURE__ */ s("span", { className: "text-destructive", children: "*" })
|
|
44
44
|
]
|
|
@@ -47,33 +47,34 @@ const v = p(
|
|
|
47
47
|
/* @__PURE__ */ s(
|
|
48
48
|
"textarea",
|
|
49
49
|
{
|
|
50
|
-
className:
|
|
50
|
+
className: i(
|
|
51
51
|
v({ isError: t, disabled: a, className: u }),
|
|
52
52
|
"bg-background",
|
|
53
53
|
a && "bg-disabled-secondary-bg"
|
|
54
54
|
),
|
|
55
|
-
ref:
|
|
55
|
+
ref: f,
|
|
56
56
|
disabled: !!a,
|
|
57
57
|
value: r,
|
|
58
58
|
onChange: h,
|
|
59
|
+
"data-component": "textarea",
|
|
59
60
|
...e
|
|
60
61
|
}
|
|
61
62
|
),
|
|
62
|
-
(
|
|
63
|
-
/* @__PURE__ */ s("div", { className:
|
|
63
|
+
(n || o) && /* @__PURE__ */ d("div", { className: "flex items-start justify-between gap-2", children: [
|
|
64
|
+
/* @__PURE__ */ s("div", { className: i("flex items-center gap-1", t && "text-destructive"), children: n && /* @__PURE__ */ s(
|
|
64
65
|
"p",
|
|
65
66
|
{
|
|
66
|
-
className:
|
|
67
|
+
className: i(
|
|
67
68
|
"text-[10px] text-[#7a8294]",
|
|
68
69
|
t && "text-destructive"
|
|
69
70
|
),
|
|
70
|
-
children:
|
|
71
|
+
children: n
|
|
71
72
|
}
|
|
72
73
|
) }),
|
|
73
|
-
|
|
74
|
+
o && /* @__PURE__ */ d("div", { className: "text-[10px] text-[#7a8294] text-right", "data-component": "character-count-indicator", children: [
|
|
74
75
|
g,
|
|
75
76
|
"/",
|
|
76
|
-
|
|
77
|
+
o
|
|
77
78
|
] })
|
|
78
79
|
] })
|
|
79
80
|
] });
|
|
@@ -6,7 +6,7 @@ declare const ToastViewport: React.ForwardRefExoticComponent<Omit<ToastPrimitive
|
|
|
6
6
|
position?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
7
7
|
} & React.RefAttributes<HTMLOListElement>>;
|
|
8
8
|
declare const Toast: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastProps & React.RefAttributes<HTMLLIElement>, "ref"> & VariantProps<(props?: {
|
|
9
|
-
variant?: "default" | "destructive" | "
|
|
9
|
+
variant?: "default" | "destructive" | "basic" | "unstyled" | "basic-success" | "basic-info" | "basic-warning" | "basic-error";
|
|
10
10
|
} & import('class-variance-authority/types').ClassProp) => string> & React.RefAttributes<HTMLLIElement>>;
|
|
11
11
|
declare const ToastAction: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastActionProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
12
12
|
declare const ToastClose: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastCloseProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import * as s from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as o from "@radix-ui/react-toast";
|
|
4
4
|
import { cva as d } from "class-variance-authority";
|
|
5
5
|
import { X as p } from "lucide-react";
|
|
6
6
|
import { cn as i } from "../../lib/utils.js";
|
|
7
|
-
const y =
|
|
8
|
-
|
|
7
|
+
const y = o.Provider, c = s.forwardRef(({ className: t, position: e = "top-right", ...r }, n) => /* @__PURE__ */ a(
|
|
8
|
+
o.Viewport,
|
|
9
9
|
{
|
|
10
10
|
ref: n,
|
|
11
11
|
className: i(
|
|
12
|
-
"z-[
|
|
13
|
-
!
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
"z-[60] flex max-h-screen w-full p-4 md:max-w-[420px] gap-2",
|
|
13
|
+
!t?.includes("static") && !t?.includes("absolute") && "fixed",
|
|
14
|
+
e.startsWith("top") ? "top-0 sm:top-8 flex-col" : "bottom-0 sm:bottom-8 flex-col-reverse",
|
|
15
|
+
e.endsWith("left") ? "left-0 sm:left-8" : "right-0 sm:right-8",
|
|
16
|
+
t
|
|
17
17
|
),
|
|
18
|
-
...
|
|
18
|
+
...r
|
|
19
19
|
}
|
|
20
20
|
));
|
|
21
|
-
|
|
22
|
-
const
|
|
21
|
+
c.displayName = o.Viewport.displayName;
|
|
22
|
+
const f = d(
|
|
23
23
|
"group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",
|
|
24
24
|
{
|
|
25
25
|
variants: {
|
|
@@ -38,59 +38,65 @@ const c = d(
|
|
|
38
38
|
variant: "default"
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
), l = s.forwardRef(({ className:
|
|
42
|
-
|
|
41
|
+
), l = s.forwardRef(({ className: t, variant: e, ...r }, n) => /* @__PURE__ */ a(
|
|
42
|
+
o.Root,
|
|
43
43
|
{
|
|
44
44
|
ref: n,
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
"data-component": "toast",
|
|
46
|
+
"data-variant": e ?? "default",
|
|
47
|
+
className: i(f({ variant: e }), t),
|
|
48
|
+
...r
|
|
47
49
|
}
|
|
48
50
|
));
|
|
49
|
-
l.displayName =
|
|
50
|
-
const u = s.forwardRef(({ className:
|
|
51
|
-
|
|
51
|
+
l.displayName = o.Root.displayName;
|
|
52
|
+
const u = s.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ a(
|
|
53
|
+
o.Action,
|
|
52
54
|
{
|
|
53
|
-
ref:
|
|
55
|
+
ref: r,
|
|
56
|
+
"data-component": "toast-action",
|
|
54
57
|
className: i(
|
|
55
58
|
"inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",
|
|
56
|
-
|
|
59
|
+
t
|
|
57
60
|
),
|
|
58
|
-
...
|
|
61
|
+
...e
|
|
59
62
|
}
|
|
60
63
|
));
|
|
61
|
-
u.displayName =
|
|
62
|
-
const x = s.forwardRef(({ className:
|
|
63
|
-
|
|
64
|
+
u.displayName = o.Action.displayName;
|
|
65
|
+
const x = s.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ a(
|
|
66
|
+
o.Close,
|
|
64
67
|
{
|
|
65
|
-
ref:
|
|
68
|
+
ref: r,
|
|
69
|
+
"data-component": "toast-close",
|
|
66
70
|
className: i(
|
|
67
71
|
"absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",
|
|
68
|
-
|
|
72
|
+
t
|
|
69
73
|
),
|
|
70
74
|
"toast-close": "",
|
|
71
|
-
...
|
|
75
|
+
...e,
|
|
72
76
|
children: /* @__PURE__ */ a(p, { className: "h-4 w-4" })
|
|
73
77
|
}
|
|
74
78
|
));
|
|
75
|
-
x.displayName =
|
|
76
|
-
const m = s.forwardRef(({ className:
|
|
77
|
-
|
|
79
|
+
x.displayName = o.Close.displayName;
|
|
80
|
+
const m = s.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ a(
|
|
81
|
+
o.Title,
|
|
78
82
|
{
|
|
79
|
-
ref:
|
|
80
|
-
|
|
81
|
-
|
|
83
|
+
ref: r,
|
|
84
|
+
"data-component": "toast-title",
|
|
85
|
+
className: i("text-sm font-semibold [&+div]:text-xs group-[.basic]:text-center group-[.basic]:font-normal", t),
|
|
86
|
+
...e
|
|
82
87
|
}
|
|
83
88
|
));
|
|
84
|
-
m.displayName =
|
|
85
|
-
const b = s.forwardRef(({ className:
|
|
86
|
-
|
|
89
|
+
m.displayName = o.Title.displayName;
|
|
90
|
+
const b = s.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ a(
|
|
91
|
+
o.Description,
|
|
87
92
|
{
|
|
88
|
-
ref:
|
|
89
|
-
|
|
90
|
-
|
|
93
|
+
ref: r,
|
|
94
|
+
"data-component": "toast-description",
|
|
95
|
+
className: i("text-sm opacity-90 group-[.basic]:text-center", t),
|
|
96
|
+
...e
|
|
91
97
|
}
|
|
92
98
|
));
|
|
93
|
-
b.displayName =
|
|
99
|
+
b.displayName = o.Description.displayName;
|
|
94
100
|
export {
|
|
95
101
|
l as Toast,
|
|
96
102
|
u as ToastAction,
|
|
@@ -98,5 +104,5 @@ export {
|
|
|
98
104
|
b as ToastDescription,
|
|
99
105
|
y as ToastProvider,
|
|
100
106
|
m as ToastTitle,
|
|
101
|
-
|
|
107
|
+
c as ToastViewport
|
|
102
108
|
};
|