@arkyn/components 3.0.2 → 3.0.4

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 (196) hide show
  1. package/README.md +24 -24
  2. package/dist/components/alert/alertContainer/index.d.ts +7 -7
  3. package/dist/components/alert/alertContent/index.d.ts +1 -1
  4. package/dist/components/alert/alertDescription/index.d.ts +1 -1
  5. package/dist/components/alert/alertIcon/index.d.ts +1 -1
  6. package/dist/components/alert/alertTitle/index.d.ts +1 -1
  7. package/dist/components/audioPlayer/index.d.ts +1 -1
  8. package/dist/components/audioUpload/index.d.ts +2 -2
  9. package/dist/components/badge/index.d.ts +1 -1
  10. package/dist/components/button/index.d.ts +1 -1
  11. package/dist/components/cardTab/cardTabButton/index.d.ts +1 -1
  12. package/dist/components/cardTab/cardTabContainer/index.d.ts +1 -1
  13. package/dist/components/checkbox/index.d.ts +3 -3
  14. package/dist/components/checkbox/index.d.ts.map +1 -1
  15. package/dist/components/clientOnly.d.ts +2 -2
  16. package/dist/components/clientOnly.d.ts.map +1 -1
  17. package/dist/components/currencyInput/index.d.ts +2 -2
  18. package/dist/components/datePicker/datePickerCalendarContainer/index.d.ts +9 -0
  19. package/dist/components/datePicker/datePickerCalendarContainer/index.d.ts.map +1 -0
  20. package/dist/components/datePicker/datePickerChevron/index.d.ts +11 -0
  21. package/dist/components/datePicker/datePickerChevron/index.d.ts.map +1 -0
  22. package/dist/components/datePicker/datePickerContainer/index.d.ts +19 -0
  23. package/dist/components/datePicker/datePickerContainer/index.d.ts.map +1 -0
  24. package/dist/components/datePicker/datePickerContent/index.d.ts +9 -0
  25. package/dist/components/datePicker/datePickerContent/index.d.ts.map +1 -0
  26. package/dist/components/datePicker/datePickerOverlay/index.d.ts +8 -0
  27. package/dist/components/datePicker/datePickerOverlay/index.d.ts.map +1 -0
  28. package/dist/components/datePicker/datePickerSpinner/index.d.ts +8 -0
  29. package/dist/components/datePicker/datePickerSpinner/index.d.ts.map +1 -0
  30. package/dist/components/datePicker/index.d.ts +155 -0
  31. package/dist/components/datePicker/index.d.ts.map +1 -0
  32. package/dist/components/divider/index.d.ts +1 -1
  33. package/dist/components/drawer/drawerContainer/index.d.ts +1 -1
  34. package/dist/components/drawer/drawerHeader/index.d.ts +1 -1
  35. package/dist/components/facebookPixel/index.d.ts +1 -1
  36. package/dist/components/fieldError/index.d.ts +1 -1
  37. package/dist/components/fieldLabel/index.d.ts +1 -1
  38. package/dist/components/fieldWrapper/index.d.ts +1 -1
  39. package/dist/components/fileUpload/index.d.ts +2 -2
  40. package/dist/components/googleAnalytics/index.d.ts +1 -1
  41. package/dist/components/googleTagManager/index.d.ts +1 -1
  42. package/dist/components/iconButton/index.d.ts +1 -1
  43. package/dist/components/imageUpload/index.d.ts +2 -2
  44. package/dist/components/input/index.d.ts +1 -1
  45. package/dist/components/mapView/index.d.ts +2 -2
  46. package/dist/components/mapView/index.d.ts.map +1 -1
  47. package/dist/components/maskedInput/index.d.ts +3 -3
  48. package/dist/components/modal/modalContainer/index.d.ts +1 -1
  49. package/dist/components/modal/modalFooter/index.d.ts +1 -1
  50. package/dist/components/modal/modalHeader/index.d.ts +1 -1
  51. package/dist/components/multiSelect/index.d.ts +1 -1
  52. package/dist/components/pagination/index.d.ts +1 -1
  53. package/dist/components/phoneInput/index.d.ts +2 -2
  54. package/dist/components/phoneInput/index.d.ts.map +1 -1
  55. package/dist/components/popover/index.d.ts +2 -2
  56. package/dist/components/popover/index.d.ts.map +1 -1
  57. package/dist/components/radio/radioBox/index.d.ts +4 -4
  58. package/dist/components/radio/radioGroup/index.d.ts +3 -3
  59. package/dist/components/richText/index.d.ts +3 -3
  60. package/dist/components/searchPlaces.d.ts +3 -3
  61. package/dist/components/select/index.d.ts +1 -1
  62. package/dist/components/slider/index.d.ts +1 -1
  63. package/dist/components/switch/index.d.ts +3 -3
  64. package/dist/components/switch/index.d.ts.map +1 -1
  65. package/dist/components/tab/tabButton/index.d.ts +1 -1
  66. package/dist/components/tab/tabContainer/index.d.ts +1 -1
  67. package/dist/components/table/tableBody/index.d.ts +1 -1
  68. package/dist/components/table/tableCaption/index.d.ts +2 -2
  69. package/dist/components/table/tableContainer/index.d.ts +1 -1
  70. package/dist/components/table/tableFooter/index.d.ts +1 -1
  71. package/dist/components/table/tableHeader/index.d.ts +2 -2
  72. package/dist/components/textarea/index.d.ts +1 -1
  73. package/dist/components/tooltip/index.d.ts +1 -1
  74. package/dist/hooks/useAutomation.d.ts +1 -1
  75. package/dist/hooks/useDrawer.d.ts +5 -5
  76. package/dist/hooks/useForm.d.ts +2 -2
  77. package/dist/hooks/useHydrated.d.ts +1 -1
  78. package/dist/hooks/useModal.d.ts +5 -5
  79. package/dist/hooks/useScopedParams.d.ts +5 -5
  80. package/dist/hooks/useScrollLock.d.ts +2 -2
  81. package/dist/hooks/useSearchAutomation.d.ts +6 -6
  82. package/dist/hooks/useSlider.d.ts +2 -2
  83. package/dist/hooks/useToast.d.ts +1 -1
  84. package/dist/index.d.ts +1 -0
  85. package/dist/index.d.ts.map +1 -1
  86. package/dist/index.js +642 -389
  87. package/dist/index.js.map +1 -1
  88. package/dist/modules/components/alert/alertContainer/index.js.map +1 -1
  89. package/dist/modules/components/alert/alertContent/index.js.map +1 -1
  90. package/dist/modules/components/alert/alertDescription/index.js.map +1 -1
  91. package/dist/modules/components/alert/alertIcon/index.js.map +1 -1
  92. package/dist/modules/components/alert/alertTitle/index.js.map +1 -1
  93. package/dist/modules/components/audioPlayer/index.js.map +1 -1
  94. package/dist/modules/components/audioUpload/index.js.map +1 -1
  95. package/dist/modules/components/badge/index.js.map +1 -1
  96. package/dist/modules/components/button/index.js.map +1 -1
  97. package/dist/modules/components/cardTab/cardTabButton/index.js.map +1 -1
  98. package/dist/modules/components/cardTab/cardTabContainer/index.js.map +1 -1
  99. package/dist/modules/components/checkbox/index.js.map +1 -1
  100. package/dist/modules/components/clientOnly.js.map +1 -1
  101. package/dist/modules/components/currencyInput/index.js.map +1 -1
  102. package/dist/modules/components/datePicker/datePickerCalendarContainer/index.js +25 -0
  103. package/dist/modules/components/datePicker/datePickerCalendarContainer/index.js.map +1 -0
  104. package/dist/modules/components/datePicker/datePickerCalendarContainer/styles.css +1 -0
  105. package/dist/modules/components/datePicker/datePickerChevron/index.js +21 -0
  106. package/dist/modules/components/datePicker/datePickerChevron/index.js.map +1 -0
  107. package/dist/modules/components/datePicker/datePickerChevron/styles.css +1 -0
  108. package/dist/modules/components/datePicker/datePickerContainer/index.js +16 -0
  109. package/dist/modules/components/datePicker/datePickerContainer/index.js.map +1 -0
  110. package/dist/modules/components/datePicker/datePickerContainer/styles.css +1 -0
  111. package/dist/modules/components/datePicker/datePickerContent/index.js +14 -0
  112. package/dist/modules/components/datePicker/datePickerContent/index.js.map +1 -0
  113. package/dist/modules/components/datePicker/datePickerContent/styles.css +1 -0
  114. package/dist/modules/components/datePicker/datePickerOverlay/index.js +14 -0
  115. package/dist/modules/components/datePicker/datePickerOverlay/index.js.map +1 -0
  116. package/dist/modules/components/datePicker/datePickerOverlay/styles.css +1 -0
  117. package/dist/modules/components/datePicker/datePickerSpinner/index.js +16 -0
  118. package/dist/modules/components/datePicker/datePickerSpinner/index.js.map +1 -0
  119. package/dist/modules/components/datePicker/datePickerSpinner/styles.css +1 -0
  120. package/dist/modules/components/datePicker/index.js +194 -0
  121. package/dist/modules/components/datePicker/index.js.map +1 -0
  122. package/dist/modules/components/datePicker/styles.css +79 -0
  123. package/dist/modules/components/divider/index.js.map +1 -1
  124. package/dist/modules/components/drawer/drawerContainer/index.js.map +1 -1
  125. package/dist/modules/components/drawer/drawerHeader/index.js.map +1 -1
  126. package/dist/modules/components/facebookPixel/index.js.map +1 -1
  127. package/dist/modules/components/fieldError/index.js.map +1 -1
  128. package/dist/modules/components/fieldLabel/index.js.map +1 -1
  129. package/dist/modules/components/fieldWrapper/index.js.map +1 -1
  130. package/dist/modules/components/fileUpload/index.js.map +1 -1
  131. package/dist/modules/components/googleAnalytics/index.js.map +1 -1
  132. package/dist/modules/components/googleTagManager/index.js.map +1 -1
  133. package/dist/modules/components/iconButton/index.js.map +1 -1
  134. package/dist/modules/components/imageUpload/index.js.map +1 -1
  135. package/dist/modules/components/input/index.js.map +1 -1
  136. package/dist/modules/components/mapView/index.js.map +1 -1
  137. package/dist/modules/components/maskedInput/index.js.map +1 -1
  138. package/dist/modules/components/modal/modalContainer/index.js.map +1 -1
  139. package/dist/modules/components/modal/modalFooter/index.js.map +1 -1
  140. package/dist/modules/components/modal/modalHeader/index.js.map +1 -1
  141. package/dist/modules/components/multiSelect/index.js.map +1 -1
  142. package/dist/modules/components/pagination/index.js.map +1 -1
  143. package/dist/modules/components/phoneInput/index.js +68 -63
  144. package/dist/modules/components/phoneInput/index.js.map +1 -1
  145. package/dist/modules/components/popover/index.js.map +1 -1
  146. package/dist/modules/components/radio/radioBox/index.js.map +1 -1
  147. package/dist/modules/components/radio/radioGroup/index.js.map +1 -1
  148. package/dist/modules/components/richText/index.js.map +1 -1
  149. package/dist/modules/components/searchPlaces.js.map +1 -1
  150. package/dist/modules/components/select/index.js.map +1 -1
  151. package/dist/modules/components/slider/index.js.map +1 -1
  152. package/dist/modules/components/switch/index.js.map +1 -1
  153. package/dist/modules/components/tab/tabButton/index.js.map +1 -1
  154. package/dist/modules/components/tab/tabContainer/index.js.map +1 -1
  155. package/dist/modules/components/table/tableBody/index.js.map +1 -1
  156. package/dist/modules/components/table/tableCaption/index.js.map +1 -1
  157. package/dist/modules/components/table/tableContainer/index.js.map +1 -1
  158. package/dist/modules/components/table/tableFooter/index.js.map +1 -1
  159. package/dist/modules/components/table/tableHeader/index.js.map +1 -1
  160. package/dist/modules/components/textarea/index.js.map +1 -1
  161. package/dist/modules/components/tooltip/index.js.map +1 -1
  162. package/dist/modules/hooks/useAutomation.js.map +1 -1
  163. package/dist/modules/hooks/useDrawer.js.map +1 -1
  164. package/dist/modules/hooks/useForm.js.map +1 -1
  165. package/dist/modules/hooks/useHydrated.js.map +1 -1
  166. package/dist/modules/hooks/useModal.js.map +1 -1
  167. package/dist/modules/hooks/useScopedParams.js.map +1 -1
  168. package/dist/modules/hooks/useScrollLock.js.map +1 -1
  169. package/dist/modules/hooks/useSearchAutomation.js.map +1 -1
  170. package/dist/modules/hooks/useSlider.js.map +1 -1
  171. package/dist/modules/hooks/useToast.js.map +1 -1
  172. package/dist/modules/providers/drawerProvider.js.map +1 -1
  173. package/dist/modules/providers/formProvider.js.map +1 -1
  174. package/dist/modules/providers/modalProvider.js +27 -33
  175. package/dist/modules/providers/modalProvider.js.map +1 -1
  176. package/dist/modules/providers/placesProvider.js.map +1 -1
  177. package/dist/modules/providers/toastProvider.js.map +1 -1
  178. package/dist/modules/services/fieldTemplate.js +1 -0
  179. package/dist/modules/services/fieldTemplate.js.map +1 -1
  180. package/dist/modules/services/toHtml.js.map +1 -1
  181. package/dist/modules/services/toRichTextValue.js.map +1 -1
  182. package/dist/modules/utils/phoneInputUtilities.js +5 -5
  183. package/dist/modules/utils/phoneInputUtilities.js.map +1 -1
  184. package/dist/providers/drawerProvider.d.ts +1 -1
  185. package/dist/providers/formProvider.d.ts +1 -1
  186. package/dist/providers/modalProvider.d.ts +1 -1
  187. package/dist/providers/modalProvider.d.ts.map +1 -1
  188. package/dist/providers/placesProvider.d.ts +1 -1
  189. package/dist/providers/toastProvider.d.ts +1 -1
  190. package/dist/services/fieldTemplate.d.ts.map +1 -1
  191. package/dist/services/toHtml.d.ts +1 -1
  192. package/dist/services/toRichTextValue.d.ts +1 -1
  193. package/dist/style.css +1 -1
  194. package/dist/utils/phoneInputUtilities.d.ts +1 -1
  195. package/dist/utils/phoneInputUtilities.d.ts.map +1 -1
  196. package/package.json +17 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/popover/index.tsx"],"sourcesContent":["import { type ReactNode, useState } from \"react\";\n\nimport { useScrollLock } from \"../../hooks/useScrollLock\";\nimport \"./styles.css\";\n\ntype OrientationProps =\n\t| \"bottomLeft\"\n\t| \"bottomRight\"\n\t| \"topLeft\"\n\t| \"topRight\"\n\t| \"top\"\n\t| \"left\"\n\t| \"bottom\"\n\t| \"right\";\n\ntype PopoverProps = {\n\t/** Content rendered inside the floating panel. Required. */\n\tchildren: ReactNode;\n\t/** Trigger element clicking it opens the popover. Required. */\n\tbutton: ReactNode;\n\t/** When true, clicking the popover content also closes it. @default false */\n\tcloseOnClick?: boolean;\n\t/**\n\t * Position of the floating panel relative to the trigger.\n\t * Options: `\"bottomLeft\"` | `\"bottomRight\"` | `\"topLeft\"` | `\"topRight\"` | `\"top\"` | `\"bottom\"` | `\"left\"` | `\"right\"`.\n\t * @default \"bottomLeft\"\n\t */\n\torientation?: OrientationProps;\n\t/** Additional CSS class applied to the popover root element. */\n\tclassName?: string;\n};\n\n/**\n * Popover floating panel that appears relative to a trigger element.\n *\n * Clicking outside the popover (or clicking the content when `closeOnClick` is set)\n * dismisses it. Locks body scroll while open.\n *\n * @param props.children - Content to display inside the panel. Required.\n * @param props.button - Trigger element that opens the popover. Required.\n * @param props.closeOnClick - Clicking the content also closes the popover. Default: false\n * @param props.orientation - Panel position relative to the trigger. Default: \"bottomLeft\"\n * @param props.className - Additional CSS class for the root element.\n *\n * @returns Popover JSX element with trigger, animated panel, and outside-click overlay.\n *\n * @example\n * ```tsx\n * // Basic dropdown menu\n * <Popover button={<Button>Options</Button>} closeOnClick>\n * <ul>\n * <li onClick={handleEdit}>Edit</li>\n * <li onClick={handleDelete}>Delete</li>\n * </ul>\n * </Popover>\n *\n * // User profile menu (bottom-right)\n * <Popover\n * button={<IconButton icon={User} aria-label=\"Account\" />}\n * orientation=\"bottomRight\"\n * closeOnClick\n * >\n * <nav>\n * <a href=\"/profile\">Profile</a>\n * <a href=\"/settings\">Settings</a>\n * <a href=\"/logout\">Sign out</a>\n * </nav>\n * </Popover>\n *\n * // Filter panel (top-left)\n * <Popover button={<Badge>Filters</Badge>} orientation=\"topLeft\">\n * <Input name=\"search\" placeholder=\"Search...\" />\n * <Select name=\"status\" options={statusOptions} />\n * </Popover>\n * ```\n */\n\nfunction Popover(props: PopoverProps) {\n\tconst {\n\t\tchildren,\n\t\tbutton,\n\t\tcloseOnClick,\n\t\tclassName: baseClassName = \"\",\n\t\torientation = \"bottomLeft\",\n\t} = props;\n\tconst [isOpen, setIsOpen] = useState(false);\n\n\tconst visible = isOpen ? \"visibleTrue\" : \"visibleFalse\";\n\tconst className = `arkynPopover ${orientation} ${visible} ${baseClassName}`;\n\n\tfunction handleOpenPopover() {\n\t\tif (!isOpen) setIsOpen(true);\n\t}\n\n\tuseScrollLock(isOpen);\n\n\treturn (\n\t\t<div className={className} onClick={handleOpenPopover}>\n\t\t\t{button}\n\n\t\t\t<div\n\t\t\t\tstyle={{ visibility: isOpen ? \"visible\" : \"hidden\" }}\n\t\t\t\tonClick={() => closeOnClick && setIsOpen(false)}\n\t\t\t\tclassName=\"arkynPopoverContent\"\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\n\t\t\t{isOpen && (\n\t\t\t\t<div onClick={() => setIsOpen(false)} className=\"arkynPopoverOverlay\" />\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nexport { Popover };\n"],"mappings":";;;;;AA6EA,SAAS,EAAQ,GAAqB;CACrC,IAAM,EACL,aACA,WACA,iBACA,WAAW,IAAgB,IAC3B,iBAAc,iBACX,GACE,CAAC,GAAQ,KAAa,EAAS,EAAK,GAGpC,IAAY,gBAAgB,EAAY,GAD9B,IAAS,gBAAgB,eACgB,GAAG;CAE5D,SAAS,IAAoB;EAC5B,AAAK,KAAQ,EAAU,EAAI;CAC5B;CAIA,OAFA,EAAc,CAAM,GAGnB,kBAAC,OAAD;EAAgB;EAAW,SAAS;YAApC;GACE;GAED,kBAAC,OAAD;IACC,OAAO,EAAE,YAAY,IAAS,YAAY,SAAS;IACnD,eAAe,KAAgB,EAAU,EAAK;IAC9C,WAAU;IAET;GACG,CAAA;GAEJ,KACA,kBAAC,OAAD;IAAK,eAAe,EAAU,EAAK;IAAG,WAAU;GAAuB,CAAA;EAEpE;;AAEP"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/popover/index.tsx"],"sourcesContent":["import { type ReactNode, useState } from \"react\";\n\nimport { useScrollLock } from \"../../hooks/useScrollLock\";\nimport \"./styles.css\";\n\ntype OrientationProps =\n\t| \"bottomLeft\"\n\t| \"bottomRight\"\n\t| \"topLeft\"\n\t| \"topRight\"\n\t| \"top\"\n\t| \"left\"\n\t| \"bottom\"\n\t| \"right\";\n\ntype PopoverProps = {\n\t/** Content rendered inside the floating panel. Required. */\n\tchildren: ReactNode;\n\t/** Trigger element, clicking it opens the popover. Required. */\n\tbutton: ReactNode;\n\t/** When true, clicking the popover content also closes it. @default false */\n\tcloseOnClick?: boolean;\n\t/**\n\t * Position of the floating panel relative to the trigger.\n\t * Options: `\"bottomLeft\"` | `\"bottomRight\"` | `\"topLeft\"` | `\"topRight\"` | `\"top\"` | `\"bottom\"` | `\"left\"` | `\"right\"`.\n\t * @default \"bottomLeft\"\n\t */\n\torientation?: OrientationProps;\n\t/** Additional CSS class applied to the popover root element. */\n\tclassName?: string;\n};\n\n/**\n * Popover, floating panel that appears relative to a trigger element.\n *\n * Clicking outside the popover (or clicking the content when `closeOnClick` is set)\n * dismisses it. Locks body scroll while open.\n *\n * @param props.children - Content to display inside the panel. Required.\n * @param props.button - Trigger element that opens the popover. Required.\n * @param props.closeOnClick - Clicking the content also closes the popover. Default: false\n * @param props.orientation - Panel position relative to the trigger. Default: \"bottomLeft\"\n * @param props.className - Additional CSS class for the root element.\n *\n * @returns Popover JSX element with trigger, animated panel, and outside-click overlay.\n *\n * @example\n * ```tsx\n * // Basic dropdown menu\n * <Popover button={<Button>Options</Button>} closeOnClick>\n * <ul>\n * <li onClick={handleEdit}>Edit</li>\n * <li onClick={handleDelete}>Delete</li>\n * </ul>\n * </Popover>\n *\n * // User profile menu (bottom-right)\n * <Popover\n * button={<IconButton icon={User} aria-label=\"Account\" />}\n * orientation=\"bottomRight\"\n * closeOnClick\n * >\n * <nav>\n * <a href=\"/profile\">Profile</a>\n * <a href=\"/settings\">Settings</a>\n * <a href=\"/logout\">Sign out</a>\n * </nav>\n * </Popover>\n *\n * // Filter panel (top-left)\n * <Popover button={<Badge>Filters</Badge>} orientation=\"topLeft\">\n * <Input name=\"search\" placeholder=\"Search...\" />\n * <Select name=\"status\" options={statusOptions} />\n * </Popover>\n * ```\n */\n\nfunction Popover(props: PopoverProps) {\n\tconst {\n\t\tchildren,\n\t\tbutton,\n\t\tcloseOnClick,\n\t\tclassName: baseClassName = \"\",\n\t\torientation = \"bottomLeft\",\n\t} = props;\n\tconst [isOpen, setIsOpen] = useState(false);\n\n\tconst visible = isOpen ? \"visibleTrue\" : \"visibleFalse\";\n\tconst className = `arkynPopover ${orientation} ${visible} ${baseClassName}`;\n\n\tfunction handleOpenPopover() {\n\t\tif (!isOpen) setIsOpen(true);\n\t}\n\n\tuseScrollLock(isOpen);\n\n\treturn (\n\t\t<div className={className} onClick={handleOpenPopover}>\n\t\t\t{button}\n\n\t\t\t<div\n\t\t\t\tstyle={{ visibility: isOpen ? \"visible\" : \"hidden\" }}\n\t\t\t\tonClick={() => closeOnClick && setIsOpen(false)}\n\t\t\t\tclassName=\"arkynPopoverContent\"\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\n\t\t\t{isOpen && (\n\t\t\t\t<div onClick={() => setIsOpen(false)} className=\"arkynPopoverOverlay\" />\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nexport { Popover };\n"],"mappings":";;;;;AA6EA,SAAS,EAAQ,GAAqB;CACrC,IAAM,EACL,aACA,WACA,iBACA,WAAW,IAAgB,IAC3B,iBAAc,iBACX,GACE,CAAC,GAAQ,KAAa,EAAS,EAAK,GAGpC,IAAY,gBAAgB,EAAY,GAD9B,IAAS,gBAAgB,eACgB,GAAG;CAE5D,SAAS,IAAoB;EAC5B,AAAK,KAAQ,EAAU,EAAI;CAC5B;CAIA,OAFA,EAAc,CAAM,GAGnB,kBAAC,OAAD;EAAgB;EAAW,SAAS;YAApC;GACE;GAED,kBAAC,OAAD;IACC,OAAO,EAAE,YAAY,IAAS,YAAY,SAAS;IACnD,eAAe,KAAgB,EAAU,EAAK;IAC9C,WAAU;IAET;GACG,CAAA;GAEJ,KACA,kBAAC,OAAD;IAAK,eAAe,EAAU,EAAK;IAAG,WAAU;GAAuB,CAAA;EAEpE;;AAEP"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/radio/radioBox/index.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes } from \"react\";\n\nimport { useRadioGroup } from \"../radioContext\";\nimport \"./styles.css\";\n\ntype RadioBoxProps = ButtonHTMLAttributes<HTMLButtonElement> & {\n\t/** Value submitted to the form when this option is selected. Required. */\n\tvalue: string;\n\t/** Applies error styling. Inherited from `RadioGroup` when not set. */\n\tisError?: boolean;\n\t/** Size variant. Inherits from `RadioGroup` when not set. */\n\tsize?: \"sm\" | \"md\" | \"lg\";\n};\n\n/**\n * RadioBox individual option inside a `RadioGroup`. Renders as a `<label>` + hidden `<button>` pair.\n *\n * Reads active value, size, error state, and disabled state from `RadioGroup` context.\n * Must be used as a direct child of `RadioGroup`.\n *\n * @param props.value - Option value. Required.\n * @param props.children - Option label content (text, icons, or rich markup).\n * @param props.disabled - Disables this option (group can also disable all options).\n * @param props.size - Size override. Inherits from group by default.\n *\n * **...Other valid HTML `<button>` properties**\n *\n * @returns RadioBox JSX element.\n *\n * @example\n * ```tsx\n * <RadioGroup name=\"plan\" label=\"Choose a plan\" onChange={setPlan}>\n * <RadioBox value=\"basic\">Basic $9/mo</RadioBox>\n * <RadioBox value=\"pro\">Pro $29/mo</RadioBox>\n * <RadioBox value=\"enterprise\" disabled>Enterprise contact us</RadioBox>\n * </RadioGroup>\n * ```\n */\n\nfunction RadioBox(props: RadioBoxProps) {\n\tconst {\n\t\tvalue: componentValue,\n\t\tsize: componentSize,\n\t\tdisabled,\n\t\tchildren,\n\t\tclassName: baseClassName = \"\",\n\t\tonClick,\n\t\tonFocus,\n\t\t...rest\n\t} = props;\n\n\tconst {\n\t\thandleChange,\n\t\tsize: groupSize,\n\t\tvalue,\n\t\tisError,\n\t\tdisabled: groupDisabled,\n\t} = useRadioGroup();\n\n\tconst isChecked = value === componentValue;\n\tconst size = componentSize || groupSize;\n\n\tconst isDisabled = disabled || groupDisabled;\n\n\tconst checkedClass = isChecked ? \"checkedTrue\" : \"checkedFalse\";\n\tconst errorClass = isError ? \"errorTrue\" : \"errorFalse\";\n\tconst disabledClass = isDisabled ? \"disabledTrue\" : \"disabledFalse\";\n\tconst className = `arkynRadioBox ${size} ${checkedClass} ${errorClass} ${disabledClass} ${baseClassName}`;\n\n\tfunction handleClick(event: React.MouseEvent<HTMLButtonElement>) {\n\t\tonClick?.(event);\n\t\thandleChange(componentValue);\n\t}\n\n\tfunction handleFocus(event: React.FocusEvent<HTMLButtonElement>) {\n\t\tonFocus?.(event);\n\t\thandleChange(componentValue);\n\t}\n\n\treturn (\n\t\t<label className={className.trim()}>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tdisabled={isDisabled}\n\t\t\t\tonClick={handleClick}\n\t\t\t\tonFocus={handleFocus}\n\t\t\t\t{...rest}\n\t\t\t/>\n\n\t\t\t{children}\n\t\t</label>\n\t);\n}\n\nexport { RadioBox };\n"],"mappings":";;;;AAuCA,SAAS,EAAS,GAAsB;CACvC,IAAM,EACL,OAAO,GACP,MAAM,GACN,aACA,aACA,WAAW,IAAgB,IAC3B,YACA,YACA,GAAG,MACA,GAEE,EACL,iBACA,MAAM,GACN,UACA,YACA,UAAU,MACP,EAAc,GAEZ,IAAY,MAAU,GACtB,IAAO,KAAiB,GAExB,IAAa,KAAY,GAKzB,IAAY,iBAAiB,EAAK,GAHnB,IAAY,gBAAgB,eAGO,GAFrC,IAAU,cAAc,aAE2B,GADhD,IAAa,iBAAiB,gBACmC,GAAG;CAE1F,SAAS,EAAY,GAA4C;EAEhE,AADA,IAAU,CAAK,GACf,EAAa,CAAc;CAC5B;CAEA,SAAS,EAAY,GAA4C;EAEhE,AADA,IAAU,CAAK,GACf,EAAa,CAAc;CAC5B;CAEA,OACC,kBAAC,SAAD;EAAO,WAAW,EAAU,KAAK;YAAjC,CACC,kBAAC,UAAD;GACC,MAAK;GACL,UAAU;GACV,SAAS;GACT,SAAS;GACT,GAAI;EACJ,CAAA,GAEA,CACK;;AAET"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/radio/radioBox/index.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes } from \"react\";\n\nimport { useRadioGroup } from \"../radioContext\";\nimport \"./styles.css\";\n\ntype RadioBoxProps = ButtonHTMLAttributes<HTMLButtonElement> & {\n\t/** Value submitted to the form when this option is selected. Required. */\n\tvalue: string;\n\t/** Applies error styling. Inherited from `RadioGroup` when not set. */\n\tisError?: boolean;\n\t/** Size variant. Inherits from `RadioGroup` when not set. */\n\tsize?: \"sm\" | \"md\" | \"lg\";\n};\n\n/**\n * RadioBox, individual option inside a `RadioGroup`. Renders as a `<label>` + hidden `<button>` pair.\n *\n * Reads active value, size, error state, and disabled state from `RadioGroup` context.\n * Must be used as a direct child of `RadioGroup`.\n *\n * @param props.value - Option value. Required.\n * @param props.children - Option label content (text, icons, or rich markup).\n * @param props.disabled - Disables this option (group can also disable all options).\n * @param props.size - Size override. Inherits from group by default.\n *\n * **...Other valid HTML `<button>` properties**\n *\n * @returns RadioBox JSX element.\n *\n * @example\n * ```tsx\n * <RadioGroup name=\"plan\" label=\"Choose a plan\" onChange={setPlan}>\n * <RadioBox value=\"basic\">Basic, $9/mo</RadioBox>\n * <RadioBox value=\"pro\">Pro, $29/mo</RadioBox>\n * <RadioBox value=\"enterprise\" disabled>Enterprise, contact us</RadioBox>\n * </RadioGroup>\n * ```\n */\n\nfunction RadioBox(props: RadioBoxProps) {\n\tconst {\n\t\tvalue: componentValue,\n\t\tsize: componentSize,\n\t\tdisabled,\n\t\tchildren,\n\t\tclassName: baseClassName = \"\",\n\t\tonClick,\n\t\tonFocus,\n\t\t...rest\n\t} = props;\n\n\tconst {\n\t\thandleChange,\n\t\tsize: groupSize,\n\t\tvalue,\n\t\tisError,\n\t\tdisabled: groupDisabled,\n\t} = useRadioGroup();\n\n\tconst isChecked = value === componentValue;\n\tconst size = componentSize || groupSize;\n\n\tconst isDisabled = disabled || groupDisabled;\n\n\tconst checkedClass = isChecked ? \"checkedTrue\" : \"checkedFalse\";\n\tconst errorClass = isError ? \"errorTrue\" : \"errorFalse\";\n\tconst disabledClass = isDisabled ? \"disabledTrue\" : \"disabledFalse\";\n\tconst className = `arkynRadioBox ${size} ${checkedClass} ${errorClass} ${disabledClass} ${baseClassName}`;\n\n\tfunction handleClick(event: React.MouseEvent<HTMLButtonElement>) {\n\t\tonClick?.(event);\n\t\thandleChange(componentValue);\n\t}\n\n\tfunction handleFocus(event: React.FocusEvent<HTMLButtonElement>) {\n\t\tonFocus?.(event);\n\t\thandleChange(componentValue);\n\t}\n\n\treturn (\n\t\t<label className={className.trim()}>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tdisabled={isDisabled}\n\t\t\t\tonClick={handleClick}\n\t\t\t\tonFocus={handleFocus}\n\t\t\t\t{...rest}\n\t\t\t/>\n\n\t\t\t{children}\n\t\t</label>\n\t);\n}\n\nexport { RadioBox };\n"],"mappings":";;;;AAuCA,SAAS,EAAS,GAAsB;CACvC,IAAM,EACL,OAAO,GACP,MAAM,GACN,aACA,aACA,WAAW,IAAgB,IAC3B,YACA,YACA,GAAG,MACA,GAEE,EACL,iBACA,MAAM,GACN,UACA,YACA,UAAU,MACP,EAAc,GAEZ,IAAY,MAAU,GACtB,IAAO,KAAiB,GAExB,IAAa,KAAY,GAKzB,IAAY,iBAAiB,EAAK,GAHnB,IAAY,gBAAgB,eAGO,GAFrC,IAAU,cAAc,aAE2B,GADhD,IAAa,iBAAiB,gBACmC,GAAG;CAE1F,SAAS,EAAY,GAA4C;EAEhE,AADA,IAAU,CAAK,GACf,EAAa,CAAc;CAC5B;CAEA,SAAS,EAAY,GAA4C;EAEhE,AADA,IAAU,CAAK,GACf,EAAa,CAAc;CAC5B;CAEA,OACC,kBAAC,SAAD;EAAO,WAAW,EAAU,KAAK;YAAjC,CACC,kBAAC,UAAD;GACC,MAAK;GACL,UAAU;GACV,SAAS;GACT,SAAS;GACT,GAAI;EACJ,CAAA,GAEA,CACK;;AAET"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/radio/radioGroup/index.tsx"],"sourcesContent":["import { type HTMLAttributes, useState } from \"react\";\n\nimport { useForm } from \"../../../hooks/useForm\";\nimport { FieldTemplate } from \"../../../services/fieldTemplate\";\n\nimport { RadioProvider } from \"../radioContext\";\nimport \"./styles.css\";\n\ntype RadioGroupProps = Omit<HTMLAttributes<HTMLDivElement>, \"onChange\"> & {\n\t/** Field name used for form submission. Required. */\n\tname: string;\n\t/** Label displayed above the group. */\n\tlabel?: string;\n\t/** Appends an asterisk to the label. @default false */\n\tshowAsterisk?: boolean;\n\t/** Error message shown below the group. Overrides `fieldErrors[name]` from `FormProvider`. */\n\terrorMessage?: string;\n\t/** Controlled selected value. */\n\tvalue?: string;\n\t/** Initial selected value (uncontrolled). @default \"\" */\n\tdefaultValue?: string;\n\t/** Callback fired when the selected option changes. */\n\tonChange?: (value: string) => void;\n\t/** Size variant applied to all `RadioBox` children. @default \"md\" */\n\tsize?: \"sm\" | \"md\" | \"lg\";\n\t/** Disables all `RadioBox` children. @default false */\n\tdisabled?: boolean;\n\t/** When `true`, skips the `FieldTemplate` wrapper (label, error message). @default false */\n\tunShowFieldTemplate?: boolean;\n\t/** Layout direction of the `FieldWrapper`. @default \"horizontal\" */\n\torientation?: \"horizontal\" | \"vertical\" | \"horizontalReverse\";\n};\n\n/**\n * RadioGroup managed group of `RadioBox` options with form integration.\n *\n * Renders a hidden `<input>` for native form submission. Reads `fieldErrors[name]` from\n * the nearest `FormProvider` when no `errorMessage` is explicitly provided.\n *\n * @param props.name - Form field name. Required.\n * @param props.label - Label displayed above the group.\n * @param props.showAsterisk - Appends `*` to the label. Default: false\n * @param props.value - Controlled selection.\n * @param props.defaultValue - Initial selection (uncontrolled). Default: `\"\"`\n * @param props.onChange - Called with the newly selected value.\n * @param props.size - Size for all child `RadioBox` elements. Default: `\"md\"`\n * @param props.disabled - Disables all options. Default: false\n * @param props.errorMessage - Validation error message.\n * @param props.unShowFieldTemplate - Omit label/error wrapper. Default: false\n *\n * **...Other valid HTML `<div>` properties**\n *\n * @returns RadioGroup JSX element.\n *\n * @example\n * ```tsx\n * // Uncontrolled with label\n * <RadioGroup name=\"gender\" label=\"Gender\" showAsterisk defaultValue=\"male\">\n * <RadioBox value=\"male\">Male</RadioBox>\n * <RadioBox value=\"female\">Female</RadioBox>\n * <RadioBox value=\"other\">Other</RadioBox>\n * </RadioGroup>\n *\n * // Controlled with change handler\n * <RadioGroup name=\"plan\" label=\"Subscription plan\" value={plan} onChange={setPlan}>\n * <RadioBox value=\"basic\">Basic $9/mo</RadioBox>\n * <RadioBox value=\"pro\">Pro $29/mo</RadioBox>\n * </RadioGroup>\n * ```\n */\n\nfunction RadioGroup(props: RadioGroupProps) {\n\tconst {\n\t\tdefaultValue = \"\",\n\t\tname,\n\t\tlabel,\n\t\tshowAsterisk,\n\t\terrorMessage: baseErrorMessage,\n\t\tvalue: forceValue,\n\t\tonChange,\n\t\tsize = \"md\",\n\t\tclassName: wrapperClassName = \"\",\n\t\tdisabled = false,\n\t\tunShowFieldTemplate = false,\n\t\torientation = \"vertical\",\n\t\t...rest\n\t} = props;\n\n\tconst [value, setValue] = useState(defaultValue);\n\tconst { fieldErrors } = useForm();\n\n\tfunction handleChange(value: string) {\n\t\tsetValue(value);\n\t\tif (onChange) onChange(value);\n\t}\n\n\tconst errorMessage = baseErrorMessage || fieldErrors?.[name];\n\tconst isError = !!errorMessage;\n\tconst className = `arkynRadioGroup ${size}`;\n\n\treturn (\n\t\t<FieldTemplate\n\t\t\tname={name}\n\t\t\tlabel={label}\n\t\t\tshowAsterisk={showAsterisk}\n\t\t\tclassName={wrapperClassName}\n\t\t\terrorMessage={errorMessage}\n\t\t\tunShowFieldTemplate={unShowFieldTemplate}\n\t\t\torientation={orientation}\n\t\t>\n\t\t\t<RadioProvider\n\t\t\t\tisError={isError}\n\t\t\t\tsize={size}\n\t\t\t\tvalue={forceValue || value}\n\t\t\t\thandleChange={handleChange}\n\t\t\t\tdisabled={disabled}\n\t\t\t>\n\t\t\t\t<input\n\t\t\t\t\tstyle={{ display: \"none\" }}\n\t\t\t\t\ttype=\"text\"\n\t\t\t\t\treadOnly\n\t\t\t\t\tname={name}\n\t\t\t\t\tvalue={forceValue || value}\n\t\t\t\t/>\n\n\t\t\t\t<div className={className.trim()} {...rest} />\n\t\t\t</RadioProvider>\n\t\t</FieldTemplate>\n\t);\n}\n\nexport { RadioGroup };\n"],"mappings":";;;;;;;AAuEA,SAAS,EAAW,GAAwB;CAC3C,IAAM,EACL,kBAAe,IACf,SACA,UACA,iBACA,cAAc,GACd,OAAO,GACP,aACA,UAAO,MACP,WAAW,IAAmB,IAC9B,cAAW,IACX,yBAAsB,IACtB,iBAAc,YACd,GAAG,MACA,GAEE,CAAC,GAAO,KAAY,EAAS,CAAY,GACzC,EAAE,mBAAgB,EAAQ;CAEhC,SAAS,EAAa,GAAe;EAEpC,AADA,EAAS,CAAK,GACV,KAAU,EAAS,CAAK;CAC7B;CAEA,IAAM,IAAe,KAAoB,IAAc,IACjD,IAAU,CAAC,CAAC,GACZ,IAAY,mBAAmB;CAErC,OACC,kBAAC,GAAD;EACO;EACC;EACO;EACd,WAAW;EACG;EACO;EACR;YAEb,kBAAC,GAAD;GACU;GACH;GACN,OAAO,KAAc;GACP;GACJ;aALX,CAOC,kBAAC,SAAD;IACC,OAAO,EAAE,SAAS,OAAO;IACzB,MAAK;IACL,UAAA;IACM;IACN,OAAO,KAAc;GACrB,CAAA,GAED,kBAAC,OAAD;IAAK,WAAW,EAAU,KAAK;IAAG,GAAI;GAAO,CAAA,CAC/B;;CACD,CAAA;AAEjB"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/radio/radioGroup/index.tsx"],"sourcesContent":["import { type HTMLAttributes, useState } from \"react\";\n\nimport { useForm } from \"../../../hooks/useForm\";\nimport { FieldTemplate } from \"../../../services/fieldTemplate\";\n\nimport { RadioProvider } from \"../radioContext\";\nimport \"./styles.css\";\n\ntype RadioGroupProps = Omit<HTMLAttributes<HTMLDivElement>, \"onChange\"> & {\n\t/** Field name used for form submission. Required. */\n\tname: string;\n\t/** Label displayed above the group. */\n\tlabel?: string;\n\t/** Appends an asterisk to the label. @default false */\n\tshowAsterisk?: boolean;\n\t/** Error message shown below the group. Overrides `fieldErrors[name]` from `FormProvider`. */\n\terrorMessage?: string;\n\t/** Controlled selected value. */\n\tvalue?: string;\n\t/** Initial selected value (uncontrolled). @default \"\" */\n\tdefaultValue?: string;\n\t/** Callback fired when the selected option changes. */\n\tonChange?: (value: string) => void;\n\t/** Size variant applied to all `RadioBox` children. @default \"md\" */\n\tsize?: \"sm\" | \"md\" | \"lg\";\n\t/** Disables all `RadioBox` children. @default false */\n\tdisabled?: boolean;\n\t/** When `true`, skips the `FieldTemplate` wrapper (label, error message). @default false */\n\tunShowFieldTemplate?: boolean;\n\t/** Layout direction of the `FieldWrapper`. @default \"horizontal\" */\n\torientation?: \"horizontal\" | \"vertical\" | \"horizontalReverse\";\n};\n\n/**\n * RadioGroup, managed group of `RadioBox` options with form integration.\n *\n * Renders a hidden `<input>` for native form submission. Reads `fieldErrors[name]` from\n * the nearest `FormProvider` when no `errorMessage` is explicitly provided.\n *\n * @param props.name - Form field name. Required.\n * @param props.label - Label displayed above the group.\n * @param props.showAsterisk - Appends `*` to the label. Default: false\n * @param props.value - Controlled selection.\n * @param props.defaultValue - Initial selection (uncontrolled). Default: `\"\"`\n * @param props.onChange - Called with the newly selected value.\n * @param props.size - Size for all child `RadioBox` elements. Default: `\"md\"`\n * @param props.disabled - Disables all options. Default: false\n * @param props.errorMessage - Validation error message.\n * @param props.unShowFieldTemplate - Omit label/error wrapper. Default: false\n *\n * **...Other valid HTML `<div>` properties**\n *\n * @returns RadioGroup JSX element.\n *\n * @example\n * ```tsx\n * // Uncontrolled with label\n * <RadioGroup name=\"gender\" label=\"Gender\" showAsterisk defaultValue=\"male\">\n * <RadioBox value=\"male\">Male</RadioBox>\n * <RadioBox value=\"female\">Female</RadioBox>\n * <RadioBox value=\"other\">Other</RadioBox>\n * </RadioGroup>\n *\n * // Controlled with change handler\n * <RadioGroup name=\"plan\" label=\"Subscription plan\" value={plan} onChange={setPlan}>\n * <RadioBox value=\"basic\">Basic, $9/mo</RadioBox>\n * <RadioBox value=\"pro\">Pro, $29/mo</RadioBox>\n * </RadioGroup>\n * ```\n */\n\nfunction RadioGroup(props: RadioGroupProps) {\n\tconst {\n\t\tdefaultValue = \"\",\n\t\tname,\n\t\tlabel,\n\t\tshowAsterisk,\n\t\terrorMessage: baseErrorMessage,\n\t\tvalue: forceValue,\n\t\tonChange,\n\t\tsize = \"md\",\n\t\tclassName: wrapperClassName = \"\",\n\t\tdisabled = false,\n\t\tunShowFieldTemplate = false,\n\t\torientation = \"vertical\",\n\t\t...rest\n\t} = props;\n\n\tconst [value, setValue] = useState(defaultValue);\n\tconst { fieldErrors } = useForm();\n\n\tfunction handleChange(value: string) {\n\t\tsetValue(value);\n\t\tif (onChange) onChange(value);\n\t}\n\n\tconst errorMessage = baseErrorMessage || fieldErrors?.[name];\n\tconst isError = !!errorMessage;\n\tconst className = `arkynRadioGroup ${size}`;\n\n\treturn (\n\t\t<FieldTemplate\n\t\t\tname={name}\n\t\t\tlabel={label}\n\t\t\tshowAsterisk={showAsterisk}\n\t\t\tclassName={wrapperClassName}\n\t\t\terrorMessage={errorMessage}\n\t\t\tunShowFieldTemplate={unShowFieldTemplate}\n\t\t\torientation={orientation}\n\t\t>\n\t\t\t<RadioProvider\n\t\t\t\tisError={isError}\n\t\t\t\tsize={size}\n\t\t\t\tvalue={forceValue || value}\n\t\t\t\thandleChange={handleChange}\n\t\t\t\tdisabled={disabled}\n\t\t\t>\n\t\t\t\t<input\n\t\t\t\t\tstyle={{ display: \"none\" }}\n\t\t\t\t\ttype=\"text\"\n\t\t\t\t\treadOnly\n\t\t\t\t\tname={name}\n\t\t\t\t\tvalue={forceValue || value}\n\t\t\t\t/>\n\n\t\t\t\t<div className={className.trim()} {...rest} />\n\t\t\t</RadioProvider>\n\t\t</FieldTemplate>\n\t);\n}\n\nexport { RadioGroup };\n"],"mappings":";;;;;;;AAuEA,SAAS,EAAW,GAAwB;CAC3C,IAAM,EACL,kBAAe,IACf,SACA,UACA,iBACA,cAAc,GACd,OAAO,GACP,aACA,UAAO,MACP,WAAW,IAAmB,IAC9B,cAAW,IACX,yBAAsB,IACtB,iBAAc,YACd,GAAG,MACA,GAEE,CAAC,GAAO,KAAY,EAAS,CAAY,GACzC,EAAE,mBAAgB,EAAQ;CAEhC,SAAS,EAAa,GAAe;EAEpC,AADA,EAAS,CAAK,GACV,KAAU,EAAS,CAAK;CAC7B;CAEA,IAAM,IAAe,KAAoB,IAAc,IACjD,IAAU,CAAC,CAAC,GACZ,IAAY,mBAAmB;CAErC,OACC,kBAAC,GAAD;EACO;EACC;EACO;EACd,WAAW;EACG;EACO;EACR;YAEb,kBAAC,GAAD;GACU;GACH;GACN,OAAO,KAAc;GACP;GACJ;aALX,CAOC,kBAAC,SAAD;IACC,OAAO,EAAE,SAAS,OAAO;IACzB,MAAK;IACL,UAAA;IACM;IACN,OAAO,KAAc;GACrB,CAAA,GAED,kBAAC,OAAD;IAAK,WAAW,EAAU,KAAK;IAAG,GAAI;GAAO,CAAA,CAC/B;;CACD,CAAA;AAEjB"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/richText/index.tsx"],"sourcesContent":["import isHotkey from \"is-hotkey\";\nimport {\n\tAlignCenter,\n\tAlignJustify,\n\tAlignLeft,\n\tAlignRight,\n\tBold,\n\tCode,\n\tHeading1,\n\tHeading2,\n\tItalic,\n\tQuote,\n\tUnderline,\n} from \"lucide-react\";\nimport { useCallback, useId, useMemo, useRef, useState } from \"react\";\nimport { createEditor, type Descendant } from \"slate\";\nimport { withHistory } from \"slate-history\";\nimport { Editable, Slate, withReact } from \"slate-react\";\nimport { useForm } from \"../../hooks/useForm\";\nimport { extractTextFromNode } from \"../../services/extractTextFromNode\";\nimport { FieldTemplate } from \"../../services/fieldTemplate\";\nimport { toggleMark } from \"../../services/toggleMark\";\nimport { hotKeys, initialValue } from \"../../templates/richTextTemplates\";\nimport type {\n\tRichTextHiddenButtonKey,\n\tRichTextProps,\n} from \"../../types/richTextTypes\";\nimport { BlockButton } from \"./blockButton\";\nimport { Element } from \"./element\";\nimport { InsertImage } from \"./insertImage\";\nimport { InsertVideo } from \"./insertVideo\";\nimport { Leaf } from \"./leaf\";\nimport { MarkButton } from \"./markButton\";\nimport { Toolbar } from \"./toolbar\";\nimport \"./styles.css\";\n\n/**\n * RichText — WYSIWYG rich-text editor built on Slate.js with a configurable toolbar.\n *\n * **Toolbar features:** bold, italic, underline, code, H1/H2, block quote, alignment (left/center/right/justify), image and video insertion.\n *\n * Editor content is stored as a Slate JSON string in a hidden `<input>` for form submission.\n * Integrates with `useForm` to display validation errors by field name.\n *\n * @param props.name - Field name for form submission. Required.\n * @param props.label - Label text displayed above the editor.\n * @param props.hiddenButtons - Toolbar button keys to hide (e.g. `[\"image\", \"code\"]`).\n * @param props.imageConfig - Enables image insertion; contains the upload endpoint and modal labels.\n * @param props.defaultValue - Initial editor content as a Slate JSON string. Default: \"[]\"\n * @param props.maxLimit - Maximum character count. Default: 10000\n * @param props.enforceCharacterLimit - Prevents typing past `maxLimit`. Default: false\n * @param props.onChangeCharactersCount - Callback fired on every keystroke — receives the current character count.\n * @param props.onChange - Callback fired when editor content changes — receives the Slate `Descendant[]`.\n * @param props.baseErrorMessage - Custom error message (overrides `useForm` context error).\n * @param props.isError - Forces the error visual state.\n * @param props.id - Custom id for the editable area element.\n * @param props.showAsterisk - Appends `*` to the label.\n * @param props.orientation - Layout direction. Default: \"horizontal\"\n * @param props.unShowFieldTemplate - Skips wrapper, label, and error rendering. Default: false\n *\n * @returns RichText JSX element wrapped in `FieldTemplate`.\n *\n * @example\n * ```tsx\n * // Basic\n * <RichText name=\"content\" />\n *\n * // With character limit and hidden toolbar buttons\n * <RichText\n * name=\"description\"\n * label=\"Description\"\n * maxLimit={500}\n * enforceCharacterLimit\n * hiddenButtons={[\"image\", \"video\", \"code\"]}\n * onChangeCharactersCount={(n) => setCharCount(n)}\n * />\n *\n * // With image upload support\n * <RichText\n * name=\"article\"\n * label=\"Article Body\"\n * imageConfig={{ action: \"/api/upload\" }}\n * />\n * ```\n */\n\nfunction RichText(props: RichTextProps) {\n\tconst {\n\t\tname,\n\t\thiddenButtons,\n\t\timageConfig,\n\t\tvideoConfig,\n\t\tclassName: wrapperClassName = \"\",\n\t\tdefaultValue = \"[]\",\n\t\tenforceCharacterLimit = false,\n\t\tonChangeCharactersCount,\n\t\tbaseErrorMessage,\n\t\tmaxLimit = 10000,\n\t\tonChange,\n\t\tisError: baseIsError,\n\t\tlabel,\n\t\tshowAsterisk,\n\t\tid,\n\t\torientation = \"vertical\",\n\t\tunShowFieldTemplate = false,\n\t} = props;\n\n\tconst editor = useMemo(() => withHistory(withReact(createEditor())), []);\n\n\tconst { fieldErrors } = useForm();\n\n\tconst defaultNodes = useMemo((): Descendant[] => {\n\t\ttry {\n\t\t\tconst parsedNodes = JSON.parse(defaultValue);\n\t\t\tif (!Array.isArray(parsedNodes) || parsedNodes.length === 0) {\n\t\t\t\treturn structuredClone(initialValue);\n\t\t\t}\n\n\t\t\tconst isValidNodes = parsedNodes.every(\n\t\t\t\t(node) =>\n\t\t\t\t\ttypeof node === \"object\" &&\n\t\t\t\t\tnode !== null &&\n\t\t\t\t\t\"type\" in node &&\n\t\t\t\t\t\"children\" in node,\n\t\t\t);\n\n\t\t\treturn isValidNodes ? parsedNodes : structuredClone(initialValue);\n\t\t} catch (_error) {\n\t\t\treturn structuredClone(initialValue);\n\t\t}\n\t}, [defaultValue]);\n\n\tconst textFromNodes = extractTextFromNode(defaultNodes);\n\n\tconst [charactersCount, setCharactersCount] = useState(textFromNodes.length);\n\tconst [inputValue, setInputValue] = useState(\n\t\tJSON.stringify(defaultNodes) || \"[]\",\n\t);\n\n\tconst [onFocus, setOnFocus] = useState(false);\n\n\tconst ref = useRef<HTMLInputElement>(null);\n\tconst generatedId = useId();\n\tconst inputId = id || generatedId;\n\n\tconst errorMessage = baseErrorMessage || fieldErrors?.[name];\n\tconst isError = baseIsError || !!errorMessage;\n\n\tconst renderLeaf = useCallback(Leaf, []);\n\tconst renderElement = useCallback(Element, []);\n\n\tfunction handleChange(value: Descendant[]) {\n\t\tconst text = extractTextFromNode(value);\n\n\t\tsetCharactersCount(text.length);\n\t\tonChangeCharactersCount?.(text.length);\n\n\t\tif (enforceCharacterLimit && text.length >= maxLimit) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetInputValue(JSON.stringify(value));\n\t\tonChange?.(value);\n\t}\n\n\tconst focusClass = onFocus ? \"focusTrue\" : \"focusFalse\";\n\tconst errorClass = isError\n\t\t? \"errorTrue\"\n\t\t: maxLimit < charactersCount\n\t\t\t? \"errorTrue\"\n\t\t\t: \"errorFalse\";\n\n\tconst className = `arkynRichText ${errorClass} ${focusClass}`;\n\n\tconst restatesCharacters = maxLimit - charactersCount;\n\n\tfunction buttonIsNotHidden(format: RichTextHiddenButtonKey) {\n\t\treturn !hiddenButtons?.includes(format);\n\t}\n\n\treturn (\n\t\t<FieldTemplate\n\t\t\tname={name}\n\t\t\tlabel={label}\n\t\t\tshowAsterisk={showAsterisk}\n\t\t\tclassName={wrapperClassName}\n\t\t\terrorMessage={errorMessage}\n\t\t\tunShowFieldTemplate={unShowFieldTemplate}\n\t\t\torientation={orientation}\n\t\t>\n\t\t\t<Slate\n\t\t\t\teditor={editor}\n\t\t\t\tinitialValue={defaultNodes}\n\t\t\t\tonChange={handleChange}\n\t\t\t\tonValueChange={handleChange}\n\t\t\t>\n\t\t\t\t<div className={className}>\n\t\t\t\t\t<Toolbar>\n\t\t\t\t\t\t{buttonIsNotHidden(\"headingOne\") && (\n\t\t\t\t\t\t\t<BlockButton format=\"headingOne\" icon={Heading1} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"headingTwo\") && (\n\t\t\t\t\t\t\t<BlockButton format=\"headingTwo\" icon={Heading2} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"blockQuote\") && (\n\t\t\t\t\t\t\t<BlockButton format=\"blockQuote\" icon={Quote} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"bold\") && (\n\t\t\t\t\t\t\t<MarkButton format=\"bold\" icon={Bold} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"italic\") && (\n\t\t\t\t\t\t\t<MarkButton format=\"italic\" icon={Italic} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"underline\") && (\n\t\t\t\t\t\t\t<MarkButton format=\"underline\" icon={Underline} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"code\") && (\n\t\t\t\t\t\t\t<MarkButton format=\"code\" icon={Code} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"left\") && (\n\t\t\t\t\t\t\t<BlockButton format=\"left\" icon={AlignLeft} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"right\") && (\n\t\t\t\t\t\t\t<BlockButton format=\"right\" icon={AlignRight} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"center\") && (\n\t\t\t\t\t\t\t<BlockButton format=\"center\" icon={AlignCenter} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"justify\") && (\n\t\t\t\t\t\t\t<BlockButton format=\"justify\" icon={AlignJustify} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{imageConfig && buttonIsNotHidden(\"image\") && (\n\t\t\t\t\t\t\t<InsertImage {...imageConfig} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"video\") && <InsertVideo {...videoConfig} />}\n\t\t\t\t\t</Toolbar>\n\n\t\t\t\t\t<Editable\n\t\t\t\t\t\tclassName=\"editorContainer\"\n\t\t\t\t\t\trenderElement={renderElement}\n\t\t\t\t\t\trenderLeaf={renderLeaf}\n\t\t\t\t\t\tspellCheck\n\t\t\t\t\t\tref={ref}\n\t\t\t\t\t\tid={inputId}\n\t\t\t\t\t\tonFocus={() => setOnFocus(true)}\n\t\t\t\t\t\tonBlur={() => setOnFocus(false)}\n\t\t\t\t\t\tonKeyDown={(event) => {\n\t\t\t\t\t\t\tfor (const hotkey in hotKeys) {\n\t\t\t\t\t\t\t\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\t\t\t\t\t\t\t\tif (isHotkey(hotkey, event as any)) {\n\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\tconst mark = hotKeys[hotkey as keyof typeof hotKeys];\n\t\t\t\t\t\t\t\t\ttoggleMark(editor, mark);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\n\t\t\t\t\t{restatesCharacters < 0 && (\n\t\t\t\t\t\t<div className=\"restatesCharacters\">{restatesCharacters}</div>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\n\t\t\t\t<input\n\t\t\t\t\ttype=\"hidden\"\n\t\t\t\t\tname={name}\n\t\t\t\t\tvalue={inputValue.slice(0, maxLimit)}\n\t\t\t\t/>\n\n\t\t\t\t<input type=\"hidden\" name={`${name}Count`} value={charactersCount} />\n\t\t\t</Slate>\n\t\t</FieldTemplate>\n\t);\n}\n\nexport { RichText };\n"],"mappings":"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"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/richText/index.tsx"],"sourcesContent":["import isHotkey from \"is-hotkey\";\nimport {\n\tAlignCenter,\n\tAlignJustify,\n\tAlignLeft,\n\tAlignRight,\n\tBold,\n\tCode,\n\tHeading1,\n\tHeading2,\n\tItalic,\n\tQuote,\n\tUnderline,\n} from \"lucide-react\";\nimport { useCallback, useId, useMemo, useRef, useState } from \"react\";\nimport { createEditor, type Descendant } from \"slate\";\nimport { withHistory } from \"slate-history\";\nimport { Editable, Slate, withReact } from \"slate-react\";\nimport { useForm } from \"../../hooks/useForm\";\nimport { extractTextFromNode } from \"../../services/extractTextFromNode\";\nimport { FieldTemplate } from \"../../services/fieldTemplate\";\nimport { toggleMark } from \"../../services/toggleMark\";\nimport { hotKeys, initialValue } from \"../../templates/richTextTemplates\";\nimport type {\n\tRichTextHiddenButtonKey,\n\tRichTextProps,\n} from \"../../types/richTextTypes\";\nimport { BlockButton } from \"./blockButton\";\nimport { Element } from \"./element\";\nimport { InsertImage } from \"./insertImage\";\nimport { InsertVideo } from \"./insertVideo\";\nimport { Leaf } from \"./leaf\";\nimport { MarkButton } from \"./markButton\";\nimport { Toolbar } from \"./toolbar\";\nimport \"./styles.css\";\n\n/**\n * RichText, WYSIWYG rich-text editor built on Slate.js with a configurable toolbar.\n *\n * **Toolbar features:** bold, italic, underline, code, H1/H2, block quote, alignment (left/center/right/justify), image and video insertion.\n *\n * Editor content is stored as a Slate JSON string in a hidden `<input>` for form submission.\n * Integrates with `useForm` to display validation errors by field name.\n *\n * @param props.name - Field name for form submission. Required.\n * @param props.label - Label text displayed above the editor.\n * @param props.hiddenButtons - Toolbar button keys to hide (e.g. `[\"image\", \"code\"]`).\n * @param props.imageConfig - Enables image insertion; contains the upload endpoint and modal labels.\n * @param props.defaultValue - Initial editor content as a Slate JSON string. Default: \"[]\"\n * @param props.maxLimit - Maximum character count. Default: 10000\n * @param props.enforceCharacterLimit - Prevents typing past `maxLimit`. Default: false\n * @param props.onChangeCharactersCount - Callback fired on every keystroke, receives the current character count.\n * @param props.onChange - Callback fired when editor content changes, receives the Slate `Descendant[]`.\n * @param props.baseErrorMessage - Custom error message (overrides `useForm` context error).\n * @param props.isError - Forces the error visual state.\n * @param props.id - Custom id for the editable area element.\n * @param props.showAsterisk - Appends `*` to the label.\n * @param props.orientation - Layout direction. Default: \"horizontal\"\n * @param props.unShowFieldTemplate - Skips wrapper, label, and error rendering. Default: false\n *\n * @returns RichText JSX element wrapped in `FieldTemplate`.\n *\n * @example\n * ```tsx\n * // Basic\n * <RichText name=\"content\" />\n *\n * // With character limit and hidden toolbar buttons\n * <RichText\n * name=\"description\"\n * label=\"Description\"\n * maxLimit={500}\n * enforceCharacterLimit\n * hiddenButtons={[\"image\", \"video\", \"code\"]}\n * onChangeCharactersCount={(n) => setCharCount(n)}\n * />\n *\n * // With image upload support\n * <RichText\n * name=\"article\"\n * label=\"Article Body\"\n * imageConfig={{ action: \"/api/upload\" }}\n * />\n * ```\n */\n\nfunction RichText(props: RichTextProps) {\n\tconst {\n\t\tname,\n\t\thiddenButtons,\n\t\timageConfig,\n\t\tvideoConfig,\n\t\tclassName: wrapperClassName = \"\",\n\t\tdefaultValue = \"[]\",\n\t\tenforceCharacterLimit = false,\n\t\tonChangeCharactersCount,\n\t\tbaseErrorMessage,\n\t\tmaxLimit = 10000,\n\t\tonChange,\n\t\tisError: baseIsError,\n\t\tlabel,\n\t\tshowAsterisk,\n\t\tid,\n\t\torientation = \"vertical\",\n\t\tunShowFieldTemplate = false,\n\t} = props;\n\n\tconst editor = useMemo(() => withHistory(withReact(createEditor())), []);\n\n\tconst { fieldErrors } = useForm();\n\n\tconst defaultNodes = useMemo((): Descendant[] => {\n\t\ttry {\n\t\t\tconst parsedNodes = JSON.parse(defaultValue);\n\t\t\tif (!Array.isArray(parsedNodes) || parsedNodes.length === 0) {\n\t\t\t\treturn structuredClone(initialValue);\n\t\t\t}\n\n\t\t\tconst isValidNodes = parsedNodes.every(\n\t\t\t\t(node) =>\n\t\t\t\t\ttypeof node === \"object\" &&\n\t\t\t\t\tnode !== null &&\n\t\t\t\t\t\"type\" in node &&\n\t\t\t\t\t\"children\" in node,\n\t\t\t);\n\n\t\t\treturn isValidNodes ? parsedNodes : structuredClone(initialValue);\n\t\t} catch (_error) {\n\t\t\treturn structuredClone(initialValue);\n\t\t}\n\t}, [defaultValue]);\n\n\tconst textFromNodes = extractTextFromNode(defaultNodes);\n\n\tconst [charactersCount, setCharactersCount] = useState(textFromNodes.length);\n\tconst [inputValue, setInputValue] = useState(\n\t\tJSON.stringify(defaultNodes) || \"[]\",\n\t);\n\n\tconst [onFocus, setOnFocus] = useState(false);\n\n\tconst ref = useRef<HTMLInputElement>(null);\n\tconst generatedId = useId();\n\tconst inputId = id || generatedId;\n\n\tconst errorMessage = baseErrorMessage || fieldErrors?.[name];\n\tconst isError = baseIsError || !!errorMessage;\n\n\tconst renderLeaf = useCallback(Leaf, []);\n\tconst renderElement = useCallback(Element, []);\n\n\tfunction handleChange(value: Descendant[]) {\n\t\tconst text = extractTextFromNode(value);\n\n\t\tsetCharactersCount(text.length);\n\t\tonChangeCharactersCount?.(text.length);\n\n\t\tif (enforceCharacterLimit && text.length >= maxLimit) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetInputValue(JSON.stringify(value));\n\t\tonChange?.(value);\n\t}\n\n\tconst focusClass = onFocus ? \"focusTrue\" : \"focusFalse\";\n\tconst errorClass = isError\n\t\t? \"errorTrue\"\n\t\t: maxLimit < charactersCount\n\t\t\t? \"errorTrue\"\n\t\t\t: \"errorFalse\";\n\n\tconst className = `arkynRichText ${errorClass} ${focusClass}`;\n\n\tconst restatesCharacters = maxLimit - charactersCount;\n\n\tfunction buttonIsNotHidden(format: RichTextHiddenButtonKey) {\n\t\treturn !hiddenButtons?.includes(format);\n\t}\n\n\treturn (\n\t\t<FieldTemplate\n\t\t\tname={name}\n\t\t\tlabel={label}\n\t\t\tshowAsterisk={showAsterisk}\n\t\t\tclassName={wrapperClassName}\n\t\t\terrorMessage={errorMessage}\n\t\t\tunShowFieldTemplate={unShowFieldTemplate}\n\t\t\torientation={orientation}\n\t\t>\n\t\t\t<Slate\n\t\t\t\teditor={editor}\n\t\t\t\tinitialValue={defaultNodes}\n\t\t\t\tonChange={handleChange}\n\t\t\t\tonValueChange={handleChange}\n\t\t\t>\n\t\t\t\t<div className={className}>\n\t\t\t\t\t<Toolbar>\n\t\t\t\t\t\t{buttonIsNotHidden(\"headingOne\") && (\n\t\t\t\t\t\t\t<BlockButton format=\"headingOne\" icon={Heading1} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"headingTwo\") && (\n\t\t\t\t\t\t\t<BlockButton format=\"headingTwo\" icon={Heading2} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"blockQuote\") && (\n\t\t\t\t\t\t\t<BlockButton format=\"blockQuote\" icon={Quote} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"bold\") && (\n\t\t\t\t\t\t\t<MarkButton format=\"bold\" icon={Bold} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"italic\") && (\n\t\t\t\t\t\t\t<MarkButton format=\"italic\" icon={Italic} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"underline\") && (\n\t\t\t\t\t\t\t<MarkButton format=\"underline\" icon={Underline} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"code\") && (\n\t\t\t\t\t\t\t<MarkButton format=\"code\" icon={Code} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"left\") && (\n\t\t\t\t\t\t\t<BlockButton format=\"left\" icon={AlignLeft} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"right\") && (\n\t\t\t\t\t\t\t<BlockButton format=\"right\" icon={AlignRight} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"center\") && (\n\t\t\t\t\t\t\t<BlockButton format=\"center\" icon={AlignCenter} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"justify\") && (\n\t\t\t\t\t\t\t<BlockButton format=\"justify\" icon={AlignJustify} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{imageConfig && buttonIsNotHidden(\"image\") && (\n\t\t\t\t\t\t\t<InsertImage {...imageConfig} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"video\") && <InsertVideo {...videoConfig} />}\n\t\t\t\t\t</Toolbar>\n\n\t\t\t\t\t<Editable\n\t\t\t\t\t\tclassName=\"editorContainer\"\n\t\t\t\t\t\trenderElement={renderElement}\n\t\t\t\t\t\trenderLeaf={renderLeaf}\n\t\t\t\t\t\tspellCheck\n\t\t\t\t\t\tref={ref}\n\t\t\t\t\t\tid={inputId}\n\t\t\t\t\t\tonFocus={() => setOnFocus(true)}\n\t\t\t\t\t\tonBlur={() => setOnFocus(false)}\n\t\t\t\t\t\tonKeyDown={(event) => {\n\t\t\t\t\t\t\tfor (const hotkey in hotKeys) {\n\t\t\t\t\t\t\t\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\t\t\t\t\t\t\t\tif (isHotkey(hotkey, event as any)) {\n\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\tconst mark = hotKeys[hotkey as keyof typeof hotKeys];\n\t\t\t\t\t\t\t\t\ttoggleMark(editor, mark);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\n\t\t\t\t\t{restatesCharacters < 0 && (\n\t\t\t\t\t\t<div className=\"restatesCharacters\">{restatesCharacters}</div>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\n\t\t\t\t<input\n\t\t\t\t\ttype=\"hidden\"\n\t\t\t\t\tname={name}\n\t\t\t\t\tvalue={inputValue.slice(0, maxLimit)}\n\t\t\t\t/>\n\n\t\t\t\t<input type=\"hidden\" name={`${name}Count`} value={charactersCount} />\n\t\t\t</Slate>\n\t\t</FieldTemplate>\n\t);\n}\n\nexport { RichText };\n"],"mappings":"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"}
@@ -1 +1 @@
1
- {"version":3,"file":"searchPlaces.js","names":[],"sources":["../../../src/components/searchPlaces.tsx"],"sourcesContent":["import type { StandaloneSearchBoxProps } from \"@react-google-maps/api\";\nimport { StandaloneSearchBox } from \"@react-google-maps/api\";\nimport { type JSX, useState } from \"react\";\nimport { Input, type InputProps } from \"./input\";\n\ntype AddressComponentsType = {\n\tlong_name: string;\n\tshort_name: string;\n\ttypes: string[];\n}[];\n\n/** Structured address data extracted from a Google Places result. */\ntype PlaceData = {\n\t/** Street name (e.g. `\"Rua Exemplo\"`). */\n\tstreet: string;\n\t/** City name (e.g. `\"São Paulo\"`). */\n\tcity: string;\n\t/** Full state name (e.g. `\"São Paulo\"`). */\n\tstate: string;\n\t/** Neighborhood / district name. */\n\tneighborhood: string;\n\t/** Postal / ZIP code. */\n\tpostalCode: string;\n\t/** State abbreviation (e.g. `\"SP\"`). */\n\tstateShortName: string;\n\t/** Street number (e.g. `\"123\"`). */\n\tstreetNumber: string;\n\t/** Geographic coordinates of the place. */\n\tcoordinates: { lat: number; lng: number };\n};\n\ntype SearchPlacesProps = {\n\t/** Google Maps `StandaloneSearchBox` options (e.g. `componentRestrictions`, `bounds`). */\n\toptions?: StandaloneSearchBoxProps[\"options\"];\n\t/** Callback fired every time the input text changes. Receives the current string value. */\n\tonChange?: (e: string) => void;\n\t/**\n\t * Callback fired when the user selects a place from the autocomplete suggestions.\n\t * Receives a structured {@link PlaceData} object.\n\t */\n\tonPlaceChanged?: (e: PlaceData) => void;\n} & Omit<InputProps, \"onLoad\" | \"onChange\" | \"type\">;\n\n/**\n * SearchPlaces text input with Google Places autocomplete that returns structured address data.\n *\n * Requires the Google Maps JavaScript API with the Places library to be loaded.\n * Built on `@react-google-maps/api`'s `StandaloneSearchBox`.\n *\n * @param props.options - Google Maps search box options (e.g. restrict by country).\n * @param props.onChange - Fires on every keystroke receives the current text value.\n * @param props.onPlaceChanged - Fires when the user selects a suggestion receives structured address data.\n *\n * **...Other valid `Input` properties (except `onLoad`, `onChange`, `type`)**\n *\n * @returns SearchPlaces JSX element (an `Input` wrapped in `StandaloneSearchBox`).\n *\n * @example\n * ```tsx\n * <SearchPlaces\n * name=\"address\"\n * label=\"Address\"\n * placeholder=\"Start typing an address…\"\n * options={{ componentRestrictions: { country: \"br\" } }}\n * onChange={(v) => setRawAddress(v)}\n * onPlaceChanged={(place) => {\n * setAddress({\n * street: place.street,\n * city: place.city,\n * state: place.state,\n * postalCode: place.postalCode,\n * coordinates: place.coordinates,\n * });\n * }}\n * />\n * ```\n */\n\nfunction SearchPlaces(props: SearchPlacesProps): JSX.Element {\n\tconst { onChange, onPlaceChanged, options, ...rest } = props;\n\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tconst [searchBox, setSearchBox] = useState<any>(null);\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tconst handleLoad = (ref: any) => setSearchBox(ref);\n\n\tconst handlePlacesChanged = () => {\n\t\tconst places = searchBox?.getPlaces();\n\t\tconst place = places ? places[0] : null;\n\n\t\tconst address_components =\n\t\t\tplace?.address_components as AddressComponentsType;\n\n\t\tfunction findData(key: string) {\n\t\t\tconst data = address_components.find((item) => item.types[0] === key);\n\t\t\tif (data) return data.long_name;\n\t\t\treturn \"\";\n\t\t}\n\n\t\tfunction findDataShort(key: string) {\n\t\t\tconst data = address_components.find((item) => item.types[0] === key);\n\t\t\tif (data) return data.short_name;\n\t\t\treturn \"\";\n\t\t}\n\n\t\tfunction findDataByMultipleTypes(keys: string[]) {\n\t\t\tfor (const key of keys) {\n\t\t\t\tconst data = address_components.find((item) =>\n\t\t\t\t\titem.types.includes(key),\n\t\t\t\t);\n\t\t\t\tif (data) return data.long_name;\n\t\t\t}\n\t\t\treturn \"\";\n\t\t}\n\n\t\tif (place) {\n\t\t\tconst street = findData(\"route\");\n\t\t\tconst streetNumber = findData(\"street_number\");\n\t\t\tconst neighborhood = findDataByMultipleTypes([\n\t\t\t\t\"sublocality_level_1\",\n\t\t\t\t\"sublocality\",\n\t\t\t\t\"neighborhood\",\n\t\t\t]);\n\t\t\tconst city = findData(\"administrative_area_level_2\");\n\t\t\tconst state = findData(\"administrative_area_level_1\");\n\t\t\tconst stateShortName = findDataShort(\"administrative_area_level_1\");\n\t\t\tconst postalCode = findDataByMultipleTypes([\n\t\t\t\t\"postal_code\",\n\t\t\t\t\"postal_code_prefix\",\n\t\t\t]);\n\n\t\t\tconst lat = place.geometry?.location?.lat();\n\t\t\tconst lng = place.geometry?.location?.lng();\n\n\t\t\tconst sendPlace = {\n\t\t\t\tstreet,\n\t\t\t\tcity,\n\t\t\t\tstate,\n\t\t\t\tneighborhood,\n\t\t\t\tpostalCode,\n\t\t\t\tstreetNumber,\n\t\t\t\tstateShortName,\n\t\t\t\tcoordinates: { lat, lng },\n\t\t\t};\n\n\t\t\tonPlaceChanged?.(sendPlace);\n\t\t}\n\t};\n\n\treturn (\n\t\t<StandaloneSearchBox\n\t\t\tonLoad={handleLoad}\n\t\t\tonPlacesChanged={handlePlacesChanged}\n\t\t\toptions={options}\n\t\t>\n\t\t\t<Input\n\t\t\t\ttype=\"text\"\n\t\t\t\tautoComplete=\"off\"\n\t\t\t\tonChange={(e) => onChange?.(e.target.value)}\n\t\t\t\t{...rest}\n\t\t\t/>\n\t\t</StandaloneSearchBox>\n\t);\n}\n\nexport { SearchPlaces };\n"],"mappings":";;;;;AA8EA,SAAS,EAAa,GAAuC;CAC5D,IAAM,EAAE,aAAU,mBAAgB,YAAS,GAAG,MAAS,GAGjD,CAAC,GAAW,KAAgB,EAAc,IAAI;CAmEpD,OACC,kBAAC,GAAD;EACC,SAnEkB,MAAa,EAAa,CAAG;EAoE/C,uBAlEgC;GACjC,IAAM,IAAS,GAAW,UAAU,GAC9B,IAAQ,IAAS,EAAO,KAAK,MAE7B,IACL,GAAO;GAER,SAAS,EAAS,GAAa;IAC9B,IAAM,IAAO,EAAmB,MAAM,MAAS,EAAK,MAAM,OAAO,CAAG;IAEpE,OADI,IAAa,EAAK,YACf;GACR;GAEA,SAAS,EAAc,GAAa;IACnC,IAAM,IAAO,EAAmB,MAAM,MAAS,EAAK,MAAM,OAAO,CAAG;IAEpE,OADI,IAAa,EAAK,aACf;GACR;GAEA,SAAS,EAAwB,GAAgB;IAChD,KAAK,IAAM,KAAO,GAAM;KACvB,IAAM,IAAO,EAAmB,MAAM,MACrC,EAAK,MAAM,SAAS,CAAG,CACxB;KACA,IAAI,GAAM,OAAO,EAAK;IACvB;IACA,OAAO;GACR;GAEA,IAAI,GAAO;IACV,IAAM,IAAS,EAAS,OAAO,GACzB,IAAe,EAAS,eAAe,GACvC,IAAe,EAAwB;KAC5C;KACA;KACA;IACD,CAAC,GACK,IAAO,EAAS,6BAA6B,GAC7C,IAAQ,EAAS,6BAA6B,GAC9C,IAAiB,EAAc,6BAA6B,GAS5D,IAAY;KACjB;KACA;KACA;KACA;KACA,YAbkB,EAAwB,CAC1C,eACA,oBACD,CAUC;KACA;KACA;KACA,aAAa;MAAE,KAXJ,EAAM,UAAU,UAAU,IAAI;MAWrB,KAVT,EAAM,UAAU,UAAU,IAAI;KAUjB;IACzB;IAEA,IAAiB,CAAS;GAC3B;EACD;EAMW;YAET,kBAAC,GAAD;GACC,MAAK;GACL,cAAa;GACb,WAAW,MAAM,IAAW,EAAE,OAAO,KAAK;GAC1C,GAAI;EACJ,CAAA;CACmB,CAAA;AAEvB"}
1
+ {"version":3,"file":"searchPlaces.js","names":[],"sources":["../../../src/components/searchPlaces.tsx"],"sourcesContent":["import type { StandaloneSearchBoxProps } from \"@react-google-maps/api\";\nimport { StandaloneSearchBox } from \"@react-google-maps/api\";\nimport { type JSX, useState } from \"react\";\nimport { Input, type InputProps } from \"./input\";\n\ntype AddressComponentsType = {\n\tlong_name: string;\n\tshort_name: string;\n\ttypes: string[];\n}[];\n\n/** Structured address data extracted from a Google Places result. */\ntype PlaceData = {\n\t/** Street name (e.g. `\"Rua Exemplo\"`). */\n\tstreet: string;\n\t/** City name (e.g. `\"São Paulo\"`). */\n\tcity: string;\n\t/** Full state name (e.g. `\"São Paulo\"`). */\n\tstate: string;\n\t/** Neighborhood / district name. */\n\tneighborhood: string;\n\t/** Postal / ZIP code. */\n\tpostalCode: string;\n\t/** State abbreviation (e.g. `\"SP\"`). */\n\tstateShortName: string;\n\t/** Street number (e.g. `\"123\"`). */\n\tstreetNumber: string;\n\t/** Geographic coordinates of the place. */\n\tcoordinates: { lat: number; lng: number };\n};\n\ntype SearchPlacesProps = {\n\t/** Google Maps `StandaloneSearchBox` options (e.g. `componentRestrictions`, `bounds`). */\n\toptions?: StandaloneSearchBoxProps[\"options\"];\n\t/** Callback fired every time the input text changes. Receives the current string value. */\n\tonChange?: (e: string) => void;\n\t/**\n\t * Callback fired when the user selects a place from the autocomplete suggestions.\n\t * Receives a structured {@link PlaceData} object.\n\t */\n\tonPlaceChanged?: (e: PlaceData) => void;\n} & Omit<InputProps, \"onLoad\" | \"onChange\" | \"type\">;\n\n/**\n * SearchPlaces, text input with Google Places autocomplete that returns structured address data.\n *\n * Requires the Google Maps JavaScript API with the Places library to be loaded.\n * Built on `@react-google-maps/api`'s `StandaloneSearchBox`.\n *\n * @param props.options - Google Maps search box options (e.g. restrict by country).\n * @param props.onChange - Fires on every keystroke, receives the current text value.\n * @param props.onPlaceChanged - Fires when the user selects a suggestion, receives structured address data.\n *\n * **...Other valid `Input` properties (except `onLoad`, `onChange`, `type`)**\n *\n * @returns SearchPlaces JSX element (an `Input` wrapped in `StandaloneSearchBox`).\n *\n * @example\n * ```tsx\n * <SearchPlaces\n * name=\"address\"\n * label=\"Address\"\n * placeholder=\"Start typing an address…\"\n * options={{ componentRestrictions: { country: \"br\" } }}\n * onChange={(v) => setRawAddress(v)}\n * onPlaceChanged={(place) => {\n * setAddress({\n * street: place.street,\n * city: place.city,\n * state: place.state,\n * postalCode: place.postalCode,\n * coordinates: place.coordinates,\n * });\n * }}\n * />\n * ```\n */\n\nfunction SearchPlaces(props: SearchPlacesProps): JSX.Element {\n\tconst { onChange, onPlaceChanged, options, ...rest } = props;\n\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tconst [searchBox, setSearchBox] = useState<any>(null);\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tconst handleLoad = (ref: any) => setSearchBox(ref);\n\n\tconst handlePlacesChanged = () => {\n\t\tconst places = searchBox?.getPlaces();\n\t\tconst place = places ? places[0] : null;\n\n\t\tconst address_components =\n\t\t\tplace?.address_components as AddressComponentsType;\n\n\t\tfunction findData(key: string) {\n\t\t\tconst data = address_components.find((item) => item.types[0] === key);\n\t\t\tif (data) return data.long_name;\n\t\t\treturn \"\";\n\t\t}\n\n\t\tfunction findDataShort(key: string) {\n\t\t\tconst data = address_components.find((item) => item.types[0] === key);\n\t\t\tif (data) return data.short_name;\n\t\t\treturn \"\";\n\t\t}\n\n\t\tfunction findDataByMultipleTypes(keys: string[]) {\n\t\t\tfor (const key of keys) {\n\t\t\t\tconst data = address_components.find((item) =>\n\t\t\t\t\titem.types.includes(key),\n\t\t\t\t);\n\t\t\t\tif (data) return data.long_name;\n\t\t\t}\n\t\t\treturn \"\";\n\t\t}\n\n\t\tif (place) {\n\t\t\tconst street = findData(\"route\");\n\t\t\tconst streetNumber = findData(\"street_number\");\n\t\t\tconst neighborhood = findDataByMultipleTypes([\n\t\t\t\t\"sublocality_level_1\",\n\t\t\t\t\"sublocality\",\n\t\t\t\t\"neighborhood\",\n\t\t\t]);\n\t\t\tconst city = findData(\"administrative_area_level_2\");\n\t\t\tconst state = findData(\"administrative_area_level_1\");\n\t\t\tconst stateShortName = findDataShort(\"administrative_area_level_1\");\n\t\t\tconst postalCode = findDataByMultipleTypes([\n\t\t\t\t\"postal_code\",\n\t\t\t\t\"postal_code_prefix\",\n\t\t\t]);\n\n\t\t\tconst lat = place.geometry?.location?.lat();\n\t\t\tconst lng = place.geometry?.location?.lng();\n\n\t\t\tconst sendPlace = {\n\t\t\t\tstreet,\n\t\t\t\tcity,\n\t\t\t\tstate,\n\t\t\t\tneighborhood,\n\t\t\t\tpostalCode,\n\t\t\t\tstreetNumber,\n\t\t\t\tstateShortName,\n\t\t\t\tcoordinates: { lat, lng },\n\t\t\t};\n\n\t\t\tonPlaceChanged?.(sendPlace);\n\t\t}\n\t};\n\n\treturn (\n\t\t<StandaloneSearchBox\n\t\t\tonLoad={handleLoad}\n\t\t\tonPlacesChanged={handlePlacesChanged}\n\t\t\toptions={options}\n\t\t>\n\t\t\t<Input\n\t\t\t\ttype=\"text\"\n\t\t\t\tautoComplete=\"off\"\n\t\t\t\tonChange={(e) => onChange?.(e.target.value)}\n\t\t\t\t{...rest}\n\t\t\t/>\n\t\t</StandaloneSearchBox>\n\t);\n}\n\nexport { SearchPlaces };\n"],"mappings":";;;;;AA8EA,SAAS,EAAa,GAAuC;CAC5D,IAAM,EAAE,aAAU,mBAAgB,YAAS,GAAG,MAAS,GAGjD,CAAC,GAAW,KAAgB,EAAc,IAAI;CAmEpD,OACC,kBAAC,GAAD;EACC,SAnEkB,MAAa,EAAa,CAAG;EAoE/C,uBAlEgC;GACjC,IAAM,IAAS,GAAW,UAAU,GAC9B,IAAQ,IAAS,EAAO,KAAK,MAE7B,IACL,GAAO;GAER,SAAS,EAAS,GAAa;IAC9B,IAAM,IAAO,EAAmB,MAAM,MAAS,EAAK,MAAM,OAAO,CAAG;IAEpE,OADI,IAAa,EAAK,YACf;GACR;GAEA,SAAS,EAAc,GAAa;IACnC,IAAM,IAAO,EAAmB,MAAM,MAAS,EAAK,MAAM,OAAO,CAAG;IAEpE,OADI,IAAa,EAAK,aACf;GACR;GAEA,SAAS,EAAwB,GAAgB;IAChD,KAAK,IAAM,KAAO,GAAM;KACvB,IAAM,IAAO,EAAmB,MAAM,MACrC,EAAK,MAAM,SAAS,CAAG,CACxB;KACA,IAAI,GAAM,OAAO,EAAK;IACvB;IACA,OAAO;GACR;GAEA,IAAI,GAAO;IACV,IAAM,IAAS,EAAS,OAAO,GACzB,IAAe,EAAS,eAAe,GACvC,IAAe,EAAwB;KAC5C;KACA;KACA;IACD,CAAC,GACK,IAAO,EAAS,6BAA6B,GAC7C,IAAQ,EAAS,6BAA6B,GAC9C,IAAiB,EAAc,6BAA6B,GAS5D,IAAY;KACjB;KACA;KACA;KACA;KACA,YAbkB,EAAwB,CAC1C,eACA,oBACD,CAUC;KACA;KACA;KACA,aAAa;MAAE,KAXJ,EAAM,UAAU,UAAU,IAAI;MAWrB,KAVT,EAAM,UAAU,UAAU,IAAI;KAUjB;IACzB;IAEA,IAAiB,CAAS;GAC3B;EACD;EAMW;YAET,kBAAC,GAAD;GACC,MAAK;GACL,cAAa;GACb,WAAW,MAAM,IAAW,EAAE,OAAO,KAAK;GAC1C,GAAI;EACJ,CAAA;CACmB,CAAA;AAEvB"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/select/index.tsx"],"sourcesContent":["import type { LucideIcon } from \"lucide-react\";\nimport { type FocusEvent, useId, useRef, useState } from \"react\";\n\nimport { useForm } from \"../../hooks/useForm\";\nimport { FieldTemplate } from \"../../services/fieldTemplate\";\nimport { IconRenderer } from \"../../services/iconRenderer\";\n\nimport { SelectChevron } from \"./selectChevron\";\nimport { SelectContainer } from \"./selectContainer\";\nimport { SelectContent } from \"./selectContent\";\nimport { SelectOption } from \"./selectOption\";\nimport { SelectOptionsContainer } from \"./selectOptionsContainer\";\nimport { SelectOverlay } from \"./selectOverlay\";\nimport { SelectSpinner } from \"./selectSpinner\";\n\ntype SelectProps = {\n\t/** Field name for form submission. Required. */\n\tname: string;\n\t/** Array of selectable options. Required. */\n\toptions: { label: string; value: string }[];\n\t/** Optional HTML id for the underlying hidden input. */\n\tid?: string;\n\t/** Controlled selected value. */\n\tvalue?: string;\n\t/** Uncontrolled default selected value. @default \"\" */\n\tdefaultValue?: string;\n\t/** Displays an asterisk on the label to signal a required field. */\n\tshowAsterisk?: boolean;\n\t/** Optional label text displayed above the select. */\n\tlabel?: string;\n\t/** Validation error message displayed below the select. */\n\terrorMessage?: string;\n\t/** Placeholder text shown when no option is selected. @default \"Selecione...\" */\n\tplaceholder?: string;\n\t/** Text shown when no options match the search query. @default \"Sem opções disponíveis\" */\n\tnotFoundText?: string;\n\t/** Additional CSS class applied to the wrapper element. */\n\tclassName?: string;\n\t/** Disables all interactions. @default false */\n\tdisabled?: boolean;\n\t/** Prevents value changes while keeping the current value visible. @default false */\n\treadOnly?: boolean;\n\t/** Shows a loading spinner and disables interactions. @default false */\n\tisLoading?: boolean;\n\t/** Enables search/filter within the dropdown. @default false */\n\tisSearchable?: boolean;\n\t/** Closes the dropdown after an option is selected. @default true */\n\tcloseOnSelect?: boolean;\n\t/** Callback fired when the search query changes. Use for async option loading. */\n\tonSearch?: (value: string) => void;\n\t/** Callback fired when the selected value changes. */\n\tonChange?: (value: string) => void;\n\t/** Callback fired when the select gains focus. */\n\tonFocus?: () => void;\n\t/** Callback fired when the select loses focus. */\n\tonBlur?: (e: FocusEvent<HTMLDivElement>) => void;\n\t/**\n\t * Select size.\n\t * @default \"md\"\n\t */\n\tsize?: \"md\" | \"lg\";\n\t/**\n\t * Visual style variant.\n\t * - `solid`: filled background.\n\t * - `outline`: bordered, transparent background.\n\t * - `underline`: bottom border only.\n\t * @default \"solid\"\n\t */\n\tvariant?: \"solid\" | \"outline\" | \"underline\";\n\t/** Text or icon rendered at the far left, outside the select area. */\n\tprefix?: string | LucideIcon;\n\t/** Lucide icon rendered inside the select on the left. */\n\tleftIcon?: LucideIcon;\n\t/** Maximum height (in px) of the options dropdown. */\n\toptionMaxHeight?: number;\n\t/** When true, skips `FieldTemplate` wrapper (label and error text). @default false */\n\tunShowFieldTemplate?: boolean;\n\t/**\n\t * Layout direction forwarded to `FieldTemplate`.\n\t * @default \"horizontal\"\n\t */\n\torientation?: \"horizontal\" | \"vertical\" | \"horizontalReverse\";\n};\n\n/**\n * Select — single-option dropdown with optional search, label, validation, and form integration.\n *\n * Integrates with `useForm` to display validation errors by field name.\n *\n * @param props.name - Field name for form submission. Required.\n * @param props.options - Array of selectable options (`{ label, value }`). Required.\n * @param props.value - Controlled selected value.\n * @param props.defaultValue - Uncontrolled default value. Default: \"\"\n * @param props.label - Label text displayed above the select.\n * @param props.placeholder - Placeholder shown when nothing is selected. Default: \"Selecione...\"\n * @param props.errorMessage - Validation error message.\n * @param props.isSearchable - Enables search/filter within the dropdown. Default: false\n * @param props.isLoading - Shows a loading spinner and disables interactions. Default: false\n * @param props.closeOnSelect - Closes the dropdown after selecting. Default: true\n * @param props.onChange - Callback fired when the selected value changes.\n * @param props.onSearch - Callback fired when the search query changes.\n * @param props.size - Select size (`md` | `lg`). Default: \"md\"\n * @param props.variant - Visual style variant. Default: \"solid\"\n * @param props.orientation - Layout direction. Default: \"horizontal\"\n * @param props.unShowFieldTemplate - Skips wrapper, label, and error rendering. Default: false\n *\n * @returns Select JSX element wrapped in `FieldTemplate`.\n *\n * @example\n * ```tsx\n * // Basic\n * <Select\n * name=\"category\"\n * options={[\n * { label: \"Technology\", value: \"tech\" },\n * { label: \"Design\", value: \"design\" },\n * ]}\n * />\n *\n * // With label, validation, and searchable\n * <Select\n * name=\"country\"\n * label=\"Country\"\n * showAsterisk\n * isSearchable\n * options={countryOptions}\n * errorMessage={errors.country}\n * notFoundText=\"No countries found\"\n * />\n *\n * // Controlled with async search\n * <Select\n * name=\"tag\"\n * label=\"Tag\"\n * value={selectedTag}\n * onChange={setSelectedTag}\n * onSearch={fetchTagOptions}\n * isLoading={isLoadingTags}\n * options={tagOptions}\n * />\n * ```\n */\n\nfunction Select(props: SelectProps) {\n\tconst {\n\t\tname,\n\t\toptions,\n\t\tclassName: wrapperClassName = \"\",\n\t\tplaceholder = \"Selecione...\",\n\t\tcloseOnSelect = true,\n\t\tdefaultValue = \"\",\n\t\terrorMessage: baseErrorMessage,\n\t\tisLoading = false,\n\t\treadOnly = false,\n\t\tisSearchable = false,\n\t\tid,\n\t\tlabel,\n\t\tshowAsterisk,\n\t\tleftIcon: LeftIcon,\n\t\tonSearch,\n\t\tonChange,\n\t\tonBlur,\n\t\tnotFoundText = \"Sem opções disponíveis\",\n\t\tonFocus,\n\t\tdisabled: baseDisabled = false,\n\t\tprefix,\n\t\tsize = \"md\",\n\t\tvalue,\n\t\tvariant = \"solid\",\n\t\torientation = \"vertical\",\n\t\tunShowFieldTemplate = false,\n\t} = props;\n\n\tconst { fieldErrors } = useForm();\n\n\tconst selectRef = useRef<HTMLInputElement>(null);\n\tconst generatedId = useId();\n\tconst selectId = id || generatedId;\n\n\tconst errorMessage = baseErrorMessage || fieldErrors?.[name];\n\tconst isError = !!errorMessage;\n\tconst disabled = baseDisabled || isLoading || readOnly;\n\n\tconst iconSizes = { md: 20, lg: 20 };\n\tconst iconSize = iconSizes[size];\n\n\tconst [search, setSearch] = useState(\"\");\n\tconst [isFocused, setIsFocused] = useState(false);\n\tconst [selectedOption, setSelectedOption] = useState(defaultValue);\n\n\tconst forceSelectedOptions = value || selectedOption;\n\n\tfunction optionHasSelected(value: string) {\n\t\treturn forceSelectedOptions === value;\n\t}\n\n\tfunction getOptionLabel(value: string) {\n\t\tconst option = options.find((option) => option.value === value);\n\t\treturn option?.label || \"\";\n\t}\n\n\tfunction handleContainerFocus() {\n\t\tif (disabled || !selectRef?.current || isFocused) return;\n\t\tsetIsFocused(true);\n\t\tselectRef.current.focus();\n\t\tonFocus?.();\n\t}\n\n\tfunction handleBlur() {\n\t\tsetIsFocused(false);\n\t\tif (onBlur && selectRef.current) selectRef.current.blur();\n\t}\n\n\tfunction handleSearch(value: string) {\n\t\tsetSearch(value);\n\t\tif (onSearch) onSearch(value);\n\t}\n\n\tfunction handleChangeValue(value: string) {\n\t\tif (optionHasSelected(value)) {\n\t\t\tsetSelectedOption(\"\");\n\t\t\tif (onChange) onChange(\"\");\n\t\t} else {\n\t\t\tsetSelectedOption(value);\n\t\t\tif (onChange) onChange(value);\n\t\t}\n\n\t\tif (closeOnSelect) handleBlur();\n\t}\n\n\tconst mappedOptions = options.filter((option) => {\n\t\tif (props.onSearch) return true;\n\t\tif (!props.isSearchable) return true;\n\t\tif (option.label.toLowerCase().includes(search.toLowerCase())) return true;\n\t\treturn false;\n\t});\n\n\treturn (\n\t\t<FieldTemplate\n\t\t\tname={name}\n\t\t\tlabel={label}\n\t\t\tshowAsterisk={showAsterisk}\n\t\t\tclassName={wrapperClassName}\n\t\t\terrorMessage={errorMessage}\n\t\t\tunShowFieldTemplate={unShowFieldTemplate}\n\t\t\torientation={orientation}\n\t\t>\n\t\t\t<SelectContainer\n\t\t\t\thandleContainerFocus={handleContainerFocus}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tisError={isError}\n\t\t\t\tisFocused={isFocused}\n\t\t\t\tisLoading={isLoading}\n\t\t\t\treadOnly={readOnly}\n\t\t\t\tsize={size}\n\t\t\t\tvariant={variant}\n\t\t\t\tprefixExists={!!prefix}\n\t\t\t\tid={selectId}\n\t\t\t>\n\t\t\t\t<input\n\t\t\t\t\tref={selectRef}\n\t\t\t\t\tname={name}\n\t\t\t\t\tvalue={forceSelectedOptions}\n\t\t\t\t\ttype=\"hidden\"\n\t\t\t\t/>\n\n\t\t\t\t<IconRenderer iconSize={iconSize} icon={prefix} className=\"prefix\" />\n\n\t\t\t\t{LeftIcon && <LeftIcon size={iconSize} strokeWidth={2.5} />}\n\n\t\t\t\t<SelectContent size={size}>\n\t\t\t\t\t{forceSelectedOptions !== \"\" && (\n\t\t\t\t\t\t<p className=\"hasValue\">{getOptionLabel(forceSelectedOptions)}</p>\n\t\t\t\t\t)}\n\t\t\t\t\t{forceSelectedOptions === \"\" && <p>{placeholder}</p>}\n\t\t\t\t</SelectContent>\n\n\t\t\t\t<SelectOptionsContainer\n\t\t\t\t\tisFocused={isFocused}\n\t\t\t\t\tisSearchable={isSearchable}\n\t\t\t\t\tsearch={search}\n\t\t\t\t\tonSearch={handleSearch}\n\t\t\t\t>\n\t\t\t\t\t{mappedOptions.map(({ label, value }) => (\n\t\t\t\t\t\t<SelectOption\n\t\t\t\t\t\t\tkey={value}\n\t\t\t\t\t\t\tlabel={label}\n\t\t\t\t\t\t\tvalue={value}\n\t\t\t\t\t\t\tsize={size}\n\t\t\t\t\t\t\thandleChangeValue={handleChangeValue}\n\t\t\t\t\t\t\toptionHasSelected={optionHasSelected}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\n\t\t\t\t\t{mappedOptions.length <= 0 && <p>{notFoundText}</p>}\n\t\t\t\t</SelectOptionsContainer>\n\n\t\t\t\t<SelectChevron\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tisFocused={isFocused}\n\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\ticonSize={iconSize}\n\t\t\t\t\tisLoading={isLoading}\n\t\t\t\t/>\n\n\t\t\t\t<SelectSpinner iconSize={iconSize} isLoading={isLoading} />\n\t\t\t\t<SelectOverlay handleBlur={handleBlur} isFocused={isFocused} />\n\t\t\t</SelectContainer>\n\t\t</FieldTemplate>\n\t);\n}\n\nexport { Select };\n"],"mappings":"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"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/select/index.tsx"],"sourcesContent":["import type { LucideIcon } from \"lucide-react\";\nimport { type FocusEvent, useId, useRef, useState } from \"react\";\n\nimport { useForm } from \"../../hooks/useForm\";\nimport { FieldTemplate } from \"../../services/fieldTemplate\";\nimport { IconRenderer } from \"../../services/iconRenderer\";\n\nimport { SelectChevron } from \"./selectChevron\";\nimport { SelectContainer } from \"./selectContainer\";\nimport { SelectContent } from \"./selectContent\";\nimport { SelectOption } from \"./selectOption\";\nimport { SelectOptionsContainer } from \"./selectOptionsContainer\";\nimport { SelectOverlay } from \"./selectOverlay\";\nimport { SelectSpinner } from \"./selectSpinner\";\n\ntype SelectProps = {\n\t/** Field name for form submission. Required. */\n\tname: string;\n\t/** Array of selectable options. Required. */\n\toptions: { label: string; value: string }[];\n\t/** Optional HTML id for the underlying hidden input. */\n\tid?: string;\n\t/** Controlled selected value. */\n\tvalue?: string;\n\t/** Uncontrolled default selected value. @default \"\" */\n\tdefaultValue?: string;\n\t/** Displays an asterisk on the label to signal a required field. */\n\tshowAsterisk?: boolean;\n\t/** Optional label text displayed above the select. */\n\tlabel?: string;\n\t/** Validation error message displayed below the select. */\n\terrorMessage?: string;\n\t/** Placeholder text shown when no option is selected. @default \"Selecione...\" */\n\tplaceholder?: string;\n\t/** Text shown when no options match the search query. @default \"Sem opções disponíveis\" */\n\tnotFoundText?: string;\n\t/** Additional CSS class applied to the wrapper element. */\n\tclassName?: string;\n\t/** Disables all interactions. @default false */\n\tdisabled?: boolean;\n\t/** Prevents value changes while keeping the current value visible. @default false */\n\treadOnly?: boolean;\n\t/** Shows a loading spinner and disables interactions. @default false */\n\tisLoading?: boolean;\n\t/** Enables search/filter within the dropdown. @default false */\n\tisSearchable?: boolean;\n\t/** Closes the dropdown after an option is selected. @default true */\n\tcloseOnSelect?: boolean;\n\t/** Callback fired when the search query changes. Use for async option loading. */\n\tonSearch?: (value: string) => void;\n\t/** Callback fired when the selected value changes. */\n\tonChange?: (value: string) => void;\n\t/** Callback fired when the select gains focus. */\n\tonFocus?: () => void;\n\t/** Callback fired when the select loses focus. */\n\tonBlur?: (e: FocusEvent<HTMLDivElement>) => void;\n\t/**\n\t * Select size.\n\t * @default \"md\"\n\t */\n\tsize?: \"md\" | \"lg\";\n\t/**\n\t * Visual style variant.\n\t * - `solid`: filled background.\n\t * - `outline`: bordered, transparent background.\n\t * - `underline`: bottom border only.\n\t * @default \"solid\"\n\t */\n\tvariant?: \"solid\" | \"outline\" | \"underline\";\n\t/** Text or icon rendered at the far left, outside the select area. */\n\tprefix?: string | LucideIcon;\n\t/** Lucide icon rendered inside the select on the left. */\n\tleftIcon?: LucideIcon;\n\t/** Maximum height (in px) of the options dropdown. */\n\toptionMaxHeight?: number;\n\t/** When true, skips `FieldTemplate` wrapper (label and error text). @default false */\n\tunShowFieldTemplate?: boolean;\n\t/**\n\t * Layout direction forwarded to `FieldTemplate`.\n\t * @default \"horizontal\"\n\t */\n\torientation?: \"horizontal\" | \"vertical\" | \"horizontalReverse\";\n};\n\n/**\n * Select, single-option dropdown with optional search, label, validation, and form integration.\n *\n * Integrates with `useForm` to display validation errors by field name.\n *\n * @param props.name - Field name for form submission. Required.\n * @param props.options - Array of selectable options (`{ label, value }`). Required.\n * @param props.value - Controlled selected value.\n * @param props.defaultValue - Uncontrolled default value. Default: \"\"\n * @param props.label - Label text displayed above the select.\n * @param props.placeholder - Placeholder shown when nothing is selected. Default: \"Selecione...\"\n * @param props.errorMessage - Validation error message.\n * @param props.isSearchable - Enables search/filter within the dropdown. Default: false\n * @param props.isLoading - Shows a loading spinner and disables interactions. Default: false\n * @param props.closeOnSelect - Closes the dropdown after selecting. Default: true\n * @param props.onChange - Callback fired when the selected value changes.\n * @param props.onSearch - Callback fired when the search query changes.\n * @param props.size - Select size (`md` | `lg`). Default: \"md\"\n * @param props.variant - Visual style variant. Default: \"solid\"\n * @param props.orientation - Layout direction. Default: \"horizontal\"\n * @param props.unShowFieldTemplate - Skips wrapper, label, and error rendering. Default: false\n *\n * @returns Select JSX element wrapped in `FieldTemplate`.\n *\n * @example\n * ```tsx\n * // Basic\n * <Select\n * name=\"category\"\n * options={[\n * { label: \"Technology\", value: \"tech\" },\n * { label: \"Design\", value: \"design\" },\n * ]}\n * />\n *\n * // With label, validation, and searchable\n * <Select\n * name=\"country\"\n * label=\"Country\"\n * showAsterisk\n * isSearchable\n * options={countryOptions}\n * errorMessage={errors.country}\n * notFoundText=\"No countries found\"\n * />\n *\n * // Controlled with async search\n * <Select\n * name=\"tag\"\n * label=\"Tag\"\n * value={selectedTag}\n * onChange={setSelectedTag}\n * onSearch={fetchTagOptions}\n * isLoading={isLoadingTags}\n * options={tagOptions}\n * />\n * ```\n */\n\nfunction Select(props: SelectProps) {\n\tconst {\n\t\tname,\n\t\toptions,\n\t\tclassName: wrapperClassName = \"\",\n\t\tplaceholder = \"Selecione...\",\n\t\tcloseOnSelect = true,\n\t\tdefaultValue = \"\",\n\t\terrorMessage: baseErrorMessage,\n\t\tisLoading = false,\n\t\treadOnly = false,\n\t\tisSearchable = false,\n\t\tid,\n\t\tlabel,\n\t\tshowAsterisk,\n\t\tleftIcon: LeftIcon,\n\t\tonSearch,\n\t\tonChange,\n\t\tonBlur,\n\t\tnotFoundText = \"Sem opções disponíveis\",\n\t\tonFocus,\n\t\tdisabled: baseDisabled = false,\n\t\tprefix,\n\t\tsize = \"md\",\n\t\tvalue,\n\t\tvariant = \"solid\",\n\t\torientation = \"vertical\",\n\t\tunShowFieldTemplate = false,\n\t} = props;\n\n\tconst { fieldErrors } = useForm();\n\n\tconst selectRef = useRef<HTMLInputElement>(null);\n\tconst generatedId = useId();\n\tconst selectId = id || generatedId;\n\n\tconst errorMessage = baseErrorMessage || fieldErrors?.[name];\n\tconst isError = !!errorMessage;\n\tconst disabled = baseDisabled || isLoading || readOnly;\n\n\tconst iconSizes = { md: 20, lg: 20 };\n\tconst iconSize = iconSizes[size];\n\n\tconst [search, setSearch] = useState(\"\");\n\tconst [isFocused, setIsFocused] = useState(false);\n\tconst [selectedOption, setSelectedOption] = useState(defaultValue);\n\n\tconst forceSelectedOptions = value || selectedOption;\n\n\tfunction optionHasSelected(value: string) {\n\t\treturn forceSelectedOptions === value;\n\t}\n\n\tfunction getOptionLabel(value: string) {\n\t\tconst option = options.find((option) => option.value === value);\n\t\treturn option?.label || \"\";\n\t}\n\n\tfunction handleContainerFocus() {\n\t\tif (disabled || !selectRef?.current || isFocused) return;\n\t\tsetIsFocused(true);\n\t\tselectRef.current.focus();\n\t\tonFocus?.();\n\t}\n\n\tfunction handleBlur() {\n\t\tsetIsFocused(false);\n\t\tif (onBlur && selectRef.current) selectRef.current.blur();\n\t}\n\n\tfunction handleSearch(value: string) {\n\t\tsetSearch(value);\n\t\tif (onSearch) onSearch(value);\n\t}\n\n\tfunction handleChangeValue(value: string) {\n\t\tif (optionHasSelected(value)) {\n\t\t\tsetSelectedOption(\"\");\n\t\t\tif (onChange) onChange(\"\");\n\t\t} else {\n\t\t\tsetSelectedOption(value);\n\t\t\tif (onChange) onChange(value);\n\t\t}\n\n\t\tif (closeOnSelect) handleBlur();\n\t}\n\n\tconst mappedOptions = options.filter((option) => {\n\t\tif (props.onSearch) return true;\n\t\tif (!props.isSearchable) return true;\n\t\tif (option.label.toLowerCase().includes(search.toLowerCase())) return true;\n\t\treturn false;\n\t});\n\n\treturn (\n\t\t<FieldTemplate\n\t\t\tname={name}\n\t\t\tlabel={label}\n\t\t\tshowAsterisk={showAsterisk}\n\t\t\tclassName={wrapperClassName}\n\t\t\terrorMessage={errorMessage}\n\t\t\tunShowFieldTemplate={unShowFieldTemplate}\n\t\t\torientation={orientation}\n\t\t>\n\t\t\t<SelectContainer\n\t\t\t\thandleContainerFocus={handleContainerFocus}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tisError={isError}\n\t\t\t\tisFocused={isFocused}\n\t\t\t\tisLoading={isLoading}\n\t\t\t\treadOnly={readOnly}\n\t\t\t\tsize={size}\n\t\t\t\tvariant={variant}\n\t\t\t\tprefixExists={!!prefix}\n\t\t\t\tid={selectId}\n\t\t\t>\n\t\t\t\t<input\n\t\t\t\t\tref={selectRef}\n\t\t\t\t\tname={name}\n\t\t\t\t\tvalue={forceSelectedOptions}\n\t\t\t\t\ttype=\"hidden\"\n\t\t\t\t/>\n\n\t\t\t\t<IconRenderer iconSize={iconSize} icon={prefix} className=\"prefix\" />\n\n\t\t\t\t{LeftIcon && <LeftIcon size={iconSize} strokeWidth={2.5} />}\n\n\t\t\t\t<SelectContent size={size}>\n\t\t\t\t\t{forceSelectedOptions !== \"\" && (\n\t\t\t\t\t\t<p className=\"hasValue\">{getOptionLabel(forceSelectedOptions)}</p>\n\t\t\t\t\t)}\n\t\t\t\t\t{forceSelectedOptions === \"\" && <p>{placeholder}</p>}\n\t\t\t\t</SelectContent>\n\n\t\t\t\t<SelectOptionsContainer\n\t\t\t\t\tisFocused={isFocused}\n\t\t\t\t\tisSearchable={isSearchable}\n\t\t\t\t\tsearch={search}\n\t\t\t\t\tonSearch={handleSearch}\n\t\t\t\t>\n\t\t\t\t\t{mappedOptions.map(({ label, value }) => (\n\t\t\t\t\t\t<SelectOption\n\t\t\t\t\t\t\tkey={value}\n\t\t\t\t\t\t\tlabel={label}\n\t\t\t\t\t\t\tvalue={value}\n\t\t\t\t\t\t\tsize={size}\n\t\t\t\t\t\t\thandleChangeValue={handleChangeValue}\n\t\t\t\t\t\t\toptionHasSelected={optionHasSelected}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\n\t\t\t\t\t{mappedOptions.length <= 0 && <p>{notFoundText}</p>}\n\t\t\t\t</SelectOptionsContainer>\n\n\t\t\t\t<SelectChevron\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tisFocused={isFocused}\n\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\ticonSize={iconSize}\n\t\t\t\t\tisLoading={isLoading}\n\t\t\t\t/>\n\n\t\t\t\t<SelectSpinner iconSize={iconSize} isLoading={isLoading} />\n\t\t\t\t<SelectOverlay handleBlur={handleBlur} isFocused={isFocused} />\n\t\t\t</SelectContainer>\n\t\t</FieldTemplate>\n\t);\n}\n\nexport { Select };\n"],"mappings":"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"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/slider/index.tsx"],"sourcesContent":["import {\n\ttype HTMLAttributes,\n\tuseCallback,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n} from \"react\";\n\nimport \"./styles.css\";\n\ntype SliderProps = Omit<HTMLAttributes<HTMLDivElement>, \"onChange\"> & {\n\t/** Current slider position as a percentage (0–100). Required. */\n\tvalue: number;\n\t/** Callback fired whenever the value changes. Required. */\n\tonChange: (value: number) => void;\n\t/** Disables all drag and click interactions. @default false */\n\tdisabled?: boolean;\n\t/** Callback fired when the dragging state changes (`true` = drag started, `false` = drag ended). */\n\tonDragging?: (isDragging: boolean) => void;\n};\n\n/**\n * Slider interactive track for selecting a numeric value between 0 and 100.\n *\n * Pair with `useSlider` for managed state.\n *\n * @param props.value - Current position as a percentage (0–100). Required.\n * @param props.onChange - Callback fired on value change. Required.\n * @param props.disabled - Disables interactions. Default: false\n * @param props.onDragging - Callback fired when dragging starts or stops.\n *\n * **...Other valid HTML properties for `<div>`**\n *\n * @returns Slider JSX element.\n *\n * @example\n * ```tsx\n * // Controlled slider\n * const [value, setValue] = useState(50);\n * <Slider value={value} onChange={setValue} />\n *\n * // With useSlider hook\n * const [value, setValue] = useSlider(25);\n * <Slider value={value} onChange={setValue} onDragging={setIsDragging} />\n *\n * // Disabled\n * <Slider value={75} onChange={() => {}} disabled />\n * ```\n */\n\nfunction Slider(props: SliderProps) {\n\tconst {\n\t\tonChange,\n\t\tvalue,\n\t\tdisabled = false,\n\t\tonDragging,\n\t\tclassName = \"\",\n\t\t...rest\n\t} = props;\n\n\tconst [isDragging, setIsDragging] = useState(false);\n\tconst sliderRef = useRef<HTMLDivElement>(null);\n\n\tconst handleMouseDown = () => setIsDragging(true);\n\tconst handleMouseUp = useCallback(() => setIsDragging(false), []);\n\n\tconst handleMouseMove = useCallback(\n\t\t(event: MouseEvent) => {\n\t\t\tif (disabled) return;\n\t\t\tif (!isDragging || !sliderRef.current) return;\n\n\t\t\tconst rect = sliderRef.current.getBoundingClientRect();\n\t\t\tconst offsetX = event.clientX - rect.left;\n\t\t\tconst newValue = Math.min(Math.max((offsetX / rect.width) * 100, 0), 100);\n\n\t\t\tonChange(newValue);\n\t\t},\n\t\t[disabled, isDragging, onChange],\n\t);\n\n\tconst handleSliderClick = (event: React.MouseEvent<HTMLDivElement>) => {\n\t\tif (disabled) return;\n\t\tif (!sliderRef.current) return;\n\n\t\tconst rect = sliderRef.current.getBoundingClientRect();\n\t\tconst offsetX = event.clientX - rect.left;\n\t\tconst newValue = Math.min(Math.max((offsetX / rect.width) * 100, 0), 100);\n\n\t\tonChange(newValue);\n\t};\n\n\tuseEffect(() => {\n\t\tif (isDragging) {\n\t\t\tonDragging?.(true);\n\t\t\tdocument.addEventListener(\"mousemove\", handleMouseMove);\n\t\t\tdocument.addEventListener(\"mouseup\", handleMouseUp);\n\t\t} else {\n\t\t\tonDragging?.(false);\n\t\t\tdocument.removeEventListener(\"mousemove\", handleMouseMove);\n\t\t\tdocument.removeEventListener(\"mouseup\", handleMouseUp);\n\t\t}\n\n\t\treturn () => {\n\t\t\tdocument.removeEventListener(\"mousemove\", handleMouseMove);\n\t\t\tdocument.removeEventListener(\"mouseup\", handleMouseUp);\n\t\t};\n\t}, [isDragging, onDragging, handleMouseUp, handleMouseMove]);\n\n\tconst isDraggingClass = isDragging ? \"isDragging\" : \"isNotDragging\";\n\tconst disabledClass = disabled ? \"isDisabled\" : \"isEnabled\";\n\tconst sliderClassname = `arkynSliderTrack ${isDraggingClass} ${disabledClass} ${className}`;\n\n\treturn (\n\t\t<div\n\t\t\t{...rest}\n\t\t\tclassName={sliderClassname}\n\t\t\tonMouseDown={handleMouseDown}\n\t\t\tonClick={handleSliderClick}\n\t\t\tref={sliderRef}\n\t\t>\n\t\t\t<div className=\"arkynSliderFill\" style={{ width: `${value}%` }} />\n\t\t\t<div className=\"arkynSliderThumb\" style={{ left: `${value}%` }} />\n\t\t</div>\n\t);\n}\n\nexport { Slider };\n"],"mappings":";;;;AAkDA,SAAS,EAAO,GAAoB;CACnC,IAAM,EACL,aACA,UACA,cAAW,IACX,eACA,eAAY,IACZ,GAAG,MACA,GAEE,CAAC,GAAY,KAAiB,EAAS,EAAK,GAC5C,IAAY,EAAuB,IAAI,GAEvC,UAAwB,EAAc,EAAI,GAC1C,IAAgB,QAAkB,EAAc,EAAK,GAAG,CAAC,CAAC,GAE1D,IAAkB,GACtB,MAAsB;EAEtB,IADI,KACA,CAAC,KAAc,CAAC,EAAU,SAAS;EAEvC,IAAM,IAAO,EAAU,QAAQ,sBAAsB,GAC/C,IAAU,EAAM,UAAU,EAAK;EAGrC,EAFiB,KAAK,IAAI,KAAK,IAAK,IAAU,EAAK,QAAS,KAAK,CAAC,GAAG,GAE5D,CAAQ;CAClB,GACA;EAAC;EAAU;EAAY;CAAQ,CAChC,GAEM,KAAqB,MAA4C;EAEtE,IADI,KACA,CAAC,EAAU,SAAS;EAExB,IAAM,IAAO,EAAU,QAAQ,sBAAsB,GAC/C,IAAU,EAAM,UAAU,EAAK;EAGrC,EAFiB,KAAK,IAAI,KAAK,IAAK,IAAU,EAAK,QAAS,KAAK,CAAC,GAAG,GAE5D,CAAQ;CAClB;CAEA,SACK,KACH,IAAa,EAAI,GACjB,SAAS,iBAAiB,aAAa,CAAe,GACtD,SAAS,iBAAiB,WAAW,CAAa,MAElD,IAAa,EAAK,GAClB,SAAS,oBAAoB,aAAa,CAAe,GACzD,SAAS,oBAAoB,WAAW,CAAa,UAGzC;EAEZ,AADA,SAAS,oBAAoB,aAAa,CAAe,GACzD,SAAS,oBAAoB,WAAW,CAAa;CACtD,IACE;EAAC;EAAY;EAAY;EAAe;CAAe,CAAC;CAI3D,IAAM,IAAkB,oBAFA,IAAa,eAAe,gBAEQ,GADtC,IAAW,eAAe,YAC6B,GAAG;CAEhF,OACC,kBAAC,OAAD;EACC,GAAI;EACJ,WAAW;EACX,aAAa;EACb,SAAS;EACT,KAAK;YALN,CAOC,kBAAC,OAAD;GAAK,WAAU;GAAkB,OAAO,EAAE,OAAO,GAAG,EAAM,GAAG;EAAI,CAAA,GACjE,kBAAC,OAAD;GAAK,WAAU;GAAmB,OAAO,EAAE,MAAM,GAAG,EAAM,GAAG;EAAI,CAAA,CAC7D;;AAEP"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/slider/index.tsx"],"sourcesContent":["import {\n\ttype HTMLAttributes,\n\tuseCallback,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n} from \"react\";\n\nimport \"./styles.css\";\n\ntype SliderProps = Omit<HTMLAttributes<HTMLDivElement>, \"onChange\"> & {\n\t/** Current slider position as a percentage (0–100). Required. */\n\tvalue: number;\n\t/** Callback fired whenever the value changes. Required. */\n\tonChange: (value: number) => void;\n\t/** Disables all drag and click interactions. @default false */\n\tdisabled?: boolean;\n\t/** Callback fired when the dragging state changes (`true` = drag started, `false` = drag ended). */\n\tonDragging?: (isDragging: boolean) => void;\n};\n\n/**\n * Slider, interactive track for selecting a numeric value between 0 and 100.\n *\n * Pair with `useSlider` for managed state.\n *\n * @param props.value - Current position as a percentage (0–100). Required.\n * @param props.onChange - Callback fired on value change. Required.\n * @param props.disabled - Disables interactions. Default: false\n * @param props.onDragging - Callback fired when dragging starts or stops.\n *\n * **...Other valid HTML properties for `<div>`**\n *\n * @returns Slider JSX element.\n *\n * @example\n * ```tsx\n * // Controlled slider\n * const [value, setValue] = useState(50);\n * <Slider value={value} onChange={setValue} />\n *\n * // With useSlider hook\n * const [value, setValue] = useSlider(25);\n * <Slider value={value} onChange={setValue} onDragging={setIsDragging} />\n *\n * // Disabled\n * <Slider value={75} onChange={() => {}} disabled />\n * ```\n */\n\nfunction Slider(props: SliderProps) {\n\tconst {\n\t\tonChange,\n\t\tvalue,\n\t\tdisabled = false,\n\t\tonDragging,\n\t\tclassName = \"\",\n\t\t...rest\n\t} = props;\n\n\tconst [isDragging, setIsDragging] = useState(false);\n\tconst sliderRef = useRef<HTMLDivElement>(null);\n\n\tconst handleMouseDown = () => setIsDragging(true);\n\tconst handleMouseUp = useCallback(() => setIsDragging(false), []);\n\n\tconst handleMouseMove = useCallback(\n\t\t(event: MouseEvent) => {\n\t\t\tif (disabled) return;\n\t\t\tif (!isDragging || !sliderRef.current) return;\n\n\t\t\tconst rect = sliderRef.current.getBoundingClientRect();\n\t\t\tconst offsetX = event.clientX - rect.left;\n\t\t\tconst newValue = Math.min(Math.max((offsetX / rect.width) * 100, 0), 100);\n\n\t\t\tonChange(newValue);\n\t\t},\n\t\t[disabled, isDragging, onChange],\n\t);\n\n\tconst handleSliderClick = (event: React.MouseEvent<HTMLDivElement>) => {\n\t\tif (disabled) return;\n\t\tif (!sliderRef.current) return;\n\n\t\tconst rect = sliderRef.current.getBoundingClientRect();\n\t\tconst offsetX = event.clientX - rect.left;\n\t\tconst newValue = Math.min(Math.max((offsetX / rect.width) * 100, 0), 100);\n\n\t\tonChange(newValue);\n\t};\n\n\tuseEffect(() => {\n\t\tif (isDragging) {\n\t\t\tonDragging?.(true);\n\t\t\tdocument.addEventListener(\"mousemove\", handleMouseMove);\n\t\t\tdocument.addEventListener(\"mouseup\", handleMouseUp);\n\t\t} else {\n\t\t\tonDragging?.(false);\n\t\t\tdocument.removeEventListener(\"mousemove\", handleMouseMove);\n\t\t\tdocument.removeEventListener(\"mouseup\", handleMouseUp);\n\t\t}\n\n\t\treturn () => {\n\t\t\tdocument.removeEventListener(\"mousemove\", handleMouseMove);\n\t\t\tdocument.removeEventListener(\"mouseup\", handleMouseUp);\n\t\t};\n\t}, [isDragging, onDragging, handleMouseUp, handleMouseMove]);\n\n\tconst isDraggingClass = isDragging ? \"isDragging\" : \"isNotDragging\";\n\tconst disabledClass = disabled ? \"isDisabled\" : \"isEnabled\";\n\tconst sliderClassname = `arkynSliderTrack ${isDraggingClass} ${disabledClass} ${className}`;\n\n\treturn (\n\t\t<div\n\t\t\t{...rest}\n\t\t\tclassName={sliderClassname}\n\t\t\tonMouseDown={handleMouseDown}\n\t\t\tonClick={handleSliderClick}\n\t\t\tref={sliderRef}\n\t\t>\n\t\t\t<div className=\"arkynSliderFill\" style={{ width: `${value}%` }} />\n\t\t\t<div className=\"arkynSliderThumb\" style={{ left: `${value}%` }} />\n\t\t</div>\n\t);\n}\n\nexport { Slider };\n"],"mappings":";;;;AAkDA,SAAS,EAAO,GAAoB;CACnC,IAAM,EACL,aACA,UACA,cAAW,IACX,eACA,eAAY,IACZ,GAAG,MACA,GAEE,CAAC,GAAY,KAAiB,EAAS,EAAK,GAC5C,IAAY,EAAuB,IAAI,GAEvC,UAAwB,EAAc,EAAI,GAC1C,IAAgB,QAAkB,EAAc,EAAK,GAAG,CAAC,CAAC,GAE1D,IAAkB,GACtB,MAAsB;EAEtB,IADI,KACA,CAAC,KAAc,CAAC,EAAU,SAAS;EAEvC,IAAM,IAAO,EAAU,QAAQ,sBAAsB,GAC/C,IAAU,EAAM,UAAU,EAAK;EAGrC,EAFiB,KAAK,IAAI,KAAK,IAAK,IAAU,EAAK,QAAS,KAAK,CAAC,GAAG,GAE5D,CAAQ;CAClB,GACA;EAAC;EAAU;EAAY;CAAQ,CAChC,GAEM,KAAqB,MAA4C;EAEtE,IADI,KACA,CAAC,EAAU,SAAS;EAExB,IAAM,IAAO,EAAU,QAAQ,sBAAsB,GAC/C,IAAU,EAAM,UAAU,EAAK;EAGrC,EAFiB,KAAK,IAAI,KAAK,IAAK,IAAU,EAAK,QAAS,KAAK,CAAC,GAAG,GAE5D,CAAQ;CAClB;CAEA,SACK,KACH,IAAa,EAAI,GACjB,SAAS,iBAAiB,aAAa,CAAe,GACtD,SAAS,iBAAiB,WAAW,CAAa,MAElD,IAAa,EAAK,GAClB,SAAS,oBAAoB,aAAa,CAAe,GACzD,SAAS,oBAAoB,WAAW,CAAa,UAGzC;EAEZ,AADA,SAAS,oBAAoB,aAAa,CAAe,GACzD,SAAS,oBAAoB,WAAW,CAAa;CACtD,IACE;EAAC;EAAY;EAAY;EAAe;CAAe,CAAC;CAI3D,IAAM,IAAkB,oBAFA,IAAa,eAAe,gBAEQ,GADtC,IAAW,eAAe,YAC6B,GAAG;CAEhF,OACC,kBAAC,OAAD;EACC,GAAI;EACJ,WAAW;EACX,aAAa;EACb,SAAS;EACT,KAAK;YALN,CAOC,kBAAC,OAAD;GAAK,WAAU;GAAkB,OAAO,EAAE,OAAO,GAAG,EAAM,GAAG;EAAI,CAAA,GACjE,kBAAC,OAAD;GAAK,WAAU;GAAmB,OAAO,EAAE,MAAM,GAAG,EAAM,GAAG;EAAI,CAAA,CAC7D;;AAEP"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/switch/index.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes } from \"react\";\nimport { useId, useRef, useState } from \"react\";\n\nimport { FieldTemplate } from \"../../services/fieldTemplate\";\nimport \"./styles.css\";\n\ntype SwitchProps = Omit<\n\tButtonHTMLAttributes<HTMLButtonElement>,\n\t\"children\" | \"onChange\" | \"defaultValue\" | \"onCheck\" | \"value\"\n> & {\n\t/** Optional label text displayed beside the switch. */\n\tlabel?: string;\n\t/**\n\t * Switch size.\n\t * @default \"lg\"\n\t */\n\tsize?: \"sm\" | \"md\" | \"lg\";\n\t/** Uncontrolled initial checked state. @default false */\n\tdefaultChecked?: boolean;\n\t/** Controlled checked state. */\n\tchecked?: boolean;\n\t/** Value emitted when the switch is on. @default \"checked\" */\n\tvalue?: string;\n\t/** Value emitted when the switch is off. @default \"\" */\n\tunCheckedValue?: string;\n\t/** Field name for form submission. Required. */\n\tname: string;\n\t/** Callback fired on toggle receives the current value string. */\n\tonCheck?: (value: string) => void;\n\t/**\n\t * Layout direction forwarded to `FieldTemplate`.\n\t * @default \"horizontalReverse\"\n\t */\n\torientation?: \"vertical\" | \"horizontal\" | \"horizontalReverse\";\n\t/** When true, skips `FieldTemplate` wrapper (label and error text). @default false */\n\tunShowFieldTemplate?: boolean;\n\t/** Displays an asterisk on the label to signal a required field. */\n\tshowAsterisk?: boolean;\n\t/** Validation error message displayed below the switch. */\n\terrorMessage?: string;\n};\n\n/**\n * Switch toggle input for binary on/off states.\n *\n * Stores value in a hidden `<input>` for native form submission.\n * Integrates with `useForm` to display validation errors by field name.\n *\n * @param props.name - Field name for form submission. Required.\n * @param props.label - Label text displayed beside the switch.\n * @param props.size - Switch size (`sm` | `md` | `lg`). Default: \"lg\"\n * @param props.defaultChecked - Uncontrolled initial checked state. Default: false\n * @param props.checked - Controlled checked state.\n * @param props.value - Value emitted when on. Default: \"checked\"\n * @param props.unCheckedValue - Value emitted when off. Default: \"\"\n * @param props.onCheck - Callback fired on toggle receives the current value string.\n * @param props.orientation - Layout direction (`horizontal` | `vertical` | `horizontalReverse`). Default: \"horizontalReverse\"\n * @param props.unShowFieldTemplate - Skips wrapper, label, and error rendering. Default: false\n * @param props.showAsterisk - Appends `*` to the label.\n * @param props.errorMessage - Validation error message.\n *\n * **...Other valid HTML properties for `<button>` (except `children`, `onChange`, `defaultValue`)**\n *\n * @returns Switch JSX element wrapped in `FieldTemplate`.\n *\n * @example\n * ```tsx\n * // Basic\n * <Switch name=\"notifications\" label=\"Enable notifications\" />\n *\n * // Custom on/off values\n * <Switch\n * name=\"theme\"\n * label=\"Dark mode\"\n * value=\"dark\"\n * unCheckedValue=\"light\"\n * onCheck={(v) => setTheme(v)}\n * />\n *\n * // Controlled\n * <Switch\n * name=\"autoSave\"\n * label=\"Auto-save\"\n * checked={isAutoSaveEnabled}\n * onCheck={(v) => setAutoSave(!!v)}\n * size=\"md\"\n * />\n * ```\n */\n\nfunction Switch(props: SwitchProps) {\n\tconst {\n\t\tlabel,\n\t\tsize = \"lg\",\n\t\tdefaultChecked = false,\n\t\tchecked: baseChecked = null,\n\t\tvalue,\n\t\tunCheckedValue = \"\",\n\t\tname,\n\t\tclassName: baseClassName = \"\",\n\t\tonCheck,\n\t\tid,\n\t\torientation = \"horizontalReverse\",\n\t\tclassName: wrapperClassName = \"\",\n\t\tshowAsterisk,\n\t\terrorMessage,\n\t\tunShowFieldTemplate = false,\n\t\t...rest\n\t} = props;\n\n\tconst inputRef = useRef<HTMLInputElement>(null);\n\tconst generatedId = useId();\n\tconst inputId = id || generatedId;\n\n\tconst [isChecked, setIsChecked] = useState(defaultChecked);\n\n\tconst currentChecked =\n\t\ttypeof baseChecked === \"boolean\" ? baseChecked : isChecked;\n\n\tfunction handleCheck() {\n\t\tsetIsChecked(!isChecked);\n\t\tonCheck?.(!currentChecked ? value || \"checked\" : unCheckedValue);\n\t}\n\n\tconst checkedClass = currentChecked ? \"checkedTrue\" : \"checkedFalse\";\n\tconst className = `arkynSwitch ${checkedClass} ${size} ${baseClassName}`;\n\n\treturn (\n\t\t<FieldTemplate\n\t\t\tname={name}\n\t\t\tlabel={label}\n\t\t\tshowAsterisk={showAsterisk}\n\t\t\tclassName={wrapperClassName}\n\t\t\terrorMessage={errorMessage}\n\t\t\tunShowFieldTemplate={unShowFieldTemplate}\n\t\t\torientation={orientation}\n\t\t>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tonClick={handleCheck}\n\t\t\t\tclassName={className}\n\t\t\t\t{...rest}\n\t\t\t>\n\t\t\t\t<input\n\t\t\t\t\tid={inputId}\n\t\t\t\t\ttype=\"hidden\"\n\t\t\t\t\tname={name}\n\t\t\t\t\tref={inputRef}\n\t\t\t\t\tonClick={handleCheck}\n\t\t\t\t\tvalue={currentChecked ? value || \"checked\" : unCheckedValue}\n\t\t\t\t/>\n\t\t\t</button>\n\t\t</FieldTemplate>\n\t);\n}\n\nexport { Switch };\n"],"mappings":";;;;;AA0FA,SAAS,EAAO,GAAoB;CACnC,IAAM,EACL,UACA,UAAO,MACP,oBAAiB,IACjB,SAAS,IAAc,MACvB,UACA,oBAAiB,IACjB,SACA,WAAW,IAAgB,IAC3B,YACA,OACA,iBAAc,qBACd,WAAW,IAAmB,IAC9B,iBACA,iBACA,yBAAsB,IACtB,GAAG,MACA,GAEE,IAAW,EAAyB,IAAI,GACxC,IAAc,EAAM,GACpB,IAAU,KAAM,GAEhB,CAAC,GAAW,KAAgB,EAAS,CAAc,GAEnD,IACL,OAAO,KAAgB,YAAY,IAAc;CAElD,SAAS,IAAc;EAEtB,AADA,EAAa,CAAC,CAAS,GACvB,IAAW,IAAsC,IAArB,KAAS,SAA0B;CAChE;CAKA,OACC,kBAAC,GAAD;EACO;EACC;EACO;EACd,WAAW;EACG;EACO;EACR;YAEb,kBAAC,UAAD;GACC,MAAK;GACL,SAAS;GACE,WAAA,eAhBO,IAAiB,gBAAgB,eACR,GAAG,EAAK,GAAG;GAgBtD,GAAI;aAEJ,kBAAC,SAAD;IACC,IAAI;IACJ,MAAK;IACC;IACN,KAAK;IACL,SAAS;IACT,OAAO,IAAiB,KAAS,YAAY;GAC7C,CAAA;EACM,CAAA;CACM,CAAA;AAEjB"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/switch/index.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes } from \"react\";\nimport { useId, useRef, useState } from \"react\";\n\nimport { FieldTemplate } from \"../../services/fieldTemplate\";\nimport \"./styles.css\";\n\ntype SwitchProps = Omit<\n\tButtonHTMLAttributes<HTMLButtonElement>,\n\t\"children\" | \"onChange\" | \"defaultValue\" | \"onCheck\" | \"value\"\n> & {\n\t/** Optional label text displayed beside the switch. */\n\tlabel?: string;\n\t/**\n\t * Switch size.\n\t * @default \"lg\"\n\t */\n\tsize?: \"sm\" | \"md\" | \"lg\";\n\t/** Uncontrolled initial checked state. @default false */\n\tdefaultChecked?: boolean;\n\t/** Controlled checked state. */\n\tchecked?: boolean;\n\t/** Value emitted when the switch is on. @default \"checked\" */\n\tvalue?: string;\n\t/** Value emitted when the switch is off. @default \"\" */\n\tunCheckedValue?: string;\n\t/** Field name for form submission. Required. */\n\tname: string;\n\t/** Callback fired on toggle, receives the current value string. */\n\tonCheck?: (value: string) => void;\n\t/**\n\t * Layout direction forwarded to `FieldTemplate`.\n\t * @default \"horizontalReverse\"\n\t */\n\torientation?: \"vertical\" | \"horizontal\" | \"horizontalReverse\";\n\t/** When true, skips `FieldTemplate` wrapper (label and error text). @default false */\n\tunShowFieldTemplate?: boolean;\n\t/** Displays an asterisk on the label to signal a required field. */\n\tshowAsterisk?: boolean;\n\t/** Validation error message displayed below the switch. */\n\terrorMessage?: string;\n};\n\n/**\n * Switch, toggle input for binary on/off states.\n *\n * Stores value in a hidden `<input>` for native form submission.\n * Integrates with `useForm` to display validation errors by field name.\n *\n * @param props.name - Field name for form submission. Required.\n * @param props.label - Label text displayed beside the switch.\n * @param props.size - Switch size (`sm` | `md` | `lg`). Default: \"lg\"\n * @param props.defaultChecked - Uncontrolled initial checked state. Default: false\n * @param props.checked - Controlled checked state.\n * @param props.value - Value emitted when on. Default: \"checked\"\n * @param props.unCheckedValue - Value emitted when off. Default: \"\"\n * @param props.onCheck - Callback fired on toggle, receives the current value string.\n * @param props.orientation - Layout direction (`horizontal` | `vertical` | `horizontalReverse`). Default: \"horizontalReverse\"\n * @param props.unShowFieldTemplate - Skips wrapper, label, and error rendering. Default: false\n * @param props.showAsterisk - Appends `*` to the label.\n * @param props.errorMessage - Validation error message.\n *\n * **...Other valid HTML properties for `<button>` (except `children`, `onChange`, `defaultValue`)**\n *\n * @returns Switch JSX element wrapped in `FieldTemplate`.\n *\n * @example\n * ```tsx\n * // Basic\n * <Switch name=\"notifications\" label=\"Enable notifications\" />\n *\n * // Custom on/off values\n * <Switch\n * name=\"theme\"\n * label=\"Dark mode\"\n * value=\"dark\"\n * unCheckedValue=\"light\"\n * onCheck={(v) => setTheme(v)}\n * />\n *\n * // Controlled\n * <Switch\n * name=\"autoSave\"\n * label=\"Auto-save\"\n * checked={isAutoSaveEnabled}\n * onCheck={(v) => setAutoSave(!!v)}\n * size=\"md\"\n * />\n * ```\n */\n\nfunction Switch(props: SwitchProps) {\n\tconst {\n\t\tlabel,\n\t\tsize = \"lg\",\n\t\tdefaultChecked = false,\n\t\tchecked: baseChecked = null,\n\t\tvalue,\n\t\tunCheckedValue = \"\",\n\t\tname,\n\t\tclassName: baseClassName = \"\",\n\t\tonCheck,\n\t\tid,\n\t\torientation = \"horizontalReverse\",\n\t\tclassName: wrapperClassName = \"\",\n\t\tshowAsterisk,\n\t\terrorMessage,\n\t\tunShowFieldTemplate = false,\n\t\t...rest\n\t} = props;\n\n\tconst inputRef = useRef<HTMLInputElement>(null);\n\tconst generatedId = useId();\n\tconst inputId = id || generatedId;\n\n\tconst [isChecked, setIsChecked] = useState(defaultChecked);\n\n\tconst currentChecked =\n\t\ttypeof baseChecked === \"boolean\" ? baseChecked : isChecked;\n\n\tfunction handleCheck() {\n\t\tsetIsChecked(!isChecked);\n\t\tonCheck?.(!currentChecked ? value || \"checked\" : unCheckedValue);\n\t}\n\n\tconst checkedClass = currentChecked ? \"checkedTrue\" : \"checkedFalse\";\n\tconst className = `arkynSwitch ${checkedClass} ${size} ${baseClassName}`;\n\n\treturn (\n\t\t<FieldTemplate\n\t\t\tname={name}\n\t\t\tlabel={label}\n\t\t\tshowAsterisk={showAsterisk}\n\t\t\tclassName={wrapperClassName}\n\t\t\terrorMessage={errorMessage}\n\t\t\tunShowFieldTemplate={unShowFieldTemplate}\n\t\t\torientation={orientation}\n\t\t>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tonClick={handleCheck}\n\t\t\t\tclassName={className}\n\t\t\t\t{...rest}\n\t\t\t>\n\t\t\t\t<input\n\t\t\t\t\tid={inputId}\n\t\t\t\t\ttype=\"hidden\"\n\t\t\t\t\tname={name}\n\t\t\t\t\tref={inputRef}\n\t\t\t\t\tonClick={handleCheck}\n\t\t\t\t\tvalue={currentChecked ? value || \"checked\" : unCheckedValue}\n\t\t\t\t/>\n\t\t\t</button>\n\t\t</FieldTemplate>\n\t);\n}\n\nexport { Switch };\n"],"mappings":";;;;;AA0FA,SAAS,EAAO,GAAoB;CACnC,IAAM,EACL,UACA,UAAO,MACP,oBAAiB,IACjB,SAAS,IAAc,MACvB,UACA,oBAAiB,IACjB,SACA,WAAW,IAAgB,IAC3B,YACA,OACA,iBAAc,qBACd,WAAW,IAAmB,IAC9B,iBACA,iBACA,yBAAsB,IACtB,GAAG,MACA,GAEE,IAAW,EAAyB,IAAI,GACxC,IAAc,EAAM,GACpB,IAAU,KAAM,GAEhB,CAAC,GAAW,KAAgB,EAAS,CAAc,GAEnD,IACL,OAAO,KAAgB,YAAY,IAAc;CAElD,SAAS,IAAc;EAEtB,AADA,EAAa,CAAC,CAAS,GACvB,IAAW,IAAsC,IAArB,KAAS,SAA0B;CAChE;CAKA,OACC,kBAAC,GAAD;EACO;EACC;EACO;EACd,WAAW;EACG;EACO;EACR;YAEb,kBAAC,UAAD;GACC,MAAK;GACL,SAAS;GACE,WAAA,eAhBO,IAAiB,gBAAgB,eACR,GAAG,EAAK,GAAG;GAgBtD,GAAI;aAEJ,kBAAC,SAAD;IACC,IAAI;IACJ,MAAK;IACC;IACN,KAAK;IACL,SAAS;IACT,OAAO,IAAiB,KAAS,YAAY;GAC7C,CAAA;EACM,CAAA;CACM,CAAA;AAEjB"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/tab/tabButton/index.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes, MouseEvent, ReactNode } from \"react\";\n\nimport { useTab } from \"../tabContext\";\nimport \"./styles.css\";\n\ntype TabButtonProps = Omit<\n\tButtonHTMLAttributes<HTMLButtonElement>,\n\t\"children\" | \"value\" | \"type\"\n> & {\n\t/** Content displayed inside the tab button. */\n\tchildren: ReactNode;\n\t/** Unique identifier for this tab; matched against the container's active value. */\n\tvalue: string;\n};\n\n/**\n * TabButton individual tab button inside a `TabContainer`.\n *\n * Reads active state and disabled state from `TabContainer` context.\n * The button's own `disabled` prop is ORed with the container's `disabled`.\n *\n * @param props.children - Tab label content. Required.\n * @param props.value - Tab identifier. Required.\n * @param props.disabled - Disables this tab individually (container can also disable all tabs).\n *\n * **...Other valid HTML `<button>` properties except `type`**\n *\n * @returns TabButton JSX element.\n *\n * @example\n * ```tsx\n * <TabContainer defaultValue=\"overview\" onChange={setTab}>\n * <TabButton value=\"overview\">Overview</TabButton>\n * <TabButton value=\"activity\">Activity</TabButton>\n * <TabButton value=\"settings\" disabled>Settings</TabButton>\n * </TabContainer>\n * ```\n */\n\nfunction TabButton(props: TabButtonProps) {\n\tconst {\n\t\tchildren,\n\t\tdisabled: rawDisabled = false,\n\t\tclassName: baseClassName = \"\",\n\t\tonClick,\n\t\tvalue,\n\t\t...rest\n\t} = props;\n\n\tconst { disabled, currentTab, changeCurrentTab } = useTab();\n\n\tconst isDisabled = disabled || rawDisabled;\n\n\tconst disabledClass = isDisabled ? \"isDisabled\" : \"\";\n\tconst activeClass = currentTab === value && value ? \"isActive\" : \"\";\n\tconst className = `arkynTabButton ${disabledClass} ${activeClass} ${baseClassName}`;\n\n\tfunction handleClick(event: MouseEvent<HTMLButtonElement>) {\n\t\tchangeCurrentTab(value);\n\t\tonClick?.(event);\n\t}\n\n\treturn (\n\t\t<button\n\t\t\tonClick={handleClick}\n\t\t\tclassName={className.trim()}\n\t\t\t{...rest}\n\t\t\tdisabled={isDisabled}\n\t\t\ttype=\"button\"\n\t\t>\n\t\t\t{children}\n\t\t</button>\n\t);\n}\n\nexport { TabButton };\n"],"mappings":";;;;AAuCA,SAAS,EAAU,GAAuB;CACzC,IAAM,EACL,aACA,UAAU,IAAc,IACxB,WAAW,IAAgB,IAC3B,YACA,UACA,GAAG,MACA,GAEE,EAAE,aAAU,eAAY,wBAAqB,EAAO,GAEpD,IAAa,KAAY,GAIzB,IAAY,kBAFI,IAAa,eAAe,GAEA,GAD9B,MAAe,KAAS,IAAQ,aAAa,GACA,GAAG;CAEpE,SAAS,EAAY,GAAsC;EAE1D,AADA,EAAiB,CAAK,GACtB,IAAU,CAAK;CAChB;CAEA,OACC,kBAAC,UAAD;EACC,SAAS;EACT,WAAW,EAAU,KAAK;EAC1B,GAAI;EACJ,UAAU;EACV,MAAK;EAEJ;CACM,CAAA;AAEV"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/tab/tabButton/index.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes, MouseEvent, ReactNode } from \"react\";\n\nimport { useTab } from \"../tabContext\";\nimport \"./styles.css\";\n\ntype TabButtonProps = Omit<\n\tButtonHTMLAttributes<HTMLButtonElement>,\n\t\"children\" | \"value\" | \"type\"\n> & {\n\t/** Content displayed inside the tab button. */\n\tchildren: ReactNode;\n\t/** Unique identifier for this tab; matched against the container's active value. */\n\tvalue: string;\n};\n\n/**\n * TabButton, individual tab button inside a `TabContainer`.\n *\n * Reads active state and disabled state from `TabContainer` context.\n * The button's own `disabled` prop is ORed with the container's `disabled`.\n *\n * @param props.children - Tab label content. Required.\n * @param props.value - Tab identifier. Required.\n * @param props.disabled - Disables this tab individually (container can also disable all tabs).\n *\n * **...Other valid HTML `<button>` properties except `type`**\n *\n * @returns TabButton JSX element.\n *\n * @example\n * ```tsx\n * <TabContainer defaultValue=\"overview\" onChange={setTab}>\n * <TabButton value=\"overview\">Overview</TabButton>\n * <TabButton value=\"activity\">Activity</TabButton>\n * <TabButton value=\"settings\" disabled>Settings</TabButton>\n * </TabContainer>\n * ```\n */\n\nfunction TabButton(props: TabButtonProps) {\n\tconst {\n\t\tchildren,\n\t\tdisabled: rawDisabled = false,\n\t\tclassName: baseClassName = \"\",\n\t\tonClick,\n\t\tvalue,\n\t\t...rest\n\t} = props;\n\n\tconst { disabled, currentTab, changeCurrentTab } = useTab();\n\n\tconst isDisabled = disabled || rawDisabled;\n\n\tconst disabledClass = isDisabled ? \"isDisabled\" : \"\";\n\tconst activeClass = currentTab === value && value ? \"isActive\" : \"\";\n\tconst className = `arkynTabButton ${disabledClass} ${activeClass} ${baseClassName}`;\n\n\tfunction handleClick(event: MouseEvent<HTMLButtonElement>) {\n\t\tchangeCurrentTab(value);\n\t\tonClick?.(event);\n\t}\n\n\treturn (\n\t\t<button\n\t\t\tonClick={handleClick}\n\t\t\tclassName={className.trim()}\n\t\t\t{...rest}\n\t\t\tdisabled={isDisabled}\n\t\t\ttype=\"button\"\n\t\t>\n\t\t\t{children}\n\t\t</button>\n\t);\n}\n\nexport { TabButton };\n"],"mappings":";;;;AAuCA,SAAS,EAAU,GAAuB;CACzC,IAAM,EACL,aACA,UAAU,IAAc,IACxB,WAAW,IAAgB,IAC3B,YACA,UACA,GAAG,MACA,GAEE,EAAE,aAAU,eAAY,wBAAqB,EAAO,GAEpD,IAAa,KAAY,GAIzB,IAAY,kBAFI,IAAa,eAAe,GAEA,GAD9B,MAAe,KAAS,IAAQ,aAAa,GACA,GAAG;CAEpE,SAAS,EAAY,GAAsC;EAE1D,AADA,EAAiB,CAAK,GACtB,IAAU,CAAK;CAChB;CAEA,OACC,kBAAC,UAAD;EACC,SAAS;EACT,WAAW,EAAU,KAAK;EAC1B,GAAI;EACJ,UAAU;EACV,MAAK;EAEJ;CACM,CAAA;AAEV"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/tab/tabContainer/index.tsx"],"sourcesContent":["import { type HTMLAttributes, type ReactNode, useState } from \"react\";\n\nimport { TabProvider } from \"../tabContext\";\nimport \"./styles.css\";\n\ntype TabContainerProps = Omit<\n\tHTMLAttributes<HTMLElement>,\n\t\"onChange\" | \"children\" | \"ref\" | \"onClick\"\n> & {\n\t/** `TabButton` components to render as tabs. Required. */\n\tchildren: ReactNode;\n\t/** Disables all tab buttons at once. @default false */\n\tdisabled?: boolean;\n\t/** Initially selected tab value. */\n\tdefaultValue?: string;\n\t/** Callback fired when the active tab changes, receiving the new value. */\n\tonChange?: (index: string) => void;\n};\n\n/**\n * TabContainer wrapper that manages active state for a group of `TabButton` components.\n *\n * Renders as a `<nav>` element. Provides context consumed by each `TabButton`.\n *\n * @param props.children - `TabButton` elements. Required.\n * @param props.defaultValue - Initially selected tab value.\n * @param props.disabled - Disables all buttons. Default: false\n * @param props.onChange - Called with the new value whenever the active tab changes.\n *\n * **...Other valid HTML `<nav>` properties**\n *\n * @returns TabContainer JSX element.\n *\n * @example\n * ```tsx\n * <TabContainer defaultValue=\"overview\" onChange={setActiveTab}>\n * <TabButton value=\"overview\">Overview</TabButton>\n * <TabButton value=\"analytics\">Analytics</TabButton>\n * <TabButton value=\"settings\">Settings</TabButton>\n * </TabContainer>\n *\n * {activeTab === 'overview' && <OverviewPanel />}\n * {activeTab === 'analytics' && <AnalyticsPanel />}\n * ```\n */\n\nfunction TabContainer(props: TabContainerProps) {\n\tconst {\n\t\tchildren,\n\t\tonChange,\n\t\tdefaultValue,\n\t\tdisabled = false,\n\t\tclassName: baseClassName,\n\t\t...rest\n\t} = props;\n\n\tconst [currentTab, setCurrentTab] = useState(defaultValue || \"\");\n\n\tconst className = `arkynTabContainer ${baseClassName || \"\"}`;\n\n\tfunction changeCurrentTab(value: string) {\n\t\tsetCurrentTab(value);\n\t\tif (onChange) onChange(value);\n\t}\n\n\treturn (\n\t\t<TabProvider\n\t\t\tdisabled={disabled}\n\t\t\tcurrentTab={currentTab}\n\t\t\tchangeCurrentTab={changeCurrentTab}\n\t\t>\n\t\t\t<nav className={className.trim()} {...rest}>\n\t\t\t\t{children}\n\t\t\t</nav>\n\t\t</TabProvider>\n\t);\n}\n\nexport { TabContainer };\n"],"mappings":";;;;;AA8CA,SAAS,EAAa,GAA0B;CAC/C,IAAM,EACL,aACA,aACA,iBACA,cAAW,IACX,WAAW,GACX,GAAG,MACA,GAEE,CAAC,GAAY,KAAiB,EAAS,KAAgB,EAAE,GAEzD,IAAY,qBAAqB,KAAiB;CAExD,SAAS,EAAiB,GAAe;EAExC,AADA,EAAc,CAAK,GACf,KAAU,EAAS,CAAK;CAC7B;CAEA,OACC,kBAAC,GAAD;EACW;EACE;EACM;YAElB,kBAAC,OAAD;GAAK,WAAW,EAAU,KAAK;GAAG,GAAI;GACpC;EACG,CAAA;CACO,CAAA;AAEf"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/tab/tabContainer/index.tsx"],"sourcesContent":["import { type HTMLAttributes, type ReactNode, useState } from \"react\";\n\nimport { TabProvider } from \"../tabContext\";\nimport \"./styles.css\";\n\ntype TabContainerProps = Omit<\n\tHTMLAttributes<HTMLElement>,\n\t\"onChange\" | \"children\" | \"ref\" | \"onClick\"\n> & {\n\t/** `TabButton` components to render as tabs. Required. */\n\tchildren: ReactNode;\n\t/** Disables all tab buttons at once. @default false */\n\tdisabled?: boolean;\n\t/** Initially selected tab value. */\n\tdefaultValue?: string;\n\t/** Callback fired when the active tab changes, receiving the new value. */\n\tonChange?: (index: string) => void;\n};\n\n/**\n * TabContainer, wrapper that manages active state for a group of `TabButton` components.\n *\n * Renders as a `<nav>` element. Provides context consumed by each `TabButton`.\n *\n * @param props.children - `TabButton` elements. Required.\n * @param props.defaultValue - Initially selected tab value.\n * @param props.disabled - Disables all buttons. Default: false\n * @param props.onChange - Called with the new value whenever the active tab changes.\n *\n * **...Other valid HTML `<nav>` properties**\n *\n * @returns TabContainer JSX element.\n *\n * @example\n * ```tsx\n * <TabContainer defaultValue=\"overview\" onChange={setActiveTab}>\n * <TabButton value=\"overview\">Overview</TabButton>\n * <TabButton value=\"analytics\">Analytics</TabButton>\n * <TabButton value=\"settings\">Settings</TabButton>\n * </TabContainer>\n *\n * {activeTab === 'overview' && <OverviewPanel />}\n * {activeTab === 'analytics' && <AnalyticsPanel />}\n * ```\n */\n\nfunction TabContainer(props: TabContainerProps) {\n\tconst {\n\t\tchildren,\n\t\tonChange,\n\t\tdefaultValue,\n\t\tdisabled = false,\n\t\tclassName: baseClassName,\n\t\t...rest\n\t} = props;\n\n\tconst [currentTab, setCurrentTab] = useState(defaultValue || \"\");\n\n\tconst className = `arkynTabContainer ${baseClassName || \"\"}`;\n\n\tfunction changeCurrentTab(value: string) {\n\t\tsetCurrentTab(value);\n\t\tif (onChange) onChange(value);\n\t}\n\n\treturn (\n\t\t<TabProvider\n\t\t\tdisabled={disabled}\n\t\t\tcurrentTab={currentTab}\n\t\t\tchangeCurrentTab={changeCurrentTab}\n\t\t>\n\t\t\t<nav className={className.trim()} {...rest}>\n\t\t\t\t{children}\n\t\t\t</nav>\n\t\t</TabProvider>\n\t);\n}\n\nexport { TabContainer };\n"],"mappings":";;;;;AA8CA,SAAS,EAAa,GAA0B;CAC/C,IAAM,EACL,aACA,aACA,iBACA,cAAW,IACX,WAAW,GACX,GAAG,MACA,GAEE,CAAC,GAAY,KAAiB,EAAS,KAAgB,EAAE,GAEzD,IAAY,qBAAqB,KAAiB;CAExD,SAAS,EAAiB,GAAe;EAExC,AADA,EAAc,CAAK,GACf,KAAU,EAAS,CAAK;CAC7B;CAEA,OACC,kBAAC,GAAD;EACW;EACE;EACM;YAElB,kBAAC,OAAD;GAAK,WAAW,EAAU,KAAK;GAAG,GAAI;GACpC;EACG,CAAA;CACO,CAAA;AAEf"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/table/tableBody/index.tsx"],"sourcesContent":["import { Children, type HTMLAttributes } from \"react\";\nimport \"./styles.css\";\n\ntype TableBodyProps = HTMLAttributes<HTMLTableSectionElement> & {\n\t/** Text displayed in a full-width row when no children are present. @default \"Nenhum dado adicionado.\" */\n\temptyMessage?: string;\n};\n\n/**\n * TableBody `<tbody>` section with built-in empty state handling.\n *\n * When `children` is empty, renders a full-width row with `emptyMessage`.\n * Accepts all standard HTML `<tbody>` attributes.\n *\n * @param props.emptyMessage - Empty state text. Default: `\"Nenhum dado adicionado.\"`\n *\n * **...Other valid HTML `<tbody>` properties**\n *\n * @returns TableBody JSX element.\n *\n * @example\n * ```tsx\n * <TableBody emptyMessage=\"No orders found\">\n * {orders.map(o => (\n * <tr key={o.id}>\n * <td>{o.number}</td>\n * <td>{o.status}</td>\n * </tr>\n * ))}\n * </TableBody>\n * ```\n */\n\nfunction TableBody(props: TableBodyProps) {\n\tconst {\n\t\temptyMessage = \"Nenhum dado adicionado.\",\n\t\tclassName: baseClassName,\n\t\tchildren,\n\t\t...rest\n\t} = props;\n\n\tconst className = `arkynTableBody ${baseClassName}`;\n\tconst childArray = Children.toArray(children).filter(Boolean);\n\tconst isEmpty = childArray.length === 0;\n\n\treturn (\n\t\t<tbody className={className.trim()} {...rest}>\n\t\t\t{isEmpty ? (\n\t\t\t\t<tr className=\"arkynTableBodyEmptyLine\">\n\t\t\t\t\t<td colSpan={100}>\n\t\t\t\t\t\t<div>{emptyMessage}</div>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t) : (\n\t\t\t\tchildArray\n\t\t\t)}\n\t\t</tbody>\n\t);\n}\n\nexport { TableBody };\n"],"mappings":";;;;AAiCA,SAAS,EAAU,GAAuB;CACzC,IAAM,EACL,kBAAe,2BACf,WAAW,GACX,aACA,GAAG,MACA,GAEE,IAAY,kBAAkB,KAC9B,IAAa,EAAS,QAAQ,CAAQ,CAAC,CAAC,OAAO,OAAO,GACtD,IAAU,EAAW,WAAW;CAEtC,OACC,kBAAC,SAAD;EAAO,WAAW,EAAU,KAAK;EAAG,GAAI;YACtC,IACA,kBAAC,MAAD;GAAI,WAAU;aACb,kBAAC,MAAD;IAAI,SAAS;cACZ,kBAAC,OAAD,EAAA,UAAM,EAAkB,CAAA;GACrB,CAAA;EACD,CAAA,IAEJ;CAEK,CAAA;AAET"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/table/tableBody/index.tsx"],"sourcesContent":["import { Children, type HTMLAttributes } from \"react\";\nimport \"./styles.css\";\n\ntype TableBodyProps = HTMLAttributes<HTMLTableSectionElement> & {\n\t/** Text displayed in a full-width row when no children are present. @default \"Nenhum dado adicionado.\" */\n\temptyMessage?: string;\n};\n\n/**\n * TableBody, `<tbody>` section with built-in empty state handling.\n *\n * When `children` is empty, renders a full-width row with `emptyMessage`.\n * Accepts all standard HTML `<tbody>` attributes.\n *\n * @param props.emptyMessage - Empty state text. Default: `\"Nenhum dado adicionado.\"`\n *\n * **...Other valid HTML `<tbody>` properties**\n *\n * @returns TableBody JSX element.\n *\n * @example\n * ```tsx\n * <TableBody emptyMessage=\"No orders found\">\n * {orders.map(o => (\n * <tr key={o.id}>\n * <td>{o.number}</td>\n * <td>{o.status}</td>\n * </tr>\n * ))}\n * </TableBody>\n * ```\n */\n\nfunction TableBody(props: TableBodyProps) {\n\tconst {\n\t\temptyMessage = \"Nenhum dado adicionado.\",\n\t\tclassName: baseClassName,\n\t\tchildren,\n\t\t...rest\n\t} = props;\n\n\tconst className = `arkynTableBody ${baseClassName}`;\n\tconst childArray = Children.toArray(children).filter(Boolean);\n\tconst isEmpty = childArray.length === 0;\n\n\treturn (\n\t\t<tbody className={className.trim()} {...rest}>\n\t\t\t{isEmpty ? (\n\t\t\t\t<tr className=\"arkynTableBodyEmptyLine\">\n\t\t\t\t\t<td colSpan={100}>\n\t\t\t\t\t\t<div>{emptyMessage}</div>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t) : (\n\t\t\t\tchildArray\n\t\t\t)}\n\t\t</tbody>\n\t);\n}\n\nexport { TableBody };\n"],"mappings":";;;;AAiCA,SAAS,EAAU,GAAuB;CACzC,IAAM,EACL,kBAAe,2BACf,WAAW,GACX,aACA,GAAG,MACA,GAEE,IAAY,kBAAkB,KAC9B,IAAa,EAAS,QAAQ,CAAQ,CAAC,CAAC,OAAO,OAAO,GACtD,IAAU,EAAW,WAAW;CAEtC,OACC,kBAAC,SAAD;EAAO,WAAW,EAAU,KAAK;EAAG,GAAI;YACtC,IACA,kBAAC,MAAD;GAAI,WAAU;aACb,kBAAC,MAAD;IAAI,SAAS;cACZ,kBAAC,OAAD,EAAA,UAAM,EAAkB,CAAA;GACrB,CAAA;EACD,CAAA,IAEJ;CAEK,CAAA;AAET"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/table/tableCaption/index.tsx"],"sourcesContent":["import type { HTMLAttributes } from \"react\";\nimport \"./styles.css\";\n\ntype TableCaptionProps = HTMLAttributes<HTMLElement>;\n\n/**\n * TableCaption title / description placed above a table. Renders as a `<caption>` element.\n *\n * Accepts all standard HTML element attributes.\n *\n * @returns TableCaption JSX element.\n *\n * @example\n * ```tsx\n * <TableContainer>\n * <TableCaption>Orders Q2 2025</TableCaption>\n * <TableHeader>...</TableHeader>\n * <TableBody>...</TableBody>\n * </TableContainer>\n * ```\n */\n\nfunction TableCaption(props: TableCaptionProps) {\n\tconst { className: baseClassName, children, ...rest } = props;\n\tconst className = `arkynTableCaption ${baseClassName}`;\n\n\treturn (\n\t\t<caption className={className.trim()} {...rest}>\n\t\t\t<div className=\"arkynTableCaptionContent\">{children}</div>\n\t\t</caption>\n\t);\n}\n\nexport { TableCaption };\n"],"mappings":";;;AAsBA,SAAS,EAAa,GAA0B;CAC/C,IAAM,EAAE,WAAW,GAAe,aAAU,GAAG,MAAS;CAGxD,OACC,kBAAC,WAAD;EAAS,WAAW,qBAHkB,IAGR,KAAK;EAAG,GAAI;YACzC,kBAAC,OAAD;GAAK,WAAU;GAA4B;EAAc,CAAA;CACjD,CAAA;AAEX"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/table/tableCaption/index.tsx"],"sourcesContent":["import type { HTMLAttributes } from \"react\";\nimport \"./styles.css\";\n\ntype TableCaptionProps = HTMLAttributes<HTMLElement>;\n\n/**\n * TableCaption, title / description placed above a table. Renders as a `<caption>` element.\n *\n * Accepts all standard HTML element attributes.\n *\n * @returns TableCaption JSX element.\n *\n * @example\n * ```tsx\n * <TableContainer>\n * <TableCaption>Orders, Q2 2025</TableCaption>\n * <TableHeader>...</TableHeader>\n * <TableBody>...</TableBody>\n * </TableContainer>\n * ```\n */\n\nfunction TableCaption(props: TableCaptionProps) {\n\tconst { className: baseClassName, children, ...rest } = props;\n\tconst className = `arkynTableCaption ${baseClassName}`;\n\n\treturn (\n\t\t<caption className={className.trim()} {...rest}>\n\t\t\t<div className=\"arkynTableCaptionContent\">{children}</div>\n\t\t</caption>\n\t);\n}\n\nexport { TableCaption };\n"],"mappings":";;;AAsBA,SAAS,EAAa,GAA0B;CAC/C,IAAM,EAAE,WAAW,GAAe,aAAU,GAAG,MAAS;CAGxD,OACC,kBAAC,WAAD;EAAS,WAAW,qBAHkB,IAGR,KAAK;EAAG,GAAI;YACzC,kBAAC,OAAD;GAAK,WAAU;GAA4B;EAAc,CAAA;CACjD,CAAA;AAEX"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/table/tableContainer/index.tsx"],"sourcesContent":["import type { TableHTMLAttributes } from \"react\";\nimport \"./styles.css\";\n\ntype TableContainerProps = TableHTMLAttributes<HTMLTableElement>;\n\n/**\n * TableContainer root wrapper for the Table component set. Renders a responsive scrollable container around a `<table>`.\n *\n * Accepts all standard HTML `<table>` attributes.\n *\n * @returns TableContainer JSX element.\n *\n * @example\n * ```tsx\n * <TableContainer>\n * <TableCaption>Users</TableCaption>\n * <TableHeader>\n * <th>Name</th>\n * <th>Email</th>\n * <th>Status</th>\n * </TableHeader>\n * <TableBody emptyMessage=\"No users found\">\n * {users.map(u => (\n * <tr key={u.id}>\n * <td>{u.name}</td>\n * <td>{u.email}</td>\n * <td>{u.status}</td>\n * </tr>\n * ))}\n * </TableBody>\n * <TableFooter><Pagination /></TableFooter>\n * </TableContainer>\n * ```\n */\n\nfunction TableContainer(props: TableContainerProps) {\n\tconst { children, className: baseClassName, ...rest } = props;\n\tconst className = `arkynTableContainer ${baseClassName}`;\n\n\treturn (\n\t\t<div className={className.trim()} {...rest}>\n\t\t\t<table>{children}</table>\n\t\t</div>\n\t);\n}\n\nexport { TableContainer };\n"],"mappings":";;;AAmCA,SAAS,EAAe,GAA4B;CACnD,IAAM,EAAE,aAAU,WAAW,GAAe,GAAG,MAAS;CAGxD,OACC,kBAAC,OAAD;EAAK,WAAW,uBAHwB,IAGd,KAAK;EAAG,GAAI;YACrC,kBAAC,SAAD,EAAQ,YAAgB,CAAA;CACpB,CAAA;AAEP"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/table/tableContainer/index.tsx"],"sourcesContent":["import type { TableHTMLAttributes } from \"react\";\nimport \"./styles.css\";\n\ntype TableContainerProps = TableHTMLAttributes<HTMLTableElement>;\n\n/**\n * TableContainer, root wrapper for the Table component set. Renders a responsive scrollable container around a `<table>`.\n *\n * Accepts all standard HTML `<table>` attributes.\n *\n * @returns TableContainer JSX element.\n *\n * @example\n * ```tsx\n * <TableContainer>\n * <TableCaption>Users</TableCaption>\n * <TableHeader>\n * <th>Name</th>\n * <th>Email</th>\n * <th>Status</th>\n * </TableHeader>\n * <TableBody emptyMessage=\"No users found\">\n * {users.map(u => (\n * <tr key={u.id}>\n * <td>{u.name}</td>\n * <td>{u.email}</td>\n * <td>{u.status}</td>\n * </tr>\n * ))}\n * </TableBody>\n * <TableFooter><Pagination /></TableFooter>\n * </TableContainer>\n * ```\n */\n\nfunction TableContainer(props: TableContainerProps) {\n\tconst { children, className: baseClassName, ...rest } = props;\n\tconst className = `arkynTableContainer ${baseClassName}`;\n\n\treturn (\n\t\t<div className={className.trim()} {...rest}>\n\t\t\t<table>{children}</table>\n\t\t</div>\n\t);\n}\n\nexport { TableContainer };\n"],"mappings":";;;AAmCA,SAAS,EAAe,GAA4B;CACnD,IAAM,EAAE,aAAU,WAAW,GAAe,GAAG,MAAS;CAGxD,OACC,kBAAC,OAAD;EAAK,WAAW,uBAHwB,IAGd,KAAK;EAAG,GAAI;YACrC,kBAAC,SAAD,EAAQ,YAAgB,CAAA;CACpB,CAAA;AAEP"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/table/tableFooter/index.tsx"],"sourcesContent":["import type { HTMLAttributes } from \"react\";\nimport \"./styles.css\";\n\ntype TableFooterProps = HTMLAttributes<HTMLTableSectionElement>;\n\n/**\n * TableFooter `<tfoot>` section with an automatic spacing row above the content.\n *\n * Children span all columns via `colSpan={100}`. Commonly used for `Pagination`.\n * Accepts all standard HTML `<tfoot>` attributes.\n *\n * @returns TableFooter JSX element.\n *\n * @example\n * ```tsx\n * <TableFooter>\n * <Pagination currentPage={page} totalPages={totalPages} onChange={setPage} />\n * </TableFooter>\n * ```\n */\n\nfunction TableFooter(props: TableFooterProps) {\n\tconst { className: baseClassName, children, ...rest } = props;\n\tconst className = `arkynTableFooter ${baseClassName}`;\n\n\treturn (\n\t\t<tfoot className={className.trim()} {...rest}>\n\t\t\t<tr className=\"spacingRow\" />\n\t\t\t<tr>\n\t\t\t\t<th colSpan={100}>\n\t\t\t\t\t<div className=\"arkynTableFooterContent\">{children}</div>\n\t\t\t\t</th>\n\t\t\t</tr>\n\t\t</tfoot>\n\t);\n}\n\nexport { TableFooter };\n"],"mappings":";;;AAqBA,SAAS,EAAY,GAAyB;CAC7C,IAAM,EAAE,WAAW,GAAe,aAAU,GAAG,MAAS;CAGxD,OACC,kBAAC,SAAD;EAAO,WAAW,oBAHmB,IAGT,KAAK;EAAG,GAAI;YAAxC,CACC,kBAAC,MAAD,EAAI,WAAU,aAAc,CAAA,GAC5B,kBAAC,MAAD,EAAA,UACC,kBAAC,MAAD;GAAI,SAAS;aACZ,kBAAC,OAAD;IAAK,WAAU;IAA2B;GAAc,CAAA;EACrD,CAAA,EACD,CAAA,CACE;;AAET"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/table/tableFooter/index.tsx"],"sourcesContent":["import type { HTMLAttributes } from \"react\";\nimport \"./styles.css\";\n\ntype TableFooterProps = HTMLAttributes<HTMLTableSectionElement>;\n\n/**\n * TableFooter, `<tfoot>` section with an automatic spacing row above the content.\n *\n * Children span all columns via `colSpan={100}`. Commonly used for `Pagination`.\n * Accepts all standard HTML `<tfoot>` attributes.\n *\n * @returns TableFooter JSX element.\n *\n * @example\n * ```tsx\n * <TableFooter>\n * <Pagination currentPage={page} totalPages={totalPages} onChange={setPage} />\n * </TableFooter>\n * ```\n */\n\nfunction TableFooter(props: TableFooterProps) {\n\tconst { className: baseClassName, children, ...rest } = props;\n\tconst className = `arkynTableFooter ${baseClassName}`;\n\n\treturn (\n\t\t<tfoot className={className.trim()} {...rest}>\n\t\t\t<tr className=\"spacingRow\" />\n\t\t\t<tr>\n\t\t\t\t<th colSpan={100}>\n\t\t\t\t\t<div className=\"arkynTableFooterContent\">{children}</div>\n\t\t\t\t</th>\n\t\t\t</tr>\n\t\t</tfoot>\n\t);\n}\n\nexport { TableFooter };\n"],"mappings":";;;AAqBA,SAAS,EAAY,GAAyB;CAC7C,IAAM,EAAE,WAAW,GAAe,aAAU,GAAG,MAAS;CAGxD,OACC,kBAAC,SAAD;EAAO,WAAW,oBAHmB,IAGT,KAAK;EAAG,GAAI;YAAxC,CACC,kBAAC,MAAD,EAAI,WAAU,aAAc,CAAA,GAC5B,kBAAC,MAAD,EAAA,UACC,kBAAC,MAAD;GAAI,SAAS;aACZ,kBAAC,OAAD;IAAK,WAAU;IAA2B;GAAc,CAAA;EACrD,CAAA,EACD,CAAA,CACE;;AAET"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/table/tableHeader/index.tsx"],"sourcesContent":["import type { HTMLAttributes } from \"react\";\nimport \"./styles.css\";\n\ntype TableHeaderProps = HTMLAttributes<HTMLTableSectionElement>;\n\n/**\n * TableHeader `<thead>` section with an automatic spacing row below the header row.\n *\n * Pass `<th>` elements as children they are wrapped in a `<tr>` automatically.\n * Accepts all standard HTML `<thead>` attributes.\n *\n * @returns TableHeader JSX element.\n *\n * @example\n * ```tsx\n * <TableHeader>\n * <th>Name</th>\n * <th>Email</th>\n * <th>Actions</th>\n * </TableHeader>\n * ```\n */\n\nfunction TableHeader(props: TableHeaderProps) {\n\tconst { className: baseClassName, children, ...rest } = props;\n\tconst className = `arkynTableHeader ${baseClassName}`;\n\n\treturn (\n\t\t<thead className={className.trim()} {...rest}>\n\t\t\t<tr>{children}</tr>\n\t\t\t<tr className=\"spacingRow\" />\n\t\t</thead>\n\t);\n}\n\nexport { TableHeader };\n"],"mappings":";;;AAuBA,SAAS,EAAY,GAAyB;CAC7C,IAAM,EAAE,WAAW,GAAe,aAAU,GAAG,MAAS;CAGxD,OACC,kBAAC,SAAD;EAAO,WAAW,oBAHmB,IAGT,KAAK;EAAG,GAAI;YAAxC,CACC,kBAAC,MAAD,EAAK,YAAa,CAAA,GAClB,kBAAC,MAAD,EAAI,WAAU,aAAc,CAAA,CACtB;;AAET"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/table/tableHeader/index.tsx"],"sourcesContent":["import type { HTMLAttributes } from \"react\";\nimport \"./styles.css\";\n\ntype TableHeaderProps = HTMLAttributes<HTMLTableSectionElement>;\n\n/**\n * TableHeader, `<thead>` section with an automatic spacing row below the header row.\n *\n * Pass `<th>` elements as children, they are wrapped in a `<tr>` automatically.\n * Accepts all standard HTML `<thead>` attributes.\n *\n * @returns TableHeader JSX element.\n *\n * @example\n * ```tsx\n * <TableHeader>\n * <th>Name</th>\n * <th>Email</th>\n * <th>Actions</th>\n * </TableHeader>\n * ```\n */\n\nfunction TableHeader(props: TableHeaderProps) {\n\tconst { className: baseClassName, children, ...rest } = props;\n\tconst className = `arkynTableHeader ${baseClassName}`;\n\n\treturn (\n\t\t<thead className={className.trim()} {...rest}>\n\t\t\t<tr>{children}</tr>\n\t\t\t<tr className=\"spacingRow\" />\n\t\t</thead>\n\t);\n}\n\nexport { TableHeader };\n"],"mappings":";;;AAuBA,SAAS,EAAY,GAAyB;CAC7C,IAAM,EAAE,WAAW,GAAe,aAAU,GAAG,MAAS;CAGxD,OACC,kBAAC,SAAD;EAAO,WAAW,oBAHmB,IAGT,KAAK;EAAG,GAAI;YAAxC,CACC,kBAAC,MAAD,EAAK,YAAa,CAAA,GAClB,kBAAC,MAAD,EAAI,WAAU,aAAc,CAAA,CACtB;;AAET"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/textarea/index.tsx"],"sourcesContent":["import {\n\ttype FocusEvent,\n\ttype TextareaHTMLAttributes,\n\tuseId,\n\tuseRef,\n\tuseState,\n} from \"react\";\n\nimport { useForm } from \"../../hooks/useForm\";\nimport { FieldError } from \"../fieldError\";\nimport { FieldLabel } from \"../fieldLabel\";\nimport { FieldWrapper } from \"../fieldWrapper\";\nimport \"./styles.css\";\n\ntype TextareaProps = Omit<\n\tTextareaHTMLAttributes<HTMLTextAreaElement>,\n\t\"name\" | \"value\" | \"defaultValue\"\n> & {\n\t/** Field name for form submission. Required. */\n\tname: string;\n\t/** Optional label text displayed above the textarea. */\n\tlabel?: string;\n\t/** Displays an asterisk on the label to signal a required field. */\n\tshowAsterisk?: boolean;\n\t/** Validation error message displayed below the textarea. */\n\terrorMessage?: string;\n\t/**\n\t * Textarea size.\n\t * @default \"md\"\n\t */\n\tsize?: \"md\" | \"lg\";\n\t/**\n\t * Visual style variant.\n\t * - `solid`: filled background.\n\t * - `outline`: bordered, transparent background.\n\t * @default \"solid\"\n\t */\n\tvariant?: \"solid\" | \"outline\";\n\t/** Controlled value. */\n\tvalue?: string;\n\t/** Uncontrolled default value. */\n\tdefaultValue?: string;\n};\n\n/**\n * Textarea multi-line text input with label, validation, and form integration.\n *\n * Integrates with `useForm` to display validation errors by field name.\n *\n * @param props.name - Field name for form submission. Required.\n * @param props.label - Label text displayed above the textarea.\n * @param props.showAsterisk - Appends `*` to the label.\n * @param props.errorMessage - Validation error message.\n * @param props.size - Textarea size (`md` | `lg`). Default: \"md\"\n * @param props.variant - Visual style variant. Default: \"solid\"\n *\n * **...Other valid HTML properties for `<textarea>`**\n *\n * @returns Textarea JSX element wrapped in `FieldWrapper`.\n *\n * @example\n * ```tsx\n * // Basic\n * <Textarea name=\"description\" placeholder=\"Enter description...\" />\n *\n * // With label and validation\n * <Textarea\n * name=\"bio\"\n * label=\"Biography\"\n * showAsterisk\n * placeholder=\"Tell us about yourself\"\n * errorMessage=\"Biography is required\"\n * />\n *\n * // Controlled with custom rows\n * <Textarea\n * name=\"message\"\n * label=\"Message\"\n * value={message}\n * onChange={(e) => setMessage(e.target.value)}\n * rows={5}\n * size=\"lg\"\n * variant=\"outline\"\n * />\n * ```\n */\n\nfunction Textarea(props: TextareaProps) {\n\tconst {\n\t\tvariant = \"solid\",\n\t\tsize = \"md\",\n\t\tclassName: wrapperClassName,\n\t\terrorMessage: baseErrorMessage,\n\t\tdisabled = false,\n\t\treadOnly = false,\n\t\tlabel,\n\t\tshowAsterisk,\n\t\tname,\n\t\tonFocus,\n\t\tonBlur,\n\t\ttitle,\n\t\tstyle,\n\t\tvalue,\n\t\tdefaultValue,\n\t\tplaceholder,\n\t\tid,\n\t\t...rest\n\t} = props;\n\n\tconst { fieldErrors } = useForm();\n\tconst [isFocused, setIsFocused] = useState(false);\n\tconst textareaRef = useRef<HTMLTextAreaElement>(null);\n\tconst generatedId = useId();\n\tconst textareaId = id || generatedId;\n\n\tconst errorMessage = baseErrorMessage || fieldErrors?.[name];\n\tconst isError = !!errorMessage;\n\n\tconst errorClass = isError ? \"errorTrue\" : \"errorFalse\";\n\tconst opacityClass = disabled || readOnly ? \"opacityTrue\" : \"opacityFalse\";\n\tconst focusedClass = isFocused ? \"focusedTrue\" : \"focusedFalse\";\n\n\tconst className = `arkynTextarea ${variant} ${size} ${opacityClass} ${errorClass} ${focusedClass}`;\n\tconst domValue = disabled ? undefined : value;\n\n\tfunction handleSectionClick() {\n\t\tif (disabled || !textareaRef?.current) return;\n\t\tsetIsFocused(true);\n\t\ttextareaRef.current.focus();\n\t}\n\n\tfunction handleFocus(e: FocusEvent<HTMLTextAreaElement>) {\n\t\tsetIsFocused(true);\n\t\tif (onFocus) onFocus(e);\n\t}\n\n\tfunction handleBlur(e: FocusEvent<HTMLTextAreaElement>) {\n\t\tsetIsFocused(false);\n\t\tif (onBlur) onBlur(e);\n\t}\n\n\treturn (\n\t\t<FieldWrapper className={wrapperClassName}>\n\t\t\t{label && (\n\t\t\t\t<FieldLabel htmlFor={textareaId} showAsterisk={showAsterisk}>\n\t\t\t\t\t{label}\n\t\t\t\t</FieldLabel>\n\t\t\t)}\n\n\t\t\t<section\n\t\t\t\ttitle={title}\n\t\t\t\tstyle={style}\n\t\t\t\tonClick={handleSectionClick}\n\t\t\t\tclassName={className}\n\t\t\t>\n\t\t\t\t<textarea\n\t\t\t\t\tid={textareaId}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\tref={textareaRef}\n\t\t\t\t\tname={name}\n\t\t\t\t\tonFocus={handleFocus}\n\t\t\t\t\tonBlur={handleBlur}\n\t\t\t\t\tdefaultValue={domValue === undefined ? defaultValue || \"\" : undefined}\n\t\t\t\t\tplaceholder={disabled ? value || placeholder : placeholder}\n\t\t\t\t\tvalue={domValue}\n\t\t\t\t\t{...rest}\n\t\t\t\t/>\n\t\t\t</section>\n\t\t\t{errorMessage && <FieldError>{errorMessage}</FieldError>}\n\t\t</FieldWrapper>\n\t);\n}\n\nexport { Textarea };\n"],"mappings":";;;;;;;;AAuFA,SAAS,EAAS,GAAsB;CACvC,IAAM,EACL,aAAU,SACV,UAAO,MACP,WAAW,GACX,cAAc,GACd,cAAW,IACX,cAAW,IACX,UACA,iBACA,SACA,YACA,WACA,UACA,UACA,UACA,iBACA,gBACA,OACA,GAAG,MACA,GAEE,EAAE,mBAAgB,EAAQ,GAC1B,CAAC,GAAW,KAAgB,EAAS,EAAK,GAC1C,IAAc,EAA4B,IAAI,GAC9C,IAAc,EAAM,GACpB,IAAa,KAAM,GAEnB,IAAe,KAAoB,IAAc,IAOjD,IAAY,iBAAiB,EAAQ,GAAG,EAAK,GAH9B,KAAY,IAAW,gBAAgB,eAGO,GANjD,IAEW,cAAc,aAIsC,GAF5D,IAAY,gBAAgB,kBAG3C,IAAW,IAAW,KAAA,IAAY;CAExC,SAAS,IAAqB;EACzB,KAAY,CAAC,GAAa,YAC9B,EAAa,EAAI,GACjB,EAAY,QAAQ,MAAM;CAC3B;CAEA,SAAS,EAAY,GAAoC;EAExD,AADA,EAAa,EAAI,GACb,KAAS,EAAQ,CAAC;CACvB;CAEA,SAAS,EAAW,GAAoC;EAEvD,AADA,EAAa,EAAK,GACd,KAAQ,EAAO,CAAC;CACrB;CAEA,OACC,kBAAC,GAAD;EAAc,WAAW;YAAzB;GACE,KACA,kBAAC,GAAD;IAAY,SAAS;IAA0B;cAC7C;GACU,CAAA;GAGb,kBAAC,WAAD;IACQ;IACA;IACP,SAAS;IACE;cAEX,kBAAC,YAAD;KACC,IAAI;KACM;KACA;KACV,KAAK;KACC;KACN,SAAS;KACT,QAAQ;KACR,cAAc,MAAa,KAAA,IAAY,KAAgB,KAAK,KAAA;KAC5D,aAAa,KAAW,KAAuB;KAC/C,OAAO;KACP,GAAI;IACJ,CAAA;GACO,CAAA;GACR,KAAgB,kBAAC,GAAD,EAAA,UAAa,EAAyB,CAAA;EAC1C;;AAEhB"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/textarea/index.tsx"],"sourcesContent":["import {\n\ttype FocusEvent,\n\ttype TextareaHTMLAttributes,\n\tuseId,\n\tuseRef,\n\tuseState,\n} from \"react\";\n\nimport { useForm } from \"../../hooks/useForm\";\nimport { FieldError } from \"../fieldError\";\nimport { FieldLabel } from \"../fieldLabel\";\nimport { FieldWrapper } from \"../fieldWrapper\";\nimport \"./styles.css\";\n\ntype TextareaProps = Omit<\n\tTextareaHTMLAttributes<HTMLTextAreaElement>,\n\t\"name\" | \"value\" | \"defaultValue\"\n> & {\n\t/** Field name for form submission. Required. */\n\tname: string;\n\t/** Optional label text displayed above the textarea. */\n\tlabel?: string;\n\t/** Displays an asterisk on the label to signal a required field. */\n\tshowAsterisk?: boolean;\n\t/** Validation error message displayed below the textarea. */\n\terrorMessage?: string;\n\t/**\n\t * Textarea size.\n\t * @default \"md\"\n\t */\n\tsize?: \"md\" | \"lg\";\n\t/**\n\t * Visual style variant.\n\t * - `solid`: filled background.\n\t * - `outline`: bordered, transparent background.\n\t * @default \"solid\"\n\t */\n\tvariant?: \"solid\" | \"outline\";\n\t/** Controlled value. */\n\tvalue?: string;\n\t/** Uncontrolled default value. */\n\tdefaultValue?: string;\n};\n\n/**\n * Textarea, multi-line text input with label, validation, and form integration.\n *\n * Integrates with `useForm` to display validation errors by field name.\n *\n * @param props.name - Field name for form submission. Required.\n * @param props.label - Label text displayed above the textarea.\n * @param props.showAsterisk - Appends `*` to the label.\n * @param props.errorMessage - Validation error message.\n * @param props.size - Textarea size (`md` | `lg`). Default: \"md\"\n * @param props.variant - Visual style variant. Default: \"solid\"\n *\n * **...Other valid HTML properties for `<textarea>`**\n *\n * @returns Textarea JSX element wrapped in `FieldWrapper`.\n *\n * @example\n * ```tsx\n * // Basic\n * <Textarea name=\"description\" placeholder=\"Enter description...\" />\n *\n * // With label and validation\n * <Textarea\n * name=\"bio\"\n * label=\"Biography\"\n * showAsterisk\n * placeholder=\"Tell us about yourself\"\n * errorMessage=\"Biography is required\"\n * />\n *\n * // Controlled with custom rows\n * <Textarea\n * name=\"message\"\n * label=\"Message\"\n * value={message}\n * onChange={(e) => setMessage(e.target.value)}\n * rows={5}\n * size=\"lg\"\n * variant=\"outline\"\n * />\n * ```\n */\n\nfunction Textarea(props: TextareaProps) {\n\tconst {\n\t\tvariant = \"solid\",\n\t\tsize = \"md\",\n\t\tclassName: wrapperClassName,\n\t\terrorMessage: baseErrorMessage,\n\t\tdisabled = false,\n\t\treadOnly = false,\n\t\tlabel,\n\t\tshowAsterisk,\n\t\tname,\n\t\tonFocus,\n\t\tonBlur,\n\t\ttitle,\n\t\tstyle,\n\t\tvalue,\n\t\tdefaultValue,\n\t\tplaceholder,\n\t\tid,\n\t\t...rest\n\t} = props;\n\n\tconst { fieldErrors } = useForm();\n\tconst [isFocused, setIsFocused] = useState(false);\n\tconst textareaRef = useRef<HTMLTextAreaElement>(null);\n\tconst generatedId = useId();\n\tconst textareaId = id || generatedId;\n\n\tconst errorMessage = baseErrorMessage || fieldErrors?.[name];\n\tconst isError = !!errorMessage;\n\n\tconst errorClass = isError ? \"errorTrue\" : \"errorFalse\";\n\tconst opacityClass = disabled || readOnly ? \"opacityTrue\" : \"opacityFalse\";\n\tconst focusedClass = isFocused ? \"focusedTrue\" : \"focusedFalse\";\n\n\tconst className = `arkynTextarea ${variant} ${size} ${opacityClass} ${errorClass} ${focusedClass}`;\n\tconst domValue = disabled ? undefined : value;\n\n\tfunction handleSectionClick() {\n\t\tif (disabled || !textareaRef?.current) return;\n\t\tsetIsFocused(true);\n\t\ttextareaRef.current.focus();\n\t}\n\n\tfunction handleFocus(e: FocusEvent<HTMLTextAreaElement>) {\n\t\tsetIsFocused(true);\n\t\tif (onFocus) onFocus(e);\n\t}\n\n\tfunction handleBlur(e: FocusEvent<HTMLTextAreaElement>) {\n\t\tsetIsFocused(false);\n\t\tif (onBlur) onBlur(e);\n\t}\n\n\treturn (\n\t\t<FieldWrapper className={wrapperClassName}>\n\t\t\t{label && (\n\t\t\t\t<FieldLabel htmlFor={textareaId} showAsterisk={showAsterisk}>\n\t\t\t\t\t{label}\n\t\t\t\t</FieldLabel>\n\t\t\t)}\n\n\t\t\t<section\n\t\t\t\ttitle={title}\n\t\t\t\tstyle={style}\n\t\t\t\tonClick={handleSectionClick}\n\t\t\t\tclassName={className}\n\t\t\t>\n\t\t\t\t<textarea\n\t\t\t\t\tid={textareaId}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\tref={textareaRef}\n\t\t\t\t\tname={name}\n\t\t\t\t\tonFocus={handleFocus}\n\t\t\t\t\tonBlur={handleBlur}\n\t\t\t\t\tdefaultValue={domValue === undefined ? defaultValue || \"\" : undefined}\n\t\t\t\t\tplaceholder={disabled ? value || placeholder : placeholder}\n\t\t\t\t\tvalue={domValue}\n\t\t\t\t\t{...rest}\n\t\t\t\t/>\n\t\t\t</section>\n\t\t\t{errorMessage && <FieldError>{errorMessage}</FieldError>}\n\t\t</FieldWrapper>\n\t);\n}\n\nexport { Textarea };\n"],"mappings":";;;;;;;;AAuFA,SAAS,EAAS,GAAsB;CACvC,IAAM,EACL,aAAU,SACV,UAAO,MACP,WAAW,GACX,cAAc,GACd,cAAW,IACX,cAAW,IACX,UACA,iBACA,SACA,YACA,WACA,UACA,UACA,UACA,iBACA,gBACA,OACA,GAAG,MACA,GAEE,EAAE,mBAAgB,EAAQ,GAC1B,CAAC,GAAW,KAAgB,EAAS,EAAK,GAC1C,IAAc,EAA4B,IAAI,GAC9C,IAAc,EAAM,GACpB,IAAa,KAAM,GAEnB,IAAe,KAAoB,IAAc,IAOjD,IAAY,iBAAiB,EAAQ,GAAG,EAAK,GAH9B,KAAY,IAAW,gBAAgB,eAGO,GANjD,IAEW,cAAc,aAIsC,GAF5D,IAAY,gBAAgB,kBAG3C,IAAW,IAAW,KAAA,IAAY;CAExC,SAAS,IAAqB;EACzB,KAAY,CAAC,GAAa,YAC9B,EAAa,EAAI,GACjB,EAAY,QAAQ,MAAM;CAC3B;CAEA,SAAS,EAAY,GAAoC;EAExD,AADA,EAAa,EAAI,GACb,KAAS,EAAQ,CAAC;CACvB;CAEA,SAAS,EAAW,GAAoC;EAEvD,AADA,EAAa,EAAK,GACd,KAAQ,EAAO,CAAC;CACrB;CAEA,OACC,kBAAC,GAAD;EAAc,WAAW;YAAzB;GACE,KACA,kBAAC,GAAD;IAAY,SAAS;IAA0B;cAC7C;GACU,CAAA;GAGb,kBAAC,WAAD;IACQ;IACA;IACP,SAAS;IACE;cAEX,kBAAC,YAAD;KACC,IAAI;KACM;KACA;KACV,KAAK;KACC;KACN,SAAS;KACT,QAAQ;KACR,cAAc,MAAa,KAAA,IAAY,KAAgB,KAAK,KAAA;KAC5D,aAAa,KAAW,KAAuB;KAC/C,OAAO;KACP,GAAI;IACJ,CAAA;GACO,CAAA;GACR,KAAgB,kBAAC,GAAD,EAAA,UAAa,EAAyB,CAAA;EAC1C;;AAEhB"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/tooltip/index.tsx"],"sourcesContent":["import {\n\ttype HTMLAttributes,\n\ttype ReactNode,\n\tuseEffect,\n\tuseId,\n\tuseRef,\n\tuseState,\n} from \"react\";\nimport \"./styles.css\";\n\ntype TooltipProps = Omit<HTMLAttributes<HTMLDivElement>, \"children\"> & {\n\t/** Text rendered inside the tooltip bubble. Supports inline HTML. Required. */\n\ttext: string;\n\t/** Element that triggers the tooltip on hover. Required. */\n\tchildren: ReactNode;\n\t/**\n\t * Preferred position of the tooltip relative to the trigger element.\n\t * Automatically flips to the opposite side if the tooltip would overflow the viewport.\n\t * @default \"top\"\n\t */\n\torientation?: \"top\" | \"right\" | \"bottom\" | \"left\";\n\t/**\n\t * Tooltip size.\n\t * @default \"lg\"\n\t */\n\tsize?: \"md\" | \"lg\";\n};\n\n/**\n * Tooltip shows a contextual text bubble on hover with smart viewport-aware positioning.\n *\n * The tooltip automatically flips to the opposite side when it would overflow the viewport.\n *\n * @param props.text - Text (or HTML) to display in the tooltip. Required.\n * @param props.children - Trigger element. Required.\n * @param props.orientation - Preferred position relative to the trigger. Default: \"top\"\n * @param props.size - Tooltip size. Default: \"lg\"\n *\n * **...Other valid HTML properties for `<div>`**\n *\n * @returns Tooltip JSX element.\n *\n * @example\n * ```tsx\n * <Tooltip text=\"Save changes before leaving\">\n * <IconButton icon={SaveIcon} aria-label=\"Save\" />\n * </Tooltip>\n *\n * // Toolbar with bottom-oriented tooltips\n * <Tooltip text=\"Add item\" orientation=\"bottom\">\n * <IconButton icon={Plus} aria-label=\"Add\" />\n * </Tooltip>\n *\n * <Tooltip text=\"Delete\" orientation=\"bottom\" size=\"md\">\n * <IconButton icon={Trash2} aria-label=\"Delete\" scheme=\"danger\" />\n * </Tooltip>\n * ```\n */\n\nfunction Tooltip(props: TooltipProps) {\n\tconst {\n\t\ttext,\n\t\tsize = \"lg\",\n\t\tchildren,\n\t\torientation = \"top\",\n\t\tclassName: baseClassName = \"\",\n\t\t...rest\n\t} = props;\n\n\tconst tooltipId = useId();\n\tconst tooltipRef = useRef<HTMLDivElement>(null);\n\tconst [adjustedOrientation, setAdjustedOrientation] = useState(orientation);\n\n\tuseEffect(() => {\n\t\tconst checkTooltipPosition = () => {\n\t\t\tif (!tooltipRef.current) return;\n\t\t\tconst tooltipText = document.getElementById(tooltipId) as HTMLElement;\n\t\t\tif (!tooltipText) return;\n\n\t\t\tsetAdjustedOrientation(orientation);\n\n\t\t\trequestAnimationFrame(() => {\n\t\t\t\tconst rect = tooltipText.getBoundingClientRect();\n\t\t\t\tconst viewportWidth = window.innerWidth;\n\t\t\t\tconst viewportHeight = window.innerHeight;\n\n\t\t\t\tlet newOrientation = orientation;\n\n\t\t\t\tif (orientation === \"left\" && rect.left < 0) {\n\t\t\t\t\tnewOrientation = \"right\";\n\t\t\t\t} else if (orientation === \"right\" && rect.right > viewportWidth) {\n\t\t\t\t\tnewOrientation = \"left\";\n\t\t\t\t} else if (orientation === \"top\" && rect.top < 0) {\n\t\t\t\t\tnewOrientation = \"bottom\";\n\t\t\t\t} else if (orientation === \"bottom\" && rect.bottom > viewportHeight) {\n\t\t\t\t\tnewOrientation = \"top\";\n\t\t\t\t}\n\n\t\t\t\tif (newOrientation === \"right\" && rect.right > viewportWidth) {\n\t\t\t\t\tnewOrientation = \"left\";\n\t\t\t\t} else if (newOrientation === \"left\" && rect.left < 0) {\n\t\t\t\t\tnewOrientation = \"right\";\n\t\t\t\t} else if (\n\t\t\t\t\tnewOrientation === \"bottom\" &&\n\t\t\t\t\trect.bottom > viewportHeight\n\t\t\t\t) {\n\t\t\t\t\tnewOrientation = \"top\";\n\t\t\t\t} else if (newOrientation === \"top\" && rect.top < 0) {\n\t\t\t\t\tnewOrientation = \"bottom\";\n\t\t\t\t}\n\n\t\t\t\tsetAdjustedOrientation(newOrientation);\n\t\t\t});\n\t\t};\n\n\t\tconst tooltip = tooltipRef.current;\n\t\tif (!tooltip) return;\n\n\t\tconst handleMouseEnter = () => {\n\t\t\tsetTimeout(checkTooltipPosition, 1);\n\t\t};\n\n\t\ttooltip.addEventListener(\"mouseenter\", handleMouseEnter);\n\t\twindow.addEventListener(\"resize\", checkTooltipPosition);\n\n\t\treturn () => {\n\t\t\ttooltip.removeEventListener(\"mouseenter\", handleMouseEnter);\n\t\t\twindow.removeEventListener(\"resize\", checkTooltipPosition);\n\t\t};\n\t}, [orientation, tooltipId]);\n\n\tconst className = `arkynTooltip ${size} ${adjustedOrientation} ${baseClassName}`;\n\n\treturn (\n\t\t<div className={className.trim()} {...rest} ref={tooltipRef}>\n\t\t\t{children}\n\n\t\t\t<div\n\t\t\t\tclassName=\"arkynTooltipText\"\n\t\t\t\tid={tooltipId}\n\t\t\t\tdangerouslySetInnerHTML={{ __html: text }}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nexport { Tooltip };\n"],"mappings":";;;;AA2DA,SAAS,EAAQ,GAAqB;CACrC,IAAM,EACL,SACA,UAAO,MACP,aACA,iBAAc,OACd,WAAW,IAAgB,IAC3B,GAAG,MACA,GAEE,IAAY,EAAM,GAClB,IAAa,EAAuB,IAAI,GACxC,CAAC,GAAqB,KAA0B,EAAS,CAAW;CA8D1E,OA5DA,QAAgB;EACf,IAAM,UAA6B;GAClC,IAAI,CAAC,EAAW,SAAS;GACzB,IAAM,IAAc,SAAS,eAAe,CAAS;GAChD,MAEL,EAAuB,CAAW,GAElC,4BAA4B;IAC3B,IAAM,IAAO,EAAY,sBAAsB,GACzC,IAAgB,OAAO,YACvB,IAAiB,OAAO,aAE1B,IAAiB;IAyBrB,AAvBI,MAAgB,UAAU,EAAK,OAAO,IACzC,IAAiB,UACP,MAAgB,WAAW,EAAK,QAAQ,IAClD,IAAiB,SACP,MAAgB,SAAS,EAAK,MAAM,IAC9C,IAAiB,WACP,MAAgB,YAAY,EAAK,SAAS,MACpD,IAAiB,QAGd,MAAmB,WAAW,EAAK,QAAQ,IAC9C,IAAiB,SACP,MAAmB,UAAU,EAAK,OAAO,IACnD,IAAiB,UAEjB,MAAmB,YACnB,EAAK,SAAS,IAEd,IAAiB,QACP,MAAmB,SAAS,EAAK,MAAM,MACjD,IAAiB,WAGlB,EAAuB,CAAc;GACtC,CAAC;EACF,GAEM,IAAU,EAAW;EAC3B,IAAI,CAAC,GAAS;EAEd,IAAM,UAAyB;GAC9B,WAAW,GAAsB,CAAC;EACnC;EAKA,OAHA,EAAQ,iBAAiB,cAAc,CAAgB,GACvD,OAAO,iBAAiB,UAAU,CAAoB,SAEzC;GAEZ,AADA,EAAQ,oBAAoB,cAAc,CAAgB,GAC1D,OAAO,oBAAoB,UAAU,CAAoB;EAC1D;CACD,GAAG,CAAC,GAAa,CAAS,CAAC,GAK1B,kBAAC,OAAD;EAAK,WAAW,gBAHiB,EAAK,GAAG,EAAoB,GAAG,IAGtC,KAAK;EAAG,GAAI;EAAM,KAAK;YAAjD,CACE,GAED,kBAAC,OAAD;GACC,WAAU;GACV,IAAI;GACJ,yBAAyB,EAAE,QAAQ,EAAK;EACxC,CAAA,CACG;;AAEP"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/tooltip/index.tsx"],"sourcesContent":["import {\n\ttype HTMLAttributes,\n\ttype ReactNode,\n\tuseEffect,\n\tuseId,\n\tuseRef,\n\tuseState,\n} from \"react\";\nimport \"./styles.css\";\n\ntype TooltipProps = Omit<HTMLAttributes<HTMLDivElement>, \"children\"> & {\n\t/** Text rendered inside the tooltip bubble. Supports inline HTML. Required. */\n\ttext: string;\n\t/** Element that triggers the tooltip on hover. Required. */\n\tchildren: ReactNode;\n\t/**\n\t * Preferred position of the tooltip relative to the trigger element.\n\t * Automatically flips to the opposite side if the tooltip would overflow the viewport.\n\t * @default \"top\"\n\t */\n\torientation?: \"top\" | \"right\" | \"bottom\" | \"left\";\n\t/**\n\t * Tooltip size.\n\t * @default \"lg\"\n\t */\n\tsize?: \"md\" | \"lg\";\n};\n\n/**\n * Tooltip, shows a contextual text bubble on hover with smart viewport-aware positioning.\n *\n * The tooltip automatically flips to the opposite side when it would overflow the viewport.\n *\n * @param props.text - Text (or HTML) to display in the tooltip. Required.\n * @param props.children - Trigger element. Required.\n * @param props.orientation - Preferred position relative to the trigger. Default: \"top\"\n * @param props.size - Tooltip size. Default: \"lg\"\n *\n * **...Other valid HTML properties for `<div>`**\n *\n * @returns Tooltip JSX element.\n *\n * @example\n * ```tsx\n * <Tooltip text=\"Save changes before leaving\">\n * <IconButton icon={SaveIcon} aria-label=\"Save\" />\n * </Tooltip>\n *\n * // Toolbar with bottom-oriented tooltips\n * <Tooltip text=\"Add item\" orientation=\"bottom\">\n * <IconButton icon={Plus} aria-label=\"Add\" />\n * </Tooltip>\n *\n * <Tooltip text=\"Delete\" orientation=\"bottom\" size=\"md\">\n * <IconButton icon={Trash2} aria-label=\"Delete\" scheme=\"danger\" />\n * </Tooltip>\n * ```\n */\n\nfunction Tooltip(props: TooltipProps) {\n\tconst {\n\t\ttext,\n\t\tsize = \"lg\",\n\t\tchildren,\n\t\torientation = \"top\",\n\t\tclassName: baseClassName = \"\",\n\t\t...rest\n\t} = props;\n\n\tconst tooltipId = useId();\n\tconst tooltipRef = useRef<HTMLDivElement>(null);\n\tconst [adjustedOrientation, setAdjustedOrientation] = useState(orientation);\n\n\tuseEffect(() => {\n\t\tconst checkTooltipPosition = () => {\n\t\t\tif (!tooltipRef.current) return;\n\t\t\tconst tooltipText = document.getElementById(tooltipId) as HTMLElement;\n\t\t\tif (!tooltipText) return;\n\n\t\t\tsetAdjustedOrientation(orientation);\n\n\t\t\trequestAnimationFrame(() => {\n\t\t\t\tconst rect = tooltipText.getBoundingClientRect();\n\t\t\t\tconst viewportWidth = window.innerWidth;\n\t\t\t\tconst viewportHeight = window.innerHeight;\n\n\t\t\t\tlet newOrientation = orientation;\n\n\t\t\t\tif (orientation === \"left\" && rect.left < 0) {\n\t\t\t\t\tnewOrientation = \"right\";\n\t\t\t\t} else if (orientation === \"right\" && rect.right > viewportWidth) {\n\t\t\t\t\tnewOrientation = \"left\";\n\t\t\t\t} else if (orientation === \"top\" && rect.top < 0) {\n\t\t\t\t\tnewOrientation = \"bottom\";\n\t\t\t\t} else if (orientation === \"bottom\" && rect.bottom > viewportHeight) {\n\t\t\t\t\tnewOrientation = \"top\";\n\t\t\t\t}\n\n\t\t\t\tif (newOrientation === \"right\" && rect.right > viewportWidth) {\n\t\t\t\t\tnewOrientation = \"left\";\n\t\t\t\t} else if (newOrientation === \"left\" && rect.left < 0) {\n\t\t\t\t\tnewOrientation = \"right\";\n\t\t\t\t} else if (\n\t\t\t\t\tnewOrientation === \"bottom\" &&\n\t\t\t\t\trect.bottom > viewportHeight\n\t\t\t\t) {\n\t\t\t\t\tnewOrientation = \"top\";\n\t\t\t\t} else if (newOrientation === \"top\" && rect.top < 0) {\n\t\t\t\t\tnewOrientation = \"bottom\";\n\t\t\t\t}\n\n\t\t\t\tsetAdjustedOrientation(newOrientation);\n\t\t\t});\n\t\t};\n\n\t\tconst tooltip = tooltipRef.current;\n\t\tif (!tooltip) return;\n\n\t\tconst handleMouseEnter = () => {\n\t\t\tsetTimeout(checkTooltipPosition, 1);\n\t\t};\n\n\t\ttooltip.addEventListener(\"mouseenter\", handleMouseEnter);\n\t\twindow.addEventListener(\"resize\", checkTooltipPosition);\n\n\t\treturn () => {\n\t\t\ttooltip.removeEventListener(\"mouseenter\", handleMouseEnter);\n\t\t\twindow.removeEventListener(\"resize\", checkTooltipPosition);\n\t\t};\n\t}, [orientation, tooltipId]);\n\n\tconst className = `arkynTooltip ${size} ${adjustedOrientation} ${baseClassName}`;\n\n\treturn (\n\t\t<div className={className.trim()} {...rest} ref={tooltipRef}>\n\t\t\t{children}\n\n\t\t\t<div\n\t\t\t\tclassName=\"arkynTooltipText\"\n\t\t\t\tid={tooltipId}\n\t\t\t\tdangerouslySetInnerHTML={{ __html: text }}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nexport { Tooltip };\n"],"mappings":";;;;AA2DA,SAAS,EAAQ,GAAqB;CACrC,IAAM,EACL,SACA,UAAO,MACP,aACA,iBAAc,OACd,WAAW,IAAgB,IAC3B,GAAG,MACA,GAEE,IAAY,EAAM,GAClB,IAAa,EAAuB,IAAI,GACxC,CAAC,GAAqB,KAA0B,EAAS,CAAW;CA8D1E,OA5DA,QAAgB;EACf,IAAM,UAA6B;GAClC,IAAI,CAAC,EAAW,SAAS;GACzB,IAAM,IAAc,SAAS,eAAe,CAAS;GAChD,MAEL,EAAuB,CAAW,GAElC,4BAA4B;IAC3B,IAAM,IAAO,EAAY,sBAAsB,GACzC,IAAgB,OAAO,YACvB,IAAiB,OAAO,aAE1B,IAAiB;IAyBrB,AAvBI,MAAgB,UAAU,EAAK,OAAO,IACzC,IAAiB,UACP,MAAgB,WAAW,EAAK,QAAQ,IAClD,IAAiB,SACP,MAAgB,SAAS,EAAK,MAAM,IAC9C,IAAiB,WACP,MAAgB,YAAY,EAAK,SAAS,MACpD,IAAiB,QAGd,MAAmB,WAAW,EAAK,QAAQ,IAC9C,IAAiB,SACP,MAAmB,UAAU,EAAK,OAAO,IACnD,IAAiB,UAEjB,MAAmB,YACnB,EAAK,SAAS,IAEd,IAAiB,QACP,MAAmB,SAAS,EAAK,MAAM,MACjD,IAAiB,WAGlB,EAAuB,CAAc;GACtC,CAAC;EACF,GAEM,IAAU,EAAW;EAC3B,IAAI,CAAC,GAAS;EAEd,IAAM,UAAyB;GAC9B,WAAW,GAAsB,CAAC;EACnC;EAKA,OAHA,EAAQ,iBAAiB,cAAc,CAAgB,GACvD,OAAO,iBAAiB,UAAU,CAAoB,SAEzC;GAEZ,AADA,EAAQ,oBAAoB,cAAc,CAAgB,GAC1D,OAAO,oBAAoB,UAAU,CAAoB;EAC1D;CACD,GAAG,CAAC,GAAa,CAAS,CAAC,GAK1B,kBAAC,OAAD;EAAK,WAAW,gBAHiB,EAAK,GAAG,EAAoB,GAAG,IAGtC,KAAK;EAAG,GAAI;EAAM,KAAK;YAAjD,CACE,GAED,kBAAC,OAAD;GACC,WAAU;GACV,IAAI;GACJ,yBAAyB,EAAE,QAAQ,EAAK;EACxC,CAAA,CACG;;AAEP"}
@@ -1 +1 @@
1
- {"version":3,"file":"useAutomation.js","names":[],"sources":["../../../src/hooks/useAutomation.ts"],"sourcesContent":["import { useCallback, useEffect } from \"react\";\nimport { scroller } from \"react-scroll\";\nimport { badResponses } from \"../templates/badResponses\";\nimport { successResponses } from \"../templates/successResponses\";\nimport { useModal } from \"./useModal\";\nimport { useToast } from \"./useToast\";\n\n/**\n * useAutomation runs UI side-effects (close modals, scroll, toast) in response to a server action payload.\n *\n * Pass the raw response from a form submission. On every change the hook:\n * 1. Closes all open modals if `closeModal` is `true`.\n * 2. Smooth-scrolls to a named element if `cause.data.scrollTo` is set.\n * 3. Shows a toast based on `name` (matched against `successResponses`/`badResponses`) and `message`.\n * When `cause.fieldErrors` is present, the first field error takes priority in the toast.\n * The message `\"Unprocessable entity\"` is intentionally suppressed.\n *\n * @param formResponseData - Raw server response payload.\n * @param formResponseData.closeModal - Closes all open modals when `true`.\n * @param formResponseData.name - Response identifier matched against success/bad response lists.\n * @param formResponseData.message - Text shown in the toast notification.\n * @param formResponseData.cause.data.scrollTo - Element name to scroll to via `react-scroll`.\n * @param formResponseData.cause.fieldErrors - Field-level errors; the first value is shown in the toast.\n *\n * @example\n * ```tsx\n * // After a successful create action\n * useAutomation({ closeModal: true, name: \"created\", message: \"Saved successfully\" });\n * ```\n *\n * @example\n * ```tsx\n * // Validation error with field-level feedback and scroll\n * useAutomation({\n * name: \"validation_error\",\n * message: \"Invalid payload\",\n * cause: {\n * data: { scrollTo: \"email\" },\n * fieldErrors: { email: \"E-mail is required\" },\n * },\n * });\n * ```\n */\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\nfunction useAutomation(formResponseData: any) {\n\tconst { closeAll } = useModal();\n\tconst { showToast } = useToast();\n\n\tconst closeModal = formResponseData?.closeModal;\n\tconst message = formResponseData?.message;\n\tconst name = formResponseData?.name;\n\tconst scrollTo = formResponseData?.cause?.data?.scrollTo;\n\tconst firstErrorField = formResponseData?.cause?.fieldErrors\n\t\t? (Object.values(formResponseData?.cause?.fieldErrors)[0] as string)\n\t\t: null;\n\n\tconst fireToast = useCallback(() => {\n\t\tif (!message && !firstErrorField) return;\n\n\t\tif (successResponses.includes(name))\n\t\t\treturn showToast({ message, type: \"success\" });\n\n\t\tif (!badResponses.includes(name)) return;\n\t\tif (firstErrorField)\n\t\t\treturn showToast({ message: firstErrorField, type: \"danger\" });\n\n\t\tif (message === \"Unprocessable entity\") return;\n\t\treturn showToast({ message, type: \"danger\" });\n\t}, [message, firstErrorField, name, showToast]);\n\n\tuseEffect(() => {\n\t\tif (closeModal) closeAll();\n\t\tif (scrollTo) scroller.scrollTo(scrollTo, { smooth: true, offset: 20 });\n\t\tfireToast();\n\t}, [closeModal, scrollTo, fireToast, closeAll]);\n}\n\nexport { useAutomation };\n"],"mappings":";;;;;;;AA6CA,SAAS,EAAc,GAAuB;CAC7C,IAAM,EAAE,gBAAa,EAAS,GACxB,EAAE,iBAAc,EAAS,GAEzB,IAAa,GAAkB,YAC/B,IAAU,GAAkB,SAC5B,IAAO,GAAkB,MACzB,IAAW,GAAkB,OAAO,MAAM,UAC1C,IAAkB,GAAkB,OAAO,cAC7C,OAAO,OAAO,GAAkB,OAAO,WAAW,CAAC,CAAC,KACrD,MAEG,IAAY,QAAkB;EAC/B,OAAC,KAAW,CAAC,IAEjB;OAAI,EAAiB,SAAS,CAAI,GACjC,OAAO,EAAU;IAAE;IAAS,MAAM;GAAU,CAAC;GAEzC,MAAa,SAAS,CAAI,GAC/B;QAAI,GACH,OAAO,EAAU;KAAE,SAAS;KAAiB,MAAM;IAAS,CAAC;IAE1D,UAAY,wBAChB,OAAO,EAAU;KAAE;KAAS,MAAM;IAAS,CAAC;GAHkB;EAJhB;CAQ/C,GAAG;EAAC;EAAS;EAAiB;EAAM;CAAS,CAAC;CAE9C,QAAgB;EAGf,AAFI,KAAY,EAAS,GACrB,KAAU,EAAS,SAAS,GAAU;GAAE,QAAQ;GAAM,QAAQ;EAAG,CAAC,GACtE,EAAU;CACX,GAAG;EAAC;EAAY;EAAU;EAAW;CAAQ,CAAC;AAC/C"}
1
+ {"version":3,"file":"useAutomation.js","names":[],"sources":["../../../src/hooks/useAutomation.ts"],"sourcesContent":["import { useCallback, useEffect } from \"react\";\nimport { scroller } from \"react-scroll\";\nimport { badResponses } from \"../templates/badResponses\";\nimport { successResponses } from \"../templates/successResponses\";\nimport { useModal } from \"./useModal\";\nimport { useToast } from \"./useToast\";\n\n/**\n * useAutomation, runs UI side-effects (close modals, scroll, toast) in response to a server action payload.\n *\n * Pass the raw response from a form submission. On every change the hook:\n * 1. Closes all open modals if `closeModal` is `true`.\n * 2. Smooth-scrolls to a named element if `cause.data.scrollTo` is set.\n * 3. Shows a toast based on `name` (matched against `successResponses`/`badResponses`) and `message`.\n * When `cause.fieldErrors` is present, the first field error takes priority in the toast.\n * The message `\"Unprocessable entity\"` is intentionally suppressed.\n *\n * @param formResponseData - Raw server response payload.\n * @param formResponseData.closeModal - Closes all open modals when `true`.\n * @param formResponseData.name - Response identifier matched against success/bad response lists.\n * @param formResponseData.message - Text shown in the toast notification.\n * @param formResponseData.cause.data.scrollTo - Element name to scroll to via `react-scroll`.\n * @param formResponseData.cause.fieldErrors - Field-level errors; the first value is shown in the toast.\n *\n * @example\n * ```tsx\n * // After a successful create action\n * useAutomation({ closeModal: true, name: \"created\", message: \"Saved successfully\" });\n * ```\n *\n * @example\n * ```tsx\n * // Validation error with field-level feedback and scroll\n * useAutomation({\n * name: \"validation_error\",\n * message: \"Invalid payload\",\n * cause: {\n * data: { scrollTo: \"email\" },\n * fieldErrors: { email: \"E-mail is required\" },\n * },\n * });\n * ```\n */\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\nfunction useAutomation(formResponseData: any) {\n\tconst { closeAll } = useModal();\n\tconst { showToast } = useToast();\n\n\tconst closeModal = formResponseData?.closeModal;\n\tconst message = formResponseData?.message;\n\tconst name = formResponseData?.name;\n\tconst scrollTo = formResponseData?.cause?.data?.scrollTo;\n\tconst firstErrorField = formResponseData?.cause?.fieldErrors\n\t\t? (Object.values(formResponseData?.cause?.fieldErrors)[0] as string)\n\t\t: null;\n\n\tconst fireToast = useCallback(() => {\n\t\tif (!message && !firstErrorField) return;\n\n\t\tif (successResponses.includes(name))\n\t\t\treturn showToast({ message, type: \"success\" });\n\n\t\tif (!badResponses.includes(name)) return;\n\t\tif (firstErrorField)\n\t\t\treturn showToast({ message: firstErrorField, type: \"danger\" });\n\n\t\tif (message === \"Unprocessable entity\") return;\n\t\treturn showToast({ message, type: \"danger\" });\n\t}, [message, firstErrorField, name, showToast]);\n\n\tuseEffect(() => {\n\t\tif (closeModal) closeAll();\n\t\tif (scrollTo) scroller.scrollTo(scrollTo, { smooth: true, offset: 20 });\n\t\tfireToast();\n\t}, [closeModal, scrollTo, fireToast, closeAll]);\n}\n\nexport { useAutomation };\n"],"mappings":";;;;;;;AA6CA,SAAS,EAAc,GAAuB;CAC7C,IAAM,EAAE,gBAAa,EAAS,GACxB,EAAE,iBAAc,EAAS,GAEzB,IAAa,GAAkB,YAC/B,IAAU,GAAkB,SAC5B,IAAO,GAAkB,MACzB,IAAW,GAAkB,OAAO,MAAM,UAC1C,IAAkB,GAAkB,OAAO,cAC7C,OAAO,OAAO,GAAkB,OAAO,WAAW,CAAC,CAAC,KACrD,MAEG,IAAY,QAAkB;EAC/B,OAAC,KAAW,CAAC,IAEjB;OAAI,EAAiB,SAAS,CAAI,GACjC,OAAO,EAAU;IAAE;IAAS,MAAM;GAAU,CAAC;GAEzC,MAAa,SAAS,CAAI,GAC/B;QAAI,GACH,OAAO,EAAU;KAAE,SAAS;KAAiB,MAAM;IAAS,CAAC;IAE1D,UAAY,wBAChB,OAAO,EAAU;KAAE;KAAS,MAAM;IAAS,CAAC;GAHkB;EAJhB;CAQ/C,GAAG;EAAC;EAAS;EAAiB;EAAM;CAAS,CAAC;CAE9C,QAAgB;EAGf,AAFI,KAAY,EAAS,GACrB,KAAU,EAAS,SAAS,GAAU;GAAE,QAAQ;GAAM,QAAQ;EAAG,CAAC,GACtE,EAAU;CACX,GAAG;EAAC;EAAY;EAAU;EAAW;CAAQ,CAAC;AAC/C"}
@@ -1 +1 @@
1
- {"version":3,"file":"useDrawer.js","names":[],"sources":["../../../src/hooks/useDrawer.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport {\n\ttype DrawerContextProps,\n\tdrawerContext,\n} from \"../providers/drawerProvider\";\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\ntype OpenDrawerProps<T = any> = (data?: T) => void;\n\n/**\n * useDrawer accesses the nearest `DrawerProvider` context.\n *\n * Two call signatures:\n * - **Without `key`** returns the raw context object (manage any drawer by name).\n * - **With `key`** returns a scoped object bound to one named drawer.\n *\n * @param key - Drawer identifier registered in `DrawerProvider`.\n *\n * @returns Without key: full `DrawerContextProps`. With key: `{ drawerIsOpen, drawerData, openDrawer, closeDrawer }`.\n *\n * @throws If called outside a `DrawerProvider`.\n *\n * @example\n * ```tsx\n * // Scoped to one drawer the most common pattern\n * const { drawerIsOpen, drawerData, openDrawer, closeDrawer } = useDrawer<{ section: string }>('navigation');\n *\n * openDrawer({ section: 'products' });\n * ```\n *\n * @example\n * ```tsx\n * // Full context useful when triggering multiple different drawers from one place\n * const { openDrawer } = useDrawer();\n *\n * openDrawer('navigation', { section: 'main' });\n * openDrawer('filters', { category: 'electronics' });\n * ```\n */\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\nfunction useDrawer<T = any>(): DrawerContextProps<T>;\n// biome-ignore lint/suspicious/noExplicitAny: intentional\nfunction useDrawer<T = any>(\n\tkey: string,\n): {\n\tdrawerIsOpen: boolean;\n\tdrawerData: T;\n\topenDrawer: OpenDrawerProps<T>;\n\tcloseDrawer: () => void;\n};\n\nfunction useDrawer(key?: string) {\n\tconst contextData = useContext(drawerContext);\n\n\tif (Object.entries(contextData).length === 0) {\n\t\tthrow new Error(\"useDrawer must be used within a Provider\");\n\t}\n\n\tif (key) {\n\t\tconst {\n\t\t\tdrawerData: contextDrawerData,\n\t\t\tdrawerIsOpen: contextDrawerIsOpen,\n\t\t\topenDrawer: contextOpenDrawer,\n\t\t\tcloseDrawer: contextCloseDrawer,\n\t\t} = contextData;\n\n\t\tconst drawerIsOpen = contextDrawerIsOpen(key);\n\t\tconst drawerData = contextDrawerData(key);\n\n\t\tconst openDrawer: OpenDrawerProps = (data) => contextOpenDrawer(key, data);\n\t\tconst closeDrawer = () => contextCloseDrawer(key);\n\n\t\treturn { drawerIsOpen, drawerData, openDrawer, closeDrawer };\n\t} else {\n\t\treturn contextData;\n\t}\n}\n\nexport { useDrawer };\n"],"mappings":";;;AAoDA,SAAS,EAAU,GAAc;CAChC,IAAM,IAAc,EAAW,CAAa;CAE5C,IAAI,OAAO,QAAQ,CAAW,CAAC,CAAC,WAAW,GAC1C,MAAU,MAAM,0CAA0C;CAG3D,IAAI,GAAK;EACR,IAAM,EACL,YAAY,GACZ,cAAc,GACd,YAAY,GACZ,aAAa,MACV;EAQJ,OAAO;GAAE,cANY,EAAoB,CAMhC;GAAc,YALJ,EAAkB,CAKd;GAAY,aAHE,MAAS,EAAkB,GAAK,CAAI;GAG1B,mBAFrB,EAAmB,CAAG;EAEW;CAC5D,OACC,OAAO;AAET"}
1
+ {"version":3,"file":"useDrawer.js","names":[],"sources":["../../../src/hooks/useDrawer.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport {\n\ttype DrawerContextProps,\n\tdrawerContext,\n} from \"../providers/drawerProvider\";\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\ntype OpenDrawerProps<T = any> = (data?: T) => void;\n\n/**\n * useDrawer, accesses the nearest `DrawerProvider` context.\n *\n * Two call signatures:\n * - **Without `key`**, returns the raw context object (manage any drawer by name).\n * - **With `key`**, returns a scoped object bound to one named drawer.\n *\n * @param key - Drawer identifier registered in `DrawerProvider`.\n *\n * @returns Without key: full `DrawerContextProps`. With key: `{ drawerIsOpen, drawerData, openDrawer, closeDrawer }`.\n *\n * @throws If called outside a `DrawerProvider`.\n *\n * @example\n * ```tsx\n * // Scoped to one drawer, the most common pattern\n * const { drawerIsOpen, drawerData, openDrawer, closeDrawer } = useDrawer<{ section: string }>('navigation');\n *\n * openDrawer({ section: 'products' });\n * ```\n *\n * @example\n * ```tsx\n * // Full context, useful when triggering multiple different drawers from one place\n * const { openDrawer } = useDrawer();\n *\n * openDrawer('navigation', { section: 'main' });\n * openDrawer('filters', { category: 'electronics' });\n * ```\n */\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\nfunction useDrawer<T = any>(): DrawerContextProps<T>;\n// biome-ignore lint/suspicious/noExplicitAny: intentional\nfunction useDrawer<T = any>(\n\tkey: string,\n): {\n\tdrawerIsOpen: boolean;\n\tdrawerData: T;\n\topenDrawer: OpenDrawerProps<T>;\n\tcloseDrawer: () => void;\n};\n\nfunction useDrawer(key?: string) {\n\tconst contextData = useContext(drawerContext);\n\n\tif (Object.entries(contextData).length === 0) {\n\t\tthrow new Error(\"useDrawer must be used within a Provider\");\n\t}\n\n\tif (key) {\n\t\tconst {\n\t\t\tdrawerData: contextDrawerData,\n\t\t\tdrawerIsOpen: contextDrawerIsOpen,\n\t\t\topenDrawer: contextOpenDrawer,\n\t\t\tcloseDrawer: contextCloseDrawer,\n\t\t} = contextData;\n\n\t\tconst drawerIsOpen = contextDrawerIsOpen(key);\n\t\tconst drawerData = contextDrawerData(key);\n\n\t\tconst openDrawer: OpenDrawerProps = (data) => contextOpenDrawer(key, data);\n\t\tconst closeDrawer = () => contextCloseDrawer(key);\n\n\t\treturn { drawerIsOpen, drawerData, openDrawer, closeDrawer };\n\t} else {\n\t\treturn contextData;\n\t}\n}\n\nexport { useDrawer };\n"],"mappings":";;;AAoDA,SAAS,EAAU,GAAc;CAChC,IAAM,IAAc,EAAW,CAAa;CAE5C,IAAI,OAAO,QAAQ,CAAW,CAAC,CAAC,WAAW,GAC1C,MAAU,MAAM,0CAA0C;CAG3D,IAAI,GAAK;EACR,IAAM,EACL,YAAY,GACZ,cAAc,GACd,YAAY,GACZ,aAAa,MACV;EAQJ,OAAO;GAAE,cANY,EAAoB,CAMhC;GAAc,YALJ,EAAkB,CAKd;GAAY,aAHE,MAAS,EAAkB,GAAK,CAAI;GAG1B,mBAFrB,EAAmB,CAAG;EAEW;CAC5D,OACC,OAAO;AAET"}
@@ -1 +1 @@
1
- {"version":3,"file":"useForm.js","names":[],"sources":["../../../src/hooks/useForm.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport { formContext } from \"../providers/formProvider\";\n\n/**\n * useForm reads the nearest `FormProvider` context to access field-level validation errors.\n *\n * All form inputs (`Input`, `Select`, `Checkbox`, etc.) call this hook internally,\n * so you rarely need it directly. Use it when you want to read errors outside of\n * an input component, or build a custom input.\n *\n * @returns Form context containing:\n * - `fieldErrors` `Record<string, string>` mapping field names to error messages.\n *\n * @example\n * ```tsx\n * // Wrapping a form with FormProvider\n * function App() {\n * return (\n * <FormProvider fieldErrors={{ email: \"Invalid email\" }}>\n * <MyForm />\n * </FormProvider>\n * );\n * }\n *\n * // Reading errors manually\n * function CustomField() {\n * const { fieldErrors } = useForm();\n * return <span>{fieldErrors?.username}</span>;\n * }\n * ```\n */\n\nfunction useForm() {\n\tconst context = useContext(formContext);\n\treturn context;\n}\n\nexport { useForm };\n"],"mappings":";;;AAgCA,SAAS,IAAU;CAElB,OADgB,EAAW,CACpB;AACR"}
1
+ {"version":3,"file":"useForm.js","names":[],"sources":["../../../src/hooks/useForm.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport { formContext } from \"../providers/formProvider\";\n\n/**\n * useForm, reads the nearest `FormProvider` context to access field-level validation errors.\n *\n * All form inputs (`Input`, `Select`, `Checkbox`, etc.) call this hook internally,\n * so you rarely need it directly. Use it when you want to read errors outside of\n * an input component, or build a custom input.\n *\n * @returns Form context containing:\n * - `fieldErrors`, `Record<string, string>` mapping field names to error messages.\n *\n * @example\n * ```tsx\n * // Wrapping a form with FormProvider\n * function App() {\n * return (\n * <FormProvider fieldErrors={{ email: \"Invalid email\" }}>\n * <MyForm />\n * </FormProvider>\n * );\n * }\n *\n * // Reading errors manually\n * function CustomField() {\n * const { fieldErrors } = useForm();\n * return <span>{fieldErrors?.username}</span>;\n * }\n * ```\n */\n\nfunction useForm() {\n\tconst context = useContext(formContext);\n\treturn context;\n}\n\nexport { useForm };\n"],"mappings":";;;AAgCA,SAAS,IAAU;CAElB,OADgB,EAAW,CACpB;AACR"}
@@ -1 +1 @@
1
- {"version":3,"file":"useHydrated.js","names":[],"sources":["../../../src/hooks/useHydrated.ts"],"sourcesContent":["import { useSyncExternalStore } from \"react\";\n\nfunction subscribe() {\n\treturn () => {};\n}\n\n/**\n * useHydrated returns `true` once the component has hydrated on the client, `false` during SSR.\n *\n * Built on `useSyncExternalStore` so it is safe with React 18 concurrent rendering.\n * Use this when you need to defer client-only rendering (e.g. browser APIs, `window`, `navigator`)\n * without causing a hydration mismatch. For most cases, prefer the `ClientOnly` component.\n *\n * @returns `true` on the client after hydration; `false` on the server.\n *\n * @example\n * ```tsx\n * function Map() {\n * const isHydrated = useHydrated();\n * if (!isHydrated) return <Skeleton />;\n * return <MapView accessToken={token} coordinates={coords} />;\n * }\n * ```\n */\n\nfunction useHydrated() {\n\treturn useSyncExternalStore(\n\t\tsubscribe,\n\t\t() => true,\n\t\t() => false,\n\t);\n}\n\nexport { useHydrated };\n"],"mappings":";;AAEA,SAAS,IAAY;CACpB,aAAa,CAAC;AACf;AAqBA,SAAS,IAAc;CACtB,OAAO,EACN,SACM,UACA,EACP;AACD"}
1
+ {"version":3,"file":"useHydrated.js","names":[],"sources":["../../../src/hooks/useHydrated.ts"],"sourcesContent":["import { useSyncExternalStore } from \"react\";\n\nfunction subscribe() {\n\treturn () => {};\n}\n\n/**\n * useHydrated, returns `true` once the component has hydrated on the client, `false` during SSR.\n *\n * Built on `useSyncExternalStore` so it is safe with React 18 concurrent rendering.\n * Use this when you need to defer client-only rendering (e.g. browser APIs, `window`, `navigator`)\n * without causing a hydration mismatch. For most cases, prefer the `ClientOnly` component.\n *\n * @returns `true` on the client after hydration; `false` on the server.\n *\n * @example\n * ```tsx\n * function Map() {\n * const isHydrated = useHydrated();\n * if (!isHydrated) return <Skeleton />;\n * return <MapView accessToken={token} coordinates={coords} />;\n * }\n * ```\n */\n\nfunction useHydrated() {\n\treturn useSyncExternalStore(\n\t\tsubscribe,\n\t\t() => true,\n\t\t() => false,\n\t);\n}\n\nexport { useHydrated };\n"],"mappings":";;AAEA,SAAS,IAAY;CACpB,aAAa,CAAC;AACf;AAqBA,SAAS,IAAc;CACtB,OAAO,EACN,SACM,UACA,EACP;AACD"}
@@ -1 +1 @@
1
- {"version":3,"file":"useModal.js","names":[],"sources":["../../../src/hooks/useModal.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport {\n\ttype ModalContextProps,\n\tmodalContext,\n} from \"../providers/modalProvider\";\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\ntype OpenModalProps<T = any> = (data?: T) => void;\n\n/**\n * useModal accesses the nearest `ModalProvider` context.\n *\n * Two call signatures:\n * - **Without `key`** returns the raw context object (manage any modal by name).\n * - **With `key`** returns a scoped object bound to one named modal.\n *\n * @param key - Modal identifier registered in `ModalProvider`.\n *\n * @returns Without key: full `ModalContextProps`. With key: `{ modalIsOpen, modalData, openModal, closeModal }`.\n *\n * @throws If called outside a `ModalProvider`.\n *\n * @example\n * ```tsx\n * // Scoped to one modal the most common pattern\n * const { modalIsOpen, modalData, openModal, closeModal } = useModal<{ id: number }>('confirm-delete');\n *\n * openModal({ id: user.id });\n * ```\n *\n * @example\n * ```tsx\n * // Full context useful when triggering multiple different modals from one place\n * const { openModal } = useModal();\n *\n * openModal('confirm-delete', { id: user.id });\n * openModal('user-details', { id: user.id });\n * ```\n */\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\nfunction useModal<T = any>(): ModalContextProps<T>;\n// biome-ignore lint/suspicious/noExplicitAny: intentional\nfunction useModal<T = any>(\n\tkey: string,\n): {\n\tmodalIsOpen: boolean;\n\tmodalData: T;\n\topenModal: OpenModalProps<T>;\n\tcloseModal: () => void;\n};\n\nfunction useModal(key?: string) {\n\tconst contextData = useContext(modalContext);\n\n\tif (Object.entries(contextData).length === 0) {\n\t\tthrow new Error(\"useModal must be used within a Provider\");\n\t}\n\n\tif (key) {\n\t\tconst {\n\t\t\tmodalData: contextModalData,\n\t\t\tmodalIsOpen: contextModalIsOpen,\n\t\t\topenModal: contextOpenModal,\n\t\t\tcloseModal: contextCloseModal,\n\t\t} = contextData;\n\n\t\tconst modalIsOpen = contextModalIsOpen(key);\n\t\tconst modalData = contextModalData(key);\n\n\t\tconst openModal: OpenModalProps = (data) => contextOpenModal(key, data);\n\t\tconst closeModal = () => contextCloseModal(key);\n\n\t\treturn { modalIsOpen, modalData, openModal, closeModal };\n\t} else {\n\t\treturn contextData;\n\t}\n}\n\nexport { useModal };\n"],"mappings":";;;AAoDA,SAAS,EAAS,GAAc;CAC/B,IAAM,IAAc,EAAW,CAAY;CAE3C,IAAI,OAAO,QAAQ,CAAW,CAAC,CAAC,WAAW,GAC1C,MAAU,MAAM,yCAAyC;CAG1D,IAAI,GAAK;EACR,IAAM,EACL,WAAW,GACX,aAAa,GACb,WAAW,GACX,YAAY,MACT;EAQJ,OAAO;GAAE,aANW,EAAmB,CAM9B;GAAa,WALJ,EAAiB,CAKb;GAAW,YAHE,MAAS,EAAiB,GAAK,CAAI;GAG1B,kBAFnB,EAAkB,CAAG;EAES;CACxD,OACC,OAAO;AAET"}
1
+ {"version":3,"file":"useModal.js","names":[],"sources":["../../../src/hooks/useModal.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport {\n\ttype ModalContextProps,\n\tmodalContext,\n} from \"../providers/modalProvider\";\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\ntype OpenModalProps<T = any> = (data?: T) => void;\n\n/**\n * useModal, accesses the nearest `ModalProvider` context.\n *\n * Two call signatures:\n * - **Without `key`**, returns the raw context object (manage any modal by name).\n * - **With `key`**, returns a scoped object bound to one named modal.\n *\n * @param key - Modal identifier registered in `ModalProvider`.\n *\n * @returns Without key: full `ModalContextProps`. With key: `{ modalIsOpen, modalData, openModal, closeModal }`.\n *\n * @throws If called outside a `ModalProvider`.\n *\n * @example\n * ```tsx\n * // Scoped to one modal, the most common pattern\n * const { modalIsOpen, modalData, openModal, closeModal } = useModal<{ id: number }>('confirm-delete');\n *\n * openModal({ id: user.id });\n * ```\n *\n * @example\n * ```tsx\n * // Full context, useful when triggering multiple different modals from one place\n * const { openModal } = useModal();\n *\n * openModal('confirm-delete', { id: user.id });\n * openModal('user-details', { id: user.id });\n * ```\n */\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\nfunction useModal<T = any>(): ModalContextProps<T>;\n// biome-ignore lint/suspicious/noExplicitAny: intentional\nfunction useModal<T = any>(\n\tkey: string,\n): {\n\tmodalIsOpen: boolean;\n\tmodalData: T;\n\topenModal: OpenModalProps<T>;\n\tcloseModal: () => void;\n};\n\nfunction useModal(key?: string) {\n\tconst contextData = useContext(modalContext);\n\n\tif (Object.entries(contextData).length === 0) {\n\t\tthrow new Error(\"useModal must be used within a Provider\");\n\t}\n\n\tif (key) {\n\t\tconst {\n\t\t\tmodalData: contextModalData,\n\t\t\tmodalIsOpen: contextModalIsOpen,\n\t\t\topenModal: contextOpenModal,\n\t\t\tcloseModal: contextCloseModal,\n\t\t} = contextData;\n\n\t\tconst modalIsOpen = contextModalIsOpen(key);\n\t\tconst modalData = contextModalData(key);\n\n\t\tconst openModal: OpenModalProps = (data) => contextOpenModal(key, data);\n\t\tconst closeModal = () => contextCloseModal(key);\n\n\t\treturn { modalIsOpen, modalData, openModal, closeModal };\n\t} else {\n\t\treturn contextData;\n\t}\n}\n\nexport { useModal };\n"],"mappings":";;;AAoDA,SAAS,EAAS,GAAc;CAC/B,IAAM,IAAc,EAAW,CAAY;CAE3C,IAAI,OAAO,QAAQ,CAAW,CAAC,CAAC,WAAW,GAC1C,MAAU,MAAM,yCAAyC;CAG1D,IAAI,GAAK;EACR,IAAM,EACL,WAAW,GACX,aAAa,GACb,WAAW,GACX,YAAY,MACT;EAQJ,OAAO;GAAE,aANW,EAAmB,CAM9B;GAAa,WALJ,EAAiB,CAKb;GAAW,YAHE,MAAS,EAAiB,GAAK,CAAI;GAG1B,kBAFnB,EAAkB,CAAG;EAES;CACxD,OACC,OAAO;AAET"}