@wealthx/shadcn 0.0.2 → 1.0.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 (188) hide show
  1. package/.turbo/turbo-build.log +135 -11
  2. package/CHANGELOG.md +6 -0
  3. package/CHANGES.md +345 -0
  4. package/dist/chunk-2WZVSBAY.mjs +232 -0
  5. package/dist/chunk-2Y7YJKPE.mjs +47 -0
  6. package/dist/chunk-3U7SD3MS.mjs +55 -0
  7. package/dist/chunk-3VQNJ235.mjs +114 -0
  8. package/dist/chunk-55CEW76V.mjs +35 -0
  9. package/dist/chunk-6AFMNC42.mjs +146 -0
  10. package/dist/chunk-6OJF6XRN.mjs +117 -0
  11. package/dist/chunk-7LDIMXGM.mjs +181 -0
  12. package/dist/chunk-AMJ23O53.mjs +122 -0
  13. package/dist/chunk-BBJBJSXQ.mjs +44 -0
  14. package/dist/chunk-BGP2N52Z.mjs +126 -0
  15. package/dist/chunk-BMFN37JH.mjs +41 -0
  16. package/dist/chunk-CGOKTPXU.mjs +79 -0
  17. package/dist/chunk-CZ3BW5GL.mjs +81 -0
  18. package/dist/chunk-DBHJ5KC3.mjs +55 -0
  19. package/dist/chunk-DDPA2XXS.mjs +97 -0
  20. package/dist/chunk-DS2AMHN2.mjs +30 -0
  21. package/dist/chunk-E3K6O4FZ.mjs +57 -0
  22. package/dist/chunk-FWCSY2DS.mjs +37 -0
  23. package/dist/chunk-GPRJQ24C.mjs +28 -0
  24. package/dist/chunk-HS7TFG7V.mjs +24 -0
  25. package/dist/chunk-HUVTPUV2.mjs +256 -0
  26. package/dist/chunk-IAOOZCUY.mjs +90 -0
  27. package/dist/chunk-JF4PHPD5.mjs +111 -0
  28. package/dist/chunk-JU2RUWHF.mjs +123 -0
  29. package/dist/chunk-KKHTJNMM.mjs +86 -0
  30. package/dist/chunk-MJIEMGRD.mjs +266 -0
  31. package/dist/chunk-MKFL5MNH.mjs +372 -0
  32. package/dist/chunk-MQ72DIBH.mjs +105 -0
  33. package/dist/chunk-NGYG2EA6.mjs +148 -0
  34. package/dist/chunk-NWZ46DJL.mjs +213 -0
  35. package/dist/chunk-OXQQNQZI.mjs +75 -0
  36. package/dist/chunk-PMKODV6M.mjs +161 -0
  37. package/dist/chunk-QOJ2DQD6.mjs +57 -0
  38. package/dist/chunk-RL772EH7.mjs +126 -0
  39. package/dist/chunk-SLWCCURD.mjs +99 -0
  40. package/dist/chunk-V7CNWJT3.mjs +10 -0
  41. package/dist/chunk-VG6UF6UT.mjs +68 -0
  42. package/dist/chunk-VYMHBV6D.mjs +123 -0
  43. package/dist/chunk-VZ2NR7L3.mjs +195 -0
  44. package/dist/chunk-YN5SYTOO.mjs +117 -0
  45. package/dist/chunk-Z3MK2KKZ.mjs +83 -0
  46. package/dist/chunk-ZN2QKLF6.mjs +187 -0
  47. package/dist/chunk-ZZV5JVNW.mjs +34 -0
  48. package/dist/components/ui/accordion.js +142 -0
  49. package/dist/components/ui/accordion.mjs +14 -0
  50. package/dist/components/ui/alert-dialog.js +413 -0
  51. package/dist/components/ui/alert-dialog.mjs +34 -0
  52. package/dist/components/ui/alert.js +134 -0
  53. package/dist/components/ui/alert.mjs +12 -0
  54. package/dist/components/ui/avatar.js +173 -0
  55. package/dist/components/ui/avatar.mjs +18 -0
  56. package/dist/components/ui/badge.js +163 -0
  57. package/dist/components/ui/badge.mjs +11 -0
  58. package/dist/components/ui/button.js +198 -0
  59. package/dist/components/ui/button.mjs +11 -0
  60. package/dist/components/ui/calendar.js +408 -0
  61. package/dist/components/ui/calendar.mjs +12 -0
  62. package/dist/components/ui/card.js +156 -0
  63. package/dist/components/ui/card.mjs +20 -0
  64. package/dist/components/ui/checkbox.js +166 -0
  65. package/dist/components/ui/checkbox.mjs +11 -0
  66. package/dist/components/ui/chip.js +199 -0
  67. package/dist/components/ui/chip.mjs +10 -0
  68. package/dist/components/ui/data-table.js +925 -0
  69. package/dist/components/ui/data-table.mjs +29 -0
  70. package/dist/components/ui/date-picker.js +561 -0
  71. package/dist/components/ui/date-picker.mjs +15 -0
  72. package/dist/components/ui/dialog.js +378 -0
  73. package/dist/components/ui/dialog.mjs +30 -0
  74. package/dist/components/ui/drawer.js +213 -0
  75. package/dist/components/ui/drawer.mjs +28 -0
  76. package/dist/components/ui/dropdown-menu.js +338 -0
  77. package/dist/components/ui/dropdown-menu.mjs +38 -0
  78. package/dist/components/ui/empty.js +173 -0
  79. package/dist/components/ui/empty.mjs +18 -0
  80. package/dist/components/ui/field.js +359 -0
  81. package/dist/components/ui/field.mjs +28 -0
  82. package/dist/components/ui/input-group.js +406 -0
  83. package/dist/components/ui/input-group.mjs +22 -0
  84. package/dist/components/ui/input-otp.js +149 -0
  85. package/dist/components/ui/input-otp.mjs +14 -0
  86. package/dist/components/ui/input.js +81 -0
  87. package/dist/components/ui/input.mjs +8 -0
  88. package/dist/components/ui/label.js +85 -0
  89. package/dist/components/ui/label.mjs +8 -0
  90. package/dist/components/ui/pagination.js +333 -0
  91. package/dist/components/ui/pagination.mjs +22 -0
  92. package/dist/components/ui/popover.js +167 -0
  93. package/dist/components/ui/popover.mjs +22 -0
  94. package/dist/components/ui/progress.js +97 -0
  95. package/dist/components/ui/progress.mjs +8 -0
  96. package/dist/components/ui/radio-group.js +178 -0
  97. package/dist/components/ui/radio-group.mjs +12 -0
  98. package/dist/components/ui/select.js +262 -0
  99. package/dist/components/ui/select.mjs +28 -0
  100. package/dist/components/ui/separator.js +86 -0
  101. package/dist/components/ui/separator.mjs +8 -0
  102. package/dist/components/ui/sheet.js +227 -0
  103. package/dist/components/ui/sheet.mjs +26 -0
  104. package/dist/components/ui/skeleton.js +75 -0
  105. package/dist/components/ui/skeleton.mjs +8 -0
  106. package/dist/components/ui/sonner.js +86 -0
  107. package/dist/components/ui/sonner.mjs +7 -0
  108. package/dist/components/ui/spinner.js +93 -0
  109. package/dist/components/ui/spinner.mjs +10 -0
  110. package/dist/components/ui/switch.js +178 -0
  111. package/dist/components/ui/switch.mjs +11 -0
  112. package/dist/components/ui/table.js +184 -0
  113. package/dist/components/ui/table.mjs +22 -0
  114. package/dist/components/ui/tabs.js +181 -0
  115. package/dist/components/ui/tabs.mjs +16 -0
  116. package/dist/components/ui/textarea.js +79 -0
  117. package/dist/components/ui/textarea.mjs +8 -0
  118. package/dist/components/ui/toggle-group.js +184 -0
  119. package/dist/components/ui/toggle-group.mjs +12 -0
  120. package/dist/components/ui/toggle.js +108 -0
  121. package/dist/components/ui/toggle.mjs +11 -0
  122. package/dist/components/ui/tooltip.js +140 -0
  123. package/dist/components/ui/tooltip.mjs +16 -0
  124. package/dist/index.js +4312 -90
  125. package/dist/index.mjs +459 -158
  126. package/dist/lib/colors.js +84 -0
  127. package/dist/lib/colors.mjs +13 -0
  128. package/dist/lib/theme-provider.js +150 -0
  129. package/dist/lib/theme-provider.mjs +13 -0
  130. package/dist/lib/typography.js +157 -0
  131. package/dist/lib/typography.mjs +25 -0
  132. package/dist/lib/utils.js +34 -0
  133. package/dist/lib/utils.mjs +7 -0
  134. package/dist/styles.css +1 -1
  135. package/package.json +228 -11
  136. package/scripts/build-css.ts +15 -9
  137. package/src/components/index.tsx +443 -0
  138. package/src/components/ui/accordion.tsx +99 -0
  139. package/src/components/ui/alert-dialog.tsx +239 -0
  140. package/src/components/ui/alert.tsx +81 -0
  141. package/src/components/ui/avatar.tsx +130 -0
  142. package/src/components/ui/badge.tsx +57 -0
  143. package/src/components/ui/button.tsx +69 -37
  144. package/src/components/ui/calendar.tsx +252 -0
  145. package/src/components/ui/card.tsx +106 -0
  146. package/src/components/ui/checkbox.tsx +111 -0
  147. package/src/components/ui/chip.tsx +65 -0
  148. package/src/components/ui/data-table.tsx +490 -0
  149. package/src/components/ui/date-picker.tsx +133 -0
  150. package/src/components/ui/dialog.tsx +195 -0
  151. package/src/components/ui/drawer.tsx +169 -0
  152. package/src/components/ui/dropdown-menu.tsx +315 -0
  153. package/src/components/ui/empty.tsx +128 -0
  154. package/src/components/ui/field.tsx +273 -0
  155. package/src/components/ui/input-group.tsx +190 -0
  156. package/src/components/ui/input-otp.tsx +90 -0
  157. package/src/components/ui/input.tsx +28 -0
  158. package/src/components/ui/label.tsx +24 -0
  159. package/src/components/ui/pagination.tsx +148 -0
  160. package/src/components/ui/popover.tsx +112 -0
  161. package/src/components/ui/progress.tsx +40 -0
  162. package/src/components/ui/radio-group.tsx +129 -0
  163. package/src/components/ui/select.tsx +201 -0
  164. package/src/components/ui/separator.tsx +26 -0
  165. package/src/components/ui/sheet.tsx +182 -0
  166. package/src/components/ui/skeleton.tsx +22 -0
  167. package/src/components/ui/sonner.tsx +48 -0
  168. package/src/components/ui/spinner.tsx +41 -0
  169. package/src/components/ui/switch.tsx +126 -0
  170. package/src/components/ui/table.tsx +143 -0
  171. package/src/components/ui/tabs.tsx +119 -0
  172. package/src/components/ui/textarea.tsx +28 -0
  173. package/src/components/ui/toggle-group.tsx +94 -0
  174. package/src/components/ui/toggle.tsx +59 -0
  175. package/src/components/ui/tooltip.tsx +80 -0
  176. package/src/index.ts +15 -3
  177. package/src/lib/colors.ts +74 -0
  178. package/src/lib/slot.tsx +68 -0
  179. package/src/lib/theme-provider.tsx +134 -0
  180. package/src/lib/typography.ts +153 -0
  181. package/src/lib/utils.ts +1 -1
  182. package/src/styles/globals.css +377 -107
  183. package/src/styles/styles-css.ts +1 -1
  184. package/tsup.config.ts +48 -2
  185. package/dist/index.d.mts +0 -27
  186. package/dist/index.d.ts +0 -27
  187. package/src/provider/ShadcnProvider.tsx +0 -89
  188. package/src/provider/index.ts +0 -2
@@ -0,0 +1,57 @@
1
+ // src/lib/colors.ts
2
+ var CONTRAST_DARK = "#040D13";
3
+ var CONTRAST_LIGHT = "#FFFFFF";
4
+ function hexToRgb(hex) {
5
+ const normalized = hex.replace(/^#/, "");
6
+ if (normalized.length === 3) {
7
+ const r = parseInt(normalized[0] + normalized[0], 16);
8
+ const g = parseInt(normalized[1] + normalized[1], 16);
9
+ const b = parseInt(normalized[2] + normalized[2], 16);
10
+ return [r, g, b];
11
+ }
12
+ if (normalized.length === 6 || normalized.length === 8) {
13
+ const r = parseInt(normalized.slice(0, 2), 16);
14
+ const g = parseInt(normalized.slice(2, 4), 16);
15
+ const b = parseInt(normalized.slice(4, 6), 16);
16
+ return [r, g, b];
17
+ }
18
+ throw new Error(`Invalid hex color: ${hex}`);
19
+ }
20
+ function linearizeSrgb(c) {
21
+ const n = c / 255;
22
+ return n <= 0.03928 ? n / 12.92 : Math.pow((n + 0.055) / 1.055, 2.4);
23
+ }
24
+ function getLuminance(hex) {
25
+ const [r, g, b] = hexToRgb(hex);
26
+ return 0.2126 * linearizeSrgb(r) + 0.7152 * linearizeSrgb(g) + 0.0722 * linearizeSrgb(b);
27
+ }
28
+ function getContrastText(backgroundColor) {
29
+ const luminance = getLuminance(backgroundColor);
30
+ return luminance > 0.179 ? CONTRAST_DARK : CONTRAST_LIGHT;
31
+ }
32
+ function hexToOklch(hex) {
33
+ const [r, g, b] = hexToRgb(hex);
34
+ const rl = linearizeSrgb(r);
35
+ const gl = linearizeSrgb(g);
36
+ const bl = linearizeSrgb(b);
37
+ const l = 0.4122214708 * rl + 0.5363325363 * gl + 0.0514459929 * bl;
38
+ const m = 0.2119034982 * rl + 0.6806995451 * gl + 0.1073969566 * bl;
39
+ const s = 0.0883024619 * rl + 0.2817188376 * gl + 0.6299787005 * bl;
40
+ const l_ = l > 0 ? Math.cbrt(l) : 0;
41
+ const m_ = m > 0 ? Math.cbrt(m) : 0;
42
+ const s_ = s > 0 ? Math.cbrt(s) : 0;
43
+ const L = 0.2104542553 * l_ + 0.793617785 * m_ - 0.0040720468 * s_;
44
+ const a = 1.9779984951 * l_ - 2.428592205 * m_ + 0.4505937099 * s_;
45
+ const bv = 0.0259040371 * l_ + 0.7827717662 * m_ - 0.808675766 * s_;
46
+ const C = Math.sqrt(a * a + bv * bv);
47
+ const h = (Math.atan2(bv, a) * 180 / Math.PI + 360) % 360;
48
+ if (C < 1e-3) return `oklch(${L.toFixed(3)} 0 0)`;
49
+ return `oklch(${L.toFixed(3)} ${C.toFixed(3)} ${h.toFixed(1)})`;
50
+ }
51
+
52
+ export {
53
+ hexToRgb,
54
+ getLuminance,
55
+ getContrastText,
56
+ hexToOklch
57
+ };
@@ -0,0 +1,126 @@
1
+ import {
2
+ cn
3
+ } from "./chunk-V7CNWJT3.mjs";
4
+ import {
5
+ __objRest,
6
+ __spreadValues
7
+ } from "./chunk-FWCSY2DS.mjs";
8
+
9
+ // src/components/ui/tabs.tsx
10
+ import { cva } from "class-variance-authority";
11
+ import { Tabs as TabsPrimitive } from "@base-ui/react/tabs";
12
+ import { jsx } from "react/jsx-runtime";
13
+ function Tabs(_a) {
14
+ var _b = _a, {
15
+ className,
16
+ orientation = "horizontal"
17
+ } = _b, props = __objRest(_b, [
18
+ "className",
19
+ "orientation"
20
+ ]);
21
+ return /* @__PURE__ */ jsx(
22
+ TabsPrimitive.Root,
23
+ __spreadValues({
24
+ className: cn(
25
+ "group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",
26
+ className
27
+ ),
28
+ "data-orientation": orientation,
29
+ "data-slot": "tabs"
30
+ }, props)
31
+ );
32
+ }
33
+ var tabsListVariants = cva(
34
+ "group/tabs-list inline-flex w-fit items-center justify-center gap-1 rounded-none p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",
35
+ {
36
+ variants: {
37
+ variant: {
38
+ default: "bg-muted",
39
+ line: "bg-transparent p-0"
40
+ }
41
+ },
42
+ defaultVariants: {
43
+ variant: "default"
44
+ }
45
+ }
46
+ );
47
+ function TabsList(_a) {
48
+ var _b = _a, {
49
+ className,
50
+ variant = "default"
51
+ } = _b, props = __objRest(_b, [
52
+ "className",
53
+ "variant"
54
+ ]);
55
+ return /* @__PURE__ */ jsx(
56
+ TabsPrimitive.List,
57
+ __spreadValues({
58
+ className: cn(tabsListVariants({ variant }), className),
59
+ "data-slot": "tabs-list",
60
+ "data-variant": variant
61
+ }, props)
62
+ );
63
+ }
64
+ function TabsTrigger(_a) {
65
+ var _b = _a, {
66
+ className
67
+ } = _b, props = __objRest(_b, [
68
+ "className"
69
+ ]);
70
+ return /* @__PURE__ */ jsx(
71
+ TabsPrimitive.Tab,
72
+ __spreadValues({
73
+ className: cn(
74
+ // Base layout & typography
75
+ "relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 whitespace-nowrap",
76
+ "rounded-none border border-transparent px-1.5 py-1 text-sm font-medium",
77
+ "text-muted-foreground transition-all",
78
+ // Vertical orientation
79
+ "group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start",
80
+ // Hover & focus
81
+ "hover:text-foreground",
82
+ "focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring",
83
+ // Disabled
84
+ "disabled:pointer-events-none disabled:opacity-50",
85
+ // Active state — Default variant: primary/10 bg + subtle shadow
86
+ // Base UI uses data-active attribute for the active/selected tab
87
+ "data-active:bg-primary/10 data-active:text-foreground",
88
+ "group-data-[variant=default]/tabs-list:data-active:shadow-sm",
89
+ // Active state — Line variant: suppress bg & shadow
90
+ "group-data-[variant=line]/tabs-list:data-active:bg-transparent",
91
+ "group-data-[variant=line]/tabs-list:data-active:shadow-none",
92
+ // Indicator pseudo-element (visible only for Line variant, active state)
93
+ "after:absolute after:bg-primary after:opacity-0 after:transition-opacity",
94
+ "group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5",
95
+ "group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5",
96
+ "group-data-[variant=line]/tabs-list:data-active:after:opacity-100",
97
+ // SVG icons
98
+ "[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
99
+ className
100
+ ),
101
+ "data-slot": "tabs-trigger"
102
+ }, props)
103
+ );
104
+ }
105
+ function TabsContent(_a) {
106
+ var _b = _a, {
107
+ className
108
+ } = _b, props = __objRest(_b, [
109
+ "className"
110
+ ]);
111
+ return /* @__PURE__ */ jsx(
112
+ TabsPrimitive.Panel,
113
+ __spreadValues({
114
+ className: cn("flex-1 outline-none", className),
115
+ "data-slot": "tabs-content"
116
+ }, props)
117
+ );
118
+ }
119
+
120
+ export {
121
+ Tabs,
122
+ tabsListVariants,
123
+ TabsList,
124
+ TabsTrigger,
125
+ TabsContent
126
+ };
@@ -0,0 +1,99 @@
1
+ import {
2
+ cn
3
+ } from "./chunk-V7CNWJT3.mjs";
4
+ import {
5
+ __objRest,
6
+ __spreadValues
7
+ } from "./chunk-FWCSY2DS.mjs";
8
+
9
+ // src/components/ui/card.tsx
10
+ import { jsx } from "react/jsx-runtime";
11
+ function Card(_a) {
12
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
13
+ return /* @__PURE__ */ jsx(
14
+ "div",
15
+ __spreadValues({
16
+ className: cn(
17
+ "flex flex-col gap-6 border bg-card py-6 text-card-foreground shadow-sm",
18
+ className
19
+ ),
20
+ "data-slot": "card"
21
+ }, props)
22
+ );
23
+ }
24
+ function CardHeader(_a) {
25
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
26
+ return /* @__PURE__ */ jsx(
27
+ "div",
28
+ __spreadValues({
29
+ className: cn(
30
+ "@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
31
+ className
32
+ ),
33
+ "data-slot": "card-header"
34
+ }, props)
35
+ );
36
+ }
37
+ function CardTitle(_a) {
38
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
39
+ return /* @__PURE__ */ jsx(
40
+ "div",
41
+ __spreadValues({
42
+ className: cn("leading-none font-semibold", className),
43
+ "data-slot": "card-title"
44
+ }, props)
45
+ );
46
+ }
47
+ function CardDescription(_a) {
48
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
49
+ return /* @__PURE__ */ jsx(
50
+ "div",
51
+ __spreadValues({
52
+ className: cn("text-sm text-muted-foreground", className),
53
+ "data-slot": "card-description"
54
+ }, props)
55
+ );
56
+ }
57
+ function CardAction(_a) {
58
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
59
+ return /* @__PURE__ */ jsx(
60
+ "div",
61
+ __spreadValues({
62
+ className: cn(
63
+ "col-start-2 row-span-2 row-start-1 self-start justify-self-end",
64
+ className
65
+ ),
66
+ "data-slot": "card-action"
67
+ }, props)
68
+ );
69
+ }
70
+ function CardContent(_a) {
71
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
72
+ return /* @__PURE__ */ jsx(
73
+ "div",
74
+ __spreadValues({
75
+ className: cn("px-6", className),
76
+ "data-slot": "card-content"
77
+ }, props)
78
+ );
79
+ }
80
+ function CardFooter(_a) {
81
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
82
+ return /* @__PURE__ */ jsx(
83
+ "div",
84
+ __spreadValues({
85
+ className: cn("flex items-center px-6 [.border-t]:pt-6", className),
86
+ "data-slot": "card-footer"
87
+ }, props)
88
+ );
89
+ }
90
+
91
+ export {
92
+ Card,
93
+ CardHeader,
94
+ CardTitle,
95
+ CardDescription,
96
+ CardAction,
97
+ CardContent,
98
+ CardFooter
99
+ };
@@ -0,0 +1,10 @@
1
+ // src/lib/utils.ts
2
+ import { clsx } from "clsx";
3
+ import { twMerge } from "tailwind-merge";
4
+ function cn(...inputs) {
5
+ return twMerge(clsx(inputs));
6
+ }
7
+
8
+ export {
9
+ cn
10
+ };
@@ -0,0 +1,68 @@
1
+ import {
2
+ badgeVariants
3
+ } from "./chunk-E3K6O4FZ.mjs";
4
+ import {
5
+ cn
6
+ } from "./chunk-V7CNWJT3.mjs";
7
+ import {
8
+ __objRest,
9
+ __spreadProps,
10
+ __spreadValues
11
+ } from "./chunk-FWCSY2DS.mjs";
12
+
13
+ // src/components/ui/chip.tsx
14
+ import { X } from "lucide-react";
15
+ import { jsx, jsxs } from "react/jsx-runtime";
16
+ function Chip(_a) {
17
+ var _b = _a, {
18
+ className,
19
+ variant = "secondary",
20
+ onRemove,
21
+ disabled,
22
+ children
23
+ } = _b, props = __objRest(_b, [
24
+ "className",
25
+ "variant",
26
+ "onRemove",
27
+ "disabled",
28
+ "children"
29
+ ]);
30
+ return /* @__PURE__ */ jsxs(
31
+ "span",
32
+ __spreadProps(__spreadValues({
33
+ "aria-disabled": disabled,
34
+ className: cn(
35
+ badgeVariants({ variant }),
36
+ // extra right padding only when dismiss button is present
37
+ onRemove && "pr-1",
38
+ disabled && "pointer-events-none opacity-50",
39
+ className
40
+ ),
41
+ "data-slot": "chip",
42
+ "data-variant": variant
43
+ }, props), {
44
+ children: [
45
+ children,
46
+ onRemove ? /* @__PURE__ */ jsx(
47
+ "button",
48
+ {
49
+ "aria-label": "Remove",
50
+ className: "ml-0.5 inline-flex shrink-0 items-center justify-center rounded-full p-0.5 opacity-60 hover:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none",
51
+ "data-slot": "chip-remove",
52
+ disabled,
53
+ onClick: (e) => {
54
+ e.stopPropagation();
55
+ onRemove();
56
+ },
57
+ type: "button",
58
+ children: /* @__PURE__ */ jsx(X, { className: "size-3" })
59
+ }
60
+ ) : null
61
+ ]
62
+ })
63
+ );
64
+ }
65
+
66
+ export {
67
+ Chip
68
+ };
@@ -0,0 +1,123 @@
1
+ import {
2
+ cn
3
+ } from "./chunk-V7CNWJT3.mjs";
4
+ import {
5
+ __objRest,
6
+ __spreadProps,
7
+ __spreadValues
8
+ } from "./chunk-FWCSY2DS.mjs";
9
+
10
+ // src/components/ui/switch.tsx
11
+ import { useState } from "react";
12
+ import { Switch as SwitchPrimitive } from "@base-ui/react/switch";
13
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
14
+ function Switch(_a) {
15
+ var _b = _a, {
16
+ className,
17
+ size = "default"
18
+ } = _b, props = __objRest(_b, [
19
+ "className",
20
+ "size"
21
+ ]);
22
+ return /* @__PURE__ */ jsx(
23
+ SwitchPrimitive.Root,
24
+ __spreadProps(__spreadValues({
25
+ className: cn(
26
+ "peer group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none",
27
+ "focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50",
28
+ "disabled:cursor-not-allowed disabled:opacity-50",
29
+ "data-[size=default]:h-[1.15rem] data-[size=default]:w-8",
30
+ "data-[size=sm]:h-3.5 data-[size=sm]:w-6",
31
+ "data-checked:bg-primary data-unchecked:bg-input",
32
+ "aria-invalid:data-checked:bg-destructive aria-invalid:border-destructive",
33
+ "dark:data-unchecked:bg-input/80",
34
+ className
35
+ ),
36
+ "data-size": size,
37
+ "data-slot": "switch"
38
+ }, props), {
39
+ children: /* @__PURE__ */ jsx(
40
+ SwitchPrimitive.Thumb,
41
+ {
42
+ className: cn(
43
+ "pointer-events-none block rounded-full bg-background ring-0 transition-transform",
44
+ "group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3",
45
+ "data-checked:translate-x-[calc(100%-2px)] data-unchecked:translate-x-0",
46
+ "dark:data-checked:bg-primary-foreground dark:data-unchecked:bg-foreground"
47
+ ),
48
+ "data-slot": "switch-thumb"
49
+ }
50
+ )
51
+ })
52
+ );
53
+ }
54
+ function SwitchCard(_a) {
55
+ var _b = _a, {
56
+ className,
57
+ checked,
58
+ defaultChecked,
59
+ onCheckedChange,
60
+ disabled,
61
+ error,
62
+ label,
63
+ description,
64
+ switchPosition = "right",
65
+ size
66
+ } = _b, props = __objRest(_b, [
67
+ "className",
68
+ "checked",
69
+ "defaultChecked",
70
+ "onCheckedChange",
71
+ "disabled",
72
+ "error",
73
+ "label",
74
+ "description",
75
+ "switchPosition",
76
+ "size"
77
+ ]);
78
+ const [internalChecked, setInternalChecked] = useState(defaultChecked != null ? defaultChecked : false);
79
+ const isChecked = checked != null ? checked : internalChecked;
80
+ const switchElement = /* @__PURE__ */ jsx(
81
+ Switch,
82
+ __spreadValues({
83
+ "aria-invalid": error || void 0,
84
+ checked: isChecked,
85
+ className: "shrink-0",
86
+ disabled,
87
+ onCheckedChange: (value, event) => {
88
+ setInternalChecked(value);
89
+ onCheckedChange == null ? void 0 : onCheckedChange(value, event);
90
+ },
91
+ size
92
+ }, props)
93
+ );
94
+ const contentElement = /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
95
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-medium leading-none", children: label }),
96
+ description ? /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: description }) : null
97
+ ] });
98
+ return /* @__PURE__ */ jsx(
99
+ "label",
100
+ {
101
+ className: cn(
102
+ "flex items-center gap-3 border border-border p-4 font-sans transition-colors cursor-pointer",
103
+ switchPosition === "right" && "justify-between",
104
+ disabled && "cursor-not-allowed opacity-50",
105
+ error ? ["border-destructive", isChecked && "bg-destructive/5"] : isChecked && "border-primary bg-primary/5",
106
+ className
107
+ ),
108
+ "data-slot": "switch-card",
109
+ children: switchPosition === "left" ? /* @__PURE__ */ jsxs(Fragment, { children: [
110
+ switchElement,
111
+ contentElement
112
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
113
+ contentElement,
114
+ switchElement
115
+ ] })
116
+ }
117
+ );
118
+ }
119
+
120
+ export {
121
+ Switch,
122
+ SwitchCard
123
+ };
@@ -0,0 +1,195 @@
1
+ import {
2
+ useThemeVars
3
+ } from "./chunk-OXQQNQZI.mjs";
4
+ import {
5
+ cn
6
+ } from "./chunk-V7CNWJT3.mjs";
7
+ import {
8
+ __objRest,
9
+ __spreadProps,
10
+ __spreadValues
11
+ } from "./chunk-FWCSY2DS.mjs";
12
+
13
+ // src/components/ui/select.tsx
14
+ import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
15
+ import { Select as SelectPrimitive } from "@base-ui/react/select";
16
+ import { jsx, jsxs } from "react/jsx-runtime";
17
+ function Select(_a) {
18
+ var props = __objRest(_a, []);
19
+ return /* @__PURE__ */ jsx(SelectPrimitive.Root, __spreadValues({ "data-slot": "select" }, props));
20
+ }
21
+ function SelectGroup(_a) {
22
+ var props = __objRest(_a, []);
23
+ return /* @__PURE__ */ jsx(SelectPrimitive.Group, __spreadValues({ "data-slot": "select-group" }, props));
24
+ }
25
+ function SelectValue(_a) {
26
+ var props = __objRest(_a, []);
27
+ return /* @__PURE__ */ jsx(SelectPrimitive.Value, __spreadValues({ "data-slot": "select-value" }, props));
28
+ }
29
+ function SelectTrigger(_a) {
30
+ var _b = _a, {
31
+ className,
32
+ size = "default",
33
+ children
34
+ } = _b, props = __objRest(_b, [
35
+ "className",
36
+ "size",
37
+ "children"
38
+ ]);
39
+ return /* @__PURE__ */ jsxs(
40
+ SelectPrimitive.Trigger,
41
+ __spreadProps(__spreadValues({
42
+ className: cn(
43
+ "flex w-fit items-center justify-between gap-2 border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/20 data-popup-open:border-primary data-popup-open:ring-[3px] data-popup-open:ring-primary/20 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",
44
+ className
45
+ ),
46
+ "data-size": size,
47
+ "data-slot": "select-trigger"
48
+ }, props), {
49
+ children: [
50
+ children,
51
+ /* @__PURE__ */ jsx(SelectPrimitive.Icon, { className: "transition-transform duration-200 data-popup-open:rotate-180", children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: "size-4 opacity-50" }) })
52
+ ]
53
+ })
54
+ );
55
+ }
56
+ function SelectContent(_a) {
57
+ var _b = _a, {
58
+ className,
59
+ children,
60
+ style
61
+ } = _b, props = __objRest(_b, [
62
+ "className",
63
+ "children",
64
+ "style"
65
+ ]);
66
+ const themeVars = useThemeVars();
67
+ return /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsx(SelectPrimitive.Positioner, { align: "start", alignItemWithTrigger: false, sideOffset: 4, children: /* @__PURE__ */ jsxs(
68
+ SelectPrimitive.Popup,
69
+ __spreadProps(__spreadValues({
70
+ className: cn(
71
+ "relative z-50 max-h-[var(--available-height)] min-w-[8rem] overflow-x-hidden overflow-y-auto border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-ending-style:animate-out data-ending-style:fade-out-0 data-ending-style:zoom-out-95 data-ending-style:fill-mode-forwards data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95",
72
+ className
73
+ ),
74
+ "data-slot": "select-content",
75
+ style: __spreadValues(__spreadValues({}, themeVars), style)
76
+ }, props), {
77
+ children: [
78
+ /* @__PURE__ */ jsx(SelectScrollUpButton, {}),
79
+ children,
80
+ /* @__PURE__ */ jsx(SelectScrollDownButton, {})
81
+ ]
82
+ })
83
+ ) }) });
84
+ }
85
+ function SelectLabel(_a) {
86
+ var _b = _a, {
87
+ className
88
+ } = _b, props = __objRest(_b, [
89
+ "className"
90
+ ]);
91
+ return /* @__PURE__ */ jsx(
92
+ SelectPrimitive.GroupLabel,
93
+ __spreadValues({
94
+ className: cn("px-2 py-1.5 text-xs font-semibold text-muted-foreground", className),
95
+ "data-slot": "select-label"
96
+ }, props)
97
+ );
98
+ }
99
+ function SelectItem(_a) {
100
+ var _b = _a, {
101
+ className,
102
+ children
103
+ } = _b, props = __objRest(_b, [
104
+ "className",
105
+ "children"
106
+ ]);
107
+ return /* @__PURE__ */ jsxs(
108
+ SelectPrimitive.Item,
109
+ __spreadProps(__spreadValues({
110
+ className: cn(
111
+ "relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-highlighted:bg-primary/5 data-highlighted:text-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
112
+ className
113
+ ),
114
+ "data-slot": "select-item"
115
+ }, props), {
116
+ children: [
117
+ /* @__PURE__ */ jsx(
118
+ "span",
119
+ {
120
+ className: "absolute right-2 flex size-3.5 items-center justify-center",
121
+ "data-slot": "select-item-indicator",
122
+ children: /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) })
123
+ }
124
+ ),
125
+ /* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })
126
+ ]
127
+ })
128
+ );
129
+ }
130
+ function SelectSeparator(_a) {
131
+ var _b = _a, {
132
+ className
133
+ } = _b, props = __objRest(_b, [
134
+ "className"
135
+ ]);
136
+ return /* @__PURE__ */ jsx(
137
+ "div",
138
+ __spreadValues({
139
+ className: cn("pointer-events-none -mx-1 my-1 h-px bg-border", className),
140
+ "data-slot": "select-separator",
141
+ role: "separator"
142
+ }, props)
143
+ );
144
+ }
145
+ function SelectScrollUpButton(_a) {
146
+ var _b = _a, {
147
+ className
148
+ } = _b, props = __objRest(_b, [
149
+ "className"
150
+ ]);
151
+ return /* @__PURE__ */ jsx(
152
+ SelectPrimitive.ScrollUpArrow,
153
+ __spreadProps(__spreadValues({
154
+ className: cn(
155
+ "flex cursor-default items-center justify-center py-1",
156
+ className
157
+ ),
158
+ "data-slot": "select-scroll-up-button"
159
+ }, props), {
160
+ children: /* @__PURE__ */ jsx(ChevronUpIcon, { className: "size-4" })
161
+ })
162
+ );
163
+ }
164
+ function SelectScrollDownButton(_a) {
165
+ var _b = _a, {
166
+ className
167
+ } = _b, props = __objRest(_b, [
168
+ "className"
169
+ ]);
170
+ return /* @__PURE__ */ jsx(
171
+ SelectPrimitive.ScrollDownArrow,
172
+ __spreadProps(__spreadValues({
173
+ className: cn(
174
+ "flex cursor-default items-center justify-center py-1",
175
+ className
176
+ ),
177
+ "data-slot": "select-scroll-down-button"
178
+ }, props), {
179
+ children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: "size-4" })
180
+ })
181
+ );
182
+ }
183
+
184
+ export {
185
+ Select,
186
+ SelectGroup,
187
+ SelectValue,
188
+ SelectTrigger,
189
+ SelectContent,
190
+ SelectLabel,
191
+ SelectItem,
192
+ SelectSeparator,
193
+ SelectScrollUpButton,
194
+ SelectScrollDownButton
195
+ };