@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
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { UIStyle } from "./uiStyle.context.js";
|
|
2
|
+
import { CheckContent } from "./CheckContent.js";
|
|
3
|
+
import { UIConfig } from "./uiConfig.context.js";
|
|
4
|
+
import { FormField } from "./FormField.js";
|
|
5
|
+
import { radio, radioIndicatorClass, radioTypography } from "./radio.cva.js";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import clsx$1 from "clsx";
|
|
8
|
+
import { Radio, RadioGroup } from "react-aria-components";
|
|
9
|
+
import { mergeRefs } from "@react-aria/utils";
|
|
10
|
+
import { Controller } from "react-hook-form";
|
|
11
|
+
var RadioGroupBase = (props) => {
|
|
12
|
+
const ui = UIConfig.useConfig();
|
|
13
|
+
const uiStyle = UIStyle.useConfig();
|
|
14
|
+
const radioCva = uiStyle?.radio?.cva ?? radio;
|
|
15
|
+
const radioTypographyMap = uiStyle?.radio?.typography ?? radioTypography;
|
|
16
|
+
const { label, tooltipText, helperText, isDirty, isRequired, rightContent, isDisabled, headerClassName, errorClassName, labelClassName, inputClassName, isHeaderHidden, error, className, options, variant = ui.radioGroup.variant, hideLabel = ui.radioGroup.hideLabel,...rest } = props;
|
|
17
|
+
const formFieldProps = {
|
|
18
|
+
className,
|
|
19
|
+
error,
|
|
20
|
+
label,
|
|
21
|
+
tooltipText,
|
|
22
|
+
helperText,
|
|
23
|
+
isRequired,
|
|
24
|
+
rightContent,
|
|
25
|
+
isHeaderHidden,
|
|
26
|
+
hideLabel,
|
|
27
|
+
isDisabled,
|
|
28
|
+
headerClassName,
|
|
29
|
+
errorClassName
|
|
30
|
+
};
|
|
31
|
+
return /* @__PURE__ */ jsx(RadioGroup, {
|
|
32
|
+
...rest,
|
|
33
|
+
isDisabled,
|
|
34
|
+
isInvalid: !!error,
|
|
35
|
+
"data-is-dirty": isDirty || void 0,
|
|
36
|
+
"data-is-required": isRequired || void 0,
|
|
37
|
+
children: /* @__PURE__ */ jsx(FormField, {
|
|
38
|
+
...formFieldProps,
|
|
39
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
40
|
+
className: clsx$1("flex flex-col", inputClassName),
|
|
41
|
+
children: options.map((option) => /* @__PURE__ */ jsxs(Radio, {
|
|
42
|
+
value: option.value,
|
|
43
|
+
className: radioIndicatorClass,
|
|
44
|
+
children: [/* @__PURE__ */ jsx("div", { className: radioCva({
|
|
45
|
+
variant,
|
|
46
|
+
...rest
|
|
47
|
+
}) }), /* @__PURE__ */ jsx(CheckContent, {
|
|
48
|
+
typography: radioTypographyMap({
|
|
49
|
+
variant,
|
|
50
|
+
...rest
|
|
51
|
+
}),
|
|
52
|
+
className: labelClassName,
|
|
53
|
+
children: option.label
|
|
54
|
+
})]
|
|
55
|
+
}, option.value))
|
|
56
|
+
})
|
|
57
|
+
})
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
const RadioGroup$1 = (props) => {
|
|
61
|
+
if ("formControl" in props && props.formControl) {
|
|
62
|
+
const { formControl, ref,...innerProps } = props;
|
|
63
|
+
return /* @__PURE__ */ jsx(Controller, {
|
|
64
|
+
control: formControl.control,
|
|
65
|
+
name: formControl.name,
|
|
66
|
+
render: ({ field, fieldState: { error, isDirty } }) => /* @__PURE__ */ jsx(RadioGroupBase, {
|
|
67
|
+
...innerProps,
|
|
68
|
+
ref: mergeRefs(ref, field.ref),
|
|
69
|
+
value: field.value,
|
|
70
|
+
onChange: field.onChange,
|
|
71
|
+
onBlur: field.onBlur,
|
|
72
|
+
name: field.name,
|
|
73
|
+
isDirty,
|
|
74
|
+
isDisabled: field.disabled || props.isDisabled,
|
|
75
|
+
error: props.error ?? error?.message
|
|
76
|
+
})
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
return /* @__PURE__ */ jsx(RadioGroupBase, { ...props });
|
|
80
|
+
};
|
|
81
|
+
export { RadioGroup$1 as RadioGroup };
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { CalendarGrid } from "./CalendarGrid.js";
|
|
2
|
+
import { CalendarSelectHeader } from "./CalendarSelectHeader.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { clsx } from "clsx";
|
|
5
|
+
import { useMemo, useRef } from "react";
|
|
6
|
+
import { useRangeCalendar } from "@react-aria/calendar";
|
|
7
|
+
const RangeCalendar = ({ className, leftCalendarState, rightCalendarState, calendarProps, onApply, onRangeChange: _onRangeChange, onDateSelection, onDateHover, rangeSelection, hoverDate, onKeyboardNavigation }) => {
|
|
8
|
+
const leftRef = useRef(null);
|
|
9
|
+
const rightRef = useRef(null);
|
|
10
|
+
const { calendarProps: leftCalendarAriaProps } = useRangeCalendar(calendarProps, leftCalendarState, leftRef);
|
|
11
|
+
const { calendarProps: rightCalendarAriaProps } = useRangeCalendar(calendarProps, rightCalendarState, rightRef);
|
|
12
|
+
const leftDate = leftCalendarState.visibleRange.start;
|
|
13
|
+
const rightDate = rightCalendarState.visibleRange.start;
|
|
14
|
+
const handleLeftKeyboardNavigation = (event, date) => {
|
|
15
|
+
return onKeyboardNavigation?.(event, date, "left") ?? false;
|
|
16
|
+
};
|
|
17
|
+
const handleRightKeyboardNavigation = (event, date) => {
|
|
18
|
+
return onKeyboardNavigation?.(event, date, "right") ?? false;
|
|
19
|
+
};
|
|
20
|
+
const handleLeftNavigate = (newDate) => {
|
|
21
|
+
const rightCurrentDate = rightCalendarState.visibleRange.start;
|
|
22
|
+
if (newDate.year < rightCurrentDate.year || newDate.year === rightCurrentDate.year && newDate.month < rightCurrentDate.month) leftCalendarState.setFocusedDate(newDate);
|
|
23
|
+
else {
|
|
24
|
+
const closestValidDate = rightCurrentDate.subtract({ months: 1 });
|
|
25
|
+
leftCalendarState.setFocusedDate(closestValidDate);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
const handleRightNavigate = (newDate) => {
|
|
29
|
+
const leftCurrentDate = leftCalendarState.visibleRange.start;
|
|
30
|
+
if (newDate.year > leftCurrentDate.year || newDate.year === leftCurrentDate.year && newDate.month > leftCurrentDate.month) rightCalendarState.setFocusedDate(newDate);
|
|
31
|
+
else {
|
|
32
|
+
const closestValidDate = leftCurrentDate.add({ months: 1 });
|
|
33
|
+
rightCalendarState.setFocusedDate(closestValidDate);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
const isNextDisabled = useMemo(() => {
|
|
37
|
+
const leftNextDate = leftDate.add({ months: 1 });
|
|
38
|
+
return leftNextDate.year > rightDate.year || leftNextDate.year === rightDate.year && leftNextDate.month === rightDate.month;
|
|
39
|
+
}, [leftDate, rightDate]);
|
|
40
|
+
const isPrevDisabled = useMemo(() => {
|
|
41
|
+
const rightPrevDate = rightDate.subtract({ months: 1 });
|
|
42
|
+
return rightPrevDate.year < leftDate.year || rightPrevDate.year === leftDate.year && rightPrevDate.month === leftDate.month;
|
|
43
|
+
}, [leftDate, rightDate]);
|
|
44
|
+
return /* @__PURE__ */ jsx("div", {
|
|
45
|
+
className: clsx("flex w-fit flex-col items-center bg-elevation-fill-default-1", className),
|
|
46
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
47
|
+
className: "flex",
|
|
48
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
49
|
+
...leftCalendarAriaProps,
|
|
50
|
+
ref: leftRef,
|
|
51
|
+
className: "flex flex-col items-center",
|
|
52
|
+
children: [/* @__PURE__ */ jsx(CalendarSelectHeader, {
|
|
53
|
+
state: leftCalendarState,
|
|
54
|
+
isNextMonthDisabled: isNextDisabled,
|
|
55
|
+
isNextYearDisabled: isNextDisabled,
|
|
56
|
+
onNavigate: handleLeftNavigate,
|
|
57
|
+
maxDate: rightDate
|
|
58
|
+
}), /* @__PURE__ */ jsx(CalendarGrid, {
|
|
59
|
+
state: leftCalendarState,
|
|
60
|
+
onApply,
|
|
61
|
+
shouldCloseOnSelect: false,
|
|
62
|
+
onDateSelection,
|
|
63
|
+
rangeSelection,
|
|
64
|
+
onDateHover,
|
|
65
|
+
hoverDate,
|
|
66
|
+
onKeyboardNavigation: handleLeftKeyboardNavigation,
|
|
67
|
+
className: "h-64 w-[304px]!",
|
|
68
|
+
calendarSide: "left"
|
|
69
|
+
})]
|
|
70
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
71
|
+
...rightCalendarAriaProps,
|
|
72
|
+
ref: rightRef,
|
|
73
|
+
className: "hidden flex-col items-center md:flex",
|
|
74
|
+
children: [/* @__PURE__ */ jsx(CalendarSelectHeader, {
|
|
75
|
+
state: rightCalendarState,
|
|
76
|
+
isPrevMonthDisabled: isPrevDisabled,
|
|
77
|
+
isPrevYearDisabled: isPrevDisabled,
|
|
78
|
+
onNavigate: handleRightNavigate,
|
|
79
|
+
minDate: leftDate
|
|
80
|
+
}), /* @__PURE__ */ jsx(CalendarGrid, {
|
|
81
|
+
state: rightCalendarState,
|
|
82
|
+
onApply,
|
|
83
|
+
shouldCloseOnSelect: false,
|
|
84
|
+
onDateSelection,
|
|
85
|
+
rangeSelection,
|
|
86
|
+
onDateHover,
|
|
87
|
+
hoverDate,
|
|
88
|
+
onKeyboardNavigation: handleRightKeyboardNavigation,
|
|
89
|
+
className: "h-64 w-[304px]!",
|
|
90
|
+
calendarSide: "right"
|
|
91
|
+
})]
|
|
92
|
+
})]
|
|
93
|
+
})
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
export { RangeCalendar };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { BottomSheet } from "./BottomSheet.js";
|
|
2
|
+
import { useBreakpoint } from "./useBreakpoint.js";
|
|
3
|
+
import { FormFieldHeader } from "./FormFieldHeader.js";
|
|
4
|
+
import { FormFieldHeaderClose } from "./FormFieldHeaderClose.js";
|
|
5
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { clsx } from "clsx";
|
|
7
|
+
import { Dialog, DialogTrigger, Popover } from "react-aria-components";
|
|
8
|
+
const ResponsivePopover = ({ trigger, isOpen, onOpenChange, children, popoverClassName, sheetLabel }) => {
|
|
9
|
+
if (!useBreakpoint("md")) return /* @__PURE__ */ jsx(BottomSheet, {
|
|
10
|
+
isOpen,
|
|
11
|
+
onOpenChange,
|
|
12
|
+
trigger,
|
|
13
|
+
height: "auto",
|
|
14
|
+
isDismissable: true,
|
|
15
|
+
children: (close) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(FormFieldHeader, {
|
|
16
|
+
label: sheetLabel,
|
|
17
|
+
rightContent: /* @__PURE__ */ jsx(FormFieldHeaderClose, { onClose: close }),
|
|
18
|
+
className: "px-4 pt-3"
|
|
19
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
20
|
+
className: "p-4",
|
|
21
|
+
children
|
|
22
|
+
})] })
|
|
23
|
+
});
|
|
24
|
+
return /* @__PURE__ */ jsxs(DialogTrigger, {
|
|
25
|
+
isOpen,
|
|
26
|
+
onOpenChange,
|
|
27
|
+
children: [trigger, /* @__PURE__ */ jsx(Popover, {
|
|
28
|
+
className: clsx("my-4 outline-none", popoverClassName),
|
|
29
|
+
offset: 0,
|
|
30
|
+
placement: "bottom start",
|
|
31
|
+
children: /* @__PURE__ */ jsx(Dialog, {
|
|
32
|
+
className: "outline-none",
|
|
33
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
34
|
+
className: clsx("overflow-hidden p-2 shadow-5 outline-none", "rounded-s border border-elevation-outline-default-1 bg-elevation-fill-default-1"),
|
|
35
|
+
children
|
|
36
|
+
})
|
|
37
|
+
})
|
|
38
|
+
})]
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
export { ResponsivePopover };
|
package/dist/Segment.js
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { UIStyle } from "./uiStyle.context.js";
|
|
2
|
+
import { FormField } from "./FormField.js";
|
|
3
|
+
import { segmentCva } from "./segment.cva.js";
|
|
4
|
+
import { SegmentItem } from "./SegmentItem.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { clsx } from "clsx";
|
|
7
|
+
import { ToggleButtonGroup } from "react-aria-components";
|
|
8
|
+
import { Fragment as Fragment$1, useMemo, useRef } from "react";
|
|
9
|
+
import { useToggleButtonGroup } from "react-aria";
|
|
10
|
+
import { mergeRefs } from "@react-aria/utils";
|
|
11
|
+
import { Controller } from "react-hook-form";
|
|
12
|
+
import { useToggleGroupState } from "react-stately";
|
|
13
|
+
var SegmentBase = ({ className, items, error, onChange, value, defaultValue,...rest }) => {
|
|
14
|
+
const props = {
|
|
15
|
+
...rest,
|
|
16
|
+
defaultSelectedKeys: defaultValue ? Array.isArray(defaultValue) ? defaultValue : [defaultValue] : void 0,
|
|
17
|
+
selectedKeys: value ? Array.isArray(value) ? value : [value] : void 0
|
|
18
|
+
};
|
|
19
|
+
const buttonGroupRef = useRef(null);
|
|
20
|
+
const uiStyle = UIStyle.useConfig();
|
|
21
|
+
const state = useToggleGroupState(props);
|
|
22
|
+
const { groupProps } = useToggleButtonGroup(props, state, buttonGroupRef);
|
|
23
|
+
const segmentCva$1 = uiStyle?.segment?.cva ?? segmentCva;
|
|
24
|
+
const formFieldProps = {
|
|
25
|
+
error,
|
|
26
|
+
label: "",
|
|
27
|
+
hideLabel: true,
|
|
28
|
+
isDisabled: props.isDisabled
|
|
29
|
+
};
|
|
30
|
+
const onSelectionChange = (keys) => {
|
|
31
|
+
if (props.selectionMode === "multiple") onChange?.(Array.from(keys.values()));
|
|
32
|
+
else onChange?.(Array.from(keys.values())[0]);
|
|
33
|
+
};
|
|
34
|
+
const gridTemplateColumns = useMemo(() => {
|
|
35
|
+
return items.length > 2 ? Array.from({ length: items.length * 2 - 1 }, (_, i) => i % 2 === 0 ? "1fr" : "auto").join(" ") : `repeat(${items.length}, 1fr)`;
|
|
36
|
+
}, [items.length]);
|
|
37
|
+
return /* @__PURE__ */ jsx(FormField, {
|
|
38
|
+
...formFieldProps,
|
|
39
|
+
className: clsx("relative w-full", className),
|
|
40
|
+
children: /* @__PURE__ */ jsx(ToggleButtonGroup, {
|
|
41
|
+
...props,
|
|
42
|
+
...groupProps,
|
|
43
|
+
ref: buttonGroupRef,
|
|
44
|
+
onSelectionChange,
|
|
45
|
+
className: segmentCva$1({
|
|
46
|
+
...props,
|
|
47
|
+
className
|
|
48
|
+
}),
|
|
49
|
+
style: { gridTemplateColumns },
|
|
50
|
+
children: items.map((item, index) => /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(SegmentItem, {
|
|
51
|
+
...item,
|
|
52
|
+
isDisabled: item.isDisabled || props.isDisabled,
|
|
53
|
+
isSelected: state.selectedKeys.has(item.id),
|
|
54
|
+
onPress: () => {
|
|
55
|
+
state.toggleKey(item.id);
|
|
56
|
+
}
|
|
57
|
+
}), index !== items.length - 1 && items.length > 2 && /* @__PURE__ */ jsx("div", {
|
|
58
|
+
className: clsx("h-5 w-px rounded-2xl", !state.selectedKeys.has(item.id) && !state.selectedKeys.has(items[index + 1].id) && "bg-elevation-outline-default-1"),
|
|
59
|
+
children: /* @__PURE__ */ jsx("span", { className: "flex h-full w-px" })
|
|
60
|
+
})] }, item.id))
|
|
61
|
+
})
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
const Segment = (props) => {
|
|
65
|
+
if ("formControl" in props && props.formControl) {
|
|
66
|
+
const { formControl, ref,...innerProps } = props;
|
|
67
|
+
return /* @__PURE__ */ jsx(Controller, {
|
|
68
|
+
control: formControl.control,
|
|
69
|
+
name: formControl.name,
|
|
70
|
+
render: ({ field, fieldState: { error } }) => /* @__PURE__ */ jsx(SegmentBase, {
|
|
71
|
+
...innerProps,
|
|
72
|
+
ref: mergeRefs(ref, field.ref),
|
|
73
|
+
value: field.value,
|
|
74
|
+
onChange: field.onChange,
|
|
75
|
+
isDisabled: field.disabled || props.isDisabled,
|
|
76
|
+
error: props.error ?? error?.message
|
|
77
|
+
})
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
return /* @__PURE__ */ jsx(SegmentBase, { ...props });
|
|
81
|
+
};
|
|
82
|
+
export { Segment };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { UIStyle } from "./uiStyle.context.js";
|
|
2
|
+
import { Typography } from "./Typography.js";
|
|
3
|
+
import { segmentItemCva } from "./segment.cva.js";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { ToggleButton } from "react-aria-components";
|
|
6
|
+
const SegmentItem = ({ label, icon, id, isDisabled,...props }) => {
|
|
7
|
+
const IconComponent = icon;
|
|
8
|
+
const iconOnly = !!(icon && !label);
|
|
9
|
+
const segmentItemCva$1 = UIStyle.useConfig()?.segment?.itemCva ?? segmentItemCva;
|
|
10
|
+
return /* @__PURE__ */ jsxs(ToggleButton, {
|
|
11
|
+
...props,
|
|
12
|
+
id,
|
|
13
|
+
className: segmentItemCva$1({ iconOnly }),
|
|
14
|
+
isDisabled,
|
|
15
|
+
children: [icon && /* @__PURE__ */ jsx(IconComponent, { className: "size-6" }), label && /* @__PURE__ */ jsx(Typography, {
|
|
16
|
+
size: "label-2",
|
|
17
|
+
as: "span",
|
|
18
|
+
className: "overflow-hidden text-ellipsis text-center",
|
|
19
|
+
children: label
|
|
20
|
+
})]
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
export { SegmentItem };
|
package/dist/Select.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { SelectBase } from "./SelectBase.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { mergeRefs } from "@react-aria/utils";
|
|
4
|
+
import { Controller } from "react-hook-form";
|
|
5
|
+
const Select = (props) => {
|
|
6
|
+
if ("formControl" in props && props.formControl) {
|
|
7
|
+
const { formControl, ref,...innerProps } = props;
|
|
8
|
+
return /* @__PURE__ */ jsx(Controller, {
|
|
9
|
+
control: formControl.control,
|
|
10
|
+
name: formControl.name,
|
|
11
|
+
render: ({ field, fieldState: { error } }) => /* @__PURE__ */ jsx(SelectBase, {
|
|
12
|
+
...innerProps,
|
|
13
|
+
ref: mergeRefs(ref, field.ref),
|
|
14
|
+
value: field.value,
|
|
15
|
+
onChange: field.onChange,
|
|
16
|
+
onBlur: field.onBlur,
|
|
17
|
+
isDisabled: field.disabled || props.isDisabled,
|
|
18
|
+
error: props.error ?? error?.message
|
|
19
|
+
})
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
return /* @__PURE__ */ jsx(SelectBase, { ...props });
|
|
23
|
+
};
|
|
24
|
+
export { Select };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { useBreakpoint } from "./useBreakpoint.js";
|
|
2
|
+
import { UIConfig } from "./uiConfig.context.js";
|
|
3
|
+
import { SelectContext } from "./select.context.js";
|
|
4
|
+
import { SelectDesktop } from "./SelectDesktop.js";
|
|
5
|
+
import { SelectMobile } from "./SelectMobile.js";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
const SelectBase = (dProps) => {
|
|
8
|
+
const ui = UIConfig.useConfig();
|
|
9
|
+
const props = {
|
|
10
|
+
...dProps,
|
|
11
|
+
selectionMode: dProps.selectionMode ?? ui.select.selectionMode,
|
|
12
|
+
variant: dProps.variant ?? ui.input.variant,
|
|
13
|
+
as: dProps.as ?? ui.input.as,
|
|
14
|
+
size: dProps.size ?? ui.input.size,
|
|
15
|
+
hideLabel: dProps.hideLabel ?? ui.input.hideLabel,
|
|
16
|
+
isClearable: dProps.isClearable ?? ui.input.isClearable,
|
|
17
|
+
isSearchable: dProps.isSearchable ?? ui.select.isSearchable,
|
|
18
|
+
selectedTagsType: dProps.selectedTagsType ?? ui.select.selectedTagsType,
|
|
19
|
+
ignoreTriggerWidth: dProps.virtualizerOptions || dProps.items.length > 100 ? false : dProps.ignoreTriggerWidth ?? false,
|
|
20
|
+
collapseAfter: dProps.collapseAfter ?? ui.select.collapseAfter
|
|
21
|
+
};
|
|
22
|
+
const isDesktop = useBreakpoint("md");
|
|
23
|
+
return /* @__PURE__ */ jsx(SelectContext.Provider, {
|
|
24
|
+
...props,
|
|
25
|
+
children: isDesktop ? /* @__PURE__ */ jsx(SelectDesktop, { ...props }) : /* @__PURE__ */ jsx(SelectMobile, { ...props })
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
export { SelectBase };
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { FormField } from "./FormField.js";
|
|
2
|
+
import { TooltipWrapper } from "./TooltipWrapper.js";
|
|
3
|
+
import { SelectAllItemId } from "./useSelectItems.js";
|
|
4
|
+
import { SelectContext } from "./select.context.js";
|
|
5
|
+
import { SelectInput } from "./SelectInput.js";
|
|
6
|
+
import { SelectListBox } from "./SelectListBox.js";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { clsx } from "clsx";
|
|
9
|
+
import { ComboBox, DialogTrigger, Popover } from "react-aria-components";
|
|
10
|
+
import { Fragment as Fragment$1, useMemo, useRef } from "react";
|
|
11
|
+
import { useLabel } from "react-aria";
|
|
12
|
+
import { mergeRefs } from "@react-aria/utils";
|
|
13
|
+
import useMeasure from "react-use-measure";
|
|
14
|
+
const SelectDesktop = ({ ref, error, ignoreTriggerWidth, showSelectionContent, inputClassName, containerClassName, customTrigger, onBlur,...props }) => {
|
|
15
|
+
const { label, tooltipText, helperText, isRequired, rightContent, isHeaderHidden, headerClassName, errorClassName, placeholder, variant, isDisabled, className, hideLabel, hideDropdownIcon, isSearchable, isClearable, isLoading, as, size, collapseAfter, selectedTagsType } = props;
|
|
16
|
+
const formFieldProps = {
|
|
17
|
+
error,
|
|
18
|
+
label,
|
|
19
|
+
tooltipText,
|
|
20
|
+
helperText,
|
|
21
|
+
isRequired,
|
|
22
|
+
rightContent,
|
|
23
|
+
isHeaderHidden: isHeaderHidden || as === "inline" || as === "filter" || as === "floating",
|
|
24
|
+
hideLabel,
|
|
25
|
+
isDisabled,
|
|
26
|
+
headerClassName,
|
|
27
|
+
errorClassName
|
|
28
|
+
};
|
|
29
|
+
const { labelProps, fieldProps } = useLabel({ label });
|
|
30
|
+
const triggerRef = useRef(null);
|
|
31
|
+
const closeComboBoxRef = useRef(null);
|
|
32
|
+
const [wrapperRef, { width }] = useMeasure();
|
|
33
|
+
const { fieldState, isOpen, setIsOpen, onInputChange, onChange, onClear, onSelectAll, listItems, selectableListItems, selectedIds, isMultiple } = SelectContext.useSelect();
|
|
34
|
+
const onSelectionChange = (value) => {
|
|
35
|
+
if (!value) return;
|
|
36
|
+
if (value === "all-item-id") {
|
|
37
|
+
if (selectedIds.length === selectableListItems.length) onClear();
|
|
38
|
+
else onSelectAll();
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
if (!isMultiple) {
|
|
42
|
+
onChange(value);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
if (!Array.isArray(fieldState.value)) {
|
|
46
|
+
onChange([value]);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if (fieldState.value.includes(value)) onChange(fieldState.value.filter((id) => id !== value));
|
|
50
|
+
else onChange(fieldState.value.concat(value));
|
|
51
|
+
};
|
|
52
|
+
const openChangeHandler = (value) => {
|
|
53
|
+
if (closeComboBoxRef.current && value) {
|
|
54
|
+
closeComboBoxRef.current.setOpen(false);
|
|
55
|
+
closeComboBoxRef.current = null;
|
|
56
|
+
} else setIsOpen(value);
|
|
57
|
+
};
|
|
58
|
+
const WrapperComponent = isSearchable ? ComboBox : Fragment$1;
|
|
59
|
+
const comboBoxProps = {
|
|
60
|
+
items: listItems,
|
|
61
|
+
selectedKey: isMultiple ? null : fieldState.value,
|
|
62
|
+
onSelectionChange,
|
|
63
|
+
inputValue: fieldState.inputValue,
|
|
64
|
+
onInputChange,
|
|
65
|
+
onOpenChange: openChangeHandler,
|
|
66
|
+
allowsEmptyCollection: true,
|
|
67
|
+
isDisabled,
|
|
68
|
+
isInvalid: !!error,
|
|
69
|
+
menuTrigger: "focus",
|
|
70
|
+
className: clsx("w-full", containerClassName)
|
|
71
|
+
};
|
|
72
|
+
const headerProps = {
|
|
73
|
+
label,
|
|
74
|
+
tooltipText,
|
|
75
|
+
helperText,
|
|
76
|
+
isRequired,
|
|
77
|
+
rightContent,
|
|
78
|
+
isHeaderHidden: hideLabel || isHeaderHidden,
|
|
79
|
+
isDisabled,
|
|
80
|
+
className: headerClassName,
|
|
81
|
+
labelProps
|
|
82
|
+
};
|
|
83
|
+
const dialogTriggerProps = {
|
|
84
|
+
isOpen,
|
|
85
|
+
onOpenChange: setIsOpen
|
|
86
|
+
};
|
|
87
|
+
const showPopover = useMemo(() => listItems.filter((item) => !item.isSelectAllItem).length > 0 || isLoading, [listItems, isLoading]);
|
|
88
|
+
return /* @__PURE__ */ jsx(TooltipWrapper, {
|
|
89
|
+
as,
|
|
90
|
+
error,
|
|
91
|
+
children: /* @__PURE__ */ jsx(WrapperComponent, {
|
|
92
|
+
...isSearchable ? comboBoxProps : {},
|
|
93
|
+
children: /* @__PURE__ */ jsxs(FormField, {
|
|
94
|
+
...formFieldProps,
|
|
95
|
+
...!isSearchable && {
|
|
96
|
+
labelProps,
|
|
97
|
+
className: clsx("w-full", containerClassName)
|
|
98
|
+
},
|
|
99
|
+
as,
|
|
100
|
+
ref: wrapperRef,
|
|
101
|
+
children: [customTrigger ? /* @__PURE__ */ jsx(DialogTrigger, {
|
|
102
|
+
...dialogTriggerProps,
|
|
103
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
104
|
+
...fieldProps,
|
|
105
|
+
ref: mergeRefs(ref, triggerRef),
|
|
106
|
+
children: customTrigger
|
|
107
|
+
})
|
|
108
|
+
}) : /* @__PURE__ */ jsx(SelectInput, {
|
|
109
|
+
ref: mergeRefs(ref, triggerRef),
|
|
110
|
+
placeholder,
|
|
111
|
+
variant,
|
|
112
|
+
as,
|
|
113
|
+
size,
|
|
114
|
+
isDisabled,
|
|
115
|
+
isInvalid: !!error,
|
|
116
|
+
className,
|
|
117
|
+
hideDropdownIcon,
|
|
118
|
+
isSearchable,
|
|
119
|
+
isClearable,
|
|
120
|
+
showSelectionContent,
|
|
121
|
+
inputClassName,
|
|
122
|
+
collapseAfter,
|
|
123
|
+
selectedTagsType,
|
|
124
|
+
onBlur,
|
|
125
|
+
onCloseComboBox: (state) => {
|
|
126
|
+
if (isSearchable) closeComboBoxRef.current = state;
|
|
127
|
+
},
|
|
128
|
+
fieldProps,
|
|
129
|
+
headerProps
|
|
130
|
+
}), (!isSearchable || showPopover) && /* @__PURE__ */ jsx(Popover, {
|
|
131
|
+
triggerRef,
|
|
132
|
+
isOpen,
|
|
133
|
+
onOpenChange: setIsOpen,
|
|
134
|
+
className: "my-4 outline-none",
|
|
135
|
+
style: { width: !ignoreTriggerWidth ? width : void 0 },
|
|
136
|
+
offset: 0,
|
|
137
|
+
children: /* @__PURE__ */ jsx(SelectListBox, {
|
|
138
|
+
...props,
|
|
139
|
+
className: "max-h-80 rounded-list-rounding-dropdown border border-elevation-outline-default-1 bg-elevation-fill-default-1 shadow-5 [scrollbar-width:thin]",
|
|
140
|
+
autoFocus: !isSearchable
|
|
141
|
+
})
|
|
142
|
+
})]
|
|
143
|
+
})
|
|
144
|
+
})
|
|
145
|
+
});
|
|
146
|
+
};
|
|
147
|
+
export { SelectDesktop };
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { ArrowDropDownIcon } from "./ArrowDropDown.js";
|
|
2
|
+
import { UIStyle } from "./uiStyle.context.js";
|
|
3
|
+
import { Typography } from "./Typography.js";
|
|
4
|
+
import { inputBase, inputSide, inputSize } from "./input.cva.js";
|
|
5
|
+
import { FormFieldLabel } from "./FormFieldLabel.js";
|
|
6
|
+
import { ns } from "./i18n.js";
|
|
7
|
+
import { InputClear } from "./InputClear.js";
|
|
8
|
+
import { SelectInputTags } from "./SelectInputTags.js";
|
|
9
|
+
import { SelectContext } from "./select.context.js";
|
|
10
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
import { clsx } from "clsx";
|
|
12
|
+
import { Button, ComboBoxStateContext, Input } from "react-aria-components";
|
|
13
|
+
import { use, useMemo, useState } from "react";
|
|
14
|
+
import { useFocusVisible, useFocusWithin, useHover } from "react-aria";
|
|
15
|
+
import useMeasure from "react-use-measure";
|
|
16
|
+
import { useTranslation } from "react-i18next";
|
|
17
|
+
const SelectInput = ({ ref, placeholder, variant, as, size, isDisabled, isInvalid, className, hideDropdownIcon, isSearchable, isClearable, showSelectionContent, inputClassName, fieldProps, headerProps, selectedTagsType, collapseAfter, onCloseComboBox, onBlur,...props }) => {
|
|
18
|
+
const uiStyle = UIStyle.useConfig();
|
|
19
|
+
const inputSizeCva = uiStyle?.input?.sizeCva ?? inputSize;
|
|
20
|
+
const inputBaseCva = uiStyle?.input?.baseCva ?? inputBase;
|
|
21
|
+
const inputSideCva = uiStyle?.input?.sideCva ?? inputSide;
|
|
22
|
+
const { t } = useTranslation("ui");
|
|
23
|
+
const state = use(ComboBoxStateContext);
|
|
24
|
+
const { hoverProps, isHovered } = useHover({ isDisabled });
|
|
25
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
26
|
+
const { focusWithinProps } = useFocusWithin({ onFocusWithinChange: setIsFocused });
|
|
27
|
+
const { isFocusVisible } = useFocusVisible();
|
|
28
|
+
const [labelContentRef, { width: labelWidth }] = useMeasure();
|
|
29
|
+
const { fieldState, isOpen, setIsOpen, listItems, selectedItems, onChange, onClear, onRemove, isMultiple, isLoading } = SelectContext.useSelect();
|
|
30
|
+
const isEmpty = selectedItems.length === 0;
|
|
31
|
+
const showTags = isMultiple && !isEmpty;
|
|
32
|
+
const showClearButton = isClearable && isHovered && (selectedItems.length > 0 || isSearchable && fieldState.inputValue !== "");
|
|
33
|
+
const style = useMemo(() => {
|
|
34
|
+
if (as !== "filter") return {};
|
|
35
|
+
return { paddingLeft: `calc(${isSearchable || showTags ? "1 * " : "2 * "}var(${inputSideCva({
|
|
36
|
+
size,
|
|
37
|
+
type: "var"
|
|
38
|
+
})}) + ${labelWidth}px)` };
|
|
39
|
+
}, [
|
|
40
|
+
labelWidth,
|
|
41
|
+
as,
|
|
42
|
+
size,
|
|
43
|
+
isSearchable,
|
|
44
|
+
showTags,
|
|
45
|
+
inputSideCva
|
|
46
|
+
]);
|
|
47
|
+
const labelProps = useMemo(() => {
|
|
48
|
+
const { labelProps: headerLabelProps } = headerProps ?? {};
|
|
49
|
+
if (!(as && ["filter", "floating"].includes(as)) || isSearchable) return headerLabelProps;
|
|
50
|
+
return {
|
|
51
|
+
...headerLabelProps,
|
|
52
|
+
className: clsx(headerLabelProps?.className, "pointer-events-none")
|
|
53
|
+
};
|
|
54
|
+
}, [
|
|
55
|
+
as,
|
|
56
|
+
headerProps,
|
|
57
|
+
isSearchable
|
|
58
|
+
]);
|
|
59
|
+
const onKeyDown = (e) => {
|
|
60
|
+
if (e.key === "Enter" && !isMultiple && !isLoading && listItems.length === 1 && !listItems[0].isDisabled) {
|
|
61
|
+
e.preventDefault();
|
|
62
|
+
onChange(listItems[0].id);
|
|
63
|
+
onCloseComboBox?.(state);
|
|
64
|
+
}
|
|
65
|
+
if (e.key === "Backspace" && isMultiple && fieldState.inputValue === "" && Array.isArray(fieldState.value) && fieldState.value.length > 0) onChange(fieldState.value.slice(0, -1));
|
|
66
|
+
};
|
|
67
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
68
|
+
ref,
|
|
69
|
+
className: inputBaseCva({
|
|
70
|
+
variant,
|
|
71
|
+
as,
|
|
72
|
+
...props,
|
|
73
|
+
className: clsx("group/select-content relative flex px-0!", isSearchable && "cursor-text", className)
|
|
74
|
+
}),
|
|
75
|
+
"data-rac": "",
|
|
76
|
+
"data-disabled": isDisabled,
|
|
77
|
+
"data-hovered": isHovered || void 0,
|
|
78
|
+
"data-focused": isOpen || isFocused || void 0,
|
|
79
|
+
"data-focus-within": isFocused || void 0,
|
|
80
|
+
"data-searchable-focus-within": isFocused && isSearchable || void 0,
|
|
81
|
+
"data-focus-visible": isFocused && isFocusVisible || void 0,
|
|
82
|
+
"data-has-selection": !isEmpty || void 0,
|
|
83
|
+
"data-has-search": fieldState.searchValue !== "" || void 0,
|
|
84
|
+
"data-invalid": isInvalid || void 0,
|
|
85
|
+
"data-is-empty": isEmpty || void 0,
|
|
86
|
+
...hoverProps,
|
|
87
|
+
...focusWithinProps,
|
|
88
|
+
children: [
|
|
89
|
+
/* @__PURE__ */ jsxs("div", {
|
|
90
|
+
className: clsx("relative flex flex-1 items-center truncate", showTags && inputSizeCva({
|
|
91
|
+
size,
|
|
92
|
+
...props
|
|
93
|
+
})),
|
|
94
|
+
children: [
|
|
95
|
+
as && ["filter", "floating"].includes(as) && headerProps && /* @__PURE__ */ jsx(FormFieldLabel, {
|
|
96
|
+
ref: labelContentRef,
|
|
97
|
+
as,
|
|
98
|
+
...headerProps,
|
|
99
|
+
labelProps
|
|
100
|
+
}),
|
|
101
|
+
(showTags || isSearchable) && /* @__PURE__ */ jsxs("div", {
|
|
102
|
+
className: clsx("flex flex-1 flex-wrap gap-2 truncate", !isSearchable && "pointer-events-none z-1"),
|
|
103
|
+
style,
|
|
104
|
+
children: [showTags && /* @__PURE__ */ jsx(SelectInputTags, {
|
|
105
|
+
selectedItems,
|
|
106
|
+
isDisabled,
|
|
107
|
+
collapseAfter,
|
|
108
|
+
selectedTagsType,
|
|
109
|
+
onRemove
|
|
110
|
+
}), isSearchable && /* @__PURE__ */ jsx(Input, {
|
|
111
|
+
placeholder,
|
|
112
|
+
onBlur,
|
|
113
|
+
className: clsx("flex-1 bg-transparent outline-none placeholder:text-text-default-3 disabled:text-interactive-text-secondary-disabled", !showTags && inputSizeCva({
|
|
114
|
+
size,
|
|
115
|
+
...props,
|
|
116
|
+
className: "rounded-input-rounding-default"
|
|
117
|
+
}), inputClassName),
|
|
118
|
+
onKeyDown,
|
|
119
|
+
...fieldProps
|
|
120
|
+
})]
|
|
121
|
+
}),
|
|
122
|
+
!isSearchable && /* @__PURE__ */ jsx(Button, {
|
|
123
|
+
isDisabled,
|
|
124
|
+
onPress: () => setIsOpen(!isOpen),
|
|
125
|
+
onBlur,
|
|
126
|
+
"data-type": "select-trigger",
|
|
127
|
+
className: inputSizeCva({
|
|
128
|
+
size,
|
|
129
|
+
...props,
|
|
130
|
+
className: clsx("w-full truncate text-start outline-none disabled:text-interactive-text-secondary-disabled", showTags && "absolute inset-0 z-0")
|
|
131
|
+
}),
|
|
132
|
+
style,
|
|
133
|
+
...fieldProps,
|
|
134
|
+
children: (isEmpty || !isMultiple) && /* @__PURE__ */ jsxs(Typography, {
|
|
135
|
+
size: "label-1",
|
|
136
|
+
className: clsx("truncate empty:before:inline-block empty:before:content-['']", isEmpty && "text-text-default-3"),
|
|
137
|
+
children: [isEmpty && placeholder, !isEmpty && (showSelectionContent ? selectedItems[0].content : selectedItems[0].label)]
|
|
138
|
+
})
|
|
139
|
+
})
|
|
140
|
+
]
|
|
141
|
+
}),
|
|
142
|
+
showClearButton && /* @__PURE__ */ jsx(InputClear, { onClear }),
|
|
143
|
+
!hideDropdownIcon && /* @__PURE__ */ jsx(Button, {
|
|
144
|
+
excludeFromTabOrder: true,
|
|
145
|
+
"aria-label": t(($) => isOpen ? $.ui.closeAlt : $.ui.openAlt),
|
|
146
|
+
className: clsx("self-stretch pl-1-5 outline-none", inputSizeCva({ size })),
|
|
147
|
+
isDisabled,
|
|
148
|
+
onPress: () => {
|
|
149
|
+
if (!isSearchable) setIsOpen(!isOpen);
|
|
150
|
+
},
|
|
151
|
+
children: /* @__PURE__ */ jsx(ArrowDropDownIcon, {
|
|
152
|
+
className: clsx("size-6 shrink-0", isOpen && "rotate-180", isDisabled ? "text-interactive-text-secondary-disabled" : "text-interactive-text-secondary-idle"),
|
|
153
|
+
"aria-hidden": "true"
|
|
154
|
+
})
|
|
155
|
+
})
|
|
156
|
+
]
|
|
157
|
+
});
|
|
158
|
+
};
|
|
159
|
+
export { SelectInput };
|