@spark-ui/components 10.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 (296) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/LICENSE.md +21 -0
  3. package/README.md +19 -0
  4. package/dist/DialogTrigger-5SI4dvpK.d.mts +142 -0
  5. package/dist/DialogTrigger-5SI4dvpK.d.ts +142 -0
  6. package/dist/Input-g0LpWuv0.d.mts +17 -0
  7. package/dist/Input-g0LpWuv0.d.ts +17 -0
  8. package/dist/InputGroup-aoaZxCLk.d.mts +28 -0
  9. package/dist/InputGroup-aoaZxCLk.d.ts +28 -0
  10. package/dist/InputTrailingIcon-BBp7sE6D.d.mts +20 -0
  11. package/dist/InputTrailingIcon-ZZx8PoJy.d.ts +20 -0
  12. package/dist/LabelRequiredIndicator-DRnCzHMU.d.mts +19 -0
  13. package/dist/LabelRequiredIndicator-DRnCzHMU.d.ts +19 -0
  14. package/dist/accordion/index.d.mts +85 -0
  15. package/dist/accordion/index.d.ts +85 -0
  16. package/dist/accordion/index.js +461 -0
  17. package/dist/accordion/index.js.map +1 -0
  18. package/dist/accordion/index.mjs +249 -0
  19. package/dist/accordion/index.mjs.map +1 -0
  20. package/dist/alert-dialog/index.d.mts +119 -0
  21. package/dist/alert-dialog/index.d.ts +119 -0
  22. package/dist/alert-dialog/index.js +1451 -0
  23. package/dist/alert-dialog/index.js.map +1 -0
  24. package/dist/alert-dialog/index.mjs +177 -0
  25. package/dist/alert-dialog/index.mjs.map +1 -0
  26. package/dist/badge/index.d.mts +47 -0
  27. package/dist/badge/index.d.ts +47 -0
  28. package/dist/badge/index.js +122 -0
  29. package/dist/badge/index.js.map +1 -0
  30. package/dist/badge/index.mjs +95 -0
  31. package/dist/badge/index.mjs.map +1 -0
  32. package/dist/breadcrumb/index.d.mts +64 -0
  33. package/dist/breadcrumb/index.d.ts +64 -0
  34. package/dist/breadcrumb/index.js +326 -0
  35. package/dist/breadcrumb/index.js.map +1 -0
  36. package/dist/breadcrumb/index.mjs +149 -0
  37. package/dist/breadcrumb/index.mjs.map +1 -0
  38. package/dist/button/index.d.mts +40 -0
  39. package/dist/button/index.d.ts +40 -0
  40. package/dist/button/index.js +877 -0
  41. package/dist/button/index.js.map +1 -0
  42. package/dist/button/index.mjs +10 -0
  43. package/dist/button/index.mjs.map +1 -0
  44. package/dist/carousel/index.d.mts +253 -0
  45. package/dist/carousel/index.d.ts +253 -0
  46. package/dist/carousel/index.js +1678 -0
  47. package/dist/carousel/index.js.map +1 -0
  48. package/dist/carousel/index.mjs +716 -0
  49. package/dist/carousel/index.mjs.map +1 -0
  50. package/dist/checkbox/index.d.mts +120 -0
  51. package/dist/checkbox/index.d.ts +120 -0
  52. package/dist/checkbox/index.js +873 -0
  53. package/dist/checkbox/index.js.map +1 -0
  54. package/dist/checkbox/index.mjs +349 -0
  55. package/dist/checkbox/index.mjs.map +1 -0
  56. package/dist/chip/index.d.mts +97 -0
  57. package/dist/chip/index.d.ts +97 -0
  58. package/dist/chip/index.js +905 -0
  59. package/dist/chip/index.js.map +1 -0
  60. package/dist/chip/index.mjs +793 -0
  61. package/dist/chip/index.mjs.map +1 -0
  62. package/dist/chunk-2KPFQEAA.mjs +52 -0
  63. package/dist/chunk-2KPFQEAA.mjs.map +1 -0
  64. package/dist/chunk-4F5DOL57.mjs +26 -0
  65. package/dist/chunk-4F5DOL57.mjs.map +1 -0
  66. package/dist/chunk-6JOA37TZ.mjs +742 -0
  67. package/dist/chunk-6JOA37TZ.mjs.map +1 -0
  68. package/dist/chunk-7PMPYEHJ.mjs +379 -0
  69. package/dist/chunk-7PMPYEHJ.mjs.map +1 -0
  70. package/dist/chunk-AESXFMCC.mjs +68 -0
  71. package/dist/chunk-AESXFMCC.mjs.map +1 -0
  72. package/dist/chunk-B42LOFIZ.mjs +308 -0
  73. package/dist/chunk-B42LOFIZ.mjs.map +1 -0
  74. package/dist/chunk-FGOZHKBT.mjs +97 -0
  75. package/dist/chunk-FGOZHKBT.mjs.map +1 -0
  76. package/dist/chunk-HLXYG643.mjs +52 -0
  77. package/dist/chunk-HLXYG643.mjs.map +1 -0
  78. package/dist/chunk-JKNBJHD5.mjs +601 -0
  79. package/dist/chunk-JKNBJHD5.mjs.map +1 -0
  80. package/dist/chunk-K7VP7DH3.mjs +66 -0
  81. package/dist/chunk-K7VP7DH3.mjs.map +1 -0
  82. package/dist/chunk-MUNDKRAE.mjs +80 -0
  83. package/dist/chunk-MUNDKRAE.mjs.map +1 -0
  84. package/dist/chunk-NBZKMCHF.mjs +36 -0
  85. package/dist/chunk-NBZKMCHF.mjs.map +1 -0
  86. package/dist/chunk-PZWESKAR.mjs +314 -0
  87. package/dist/chunk-PZWESKAR.mjs.map +1 -0
  88. package/dist/collapsible/index.d.mts +60 -0
  89. package/dist/collapsible/index.d.ts +60 -0
  90. package/dist/collapsible/index.js +140 -0
  91. package/dist/collapsible/index.js.map +1 -0
  92. package/dist/collapsible/index.mjs +8 -0
  93. package/dist/collapsible/index.mjs.map +1 -0
  94. package/dist/combobox/index.d.mts +285 -0
  95. package/dist/combobox/index.d.ts +285 -0
  96. package/dist/combobox/index.js +2920 -0
  97. package/dist/combobox/index.js.map +1 -0
  98. package/dist/combobox/index.mjs +1267 -0
  99. package/dist/combobox/index.mjs.map +1 -0
  100. package/dist/dialog/index.d.mts +33 -0
  101. package/dist/dialog/index.d.ts +33 -0
  102. package/dist/dialog/index.js +1286 -0
  103. package/dist/dialog/index.js.map +1 -0
  104. package/dist/dialog/index.mjs +13 -0
  105. package/dist/dialog/index.mjs.map +1 -0
  106. package/dist/divider/index.d.mts +61 -0
  107. package/dist/divider/index.d.ts +61 -0
  108. package/dist/divider/index.js +223 -0
  109. package/dist/divider/index.js.map +1 -0
  110. package/dist/divider/index.mjs +196 -0
  111. package/dist/divider/index.mjs.map +1 -0
  112. package/dist/drawer/index.d.mts +148 -0
  113. package/dist/drawer/index.d.ts +148 -0
  114. package/dist/drawer/index.js +1266 -0
  115. package/dist/drawer/index.js.map +1 -0
  116. package/dist/drawer/index.mjs +299 -0
  117. package/dist/drawer/index.mjs.map +1 -0
  118. package/dist/dropdown/index.d.mts +233 -0
  119. package/dist/dropdown/index.d.ts +233 -0
  120. package/dist/dropdown/index.js +2402 -0
  121. package/dist/dropdown/index.js.map +1 -0
  122. package/dist/dropdown/index.mjs +741 -0
  123. package/dist/dropdown/index.mjs.map +1 -0
  124. package/dist/form-field/index.d.mts +176 -0
  125. package/dist/form-field/index.d.ts +176 -0
  126. package/dist/form-field/index.js +540 -0
  127. package/dist/form-field/index.js.map +1 -0
  128. package/dist/form-field/index.mjs +13 -0
  129. package/dist/form-field/index.mjs.map +1 -0
  130. package/dist/icon/index.d.mts +28 -0
  131. package/dist/icon/index.d.ts +28 -0
  132. package/dist/icon/index.js +127 -0
  133. package/dist/icon/index.js.map +1 -0
  134. package/dist/icon/index.mjs +9 -0
  135. package/dist/icon/index.mjs.map +1 -0
  136. package/dist/icon-button/index.d.mts +16 -0
  137. package/dist/icon-button/index.d.ts +16 -0
  138. package/dist/icon-button/index.js +921 -0
  139. package/dist/icon-button/index.js.map +1 -0
  140. package/dist/icon-button/index.mjs +11 -0
  141. package/dist/icon-button/index.mjs.map +1 -0
  142. package/dist/input/index.d.mts +78 -0
  143. package/dist/input/index.d.ts +78 -0
  144. package/dist/input/index.js +1119 -0
  145. package/dist/input/index.js.map +1 -0
  146. package/dist/input/index.mjs +16 -0
  147. package/dist/input/index.mjs.map +1 -0
  148. package/dist/kbd/index.d.mts +9 -0
  149. package/dist/kbd/index.d.ts +9 -0
  150. package/dist/kbd/index.js +46 -0
  151. package/dist/kbd/index.js.map +1 -0
  152. package/dist/kbd/index.mjs +19 -0
  153. package/dist/kbd/index.mjs.map +1 -0
  154. package/dist/label/index.d.mts +11 -0
  155. package/dist/label/index.d.ts +11 -0
  156. package/dist/label/index.js +78 -0
  157. package/dist/label/index.js.map +1 -0
  158. package/dist/label/index.mjs +7 -0
  159. package/dist/label/index.mjs.map +1 -0
  160. package/dist/link-box/index.d.mts +34 -0
  161. package/dist/link-box/index.d.ts +34 -0
  162. package/dist/link-box/index.js +92 -0
  163. package/dist/link-box/index.js.map +1 -0
  164. package/dist/link-box/index.mjs +58 -0
  165. package/dist/link-box/index.mjs.map +1 -0
  166. package/dist/pagination/index.d.mts +143 -0
  167. package/dist/pagination/index.d.ts +143 -0
  168. package/dist/pagination/index.js +1303 -0
  169. package/dist/pagination/index.js.map +1 -0
  170. package/dist/pagination/index.mjs +326 -0
  171. package/dist/pagination/index.mjs.map +1 -0
  172. package/dist/popover/index.d.mts +93 -0
  173. package/dist/popover/index.d.ts +93 -0
  174. package/dist/popover/index.js +1280 -0
  175. package/dist/popover/index.js.map +1 -0
  176. package/dist/popover/index.mjs +13 -0
  177. package/dist/popover/index.mjs.map +1 -0
  178. package/dist/portal/index.d.mts +13 -0
  179. package/dist/portal/index.d.ts +13 -0
  180. package/dist/portal/index.js +37 -0
  181. package/dist/portal/index.js.map +1 -0
  182. package/dist/portal/index.mjs +10 -0
  183. package/dist/portal/index.mjs.map +1 -0
  184. package/dist/progress/index.d.mts +48 -0
  185. package/dist/progress/index.d.ts +48 -0
  186. package/dist/progress/index.js +201 -0
  187. package/dist/progress/index.js.map +1 -0
  188. package/dist/progress/index.mjs +174 -0
  189. package/dist/progress/index.mjs.map +1 -0
  190. package/dist/progress-tracker/index.d.mts +81 -0
  191. package/dist/progress-tracker/index.d.ts +81 -0
  192. package/dist/progress-tracker/index.js +834 -0
  193. package/dist/progress-tracker/index.js.map +1 -0
  194. package/dist/progress-tracker/index.mjs +716 -0
  195. package/dist/progress-tracker/index.mjs.map +1 -0
  196. package/dist/radio-group/index.d.mts +100 -0
  197. package/dist/radio-group/index.d.ts +100 -0
  198. package/dist/radio-group/index.js +824 -0
  199. package/dist/radio-group/index.js.map +1 -0
  200. package/dist/radio-group/index.mjs +297 -0
  201. package/dist/radio-group/index.mjs.map +1 -0
  202. package/dist/rating/index.d.mts +78 -0
  203. package/dist/rating/index.d.ts +78 -0
  204. package/dist/rating/index.js +362 -0
  205. package/dist/rating/index.js.map +1 -0
  206. package/dist/rating/index.mjs +247 -0
  207. package/dist/rating/index.mjs.map +1 -0
  208. package/dist/scrolling-list/index.d.mts +105 -0
  209. package/dist/scrolling-list/index.d.ts +105 -0
  210. package/dist/scrolling-list/index.js +1367 -0
  211. package/dist/scrolling-list/index.js.map +1 -0
  212. package/dist/scrolling-list/index.mjs +407 -0
  213. package/dist/scrolling-list/index.mjs.map +1 -0
  214. package/dist/select/index.d.mts +167 -0
  215. package/dist/select/index.d.ts +167 -0
  216. package/dist/select/index.js +991 -0
  217. package/dist/select/index.js.map +1 -0
  218. package/dist/select/index.mjs +470 -0
  219. package/dist/select/index.mjs.map +1 -0
  220. package/dist/skeleton/index.d.mts +67 -0
  221. package/dist/skeleton/index.d.ts +67 -0
  222. package/dist/skeleton/index.js +206 -0
  223. package/dist/skeleton/index.js.map +1 -0
  224. package/dist/skeleton/index.mjs +147 -0
  225. package/dist/skeleton/index.mjs.map +1 -0
  226. package/dist/slider/index.d.mts +97 -0
  227. package/dist/slider/index.d.ts +97 -0
  228. package/dist/slider/index.js +209 -0
  229. package/dist/slider/index.js.map +1 -0
  230. package/dist/slider/index.mjs +182 -0
  231. package/dist/slider/index.mjs.map +1 -0
  232. package/dist/slot/index.d.mts +17 -0
  233. package/dist/slot/index.d.ts +17 -0
  234. package/dist/slot/index.js +51 -0
  235. package/dist/slot/index.js.map +1 -0
  236. package/dist/slot/index.mjs +11 -0
  237. package/dist/slot/index.mjs.map +1 -0
  238. package/dist/snackbar/index.d.mts +158 -0
  239. package/dist/snackbar/index.d.ts +158 -0
  240. package/dist/snackbar/index.js +1693 -0
  241. package/dist/snackbar/index.js.map +1 -0
  242. package/dist/snackbar/index.mjs +733 -0
  243. package/dist/snackbar/index.mjs.map +1 -0
  244. package/dist/spinner/index.d.mts +21 -0
  245. package/dist/spinner/index.d.ts +21 -0
  246. package/dist/spinner/index.js +139 -0
  247. package/dist/spinner/index.js.map +1 -0
  248. package/dist/spinner/index.mjs +9 -0
  249. package/dist/spinner/index.mjs.map +1 -0
  250. package/dist/stepper/index.d.mts +82 -0
  251. package/dist/stepper/index.d.ts +82 -0
  252. package/dist/stepper/index.js +2178 -0
  253. package/dist/stepper/index.js.map +1 -0
  254. package/dist/stepper/index.mjs +229 -0
  255. package/dist/stepper/index.mjs.map +1 -0
  256. package/dist/switch/index.d.mts +64 -0
  257. package/dist/switch/index.d.ts +64 -0
  258. package/dist/switch/index.js +768 -0
  259. package/dist/switch/index.js.map +1 -0
  260. package/dist/switch/index.mjs +245 -0
  261. package/dist/switch/index.mjs.map +1 -0
  262. package/dist/tabs/index.d.mts +103 -0
  263. package/dist/tabs/index.d.ts +103 -0
  264. package/dist/tabs/index.js +1315 -0
  265. package/dist/tabs/index.js.map +1 -0
  266. package/dist/tabs/index.mjs +391 -0
  267. package/dist/tabs/index.mjs.map +1 -0
  268. package/dist/tag/index.d.mts +27 -0
  269. package/dist/tag/index.d.ts +27 -0
  270. package/dist/tag/index.js +269 -0
  271. package/dist/tag/index.js.map +1 -0
  272. package/dist/tag/index.mjs +237 -0
  273. package/dist/tag/index.mjs.map +1 -0
  274. package/dist/text-link/index.d.mts +20 -0
  275. package/dist/text-link/index.d.ts +20 -0
  276. package/dist/text-link/index.js +99 -0
  277. package/dist/text-link/index.js.map +1 -0
  278. package/dist/text-link/index.mjs +8 -0
  279. package/dist/text-link/index.mjs.map +1 -0
  280. package/dist/textarea/index.d.mts +47 -0
  281. package/dist/textarea/index.d.ts +47 -0
  282. package/dist/textarea/index.js +1180 -0
  283. package/dist/textarea/index.js.map +1 -0
  284. package/dist/textarea/index.mjs +77 -0
  285. package/dist/textarea/index.mjs.map +1 -0
  286. package/dist/visually-hidden/index.d.mts +16 -0
  287. package/dist/visually-hidden/index.d.ts +16 -0
  288. package/dist/visually-hidden/index.js +67 -0
  289. package/dist/visually-hidden/index.js.map +1 -0
  290. package/dist/visually-hidden/index.mjs +8 -0
  291. package/dist/visually-hidden/index.mjs.map +1 -0
  292. package/global.d.ts +12 -0
  293. package/package.json +75 -0
  294. package/tsconfig.build.json +9 -0
  295. package/tsconfig.json +9 -0
  296. package/tsup.config.ts +11 -0
@@ -0,0 +1,2178 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/stepper/index.ts
21
+ var stepper_exports = {};
22
+ __export(stepper_exports, {
23
+ Stepper: () => Stepper2
24
+ });
25
+ module.exports = __toCommonJS(stepper_exports);
26
+
27
+ // src/stepper/Stepper.tsx
28
+ var import_react11 = require("react");
29
+
30
+ // src/form-field/FormField.tsx
31
+ var import_class_variance_authority = require("class-variance-authority");
32
+ var import_react4 = require("react");
33
+
34
+ // src/slot/Slot.tsx
35
+ var import_radix_ui = require("radix-ui");
36
+ var import_react = require("react");
37
+ var import_jsx_runtime = require("react/jsx-runtime");
38
+ var Slottable = import_radix_ui.Slot.Slottable;
39
+ var Slot = ({ ref, ...props }) => {
40
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_radix_ui.Slot.Root, { ref, ...props });
41
+ };
42
+ var wrapPolymorphicSlot = (asChild, children, callback) => {
43
+ if (!asChild) return callback(children);
44
+ return (0, import_react.isValidElement)(children) ? (0, import_react.cloneElement)(
45
+ children,
46
+ void 0,
47
+ callback(children.props.children)
48
+ ) : null;
49
+ };
50
+
51
+ // src/form-field/FormFieldContext.tsx
52
+ var import_react2 = require("react");
53
+ var FormFieldContext = (0, import_react2.createContext)(null);
54
+ var ID_PREFIX = ":form-field";
55
+ var useFormField = () => {
56
+ const context = (0, import_react2.useContext)(FormFieldContext);
57
+ if (!context) {
58
+ throw Error("useFormField must be used within a FormField provider");
59
+ }
60
+ return context;
61
+ };
62
+
63
+ // src/form-field/FormFieldProvider.tsx
64
+ var import_react3 = require("react");
65
+ var import_jsx_runtime2 = require("react/jsx-runtime");
66
+ var FormFieldProvider = ({
67
+ id,
68
+ name,
69
+ disabled = false,
70
+ readOnly = false,
71
+ state,
72
+ isRequired,
73
+ children
74
+ }) => {
75
+ const labelId = `${ID_PREFIX}-label-${(0, import_react3.useId)()}`;
76
+ const [messageIds, setMessageIds] = (0, import_react3.useState)([]);
77
+ const description = messageIds.length > 0 ? messageIds.join(" ") : void 0;
78
+ const handleMessageIdAdd = (0, import_react3.useCallback)((msgId) => {
79
+ setMessageIds((ids) => [...ids, msgId]);
80
+ }, []);
81
+ const handleMessageIdRemove = (0, import_react3.useCallback)((msgId) => {
82
+ setMessageIds((ids) => ids.filter((current) => current !== msgId));
83
+ }, []);
84
+ const value = (0, import_react3.useMemo)(() => {
85
+ const isInvalid = state === "error";
86
+ return {
87
+ id,
88
+ labelId,
89
+ name,
90
+ disabled,
91
+ readOnly,
92
+ state,
93
+ isRequired,
94
+ isInvalid,
95
+ description,
96
+ onMessageIdAdd: handleMessageIdAdd,
97
+ onMessageIdRemove: handleMessageIdRemove
98
+ };
99
+ }, [
100
+ id,
101
+ labelId,
102
+ name,
103
+ disabled,
104
+ readOnly,
105
+ description,
106
+ state,
107
+ isRequired,
108
+ handleMessageIdAdd,
109
+ handleMessageIdRemove
110
+ ]);
111
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(FormFieldContext.Provider, { value, children });
112
+ };
113
+ FormFieldProvider.displayName = "FormFieldProvider";
114
+
115
+ // src/form-field/FormField.tsx
116
+ var import_jsx_runtime3 = require("react/jsx-runtime");
117
+ var FormField = ({
118
+ className,
119
+ disabled = false,
120
+ readOnly = false,
121
+ name,
122
+ state,
123
+ isRequired = false,
124
+ asChild = false,
125
+ ref,
126
+ ...others
127
+ }) => {
128
+ const id = `${ID_PREFIX}-${(0, import_react4.useId)()}`;
129
+ const Component = asChild ? Slot : "div";
130
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
131
+ FormFieldProvider,
132
+ {
133
+ id,
134
+ name,
135
+ isRequired,
136
+ disabled,
137
+ readOnly,
138
+ state,
139
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
140
+ Component,
141
+ {
142
+ ref,
143
+ "data-spark-component": "form-field",
144
+ className: (0, import_class_variance_authority.cx)(className, "gap-sm flex flex-col"),
145
+ ...others
146
+ }
147
+ )
148
+ }
149
+ );
150
+ };
151
+ FormField.displayName = "FormField";
152
+
153
+ // src/form-field/FormFieldStateMessage.tsx
154
+ var import_AlertOutline = require("@spark-ui/icons/AlertOutline");
155
+ var import_Check = require("@spark-ui/icons/Check");
156
+ var import_WarningOutline = require("@spark-ui/icons/WarningOutline");
157
+ var import_class_variance_authority4 = require("class-variance-authority");
158
+
159
+ // src/icon/Icon.tsx
160
+ var import_react5 = require("react");
161
+
162
+ // src/visually-hidden/VisuallyHidden.tsx
163
+ var import_jsx_runtime4 = require("react/jsx-runtime");
164
+ var VisuallyHidden = ({ asChild = false, ref, ...props }) => {
165
+ const Component = asChild ? Slot : "span";
166
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
167
+ Component,
168
+ {
169
+ ...props,
170
+ ref,
171
+ style: {
172
+ // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
173
+ position: "absolute",
174
+ border: 0,
175
+ width: 1,
176
+ height: 1,
177
+ padding: 0,
178
+ margin: -1,
179
+ overflow: "hidden",
180
+ clip: "rect(0, 0, 0, 0)",
181
+ whiteSpace: "nowrap",
182
+ wordWrap: "normal",
183
+ ...props.style
184
+ }
185
+ }
186
+ );
187
+ };
188
+ VisuallyHidden.displayName = "VisuallyHidden";
189
+
190
+ // src/icon/Icon.styles.tsx
191
+ var import_internal_utils = require("@spark-ui/internal-utils");
192
+ var import_class_variance_authority2 = require("class-variance-authority");
193
+ var iconStyles = (0, import_class_variance_authority2.cva)(["fill-current shrink-0"], {
194
+ variants: {
195
+ /**
196
+ * Color scheme of the icon.
197
+ */
198
+ intent: (0, import_internal_utils.makeVariants)({
199
+ current: ["text-current"],
200
+ main: ["text-main"],
201
+ support: ["text-support"],
202
+ accent: ["text-accent"],
203
+ basic: ["text-basic"],
204
+ success: ["text-success"],
205
+ alert: ["text-alert"],
206
+ error: ["text-error"],
207
+ info: ["text-info"],
208
+ neutral: ["text-neutral"]
209
+ }),
210
+ /**
211
+ * Sets the size of the icon.
212
+ */
213
+ size: (0, import_internal_utils.makeVariants)({
214
+ current: ["u-current-font-size"],
215
+ sm: ["w-sz-16", "h-sz-16"],
216
+ md: ["w-sz-24", "h-sz-24"],
217
+ lg: ["w-sz-32", "h-sz-32"],
218
+ xl: ["w-sz-40", "h-sz-40"]
219
+ })
220
+ }
221
+ });
222
+
223
+ // src/icon/Icon.tsx
224
+ var import_jsx_runtime5 = require("react/jsx-runtime");
225
+ var Icon = ({
226
+ label,
227
+ className,
228
+ size = "current",
229
+ intent = "current",
230
+ children,
231
+ ...others
232
+ }) => {
233
+ const child = import_react5.Children.only(children);
234
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
235
+ (0, import_react5.cloneElement)(child, {
236
+ className: iconStyles({ className, size, intent }),
237
+ "data-spark-component": "icon",
238
+ "aria-hidden": "true",
239
+ focusable: "false",
240
+ ...others
241
+ }),
242
+ label && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(VisuallyHidden, { children: label })
243
+ ] });
244
+ };
245
+ Icon.displayName = "Icon";
246
+
247
+ // src/form-field/FormFieldMessage.tsx
248
+ var import_class_variance_authority3 = require("class-variance-authority");
249
+ var import_react6 = require("react");
250
+ var import_jsx_runtime6 = require("react/jsx-runtime");
251
+ var FormFieldMessage = ({
252
+ id: idProp,
253
+ className,
254
+ ref,
255
+ ...others
256
+ }) => {
257
+ const { onMessageIdAdd, onMessageIdRemove } = useFormField();
258
+ const currentId = `${ID_PREFIX}-message-${(0, import_react6.useId)()}`;
259
+ const id = idProp || currentId;
260
+ (0, import_react6.useEffect)(() => {
261
+ onMessageIdAdd(id);
262
+ return () => {
263
+ onMessageIdRemove(id);
264
+ };
265
+ }, [id, onMessageIdAdd, onMessageIdRemove]);
266
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
267
+ "span",
268
+ {
269
+ ref,
270
+ id,
271
+ "data-spark-component": "form-field-message",
272
+ className: (0, import_class_variance_authority3.cx)(className, "text-caption"),
273
+ ...others
274
+ }
275
+ );
276
+ };
277
+ FormFieldMessage.displayName = "FormField.Message";
278
+
279
+ // src/form-field/FormFieldStateMessage.tsx
280
+ var import_jsx_runtime7 = require("react/jsx-runtime");
281
+ var FormFieldStateMessage = ({
282
+ className,
283
+ state,
284
+ children,
285
+ ref,
286
+ ...others
287
+ }) => {
288
+ const field = useFormField();
289
+ if (field.state !== state) {
290
+ return null;
291
+ }
292
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
293
+ FormFieldMessage,
294
+ {
295
+ ref,
296
+ "data-spark-component": "form-field-state-message",
297
+ "aria-live": "polite",
298
+ className: (0, import_class_variance_authority4.cx)(
299
+ "gap-sm flex items-center",
300
+ state === "error" ? "text-error" : "text-on-surface/dim-1",
301
+ className
302
+ ),
303
+ ...others,
304
+ children: [
305
+ state === "alert" && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_WarningOutline.WarningOutline, {}) }),
306
+ state === "error" && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { size: "sm", intent: "error", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_AlertOutline.AlertOutline, {}) }),
307
+ state === "success" && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_Check.Check, {}) }),
308
+ children
309
+ ]
310
+ }
311
+ );
312
+ };
313
+ FormFieldStateMessage.displayName = "FormField.StateMessage";
314
+
315
+ // src/form-field/FormFieldAlertMessage.tsx
316
+ var import_jsx_runtime8 = require("react/jsx-runtime");
317
+ var FormFieldAlertMessage = ({ ref, ...props }) => {
318
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
319
+ FormFieldStateMessage,
320
+ {
321
+ ref,
322
+ "data-spark-component": "form-field-alert-message",
323
+ state: "alert",
324
+ ...props
325
+ }
326
+ );
327
+ };
328
+ FormFieldAlertMessage.displayName = "FormField.AlertMessage";
329
+
330
+ // src/form-field/FormFieldCharactersCount.tsx
331
+ var import_class_variance_authority5 = require("class-variance-authority");
332
+ var import_jsx_runtime9 = require("react/jsx-runtime");
333
+ var FormFieldCharactersCount = ({
334
+ className,
335
+ value = "",
336
+ maxLength,
337
+ ref,
338
+ ...others
339
+ }) => {
340
+ const displayValue = `${value.length}/${maxLength}`;
341
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
342
+ "span",
343
+ {
344
+ ref,
345
+ "data-spark-component": "form-field-characters-count",
346
+ className: (0, import_class_variance_authority5.cx)(className, "text-caption", "text-neutral"),
347
+ ...others,
348
+ children: displayValue
349
+ }
350
+ );
351
+ };
352
+ FormFieldCharactersCount.displayName = "FormField.CharactersCount";
353
+
354
+ // src/form-field/FormFieldControl.tsx
355
+ var import_react7 = require("react");
356
+ var import_jsx_runtime10 = require("react/jsx-runtime");
357
+ var useFormFieldControl = () => {
358
+ const { id, name, description, disabled, readOnly, state, labelId, isInvalid, isRequired } = (0, import_react7.useContext)(FormFieldContext) || {};
359
+ return {
360
+ id,
361
+ name,
362
+ description,
363
+ disabled,
364
+ readOnly,
365
+ state,
366
+ labelId,
367
+ isInvalid,
368
+ isRequired
369
+ };
370
+ };
371
+ var FormFieldControl = ({ children }) => {
372
+ const props = useFormFieldControl();
373
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: children(props) });
374
+ };
375
+ FormFieldControl.displayName = "FormField.Control";
376
+
377
+ // src/form-field/FormFieldErrorMessage.tsx
378
+ var import_jsx_runtime11 = require("react/jsx-runtime");
379
+ var FormFieldErrorMessage = ({ ref, ...props }) => {
380
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
381
+ FormFieldStateMessage,
382
+ {
383
+ ref,
384
+ "data-spark-component": "form-field-error-message",
385
+ state: "error",
386
+ ...props
387
+ }
388
+ );
389
+ };
390
+ FormFieldErrorMessage.displayName = "FormField.ErrorMessage";
391
+
392
+ // src/form-field/FormFieldHelperMessage.tsx
393
+ var import_class_variance_authority6 = require("class-variance-authority");
394
+ var import_jsx_runtime12 = require("react/jsx-runtime");
395
+ var FormFieldHelperMessage = ({
396
+ className,
397
+ ref,
398
+ ...others
399
+ }) => {
400
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
401
+ FormFieldMessage,
402
+ {
403
+ ref,
404
+ "data-spark-component": "form-field-helper-message",
405
+ className: (0, import_class_variance_authority6.cx)("text-on-surface/dim-1", className),
406
+ ...others
407
+ }
408
+ );
409
+ };
410
+ FormFieldHelperMessage.displayName = "FormField.HelperMessage";
411
+
412
+ // src/form-field/FormFieldLabel.tsx
413
+ var import_class_variance_authority10 = require("class-variance-authority");
414
+
415
+ // src/label/Label.tsx
416
+ var import_class_variance_authority7 = require("class-variance-authority");
417
+ var import_radix_ui2 = require("radix-ui");
418
+ var import_jsx_runtime13 = require("react/jsx-runtime");
419
+ var Label = ({ className, ref, ...others }) => {
420
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
421
+ import_radix_ui2.Label.Label,
422
+ {
423
+ ref,
424
+ "data-spark-component": "label",
425
+ className: (0, import_class_variance_authority7.cx)("text-body-1", className),
426
+ ...others
427
+ }
428
+ );
429
+ };
430
+ Label.displayName = "Label";
431
+
432
+ // src/label/LabelRequiredIndicator.tsx
433
+ var import_class_variance_authority8 = require("class-variance-authority");
434
+ var import_jsx_runtime14 = require("react/jsx-runtime");
435
+ var LabelRequiredIndicator = ({
436
+ className,
437
+ children = "*",
438
+ ref,
439
+ ...others
440
+ }) => {
441
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
442
+ "span",
443
+ {
444
+ ref,
445
+ "data-spark-component": "label-required-indicator",
446
+ role: "presentation",
447
+ "aria-hidden": "true",
448
+ className: (0, import_class_variance_authority8.cx)(className, "text-caption text-on-surface/dim-1"),
449
+ ...others,
450
+ children
451
+ }
452
+ );
453
+ };
454
+ LabelRequiredIndicator.displayName = "Label.RequiredIndicator";
455
+
456
+ // src/label/index.ts
457
+ var Label2 = Object.assign(Label, {
458
+ RequiredIndicator: LabelRequiredIndicator
459
+ });
460
+ Label2.displayName = "Label";
461
+ LabelRequiredIndicator.displayName = "Label.RequiredIndicator";
462
+
463
+ // src/form-field/FormFieldRequiredIndicator.tsx
464
+ var import_class_variance_authority9 = require("class-variance-authority");
465
+ var import_jsx_runtime15 = require("react/jsx-runtime");
466
+ var FormFieldRequiredIndicator = ({
467
+ className,
468
+ ref,
469
+ ...props
470
+ }) => {
471
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Label2.RequiredIndicator, { ref, className: (0, import_class_variance_authority9.cx)("ml-sm", className), ...props });
472
+ };
473
+ FormFieldRequiredIndicator.displayName = "FormField.RequiredIndicator";
474
+
475
+ // src/form-field/FormFieldLabel.tsx
476
+ var import_jsx_runtime16 = require("react/jsx-runtime");
477
+ var FormFieldLabel = ({
478
+ htmlFor: htmlForProp,
479
+ className,
480
+ children,
481
+ requiredIndicator = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(FormFieldRequiredIndicator, {}),
482
+ asChild,
483
+ ref,
484
+ ...others
485
+ }) => {
486
+ const control = useFormField();
487
+ const { disabled, labelId, isRequired } = control;
488
+ const htmlFor = asChild ? void 0 : htmlForProp || control.id;
489
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
490
+ Label2,
491
+ {
492
+ ref,
493
+ id: labelId,
494
+ "data-spark-component": "form-field-label",
495
+ htmlFor,
496
+ className: (0, import_class_variance_authority10.cx)(className, disabled ? "text-on-surface/dim-3 pointer-events-none" : void 0),
497
+ asChild,
498
+ ...others,
499
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
500
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Slottable, { children }),
501
+ isRequired && requiredIndicator
502
+ ] })
503
+ }
504
+ );
505
+ };
506
+ FormFieldLabel.displayName = "FormField.Label";
507
+
508
+ // src/form-field/FormFieldSuccessMessage.tsx
509
+ var import_jsx_runtime17 = require("react/jsx-runtime");
510
+ var FormFieldSuccessMessage = ({ ref, ...props }) => {
511
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
512
+ FormFieldStateMessage,
513
+ {
514
+ ref,
515
+ "data-spark-component": "form-field-success-message",
516
+ state: "success",
517
+ ...props
518
+ }
519
+ );
520
+ };
521
+ FormFieldSuccessMessage.displayName = "FormField.SuccessMessage";
522
+
523
+ // src/form-field/index.ts
524
+ var FormField2 = Object.assign(FormField, {
525
+ Label: FormFieldLabel,
526
+ Control: FormFieldControl,
527
+ StateMessage: FormFieldStateMessage,
528
+ SuccessMessage: FormFieldSuccessMessage,
529
+ AlertMessage: FormFieldAlertMessage,
530
+ ErrorMessage: FormFieldErrorMessage,
531
+ HelperMessage: FormFieldHelperMessage,
532
+ RequiredIndicator: FormFieldRequiredIndicator,
533
+ CharactersCount: FormFieldCharactersCount
534
+ });
535
+ FormField2.displayName = "FormField";
536
+ FormFieldLabel.displayName = "FormField.Label";
537
+ FormFieldControl.displayName = "FormField.Control";
538
+ FormFieldStateMessage.displayName = "FormField.StateMessage";
539
+ FormFieldSuccessMessage.displayName = "FormField.SuccessMessage";
540
+ FormFieldAlertMessage.displayName = "FormField.AlertMessage";
541
+ FormFieldErrorMessage.displayName = "FormField.ErrorMessage";
542
+ FormFieldHelperMessage.displayName = "FormField.HelperMessage";
543
+ FormFieldRequiredIndicator.displayName = "FormField.RequiredIndicator";
544
+ FormFieldCharactersCount.displayName = "FormField.CharactersCount";
545
+
546
+ // src/input/InputClearButton.tsx
547
+ var import_DeleteOutline = require("@spark-ui/icons/DeleteOutline");
548
+ var import_class_variance_authority11 = require("class-variance-authority");
549
+
550
+ // src/input/InputGroupContext.ts
551
+ var import_react8 = require("react");
552
+ var InputGroupContext = (0, import_react8.createContext)(null);
553
+ var useInputGroup = () => {
554
+ const context = (0, import_react8.useContext)(InputGroupContext);
555
+ return context || { isStandalone: true };
556
+ };
557
+
558
+ // src/input/InputClearButton.tsx
559
+ var import_jsx_runtime18 = require("react/jsx-runtime");
560
+ var Root = ({ className, tabIndex = -1, onClick, ref, ...others }) => {
561
+ const { onClear, hasTrailingIcon } = useInputGroup();
562
+ const handleClick = (event) => {
563
+ if (onClick) {
564
+ onClick(event);
565
+ }
566
+ if (onClear) {
567
+ onClear();
568
+ }
569
+ };
570
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
571
+ "button",
572
+ {
573
+ ref,
574
+ className: (0, import_class_variance_authority11.cx)(
575
+ className,
576
+ "pointer-events-auto absolute top-1/2 -translate-y-1/2",
577
+ "inline-flex h-full items-center justify-center outline-hidden",
578
+ "text-neutral hover:text-neutral-hovered",
579
+ hasTrailingIcon ? "right-3xl px-sz-12" : "pl-md pr-lg right-0"
580
+ ),
581
+ tabIndex,
582
+ onClick: handleClick,
583
+ type: "button",
584
+ ...others,
585
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Icon, { size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_DeleteOutline.DeleteOutline, {}) })
586
+ }
587
+ );
588
+ };
589
+ var InputClearButton = Object.assign(Root, {
590
+ id: "ClearButton"
591
+ });
592
+ Root.displayName = "InputGroup.ClearButton";
593
+
594
+ // src/input/InputGroup.tsx
595
+ var import_use_combined_state = require("@spark-ui/use-combined-state");
596
+ var import_use_merge_refs = require("@spark-ui/use-merge-refs");
597
+ var import_react9 = require("react");
598
+
599
+ // src/input/InputGroup.styles.ts
600
+ var import_class_variance_authority12 = require("class-variance-authority");
601
+ var inputGroupStyles = (0, import_class_variance_authority12.cva)(["relative inline-flex w-full"], {
602
+ variants: {
603
+ /**
604
+ * When `true`, prevents the user from interacting.
605
+ */
606
+ disabled: {
607
+ true: [
608
+ "cursor-not-allowed",
609
+ "relative",
610
+ "after:absolute",
611
+ "after:top-0",
612
+ "after:h-full",
613
+ "after:w-full",
614
+ "after:border-sm after:border-outline",
615
+ "after:rounded-lg"
616
+ ],
617
+ false: "after:hidden"
618
+ },
619
+ /**
620
+ * Sets the component as interactive or not.
621
+ */
622
+ readOnly: {
623
+ true: [
624
+ "relative",
625
+ "after:absolute",
626
+ "after:top-0",
627
+ "after:h-full",
628
+ "after:w-full",
629
+ "after:border-sm after:border-outline",
630
+ "after:rounded-lg"
631
+ ],
632
+ false: "after:hidden"
633
+ }
634
+ }
635
+ });
636
+
637
+ // src/input/InputGroup.tsx
638
+ var import_jsx_runtime19 = require("react/jsx-runtime");
639
+ var InputGroup = ({
640
+ className,
641
+ children: childrenProp,
642
+ state: stateProp,
643
+ disabled: disabledProp,
644
+ readOnly: readOnlyProp,
645
+ onClear,
646
+ ref: forwardedRef,
647
+ ...others
648
+ }) => {
649
+ const getElementId = (element) => {
650
+ return element ? element.type.id : "";
651
+ };
652
+ const findElement = (...values) => {
653
+ return children.find((child) => values.includes(getElementId(child) || ""));
654
+ };
655
+ const children = import_react9.Children.toArray(childrenProp).filter(import_react9.isValidElement);
656
+ const input = findElement("Input");
657
+ const props = input?.props || {};
658
+ const inputRef = (0, import_react9.useRef)(null);
659
+ const onClearRef = (0, import_react9.useRef)(onClear);
660
+ const ref = (0, import_use_merge_refs.useMergeRefs)(input?.ref, inputRef);
661
+ const [value, onChange] = (0, import_use_combined_state.useCombinedState)(
662
+ props.value,
663
+ props.defaultValue,
664
+ props.onValueChange
665
+ );
666
+ const field = useFormFieldControl();
667
+ const state = field.state ?? stateProp;
668
+ const disabled = field.disabled || !!disabledProp;
669
+ const readOnly = field.readOnly || !!readOnlyProp;
670
+ const leadingAddon = findElement("LeadingAddon");
671
+ const leadingIcon = findElement("LeadingIcon");
672
+ const clearButton = findElement("ClearButton");
673
+ const trailingIcon = findElement("TrailingIcon");
674
+ const trailingAddon = findElement("TrailingAddon");
675
+ const hasLeadingAddon = !!leadingAddon;
676
+ const hasTrailingAddon = !!trailingAddon;
677
+ const hasLeadingIcon = !!leadingIcon;
678
+ const hasTrailingIcon = !!trailingIcon;
679
+ const hasClearButton = !!value && !!clearButton && !disabled && !readOnly;
680
+ const handleChange = (event) => {
681
+ if (props.onChange) {
682
+ props.onChange(event);
683
+ }
684
+ onChange(event.target.value);
685
+ };
686
+ const handleClear = (0, import_react9.useCallback)(() => {
687
+ if (onClearRef.current) {
688
+ onClearRef.current();
689
+ }
690
+ onChange("");
691
+ inputRef.current.focus();
692
+ }, [onChange]);
693
+ const current = (0, import_react9.useMemo)(() => {
694
+ return {
695
+ state,
696
+ disabled,
697
+ readOnly,
698
+ hasLeadingIcon,
699
+ hasTrailingIcon,
700
+ hasLeadingAddon,
701
+ hasTrailingAddon,
702
+ hasClearButton,
703
+ onClear: handleClear
704
+ };
705
+ }, [
706
+ state,
707
+ disabled,
708
+ readOnly,
709
+ hasLeadingIcon,
710
+ hasTrailingIcon,
711
+ hasLeadingAddon,
712
+ hasTrailingAddon,
713
+ hasClearButton,
714
+ handleClear
715
+ ]);
716
+ (0, import_react9.useEffect)(() => {
717
+ onClearRef.current = onClear;
718
+ }, [onClear]);
719
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(InputGroupContext.Provider, { value: current, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
720
+ "div",
721
+ {
722
+ ref: forwardedRef,
723
+ className: inputGroupStyles({ disabled, readOnly, className }),
724
+ ...others,
725
+ children: [
726
+ hasLeadingAddon && leadingAddon,
727
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "relative inline-flex w-full", children: [
728
+ input && (0, import_react9.cloneElement)(input, {
729
+ ref,
730
+ defaultValue: void 0,
731
+ value: value ?? "",
732
+ onChange: handleChange
733
+ }),
734
+ leadingIcon,
735
+ hasClearButton && clearButton,
736
+ trailingIcon
737
+ ] }),
738
+ hasTrailingAddon && trailingAddon
739
+ ]
740
+ }
741
+ ) });
742
+ };
743
+ InputGroup.displayName = "InputGroup";
744
+
745
+ // src/input/InputLeadingAddon.tsx
746
+ var import_class_variance_authority14 = require("class-variance-authority");
747
+
748
+ // src/input/InputAddon.tsx
749
+ var import_react10 = require("react");
750
+
751
+ // src/input/InputAddon.styles.ts
752
+ var import_class_variance_authority13 = require("class-variance-authority");
753
+ var inputAddonStyles = (0, import_class_variance_authority13.cva)(
754
+ [
755
+ "overflow-hidden",
756
+ "border-sm",
757
+ "shrink-0",
758
+ "h-full",
759
+ "focus-visible:relative focus-visible:z-raised"
760
+ ],
761
+ {
762
+ variants: {
763
+ /**
764
+ * Change the component to the HTML tag or custom component of the only child.
765
+ */
766
+ asChild: { false: ["flex", "items-center", "px-lg"] },
767
+ intent: {
768
+ neutral: "border-outline",
769
+ error: "border-error",
770
+ alert: "border-alert",
771
+ success: "border-success"
772
+ },
773
+ /**
774
+ * Disable the input addon, preventing user interaction and adding opacity.
775
+ */
776
+ disabled: {
777
+ true: ["pointer-events-none border-outline!"]
778
+ },
779
+ /**
780
+ * Changes input addon styles based on the read only status from the input.
781
+ */
782
+ readOnly: {
783
+ true: ["pointer-events-none"]
784
+ },
785
+ /**
786
+ * Main style of the input addon.
787
+ */
788
+ design: {
789
+ text: "",
790
+ solid: "",
791
+ inline: ""
792
+ }
793
+ },
794
+ compoundVariants: [
795
+ {
796
+ disabled: false,
797
+ readOnly: false,
798
+ design: "text",
799
+ class: ["bg-surface", "text-on-surface"]
800
+ },
801
+ {
802
+ disabled: true,
803
+ design: "text",
804
+ class: ["text-on-surface/dim-3"]
805
+ },
806
+ {
807
+ disabled: true,
808
+ design: ["solid", "inline"],
809
+ class: ["opacity-dim-3"]
810
+ }
811
+ ],
812
+ defaultVariants: {
813
+ intent: "neutral"
814
+ }
815
+ }
816
+ );
817
+
818
+ // src/input/InputAddon.tsx
819
+ var import_jsx_runtime20 = require("react/jsx-runtime");
820
+ var InputAddon = ({
821
+ asChild: asChildProp,
822
+ className,
823
+ children,
824
+ ref,
825
+ ...others
826
+ }) => {
827
+ const { state, disabled, readOnly } = useInputGroup();
828
+ const isRawText = typeof children === "string";
829
+ const asChild = !!(isRawText ? false : asChildProp);
830
+ const child = isRawText ? children : import_react10.Children.only(children);
831
+ const Component = asChild && !isRawText ? Slot : "div";
832
+ const getDesign = () => {
833
+ if (isRawText) return "text";
834
+ return asChild ? "solid" : "inline";
835
+ };
836
+ const design = getDesign();
837
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
838
+ Component,
839
+ {
840
+ ref,
841
+ className: inputAddonStyles({
842
+ className,
843
+ intent: state,
844
+ disabled,
845
+ readOnly,
846
+ asChild,
847
+ design
848
+ }),
849
+ ...disabled && { tabIndex: -1 },
850
+ ...others,
851
+ children: child
852
+ }
853
+ );
854
+ };
855
+ InputAddon.displayName = "InputGroup.Addon";
856
+
857
+ // src/input/InputLeadingAddon.tsx
858
+ var import_jsx_runtime21 = require("react/jsx-runtime");
859
+ var Root2 = ({ className, ref, ...others }) => {
860
+ const { disabled, readOnly } = useInputGroup();
861
+ const isInactive = disabled || readOnly;
862
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: (0, import_class_variance_authority14.cx)("rounded-l-lg", isInactive ? "bg-on-surface/dim-5" : null), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
863
+ InputAddon,
864
+ {
865
+ ref,
866
+ className: (0, import_class_variance_authority14.cx)(className, "rounded-r-0! mr-[-1px] rounded-l-lg"),
867
+ ...others
868
+ }
869
+ ) });
870
+ };
871
+ var InputLeadingAddon = Object.assign(Root2, {
872
+ id: "LeadingAddon"
873
+ });
874
+ Root2.displayName = "InputGroup.LeadingAddon";
875
+
876
+ // src/input/InputLeadingIcon.tsx
877
+ var import_class_variance_authority16 = require("class-variance-authority");
878
+
879
+ // src/input/InputIcon.tsx
880
+ var import_class_variance_authority15 = require("class-variance-authority");
881
+ var import_jsx_runtime22 = require("react/jsx-runtime");
882
+ var InputIcon = ({ className, intent, children, ...others }) => {
883
+ const { disabled, readOnly } = useInputGroup();
884
+ const isInactive = disabled || readOnly;
885
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
886
+ Icon,
887
+ {
888
+ intent,
889
+ className: (0, import_class_variance_authority15.cx)(
890
+ className,
891
+ "pointer-events-none absolute top-[calc(var(--spacing-sz-44)/2)] -translate-y-1/2",
892
+ intent ? void 0 : "text-neutral peer-focus:text-outline-high",
893
+ isInactive ? "opacity-dim-3" : void 0
894
+ ),
895
+ ...others,
896
+ children
897
+ }
898
+ );
899
+ };
900
+ InputIcon.displayName = "InputGroup.Icon";
901
+
902
+ // src/input/InputLeadingIcon.tsx
903
+ var import_jsx_runtime23 = require("react/jsx-runtime");
904
+ var InputLeadingIcon = ({ className, ...others }) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(InputIcon, { className: (0, import_class_variance_authority16.cx)(className, "left-lg text-body-1"), ...others });
905
+ InputLeadingIcon.id = "LeadingIcon";
906
+ InputLeadingIcon.displayName = "InputGroup.LeadingIcon";
907
+
908
+ // src/input/InputTrailingAddon.tsx
909
+ var import_class_variance_authority17 = require("class-variance-authority");
910
+ var import_jsx_runtime24 = require("react/jsx-runtime");
911
+ var Root3 = ({ className, ref, ...others }) => {
912
+ const { disabled, readOnly } = useInputGroup();
913
+ const isInactive = disabled || readOnly;
914
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: (0, import_class_variance_authority17.cx)("rounded-r-lg", isInactive ? "bg-on-surface/dim-5" : null), children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
915
+ InputAddon,
916
+ {
917
+ ref,
918
+ className: (0, import_class_variance_authority17.cx)(className, "rounded-l-0! ml-[-1px] rounded-r-lg"),
919
+ ...others
920
+ }
921
+ ) });
922
+ };
923
+ var InputTrailingAddon = Object.assign(Root3, {
924
+ id: "TrailingAddon"
925
+ });
926
+ Root3.displayName = "InputGroup.TrailingAddon";
927
+
928
+ // src/input/InputTrailingIcon.tsx
929
+ var import_class_variance_authority18 = require("class-variance-authority");
930
+ var import_jsx_runtime25 = require("react/jsx-runtime");
931
+ var InputTrailingIcon = ({ className, ...others }) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(InputIcon, { className: (0, import_class_variance_authority18.cx)(className, "right-lg text-body-1"), ...others });
932
+ InputTrailingIcon.id = "TrailingIcon";
933
+ InputTrailingIcon.displayName = "InputGroup.TrailingIcon";
934
+
935
+ // src/input/Input.styles.ts
936
+ var import_class_variance_authority19 = require("class-variance-authority");
937
+ var inputStyles = (0, import_class_variance_authority19.cva)(
938
+ [
939
+ "relative",
940
+ "border-sm",
941
+ "peer",
942
+ "w-full",
943
+ "appearance-none outline-hidden",
944
+ "bg-surface",
945
+ "text-ellipsis text-body-1 text-on-surface",
946
+ "caret-neutral",
947
+ "autofill:shadow-surface autofill:shadow-[inset_0_0_0px_1000px]",
948
+ "disabled:cursor-not-allowed disabled:border-outline disabled:bg-on-surface/dim-5 disabled:text-on-surface/dim-3",
949
+ "read-only:cursor-default read-only:pointer-events-none read-only:bg-on-surface/dim-5",
950
+ "focus:ring-1 focus:ring-inset"
951
+ ],
952
+ {
953
+ variants: {
954
+ /**
955
+ * Change the component to the HTML tag or custom component of the only child.
956
+ */
957
+ asChild: {
958
+ true: ["min-h-sz-44"],
959
+ false: ["h-sz-44"]
960
+ },
961
+ /**
962
+ * Color scheme of the button.
963
+ */
964
+ intent: {
965
+ neutral: [
966
+ "border-outline",
967
+ "hover:border-outline-high",
968
+ "focus:ring-outline-high focus:border-outline-high"
969
+ ],
970
+ success: ["border-success", "focus:ring-success"],
971
+ alert: ["border-alert", "focus:ring-alert"],
972
+ error: ["border-error", "focus:ring-error"]
973
+ },
974
+ /**
975
+ * Sets if there is an addon before the input text.
976
+ */
977
+ hasLeadingAddon: {
978
+ true: ["rounded-l-0"],
979
+ false: ["rounded-l-lg"]
980
+ },
981
+ /**
982
+ * Sets if there is an addon after the input text.
983
+ */
984
+ hasTrailingAddon: {
985
+ true: ["rounded-r-0"],
986
+ false: ["rounded-r-lg"]
987
+ },
988
+ /**
989
+ * Sets if there is an icon before the input text.
990
+ */
991
+ hasLeadingIcon: {
992
+ true: ["pl-3xl"],
993
+ false: ["pl-lg"]
994
+ },
995
+ /**
996
+ * Sets if there is an icon after the input text.
997
+ */
998
+ hasTrailingIcon: { true: "" },
999
+ /**
1000
+ * Sets if there is a button to clear the input text.
1001
+ */
1002
+ hasClearButton: { true: "" }
1003
+ },
1004
+ compoundVariants: [
1005
+ {
1006
+ hasTrailingIcon: false,
1007
+ hasClearButton: false,
1008
+ class: "pr-lg"
1009
+ },
1010
+ {
1011
+ hasTrailingIcon: true,
1012
+ hasClearButton: false,
1013
+ class: "pr-3xl"
1014
+ },
1015
+ {
1016
+ hasTrailingIcon: false,
1017
+ hasClearButton: true,
1018
+ class: "pr-3xl"
1019
+ },
1020
+ {
1021
+ hasTrailingIcon: true,
1022
+ hasClearButton: true,
1023
+ class: "pr-[calc(var(--spacing-3xl)*2)]"
1024
+ }
1025
+ ],
1026
+ defaultVariants: {
1027
+ intent: "neutral"
1028
+ }
1029
+ }
1030
+ );
1031
+
1032
+ // src/input/Input.tsx
1033
+ var import_jsx_runtime26 = require("react/jsx-runtime");
1034
+ var Root4 = ({
1035
+ className,
1036
+ asChild = false,
1037
+ onValueChange,
1038
+ onChange,
1039
+ onKeyDown,
1040
+ disabled: disabledProp,
1041
+ readOnly: readOnlyProp,
1042
+ ref,
1043
+ ...others
1044
+ }) => {
1045
+ const field = useFormFieldControl();
1046
+ const group = useInputGroup();
1047
+ const { id, name, isInvalid, isRequired, description } = field;
1048
+ const {
1049
+ hasLeadingAddon,
1050
+ hasTrailingAddon,
1051
+ hasLeadingIcon,
1052
+ hasTrailingIcon,
1053
+ hasClearButton,
1054
+ onClear
1055
+ } = group;
1056
+ const Component = asChild ? Slot : "input";
1057
+ const state = field.state || group.state;
1058
+ const disabled = field.disabled || group.disabled || disabledProp;
1059
+ const readOnly = field.readOnly || group.readOnly || readOnlyProp;
1060
+ const handleChange = (event) => {
1061
+ if (onChange) {
1062
+ onChange(event);
1063
+ }
1064
+ if (onValueChange) {
1065
+ onValueChange(event.target.value);
1066
+ }
1067
+ };
1068
+ const handleKeyDown = (event) => {
1069
+ if (onKeyDown) {
1070
+ onKeyDown(event);
1071
+ }
1072
+ if (hasClearButton && onClear && event.key === "Escape") {
1073
+ onClear();
1074
+ }
1075
+ };
1076
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1077
+ Component,
1078
+ {
1079
+ ref,
1080
+ id,
1081
+ name,
1082
+ className: inputStyles({
1083
+ asChild,
1084
+ className,
1085
+ intent: state,
1086
+ hasLeadingAddon: !!hasLeadingAddon,
1087
+ hasTrailingAddon: !!hasTrailingAddon,
1088
+ hasLeadingIcon: !!hasLeadingIcon,
1089
+ hasTrailingIcon: !!hasTrailingIcon,
1090
+ hasClearButton: !!hasClearButton
1091
+ }),
1092
+ disabled,
1093
+ readOnly,
1094
+ required: isRequired,
1095
+ "aria-describedby": description,
1096
+ "aria-invalid": isInvalid,
1097
+ onChange: handleChange,
1098
+ onKeyDown: handleKeyDown,
1099
+ ...others
1100
+ }
1101
+ );
1102
+ };
1103
+ var Input = Object.assign(Root4, {
1104
+ id: "Input"
1105
+ });
1106
+ Root4.displayName = "Input";
1107
+
1108
+ // src/input/index.ts
1109
+ var InputGroup2 = Object.assign(InputGroup, {
1110
+ LeadingAddon: InputLeadingAddon,
1111
+ TrailingAddon: InputTrailingAddon,
1112
+ LeadingIcon: InputLeadingIcon,
1113
+ TrailingIcon: InputTrailingIcon,
1114
+ ClearButton: InputClearButton
1115
+ });
1116
+ InputGroup2.displayName = "InputGroup";
1117
+ InputLeadingAddon.displayName = "InputGroup.LeadingAddon";
1118
+ InputTrailingAddon.displayName = "InputGroup.TrailingAddon";
1119
+ InputLeadingIcon.displayName = "InputGroup.LeadingIcon";
1120
+ InputTrailingIcon.displayName = "InputGroup.TrailingIcon";
1121
+ InputClearButton.displayName = "InputGroup.ClearButton";
1122
+
1123
+ // src/stepper/useStepper.ts
1124
+ var import_numberfield = require("@react-aria/numberfield");
1125
+ var import_numberfield2 = require("@react-stately/numberfield");
1126
+ var useStepper = ({
1127
+ inputRef,
1128
+ locale = "fr",
1129
+ ...rest
1130
+ }) => {
1131
+ const state = (0, import_numberfield2.useNumberFieldState)({
1132
+ ...rest,
1133
+ isDisabled: rest.disabled,
1134
+ isReadOnly: rest.readOnly,
1135
+ isRequired: rest.required,
1136
+ locale
1137
+ });
1138
+ const { groupProps, inputProps, incrementButtonProps, decrementButtonProps } = (0, import_numberfield.useNumberField)(
1139
+ {
1140
+ isWheelDisabled: false,
1141
+ ...rest,
1142
+ isDisabled: rest.disabled,
1143
+ isReadOnly: rest.readOnly,
1144
+ isRequired: rest.required
1145
+ },
1146
+ state,
1147
+ inputRef
1148
+ );
1149
+ return {
1150
+ groupProps,
1151
+ inputProps,
1152
+ incrementButtonProps,
1153
+ decrementButtonProps
1154
+ };
1155
+ };
1156
+
1157
+ // src/stepper/Stepper.tsx
1158
+ var import_jsx_runtime27 = require("react/jsx-runtime");
1159
+ var StepperContext = (0, import_react11.createContext)(null);
1160
+ var Stepper = ({
1161
+ children,
1162
+ formatOptions,
1163
+ minValue,
1164
+ maxValue,
1165
+ incrementAriaLabel,
1166
+ decrementAriaLabel,
1167
+ ref: forwardedRef,
1168
+ ...stepperProps
1169
+ }) => {
1170
+ const inputRef = (0, import_react11.useRef)(null);
1171
+ const {
1172
+ groupProps,
1173
+ inputProps: _inputProps,
1174
+ incrementButtonProps: _incrementButtonProps,
1175
+ decrementButtonProps: _decrementButtonProps
1176
+ } = useStepper({
1177
+ ...{
1178
+ ...stepperProps,
1179
+ onChange: stepperProps.onValueChange
1180
+ },
1181
+ formatOptions,
1182
+ minValue,
1183
+ maxValue,
1184
+ incrementAriaLabel,
1185
+ decrementAriaLabel,
1186
+ inputRef
1187
+ });
1188
+ const formFieldControlProps = useFormFieldControl();
1189
+ const isWrappedInFormField = !!formFieldControlProps.id;
1190
+ const incrementButtonProps = {
1191
+ ..._incrementButtonProps,
1192
+ ...isWrappedInFormField && { "aria-controls": formFieldControlProps.id }
1193
+ };
1194
+ const decrementButtonProps = {
1195
+ ..._decrementButtonProps,
1196
+ ...isWrappedInFormField && { "aria-controls": formFieldControlProps.id }
1197
+ };
1198
+ const inputProps = {
1199
+ ..._inputProps,
1200
+ ...isWrappedInFormField && {
1201
+ id: formFieldControlProps.id,
1202
+ required: formFieldControlProps.isRequired,
1203
+ "aria-invalid": formFieldControlProps.isInvalid ? true : void 0
1204
+ }
1205
+ };
1206
+ const { onValueChange: _, ...remainingStepperProps } = stepperProps;
1207
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
1208
+ StepperContext.Provider,
1209
+ {
1210
+ value: { incrementButtonProps, decrementButtonProps, inputProps, inputRef },
1211
+ children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
1212
+ InputGroup2,
1213
+ {
1214
+ ...remainingStepperProps,
1215
+ ...groupProps,
1216
+ "data-spark-component": "stepper",
1217
+ ref: forwardedRef,
1218
+ children
1219
+ }
1220
+ )
1221
+ }
1222
+ );
1223
+ };
1224
+ Stepper.displayName = "Stepper";
1225
+ var useStepperContext = () => {
1226
+ const context = (0, import_react11.useContext)(StepperContext);
1227
+ if (!context) {
1228
+ throw Error("useStepperContext must be used within a Stepper provider");
1229
+ }
1230
+ return context;
1231
+ };
1232
+
1233
+ // src/stepper/StepperButton.tsx
1234
+ var import_button2 = require("@react-aria/button");
1235
+ var import_Minus = require("@spark-ui/icons/Minus");
1236
+ var import_Plus = require("@spark-ui/icons/Plus");
1237
+ var import_react13 = require("react");
1238
+
1239
+ // src/button/Button.tsx
1240
+ var import_class_variance_authority22 = require("class-variance-authority");
1241
+ var import_react12 = require("react");
1242
+
1243
+ // src/spinner/Spinner.styles.tsx
1244
+ var import_internal_utils2 = require("@spark-ui/internal-utils");
1245
+ var import_class_variance_authority20 = require("class-variance-authority");
1246
+ var defaultVariants = {
1247
+ intent: "current",
1248
+ size: "current",
1249
+ isBackgroundVisible: false
1250
+ };
1251
+ var spinnerStyles = (0, import_class_variance_authority20.cva)(
1252
+ ["inline-block", "border-solid", "rounded-full", "border-md", "animate-spin"],
1253
+ {
1254
+ variants: {
1255
+ /**
1256
+ * Use `size` prop to set the size of the spinner. If you want to set the full size for the spinner, don't forget to add a wrapping container with its own size.
1257
+ */
1258
+ size: {
1259
+ current: ["u-current-font-size"],
1260
+ sm: ["w-sz-20", "h-sz-20"],
1261
+ md: ["w-sz-28", "h-sz-28"],
1262
+ full: ["w-full", "h-full"]
1263
+ },
1264
+ /**
1265
+ * Color scheme of the spinner.
1266
+ */
1267
+ intent: (0, import_internal_utils2.makeVariants)({
1268
+ current: ["border-current"],
1269
+ main: ["border-main"],
1270
+ support: ["border-support"],
1271
+ accent: ["border-accent"],
1272
+ basic: ["border-basic"],
1273
+ success: ["border-success"],
1274
+ alert: ["border-alert"],
1275
+ error: ["border-error"],
1276
+ info: ["border-info"],
1277
+ neutral: ["border-neutral"]
1278
+ }),
1279
+ /**
1280
+ * Size of the button.
1281
+ */
1282
+ isBackgroundVisible: {
1283
+ true: ["border-b-neutral-container", "border-l-neutral-container"],
1284
+ false: ["border-b-transparent", "border-l-transparent"]
1285
+ }
1286
+ },
1287
+ defaultVariants
1288
+ }
1289
+ );
1290
+
1291
+ // src/spinner/Spinner.tsx
1292
+ var import_jsx_runtime28 = require("react/jsx-runtime");
1293
+ var Spinner = ({
1294
+ className,
1295
+ size = "current",
1296
+ intent = "current",
1297
+ label,
1298
+ isBackgroundVisible,
1299
+ ref,
1300
+ ...others
1301
+ }) => {
1302
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
1303
+ "span",
1304
+ {
1305
+ role: "status",
1306
+ "data-spark-component": "spinner",
1307
+ ref,
1308
+ className: spinnerStyles({ className, size, intent, isBackgroundVisible }),
1309
+ ...others,
1310
+ children: label && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(VisuallyHidden, { children: label })
1311
+ }
1312
+ );
1313
+ };
1314
+
1315
+ // src/button/Button.styles.tsx
1316
+ var import_internal_utils8 = require("@spark-ui/internal-utils");
1317
+ var import_class_variance_authority21 = require("class-variance-authority");
1318
+
1319
+ // src/button/variants/filled.ts
1320
+ var import_internal_utils3 = require("@spark-ui/internal-utils");
1321
+ var filledVariants = [
1322
+ // Main
1323
+ {
1324
+ intent: "main",
1325
+ design: "filled",
1326
+ class: (0, import_internal_utils3.tw)([
1327
+ "bg-main",
1328
+ "text-on-main",
1329
+ "hover:bg-main-hovered",
1330
+ "enabled:active:bg-main-hovered",
1331
+ "focus-visible:bg-main-hovered"
1332
+ ])
1333
+ },
1334
+ // Support
1335
+ {
1336
+ intent: "support",
1337
+ design: "filled",
1338
+ class: (0, import_internal_utils3.tw)([
1339
+ "bg-support",
1340
+ "text-on-support",
1341
+ "hover:bg-support-hovered",
1342
+ "enabled:active:bg-support-hovered",
1343
+ "focus-visible:bg-support-hovered"
1344
+ ])
1345
+ },
1346
+ // Accent
1347
+ {
1348
+ intent: "accent",
1349
+ design: "filled",
1350
+ class: (0, import_internal_utils3.tw)([
1351
+ "bg-accent",
1352
+ "text-on-accent",
1353
+ "hover:bg-accent-hovered",
1354
+ "enabled:active:bg-accent-hovered",
1355
+ "focus-visible:bg-accent-hovered"
1356
+ ])
1357
+ },
1358
+ // Basic
1359
+ {
1360
+ intent: "basic",
1361
+ design: "filled",
1362
+ class: (0, import_internal_utils3.tw)([
1363
+ "bg-basic",
1364
+ "text-on-basic",
1365
+ "hover:bg-basic-hovered",
1366
+ "enabled:active:bg-basic-hovered",
1367
+ "focus-visible:bg-basic-hovered"
1368
+ ])
1369
+ },
1370
+ // Success
1371
+ {
1372
+ intent: "success",
1373
+ design: "filled",
1374
+ class: (0, import_internal_utils3.tw)([
1375
+ "bg-success",
1376
+ "text-on-success",
1377
+ "hover:bg-success-hovered",
1378
+ "enabled:active:bg-success-hovered",
1379
+ "focus-visible:bg-success-hovered"
1380
+ ])
1381
+ },
1382
+ // Alert
1383
+ {
1384
+ intent: "alert",
1385
+ design: "filled",
1386
+ class: (0, import_internal_utils3.tw)([
1387
+ "bg-alert",
1388
+ "text-on-alert",
1389
+ "hover:bg-alert-hovered",
1390
+ "enabled:active:bg-alert-hovered",
1391
+ "focus-visible:bg-alert-hovered"
1392
+ ])
1393
+ },
1394
+ // Danger
1395
+ {
1396
+ intent: "danger",
1397
+ design: "filled",
1398
+ class: (0, import_internal_utils3.tw)([
1399
+ "text-on-error bg-error",
1400
+ "hover:bg-error-hovered enabled:active:bg-error-hovered",
1401
+ "focus-visible:bg-error-hovered"
1402
+ ])
1403
+ },
1404
+ // Info
1405
+ {
1406
+ intent: "info",
1407
+ design: "filled",
1408
+ class: (0, import_internal_utils3.tw)([
1409
+ "text-on-error bg-info",
1410
+ "hover:bg-info-hovered enabled:active:bg-info-hovered",
1411
+ "focus-visible:bg-info-hovered"
1412
+ ])
1413
+ },
1414
+ // Neutral
1415
+ {
1416
+ intent: "neutral",
1417
+ design: "filled",
1418
+ class: (0, import_internal_utils3.tw)([
1419
+ "bg-neutral",
1420
+ "text-on-neutral",
1421
+ "hover:bg-neutral-hovered",
1422
+ "enabled:active:bg-neutral-hovered",
1423
+ "focus-visible:bg-neutral-hovered"
1424
+ ])
1425
+ },
1426
+ // Surface
1427
+ {
1428
+ intent: "surface",
1429
+ design: "filled",
1430
+ class: (0, import_internal_utils3.tw)([
1431
+ "bg-surface",
1432
+ "text-on-surface",
1433
+ "hover:bg-surface-hovered",
1434
+ "enabled:active:bg-surface-hovered",
1435
+ "focus-visible:bg-surface-hovered"
1436
+ ])
1437
+ }
1438
+ ];
1439
+
1440
+ // src/button/variants/ghost.ts
1441
+ var import_internal_utils4 = require("@spark-ui/internal-utils");
1442
+ var ghostVariants = [
1443
+ {
1444
+ intent: "main",
1445
+ design: "ghost",
1446
+ class: (0, import_internal_utils4.tw)([
1447
+ "text-main",
1448
+ "hover:bg-main/dim-5",
1449
+ "enabled:active:bg-main/dim-5",
1450
+ "focus-visible:bg-main/dim-5"
1451
+ ])
1452
+ },
1453
+ {
1454
+ intent: "support",
1455
+ design: "ghost",
1456
+ class: (0, import_internal_utils4.tw)([
1457
+ "text-support",
1458
+ "hover:bg-support/dim-5",
1459
+ "enabled:active:bg-support/dim-5",
1460
+ "focus-visible:bg-support/dim-5"
1461
+ ])
1462
+ },
1463
+ {
1464
+ intent: "accent",
1465
+ design: "ghost",
1466
+ class: (0, import_internal_utils4.tw)([
1467
+ "text-accent",
1468
+ "hover:bg-accent/dim-5",
1469
+ "enabled:active:bg-accent/dim-5",
1470
+ "focus-visible:bg-accent/dim-5"
1471
+ ])
1472
+ },
1473
+ {
1474
+ intent: "basic",
1475
+ design: "ghost",
1476
+ class: (0, import_internal_utils4.tw)([
1477
+ "text-basic",
1478
+ "hover:bg-basic/dim-5",
1479
+ "enabled:active:bg-basic/dim-5",
1480
+ "focus-visible:bg-basic/dim-5"
1481
+ ])
1482
+ },
1483
+ {
1484
+ intent: "success",
1485
+ design: "ghost",
1486
+ class: (0, import_internal_utils4.tw)([
1487
+ "text-success",
1488
+ "hover:bg-success/dim-5",
1489
+ "enabled:active:bg-success/dim-5",
1490
+ "focus-visible:bg-success/dim-5"
1491
+ ])
1492
+ },
1493
+ {
1494
+ intent: "alert",
1495
+ design: "ghost",
1496
+ class: (0, import_internal_utils4.tw)([
1497
+ "text-alert",
1498
+ "hover:bg-alert/dim-5",
1499
+ "enabled:active:bg-alert/dim-5",
1500
+ "focus-visible:bg-alert/dim-5"
1501
+ ])
1502
+ },
1503
+ {
1504
+ intent: "danger",
1505
+ design: "ghost",
1506
+ class: (0, import_internal_utils4.tw)([
1507
+ "text-error",
1508
+ "hover:bg-error/dim-5",
1509
+ "enabled:active:bg-error/dim-5",
1510
+ "focus-visible:bg-error/dim-5"
1511
+ ])
1512
+ },
1513
+ {
1514
+ intent: "info",
1515
+ design: "ghost",
1516
+ class: (0, import_internal_utils4.tw)([
1517
+ "text-info",
1518
+ "hover:bg-info/dim-5",
1519
+ "enabled:active:bg-info/dim-5",
1520
+ "focus-visible:bg-info/dim-5"
1521
+ ])
1522
+ },
1523
+ {
1524
+ intent: "neutral",
1525
+ design: "ghost",
1526
+ class: (0, import_internal_utils4.tw)([
1527
+ "text-neutral",
1528
+ "hover:bg-neutral/dim-5",
1529
+ "enabled:active:bg-neutral/dim-5",
1530
+ "focus-visible:bg-neutral/dim-5"
1531
+ ])
1532
+ },
1533
+ {
1534
+ intent: "surface",
1535
+ design: "ghost",
1536
+ class: (0, import_internal_utils4.tw)([
1537
+ "text-surface",
1538
+ "hover:bg-surface/dim-5",
1539
+ "enabled:active:bg-surface/dim-5",
1540
+ "focus-visible:bg-surface/dim-5"
1541
+ ])
1542
+ }
1543
+ ];
1544
+
1545
+ // src/button/variants/outlined.ts
1546
+ var import_internal_utils5 = require("@spark-ui/internal-utils");
1547
+ var outlinedVariants = [
1548
+ {
1549
+ intent: "main",
1550
+ design: "outlined",
1551
+ class: (0, import_internal_utils5.tw)([
1552
+ "hover:bg-main/dim-5",
1553
+ "enabled:active:bg-main/dim-5",
1554
+ "focus-visible:bg-main/dim-5",
1555
+ "text-main"
1556
+ ])
1557
+ },
1558
+ {
1559
+ intent: "support",
1560
+ design: "outlined",
1561
+ class: (0, import_internal_utils5.tw)([
1562
+ "hover:bg-support/dim-5",
1563
+ "enabled:active:bg-support/dim-5",
1564
+ "focus-visible:bg-support/dim-5",
1565
+ "text-support"
1566
+ ])
1567
+ },
1568
+ {
1569
+ intent: "accent",
1570
+ design: "outlined",
1571
+ class: (0, import_internal_utils5.tw)([
1572
+ "hover:bg-accent/dim-5",
1573
+ "enabled:active:bg-accent/dim-5",
1574
+ "focus-visible:bg-accent/dim-5",
1575
+ "text-accent"
1576
+ ])
1577
+ },
1578
+ {
1579
+ intent: "basic",
1580
+ design: "outlined",
1581
+ class: (0, import_internal_utils5.tw)([
1582
+ "hover:bg-basic/dim-5",
1583
+ "enabled:active:bg-basic/dim-5",
1584
+ "focus-visible:bg-basic/dim-5",
1585
+ "text-basic"
1586
+ ])
1587
+ },
1588
+ {
1589
+ intent: "success",
1590
+ design: "outlined",
1591
+ class: (0, import_internal_utils5.tw)([
1592
+ "hover:bg-success/dim-5",
1593
+ "enabled:active:bg-success/dim-5",
1594
+ "focus-visible:bg-success/dim-5",
1595
+ "text-success"
1596
+ ])
1597
+ },
1598
+ {
1599
+ intent: "alert",
1600
+ design: "outlined",
1601
+ class: (0, import_internal_utils5.tw)([
1602
+ "hover:bg-alert/dim-5",
1603
+ "enabled:active:bg-alert/dim-5",
1604
+ "focus-visible:bg-alert/dim-5",
1605
+ "text-alert"
1606
+ ])
1607
+ },
1608
+ {
1609
+ intent: "danger",
1610
+ design: "outlined",
1611
+ class: (0, import_internal_utils5.tw)([
1612
+ "hover:bg-error/dim-5",
1613
+ "enabled:active:bg-error/dim-5",
1614
+ "focus-visible:bg-error/dim-5",
1615
+ "text-error"
1616
+ ])
1617
+ },
1618
+ {
1619
+ intent: "info",
1620
+ design: "outlined",
1621
+ class: (0, import_internal_utils5.tw)([
1622
+ "hover:bg-info/dim-5",
1623
+ "enabled:active:bg-info/dim-5",
1624
+ "focus-visible:bg-info/dim-5",
1625
+ "text-info"
1626
+ ])
1627
+ },
1628
+ {
1629
+ intent: "neutral",
1630
+ design: "outlined",
1631
+ class: (0, import_internal_utils5.tw)([
1632
+ "hover:bg-neutral/dim-5",
1633
+ "enabled:active:bg-neutral/dim-5",
1634
+ "focus-visible:bg-neutral/dim-5",
1635
+ "text-neutral"
1636
+ ])
1637
+ },
1638
+ {
1639
+ intent: "surface",
1640
+ design: "outlined",
1641
+ class: (0, import_internal_utils5.tw)([
1642
+ "hover:bg-surface/dim-5",
1643
+ "enabled:active:bg-surface/dim-5",
1644
+ "focus-visible:bg-surface/dim-5",
1645
+ "text-surface"
1646
+ ])
1647
+ }
1648
+ ];
1649
+
1650
+ // src/button/variants/tinted.ts
1651
+ var import_internal_utils6 = require("@spark-ui/internal-utils");
1652
+ var tintedVariants = [
1653
+ {
1654
+ intent: "main",
1655
+ design: "tinted",
1656
+ class: (0, import_internal_utils6.tw)([
1657
+ "bg-main-container",
1658
+ "text-on-main-container",
1659
+ "hover:bg-main-container-hovered",
1660
+ "enabled:active:bg-main-container-hovered",
1661
+ "focus-visible:bg-main-container-hovered"
1662
+ ])
1663
+ },
1664
+ {
1665
+ intent: "support",
1666
+ design: "tinted",
1667
+ class: (0, import_internal_utils6.tw)([
1668
+ "bg-support-container",
1669
+ "text-on-support-container",
1670
+ "hover:bg-support-container-hovered",
1671
+ "enabled:active:bg-support-container-hovered",
1672
+ "focus-visible:bg-support-container-hovered"
1673
+ ])
1674
+ },
1675
+ {
1676
+ intent: "accent",
1677
+ design: "tinted",
1678
+ class: (0, import_internal_utils6.tw)([
1679
+ "bg-accent-container",
1680
+ "text-on-accent-container",
1681
+ "hover:bg-accent-container-hovered",
1682
+ "enabled:active:bg-accent-container-hovered",
1683
+ "focus-visible:bg-accent-container-hovered"
1684
+ ])
1685
+ },
1686
+ {
1687
+ intent: "basic",
1688
+ design: "tinted",
1689
+ class: (0, import_internal_utils6.tw)([
1690
+ "bg-basic-container",
1691
+ "text-on-basic-container",
1692
+ "hover:bg-basic-container-hovered",
1693
+ "enabled:active:bg-basic-container-hovered",
1694
+ "focus-visible:bg-basic-container-hovered"
1695
+ ])
1696
+ },
1697
+ {
1698
+ intent: "success",
1699
+ design: "tinted",
1700
+ class: (0, import_internal_utils6.tw)([
1701
+ "bg-success-container",
1702
+ "text-on-success-container",
1703
+ "hover:bg-success-container-hovered",
1704
+ "enabled:active:bg-success-container-hovered",
1705
+ "focus-visible:bg-success-container-hovered"
1706
+ ])
1707
+ },
1708
+ {
1709
+ intent: "alert",
1710
+ design: "tinted",
1711
+ class: (0, import_internal_utils6.tw)([
1712
+ "bg-alert-container",
1713
+ "text-on-alert-container",
1714
+ "hover:bg-alert-container-hovered",
1715
+ "enabled:active:bg-alert-container-hovered",
1716
+ "focus-visible:bg-alert-container-hovered"
1717
+ ])
1718
+ },
1719
+ {
1720
+ intent: "danger",
1721
+ design: "tinted",
1722
+ class: (0, import_internal_utils6.tw)([
1723
+ "bg-error-container",
1724
+ "text-on-error-container",
1725
+ "hover:bg-error-container-hovered",
1726
+ "enabled:active:bg-error-container-hovered",
1727
+ "focus-visible:bg-error-container-hovered"
1728
+ ])
1729
+ },
1730
+ {
1731
+ intent: "info",
1732
+ design: "tinted",
1733
+ class: (0, import_internal_utils6.tw)([
1734
+ "bg-info-container",
1735
+ "text-on-info-container",
1736
+ "hover:bg-info-container-hovered",
1737
+ "enabled:active:bg-info-container-hovered",
1738
+ "focus-visible:bg-info-container-hovered"
1739
+ ])
1740
+ },
1741
+ {
1742
+ intent: "neutral",
1743
+ design: "tinted",
1744
+ class: (0, import_internal_utils6.tw)([
1745
+ "bg-neutral-container",
1746
+ "text-on-neutral-container",
1747
+ "hover:bg-neutral-container-hovered",
1748
+ "enabled:active:bg-neutral-container-hovered",
1749
+ "focus-visible:bg-neutral-container-hovered"
1750
+ ])
1751
+ },
1752
+ {
1753
+ intent: "surface",
1754
+ design: "tinted",
1755
+ class: (0, import_internal_utils6.tw)([
1756
+ "bg-surface",
1757
+ "text-on-surface",
1758
+ "hover:bg-surface-hovered",
1759
+ "enabled:active:bg-surface-hovered",
1760
+ "focus-visible:bg-surface-hovered"
1761
+ ])
1762
+ }
1763
+ ];
1764
+
1765
+ // src/button/variants/contrast.ts
1766
+ var import_internal_utils7 = require("@spark-ui/internal-utils");
1767
+ var contrastVariants = [
1768
+ {
1769
+ intent: "main",
1770
+ design: "contrast",
1771
+ class: (0, import_internal_utils7.tw)([
1772
+ "text-main",
1773
+ "hover:bg-main-container-hovered",
1774
+ "enabled:active:bg-main-container-hovered",
1775
+ "focus-visible:bg-main-container-hovered"
1776
+ ])
1777
+ },
1778
+ {
1779
+ intent: "support",
1780
+ design: "contrast",
1781
+ class: (0, import_internal_utils7.tw)([
1782
+ "text-support",
1783
+ "hover:bg-support-container-hovered",
1784
+ "enabled:active:bg-support-container-hovered",
1785
+ "focus-visible:bg-support-container-hovered"
1786
+ ])
1787
+ },
1788
+ {
1789
+ intent: "accent",
1790
+ design: "contrast",
1791
+ class: (0, import_internal_utils7.tw)([
1792
+ "text-accent",
1793
+ "hover:bg-accent-container-hovered",
1794
+ "enabled:active:bg-accent-container-hovered",
1795
+ "focus-visible:bg-accent-container-hovered"
1796
+ ])
1797
+ },
1798
+ {
1799
+ intent: "basic",
1800
+ design: "contrast",
1801
+ class: (0, import_internal_utils7.tw)([
1802
+ "text-basic",
1803
+ "hover:bg-basic-container-hovered",
1804
+ "enabled:active:bg-basic-container-hovered",
1805
+ "focus-visible:bg-basic-container-hovered"
1806
+ ])
1807
+ },
1808
+ {
1809
+ intent: "success",
1810
+ design: "contrast",
1811
+ class: (0, import_internal_utils7.tw)([
1812
+ "text-success",
1813
+ "hover:bg-success-container-hovered",
1814
+ "enabled:active:bg-success-container-hovered",
1815
+ "focus-visible:bg-success-container-hovered"
1816
+ ])
1817
+ },
1818
+ {
1819
+ intent: "alert",
1820
+ design: "contrast",
1821
+ class: (0, import_internal_utils7.tw)([
1822
+ "text-alert",
1823
+ "hover:bg-alert-container-hovered",
1824
+ "enabled:active:bg-alert-container-hovered",
1825
+ "focus-visible:bg-alert-container-hovered"
1826
+ ])
1827
+ },
1828
+ {
1829
+ intent: "danger",
1830
+ design: "contrast",
1831
+ class: (0, import_internal_utils7.tw)([
1832
+ "text-error",
1833
+ "hover:bg-error-container-hovered",
1834
+ "enabled:active:bg-error-container-hovered",
1835
+ "focus-visible:bg-error-container-hovered"
1836
+ ])
1837
+ },
1838
+ {
1839
+ intent: "info",
1840
+ design: "contrast",
1841
+ class: (0, import_internal_utils7.tw)([
1842
+ "text-info",
1843
+ "hover:bg-info-container-hovered",
1844
+ "enabled:active:bg-info-container-hovered",
1845
+ "focus-visible:bg-info-container-hovered"
1846
+ ])
1847
+ },
1848
+ {
1849
+ intent: "neutral",
1850
+ design: "contrast",
1851
+ class: (0, import_internal_utils7.tw)([
1852
+ "text-neutral",
1853
+ "hover:bg-neutral-container-hovered",
1854
+ "enabled:active:bg-neutral-container-hovered",
1855
+ "focus-visible:bg-neutral-container-hovered"
1856
+ ])
1857
+ },
1858
+ {
1859
+ intent: "surface",
1860
+ design: "contrast",
1861
+ class: (0, import_internal_utils7.tw)([
1862
+ "text-on-surface",
1863
+ "hover:bg-surface-hovered",
1864
+ "enabled:active:bg-surface-hovered",
1865
+ "focus-visible:bg-surface-hovered"
1866
+ ])
1867
+ }
1868
+ ];
1869
+
1870
+ // src/button/Button.styles.tsx
1871
+ var buttonStyles = (0, import_class_variance_authority21.cva)(
1872
+ [
1873
+ "u-shadow-border-transition",
1874
+ "box-border inline-flex items-center justify-center gap-md whitespace-nowrap",
1875
+ "px-lg",
1876
+ "text-body-1 font-bold",
1877
+ "focus-visible:u-outline"
1878
+ ],
1879
+ {
1880
+ variants: {
1881
+ /**
1882
+ * Main style of the button.
1883
+ *
1884
+ * - `filled`: Button will be plain.
1885
+ *
1886
+ * - `outlined`: Button will be transparent with an outline.
1887
+ *
1888
+ * - `tinted`: Button will be filled but using a lighter color scheme.
1889
+ *
1890
+ * - `ghost`: Button will look like a link. No borders, plain text.
1891
+ *
1892
+ * - `contrast`: Button will be surface filled. No borders, plain text.
1893
+ *
1894
+ */
1895
+ design: (0, import_internal_utils8.makeVariants)({
1896
+ filled: [],
1897
+ outlined: ["bg-transparent", "border-sm", "border-current"],
1898
+ tinted: [],
1899
+ ghost: [],
1900
+ contrast: ["bg-surface"]
1901
+ }),
1902
+ /**
1903
+ * Color scheme of the button.
1904
+ */
1905
+ intent: (0, import_internal_utils8.makeVariants)({
1906
+ main: [],
1907
+ support: [],
1908
+ accent: [],
1909
+ basic: [],
1910
+ success: [],
1911
+ alert: [],
1912
+ danger: [],
1913
+ info: [],
1914
+ neutral: [],
1915
+ surface: []
1916
+ }),
1917
+ /**
1918
+ * Size of the button.
1919
+ */
1920
+ size: (0, import_internal_utils8.makeVariants)({
1921
+ sm: ["min-w-sz-32", "h-sz-32"],
1922
+ md: ["min-w-sz-44", "h-sz-44"],
1923
+ lg: ["min-w-sz-56", "h-sz-56"]
1924
+ }),
1925
+ /**
1926
+ * Shape of the button.
1927
+ */
1928
+ shape: (0, import_internal_utils8.makeVariants)({
1929
+ rounded: ["rounded-lg"],
1930
+ square: ["rounded-0"],
1931
+ pill: ["rounded-full"]
1932
+ }),
1933
+ /**
1934
+ * Disable the button, preventing user interaction and adding opacity.
1935
+ */
1936
+ disabled: {
1937
+ true: ["cursor-not-allowed", "opacity-dim-3"],
1938
+ false: ["cursor-pointer"]
1939
+ }
1940
+ },
1941
+ compoundVariants: [
1942
+ ...filledVariants,
1943
+ ...outlinedVariants,
1944
+ ...tintedVariants,
1945
+ ...ghostVariants,
1946
+ ...contrastVariants
1947
+ ],
1948
+ defaultVariants: {
1949
+ design: "filled",
1950
+ intent: "main",
1951
+ size: "md",
1952
+ shape: "rounded"
1953
+ }
1954
+ }
1955
+ );
1956
+
1957
+ // src/button/Button.tsx
1958
+ var import_jsx_runtime29 = require("react/jsx-runtime");
1959
+ var blockedEventHandlers = [
1960
+ "onClick",
1961
+ "onMouseDown",
1962
+ "onMouseUp",
1963
+ "onMouseEnter",
1964
+ "onMouseLeave",
1965
+ "onMouseOver",
1966
+ "onMouseOut",
1967
+ "onKeyDown",
1968
+ "onKeyPress",
1969
+ "onKeyUp",
1970
+ "onSubmit"
1971
+ ];
1972
+ var Button = ({
1973
+ children,
1974
+ design = "filled",
1975
+ disabled = false,
1976
+ intent = "main",
1977
+ isLoading = false,
1978
+ loadingLabel,
1979
+ loadingText,
1980
+ shape = "rounded",
1981
+ size = "md",
1982
+ asChild,
1983
+ className,
1984
+ ref,
1985
+ ...others
1986
+ }) => {
1987
+ const Component = asChild ? Slot : "button";
1988
+ const shouldNotInteract = !!disabled || isLoading;
1989
+ const disabledEventHandlers = (0, import_react12.useMemo)(() => {
1990
+ const result = {};
1991
+ if (shouldNotInteract) {
1992
+ blockedEventHandlers.forEach((eventHandler) => result[eventHandler] = void 0);
1993
+ }
1994
+ return result;
1995
+ }, [shouldNotInteract]);
1996
+ const spinnerProps = {
1997
+ size: "current",
1998
+ className: loadingText ? "inline-block" : "absolute",
1999
+ ...loadingLabel && { "aria-label": loadingLabel }
2000
+ };
2001
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
2002
+ Component,
2003
+ {
2004
+ "data-spark-component": "button",
2005
+ ...Component === "button" && { type: "button" },
2006
+ ref,
2007
+ className: buttonStyles({
2008
+ className,
2009
+ design,
2010
+ disabled: shouldNotInteract,
2011
+ intent,
2012
+ shape,
2013
+ size
2014
+ }),
2015
+ disabled: !!disabled,
2016
+ "aria-busy": isLoading,
2017
+ "aria-live": isLoading ? "assertive" : "off",
2018
+ ...others,
2019
+ ...disabledEventHandlers,
2020
+ children: wrapPolymorphicSlot(
2021
+ asChild,
2022
+ children,
2023
+ (slotted) => isLoading ? /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
2024
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Spinner, { ...spinnerProps }),
2025
+ loadingText && loadingText,
2026
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
2027
+ "div",
2028
+ {
2029
+ "aria-hidden": true,
2030
+ className: (0, import_class_variance_authority22.cx)("gap-md", loadingText ? "hidden" : "inline-flex opacity-0"),
2031
+ children: slotted
2032
+ }
2033
+ )
2034
+ ] }) : slotted
2035
+ )
2036
+ }
2037
+ );
2038
+ };
2039
+ Button.displayName = "Button";
2040
+
2041
+ // src/icon-button/IconButton.styles.tsx
2042
+ var import_internal_utils9 = require("@spark-ui/internal-utils");
2043
+ var import_class_variance_authority23 = require("class-variance-authority");
2044
+ var iconButtonStyles = (0, import_class_variance_authority23.cva)(["pl-0 pr-0"], {
2045
+ variants: {
2046
+ /**
2047
+ * Sets the size of the icon.
2048
+ */
2049
+ size: (0, import_internal_utils9.makeVariants)({
2050
+ sm: ["text-body-1"],
2051
+ md: ["text-body-1"],
2052
+ lg: ["text-display-3"]
2053
+ })
2054
+ }
2055
+ });
2056
+
2057
+ // src/icon-button/IconButton.tsx
2058
+ var import_jsx_runtime30 = require("react/jsx-runtime");
2059
+ var IconButton = ({
2060
+ design = "filled",
2061
+ disabled = false,
2062
+ intent = "main",
2063
+ shape = "rounded",
2064
+ size = "md",
2065
+ className,
2066
+ ref,
2067
+ ...others
2068
+ }) => {
2069
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2070
+ Button,
2071
+ {
2072
+ ref,
2073
+ className: iconButtonStyles({ size, className }),
2074
+ design,
2075
+ disabled,
2076
+ intent,
2077
+ shape,
2078
+ size,
2079
+ ...others
2080
+ }
2081
+ );
2082
+ };
2083
+ IconButton.displayName = "IconButton";
2084
+
2085
+ // src/stepper/StepperButton.tsx
2086
+ var import_jsx_runtime31 = require("react/jsx-runtime");
2087
+ var IncrementButton = ({
2088
+ children,
2089
+ design = "ghost",
2090
+ intent = "neutral",
2091
+ className,
2092
+ ref: forwardedRef,
2093
+ ...rest
2094
+ }) => {
2095
+ const innerRef = (0, import_react13.useRef)(null);
2096
+ const ref = forwardedRef && typeof forwardedRef !== "function" ? forwardedRef : innerRef;
2097
+ const { incrementButtonProps } = useStepperContext();
2098
+ const { buttonProps } = (0, import_button2.useButton)({ ...incrementButtonProps, ...rest }, ref);
2099
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(InputGroup2.TrailingAddon, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
2100
+ IconButton,
2101
+ {
2102
+ ref,
2103
+ design,
2104
+ intent,
2105
+ className,
2106
+ "aria-label": buttonProps["aria-label"],
2107
+ ...buttonProps,
2108
+ children: children || /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Icon, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_Plus.Plus, {}) })
2109
+ }
2110
+ ) });
2111
+ };
2112
+ var DecrementButton = ({
2113
+ children,
2114
+ design = "ghost",
2115
+ intent = "neutral",
2116
+ className,
2117
+ ref: forwardedRef,
2118
+ ...rest
2119
+ }) => {
2120
+ const innerRef = (0, import_react13.useRef)(null);
2121
+ const ref = forwardedRef && typeof forwardedRef !== "function" ? forwardedRef : innerRef;
2122
+ const { decrementButtonProps } = useStepperContext();
2123
+ const { buttonProps } = (0, import_button2.useButton)({ ...decrementButtonProps, ...rest }, ref);
2124
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(InputGroup2.LeadingAddon, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
2125
+ IconButton,
2126
+ {
2127
+ ref,
2128
+ design,
2129
+ intent,
2130
+ className,
2131
+ "aria-label": buttonProps["aria-label"],
2132
+ ...buttonProps,
2133
+ children: children || /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Icon, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_Minus.Minus, {}) })
2134
+ }
2135
+ ) });
2136
+ };
2137
+ var StepperIncrementButton = Object.assign(IncrementButton, {
2138
+ id: "TrailingAddon"
2139
+ });
2140
+ var StepperDecrementButton = Object.assign(DecrementButton, {
2141
+ id: "LeadingAddon"
2142
+ });
2143
+ IncrementButton.displayName = "Stepper.DecrementButton";
2144
+ DecrementButton.displayName = "Stepper.DecrementButton";
2145
+
2146
+ // src/stepper/StepperInput.tsx
2147
+ var import_use_merge_refs2 = require("@spark-ui/use-merge-refs");
2148
+ var import_jsx_runtime32 = require("react/jsx-runtime");
2149
+ var Input2 = ({ ref: forwardedRef, ...props }) => {
2150
+ const { inputRef, inputProps } = useStepperContext();
2151
+ const ref = (0, import_use_merge_refs2.useMergeRefs)(forwardedRef, inputRef);
2152
+ const { className = "", ...remainingProps } = props;
2153
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
2154
+ Input,
2155
+ {
2156
+ ref,
2157
+ ...remainingProps,
2158
+ ...inputProps,
2159
+ className: `min-w-sz-56 text-center ${className}`
2160
+ }
2161
+ );
2162
+ };
2163
+ var StepperInput = Object.assign(Input2, {
2164
+ id: "Input"
2165
+ });
2166
+ Input2.displayName = "Stepper.Input";
2167
+
2168
+ // src/stepper/index.ts
2169
+ var Stepper2 = Object.assign(Stepper, { IncrementButton: StepperIncrementButton, DecrementButton: StepperDecrementButton, Input: StepperInput });
2170
+ Stepper2.displayName = "Stepper";
2171
+ StepperIncrementButton.displayName = "Stepper.IncrementButton";
2172
+ StepperDecrementButton.displayName = "Stepper.DecrementButton";
2173
+ StepperInput.displayName = "Stepper.Input";
2174
+ // Annotate the CommonJS export names for ESM import in node:
2175
+ 0 && (module.exports = {
2176
+ Stepper
2177
+ });
2178
+ //# sourceMappingURL=index.js.map