@wow-two-beta/ui 0.0.12 → 0.0.14

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 (110) hide show
  1. package/dist/actions/index.d.ts +1 -0
  2. package/dist/actions/index.d.ts.map +1 -1
  3. package/dist/actions/index.js +2 -2
  4. package/dist/actions/toolbar/Toolbar.d.ts +23 -0
  5. package/dist/actions/toolbar/Toolbar.d.ts.map +1 -0
  6. package/dist/actions/toolbar/index.d.ts +2 -0
  7. package/dist/actions/toolbar/index.d.ts.map +1 -0
  8. package/dist/chunk-ASXB42MH.js +1670 -0
  9. package/dist/chunk-ASXB42MH.js.map +1 -0
  10. package/dist/{chunk-K6V4KLRO.js → chunk-BQTO7XY6.js} +1299 -478
  11. package/dist/chunk-BQTO7XY6.js.map +1 -0
  12. package/dist/{chunk-52DFDWY3.js → chunk-FS6DTWWH.js} +121 -146
  13. package/dist/chunk-FS6DTWWH.js.map +1 -0
  14. package/dist/{chunk-ZTHJ5OTI.js → chunk-UGHPZ3I7.js} +212 -6
  15. package/dist/chunk-UGHPZ3I7.js.map +1 -0
  16. package/dist/{chunk-D5CHR6RX.js → chunk-ULAOIBCP.js} +113 -5
  17. package/dist/chunk-ULAOIBCP.js.map +1 -0
  18. package/dist/{chunk-YANOG5YR.js → chunk-YMSAS7M7.js} +104 -55
  19. package/dist/chunk-YMSAS7M7.js.map +1 -0
  20. package/dist/display/accordion/Accordion.d.ts +41 -0
  21. package/dist/display/accordion/Accordion.d.ts.map +1 -0
  22. package/dist/display/accordion/index.d.ts +2 -0
  23. package/dist/display/accordion/index.d.ts.map +1 -0
  24. package/dist/display/collapsible/Collapsible.d.ts +26 -0
  25. package/dist/display/collapsible/Collapsible.d.ts.map +1 -0
  26. package/dist/display/collapsible/index.d.ts +2 -0
  27. package/dist/display/collapsible/index.d.ts.map +1 -0
  28. package/dist/display/dataTable/DataTable.d.ts +34 -0
  29. package/dist/display/dataTable/DataTable.d.ts.map +1 -0
  30. package/dist/display/dataTable/index.d.ts +2 -0
  31. package/dist/display/dataTable/index.d.ts.map +1 -0
  32. package/dist/display/index.d.ts +8 -0
  33. package/dist/display/index.d.ts.map +1 -1
  34. package/dist/display/index.js +2 -3
  35. package/dist/display/list/List.d.ts +23 -0
  36. package/dist/display/list/List.d.ts.map +1 -0
  37. package/dist/display/list/List.variants.d.ts +89 -0
  38. package/dist/display/list/List.variants.d.ts.map +1 -0
  39. package/dist/display/list/index.d.ts +2 -0
  40. package/dist/display/list/index.d.ts.map +1 -0
  41. package/dist/display/table/Table.d.ts +35 -0
  42. package/dist/display/table/Table.d.ts.map +1 -0
  43. package/dist/display/table/index.d.ts +2 -0
  44. package/dist/display/table/index.d.ts.map +1 -0
  45. package/dist/display/tabs/Tabs.d.ts +31 -0
  46. package/dist/display/tabs/Tabs.d.ts.map +1 -0
  47. package/dist/display/tabs/index.d.ts +2 -0
  48. package/dist/display/tabs/index.d.ts.map +1 -0
  49. package/dist/display/timeline/Timeline.d.ts +29 -0
  50. package/dist/display/timeline/Timeline.d.ts.map +1 -0
  51. package/dist/display/timeline/index.d.ts +2 -0
  52. package/dist/display/timeline/index.d.ts.map +1 -0
  53. package/dist/display/tree/Tree.d.ts +30 -0
  54. package/dist/display/tree/Tree.d.ts.map +1 -0
  55. package/dist/display/tree/index.d.ts +2 -0
  56. package/dist/display/tree/index.d.ts.map +1 -0
  57. package/dist/forms/MonthGrid.d.ts +29 -0
  58. package/dist/forms/MonthGrid.d.ts.map +1 -0
  59. package/dist/forms/calendar/Calendar.d.ts.map +1 -1
  60. package/dist/forms/datePicker/DatePicker.d.ts.map +1 -1
  61. package/dist/forms/dateRangePicker/DateRangePicker.d.ts.map +1 -1
  62. package/dist/forms/index.d.ts +8 -0
  63. package/dist/forms/index.d.ts.map +1 -1
  64. package/dist/forms/index.js +3 -3
  65. package/dist/forms/multiSelect/MultiSelect.d.ts +4 -5
  66. package/dist/forms/multiSelect/MultiSelect.d.ts.map +1 -1
  67. package/dist/forms/rangeCalendar/RangeCalendar.d.ts.map +1 -1
  68. package/dist/forms/select/Select.d.ts +5 -9
  69. package/dist/forms/select/Select.d.ts.map +1 -1
  70. package/dist/forms/stepper/Stepper.d.ts +32 -0
  71. package/dist/forms/stepper/Stepper.d.ts.map +1 -0
  72. package/dist/forms/stepper/index.d.ts +2 -0
  73. package/dist/forms/stepper/index.d.ts.map +1 -0
  74. package/dist/forms/timePicker/TimePicker.d.ts.map +1 -1
  75. package/dist/index.js +6 -7
  76. package/dist/nav/index.d.ts +1 -0
  77. package/dist/nav/index.d.ts.map +1 -1
  78. package/dist/nav/index.js +2 -3
  79. package/dist/nav/navigationMenu/NavigationMenu.d.ts +39 -0
  80. package/dist/nav/navigationMenu/NavigationMenu.d.ts.map +1 -0
  81. package/dist/nav/navigationMenu/index.d.ts +2 -0
  82. package/dist/nav/navigationMenu/index.d.ts.map +1 -0
  83. package/dist/overlays/OverlayChrome.d.ts +34 -0
  84. package/dist/overlays/OverlayChrome.d.ts.map +1 -0
  85. package/dist/overlays/dialog/Dialog.d.ts +7 -25
  86. package/dist/overlays/dialog/Dialog.d.ts.map +1 -1
  87. package/dist/overlays/dialog/index.d.ts +1 -1
  88. package/dist/overlays/dialog/index.d.ts.map +1 -1
  89. package/dist/overlays/drawer/Drawer.d.ts +7 -21
  90. package/dist/overlays/drawer/Drawer.d.ts.map +1 -1
  91. package/dist/overlays/drawer/index.d.ts +1 -1
  92. package/dist/overlays/drawer/index.d.ts.map +1 -1
  93. package/dist/overlays/index.js +2 -3
  94. package/dist/overlays/popover/Popover.d.ts +7 -0
  95. package/dist/overlays/popover/Popover.d.ts.map +1 -1
  96. package/dist/primitives/anchoredPositioner/AnchoredPositioner.d.ts +8 -0
  97. package/dist/primitives/anchoredPositioner/AnchoredPositioner.d.ts.map +1 -1
  98. package/dist/primitives/index.js +1 -2
  99. package/dist/primitives/rovingFocusGroup/RovingFocusGroup.d.ts +1 -1
  100. package/dist/primitives/rovingFocusGroup/RovingFocusGroup.d.ts.map +1 -1
  101. package/package.json +1 -1
  102. package/dist/chunk-33IOXQYO.js +0 -47
  103. package/dist/chunk-33IOXQYO.js.map +0 -1
  104. package/dist/chunk-52DFDWY3.js.map +0 -1
  105. package/dist/chunk-D5CHR6RX.js.map +0 -1
  106. package/dist/chunk-K6V4KLRO.js.map +0 -1
  107. package/dist/chunk-VTLWHUMD.js +0 -774
  108. package/dist/chunk-VTLWHUMD.js.map +0 -1
  109. package/dist/chunk-YANOG5YR.js.map +0 -1
  110. package/dist/chunk-ZTHJ5OTI.js.map +0 -1
@@ -1,774 +0,0 @@
1
- import { Portal, AnchoredPositioner } from './chunk-YANOG5YR.js';
2
- import { useClipboard } from './chunk-4P2TFUVW.js';
3
- import { tv } from './chunk-BMBIZLO4.js';
4
- import { Icon } from './chunk-TDX22OWF.js';
5
- import { composeRefs } from './chunk-DN7WBRIV.js';
6
- import { cn } from './chunk-KZ4VFY2T.js';
7
- import { forwardRef, useState, Children, isValidElement, Fragment as Fragment$1, useRef, cloneElement } from 'react';
8
- import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
9
- import { X, TrendingUp, TrendingDown, Check, Copy } from 'lucide-react';
10
-
11
- // src/display/heading/Heading.variants.ts
12
- var headingVariants = tv({
13
- base: "font-semibold tracking-tight text-foreground",
14
- variants: {
15
- size: {
16
- xs: "text-sm",
17
- sm: "text-base",
18
- md: "text-lg",
19
- lg: "text-xl",
20
- xl: "text-2xl",
21
- "2xl": "text-3xl",
22
- "3xl": "text-4xl",
23
- "4xl": "text-5xl"
24
- },
25
- weight: {
26
- normal: "font-normal",
27
- medium: "font-medium",
28
- semibold: "font-semibold",
29
- bold: "font-bold"
30
- },
31
- align: {
32
- left: "text-left",
33
- center: "text-center",
34
- right: "text-right"
35
- }
36
- },
37
- defaultVariants: {
38
- size: "lg",
39
- weight: "semibold"
40
- }
41
- });
42
- var Heading = forwardRef(
43
- ({ level = 2, className, size, weight, align, ...props }, ref) => {
44
- const Tag2 = `h${level}`;
45
- return /* @__PURE__ */ jsx(
46
- Tag2,
47
- {
48
- ref,
49
- className: cn(headingVariants({ size, weight, align }), className),
50
- ...props
51
- }
52
- );
53
- }
54
- );
55
- Heading.displayName = "Heading";
56
-
57
- // src/display/text/Text.variants.ts
58
- var textVariants = tv({
59
- base: "",
60
- variants: {
61
- size: {
62
- xs: "text-xs",
63
- sm: "text-sm",
64
- md: "text-base",
65
- lg: "text-lg",
66
- xl: "text-xl"
67
- },
68
- weight: {
69
- normal: "font-normal",
70
- medium: "font-medium",
71
- semibold: "font-semibold",
72
- bold: "font-bold"
73
- },
74
- color: {
75
- default: "text-foreground",
76
- muted: "text-muted-foreground",
77
- subtle: "text-subtle-foreground",
78
- brand: "text-primary",
79
- success: "text-success",
80
- warning: "text-warning",
81
- danger: "text-destructive"
82
- },
83
- align: {
84
- left: "text-left",
85
- center: "text-center",
86
- right: "text-right",
87
- justify: "text-justify"
88
- },
89
- truncate: {
90
- true: "truncate"
91
- }
92
- },
93
- defaultVariants: {
94
- size: "md",
95
- weight: "normal",
96
- color: "default"
97
- }
98
- });
99
- var Text = forwardRef(
100
- ({ as: Component = "p", className, size, weight, color, align, truncate, ...props }, ref) => /* @__PURE__ */ jsx(
101
- Component,
102
- {
103
- ref,
104
- className: cn(textVariants({ size, weight, color, align, truncate }), className),
105
- ...props
106
- }
107
- )
108
- );
109
- Text.displayName = "Text";
110
-
111
- // src/display/code/Code.variants.ts
112
- var codeVariants = tv({
113
- base: "font-mono text-sm",
114
- variants: {
115
- variant: {
116
- inline: "rounded-sm bg-muted px-1 py-0.5 text-foreground",
117
- block: "block w-full overflow-x-auto rounded-md bg-muted p-4 text-foreground"
118
- }
119
- },
120
- defaultVariants: {
121
- variant: "inline"
122
- }
123
- });
124
- var Code = forwardRef(
125
- ({ className, variant, ...props }, ref) => /* @__PURE__ */ jsx("code", { ref, className: cn(codeVariants({ variant }), className), ...props })
126
- );
127
- Code.displayName = "Code";
128
- var Kbd = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
129
- "kbd",
130
- {
131
- ref,
132
- className: cn(
133
- "inline-flex h-5 min-w-5 items-center justify-center rounded-sm border border-border",
134
- "bg-muted px-1.5 font-mono text-xs text-muted-foreground shadow-[inset_0_-1px_0_0_rgb(0_0_0/0.05)]",
135
- className
136
- ),
137
- ...props
138
- }
139
- ));
140
- Kbd.displayName = "Kbd";
141
- var Image = forwardRef(
142
- ({ fallback, onError, alt = "", className, ...props }, ref) => {
143
- const [errored, setErrored] = useState(false);
144
- if (errored && fallback !== void 0) return /* @__PURE__ */ jsx(Fragment, { children: fallback });
145
- return /* @__PURE__ */ jsx(
146
- "img",
147
- {
148
- ref,
149
- alt,
150
- className: cn("block max-w-full", className),
151
- onError: (e) => {
152
- setErrored(true);
153
- onError?.(e);
154
- },
155
- ...props
156
- }
157
- );
158
- }
159
- );
160
- Image.displayName = "Image";
161
-
162
- // src/display/avatar/Avatar.variants.ts
163
- var avatarVariants = tv({
164
- base: "inline-flex shrink-0 select-none items-center justify-center overflow-hidden rounded-full bg-muted text-muted-foreground font-medium",
165
- variants: {
166
- size: {
167
- xs: "h-6 w-6 text-xs",
168
- sm: "h-8 w-8 text-sm",
169
- md: "h-10 w-10 text-base",
170
- lg: "h-12 w-12 text-lg",
171
- xl: "h-16 w-16 text-xl",
172
- "2xl": "h-20 w-20 text-2xl"
173
- },
174
- shape: {
175
- circle: "rounded-full",
176
- square: "rounded-md"
177
- }
178
- },
179
- defaultVariants: {
180
- size: "md",
181
- shape: "circle"
182
- }
183
- });
184
- function getInitials(name) {
185
- const parts = name.trim().split(/\s+/);
186
- if (parts.length === 0) return "";
187
- const first = parts[0]?.[0] ?? "";
188
- const last = parts.length > 1 ? parts[parts.length - 1]?.[0] ?? "" : "";
189
- return (first + last).toUpperCase();
190
- }
191
- var Avatar = forwardRef(
192
- ({ src, name = "", fallback, alt, className, size, shape, ...props }, ref) => {
193
- const [errored, setErrored] = useState(false);
194
- const showImage = src && !errored;
195
- return /* @__PURE__ */ jsx(
196
- "span",
197
- {
198
- ref,
199
- className: cn(avatarVariants({ size, shape }), className),
200
- ...props,
201
- children: showImage ? /* @__PURE__ */ jsx(
202
- "img",
203
- {
204
- src,
205
- alt: alt ?? name,
206
- className: "h-full w-full object-cover",
207
- onError: () => setErrored(true)
208
- }
209
- ) : fallback ?? getInitials(name)
210
- }
211
- );
212
- }
213
- );
214
- Avatar.displayName = "Avatar";
215
-
216
- // src/display/badge/Badge.variants.ts
217
- var badgeVariants = tv({
218
- base: "inline-flex items-center rounded-full font-medium",
219
- variants: {
220
- variant: {
221
- neutral: "bg-muted text-foreground",
222
- brand: "bg-primary-soft text-primary-soft-foreground",
223
- success: "bg-success-soft text-success-soft-foreground",
224
- warning: "bg-warning-soft text-warning-soft-foreground",
225
- danger: "bg-destructive-soft text-destructive-soft-foreground",
226
- info: "bg-info-soft text-info-soft-foreground",
227
- outline: "border border-border text-foreground"
228
- },
229
- size: {
230
- sm: "h-5 px-2 text-xs",
231
- md: "h-6 px-2.5 text-xs",
232
- lg: "h-7 px-3 text-sm"
233
- }
234
- },
235
- defaultVariants: {
236
- variant: "neutral",
237
- size: "md"
238
- }
239
- });
240
- var Badge = forwardRef(
241
- ({ className, variant, size, ...props }, ref) => /* @__PURE__ */ jsx("span", { ref, className: cn(badgeVariants({ variant, size }), className), ...props })
242
- );
243
- Badge.displayName = "Badge";
244
-
245
- // src/display/tag/Tag.variants.ts
246
- var tagVariants = tv({
247
- base: "inline-flex items-center gap-1 rounded-md border border-border bg-card px-2 py-0.5 text-xs font-medium text-card-foreground",
248
- variants: {
249
- variant: {
250
- neutral: "",
251
- brand: "border-transparent bg-primary-soft text-primary-soft-foreground",
252
- success: "border-transparent bg-success-soft text-success-soft-foreground",
253
- warning: "border-transparent bg-warning-soft text-warning-soft-foreground",
254
- danger: "border-transparent bg-destructive-soft text-destructive-soft-foreground",
255
- info: "border-transparent bg-info-soft text-info-soft-foreground"
256
- }
257
- },
258
- defaultVariants: {
259
- variant: "neutral"
260
- }
261
- });
262
- var Tag = forwardRef(
263
- ({ children, onClose, closeLabel = "Remove", variant, className, ...props }, ref) => /* @__PURE__ */ jsxs("span", { ref, className: cn(tagVariants({ variant }), className), ...props, children: [
264
- children,
265
- onClose && /* @__PURE__ */ jsx(
266
- "button",
267
- {
268
- type: "button",
269
- "aria-label": closeLabel,
270
- onClick: onClose,
271
- className: "-mr-1 inline-flex h-4 w-4 items-center justify-center rounded-sm text-muted-foreground hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
272
- children: /* @__PURE__ */ jsx(Icon, { icon: X, size: 12 })
273
- }
274
- )
275
- ] })
276
- );
277
- Tag.displayName = "Tag";
278
- var Separator = forwardRef(
279
- ({ orientation = "horizontal", decorative = true, className, ...props }, ref) => /* @__PURE__ */ jsx(
280
- "div",
281
- {
282
- ref,
283
- role: decorative ? "none" : "separator",
284
- "aria-orientation": decorative ? void 0 : orientation,
285
- className: cn(
286
- "bg-border",
287
- orientation === "horizontal" ? "h-px w-full" : "w-px self-stretch",
288
- className
289
- ),
290
- ...props
291
- }
292
- )
293
- );
294
- Separator.displayName = "Separator";
295
- var Mark = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
296
- "mark",
297
- {
298
- ref,
299
- className: cn("rounded-sm bg-warning-soft px-0.5 text-warning-soft-foreground", className),
300
- ...props
301
- }
302
- ));
303
- Mark.displayName = "Mark";
304
- var Quote = forwardRef(
305
- ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
306
- "blockquote",
307
- {
308
- ref,
309
- className: cn(
310
- "border-l-4 border-border pl-4 italic text-muted-foreground",
311
- className
312
- ),
313
- ...props
314
- }
315
- )
316
- );
317
- Quote.displayName = "Quote";
318
- var PADDING = {
319
- none: "",
320
- sm: "p-3",
321
- md: "p-4",
322
- lg: "p-6"
323
- };
324
- var CardRoot = forwardRef(
325
- ({ className, padding = "none", ...props }, ref) => /* @__PURE__ */ jsx(
326
- "div",
327
- {
328
- ref,
329
- className: cn(
330
- "rounded-lg border border-border bg-card text-card-foreground shadow-xs",
331
- PADDING[padding],
332
- className
333
- ),
334
- ...props
335
- }
336
- )
337
- );
338
- CardRoot.displayName = "Card";
339
- var CardHeader = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("flex flex-col gap-1 p-4 pb-2", className), ...props }));
340
- CardHeader.displayName = "Card.Header";
341
- var CardTitle = forwardRef(
342
- ({ className, ...props }, ref) => /* @__PURE__ */ jsx("h3", { ref, className: cn("text-lg font-semibold tracking-tight", className), ...props })
343
- );
344
- CardTitle.displayName = "Card.Title";
345
- var CardDescription = forwardRef(
346
- ({ className, ...props }, ref) => /* @__PURE__ */ jsx("p", { ref, className: cn("text-sm text-muted-foreground", className), ...props })
347
- );
348
- CardDescription.displayName = "Card.Description";
349
- var CardBody = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("p-4 pt-2", className), ...props }));
350
- CardBody.displayName = "Card.Body";
351
- var CardFooter = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("flex items-center gap-2 border-t border-border p-4", className), ...props }));
352
- CardFooter.displayName = "Card.Footer";
353
- var Card = Object.assign(CardRoot, {
354
- Header: CardHeader,
355
- Title: CardTitle,
356
- Description: CardDescription,
357
- Body: CardBody,
358
- Footer: CardFooter
359
- });
360
- var AvatarGroup = forwardRef(
361
- ({ max, size = "md", overlap = "-ml-2", className, children, ...props }, ref) => {
362
- const all = Children.toArray(children).filter(isValidElement);
363
- const visible = max ? all.slice(0, max) : all;
364
- const overflow = max ? Math.max(0, all.length - max) : 0;
365
- return /* @__PURE__ */ jsxs(
366
- "div",
367
- {
368
- ref,
369
- className: cn("inline-flex items-center", className),
370
- ...props,
371
- children: [
372
- visible.map((child, i) => /* @__PURE__ */ jsx(
373
- "div",
374
- {
375
- className: cn("ring-2 ring-background rounded-full", i > 0 && overlap),
376
- children: /* @__PURE__ */ jsx(Avatar, { ...child.props, size })
377
- },
378
- i
379
- )),
380
- overflow > 0 && /* @__PURE__ */ jsx(
381
- Avatar,
382
- {
383
- size,
384
- name: `+${overflow}`,
385
- className: cn(overlap, "ring-2 ring-background")
386
- }
387
- )
388
- ]
389
- }
390
- );
391
- }
392
- );
393
- AvatarGroup.displayName = "AvatarGroup";
394
- function Tooltip({
395
- content,
396
- children,
397
- placement = "top",
398
- openDelay = 700,
399
- closeDelay = 0,
400
- open: controlledOpen,
401
- disabled
402
- }) {
403
- const [uncontrolledOpen, setUncontrolledOpen] = useState(false);
404
- const open = controlledOpen ?? uncontrolledOpen;
405
- const [anchor, setAnchor] = useState(null);
406
- const openTimer = useRef(null);
407
- const closeTimer = useRef(null);
408
- const clear = () => {
409
- if (openTimer.current) clearTimeout(openTimer.current);
410
- if (closeTimer.current) clearTimeout(closeTimer.current);
411
- openTimer.current = null;
412
- closeTimer.current = null;
413
- };
414
- const show = () => {
415
- clear();
416
- openTimer.current = setTimeout(() => setUncontrolledOpen(true), openDelay);
417
- };
418
- const hide = () => {
419
- clear();
420
- closeTimer.current = setTimeout(() => setUncontrolledOpen(false), closeDelay);
421
- };
422
- if (!isValidElement(children)) return children;
423
- const trigger = children;
424
- const cloned = cloneElement(trigger, {
425
- ref: composeRefs(setAnchor, trigger.ref),
426
- onPointerEnter: (e) => {
427
- trigger.props.onPointerEnter?.(e);
428
- show();
429
- },
430
- onPointerLeave: (e) => {
431
- trigger.props.onPointerLeave?.(e);
432
- hide();
433
- },
434
- onFocus: (e) => {
435
- trigger.props.onFocus?.(e);
436
- show();
437
- },
438
- onBlur: (e) => {
439
- trigger.props.onBlur?.(e);
440
- hide();
441
- }
442
- });
443
- return /* @__PURE__ */ jsxs(Fragment, { children: [
444
- cloned,
445
- !disabled && open && content && /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(AnchoredPositioner, { anchor, placement, offset: 6, children: /* @__PURE__ */ jsx(
446
- "div",
447
- {
448
- role: "tooltip",
449
- className: cn(
450
- "z-tooltip rounded-md bg-inverse px-2.5 py-1.5 text-xs text-inverse-foreground shadow-md",
451
- "animate-in fade-in-0 zoom-in-95"
452
- ),
453
- children: content
454
- }
455
- ) }) })
456
- ] });
457
- }
458
- var SIZE = {
459
- sm: { wrap: "gap-2 py-6", iconBox: "h-10 w-10" },
460
- md: { wrap: "gap-3 py-10", iconBox: "h-14 w-14" },
461
- lg: { wrap: "gap-4 py-16", iconBox: "h-20 w-20" }
462
- };
463
- var EmptyState = forwardRef(
464
- ({ icon, title, description, actions, size = "md", className, ...props }, ref) => {
465
- const sz = SIZE[size];
466
- return /* @__PURE__ */ jsxs(
467
- "div",
468
- {
469
- ref,
470
- className: cn("flex flex-col items-center text-center", sz.wrap, className),
471
- ...props,
472
- children: [
473
- icon && /* @__PURE__ */ jsx(
474
- "div",
475
- {
476
- className: cn(
477
- "flex items-center justify-center rounded-full bg-muted text-muted-foreground",
478
- sz.iconBox
479
- ),
480
- children: icon
481
- }
482
- ),
483
- /* @__PURE__ */ jsx(Heading, { level: 3, size: size === "sm" ? "md" : size === "lg" ? "xl" : "lg", children: title }),
484
- description && /* @__PURE__ */ jsx(Text, { color: "muted", size: size === "lg" ? "md" : "sm", children: description }),
485
- actions && /* @__PURE__ */ jsx("div", { className: "mt-2 flex items-center gap-2", children: actions })
486
- ]
487
- }
488
- );
489
- }
490
- );
491
- EmptyState.displayName = "EmptyState";
492
- var VALUE_SIZE = {
493
- sm: "2xl",
494
- md: "3xl",
495
- lg: "4xl"
496
- };
497
- var Stat = forwardRef(
498
- ({ label, value, trend, helper, size = "md", className, ...props }, ref) => {
499
- const trendUp = trend ? trend.value >= 0 : false;
500
- return /* @__PURE__ */ jsxs("div", { ref, className: cn("flex flex-col gap-1", className), ...props, children: [
501
- /* @__PURE__ */ jsx(Text, { size: "sm", color: "muted", children: label }),
502
- /* @__PURE__ */ jsx(Heading, { level: 3, size: VALUE_SIZE[size], weight: "bold", children: value }),
503
- (trend || helper) && /* @__PURE__ */ jsxs("div", { className: "mt-1 flex items-center gap-2", children: [
504
- trend && /* @__PURE__ */ jsxs(
505
- "span",
506
- {
507
- className: cn(
508
- "inline-flex items-center gap-0.5 text-xs font-medium",
509
- trendUp ? "text-success" : "text-destructive"
510
- ),
511
- children: [
512
- /* @__PURE__ */ jsx(Icon, { icon: trendUp ? TrendingUp : TrendingDown, size: 12 }),
513
- trend.value > 0 ? "+" : "",
514
- trend.value,
515
- "%",
516
- trend.label && /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground", children: [
517
- " ",
518
- trend.label
519
- ] })
520
- ]
521
- }
522
- ),
523
- helper && !trend && /* @__PURE__ */ jsx(Text, { size: "xs", color: "muted", children: helper })
524
- ] })
525
- ] });
526
- }
527
- );
528
- Stat.displayName = "Stat";
529
- var Snippet = forwardRef(
530
- ({ text, variant = "inline", className, ...props }, ref) => {
531
- const { copied, copy } = useClipboard();
532
- return /* @__PURE__ */ jsxs(
533
- "div",
534
- {
535
- ref,
536
- className: cn(
537
- "group relative inline-flex w-full items-start",
538
- variant === "inline" ? "gap-2" : "flex-col gap-0",
539
- className
540
- ),
541
- ...props,
542
- children: [
543
- /* @__PURE__ */ jsx(Code, { variant, className: "flex-1 pr-10", children: text }),
544
- /* @__PURE__ */ jsx(
545
- "button",
546
- {
547
- type: "button",
548
- "aria-label": copied ? "Copied" : "Copy",
549
- onClick: () => void copy(text),
550
- className: cn(
551
- "absolute right-2 grid h-7 w-7 place-items-center rounded text-muted-foreground transition-colors hover:bg-background hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
552
- variant === "inline" ? "top-1/2 -translate-y-1/2" : "top-2"
553
- ),
554
- children: /* @__PURE__ */ jsx(Icon, { icon: copied ? Check : Copy, size: 14 })
555
- }
556
- )
557
- ]
558
- }
559
- );
560
- }
561
- );
562
- Snippet.displayName = "Snippet";
563
- var TONE = {
564
- destructive: "bg-destructive",
565
- success: "bg-success",
566
- warning: "bg-warning",
567
- info: "bg-info",
568
- primary: "bg-primary",
569
- neutral: "bg-muted-foreground"
570
- };
571
- var SIZE2 = {
572
- xs: "h-1.5 w-1.5",
573
- sm: "h-2 w-2",
574
- md: "h-2.5 w-2.5"
575
- };
576
- var POS = {
577
- "top-right": "absolute -top-0.5 -right-0.5",
578
- "top-left": "absolute -top-0.5 -left-0.5",
579
- "bottom-right": "absolute -bottom-0.5 -right-0.5",
580
- "bottom-left": "absolute -bottom-0.5 -left-0.5"
581
- };
582
- var NotificationDot = forwardRef(
583
- ({ tone = "destructive", size = "sm", pulse, position, className, ...props }, ref) => /* @__PURE__ */ jsx(
584
- "span",
585
- {
586
- ref,
587
- "aria-hidden": "true",
588
- className: cn(
589
- "inline-flex rounded-full ring-2 ring-background",
590
- TONE[tone],
591
- SIZE2[size],
592
- position && POS[position],
593
- pulse && 'after:absolute after:inset-0 after:animate-ping after:rounded-full after:opacity-75 after:content-[""] ' + TONE[tone],
594
- className
595
- ),
596
- ...props
597
- }
598
- )
599
- );
600
- NotificationDot.displayName = "NotificationDot";
601
- var CountBadge = forwardRef(
602
- ({ value, max = 99, hideZero = true, variant = "danger", className, ...props }, ref) => {
603
- if (value === 0 && hideZero) return null;
604
- const display = value > max ? `${max}+` : `${value}`;
605
- return /* @__PURE__ */ jsx(
606
- Badge,
607
- {
608
- ref,
609
- variant,
610
- size: "sm",
611
- className: cn("min-w-5 justify-center px-1.5", className),
612
- ...props,
613
- children: display
614
- }
615
- );
616
- }
617
- );
618
- CountBadge.displayName = "CountBadge";
619
- var TONE2 = {
620
- success: "bg-success",
621
- warning: "bg-warning",
622
- destructive: "bg-destructive",
623
- info: "bg-info",
624
- neutral: "bg-muted-foreground"
625
- };
626
- var Status = forwardRef(
627
- ({ tone = "success", pulse, className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
628
- "span",
629
- {
630
- ref,
631
- className: cn("inline-flex items-center gap-2 text-sm text-foreground", className),
632
- ...props,
633
- children: [
634
- /* @__PURE__ */ jsxs("span", { className: "relative inline-flex", children: [
635
- /* @__PURE__ */ jsx("span", { className: cn("inline-block h-2 w-2 rounded-full", TONE2[tone]) }),
636
- pulse && /* @__PURE__ */ jsx(
637
- "span",
638
- {
639
- className: cn(
640
- "absolute inset-0 inline-block rounded-full opacity-75 animate-ping",
641
- TONE2[tone]
642
- )
643
- }
644
- )
645
- ] }),
646
- children
647
- ]
648
- }
649
- )
650
- );
651
- Status.displayName = "Status";
652
- var KeyboardShortcut = forwardRef(
653
- ({ keys, separator = "+", className, ...props }, ref) => /* @__PURE__ */ jsx(
654
- "span",
655
- {
656
- ref,
657
- className: cn("inline-flex items-center gap-1 text-muted-foreground", className),
658
- ...props,
659
- children: keys.map((key, i) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
660
- i > 0 && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: separator }),
661
- /* @__PURE__ */ jsx(Kbd, { children: key })
662
- ] }, i))
663
- }
664
- )
665
- );
666
- KeyboardShortcut.displayName = "KeyboardShortcut";
667
- var ROW_GAP = {
668
- sm: "gap-y-1",
669
- md: "gap-y-2",
670
- lg: "gap-y-3"
671
- };
672
- var DescriptionList = forwardRef(
673
- ({ items, layout = "inline", density = "md", className, ...props }, ref) => /* @__PURE__ */ jsx(
674
- "dl",
675
- {
676
- ref,
677
- className: cn(
678
- "text-sm",
679
- layout === "inline" ? "grid grid-cols-[max-content_1fr] gap-x-4" : "flex flex-col gap-1",
680
- ROW_GAP[density],
681
- className
682
- ),
683
- ...props,
684
- children: items.map((item, i) => /* @__PURE__ */ jsxs("div", { className: cn("contents", layout === "stacked" && "flex flex-col gap-0.5"), children: [
685
- /* @__PURE__ */ jsx("dt", { className: "text-muted-foreground", children: item.label }),
686
- /* @__PURE__ */ jsx("dd", { className: "text-foreground", children: item.value })
687
- ] }, i))
688
- }
689
- )
690
- );
691
- DescriptionList.displayName = "DescriptionList";
692
- var InfoRow = forwardRef(
693
- ({ label, value, icon, layout = "inline", className, ...props }, ref) => /* @__PURE__ */ jsxs(
694
- "div",
695
- {
696
- ref,
697
- className: cn(
698
- "flex text-sm",
699
- layout === "inline" ? "items-center justify-between gap-3" : "flex-col gap-0.5",
700
- className
701
- ),
702
- ...props,
703
- children: [
704
- /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1.5 text-muted-foreground", children: [
705
- icon,
706
- label
707
- ] }),
708
- /* @__PURE__ */ jsx("span", { className: "text-foreground", children: value })
709
- ]
710
- }
711
- )
712
- );
713
- InfoRow.displayName = "InfoRow";
714
- var POS2 = {
715
- "top-right": "top-0 right-0 -translate-y-1/2 translate-x-1/2",
716
- "top-left": "top-0 left-0 -translate-y-1/2 -translate-x-1/2",
717
- "bottom-right": "bottom-0 right-0 translate-y-1/2 translate-x-1/2",
718
- "bottom-left": "bottom-0 left-0 translate-y-1/2 -translate-x-1/2"
719
- };
720
- var BadgeOverlay = forwardRef(
721
- ({ children, badge, position = "top-right", hidden, className, ...props }, ref) => /* @__PURE__ */ jsxs("div", { ref, className: cn("relative inline-flex", className), ...props, children: [
722
- children,
723
- !hidden && /* @__PURE__ */ jsx("span", { className: cn("absolute z-10", POS2[position]), children: badge })
724
- ] })
725
- );
726
- BadgeOverlay.displayName = "BadgeOverlay";
727
- var SectionHeader = forwardRef(
728
- ({ title, description, actions, level = 2, size = "lg", bordered = true, className, ...props }, ref) => /* @__PURE__ */ jsxs(
729
- "header",
730
- {
731
- ref,
732
- className: cn(
733
- "flex items-start justify-between gap-4 pb-3",
734
- bordered && "border-b border-border",
735
- className
736
- ),
737
- ...props,
738
- children: [
739
- /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-1", children: [
740
- /* @__PURE__ */ jsx(Heading, { level, size, children: title }),
741
- description && /* @__PURE__ */ jsx(Text, { size: "sm", color: "muted", children: description })
742
- ] }),
743
- actions && /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center gap-2", children: actions })
744
- ]
745
- }
746
- )
747
- );
748
- SectionHeader.displayName = "SectionHeader";
749
- function escape(re) {
750
- return re.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
751
- }
752
- var Highlight = forwardRef(
753
- ({ children, query, wholeWord, className, ...props }, ref) => {
754
- const queries = (Array.isArray(query) ? query : [query]).filter(Boolean);
755
- if (queries.length === 0) return /* @__PURE__ */ jsx("span", { ref, className: cn(className), ...props, children });
756
- const pattern = queries.map(escape).join("|");
757
- const regex = new RegExp(wholeWord ? `\\b(${pattern})\\b` : `(${pattern})`, "gi");
758
- const parts = children.split(regex);
759
- const nodes = [];
760
- parts.forEach((part, i) => {
761
- if (queries.some((q) => part.toLowerCase() === q.toLowerCase())) {
762
- nodes.push(/* @__PURE__ */ jsx(Mark, { children: part }, i));
763
- } else if (part) {
764
- nodes.push(/* @__PURE__ */ jsx(Fragment$1, { children: part }, i));
765
- }
766
- });
767
- return /* @__PURE__ */ jsx("span", { ref, className: cn(className), ...props, children: nodes });
768
- }
769
- );
770
- Highlight.displayName = "Highlight";
771
-
772
- export { Avatar, AvatarGroup, Badge, BadgeOverlay, Card, Code, CountBadge, DescriptionList, EmptyState, Heading, Highlight, Image, InfoRow, Kbd, KeyboardShortcut, Mark, NotificationDot, Quote, SectionHeader, Separator, Snippet, Stat, Status, Tag, Text, Tooltip, avatarVariants, badgeVariants, codeVariants, headingVariants, tagVariants, textVariants };
773
- //# sourceMappingURL=chunk-VTLWHUMD.js.map
774
- //# sourceMappingURL=chunk-VTLWHUMD.js.map