@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":"useScopedParams.js","names":[],"sources":["../../../src/hooks/useScopedParams.ts"],"sourcesContent":["type ParamsType = Record<string, string | number | boolean | undefined>;\n\n/**\n * useScopedParams reads and writes URL search parameters with an optional namespace prefix.\n *\n * When `scope` is provided, every key is namespaced as `scope:key`, so multiple features\n * can share the same URL without collisions (e.g. `filters:status` and `table:page`).\n *\n * @param searchString - Current URL search string (e.g. `location.search`).\n * @param scope - Namespace prefix. Default: `\"\"` (no prefix).\n *\n * @returns\n * - `getParam(key)` returns the (scoped) param value, or `null` if absent.\n * - `getScopedSearch(params)` merges `params` into the existing search string and returns the result.\n * Pass `undefined` as a value to delete that param.\n *\n * @example\n * ```tsx\n * // Without scope plain key/value params\n * const { getParam, getScopedSearch } = useScopedParams(location.search);\n * getParam('page'); // \"1\"\n * getScopedSearch({ page: 2, sort: 'name' }); // \"?page=2&sort=name\"\n * ```\n *\n * @example\n * ```tsx\n * // With scope all keys prefixed as \"filters:key\"\n * const { getParam, getScopedSearch } = useScopedParams(location.search, 'filters');\n * getParam('status'); // reads \"filters:status\"\n * getScopedSearch({ status: 'active', category: undefined }); // removes \"filters:category\"\n * ```\n */\n\nfunction useScopedParams(searchString: string, scope: string = \"\") {\n\tconst searchParams = new URLSearchParams(searchString);\n\tconst prefix = scope ? `${scope}:` : \"\";\n\n\tconst updateSearchParams = (params: ParamsType) => {\n\t\tObject.entries(params).forEach(([key, value]) => {\n\t\t\tif (value === undefined) {\n\t\t\t\tsearchParams.delete(`${prefix}${key}`);\n\t\t\t} else {\n\t\t\t\tsearchParams.set(`${prefix}${key}`, String(value));\n\t\t\t}\n\t\t});\n\t};\n\n\treturn {\n\t\tgetParam: (key: string) => searchParams.get(`${prefix}${key}`),\n\t\tgetScopedSearch: (params: ParamsType) => {\n\t\t\tupdateSearchParams(params);\n\t\t\tlet search = searchParams.toString();\n\t\t\tif (search) search = `?${search}`;\n\t\t\treturn search;\n\t\t},\n\t};\n}\n\nexport { useScopedParams };\n"],"mappings":";AAiCA,SAAS,EAAgB,GAAsB,IAAgB,IAAI;CAClE,IAAM,IAAe,IAAI,gBAAgB,CAAY,GAC/C,IAAS,IAAQ,GAAG,EAAM,KAAK,IAE/B,KAAsB,MAAuB;EAClD,OAAO,QAAQ,CAAM,CAAC,CAAC,SAAS,CAAC,GAAK,OAAW;GAChD,AAAI,MAAU,KAAA,IACb,EAAa,OAAO,GAAG,IAAS,GAAK,IAErC,EAAa,IAAI,GAAG,IAAS,KAAO,OAAO,CAAK,CAAC;EAEnD,CAAC;CACF;CAEA,OAAO;EACN,WAAW,MAAgB,EAAa,IAAI,GAAG,IAAS,GAAK;EAC7D,kBAAkB,MAAuB;GACxC,EAAmB,CAAM;GACzB,IAAI,IAAS,EAAa,SAAS;GAEnC,OADA,AAAY,MAAS,IAAI,KAClB;EACR;CACD;AACD"}
1
+ {"version":3,"file":"useScopedParams.js","names":[],"sources":["../../../src/hooks/useScopedParams.ts"],"sourcesContent":["type ParamsType = Record<string, string | number | boolean | undefined>;\n\n/**\n * useScopedParams, reads and writes URL search parameters with an optional namespace prefix.\n *\n * When `scope` is provided, every key is namespaced as `scope:key`, so multiple features\n * can share the same URL without collisions (e.g. `filters:status` and `table:page`).\n *\n * @param searchString - Current URL search string (e.g. `location.search`).\n * @param scope - Namespace prefix. Default: `\"\"` (no prefix).\n *\n * @returns\n * - `getParam(key)`, returns the (scoped) param value, or `null` if absent.\n * - `getScopedSearch(params)`, merges `params` into the existing search string and returns the result.\n * Pass `undefined` as a value to delete that param.\n *\n * @example\n * ```tsx\n * // Without scope, plain key/value params\n * const { getParam, getScopedSearch } = useScopedParams(location.search);\n * getParam('page'); // \"1\"\n * getScopedSearch({ page: 2, sort: 'name' }); // \"?page=2&sort=name\"\n * ```\n *\n * @example\n * ```tsx\n * // With scope, all keys prefixed as \"filters:key\"\n * const { getParam, getScopedSearch } = useScopedParams(location.search, 'filters');\n * getParam('status'); // reads \"filters:status\"\n * getScopedSearch({ status: 'active', category: undefined }); // removes \"filters:category\"\n * ```\n */\n\nfunction useScopedParams(searchString: string, scope: string = \"\") {\n\tconst searchParams = new URLSearchParams(searchString);\n\tconst prefix = scope ? `${scope}:` : \"\";\n\n\tconst updateSearchParams = (params: ParamsType) => {\n\t\tObject.entries(params).forEach(([key, value]) => {\n\t\t\tif (value === undefined) {\n\t\t\t\tsearchParams.delete(`${prefix}${key}`);\n\t\t\t} else {\n\t\t\t\tsearchParams.set(`${prefix}${key}`, String(value));\n\t\t\t}\n\t\t});\n\t};\n\n\treturn {\n\t\tgetParam: (key: string) => searchParams.get(`${prefix}${key}`),\n\t\tgetScopedSearch: (params: ParamsType) => {\n\t\t\tupdateSearchParams(params);\n\t\t\tlet search = searchParams.toString();\n\t\t\tif (search) search = `?${search}`;\n\t\t\treturn search;\n\t\t},\n\t};\n}\n\nexport { useScopedParams };\n"],"mappings":";AAiCA,SAAS,EAAgB,GAAsB,IAAgB,IAAI;CAClE,IAAM,IAAe,IAAI,gBAAgB,CAAY,GAC/C,IAAS,IAAQ,GAAG,EAAM,KAAK,IAE/B,KAAsB,MAAuB;EAClD,OAAO,QAAQ,CAAM,CAAC,CAAC,SAAS,CAAC,GAAK,OAAW;GAChD,AAAI,MAAU,KAAA,IACb,EAAa,OAAO,GAAG,IAAS,GAAK,IAErC,EAAa,IAAI,GAAG,IAAS,KAAO,OAAO,CAAK,CAAC;EAEnD,CAAC;CACF;CAEA,OAAO;EACN,WAAW,MAAgB,EAAa,IAAI,GAAG,IAAS,GAAK;EAC7D,kBAAkB,MAAuB;GACxC,EAAmB,CAAM;GACzB,IAAI,IAAS,EAAa,SAAS;GAEnC,OADA,AAAY,MAAS,IAAI,KAClB;EACR;CACD;AACD"}
@@ -1 +1 @@
1
- {"version":3,"file":"useScrollLock.js","names":[],"sources":["../../../src/hooks/useScrollLock.ts"],"sourcesContent":["import { useEffect } from \"react\";\n\nfunction getScrollbarWidth(): number {\n\tif (typeof window === \"undefined\") return 0;\n\treturn window.innerWidth - document.documentElement.clientWidth;\n}\n\n/**\n * useScrollLock locks `document.body` scroll while an overlay is open.\n *\n * Compensates for the scrollbar width by adding equivalent `paddingRight`,\n * preventing layout shift when the scrollbar disappears.\n * Restores the original `overflow` and `paddingRight` when `isLocked` becomes `false`.\n *\n * Used internally by `Modal` and `Drawer` you usually don't need this directly\n * unless building a custom overlay.\n *\n * @param isLocked - When `true`, body scroll is disabled.\n *\n * @example\n * ```tsx\n * function CustomOverlay({ isOpen }) {\n * useScrollLock(isOpen);\n * return isOpen ? <div className=\"overlay\">...</div> : null;\n * }\n * ```\n */\n\nfunction useScrollLock(isLocked: boolean): void {\n\tuseEffect(() => {\n\t\tif (isLocked) {\n\t\t\tconst originalOverflow = document.body.style.overflow;\n\t\t\tconst originalPaddingRight = document.body.style.paddingRight;\n\n\t\t\tconst scrollbarWidth = getScrollbarWidth();\n\n\t\t\tif (scrollbarWidth > 0) {\n\t\t\t\tconst computedStyle = window.getComputedStyle(document.body);\n\t\t\t\tconst existingPaddingRight =\n\t\t\t\t\tparseInt(computedStyle.paddingRight, 10) || 0;\n\n\t\t\t\tdocument.body.style.paddingRight = `${\n\t\t\t\t\texistingPaddingRight + scrollbarWidth\n\t\t\t\t}px`;\n\t\t\t}\n\n\t\t\tdocument.body.style.overflow = \"hidden\";\n\n\t\t\treturn () => {\n\t\t\t\tdocument.body.style.overflow = originalOverflow;\n\t\t\t\tdocument.body.style.paddingRight = originalPaddingRight;\n\t\t\t};\n\t\t}\n\t}, [isLocked]);\n}\n\nexport { useScrollLock };\n"],"mappings":";;AAEA,SAAS,IAA4B;CAEpC,OADI,OAAO,SAAW,MAAoB,IACnC,OAAO,aAAa,SAAS,gBAAgB;AACrD;AAuBA,SAAS,EAAc,GAAyB;CAC/C,QAAgB;EACf,IAAI,GAAU;GACb,IAAM,IAAmB,SAAS,KAAK,MAAM,UACvC,IAAuB,SAAS,KAAK,MAAM,cAE3C,IAAiB,EAAkB;GAEzC,IAAI,IAAiB,GAAG;IACvB,IAAM,IAAgB,OAAO,iBAAiB,SAAS,IAAI,GACrD,IACL,SAAS,EAAc,cAAc,EAAE,KAAK;IAE7C,SAAS,KAAK,MAAM,eAAe,GAClC,IAAuB,EACvB;GACF;GAIA,OAFA,SAAS,KAAK,MAAM,WAAW,gBAElB;IAEZ,AADA,SAAS,KAAK,MAAM,WAAW,GAC/B,SAAS,KAAK,MAAM,eAAe;GACpC;EACD;CACD,GAAG,CAAC,CAAQ,CAAC;AACd"}
1
+ {"version":3,"file":"useScrollLock.js","names":[],"sources":["../../../src/hooks/useScrollLock.ts"],"sourcesContent":["import { useEffect } from \"react\";\n\nfunction getScrollbarWidth(): number {\n\tif (typeof window === \"undefined\") return 0;\n\treturn window.innerWidth - document.documentElement.clientWidth;\n}\n\n/**\n * useScrollLock, locks `document.body` scroll while an overlay is open.\n *\n * Compensates for the scrollbar width by adding equivalent `paddingRight`,\n * preventing layout shift when the scrollbar disappears.\n * Restores the original `overflow` and `paddingRight` when `isLocked` becomes `false`.\n *\n * Used internally by `Modal` and `Drawer`, you usually don't need this directly\n * unless building a custom overlay.\n *\n * @param isLocked - When `true`, body scroll is disabled.\n *\n * @example\n * ```tsx\n * function CustomOverlay({ isOpen }) {\n * useScrollLock(isOpen);\n * return isOpen ? <div className=\"overlay\">...</div> : null;\n * }\n * ```\n */\n\nfunction useScrollLock(isLocked: boolean): void {\n\tuseEffect(() => {\n\t\tif (isLocked) {\n\t\t\tconst originalOverflow = document.body.style.overflow;\n\t\t\tconst originalPaddingRight = document.body.style.paddingRight;\n\n\t\t\tconst scrollbarWidth = getScrollbarWidth();\n\n\t\t\tif (scrollbarWidth > 0) {\n\t\t\t\tconst computedStyle = window.getComputedStyle(document.body);\n\t\t\t\tconst existingPaddingRight =\n\t\t\t\t\tparseInt(computedStyle.paddingRight, 10) || 0;\n\n\t\t\t\tdocument.body.style.paddingRight = `${\n\t\t\t\t\texistingPaddingRight + scrollbarWidth\n\t\t\t\t}px`;\n\t\t\t}\n\n\t\t\tdocument.body.style.overflow = \"hidden\";\n\n\t\t\treturn () => {\n\t\t\t\tdocument.body.style.overflow = originalOverflow;\n\t\t\t\tdocument.body.style.paddingRight = originalPaddingRight;\n\t\t\t};\n\t\t}\n\t}, [isLocked]);\n}\n\nexport { useScrollLock };\n"],"mappings":";;AAEA,SAAS,IAA4B;CAEpC,OADI,OAAO,SAAW,MAAoB,IACnC,OAAO,aAAa,SAAS,gBAAgB;AACrD;AAuBA,SAAS,EAAc,GAAyB;CAC/C,QAAgB;EACf,IAAI,GAAU;GACb,IAAM,IAAmB,SAAS,KAAK,MAAM,UACvC,IAAuB,SAAS,KAAK,MAAM,cAE3C,IAAiB,EAAkB;GAEzC,IAAI,IAAiB,GAAG;IACvB,IAAM,IAAgB,OAAO,iBAAiB,SAAS,IAAI,GACrD,IACL,SAAS,EAAc,cAAc,EAAE,KAAK;IAE7C,SAAS,KAAK,MAAM,eAAe,GAClC,IAAuB,EACvB;GACF;GAIA,OAFA,SAAS,KAAK,MAAM,WAAW,gBAElB;IAEZ,AADA,SAAS,KAAK,MAAM,WAAW,GAC/B,SAAS,KAAK,MAAM,eAAe;GACpC;EACD;CACD,GAAG,CAAC,CAAQ,CAAC;AACd"}
@@ -1 +1 @@
1
- {"version":3,"file":"useSearchAutomation.js","names":[],"sources":["../../../src/hooks/useSearchAutomation.ts"],"sourcesContent":["import { useEffect } from \"react\";\nimport { badResponses } from \"../templates/badResponses\";\nimport { successResponses } from \"../templates/successResponses\";\nimport { useModal } from \"./useModal\";\nimport { useScopedParams } from \"./useScopedParams\";\nimport { useToast } from \"./useToast\";\n\n/**\n * useSearchAutomation URL-driven version of `useAutomation`. Reads automation params from a\n * URL search string and executes the same side-effects (close modals, toast) on every change.\n *\n * Reads the following params (optionally prefixed by `scope:`):\n * - `closeModal=true` closes all open modals.\n * - `message` text for the toast notification.\n * - `type` `\"success\"` or `\"danger\"` toast style.\n * - `name` response identifier matched against `successResponses`/`badResponses` lists.\n *\n * @param searchString - Raw URL search string (e.g. `location.search`).\n * @param scope - Optional prefix for all params. Default: `\"\"` (no prefix).\n *\n * @example\n * ```tsx\n * // Remix / Next.js Server Action that redirects with search params\n * // redirect(\"?closeModal=true&message=Saved!&type=success\")\n * const [searchParams] = useSearchParams();\n * useSearchAutomation(searchParams.toString());\n * ```\n *\n * @example\n * ```tsx\n * // Scoped params avoids collisions when multiple features share the URL\n * // redirect(\"?filters:closeModal=true&filters:message=Applied!&filters:type=success\")\n * useSearchAutomation(location.search, \"filters\");\n * ```\n */\n\nfunction useSearchAutomation(searchString: string, scope: string = \"\") {\n\tconst { closeAll } = useModal();\n\tconst { showToast } = useToast();\n\n\tconst { getParam } = useScopedParams(searchString, scope);\n\n\tconst closeModal = getParam(\"closeModal\") === \"true\";\n\tconst message = getParam(\"message\");\n\tconst name = getParam(\"name\");\n\tconst type = getParam(\"type\") as \"success\" | \"danger\" | null;\n\n\tuseEffect(() => {\n\t\tif (closeModal) closeAll();\n\t\tif (message) {\n\t\t\tif (type === \"success\") showToast({ message, type: \"success\" });\n\t\t\tif (type === \"danger\") showToast({ message, type: \"danger\" });\n\n\t\t\tif (\n\t\t\t\tname &&\n\t\t\t\tbadResponses.includes(name) &&\n\t\t\t\t!badResponses.includes(message)\n\t\t\t) {\n\t\t\t\tshowToast({ message, type: \"danger\" });\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tname &&\n\t\t\t\tsuccessResponses.includes(name) &&\n\t\t\t\t!successResponses.includes(message)\n\t\t\t) {\n\t\t\t\tshowToast({ message, type: \"success\" });\n\t\t\t}\n\t\t}\n\t}, [closeModal, message, name, type, showToast, closeAll]);\n}\n\nexport { useSearchAutomation };\n"],"mappings":";;;;;;;AAoCA,SAAS,EAAoB,GAAsB,IAAgB,IAAI;CACtE,IAAM,EAAE,gBAAa,EAAS,GACxB,EAAE,iBAAc,EAAS,GAEzB,EAAE,gBAAa,EAAgB,GAAc,CAAK,GAElD,IAAa,EAAS,YAAY,MAAM,QACxC,IAAU,EAAS,SAAS,GAC5B,IAAO,EAAS,MAAM,GACtB,IAAO,EAAS,MAAM;CAE5B,QAAgB;EAEf,AADI,KAAY,EAAS,GACrB,MACC,MAAS,aAAW,EAAU;GAAE;GAAS,MAAM;EAAU,CAAC,GAC1D,MAAS,YAAU,EAAU;GAAE;GAAS,MAAM;EAAS,CAAC,GAG3D,KACA,EAAa,SAAS,CAAI,KAC1B,CAAC,EAAa,SAAS,CAAO,KAE9B,EAAU;GAAE;GAAS,MAAM;EAAS,CAAC,GAIrC,KACA,EAAiB,SAAS,CAAI,KAC9B,CAAC,EAAiB,SAAS,CAAO,KAElC,EAAU;GAAE;GAAS,MAAM;EAAU,CAAC;CAGzC,GAAG;EAAC;EAAY;EAAS;EAAM;EAAM;EAAW;CAAQ,CAAC;AAC1D"}
1
+ {"version":3,"file":"useSearchAutomation.js","names":[],"sources":["../../../src/hooks/useSearchAutomation.ts"],"sourcesContent":["import { useEffect } from \"react\";\nimport { badResponses } from \"../templates/badResponses\";\nimport { successResponses } from \"../templates/successResponses\";\nimport { useModal } from \"./useModal\";\nimport { useScopedParams } from \"./useScopedParams\";\nimport { useToast } from \"./useToast\";\n\n/**\n * useSearchAutomation, URL-driven version of `useAutomation`. Reads automation params from a\n * URL search string and executes the same side-effects (close modals, toast) on every change.\n *\n * Reads the following params (optionally prefixed by `scope:`):\n * - `closeModal=true`, closes all open modals.\n * - `message`, text for the toast notification.\n * - `type`, `\"success\"` or `\"danger\"` toast style.\n * - `name`, response identifier matched against `successResponses`/`badResponses` lists.\n *\n * @param searchString - Raw URL search string (e.g. `location.search`).\n * @param scope - Optional prefix for all params. Default: `\"\"` (no prefix).\n *\n * @example\n * ```tsx\n * // Remix / Next.js Server Action that redirects with search params\n * // redirect(\"?closeModal=true&message=Saved!&type=success\")\n * const [searchParams] = useSearchParams();\n * useSearchAutomation(searchParams.toString());\n * ```\n *\n * @example\n * ```tsx\n * // Scoped params, avoids collisions when multiple features share the URL\n * // redirect(\"?filters:closeModal=true&filters:message=Applied!&filters:type=success\")\n * useSearchAutomation(location.search, \"filters\");\n * ```\n */\n\nfunction useSearchAutomation(searchString: string, scope: string = \"\") {\n\tconst { closeAll } = useModal();\n\tconst { showToast } = useToast();\n\n\tconst { getParam } = useScopedParams(searchString, scope);\n\n\tconst closeModal = getParam(\"closeModal\") === \"true\";\n\tconst message = getParam(\"message\");\n\tconst name = getParam(\"name\");\n\tconst type = getParam(\"type\") as \"success\" | \"danger\" | null;\n\n\tuseEffect(() => {\n\t\tif (closeModal) closeAll();\n\t\tif (message) {\n\t\t\tif (type === \"success\") showToast({ message, type: \"success\" });\n\t\t\tif (type === \"danger\") showToast({ message, type: \"danger\" });\n\n\t\t\tif (\n\t\t\t\tname &&\n\t\t\t\tbadResponses.includes(name) &&\n\t\t\t\t!badResponses.includes(message)\n\t\t\t) {\n\t\t\t\tshowToast({ message, type: \"danger\" });\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tname &&\n\t\t\t\tsuccessResponses.includes(name) &&\n\t\t\t\t!successResponses.includes(message)\n\t\t\t) {\n\t\t\t\tshowToast({ message, type: \"success\" });\n\t\t\t}\n\t\t}\n\t}, [closeModal, message, name, type, showToast, closeAll]);\n}\n\nexport { useSearchAutomation };\n"],"mappings":";;;;;;;AAoCA,SAAS,EAAoB,GAAsB,IAAgB,IAAI;CACtE,IAAM,EAAE,gBAAa,EAAS,GACxB,EAAE,iBAAc,EAAS,GAEzB,EAAE,gBAAa,EAAgB,GAAc,CAAK,GAElD,IAAa,EAAS,YAAY,MAAM,QACxC,IAAU,EAAS,SAAS,GAC5B,IAAO,EAAS,MAAM,GACtB,IAAO,EAAS,MAAM;CAE5B,QAAgB;EAEf,AADI,KAAY,EAAS,GACrB,MACC,MAAS,aAAW,EAAU;GAAE;GAAS,MAAM;EAAU,CAAC,GAC1D,MAAS,YAAU,EAAU;GAAE;GAAS,MAAM;EAAS,CAAC,GAG3D,KACA,EAAa,SAAS,CAAI,KAC1B,CAAC,EAAa,SAAS,CAAO,KAE9B,EAAU;GAAE;GAAS,MAAM;EAAS,CAAC,GAIrC,KACA,EAAiB,SAAS,CAAI,KAC9B,CAAC,EAAiB,SAAS,CAAO,KAElC,EAAU;GAAE;GAAS,MAAM;EAAU,CAAC;CAGzC,GAAG;EAAC;EAAY;EAAS;EAAM;EAAM;EAAW;CAAQ,CAAC;AAC1D"}
@@ -1 +1 @@
1
- {"version":3,"file":"useSlider.js","names":[],"sources":["../../../src/hooks/useSlider.ts"],"sourcesContent":["import { useState } from \"react\";\n\ntype UseSliderReturnProps = [number, (number: number) => void];\n\n/**\n * useSlider state manager for the `Slider` component. Clamps values to `[0, 100]`.\n *\n * @param defaultValue - Initial percentage value (0–100). Default: 0\n *\n * @returns `[value, setValue]` current percentage and a setter that clamps at the boundaries.\n *\n * @example\n * ```tsx\n * const [volume, setVolume] = useSlider(50);\n * return <Slider value={volume} onChange={setVolume} />;\n * ```\n */\n\nfunction useSlider(defaultValue?: number): UseSliderReturnProps {\n\tfunction getDefaultValue() {\n\t\tif (!defaultValue) return 0;\n\t\tif (defaultValue <= 0) return 0;\n\t\tif (defaultValue >= 100) return 100;\n\t\treturn defaultValue;\n\t}\n\n\tconst [sliderValue, setSliderValue] = useState(getDefaultValue());\n\n\tfunction changeSliderValue(value: number) {\n\t\tif (value <= 0) return setSliderValue(0);\n\t\tif (value >= 100) return setSliderValue(100);\n\t\treturn setSliderValue(value);\n\t}\n\n\treturn [sliderValue, changeSliderValue];\n}\n\nexport { useSlider };\n"],"mappings":";;AAkBA,SAAS,EAAU,GAA6C;CAC/D,SAAS,IAAkB;EAI1B,OAHI,CAAC,KACD,KAAgB,IAAU,IAC1B,KAAgB,MAAY,MACzB;CACR;CAEA,IAAM,CAAC,GAAa,KAAkB,EAAS,EAAgB,CAAC;CAEhE,SAAS,EAAkB,GAAe;EAGzC,OAFuB,EAAnB,KAAS,IAAyB,IAClC,KAAS,MAA2B,MAClB,CAFiB;CAGxC;CAEA,OAAO,CAAC,GAAa,CAAiB;AACvC"}
1
+ {"version":3,"file":"useSlider.js","names":[],"sources":["../../../src/hooks/useSlider.ts"],"sourcesContent":["import { useState } from \"react\";\n\ntype UseSliderReturnProps = [number, (number: number) => void];\n\n/**\n * useSlider, state manager for the `Slider` component. Clamps values to `[0, 100]`.\n *\n * @param defaultValue - Initial percentage value (0–100). Default: 0\n *\n * @returns `[value, setValue]`, current percentage and a setter that clamps at the boundaries.\n *\n * @example\n * ```tsx\n * const [volume, setVolume] = useSlider(50);\n * return <Slider value={volume} onChange={setVolume} />;\n * ```\n */\n\nfunction useSlider(defaultValue?: number): UseSliderReturnProps {\n\tfunction getDefaultValue() {\n\t\tif (!defaultValue) return 0;\n\t\tif (defaultValue <= 0) return 0;\n\t\tif (defaultValue >= 100) return 100;\n\t\treturn defaultValue;\n\t}\n\n\tconst [sliderValue, setSliderValue] = useState(getDefaultValue());\n\n\tfunction changeSliderValue(value: number) {\n\t\tif (value <= 0) return setSliderValue(0);\n\t\tif (value >= 100) return setSliderValue(100);\n\t\treturn setSliderValue(value);\n\t}\n\n\treturn [sliderValue, changeSliderValue];\n}\n\nexport { useSlider };\n"],"mappings":";;AAkBA,SAAS,EAAU,GAA6C;CAC/D,SAAS,IAAkB;EAI1B,OAHI,CAAC,KACD,KAAgB,IAAU,IAC1B,KAAgB,MAAY,MACzB;CACR;CAEA,IAAM,CAAC,GAAa,KAAkB,EAAS,EAAgB,CAAC;CAEhE,SAAS,EAAkB,GAAe;EAGzC,OAFuB,EAAnB,KAAS,IAAyB,IAClC,KAAS,MAA2B,MAClB,CAFiB;CAGxC;CAEA,OAAO,CAAC,GAAa,CAAiB;AACvC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useToast.js","names":[],"sources":["../../../src/hooks/useToast.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport { toastContext } from \"../providers/toastProvider\";\n\n/**\n * useToast reads `ToastProvider` context to display toast notifications.\n *\n * @returns Context containing `showToast(options)`.\n *\n * @throws If called outside a `ToastProvider`.\n *\n * @example\n * ```tsx\n * const { showToast } = useToast();\n *\n * // After a successful save\n * showToast({ message: \"Changes saved!\", type: \"success\" });\n *\n * // After a failed request\n * showToast({ message: \"Failed to save changes.\", type: \"danger\" });\n * ```\n */\n\nfunction useToast() {\n\tconst contextData = useContext(toastContext);\n\n\tif (Object.entries(contextData).length === 0) {\n\t\tthrow new Error(\"useToast must be used within a Provider\");\n\t}\n\n\treturn contextData;\n}\n\nexport { useToast };\n"],"mappings":";;;AAsBA,SAAS,IAAW;CACnB,IAAM,IAAc,EAAW,CAAY;CAE3C,IAAI,OAAO,QAAQ,CAAW,CAAC,CAAC,WAAW,GAC1C,MAAU,MAAM,yCAAyC;CAG1D,OAAO;AACR"}
1
+ {"version":3,"file":"useToast.js","names":[],"sources":["../../../src/hooks/useToast.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport { toastContext } from \"../providers/toastProvider\";\n\n/**\n * useToast, reads `ToastProvider` context to display toast notifications.\n *\n * @returns Context containing `showToast(options)`.\n *\n * @throws If called outside a `ToastProvider`.\n *\n * @example\n * ```tsx\n * const { showToast } = useToast();\n *\n * // After a successful save\n * showToast({ message: \"Changes saved!\", type: \"success\" });\n *\n * // After a failed request\n * showToast({ message: \"Failed to save changes.\", type: \"danger\" });\n * ```\n */\n\nfunction useToast() {\n\tconst contextData = useContext(toastContext);\n\n\tif (Object.entries(contextData).length === 0) {\n\t\tthrow new Error(\"useToast must be used within a Provider\");\n\t}\n\n\treturn contextData;\n}\n\nexport { useToast };\n"],"mappings":";;;AAsBA,SAAS,IAAW;CACnB,IAAM,IAAc,EAAW,CAAY;CAE3C,IAAI,OAAO,QAAQ,CAAW,CAAC,CAAC,WAAW,GAC1C,MAAU,MAAM,yCAAyC;CAG1D,OAAO;AACR"}
@@ -1 +1 @@
1
- {"version":3,"file":"drawerProvider.js","names":[],"sources":["../../../src/providers/drawerProvider.tsx"],"sourcesContent":["import { createContext, type ReactNode, useState } from \"react\";\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\ntype DrawerContextProps<T = any> = {\n\tdrawerIsOpen(key: string): boolean;\n\tdrawerData(key: string): T;\n\topenDrawer(key: string, data?: T): void;\n\tcloseDrawer(key: string): void;\n};\n\ntype OpenedDrawers = {\n\tkey: string;\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tdata?: any;\n}[];\n\ntype DrawerProviderProps = {\n\tchildren: ReactNode;\n\tenableDrawerAutomation?: boolean;\n};\n\nconst drawerContext = createContext({} as DrawerContextProps);\n\n/**\n * DrawerProvider context provider that manages open/close state and data for named drawers.\n *\n * Wrap your app (or a subtree) with this once. Any component in the tree can then call\n * `useDrawer(key)` to open, close, or read data for a specific drawer.\n *\n * @param props.children - Components that will have access to drawer context.\n *\n * @returns DrawerProvider JSX element.\n *\n * @example\n * ```tsx\n * // In your root layout\n * <DrawerProvider>\n * <App />\n * </DrawerProvider>\n *\n * // Opening a drawer from anywhere in the tree\n * const { openDrawer } = useDrawer();\n * openDrawer('filters', { category: 'electronics' });\n *\n * // Consuming in the drawer component\n * const { drawerIsOpen, drawerData, closeDrawer } = useDrawer<{ category: string }>('filters');\n * ```\n */\n\nfunction DrawerProvider(args: DrawerProviderProps) {\n\tconst { children = false } = args;\n\tconst [openedDrawers, setOpenedDrawers] = useState<OpenedDrawers>([]);\n\n\tfunction drawerIsOpen(key: string) {\n\t\treturn !!openedDrawers.some((drawer) => drawer.key === key);\n\t}\n\n\tfunction drawerData(key: string) {\n\t\treturn openedDrawers.find((drawer) => drawer.key === key)?.data;\n\t}\n\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tfunction openDrawer(key: string, data?: any) {\n\t\tconst alreadyExist = drawerIsOpen(key);\n\t\tif (alreadyExist) {\n\t\t\tsetOpenedDrawers((old) => {\n\t\t\t\tconst filtered = old.filter((drawer) => drawer.key !== key);\n\t\t\t\treturn [...filtered, { key, data }];\n\t\t\t});\n\t\t} else setOpenedDrawers([...openedDrawers, { key, data }]);\n\t}\n\n\tfunction closeDrawer(key: string) {\n\t\tsetOpenedDrawers(openedDrawers.filter((drawer) => drawer.key !== key));\n\t}\n\n\treturn (\n\t\t<drawerContext.Provider\n\t\t\tvalue={{ drawerIsOpen, drawerData, openDrawer, closeDrawer }}\n\t\t>\n\t\t\t{children}\n\t\t</drawerContext.Provider>\n\t);\n}\n\nexport { type DrawerContextProps, DrawerProvider, drawerContext };\n"],"mappings":";;;AAqBA,IAAM,IAAgB,EAAc,CAAC,CAAuB;AA4B5D,SAAS,EAAe,GAA2B;CAClD,IAAM,EAAE,cAAW,OAAU,GACvB,CAAC,GAAe,KAAoB,EAAwB,CAAC,CAAC;CAEpE,SAAS,EAAa,GAAa;EAClC,OAAO,CAAC,CAAC,EAAc,MAAM,MAAW,EAAO,QAAQ,CAAG;CAC3D;CAEA,SAAS,EAAW,GAAa;EAChC,OAAO,EAAc,MAAM,MAAW,EAAO,QAAQ,CAAG,CAAC,EAAE;CAC5D;CAGA,SAAS,EAAW,GAAa,GAAY;EAE5C,AADqB,EAAa,CAC9B,IACH,GAAkB,MAEV,CAAC,GADS,EAAI,QAAQ,MAAW,EAAO,QAAQ,CAC5C,GAAU;GAAE;GAAK;EAAK,CAAC,CAClC,IACK,EAAiB,CAAC,GAAG,GAAe;GAAE;GAAK;EAAK,CAAC,CAAC;CAC1D;CAEA,SAAS,EAAY,GAAa;EACjC,EAAiB,EAAc,QAAQ,MAAW,EAAO,QAAQ,CAAG,CAAC;CACtE;CAEA,OACC,kBAAC,EAAc,UAAf;EACC,OAAO;GAAE;GAAc;GAAY;GAAY;EAAY;EAE1D;CACsB,CAAA;AAE1B"}
1
+ {"version":3,"file":"drawerProvider.js","names":[],"sources":["../../../src/providers/drawerProvider.tsx"],"sourcesContent":["import { createContext, type ReactNode, useState } from \"react\";\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\ntype DrawerContextProps<T = any> = {\n\tdrawerIsOpen(key: string): boolean;\n\tdrawerData(key: string): T;\n\topenDrawer(key: string, data?: T): void;\n\tcloseDrawer(key: string): void;\n};\n\ntype OpenedDrawers = {\n\tkey: string;\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tdata?: any;\n}[];\n\ntype DrawerProviderProps = {\n\tchildren: ReactNode;\n\tenableDrawerAutomation?: boolean;\n};\n\nconst drawerContext = createContext({} as DrawerContextProps);\n\n/**\n * DrawerProvider, context provider that manages open/close state and data for named drawers.\n *\n * Wrap your app (or a subtree) with this once. Any component in the tree can then call\n * `useDrawer(key)` to open, close, or read data for a specific drawer.\n *\n * @param props.children - Components that will have access to drawer context.\n *\n * @returns DrawerProvider JSX element.\n *\n * @example\n * ```tsx\n * // In your root layout\n * <DrawerProvider>\n * <App />\n * </DrawerProvider>\n *\n * // Opening a drawer from anywhere in the tree\n * const { openDrawer } = useDrawer();\n * openDrawer('filters', { category: 'electronics' });\n *\n * // Consuming in the drawer component\n * const { drawerIsOpen, drawerData, closeDrawer } = useDrawer<{ category: string }>('filters');\n * ```\n */\n\nfunction DrawerProvider(args: DrawerProviderProps) {\n\tconst { children = false } = args;\n\tconst [openedDrawers, setOpenedDrawers] = useState<OpenedDrawers>([]);\n\n\tfunction drawerIsOpen(key: string) {\n\t\treturn !!openedDrawers.some((drawer) => drawer.key === key);\n\t}\n\n\tfunction drawerData(key: string) {\n\t\treturn openedDrawers.find((drawer) => drawer.key === key)?.data;\n\t}\n\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tfunction openDrawer(key: string, data?: any) {\n\t\tconst alreadyExist = drawerIsOpen(key);\n\t\tif (alreadyExist) {\n\t\t\tsetOpenedDrawers((old) => {\n\t\t\t\tconst filtered = old.filter((drawer) => drawer.key !== key);\n\t\t\t\treturn [...filtered, { key, data }];\n\t\t\t});\n\t\t} else setOpenedDrawers([...openedDrawers, { key, data }]);\n\t}\n\n\tfunction closeDrawer(key: string) {\n\t\tsetOpenedDrawers(openedDrawers.filter((drawer) => drawer.key !== key));\n\t}\n\n\treturn (\n\t\t<drawerContext.Provider\n\t\t\tvalue={{ drawerIsOpen, drawerData, openDrawer, closeDrawer }}\n\t\t>\n\t\t\t{children}\n\t\t</drawerContext.Provider>\n\t);\n}\n\nexport { type DrawerContextProps, DrawerProvider, drawerContext };\n"],"mappings":";;;AAqBA,IAAM,IAAgB,EAAc,CAAC,CAAuB;AA4B5D,SAAS,EAAe,GAA2B;CAClD,IAAM,EAAE,cAAW,OAAU,GACvB,CAAC,GAAe,KAAoB,EAAwB,CAAC,CAAC;CAEpE,SAAS,EAAa,GAAa;EAClC,OAAO,CAAC,CAAC,EAAc,MAAM,MAAW,EAAO,QAAQ,CAAG;CAC3D;CAEA,SAAS,EAAW,GAAa;EAChC,OAAO,EAAc,MAAM,MAAW,EAAO,QAAQ,CAAG,CAAC,EAAE;CAC5D;CAGA,SAAS,EAAW,GAAa,GAAY;EAE5C,AADqB,EAAa,CAC9B,IACH,GAAkB,MAEV,CAAC,GADS,EAAI,QAAQ,MAAW,EAAO,QAAQ,CAC5C,GAAU;GAAE;GAAK;EAAK,CAAC,CAClC,IACK,EAAiB,CAAC,GAAG,GAAe;GAAE;GAAK;EAAK,CAAC,CAAC;CAC1D;CAEA,SAAS,EAAY,GAAa;EACjC,EAAiB,EAAc,QAAQ,MAAW,EAAO,QAAQ,CAAG,CAAC;CACtE;CAEA,OACC,kBAAC,EAAc,UAAf;EACC,OAAO;GAAE;GAAc;GAAY;GAAY;EAAY;EAE1D;CACsB,CAAA;AAE1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"formProvider.js","names":[],"sources":["../../../src/providers/formProvider.tsx"],"sourcesContent":["import { cloneElement, createContext, type ReactNode, useMemo } from \"react\";\n\ntype FormContextProps = {\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tfieldErrors: { [x: string]: any };\n};\n\ntype FormProviderProps = {\n\tchildren: ReactNode;\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tfieldErrors?: any;\n\tform?: React.ReactElement;\n};\n\nconst formContext = createContext({} as FormContextProps);\n\n/**\n * FormProvider distributes field-level validation errors to all form input components in its subtree.\n *\n * All inputs (`Input`, `Select`, `Checkbox`, etc.) read `fieldErrors[name]` automatically,\n * so you don't need to pass errors manually to each field. Use the `form` prop to also wrap\n * children in a `<form>` element (e.g. for Remix `<Form />`).\n *\n * @param props.children - Form fields and other components.\n * @param props.fieldErrors - Map of field name → error message (e.g. from Zod / server validation).\n * @param props.form - Optional `<form>` element to wrap children in (cloned with `children`).\n *\n * @returns FormProvider JSX element.\n *\n * @example\n * ```tsx\n * // With Remix action errors\n * const actionData = useActionData<typeof action>();\n *\n * <FormProvider fieldErrors={actionData?.fieldErrors}>\n * <Input name=\"email\" label=\"Email\" />\n * <Input name=\"password\" label=\"Password\" type=\"password\" />\n * <Button type=\"submit\">Login</Button>\n * </FormProvider>\n * ```\n */\n\nfunction FormProvider(props: FormProviderProps) {\n\tconst { children, fieldErrors, form } = props;\n\n\tconst value = useMemo(() => ({ fieldErrors }), [fieldErrors]);\n\n\treturn (\n\t\t<formContext.Provider value={value}>\n\t\t\t{!form && children}\n\t\t\t{form &&\n\t\t\t\tcloneElement(\n\t\t\t\t\tform as React.ReactElement,\n\t\t\t\t\tform.props as React.ReactElement,\n\t\t\t\t\tchildren,\n\t\t\t\t)}\n\t\t</formContext.Provider>\n\t);\n}\n\nexport { FormProvider, formContext };\n"],"mappings":";;;AAcA,IAAM,IAAc,EAAc,CAAC,CAAqB;AA4BxD,SAAS,EAAa,GAA0B;CAC/C,IAAM,EAAE,aAAU,gBAAa,YAAS,GAElC,IAAQ,SAAe,EAAE,eAAY,IAAI,CAAC,CAAW,CAAC;CAE5D,OACC,kBAAC,EAAY,UAAb;EAA6B;YAA7B,CACE,CAAC,KAAQ,GACT,KACA,EACC,GACA,EAAK,OACL,CACD,CACoB;;AAExB"}
1
+ {"version":3,"file":"formProvider.js","names":[],"sources":["../../../src/providers/formProvider.tsx"],"sourcesContent":["import { cloneElement, createContext, type ReactNode, useMemo } from \"react\";\n\ntype FormContextProps = {\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tfieldErrors: { [x: string]: any };\n};\n\ntype FormProviderProps = {\n\tchildren: ReactNode;\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tfieldErrors?: any;\n\tform?: React.ReactElement;\n};\n\nconst formContext = createContext({} as FormContextProps);\n\n/**\n * FormProvider, distributes field-level validation errors to all form input components in its subtree.\n *\n * All inputs (`Input`, `Select`, `Checkbox`, etc.) read `fieldErrors[name]` automatically,\n * so you don't need to pass errors manually to each field. Use the `form` prop to also wrap\n * children in a `<form>` element (e.g. for Remix `<Form />`).\n *\n * @param props.children - Form fields and other components.\n * @param props.fieldErrors - Map of field name → error message (e.g. from Zod / server validation).\n * @param props.form - Optional `<form>` element to wrap children in (cloned with `children`).\n *\n * @returns FormProvider JSX element.\n *\n * @example\n * ```tsx\n * // With Remix action errors\n * const actionData = useActionData<typeof action>();\n *\n * <FormProvider fieldErrors={actionData?.fieldErrors}>\n * <Input name=\"email\" label=\"Email\" />\n * <Input name=\"password\" label=\"Password\" type=\"password\" />\n * <Button type=\"submit\">Login</Button>\n * </FormProvider>\n * ```\n */\n\nfunction FormProvider(props: FormProviderProps) {\n\tconst { children, fieldErrors, form } = props;\n\n\tconst value = useMemo(() => ({ fieldErrors }), [fieldErrors]);\n\n\treturn (\n\t\t<formContext.Provider value={value}>\n\t\t\t{!form && children}\n\t\t\t{form &&\n\t\t\t\tcloneElement(\n\t\t\t\t\tform as React.ReactElement,\n\t\t\t\t\tform.props as React.ReactElement,\n\t\t\t\t\tchildren,\n\t\t\t\t)}\n\t\t</formContext.Provider>\n\t);\n}\n\nexport { FormProvider, formContext };\n"],"mappings":";;;AAcA,IAAM,IAAc,EAAc,CAAC,CAAqB;AA4BxD,SAAS,EAAa,GAA0B;CAC/C,IAAM,EAAE,aAAU,gBAAa,YAAS,GAElC,IAAQ,SAAe,EAAE,eAAY,IAAI,CAAC,CAAW,CAAC;CAE5D,OACC,kBAAC,EAAY,UAAb;EAA6B;YAA7B,CACE,CAAC,KAAQ,GACT,KACA,EACC,GACA,EAAK,OACL,CACD,CACoB;;AAExB"}
@@ -1,42 +1,36 @@
1
- import { createContext as e, useState as t } from "react";
2
- import { jsx as n } from "react/jsx-runtime";
1
+ import { createContext as e, useCallback as t, useMemo as n, useState as r } from "react";
2
+ import { jsx as i } from "react/jsx-runtime";
3
3
  //#region src/providers/modalProvider.tsx
4
- var r = e({});
5
- function i(e) {
6
- let { children: i = !1 } = e, [a, o] = t([]);
7
- function s(e) {
8
- return !!a.some((t) => t.key === e);
9
- }
10
- function c(e) {
11
- return a.find((t) => t.key === e)?.data;
12
- }
13
- function l(e, t) {
14
- s(e) ? o((n) => [...n.filter((t) => t.key !== e), {
15
- key: e,
16
- data: t
17
- }]) : o([...a, {
4
+ var a = e({});
5
+ function o(e) {
6
+ let { children: o = !1 } = e, [s, c] = r([]), l = t((e) => s.some((t) => t.key === e), [s]), u = t((e) => s.find((t) => t.key === e)?.data, [s]), d = t((e, t) => {
7
+ c((n) => [...n.filter((t) => t.key !== e), {
18
8
  key: e,
19
9
  data: t
20
10
  }]);
21
- }
22
- function u(e) {
23
- o(a.filter((t) => t.key !== e));
24
- }
25
- function d() {
26
- o([]);
27
- }
28
- return /* @__PURE__ */ n(r.Provider, {
29
- value: {
30
- modalIsOpen: s,
31
- modalData: c,
32
- openModal: l,
33
- closeModal: u,
34
- closeAll: d
35
- },
36
- children: i
11
+ }, []), f = t((e) => {
12
+ c((t) => t.filter((t) => t.key !== e));
13
+ }, []), p = t(() => {
14
+ c([]);
15
+ }, []), m = n(() => ({
16
+ modalIsOpen: l,
17
+ modalData: u,
18
+ openModal: d,
19
+ closeModal: f,
20
+ closeAll: p
21
+ }), [
22
+ l,
23
+ u,
24
+ d,
25
+ f,
26
+ p
27
+ ]);
28
+ return /* @__PURE__ */ i(a.Provider, {
29
+ value: m,
30
+ children: o
37
31
  });
38
32
  }
39
33
  //#endregion
40
- export { i as ModalProvider, r as modalContext };
34
+ export { o as ModalProvider, a as modalContext };
41
35
 
42
36
  //# sourceMappingURL=modalProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"modalProvider.js","names":[],"sources":["../../../src/providers/modalProvider.tsx"],"sourcesContent":["import { createContext, type ReactNode, useState } from \"react\";\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\ntype ModalContextProps<T = any> = {\n\tmodalIsOpen(key: string): boolean;\n\tmodalData(key: string): T;\n\topenModal(key: string, data?: T): void;\n\tcloseModal(key: string): void;\n\tcloseAll(): void;\n};\n\ntype OpenedModals = {\n\tkey: string;\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tdata?: any;\n}[];\n\ntype ModalProviderProps = {\n\tchildren: ReactNode;\n\tenableModalAutomation?: boolean;\n};\n\nconst modalContext = createContext({} as ModalContextProps);\n\n/**\n * ModalProvider context provider that manages open/close state and data for named modals.\n *\n * Wrap your app (or a subtree) with this once. Any component in the tree can then call\n * `useModal(key)` to open, close, or read data for a specific modal. `closeAll()` is also\n * available (used by `useAutomation` to close all modals after a successful form action).\n *\n * @param props.children - Components that will have access to modal context.\n *\n * @returns ModalProvider JSX element.\n *\n * @example\n * ```tsx\n * // In your root layout\n * <ModalProvider>\n * <App />\n * </ModalProvider>\n *\n * // Opening a modal from anywhere in the tree\n * const { openModal } = useModal();\n * openModal('confirm-delete', { id: user.id });\n *\n * // Consuming in the modal component\n * const { modalIsOpen, modalData, closeModal } = useModal<{ id: number }>('confirm-delete');\n * ```\n */\n\nfunction ModalProvider(args: ModalProviderProps) {\n\tconst { children = false } = args;\n\tconst [openedModals, setOpenedModals] = useState<OpenedModals>([]);\n\n\tfunction modalIsOpen(key: string) {\n\t\treturn !!openedModals.some((modal) => modal.key === key);\n\t}\n\n\tfunction modalData(key: string) {\n\t\treturn openedModals.find((modal) => modal.key === key)?.data;\n\t}\n\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tfunction openModal(key: string, data?: any) {\n\t\tconst alreadyExist = modalIsOpen(key);\n\t\tif (alreadyExist) {\n\t\t\tsetOpenedModals((old) => {\n\t\t\t\tconst filtered = old.filter((modal) => modal.key !== key);\n\t\t\t\treturn [...filtered, { key, data }];\n\t\t\t});\n\t\t} else setOpenedModals([...openedModals, { key, data }]);\n\t}\n\n\tfunction closeModal(key: string) {\n\t\tsetOpenedModals(openedModals.filter((modal) => modal.key !== key));\n\t}\n\n\tfunction closeAll() {\n\t\tsetOpenedModals([]);\n\t}\n\n\treturn (\n\t\t<modalContext.Provider\n\t\t\tvalue={{ modalIsOpen, modalData, openModal, closeModal, closeAll }}\n\t\t>\n\t\t\t{children}\n\t\t</modalContext.Provider>\n\t);\n}\n\nexport { type ModalContextProps, ModalProvider, modalContext };\n"],"mappings":";;;AAsBA,IAAM,IAAe,EAAc,CAAC,CAAsB;AA6B1D,SAAS,EAAc,GAA0B;CAChD,IAAM,EAAE,cAAW,OAAU,GACvB,CAAC,GAAc,KAAmB,EAAuB,CAAC,CAAC;CAEjE,SAAS,EAAY,GAAa;EACjC,OAAO,CAAC,CAAC,EAAa,MAAM,MAAU,EAAM,QAAQ,CAAG;CACxD;CAEA,SAAS,EAAU,GAAa;EAC/B,OAAO,EAAa,MAAM,MAAU,EAAM,QAAQ,CAAG,CAAC,EAAE;CACzD;CAGA,SAAS,EAAU,GAAa,GAAY;EAE3C,AADqB,EAAY,CAC7B,IACH,GAAiB,MAET,CAAC,GADS,EAAI,QAAQ,MAAU,EAAM,QAAQ,CAC1C,GAAU;GAAE;GAAK;EAAK,CAAC,CAClC,IACK,EAAgB,CAAC,GAAG,GAAc;GAAE;GAAK;EAAK,CAAC,CAAC;CACxD;CAEA,SAAS,EAAW,GAAa;EAChC,EAAgB,EAAa,QAAQ,MAAU,EAAM,QAAQ,CAAG,CAAC;CAClE;CAEA,SAAS,IAAW;EACnB,EAAgB,CAAC,CAAC;CACnB;CAEA,OACC,kBAAC,EAAa,UAAd;EACC,OAAO;GAAE;GAAa;GAAW;GAAW;GAAY;EAAS;EAEhE;CACqB,CAAA;AAEzB"}
1
+ {"version":3,"file":"modalProvider.js","names":[],"sources":["../../../src/providers/modalProvider.tsx"],"sourcesContent":["import {\n\tcreateContext,\n\ttype ReactNode,\n\tuseCallback,\n\tuseMemo,\n\tuseState,\n} from \"react\";\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\ntype ModalContextProps<T = any> = {\n\tmodalIsOpen(key: string): boolean;\n\tmodalData(key: string): T;\n\topenModal(key: string, data?: T): void;\n\tcloseModal(key: string): void;\n\tcloseAll(): void;\n};\n\ntype OpenedModals = {\n\tkey: string;\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tdata?: any;\n}[];\n\ntype ModalProviderProps = {\n\tchildren: ReactNode;\n\tenableModalAutomation?: boolean;\n};\n\nconst modalContext = createContext({} as ModalContextProps);\n\n/**\n * ModalProvider, context provider that manages open/close state and data for named modals.\n *\n * Wrap your app (or a subtree) with this once. Any component in the tree can then call\n * `useModal(key)` to open, close, or read data for a specific modal. `closeAll()` is also\n * available (used by `useAutomation` to close all modals after a successful form action).\n *\n * @param props.children - Components that will have access to modal context.\n *\n * @returns ModalProvider JSX element.\n *\n * @example\n * ```tsx\n * // In your root layout\n * <ModalProvider>\n * <App />\n * </ModalProvider>\n *\n * // Opening a modal from anywhere in the tree\n * const { openModal } = useModal();\n * openModal('confirm-delete', { id: user.id });\n *\n * // Consuming in the modal component\n * const { modalIsOpen, modalData, closeModal } = useModal<{ id: number }>('confirm-delete');\n * ```\n */\n\nfunction ModalProvider(args: ModalProviderProps) {\n\tconst { children = false } = args;\n\tconst [openedModals, setOpenedModals] = useState<OpenedModals>([]);\n\n\tconst modalIsOpen = useCallback(\n\t\t(key: string) => openedModals.some((modal) => modal.key === key),\n\t\t[openedModals],\n\t);\n\n\tconst modalData = useCallback(\n\t\t(key: string) => openedModals.find((modal) => modal.key === key)?.data,\n\t\t[openedModals],\n\t);\n\n\tconst openModal = useCallback(\n\t\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\t\t(key: string, data?: any) => {\n\t\t\tsetOpenedModals((old) => {\n\t\t\t\tconst filtered = old.filter((modal) => modal.key !== key);\n\t\t\t\treturn [...filtered, { key, data }];\n\t\t\t});\n\t\t},\n\t\t[],\n\t);\n\n\tconst closeModal = useCallback((key: string) => {\n\t\tsetOpenedModals((old) => old.filter((modal) => modal.key !== key));\n\t}, []);\n\n\tconst closeAll = useCallback(() => {\n\t\tsetOpenedModals([]);\n\t}, []);\n\n\tconst value = useMemo(\n\t\t() => ({ modalIsOpen, modalData, openModal, closeModal, closeAll }),\n\t\t[modalIsOpen, modalData, openModal, closeModal, closeAll],\n\t);\n\n\treturn (\n\t\t<modalContext.Provider value={value}>{children}</modalContext.Provider>\n\t);\n}\n\nexport { type ModalContextProps, ModalProvider, modalContext };\n"],"mappings":";;;AA4BA,IAAM,IAAe,EAAc,CAAC,CAAsB;AA6B1D,SAAS,EAAc,GAA0B;CAChD,IAAM,EAAE,cAAW,OAAU,GACvB,CAAC,GAAc,KAAmB,EAAuB,CAAC,CAAC,GAE3D,IAAc,GAClB,MAAgB,EAAa,MAAM,MAAU,EAAM,QAAQ,CAAG,GAC/D,CAAC,CAAY,CACd,GAEM,IAAY,GAChB,MAAgB,EAAa,MAAM,MAAU,EAAM,QAAQ,CAAG,CAAC,EAAE,MAClE,CAAC,CAAY,CACd,GAEM,IAAY,GAEhB,GAAa,MAAe;EAC5B,GAAiB,MAET,CAAC,GADS,EAAI,QAAQ,MAAU,EAAM,QAAQ,CAC1C,GAAU;GAAE;GAAK;EAAK,CAAC,CAClC;CACF,GACA,CAAC,CACF,GAEM,IAAa,GAAa,MAAgB;EAC/C,GAAiB,MAAQ,EAAI,QAAQ,MAAU,EAAM,QAAQ,CAAG,CAAC;CAClE,GAAG,CAAC,CAAC,GAEC,IAAW,QAAkB;EAClC,EAAgB,CAAC,CAAC;CACnB,GAAG,CAAC,CAAC,GAEC,IAAQ,SACN;EAAE;EAAa;EAAW;EAAW;EAAY;CAAS,IACjE;EAAC;EAAa;EAAW;EAAW;EAAY;CAAQ,CACzD;CAEA,OACC,kBAAC,EAAa,UAAd;EAA8B;EAAQ;CAAgC,CAAA;AAExE"}
@@ -1 +1 @@
1
- {"version":3,"file":"placesProvider.js","names":[],"sources":["../../../src/providers/placesProvider.tsx"],"sourcesContent":["import { useLoadScript } from \"@react-google-maps/api\";\nimport type { ReactNode } from \"react\";\n\nconst libraries: (\"places\" | \"marker\" | \"maps\")[] = [\n\t\"places\",\n\t\"marker\",\n\t\"maps\",\n];\n\ntype PlacesProviderProps = {\n\tapiKey: string;\n\tchildren: (isLoaded: boolean) => ReactNode;\n\tpreventFontsLoading?: boolean;\n};\n\n/**\n * PlacesProvider loads the Google Maps JS API with `places`, `marker`, and `maps` libraries.\n *\n * Uses a render-prop pattern: `children` receives `isLoaded` so you can defer rendering\n * `SearchPlaces` or `MapView` until the script is ready.\n *\n * @param props.apiKey - Google Maps API key. Required.\n * @param props.children - Render function: `(isLoaded: boolean) => ReactNode`.\n * @param props.preventFontsLoading - Prevents Google Fonts from being injected by the Maps SDK. @default true\n *\n * @returns The result of calling `children(isLoaded)`.\n *\n * @example\n * ```tsx\n * <PlacesProvider apiKey={env.GOOGLE_MAPS_KEY}>\n * {(isLoaded) => (\n * isLoaded\n * ? <SearchPlaces apiKey={env.GOOGLE_MAPS_KEY} onSelect={setAddress} />\n * : <Skeleton />\n * )}\n * </PlacesProvider>\n * ```\n */\n\nfunction PlacesProvider(props: PlacesProviderProps) {\n\tconst { apiKey, children, preventFontsLoading = true } = props;\n\n\tconst { isLoaded } = useLoadScript({\n\t\tgoogleMapsApiKey: apiKey,\n\t\tlibraries,\n\t\tpreventGoogleFontsLoading: preventFontsLoading,\n\t});\n\n\treturn <>{children(isLoaded)}</>;\n}\n\nexport { PlacesProvider };\n"],"mappings":";;;AAGA,IAAM,IAA8C;CACnD;CACA;CACA;AACD;AAgCA,SAAS,EAAe,GAA4B;CACnD,IAAM,EAAE,WAAQ,aAAU,yBAAsB,OAAS,GAEnD,EAAE,gBAAa,EAAc;EAClC,kBAAkB;EAClB;EACA,2BAA2B;CAC5B,CAAC;CAED,OAAO,kBAAA,GAAA,EAAA,UAAG,EAAS,CAAQ,EAAI,CAAA;AAChC"}
1
+ {"version":3,"file":"placesProvider.js","names":[],"sources":["../../../src/providers/placesProvider.tsx"],"sourcesContent":["import { useLoadScript } from \"@react-google-maps/api\";\nimport type { ReactNode } from \"react\";\n\nconst libraries: (\"places\" | \"marker\" | \"maps\")[] = [\n\t\"places\",\n\t\"marker\",\n\t\"maps\",\n];\n\ntype PlacesProviderProps = {\n\tapiKey: string;\n\tchildren: (isLoaded: boolean) => ReactNode;\n\tpreventFontsLoading?: boolean;\n};\n\n/**\n * PlacesProvider, loads the Google Maps JS API with `places`, `marker`, and `maps` libraries.\n *\n * Uses a render-prop pattern: `children` receives `isLoaded` so you can defer rendering\n * `SearchPlaces` or `MapView` until the script is ready.\n *\n * @param props.apiKey - Google Maps API key. Required.\n * @param props.children - Render function: `(isLoaded: boolean) => ReactNode`.\n * @param props.preventFontsLoading - Prevents Google Fonts from being injected by the Maps SDK. @default true\n *\n * @returns The result of calling `children(isLoaded)`.\n *\n * @example\n * ```tsx\n * <PlacesProvider apiKey={env.GOOGLE_MAPS_KEY}>\n * {(isLoaded) => (\n * isLoaded\n * ? <SearchPlaces apiKey={env.GOOGLE_MAPS_KEY} onSelect={setAddress} />\n * : <Skeleton />\n * )}\n * </PlacesProvider>\n * ```\n */\n\nfunction PlacesProvider(props: PlacesProviderProps) {\n\tconst { apiKey, children, preventFontsLoading = true } = props;\n\n\tconst { isLoaded } = useLoadScript({\n\t\tgoogleMapsApiKey: apiKey,\n\t\tlibraries,\n\t\tpreventGoogleFontsLoading: preventFontsLoading,\n\t});\n\n\treturn <>{children(isLoaded)}</>;\n}\n\nexport { PlacesProvider };\n"],"mappings":";;;AAGA,IAAM,IAA8C;CACnD;CACA;CACA;AACD;AAgCA,SAAS,EAAe,GAA4B;CACnD,IAAM,EAAE,WAAQ,aAAU,yBAAsB,OAAS,GAEnD,EAAE,gBAAa,EAAc;EAClC,kBAAkB;EAClB;EACA,2BAA2B;CAC5B,CAAC;CAED,OAAO,kBAAA,GAAA,EAAA,UAAG,EAAS,CAAQ,EAAI,CAAA;AAChC"}
@@ -1 +1 @@
1
- {"version":3,"file":"toastProvider.js","names":[],"sources":["../../../src/providers/toastProvider.tsx"],"sourcesContent":["import { createContext, type ReactNode, useMemo } from \"react\";\nimport toast, { Toaster } from \"react-hot-toast\";\n\ntype ToastProps = {\n\tmessage: string;\n\ttype: \"success\" | \"danger\";\n};\n\ntype ToastContextProps = {\n\tshowToast(toast: ToastProps): void;\n};\n\ntype ToastProviderProps = {\n\tchildren: ReactNode;\n};\n\nconst toastContext = createContext({} as ToastContextProps);\n\nfunction showToast(props: ToastProps) {\n\tswitch (props.type) {\n\t\tcase \"success\":\n\t\t\treturn toast.success(props.message, {\n\t\t\t\tstyle: {\n\t\t\t\t\tbackground: \"#10B981\",\n\t\t\t\t\tcolor: \"#ffffff\",\n\t\t\t\t\tpadding: \"12px 16px\",\n\t\t\t\t\tfontSize: \"14px\",\n\t\t\t\t\tfontWeight: 600,\n\t\t\t\t},\n\t\t\t\ticonTheme: {\n\t\t\t\t\tprimary: \"#059669\",\n\t\t\t\t\tsecondary: \"#ffffff\",\n\t\t\t\t},\n\t\t\t});\n\t\tcase \"danger\":\n\t\t\treturn toast.error(props.message, {\n\t\t\t\tstyle: {\n\t\t\t\t\tbackground: \"#E11D48\",\n\t\t\t\t\tcolor: \"#ffffff\",\n\t\t\t\t\tpadding: \"12px 16px\",\n\t\t\t\t\tfontSize: \"14px\",\n\t\t\t\t\tfontWeight: 600,\n\t\t\t\t},\n\t\t\t\ticonTheme: {\n\t\t\t\t\tprimary: \"#BE123C\",\n\t\t\t\t\tsecondary: \"#ffffff\",\n\t\t\t\t},\n\t\t\t});\n\t}\n}\n\n/**\n * ToastProvider mounts a `react-hot-toast` `<Toaster>` and exposes `showToast` via context.\n *\n * Wrap your app once. Then call `useToast()` anywhere in the tree to show notifications.\n * Supports two types: `\"success\"` (green) and `\"danger\"` (red).\n *\n * @param props.children - App subtree that will have access to `useToast`.\n *\n * @returns ToastProvider JSX element.\n *\n * @example\n * ```tsx\n * // In your root layout\n * <ToastProvider>\n * <App />\n * </ToastProvider>\n *\n * // Anywhere in the tree\n * const { showToast } = useToast();\n * showToast({ message: \"Order placed!\", type: \"success\" });\n * ```\n */\n\nfunction ToastProvider({ children }: ToastProviderProps) {\n\tconst value = useMemo(() => ({ showToast }), []);\n\n\treturn (\n\t\t<toastContext.Provider value={value}>\n\t\t\t<Toaster\n\t\t\t\tposition=\"top-right\"\n\t\t\t\tcontainerStyle={{ zIndex: 999999999999999 }}\n\t\t\t/>\n\t\t\t{children}\n\t\t</toastContext.Provider>\n\t);\n}\n\nexport { ToastProvider, toastContext };\n"],"mappings":";;;;AAgBA,IAAM,IAAe,EAAc,CAAC,CAAsB;AAE1D,SAAS,EAAU,GAAmB;CACrC,QAAQ,EAAM,MAAd;EACC,KAAK,WACJ,OAAO,EAAM,QAAQ,EAAM,SAAS;GACnC,OAAO;IACN,YAAY;IACZ,OAAO;IACP,SAAS;IACT,UAAU;IACV,YAAY;GACb;GACA,WAAW;IACV,SAAS;IACT,WAAW;GACZ;EACD,CAAC;EACF,KAAK,UACJ,OAAO,EAAM,MAAM,EAAM,SAAS;GACjC,OAAO;IACN,YAAY;IACZ,OAAO;IACP,SAAS;IACT,UAAU;IACV,YAAY;GACb;GACA,WAAW;IACV,SAAS;IACT,WAAW;GACZ;EACD,CAAC;CACH;AACD;AAyBA,SAAS,EAAc,EAAE,eAAgC;CACxD,IAAM,IAAQ,SAAe,EAAE,aAAU,IAAI,CAAC,CAAC;CAE/C,OACC,kBAAC,EAAa,UAAd;EAA8B;YAA9B,CACC,kBAAC,GAAD;GACC,UAAS;GACT,gBAAgB,EAAE,QAAQ,gBAAgB;EAC1C,CAAA,GACA,CACqB;;AAEzB"}
1
+ {"version":3,"file":"toastProvider.js","names":[],"sources":["../../../src/providers/toastProvider.tsx"],"sourcesContent":["import { createContext, type ReactNode, useMemo } from \"react\";\nimport toast, { Toaster } from \"react-hot-toast\";\n\ntype ToastProps = {\n\tmessage: string;\n\ttype: \"success\" | \"danger\";\n};\n\ntype ToastContextProps = {\n\tshowToast(toast: ToastProps): void;\n};\n\ntype ToastProviderProps = {\n\tchildren: ReactNode;\n};\n\nconst toastContext = createContext({} as ToastContextProps);\n\nfunction showToast(props: ToastProps) {\n\tswitch (props.type) {\n\t\tcase \"success\":\n\t\t\treturn toast.success(props.message, {\n\t\t\t\tstyle: {\n\t\t\t\t\tbackground: \"#10B981\",\n\t\t\t\t\tcolor: \"#ffffff\",\n\t\t\t\t\tpadding: \"12px 16px\",\n\t\t\t\t\tfontSize: \"14px\",\n\t\t\t\t\tfontWeight: 600,\n\t\t\t\t},\n\t\t\t\ticonTheme: {\n\t\t\t\t\tprimary: \"#059669\",\n\t\t\t\t\tsecondary: \"#ffffff\",\n\t\t\t\t},\n\t\t\t});\n\t\tcase \"danger\":\n\t\t\treturn toast.error(props.message, {\n\t\t\t\tstyle: {\n\t\t\t\t\tbackground: \"#E11D48\",\n\t\t\t\t\tcolor: \"#ffffff\",\n\t\t\t\t\tpadding: \"12px 16px\",\n\t\t\t\t\tfontSize: \"14px\",\n\t\t\t\t\tfontWeight: 600,\n\t\t\t\t},\n\t\t\t\ticonTheme: {\n\t\t\t\t\tprimary: \"#BE123C\",\n\t\t\t\t\tsecondary: \"#ffffff\",\n\t\t\t\t},\n\t\t\t});\n\t}\n}\n\n/**\n * ToastProvider, mounts a `react-hot-toast` `<Toaster>` and exposes `showToast` via context.\n *\n * Wrap your app once. Then call `useToast()` anywhere in the tree to show notifications.\n * Supports two types: `\"success\"` (green) and `\"danger\"` (red).\n *\n * @param props.children - App subtree that will have access to `useToast`.\n *\n * @returns ToastProvider JSX element.\n *\n * @example\n * ```tsx\n * // In your root layout\n * <ToastProvider>\n * <App />\n * </ToastProvider>\n *\n * // Anywhere in the tree\n * const { showToast } = useToast();\n * showToast({ message: \"Order placed!\", type: \"success\" });\n * ```\n */\n\nfunction ToastProvider({ children }: ToastProviderProps) {\n\tconst value = useMemo(() => ({ showToast }), []);\n\n\treturn (\n\t\t<toastContext.Provider value={value}>\n\t\t\t<Toaster\n\t\t\t\tposition=\"top-right\"\n\t\t\t\tcontainerStyle={{ zIndex: 999999999999999 }}\n\t\t\t/>\n\t\t\t{children}\n\t\t</toastContext.Provider>\n\t);\n}\n\nexport { ToastProvider, toastContext };\n"],"mappings":";;;;AAgBA,IAAM,IAAe,EAAc,CAAC,CAAsB;AAE1D,SAAS,EAAU,GAAmB;CACrC,QAAQ,EAAM,MAAd;EACC,KAAK,WACJ,OAAO,EAAM,QAAQ,EAAM,SAAS;GACnC,OAAO;IACN,YAAY;IACZ,OAAO;IACP,SAAS;IACT,UAAU;IACV,YAAY;GACb;GACA,WAAW;IACV,SAAS;IACT,WAAW;GACZ;EACD,CAAC;EACF,KAAK,UACJ,OAAO,EAAM,MAAM,EAAM,SAAS;GACjC,OAAO;IACN,YAAY;IACZ,OAAO;IACP,SAAS;IACT,UAAU;IACV,YAAY;GACb;GACA,WAAW;IACV,SAAS;IACT,WAAW;GACZ;EACD,CAAC;CACH;AACD;AAyBA,SAAS,EAAc,EAAE,eAAgC;CACxD,IAAM,IAAQ,SAAe,EAAE,aAAU,IAAI,CAAC,CAAC;CAE/C,OACC,kBAAC,EAAa,UAAd;EAA8B;YAA9B,CACC,kBAAC,GAAD;GACC,UAAS;GACT,gBAAgB,EAAE,QAAQ,gBAAgB;EAC1C,CAAA,GACA,CACqB;;AAEzB"}
@@ -11,6 +11,7 @@ function a(a) {
11
11
  orientation: p,
12
12
  children: [
13
13
  s && /* @__PURE__ */ r(t, {
14
+ htmlFor: o,
14
15
  showAsterisk: c,
15
16
  children: s
16
17
  }),
@@ -1 +1 @@
1
- {"version":3,"file":"fieldTemplate.js","names":[],"sources":["../../../src/services/fieldTemplate.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\n\nimport { FieldError } from \"../components/fieldError\";\nimport { FieldLabel } from \"../components/fieldLabel\";\nimport { FieldWrapper } from \"../components/fieldWrapper\";\n\ntype FormRendererProps = {\n\tname?: string;\n\tlabel?: string;\n\tclassName?: string;\n\tshowAsterisk?: boolean;\n\tunShowFieldTemplate?: boolean;\n\terrorMessage?: string;\n\torientation?: \"horizontal\" | \"vertical\" | \"horizontalReverse\";\n\tchildren: ReactNode;\n};\n\nfunction FieldTemplate(props: FormRendererProps) {\n\tconst {\n\t\tname,\n\t\tlabel,\n\t\tshowAsterisk,\n\t\tclassName,\n\t\tunShowFieldTemplate,\n\t\terrorMessage,\n\t\tchildren,\n\t\torientation,\n\t} = props;\n\n\tif (unShowFieldTemplate) return children;\n\n\treturn (\n\t\t<FieldWrapper id={name} className={className} orientation={orientation}>\n\t\t\t{label && <FieldLabel showAsterisk={showAsterisk}>{label}</FieldLabel>}\n\t\t\t{children}\n\t\t\t{errorMessage && <FieldError>{errorMessage}</FieldError>}\n\t\t</FieldWrapper>\n\t);\n}\n\nexport { FieldTemplate };\n"],"mappings":";;;;;AAiBA,SAAS,EAAc,GAA0B;CAChD,IAAM,EACL,SACA,UACA,iBACA,cACA,wBACA,iBACA,aACA,mBACG;CAIJ,OAFI,IAA4B,IAG/B,kBAAC,GAAD;EAAc,IAAI;EAAiB;EAAwB;YAA3D;GACE,KAAS,kBAAC,GAAD;IAA0B;cAAe;GAAkB,CAAA;GACpE;GACA,KAAgB,kBAAC,GAAD,EAAA,UAAa,EAAyB,CAAA;EAC1C;;AAEhB"}
1
+ {"version":3,"file":"fieldTemplate.js","names":[],"sources":["../../../src/services/fieldTemplate.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\n\nimport { FieldError } from \"../components/fieldError\";\nimport { FieldLabel } from \"../components/fieldLabel\";\nimport { FieldWrapper } from \"../components/fieldWrapper\";\n\ntype FormRendererProps = {\n\tname?: string;\n\tlabel?: string;\n\tclassName?: string;\n\tshowAsterisk?: boolean;\n\tunShowFieldTemplate?: boolean;\n\terrorMessage?: string;\n\torientation?: \"horizontal\" | \"vertical\" | \"horizontalReverse\";\n\tchildren: ReactNode;\n};\n\nfunction FieldTemplate(props: FormRendererProps) {\n\tconst {\n\t\tname,\n\t\tlabel,\n\t\tshowAsterisk,\n\t\tclassName,\n\t\tunShowFieldTemplate,\n\t\terrorMessage,\n\t\tchildren,\n\t\torientation,\n\t} = props;\n\n\tif (unShowFieldTemplate) return children;\n\n\treturn (\n\t\t<FieldWrapper id={name} className={className} orientation={orientation}>\n\t\t\t{label && (\n\t\t\t\t<FieldLabel htmlFor={name} showAsterisk={showAsterisk}>\n\t\t\t\t\t{label}\n\t\t\t\t</FieldLabel>\n\t\t\t)}\n\n\t\t\t{children}\n\t\t\t{errorMessage && <FieldError>{errorMessage}</FieldError>}\n\t\t</FieldWrapper>\n\t);\n}\n\nexport { FieldTemplate };\n"],"mappings":";;;;;AAiBA,SAAS,EAAc,GAA0B;CAChD,IAAM,EACL,SACA,UACA,iBACA,cACA,wBACA,iBACA,aACA,mBACG;CAIJ,OAFI,IAA4B,IAG/B,kBAAC,GAAD;EAAc,IAAI;EAAiB;EAAwB;YAA3D;GACE,KACA,kBAAC,GAAD;IAAY,SAAS;IAAoB;cACvC;GACU,CAAA;GAGZ;GACA,KAAgB,kBAAC,GAAD,EAAA,UAAa,EAAyB,CAAA;EAC1C;;AAEhB"}
@@ -1 +1 @@
1
- {"version":3,"file":"toHtml.js","names":[],"sources":["../../../src/services/toHtml.ts"],"sourcesContent":["import type { RichTextValue } from \"../types/richTextTypes\";\nimport { serialize } from \"../utils/richTextUtilities\";\n\n/**\n * toHtml converts a `RichTextValue` (Slate.js Descendant array) to an HTML string.\n *\n * Use this to persist or display the editor's content as plain HTML.\n *\n * @param richTextValue - The value from a `RichText` component's `onChange` callback.\n * @returns HTML string representation of the rich text content.\n *\n * @example\n * ```tsx\n * const [content, setContent] = useState<RichTextValue>([]);\n *\n * // On form submit, convert to HTML for storage\n * const html = toHtml(content);\n * // e.g. \"<p><strong>Hello world</strong></p>\"\n * ```\n */\n\nfunction toHtml(richTextValue: RichTextValue): string {\n\treturn richTextValue.map((node) => serialize(node)).join(\"\");\n}\n\nexport { toHtml };\n"],"mappings":";;AAqBA,SAAS,EAAO,GAAsC;CACrD,OAAO,EAAc,KAAK,MAAS,EAAU,CAAI,CAAC,CAAC,CAAC,KAAK,EAAE;AAC5D"}
1
+ {"version":3,"file":"toHtml.js","names":[],"sources":["../../../src/services/toHtml.ts"],"sourcesContent":["import type { RichTextValue } from \"../types/richTextTypes\";\nimport { serialize } from \"../utils/richTextUtilities\";\n\n/**\n * toHtml, converts a `RichTextValue` (Slate.js Descendant array) to an HTML string.\n *\n * Use this to persist or display the editor's content as plain HTML.\n *\n * @param richTextValue - The value from a `RichText` component's `onChange` callback.\n * @returns HTML string representation of the rich text content.\n *\n * @example\n * ```tsx\n * const [content, setContent] = useState<RichTextValue>([]);\n *\n * // On form submit, convert to HTML for storage\n * const html = toHtml(content);\n * // e.g. \"<p><strong>Hello world</strong></p>\"\n * ```\n */\n\nfunction toHtml(richTextValue: RichTextValue): string {\n\treturn richTextValue.map((node) => serialize(node)).join(\"\");\n}\n\nexport { toHtml };\n"],"mappings":";;AAqBA,SAAS,EAAO,GAAsC;CACrD,OAAO,EAAc,KAAK,MAAS,EAAU,CAAI,CAAC,CAAC,CAAC,KAAK,EAAE;AAC5D"}
@@ -1 +1 @@
1
- {"version":3,"file":"toRichTextValue.js","names":[],"sources":["../../../src/services/toRichTextValue.ts"],"sourcesContent":["import parse from \"html-react-parser\";\n\nimport type { ParseElement, RichTextValue } from \"../types/richTextTypes\";\nimport { deserialize } from \"../utils/richTextUtilities\";\n\n/**\n * toRichTextValue converts an HTML string to a `RichTextValue` (Slate.js Descendant array).\n *\n * Use this to populate a `RichText` editor with content previously stored as HTML\n * (e.g. loaded from a database).\n *\n * @param html - HTML string to convert.\n * @returns Slate.js Descendant array ready to pass to `RichText`'s `defaultValue` prop.\n *\n * @example\n * ```tsx\n * // Load stored HTML into the editor\n * const defaultValue = toRichTextValue(product.description);\n * // e.g. [{ type: 'paragraph', children: [{ text: 'Hello', bold: true }] }]\n *\n * <RichText name=\"description\" defaultValue={defaultValue} />\n * ```\n */\n\nfunction toRichTextValue(html: string): RichTextValue {\n\tconst parsed = parse(html);\n\n\tif (Array.isArray(parsed)) {\n\t\treturn parsed.map((node) => {\n\t\t\tif (typeof node === \"string\") return { text: node };\n\t\t\treturn deserialize(node as ParseElement);\n\t\t});\n\t}\n\n\tif (typeof parsed === \"string\") return [{ text: parsed }];\n\treturn [deserialize(parsed as ParseElement)];\n}\n\nexport { toRichTextValue };\n"],"mappings":";;;AAwBA,SAAS,EAAgB,GAA6B;CACrD,IAAM,IAAS,EAAM,CAAI;CAUzB,OARI,MAAM,QAAQ,CAAM,IAChB,EAAO,KAAK,MACd,OAAO,KAAS,WAAiB,EAAE,MAAM,EAAK,IAC3C,EAAY,CAAoB,CACvC,IAGE,OAAO,KAAW,WAAiB,CAAC,EAAE,MAAM,EAAO,CAAC,IACjD,CAAC,EAAY,CAAsB,CAAC;AAC5C"}
1
+ {"version":3,"file":"toRichTextValue.js","names":[],"sources":["../../../src/services/toRichTextValue.ts"],"sourcesContent":["import parse from \"html-react-parser\";\n\nimport type { ParseElement, RichTextValue } from \"../types/richTextTypes\";\nimport { deserialize } from \"../utils/richTextUtilities\";\n\n/**\n * toRichTextValue, converts an HTML string to a `RichTextValue` (Slate.js Descendant array).\n *\n * Use this to populate a `RichText` editor with content previously stored as HTML\n * (e.g. loaded from a database).\n *\n * @param html - HTML string to convert.\n * @returns Slate.js Descendant array ready to pass to `RichText`'s `defaultValue` prop.\n *\n * @example\n * ```tsx\n * // Load stored HTML into the editor\n * const defaultValue = toRichTextValue(product.description);\n * // e.g. [{ type: 'paragraph', children: [{ text: 'Hello', bold: true }] }]\n *\n * <RichText name=\"description\" defaultValue={defaultValue} />\n * ```\n */\n\nfunction toRichTextValue(html: string): RichTextValue {\n\tconst parsed = parse(html);\n\n\tif (Array.isArray(parsed)) {\n\t\treturn parsed.map((node) => {\n\t\t\tif (typeof node === \"string\") return { text: node };\n\t\t\treturn deserialize(node as ParseElement);\n\t\t});\n\t}\n\n\tif (typeof parsed === \"string\") return [{ text: parsed }];\n\treturn [deserialize(parsed as ParseElement)];\n}\n\nexport { toRichTextValue };\n"],"mappings":";;;AAwBA,SAAS,EAAgB,GAA6B;CACrD,IAAM,IAAS,EAAM,CAAI;CAUzB,OARI,MAAM,QAAQ,CAAM,IAChB,EAAO,KAAK,MACd,OAAO,KAAS,WAAiB,EAAE,MAAM,EAAK,IAC3C,EAAY,CAAoB,CACvC,IAGE,OAAO,KAAW,WAAiB,CAAC,EAAE,MAAM,EAAO,CAAC,IACjD,CAAC,EAAY,CAAsB,CAAC;AAC5C"}
@@ -6,13 +6,13 @@ var t = {
6
6
  EIGHT: "(99) 9999-9999",
7
7
  NINE: "(99) 99999-9999"
8
8
  };
9
- function n(e, t) {
10
- let n = "", r = 0;
11
- for (let i = 0; i < t.length; i++) if (t[i] === "9") if (r < e.length) n += e[r], r++;
9
+ function n(e, t, n = "9") {
10
+ let r = "", i = 0;
11
+ for (let a = 0; a < t.length; a++) if (t[a] === n) if (i < e.length) r += e[i], i++;
12
12
  else break;
13
- else if (r < e.length) n += t[i];
13
+ else if (i < e.length) r += t[a];
14
14
  else break;
15
- return n;
15
+ return r;
16
16
  }
17
17
  function r(e) {
18
18
  return e.length > 10 ? "NINE" : "EIGHT";
@@ -1 +1 @@
1
- {"version":3,"file":"phoneInputUtilities.js","names":[],"sources":["../../../src/utils/phoneInputUtilities.ts"],"sourcesContent":["function clear(value: string) {\n\treturn value?.replace(/[^0-9]/g, \"\");\n}\n\nconst TYPES = {\n\tEIGHT: \"(99) 9999-9999\",\n\tNINE: \"(99) 99999-9999\",\n};\n\nfunction applyMask(value: string, maskPattern: string) {\n\tlet result = \"\";\n\tlet digitIndex = 0;\n\n\tfor (let i = 0; i < maskPattern.length; i++) {\n\t\tif (maskPattern[i] === \"9\") {\n\t\t\tif (digitIndex < value.length) {\n\t\t\t\tresult += value[digitIndex];\n\t\t\t\tdigitIndex++;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} else {\n\t\t\tif (digitIndex < value.length) {\n\t\t\t\tresult += maskPattern[i];\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn result;\n}\n\nfunction getMask(value: string): \"NINE\" | \"EIGHT\" {\n\tconst mask = value.length > 10 ? \"NINE\" : \"EIGHT\";\n\treturn mask;\n}\n\nconst MAX_LENGTH = clear(TYPES.NINE).length;\n\nexport { applyMask, clear, getMask, MAX_LENGTH, TYPES };\n"],"mappings":";AAAA,SAAS,EAAM,GAAe;CAC7B,OAAO,GAAO,QAAQ,WAAW,EAAE;AACpC;AAEA,IAAM,IAAQ;CACb,OAAO;CACP,MAAM;AACP;AAEA,SAAS,EAAU,GAAe,GAAqB;CACtD,IAAI,IAAS,IACT,IAAa;CAEjB,KAAK,IAAI,IAAI,GAAG,IAAI,EAAY,QAAQ,KACvC,IAAI,EAAY,OAAO,KACtB,IAAI,IAAa,EAAM,QAEtB,AADA,KAAU,EAAM,IAChB;MAEA;MAGD,IAAI,IAAa,EAAM,QACtB,KAAU,EAAY;MAEtB;CAKH,OAAO;AACR;AAEA,SAAS,EAAQ,GAAiC;CAEjD,OADa,EAAM,SAAS,KAAK,SAAS;AAE3C;AAEA,IAAM,IAAa,EAAM,EAAM,IAAI,CAAC,CAAC"}
1
+ {"version":3,"file":"phoneInputUtilities.js","names":[],"sources":["../../../src/utils/phoneInputUtilities.ts"],"sourcesContent":["function clear(value: string) {\n\treturn value?.replace(/[^0-9]/g, \"\");\n}\n\nconst TYPES = {\n\tEIGHT: \"(99) 9999-9999\",\n\tNINE: \"(99) 99999-9999\",\n};\n\nfunction applyMask(value: string, maskPattern: string, placeholder = \"9\") {\n\tlet result = \"\";\n\tlet digitIndex = 0;\n\n\tfor (let i = 0; i < maskPattern.length; i++) {\n\t\tif (maskPattern[i] === placeholder) {\n\t\t\tif (digitIndex < value.length) {\n\t\t\t\tresult += value[digitIndex];\n\t\t\t\tdigitIndex++;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} else {\n\t\t\tif (digitIndex < value.length) {\n\t\t\t\tresult += maskPattern[i];\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn result;\n}\n\nfunction getMask(value: string): \"NINE\" | \"EIGHT\" {\n\tconst mask = value.length > 10 ? \"NINE\" : \"EIGHT\";\n\treturn mask;\n}\n\nconst MAX_LENGTH = clear(TYPES.NINE).length;\n\nexport { applyMask, clear, getMask, MAX_LENGTH, TYPES };\n"],"mappings":";AAAA,SAAS,EAAM,GAAe;CAC7B,OAAO,GAAO,QAAQ,WAAW,EAAE;AACpC;AAEA,IAAM,IAAQ;CACb,OAAO;CACP,MAAM;AACP;AAEA,SAAS,EAAU,GAAe,GAAqB,IAAc,KAAK;CACzE,IAAI,IAAS,IACT,IAAa;CAEjB,KAAK,IAAI,IAAI,GAAG,IAAI,EAAY,QAAQ,KACvC,IAAI,EAAY,OAAO,GACtB,IAAI,IAAa,EAAM,QAEtB,AADA,KAAU,EAAM,IAChB;MAEA;MAGD,IAAI,IAAa,EAAM,QACtB,KAAU,EAAY;MAEtB;CAKH,OAAO;AACR;AAEA,SAAS,EAAQ,GAAiC;CAEjD,OADa,EAAM,SAAS,KAAK,SAAS;AAE3C;AAEA,IAAM,IAAa,EAAM,EAAM,IAAI,CAAC,CAAC"}
@@ -11,7 +11,7 @@ type DrawerProviderProps = {
11
11
  };
12
12
  declare const drawerContext: import("react").Context<DrawerContextProps<any>>;
13
13
  /**
14
- * DrawerProvider context provider that manages open/close state and data for named drawers.
14
+ * DrawerProvider, context provider that manages open/close state and data for named drawers.
15
15
  *
16
16
  * Wrap your app (or a subtree) with this once. Any component in the tree can then call
17
17
  * `useDrawer(key)` to open, close, or read data for a specific drawer.
@@ -11,7 +11,7 @@ type FormProviderProps = {
11
11
  };
12
12
  declare const formContext: import("react").Context<FormContextProps>;
13
13
  /**
14
- * FormProvider distributes field-level validation errors to all form input components in its subtree.
14
+ * FormProvider, distributes field-level validation errors to all form input components in its subtree.
15
15
  *
16
16
  * All inputs (`Input`, `Select`, `Checkbox`, etc.) read `fieldErrors[name]` automatically,
17
17
  * so you don't need to pass errors manually to each field. Use the `form` prop to also wrap
@@ -12,7 +12,7 @@ type ModalProviderProps = {
12
12
  };
13
13
  declare const modalContext: import("react").Context<ModalContextProps<any>>;
14
14
  /**
15
- * ModalProvider context provider that manages open/close state and data for named modals.
15
+ * ModalProvider, context provider that manages open/close state and data for named modals.
16
16
  *
17
17
  * Wrap your app (or a subtree) with this once. Any component in the tree can then call
18
18
  * `useModal(key)` to open, close, or read data for a specific modal. `closeAll()` is also
@@ -1 +1 @@
1
- {"version":3,"file":"modalProvider.d.ts","sourceRoot":"","sources":["../../src/providers/modalProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,SAAS,EAAY,MAAM,OAAO,CAAC;AAGhE,KAAK,iBAAiB,CAAC,CAAC,GAAG,GAAG,IAAI;IACjC,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IAClC,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC;IAC1B,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;IACvC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,QAAQ,IAAI,IAAI,CAAC;CACjB,CAAC;AAQF,KAAK,kBAAkB,GAAG;IACzB,QAAQ,EAAE,SAAS,CAAC;IACpB,qBAAqB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AAEF,QAAA,MAAM,YAAY,iDAAyC,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,iBAAS,aAAa,CAAC,IAAI,EAAE,kBAAkB,+BAsC9C;AAED,OAAO,EAAE,KAAK,iBAAiB,EAAE,aAAa,EAAE,YAAY,EAAE,CAAC"}
1
+ {"version":3,"file":"modalProvider.d.ts","sourceRoot":"","sources":["../../src/providers/modalProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEN,KAAK,SAAS,EAId,MAAM,OAAO,CAAC;AAGf,KAAK,iBAAiB,CAAC,CAAC,GAAG,GAAG,IAAI;IACjC,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IAClC,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC;IAC1B,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;IACvC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,QAAQ,IAAI,IAAI,CAAC;CACjB,CAAC;AAQF,KAAK,kBAAkB,GAAG;IACzB,QAAQ,EAAE,SAAS,CAAC;IACpB,qBAAqB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AAEF,QAAA,MAAM,YAAY,iDAAyC,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,iBAAS,aAAa,CAAC,IAAI,EAAE,kBAAkB,+BAyC9C;AAED,OAAO,EAAE,KAAK,iBAAiB,EAAE,aAAa,EAAE,YAAY,EAAE,CAAC"}
@@ -5,7 +5,7 @@ type PlacesProviderProps = {
5
5
  preventFontsLoading?: boolean;
6
6
  };
7
7
  /**
8
- * PlacesProvider loads the Google Maps JS API with `places`, `marker`, and `maps` libraries.
8
+ * PlacesProvider, loads the Google Maps JS API with `places`, `marker`, and `maps` libraries.
9
9
  *
10
10
  * Uses a render-prop pattern: `children` receives `isLoaded` so you can defer rendering
11
11
  * `SearchPlaces` or `MapView` until the script is ready.
@@ -11,7 +11,7 @@ type ToastProviderProps = {
11
11
  };
12
12
  declare const toastContext: import("react").Context<ToastContextProps>;
13
13
  /**
14
- * ToastProvider mounts a `react-hot-toast` `<Toaster>` and exposes `showToast` via context.
14
+ * ToastProvider, mounts a `react-hot-toast` `<Toaster>` and exposes `showToast` via context.
15
15
  *
16
16
  * Wrap your app once. Then call `useToast()` anywhere in the tree to show notifications.
17
17
  * Supports two types: `"success"` (green) and `"danger"` (red).
@@ -1 +1 @@
1
- {"version":3,"file":"fieldTemplate.d.ts","sourceRoot":"","sources":["../../src/services/fieldTemplate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvC,KAAK,iBAAiB,GAAG;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,GAAG,mBAAmB,CAAC;IAC9D,QAAQ,EAAE,SAAS,CAAC;CACpB,CAAC;AAEF,iBAAS,aAAa,CAAC,KAAK,EAAE,iBAAiB,+TAqB9C;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"fieldTemplate.d.ts","sourceRoot":"","sources":["../../src/services/fieldTemplate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvC,KAAK,iBAAiB,GAAG;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,GAAG,mBAAmB,CAAC;IAC9D,QAAQ,EAAE,SAAS,CAAC;CACpB,CAAC;AAEF,iBAAS,aAAa,CAAC,KAAK,EAAE,iBAAiB,+TA0B9C;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import type { RichTextValue } from "../types/richTextTypes";
2
2
  /**
3
- * toHtml converts a `RichTextValue` (Slate.js Descendant array) to an HTML string.
3
+ * toHtml, converts a `RichTextValue` (Slate.js Descendant array) to an HTML string.
4
4
  *
5
5
  * Use this to persist or display the editor's content as plain HTML.
6
6
  *
@@ -1,6 +1,6 @@
1
1
  import type { RichTextValue } from "../types/richTextTypes";
2
2
  /**
3
- * toRichTextValue converts an HTML string to a `RichTextValue` (Slate.js Descendant array).
3
+ * toRichTextValue, converts an HTML string to a `RichTextValue` (Slate.js Descendant array).
4
4
  *
5
5
  * Use this to populate a `RichText` editor with content previously stored as HTML
6
6
  * (e.g. loaded from a database).