@arkyn/components 3.0.1-beta.154 → 3.0.1-beta.156
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/index.js +4694 -75
- package/dist/modules/components/alert/alertContainer/index.js +22 -0
- package/dist/modules/components/alert/alertContent/index.js +9 -0
- package/dist/modules/components/alert/alertDescription/index.js +9 -0
- package/dist/modules/components/alert/alertIcon/index.js +20 -0
- package/dist/modules/components/alert/alertTitle/index.js +9 -0
- package/dist/modules/components/audioPlayer/index.js +76 -0
- package/dist/modules/components/audioUpload/hasFileContent/index.js +63 -0
- package/dist/modules/components/audioUpload/index.js +80 -0
- package/dist/modules/components/audioUpload/noFileContent/index.js +46 -0
- package/dist/modules/components/badge/index.js +23 -0
- package/dist/modules/components/button/index.js +33 -0
- package/dist/modules/components/calendar/_calendarProvider.js +65 -0
- package/dist/modules/components/calendar/_viewService.js +141 -0
- package/dist/modules/components/calendar/calendarContainer/index.js +8 -0
- package/dist/modules/components/calendar/calendarHeader/index.js +73 -0
- package/dist/modules/components/calendar/calendarTableBody/index.js +11 -0
- package/dist/modules/components/calendar/calendarTableContainer/index.js +8 -0
- package/dist/modules/components/calendar/calendarTableHeader/index.js +11 -0
- package/dist/modules/components/calendar/calendarTableTd/index.js +24 -0
- package/dist/modules/components/calendar/index.js +50 -0
- package/dist/modules/components/cardTab/cardTabButton/index.js +30 -0
- package/dist/modules/components/cardTab/cardTabContainer/index.js +29 -0
- package/dist/modules/components/cardTab/cardTabContext.js +13 -0
- package/dist/modules/components/checkbox/index.js +65 -0
- package/dist/modules/components/clientOnly.js +9 -0
- package/dist/modules/components/currencyInput/index.js +140 -0
- package/dist/modules/components/divider/index.js +13 -0
- package/dist/modules/components/drawer/drawerContainer/index.js +44 -0
- package/dist/modules/components/drawer/drawerContext.js +13 -0
- package/dist/modules/components/drawer/drawerHeader/index.js +28 -0
- package/dist/modules/components/facebookPixel/facebookPixel.client.js +19 -0
- package/dist/modules/components/facebookPixel/index.js +9 -0
- package/dist/modules/components/facebookPixel/pixel.js +53 -0
- package/dist/modules/components/fieldError/index.js +9 -0
- package/dist/modules/components/fieldLabel/index.js +13 -0
- package/dist/modules/components/fieldWrapper/index.js +14 -0
- package/dist/modules/components/fileUpload/hasFileContent/index.js +68 -0
- package/dist/modules/components/fileUpload/index.js +73 -0
- package/dist/modules/components/fileUpload/noFileContent/index.js +46 -0
- package/dist/modules/components/fullCalendar/_fullCalendarProvider.js +48 -0
- package/dist/modules/components/fullCalendar/_viewService.js +106 -0
- package/dist/modules/components/fullCalendar/dayCalendar/dayCalendarContainer/index.js +8 -0
- package/dist/modules/components/fullCalendar/dayCalendar/dayCalendarEvent/index.js +79 -0
- package/dist/modules/components/fullCalendar/dayCalendar/dayCalendarRow/index.js +34 -0
- package/dist/modules/components/fullCalendar/dayCalendar/index.js +11 -0
- package/dist/modules/components/fullCalendar/fullCalendarContainer/index.js +8 -0
- package/dist/modules/components/fullCalendar/fullCalendarHeader/index.js +72 -0
- package/dist/modules/components/fullCalendar/index.js +31 -0
- package/dist/modules/components/fullCalendar/monthlyCalendar/index.js +13 -0
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarEvent/index.js +37 -0
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableBody/index.js +11 -0
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableContainer/index.js +10 -0
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableHeader/index.js +11 -0
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableTd/index.js +37 -0
- package/dist/modules/components/fullCalendar/weekCalendar/index.js +13 -0
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarEvent/index.js +79 -0
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableBody/index.js +21 -0
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableContainer/index.js +10 -0
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableHeader/index.js +20 -0
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableTd/index.js +40 -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 +16 -0
- package/dist/modules/components/googleTagManager/googleTagManager.client.js +8 -0
- package/dist/modules/components/googleTagManager/googleTagManager.js +49 -0
- package/dist/modules/components/googleTagManager/index.js +28 -0
- package/dist/modules/components/googleTagManager/snippets/appendToDataLayer.js +9 -0
- package/dist/modules/components/googleTagManager/snippets/generateGTMElements.js +24 -0
- package/dist/modules/components/iconButton/index.js +30 -0
- package/dist/modules/components/imageUpload/hasFileContent/index.js +64 -0
- package/dist/modules/components/imageUpload/index.js +83 -0
- package/dist/modules/components/imageUpload/noFileContent/index.js +46 -0
- package/dist/modules/components/input/index.js +121 -0
- package/dist/modules/components/mapView/index.js +33 -0
- package/dist/modules/components/mapView/mapView.client.js +52 -0
- package/dist/modules/components/maskedInput/index.js +113 -0
- package/dist/modules/components/modal/modalContainer/index.js +43 -0
- package/dist/modules/components/modal/modalContext.js +13 -0
- package/dist/modules/components/modal/modalFooter/index.js +9 -0
- package/dist/modules/components/modal/modalHeader/index.js +28 -0
- package/dist/modules/components/multiSelect/index.js +155 -0
- package/dist/modules/components/multiSelect/multiSelectChevron/index.js +22 -0
- package/dist/modules/components/multiSelect/multiSelectContainer/index.js +30 -0
- package/dist/modules/components/multiSelect/multiSelectContent/index.js +9 -0
- package/dist/modules/components/multiSelect/multiSelectMark/index.js +23 -0
- package/dist/modules/components/multiSelect/multiSelectOption/index.js +14 -0
- package/dist/modules/components/multiSelect/multiSelectOptionsContainer/index.js +46 -0
- package/dist/modules/components/multiSelect/multiSelectOverlay/index.js +9 -0
- package/dist/modules/components/multiSelect/multiSelectSpinner/index.js +17 -0
- package/dist/modules/components/pagination/chevronButton/index.js +18 -0
- package/dist/modules/components/pagination/currentButton/index.js +8 -0
- package/dist/modules/components/pagination/index.js +84 -0
- package/dist/modules/components/pagination/pageButton/index.js +9 -0
- package/dist/modules/components/pagination/paginationService.js +49 -0
- package/dist/modules/components/pagination/spread/index.js +9 -0
- package/dist/modules/components/phoneInput/index.js +152 -0
- package/dist/modules/components/phoneInput/phoneInputContainer/index.js +20 -0
- package/dist/modules/components/phoneInput/phoneInputCountriesOverlay/index.js +9 -0
- package/dist/modules/components/phoneInput/phoneInputCountryOption/index.js +16 -0
- package/dist/modules/components/phoneInput/phoneInputCountryOptionsContainer/index.js +44 -0
- package/dist/modules/components/phoneInput/phoneInputCountrySelector/index.js +22 -0
- package/dist/modules/components/phoneInput/phoneInputMask/index.js +62 -0
- package/dist/modules/components/popover/index.js +37 -0
- package/dist/modules/components/radio/radioBox/index.js +43 -0
- package/dist/modules/components/radio/radioContext.js +20 -0
- package/dist/modules/components/radio/radioGroup/index.js +65 -0
- package/dist/modules/components/richText/blockButton/index.js +24 -0
- package/dist/modules/components/richText/element/index.js +59 -0
- package/dist/modules/components/richText/index.js +136 -0
- package/dist/modules/components/richText/insertImage/index.js +106 -0
- package/dist/modules/components/richText/insertVideo/index.js +98 -0
- package/dist/modules/components/richText/leaf/index.js +7 -0
- package/dist/modules/components/richText/markButton/index.js +23 -0
- package/dist/modules/components/richText/toolbar/index.js +8 -0
- package/dist/modules/components/searchPlaces.js +67 -0
- package/dist/modules/components/select/index.js +145 -0
- package/dist/modules/components/select/selectChevron/index.js +22 -0
- package/dist/modules/components/select/selectContainer/index.js +30 -0
- package/dist/modules/components/select/selectContent/index.js +9 -0
- package/dist/modules/components/select/selectOption/index.js +14 -0
- package/dist/modules/components/select/selectOptionsContainer/index.js +46 -0
- package/dist/modules/components/select/selectOverlay/index.js +9 -0
- package/dist/modules/components/select/selectSpinner/index.js +10 -0
- package/dist/modules/components/slider/index.js +42 -0
- package/dist/modules/components/switch/index.js +63 -0
- package/dist/modules/components/tab/tabButton/index.js +30 -0
- package/dist/modules/components/tab/tabContainer/index.js +29 -0
- package/dist/modules/components/tab/tabContext.js +13 -0
- package/dist/modules/components/table/tableBody/index.js +15 -0
- package/dist/modules/components/table/tableCaption/index.js +9 -0
- package/dist/modules/components/table/tableContainer/index.js +9 -0
- package/dist/modules/components/table/tableFooter/index.js +12 -0
- package/dist/modules/components/table/tableHeader/index.js +12 -0
- package/dist/modules/components/textarea/index.js +70 -0
- package/dist/modules/components/tooltip/index.js +46 -0
- package/dist/modules/hooks/useAutomation.js +28 -0
- package/dist/modules/hooks/useDrawer.js +20 -0
- package/dist/modules/hooks/useForm.js +8 -0
- package/dist/modules/hooks/useHydrated.js +15 -0
- package/dist/modules/hooks/useModal.js +20 -0
- package/dist/modules/hooks/useScopedParams.js +18 -0
- package/dist/modules/hooks/useScrollLock.js +21 -0
- package/dist/modules/hooks/useSearchAutomation.js +15 -0
- package/dist/modules/hooks/useSlider.js +14 -0
- package/dist/modules/hooks/useToast.js +11 -0
- package/dist/modules/index.js +144 -0
- package/dist/modules/providers/drawerProvider.js +31 -0
- package/dist/modules/providers/formProvider.js +18 -0
- package/dist/modules/providers/modalProvider.js +34 -0
- package/dist/modules/providers/placesProvider.js +18 -0
- package/dist/modules/providers/toastProvider.js +52 -0
- package/dist/modules/services/extractTextFromNode.js +7 -0
- package/dist/modules/services/fieldTemplate.js +24 -0
- package/dist/modules/services/iconRenderer.js +8 -0
- package/dist/modules/services/isBlockActive.js +15 -0
- package/dist/modules/services/isMarkActive.js +8 -0
- package/dist/modules/services/maskCurrencyValues.js +14 -0
- package/dist/modules/services/toHtml.js +7 -0
- package/dist/modules/services/toRichTextValue.js +9 -0
- package/dist/modules/services/toggleBlock.js +20 -0
- package/dist/modules/services/toggleMark.js +8 -0
- package/dist/modules/style.css +1 -0
- package/dist/modules/templates/badResponses.js +14 -0
- package/dist/modules/templates/richTextTemplates.js +14 -0
- package/dist/modules/templates/successResponses.js +4 -0
- package/dist/modules/utils/phoneInputUtilities.js +32 -0
- package/dist/modules/utils/richTextUtilities.js +77 -0
- package/package.json +208 -208
- 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/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,25 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useFullCalendar } from "../../_fullCalendarProvider";
|
|
3
|
-
import { WeekCalendarEvent } from "../weekCalendarEvent";
|
|
4
|
-
import "./styles.css";
|
|
5
|
-
function WeekCalendarTableTd(props) {
|
|
6
|
-
const { day, month, year, dayOwner, timeInMinutes } = props;
|
|
7
|
-
const { blockedTimestamps, onClickDate } = useFullCalendar();
|
|
8
|
-
function isBlocked() {
|
|
9
|
-
const currentDate = new Date(year, month, day);
|
|
10
|
-
return blockedTimestamps.some((timestamp) => currentDate >= timestamp.initialDate &&
|
|
11
|
-
currentDate <= timestamp.endDate);
|
|
12
|
-
}
|
|
13
|
-
function handleClick(event) {
|
|
14
|
-
event.stopPropagation();
|
|
15
|
-
if (isBlocked())
|
|
16
|
-
return;
|
|
17
|
-
if (onClickDate) {
|
|
18
|
-
const date = new Date(year, month, day);
|
|
19
|
-
date.setHours(0, timeInMinutes, 0, 0);
|
|
20
|
-
onClickDate(date);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return (_jsx("td", { className: `arkynWeekCalendarTableTd ${dayOwner} ${isBlocked() ? "blocked" : ""}`, "data-day": day, "data-time": timeInMinutes, onClick: handleClick, children: _jsx("div", { className: "arkynWeekCalendarTableTdContent", children: _jsx(WeekCalendarEvent, { day: day, month: month, year: year, timeInMinutes: timeInMinutes }) }) }));
|
|
24
|
-
}
|
|
25
|
-
export { WeekCalendarTableTd };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { GoogleAnalytics } from "./googleAnalytics";
|
|
3
|
-
function GoogleAnalyticsClient(props) {
|
|
4
|
-
const googleAnalytics = new GoogleAnalytics();
|
|
5
|
-
googleAnalytics.initialize(props);
|
|
6
|
-
return _jsx(_Fragment, {});
|
|
7
|
-
}
|
|
8
|
-
export { GoogleAnalyticsClient };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { generateGAElements } from "./snippets/generateGAElements";
|
|
2
|
-
class GoogleAnalytics {
|
|
3
|
-
initializeAsyncScript(src) {
|
|
4
|
-
const script = document.createElement("script");
|
|
5
|
-
script.async = true;
|
|
6
|
-
script.src = src;
|
|
7
|
-
return script;
|
|
8
|
-
}
|
|
9
|
-
initializeInlineScript(content) {
|
|
10
|
-
const script = document.createElement("script");
|
|
11
|
-
script.innerHTML = content;
|
|
12
|
-
return script;
|
|
13
|
-
}
|
|
14
|
-
initialize(props) {
|
|
15
|
-
const { measurementId } = props;
|
|
16
|
-
const elements = generateGAElements({ measurementId });
|
|
17
|
-
const asyncScript = this.initializeAsyncScript(elements.src);
|
|
18
|
-
const inlineScript = this.initializeInlineScript(elements.script);
|
|
19
|
-
document.head.appendChild(asyncScript);
|
|
20
|
-
document.head.appendChild(inlineScript);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
export { GoogleAnalytics };
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { ClientOnly } from "../clientOnly";
|
|
3
|
-
import { GoogleAnalyticsClient } from "./googleAnalytics.client";
|
|
4
|
-
/**
|
|
5
|
-
* GoogleAnalytics — injects the Google Analytics 4 script into the page client-side.
|
|
6
|
-
*
|
|
7
|
-
* Renders nothing in development mode unless `showInDevMode` is `true`.
|
|
8
|
-
* Wrapped in `ClientOnly` to avoid SSR errors.
|
|
9
|
-
*
|
|
10
|
-
* @param props.measurementId - GA4 Measurement ID (e.g. `"G-XXXXXXXXXX"`). Required.
|
|
11
|
-
* @param props.showInDevMode - Renders in development mode. Default: false
|
|
12
|
-
*
|
|
13
|
-
* @returns GoogleAnalytics JSX element, or an empty fragment in dev mode.
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```tsx
|
|
17
|
-
* // In your root layout
|
|
18
|
-
* <GoogleAnalytics measurementId="G-XXXXXXXXXX" />
|
|
19
|
-
*
|
|
20
|
-
* // Enable in development for testing
|
|
21
|
-
* <GoogleAnalytics measurementId="G-XXXXXXXXXX" showInDevMode />
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
function GoogleAnalytics(props) {
|
|
25
|
-
const { measurementId, showInDevMode = false } = props;
|
|
26
|
-
if (process.env.NODE_ENV !== "production" && !showInDevMode) {
|
|
27
|
-
return _jsx(_Fragment, {});
|
|
28
|
-
}
|
|
29
|
-
return (_jsx(ClientOnly, { children: () => _jsx(GoogleAnalyticsClient, { measurementId: measurementId }) }));
|
|
30
|
-
}
|
|
31
|
-
export { GoogleAnalytics };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
function generateGAElements(props) {
|
|
2
|
-
const { measurementId } = props;
|
|
3
|
-
if (!measurementId)
|
|
4
|
-
console.warn("Google Analytics Measurement ID is required");
|
|
5
|
-
const src = `https://www.googletagmanager.com/gtag/js?id=${measurementId}`;
|
|
6
|
-
const script = `
|
|
7
|
-
window.dataLayer = window.dataLayer || [];
|
|
8
|
-
function gtag(){dataLayer.push(arguments);}
|
|
9
|
-
gtag('js', new Date());
|
|
10
|
-
gtag('config', '${measurementId}');`;
|
|
11
|
-
return {
|
|
12
|
-
src,
|
|
13
|
-
script,
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
export { generateGAElements };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { GoogleTagManager } from "./googleTagManager";
|
|
3
|
-
function GoogleTagManagerClient(props) {
|
|
4
|
-
const googleTagManager = new GoogleTagManager();
|
|
5
|
-
googleTagManager.initialize(props);
|
|
6
|
-
return _jsx(_Fragment, {});
|
|
7
|
-
}
|
|
8
|
-
export { GoogleTagManagerClient };
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { appendToDataLayer } from "./snippets/appendToDataLayer";
|
|
2
|
-
import { generateGTMElements } from "./snippets/generateGTMElements";
|
|
3
|
-
class GoogleTagManager {
|
|
4
|
-
initializeDataScript(dataLayer) {
|
|
5
|
-
const script = document.createElement("script");
|
|
6
|
-
script.innerHTML = dataLayer;
|
|
7
|
-
return script;
|
|
8
|
-
}
|
|
9
|
-
initializeGTMElements(props) {
|
|
10
|
-
const snippets = generateGTMElements(props);
|
|
11
|
-
const noScript = () => {
|
|
12
|
-
const noscript = document.createElement("noscript");
|
|
13
|
-
noscript.innerHTML = snippets.iframe;
|
|
14
|
-
return noscript;
|
|
15
|
-
};
|
|
16
|
-
const script = () => {
|
|
17
|
-
const script = document.createElement("script");
|
|
18
|
-
script.innerHTML = snippets.script;
|
|
19
|
-
return script;
|
|
20
|
-
};
|
|
21
|
-
const dataScript = this.initializeDataScript(snippets.dataLayerVar);
|
|
22
|
-
return {
|
|
23
|
-
noScript,
|
|
24
|
-
script,
|
|
25
|
-
dataScript,
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
initializeDataLayer(props) {
|
|
29
|
-
const { dataLayer, dataLayerName } = props;
|
|
30
|
-
if (window[dataLayerName])
|
|
31
|
-
return window[dataLayerName].push(dataLayer);
|
|
32
|
-
const snippets = appendToDataLayer({ dataLayer, dataLayerName });
|
|
33
|
-
const dataScript = this.initializeDataScript(snippets);
|
|
34
|
-
document.head.insertBefore(dataScript, document.head.childNodes[0]);
|
|
35
|
-
}
|
|
36
|
-
initialize(props) {
|
|
37
|
-
const { events, gtmId, dataLayer, auth = "", preview = "", dataLayerName = "dataLayer", } = props;
|
|
38
|
-
const gtm = this.initializeGTMElements({
|
|
39
|
-
id: gtmId,
|
|
40
|
-
events: events,
|
|
41
|
-
dataLayer: dataLayer || undefined,
|
|
42
|
-
dataLayerName: dataLayerName,
|
|
43
|
-
auth,
|
|
44
|
-
preview,
|
|
45
|
-
});
|
|
46
|
-
if (dataLayer)
|
|
47
|
-
document.head.appendChild(gtm.dataScript);
|
|
48
|
-
document.head.insertBefore(gtm.script(), document.head.childNodes[0]);
|
|
49
|
-
document.body.insertBefore(gtm.noScript(), document.body.childNodes[0]);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
export { GoogleTagManager };
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { ClientOnly } from "../clientOnly";
|
|
3
|
-
import { GoogleTagManagerClient } from "./googleTagManager.client";
|
|
4
|
-
/**
|
|
5
|
-
* GoogleTagManager — injects the GTM `<script>` and `<noscript>` snippets into the page client-side.
|
|
6
|
-
*
|
|
7
|
-
* Renders nothing in development mode unless `showInDevMode` is `true`.
|
|
8
|
-
* Wrapped in `ClientOnly` to avoid SSR errors.
|
|
9
|
-
*
|
|
10
|
-
* @param props.gtmId - GTM container ID (e.g. `"GTM-XXXXXXX"`). Required.
|
|
11
|
-
* @param props.dataLayer - Initial key-value pairs for the dataLayer.
|
|
12
|
-
* @param props.dataLayerName - Global dataLayer variable name. Default: "dataLayer"
|
|
13
|
-
* @param props.events - Additional key-value pairs pushed on initialization.
|
|
14
|
-
* @param props.auth - GTM environment auth token.
|
|
15
|
-
* @param props.preview - GTM environment preview token (e.g. `"env-3"`).
|
|
16
|
-
* @param props.showInDevMode - Renders in development mode. Default: false
|
|
17
|
-
*
|
|
18
|
-
* @returns GoogleTagManager JSX element, or an empty fragment in dev mode.
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* ```tsx
|
|
22
|
-
* // Basic setup in your root layout
|
|
23
|
-
* <GoogleTagManager gtmId="GTM-XXXXXXX" />
|
|
24
|
-
*
|
|
25
|
-
* // With initial dataLayer values
|
|
26
|
-
* <GoogleTagManager
|
|
27
|
-
* gtmId="GTM-XXXXXXX"
|
|
28
|
-
* dataLayer={{ pageType: "home", userType: "anonymous" }}
|
|
29
|
-
* />
|
|
30
|
-
*
|
|
31
|
-
* // Staging/preview environment
|
|
32
|
-
* <GoogleTagManager
|
|
33
|
-
* gtmId="GTM-XXXXXXX"
|
|
34
|
-
* auth="your-auth-token"
|
|
35
|
-
* preview="env-3"
|
|
36
|
-
* showInDevMode
|
|
37
|
-
* />
|
|
38
|
-
* ```
|
|
39
|
-
*/
|
|
40
|
-
function GoogleTagManager(props) {
|
|
41
|
-
const { gtmId, auth = "", preview = "", dataLayerName = "dataLayer", events = {}, dataLayer = {}, showInDevMode = false, } = props;
|
|
42
|
-
if (process.env.NODE_ENV !== "production" && !showInDevMode) {
|
|
43
|
-
return _jsx(_Fragment, {});
|
|
44
|
-
}
|
|
45
|
-
return (_jsx(ClientOnly, { children: () => (_jsx(GoogleTagManagerClient, { auth: auth, dataLayer: dataLayer, dataLayerName: dataLayerName, events: events, gtmId: gtmId, preview: preview })) }));
|
|
46
|
-
}
|
|
47
|
-
export { GoogleTagManager };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { appendToDataLayer } from "./appendToDataLayer";
|
|
2
|
-
function generateGTMElements(props) {
|
|
3
|
-
const { id, events, dataLayer, dataLayerName, preview, auth } = props;
|
|
4
|
-
const gtmAuth = `>m_auth=${auth}`;
|
|
5
|
-
const gtmPreview = `>m_preview=${preview}`;
|
|
6
|
-
if (!id)
|
|
7
|
-
console.warn("GTM Id is required");
|
|
8
|
-
const iframe = `
|
|
9
|
-
<iframe src="https://www.googletagmanager.com/ns.html?id=${id}${gtmAuth}${gtmPreview}>m_cookies_win=x"
|
|
10
|
-
height="0" width="0" style="display:none;visibility:hidden" id="tag-manager"></iframe>`;
|
|
11
|
-
const script = `
|
|
12
|
-
(function(w,d,s,l,i){w[l]=w[l]||[];
|
|
13
|
-
w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js', ${JSON.stringify(events).slice(1, -1)}});
|
|
14
|
-
var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';
|
|
15
|
-
j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl+'${gtmAuth}${gtmPreview}>m_cookies_win=x';
|
|
16
|
-
f.parentNode.insertBefore(j,f);
|
|
17
|
-
})(window,document,'script','${dataLayerName}','${id}');`;
|
|
18
|
-
const dataLayerVar = appendToDataLayer({ dataLayer, dataLayerName });
|
|
19
|
-
return {
|
|
20
|
-
iframe,
|
|
21
|
-
script,
|
|
22
|
-
dataLayerVar,
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
export { generateGTMElements };
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Loader2 } from "lucide-react";
|
|
3
|
-
import "./styles.css";
|
|
4
|
-
/**
|
|
5
|
-
* IconButton — compact button that renders a single icon without a text label.
|
|
6
|
-
*
|
|
7
|
-
* Always requires `aria-label` for accessibility.
|
|
8
|
-
*
|
|
9
|
-
* @param props.icon - Lucide icon component to render. Required.
|
|
10
|
-
* @param props["aria-label"] - Accessible label for screen readers. Required.
|
|
11
|
-
* @param props.isLoading - Shows a spinner and disables the button. Default: false
|
|
12
|
-
* @param props.size - Button size (`xs` | `sm` | `md` | `lg`). Default: "md"
|
|
13
|
-
* @param props.variant - Visual style variant. Default: "solid"
|
|
14
|
-
* @param props.scheme - Color scheme. Default: "primary"
|
|
15
|
-
*
|
|
16
|
-
* **...Other valid HTML properties for `<button>` (children not supported)**
|
|
17
|
-
*
|
|
18
|
-
* @returns IconButton JSX element.
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* ```tsx
|
|
22
|
-
* <IconButton icon={Plus} aria-label="Add item" />
|
|
23
|
-
*
|
|
24
|
-
* <IconButton icon={Trash2} aria-label="Delete" scheme="danger" variant="outline" />
|
|
25
|
-
*
|
|
26
|
-
* <IconButton icon={Save} aria-label="Saving" isLoading />
|
|
27
|
-
*
|
|
28
|
-
* <IconButton icon={MoreVertical} aria-label="More options" size="sm" />
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
function IconButton(props) {
|
|
32
|
-
const { isLoading = false, scheme = "primary", variant = "solid", size = "md", icon: Icon, disabled, className: baseClassName = "", ...rest } = props;
|
|
33
|
-
const iconSize = { xs: 12, sm: 16, md: 20, lg: 24 };
|
|
34
|
-
const loading = isLoading ? "loadingTrue" : "loadingFalse";
|
|
35
|
-
const className = `arkynIconButton ${variant} ${scheme} ${size} ${loading} ${baseClassName}`;
|
|
36
|
-
return (_jsxs("button", { disabled: disabled || isLoading, className: className.trim(), ...rest, children: [_jsx("div", { className: "arkynIconButtonSpinner", children: _jsx(Loader2, { size: iconSize[size], strokeWidth: 2.5 }) }), _jsx("div", { className: "arkynIconButtonContent", children: _jsx(Icon, { size: iconSize[size], strokeWidth: 2.5 }) })] }));
|
|
37
|
-
}
|
|
38
|
-
export { IconButton };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { RefreshCw } from "lucide-react";
|
|
3
|
-
import { Button } from "../../button";
|
|
4
|
-
import { IconButton } from "../../iconButton";
|
|
5
|
-
import { Tooltip } from "../../tooltip";
|
|
6
|
-
import "./styles.css";
|
|
7
|
-
function HasFileContent(props) {
|
|
8
|
-
const { disabled, filePath, isLoading, acceptImage, changeImageButtonText, handleSelectFile, reSendImage, } = props;
|
|
9
|
-
function handleClick() {
|
|
10
|
-
if (disabled)
|
|
11
|
-
return;
|
|
12
|
-
const input = document.createElement("input");
|
|
13
|
-
input.type = "file";
|
|
14
|
-
input.accept = acceptImage;
|
|
15
|
-
input.onchange = (event) => {
|
|
16
|
-
const file = event.target.files?.[0];
|
|
17
|
-
if (file)
|
|
18
|
-
handleSelectFile(file);
|
|
19
|
-
};
|
|
20
|
-
input.click();
|
|
21
|
-
}
|
|
22
|
-
return (_jsxs("div", { className: "arkynImageUploadHasFileContent", style: { backgroundImage: `url("${filePath}")` }, children: [reSendImage && (_jsx(Tooltip, { orientation: "bottom", text: "Reenviar imagem", children: _jsx(IconButton, { type: "button", "aria-label": "resend image", variant: "outline", scheme: "danger", size: "sm", isLoading: isLoading, onClick: reSendImage, icon: RefreshCw, disabled: disabled }) })), _jsx(Button, { isLoading: isLoading, onClick: handleClick, variant: "outline", size: "sm", type: "button", disabled: disabled, children: changeImageButtonText })] }));
|
|
23
|
-
}
|
|
24
|
-
export { HasFileContent };
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import { useForm } from "../../hooks/useForm";
|
|
4
|
-
import { FieldTemplate } from "../../services/fieldTemplate";
|
|
5
|
-
import { HasFileContent } from "./hasFileContent";
|
|
6
|
-
import { NoFileContent } from "./noFileContent";
|
|
7
|
-
import "./styles.css";
|
|
8
|
-
/**
|
|
9
|
-
* ImageUpload — drag-and-drop image uploader with server upload and image preview.
|
|
10
|
-
*
|
|
11
|
-
* Sends the file via `fetch` as `multipart/form-data` and stores the returned URL
|
|
12
|
-
* in a hidden `<input>` for form submission.
|
|
13
|
-
* Integrates with `useForm` to display validation errors by field name.
|
|
14
|
-
*
|
|
15
|
-
* @param props.name - Field name for form submission. Required.
|
|
16
|
-
* @param props.action - Upload endpoint URL. Required.
|
|
17
|
-
* @param props.defaultValue - Pre-populated image URL displayed as preview.
|
|
18
|
-
* @param props.disabled - Disables file selection and upload. Default: false
|
|
19
|
-
* @param props.label - Label text displayed above the upload area.
|
|
20
|
-
* @param props.showAsterisk - Appends `*` to the label. Default: false
|
|
21
|
-
* @param props.acceptImage - Accepted MIME types or extensions. Default: "image/*"
|
|
22
|
-
* @param props.method - HTTP method. Default: "POST"
|
|
23
|
-
* @param props.fileName - Form-data field name for the file. Default: "file"
|
|
24
|
-
* @param props.fileResponseName - Server response property containing the URL. Default: "url"
|
|
25
|
-
* @param props.onChange - Callback fired after a successful upload — receives the image URL.
|
|
26
|
-
* @param props.orientation - Layout direction. Default: "horizontal"
|
|
27
|
-
* @param props.unShowFieldTemplate - Skips wrapper, label, and error rendering. Default: false
|
|
28
|
-
*
|
|
29
|
-
* @returns ImageUpload JSX element wrapped in `FieldTemplate`.
|
|
30
|
-
*
|
|
31
|
-
* @example
|
|
32
|
-
* ```tsx
|
|
33
|
-
* // Basic
|
|
34
|
-
* <ImageUpload name="avatar" action="/api/upload/image" />
|
|
35
|
-
*
|
|
36
|
-
* // Profile picture with existing image and label
|
|
37
|
-
* <ImageUpload
|
|
38
|
-
* name="profilePicture"
|
|
39
|
-
* action="/api/upload/avatar"
|
|
40
|
-
* label="Profile Picture"
|
|
41
|
-
* showAsterisk
|
|
42
|
-
* defaultValue={user.avatarUrl}
|
|
43
|
-
* selectImageButtonText="Choose photo"
|
|
44
|
-
* onChange={(url) => updateProfile({ avatarUrl: url })}
|
|
45
|
-
* />
|
|
46
|
-
*
|
|
47
|
-
* // Restricted to JPEG/PNG
|
|
48
|
-
* <ImageUpload
|
|
49
|
-
* name="productImage"
|
|
50
|
-
* action="/api/upload/product"
|
|
51
|
-
* label="Product Image"
|
|
52
|
-
* acceptImage="image/jpeg,image/png"
|
|
53
|
-
* fileResponseName="imageUrl"
|
|
54
|
-
* />
|
|
55
|
-
* ```
|
|
56
|
-
*/
|
|
57
|
-
function ImageUpload(props) {
|
|
58
|
-
const { name, defaultValue = "", label, showAsterisk = false, action, fileName = "file", className: wrapperClassName = "", method = "POST", acceptImage = "image/*", fileResponseName = "url", changeImageButtonText = "Alterar imagem", selectImageButtonText = "Selecionar imagem", dropImageText = "Ou arraste e solte a imagem aqui", onChange, disabled = false, unShowFieldTemplate = false, orientation = "vertical", } = props;
|
|
59
|
-
const { fieldErrors } = useForm();
|
|
60
|
-
const fieldError = fieldErrors?.[name];
|
|
61
|
-
const [value, setValue] = useState(defaultValue);
|
|
62
|
-
const [error, setError] = useState("");
|
|
63
|
-
const [file, setFile] = useState(null);
|
|
64
|
-
const [filePath, setFilePath] = useState(defaultValue);
|
|
65
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
66
|
-
async function handleUploadImage(file) {
|
|
67
|
-
if (disabled)
|
|
68
|
-
return;
|
|
69
|
-
setIsLoading(true);
|
|
70
|
-
setFile(file);
|
|
71
|
-
setError("");
|
|
72
|
-
const formData = new FormData();
|
|
73
|
-
formData.append(fileName, file);
|
|
74
|
-
await fetch(action, { method: method, body: formData })
|
|
75
|
-
.then(async (response) => await response.json())
|
|
76
|
-
.then((response) => {
|
|
77
|
-
if (!!response?.error)
|
|
78
|
-
setError(response.error);
|
|
79
|
-
else
|
|
80
|
-
setValue(response?.[fileResponseName]);
|
|
81
|
-
onChange && onChange(response?.[fileResponseName]);
|
|
82
|
-
})
|
|
83
|
-
.catch((error) => {
|
|
84
|
-
console.error(error);
|
|
85
|
-
setError("Erro ao enviar imagem");
|
|
86
|
-
})
|
|
87
|
-
.finally(() => setIsLoading(false));
|
|
88
|
-
}
|
|
89
|
-
function handleSelectFile(file) {
|
|
90
|
-
if (disabled)
|
|
91
|
-
return;
|
|
92
|
-
setFilePath(URL.createObjectURL(file));
|
|
93
|
-
handleUploadImage(file);
|
|
94
|
-
}
|
|
95
|
-
const errorMessage = fieldError || error;
|
|
96
|
-
const hasErrorClassName = errorMessage ? "hasError" : "noHasError";
|
|
97
|
-
const hasImageClassName = filePath ? "hasImage" : "noHasImage";
|
|
98
|
-
const className = `arkynImageUpload ${hasErrorClassName} ${hasImageClassName}`;
|
|
99
|
-
return (_jsx(FieldTemplate, { name: name, label: label, showAsterisk: showAsterisk, className: wrapperClassName, errorMessage: errorMessage, unShowFieldTemplate: unShowFieldTemplate, orientation: orientation, children: _jsxs("div", { className: className, children: [_jsx("input", { type: "hidden", name: name, value: value || "" }), !filePath && (_jsx(NoFileContent, { disabled: disabled, isLoading: isLoading, acceptImage: acceptImage, dropImageText: dropImageText, handleSelectFile: handleSelectFile, selectImageButtonText: selectImageButtonText })), filePath && (_jsx(HasFileContent, { disabled: disabled, isLoading: isLoading, acceptImage: acceptImage, filePath: filePath, handleSelectFile: handleSelectFile, changeImageButtonText: changeImageButtonText, reSendImage: !!errorMessage && file ? () => handleUploadImage(file) : undefined }))] }) }));
|
|
100
|
-
}
|
|
101
|
-
export { ImageUpload };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Button } from "../../button";
|
|
3
|
-
import "./styles.css";
|
|
4
|
-
function NoFileContent(props) {
|
|
5
|
-
const { dropImageText, isLoading, acceptImage, handleSelectFile, selectImageButtonText, disabled, } = props;
|
|
6
|
-
function handleDrop(event) {
|
|
7
|
-
if (disabled)
|
|
8
|
-
return;
|
|
9
|
-
event.preventDefault();
|
|
10
|
-
const file = event.dataTransfer.files[0];
|
|
11
|
-
if (file)
|
|
12
|
-
handleSelectFile(file);
|
|
13
|
-
}
|
|
14
|
-
function handleClick() {
|
|
15
|
-
if (disabled)
|
|
16
|
-
return;
|
|
17
|
-
const input = document.createElement("input");
|
|
18
|
-
input.type = "file";
|
|
19
|
-
input.accept = acceptImage;
|
|
20
|
-
input.onchange = (event) => {
|
|
21
|
-
const file = event.target.files?.[0];
|
|
22
|
-
if (file)
|
|
23
|
-
handleSelectFile(file);
|
|
24
|
-
};
|
|
25
|
-
input.click();
|
|
26
|
-
}
|
|
27
|
-
return (_jsxs("div", { onDrop: handleDrop, className: "arkynImageUploadNoFileContent", children: [_jsx(Button, { isLoading: isLoading, onClick: handleClick, variant: "ghost", size: "sm", type: "button", disabled: disabled, children: selectImageButtonText }), _jsx("p", { children: dropImageText })] }));
|
|
28
|
-
}
|
|
29
|
-
export { NoFileContent };
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Loader2 } from "lucide-react";
|
|
3
|
-
import { useId, useRef, useState, } from "react";
|
|
4
|
-
import { useForm } from "../../hooks/useForm";
|
|
5
|
-
import { FieldTemplate } from "../../services/fieldTemplate";
|
|
6
|
-
import { IconRenderer } from "../../services/iconRenderer";
|
|
7
|
-
import "./style.css";
|
|
8
|
-
/**
|
|
9
|
-
* Input — text input field with label, validation, icons, prefix/suffix, and loading state.
|
|
10
|
-
*
|
|
11
|
-
* Integrates with `useForm` to display validation errors by field name.
|
|
12
|
-
*
|
|
13
|
-
* @param props.name - Field name for form submission. Required.
|
|
14
|
-
* @param props.label - Label text displayed above the input.
|
|
15
|
-
* @param props.errorMessage - Validation error message.
|
|
16
|
-
* @param props.isLoading - Shows a spinner and disables the input. Default: false
|
|
17
|
-
* @param props.size - Input size (`md` | `lg`). Default: "md"
|
|
18
|
-
* @param props.variant - Visual style variant. Default: "solid"
|
|
19
|
-
* @param props.prefix - Text or icon at the far left (outside the input).
|
|
20
|
-
* @param props.suffix - Text or icon at the far right (outside the input).
|
|
21
|
-
* @param props.leftIcon - Lucide icon inside the input on the left.
|
|
22
|
-
* @param props.rightIcon - Lucide icon inside the input on the right.
|
|
23
|
-
* @param props.showAsterisk - Appends `*` to the label.
|
|
24
|
-
* @param props.orientation - Layout direction (`horizontal` | `vertical` | `horizontalReverse`). Default: "horizontal"
|
|
25
|
-
* @param props.unShowFieldTemplate - Skips wrapper, label, and error rendering. Default: false
|
|
26
|
-
*
|
|
27
|
-
* **...Other valid HTML properties for `<input>`**
|
|
28
|
-
*
|
|
29
|
-
* @returns Input JSX element wrapped in `FieldTemplate`.
|
|
30
|
-
*
|
|
31
|
-
* @example
|
|
32
|
-
* ```tsx
|
|
33
|
-
* // Basic
|
|
34
|
-
* <Input name="username" placeholder="Enter username" />
|
|
35
|
-
*
|
|
36
|
-
* // With label and validation
|
|
37
|
-
* <Input
|
|
38
|
-
* name="email"
|
|
39
|
-
* label="Email Address"
|
|
40
|
-
* type="email"
|
|
41
|
-
* showAsterisk
|
|
42
|
-
* errorMessage="Please enter a valid email"
|
|
43
|
-
* />
|
|
44
|
-
*
|
|
45
|
-
* // With icons and loading state
|
|
46
|
-
* <Input name="search" label="Search" leftIcon={SearchIcon} isLoading />
|
|
47
|
-
*
|
|
48
|
-
* // With prefix/suffix
|
|
49
|
-
* <Input name="website" label="Website" prefix="https://" suffix=".com" variant="outline" />
|
|
50
|
-
* ```
|
|
51
|
-
*/
|
|
52
|
-
function Input(props) {
|
|
53
|
-
const { name, disabled, title, style, variant = "solid", label, className: wrapperClassName = "", prefix, suffix, isLoading = false, leftIcon, readOnly, onFocus, onBlur, unShowFieldTemplate = false, errorMessage: baseErrorMessage, showAsterisk, rightIcon, type = "text", size = "md", id, value, placeholder, orientation, ...rest } = props;
|
|
54
|
-
const { fieldErrors } = useForm();
|
|
55
|
-
const [isFocused, setIsFocused] = useState(false);
|
|
56
|
-
const inputRef = useRef(null);
|
|
57
|
-
const inputId = id || useId();
|
|
58
|
-
const errorMessage = baseErrorMessage || fieldErrors?.[name];
|
|
59
|
-
const isError = !!errorMessage;
|
|
60
|
-
const isDisabled = disabled || isLoading;
|
|
61
|
-
const iconSizes = { md: 20, lg: 20 };
|
|
62
|
-
const iconSize = iconSizes[size];
|
|
63
|
-
const loadingPosition = rightIcon ? "right" : "left";
|
|
64
|
-
const showLeftSpinner = loadingPosition === "left" && isLoading;
|
|
65
|
-
const showRightSpinner = loadingPosition === "right" && isLoading;
|
|
66
|
-
function handleSectionClick() {
|
|
67
|
-
if (isDisabled || !inputRef?.current)
|
|
68
|
-
return;
|
|
69
|
-
setIsFocused(true);
|
|
70
|
-
inputRef.current.focus();
|
|
71
|
-
}
|
|
72
|
-
function handleFocus(e) {
|
|
73
|
-
setIsFocused(true);
|
|
74
|
-
if (onFocus)
|
|
75
|
-
onFocus(e);
|
|
76
|
-
}
|
|
77
|
-
function handleBlur(e) {
|
|
78
|
-
setIsFocused(false);
|
|
79
|
-
if (onBlur)
|
|
80
|
-
onBlur(e);
|
|
81
|
-
}
|
|
82
|
-
if (type === "hidden") {
|
|
83
|
-
return (_jsx("input", { style: { display: "none" }, readOnly: true, type: "text", ref: inputRef, ...rest }));
|
|
84
|
-
}
|
|
85
|
-
const hasPrefix = !!prefix ? "hasPrefix" : "";
|
|
86
|
-
const hasSuffix = !!suffix ? "hasSuffix" : "";
|
|
87
|
-
const errored = isError ? "errored" : "";
|
|
88
|
-
const opacity = isDisabled || readOnly || isLoading ? "opacity" : "";
|
|
89
|
-
const focused = isFocused ? "focused" : "";
|
|
90
|
-
const disabledClass = disabled ? "disabled" : "";
|
|
91
|
-
const className = `arkynInput ${hasPrefix} ${disabledClass} ${hasSuffix} ${variant} ${size} ${opacity} ${errored} ${focused}`;
|
|
92
|
-
return (_jsx(FieldTemplate, { name: name, label: label, showAsterisk: showAsterisk, className: wrapperClassName, errorMessage: errorMessage, unShowFieldTemplate: unShowFieldTemplate, orientation: orientation, children: _jsxs("section", { title: title, style: style, onClick: handleSectionClick, className: className, children: [_jsx(IconRenderer, { iconSize: iconSize, icon: prefix, className: "prefix" }), _jsx(IconRenderer, { show: showLeftSpinner, iconSize: iconSize, className: "spinner", icon: Loader2 }), _jsx(IconRenderer, { show: !isLoading, icon: leftIcon, iconSize: iconSize }), _jsx("input", { disabled: isDisabled, readOnly: readOnly, ref: inputRef, onFocus: handleFocus, onBlur: handleBlur, type: type, id: inputId, name: name, placeholder: isDisabled ? value || placeholder : placeholder, value: isDisabled ? undefined : value, ...rest }), _jsx(IconRenderer, { show: !isLoading, icon: rightIcon, iconSize: iconSize }), _jsx(IconRenderer, { show: showRightSpinner, iconSize: iconSize, className: "spinner", icon: Loader2 }), _jsx(IconRenderer, { iconSize: iconSize, icon: suffix, className: "suffix" })] }) }));
|
|
93
|
-
}
|
|
94
|
-
export { Input };
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { MapPinned } from "lucide-react";
|
|
3
|
-
import { ClientMapView } from "./mapView.client";
|
|
4
|
-
import "./styles.css";
|
|
5
|
-
import { ClientOnly } from "../clientOnly";
|
|
6
|
-
function EmptyMap({ className }) {
|
|
7
|
-
return (_jsx("div", { className: "arkynMapViewPinnedEmpty " + className, children: _jsx(MapPinned, {}) }));
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* MapView — interactive Mapbox map with optional click-able markers.
|
|
11
|
-
*
|
|
12
|
-
* Renders client-side only (via `ClientOnly`). Displays a placeholder icon
|
|
13
|
-
* when `coordinates` is absent or empty, or before the component hydrates.
|
|
14
|
-
*
|
|
15
|
-
* @param props.accessToken - Mapbox GL public access token. Required.
|
|
16
|
-
* @param props.zoom - Initial zoom level. Default: 18
|
|
17
|
-
* @param props.coordinates - Marker(s) to display on the map.
|
|
18
|
-
* @param props.onMarkerClick - Callback fired when a marker is clicked.
|
|
19
|
-
*
|
|
20
|
-
* **...Other valid HTML properties for `<div>`**
|
|
21
|
-
*
|
|
22
|
-
* @returns MapView JSX element, or a placeholder icon when no coordinates are provided.
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* ```tsx
|
|
26
|
-
* // Single marker
|
|
27
|
-
* <MapView
|
|
28
|
-
* accessToken="pk.your-mapbox-token"
|
|
29
|
-
* coordinates={{ lat: -23.5505, lng: -46.6333 }}
|
|
30
|
-
* />
|
|
31
|
-
*
|
|
32
|
-
* // Multiple markers with popup and click handler
|
|
33
|
-
* <MapView
|
|
34
|
-
* accessToken="pk.your-mapbox-token"
|
|
35
|
-
* zoom={12}
|
|
36
|
-
* coordinates={[
|
|
37
|
-
* { lat: -23.55, lng: -46.63, data: { id: 1 }, popUp: <p>Store A</p> },
|
|
38
|
-
* { lat: -23.56, lng: -46.64, data: { id: 2 }, popUp: <p>Store B</p> },
|
|
39
|
-
* ]}
|
|
40
|
-
* onMarkerClick={(coord) => selectStore(coord.data.id)}
|
|
41
|
-
* />
|
|
42
|
-
* ```
|
|
43
|
-
*/
|
|
44
|
-
function MapView(props) {
|
|
45
|
-
const { coordinates, zoom = 18, accessToken, className, onMarkerClick, ...rest } = props;
|
|
46
|
-
if (!coordinates)
|
|
47
|
-
return _jsx(EmptyMap, { className: className });
|
|
48
|
-
const coordArray = Array.isArray(coordinates) ? coordinates : [coordinates];
|
|
49
|
-
if (coordArray.length === 0)
|
|
50
|
-
return _jsx(EmptyMap, { className: className });
|
|
51
|
-
return (_jsx(ClientOnly, { fallback: _jsx(EmptyMap, { className: className }), children: () => (_jsx(ClientMapView, { accessToken: accessToken, coordinates: coordArray, center: coordArray[0], onMarkerClick: onMarkerClick, ...rest })) }));
|
|
52
|
-
}
|
|
53
|
-
export { MapView };
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import mapBoxGl from "mapbox-gl";
|
|
3
|
-
import { createRoot } from "react-dom/client";
|
|
4
|
-
import "./mapbox.css";
|
|
5
|
-
import { useEffect, useRef, } from "react";
|
|
6
|
-
function ClientMapView({ center: rawCenter, coordinates, onMarkerClick, accessToken, ...rest }) {
|
|
7
|
-
const mapRef = useRef(null);
|
|
8
|
-
const mapContainerRef = useRef(null);
|
|
9
|
-
const center = rawCenter ? rawCenter : coordinates[0];
|
|
10
|
-
useEffect(() => {
|
|
11
|
-
mapBoxGl.accessToken = accessToken;
|
|
12
|
-
mapRef.current = new mapBoxGl.Map({
|
|
13
|
-
container: mapContainerRef.current,
|
|
14
|
-
style: "mapbox://styles/mapbox/light-v11",
|
|
15
|
-
center: [center.lng, center.lat],
|
|
16
|
-
zoom: 13,
|
|
17
|
-
language: "pt-BR",
|
|
18
|
-
});
|
|
19
|
-
coordinates.forEach((props) => {
|
|
20
|
-
const { lat, lng, popUp } = props;
|
|
21
|
-
const el = document.createElement("img");
|
|
22
|
-
el.className = "arkynMarker";
|
|
23
|
-
el.src = "https://i.postimg.cc/mgKggjk7/Pin.png";
|
|
24
|
-
const marker = new mapBoxGl.Marker(el)
|
|
25
|
-
.setLngLat([lng, lat])
|
|
26
|
-
.addTo(mapRef.current);
|
|
27
|
-
if (popUp) {
|
|
28
|
-
const popupNode = document.createElement("div");
|
|
29
|
-
const root = createRoot(popupNode);
|
|
30
|
-
root.render(popUp);
|
|
31
|
-
const popup = new mapBoxGl.Popup({
|
|
32
|
-
offset: 25,
|
|
33
|
-
closeButton: false,
|
|
34
|
-
className: "arkynMapViewPopup",
|
|
35
|
-
}).setDOMContent(popupNode);
|
|
36
|
-
marker.setPopup(popup);
|
|
37
|
-
}
|
|
38
|
-
el.addEventListener("click", () => {
|
|
39
|
-
if (onMarkerClick)
|
|
40
|
-
onMarkerClick(props);
|
|
41
|
-
mapRef.current.flyTo({ center: [lng, lat], zoom: 15, duration: 1200 });
|
|
42
|
-
marker.togglePopup();
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
return () => {
|
|
46
|
-
mapRef.current?.remove();
|
|
47
|
-
};
|
|
48
|
-
}, []);
|
|
49
|
-
return (_jsx("div", { id: "map-container", ref: mapContainerRef, style: { height: "100%", width: "100%", borderRadius: "8px" }, ...rest }));
|
|
50
|
-
}
|
|
51
|
-
export { ClientMapView };
|