@choco-vanille/ui 1.1.2 → 1.2.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 (427) hide show
  1. package/README.md +1 -2
  2. package/dist/components/actions/button/styles/Button.css.d.ts +1 -2
  3. package/dist/components/actions/button/types/Button.props.d.ts +8 -2
  4. package/dist/components/actions/icon-button/constants/iconButtonSizeVariants.const.d.ts +18 -0
  5. package/dist/components/actions/icon-button/constants/iconButtonSizes.const.cjs +1 -1
  6. package/dist/components/actions/icon-button/constants/iconButtonSizes.const.cjs.map +1 -1
  7. package/dist/components/actions/icon-button/constants/iconButtonSizes.const.js +5 -8
  8. package/dist/components/actions/icon-button/constants/iconButtonSizes.const.js.map +1 -1
  9. package/dist/components/actions/icon-button/constants/index.d.ts +1 -0
  10. package/dist/components/actions/icon-button/styles/IconButton.css.d.ts +12 -12
  11. package/dist/components/actions/icon-button/types/IconButton.props.d.ts +6 -2
  12. package/dist/components/actions/index.d.ts +2 -3
  13. package/dist/components/actions/toggle/Toggle.cjs +2 -0
  14. package/dist/components/actions/toggle/Toggle.cjs.map +1 -0
  15. package/dist/components/actions/toggle/Toggle.d.ts +4 -0
  16. package/dist/components/actions/toggle/Toggle.js +74 -0
  17. package/dist/components/actions/toggle/Toggle.js.map +1 -0
  18. package/dist/components/actions/toggle/constants/toggleSizes.const.cjs +2 -0
  19. package/dist/components/actions/toggle/constants/toggleSizes.const.cjs.map +1 -0
  20. package/dist/components/actions/toggle/constants/toggleSizes.const.d.ts +3 -0
  21. package/dist/components/actions/toggle/constants/toggleSizes.const.js +10 -0
  22. package/dist/components/actions/toggle/constants/toggleSizes.const.js.map +1 -0
  23. package/dist/components/actions/toggle/index.d.ts +4 -0
  24. package/dist/components/actions/toggle/styles/Toggle.css.cjs +2 -0
  25. package/dist/components/actions/toggle/styles/Toggle.css.cjs.map +1 -0
  26. package/dist/components/actions/{toggle-button/styles/ToggleButton.css.d.ts → toggle/styles/Toggle.css.d.ts} +2 -3
  27. package/dist/components/actions/toggle/styles/Toggle.css.js +9 -0
  28. package/dist/components/actions/toggle/styles/Toggle.css.js.map +1 -0
  29. package/dist/components/actions/toggle/types/Toggle.props.d.ts +11 -0
  30. package/dist/components/actions/toggle/types/Toggle.types.d.ts +21 -0
  31. package/dist/components/actions/toggle-group/ToggleGroup.cjs +2 -0
  32. package/dist/components/actions/toggle-group/ToggleGroup.cjs.map +1 -0
  33. package/dist/components/actions/toggle-group/ToggleGroup.d.ts +19 -0
  34. package/dist/components/actions/toggle-group/ToggleGroup.js +20 -0
  35. package/dist/components/actions/toggle-group/ToggleGroup.js.map +1 -0
  36. package/dist/components/actions/toggle-group/components/toggle-group-item/ToggleGroupItem.cjs +2 -0
  37. package/dist/components/actions/toggle-group/components/toggle-group-item/ToggleGroupItem.cjs.map +1 -0
  38. package/dist/components/actions/toggle-group/components/toggle-group-item/ToggleGroupItem.d.ts +4 -0
  39. package/dist/components/actions/toggle-group/components/toggle-group-item/ToggleGroupItem.js +74 -0
  40. package/dist/components/actions/toggle-group/components/toggle-group-item/ToggleGroupItem.js.map +1 -0
  41. package/dist/components/actions/toggle-group/components/toggle-group-item/types/ToggleGroupItem.props.d.ts +11 -0
  42. package/dist/components/actions/toggle-group/index.d.ts +4 -0
  43. package/dist/components/actions/toggle-group/styles/ToggleGroup.css.cjs +2 -0
  44. package/dist/components/actions/toggle-group/styles/ToggleGroup.css.cjs.map +1 -0
  45. package/dist/components/actions/toggle-group/styles/ToggleGroup.css.d.ts +14 -0
  46. package/dist/components/actions/toggle-group/styles/ToggleGroup.css.js +8 -0
  47. package/dist/components/actions/toggle-group/styles/ToggleGroup.css.js.map +1 -0
  48. package/dist/components/actions/toggle-group/types/ToggleGroup.props.d.ts +19 -0
  49. package/dist/components/actions/toggle-group/types/ToggleGroupCompound.d.ts +6 -0
  50. package/dist/components/data-display/avatar/Avatar.cjs +1 -1
  51. package/dist/components/data-display/avatar/components/avatar-fallback/types/AvatarFallback.props.d.ts +2 -3
  52. package/dist/components/data-display/avatar/components/avatar-image/types/AvatarImage.props.d.ts +2 -3
  53. package/dist/components/data-display/avatar/components/avatar-root/types/AvatarRoot.props.d.ts +1 -7
  54. package/dist/components/data-display/avatar/components/avatar-status/AvatarStatus.cjs +1 -1
  55. package/dist/components/data-display/avatar/components/avatar-status/index.d.ts +0 -1
  56. package/dist/components/data-display/avatar/components/avatar-status/types/AvatarStatus.props.d.ts +2 -3
  57. package/dist/components/data-display/avatar/components/index.d.ts +1 -1
  58. package/dist/components/data-display/avatar/constants/avatarStatus.const.d.ts +1 -1
  59. package/dist/components/data-display/avatar/types/Avatar.props.d.ts +1 -5
  60. package/dist/components/data-display/avatar/types/index.d.ts +2 -2
  61. package/dist/components/data-display/badge/Badge.cjs +1 -1
  62. package/dist/components/data-display/badge/constants/badgeVariants.const.d.ts +3 -3
  63. package/dist/components/data-display/badge/styles/Badge.css.cjs +1 -1
  64. package/dist/components/data-display/badge/styles/Badge.css.d.ts +2 -2
  65. package/dist/components/data-display/badge/styles/Badge.css.js +2 -2
  66. package/dist/components/data-display/badge/styles/variants/{solid.d.ts → contained.d.ts} +1 -1
  67. package/dist/components/data-display/badge/styles/variants/{outline.d.ts → outlined.d.ts} +1 -1
  68. package/dist/components/data-display/badge/types/Badge.props.d.ts +1 -1
  69. package/dist/components/data-display/table/components/table-body/TableBody.cjs +1 -1
  70. package/dist/components/data-display/table/components/table-caption/TableCaption.cjs +1 -1
  71. package/dist/components/data-display/table/components/table-cell/styles/TableCell.css.d.ts +1 -2
  72. package/dist/components/data-display/table/components/table-cell/types/TableCell.props.d.ts +3 -2
  73. package/dist/components/data-display/table/components/table-col/TableCol.cjs +1 -1
  74. package/dist/components/data-display/table/components/table-footer/TableFooter.cjs +1 -1
  75. package/dist/components/data-display/table/components/table-head/styles/TableHead.css.d.ts +1 -2
  76. package/dist/components/data-display/table/components/table-head/types/TableHead.props.d.ts +3 -2
  77. package/dist/components/data-display/table/components/table-header/TableHeader.cjs +1 -1
  78. package/dist/components/data-display/table/components/table-row/TableRow.cjs +1 -1
  79. package/dist/components/data-display/table/components/table-row/styles/TableRow.css.d.ts +1 -2
  80. package/dist/components/data-display/table/components/table-row/types/TableRow.props.d.ts +7 -2
  81. package/dist/components/data-display/table/index.d.ts +1 -1
  82. package/dist/components/data-display/table/styles/Table.css.d.ts +1 -2
  83. package/dist/components/data-display/table/types/Table.props.d.ts +3 -2
  84. package/dist/components/data-display/table/types/Table.types.d.ts +2 -0
  85. package/dist/components/feedback/callout/Callout.cjs +1 -1
  86. package/dist/components/feedback/callout/Callout.cjs.map +1 -1
  87. package/dist/components/feedback/callout/Callout.js +32 -34
  88. package/dist/components/feedback/callout/Callout.js.map +1 -1
  89. package/dist/components/feedback/callout/components/callout-description/index.d.ts +0 -1
  90. package/dist/components/feedback/callout/components/callout-icon/index.d.ts +0 -1
  91. package/dist/components/feedback/callout/components/callout-title/index.d.ts +0 -1
  92. package/dist/components/feedback/callout/types/Callout.props.d.ts +1 -1
  93. package/dist/components/feedback/callout/types/Callout.types.d.ts +1 -1
  94. package/dist/components/feedback/progress/CircularProgress.cjs +1 -1
  95. package/dist/components/feedback/progress/CircularProgress.cjs.map +1 -1
  96. package/dist/components/feedback/progress/CircularProgress.js +48 -44
  97. package/dist/components/feedback/progress/CircularProgress.js.map +1 -1
  98. package/dist/components/feedback/progress/Progress.cjs +1 -1
  99. package/dist/components/feedback/progress/Progress.cjs.map +1 -1
  100. package/dist/components/feedback/progress/Progress.js +32 -29
  101. package/dist/components/feedback/progress/Progress.js.map +1 -1
  102. package/dist/components/feedback/progress/types/Progress.props.d.ts +14 -3
  103. package/dist/components/feedback/progress/utils/clamp.utils.cjs +2 -0
  104. package/dist/components/feedback/progress/utils/clamp.utils.cjs.map +1 -0
  105. package/dist/components/feedback/progress/utils/clamp.utils.d.ts +1 -0
  106. package/dist/components/feedback/progress/utils/clamp.utils.js +5 -0
  107. package/dist/components/feedback/progress/utils/clamp.utils.js.map +1 -0
  108. package/dist/components/feedback/skeleton/styles/Skeleton.css.d.ts +1 -2
  109. package/dist/components/feedback/skeleton/types/Skeleton.props.d.ts +4 -2
  110. package/dist/components/feedback/toast/components/index.d.ts +6 -5
  111. package/dist/components/feedback/toast/constants/index.cjs.map +1 -1
  112. package/dist/components/feedback/toast/constants/index.d.ts +1 -0
  113. package/dist/components/feedback/toast/constants/index.js.map +1 -1
  114. package/dist/components/feedback/toast/constants/toastVariants.const.d.ts +6 -0
  115. package/dist/components/feedback/toast/styles/Toast.css.d.ts +1 -2
  116. package/dist/components/feedback/toast/types/Toast.props.d.ts +4 -3
  117. package/dist/components/feedback/toast/types/Toast.types.d.ts +2 -2
  118. package/dist/components/forms/autocomplete/Autocomplete.cjs +1 -1
  119. package/dist/components/forms/autocomplete/components/autocomplete-content/AutocompleteContent.cjs +1 -1
  120. package/dist/components/forms/autocomplete/components/autocomplete-field/AutocompleteField.cjs +1 -1
  121. package/dist/components/forms/autocomplete/components/autocomplete-field/utils/toRootItems.utils.cjs.map +1 -1
  122. package/dist/components/forms/autocomplete/components/autocomplete-field/utils/toRootItems.utils.d.ts +1 -1
  123. package/dist/components/forms/autocomplete/components/autocomplete-field/utils/toRootItems.utils.js.map +1 -1
  124. package/dist/components/forms/autocomplete/components/autocomplete-group/AutocompleteGroup.cjs +1 -1
  125. package/dist/components/forms/autocomplete/components/autocomplete-label/AutocompleteLabel.cjs +1 -1
  126. package/dist/components/forms/autocomplete/types/Autocomplete.types.d.ts +4 -2
  127. package/dist/components/forms/calendar/Calendar.cjs +1 -1
  128. package/dist/components/forms/calendar/components/calendar-month-view/components/calendar-month-button/CalendarMonthButton.cjs +1 -1
  129. package/dist/components/forms/calendar/components/calendar-month-view/components/calendar-month-button/CalendarMonthButton.cjs.map +1 -1
  130. package/dist/components/forms/calendar/components/calendar-month-view/components/calendar-month-button/CalendarMonthButton.js +4 -16
  131. package/dist/components/forms/calendar/components/calendar-month-view/components/calendar-month-button/CalendarMonthButton.js.map +1 -1
  132. package/dist/components/forms/calendar/components/calendar-year-view/components/calendar-year-button/CalendarYearButton.cjs +1 -1
  133. package/dist/components/forms/calendar/components/calendar-year-view/components/calendar-year-button/CalendarYearButton.cjs.map +1 -1
  134. package/dist/components/forms/calendar/components/calendar-year-view/components/calendar-year-button/CalendarYearButton.js +4 -16
  135. package/dist/components/forms/calendar/components/calendar-year-view/components/calendar-year-button/CalendarYearButton.js.map +1 -1
  136. package/dist/components/forms/calendar/components/calendar-year-view/hooks/useCalendarYearView.hook.cjs +1 -1
  137. package/dist/components/forms/checkbox/Checkbox.cjs +1 -1
  138. package/dist/components/forms/checkbox/Checkbox.cjs.map +1 -1
  139. package/dist/components/forms/checkbox/Checkbox.js +21 -24
  140. package/dist/components/forms/checkbox/Checkbox.js.map +1 -1
  141. package/dist/components/forms/date-picker/DatePicker.cjs +1 -1
  142. package/dist/components/forms/select/components/select-content/SelectContent.cjs +1 -1
  143. package/dist/components/forms/select/components/select-field/SelectField.cjs +1 -1
  144. package/dist/components/forms/select/components/select-label/SelectLabel.cjs +1 -1
  145. package/dist/components/forms/select/components/select-trigger/SelectTrigger.cjs +1 -1
  146. package/dist/components/forms/select/components/select-trigger/hooks/useSelectTrigger.hook.cjs +1 -1
  147. package/dist/components/forms/select/components/select-trigger/types/SelectTrigger.props.d.ts +1 -1
  148. package/dist/components/forms/switch/Switch.cjs +1 -1
  149. package/dist/components/forms/switch/Switch.cjs.map +1 -1
  150. package/dist/components/forms/switch/Switch.js +36 -39
  151. package/dist/components/forms/switch/Switch.js.map +1 -1
  152. package/dist/components/forms/text-area/TextArea.cjs +1 -1
  153. package/dist/components/forms/text-area/components/text-area-end-action/TextAreaEndAction.cjs +1 -1
  154. package/dist/components/forms/text-area/constants/index.d.ts +5 -0
  155. package/dist/components/forms/text-area/index.d.ts +1 -0
  156. package/dist/components/forms/text-area/styles/TextArea.css.d.ts +1 -2
  157. package/dist/components/forms/text-area/types/TextArea.props.d.ts +4 -2
  158. package/dist/components/forms/text-area/types/TextArea.types.d.ts +2 -1
  159. package/dist/components/forms/text-field/TextField.cjs +1 -1
  160. package/dist/components/forms/text-field/components/index.d.ts +1 -0
  161. package/dist/components/forms/text-field/components/text-field-end-action/TextFieldEndAction.cjs.map +1 -1
  162. package/dist/components/forms/text-field/components/text-field-end-action/TextFieldEndAction.d.ts +2 -4
  163. package/dist/components/forms/text-field/components/text-field-end-action/TextFieldEndAction.js.map +1 -1
  164. package/dist/components/forms/text-field/components/text-field-end-action/types/TextFieldEndAction.props.d.ts +5 -0
  165. package/dist/components/forms/text-field/components/text-field-label/TextFieldLabel.cjs +1 -1
  166. package/dist/components/forms/text-field/constants/index.cjs.map +1 -1
  167. package/dist/components/forms/text-field/constants/index.d.ts +5 -0
  168. package/dist/components/forms/text-field/constants/index.js.map +1 -1
  169. package/dist/components/forms/text-field/index.d.ts +1 -0
  170. package/dist/components/forms/text-field/styles/TextField.css.d.ts +1 -2
  171. package/dist/components/forms/text-field/types/TextField.props.d.ts +4 -2
  172. package/dist/components/forms/text-field/types/TextField.types.d.ts +2 -1
  173. package/dist/components/foundation/icon/Icon.cjs +1 -1
  174. package/dist/components/foundation/icon/index.d.ts +1 -1
  175. package/dist/components/foundation/icon/types/Icon.props.d.ts +12 -9
  176. package/dist/components/foundation/icon/types/Icon.types.d.ts +3 -0
  177. package/dist/components/foundation/typography/Typography.cjs +1 -1
  178. package/dist/components/foundation/typography/styles/Typography.css.d.ts +1 -2
  179. package/dist/components/foundation/typography/types/Typography.props.d.ts +10 -3
  180. package/dist/components/layout/box/Box.cjs +1 -1
  181. package/dist/components/layout/box/index.d.ts +1 -2
  182. package/dist/components/layout/box/styles/Box.css.d.ts +1 -2
  183. package/dist/components/layout/box/types/Box.props.d.ts +22 -23
  184. package/dist/components/layout/box/types/Box.types.d.ts +14 -0
  185. package/dist/components/layout/flex/index.d.ts +0 -1
  186. package/dist/components/layout/flex/styles/Flex.css.d.ts +1 -2
  187. package/dist/components/layout/flex/types/Flex.props.d.ts +1 -2
  188. package/dist/components/layout/grid/Grid.cjs +1 -1
  189. package/dist/components/layout/grid/index.d.ts +1 -2
  190. package/dist/components/layout/grid/styles/Grid.css.d.ts +1 -2
  191. package/dist/components/layout/grid/types/Grid.props.d.ts +9 -9
  192. package/dist/components/layout/image/index.d.ts +0 -1
  193. package/dist/components/layout/image/styles/Image.css.d.ts +1 -2
  194. package/dist/components/layout/image/types/Image.props.d.ts +8 -7
  195. package/dist/components/layout/image/types/Image.types.d.ts +4 -0
  196. package/dist/components/layout/separator/Separator.cjs +1 -1
  197. package/dist/components/layout/separator/Separator.cjs.map +1 -1
  198. package/dist/components/layout/separator/Separator.js +2 -1
  199. package/dist/components/layout/separator/Separator.js.map +1 -1
  200. package/dist/components/layout/separator/constants/index.d.ts +4 -0
  201. package/dist/components/layout/separator/index.d.ts +1 -2
  202. package/dist/components/layout/separator/styles/Separator.css.d.ts +1 -2
  203. package/dist/components/layout/separator/types/Separator.props.d.ts +4 -4
  204. package/dist/components/layout/separator/types/Separator.types.d.ts +5 -1
  205. package/dist/components/navigation/tabs/components/tabs-content/TabsContent.cjs +1 -1
  206. package/dist/components/navigation/tabs/components/tabs-list/TabsList.cjs +1 -1
  207. package/dist/components/navigation/tabs/components/tabs-trigger/types/TabsTrigger.props.d.ts +1 -1
  208. package/dist/components/overlay/dialog/components/dialog-close/DialogClose.cjs +1 -1
  209. package/dist/components/overlay/dialog/components/dialog-content/DialogContent.cjs +1 -1
  210. package/dist/components/overlay/dialog/components/dialog-footer/DialogFooter.cjs +1 -1
  211. package/dist/components/overlay/dialog/components/dialog-header/DialogHeader.cjs +1 -1
  212. package/dist/components/overlay/drawer/components/items/drawer-action-item/DrawerActionItem.cjs +1 -1
  213. package/dist/components/overlay/drawer/components/items/drawer-action-item/DrawerActionItem.cjs.map +1 -1
  214. package/dist/components/overlay/drawer/components/items/drawer-action-item/DrawerActionItem.js +4 -16
  215. package/dist/components/overlay/drawer/components/items/drawer-action-item/DrawerActionItem.js.map +1 -1
  216. package/dist/components/overlay/drawer/components/items/drawer-nav-item/DrawerNavItem.cjs +1 -1
  217. package/dist/components/overlay/drawer/components/items/drawer-nav-item/DrawerNavItem.cjs.map +1 -1
  218. package/dist/components/overlay/drawer/components/items/drawer-nav-item/DrawerNavItem.js +4 -16
  219. package/dist/components/overlay/drawer/components/items/drawer-nav-item/DrawerNavItem.js.map +1 -1
  220. package/dist/components/overlay/drawer/components/items/drawer-section-item/DrawerSectionItem.cjs +1 -1
  221. package/dist/components/overlay/drawer/components/items/drawer-section-item/DrawerSectionItem.cjs.map +1 -1
  222. package/dist/components/overlay/drawer/components/items/drawer-section-item/DrawerSectionItem.js +4 -16
  223. package/dist/components/overlay/drawer/components/items/drawer-section-item/DrawerSectionItem.js.map +1 -1
  224. package/dist/components/overlay/drawer/components/items/drawer-section-item/constants/index.cjs.map +1 -1
  225. package/dist/components/overlay/drawer/components/items/drawer-section-item/constants/index.d.ts +2 -2
  226. package/dist/components/overlay/drawer/components/items/drawer-section-item/constants/index.js.map +1 -1
  227. package/dist/components/overlay/drawer/components/variants/drawer-inline/types/DrawerInline.props.d.ts +2 -3
  228. package/dist/components/overlay/drawer/components/variants/drawer-mini/DrawerMini.cjs +1 -1
  229. package/dist/components/overlay/drawer/components/variants/drawer-mini/types/DrawerMini.props.d.ts +2 -3
  230. package/dist/components/overlay/drawer/components/variants/drawer-portal/types/DrawerPortal.props.d.ts +2 -3
  231. package/dist/components/overlay/drawer/hooks/use-drawer/useDrawer.hook.cjs +1 -1
  232. package/dist/components/overlay/drawer/index.d.ts +2 -1
  233. package/dist/components/overlay/drawer/styles/Drawer.css.d.ts +1 -6
  234. package/dist/components/overlay/drawer/types/Drawer.props.d.ts +2 -3
  235. package/dist/components/overlay/drawer/types/Drawer.types.d.ts +3 -0
  236. package/dist/components/overlay/drawer/types/index.d.ts +1 -1
  237. package/dist/components/overlay/dropdown-menu/components/items/dropdown-menu-checkbox-item/DropdownMenuCheckboxItem.cjs +1 -1
  238. package/dist/components/overlay/hover-card/HoverCard.cjs +1 -1
  239. package/dist/components/overlay/popover/components/content/PopoverContent.cjs +1 -1
  240. package/dist/components/overlay/tooltip/Tooltip.cjs +1 -1
  241. package/dist/components/overlay/tooltip/Tooltip.cjs.map +1 -1
  242. package/dist/components/overlay/tooltip/Tooltip.js +33 -28
  243. package/dist/components/overlay/tooltip/Tooltip.js.map +1 -1
  244. package/dist/components/overlay/tooltip/hooks/use-tooltip/types/index.d.ts +1 -0
  245. package/dist/components/overlay/tooltip/hooks/use-tooltip/useTooltip.hook.cjs +1 -1
  246. package/dist/components/overlay/tooltip/hooks/use-tooltip/useTooltip.hook.cjs.map +1 -1
  247. package/dist/components/overlay/tooltip/hooks/use-tooltip/useTooltip.hook.d.ts +1 -1
  248. package/dist/components/overlay/tooltip/hooks/use-tooltip/useTooltip.hook.js +7 -7
  249. package/dist/components/overlay/tooltip/hooks/use-tooltip/useTooltip.hook.js.map +1 -1
  250. package/dist/components/overlay/tooltip/styles/Tooltip.css.cjs +1 -1
  251. package/dist/components/overlay/tooltip/styles/Tooltip.css.d.ts +1 -0
  252. package/dist/components/overlay/tooltip/styles/Tooltip.css.js +2 -2
  253. package/dist/components/overlay/tooltip/types/Tooltip.props.d.ts +4 -0
  254. package/dist/components/surfaces/card/Card.cjs +1 -1
  255. package/dist/components/surfaces/card/Card.cjs.map +1 -1
  256. package/dist/components/surfaces/card/Card.js +32 -28
  257. package/dist/components/surfaces/card/Card.js.map +1 -1
  258. package/dist/components/surfaces/card/types/Card.props.d.ts +3 -1
  259. package/dist/components/surfaces/collapsible/components/collapsible-panel/CollapsiblePanel.cjs +1 -1
  260. package/dist/components/theme-provider/ThemeProvider.cjs +1 -1
  261. package/dist/components/theme-provider/ThemeProvider.cjs.map +1 -1
  262. package/dist/components/theme-provider/ThemeProvider.context.cjs.map +1 -1
  263. package/dist/components/theme-provider/ThemeProvider.context.d.ts +8 -9
  264. package/dist/components/theme-provider/ThemeProvider.context.js.map +1 -1
  265. package/dist/components/theme-provider/ThemeProvider.d.ts +5 -9
  266. package/dist/components/theme-provider/ThemeProvider.js +46 -31
  267. package/dist/components/theme-provider/ThemeProvider.js.map +1 -1
  268. package/dist/components/theme-provider/hooks/use-theme-provider/helpers/use-theme-document-scope/useThemeDocumentScope.hook.cjs +2 -0
  269. package/dist/components/theme-provider/hooks/use-theme-provider/helpers/use-theme-document-scope/useThemeDocumentScope.hook.cjs.map +1 -0
  270. package/dist/components/theme-provider/hooks/use-theme-provider/helpers/use-theme-document-scope/useThemeDocumentScope.hook.d.ts +6 -0
  271. package/dist/components/theme-provider/hooks/use-theme-provider/helpers/use-theme-document-scope/useThemeDocumentScope.hook.js +42 -0
  272. package/dist/components/theme-provider/hooks/use-theme-provider/helpers/use-theme-document-scope/useThemeDocumentScope.hook.js.map +1 -0
  273. package/dist/components/theme-provider/hooks/use-theme-provider/helpers/use-theme-state/types/index.d.ts +6 -0
  274. package/dist/components/theme-provider/hooks/use-theme-provider/helpers/use-theme-state/useThemeState.hook.cjs +2 -0
  275. package/dist/components/theme-provider/hooks/use-theme-provider/helpers/use-theme-state/useThemeState.hook.cjs.map +1 -0
  276. package/dist/components/theme-provider/hooks/use-theme-provider/helpers/use-theme-state/useThemeState.hook.d.ts +10 -0
  277. package/dist/components/theme-provider/hooks/use-theme-provider/helpers/use-theme-state/useThemeState.hook.js +28 -0
  278. package/dist/components/theme-provider/hooks/use-theme-provider/helpers/use-theme-state/useThemeState.hook.js.map +1 -0
  279. package/dist/components/theme-provider/hooks/use-theme-provider/helpers/use-theme-token-styles/useThemeTokenStyles.hook.cjs +2 -0
  280. package/dist/components/theme-provider/hooks/use-theme-provider/helpers/use-theme-token-styles/useThemeTokenStyles.hook.cjs.map +1 -0
  281. package/dist/components/theme-provider/hooks/use-theme-provider/helpers/use-theme-token-styles/useThemeTokenStyles.hook.d.ts +6 -0
  282. package/dist/components/theme-provider/hooks/use-theme-provider/helpers/use-theme-token-styles/useThemeTokenStyles.hook.js +9 -0
  283. package/dist/components/theme-provider/hooks/use-theme-provider/helpers/use-theme-token-styles/useThemeTokenStyles.hook.js.map +1 -0
  284. package/dist/components/theme-provider/hooks/use-theme-provider/helpers/use-theme-transition/useThemeTransition.hook.cjs +2 -0
  285. package/dist/components/theme-provider/hooks/use-theme-provider/helpers/use-theme-transition/useThemeTransition.hook.cjs.map +1 -0
  286. package/dist/components/theme-provider/hooks/use-theme-provider/helpers/use-theme-transition/useThemeTransition.hook.d.ts +4 -0
  287. package/dist/components/theme-provider/hooks/use-theme-provider/helpers/use-theme-transition/useThemeTransition.hook.js +24 -0
  288. package/dist/components/theme-provider/hooks/use-theme-provider/helpers/use-theme-transition/useThemeTransition.hook.js.map +1 -0
  289. package/dist/components/theme-provider/hooks/use-theme-provider/types/index.d.ts +11 -0
  290. package/dist/components/theme-provider/hooks/use-theme-provider/useThemeProvider.hook.cjs +2 -0
  291. package/dist/components/theme-provider/hooks/use-theme-provider/useThemeProvider.hook.cjs.map +1 -0
  292. package/dist/components/theme-provider/hooks/use-theme-provider/useThemeProvider.hook.d.ts +13 -0
  293. package/dist/components/theme-provider/hooks/use-theme-provider/useThemeProvider.hook.js +36 -0
  294. package/dist/components/theme-provider/hooks/use-theme-provider/useThemeProvider.hook.js.map +1 -0
  295. package/dist/components/theme-provider/index.d.ts +1 -1
  296. package/dist/components/theme-provider/types/ThemeProvider.props.d.ts +27 -7
  297. package/dist/components/theme-provider/utils/resolveTheme.utils.cjs.map +1 -1
  298. package/dist/components/theme-provider/utils/resolveTheme.utils.d.ts +2 -2
  299. package/dist/components/theme-provider/utils/resolveTheme.utils.js.map +1 -1
  300. package/dist/constants/theme.cjs +1 -1
  301. package/dist/constants/theme.cjs.map +1 -1
  302. package/dist/constants/theme.d.ts +4 -0
  303. package/dist/constants/theme.js +6 -4
  304. package/dist/constants/theme.js.map +1 -1
  305. package/dist/index.cjs +1 -1
  306. package/dist/index.d.ts +1 -2
  307. package/dist/index.js +311 -325
  308. package/dist/index.js.map +1 -1
  309. package/dist/theme/colors/dark.cjs +2 -0
  310. package/dist/theme/colors/dark.cjs.map +1 -0
  311. package/dist/theme/colors/dark.js +170 -0
  312. package/dist/theme/colors/dark.js.map +1 -0
  313. package/dist/theme/colors/light.cjs +2 -0
  314. package/dist/theme/colors/light.cjs.map +1 -0
  315. package/dist/theme/colors/light.js +169 -0
  316. package/dist/theme/colors/light.js.map +1 -0
  317. package/dist/theme/index.d.ts +1 -2
  318. package/dist/theme/tokens/index.cjs +2 -0
  319. package/dist/theme/tokens/index.cjs.map +1 -0
  320. package/dist/theme/tokens/index.js +35 -0
  321. package/dist/theme/tokens/index.js.map +1 -0
  322. package/dist/theme/tokens/motion.cjs +1 -1
  323. package/dist/theme/tokens/motion.cjs.map +1 -1
  324. package/dist/theme/tokens/motion.js +13 -2
  325. package/dist/theme/tokens/motion.js.map +1 -1
  326. package/dist/theme/tokens/palette.cjs +2 -0
  327. package/dist/theme/tokens/palette.cjs.map +1 -0
  328. package/dist/theme/tokens/palette.js +193 -0
  329. package/dist/theme/tokens/palette.js.map +1 -0
  330. package/dist/theme/tokens/radii.cjs +2 -0
  331. package/dist/theme/tokens/radii.cjs.map +1 -0
  332. package/dist/theme/tokens/radii.js +20 -0
  333. package/dist/theme/tokens/radii.js.map +1 -0
  334. package/dist/theme/tokens/shadows.cjs +2 -0
  335. package/dist/theme/tokens/shadows.cjs.map +1 -0
  336. package/dist/theme/tokens/shadows.js +38 -0
  337. package/dist/theme/tokens/shadows.js.map +1 -0
  338. package/dist/theme/tokens/spacing.cjs +2 -0
  339. package/dist/theme/tokens/spacing.cjs.map +1 -0
  340. package/dist/theme/tokens/spacing.js +36 -0
  341. package/dist/theme/tokens/spacing.js.map +1 -0
  342. package/dist/theme/tokens/typography.cjs +2 -0
  343. package/dist/theme/tokens/typography.cjs.map +1 -0
  344. package/dist/theme/tokens/typography.js +50 -0
  345. package/dist/theme/tokens/typography.js.map +1 -0
  346. package/dist/theme/tokens/zIndex.cjs +2 -0
  347. package/dist/theme/tokens/zIndex.cjs.map +1 -0
  348. package/dist/theme/tokens/zIndex.js +17 -0
  349. package/dist/theme/tokens/zIndex.js.map +1 -0
  350. package/dist/theme/types/index.d.ts +2 -0
  351. package/dist/ui-kit.css +1 -1
  352. package/dist/utils/createIconChildUtils.cjs +1 -1
  353. package/package.json +5 -1
  354. package/dist/components/actions/toggle-button/ToggleButton.cjs +0 -2
  355. package/dist/components/actions/toggle-button/ToggleButton.cjs.map +0 -1
  356. package/dist/components/actions/toggle-button/ToggleButton.d.ts +0 -4
  357. package/dist/components/actions/toggle-button/ToggleButton.js +0 -66
  358. package/dist/components/actions/toggle-button/ToggleButton.js.map +0 -1
  359. package/dist/components/actions/toggle-button/constants/index.d.ts +0 -2
  360. package/dist/components/actions/toggle-button/constants/toggleButtonSizes.const.cjs +0 -2
  361. package/dist/components/actions/toggle-button/constants/toggleButtonSizes.const.cjs.map +0 -1
  362. package/dist/components/actions/toggle-button/constants/toggleButtonSizes.const.d.ts +0 -3
  363. package/dist/components/actions/toggle-button/constants/toggleButtonSizes.const.js +0 -10
  364. package/dist/components/actions/toggle-button/constants/toggleButtonSizes.const.js.map +0 -1
  365. package/dist/components/actions/toggle-button/index.d.ts +0 -4
  366. package/dist/components/actions/toggle-button/styles/ToggleButton.css.cjs +0 -2
  367. package/dist/components/actions/toggle-button/styles/ToggleButton.css.cjs.map +0 -1
  368. package/dist/components/actions/toggle-button/styles/ToggleButton.css.js +0 -9
  369. package/dist/components/actions/toggle-button/styles/ToggleButton.css.js.map +0 -1
  370. package/dist/components/actions/toggle-button/types/ToggleButton.props.d.ts +0 -13
  371. package/dist/components/actions/toggle-button/types/ToggleButton.types.d.ts +0 -10
  372. package/dist/components/actions/toggle-button-group/ToggleButtonGroup.cjs +0 -2
  373. package/dist/components/actions/toggle-button-group/ToggleButtonGroup.cjs.map +0 -1
  374. package/dist/components/actions/toggle-button-group/ToggleButtonGroup.d.ts +0 -18
  375. package/dist/components/actions/toggle-button-group/ToggleButtonGroup.js +0 -51
  376. package/dist/components/actions/toggle-button-group/ToggleButtonGroup.js.map +0 -1
  377. package/dist/components/actions/toggle-button-group/components/toggle-button-group-icon-item/ToggleButtonGroupIconItem.cjs +0 -2
  378. package/dist/components/actions/toggle-button-group/components/toggle-button-group-icon-item/ToggleButtonGroupIconItem.cjs.map +0 -1
  379. package/dist/components/actions/toggle-button-group/components/toggle-button-group-icon-item/ToggleButtonGroupIconItem.d.ts +0 -17
  380. package/dist/components/actions/toggle-button-group/components/toggle-button-group-icon-item/ToggleButtonGroupIconItem.js +0 -44
  381. package/dist/components/actions/toggle-button-group/components/toggle-button-group-icon-item/ToggleButtonGroupIconItem.js.map +0 -1
  382. package/dist/components/actions/toggle-button-group/components/toggle-button-group-icon-item/styles/ToggleButtonGroupIconItem.css.cjs +0 -2
  383. package/dist/components/actions/toggle-button-group/components/toggle-button-group-icon-item/styles/ToggleButtonGroupIconItem.css.cjs.map +0 -1
  384. package/dist/components/actions/toggle-button-group/components/toggle-button-group-icon-item/styles/ToggleButtonGroupIconItem.css.d.ts +0 -202
  385. package/dist/components/actions/toggle-button-group/components/toggle-button-group-icon-item/styles/ToggleButtonGroupIconItem.css.js +0 -9
  386. package/dist/components/actions/toggle-button-group/components/toggle-button-group-icon-item/styles/ToggleButtonGroupIconItem.css.js.map +0 -1
  387. package/dist/components/actions/toggle-button-group/components/toggle-button-group-icon-item/types/ToggleButtonGroupIconItem.props.d.ts +0 -11
  388. package/dist/components/actions/toggle-button-group/components/toggle-button-group-item/ToggleButtonGroupItem.cjs +0 -2
  389. package/dist/components/actions/toggle-button-group/components/toggle-button-group-item/ToggleButtonGroupItem.cjs.map +0 -1
  390. package/dist/components/actions/toggle-button-group/components/toggle-button-group-item/ToggleButtonGroupItem.d.ts +0 -17
  391. package/dist/components/actions/toggle-button-group/components/toggle-button-group-item/ToggleButtonGroupItem.js +0 -65
  392. package/dist/components/actions/toggle-button-group/components/toggle-button-group-item/ToggleButtonGroupItem.js.map +0 -1
  393. package/dist/components/actions/toggle-button-group/components/toggle-button-group-item/styles/ToggleButtonGroupItem.css.cjs +0 -2
  394. package/dist/components/actions/toggle-button-group/components/toggle-button-group-item/styles/ToggleButtonGroupItem.css.cjs.map +0 -1
  395. package/dist/components/actions/toggle-button-group/components/toggle-button-group-item/styles/ToggleButtonGroupItem.css.d.ts +0 -202
  396. package/dist/components/actions/toggle-button-group/components/toggle-button-group-item/styles/ToggleButtonGroupItem.css.js +0 -9
  397. package/dist/components/actions/toggle-button-group/components/toggle-button-group-item/styles/ToggleButtonGroupItem.css.js.map +0 -1
  398. package/dist/components/actions/toggle-button-group/components/toggle-button-group-item/types/ToggleButtonGroupItem.props.d.ts +0 -13
  399. package/dist/components/actions/toggle-button-group/index.d.ts +0 -8
  400. package/dist/components/actions/toggle-button-group/styles/ToggleButtonGroup.css.cjs +0 -2
  401. package/dist/components/actions/toggle-button-group/styles/ToggleButtonGroup.css.cjs.map +0 -1
  402. package/dist/components/actions/toggle-button-group/styles/ToggleButtonGroup.css.d.ts +0 -23
  403. package/dist/components/actions/toggle-button-group/styles/ToggleButtonGroup.css.js +0 -8
  404. package/dist/components/actions/toggle-button-group/styles/ToggleButtonGroup.css.js.map +0 -1
  405. package/dist/components/actions/toggle-button-group/types/ToggleButtonGroup.props.d.ts +0 -18
  406. package/dist/components/actions/toggle-button-group/types/ToggleButtonGroup.types.d.ts +0 -2
  407. package/dist/components/actions/toggle-button-group/types/ToggleButtonGroupCompound.d.ts +0 -8
  408. package/dist/components/actions/toggle-icon-button/ToggleIconButton.cjs +0 -2
  409. package/dist/components/actions/toggle-icon-button/ToggleIconButton.cjs.map +0 -1
  410. package/dist/components/actions/toggle-icon-button/ToggleIconButton.d.ts +0 -4
  411. package/dist/components/actions/toggle-icon-button/ToggleIconButton.js +0 -45
  412. package/dist/components/actions/toggle-icon-button/ToggleIconButton.js.map +0 -1
  413. package/dist/components/actions/toggle-icon-button/constants/index.d.ts +0 -1
  414. package/dist/components/actions/toggle-icon-button/constants/toggleIconButtonSizes.const.cjs +0 -2
  415. package/dist/components/actions/toggle-icon-button/constants/toggleIconButtonSizes.const.cjs.map +0 -1
  416. package/dist/components/actions/toggle-icon-button/constants/toggleIconButtonSizes.const.d.ts +0 -3
  417. package/dist/components/actions/toggle-icon-button/constants/toggleIconButtonSizes.const.js +0 -11
  418. package/dist/components/actions/toggle-icon-button/constants/toggleIconButtonSizes.const.js.map +0 -1
  419. package/dist/components/actions/toggle-icon-button/index.d.ts +0 -4
  420. package/dist/components/actions/toggle-icon-button/styles/ToggleIconButton.css.cjs +0 -2
  421. package/dist/components/actions/toggle-icon-button/styles/ToggleIconButton.css.cjs.map +0 -1
  422. package/dist/components/actions/toggle-icon-button/styles/ToggleIconButton.css.d.ts +0 -221
  423. package/dist/components/actions/toggle-icon-button/styles/ToggleIconButton.css.js +0 -9
  424. package/dist/components/actions/toggle-icon-button/styles/ToggleIconButton.css.js.map +0 -1
  425. package/dist/components/actions/toggle-icon-button/types/ToggleIconButton.props.d.ts +0 -11
  426. package/dist/components/actions/toggle-icon-button/types/ToggleIconButton.types.d.ts +0 -11
  427. package/dist/theme/override.d.ts +0 -11
@@ -1,2 +1,2 @@
1
- "use strict";const e=require("react/jsx-runtime"),i=require("@base-ui/react/checkbox"),r=require("react"),C=require("../../foundation/icon/Icon.cjs");require("../../foundation/icon/styles/Icon.css.cjs");const q=require("../../../constants/icons.cjs"),k=require("../../foundation/typography/Typography.cjs");require("../../foundation/typography/styles/Typography.css.cjs");const b=require("../../layout/flex/Flex.cjs");require("../../layout/flex/styles/Flex.css.cjs");const m=require("../../../utils/cn.cjs"),s=require("./styles/Checkbox.css.cjs"),t=r.memo(({label:c,id:a,className:u,onCheckedChange:o,...h})=>{const l=r.useId(),n=a??(c?l:void 0),d=r.useCallback(x=>o?.(x,{reason:"none"}),[o]);return e.jsxs(b,{as:"span",inline:!0,gap:"sm",children:[e.jsx(i.Checkbox.Root,{id:n,className:m.cn(s.CHECKBOX_STYLES.root,u),onCheckedChange:d,...h,children:e.jsx(i.Checkbox.Indicator,{className:s.CHECKBOX_STYLES.indicator,children:e.jsx(C,{icon:q.IconRegistry.check,size:"xs"})})}),c&&e.jsx(k,{as:"label",variant:"label",color:"foreground",htmlFor:n,className:s.CHECKBOX_STYLES.label,children:c})]})});t.displayName="Checkbox";module.exports=t;
1
+ "use strict";const e=require("react/jsx-runtime"),o=require("@base-ui/react/checkbox"),n=require("react"),h=require("../../foundation/icon/Icon.cjs");require("../../foundation/icon/styles/Icon.css.cjs");const l=require("../../../constants/icons.cjs"),q=require("../../foundation/typography/Typography.cjs");require("../../foundation/typography/styles/Typography.css.cjs");const C=require("../../layout/flex/Flex.cjs");require("../../layout/flex/styles/Flex.css.cjs");const m=require("../../../utils/cn.cjs"),c=require("./styles/Checkbox.css.cjs"),i=n.memo(({label:r,id:t,className:a,onCheckedChange:u,...x})=>{const d=n.useId(),s=t??(r?d:void 0);return e.jsxs(C,{as:"span",inline:!0,gap:"sm",children:[e.jsx(o.Checkbox.Root,{id:s,className:m.cn(c.CHECKBOX_STYLES.root,a),onCheckedChange:u,...x,children:e.jsx(o.Checkbox.Indicator,{className:c.CHECKBOX_STYLES.indicator,children:e.jsx(h,{icon:l.IconRegistry.check,size:"xs"})})}),r&&e.jsx(q,{as:"label",variant:"label",color:"foreground",htmlFor:s,className:c.CHECKBOX_STYLES.label,children:r})]})});i.displayName="Checkbox";module.exports=i;
2
2
  //# sourceMappingURL=Checkbox.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.cjs","sources":["../../../../src/components/forms/checkbox/Checkbox.tsx"],"sourcesContent":["import { Checkbox as BaseCheckbox } from '@base-ui/react/checkbox'\r\nimport { memo, useCallback, useId, type FC } from 'react'\r\n\r\nimport { Icon } from '@components/foundation/icon'\r\nimport { IconRegistry } from '@constants/icons'\r\nimport { Typography } from '@components/foundation/typography'\r\nimport { Flex } from '@components/layout/flex'\r\nimport { cn } from '@utils/cn.ts'\r\nimport { CHECKBOX_STYLES } from '@components/forms/checkbox/styles/Checkbox.css.ts'\r\nimport type { CheckboxProps } from '@components/forms/checkbox/types/Checkbox.props.ts'\r\n\r\n/**\r\n * A styled checkbox control built on top of `@base-ui/react/checkbox`.\r\n *\r\n * Supports controlled (`checked` + `onCheckedChange`) and uncontrolled\r\n * (`defaultChecked`) modes, plus an optional inline `label`.\r\n *\r\n * @example\r\n * ```tsx\r\n * <Checkbox label=\"Accept terms\" checked={accepted} onCheckedChange={setAccepted} />\r\n * ```\r\n */\r\nconst Checkbox: FC<CheckboxProps> = memo(({ label, id, className, onCheckedChange, ...props }) => {\r\n const generatedId = useId()\r\n const checkboxId = id ?? (label ? generatedId : undefined)\r\n\r\n const handleCheckedChange = useCallback(\r\n (checked: boolean) => onCheckedChange?.(checked, { reason: 'none' } as never),\r\n [onCheckedChange],\r\n )\r\n\r\n return (\r\n <Flex\r\n as={'span'}\r\n inline\r\n gap={'sm'}\r\n >\r\n <BaseCheckbox.Root\r\n id={checkboxId}\r\n className={cn(CHECKBOX_STYLES.root, className)}\r\n onCheckedChange={handleCheckedChange}\r\n {...props}\r\n >\r\n <BaseCheckbox.Indicator className={CHECKBOX_STYLES.indicator}>\r\n <Icon\r\n icon={IconRegistry.check}\r\n size={'xs'}\r\n />\r\n </BaseCheckbox.Indicator>\r\n </BaseCheckbox.Root>\r\n\r\n {label && (\r\n <Typography\r\n as={'label'}\r\n variant={'label'}\r\n color={'foreground'}\r\n htmlFor={checkboxId}\r\n className={CHECKBOX_STYLES.label}\r\n >\r\n {label}\r\n </Typography>\r\n )}\r\n </Flex>\r\n )\r\n})\r\n\r\nCheckbox.displayName = 'Checkbox'\r\n\r\nexport default Checkbox\r\n"],"names":["Checkbox","memo","label","id","className","onCheckedChange","props","generatedId","useId","checkboxId","handleCheckedChange","useCallback","checked","jsxs","Flex","jsx","BaseCheckbox","cn","CHECKBOX_STYLES","Icon","IconRegistry","Typography"],"mappings":"miBAsBMA,EAA8BC,EAAAA,KAAK,CAAC,CAAE,MAAAC,EAAO,GAAAC,EAAI,UAAAC,EAAW,gBAAAC,EAAiB,GAAGC,KAAY,CAC9F,MAAMC,EAAcC,EAAAA,MAAA,EACdC,EAAaN,IAAOD,EAAQK,EAAc,QAE1CG,EAAsBC,EAAAA,YACvBC,GAAqBP,IAAkBO,EAAS,CAAE,OAAQ,OAAiB,EAC5E,CAACP,CAAe,CAAA,EAGpB,OACIQ,EAAAA,KAACC,EAAA,CACG,GAAI,OACJ,OAAM,GACN,IAAK,KAEL,SAAA,CAAAC,EAAAA,IAACC,EAAAA,SAAa,KAAb,CACG,GAAIP,EACJ,UAAWQ,EAAAA,GAAGC,kBAAgB,KAAMd,CAAS,EAC7C,gBAAiBM,EAChB,GAAGJ,EAEJ,eAACU,EAAAA,SAAa,UAAb,CAAuB,UAAWE,EAAAA,gBAAgB,UAC/C,SAAAH,EAAAA,IAACI,EAAA,CACG,KAAMC,EAAAA,aAAa,MACnB,KAAM,IAAA,CAAA,CACV,CACJ,CAAA,CAAA,EAGHlB,GACGa,EAAAA,IAACM,EAAA,CACG,GAAI,QACJ,QAAS,QACT,MAAO,aACP,QAASZ,EACT,UAAWS,EAAAA,gBAAgB,MAE1B,SAAAhB,CAAA,CAAA,CACL,CAAA,CAAA,CAIhB,CAAC,EAEDF,EAAS,YAAc"}
1
+ {"version":3,"file":"Checkbox.cjs","sources":["../../../../src/components/forms/checkbox/Checkbox.tsx"],"sourcesContent":["import { Checkbox as BaseCheckbox } from '@base-ui/react/checkbox'\r\nimport { memo, useId, type FC } from 'react'\r\n\r\nimport { Icon } from '@components/foundation/icon'\r\nimport { IconRegistry } from '@constants/icons'\r\nimport { Typography } from '@components/foundation/typography'\r\nimport { Flex } from '@components/layout/flex'\r\nimport { cn } from '@utils/cn.ts'\r\nimport { CHECKBOX_STYLES } from '@components/forms/checkbox/styles/Checkbox.css.ts'\r\nimport type { CheckboxProps } from '@components/forms/checkbox/types/Checkbox.props.ts'\r\n\r\n/**\r\n * A styled checkbox control built on top of `@base-ui/react/checkbox`.\r\n *\r\n * Supports controlled (`checked` + `onCheckedChange`) and uncontrolled\r\n * (`defaultChecked`) modes, plus an optional inline `label`.\r\n *\r\n * @example\r\n * ```tsx\r\n * <Checkbox label=\"Accept terms\" checked={accepted} onCheckedChange={setAccepted} />\r\n * ```\r\n */\r\nconst Checkbox: FC<CheckboxProps> = memo(({ label, id, className, onCheckedChange, ...props }) => {\r\n const generatedId = useId()\r\n const checkboxId = id ?? (label ? generatedId : undefined)\r\n\r\n return (\r\n <Flex\r\n as={'span'}\r\n inline\r\n gap={'sm'}\r\n >\r\n <BaseCheckbox.Root\r\n id={checkboxId}\r\n className={cn(CHECKBOX_STYLES.root, className)}\r\n onCheckedChange={onCheckedChange}\r\n {...props}\r\n >\r\n <BaseCheckbox.Indicator className={CHECKBOX_STYLES.indicator}>\r\n <Icon\r\n icon={IconRegistry.check}\r\n size={'xs'}\r\n />\r\n </BaseCheckbox.Indicator>\r\n </BaseCheckbox.Root>\r\n\r\n {label && (\r\n <Typography\r\n as={'label'}\r\n variant={'label'}\r\n color={'foreground'}\r\n htmlFor={checkboxId}\r\n className={CHECKBOX_STYLES.label}\r\n >\r\n {label}\r\n </Typography>\r\n )}\r\n </Flex>\r\n )\r\n})\r\n\r\nCheckbox.displayName = 'Checkbox'\r\n\r\nexport default Checkbox\r\n"],"names":["Checkbox","memo","label","id","className","onCheckedChange","props","generatedId","useId","checkboxId","jsxs","Flex","jsx","BaseCheckbox","cn","CHECKBOX_STYLES","Icon","IconRegistry","Typography"],"mappings":"miBAsBMA,EAA8BC,EAAAA,KAAK,CAAC,CAAE,MAAAC,EAAO,GAAAC,EAAI,UAAAC,EAAW,gBAAAC,EAAiB,GAAGC,KAAY,CAC9F,MAAMC,EAAcC,EAAAA,MAAA,EACdC,EAAaN,IAAOD,EAAQK,EAAc,QAEhD,OACIG,EAAAA,KAACC,EAAA,CACG,GAAI,OACJ,OAAM,GACN,IAAK,KAEL,SAAA,CAAAC,EAAAA,IAACC,EAAAA,SAAa,KAAb,CACG,GAAIJ,EACJ,UAAWK,EAAAA,GAAGC,kBAAgB,KAAMX,CAAS,EAC7C,gBAAAC,EACC,GAAGC,EAEJ,eAACO,EAAAA,SAAa,UAAb,CAAuB,UAAWE,EAAAA,gBAAgB,UAC/C,SAAAH,EAAAA,IAACI,EAAA,CACG,KAAMC,EAAAA,aAAa,MACnB,KAAM,IAAA,CAAA,CACV,CACJ,CAAA,CAAA,EAGHf,GACGU,EAAAA,IAACM,EAAA,CACG,GAAI,QACJ,QAAS,QACT,MAAO,aACP,QAAST,EACT,UAAWM,EAAAA,gBAAgB,MAE1B,SAAAb,CAAA,CAAA,CACL,CAAA,CAAA,CAIhB,CAAC,EAEDF,EAAS,YAAc"}
@@ -1,22 +1,19 @@
1
- import { jsxs as d, jsx as o } from "react/jsx-runtime";
1
+ import { jsxs as p, jsx as o } from "react/jsx-runtime";
2
2
  import { Checkbox as i } from "@base-ui/react/checkbox";
3
- import { memo as h, useId as f, useCallback as x } from "react";
4
- import C from "../../foundation/icon/Icon.js";
3
+ import { memo as d, useId as l } from "react";
4
+ import h from "../../foundation/icon/Icon.js";
5
5
  import "../../foundation/icon/styles/Icon.css.js";
6
- import { IconRegistry as k } from "../../../constants/icons.js";
7
- import b from "../../foundation/typography/Typography.js";
6
+ import { IconRegistry as f } from "../../../constants/icons.js";
7
+ import x from "../../foundation/typography/Typography.js";
8
8
  import "../../foundation/typography/styles/Typography.css.js";
9
- import g from "../../layout/flex/Flex.js";
9
+ import b from "../../layout/flex/Flex.js";
10
10
  import "../../layout/flex/styles/Flex.css.js";
11
- import { cn as u } from "../../../utils/cn.js";
11
+ import { cn as k } from "../../../utils/cn.js";
12
12
  import { CHECKBOX_STYLES as e } from "./styles/Checkbox.css.js";
13
- const I = h(({ label: r, id: t, className: a, onCheckedChange: m, ...n }) => {
14
- const s = f(), c = t ?? (r ? s : void 0), l = x(
15
- (p) => m?.(p, { reason: "none" }),
16
- [m]
17
- );
18
- return /* @__PURE__ */ d(
19
- g,
13
+ const C = d(({ label: r, id: t, className: c, onCheckedChange: s, ...a }) => {
14
+ const n = l(), m = t ?? (r ? n : void 0);
15
+ return /* @__PURE__ */ p(
16
+ b,
20
17
  {
21
18
  as: "span",
22
19
  inline: !0,
@@ -25,26 +22,26 @@ const I = h(({ label: r, id: t, className: a, onCheckedChange: m, ...n }) => {
25
22
  /* @__PURE__ */ o(
26
23
  i.Root,
27
24
  {
28
- id: c,
29
- className: u(e.root, a),
30
- onCheckedChange: l,
31
- ...n,
25
+ id: m,
26
+ className: k(e.root, c),
27
+ onCheckedChange: s,
28
+ ...a,
32
29
  children: /* @__PURE__ */ o(i.Indicator, { className: e.indicator, children: /* @__PURE__ */ o(
33
- C,
30
+ h,
34
31
  {
35
- icon: k.check,
32
+ icon: f.check,
36
33
  size: "xs"
37
34
  }
38
35
  ) })
39
36
  }
40
37
  ),
41
38
  r && /* @__PURE__ */ o(
42
- b,
39
+ x,
43
40
  {
44
41
  as: "label",
45
42
  variant: "label",
46
43
  color: "foreground",
47
- htmlFor: c,
44
+ htmlFor: m,
48
45
  className: e.label,
49
46
  children: r
50
47
  }
@@ -53,8 +50,8 @@ const I = h(({ label: r, id: t, className: a, onCheckedChange: m, ...n }) => {
53
50
  }
54
51
  );
55
52
  });
56
- I.displayName = "Checkbox";
53
+ C.displayName = "Checkbox";
57
54
  export {
58
- I as default
55
+ C as default
59
56
  };
60
57
  //# sourceMappingURL=Checkbox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.js","sources":["../../../../src/components/forms/checkbox/Checkbox.tsx"],"sourcesContent":["import { Checkbox as BaseCheckbox } from '@base-ui/react/checkbox'\r\nimport { memo, useCallback, useId, type FC } from 'react'\r\n\r\nimport { Icon } from '@components/foundation/icon'\r\nimport { IconRegistry } from '@constants/icons'\r\nimport { Typography } from '@components/foundation/typography'\r\nimport { Flex } from '@components/layout/flex'\r\nimport { cn } from '@utils/cn.ts'\r\nimport { CHECKBOX_STYLES } from '@components/forms/checkbox/styles/Checkbox.css.ts'\r\nimport type { CheckboxProps } from '@components/forms/checkbox/types/Checkbox.props.ts'\r\n\r\n/**\r\n * A styled checkbox control built on top of `@base-ui/react/checkbox`.\r\n *\r\n * Supports controlled (`checked` + `onCheckedChange`) and uncontrolled\r\n * (`defaultChecked`) modes, plus an optional inline `label`.\r\n *\r\n * @example\r\n * ```tsx\r\n * <Checkbox label=\"Accept terms\" checked={accepted} onCheckedChange={setAccepted} />\r\n * ```\r\n */\r\nconst Checkbox: FC<CheckboxProps> = memo(({ label, id, className, onCheckedChange, ...props }) => {\r\n const generatedId = useId()\r\n const checkboxId = id ?? (label ? generatedId : undefined)\r\n\r\n const handleCheckedChange = useCallback(\r\n (checked: boolean) => onCheckedChange?.(checked, { reason: 'none' } as never),\r\n [onCheckedChange],\r\n )\r\n\r\n return (\r\n <Flex\r\n as={'span'}\r\n inline\r\n gap={'sm'}\r\n >\r\n <BaseCheckbox.Root\r\n id={checkboxId}\r\n className={cn(CHECKBOX_STYLES.root, className)}\r\n onCheckedChange={handleCheckedChange}\r\n {...props}\r\n >\r\n <BaseCheckbox.Indicator className={CHECKBOX_STYLES.indicator}>\r\n <Icon\r\n icon={IconRegistry.check}\r\n size={'xs'}\r\n />\r\n </BaseCheckbox.Indicator>\r\n </BaseCheckbox.Root>\r\n\r\n {label && (\r\n <Typography\r\n as={'label'}\r\n variant={'label'}\r\n color={'foreground'}\r\n htmlFor={checkboxId}\r\n className={CHECKBOX_STYLES.label}\r\n >\r\n {label}\r\n </Typography>\r\n )}\r\n </Flex>\r\n )\r\n})\r\n\r\nCheckbox.displayName = 'Checkbox'\r\n\r\nexport default Checkbox\r\n"],"names":["Checkbox","memo","label","id","className","onCheckedChange","props","generatedId","useId","checkboxId","handleCheckedChange","useCallback","checked","jsxs","Flex","jsx","BaseCheckbox","cn","CHECKBOX_STYLES","Icon","IconRegistry","Typography"],"mappings":";;;;;;;;;;;;AAsBA,MAAMA,IAA8BC,EAAK,CAAC,EAAE,OAAAC,GAAO,IAAAC,GAAI,WAAAC,GAAW,iBAAAC,GAAiB,GAAGC,QAAY;AAC9F,QAAMC,IAAcC,EAAA,GACdC,IAAaN,MAAOD,IAAQK,IAAc,SAE1CG,IAAsBC;AAAA,IACxB,CAACC,MAAqBP,IAAkBO,GAAS,EAAE,QAAQ,QAAiB;AAAA,IAC5E,CAACP,CAAe;AAAA,EAAA;AAGpB,SACI,gBAAAQ;AAAA,IAACC;AAAA,IAAA;AAAA,MACG,IAAI;AAAA,MACJ,QAAM;AAAA,MACN,KAAK;AAAA,MAEL,UAAA;AAAA,QAAA,gBAAAC;AAAA,UAACC,EAAa;AAAA,UAAb;AAAA,YACG,IAAIP;AAAA,YACJ,WAAWQ,EAAGC,EAAgB,MAAMd,CAAS;AAAA,YAC7C,iBAAiBM;AAAA,YAChB,GAAGJ;AAAA,YAEJ,4BAACU,EAAa,WAAb,EAAuB,WAAWE,EAAgB,WAC/C,UAAA,gBAAAH;AAAA,cAACI;AAAA,cAAA;AAAA,gBACG,MAAMC,EAAa;AAAA,gBACnB,MAAM;AAAA,cAAA;AAAA,YAAA,EACV,CACJ;AAAA,UAAA;AAAA,QAAA;AAAA,QAGHlB,KACG,gBAAAa;AAAA,UAACM;AAAA,UAAA;AAAA,YACG,IAAI;AAAA,YACJ,SAAS;AAAA,YACT,OAAO;AAAA,YACP,SAASZ;AAAA,YACT,WAAWS,EAAgB;AAAA,YAE1B,UAAAhB;AAAA,UAAA;AAAA,QAAA;AAAA,MACL;AAAA,IAAA;AAAA,EAAA;AAIhB,CAAC;AAEDF,EAAS,cAAc;"}
1
+ {"version":3,"file":"Checkbox.js","sources":["../../../../src/components/forms/checkbox/Checkbox.tsx"],"sourcesContent":["import { Checkbox as BaseCheckbox } from '@base-ui/react/checkbox'\r\nimport { memo, useId, type FC } from 'react'\r\n\r\nimport { Icon } from '@components/foundation/icon'\r\nimport { IconRegistry } from '@constants/icons'\r\nimport { Typography } from '@components/foundation/typography'\r\nimport { Flex } from '@components/layout/flex'\r\nimport { cn } from '@utils/cn.ts'\r\nimport { CHECKBOX_STYLES } from '@components/forms/checkbox/styles/Checkbox.css.ts'\r\nimport type { CheckboxProps } from '@components/forms/checkbox/types/Checkbox.props.ts'\r\n\r\n/**\r\n * A styled checkbox control built on top of `@base-ui/react/checkbox`.\r\n *\r\n * Supports controlled (`checked` + `onCheckedChange`) and uncontrolled\r\n * (`defaultChecked`) modes, plus an optional inline `label`.\r\n *\r\n * @example\r\n * ```tsx\r\n * <Checkbox label=\"Accept terms\" checked={accepted} onCheckedChange={setAccepted} />\r\n * ```\r\n */\r\nconst Checkbox: FC<CheckboxProps> = memo(({ label, id, className, onCheckedChange, ...props }) => {\r\n const generatedId = useId()\r\n const checkboxId = id ?? (label ? generatedId : undefined)\r\n\r\n return (\r\n <Flex\r\n as={'span'}\r\n inline\r\n gap={'sm'}\r\n >\r\n <BaseCheckbox.Root\r\n id={checkboxId}\r\n className={cn(CHECKBOX_STYLES.root, className)}\r\n onCheckedChange={onCheckedChange}\r\n {...props}\r\n >\r\n <BaseCheckbox.Indicator className={CHECKBOX_STYLES.indicator}>\r\n <Icon\r\n icon={IconRegistry.check}\r\n size={'xs'}\r\n />\r\n </BaseCheckbox.Indicator>\r\n </BaseCheckbox.Root>\r\n\r\n {label && (\r\n <Typography\r\n as={'label'}\r\n variant={'label'}\r\n color={'foreground'}\r\n htmlFor={checkboxId}\r\n className={CHECKBOX_STYLES.label}\r\n >\r\n {label}\r\n </Typography>\r\n )}\r\n </Flex>\r\n )\r\n})\r\n\r\nCheckbox.displayName = 'Checkbox'\r\n\r\nexport default Checkbox\r\n"],"names":["Checkbox","memo","label","id","className","onCheckedChange","props","generatedId","useId","checkboxId","jsxs","Flex","jsx","BaseCheckbox","cn","CHECKBOX_STYLES","Icon","IconRegistry","Typography"],"mappings":";;;;;;;;;;;;AAsBA,MAAMA,IAA8BC,EAAK,CAAC,EAAE,OAAAC,GAAO,IAAAC,GAAI,WAAAC,GAAW,iBAAAC,GAAiB,GAAGC,QAAY;AAC9F,QAAMC,IAAcC,EAAA,GACdC,IAAaN,MAAOD,IAAQK,IAAc;AAEhD,SACI,gBAAAG;AAAA,IAACC;AAAA,IAAA;AAAA,MACG,IAAI;AAAA,MACJ,QAAM;AAAA,MACN,KAAK;AAAA,MAEL,UAAA;AAAA,QAAA,gBAAAC;AAAA,UAACC,EAAa;AAAA,UAAb;AAAA,YACG,IAAIJ;AAAA,YACJ,WAAWK,EAAGC,EAAgB,MAAMX,CAAS;AAAA,YAC7C,iBAAAC;AAAA,YACC,GAAGC;AAAA,YAEJ,4BAACO,EAAa,WAAb,EAAuB,WAAWE,EAAgB,WAC/C,UAAA,gBAAAH;AAAA,cAACI;AAAA,cAAA;AAAA,gBACG,MAAMC,EAAa;AAAA,gBACnB,MAAM;AAAA,cAAA;AAAA,YAAA,EACV,CACJ;AAAA,UAAA;AAAA,QAAA;AAAA,QAGHf,KACG,gBAAAU;AAAA,UAACM;AAAA,UAAA;AAAA,YACG,IAAI;AAAA,YACJ,SAAS;AAAA,YACT,OAAO;AAAA,YACP,SAAST;AAAA,YACT,WAAWM,EAAgB;AAAA,YAE1B,UAAAb;AAAA,UAAA;AAAA,QAAA;AAAA,MACL;AAAA,IAAA;AAAA,EAAA;AAIhB,CAAC;AAEDF,EAAS,cAAc;"}
@@ -1,2 +1,2 @@
1
- "use strict";const e=require("react/jsx-runtime"),N=require("../calendar/Calendar.cjs");;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */const w=require("../text-field/TextField.cjs");require("../text-field/styles/TextField.css.cjs");;/* empty css */;/* empty css */;/* empty css */;/* empty css */const u=require("../../overlay/popover/Popover.cjs");;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */const K=require("../../actions/icon-button/IconButton.cjs");require("../../actions/icon-button/styles/IconButton.css.cjs");const M=require("./hooks/useDatePicker.hook.cjs"),s=require("./styles/DatePicker.css.cjs"),A=require("../../../constants/icons.cjs"),d=require("../../../utils/cn.cjs"),r=require("react"),p=r.memo(({value:h,defaultValue:D,onChange:m,calendarProps:C,id:b,disabled:n,"aria-label":g,"aria-labelledby":x,calendarAriaLabel:y="Calendar",onKeyDown:l,...o})=>{const{selectedDate:i,inputValue:E,open:t,inputId:P,handleInputChange:f,handleInputKeyDown:c,handleCalendarSelect:k,setOpen:I}=M.useDatePicker({value:h,defaultValue:D,onChange:m,id:b}),q=r.useRef(null),R=r.useMemo(()=>i??new Date,[i]),S=r.useCallback(a=>{c(a),l?.(a)},[c,l]),T=r.useCallback(a=>{a.preventDefault()},[]),{className:_,...j}=C??{};return e.jsxs(u,{open:t,onOpenChange:I,children:[e.jsx(w,{...o,ref:q,id:P,type:"date",disabled:n,value:E,onChange:f,onKeyDown:S,className:d.cn(s.DATE_PICKER_STYLES.input,o.className),"aria-label":g,"aria-labelledby":x,"aria-haspopup":"dialog","aria-expanded":t,endAction:e.jsx(u.Trigger,{children:e.jsx(K,{icon:A.IconRegistry.calendar,"aria-label":"Open calendar",variant:"ghost",color:"primary",size:"sm",type:"button",disabled:n,onMouseDown:T})})}),e.jsx(u.Content,{side:"bottom",align:"end",className:s.DATE_PICKER_STYLES.content,"aria-label":y,initialFocus:!1,finalFocus:q,children:e.jsx(N,{mode:"single",selected:i,onSelect:k,disabled:n,className:d.cn(s.DATE_PICKER_STYLES.calendar,_),...j,defaultMonth:R,autoFocus:t})})]})});p.displayName="DatePicker";module.exports=p;
1
+ "use strict";const e=require("react/jsx-runtime"),R=require("../calendar/Calendar.cjs");;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */const w=require("../text-field/TextField.cjs");require("../text-field/styles/TextField.css.cjs");;/* empty css */;/* empty css */;/* empty css */;/* empty css */const u=require("../../overlay/popover/Popover.cjs");;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */const K=require("../../actions/icon-button/IconButton.cjs");require("../../actions/icon-button/styles/IconButton.css.cjs");const M=require("./hooks/useDatePicker.hook.cjs"),s=require("./styles/DatePicker.css.cjs"),A=require("../../../constants/icons.cjs"),d=require("../../../utils/cn.cjs"),r=require("react"),p=r.memo(({value:h,defaultValue:D,onChange:m,calendarProps:C,id:b,disabled:n,"aria-label":g,"aria-labelledby":x,calendarAriaLabel:y="Calendar",onKeyDown:l,...o})=>{const{selectedDate:i,inputValue:E,open:t,inputId:P,handleInputChange:f,handleInputKeyDown:c,handleCalendarSelect:k,setOpen:I}=M.useDatePicker({value:h,defaultValue:D,onChange:m,id:b}),q=r.useRef(null),S=r.useMemo(()=>i??new Date,[i]),T=r.useCallback(a=>{c(a),l?.(a)},[c,l]),_=r.useCallback(a=>{a.preventDefault()},[]),{className:j,...N}=C??{};return e.jsxs(u,{open:t,onOpenChange:I,children:[e.jsx(w,{...o,ref:q,id:P,type:"date",disabled:n,value:E,onChange:f,onKeyDown:T,className:d.cn(s.DATE_PICKER_STYLES.input,o.className),"aria-label":g,"aria-labelledby":x,"aria-haspopup":"dialog","aria-expanded":t,endAction:e.jsx(u.Trigger,{children:e.jsx(K,{icon:A.IconRegistry.calendar,"aria-label":"Open calendar",variant:"ghost",color:"primary",size:"sm",type:"button",disabled:n,onMouseDown:_})})}),e.jsx(u.Content,{side:"bottom",align:"end",className:s.DATE_PICKER_STYLES.content,"aria-label":y,initialFocus:!1,finalFocus:q,children:e.jsx(R,{mode:"single",selected:i,onSelect:k,disabled:n,className:d.cn(s.DATE_PICKER_STYLES.calendar,j),...N,defaultMonth:S,autoFocus:t})})]})});p.displayName="DatePicker";module.exports=p;
2
2
  //# sourceMappingURL=DatePicker.cjs.map
@@ -1,2 +1,2 @@
1
- "use strict";const e=require("react/jsx-runtime"),t=require("@base-ui/react/select"),m=require("react"),p=require("../../../../../utils/cn.cjs"),h=require("./styles/SelectContent.css.cjs"),q=require("../../../../../hooks/use-viewport-shift/useViewportShift.hook.cjs"),n=m.memo(({className:o,listboxAriaLabel:s="Options",children:r,side:i="bottom",align:c="start",sideOffset:l=6,collisionPadding:a=8,...u})=>{const S=q.useViewportShift(a);return e.jsx(t.Select.Portal,{children:e.jsx(t.Select.Positioner,{side:i,align:c,sideOffset:l,alignItemWithTrigger:!1,collisionAvoidance:{side:"none",align:"none"},...u,children:e.jsx(t.Select.Popup,{ref:S,className:p.cn(h.SELECT_CONTENT_STYLES.root,o),"aria-label":s,children:r})})})});n.displayName="Select.Content";module.exports=n;
1
+ "use strict";const e=require("react/jsx-runtime"),t=require("@base-ui/react/select"),m=require("react"),p=require("../../../../../utils/cn.cjs"),h=require("./styles/SelectContent.css.cjs"),q=require("../../../../../hooks/use-viewport-shift/useViewportShift.hook.cjs"),n=m.memo(({className:o,listboxAriaLabel:r="Options",children:s,side:i="bottom",align:c="start",sideOffset:l=6,collisionPadding:a=8,...u})=>{const S=q.useViewportShift(a);return e.jsx(t.Select.Portal,{children:e.jsx(t.Select.Positioner,{side:i,align:c,sideOffset:l,alignItemWithTrigger:!1,collisionAvoidance:{side:"none",align:"none"},...u,children:e.jsx(t.Select.Popup,{ref:S,className:p.cn(h.SELECT_CONTENT_STYLES.root,o),"aria-label":r,children:s})})})});n.displayName="Select.Content";module.exports=n;
2
2
  //# sourceMappingURL=SelectContent.cjs.map
@@ -1,2 +1,2 @@
1
- "use strict";const l=require("react/jsx-runtime"),d=require("react"),E=require("../../../../layout/flex/Flex.cjs");require("../../../../layout/flex/styles/Flex.css.cjs");const G=require("../../../_shared/components/helper-text/HelperText.cjs"),H=require("../../../text-field/components/text-field-label/TextFieldLabel.cjs");;/* empty css */;/* empty css */;/* empty css */require("../../../text-field/components/text-field-start-icon/TextFieldStartIcon.cjs");;/* empty css */require("../../../text-field/components/text-field-end-action/TextFieldEndAction.cjs");;/* empty css */const r=require("../../Select.cjs"),M=require("./hooks/useSelectField.hook.cjs"),N=require("./utils/flattenItems.utils.cjs"),j=d.memo(({label:c,helperText:s,error:a,startIcon:m,placeholder:g,size:o="md",width:n,disabled:q,required:v,listboxAriaLabel:I,options:t,className:F,value:S,defaultValue:y,onValueChange:C,open:p,defaultOpen:V,onOpenChange:L,name:$,...k})=>{const{triggerId:x,helperId:f,hasError:i,selectedValue:R,handleValueChange:h}=M({error:a,value:S,defaultValue:y,onValueChange:C}),_=d.useMemo(()=>N.flattenItems(t),[t]),D=d.useCallback(e=>{e!==null&&h(e)},[h]);return l.jsxs(E,{flexDirection:"column",gap:"xs",width:"100%",alignItems:"start",style:n!==void 0?{width:n}:void 0,className:F,...k,children:[c&&l.jsx(H,{htmlFor:x,disabled:q,children:c}),l.jsxs(r.default,{value:R??null,onValueChange:D,disabled:q,required:v,open:p,defaultOpen:V,onOpenChange:L,name:$,items:_,children:[l.jsx(r.default.Trigger,{id:x,placeholder:g,startIcon:m,size:o,hasError:i,"aria-describedby":a||s?f:void 0,"aria-invalid":i||void 0}),l.jsx(r.default.Content,{listboxAriaLabel:I,children:l.jsx(r.default.List,{children:t.map((e,b)=>e.type==="separator"?l.jsx(r.default.Separator,{},`sep-${b}`):e.type==="group"?l.jsxs(r.default.Group,{children:[l.jsx(r.default.Label,{children:e.label}),e.options.map(u=>l.jsx(r.default.Item,{value:u.value,disabled:u.disabled,label:u.label},u.value))]},`group-${e.label}-${b}`):l.jsx(r.default.Item,{value:e.value,disabled:e.disabled,label:e.label},e.value))})})]}),(a||s)&&l.jsx(G,{id:f,hasError:i,children:a??s})]})});j.displayName="SelectField";module.exports=j;
1
+ "use strict";const l=require("react/jsx-runtime"),d=require("react"),G=require("../../../../layout/flex/Flex.cjs");require("../../../../layout/flex/styles/Flex.css.cjs");const H=require("../../../_shared/components/helper-text/HelperText.cjs"),M=require("../../../text-field/components/text-field-label/TextFieldLabel.cjs");;/* empty css */;/* empty css */;/* empty css */require("../../../text-field/components/text-field-start-icon/TextFieldStartIcon.cjs");;/* empty css */require("../../../text-field/components/text-field-end-action/TextFieldEndAction.cjs");;/* empty css */const r=require("../../Select.cjs"),N=require("./hooks/useSelectField.hook.cjs"),R=require("./utils/flattenItems.utils.cjs"),j=d.memo(({label:c,helperText:s,error:a,startIcon:m,placeholder:g,size:o="md",width:n,disabled:q,required:v,listboxAriaLabel:I,options:t,className:F,value:S,defaultValue:y,onValueChange:C,open:p,defaultOpen:V,onOpenChange:L,name:$,...k})=>{const{triggerId:x,helperId:f,hasError:i,selectedValue:_,handleValueChange:h}=N({error:a,value:S,defaultValue:y,onValueChange:C}),D=d.useMemo(()=>R.flattenItems(t),[t]),E=d.useCallback(e=>{e!==null&&h(e)},[h]);return l.jsxs(G,{flexDirection:"column",gap:"xs",width:"100%",alignItems:"start",style:n!==void 0?{width:n}:void 0,className:F,...k,children:[c&&l.jsx(M,{htmlFor:x,disabled:q,children:c}),l.jsxs(r.default,{value:_??null,onValueChange:E,disabled:q,required:v,open:p,defaultOpen:V,onOpenChange:L,name:$,items:D,children:[l.jsx(r.default.Trigger,{id:x,placeholder:g,startIcon:m,size:o,hasError:i,"aria-describedby":a||s?f:void 0,"aria-invalid":i||void 0}),l.jsx(r.default.Content,{listboxAriaLabel:I,children:l.jsx(r.default.List,{children:t.map((e,b)=>e.type==="separator"?l.jsx(r.default.Separator,{},`sep-${b}`):e.type==="group"?l.jsxs(r.default.Group,{children:[l.jsx(r.default.Label,{children:e.label}),e.options.map(u=>l.jsx(r.default.Item,{value:u.value,disabled:u.disabled,label:u.label},u.value))]},`group-${e.label}-${b}`):l.jsx(r.default.Item,{value:e.value,disabled:e.disabled,label:e.label},e.value))})})]}),(a||s)&&l.jsx(H,{id:f,hasError:i,children:a??s})]})});j.displayName="SelectField";module.exports=j;
2
2
  //# sourceMappingURL=SelectField.cjs.map
@@ -1,2 +1,2 @@
1
- "use strict";const e=require("react/jsx-runtime"),a=require("@base-ui/react/select"),n=require("react"),o=require("../../../../foundation/typography/Typography.cjs");require("../../../../foundation/typography/styles/Typography.css.cjs");const i=require("../../../../../utils/cn.cjs"),l=require("./styles/SelectLabel.css.cjs"),s=n.memo(({className:r,children:c,...t})=>e.jsx(a.Select.GroupLabel,{className:i.cn(l.SELECT_LABEL_STYLES.root,r),...t,children:e.jsx(o,{as:"span",variant:"span",children:c})}));s.displayName="Select.Label";module.exports=s;
1
+ "use strict";const e=require("react/jsx-runtime"),a=require("@base-ui/react/select"),n=require("react"),o=require("../../../../foundation/typography/Typography.cjs");require("../../../../foundation/typography/styles/Typography.css.cjs");const i=require("../../../../../utils/cn.cjs"),l=require("./styles/SelectLabel.css.cjs"),r=n.memo(({className:s,children:c,...t})=>e.jsx(a.Select.GroupLabel,{className:i.cn(l.SELECT_LABEL_STYLES.root,s),...t,children:e.jsx(o,{as:"span",variant:"span",children:c})}));r.displayName="Select.Label";module.exports=r;
2
2
  //# sourceMappingURL=SelectLabel.cjs.map
@@ -1,2 +1,2 @@
1
- "use strict";const e=require("react/jsx-runtime"),c=require("@base-ui/react/select"),R=require("react"),_=require("../../../../foundation/icon/Icon.cjs");require("../../../../foundation/icon/styles/Icon.css.cjs");const j=require("../../../../../constants/icons.cjs"),I=require("../../../../layout/box/Box.cjs");require("../../../../layout/box/styles/Box.css.cjs");require("../../../text-field/components/text-field-label/TextFieldLabel.cjs");;/* empty css */;/* empty css */;/* empty css */const N=require("../../../text-field/components/text-field-start-icon/TextFieldStartIcon.cjs");;/* empty css */require("../../../text-field/components/text-field-end-action/TextFieldEndAction.cjs");;/* empty css */const s=require("./styles/SelectTrigger.css.cjs"),y=require("../../../../../utils/cn.cjs"),B=require("./hooks/useSelectTrigger.hook.cjs"),i=R.memo(({className:n,placeholder:u,startIcon:r,size:o="md",hasError:t=!1,width:l,children:q,onMouseDown:a,onFocus:g,onBlur:S,style:d,...T})=>{const{handleMouseDown:m,handleFocus:x,handleBlur:h,mergedStyle:E}=B({width:l,style:d,onMouseDown:a,onFocus:g,onBlur:S});return e.jsxs(c.Select.Trigger,{...T,className:y.cn(s.SELECT_TRIGGER_STYLES.recipe({size:o,hasError:t,hasStartIcon:!!r}),n),style:E,onMouseDown:m,onFocus:x,onBlur:h,children:[r&&e.jsx(N,{icon:r,size:o}),q??e.jsx(c.Select.Value,{placeholder:u}),e.jsx(I,{className:s.SELECT_TRIGGER_END_ICON,children:e.jsx(_,{icon:j.IconRegistry.chevronDown,size:"md",color:"mutedForeground"})})]})});i.displayName="Select.Trigger";module.exports=i;
1
+ "use strict";const e=require("react/jsx-runtime"),c=require("@base-ui/react/select"),_=require("react"),j=require("../../../../foundation/icon/Icon.cjs");require("../../../../foundation/icon/styles/Icon.css.cjs");const R=require("../../../../../constants/icons.cjs"),I=require("../../../../layout/box/Box.cjs");require("../../../../layout/box/styles/Box.css.cjs");require("../../../text-field/components/text-field-label/TextFieldLabel.cjs");;/* empty css */;/* empty css */;/* empty css */const N=require("../../../text-field/components/text-field-start-icon/TextFieldStartIcon.cjs");;/* empty css */require("../../../text-field/components/text-field-end-action/TextFieldEndAction.cjs");;/* empty css */const s=require("./styles/SelectTrigger.css.cjs"),y=require("../../../../../utils/cn.cjs"),B=require("./hooks/useSelectTrigger.hook.cjs"),i=_.memo(({className:n,placeholder:u,startIcon:r,size:o="md",hasError:t=!1,width:l,children:q,onMouseDown:a,onFocus:g,onBlur:S,style:d,...T})=>{const{handleMouseDown:m,handleFocus:x,handleBlur:h,mergedStyle:E}=B({width:l,style:d,onMouseDown:a,onFocus:g,onBlur:S});return e.jsxs(c.Select.Trigger,{...T,className:y.cn(s.SELECT_TRIGGER_STYLES.recipe({size:o,hasError:t,hasStartIcon:!!r}),n),style:E,onMouseDown:m,onFocus:x,onBlur:h,children:[r&&e.jsx(N,{icon:r,size:o}),q??e.jsx(c.Select.Value,{placeholder:u}),e.jsx(I,{className:s.SELECT_TRIGGER_END_ICON,children:e.jsx(j,{icon:R.IconRegistry.chevronDown,size:"md",color:"mutedForeground"})})]})});i.displayName="Select.Trigger";module.exports=i;
2
2
  //# sourceMappingURL=SelectTrigger.cjs.map
@@ -1,2 +1,2 @@
1
- "use strict";const r=require("react"),d=({width:s,style:c,onMouseDown:u,onFocus:a,onBlur:n})=>{const t=r.useRef(!1),l=r.useCallback(e=>{t.current=!0,u?.(e)},[u]),o=r.useCallback(e=>{t.current&&(e.currentTarget.setAttribute("data-mouse-focus",""),t.current=!1),a?.(e)},[a]),f=r.useCallback(e=>{t.current=!1,e.currentTarget.removeAttribute("data-mouse-focus"),n?.(e)},[n]),i=s!==void 0?{...c,width:s}:c;return{handleMouseDown:l,handleFocus:o,handleBlur:f,mergedStyle:i}};module.exports=d;
1
+ "use strict";const t=require("react"),d=({width:s,style:c,onMouseDown:u,onFocus:a,onBlur:n})=>{const r=t.useRef(!1),l=t.useCallback(e=>{r.current=!0,u?.(e)},[u]),o=t.useCallback(e=>{r.current&&(e.currentTarget.setAttribute("data-mouse-focus",""),r.current=!1),a?.(e)},[a]),f=t.useCallback(e=>{r.current=!1,e.currentTarget.removeAttribute("data-mouse-focus"),n?.(e)},[n]),i=s!==void 0?{...c,width:s}:c;return{handleMouseDown:l,handleFocus:o,handleBlur:f,mergedStyle:i}};module.exports=d;
2
2
  //# sourceMappingURL=useSelectTrigger.hook.cjs.map
@@ -7,7 +7,7 @@ export type SelectTriggerProps = BaseSelect.Trigger.Props & {
7
7
  placeholder?: string;
8
8
  /** Iconify icon name rendered on the left side of the trigger. */
9
9
  startIcon?: string;
10
- /** Visual size of the trigger. */
10
+ /** Visual size of the trigger. Defaults to `md`. */
11
11
  size?: TextFieldSize;
12
12
  /** Whether the trigger should be styled in its error state. */
13
13
  hasError?: boolean;
@@ -1,2 +1,2 @@
1
- "use strict";const e=require("react/jsx-runtime"),h=require("@base-ui/react/switch"),o=require("react"),g=require("../../foundation/typography/Typography.cjs");require("../../foundation/typography/styles/Typography.css.cjs");const _=require("../_shared/components/helper-text/HelperText.cjs"),m=require("../../layout/flex/Flex.cjs");require("../../layout/flex/styles/Flex.css.cjs");const l=require("../../../utils/cn.cjs"),s=require("./styles/Switch.css.cjs"),p=o.memo(({label:n,helperText:c,error:r,id:T,className:I,disabled:i,size:S="md",onCheckedChange:d,...q})=>{const x=o.useId(),a=T??(n?x:void 0),t=!!r,u=c||r?`${a}-helper`:void 0,w=o.useCallback(C=>d?.(C,{reason:"none"}),[d]);return e.jsxs(m,{as:"span",inline:!0,flexDirection:"column",gap:"xs",alignItems:"start",className:l.cn(s.SWITCH_STYLES.wrapper,i&&s.SWITCH_STYLES.wrapperDisabled),children:[e.jsxs(m,{as:"span",inline:!0,gap:"sm",alignItems:"center",children:[e.jsx(h.Switch.Root,{id:a,disabled:i,"aria-describedby":u,"aria-invalid":t||void 0,className:l.cn(s.SWITCH_STYLES.root({size:S,error:t}),I),onCheckedChange:w,...q,children:e.jsx(h.Switch.Thumb,{className:s.SWITCH_STYLES.thumb({size:S})})}),n&&e.jsx(g,{as:"label",variant:"label",color:"foreground",htmlFor:a,className:l.cn(s.SWITCH_STYLES.label,i&&s.SWITCH_STYLES.labelDisabled),children:n})]}),(r||c)&&e.jsx(_,{id:u,hasError:t,children:r??c})]})});p.displayName="Switch";module.exports=p;
1
+ "use strict";const e=require("react/jsx-runtime"),u=require("@base-ui/react/switch"),d=require("react"),w=require("../../foundation/typography/Typography.cjs");require("../../foundation/typography/styles/Typography.css.cjs");const _=require("../_shared/components/helper-text/HelperText.cjs"),h=require("../../layout/flex/Flex.cjs");require("../../layout/flex/styles/Flex.css.cjs");const o=require("../../../utils/cn.cjs"),s=require("./styles/Switch.css.cjs"),m=d.memo(({label:i,helperText:c,error:r,id:p,className:T,disabled:n,size:l="md",onCheckedChange:I,...q})=>{const x=d.useId(),t=p??(i?x:void 0),a=!!r,S=c||r?`${t}-helper`:void 0;return e.jsxs(h,{as:"span",inline:!0,flexDirection:"column",gap:"xs",alignItems:"start",className:o.cn(s.SWITCH_STYLES.wrapper,n&&s.SWITCH_STYLES.wrapperDisabled),children:[e.jsxs(h,{as:"span",inline:!0,gap:"sm",alignItems:"center",children:[e.jsx(u.Switch.Root,{id:t,disabled:n,"aria-describedby":S,"aria-invalid":a||void 0,className:o.cn(s.SWITCH_STYLES.root({size:l,error:a}),T),onCheckedChange:I,...q,children:e.jsx(u.Switch.Thumb,{className:s.SWITCH_STYLES.thumb({size:l})})}),i&&e.jsx(w,{as:"label",variant:"label",color:"foreground",htmlFor:t,className:o.cn(s.SWITCH_STYLES.label,n&&s.SWITCH_STYLES.labelDisabled),children:i})]}),(r||c)&&e.jsx(_,{id:S,hasError:a,children:r??c})]})});m.displayName="Switch";module.exports=m;
2
2
  //# sourceMappingURL=Switch.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.cjs","sources":["../../../../src/components/forms/switch/Switch.tsx"],"sourcesContent":["import { Switch as BaseSwitch } from '@base-ui/react/switch'\r\nimport { memo, useCallback, useId, type FC } from 'react'\r\n\r\nimport { Typography } from '@components/foundation/typography'\r\nimport HelperText from '@components/forms/_shared/components/helper-text/HelperText.tsx'\r\nimport { Flex } from '@components/layout/flex'\r\nimport { cn } from '@utils/cn.ts'\r\nimport { SWITCH_STYLES } from '@components/forms/switch/styles/Switch.css.ts'\r\nimport type { SwitchProps } from '@components/forms/switch/types/Switch.props.ts'\r\n\r\n/**\r\n * A styled switch control built on top of `@base-ui/react/switch`.\r\n *\r\n * Supports controlled (`checked` + `onCheckedChange`) and uncontrolled\r\n * (`defaultChecked`) modes, plus an optional inline `label`.\r\n *\r\n * @example\r\n * ```tsx\r\n * <Switch label=\"Airplane mode\" checked={enabled} onCheckedChange={setEnabled} />\r\n * ```\r\n */\r\nconst Switch: FC<SwitchProps> = memo(({ label, helperText, error, id, className, disabled, size = 'md', onCheckedChange, ...props }) => {\r\n const generatedId = useId()\r\n const switchId = id ?? (label ? generatedId : undefined)\r\n const hasError = Boolean(error)\r\n const helperId = (helperText || error) ? `${switchId}-helper` : undefined\r\n\r\n const handleCheckedChange = useCallback(\r\n (checked: boolean) => onCheckedChange?.(checked, { reason: 'none' } as never),\r\n [onCheckedChange],\r\n )\r\n\r\n return (\r\n <Flex\r\n as={'span'}\r\n inline\r\n flexDirection={'column'}\r\n gap={'xs'}\r\n alignItems={'start'}\r\n className={cn(SWITCH_STYLES.wrapper, disabled && SWITCH_STYLES.wrapperDisabled)}\r\n >\r\n <Flex\r\n as={'span'}\r\n inline\r\n gap={'sm'}\r\n alignItems={'center'}\r\n >\r\n <BaseSwitch.Root\r\n id={switchId}\r\n disabled={disabled}\r\n aria-describedby={helperId}\r\n aria-invalid={hasError || undefined}\r\n className={cn(SWITCH_STYLES.root({ size, error: hasError }), className)}\r\n onCheckedChange={handleCheckedChange}\r\n {...props}\r\n >\r\n <BaseSwitch.Thumb className={SWITCH_STYLES.thumb({ size })} />\r\n </BaseSwitch.Root>\r\n\r\n {label && (\r\n <Typography\r\n as={'label'}\r\n variant={'label'}\r\n color={'foreground'}\r\n htmlFor={switchId}\r\n className={cn(SWITCH_STYLES.label, disabled && SWITCH_STYLES.labelDisabled)}\r\n >\r\n {label}\r\n </Typography>\r\n )}\r\n </Flex>\r\n\r\n {(error || helperText) && (\r\n <HelperText\r\n id={helperId}\r\n hasError={hasError}\r\n >\r\n {error ?? helperText}\r\n </HelperText>\r\n )}\r\n </Flex>\r\n )\r\n})\r\n\r\nSwitch.displayName = 'Switch'\r\n\r\nexport default Switch\r\n"],"names":["Switch","memo","label","helperText","error","id","className","disabled","size","onCheckedChange","props","generatedId","useId","switchId","hasError","helperId","handleCheckedChange","useCallback","checked","jsxs","Flex","cn","SWITCH_STYLES","jsx","BaseSwitch","Typography","HelperText"],"mappings":"4cAqBMA,EAA0BC,EAAAA,KAAK,CAAC,CAAE,MAAAC,EAAO,WAAAC,EAAY,MAAAC,EAAO,GAAAC,EAAI,UAAAC,EAAW,SAAAC,EAAU,KAAAC,EAAO,KAAM,gBAAAC,EAAiB,GAAGC,KAAY,CACpI,MAAMC,EAAcC,EAAAA,MAAA,EACdC,EAAWR,IAAOH,EAAQS,EAAc,QACxCG,EAAW,EAAQV,EACnBW,EAAYZ,GAAcC,EAAS,GAAGS,CAAQ,UAAY,OAE1DG,EAAsBC,EAAAA,YACvBC,GAAqBT,IAAkBS,EAAS,CAAE,OAAQ,OAAiB,EAC5E,CAACT,CAAe,CAAA,EAGpB,OACIU,EAAAA,KAACC,EAAA,CACG,GAAI,OACJ,OAAM,GACN,cAAe,SACf,IAAK,KACL,WAAY,QACZ,UAAWC,EAAAA,GAAGC,EAAAA,cAAc,QAASf,GAAYe,EAAAA,cAAc,eAAe,EAE9E,SAAA,CAAAH,EAAAA,KAACC,EAAA,CACG,GAAI,OACJ,OAAM,GACN,IAAK,KACL,WAAY,SAEZ,SAAA,CAAAG,EAAAA,IAACC,EAAAA,OAAW,KAAX,CACG,GAAIX,EACJ,SAAAN,EACA,mBAAkBQ,EAClB,eAAcD,GAAY,OAC1B,UAAWO,EAAAA,GAAGC,EAAAA,cAAc,KAAK,CAAE,KAAAd,EAAM,MAAOM,EAAU,EAAGR,CAAS,EACtE,gBAAiBU,EAChB,GAAGN,EAEJ,SAAAa,EAAAA,IAACC,EAAAA,OAAW,MAAX,CAAiB,UAAWF,EAAAA,cAAc,MAAM,CAAE,KAAAd,CAAA,CAAM,CAAA,CAAG,CAAA,CAAA,EAG/DN,GACGqB,EAAAA,IAACE,EAAA,CACG,GAAI,QACJ,QAAS,QACT,MAAO,aACP,QAASZ,EACT,UAAWQ,EAAAA,GAAGC,EAAAA,cAAc,MAAOf,GAAYe,EAAAA,cAAc,aAAa,EAEzE,SAAApB,CAAA,CAAA,CACL,CAAA,CAAA,GAINE,GAASD,IACPoB,EAAAA,IAACG,EAAA,CACG,GAAIX,EACJ,SAAAD,EAEC,SAAAV,GAASD,CAAA,CAAA,CACd,CAAA,CAAA,CAIhB,CAAC,EAEDH,EAAO,YAAc"}
1
+ {"version":3,"file":"Switch.cjs","sources":["../../../../src/components/forms/switch/Switch.tsx"],"sourcesContent":["import { Switch as BaseSwitch } from '@base-ui/react/switch'\r\nimport { memo, useId, type FC } from 'react'\r\n\r\nimport { Typography } from '@components/foundation/typography'\r\nimport HelperText from '@components/forms/_shared/components/helper-text/HelperText.tsx'\r\nimport { Flex } from '@components/layout/flex'\r\nimport { cn } from '@utils/cn.ts'\r\nimport { SWITCH_STYLES } from '@components/forms/switch/styles/Switch.css.ts'\r\nimport type { SwitchProps } from '@components/forms/switch/types/Switch.props.ts'\r\n\r\n/**\r\n * A styled switch control built on top of `@base-ui/react/switch`.\r\n *\r\n * Supports controlled (`checked` + `onCheckedChange`) and uncontrolled\r\n * (`defaultChecked`) modes, plus an optional inline `label`.\r\n *\r\n * @example\r\n * ```tsx\r\n * <Switch label=\"Airplane mode\" checked={enabled} onCheckedChange={setEnabled} />\r\n * ```\r\n */\r\nconst Switch: FC<SwitchProps> = memo(({ label, helperText, error, id, className, disabled, size = 'md', onCheckedChange, ...props }) => {\r\n const generatedId = useId()\r\n const switchId = id ?? (label ? generatedId : undefined)\r\n const hasError = Boolean(error)\r\n const helperId = (helperText || error) ? `${switchId}-helper` : undefined\r\n\r\n return (\r\n <Flex\r\n as={'span'}\r\n inline\r\n flexDirection={'column'}\r\n gap={'xs'}\r\n alignItems={'start'}\r\n className={cn(SWITCH_STYLES.wrapper, disabled && SWITCH_STYLES.wrapperDisabled)}\r\n >\r\n <Flex\r\n as={'span'}\r\n inline\r\n gap={'sm'}\r\n alignItems={'center'}\r\n >\r\n <BaseSwitch.Root\r\n id={switchId}\r\n disabled={disabled}\r\n aria-describedby={helperId}\r\n aria-invalid={hasError || undefined}\r\n className={cn(SWITCH_STYLES.root({ size, error: hasError }), className)}\r\n onCheckedChange={onCheckedChange}\r\n {...props}\r\n >\r\n <BaseSwitch.Thumb className={SWITCH_STYLES.thumb({ size })} />\r\n </BaseSwitch.Root>\r\n\r\n {label && (\r\n <Typography\r\n as={'label'}\r\n variant={'label'}\r\n color={'foreground'}\r\n htmlFor={switchId}\r\n className={cn(SWITCH_STYLES.label, disabled && SWITCH_STYLES.labelDisabled)}\r\n >\r\n {label}\r\n </Typography>\r\n )}\r\n </Flex>\r\n\r\n {(error || helperText) && (\r\n <HelperText\r\n id={helperId}\r\n hasError={hasError}\r\n >\r\n {error ?? helperText}\r\n </HelperText>\r\n )}\r\n </Flex>\r\n )\r\n})\r\n\r\nSwitch.displayName = 'Switch'\r\n\r\nexport default Switch\r\n"],"names":["Switch","memo","label","helperText","error","id","className","disabled","size","onCheckedChange","props","generatedId","useId","switchId","hasError","helperId","jsxs","Flex","cn","SWITCH_STYLES","jsx","BaseSwitch","Typography","HelperText"],"mappings":"4cAqBMA,EAA0BC,EAAAA,KAAK,CAAC,CAAE,MAAAC,EAAO,WAAAC,EAAY,MAAAC,EAAO,GAAAC,EAAI,UAAAC,EAAW,SAAAC,EAAU,KAAAC,EAAO,KAAM,gBAAAC,EAAiB,GAAGC,KAAY,CACpI,MAAMC,EAAcC,EAAAA,MAAA,EACdC,EAAWR,IAAOH,EAAQS,EAAc,QACxCG,EAAW,EAAQV,EACnBW,EAAYZ,GAAcC,EAAS,GAAGS,CAAQ,UAAY,OAEhE,OACIG,EAAAA,KAACC,EAAA,CACG,GAAI,OACJ,OAAM,GACN,cAAe,SACf,IAAK,KACL,WAAY,QACZ,UAAWC,EAAAA,GAAGC,EAAAA,cAAc,QAASZ,GAAYY,EAAAA,cAAc,eAAe,EAE9E,SAAA,CAAAH,EAAAA,KAACC,EAAA,CACG,GAAI,OACJ,OAAM,GACN,IAAK,KACL,WAAY,SAEZ,SAAA,CAAAG,EAAAA,IAACC,EAAAA,OAAW,KAAX,CACG,GAAIR,EACJ,SAAAN,EACA,mBAAkBQ,EAClB,eAAcD,GAAY,OAC1B,UAAWI,EAAAA,GAAGC,EAAAA,cAAc,KAAK,CAAE,KAAAX,EAAM,MAAOM,EAAU,EAAGR,CAAS,EACtE,gBAAAG,EACC,GAAGC,EAEJ,SAAAU,EAAAA,IAACC,EAAAA,OAAW,MAAX,CAAiB,UAAWF,EAAAA,cAAc,MAAM,CAAE,KAAAX,CAAA,CAAM,CAAA,CAAG,CAAA,CAAA,EAG/DN,GACGkB,EAAAA,IAACE,EAAA,CACG,GAAI,QACJ,QAAS,QACT,MAAO,aACP,QAAST,EACT,UAAWK,EAAAA,GAAGC,EAAAA,cAAc,MAAOZ,GAAYY,EAAAA,cAAc,aAAa,EAEzE,SAAAjB,CAAA,CAAA,CACL,CAAA,CAAA,GAINE,GAASD,IACPiB,EAAAA,IAACG,EAAA,CACG,GAAIR,EACJ,SAAAD,EAEC,SAAAV,GAASD,CAAA,CAAA,CACd,CAAA,CAAA,CAIhB,CAAC,EAEDH,EAAO,YAAc"}
@@ -1,77 +1,74 @@
1
- import { jsxs as d, jsx as a } from "react/jsx-runtime";
2
- import { Switch as h } from "@base-ui/react/switch";
3
- import { memo as v, useId as x, useCallback as N } from "react";
4
- import y from "../../foundation/typography/Typography.js";
1
+ import { jsxs as p, jsx as i } from "react/jsx-runtime";
2
+ import { Switch as d } from "@base-ui/react/switch";
3
+ import { memo as S, useId as b } from "react";
4
+ import v from "../../foundation/typography/Typography.js";
5
5
  import "../../foundation/typography/styles/Typography.css.js";
6
- import C from "../_shared/components/helper-text/HelperText.js";
7
- import f from "../../layout/flex/Flex.js";
6
+ import x from "../_shared/components/helper-text/HelperText.js";
7
+ import h from "../../layout/flex/Flex.js";
8
8
  import "../../layout/flex/styles/Flex.css.js";
9
- import { cn as m } from "../../../utils/cn.js";
9
+ import { cn as n } from "../../../utils/cn.js";
10
10
  import { SWITCH_STYLES as r } from "./styles/Switch.css.js";
11
- const D = v(({ label: e, helperText: i, error: o, id: u, className: g, disabled: t, size: l = "md", onCheckedChange: c, ...b }) => {
12
- const w = x(), s = u ?? (e ? w : void 0), n = !!o, p = i || o ? `${s}-helper` : void 0, I = N(
13
- (S) => c?.(S, { reason: "none" }),
14
- [c]
15
- );
16
- return /* @__PURE__ */ d(
17
- f,
11
+ const N = S(({ label: a, helperText: t, error: o, id: f, className: u, disabled: e, size: l = "md", onCheckedChange: g, ...w }) => {
12
+ const I = b(), m = f ?? (a ? I : void 0), s = !!o, c = t || o ? `${m}-helper` : void 0;
13
+ return /* @__PURE__ */ p(
14
+ h,
18
15
  {
19
16
  as: "span",
20
17
  inline: !0,
21
18
  flexDirection: "column",
22
19
  gap: "xs",
23
20
  alignItems: "start",
24
- className: m(r.wrapper, t && r.wrapperDisabled),
21
+ className: n(r.wrapper, e && r.wrapperDisabled),
25
22
  children: [
26
- /* @__PURE__ */ d(
27
- f,
23
+ /* @__PURE__ */ p(
24
+ h,
28
25
  {
29
26
  as: "span",
30
27
  inline: !0,
31
28
  gap: "sm",
32
29
  alignItems: "center",
33
30
  children: [
34
- /* @__PURE__ */ a(
35
- h.Root,
31
+ /* @__PURE__ */ i(
32
+ d.Root,
36
33
  {
37
- id: s,
38
- disabled: t,
39
- "aria-describedby": p,
40
- "aria-invalid": n || void 0,
41
- className: m(r.root({ size: l, error: n }), g),
42
- onCheckedChange: I,
43
- ...b,
44
- children: /* @__PURE__ */ a(h.Thumb, { className: r.thumb({ size: l }) })
34
+ id: m,
35
+ disabled: e,
36
+ "aria-describedby": c,
37
+ "aria-invalid": s || void 0,
38
+ className: n(r.root({ size: l, error: s }), u),
39
+ onCheckedChange: g,
40
+ ...w,
41
+ children: /* @__PURE__ */ i(d.Thumb, { className: r.thumb({ size: l }) })
45
42
  }
46
43
  ),
47
- e && /* @__PURE__ */ a(
48
- y,
44
+ a && /* @__PURE__ */ i(
45
+ v,
49
46
  {
50
47
  as: "label",
51
48
  variant: "label",
52
49
  color: "foreground",
53
- htmlFor: s,
54
- className: m(r.label, t && r.labelDisabled),
55
- children: e
50
+ htmlFor: m,
51
+ className: n(r.label, e && r.labelDisabled),
52
+ children: a
56
53
  }
57
54
  )
58
55
  ]
59
56
  }
60
57
  ),
61
- (o || i) && /* @__PURE__ */ a(
62
- C,
58
+ (o || t) && /* @__PURE__ */ i(
59
+ x,
63
60
  {
64
- id: p,
65
- hasError: n,
66
- children: o ?? i
61
+ id: c,
62
+ hasError: s,
63
+ children: o ?? t
67
64
  }
68
65
  )
69
66
  ]
70
67
  }
71
68
  );
72
69
  });
73
- D.displayName = "Switch";
70
+ N.displayName = "Switch";
74
71
  export {
75
- D as default
72
+ N as default
76
73
  };
77
74
  //# sourceMappingURL=Switch.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.js","sources":["../../../../src/components/forms/switch/Switch.tsx"],"sourcesContent":["import { Switch as BaseSwitch } from '@base-ui/react/switch'\r\nimport { memo, useCallback, useId, type FC } from 'react'\r\n\r\nimport { Typography } from '@components/foundation/typography'\r\nimport HelperText from '@components/forms/_shared/components/helper-text/HelperText.tsx'\r\nimport { Flex } from '@components/layout/flex'\r\nimport { cn } from '@utils/cn.ts'\r\nimport { SWITCH_STYLES } from '@components/forms/switch/styles/Switch.css.ts'\r\nimport type { SwitchProps } from '@components/forms/switch/types/Switch.props.ts'\r\n\r\n/**\r\n * A styled switch control built on top of `@base-ui/react/switch`.\r\n *\r\n * Supports controlled (`checked` + `onCheckedChange`) and uncontrolled\r\n * (`defaultChecked`) modes, plus an optional inline `label`.\r\n *\r\n * @example\r\n * ```tsx\r\n * <Switch label=\"Airplane mode\" checked={enabled} onCheckedChange={setEnabled} />\r\n * ```\r\n */\r\nconst Switch: FC<SwitchProps> = memo(({ label, helperText, error, id, className, disabled, size = 'md', onCheckedChange, ...props }) => {\r\n const generatedId = useId()\r\n const switchId = id ?? (label ? generatedId : undefined)\r\n const hasError = Boolean(error)\r\n const helperId = (helperText || error) ? `${switchId}-helper` : undefined\r\n\r\n const handleCheckedChange = useCallback(\r\n (checked: boolean) => onCheckedChange?.(checked, { reason: 'none' } as never),\r\n [onCheckedChange],\r\n )\r\n\r\n return (\r\n <Flex\r\n as={'span'}\r\n inline\r\n flexDirection={'column'}\r\n gap={'xs'}\r\n alignItems={'start'}\r\n className={cn(SWITCH_STYLES.wrapper, disabled && SWITCH_STYLES.wrapperDisabled)}\r\n >\r\n <Flex\r\n as={'span'}\r\n inline\r\n gap={'sm'}\r\n alignItems={'center'}\r\n >\r\n <BaseSwitch.Root\r\n id={switchId}\r\n disabled={disabled}\r\n aria-describedby={helperId}\r\n aria-invalid={hasError || undefined}\r\n className={cn(SWITCH_STYLES.root({ size, error: hasError }), className)}\r\n onCheckedChange={handleCheckedChange}\r\n {...props}\r\n >\r\n <BaseSwitch.Thumb className={SWITCH_STYLES.thumb({ size })} />\r\n </BaseSwitch.Root>\r\n\r\n {label && (\r\n <Typography\r\n as={'label'}\r\n variant={'label'}\r\n color={'foreground'}\r\n htmlFor={switchId}\r\n className={cn(SWITCH_STYLES.label, disabled && SWITCH_STYLES.labelDisabled)}\r\n >\r\n {label}\r\n </Typography>\r\n )}\r\n </Flex>\r\n\r\n {(error || helperText) && (\r\n <HelperText\r\n id={helperId}\r\n hasError={hasError}\r\n >\r\n {error ?? helperText}\r\n </HelperText>\r\n )}\r\n </Flex>\r\n )\r\n})\r\n\r\nSwitch.displayName = 'Switch'\r\n\r\nexport default Switch\r\n"],"names":["Switch","memo","label","helperText","error","id","className","disabled","size","onCheckedChange","props","generatedId","useId","switchId","hasError","helperId","handleCheckedChange","useCallback","checked","jsxs","Flex","cn","SWITCH_STYLES","jsx","BaseSwitch","Typography","HelperText"],"mappings":";;;;;;;;;;AAqBA,MAAMA,IAA0BC,EAAK,CAAC,EAAE,OAAAC,GAAO,YAAAC,GAAY,OAAAC,GAAO,IAAAC,GAAI,WAAAC,GAAW,UAAAC,GAAU,MAAAC,IAAO,MAAM,iBAAAC,GAAiB,GAAGC,QAAY;AACpI,QAAMC,IAAcC,EAAA,GACdC,IAAWR,MAAOH,IAAQS,IAAc,SACxCG,IAAW,EAAQV,GACnBW,IAAYZ,KAAcC,IAAS,GAAGS,CAAQ,YAAY,QAE1DG,IAAsBC;AAAA,IACxB,CAACC,MAAqBT,IAAkBS,GAAS,EAAE,QAAQ,QAAiB;AAAA,IAC5E,CAACT,CAAe;AAAA,EAAA;AAGpB,SACI,gBAAAU;AAAA,IAACC;AAAA,IAAA;AAAA,MACG,IAAI;AAAA,MACJ,QAAM;AAAA,MACN,eAAe;AAAA,MACf,KAAK;AAAA,MACL,YAAY;AAAA,MACZ,WAAWC,EAAGC,EAAc,SAASf,KAAYe,EAAc,eAAe;AAAA,MAE9E,UAAA;AAAA,QAAA,gBAAAH;AAAA,UAACC;AAAA,UAAA;AAAA,YACG,IAAI;AAAA,YACJ,QAAM;AAAA,YACN,KAAK;AAAA,YACL,YAAY;AAAA,YAEZ,UAAA;AAAA,cAAA,gBAAAG;AAAA,gBAACC,EAAW;AAAA,gBAAX;AAAA,kBACG,IAAIX;AAAA,kBACJ,UAAAN;AAAA,kBACA,oBAAkBQ;AAAA,kBAClB,gBAAcD,KAAY;AAAA,kBAC1B,WAAWO,EAAGC,EAAc,KAAK,EAAE,MAAAd,GAAM,OAAOM,GAAU,GAAGR,CAAS;AAAA,kBACtE,iBAAiBU;AAAA,kBAChB,GAAGN;AAAA,kBAEJ,UAAA,gBAAAa,EAACC,EAAW,OAAX,EAAiB,WAAWF,EAAc,MAAM,EAAE,MAAAd,EAAA,CAAM,EAAA,CAAG;AAAA,gBAAA;AAAA,cAAA;AAAA,cAG/DN,KACG,gBAAAqB;AAAA,gBAACE;AAAA,gBAAA;AAAA,kBACG,IAAI;AAAA,kBACJ,SAAS;AAAA,kBACT,OAAO;AAAA,kBACP,SAASZ;AAAA,kBACT,WAAWQ,EAAGC,EAAc,OAAOf,KAAYe,EAAc,aAAa;AAAA,kBAEzE,UAAApB;AAAA,gBAAA;AAAA,cAAA;AAAA,YACL;AAAA,UAAA;AAAA,QAAA;AAAA,SAINE,KAASD,MACP,gBAAAoB;AAAA,UAACG;AAAA,UAAA;AAAA,YACG,IAAIX;AAAA,YACJ,UAAAD;AAAA,YAEC,UAAAV,KAASD;AAAA,UAAA;AAAA,QAAA;AAAA,MACd;AAAA,IAAA;AAAA,EAAA;AAIhB,CAAC;AAEDH,EAAO,cAAc;"}
1
+ {"version":3,"file":"Switch.js","sources":["../../../../src/components/forms/switch/Switch.tsx"],"sourcesContent":["import { Switch as BaseSwitch } from '@base-ui/react/switch'\r\nimport { memo, useId, type FC } from 'react'\r\n\r\nimport { Typography } from '@components/foundation/typography'\r\nimport HelperText from '@components/forms/_shared/components/helper-text/HelperText.tsx'\r\nimport { Flex } from '@components/layout/flex'\r\nimport { cn } from '@utils/cn.ts'\r\nimport { SWITCH_STYLES } from '@components/forms/switch/styles/Switch.css.ts'\r\nimport type { SwitchProps } from '@components/forms/switch/types/Switch.props.ts'\r\n\r\n/**\r\n * A styled switch control built on top of `@base-ui/react/switch`.\r\n *\r\n * Supports controlled (`checked` + `onCheckedChange`) and uncontrolled\r\n * (`defaultChecked`) modes, plus an optional inline `label`.\r\n *\r\n * @example\r\n * ```tsx\r\n * <Switch label=\"Airplane mode\" checked={enabled} onCheckedChange={setEnabled} />\r\n * ```\r\n */\r\nconst Switch: FC<SwitchProps> = memo(({ label, helperText, error, id, className, disabled, size = 'md', onCheckedChange, ...props }) => {\r\n const generatedId = useId()\r\n const switchId = id ?? (label ? generatedId : undefined)\r\n const hasError = Boolean(error)\r\n const helperId = (helperText || error) ? `${switchId}-helper` : undefined\r\n\r\n return (\r\n <Flex\r\n as={'span'}\r\n inline\r\n flexDirection={'column'}\r\n gap={'xs'}\r\n alignItems={'start'}\r\n className={cn(SWITCH_STYLES.wrapper, disabled && SWITCH_STYLES.wrapperDisabled)}\r\n >\r\n <Flex\r\n as={'span'}\r\n inline\r\n gap={'sm'}\r\n alignItems={'center'}\r\n >\r\n <BaseSwitch.Root\r\n id={switchId}\r\n disabled={disabled}\r\n aria-describedby={helperId}\r\n aria-invalid={hasError || undefined}\r\n className={cn(SWITCH_STYLES.root({ size, error: hasError }), className)}\r\n onCheckedChange={onCheckedChange}\r\n {...props}\r\n >\r\n <BaseSwitch.Thumb className={SWITCH_STYLES.thumb({ size })} />\r\n </BaseSwitch.Root>\r\n\r\n {label && (\r\n <Typography\r\n as={'label'}\r\n variant={'label'}\r\n color={'foreground'}\r\n htmlFor={switchId}\r\n className={cn(SWITCH_STYLES.label, disabled && SWITCH_STYLES.labelDisabled)}\r\n >\r\n {label}\r\n </Typography>\r\n )}\r\n </Flex>\r\n\r\n {(error || helperText) && (\r\n <HelperText\r\n id={helperId}\r\n hasError={hasError}\r\n >\r\n {error ?? helperText}\r\n </HelperText>\r\n )}\r\n </Flex>\r\n )\r\n})\r\n\r\nSwitch.displayName = 'Switch'\r\n\r\nexport default Switch\r\n"],"names":["Switch","memo","label","helperText","error","id","className","disabled","size","onCheckedChange","props","generatedId","useId","switchId","hasError","helperId","jsxs","Flex","cn","SWITCH_STYLES","jsx","BaseSwitch","Typography","HelperText"],"mappings":";;;;;;;;;;AAqBA,MAAMA,IAA0BC,EAAK,CAAC,EAAE,OAAAC,GAAO,YAAAC,GAAY,OAAAC,GAAO,IAAAC,GAAI,WAAAC,GAAW,UAAAC,GAAU,MAAAC,IAAO,MAAM,iBAAAC,GAAiB,GAAGC,QAAY;AACpI,QAAMC,IAAcC,EAAA,GACdC,IAAWR,MAAOH,IAAQS,IAAc,SACxCG,IAAW,EAAQV,GACnBW,IAAYZ,KAAcC,IAAS,GAAGS,CAAQ,YAAY;AAEhE,SACI,gBAAAG;AAAA,IAACC;AAAA,IAAA;AAAA,MACG,IAAI;AAAA,MACJ,QAAM;AAAA,MACN,eAAe;AAAA,MACf,KAAK;AAAA,MACL,YAAY;AAAA,MACZ,WAAWC,EAAGC,EAAc,SAASZ,KAAYY,EAAc,eAAe;AAAA,MAE9E,UAAA;AAAA,QAAA,gBAAAH;AAAA,UAACC;AAAA,UAAA;AAAA,YACG,IAAI;AAAA,YACJ,QAAM;AAAA,YACN,KAAK;AAAA,YACL,YAAY;AAAA,YAEZ,UAAA;AAAA,cAAA,gBAAAG;AAAA,gBAACC,EAAW;AAAA,gBAAX;AAAA,kBACG,IAAIR;AAAA,kBACJ,UAAAN;AAAA,kBACA,oBAAkBQ;AAAA,kBAClB,gBAAcD,KAAY;AAAA,kBAC1B,WAAWI,EAAGC,EAAc,KAAK,EAAE,MAAAX,GAAM,OAAOM,GAAU,GAAGR,CAAS;AAAA,kBACtE,iBAAAG;AAAA,kBACC,GAAGC;AAAA,kBAEJ,UAAA,gBAAAU,EAACC,EAAW,OAAX,EAAiB,WAAWF,EAAc,MAAM,EAAE,MAAAX,EAAA,CAAM,EAAA,CAAG;AAAA,gBAAA;AAAA,cAAA;AAAA,cAG/DN,KACG,gBAAAkB;AAAA,gBAACE;AAAA,gBAAA;AAAA,kBACG,IAAI;AAAA,kBACJ,SAAS;AAAA,kBACT,OAAO;AAAA,kBACP,SAAST;AAAA,kBACT,WAAWK,EAAGC,EAAc,OAAOZ,KAAYY,EAAc,aAAa;AAAA,kBAEzE,UAAAjB;AAAA,gBAAA;AAAA,cAAA;AAAA,YACL;AAAA,UAAA;AAAA,QAAA;AAAA,SAINE,KAASD,MACP,gBAAAiB;AAAA,UAACG;AAAA,UAAA;AAAA,YACG,IAAIR;AAAA,YACJ,UAAAD;AAAA,YAEC,UAAAV,KAASD;AAAA,UAAA;AAAA,QAAA;AAAA,MACd;AAAA,IAAA;AAAA,EAAA;AAIhB,CAAC;AAEDH,EAAO,cAAc;"}
@@ -1,2 +1,2 @@
1
- "use strict";const e=require("react/jsx-runtime"),j=require("./components/text-area-label/TextAreaLabel.cjs");;/* empty css */;/* empty css */;/* empty css */const v=require("./components/text-area-start-icon/TextAreaStartIcon.cjs");;/* empty css */const z=require("./components/text-area-end-action/TextAreaEndAction.cjs");;/* empty css */const H=require("./styles/TextArea.css.cjs"),U=require("../_shared/components/helper-text/HelperText.cjs"),X=require("./hooks/useAutoResizeTextArea.hook.cjs"),Y=require("./hooks/useTextArea.hook.cjs"),E=require("../../layout/flex/Flex.cjs");require("../../layout/flex/styles/Flex.css.cjs");const G=require("../../../utils/cn.cjs"),t=require("react"),n=t.memo(u=>{const{inputId:l,helperId:d,hasError:o,hasStartIcon:I,hasEndAction:x,handleMouseDown:g,handleFocus:y,handleBlur:C}=Y.useTextArea(u),{disabled:h,startIcon:A,className:S,width:q,error:i,helperText:a,label:T,endAction:_,size:k,placeholder:D,value:m,onChange:p,onKeyDown:F,onKeyUp:L,ref:r,rows:c,minRows:R,maxRows:N,...B}=u,f=k??"md",w=t.useRef(null),K=t.useCallback(s=>{w.current=s,typeof r=="function"?r(s):r&&(r.current=s)},[r]),{isEnabled:M,resize:b}=X.useAutoResizeTextArea(w,{minRows:R??c,maxRows:N,value:m}),P=t.useCallback(s=>{p?.(s),b()},[p,b]);return e.jsxs(E,{flexDirection:"column",gap:"xs",width:"100%",alignItems:"start",style:q!==void 0?{width:q}:void 0,children:[T&&e.jsx(j,{htmlFor:l,disabled:h,children:T}),e.jsxs(E,{position:"relative",width:"100%",gap:"none",children:[A&&e.jsx(v,{icon:A,size:f}),e.jsx("textarea",{ref:K,id:l,disabled:h,"aria-invalid":o||void 0,"aria-describedby":i||a?d:void 0,onMouseDown:g,onFocus:y,onBlur:C,className:G.cn(H.TEXT_AREA_STYLES.recipe({size:f,hasError:o,hasStartIcon:I,hasEndAction:x}),S),placeholder:D,value:m,onChange:P,onKeyDown:F,onKeyUp:L,rows:M?R??c:c,...B}),x&&e.jsx(z,{children:_})]}),(i||a)&&e.jsx(U,{id:d,hasError:o,children:i??a})]})});n.displayName="TextArea";n.Label=j;n.StartIcon=v;n.EndAction=z;module.exports=n;
1
+ "use strict";const e=require("react/jsx-runtime"),j=require("./components/text-area-label/TextAreaLabel.cjs");;/* empty css */;/* empty css */;/* empty css */const v=require("./components/text-area-start-icon/TextAreaStartIcon.cjs");;/* empty css */const z=require("./components/text-area-end-action/TextAreaEndAction.cjs");;/* empty css */const H=require("./styles/TextArea.css.cjs"),U=require("../_shared/components/helper-text/HelperText.cjs"),X=require("./hooks/useAutoResizeTextArea.hook.cjs"),Y=require("./hooks/useTextArea.hook.cjs"),E=require("../../layout/flex/Flex.cjs");require("../../layout/flex/styles/Flex.css.cjs");const G=require("../../../utils/cn.cjs"),t=require("react"),n=t.memo(u=>{const{inputId:l,helperId:d,hasError:o,hasStartIcon:I,hasEndAction:x,handleMouseDown:g,handleFocus:y,handleBlur:C}=Y.useTextArea(u),{disabled:h,startIcon:A,className:S,width:q,error:i,helperText:a,label:T,endAction:_,size:k,placeholder:D,value:m,onChange:p,onKeyDown:F,onKeyUp:L,ref:r,rows:c,minRows:f,maxRows:N,...B}=u,w=k??"md",R=t.useRef(null),K=t.useCallback(s=>{R.current=s,typeof r=="function"?r(s):r&&(r.current=s)},[r]),{isEnabled:M,resize:b}=X.useAutoResizeTextArea(R,{minRows:f??c,maxRows:N,value:m}),P=t.useCallback(s=>{p?.(s),b()},[p,b]);return e.jsxs(E,{flexDirection:"column",gap:"xs",width:"100%",alignItems:"start",style:q!==void 0?{width:q}:void 0,children:[T&&e.jsx(j,{htmlFor:l,disabled:h,children:T}),e.jsxs(E,{position:"relative",width:"100%",gap:"none",children:[A&&e.jsx(v,{icon:A,size:w}),e.jsx("textarea",{ref:K,id:l,disabled:h,"aria-invalid":o||void 0,"aria-describedby":i||a?d:void 0,onMouseDown:g,onFocus:y,onBlur:C,className:G.cn(H.TEXT_AREA_STYLES.recipe({size:w,hasError:o,hasStartIcon:I,hasEndAction:x}),S),placeholder:D,value:m,onChange:P,onKeyDown:F,onKeyUp:L,rows:M?f??c:c,...B}),x&&e.jsx(z,{children:_})]}),(i||a)&&e.jsx(U,{id:d,hasError:o,children:i??a})]})});n.displayName="TextArea";n.Label=j;n.StartIcon=v;n.EndAction=z;module.exports=n;
2
2
  //# sourceMappingURL=TextArea.cjs.map
@@ -1,2 +1,2 @@
1
- "use strict";const r=require("react/jsx-runtime"),s=require("react"),o=require("./styles/TextAreaEndAction.css.cjs"),c=require("../../../../layout/box/Box.cjs");require("../../../../layout/box/styles/Box.css.cjs");const e=s.memo(({children:t})=>r.jsx(c,{className:o.TEXT_AREA_END_ACTION_STYLES.root,children:t}));e.displayName="TextArea.EndAction";module.exports=e;
1
+ "use strict";const t=require("react/jsx-runtime"),s=require("react"),o=require("./styles/TextAreaEndAction.css.cjs"),c=require("../../../../layout/box/Box.cjs");require("../../../../layout/box/styles/Box.css.cjs");const e=s.memo(({children:r})=>t.jsx(c,{className:o.TEXT_AREA_END_ACTION_STYLES.root,children:r}));e.displayName="TextArea.EndAction";module.exports=e;
2
2
  //# sourceMappingURL=TextAreaEndAction.cjs.map
@@ -0,0 +1,5 @@
1
+ export declare const TEXT_AREA_SIZES: {
2
+ readonly sm: "sm";
3
+ readonly md: "md";
4
+ readonly lg: "lg";
5
+ };
@@ -5,5 +5,6 @@ export { TEXT_AREA_START_ICON_STYLES } from './components/text-area-start-icon/s
5
5
  export { TEXT_AREA_END_ACTION_STYLES } from './components/text-area-end-action/styles/TextAreaEndAction.css.ts';
6
6
  export type { TextAreaProps } from './types/TextArea.props.ts';
7
7
  export type { TextAreaSize } from './types/TextArea.types.ts';
8
+ export type { TextAreaEndActionProps } from './components/text-area-end-action/types/TextAreaEndAction.props.ts';
8
9
  export type { TextAreaLabelProps } from './components/text-area-label/types/TextAreaLabel.props.ts';
9
10
  export type { TextAreaStartIconProps } from './components/text-area-start-icon/types/TextAreaStartIcon.types.ts';
@@ -1,4 +1,4 @@
1
- import { RecipeVariants, RuntimeFn } from '@vanilla-extract/recipes';
1
+ import { RuntimeFn } from '@vanilla-extract/recipes';
2
2
  export declare const TEXT_AREA_STYLES: {
3
3
  recipe: RuntimeFn<{
4
4
  size: {
@@ -50,4 +50,3 @@ export declare const TEXT_AREA_STYLES: {
50
50
  };
51
51
  }>;
52
52
  };
53
- export type TextAreaRecipeVariants = NonNullable<RecipeVariants<typeof TEXT_AREA_STYLES.recipe>>;
@@ -1,7 +1,7 @@
1
1
  import { RefAttributes } from 'react';
2
- import { TextAreaRecipeVariants } from '../styles/TextArea.css.ts';
2
+ import { TextAreaSize } from './TextArea.types.ts';
3
3
  import type * as React from 'react';
4
- export type TextAreaProps = Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'size'> & RefAttributes<HTMLTextAreaElement> & Pick<TextAreaRecipeVariants, 'size'> & {
4
+ export type TextAreaProps = Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'size'> & RefAttributes<HTMLTextAreaElement> & {
5
5
  /** Text label rendered above the textarea, linked via Radix Label for accessibility. */
6
6
  label?: string;
7
7
  /** Helper text rendered below the textarea. Hidden when `error` is provided. */
@@ -14,6 +14,8 @@ export type TextAreaProps = Omit<React.TextareaHTMLAttributes<HTMLTextAreaElemen
14
14
  endAction?: React.ReactNode;
15
15
  /** CSS width of the outer wrapper. Defaults to `100%`. */
16
16
  width?: React.CSSProperties['width'];
17
+ /** Size variant of the textarea. Defaults to `md`. */
18
+ size?: TextAreaSize;
17
19
  /** Number of visible text lines. Maps to the native `rows` attribute. */
18
20
  rows?: number;
19
21
  /** Minimum number of visible text lines when auto-resizing. */
@@ -1,2 +1,3 @@
1
+ import { TEXT_AREA_SIZES } from '../constants';
1
2
  /** Size variants for the TextArea component. */
2
- export type TextAreaSize = 'sm' | 'md' | 'lg';
3
+ export type TextAreaSize = (typeof TEXT_AREA_SIZES)[keyof typeof TEXT_AREA_SIZES];
@@ -1,2 +1,2 @@
1
- "use strict";const e=require("react/jsx-runtime"),H=require("../../actions/icon-button/IconButton.cjs");require("../../actions/icon-button/styles/IconButton.css.cjs");const F=require("./components/text-field-label/TextFieldLabel.cjs");;/* empty css */;/* empty css */;/* empty css */const I=require("./components/text-field-start-icon/TextFieldStartIcon.cjs");;/* empty css */const m=require("./components/text-field-end-action/TextFieldEndAction.cjs");;/* empty css */const K=require("./styles/TextField.css.cjs"),M=require("../_shared/components/helper-text/HelperText.cjs"),O=require("./constants/index.cjs"),U=require("./hooks/useTextfield.hook.cjs"),T=require("../../layout/flex/Flex.cjs");require("../../layout/flex/styles/Flex.css.cjs");const w=require("../../../constants/icons.cjs"),X=require("../../../utils/cn.cjs"),y=require("react"),r=y.memo(c=>{const{inputId:d,helperId:l,hasError:o,hasStartIcon:b,hasEndAction:a,handleMouseDown:v,handleFocus:g,handleBlur:j,resolvedType:S,isPassword:E,showPassword:i,setShowPassword:u}=U.useTextField(c),{disabled:h,startIcon:x,className:f,width:p,error:s,helperText:n,label:q,endAction:z,size:A,placeholder:P,value:D,onChange:_,onKeyDown:L,onKeyUp:R,ref:k,type:Y,...B}=c,t=A??"md",C=y.useCallback(()=>u(!i),[u,i]),N=E?e.jsx(H,{icon:i?w.IconRegistry.eyeOff:w.IconRegistry.eye,"aria-label":i?"Hide password":"Show password",variant:"ghost",color:"primary",size:O.fieldSizeToActionSize[t],type:"button",tabIndex:-1,onClick:C}):z;return e.jsxs(T,{flexDirection:"column",gap:"xs",width:"100%",alignItems:"start",style:p!==void 0?{width:p}:void 0,children:[q&&e.jsx(F,{htmlFor:d,disabled:h,children:q}),e.jsxs(T,{position:"relative",width:"100%",gap:"none",children:[x&&e.jsx(I,{icon:x,size:t}),e.jsx("input",{ref:k,id:d,type:S,disabled:h,"aria-invalid":o||void 0,"aria-describedby":s||n?l:void 0,onMouseDown:v,onFocus:g,onBlur:j,className:X.cn(K.TEXT_FIELD_STYLES.recipe({size:t,hasError:o,hasStartIcon:b,hasEndAction:a}),f),placeholder:P,value:D,onChange:_,onKeyDown:L,onKeyUp:R,...B}),a&&e.jsx(m,{children:N})]}),(s||n)&&e.jsx(M,{id:l,hasError:o,children:s??n})]})});r.displayName="TextField";r.Label=F;r.StartIcon=I;r.EndAction=m;module.exports=r;
1
+ "use strict";const e=require("react/jsx-runtime"),H=require("../../actions/icon-button/IconButton.cjs");require("../../actions/icon-button/styles/IconButton.css.cjs");const F=require("./components/text-field-label/TextFieldLabel.cjs");;/* empty css */;/* empty css */;/* empty css */const I=require("./components/text-field-start-icon/TextFieldStartIcon.cjs");;/* empty css */const m=require("./components/text-field-end-action/TextFieldEndAction.cjs");;/* empty css */const K=require("./styles/TextField.css.cjs"),M=require("../_shared/components/helper-text/HelperText.cjs"),O=require("./constants/index.cjs"),U=require("./hooks/useTextfield.hook.cjs"),T=require("../../layout/flex/Flex.cjs");require("../../layout/flex/styles/Flex.css.cjs");const w=require("../../../constants/icons.cjs"),X=require("../../../utils/cn.cjs"),y=require("react"),r=y.memo(c=>{const{inputId:d,helperId:l,hasError:o,hasStartIcon:b,hasEndAction:a,handleMouseDown:v,handleFocus:g,handleBlur:j,resolvedType:S,isPassword:E,showPassword:i,setShowPassword:u}=U.useTextField(c),{disabled:h,startIcon:x,className:f,width:p,error:s,helperText:n,label:q,endAction:z,size:A,placeholder:P,value:D,onChange:_,onKeyDown:L,onKeyUp:k,ref:B,type:Y,...C}=c,t=A??"md",N=y.useCallback(()=>u(!i),[u,i]),R=E?e.jsx(H,{icon:i?w.IconRegistry.eyeOff:w.IconRegistry.eye,"aria-label":i?"Hide password":"Show password",variant:"ghost",color:"primary",size:O.fieldSizeToActionSize[t],type:"button",tabIndex:-1,onClick:N}):z;return e.jsxs(T,{flexDirection:"column",gap:"xs",width:"100%",alignItems:"start",style:p!==void 0?{width:p}:void 0,children:[q&&e.jsx(F,{htmlFor:d,disabled:h,children:q}),e.jsxs(T,{position:"relative",width:"100%",gap:"none",children:[x&&e.jsx(I,{icon:x,size:t}),e.jsx("input",{ref:B,id:d,type:S,disabled:h,"aria-invalid":o||void 0,"aria-describedby":s||n?l:void 0,onMouseDown:v,onFocus:g,onBlur:j,className:X.cn(K.TEXT_FIELD_STYLES.recipe({size:t,hasError:o,hasStartIcon:b,hasEndAction:a}),f),placeholder:P,value:D,onChange:_,onKeyDown:L,onKeyUp:k,...C}),a&&e.jsx(m,{children:R})]}),(s||n)&&e.jsx(M,{id:l,hasError:o,children:s??n})]})});r.displayName="TextField";r.Label=F;r.StartIcon=I;r.EndAction=m;module.exports=r;
2
2
  //# sourceMappingURL=TextField.cjs.map
@@ -4,3 +4,4 @@ export { default as TextFieldStartIcon } from './text-field-start-icon/TextField
4
4
  export { TEXT_FIELD_START_ICON_STYLES } from './text-field-start-icon/styles/TextFieldStartIcon.css.ts';
5
5
  export { default as TextFieldEndAction } from './text-field-end-action/TextFieldEndAction.tsx';
6
6
  export { TEXT_FIELD_END_ACTION_STYLES } from './text-field-end-action/styles/TextFieldEndAction.css.ts';
7
+ export type { TextFieldEndActionProps } from './text-field-end-action/types/TextFieldEndAction.props.ts';
@@ -1 +1 @@
1
- {"version":3,"file":"TextFieldEndAction.cjs","sources":["../../../../../../src/components/forms/text-field/components/text-field-end-action/TextFieldEndAction.tsx"],"sourcesContent":["import { memo, type FC, type ReactNode } from 'react'\r\nimport { TEXT_FIELD_END_ACTION_STYLES } from '@components/forms/text-field/components/text-field-end-action/styles/TextFieldEndAction.css.ts'\r\n\r\ntype TextFieldEndActionProps = {\r\n children: ReactNode\r\n}\r\n\r\nconst TextFieldEndAction: FC<TextFieldEndActionProps> = memo(({ children }) => (\r\n <span className={TEXT_FIELD_END_ACTION_STYLES.root}>\r\n {children}\r\n </span>\r\n))\r\n\r\nTextFieldEndAction.displayName = 'TextField.EndAction'\r\n\r\nexport default TextFieldEndAction\r\n"],"names":["TextFieldEndAction","memo","children","jsx","TEXT_FIELD_END_ACTION_STYLES"],"mappings":"sHAOMA,EAAkDC,EAAAA,KAAK,CAAC,CAAE,SAAAC,CAAA,IAC5DC,EAAAA,IAAC,OAAA,CAAK,UAAWC,EAAAA,6BAA6B,KACzC,SAAAF,CAAA,CACL,CACH,EAEDF,EAAmB,YAAc"}
1
+ {"version":3,"file":"TextFieldEndAction.cjs","sources":["../../../../../../src/components/forms/text-field/components/text-field-end-action/TextFieldEndAction.tsx"],"sourcesContent":["import { memo, type FC } from 'react'\r\nimport { TEXT_FIELD_END_ACTION_STYLES } from '@components/forms/text-field/components/text-field-end-action/styles/TextFieldEndAction.css.ts'\r\nimport type { TextFieldEndActionProps } from '@components/forms/text-field/components/text-field-end-action/types/TextFieldEndAction.props.ts'\r\n\r\nconst TextFieldEndAction: FC<TextFieldEndActionProps> = memo(({ children }) => (\r\n <span className={TEXT_FIELD_END_ACTION_STYLES.root}>\r\n {children}\r\n </span>\r\n))\r\n\r\nTextFieldEndAction.displayName = 'TextField.EndAction'\r\n\r\nexport default TextFieldEndAction\r\n"],"names":["TextFieldEndAction","memo","children","jsx","TEXT_FIELD_END_ACTION_STYLES"],"mappings":"sHAIMA,EAAkDC,EAAAA,KAAK,CAAC,CAAE,SAAAC,CAAA,IAC5DC,EAAAA,IAAC,OAAA,CAAK,UAAWC,EAAAA,6BAA6B,KACzC,SAAAF,CAAA,CACL,CACH,EAEDF,EAAmB,YAAc"}
@@ -1,6 +1,4 @@
1
- import { FC, ReactNode } from 'react';
2
- type TextFieldEndActionProps = {
3
- children: ReactNode;
4
- };
1
+ import { FC } from 'react';
2
+ import { TextFieldEndActionProps } from './types/TextFieldEndAction.props.ts';
5
3
  declare const TextFieldEndAction: FC<TextFieldEndActionProps>;
6
4
  export default TextFieldEndAction;
@@ -1 +1 @@
1
- {"version":3,"file":"TextFieldEndAction.js","sources":["../../../../../../src/components/forms/text-field/components/text-field-end-action/TextFieldEndAction.tsx"],"sourcesContent":["import { memo, type FC, type ReactNode } from 'react'\r\nimport { TEXT_FIELD_END_ACTION_STYLES } from '@components/forms/text-field/components/text-field-end-action/styles/TextFieldEndAction.css.ts'\r\n\r\ntype TextFieldEndActionProps = {\r\n children: ReactNode\r\n}\r\n\r\nconst TextFieldEndAction: FC<TextFieldEndActionProps> = memo(({ children }) => (\r\n <span className={TEXT_FIELD_END_ACTION_STYLES.root}>\r\n {children}\r\n </span>\r\n))\r\n\r\nTextFieldEndAction.displayName = 'TextField.EndAction'\r\n\r\nexport default TextFieldEndAction\r\n"],"names":["TextFieldEndAction","memo","children","jsx","TEXT_FIELD_END_ACTION_STYLES"],"mappings":";;;AAOA,MAAMA,IAAkDC,EAAK,CAAC,EAAE,UAAAC,EAAA,MAC5D,gBAAAC,EAAC,QAAA,EAAK,WAAWC,EAA6B,MACzC,UAAAF,EAAA,CACL,CACH;AAEDF,EAAmB,cAAc;"}
1
+ {"version":3,"file":"TextFieldEndAction.js","sources":["../../../../../../src/components/forms/text-field/components/text-field-end-action/TextFieldEndAction.tsx"],"sourcesContent":["import { memo, type FC } from 'react'\r\nimport { TEXT_FIELD_END_ACTION_STYLES } from '@components/forms/text-field/components/text-field-end-action/styles/TextFieldEndAction.css.ts'\r\nimport type { TextFieldEndActionProps } from '@components/forms/text-field/components/text-field-end-action/types/TextFieldEndAction.props.ts'\r\n\r\nconst TextFieldEndAction: FC<TextFieldEndActionProps> = memo(({ children }) => (\r\n <span className={TEXT_FIELD_END_ACTION_STYLES.root}>\r\n {children}\r\n </span>\r\n))\r\n\r\nTextFieldEndAction.displayName = 'TextField.EndAction'\r\n\r\nexport default TextFieldEndAction\r\n"],"names":["TextFieldEndAction","memo","children","jsx","TEXT_FIELD_END_ACTION_STYLES"],"mappings":";;;AAIA,MAAMA,IAAkDC,EAAK,CAAC,EAAE,UAAAC,EAAA,MAC5D,gBAAAC,EAAC,QAAA,EAAK,WAAWC,EAA6B,MACzC,UAAAF,EAAA,CACL,CACH;AAEDF,EAAmB,cAAc;"}
@@ -0,0 +1,5 @@
1
+ import { ReactNode } from 'react';
2
+ /** Props for the `TextField.EndAction` slot. */
3
+ export type TextFieldEndActionProps = {
4
+ children: ReactNode;
5
+ };
@@ -1,2 +1,2 @@
1
- "use strict";const i=require("react/jsx-runtime"),l=require("react"),o=require("./styles/TextFieldLabel.css.cjs"),e=l.memo(({htmlFor:s,disabled:t,children:a})=>i.jsx("label",{htmlFor:s,className:o.TEXT_FIELD_LABEL_STYLES.root,"data-disabled":t?"":void 0,children:a}));e.displayName="TextField.Label";module.exports=e;
1
+ "use strict";const i=require("react/jsx-runtime"),l=require("react"),r=require("./styles/TextFieldLabel.css.cjs"),e=l.memo(({htmlFor:s,disabled:t,children:a})=>i.jsx("label",{htmlFor:s,className:r.TEXT_FIELD_LABEL_STYLES.root,"data-disabled":t?"":void 0,children:a}));e.displayName="TextField.Label";module.exports=e;
2
2
  //# sourceMappingURL=TextFieldLabel.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../../../src/components/forms/text-field/constants/index.ts"],"sourcesContent":["import type { TextFieldSize } from '@components'\r\n\r\n/** Maps field size to the IconButton size used in the end-action slot. */\r\nexport const fieldSizeToActionSize: Record<NonNullable<TextFieldSize>, 'sm' | 'md'> = {\r\n sm: 'sm',\r\n md: 'sm',\r\n lg: 'md',\r\n}\r\n"],"names":["fieldSizeToActionSize"],"mappings":"gFAGO,MAAMA,EAAyE,CAClF,GAAI,KACJ,GAAI,KACJ,GAAI,IACR"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../../../src/components/forms/text-field/constants/index.ts"],"sourcesContent":["import type { TextFieldSize } from '@components'\r\n\r\n/** Maps field size to the IconButton size used in the end-action slot. */\r\nexport const fieldSizeToActionSize: Record<NonNullable<TextFieldSize>, 'sm' | 'md'> = {\r\n sm: 'sm',\r\n md: 'sm',\r\n lg: 'md',\r\n}\r\n\r\nexport const TEXT_FIELD_SIZES = {\r\n sm: 'sm',\r\n md: 'md',\r\n lg: 'lg',\r\n} as const\r\n"],"names":["fieldSizeToActionSize"],"mappings":"gFAGO,MAAMA,EAAyE,CAClF,GAAI,KACJ,GAAI,KACJ,GAAI,IACR"}
@@ -1,3 +1,8 @@
1
1
  import { TextFieldSize } from '../../..';
2
2
  /** Maps field size to the IconButton size used in the end-action slot. */
3
3
  export declare const fieldSizeToActionSize: Record<NonNullable<TextFieldSize>, 'sm' | 'md'>;
4
+ export declare const TEXT_FIELD_SIZES: {
5
+ readonly sm: "sm";
6
+ readonly md: "md";
7
+ readonly lg: "lg";
8
+ };