@arkyn/components 3.0.1-beta.99 → 3.0.2
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/LICENSE.txt +184 -1
- package/README.md +198 -22
- package/dist/components/alert/alertContainer/index.d.ts +30 -46
- package/dist/components/alert/alertContainer/index.d.ts.map +1 -1
- package/dist/components/alert/alertContent/index.d.ts +12 -37
- package/dist/components/alert/alertContent/index.d.ts.map +1 -1
- package/dist/components/alert/alertDescription/index.d.ts +11 -39
- package/dist/components/alert/alertDescription/index.d.ts.map +1 -1
- package/dist/components/alert/alertIcon/index.d.ts +16 -40
- package/dist/components/alert/alertIcon/index.d.ts.map +1 -1
- package/dist/components/alert/alertTitle/index.d.ts +13 -36
- package/dist/components/alert/alertTitle/index.d.ts.map +1 -1
- package/dist/components/audioPlayer/index.d.ts +25 -33
- package/dist/components/audioPlayer/index.d.ts.map +1 -1
- package/dist/components/audioUpload/hasFileContent/index.d.ts +1 -1
- package/dist/components/audioUpload/hasFileContent/index.d.ts.map +1 -1
- package/dist/components/audioUpload/index.d.ts +38 -49
- package/dist/components/audioUpload/index.d.ts.map +1 -1
- package/dist/components/audioUpload/noFileContent/index.d.ts +1 -1
- package/dist/components/audioUpload/noFileContent/index.d.ts.map +1 -1
- package/dist/components/badge/index.d.ts +34 -25
- package/dist/components/badge/index.d.ts.map +1 -1
- package/dist/components/button/index.d.ts +42 -32
- package/dist/components/button/index.d.ts.map +1 -1
- package/dist/components/calendar/_calendarProvider.d.ts +52 -0
- package/dist/components/calendar/_calendarProvider.d.ts.map +1 -0
- package/dist/components/calendar/_viewService.d.ts +32 -0
- package/dist/components/calendar/_viewService.d.ts.map +1 -0
- package/dist/components/calendar/calendarContainer/index.d.ts +8 -0
- package/dist/components/calendar/calendarContainer/index.d.ts.map +1 -0
- package/dist/components/calendar/calendarHeader/index.d.ts +7 -0
- package/dist/components/calendar/calendarHeader/index.d.ts.map +1 -0
- package/dist/components/calendar/calendarTableBody/index.d.ts +4 -0
- package/dist/components/calendar/calendarTableBody/index.d.ts.map +1 -0
- package/dist/components/calendar/calendarTableContainer/index.d.ts +8 -0
- package/dist/components/calendar/calendarTableContainer/index.d.ts.map +1 -0
- package/dist/components/calendar/calendarTableHeader/index.d.ts +4 -0
- package/dist/components/calendar/calendarTableHeader/index.d.ts.map +1 -0
- package/dist/components/calendar/calendarTableTd/index.d.ts +11 -0
- package/dist/components/calendar/calendarTableTd/index.d.ts.map +1 -0
- package/dist/components/calendar/index.d.ts +100 -0
- package/dist/components/calendar/index.d.ts.map +1 -0
- package/dist/components/cardTab/cardTabButton/index.d.ts +16 -54
- package/dist/components/cardTab/cardTabButton/index.d.ts.map +1 -1
- package/dist/components/cardTab/cardTabContainer/index.d.ts +18 -60
- package/dist/components/cardTab/cardTabContainer/index.d.ts.map +1 -1
- package/dist/components/cardTab/cardTabContext.d.ts +4 -4
- package/dist/components/cardTab/cardTabContext.d.ts.map +1 -1
- package/dist/components/checkbox/index.d.ts +42 -37
- package/dist/components/checkbox/index.d.ts.map +1 -1
- package/dist/components/clientOnly.d.ts +14 -67
- package/dist/components/clientOnly.d.ts.map +1 -1
- package/dist/components/currencyInput/index.d.ts +75 -53
- package/dist/components/currencyInput/index.d.ts.map +1 -1
- package/dist/components/divider/index.d.ts +14 -27
- package/dist/components/divider/index.d.ts.map +1 -1
- package/dist/components/drawer/drawerContainer/index.d.ts +18 -52
- package/dist/components/drawer/drawerContainer/index.d.ts.map +1 -1
- package/dist/components/drawer/drawerContext.d.ts +2 -2
- package/dist/components/drawer/drawerContext.d.ts.map +1 -1
- package/dist/components/drawer/drawerHeader/index.d.ts +11 -35
- package/dist/components/drawer/drawerHeader/index.d.ts.map +1 -1
- package/dist/components/facebookPixel/facebookPixel.client.d.ts +4 -0
- package/dist/components/facebookPixel/facebookPixel.client.d.ts.map +1 -0
- package/dist/components/facebookPixel/index.d.ts +65 -0
- package/dist/components/facebookPixel/index.d.ts.map +1 -0
- package/dist/components/facebookPixel/pixel.d.ts +21 -0
- package/dist/components/facebookPixel/pixel.d.ts.map +1 -0
- package/dist/components/fieldError/index.d.ts +6 -13
- package/dist/components/fieldError/index.d.ts.map +1 -1
- package/dist/components/fieldLabel/index.d.ts +8 -23
- package/dist/components/fieldLabel/index.d.ts.map +1 -1
- package/dist/components/fieldWrapper/index.d.ts +14 -24
- package/dist/components/fieldWrapper/index.d.ts.map +1 -1
- package/dist/components/fileUpload/hasFileContent/index.d.ts +1 -1
- package/dist/components/fileUpload/hasFileContent/index.d.ts.map +1 -1
- package/dist/components/fileUpload/index.d.ts +37 -62
- package/dist/components/fileUpload/index.d.ts.map +1 -1
- package/dist/components/fileUpload/noFileContent/index.d.ts +1 -1
- package/dist/components/fileUpload/noFileContent/index.d.ts.map +1 -1
- package/dist/components/fullCalendar/_fullCalendarProvider.d.ts +44 -0
- package/dist/components/fullCalendar/_fullCalendarProvider.d.ts.map +1 -0
- package/dist/components/fullCalendar/_viewService.d.ts +28 -0
- package/dist/components/fullCalendar/_viewService.d.ts.map +1 -0
- package/dist/components/fullCalendar/dayCalendar/dayCalendarContainer/index.d.ts +8 -0
- package/dist/components/fullCalendar/dayCalendar/dayCalendarContainer/index.d.ts.map +1 -0
- package/dist/components/fullCalendar/dayCalendar/dayCalendarEvent/index.d.ts +7 -0
- package/dist/components/fullCalendar/dayCalendar/dayCalendarEvent/index.d.ts.map +1 -0
- package/dist/components/fullCalendar/dayCalendar/dayCalendarRow/index.d.ts +8 -0
- package/dist/components/fullCalendar/dayCalendar/dayCalendarRow/index.d.ts.map +1 -0
- package/dist/components/fullCalendar/dayCalendar/index.d.ts +3 -0
- package/dist/components/fullCalendar/dayCalendar/index.d.ts.map +1 -0
- package/dist/components/fullCalendar/fullCalendarContainer/index.d.ts +8 -0
- package/dist/components/fullCalendar/fullCalendarContainer/index.d.ts.map +1 -0
- package/dist/components/fullCalendar/fullCalendarHeader/index.d.ts +8 -0
- package/dist/components/fullCalendar/fullCalendarHeader/index.d.ts.map +1 -0
- package/dist/components/fullCalendar/index.d.ts +94 -0
- package/dist/components/fullCalendar/index.d.ts.map +1 -0
- package/dist/components/fullCalendar/monthlyCalendar/index.d.ts +3 -0
- package/dist/components/fullCalendar/monthlyCalendar/index.d.ts.map +1 -0
- package/dist/components/fullCalendar/monthlyCalendar/monthlyCalendarEvent/index.d.ts +9 -0
- package/dist/components/fullCalendar/monthlyCalendar/monthlyCalendarEvent/index.d.ts.map +1 -0
- package/dist/components/fullCalendar/monthlyCalendar/monthlyCalendarTableBody/index.d.ts +4 -0
- package/dist/components/fullCalendar/monthlyCalendar/monthlyCalendarTableBody/index.d.ts.map +1 -0
- package/dist/components/fullCalendar/monthlyCalendar/monthlyCalendarTableContainer/index.d.ts +8 -0
- package/dist/components/fullCalendar/monthlyCalendar/monthlyCalendarTableContainer/index.d.ts.map +1 -0
- package/dist/components/fullCalendar/monthlyCalendar/monthlyCalendarTableHeader/index.d.ts +4 -0
- package/dist/components/fullCalendar/monthlyCalendar/monthlyCalendarTableHeader/index.d.ts.map +1 -0
- package/dist/components/fullCalendar/monthlyCalendar/monthlyCalendarTableTd/index.d.ts +10 -0
- package/dist/components/fullCalendar/monthlyCalendar/monthlyCalendarTableTd/index.d.ts.map +1 -0
- package/dist/components/fullCalendar/weekCalendar/index.d.ts +3 -0
- package/dist/components/fullCalendar/weekCalendar/index.d.ts.map +1 -0
- package/dist/components/fullCalendar/weekCalendar/weekCalendarEvent/index.d.ts +10 -0
- package/dist/components/fullCalendar/weekCalendar/weekCalendarEvent/index.d.ts.map +1 -0
- package/dist/components/fullCalendar/weekCalendar/weekCalendarTableBody/index.d.ts +4 -0
- package/dist/components/fullCalendar/weekCalendar/weekCalendarTableBody/index.d.ts.map +1 -0
- package/dist/components/fullCalendar/weekCalendar/weekCalendarTableContainer/index.d.ts +8 -0
- package/dist/components/fullCalendar/weekCalendar/weekCalendarTableContainer/index.d.ts.map +1 -0
- package/dist/components/fullCalendar/weekCalendar/weekCalendarTableHeader/index.d.ts +4 -0
- package/dist/components/fullCalendar/weekCalendar/weekCalendarTableHeader/index.d.ts.map +1 -0
- package/dist/components/fullCalendar/weekCalendar/weekCalendarTableTd/index.d.ts +11 -0
- package/dist/components/fullCalendar/weekCalendar/weekCalendarTableTd/index.d.ts.map +1 -0
- package/dist/components/googleAnalytics/googleAnalytics.client.d.ts +6 -0
- package/dist/components/googleAnalytics/googleAnalytics.client.d.ts.map +1 -0
- package/dist/components/googleAnalytics/googleAnalytics.d.ts +10 -0
- package/dist/components/googleAnalytics/googleAnalytics.d.ts.map +1 -0
- package/dist/components/googleAnalytics/index.d.ts +30 -0
- package/dist/components/googleAnalytics/index.d.ts.map +1 -0
- package/dist/components/googleAnalytics/snippets/generateGAElements.d.ts +9 -0
- package/dist/components/googleAnalytics/snippets/generateGAElements.d.ts.map +1 -0
- package/dist/components/googleTagManager/googleTagManager.client.d.ts +11 -0
- package/dist/components/googleTagManager/googleTagManager.client.d.ts.map +1 -0
- package/dist/components/googleTagManager/googleTagManager.d.ts +20 -0
- package/dist/components/googleTagManager/googleTagManager.d.ts.map +1 -0
- package/dist/components/googleTagManager/index.d.ts +55 -0
- package/dist/components/googleTagManager/index.d.ts.map +1 -0
- package/dist/components/googleTagManager/snippets/appendToDataLayer.d.ts +7 -0
- package/dist/components/googleTagManager/snippets/appendToDataLayer.d.ts.map +1 -0
- package/dist/components/googleTagManager/snippets/generateGTMElements.d.ts +15 -0
- package/dist/components/googleTagManager/snippets/generateGTMElements.d.ts.map +1 -0
- package/dist/components/iconButton/index.d.ts +35 -19
- package/dist/components/iconButton/index.d.ts.map +1 -1
- package/dist/components/imageUpload/hasFileContent/index.d.ts +1 -1
- package/dist/components/imageUpload/hasFileContent/index.d.ts.map +1 -1
- package/dist/components/imageUpload/index.d.ts +51 -75
- package/dist/components/imageUpload/index.d.ts.map +1 -1
- package/dist/components/imageUpload/noFileContent/index.d.ts +1 -1
- package/dist/components/imageUpload/noFileContent/index.d.ts.map +1 -1
- package/dist/components/input/index.d.ts +58 -47
- package/dist/components/input/index.d.ts.map +1 -1
- package/dist/components/mapView/index.d.ts +55 -7
- package/dist/components/mapView/index.d.ts.map +1 -1
- package/dist/components/mapView/mapView.client.d.ts +17 -0
- package/dist/components/mapView/mapView.client.d.ts.map +1 -0
- package/dist/components/maskedInput/index.d.ts +71 -56
- package/dist/components/maskedInput/index.d.ts.map +1 -1
- package/dist/components/modal/modalContainer/index.d.ts +19 -59
- package/dist/components/modal/modalContainer/index.d.ts.map +1 -1
- package/dist/components/modal/modalContext.d.ts +2 -2
- package/dist/components/modal/modalContext.d.ts.map +1 -1
- package/dist/components/modal/modalFooter/index.d.ts +19 -52
- package/dist/components/modal/modalFooter/index.d.ts.map +1 -1
- package/dist/components/modal/modalHeader/index.d.ts +15 -49
- package/dist/components/modal/modalHeader/index.d.ts.map +1 -1
- package/dist/components/multiSelect/index.d.ts +72 -63
- package/dist/components/multiSelect/index.d.ts.map +1 -1
- package/dist/components/multiSelect/multiSelectChevron/index.d.ts +1 -1
- package/dist/components/multiSelect/multiSelectChevron/index.d.ts.map +1 -1
- package/dist/components/multiSelect/multiSelectContainer/index.d.ts +2 -2
- package/dist/components/multiSelect/multiSelectContainer/index.d.ts.map +1 -1
- package/dist/components/multiSelect/multiSelectContent/index.d.ts +2 -2
- package/dist/components/multiSelect/multiSelectContent/index.d.ts.map +1 -1
- package/dist/components/multiSelect/multiSelectMark/index.d.ts +1 -1
- package/dist/components/multiSelect/multiSelectMark/index.d.ts.map +1 -1
- package/dist/components/multiSelect/multiSelectOption/index.d.ts +1 -1
- package/dist/components/multiSelect/multiSelectOption/index.d.ts.map +1 -1
- package/dist/components/multiSelect/multiSelectOptionsContainer/index.d.ts +2 -2
- package/dist/components/multiSelect/multiSelectOptionsContainer/index.d.ts.map +1 -1
- package/dist/components/multiSelect/multiSelectOverlay/index.d.ts +1 -1
- package/dist/components/multiSelect/multiSelectOverlay/index.d.ts.map +1 -1
- package/dist/components/multiSelect/multiSelectSpinner/index.d.ts +1 -1
- package/dist/components/multiSelect/multiSelectSpinner/index.d.ts.map +1 -1
- package/dist/components/pagination/chevronButton/index.d.ts +1 -1
- package/dist/components/pagination/chevronButton/index.d.ts.map +1 -1
- package/dist/components/pagination/currentButton/index.d.ts +1 -1
- package/dist/components/pagination/currentButton/index.d.ts.map +1 -1
- package/dist/components/pagination/index.d.ts +20 -11
- package/dist/components/pagination/index.d.ts.map +1 -1
- package/dist/components/pagination/pageButton/index.d.ts +1 -1
- package/dist/components/pagination/pageButton/index.d.ts.map +1 -1
- package/dist/components/pagination/paginationService.d.ts.map +1 -1
- package/dist/components/pagination/spread/index.d.ts +1 -1
- package/dist/components/pagination/spread/index.d.ts.map +1 -1
- package/dist/components/phoneInput/index.d.ts +68 -89
- package/dist/components/phoneInput/index.d.ts.map +1 -1
- package/dist/components/phoneInput/phoneInputContainer/index.d.ts +2 -2
- package/dist/components/phoneInput/phoneInputContainer/index.d.ts.map +1 -1
- package/dist/components/phoneInput/phoneInputCountriesOverlay/index.d.ts +1 -1
- package/dist/components/phoneInput/phoneInputCountriesOverlay/index.d.ts.map +1 -1
- package/dist/components/phoneInput/phoneInputCountryOption/index.d.ts +2 -3
- package/dist/components/phoneInput/phoneInputCountryOption/index.d.ts.map +1 -1
- package/dist/components/phoneInput/phoneInputCountryOptionsContainer/index.d.ts +2 -2
- package/dist/components/phoneInput/phoneInputCountryOptionsContainer/index.d.ts.map +1 -1
- package/dist/components/phoneInput/phoneInputCountrySelector/index.d.ts +2 -3
- package/dist/components/phoneInput/phoneInputCountrySelector/index.d.ts.map +1 -1
- package/dist/components/phoneInput/phoneInputMask/index.d.ts +1 -2
- package/dist/components/phoneInput/phoneInputMask/index.d.ts.map +1 -1
- package/dist/components/popover/index.d.ts +36 -116
- package/dist/components/popover/index.d.ts.map +1 -1
- package/dist/components/radio/radioBox/index.d.ts +19 -67
- package/dist/components/radio/radioBox/index.d.ts.map +1 -1
- package/dist/components/radio/radioContext.d.ts +2 -2
- package/dist/components/radio/radioContext.d.ts.map +1 -1
- package/dist/components/radio/radioGroup/index.d.ts +40 -67
- package/dist/components/radio/radioGroup/index.d.ts.map +1 -1
- package/dist/components/richText/blockButton/index.d.ts +3 -3
- package/dist/components/richText/blockButton/index.d.ts.map +1 -1
- package/dist/components/richText/element/index.d.ts +2 -2
- package/dist/components/richText/element/index.d.ts.map +1 -1
- package/dist/components/richText/index.d.ts +35 -47
- package/dist/components/richText/index.d.ts.map +1 -1
- package/dist/components/richText/insertImage/index.d.ts +2 -2
- package/dist/components/richText/insertImage/index.d.ts.map +1 -1
- package/dist/components/richText/insertVideo/index.d.ts +5 -0
- package/dist/components/richText/insertVideo/index.d.ts.map +1 -0
- package/dist/components/richText/leaf/index.d.ts +2 -2
- package/dist/components/richText/leaf/index.d.ts.map +1 -1
- package/dist/components/richText/markButton/index.d.ts +3 -3
- package/dist/components/richText/markButton/index.d.ts.map +1 -1
- package/dist/components/richText/toolbar/index.d.ts +2 -2
- package/dist/components/richText/toolbar/index.d.ts.map +1 -1
- package/dist/components/searchPlaces.d.ts +55 -52
- package/dist/components/searchPlaces.d.ts.map +1 -1
- package/dist/components/select/index.d.ts +73 -64
- package/dist/components/select/index.d.ts.map +1 -1
- package/dist/components/select/selectChevron/index.d.ts +1 -1
- package/dist/components/select/selectChevron/index.d.ts.map +1 -1
- package/dist/components/select/selectContainer/index.d.ts +2 -2
- package/dist/components/select/selectContainer/index.d.ts.map +1 -1
- package/dist/components/select/selectContent/index.d.ts +2 -2
- package/dist/components/select/selectContent/index.d.ts.map +1 -1
- package/dist/components/select/selectOption/index.d.ts +1 -1
- package/dist/components/select/selectOption/index.d.ts.map +1 -1
- package/dist/components/select/selectOptionsContainer/index.d.ts +2 -2
- package/dist/components/select/selectOptionsContainer/index.d.ts.map +1 -1
- package/dist/components/select/selectOverlay/index.d.ts +1 -1
- package/dist/components/select/selectOverlay/index.d.ts.map +1 -1
- package/dist/components/select/selectSpinner/index.d.ts +1 -1
- package/dist/components/select/selectSpinner/index.d.ts.map +1 -1
- package/dist/components/slider/index.d.ts +22 -36
- package/dist/components/slider/index.d.ts.map +1 -1
- package/dist/components/switch/index.d.ts +46 -58
- package/dist/components/switch/index.d.ts.map +1 -1
- package/dist/components/tab/tabButton/index.d.ts +16 -54
- package/dist/components/tab/tabButton/index.d.ts.map +1 -1
- package/dist/components/tab/tabContainer/index.d.ts +18 -60
- package/dist/components/tab/tabContainer/index.d.ts.map +1 -1
- package/dist/components/tab/tabContext.d.ts +2 -2
- package/dist/components/tab/tabContext.d.ts.map +1 -1
- package/dist/components/table/tableBody/index.d.ts +15 -49
- package/dist/components/table/tableBody/index.d.ts.map +1 -1
- package/dist/components/table/tableCaption/index.d.ts +8 -48
- package/dist/components/table/tableCaption/index.d.ts.map +1 -1
- package/dist/components/table/tableContainer/index.d.ts +14 -43
- package/dist/components/table/tableContainer/index.d.ts.map +1 -1
- package/dist/components/table/tableFooter/index.d.ts +7 -31
- package/dist/components/table/tableFooter/index.d.ts.map +1 -1
- package/dist/components/table/tableHeader/index.d.ts +6 -27
- package/dist/components/table/tableHeader/index.d.ts.map +1 -1
- package/dist/components/textarea/index.d.ts +36 -68
- package/dist/components/textarea/index.d.ts.map +1 -1
- package/dist/components/tooltip/index.d.ts +29 -57
- package/dist/components/tooltip/index.d.ts.map +1 -1
- package/dist/hooks/useAutomation.d.ts +22 -25
- package/dist/hooks/useAutomation.d.ts.map +1 -1
- package/dist/hooks/useDrawer.d.ts +20 -65
- package/dist/hooks/useDrawer.d.ts.map +1 -1
- package/dist/hooks/useForm.d.ts +12 -29
- package/dist/hooks/useForm.d.ts.map +1 -1
- package/dist/hooks/useHydrated.d.ts +8 -63
- package/dist/hooks/useHydrated.d.ts.map +1 -1
- package/dist/hooks/useModal.d.ts +20 -60
- package/dist/hooks/useModal.d.ts.map +1 -1
- package/dist/hooks/useScopedParams.d.ts +18 -70
- package/dist/hooks/useScopedParams.d.ts.map +1 -1
- package/dist/hooks/useScrollLock.d.ts +11 -27
- package/dist/hooks/useScrollLock.d.ts.map +1 -1
- package/dist/hooks/useSearchAutomation.d.ts +31 -0
- package/dist/hooks/useSearchAutomation.d.ts.map +1 -0
- package/dist/hooks/useSlider.d.ts +5 -19
- package/dist/hooks/useSlider.d.ts.map +1 -1
- package/dist/hooks/useToast.d.ts +8 -52
- package/dist/hooks/useToast.d.ts.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4391 -69
- package/dist/index.js.map +1 -0
- package/dist/modules/components/alert/alertContainer/index.js +29 -0
- package/dist/modules/components/alert/alertContainer/index.js.map +1 -0
- package/dist/modules/components/alert/alertContainer/styles.css +3 -0
- package/dist/modules/components/alert/alertContent/index.js +14 -0
- package/dist/modules/components/alert/alertContent/index.js.map +1 -0
- package/dist/modules/components/alert/alertContent/styles.css +1 -0
- package/dist/modules/components/alert/alertDescription/index.js +14 -0
- package/dist/modules/components/alert/alertDescription/index.js.map +1 -0
- package/dist/modules/components/alert/alertDescription/styles.css +1 -0
- package/dist/modules/components/alert/alertIcon/index.js +30 -0
- package/dist/modules/components/alert/alertIcon/index.js.map +1 -0
- package/dist/modules/components/alert/alertIcon/styles.css +7 -0
- package/dist/modules/components/alert/alertTitle/index.js +14 -0
- package/dist/modules/components/alert/alertTitle/index.js.map +1 -0
- package/dist/modules/components/alert/alertTitle/styles.css +1 -0
- package/dist/modules/components/audioPlayer/index.js +77 -0
- package/dist/modules/components/audioPlayer/index.js.map +1 -0
- package/dist/modules/components/audioPlayer/styles.css +3 -0
- package/dist/modules/components/audioUpload/hasFileContent/index.js +57 -0
- package/dist/modules/components/audioUpload/hasFileContent/index.js.map +1 -0
- package/dist/modules/components/audioUpload/hasFileContent/styles.css +1 -0
- package/dist/modules/components/audioUpload/index.js +74 -0
- package/dist/modules/components/audioUpload/index.js.map +1 -0
- package/dist/modules/components/audioUpload/noFileContent/index.js +38 -0
- package/dist/modules/components/audioUpload/noFileContent/index.js.map +1 -0
- package/dist/modules/components/audioUpload/noFileContent/styles.css +1 -0
- package/dist/modules/components/audioUpload/styles.css +25 -0
- package/dist/modules/components/badge/index.js +29 -0
- package/dist/modules/components/badge/index.js.map +1 -0
- package/dist/modules/components/badge/styles.css +1 -0
- package/dist/modules/components/button/index.js +42 -0
- package/dist/modules/components/button/index.js.map +1 -0
- package/dist/modules/components/button/styles.css +1 -0
- package/dist/modules/components/calendar/_calendarProvider.js +42 -0
- package/dist/modules/components/calendar/_calendarProvider.js.map +1 -0
- package/dist/modules/components/calendar/_viewService.js +135 -0
- package/dist/modules/components/calendar/_viewService.js.map +1 -0
- package/dist/modules/components/calendar/calendarContainer/index.js +13 -0
- package/dist/modules/components/calendar/calendarContainer/index.js.map +1 -0
- package/dist/modules/components/calendar/calendarContainer/styles.css +1 -0
- package/dist/modules/components/calendar/calendarHeader/index.js +58 -0
- package/dist/modules/components/calendar/calendarHeader/index.js.map +1 -0
- package/dist/modules/components/calendar/calendarHeader/styles.css +1 -0
- package/dist/modules/components/calendar/calendarTableBody/index.js +15 -0
- package/dist/modules/components/calendar/calendarTableBody/index.js.map +1 -0
- package/dist/modules/components/calendar/calendarTableBody/styles.css +1 -0
- package/dist/modules/components/calendar/calendarTableContainer/index.js +13 -0
- package/dist/modules/components/calendar/calendarTableContainer/index.js.map +1 -0
- package/dist/modules/components/calendar/calendarTableContainer/styles.css +1 -0
- package/dist/modules/components/calendar/calendarTableHeader/index.js +16 -0
- package/dist/modules/components/calendar/calendarTableHeader/index.js.map +1 -0
- package/dist/modules/components/calendar/calendarTableHeader/styles.css +1 -0
- package/dist/modules/components/calendar/calendarTableTd/index.js +23 -0
- package/dist/modules/components/calendar/calendarTableTd/index.js.map +1 -0
- package/dist/modules/components/calendar/calendarTableTd/styles.css +1 -0
- package/dist/modules/components/calendar/index.js +34 -0
- package/dist/modules/components/calendar/index.js.map +1 -0
- package/dist/modules/components/calendar/styles.css +33 -0
- package/dist/modules/components/cardTab/cardTabButton/index.js +22 -0
- package/dist/modules/components/cardTab/cardTabButton/index.js.map +1 -0
- package/dist/modules/components/cardTab/cardTabButton/styles.css +1 -0
- package/dist/modules/components/cardTab/cardTabContainer/index.js +25 -0
- package/dist/modules/components/cardTab/cardTabContainer/index.js.map +1 -0
- package/dist/modules/components/cardTab/cardTabContainer/styles.css +1 -0
- package/dist/modules/components/cardTab/cardTabContext.js +26 -0
- package/dist/modules/components/cardTab/cardTabContext.js.map +1 -0
- package/dist/modules/components/checkbox/index.js +40 -0
- package/dist/modules/components/checkbox/index.js.map +1 -0
- package/dist/modules/components/checkbox/styles.css +7 -0
- package/dist/modules/components/clientOnly.js +10 -0
- package/dist/modules/components/clientOnly.js.map +1 -0
- package/dist/modules/components/currencyInput/index.js +114 -0
- package/dist/modules/components/currencyInput/index.js.map +1 -0
- package/dist/modules/components/currencyInput/style.css +1 -0
- package/dist/modules/components/currencyInput/styles.css +7 -0
- package/dist/modules/components/divider/index.js +14 -0
- package/dist/modules/components/divider/index.js.map +1 -0
- package/dist/modules/components/divider/styles.css +1 -0
- package/dist/modules/components/drawer/drawerContainer/index.js +39 -0
- package/dist/modules/components/drawer/drawerContainer/index.js.map +1 -0
- package/dist/modules/components/drawer/drawerContainer/styles.css +1 -0
- package/dist/modules/components/drawer/drawerContext.js +18 -0
- package/dist/modules/components/drawer/drawerContext.js.map +1 -0
- package/dist/modules/components/drawer/drawerHeader/index.js +23 -0
- package/dist/modules/components/drawer/drawerHeader/index.js.map +1 -0
- package/dist/modules/components/drawer/drawerHeader/styles.css +1 -0
- package/dist/modules/components/facebookPixel/facebookPixel.client.js +10 -0
- package/dist/modules/components/facebookPixel/facebookPixel.client.js.map +1 -0
- package/dist/modules/components/facebookPixel/index.js +11 -0
- package/dist/modules/components/facebookPixel/index.js.map +1 -0
- package/dist/modules/components/facebookPixel/pixel.js +50 -0
- package/dist/modules/components/facebookPixel/pixel.js.map +1 -0
- package/dist/modules/components/fieldError/index.js +15 -0
- package/dist/modules/components/fieldError/index.js.map +1 -0
- package/dist/modules/components/fieldError/styles.css +1 -0
- package/dist/modules/components/fieldLabel/index.js +14 -0
- package/dist/modules/components/fieldLabel/index.js.map +1 -0
- package/dist/modules/components/fieldLabel/styles.css +1 -0
- package/dist/modules/components/fieldWrapper/index.js +15 -0
- package/dist/modules/components/fieldWrapper/index.js.map +1 -0
- package/dist/modules/components/fieldWrapper/styles.css +1 -0
- package/dist/modules/components/fileUpload/hasFileContent/index.js +62 -0
- package/dist/modules/components/fileUpload/hasFileContent/index.js.map +1 -0
- package/dist/modules/components/fileUpload/hasFileContent/styles.css +1 -0
- package/dist/modules/components/fileUpload/index.js +68 -0
- package/dist/modules/components/fileUpload/index.js.map +1 -0
- package/dist/modules/components/fileUpload/noFileContent/index.js +38 -0
- package/dist/modules/components/fileUpload/noFileContent/index.js.map +1 -0
- package/dist/modules/components/fileUpload/noFileContent/styles.css +1 -0
- package/dist/modules/components/fileUpload/styles.css +19 -0
- package/dist/modules/components/fullCalendar/_fullCalendarProvider.js +37 -0
- package/dist/modules/components/fullCalendar/_fullCalendarProvider.js.map +1 -0
- package/dist/modules/components/fullCalendar/_viewService.js +103 -0
- package/dist/modules/components/fullCalendar/_viewService.js.map +1 -0
- package/dist/modules/components/fullCalendar/dayCalendar/dayCalendarContainer/index.js +13 -0
- package/dist/modules/components/fullCalendar/dayCalendar/dayCalendarContainer/index.js.map +1 -0
- package/dist/modules/components/fullCalendar/dayCalendar/dayCalendarContainer/styles.css +1 -0
- package/dist/modules/components/fullCalendar/dayCalendar/dayCalendarEvent/index.js +73 -0
- package/dist/modules/components/fullCalendar/dayCalendar/dayCalendarEvent/index.js.map +1 -0
- package/dist/modules/components/fullCalendar/dayCalendar/dayCalendarEvent/styles.css +1 -0
- package/dist/modules/components/fullCalendar/dayCalendar/dayCalendarRow/index.js +31 -0
- package/dist/modules/components/fullCalendar/dayCalendar/dayCalendarRow/index.js.map +1 -0
- package/dist/modules/components/fullCalendar/dayCalendar/dayCalendarRow/styles.css +1 -0
- package/dist/modules/components/fullCalendar/dayCalendar/index.js +16 -0
- package/dist/modules/components/fullCalendar/dayCalendar/index.js.map +1 -0
- package/dist/modules/components/fullCalendar/fullCalendarContainer/index.js +13 -0
- package/dist/modules/components/fullCalendar/fullCalendarContainer/index.js.map +1 -0
- package/dist/modules/components/fullCalendar/fullCalendarContainer/styles.css +1 -0
- package/dist/modules/components/fullCalendar/fullCalendarHeader/index.js +71 -0
- package/dist/modules/components/fullCalendar/fullCalendarHeader/index.js.map +1 -0
- package/dist/modules/components/fullCalendar/fullCalendarHeader/styles.css +1 -0
- package/dist/modules/components/fullCalendar/index.js +33 -0
- package/dist/modules/components/fullCalendar/index.js.map +1 -0
- package/dist/modules/components/fullCalendar/monthlyCalendar/index.js +12 -0
- package/dist/modules/components/fullCalendar/monthlyCalendar/index.js.map +1 -0
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarEvent/index.js +31 -0
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarEvent/index.js.map +1 -0
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarEvent/styles.css +1 -0
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableBody/index.js +15 -0
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableBody/index.js.map +1 -0
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableBody/styles.css +1 -0
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableContainer/index.js +13 -0
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableContainer/index.js.map +1 -0
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableContainer/styles.css +1 -0
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableHeader/index.js +16 -0
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableHeader/index.js.map +1 -0
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableHeader/styles.css +1 -0
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableTd/index.js +38 -0
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableTd/index.js.map +1 -0
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableTd/styles.css +1 -0
- package/dist/modules/components/fullCalendar/styles.css +35 -0
- package/dist/modules/components/fullCalendar/weekCalendar/index.js +12 -0
- package/dist/modules/components/fullCalendar/weekCalendar/index.js.map +1 -0
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarEvent/index.js +73 -0
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarEvent/index.js.map +1 -0
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarEvent/styles.css +1 -0
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableBody/index.js +20 -0
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableBody/index.js.map +1 -0
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableBody/styles.css +1 -0
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableContainer/index.js +13 -0
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableContainer/index.js.map +1 -0
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableContainer/styles.css +1 -0
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableHeader/index.js +19 -0
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableHeader/index.js.map +1 -0
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableHeader/styles.css +1 -0
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableTd/index.js +37 -0
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableTd/index.js.map +1 -0
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableTd/styles.css +1 -0
- package/dist/modules/components/googleAnalytics/googleAnalytics.client.js +9 -0
- package/dist/modules/components/googleAnalytics/googleAnalytics.client.js.map +1 -0
- package/dist/modules/components/googleAnalytics/googleAnalytics.js +20 -0
- package/dist/modules/components/googleAnalytics/googleAnalytics.js.map +1 -0
- package/dist/modules/components/googleAnalytics/index.js +12 -0
- package/dist/modules/components/googleAnalytics/index.js.map +1 -0
- package/dist/modules/components/googleAnalytics/snippets/generateGAElements.js +16 -0
- package/dist/modules/components/googleAnalytics/snippets/generateGAElements.js.map +1 -0
- package/dist/modules/components/googleTagManager/googleTagManager.client.js +9 -0
- package/dist/modules/components/googleTagManager/googleTagManager.client.js.map +1 -0
- package/dist/modules/components/googleTagManager/googleTagManager.js +47 -0
- package/dist/modules/components/googleTagManager/googleTagManager.js.map +1 -0
- package/dist/modules/components/googleTagManager/index.js +19 -0
- package/dist/modules/components/googleTagManager/index.js.map +1 -0
- package/dist/modules/components/googleTagManager/snippets/appendToDataLayer.js +11 -0
- package/dist/modules/components/googleTagManager/snippets/appendToDataLayer.js.map +1 -0
- package/dist/modules/components/googleTagManager/snippets/generateGTMElements.js +25 -0
- package/dist/modules/components/googleTagManager/snippets/generateGTMElements.js.map +1 -0
- package/dist/modules/components/iconButton/index.js +34 -0
- package/dist/modules/components/iconButton/index.js.map +1 -0
- package/dist/modules/components/iconButton/styles.css +1 -0
- package/dist/modules/components/imageUpload/hasFileContent/index.js +49 -0
- package/dist/modules/components/imageUpload/hasFileContent/index.js.map +1 -0
- package/dist/modules/components/imageUpload/hasFileContent/styles.css +1 -0
- package/dist/modules/components/imageUpload/index.js +68 -0
- package/dist/modules/components/imageUpload/index.js.map +1 -0
- package/dist/modules/components/imageUpload/noFileContent/index.js +38 -0
- package/dist/modules/components/imageUpload/noFileContent/index.js.map +1 -0
- package/dist/modules/components/imageUpload/noFileContent/styles.css +1 -0
- package/dist/modules/components/imageUpload/styles.css +17 -0
- package/dist/modules/components/input/index.js +95 -0
- package/dist/modules/components/input/index.js.map +1 -0
- package/dist/modules/components/input/style.css +1 -0
- package/dist/modules/components/input/styles.css +7 -0
- package/dist/modules/components/mapView/index.js +31 -0
- package/dist/modules/components/mapView/index.js.map +1 -0
- package/dist/modules/components/mapView/mapView.client.js +58 -0
- package/dist/modules/components/mapView/mapView.client.js.map +1 -0
- package/dist/modules/components/mapView/mapbox.css +1 -0
- package/dist/modules/components/mapView/styles.css +1 -0
- package/dist/modules/components/maskedInput/index.js +104 -0
- package/dist/modules/components/maskedInput/index.js.map +1 -0
- package/dist/modules/components/maskedInput/style.css +1 -0
- package/dist/modules/components/maskedInput/styles.css +7 -0
- package/dist/modules/components/modal/modalContainer/index.js +38 -0
- package/dist/modules/components/modal/modalContainer/index.js.map +1 -0
- package/dist/modules/components/modal/modalContainer/styles.css +1 -0
- package/dist/modules/components/modal/modalContext.js +18 -0
- package/dist/modules/components/modal/modalContext.js.map +1 -0
- package/dist/modules/components/modal/modalFooter/index.js +14 -0
- package/dist/modules/components/modal/modalFooter/index.js.map +1 -0
- package/dist/modules/components/modal/modalFooter/styles.css +1 -0
- package/dist/modules/components/modal/modalHeader/index.js +23 -0
- package/dist/modules/components/modal/modalHeader/index.js.map +1 -0
- package/dist/modules/components/modal/modalHeader/styles.css +1 -0
- package/dist/modules/components/multiSelect/index.js +118 -0
- package/dist/modules/components/multiSelect/index.js.map +1 -0
- package/dist/modules/components/multiSelect/multiSelectChevron/index.js +21 -0
- package/dist/modules/components/multiSelect/multiSelectChevron/index.js.map +1 -0
- package/dist/modules/components/multiSelect/multiSelectChevron/styles.css +1 -0
- package/dist/modules/components/multiSelect/multiSelectContainer/index.js +16 -0
- package/dist/modules/components/multiSelect/multiSelectContainer/index.js.map +1 -0
- package/dist/modules/components/multiSelect/multiSelectContainer/styles.css +1 -0
- package/dist/modules/components/multiSelect/multiSelectContent/index.js +14 -0
- package/dist/modules/components/multiSelect/multiSelectContent/index.js.map +1 -0
- package/dist/modules/components/multiSelect/multiSelectContent/styles.css +1 -0
- package/dist/modules/components/multiSelect/multiSelectMark/index.js +22 -0
- package/dist/modules/components/multiSelect/multiSelectMark/index.js.map +1 -0
- package/dist/modules/components/multiSelect/multiSelectMark/styles.css +1 -0
- package/dist/modules/components/multiSelect/multiSelectOption/index.js +20 -0
- package/dist/modules/components/multiSelect/multiSelectOption/index.js.map +1 -0
- package/dist/modules/components/multiSelect/multiSelectOption/styles.css +1 -0
- package/dist/modules/components/multiSelect/multiSelectOptionsContainer/index.js +38 -0
- package/dist/modules/components/multiSelect/multiSelectOptionsContainer/index.js.map +1 -0
- package/dist/modules/components/multiSelect/multiSelectOptionsContainer/styles.css +1 -0
- package/dist/modules/components/multiSelect/multiSelectOverlay/index.js +14 -0
- package/dist/modules/components/multiSelect/multiSelectOverlay/index.js.map +1 -0
- package/dist/modules/components/multiSelect/multiSelectOverlay/styles.css +1 -0
- package/dist/modules/components/multiSelect/multiSelectSpinner/index.js +16 -0
- package/dist/modules/components/multiSelect/multiSelectSpinner/index.js.map +1 -0
- package/dist/modules/components/multiSelect/multiSelectSpinner/styles.css +1 -0
- package/dist/modules/components/multiSelect/styles.css +31 -0
- package/dist/modules/components/pagination/chevronButton/index.js +21 -0
- package/dist/modules/components/pagination/chevronButton/index.js.map +1 -0
- package/dist/modules/components/pagination/chevronButton/styles.css +1 -0
- package/dist/modules/components/pagination/currentButton/index.js +15 -0
- package/dist/modules/components/pagination/currentButton/index.js.map +1 -0
- package/dist/modules/components/pagination/currentButton/styles.css +1 -0
- package/dist/modules/components/pagination/index.js +54 -0
- package/dist/modules/components/pagination/index.js.map +1 -0
- package/dist/modules/components/pagination/pageButton/index.js +16 -0
- package/dist/modules/components/pagination/pageButton/index.js.map +1 -0
- package/dist/modules/components/pagination/pageButton/styles.css +1 -0
- package/dist/modules/components/pagination/paginationService.js +36 -0
- package/dist/modules/components/pagination/paginationService.js.map +1 -0
- package/dist/modules/components/pagination/spread/index.js +14 -0
- package/dist/modules/components/pagination/spread/index.js.map +1 -0
- package/dist/modules/components/pagination/spread/styles.css +1 -0
- package/dist/modules/components/pagination/styles.css +9 -0
- package/dist/modules/components/phoneInput/index.js +106 -0
- package/dist/modules/components/phoneInput/index.js.map +1 -0
- package/dist/modules/components/phoneInput/phoneInputContainer/index.js +15 -0
- package/dist/modules/components/phoneInput/phoneInputContainer/index.js.map +1 -0
- package/dist/modules/components/phoneInput/phoneInputContainer/styles.css +1 -0
- package/dist/modules/components/phoneInput/phoneInputCountriesOverlay/index.js +14 -0
- package/dist/modules/components/phoneInput/phoneInputCountriesOverlay/index.js.map +1 -0
- package/dist/modules/components/phoneInput/phoneInputCountriesOverlay/styles.css +1 -0
- package/dist/modules/components/phoneInput/phoneInputCountryOption/index.js +26 -0
- package/dist/modules/components/phoneInput/phoneInputCountryOption/index.js.map +1 -0
- package/dist/modules/components/phoneInput/phoneInputCountryOption/styles.css +1 -0
- package/dist/modules/components/phoneInput/phoneInputCountryOptionsContainer/index.js +36 -0
- package/dist/modules/components/phoneInput/phoneInputCountryOptionsContainer/index.js.map +1 -0
- package/dist/modules/components/phoneInput/phoneInputCountryOptionsContainer/styles.css +1 -0
- package/dist/modules/components/phoneInput/phoneInputCountrySelector/index.js +28 -0
- package/dist/modules/components/phoneInput/phoneInputCountrySelector/index.js.map +1 -0
- package/dist/modules/components/phoneInput/phoneInputCountrySelector/styles.css +1 -0
- package/dist/modules/components/phoneInput/phoneInputMask/index.js +55 -0
- package/dist/modules/components/phoneInput/phoneInputMask/index.js.map +1 -0
- package/dist/modules/components/phoneInput/phoneInputMask/style.css +1 -0
- package/dist/modules/components/phoneInput/styles.css +19 -0
- package/dist/modules/components/popover/index.js +32 -0
- package/dist/modules/components/popover/index.js.map +1 -0
- package/dist/modules/components/popover/styles.css +1 -0
- package/dist/modules/components/radio/radioBox/index.js +27 -0
- package/dist/modules/components/radio/radioBox/index.js.map +1 -0
- package/dist/modules/components/radio/radioBox/styles.css +1 -0
- package/dist/modules/components/radio/radioContext.js +24 -0
- package/dist/modules/components/radio/radioContext.js.map +1 -0
- package/dist/modules/components/radio/radioGroup/index.js +44 -0
- package/dist/modules/components/radio/radioGroup/index.js.map +1 -0
- package/dist/modules/components/radio/radioGroup/styles.css +7 -0
- package/dist/modules/components/richText/blockButton/index.js +23 -0
- package/dist/modules/components/richText/blockButton/index.js.map +1 -0
- package/dist/modules/components/richText/blockButton/styles.css +1 -0
- package/dist/modules/components/richText/element/index.js +75 -0
- package/dist/modules/components/richText/element/index.js.map +1 -0
- package/dist/modules/components/richText/element/styles.css +1 -0
- package/dist/modules/components/richText/index.js +144 -0
- package/dist/modules/components/richText/index.js.map +1 -0
- package/dist/modules/components/richText/insertImage/index.js +97 -0
- package/dist/modules/components/richText/insertImage/index.js.map +1 -0
- package/dist/modules/components/richText/insertImage/styles.css +1 -0
- package/dist/modules/components/richText/insertVideo/index.js +88 -0
- package/dist/modules/components/richText/insertVideo/index.js.map +1 -0
- package/dist/modules/components/richText/insertVideo/styles.css +1 -0
- package/dist/modules/components/richText/leaf/index.js +12 -0
- package/dist/modules/components/richText/leaf/index.js.map +1 -0
- package/dist/modules/components/richText/markButton/index.js +22 -0
- package/dist/modules/components/richText/markButton/index.js.map +1 -0
- package/dist/modules/components/richText/markButton/styles.css +1 -0
- package/dist/modules/components/richText/styles.css +67 -0
- package/dist/modules/components/richText/toolbar/index.js +13 -0
- package/dist/modules/components/richText/toolbar/index.js.map +1 -0
- package/dist/modules/components/richText/toolbar/styles.css +1 -0
- package/dist/modules/components/searchPlaces.js +60 -0
- package/dist/modules/components/searchPlaces.js.map +1 -0
- package/dist/modules/components/select/index.js +115 -0
- package/dist/modules/components/select/index.js.map +1 -0
- package/dist/modules/components/select/selectChevron/index.js +21 -0
- package/dist/modules/components/select/selectChevron/index.js.map +1 -0
- package/dist/modules/components/select/selectChevron/styles.css +1 -0
- package/dist/modules/components/select/selectContainer/index.js +16 -0
- package/dist/modules/components/select/selectContainer/index.js.map +1 -0
- package/dist/modules/components/select/selectContainer/styles.css +1 -0
- package/dist/modules/components/select/selectContent/index.js +14 -0
- package/dist/modules/components/select/selectContent/index.js.map +1 -0
- package/dist/modules/components/select/selectContent/styles.css +1 -0
- package/dist/modules/components/select/selectOption/index.js +21 -0
- package/dist/modules/components/select/selectOption/index.js.map +1 -0
- package/dist/modules/components/select/selectOption/styles.css +1 -0
- package/dist/modules/components/select/selectOptionsContainer/index.js +38 -0
- package/dist/modules/components/select/selectOptionsContainer/index.js.map +1 -0
- package/dist/modules/components/select/selectOptionsContainer/styles.css +1 -0
- package/dist/modules/components/select/selectOverlay/index.js +14 -0
- package/dist/modules/components/select/selectOverlay/index.js.map +1 -0
- package/dist/modules/components/select/selectOverlay/styles.css +1 -0
- package/dist/modules/components/select/selectSpinner/index.js +16 -0
- package/dist/modules/components/select/selectSpinner/index.js.map +1 -0
- package/dist/modules/components/select/selectSpinner/styles.css +1 -0
- package/dist/modules/components/select/styles.css +29 -0
- package/dist/modules/components/slider/index.js +46 -0
- package/dist/modules/components/slider/index.js.map +1 -0
- package/dist/modules/components/slider/styles.css +1 -0
- package/dist/modules/components/switch/index.js +38 -0
- package/dist/modules/components/switch/index.js.map +1 -0
- package/dist/modules/components/switch/styles.css +7 -0
- package/dist/modules/components/tab/tabButton/index.js +22 -0
- package/dist/modules/components/tab/tabButton/index.js.map +1 -0
- package/dist/modules/components/tab/tabButton/styles.css +1 -0
- package/dist/modules/components/tab/tabContainer/index.js +25 -0
- package/dist/modules/components/tab/tabContainer/index.js.map +1 -0
- package/dist/modules/components/tab/tabContainer/styles.css +1 -0
- package/dist/modules/components/tab/tabContext.js +26 -0
- package/dist/modules/components/tab/tabContext.js.map +1 -0
- package/dist/modules/components/table/tableBody/index.js +22 -0
- package/dist/modules/components/table/tableBody/index.js.map +1 -0
- package/dist/modules/components/table/tableBody/styles.css +1 -0
- package/dist/modules/components/table/tableCaption/index.js +18 -0
- package/dist/modules/components/table/tableCaption/index.js.map +1 -0
- package/dist/modules/components/table/tableCaption/styles.css +1 -0
- package/dist/modules/components/table/tableContainer/index.js +15 -0
- package/dist/modules/components/table/tableContainer/index.js.map +1 -0
- package/dist/modules/components/table/tableContainer/styles.css +1 -0
- package/dist/modules/components/table/tableFooter/index.js +21 -0
- package/dist/modules/components/table/tableFooter/index.js.map +1 -0
- package/dist/modules/components/table/tableFooter/styles.css +1 -0
- package/dist/modules/components/table/tableHeader/index.js +15 -0
- package/dist/modules/components/table/tableHeader/index.js.map +1 -0
- package/dist/modules/components/table/tableHeader/styles.css +1 -0
- package/dist/modules/components/textarea/index.js +54 -0
- package/dist/modules/components/textarea/index.js.map +1 -0
- package/dist/modules/components/textarea/styles.css +7 -0
- package/dist/modules/components/tooltip/index.js +37 -0
- package/dist/modules/components/tooltip/index.js.map +1 -0
- package/dist/modules/components/tooltip/styles.css +1 -0
- package/dist/modules/hooks/useAutomation.js +47 -0
- package/dist/modules/hooks/useAutomation.js.map +1 -0
- package/dist/modules/hooks/useDrawer.js +20 -0
- package/dist/modules/hooks/useDrawer.js.map +1 -0
- package/dist/modules/hooks/useForm.js +10 -0
- package/dist/modules/hooks/useForm.js.map +1 -0
- package/dist/modules/hooks/useHydrated.js +12 -0
- package/dist/modules/hooks/useHydrated.js.map +1 -0
- package/dist/modules/hooks/useModal.js +20 -0
- package/dist/modules/hooks/useModal.js.map +1 -0
- package/dist/modules/hooks/useScopedParams.js +20 -0
- package/dist/modules/hooks/useScopedParams.js.map +1 -0
- package/dist/modules/hooks/useScrollLock.js +23 -0
- package/dist/modules/hooks/useScrollLock.js.map +1 -0
- package/dist/modules/hooks/useSearchAutomation.js +36 -0
- package/dist/modules/hooks/useSearchAutomation.js.map +1 -0
- package/dist/modules/hooks/useSlider.js +16 -0
- package/dist/modules/hooks/useSlider.js.map +1 -0
- package/dist/modules/hooks/useToast.js +12 -0
- package/dist/modules/hooks/useToast.js.map +1 -0
- package/dist/modules/providers/drawerProvider.js +38 -0
- package/dist/modules/providers/drawerProvider.js.map +1 -0
- package/dist/modules/providers/formProvider.js +15 -0
- package/dist/modules/providers/formProvider.js.map +1 -0
- package/dist/modules/providers/modalProvider.js +42 -0
- package/dist/modules/providers/modalProvider.js.map +1 -0
- package/dist/modules/providers/placesProvider.js +20 -0
- package/dist/modules/providers/placesProvider.js.map +1 -0
- package/dist/modules/providers/toastProvider.js +49 -0
- package/dist/modules/providers/toastProvider.js.map +1 -0
- package/dist/modules/services/extractTextFromNode.js +9 -0
- package/dist/modules/services/extractTextFromNode.js.map +1 -0
- package/dist/modules/services/fieldTemplate.js +25 -0
- package/dist/modules/services/fieldTemplate.js.map +1 -0
- package/dist/modules/services/iconRenderer.js +17 -0
- package/dist/modules/services/iconRenderer.js.map +1 -0
- package/dist/modules/services/isBlockActive.js +15 -0
- package/dist/modules/services/isBlockActive.js.map +1 -0
- package/dist/modules/services/isMarkActive.js +10 -0
- package/dist/modules/services/isMarkActive.js.map +1 -0
- package/dist/modules/services/maskCurrencyValues.js +15 -0
- package/dist/modules/services/maskCurrencyValues.js.map +1 -0
- package/dist/modules/services/toHtml.js +9 -0
- package/dist/modules/services/toHtml.js.map +1 -0
- package/dist/modules/services/toRichTextValue.js +11 -0
- package/dist/modules/services/toRichTextValue.js.map +1 -0
- package/dist/modules/services/toggleBlock.js +23 -0
- package/dist/modules/services/toggleBlock.js.map +1 -0
- package/dist/modules/services/toggleMark.js +10 -0
- package/dist/modules/services/toggleMark.js.map +1 -0
- package/dist/modules/templates/badResponses.js +16 -0
- package/dist/modules/templates/badResponses.js.map +1 -0
- package/dist/modules/templates/richTextTemplates.js +19 -0
- package/dist/modules/templates/richTextTemplates.js.map +1 -0
- package/dist/modules/templates/successResponses.js +11 -0
- package/dist/modules/templates/successResponses.js.map +1 -0
- package/dist/modules/utils/phoneInputUtilities.js +24 -0
- package/dist/modules/utils/phoneInputUtilities.js.map +1 -0
- package/dist/modules/utils/richTextUtilities.js +92 -0
- package/dist/modules/utils/richTextUtilities.js.map +1 -0
- package/dist/providers/drawerProvider.d.ts +18 -84
- package/dist/providers/drawerProvider.d.ts.map +1 -1
- package/dist/providers/formProvider.d.ts +20 -56
- package/dist/providers/formProvider.d.ts.map +1 -1
- package/dist/providers/modalProvider.d.ts +19 -80
- package/dist/providers/modalProvider.d.ts.map +1 -1
- package/dist/providers/placesProvider.d.ts +18 -13
- package/dist/providers/placesProvider.d.ts.map +1 -1
- package/dist/providers/toastProvider.d.ts +13 -24
- package/dist/providers/toastProvider.d.ts.map +1 -1
- package/dist/services/extractTextFromNode.d.ts +1 -1
- package/dist/services/extractTextFromNode.d.ts.map +1 -1
- package/dist/services/fieldTemplate.d.ts +14 -0
- package/dist/services/fieldTemplate.d.ts.map +1 -0
- package/dist/services/iconRenderer.d.ts +2 -2
- package/dist/services/iconRenderer.d.ts.map +1 -1
- package/dist/services/isBlockActive.d.ts +1 -1
- package/dist/services/isBlockActive.d.ts.map +1 -1
- package/dist/services/isMarkActive.d.ts +1 -1
- package/dist/services/isMarkActive.d.ts.map +1 -1
- package/dist/services/maskCurrencyValues.d.ts.map +1 -1
- package/dist/services/toHtml.d.ts +12 -11
- package/dist/services/toHtml.d.ts.map +1 -1
- package/dist/services/toRichTextValue.d.ts +12 -18
- package/dist/services/toRichTextValue.d.ts.map +1 -1
- package/dist/services/toggleBlock.d.ts +1 -1
- package/dist/services/toggleBlock.d.ts.map +1 -1
- package/dist/services/toggleMark.d.ts +1 -1
- package/dist/services/toggleMark.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/templates/richTextTemplates.d.ts +1 -1
- package/dist/templates/richTextTemplates.d.ts.map +1 -1
- package/dist/types/richTextTypes.d.ts +14 -3
- package/dist/types/richTextTypes.d.ts.map +1 -1
- package/dist/utils/phoneInputUtilities.d.ts +1 -1713
- package/dist/utils/phoneInputUtilities.d.ts.map +1 -1
- package/dist/utils/richTextUtilities.d.ts +1 -1
- package/dist/utils/richTextUtilities.d.ts.map +1 -1
- package/package.json +1084 -27
- package/styles.d.ts +3 -0
- package/dist/bundle.js +0 -18048
- package/dist/bundle.umd.cjs +0 -219
- package/dist/components/alert/alertContainer/index.js +0 -91
- package/dist/components/alert/alertContent/index.js +0 -46
- package/dist/components/alert/alertDescription/index.js +0 -48
- package/dist/components/alert/alertIcon/index.js +0 -61
- package/dist/components/alert/alertTitle/index.js +0 -42
- package/dist/components/audioPlayer/index.js +0 -115
- package/dist/components/audioUpload/hasFileContent/index.js +0 -26
- package/dist/components/audioUpload/index.js +0 -120
- package/dist/components/audioUpload/noFileContent/index.js +0 -29
- package/dist/components/badge/index.js +0 -49
- package/dist/components/button/index.js +0 -61
- package/dist/components/cardTab/cardTabButton/index.js +0 -80
- package/dist/components/cardTab/cardTabContainer/index.js +0 -88
- package/dist/components/cardTab/cardTabContext.js +0 -10
- package/dist/components/checkbox/index.js +0 -87
- package/dist/components/clientOnly.js +0 -86
- package/dist/components/currencyInput/index.js +0 -141
- package/dist/components/divider/index.js +0 -45
- package/dist/components/drawer/drawerContainer/index.js +0 -75
- package/dist/components/drawer/drawerContext.js +0 -10
- package/dist/components/drawer/drawerHeader/index.js +0 -58
- package/dist/components/fieldError/index.js +0 -33
- package/dist/components/fieldLabel/index.js +0 -39
- package/dist/components/fieldWrapper/index.js +0 -42
- package/dist/components/fileUpload/hasFileContent/index.js +0 -34
- package/dist/components/fileUpload/index.js +0 -127
- package/dist/components/fileUpload/noFileContent/index.js +0 -29
- package/dist/components/iconButton/index.js +0 -41
- package/dist/components/imageUpload/hasFileContent/index.js +0 -24
- package/dist/components/imageUpload/index.js +0 -149
- package/dist/components/imageUpload/noFileContent/index.js +0 -29
- package/dist/components/input/index.js +0 -114
- package/dist/components/mapView/index.js +0 -16
- package/dist/components/maskedInput/index.js +0 -131
- package/dist/components/modal/modalContainer/index.js +0 -82
- package/dist/components/modal/modalContext.js +0 -10
- package/dist/components/modal/modalFooter/index.js +0 -72
- package/dist/components/modal/modalHeader/index.js +0 -69
- package/dist/components/multiSelect/index.js +0 -169
- package/dist/components/multiSelect/multiSelectChevron/index.js +0 -18
- package/dist/components/multiSelect/multiSelectContainer/index.js +0 -11
- package/dist/components/multiSelect/multiSelectContent/index.js +0 -8
- package/dist/components/multiSelect/multiSelectMark/index.js +0 -11
- package/dist/components/multiSelect/multiSelectOption/index.js +0 -10
- package/dist/components/multiSelect/multiSelectOptionsContainer/index.js +0 -44
- package/dist/components/multiSelect/multiSelectOverlay/index.js +0 -9
- package/dist/components/multiSelect/multiSelectSpinner/index.js +0 -10
- package/dist/components/pagination/chevronButton/index.js +0 -9
- package/dist/components/pagination/currentButton/index.js +0 -6
- package/dist/components/pagination/index.js +0 -37
- package/dist/components/pagination/pageButton/index.js +0 -7
- package/dist/components/pagination/paginationService.js +0 -62
- package/dist/components/pagination/spread/index.js +0 -7
- package/dist/components/phoneInput/index.js +0 -205
- package/dist/components/phoneInput/phoneInputContainer/index.js +0 -11
- package/dist/components/phoneInput/phoneInputCountriesOverlay/index.js +0 -9
- package/dist/components/phoneInput/phoneInputCountryOption/index.js +0 -10
- package/dist/components/phoneInput/phoneInputCountryOptionsContainer/index.js +0 -40
- package/dist/components/phoneInput/phoneInputCountrySelector/index.js +0 -9
- package/dist/components/phoneInput/phoneInputMask/index.js +0 -34
- package/dist/components/popover/index.js +0 -151
- package/dist/components/radio/radioBox/index.js +0 -99
- package/dist/components/radio/radioContext.js +0 -11
- package/dist/components/radio/radioGroup/index.js +0 -100
- package/dist/components/richText/blockButton/index.js +0 -18
- package/dist/components/richText/element/index.js +0 -24
- package/dist/components/richText/index.js +0 -149
- package/dist/components/richText/insertImage/index.js +0 -33
- package/dist/components/richText/leaf/index.js +0 -13
- package/dist/components/richText/markButton/index.js +0 -16
- package/dist/components/richText/toolbar/index.js +0 -6
- package/dist/components/searchPlaces.js +0 -91
- package/dist/components/select/index.js +0 -168
- package/dist/components/select/selectChevron/index.js +0 -18
- package/dist/components/select/selectContainer/index.js +0 -11
- package/dist/components/select/selectContent/index.js +0 -8
- package/dist/components/select/selectOption/index.js +0 -10
- package/dist/components/select/selectOptionsContainer/index.js +0 -44
- package/dist/components/select/selectOverlay/index.js +0 -9
- package/dist/components/select/selectSpinner/index.js +0 -10
- package/dist/components/slider/index.js +0 -97
- package/dist/components/switch/index.js +0 -100
- package/dist/components/tab/tabButton/index.js +0 -80
- package/dist/components/tab/tabContainer/index.js +0 -88
- package/dist/components/tab/tabContext.js +0 -10
- package/dist/components/table/tableBody/index.js +0 -69
- package/dist/components/table/tableCaption/index.js +0 -64
- package/dist/components/table/tableContainer/index.js +0 -66
- package/dist/components/table/tableFooter/index.js +0 -47
- package/dist/components/table/tableHeader/index.js +0 -46
- package/dist/components/textarea/index.js +0 -128
- package/dist/components/tooltip/index.js +0 -135
- package/dist/hooks/useAutomation.js +0 -67
- package/dist/hooks/useDrawer.js +0 -20
- package/dist/hooks/useForm.js +0 -52
- package/dist/hooks/useHydrated.js +0 -81
- package/dist/hooks/useModal.js +0 -20
- package/dist/hooks/useScopedParams.js +0 -107
- package/dist/hooks/useScrollLock.js +0 -68
- package/dist/hooks/useSlider.js +0 -49
- package/dist/hooks/useToast.js +0 -72
- package/dist/providers/drawerProvider.js +0 -120
- package/dist/providers/formProvider.js +0 -69
- package/dist/providers/modalProvider.js +0 -119
- package/dist/providers/placesProvider.js +0 -35
- package/dist/providers/toastProvider.js +0 -73
- package/dist/services/extractTextFromNode.js +0 -5
- package/dist/services/iconRenderer.js +0 -13
- package/dist/services/isBlockActive.js +0 -14
- package/dist/services/isMarkActive.js +0 -6
- package/dist/services/maskCurrencyValues.js +0 -23
- package/dist/services/toHtml.js +0 -21
- package/dist/services/toRichTextValue.js +0 -40
- package/dist/services/toggleBlock.js +0 -32
- package/dist/services/toggleMark.js +0 -10
- package/dist/templates/badResponses.js +0 -12
- package/dist/templates/richTextTemplates.js +0 -12
- package/dist/templates/successResponses.js +0 -2
- package/dist/types/richTextTypes.js +0 -1
- package/dist/utils/phoneInputUtilities.js +0 -99
- package/dist/utils/richTextUtilities.js +0 -87
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { useForm as e } from "../../hooks/useForm.js";
|
|
2
|
+
import { FieldError as t } from "../fieldError/index.js";
|
|
3
|
+
import { FieldLabel as n } from "../fieldLabel/index.js";
|
|
4
|
+
import { FieldWrapper as r } from "../fieldWrapper/index.js";
|
|
5
|
+
/* empty css */
|
|
6
|
+
import { useId as i, useRef as a, useState as o } from "react";
|
|
7
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
8
|
+
//#region src/components/textarea/index.tsx
|
|
9
|
+
function l(l) {
|
|
10
|
+
let { variant: u = "solid", size: d = "md", className: f, errorMessage: p, disabled: m = !1, readOnly: h = !1, label: g, showAsterisk: _, name: v, onFocus: y, onBlur: b, title: x, style: S, value: C, defaultValue: w, placeholder: T, id: E, ...D } = l, { fieldErrors: O } = e(), [k, A] = o(!1), j = a(null), M = i(), N = E || M, P = p || O?.[v], F = `arkynTextarea ${u} ${d} ${m || h ? "opacityTrue" : "opacityFalse"} ${P ? "errorTrue" : "errorFalse"} ${k ? "focusedTrue" : "focusedFalse"}`, I = m ? void 0 : C;
|
|
11
|
+
function L() {
|
|
12
|
+
m || !j?.current || (A(!0), j.current.focus());
|
|
13
|
+
}
|
|
14
|
+
function R(e) {
|
|
15
|
+
A(!0), y && y(e);
|
|
16
|
+
}
|
|
17
|
+
function z(e) {
|
|
18
|
+
A(!1), b && b(e);
|
|
19
|
+
}
|
|
20
|
+
return /* @__PURE__ */ c(r, {
|
|
21
|
+
className: f,
|
|
22
|
+
children: [
|
|
23
|
+
g && /* @__PURE__ */ s(n, {
|
|
24
|
+
htmlFor: N,
|
|
25
|
+
showAsterisk: _,
|
|
26
|
+
children: g
|
|
27
|
+
}),
|
|
28
|
+
/* @__PURE__ */ s("section", {
|
|
29
|
+
title: x,
|
|
30
|
+
style: S,
|
|
31
|
+
onClick: L,
|
|
32
|
+
className: F,
|
|
33
|
+
children: /* @__PURE__ */ s("textarea", {
|
|
34
|
+
id: N,
|
|
35
|
+
disabled: m,
|
|
36
|
+
readOnly: h,
|
|
37
|
+
ref: j,
|
|
38
|
+
name: v,
|
|
39
|
+
onFocus: R,
|
|
40
|
+
onBlur: z,
|
|
41
|
+
defaultValue: I === void 0 ? w || "" : void 0,
|
|
42
|
+
placeholder: m && C || T,
|
|
43
|
+
value: I,
|
|
44
|
+
...D
|
|
45
|
+
})
|
|
46
|
+
}),
|
|
47
|
+
P && /* @__PURE__ */ s(t, { children: P })
|
|
48
|
+
]
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
52
|
+
export { l as Textarea };
|
|
53
|
+
|
|
54
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/textarea/index.tsx"],"sourcesContent":["import {\n\ttype FocusEvent,\n\ttype TextareaHTMLAttributes,\n\tuseId,\n\tuseRef,\n\tuseState,\n} from \"react\";\n\nimport { useForm } from \"../../hooks/useForm\";\nimport { FieldError } from \"../fieldError\";\nimport { FieldLabel } from \"../fieldLabel\";\nimport { FieldWrapper } from \"../fieldWrapper\";\nimport \"./styles.css\";\n\ntype TextareaProps = Omit<\n\tTextareaHTMLAttributes<HTMLTextAreaElement>,\n\t\"name\" | \"value\" | \"defaultValue\"\n> & {\n\t/** Field name for form submission. Required. */\n\tname: string;\n\t/** Optional label text displayed above the textarea. */\n\tlabel?: string;\n\t/** Displays an asterisk on the label to signal a required field. */\n\tshowAsterisk?: boolean;\n\t/** Validation error message displayed below the textarea. */\n\terrorMessage?: string;\n\t/**\n\t * Textarea size.\n\t * @default \"md\"\n\t */\n\tsize?: \"md\" | \"lg\";\n\t/**\n\t * Visual style variant.\n\t * - `solid`: filled background.\n\t * - `outline`: bordered, transparent background.\n\t * @default \"solid\"\n\t */\n\tvariant?: \"solid\" | \"outline\";\n\t/** Controlled value. */\n\tvalue?: string;\n\t/** Uncontrolled default value. */\n\tdefaultValue?: string;\n};\n\n/**\n * Textarea — multi-line text input with label, validation, and form integration.\n *\n * Integrates with `useForm` to display validation errors by field name.\n *\n * @param props.name - Field name for form submission. Required.\n * @param props.label - Label text displayed above the textarea.\n * @param props.showAsterisk - Appends `*` to the label.\n * @param props.errorMessage - Validation error message.\n * @param props.size - Textarea size (`md` | `lg`). Default: \"md\"\n * @param props.variant - Visual style variant. Default: \"solid\"\n *\n * **...Other valid HTML properties for `<textarea>`**\n *\n * @returns Textarea JSX element wrapped in `FieldWrapper`.\n *\n * @example\n * ```tsx\n * // Basic\n * <Textarea name=\"description\" placeholder=\"Enter description...\" />\n *\n * // With label and validation\n * <Textarea\n * name=\"bio\"\n * label=\"Biography\"\n * showAsterisk\n * placeholder=\"Tell us about yourself\"\n * errorMessage=\"Biography is required\"\n * />\n *\n * // Controlled with custom rows\n * <Textarea\n * name=\"message\"\n * label=\"Message\"\n * value={message}\n * onChange={(e) => setMessage(e.target.value)}\n * rows={5}\n * size=\"lg\"\n * variant=\"outline\"\n * />\n * ```\n */\n\nfunction Textarea(props: TextareaProps) {\n\tconst {\n\t\tvariant = \"solid\",\n\t\tsize = \"md\",\n\t\tclassName: wrapperClassName,\n\t\terrorMessage: baseErrorMessage,\n\t\tdisabled = false,\n\t\treadOnly = false,\n\t\tlabel,\n\t\tshowAsterisk,\n\t\tname,\n\t\tonFocus,\n\t\tonBlur,\n\t\ttitle,\n\t\tstyle,\n\t\tvalue,\n\t\tdefaultValue,\n\t\tplaceholder,\n\t\tid,\n\t\t...rest\n\t} = props;\n\n\tconst { fieldErrors } = useForm();\n\tconst [isFocused, setIsFocused] = useState(false);\n\tconst textareaRef = useRef<HTMLTextAreaElement>(null);\n\tconst generatedId = useId();\n\tconst textareaId = id || generatedId;\n\n\tconst errorMessage = baseErrorMessage || fieldErrors?.[name];\n\tconst isError = !!errorMessage;\n\n\tconst errorClass = isError ? \"errorTrue\" : \"errorFalse\";\n\tconst opacityClass = disabled || readOnly ? \"opacityTrue\" : \"opacityFalse\";\n\tconst focusedClass = isFocused ? \"focusedTrue\" : \"focusedFalse\";\n\n\tconst className = `arkynTextarea ${variant} ${size} ${opacityClass} ${errorClass} ${focusedClass}`;\n\tconst domValue = disabled ? undefined : value;\n\n\tfunction handleSectionClick() {\n\t\tif (disabled || !textareaRef?.current) return;\n\t\tsetIsFocused(true);\n\t\ttextareaRef.current.focus();\n\t}\n\n\tfunction handleFocus(e: FocusEvent<HTMLTextAreaElement>) {\n\t\tsetIsFocused(true);\n\t\tif (onFocus) onFocus(e);\n\t}\n\n\tfunction handleBlur(e: FocusEvent<HTMLTextAreaElement>) {\n\t\tsetIsFocused(false);\n\t\tif (onBlur) onBlur(e);\n\t}\n\n\treturn (\n\t\t<FieldWrapper className={wrapperClassName}>\n\t\t\t{label && (\n\t\t\t\t<FieldLabel htmlFor={textareaId} showAsterisk={showAsterisk}>\n\t\t\t\t\t{label}\n\t\t\t\t</FieldLabel>\n\t\t\t)}\n\n\t\t\t<section\n\t\t\t\ttitle={title}\n\t\t\t\tstyle={style}\n\t\t\t\tonClick={handleSectionClick}\n\t\t\t\tclassName={className}\n\t\t\t>\n\t\t\t\t<textarea\n\t\t\t\t\tid={textareaId}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\tref={textareaRef}\n\t\t\t\t\tname={name}\n\t\t\t\t\tonFocus={handleFocus}\n\t\t\t\t\tonBlur={handleBlur}\n\t\t\t\t\tdefaultValue={domValue === undefined ? defaultValue || \"\" : undefined}\n\t\t\t\t\tplaceholder={disabled ? value || placeholder : placeholder}\n\t\t\t\t\tvalue={domValue}\n\t\t\t\t\t{...rest}\n\t\t\t\t/>\n\t\t\t</section>\n\t\t\t{errorMessage && <FieldError>{errorMessage}</FieldError>}\n\t\t</FieldWrapper>\n\t);\n}\n\nexport { Textarea };\n"],"mappings":";;;;;;;;AAuFA,SAAS,EAAS,GAAsB;CACvC,IAAM,EACL,aAAU,SACV,UAAO,MACP,WAAW,GACX,cAAc,GACd,cAAW,IACX,cAAW,IACX,UACA,iBACA,SACA,YACA,WACA,UACA,UACA,UACA,iBACA,gBACA,OACA,GAAG,MACA,GAEE,EAAE,mBAAgB,EAAQ,GAC1B,CAAC,GAAW,KAAgB,EAAS,EAAK,GAC1C,IAAc,EAA4B,IAAI,GAC9C,IAAc,EAAM,GACpB,IAAa,KAAM,GAEnB,IAAe,KAAoB,IAAc,IAOjD,IAAY,iBAAiB,EAAQ,GAAG,EAAK,GAH9B,KAAY,IAAW,gBAAgB,eAGO,GANjD,IAEW,cAAc,aAIsC,GAF5D,IAAY,gBAAgB,kBAG3C,IAAW,IAAW,KAAA,IAAY;CAExC,SAAS,IAAqB;EACzB,KAAY,CAAC,GAAa,YAC9B,EAAa,EAAI,GACjB,EAAY,QAAQ,MAAM;CAC3B;CAEA,SAAS,EAAY,GAAoC;EAExD,AADA,EAAa,EAAI,GACb,KAAS,EAAQ,CAAC;CACvB;CAEA,SAAS,EAAW,GAAoC;EAEvD,AADA,EAAa,EAAK,GACd,KAAQ,EAAO,CAAC;CACrB;CAEA,OACC,kBAAC,GAAD;EAAc,WAAW;YAAzB;GACE,KACA,kBAAC,GAAD;IAAY,SAAS;IAA0B;cAC7C;GACU,CAAA;GAGb,kBAAC,WAAD;IACQ;IACA;IACP,SAAS;IACE;cAEX,kBAAC,YAAD;KACC,IAAI;KACM;KACA;KACV,KAAK;KACC;KACN,SAAS;KACT,QAAQ;KACR,cAAc,MAAa,KAAA,IAAY,KAAgB,KAAK,KAAA;KAC5D,aAAa,KAAW,KAAuB;KAC/C,OAAO;KACP,GAAI;IACJ,CAAA;GACO,CAAA;GACR,KAAgB,kBAAC,GAAD,EAAA,UAAa,EAAyB,CAAA;EAC1C;;AAEhB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
@layer arkyn{.arkynTextarea{border:1px solid #0000;border-radius:8px;outline:1px solid #0000;align-items:center;gap:8px;width:100%;padding:16px;display:flex;position:relative}.arkynTextarea:hover{cursor:text}.arkynTextarea textarea{resize:none;width:100%;color:var(--text-heading,#09090b);background:0 0;border:none;outline:none}.arkynTextarea textarea::placeholder{color:var(--text-muted,#a1a1aa);line-height:130%}.arkynTextarea.opacityTrue{opacity:.5}.arkynTextarea.solid{border-color:var(--border,#e2e8f0);background-color:var(--input-background,#fafafa)}.arkynTextarea.solid.errorTrue{border-color:rgb(var(--spotlight-danger,244, 63, 94));outline-color:rgb(var(--spotlight-danger,244, 63, 94))}.arkynTextarea:not(.opacityTrue).solid.focusedTrue{border-color:rgb(var(--spotlight-primary,17, 109, 220));outline-color:rgb(var(--spotlight-primary,17, 109, 220))}.arkynTextarea.outline{border-color:var(--border,#e2e8f0);background-color:var(--background-foreground,#fff)}.arkynTextarea.outline.errorTrue{border-color:rgb(var(--spotlight-danger,244, 63, 94));outline-color:rgb(var(--spotlight-danger,244, 63, 94))}.arkynTextarea:not(.opacityTrue).outline.focusedTrue{border-color:rgb(var(--spotlight-primary,17, 109, 220));outline-color:rgb(var(--spotlight-primary,17, 109, 220))}.arkynTextarea.md textarea,.arkynTextarea.md textarea::placeholder{font-size:14px;font-weight:400;line-height:14px}.arkynTextarea.lg textarea,.arkynTextarea.lg textarea::placeholder{font-size:16px;font-weight:400;line-height:16px}}
|
|
2
|
+
|
|
3
|
+
@layer arkyn{.arkynFieldError{color:rgb(var(--spotlight-danger,244, 63, 94));font-size:12px;font-weight:600;line-height:12px}}
|
|
4
|
+
|
|
5
|
+
@layer arkyn{.arkynFieldLabel{color:var(--text-body,#52525b);font-size:14px;font-weight:600;line-height:19.07px}.arkynFieldLabel.asteriskTrue:before{content:"* ";text-align:left;color:rgb(var(--spotlight-danger,244, 63, 94));font-size:12px;font-weight:600;line-height:16.34px}}
|
|
6
|
+
|
|
7
|
+
@layer arkyn{.arkynFieldWrapper{gap:6px;height:max-content;display:flex}.arkynFieldWrapper.horizontal{flex-direction:row;align-items:center}.arkynFieldWrapper.horizontalReverse{flex-direction:row-reverse;align-items:center;margin-right:auto}.arkynFieldWrapper.vertical{flex-direction:column;align-items:flex-start}}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { useEffect as e, useId as t, useRef as n, useState as r } from "react";
|
|
3
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/tooltip/index.tsx
|
|
5
|
+
function o(o) {
|
|
6
|
+
let { text: s, size: c = "lg", children: l, orientation: u = "top", className: d = "", ...f } = o, p = t(), m = n(null), [h, g] = r(u);
|
|
7
|
+
return e(() => {
|
|
8
|
+
let e = () => {
|
|
9
|
+
if (!m.current) return;
|
|
10
|
+
let e = document.getElementById(p);
|
|
11
|
+
e && (g(u), requestAnimationFrame(() => {
|
|
12
|
+
let t = e.getBoundingClientRect(), n = window.innerWidth, r = window.innerHeight, i = u;
|
|
13
|
+
u === "left" && t.left < 0 ? i = "right" : u === "right" && t.right > n ? i = "left" : u === "top" && t.top < 0 ? i = "bottom" : u === "bottom" && t.bottom > r && (i = "top"), i === "right" && t.right > n ? i = "left" : i === "left" && t.left < 0 ? i = "right" : i === "bottom" && t.bottom > r ? i = "top" : i === "top" && t.top < 0 && (i = "bottom"), g(i);
|
|
14
|
+
}));
|
|
15
|
+
}, t = m.current;
|
|
16
|
+
if (!t) return;
|
|
17
|
+
let n = () => {
|
|
18
|
+
setTimeout(e, 1);
|
|
19
|
+
};
|
|
20
|
+
return t.addEventListener("mouseenter", n), window.addEventListener("resize", e), () => {
|
|
21
|
+
t.removeEventListener("mouseenter", n), window.removeEventListener("resize", e);
|
|
22
|
+
};
|
|
23
|
+
}, [u, p]), /* @__PURE__ */ a("div", {
|
|
24
|
+
className: `arkynTooltip ${c} ${h} ${d}`.trim(),
|
|
25
|
+
...f,
|
|
26
|
+
ref: m,
|
|
27
|
+
children: [l, /* @__PURE__ */ i("div", {
|
|
28
|
+
className: "arkynTooltipText",
|
|
29
|
+
id: p,
|
|
30
|
+
dangerouslySetInnerHTML: { __html: s }
|
|
31
|
+
})]
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
export { o as Tooltip };
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/tooltip/index.tsx"],"sourcesContent":["import {\n\ttype HTMLAttributes,\n\ttype ReactNode,\n\tuseEffect,\n\tuseId,\n\tuseRef,\n\tuseState,\n} from \"react\";\nimport \"./styles.css\";\n\ntype TooltipProps = Omit<HTMLAttributes<HTMLDivElement>, \"children\"> & {\n\t/** Text rendered inside the tooltip bubble. Supports inline HTML. Required. */\n\ttext: string;\n\t/** Element that triggers the tooltip on hover. Required. */\n\tchildren: ReactNode;\n\t/**\n\t * Preferred position of the tooltip relative to the trigger element.\n\t * Automatically flips to the opposite side if the tooltip would overflow the viewport.\n\t * @default \"top\"\n\t */\n\torientation?: \"top\" | \"right\" | \"bottom\" | \"left\";\n\t/**\n\t * Tooltip size.\n\t * @default \"lg\"\n\t */\n\tsize?: \"md\" | \"lg\";\n};\n\n/**\n * Tooltip — shows a contextual text bubble on hover with smart viewport-aware positioning.\n *\n * The tooltip automatically flips to the opposite side when it would overflow the viewport.\n *\n * @param props.text - Text (or HTML) to display in the tooltip. Required.\n * @param props.children - Trigger element. Required.\n * @param props.orientation - Preferred position relative to the trigger. Default: \"top\"\n * @param props.size - Tooltip size. Default: \"lg\"\n *\n * **...Other valid HTML properties for `<div>`**\n *\n * @returns Tooltip JSX element.\n *\n * @example\n * ```tsx\n * <Tooltip text=\"Save changes before leaving\">\n * <IconButton icon={SaveIcon} aria-label=\"Save\" />\n * </Tooltip>\n *\n * // Toolbar with bottom-oriented tooltips\n * <Tooltip text=\"Add item\" orientation=\"bottom\">\n * <IconButton icon={Plus} aria-label=\"Add\" />\n * </Tooltip>\n *\n * <Tooltip text=\"Delete\" orientation=\"bottom\" size=\"md\">\n * <IconButton icon={Trash2} aria-label=\"Delete\" scheme=\"danger\" />\n * </Tooltip>\n * ```\n */\n\nfunction Tooltip(props: TooltipProps) {\n\tconst {\n\t\ttext,\n\t\tsize = \"lg\",\n\t\tchildren,\n\t\torientation = \"top\",\n\t\tclassName: baseClassName = \"\",\n\t\t...rest\n\t} = props;\n\n\tconst tooltipId = useId();\n\tconst tooltipRef = useRef<HTMLDivElement>(null);\n\tconst [adjustedOrientation, setAdjustedOrientation] = useState(orientation);\n\n\tuseEffect(() => {\n\t\tconst checkTooltipPosition = () => {\n\t\t\tif (!tooltipRef.current) return;\n\t\t\tconst tooltipText = document.getElementById(tooltipId) as HTMLElement;\n\t\t\tif (!tooltipText) return;\n\n\t\t\tsetAdjustedOrientation(orientation);\n\n\t\t\trequestAnimationFrame(() => {\n\t\t\t\tconst rect = tooltipText.getBoundingClientRect();\n\t\t\t\tconst viewportWidth = window.innerWidth;\n\t\t\t\tconst viewportHeight = window.innerHeight;\n\n\t\t\t\tlet newOrientation = orientation;\n\n\t\t\t\tif (orientation === \"left\" && rect.left < 0) {\n\t\t\t\t\tnewOrientation = \"right\";\n\t\t\t\t} else if (orientation === \"right\" && rect.right > viewportWidth) {\n\t\t\t\t\tnewOrientation = \"left\";\n\t\t\t\t} else if (orientation === \"top\" && rect.top < 0) {\n\t\t\t\t\tnewOrientation = \"bottom\";\n\t\t\t\t} else if (orientation === \"bottom\" && rect.bottom > viewportHeight) {\n\t\t\t\t\tnewOrientation = \"top\";\n\t\t\t\t}\n\n\t\t\t\tif (newOrientation === \"right\" && rect.right > viewportWidth) {\n\t\t\t\t\tnewOrientation = \"left\";\n\t\t\t\t} else if (newOrientation === \"left\" && rect.left < 0) {\n\t\t\t\t\tnewOrientation = \"right\";\n\t\t\t\t} else if (\n\t\t\t\t\tnewOrientation === \"bottom\" &&\n\t\t\t\t\trect.bottom > viewportHeight\n\t\t\t\t) {\n\t\t\t\t\tnewOrientation = \"top\";\n\t\t\t\t} else if (newOrientation === \"top\" && rect.top < 0) {\n\t\t\t\t\tnewOrientation = \"bottom\";\n\t\t\t\t}\n\n\t\t\t\tsetAdjustedOrientation(newOrientation);\n\t\t\t});\n\t\t};\n\n\t\tconst tooltip = tooltipRef.current;\n\t\tif (!tooltip) return;\n\n\t\tconst handleMouseEnter = () => {\n\t\t\tsetTimeout(checkTooltipPosition, 1);\n\t\t};\n\n\t\ttooltip.addEventListener(\"mouseenter\", handleMouseEnter);\n\t\twindow.addEventListener(\"resize\", checkTooltipPosition);\n\n\t\treturn () => {\n\t\t\ttooltip.removeEventListener(\"mouseenter\", handleMouseEnter);\n\t\t\twindow.removeEventListener(\"resize\", checkTooltipPosition);\n\t\t};\n\t}, [orientation, tooltipId]);\n\n\tconst className = `arkynTooltip ${size} ${adjustedOrientation} ${baseClassName}`;\n\n\treturn (\n\t\t<div className={className.trim()} {...rest} ref={tooltipRef}>\n\t\t\t{children}\n\n\t\t\t<div\n\t\t\t\tclassName=\"arkynTooltipText\"\n\t\t\t\tid={tooltipId}\n\t\t\t\tdangerouslySetInnerHTML={{ __html: text }}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nexport { Tooltip };\n"],"mappings":";;;;AA2DA,SAAS,EAAQ,GAAqB;CACrC,IAAM,EACL,SACA,UAAO,MACP,aACA,iBAAc,OACd,WAAW,IAAgB,IAC3B,GAAG,MACA,GAEE,IAAY,EAAM,GAClB,IAAa,EAAuB,IAAI,GACxC,CAAC,GAAqB,KAA0B,EAAS,CAAW;CA8D1E,OA5DA,QAAgB;EACf,IAAM,UAA6B;GAClC,IAAI,CAAC,EAAW,SAAS;GACzB,IAAM,IAAc,SAAS,eAAe,CAAS;GAChD,MAEL,EAAuB,CAAW,GAElC,4BAA4B;IAC3B,IAAM,IAAO,EAAY,sBAAsB,GACzC,IAAgB,OAAO,YACvB,IAAiB,OAAO,aAE1B,IAAiB;IAyBrB,AAvBI,MAAgB,UAAU,EAAK,OAAO,IACzC,IAAiB,UACP,MAAgB,WAAW,EAAK,QAAQ,IAClD,IAAiB,SACP,MAAgB,SAAS,EAAK,MAAM,IAC9C,IAAiB,WACP,MAAgB,YAAY,EAAK,SAAS,MACpD,IAAiB,QAGd,MAAmB,WAAW,EAAK,QAAQ,IAC9C,IAAiB,SACP,MAAmB,UAAU,EAAK,OAAO,IACnD,IAAiB,UAEjB,MAAmB,YACnB,EAAK,SAAS,IAEd,IAAiB,QACP,MAAmB,SAAS,EAAK,MAAM,MACjD,IAAiB,WAGlB,EAAuB,CAAc;GACtC,CAAC;EACF,GAEM,IAAU,EAAW;EAC3B,IAAI,CAAC,GAAS;EAEd,IAAM,UAAyB;GAC9B,WAAW,GAAsB,CAAC;EACnC;EAKA,OAHA,EAAQ,iBAAiB,cAAc,CAAgB,GACvD,OAAO,iBAAiB,UAAU,CAAoB,SAEzC;GAEZ,AADA,EAAQ,oBAAoB,cAAc,CAAgB,GAC1D,OAAO,oBAAoB,UAAU,CAAoB;EAC1D;CACD,GAAG,CAAC,GAAa,CAAS,CAAC,GAK1B,kBAAC,OAAD;EAAK,WAAW,gBAHiB,EAAK,GAAG,EAAoB,GAAG,IAGtC,KAAK;EAAG,GAAI;EAAM,KAAK;YAAjD,CACE,GAED,kBAAC,OAAD;GACC,WAAU;GACV,IAAI;GACJ,yBAAyB,EAAE,QAAQ,EAAK;EACxC,CAAA,CACG;;AAEP"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer arkyn{.arkynTooltip{display:block;position:relative}.arkynTooltipText{visibility:hidden;opacity:0;white-space:nowrap;color:var(--tooltip-text,#fafafa);background-color:var(--tooltip-background,#27272a);z-index:9999;border-radius:4px;justify-content:center;align-items:center;font-weight:400;transition:all .15s ease-out;display:flex;position:absolute;transform:translate(-50%,-50%)}.arkynTooltip.lg .arkynTooltipText{padding:8px 12px;font-size:14px;line-height:130%}.arkynTooltip.md .arkynTooltipText{padding:8px 12px;font-size:12px;line-height:130%}.arkynTooltip:hover .arkynTooltipText{opacity:1;visibility:visible}.arkynTooltip.top .arkynTooltipText{bottom:calc(100% + 10px);left:50%;transform:translate(-50%)}.arkynTooltip.top .arkynTooltipText:before{content:"";border-style:solid;border-color:var(--tooltip-background,#27272a) transparent;border-width:6px 6px 0;position:absolute;top:100%;bottom:20px;left:50%;transform:translate(-50%)}.arkynTooltip.left .arkynTooltipText{top:50%;right:calc(100% + 10px);transform:translateY(-50%)}.arkynTooltip.left .arkynTooltipText:before{content:"";border-style:solid;border-color:transparent var(--tooltip-background,#27272a);border-width:6px 0 6px 6px;position:absolute;top:50%;left:100%;transform:translateY(-50%)}.arkynTooltip.right .arkynTooltipText{top:50%;left:calc(100% + 10px);transform:translateY(-50%)}.arkynTooltip.right .arkynTooltipText:before{content:"";border-style:solid;border-color:transparent var(--tooltip-background,#27272a);border-width:6px 6px 6px 0;position:absolute;top:50%;left:0;transform:translate(-100%,-50%)}.arkynTooltip.bottom .arkynTooltipText{top:calc(100% + 10px);left:50%;transform:translate(-50%)}.arkynTooltip.bottom .arkynTooltipText:before{content:"";border-style:solid;border-color:var(--tooltip-background,#27272a) transparent;border-width:0 6px 6px;position:absolute;top:0;left:50%;transform:translate(-50%,-100%)}}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { badResponses as e } from "../templates/badResponses.js";
|
|
2
|
+
import { successResponses as t } from "../templates/successResponses.js";
|
|
3
|
+
import { useModal as n } from "./useModal.js";
|
|
4
|
+
import { useToast as r } from "./useToast.js";
|
|
5
|
+
import { useCallback as i, useEffect as a } from "react";
|
|
6
|
+
import { scroller as o } from "react-scroll";
|
|
7
|
+
//#region src/hooks/useAutomation.ts
|
|
8
|
+
function s(s) {
|
|
9
|
+
let { closeAll: c } = n(), { showToast: l } = r(), u = s?.closeModal, d = s?.message, f = s?.name, p = s?.cause?.data?.scrollTo, m = s?.cause?.fieldErrors ? Object.values(s?.cause?.fieldErrors)[0] : null, h = i(() => {
|
|
10
|
+
if (!(!d && !m)) {
|
|
11
|
+
if (t.includes(f)) return l({
|
|
12
|
+
message: d,
|
|
13
|
+
type: "success"
|
|
14
|
+
});
|
|
15
|
+
if (e.includes(f)) {
|
|
16
|
+
if (m) return l({
|
|
17
|
+
message: m,
|
|
18
|
+
type: "danger"
|
|
19
|
+
});
|
|
20
|
+
if (d !== "Unprocessable entity") return l({
|
|
21
|
+
message: d,
|
|
22
|
+
type: "danger"
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}, [
|
|
27
|
+
d,
|
|
28
|
+
m,
|
|
29
|
+
f,
|
|
30
|
+
l
|
|
31
|
+
]);
|
|
32
|
+
a(() => {
|
|
33
|
+
u && c(), p && o.scrollTo(p, {
|
|
34
|
+
smooth: !0,
|
|
35
|
+
offset: 20
|
|
36
|
+
}), h();
|
|
37
|
+
}, [
|
|
38
|
+
u,
|
|
39
|
+
p,
|
|
40
|
+
h,
|
|
41
|
+
c
|
|
42
|
+
]);
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
export { s as useAutomation };
|
|
46
|
+
|
|
47
|
+
//# sourceMappingURL=useAutomation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAutomation.js","names":[],"sources":["../../../src/hooks/useAutomation.ts"],"sourcesContent":["import { useCallback, useEffect } from \"react\";\nimport { scroller } from \"react-scroll\";\nimport { badResponses } from \"../templates/badResponses\";\nimport { successResponses } from \"../templates/successResponses\";\nimport { useModal } from \"./useModal\";\nimport { useToast } from \"./useToast\";\n\n/**\n * useAutomation — runs UI side-effects (close modals, scroll, toast) in response to a server action payload.\n *\n * Pass the raw response from a form submission. On every change the hook:\n * 1. Closes all open modals if `closeModal` is `true`.\n * 2. Smooth-scrolls to a named element if `cause.data.scrollTo` is set.\n * 3. Shows a toast based on `name` (matched against `successResponses`/`badResponses`) and `message`.\n * When `cause.fieldErrors` is present, the first field error takes priority in the toast.\n * The message `\"Unprocessable entity\"` is intentionally suppressed.\n *\n * @param formResponseData - Raw server response payload.\n * @param formResponseData.closeModal - Closes all open modals when `true`.\n * @param formResponseData.name - Response identifier matched against success/bad response lists.\n * @param formResponseData.message - Text shown in the toast notification.\n * @param formResponseData.cause.data.scrollTo - Element name to scroll to via `react-scroll`.\n * @param formResponseData.cause.fieldErrors - Field-level errors; the first value is shown in the toast.\n *\n * @example\n * ```tsx\n * // After a successful create action\n * useAutomation({ closeModal: true, name: \"created\", message: \"Saved successfully\" });\n * ```\n *\n * @example\n * ```tsx\n * // Validation error with field-level feedback and scroll\n * useAutomation({\n * name: \"validation_error\",\n * message: \"Invalid payload\",\n * cause: {\n * data: { scrollTo: \"email\" },\n * fieldErrors: { email: \"E-mail is required\" },\n * },\n * });\n * ```\n */\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\nfunction useAutomation(formResponseData: any) {\n\tconst { closeAll } = useModal();\n\tconst { showToast } = useToast();\n\n\tconst closeModal = formResponseData?.closeModal;\n\tconst message = formResponseData?.message;\n\tconst name = formResponseData?.name;\n\tconst scrollTo = formResponseData?.cause?.data?.scrollTo;\n\tconst firstErrorField = formResponseData?.cause?.fieldErrors\n\t\t? (Object.values(formResponseData?.cause?.fieldErrors)[0] as string)\n\t\t: null;\n\n\tconst fireToast = useCallback(() => {\n\t\tif (!message && !firstErrorField) return;\n\n\t\tif (successResponses.includes(name))\n\t\t\treturn showToast({ message, type: \"success\" });\n\n\t\tif (!badResponses.includes(name)) return;\n\t\tif (firstErrorField)\n\t\t\treturn showToast({ message: firstErrorField, type: \"danger\" });\n\n\t\tif (message === \"Unprocessable entity\") return;\n\t\treturn showToast({ message, type: \"danger\" });\n\t}, [message, firstErrorField, name, showToast]);\n\n\tuseEffect(() => {\n\t\tif (closeModal) closeAll();\n\t\tif (scrollTo) scroller.scrollTo(scrollTo, { smooth: true, offset: 20 });\n\t\tfireToast();\n\t}, [closeModal, scrollTo, fireToast, closeAll]);\n}\n\nexport { useAutomation };\n"],"mappings":";;;;;;;AA6CA,SAAS,EAAc,GAAuB;CAC7C,IAAM,EAAE,gBAAa,EAAS,GACxB,EAAE,iBAAc,EAAS,GAEzB,IAAa,GAAkB,YAC/B,IAAU,GAAkB,SAC5B,IAAO,GAAkB,MACzB,IAAW,GAAkB,OAAO,MAAM,UAC1C,IAAkB,GAAkB,OAAO,cAC7C,OAAO,OAAO,GAAkB,OAAO,WAAW,CAAC,CAAC,KACrD,MAEG,IAAY,QAAkB;EAC/B,OAAC,KAAW,CAAC,IAEjB;OAAI,EAAiB,SAAS,CAAI,GACjC,OAAO,EAAU;IAAE;IAAS,MAAM;GAAU,CAAC;GAEzC,MAAa,SAAS,CAAI,GAC/B;QAAI,GACH,OAAO,EAAU;KAAE,SAAS;KAAiB,MAAM;IAAS,CAAC;IAE1D,UAAY,wBAChB,OAAO,EAAU;KAAE;KAAS,MAAM;IAAS,CAAC;GAHkB;EAJhB;CAQ/C,GAAG;EAAC;EAAS;EAAiB;EAAM;CAAS,CAAC;CAE9C,QAAgB;EAGf,AAFI,KAAY,EAAS,GACrB,KAAU,EAAS,SAAS,GAAU;GAAE,QAAQ;GAAM,QAAQ;EAAG,CAAC,GACtE,EAAU;CACX,GAAG;EAAC;EAAY;EAAU;EAAW;CAAQ,CAAC;AAC/C"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { drawerContext as e } from "../providers/drawerProvider.js";
|
|
2
|
+
import { useContext as t } from "react";
|
|
3
|
+
//#region src/hooks/useDrawer.ts
|
|
4
|
+
function n(n) {
|
|
5
|
+
let r = t(e);
|
|
6
|
+
if (Object.entries(r).length === 0) throw Error("useDrawer must be used within a Provider");
|
|
7
|
+
if (n) {
|
|
8
|
+
let { drawerData: e, drawerIsOpen: t, openDrawer: i, closeDrawer: a } = r;
|
|
9
|
+
return {
|
|
10
|
+
drawerIsOpen: t(n),
|
|
11
|
+
drawerData: e(n),
|
|
12
|
+
openDrawer: (e) => i(n, e),
|
|
13
|
+
closeDrawer: () => a(n)
|
|
14
|
+
};
|
|
15
|
+
} else return r;
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { n as useDrawer };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=useDrawer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDrawer.js","names":[],"sources":["../../../src/hooks/useDrawer.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport {\n\ttype DrawerContextProps,\n\tdrawerContext,\n} from \"../providers/drawerProvider\";\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\ntype OpenDrawerProps<T = any> = (data?: T) => void;\n\n/**\n * useDrawer — accesses the nearest `DrawerProvider` context.\n *\n * Two call signatures:\n * - **Without `key`** — returns the raw context object (manage any drawer by name).\n * - **With `key`** — returns a scoped object bound to one named drawer.\n *\n * @param key - Drawer identifier registered in `DrawerProvider`.\n *\n * @returns Without key: full `DrawerContextProps`. With key: `{ drawerIsOpen, drawerData, openDrawer, closeDrawer }`.\n *\n * @throws If called outside a `DrawerProvider`.\n *\n * @example\n * ```tsx\n * // Scoped to one drawer — the most common pattern\n * const { drawerIsOpen, drawerData, openDrawer, closeDrawer } = useDrawer<{ section: string }>('navigation');\n *\n * openDrawer({ section: 'products' });\n * ```\n *\n * @example\n * ```tsx\n * // Full context — useful when triggering multiple different drawers from one place\n * const { openDrawer } = useDrawer();\n *\n * openDrawer('navigation', { section: 'main' });\n * openDrawer('filters', { category: 'electronics' });\n * ```\n */\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\nfunction useDrawer<T = any>(): DrawerContextProps<T>;\n// biome-ignore lint/suspicious/noExplicitAny: intentional\nfunction useDrawer<T = any>(\n\tkey: string,\n): {\n\tdrawerIsOpen: boolean;\n\tdrawerData: T;\n\topenDrawer: OpenDrawerProps<T>;\n\tcloseDrawer: () => void;\n};\n\nfunction useDrawer(key?: string) {\n\tconst contextData = useContext(drawerContext);\n\n\tif (Object.entries(contextData).length === 0) {\n\t\tthrow new Error(\"useDrawer must be used within a Provider\");\n\t}\n\n\tif (key) {\n\t\tconst {\n\t\t\tdrawerData: contextDrawerData,\n\t\t\tdrawerIsOpen: contextDrawerIsOpen,\n\t\t\topenDrawer: contextOpenDrawer,\n\t\t\tcloseDrawer: contextCloseDrawer,\n\t\t} = contextData;\n\n\t\tconst drawerIsOpen = contextDrawerIsOpen(key);\n\t\tconst drawerData = contextDrawerData(key);\n\n\t\tconst openDrawer: OpenDrawerProps = (data) => contextOpenDrawer(key, data);\n\t\tconst closeDrawer = () => contextCloseDrawer(key);\n\n\t\treturn { drawerIsOpen, drawerData, openDrawer, closeDrawer };\n\t} else {\n\t\treturn contextData;\n\t}\n}\n\nexport { useDrawer };\n"],"mappings":";;;AAoDA,SAAS,EAAU,GAAc;CAChC,IAAM,IAAc,EAAW,CAAa;CAE5C,IAAI,OAAO,QAAQ,CAAW,CAAC,CAAC,WAAW,GAC1C,MAAU,MAAM,0CAA0C;CAG3D,IAAI,GAAK;EACR,IAAM,EACL,YAAY,GACZ,cAAc,GACd,YAAY,GACZ,aAAa,MACV;EAQJ,OAAO;GAAE,cANY,EAAoB,CAMhC;GAAc,YALJ,EAAkB,CAKd;GAAY,aAHE,MAAS,EAAkB,GAAK,CAAI;GAG1B,mBAFrB,EAAmB,CAAG;EAEW;CAC5D,OACC,OAAO;AAET"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useForm.js","names":[],"sources":["../../../src/hooks/useForm.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport { formContext } from \"../providers/formProvider\";\n\n/**\n * useForm — reads the nearest `FormProvider` context to access field-level validation errors.\n *\n * All form inputs (`Input`, `Select`, `Checkbox`, etc.) call this hook internally,\n * so you rarely need it directly. Use it when you want to read errors outside of\n * an input component, or build a custom input.\n *\n * @returns Form context containing:\n * - `fieldErrors` — `Record<string, string>` mapping field names to error messages.\n *\n * @example\n * ```tsx\n * // Wrapping a form with FormProvider\n * function App() {\n * return (\n * <FormProvider fieldErrors={{ email: \"Invalid email\" }}>\n * <MyForm />\n * </FormProvider>\n * );\n * }\n *\n * // Reading errors manually\n * function CustomField() {\n * const { fieldErrors } = useForm();\n * return <span>{fieldErrors?.username}</span>;\n * }\n * ```\n */\n\nfunction useForm() {\n\tconst context = useContext(formContext);\n\treturn context;\n}\n\nexport { useForm };\n"],"mappings":";;;AAgCA,SAAS,IAAU;CAElB,OADgB,EAAW,CACpB;AACR"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useSyncExternalStore as e } from "react";
|
|
2
|
+
//#region src/hooks/useHydrated.ts
|
|
3
|
+
function t() {
|
|
4
|
+
return () => {};
|
|
5
|
+
}
|
|
6
|
+
function n() {
|
|
7
|
+
return e(t, () => !0, () => !1);
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { n as useHydrated };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=useHydrated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useHydrated.js","names":[],"sources":["../../../src/hooks/useHydrated.ts"],"sourcesContent":["import { useSyncExternalStore } from \"react\";\n\nfunction subscribe() {\n\treturn () => {};\n}\n\n/**\n * useHydrated — returns `true` once the component has hydrated on the client, `false` during SSR.\n *\n * Built on `useSyncExternalStore` so it is safe with React 18 concurrent rendering.\n * Use this when you need to defer client-only rendering (e.g. browser APIs, `window`, `navigator`)\n * without causing a hydration mismatch. For most cases, prefer the `ClientOnly` component.\n *\n * @returns `true` on the client after hydration; `false` on the server.\n *\n * @example\n * ```tsx\n * function Map() {\n * const isHydrated = useHydrated();\n * if (!isHydrated) return <Skeleton />;\n * return <MapView accessToken={token} coordinates={coords} />;\n * }\n * ```\n */\n\nfunction useHydrated() {\n\treturn useSyncExternalStore(\n\t\tsubscribe,\n\t\t() => true,\n\t\t() => false,\n\t);\n}\n\nexport { useHydrated };\n"],"mappings":";;AAEA,SAAS,IAAY;CACpB,aAAa,CAAC;AACf;AAqBA,SAAS,IAAc;CACtB,OAAO,EACN,SACM,UACA,EACP;AACD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { modalContext as e } from "../providers/modalProvider.js";
|
|
2
|
+
import { useContext as t } from "react";
|
|
3
|
+
//#region src/hooks/useModal.ts
|
|
4
|
+
function n(n) {
|
|
5
|
+
let r = t(e);
|
|
6
|
+
if (Object.entries(r).length === 0) throw Error("useModal must be used within a Provider");
|
|
7
|
+
if (n) {
|
|
8
|
+
let { modalData: e, modalIsOpen: t, openModal: i, closeModal: a } = r;
|
|
9
|
+
return {
|
|
10
|
+
modalIsOpen: t(n),
|
|
11
|
+
modalData: e(n),
|
|
12
|
+
openModal: (e) => i(n, e),
|
|
13
|
+
closeModal: () => a(n)
|
|
14
|
+
};
|
|
15
|
+
} else return r;
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { n as useModal };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=useModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useModal.js","names":[],"sources":["../../../src/hooks/useModal.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport {\n\ttype ModalContextProps,\n\tmodalContext,\n} from \"../providers/modalProvider\";\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\ntype OpenModalProps<T = any> = (data?: T) => void;\n\n/**\n * useModal — accesses the nearest `ModalProvider` context.\n *\n * Two call signatures:\n * - **Without `key`** — returns the raw context object (manage any modal by name).\n * - **With `key`** — returns a scoped object bound to one named modal.\n *\n * @param key - Modal identifier registered in `ModalProvider`.\n *\n * @returns Without key: full `ModalContextProps`. With key: `{ modalIsOpen, modalData, openModal, closeModal }`.\n *\n * @throws If called outside a `ModalProvider`.\n *\n * @example\n * ```tsx\n * // Scoped to one modal — the most common pattern\n * const { modalIsOpen, modalData, openModal, closeModal } = useModal<{ id: number }>('confirm-delete');\n *\n * openModal({ id: user.id });\n * ```\n *\n * @example\n * ```tsx\n * // Full context — useful when triggering multiple different modals from one place\n * const { openModal } = useModal();\n *\n * openModal('confirm-delete', { id: user.id });\n * openModal('user-details', { id: user.id });\n * ```\n */\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\nfunction useModal<T = any>(): ModalContextProps<T>;\n// biome-ignore lint/suspicious/noExplicitAny: intentional\nfunction useModal<T = any>(\n\tkey: string,\n): {\n\tmodalIsOpen: boolean;\n\tmodalData: T;\n\topenModal: OpenModalProps<T>;\n\tcloseModal: () => void;\n};\n\nfunction useModal(key?: string) {\n\tconst contextData = useContext(modalContext);\n\n\tif (Object.entries(contextData).length === 0) {\n\t\tthrow new Error(\"useModal must be used within a Provider\");\n\t}\n\n\tif (key) {\n\t\tconst {\n\t\t\tmodalData: contextModalData,\n\t\t\tmodalIsOpen: contextModalIsOpen,\n\t\t\topenModal: contextOpenModal,\n\t\t\tcloseModal: contextCloseModal,\n\t\t} = contextData;\n\n\t\tconst modalIsOpen = contextModalIsOpen(key);\n\t\tconst modalData = contextModalData(key);\n\n\t\tconst openModal: OpenModalProps = (data) => contextOpenModal(key, data);\n\t\tconst closeModal = () => contextCloseModal(key);\n\n\t\treturn { modalIsOpen, modalData, openModal, closeModal };\n\t} else {\n\t\treturn contextData;\n\t}\n}\n\nexport { useModal };\n"],"mappings":";;;AAoDA,SAAS,EAAS,GAAc;CAC/B,IAAM,IAAc,EAAW,CAAY;CAE3C,IAAI,OAAO,QAAQ,CAAW,CAAC,CAAC,WAAW,GAC1C,MAAU,MAAM,yCAAyC;CAG1D,IAAI,GAAK;EACR,IAAM,EACL,WAAW,GACX,aAAa,GACb,WAAW,GACX,YAAY,MACT;EAQJ,OAAO;GAAE,aANW,EAAmB,CAM9B;GAAa,WALJ,EAAiB,CAKb;GAAW,YAHE,MAAS,EAAiB,GAAK,CAAI;GAG1B,kBAFnB,EAAkB,CAAG;EAES;CACxD,OACC,OAAO;AAET"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region src/hooks/useScopedParams.ts
|
|
2
|
+
function e(e, t = "") {
|
|
3
|
+
let n = new URLSearchParams(e), r = t ? `${t}:` : "", i = (e) => {
|
|
4
|
+
Object.entries(e).forEach(([e, t]) => {
|
|
5
|
+
t === void 0 ? n.delete(`${r}${e}`) : n.set(`${r}${e}`, String(t));
|
|
6
|
+
});
|
|
7
|
+
};
|
|
8
|
+
return {
|
|
9
|
+
getParam: (e) => n.get(`${r}${e}`),
|
|
10
|
+
getScopedSearch: (e) => {
|
|
11
|
+
i(e);
|
|
12
|
+
let t = n.toString();
|
|
13
|
+
return t &&= `?${t}`, t;
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { e as useScopedParams };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=useScopedParams.js.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useEffect as e } from "react";
|
|
2
|
+
//#region src/hooks/useScrollLock.ts
|
|
3
|
+
function t() {
|
|
4
|
+
return typeof window > "u" ? 0 : window.innerWidth - document.documentElement.clientWidth;
|
|
5
|
+
}
|
|
6
|
+
function n(n) {
|
|
7
|
+
e(() => {
|
|
8
|
+
if (n) {
|
|
9
|
+
let e = document.body.style.overflow, n = document.body.style.paddingRight, r = t();
|
|
10
|
+
if (r > 0) {
|
|
11
|
+
let e = window.getComputedStyle(document.body), t = parseInt(e.paddingRight, 10) || 0;
|
|
12
|
+
document.body.style.paddingRight = `${t + r}px`;
|
|
13
|
+
}
|
|
14
|
+
return document.body.style.overflow = "hidden", () => {
|
|
15
|
+
document.body.style.overflow = e, document.body.style.paddingRight = n;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
}, [n]);
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { n as useScrollLock };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=useScrollLock.js.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { badResponses as e } from "../templates/badResponses.js";
|
|
2
|
+
import { successResponses as t } from "../templates/successResponses.js";
|
|
3
|
+
import { useModal as n } from "./useModal.js";
|
|
4
|
+
import { useToast as r } from "./useToast.js";
|
|
5
|
+
import { useScopedParams as i } from "./useScopedParams.js";
|
|
6
|
+
import { useEffect as a } from "react";
|
|
7
|
+
//#region src/hooks/useSearchAutomation.ts
|
|
8
|
+
function o(o, s = "") {
|
|
9
|
+
let { closeAll: c } = n(), { showToast: l } = r(), { getParam: u } = i(o, s), d = u("closeModal") === "true", f = u("message"), p = u("name"), m = u("type");
|
|
10
|
+
a(() => {
|
|
11
|
+
d && c(), f && (m === "success" && l({
|
|
12
|
+
message: f,
|
|
13
|
+
type: "success"
|
|
14
|
+
}), m === "danger" && l({
|
|
15
|
+
message: f,
|
|
16
|
+
type: "danger"
|
|
17
|
+
}), p && e.includes(p) && !e.includes(f) && l({
|
|
18
|
+
message: f,
|
|
19
|
+
type: "danger"
|
|
20
|
+
}), p && t.includes(p) && !t.includes(f) && l({
|
|
21
|
+
message: f,
|
|
22
|
+
type: "success"
|
|
23
|
+
}));
|
|
24
|
+
}, [
|
|
25
|
+
d,
|
|
26
|
+
f,
|
|
27
|
+
p,
|
|
28
|
+
m,
|
|
29
|
+
l,
|
|
30
|
+
c
|
|
31
|
+
]);
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
export { o as useSearchAutomation };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=useSearchAutomation.js.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useState as e } from "react";
|
|
2
|
+
//#region src/hooks/useSlider.ts
|
|
3
|
+
function t(t) {
|
|
4
|
+
function n() {
|
|
5
|
+
return !t || t <= 0 ? 0 : t >= 100 ? 100 : t;
|
|
6
|
+
}
|
|
7
|
+
let [r, i] = e(n());
|
|
8
|
+
function a(e) {
|
|
9
|
+
return i(e <= 0 ? 0 : e >= 100 ? 100 : e);
|
|
10
|
+
}
|
|
11
|
+
return [r, a];
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { t as useSlider };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=useSlider.js.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { toastContext as e } from "../providers/toastProvider.js";
|
|
2
|
+
import { useContext as t } from "react";
|
|
3
|
+
//#region src/hooks/useToast.ts
|
|
4
|
+
function n() {
|
|
5
|
+
let n = t(e);
|
|
6
|
+
if (Object.entries(n).length === 0) throw Error("useToast must be used within a Provider");
|
|
7
|
+
return n;
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { n as useToast };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=useToast.js.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { createContext as e, useState as t } from "react";
|
|
2
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
3
|
+
//#region src/providers/drawerProvider.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, {
|
|
18
|
+
key: e,
|
|
19
|
+
data: t
|
|
20
|
+
}]);
|
|
21
|
+
}
|
|
22
|
+
function u(e) {
|
|
23
|
+
o(a.filter((t) => t.key !== e));
|
|
24
|
+
}
|
|
25
|
+
return /* @__PURE__ */ n(r.Provider, {
|
|
26
|
+
value: {
|
|
27
|
+
drawerIsOpen: s,
|
|
28
|
+
drawerData: c,
|
|
29
|
+
openDrawer: l,
|
|
30
|
+
closeDrawer: u
|
|
31
|
+
},
|
|
32
|
+
children: i
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { i as DrawerProvider, r as drawerContext };
|
|
37
|
+
|
|
38
|
+
//# sourceMappingURL=drawerProvider.js.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { cloneElement as e, createContext as t, useMemo as n } from "react";
|
|
2
|
+
import { jsxs as r } from "react/jsx-runtime";
|
|
3
|
+
//#region src/providers/formProvider.tsx
|
|
4
|
+
var i = t({});
|
|
5
|
+
function a(t) {
|
|
6
|
+
let { children: a, fieldErrors: o, form: s } = t, c = n(() => ({ fieldErrors: o }), [o]);
|
|
7
|
+
return /* @__PURE__ */ r(i.Provider, {
|
|
8
|
+
value: c,
|
|
9
|
+
children: [!s && a, s && e(s, s.props, a)]
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { a as FormProvider, i as formContext };
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=formProvider.js.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { createContext as e, useState as t } from "react";
|
|
2
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
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, {
|
|
18
|
+
key: e,
|
|
19
|
+
data: t
|
|
20
|
+
}]);
|
|
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
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
export { i as ModalProvider, r as modalContext };
|
|
41
|
+
|
|
42
|
+
//# sourceMappingURL=modalProvider.js.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Fragment as e, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useLoadScript as n } from "@react-google-maps/api";
|
|
3
|
+
//#region src/providers/placesProvider.tsx
|
|
4
|
+
var r = [
|
|
5
|
+
"places",
|
|
6
|
+
"marker",
|
|
7
|
+
"maps"
|
|
8
|
+
];
|
|
9
|
+
function i(i) {
|
|
10
|
+
let { apiKey: a, children: o, preventFontsLoading: s = !0 } = i, { isLoaded: c } = n({
|
|
11
|
+
googleMapsApiKey: a,
|
|
12
|
+
libraries: r,
|
|
13
|
+
preventGoogleFontsLoading: s
|
|
14
|
+
});
|
|
15
|
+
return /* @__PURE__ */ t(e, { children: o(c) });
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { i as PlacesProvider };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=placesProvider.js.map
|
|
@@ -0,0 +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"}
|