@povio/ui 2.1.14 → 2.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +74 -0
- package/dist/AclGuard.js +12 -0
- package/dist/ActionModal.js +51 -0
- package/dist/Alert.js +46 -0
- package/dist/AlignCenter.js +13 -0
- package/dist/AlignLeft.js +13 -0
- package/dist/AlignLeftRight.js +13 -0
- package/dist/AlignRight.js +13 -0
- package/dist/ArrowDropDown.js +13 -0
- package/dist/ArrowDropUp.js +13 -0
- package/dist/ArrowLeft.js +13 -0
- package/dist/ArrowRight.js +13 -0
- package/dist/AuthGuard.js +22 -0
- package/dist/Autocomplete.js +28 -0
- package/dist/Bold.js +13 -0
- package/dist/BottomSheet.js +191 -0
- package/dist/BulletedList.js +13 -0
- package/dist/Button.js +54 -0
- package/dist/ButtonContent.js +28 -0
- package/dist/Calendar.js +15 -0
- package/dist/Calendar2.js +54 -0
- package/dist/CalendarCell.js +130 -0
- package/dist/CalendarGrid.js +50 -0
- package/dist/CalendarHeader.js +75 -0
- package/dist/CalendarSelectHeader.js +170 -0
- package/dist/Can.js +13 -0
- package/dist/CellText.js +13 -0
- package/dist/Check.js +15 -0
- package/dist/CheckCircle.js +13 -0
- package/dist/CheckContent.js +16 -0
- package/dist/Checkbox.js +61 -0
- package/dist/CheckboxCheckmark.js +16 -0
- package/dist/CheckboxCheckmark2.js +25 -0
- package/dist/CheckboxIndeterminate.js +16 -0
- package/dist/ChevronDown.js +15 -0
- package/dist/ChevronLeft.js +15 -0
- package/dist/ChevronRight.js +15 -0
- package/dist/ChevronUp.js +15 -0
- package/dist/ChevronsLeft.js +15 -0
- package/dist/ChevronsRight.js +15 -0
- package/dist/Clock.js +13 -0
- package/dist/Close.js +13 -0
- package/dist/ColorPicker.js +16 -0
- package/dist/ColorPickerDropdown.js +51 -0
- package/dist/ColumnConfig.js +81 -0
- package/dist/DateField.js +89 -0
- package/dist/DatePicker.js +191 -0
- package/dist/DatePickerInput.js +158 -0
- package/dist/DateRangePicker.js +601 -0
- package/dist/DateSegmentItem.js +29 -0
- package/dist/DateTime.js +18 -0
- package/dist/DateTimeDialog.js +49 -0
- package/dist/DateTimeDialogFooter.js +25 -0
- package/dist/DateTimePicker.js +200 -0
- package/dist/Drag.js +13 -0
- package/dist/Drawer.js +43 -0
- package/dist/File.js +15 -0
- package/dist/FileCard.js +50 -0
- package/dist/FileCardList.js +17 -0
- package/dist/FileUpload.js +189 -0
- package/dist/FileUploadContainer.js +12 -0
- package/dist/FileUploadContent.js +61 -0
- package/dist/FileUploadContentEmpty.js +54 -0
- package/dist/FileUploadContentError.js +109 -0
- package/dist/FileUploadContentFilled.js +112 -0
- package/dist/FileUploadContentLoading.js +76 -0
- package/dist/Form.js +42 -0
- package/dist/FormField.js +35 -0
- package/dist/FormFieldError.js +11 -0
- package/dist/FormFieldHeader.js +36 -0
- package/dist/FormFieldHeaderClose.js +15 -0
- package/dist/FormFieldLabel.js +32 -0
- package/dist/HeaderText.js +10 -0
- package/dist/Highlight.js +13 -0
- package/dist/HighlightOn.js +19 -0
- package/dist/HyperlinkAction.js +70 -0
- package/dist/IconButton.js +12 -0
- package/dist/InfiniteTable.js +31 -0
- package/dist/Info.js +18 -0
- package/dist/InlineIconButton.js +13 -0
- package/dist/InputClear.js +19 -0
- package/dist/InputContent.js +94 -0
- package/dist/InputItem.js +54 -0
- package/dist/InputUpload.js +111 -0
- package/dist/InputUploadContent.js +52 -0
- package/dist/InputUploadFilled.js +26 -0
- package/dist/Inputs.js +15 -0
- package/dist/Italic.js +13 -0
- package/dist/Link.js +13 -0
- package/dist/Link2.js +19 -0
- package/dist/Loader.js +32 -0
- package/dist/Menu.js +13 -0
- package/dist/Menu2.js +9 -0
- package/dist/MenuDesktop.js +53 -0
- package/dist/MenuItem.js +21 -0
- package/dist/MenuMobile.js +64 -0
- package/dist/MenuPopover.js +30 -0
- package/dist/Modal.js +49 -0
- package/dist/MonthPicker.js +56 -0
- package/dist/NumberInput.js +132 -0
- package/dist/NumberedList.js +13 -0
- package/dist/PaginatedTable.js +26 -0
- package/dist/Pagination.js +43 -0
- package/dist/PaginationList.js +105 -0
- package/dist/PasswordInput.js +21 -0
- package/dist/PillButton.js +37 -0
- package/dist/PointerHorizontal.js +13 -0
- package/dist/PointerVertical.js +13 -0
- package/dist/ProgressBar.js +25 -0
- package/dist/QueryAutocomplete.js +18 -0
- package/dist/RadioGroup.js +81 -0
- package/dist/RangeCalendar.js +96 -0
- package/dist/ResponsivePopover.js +41 -0
- package/dist/Segment.js +82 -0
- package/dist/SegmentItem.js +23 -0
- package/dist/Select.js +24 -0
- package/dist/SelectBase.js +28 -0
- package/dist/SelectDesktop.js +147 -0
- package/dist/SelectInput.js +159 -0
- package/dist/SelectInputTags.js +29 -0
- package/dist/SelectListBox.js +73 -0
- package/dist/SelectListBoxItem.js +48 -0
- package/dist/SelectListBoxItemSelectAll.js +31 -0
- package/dist/SelectListBoxLoadingItem.js +41 -0
- package/dist/SelectListBoxSelectionBar.js +25 -0
- package/dist/SelectMobile.js +111 -0
- package/dist/Send.js +15 -0
- package/dist/Slider.js +93 -0
- package/dist/SplitButton.js +36 -0
- package/dist/Strikethrough.js +13 -0
- package/dist/Table.js +248 -0
- package/dist/Tag.js +42 -0
- package/dist/TextAlignSelect.js +44 -0
- package/dist/TextArea.js +120 -0
- package/dist/TextButton.js +13 -0
- package/dist/TextColor.js +16 -0
- package/dist/TextColorSelect.js +22 -0
- package/dist/TextEditor.js +143 -0
- package/dist/TextEditorToolbar.js +30 -0
- package/dist/TextHighlightSelect.js +24 -0
- package/dist/TextInput.js +125 -0
- package/dist/TextListActions.js +42 -0
- package/dist/TextMarksActions.js +67 -0
- package/dist/TextStyleSelect.js +52 -0
- package/dist/TimeField.js +17 -0
- package/dist/TimePicker.js +158 -0
- package/dist/TimePickerForm.js +158 -0
- package/dist/TimePickerInput.js +92 -0
- package/dist/Toast.js +58 -0
- package/dist/Today.js +13 -0
- package/dist/Toggle.js +60 -0
- package/dist/ToggleButton.js +13 -0
- package/dist/Tooltip.js +49 -0
- package/dist/TooltipEllipsis.js +18 -0
- package/dist/TooltipWrapper.js +19 -0
- package/dist/Typography.js +14 -0
- package/dist/Underlined.js +15 -0
- package/dist/Upload.js +16 -0
- package/dist/View.js +13 -0
- package/dist/ViewOff.js +13 -0
- package/dist/WarningFilled.js +15 -0
- package/dist/YearPicker.js +64 -0
- package/dist/ability.context.js +35 -0
- package/dist/alert.cva.js +62 -0
- package/dist/array.utils.js +8 -0
- package/dist/auth.context.js +37 -0
- package/dist/auth.js +6 -12
- package/dist/button.cva.js +656 -0
- package/dist/buttonContent.cva.js +10 -0
- package/dist/checkbox.cva.js +47 -0
- package/dist/components/inputs/Checkbox/Checkbox.d.ts +1 -0
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.d.ts +2 -2
- package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +5 -0
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +3 -1
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +3 -1
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +3 -1
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +1 -0
- package/dist/components/inputs/DateTime/shared/DateField.d.ts +1 -0
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +8 -2
- package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +2 -1
- package/dist/components/inputs/File/fileUpload.types.d.ts +1 -0
- package/dist/components/inputs/FormField/FormField.d.ts +4 -1
- package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +4 -2
- package/dist/components/inputs/Input/TextArea/TextArea.d.ts +1 -0
- package/dist/components/inputs/Input/TextInput/TextInput.d.ts +2 -1
- package/dist/components/inputs/Input/shared/InputContent.d.ts +4 -3
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +3 -0
- package/dist/components/inputs/TextEditor/TextEditor.d.ts +1 -0
- package/dist/components/inputs/Toggle/Toggle.d.ts +2 -0
- package/dist/components/inputs/shared/CheckContent.d.ts +2 -1
- package/dist/compoundMapper.js +11 -0
- package/dist/config/uiStyle.context.d.ts +2 -1
- package/dist/confirmation.context.js +78 -0
- package/dist/date-time.utils.js +50 -0
- package/dist/date.utils.js +17 -0
- package/dist/dom.utils.js +17 -0
- package/dist/dynamicColumns.js +272 -0
- package/dist/dynamicInputs.js +186 -0
- package/dist/error-handling.js +87 -0
- package/dist/file.utils.js +43 -0
- package/dist/fileUpload.cva.js +49 -0
- package/dist/i18n.js +8 -0
- package/dist/index.js +136 -278
- package/dist/input.cva.js +210 -0
- package/dist/inputUploadButton.cva.js +27 -0
- package/dist/isEqual.js +57 -0
- package/dist/label.cva.js +104 -0
- package/dist/link.context.js +17 -0
- package/dist/link.cva.js +7 -0
- package/dist/loader.cva.js +16 -0
- package/dist/logger.js +17 -0
- package/dist/menu.cva.js +27 -0
- package/dist/minWidth.cva.js +9 -0
- package/dist/modal.cva.js +31 -0
- package/dist/object.utils.js +36 -0
- package/dist/outline.clsx.js +4 -0
- package/dist/pillButton.cva.js +254 -0
- package/dist/queries.utils.js +7 -0
- package/dist/radio.cva.js +42 -0
- package/dist/react.js +6 -0
- package/dist/rest-interceptor.js +22 -0
- package/dist/rest.utils.js +31 -0
- package/dist/rolldown_runtime.js +16 -0
- package/dist/router.context.js +37 -0
- package/dist/routing.utils.js +9 -0
- package/dist/segment.cva.js +25 -0
- package/dist/select.context.js +190 -0
- package/dist/status.cva.js +57 -0
- package/dist/string.utils.js +10 -0
- package/dist/table.cva.js +35 -0
- package/dist/tag.cva.js +50 -0
- package/dist/text-editor.js +2 -4
- package/dist/textEditor.types.js +38 -0
- package/dist/theme.context.js +65 -0
- package/dist/toast.cva.js +158 -0
- package/dist/toggle.cva.js +27 -0
- package/dist/tooltip.cva.js +30 -0
- package/dist/translation.js +147 -0
- package/dist/translation2.js +145 -0
- package/dist/typography.cva.js +124 -0
- package/dist/uiConfig.context.js +58 -0
- package/dist/uiStyle.context.js +16 -0
- package/dist/useAutosave.js +62 -0
- package/dist/useBreakpoint.js +28 -0
- package/dist/useDebounceCallback.js +23 -0
- package/dist/useDeepCompare.js +21 -0
- package/dist/useFilters.js +121 -0
- package/dist/useForm.js +12 -0
- package/dist/useFormAutosave.js +52 -0
- package/dist/useIntersectionObserver.js +23 -0
- package/dist/useLocalStorage.js +35 -0
- package/dist/useLongPressRepeat.js +27 -0
- package/dist/usePagination.js +26 -0
- package/dist/useScrollableListBox.js +24 -0
- package/dist/useSelectItems.js +82 -0
- package/dist/useSorting.js +34 -0
- package/dist/useStateAndRef.js +15 -0
- package/dist/useTableColumnConfig.js +38 -0
- package/dist/useTableNav.js +279 -0
- package/dist/useToast.js +63 -0
- package/dist/useTranslationMemo.js +10 -0
- package/dist/zod.utils.js +17 -0
- package/package.json +14 -14
- package/dist/assets/icons/AlignCenter.js +0 -21
- package/dist/assets/icons/AlignLeft.js +0 -21
- package/dist/assets/icons/AlignLeftRight.js +0 -21
- package/dist/assets/icons/AlignRight.js +0 -21
- package/dist/assets/icons/ArrowDropDown.js +0 -21
- package/dist/assets/icons/ArrowDropUp.js +0 -21
- package/dist/assets/icons/ArrowLeft.js +0 -21
- package/dist/assets/icons/ArrowRight.js +0 -21
- package/dist/assets/icons/Bold.js +0 -21
- package/dist/assets/icons/BulletedList.js +0 -21
- package/dist/assets/icons/Calendar.js +0 -23
- package/dist/assets/icons/Check.js +0 -23
- package/dist/assets/icons/CheckCircle.js +0 -21
- package/dist/assets/icons/CheckboxCheckmark.js +0 -24
- package/dist/assets/icons/CheckboxIndeterminate.js +0 -24
- package/dist/assets/icons/ChevronDown.js +0 -23
- package/dist/assets/icons/ChevronLeft.js +0 -23
- package/dist/assets/icons/ChevronRight.js +0 -23
- package/dist/assets/icons/ChevronUp.js +0 -23
- package/dist/assets/icons/ChevronsLeft.js +0 -23
- package/dist/assets/icons/ChevronsRight.js +0 -23
- package/dist/assets/icons/Clock.js +0 -21
- package/dist/assets/icons/Close.js +0 -21
- package/dist/assets/icons/DateTime.js +0 -32
- package/dist/assets/icons/Drag.js +0 -21
- package/dist/assets/icons/File.js +0 -23
- package/dist/assets/icons/Highlight.js +0 -21
- package/dist/assets/icons/HighlightOn.js +0 -30
- package/dist/assets/icons/Info.js +0 -32
- package/dist/assets/icons/Italic.js +0 -21
- package/dist/assets/icons/Link.js +0 -21
- package/dist/assets/icons/Menu.js +0 -21
- package/dist/assets/icons/NumberedList.js +0 -21
- package/dist/assets/icons/PointerHorizontal.js +0 -21
- package/dist/assets/icons/PointerVertical.js +0 -21
- package/dist/assets/icons/Send.js +0 -23
- package/dist/assets/icons/Strikethrough.js +0 -21
- package/dist/assets/icons/TextColor.js +0 -30
- package/dist/assets/icons/Today.js +0 -21
- package/dist/assets/icons/Underlined.js +0 -23
- package/dist/assets/icons/Upload.js +0 -30
- package/dist/assets/icons/View.js +0 -18
- package/dist/assets/icons/ViewOff.js +0 -18
- package/dist/assets/icons/WarningFilled.js +0 -23
- package/dist/assets/locales/en/translation.json.js +0 -14
- package/dist/assets/locales/sl/translation.json.js +0 -14
- package/dist/components/Menu/Menu.js +0 -14
- package/dist/components/Menu/MenuDesktop.js +0 -74
- package/dist/components/Menu/MenuItem.js +0 -27
- package/dist/components/Menu/MenuMobile.js +0 -83
- package/dist/components/Menu/MenuPopover.js +0 -43
- package/dist/components/Menu/menu.cva.js +0 -45
- package/dist/components/buttons/Button/Button.js +0 -73
- package/dist/components/buttons/Button/button.cva.js +0 -666
- package/dist/components/buttons/IconButton/IconButton.js +0 -17
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +0 -18
- package/dist/components/buttons/PillButton/PillButton.js +0 -44
- package/dist/components/buttons/PillButton/pillButton.cva.js +0 -268
- package/dist/components/buttons/SplitButton/SplitButton.js +0 -65
- package/dist/components/buttons/TextButton/TextButton.js +0 -18
- package/dist/components/buttons/ToggleButton/ToggleButton.js +0 -21
- package/dist/components/buttons/shared/ButtonContent.js +0 -53
- package/dist/components/buttons/shared/buttonContent.cva.js +0 -16
- package/dist/components/inputs/Checkbox/Checkbox.js +0 -81
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +0 -32
- package/dist/components/inputs/Checkbox/checkbox.cva.js +0 -51
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +0 -251
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +0 -689
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +0 -265
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +0 -217
- package/dist/components/inputs/DateTime/shared/Calendar.js +0 -85
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +0 -160
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +0 -67
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +0 -89
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +0 -203
- package/dist/components/inputs/DateTime/shared/DateField.js +0 -77
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +0 -206
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +0 -55
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +0 -76
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +0 -47
- package/dist/components/inputs/DateTime/shared/MonthPicker.js +0 -82
- package/dist/components/inputs/DateTime/shared/RangeCalendar.js +0 -133
- package/dist/components/inputs/DateTime/shared/TimeField.js +0 -26
- package/dist/components/inputs/DateTime/shared/TimePickerForm.js +0 -186
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +0 -125
- package/dist/components/inputs/DateTime/shared/YearPicker.js +0 -89
- package/dist/components/inputs/File/FileUpload.js +0 -257
- package/dist/components/inputs/File/FileUploadContainer.js +0 -17
- package/dist/components/inputs/File/InputUpload.js +0 -174
- package/dist/components/inputs/File/shared/FileCard.js +0 -67
- package/dist/components/inputs/File/shared/FileCardList.js +0 -20
- package/dist/components/inputs/File/shared/FileUploadContent.js +0 -92
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +0 -92
- package/dist/components/inputs/File/shared/FileUploadContentError.js +0 -167
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +0 -173
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +0 -128
- package/dist/components/inputs/File/shared/InputUploadContent.js +0 -73
- package/dist/components/inputs/File/shared/InputUploadFilled.js +0 -45
- package/dist/components/inputs/File/shared/ProgressBar.js +0 -42
- package/dist/components/inputs/File/shared/fileUpload.cva.js +0 -58
- package/dist/components/inputs/File/shared/inputUploadButton.cva.js +0 -49
- package/dist/components/inputs/FormField/FormField.js +0 -54
- package/dist/components/inputs/FormField/FormFieldError.js +0 -16
- package/dist/components/inputs/FormField/FormFieldHeader.js +0 -57
- package/dist/components/inputs/FormField/FormFieldHeaderClose.js +0 -20
- package/dist/components/inputs/FormField/FormFieldLabel.js +0 -37
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +0 -166
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +0 -26
- package/dist/components/inputs/Input/TextArea/TextArea.js +0 -155
- package/dist/components/inputs/Input/TextInput/TextInput.js +0 -162
- package/dist/components/inputs/Input/shared/InputContent.js +0 -114
- package/dist/components/inputs/Inputs/Form.js +0 -68
- package/dist/components/inputs/Inputs/InputItem.js +0 -61
- package/dist/components/inputs/Inputs/Inputs.js +0 -32
- package/dist/components/inputs/RadioGroup/RadioGroup.js +0 -103
- package/dist/components/inputs/RadioGroup/radio.cva.js +0 -57
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +0 -39
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +0 -25
- package/dist/components/inputs/Selection/Select/Select.js +0 -32
- package/dist/components/inputs/Selection/shared/SelectBase.js +0 -27
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +0 -223
- package/dist/components/inputs/Selection/shared/SelectInput.js +0 -234
- package/dist/components/inputs/Selection/shared/SelectInputTags.js +0 -49
- package/dist/components/inputs/Selection/shared/SelectListBox.js +0 -127
- package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +0 -78
- package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +0 -45
- package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +0 -47
- package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +0 -42
- package/dist/components/inputs/Selection/shared/SelectMobile.js +0 -165
- package/dist/components/inputs/Selection/shared/select.context.js +0 -244
- package/dist/components/inputs/Selection/shared/useSelectItems.js +0 -94
- package/dist/components/inputs/Slider/Slider.js +0 -137
- package/dist/components/inputs/TextEditor/TextEditor.js +0 -223
- package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +0 -34
- package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +0 -80
- package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +0 -92
- package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +0 -56
- package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +0 -33
- package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +0 -31
- package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +0 -37
- package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +0 -51
- package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +0 -73
- package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +0 -61
- package/dist/components/inputs/TextEditor/textEditor.types.js +0 -40
- package/dist/components/inputs/Toggle/Toggle.js +0 -65
- package/dist/components/inputs/Toggle/toggle.cva.js +0 -44
- package/dist/components/inputs/shared/CheckContent.js +0 -22
- package/dist/components/inputs/shared/InputClear.js +0 -27
- package/dist/components/inputs/shared/TooltipWrapper.js +0 -23
- package/dist/components/inputs/shared/input.cva.js +0 -174
- package/dist/components/inputs/shared/label.cva.js +0 -128
- package/dist/components/outline.clsx.js +0 -11
- package/dist/components/overlays/ActionModal/ActionModal.js +0 -80
- package/dist/components/overlays/BottomSheet/BottomSheet.js +0 -261
- package/dist/components/overlays/Drawer/Drawer.js +0 -84
- package/dist/components/overlays/Modal/Modal.js +0 -64
- package/dist/components/overlays/Modal/modal.cva.js +0 -53
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +0 -71
- package/dist/components/overlays/Tooltip/Tooltip.js +0 -92
- package/dist/components/overlays/Tooltip/TooltipEllipsis.js +0 -27
- package/dist/components/overlays/Tooltip/tooltip.cva.js +0 -60
- package/dist/components/segment/Segment.js +0 -118
- package/dist/components/segment/SegmentItem.js +0 -35
- package/dist/components/segment/segment.cva.js +0 -35
- package/dist/components/shared/pagination/Pagination.js +0 -75
- package/dist/components/shared/pagination/PaginationList.js +0 -145
- package/dist/components/shared/pagination/minWidth.cva.js +0 -15
- package/dist/components/status/Alert/Alert.js +0 -41
- package/dist/components/status/Alert/alert.cva.js +0 -64
- package/dist/components/status/Loader/Loader.js +0 -37
- package/dist/components/status/Loader/loader.cva.js +0 -27
- package/dist/components/status/Toast/Toast.js +0 -65
- package/dist/components/status/Toast/toast.cva.js +0 -150
- package/dist/components/status/Toast/useToast.js +0 -94
- package/dist/components/status/shared/status.cva.js +0 -62
- package/dist/components/table/CellText.js +0 -18
- package/dist/components/table/ColumnConfig.js +0 -124
- package/dist/components/table/HeaderText.js +0 -15
- package/dist/components/table/InfiniteTable.js +0 -40
- package/dist/components/table/PaginatedTable.js +0 -33
- package/dist/components/table/Table.js +0 -370
- package/dist/components/table/table.cva.js +0 -63
- package/dist/components/text/Link/Link.js +0 -24
- package/dist/components/text/Link/link.cva.js +0 -18
- package/dist/components/text/Tag/Tag.js +0 -49
- package/dist/components/text/Tag/tag.cva.js +0 -59
- package/dist/components/text/Typography/Typography.js +0 -22
- package/dist/components/text/Typography/typography.cva.js +0 -100
- package/dist/config/confirmation.context.js +0 -107
- package/dist/config/i18n.js +0 -15
- package/dist/config/link.context.js +0 -19
- package/dist/config/router.context.js +0 -39
- package/dist/config/theme.context.js +0 -73
- package/dist/config/uiConfig.context.js +0 -69
- package/dist/config/uiStyle.context.js +0 -16
- package/dist/helpers/dynamicColumns.js +0 -359
- package/dist/helpers/dynamicInputs.js +0 -212
- package/dist/hooks/useAutosave.js +0 -83
- package/dist/hooks/useBreakpoint.js +0 -33
- package/dist/hooks/useDebounceCallback.js +0 -29
- package/dist/hooks/useDeepCompare.js +0 -25
- package/dist/hooks/useFilters.js +0 -160
- package/dist/hooks/useForm.js +0 -22
- package/dist/hooks/useFormAutosave.js +0 -67
- package/dist/hooks/useIntersectionObserver.js +0 -27
- package/dist/hooks/useLocalStorage.js +0 -54
- package/dist/hooks/useLongPressRepeat.js +0 -33
- package/dist/hooks/usePagination.js +0 -35
- package/dist/hooks/useScrollableListBox.js +0 -30
- package/dist/hooks/useSorting.js +0 -32
- package/dist/hooks/useStateAndRef.js +0 -17
- package/dist/hooks/useTableColumnConfig.js +0 -63
- package/dist/hooks/useTableNav.js +0 -394
- package/dist/hooks/useTranslationMemo.js +0 -14
- package/dist/utils/array.utils.js +0 -12
- package/dist/utils/compoundMapper.js +0 -14
- package/dist/utils/date-time.utils.js +0 -77
- package/dist/utils/date.utils.js +0 -23
- package/dist/utils/dom.utils.js +0 -13
- package/dist/utils/file.utils.js +0 -63
- package/dist/utils/isEqual.js +0 -95
- package/dist/utils/logger.js +0 -19
- package/dist/utils/object.utils.js +0 -53
- package/dist/utils/queries.utils.js +0 -9
- package/dist/utils/rest.utils.js +0 -51
- package/dist/utils/routing.utils.js +0 -15
- package/dist/utils/string.utils.js +0 -12
- package/dist/utils/vendor/acl/AclGuard.js +0 -14
- package/dist/utils/vendor/acl/Can.js +0 -18
- package/dist/utils/vendor/acl/ability.context.js +0 -37
- package/dist/utils/vendor/auth/AuthGuard.js +0 -26
- package/dist/utils/vendor/auth/auth.context.js +0 -41
- package/dist/utils/vendor/error-handling.js +0 -119
- package/dist/utils/vendor/rest-interceptor.js +0 -21
- package/dist/utils/zod.utils.js +0 -21
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { isSameDay } from "@internationalized/date";
|
|
3
|
-
import { useCalendarCell } from "@react-aria/calendar";
|
|
4
|
-
import { useFocusRing } from "@react-aria/focus";
|
|
5
|
-
import { mergeProps } from "@react-aria/utils";
|
|
6
|
-
import { clsx } from "clsx";
|
|
7
|
-
import { useRef, useCallback, useMemo } from "react";
|
|
8
|
-
import { Typography } from "../../../text/Typography/Typography.js";
|
|
9
|
-
const isRange = (state) => {
|
|
10
|
-
return "highlightedRange" in state;
|
|
11
|
-
};
|
|
12
|
-
const CalendarCell = ({
|
|
13
|
-
state,
|
|
14
|
-
onApply,
|
|
15
|
-
shouldCloseOnSelect = true,
|
|
16
|
-
onDateSelection,
|
|
17
|
-
onDateHover,
|
|
18
|
-
rangeSelection,
|
|
19
|
-
hoverDate,
|
|
20
|
-
onKeyboardNavigation,
|
|
21
|
-
...props
|
|
22
|
-
}) => {
|
|
23
|
-
const ref = useRef(null);
|
|
24
|
-
const { cellProps, buttonProps, formattedDate, isSelected, isDisabled, isOutsideVisibleRange } = useCalendarCell(
|
|
25
|
-
props,
|
|
26
|
-
state,
|
|
27
|
-
ref
|
|
28
|
-
);
|
|
29
|
-
const { focusProps } = useFocusRing();
|
|
30
|
-
const onClick = useCallback(
|
|
31
|
-
(event) => {
|
|
32
|
-
buttonProps.onClick?.(event);
|
|
33
|
-
if (onDateSelection) {
|
|
34
|
-
onDateSelection(props.date);
|
|
35
|
-
}
|
|
36
|
-
if (isSelected && shouldCloseOnSelect) {
|
|
37
|
-
onApply?.();
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
[buttonProps, onDateSelection, props.date, isSelected, shouldCloseOnSelect, onApply]
|
|
41
|
-
);
|
|
42
|
-
const selectionState = useMemo(() => {
|
|
43
|
-
let isSelectionStart = false;
|
|
44
|
-
let isSelectionEnd = false;
|
|
45
|
-
let isSelectedCell = false;
|
|
46
|
-
let isInRange = false;
|
|
47
|
-
let isHoverRange = false;
|
|
48
|
-
let isSelectingMode = false;
|
|
49
|
-
if (rangeSelection?.start) {
|
|
50
|
-
isSelectionStart = isSameDay(props.date, rangeSelection.start);
|
|
51
|
-
isSelectionEnd = rangeSelection.end ? isSameDay(props.date, rangeSelection.end) : false;
|
|
52
|
-
isSelectedCell = isSelectionStart || isSelectionEnd;
|
|
53
|
-
isSelectingMode = rangeSelection.isSelecting && !rangeSelection.end;
|
|
54
|
-
if (rangeSelection.start && rangeSelection.end) {
|
|
55
|
-
const dateValue = props.date;
|
|
56
|
-
const isAfterStart = dateValue.compare(rangeSelection.start) > 0;
|
|
57
|
-
const isBeforeEnd = dateValue.compare(rangeSelection.end) < 0;
|
|
58
|
-
isInRange = isAfterStart && isBeforeEnd;
|
|
59
|
-
}
|
|
60
|
-
if (rangeSelection.isSelecting && rangeSelection.start && hoverDate && !rangeSelection.end) {
|
|
61
|
-
const dateValue = props.date;
|
|
62
|
-
const { start } = rangeSelection;
|
|
63
|
-
const end = hoverDate;
|
|
64
|
-
const earlierDate = start.compare(end) <= 0 ? start : end;
|
|
65
|
-
const laterDate = start.compare(end) <= 0 ? end : start;
|
|
66
|
-
const isAfterStart = dateValue.compare(earlierDate) > 0;
|
|
67
|
-
const isBeforeEnd = dateValue.compare(laterDate) < 0;
|
|
68
|
-
isHoverRange = isAfterStart && isBeforeEnd;
|
|
69
|
-
}
|
|
70
|
-
} else {
|
|
71
|
-
isSelectionStart = isRange(state) && state.highlightedRange ? isSameDay(props.date, state.highlightedRange.start) : isSelected;
|
|
72
|
-
isSelectionEnd = isRange(state) && state.highlightedRange ? isSameDay(props.date, state.highlightedRange.end) : isSelected;
|
|
73
|
-
isSelectedCell = isSelectionStart || isSelectionEnd || !isRange(state) && isSelected;
|
|
74
|
-
isInRange = isRange(state) && isSelected && !isSelectionStart && !isSelectionEnd;
|
|
75
|
-
if (isRange(state) && state.highlightedRange && !isSelected) {
|
|
76
|
-
const dateValue = props.date;
|
|
77
|
-
const isAfterStart = dateValue.compare(state.highlightedRange.start) > 0;
|
|
78
|
-
const isBeforeEnd = dateValue.compare(state.highlightedRange.end) < 0;
|
|
79
|
-
isHoverRange = isAfterStart && isBeforeEnd;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
return { isSelectionStart, isSelectionEnd, isSelectedCell, isInRange, isHoverRange, isSelectingMode };
|
|
83
|
-
}, [props.date, rangeSelection, state, isSelected, hoverDate]);
|
|
84
|
-
const handleEvent = (event, eventHandler) => {
|
|
85
|
-
if (isOutsideVisibleRange) {
|
|
86
|
-
state.selectDate(props.date);
|
|
87
|
-
state.setFocusedDate(props.date);
|
|
88
|
-
}
|
|
89
|
-
eventHandler?.(event);
|
|
90
|
-
if (isSelected && shouldCloseOnSelect) {
|
|
91
|
-
onApply?.();
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
const onMouseEnter = useCallback(() => {
|
|
95
|
-
if (onDateHover && selectionState.isSelectingMode) {
|
|
96
|
-
onDateHover(props.date);
|
|
97
|
-
}
|
|
98
|
-
}, [onDateHover, selectionState.isSelectingMode, props.date]);
|
|
99
|
-
const onMouseLeave = useCallback(() => {
|
|
100
|
-
if (onDateHover && selectionState.isSelectingMode) {
|
|
101
|
-
onDateHover(null);
|
|
102
|
-
}
|
|
103
|
-
}, [onDateHover, selectionState.isSelectingMode]);
|
|
104
|
-
const cellClassName = useMemo(() => {
|
|
105
|
-
const { isSelectedCell, isInRange, isHoverRange, isSelectingMode, isSelectionStart, isSelectionEnd } = selectionState;
|
|
106
|
-
return clsx(
|
|
107
|
-
"mx-auto flex h-10 w-full max-w-10 items-center justify-center rounded-button-rounding-m p-2",
|
|
108
|
-
"focus:outline-none focus-visible:outline-1 focus-visible:outline-interactive-contained-primary-focus focus-visible:outline-offset-1",
|
|
109
|
-
"border border-transparent border-solid",
|
|
110
|
-
// Base text colors
|
|
111
|
-
!isSelectedCell && !isOutsideVisibleRange && "bg-elevation-fill-default-1 text-interactive-text-secondary-idle",
|
|
112
|
-
!isSelectedCell && isOutsideVisibleRange && "bg-elevation-fill-default-1 text-interactive-text-secondary-disabled",
|
|
113
|
-
// Selected cell styling
|
|
114
|
-
isSelectedCell && !isOutsideVisibleRange && "bg-interactive-contained-primary-idle text-interactive-contained-primary-on-idle",
|
|
115
|
-
// Selection start cell styling
|
|
116
|
-
isSelectedCell && !isOutsideVisibleRange && rangeSelection && !rangeSelection.isSelecting && isSelectionStart && !isSelectionEnd && "rounded-r-none",
|
|
117
|
-
// Selection end cell styling
|
|
118
|
-
isSelectedCell && !isOutsideVisibleRange && rangeSelection && !rangeSelection.isSelecting && isSelectionEnd && !isSelectionStart && "rounded-l-none",
|
|
119
|
-
// Disabled state
|
|
120
|
-
isDisabled && !isOutsideVisibleRange && "cursor-default",
|
|
121
|
-
// Disabled cell styling
|
|
122
|
-
isDisabled && "opacity-20",
|
|
123
|
-
// Regular hover state - only for non-selected, non-disabled, visible cells when not in selecting mode
|
|
124
|
-
!isSelectedCell && !isInRange && !isHoverRange && !isSelectingMode && !isDisabled && !isOutsideVisibleRange && "[@media(pointer:fine)]:hover:border-elevation-outline-default-1 [@media(pointer:fine)]:hover:text-interactive-text-secondary-hover",
|
|
125
|
-
// Range styling - for dates between start and end
|
|
126
|
-
isInRange && !isOutsideVisibleRange && "!rounded-none !bg-elevation-fill-default-2 text-interactive-text-secondary-hover",
|
|
127
|
-
// Hover range styling - for potential range during hover
|
|
128
|
-
isHoverRange && !isOutsideVisibleRange && "!rounded-none !bg-elevation-fill-default-2 text-interactive-text-secondary-hover",
|
|
129
|
-
// Hover state for selecting mode
|
|
130
|
-
!isInRange && !isSelectedCell && isSelectingMode && "hover:bg-interactive-contained-primary-idle hover:text-interactive-text-primary-idle-inverted",
|
|
131
|
-
// css only hover effect during selection mode for better performance
|
|
132
|
-
isSelectingMode && !isSelectedCell && !isInRange && !isHoverRange && !isDisabled && !isOutsideVisibleRange && "transition-all duration-75 hover:border-elevation-outline-default-1"
|
|
133
|
-
);
|
|
134
|
-
}, [selectionState, isOutsideVisibleRange, rangeSelection, isDisabled]);
|
|
135
|
-
return /* @__PURE__ */ jsx("td", { ...cellProps, children: /* @__PURE__ */ jsx(
|
|
136
|
-
"div",
|
|
137
|
-
{
|
|
138
|
-
ref,
|
|
139
|
-
...mergeProps(buttonProps, focusProps),
|
|
140
|
-
"aria-disabled": void 0,
|
|
141
|
-
onMouseEnter,
|
|
142
|
-
onMouseLeave,
|
|
143
|
-
className: cellClassName,
|
|
144
|
-
onClick: (e) => handleEvent(e, onClick),
|
|
145
|
-
onKeyDown: (e) => handleEvent(e, () => onKeyboardNavigation?.(e, props.date)),
|
|
146
|
-
children: /* @__PURE__ */ jsx(
|
|
147
|
-
Typography,
|
|
148
|
-
{
|
|
149
|
-
as: "span",
|
|
150
|
-
size: "label-2",
|
|
151
|
-
className: "block w-6 overflow-hidden text-ellipsis text-center",
|
|
152
|
-
children: formattedDate
|
|
153
|
-
}
|
|
154
|
-
)
|
|
155
|
-
}
|
|
156
|
-
) });
|
|
157
|
-
};
|
|
158
|
-
export {
|
|
159
|
-
CalendarCell
|
|
160
|
-
};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useCalendarGrid } from "@react-aria/calendar";
|
|
3
|
-
import { clsx } from "clsx";
|
|
4
|
-
import { CalendarCell } from "./CalendarCell.js";
|
|
5
|
-
import { Typography } from "../../../text/Typography/Typography.js";
|
|
6
|
-
const WEEK_INDICES = [0, 1, 2, 3, 4, 5];
|
|
7
|
-
const CalendarGrid = ({
|
|
8
|
-
state,
|
|
9
|
-
onApply,
|
|
10
|
-
shouldCloseOnSelect,
|
|
11
|
-
offset = {},
|
|
12
|
-
onDateSelection,
|
|
13
|
-
onDateHover,
|
|
14
|
-
rangeSelection,
|
|
15
|
-
hoverDate,
|
|
16
|
-
onKeyboardNavigation,
|
|
17
|
-
className,
|
|
18
|
-
calendarSide,
|
|
19
|
-
...props
|
|
20
|
-
}) => {
|
|
21
|
-
const { gridProps, headerProps, weekDays } = useCalendarGrid({ ...props, weekdayStyle: "short" }, state);
|
|
22
|
-
const startDate = state.visibleRange.start.add(offset);
|
|
23
|
-
const handleDateSelection = (date) => {
|
|
24
|
-
onDateSelection?.(date, calendarSide);
|
|
25
|
-
};
|
|
26
|
-
return /* @__PURE__ */ jsx("div", { className: clsx("h-72 w-full px-3 py-1 md:w-80", className), children: /* @__PURE__ */ jsxs(
|
|
27
|
-
"table",
|
|
28
|
-
{
|
|
29
|
-
...gridProps,
|
|
30
|
-
cellPadding: "0",
|
|
31
|
-
className: "w-full",
|
|
32
|
-
children: [
|
|
33
|
-
/* @__PURE__ */ jsx("thead", { ...headerProps, children: /* @__PURE__ */ jsx("tr", { children: weekDays.map((day) => /* @__PURE__ */ jsx("th", { children: /* @__PURE__ */ jsx(
|
|
34
|
-
Typography,
|
|
35
|
-
{
|
|
36
|
-
size: "label-2",
|
|
37
|
-
className: "bg-elevation-fill-default-1 py-2 text-interactive-text-secondary-idle",
|
|
38
|
-
children: day.substring(0, 2)
|
|
39
|
-
}
|
|
40
|
-
) }, day)) }) }),
|
|
41
|
-
/* @__PURE__ */ jsx("tbody", { children: WEEK_INDICES.map((weekIndex) => /* @__PURE__ */ jsx("tr", { children: state.getDatesInWeek(weekIndex, startDate).map(
|
|
42
|
-
(date, i) => date ? /* @__PURE__ */ jsx(
|
|
43
|
-
CalendarCell,
|
|
44
|
-
{
|
|
45
|
-
state,
|
|
46
|
-
date,
|
|
47
|
-
onApply,
|
|
48
|
-
shouldCloseOnSelect,
|
|
49
|
-
onDateSelection: handleDateSelection,
|
|
50
|
-
onDateHover,
|
|
51
|
-
rangeSelection,
|
|
52
|
-
hoverDate,
|
|
53
|
-
onKeyboardNavigation
|
|
54
|
-
},
|
|
55
|
-
i
|
|
56
|
-
) : (
|
|
57
|
-
// oxlint-disable-next-line react/no-array-index-key
|
|
58
|
-
/* @__PURE__ */ jsx("td", {}, i)
|
|
59
|
-
)
|
|
60
|
-
) }, weekIndex)) })
|
|
61
|
-
]
|
|
62
|
-
}
|
|
63
|
-
) });
|
|
64
|
-
};
|
|
65
|
-
export {
|
|
66
|
-
CalendarGrid
|
|
67
|
-
};
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Time } from "@internationalized/date";
|
|
3
|
-
import { useDateFormatter } from "@react-aria/i18n";
|
|
4
|
-
import { Button, ToggleButtonGroup } from "react-aria-components";
|
|
5
|
-
import { ChevronLeftIcon } from "../../../../assets/icons/ChevronLeft.js";
|
|
6
|
-
import { ChevronRightIcon } from "../../../../assets/icons/ChevronRight.js";
|
|
7
|
-
import { PillButton } from "../../../buttons/PillButton/PillButton.js";
|
|
8
|
-
const HourCycle = {
|
|
9
|
-
12: "h12",
|
|
10
|
-
24: "h23"
|
|
11
|
-
};
|
|
12
|
-
const CalendarHeader = ({
|
|
13
|
-
calendarState,
|
|
14
|
-
datePickerState,
|
|
15
|
-
prevButtonProps,
|
|
16
|
-
nextButtonProps,
|
|
17
|
-
includesTime,
|
|
18
|
-
hourCycle,
|
|
19
|
-
toggleState,
|
|
20
|
-
setToggleState
|
|
21
|
-
}) => {
|
|
22
|
-
const formatter = useDateFormatter({
|
|
23
|
-
month: "long",
|
|
24
|
-
timeZone: calendarState.timeZone
|
|
25
|
-
});
|
|
26
|
-
const timeFormatter = useDateFormatter({
|
|
27
|
-
timeStyle: "short",
|
|
28
|
-
timeZone: calendarState.timeZone,
|
|
29
|
-
hourCycle: hourCycle ? HourCycle[hourCycle] : void 0
|
|
30
|
-
});
|
|
31
|
-
const year = calendarState.focusedDate.year.toString();
|
|
32
|
-
const month = formatter.format(calendarState.focusedDate.toDate(calendarState.timeZone));
|
|
33
|
-
const timeValue = datePickerState?.timeValue || new Time();
|
|
34
|
-
const date = /* @__PURE__ */ new Date();
|
|
35
|
-
date.setHours(timeValue.hour, timeValue.minute);
|
|
36
|
-
return /* @__PURE__ */ jsxs("div", { className: "inline-flex w-full items-center justify-between border-elevation-outline-default-1 border-b border-solid px-1", children: [
|
|
37
|
-
/* @__PURE__ */ jsx("div", { className: "inline-flex h-12 items-center p-3", children: !toggleState && /* @__PURE__ */ jsx(
|
|
38
|
-
Button,
|
|
39
|
-
{
|
|
40
|
-
...prevButtonProps,
|
|
41
|
-
className: "shrink-0 focus-visible:outline-interactive-contained-secondary-focus",
|
|
42
|
-
children: /* @__PURE__ */ jsx(ChevronLeftIcon, { className: "size-6 text-interactive-text-secondary-idle" })
|
|
43
|
-
}
|
|
44
|
-
) }),
|
|
45
|
-
/* @__PURE__ */ jsxs(ToggleButtonGroup, { className: "flex gap-2", children: [
|
|
46
|
-
/* @__PURE__ */ jsx(
|
|
47
|
-
PillButton,
|
|
48
|
-
{
|
|
49
|
-
color: "secondary",
|
|
50
|
-
toggle: true,
|
|
51
|
-
isSelected: toggleState === "month",
|
|
52
|
-
onChange: (isSelected) => setToggleState(isSelected ? "month" : null),
|
|
53
|
-
children: month
|
|
54
|
-
}
|
|
55
|
-
),
|
|
56
|
-
/* @__PURE__ */ jsx(
|
|
57
|
-
PillButton,
|
|
58
|
-
{
|
|
59
|
-
color: "secondary",
|
|
60
|
-
toggle: true,
|
|
61
|
-
isSelected: toggleState === "year",
|
|
62
|
-
onChange: (isSelected) => setToggleState(isSelected ? "year" : null),
|
|
63
|
-
children: year
|
|
64
|
-
}
|
|
65
|
-
),
|
|
66
|
-
includesTime && /* @__PURE__ */ jsx(
|
|
67
|
-
PillButton,
|
|
68
|
-
{
|
|
69
|
-
color: "secondary",
|
|
70
|
-
toggle: true,
|
|
71
|
-
isSelected: toggleState === "time",
|
|
72
|
-
onChange: (isSelected) => setToggleState(isSelected ? "time" : null),
|
|
73
|
-
children: timeFormatter.format(date)
|
|
74
|
-
}
|
|
75
|
-
)
|
|
76
|
-
] }),
|
|
77
|
-
/* @__PURE__ */ jsx("div", { className: "inline-flex h-12 items-center p-3", children: !toggleState && /* @__PURE__ */ jsx(
|
|
78
|
-
Button,
|
|
79
|
-
{
|
|
80
|
-
...nextButtonProps,
|
|
81
|
-
className: "shrink-0 focus-visible:outline-interactive-contained-secondary-focus",
|
|
82
|
-
children: /* @__PURE__ */ jsx(ChevronRightIcon, { className: "size-6 text-interactive-text-secondary-idle" })
|
|
83
|
-
}
|
|
84
|
-
) })
|
|
85
|
-
] });
|
|
86
|
-
};
|
|
87
|
-
export {
|
|
88
|
-
CalendarHeader
|
|
89
|
-
};
|
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useDateFormatter } from "@react-aria/i18n";
|
|
3
|
-
import { useMemo } from "react";
|
|
4
|
-
import { ArrowDropDownIcon } from "../../../../assets/icons/ArrowDropDown.js";
|
|
5
|
-
import { ChevronLeftIcon } from "../../../../assets/icons/ChevronLeft.js";
|
|
6
|
-
import { ChevronRightIcon } from "../../../../assets/icons/ChevronRight.js";
|
|
7
|
-
import { ChevronsLeftIcon } from "../../../../assets/icons/ChevronsLeft.js";
|
|
8
|
-
import { ChevronsRightIcon } from "../../../../assets/icons/ChevronsRight.js";
|
|
9
|
-
import { InlineIconButton } from "../../../buttons/InlineIconButton/InlineIconButton.js";
|
|
10
|
-
import { PillButton } from "../../../buttons/PillButton/PillButton.js";
|
|
11
|
-
import { Select } from "../../Selection/Select/Select.js";
|
|
12
|
-
const CalendarSelectHeader = ({
|
|
13
|
-
state,
|
|
14
|
-
isPrevMonthDisabled,
|
|
15
|
-
isPrevYearDisabled,
|
|
16
|
-
isNextMonthDisabled,
|
|
17
|
-
isNextYearDisabled,
|
|
18
|
-
offset = { months: 0 },
|
|
19
|
-
onNavigate,
|
|
20
|
-
maxDate,
|
|
21
|
-
minDate
|
|
22
|
-
}) => {
|
|
23
|
-
const displayDate = state.visibleRange.start.add(offset);
|
|
24
|
-
const currentMonth = displayDate.month - 1;
|
|
25
|
-
const currentYear = displayDate.year;
|
|
26
|
-
const formatter = useDateFormatter({
|
|
27
|
-
month: "long",
|
|
28
|
-
timeZone: state.timeZone
|
|
29
|
-
});
|
|
30
|
-
const numMonths = state.focusedDate.calendar.getMonthsInYear(state.focusedDate);
|
|
31
|
-
const MONTHS = useMemo(() => {
|
|
32
|
-
const months = [];
|
|
33
|
-
for (let i = 1; i <= numMonths; i++) {
|
|
34
|
-
const date = state.focusedDate.set({ month: i });
|
|
35
|
-
months.push(formatter.format(date.toDate(state.timeZone)));
|
|
36
|
-
}
|
|
37
|
-
return months;
|
|
38
|
-
}, [formatter, numMonths, state.focusedDate, state.timeZone]);
|
|
39
|
-
const years = Array.from({ length: 201 }, (_, i) => currentYear - 100 + i);
|
|
40
|
-
const getAvailableMonths = () => {
|
|
41
|
-
return MONTHS.map((month, i) => {
|
|
42
|
-
const monthDate = displayDate.set({ month: i + 1 });
|
|
43
|
-
let isDisabled = false;
|
|
44
|
-
if (maxDate) {
|
|
45
|
-
isDisabled = monthDate.year > maxDate.year || monthDate.year === maxDate.year && monthDate.month >= maxDate.month;
|
|
46
|
-
}
|
|
47
|
-
if (minDate) {
|
|
48
|
-
isDisabled = monthDate.year < minDate.year || monthDate.year === minDate.year && monthDate.month <= minDate.month;
|
|
49
|
-
}
|
|
50
|
-
return { month, value: i, isDisabled };
|
|
51
|
-
});
|
|
52
|
-
};
|
|
53
|
-
const getAvailableYears = () => {
|
|
54
|
-
return years.map((year) => {
|
|
55
|
-
let isDisabled = false;
|
|
56
|
-
if (maxDate) {
|
|
57
|
-
isDisabled = year > maxDate.year || year === maxDate.year && displayDate.month >= maxDate.month;
|
|
58
|
-
}
|
|
59
|
-
if (minDate && !isDisabled) {
|
|
60
|
-
isDisabled = year < minDate.year || year === minDate.year && displayDate.month <= minDate.month;
|
|
61
|
-
}
|
|
62
|
-
return { year, isDisabled };
|
|
63
|
-
});
|
|
64
|
-
};
|
|
65
|
-
const availableMonths = getAvailableMonths();
|
|
66
|
-
const availableYears = getAvailableYears();
|
|
67
|
-
const handleMonthChange = (value) => {
|
|
68
|
-
if (value === null) {
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
const newDate = displayDate.set({ month: value + 1 });
|
|
72
|
-
onNavigate?.(newDate);
|
|
73
|
-
};
|
|
74
|
-
const handleYearChange = (value) => {
|
|
75
|
-
if (value === null) {
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
const newDate = displayDate.set({ year: value });
|
|
79
|
-
onNavigate?.(newDate);
|
|
80
|
-
};
|
|
81
|
-
const handlePrevMonth = (e) => {
|
|
82
|
-
e.preventDefault();
|
|
83
|
-
e.stopPropagation();
|
|
84
|
-
const newDate = displayDate.subtract({ months: 1 });
|
|
85
|
-
onNavigate?.(newDate);
|
|
86
|
-
};
|
|
87
|
-
const handleNextMonth = (e) => {
|
|
88
|
-
e.preventDefault();
|
|
89
|
-
e.stopPropagation();
|
|
90
|
-
const newDate = displayDate.add({ months: 1 });
|
|
91
|
-
onNavigate?.(newDate);
|
|
92
|
-
};
|
|
93
|
-
const handlePrevYear = (e) => {
|
|
94
|
-
e.preventDefault();
|
|
95
|
-
e.stopPropagation();
|
|
96
|
-
const newDate = displayDate.subtract({ years: 1 });
|
|
97
|
-
onNavigate?.(newDate);
|
|
98
|
-
};
|
|
99
|
-
const handleNextYear = (e) => {
|
|
100
|
-
e.preventDefault();
|
|
101
|
-
e.stopPropagation();
|
|
102
|
-
const newDate = displayDate.add({ years: 1 });
|
|
103
|
-
onNavigate?.(newDate);
|
|
104
|
-
};
|
|
105
|
-
return /* @__PURE__ */ jsxs("div", { className: "flex w-full items-center justify-between gap-3 border-elevation-outline-default-1 border-b border-solid px-3 py-2-5", children: [
|
|
106
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
|
|
107
|
-
/* @__PURE__ */ jsx(
|
|
108
|
-
InlineIconButton,
|
|
109
|
-
{
|
|
110
|
-
color: "secondary",
|
|
111
|
-
isDisabled: isPrevYearDisabled,
|
|
112
|
-
onClick: handlePrevYear,
|
|
113
|
-
icon: ChevronsLeftIcon,
|
|
114
|
-
label: "Previous year"
|
|
115
|
-
}
|
|
116
|
-
),
|
|
117
|
-
/* @__PURE__ */ jsx(
|
|
118
|
-
InlineIconButton,
|
|
119
|
-
{
|
|
120
|
-
color: "secondary",
|
|
121
|
-
isDisabled: isPrevMonthDisabled,
|
|
122
|
-
onClick: handlePrevMonth,
|
|
123
|
-
icon: ChevronLeftIcon,
|
|
124
|
-
label: "Previous month"
|
|
125
|
-
}
|
|
126
|
-
)
|
|
127
|
-
] }),
|
|
128
|
-
/* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
|
|
129
|
-
/* @__PURE__ */ jsx(
|
|
130
|
-
Select,
|
|
131
|
-
{
|
|
132
|
-
label: "Month",
|
|
133
|
-
hideLabel: true,
|
|
134
|
-
customTrigger: /* @__PURE__ */ jsx(
|
|
135
|
-
PillButton,
|
|
136
|
-
{
|
|
137
|
-
color: "secondary",
|
|
138
|
-
iconPosition: "right",
|
|
139
|
-
icon: ArrowDropDownIcon,
|
|
140
|
-
children: MONTHS[currentMonth].slice(0, 3)
|
|
141
|
-
}
|
|
142
|
-
),
|
|
143
|
-
ignoreTriggerWidth: true,
|
|
144
|
-
items: availableMonths.map(({ month, value, isDisabled }) => ({
|
|
145
|
-
label: month,
|
|
146
|
-
id: value,
|
|
147
|
-
isDisabled
|
|
148
|
-
})).filter(({ isDisabled }) => !isDisabled),
|
|
149
|
-
value: currentMonth,
|
|
150
|
-
onChange: handleMonthChange
|
|
151
|
-
}
|
|
152
|
-
),
|
|
153
|
-
/* @__PURE__ */ jsx(
|
|
154
|
-
Select,
|
|
155
|
-
{
|
|
156
|
-
label: "Year",
|
|
157
|
-
hideLabel: true,
|
|
158
|
-
customTrigger: /* @__PURE__ */ jsx(
|
|
159
|
-
PillButton,
|
|
160
|
-
{
|
|
161
|
-
color: "secondary",
|
|
162
|
-
iconPosition: "right",
|
|
163
|
-
icon: ArrowDropDownIcon,
|
|
164
|
-
children: currentYear.toString()
|
|
165
|
-
}
|
|
166
|
-
),
|
|
167
|
-
items: availableYears.map(({ year, isDisabled }) => ({
|
|
168
|
-
label: year.toString(),
|
|
169
|
-
id: year,
|
|
170
|
-
isDisabled
|
|
171
|
-
})).filter(({ isDisabled }) => !isDisabled),
|
|
172
|
-
value: currentYear,
|
|
173
|
-
onChange: handleYearChange
|
|
174
|
-
}
|
|
175
|
-
)
|
|
176
|
-
] }),
|
|
177
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
|
|
178
|
-
/* @__PURE__ */ jsx(
|
|
179
|
-
InlineIconButton,
|
|
180
|
-
{
|
|
181
|
-
color: "secondary",
|
|
182
|
-
isDisabled: isNextMonthDisabled,
|
|
183
|
-
onClick: handleNextMonth,
|
|
184
|
-
icon: ChevronRightIcon,
|
|
185
|
-
label: "Next month"
|
|
186
|
-
}
|
|
187
|
-
),
|
|
188
|
-
/* @__PURE__ */ jsx(
|
|
189
|
-
InlineIconButton,
|
|
190
|
-
{
|
|
191
|
-
color: "secondary",
|
|
192
|
-
isDisabled: isNextYearDisabled,
|
|
193
|
-
onClick: handleNextYear,
|
|
194
|
-
icon: ChevronsRightIcon,
|
|
195
|
-
label: "Next year"
|
|
196
|
-
}
|
|
197
|
-
)
|
|
198
|
-
] })
|
|
199
|
-
] });
|
|
200
|
-
};
|
|
201
|
-
export {
|
|
202
|
-
CalendarSelectHeader
|
|
203
|
-
};
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { createCalendar } from "@internationalized/date";
|
|
3
|
-
import { clsx } from "clsx";
|
|
4
|
-
import { useRef, useImperativeHandle, useEffect } from "react";
|
|
5
|
-
import { useLocale, useDateField } from "react-aria";
|
|
6
|
-
import { useDateFieldState } from "react-stately";
|
|
7
|
-
import { DateSegmentItem } from "./DateSegmentItem.js";
|
|
8
|
-
const DateField = ({
|
|
9
|
-
ref,
|
|
10
|
-
onClearChange,
|
|
11
|
-
hidePlaceholder,
|
|
12
|
-
isDisabled,
|
|
13
|
-
disableManualEntry,
|
|
14
|
-
...props
|
|
15
|
-
}) => {
|
|
16
|
-
const { locale } = useLocale();
|
|
17
|
-
const state = useDateFieldState({
|
|
18
|
-
...props,
|
|
19
|
-
isDisabled,
|
|
20
|
-
isReadOnly: disableManualEntry,
|
|
21
|
-
locale,
|
|
22
|
-
createCalendar
|
|
23
|
-
});
|
|
24
|
-
const dataFieldRef = useRef(null);
|
|
25
|
-
const { fieldProps } = useDateField({ ...props, isDisabled, isReadOnly: disableManualEntry }, state, dataFieldRef);
|
|
26
|
-
const handleBlur = (e) => {
|
|
27
|
-
fieldProps.onBlur?.(e);
|
|
28
|
-
if (!state.value) {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
const currentValue = state.value;
|
|
32
|
-
const { year } = currentValue;
|
|
33
|
-
if (year >= 0 && year <= 99) {
|
|
34
|
-
const correctedYear = year <= 50 ? 2e3 + year : 1900 + year;
|
|
35
|
-
const correctedDate = currentValue.set({ year: correctedYear });
|
|
36
|
-
if (correctedDate) {
|
|
37
|
-
state.setValue(correctedDate);
|
|
38
|
-
props.onChange?.(correctedDate);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
useImperativeHandle(ref, () => ({
|
|
43
|
-
clearField: () => {
|
|
44
|
-
state.setValue(null);
|
|
45
|
-
for (const segment of state.segments) {
|
|
46
|
-
if (segment.type !== "literal") {
|
|
47
|
-
state.clearSegment(segment.type);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}));
|
|
52
|
-
useEffect(() => {
|
|
53
|
-
onClearChange?.(state.segments.some((segment) => segment.type !== "literal" && segment.isPlaceholder === false));
|
|
54
|
-
}, [state.segments, onClearChange]);
|
|
55
|
-
return /* @__PURE__ */ jsx(
|
|
56
|
-
"div",
|
|
57
|
-
{
|
|
58
|
-
...fieldProps,
|
|
59
|
-
ref: dataFieldRef,
|
|
60
|
-
onBlur: handleBlur,
|
|
61
|
-
className: clsx("relative w-full", disableManualEntry && "pointer-events-none"),
|
|
62
|
-
children: /* @__PURE__ */ jsx("div", { className: "flex", children: state.segments.map((segment, i) => /* @__PURE__ */ jsx(
|
|
63
|
-
DateSegmentItem,
|
|
64
|
-
{
|
|
65
|
-
segment,
|
|
66
|
-
state,
|
|
67
|
-
isDisabled,
|
|
68
|
-
hidePlaceholder
|
|
69
|
-
},
|
|
70
|
-
i
|
|
71
|
-
)) })
|
|
72
|
-
}
|
|
73
|
-
);
|
|
74
|
-
};
|
|
75
|
-
export {
|
|
76
|
-
DateField
|
|
77
|
-
};
|