@povio/ui 2.1.14 → 2.1.16
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 +80 -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 +197 -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 +209 -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
package/dist/Calendar.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
const CalendarIcon = (props) => /* @__PURE__ */ jsx("svg", {
|
|
3
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4
|
+
fill: "none",
|
|
5
|
+
viewBox: "0 0 24 24",
|
|
6
|
+
className: "fill-current",
|
|
7
|
+
...props,
|
|
8
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
9
|
+
fill: "currentColor",
|
|
10
|
+
fillRule: "evenodd",
|
|
11
|
+
d: "M16.5 2.91a.905.905 0 0 0-.9-.91c-.497 0-.9.407-.9.91v.908H9.3V2.91A.905.905 0 0 0 8.4 2c-.497 0-.9.407-.9.91v.908H5.7C4.209 3.818 3 5.04 3 6.545v12.728C3 20.779 4.209 22 5.7 22h12.6c1.491 0 2.7-1.221 2.7-2.727V6.545c0-1.506-1.209-2.727-2.7-2.727h-1.8zm2.7 6.363V6.545a.905.905 0 0 0-.9-.909h-1.8v.91c0 .502-.403.909-.9.909a.905.905 0 0 1-.9-.91v-.909H9.3v.91c0 .502-.403.909-.9.909a.905.905 0 0 1-.9-.91v-.909H5.7c-.497 0-.9.407-.9.91v2.727zM4.8 11.09h14.4v8.182c0 .502-.403.909-.9.909H5.7a.905.905 0 0 1-.9-.91z",
|
|
12
|
+
clipRule: "evenodd"
|
|
13
|
+
})
|
|
14
|
+
});
|
|
15
|
+
export { CalendarIcon };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { CalendarGrid } from "./CalendarGrid.js";
|
|
2
|
+
import { CalendarHeader } from "./CalendarHeader.js";
|
|
3
|
+
import { MonthPicker } from "./MonthPicker.js";
|
|
4
|
+
import { TimePickerForm } from "./TimePickerForm.js";
|
|
5
|
+
import { YearPicker } from "./YearPicker.js";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { clsx } from "clsx";
|
|
8
|
+
import { useState } from "react";
|
|
9
|
+
import { useCalendar } from "@react-aria/calendar";
|
|
10
|
+
const Calendar = ({ className, includesTime, datePickerState, hourCycle, onApply,...props }) => {
|
|
11
|
+
const [toggleState, setToggleState] = useState(null);
|
|
12
|
+
const { calendarProps, prevButtonProps, nextButtonProps } = useCalendar(props.calendarProps, props.state);
|
|
13
|
+
const handleDateChange = () => {
|
|
14
|
+
if (includesTime && !datePickerState.value) setToggleState("time");
|
|
15
|
+
else onApply();
|
|
16
|
+
};
|
|
17
|
+
const getContent = () => {
|
|
18
|
+
if (!toggleState) return /* @__PURE__ */ jsx(CalendarGrid, {
|
|
19
|
+
state: props.state,
|
|
20
|
+
onApply: handleDateChange
|
|
21
|
+
});
|
|
22
|
+
if (toggleState === "month") return /* @__PURE__ */ jsx(MonthPicker, {
|
|
23
|
+
state: props.state,
|
|
24
|
+
onSelectionChange: () => setToggleState(null)
|
|
25
|
+
});
|
|
26
|
+
if (toggleState === "year") return /* @__PURE__ */ jsx(YearPicker, {
|
|
27
|
+
state: props.state,
|
|
28
|
+
onSelectionChange: () => setToggleState(null)
|
|
29
|
+
});
|
|
30
|
+
if (toggleState === "time" && includesTime) return /* @__PURE__ */ jsx("div", {
|
|
31
|
+
className: "flex h-72 w-80 items-center justify-center",
|
|
32
|
+
children: /* @__PURE__ */ jsx(TimePickerForm, { datePickerState })
|
|
33
|
+
});
|
|
34
|
+
return null;
|
|
35
|
+
};
|
|
36
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
37
|
+
...calendarProps,
|
|
38
|
+
className: clsx("flex min-h-0 w-full flex-col items-center", className),
|
|
39
|
+
children: [/* @__PURE__ */ jsx(CalendarHeader, {
|
|
40
|
+
calendarState: props.state,
|
|
41
|
+
datePickerState,
|
|
42
|
+
prevButtonProps,
|
|
43
|
+
nextButtonProps,
|
|
44
|
+
includesTime,
|
|
45
|
+
hourCycle,
|
|
46
|
+
toggleState,
|
|
47
|
+
setToggleState
|
|
48
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
49
|
+
className: clsx("flex min-h-0 w-full flex-1 flex-col items-center", toggleState !== "year" && "pb-8 md:pb-0"),
|
|
50
|
+
children: getContent()
|
|
51
|
+
})]
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
export { Calendar };
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { Typography } from "./Typography.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { clsx } from "clsx";
|
|
4
|
+
import { useCallback, useMemo, useRef } from "react";
|
|
5
|
+
import { mergeProps } from "@react-aria/utils";
|
|
6
|
+
import { isSameDay } from "@internationalized/date";
|
|
7
|
+
import { useCalendarCell } from "@react-aria/calendar";
|
|
8
|
+
import { useFocusRing } from "@react-aria/focus";
|
|
9
|
+
var isRange = (state) => {
|
|
10
|
+
return "highlightedRange" in state;
|
|
11
|
+
};
|
|
12
|
+
const CalendarCell = ({ state, onApply, shouldCloseOnSelect = true, onDateSelection, onDateHover, rangeSelection, hoverDate, onKeyboardNavigation,...props }) => {
|
|
13
|
+
const ref = useRef(null);
|
|
14
|
+
const { cellProps, buttonProps, formattedDate, isSelected, isDisabled, isOutsideVisibleRange } = useCalendarCell(props, state, ref);
|
|
15
|
+
const { focusProps } = useFocusRing();
|
|
16
|
+
const onClick = useCallback((event) => {
|
|
17
|
+
buttonProps.onClick?.(event);
|
|
18
|
+
if (onDateSelection) onDateSelection(props.date);
|
|
19
|
+
if (isSelected && shouldCloseOnSelect) onApply?.();
|
|
20
|
+
}, [
|
|
21
|
+
buttonProps,
|
|
22
|
+
onDateSelection,
|
|
23
|
+
props.date,
|
|
24
|
+
isSelected,
|
|
25
|
+
shouldCloseOnSelect,
|
|
26
|
+
onApply
|
|
27
|
+
]);
|
|
28
|
+
const selectionState = useMemo(() => {
|
|
29
|
+
let isSelectionStart = false;
|
|
30
|
+
let isSelectionEnd = false;
|
|
31
|
+
let isSelectedCell = false;
|
|
32
|
+
let isInRange = false;
|
|
33
|
+
let isHoverRange = false;
|
|
34
|
+
let isSelectingMode = false;
|
|
35
|
+
if (rangeSelection?.start) {
|
|
36
|
+
isSelectionStart = isSameDay(props.date, rangeSelection.start);
|
|
37
|
+
isSelectionEnd = rangeSelection.end ? isSameDay(props.date, rangeSelection.end) : false;
|
|
38
|
+
isSelectedCell = isSelectionStart || isSelectionEnd;
|
|
39
|
+
isSelectingMode = rangeSelection.isSelecting && !rangeSelection.end;
|
|
40
|
+
if (rangeSelection.start && rangeSelection.end) {
|
|
41
|
+
const dateValue = props.date;
|
|
42
|
+
const isAfterStart = dateValue.compare(rangeSelection.start) > 0;
|
|
43
|
+
const isBeforeEnd = dateValue.compare(rangeSelection.end) < 0;
|
|
44
|
+
isInRange = isAfterStart && isBeforeEnd;
|
|
45
|
+
}
|
|
46
|
+
if (rangeSelection.isSelecting && rangeSelection.start && hoverDate && !rangeSelection.end) {
|
|
47
|
+
const dateValue = props.date;
|
|
48
|
+
const { start } = rangeSelection;
|
|
49
|
+
const end = hoverDate;
|
|
50
|
+
const earlierDate = start.compare(end) <= 0 ? start : end;
|
|
51
|
+
const laterDate = start.compare(end) <= 0 ? end : start;
|
|
52
|
+
const isAfterStart = dateValue.compare(earlierDate) > 0;
|
|
53
|
+
const isBeforeEnd = dateValue.compare(laterDate) < 0;
|
|
54
|
+
isHoverRange = isAfterStart && isBeforeEnd;
|
|
55
|
+
}
|
|
56
|
+
} else {
|
|
57
|
+
isSelectionStart = isRange(state) && state.highlightedRange ? isSameDay(props.date, state.highlightedRange.start) : isSelected;
|
|
58
|
+
isSelectionEnd = isRange(state) && state.highlightedRange ? isSameDay(props.date, state.highlightedRange.end) : isSelected;
|
|
59
|
+
isSelectedCell = isSelectionStart || isSelectionEnd || !isRange(state) && isSelected;
|
|
60
|
+
isInRange = isRange(state) && isSelected && !isSelectionStart && !isSelectionEnd;
|
|
61
|
+
if (isRange(state) && state.highlightedRange && !isSelected) {
|
|
62
|
+
const dateValue = props.date;
|
|
63
|
+
const isAfterStart = dateValue.compare(state.highlightedRange.start) > 0;
|
|
64
|
+
const isBeforeEnd = dateValue.compare(state.highlightedRange.end) < 0;
|
|
65
|
+
isHoverRange = isAfterStart && isBeforeEnd;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
isSelectionStart,
|
|
70
|
+
isSelectionEnd,
|
|
71
|
+
isSelectedCell,
|
|
72
|
+
isInRange,
|
|
73
|
+
isHoverRange,
|
|
74
|
+
isSelectingMode
|
|
75
|
+
};
|
|
76
|
+
}, [
|
|
77
|
+
props.date,
|
|
78
|
+
rangeSelection,
|
|
79
|
+
state,
|
|
80
|
+
isSelected,
|
|
81
|
+
hoverDate
|
|
82
|
+
]);
|
|
83
|
+
const handleEvent = (event, eventHandler) => {
|
|
84
|
+
if (isOutsideVisibleRange) {
|
|
85
|
+
state.selectDate(props.date);
|
|
86
|
+
state.setFocusedDate(props.date);
|
|
87
|
+
}
|
|
88
|
+
eventHandler?.(event);
|
|
89
|
+
if (isSelected && shouldCloseOnSelect) onApply?.();
|
|
90
|
+
};
|
|
91
|
+
const onMouseEnter = useCallback(() => {
|
|
92
|
+
if (onDateHover && selectionState.isSelectingMode) onDateHover(props.date);
|
|
93
|
+
}, [
|
|
94
|
+
onDateHover,
|
|
95
|
+
selectionState.isSelectingMode,
|
|
96
|
+
props.date
|
|
97
|
+
]);
|
|
98
|
+
const onMouseLeave = useCallback(() => {
|
|
99
|
+
if (onDateHover && selectionState.isSelectingMode) onDateHover(null);
|
|
100
|
+
}, [onDateHover, selectionState.isSelectingMode]);
|
|
101
|
+
const cellClassName = useMemo(() => {
|
|
102
|
+
const { isSelectedCell, isInRange, isHoverRange, isSelectingMode, isSelectionStart, isSelectionEnd } = selectionState;
|
|
103
|
+
return clsx("mx-auto flex h-10 w-full max-w-10 items-center justify-center rounded-button-rounding-m p-2", "focus:outline-none focus-visible:outline-1 focus-visible:outline-interactive-contained-primary-focus focus-visible:outline-offset-1", "border border-transparent border-solid", !isSelectedCell && !isOutsideVisibleRange && "bg-elevation-fill-default-1 text-interactive-text-secondary-idle", !isSelectedCell && isOutsideVisibleRange && "bg-elevation-fill-default-1 text-interactive-text-secondary-disabled", isSelectedCell && !isOutsideVisibleRange && "bg-interactive-contained-primary-idle text-interactive-contained-primary-on-idle", isSelectedCell && !isOutsideVisibleRange && rangeSelection && !rangeSelection.isSelecting && isSelectionStart && !isSelectionEnd && "rounded-r-none", isSelectedCell && !isOutsideVisibleRange && rangeSelection && !rangeSelection.isSelecting && isSelectionEnd && !isSelectionStart && "rounded-l-none", isDisabled && !isOutsideVisibleRange && "cursor-default", isDisabled && "opacity-20", !isSelectedCell && !isInRange && !isHoverRange && !isSelectingMode && !isDisabled && !isOutsideVisibleRange && "[@media(pointer:fine)]:hover:border-elevation-outline-default-1 [@media(pointer:fine)]:hover:text-interactive-text-secondary-hover", isInRange && !isOutsideVisibleRange && "!rounded-none !bg-elevation-fill-default-2 text-interactive-text-secondary-hover", isHoverRange && !isOutsideVisibleRange && "!rounded-none !bg-elevation-fill-default-2 text-interactive-text-secondary-hover", !isInRange && !isSelectedCell && isSelectingMode && "hover:bg-interactive-contained-primary-idle hover:text-interactive-text-primary-idle-inverted", isSelectingMode && !isSelectedCell && !isInRange && !isHoverRange && !isDisabled && !isOutsideVisibleRange && "transition-all duration-75 hover:border-elevation-outline-default-1");
|
|
104
|
+
}, [
|
|
105
|
+
selectionState,
|
|
106
|
+
isOutsideVisibleRange,
|
|
107
|
+
rangeSelection,
|
|
108
|
+
isDisabled
|
|
109
|
+
]);
|
|
110
|
+
return /* @__PURE__ */ jsx("td", {
|
|
111
|
+
...cellProps,
|
|
112
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
113
|
+
ref,
|
|
114
|
+
...mergeProps(buttonProps, focusProps),
|
|
115
|
+
"aria-disabled": void 0,
|
|
116
|
+
onMouseEnter,
|
|
117
|
+
onMouseLeave,
|
|
118
|
+
className: cellClassName,
|
|
119
|
+
onClick: (e) => handleEvent(e, onClick),
|
|
120
|
+
onKeyDown: (e) => handleEvent(e, () => onKeyboardNavigation?.(e, props.date)),
|
|
121
|
+
children: /* @__PURE__ */ jsx(Typography, {
|
|
122
|
+
as: "span",
|
|
123
|
+
size: "label-2",
|
|
124
|
+
className: "block w-6 overflow-hidden text-ellipsis text-center",
|
|
125
|
+
children: formattedDate
|
|
126
|
+
})
|
|
127
|
+
})
|
|
128
|
+
});
|
|
129
|
+
};
|
|
130
|
+
export { CalendarCell };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Typography } from "./Typography.js";
|
|
2
|
+
import { CalendarCell } from "./CalendarCell.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { clsx } from "clsx";
|
|
5
|
+
import { useCalendarGrid } from "@react-aria/calendar";
|
|
6
|
+
var WEEK_INDICES = [
|
|
7
|
+
0,
|
|
8
|
+
1,
|
|
9
|
+
2,
|
|
10
|
+
3,
|
|
11
|
+
4,
|
|
12
|
+
5
|
|
13
|
+
];
|
|
14
|
+
const CalendarGrid = ({ state, onApply, shouldCloseOnSelect, offset = {}, onDateSelection, onDateHover, rangeSelection, hoverDate, onKeyboardNavigation, className, calendarSide,...props }) => {
|
|
15
|
+
const { gridProps, headerProps, weekDays } = useCalendarGrid({
|
|
16
|
+
...props,
|
|
17
|
+
weekdayStyle: "short"
|
|
18
|
+
}, state);
|
|
19
|
+
const startDate = state.visibleRange.start.add(offset);
|
|
20
|
+
const handleDateSelection = (date) => {
|
|
21
|
+
onDateSelection?.(date, calendarSide);
|
|
22
|
+
};
|
|
23
|
+
return /* @__PURE__ */ jsx("div", {
|
|
24
|
+
className: clsx("h-72 w-full px-3 py-1 md:w-80", className),
|
|
25
|
+
children: /* @__PURE__ */ jsxs("table", {
|
|
26
|
+
...gridProps,
|
|
27
|
+
cellPadding: "0",
|
|
28
|
+
className: "w-full",
|
|
29
|
+
children: [/* @__PURE__ */ jsx("thead", {
|
|
30
|
+
...headerProps,
|
|
31
|
+
children: /* @__PURE__ */ jsx("tr", { children: weekDays.map((day) => /* @__PURE__ */ jsx("th", { children: /* @__PURE__ */ jsx(Typography, {
|
|
32
|
+
size: "label-2",
|
|
33
|
+
className: "bg-elevation-fill-default-1 py-2 text-interactive-text-secondary-idle",
|
|
34
|
+
children: day.substring(0, 2)
|
|
35
|
+
}) }, day)) })
|
|
36
|
+
}), /* @__PURE__ */ jsx("tbody", { children: WEEK_INDICES.map((weekIndex) => /* @__PURE__ */ jsx("tr", { children: state.getDatesInWeek(weekIndex, startDate).map((date, i) => date ? /* @__PURE__ */ jsx(CalendarCell, {
|
|
37
|
+
state,
|
|
38
|
+
date,
|
|
39
|
+
onApply,
|
|
40
|
+
shouldCloseOnSelect,
|
|
41
|
+
onDateSelection: handleDateSelection,
|
|
42
|
+
onDateHover,
|
|
43
|
+
rangeSelection,
|
|
44
|
+
hoverDate,
|
|
45
|
+
onKeyboardNavigation
|
|
46
|
+
}, i) : /* @__PURE__ */ jsx("td", {}, i)) }, weekIndex)) })]
|
|
47
|
+
})
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
export { CalendarGrid };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { ChevronLeftIcon } from "./ChevronLeft.js";
|
|
2
|
+
import { ChevronRightIcon } from "./ChevronRight.js";
|
|
3
|
+
import { PillButton } from "./PillButton.js";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { Button, ToggleButtonGroup } from "react-aria-components";
|
|
6
|
+
import { Time } from "@internationalized/date";
|
|
7
|
+
import { useDateFormatter } from "@react-aria/i18n";
|
|
8
|
+
var HourCycle = {
|
|
9
|
+
12: "h12",
|
|
10
|
+
24: "h23"
|
|
11
|
+
};
|
|
12
|
+
const CalendarHeader = ({ calendarState, datePickerState, prevButtonProps, nextButtonProps, includesTime, hourCycle, toggleState, setToggleState }) => {
|
|
13
|
+
const formatter = useDateFormatter({
|
|
14
|
+
month: "long",
|
|
15
|
+
timeZone: calendarState.timeZone
|
|
16
|
+
});
|
|
17
|
+
const timeFormatter = useDateFormatter({
|
|
18
|
+
timeStyle: "short",
|
|
19
|
+
timeZone: calendarState.timeZone,
|
|
20
|
+
hourCycle: hourCycle ? HourCycle[hourCycle] : void 0
|
|
21
|
+
});
|
|
22
|
+
const year = calendarState.focusedDate.year.toString();
|
|
23
|
+
const month = formatter.format(calendarState.focusedDate.toDate(calendarState.timeZone));
|
|
24
|
+
const timeValue = datePickerState?.timeValue || new Time();
|
|
25
|
+
const date = /* @__PURE__ */ new Date();
|
|
26
|
+
date.setHours(timeValue.hour, timeValue.minute);
|
|
27
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
28
|
+
className: "inline-flex w-full items-center justify-between border-elevation-outline-default-1 border-b border-solid px-1",
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ jsx("div", {
|
|
31
|
+
className: "inline-flex h-12 items-center p-3",
|
|
32
|
+
children: !toggleState && /* @__PURE__ */ jsx(Button, {
|
|
33
|
+
...prevButtonProps,
|
|
34
|
+
className: "shrink-0 focus-visible:outline-interactive-contained-secondary-focus",
|
|
35
|
+
children: /* @__PURE__ */ jsx(ChevronLeftIcon, { className: "size-6 text-interactive-text-secondary-idle" })
|
|
36
|
+
})
|
|
37
|
+
}),
|
|
38
|
+
/* @__PURE__ */ jsxs(ToggleButtonGroup, {
|
|
39
|
+
className: "flex gap-2",
|
|
40
|
+
children: [
|
|
41
|
+
/* @__PURE__ */ jsx(PillButton, {
|
|
42
|
+
color: "secondary",
|
|
43
|
+
toggle: true,
|
|
44
|
+
isSelected: toggleState === "month",
|
|
45
|
+
onChange: (isSelected) => setToggleState(isSelected ? "month" : null),
|
|
46
|
+
children: month
|
|
47
|
+
}),
|
|
48
|
+
/* @__PURE__ */ jsx(PillButton, {
|
|
49
|
+
color: "secondary",
|
|
50
|
+
toggle: true,
|
|
51
|
+
isSelected: toggleState === "year",
|
|
52
|
+
onChange: (isSelected) => setToggleState(isSelected ? "year" : null),
|
|
53
|
+
children: year
|
|
54
|
+
}),
|
|
55
|
+
includesTime && /* @__PURE__ */ jsx(PillButton, {
|
|
56
|
+
color: "secondary",
|
|
57
|
+
toggle: true,
|
|
58
|
+
isSelected: toggleState === "time",
|
|
59
|
+
onChange: (isSelected) => setToggleState(isSelected ? "time" : null),
|
|
60
|
+
children: timeFormatter.format(date)
|
|
61
|
+
})
|
|
62
|
+
]
|
|
63
|
+
}),
|
|
64
|
+
/* @__PURE__ */ jsx("div", {
|
|
65
|
+
className: "inline-flex h-12 items-center p-3",
|
|
66
|
+
children: !toggleState && /* @__PURE__ */ jsx(Button, {
|
|
67
|
+
...nextButtonProps,
|
|
68
|
+
className: "shrink-0 focus-visible:outline-interactive-contained-secondary-focus",
|
|
69
|
+
children: /* @__PURE__ */ jsx(ChevronRightIcon, { className: "size-6 text-interactive-text-secondary-idle" })
|
|
70
|
+
})
|
|
71
|
+
})
|
|
72
|
+
]
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
export { CalendarHeader };
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { ArrowDropDownIcon } from "./ArrowDropDown.js";
|
|
2
|
+
import { ChevronLeftIcon } from "./ChevronLeft.js";
|
|
3
|
+
import { ChevronRightIcon } from "./ChevronRight.js";
|
|
4
|
+
import { ChevronsLeftIcon } from "./ChevronsLeft.js";
|
|
5
|
+
import { ChevronsRightIcon } from "./ChevronsRight.js";
|
|
6
|
+
import { InlineIconButton } from "./InlineIconButton.js";
|
|
7
|
+
import { PillButton } from "./PillButton.js";
|
|
8
|
+
import { Select } from "./Select.js";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { useMemo } from "react";
|
|
11
|
+
import { useDateFormatter } from "@react-aria/i18n";
|
|
12
|
+
const CalendarSelectHeader = ({ state, isPrevMonthDisabled, isPrevYearDisabled, isNextMonthDisabled, isNextYearDisabled, offset = { months: 0 }, onNavigate, maxDate, minDate }) => {
|
|
13
|
+
const displayDate = state.visibleRange.start.add(offset);
|
|
14
|
+
const currentMonth = displayDate.month - 1;
|
|
15
|
+
const currentYear = displayDate.year;
|
|
16
|
+
const formatter = useDateFormatter({
|
|
17
|
+
month: "long",
|
|
18
|
+
timeZone: state.timeZone
|
|
19
|
+
});
|
|
20
|
+
const numMonths = state.focusedDate.calendar.getMonthsInYear(state.focusedDate);
|
|
21
|
+
const MONTHS = useMemo(() => {
|
|
22
|
+
const months = [];
|
|
23
|
+
for (let i = 1; i <= numMonths; i++) {
|
|
24
|
+
const date = state.focusedDate.set({ month: i });
|
|
25
|
+
months.push(formatter.format(date.toDate(state.timeZone)));
|
|
26
|
+
}
|
|
27
|
+
return months;
|
|
28
|
+
}, [
|
|
29
|
+
formatter,
|
|
30
|
+
numMonths,
|
|
31
|
+
state.focusedDate,
|
|
32
|
+
state.timeZone
|
|
33
|
+
]);
|
|
34
|
+
const years = Array.from({ length: 201 }, (_, i) => currentYear - 100 + i);
|
|
35
|
+
const getAvailableMonths = () => {
|
|
36
|
+
return MONTHS.map((month, i) => {
|
|
37
|
+
const monthDate = displayDate.set({ month: i + 1 });
|
|
38
|
+
let isDisabled = false;
|
|
39
|
+
if (maxDate) isDisabled = monthDate.year > maxDate.year || monthDate.year === maxDate.year && monthDate.month >= maxDate.month;
|
|
40
|
+
if (minDate) isDisabled = monthDate.year < minDate.year || monthDate.year === minDate.year && monthDate.month <= minDate.month;
|
|
41
|
+
return {
|
|
42
|
+
month,
|
|
43
|
+
value: i,
|
|
44
|
+
isDisabled
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
const getAvailableYears = () => {
|
|
49
|
+
return years.map((year) => {
|
|
50
|
+
let isDisabled = false;
|
|
51
|
+
if (maxDate) isDisabled = year > maxDate.year || year === maxDate.year && displayDate.month >= maxDate.month;
|
|
52
|
+
if (minDate && !isDisabled) isDisabled = year < minDate.year || year === minDate.year && displayDate.month <= minDate.month;
|
|
53
|
+
return {
|
|
54
|
+
year,
|
|
55
|
+
isDisabled
|
|
56
|
+
};
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
const availableMonths = getAvailableMonths();
|
|
60
|
+
const availableYears = getAvailableYears();
|
|
61
|
+
const handleMonthChange = (value) => {
|
|
62
|
+
if (value === null) return;
|
|
63
|
+
const newDate = displayDate.set({ month: value + 1 });
|
|
64
|
+
onNavigate?.(newDate);
|
|
65
|
+
};
|
|
66
|
+
const handleYearChange = (value) => {
|
|
67
|
+
if (value === null) return;
|
|
68
|
+
const newDate = displayDate.set({ year: value });
|
|
69
|
+
onNavigate?.(newDate);
|
|
70
|
+
};
|
|
71
|
+
const handlePrevMonth = (e) => {
|
|
72
|
+
e.preventDefault();
|
|
73
|
+
e.stopPropagation();
|
|
74
|
+
const newDate = displayDate.subtract({ months: 1 });
|
|
75
|
+
onNavigate?.(newDate);
|
|
76
|
+
};
|
|
77
|
+
const handleNextMonth = (e) => {
|
|
78
|
+
e.preventDefault();
|
|
79
|
+
e.stopPropagation();
|
|
80
|
+
const newDate = displayDate.add({ months: 1 });
|
|
81
|
+
onNavigate?.(newDate);
|
|
82
|
+
};
|
|
83
|
+
const handlePrevYear = (e) => {
|
|
84
|
+
e.preventDefault();
|
|
85
|
+
e.stopPropagation();
|
|
86
|
+
const newDate = displayDate.subtract({ years: 1 });
|
|
87
|
+
onNavigate?.(newDate);
|
|
88
|
+
};
|
|
89
|
+
const handleNextYear = (e) => {
|
|
90
|
+
e.preventDefault();
|
|
91
|
+
e.stopPropagation();
|
|
92
|
+
const newDate = displayDate.add({ years: 1 });
|
|
93
|
+
onNavigate?.(newDate);
|
|
94
|
+
};
|
|
95
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
96
|
+
className: "flex w-full items-center justify-between gap-3 border-elevation-outline-default-1 border-b border-solid px-3 py-2-5",
|
|
97
|
+
children: [
|
|
98
|
+
/* @__PURE__ */ jsxs("div", {
|
|
99
|
+
className: "flex items-center",
|
|
100
|
+
children: [/* @__PURE__ */ jsx(InlineIconButton, {
|
|
101
|
+
color: "secondary",
|
|
102
|
+
isDisabled: isPrevYearDisabled,
|
|
103
|
+
onClick: handlePrevYear,
|
|
104
|
+
icon: ChevronsLeftIcon,
|
|
105
|
+
label: "Previous year"
|
|
106
|
+
}), /* @__PURE__ */ jsx(InlineIconButton, {
|
|
107
|
+
color: "secondary",
|
|
108
|
+
isDisabled: isPrevMonthDisabled,
|
|
109
|
+
onClick: handlePrevMonth,
|
|
110
|
+
icon: ChevronLeftIcon,
|
|
111
|
+
label: "Previous month"
|
|
112
|
+
})]
|
|
113
|
+
}),
|
|
114
|
+
/* @__PURE__ */ jsxs("div", {
|
|
115
|
+
className: "flex gap-2",
|
|
116
|
+
children: [/* @__PURE__ */ jsx(Select, {
|
|
117
|
+
label: "Month",
|
|
118
|
+
hideLabel: true,
|
|
119
|
+
customTrigger: /* @__PURE__ */ jsx(PillButton, {
|
|
120
|
+
color: "secondary",
|
|
121
|
+
iconPosition: "right",
|
|
122
|
+
icon: ArrowDropDownIcon,
|
|
123
|
+
children: MONTHS[currentMonth].slice(0, 3)
|
|
124
|
+
}),
|
|
125
|
+
ignoreTriggerWidth: true,
|
|
126
|
+
items: availableMonths.map(({ month, value, isDisabled }) => ({
|
|
127
|
+
label: month,
|
|
128
|
+
id: value,
|
|
129
|
+
isDisabled
|
|
130
|
+
})).filter(({ isDisabled }) => !isDisabled),
|
|
131
|
+
value: currentMonth,
|
|
132
|
+
onChange: handleMonthChange
|
|
133
|
+
}), /* @__PURE__ */ jsx(Select, {
|
|
134
|
+
label: "Year",
|
|
135
|
+
hideLabel: true,
|
|
136
|
+
customTrigger: /* @__PURE__ */ jsx(PillButton, {
|
|
137
|
+
color: "secondary",
|
|
138
|
+
iconPosition: "right",
|
|
139
|
+
icon: ArrowDropDownIcon,
|
|
140
|
+
children: currentYear.toString()
|
|
141
|
+
}),
|
|
142
|
+
items: availableYears.map(({ year, isDisabled }) => ({
|
|
143
|
+
label: year.toString(),
|
|
144
|
+
id: year,
|
|
145
|
+
isDisabled
|
|
146
|
+
})).filter(({ isDisabled }) => !isDisabled),
|
|
147
|
+
value: currentYear,
|
|
148
|
+
onChange: handleYearChange
|
|
149
|
+
})]
|
|
150
|
+
}),
|
|
151
|
+
/* @__PURE__ */ jsxs("div", {
|
|
152
|
+
className: "flex items-center",
|
|
153
|
+
children: [/* @__PURE__ */ jsx(InlineIconButton, {
|
|
154
|
+
color: "secondary",
|
|
155
|
+
isDisabled: isNextMonthDisabled,
|
|
156
|
+
onClick: handleNextMonth,
|
|
157
|
+
icon: ChevronRightIcon,
|
|
158
|
+
label: "Next month"
|
|
159
|
+
}), /* @__PURE__ */ jsx(InlineIconButton, {
|
|
160
|
+
color: "secondary",
|
|
161
|
+
isDisabled: isNextYearDisabled,
|
|
162
|
+
onClick: handleNextYear,
|
|
163
|
+
icon: ChevronsRightIcon,
|
|
164
|
+
label: "Next year"
|
|
165
|
+
})]
|
|
166
|
+
})
|
|
167
|
+
]
|
|
168
|
+
});
|
|
169
|
+
};
|
|
170
|
+
export { CalendarSelectHeader };
|
package/dist/Can.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AbilityContext } from "./ability.context.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { createContextualCan } from "@casl/react";
|
|
4
|
+
var ContextualCan = createContextualCan(AbilityContext.Consumer);
|
|
5
|
+
const Can = ({ use,...props }) => {
|
|
6
|
+
const [action, subject] = use;
|
|
7
|
+
return /* @__PURE__ */ jsx(ContextualCan, {
|
|
8
|
+
...props,
|
|
9
|
+
do: action,
|
|
10
|
+
on: subject
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
export { Can };
|
package/dist/CellText.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Typography } from "./Typography.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { clsx } from "clsx";
|
|
4
|
+
const CellText = ({ children, style, className }) => /* @__PURE__ */ jsx(Typography, {
|
|
5
|
+
variant: "default",
|
|
6
|
+
size: "label-1",
|
|
7
|
+
as: "span",
|
|
8
|
+
className: clsx("block overflow-hidden text-ellipsis text-text-default-2", className),
|
|
9
|
+
style,
|
|
10
|
+
"data-rac": true,
|
|
11
|
+
children
|
|
12
|
+
});
|
|
13
|
+
export { CellText };
|
package/dist/Check.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
const CheckIcon = (props) => /* @__PURE__ */ jsx("svg", {
|
|
3
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4
|
+
fill: "none",
|
|
5
|
+
viewBox: "0 0 24 24",
|
|
6
|
+
className: "fill-current",
|
|
7
|
+
...props,
|
|
8
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
9
|
+
fill: "currentColor",
|
|
10
|
+
fillRule: "evenodd",
|
|
11
|
+
d: "M20.707 5.293a1 1 0 0 1 0 1.414l-11 11a1 1 0 0 1-1.414 0l-5-5a1 1 0 1 1 1.414-1.414L9 15.586 19.293 5.293a1 1 0 0 1 1.414 0",
|
|
12
|
+
clipRule: "evenodd"
|
|
13
|
+
})
|
|
14
|
+
});
|
|
15
|
+
export { CheckIcon };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
const CheckCircleIcon = (props) => /* @__PURE__ */ jsx("svg", {
|
|
3
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4
|
+
fill: "none",
|
|
5
|
+
viewBox: "0 0 24 24",
|
|
6
|
+
className: "fill-current",
|
|
7
|
+
...props,
|
|
8
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
9
|
+
fill: "currentColor",
|
|
10
|
+
d: "m10.58 14.146-2.322-2.323a.73.73 0 0 0-.522-.213.7.7 0 0 0-.532.213.72.72 0 0 0-.217.527q0 .31.217.527l2.744 2.744q.27.27.633.271.36 0 .633-.27l5.563-5.564a.73.73 0 0 0 .212-.522.7.7 0 0 0-.212-.532.72.72 0 0 0-.527-.217.72.72 0 0 0-.527.217zm1.422 7.354a9.3 9.3 0 0 1-3.706-.748 9.6 9.6 0 0 1-3.016-2.03 9.6 9.6 0 0 1-2.032-3.016 9.25 9.25 0 0 1-.748-3.704q0-1.972.748-3.706a9.6 9.6 0 0 1 2.03-3.016 9.6 9.6 0 0 1 3.016-2.032 9.25 9.25 0 0 1 3.704-.748q1.972 0 3.706.748a9.6 9.6 0 0 1 3.017 2.03 9.6 9.6 0 0 1 2.03 3.016 9.25 9.25 0 0 1 .749 3.704q0 1.972-.748 3.706a9.6 9.6 0 0 1-2.03 3.017 9.6 9.6 0 0 1-3.016 2.03 9.25 9.25 0 0 1-3.704.749"
|
|
11
|
+
})
|
|
12
|
+
});
|
|
13
|
+
export { CheckCircleIcon };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { typography } from "./typography.cva.js";
|
|
2
|
+
import { UIStyle } from "./uiStyle.context.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import clsx$1 from "clsx";
|
|
5
|
+
const CheckContent = ({ children, className,...props }) => {
|
|
6
|
+
return /* @__PURE__ */ jsx("div", {
|
|
7
|
+
className: clsx$1((UIStyle.useConfig()?.typography?.cva ?? typography)({
|
|
8
|
+
size: "label-1",
|
|
9
|
+
variant: "default",
|
|
10
|
+
...props.typography,
|
|
11
|
+
className: "text-text-default-2"
|
|
12
|
+
}), className),
|
|
13
|
+
children
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
export { CheckContent };
|
package/dist/Checkbox.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { UIStyle } from "./uiStyle.context.js";
|
|
2
|
+
import { checkboxIndicatorClass, checkboxTypography } from "./checkbox.cva.js";
|
|
3
|
+
import { FormFieldError } from "./FormFieldError.js";
|
|
4
|
+
import { CheckContent } from "./CheckContent.js";
|
|
5
|
+
import { UIConfig } from "./uiConfig.context.js";
|
|
6
|
+
import { CheckboxCheckmark } from "./CheckboxCheckmark2.js";
|
|
7
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { clsx } from "clsx";
|
|
9
|
+
import { Checkbox } from "react-aria-components";
|
|
10
|
+
import { mergeRefs } from "@react-aria/utils";
|
|
11
|
+
import { Controller } from "react-hook-form";
|
|
12
|
+
var CheckboxBase = (props) => {
|
|
13
|
+
const ui = UIConfig.useConfig();
|
|
14
|
+
const checkboxTypographyMap = UIStyle.useConfig()?.checkbox?.typography ?? checkboxTypography;
|
|
15
|
+
const { className, children, isDisabled, error, variant = ui.checkbox.variant, hideLabel = ui.input.hideLabel,...rest } = props;
|
|
16
|
+
const formFieldErrorProps = {
|
|
17
|
+
error,
|
|
18
|
+
isDisabled
|
|
19
|
+
};
|
|
20
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(Checkbox, {
|
|
21
|
+
...rest,
|
|
22
|
+
isDisabled,
|
|
23
|
+
isInvalid: !!error,
|
|
24
|
+
"aria-errormessage": error || void 0,
|
|
25
|
+
"data-is-dirty": props.isDirty || void 0,
|
|
26
|
+
"data-is-required": props.isRequired || void 0,
|
|
27
|
+
className: clsx(checkboxIndicatorClass, className),
|
|
28
|
+
children: [/* @__PURE__ */ jsx(CheckboxCheckmark, {
|
|
29
|
+
variant,
|
|
30
|
+
...rest
|
|
31
|
+
}), !hideLabel && /* @__PURE__ */ jsx(CheckContent, {
|
|
32
|
+
typography: checkboxTypographyMap({
|
|
33
|
+
variant,
|
|
34
|
+
...rest
|
|
35
|
+
}),
|
|
36
|
+
children
|
|
37
|
+
})]
|
|
38
|
+
}), /* @__PURE__ */ jsx(FormFieldError, { ...formFieldErrorProps })] });
|
|
39
|
+
};
|
|
40
|
+
const Checkbox$1 = (props) => {
|
|
41
|
+
if ("formControl" in props && props.formControl) {
|
|
42
|
+
const { formControl, ref,...innerProps } = props;
|
|
43
|
+
return /* @__PURE__ */ jsx(Controller, {
|
|
44
|
+
control: formControl.control,
|
|
45
|
+
name: formControl.name,
|
|
46
|
+
render: ({ field, fieldState: { error, isDirty } }) => /* @__PURE__ */ jsx(CheckboxBase, {
|
|
47
|
+
...innerProps,
|
|
48
|
+
ref: mergeRefs(ref, field.ref),
|
|
49
|
+
isSelected: field.value,
|
|
50
|
+
onChange: field.onChange,
|
|
51
|
+
onBlur: field.onBlur,
|
|
52
|
+
name: field.name,
|
|
53
|
+
isDirty,
|
|
54
|
+
isDisabled: field.disabled || props.isDisabled,
|
|
55
|
+
error: props.error ?? error?.message
|
|
56
|
+
})
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
return /* @__PURE__ */ jsx(CheckboxBase, { ...props });
|
|
60
|
+
};
|
|
61
|
+
export { Checkbox$1 as Checkbox };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
const CheckboxCheckmarkIcon = (props) => /* @__PURE__ */ jsx("svg", {
|
|
3
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4
|
+
fill: "none",
|
|
5
|
+
viewBox: "0 0 12 9",
|
|
6
|
+
className: "fill-current",
|
|
7
|
+
...props,
|
|
8
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
9
|
+
stroke: "currentColor",
|
|
10
|
+
strokeLinecap: "round",
|
|
11
|
+
strokeLinejoin: "round",
|
|
12
|
+
strokeWidth: 2,
|
|
13
|
+
d: "M11 1 4.125 8 1 4.818"
|
|
14
|
+
})
|
|
15
|
+
});
|
|
16
|
+
export { CheckboxCheckmarkIcon };
|