@arkyn/components 3.0.1-beta.154 → 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 +144 -144
- 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,25 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import "./styles.css";
|
|
3
|
-
/**
|
|
4
|
-
* AlertDescription — body text for an alert. Place inside `AlertContent`.
|
|
5
|
-
*
|
|
6
|
-
* Accepts all standard `<div>` HTML attributes.
|
|
7
|
-
*
|
|
8
|
-
* @returns AlertDescription JSX element.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```tsx
|
|
12
|
-
* <AlertContainer schema="info">
|
|
13
|
-
* <AlertContent>
|
|
14
|
-
* <AlertTitle>Maintenance scheduled</AlertTitle>
|
|
15
|
-
* <AlertDescription>The service will be unavailable on Sunday from 2–4 AM UTC.</AlertDescription>
|
|
16
|
-
* </AlertContent>
|
|
17
|
-
* </AlertContainer>
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
function AlertDescription(props) {
|
|
21
|
-
const { className: baseClassName, ...rest } = props;
|
|
22
|
-
const className = `arkynAlertDescription ${baseClassName}`;
|
|
23
|
-
return _jsx("div", { className: className.trim(), ...rest });
|
|
24
|
-
}
|
|
25
|
-
export { AlertDescription };
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { AlertTriangle, CheckCircle2, Info, XCircle, } from "lucide-react";
|
|
3
|
-
import { useAlertContainer } from "../alertContainer";
|
|
4
|
-
import "./styles.css";
|
|
5
|
-
/**
|
|
6
|
-
* AlertIcon — renders a schema-appropriate icon from `AlertContainer` context.
|
|
7
|
-
*
|
|
8
|
-
* - `success` → `CheckCircle2`
|
|
9
|
-
* - `danger` → `XCircle`
|
|
10
|
-
* - `warning` → `AlertTriangle`
|
|
11
|
-
* - `info` → `Info`
|
|
12
|
-
*
|
|
13
|
-
* Must be placed inside an `AlertContainer`. Accepts all Lucide icon props.
|
|
14
|
-
*
|
|
15
|
-
* @returns The schema-matched Lucide icon element.
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* ```tsx
|
|
19
|
-
* <AlertContainer schema="danger">
|
|
20
|
-
* <AlertIcon />
|
|
21
|
-
* <AlertContent>
|
|
22
|
-
* <AlertTitle>Payment failed</AlertTitle>
|
|
23
|
-
* <AlertDescription>Please check your card details.</AlertDescription>
|
|
24
|
-
* </AlertContent>
|
|
25
|
-
* </AlertContainer>
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
function AlertIcon(props) {
|
|
29
|
-
const { className: baseClassName, ...rest } = props;
|
|
30
|
-
const { schema } = useAlertContainer();
|
|
31
|
-
const className = `arkynAlertIcon ${schema} ${baseClassName}`;
|
|
32
|
-
switch (schema) {
|
|
33
|
-
case "success":
|
|
34
|
-
return _jsx(CheckCircle2, { className: className, ...rest });
|
|
35
|
-
case "danger":
|
|
36
|
-
return _jsx(XCircle, { className: className, ...rest });
|
|
37
|
-
case "warning":
|
|
38
|
-
return _jsx(AlertTriangle, { className: className, ...rest });
|
|
39
|
-
case "info":
|
|
40
|
-
return _jsx(Info, { className: className, ...rest });
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
export { AlertIcon };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import "./styles.css";
|
|
3
|
-
/**
|
|
4
|
-
* AlertTitle — bold heading for an alert. Place inside `AlertContent`.
|
|
5
|
-
*
|
|
6
|
-
* Its presence is detected by `AlertContainer` to switch the layout from centered to left-aligned.
|
|
7
|
-
* Accepts all standard `<div>` HTML attributes.
|
|
8
|
-
*
|
|
9
|
-
* @returns AlertTitle JSX element.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```tsx
|
|
13
|
-
* <AlertContainer schema="danger">
|
|
14
|
-
* <AlertIcon />
|
|
15
|
-
* <AlertContent>
|
|
16
|
-
* <AlertTitle>Access denied</AlertTitle>
|
|
17
|
-
* <AlertDescription>You don't have permission to view this page.</AlertDescription>
|
|
18
|
-
* </AlertContent>
|
|
19
|
-
* </AlertContainer>
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
function AlertTitle(props) {
|
|
23
|
-
const { className: baseClassName, ...rest } = props;
|
|
24
|
-
const className = `arkynAlertTitle ${baseClassName}`;
|
|
25
|
-
return _jsx("div", { className: className.trim(), ...rest });
|
|
26
|
-
}
|
|
27
|
-
export { AlertTitle };
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Pause, Play } from "lucide-react";
|
|
3
|
-
import { useEffect, useRef, useState } from "react";
|
|
4
|
-
import { useSlider } from "../../hooks/useSlider";
|
|
5
|
-
import { Slider } from "../slider";
|
|
6
|
-
import "./styles.css";
|
|
7
|
-
/**
|
|
8
|
-
* AudioPlayer — play/pause controls, a scrubable progress bar, and elapsed/total time display.
|
|
9
|
-
*
|
|
10
|
-
* @param props.src - Audio file URL. Required.
|
|
11
|
-
* @param props.disabled - Disables controls. Default: false
|
|
12
|
-
* @param props.onPlayAudio - Callback fired when playback starts.
|
|
13
|
-
* @param props.onPauseAudio - Callback fired when playback is paused.
|
|
14
|
-
*
|
|
15
|
-
* **...Other valid HTML properties for `<audio>` (except `onEnded` and `src`)**
|
|
16
|
-
*
|
|
17
|
-
* @returns AudioPlayer JSX element.
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* ```tsx
|
|
21
|
-
* // Basic
|
|
22
|
-
* <AudioPlayer src="/audio/episode.mp3" />
|
|
23
|
-
*
|
|
24
|
-
* // With play/pause callbacks
|
|
25
|
-
* <AudioPlayer
|
|
26
|
-
* src="/audio/episode.mp3"
|
|
27
|
-
* onPlayAudio={(info) => console.log("Playing at", info.formattedCurrentTime)}
|
|
28
|
-
* onPauseAudio={(info) => console.log("Paused at", info.formattedCurrentTime)}
|
|
29
|
-
* />
|
|
30
|
-
* ```
|
|
31
|
-
*/
|
|
32
|
-
function AudioPlayer(props) {
|
|
33
|
-
const { onPlayAudio, onPauseAudio, disabled, style, ...rest } = props;
|
|
34
|
-
const [sliderValue, setSliderValue] = useSlider(0);
|
|
35
|
-
const [isPlaying, setIsPlaying] = useState(false);
|
|
36
|
-
const [isDragging, setIsDragging] = useState(false);
|
|
37
|
-
const audioReference = useRef(null);
|
|
38
|
-
const currentTime = audioReference.current?.currentTime || 0;
|
|
39
|
-
const totalTime = audioReference.current?.duration || 0;
|
|
40
|
-
const formattedCurrentTime = formatTime(currentTime);
|
|
41
|
-
const formattedTotalTime = formatTime(totalTime);
|
|
42
|
-
const audioInformation = {
|
|
43
|
-
totalTime,
|
|
44
|
-
currentTime,
|
|
45
|
-
formattedCurrentTime,
|
|
46
|
-
formattedTotalTime,
|
|
47
|
-
};
|
|
48
|
-
function formatTime(time) {
|
|
49
|
-
if (!time)
|
|
50
|
-
return "00:00";
|
|
51
|
-
const minutes = Math.floor(time / 60);
|
|
52
|
-
const seconds = Math.floor(time % 60);
|
|
53
|
-
const formattedMinutes = String(minutes).padStart(2, "0");
|
|
54
|
-
const formattedSeconds = String(seconds).padStart(2, "0");
|
|
55
|
-
return `${formattedMinutes}:${formattedSeconds}`;
|
|
56
|
-
}
|
|
57
|
-
function handlePlayAudio() {
|
|
58
|
-
const audioElement = audioReference.current;
|
|
59
|
-
if (!audioElement)
|
|
60
|
-
return;
|
|
61
|
-
if (props.onPlayAudio)
|
|
62
|
-
props.onPlayAudio(audioInformation);
|
|
63
|
-
audioElement.play();
|
|
64
|
-
setIsPlaying(true);
|
|
65
|
-
}
|
|
66
|
-
function handlePauseAudio() {
|
|
67
|
-
const audioElement = audioReference.current;
|
|
68
|
-
if (!audioElement)
|
|
69
|
-
return;
|
|
70
|
-
if (props.onPauseAudio)
|
|
71
|
-
props.onPauseAudio(audioInformation);
|
|
72
|
-
audioElement.pause();
|
|
73
|
-
setIsPlaying(false);
|
|
74
|
-
}
|
|
75
|
-
function handleToggleAudio() {
|
|
76
|
-
if (isPlaying)
|
|
77
|
-
handlePauseAudio();
|
|
78
|
-
else
|
|
79
|
-
handlePlayAudio();
|
|
80
|
-
}
|
|
81
|
-
function handleSliderChange(value) {
|
|
82
|
-
const audioElement = audioReference.current;
|
|
83
|
-
if (!audioElement)
|
|
84
|
-
return;
|
|
85
|
-
const totalTime = audioElement.duration;
|
|
86
|
-
const currentTime = (value / 100) * totalTime;
|
|
87
|
-
audioElement.currentTime = currentTime;
|
|
88
|
-
}
|
|
89
|
-
if (isDragging || !isPlaying) {
|
|
90
|
-
audioReference.current?.pause();
|
|
91
|
-
}
|
|
92
|
-
else if (isPlaying) {
|
|
93
|
-
audioReference.current?.play();
|
|
94
|
-
}
|
|
95
|
-
useEffect(() => {
|
|
96
|
-
const audioElement = audioReference.current;
|
|
97
|
-
if (!audioElement)
|
|
98
|
-
return;
|
|
99
|
-
const handleTimeUpdate = () => {
|
|
100
|
-
const totalTime = audioElement.duration;
|
|
101
|
-
const currentTime = audioElement.currentTime;
|
|
102
|
-
const value = (currentTime / totalTime) * 100;
|
|
103
|
-
setSliderValue(value);
|
|
104
|
-
};
|
|
105
|
-
audioElement.addEventListener("timeupdate", handleTimeUpdate);
|
|
106
|
-
return () => {
|
|
107
|
-
audioElement.removeEventListener("timeupdate", handleTimeUpdate);
|
|
108
|
-
};
|
|
109
|
-
}, []);
|
|
110
|
-
return (_jsxs("div", { className: "arkynAudioPlayer", style: style, children: [_jsx("audio", { ...rest, ref: audioReference, src: props.src, onEnded: handlePauseAudio }), _jsxs("button", { type: "button", disabled: disabled, onClick: handleToggleAudio, children: [isPlaying && _jsx(Pause, {}), !isPlaying && _jsx(Play, {})] }), _jsx("p", { children: formattedCurrentTime }), _jsx(Slider, { value: sliderValue, onChange: handleSliderChange, onDragging: setIsDragging, disabled: disabled }), _jsx("p", { children: formattedTotalTime })] }));
|
|
111
|
-
}
|
|
112
|
-
export { AudioPlayer };
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { RefreshCw } from "lucide-react";
|
|
3
|
-
import { AudioPlayer } from "../../audioPlayer";
|
|
4
|
-
import { Button } from "../../button";
|
|
5
|
-
import { Divider } from "../../divider";
|
|
6
|
-
import { IconButton } from "../../iconButton";
|
|
7
|
-
import { Tooltip } from "../../tooltip";
|
|
8
|
-
import "./styles.css";
|
|
9
|
-
function HasFileContent(props) {
|
|
10
|
-
const { filePath, disabled, acceptAudio, handleSelectFile, isLoading, reSendAudio, changeAudioButtonText, } = props;
|
|
11
|
-
function handleClick() {
|
|
12
|
-
if (disabled)
|
|
13
|
-
return;
|
|
14
|
-
const input = document.createElement("input");
|
|
15
|
-
input.type = "file";
|
|
16
|
-
input.accept = acceptAudio;
|
|
17
|
-
input.onchange = (event) => {
|
|
18
|
-
const file = event.target.files?.[0];
|
|
19
|
-
if (file)
|
|
20
|
-
handleSelectFile(file);
|
|
21
|
-
};
|
|
22
|
-
input.click();
|
|
23
|
-
}
|
|
24
|
-
return (_jsxs("div", { className: "arkynAudioUploadHasFileContentContainer", children: [_jsx(AudioPlayer, { src: filePath }), _jsx(Divider, {}), _jsxs("div", { className: "arkynAudioUploadButtonsContainer", children: [!!reSendAudio && (_jsx(Tooltip, { orientation: "bottom", text: "Reenviar \u00E1udio", children: _jsx(IconButton, { type: "button", "aria-label": "resend image", variant: "outline", scheme: "danger", size: "sm", isLoading: isLoading, onClick: reSendAudio, icon: RefreshCw, disabled: disabled }) })), _jsx(Button, { isLoading: isLoading, onClick: handleClick, variant: "outline", size: "sm", type: "button", disabled: disabled, children: changeAudioButtonText })] })] }));
|
|
25
|
-
}
|
|
26
|
-
export { HasFileContent };
|
|
@@ -1,95 +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 { FieldError } from "../fieldError";
|
|
5
|
-
import { FieldLabel } from "../fieldLabel";
|
|
6
|
-
import { FieldWrapper } from "../fieldWrapper";
|
|
7
|
-
import { HasFileContent } from "./hasFileContent";
|
|
8
|
-
import { NoFileContent } from "./noFileContent";
|
|
9
|
-
import "./styles.css";
|
|
10
|
-
/**
|
|
11
|
-
* AudioUpload — drag-and-drop audio file uploader with server upload and playback preview.
|
|
12
|
-
*
|
|
13
|
-
* Sends the file via `fetch` as `multipart/form-data` and stores the returned URL
|
|
14
|
-
* in a hidden `<input>` for form submission.
|
|
15
|
-
* Integrates with `useForm` to display validation errors by field name.
|
|
16
|
-
*
|
|
17
|
-
* @param props.name - Field name for form submission. Required.
|
|
18
|
-
* @param props.action - Upload endpoint URL. Required.
|
|
19
|
-
* @param props.fileName - Form-data field name for the file. Default: "file"
|
|
20
|
-
* @param props.method - HTTP method. Default: "POST"
|
|
21
|
-
* @param props.acceptAudio - Accepted MIME types / extensions. Default: "audio/*"
|
|
22
|
-
* @param props.onChange - Callback fired after a successful upload — receives the audio URL.
|
|
23
|
-
* @param props.fileResponseName - Server response property containing the URL. Default: "url"
|
|
24
|
-
* @param props.label - Label text displayed above the upload area.
|
|
25
|
-
* @param props.showAsterisk - Appends `*` to the label. Default: false
|
|
26
|
-
* @param props.disabled - Disables file selection and upload. Default: false
|
|
27
|
-
* @param props.defaultValue - Pre-populated audio URL.
|
|
28
|
-
*
|
|
29
|
-
* @returns AudioUpload JSX element wrapped in `FieldWrapper`.
|
|
30
|
-
*
|
|
31
|
-
* @example
|
|
32
|
-
* ```tsx
|
|
33
|
-
* // Basic
|
|
34
|
-
* <AudioUpload name="audio" action="/api/upload" />
|
|
35
|
-
*
|
|
36
|
-
* // With label and custom texts
|
|
37
|
-
* <AudioUpload
|
|
38
|
-
* name="podcast"
|
|
39
|
-
* action="/api/upload/podcast"
|
|
40
|
-
* label="Podcast Episode"
|
|
41
|
-
* showAsterisk
|
|
42
|
-
* selectAudioButtonText="Choose audio file"
|
|
43
|
-
* onChange={(url) => setPodcastUrl(url)}
|
|
44
|
-
* />
|
|
45
|
-
* ```
|
|
46
|
-
*/
|
|
47
|
-
function AudioUpload(props) {
|
|
48
|
-
const { name, label, fileName = "file", method = "POST", onChange, fileResponseName = "url", selectAudioButtonText = "Selecionar arquivo de áudio", dropAudioText = "Ou arraste e solte um arquivo de áudio aqui", changeAudioButtonText = "Trocar arquivo de áudio", acceptAudio = "audio/*", action, defaultValue = "", showAsterisk = false, disabled = false, } = props;
|
|
49
|
-
const { fieldErrors } = useForm();
|
|
50
|
-
const fieldError = fieldErrors?.[name];
|
|
51
|
-
const [value, setValue] = useState(defaultValue);
|
|
52
|
-
const [error, setError] = useState("");
|
|
53
|
-
const [file, setFile] = useState(null);
|
|
54
|
-
const [filePath, setFilePath] = useState(defaultValue);
|
|
55
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
56
|
-
async function handleUploadAudio(file) {
|
|
57
|
-
if (disabled)
|
|
58
|
-
return;
|
|
59
|
-
setIsLoading(true);
|
|
60
|
-
setFile(file);
|
|
61
|
-
setError("");
|
|
62
|
-
const formData = new FormData();
|
|
63
|
-
formData.append(fileName, file);
|
|
64
|
-
await fetch(action, { method: method, body: formData })
|
|
65
|
-
.then(async (response) => await response.json())
|
|
66
|
-
.then((response) => {
|
|
67
|
-
if (!!response?.error)
|
|
68
|
-
setError(response.error);
|
|
69
|
-
else
|
|
70
|
-
setValue(response?.[fileResponseName]);
|
|
71
|
-
onChange && onChange(response?.[fileResponseName]);
|
|
72
|
-
})
|
|
73
|
-
.catch((error) => {
|
|
74
|
-
console.error(error);
|
|
75
|
-
setError("Erro ao enviar audio");
|
|
76
|
-
})
|
|
77
|
-
.finally(() => setIsLoading(false));
|
|
78
|
-
}
|
|
79
|
-
function handleSelectFile(file) {
|
|
80
|
-
if (disabled)
|
|
81
|
-
return;
|
|
82
|
-
if (file.type.indexOf("audio") === -1) {
|
|
83
|
-
setError("O arquivo selecionado não é um arquivo de áudio");
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
setFilePath(URL.createObjectURL(file));
|
|
87
|
-
handleUploadAudio(file);
|
|
88
|
-
}
|
|
89
|
-
const errorMessage = fieldError || error;
|
|
90
|
-
const hasErrorClassName = errorMessage ? "hasError" : "noHasError";
|
|
91
|
-
const hasImageClassName = filePath ? "hasAudio" : "noHasAudio";
|
|
92
|
-
const className = `arkynAudioUpload ${hasErrorClassName} ${hasImageClassName}`;
|
|
93
|
-
return (_jsxs(FieldWrapper, { children: [label && _jsx(FieldLabel, { showAsterisk: showAsterisk, children: label }), _jsxs("div", { className: className, children: [_jsx("input", { type: "hidden", name: name, value: value || "" }), !filePath && (_jsx(NoFileContent, { disabled: disabled, isLoading: isLoading, acceptAudio: acceptAudio, dropAudioText: dropAudioText, handleSelectFile: handleSelectFile, selectAudioButtonText: selectAudioButtonText })), filePath && (_jsx(HasFileContent, { filePath: filePath, acceptAudio: acceptAudio, changeAudioButtonText: changeAudioButtonText, disabled: disabled, handleSelectFile: handleSelectFile, isLoading: isLoading, reSendAudio: !!errorMessage && file ? () => handleUploadAudio(file) : undefined }))] }), errorMessage && _jsx(FieldError, { children: errorMessage })] }));
|
|
94
|
-
}
|
|
95
|
-
export { AudioUpload };
|
|
@@ -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 { dropAudioText, isLoading, acceptAudio, handleSelectFile, selectAudioButtonText, 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 = acceptAudio;
|
|
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: "arkynAudioUploadNoFileContent", children: [_jsx(Button, { isLoading: isLoading, onClick: handleClick, variant: "ghost", size: "sm", type: "button", disabled: disabled, children: selectAudioButtonText }), _jsx("p", { children: dropAudioText })] }));
|
|
28
|
-
}
|
|
29
|
-
export { NoFileContent };
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { IconRenderer } from "../../services/iconRenderer";
|
|
3
|
-
import "./styles.css";
|
|
4
|
-
/**
|
|
5
|
-
* Badge — displays labels, statuses, and categorization tags.
|
|
6
|
-
*
|
|
7
|
-
* @param props.size - Badge size (`md` | `lg`). Default: "lg"
|
|
8
|
-
* @param props.variant - Visual style variant. Default: "ghost"
|
|
9
|
-
* @param props.scheme - Color scheme. Default: "primary"
|
|
10
|
-
* @param props.leftIcon - Lucide icon rendered to the left of the label.
|
|
11
|
-
* @param props.rightIcon - Lucide icon rendered to the right of the label.
|
|
12
|
-
*
|
|
13
|
-
* **...Other valid HTML properties for `<div>`**
|
|
14
|
-
*
|
|
15
|
-
* @returns Badge JSX element.
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* ```tsx
|
|
19
|
-
* // Basic badge
|
|
20
|
-
* <Badge>New</Badge>
|
|
21
|
-
*
|
|
22
|
-
* // With color scheme
|
|
23
|
-
* <Badge scheme="success">Approved</Badge>
|
|
24
|
-
*
|
|
25
|
-
* // With icon
|
|
26
|
-
* <Badge leftIcon={CheckIcon} scheme="success">Completed</Badge>
|
|
27
|
-
*
|
|
28
|
-
* // Custom size, variant and scheme
|
|
29
|
-
* <Badge size="lg" variant="solid" scheme="warning" rightIcon={AlertIcon}>
|
|
30
|
-
* Warning
|
|
31
|
-
* </Badge>
|
|
32
|
-
* ```
|
|
33
|
-
*/
|
|
34
|
-
function Badge(props) {
|
|
35
|
-
const { variant = "ghost", scheme = "primary", size = "lg", leftIcon, rightIcon, className: baseClassName = "", children, ...rest } = props;
|
|
36
|
-
const iconSizes = { md: 12, lg: 14 };
|
|
37
|
-
const iconSize = iconSizes[size];
|
|
38
|
-
const className = `arkynBadge ${variant} ${scheme} ${size} ${baseClassName}`;
|
|
39
|
-
return (_jsxs("div", { className: className.trim(), ...rest, children: [_jsx(IconRenderer, { iconSize: iconSize, icon: leftIcon }), _jsx("p", { children: children }), _jsx(IconRenderer, { iconSize: iconSize, icon: rightIcon })] }));
|
|
40
|
-
}
|
|
41
|
-
export { Badge };
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Loader2 } from "lucide-react";
|
|
3
|
-
import { IconRenderer } from "../../services/iconRenderer";
|
|
4
|
-
import "./styles.css";
|
|
5
|
-
/**
|
|
6
|
-
* Button — used for user interactions and form submissions.
|
|
7
|
-
*
|
|
8
|
-
* @param props.isLoading - Shows a spinner and disables the button. Default: false
|
|
9
|
-
* @param props.loadingText - Text displayed beside the spinner when loading.
|
|
10
|
-
* @param props.size - Button size (`xs` | `sm` | `md` | `lg`). Default: "md"
|
|
11
|
-
* @param props.variant - Visual style variant. Default: "solid"
|
|
12
|
-
* @param props.scheme - Color scheme. Default: "primary"
|
|
13
|
-
* @param props.leftIcon - Lucide icon rendered to the left of the label.
|
|
14
|
-
* @param props.rightIcon - Lucide icon rendered to the right of the label.
|
|
15
|
-
*
|
|
16
|
-
* **...Other valid HTML properties for `<button>`**
|
|
17
|
-
*
|
|
18
|
-
* @returns Button JSX element.
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* ```tsx
|
|
22
|
-
* // Basic button
|
|
23
|
-
* <Button>Click me</Button>
|
|
24
|
-
*
|
|
25
|
-
* // With color scheme
|
|
26
|
-
* <Button scheme="success">Save</Button>
|
|
27
|
-
*
|
|
28
|
-
* // With loading state
|
|
29
|
-
* <Button isLoading loadingText="Saving...">Save</Button>
|
|
30
|
-
*
|
|
31
|
-
* // With icons
|
|
32
|
-
* <Button leftIcon={SaveIcon} scheme="success">Save</Button>
|
|
33
|
-
*
|
|
34
|
-
* // Custom size, variant and scheme
|
|
35
|
-
* <Button size="lg" variant="outline" scheme="danger" rightIcon={TrashIcon}>
|
|
36
|
-
* Delete
|
|
37
|
-
* </Button>
|
|
38
|
-
* ```
|
|
39
|
-
*/
|
|
40
|
-
function Button(props) {
|
|
41
|
-
const { isLoading = false, scheme = "primary", variant = "solid", loadingText, size = "md", leftIcon, rightIcon, disabled, className: baseClassName = "", children, ...rest } = props;
|
|
42
|
-
const iconSizes = { xs: 12, sm: 16, md: 20, lg: 24 };
|
|
43
|
-
const iconSize = iconSizes[size];
|
|
44
|
-
const loadingClass = isLoading ? "loadingTrue" : "loadingFalse";
|
|
45
|
-
const loadingTextClass = !!loadingText
|
|
46
|
-
? "loadingTextTrue"
|
|
47
|
-
: "loadingTextFalse";
|
|
48
|
-
const className = `arkynButton ${loadingClass} ${variant} ${scheme} ${size} ${loadingTextClass} ${baseClassName}`;
|
|
49
|
-
return (_jsxs("button", { className: className, disabled: disabled || isLoading, ...rest, children: [_jsxs("div", { className: "arkynButtonSpinner", children: [_jsx(Loader2, { size: iconSize, strokeWidth: 2.5 }), loadingText && loadingText] }), _jsxs("div", { className: "arkynButtonContent", children: [_jsx(IconRenderer, { iconSize: iconSize, icon: leftIcon }), children, _jsx(IconRenderer, { iconSize: iconSize, icon: rightIcon })] })] }));
|
|
50
|
-
}
|
|
51
|
-
export { Button };
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { createContext, useContext, useState } from "react";
|
|
3
|
-
import { ViewService } from "./_viewService";
|
|
4
|
-
const CalendarContext = createContext({});
|
|
5
|
-
function useCalendar() {
|
|
6
|
-
return useContext(CalendarContext);
|
|
7
|
-
}
|
|
8
|
-
function CalendarProvider(props) {
|
|
9
|
-
const { calendarType, children, defaultValue: rawDefaultValue, defaultViewValue = new Date(), language = "pt-BR", onChange, onChangeView, value, viewValue, } = props;
|
|
10
|
-
const defaultValue = calendarType === "single"
|
|
11
|
-
? [rawDefaultValue || new Date(), rawDefaultValue || new Date()]
|
|
12
|
-
: rawDefaultValue || [new Date(), new Date()];
|
|
13
|
-
const [rawViewDate, rawSetViewDate] = useState(defaultViewValue);
|
|
14
|
-
const [rawValueDate, rawSetValueDate] = useState(defaultValue);
|
|
15
|
-
const viewDate = viewValue || rawViewDate;
|
|
16
|
-
const valueDate = value
|
|
17
|
-
? calendarType === "single"
|
|
18
|
-
? [value, value]
|
|
19
|
-
: value
|
|
20
|
-
: rawValueDate;
|
|
21
|
-
const viewService = new ViewService();
|
|
22
|
-
function setValueDate(value) {
|
|
23
|
-
const normalizedValue = [
|
|
24
|
-
new Date(value[0]),
|
|
25
|
-
new Date(value[1]),
|
|
26
|
-
];
|
|
27
|
-
if (onChange && calendarType === "range") {
|
|
28
|
-
onChange(normalizedValue);
|
|
29
|
-
}
|
|
30
|
-
if (onChange && calendarType === "single") {
|
|
31
|
-
onChange(normalizedValue[0]);
|
|
32
|
-
}
|
|
33
|
-
rawSetValueDate(normalizedValue);
|
|
34
|
-
}
|
|
35
|
-
function setViewDate(date) {
|
|
36
|
-
if (onChangeView)
|
|
37
|
-
onChangeView(date);
|
|
38
|
-
rawSetViewDate(date);
|
|
39
|
-
}
|
|
40
|
-
return (_jsx(CalendarContext.Provider, { value: {
|
|
41
|
-
valueDate,
|
|
42
|
-
viewDate,
|
|
43
|
-
currentDate: viewDate.toLocaleDateString(language).slice(3),
|
|
44
|
-
currentDay: viewService.currentDay(viewDate),
|
|
45
|
-
currentMonth: viewService.currentMonth(viewDate),
|
|
46
|
-
currentYear: viewService.currentYear(viewDate),
|
|
47
|
-
listWeek: viewService.listWeek(language),
|
|
48
|
-
listMonths: viewService.listMonths(viewDate, language),
|
|
49
|
-
listYears: viewService.listYears(100),
|
|
50
|
-
listMatrix: viewService.listMatrix(viewDate, valueDate),
|
|
51
|
-
changeDay: (day, month, year) => viewService.changeDay(day, month, year, calendarType, valueDate, setValueDate, setViewDate),
|
|
52
|
-
changeMonth: (month) => viewService.changeMonth(month, viewDate, setViewDate),
|
|
53
|
-
changeYear: (year) => viewService.changeYear(year, viewDate, setViewDate),
|
|
54
|
-
nextMonth: () => viewService.nextMonth(viewDate, setViewDate),
|
|
55
|
-
previousMonth: () => viewService.previousMonth(viewDate, setViewDate),
|
|
56
|
-
}, children: children }));
|
|
57
|
-
}
|
|
58
|
-
export { CalendarProvider, useCalendar };
|