@karakuri-ui/react 0.2.3 → 0.3.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 (244) hide show
  1. package/README.md +0 -1
  2. package/dist/components/ui/accordion.d.mts +40 -0
  3. package/dist/components/ui/accordion.d.ts +40 -0
  4. package/dist/components/ui/accordion.js +215 -0
  5. package/dist/components/ui/accordion.js.map +1 -0
  6. package/dist/components/ui/accordion.mjs +176 -0
  7. package/dist/components/ui/accordion.mjs.map +1 -0
  8. package/dist/components/ui/alert.d.mts +38 -0
  9. package/dist/components/ui/alert.d.ts +38 -0
  10. package/dist/components/ui/alert.js +217 -0
  11. package/dist/components/ui/alert.js.map +1 -0
  12. package/dist/components/ui/alert.mjs +180 -0
  13. package/dist/components/ui/alert.mjs.map +1 -0
  14. package/dist/components/ui/avatar.d.mts +223 -0
  15. package/dist/components/ui/avatar.d.ts +223 -0
  16. package/dist/components/ui/avatar.js +245 -0
  17. package/dist/components/ui/avatar.js.map +1 -0
  18. package/dist/components/ui/avatar.mjs +204 -0
  19. package/dist/components/ui/avatar.mjs.map +1 -0
  20. package/dist/components/ui/badge.d.mts +31 -0
  21. package/dist/components/ui/badge.d.ts +31 -0
  22. package/dist/components/ui/badge.js +205 -0
  23. package/dist/components/ui/badge.js.map +1 -0
  24. package/dist/components/ui/badge.mjs +170 -0
  25. package/dist/components/ui/badge.mjs.map +1 -0
  26. package/dist/components/ui/breadcrumb.d.mts +46 -0
  27. package/dist/components/ui/breadcrumb.d.ts +46 -0
  28. package/dist/components/ui/breadcrumb.js +201 -0
  29. package/dist/components/ui/breadcrumb.js.map +1 -0
  30. package/dist/components/ui/breadcrumb.mjs +160 -0
  31. package/dist/components/ui/breadcrumb.mjs.map +1 -0
  32. package/dist/components/ui/button-group.d.mts +22 -0
  33. package/dist/components/ui/button-group.d.ts +22 -0
  34. package/dist/components/ui/button-group.js +107 -0
  35. package/dist/components/ui/button-group.js.map +1 -0
  36. package/dist/components/ui/button-group.mjs +72 -0
  37. package/dist/components/ui/button-group.mjs.map +1 -0
  38. package/dist/components/ui/button.d.mts +31 -0
  39. package/dist/components/ui/button.d.ts +31 -0
  40. package/dist/components/ui/button.js +176 -0
  41. package/dist/components/ui/button.js.map +1 -0
  42. package/dist/components/ui/button.mjs +141 -0
  43. package/dist/components/ui/button.mjs.map +1 -0
  44. package/dist/components/ui/card.d.mts +60 -0
  45. package/dist/components/ui/card.d.ts +60 -0
  46. package/dist/components/ui/card.js +361 -0
  47. package/dist/components/ui/card.js.map +1 -0
  48. package/dist/components/ui/card.mjs +319 -0
  49. package/dist/components/ui/card.mjs.map +1 -0
  50. package/dist/{chart.d.mts → components/ui/chart.d.mts} +2 -18
  51. package/dist/{chart.d.ts → components/ui/chart.d.ts} +2 -18
  52. package/dist/{chart.js → components/ui/chart.js} +30 -55
  53. package/dist/components/ui/chart.js.map +1 -0
  54. package/dist/{chart.mjs → components/ui/chart.mjs} +22 -46
  55. package/dist/components/ui/chart.mjs.map +1 -0
  56. package/dist/components/ui/checkbox.d.mts +24 -0
  57. package/dist/components/ui/checkbox.d.ts +24 -0
  58. package/dist/components/ui/checkbox.js +173 -0
  59. package/dist/components/ui/checkbox.js.map +1 -0
  60. package/dist/components/ui/checkbox.mjs +138 -0
  61. package/dist/components/ui/checkbox.mjs.map +1 -0
  62. package/dist/components/ui/divider.d.mts +27 -0
  63. package/dist/components/ui/divider.d.ts +27 -0
  64. package/dist/components/ui/divider.js +147 -0
  65. package/dist/components/ui/divider.js.map +1 -0
  66. package/dist/components/ui/divider.mjs +112 -0
  67. package/dist/components/ui/divider.mjs.map +1 -0
  68. package/dist/components/ui/drawer.d.mts +36 -0
  69. package/dist/components/ui/drawer.d.ts +36 -0
  70. package/dist/components/ui/drawer.js +211 -0
  71. package/dist/components/ui/drawer.js.map +1 -0
  72. package/dist/components/ui/drawer.mjs +165 -0
  73. package/dist/components/ui/drawer.mjs.map +1 -0
  74. package/dist/components/ui/dropdown.d.mts +34 -0
  75. package/dist/components/ui/dropdown.d.ts +34 -0
  76. package/dist/components/ui/dropdown.js +295 -0
  77. package/dist/components/ui/dropdown.js.map +1 -0
  78. package/dist/components/ui/dropdown.mjs +248 -0
  79. package/dist/components/ui/dropdown.mjs.map +1 -0
  80. package/dist/components/ui/field.d.mts +26 -0
  81. package/dist/components/ui/field.d.ts +26 -0
  82. package/dist/components/ui/field.js +141 -0
  83. package/dist/components/ui/field.js.map +1 -0
  84. package/dist/components/ui/field.mjs +103 -0
  85. package/dist/components/ui/field.mjs.map +1 -0
  86. package/dist/components/ui/icon-button.d.mts +20 -0
  87. package/dist/components/ui/icon-button.d.ts +20 -0
  88. package/dist/components/ui/icon-button.js +147 -0
  89. package/dist/components/ui/icon-button.js.map +1 -0
  90. package/dist/components/ui/icon-button.mjs +112 -0
  91. package/dist/components/ui/icon-button.mjs.map +1 -0
  92. package/dist/components/ui/index.d.mts +55 -0
  93. package/dist/components/ui/index.d.ts +55 -0
  94. package/dist/components/ui/index.js +468 -0
  95. package/dist/components/ui/index.js.map +1 -0
  96. package/dist/components/ui/index.mjs +242 -0
  97. package/dist/components/ui/index.mjs.map +1 -0
  98. package/dist/components/ui/input.d.mts +20 -0
  99. package/dist/components/ui/input.d.ts +20 -0
  100. package/dist/components/ui/input.js +250 -0
  101. package/dist/components/ui/input.js.map +1 -0
  102. package/dist/components/ui/input.mjs +215 -0
  103. package/dist/components/ui/input.mjs.map +1 -0
  104. package/dist/components/ui/metric-card.d.mts +38 -0
  105. package/dist/components/ui/metric-card.d.ts +38 -0
  106. package/dist/components/ui/metric-card.js +250 -0
  107. package/dist/components/ui/metric-card.js.map +1 -0
  108. package/dist/components/ui/metric-card.mjs +209 -0
  109. package/dist/components/ui/metric-card.mjs.map +1 -0
  110. package/dist/components/ui/modal.d.mts +47 -0
  111. package/dist/components/ui/modal.d.ts +47 -0
  112. package/dist/components/ui/modal.js +371 -0
  113. package/dist/components/ui/modal.js.map +1 -0
  114. package/dist/components/ui/modal.mjs +313 -0
  115. package/dist/components/ui/modal.mjs.map +1 -0
  116. package/dist/components/ui/navigation-menu.d.mts +120 -0
  117. package/dist/components/ui/navigation-menu.d.ts +120 -0
  118. package/dist/components/ui/navigation-menu.js +521 -0
  119. package/dist/components/ui/navigation-menu.js.map +1 -0
  120. package/dist/components/ui/navigation-menu.mjs +478 -0
  121. package/dist/components/ui/navigation-menu.mjs.map +1 -0
  122. package/dist/components/ui/pagination.d.mts +113 -0
  123. package/dist/components/ui/pagination.d.ts +113 -0
  124. package/dist/components/ui/pagination.js +484 -0
  125. package/dist/components/ui/pagination.js.map +1 -0
  126. package/dist/components/ui/pagination.mjs +438 -0
  127. package/dist/components/ui/pagination.mjs.map +1 -0
  128. package/dist/components/ui/popover.d.mts +29 -0
  129. package/dist/components/ui/popover.d.ts +29 -0
  130. package/dist/components/ui/popover.js +165 -0
  131. package/dist/components/ui/popover.js.map +1 -0
  132. package/dist/components/ui/popover.mjs +124 -0
  133. package/dist/components/ui/popover.mjs.map +1 -0
  134. package/dist/components/ui/progress.d.mts +35 -0
  135. package/dist/components/ui/progress.d.ts +35 -0
  136. package/dist/components/ui/progress.js +194 -0
  137. package/dist/components/ui/progress.js.map +1 -0
  138. package/dist/components/ui/progress.mjs +159 -0
  139. package/dist/components/ui/progress.mjs.map +1 -0
  140. package/dist/components/ui/radio-group.d.mts +35 -0
  141. package/dist/components/ui/radio-group.d.ts +35 -0
  142. package/dist/components/ui/radio-group.js +174 -0
  143. package/dist/components/ui/radio-group.js.map +1 -0
  144. package/dist/components/ui/radio-group.mjs +137 -0
  145. package/dist/components/ui/radio-group.mjs.map +1 -0
  146. package/dist/components/ui/segmented.d.mts +25 -0
  147. package/dist/components/ui/segmented.d.ts +25 -0
  148. package/dist/components/ui/segmented.js +238 -0
  149. package/dist/components/ui/segmented.js.map +1 -0
  150. package/dist/components/ui/segmented.mjs +201 -0
  151. package/dist/components/ui/segmented.mjs.map +1 -0
  152. package/dist/components/ui/select.d.mts +20 -0
  153. package/dist/components/ui/select.d.ts +20 -0
  154. package/dist/components/ui/select.js +308 -0
  155. package/dist/components/ui/select.js.map +1 -0
  156. package/dist/components/ui/select.mjs +267 -0
  157. package/dist/components/ui/select.mjs.map +1 -0
  158. package/dist/components/ui/skeleton.d.mts +26 -0
  159. package/dist/components/ui/skeleton.d.ts +26 -0
  160. package/dist/components/ui/skeleton.js +144 -0
  161. package/dist/components/ui/skeleton.js.map +1 -0
  162. package/dist/components/ui/skeleton.mjs +109 -0
  163. package/dist/components/ui/skeleton.mjs.map +1 -0
  164. package/dist/components/ui/slider.d.mts +38 -0
  165. package/dist/components/ui/slider.d.ts +38 -0
  166. package/dist/components/ui/slider.js +180 -0
  167. package/dist/components/ui/slider.js.map +1 -0
  168. package/dist/components/ui/slider.mjs +145 -0
  169. package/dist/components/ui/slider.mjs.map +1 -0
  170. package/dist/components/ui/spinner.d.mts +23 -0
  171. package/dist/components/ui/spinner.d.ts +23 -0
  172. package/dist/components/ui/spinner.js +471 -0
  173. package/dist/components/ui/spinner.js.map +1 -0
  174. package/dist/components/ui/spinner.mjs +436 -0
  175. package/dist/components/ui/spinner.mjs.map +1 -0
  176. package/dist/components/ui/switch.d.mts +22 -0
  177. package/dist/components/ui/switch.d.ts +22 -0
  178. package/dist/components/ui/switch.js +173 -0
  179. package/dist/components/ui/switch.js.map +1 -0
  180. package/dist/components/ui/switch.mjs +138 -0
  181. package/dist/components/ui/switch.mjs.map +1 -0
  182. package/dist/components/ui/table.d.mts +60 -0
  183. package/dist/components/ui/table.d.ts +60 -0
  184. package/dist/components/ui/table.js +231 -0
  185. package/dist/components/ui/table.js.map +1 -0
  186. package/dist/components/ui/table.mjs +190 -0
  187. package/dist/components/ui/table.mjs.map +1 -0
  188. package/dist/components/ui/tabs.d.mts +31 -0
  189. package/dist/components/ui/tabs.d.ts +31 -0
  190. package/dist/components/ui/tabs.js +233 -0
  191. package/dist/components/ui/tabs.js.map +1 -0
  192. package/dist/components/ui/tabs.mjs +194 -0
  193. package/dist/components/ui/tabs.mjs.map +1 -0
  194. package/dist/components/ui/textarea.d.mts +19 -0
  195. package/dist/components/ui/textarea.d.ts +19 -0
  196. package/dist/components/ui/textarea.js +181 -0
  197. package/dist/components/ui/textarea.js.map +1 -0
  198. package/dist/components/ui/textarea.mjs +146 -0
  199. package/dist/components/ui/textarea.mjs.map +1 -0
  200. package/dist/components/ui/toast.d.mts +93 -0
  201. package/dist/components/ui/toast.d.ts +93 -0
  202. package/dist/components/ui/toast.js +429 -0
  203. package/dist/components/ui/toast.js.map +1 -0
  204. package/dist/components/ui/toast.mjs +393 -0
  205. package/dist/components/ui/toast.mjs.map +1 -0
  206. package/dist/components/ui/toggle-group.d.mts +42 -0
  207. package/dist/components/ui/toggle-group.d.ts +42 -0
  208. package/dist/components/ui/toggle-group.js +183 -0
  209. package/dist/components/ui/toggle-group.js.map +1 -0
  210. package/dist/components/ui/toggle-group.mjs +146 -0
  211. package/dist/components/ui/toggle-group.mjs.map +1 -0
  212. package/dist/components/ui/toggle.d.mts +19 -0
  213. package/dist/components/ui/toggle.d.ts +19 -0
  214. package/dist/components/ui/toggle.js +194 -0
  215. package/dist/components/ui/toggle.js.map +1 -0
  216. package/dist/components/ui/toggle.mjs +159 -0
  217. package/dist/components/ui/toggle.mjs.map +1 -0
  218. package/dist/components/ui/tooltip.d.mts +26 -0
  219. package/dist/components/ui/tooltip.d.ts +26 -0
  220. package/dist/components/ui/tooltip.js +128 -0
  221. package/dist/components/ui/tooltip.js.map +1 -0
  222. package/dist/components/ui/tooltip.mjs +88 -0
  223. package/dist/components/ui/tooltip.mjs.map +1 -0
  224. package/dist/lib/code-generator.d.mts +60 -0
  225. package/dist/lib/code-generator.d.ts +60 -0
  226. package/dist/lib/code-generator.js +224 -0
  227. package/dist/lib/code-generator.js.map +1 -0
  228. package/dist/lib/code-generator.mjs +159 -0
  229. package/dist/lib/code-generator.mjs.map +1 -0
  230. package/dist/lib/utils.d.mts +10 -0
  231. package/dist/lib/utils.d.ts +10 -0
  232. package/dist/lib/utils.js +33 -0
  233. package/dist/lib/utils.js.map +1 -0
  234. package/dist/lib/utils.mjs +9 -0
  235. package/dist/lib/utils.mjs.map +1 -0
  236. package/package.json +11 -11
  237. package/dist/chart.js.map +0 -1
  238. package/dist/chart.mjs.map +0 -1
  239. package/dist/index.d.mts +0 -1636
  240. package/dist/index.d.ts +0 -1636
  241. package/dist/index.js +0 -7291
  242. package/dist/index.js.map +0 -1
  243. package/dist/index.mjs +0 -7048
  244. package/dist/index.mjs.map +0 -1
@@ -0,0 +1,173 @@
1
+ "use strict";
2
+ "use client";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, { get: all[name], enumerable: true });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+ var checkbox_exports = {};
31
+ __export(checkbox_exports, {
32
+ Checkbox: () => Checkbox,
33
+ checkboxVariants: () => checkboxVariants
34
+ });
35
+ module.exports = __toCommonJS(checkbox_exports);
36
+ var React = __toESM(require("react"));
37
+ var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"));
38
+ var import_class_variance_authority = require("class-variance-authority");
39
+ var import_utils = require("../../lib/utils");
40
+ var import_field = require("./field");
41
+ const checkboxColorMap = {
42
+ default: "data-[state=checked]:bg-foreground data-[state=checked]:border-foreground data-[state=checked]:text-background data-[state=indeterminate]:bg-foreground data-[state=indeterminate]:border-foreground data-[state=indeterminate]:text-background",
43
+ primary: "data-[state=checked]:bg-primary data-[state=checked]:border-primary data-[state=checked]:text-primary-foreground data-[state=indeterminate]:bg-primary data-[state=indeterminate]:border-primary data-[state=indeterminate]:text-primary-foreground"
44
+ };
45
+ const checkboxVariants = (0, import_class_variance_authority.cva)(
46
+ [
47
+ "peer relative shrink-0 border-border-form hover:border-border-form-strong transition-all duration-micro ease-out",
48
+ "focus-visible:focus-ring",
49
+ "disabled:cursor-not-allowed disabled:opacity-50",
50
+ // Transparent hit area expansion via ::after
51
+ "after:absolute after:content-['']"
52
+ ].join(" "),
53
+ {
54
+ variants: {
55
+ size: {
56
+ sm: "w-3.5 h-3.5 after:-inset-[5px]",
57
+ // 14px box → 24px click
58
+ default: "w-4 h-4 after:-inset-2",
59
+ // 16px box → 32px click
60
+ lg: "w-5 h-5 after:-inset-2"
61
+ // 20px box → 36px click
62
+ },
63
+ radius: {
64
+ none: "rounded-none",
65
+ // 0px — sharp square
66
+ sm: "rounded-sm",
67
+ // 2px — default checkbox style
68
+ md: "rounded"
69
+ // 4px — softer corners
70
+ },
71
+ weight: {
72
+ thin: "border",
73
+ // 1px
74
+ bold: "border-2"
75
+ // 2px
76
+ }
77
+ },
78
+ defaultVariants: {
79
+ size: "default",
80
+ radius: "sm",
81
+ weight: "bold"
82
+ }
83
+ }
84
+ );
85
+ const checkIconSizes = {
86
+ sm: "w-2.5 h-2.5",
87
+ // 10px in 14px box
88
+ default: "w-3 h-3",
89
+ // 12px in 16px box
90
+ lg: "icon-xs"
91
+ // 14px in 20px box
92
+ };
93
+ const labelSizes = {
94
+ sm: "text-xs",
95
+ // 12px
96
+ default: "text-md",
97
+ // 14px
98
+ lg: "text-base"
99
+ // 16px
100
+ };
101
+ const gapSizes = {
102
+ sm: "gap-1.5",
103
+ default: "gap-2",
104
+ lg: "gap-2.5"
105
+ };
106
+ const Checkbox = React.forwardRef(({ className, size, radius, weight, color = "default", label, disabled, id, ...props }, ref) => {
107
+ const fieldContext = (0, import_field.useFieldContext)();
108
+ const resolvedSize = size || "default";
109
+ const resolvedDisabled = disabled ?? fieldContext?.disabled;
110
+ const generatedId = React.useId();
111
+ const checkboxId = id ?? fieldContext?.id ?? generatedId;
112
+ const checkbox = /* @__PURE__ */ React.createElement(
113
+ CheckboxPrimitive.Root,
114
+ {
115
+ ref,
116
+ id: checkboxId,
117
+ disabled: resolvedDisabled,
118
+ className: (0, import_utils.cn)(
119
+ checkboxVariants({ size, radius, weight }),
120
+ checkboxColorMap[color],
121
+ className
122
+ ),
123
+ ...props
124
+ },
125
+ /* @__PURE__ */ React.createElement(CheckboxPrimitive.Indicator, { className: "flex items-center justify-center animate-checkbox-enter" }, /* @__PURE__ */ React.createElement(CheckIcon, { className: checkIconSizes[resolvedSize] }))
126
+ );
127
+ if (!label) return checkbox;
128
+ return /* @__PURE__ */ React.createElement("div", { className: (0, import_utils.cn)("group flex items-center", gapSizes[resolvedSize]) }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center" }, checkbox), /* @__PURE__ */ React.createElement(
129
+ "label",
130
+ {
131
+ htmlFor: checkboxId,
132
+ className: (0, import_utils.cn)(
133
+ labelSizes[resolvedSize],
134
+ "text-text-muted cursor-pointer select-none transition-colors duration-micro",
135
+ "group-hover:text-foreground",
136
+ resolvedDisabled && "opacity-50 cursor-not-allowed"
137
+ )
138
+ },
139
+ label
140
+ ));
141
+ });
142
+ Checkbox.displayName = "Checkbox";
143
+ function CheckIcon({ className }) {
144
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
145
+ "svg",
146
+ {
147
+ className: (0, import_utils.cn)(className, "hidden [[data-state=checked]_&]:block"),
148
+ fill: "none",
149
+ viewBox: "0 0 24 24",
150
+ stroke: "currentColor",
151
+ strokeWidth: 3,
152
+ "aria-hidden": "true"
153
+ },
154
+ /* @__PURE__ */ React.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" })
155
+ ), /* @__PURE__ */ React.createElement(
156
+ "svg",
157
+ {
158
+ className: (0, import_utils.cn)(className, "hidden [[data-state=indeterminate]_&]:block"),
159
+ fill: "none",
160
+ viewBox: "0 0 24 24",
161
+ stroke: "currentColor",
162
+ strokeWidth: 3,
163
+ "aria-hidden": "true"
164
+ },
165
+ /* @__PURE__ */ React.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 12h14" })
166
+ ));
167
+ }
168
+ // Annotate the CommonJS export names for ESM import in node:
169
+ 0 && (module.exports = {
170
+ Checkbox,
171
+ checkboxVariants
172
+ });
173
+ //# sourceMappingURL=checkbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/ui/checkbox.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { cn } from '../../lib/utils'\nimport { useFieldContext } from './field'\n\n// Color maps for checked/indeterminate state\nconst checkboxColorMap = {\n default: 'data-[state=checked]:bg-foreground data-[state=checked]:border-foreground data-[state=checked]:text-background data-[state=indeterminate]:bg-foreground data-[state=indeterminate]:border-foreground data-[state=indeterminate]:text-background',\n primary: 'data-[state=checked]:bg-primary data-[state=checked]:border-primary data-[state=checked]:text-primary-foreground data-[state=indeterminate]:bg-primary data-[state=indeterminate]:border-primary data-[state=indeterminate]:text-primary-foreground',\n} as const\n\nexport type CheckboxColor = keyof typeof checkboxColorMap\n\n// Checkbox box variants\nconst checkboxVariants = cva(\n [\n 'peer relative shrink-0 border-border-form hover:border-border-form-strong transition-all duration-micro ease-out',\n 'focus-visible:focus-ring',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n // Transparent hit area expansion via ::after\n \"after:absolute after:content-['']\",\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'w-3.5 h-3.5 after:-inset-[5px]', // 14px box → 24px click\n default: 'w-4 h-4 after:-inset-2', // 16px box → 32px click\n lg: 'w-5 h-5 after:-inset-2', // 20px box → 36px click\n },\n radius: {\n none: 'rounded-none', // 0px — sharp square\n sm: 'rounded-sm', // 2px — default checkbox style\n md: 'rounded', // 4px — softer corners\n },\n weight: {\n thin: 'border', // 1px\n bold: 'border-2', // 2px\n },\n },\n defaultVariants: {\n size: 'default',\n radius: 'sm',\n weight: 'bold',\n },\n }\n)\n\n// Check icon sizes per checkbox size\nconst checkIconSizes = {\n sm: 'w-2.5 h-2.5', // 10px in 14px box\n default: 'w-3 h-3', // 12px in 16px box\n lg: 'icon-xs', // 14px in 20px box\n}\n\n// Label font sizes per checkbox size\nconst labelSizes = {\n sm: 'text-xs', // 12px\n default: 'text-md', // 14px\n lg: 'text-base', // 16px\n}\n\n// Gap between checkbox and label\nconst gapSizes = {\n sm: 'gap-1.5',\n default: 'gap-2',\n lg: 'gap-2.5',\n}\n\nexport interface CheckboxProps\n extends Omit<React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>, 'children'>,\n VariantProps<typeof checkboxVariants> {\n /** Checked state color */\n color?: CheckboxColor\n label?: string\n radius?: 'none' | 'sm' | 'md'\n}\n\nconst Checkbox = React.forwardRef<\n React.ElementRef<typeof CheckboxPrimitive.Root>,\n CheckboxProps\n>(({ className, size, radius, weight, color = 'default', label, disabled, id, ...props }, ref) => {\n const fieldContext = useFieldContext()\n const resolvedSize = size || 'default'\n const resolvedDisabled = disabled ?? fieldContext?.disabled\n const generatedId = React.useId()\n const checkboxId = id ?? fieldContext?.id ?? generatedId\n\n const checkbox = (\n <CheckboxPrimitive.Root\n ref={ref}\n id={checkboxId}\n disabled={resolvedDisabled}\n className={cn(\n checkboxVariants({ size, radius, weight }),\n checkboxColorMap[color],\n className\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator className=\"flex items-center justify-center animate-checkbox-enter\">\n <CheckIcon className={checkIconSizes[resolvedSize]} />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n )\n\n if (!label) return checkbox\n\n return (\n <div className={cn('group flex items-center', gapSizes[resolvedSize])}>\n <div className=\"flex items-center\">\n {checkbox}\n </div>\n <label\n htmlFor={checkboxId}\n className={cn(\n labelSizes[resolvedSize],\n 'text-text-muted cursor-pointer select-none transition-colors duration-micro',\n 'group-hover:text-foreground',\n resolvedDisabled && 'opacity-50 cursor-not-allowed'\n )}\n >\n {label}\n </label>\n </div>\n )\n})\nCheckbox.displayName = 'Checkbox'\n\n// Check icon — renders ✓ for checked, — for indeterminate\nfunction CheckIcon({ className }: { className?: string }) {\n return (\n <>\n {/* Check mark (shown when data-state=checked on parent Indicator) */}\n <svg\n className={cn(className, 'hidden [[data-state=checked]_&]:block')}\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n strokeWidth={3}\n aria-hidden=\"true\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M5 13l4 4L19 7\" />\n </svg>\n {/* Dash (shown when data-state=indeterminate on parent Indicator) */}\n <svg\n className={cn(className, 'hidden [[data-state=indeterminate]_&]:block')}\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n strokeWidth={3}\n aria-hidden=\"true\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M5 12h14\" />\n </svg>\n </>\n )\n}\n\nexport { Checkbox, checkboxVariants }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA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
3
+ import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
4
+ import { cva } from "class-variance-authority";
5
+ import { cn } from "../../lib/utils";
6
+ import { useFieldContext } from "./field";
7
+ const checkboxColorMap = {
8
+ default: "data-[state=checked]:bg-foreground data-[state=checked]:border-foreground data-[state=checked]:text-background data-[state=indeterminate]:bg-foreground data-[state=indeterminate]:border-foreground data-[state=indeterminate]:text-background",
9
+ primary: "data-[state=checked]:bg-primary data-[state=checked]:border-primary data-[state=checked]:text-primary-foreground data-[state=indeterminate]:bg-primary data-[state=indeterminate]:border-primary data-[state=indeterminate]:text-primary-foreground"
10
+ };
11
+ const checkboxVariants = cva(
12
+ [
13
+ "peer relative shrink-0 border-border-form hover:border-border-form-strong transition-all duration-micro ease-out",
14
+ "focus-visible:focus-ring",
15
+ "disabled:cursor-not-allowed disabled:opacity-50",
16
+ // Transparent hit area expansion via ::after
17
+ "after:absolute after:content-['']"
18
+ ].join(" "),
19
+ {
20
+ variants: {
21
+ size: {
22
+ sm: "w-3.5 h-3.5 after:-inset-[5px]",
23
+ // 14px box → 24px click
24
+ default: "w-4 h-4 after:-inset-2",
25
+ // 16px box → 32px click
26
+ lg: "w-5 h-5 after:-inset-2"
27
+ // 20px box → 36px click
28
+ },
29
+ radius: {
30
+ none: "rounded-none",
31
+ // 0px — sharp square
32
+ sm: "rounded-sm",
33
+ // 2px — default checkbox style
34
+ md: "rounded"
35
+ // 4px — softer corners
36
+ },
37
+ weight: {
38
+ thin: "border",
39
+ // 1px
40
+ bold: "border-2"
41
+ // 2px
42
+ }
43
+ },
44
+ defaultVariants: {
45
+ size: "default",
46
+ radius: "sm",
47
+ weight: "bold"
48
+ }
49
+ }
50
+ );
51
+ const checkIconSizes = {
52
+ sm: "w-2.5 h-2.5",
53
+ // 10px in 14px box
54
+ default: "w-3 h-3",
55
+ // 12px in 16px box
56
+ lg: "icon-xs"
57
+ // 14px in 20px box
58
+ };
59
+ const labelSizes = {
60
+ sm: "text-xs",
61
+ // 12px
62
+ default: "text-md",
63
+ // 14px
64
+ lg: "text-base"
65
+ // 16px
66
+ };
67
+ const gapSizes = {
68
+ sm: "gap-1.5",
69
+ default: "gap-2",
70
+ lg: "gap-2.5"
71
+ };
72
+ const Checkbox = React.forwardRef(({ className, size, radius, weight, color = "default", label, disabled, id, ...props }, ref) => {
73
+ const fieldContext = useFieldContext();
74
+ const resolvedSize = size || "default";
75
+ const resolvedDisabled = disabled ?? fieldContext?.disabled;
76
+ const generatedId = React.useId();
77
+ const checkboxId = id ?? fieldContext?.id ?? generatedId;
78
+ const checkbox = /* @__PURE__ */ React.createElement(
79
+ CheckboxPrimitive.Root,
80
+ {
81
+ ref,
82
+ id: checkboxId,
83
+ disabled: resolvedDisabled,
84
+ className: cn(
85
+ checkboxVariants({ size, radius, weight }),
86
+ checkboxColorMap[color],
87
+ className
88
+ ),
89
+ ...props
90
+ },
91
+ /* @__PURE__ */ React.createElement(CheckboxPrimitive.Indicator, { className: "flex items-center justify-center animate-checkbox-enter" }, /* @__PURE__ */ React.createElement(CheckIcon, { className: checkIconSizes[resolvedSize] }))
92
+ );
93
+ if (!label) return checkbox;
94
+ return /* @__PURE__ */ React.createElement("div", { className: cn("group flex items-center", gapSizes[resolvedSize]) }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center" }, checkbox), /* @__PURE__ */ React.createElement(
95
+ "label",
96
+ {
97
+ htmlFor: checkboxId,
98
+ className: cn(
99
+ labelSizes[resolvedSize],
100
+ "text-text-muted cursor-pointer select-none transition-colors duration-micro",
101
+ "group-hover:text-foreground",
102
+ resolvedDisabled && "opacity-50 cursor-not-allowed"
103
+ )
104
+ },
105
+ label
106
+ ));
107
+ });
108
+ Checkbox.displayName = "Checkbox";
109
+ function CheckIcon({ className }) {
110
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
111
+ "svg",
112
+ {
113
+ className: cn(className, "hidden [[data-state=checked]_&]:block"),
114
+ fill: "none",
115
+ viewBox: "0 0 24 24",
116
+ stroke: "currentColor",
117
+ strokeWidth: 3,
118
+ "aria-hidden": "true"
119
+ },
120
+ /* @__PURE__ */ React.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" })
121
+ ), /* @__PURE__ */ React.createElement(
122
+ "svg",
123
+ {
124
+ className: cn(className, "hidden [[data-state=indeterminate]_&]:block"),
125
+ fill: "none",
126
+ viewBox: "0 0 24 24",
127
+ stroke: "currentColor",
128
+ strokeWidth: 3,
129
+ "aria-hidden": "true"
130
+ },
131
+ /* @__PURE__ */ React.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 12h14" })
132
+ ));
133
+ }
134
+ export {
135
+ Checkbox,
136
+ checkboxVariants
137
+ };
138
+ //# sourceMappingURL=checkbox.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/ui/checkbox.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { cn } from '../../lib/utils'\nimport { useFieldContext } from './field'\n\n// Color maps for checked/indeterminate state\nconst checkboxColorMap = {\n default: 'data-[state=checked]:bg-foreground data-[state=checked]:border-foreground data-[state=checked]:text-background data-[state=indeterminate]:bg-foreground data-[state=indeterminate]:border-foreground data-[state=indeterminate]:text-background',\n primary: 'data-[state=checked]:bg-primary data-[state=checked]:border-primary data-[state=checked]:text-primary-foreground data-[state=indeterminate]:bg-primary data-[state=indeterminate]:border-primary data-[state=indeterminate]:text-primary-foreground',\n} as const\n\nexport type CheckboxColor = keyof typeof checkboxColorMap\n\n// Checkbox box variants\nconst checkboxVariants = cva(\n [\n 'peer relative shrink-0 border-border-form hover:border-border-form-strong transition-all duration-micro ease-out',\n 'focus-visible:focus-ring',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n // Transparent hit area expansion via ::after\n \"after:absolute after:content-['']\",\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'w-3.5 h-3.5 after:-inset-[5px]', // 14px box → 24px click\n default: 'w-4 h-4 after:-inset-2', // 16px box → 32px click\n lg: 'w-5 h-5 after:-inset-2', // 20px box → 36px click\n },\n radius: {\n none: 'rounded-none', // 0px — sharp square\n sm: 'rounded-sm', // 2px — default checkbox style\n md: 'rounded', // 4px — softer corners\n },\n weight: {\n thin: 'border', // 1px\n bold: 'border-2', // 2px\n },\n },\n defaultVariants: {\n size: 'default',\n radius: 'sm',\n weight: 'bold',\n },\n }\n)\n\n// Check icon sizes per checkbox size\nconst checkIconSizes = {\n sm: 'w-2.5 h-2.5', // 10px in 14px box\n default: 'w-3 h-3', // 12px in 16px box\n lg: 'icon-xs', // 14px in 20px box\n}\n\n// Label font sizes per checkbox size\nconst labelSizes = {\n sm: 'text-xs', // 12px\n default: 'text-md', // 14px\n lg: 'text-base', // 16px\n}\n\n// Gap between checkbox and label\nconst gapSizes = {\n sm: 'gap-1.5',\n default: 'gap-2',\n lg: 'gap-2.5',\n}\n\nexport interface CheckboxProps\n extends Omit<React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>, 'children'>,\n VariantProps<typeof checkboxVariants> {\n /** Checked state color */\n color?: CheckboxColor\n label?: string\n radius?: 'none' | 'sm' | 'md'\n}\n\nconst Checkbox = React.forwardRef<\n React.ElementRef<typeof CheckboxPrimitive.Root>,\n CheckboxProps\n>(({ className, size, radius, weight, color = 'default', label, disabled, id, ...props }, ref) => {\n const fieldContext = useFieldContext()\n const resolvedSize = size || 'default'\n const resolvedDisabled = disabled ?? fieldContext?.disabled\n const generatedId = React.useId()\n const checkboxId = id ?? fieldContext?.id ?? generatedId\n\n const checkbox = (\n <CheckboxPrimitive.Root\n ref={ref}\n id={checkboxId}\n disabled={resolvedDisabled}\n className={cn(\n checkboxVariants({ size, radius, weight }),\n checkboxColorMap[color],\n className\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator className=\"flex items-center justify-center animate-checkbox-enter\">\n <CheckIcon className={checkIconSizes[resolvedSize]} />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n )\n\n if (!label) return checkbox\n\n return (\n <div className={cn('group flex items-center', gapSizes[resolvedSize])}>\n <div className=\"flex items-center\">\n {checkbox}\n </div>\n <label\n htmlFor={checkboxId}\n className={cn(\n labelSizes[resolvedSize],\n 'text-text-muted cursor-pointer select-none transition-colors duration-micro',\n 'group-hover:text-foreground',\n resolvedDisabled && 'opacity-50 cursor-not-allowed'\n )}\n >\n {label}\n </label>\n </div>\n )\n})\nCheckbox.displayName = 'Checkbox'\n\n// Check icon — renders ✓ for checked, — for indeterminate\nfunction CheckIcon({ className }: { className?: string }) {\n return (\n <>\n {/* Check mark (shown when data-state=checked on parent Indicator) */}\n <svg\n className={cn(className, 'hidden [[data-state=checked]_&]:block')}\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n strokeWidth={3}\n aria-hidden=\"true\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M5 13l4 4L19 7\" />\n </svg>\n {/* Dash (shown when data-state=indeterminate on parent Indicator) */}\n <svg\n className={cn(className, 'hidden [[data-state=indeterminate]_&]:block')}\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n strokeWidth={3}\n aria-hidden=\"true\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M5 12h14\" />\n </svg>\n </>\n )\n}\n\nexport { Checkbox, checkboxVariants }\n"],"mappings":";AAEA,YAAY,WAAW;AACvB,YAAY,uBAAuB;AACnC,SAAS,WAA8B;AACvC,SAAS,UAAU;AACnB,SAAS,uBAAuB;AAGhC,MAAM,mBAAmB;AAAA,EACvB,SAAS;AAAA,EACT,SAAS;AACX;AAKA,MAAM,mBAAmB;AAAA,EACvB;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IAEA;AAAA,EACF,EAAE,KAAK,GAAG;AAAA,EACV;AAAA,IACE,UAAU;AA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AW,eAAe,YAAY,GAAG,CACtD;AAAA,EACF;AAGF,MAAI,CAAC,MAAO,QAAO;AAEnB,SACE,oCAAC,SAAI,WAAW,GAAG,2BAA2B,SAAS,YAAY,CAAC,KAClE,oCAAC,SAAI,WAAU,uBACZ,QACH,GACA;AAAA,IAAC;AAAA;AAAA,MACC,SAAS;AAAA,MACT,WAAW;AAAA,QACT,WAAW,YAAY;AAAA,QACvB;AAAA,QACA;AAAA,QACA,oBAAoB;AAAA,MACtB;AAAA;AAAA,IAEC;AAAA,EACH,CACF;AAEJ,CAAC;AACD,SAAS,cAAc;AAGvB,SAAS,UAAU,EAAE,UAAU,GAA2B;AACxD,SACE,0DAEE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,WAAW,uCAAuC;AAAA,MAChE,MAAK;AAAA,MACL,SAAQ;AAAA,MACR,QAAO;AAAA,MACP,aAAa;AAAA,MACb,eAAY;AAAA;AAAA,IAEZ,oCAAC,UAAK,eAAc,SAAQ,gBAAe,SAAQ,GAAE,kBAAiB;AAAA,EACxE,GAEA;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,WAAW,6CAA6C;AAAA,MACtE,MAAK;AAAA,MACL,SAAQ;AAAA,MACR,QAAO;AAAA,MACP,aAAa;AAAA,MACb,eAAY;AAAA;AAAA,IAEZ,oCAAC,UAAK,eAAc,SAAQ,gBAAe,SAAQ,GAAE,YAAW;AAAA,EAClE,CACF;AAEJ;","names":[]}
@@ -0,0 +1,27 @@
1
+ import * as class_variance_authority_types from 'class-variance-authority/types';
2
+ import * as React from 'react';
3
+ import * as SeparatorPrimitive from '@radix-ui/react-separator';
4
+
5
+ declare const dividerVariants: (props?: ({
6
+ orientation?: "horizontal" | "vertical" | null | undefined;
7
+ variant?: "solid" | "dashed" | "dotted" | null | undefined;
8
+ color?: "default" | "strong" | "muted" | null | undefined;
9
+ spacing?: "default" | "sm" | "lg" | "md" | null | undefined;
10
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
11
+ interface DividerProps extends Omit<React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>, 'children' | 'color' | 'orientation'> {
12
+ /** Direction of the divider */
13
+ orientation?: 'horizontal' | 'vertical';
14
+ /** Line style */
15
+ variant?: 'solid' | 'dashed' | 'dotted';
16
+ /** Line color intensity */
17
+ color?: 'default' | 'muted' | 'strong';
18
+ /** Spacing around the divider */
19
+ spacing?: 'sm' | 'md' | 'default' | 'lg';
20
+ /** Content to display on the divider line (horizontal only) */
21
+ label?: React.ReactNode;
22
+ /** Label position along the line */
23
+ labelPosition?: 'left' | 'center' | 'right';
24
+ }
25
+ declare const Divider: React.ForwardRefExoticComponent<DividerProps & React.RefAttributes<HTMLDivElement>>;
26
+
27
+ export { Divider, type DividerProps, dividerVariants };
@@ -0,0 +1,27 @@
1
+ import * as class_variance_authority_types from 'class-variance-authority/types';
2
+ import * as React from 'react';
3
+ import * as SeparatorPrimitive from '@radix-ui/react-separator';
4
+
5
+ declare const dividerVariants: (props?: ({
6
+ orientation?: "horizontal" | "vertical" | null | undefined;
7
+ variant?: "solid" | "dashed" | "dotted" | null | undefined;
8
+ color?: "default" | "strong" | "muted" | null | undefined;
9
+ spacing?: "default" | "sm" | "lg" | "md" | null | undefined;
10
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
11
+ interface DividerProps extends Omit<React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>, 'children' | 'color' | 'orientation'> {
12
+ /** Direction of the divider */
13
+ orientation?: 'horizontal' | 'vertical';
14
+ /** Line style */
15
+ variant?: 'solid' | 'dashed' | 'dotted';
16
+ /** Line color intensity */
17
+ color?: 'default' | 'muted' | 'strong';
18
+ /** Spacing around the divider */
19
+ spacing?: 'sm' | 'md' | 'default' | 'lg';
20
+ /** Content to display on the divider line (horizontal only) */
21
+ label?: React.ReactNode;
22
+ /** Label position along the line */
23
+ labelPosition?: 'left' | 'center' | 'right';
24
+ }
25
+ declare const Divider: React.ForwardRefExoticComponent<DividerProps & React.RefAttributes<HTMLDivElement>>;
26
+
27
+ export { Divider, type DividerProps, dividerVariants };
@@ -0,0 +1,147 @@
1
+ "use strict";
2
+ "use client";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, { get: all[name], enumerable: true });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+ var divider_exports = {};
31
+ __export(divider_exports, {
32
+ Divider: () => Divider,
33
+ dividerVariants: () => dividerVariants
34
+ });
35
+ module.exports = __toCommonJS(divider_exports);
36
+ var React = __toESM(require("react"));
37
+ var SeparatorPrimitive = __toESM(require("@radix-ui/react-separator"));
38
+ var import_class_variance_authority = require("class-variance-authority");
39
+ var import_utils = require("../../lib/utils");
40
+ const dividerVariants = (0, import_class_variance_authority.cva)("shrink-0", {
41
+ variants: {
42
+ orientation: {
43
+ horizontal: "w-full",
44
+ vertical: "h-full self-stretch"
45
+ },
46
+ variant: {
47
+ solid: "border-solid",
48
+ dashed: "border-dashed",
49
+ dotted: "border-dotted"
50
+ },
51
+ color: {
52
+ default: "border-border-subtle",
53
+ muted: "border-border-subtle",
54
+ strong: "border-border-strong"
55
+ },
56
+ spacing: {
57
+ sm: "",
58
+ md: "",
59
+ default: "",
60
+ lg: ""
61
+ }
62
+ },
63
+ compoundVariants: [
64
+ // Horizontal spacing
65
+ { orientation: "horizontal", spacing: "sm", className: "my-2" },
66
+ { orientation: "horizontal", spacing: "md", className: "my-3" },
67
+ { orientation: "horizontal", spacing: "default", className: "my-4" },
68
+ { orientation: "horizontal", spacing: "lg", className: "my-8" },
69
+ // Vertical spacing
70
+ { orientation: "vertical", spacing: "sm", className: "mx-2" },
71
+ { orientation: "vertical", spacing: "md", className: "mx-3" },
72
+ { orientation: "vertical", spacing: "default", className: "mx-4" },
73
+ { orientation: "vertical", spacing: "lg", className: "mx-8" },
74
+ // Horizontal line style (border-top)
75
+ { orientation: "horizontal", className: "border-t border-l-0" },
76
+ // Vertical line style (border-left)
77
+ { orientation: "vertical", className: "border-l border-t-0" }
78
+ ],
79
+ defaultVariants: {
80
+ orientation: "horizontal",
81
+ variant: "solid",
82
+ color: "default",
83
+ spacing: "default"
84
+ }
85
+ });
86
+ const Divider = React.forwardRef(({
87
+ className,
88
+ orientation = "horizontal",
89
+ variant = "solid",
90
+ color = "default",
91
+ spacing = "default",
92
+ label,
93
+ labelPosition = "center",
94
+ decorative = true,
95
+ ...props
96
+ }, ref) => {
97
+ const lineClass = (0, import_utils.cn)(
98
+ "flex-1",
99
+ variant === "dashed" ? "border-dashed" : variant === "dotted" ? "border-dotted" : "border-solid",
100
+ color === "muted" ? "border-border-subtle" : color === "strong" ? "border-border-strong" : "border-border-subtle",
101
+ "border-t"
102
+ );
103
+ const spacingClass = spacing === "sm" ? "my-2" : spacing === "md" ? "my-3" : spacing === "lg" ? "my-8" : "my-4";
104
+ if (label && orientation === "horizontal") {
105
+ return /* @__PURE__ */ React.createElement(
106
+ "div",
107
+ {
108
+ role: decorative ? "none" : "separator",
109
+ "aria-orientation": "horizontal",
110
+ className: (0, import_utils.cn)(
111
+ "flex items-center w-full",
112
+ spacingClass,
113
+ className
114
+ )
115
+ },
116
+ /* @__PURE__ */ React.createElement("div", { className: (0, import_utils.cn)(
117
+ lineClass,
118
+ labelPosition === "left" ? "max-w-[10%]" : ""
119
+ ) }),
120
+ /* @__PURE__ */ React.createElement("span", { className: "px-3 text-sm text-text-muted shrink-0 select-none" }, label),
121
+ /* @__PURE__ */ React.createElement("div", { className: (0, import_utils.cn)(
122
+ lineClass,
123
+ labelPosition === "right" ? "max-w-[10%]" : ""
124
+ ) })
125
+ );
126
+ }
127
+ return /* @__PURE__ */ React.createElement(
128
+ SeparatorPrimitive.Root,
129
+ {
130
+ ref,
131
+ decorative,
132
+ orientation,
133
+ className: (0, import_utils.cn)(
134
+ dividerVariants({ orientation, variant, color, spacing }),
135
+ className
136
+ ),
137
+ ...props
138
+ }
139
+ );
140
+ });
141
+ Divider.displayName = "Divider";
142
+ // Annotate the CommonJS export names for ESM import in node:
143
+ 0 && (module.exports = {
144
+ Divider,
145
+ dividerVariants
146
+ });
147
+ //# sourceMappingURL=divider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/ui/divider.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\nimport * as SeparatorPrimitive from '@radix-ui/react-separator'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { cn } from '../../lib/utils'\n\n// ─── Divider ─────────────────────────────────────────────────\n\nconst dividerVariants = cva('shrink-0', {\n variants: {\n orientation: {\n horizontal: 'w-full',\n vertical: 'h-full self-stretch',\n },\n variant: {\n solid: 'border-solid',\n dashed: 'border-dashed',\n dotted: 'border-dotted',\n },\n color: {\n default: 'border-border-subtle',\n muted: 'border-border-subtle',\n strong: 'border-border-strong',\n },\n spacing: {\n sm: '',\n md: '',\n default: '',\n lg: '',\n },\n },\n compoundVariants: [\n // Horizontal spacing\n { orientation: 'horizontal', spacing: 'sm', className: 'my-2' },\n { orientation: 'horizontal', spacing: 'md', className: 'my-3' },\n { orientation: 'horizontal', spacing: 'default', className: 'my-4' },\n { orientation: 'horizontal', spacing: 'lg', className: 'my-8' },\n // Vertical spacing\n { orientation: 'vertical', spacing: 'sm', className: 'mx-2' },\n { orientation: 'vertical', spacing: 'md', className: 'mx-3' },\n { orientation: 'vertical', spacing: 'default', className: 'mx-4' },\n { orientation: 'vertical', spacing: 'lg', className: 'mx-8' },\n // Horizontal line style (border-top)\n { orientation: 'horizontal', className: 'border-t border-l-0' },\n // Vertical line style (border-left)\n { orientation: 'vertical', className: 'border-l border-t-0' },\n ],\n defaultVariants: {\n orientation: 'horizontal',\n variant: 'solid',\n color: 'default',\n spacing: 'default',\n },\n})\n\nexport interface DividerProps\n extends Omit<React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>, 'children' | 'color' | 'orientation'> {\n /** Direction of the divider */\n orientation?: 'horizontal' | 'vertical'\n /** Line style */\n variant?: 'solid' | 'dashed' | 'dotted'\n /** Line color intensity */\n color?: 'default' | 'muted' | 'strong'\n /** Spacing around the divider */\n spacing?: 'sm' | 'md' | 'default' | 'lg'\n /** Content to display on the divider line (horizontal only) */\n label?: React.ReactNode\n /** Label position along the line */\n labelPosition?: 'left' | 'center' | 'right'\n}\n\nconst Divider = React.forwardRef<\n React.ElementRef<typeof SeparatorPrimitive.Root>,\n DividerProps\n>(({\n className,\n orientation = 'horizontal',\n variant = 'solid',\n color = 'default',\n spacing = 'default',\n label,\n labelPosition = 'center',\n decorative = true,\n ...props\n}, ref) => {\n // Line style class for label mode\n const lineClass = cn(\n 'flex-1',\n variant === 'dashed' ? 'border-dashed' : variant === 'dotted' ? 'border-dotted' : 'border-solid',\n color === 'muted' ? 'border-border-subtle' : color === 'strong' ? 'border-border-strong' : 'border-border-subtle',\n 'border-t'\n )\n\n // Spacing class for label wrapper\n const spacingClass =\n spacing === 'sm' ? 'my-2'\n : spacing === 'md' ? 'my-3'\n : spacing === 'lg' ? 'my-8'\n : 'my-4'\n\n // Horizontal with label: render as flex container with two lines\n if (label && orientation === 'horizontal') {\n return (\n <div\n role={decorative ? 'none' : 'separator'}\n aria-orientation=\"horizontal\"\n className={cn(\n 'flex items-center w-full',\n spacingClass,\n className\n )}\n >\n <div className={cn(\n lineClass,\n labelPosition === 'left' ? 'max-w-[10%]' : ''\n )} />\n <span className=\"px-3 text-sm text-text-muted shrink-0 select-none\">{label}</span>\n <div className={cn(\n lineClass,\n labelPosition === 'right' ? 'max-w-[10%]' : ''\n )} />\n </div>\n )\n }\n\n // Default: Radix Separator\n return (\n <SeparatorPrimitive.Root\n ref={ref}\n decorative={decorative}\n orientation={orientation}\n className={cn(\n dividerVariants({ orientation, variant, color, spacing }),\n className\n )}\n {...props}\n />\n )\n})\nDivider.displayName = 'Divider'\n\n// ─── Exports ─────────────────────────────────────────────────\n\nexport { Divider, dividerVariants }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,YAAuB;AACvB,yBAAoC;AACpC,sCAAuC;AACvC,mBAAmB;AAInB,MAAM,sBAAkB,qCAAI,YAAY;AAAA,EACtC,UAAU;AAAA,IACR,aAAa;AAAA,MACX,YAAY;AAAA,MACZ,UAAU;AAAA,IACZ;AAAA,IACA,SAAS;AAAA,MACP,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,QAAQ;AAAA,IACV;AAAA,IACA,OAAO;AAAA,MACL,SAAS;AAAA,MACT,OAAO;AAAA,MACP,QAAQ;AAAA,IACV;AAAA,IACA,SAAS;AAAA,MACP,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,SAAS;AAAA,MACT,IAAI;AAAA,IACN;AAAA,EACF;AAAA,EACA,kBAAkB;AAAA;AAAA,IAEhB,EAAE,aAAa,cAAc,SAAS,MAAM,WAAW,OAAO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