@dimasbaguspm/versaur 0.0.26 → 0.0.27

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