@nexub/react 1.0.0 → 1.2.0

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 (199) hide show
  1. package/dist/chunk-24CZFBTG.js +83 -0
  2. package/dist/chunk-2RLSIOGB.js +173 -0
  3. package/dist/chunk-2VDP2ML4.js +105 -0
  4. package/dist/chunk-3CSKW56L.js +44 -0
  5. package/dist/chunk-3U54QLYB.js +87 -0
  6. package/dist/chunk-46CFSBEO.js +48 -0
  7. package/dist/chunk-4NGB7XIM.js +88 -0
  8. package/dist/chunk-4OCXGNP3.js +85 -0
  9. package/dist/chunk-52KTX5A7.js +119 -0
  10. package/dist/chunk-6AZP6VBM.js +62 -0
  11. package/dist/chunk-6Y734SXN.js +51 -0
  12. package/dist/chunk-7B4FS7VQ.js +150 -0
  13. package/dist/chunk-7W2YDJ5W.js +128 -0
  14. package/dist/chunk-A7L75YXY.js +61 -0
  15. package/dist/chunk-ADO2DB6Q.js +1 -0
  16. package/dist/chunk-AT6RPKU3.js +12 -0
  17. package/dist/chunk-BBVOB4EC.js +36 -0
  18. package/dist/chunk-BGY23Y5O.js +104 -0
  19. package/dist/chunk-BJKW3G2L.js +99 -0
  20. package/dist/chunk-BMVAZIAJ.js +187 -0
  21. package/dist/chunk-BTZW34TX.js +76 -0
  22. package/dist/chunk-BUBYXAJK.js +20 -0
  23. package/dist/chunk-BV3U3ATL.js +1 -0
  24. package/dist/chunk-BYCTJHXY.js +75 -0
  25. package/dist/chunk-BYF223HT.js +92 -0
  26. package/dist/chunk-CPV367VS.js +106 -0
  27. package/dist/chunk-CVBAWKNG.js +124 -0
  28. package/dist/chunk-CZUNTABW.js +25 -0
  29. package/dist/chunk-DAXDAFNG.js +92 -0
  30. package/dist/chunk-DD6XCW6R.js +53 -0
  31. package/dist/chunk-DEH2Z27F.js +50 -0
  32. package/dist/chunk-DGJE5MX5.js +102 -0
  33. package/dist/chunk-DOHXBNOP.js +119 -0
  34. package/dist/chunk-DR2Y3PIT.js +91 -0
  35. package/dist/chunk-ELC2NBGH.js +89 -0
  36. package/dist/chunk-EV43I5J6.js +1 -0
  37. package/dist/chunk-EVCTOIRS.js +66 -0
  38. package/dist/chunk-FS4XKWFA.js +308 -0
  39. package/dist/chunk-FUJOSPNQ.js +38 -0
  40. package/dist/chunk-GTQIA62H.js +60 -0
  41. package/dist/chunk-H4MXRAXP.js +37 -0
  42. package/dist/chunk-HW3I7I3R.js +29 -0
  43. package/dist/chunk-HY3JWSG4.js +1 -0
  44. package/dist/chunk-I5Z3A7N3.js +40 -0
  45. package/dist/chunk-IBCYG6HR.js +55 -0
  46. package/dist/chunk-IHW2L532.js +175 -0
  47. package/dist/chunk-IU76LV3W.js +101 -0
  48. package/dist/chunk-IZ6ZPEZ2.js +1 -0
  49. package/dist/chunk-JCUVWDUC.js +57 -0
  50. package/dist/chunk-JKTZMWWC.js +63 -0
  51. package/dist/chunk-JQDLCN5D.js +66 -0
  52. package/dist/chunk-K7CUCLLI.js +43 -0
  53. package/dist/chunk-KBB7M6WO.js +65 -0
  54. package/dist/chunk-KLTQJZOX.js +1 -0
  55. package/dist/chunk-KWWV3CM3.js +62 -0
  56. package/dist/chunk-KZW37FQZ.js +40 -0
  57. package/dist/chunk-LAWZQ6R6.js +76 -0
  58. package/dist/chunk-LOP63AVE.js +49 -0
  59. package/dist/chunk-MY6XUJ5P.js +216 -0
  60. package/dist/chunk-N2GIMMTF.js +98 -0
  61. package/dist/chunk-NAIZ7R2L.js +59 -0
  62. package/dist/chunk-NHUQLIHL.js +9 -0
  63. package/dist/chunk-NZ7UK3G6.js +1 -0
  64. package/dist/chunk-OUBBOOZE.js +34 -0
  65. package/dist/chunk-OZPPL76D.js +82 -0
  66. package/dist/chunk-P6BZNFVU.js +38 -0
  67. package/dist/chunk-PANDAMD2.js +54 -0
  68. package/dist/chunk-PBLEGOLM.js +71 -0
  69. package/dist/chunk-PER3O4FD.js +33 -0
  70. package/dist/chunk-PICMOOAZ.js +1 -0
  71. package/dist/chunk-POBSY7EZ.js +155 -0
  72. package/dist/chunk-POFKKYHY.js +37 -0
  73. package/dist/chunk-QF7GUDOE.js +67 -0
  74. package/dist/chunk-QHJ43Q2T.js +70 -0
  75. package/dist/chunk-QRZV2FLW.js +106 -0
  76. package/dist/chunk-QURKXXNS.js +46 -0
  77. package/dist/chunk-RIDDJUPA.js +122 -0
  78. package/dist/chunk-ROZVVWPV.js +8 -0
  79. package/dist/chunk-SZKUSLHI.js +176 -0
  80. package/dist/chunk-T4IVMVMQ.js +32 -0
  81. package/dist/chunk-TCTFQYLH.js +115 -0
  82. package/dist/chunk-U3AEA4BZ.js +56 -0
  83. package/dist/chunk-U3EGB3JL.js +43 -0
  84. package/dist/chunk-UALYS4XI.js +67 -0
  85. package/dist/chunk-UTBUIBEP.js +153 -0
  86. package/dist/chunk-UWWL5FPC.js +80 -0
  87. package/dist/chunk-V3FZHIEB.js +52 -0
  88. package/dist/chunk-VPZCQFVY.js +33 -0
  89. package/dist/chunk-VT7RKY46.js +49 -0
  90. package/dist/chunk-W4IEXUD4.js +127 -0
  91. package/dist/chunk-WCJNZ5ME.js +1593 -0
  92. package/dist/chunk-WPPNDU2E.js +36 -0
  93. package/dist/chunk-XNDCVVNE.js +45 -0
  94. package/dist/chunk-Y45JAJKW.js +44 -0
  95. package/dist/chunk-YAGVMERC.js +81 -0
  96. package/dist/chunk-YGOR3KT7.js +46 -0
  97. package/dist/chunk-YJD66LTV.js +54 -0
  98. package/dist/chunk-YJU4ZRQZ.js +1 -0
  99. package/dist/chunk-YUFCNHZF.js +27 -0
  100. package/dist/chunk-YUNWZAAD.js +57 -0
  101. package/dist/chunk-ZFVBFCYV.js +84 -0
  102. package/dist/chunk-ZLSUVZM2.js +145 -0
  103. package/dist/chunk-ZXLACKEB.js +8 -0
  104. package/dist/components/Accordion/index.js +8 -0
  105. package/dist/components/Alert/index.js +10 -0
  106. package/dist/components/AlertDialog/index.js +8 -0
  107. package/dist/components/AppShell/index.js +8 -0
  108. package/dist/components/AspectRatio/index.js +8 -0
  109. package/dist/components/Autocomplete/index.js +9 -0
  110. package/dist/components/Avatar/index.js +11 -0
  111. package/dist/components/AvatarGroup/index.js +11 -0
  112. package/dist/components/Badge/index.js +10 -0
  113. package/dist/components/Banner/index.js +10 -0
  114. package/dist/components/Box/index.js +8 -0
  115. package/dist/components/Breadcrumb/index.js +8 -0
  116. package/dist/components/Button/index.js +10 -0
  117. package/dist/components/ButtonGroup/index.js +8 -0
  118. package/dist/components/Callout/index.js +10 -0
  119. package/dist/components/Card/index.js +11 -0
  120. package/dist/components/CheckList/index.js +10 -0
  121. package/dist/components/Checkbox/index.js +8 -0
  122. package/dist/components/Chip/index.js +10 -0
  123. package/dist/components/Code/index.js +8 -0
  124. package/dist/components/Collapsible/index.js +8 -0
  125. package/dist/components/Combobox/index.js +9 -0
  126. package/dist/components/CommandPalette/index.js +8 -0
  127. package/dist/components/Container/index.js +10 -0
  128. package/dist/components/ContextMenu/index.js +8 -0
  129. package/dist/components/CountryBadge/index.js +9 -0
  130. package/dist/components/DataTable/index.js +8 -0
  131. package/dist/components/DatePicker/index.js +8 -0
  132. package/dist/components/DateRangePicker/index.js +8 -0
  133. package/dist/components/Dialog/index.js +9 -0
  134. package/dist/components/Drawer/index.js +11 -0
  135. package/dist/components/DropdownMenu/index.js +8 -0
  136. package/dist/components/EmptyState/index.js +8 -0
  137. package/dist/components/ErrorState/index.js +8 -0
  138. package/dist/components/EyebrowChip/index.js +8 -0
  139. package/dist/components/FileUpload/index.js +8 -0
  140. package/dist/components/FilterChip/index.js +8 -0
  141. package/dist/components/Flag/index.js +9 -0
  142. package/dist/components/Flex/index.js +8 -0
  143. package/dist/components/FormError/index.js +9 -0
  144. package/dist/components/FormField/index.js +11 -0
  145. package/dist/components/GradientDivider/index.js +8 -0
  146. package/dist/components/Grid/index.js +8 -0
  147. package/dist/components/Heading/index.js +10 -0
  148. package/dist/components/HelperText/index.js +9 -0
  149. package/dist/components/HoverCard/index.js +8 -0
  150. package/dist/components/IconButton/index.js +10 -0
  151. package/dist/components/Input/index.js +15 -0
  152. package/dist/components/Kbd/index.js +9 -0
  153. package/dist/components/KeyboardShortcut/index.js +9 -0
  154. package/dist/components/Label/index.js +11 -0
  155. package/dist/components/Link/index.js +10 -0
  156. package/dist/components/Logo/index.js +10 -0
  157. package/dist/components/Menubar/index.js +8 -0
  158. package/dist/components/Motion/index.js +13 -0
  159. package/dist/components/NavigationMenu/index.js +8 -0
  160. package/dist/components/NumberInput/index.js +9 -0
  161. package/dist/components/PageHeader/index.js +8 -0
  162. package/dist/components/Pagination/index.js +8 -0
  163. package/dist/components/PasswordInput/index.js +9 -0
  164. package/dist/components/Popover/index.js +9 -0
  165. package/dist/components/Progress/index.js +12 -0
  166. package/dist/components/RadioGroup/index.js +8 -0
  167. package/dist/components/Rating/index.js +11 -0
  168. package/dist/components/ScrollArea/index.js +8 -0
  169. package/dist/components/SearchInput/index.js +9 -0
  170. package/dist/components/Section/index.js +10 -0
  171. package/dist/components/SegmentedControl/index.js +8 -0
  172. package/dist/components/Select/index.js +8 -0
  173. package/dist/components/Separator/index.js +10 -0
  174. package/dist/components/Sidebar/index.js +8 -0
  175. package/dist/components/Skeleton/index.js +10 -0
  176. package/dist/components/Slider/index.js +8 -0
  177. package/dist/components/Spinner/index.js +10 -0
  178. package/dist/components/Stack/index.js +8 -0
  179. package/dist/components/StatusPill/index.js +10 -0
  180. package/dist/components/Switch/index.js +8 -0
  181. package/dist/components/Table/index.js +8 -0
  182. package/dist/components/Tabs/index.js +8 -0
  183. package/dist/components/Tag/index.js +10 -0
  184. package/dist/components/Text/index.js +10 -0
  185. package/dist/components/TextGradient/index.js +8 -0
  186. package/dist/components/Textarea/index.js +10 -0
  187. package/dist/components/ThemeProvider/index.js +10 -0
  188. package/dist/components/Toast/index.js +14 -0
  189. package/dist/components/Toggle/index.js +11 -0
  190. package/dist/components/ToggleGroup/index.js +9 -0
  191. package/dist/components/Toolbar/index.js +8 -0
  192. package/dist/components/Tooltip/index.js +16 -0
  193. package/dist/components/TopNav/index.js +9 -0
  194. package/dist/components/VisuallyHidden/index.js +7 -0
  195. package/dist/index.d.ts +36 -14
  196. package/dist/index.js +479 -5896
  197. package/package.json +13 -13
  198. package/dist/index.cjs +0 -6112
  199. package/dist/index.d.cts +0 -1245
@@ -0,0 +1,119 @@
1
+ 'use client';
2
+ import {
3
+ cn
4
+ } from "./chunk-AT6RPKU3.js";
5
+
6
+ // src/components/DatePicker/DatePicker.tsx
7
+ import * as React from "react";
8
+ import * as RadixPopover from "@radix-ui/react-popover";
9
+ import { DayPicker } from "react-day-picker";
10
+ import { format } from "date-fns";
11
+ import { CalendarDays, ChevronLeft, ChevronRight } from "@nexub/icons";
12
+ import { jsx, jsxs } from "react/jsx-runtime";
13
+ var calendarClassNames = {
14
+ months: "flex flex-col sm:flex-row gap-4",
15
+ month: "flex flex-col gap-4",
16
+ month_caption: "flex justify-center pt-1 relative items-center",
17
+ caption_label: "text-sm font-medium",
18
+ nav: "flex items-center gap-1",
19
+ button_previous: "absolute left-1 inline-flex h-7 w-7 items-center justify-center rounded-md border border-[var(--color-border-default)] hover:bg-[var(--color-bg-subtle)] disabled:pointer-events-none disabled:opacity-50",
20
+ button_next: "absolute right-1 inline-flex h-7 w-7 items-center justify-center rounded-md border border-[var(--color-border-default)] hover:bg-[var(--color-bg-subtle)] disabled:pointer-events-none disabled:opacity-50",
21
+ month_grid: "w-full border-collapse",
22
+ weekdays: "flex",
23
+ weekday: "text-[var(--color-text-muted)] rounded-md w-8 font-normal text-[0.8rem] flex-1 text-center",
24
+ week: "flex w-full mt-2",
25
+ day: cn(
26
+ "relative p-0 text-center text-sm flex-1",
27
+ "[&:has([aria-selected].day-range-end)]:rounded-r-md",
28
+ "[&:has([aria-selected].day-outside)]:bg-[var(--color-bg-subtle)]/50",
29
+ "[&:has([aria-selected])]:bg-[var(--color-bg-subtle)]",
30
+ "first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md",
31
+ "focus-within:relative focus-within:z-20"
32
+ ),
33
+ day_button: cn(
34
+ "inline-flex h-8 w-8 items-center justify-center rounded-md text-sm transition-colors",
35
+ "hover:bg-[var(--color-bg-subtle)] hover:text-[var(--color-text-primary)]",
36
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-ring-default)]",
37
+ "aria-selected:opacity-100"
38
+ ),
39
+ selected: "bg-[var(--color-fill-primary)] text-white hover:bg-[var(--color-fill-primary-hover)] hover:text-white focus:bg-[var(--color-fill-primary)] focus:text-white",
40
+ today: "bg-[var(--color-bg-subtle)] text-[var(--color-text-primary)]",
41
+ outside: "text-[var(--color-text-muted)] opacity-50",
42
+ disabled: "text-[var(--color-text-muted)] opacity-50",
43
+ hidden: "invisible"
44
+ };
45
+ var DatePicker = React.forwardRef(
46
+ function DatePicker2({
47
+ value,
48
+ onChange,
49
+ placeholder = "Pick a date",
50
+ disabled = false,
51
+ minDate,
52
+ maxDate,
53
+ className,
54
+ id,
55
+ "aria-label": ariaLabel
56
+ }, ref) {
57
+ const [open, setOpen] = React.useState(false);
58
+ const display = value ? format(value, "PP") : placeholder;
59
+ return /* @__PURE__ */ jsxs(RadixPopover.Root, { open, onOpenChange: setOpen, children: [
60
+ /* @__PURE__ */ jsx(RadixPopover.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs(
61
+ "button",
62
+ {
63
+ ref,
64
+ id,
65
+ disabled,
66
+ "aria-label": ariaLabel ? `${ariaLabel}: ${display}` : display,
67
+ className: cn(
68
+ "inline-flex h-9 w-full items-center justify-start gap-2 rounded-md border border-[var(--color-border-input)] bg-[var(--color-bg-default)] px-3 py-2 text-sm",
69
+ "hover:bg-[var(--color-bg-subtle)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-ring-default)]",
70
+ "disabled:cursor-not-allowed disabled:opacity-50",
71
+ !value && "text-[var(--color-text-muted)]",
72
+ className
73
+ ),
74
+ children: [
75
+ /* @__PURE__ */ jsx(CalendarDays, { size: "sm", "aria-hidden": "true" }),
76
+ value ? format(value, "PP") : placeholder
77
+ ]
78
+ }
79
+ ) }),
80
+ /* @__PURE__ */ jsx(RadixPopover.Portal, { children: /* @__PURE__ */ jsx(
81
+ RadixPopover.Content,
82
+ {
83
+ align: "start",
84
+ className: cn(
85
+ "z-[var(--z-popover)] rounded-lg border border-[var(--color-border-default)] bg-[var(--color-bg-default)] shadow-md",
86
+ "data-[state=open]:animate-in data-[state=closed]:animate-out",
87
+ "data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
88
+ "data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95"
89
+ ),
90
+ children: /* @__PURE__ */ jsx(
91
+ DayPicker,
92
+ {
93
+ mode: "single",
94
+ selected: value,
95
+ onSelect: (date) => {
96
+ onChange?.(date);
97
+ setOpen(false);
98
+ },
99
+ startMonth: minDate,
100
+ endMonth: maxDate,
101
+ initialFocus: true,
102
+ showOutsideDays: true,
103
+ className: "p-3",
104
+ classNames: calendarClassNames,
105
+ components: {
106
+ Chevron: ({ orientation, ...rest }) => orientation === "left" ? /* @__PURE__ */ jsx(ChevronLeft, { size: "xs", "aria-hidden": "true" }) : orientation === "right" ? /* @__PURE__ */ jsx(ChevronRight, { size: "xs", "aria-hidden": "true" }) : /* @__PURE__ */ jsx(ChevronRight, { size: "xs", "aria-hidden": "true", ...rest })
107
+ }
108
+ }
109
+ )
110
+ }
111
+ ) })
112
+ ] });
113
+ }
114
+ );
115
+ DatePicker.displayName = "DatePicker";
116
+
117
+ export {
118
+ DatePicker
119
+ };
@@ -0,0 +1,91 @@
1
+ 'use client';
2
+ import {
3
+ cn
4
+ } from "./chunk-AT6RPKU3.js";
5
+
6
+ // src/components/FilterChip/FilterChip.tsx
7
+ import * as React from "react";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+ var FilterChip = React.forwardRef(
10
+ ({ className, selected = false, count, onRemove, children, ...props }, ref) => {
11
+ return /* @__PURE__ */ jsxs(
12
+ "span",
13
+ {
14
+ className: cn(
15
+ "inline-flex items-center gap-1 rounded-full border px-3 py-1 text-sm font-medium select-none transition-colors",
16
+ selected ? "bg-[var(--color-fill-accent)] text-white border-[var(--color-fill-accent)]" : "bg-[var(--color-bg-subtle)] text-[var(--color-text-primary)] border-[var(--color-border-default)] hover:bg-[var(--color-bg-muted)]"
17
+ ),
18
+ children: [
19
+ /* @__PURE__ */ jsxs(
20
+ "button",
21
+ {
22
+ ref,
23
+ type: "button",
24
+ className: cn(
25
+ "inline-flex items-center gap-1 bg-transparent border-0 p-0 m-0 cursor-pointer",
26
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-ring-default)] focus-visible:ring-offset-2 ring-offset-[var(--color-ring-offset)] rounded-sm",
27
+ selected ? "text-white" : "text-[var(--color-text-primary)]",
28
+ className
29
+ ),
30
+ "aria-pressed": selected,
31
+ ...props,
32
+ children: [
33
+ children,
34
+ count !== void 0 && /* @__PURE__ */ jsx(
35
+ "span",
36
+ {
37
+ className: cn(
38
+ "inline-flex items-center justify-center rounded-full text-xs font-semibold px-1.5 min-w-[1.25rem] h-5",
39
+ selected ? "bg-white/20 text-white" : "bg-[var(--color-bg-muted)] text-[var(--color-text-muted)]"
40
+ ),
41
+ children: count
42
+ }
43
+ )
44
+ ]
45
+ }
46
+ ),
47
+ onRemove && /* @__PURE__ */ jsx(
48
+ "button",
49
+ {
50
+ type: "button",
51
+ "aria-label": "Remove filter",
52
+ onClick: (e) => {
53
+ e.stopPropagation();
54
+ onRemove();
55
+ },
56
+ className: cn(
57
+ "inline-flex items-center justify-center rounded-full w-4 h-4 text-xs transition-colors",
58
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-ring-default)] focus-visible:ring-offset-1",
59
+ selected ? "text-white hover:bg-white/20" : "text-[var(--color-text-muted)] hover:bg-[var(--color-bg-muted)] hover:text-[var(--color-text-primary)]"
60
+ ),
61
+ children: /* @__PURE__ */ jsx(
62
+ "svg",
63
+ {
64
+ width: "10",
65
+ height: "10",
66
+ viewBox: "0 0 10 10",
67
+ fill: "none",
68
+ "aria-hidden": "true",
69
+ children: /* @__PURE__ */ jsx(
70
+ "path",
71
+ {
72
+ d: "M8 2L2 8M2 2l6 6",
73
+ stroke: "currentColor",
74
+ strokeWidth: "1.5",
75
+ strokeLinecap: "round"
76
+ }
77
+ )
78
+ }
79
+ )
80
+ }
81
+ )
82
+ ]
83
+ }
84
+ );
85
+ }
86
+ );
87
+ FilterChip.displayName = "FilterChip";
88
+
89
+ export {
90
+ FilterChip
91
+ };
@@ -0,0 +1,89 @@
1
+ 'use client';
2
+ import {
3
+ cn
4
+ } from "./chunk-AT6RPKU3.js";
5
+
6
+ // src/components/Table/Table.tsx
7
+ import * as React from "react";
8
+ import { jsx } from "react/jsx-runtime";
9
+ var Root = React.forwardRef(
10
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ jsx("table", { ref, className: cn("w-full caption-bottom text-sm", className), ...props }) })
11
+ );
12
+ Root.displayName = "Table.Root";
13
+ var Header = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
14
+ Header.displayName = "Table.Header";
15
+ var Body = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("tbody", { ref, className: cn("[&_tr:last-child]:border-0", className), ...props }));
16
+ Body.displayName = "Table.Body";
17
+ var TableFooter = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
18
+ "tfoot",
19
+ {
20
+ ref,
21
+ className: cn(
22
+ "border-t bg-[var(--color-bg-subtle)] font-medium [&>tr]:last:border-b-0",
23
+ className
24
+ ),
25
+ ...props
26
+ }
27
+ ));
28
+ TableFooter.displayName = "Table.Footer";
29
+ var Row = React.forwardRef(
30
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
31
+ "tr",
32
+ {
33
+ ref,
34
+ className: cn(
35
+ "border-b border-[var(--color-border-default)] transition-colors hover:bg-[var(--color-bg-subtle)]/50 data-[state=selected]:bg-[var(--color-bg-subtle)]",
36
+ className
37
+ ),
38
+ ...props
39
+ }
40
+ )
41
+ );
42
+ Row.displayName = "Table.Row";
43
+ var Head = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
44
+ "th",
45
+ {
46
+ ref,
47
+ className: cn(
48
+ "h-10 px-4 text-left align-middle font-medium text-[var(--color-text-muted)] [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
49
+ className
50
+ ),
51
+ ...props
52
+ }
53
+ ));
54
+ Head.displayName = "Table.Head";
55
+ var Cell = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
56
+ "td",
57
+ {
58
+ ref,
59
+ className: cn(
60
+ "p-4 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
61
+ className
62
+ ),
63
+ ...props
64
+ }
65
+ ));
66
+ Cell.displayName = "Table.Cell";
67
+ var Caption = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
68
+ "caption",
69
+ {
70
+ ref,
71
+ className: cn("mt-4 text-sm text-[var(--color-text-muted)]", className),
72
+ ...props
73
+ }
74
+ ));
75
+ Caption.displayName = "Table.Caption";
76
+ var Table = {
77
+ Root,
78
+ Header,
79
+ Body,
80
+ Footer: TableFooter,
81
+ Row,
82
+ Head,
83
+ Cell,
84
+ Caption
85
+ };
86
+
87
+ export {
88
+ Table
89
+ };
@@ -0,0 +1 @@
1
+ 'use client';
@@ -0,0 +1,66 @@
1
+ 'use client';
2
+ import {
3
+ cn
4
+ } from "./chunk-AT6RPKU3.js";
5
+
6
+ // src/components/Tabs/Tabs.tsx
7
+ import * as React from "react";
8
+ import * as RadixTabs from "@radix-ui/react-tabs";
9
+ import { jsx } from "react/jsx-runtime";
10
+ var Root2 = React.forwardRef(
11
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx(RadixTabs.Root, { ref, className: cn("flex flex-col gap-2", className), ...props })
12
+ );
13
+ Root2.displayName = "Tabs.Root";
14
+ var List2 = React.forwardRef(
15
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
16
+ RadixTabs.List,
17
+ {
18
+ ref,
19
+ className: cn(
20
+ "flex h-9 w-full items-center justify-start overflow-x-auto rounded-lg bg-[var(--color-bg-subtle)] p-1 text-[var(--color-text-muted)] gap-0.5",
21
+ className
22
+ ),
23
+ ...props
24
+ }
25
+ )
26
+ );
27
+ List2.displayName = "Tabs.List";
28
+ var Trigger2 = React.forwardRef(
29
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
30
+ RadixTabs.Trigger,
31
+ {
32
+ ref,
33
+ className: cn(
34
+ "inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all",
35
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-ring-default)] focus-visible:ring-offset-2 ring-offset-[var(--color-ring-offset)]",
36
+ "disabled:pointer-events-none disabled:opacity-50",
37
+ "data-[state=active]:bg-[var(--color-bg-default)] data-[state=active]:text-[var(--color-text-primary)] data-[state=active]:shadow-sm",
38
+ className
39
+ ),
40
+ ...props
41
+ }
42
+ )
43
+ );
44
+ Trigger2.displayName = "Tabs.Trigger";
45
+ var Content2 = React.forwardRef(
46
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
47
+ RadixTabs.Content,
48
+ {
49
+ ref,
50
+ className: cn(
51
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-ring-default)] focus-visible:ring-offset-2 ring-offset-[var(--color-ring-offset)]",
52
+ className,
53
+ // Radix hides inactive panels with the `hidden` attribute, which any
54
+ // display class (`flex`, `md:grid`…) overrides. !important always wins.
55
+ "data-[state=inactive]:!hidden"
56
+ ),
57
+ ...props
58
+ }
59
+ )
60
+ );
61
+ Content2.displayName = "Tabs.Content";
62
+ var Tabs = { Root: Root2, List: List2, Trigger: Trigger2, Content: Content2 };
63
+
64
+ export {
65
+ Tabs
66
+ };
@@ -0,0 +1,308 @@
1
+ 'use client';
2
+
3
+ // src/components/Motion/Fade.tsx
4
+ import * as React2 from "react";
5
+
6
+ // src/components/Motion/useMotion.ts
7
+ import * as React from "react";
8
+ var DURATION_MS = {
9
+ instant: 0,
10
+ fast: 150,
11
+ normal: 200,
12
+ slow: 300,
13
+ slower: 500
14
+ };
15
+ var FALLBACK_MARGIN_MS = 50;
16
+ function useMotion({
17
+ visible,
18
+ duration = "normal",
19
+ easing = "out",
20
+ unmountOnExit = false
21
+ }) {
22
+ const [phase, setPhase] = React.useState(
23
+ visible ? "entered" : "exited"
24
+ );
25
+ const rafRef = React.useRef(null);
26
+ const isMounted = React.useRef(true);
27
+ React.useEffect(() => {
28
+ isMounted.current = true;
29
+ return () => {
30
+ isMounted.current = false;
31
+ if (rafRef.current !== null) cancelAnimationFrame(rafRef.current);
32
+ };
33
+ }, []);
34
+ const prevVisible = React.useRef(visible);
35
+ React.useEffect(() => {
36
+ if (prevVisible.current === visible) return;
37
+ prevVisible.current = visible;
38
+ if (visible) {
39
+ setPhase("entering");
40
+ rafRef.current = requestAnimationFrame(() => {
41
+ rafRef.current = requestAnimationFrame(() => {
42
+ if (isMounted.current) setPhase("entered");
43
+ });
44
+ });
45
+ } else {
46
+ setPhase("exiting");
47
+ }
48
+ }, [visible]);
49
+ React.useEffect(() => {
50
+ if (phase !== "exiting") return;
51
+ const t = setTimeout(() => setPhase("exited"), DURATION_MS[duration] + FALLBACK_MARGIN_MS);
52
+ return () => clearTimeout(t);
53
+ }, [phase, duration]);
54
+ const handleTransitionEnd = React.useCallback((e) => {
55
+ if (!isMounted.current) return;
56
+ if (e && e.target !== e.currentTarget) return;
57
+ setPhase((prev) => prev === "exiting" ? "exited" : prev);
58
+ }, []);
59
+ const mounted = unmountOnExit ? phase !== "exited" : true;
60
+ const transitionStyle = {
61
+ transitionDuration: `var(--duration-${duration})`,
62
+ transitionTimingFunction: `var(--ease-${easing})`,
63
+ transitionProperty: "opacity, transform"
64
+ };
65
+ return { phase, mounted, transitionStyle, handleTransitionEnd };
66
+ }
67
+
68
+ // src/components/Motion/Fade.tsx
69
+ import { jsx } from "react/jsx-runtime";
70
+ var Fade = React2.forwardRef(function Fade2({
71
+ in: visible,
72
+ duration = "normal",
73
+ easing = "out",
74
+ unmountOnExit = false,
75
+ children,
76
+ style,
77
+ as: Tag = "div",
78
+ ...rest
79
+ }, ref) {
80
+ const { phase, mounted, transitionStyle, handleTransitionEnd } = useMotion({
81
+ visible,
82
+ duration,
83
+ easing,
84
+ unmountOnExit
85
+ });
86
+ if (!mounted) return null;
87
+ const opacity = phase === "entered" ? 1 : 0;
88
+ return /* @__PURE__ */ jsx(
89
+ Tag,
90
+ {
91
+ ref,
92
+ onTransitionEnd: handleTransitionEnd,
93
+ style: {
94
+ opacity,
95
+ willChange: "opacity",
96
+ ...transitionStyle,
97
+ ...style
98
+ },
99
+ ...rest,
100
+ children
101
+ }
102
+ );
103
+ });
104
+ Fade.displayName = "Fade";
105
+
106
+ // src/components/Motion/Slide.tsx
107
+ import * as React3 from "react";
108
+ import { jsx as jsx2 } from "react/jsx-runtime";
109
+ var directionTransform = {
110
+ up: { from: "translateY(12px)", to: "translateY(0)" },
111
+ down: { from: "translateY(-12px)", to: "translateY(0)" },
112
+ left: { from: "translateX(12px)", to: "translateX(0)" },
113
+ right: { from: "translateX(-12px)", to: "translateX(0)" }
114
+ };
115
+ var Slide = React3.forwardRef(function Slide2({
116
+ in: visible,
117
+ duration = "normal",
118
+ easing = "out",
119
+ unmountOnExit = false,
120
+ direction = "up",
121
+ distance,
122
+ children,
123
+ style,
124
+ as: Tag = "div",
125
+ ...rest
126
+ }, ref) {
127
+ const { phase, mounted, transitionStyle, handleTransitionEnd } = useMotion({
128
+ visible,
129
+ duration,
130
+ easing,
131
+ unmountOnExit
132
+ });
133
+ if (!mounted) return null;
134
+ const isEntered = phase === "entered";
135
+ const dt = directionTransform[direction];
136
+ let fromTransform = dt.from;
137
+ if (distance) {
138
+ if (direction === "up") fromTransform = `translateY(${distance})`;
139
+ if (direction === "down") fromTransform = `translateY(-${distance})`;
140
+ if (direction === "left") fromTransform = `translateX(${distance})`;
141
+ if (direction === "right") fromTransform = `translateX(-${distance})`;
142
+ }
143
+ return /* @__PURE__ */ jsx2(
144
+ Tag,
145
+ {
146
+ ref,
147
+ onTransitionEnd: handleTransitionEnd,
148
+ style: {
149
+ opacity: isEntered ? 1 : 0,
150
+ transform: isEntered ? dt.to : fromTransform,
151
+ willChange: "opacity, transform",
152
+ ...transitionStyle,
153
+ ...style
154
+ },
155
+ ...rest,
156
+ children
157
+ }
158
+ );
159
+ });
160
+ Slide.displayName = "Slide";
161
+
162
+ // src/components/Motion/Scale.tsx
163
+ import * as React4 from "react";
164
+ import { jsx as jsx3 } from "react/jsx-runtime";
165
+ var Scale = React4.forwardRef(function Scale2({
166
+ in: visible,
167
+ duration = "fast",
168
+ easing = "out-expo",
169
+ unmountOnExit = false,
170
+ initialScale = 0.95,
171
+ children,
172
+ style,
173
+ as: Tag = "div",
174
+ ...rest
175
+ }, ref) {
176
+ const { phase, mounted, transitionStyle, handleTransitionEnd } = useMotion({
177
+ visible,
178
+ duration,
179
+ easing,
180
+ unmountOnExit
181
+ });
182
+ if (!mounted) return null;
183
+ const isEntered = phase === "entered";
184
+ return /* @__PURE__ */ jsx3(
185
+ Tag,
186
+ {
187
+ ref,
188
+ onTransitionEnd: handleTransitionEnd,
189
+ style: {
190
+ opacity: isEntered ? 1 : 0,
191
+ transform: isEntered ? "scale(1)" : `scale(${initialScale})`,
192
+ transformOrigin: "top center",
193
+ willChange: "opacity, transform",
194
+ ...transitionStyle,
195
+ ...style
196
+ },
197
+ ...rest,
198
+ children
199
+ }
200
+ );
201
+ });
202
+ Scale.displayName = "Scale";
203
+
204
+ // src/components/Motion/Collapse.tsx
205
+ import * as React5 from "react";
206
+ import { jsx as jsx4 } from "react/jsx-runtime";
207
+ var Collapse = React5.forwardRef(function Collapse2({
208
+ in: visible,
209
+ duration = "normal",
210
+ easing = "out",
211
+ unmountOnExit = false,
212
+ collapsedHeight = 0,
213
+ children,
214
+ style,
215
+ as: Tag = "div",
216
+ ...rest
217
+ }, ref) {
218
+ const innerRef = React5.useRef(null);
219
+ const [height, setHeight] = React5.useState(visible ? "auto" : 0);
220
+ const [overflow, setOverflow] = React5.useState(
221
+ visible ? "visible" : "hidden"
222
+ );
223
+ const [mounted, setMounted] = React5.useState(unmountOnExit ? visible : true);
224
+ const prevVisible = React5.useRef(visible);
225
+ React5.useEffect(() => {
226
+ const changed = prevVisible.current !== visible;
227
+ prevVisible.current = visible;
228
+ if (!changed) return;
229
+ let raf1 = 0;
230
+ let raf2 = 0;
231
+ if (visible) {
232
+ setMounted(true);
233
+ raf1 = requestAnimationFrame(() => {
234
+ const el = innerRef.current;
235
+ if (el) {
236
+ setHeight(el.scrollHeight);
237
+ setOverflow("hidden");
238
+ }
239
+ });
240
+ } else {
241
+ const el = innerRef.current;
242
+ if (el) {
243
+ setHeight(el.scrollHeight);
244
+ setOverflow("hidden");
245
+ raf1 = requestAnimationFrame(() => {
246
+ raf2 = requestAnimationFrame(() => {
247
+ setHeight(typeof collapsedHeight === "number" ? collapsedHeight : 0);
248
+ });
249
+ });
250
+ }
251
+ }
252
+ return () => {
253
+ cancelAnimationFrame(raf1);
254
+ cancelAnimationFrame(raf2);
255
+ };
256
+ }, [visible, collapsedHeight]);
257
+ const finish = React5.useCallback(() => {
258
+ if (visible) {
259
+ setHeight("auto");
260
+ setOverflow("visible");
261
+ } else if (unmountOnExit) {
262
+ setMounted(false);
263
+ }
264
+ }, [visible, unmountOnExit]);
265
+ const handleTransitionEnd = React5.useCallback(
266
+ (e) => {
267
+ if (e.target !== e.currentTarget || e.propertyName !== "max-height") return;
268
+ finish();
269
+ },
270
+ [finish]
271
+ );
272
+ const firstRender = React5.useRef(true);
273
+ React5.useEffect(() => {
274
+ if (firstRender.current) {
275
+ firstRender.current = false;
276
+ return;
277
+ }
278
+ const t = setTimeout(finish, DURATION_MS[duration] + 100);
279
+ return () => clearTimeout(t);
280
+ }, [visible, duration, finish]);
281
+ if (!mounted) return null;
282
+ const maxHeight = height === "auto" ? "none" : `${height}px`;
283
+ return /* @__PURE__ */ jsx4(
284
+ Tag,
285
+ {
286
+ ref,
287
+ style: {
288
+ maxHeight,
289
+ overflow,
290
+ transitionProperty: "max-height",
291
+ transitionDuration: `var(--duration-${duration})`,
292
+ transitionTimingFunction: `var(--ease-${easing})`,
293
+ ...style
294
+ },
295
+ onTransitionEnd: handleTransitionEnd,
296
+ ...rest,
297
+ children: /* @__PURE__ */ jsx4("div", { ref: innerRef, children })
298
+ }
299
+ );
300
+ });
301
+ Collapse.displayName = "Collapse";
302
+
303
+ export {
304
+ Fade,
305
+ Slide,
306
+ Scale,
307
+ Collapse
308
+ };