@adamosuiteservices/ui 2.18.6 → 2.19.1
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/README.md +1 -1
- package/dist/accordion-rounded.cjs +8 -8
- package/dist/accordion-rounded.js +12 -12
- package/dist/accordion.cjs +1 -1
- package/dist/accordion.js +1 -1
- package/dist/alert.cjs +32 -23
- package/dist/alert.js +53 -43
- package/dist/amount-input.cjs +8 -0
- package/dist/amount-input.js +191 -0
- package/dist/avatar.cjs +7 -7
- package/dist/avatar.js +18 -18
- package/dist/badge.cjs +24 -28
- package/dist/badge.js +45 -42
- package/dist/breadcrumb.cjs +3 -4
- package/dist/breadcrumb.js +17 -18
- package/dist/button-CPm4-98H.cjs +87 -0
- package/dist/button-D4ddrxyp.js +156 -0
- package/dist/button-group.cjs +1 -1
- package/dist/button-group.js +1 -1
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/{calendar-Dorq3-wv.cjs → calendar-DXq90PYV.cjs} +20 -22
- package/dist/{calendar-xBaFu2sB.js → calendar-DgfO9zab.js} +239 -240
- package/dist/calendar.cjs +1 -1
- package/dist/calendar.js +1 -1
- package/dist/card.cjs +3 -3
- package/dist/card.js +4 -4
- package/dist/checkbox-CIzBdqN7.cjs +24 -0
- package/dist/{checkbox-DL_jFvgl.js → checkbox-DPlUjwLi.js} +54 -52
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/colors.css +1 -1
- package/dist/combobox-DG9u4g84.js +692 -0
- package/dist/combobox-DylTjGrw.cjs +57 -0
- package/dist/combobox.cjs +1 -1
- package/dist/combobox.js +1 -1
- package/dist/components/layout/sidebar/sidebar.d.ts +2 -1
- package/dist/components/layout/toaster/toaster.d.ts +1 -1
- package/dist/components/ui/alert/alert.d.ts +1 -1
- package/dist/components/ui/amount-input/amount-input.d.ts +32 -0
- package/dist/components/ui/amount-input/index.d.ts +1 -0
- package/dist/components/ui/badge/badge.d.ts +3 -2
- package/dist/components/ui/calendar/calendar.d.ts +1 -1
- package/dist/components/ui/combobox/combobox.d.ts +3 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts +3 -1
- package/dist/components/ui/selectable-card/index.d.ts +1 -0
- package/dist/components/ui/selectable-card/selectable-card.d.ts +22 -0
- package/dist/components/ui/timeline/index.d.ts +1 -0
- package/dist/components/ui/timeline/timeline.d.ts +30 -0
- package/dist/components/ui/typography/typography.d.ts +1 -1
- package/dist/context-menu.cjs +18 -19
- package/dist/context-menu.js +37 -38
- package/dist/date-picker-selector.cjs +1 -1
- package/dist/date-picker-selector.js +3 -3
- package/dist/dialog.cjs +7 -9
- package/dist/dialog.js +36 -38
- package/dist/dropdown-menu.cjs +57 -36
- package/dist/dropdown-menu.js +206 -173
- package/dist/field.cjs +12 -7
- package/dist/field.js +51 -45
- package/dist/file-upload-v2.cjs +11 -5
- package/dist/file-upload-v2.js +75 -60
- package/dist/file-upload.cjs +11 -5
- package/dist/file-upload.js +118 -110
- package/dist/full-screen-loader.cjs +1 -1
- package/dist/full-screen-loader.js +1 -1
- package/dist/{icon-B7joBr0A.cjs → icon-C5Q2b1Am.cjs} +1 -1
- package/dist/{icon-BFQz1tQC.js → icon-t4jt1Z2h.js} +1 -1
- package/dist/icon.cjs +1 -1
- package/dist/icon.js +1 -1
- package/dist/index-BBT2EGq8.js +18 -0
- package/dist/index-DCsgSkBj.cjs +1 -0
- package/dist/input-8sEO5zwD.js +44 -0
- package/dist/input-AONeSXcs.cjs +22 -0
- package/dist/input-group-BLffLxyg.cjs +86 -0
- package/dist/input-group-DmevJAqa.js +240 -0
- package/dist/input-group.cjs +1 -84
- package/dist/input-group.js +7 -234
- package/dist/input-otp.cjs +5 -7
- package/dist/input-otp.js +58 -60
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/kbd.cjs +6 -7
- package/dist/kbd.js +14 -15
- package/dist/{label-DqfX9cHc.cjs → label-B7Z1D5-Q.cjs} +5 -4
- package/dist/{label-C6zVnc3d.js → label-_BWRIH7C.js} +14 -13
- package/dist/label.cjs +1 -1
- package/dist/label.js +1 -1
- package/dist/pagination.cjs +5 -5
- package/dist/pagination.js +18 -18
- package/dist/radio-group.cjs +12 -9
- package/dist/radio-group.js +66 -63
- package/dist/select.cjs +18 -16
- package/dist/select.js +18 -16
- package/dist/selectable-card.cjs +29 -0
- package/dist/selectable-card.js +129 -0
- package/dist/separator-DXdc7LcC.cjs +7 -0
- package/dist/{separator-CsaqP20m.js → separator-DZfXXbNt.js} +1 -1
- package/dist/separator.cjs +1 -1
- package/dist/separator.js +1 -1
- package/dist/{sheet-Cnq7TCzu.cjs → sheet-Cp6JGhWC.cjs} +10 -10
- package/dist/{sheet-C9vce0ut.js → sheet-hWerE8S1.js} +9 -6
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.js +1 -1
- package/dist/sidebar.cjs +10 -10
- package/dist/sidebar.js +83 -92
- package/dist/slider.cjs +1 -1
- package/dist/slider.js +1 -1
- package/dist/{spinner-C7q7NthY.cjs → spinner-DUZ2vcus.cjs} +1 -1
- package/dist/{spinner-DQ5JLL3U.js → spinner-_-J3zJ_g.js} +1 -1
- package/dist/spinner.cjs +1 -1
- package/dist/spinner.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/switch.cjs +2 -4
- package/dist/switch.js +71 -73
- package/dist/table.cjs +14 -14
- package/dist/table.js +12 -12
- package/dist/tabs-underline.cjs +11 -15
- package/dist/tabs-underline.js +20 -24
- package/dist/tabs.cjs +10 -14
- package/dist/tabs.js +20 -24
- package/dist/tailwind-colors.css +1 -1
- package/dist/tailwind-theme.css +1 -1
- package/dist/textarea-BSooGyp-.cjs +18 -0
- package/dist/textarea-D_sj6ivo.js +39 -0
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +1 -1
- package/dist/themes.css +1 -1
- package/dist/timeline.cjs +4 -0
- package/dist/timeline.js +189 -0
- package/dist/toaster.cjs +5 -4
- package/dist/toaster.js +33 -32
- package/dist/toggle.cjs +4 -4
- package/dist/toggle.js +17 -17
- package/dist/tooltip.cjs +5 -6
- package/dist/tooltip.js +4 -5
- package/docs/components/layout/sidebar.md +81 -53
- package/docs/components/layout/toaster.md +35 -55
- package/docs/components/ui/accordion-rounded.md +12 -11
- package/docs/components/ui/alert.md +66 -36
- package/docs/components/ui/amount-input.md +229 -0
- package/docs/components/ui/avatar.md +28 -32
- package/docs/components/ui/badge.md +85 -32
- package/docs/components/ui/breadcrumb.md +5 -7
- package/docs/components/ui/button-group.md +16 -16
- package/docs/components/ui/button.md +23 -36
- package/docs/components/ui/calendar.md +54 -27
- package/docs/components/ui/card.md +5 -4
- package/docs/components/ui/checkbox.md +3 -3
- package/docs/components/ui/combobox.md +35 -1
- package/docs/components/ui/command.md +7 -7
- package/docs/components/ui/context-menu.md +14 -15
- package/docs/components/ui/date-picker-selector.md +31 -31
- package/docs/components/ui/dialog.md +47 -49
- package/docs/components/ui/dropdown-menu.md +34 -37
- package/docs/components/ui/field.md +25 -31
- package/docs/components/ui/file-upload-v2.md +11 -0
- package/docs/components/ui/file-upload.md +105 -108
- package/docs/components/ui/hover-card.md +28 -6
- package/docs/components/ui/icon.md +10 -9
- package/docs/components/ui/input-group.md +9 -9
- package/docs/components/ui/input.md +30 -33
- package/docs/components/ui/kbd.md +10 -9
- package/docs/components/ui/label.md +6 -6
- package/docs/components/ui/pagination.md +3 -3
- package/docs/components/ui/popover.md +1 -0
- package/docs/components/ui/progress.md +3 -3
- package/docs/components/ui/radio-group.md +18 -6
- package/docs/components/ui/scroll-area.md +4 -4
- package/docs/components/ui/select.md +14 -12
- package/docs/components/ui/selectable-card.md +204 -0
- package/docs/components/ui/separator.md +4 -4
- package/docs/components/ui/sheet.md +21 -3
- package/docs/components/ui/slider.md +3 -3
- package/docs/components/ui/switch.md +7 -7
- package/docs/components/ui/table.md +7 -4
- package/docs/components/ui/tabs-underline.md +36 -36
- package/docs/components/ui/tabs.md +6 -4
- package/docs/components/ui/textarea.md +6 -4
- package/docs/components/ui/timeline.md +214 -0
- package/docs/components/ui/toggle.md +1 -1
- package/docs/components/ui/tooltip.md +3 -3
- package/llm.txt +7 -4
- package/package.json +13 -1
- package/dist/button-BnUlAtuD.js +0 -132
- package/dist/button-CFJs0esR.cjs +0 -63
- package/dist/checkbox-3RIZX2HF.cjs +0 -22
- package/dist/combobox-MkeJiTXj.js +0 -637
- package/dist/combobox-jJRxvUsB.cjs +0 -40
- package/dist/input-BCiOr4Fy.js +0 -44
- package/dist/input-Bz5k4w94.cjs +0 -22
- package/dist/separator-CCGaTo09.cjs +0 -7
- package/dist/textarea-BRCnIxdB.js +0 -33
- package/dist/textarea-DkFUS_oS.cjs +0 -14
package/dist/file-upload.js
CHANGED
|
@@ -1,125 +1,132 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { B } from "./button-
|
|
3
|
-
import { I as R } from "./icon-
|
|
1
|
+
import { j as t } from "./jsx-runtime-BzflLqGi.js";
|
|
2
|
+
import { B } from "./button-D4ddrxyp.js";
|
|
3
|
+
import { I as R } from "./icon-t4jt1Z2h.js";
|
|
4
4
|
import { T as $ } from "./typography-MnY0LQoZ.js";
|
|
5
5
|
import { c as v } from "./index-CRiPKpXj.js";
|
|
6
6
|
import { useState as U, useRef as P, useEffect as F } from "react";
|
|
7
7
|
function S({
|
|
8
8
|
isDragging: i,
|
|
9
|
-
isMultiple:
|
|
9
|
+
isMultiple: o,
|
|
10
10
|
invalid: a,
|
|
11
|
-
disabled:
|
|
11
|
+
disabled: r,
|
|
12
12
|
accept: d,
|
|
13
13
|
acceptedExtensions: c,
|
|
14
|
-
maxSizeInMB:
|
|
14
|
+
maxSizeInMB: h,
|
|
15
15
|
maxFiles: f,
|
|
16
16
|
labels: l,
|
|
17
|
-
input:
|
|
18
|
-
onDragOver:
|
|
17
|
+
input: x,
|
|
18
|
+
onDragOver: p,
|
|
19
19
|
onDragLeave: w,
|
|
20
20
|
onDrop: j,
|
|
21
21
|
onFileChange: T
|
|
22
22
|
}) {
|
|
23
|
-
const y =
|
|
24
|
-
return /* @__PURE__ */
|
|
23
|
+
const y = x?.id || `file-upload-${Math.random().toString(36).substring(2, 11)}`;
|
|
24
|
+
return /* @__PURE__ */ t.jsxs(
|
|
25
25
|
"div",
|
|
26
26
|
{
|
|
27
|
-
onDragOver:
|
|
28
|
-
onDragLeave:
|
|
29
|
-
onDrop:
|
|
27
|
+
onDragOver: r ? void 0 : p,
|
|
28
|
+
onDragLeave: r ? void 0 : w,
|
|
29
|
+
onDrop: r ? void 0 : j,
|
|
30
30
|
className: v(
|
|
31
31
|
`
|
|
32
|
-
adm:flex adm:flex-col adm:items-center adm:gap-6 adm:rounded-
|
|
33
|
-
adm:border
|
|
32
|
+
adm:flex adm:flex-col adm:items-center adm:gap-6 adm:rounded-3xl
|
|
33
|
+
adm:border
|
|
34
34
|
`,
|
|
35
35
|
"adm:border-dashed adm:bg-background adm:p-6 adm:transition-colors",
|
|
36
|
+
"adm:hover:border-strong-border adm:hover:bg-muted",
|
|
36
37
|
{
|
|
37
|
-
"adm:border-
|
|
38
|
-
"adm:border-destructive": a && !
|
|
38
|
+
"adm:border-strong-border": i && !a && !r,
|
|
39
|
+
"adm:border-destructive": a && !r,
|
|
39
40
|
"adm:border-input": !i && !a,
|
|
40
|
-
"adm:cursor-not-allowed adm:opacity-50":
|
|
41
|
+
"adm:cursor-not-allowed adm:opacity-50": r
|
|
41
42
|
}
|
|
42
43
|
),
|
|
43
44
|
children: [
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
+
/* @__PURE__ */ t.jsx(
|
|
45
46
|
"div",
|
|
46
47
|
{
|
|
47
48
|
className: v(
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
`
|
|
50
|
+
adm:flex adm:size-11 adm:items-center adm:justify-center
|
|
51
|
+
adm:rounded-full
|
|
52
|
+
`,
|
|
53
|
+
a && !r ? "adm:bg-destructive/10" : "adm:bg-primary-50"
|
|
50
54
|
),
|
|
51
|
-
children: /* @__PURE__ */
|
|
55
|
+
children: /* @__PURE__ */ t.jsx(
|
|
52
56
|
R,
|
|
53
57
|
{
|
|
54
|
-
symbol: "
|
|
55
|
-
className: a && !
|
|
58
|
+
symbol: "upload",
|
|
59
|
+
className: a && !r ? "adm:text-destructive" : "adm:text-primary"
|
|
56
60
|
}
|
|
57
61
|
)
|
|
58
62
|
}
|
|
59
63
|
),
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
/* @__PURE__ */
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
+
/* @__PURE__ */ t.jsxs("div", { className: "adm:flex adm:flex-col adm:items-center adm:gap-2", children: [
|
|
65
|
+
/* @__PURE__ */ t.jsx($, { className: "adm:text-center", color: a && !r ? "destructive" : void 0, children: l?.dragDrop || (o ? "Drag and drop your files here or" : "Drag and drop your file here or") }),
|
|
66
|
+
/* @__PURE__ */ t.jsxs("label", { htmlFor: y, children: [
|
|
67
|
+
/* @__PURE__ */ t.jsx(
|
|
64
68
|
"input",
|
|
65
69
|
{
|
|
66
|
-
...
|
|
70
|
+
...x,
|
|
67
71
|
id: y,
|
|
68
72
|
type: "file",
|
|
69
73
|
accept: d,
|
|
70
|
-
multiple:
|
|
74
|
+
multiple: o,
|
|
71
75
|
onChange: T,
|
|
72
|
-
disabled:
|
|
76
|
+
disabled: r,
|
|
73
77
|
className: "adm:hidden"
|
|
74
78
|
}
|
|
75
79
|
),
|
|
76
|
-
/* @__PURE__ */
|
|
80
|
+
/* @__PURE__ */ t.jsx(
|
|
77
81
|
B,
|
|
78
82
|
{
|
|
79
83
|
asChild: !0,
|
|
80
84
|
type: "button",
|
|
81
85
|
variant: "link",
|
|
82
|
-
className: v("adm:cursor-pointer",
|
|
86
|
+
className: v("adm:cursor-pointer", r && `
|
|
83
87
|
adm:pointer-events-none
|
|
84
88
|
`),
|
|
85
|
-
disabled:
|
|
86
|
-
children: /* @__PURE__ */
|
|
89
|
+
disabled: r,
|
|
90
|
+
children: /* @__PURE__ */ t.jsx("span", { className: "adm:text-center", children: l?.selectFile || (o ? "Select files" : "Select the file") })
|
|
87
91
|
}
|
|
88
92
|
)
|
|
89
93
|
] })
|
|
90
94
|
] }),
|
|
91
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ t.jsx($, { className: "adm:text-center", color: a && !r ? "destructive" : "muted", children: l?.fileRequirements || (c && c.length > 0 ? `Allowed files: ${c.join(", ")}. Maximum size ${h} MB${o ? `. Up to ${f} files` : ""}.` : `Maximum size ${h} MB${o ? `. Up to ${f} files` : ""}.`) })
|
|
92
96
|
]
|
|
93
97
|
}
|
|
94
98
|
);
|
|
95
99
|
}
|
|
96
|
-
function ee({ file: i, invalid:
|
|
97
|
-
return /* @__PURE__ */
|
|
100
|
+
function ee({ file: i, invalid: o, disabled: a, onRemove: r }) {
|
|
101
|
+
return /* @__PURE__ */ t.jsxs(
|
|
98
102
|
"div",
|
|
99
103
|
{
|
|
100
104
|
className: v(
|
|
101
|
-
"adm:flex adm:items-center adm:gap-
|
|
102
|
-
|
|
105
|
+
"adm:flex adm:items-center adm:gap-6 adm:rounded-3xl adm:p-4",
|
|
106
|
+
o && !a ? "adm:bg-destructive/5" : "adm:bg-muted",
|
|
103
107
|
a && "adm:cursor-not-allowed adm:opacity-50"
|
|
104
108
|
),
|
|
105
109
|
children: [
|
|
106
|
-
/* @__PURE__ */
|
|
110
|
+
/* @__PURE__ */ t.jsx(
|
|
107
111
|
"div",
|
|
108
112
|
{
|
|
109
113
|
className: v(
|
|
110
|
-
|
|
111
|
-
|
|
114
|
+
`
|
|
115
|
+
adm:flex adm:size-11 adm:items-center adm:justify-center
|
|
116
|
+
adm:rounded-full
|
|
117
|
+
`,
|
|
118
|
+
o && !a ? "adm:bg-destructive/15" : "adm:bg-background"
|
|
112
119
|
),
|
|
113
|
-
children: /* @__PURE__ */
|
|
120
|
+
children: /* @__PURE__ */ t.jsx(
|
|
114
121
|
R,
|
|
115
122
|
{
|
|
116
|
-
symbol: "
|
|
117
|
-
className:
|
|
123
|
+
symbol: "article",
|
|
124
|
+
className: o && !a ? "adm:text-destructive" : "adm:text-primary"
|
|
118
125
|
}
|
|
119
126
|
)
|
|
120
127
|
}
|
|
121
128
|
),
|
|
122
|
-
/* @__PURE__ */
|
|
129
|
+
/* @__PURE__ */ t.jsx("div", { className: "adm:flex adm:min-w-0 adm:flex-1 adm:flex-col adm:gap-1", children: /* @__PURE__ */ t.jsx(
|
|
123
130
|
$,
|
|
124
131
|
{
|
|
125
132
|
className: v(
|
|
@@ -128,187 +135,188 @@ function ee({ file: i, invalid: m, disabled: a, onRemove: t }) {
|
|
|
128
135
|
children: i.name
|
|
129
136
|
}
|
|
130
137
|
) }),
|
|
131
|
-
/* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ t.jsxs($, { className: "adm:shrink-0", color: "muted", children: [
|
|
132
139
|
(i.size / 1024 / 1024).toFixed(1),
|
|
133
140
|
" MB"
|
|
134
141
|
] }),
|
|
135
|
-
/* @__PURE__ */
|
|
142
|
+
/* @__PURE__ */ t.jsx(
|
|
136
143
|
B,
|
|
137
144
|
{
|
|
138
|
-
variant: "
|
|
139
|
-
|
|
145
|
+
variant: "link",
|
|
146
|
+
size: "icon",
|
|
147
|
+
onClick: r,
|
|
140
148
|
type: "button",
|
|
141
149
|
disabled: a,
|
|
142
|
-
children: /* @__PURE__ */
|
|
150
|
+
children: /* @__PURE__ */ t.jsx(R, { symbol: "cancel", fill: 1, className: "adm:text-destructive" })
|
|
143
151
|
}
|
|
144
152
|
)
|
|
145
153
|
]
|
|
146
154
|
}
|
|
147
155
|
);
|
|
148
156
|
}
|
|
149
|
-
function O({ files: i, isMultiple:
|
|
150
|
-
return i.length === 0 ? null : /* @__PURE__ */
|
|
151
|
-
|
|
152
|
-
/* @__PURE__ */
|
|
153
|
-
/* @__PURE__ */
|
|
157
|
+
function O({ files: i, isMultiple: o, invalid: a, disabled: r, labels: d, onRemoveFile: c, onClearAll: h }) {
|
|
158
|
+
return i.length === 0 ? null : /* @__PURE__ */ t.jsxs("div", { className: "adm:flex adm:flex-col adm:gap-3", children: [
|
|
159
|
+
o && i.length > 1 && /* @__PURE__ */ t.jsxs("div", { className: "adm:flex adm:items-center adm:justify-between", children: [
|
|
160
|
+
/* @__PURE__ */ t.jsx($, { className: "adm:text-center adm:text-sm adm:font-medium", color: a && !r ? "destructive" : void 0, children: d?.filesSelected?.(i.length) || `${i.length} file${i.length !== 1 ? "s" : ""} selected` }),
|
|
161
|
+
/* @__PURE__ */ t.jsx(
|
|
154
162
|
B,
|
|
155
163
|
{
|
|
156
164
|
variant: "ghost",
|
|
157
165
|
size: "sm",
|
|
158
|
-
onClick:
|
|
166
|
+
onClick: h,
|
|
159
167
|
type: "button",
|
|
160
|
-
disabled:
|
|
168
|
+
disabled: r,
|
|
161
169
|
children: d?.clearAll || "Clear all"
|
|
162
170
|
}
|
|
163
171
|
)
|
|
164
172
|
] }),
|
|
165
|
-
i.map((f, l) => /* @__PURE__ */
|
|
173
|
+
i.map((f, l) => /* @__PURE__ */ t.jsx(
|
|
166
174
|
ee,
|
|
167
175
|
{
|
|
168
176
|
file: f,
|
|
169
177
|
invalid: a,
|
|
170
|
-
disabled:
|
|
178
|
+
disabled: r,
|
|
171
179
|
onRemove: () => c(l)
|
|
172
180
|
},
|
|
173
181
|
`${f.name}-${l}`
|
|
174
182
|
))
|
|
175
183
|
] });
|
|
176
184
|
}
|
|
177
|
-
function
|
|
185
|
+
function oe({
|
|
178
186
|
className: i,
|
|
179
|
-
selectedFile:
|
|
187
|
+
selectedFile: o,
|
|
180
188
|
selectedFiles: a,
|
|
181
|
-
onFileSelect:
|
|
189
|
+
onFileSelect: r,
|
|
182
190
|
onFilesSelect: d,
|
|
183
191
|
onFileAdd: c,
|
|
184
|
-
onFileRemove:
|
|
192
|
+
onFileRemove: h,
|
|
185
193
|
onFilesAdd: f,
|
|
186
194
|
onFilesRemove: l,
|
|
187
|
-
onInvalidFile:
|
|
188
|
-
acceptedExtensions:
|
|
195
|
+
onInvalidFile: x,
|
|
196
|
+
acceptedExtensions: p,
|
|
189
197
|
maxSizeInMB: w = 50,
|
|
190
198
|
maxFiles: j = 10,
|
|
191
199
|
multiple: T = !1,
|
|
192
200
|
filesPosition: y = "below",
|
|
193
201
|
invalid: V = !1,
|
|
194
|
-
disabled:
|
|
195
|
-
"aria-invalid":
|
|
202
|
+
disabled: M = !1,
|
|
203
|
+
"aria-invalid": q,
|
|
196
204
|
labels: C,
|
|
197
|
-
input:
|
|
205
|
+
input: _,
|
|
198
206
|
...G
|
|
199
207
|
}) {
|
|
200
|
-
const [H, A] = U(!1), [J, K] = U(!1),
|
|
208
|
+
const [H, A] = U(!1), [J, K] = U(!1), b = P(null);
|
|
201
209
|
F(() => {
|
|
202
210
|
const e = () => {
|
|
203
|
-
if (
|
|
204
|
-
const n =
|
|
211
|
+
if (b.current) {
|
|
212
|
+
const n = b.current.closest("fieldset");
|
|
205
213
|
K(n?.disabled ?? !1);
|
|
206
214
|
}
|
|
207
215
|
};
|
|
208
216
|
e();
|
|
209
217
|
const s = new MutationObserver(e);
|
|
210
|
-
if (
|
|
211
|
-
const n =
|
|
218
|
+
if (b.current) {
|
|
219
|
+
const n = b.current.closest("fieldset");
|
|
212
220
|
n && s.observe(n, { attributes: !0, attributeFilter: ["disabled"] });
|
|
213
221
|
}
|
|
214
222
|
return () => s.disconnect();
|
|
215
223
|
}, []);
|
|
216
|
-
const Q =
|
|
224
|
+
const Q = p?.join(",") || "", W = w * 1024 * 1024, m = T || a !== void 0 || d !== void 0, g = m ? a || [] : o ? [o] : [], z = V || q, u = M || J, X = (e) => {
|
|
217
225
|
u || (e.preventDefault(), A(!0));
|
|
218
226
|
}, Y = (e) => {
|
|
219
227
|
u || (e.preventDefault(), A(!1));
|
|
220
228
|
}, Z = (e) => {
|
|
221
229
|
if (!u)
|
|
222
|
-
if (e.preventDefault(), A(!1),
|
|
223
|
-
const n = Array.from(e.dataTransfer.files).filter(
|
|
230
|
+
if (e.preventDefault(), A(!1), m) {
|
|
231
|
+
const n = Array.from(e.dataTransfer.files).filter(k);
|
|
224
232
|
if (n.length > 0) {
|
|
225
233
|
const N = [...a || [], ...n].slice(0, j);
|
|
226
234
|
d && d(N), f && f(n);
|
|
227
235
|
}
|
|
228
236
|
} else {
|
|
229
237
|
const s = e.dataTransfer.files[0];
|
|
230
|
-
s &&
|
|
238
|
+
s && k(s) && (r && r(s), c && c(s));
|
|
231
239
|
}
|
|
232
240
|
}, E = (e) => {
|
|
233
241
|
if (!u) {
|
|
234
|
-
if (
|
|
235
|
-
const n = (e.target.files ? Array.from(e.target.files) : []).filter(
|
|
242
|
+
if (m) {
|
|
243
|
+
const n = (e.target.files ? Array.from(e.target.files) : []).filter(k);
|
|
236
244
|
if (n.length > 0) {
|
|
237
245
|
const N = [...a || [], ...n].slice(0, j);
|
|
238
246
|
d && d(N), f && f(n);
|
|
239
247
|
}
|
|
240
248
|
} else {
|
|
241
249
|
const s = e.target.files?.[0];
|
|
242
|
-
s &&
|
|
250
|
+
s && k(s) && (r && r(s), c && c(s));
|
|
243
251
|
}
|
|
244
252
|
e.target.value = "";
|
|
245
253
|
}
|
|
246
254
|
}, I = (e) => {
|
|
247
255
|
if (u) return;
|
|
248
|
-
const s =
|
|
249
|
-
if (
|
|
250
|
-
const n =
|
|
256
|
+
const s = g[e];
|
|
257
|
+
if (m) {
|
|
258
|
+
const n = g.filter((D, N) => N !== e);
|
|
251
259
|
d && d(n), l && s && l([s]);
|
|
252
260
|
} else
|
|
253
|
-
|
|
254
|
-
},
|
|
255
|
-
const s = e.name.substring(e.name.lastIndexOf(".")), n = !
|
|
256
|
-
return !n &&
|
|
261
|
+
r && r(null), h && s && h(s);
|
|
262
|
+
}, k = (e) => {
|
|
263
|
+
const s = e.name.substring(e.name.lastIndexOf(".")), n = !p || p.length === 0 || p.includes(s.toLowerCase()), D = e.size <= W;
|
|
264
|
+
return !n && x ? x(e, "extension") : !D && x && x(e, "size"), n && D;
|
|
257
265
|
}, L = () => {
|
|
258
266
|
if (u) return;
|
|
259
|
-
const e = [...
|
|
260
|
-
|
|
267
|
+
const e = [...g];
|
|
268
|
+
m ? (d && d([]), l && e.length > 0 && l(e)) : (r && r(null), h && e.length > 0 && h(e[0]));
|
|
261
269
|
};
|
|
262
|
-
return /* @__PURE__ */
|
|
263
|
-
|
|
270
|
+
return /* @__PURE__ */ t.jsxs("div", { ref: b, className: v("adm:flex adm:flex-col adm:gap-4", i), ...G, children: [
|
|
271
|
+
m && y === "above" && /* @__PURE__ */ t.jsx(
|
|
264
272
|
O,
|
|
265
273
|
{
|
|
266
|
-
files:
|
|
267
|
-
isMultiple:
|
|
268
|
-
invalid:
|
|
274
|
+
files: g,
|
|
275
|
+
isMultiple: m,
|
|
276
|
+
invalid: z,
|
|
269
277
|
disabled: u,
|
|
270
278
|
labels: C,
|
|
271
279
|
onRemoveFile: I,
|
|
272
280
|
onClearAll: L
|
|
273
281
|
}
|
|
274
282
|
),
|
|
275
|
-
(
|
|
283
|
+
(m || g.length === 0) && /* @__PURE__ */ t.jsx(
|
|
276
284
|
S,
|
|
277
285
|
{
|
|
278
286
|
isDragging: H,
|
|
279
|
-
isMultiple:
|
|
280
|
-
invalid:
|
|
287
|
+
isMultiple: m,
|
|
288
|
+
invalid: z,
|
|
281
289
|
disabled: u,
|
|
282
290
|
accept: Q,
|
|
283
|
-
acceptedExtensions:
|
|
291
|
+
acceptedExtensions: p,
|
|
284
292
|
maxSizeInMB: w,
|
|
285
293
|
maxFiles: j,
|
|
286
294
|
labels: C,
|
|
287
|
-
input:
|
|
295
|
+
input: _,
|
|
288
296
|
onDragOver: X,
|
|
289
297
|
onDragLeave: Y,
|
|
290
298
|
onDrop: Z,
|
|
291
299
|
onFileChange: E
|
|
292
300
|
}
|
|
293
301
|
),
|
|
294
|
-
!
|
|
302
|
+
!m && g.length > 0 && /* @__PURE__ */ t.jsx(
|
|
295
303
|
O,
|
|
296
304
|
{
|
|
297
|
-
files:
|
|
298
|
-
isMultiple:
|
|
299
|
-
invalid:
|
|
305
|
+
files: g,
|
|
306
|
+
isMultiple: m,
|
|
307
|
+
invalid: z,
|
|
300
308
|
disabled: u,
|
|
301
309
|
labels: C,
|
|
302
310
|
onRemoveFile: I,
|
|
303
311
|
onClearAll: L
|
|
304
312
|
}
|
|
305
313
|
),
|
|
306
|
-
|
|
314
|
+
m && y === "below" && /* @__PURE__ */ t.jsx(
|
|
307
315
|
O,
|
|
308
316
|
{
|
|
309
|
-
files:
|
|
310
|
-
isMultiple:
|
|
311
|
-
invalid:
|
|
317
|
+
files: g,
|
|
318
|
+
isMultiple: m,
|
|
319
|
+
invalid: z,
|
|
312
320
|
disabled: u,
|
|
313
321
|
labels: C,
|
|
314
322
|
onRemoveFile: I,
|
|
@@ -318,5 +326,5 @@ function me({
|
|
|
318
326
|
] });
|
|
319
327
|
}
|
|
320
328
|
export {
|
|
321
|
-
|
|
329
|
+
oe as FileUpload
|
|
322
330
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./jsx-runtime-BB_1_6y_.cjs"),i=require("./spinner-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./jsx-runtime-BB_1_6y_.cjs"),i=require("./spinner-DUZ2vcus.cjs"),a=require("react");class l{subscribers=[];subscribe(e){return this.subscribers.push(e),()=>{this.subscribers=this.subscribers.filter(r=>r!==e)}}emit(e){this.subscribers.forEach(r=>r(e))}}const s=new l;function c(){const[t,e]=a.useState(!1);return a.useEffect(()=>{const r=s.subscribe(({open:u})=>{e(u)});return()=>{r()}},[]),t?n.jsxRuntimeExports.jsx("div",{"data-slot":"full-screen-loader",className:`
|
|
2
2
|
adm:fixed adm:inset-0 adm:z-100 adm:flex adm:items-center
|
|
3
3
|
adm:justify-center adm:bg-black/20
|
|
4
4
|
`,children:n.jsxRuntimeExports.jsx(i.Spinner,{className:"adm:text-4xl adm:text-primary"})}):null}class o{show(){s.emit({open:!0})}hide(){s.emit({open:!1})}}const b=new o;exports.FullScreenLoader=c;exports.FullScreenLoaderManager=b;exports.FullScreenLoaderObservable=s;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";"use strict";const r=require("./jsx-runtime-BB_1_6y_.cjs"),u=require("./index-DoxiiusW.cjs");function m({symbol:t,fill:n=0,weight:e=
|
|
1
|
+
"use client";"use strict";const r=require("./jsx-runtime-BB_1_6y_.cjs"),u=require("./index-DoxiiusW.cjs");function m({symbol:t,fill:n=0,weight:e=200,grade:s=0,opticalSize:o=24,className:i,style:c,...l}){const a={fontVariationSettings:`
|
|
2
2
|
'FILL' ${n},
|
|
3
3
|
'wght' ${e},
|
|
4
4
|
'GRAD' ${s},
|
package/dist/icon.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./icon-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./icon-C5Q2b1Am.cjs");exports.Icon=e.Icon;
|
package/dist/icon.js
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as r from "react";
|
|
2
|
+
function c(e) {
|
|
3
|
+
const a = r.useCallback(
|
|
4
|
+
(t) => {
|
|
5
|
+
const n = window.matchMedia(e);
|
|
6
|
+
return n.addEventListener("change", t), () => {
|
|
7
|
+
n.removeEventListener("change", t);
|
|
8
|
+
};
|
|
9
|
+
},
|
|
10
|
+
[e]
|
|
11
|
+
), o = () => window.matchMedia(e).matches, s = () => {
|
|
12
|
+
throw Error("useMediaQuery is a client-only hook");
|
|
13
|
+
};
|
|
14
|
+
return r.useSyncExternalStore(a, o, s);
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
c as u
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const s=require("react");function i(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const o=i(s);function u(e){const n=o.useCallback(a=>{const c=window.matchMedia(e);return c.addEventListener("change",a),()=>{c.removeEventListener("change",a)}},[e]),t=()=>window.matchMedia(e).matches,r=()=>{throw Error("useMediaQuery is a client-only hook")};return o.useSyncExternalStore(n,t,r)}exports.useMediaQuery=u;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { j as i } from "./jsx-runtime-BzflLqGi.js";
|
|
3
|
+
import { c as r } from "./index-CRiPKpXj.js";
|
|
4
|
+
import "react";
|
|
5
|
+
function l({ className: d, type: e, ...a }) {
|
|
6
|
+
return /* @__PURE__ */ i.jsx(
|
|
7
|
+
"input",
|
|
8
|
+
{
|
|
9
|
+
type: e,
|
|
10
|
+
"data-slot": "input",
|
|
11
|
+
className: r(
|
|
12
|
+
`
|
|
13
|
+
adm:h-10 adm:w-full adm:min-w-0 adm:rounded-md adm:border
|
|
14
|
+
adm:border-input adm:bg-background adm:px-3 adm:text-sm
|
|
15
|
+
adm:text-input-foreground adm:shadow-xs
|
|
16
|
+
adm:transition-[color,box-shadow] adm:outline-none
|
|
17
|
+
adm:selection:bg-primary adm:selection:text-primary-foreground
|
|
18
|
+
adm:file:mr-3 adm:file:-ml-3 adm:file:inline-flex adm:file:h-full
|
|
19
|
+
adm:file:items-center adm:file:border-0 adm:file:bg-transparent
|
|
20
|
+
adm:file:pl-3 adm:file:text-sm adm:file:font-medium
|
|
21
|
+
adm:file:text-foreground
|
|
22
|
+
adm:placeholder:text-foreground-secondary
|
|
23
|
+
adm:hover:bg-muted
|
|
24
|
+
adm:disabled:pointer-events-none adm:disabled:cursor-not-allowed
|
|
25
|
+
adm:disabled:bg-input-disabled
|
|
26
|
+
adm:disabled:text-input-foreground-disabled adm:disabled:opacity-100
|
|
27
|
+
adm:disabled:placeholder:text-disabled-foreground
|
|
28
|
+
`,
|
|
29
|
+
`
|
|
30
|
+
adm:focus-visible:border-primary-300 adm:focus-visible:ring-4
|
|
31
|
+
adm:focus-visible:ring-primary/10
|
|
32
|
+
adm:aria-invalid:focus-visible:border-destructive
|
|
33
|
+
adm:aria-invalid:focus-visible:ring-destructive/10
|
|
34
|
+
`,
|
|
35
|
+
"adm:aria-invalid:border-destructive",
|
|
36
|
+
d
|
|
37
|
+
),
|
|
38
|
+
...a
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
export {
|
|
43
|
+
l as I
|
|
44
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";"use strict";const i=require("./jsx-runtime-BB_1_6y_.cjs"),r=require("./index-DoxiiusW.cjs");require("react");function m({className:e,type:d,...a}){return i.jsxRuntimeExports.jsx("input",{type:d,"data-slot":"input",className:r.cn(`
|
|
2
|
+
adm:h-10 adm:w-full adm:min-w-0 adm:rounded-md adm:border
|
|
3
|
+
adm:border-input adm:bg-background adm:px-3 adm:text-sm
|
|
4
|
+
adm:text-input-foreground adm:shadow-xs
|
|
5
|
+
adm:transition-[color,box-shadow] adm:outline-none
|
|
6
|
+
adm:selection:bg-primary adm:selection:text-primary-foreground
|
|
7
|
+
adm:file:mr-3 adm:file:-ml-3 adm:file:inline-flex adm:file:h-full
|
|
8
|
+
adm:file:items-center adm:file:border-0 adm:file:bg-transparent
|
|
9
|
+
adm:file:pl-3 adm:file:text-sm adm:file:font-medium
|
|
10
|
+
adm:file:text-foreground
|
|
11
|
+
adm:placeholder:text-foreground-secondary
|
|
12
|
+
adm:hover:bg-muted
|
|
13
|
+
adm:disabled:pointer-events-none adm:disabled:cursor-not-allowed
|
|
14
|
+
adm:disabled:bg-input-disabled
|
|
15
|
+
adm:disabled:text-input-foreground-disabled adm:disabled:opacity-100
|
|
16
|
+
adm:disabled:placeholder:text-disabled-foreground
|
|
17
|
+
`,`
|
|
18
|
+
adm:focus-visible:border-primary-300 adm:focus-visible:ring-4
|
|
19
|
+
adm:focus-visible:ring-primary/10
|
|
20
|
+
adm:aria-invalid:focus-visible:border-destructive
|
|
21
|
+
adm:aria-invalid:focus-visible:ring-destructive/10
|
|
22
|
+
`,"adm:aria-invalid:border-destructive",e),...a})}exports.Input=m;
|