@bysages/react 0.3.0 → 0.4.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 (277) hide show
  1. package/dist/{ai-response-jZy-0Tvv.mjs → ai-response-B4DX7nmJ.mjs} +10 -4
  2. package/dist/chevron-a2nIZKN4.mjs +6 -0
  3. package/dist/components/accordion/index.d.mts +22 -4
  4. package/dist/components/accordion/index.mjs +31 -1
  5. package/dist/components/affix/index.d.mts +4 -1
  6. package/dist/components/affix/index.mjs +5 -3
  7. package/dist/components/ai/index.d.mts +2 -2
  8. package/dist/components/ai/index.mjs +29 -12
  9. package/dist/components/ai-action/index.d.mts +4 -1
  10. package/dist/components/ai-action/index.mjs +3 -1
  11. package/dist/components/ai-attachments/index.d.mts +10 -4
  12. package/dist/components/ai-attachments/index.mjs +19 -45
  13. package/dist/components/ai-message/index.d.mts +4 -1
  14. package/dist/components/ai-message/index.mjs +3 -1
  15. package/dist/components/ai-prompt-input/index.d.mts +5 -2
  16. package/dist/components/ai-prompt-input/index.mjs +17 -17
  17. package/dist/components/ai-reasoning/index.d.mts +4 -1
  18. package/dist/components/ai-reasoning/index.mjs +4 -2
  19. package/dist/components/ai-response/index.d.mts +8 -3
  20. package/dist/components/ai-response/index.mjs +1 -1
  21. package/dist/components/ai-source/index.d.mts +8 -2
  22. package/dist/components/ai-source/index.mjs +5 -2
  23. package/dist/components/ai-suggestion/index.d.mts +4 -1
  24. package/dist/components/ai-suggestion/index.mjs +3 -1
  25. package/dist/components/ai-tool/index.d.mts +4 -1
  26. package/dist/components/ai-tool/index.mjs +4 -2
  27. package/dist/components/alert/index.d.mts +2 -0
  28. package/dist/components/alert/index.mjs +11 -18
  29. package/dist/components/angle-slider/index.d.mts +19 -2
  30. package/dist/components/angle-slider/index.mjs +31 -8
  31. package/dist/components/aspect-ratio/index.d.mts +4 -1
  32. package/dist/components/aspect-ratio/index.mjs +3 -1
  33. package/dist/components/autocomplete/index.d.mts +3 -1
  34. package/dist/components/autocomplete/index.mjs +9 -2
  35. package/dist/components/avatar/index.d.mts +2 -2
  36. package/dist/components/avatar/index.mjs +9 -2
  37. package/dist/components/avatar-group/index.d.mts +4 -1
  38. package/dist/components/avatar-group/index.mjs +3 -1
  39. package/dist/components/back-top/index.d.mts +7 -1
  40. package/dist/components/back-top/index.mjs +12 -17
  41. package/dist/components/badge/index.d.mts +4 -1
  42. package/dist/components/badge/index.mjs +3 -1
  43. package/dist/components/banner/index.mjs +13 -18
  44. package/dist/components/block-ui/index.d.mts +4 -1
  45. package/dist/components/block-ui/index.mjs +3 -1
  46. package/dist/components/breadcrumb/index.d.mts +3 -8
  47. package/dist/components/breadcrumb/index.mjs +11 -1
  48. package/dist/components/button/index.d.mts +4 -1
  49. package/dist/components/button/index.mjs +3 -1
  50. package/dist/components/calendar/index.d.mts +3 -1
  51. package/dist/components/calendar/index.mjs +9 -10
  52. package/dist/components/carousel/index.d.mts +21 -1
  53. package/dist/components/carousel/index.mjs +43 -2
  54. package/dist/components/cascade-select/index.d.mts +6 -1
  55. package/dist/components/cascade-select/index.mjs +18 -37
  56. package/dist/components/checkbox/index.d.mts +20 -2
  57. package/dist/components/checkbox/index.mjs +28 -8
  58. package/dist/components/checkbox-group/index.d.mts +8 -6
  59. package/dist/components/checkbox-group/index.mjs +44 -48
  60. package/dist/components/chip/index.d.mts +4 -1
  61. package/dist/components/chip/index.mjs +3 -1
  62. package/dist/components/client-only/index.d.mts +7 -2
  63. package/dist/components/client-only/index.mjs +5 -1
  64. package/dist/components/clipboard/index.d.mts +17 -4
  65. package/dist/components/clipboard/index.mjs +33 -5
  66. package/dist/components/collapsible/index.d.mts +16 -4
  67. package/dist/components/collapsible/index.mjs +25 -1
  68. package/dist/components/color-picker/index.d.mts +20 -4
  69. package/dist/components/color-picker/index.mjs +56 -14
  70. package/dist/components/combobox/index.d.mts +27 -1
  71. package/dist/components/combobox/index.mjs +62 -5
  72. package/dist/components/command/index.d.mts +4 -1
  73. package/dist/components/command/index.mjs +15 -3
  74. package/dist/components/comment/index.d.mts +4 -1
  75. package/dist/components/comment/index.mjs +3 -1
  76. package/dist/components/config-provider/index.d.mts +8 -2
  77. package/dist/components/config-provider/index.mjs +5 -2
  78. package/dist/components/container/index.d.mts +4 -1
  79. package/dist/components/container/index.mjs +3 -1
  80. package/dist/components/data-view/index.d.mts +4 -1
  81. package/dist/components/data-view/index.mjs +7 -3
  82. package/dist/components/date-input/index.d.mts +19 -4
  83. package/dist/components/date-input/index.mjs +33 -9
  84. package/dist/components/date-picker/index.d.mts +21 -4
  85. package/dist/components/date-picker/index.mjs +58 -11
  86. package/dist/components/deferred-content/index.d.mts +4 -1
  87. package/dist/components/deferred-content/index.mjs +3 -1
  88. package/dist/components/descriptions/index.d.mts +10 -2
  89. package/dist/components/descriptions/index.mjs +13 -8
  90. package/dist/components/dialog/index.d.mts +18 -5
  91. package/dist/components/dialog/index.mjs +43 -1
  92. package/dist/components/download-trigger/index.d.mts +7 -2
  93. package/dist/components/download-trigger/index.mjs +5 -1
  94. package/dist/components/drawer/index.d.mts +18 -6
  95. package/dist/components/drawer/index.mjs +40 -1
  96. package/dist/components/dynamic-input/index.d.mts +4 -1
  97. package/dist/components/dynamic-input/index.mjs +13 -19
  98. package/dist/components/editable/index.d.mts +28 -7
  99. package/dist/components/editable/index.mjs +43 -4
  100. package/dist/components/ellipsis/index.d.mts +4 -1
  101. package/dist/components/ellipsis/index.mjs +3 -1
  102. package/dist/components/field/index.d.mts +30 -5
  103. package/dist/components/field/index.mjs +36 -3
  104. package/dist/components/fieldset/index.d.mts +19 -4
  105. package/dist/components/fieldset/index.mjs +28 -3
  106. package/dist/components/file-upload/index.d.mts +36 -9
  107. package/dist/components/file-upload/index.mjs +66 -11
  108. package/dist/components/float-button/index.mjs +3 -1
  109. package/dist/components/floating-panel/index.d.mts +18 -6
  110. package/dist/components/floating-panel/index.mjs +55 -1
  111. package/dist/components/focus-trap/index.d.mts +7 -2
  112. package/dist/components/focus-trap/index.mjs +5 -1
  113. package/dist/components/form/index.d.mts +1 -1
  114. package/dist/components/form/index.mjs +5 -2
  115. package/dist/components/frame/index.d.mts +4 -8
  116. package/dist/components/frame/index.mjs +13 -1
  117. package/dist/components/grid/index.d.mts +4 -1
  118. package/dist/components/grid/index.mjs +3 -1
  119. package/dist/components/highlight/index.d.mts +3 -5
  120. package/dist/components/highlight/index.mjs +6 -1
  121. package/dist/components/hover-card/index.d.mts +20 -4
  122. package/dist/components/hover-card/index.mjs +32 -1
  123. package/dist/components/icon/index.d.mts +10 -8
  124. package/dist/components/icon/index.mjs +5 -3
  125. package/dist/components/image/index.d.mts +11 -2
  126. package/dist/components/image/index.mjs +16 -29
  127. package/dist/components/image-cropper/index.d.mts +13 -2
  128. package/dist/components/image-cropper/index.mjs +34 -2
  129. package/dist/components/image-viewer/index.d.mts +2 -18
  130. package/dist/components/image-viewer/index.mjs +3 -109
  131. package/dist/components/input/index.d.mts +3 -1
  132. package/dist/components/input/index.mjs +1 -1
  133. package/dist/components/json-tree-view/index.d.mts +20 -4
  134. package/dist/components/json-tree-view/index.mjs +38 -4
  135. package/dist/components/kbd/index.d.mts +4 -1
  136. package/dist/components/kbd/index.mjs +3 -1
  137. package/dist/components/layout/index.d.mts +25 -7
  138. package/dist/components/layout/index.mjs +159 -63
  139. package/dist/components/link/index.d.mts +4 -1
  140. package/dist/components/link/index.mjs +3 -1
  141. package/dist/components/list/index.d.mts +5 -4
  142. package/dist/components/list/index.mjs +10 -1
  143. package/dist/components/listbox/index.d.mts +22 -1
  144. package/dist/components/listbox/index.mjs +36 -4
  145. package/dist/components/marquee/index.d.mts +18 -1
  146. package/dist/components/marquee/index.mjs +34 -2
  147. package/dist/components/masonry/index.d.mts +4 -1
  148. package/dist/components/masonry/index.mjs +3 -1
  149. package/dist/components/media-player/index.d.mts +2 -0
  150. package/dist/components/media-player/index.mjs +2 -0
  151. package/dist/components/mentions/index.d.mts +1 -1
  152. package/dist/components/mentions/index.mjs +1 -1
  153. package/dist/components/menu/index.d.mts +29 -11
  154. package/dist/components/menu/index.mjs +34 -12
  155. package/dist/components/menubar/index.d.mts +3 -1
  156. package/dist/components/menubar/index.mjs +7 -1
  157. package/dist/components/navigation-menu/index.d.mts +25 -1
  158. package/dist/components/navigation-menu/index.mjs +36 -1
  159. package/dist/components/number-input/index.d.mts +28 -6
  160. package/dist/components/number-input/index.mjs +33 -8
  161. package/dist/components/order-list/index.d.mts +4 -1
  162. package/dist/components/order-list/index.mjs +34 -33
  163. package/dist/components/pagination/index.d.mts +23 -3
  164. package/dist/components/pagination/index.mjs +57 -12
  165. package/dist/components/password-input/index.d.mts +24 -6
  166. package/dist/components/password-input/index.mjs +31 -8
  167. package/dist/components/pin-input/index.d.mts +23 -5
  168. package/dist/components/pin-input/index.mjs +29 -7
  169. package/dist/components/popconfirm/index.d.mts +9 -5
  170. package/dist/components/popconfirm/index.mjs +23 -18
  171. package/dist/components/popover/index.d.mts +2 -8
  172. package/dist/components/popover/index.mjs +44 -4
  173. package/dist/components/presence/index.d.mts +10 -2
  174. package/dist/components/presence/index.mjs +6 -1
  175. package/dist/components/progress/index.d.mts +18 -3
  176. package/dist/components/progress/index.mjs +34 -9
  177. package/dist/components/progress-group/index.d.mts +4 -1
  178. package/dist/components/progress-group/index.mjs +4 -2
  179. package/dist/components/qr-code/index.d.mts +14 -1
  180. package/dist/components/qr-code/index.mjs +26 -2
  181. package/dist/components/radio-group/index.d.mts +27 -2
  182. package/dist/components/radio-group/index.mjs +32 -8
  183. package/dist/components/rating-group/index.d.mts +20 -3
  184. package/dist/components/rating-group/index.mjs +26 -8
  185. package/dist/components/result/index.d.mts +1 -1
  186. package/dist/components/result/index.mjs +2 -2
  187. package/dist/components/scroll-area/index.d.mts +14 -1
  188. package/dist/components/scroll-area/index.mjs +32 -2
  189. package/dist/components/segment-group/index.d.mts +28 -2
  190. package/dist/components/segment-group/index.mjs +34 -7
  191. package/dist/components/select/index.d.mts +2 -2
  192. package/dist/components/select/index.mjs +1 -1
  193. package/dist/components/separator/index.d.mts +4 -1
  194. package/dist/components/separator/index.mjs +3 -1
  195. package/dist/components/signature-pad/index.d.mts +25 -5
  196. package/dist/components/signature-pad/index.mjs +37 -3
  197. package/dist/components/skeleton/index.d.mts +4 -1
  198. package/dist/components/skeleton/index.mjs +3 -1
  199. package/dist/components/slider/index.d.mts +21 -2
  200. package/dist/components/slider/index.mjs +31 -8
  201. package/dist/components/spinner/index.d.mts +4 -1
  202. package/dist/components/spinner/index.mjs +6 -2
  203. package/dist/components/split-button/index.d.mts +3 -1
  204. package/dist/components/split-button/index.mjs +15 -18
  205. package/dist/components/splitter/index.d.mts +17 -4
  206. package/dist/components/splitter/index.mjs +35 -1
  207. package/dist/components/spotlight/index.d.mts +4 -1
  208. package/dist/components/spotlight/index.mjs +3 -1
  209. package/dist/components/stack/index.d.mts +4 -1
  210. package/dist/components/stack/index.mjs +6 -4
  211. package/dist/components/steps/index.d.mts +27 -3
  212. package/dist/components/steps/index.mjs +36 -12
  213. package/dist/components/swap/index.d.mts +11 -5
  214. package/dist/components/swap/index.mjs +30 -3
  215. package/dist/components/switch/index.d.mts +20 -2
  216. package/dist/components/switch/index.mjs +27 -8
  217. package/dist/components/table/index.d.mts +4 -1
  218. package/dist/components/table/index.mjs +44 -70
  219. package/dist/components/tabs/index.d.mts +24 -2
  220. package/dist/components/tabs/index.mjs +25 -9
  221. package/dist/components/tags-input/index.d.mts +33 -8
  222. package/dist/components/tags-input/index.mjs +41 -9
  223. package/dist/components/terminal/index.d.mts +4 -1
  224. package/dist/components/terminal/index.mjs +8 -3
  225. package/dist/components/textarea/index.d.mts +4 -1
  226. package/dist/components/textarea/index.mjs +3 -1
  227. package/dist/components/timer/index.d.mts +18 -1
  228. package/dist/components/timer/index.mjs +51 -2
  229. package/dist/components/toast/index.d.mts +3 -6
  230. package/dist/components/toast/index.mjs +22 -2
  231. package/dist/components/toc/index.d.mts +24 -4
  232. package/dist/components/toc/index.mjs +41 -3
  233. package/dist/components/toggle/index.d.mts +11 -4
  234. package/dist/components/toggle/index.mjs +21 -1
  235. package/dist/components/toggle-group/index.d.mts +26 -2
  236. package/dist/components/toggle-group/index.mjs +31 -6
  237. package/dist/components/toolbar/index.d.mts +4 -1
  238. package/dist/components/toolbar/index.mjs +3 -1
  239. package/dist/components/tooltip/index.d.mts +17 -4
  240. package/dist/components/tooltip/index.mjs +28 -1
  241. package/dist/components/tour/index.d.mts +18 -9
  242. package/dist/components/tour/index.mjs +44 -2
  243. package/dist/components/transfer/index.d.mts +3 -1
  244. package/dist/components/transfer/index.mjs +20 -30
  245. package/dist/components/tree-select/index.d.mts +3 -1
  246. package/dist/components/tree-select/index.mjs +15 -24
  247. package/dist/components/tree-view/index.d.mts +30 -1
  248. package/dist/components/tree-view/index.mjs +69 -6
  249. package/dist/components/typography/index.d.mts +4 -0
  250. package/dist/components/typography/index.mjs +1 -0
  251. package/dist/components/user/index.d.mts +4 -1
  252. package/dist/components/user/index.mjs +3 -1
  253. package/dist/components/virtual-list/index.d.mts +4 -1
  254. package/dist/components/virtual-list/index.mjs +11 -12
  255. package/dist/components/watermark/index.d.mts +4 -1
  256. package/dist/components/watermark/index.mjs +4 -2
  257. package/dist/family-DE_GQeeM.mjs +9 -0
  258. package/dist/icon-BALgGtNK.mjs +18 -0
  259. package/dist/id-C37UYLwJ.mjs +13 -0
  260. package/dist/image-viewer-Cf6thHax.mjs +141 -0
  261. package/dist/{index-Uefyw7Im.d.mts → index-Bbg4heDO.d.mts} +12 -7
  262. package/dist/index-BcRdWGY-.d.mts +115 -0
  263. package/dist/{index-DFN9F5Zt.d.mts → index-D_iKc2Uw.d.mts} +32 -3
  264. package/dist/{index-CsfxYv6J.d.mts → index-DdNKngUQ.d.mts} +63 -39
  265. package/dist/index-Dj8S4eyJ.d.mts +41 -0
  266. package/dist/index-Eu-Bttta.d.mts +24 -0
  267. package/dist/{index-uPyYiWaL.d.mts → index-PsgGWW3m.d.mts} +8 -2
  268. package/dist/index.d.mts +36 -35
  269. package/dist/index.mjs +13 -12
  270. package/dist/{input-2oezH-dY.mjs → input-C21Zzuy6.mjs} +3 -1
  271. package/dist/media-player-gQrnxU52.mjs +554 -0
  272. package/dist/{mentions-DMIBCBOd.mjs → mentions-BuWibdci.mjs} +74 -42
  273. package/dist/messages-1jJWtaYU.mjs +16 -0
  274. package/dist/select-ozUFq0zd.mjs +121 -0
  275. package/package.json +3 -3
  276. package/dist/chevron-BeHvt46K.mjs +0 -17
  277. package/dist/select-D1xiT1oJ.mjs +0 -68
@@ -1,10 +1,34 @@
1
+ import { t as iconNode } from "../../icon-BALgGtNK.mjs";
2
+ import { t as useElementId } from "../../id-C37UYLwJ.mjs";
1
3
  import { injectComponentStyle } from "@bysages/core";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
2
5
  import { Collapsible as Collapsible$1 } from "@ark-ui/react/collapsible";
3
6
  //#region src/components/collapsible/index.tsx
4
7
  /** Ark's Collapsible, dressed in the paper-and-ink system: one control on
5
8
  * the paper, its panel dissolving open to the machine's measured height.
6
9
  * The API is Ark's own — Root, Trigger, Content, Indicator. */
7
- const Collapsible = Collapsible$1;
10
+ function CollapsibleRoot(props) {
11
+ const id = useElementId("collapsible", props);
12
+ return /* @__PURE__ */ jsx(Collapsible$1.Root, {
13
+ ...props,
14
+ id
15
+ });
16
+ }
17
+ function CollapsibleFacade({ open, defaultOpen = false, label, disabled = false, className, children, onOpenChange }) {
18
+ return /* @__PURE__ */ jsxs(CollapsibleRoot, {
19
+ className,
20
+ disabled,
21
+ defaultOpen,
22
+ ...open === void 0 ? {} : { open },
23
+ onOpenChange: (details) => onOpenChange?.(details.open),
24
+ children: [/* @__PURE__ */ jsxs(Collapsible$1.Trigger, { children: [label, /* @__PURE__ */ jsx(Collapsible$1.Indicator, { children: iconNode("chevron-right") })] }), /* @__PURE__ */ jsx(Collapsible$1.Content, { children })]
25
+ });
26
+ }
27
+ CollapsibleFacade.displayName = "SCollapsible";
28
+ const Collapsible = Object.assign(CollapsibleFacade, {
29
+ ...Collapsible$1,
30
+ Root: CollapsibleRoot
31
+ });
8
32
  injectComponentStyle("collapsible");
9
33
  //#endregion
10
34
  export { Collapsible };
@@ -1,11 +1,11 @@
1
- import { ComponentProps } from "react";
2
- import { ColorPicker as ColorPicker$1 } from "@ark-ui/react/color-picker";
1
+ import { CSSProperties, ComponentProps } from "react";
2
+ import { Color, ColorPicker as ColorPicker$1 } from "@ark-ui/react/color-picker";
3
3
  //#region src/components/color-picker/index.d.ts
4
4
  type ColorPickerRootProps = ComponentProps<typeof ColorPicker$1.Root> & {
5
5
  /** One rung of the control-height ladder for the swatch seal. */
6
6
  size?: "sm" | "md" | "lg";
7
7
  };
8
- declare function ColorPickerRoot({ size, ...rest }: ColorPickerRootProps): import("react").JSX.Element;
8
+ declare function ColorPickerRoot(props: ColorPickerRootProps): import("react").JSX.Element;
9
9
  /** Ark's ColorPicker, dressed in the paper-and-ink system: a seal-sized swatch
10
10
  * on the paper, opening into an area and channel sliders where pigment is
11
11
  * picked. The API is Ark's own — Root, Label, Control, Trigger, Positioner,
@@ -14,7 +14,23 @@ declare function ColorPickerRoot({ size, ...rest }: ColorPickerRootProps): impor
14
14
  * ChannelSliderValueText, ChannelInput, TransparencyGrid, SwatchGroup,
15
15
  * SwatchTrigger, SwatchIndicator, Swatch, EyeDropperTrigger, FormatTrigger,
16
16
  * FormatSelect, HiddenInput, Context. */
17
- export declare const ColorPicker: Omit<typeof ColorPicker$1, "Root"> & {
17
+ type ColorPickerFacadeProps = {
18
+ value?: string | Color;
19
+ defaultValue?: string | Color;
20
+ disabled?: boolean;
21
+ invalid?: boolean;
22
+ required?: boolean;
23
+ label?: string;
24
+ size?: "sm" | "md" | "lg";
25
+ className?: string;
26
+ style?: CSSProperties;
27
+ onValueChange?: (value: unknown) => void;
28
+ };
29
+ /** The complete picker behind one color: the hex input rides beside the
30
+ * swatch trigger, while the popup carries the area and hue/alpha tracks.
31
+ * Saved swatches and format switches remain anatomy work. */
32
+ declare function ColorPickerFacade(props: ColorPickerFacadeProps): import("react").JSX.Element;
33
+ export declare const ColorPicker: typeof ColorPickerFacade & Omit<typeof ColorPicker$1, "Root"> & {
18
34
  Root: typeof ColorPickerRoot;
19
35
  };
20
36
  //#endregion
@@ -1,25 +1,67 @@
1
+ import { t as iconNode } from "../../icon-BALgGtNK.mjs";
2
+ import { t as useElementId } from "../../id-C37UYLwJ.mjs";
1
3
  import { injectComponentStyle } from "@bysages/core";
2
- import { jsx } from "react/jsx-runtime";
3
- import { ColorPicker as ColorPicker$1 } from "@ark-ui/react/color-picker";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { ColorPicker as ColorPicker$1, parseColor } from "@ark-ui/react/color-picker";
4
6
  //#region src/components/color-picker/index.tsx
5
- function ColorPickerRoot({ size = "md", ...rest }) {
7
+ function ColorPickerRoot(props) {
8
+ injectComponentStyle("color-picker");
9
+ const id = useElementId("color-picker", props);
10
+ const { size = "md", ...rest } = props;
6
11
  return /* @__PURE__ */ jsx(ColorPicker$1.Root, {
7
12
  ...rest,
13
+ id,
8
14
  "data-size": size
9
15
  });
10
16
  }
11
- /** Ark's ColorPicker, dressed in the paper-and-ink system: a seal-sized swatch
12
- * on the paper, opening into an area and channel sliders where pigment is
13
- * picked. The API is Ark's own — Root, Label, Control, Trigger, Positioner,
14
- * Content, Area, AreaThumb, AreaBackground, ValueText, ValueSwatch,
15
- * ChannelSlider, ChannelSliderLabel, ChannelSliderTrack, ChannelSliderThumb,
16
- * ChannelSliderValueText, ChannelInput, TransparencyGrid, SwatchGroup,
17
- * SwatchTrigger, SwatchIndicator, Swatch, EyeDropperTrigger, FormatTrigger,
18
- * FormatSelect, HiddenInput, Context. */
19
- const ColorPicker = {
17
+ /** The complete picker behind one color: the hex input rides beside the
18
+ * swatch trigger, while the popup carries the area and hue/alpha tracks.
19
+ * Saved swatches and format switches remain anatomy work. */
20
+ function ColorPickerFacade(props) {
21
+ const { value, defaultValue, disabled, invalid, required, label, size = "md", className, style, onValueChange } = props;
22
+ const toColor = (color) => typeof color === "string" ? parseColor(color) : color;
23
+ return /* @__PURE__ */ jsxs(ColorPickerRoot, {
24
+ size,
25
+ defaultValue: toColor(defaultValue),
26
+ value: toColor(value),
27
+ disabled,
28
+ invalid,
29
+ required,
30
+ className,
31
+ style,
32
+ onValueChange: (event) => onValueChange?.(event.value),
33
+ children: [
34
+ label ? /* @__PURE__ */ jsx(ColorPicker$1.Label, { children: label }) : null,
35
+ /* @__PURE__ */ jsxs(ColorPicker$1.Control, { children: [/* @__PURE__ */ jsx(ColorPicker$1.ChannelInput, { channel: "hex" }), /* @__PURE__ */ jsxs(ColorPicker$1.Trigger, { children: [/* @__PURE__ */ jsx(ColorPicker$1.TransparencyGrid, {}), /* @__PURE__ */ jsx(ColorPicker$1.ValueSwatch, {})] })] }),
36
+ /* @__PURE__ */ jsx(ColorPicker$1.Positioner, { children: /* @__PURE__ */ jsxs(ColorPicker$1.Content, { children: [/* @__PURE__ */ jsxs(ColorPicker$1.Area, { children: [/* @__PURE__ */ jsx(ColorPicker$1.AreaBackground, {}), /* @__PURE__ */ jsx(ColorPicker$1.AreaThumb, {})] }), /* @__PURE__ */ jsxs("div", {
37
+ "data-scope": "color-picker",
38
+ "data-part": "channel-controls",
39
+ children: [/* @__PURE__ */ jsx(ColorPicker$1.EyeDropperTrigger, { children: iconNode("pipette", {
40
+ width: 14,
41
+ height: 14
42
+ }) }), /* @__PURE__ */ jsxs("div", {
43
+ "data-scope": "color-picker",
44
+ "data-part": "channel-sliders",
45
+ children: [/* @__PURE__ */ jsxs(ColorPicker$1.ChannelSlider, {
46
+ channel: "hue",
47
+ children: [/* @__PURE__ */ jsx(ColorPicker$1.ChannelSliderTrack, {}), /* @__PURE__ */ jsx(ColorPicker$1.ChannelSliderThumb, {})]
48
+ }), /* @__PURE__ */ jsxs(ColorPicker$1.ChannelSlider, {
49
+ channel: "alpha",
50
+ children: [
51
+ /* @__PURE__ */ jsx(ColorPicker$1.TransparencyGrid, {}),
52
+ /* @__PURE__ */ jsx(ColorPicker$1.ChannelSliderTrack, {}),
53
+ /* @__PURE__ */ jsx(ColorPicker$1.ChannelSliderThumb, {})
54
+ ]
55
+ })]
56
+ })]
57
+ })] }) }),
58
+ /* @__PURE__ */ jsx(ColorPicker$1.HiddenInput, {})
59
+ ]
60
+ });
61
+ }
62
+ const ColorPicker = Object.assign(ColorPickerFacade, {
20
63
  ...ColorPicker$1,
21
64
  Root: ColorPickerRoot
22
- };
23
- injectComponentStyle("color-picker");
65
+ });
24
66
  //#endregion
25
67
  export { ColorPicker };
@@ -1,3 +1,4 @@
1
+ import { CSSProperties } from "react";
1
2
  import { CollectionItem } from "@ark-ui/react/collection";
2
3
  import { Combobox as Combobox$1, ComboboxRootComponentProps } from "@ark-ui/react/combobox";
3
4
  //#region src/components/combobox/index.d.ts
@@ -11,7 +12,32 @@ type ComboboxOwnProps = {
11
12
  size?: "sm" | "md" | "lg";
12
13
  };
13
14
  declare function ComboboxRoot<T extends CollectionItem>(props: ComboboxRootComponentProps<T, ComboboxOwnProps>): import("react").JSX.Element;
14
- export declare const Combobox: Omit<typeof Combobox$1, "Root"> & {
15
+ type ComboboxOption = {
16
+ label: string;
17
+ value: string;
18
+ };
19
+ type ComboboxFacadeValue = string | string[];
20
+ type ComboboxFacadeProps = {
21
+ value?: ComboboxFacadeValue;
22
+ defaultValue?: ComboboxFacadeValue;
23
+ options: ComboboxOption[];
24
+ multiple?: boolean;
25
+ /** Show the clear-value control when the machine allows it. */
26
+ clearable?: boolean;
27
+ disabled?: boolean;
28
+ invalid?: boolean;
29
+ required?: boolean;
30
+ label?: string;
31
+ placeholder?: string;
32
+ size?: "sm" | "md" | "lg";
33
+ className?: string;
34
+ style?: CSSProperties;
35
+ onValueChange?: (value?: ComboboxFacadeValue) => void;
36
+ };
37
+ /** The complete combobox behind one model value: options become the vessel's
38
+ * rows while typing, clearing, and selection stay on the common field path. */
39
+ declare function ComboboxFacade(props: ComboboxFacadeProps): import("react").JSX.Element;
40
+ export declare const Combobox: typeof ComboboxFacade & Omit<typeof Combobox$1, "Root"> & {
15
41
  Root: typeof ComboboxRoot;
16
42
  };
17
43
  //#endregion
@@ -1,18 +1,75 @@
1
+ import { t as iconNode } from "../../icon-BALgGtNK.mjs";
2
+ import { t as useElementId } from "../../id-C37UYLwJ.mjs";
1
3
  import { injectComponentStyle } from "@bysages/core";
2
- import { jsx } from "react/jsx-runtime";
3
- import { Combobox as Combobox$1 } from "@ark-ui/react/combobox";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { Combobox as Combobox$1, createListCollection } from "@ark-ui/react/combobox";
4
6
  //#region src/components/combobox/index.tsx
5
7
  function ComboboxRoot(props) {
8
+ injectComponentStyle("combobox");
9
+ const id = useElementId("combobox", props);
6
10
  const { size = "md", ...rest } = props;
7
11
  return /* @__PURE__ */ jsx(Combobox$1.Root, {
8
12
  ...rest,
13
+ id,
9
14
  "data-size": size
10
15
  });
11
16
  }
12
- const Combobox = {
17
+ function toComboboxValue(value) {
18
+ if (value === void 0) return void 0;
19
+ return Array.isArray(value) ? value : [value];
20
+ }
21
+ function fromComboboxValue(value, multiple) {
22
+ return multiple ? value : value.at(0);
23
+ }
24
+ /** The complete combobox behind one model value: options become the vessel's
25
+ * rows while typing, clearing, and selection stay on the common field path. */
26
+ function ComboboxFacade(props) {
27
+ const { value, defaultValue, options, multiple, clearable = true, disabled, invalid, required, label, placeholder, size = "md", className, style, onValueChange } = props;
28
+ const collection = createListCollection({ items: options });
29
+ return /* @__PURE__ */ jsxs(ComboboxRoot, {
30
+ size,
31
+ collection,
32
+ defaultValue: toComboboxValue(defaultValue),
33
+ value: toComboboxValue(value),
34
+ disabled,
35
+ invalid,
36
+ multiple,
37
+ placeholder,
38
+ required,
39
+ lazyMount: true,
40
+ unmountOnExit: true,
41
+ className,
42
+ style,
43
+ onValueChange: (event) => onValueChange?.(fromComboboxValue(event.value, multiple)),
44
+ children: [
45
+ label ? /* @__PURE__ */ jsx(Combobox$1.Label, { children: label }) : null,
46
+ /* @__PURE__ */ jsxs(Combobox$1.Control, { children: [
47
+ /* @__PURE__ */ jsx(Combobox$1.Input, {
48
+ placeholder,
49
+ "aria-label": label ? void 0 : placeholder
50
+ }),
51
+ clearable ? /* @__PURE__ */ jsx(Combobox$1.ClearTrigger, { children: iconNode("x", {
52
+ width: 14,
53
+ height: 14
54
+ }) }) : null,
55
+ /* @__PURE__ */ jsx(Combobox$1.Trigger, { children: iconNode("chevron-down", {
56
+ width: 16,
57
+ height: 16
58
+ }) })
59
+ ] }),
60
+ /* @__PURE__ */ jsx(Combobox$1.Positioner, { children: /* @__PURE__ */ jsxs(Combobox$1.Content, { children: [/* @__PURE__ */ jsx(Combobox$1.Empty, { children: "No results found" }), /* @__PURE__ */ jsx(Combobox$1.List, { children: collection.items.map((item) => /* @__PURE__ */ jsxs(Combobox$1.Item, {
61
+ item,
62
+ children: [/* @__PURE__ */ jsx(Combobox$1.ItemText, { children: item.label }), /* @__PURE__ */ jsx(Combobox$1.ItemIndicator, { children: iconNode("check", {
63
+ width: 14,
64
+ height: 14
65
+ }) })]
66
+ }, item.value)) })] }) })
67
+ ]
68
+ });
69
+ }
70
+ const Combobox = Object.assign(ComboboxFacade, {
13
71
  ...Combobox$1,
14
72
  Root: ComboboxRoot
15
- };
16
- injectComponentStyle("combobox");
73
+ });
17
74
  //#endregion
18
75
  export { Combobox };
@@ -1,3 +1,4 @@
1
+ import { Dialog } from "../dialog/index.mjs";
1
2
  //#region src/components/command/index.d.ts
2
3
  export interface CommandEntry {
3
4
  label: string;
@@ -17,6 +18,7 @@ export interface CommandEntry {
17
18
  * grafts onto the sheet's list.
18
19
  */
19
20
  export interface CommandProps {
21
+ id?: string;
20
22
  /** The commands on offer, grouped as they arrive. */
21
23
  items?: CommandEntry[];
22
24
  placeholder?: string;
@@ -39,5 +41,6 @@ export interface CommandProps {
39
41
  /** Reports the field's live text. */
40
42
  onInputValueChange?: (value: string) => void;
41
43
  }
42
- export declare function Command({ items, placeholder, open, autoFilter, inputValue, emptyText, onSelect, onOpenChange, onInputValueChange }: CommandProps): import("react").JSX.Element;
44
+ declare function CommandImpl({ items, placeholder, open, autoFilter, inputValue, emptyText, onSelect, onOpenChange, onInputValueChange, id }: CommandProps): import("react").JSX.Element;
45
+ export declare const Command: typeof CommandImpl & typeof Dialog;
43
46
  //#endregion
@@ -1,3 +1,6 @@
1
+ import { t as useElementId } from "../../id-C37UYLwJ.mjs";
2
+ import { n as useComponentMessages } from "../../messages-1jJWtaYU.mjs";
3
+ import { Dialog as Dialog$1 } from "../dialog/index.mjs";
1
4
  import { injectComponentStyle } from "@bysages/core";
2
5
  import { jsx, jsxs } from "react/jsx-runtime";
3
6
  import { useEffect, useState } from "react";
@@ -6,9 +9,13 @@ import { useListCollection } from "@ark-ui/react/collection";
6
9
  import { Combobox } from "@ark-ui/react/combobox";
7
10
  import { Dialog } from "@ark-ui/react/dialog";
8
11
  //#region src/components/command/index.tsx
9
- function Command({ items = [], placeholder, open, autoFilter = true, inputValue, emptyText = "No matching commands", onSelect, onOpenChange, onInputValueChange }) {
12
+ function CommandImpl({ items = [], placeholder, open, autoFilter = true, inputValue, emptyText, onSelect, onOpenChange, onInputValueChange, id }) {
10
13
  injectComponentStyle("command");
11
14
  injectComponentStyle("dialog");
15
+ const hostId = useElementId("command", { id });
16
+ const messages = useComponentMessages();
17
+ const resolvedPlaceholder = placeholder ?? messages.command.search;
18
+ const resolvedEmptyText = emptyText ?? messages.command.noMatches;
12
19
  const [internalOpen, setInternalOpen] = useState(false);
13
20
  const [listOpen, setListOpen] = useState(true);
14
21
  const [fieldText, setFieldText] = useState("");
@@ -62,6 +69,7 @@ function Command({ items = [], placeholder, open, autoFilter = true, inputValue,
62
69
  })
63
70
  }, entry.value);
64
71
  return /* @__PURE__ */ jsx(Dialog.Root, {
72
+ id: `${hostId}:dialog`,
65
73
  open: currentOpen,
66
74
  onOpenChange: (details) => setOpen(details.open),
67
75
  children: /* @__PURE__ */ jsxs(Portal, { children: [/* @__PURE__ */ jsx(Dialog.Backdrop, {}), /* @__PURE__ */ jsx(Dialog.Positioner, {
@@ -74,7 +82,9 @@ function Command({ items = [], placeholder, open, autoFilter = true, inputValue,
74
82
  children: /* @__PURE__ */ jsx("div", {
75
83
  "data-scope": "command",
76
84
  "data-part": "content",
85
+ "aria-label": messages.command.palette,
77
86
  children: /* @__PURE__ */ jsxs(Combobox.Root, {
87
+ id: `${hostId}:combobox`,
78
88
  collection,
79
89
  inputValue,
80
90
  open: listOpen,
@@ -96,7 +106,8 @@ function Command({ items = [], placeholder, open, autoFilter = true, inputValue,
96
106
  asChild: true,
97
107
  children: /* @__PURE__ */ jsx("input", {
98
108
  type: "text",
99
- placeholder,
109
+ placeholder: resolvedPlaceholder,
110
+ "aria-label": resolvedPlaceholder,
100
111
  "data-scope": "command",
101
112
  "data-part": "input"
102
113
  })
@@ -122,7 +133,7 @@ function Command({ items = [], placeholder, open, autoFilter = true, inputValue,
122
133
  }, group)), groups.size === 0 ? /* @__PURE__ */ jsx("div", {
123
134
  "data-scope": "command",
124
135
  "data-part": "empty",
125
- children: emptyText
136
+ children: resolvedEmptyText
126
137
  }) : null]
127
138
  })
128
139
  })]
@@ -133,5 +144,6 @@ function Command({ items = [], placeholder, open, autoFilter = true, inputValue,
133
144
  })] })
134
145
  });
135
146
  }
147
+ const Command = Object.assign(CommandImpl, Dialog$1);
136
148
  //#endregion
137
149
  export { Command };
@@ -13,5 +13,8 @@ export interface CommentProps extends HTMLAttributes<HTMLElement> {
13
13
  /** The row of answers beneath the ink. */
14
14
  actions?: ReactNode;
15
15
  }
16
- export declare function Comment({ author, datetime, avatar, actions, children, ...rest }: CommentProps): import("react").JSX.Element;
16
+ declare function CommentImpl({ author, datetime, avatar, actions, children, ...rest }: CommentProps): import("react").JSX.Element;
17
+ export declare const Comment: typeof CommentImpl & {
18
+ Root: typeof CommentImpl;
19
+ };
17
20
  //#endregion
@@ -1,7 +1,8 @@
1
+ import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
1
2
  import { injectComponentStyle } from "@bysages/core";
2
3
  import { jsx, jsxs } from "react/jsx-runtime";
3
4
  //#region src/components/comment/index.tsx
4
- function Comment({ author, datetime, avatar, actions, children, ...rest }) {
5
+ function CommentImpl({ author, datetime, avatar, actions, children, ...rest }) {
5
6
  injectComponentStyle("comment");
6
7
  return /* @__PURE__ */ jsxs("article", {
7
8
  ...rest,
@@ -43,5 +44,6 @@ function Comment({ author, datetime, avatar, actions, children, ...rest }) {
43
44
  })]
44
45
  });
45
46
  }
47
+ const Comment = withSelfRoot(CommentImpl);
46
48
  //#endregion
47
49
  export { Comment };
@@ -1,4 +1,4 @@
1
- import { ThemeScene } from "@bysages/core";
1
+ import { ComponentMessagesOverride, ThemeScene } from "@bysages/core";
2
2
  import { HTMLAttributes, ReactNode } from "react";
3
3
  //#region src/components/config-provider/index.d.ts
4
4
  /** The four density tiers the token layer's `[data-density]` selectors
@@ -22,6 +22,8 @@ export interface ConfigContext {
22
22
  dir?: "ltr" | "rtl";
23
23
  /** BCP-47 locale, landing as the native `lang` attribute. */
24
24
  locale?: string;
25
+ /** Partial leaf overrides for wrapper-owned runtime copy. */
26
+ messages?: ComponentMessagesOverride;
25
27
  }
26
28
  /** The nearest provider's snapshot, or an empty one when no provider
27
29
  * wraps the caller — the hook the date and format families will consume
@@ -33,6 +35,7 @@ export interface ConfigProviderProps extends HTMLAttributes<HTMLDivElement> {
33
35
  accent?: string;
34
36
  dir?: "ltr" | "rtl";
35
37
  locale?: string;
38
+ messages?: ComponentMessagesOverride;
36
39
  children?: ReactNode;
37
40
  }
38
41
  /**
@@ -42,5 +45,8 @@ export interface ConfigProviderProps extends HTMLAttributes<HTMLDivElement> {
42
45
  * descendants through `useConfig`, so interactive behavior (formatting,
43
46
  * messages) and visual theming stay one decision.
44
47
  */
45
- export declare function ConfigProvider({ density, scene, accent, dir, locale, children, ...rest }: ConfigProviderProps): import("react").JSX.Element;
48
+ declare function ConfigProviderImpl({ density, scene, accent, dir, locale, messages, children, ...rest }: ConfigProviderProps): import("react").JSX.Element;
49
+ export declare const ConfigProvider: typeof ConfigProviderImpl & {
50
+ Root: typeof ConfigProviderImpl;
51
+ };
46
52
  //#endregion
@@ -1,3 +1,4 @@
1
+ import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
1
2
  import { jsx } from "react/jsx-runtime";
2
3
  import { createContext, useContext } from "react";
3
4
  //#region src/components/config-provider/index.tsx
@@ -15,14 +16,15 @@ function useConfig() {
15
16
  * descendants through `useConfig`, so interactive behavior (formatting,
16
17
  * messages) and visual theming stay one decision.
17
18
  */
18
- function ConfigProvider({ density, scene, accent, dir, locale, children, ...rest }) {
19
+ function ConfigProviderImpl({ density, scene, accent, dir, locale, messages, children, ...rest }) {
19
20
  return /* @__PURE__ */ jsx(ConfigContextImpl.Provider, {
20
21
  value: {
21
22
  density,
22
23
  scene,
23
24
  accent,
24
25
  dir,
25
- locale
26
+ locale,
27
+ messages
26
28
  },
27
29
  children: /* @__PURE__ */ jsx("div", {
28
30
  ...rest,
@@ -37,5 +39,6 @@ function ConfigProvider({ density, scene, accent, dir, locale, children, ...rest
37
39
  })
38
40
  });
39
41
  }
42
+ const ConfigProvider = withSelfRoot(ConfigProviderImpl);
40
43
  //#endregion
41
44
  export { ConfigProvider, useConfig };
@@ -9,5 +9,8 @@ export interface ContainerProps extends HTMLAttributes<HTMLDivElement> {
9
9
  * than the measure. */
10
10
  padding?: boolean;
11
11
  }
12
- export declare function Container({ size, padding, ...rest }: ContainerProps): import("react").JSX.Element;
12
+ declare function ContainerImpl({ size, padding, ...rest }: ContainerProps): import("react").JSX.Element;
13
+ export declare const Container: typeof ContainerImpl & {
14
+ Root: typeof ContainerImpl;
15
+ };
13
16
  //#endregion
@@ -1,7 +1,8 @@
1
+ import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
1
2
  import { injectComponentStyle } from "@bysages/core";
2
3
  import { jsx } from "react/jsx-runtime";
3
4
  //#region src/components/container/index.tsx
4
- function Container({ size = "readable", padding = true, ...rest }) {
5
+ function ContainerImpl({ size = "readable", padding = true, ...rest }) {
5
6
  injectComponentStyle("container");
6
7
  return /* @__PURE__ */ jsx("div", {
7
8
  ...rest,
@@ -11,5 +12,6 @@ function Container({ size = "readable", padding = true, ...rest }) {
11
12
  "data-padding": padding ? "" : void 0
12
13
  });
13
14
  }
15
+ const Container = withSelfRoot(ContainerImpl);
14
16
  //#endregion
15
17
  export { Container };
@@ -14,5 +14,8 @@ export interface DataViewProps extends HTMLAttributes<HTMLDivElement> {
14
14
  * renderItem, the view lays the records out as a ledger or a lattice
15
15
  * and — when a page size is given — pages them with the pagination
16
16
  * family's own parts rather than a second implementation. */
17
- export declare function DataView({ items, layout, pageSize, renderItem, header, ...rest }: DataViewProps): import("react").JSX.Element;
17
+ declare function DataViewImpl({ items, layout, pageSize, renderItem, header, ...rest }: DataViewProps): import("react").JSX.Element;
18
+ export declare const DataView: typeof DataViewImpl & {
19
+ Root: typeof DataViewImpl;
20
+ };
18
21
  //#endregion
@@ -1,3 +1,5 @@
1
+ import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
2
+ import { n as useComponentMessages } from "../../messages-1jJWtaYU.mjs";
1
3
  import { Pagination } from "../pagination/index.mjs";
2
4
  import { injectComponentStyle } from "@bysages/core";
3
5
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -7,9 +9,10 @@ import { useState } from "react";
7
9
  * renderItem, the view lays the records out as a ledger or a lattice
8
10
  * and — when a page size is given — pages them with the pagination
9
11
  * family's own parts rather than a second implementation. */
10
- function DataView({ items, layout = "list", pageSize, renderItem, header, ...rest }) {
12
+ function DataViewImpl({ items, layout = "list", pageSize, renderItem, header, ...rest }) {
11
13
  injectComponentStyle("data-view");
12
14
  const [page, setPage] = useState(1);
15
+ const messages = useComponentMessages();
13
16
  const pageCount = pageSize ? Math.max(1, Math.ceil(items.length / pageSize)) : 1;
14
17
  const visible = pageSize ? items.slice((page - 1) * pageSize, page * pageSize) : items;
15
18
  return /* @__PURE__ */ jsxs("div", {
@@ -39,7 +42,7 @@ function DataView({ items, layout = "list", pageSize, renderItem, header, ...res
39
42
  onPageChange: (details) => setPage(details.page),
40
43
  children: [
41
44
  /* @__PURE__ */ jsx(Pagination.PrevTrigger, {
42
- "aria-label": "Previous page",
45
+ "aria-label": messages.pagination.previous,
43
46
  children: "‹"
44
47
  }),
45
48
  /* @__PURE__ */ jsx(Pagination.Context, { children: (pagination) => pagination.pages.map((entry, index) => entry.type === "ellipsis" ? /* @__PURE__ */ jsx(Pagination.Ellipsis, {
@@ -51,7 +54,7 @@ function DataView({ items, layout = "list", pageSize, renderItem, header, ...res
51
54
  children: entry.value
52
55
  }, entry.value)) }),
53
56
  /* @__PURE__ */ jsx(Pagination.NextTrigger, {
54
- "aria-label": "Next page",
57
+ "aria-label": messages.pagination.next,
55
58
  children: "›"
56
59
  })
57
60
  ]
@@ -60,5 +63,6 @@ function DataView({ items, layout = "list", pageSize, renderItem, header, ...res
60
63
  ]
61
64
  });
62
65
  }
66
+ const DataView = withSelfRoot(DataViewImpl);
63
67
  //#endregion
64
68
  export { DataView };
@@ -1,16 +1,31 @@
1
- import { ComponentProps } from "react";
2
- import { DateInput as DateInput$1, DateInputFocusChangeDetails, DateInputValueChangeDetails } from "@ark-ui/react/date-input";
1
+ import { CSSProperties, ComponentProps } from "react";
2
+ import { DateInput as DateInput$1, DateInputDateValue, DateInputFocusChangeDetails, DateInputValueChangeDetails } from "@ark-ui/react/date-input";
3
3
  //#region src/components/date-input/index.d.ts
4
4
  type DateInputRootProps = ComponentProps<typeof DateInput$1.Root> & {
5
5
  /** One rung of the control-height ladder for the segmented field. */
6
6
  size?: "sm" | "md" | "lg";
7
7
  };
8
- declare function DateInputRoot({ size, ...rest }: DateInputRootProps): import("react").JSX.Element;
8
+ declare function DateInputRoot(props: DateInputRootProps): import("react").JSX.Element;
9
9
  /** Ark's DateInput, dressed in the paper-and-ink system: a segmented
10
10
  * field where the focused segment takes the flat ink fill. The API is
11
11
  * Ark's own — Root, Label, Control, SegmentGroup, Segment, SegmentContext,
12
12
  * HiddenInput. */
13
- export declare const DateInput: Omit<typeof DateInput$1, "Root"> & {
13
+ type DateInputFacadeValue = DateInputDateValue | DateInputDateValue[];
14
+ type DateInputFacadeProps = {
15
+ value?: DateInputFacadeValue;
16
+ defaultValue?: DateInputFacadeValue;
17
+ disabled?: boolean;
18
+ invalid?: boolean;
19
+ required?: boolean;
20
+ label?: string;
21
+ size?: "sm" | "md" | "lg";
22
+ className?: string;
23
+ style?: CSSProperties;
24
+ onValueChange?: (value: DateInputDateValue[]) => void;
25
+ };
26
+ /** The complete segmented date field behind one model value. */
27
+ declare function DateInputFacade(props: DateInputFacadeProps): import("react").JSX.Element;
28
+ export declare const DateInput: typeof DateInputFacade & Omit<typeof DateInput$1, "Root"> & {
14
29
  Root: typeof DateInputRoot;
15
30
  };
16
31
  //#endregion
@@ -1,21 +1,45 @@
1
+ import { t as useElementId } from "../../id-C37UYLwJ.mjs";
1
2
  import { injectComponentStyle } from "@bysages/core";
2
- import { jsx } from "react/jsx-runtime";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
3
4
  import { DateInput as DateInput$1 } from "@ark-ui/react/date-input";
4
5
  //#region src/components/date-input/index.tsx
5
- function DateInputRoot({ size = "md", ...rest }) {
6
+ function DateInputRoot(props) {
7
+ injectComponentStyle("date-input");
8
+ const id = useElementId("date-input", props);
9
+ const { size = "md", ...rest } = props;
6
10
  return /* @__PURE__ */ jsx(DateInput$1.Root, {
7
11
  ...rest,
12
+ id,
8
13
  "data-size": size
9
14
  });
10
15
  }
11
- /** Ark's DateInput, dressed in the paper-and-ink system: a segmented
12
- * field where the focused segment takes the flat ink fill. The API is
13
- * Ark's own — Root, Label, Control, SegmentGroup, Segment, SegmentContext,
14
- * HiddenInput. */
15
- const DateInput = {
16
+ function toDateInputValue(value) {
17
+ if (value === void 0) return void 0;
18
+ return Array.isArray(value) ? value : [value];
19
+ }
20
+ /** The complete segmented date field behind one model value. */
21
+ function DateInputFacade(props) {
22
+ const { value, defaultValue, disabled, invalid, required, label, size = "md", className, style, onValueChange } = props;
23
+ return /* @__PURE__ */ jsxs(DateInputRoot, {
24
+ size,
25
+ defaultValue: toDateInputValue(defaultValue),
26
+ value: toDateInputValue(value),
27
+ disabled,
28
+ invalid,
29
+ required,
30
+ className,
31
+ style,
32
+ onValueChange: (event) => onValueChange?.(event.value),
33
+ children: [
34
+ label ? /* @__PURE__ */ jsx(DateInput$1.Label, { children: label }) : null,
35
+ /* @__PURE__ */ jsx(DateInput$1.Control, { children: /* @__PURE__ */ jsx(DateInput$1.SegmentGroup, { children: /* @__PURE__ */ jsx(DateInput$1.SegmentContext, { children: (segmentProps) => /* @__PURE__ */ jsx(DateInput$1.Segment, { segment: segmentProps }) }) }) }),
36
+ /* @__PURE__ */ jsx(DateInput$1.HiddenInput, {})
37
+ ]
38
+ });
39
+ }
40
+ const DateInput = Object.assign(DateInputFacade, {
16
41
  ...DateInput$1,
17
42
  Root: DateInputRoot
18
- };
19
- injectComponentStyle("date-input");
43
+ });
20
44
  //#endregion
21
45
  export { DateInput };