@arkyn/components 3.0.3 → 3.0.5
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.
- package/README.md +24 -24
- package/dist/components/alert/alertContainer/index.d.ts +7 -7
- package/dist/components/alert/alertContent/index.d.ts +1 -1
- package/dist/components/alert/alertDescription/index.d.ts +1 -1
- package/dist/components/alert/alertIcon/index.d.ts +1 -1
- package/dist/components/alert/alertTitle/index.d.ts +1 -1
- package/dist/components/audioPlayer/index.d.ts +1 -1
- package/dist/components/audioUpload/index.d.ts +2 -2
- package/dist/components/badge/index.d.ts +1 -1
- package/dist/components/button/index.d.ts +1 -1
- package/dist/components/cardTab/cardTabButton/index.d.ts +1 -1
- package/dist/components/cardTab/cardTabContainer/index.d.ts +1 -1
- package/dist/components/checkbox/index.d.ts +3 -3
- package/dist/components/checkbox/index.d.ts.map +1 -1
- package/dist/components/clientOnly.d.ts +2 -2
- package/dist/components/clientOnly.d.ts.map +1 -1
- package/dist/components/currencyInput/index.d.ts +2 -2
- package/dist/components/datePicker/index.d.ts +1 -1
- package/dist/components/divider/index.d.ts +1 -1
- package/dist/components/drawer/drawerContainer/index.d.ts +1 -1
- package/dist/components/drawer/drawerHeader/index.d.ts +1 -1
- package/dist/components/facebookPixel/index.d.ts +1 -1
- package/dist/components/fieldError/index.d.ts +1 -1
- package/dist/components/fieldLabel/index.d.ts +1 -1
- package/dist/components/fieldWrapper/index.d.ts +1 -1
- package/dist/components/fileUpload/index.d.ts +2 -2
- package/dist/components/googleAnalytics/index.d.ts +1 -1
- package/dist/components/googleTagManager/index.d.ts +1 -1
- package/dist/components/iconButton/index.d.ts +1 -1
- package/dist/components/imageUpload/index.d.ts +2 -2
- package/dist/components/input/index.d.ts +1 -1
- package/dist/components/mapView/index.d.ts +2 -2
- package/dist/components/mapView/index.d.ts.map +1 -1
- package/dist/components/maskedInput/index.d.ts +3 -3
- package/dist/components/modal/modalContainer/index.d.ts +1 -1
- package/dist/components/modal/modalFooter/index.d.ts +1 -1
- package/dist/components/modal/modalHeader/index.d.ts +1 -1
- package/dist/components/multiSelect/index.d.ts +1 -1
- package/dist/components/pagination/index.d.ts +1 -1
- package/dist/components/phoneInput/index.d.ts +2 -2
- package/dist/components/phoneInput/index.d.ts.map +1 -1
- package/dist/components/popover/index.d.ts +2 -2
- package/dist/components/popover/index.d.ts.map +1 -1
- package/dist/components/radio/radioBox/index.d.ts +4 -4
- package/dist/components/radio/radioGroup/index.d.ts +3 -3
- package/dist/components/richText/index.d.ts +13 -4
- package/dist/components/richText/index.d.ts.map +1 -1
- package/dist/components/richText/insertLink/index.d.ts +5 -0
- package/dist/components/richText/insertLink/index.d.ts.map +1 -0
- package/dist/components/richText/insertVideo/index.d.ts.map +1 -1
- package/dist/components/richText/leaf/index.d.ts +1 -0
- package/dist/components/richText/leaf/index.d.ts.map +1 -1
- package/dist/components/searchPlaces.d.ts +3 -3
- package/dist/components/select/index.d.ts +1 -1
- package/dist/components/slider/index.d.ts +1 -1
- package/dist/components/switch/index.d.ts +3 -3
- package/dist/components/switch/index.d.ts.map +1 -1
- package/dist/components/tab/tabButton/index.d.ts +1 -1
- package/dist/components/tab/tabContainer/index.d.ts +1 -1
- package/dist/components/table/tableBody/index.d.ts +1 -1
- package/dist/components/table/tableCaption/index.d.ts +2 -2
- package/dist/components/table/tableContainer/index.d.ts +1 -1
- package/dist/components/table/tableFooter/index.d.ts +1 -1
- package/dist/components/table/tableHeader/index.d.ts +2 -2
- package/dist/components/textarea/index.d.ts +1 -1
- package/dist/components/tooltip/index.d.ts +1 -1
- package/dist/hooks/useAutomation.d.ts +1 -1
- package/dist/hooks/useDrawer.d.ts +5 -5
- package/dist/hooks/useForm.d.ts +2 -2
- package/dist/hooks/useHydrated.d.ts +1 -1
- package/dist/hooks/useModal.d.ts +5 -5
- package/dist/hooks/useScopedParams.d.ts +5 -5
- package/dist/hooks/useScrollLock.d.ts +2 -2
- package/dist/hooks/useSearchAutomation.d.ts +6 -6
- package/dist/hooks/useSlider.d.ts +2 -2
- package/dist/hooks/useToast.d.ts +1 -1
- package/dist/index.js +710 -633
- package/dist/index.js.map +1 -1
- package/dist/modules/components/alert/alertContainer/index.js.map +1 -1
- package/dist/modules/components/alert/alertContent/index.js.map +1 -1
- package/dist/modules/components/alert/alertDescription/index.js.map +1 -1
- package/dist/modules/components/alert/alertIcon/index.js.map +1 -1
- package/dist/modules/components/alert/alertTitle/index.js.map +1 -1
- package/dist/modules/components/audioPlayer/index.js.map +1 -1
- package/dist/modules/components/audioUpload/index.js.map +1 -1
- package/dist/modules/components/badge/index.js.map +1 -1
- package/dist/modules/components/button/index.js.map +1 -1
- package/dist/modules/components/cardTab/cardTabButton/index.js.map +1 -1
- package/dist/modules/components/cardTab/cardTabContainer/index.js.map +1 -1
- package/dist/modules/components/checkbox/index.js.map +1 -1
- package/dist/modules/components/clientOnly.js.map +1 -1
- package/dist/modules/components/currencyInput/index.js.map +1 -1
- package/dist/modules/components/datePicker/index.js.map +1 -1
- package/dist/modules/components/divider/index.js.map +1 -1
- package/dist/modules/components/drawer/drawerContainer/index.js.map +1 -1
- package/dist/modules/components/drawer/drawerHeader/index.js.map +1 -1
- package/dist/modules/components/facebookPixel/index.js.map +1 -1
- package/dist/modules/components/fieldError/index.js.map +1 -1
- package/dist/modules/components/fieldLabel/index.js.map +1 -1
- package/dist/modules/components/fieldWrapper/index.js.map +1 -1
- package/dist/modules/components/fileUpload/index.js.map +1 -1
- package/dist/modules/components/googleAnalytics/index.js.map +1 -1
- package/dist/modules/components/googleTagManager/index.js.map +1 -1
- package/dist/modules/components/iconButton/index.js.map +1 -1
- package/dist/modules/components/imageUpload/index.js.map +1 -1
- package/dist/modules/components/input/index.js.map +1 -1
- package/dist/modules/components/mapView/index.js.map +1 -1
- package/dist/modules/components/maskedInput/index.js.map +1 -1
- package/dist/modules/components/modal/modalContainer/index.js.map +1 -1
- package/dist/modules/components/modal/modalFooter/index.js.map +1 -1
- package/dist/modules/components/modal/modalHeader/index.js.map +1 -1
- package/dist/modules/components/multiSelect/index.js.map +1 -1
- package/dist/modules/components/pagination/index.js.map +1 -1
- package/dist/modules/components/phoneInput/index.js +59 -59
- package/dist/modules/components/phoneInput/index.js.map +1 -1
- package/dist/modules/components/popover/index.js.map +1 -1
- package/dist/modules/components/radio/radioBox/index.js.map +1 -1
- package/dist/modules/components/radio/radioGroup/index.js.map +1 -1
- package/dist/modules/components/richText/index.js +58 -56
- package/dist/modules/components/richText/index.js.map +1 -1
- package/dist/modules/components/richText/insertLink/index.js +68 -0
- package/dist/modules/components/richText/insertLink/index.js.map +1 -0
- package/dist/modules/components/richText/insertLink/styles.css +1 -0
- package/dist/modules/components/richText/insertVideo/index.js +45 -41
- package/dist/modules/components/richText/insertVideo/index.js.map +1 -1
- package/dist/modules/components/richText/leaf/index.js +6 -1
- package/dist/modules/components/richText/leaf/index.js.map +1 -1
- package/dist/modules/components/richText/leaf/styles.css +1 -0
- package/dist/modules/components/richText/styles.css +4 -0
- package/dist/modules/components/searchPlaces.js.map +1 -1
- package/dist/modules/components/select/index.js.map +1 -1
- package/dist/modules/components/slider/index.js.map +1 -1
- package/dist/modules/components/switch/index.js.map +1 -1
- package/dist/modules/components/tab/tabButton/index.js.map +1 -1
- package/dist/modules/components/tab/tabContainer/index.js.map +1 -1
- package/dist/modules/components/table/tableBody/index.js.map +1 -1
- package/dist/modules/components/table/tableCaption/index.js.map +1 -1
- package/dist/modules/components/table/tableContainer/index.js.map +1 -1
- package/dist/modules/components/table/tableFooter/index.js.map +1 -1
- package/dist/modules/components/table/tableHeader/index.js.map +1 -1
- package/dist/modules/components/textarea/index.js.map +1 -1
- package/dist/modules/components/tooltip/index.js.map +1 -1
- package/dist/modules/hooks/useAutomation.js.map +1 -1
- package/dist/modules/hooks/useDrawer.js.map +1 -1
- package/dist/modules/hooks/useForm.js.map +1 -1
- package/dist/modules/hooks/useHydrated.js.map +1 -1
- package/dist/modules/hooks/useModal.js.map +1 -1
- package/dist/modules/hooks/useScopedParams.js.map +1 -1
- package/dist/modules/hooks/useScrollLock.js.map +1 -1
- package/dist/modules/hooks/useSearchAutomation.js.map +1 -1
- package/dist/modules/hooks/useSlider.js.map +1 -1
- package/dist/modules/hooks/useToast.js.map +1 -1
- package/dist/modules/providers/drawerProvider.js.map +1 -1
- package/dist/modules/providers/formProvider.js.map +1 -1
- package/dist/modules/providers/modalProvider.js.map +1 -1
- package/dist/modules/providers/placesProvider.js.map +1 -1
- package/dist/modules/providers/toastProvider.js.map +1 -1
- package/dist/modules/services/isValidHttpsUrl.js +12 -0
- package/dist/modules/services/isValidHttpsUrl.js.map +1 -0
- package/dist/modules/services/toHtml.js.map +1 -1
- package/dist/modules/services/toRichTextValue.js.map +1 -1
- package/dist/modules/utils/richTextUtilities.js +24 -17
- package/dist/modules/utils/richTextUtilities.js.map +1 -1
- package/dist/providers/drawerProvider.d.ts +1 -1
- package/dist/providers/formProvider.d.ts +1 -1
- package/dist/providers/modalProvider.d.ts +1 -1
- package/dist/providers/placesProvider.d.ts +1 -1
- package/dist/providers/toastProvider.d.ts +1 -1
- package/dist/services/isValidHttpsUrl.d.ts +3 -0
- package/dist/services/isValidHttpsUrl.d.ts.map +1 -0
- package/dist/services/toHtml.d.ts +1 -1
- package/dist/services/toRichTextValue.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/types/richTextTypes.d.ts +13 -2
- package/dist/types/richTextTypes.d.ts.map +1 -1
- package/dist/utils/richTextUtilities.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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 +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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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 +1 @@
|
|
|
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
|
|
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
|
|
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
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isValidHttpsUrl.js","names":[],"sources":["../../../src/services/isValidHttpsUrl.ts"],"sourcesContent":["function isValidHttpsUrl(url: string): boolean {\n\ttry {\n\t\treturn new URL(url).protocol === \"https:\";\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nexport { isValidHttpsUrl };\n"],"mappings":";AAAA,SAAS,EAAgB,GAAsB;CAC9C,IAAI;EACH,OAAO,IAAI,IAAI,CAAG,CAAC,CAAC,aAAa;CAClC,QAAQ;EACP,OAAO;CACR;AACD"}
|
|
@@ -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
|
|
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
|
|
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"}
|
|
@@ -3,7 +3,7 @@ import { Element as e, Text as t } from "slate";
|
|
|
3
3
|
function n(r) {
|
|
4
4
|
if (t.isText(r)) {
|
|
5
5
|
let e = r?.text;
|
|
6
|
-
return r?.bold && (e = `<strong>${e}</strong>`), r?.code && (e = `<code>${e}</code>`), r?.italic && (e = `<em>${e}</em>`), r?.underline && (e = `<u>${e}</u>`), e;
|
|
6
|
+
return r?.bold && (e = `<strong>${e}</strong>`), r?.code && (e = `<code>${e}</code>`), r?.italic && (e = `<em>${e}</em>`), r?.underline && (e = `<u>${e}</u>`), r?.link && (e = `<a href="${r.href}">${e}</a>`), e;
|
|
7
7
|
}
|
|
8
8
|
if (e.isElement(r)) {
|
|
9
9
|
let e = r.children?.map((e) => n(e)).join(""), t = r.align || "left";
|
|
@@ -24,48 +24,50 @@ function n(r) {
|
|
|
24
24
|
}
|
|
25
25
|
function r(e) {
|
|
26
26
|
if (typeof e == "string") return { text: e };
|
|
27
|
-
let t =
|
|
27
|
+
let t = e.props.children, n;
|
|
28
|
+
n = Array.isArray(t) ? t.map((e) => r(e)) : typeof t == "string" || !t ? [{ text: t || "" }] : [r(t)];
|
|
29
|
+
let i = e.props.className?.replace("align_", "");
|
|
28
30
|
switch (e.type) {
|
|
29
31
|
case "img": return {
|
|
30
32
|
type: "image",
|
|
31
|
-
align:
|
|
33
|
+
align: i,
|
|
32
34
|
src: e.props.src,
|
|
33
35
|
children: [{ text: "" }]
|
|
34
36
|
};
|
|
35
37
|
case "p": return {
|
|
36
38
|
type: "paragraph",
|
|
37
|
-
align:
|
|
38
|
-
children:
|
|
39
|
+
align: i,
|
|
40
|
+
children: n
|
|
39
41
|
};
|
|
40
42
|
case "blockquote": return {
|
|
41
43
|
type: "blockQuote",
|
|
42
|
-
align:
|
|
43
|
-
children:
|
|
44
|
+
align: i,
|
|
45
|
+
children: n
|
|
44
46
|
};
|
|
45
47
|
case "ul": return {
|
|
46
48
|
type: "bulletedList",
|
|
47
|
-
align:
|
|
48
|
-
children:
|
|
49
|
+
align: i,
|
|
50
|
+
children: n
|
|
49
51
|
};
|
|
50
52
|
case "ol": return {
|
|
51
53
|
type: "numberedList",
|
|
52
|
-
align:
|
|
53
|
-
children:
|
|
54
|
+
align: i,
|
|
55
|
+
children: n
|
|
54
56
|
};
|
|
55
57
|
case "li": return {
|
|
56
58
|
type: "listItem",
|
|
57
|
-
align:
|
|
58
|
-
children:
|
|
59
|
+
align: i,
|
|
60
|
+
children: n
|
|
59
61
|
};
|
|
60
62
|
case "h1": return {
|
|
61
63
|
type: "headingOne",
|
|
62
|
-
align:
|
|
63
|
-
children:
|
|
64
|
+
align: i,
|
|
65
|
+
children: n
|
|
64
66
|
};
|
|
65
67
|
case "h2": return {
|
|
66
68
|
type: "headingTwo",
|
|
67
|
-
align:
|
|
68
|
-
children:
|
|
69
|
+
align: i,
|
|
70
|
+
children: n
|
|
69
71
|
};
|
|
70
72
|
case "strong": return {
|
|
71
73
|
text: e.props.children,
|
|
@@ -83,6 +85,11 @@ function r(e) {
|
|
|
83
85
|
text: e.props.children,
|
|
84
86
|
underline: !0
|
|
85
87
|
};
|
|
88
|
+
case "a": return {
|
|
89
|
+
text: e.props.children,
|
|
90
|
+
link: !0,
|
|
91
|
+
href: e.props.href
|
|
92
|
+
};
|
|
86
93
|
default: return { text: e.props.children || "" };
|
|
87
94
|
}
|
|
88
95
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"richTextUtilities.js","names":[],"sources":["../../../src/utils/richTextUtilities.ts"],"sourcesContent":["import { Element, Text } from \"slate\";\nimport type { ParseElement } from \"../types/richTextTypes\";\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\nfunction serialize(node: any): string {\n\tif (Text.isText(node)) {\n\t\tlet text = node?.text;\n\t\tif (node?.bold) {\n\t\t\ttext = `<strong>${text}</strong>`;\n\t\t}\n\t\tif (node?.code) {\n\t\t\ttext = `<code>${text}</code>`;\n\t\t}\n\t\tif (node?.italic) {\n\t\t\ttext = `<em>${text}</em>`;\n\t\t}\n\t\tif (node?.underline) {\n\t\t\ttext = `<u>${text}</u>`;\n\t\t}\n\t\treturn text;\n\t}\n\n\tif (Element.isElement(node)) {\n\t\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\t\tconst children = node.children?.map((n: any) => serialize(n)).join(\"\");\n\t\tconst alignStyle = node.align || \"left\";\n\n\t\tswitch (node.type) {\n\t\t\tcase \"video\":\n\t\t\t\treturn `<iframe src=\"${node.src}\" class=\"align_${alignStyle}\" />`;\n\t\t\tcase \"image\":\n\t\t\t\treturn `<img src=\"${node.src}\" class=\"align_${alignStyle}\" />`;\n\t\t\tcase \"paragraph\":\n\t\t\t\treturn `<p class=\"align_${alignStyle}\">${children}</p>`;\n\t\t\tcase \"blockQuote\":\n\t\t\t\treturn `<blockquote class=\"align_${alignStyle}\">${children}</blockquote>`;\n\t\t\tcase \"bulletedList\":\n\t\t\t\treturn `<ul class=\"align_${alignStyle}\">${children}</ul>`;\n\t\t\tcase \"headingOne\":\n\t\t\t\treturn `<h1 class=\"align_${alignStyle}\">${children}</h1>`;\n\t\t\tcase \"headingTwo\":\n\t\t\t\treturn `<h2 class=\"align_${alignStyle}\">${children}</h2>`;\n\t\t\tcase \"listItem\":\n\t\t\t\treturn `<li class=\"align_${alignStyle}\">${children}</li>`;\n\t\t\tcase \"numberedList\":\n\t\t\t\treturn `<ol class=\"align_${alignStyle}\">${children}</ol>`;\n\t\t\tdefault:\n\t\t\t\treturn \"\";\n\t\t}\n\t}\n\n\treturn \"\";\n}\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\nfunction deserialize(el: ParseElement): any {\n\tif (typeof el === \"string\") {\n\t\treturn { text: el };\n\t}\n\n\tconst
|
|
1
|
+
{"version":3,"file":"richTextUtilities.js","names":[],"sources":["../../../src/utils/richTextUtilities.ts"],"sourcesContent":["import { Element, Text } from \"slate\";\nimport type { ParseElement } from \"../types/richTextTypes\";\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\nfunction serialize(node: any): string {\n\tif (Text.isText(node)) {\n\t\tlet text = node?.text;\n\t\tif (node?.bold) {\n\t\t\ttext = `<strong>${text}</strong>`;\n\t\t}\n\t\tif (node?.code) {\n\t\t\ttext = `<code>${text}</code>`;\n\t\t}\n\t\tif (node?.italic) {\n\t\t\ttext = `<em>${text}</em>`;\n\t\t}\n\t\tif (node?.underline) {\n\t\t\ttext = `<u>${text}</u>`;\n\t\t}\n\t\tif (node?.link) {\n\t\t\ttext = `<a href=\"${node.href}\">${text}</a>`;\n\t\t}\n\t\treturn text;\n\t}\n\n\tif (Element.isElement(node)) {\n\t\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\t\tconst children = node.children?.map((n: any) => serialize(n)).join(\"\");\n\t\tconst alignStyle = node.align || \"left\";\n\n\t\tswitch (node.type) {\n\t\t\tcase \"video\":\n\t\t\t\treturn `<iframe src=\"${node.src}\" class=\"align_${alignStyle}\" />`;\n\t\t\tcase \"image\":\n\t\t\t\treturn `<img src=\"${node.src}\" class=\"align_${alignStyle}\" />`;\n\t\t\tcase \"paragraph\":\n\t\t\t\treturn `<p class=\"align_${alignStyle}\">${children}</p>`;\n\t\t\tcase \"blockQuote\":\n\t\t\t\treturn `<blockquote class=\"align_${alignStyle}\">${children}</blockquote>`;\n\t\t\tcase \"bulletedList\":\n\t\t\t\treturn `<ul class=\"align_${alignStyle}\">${children}</ul>`;\n\t\t\tcase \"headingOne\":\n\t\t\t\treturn `<h1 class=\"align_${alignStyle}\">${children}</h1>`;\n\t\t\tcase \"headingTwo\":\n\t\t\t\treturn `<h2 class=\"align_${alignStyle}\">${children}</h2>`;\n\t\t\tcase \"listItem\":\n\t\t\t\treturn `<li class=\"align_${alignStyle}\">${children}</li>`;\n\t\t\tcase \"numberedList\":\n\t\t\t\treturn `<ol class=\"align_${alignStyle}\">${children}</ol>`;\n\t\t\tdefault:\n\t\t\t\treturn \"\";\n\t\t}\n\t}\n\n\treturn \"\";\n}\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\nfunction deserialize(el: ParseElement): any {\n\tif (typeof el === \"string\") {\n\t\treturn { text: el };\n\t}\n\n\tconst rawChildren = el.props.children;\n\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tlet children: any[];\n\tif (Array.isArray(rawChildren)) {\n\t\tchildren = rawChildren.map((child) => deserialize(child));\n\t} else if (typeof rawChildren === \"string\" || !rawChildren) {\n\t\tchildren = [{ text: rawChildren || \"\" }];\n\t} else {\n\t\tchildren = [deserialize(rawChildren)];\n\t}\n\n\tconst align = el.props.className?.replace(\"align_\", \"\") as\n\t\t| \"left\"\n\t\t| \"center\"\n\t\t| \"right\"\n\t\t| \"justify\";\n\n\tswitch (el.type) {\n\t\tcase \"img\":\n\t\t\treturn {\n\t\t\t\ttype: \"image\",\n\t\t\t\talign,\n\t\t\t\tsrc: el.props.src,\n\t\t\t\tchildren: [{ text: \"\" }],\n\t\t\t};\n\t\tcase \"p\":\n\t\t\treturn { type: \"paragraph\", align, children };\n\t\tcase \"blockquote\":\n\t\t\treturn { type: \"blockQuote\", align, children };\n\t\tcase \"ul\":\n\t\t\treturn { type: \"bulletedList\", align, children };\n\t\tcase \"ol\":\n\t\t\treturn { type: \"numberedList\", align, children };\n\t\tcase \"li\":\n\t\t\treturn { type: \"listItem\", align, children };\n\t\tcase \"h1\":\n\t\t\treturn { type: \"headingOne\", align, children };\n\t\tcase \"h2\":\n\t\t\treturn { type: \"headingTwo\", align, children };\n\t\tcase \"strong\":\n\t\t\treturn { text: el.props.children, bold: true };\n\t\tcase \"code\":\n\t\t\treturn { text: el.props.children, code: true };\n\t\tcase \"em\":\n\t\t\treturn { text: el.props.children, italic: true };\n\t\tcase \"u\":\n\t\t\treturn { text: el.props.children, underline: true };\n\t\tcase \"a\":\n\t\t\treturn { text: el.props.children, link: true, href: el.props.href };\n\t\tdefault:\n\t\t\treturn { text: el.props.children || \"\" };\n\t}\n}\n\nexport { deserialize, serialize };\n"],"mappings":";;AAIA,SAAS,EAAU,GAAmB;CACrC,IAAI,EAAK,OAAO,CAAI,GAAG;EACtB,IAAI,IAAO,GAAM;EAgBjB,OAfI,GAAM,SACT,IAAO,WAAW,EAAK,aAEpB,GAAM,SACT,IAAO,SAAS,EAAK,WAElB,GAAM,WACT,IAAO,OAAO,EAAK,SAEhB,GAAM,cACT,IAAO,MAAM,EAAK,QAEf,GAAM,SACT,IAAO,YAAY,EAAK,KAAK,IAAI,EAAK,QAEhC;CACR;CAEA,IAAI,EAAQ,UAAU,CAAI,GAAG;EAE5B,IAAM,IAAW,EAAK,UAAU,KAAK,MAAW,EAAU,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,GAC/D,IAAa,EAAK,SAAS;EAEjC,QAAQ,EAAK,MAAb;GACC,KAAK,SACJ,OAAO,gBAAgB,EAAK,IAAI,iBAAiB,EAAW;GAC7D,KAAK,SACJ,OAAO,aAAa,EAAK,IAAI,iBAAiB,EAAW;GAC1D,KAAK,aACJ,OAAO,mBAAmB,EAAW,IAAI,EAAS;GACnD,KAAK,cACJ,OAAO,4BAA4B,EAAW,IAAI,EAAS;GAC5D,KAAK,gBACJ,OAAO,oBAAoB,EAAW,IAAI,EAAS;GACpD,KAAK,cACJ,OAAO,oBAAoB,EAAW,IAAI,EAAS;GACpD,KAAK,cACJ,OAAO,oBAAoB,EAAW,IAAI,EAAS;GACpD,KAAK,YACJ,OAAO,oBAAoB,EAAW,IAAI,EAAS;GACpD,KAAK,gBACJ,OAAO,oBAAoB,EAAW,IAAI,EAAS;GACpD,SACC,OAAO;EACT;CACD;CAEA,OAAO;AACR;AAGA,SAAS,EAAY,GAAuB;CAC3C,IAAI,OAAO,KAAO,UACjB,OAAO,EAAE,MAAM,EAAG;CAGnB,IAAM,IAAc,EAAG,MAAM,UAGzB;CACJ,AAKC,IALG,MAAM,QAAQ,CAAW,IACjB,EAAY,KAAK,MAAU,EAAY,CAAK,CAAC,IAC9C,OAAO,KAAgB,YAAY,CAAC,IACnC,CAAC,EAAE,MAAM,KAAe,GAAG,CAAC,IAE5B,CAAC,EAAY,CAAW,CAAC;CAGrC,IAAM,IAAQ,EAAG,MAAM,WAAW,QAAQ,UAAU,EAAE;CAMtD,QAAQ,EAAG,MAAX;EACC,KAAK,OACJ,OAAO;GACN,MAAM;GACN;GACA,KAAK,EAAG,MAAM;GACd,UAAU,CAAC,EAAE,MAAM,GAAG,CAAC;EACxB;EACD,KAAK,KACJ,OAAO;GAAE,MAAM;GAAa;GAAO;EAAS;EAC7C,KAAK,cACJ,OAAO;GAAE,MAAM;GAAc;GAAO;EAAS;EAC9C,KAAK,MACJ,OAAO;GAAE,MAAM;GAAgB;GAAO;EAAS;EAChD,KAAK,MACJ,OAAO;GAAE,MAAM;GAAgB;GAAO;EAAS;EAChD,KAAK,MACJ,OAAO;GAAE,MAAM;GAAY;GAAO;EAAS;EAC5C,KAAK,MACJ,OAAO;GAAE,MAAM;GAAc;GAAO;EAAS;EAC9C,KAAK,MACJ,OAAO;GAAE,MAAM;GAAc;GAAO;EAAS;EAC9C,KAAK,UACJ,OAAO;GAAE,MAAM,EAAG,MAAM;GAAU,MAAM;EAAK;EAC9C,KAAK,QACJ,OAAO;GAAE,MAAM,EAAG,MAAM;GAAU,MAAM;EAAK;EAC9C,KAAK,MACJ,OAAO;GAAE,MAAM,EAAG,MAAM;GAAU,QAAQ;EAAK;EAChD,KAAK,KACJ,OAAO;GAAE,MAAM,EAAG,MAAM;GAAU,WAAW;EAAK;EACnD,KAAK,KACJ,OAAO;GAAE,MAAM,EAAG,MAAM;GAAU,MAAM;GAAM,MAAM,EAAG,MAAM;EAAK;EACnE,SACC,OAAO,EAAE,MAAM,EAAG,MAAM,YAAY,GAAG;CACzC;AACD"}
|
|
@@ -11,7 +11,7 @@ type DrawerProviderProps = {
|
|
|
11
11
|
};
|
|
12
12
|
declare const drawerContext: import("react").Context<DrawerContextProps<any>>;
|
|
13
13
|
/**
|
|
14
|
-
* DrawerProvider
|
|
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
|
|
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
|
|
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
|
|
@@ -5,7 +5,7 @@ type PlacesProviderProps = {
|
|
|
5
5
|
preventFontsLoading?: boolean;
|
|
6
6
|
};
|
|
7
7
|
/**
|
|
8
|
-
* PlacesProvider
|
|
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
|
|
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).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isValidHttpsUrl.d.ts","sourceRoot":"","sources":["../../src/services/isValidHttpsUrl.ts"],"names":[],"mappings":"AAAA,iBAAS,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAM7C;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RichTextValue } from "../types/richTextTypes";
|
|
2
2
|
/**
|
|
3
|
-
* toHtml
|
|
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
|
|
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).
|