@dimasbaguspm/versaur 0.0.22 → 0.0.23

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.
@@ -0,0 +1,597 @@
1
+ import { c as i, j as s, a as l } from "./index-DOdDlCoL.js";
2
+ import * as v from "react";
3
+ import { forwardRef as n } from "react";
4
+ import "./image-rectangle-GA3oWX7A.js";
5
+ import "./snackbar-DH8jCh2V.js";
6
+ import { T as d } from "./text-CRsIInRA.js";
7
+ const h = i(
8
+ "w-full flex flex-wrap items-center pt-3 mb-3 gap-2 bg-white [&>[data-versaur-appbar-bottom]]:basis-full [&>[data-versaur-appbar-bottom]]:w-full [&:has([data-versaur-appbar-bottom])>[data-versaur-appbar-leading]]:pl-4 [&:has([data-versaur-appbar-bottom])>[data-versaur-appbar-trailing]]:pr-4 [&:not(:has([data-versaur-appbar-bottom]))]:px-4",
9
+ {
10
+ variants: {
11
+ variant: {
12
+ primary: "",
13
+ secondary: "",
14
+ tertiary: "",
15
+ ghost: "",
16
+ neutral: ""
17
+ }
18
+ },
19
+ defaultVariants: {
20
+ variant: "primary"
21
+ }
22
+ }
23
+ ), j = i(
24
+ "flex flex-col justify-center min-w-0 flex-grow",
25
+ {
26
+ variants: {
27
+ placement: {
28
+ start: "items-start",
29
+ center: "items-center",
30
+ end: "items-end"
31
+ }
32
+ },
33
+ defaultVariants: {
34
+ placement: "start"
35
+ }
36
+ }
37
+ ), y = n(
38
+ ({ children: t, className: a }, e) => /* @__PURE__ */ s.jsx(
39
+ "div",
40
+ {
41
+ ref: e,
42
+ "data-versaur-appbar-bottom": !0,
43
+ className: l("w-full flex items-center min-h-[2.5rem] mt-2", a),
44
+ children: t
45
+ }
46
+ )
47
+ ), B = n(
48
+ ({ children: t, className: a }, e) => /* @__PURE__ */ s.jsx(
49
+ "div",
50
+ {
51
+ ref: e,
52
+ className: l("flex items-center", a),
53
+ "data-versaur-appbar-leading": !0,
54
+ children: t
55
+ }
56
+ )
57
+ ), w = n(({ children: t, ...a }, e) => /* @__PURE__ */ s.jsx(
58
+ d,
59
+ {
60
+ ...a,
61
+ as: "h1",
62
+ ref: e,
63
+ fontSize: "lg",
64
+ fontWeight: "semibold",
65
+ ellipsis: !0,
66
+ clamp: 1,
67
+ children: t
68
+ }
69
+ )), N = n(({ children: t, ...a }, e) => /* @__PURE__ */ s.jsx(
70
+ d,
71
+ {
72
+ ...a,
73
+ ref: e,
74
+ as: "p",
75
+ fontSize: "xs",
76
+ fontWeight: "normal",
77
+ ellipsis: !0,
78
+ clamp: 1,
79
+ color: "gray",
80
+ children: t
81
+ }
82
+ )), T = n(
83
+ ({ children: t, className: a }, e) => /* @__PURE__ */ s.jsx(
84
+ "div",
85
+ {
86
+ ref: e,
87
+ className: l("flex items-center justify-end gap-2", a),
88
+ "data-versaur-appbar-trailing": !0,
89
+ children: t
90
+ }
91
+ )
92
+ ), V = n(
93
+ ({ children: t, className: a, placement: e }, r) => /* @__PURE__ */ s.jsx(
94
+ "div",
95
+ {
96
+ ref: r,
97
+ className: l(j({ placement: e }), a),
98
+ children: t
99
+ }
100
+ )
101
+ ), S = ({
102
+ children: t,
103
+ className: a,
104
+ variant: e = "primary"
105
+ }) => /* @__PURE__ */ s.jsx(
106
+ "header",
107
+ {
108
+ className: l(h({ variant: e }), a),
109
+ role: "banner",
110
+ children: t
111
+ }
112
+ ), ja = Object.assign(S, {
113
+ Leading: B,
114
+ Headline: w,
115
+ Subtitle: N,
116
+ Trailing: T,
117
+ Center: V,
118
+ Bottom: y
119
+ }), H = i(
120
+ "sticky bottom-0 left-0 w-full flex justify-between items-center bg-white border-t border-border shadow-xs z-40 safe-bottom px-8 py-1",
121
+ {
122
+ variants: {
123
+ variant: {
124
+ primary: "",
125
+ secondary: "",
126
+ ghost: "",
127
+ neutral: "",
128
+ tertiary: ""
129
+ },
130
+ size: {
131
+ sm: "h-12 text-sm",
132
+ md: "h-16 text-base",
133
+ lg: "h-20 text-lg"
134
+ }
135
+ },
136
+ defaultVariants: {
137
+ variant: "primary",
138
+ size: "md"
139
+ }
140
+ }
141
+ ), A = i(
142
+ "flex flex-col items-center justify-center gap-1 px-2 py-1",
143
+ {
144
+ variants: {
145
+ active: {
146
+ true: "font-semibold text-primary",
147
+ false: "text-ghost"
148
+ }
149
+ },
150
+ defaultVariants: {
151
+ active: !1
152
+ }
153
+ }
154
+ ), L = n(
155
+ ({ icon: t, label: a, active: e = !1, className: r, ...o }, c) => /* @__PURE__ */ s.jsxs(
156
+ "div",
157
+ {
158
+ ref: c,
159
+ "aria-current": e ? "page" : void 0,
160
+ className: A({ active: e, className: r }),
161
+ ...o,
162
+ children: [
163
+ t,
164
+ a && /* @__PURE__ */ s.jsx("span", { className: "text-xs mt-0.5", children: a })
165
+ ]
166
+ }
167
+ )
168
+ ), P = ({
169
+ children: t,
170
+ variant: a = "primary",
171
+ size: e = "md",
172
+ className: r,
173
+ ...o
174
+ }) => /* @__PURE__ */ s.jsx(
175
+ "nav",
176
+ {
177
+ role: "navigation",
178
+ "aria-label": "Bottom navigation",
179
+ className: H({ variant: a, size: e, className: r }),
180
+ ...o,
181
+ children: t
182
+ }
183
+ ), ya = Object.assign(P, {
184
+ Item: L
185
+ }), z = i("flex", {
186
+ variants: {
187
+ orientation: {
188
+ horizontal: "flex-row",
189
+ vertical: "flex-col"
190
+ },
191
+ alignment: {
192
+ start: "justify-start",
193
+ center: "justify-center",
194
+ end: "justify-end",
195
+ between: "justify-between",
196
+ around: "justify-around",
197
+ evenly: "justify-evenly"
198
+ },
199
+ gap: {
200
+ xs: "gap-1",
201
+ sm: "gap-2",
202
+ md: "gap-3",
203
+ lg: "gap-4",
204
+ xl: "gap-6"
205
+ },
206
+ fluid: {
207
+ true: "[&>*]:flex-1",
208
+ false: ""
209
+ }
210
+ },
211
+ defaultVariants: {
212
+ orientation: "horizontal",
213
+ alignment: "start",
214
+ gap: "md",
215
+ fluid: !1
216
+ }
217
+ }), Ba = n(
218
+ function({
219
+ className: a,
220
+ children: e,
221
+ orientation: r = "horizontal",
222
+ alignment: o = "start",
223
+ gap: c = "md",
224
+ fluid: p = !1,
225
+ ...m
226
+ }, x) {
227
+ return /* @__PURE__ */ s.jsx(
228
+ "div",
229
+ {
230
+ ref: x,
231
+ className: l(
232
+ z({
233
+ orientation: r,
234
+ alignment: o,
235
+ gap: c,
236
+ fluid: p
237
+ }),
238
+ a
239
+ ),
240
+ role: "group",
241
+ ...m,
242
+ children: e
243
+ }
244
+ );
245
+ }
246
+ ), C = i("w-full"), R = i(
247
+ "flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4 px-4 sm:px-6 mb-4"
248
+ ), I = i("mb-4 px-4 sm:px-6"), k = i(
249
+ "flex-1 min-w-0 flex flex-col gap-2 w-full sm:w-auto"
250
+ ), F = i("flex items-center gap-2 flex-wrap"), G = i(
251
+ "flex flex-col sm:flex-row gap-2 sm:gap-3 w-full sm:w-auto sm:ml-auto sm:shrink-0 [&>*]:w-full sm:[&>*]:w-auto"
252
+ ), O = i(
253
+ "w-full flex items-center px-4 sm:px-6 py-0 overflow-x-auto"
254
+ ), W = n(
255
+ ({ children: t, className: a, ...e }, r) => /* @__PURE__ */ s.jsx(
256
+ "div",
257
+ {
258
+ ref: r,
259
+ className: l(R(), a),
260
+ "data-versaur-page-header-top": !0,
261
+ ...e,
262
+ children: t
263
+ }
264
+ )
265
+ ), M = n(({ children: t, className: a, ...e }, r) => /* @__PURE__ */ s.jsx(
266
+ "div",
267
+ {
268
+ ref: r,
269
+ className: l(I(), a),
270
+ "data-versaur-page-header-breadcrumbs": !0,
271
+ ...e,
272
+ children: t
273
+ }
274
+ )), E = n(({ children: t, className: a, ...e }, r) => /* @__PURE__ */ s.jsx(
275
+ "div",
276
+ {
277
+ ref: r,
278
+ className: l(k(), a),
279
+ "data-versaur-page-header-content": !0,
280
+ ...e,
281
+ children: t
282
+ }
283
+ )), $ = n((t, a) => /* @__PURE__ */ s.jsx(
284
+ d,
285
+ {
286
+ ...t,
287
+ as: "h1",
288
+ fontSize: "xl",
289
+ fontWeight: "semibold",
290
+ ellipsis: !0,
291
+ ref: a
292
+ }
293
+ )), q = n(({ className: t, ...a }, e) => /* @__PURE__ */ s.jsx(
294
+ d,
295
+ {
296
+ as: "p",
297
+ fontSize: "sm",
298
+ fontWeight: "normal",
299
+ clamp: 2,
300
+ ref: e,
301
+ className: l("mb-2 sm:clamp-3", t),
302
+ ...a
303
+ }
304
+ )), D = n(({ children: t, className: a, ...e }, r) => /* @__PURE__ */ s.jsx(
305
+ "div",
306
+ {
307
+ ref: r,
308
+ className: l(F(), a),
309
+ "data-versaur-page-header-badges": !0,
310
+ ...e,
311
+ children: t
312
+ }
313
+ )), J = n(({ children: t, className: a, ...e }, r) => /* @__PURE__ */ s.jsx(
314
+ "div",
315
+ {
316
+ ref: r,
317
+ className: l(G(), a),
318
+ "data-versaur-page-header-actions": !0,
319
+ ...e,
320
+ children: t
321
+ }
322
+ )), K = n(({ children: t, className: a, ...e }, r) => /* @__PURE__ */ s.jsx(
323
+ "div",
324
+ {
325
+ ref: r,
326
+ className: l(O(), a),
327
+ "data-versaur-page-header-bottom": !0,
328
+ ...e,
329
+ children: t
330
+ }
331
+ )), Q = n(
332
+ ({
333
+ children: t,
334
+ className: a,
335
+ title: e,
336
+ subtitle: r,
337
+ breadcrumbs: o,
338
+ badges: c,
339
+ actions: p,
340
+ tabs: m,
341
+ ...x
342
+ }, u) => {
343
+ const g = e || r || o || c || p, b = m;
344
+ return /* @__PURE__ */ s.jsxs(
345
+ "header",
346
+ {
347
+ ref: u,
348
+ className: l(C(), a),
349
+ role: "banner",
350
+ ...x,
351
+ children: [
352
+ o && /* @__PURE__ */ s.jsx(M, { children: o }),
353
+ g && /* @__PURE__ */ s.jsxs(W, { children: [
354
+ /* @__PURE__ */ s.jsxs(E, { children: [
355
+ e && /* @__PURE__ */ s.jsx($, { children: e }),
356
+ r && /* @__PURE__ */ s.jsx(q, { children: r }),
357
+ c && /* @__PURE__ */ s.jsx(D, { children: c })
358
+ ] }),
359
+ p && /* @__PURE__ */ s.jsx(J, { children: p })
360
+ ] }),
361
+ b && /* @__PURE__ */ s.jsx(K, { children: m }),
362
+ t
363
+ ]
364
+ }
365
+ );
366
+ }
367
+ ), wa = Q, U = i(
368
+ "w-full flex items-center px-6 py-4 mb-6 border-b border-border shadow-xs bg-white",
369
+ {
370
+ variants: {},
371
+ defaultVariants: {}
372
+ }
373
+ ), X = i("flex items-center gap-3 min-w-0 flex-1"), Y = i("flex items-center gap-2 ml-auto"), Z = i(
374
+ "px-2.5 py-1.5 rounded-md text-sm cursor-pointer transition-colors",
375
+ {
376
+ variants: {
377
+ active: {
378
+ true: "bg-primary/10 text-primary",
379
+ false: "hover:text-primary text-ghost"
380
+ }
381
+ },
382
+ defaultVariants: {
383
+ active: !1
384
+ }
385
+ }
386
+ ), _ = i("flex items-center gap-2 ml-4"), aa = i("flex items-center gap-2 mr-4"), ea = n(
387
+ function({ children: a, className: e, ...r }, o) {
388
+ return /* @__PURE__ */ s.jsx("nav", { ref: o, className: _({ className: e }), ...r, children: a });
389
+ }
390
+ ), ta = n(
391
+ function({ children: a, className: e, ...r }, o) {
392
+ return /* @__PURE__ */ s.jsx("div", { ref: o, className: aa({ className: e }), ...r, children: a });
393
+ }
394
+ ), sa = n(
395
+ function({ children: a, className: e, ...r }, o) {
396
+ return /* @__PURE__ */ s.jsx("div", { ref: o, className: X({ className: e }), ...r, children: a });
397
+ }
398
+ ), ra = n(
399
+ function({ children: a, className: e, ...r }, o) {
400
+ return /* @__PURE__ */ s.jsx("div", { ref: o, className: Y({ className: e }), ...r, children: a });
401
+ }
402
+ ), oa = n(
403
+ function({ children: a, className: e, active: r, ...o }, c) {
404
+ return /* @__PURE__ */ s.jsx(
405
+ "div",
406
+ {
407
+ ref: c,
408
+ className: Z({ active: r, className: e }),
409
+ "aria-current": r ? "page" : void 0,
410
+ ...o,
411
+ children: a
412
+ }
413
+ );
414
+ }
415
+ ), na = n(
416
+ ({ children: t, className: a, ...e }, r) => /* @__PURE__ */ s.jsx("header", { ref: r, className: U({ className: a }), ...e, children: t })
417
+ ), Na = Object.assign(na, {
418
+ Leading: sa,
419
+ Trailing: ra,
420
+ NavItem: oa,
421
+ Nav: ea,
422
+ Actions: ta
423
+ }), ia = i("w-full mx-auto relative", {
424
+ variants: {
425
+ type: {
426
+ desktop: "max-w-7xl px-6 pb-10",
427
+ tablet: "max-w-3xl px-4",
428
+ mobile: "w-full"
429
+ }
430
+ },
431
+ defaultVariants: {
432
+ type: "desktop"
433
+ }
434
+ }), Ta = v.forwardRef(
435
+ function({ type: a = "desktop", className: e, children: r, ...o }, c) {
436
+ return /* @__PURE__ */ s.jsx(
437
+ "div",
438
+ {
439
+ ref: c,
440
+ className: l(ia({ type: a }), e),
441
+ ...o,
442
+ children: r
443
+ }
444
+ );
445
+ }
446
+ ), la = i("grid w-full gap-4 grid-cols-12"), ca = i("", {
447
+ variants: {
448
+ span: {
449
+ 1: "col-span-1",
450
+ 2: "col-span-2",
451
+ 3: "col-span-3",
452
+ 4: "col-span-4",
453
+ 5: "col-span-5",
454
+ 6: "col-span-6",
455
+ 7: "col-span-7",
456
+ 8: "col-span-8",
457
+ 9: "col-span-9",
458
+ 10: "col-span-10",
459
+ 11: "col-span-11",
460
+ 12: "col-span-12"
461
+ }
462
+ },
463
+ defaultVariants: {
464
+ span: "4"
465
+ }
466
+ }), pa = n(
467
+ function({ className: a, children: e, ...r }, o) {
468
+ return /* @__PURE__ */ s.jsx(
469
+ "div",
470
+ {
471
+ ref: o,
472
+ className: l(la(), a),
473
+ ...r,
474
+ children: e
475
+ }
476
+ );
477
+ }
478
+ ), ma = n(
479
+ function({ span: a = 4, className: e, children: r, ...o }, c) {
480
+ const p = Math.min(12, Math.max(1, a));
481
+ return /* @__PURE__ */ s.jsx(
482
+ "div",
483
+ {
484
+ ref: c,
485
+ className: l(
486
+ ca({ span: `${p}` }),
487
+ e
488
+ ),
489
+ ...o,
490
+ children: r
491
+ }
492
+ );
493
+ }
494
+ ), Va = Object.assign(pa, {
495
+ Column: ma
496
+ }), f = i(
497
+ "flex items-center gap-2 px-4 py-2 rounded-md hover:text-primary focus:outline-none transition-colors",
498
+ {
499
+ variants: {
500
+ active: {
501
+ true: "bg-primary/10 text-primary",
502
+ false: "text-ghost"
503
+ },
504
+ disabled: {
505
+ true: "opacity-50 pointer-events-none",
506
+ false: ""
507
+ }
508
+ },
509
+ defaultVariants: {
510
+ active: !1,
511
+ disabled: !1
512
+ }
513
+ }
514
+ ), da = n(
515
+ (t, a) => {
516
+ const { icon: e, children: r, href: o, onClick: c, active: p, ...m } = t;
517
+ if (typeof o == "string") {
518
+ const u = m;
519
+ return /* @__PURE__ */ s.jsx("li", { children: /* @__PURE__ */ s.jsxs(
520
+ "a",
521
+ {
522
+ ref: a,
523
+ href: o,
524
+ className: f({
525
+ disabled: !!t["aria-disabled"],
526
+ active: p
527
+ }),
528
+ ...u,
529
+ children: [
530
+ e,
531
+ /* @__PURE__ */ s.jsx(d, { as: "span", color: "inherit", fontSize: "sm", children: r })
532
+ ]
533
+ }
534
+ ) });
535
+ } else {
536
+ const u = m;
537
+ return /* @__PURE__ */ s.jsx("li", { children: /* @__PURE__ */ s.jsxs(
538
+ "button",
539
+ {
540
+ ref: a,
541
+ type: "button",
542
+ onClick: c,
543
+ className: l(
544
+ f({ disabled: !!u.disabled, active: p }),
545
+ "w-full text-left"
546
+ ),
547
+ ...u,
548
+ children: [
549
+ e,
550
+ /* @__PURE__ */ s.jsx(d, { as: "span", color: "inherit", fontSize: "sm", children: r })
551
+ ]
552
+ }
553
+ ) });
554
+ }
555
+ }
556
+ ), ua = n(
557
+ function({ children: a, label: e, ...r }, o) {
558
+ return /* @__PURE__ */ s.jsxs("li", { ref: o, className: "flex flex-col gap-2 mt-2", ...r, children: [
559
+ /* @__PURE__ */ s.jsx(
560
+ d,
561
+ {
562
+ as: "h2",
563
+ fontSize: "xs",
564
+ fontWeight: "semibold",
565
+ color: "gray",
566
+ className: "px-2",
567
+ children: e
568
+ }
569
+ ),
570
+ /* @__PURE__ */ s.jsx("ul", { className: "flex flex-col gap-1", children: a })
571
+ ] });
572
+ }
573
+ ), xa = n(
574
+ ({ children: t, ...a }, e) => /* @__PURE__ */ s.jsx(
575
+ "nav",
576
+ {
577
+ ref: e,
578
+ className: "w-56 bg-background border-r border-border flex flex-col my-2",
579
+ "aria-label": "Sidebar",
580
+ ...a,
581
+ children: /* @__PURE__ */ s.jsx("div", { className: "flex-1 overflow-y-auto scrollbar-thin scrollbar-thumb-border scrollbar-track-background", children: /* @__PURE__ */ s.jsx("ul", { className: "flex flex-col gap-1 mx-2", children: t }) })
582
+ }
583
+ )
584
+ ), Sa = Object.assign(xa, {
585
+ Item: da,
586
+ Group: ua
587
+ });
588
+ export {
589
+ ja as A,
590
+ ya as B,
591
+ Va as F,
592
+ wa as P,
593
+ Sa as S,
594
+ Na as T,
595
+ Ba as a,
596
+ Ta as b
597
+ };