@dimasbaguspm/versaur 0.0.0 → 0.0.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.
Files changed (68) hide show
  1. package/dist/index.js +6996 -66
  2. package/package.json +2 -10
  3. package/dist/alert-DzSPXqwS.js +0 -167
  4. package/dist/app-bar-B4nQkgdL.js +0 -92
  5. package/dist/avatar-Bsn24V6g.js +0 -91
  6. package/dist/badge-DqLCHm9q.js +0 -184
  7. package/dist/bottom-bar-DOQ3gVwW.js +0 -73
  8. package/dist/breadcrumbs-PJV3izUu.js +0 -59
  9. package/dist/button-C8OibEPE.js +0 -81
  10. package/dist/button-float-B8tdLJkX.js +0 -107
  11. package/dist/button-icon-CWji4cBA.js +0 -89
  12. package/dist/calendar-CkLj89o2.js +0 -112
  13. package/dist/checkbox-input-CSboebwt.js +0 -167
  14. package/dist/chip-input-C1PJPDFq.js +0 -189
  15. package/dist/cn-Ca4KprQ1.js +0 -2730
  16. package/dist/components/alert.js +0 -4
  17. package/dist/components/app-bar.js +0 -4
  18. package/dist/components/avatar.js +0 -4
  19. package/dist/components/badge.js +0 -4
  20. package/dist/components/bottom-bar.js +0 -4
  21. package/dist/components/breadcrumbs.js +0 -4
  22. package/dist/components/button-float.js +0 -4
  23. package/dist/components/button-icon.js +0 -4
  24. package/dist/components/button.js +0 -4
  25. package/dist/components/calendar.js +0 -4
  26. package/dist/components/checkbox-input.js +0 -4
  27. package/dist/components/chip-input.js +0 -4
  28. package/dist/components/date-single-picker-input.js +0 -4
  29. package/dist/components/drawer.js +0 -9
  30. package/dist/components/icon.js +0 -4
  31. package/dist/components/loading-indicator.js +0 -4
  32. package/dist/components/menu.js +0 -4
  33. package/dist/components/modal.js +0 -4
  34. package/dist/components/radio-input.js +0 -4
  35. package/dist/components/segment-multiple-input.js +0 -4
  36. package/dist/components/segment-single-input.js +0 -4
  37. package/dist/components/select-input.js +0 -4
  38. package/dist/components/skeleton.js +0 -4
  39. package/dist/components/snackbar.js +0 -4
  40. package/dist/components/switch-input.js +0 -7
  41. package/dist/components/tabs.js +0 -4
  42. package/dist/components/text-input.js +0 -4
  43. package/dist/components/text.js +0 -4
  44. package/dist/components/textarea-input.js +0 -4
  45. package/dist/components/tile.js +0 -4
  46. package/dist/components/top-bar.js +0 -4
  47. package/dist/date-single-picker-input--Ew0O9NQ.js +0 -252
  48. package/dist/drawer-DrnAR2a4.js +0 -218
  49. package/dist/helpers-CEDtBUGM.js +0 -37
  50. package/dist/hooks/index.js +0 -1
  51. package/dist/icon-D-lTZMHY.js +0 -44
  52. package/dist/index-DU1SCUkk.js +0 -329
  53. package/dist/loading-indicator-BZMnT5PA.js +0 -168
  54. package/dist/menu-BZvilMF7.js +0 -174
  55. package/dist/modal-BGAtqMl9.js +0 -149
  56. package/dist/radio-input-BRGoevZY.js +0 -173
  57. package/dist/segment-multiple-input-VwHCqFd6.js +0 -229
  58. package/dist/segment-single-input-Cqoo7-C2.js +0 -228
  59. package/dist/select-input-DCb0usvK.js +0 -108
  60. package/dist/skeleton-D4X5USf_.js +0 -59
  61. package/dist/snackbar-CYias-fJ.js +0 -79
  62. package/dist/switch-input-C5s1lvYh.js +0 -186
  63. package/dist/tabs-C8aRKfxS.js +0 -216
  64. package/dist/text-B7e-au41.js +0 -120
  65. package/dist/text-input-BsWvUk_H.js +0 -73
  66. package/dist/textarea-input-DZExXEE8.js +0 -102
  67. package/dist/tile-Du7YciCG.js +0 -51
  68. package/dist/top-bar-ErHvwR4K.js +0 -62
@@ -1,4 +0,0 @@
1
- import { A as o } from "../alert-DzSPXqwS.js";
2
- export {
3
- o as Alert
4
- };
@@ -1,4 +0,0 @@
1
- import { A as a } from "../app-bar-B4nQkgdL.js";
2
- export {
3
- a as AppBar
4
- };
@@ -1,4 +0,0 @@
1
- import { A as o } from "../avatar-Bsn24V6g.js";
2
- export {
3
- o as Avatar
4
- };
@@ -1,4 +0,0 @@
1
- import { B as o } from "../badge-DqLCHm9q.js";
2
- export {
3
- o as Badge
4
- };
@@ -1,4 +0,0 @@
1
- import { B as t } from "../bottom-bar-DOQ3gVwW.js";
2
- export {
3
- t as BottomBar
4
- };
@@ -1,4 +0,0 @@
1
- import { B as e } from "../breadcrumbs-PJV3izUu.js";
2
- export {
3
- e as Breadcrumbs
4
- };
@@ -1,4 +0,0 @@
1
- import { B as a } from "../button-float-B8tdLJkX.js";
2
- export {
3
- a as ButtonFloat
4
- };
@@ -1,4 +0,0 @@
1
- import { B as n } from "../button-icon-CWji4cBA.js";
2
- export {
3
- n as ButtonIcon
4
- };
@@ -1,4 +0,0 @@
1
- import { B as r } from "../button-C8OibEPE.js";
2
- export {
3
- r as Button
4
- };
@@ -1,4 +0,0 @@
1
- import { C as e } from "../calendar-CkLj89o2.js";
2
- export {
3
- e as Calendar
4
- };
@@ -1,4 +0,0 @@
1
- import { C as p } from "../checkbox-input-CSboebwt.js";
2
- export {
3
- p as CheckboxInput
4
- };
@@ -1,4 +0,0 @@
1
- import { C as r } from "../chip-input-C1PJPDFq.js";
2
- export {
3
- r as ChipInput
4
- };
@@ -1,4 +0,0 @@
1
- import { D as t } from "../date-single-picker-input--Ew0O9NQ.js";
2
- export {
3
- t as DateSinglePickerInput
4
- };
@@ -1,9 +0,0 @@
1
- import { D as e, c as s, d as D, b as o, a as w, u as t } from "../drawer-DrnAR2a4.js";
2
- export {
3
- e as Drawer,
4
- s as DrawerBody,
5
- D as DrawerFooter,
6
- o as DrawerHeader,
7
- w as DrawerOverlay,
8
- t as useDrawerContext
9
- };
@@ -1,4 +0,0 @@
1
- import { I } from "../icon-D-lTZMHY.js";
2
- export {
3
- I as Icon
4
- };
@@ -1,4 +0,0 @@
1
- import { L as r } from "../loading-indicator-BZMnT5PA.js";
2
- export {
3
- r as LoadingIndicator
4
- };
@@ -1,4 +0,0 @@
1
- import { M as r } from "../menu-BZvilMF7.js";
2
- export {
3
- r as Menu
4
- };
@@ -1,4 +0,0 @@
1
- import { M as r } from "../modal-BGAtqMl9.js";
2
- export {
3
- r as Modal
4
- };
@@ -1,4 +0,0 @@
1
- import { R as p } from "../radio-input-BRGoevZY.js";
2
- export {
3
- p as RadioInput
4
- };
@@ -1,4 +0,0 @@
1
- import { S as p } from "../segment-multiple-input-VwHCqFd6.js";
2
- export {
3
- p as SegmentMultipleInput
4
- };
@@ -1,4 +0,0 @@
1
- import { S as t } from "../segment-single-input-Cqoo7-C2.js";
2
- export {
3
- t as SegmentSingleInput
4
- };
@@ -1,4 +0,0 @@
1
- import { S as o } from "../select-input-DCb0usvK.js";
2
- export {
3
- o as SelectInput
4
- };
@@ -1,4 +0,0 @@
1
- import { S as r } from "../skeleton-D4X5USf_.js";
2
- export {
3
- r as Skeleton
4
- };
@@ -1,4 +0,0 @@
1
- import { S as o } from "../snackbar-CYias-fJ.js";
2
- export {
3
- o as Snackbar
4
- };
@@ -1,7 +0,0 @@
1
- import { S as t, c as h, b as S, a as i } from "../switch-input-C5s1lvYh.js";
2
- export {
3
- t as SwitchInput,
4
- h as SwitchLabel,
5
- S as SwitchThumb,
6
- i as SwitchTrack
7
- };
@@ -1,4 +0,0 @@
1
- import { T as r } from "../tabs-C8aRKfxS.js";
2
- export {
3
- r as Tabs
4
- };
@@ -1,4 +0,0 @@
1
- import { T as o } from "../text-input-BsWvUk_H.js";
2
- export {
3
- o as TextInput
4
- };
@@ -1,4 +0,0 @@
1
- import { T as r } from "../text-B7e-au41.js";
2
- export {
3
- r as Text
4
- };
@@ -1,4 +0,0 @@
1
- import { T as t } from "../textarea-input-DZExXEE8.js";
2
- export {
3
- t as TextAreaInput
4
- };
@@ -1,4 +0,0 @@
1
- import { T as r } from "../tile-Du7YciCG.js";
2
- export {
3
- r as Tile
4
- };
@@ -1,4 +0,0 @@
1
- import { T as a } from "../top-bar-ErHvwR4K.js";
2
- export {
3
- a as TopBar
4
- };
@@ -1,252 +0,0 @@
1
- import { j as e } from "./index-DU1SCUkk.js";
2
- import C, { useState as v, useEffect as T, useId as z, useRef as V, useCallback as b } from "react";
3
- import { M as y } from "./modal-BGAtqMl9.js";
4
- import { B as S } from "./button-C8OibEPE.js";
5
- import { c as w } from "./cn-Ca4KprQ1.js";
6
- import { t as _ } from "./helpers-CEDtBUGM.js";
7
- import { M as j } from "./menu-BZvilMF7.js";
8
- import { C as N } from "./calendar-CkLj89o2.js";
9
- const q = _, I = C.forwardRef(
10
- ({
11
- leftContent: n,
12
- rightContent: a,
13
- hasError: t,
14
- variant: c = "primary",
15
- value: d,
16
- placeholder: o = "Select date",
17
- formatDate: s,
18
- className: l,
19
- ...i
20
- }, m) => /* @__PURE__ */ e.jsxs(
21
- "button",
22
- {
23
- ref: m,
24
- type: "button",
25
- "aria-invalid": t,
26
- className: w(
27
- q({
28
- variant: t ? "danger" : c
29
- }),
30
- n ? "pl-9" : "pl-3",
31
- a ? "pr-9" : "pr-3",
32
- "h-10 flex items-center justify-between cursor-pointer w-full relative",
33
- "text-left",
34
- l
35
- ),
36
- ...i,
37
- children: [
38
- n && /* @__PURE__ */ e.jsx(
39
- "span",
40
- {
41
- className: "absolute left-2.5 top-0 bottom-0 pointer-events-none text-gray-500 flex items-center justify-center w-5",
42
- "data-testid": "left-content",
43
- children: n
44
- }
45
- ),
46
- /* @__PURE__ */ e.jsx(
47
- "span",
48
- {
49
- className: w(
50
- "flex-1",
51
- n ? "ml-2" : "",
52
- a ? "mr-2" : ""
53
- ),
54
- children: s ? s(d) : o
55
- }
56
- ),
57
- a && /* @__PURE__ */ e.jsx(
58
- "span",
59
- {
60
- className: "absolute right-2.5 top-0 bottom-0 pointer-events-none text-gray-500 flex items-center justify-center w-5",
61
- "data-testid": "right-content",
62
- children: a
63
- }
64
- )
65
- ]
66
- }
67
- )
68
- );
69
- I.displayName = "DateSinglePickerTrigger";
70
- const A = ({
71
- open: n,
72
- value: a,
73
- onChange: t,
74
- handleMenuClose: c
75
- }) => /* @__PURE__ */ e.jsxs(j, { isOpen: n, onOutsideClick: c, children: [
76
- /* @__PURE__ */ e.jsx(j.Trigger, { className: "absolute top-[90%] left-0", children: /* @__PURE__ */ e.jsx("span", { "aria-hidden": "true" }) }),
77
- /* @__PURE__ */ e.jsx(j.Content, { className: "drop-shadow-lg rounded-lg bg-white border border-neutral", children: /* @__PURE__ */ e.jsx(N, { value: a, onChange: t }) })
78
- ] }), L = ({
79
- open: n,
80
- setOpen: a,
81
- value: t,
82
- onChange: c,
83
- label: d,
84
- buttonRef: o
85
- }) => {
86
- const [s, l] = v(
87
- t
88
- );
89
- T(() => {
90
- l(t);
91
- }, [t, n]);
92
- const i = () => {
93
- a(!1), l(t), o.current?.focus();
94
- }, m = () => {
95
- s && (c(s), a(!1), o.current?.focus());
96
- };
97
- return /* @__PURE__ */ e.jsxs(
98
- y,
99
- {
100
- isOpen: n,
101
- onOpenChange: a,
102
- placement: "top",
103
- size: "md",
104
- "aria-label": d ? String(d) : "Select date",
105
- disableOverlayClose: !1,
106
- disableEscClose: !1,
107
- children: [
108
- /* @__PURE__ */ e.jsx(y.Body, { className: "px-2", children: /* @__PURE__ */ e.jsx(N, { value: s, onChange: l }) }),
109
- /* @__PURE__ */ e.jsxs(y.Footer, { className: "px-6", children: [
110
- /* @__PURE__ */ e.jsx(
111
- S,
112
- {
113
- onClick: i,
114
- variant: "ghost",
115
- type: "button",
116
- size: "sm",
117
- children: "Cancel"
118
- }
119
- ),
120
- /* @__PURE__ */ e.jsx(
121
- S,
122
- {
123
- onClick: m,
124
- variant: "primary",
125
- type: "button",
126
- disabled: !s,
127
- size: "sm",
128
- children: "Confirm"
129
- }
130
- )
131
- ] })
132
- ]
133
- }
134
- );
135
- };
136
- function $({ id: n }) {
137
- const [a, t] = v(!1), c = z(), d = n || c, o = V(null), s = b(
138
- (i) => {
139
- (i.key === "ArrowDown" || i.key === "Enter" || i.key === " ") && t(!0);
140
- },
141
- []
142
- ), l = b(() => {
143
- t(!1), o.current?.focus();
144
- }, []);
145
- return {
146
- open: a,
147
- setOpen: t,
148
- inputId: d,
149
- buttonRef: o,
150
- handleKeyDown: s,
151
- handleMenuClose: l
152
- };
153
- }
154
- const Z = C.forwardRef(
155
- ({
156
- value: n,
157
- onChange: a,
158
- label: t,
159
- leftContent: c,
160
- rightContent: d,
161
- helperText: o,
162
- error: s,
163
- variant: l = "primary",
164
- disabled: i,
165
- placeholder: m = "Select date",
166
- id: M,
167
- type: P = "docked",
168
- ...x
169
- }, u) => {
170
- if (n === void 0 || typeof a != "function")
171
- throw new Error(
172
- "DateSinglePickerInput is a controlled component: value and onChange are required."
173
- );
174
- const {
175
- open: f,
176
- setOpen: D,
177
- inputId: p,
178
- buttonRef: g,
179
- handleKeyDown: O,
180
- handleMenuClose: R
181
- } = $({ id: M }), h = !!s, E = (r) => r ? r.toLocaleDateString(void 0, {
182
- year: "numeric",
183
- month: "short",
184
- day: "numeric"
185
- }) : typeof m == "string" ? m : "Select date", B = (r) => typeof x.formatDate == "function" ? x.formatDate(r) : E(r), F = () => D((r) => !r), K = O, k = (r) => {
186
- a?.(r), g.current?.focus();
187
- };
188
- return /* @__PURE__ */ e.jsxs("div", { className: "relative w-full", children: [
189
- /* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
190
- t && /* @__PURE__ */ e.jsx(
191
- "label",
192
- {
193
- htmlFor: p,
194
- className: "block text-sm font-medium text-foreground mb-2",
195
- children: t
196
- }
197
- ),
198
- /* @__PURE__ */ e.jsx(
199
- I,
200
- {
201
- ref: (r) => {
202
- g.current = r, typeof u == "function" ? u(r) : u && (u.current = r);
203
- },
204
- id: p,
205
- "aria-haspopup": "dialog",
206
- "aria-expanded": f,
207
- "aria-controls": f ? `${p}-calendar` : void 0,
208
- "aria-invalid": h,
209
- "aria-disabled": i,
210
- disabled: i,
211
- leftContent: c,
212
- rightContent: d,
213
- hasError: h,
214
- variant: l,
215
- value: n,
216
- placeholder: typeof m == "string" ? m : "Select date",
217
- formatDate: B,
218
- onClick: F,
219
- onKeyDown: K,
220
- tabIndex: 0,
221
- ...x
222
- }
223
- ),
224
- h && /* @__PURE__ */ e.jsx("div", { className: "mt-1 text-sm text-danger", role: "alert", children: s }),
225
- o && /* @__PURE__ */ e.jsx("div", { className: "mt-1 text-sm text-muted-foreground", children: o })
226
- ] }),
227
- P === "docked" ? /* @__PURE__ */ e.jsx(
228
- A,
229
- {
230
- open: f,
231
- value: n,
232
- onChange: k,
233
- inputId: p,
234
- handleMenuClose: R
235
- }
236
- ) : /* @__PURE__ */ e.jsx(
237
- L,
238
- {
239
- open: f,
240
- setOpen: D,
241
- value: n,
242
- onChange: k,
243
- label: typeof t == "string" ? t : void 0,
244
- buttonRef: g
245
- }
246
- )
247
- ] });
248
- }
249
- );
250
- export {
251
- Z as D
252
- };
@@ -1,218 +0,0 @@
1
- import { c as d, j as s } from "./index-DU1SCUkk.js";
2
- import i, { createContext as g, useContext as h, useCallback as p, useEffect as y } from "react";
3
- import { c as l } from "./cn-Ca4KprQ1.js";
4
- const w = g(null);
5
- function c() {
6
- const t = h(w);
7
- if (!t)
8
- throw new Error(
9
- "Drawer components must be used within a DrawerRoot component"
10
- );
11
- return t;
12
- }
13
- const j = d(
14
- "fixed inset-0 z-50 transition-opacity duration-300 bg-black/30 backdrop-blur-md",
15
- {
16
- variants: {
17
- state: {
18
- open: "opacity-100",
19
- closed: "opacity-0 pointer-events-none"
20
- }
21
- },
22
- defaultVariants: {
23
- state: "closed"
24
- }
25
- }
26
- ), k = d(
27
- "fixed z-50 shadow-xl transition-transform duration-300 ease-in-out flex flex-col",
28
- {
29
- variants: {
30
- position: {
31
- left: "left-0 top-0 bottom-0 border-r",
32
- right: "right-0 top-0 bottom-0 border-l"
33
- },
34
- size: {
35
- sm: "w-80",
36
- md: "w-96",
37
- lg: "w-[28rem]",
38
- xl: "w-[32rem]",
39
- "3/4": "w-[75vw]",
40
- full: "w-full"
41
- },
42
- variant: {
43
- default: "bg-white border-gray-200",
44
- glass: "bg-white/10 backdrop-blur-lg border-white/20"
45
- }
46
- },
47
- defaultVariants: {
48
- position: "right",
49
- size: "md",
50
- variant: "default"
51
- }
52
- }
53
- ), D = d("flex-shrink-0 px-6 py-4 border-b", {
54
- variants: {
55
- variant: {
56
- default: "bg-white border-gray-200",
57
- glass: "bg-transparent border-white/10"
58
- }
59
- },
60
- defaultVariants: {
61
- variant: "default"
62
- }
63
- }), V = d("flex-1 overflow-y-auto px-6 py-4", {
64
- variants: {
65
- variant: {
66
- default: "bg-white",
67
- glass: "bg-transparent"
68
- }
69
- },
70
- defaultVariants: {
71
- variant: "default"
72
- }
73
- }), C = d("flex-shrink-0 px-6 py-4 border-t", {
74
- variants: {
75
- variant: {
76
- default: "bg-white border-gray-200",
77
- glass: "bg-transparent border-white/10"
78
- },
79
- responsiveFlex: {
80
- true: "flex flex-row gap-3 sm:justify-end [&>*]:sm:flex-grow-0 [&>*]:flex-grow",
81
- false: "flex gap-2"
82
- }
83
- },
84
- defaultVariants: {
85
- variant: "default",
86
- responsiveFlex: !0
87
- }
88
- }), R = i.forwardRef(({ className: t, ...e }, a) => {
89
- const { isOpen: r, onClose: o } = c(), n = () => {
90
- o();
91
- };
92
- return /* @__PURE__ */ s.jsx(
93
- "div",
94
- {
95
- ref: a,
96
- onClick: n,
97
- className: l(
98
- j({
99
- state: r ? "open" : "closed"
100
- }),
101
- t
102
- ),
103
- ...e
104
- }
105
- );
106
- }), E = i.forwardRef(
107
- ({ children: t, className: e, ...a }, r) => {
108
- const { variant: o } = c();
109
- return /* @__PURE__ */ s.jsx(
110
- "div",
111
- {
112
- ref: r,
113
- className: l(D({ variant: o }), e),
114
- ...a,
115
- children: t
116
- }
117
- );
118
- }
119
- ), N = i.forwardRef(
120
- ({ children: t, className: e, ...a }, r) => {
121
- const { variant: o } = c();
122
- return /* @__PURE__ */ s.jsx(
123
- "div",
124
- {
125
- ref: r,
126
- className: l(V({ variant: o }), e),
127
- ...a,
128
- children: t
129
- }
130
- );
131
- }
132
- ), F = i.forwardRef(
133
- ({ children: t, className: e, responsiveFlex: a = !0, ...r }, o) => {
134
- const { variant: n } = c();
135
- return /* @__PURE__ */ s.jsx(
136
- "div",
137
- {
138
- ref: o,
139
- className: l(
140
- C({ variant: n, responsiveFlex: a }),
141
- e
142
- ),
143
- ...r,
144
- children: t
145
- }
146
- );
147
- }
148
- ), z = ({
149
- children: t,
150
- isOpen: e,
151
- onClose: a,
152
- position: r = "right",
153
- size: o = "md",
154
- variant: n = "default",
155
- className: v,
156
- ...x
157
- }) => {
158
- const f = p(() => {
159
- a(!1);
160
- }, [a]), m = {
161
- isOpen: e,
162
- onClose: f,
163
- position: r,
164
- size: o,
165
- variant: n
166
- };
167
- return y(() => {
168
- const u = (b) => {
169
- b.key === "Escape" && e && f();
170
- };
171
- return e && (document.addEventListener("keydown", u), document.body.style.overflow = "hidden"), () => {
172
- document.removeEventListener("keydown", u), document.body.style.overflow = "unset";
173
- };
174
- }, [e, f]), /* @__PURE__ */ s.jsx(w.Provider, { value: m, children: /* @__PURE__ */ s.jsxs(
175
- "div",
176
- {
177
- className: l(
178
- "fixed z-50 inset-0 pointer-events-none",
179
- e && "pointer-events-auto"
180
- ),
181
- children: [
182
- /* @__PURE__ */ s.jsx(R, {}),
183
- /* @__PURE__ */ s.jsx(
184
- "div",
185
- {
186
- role: e ? "dialog" : void 0,
187
- "aria-modal": e ? "true" : void 0,
188
- className: l(
189
- k({
190
- position: r,
191
- size: o,
192
- variant: n
193
- }),
194
- // Apply closed transform when not open
195
- !e && r === "left" && "-translate-x-full",
196
- !e && r === "right" && "translate-x-full",
197
- v
198
- ),
199
- ...x,
200
- children: e && t
201
- }
202
- )
203
- ]
204
- }
205
- ) });
206
- }, _ = Object.assign(z, {
207
- Header: E,
208
- Body: N,
209
- Footer: F
210
- });
211
- export {
212
- _ as D,
213
- R as a,
214
- E as b,
215
- N as c,
216
- F as d,
217
- c as u
218
- };