@accelint/design-toolkit 2.4.3 → 2.5.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 (252) hide show
  1. package/dist/components/accordion/index.d.ts +1 -1
  2. package/dist/components/accordion/index.js +1 -1
  3. package/dist/components/accordion/index.js.map +1 -1
  4. package/dist/components/accordion/styles.d.ts +1 -5
  5. package/dist/components/accordion/styles.js +1 -1
  6. package/dist/components/accordion/styles.js.map +1 -1
  7. package/dist/components/accordion/types.d.ts +9 -10
  8. package/dist/components/avatar/index.d.ts +4 -2
  9. package/dist/components/avatar/index.js +1 -1
  10. package/dist/components/avatar/index.js.map +1 -1
  11. package/dist/components/avatar/styles.d.ts +16 -15
  12. package/dist/components/avatar/styles.js +1 -1
  13. package/dist/components/avatar/styles.js.map +1 -1
  14. package/dist/components/avatar/types.d.ts +7 -7
  15. package/dist/components/badge/index.d.ts +3 -2
  16. package/dist/components/badge/index.js +1 -1
  17. package/dist/components/badge/index.js.map +1 -1
  18. package/dist/components/badge/styles.js +1 -1
  19. package/dist/components/badge/styles.js.map +1 -1
  20. package/dist/components/badge/types.d.ts +3 -4
  21. package/dist/components/box/index.js +1 -1
  22. package/dist/components/box/index.js.map +1 -1
  23. package/dist/components/button/index.d.ts +6 -4
  24. package/dist/components/button/index.js +1 -1
  25. package/dist/components/button/index.js.map +1 -1
  26. package/dist/components/button/styles.d.ts +25 -24
  27. package/dist/components/button/styles.js +1 -1
  28. package/dist/components/button/styles.js.map +1 -1
  29. package/dist/components/button/types.d.ts +3 -5
  30. package/dist/components/checkbox/index.js +1 -1
  31. package/dist/components/checkbox/index.js.map +1 -1
  32. package/dist/components/checkbox/styles.d.ts +19 -18
  33. package/dist/components/checkbox/styles.js +1 -1
  34. package/dist/components/checkbox/styles.js.map +1 -1
  35. package/dist/components/chip/index.d.ts +4 -2
  36. package/dist/components/chip/index.js +1 -1
  37. package/dist/components/chip/index.js.map +1 -1
  38. package/dist/components/chip/styles.d.ts +70 -69
  39. package/dist/components/chip/styles.js +1 -1
  40. package/dist/components/chip/styles.js.map +1 -1
  41. package/dist/components/chip/types.d.ts +5 -5
  42. package/dist/components/classification-badge/index.d.ts +3 -2
  43. package/dist/components/classification-badge/index.js +1 -1
  44. package/dist/components/classification-badge/index.js.map +1 -1
  45. package/dist/components/classification-badge/styles.js +1 -1
  46. package/dist/components/classification-badge/styles.js.map +1 -1
  47. package/dist/components/classification-badge/types.d.ts +3 -4
  48. package/dist/components/classification-banner/index.d.ts +3 -2
  49. package/dist/components/classification-banner/index.js +1 -1
  50. package/dist/components/classification-banner/index.js.map +1 -1
  51. package/dist/components/classification-banner/styles.js +1 -1
  52. package/dist/components/classification-banner/styles.js.map +1 -1
  53. package/dist/components/classification-banner/types.d.ts +3 -4
  54. package/dist/components/color-picker/index.d.ts +45 -15
  55. package/dist/components/color-picker/index.js +1 -1
  56. package/dist/components/color-picker/index.js.map +1 -1
  57. package/dist/components/color-picker/styles.d.ts +42 -0
  58. package/dist/components/color-picker/styles.js +2 -0
  59. package/dist/components/color-picker/styles.js.map +1 -0
  60. package/dist/components/color-picker/types.d.ts +13 -0
  61. package/dist/components/color-picker/types.js +2 -0
  62. package/dist/components/color-picker/types.js.map +1 -0
  63. package/dist/components/combobox/index.d.ts +9 -14
  64. package/dist/components/combobox/index.js +1 -1
  65. package/dist/components/combobox/index.js.map +1 -1
  66. package/dist/components/date-field/index.d.ts +8 -24
  67. package/dist/components/date-field/index.js +1 -1
  68. package/dist/components/date-field/index.js.map +1 -1
  69. package/dist/components/date-field/styles.d.ts +69 -0
  70. package/dist/components/date-field/styles.js +2 -0
  71. package/dist/components/date-field/styles.js.map +1 -0
  72. package/dist/components/date-field/types.d.ts +29 -0
  73. package/dist/components/date-field/types.js +2 -0
  74. package/dist/components/date-field/types.js.map +1 -0
  75. package/dist/components/details-list/index.d.ts +59 -0
  76. package/dist/components/details-list/index.js +2 -0
  77. package/dist/components/details-list/index.js.map +1 -0
  78. package/dist/components/details-list/styles.d.ts +65 -0
  79. package/dist/components/details-list/styles.js +2 -0
  80. package/dist/components/details-list/styles.js.map +1 -0
  81. package/dist/components/details-list/types.d.ts +16 -0
  82. package/dist/components/details-list/types.js +2 -0
  83. package/dist/components/details-list/types.js.map +1 -0
  84. package/dist/components/dialog/index.d.ts +1 -0
  85. package/dist/components/dialog/index.js +1 -1
  86. package/dist/components/dialog/index.js.map +1 -1
  87. package/dist/components/drawer/context.d.ts +13 -0
  88. package/dist/components/drawer/context.js +2 -0
  89. package/dist/components/drawer/context.js.map +1 -0
  90. package/dist/components/drawer/index.d.ts +48 -0
  91. package/dist/components/drawer/index.js +2 -0
  92. package/dist/components/drawer/index.js.map +1 -0
  93. package/dist/components/drawer/state.d.ts +26 -0
  94. package/dist/components/drawer/state.js +2 -0
  95. package/dist/components/drawer/state.js.map +1 -0
  96. package/dist/components/drawer/styles.d.ts +118 -0
  97. package/dist/components/drawer/styles.js +2 -0
  98. package/dist/components/drawer/styles.js.map +1 -0
  99. package/dist/components/drawer/types.d.ts +279 -0
  100. package/dist/components/drawer/types.js +2 -0
  101. package/dist/components/drawer/types.js.map +1 -0
  102. package/dist/components/hero/index.d.ts +45 -0
  103. package/dist/components/hero/index.js +2 -0
  104. package/dist/components/hero/index.js.map +1 -0
  105. package/dist/components/hero/styles.d.ts +48 -0
  106. package/dist/components/hero/styles.js +2 -0
  107. package/dist/components/hero/styles.js.map +1 -0
  108. package/dist/components/hero/types.d.ts +13 -0
  109. package/dist/components/hero/types.js +2 -0
  110. package/dist/components/hero/types.js.map +1 -0
  111. package/dist/components/icon/index.d.ts +3 -2
  112. package/dist/components/icon/index.js +1 -1
  113. package/dist/components/icon/index.js.map +1 -1
  114. package/dist/components/icon/styles.js +1 -1
  115. package/dist/components/icon/styles.js.map +1 -1
  116. package/dist/components/icon/types.d.ts +4 -5
  117. package/dist/components/input/index.d.ts +1 -0
  118. package/dist/components/input/index.js +1 -1
  119. package/dist/components/input/index.js.map +1 -1
  120. package/dist/components/input/styles.js +1 -1
  121. package/dist/components/input/styles.js.map +1 -1
  122. package/dist/components/input/types.d.ts +1 -0
  123. package/dist/components/label/index.d.ts +3 -2
  124. package/dist/components/label/index.js +1 -1
  125. package/dist/components/label/index.js.map +1 -1
  126. package/dist/components/label/styles.js +1 -1
  127. package/dist/components/label/styles.js.map +1 -1
  128. package/dist/components/label/types.d.ts +2 -3
  129. package/dist/components/menu/index.d.ts +16 -21
  130. package/dist/components/menu/index.js +1 -1
  131. package/dist/components/menu/index.js.map +1 -1
  132. package/dist/components/menu/styles.js +1 -1
  133. package/dist/components/menu/styles.js.map +1 -1
  134. package/dist/components/navigation-stack/index.d.ts +20 -0
  135. package/dist/components/navigation-stack/index.js +2 -0
  136. package/dist/components/navigation-stack/index.js.map +1 -0
  137. package/dist/components/navigation-stack/types.d.ts +31 -0
  138. package/dist/components/navigation-stack/types.js +2 -0
  139. package/dist/components/navigation-stack/types.js.map +1 -0
  140. package/dist/components/options/index.d.ts +28 -22
  141. package/dist/components/options/index.js +1 -1
  142. package/dist/components/options/index.js.map +1 -1
  143. package/dist/components/options/styles.d.ts +72 -0
  144. package/dist/components/options/styles.js +2 -0
  145. package/dist/components/options/styles.js.map +1 -0
  146. package/dist/components/options/types.d.ts +29 -0
  147. package/dist/components/options/types.js +2 -0
  148. package/dist/components/options/types.js.map +1 -0
  149. package/dist/components/popover/index.js +1 -1
  150. package/dist/components/popover/index.js.map +1 -1
  151. package/dist/components/popover/styles.d.ts +16 -15
  152. package/dist/components/popover/styles.js +1 -1
  153. package/dist/components/popover/styles.js.map +1 -1
  154. package/dist/components/query-builder/action-element.js +1 -1
  155. package/dist/components/query-builder/action-element.js.map +1 -1
  156. package/dist/components/query-builder/constants.js +1 -1
  157. package/dist/components/query-builder/constants.js.map +1 -1
  158. package/dist/components/query-builder/group.js +1 -1
  159. package/dist/components/query-builder/group.js.map +1 -1
  160. package/dist/components/query-builder/index.d.ts +5 -20
  161. package/dist/components/query-builder/index.js +1 -1
  162. package/dist/components/query-builder/index.js.map +1 -1
  163. package/dist/components/query-builder/rule.js +1 -1
  164. package/dist/components/query-builder/rule.js.map +1 -1
  165. package/dist/components/query-builder/types.d.ts +22 -0
  166. package/dist/components/query-builder/types.js +2 -0
  167. package/dist/components/query-builder/types.js.map +1 -0
  168. package/dist/components/query-builder/utils.js +1 -1
  169. package/dist/components/query-builder/utils.js.map +1 -1
  170. package/dist/components/query-builder/value-editor.js +1 -1
  171. package/dist/components/query-builder/value-editor.js.map +1 -1
  172. package/dist/components/query-builder/value-selector.js +1 -1
  173. package/dist/components/query-builder/value-selector.js.map +1 -1
  174. package/dist/components/radio/index.js +1 -1
  175. package/dist/components/radio/index.js.map +1 -1
  176. package/dist/components/radio/styles.d.ts +19 -18
  177. package/dist/components/radio/styles.js +1 -1
  178. package/dist/components/radio/styles.js.map +1 -1
  179. package/dist/components/radio/types.d.ts +2 -3
  180. package/dist/components/search-field/index.d.ts +56 -15
  181. package/dist/components/search-field/index.js +1 -1
  182. package/dist/components/search-field/index.js.map +1 -1
  183. package/dist/components/search-field/styles.d.ts +53 -0
  184. package/dist/components/search-field/styles.js +2 -0
  185. package/dist/components/search-field/styles.js.map +1 -0
  186. package/dist/components/search-field/types.d.ts +25 -0
  187. package/dist/components/search-field/types.js +2 -0
  188. package/dist/components/search-field/types.js.map +1 -0
  189. package/dist/components/skeleton/index.d.ts +42 -0
  190. package/dist/components/skeleton/index.js +2 -0
  191. package/dist/components/skeleton/index.js.map +1 -0
  192. package/dist/components/skeleton/styles.d.ts +23 -0
  193. package/dist/components/skeleton/styles.js +2 -0
  194. package/dist/components/skeleton/styles.js.map +1 -0
  195. package/dist/components/skeleton/types.d.ts +8 -0
  196. package/dist/components/skeleton/types.js +2 -0
  197. package/dist/components/skeleton/types.js.map +1 -0
  198. package/dist/components/slider/index.js +1 -1
  199. package/dist/components/slider/index.js.map +1 -1
  200. package/dist/components/switch/index.d.ts +3 -2
  201. package/dist/components/switch/index.js +1 -1
  202. package/dist/components/switch/index.js.map +1 -1
  203. package/dist/components/switch/styles.d.ts +13 -12
  204. package/dist/components/switch/styles.js +1 -1
  205. package/dist/components/switch/styles.js.map +1 -1
  206. package/dist/components/switch/types.d.ts +2 -3
  207. package/dist/components/tabs/index.js +1 -1
  208. package/dist/components/tabs/index.js.map +1 -1
  209. package/dist/components/text-area-field/index.d.ts +4 -3
  210. package/dist/components/text-area-field/index.js +1 -1
  211. package/dist/components/text-area-field/index.js.map +1 -1
  212. package/dist/components/text-area-field/styles.d.ts +19 -18
  213. package/dist/components/text-area-field/styles.js +1 -1
  214. package/dist/components/text-area-field/styles.js.map +1 -1
  215. package/dist/components/text-area-field/types.d.ts +2 -3
  216. package/dist/components/text-field/index.d.ts +4 -2
  217. package/dist/components/text-field/index.js +1 -1
  218. package/dist/components/text-field/index.js.map +1 -1
  219. package/dist/components/text-field/styles.d.ts +19 -18
  220. package/dist/components/text-field/styles.js +1 -1
  221. package/dist/components/text-field/styles.js.map +1 -1
  222. package/dist/components/text-field/types.d.ts +4 -4
  223. package/dist/components/tooltip/index.d.ts +14 -28
  224. package/dist/components/tooltip/index.js +1 -1
  225. package/dist/components/tooltip/index.js.map +1 -1
  226. package/dist/components/tooltip/styles.d.ts +5 -0
  227. package/dist/components/tooltip/styles.js +2 -0
  228. package/dist/components/tooltip/styles.js.map +1 -0
  229. package/dist/components/tooltip/types.d.ts +8 -0
  230. package/dist/components/tooltip/types.js +2 -0
  231. package/dist/components/tooltip/types.js.map +1 -0
  232. package/dist/icons/catalog.js +1 -1
  233. package/dist/index.d.ts +54 -28
  234. package/dist/index.js +1 -1
  235. package/dist/lib/react.d.ts +13 -12
  236. package/dist/lib/react.js +4 -4
  237. package/dist/lib/react.js.map +1 -1
  238. package/dist/lib/types.d.ts +6 -2
  239. package/dist/lib/utils.js +1 -1
  240. package/dist/lib/utils.js.map +1 -1
  241. package/dist/metafile-esm.json +1 -1
  242. package/dist/styles.css +1341 -278
  243. package/dist/tokens/index.js +1 -1
  244. package/dist/tokens/index.js.map +1 -1
  245. package/dist/variants/variants.css +6 -0
  246. package/package.json +79 -56
  247. package/dist/components/options-item/index.d.ts +0 -30
  248. package/dist/components/options-item/index.js +0 -2
  249. package/dist/components/options-item/index.js.map +0 -1
  250. package/dist/components/query-builder/example-configuration.d.ts +0 -30
  251. package/dist/components/query-builder/example-configuration.js +0 -2
  252. package/dist/components/query-builder/example-configuration.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/color-picker/index.tsx"],"names":["value","parseColor","P","useMemo","parseColorFromProp","props","useControlledState","defaultValue","color","ref","colorFromProps","propColor","n","locale","map","useContext","ColorMapContext","m","useEffect","p","key","jsx","AriaListBoxItem","a","S","createContext","h","useContextProps","ColorSwatchPickerContext","v","state","useColorPickerState","colorMap","w","u","x","ColorPicker"],"mappings":"4WA8CE,CAAA,CAAI,CAAA,EAAA,CAAA,GAAOA,uBAEAC,OACTC,UAAA,CAAA,CAAQ,CACN,MACF,CAEF,MAAA,CAAOF,OAGF,CAAA,CAAA,CAAA,WAGCA,CAAAA,CAAQG,CAAAA,KAAcC,CAAAA,OAAmBC,CAAAA,MAAW,CAAA,CAAG,KAAO,CAAA,CAAA,CAAK,CAAC,MAGxE,IAAMD,CAAAA,OAAmBC,CAAAA,oBAAsB,EAAA,SACxC,CAAA,CAAA,CAAA,CAAA,CAAA,YAEa,EAAIC,CAAAA,CACxBN,CAAAA,CAAAA,CAAS,sBACTO,EACAF,iBAGF,CAAO,CACL,OAAAG,CAAAA,gBAEgB,CAChB,CACF,CACF,CAeA,iBACEC,CAAAA,CAAM,CAAA,GAAA,CACN,MAAOC,CAAAA,KAET,CAAA,CAGG,CACD,IAAMC,CAAAA,CAAYD,CAAAA,kBAET,CAAAE,OAAA,CAAA,IAAOD,kBAAiDA,CAC/DT,UAACS,CAAS,CACZ,CAAA,CACM,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAAE,MAAqB,CACvBC,EAAMC,CAAAA,SAAWC,G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AAC,GAAE,CAGzCA,CAAAA,CAAM,eAGZ,KACIzB,CAAAA,EAEJ,8BAA0B,CAAO2B,MAC9B,CAAA,CAAA,CAAA,QAMF,0BAEL,CAAA,CAAA,CAAA,SAEF,EAAqB,CACnB,GAAA,CAAA,CAAA,CAAA,CACEX,uBACgB,CAAAa,EAAA,CAAA,sBACV7B,EAEH,CAAA,CAAA,GAAA,CAAA,CAAA,QAAaG,CAAAA,CAAAA,CACZa,IAAC,CAA6C,EAAAE,GAAA,CAAA,CAAA,CAAOf,MACnD,CAAA,CAAA,CAAA,QAAiB,CAAAe,GAAA,CAAAY,WAAA,CAAA,CAAA,2CAM3BC,EAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,WAAc,CAAA,aAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\nimport { cn } from '@/lib/utils';\nimport { useControlledState } from '@react-stately/utils';\nimport 'client-only';\nimport {\n type ForwardedRef,\n type ReactNode,\n createContext,\n useContext,\n useEffect,\n useMemo,\n} from 'react';\nimport {\n ColorSwatch as AriaColorSwatch,\n ColorSwatchContext as AriaColorSwatchContext,\n type ColorSwatchPickerItemProps as AriaColorSwatchPickerItemProps,\n type ColorSwatchPickerProps as AriaColorSwatchPickerProps,\n ListBox as AriaListBox,\n ListBoxItem as AriaListBoxItem,\n type Color,\n ColorSwatchPickerContext,\n parseColor,\n useContextProps,\n useLocale,\n} from 'react-aria-components';\n\ninterface ColorPickerState {\n /** The current color value of the color picker. */\n color: Color | null;\n /** Sets the current color value of the color picker. */\n setColor(color: Color | null): void;\n}\n\nconst parseColorFromProp = (value?: Color | string) => {\n if (typeof value === 'string') {\n try {\n return parseColor(value);\n } catch {\n return undefined;\n }\n }\n return value;\n};\n\nexport function useColorPickerState(\n props: AriaColorSwatchPickerProps,\n): ColorPickerState {\n const value = useMemo(() => parseColorFromProp(props.value), [props.value]);\n\n const defaultValue = useMemo(\n () => parseColorFromProp(props.defaultValue || '#000000'),\n [props.defaultValue],\n );\n const [color, setColor] = useControlledState(\n value || null,\n defaultValue as Color,\n props.onChange,\n );\n\n return {\n color,\n setColor(color) {\n setColor(color);\n },\n };\n}\n\n/**\n * Renders a single color swatch item for use within a color picker list.\n *\n * This component manages the registration of its color value in a shared color map context,\n * and provides the color value to its children via context. It also handles accessibility\n * and styling for selection and focus states.\n\n *\n * @remarks\n * - The component registers its color in a shared `ColorMapContext` on mount and removes it on unmount.\n * - The color is parsed and memoized for performance.\n * - The swatch item is rendered as an accessible list box item.\n */\nfunction ColorSwatchPickerItem({\n ref = null,\n color: colorFromProps,\n ...props\n}: Omit<AriaColorSwatchPickerItemProps, 'style'> & {\n children: ReactNode;\n ref?: ForwardedRef<HTMLDivElement>;\n}) {\n const propColor = colorFromProps || '#0000';\n const color = useMemo(\n () => (typeof propColor === 'string' ? parseColor(propColor) : propColor),\n [propColor],\n );\n const { locale } = useLocale();\n const map = useContext(ColorMapContext);\n\n // Register the color in the map context on mount and remove it on unmount.\n // This allows the color picker to manage its own state and selection.\n // The key is the color's hex representation, ensuring uniqueness.\n // The color is also provided to the context for use by children components.\n // This is useful for rendering the swatch or any related UI elements.\n useEffect(() => {\n const key = color.toString('hexa');\n map?.set(key, color);\n return () => {\n map?.delete(key);\n };\n }, [color, map]);\n\n return (\n <AriaListBoxItem\n {...props}\n ref={ref}\n id={color.toString('hexa')}\n textValue={color.getColorName(locale)}\n className='w-fit outline-none outline outline-offset-1 hover:outline-interactive-hover hover:outline-solid focus:outline-interactive-hover focus:outline-solid data-selected:outline-highlight data-selected:outline-solid'\n >\n <AriaColorSwatchContext.Provider value={{ color }}>\n {props.children}\n </AriaColorSwatchContext.Provider>\n </AriaListBoxItem>\n );\n}\n\nconst ColorMapContext = createContext<Map<string, Color> | null>(null);\n\nexport interface ColorPickerProps extends AriaColorSwatchPickerProps {\n options: AriaColorSwatchPickerItemProps['color'][];\n ref?: ForwardedRef<HTMLDivElement>;\n}\n\ninterface ColorSwatchPickerProps extends Omit<ColorPickerProps, 'options'> {\n children?: ReactNode;\n}\n\nfunction ColorSwatchPicker({\n ref = null,\n className,\n children,\n ...props\n}: ColorSwatchPickerProps) {\n [props, ref] = useContextProps(props, ref, ColorSwatchPickerContext);\n const state = useColorPickerState(props);\n const colorMap = useMemo(() => new Map(), []);\n return (\n <AriaListBox\n className={cn('flex flex-wrap gap-s', className)}\n style={props.style}\n layout={props.layout || 'grid'}\n selectionMode='single'\n selectedKeys={state.color ? [state.color.toString('hexa')] : undefined}\n onSelectionChange={(keys) => {\n // single select, 'all' cannot occur.\n if (keys !== 'all') {\n if (keys.size > 0) {\n state.setColor(colorMap.get([...keys][0]));\n } else {\n // If no keys are selected, we can set the color to null or a default value\n state.setColor(null);\n }\n }\n }}\n {...props}\n >\n <ColorMapContext.Provider value={colorMap}>\n {children}\n </ColorMapContext.Provider>\n </AriaListBox>\n );\n}\n\nexport function ColorPicker({\n options,\n className,\n ...props\n}: ColorPickerProps) {\n return (\n <ColorSwatchPicker\n className={cn('flex flex-wrap gap-s', className)}\n {...props}\n >\n {options.map((color) => (\n <ColorSwatchPickerItem key={color.toString()} color={color}>\n <AriaColorSwatch className='h-[16px] w-[16px]' />\n </ColorSwatchPickerItem>\n ))}\n </ColorSwatchPicker>\n );\n}\nColorPicker.displayName = 'ColorPicker';\n"]}
1
+ {"version":3,"sources":["../../../src/components/color-picker/index.tsx"],"names":["ColorPickerStyles","k","rest","c","m","classNames","picker","color","jsx","ColorSwatchPickerItem","item","ColorSwatch","l","swatch","ColorPicker"],"mappings":"oNAuBQ,CAAA,MAAQ,CAAA,CAAA,CAAA,IAAM,CAAA,CAAA,CAAA,MAAWA,CAAAA,CAAkB,EA0C5CC,iBAAA,EAAA,CAAA,SAAuB,CAAA,CAAA,CAAA,UAAY,CAAA,CAAA,CAAA,KAAO,CAAA,CAAGC,CAAK,GACvD,CAAA,CAAA,CAAA,CAAA,OACGC,GACE,CAAAC,iBAAA,CAAGF,IACJ,CAAA,CAAA,SAA8BG,CAAAA,kBAAY,CAAA,CAAA,EAAA,MACxCC,CAAAA,CAAO,EAAE,CAAA,CAAA,CAAA,SACX,CAAA,CAEC,YAAM,CAAA,CAAA,CAAKC,GACVC,CAAAA,CAACC,EAAAN,GAEC,iCAA8BE,CAAAA,kBAAY,CAAA,CAAA,EAAA,IACxCK,CAAAA,CAAK,cACP,CAAA,CACA,CAAA,CAAA,CAAA,CAAA,gBAECC,CAAAR,GACC,CAAAS,WAAA,CAAA,CAAA,SAA8BP,CAAAA,kBAAY,UACxCQ,CAAAA,CAAO,EAAE,CAAA,CAAA,CAAA,SACX,CAAA,CACF,CAAA,CAAA,CAVKN,CAAAA,CAAM,CAAA,CAAA,CAAA,CAAA,QAAS,CAAA,MAa1B,CAEJ,CACAO,CAAAA,CAAY,CAAA,CAAA,CAAA,CAAA,WAAc,CAAA,aAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport {\n ColorSwatch,\n ColorSwatchPicker,\n ColorSwatchPickerItem,\n composeRenderProps,\n} from 'react-aria-components';\nimport { ColorPickerStyles } from './styles';\nimport type { ColorPickerProps } from './types';\n\nconst { picker, item, swatch } = ColorPickerStyles();\n\n/**\n * A color picker component that renders a grid of color swatches for selection.\n *\n * This component provides a simple interface for users to select from a predefined\n * set of colors. It renders each color as an interactive swatch that can be clicked\n * to select that color. The component supports keyboard navigation, accessibility\n * features, and fine-grained styling control through the classNames prop.\n *\n * @param items - Array of color values to display as selectable swatches\n * @param classNames - Object containing CSS class names for fine-grained styling control\n * @param classNames.picker - CSS class name for the main picker container\n * @param classNames.item - CSS class name for individual swatch items\n * @param classNames.swatch - CSS class name for the color swatch elements\n *\n * @example\n * ```tsx\n * const colors = [\n * '#ff0000',\n * '#00ff00',\n * '#0000ff',\n * ];\n *\n * <ColorPicker\n * options={colors}\n * value={'#ff0000'}\n * onChange={(color) => console.log('Selected:', color)}\n * classNames={{\n * picker: 'gap-4',\n * item: 'rounded-lg',\n * swatch: 'w-8 h-8'\n * }}\n * />\n * ```\n *\n * @remarks\n * - Colors can be provided as Color objects or color strings\n * - The component automatically handles color parsing and validation\n * - Supports all accessibility features from react-aria-components\n * - Uses a grid layout by default but can be customized via the layout prop\n */\nexport function ColorPicker({ classNames, items, ...rest }: ColorPickerProps) {\n return (\n <ColorSwatchPicker\n {...rest}\n className={composeRenderProps(classNames?.picker, (className) =>\n picker({ className }),\n )}\n >\n {items.map((color) => (\n <ColorSwatchPickerItem\n key={color.toString('hexa')}\n className={composeRenderProps(classNames?.item, (className) =>\n item({ className }),\n )}\n color={color}\n >\n <ColorSwatch\n className={composeRenderProps(classNames?.swatch, (className) =>\n swatch({ className }),\n )}\n />\n </ColorSwatchPickerItem>\n ))}\n </ColorSwatchPicker>\n );\n}\nColorPicker.displayName = 'ColorPicker';\n"]}
@@ -0,0 +1,42 @@
1
+ import * as tailwind_variants from 'tailwind-variants';
2
+ import * as tailwind_merge from 'tailwind-merge';
3
+
4
+ declare const ColorPickerStyles: tailwind_variants.TVReturnType<{
5
+ [key: string]: {
6
+ [key: string]: tailwind_merge.ClassNameValue | {
7
+ picker?: tailwind_merge.ClassNameValue;
8
+ swatch?: tailwind_merge.ClassNameValue;
9
+ item?: tailwind_merge.ClassNameValue;
10
+ };
11
+ };
12
+ } | {
13
+ [x: string]: {
14
+ [x: string]: tailwind_merge.ClassNameValue | {
15
+ picker?: tailwind_merge.ClassNameValue;
16
+ swatch?: tailwind_merge.ClassNameValue;
17
+ item?: tailwind_merge.ClassNameValue;
18
+ };
19
+ };
20
+ } | {}, {
21
+ picker: string;
22
+ item: string[];
23
+ swatch: string;
24
+ }, undefined, {
25
+ [key: string]: {
26
+ [key: string]: tailwind_merge.ClassNameValue | {
27
+ picker?: tailwind_merge.ClassNameValue;
28
+ swatch?: tailwind_merge.ClassNameValue;
29
+ item?: tailwind_merge.ClassNameValue;
30
+ };
31
+ };
32
+ } | {}, {
33
+ picker: string;
34
+ item: string[];
35
+ swatch: string;
36
+ }, tailwind_variants.TVReturnType<unknown, {
37
+ picker: string;
38
+ item: string[];
39
+ swatch: string;
40
+ }, undefined, unknown, unknown, undefined>>;
41
+
42
+ export { ColorPickerStyles };
@@ -0,0 +1,2 @@
1
+ import {tv}from'./../../lib/utils.js';const i=tv({slots:{picker:"flex flex-wrap gap-s",item:["w-fit cursor-pointer outline outline-transparent","focus:outline-interactive-hover","hover:outline-interactive-hover","selected:outline-highlight"],swatch:"size-l"}});export{i as ColorPickerStyles};//# sourceMappingURL=styles.js.map
2
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/color-picker/styles.ts"],"names":["e"],"mappings":"6CAeS,CACLA,EAAA,CAAA,CAAA,6FAGE,CAAA,iCACA,CAAA,8DAGM,CAAA,CAAA,MAEZ,CAAC,QAAA,CAAA,CAAA","file":"styles.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { tv } from '@/lib/utils';\n\nexport const ColorPickerStyles = tv({\n slots: {\n picker: 'flex flex-wrap gap-s',\n item: [\n 'w-fit cursor-pointer outline outline-transparent',\n 'focus:outline-interactive-hover',\n 'hover:outline-interactive-hover',\n 'selected:outline-highlight',\n ],\n swatch: 'size-l',\n },\n});\n"]}
@@ -0,0 +1,13 @@
1
+ import { RefAttributes } from 'react';
2
+ import { ColorSwatchPickerProps, ColorSwatchPickerItemProps, ColorSwatchProps } from 'react-aria-components';
3
+
4
+ type ColorPickerProps = Omit<ColorSwatchPickerProps, 'children' | 'layout'> & RefAttributes<HTMLDivElement> & {
5
+ classNames?: {
6
+ picker?: ColorSwatchPickerProps['className'];
7
+ item?: ColorSwatchPickerItemProps['className'];
8
+ swatch?: ColorSwatchProps['className'];
9
+ };
10
+ items: ColorSwatchPickerItemProps['color'][];
11
+ };
12
+
13
+ export type { ColorPickerProps };
@@ -0,0 +1,2 @@
1
+ //# sourceMappingURL=types.js.map
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"types.js"}
@@ -1,16 +1,17 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as cva_types from 'cva/types';
3
- import { ComboBoxProps as ComboBoxProps$1, VirtualizerProps, ListLayoutOptions, ListBoxSectionProps } from 'react-aria-components';
4
- import { VariantProps } from 'cva';
2
+ import * as class_variance_authority_types from 'class-variance-authority/types';
3
+ import { VariantProps } from 'class-variance-authority';
5
4
  import { ReactNode } from 'react';
6
- import { IOptionsItem, OptionsItem } from '../options-item/index.js';
5
+ import { ComboBoxProps as ComboBoxProps$1, VirtualizerProps, ListLayoutOptions } from 'react-aria-components';
6
+ import { OptionsDataItem } from '../options/types.js';
7
+ import '../icon/types.js';
7
8
 
8
9
  declare const textFieldStyles: (props?: ({
9
10
  isDisabled?: boolean | null | undefined;
10
11
  isInvalid?: boolean | null | undefined;
11
12
  size?: "small" | "medium" | null | undefined;
12
- } & cva_types.ClassProp) | undefined) => string;
13
- interface ComboBoxProps<T extends IOptionsItem> extends Omit<VariantProps<typeof textFieldStyles>, 'isDisabled' | 'isInvalid' | 'isReadOnly'>, Omit<ComboBoxProps$1<T>, 'children'>, Pick<VirtualizerProps<ListLayoutOptions>, 'layoutOptions'> {
13
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
14
+ interface ComboBoxProps<T extends OptionsDataItem> extends Omit<VariantProps<typeof textFieldStyles>, 'isDisabled' | 'isInvalid' | 'isReadOnly'>, Omit<ComboBoxProps$1<T>, 'children'>, Pick<VirtualizerProps<ListLayoutOptions>, 'layoutOptions'> {
14
15
  className?: string;
15
16
  children: ReactNode | ((item: T) => ReactNode);
16
17
  description?: string;
@@ -18,15 +19,9 @@ interface ComboBoxProps<T extends IOptionsItem> extends Omit<VariantProps<typeof
18
19
  label?: string;
19
20
  placeholder?: string;
20
21
  }
21
- declare function ComboBox<T extends IOptionsItem>({ children, className, description, errorMessage, isDisabled, isInvalid, isReadOnly, label, placeholder, layoutOptions, size, ...props }: ComboBoxProps<T>): react_jsx_runtime.JSX.Element;
22
+ declare function ComboBox<T extends OptionsDataItem>({ children, className, description, errorMessage, isDisabled, isInvalid, isReadOnly, label, placeholder, layoutOptions, size, ...props }: ComboBoxProps<T>): react_jsx_runtime.JSX.Element;
22
23
  declare namespace ComboBox {
23
24
  var displayName: string;
24
- var Item: typeof OptionsItem;
25
- var Section: typeof ComboBoxSection;
26
25
  }
27
- interface ComboBoxSectionProps<T extends IOptionsItem> extends ListBoxSectionProps<T> {
28
- header?: string;
29
- }
30
- declare function ComboBoxSection<T extends IOptionsItem>({ children, header, items, }: ComboBoxSectionProps<T>): react_jsx_runtime.JSX.Element;
31
26
 
32
- export { ComboBox, type ComboBoxProps, ComboBoxSection };
27
+ export { ComboBox, type ComboBoxProps };
@@ -1,2 +1,2 @@
1
- import'client-only';import {ComboBox,Button,Text,Popover,Virtualizer,ListLayout,ListBoxSection,Header,Collection,Input}from'react-aria-components';import {cn}from'./../../lib/utils.js';import {ChevronDown}from'@accelint/icons';import {cva}from'cva';import {Icon}from'../icon/index.js';import {Label}from'../label/index.js';import {Options}from'../options/index.js';import {OptionsItem}from'../options-item/index.js';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var q=cva(["block w-full rounded-medium py-xs pr-[32px] pl-s font-display outline outline-interactive","not-disabled:read-only:rounded-none not-disabled:read-only:p-0 not-disabled:read-only:outline-transparent not-disabled:read-only:hover:outline-transparent not-disabled:read-only:focus:outline-transparent"],{variants:{isDisabled:{true:"text-disabled outline-interactive-disabled placeholder:text-disabled",false:"text-default-light placeholder:text-default-dark hover:outline-interactive-hover focus:outline-highlight"},isInvalid:{true:"outline-serious"},size:{medium:"text-body-s",small:"text-body-xs"}},compoundVariants:[{isDisabled:true,isInvalid:true,className:"outline-interactive-disabled"}],defaultVariants:{size:"medium"}}),f=({className:t,isReadOnly:o=false,size:i="medium",...l})=>jsx(Input,{...l,className:({isDisabled:s,isInvalid:a})=>cn(q({isDisabled:s,isInvalid:a,size:i,className:t}))});f.displayName="ComboBox.Input";function n({children:t,className:o,description:i,errorMessage:l,isDisabled:s,isInvalid:a,isReadOnly:r,label:u,placeholder:A,layoutOptions:h,size:c="medium",...x}){let b=c==="small",B=!(b||a)||s,I=a&&!s&&!r,P=!b&&u;return jsx(ComboBox,{...x,isDisabled:s,isInvalid:a,isReadOnly:r,className:"flex flex-col gap-xs",children:({isDisabled:d,isOpen:g})=>jsxs(Fragment,{children:[P&&jsx(Label,{className:"empty:hidden",isDisabled:d,isRequired:x.isRequired,children:u}),jsxs("div",{className:"relative flex items-center",children:[jsx(f,{className:o,isReadOnly:r,placeholder:A,size:c}),jsx(Button,{className:cn(["fg-default-light absolute right-xs transform",d&&"fg-disabled",g&&"rotate-180",r&&"hidden"]),children:jsx(Icon,{className:"block",size:"large",children:jsx(ChevronDown,{})})})]}),B&&jsx(Text,{className:cn(["fg-default-dark text-body-xs empty:hidden",d&&"fg-disabled"]),slot:"description",children:i}),I&&jsx(Text,{className:"fg-serious text-body-xs empty:hidden",slot:"errorMessage",children:l}),jsx(Popover,{className:"w-(--trigger-width)",children:jsx(Virtualizer,{layout:ListLayout,layoutOptions:h,children:jsx(Options,{children:t})})})]})})}n.displayName="ComboBox";n.Item=OptionsItem;function M({children:t,header:o,items:i}){return jsxs(ListBoxSection,{id:o,className:"col-span-2 mt-s grid grid-cols-[auto_1fr] border-default-dark border-t first:border-none",children:[jsx(Header,{className:"col-span-2 m-xs my-s text-default-dark text-header-xs",children:o}),jsx(Collection,{items:i,children:t})]})}n.displayName="ComboBox.Section";n.Section=M;export{n as ComboBox,M as ComboBoxSection};//# sourceMappingURL=index.js.map
1
+ import {jsx,jsxs,Fragment}from'react/jsx-runtime';import'client-only';import {cn}from'./../../lib/utils.js';import {ChevronDown}from'@accelint/icons';import {cva}from'class-variance-authority';import {ComboBox,Button,Text,Popover,Virtualizer,ListLayout,Input}from'react-aria-components';import {Icon}from'../icon/index.js';import {Label}from'../label/index.js';import {Options}from'../options/index.js';const S=cva(["block w-full rounded-medium py-xs pr-[32px] pl-s font-display outline outline-interactive","not-disabled:read-only:rounded-none not-disabled:read-only:p-0 not-disabled:read-only:outline-transparent not-disabled:read-only:hover:outline-transparent not-disabled:read-only:focus:outline-transparent"],{variants:{isDisabled:{true:"text-disabled outline-interactive-disabled placeholder:text-disabled",false:"text-default-light placeholder:text-default-dark hover:outline-interactive-hover focus:outline-highlight"},isInvalid:{true:"outline-serious"},size:{medium:"text-body-s",small:"text-body-xs"}},compoundVariants:[{isDisabled:true,isInvalid:true,className:"outline-interactive-disabled"}],defaultVariants:{size:"medium"}}),y=({className:a,isReadOnly:d=false,size:s="medium",...r})=>jsx(Input,{...r,className:({isDisabled:e,isInvalid:o})=>cn(S({isDisabled:e,isInvalid:o,size:s,className:a}))});y.displayName="ComboBox.Input";function D({children:a,className:d,description:s,errorMessage:r,isDisabled:e,isInvalid:o,isReadOnly:i,label:p,placeholder:b,layoutOptions:h,size:m="medium",...u}){const c=m==="small",A=!(c||o)||e,g=o&&!e&&!i,P=!c&&p;return jsx(ComboBox,{...u,isDisabled:e,isInvalid:o,isReadOnly:i,className:"flex flex-col gap-xs",children:({isDisabled:l,isOpen:v})=>jsxs(Fragment,{children:[P&&jsx(Label,{className:"empty:hidden",isDisabled:l,isRequired:u.isRequired,children:p}),jsxs("div",{className:"relative flex items-center",children:[jsx(y,{className:d,isReadOnly:i,placeholder:b,size:m}),jsx(Button,{className:cn(["fg-default-light absolute right-xs transform",l&&"fg-disabled",v&&"rotate-180",i&&"hidden"]),children:jsx(Icon,{size:"small",children:jsx(ChevronDown,{})})})]}),A&&jsx(Text,{className:cn(["fg-default-dark text-body-xs empty:hidden",l&&"fg-disabled"]),slot:"description",children:s}),g&&jsx(Text,{className:"fg-serious text-body-xs empty:hidden",slot:"errorMessage",children:r}),jsx(Popover,{className:"w-(--trigger-width)",children:jsx(Virtualizer,{layout:ListLayout,layoutOptions:h,children:jsx(Options,{children:a})})})]})})}D.displayName="ComboBox";export{D as ComboBox};//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/combobox/index.tsx"],"names":["w","className","isReadOnly","size","AriaInput","props","isDisabled","isInvalid","p","ComboBox","children","isSmall","shouldShowDescription","shouldShowError","shouldShowLabel","label","jsx","AriaComboBox","e","N","m","E","AriaButton","L","cn","Icon","ChevronDown","k","AriaText","description","y","errorMessage","AriaVirtualizer","AriaListLayout","T","Options","F","ComboBoxSection","jsxs","AriaListBoxSection","S","C","header","items","O"],"mappings":"kdA2CI,IAAA,CAAA,CAAAA,GAAA,CAAA,CAAA,2FACA,CAAA,6MA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ACE4B,EAACC,CAAAA,CAAA,OAECnB,IAAA,CAAAoB,cAAA,CAAA,CAAA,EAAA,CAAA,CAAU,CAAA,SAAA,CAAA,0FAEVxB,CAAAA,QAAY,CAAA,CAAAE,GAAA,CAAAuB,MAAA,CAAU,CAAA,SAAA,CAAA,uDACnBC,CACH,aAC8BC,GAAAA,CAAQC,UAAA,CAAA,CAAA,KAAA,CAAAlC,EAAS,QAI5C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,WAAc,CAAA,kBACJ2B,CAAAA,CAAAA,CAAAA,OAAAA,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\nimport 'client-only';\nimport {\n Button as AriaButton,\n ComboBox as AriaComboBox,\n type ComboBoxProps as AriaComboBoxProps,\n Header as AriaHeader,\n Input as AriaInput,\n type InputProps as AriaInputProps,\n Collection as AriaListBoxCollection,\n ListBoxSection as AriaListBoxSection,\n type ListBoxSectionProps as AriaListBoxSectionProps,\n ListLayout as AriaListLayout,\n type ListLayoutOptions as AriaListLayoutOptions,\n Popover as AriaPopover,\n Text as AriaText,\n Virtualizer as AriaVirtualizer,\n type VirtualizerProps as AriaVirtualizerProps,\n} from 'react-aria-components';\n\nimport { cn } from '@/lib/utils';\nimport { ChevronDown } from '@accelint/icons';\nimport { type VariantProps, cva } from 'cva';\nimport type { ReactNode } from 'react';\nimport { Icon } from '../icon';\nimport { Label } from '../label';\nimport { Options } from '../options';\nimport { type IOptionsItem, OptionsItem } from '../options-item';\n\nconst textFieldStyles = cva(\n [\n 'block w-full rounded-medium py-xs pr-[32px] pl-s font-display outline outline-interactive',\n 'not-disabled:read-only:rounded-none not-disabled:read-only:p-0 not-disabled:read-only:outline-transparent not-disabled:read-only:hover:outline-transparent not-disabled:read-only:focus:outline-transparent',\n ],\n {\n variants: {\n isDisabled: {\n true: 'text-disabled outline-interactive-disabled placeholder:text-disabled',\n false:\n 'text-default-light placeholder:text-default-dark hover:outline-interactive-hover focus:outline-highlight',\n },\n isInvalid: {\n true: 'outline-serious',\n },\n size: {\n medium: 'text-body-s',\n small: 'text-body-xs',\n },\n },\n compoundVariants: [\n {\n isDisabled: true,\n isInvalid: true,\n className: 'outline-interactive-disabled',\n },\n ],\n defaultVariants: {\n size: 'medium',\n },\n },\n);\n\ninterface InputProps\n extends VariantProps<typeof textFieldStyles>,\n Omit<AriaInputProps, 'size'> {\n isReadOnly?: boolean;\n}\n\nconst Input = ({\n className,\n isReadOnly = false,\n size = 'medium',\n ...props\n}: InputProps) => {\n return (\n <AriaInput\n {...props}\n className={({ isDisabled, isInvalid }) =>\n cn(\n textFieldStyles({\n isDisabled,\n isInvalid,\n size,\n className,\n }),\n )\n }\n />\n );\n};\nInput.displayName = 'ComboBox.Input';\n\nexport interface ComboBoxProps<T extends IOptionsItem>\n extends Omit<\n VariantProps<typeof textFieldStyles>,\n 'isDisabled' | 'isInvalid' | 'isReadOnly'\n >,\n Omit<AriaComboBoxProps<T>, 'children'>,\n Pick<AriaVirtualizerProps<AriaListLayoutOptions>, 'layoutOptions'> {\n className?: string;\n children: ReactNode | ((item: T) => ReactNode);\n description?: string;\n errorMessage?: string;\n label?: string;\n placeholder?: string;\n}\n\nexport function ComboBox<T extends IOptionsItem>({\n children,\n className,\n description,\n errorMessage,\n isDisabled,\n isInvalid,\n isReadOnly,\n label,\n placeholder,\n layoutOptions,\n size = 'medium',\n ...props\n}: ComboBoxProps<T>) {\n const isSmall = size === 'small';\n const shouldShowDescription = !(isSmall || isInvalid) || isDisabled;\n const shouldShowError = isInvalid && !isDisabled && !isReadOnly;\n const shouldShowLabel = !isSmall && label;\n\n return (\n <AriaComboBox<T>\n {...props}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n isReadOnly={isReadOnly}\n className='flex flex-col gap-xs'\n >\n {({ isDisabled, isOpen }) => (\n <>\n {shouldShowLabel && (\n <Label\n className='empty:hidden'\n isDisabled={isDisabled}\n isRequired={props.isRequired}\n >\n {label}\n </Label>\n )}\n <div className='relative flex items-center'>\n <Input\n className={className}\n isReadOnly={isReadOnly}\n placeholder={placeholder}\n size={size}\n />\n <AriaButton\n className={cn([\n 'fg-default-light absolute right-xs transform',\n isDisabled && 'fg-disabled',\n isOpen && 'rotate-180',\n isReadOnly && 'hidden',\n ])}\n >\n <Icon className='block' size='large'>\n <ChevronDown />\n </Icon>\n </AriaButton>\n </div>\n {shouldShowDescription && (\n <AriaText\n className={cn([\n 'fg-default-dark text-body-xs empty:hidden',\n isDisabled && 'fg-disabled',\n ])}\n slot='description'\n >\n {description}\n </AriaText>\n )}\n {shouldShowError && (\n <AriaText\n className='fg-serious text-body-xs empty:hidden'\n slot='errorMessage'\n >\n {errorMessage}\n </AriaText>\n )}\n <AriaPopover className='w-(--trigger-width)'>\n <AriaVirtualizer\n layout={AriaListLayout}\n layoutOptions={layoutOptions}\n >\n <Options>{children}</Options>\n </AriaVirtualizer>\n </AriaPopover>\n </>\n )}\n </AriaComboBox>\n );\n}\nComboBox.displayName = 'ComboBox';\n\nComboBox.Item = OptionsItem;\n\ninterface ComboBoxSectionProps<T extends IOptionsItem>\n extends AriaListBoxSectionProps<T> {\n header?: string;\n}\n\nexport function ComboBoxSection<T extends IOptionsItem>({\n children,\n header,\n items,\n}: ComboBoxSectionProps<T>) {\n return (\n <AriaListBoxSection\n id={header}\n className='col-span-2 mt-s grid grid-cols-[auto_1fr] border-default-dark border-t first:border-none'\n >\n <AriaHeader className='col-span-2 m-xs my-s text-default-dark text-header-xs'>\n {header}\n </AriaHeader>\n <AriaListBoxCollection items={items}>{children}</AriaListBoxCollection>\n </AriaListBoxSection>\n );\n}\nComboBox.displayName = 'ComboBox.Section';\nComboBox.Section = ComboBoxSection;\n"]}
1
+ {"version":3,"sources":["../../../src/components/combobox/index.tsx"],"names":["N","isReadOnly","size","jsx","t","L","isInvalid","cn","n","Input","ComboBox","errorMessage","isDisabled","layoutOptions","shouldShowDescription","isSmall","shouldShowError","label","AriaComboBox","props","B","shouldShowLabel","jsxs","f","placeholder","AriaButton","O","Icon","ChevronDown","I","x","AriaText","V","Options","C","children","R"],"mappings":"mZAsCI,MAAA,CAAA,CAAAA,GAAA,CAAA,CAAA,6YAQM,CAAA,KAAA,CAAA,0GAKJ,CAAA,CAAM,SACI,CAAA,CAAA,IAAA,CAAA,iBACD,CAAA,CAAA,IAAA,CAAA,CAAA,MAGX,CAAA,aAAA,CAAkB,KAEd,CAAA,cACA,CAAA,CAAA,CAAA,gBACW,CAAA,CAAA,CAAA,UAAA,CAAA,IAAA,CAAA,SAAA,CAAA,IAAA,CACb,SAEF,CAAA,8BAYW,CACb,CAAA,CAAA,eACA,CAAA,CAAA,IAAAC,CAAAA,QACA,CAAAC,CAAAA,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,SAET,CAAA,CAAA,CAEIC,UAEE,CAAA,CAAA,CAAA,KAAA,CAAA,IAAW,CAAC,CAAE,CAAA,QAAA,CAAA,GAAY,CAAA,CAAA,GAAAC,GAAA,CAAAC,KAAA,CAAA,CAAAC,GAAU,CAAA,CAClCC,SAEI,CAAA,CAAA,CAAA,UACA,CAAA,CAAA,CAAA,SACA,CAAAL,CAAAA,CACA,GAAAM,EAAA,CAAA,CAAA,CAAA,CAAA,UAOZC,CAAM,CAAA,CAAA,SAAA,CAAc,kBAiBb,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAASC,CAAAA,CAAoC,YAElD,gBACA,CAAA,SACA,aAAAC,CAAAA,SACA,CAAA,CAAA,CAAAC,WACA,CA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A0B,IAAA,CAAA,CAAA,SAAA,CAAAtB,EAAA,CAAA,CAAA,2CAKD,CAAA,CAAA,EAAA,aAIFuB,CAAAA,CAAA,CACC,kBAAU,CAAA,QAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA3B,GAAA,CAAA0B,IAAA,CAAA,CAAA,SACV,CAAA,sCAKS,CAAA,IAAA,CAAA,yBACX,CAAA,CAAA,CAAA1B,GAAA,CAAA4B,OAAA,CAAA,CAAA,+BAIE,CAAA,QAAA7B,IAAC8B,CAAAA,WAAA,CAAS,CAAA,MAAA,CAAAC,UAAAC,CAAAA,cAQf,CAAA,CAAA,QAAA,CAAA/B,GAAc,CAAAgC,OAAA,CAAA,CAAA,QAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,WAAA,CAAA,UAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport { cn } from '@/lib/utils';\nimport { ChevronDown } from '@accelint/icons';\nimport { type VariantProps, cva } from 'class-variance-authority';\nimport type { ReactNode } from 'react';\nimport {\n Button as AriaButton,\n ComboBox as AriaComboBox,\n type ComboBoxProps as AriaComboBoxProps,\n Input as AriaInput,\n type InputProps as AriaInputProps,\n ListLayout as AriaListLayout,\n type ListLayoutOptions as AriaListLayoutOptions,\n Popover as AriaPopover,\n Text as AriaText,\n Virtualizer as AriaVirtualizer,\n type VirtualizerProps as AriaVirtualizerProps,\n} from 'react-aria-components';\nimport { Icon } from '../icon';\nimport { Label } from '../label';\nimport { Options } from '../options';\nimport type { OptionsDataItem } from '../options/types';\n\nconst textFieldStyles = cva(\n [\n 'block w-full rounded-medium py-xs pr-[32px] pl-s font-display outline outline-interactive',\n 'not-disabled:read-only:rounded-none not-disabled:read-only:p-0 not-disabled:read-only:outline-transparent not-disabled:read-only:hover:outline-transparent not-disabled:read-only:focus:outline-transparent',\n ],\n {\n variants: {\n isDisabled: {\n true: 'text-disabled outline-interactive-disabled placeholder:text-disabled',\n false:\n 'text-default-light placeholder:text-default-dark hover:outline-interactive-hover focus:outline-highlight',\n },\n isInvalid: {\n true: 'outline-serious',\n },\n size: {\n medium: 'text-body-s',\n small: 'text-body-xs',\n },\n },\n compoundVariants: [\n {\n isDisabled: true,\n isInvalid: true,\n className: 'outline-interactive-disabled',\n },\n ],\n defaultVariants: {\n size: 'medium',\n },\n },\n);\n\ninterface InputProps\n extends VariantProps<typeof textFieldStyles>,\n Omit<AriaInputProps, 'size'> {\n isReadOnly?: boolean;\n}\n\nconst Input = ({\n className,\n isReadOnly = false,\n size = 'medium',\n ...props\n}: InputProps) => {\n return (\n <AriaInput\n {...props}\n className={({ isDisabled, isInvalid }) =>\n cn(\n textFieldStyles({\n isDisabled,\n isInvalid,\n size,\n className,\n }),\n )\n }\n />\n );\n};\nInput.displayName = 'ComboBox.Input';\n\nexport interface ComboBoxProps<T extends OptionsDataItem>\n extends Omit<\n VariantProps<typeof textFieldStyles>,\n 'isDisabled' | 'isInvalid' | 'isReadOnly'\n >,\n Omit<AriaComboBoxProps<T>, 'children'>,\n Pick<AriaVirtualizerProps<AriaListLayoutOptions>, 'layoutOptions'> {\n className?: string;\n children: ReactNode | ((item: T) => ReactNode);\n description?: string;\n errorMessage?: string;\n label?: string;\n placeholder?: string;\n}\n\nexport function ComboBox<T extends OptionsDataItem>({\n children,\n className,\n description,\n errorMessage,\n isDisabled,\n isInvalid,\n isReadOnly,\n label,\n placeholder,\n layoutOptions,\n size = 'medium',\n ...props\n}: ComboBoxProps<T>) {\n const isSmall = size === 'small';\n const shouldShowDescription = !(isSmall || isInvalid) || isDisabled;\n const shouldShowError = isInvalid && !isDisabled && !isReadOnly;\n const shouldShowLabel = !isSmall && label;\n\n return (\n <AriaComboBox<T>\n {...props}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n isReadOnly={isReadOnly}\n className='flex flex-col gap-xs'\n >\n {({ isDisabled, isOpen }) => (\n <>\n {shouldShowLabel && (\n <Label\n className='empty:hidden'\n isDisabled={isDisabled}\n isRequired={props.isRequired}\n >\n {label}\n </Label>\n )}\n <div className='relative flex items-center'>\n <Input\n className={className}\n isReadOnly={isReadOnly}\n placeholder={placeholder}\n size={size}\n />\n <AriaButton\n className={cn([\n 'fg-default-light absolute right-xs transform',\n isDisabled && 'fg-disabled',\n isOpen && 'rotate-180',\n isReadOnly && 'hidden',\n ])}\n >\n <Icon size='small'>\n <ChevronDown />\n </Icon>\n </AriaButton>\n </div>\n {shouldShowDescription && (\n <AriaText\n className={cn([\n 'fg-default-dark text-body-xs empty:hidden',\n isDisabled && 'fg-disabled',\n ])}\n slot='description'\n >\n {description}\n </AriaText>\n )}\n {shouldShowError && (\n <AriaText\n className='fg-serious text-body-xs empty:hidden'\n slot='errorMessage'\n >\n {errorMessage}\n </AriaText>\n )}\n <AriaPopover className='w-(--trigger-width)'>\n <AriaVirtualizer\n layout={AriaListLayout}\n layoutOptions={layoutOptions}\n >\n <Options>{children}</Options>\n </AriaVirtualizer>\n </AriaPopover>\n </>\n )}\n </AriaComboBox>\n );\n}\nComboBox.displayName = 'ComboBox';\n"]}
@@ -1,28 +1,12 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as cva_types from 'cva/types';
3
2
  import { DateValue } from '@internationalized/date';
4
- import { VariantProps } from 'cva';
5
- import { DateFieldProps as DateFieldProps$1, DateInputProps } from 'react-aria-components';
3
+ import { DateFieldProps } from './types.js';
4
+ import 'react';
5
+ import 'react-aria-components';
6
+ import 'tailwind-variants';
7
+ import './styles.js';
8
+ import 'tailwind-merge';
6
9
 
7
- declare const dateFieldStyles: (props?: ({
8
- isDisabled?: boolean | null | undefined;
9
- isInvalid?: boolean | null | undefined;
10
- isReadOnly?: boolean | null | undefined;
11
- size?: "small" | "medium" | null | undefined;
12
- } & cva_types.ClassProp) | undefined) => string;
13
- interface DateFieldProps<T extends DateValue> extends Omit<VariantProps<typeof dateFieldStyles>, 'isDisabled' | 'isInvalid' | 'isReadOnly'>, Omit<DateFieldProps$1<T>, 'className' | 'style'>, // Exclude className to avoid conflict with cva
14
- Omit<DateInputProps, 'className' | 'children' | 'style'> {
15
- isDisabled?: boolean;
16
- isInvalid?: boolean;
17
- isReadOnly?: boolean;
18
- size?: 'small' | 'medium';
19
- className?: string;
20
- description?: string;
21
- errorMessage?: string;
22
- label?: string;
23
- placeholder?: string;
24
- shortMonth?: boolean;
25
- }
26
- declare function DateField<T extends DateValue>({ className, description, errorMessage, isDisabled, isInvalid, isReadOnly, label, placeholder, slot, size, shortMonth, ...props }: DateFieldProps<T>): react_jsx_runtime.JSX.Element;
10
+ declare function DateField<T extends DateValue>({ classNames, description: descriptionProp, errorMessage: errorMessageProp, isDisabled, isInvalid: isInvalidProp, isReadOnly, label, placeholder, slot, size, shortMonth, isRequired, ...props }: DateFieldProps<T>): react_jsx_runtime.JSX.Element;
27
11
 
28
- export { DateField, type DateFieldProps };
12
+ export { DateField };
@@ -1,2 +1,2 @@
1
- import {cn}from'./../../lib/utils.js';import y from'@accelint/icons/calendar';import'client-only';import {cva}from'cva';import {DateField,Text,FieldError,DateInput,DateSegment}from'react-aria-components';import {Icon}from'../icon/index.js';import {Label}from'../label/index.js';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var I=["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"],R=({value:e,isFocused:o,isPlaceholder:i,placeholder:t,isReadOnly:s,shortMonth:l})=>{if(i)return t;let r=`${e}`;return !s&&o?r=r.padStart(2,"0"):l&&(r=I[(e??0)-1]),r},T=({segment:e,shortMonth:o,...i})=>e.type==="literal"&&e.text!==":"?jsx(Fragment,{}):jsx(DateSegment,{segment:e,className:"focus:bg-highlight focus:text-inverse-light focus:outline-none",...i,children:e.type==="month"?t=>jsx(R,{...t,shortMonth:o}):e.text}),O=cva(["flex w-full gap-xs rounded-medium px-s py-xs font-display outline outline-interactive"],{variants:{isDisabled:{true:"text-disabled outline-interactive-disabled placeholder:text-disabled",false:"text-default-light placeholder:text-default-dark focus-within:outline-highlight hover:outline-interactive-hover"},isInvalid:{true:"outline-serious"},isReadOnly:{true:"rounded-none p-0 outline-none"},size:{medium:["text-body-s","pl-[32px]"],small:"text-body-xs"}},compoundVariants:[{isDisabled:true,isInvalid:true,className:"outline-interactive-disabled"},{isDisabled:false,size:"medium"}],defaultVariants:{size:"medium"}}),V=({className:e,ref:o=null,size:i="medium",isReadOnly:t,...s})=>jsxs("div",{className:"relative flex",children:[i==="medium"?jsx(Icon,{className:cn(["-translate-y-1/2 absolute top-1/2 left-s",s.isDisabled?"text-disabled":"text-default-light"]),children:jsx(y,{})}):null,jsx(DateInput,{...s,className:({isDisabled:l,isInvalid:r})=>cn(O({isDisabled:l,isInvalid:r,isReadOnly:t,size:i,className:e}))})]});function q({className:e,description:o,errorMessage:i,isDisabled:t,isInvalid:s,isReadOnly:l,label:r,placeholder:E,slot:c,size:d="medium",shortMonth:f=true,...m}){let p=d==="small",D=o&&(!(p||s)||t),h=i&&s&&!t&&!l;return jsxs(DateField,{...m,isDisabled:t,isInvalid:s,isReadOnly:l,slot:c,className:"flex flex-col gap-xs",children:[!p&&jsx(Label,{className:"empty:hidden",isDisabled:t,isRequired:m.isRequired,children:r}),jsx(V,{className:e,isDisabled:t,size:d,isReadOnly:l,isInvalid:s,children:x=>jsx(T,{segment:x,shortMonth:f})}),D&&jsx(Text,{className:cn(["fg-default-dark text-body-xs empty:hidden",t&&"fg-disabled"]),slot:"description",children:o}),h&&jsx(FieldError,{className:"fg-serious text-body-xs empty:hidden",children:i})]})}export{q as DateField};//# sourceMappingURL=index.js.map
1
+ import {jsx,jsxs,Fragment}from'react/jsx-runtime';import'client-only';import A from'@accelint/icons/calendar';import {DateField,composeRenderProps,Text,FieldError,DateInput,DateSegment}from'react-aria-components';import {Icon}from'../icon/index.js';import {Label}from'../label/index.js';import {DateFieldStyles}from'./styles.js';const{field:v,dateInput:E,dateInputContainer:C,icon:L,descriptionText:V,error:J,dateSegment:O}=DateFieldStyles(),U=["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"],k=({value:e,isFocused:r,isPlaceholder:a,placeholder:n,isReadOnly:i,shortMonth:l})=>{if(a)return n;let o=`${e}`;return !i&&r?o=o.padStart(2,"0"):l&&(o=U[(e??0)-1]),o},q=({segment:e,shortMonth:r,...a})=>e.type==="literal"&&e.text!==":"?jsx(Fragment,{}):jsx(DateSegment,{segment:e,className:O({}),...a,children:e.type==="month"?n=>jsx(k,{...n,shortMonth:r}):e.text}),z=({className:e,ref:r=null,size:a,...n})=>jsxs("div",{className:C({}),children:[a==="medium"?jsx(Icon,{className:L({}),children:jsx(A,{})}):null,jsx(DateInput,{...n,className:composeRenderProps(e,i=>E({className:i})),"data-size":a})]});function Q({classNames:e,description:r,errorMessage:a,isDisabled:n,isInvalid:i,isReadOnly:l,label:o,placeholder:B,slot:S,size:p="medium",shortMonth:g=true,isRequired:F,...h}){const D=a||null,u=p==="small";return jsx(DateField,{...h,isDisabled:n,isInvalid:i||(D?true:void 0),isReadOnly:l,slot:S,className:composeRenderProps(e?.field,s=>v({className:s})),children:({isDisabled:s,isInvalid:y})=>jsxs(Fragment,{children:[!u&&o&&jsx(Label,{className:e?.label,isDisabled:s,isRequired:F,children:o}),jsx(z,{className:e?.input,size:p,isInvalid:y,children:m=>jsx(q,{segment:m,shortMonth:g})}),r&&(!(u||i)||s)&&jsx(Text,{className:V({}),slot:"description",children:r}),jsx(FieldError,{className:composeRenderProps(e?.error,m=>J({className:m})),children:D})]})})}export{Q as DateField};//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/date-field/index.tsx"],"names":["value","isPlaceholder","placeholder","isReadOnly","displayValue","months","FormattedDateSegment","segment","Fragment","jsx","DateSegment","a","F","renderProps","dateFieldStyles","cva","g","jsxs","u","v","n","AriaDateInput","props","P","DateField","label","slot","size","isSmall","shouldShowDescription","isInvalid","isDisabled","shouldShowError","errorMessage","AriaDateField","b","Label","AriaText","S","description","FieldError"],"mappings":"4UAoCE,CAAA,CAAA,CAAA,KACA,CAAA,KACA,CAAA,KACA,CAAA,KACA,CAAA,KACA,CAAA,WAEA,CAAA,KACA,CAAA,WAEA,CAAA,MAGuB,KACvB,CAAA,CAAA,CAAAA,CAAAA,CACA,CAAA,KAAA,CAAA,CAAA,CAAA,yBAEA,CAAA,CAAA,CAAA,WACA,CAAA,CAAA,CAAA,uBAGA,CAAIC,CAAAA,CACF,GAAA,CAAA,GAAOC,EAGT,SAA0CF,IAE1C,MAAI,CAACG,CAAAA,CAAAA,OACYC,CAAa,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,WAErCA,GAAeC,CAAAA,CAAQL,IAAS,CAAA,CAAK,CAAC,CAAA,CAAA,CAGjCI,EACT,CAOME,EAAuB,CAAC,CAC5B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAAC,QACA,CAAA,CAAA,CAAA,UAEF,CAAA,CACMA,IAAQ,CAAA,CAAA,GAAS,CAAA,CAAA,IAAA,GAAA,SAAqB,EAAS,CAAA,CAAA,IAC1CC,GAAA,GAIPC,CAAAA,GAACC,CAAAA,QAAA,CACC,EAAA,CAAA,CAAAC,GAAA,CAAAC,WAAA,CAASL,CAAAA,OACT,CAAA,CAAA,CAAA,gFAGCA,QAAQ,CAAS,SACbM,OACoB,CAAA,CAAA,EAAGA,GAAa,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.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\nimport { cn } from '@/lib/utils';\nimport Calendar from '@accelint/icons/calendar';\nimport type { DateValue } from '@internationalized/date';\nimport type { DateSegment as TDateSegment } from '@react-stately/datepicker';\nimport 'client-only';\nimport { type VariantProps, cva } from 'cva';\nimport type { ForwardedRef } from 'react';\nimport {\n DateField as AriaDateField,\n type DateFieldProps as AriaDateFieldProps,\n DateInput as AriaDateInput,\n type DateInputProps as AriaDateInputProps,\n type DateSegmentProps as AriaDateSegmentProps,\n Text as AriaText,\n DateSegment,\n type DateSegmentRenderProps,\n FieldError,\n} from 'react-aria-components';\nimport { Icon } from '../icon';\nimport { Label } from '../label';\n\nconst months = [\n 'JAN',\n 'FEB',\n 'MAR',\n 'APR',\n 'MAY',\n 'JUN',\n 'JUL',\n 'AUG',\n 'SEP',\n 'OCT',\n 'NOV',\n 'DEC',\n];\n\nconst MonthDateSegment = ({\n value,\n isFocused,\n isPlaceholder,\n placeholder,\n isReadOnly,\n shortMonth,\n}: DateSegmentRenderProps & { shortMonth?: boolean }) => {\n if (isPlaceholder) {\n return placeholder;\n }\n\n let displayValue: string | undefined = `${value}`;\n\n if (!isReadOnly && isFocused) {\n displayValue = displayValue.padStart(2, '0');\n } else if (shortMonth) {\n displayValue = months[(value ?? 0) - 1];\n }\n\n return displayValue;\n};\n\ninterface FormattedDateSegmentProps extends AriaDateSegmentProps {\n segment: TDateSegment;\n shortMonth?: boolean;\n}\n\nconst FormattedDateSegment = ({\n segment,\n shortMonth,\n ...props\n}: FormattedDateSegmentProps) => {\n if (segment.type === 'literal' && segment.text !== ':') {\n return <></>;\n }\n\n return (\n <DateSegment\n segment={segment}\n className='focus:bg-highlight focus:text-inverse-light focus:outline-none' // Ensure caret color is visible, RAC sets the style prop and it is not overridable. Thanks for that.\n {...props}\n >\n {segment.type === 'month'\n ? (renderProps) => (\n <MonthDateSegment {...renderProps} shortMonth={shortMonth} />\n )\n : segment.text}\n </DateSegment>\n );\n};\n\nconst dateFieldStyles = cva(\n [\n 'flex w-full gap-xs rounded-medium px-s py-xs font-display outline outline-interactive',\n ],\n {\n variants: {\n isDisabled: {\n true: 'text-disabled outline-interactive-disabled placeholder:text-disabled',\n false:\n 'text-default-light placeholder:text-default-dark focus-within:outline-highlight hover:outline-interactive-hover',\n },\n isInvalid: {\n true: 'outline-serious',\n },\n isReadOnly: {\n true: 'rounded-none p-0 outline-none',\n },\n size: {\n medium: ['text-body-s', 'pl-[32px]'],\n small: 'text-body-xs',\n },\n },\n compoundVariants: [\n {\n isDisabled: true,\n isInvalid: true,\n className: 'outline-interactive-disabled',\n },\n {\n isDisabled: false,\n size: 'medium',\n },\n ],\n defaultVariants: {\n size: 'medium',\n },\n },\n);\n\ninterface DateInputProps\n extends VariantProps<typeof dateFieldStyles>,\n Omit<AriaDateInputProps, 'size'> {\n ref?: ForwardedRef<HTMLDivElement>;\n}\n\nconst DateInput = ({\n className,\n ref = null,\n size = 'medium',\n isReadOnly,\n ...props\n}: DateInputProps) => {\n return (\n <div className='relative flex'>\n {size === 'medium' ? (\n <Icon\n className={cn([\n '-translate-y-1/2 absolute top-1/2 left-s',\n props.isDisabled ? 'text-disabled' : 'text-default-light',\n ])}\n >\n <Calendar />\n </Icon>\n ) : null}\n <AriaDateInput\n {...props}\n className={({ isDisabled, isInvalid }) =>\n cn(\n dateFieldStyles({\n isDisabled,\n isInvalid,\n isReadOnly: isReadOnly,\n size,\n className,\n }),\n )\n }\n />\n </div>\n );\n};\n\nexport interface DateFieldProps<T extends DateValue>\n extends Omit<\n VariantProps<typeof dateFieldStyles>,\n 'isDisabled' | 'isInvalid' | 'isReadOnly'\n >,\n Omit<AriaDateFieldProps<T>, 'className' | 'style'>, // Exclude className to avoid conflict with cva\n Omit<AriaDateInputProps, 'className' | 'children' | 'style'> {\n isDisabled?: boolean;\n isInvalid?: boolean;\n isReadOnly?: boolean;\n size?: 'small' | 'medium';\n className?: string;\n description?: string;\n errorMessage?: string;\n label?: string;\n placeholder?: string;\n shortMonth?: boolean;\n}\n\nexport function DateField<T extends DateValue>({\n className,\n description,\n errorMessage,\n isDisabled,\n isInvalid,\n isReadOnly,\n label,\n placeholder,\n slot,\n size = 'medium',\n shortMonth = true,\n ...props\n}: DateFieldProps<T>) {\n const isSmall = size === 'small';\n const shouldShowDescription =\n description && (!(isSmall || isInvalid) || isDisabled);\n const shouldShowError =\n errorMessage && isInvalid && !isDisabled && !isReadOnly;\n\n return (\n <AriaDateField<T>\n {...props}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n isReadOnly={isReadOnly}\n slot={slot}\n className={'flex flex-col gap-xs'}\n >\n {!isSmall && (\n <Label\n className='empty:hidden'\n isDisabled={isDisabled}\n isRequired={props.isRequired}\n >\n {label}\n </Label>\n )}\n\n <DateInput\n className={className}\n isDisabled={isDisabled}\n size={size}\n isReadOnly={isReadOnly}\n isInvalid={isInvalid}\n >\n {(segment) => (\n <FormattedDateSegment segment={segment} shortMonth={shortMonth} />\n )}\n </DateInput>\n {shouldShowDescription && (\n <AriaText\n className={cn([\n 'fg-default-dark text-body-xs empty:hidden',\n isDisabled && 'fg-disabled',\n ])}\n slot='description'\n >\n {description}\n </AriaText>\n )}\n {shouldShowError && (\n <FieldError className='fg-serious text-body-xs empty:hidden'>\n {errorMessage}\n </FieldError>\n )}\n </AriaDateField>\n );\n}\n"]}
1
+ {"version":3,"sources":["../../../src/components/date-field/index.tsx"],"names":["dateInput","descriptionText","error","DateFieldStyles","R","value","isFocused","shortMonth","displayValue","isReadOnly","months","FormattedDateSegment","segment","jsx","DateSegment","t","c","dateSegment","DateInput","className","ref","props","jsxs","dateInputContainer","f","icon","d","classNames","isInvalidProp","isSmall","size","AriaDateField","field","isDisabled","isInvalid","label","Label","b","isRequired","AriaText","T","descriptionProp","errorMessage"],"mappings":"yUAkCEA,KACA,CAAA,KAAA,CAAA,CAAA,CAAA,SACA,CAAA,CAAA,CAAA,oBACAC,CAAAA,IACA,CAAA,CAAA,CAAAC,eAEF,EAAIC,CAAAA,KAEW,CACb,CAAA,CAAA,WAEA,CAAA,CAAA,CAAA,CAAAC,eACA,EAAA,CAAA,CAAA,CAAA,CACA,MACA,KAAA,CACA,KAAA,CACA,MACA,KAAA,CACA,KAAA,CACA,MACA,KACF,CAAA,KAGE,MAAAC,CAAAA,KACA,CAAA,KAAAC,EACA,CAAA,CAAA,CAAA,CAAA,KAAA,CAAA,CAAA,CAAA,yBAEA,CAAA,CAAA,CAAA,WACA,CAAA,CAAA,CAAAC,WAGE,CAAA,CAAA,UAGF,CAAIC,CAAAA,CAAmC,GAAGH,CAAK,GAE/C,SAAKI,CAAcH,KACFE,CAAa,eAAe,EAClCD,EAAAA,CAAAA,CACTC,CAAAA,CAAeE,UAAuB,CAAA,CAAA,CAGjCF,GAQHG,CAAAA,CAAuB,CAAC,GAC5B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAAC,EACA,WAAAL,CAAAA,CACA,CAAA,OAEIK,CAAAA,CAAQ,WAAS,CAAA,CAAA,CAAA,GAAA,CAAaA,CAAAA,SAAiB,GAC1CC,WAINC,CAAA,CAAY,UAAkB,CAAAC,GAAA,CAAAC,QAAA,CAAA,EAAA,CAAA,CAAAD,GAAWE,YAAY,CAAC,CAAC,OACrD,YAAQ,CAAA,CAAA,CAAA,EAAA,CAAS,eAEX,CAAkB,CAAA,IAAgB,GAAA,OAAA,CAAYV,CAAAA,KAEjDK,CAAAA,CAAQ,CAAA,CAAA,GACd,EAIEM,UACJ,CAAA,CAAA,CAAA,CAAAC,CAAAA,CACA,KAAAC,CAAM,CAAA,CAAA,CAAA,CAAA,CACN,UACGC,CACL,CA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wC,CAAA,CAAA,EAAAE,GAAA,CAAYR,EAAY,CAAA,OAG/C,CAAA,CAAEsB,CAAAA,UACrBhB,CAAAA,CAAC0B,EAAA,CAAS,CAAA,CAAA,CAAA,GAAA,EAAA,CAAA,GAA2B,CAAC,GAAI,CAAA,EAAAxB,GAAA,CAAKyB,IAAA,CAAA,CAAA,SAAA,CAAA,CAC5C,SAAAC,CAAAA,sBAI2Bd,CAAY,QAAQR,UAAAA,CAAAA,CAChDjB,SAAQ,CAAAwB,kBAAA,CAAA,CAAAP,EAAW,YAGpBuB,SAMb,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,QAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\nimport 'client-only';\nimport Calendar from '@accelint/icons/calendar';\nimport type { DateValue } from '@internationalized/date';\nimport type { DateSegment as TDateSegment } from '@react-stately/datepicker';\nimport {\n DateField as AriaDateField,\n DateInput as AriaDateInput,\n type DateSegmentProps as AriaDateSegmentProps,\n Text as AriaText,\n DateSegment,\n type DateSegmentRenderProps,\n FieldError,\n composeRenderProps,\n} from 'react-aria-components';\nimport { Icon } from '../icon';\nimport { Label } from '../label';\nimport { DateFieldStyles } from './styles';\nimport type { DateFieldProps, DateInputProps } from './types';\n\nconst {\n field,\n dateInput,\n dateInputContainer,\n icon,\n descriptionText,\n error,\n dateSegment,\n} = DateFieldStyles();\n\nconst months = [\n 'JAN',\n 'FEB',\n 'MAR',\n 'APR',\n 'MAY',\n 'JUN',\n 'JUL',\n 'AUG',\n 'SEP',\n 'OCT',\n 'NOV',\n 'DEC',\n];\n\nconst MonthDateSegment = ({\n value,\n isFocused,\n isPlaceholder,\n placeholder,\n isReadOnly,\n shortMonth,\n}: DateSegmentRenderProps & { shortMonth?: boolean }) => {\n if (isPlaceholder) {\n return placeholder;\n }\n\n let displayValue: string | undefined = `${value}`;\n\n if (!isReadOnly && isFocused) {\n displayValue = displayValue.padStart(2, '0');\n } else if (shortMonth) {\n displayValue = months[(value ?? 0) - 1];\n }\n\n return displayValue;\n};\n\ninterface FormattedDateSegmentProps extends AriaDateSegmentProps {\n segment: TDateSegment;\n shortMonth?: boolean;\n}\n\nconst FormattedDateSegment = ({\n segment,\n shortMonth,\n ...props\n}: FormattedDateSegmentProps) => {\n if (segment.type === 'literal' && segment.text !== ':') {\n return <></>;\n }\n\n return (\n <DateSegment segment={segment} className={dateSegment({})} {...props}>\n {segment.type === 'month'\n ? (renderProps) => (\n <MonthDateSegment {...renderProps} shortMonth={shortMonth} />\n )\n : segment.text}\n </DateSegment>\n );\n};\n\nconst DateInput = ({\n className,\n ref = null,\n size,\n ...props\n}: DateInputProps) => {\n return (\n <div className={dateInputContainer({})}>\n {size === 'medium' ? (\n <Icon className={icon({})}>\n <Calendar />\n </Icon>\n ) : null}\n <AriaDateInput\n {...props}\n className={composeRenderProps(className, (className) =>\n dateInput({\n className,\n }),\n )}\n data-size={size}\n />\n </div>\n );\n};\n\nexport function DateField<T extends DateValue>({\n classNames,\n description: descriptionProp,\n errorMessage: errorMessageProp,\n isDisabled,\n isInvalid: isInvalidProp,\n isReadOnly,\n label,\n placeholder,\n slot,\n size = 'medium',\n shortMonth = true,\n isRequired,\n ...props\n}: DateFieldProps<T>) {\n const errorMessage = errorMessageProp || null; // Protect against empty string\n const isSmall = size === 'small';\n\n return (\n <AriaDateField<T>\n {...props}\n isDisabled={isDisabled}\n isInvalid={isInvalidProp || (errorMessage ? true : undefined)} // Leave uncontrolled if possible to fallback to validation state\n isReadOnly={isReadOnly}\n slot={slot}\n className={composeRenderProps(classNames?.field, (className) =>\n field({ className }),\n )}\n >\n {(\n { isDisabled, isInvalid }, // Rely on internal state, not props, since state could differ from props\n ) => (\n <>\n {!isSmall && label && (\n <Label\n className={classNames?.label}\n isDisabled={isDisabled}\n isRequired={isRequired}\n >\n {label}\n </Label>\n )}\n <DateInput\n className={classNames?.input}\n size={size}\n isInvalid={isInvalid}\n >\n {(segment) => (\n <FormattedDateSegment segment={segment} shortMonth={shortMonth} />\n )}\n </DateInput>\n {descriptionProp && (!(isSmall || isInvalidProp) || isDisabled) && (\n <AriaText className={descriptionText({})} slot='description'>\n {descriptionProp}\n </AriaText>\n )}\n <FieldError\n className={composeRenderProps(classNames?.error, (className) =>\n error({ className }),\n )}\n >\n {errorMessage}\n </FieldError>\n </>\n )}\n </AriaDateField>\n );\n}\n"]}
@@ -0,0 +1,69 @@
1
+ import * as tailwind_variants from 'tailwind-variants';
2
+ import * as tailwind_merge from 'tailwind-merge';
3
+
4
+ declare const DateFieldStylesDefault: {
5
+ readonly size: "medium";
6
+ };
7
+ declare const DateFieldStyles: tailwind_variants.TVReturnType<{
8
+ [key: string]: {
9
+ [key: string]: tailwind_merge.ClassNameValue | {
10
+ icon?: tailwind_merge.ClassNameValue;
11
+ error?: tailwind_merge.ClassNameValue;
12
+ field?: tailwind_merge.ClassNameValue;
13
+ dateInputContainer?: tailwind_merge.ClassNameValue;
14
+ dateSegment?: tailwind_merge.ClassNameValue;
15
+ dateInput?: tailwind_merge.ClassNameValue;
16
+ descriptionText?: tailwind_merge.ClassNameValue;
17
+ };
18
+ };
19
+ } | {
20
+ [x: string]: {
21
+ [x: string]: tailwind_merge.ClassNameValue | {
22
+ icon?: tailwind_merge.ClassNameValue;
23
+ error?: tailwind_merge.ClassNameValue;
24
+ field?: tailwind_merge.ClassNameValue;
25
+ dateInputContainer?: tailwind_merge.ClassNameValue;
26
+ dateSegment?: tailwind_merge.ClassNameValue;
27
+ dateInput?: tailwind_merge.ClassNameValue;
28
+ descriptionText?: tailwind_merge.ClassNameValue;
29
+ };
30
+ };
31
+ } | {}, {
32
+ field: string;
33
+ dateInput: string[];
34
+ dateInputContainer: string;
35
+ icon: string[];
36
+ descriptionText: string[];
37
+ error: string;
38
+ dateSegment: string;
39
+ }, undefined, {
40
+ [key: string]: {
41
+ [key: string]: tailwind_merge.ClassNameValue | {
42
+ icon?: tailwind_merge.ClassNameValue;
43
+ error?: tailwind_merge.ClassNameValue;
44
+ field?: tailwind_merge.ClassNameValue;
45
+ dateInputContainer?: tailwind_merge.ClassNameValue;
46
+ dateSegment?: tailwind_merge.ClassNameValue;
47
+ dateInput?: tailwind_merge.ClassNameValue;
48
+ descriptionText?: tailwind_merge.ClassNameValue;
49
+ };
50
+ };
51
+ } | {}, {
52
+ field: string;
53
+ dateInput: string[];
54
+ dateInputContainer: string;
55
+ icon: string[];
56
+ descriptionText: string[];
57
+ error: string;
58
+ dateSegment: string;
59
+ }, tailwind_variants.TVReturnType<unknown, {
60
+ field: string;
61
+ dateInput: string[];
62
+ dateInputContainer: string;
63
+ icon: string[];
64
+ descriptionText: string[];
65
+ error: string;
66
+ dateSegment: string;
67
+ }, undefined, unknown, unknown, undefined>>;
68
+
69
+ export { DateFieldStyles, DateFieldStylesDefault };
@@ -0,0 +1,2 @@
1
+ import {tv}from'tailwind-variants';const t={size:"medium"},d=tv({slots:{field:"group/date-field flex flex-col gap-xs",dateInput:["group/date-field flex w-full gap-xs rounded-medium px-s py-xs font-display outline outline-interactive","disabled:text-disabled disabled:outline-interactive-disabled disabled:placeholder:text-disabled","text-default-light placeholder:text-default-dark focus-within:outline-highlight hover:outline-interactive-hover","invalid:outline-serious","size-medium:pl-[32px] size-medium:text-body-s","size-small:text-body-xs"],dateInputContainer:"relative flex",icon:["-translate-y-1/2 absolute top-1/2 left-s text-default-light","group-disabled/date-field:text-disabled"],descriptionText:["fg-default-dark text-body-xs empty:hidden","group-disabled/date-field:fg-disabled"],error:"fg-serious text-body-xs empty:hidden",dateSegment:"focus:bg-highlight focus:text-inverse-light focus:outline-none"},defaultVariants:t});export{d as DateFieldStyles,t as DateFieldStylesDefault};//# sourceMappingURL=styles.js.map
2
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/date-field/styles.ts"],"names":["DateFieldStylesDefault","DateFieldStyles","tv"],"mappings":"mCAcO,MAAMA,EAAyB,CACpC,IAAA,CAAM,QACR,CAAA,CAEaC,CAAAA,CAAkBC,GAAG,CAChC,KAAA,CAAO,CACL,KAAA,CAAO,uCAAA,CACP,UAAW,CACT,wGAAA,CACA,kGACA,iHAAA,CACA,yBAAA,CACA,gDACA,yBACF,CAAA,CACA,mBAAoB,eAAA,CACpB,IAAA,CAAM,CACJ,6DAAA,CACA,yCACF,EACA,eAAA,CAAiB,CACf,4CACA,uCACF,CAAA,CACA,MAAO,sCAAA,CACP,WAAA,CACE,gEACJ,CAAA,CACA,eAAA,CAAiBF,CACnB,CAAC","file":"styles.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { tv } from 'tailwind-variants';\n\nexport const DateFieldStylesDefault = {\n size: 'medium',\n} as const;\n\nexport const DateFieldStyles = tv({\n slots: {\n field: 'group/date-field flex flex-col gap-xs',\n dateInput: [\n 'group/date-field flex w-full gap-xs rounded-medium px-s py-xs font-display outline outline-interactive',\n 'disabled:text-disabled disabled:outline-interactive-disabled disabled:placeholder:text-disabled',\n 'text-default-light placeholder:text-default-dark focus-within:outline-highlight hover:outline-interactive-hover',\n 'invalid:outline-serious',\n 'size-medium:pl-[32px] size-medium:text-body-s',\n 'size-small:text-body-xs',\n ],\n dateInputContainer: 'relative flex',\n icon: [\n '-translate-y-1/2 absolute top-1/2 left-s text-default-light',\n 'group-disabled/date-field:text-disabled',\n ],\n descriptionText: [\n 'fg-default-dark text-body-xs empty:hidden',\n 'group-disabled/date-field:fg-disabled',\n ],\n error: 'fg-serious text-body-xs empty:hidden',\n dateSegment:\n 'focus:bg-highlight focus:text-inverse-light focus:outline-none',\n },\n defaultVariants: DateFieldStylesDefault,\n});\n"]}
@@ -0,0 +1,29 @@
1
+ import { ForwardedRef } from 'react';
2
+ import { DateValue, DateFieldProps as DateFieldProps$1, DateInputProps as DateInputProps$1, LabelProps, FieldErrorProps } from 'react-aria-components';
3
+ import { VariantProps } from 'tailwind-variants';
4
+ import { DateFieldStyles } from './styles.js';
5
+ import 'tailwind-merge';
6
+
7
+ interface DateInputProps extends VariantProps<typeof DateFieldStyles>, Omit<DateInputProps$1, 'size'> {
8
+ ref?: ForwardedRef<HTMLDivElement>;
9
+ size?: 'small' | 'medium';
10
+ isInvalid?: boolean;
11
+ }
12
+ interface DateFieldProps<T extends DateValue> extends VariantProps<typeof DateFieldStyles>, Omit<DateFieldProps$1<T>, 'style' | 'className'>, Omit<DateInputProps$1, 'children' | 'style'> {
13
+ classNames?: {
14
+ field?: DateFieldProps$1<T>['className'];
15
+ label?: LabelProps['className'];
16
+ input?: DateInputProps['className'];
17
+ description?: string;
18
+ error?: FieldErrorProps['className'];
19
+ };
20
+ size?: 'small' | 'medium';
21
+ description?: string;
22
+ errorMessage?: string;
23
+ label?: string;
24
+ placeholder?: string;
25
+ shortMonth?: boolean;
26
+ isRequired?: boolean;
27
+ }
28
+
29
+ export type { DateFieldProps, DateInputProps };
@@ -0,0 +1,2 @@
1
+ //# sourceMappingURL=types.js.map
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"types.js"}
@@ -0,0 +1,59 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as react from 'react';
3
+ import { ProviderProps } from '../../lib/types.js';
4
+ import { ContextValue } from 'react-aria-components';
5
+ import { DetailsListProps, DetailsListLabelProps, DetailsListValueProps } from './types.js';
6
+ import 'tailwind-variants';
7
+ import './styles.js';
8
+
9
+ declare const DetailsListContext: react.Context<ContextValue<DetailsListProps, HTMLDListElement>>;
10
+ declare function DetailsListProvider({ children, ...props }: ProviderProps<DetailsListProps>): react_jsx_runtime.JSX.Element;
11
+ declare namespace DetailsListProvider {
12
+ var displayName: string;
13
+ }
14
+ declare function DetailsListLabel(props: DetailsListLabelProps): react_jsx_runtime.JSX.Element;
15
+ declare namespace DetailsListLabel {
16
+ var displayName: string;
17
+ }
18
+ declare function DetailsListValue(props: DetailsListValueProps): react_jsx_runtime.JSX.Element;
19
+ declare namespace DetailsListValue {
20
+ var displayName: string;
21
+ }
22
+ /**
23
+ * A semantic details list component for displaying metadata in key-value pairs.
24
+ * Uses CSS Grid layout with labels in the first column and values in the second column.
25
+ * Perfect for map object details, user profiles, or any structured information.
26
+ *
27
+ * @example
28
+ * ```tsx
29
+ * <DetailsList align="left">
30
+ * <DetailsList.Label>Key</DetailsList.Label>
31
+ * <DetailsList.Value>Value</DetailsList.Value>
32
+ *
33
+ * <DetailsList.Label>Ships</DetailsList.Label>
34
+ * <DetailsList.Value>Millennium Falcon</DetailsList.Value>
35
+ * <DetailsList.Value>USS Enterprise NCC-1701</DetailsList.Value>
36
+ * <DetailsList.Value>Serenity</DetailsList.Value>
37
+ *
38
+ * <DetailsList.Label>Coordinates</DetailsList.Label>
39
+ * <DetailsList.Value>
40
+ * <div>Great Pyramid of Giza: 29°58'44" N 31°08'02" E</div>
41
+ * <div>Machu Picchu: 13°09'47" S 72°32'41" W</div>
42
+ * <div>Colosseum: 41°53'24" N 12°29'32" E</div>
43
+ * <div>Taj Mahal: 27°10'30" N 78°02'31" E</div>
44
+ * </DetailsList.Value>
45
+ * </DetailsList>
46
+ * ```
47
+ * ## Child Component Behavior
48
+ * - **DetailsList.Label**: Minimum of 1
49
+ * - **DetailsList.Value**: Minimum of 1
50
+ */
51
+ declare function DetailsList({ ref, ...props }: DetailsListProps): react_jsx_runtime.JSX.Element;
52
+ declare namespace DetailsList {
53
+ var displayName: string;
54
+ var Provider: typeof DetailsListProvider;
55
+ var Label: typeof DetailsListLabel;
56
+ var Value: typeof DetailsListValue;
57
+ }
58
+
59
+ export { DetailsList, DetailsListContext };
@@ -0,0 +1,2 @@
1
+ import {jsx}from'react/jsx-runtime';import'client-only';import {containsExactChildren}from'./../../lib/react.js';import {createContext}from'react';import {useContextProps,TextContext,DEFAULT_SLOT,Text}from'react-aria-components';import {DetailsListStyles,DetailsListStylesDefaults}from'./styles.js';const {list:N,label:b,value:f}=DetailsListStyles(),n=createContext(null);function m({children:e,...s}){return jsx(n.Provider,{value:s,children:e})}m.displayName="DetailsListProvider.Provider";function L(e){return jsx(Text,{...e,elementType:"dt",slot:"label"})}L.displayName="DetailsList.Label";function p(e){return jsx(Text,{...e,elementType:"dd",slot:"value"})}p.displayName="DetailsList.Value";function t({ref:e,...s}){[s,e]=useContextProps(s,e??null,n);const{children:o,classNames:i,align:a=DetailsListStylesDefaults.align,...u}=s;return containsExactChildren({children:o,componentName:t.displayName,restrictions:[[t.Label,{min:1}],[t.Value,{min:1}]]}),jsx(TextContext,{value:{slots:{[DEFAULT_SLOT]:{},label:{className:b({className:i?.label,align:a})},value:{className:f({className:i?.value,align:a})}}},children:jsx("dl",{...u,className:N({className:i?.list,align:a}),children:o})})}t.displayName="DetailsList",t.Provider=m,t.Label=L,t.Value=p;export{t as DetailsList,n as DetailsListContext};//# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/details-list/index.tsx"],"names":["label","value","DetailsListContext","y","props","jsx","l","DetailsListProvider","Text","r","use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K,CAAE,CAAC,CAAA,KACjB,CAAA,CAAA,GAAO,CAAE,CAAA,CAAA,CAAA,CAAK,CAAE,CAAC,CAChC,KAIAX,CAACY,CAAAA,GACC,CAAA,CAAA,CAAA,CAAA,CAAO,CACL,CAAA,CAAAX,GAAA,CAAAY,WAAA,CAAO,CACL,KAAiB,CAAA,CACjB,MAAO,CAAE,CAAAC,YAAA,EAAA,EAAA,CAAA,KAAiB,CAAE,CAAA,SAAWN,CAAAA,CAAAA,CAAY,CAAA,SAAO,CAAA,CAAAO,EAAO,KACjE,CAAA,gBAA0B,CAAE,CAAA,SAAWP,CAAAA,CAAAA,CAAY,CAAA,SAAO,CAAA,CAAAO,EAAO,KAIrE,CAAA,KAAA,CAAA,CAAA,CAAAf,CAAAA,CAAC,WAAa,CAAAC,GAAA,CAAA,IAAA,CAAA,CAAA,GAAgB,CAAE,CAAA,SAAWO,CAAAA,CAAAA,CAAY,CAAA,SAAM,CAAAO,CAAM,EAAC,IACjE,CAAA,KAAAC,CAAAA,CACH,EACF,CAEJ,QACY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,CAAA,CAAA,WAAA,CAC1BL,aACAA,CAAAA,CAAY,CAAA,QACZA,CAAY,CAAA,CAAA,CAAA,CAAA,KAAQM,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,KAAAA,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport { containsExactChildren } from '@/lib/react';\nimport type { ProviderProps } from '@/lib/types';\nimport { createContext } from 'react';\nimport {\n type ContextValue,\n DEFAULT_SLOT,\n Text,\n TextContext,\n useContextProps,\n} from 'react-aria-components';\nimport { DetailsListStyles, DetailsListStylesDefaults } from './styles';\nimport type {\n DetailsListLabelProps,\n DetailsListProps,\n DetailsListValueProps,\n} from './types';\n\nconst { list, label, value } = DetailsListStyles();\n\nexport const DetailsListContext =\n createContext<ContextValue<DetailsListProps, HTMLDListElement>>(null);\n\nfunction DetailsListProvider({\n children,\n ...props\n}: ProviderProps<DetailsListProps>) {\n return (\n <DetailsListContext.Provider value={props}>\n {children}\n </DetailsListContext.Provider>\n );\n}\nDetailsListProvider.displayName = 'DetailsListProvider.Provider';\n\nfunction DetailsListLabel(props: DetailsListLabelProps) {\n return <Text {...props} elementType='dt' slot='label' />;\n}\nDetailsListLabel.displayName = 'DetailsList.Label';\n\nfunction DetailsListValue(props: DetailsListValueProps) {\n return <Text {...props} elementType='dd' slot='value' />;\n}\nDetailsListValue.displayName = 'DetailsList.Value';\n\n/**\n * A semantic details list component for displaying metadata in key-value pairs.\n * Uses CSS Grid layout with labels in the first column and values in the second column.\n * Perfect for map object details, user profiles, or any structured information.\n *\n * @example\n * ```tsx\n * <DetailsList align=\"left\">\n * <DetailsList.Label>Key</DetailsList.Label>\n * <DetailsList.Value>Value</DetailsList.Value>\n *\n * <DetailsList.Label>Ships</DetailsList.Label>\n * <DetailsList.Value>Millennium Falcon</DetailsList.Value>\n * <DetailsList.Value>USS Enterprise NCC-1701</DetailsList.Value>\n * <DetailsList.Value>Serenity</DetailsList.Value>\n *\n * <DetailsList.Label>Coordinates</DetailsList.Label>\n * <DetailsList.Value>\n * <div>Great Pyramid of Giza: 29°58'44\" N 31°08'02\" E</div>\n * <div>Machu Picchu: 13°09'47\" S 72°32'41\" W</div>\n * <div>Colosseum: 41°53'24\" N 12°29'32\" E</div>\n * <div>Taj Mahal: 27°10'30\" N 78°02'31\" E</div>\n * </DetailsList.Value>\n * </DetailsList>\n * ```\n * ## Child Component Behavior\n * - **DetailsList.Label**: Minimum of 1\n * - **DetailsList.Value**: Minimum of 1\n */\nexport function DetailsList({ ref, ...props }: DetailsListProps) {\n [props, ref] = useContextProps(props, ref ?? null, DetailsListContext);\n\n const {\n children,\n classNames,\n align = DetailsListStylesDefaults.align,\n ...rest\n } = props;\n\n containsExactChildren({\n children,\n componentName: DetailsList.displayName,\n restrictions: [\n [DetailsList.Label, { min: 1 }],\n [DetailsList.Value, { min: 1 }],\n ],\n });\n\n return (\n <TextContext\n value={{\n slots: {\n [DEFAULT_SLOT]: {},\n label: { className: label({ className: classNames?.label, align }) },\n value: { className: value({ className: classNames?.value, align }) },\n },\n }}\n >\n <dl {...rest} className={list({ className: classNames?.list, align })}>\n {children}\n </dl>\n </TextContext>\n );\n}\nDetailsList.displayName = 'DetailsList';\nDetailsList.Provider = DetailsListProvider;\nDetailsList.Label = DetailsListLabel;\nDetailsList.Value = DetailsListValue;\n"]}