@central-ui/react 0.0.0-stage → 0.1.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 (292) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +31 -2
  3. package/dist/components/accordion/index.d.ts +73 -0
  4. package/dist/components/accordion/index.d.ts.map +1 -0
  5. package/dist/components/accordion/index.js +92 -0
  6. package/dist/components/accordion/index.js.map +1 -0
  7. package/dist/components/autocomplete/index.d.ts +365 -0
  8. package/dist/components/autocomplete/index.d.ts.map +1 -0
  9. package/dist/components/autocomplete/index.js +369 -0
  10. package/dist/components/autocomplete/index.js.map +1 -0
  11. package/dist/components/avatar/index.d.ts +48 -0
  12. package/dist/components/avatar/index.d.ts.map +1 -0
  13. package/dist/components/avatar/index.js +60 -0
  14. package/dist/components/avatar/index.js.map +1 -0
  15. package/dist/components/badge/index.d.ts +29 -0
  16. package/dist/components/badge/index.d.ts.map +1 -0
  17. package/dist/components/badge/index.js +36 -0
  18. package/dist/components/badge/index.js.map +1 -0
  19. package/dist/components/banner/index.d.ts +71 -0
  20. package/dist/components/banner/index.d.ts.map +1 -0
  21. package/dist/components/banner/index.js +119 -0
  22. package/dist/components/banner/index.js.map +1 -0
  23. package/dist/components/breadcrumb/index.d.ts +31 -0
  24. package/dist/components/breadcrumb/index.d.ts.map +1 -0
  25. package/dist/components/breadcrumb/index.js +42 -0
  26. package/dist/components/breadcrumb/index.js.map +1 -0
  27. package/dist/components/button/index.d.ts +48 -0
  28. package/dist/components/button/index.d.ts.map +1 -0
  29. package/dist/components/button/index.js +60 -0
  30. package/dist/components/button/index.js.map +1 -0
  31. package/dist/components/card/index.d.ts +34 -0
  32. package/dist/components/card/index.d.ts.map +1 -0
  33. package/dist/components/card/index.js +45 -0
  34. package/dist/components/card/index.js.map +1 -0
  35. package/dist/components/checkbox/index.d.ts +66 -0
  36. package/dist/components/checkbox/index.d.ts.map +1 -0
  37. package/dist/components/checkbox/index.js +146 -0
  38. package/dist/components/checkbox/index.js.map +1 -0
  39. package/dist/components/chip/index.d.ts +26 -0
  40. package/dist/components/chip/index.d.ts.map +1 -0
  41. package/dist/components/chip/index.js +40 -0
  42. package/dist/components/chip/index.js.map +1 -0
  43. package/dist/components/combobox/index.d.ts +427 -0
  44. package/dist/components/combobox/index.d.ts.map +1 -0
  45. package/dist/components/combobox/index.js +416 -0
  46. package/dist/components/combobox/index.js.map +1 -0
  47. package/dist/components/datepicker/index.d.ts +297 -0
  48. package/dist/components/datepicker/index.d.ts.map +1 -0
  49. package/dist/components/datepicker/index.js +507 -0
  50. package/dist/components/datepicker/index.js.map +1 -0
  51. package/dist/components/dialog/index.d.ts +88 -0
  52. package/dist/components/dialog/index.d.ts.map +1 -0
  53. package/dist/components/dialog/index.js +102 -0
  54. package/dist/components/dialog/index.js.map +1 -0
  55. package/dist/components/divider/index.d.ts +21 -0
  56. package/dist/components/divider/index.d.ts.map +1 -0
  57. package/dist/components/divider/index.js +24 -0
  58. package/dist/components/divider/index.js.map +1 -0
  59. package/dist/components/drawer/index.d.ts +99 -0
  60. package/dist/components/drawer/index.d.ts.map +1 -0
  61. package/dist/components/drawer/index.js +137 -0
  62. package/dist/components/drawer/index.js.map +1 -0
  63. package/dist/components/empty/index.d.ts +40 -0
  64. package/dist/components/empty/index.d.ts.map +1 -0
  65. package/dist/components/empty/index.js +61 -0
  66. package/dist/components/empty/index.js.map +1 -0
  67. package/dist/components/fileupload/index.d.ts +107 -0
  68. package/dist/components/fileupload/index.d.ts.map +1 -0
  69. package/dist/components/fileupload/index.js +185 -0
  70. package/dist/components/fileupload/index.js.map +1 -0
  71. package/dist/components/form/index.d.ts +34 -0
  72. package/dist/components/form/index.d.ts.map +1 -0
  73. package/dist/components/form/index.js +35 -0
  74. package/dist/components/form/index.js.map +1 -0
  75. package/dist/components/input/index.d.ts +85 -0
  76. package/dist/components/input/index.d.ts.map +1 -0
  77. package/dist/components/input/index.js +249 -0
  78. package/dist/components/input/index.js.map +1 -0
  79. package/dist/components/menu/index.d.ts +115 -0
  80. package/dist/components/menu/index.d.ts.map +1 -0
  81. package/dist/components/menu/index.js +188 -0
  82. package/dist/components/menu/index.js.map +1 -0
  83. package/dist/components/metric/index.d.ts +24 -0
  84. package/dist/components/metric/index.d.ts.map +1 -0
  85. package/dist/components/metric/index.js +26 -0
  86. package/dist/components/metric/index.js.map +1 -0
  87. package/dist/components/numberinput/index.d.ts +105 -0
  88. package/dist/components/numberinput/index.d.ts.map +1 -0
  89. package/dist/components/numberinput/index.js +240 -0
  90. package/dist/components/numberinput/index.js.map +1 -0
  91. package/dist/components/otpinput/index.d.ts +63 -0
  92. package/dist/components/otpinput/index.d.ts.map +1 -0
  93. package/dist/components/otpinput/index.js +133 -0
  94. package/dist/components/otpinput/index.js.map +1 -0
  95. package/dist/components/page/index.d.ts +54 -0
  96. package/dist/components/page/index.d.ts.map +1 -0
  97. package/dist/components/page/index.js +100 -0
  98. package/dist/components/page/index.js.map +1 -0
  99. package/dist/components/passwordinput/index.d.ts +88 -0
  100. package/dist/components/passwordinput/index.d.ts.map +1 -0
  101. package/dist/components/passwordinput/index.js +251 -0
  102. package/dist/components/passwordinput/index.js.map +1 -0
  103. package/dist/components/popover/index.d.ts +67 -0
  104. package/dist/components/popover/index.d.ts.map +1 -0
  105. package/dist/components/popover/index.js +76 -0
  106. package/dist/components/popover/index.js.map +1 -0
  107. package/dist/components/radio/index.d.ts +90 -0
  108. package/dist/components/radio/index.d.ts.map +1 -0
  109. package/dist/components/radio/index.js +232 -0
  110. package/dist/components/radio/index.js.map +1 -0
  111. package/dist/components/ratinginput/index.d.ts +59 -0
  112. package/dist/components/ratinginput/index.d.ts.map +1 -0
  113. package/dist/components/ratinginput/index.js +88 -0
  114. package/dist/components/ratinginput/index.js.map +1 -0
  115. package/dist/components/select/index.d.ts +205 -0
  116. package/dist/components/select/index.d.ts.map +1 -0
  117. package/dist/components/select/index.js +234 -0
  118. package/dist/components/select/index.js.map +1 -0
  119. package/dist/components/skeleton/index.d.ts +19 -0
  120. package/dist/components/skeleton/index.d.ts.map +1 -0
  121. package/dist/components/skeleton/index.js +20 -0
  122. package/dist/components/skeleton/index.js.map +1 -0
  123. package/dist/components/slider/index.d.ts +72 -0
  124. package/dist/components/slider/index.d.ts.map +1 -0
  125. package/dist/components/slider/index.js +159 -0
  126. package/dist/components/slider/index.js.map +1 -0
  127. package/dist/components/spinner/index.d.ts +14 -0
  128. package/dist/components/spinner/index.d.ts.map +1 -0
  129. package/dist/components/spinner/index.js +15 -0
  130. package/dist/components/spinner/index.js.map +1 -0
  131. package/dist/components/splitter/index.d.ts +49 -0
  132. package/dist/components/splitter/index.d.ts.map +1 -0
  133. package/dist/components/splitter/index.js +67 -0
  134. package/dist/components/splitter/index.js.map +1 -0
  135. package/dist/components/stepper/index.d.ts +82 -0
  136. package/dist/components/stepper/index.d.ts.map +1 -0
  137. package/dist/components/stepper/index.js +100 -0
  138. package/dist/components/stepper/index.js.map +1 -0
  139. package/dist/components/switch/index.d.ts +57 -0
  140. package/dist/components/switch/index.d.ts.map +1 -0
  141. package/dist/components/switch/index.js +101 -0
  142. package/dist/components/switch/index.js.map +1 -0
  143. package/dist/components/table/index.d.ts +110 -0
  144. package/dist/components/table/index.d.ts.map +1 -0
  145. package/dist/components/table/index.js +211 -0
  146. package/dist/components/table/index.js.map +1 -0
  147. package/dist/components/tabs/index.d.ts +67 -0
  148. package/dist/components/tabs/index.d.ts.map +1 -0
  149. package/dist/components/tabs/index.js +78 -0
  150. package/dist/components/tabs/index.js.map +1 -0
  151. package/dist/components/textarea/index.d.ts +72 -0
  152. package/dist/components/textarea/index.d.ts.map +1 -0
  153. package/dist/components/textarea/index.js +205 -0
  154. package/dist/components/textarea/index.js.map +1 -0
  155. package/dist/components/textlink/index.d.ts +39 -0
  156. package/dist/components/textlink/index.d.ts.map +1 -0
  157. package/dist/components/textlink/index.js +42 -0
  158. package/dist/components/textlink/index.js.map +1 -0
  159. package/dist/components/toast/index.d.ts +111 -0
  160. package/dist/components/toast/index.d.ts.map +1 -0
  161. package/dist/components/toast/index.js +205 -0
  162. package/dist/components/toast/index.js.map +1 -0
  163. package/dist/components/toggle/index.d.ts +41 -0
  164. package/dist/components/toggle/index.d.ts.map +1 -0
  165. package/dist/components/toggle/index.js +78 -0
  166. package/dist/components/toggle/index.js.map +1 -0
  167. package/dist/components/tooltip/index.d.ts +44 -0
  168. package/dist/components/tooltip/index.d.ts.map +1 -0
  169. package/dist/components/tooltip/index.js +51 -0
  170. package/dist/components/tooltip/index.js.map +1 -0
  171. package/dist/index.d.ts +50 -0
  172. package/dist/index.d.ts.map +1 -0
  173. package/dist/index.js +46 -0
  174. package/dist/index.js.map +1 -0
  175. package/dist/types/Style.d.ts +14 -0
  176. package/dist/types/Style.d.ts.map +1 -0
  177. package/dist/types/Style.js +2 -0
  178. package/dist/types/Style.js.map +1 -0
  179. package/dist/types/Tone.d.ts +4 -0
  180. package/dist/types/Tone.d.ts.map +1 -0
  181. package/dist/types/Tone.js +2 -0
  182. package/dist/types/Tone.js.map +1 -0
  183. package/dist/utils/ArkStateToDataAttributes.d.ts +4 -0
  184. package/dist/utils/ArkStateToDataAttributes.d.ts.map +1 -0
  185. package/dist/utils/ArkStateToDataAttributes.js +9 -0
  186. package/dist/utils/ArkStateToDataAttributes.js.map +1 -0
  187. package/dist/utils/Tone.d.ts +3 -0
  188. package/dist/utils/Tone.d.ts.map +1 -0
  189. package/dist/utils/Tone.js +7 -0
  190. package/dist/utils/Tone.js.map +1 -0
  191. package/dist/utils/useForwardClickToInput.d.ts +4 -0
  192. package/dist/utils/useForwardClickToInput.d.ts.map +1 -0
  193. package/dist/utils/useForwardClickToInput.js +27 -0
  194. package/dist/utils/useForwardClickToInput.js.map +1 -0
  195. package/dist/utils/virtualization/useVirtualizedAutocomplete.d.ts +198 -0
  196. package/dist/utils/virtualization/useVirtualizedAutocomplete.d.ts.map +1 -0
  197. package/dist/utils/virtualization/useVirtualizedAutocomplete.js +180 -0
  198. package/dist/utils/virtualization/useVirtualizedAutocomplete.js.map +1 -0
  199. package/dist/utils/virtualization/useVirtualizedCombobox.d.ts +200 -0
  200. package/dist/utils/virtualization/useVirtualizedCombobox.d.ts.map +1 -0
  201. package/dist/utils/virtualization/useVirtualizedCombobox.js +174 -0
  202. package/dist/utils/virtualization/useVirtualizedCombobox.js.map +1 -0
  203. package/dist/utils/virtualization/useVirtualizedTable.d.ts +169 -0
  204. package/dist/utils/virtualization/useVirtualizedTable.d.ts.map +1 -0
  205. package/dist/utils/virtualization/useVirtualizedTable.js +127 -0
  206. package/dist/utils/virtualization/useVirtualizedTable.js.map +1 -0
  207. package/package.json +64 -4
  208. package/src/presets/shopify-polaris/shopify-polaris-accordion.css +28 -0
  209. package/src/presets/shopify-polaris/shopify-polaris-autocomplete.css +155 -0
  210. package/src/presets/shopify-polaris/shopify-polaris-avatar.css +47 -0
  211. package/src/presets/shopify-polaris/shopify-polaris-badge.css +27 -0
  212. package/src/presets/shopify-polaris/shopify-polaris-banner.css +111 -0
  213. package/src/presets/shopify-polaris/shopify-polaris-breadcrumb.css +16 -0
  214. package/src/presets/shopify-polaris/shopify-polaris-button.css +79 -0
  215. package/src/presets/shopify-polaris/shopify-polaris-card.css +28 -0
  216. package/src/presets/shopify-polaris/shopify-polaris-checkbox.css +52 -0
  217. package/src/presets/shopify-polaris/shopify-polaris-chip.css +16 -0
  218. package/src/presets/shopify-polaris/shopify-polaris-combobox.css +179 -0
  219. package/src/presets/shopify-polaris/shopify-polaris-datepicker.css +183 -0
  220. package/src/presets/shopify-polaris/shopify-polaris-dialog.css +40 -0
  221. package/src/presets/shopify-polaris/shopify-polaris-divider.css +12 -0
  222. package/src/presets/shopify-polaris/shopify-polaris-drawer.css +40 -0
  223. package/src/presets/shopify-polaris/shopify-polaris-empty.css +32 -0
  224. package/src/presets/shopify-polaris/shopify-polaris-fileupload.css +78 -0
  225. package/src/presets/shopify-polaris/shopify-polaris-form.css +8 -0
  226. package/src/presets/shopify-polaris/shopify-polaris-input.css +72 -0
  227. package/src/presets/shopify-polaris/shopify-polaris-menu.css +112 -0
  228. package/src/presets/shopify-polaris/shopify-polaris-metric.css +16 -0
  229. package/src/presets/shopify-polaris/shopify-polaris-numberinput.css +88 -0
  230. package/src/presets/shopify-polaris/shopify-polaris-otpinput.css +42 -0
  231. package/src/presets/shopify-polaris/shopify-polaris-page.css +69 -0
  232. package/src/presets/shopify-polaris/shopify-polaris-passwordinput.css +76 -0
  233. package/src/presets/shopify-polaris/shopify-polaris-popover.css +47 -0
  234. package/src/presets/shopify-polaris/shopify-polaris-radio.css +54 -0
  235. package/src/presets/shopify-polaris/shopify-polaris-ratinginput.css +42 -0
  236. package/src/presets/shopify-polaris/shopify-polaris-select.css +119 -0
  237. package/src/presets/shopify-polaris/shopify-polaris-skeleton.css +8 -0
  238. package/src/presets/shopify-polaris/shopify-polaris-slider.css +86 -0
  239. package/src/presets/shopify-polaris/shopify-polaris-spinner.css +16 -0
  240. package/src/presets/shopify-polaris/shopify-polaris-splitter.css +34 -0
  241. package/src/presets/shopify-polaris/shopify-polaris-stepper.css +55 -0
  242. package/src/presets/shopify-polaris/shopify-polaris-switch.css +38 -0
  243. package/src/presets/shopify-polaris/shopify-polaris-table.css +72 -0
  244. package/src/presets/shopify-polaris/shopify-polaris-tabs.css +33 -0
  245. package/src/presets/shopify-polaris/shopify-polaris-textarea.css +61 -0
  246. package/src/presets/shopify-polaris/shopify-polaris-textlink.css +8 -0
  247. package/src/presets/shopify-polaris/shopify-polaris-toggle.css +52 -0
  248. package/src/presets/shopify-polaris/shopify-polaris-tooltip.css +31 -0
  249. package/src/presets/shopify-polaris/shopify-polaris.css +380 -0
  250. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-accordion.css +28 -0
  251. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-autocomplete.css +155 -0
  252. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-avatar.css +47 -0
  253. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-badge.css +27 -0
  254. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-banner.css +96 -0
  255. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-breadcrumb.css +16 -0
  256. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-button.css +68 -0
  257. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-card.css +28 -0
  258. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-checkbox.css +52 -0
  259. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-chip.css +16 -0
  260. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-combobox.css +184 -0
  261. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-datepicker.css +187 -0
  262. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-dialog.css +40 -0
  263. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-divider.css +12 -0
  264. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-drawer.css +40 -0
  265. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-empty.css +32 -0
  266. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-fileupload.css +72 -0
  267. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-form.css +8 -0
  268. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-input.css +72 -0
  269. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-menu.css +112 -0
  270. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-metric.css +16 -0
  271. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-numberinput.css +88 -0
  272. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-otpinput.css +42 -0
  273. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-page.css +69 -0
  274. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-passwordinput.css +76 -0
  275. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-popover.css +47 -0
  276. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-radio.css +54 -0
  277. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-ratinginput.css +42 -0
  278. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-select.css +118 -0
  279. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-skeleton.css +8 -0
  280. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-slider.css +86 -0
  281. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-spinner.css +16 -0
  282. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-splitter.css +34 -0
  283. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-stepper.css +55 -0
  284. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-switch.css +38 -0
  285. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-table.css +72 -0
  286. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-tabs.css +33 -0
  287. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-textarea.css +61 -0
  288. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-textlink.css +8 -0
  289. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-toast.css +43 -0
  290. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-toggle.css +52 -0
  291. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-tooltip.css +31 -0
  292. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy.css +381 -0
@@ -0,0 +1,71 @@
1
+ import type { StyleProps } from '../../types/Style.ts';
2
+ import type { ComponentProps, ReactElement, ReactNode } from 'react';
3
+ type BannerTone = 'neutral' | 'success' | 'danger' | 'informative' | 'caution';
4
+ /**
5
+ * Root supplies tone and an optional onClose callback. Surface is the visible banner. Closing calls your callback; you decide whether to remove the banner. Keep only the header/body parts your message needs.
6
+ *
7
+ * @example Complete composition
8
+ * import { Banner } from '@central-ui/react'
9
+ * import { useState } from 'react'
10
+ *
11
+ * function Example() {
12
+ * const [open, setOpen] = useState(true)
13
+ * return (
14
+ * <>
15
+ * {open ? (
16
+ * <Banner.Root onClose={() => setOpen(false)}>
17
+ * <Banner.Surface>
18
+ * <Banner.Header>
19
+ * <Banner.Icon />
20
+ * <Banner.Title>Notice</Banner.Title>
21
+ * <Banner.CloseButton aria-label="Dismiss">
22
+ * <Banner.CloseButtonIcon />
23
+ * </Banner.CloseButton>
24
+ * </Banner.Header>
25
+ * <Banner.Body>
26
+ * <Banner.Description>Your settings are ready to review.</Banner.Description>
27
+ * </Banner.Body>
28
+ * </Banner.Surface>
29
+ * </Banner.Root>
30
+ * ) : (
31
+ * <button
32
+ * type="button"
33
+ * onClick={() => setOpen(true)}
34
+ * className="self-start text-sm text-neutral-700 underline"
35
+ * >
36
+ * Show banner again
37
+ * </button>
38
+ * )}
39
+ * </>
40
+ * )
41
+ * }
42
+ */
43
+ export declare function Root({ tone, onClose, children, }: {
44
+ /** Choose the visual tone. This does not validate data or show/hide feedback messages. */
45
+ tone?: BannerTone;
46
+ /** Handle dismissal in application state; the callback does not remove your rendered component. */
47
+ onClose?: () => void;
48
+ children: ReactNode;
49
+ }): import("react").JSX.Element;
50
+ export declare function Surface({ disableStyle, className, ...props }: ComponentProps<'div'> & StyleProps): import("react").JSX.Element;
51
+ export declare function Header({ disableStyle, className, ...props }: ComponentProps<'div'> & StyleProps): import("react").JSX.Element;
52
+ /** A default icon is supplied. Omit children for the usual case; pass an icon only to replace that visual. */
53
+ export declare function Icon({ disableStyle, children, className, ...props }: (Omit<ComponentProps<'svg'>, 'children'> & {
54
+ /** Omit for the supplied default icon; pass a child only to replace it. */
55
+ children?: ReactElement<ComponentProps<'svg'>>;
56
+ }) & StyleProps): ReactElement<import("react").SVGProps<SVGSVGElement> & {
57
+ 'data-tone'?: BannerTone;
58
+ }, string | import("react").JSXElementConstructor<any>>;
59
+ export declare function Title({ disableStyle, className, ...props }: ComponentProps<'h2'> & StyleProps): import("react").JSX.Element;
60
+ export declare function CloseButton({ disableStyle, type, className, onClick, ...props }: ComponentProps<'button'> & StyleProps): import("react").JSX.Element;
61
+ /** A default icon is supplied. Omit children for the usual case; pass an icon only to replace that visual. */
62
+ export declare function CloseButtonIcon({ disableStyle, children, className, ...props }: (Omit<ComponentProps<'svg'>, 'children'> & {
63
+ /** Omit for the supplied default icon; pass a child only to replace it. */
64
+ children?: ReactElement<ComponentProps<'svg'>>;
65
+ }) & StyleProps): ReactElement<import("react").SVGProps<SVGSVGElement> & {
66
+ 'data-tone'?: BannerTone;
67
+ }, string | import("react").JSXElementConstructor<any>>;
68
+ export declare function Body({ disableStyle, className, ...props }: ComponentProps<'div'> & StyleProps): import("react").JSX.Element;
69
+ export declare function Description({ disableStyle, className, ...props }: ComponentProps<'div'> & StyleProps): import("react").JSX.Element;
70
+ export {};
71
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/banner/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAStD,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAIpE,KAAK,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,aAAa,GAAG,SAAS,CAAA;AAM9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,IAAI,CAAC,EACnB,IAAgB,EAChB,OAAO,EACP,QAAQ,GACT,EAAE;IACD,0FAA0F;IAC1F,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB,mGAAmG;IACnG,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,QAAQ,EAAE,SAAS,CAAA;CACpB,+BAMA;AAED,wBAAgB,OAAO,CAAC,EACtB,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG,UAAU,+BAWpC;AAED,wBAAgB,MAAM,CAAC,E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-0,0 +1,119 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { CircleAlert, CircleCheck, Info, Text, TriangleAlert, X, } from 'lucide-react';
3
+ import { cloneElement, createContext, useContext } from 'react';
4
+ import { twMerge } from 'tailwind-merge';
5
+ const BannerContext = createContext({
6
+ tone: 'neutral',
7
+ });
8
+ /**
9
+ * Root supplies tone and an optional onClose callback. Surface is the visible banner. Closing calls your callback; you decide whether to remove the banner. Keep only the header/body parts your message needs.
10
+ *
11
+ * @example Complete composition
12
+ * import { Banner } from '@central-ui/react'
13
+ * import { useState } from 'react'
14
+ *
15
+ * function Example() {
16
+ * const [open, setOpen] = useState(true)
17
+ * return (
18
+ * <>
19
+ * {open ? (
20
+ * <Banner.Root onClose={() => setOpen(false)}>
21
+ * <Banner.Surface>
22
+ * <Banner.Header>
23
+ * <Banner.Icon />
24
+ * <Banner.Title>Notice</Banner.Title>
25
+ * <Banner.CloseButton aria-label="Dismiss">
26
+ * <Banner.CloseButtonIcon />
27
+ * </Banner.CloseButton>
28
+ * </Banner.Header>
29
+ * <Banner.Body>
30
+ * <Banner.Description>Your settings are ready to review.</Banner.Description>
31
+ * </Banner.Body>
32
+ * </Banner.Surface>
33
+ * </Banner.Root>
34
+ * ) : (
35
+ * <button
36
+ * type="button"
37
+ * onClick={() => setOpen(true)}
38
+ * className="self-start text-sm text-neutral-700 underline"
39
+ * >
40
+ * Show banner again
41
+ * </button>
42
+ * )}
43
+ * </>
44
+ * )
45
+ * }
46
+ */
47
+ export function Root({ tone = 'neutral', onClose, children, }) {
48
+ return (_jsx(BannerContext.Provider, { value: { tone, onClose }, children: children }));
49
+ }
50
+ export function Surface({ disableStyle, className, ...props }) {
51
+ const { tone } = useContext(BannerContext);
52
+ return (_jsx("div", { ...props, "data-tone": tone, "data-component": "banner-surface", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
53
+ }
54
+ export function Header({ disableStyle, className, ...props }) {
55
+ const { tone } = useContext(BannerContext);
56
+ return (_jsx("div", { ...props, "data-tone": tone, "data-component": "banner-header", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
57
+ }
58
+ /** A default icon is supplied. Omit children for the usual case; pass an icon only to replace that visual. */
59
+ export function Icon({ disableStyle, children, className, ...props }) {
60
+ const { tone } = useContext(BannerContext);
61
+ const icon = children ??
62
+ (() => {
63
+ if (tone === 'danger')
64
+ return _jsx(CircleAlert, {});
65
+ if (tone === 'informative')
66
+ return _jsx(Info, {});
67
+ if (tone === 'success')
68
+ return _jsx(CircleCheck, {});
69
+ if (tone === 'caution')
70
+ return _jsx(TriangleAlert, {});
71
+ return _jsx(Text, {});
72
+ })();
73
+ return cloneElement(icon, {
74
+ ...icon.props,
75
+ ...props,
76
+ 'data-tone': tone,
77
+ ...{
78
+ 'data-component': 'banner-icon',
79
+ 'data-style-disabled': disableStyle ? '' : undefined,
80
+ },
81
+ className: twMerge(icon.props.className, className),
82
+ });
83
+ }
84
+ export function Title({ disableStyle, className, ...props }) {
85
+ const { tone } = useContext(BannerContext);
86
+ return (_jsx("h2", { ...props, "data-tone": tone, "data-component": "banner-title", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
87
+ }
88
+ export function CloseButton({ disableStyle, type = 'button', className, onClick, ...props }) {
89
+ const { tone, onClose } = useContext(BannerContext);
90
+ return (_jsx("button", { ...props, type: type, "data-tone": tone, onClick: (event) => {
91
+ onClick?.(event);
92
+ if (!event.defaultPrevented)
93
+ onClose?.();
94
+ }, "data-component": "banner-closebutton", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
95
+ }
96
+ /** A default icon is supplied. Omit children for the usual case; pass an icon only to replace that visual. */
97
+ export function CloseButtonIcon({ disableStyle, children = _jsx(X, {}), className, ...props }) {
98
+ const { tone } = useContext(BannerContext);
99
+ return cloneElement(children, {
100
+ ...children.props,
101
+ ...props,
102
+ 'data-tone': tone,
103
+ ...{
104
+ 'data-component': 'banner-closebuttonicon',
105
+ 'data-style-disabled': disableStyle ? '' : undefined,
106
+ },
107
+ className: twMerge(children.props.className, className),
108
+ strokeWidth: props.strokeWidth ?? children.props.strokeWidth ?? 1.5,
109
+ });
110
+ }
111
+ export function Body({ disableStyle, className, ...props }) {
112
+ const { tone } = useContext(BannerContext);
113
+ return (_jsx("div", { ...props, "data-tone": tone, "data-component": "banner-body", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
114
+ }
115
+ export function Description({ disableStyle, className, ...props }) {
116
+ const { tone } = useContext(BannerContext);
117
+ return (_jsx("div", { ...props, "data-tone": tone, "data-component": "banner-description", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
118
+ }
119
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/banner/index.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,WAAW,EACX,WAAW,EACX,IAAI,EACJ,IAAI,EACJ,aAAa,EACb,CAAC,GACF,MAAM,cAAc,CAAA;AAErB,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAIxC,MAAM,aAAa,GAAG,aAAa,CAA6C;IAC9E,IAAI,EAAE,SAAS;CAChB,CAAC,CAAA;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,MAAM,UAAU,IAAI,CAAC,EACnB,IAAI,GAAG,SAAS,EAChB,OAAO,EACP,QAAQ,GAOT;IACC,OAAO,CACL,KAAC,aAAa,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,YAC7C,QAAQ,GACc,CAC1B,CAAA;AACH,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,EACtB,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EAC2B;IACnC,MAAM,EAAE,IAAI,EAAE,GAAG,UAAU,CAAC,aAAa,CAAC,CAAA;IAC1C,OAAO,CACL,iBACM,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,GAAG,KAAK;QACR,WAAW,EAAE,IAAI;QACjB,GAAG;YACD,gBAAgB,EAAE,wBAAwB;YAC1C,qBAAqB,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS;SACrD;QACD,SAAS,EAAE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,EAAE,SAAS,CAAC;QACvD,WAAW,EAAE,KAAK,CAAC,WAAW,IAAI,QAAQ,CAAC,KAAK,CAAC,WAAW,IAAI,GAAG;KACpE,CACF,CAAA;AACH,CAAC;AAED,MAAM,UAAU,IAAI,CAAC,EACnB,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EAC2B;IACnC,MAAM,EAAE,IAAI,EAAE,GAAG,UAAU,CAAC,aAAa,CAAC,CAAA;IAC1C,OAAO,CACL,iBACM,KAAK,eACE,IAAI,oBACA,aAAa,yBACP,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAClD,SAAS,EAAE,SAAS,GACpB,CACH,CAAA;AACH,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,EAC1B,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EAC2B;IACnC,MAAM,EAAE,IAAI,EAAE,GAAG,UAAU,CAAC,aAAa,CAAC,CAAA;IAC1C,OAAO,CACL,iBACM,KAAK,eACE,IAAI,oBACA,oBAAoB,yBACd,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAClD,SAAS,EAAE,SAAS,GACpB,CACH,CAAA;AACH,CAAC"}
@@ -0,0 +1,31 @@
1
+ import type { StyleProps } from '../../types/Style.ts';
2
+ import type { ComponentProps, ReactElement } from 'react';
3
+ /**
4
+ * Set active_value on the default export to match the current Item value. Use Item for each location and Separator between locations; supply actual navigation behavior where needed.
5
+ *
6
+ * @example Complete composition
7
+ * import { Breadcrumb } from '@central-ui/react'
8
+ *
9
+ * function Example() {
10
+ * return (
11
+ * <Breadcrumb.default active_value="Orders">
12
+ * <Breadcrumb.Item value="Home">Home</Breadcrumb.Item>
13
+ * <Breadcrumb.Separator />
14
+ * <Breadcrumb.Item value="Orders">Orders</Breadcrumb.Item>
15
+ * </Breadcrumb.default>
16
+ * )
17
+ * }
18
+ */
19
+ export default function BreadCrumb({ disableStyle, active_value, className, children, ...props }: (ComponentProps<'div'> & {
20
+ /** Match the value of the current breadcrumb Item so it receives the active appearance. */
21
+ active_value: string;
22
+ }) & StyleProps): import("react").JSX.Element;
23
+ export declare function Item({ disableStyle, value, type, className, ...props }: (ComponentProps<'button'> & {
24
+ /** Match active_value on the breadcrumb to mark this location as current. */
25
+ value: string;
26
+ }) & StyleProps): import("react").JSX.Element;
27
+ /** Omit children to use the supplied separator icon. Override only when another separator is needed. */
28
+ export declare function Separator({ disableStyle, children, className, ...props }: (Omit<ComponentProps<'svg'>, 'children'> & {
29
+ children?: ReactElement<ComponentProps<'svg'>>;
30
+ }) & StyleProps): ReactElement<import("react").SVGProps<SVGSVGElement>, string | import("react").JSXElementConstructor<any>>;
31
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/breadcrumb/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEtD,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAMzD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IAC1B,2FAA2F;IAC3F,YAAY,EAAE,MAAM,CAAA;CACrB,CAAC,GACA,UAAU,+BAWX;AAED,wBAAgB,IAAI,CAAC,EACnB,YAAY,EACZ,KAAK,EACL,IAAe,EACf,SAAS,EACT,GAAG,KAAK,EACT,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,GAAG;IAC7B,6EAA6E;IAC7E,KAAK,EAAE,MAAM,CAAA;CACd,CAAC,GACA,UAAU,+BAYX;AAED,wGAAwG;AACxG,wBAAgB,SAAS,CAAC,EACxB,YAAY,EACZ,QAA2B,EAC3B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,GAAG;IAC5C,QAAQ,CAAC,EAAE,YAAY,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAA;CAC/C,CAAC,GACA,UAAU,8GAWX"}
@@ -0,0 +1,42 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { ChevronRight } from 'lucide-react';
3
+ import { cloneElement, createContext, useContext } from 'react';
4
+ import { twMerge } from 'tailwind-merge';
5
+ const context = createContext('');
6
+ /**
7
+ * Set active_value on the default export to match the current Item value. Use Item for each location and Separator between locations; supply actual navigation behavior where needed.
8
+ *
9
+ * @example Complete composition
10
+ * import { Breadcrumb } from '@central-ui/react'
11
+ *
12
+ * function Example() {
13
+ * return (
14
+ * <Breadcrumb.default active_value="Orders">
15
+ * <Breadcrumb.Item value="Home">Home</Breadcrumb.Item>
16
+ * <Breadcrumb.Separator />
17
+ * <Breadcrumb.Item value="Orders">Orders</Breadcrumb.Item>
18
+ * </Breadcrumb.default>
19
+ * )
20
+ * }
21
+ */
22
+ export default function BreadCrumb({ disableStyle, active_value, className, children, ...props }) {
23
+ return (_jsx("div", { ...props, "data-component": "breadcrumb-breadcrumb", "data-style-disabled": disableStyle ? '' : undefined, className: className, children: _jsx(context.Provider, { value: active_value, children: children }) }));
24
+ }
25
+ export function Item({ disableStyle, value, type = 'button', className, ...props }) {
26
+ const active_value = useContext(context);
27
+ return (_jsx("button", { ...props, type: type, "data-active": active_value === value || undefined, "data-component": "breadcrumb-item", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
28
+ }
29
+ /** Omit children to use the supplied separator icon. Override only when another separator is needed. */
30
+ export function Separator({ disableStyle, children = _jsx(ChevronRight, {}), className, ...props }) {
31
+ return cloneElement(children, {
32
+ ...children.props,
33
+ ...props,
34
+ ...{
35
+ 'data-component': 'breadcrumb-separator',
36
+ 'data-style-disabled': disableStyle ? '' : undefined,
37
+ },
38
+ className: twMerge(children.props.className, className),
39
+ strokeWidth: props.strokeWidth ?? children.props.strokeWidth ?? 2.5,
40
+ });
41
+ }
42
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/breadcrumb/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAE3C,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAExC,MAAM,OAAO,GAAG,aAAa,CAAS,EAAE,CAAC,CAAA;AAEzC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EAKE;IACV,OAAO,CACL,iBACM,KAAK,oBACM,uBAAuB,yBACjB,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAClD,SAAS,EAAE,SAAS,YAEpB,KAAC,OAAO,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,YAAG,QAAQ,GAAoB,GAChE,CACP,CAAA;AACH,CAAC;AAED,MAAM,UAAU,IAAI,CAAC,EACnB,YAAY,EACZ,KAAK,EACL,IAAI,GAAG,QAAQ,EACf,SAAS,EACT,GAAG,KAAK,EAKE;IACV,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,CAAC,CAAA;IACxC,OAAO,CACL,oBACM,KAAK,EACT,IAAI,EAAE,IAAI,iBACG,YAAY,KAAK,KAAK,IAAI,SAAS,oBACjC,iBAAiB,yBACX,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAClD,SAAS,EAAE,SAAS,GACpB,CACH,CAAA;AACH,CAAC;AAED,wGAAwG;AACxG,MAAM,UAAU,SAAS,CAAC,EACxB,YAAY,EACZ,QAAQ,GAAG,KAAC,YAAY,KAAG,EAC3B,SAAS,EACT,GAAG,KAAK,EAIE;IACV,OAAO,YAAY,CAAC,QAAQ,EAAE;QAC5B,GAAG,QAAQ,CAAC,KAAK;QACjB,GAAG,KAAK;QACR,GAAG;YACD,gBAAgB,EAAE,sBAAsB;YACxC,qBAAqB,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS;SACrD;QACD,SAAS,EAAE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,EAAE,SAAS,CAAC;QACvD,WAAW,EAAE,KAAK,CAAC,WAAW,IAAI,QAAQ,CAAC,KAAK,CAAC,WAAW,IAAI,GAAG;KACpE,CAAC,CAAA;AACJ,CAAC"}
@@ -0,0 +1,48 @@
1
+ import type { StyleProps } from '../../types/Style.ts';
2
+ import type { LucideProps } from 'lucide-react';
3
+ import type { ButtonHTMLAttributes, ComponentProps, ReactElement } from 'react';
4
+ export type ButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'variant'> & {
5
+ /** Choose the preset appearance; this does not add action behavior. */
6
+ variant: 'primary' | 'secondary' | 'tertiary';
7
+ /** Choose the visual tone. This does not validate data or show/hide feedback messages. */
8
+ tone?: 'neutral' | 'danger';
9
+ /** Choose the shared size for the visible parts in this composition. */
10
+ size?: 'small' | 'medium' | 'large' | 'icon';
11
+ } & StyleProps;
12
+ /**
13
+ * Choose variant for action emphasis and tone for destructive actions. Icon and LoadingIcon belong inside the default button; you decide when to render loading and when to disable the action.
14
+ *
15
+ * @example Complete composition
16
+ * import { Button } from '@central-ui/react'
17
+ *
18
+ * function Example() {
19
+ * return <Button.default variant="primary">Save changes</Button.default>
20
+ * }
21
+ *
22
+ * @example Group a primary action with a secondary action
23
+ * ;<Button.List>
24
+ * <Button.default variant="secondary">Cancel</Button.default>
25
+ * <Button.default variant="primary">Save</Button.default>
26
+ * </Button.List>
27
+ *
28
+ * @example Show request progress
29
+ * // Render this state only while your request is pending; no loading detection is built in.
30
+ * ;<Button.default variant="primary" disabled>
31
+ * <Button.LoadingIcon />
32
+ * Saving
33
+ * </Button.default>
34
+ */
35
+ export default function Button({ disableStyle, variant, tone, size, className, children, ...props }: ButtonProps & StyleProps): import("react").JSX.Element;
36
+ /** Supply the decorative icon as a child. Its classes are preserved; interaction belongs to the surrounding control. */
37
+ export declare function Icon({ disableStyle, children, className, ...props }: (Omit<ComponentProps<'svg'>, 'children'> & {
38
+ /** Supply the decorative icon; the wrapper forwards the relevant state and preserves its classes. */
39
+ children: ReactElement<ComponentProps<'svg'>>;
40
+ }) & StyleProps): ReactElement<import("react").SVGProps<SVGSVGElement> & {
41
+ 'data-size'?: string;
42
+ 'data-variant'?: string;
43
+ 'data-tone'?: string;
44
+ }, string | import("react").JSXElementConstructor<any>>;
45
+ /** Built-in icon; no children needed. Use it inside its matching control. */
46
+ export declare function LoadingIcon({ disableStyle, className, ...props }: LucideProps & StyleProps): import("react").JSX.Element;
47
+ export declare function List({ disableStyle, className, ...props }: ComponentProps<'div'> & StyleProps): import("react").JSX.Element;
48
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE/C,OAAO,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAI/E,MAAM,MAAM,WAAW,GAAG,IAAI,CAC5B,oBAAoB,CAAC,iBAAiB,CAAC,EACvC,SAAS,CACV,GAAG;IACF,uEAAuE;IACvE,OAAO,EAAE,SAAS,GAAG,WAAW,GAAG,UAAU,CAAA;IAC7C,0FAA0F;IAC1F,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAA;IAC3B,wEAAwE;IACxE,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAA;CAC7C,GAAG,UAAU,CAAA;AAYd;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC7B,YAAY,EACZ,OAAO,EACP,IAAgB,EAChB,IAAe,EACf,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,WAAW,GAAG,UAAU,+BAgB1B;AAED,wHAAwH;AACxH,wBAAgB,IAAI,CAAC,EACnB,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,GAAG;IAC5C,qGAAqG;IACrG,QAAQ,EAAE,YAAY,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAA;CAC9C,CAAC,GACA,UAAU;kBAMU,MAAM;qBACH,MAAM;kBACT,MAAM;wDAgB3B;AAED,6EAA6E;AAC7E,wBAAgB,WAAW,CAAC,EAC1B,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACT,EAAE,WAAW,GAAG,UAAU,+BAe1B;AAED,wBAAgB,IAAI,CAAC,EACnB,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG,UAAU,+BASpC"}
@@ -0,0 +1,60 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { LoaderCircle } from 'lucide-react';
3
+ import { cloneElement, createContext, useContext } from 'react';
4
+ import { twMerge } from 'tailwind-merge';
5
+ const context = createContext({
6
+ size: 'medium',
7
+ variant: 'primary',
8
+ tone: 'neutral',
9
+ });
10
+ /**
11
+ * Choose variant for action emphasis and tone for destructive actions. Icon and LoadingIcon belong inside the default button; you decide when to render loading and when to disable the action.
12
+ *
13
+ * @example Complete composition
14
+ * import { Button } from '@central-ui/react'
15
+ *
16
+ * function Example() {
17
+ * return <Button.default variant="primary">Save changes</Button.default>
18
+ * }
19
+ *
20
+ * @example Group a primary action with a secondary action
21
+ * ;<Button.List>
22
+ * <Button.default variant="secondary">Cancel</Button.default>
23
+ * <Button.default variant="primary">Save</Button.default>
24
+ * </Button.List>
25
+ *
26
+ * @example Show request progress
27
+ * // Render this state only while your request is pending; no loading detection is built in.
28
+ * ;<Button.default variant="primary" disabled>
29
+ * <Button.LoadingIcon />
30
+ * Saving
31
+ * </Button.default>
32
+ */
33
+ export default function Button({ disableStyle, variant, tone = 'neutral', size = 'medium', className, children, ...props }) {
34
+ return (_jsx("button", { ...props, "data-variant": variant, "data-tone": tone, "data-size": size, "data-component": "button-button", "data-style-disabled": disableStyle ? '' : undefined, className: className, children: _jsx(context.Provider, { value: { size, variant, tone }, children: children }) }));
35
+ }
36
+ /** Supply the decorative icon as a child. Its classes are preserved; interaction belongs to the surrounding control. */
37
+ export function Icon({ disableStyle, children, className, ...props }) {
38
+ const { size, variant, tone } = useContext(context);
39
+ return cloneElement(children, {
40
+ ...children.props,
41
+ ...props,
42
+ 'data-size': size,
43
+ 'data-variant': variant,
44
+ 'data-tone': tone,
45
+ ...{
46
+ 'data-component': 'button-icon',
47
+ 'data-style-disabled': disableStyle ? '' : undefined,
48
+ },
49
+ className: twMerge(children.props.className, className),
50
+ });
51
+ }
52
+ /** Built-in icon; no children needed. Use it inside its matching control. */
53
+ export function LoadingIcon({ disableStyle, className, ...props }) {
54
+ const { size, variant, tone } = useContext(context);
55
+ return (_jsx(LoaderCircle, { "data-component": "button-loadingicon", "data-style-disabled": disableStyle ? '' : undefined, className: className, strokeWidth: undefined, ...props, "data-size": size, "data-variant": variant, "data-tone": tone }));
56
+ }
57
+ export function List({ disableStyle, className, ...props }) {
58
+ return (_jsx("div", { ...props, "data-component": "button-list", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
59
+ }
60
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/button/index.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAE3C,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAcxC,MAAM,OAAO,GAAG,aAAa,CAI1B;IACD,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,SAAS;CAChB,CAAC,CAAA;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC7B,YAAY,EACZ,OAAO,EACP,IAAI,GAAG,SAAS,EAChB,IAAI,GAAG,QAAQ,EACf,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACiB;IACzB,OAAO,CACL,oBACM,KAAK,kBACK,OAAO,eACV,IAAI,eACJ,IAAI,oBACA,eAAe,yBACT,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAClD,SAAS,EAAE,SAAS,YAEpB,KAAC,OAAO,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,YAC7C,QAAQ,GACQ,GACZ,CACV,CAAA;AACH,CAAC;AAED,wHAAwH;AACxH,MAAM,UAAU,IAAI,CAAC,EACnB,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EAKE;IACV,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,UAAU,CAAC,OAAO,CAAC,CAAA;IAEnD,OAAO,YAAY,CACjB,QAMC,EACD;QACE,GAAG,QAAQ,CAAC,KAAK;QACjB,GAAG,KAAK;QACR,WAAW,EAAE,IAAI;QACjB,cAAc,EAAE,OAAO;QACvB,WAAW,EAAE,IAAI;QACjB,GAAG;YACD,gBAAgB,EAAE,aAAa;YAC/B,qBAAqB,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS;SACrD;QACD,SAAS,EAAE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,EAAE,SAAS,CAAC;KACxD,CACF,CAAA;AACH,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,WAAW,CAAC,EAC1B,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACiB;IACzB,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,UAAU,CAAC,OAAO,CAAC,CAAA;IAEnD,OAAO,CACL,KAAC,YAAY,sBACI,oBAAoB,yBACd,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAClD,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,SAAS,KAClB,KAAK,eACE,IAAI,kBACD,OAAO,eACV,IAAI,GACf,CACH,CAAA;AACH,CAAC;AAED,MAAM,UAAU,IAAI,CAAC,EACnB,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EAC2B;IACnC,OAAO,CACL,iBACM,KAAK,oBACM,aAAa,yBACP,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAClD,SAAS,EAAE,SAAS,GACpB,CACH,CAAA;AACH,CAAC"}
@@ -0,0 +1,34 @@
1
+ import type { StyleProps } from '../../types/Style.ts';
2
+ import type { HTMLAttributes } from 'react';
3
+ /**
4
+ * Use the default export as the surface, then Header, Body, and an optional Footer. Omit sections you do not need; these parts do not fetch data or implement actions.
5
+ *
6
+ * @example Complete composition
7
+ * import { Button, Card } from '@central-ui/react'
8
+ *
9
+ * function Example() {
10
+ * return (
11
+ * <Card.default>
12
+ * <Card.Header>
13
+ * <Card.Title>Team plan</Card.Title>
14
+ * <Card.Description>For growing teams.</Card.Description>
15
+ * </Card.Header>
16
+ * <Card.Body>
17
+ * <p className="text-sm text-neutral-900">Unlimited collaborators.</p>
18
+ * </Card.Body>
19
+ * <Card.Footer>
20
+ * <Button.default variant="secondary" size="small">
21
+ * Manage plan
22
+ * </Button.default>
23
+ * </Card.Footer>
24
+ * </Card.default>
25
+ * )
26
+ * }
27
+ */
28
+ export default function Card({ disableStyle, className, ...props }: HTMLAttributes<HTMLDivElement> & StyleProps): import("react").JSX.Element;
29
+ export declare function Header({ disableStyle, className, ...props }: HTMLAttributes<HTMLDivElement> & StyleProps): import("react").JSX.Element;
30
+ export declare function Title({ disableStyle, className, ...props }: HTMLAttributes<HTMLHeadingElement> & StyleProps): import("react").JSX.Element;
31
+ export declare function Description({ disableStyle, className, ...props }: HTMLAttributes<HTMLParagraphElement> & StyleProps): import("react").JSX.Element;
32
+ export declare function Body({ disableStyle, className, ...props }: HTMLAttributes<HTMLDivElement> & StyleProps): import("react").JSX.Element;
33
+ export declare function Footer({ disableStyle, className, ...props }: HTMLAttributes<HTMLDivElement> & StyleProps): import("react").JSX.Element;
34
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/card/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAG3C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,EAC3B,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,cAAc,CAAC,GAAG,UAAU,+BAS7C;AAED,wBAAgB,MAAM,CAAC,EACrB,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,cAAc,CAAC,GAAG,UAAU,+BAS7C;AAED,wBAAgB,KAAK,CAAC,EACpB,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,kBAAkB,CAAC,GAAG,UAAU,+BASjD;AAED,wBAAgB,WAAW,CAAC,EAC1B,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,oBAAoB,CAAC,GAAG,UAAU,+BASnD;AAED,wBAAgB,IAAI,CAAC,EACnB,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,cAAc,CAAC,GAAG,UAAU,+BAS7C;AAED,wBAAgB,MAAM,CAAC,EACrB,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,cAAc,CAAC,GAAG,UAAU,+BAS7C"}
@@ -0,0 +1,45 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * Use the default export as the surface, then Header, Body, and an optional Footer. Omit sections you do not need; these parts do not fetch data or implement actions.
4
+ *
5
+ * @example Complete composition
6
+ * import { Button, Card } from '@central-ui/react'
7
+ *
8
+ * function Example() {
9
+ * return (
10
+ * <Card.default>
11
+ * <Card.Header>
12
+ * <Card.Title>Team plan</Card.Title>
13
+ * <Card.Description>For growing teams.</Card.Description>
14
+ * </Card.Header>
15
+ * <Card.Body>
16
+ * <p className="text-sm text-neutral-900">Unlimited collaborators.</p>
17
+ * </Card.Body>
18
+ * <Card.Footer>
19
+ * <Button.default variant="secondary" size="small">
20
+ * Manage plan
21
+ * </Button.default>
22
+ * </Card.Footer>
23
+ * </Card.default>
24
+ * )
25
+ * }
26
+ */
27
+ export default function Card({ disableStyle, className, ...props }) {
28
+ return (_jsx("div", { "data-component": "card-card", "data-style-disabled": disableStyle ? '' : undefined, className: className, ...props }));
29
+ }
30
+ export function Header({ disableStyle, className, ...props }) {
31
+ return (_jsx("div", { "data-component": "card-header", "data-style-disabled": disableStyle ? '' : undefined, className: className, ...props }));
32
+ }
33
+ export function Title({ disableStyle, className, ...props }) {
34
+ return (_jsx("h2", { "data-component": "card-title", "data-style-disabled": disableStyle ? '' : undefined, className: className, ...props }));
35
+ }
36
+ export function Description({ disableStyle, className, ...props }) {
37
+ return (_jsx("p", { "data-component": "card-description", "data-style-disabled": disableStyle ? '' : undefined, className: className, ...props }));
38
+ }
39
+ export function Body({ disableStyle, className, ...props }) {
40
+ return (_jsx("div", { "data-component": "card-body", "data-style-disabled": disableStyle ? '' : undefined, className: className, ...props }));
41
+ }
42
+ export function Footer({ disableStyle, className, ...props }) {
43
+ return (_jsx("div", { "data-component": "card-footer", "data-style-disabled": disableStyle ? '' : undefined, className: className, ...props }));
44
+ }
45
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/card/index.tsx"],"names":[],"mappings":";AAIA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,EAC3B,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACoC;IAC5C,OAAO,CACL,gCACiB,WAAW,yBACL,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAClD,SAAS,EAAE,SAAS,KAChB,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,EACrB,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACoC;IAC5C,OAAO,CACL,gCACiB,aAAa,yBACP,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAClD,SAAS,EAAE,SAAS,KAChB,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,MAAM,UAAU,KAAK,CAAC,EACpB,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACwC;IAChD,OAAO,CACL,+BACiB,YAAY,yBACN,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAClD,SAAS,EAAE,SAAS,KAChB,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,EAC1B,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EAC0C;IAClD,OAAO,CACL,8BACiB,kBAAkB,yBACZ,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAClD,SAAS,EAAE,SAAS,KAChB,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,MAAM,UAAU,IAAI,CAAC,EACnB,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACoC;IAC5C,OAAO,CACL,gCACiB,WAAW,yBACL,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAClD,SAAS,EAAE,SAAS,KAChB,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,EACrB,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACoC;IAC5C,OAAO,CACL,gCACiB,aAAa,yBACP,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAClD,SAAS,EAAE,SAAS,KAChB,KAAK,GACT,CACH,CAAA;AACH,CAAC"}
@@ -0,0 +1,66 @@
1
+ import type { StyleProps } from '../../types/Style.ts';
2
+ import { Checkbox as BaseCheckbox } from '@base-ui/react/checkbox';
3
+ import type { ReactNode } from 'react';
4
+ type CoreKeys = 'checked' | 'defaultChecked' | 'onCheckedChange' | 'indeterminate' | 'disabled' | 'readOnly' | 'required' | 'name' | 'form' | 'value' | 'uncheckedValue' | 'id' | 'inputRef' | 'parent';
5
+ export type RootProps = Pick<BaseCheckbox.Root.Props, CoreKeys> & {
6
+ children: ReactNode;
7
+ /** Choose the visual tone. This does not validate data or show/hide feedback messages. */
8
+ tone?: 'neutral' | 'valid' | 'invalid';
9
+ };
10
+ /**
11
+ * Keep Button and Indicator inside the same Root as Label. Indicator tracks checked and indeterminate state automatically; no conditional checkmark needed. Use CheckboxGroup only when coordinating several checkbox roots.
12
+ *
13
+ * @example Complete composition
14
+ * import { Checkbox } from '@central-ui/react'
15
+ *
16
+ * function Example() {
17
+ * return (
18
+ * <Checkbox.Root name="terms" value="accepted">
19
+ * <Checkbox.Container>
20
+ * <Checkbox.Button>
21
+ * <Checkbox.Indicator />
22
+ * </Checkbox.Button>
23
+ * <Checkbox.Label>Accept the terms</Checkbox.Label>
24
+ * <Checkbox.Description>Required to continue.</Checkbox.Description>
25
+ * </Checkbox.Container>
26
+ * </Checkbox.Root>
27
+ * )
28
+ * }
29
+ *
30
+ * @example Control acceptance in application state
31
+ * import { useState } from 'react'
32
+ * function ControlledExample() {
33
+ * const [checked, setChecked] = useState(false)
34
+ * return (
35
+ * <Checkbox.Root checked={checked} onCheckedChange={setChecked}>
36
+ * <Checkbox.Container>
37
+ * {
38
+ * // Rest of components here
39
+ * }
40
+ * </Checkbox.Container>
41
+ * </Checkbox.Root>
42
+ * )
43
+ * }
44
+ */
45
+ export declare function Root({ children, id, tone, ...coreProps }: RootProps): import("react").JSX.Element;
46
+ /** Optional: controls multiple checkboxes as a native array of checked values. Put individual Roots inside and give each child a value. For a select-all checkbox, use parent on its Root and provide allValues on this controlled group; Base UI derives checked and indeterminate automatically. */
47
+ export declare const CheckboxGroup: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").CheckboxGroupProps, "className"> & {
48
+ className?: string;
49
+ } & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
50
+ export declare const Container: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
51
+ export declare const Button: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").CheckboxRootProps, "className" | "render" | "nativeButton" | CoreKeys> & {
52
+ className?: string;
53
+ } & StyleProps, "ref"> & import("react").RefAttributes<HTMLElement>>;
54
+ /** Tracks the surrounding item state automatically. Keep it mounted; do not add your own visibility condition. Use the supplied default visual unless customization is needed. */
55
+ export declare const Indicator: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").CheckboxIndicatorProps, "children" | "className" | "render"> & {
56
+ className?: string;
57
+ } & StyleProps, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
58
+ /** Labels the associated control automatically. Supply the visible text; do not wire a second label association. */
59
+ export declare const Label: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "htmlFor"> & StyleProps, "ref"> & import("react").RefAttributes<HTMLLabelElement>>;
60
+ export declare const Description: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & StyleProps, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
61
+ /** You decide when to show this feedback. Changing tone does not validate data or render the message for you. */
62
+ export declare const Error: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & StyleProps, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
63
+ /** You decide when to show this feedback. Changing tone does not validate data or render the message for you. */
64
+ export declare const Success: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & StyleProps, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
65
+ export {};
66
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/checkbox/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAE,QAAQ,IAAI,YAAY,EA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