@dimasbaguspm/versaur 0.0.11 → 0.0.13
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/js/bottom-sheet-CBLNEX4F.js +281 -0
- package/dist/js/bottom-sheet.atoms-DFMOaMsU.js +78 -0
- package/dist/js/{calendar-De5dCVnE.js → calendar-B9rIZCdo.js} +318 -163
- package/dist/js/{index-DOdDlCoL.js → cn-BKwT3erk.js} +463 -788
- package/dist/js/enforce-subpath-import.js +1 -0
- package/dist/js/feedbacks/index.js +1 -1
- package/dist/js/{form-layout-BRqZZe8s.js → form-layout-PLH-7bWq.js} +14 -13
- package/dist/js/forms/index.js +1 -1
- package/dist/js/index-Dmu_fHni.js +329 -0
- package/dist/js/index.js +32 -31
- package/dist/js/layouts/index.js +1 -1
- package/dist/js/{menu-Du409VIG.js → menu-oRrbZAAy.js} +56 -60
- package/dist/js/navigation/index.js +1 -1
- package/dist/js/overlays/index.js +5 -4
- package/dist/js/primitive/index.js +2 -2
- package/dist/js/{skeleton-BNZyaRjo.js → skeleton-Ma-Fcs06.js} +6 -5
- package/dist/js/{switch-input-B-pwBWbi.js → switch-input-o8oO4Rf4.js} +482 -435
- package/dist/js/{tabs-BbOkYchB.js → tabs-DSeR5XxX.js} +6 -5
- package/dist/js/{tile-6SeBYc08.js → tile-8hqVMf2m.js} +110 -139
- package/dist/types/forms/chip-input/types.d.ts +16 -0
- package/dist/types/forms/date-range-picker-input/date-range-picker-input.d.ts +10 -0
- package/dist/types/forms/date-range-picker-input/index.d.ts +2 -0
- package/dist/types/forms/date-range-picker-input/types.d.ts +64 -0
- package/dist/types/forms/date-range-picker-input/use-date-range-picker.d.ts +13 -0
- package/dist/types/overlays/bottom-sheet/bottom-sheet.atoms.d.ts +17 -0
- package/dist/types/overlays/bottom-sheet/bottom-sheet.d.ts +7 -0
- package/dist/types/overlays/bottom-sheet/index.d.ts +2 -0
- package/dist/types/overlays/bottom-sheet/types.d.ts +22 -0
- package/dist/types/overlays/drawer/drawer.atoms.d.ts +2 -1
- package/dist/types/overlays/drawer/drawer.d.ts +1 -0
- package/dist/types/overlays/drawer/types.d.ts +6 -3
- package/dist/types/overlays/index.d.ts +1 -0
- package/dist/types/primitive/calendar/calendar.atoms.d.ts +13 -0
- package/dist/types/primitive/calendar/index.d.ts +1 -1
- package/dist/types/primitive/calendar/types.d.ts +38 -4
- package/dist/types/primitive/calendar/use-calendar.d.ts +18 -0
- package/package.json +1 -1
- package/dist/js/drawer-Cn7sreJG.js +0 -221
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { j as u, a as
|
|
2
|
-
import { forwardRef as m, useEffect as f, useRef as
|
|
1
|
+
import { j as u, a as b } from "./index-Dmu_fHni.js";
|
|
2
|
+
import { forwardRef as m, useEffect as f, useRef as y, useState as M, createContext as j, useContext as k, useId as I } from "react";
|
|
3
|
+
import { c as x } from "./cn-BKwT3erk.js";
|
|
3
4
|
const z = m(
|
|
4
5
|
({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
5
6
|
"div",
|
|
@@ -32,7 +33,7 @@ const z = m(
|
|
|
32
33
|
...t
|
|
33
34
|
}
|
|
34
35
|
)
|
|
35
|
-
), N =
|
|
36
|
+
), N = b(
|
|
36
37
|
"fixed inset-0 z-51 transition-opacity duration-300 bg-black/30 backdrop-blur-md flex items-center justify-center transition-opacity duration-200 ease-in-out",
|
|
37
38
|
{
|
|
38
39
|
variants: {
|
|
@@ -45,7 +46,7 @@ const z = m(
|
|
|
45
46
|
placement: "center"
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
|
-
), C =
|
|
49
|
+
), C = b(
|
|
49
50
|
[
|
|
50
51
|
"bg-white rounded-lg shadow-xl relative",
|
|
51
52
|
"flex flex-col",
|
|
@@ -87,8 +88,8 @@ function R(e, t) {
|
|
|
87
88
|
function F(e, t) {
|
|
88
89
|
f(() => {
|
|
89
90
|
if (!e) return;
|
|
90
|
-
const n = (
|
|
91
|
-
|
|
91
|
+
const n = (r) => {
|
|
92
|
+
r.key === "Escape" && t();
|
|
92
93
|
};
|
|
93
94
|
return document.addEventListener("keydown", n), () => document.removeEventListener("keydown", n);
|
|
94
95
|
}, [e, t]);
|
|
@@ -97,20 +98,20 @@ const L = 200, T = ({
|
|
|
97
98
|
isOpen: e,
|
|
98
99
|
onOpenChange: t,
|
|
99
100
|
size: n = "md",
|
|
100
|
-
placement:
|
|
101
|
-
children:
|
|
101
|
+
placement: r = "center",
|
|
102
|
+
children: o,
|
|
102
103
|
disableOverlayClose: a,
|
|
103
104
|
disableEscClose: i,
|
|
104
105
|
...s
|
|
105
106
|
}) => {
|
|
106
|
-
const d =
|
|
107
|
+
const d = y(null), c = y(null), [p, l] = M(e), [h, v] = M(!1);
|
|
107
108
|
return f(() => {
|
|
108
109
|
if (e)
|
|
109
|
-
l(!0),
|
|
110
|
+
l(!0), v(!1), d.current = document.activeElement;
|
|
110
111
|
else if (p) {
|
|
111
|
-
|
|
112
|
+
v(!0);
|
|
112
113
|
const g = setTimeout(() => {
|
|
113
|
-
l(!1),
|
|
114
|
+
l(!1), v(!1), d.current && d.current.focus();
|
|
114
115
|
}, L);
|
|
115
116
|
return () => clearTimeout(g);
|
|
116
117
|
}
|
|
@@ -120,25 +121,25 @@ const L = 200, T = ({
|
|
|
120
121
|
A,
|
|
121
122
|
{
|
|
122
123
|
ref: c,
|
|
123
|
-
className: `${N({ placement:
|
|
124
|
+
className: `${N({ placement: r })} transition-opacity duration-200 ease-in-out ` + (e && !h ? "opacity-100" : "opacity-0 pointer-events-none"),
|
|
124
125
|
onOverlayClick: (g) => {
|
|
125
126
|
g.target === c.current && !a && t && t(!1);
|
|
126
127
|
},
|
|
127
|
-
placement:
|
|
128
|
+
placement: r,
|
|
128
129
|
children: /* @__PURE__ */ u.jsx(
|
|
129
130
|
"div",
|
|
130
131
|
{
|
|
131
|
-
className: `${C({ size: n, placement:
|
|
132
|
+
className: `${C({ size: n, placement: r })} transition-all duration-200 ease-in-out ` + (e && !h ? "opacity-100 scale-100" : "opacity-0 scale-95 pointer-events-none"),
|
|
132
133
|
role: "dialog",
|
|
133
134
|
...s,
|
|
134
135
|
tabIndex: 0,
|
|
135
136
|
"aria-hidden": !e,
|
|
136
|
-
children:
|
|
137
|
+
children: o
|
|
137
138
|
}
|
|
138
139
|
)
|
|
139
140
|
}
|
|
140
141
|
);
|
|
141
|
-
},
|
|
142
|
+
}, G = Object.assign(T, {
|
|
142
143
|
Header: z,
|
|
143
144
|
Body: V,
|
|
144
145
|
Footer: D
|
|
@@ -147,9 +148,9 @@ const L = 200, T = ({
|
|
|
147
148
|
if (!e)
|
|
148
149
|
throw new Error("useMenuContext must be used within a Menu component");
|
|
149
150
|
return e;
|
|
150
|
-
}, S =
|
|
151
|
+
}, S = b(
|
|
151
152
|
// Modern, clean, accessible base style
|
|
152
|
-
"z-50 min-w-40 bg-
|
|
153
|
+
"z-50 min-w-40 bg-background text-black rounded-lg border border-border",
|
|
153
154
|
{
|
|
154
155
|
variants: {
|
|
155
156
|
variant: {
|
|
@@ -157,8 +158,8 @@ const L = 200, T = ({
|
|
|
157
158
|
outline: "border bg-transparent"
|
|
158
159
|
},
|
|
159
160
|
size: {
|
|
160
|
-
sm: "py-
|
|
161
|
-
md: "py-2
|
|
161
|
+
sm: "py-1.5 px-1",
|
|
162
|
+
md: "py-2 px-1"
|
|
162
163
|
}
|
|
163
164
|
},
|
|
164
165
|
defaultVariants: {
|
|
@@ -166,35 +167,30 @@ const L = 200, T = ({
|
|
|
166
167
|
size: "md"
|
|
167
168
|
}
|
|
168
169
|
}
|
|
169
|
-
), q =
|
|
170
|
-
"w-full text-left px-4 rounded-
|
|
170
|
+
), q = b(
|
|
171
|
+
"w-full text-left px-4 rounded-sm cursor-pointer transition-colors duration-150 select-none hover:bg-background-light outline-none border border-transparent focus-visible:border-primary-light disabled:opacity-50 disabled:cursor-not-allowed",
|
|
171
172
|
{
|
|
172
173
|
variants: {
|
|
173
|
-
variant: {
|
|
174
|
-
default: "",
|
|
175
|
-
outline: "border border-color-neutral"
|
|
176
|
-
},
|
|
177
174
|
size: {
|
|
178
|
-
sm: "text-sm py-
|
|
179
|
-
md: "text-base py-
|
|
175
|
+
sm: "text-sm py-1",
|
|
176
|
+
md: "text-base py-1"
|
|
180
177
|
}
|
|
181
178
|
},
|
|
182
179
|
defaultVariants: {
|
|
183
|
-
variant: "default",
|
|
184
180
|
size: "md"
|
|
185
181
|
}
|
|
186
182
|
}
|
|
187
183
|
), B = m(
|
|
188
184
|
({ children: e, ...t }, n) => {
|
|
189
|
-
const { open:
|
|
185
|
+
const { open: r, triggerRef: o } = w();
|
|
190
186
|
return /* @__PURE__ */ u.jsx(
|
|
191
187
|
"span",
|
|
192
188
|
{
|
|
193
189
|
ref: (a) => {
|
|
194
|
-
|
|
190
|
+
o.current = a, typeof n == "function" ? n(a) : n && (n.current = a);
|
|
195
191
|
},
|
|
196
192
|
"aria-haspopup": "menu",
|
|
197
|
-
"aria-expanded":
|
|
193
|
+
"aria-expanded": r,
|
|
198
194
|
"aria-controls": "menu-content",
|
|
199
195
|
...t,
|
|
200
196
|
children: e
|
|
@@ -202,8 +198,8 @@ const L = 200, T = ({
|
|
|
202
198
|
);
|
|
203
199
|
}
|
|
204
200
|
), H = m(
|
|
205
|
-
({ children: e, className: t, ...n },
|
|
206
|
-
const { open:
|
|
201
|
+
({ children: e, className: t, ...n }, r) => {
|
|
202
|
+
const { open: o, contentRef: a, triggerRef: i, size: s } = w(), d = I();
|
|
207
203
|
let c = 0, p = 0;
|
|
208
204
|
if (i.current) {
|
|
209
205
|
const l = i.current.getBoundingClientRect();
|
|
@@ -213,18 +209,18 @@ const L = 200, T = ({
|
|
|
213
209
|
"div",
|
|
214
210
|
{
|
|
215
211
|
ref: (l) => {
|
|
216
|
-
a.current = l, typeof
|
|
212
|
+
a.current = l, typeof r == "function" ? r(l) : r && (r.current = l);
|
|
217
213
|
},
|
|
218
214
|
id: `menu-content-${d}`,
|
|
219
215
|
role: "menu",
|
|
220
216
|
tabIndex: -1,
|
|
221
|
-
"aria-hidden": !
|
|
217
|
+
"aria-hidden": !o,
|
|
222
218
|
className: x(
|
|
223
219
|
S({
|
|
224
220
|
size: s
|
|
225
221
|
}),
|
|
226
222
|
"absolute z-50 transition-opacity duration-150 ease-out",
|
|
227
|
-
|
|
223
|
+
o ? "opacity-100" : "opacity-0",
|
|
228
224
|
t
|
|
229
225
|
),
|
|
230
226
|
style: {
|
|
@@ -233,17 +229,17 @@ const L = 200, T = ({
|
|
|
233
229
|
left: p
|
|
234
230
|
},
|
|
235
231
|
...n,
|
|
236
|
-
children:
|
|
232
|
+
children: o && e
|
|
237
233
|
}
|
|
238
234
|
);
|
|
239
235
|
}
|
|
240
236
|
), K = m(
|
|
241
|
-
({ children: e, disabled: t, className: n, ...
|
|
237
|
+
({ children: e, disabled: t, className: n, ...r }, o) => {
|
|
242
238
|
const { size: a } = w();
|
|
243
239
|
return /* @__PURE__ */ u.jsx(
|
|
244
240
|
"button",
|
|
245
241
|
{
|
|
246
|
-
ref:
|
|
242
|
+
ref: o,
|
|
247
243
|
role: "menuitem",
|
|
248
244
|
tabIndex: 0,
|
|
249
245
|
disabled: t,
|
|
@@ -254,20 +250,20 @@ const L = 200, T = ({
|
|
|
254
250
|
}),
|
|
255
251
|
n
|
|
256
252
|
),
|
|
257
|
-
...
|
|
253
|
+
...r,
|
|
258
254
|
children: e
|
|
259
255
|
}
|
|
260
256
|
);
|
|
261
257
|
}
|
|
262
258
|
);
|
|
263
|
-
function $(e, t, n,
|
|
259
|
+
function $(e, t, n, r) {
|
|
264
260
|
f(() => {
|
|
265
261
|
if (!e) return;
|
|
266
|
-
function
|
|
267
|
-
!t.current?.contains(a.target) && !n.current?.contains(a.target) &&
|
|
262
|
+
function o(a) {
|
|
263
|
+
!t.current?.contains(a.target) && !n.current?.contains(a.target) && r();
|
|
268
264
|
}
|
|
269
|
-
return document.addEventListener("mousedown",
|
|
270
|
-
}, [e,
|
|
265
|
+
return document.addEventListener("mousedown", o), () => document.removeEventListener("mousedown", o);
|
|
266
|
+
}, [e, r, t, n]);
|
|
271
267
|
}
|
|
272
268
|
function U(e, t) {
|
|
273
269
|
f(() => {
|
|
@@ -277,39 +273,39 @@ function U(e, t) {
|
|
|
277
273
|
}
|
|
278
274
|
}, [e, t]);
|
|
279
275
|
}
|
|
280
|
-
function W(e, t, n,
|
|
276
|
+
function W(e, t, n, r) {
|
|
281
277
|
f(() => {
|
|
282
278
|
if (!e || !t.current) return;
|
|
283
|
-
const
|
|
279
|
+
const o = t.current;
|
|
284
280
|
function a(i) {
|
|
285
281
|
const s = Array.from(
|
|
286
|
-
|
|
282
|
+
o.querySelectorAll('[role="menuitem"]')
|
|
287
283
|
), d = document.activeElement, c = s.indexOf(d);
|
|
288
|
-
i.key === "ArrowDown" ? (i.preventDefault(), s.length && s[(c + 1) % s.length].focus()) : i.key === "ArrowUp" ? (i.preventDefault(), s.length && s[(c - 1 + s.length) % s.length].focus()) : i.key === "Home" ? (i.preventDefault(), s.length && s[0].focus()) : i.key === "End" ? (i.preventDefault(), s.length && s[s.length - 1].focus()) : i.key === "Escape" && (i.preventDefault(),
|
|
284
|
+
i.key === "ArrowDown" ? (i.preventDefault(), s.length && s[(c + 1) % s.length].focus()) : i.key === "ArrowUp" ? (i.preventDefault(), s.length && s[(c - 1 + s.length) % s.length].focus()) : i.key === "Home" ? (i.preventDefault(), s.length && s[0].focus()) : i.key === "End" ? (i.preventDefault(), s.length && s[s.length - 1].focus()) : i.key === "Escape" && (i.preventDefault(), r(), n.current?.focus());
|
|
289
285
|
}
|
|
290
|
-
return
|
|
291
|
-
}, [e,
|
|
286
|
+
return o.addEventListener("keydown", a), () => o.removeEventListener("keydown", a);
|
|
287
|
+
}, [e, r, t, n]);
|
|
292
288
|
}
|
|
293
289
|
const P = ({
|
|
294
290
|
children: e,
|
|
295
291
|
isOpen: t,
|
|
296
292
|
onOutsideClick: n,
|
|
297
|
-
size:
|
|
293
|
+
size: r = "md"
|
|
298
294
|
}) => {
|
|
299
|
-
const
|
|
300
|
-
return $(t, a,
|
|
295
|
+
const o = y(null), a = y(null);
|
|
296
|
+
return $(t, a, o, n), U(t, a), W(t, a, o, n), /* @__PURE__ */ u.jsx(
|
|
301
297
|
E.Provider,
|
|
302
298
|
{
|
|
303
|
-
value: { open: t, triggerRef:
|
|
299
|
+
value: { open: t, triggerRef: o, contentRef: a, size: r },
|
|
304
300
|
children: e
|
|
305
301
|
}
|
|
306
302
|
);
|
|
307
|
-
},
|
|
303
|
+
}, J = Object.assign(P, {
|
|
308
304
|
Trigger: B,
|
|
309
305
|
Content: H,
|
|
310
306
|
Item: K
|
|
311
307
|
});
|
|
312
308
|
export {
|
|
313
|
-
|
|
314
|
-
|
|
309
|
+
J as M,
|
|
310
|
+
G as a
|
|
315
311
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { D as
|
|
2
|
-
import { M as s, a as
|
|
1
|
+
import { B as e, D as r } from "../bottom-sheet-CBLNEX4F.js";
|
|
2
|
+
import { M as s, a as m } from "../menu-oRrbZAAy.js";
|
|
3
3
|
export {
|
|
4
|
-
|
|
4
|
+
e as BottomSheet,
|
|
5
|
+
r as Drawer,
|
|
5
6
|
s as Menu,
|
|
6
|
-
|
|
7
|
+
m as Modal
|
|
7
8
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as t, a as o, B as r, b as e, c as n, S as l, T as B, d as c } from "../tile-
|
|
2
|
-
import { B as b, a as d, C as u, b as x, I as A, T as C } from "../calendar-
|
|
1
|
+
import { A as t, a as o, B as r, b as e, c as n, S as l, T as B, d as c } from "../tile-8hqVMf2m.js";
|
|
2
|
+
import { B as b, a as d, C as u, b as x, I as A, T as C } from "../calendar-B9rIZCdo.js";
|
|
3
3
|
export {
|
|
4
4
|
t as Alert,
|
|
5
5
|
o as Avatar,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as l, j as o } from "./index-Dmu_fHni.js";
|
|
2
2
|
import * as m from "react";
|
|
3
3
|
import u, { forwardRef as f } from "react";
|
|
4
|
+
import { c as d } from "./cn-BKwT3erk.js";
|
|
4
5
|
const p = l(
|
|
5
6
|
"inline-block border animate-spin rounded-full",
|
|
6
7
|
{
|
|
@@ -189,7 +190,7 @@ const j = l(
|
|
|
189
190
|
indeterminate: !1
|
|
190
191
|
}
|
|
191
192
|
}
|
|
192
|
-
),
|
|
193
|
+
), L = f(({ value: a, max: e = 100, color: n = "primary", className: r, ...s }, t) => {
|
|
193
194
|
const i = Math.max(0, Math.min(a, e));
|
|
194
195
|
return /* @__PURE__ */ o.jsx(
|
|
195
196
|
"div",
|
|
@@ -236,7 +237,7 @@ const j = l(
|
|
|
236
237
|
shape: "rounded",
|
|
237
238
|
size: "md"
|
|
238
239
|
}
|
|
239
|
-
}),
|
|
240
|
+
}), k = m.forwardRef(
|
|
240
241
|
function({ shape: e = "rounded", size: n = "md", height: r, className: s, style: t, ...i }, c) {
|
|
241
242
|
const g = ["sm", "md", "lg", "xl"].includes(n) ? n : "md", b = r ? {
|
|
242
243
|
...t,
|
|
@@ -272,6 +273,6 @@ const j = l(
|
|
|
272
273
|
);
|
|
273
274
|
export {
|
|
274
275
|
x as L,
|
|
275
|
-
|
|
276
|
-
|
|
276
|
+
L as P,
|
|
277
|
+
k as S
|
|
277
278
|
};
|