@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.
Files changed (38) hide show
  1. package/dist/js/bottom-sheet-CBLNEX4F.js +281 -0
  2. package/dist/js/bottom-sheet.atoms-DFMOaMsU.js +78 -0
  3. package/dist/js/{calendar-De5dCVnE.js → calendar-B9rIZCdo.js} +318 -163
  4. package/dist/js/{index-DOdDlCoL.js → cn-BKwT3erk.js} +463 -788
  5. package/dist/js/enforce-subpath-import.js +1 -0
  6. package/dist/js/feedbacks/index.js +1 -1
  7. package/dist/js/{form-layout-BRqZZe8s.js → form-layout-PLH-7bWq.js} +14 -13
  8. package/dist/js/forms/index.js +1 -1
  9. package/dist/js/index-Dmu_fHni.js +329 -0
  10. package/dist/js/index.js +32 -31
  11. package/dist/js/layouts/index.js +1 -1
  12. package/dist/js/{menu-Du409VIG.js → menu-oRrbZAAy.js} +56 -60
  13. package/dist/js/navigation/index.js +1 -1
  14. package/dist/js/overlays/index.js +5 -4
  15. package/dist/js/primitive/index.js +2 -2
  16. package/dist/js/{skeleton-BNZyaRjo.js → skeleton-Ma-Fcs06.js} +6 -5
  17. package/dist/js/{switch-input-B-pwBWbi.js → switch-input-o8oO4Rf4.js} +482 -435
  18. package/dist/js/{tabs-BbOkYchB.js → tabs-DSeR5XxX.js} +6 -5
  19. package/dist/js/{tile-6SeBYc08.js → tile-8hqVMf2m.js} +110 -139
  20. package/dist/types/forms/chip-input/types.d.ts +16 -0
  21. package/dist/types/forms/date-range-picker-input/date-range-picker-input.d.ts +10 -0
  22. package/dist/types/forms/date-range-picker-input/index.d.ts +2 -0
  23. package/dist/types/forms/date-range-picker-input/types.d.ts +64 -0
  24. package/dist/types/forms/date-range-picker-input/use-date-range-picker.d.ts +13 -0
  25. package/dist/types/overlays/bottom-sheet/bottom-sheet.atoms.d.ts +17 -0
  26. package/dist/types/overlays/bottom-sheet/bottom-sheet.d.ts +7 -0
  27. package/dist/types/overlays/bottom-sheet/index.d.ts +2 -0
  28. package/dist/types/overlays/bottom-sheet/types.d.ts +22 -0
  29. package/dist/types/overlays/drawer/drawer.atoms.d.ts +2 -1
  30. package/dist/types/overlays/drawer/drawer.d.ts +1 -0
  31. package/dist/types/overlays/drawer/types.d.ts +6 -3
  32. package/dist/types/overlays/index.d.ts +1 -0
  33. package/dist/types/primitive/calendar/calendar.atoms.d.ts +13 -0
  34. package/dist/types/primitive/calendar/index.d.ts +1 -1
  35. package/dist/types/primitive/calendar/types.d.ts +38 -4
  36. package/dist/types/primitive/calendar/use-calendar.d.ts +18 -0
  37. package/package.json +1 -1
  38. package/dist/js/drawer-Cn7sreJG.js +0 -221
@@ -1,5 +1,6 @@
1
- import { j as u, a as x, c as y } from "./index-DOdDlCoL.js";
2
- import { forwardRef as m, useEffect as f, useRef as v, useState as M, createContext as j, useContext as k, useId as I } from "react";
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 = y(
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 = y(
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 = (o) => {
91
- o.key === "Escape" && t();
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: o = "center",
101
- children: r,
101
+ placement: r = "center",
102
+ children: o,
102
103
  disableOverlayClose: a,
103
104
  disableEscClose: i,
104
105
  ...s
105
106
  }) => {
106
- const d = v(null), c = v(null), [p, l] = M(e), [h, b] = M(!1);
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), b(!1), d.current = document.activeElement;
110
+ l(!0), v(!1), d.current = document.activeElement;
110
111
  else if (p) {
111
- b(!0);
112
+ v(!0);
112
113
  const g = setTimeout(() => {
113
- l(!1), b(!1), d.current && d.current.focus();
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: o })} transition-opacity duration-200 ease-in-out ` + (e && !h ? "opacity-100" : "opacity-0 pointer-events-none"),
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: o,
128
+ placement: r,
128
129
  children: /* @__PURE__ */ u.jsx(
129
130
  "div",
130
131
  {
131
- className: `${C({ size: n, placement: o })} transition-all duration-200 ease-in-out ` + (e && !h ? "opacity-100 scale-100" : "opacity-0 scale-95 pointer-events-none"),
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: r
137
+ children: o
137
138
  }
138
139
  )
139
140
  }
140
141
  );
141
- }, _ = Object.assign(T, {
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 = y(
151
+ }, S = b(
151
152
  // Modern, clean, accessible base style
152
- "z-50 min-w-40 bg-neutral-50 text-black rounded-lg shadow-md border border-transparent",
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-2",
161
- md: "py-2.5"
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 = y(
170
- "w-full text-left px-4 rounded-md cursor-pointer transition-colors duration-150 font-medium select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/70 hover:bg-ghost-100 active:bg-ghost-200 disabled:opacity-50 disabled:cursor-not-allowed",
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-2",
179
- md: "text-base py-2.5"
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: o, triggerRef: r } = w();
185
+ const { open: r, triggerRef: o } = w();
190
186
  return /* @__PURE__ */ u.jsx(
191
187
  "span",
192
188
  {
193
189
  ref: (a) => {
194
- r.current = a, typeof n == "function" ? n(a) : n && (n.current = a);
190
+ o.current = a, typeof n == "function" ? n(a) : n && (n.current = a);
195
191
  },
196
192
  "aria-haspopup": "menu",
197
- "aria-expanded": o,
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 }, o) => {
206
- const { open: r, contentRef: a, triggerRef: i, size: s } = w(), d = I();
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 o == "function" ? o(l) : o && (o.current = l);
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": !r,
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
- r ? "opacity-100" : "opacity-0",
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: r && e
232
+ children: o && e
237
233
  }
238
234
  );
239
235
  }
240
236
  ), K = m(
241
- ({ children: e, disabled: t, className: n, ...o }, r) => {
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: r,
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
- ...o,
253
+ ...r,
258
254
  children: e
259
255
  }
260
256
  );
261
257
  }
262
258
  );
263
- function $(e, t, n, o) {
259
+ function $(e, t, n, r) {
264
260
  f(() => {
265
261
  if (!e) return;
266
- function r(a) {
267
- !t.current?.contains(a.target) && !n.current?.contains(a.target) && o();
262
+ function o(a) {
263
+ !t.current?.contains(a.target) && !n.current?.contains(a.target) && r();
268
264
  }
269
- return document.addEventListener("mousedown", r), () => document.removeEventListener("mousedown", r);
270
- }, [e, o, t, n]);
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, o) {
276
+ function W(e, t, n, r) {
281
277
  f(() => {
282
278
  if (!e || !t.current) return;
283
- const r = t.current;
279
+ const o = t.current;
284
280
  function a(i) {
285
281
  const s = Array.from(
286
- r.querySelectorAll('[role="menuitem"]')
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(), o(), n.current?.focus());
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 r.addEventListener("keydown", a), () => r.removeEventListener("keydown", a);
291
- }, [e, o, t, n]);
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: o = "md"
293
+ size: r = "md"
298
294
  }) => {
299
- const r = v(null), a = v(null);
300
- return $(t, a, r, n), U(t, a), W(t, a, r, n), /* @__PURE__ */ u.jsx(
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: r, contentRef: a, size: o },
299
+ value: { open: t, triggerRef: o, contentRef: a, size: r },
304
300
  children: e
305
301
  }
306
302
  );
307
- }, G = Object.assign(P, {
303
+ }, J = Object.assign(P, {
308
304
  Trigger: B,
309
305
  Content: H,
310
306
  Item: K
311
307
  });
312
308
  export {
313
- G as M,
314
- _ as a
309
+ J as M,
310
+ G as a
315
311
  };
@@ -1,4 +1,4 @@
1
- import { B as s, T as b } from "../tabs-BbOkYchB.js";
1
+ import { B as s, T as b } from "../tabs-DSeR5XxX.js";
2
2
  export {
3
3
  s as Breadcrumbs,
4
4
  b as Tabs
@@ -1,7 +1,8 @@
1
- import { D as o } from "../drawer-Cn7sreJG.js";
2
- import { M as s, a as M } from "../menu-Du409VIG.js";
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
- o as Drawer,
4
+ e as BottomSheet,
5
+ r as Drawer,
5
6
  s as Menu,
6
- M as Modal
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-6SeBYc08.js";
2
- import { B as b, a as d, C as u, b as x, I as A, T as C } from "../calendar-De5dCVnE.js";
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 { c as l, j as o, a as d } from "./index-DOdDlCoL.js";
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
- ), S = f(({ value: a, max: e = 100, color: n = "primary", className: r, ...s }, t) => {
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
- }), L = m.forwardRef(
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
- S as P,
276
- L as S
276
+ L as P,
277
+ k as S
277
278
  };