@arkyn/components 3.0.1-beta.153 → 3.0.1-beta.155
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/dist/components/calendar/_viewService.d.ts +1 -1
- package/dist/components/fullCalendar/_viewService.d.ts +2 -2
- package/dist/components.css +2 -0
- package/dist/hooks/useScopedParams.d.ts +1 -1
- package/dist/index.js +4358 -75
- package/dist/modules/components/alert/alertContainer/index.js +27 -0
- package/dist/modules/components/alert/alertContent/index.js +12 -0
- package/dist/modules/components/alert/alertDescription/index.js +12 -0
- package/dist/modules/components/alert/alertIcon/index.js +28 -0
- package/dist/modules/components/alert/alertTitle/index.js +12 -0
- package/dist/modules/components/audioPlayer/index.js +75 -0
- package/dist/modules/components/audioUpload/hasFileContent/index.js +55 -0
- package/dist/modules/components/audioUpload/index.js +72 -0
- package/dist/modules/components/audioUpload/noFileContent/index.js +36 -0
- package/dist/modules/components/badge/index.js +27 -0
- package/dist/modules/components/button/index.js +40 -0
- package/dist/modules/components/calendar/_calendarProvider.js +40 -0
- package/dist/modules/components/calendar/_viewService.js +133 -0
- package/dist/modules/components/calendar/calendarContainer/index.js +11 -0
- package/dist/modules/components/calendar/calendarHeader/index.js +52 -0
- package/dist/modules/components/calendar/calendarTableBody/index.js +13 -0
- package/dist/modules/components/calendar/calendarTableContainer/index.js +11 -0
- package/dist/modules/components/calendar/calendarTableHeader/index.js +14 -0
- package/dist/modules/components/calendar/calendarTableTd/index.js +21 -0
- package/dist/modules/components/calendar/index.js +32 -0
- package/dist/modules/components/cardTab/cardTabButton/index.js +20 -0
- package/dist/modules/components/cardTab/cardTabContainer/index.js +23 -0
- package/dist/modules/components/cardTab/cardTabContext.js +15 -0
- package/dist/modules/components/checkbox/index.js +38 -0
- package/dist/modules/components/clientOnly.js +9 -0
- package/dist/modules/components/currencyInput/index.js +112 -0
- package/dist/modules/components/divider/index.js +12 -0
- package/dist/modules/components/drawer/drawerContainer/index.js +41 -0
- package/dist/modules/components/drawer/drawerContext.js +15 -0
- package/dist/modules/components/drawer/drawerHeader/index.js +21 -0
- package/dist/modules/components/facebookPixel/facebookPixel.client.js +9 -0
- package/dist/modules/components/facebookPixel/index.js +9 -0
- package/dist/modules/components/facebookPixel/pixel.js +48 -0
- package/dist/modules/components/fieldError/index.js +13 -0
- package/dist/modules/components/fieldLabel/index.js +12 -0
- package/dist/modules/components/fieldWrapper/index.js +13 -0
- package/dist/modules/components/fileUpload/hasFileContent/index.js +60 -0
- package/dist/modules/components/fileUpload/index.js +66 -0
- package/dist/modules/components/fileUpload/noFileContent/index.js +36 -0
- package/dist/modules/components/fullCalendar/_fullCalendarProvider.js +35 -0
- package/dist/modules/components/fullCalendar/_viewService.js +101 -0
- package/dist/modules/components/fullCalendar/dayCalendar/dayCalendarContainer/index.js +11 -0
- package/dist/modules/components/fullCalendar/dayCalendar/dayCalendarEvent/index.js +71 -0
- package/dist/modules/components/fullCalendar/dayCalendar/dayCalendarRow/index.js +29 -0
- package/dist/modules/components/fullCalendar/dayCalendar/index.js +14 -0
- package/dist/modules/components/fullCalendar/fullCalendarContainer/index.js +11 -0
- package/dist/modules/components/fullCalendar/fullCalendarHeader/index.js +69 -0
- package/dist/modules/components/fullCalendar/index.js +31 -0
- package/dist/modules/components/fullCalendar/monthlyCalendar/index.js +10 -0
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarEvent/index.js +29 -0
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableBody/index.js +13 -0
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableContainer/index.js +11 -0
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableHeader/index.js +14 -0
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableTd/index.js +36 -0
- package/dist/modules/components/fullCalendar/weekCalendar/index.js +10 -0
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarEvent/index.js +71 -0
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableBody/index.js +18 -0
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableContainer/index.js +11 -0
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableHeader/index.js +17 -0
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableTd/index.js +35 -0
- package/dist/modules/components/googleAnalytics/googleAnalytics.client.js +8 -0
- package/dist/modules/components/googleAnalytics/googleAnalytics.js +18 -0
- package/dist/modules/components/googleAnalytics/index.js +10 -0
- package/dist/modules/components/googleAnalytics/snippets/generateGAElements.js +14 -0
- package/dist/modules/components/googleTagManager/googleTagManager.client.js +8 -0
- package/dist/modules/components/googleTagManager/googleTagManager.js +45 -0
- package/dist/modules/components/googleTagManager/index.js +17 -0
- package/dist/modules/components/googleTagManager/snippets/appendToDataLayer.js +9 -0
- package/dist/modules/components/googleTagManager/snippets/generateGTMElements.js +23 -0
- package/dist/modules/components/iconButton/index.js +32 -0
- package/dist/modules/components/imageUpload/hasFileContent/index.js +47 -0
- package/dist/modules/components/imageUpload/index.js +66 -0
- package/dist/modules/components/imageUpload/noFileContent/index.js +36 -0
- package/dist/modules/components/input/index.js +93 -0
- package/dist/modules/components/mapView/index.js +29 -0
- package/dist/modules/components/mapView/mapView.client.js +50 -0
- package/dist/modules/components/maskedInput/index.js +102 -0
- package/dist/modules/components/modal/modalContainer/index.js +50 -0
- package/dist/modules/components/modal/modalContext.js +15 -0
- package/dist/modules/components/modal/modalFooter/index.js +12 -0
- package/dist/modules/components/modal/modalHeader/index.js +21 -0
- package/dist/modules/components/multiSelect/index.js +116 -0
- package/dist/modules/components/multiSelect/multiSelectChevron/index.js +19 -0
- package/dist/modules/components/multiSelect/multiSelectContainer/index.js +14 -0
- package/dist/modules/components/multiSelect/multiSelectContent/index.js +12 -0
- package/dist/modules/components/multiSelect/multiSelectMark/index.js +20 -0
- package/dist/modules/components/multiSelect/multiSelectOption/index.js +18 -0
- package/dist/modules/components/multiSelect/multiSelectOptionsContainer/index.js +36 -0
- package/dist/modules/components/multiSelect/multiSelectOverlay/index.js +12 -0
- package/dist/modules/components/multiSelect/multiSelectSpinner/index.js +14 -0
- package/dist/modules/components/pagination/chevronButton/index.js +18 -0
- package/dist/modules/components/pagination/currentButton/index.js +12 -0
- package/dist/modules/components/pagination/index.js +52 -0
- package/dist/modules/components/pagination/pageButton/index.js +13 -0
- package/dist/modules/components/pagination/paginationService.js +34 -0
- package/dist/modules/components/pagination/spread/index.js +12 -0
- package/dist/modules/components/phoneInput/index.js +104 -0
- package/dist/modules/components/phoneInput/phoneInputContainer/index.js +13 -0
- package/dist/modules/components/phoneInput/phoneInputCountriesOverlay/index.js +12 -0
- package/dist/modules/components/phoneInput/phoneInputCountryOption/index.js +24 -0
- package/dist/modules/components/phoneInput/phoneInputCountryOptionsContainer/index.js +34 -0
- package/dist/modules/components/phoneInput/phoneInputCountrySelector/index.js +26 -0
- package/dist/modules/components/phoneInput/phoneInputMask/index.js +46 -0
- package/dist/modules/components/popover/index.js +38 -0
- package/dist/modules/components/radio/radioBox/index.js +25 -0
- package/dist/modules/components/radio/radioContext.js +22 -0
- package/dist/modules/components/radio/radioGroup/index.js +42 -0
- package/dist/modules/components/richText/blockButton/index.js +21 -0
- package/dist/modules/components/richText/element/index.js +73 -0
- package/dist/modules/components/richText/index.js +144 -0
- package/dist/modules/components/richText/insertImage/index.js +95 -0
- package/dist/modules/components/richText/insertVideo/index.js +86 -0
- package/dist/modules/components/richText/leaf/index.js +10 -0
- package/dist/modules/components/richText/markButton/index.js +20 -0
- package/dist/modules/components/richText/toolbar/index.js +11 -0
- package/dist/modules/components/searchPlaces.js +58 -0
- package/dist/modules/components/select/index.js +113 -0
- package/dist/modules/components/select/selectChevron/index.js +19 -0
- package/dist/modules/components/select/selectContainer/index.js +14 -0
- package/dist/modules/components/select/selectContent/index.js +12 -0
- package/dist/modules/components/select/selectOption/index.js +18 -0
- package/dist/modules/components/select/selectOptionsContainer/index.js +36 -0
- package/dist/modules/components/select/selectOverlay/index.js +12 -0
- package/dist/modules/components/select/selectSpinner/index.js +14 -0
- package/dist/modules/components/slider/index.js +35 -0
- package/dist/modules/components/switch/index.js +36 -0
- package/dist/modules/components/tab/tabButton/index.js +20 -0
- package/dist/modules/components/tab/tabContainer/index.js +23 -0
- package/dist/modules/components/tab/tabContext.js +15 -0
- package/dist/modules/components/table/tableBody/index.js +20 -0
- package/dist/modules/components/table/tableCaption/index.js +16 -0
- package/dist/modules/components/table/tableContainer/index.js +13 -0
- package/dist/modules/components/table/tableFooter/index.js +19 -0
- package/dist/modules/components/table/tableHeader/index.js +13 -0
- package/dist/modules/components/textarea/index.js +52 -0
- package/dist/modules/components/tooltip/index.js +35 -0
- package/dist/modules/components.css +2 -0
- package/dist/modules/hooks/useAutomation.js +36 -0
- package/dist/modules/hooks/useDrawer.js +18 -0
- package/dist/modules/hooks/useForm.js +8 -0
- package/dist/modules/hooks/useHydrated.js +10 -0
- package/dist/modules/hooks/useModal.js +18 -0
- package/dist/modules/hooks/useScopedParams.js +18 -0
- package/dist/modules/hooks/useScrollLock.js +21 -0
- package/dist/modules/hooks/useSearchAutomation.js +32 -0
- package/dist/modules/hooks/useSlider.js +14 -0
- package/dist/modules/hooks/useToast.js +10 -0
- package/dist/modules/index.js +72 -0
- package/dist/modules/providers/drawerProvider.js +36 -0
- package/dist/modules/providers/formProvider.js +13 -0
- package/dist/modules/providers/modalProvider.js +40 -0
- package/dist/modules/providers/placesProvider.js +18 -0
- package/dist/modules/providers/toastProvider.js +46 -0
- package/dist/modules/services/extractTextFromNode.js +7 -0
- package/dist/modules/services/fieldTemplate.js +23 -0
- package/dist/modules/services/iconRenderer.js +15 -0
- package/dist/modules/services/isBlockActive.js +13 -0
- package/dist/modules/services/isMarkActive.js +8 -0
- package/dist/modules/services/maskCurrencyValues.js +13 -0
- package/dist/modules/services/toHtml.js +7 -0
- package/dist/modules/services/toRichTextValue.js +9 -0
- package/dist/modules/services/toggleBlock.js +21 -0
- package/dist/modules/services/toggleMark.js +8 -0
- package/dist/modules/templates/badResponses.js +14 -0
- package/dist/modules/templates/richTextTemplates.js +17 -0
- package/dist/modules/templates/successResponses.js +9 -0
- package/dist/modules/utils/phoneInputUtilities.js +22 -0
- package/dist/modules/utils/richTextUtilities.js +90 -0
- package/dist/services/fieldTemplate.d.ts +1 -1
- package/dist/services/fieldTemplate.d.ts.map +1 -1
- package/package.json +163 -163
- package/dist/components/alert/alertContainer/index.js +0 -71
- package/dist/components/alert/alertContent/index.js +0 -26
- package/dist/components/alert/alertDescription/index.js +0 -25
- package/dist/components/alert/alertIcon/index.js +0 -43
- package/dist/components/alert/alertTitle/index.js +0 -27
- package/dist/components/audioPlayer/index.js +0 -112
- package/dist/components/audioUpload/hasFileContent/index.js +0 -26
- package/dist/components/audioUpload/index.js +0 -95
- package/dist/components/audioUpload/noFileContent/index.js +0 -29
- package/dist/components/badge/index.js +0 -41
- package/dist/components/button/index.js +0 -51
- package/dist/components/calendar/_calendarProvider.js +0 -58
- package/dist/components/calendar/_viewService.js +0 -179
- package/dist/components/calendar/calendarContainer/index.js +0 -6
- package/dist/components/calendar/calendarHeader/index.js +0 -13
- package/dist/components/calendar/calendarTableBody/index.js +0 -9
- package/dist/components/calendar/calendarTableContainer/index.js +0 -6
- package/dist/components/calendar/calendarTableHeader/index.js +0 -9
- package/dist/components/calendar/calendarTableTd/index.js +0 -15
- package/dist/components/calendar/index.js +0 -54
- package/dist/components/cardTab/cardTabButton/index.js +0 -40
- package/dist/components/cardTab/cardTabContainer/index.js +0 -42
- package/dist/components/cardTab/cardTabContext.js +0 -10
- package/dist/components/checkbox/index.js +0 -71
- package/dist/components/clientOnly.js +0 -31
- package/dist/components/currencyInput/index.js +0 -126
- package/dist/components/divider/index.js +0 -28
- package/dist/components/drawer/drawerContainer/index.js +0 -38
- package/dist/components/drawer/drawerContext.js +0 -10
- package/dist/components/drawer/drawerHeader/index.js +0 -33
- package/dist/components/facebookPixel/facebookPixel.client.js +0 -23
- package/dist/components/facebookPixel/index.js +0 -45
- package/dist/components/facebookPixel/pixel.js +0 -111
- package/dist/components/fieldError/index.js +0 -26
- package/dist/components/fieldLabel/index.js +0 -23
- package/dist/components/fieldWrapper/index.js +0 -27
- package/dist/components/fileUpload/hasFileContent/index.js +0 -34
- package/dist/components/fileUpload/index.js +0 -89
- package/dist/components/fileUpload/noFileContent/index.js +0 -29
- package/dist/components/fullCalendar/_fullCalendarProvider.js +0 -36
- package/dist/components/fullCalendar/_viewService.js +0 -144
- package/dist/components/fullCalendar/dayCalendar/dayCalendarContainer/index.js +0 -6
- package/dist/components/fullCalendar/dayCalendar/dayCalendarEvent/index.js +0 -105
- package/dist/components/fullCalendar/dayCalendar/dayCalendarRow/index.js +0 -24
- package/dist/components/fullCalendar/dayCalendar/index.js +0 -9
- package/dist/components/fullCalendar/fullCalendarContainer/index.js +0 -6
- package/dist/components/fullCalendar/fullCalendarHeader/index.js +0 -37
- package/dist/components/fullCalendar/index.js +0 -52
- package/dist/components/fullCalendar/monthlyCalendar/index.js +0 -8
- package/dist/components/fullCalendar/monthlyCalendar/monthlyCalendarEvent/index.js +0 -29
- package/dist/components/fullCalendar/monthlyCalendar/monthlyCalendarTableBody/index.js +0 -9
- package/dist/components/fullCalendar/monthlyCalendar/monthlyCalendarTableContainer/index.js +0 -6
- package/dist/components/fullCalendar/monthlyCalendar/monthlyCalendarTableHeader/index.js +0 -9
- package/dist/components/fullCalendar/monthlyCalendar/monthlyCalendarTableTd/index.js +0 -30
- package/dist/components/fullCalendar/weekCalendar/index.js +0 -8
- package/dist/components/fullCalendar/weekCalendar/weekCalendarEvent/index.js +0 -102
- package/dist/components/fullCalendar/weekCalendar/weekCalendarTableBody/index.js +0 -11
- package/dist/components/fullCalendar/weekCalendar/weekCalendarTableContainer/index.js +0 -6
- package/dist/components/fullCalendar/weekCalendar/weekCalendarTableHeader/index.js +0 -10
- package/dist/components/fullCalendar/weekCalendar/weekCalendarTableTd/index.js +0 -25
- package/dist/components/googleAnalytics/googleAnalytics.client.js +0 -8
- package/dist/components/googleAnalytics/googleAnalytics.js +0 -23
- package/dist/components/googleAnalytics/index.js +0 -31
- package/dist/components/googleAnalytics/snippets/generateGAElements.js +0 -16
- package/dist/components/googleTagManager/googleTagManager.client.js +0 -8
- package/dist/components/googleTagManager/googleTagManager.js +0 -52
- package/dist/components/googleTagManager/index.js +0 -47
- package/dist/components/googleTagManager/snippets/appendToDataLayer.js +0 -7
- package/dist/components/googleTagManager/snippets/generateGTMElements.js +0 -25
- package/dist/components/iconButton/index.js +0 -38
- package/dist/components/imageUpload/hasFileContent/index.js +0 -24
- package/dist/components/imageUpload/index.js +0 -101
- package/dist/components/imageUpload/noFileContent/index.js +0 -29
- package/dist/components/input/index.js +0 -94
- package/dist/components/mapView/index.js +0 -53
- package/dist/components/mapView/mapView.client.js +0 -51
- package/dist/components/maskedInput/index.js +0 -108
- package/dist/components/modal/modalContainer/index.js +0 -40
- package/dist/components/modal/modalContext.js +0 -10
- package/dist/components/modal/modalFooter/index.js +0 -32
- package/dist/components/modal/modalHeader/index.js +0 -34
- package/dist/components/multiSelect/index.js +0 -135
- 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 -46
- 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 -127
- 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 -37
- package/dist/components/popover/index.js +0 -62
- package/dist/components/radio/radioBox/index.js +0 -48
- package/dist/components/radio/radioContext.js +0 -11
- package/dist/components/radio/radioGroup/index.js +0 -58
- package/dist/components/richText/blockButton/index.js +0 -18
- package/dist/components/richText/element/index.js +0 -26
- package/dist/components/richText/index.js +0 -136
- package/dist/components/richText/insertImage/index.js +0 -33
- package/dist/components/richText/insertVideo/index.js +0 -51
- 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 -99
- package/dist/components/select/index.js +0 -134
- 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 -79
- package/dist/components/switch/index.js +0 -66
- package/dist/components/tab/tabButton/index.js +0 -40
- package/dist/components/tab/tabContainer/index.js +0 -42
- package/dist/components/tab/tabContext.js +0 -10
- package/dist/components/table/tableBody/index.js +0 -34
- package/dist/components/table/tableCaption/index.js +0 -24
- package/dist/components/table/tableContainer/index.js +0 -37
- package/dist/components/table/tableFooter/index.js +0 -23
- package/dist/components/table/tableHeader/index.js +0 -25
- package/dist/components/textarea/index.js +0 -80
- package/dist/components/tooltip/index.js +0 -96
- package/dist/hooks/useAutomation.js +0 -74
- package/dist/hooks/useDrawer.js +0 -20
- package/dist/hooks/useForm.js +0 -35
- package/dist/hooks/useHydrated.js +0 -26
- package/dist/hooks/useModal.js +0 -20
- package/dist/hooks/useScopedParams.js +0 -55
- package/dist/hooks/useScrollLock.js +0 -46
- package/dist/hooks/useSearchAutomation.js +0 -64
- package/dist/hooks/useSlider.js +0 -35
- package/dist/hooks/useToast.js +0 -28
- package/dist/providers/drawerProvider.js +0 -54
- package/dist/providers/formProvider.js +0 -34
- package/dist/providers/modalProvider.js +0 -58
- package/dist/providers/placesProvider.js +0 -40
- package/dist/providers/toastProvider.js +0 -62
- package/dist/services/extractTextFromNode.js +0 -5
- package/dist/services/fieldTemplate.js +0 -11
- 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 -22
- package/dist/services/toRichTextValue.js +0 -34
- package/dist/services/toggleBlock.js +0 -32
- package/dist/services/toggleMark.js +0 -10
- package/dist/style.css +0 -1
- 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 -37
- package/dist/utils/richTextUtilities.js +0 -89
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { Image } from "lucide-react";
|
|
3
|
-
import { useState } from "react";
|
|
4
|
-
import { useSlate } from "slate-react";
|
|
5
|
-
import { Button } from "../../button";
|
|
6
|
-
import { ImageUpload } from "../../imageUpload";
|
|
7
|
-
import { Input } from "../../input";
|
|
8
|
-
import { ModalContainer } from "../../modal/modalContainer";
|
|
9
|
-
import { ModalFooter } from "../../modal/modalFooter";
|
|
10
|
-
import { ModalHeader } from "../../modal/modalHeader";
|
|
11
|
-
import { TabButton } from "../../tab/tabButton";
|
|
12
|
-
import { TabContainer } from "../../tab/tabContainer";
|
|
13
|
-
import "./styles.css";
|
|
14
|
-
function InsertImage(props) {
|
|
15
|
-
const { action, tabLabels = ["Adicionar URL", "Upload de arquivo"], modalCancelButton = "Cancelar", modalConfirmButton = "Confirmar", modalInputImageLabel = "Imagem:", modalInputUrlLabel = "URL da imagem:", modalTitle = "Inserir imagem", } = props;
|
|
16
|
-
const editor = useSlate();
|
|
17
|
-
const [modalIsVisible, setModalIsVisible] = useState(false);
|
|
18
|
-
const [imageURL, setImageURL] = useState("");
|
|
19
|
-
const [uploadType, setUploadType] = useState("url");
|
|
20
|
-
function handleMouseDown(event) {
|
|
21
|
-
event.preventDefault();
|
|
22
|
-
if (!imageURL || imageURL === "")
|
|
23
|
-
return;
|
|
24
|
-
editor.insertNodes([
|
|
25
|
-
{ type: "paragraph", children: [{ text: "" }] },
|
|
26
|
-
{ type: "image", src: imageURL, children: [{ text: "" }] },
|
|
27
|
-
{ type: "paragraph", children: [{ text: "" }] },
|
|
28
|
-
]);
|
|
29
|
-
setModalIsVisible(false);
|
|
30
|
-
}
|
|
31
|
-
return (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", className: "arkynRichTextInsertImage", onMouseDown: () => setModalIsVisible(true), children: _jsx(Image, {}) }), _jsxs(ModalContainer, { isVisible: modalIsVisible, makeInvisible: () => setModalIsVisible(false), children: [_jsx(ModalHeader, { children: modalTitle }), _jsxs("div", { className: "arkynRichTextInsertImageModalContent", children: [_jsxs(TabContainer, { defaultValue: uploadType, onChange: setUploadType, children: [_jsx(TabButton, { value: "url", children: tabLabels[0] }), _jsx(TabButton, { value: "file", children: tabLabels[1] })] }), uploadType === "url" && (_jsxs(_Fragment, { children: [_jsx(Input, { type: "text", name: "richTextImageURL", label: modalInputUrlLabel, showAsterisk: true, defaultValue: imageURL, onChange: (e) => setImageURL(e.target.value) }), imageURL && (_jsx("img", { className: "arkynRichTextInsertImageModalPreviewImage", src: imageURL, alt: "preview" }))] })), uploadType === "file" && (_jsx(ImageUpload, { name: "richTextImageURL", action: action, label: modalInputImageLabel, showAsterisk: true, defaultValue: imageURL, onChange: (url) => setImageURL(url) }))] }), _jsxs(ModalFooter, { children: [_jsx(Button, { type: "button", scheme: "danger", variant: "outline", onClick: () => setModalIsVisible(false), children: modalCancelButton }), _jsx(Button, { type: "button", onClick: handleMouseDown, children: modalConfirmButton })] })] })] }));
|
|
32
|
-
}
|
|
33
|
-
export { InsertImage };
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { Video } from "lucide-react";
|
|
3
|
-
import { useEffect, useState } from "react";
|
|
4
|
-
import { useSlate } from "slate-react";
|
|
5
|
-
import { Button } from "../../button";
|
|
6
|
-
import { Input } from "../../input";
|
|
7
|
-
import { ModalContainer } from "../../modal/modalContainer";
|
|
8
|
-
import { ModalFooter } from "../../modal/modalFooter";
|
|
9
|
-
import { ModalHeader } from "../../modal/modalHeader";
|
|
10
|
-
import "./styles.css";
|
|
11
|
-
function InsertVideo(props) {
|
|
12
|
-
const { modalCancelButton = "Cancelar", modalConfirmButton = "Confirmar", modalInputUrlLabel = "URL do vídeo:", modalTitle = "Inserir vídeo", invalidUrlMessage = "URL inválida", } = props;
|
|
13
|
-
const editor = useSlate();
|
|
14
|
-
const [modalIsVisible, setModalIsVisible] = useState(false);
|
|
15
|
-
const [videoId, setVideoId] = useState("");
|
|
16
|
-
const [videoRawURL, setVideoRawURL] = useState("");
|
|
17
|
-
const [errorMessage, setErrorMessage] = useState("");
|
|
18
|
-
function handleMouseDown(event) {
|
|
19
|
-
event.preventDefault();
|
|
20
|
-
if (!videoId || videoId === "")
|
|
21
|
-
return;
|
|
22
|
-
const videoUrl = `https://www.youtube.com/embed/${videoId}`;
|
|
23
|
-
editor.insertNodes([
|
|
24
|
-
{ type: "paragraph", children: [{ text: "" }] },
|
|
25
|
-
{ type: "video", src: videoUrl, children: [{ text: "" }] },
|
|
26
|
-
{ type: "paragraph", children: [{ text: "" }] },
|
|
27
|
-
]);
|
|
28
|
-
setModalIsVisible(false);
|
|
29
|
-
}
|
|
30
|
-
useEffect(() => {
|
|
31
|
-
if (!videoRawURL || videoRawURL === "")
|
|
32
|
-
return;
|
|
33
|
-
setVideoId("");
|
|
34
|
-
setErrorMessage("");
|
|
35
|
-
const searchParams = new URLSearchParams(videoRawURL.split("?")[1]);
|
|
36
|
-
const vParam = searchParams.get("v");
|
|
37
|
-
if (vParam)
|
|
38
|
-
setVideoId(vParam);
|
|
39
|
-
else
|
|
40
|
-
setErrorMessage(invalidUrlMessage);
|
|
41
|
-
}, [videoRawURL]);
|
|
42
|
-
useEffect(() => {
|
|
43
|
-
if (!modalIsVisible) {
|
|
44
|
-
setVideoId("");
|
|
45
|
-
setVideoRawURL("");
|
|
46
|
-
setErrorMessage("");
|
|
47
|
-
}
|
|
48
|
-
}, [modalIsVisible]);
|
|
49
|
-
return (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", className: "arkynRichTextInsertVideo", onMouseDown: () => setModalIsVisible(true), children: _jsx(Video, {}) }), _jsxs(ModalContainer, { isVisible: modalIsVisible, makeInvisible: () => setModalIsVisible(false), children: [_jsx(ModalHeader, { children: modalTitle }), _jsxs("div", { className: "arkynRichTextInsertVideoModalContent", children: [_jsx(Input, { type: "text", name: "richTextVideoURL", label: modalInputUrlLabel, showAsterisk: true, defaultValue: videoRawURL, onChange: (e) => setVideoRawURL(e.target.value), errorMessage: errorMessage }), videoId && (_jsx("iframe", { width: "auto", height: "315", src: `https://www.youtube.com/embed/${videoId}`, title: "YouTube video player", allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share", referrerPolicy: "strict-origin-when-cross-origin", allowFullScreen: true }))] }), _jsxs(ModalFooter, { children: [_jsx(Button, { type: "button", scheme: "danger", variant: "outline", onClick: () => setModalIsVisible(false), children: modalCancelButton }), _jsx(Button, { disabled: !videoId, type: "button", onClick: handleMouseDown, children: modalConfirmButton })] })] })] }));
|
|
50
|
-
}
|
|
51
|
-
export { InsertVideo };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
function Leaf({ attributes, children, leaf }) {
|
|
3
|
-
if (leaf.bold)
|
|
4
|
-
children = _jsx("strong", { children: children });
|
|
5
|
-
if (leaf.code)
|
|
6
|
-
children = _jsx("code", { children: children });
|
|
7
|
-
if (leaf.italic)
|
|
8
|
-
children = _jsx("em", { children: children });
|
|
9
|
-
if (leaf.underline)
|
|
10
|
-
children = _jsx("u", { children: children });
|
|
11
|
-
return _jsx("span", { ...attributes, children: children });
|
|
12
|
-
}
|
|
13
|
-
export { Leaf };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useSlate } from "slate-react";
|
|
3
|
-
import { isMarkActive } from "../../../services/isMarkActive";
|
|
4
|
-
import { toggleMark } from "../../../services/toggleMark";
|
|
5
|
-
import "./styles.css";
|
|
6
|
-
function MarkButton({ format, icon: Icon }) {
|
|
7
|
-
const editor = useSlate();
|
|
8
|
-
const isActive = isMarkActive(editor, format);
|
|
9
|
-
const activeClass = isActive ? "activeTrue" : "activeFalse";
|
|
10
|
-
function handleMouseDown(event) {
|
|
11
|
-
event.preventDefault();
|
|
12
|
-
toggleMark(editor, format);
|
|
13
|
-
}
|
|
14
|
-
return (_jsx("button", { type: "button", className: "arkynRichTextMarkButton " + activeClass, onMouseDown: handleMouseDown, children: _jsx(Icon, {}) }));
|
|
15
|
-
}
|
|
16
|
-
export { MarkButton };
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { StandaloneSearchBox } from "@react-google-maps/api";
|
|
3
|
-
import { useState } from "react";
|
|
4
|
-
import { Input } from "./input";
|
|
5
|
-
/**
|
|
6
|
-
* SearchPlaces — text input with Google Places autocomplete that returns structured address data.
|
|
7
|
-
*
|
|
8
|
-
* Requires the Google Maps JavaScript API with the Places library to be loaded.
|
|
9
|
-
* Built on `@react-google-maps/api`'s `StandaloneSearchBox`.
|
|
10
|
-
*
|
|
11
|
-
* @param props.options - Google Maps search box options (e.g. restrict by country).
|
|
12
|
-
* @param props.onChange - Fires on every keystroke — receives the current text value.
|
|
13
|
-
* @param props.onPlaceChanged - Fires when the user selects a suggestion — receives structured address data.
|
|
14
|
-
*
|
|
15
|
-
* **...Other valid `Input` properties (except `onLoad`, `onChange`, `type`)**
|
|
16
|
-
*
|
|
17
|
-
* @returns SearchPlaces JSX element (an `Input` wrapped in `StandaloneSearchBox`).
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* ```tsx
|
|
21
|
-
* <SearchPlaces
|
|
22
|
-
* name="address"
|
|
23
|
-
* label="Address"
|
|
24
|
-
* placeholder="Start typing an address…"
|
|
25
|
-
* options={{ componentRestrictions: { country: "br" } }}
|
|
26
|
-
* onChange={(v) => setRawAddress(v)}
|
|
27
|
-
* onPlaceChanged={(place) => {
|
|
28
|
-
* setAddress({
|
|
29
|
-
* street: place.street,
|
|
30
|
-
* city: place.city,
|
|
31
|
-
* state: place.state,
|
|
32
|
-
* postalCode: place.postalCode,
|
|
33
|
-
* coordinates: place.coordinates,
|
|
34
|
-
* });
|
|
35
|
-
* }}
|
|
36
|
-
* />
|
|
37
|
-
* ```
|
|
38
|
-
*/
|
|
39
|
-
function SearchPlaces(props) {
|
|
40
|
-
const { onChange, onPlaceChanged, options, ...rest } = props;
|
|
41
|
-
const [searchBox, setSearchBox] = useState(null);
|
|
42
|
-
const handleLoad = (ref) => setSearchBox(ref);
|
|
43
|
-
const handlePlacesChanged = () => {
|
|
44
|
-
const places = searchBox?.getPlaces();
|
|
45
|
-
const place = places ? places[0] : null;
|
|
46
|
-
const address_components = place?.address_components;
|
|
47
|
-
function findData(key) {
|
|
48
|
-
const data = address_components.find((item) => item.types[0] === key);
|
|
49
|
-
if (data)
|
|
50
|
-
return data.long_name;
|
|
51
|
-
return "";
|
|
52
|
-
}
|
|
53
|
-
function findDataShort(key) {
|
|
54
|
-
const data = address_components.find((item) => item.types[0] === key);
|
|
55
|
-
if (data)
|
|
56
|
-
return data.short_name;
|
|
57
|
-
return "";
|
|
58
|
-
}
|
|
59
|
-
function findDataByMultipleTypes(keys) {
|
|
60
|
-
for (const key of keys) {
|
|
61
|
-
const data = address_components.find((item) => item.types.includes(key));
|
|
62
|
-
if (data)
|
|
63
|
-
return data.long_name;
|
|
64
|
-
}
|
|
65
|
-
return "";
|
|
66
|
-
}
|
|
67
|
-
if (place) {
|
|
68
|
-
const street = findData("route");
|
|
69
|
-
const streetNumber = findData("street_number");
|
|
70
|
-
const neighborhood = findDataByMultipleTypes([
|
|
71
|
-
"sublocality_level_1",
|
|
72
|
-
"sublocality",
|
|
73
|
-
"neighborhood",
|
|
74
|
-
]);
|
|
75
|
-
const city = findData("administrative_area_level_2");
|
|
76
|
-
const state = findData("administrative_area_level_1");
|
|
77
|
-
const stateShortName = findDataShort("administrative_area_level_1");
|
|
78
|
-
const postalCode = findDataByMultipleTypes([
|
|
79
|
-
"postal_code",
|
|
80
|
-
"postal_code_prefix",
|
|
81
|
-
]);
|
|
82
|
-
const lat = place.geometry?.location?.lat();
|
|
83
|
-
const lng = place.geometry?.location?.lng();
|
|
84
|
-
const sendPlace = {
|
|
85
|
-
street,
|
|
86
|
-
city,
|
|
87
|
-
state,
|
|
88
|
-
neighborhood,
|
|
89
|
-
postalCode,
|
|
90
|
-
streetNumber,
|
|
91
|
-
stateShortName,
|
|
92
|
-
coordinates: { lat, lng },
|
|
93
|
-
};
|
|
94
|
-
onPlaceChanged && onPlaceChanged(sendPlace);
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
return (_jsx(StandaloneSearchBox, { onLoad: handleLoad, onPlacesChanged: handlePlacesChanged, options: options, children: _jsx(Input, { type: "text", autoComplete: "off", onChange: (e) => onChange && onChange(e.target.value), ...rest }) }));
|
|
98
|
-
}
|
|
99
|
-
export { SearchPlaces };
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useId, useRef, useState } from "react";
|
|
3
|
-
import { useForm } from "../../hooks/useForm";
|
|
4
|
-
import { FieldTemplate } from "../../services/fieldTemplate";
|
|
5
|
-
import { IconRenderer } from "../../services/iconRenderer";
|
|
6
|
-
import { SelectChevron } from "./selectChevron";
|
|
7
|
-
import { SelectContainer } from "./selectContainer";
|
|
8
|
-
import { SelectContent } from "./selectContent";
|
|
9
|
-
import { SelectOption } from "./selectOption";
|
|
10
|
-
import { SelectOptionsContainer } from "./selectOptionsContainer";
|
|
11
|
-
import { SelectOverlay } from "./selectOverlay";
|
|
12
|
-
import { SelectSpinner } from "./selectSpinner";
|
|
13
|
-
/**
|
|
14
|
-
* Select — single-option dropdown with optional search, label, validation, and form integration.
|
|
15
|
-
*
|
|
16
|
-
* Integrates with `useForm` to display validation errors by field name.
|
|
17
|
-
*
|
|
18
|
-
* @param props.name - Field name for form submission. Required.
|
|
19
|
-
* @param props.options - Array of selectable options (`{ label, value }`). Required.
|
|
20
|
-
* @param props.value - Controlled selected value.
|
|
21
|
-
* @param props.defaultValue - Uncontrolled default value. Default: ""
|
|
22
|
-
* @param props.label - Label text displayed above the select.
|
|
23
|
-
* @param props.placeholder - Placeholder shown when nothing is selected. Default: "Selecione..."
|
|
24
|
-
* @param props.errorMessage - Validation error message.
|
|
25
|
-
* @param props.isSearchable - Enables search/filter within the dropdown. Default: false
|
|
26
|
-
* @param props.isLoading - Shows a loading spinner and disables interactions. Default: false
|
|
27
|
-
* @param props.closeOnSelect - Closes the dropdown after selecting. Default: true
|
|
28
|
-
* @param props.onChange - Callback fired when the selected value changes.
|
|
29
|
-
* @param props.onSearch - Callback fired when the search query changes.
|
|
30
|
-
* @param props.size - Select size (`md` | `lg`). Default: "md"
|
|
31
|
-
* @param props.variant - Visual style variant. Default: "solid"
|
|
32
|
-
* @param props.orientation - Layout direction. Default: "horizontal"
|
|
33
|
-
* @param props.unShowFieldTemplate - Skips wrapper, label, and error rendering. Default: false
|
|
34
|
-
*
|
|
35
|
-
* @returns Select JSX element wrapped in `FieldTemplate`.
|
|
36
|
-
*
|
|
37
|
-
* @example
|
|
38
|
-
* ```tsx
|
|
39
|
-
* // Basic
|
|
40
|
-
* <Select
|
|
41
|
-
* name="category"
|
|
42
|
-
* options={[
|
|
43
|
-
* { label: "Technology", value: "tech" },
|
|
44
|
-
* { label: "Design", value: "design" },
|
|
45
|
-
* ]}
|
|
46
|
-
* />
|
|
47
|
-
*
|
|
48
|
-
* // With label, validation, and searchable
|
|
49
|
-
* <Select
|
|
50
|
-
* name="country"
|
|
51
|
-
* label="Country"
|
|
52
|
-
* showAsterisk
|
|
53
|
-
* isSearchable
|
|
54
|
-
* options={countryOptions}
|
|
55
|
-
* errorMessage={errors.country}
|
|
56
|
-
* notFoundText="No countries found"
|
|
57
|
-
* />
|
|
58
|
-
*
|
|
59
|
-
* // Controlled with async search
|
|
60
|
-
* <Select
|
|
61
|
-
* name="tag"
|
|
62
|
-
* label="Tag"
|
|
63
|
-
* value={selectedTag}
|
|
64
|
-
* onChange={setSelectedTag}
|
|
65
|
-
* onSearch={fetchTagOptions}
|
|
66
|
-
* isLoading={isLoadingTags}
|
|
67
|
-
* options={tagOptions}
|
|
68
|
-
* />
|
|
69
|
-
* ```
|
|
70
|
-
*/
|
|
71
|
-
function Select(props) {
|
|
72
|
-
const { name, options, className: wrapperClassName = "", placeholder = "Selecione...", closeOnSelect = true, defaultValue = "", errorMessage: baseErrorMessage, isLoading = false, readOnly = false, isSearchable = false, id, label, optionMaxHeight, showAsterisk, leftIcon: LeftIcon, onSearch, onChange, onBlur, notFoundText = "Sem opções disponíveis", onFocus, disabled: baseDisabled = false, prefix, size = "md", value, variant = "solid", orientation = "vertical", unShowFieldTemplate = false, } = props;
|
|
73
|
-
const { fieldErrors } = useForm();
|
|
74
|
-
const selectRef = useRef(null);
|
|
75
|
-
const selectId = id || useId();
|
|
76
|
-
const errorMessage = baseErrorMessage || fieldErrors?.[name];
|
|
77
|
-
const isError = !!errorMessage;
|
|
78
|
-
const disabled = baseDisabled || isLoading || readOnly;
|
|
79
|
-
const iconSizes = { md: 20, lg: 20 };
|
|
80
|
-
const iconSize = iconSizes[size];
|
|
81
|
-
const [search, setSearch] = useState("");
|
|
82
|
-
const [isFocused, setIsFocused] = useState(false);
|
|
83
|
-
const [selectedOption, setSelectedOption] = useState(defaultValue);
|
|
84
|
-
const forceSelectedOptions = value || selectedOption;
|
|
85
|
-
function optionHasSelected(value) {
|
|
86
|
-
return forceSelectedOptions === value;
|
|
87
|
-
}
|
|
88
|
-
function getOptionLabel(value) {
|
|
89
|
-
const option = options.find((option) => option.value === value);
|
|
90
|
-
return option?.label || "";
|
|
91
|
-
}
|
|
92
|
-
function handleContainerFocus() {
|
|
93
|
-
if (disabled || !selectRef?.current || isFocused)
|
|
94
|
-
return;
|
|
95
|
-
setIsFocused(true);
|
|
96
|
-
selectRef.current.focus();
|
|
97
|
-
onFocus && onFocus();
|
|
98
|
-
}
|
|
99
|
-
function handleBlur() {
|
|
100
|
-
setIsFocused(false);
|
|
101
|
-
if (onBlur && selectRef.current)
|
|
102
|
-
selectRef.current.blur();
|
|
103
|
-
}
|
|
104
|
-
function handleSearch(value) {
|
|
105
|
-
setSearch(value);
|
|
106
|
-
if (onSearch)
|
|
107
|
-
onSearch(value);
|
|
108
|
-
}
|
|
109
|
-
function handleChangeValue(value) {
|
|
110
|
-
if (optionHasSelected(value)) {
|
|
111
|
-
setSelectedOption("");
|
|
112
|
-
if (onChange)
|
|
113
|
-
onChange("");
|
|
114
|
-
}
|
|
115
|
-
else {
|
|
116
|
-
setSelectedOption(value);
|
|
117
|
-
if (onChange)
|
|
118
|
-
onChange(value);
|
|
119
|
-
}
|
|
120
|
-
if (closeOnSelect)
|
|
121
|
-
handleBlur();
|
|
122
|
-
}
|
|
123
|
-
const mappedOptions = options.filter((option) => {
|
|
124
|
-
if (props.onSearch)
|
|
125
|
-
return true;
|
|
126
|
-
if (!props.isSearchable)
|
|
127
|
-
return true;
|
|
128
|
-
if (option.label.toLowerCase().includes(search.toLowerCase()))
|
|
129
|
-
return true;
|
|
130
|
-
return false;
|
|
131
|
-
});
|
|
132
|
-
return (_jsx(FieldTemplate, { name: name, label: label, showAsterisk: showAsterisk, className: wrapperClassName, errorMessage: errorMessage, unShowFieldTemplate: unShowFieldTemplate, orientation: orientation, children: _jsxs(SelectContainer, { handleContainerFocus: handleContainerFocus, disabled: disabled, isError: isError, isFocused: isFocused, isLoading: isLoading, readOnly: readOnly, size: size, variant: variant, prefixExists: !!prefix, id: selectId, children: [_jsx("input", { ref: selectRef, name: name, value: forceSelectedOptions, type: "hidden" }), _jsx(IconRenderer, { iconSize: iconSize, icon: prefix, className: "prefix" }), LeftIcon && _jsx(LeftIcon, { size: iconSize, strokeWidth: 2.5 }), _jsxs(SelectContent, { size: size, children: [forceSelectedOptions !== "" && (_jsx("p", { className: "hasValue", children: getOptionLabel(forceSelectedOptions) })), forceSelectedOptions === "" && _jsx("p", { children: placeholder })] }), _jsxs(SelectOptionsContainer, { isFocused: isFocused, isSearchable: isSearchable, search: search, onSearch: handleSearch, children: [mappedOptions.map(({ label, value }) => (_jsx(SelectOption, { label: label, value: value, size: size, handleChangeValue: handleChangeValue, optionHasSelected: optionHasSelected }, value))), mappedOptions.length <= 0 && _jsx("p", { children: notFoundText })] }), _jsx(SelectChevron, { disabled: disabled, isFocused: isFocused, readOnly: readOnly, iconSize: iconSize, isLoading: isLoading }), _jsx(SelectSpinner, { iconSize: iconSize, isLoading: isLoading }), _jsx(SelectOverlay, { handleBlur: handleBlur, isFocused: isFocused })] }) }));
|
|
133
|
-
}
|
|
134
|
-
export { Select };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { ChevronDown } from "lucide-react";
|
|
3
|
-
import "./styles.css";
|
|
4
|
-
function SelectChevron(props) {
|
|
5
|
-
const { iconSize, isLoading, disabled, readOnly, isFocused } = props;
|
|
6
|
-
const notAnimate = disabled || readOnly ? "notAnimate" : "";
|
|
7
|
-
const focused = isFocused ? "focused" : "";
|
|
8
|
-
const className = `arkynSelectChevron ${notAnimate} ${focused}`;
|
|
9
|
-
if (isLoading)
|
|
10
|
-
return _jsx(_Fragment, {});
|
|
11
|
-
return (_jsx(ChevronDown, { className: className, strokeWidth: 2.5, style: {
|
|
12
|
-
minWidth: iconSize,
|
|
13
|
-
minHeight: iconSize,
|
|
14
|
-
maxWidth: iconSize,
|
|
15
|
-
maxHeight: iconSize,
|
|
16
|
-
} }));
|
|
17
|
-
}
|
|
18
|
-
export { SelectChevron };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import "./styles.css";
|
|
3
|
-
function SelectContainer(props) {
|
|
4
|
-
const { children, handleContainerFocus, disabled, isError, isLoading, isFocused, className, readOnly, variant, size, id, prefixExists, } = props;
|
|
5
|
-
const hasPrefix = prefixExists ? "hasPrefix" : "";
|
|
6
|
-
const errored = isError ? "errored" : "";
|
|
7
|
-
const opacity = disabled || readOnly || isLoading ? "opacity" : "";
|
|
8
|
-
const focused = isFocused ? "focused" : "";
|
|
9
|
-
return (_jsx("section", { id: id, className: `arkynSelectContainer ${hasPrefix} ${variant} ${size} ${opacity} ${errored} ${focused} ${className}`, onClick: handleContainerFocus, children: children }));
|
|
10
|
-
}
|
|
11
|
-
export { SelectContainer };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import "./styles.css";
|
|
3
|
-
function SelectContent(props) {
|
|
4
|
-
const { children, size } = props;
|
|
5
|
-
const className = `arkynSelectContent ${size}`;
|
|
6
|
-
return _jsx("div", { className: className, children: children });
|
|
7
|
-
}
|
|
8
|
-
export { SelectContent };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Check } from "lucide-react";
|
|
3
|
-
import "./styles.css";
|
|
4
|
-
function SelectOption(props) {
|
|
5
|
-
const { label, optionHasSelected, handleChangeValue, value, size } = props;
|
|
6
|
-
const hasActive = optionHasSelected(value) ? "active" : "";
|
|
7
|
-
const className = `arkynSelectOption ${size} ${hasActive}`;
|
|
8
|
-
return (_jsxs("div", { onClick: () => handleChangeValue(value), className: className, children: [label, " ", _jsx(Check, {})] }));
|
|
9
|
-
}
|
|
10
|
-
export { SelectOption };
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Search } from "lucide-react";
|
|
3
|
-
import { useEffect, useRef, useState } from "react";
|
|
4
|
-
import { useScrollLock } from "../../../hooks/useScrollLock";
|
|
5
|
-
import { Input } from "../../input";
|
|
6
|
-
import "./styles.css";
|
|
7
|
-
function SelectOptionsContainer(props) {
|
|
8
|
-
const { children, isFocused, isSearchable, search, onSearch } = props;
|
|
9
|
-
const containerRef = useRef(null);
|
|
10
|
-
const [position, setPosition] = useState("bottom");
|
|
11
|
-
useScrollLock(isFocused);
|
|
12
|
-
useEffect(() => {
|
|
13
|
-
if (!isFocused)
|
|
14
|
-
return;
|
|
15
|
-
const checkContainerPosition = () => {
|
|
16
|
-
if (!containerRef.current)
|
|
17
|
-
return;
|
|
18
|
-
const parentElement = containerRef.current.parentElement;
|
|
19
|
-
if (!parentElement)
|
|
20
|
-
return;
|
|
21
|
-
const parentRect = parentElement.getBoundingClientRect();
|
|
22
|
-
const viewportHeight = window.innerHeight;
|
|
23
|
-
const estimatedContainerHeight = 300;
|
|
24
|
-
const spaceBelow = viewportHeight - parentRect.bottom;
|
|
25
|
-
if (spaceBelow < estimatedContainerHeight &&
|
|
26
|
-
parentRect.top > estimatedContainerHeight) {
|
|
27
|
-
setPosition("top");
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
setPosition("bottom");
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
checkContainerPosition();
|
|
34
|
-
}, [isFocused]);
|
|
35
|
-
function handleSearch(e) {
|
|
36
|
-
if (!isSearchable)
|
|
37
|
-
return;
|
|
38
|
-
onSearch(e.target.value);
|
|
39
|
-
}
|
|
40
|
-
if (!isFocused)
|
|
41
|
-
return _jsx(_Fragment, {});
|
|
42
|
-
return (_jsxs("div", { ref: containerRef, className: `arkynSelectOptionsContainer ${position}`, children: [isSearchable && (_jsx(Input, { type: "search", name: "search-select", variant: "underline", leftIcon: Search, value: search, onChange: handleSearch })), children] }));
|
|
43
|
-
}
|
|
44
|
-
export { SelectOptionsContainer };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import "./styles.css";
|
|
3
|
-
function SelectOverlay(props) {
|
|
4
|
-
const { isFocused, handleBlur } = props;
|
|
5
|
-
if (!isFocused)
|
|
6
|
-
return _jsx(_Fragment, {});
|
|
7
|
-
return _jsx("aside", { className: "arkynSelectOverlay", onClick: handleBlur });
|
|
8
|
-
}
|
|
9
|
-
export { SelectOverlay };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Loader2 } from "lucide-react";
|
|
3
|
-
import "./styles.css";
|
|
4
|
-
function SelectSpinner(props) {
|
|
5
|
-
const { iconSize, isLoading } = props;
|
|
6
|
-
if (!isLoading)
|
|
7
|
-
return _jsx(_Fragment, {});
|
|
8
|
-
return (_jsx(Loader2, { className: "arkynSelectSpinner", size: iconSize, strokeWidth: 2.5 }));
|
|
9
|
-
}
|
|
10
|
-
export { SelectSpinner };
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useRef, useState } from "react";
|
|
3
|
-
import "./styles.css";
|
|
4
|
-
/**
|
|
5
|
-
* Slider — interactive track for selecting a numeric value between 0 and 100.
|
|
6
|
-
*
|
|
7
|
-
* Pair with `useSlider` for managed state.
|
|
8
|
-
*
|
|
9
|
-
* @param props.value - Current position as a percentage (0–100). Required.
|
|
10
|
-
* @param props.onChange - Callback fired on value change. Required.
|
|
11
|
-
* @param props.disabled - Disables interactions. Default: false
|
|
12
|
-
* @param props.onDragging - Callback fired when dragging starts or stops.
|
|
13
|
-
*
|
|
14
|
-
* **...Other valid HTML properties for `<div>`**
|
|
15
|
-
*
|
|
16
|
-
* @returns Slider JSX element.
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```tsx
|
|
20
|
-
* // Controlled slider
|
|
21
|
-
* const [value, setValue] = useState(50);
|
|
22
|
-
* <Slider value={value} onChange={setValue} />
|
|
23
|
-
*
|
|
24
|
-
* // With useSlider hook
|
|
25
|
-
* const [value, setValue] = useSlider(25);
|
|
26
|
-
* <Slider value={value} onChange={setValue} onDragging={setIsDragging} />
|
|
27
|
-
*
|
|
28
|
-
* // Disabled
|
|
29
|
-
* <Slider value={75} onChange={() => {}} disabled />
|
|
30
|
-
* ```
|
|
31
|
-
*/
|
|
32
|
-
function Slider(props) {
|
|
33
|
-
const { onChange, value, disabled = false, onDragging, className = "", ...rest } = props;
|
|
34
|
-
const [isDragging, setIsDragging] = useState(false);
|
|
35
|
-
const sliderRef = useRef(null);
|
|
36
|
-
const handleMouseDown = () => setIsDragging(true);
|
|
37
|
-
const handleMouseUp = () => setIsDragging(false);
|
|
38
|
-
const handleMouseMove = (event) => {
|
|
39
|
-
if (disabled)
|
|
40
|
-
return;
|
|
41
|
-
if (!isDragging || !sliderRef.current)
|
|
42
|
-
return;
|
|
43
|
-
const rect = sliderRef.current.getBoundingClientRect();
|
|
44
|
-
const offsetX = event.clientX - rect.left;
|
|
45
|
-
const newValue = Math.min(Math.max((offsetX / rect.width) * 100, 0), 100);
|
|
46
|
-
onChange(newValue);
|
|
47
|
-
};
|
|
48
|
-
const handleSliderClick = (event) => {
|
|
49
|
-
if (disabled)
|
|
50
|
-
return;
|
|
51
|
-
if (!sliderRef.current)
|
|
52
|
-
return;
|
|
53
|
-
const rect = sliderRef.current.getBoundingClientRect();
|
|
54
|
-
const offsetX = event.clientX - rect.left;
|
|
55
|
-
const newValue = Math.min(Math.max((offsetX / rect.width) * 100, 0), 100);
|
|
56
|
-
onChange(newValue);
|
|
57
|
-
};
|
|
58
|
-
useEffect(() => {
|
|
59
|
-
if (isDragging) {
|
|
60
|
-
onDragging && onDragging(true);
|
|
61
|
-
document.addEventListener("mousemove", handleMouseMove);
|
|
62
|
-
document.addEventListener("mouseup", handleMouseUp);
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
onDragging && onDragging(false);
|
|
66
|
-
document.removeEventListener("mousemove", handleMouseMove);
|
|
67
|
-
document.removeEventListener("mouseup", handleMouseUp);
|
|
68
|
-
}
|
|
69
|
-
return () => {
|
|
70
|
-
document.removeEventListener("mousemove", handleMouseMove);
|
|
71
|
-
document.removeEventListener("mouseup", handleMouseUp);
|
|
72
|
-
};
|
|
73
|
-
}, [isDragging]);
|
|
74
|
-
const isDraggingClass = isDragging ? "isDragging" : "isNotDragging";
|
|
75
|
-
const disabledClass = disabled ? "isDisabled" : "isEnabled";
|
|
76
|
-
const sliderClassname = `arkynSliderTrack ${isDraggingClass} ${disabledClass} ${className}`;
|
|
77
|
-
return (_jsxs("div", { ...rest, className: sliderClassname, onMouseDown: handleMouseDown, onClick: handleSliderClick, ref: sliderRef, children: [_jsx("div", { className: "arkynSliderFill", style: { width: `${value}%` } }), _jsx("div", { className: "arkynSliderThumb", style: { left: `${value}%` } })] }));
|
|
78
|
-
}
|
|
79
|
-
export { Slider };
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useId, useRef, useState } from "react";
|
|
3
|
-
import { FieldTemplate } from "../../services/fieldTemplate";
|
|
4
|
-
import "./styles.css";
|
|
5
|
-
/**
|
|
6
|
-
* Switch — toggle input for binary on/off states.
|
|
7
|
-
*
|
|
8
|
-
* Stores value in a hidden `<input>` for native form submission.
|
|
9
|
-
* Integrates with `useForm` to display validation errors by field name.
|
|
10
|
-
*
|
|
11
|
-
* @param props.name - Field name for form submission. Required.
|
|
12
|
-
* @param props.label - Label text displayed beside the switch.
|
|
13
|
-
* @param props.size - Switch size (`sm` | `md` | `lg`). Default: "lg"
|
|
14
|
-
* @param props.defaultChecked - Uncontrolled initial checked state. Default: false
|
|
15
|
-
* @param props.checked - Controlled checked state.
|
|
16
|
-
* @param props.value - Value emitted when on. Default: "checked"
|
|
17
|
-
* @param props.unCheckedValue - Value emitted when off. Default: ""
|
|
18
|
-
* @param props.onCheck - Callback fired on toggle — receives the current value string.
|
|
19
|
-
* @param props.orientation - Layout direction (`horizontal` | `vertical` | `horizontalReverse`). Default: "horizontalReverse"
|
|
20
|
-
* @param props.unShowFieldTemplate - Skips wrapper, label, and error rendering. Default: false
|
|
21
|
-
* @param props.showAsterisk - Appends `*` to the label.
|
|
22
|
-
* @param props.errorMessage - Validation error message.
|
|
23
|
-
*
|
|
24
|
-
* **...Other valid HTML properties for `<button>` (except `children`, `onChange`, `defaultValue`)**
|
|
25
|
-
*
|
|
26
|
-
* @returns Switch JSX element wrapped in `FieldTemplate`.
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* ```tsx
|
|
30
|
-
* // Basic
|
|
31
|
-
* <Switch name="notifications" label="Enable notifications" />
|
|
32
|
-
*
|
|
33
|
-
* // Custom on/off values
|
|
34
|
-
* <Switch
|
|
35
|
-
* name="theme"
|
|
36
|
-
* label="Dark mode"
|
|
37
|
-
* value="dark"
|
|
38
|
-
* unCheckedValue="light"
|
|
39
|
-
* onCheck={(v) => setTheme(v)}
|
|
40
|
-
* />
|
|
41
|
-
*
|
|
42
|
-
* // Controlled
|
|
43
|
-
* <Switch
|
|
44
|
-
* name="autoSave"
|
|
45
|
-
* label="Auto-save"
|
|
46
|
-
* checked={isAutoSaveEnabled}
|
|
47
|
-
* onCheck={(v) => setAutoSave(!!v)}
|
|
48
|
-
* size="md"
|
|
49
|
-
* />
|
|
50
|
-
* ```
|
|
51
|
-
*/
|
|
52
|
-
function Switch(props) {
|
|
53
|
-
const { label, size = "lg", defaultChecked = false, checked: baseChecked = null, value, unCheckedValue = "", name, className: baseClassName = "", onCheck, id, orientation = "horizontalReverse", className: wrapperClassName = "", showAsterisk, errorMessage, unShowFieldTemplate = false, ...rest } = props;
|
|
54
|
-
const inputRef = useRef(null);
|
|
55
|
-
const inputId = id || useId();
|
|
56
|
-
const [isChecked, setIsChecked] = useState(defaultChecked);
|
|
57
|
-
const currentChecked = typeof baseChecked === "boolean" ? baseChecked : isChecked;
|
|
58
|
-
function handleCheck() {
|
|
59
|
-
setIsChecked(!isChecked);
|
|
60
|
-
onCheck && onCheck(!currentChecked ? value || "checked" : unCheckedValue);
|
|
61
|
-
}
|
|
62
|
-
const checkedClass = currentChecked ? "checkedTrue" : "checkedFalse";
|
|
63
|
-
const className = `arkynSwitch ${checkedClass} ${size} ${baseClassName}`;
|
|
64
|
-
return (_jsx(FieldTemplate, { name: name, label: label, showAsterisk: showAsterisk, className: wrapperClassName, errorMessage: errorMessage, unShowFieldTemplate: unShowFieldTemplate, orientation: orientation, children: _jsx("button", { type: "button", onClick: handleCheck, className: className, ...rest, children: _jsx("input", { id: inputId, type: "hidden", name: name, ref: inputRef, onClick: handleCheck, value: currentChecked ? value || "checked" : unCheckedValue }) }) }));
|
|
65
|
-
}
|
|
66
|
-
export { Switch };
|