@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,905 @@
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/chip/index.ts
21
+ var chip_exports = {};
22
+ __export(chip_exports, {
23
+ Chip: () => Chip2
24
+ });
25
+ module.exports = __toCommonJS(chip_exports);
26
+
27
+ // src/chip/Chip.styles.tsx
28
+ var import_internal_utils4 = require("@spark-ui/internal-utils");
29
+ var import_class_variance_authority = require("class-variance-authority");
30
+
31
+ // src/chip/variants/outlined.ts
32
+ var import_internal_utils = require("@spark-ui/internal-utils");
33
+ var outlinedVariants = [
34
+ /** Intents **/
35
+ {
36
+ design: "outlined",
37
+ intent: "main",
38
+ class: (0, import_internal_utils.tw)([
39
+ "enabled:hover:bg-main/dim-5",
40
+ "enabled:active:bg-main/dim-5",
41
+ "focus-visible:bg-main/dim-5",
42
+ "aria-pressed:bg-main-container aria-pressed:text-on-main-container aria-pressed:enabled:hover:bg-main-container/dim-1",
43
+ "text-main"
44
+ ])
45
+ },
46
+ {
47
+ design: "outlined",
48
+ intent: "support",
49
+ class: (0, import_internal_utils.tw)([
50
+ "enabled:hover:bg-support/dim-5",
51
+ "enabled:active:bg-support/dim-5",
52
+ "focus-visible:bg-support/dim-5",
53
+ "aria-pressed:bg-support-container aria-pressed:text-on-support-container aria-pressed:enabled:hover:bg-support-container/dim-1",
54
+ "text-support"
55
+ ])
56
+ },
57
+ {
58
+ design: "outlined",
59
+ intent: "basic",
60
+ class: (0, import_internal_utils.tw)([
61
+ "enabled:hover:bg-basic/dim-5",
62
+ "enabled:active:bg-basic/dim-5",
63
+ "focus-visible:bg-basic/dim-5",
64
+ "aria-pressed:bg-basic-container aria-pressed:text-on-basic-container aria-pressed:enabled:hover:bg-basic-container/dim-1",
65
+ "text-basic"
66
+ ])
67
+ },
68
+ {
69
+ intent: "accent",
70
+ design: "outlined",
71
+ class: (0, import_internal_utils.tw)([
72
+ "enabled:hover:bg-accent/dim-5",
73
+ "enabled:active:bg-accent/dim-5",
74
+ "focus-visible:bg-accent/dim-5",
75
+ "aria-pressed:bg-accent-container",
76
+ "aria-pressed:bg-accent-container aria-pressed:text-on-accent-container aria-pressed:enabled:hover:bg-accent-container/dim-1",
77
+ "text-accent"
78
+ ])
79
+ },
80
+ {
81
+ design: "outlined",
82
+ intent: "success",
83
+ class: (0, import_internal_utils.tw)([
84
+ "enabled:hover:bg-success/dim-5",
85
+ "enabled:active:bg-success/dim-5",
86
+ "focus-visible:bg-success/dim-5",
87
+ "aria-pressed:bg-success-container aria-pressed:text-on-success-container aria-pressed:enabled:hover:bg-success-container/dim-1",
88
+ "text-success"
89
+ ])
90
+ },
91
+ {
92
+ intent: "alert",
93
+ design: "outlined",
94
+ class: (0, import_internal_utils.tw)([
95
+ "enabled:hover:bg-alert/dim-5",
96
+ "enabled:active:bg-alert/dim-5",
97
+ "focus-visible:bg-alert/dim-5",
98
+ "aria-pressed:bg-alert-container aria-pressed:text-on-alert-container aria-pressed:enabled:hover:bg-alert-container/dim-1",
99
+ "text-alert"
100
+ ])
101
+ },
102
+ {
103
+ design: "outlined",
104
+ intent: "danger",
105
+ class: (0, import_internal_utils.tw)([
106
+ "enabled:hover:bg-error/dim-5",
107
+ "enabled:active:bg-error/dim-5",
108
+ "focus-visible:bg-error/dim-5",
109
+ "aria-pressed:bg-error-container aria-pressed:text-on-error-container aria-pressed:enabled:hover:bg-error-container/dim-1",
110
+ "text-error"
111
+ ])
112
+ },
113
+ {
114
+ design: "outlined",
115
+ intent: "info",
116
+ class: (0, import_internal_utils.tw)([
117
+ "enabled:hover:bg-info/dim-5",
118
+ "enabled:active:bg-info/dim-5",
119
+ "focus-visible:bg-info/dim-5",
120
+ "aria-pressed:bg-info-container aria-pressed:text-on-info-container aria-pressed:enabled:hover:bg-info-container/dim-1",
121
+ "text-info"
122
+ ])
123
+ },
124
+ {
125
+ design: "outlined",
126
+ intent: "neutral",
127
+ class: (0, import_internal_utils.tw)([
128
+ "enabled:hover:bg-neutral/dim-5",
129
+ "enabled:active:bg-neutral/dim-5",
130
+ "focus-visible:bg-neutral/dim-5",
131
+ "aria-pressed:bg-neutral-container aria-pressed:text-on-neutral-container aria-pressed:enabled:hover:bg-neutral-container/dim-1",
132
+ "text-neutral"
133
+ ])
134
+ },
135
+ {
136
+ design: "outlined",
137
+ intent: "surface",
138
+ class: (0, import_internal_utils.tw)([
139
+ "enabled:hover:bg-surface/dim-5",
140
+ "enabled:active:bg-surface/dim-5",
141
+ "focus-visible:bg-surface/dim-5",
142
+ "aria-pressed:bg-surface aria-pressed:text-on-surface aria-pressed:enabled:hover:bg-surface-hovered",
143
+ "text-surface"
144
+ ])
145
+ },
146
+ /** Spacings **/
147
+ {
148
+ design: "outlined",
149
+ hasClearButton: false,
150
+ class: (0, import_internal_utils.tw)(["px-[calc(var(--spacing-md)-var(--border-width-sm))]"])
151
+ },
152
+ {
153
+ design: "outlined",
154
+ hasClearButton: true,
155
+ class: (0, import_internal_utils.tw)(["pl-[calc(var(--spacing-md)-var(--border-width-sm))]"])
156
+ }
157
+ ];
158
+
159
+ // src/chip/variants/tinted.ts
160
+ var import_internal_utils2 = require("@spark-ui/internal-utils");
161
+ var tintedVariants = [
162
+ /** Intents **/
163
+ {
164
+ intent: "main",
165
+ design: "tinted",
166
+ class: (0, import_internal_utils2.tw)([
167
+ "bg-main-container",
168
+ "enabled:hover:bg-main-container-hovered",
169
+ "enabled:active:bg-main-container-hovered",
170
+ "focus-visible:bg-main-container-hovered",
171
+ "aria-pressed:bg-main aria-pressed:text-on-main aria-pressed:enabled:hover:bg-main/dim-1",
172
+ "text-on-main-container"
173
+ ])
174
+ },
175
+ {
176
+ intent: "support",
177
+ design: "tinted",
178
+ class: (0, import_internal_utils2.tw)([
179
+ "bg-support-container",
180
+ "enabled:hover:bg-support-container-hovered",
181
+ "enabled:active:bg-support-container-hovered",
182
+ "focus-visible:bg-support-container-hovered",
183
+ "aria-pressed:bg-support aria-pressed:text-on-support aria-pressed:enabled:hover:bg-support/dim-1",
184
+ "text-on-support-container"
185
+ ])
186
+ },
187
+ {
188
+ intent: "basic",
189
+ design: "tinted",
190
+ class: (0, import_internal_utils2.tw)([
191
+ "bg-basic-container",
192
+ "enabled:hover:bg-basic-container-hovered",
193
+ "enabled:active:bg-basic-container-hovered",
194
+ "focus-visible:bg-basic-container-hovered",
195
+ "aria-pressed:bg-basic aria-pressed:text-on-basic aria-pressed:enabled:hover:bg-basic/dim-1",
196
+ "text-on-basic-container"
197
+ ])
198
+ },
199
+ {
200
+ intent: "accent",
201
+ design: "tinted",
202
+ class: (0, import_internal_utils2.tw)([
203
+ "bg-accent-container",
204
+ "enabled:hover:bg-accent-container-hovered",
205
+ "enabled:active:bg-accent-container-hovered",
206
+ "focus-visible:bg-accent-container-hovered",
207
+ "aria-pressed:bg-accent aria-pressed:text-on-accent aria-pressed:enabled:hover:bg-accent/dim-1",
208
+ "text-on-accent-container"
209
+ ])
210
+ },
211
+ {
212
+ intent: "success",
213
+ design: "tinted",
214
+ class: (0, import_internal_utils2.tw)([
215
+ "bg-success-container",
216
+ "enabled:hover:bg-success-container-hovered",
217
+ "enabled:active:bg-success-container-hovered",
218
+ "focus-visible:bg-success-container-hovered",
219
+ "aria-pressed:bg-success aria-pressed:text-on-success aria-pressed:enabled:hover:bg-success/dim-1",
220
+ "text-on-success-container"
221
+ ])
222
+ },
223
+ {
224
+ intent: "alert",
225
+ design: "tinted",
226
+ class: (0, import_internal_utils2.tw)([
227
+ "bg-alert-container",
228
+ "enabled:hover:bg-alert-container-hovered",
229
+ "enabled:active:bg-alert-container-hovered",
230
+ "focus-visible:bg-alert-container-hovered",
231
+ "aria-pressed:bg-alert aria-pressed:text-on-alert aria-pressed:enabled:hover:bg-alert/dim-1",
232
+ "text-on-alert-container"
233
+ ])
234
+ },
235
+ {
236
+ intent: "danger",
237
+ design: "tinted",
238
+ class: (0, import_internal_utils2.tw)([
239
+ "bg-error-container",
240
+ "enabled:hover:bg-error-container-hovered",
241
+ "enabled:active:bg-error-container-hovered",
242
+ "focus-visible:bg-error-container-hovered",
243
+ "aria-pressed:bg-error aria-pressed:text-on-error aria-pressed:enabled:hover:bg-error/dim-1",
244
+ "text-on-error-container"
245
+ ])
246
+ },
247
+ {
248
+ intent: "info",
249
+ design: "tinted",
250
+ class: (0, import_internal_utils2.tw)([
251
+ "bg-info-container",
252
+ "enabled:hover:bg-info-container-hovered",
253
+ "enabled:active:bg-info-container-hovered",
254
+ "focus-visible:bg-info-container-hovered",
255
+ "aria-pressed:bg-info aria-pressed:text-on-info aria-pressed:enabled:hover:bg-info/dim-1",
256
+ "text-on-info-container"
257
+ ])
258
+ },
259
+ {
260
+ intent: "neutral",
261
+ design: "tinted",
262
+ class: (0, import_internal_utils2.tw)([
263
+ "bg-neutral-container",
264
+ "enabled:hover:bg-neutral-container-hovered",
265
+ "enabled:active:bg-neutral-container-hovered",
266
+ "focus-visible:bg-neutral-container-hovered",
267
+ "aria-pressed:bg-neutral aria-pressed:text-on-neutral aria-pressed:enabled:hover:bg-neutral/dim-1",
268
+ "text-on-neutral-container"
269
+ ])
270
+ },
271
+ {
272
+ intent: "surface",
273
+ design: "tinted",
274
+ class: (0, import_internal_utils2.tw)([
275
+ "bg-surface/dim-1",
276
+ "enabled:hover:bg-surface-hovered/dim-1",
277
+ "enabled:active:bg-surface-hovered/dim-1",
278
+ "focus-visible:bg-surface-hovered/dim-1",
279
+ "aria-pressed:bg-surface aria-pressed:text-on-surface aria-pressed:enabled:hover:bg-surface-hovered",
280
+ "text-on-surface/dim-1"
281
+ ])
282
+ },
283
+ /** Spacings **/
284
+ {
285
+ design: "tinted",
286
+ hasClearButton: false,
287
+ class: (0, import_internal_utils2.tw)(["px-md"])
288
+ },
289
+ {
290
+ design: "tinted",
291
+ hasClearButton: true,
292
+ class: (0, import_internal_utils2.tw)(["pl-md"])
293
+ }
294
+ ];
295
+
296
+ // src/chip/variants/dashed.ts
297
+ var import_internal_utils3 = require("@spark-ui/internal-utils");
298
+ var dashedVariants = [
299
+ /** Intents **/
300
+ {
301
+ intent: "main",
302
+ design: "dashed",
303
+ class: (0, import_internal_utils3.tw)([
304
+ "enabled:hover:bg-main/dim-5",
305
+ "enabled:active:bg-main/dim-5",
306
+ "focus-visible:bg-main/dim-5",
307
+ "aria-pressed:bg-main-container aria-pressed:text-on-main-container aria-pressed:enabled:hover:bg-main-container/dim-1",
308
+ "text-main"
309
+ ])
310
+ },
311
+ {
312
+ intent: "support",
313
+ design: "dashed",
314
+ class: (0, import_internal_utils3.tw)([
315
+ "enabled:hover:bg-support/dim-5",
316
+ "enabled:active:bg-support/dim-5",
317
+ "focus-visible:bg-support/dim-5",
318
+ "aria-pressed:bg-support-container aria-pressed:text-on-support-container aria-pressed:enabled:hover:bg-support-container/dim-1",
319
+ "text-support"
320
+ ])
321
+ },
322
+ {
323
+ intent: "basic",
324
+ design: "dashed",
325
+ class: (0, import_internal_utils3.tw)([
326
+ "enabled:hover:bg-basic/dim-5",
327
+ "enabled:active:bg-basic/dim-5",
328
+ "focus-visible:bg-basic/dim-5",
329
+ "aria-pressed:bg-basic-container aria-pressed:text-on-basic-container aria-pressed:enabled:hover:bg-basic-container/dim-1",
330
+ "text-basic"
331
+ ])
332
+ },
333
+ {
334
+ intent: "accent",
335
+ design: "dashed",
336
+ class: (0, import_internal_utils3.tw)([
337
+ "enabled:hover:bg-accent/dim-5",
338
+ "enabled:active:bg-accent/dim-5",
339
+ "focus-visible:bg-accent/dim-5",
340
+ "aria-pressed:bg-accent-container aria-pressed:text-on-accent-container aria-pressed:enabled:hover:bg-accent-container/dim-1",
341
+ "text-accent"
342
+ ])
343
+ },
344
+ {
345
+ intent: "success",
346
+ design: "dashed",
347
+ class: (0, import_internal_utils3.tw)([
348
+ "enabled:hover:bg-success/dim-5",
349
+ "enabled:active:bg-success/dim-5",
350
+ "focus-visible:bg-success/dim-5",
351
+ "aria-pressed:bg-success-container aria-pressed:text-on-success-container aria-pressed:enabled:hover:bg-success-container/dim-1",
352
+ "text-success"
353
+ ])
354
+ },
355
+ {
356
+ intent: "alert",
357
+ design: "dashed",
358
+ class: (0, import_internal_utils3.tw)([
359
+ "enabled:hover:bg-alert/dim-5",
360
+ "enabled:active:bg-alert/dim-5",
361
+ "focus-visible:bg-alert/dim-5",
362
+ "aria-pressed:bg-alert-container aria-pressed:text-on-alert-container aria-pressed:enabled:hover:bg-alert-container/dim-1",
363
+ "text-alert"
364
+ ])
365
+ },
366
+ {
367
+ intent: "danger",
368
+ design: "dashed",
369
+ class: (0, import_internal_utils3.tw)([
370
+ "enabled:hover:bg-error/dim-5",
371
+ "enabled:active:bg-error/dim-5",
372
+ "focus-visible:bg-error/dim-5",
373
+ "aria-pressed:bg-error-container aria-pressed:text-on-error-container aria-pressed:enabled:hover:bg-error-container/dim-1",
374
+ "text-error"
375
+ ])
376
+ },
377
+ {
378
+ intent: "info",
379
+ design: "dashed",
380
+ class: (0, import_internal_utils3.tw)([
381
+ "enabled:hover:bg-info/dim-5",
382
+ "enabled:active:bg-info/dim-5",
383
+ "focus-visible:bg-info/dim-5",
384
+ "aria-pressed:bg-info-container aria-pressed:text-on-info-container aria-pressed:enabled:hover:bg-info-container/dim-1",
385
+ "text-info"
386
+ ])
387
+ },
388
+ {
389
+ intent: "neutral",
390
+ design: "dashed",
391
+ class: (0, import_internal_utils3.tw)([
392
+ "enabled:hover:bg-neutral/dim-5",
393
+ "enabled:active:bg-neutral/dim-5",
394
+ "focus-visible:bg-neutral/dim-5",
395
+ "aria-pressed:bg-neutral-container aria-pressed:text-on-neutral-container aria-pressed:enabled:hover:bg-neutral-container/dim-1",
396
+ "text-neutral"
397
+ ])
398
+ },
399
+ {
400
+ intent: "surface",
401
+ design: "dashed",
402
+ class: (0, import_internal_utils3.tw)([
403
+ "enabled:hover:bg-surface/dim-5",
404
+ "enabled:active:bg-surface/dim-5",
405
+ "focus-visible:bg-surface/dim-5",
406
+ "aria-pressed:bg-surface aria-pressed:text-on-surface aria-pressed:enabled:hover:bg-surface-hovered",
407
+ "text-surface"
408
+ ])
409
+ },
410
+ /** Spacings **/
411
+ {
412
+ design: "dashed",
413
+ hasClearButton: false,
414
+ class: (0, import_internal_utils3.tw)(["px-[calc(var(--spacing-md)-var(--border-width-sm))]"])
415
+ },
416
+ {
417
+ design: "dashed",
418
+ hasClearButton: true,
419
+ class: (0, import_internal_utils3.tw)(["pl-[calc(var(--spacing-md)-var(--border-width-sm))]"])
420
+ }
421
+ ];
422
+
423
+ // src/chip/Chip.styles.tsx
424
+ var chipStyles = (0, import_class_variance_authority.cva)(
425
+ [
426
+ "box-border inline-flex h-sz-32 flex-nowrap items-center justify-center rounded-md text-body-1 font-regular",
427
+ "focus-visible:u-outline",
428
+ "ease-out duration-150"
429
+ ],
430
+ {
431
+ variants: {
432
+ /**
433
+ * Main style of the chip.
434
+ *
435
+ * - `filled`: Chip will be plain.
436
+ *
437
+ * - `outlined`: Chip will be transparent with an outline.
438
+ *
439
+ * - `tinted`: Chip will be filled but using a lighter color scheme.
440
+ *
441
+ * - `dashed`: Chip will be transparent with an outline dashed.
442
+ */
443
+ design: (0, import_internal_utils4.makeVariants)({
444
+ outlined: ["bg-transparent border-sm border-solid border-current"],
445
+ tinted: [""],
446
+ dashed: [
447
+ "bg-transparent border-sm border-dashed shadow-none focus-visible:border-outline-high"
448
+ ]
449
+ }),
450
+ /**
451
+ * Color scheme of the chip.
452
+ */
453
+ intent: (0, import_internal_utils4.makeVariants)({
454
+ main: [],
455
+ support: [],
456
+ basic: [],
457
+ accent: [],
458
+ success: [],
459
+ alert: [],
460
+ danger: [],
461
+ info: [],
462
+ neutral: [],
463
+ surface: []
464
+ }),
465
+ /**
466
+ * Disable the chip, preventing user interaction and adding opacity.
467
+ */
468
+ disabled: {
469
+ true: ["cursor-not-allowed", "opacity-dim-3"]
470
+ },
471
+ hasClearButton: {
472
+ true: [],
473
+ false: []
474
+ }
475
+ // 'pl-[calc(var(--spacing-md)-(var(--border-width-sm)))]'
476
+ },
477
+ compoundVariants: [...outlinedVariants, ...tintedVariants, ...dashedVariants],
478
+ defaultVariants: {
479
+ design: "outlined",
480
+ intent: "basic"
481
+ }
482
+ }
483
+ );
484
+
485
+ // src/chip/useChipContext.tsx
486
+ var import_react = require("react");
487
+ var ChipContext = (0, import_react.createContext)({});
488
+ var useChipContext = () => (0, import_react.useContext)(ChipContext) || {};
489
+
490
+ // src/chip/useChipElement.tsx
491
+ var import_use_combined_state = require("@spark-ui/use-combined-state");
492
+ var import_emulate_tab = require("emulate-tab");
493
+ var import_react3 = require("react");
494
+
495
+ // src/slot/Slot.tsx
496
+ var import_radix_ui = require("radix-ui");
497
+ var import_react2 = require("react");
498
+ var import_jsx_runtime = require("react/jsx-runtime");
499
+ var Slottable = import_radix_ui.Slot.Slottable;
500
+ var Slot = ({ ref, ...props }) => {
501
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_radix_ui.Slot.Root, { ref, ...props });
502
+ };
503
+
504
+ // src/chip/useChipElement.tsx
505
+ var import_jsx_runtime2 = require("react/jsx-runtime");
506
+ var getDisplayName = (element) => {
507
+ return element ? element.type.displayName : "";
508
+ };
509
+ var findElement = (children) => (...values) => {
510
+ const validChildren = import_react3.Children.toArray(children).filter(import_react3.isValidElement);
511
+ return validChildren.find((child) => {
512
+ const displayName = getDisplayName(child);
513
+ return values.includes(displayName || "");
514
+ });
515
+ };
516
+ var useChipElement = ({
517
+ onClick,
518
+ asChild,
519
+ pressed,
520
+ defaultPressed,
521
+ disabled,
522
+ value,
523
+ defaultValue,
524
+ children,
525
+ onClear
526
+ }) => {
527
+ const [isPressed, setIsPressed] = (0, import_use_combined_state.useCombinedState)(pressed, defaultPressed);
528
+ const [innerValue] = (0, import_use_combined_state.useCombinedState)(
529
+ value,
530
+ defaultValue
531
+ );
532
+ const findChipElement = findElement(children);
533
+ const leadingIcon = findChipElement("Chip.LeadingIcon");
534
+ const trailingIcon = findChipElement("Chip.TrailingIcon");
535
+ const content = findChipElement("Chip.Content");
536
+ const clearButton = findChipElement("Chip.ClearButton");
537
+ const isButton = (onClick || isPressed) !== void 0;
538
+ const formattedChildren = [leadingIcon, content, clearButton].every(
539
+ (element) => element === void 0
540
+ ) ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "inline-block grow truncate", children }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
541
+ leadingIcon,
542
+ content,
543
+ leadingIcon === void 0 ? trailingIcon : null,
544
+ clearButton
545
+ ] });
546
+ const onKeyDown = (event) => {
547
+ if (!!clearButton && !disabled && ["Delete", "Backspace"].includes(event.key)) {
548
+ if (onClear) {
549
+ onClear();
550
+ event.key === "Delete" && (0, import_emulate_tab.emulateTab)();
551
+ event.key === "Backspace" && import_emulate_tab.emulateTab.backwards();
552
+ }
553
+ }
554
+ };
555
+ if (isButton) {
556
+ return {
557
+ Element: asChild ? Slot : "button",
558
+ chipProps: {
559
+ type: "button",
560
+ ...isPressed !== void 0 && {
561
+ "aria-pressed": isPressed,
562
+ "data-state": isPressed ? "on" : "off"
563
+ },
564
+ onClick: (event) => {
565
+ isPressed !== void 0 && setIsPressed(!isPressed);
566
+ onClick && onClick(event, { pressed: isPressed, value: innerValue });
567
+ },
568
+ onKeyDown,
569
+ disabled,
570
+ children: formattedChildren
571
+ },
572
+ compoundElements: {
573
+ leadingIcon,
574
+ trailingIcon,
575
+ content,
576
+ clearButton
577
+ }
578
+ };
579
+ }
580
+ return {
581
+ Element: asChild ? Slot : "div",
582
+ chipProps: {
583
+ "aria-disabled": disabled,
584
+ children: formattedChildren,
585
+ onKeyDown
586
+ },
587
+ compoundElements: {
588
+ leadingIcon,
589
+ trailingIcon,
590
+ content,
591
+ clearButton
592
+ }
593
+ };
594
+ };
595
+
596
+ // src/chip/Chip.tsx
597
+ var import_jsx_runtime3 = require("react/jsx-runtime");
598
+ var Chip = ({
599
+ design = "outlined",
600
+ disabled,
601
+ children,
602
+ intent = "basic",
603
+ defaultPressed,
604
+ pressed,
605
+ asChild,
606
+ className,
607
+ onClick,
608
+ onClear,
609
+ ref: forwardedRef,
610
+ ...otherProps
611
+ }) => {
612
+ const {
613
+ Element: ChipElement,
614
+ chipProps: { children: formattedChildren, ...chipProps },
615
+ compoundElements
616
+ } = useChipElement({
617
+ asChild,
618
+ pressed,
619
+ defaultPressed,
620
+ onClick,
621
+ disabled: !!disabled,
622
+ value: otherProps.value,
623
+ defaultValue: otherProps.defaultValue,
624
+ children,
625
+ onClear
626
+ });
627
+ const { clearButton } = compoundElements;
628
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ChipContext.Provider, { value: { disabled, design, intent, onClear }, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
629
+ ChipElement,
630
+ {
631
+ ref: forwardedRef,
632
+ className: chipStyles({
633
+ className,
634
+ design,
635
+ disabled,
636
+ intent,
637
+ hasClearButton: !!clearButton
638
+ }),
639
+ ...{
640
+ ...chipProps,
641
+ ...otherProps
642
+ },
643
+ "data-spark-component": "chip",
644
+ children: formattedChildren
645
+ }
646
+ ) });
647
+ };
648
+ Chip.displayName = "Chip";
649
+
650
+ // src/chip/ChipClearButton.tsx
651
+ var import_Close = require("@spark-ui/icons/Close");
652
+ var import_react5 = require("react");
653
+
654
+ // src/icon/Icon.tsx
655
+ var import_react4 = require("react");
656
+
657
+ // src/visually-hidden/VisuallyHidden.tsx
658
+ var import_jsx_runtime4 = require("react/jsx-runtime");
659
+ var VisuallyHidden = ({ asChild = false, ref, ...props }) => {
660
+ const Component = asChild ? Slot : "span";
661
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
662
+ Component,
663
+ {
664
+ ...props,
665
+ ref,
666
+ style: {
667
+ // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
668
+ position: "absolute",
669
+ border: 0,
670
+ width: 1,
671
+ height: 1,
672
+ padding: 0,
673
+ margin: -1,
674
+ overflow: "hidden",
675
+ clip: "rect(0, 0, 0, 0)",
676
+ whiteSpace: "nowrap",
677
+ wordWrap: "normal",
678
+ ...props.style
679
+ }
680
+ }
681
+ );
682
+ };
683
+ VisuallyHidden.displayName = "VisuallyHidden";
684
+
685
+ // src/icon/Icon.styles.tsx
686
+ var import_internal_utils5 = require("@spark-ui/internal-utils");
687
+ var import_class_variance_authority2 = require("class-variance-authority");
688
+ var iconStyles = (0, import_class_variance_authority2.cva)(["fill-current shrink-0"], {
689
+ variants: {
690
+ /**
691
+ * Color scheme of the icon.
692
+ */
693
+ intent: (0, import_internal_utils5.makeVariants)({
694
+ current: ["text-current"],
695
+ main: ["text-main"],
696
+ support: ["text-support"],
697
+ accent: ["text-accent"],
698
+ basic: ["text-basic"],
699
+ success: ["text-success"],
700
+ alert: ["text-alert"],
701
+ error: ["text-error"],
702
+ info: ["text-info"],
703
+ neutral: ["text-neutral"]
704
+ }),
705
+ /**
706
+ * Sets the size of the icon.
707
+ */
708
+ size: (0, import_internal_utils5.makeVariants)({
709
+ current: ["u-current-font-size"],
710
+ sm: ["w-sz-16", "h-sz-16"],
711
+ md: ["w-sz-24", "h-sz-24"],
712
+ lg: ["w-sz-32", "h-sz-32"],
713
+ xl: ["w-sz-40", "h-sz-40"]
714
+ })
715
+ }
716
+ });
717
+
718
+ // src/icon/Icon.tsx
719
+ var import_jsx_runtime5 = require("react/jsx-runtime");
720
+ var Icon = ({
721
+ label,
722
+ className,
723
+ size = "current",
724
+ intent = "current",
725
+ children,
726
+ ...others
727
+ }) => {
728
+ const child = import_react4.Children.only(children);
729
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
730
+ (0, import_react4.cloneElement)(child, {
731
+ className: iconStyles({ className, size, intent }),
732
+ "data-spark-component": "icon",
733
+ "aria-hidden": "true",
734
+ focusable: "false",
735
+ ...others
736
+ }),
737
+ label && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(VisuallyHidden, { children: label })
738
+ ] });
739
+ };
740
+ Icon.displayName = "Icon";
741
+
742
+ // src/chip/ChipClearButton.styles.tsx
743
+ var import_internal_utils6 = require("@spark-ui/internal-utils");
744
+ var import_class_variance_authority3 = require("class-variance-authority");
745
+ var chipClearButtonWrapperStyles = (0, import_class_variance_authority3.cva)(
746
+ ["ml-md flex h-full items-center justify-center focus-visible:outline-hidden"],
747
+ {
748
+ variants: {
749
+ disabled: {
750
+ false: ["cursor-pointer"],
751
+ true: ["cursor-not-allowed"]
752
+ },
753
+ isBordered: {
754
+ false: ["pr-md"],
755
+ true: ["pr-[7px]"]
756
+ },
757
+ design: {
758
+ outlined: [],
759
+ tinted: [],
760
+ dashed: []
761
+ }
762
+ },
763
+ compoundVariants: [
764
+ {
765
+ design: "outlined",
766
+ disabled: false,
767
+ class: (0, import_internal_utils6.tw)(["hover:opacity-dim-1"])
768
+ },
769
+ {
770
+ design: "outlined",
771
+ disabled: true,
772
+ class: (0, import_internal_utils6.tw)(["opacity-dim-3"])
773
+ },
774
+ {
775
+ design: "tinted",
776
+ disabled: false,
777
+ class: (0, import_internal_utils6.tw)(["hover:opacity-dim-1"])
778
+ },
779
+ {
780
+ design: "tinted",
781
+ disabled: true,
782
+ class: (0, import_internal_utils6.tw)(["opacity-dim-3"])
783
+ },
784
+ {
785
+ design: "dashed",
786
+ disabled: false,
787
+ class: (0, import_internal_utils6.tw)(["hover:opacity-dim-1"])
788
+ },
789
+ {
790
+ design: "dashed",
791
+ disabled: true,
792
+ class: (0, import_internal_utils6.tw)(["opacity-dim-3"])
793
+ }
794
+ ]
795
+ }
796
+ );
797
+ var chipClearButtonStyles = (0, import_class_variance_authority3.cva)(
798
+ ["rounded-full p-sz-2 [font-size:var(--spacing-sz-8)] border-sm", "focus-visible:u-outline"],
799
+ {
800
+ variants: {
801
+ disabled: {
802
+ true: ["cursor-not-allowed"],
803
+ false: ["cursor-pointer"]
804
+ }
805
+ }
806
+ }
807
+ );
808
+
809
+ // src/chip/ChipClearButton.tsx
810
+ var import_jsx_runtime6 = require("react/jsx-runtime");
811
+ var ChipClearButton = ({
812
+ children = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Close.Close, {}) }),
813
+ tabIndex = 0,
814
+ label,
815
+ ref: forwardedRef
816
+ }) => {
817
+ const { design, disabled, onClear } = useChipContext();
818
+ const onClearHandler = (0, import_react5.useCallback)(
819
+ (event) => {
820
+ event.stopPropagation();
821
+ !disabled && onClear && onClear(event);
822
+ },
823
+ [disabled, onClear]
824
+ );
825
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
826
+ "span",
827
+ {
828
+ className: chipClearButtonWrapperStyles({
829
+ isBordered: ["outline", "dashed"].includes(`${design}`),
830
+ disabled: !!disabled,
831
+ design
832
+ }),
833
+ onClick: onClearHandler,
834
+ ref: forwardedRef,
835
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
836
+ "button",
837
+ {
838
+ tabIndex,
839
+ type: "button",
840
+ disabled: !!disabled,
841
+ className: chipClearButtonStyles({ disabled }),
842
+ "aria-label": label,
843
+ children: children && (0, import_react5.cloneElement)(children, { ariaLabel: label })
844
+ }
845
+ )
846
+ }
847
+ );
848
+ };
849
+ ChipClearButton.displayName = "Chip.ClearButton";
850
+
851
+ // src/chip/ChipContent.tsx
852
+ var import_class_variance_authority4 = require("class-variance-authority");
853
+ var import_jsx_runtime7 = require("react/jsx-runtime");
854
+ var ChipContent = ({ children, className, ref: forwardedRef }) => {
855
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: (0, import_class_variance_authority4.cx)("inline-block grow truncate", className), ref: forwardedRef, children });
856
+ };
857
+ ChipContent.displayName = "Chip.Content";
858
+
859
+ // src/chip/ChipLeadingIcon.tsx
860
+ var import_class_variance_authority6 = require("class-variance-authority");
861
+
862
+ // src/chip/ChipIcon.tsx
863
+ var import_class_variance_authority5 = require("class-variance-authority");
864
+ var import_jsx_runtime8 = require("react/jsx-runtime");
865
+ var ChipIcon = ({ children, className, ref: forwardedRef }) => {
866
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: (0, import_class_variance_authority5.cx)("flex h-full items-center justify-center", className), ref: forwardedRef, children });
867
+ };
868
+ ChipIcon.displayName = "Chip.Icon";
869
+
870
+ // src/chip/ChipLeadingIcon.tsx
871
+ var import_jsx_runtime9 = require("react/jsx-runtime");
872
+ var ChipLeadingIcon = ({
873
+ className,
874
+ ref: forwardedRef,
875
+ ...props
876
+ }) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ChipIcon, { className: (0, import_class_variance_authority6.cx)("mr-sm", className), ref: forwardedRef, ...props });
877
+ ChipLeadingIcon.displayName = "Chip.LeadingIcon";
878
+
879
+ // src/chip/ChipTrailingIcon.tsx
880
+ var import_class_variance_authority7 = require("class-variance-authority");
881
+ var import_jsx_runtime10 = require("react/jsx-runtime");
882
+ var ChipTrailingIcon = ({
883
+ className,
884
+ ref: forwardedRef,
885
+ ...props
886
+ }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ChipIcon, { className: (0, import_class_variance_authority7.cx)("ml-md", className), ref: forwardedRef, ...props });
887
+ ChipTrailingIcon.displayName = "Chip.TrailingIcon";
888
+
889
+ // src/chip/index.ts
890
+ var Chip2 = Object.assign(Chip, {
891
+ Content: ChipContent,
892
+ LeadingIcon: ChipLeadingIcon,
893
+ TrailingIcon: ChipTrailingIcon,
894
+ ClearButton: ChipClearButton
895
+ });
896
+ Chip2.displayName = "Chip";
897
+ Chip2.ClearButton.displayName = "Chip.ClearButton";
898
+ Chip2.Content.displayName = "Chip.Content";
899
+ Chip2.LeadingIcon.displayName = "Chip.LeadingIcon";
900
+ Chip2.TrailingIcon.displayName = "Chip.TrailingIcon";
901
+ // Annotate the CommonJS export names for ESM import in node:
902
+ 0 && (module.exports = {
903
+ Chip
904
+ });
905
+ //# sourceMappingURL=index.js.map