@povio/ui 2.1.14 → 2.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +74 -0
- package/dist/AclGuard.js +12 -0
- package/dist/ActionModal.js +51 -0
- package/dist/Alert.js +46 -0
- package/dist/AlignCenter.js +13 -0
- package/dist/AlignLeft.js +13 -0
- package/dist/AlignLeftRight.js +13 -0
- package/dist/AlignRight.js +13 -0
- package/dist/ArrowDropDown.js +13 -0
- package/dist/ArrowDropUp.js +13 -0
- package/dist/ArrowLeft.js +13 -0
- package/dist/ArrowRight.js +13 -0
- package/dist/AuthGuard.js +22 -0
- package/dist/Autocomplete.js +28 -0
- package/dist/Bold.js +13 -0
- package/dist/BottomSheet.js +191 -0
- package/dist/BulletedList.js +13 -0
- package/dist/Button.js +54 -0
- package/dist/ButtonContent.js +28 -0
- package/dist/Calendar.js +15 -0
- package/dist/Calendar2.js +54 -0
- package/dist/CalendarCell.js +130 -0
- package/dist/CalendarGrid.js +50 -0
- package/dist/CalendarHeader.js +75 -0
- package/dist/CalendarSelectHeader.js +170 -0
- package/dist/Can.js +13 -0
- package/dist/CellText.js +13 -0
- package/dist/Check.js +15 -0
- package/dist/CheckCircle.js +13 -0
- package/dist/CheckContent.js +16 -0
- package/dist/Checkbox.js +61 -0
- package/dist/CheckboxCheckmark.js +16 -0
- package/dist/CheckboxCheckmark2.js +25 -0
- package/dist/CheckboxIndeterminate.js +16 -0
- package/dist/ChevronDown.js +15 -0
- package/dist/ChevronLeft.js +15 -0
- package/dist/ChevronRight.js +15 -0
- package/dist/ChevronUp.js +15 -0
- package/dist/ChevronsLeft.js +15 -0
- package/dist/ChevronsRight.js +15 -0
- package/dist/Clock.js +13 -0
- package/dist/Close.js +13 -0
- package/dist/ColorPicker.js +16 -0
- package/dist/ColorPickerDropdown.js +51 -0
- package/dist/ColumnConfig.js +81 -0
- package/dist/DateField.js +89 -0
- package/dist/DatePicker.js +191 -0
- package/dist/DatePickerInput.js +158 -0
- package/dist/DateRangePicker.js +601 -0
- package/dist/DateSegmentItem.js +29 -0
- package/dist/DateTime.js +18 -0
- package/dist/DateTimeDialog.js +49 -0
- package/dist/DateTimeDialogFooter.js +25 -0
- package/dist/DateTimePicker.js +200 -0
- package/dist/Drag.js +13 -0
- package/dist/Drawer.js +43 -0
- package/dist/File.js +15 -0
- package/dist/FileCard.js +50 -0
- package/dist/FileCardList.js +17 -0
- package/dist/FileUpload.js +189 -0
- package/dist/FileUploadContainer.js +12 -0
- package/dist/FileUploadContent.js +61 -0
- package/dist/FileUploadContentEmpty.js +54 -0
- package/dist/FileUploadContentError.js +109 -0
- package/dist/FileUploadContentFilled.js +112 -0
- package/dist/FileUploadContentLoading.js +76 -0
- package/dist/Form.js +42 -0
- package/dist/FormField.js +35 -0
- package/dist/FormFieldError.js +11 -0
- package/dist/FormFieldHeader.js +36 -0
- package/dist/FormFieldHeaderClose.js +15 -0
- package/dist/FormFieldLabel.js +32 -0
- package/dist/HeaderText.js +10 -0
- package/dist/Highlight.js +13 -0
- package/dist/HighlightOn.js +19 -0
- package/dist/HyperlinkAction.js +70 -0
- package/dist/IconButton.js +12 -0
- package/dist/InfiniteTable.js +31 -0
- package/dist/Info.js +18 -0
- package/dist/InlineIconButton.js +13 -0
- package/dist/InputClear.js +19 -0
- package/dist/InputContent.js +94 -0
- package/dist/InputItem.js +54 -0
- package/dist/InputUpload.js +111 -0
- package/dist/InputUploadContent.js +52 -0
- package/dist/InputUploadFilled.js +26 -0
- package/dist/Inputs.js +15 -0
- package/dist/Italic.js +13 -0
- package/dist/Link.js +13 -0
- package/dist/Link2.js +19 -0
- package/dist/Loader.js +32 -0
- package/dist/Menu.js +13 -0
- package/dist/Menu2.js +9 -0
- package/dist/MenuDesktop.js +53 -0
- package/dist/MenuItem.js +21 -0
- package/dist/MenuMobile.js +64 -0
- package/dist/MenuPopover.js +30 -0
- package/dist/Modal.js +49 -0
- package/dist/MonthPicker.js +56 -0
- package/dist/NumberInput.js +132 -0
- package/dist/NumberedList.js +13 -0
- package/dist/PaginatedTable.js +26 -0
- package/dist/Pagination.js +43 -0
- package/dist/PaginationList.js +105 -0
- package/dist/PasswordInput.js +21 -0
- package/dist/PillButton.js +37 -0
- package/dist/PointerHorizontal.js +13 -0
- package/dist/PointerVertical.js +13 -0
- package/dist/ProgressBar.js +25 -0
- package/dist/QueryAutocomplete.js +18 -0
- package/dist/RadioGroup.js +81 -0
- package/dist/RangeCalendar.js +96 -0
- package/dist/ResponsivePopover.js +41 -0
- package/dist/Segment.js +82 -0
- package/dist/SegmentItem.js +23 -0
- package/dist/Select.js +24 -0
- package/dist/SelectBase.js +28 -0
- package/dist/SelectDesktop.js +147 -0
- package/dist/SelectInput.js +159 -0
- package/dist/SelectInputTags.js +29 -0
- package/dist/SelectListBox.js +73 -0
- package/dist/SelectListBoxItem.js +48 -0
- package/dist/SelectListBoxItemSelectAll.js +31 -0
- package/dist/SelectListBoxLoadingItem.js +41 -0
- package/dist/SelectListBoxSelectionBar.js +25 -0
- package/dist/SelectMobile.js +111 -0
- package/dist/Send.js +15 -0
- package/dist/Slider.js +93 -0
- package/dist/SplitButton.js +36 -0
- package/dist/Strikethrough.js +13 -0
- package/dist/Table.js +248 -0
- package/dist/Tag.js +42 -0
- package/dist/TextAlignSelect.js +44 -0
- package/dist/TextArea.js +120 -0
- package/dist/TextButton.js +13 -0
- package/dist/TextColor.js +16 -0
- package/dist/TextColorSelect.js +22 -0
- package/dist/TextEditor.js +143 -0
- package/dist/TextEditorToolbar.js +30 -0
- package/dist/TextHighlightSelect.js +24 -0
- package/dist/TextInput.js +125 -0
- package/dist/TextListActions.js +42 -0
- package/dist/TextMarksActions.js +67 -0
- package/dist/TextStyleSelect.js +52 -0
- package/dist/TimeField.js +17 -0
- package/dist/TimePicker.js +158 -0
- package/dist/TimePickerForm.js +158 -0
- package/dist/TimePickerInput.js +92 -0
- package/dist/Toast.js +58 -0
- package/dist/Today.js +13 -0
- package/dist/Toggle.js +60 -0
- package/dist/ToggleButton.js +13 -0
- package/dist/Tooltip.js +49 -0
- package/dist/TooltipEllipsis.js +18 -0
- package/dist/TooltipWrapper.js +19 -0
- package/dist/Typography.js +14 -0
- package/dist/Underlined.js +15 -0
- package/dist/Upload.js +16 -0
- package/dist/View.js +13 -0
- package/dist/ViewOff.js +13 -0
- package/dist/WarningFilled.js +15 -0
- package/dist/YearPicker.js +64 -0
- package/dist/ability.context.js +35 -0
- package/dist/alert.cva.js +62 -0
- package/dist/array.utils.js +8 -0
- package/dist/auth.context.js +37 -0
- package/dist/auth.js +6 -12
- package/dist/button.cva.js +656 -0
- package/dist/buttonContent.cva.js +10 -0
- package/dist/checkbox.cva.js +47 -0
- package/dist/components/inputs/Checkbox/Checkbox.d.ts +1 -0
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.d.ts +2 -2
- package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +5 -0
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +3 -1
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +3 -1
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +3 -1
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +1 -0
- package/dist/components/inputs/DateTime/shared/DateField.d.ts +1 -0
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +8 -2
- package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +2 -1
- package/dist/components/inputs/File/fileUpload.types.d.ts +1 -0
- package/dist/components/inputs/FormField/FormField.d.ts +4 -1
- package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +4 -2
- package/dist/components/inputs/Input/TextArea/TextArea.d.ts +1 -0
- package/dist/components/inputs/Input/TextInput/TextInput.d.ts +2 -1
- package/dist/components/inputs/Input/shared/InputContent.d.ts +4 -3
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +3 -0
- package/dist/components/inputs/TextEditor/TextEditor.d.ts +1 -0
- package/dist/components/inputs/Toggle/Toggle.d.ts +2 -0
- package/dist/components/inputs/shared/CheckContent.d.ts +2 -1
- package/dist/compoundMapper.js +11 -0
- package/dist/config/uiStyle.context.d.ts +2 -1
- package/dist/confirmation.context.js +78 -0
- package/dist/date-time.utils.js +50 -0
- package/dist/date.utils.js +17 -0
- package/dist/dom.utils.js +17 -0
- package/dist/dynamicColumns.js +272 -0
- package/dist/dynamicInputs.js +186 -0
- package/dist/error-handling.js +87 -0
- package/dist/file.utils.js +43 -0
- package/dist/fileUpload.cva.js +49 -0
- package/dist/i18n.js +8 -0
- package/dist/index.js +136 -278
- package/dist/input.cva.js +210 -0
- package/dist/inputUploadButton.cva.js +27 -0
- package/dist/isEqual.js +57 -0
- package/dist/label.cva.js +104 -0
- package/dist/link.context.js +17 -0
- package/dist/link.cva.js +7 -0
- package/dist/loader.cva.js +16 -0
- package/dist/logger.js +17 -0
- package/dist/menu.cva.js +27 -0
- package/dist/minWidth.cva.js +9 -0
- package/dist/modal.cva.js +31 -0
- package/dist/object.utils.js +36 -0
- package/dist/outline.clsx.js +4 -0
- package/dist/pillButton.cva.js +254 -0
- package/dist/queries.utils.js +7 -0
- package/dist/radio.cva.js +42 -0
- package/dist/react.js +6 -0
- package/dist/rest-interceptor.js +22 -0
- package/dist/rest.utils.js +31 -0
- package/dist/rolldown_runtime.js +16 -0
- package/dist/router.context.js +37 -0
- package/dist/routing.utils.js +9 -0
- package/dist/segment.cva.js +25 -0
- package/dist/select.context.js +190 -0
- package/dist/status.cva.js +57 -0
- package/dist/string.utils.js +10 -0
- package/dist/table.cva.js +35 -0
- package/dist/tag.cva.js +50 -0
- package/dist/text-editor.js +2 -4
- package/dist/textEditor.types.js +38 -0
- package/dist/theme.context.js +65 -0
- package/dist/toast.cva.js +158 -0
- package/dist/toggle.cva.js +27 -0
- package/dist/tooltip.cva.js +30 -0
- package/dist/translation.js +147 -0
- package/dist/translation2.js +145 -0
- package/dist/typography.cva.js +124 -0
- package/dist/uiConfig.context.js +58 -0
- package/dist/uiStyle.context.js +16 -0
- package/dist/useAutosave.js +62 -0
- package/dist/useBreakpoint.js +28 -0
- package/dist/useDebounceCallback.js +23 -0
- package/dist/useDeepCompare.js +21 -0
- package/dist/useFilters.js +121 -0
- package/dist/useForm.js +12 -0
- package/dist/useFormAutosave.js +52 -0
- package/dist/useIntersectionObserver.js +23 -0
- package/dist/useLocalStorage.js +35 -0
- package/dist/useLongPressRepeat.js +27 -0
- package/dist/usePagination.js +26 -0
- package/dist/useScrollableListBox.js +24 -0
- package/dist/useSelectItems.js +82 -0
- package/dist/useSorting.js +34 -0
- package/dist/useStateAndRef.js +15 -0
- package/dist/useTableColumnConfig.js +38 -0
- package/dist/useTableNav.js +279 -0
- package/dist/useToast.js +63 -0
- package/dist/useTranslationMemo.js +10 -0
- package/dist/zod.utils.js +17 -0
- package/package.json +14 -14
- package/dist/assets/icons/AlignCenter.js +0 -21
- package/dist/assets/icons/AlignLeft.js +0 -21
- package/dist/assets/icons/AlignLeftRight.js +0 -21
- package/dist/assets/icons/AlignRight.js +0 -21
- package/dist/assets/icons/ArrowDropDown.js +0 -21
- package/dist/assets/icons/ArrowDropUp.js +0 -21
- package/dist/assets/icons/ArrowLeft.js +0 -21
- package/dist/assets/icons/ArrowRight.js +0 -21
- package/dist/assets/icons/Bold.js +0 -21
- package/dist/assets/icons/BulletedList.js +0 -21
- package/dist/assets/icons/Calendar.js +0 -23
- package/dist/assets/icons/Check.js +0 -23
- package/dist/assets/icons/CheckCircle.js +0 -21
- package/dist/assets/icons/CheckboxCheckmark.js +0 -24
- package/dist/assets/icons/CheckboxIndeterminate.js +0 -24
- package/dist/assets/icons/ChevronDown.js +0 -23
- package/dist/assets/icons/ChevronLeft.js +0 -23
- package/dist/assets/icons/ChevronRight.js +0 -23
- package/dist/assets/icons/ChevronUp.js +0 -23
- package/dist/assets/icons/ChevronsLeft.js +0 -23
- package/dist/assets/icons/ChevronsRight.js +0 -23
- package/dist/assets/icons/Clock.js +0 -21
- package/dist/assets/icons/Close.js +0 -21
- package/dist/assets/icons/DateTime.js +0 -32
- package/dist/assets/icons/Drag.js +0 -21
- package/dist/assets/icons/File.js +0 -23
- package/dist/assets/icons/Highlight.js +0 -21
- package/dist/assets/icons/HighlightOn.js +0 -30
- package/dist/assets/icons/Info.js +0 -32
- package/dist/assets/icons/Italic.js +0 -21
- package/dist/assets/icons/Link.js +0 -21
- package/dist/assets/icons/Menu.js +0 -21
- package/dist/assets/icons/NumberedList.js +0 -21
- package/dist/assets/icons/PointerHorizontal.js +0 -21
- package/dist/assets/icons/PointerVertical.js +0 -21
- package/dist/assets/icons/Send.js +0 -23
- package/dist/assets/icons/Strikethrough.js +0 -21
- package/dist/assets/icons/TextColor.js +0 -30
- package/dist/assets/icons/Today.js +0 -21
- package/dist/assets/icons/Underlined.js +0 -23
- package/dist/assets/icons/Upload.js +0 -30
- package/dist/assets/icons/View.js +0 -18
- package/dist/assets/icons/ViewOff.js +0 -18
- package/dist/assets/icons/WarningFilled.js +0 -23
- package/dist/assets/locales/en/translation.json.js +0 -14
- package/dist/assets/locales/sl/translation.json.js +0 -14
- package/dist/components/Menu/Menu.js +0 -14
- package/dist/components/Menu/MenuDesktop.js +0 -74
- package/dist/components/Menu/MenuItem.js +0 -27
- package/dist/components/Menu/MenuMobile.js +0 -83
- package/dist/components/Menu/MenuPopover.js +0 -43
- package/dist/components/Menu/menu.cva.js +0 -45
- package/dist/components/buttons/Button/Button.js +0 -73
- package/dist/components/buttons/Button/button.cva.js +0 -666
- package/dist/components/buttons/IconButton/IconButton.js +0 -17
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +0 -18
- package/dist/components/buttons/PillButton/PillButton.js +0 -44
- package/dist/components/buttons/PillButton/pillButton.cva.js +0 -268
- package/dist/components/buttons/SplitButton/SplitButton.js +0 -65
- package/dist/components/buttons/TextButton/TextButton.js +0 -18
- package/dist/components/buttons/ToggleButton/ToggleButton.js +0 -21
- package/dist/components/buttons/shared/ButtonContent.js +0 -53
- package/dist/components/buttons/shared/buttonContent.cva.js +0 -16
- package/dist/components/inputs/Checkbox/Checkbox.js +0 -81
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +0 -32
- package/dist/components/inputs/Checkbox/checkbox.cva.js +0 -51
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +0 -251
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +0 -689
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +0 -265
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +0 -217
- package/dist/components/inputs/DateTime/shared/Calendar.js +0 -85
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +0 -160
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +0 -67
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +0 -89
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +0 -203
- package/dist/components/inputs/DateTime/shared/DateField.js +0 -77
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +0 -206
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +0 -55
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +0 -76
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +0 -47
- package/dist/components/inputs/DateTime/shared/MonthPicker.js +0 -82
- package/dist/components/inputs/DateTime/shared/RangeCalendar.js +0 -133
- package/dist/components/inputs/DateTime/shared/TimeField.js +0 -26
- package/dist/components/inputs/DateTime/shared/TimePickerForm.js +0 -186
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +0 -125
- package/dist/components/inputs/DateTime/shared/YearPicker.js +0 -89
- package/dist/components/inputs/File/FileUpload.js +0 -257
- package/dist/components/inputs/File/FileUploadContainer.js +0 -17
- package/dist/components/inputs/File/InputUpload.js +0 -174
- package/dist/components/inputs/File/shared/FileCard.js +0 -67
- package/dist/components/inputs/File/shared/FileCardList.js +0 -20
- package/dist/components/inputs/File/shared/FileUploadContent.js +0 -92
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +0 -92
- package/dist/components/inputs/File/shared/FileUploadContentError.js +0 -167
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +0 -173
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +0 -128
- package/dist/components/inputs/File/shared/InputUploadContent.js +0 -73
- package/dist/components/inputs/File/shared/InputUploadFilled.js +0 -45
- package/dist/components/inputs/File/shared/ProgressBar.js +0 -42
- package/dist/components/inputs/File/shared/fileUpload.cva.js +0 -58
- package/dist/components/inputs/File/shared/inputUploadButton.cva.js +0 -49
- package/dist/components/inputs/FormField/FormField.js +0 -54
- package/dist/components/inputs/FormField/FormFieldError.js +0 -16
- package/dist/components/inputs/FormField/FormFieldHeader.js +0 -57
- package/dist/components/inputs/FormField/FormFieldHeaderClose.js +0 -20
- package/dist/components/inputs/FormField/FormFieldLabel.js +0 -37
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +0 -166
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +0 -26
- package/dist/components/inputs/Input/TextArea/TextArea.js +0 -155
- package/dist/components/inputs/Input/TextInput/TextInput.js +0 -162
- package/dist/components/inputs/Input/shared/InputContent.js +0 -114
- package/dist/components/inputs/Inputs/Form.js +0 -68
- package/dist/components/inputs/Inputs/InputItem.js +0 -61
- package/dist/components/inputs/Inputs/Inputs.js +0 -32
- package/dist/components/inputs/RadioGroup/RadioGroup.js +0 -103
- package/dist/components/inputs/RadioGroup/radio.cva.js +0 -57
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +0 -39
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +0 -25
- package/dist/components/inputs/Selection/Select/Select.js +0 -32
- package/dist/components/inputs/Selection/shared/SelectBase.js +0 -27
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +0 -223
- package/dist/components/inputs/Selection/shared/SelectInput.js +0 -234
- package/dist/components/inputs/Selection/shared/SelectInputTags.js +0 -49
- package/dist/components/inputs/Selection/shared/SelectListBox.js +0 -127
- package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +0 -78
- package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +0 -45
- package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +0 -47
- package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +0 -42
- package/dist/components/inputs/Selection/shared/SelectMobile.js +0 -165
- package/dist/components/inputs/Selection/shared/select.context.js +0 -244
- package/dist/components/inputs/Selection/shared/useSelectItems.js +0 -94
- package/dist/components/inputs/Slider/Slider.js +0 -137
- package/dist/components/inputs/TextEditor/TextEditor.js +0 -223
- package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +0 -34
- package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +0 -80
- package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +0 -92
- package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +0 -56
- package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +0 -33
- package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +0 -31
- package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +0 -37
- package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +0 -51
- package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +0 -73
- package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +0 -61
- package/dist/components/inputs/TextEditor/textEditor.types.js +0 -40
- package/dist/components/inputs/Toggle/Toggle.js +0 -65
- package/dist/components/inputs/Toggle/toggle.cva.js +0 -44
- package/dist/components/inputs/shared/CheckContent.js +0 -22
- package/dist/components/inputs/shared/InputClear.js +0 -27
- package/dist/components/inputs/shared/TooltipWrapper.js +0 -23
- package/dist/components/inputs/shared/input.cva.js +0 -174
- package/dist/components/inputs/shared/label.cva.js +0 -128
- package/dist/components/outline.clsx.js +0 -11
- package/dist/components/overlays/ActionModal/ActionModal.js +0 -80
- package/dist/components/overlays/BottomSheet/BottomSheet.js +0 -261
- package/dist/components/overlays/Drawer/Drawer.js +0 -84
- package/dist/components/overlays/Modal/Modal.js +0 -64
- package/dist/components/overlays/Modal/modal.cva.js +0 -53
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +0 -71
- package/dist/components/overlays/Tooltip/Tooltip.js +0 -92
- package/dist/components/overlays/Tooltip/TooltipEllipsis.js +0 -27
- package/dist/components/overlays/Tooltip/tooltip.cva.js +0 -60
- package/dist/components/segment/Segment.js +0 -118
- package/dist/components/segment/SegmentItem.js +0 -35
- package/dist/components/segment/segment.cva.js +0 -35
- package/dist/components/shared/pagination/Pagination.js +0 -75
- package/dist/components/shared/pagination/PaginationList.js +0 -145
- package/dist/components/shared/pagination/minWidth.cva.js +0 -15
- package/dist/components/status/Alert/Alert.js +0 -41
- package/dist/components/status/Alert/alert.cva.js +0 -64
- package/dist/components/status/Loader/Loader.js +0 -37
- package/dist/components/status/Loader/loader.cva.js +0 -27
- package/dist/components/status/Toast/Toast.js +0 -65
- package/dist/components/status/Toast/toast.cva.js +0 -150
- package/dist/components/status/Toast/useToast.js +0 -94
- package/dist/components/status/shared/status.cva.js +0 -62
- package/dist/components/table/CellText.js +0 -18
- package/dist/components/table/ColumnConfig.js +0 -124
- package/dist/components/table/HeaderText.js +0 -15
- package/dist/components/table/InfiniteTable.js +0 -40
- package/dist/components/table/PaginatedTable.js +0 -33
- package/dist/components/table/Table.js +0 -370
- package/dist/components/table/table.cva.js +0 -63
- package/dist/components/text/Link/Link.js +0 -24
- package/dist/components/text/Link/link.cva.js +0 -18
- package/dist/components/text/Tag/Tag.js +0 -49
- package/dist/components/text/Tag/tag.cva.js +0 -59
- package/dist/components/text/Typography/Typography.js +0 -22
- package/dist/components/text/Typography/typography.cva.js +0 -100
- package/dist/config/confirmation.context.js +0 -107
- package/dist/config/i18n.js +0 -15
- package/dist/config/link.context.js +0 -19
- package/dist/config/router.context.js +0 -39
- package/dist/config/theme.context.js +0 -73
- package/dist/config/uiConfig.context.js +0 -69
- package/dist/config/uiStyle.context.js +0 -16
- package/dist/helpers/dynamicColumns.js +0 -359
- package/dist/helpers/dynamicInputs.js +0 -212
- package/dist/hooks/useAutosave.js +0 -83
- package/dist/hooks/useBreakpoint.js +0 -33
- package/dist/hooks/useDebounceCallback.js +0 -29
- package/dist/hooks/useDeepCompare.js +0 -25
- package/dist/hooks/useFilters.js +0 -160
- package/dist/hooks/useForm.js +0 -22
- package/dist/hooks/useFormAutosave.js +0 -67
- package/dist/hooks/useIntersectionObserver.js +0 -27
- package/dist/hooks/useLocalStorage.js +0 -54
- package/dist/hooks/useLongPressRepeat.js +0 -33
- package/dist/hooks/usePagination.js +0 -35
- package/dist/hooks/useScrollableListBox.js +0 -30
- package/dist/hooks/useSorting.js +0 -32
- package/dist/hooks/useStateAndRef.js +0 -17
- package/dist/hooks/useTableColumnConfig.js +0 -63
- package/dist/hooks/useTableNav.js +0 -394
- package/dist/hooks/useTranslationMemo.js +0 -14
- package/dist/utils/array.utils.js +0 -12
- package/dist/utils/compoundMapper.js +0 -14
- package/dist/utils/date-time.utils.js +0 -77
- package/dist/utils/date.utils.js +0 -23
- package/dist/utils/dom.utils.js +0 -13
- package/dist/utils/file.utils.js +0 -63
- package/dist/utils/isEqual.js +0 -95
- package/dist/utils/logger.js +0 -19
- package/dist/utils/object.utils.js +0 -53
- package/dist/utils/queries.utils.js +0 -9
- package/dist/utils/rest.utils.js +0 -51
- package/dist/utils/routing.utils.js +0 -15
- package/dist/utils/string.utils.js +0 -12
- package/dist/utils/vendor/acl/AclGuard.js +0 -14
- package/dist/utils/vendor/acl/Can.js +0 -18
- package/dist/utils/vendor/acl/ability.context.js +0 -37
- package/dist/utils/vendor/auth/AuthGuard.js +0 -26
- package/dist/utils/vendor/auth/auth.context.js +0 -41
- package/dist/utils/vendor/error-handling.js +0 -119
- package/dist/utils/vendor/rest-interceptor.js +0 -21
- package/dist/utils/zod.utils.js +0 -21
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { mergeRefs } from "@react-aria/utils";
|
|
3
|
-
import { clsx } from "clsx";
|
|
4
|
-
import { useRef, useMemo, Fragment } from "react";
|
|
5
|
-
import { useLabel } from "react-aria";
|
|
6
|
-
import { ComboBox, DialogTrigger, Popover } from "react-aria-components";
|
|
7
|
-
import useMeasure from "react-use-measure";
|
|
8
|
-
import { FormField } from "../../FormField/FormField.js";
|
|
9
|
-
import { SelectInput } from "./SelectInput.js";
|
|
10
|
-
import { SelectListBox } from "./SelectListBox.js";
|
|
11
|
-
import { SelectContext } from "./select.context.js";
|
|
12
|
-
import { SelectAllItemId } from "./useSelectItems.js";
|
|
13
|
-
import { TooltipWrapper } from "../../shared/TooltipWrapper.js";
|
|
14
|
-
const SelectDesktop = ({
|
|
15
|
-
ref,
|
|
16
|
-
error,
|
|
17
|
-
ignoreTriggerWidth,
|
|
18
|
-
showSelectionContent,
|
|
19
|
-
inputClassName,
|
|
20
|
-
containerClassName,
|
|
21
|
-
customTrigger,
|
|
22
|
-
onBlur,
|
|
23
|
-
...props
|
|
24
|
-
}) => {
|
|
25
|
-
const {
|
|
26
|
-
label,
|
|
27
|
-
tooltipText,
|
|
28
|
-
helperText,
|
|
29
|
-
isRequired,
|
|
30
|
-
rightContent,
|
|
31
|
-
isHeaderHidden,
|
|
32
|
-
headerClassName,
|
|
33
|
-
errorClassName,
|
|
34
|
-
placeholder,
|
|
35
|
-
variant,
|
|
36
|
-
isDisabled,
|
|
37
|
-
className,
|
|
38
|
-
hideLabel,
|
|
39
|
-
hideDropdownIcon,
|
|
40
|
-
isSearchable,
|
|
41
|
-
isClearable,
|
|
42
|
-
isLoading,
|
|
43
|
-
as,
|
|
44
|
-
size,
|
|
45
|
-
collapseAfter,
|
|
46
|
-
selectedTagsType
|
|
47
|
-
} = props;
|
|
48
|
-
const formFieldProps = {
|
|
49
|
-
error,
|
|
50
|
-
label,
|
|
51
|
-
tooltipText,
|
|
52
|
-
helperText,
|
|
53
|
-
isRequired,
|
|
54
|
-
rightContent,
|
|
55
|
-
isHeaderHidden: isHeaderHidden || as === "inline" || as === "filter" || as === "floating",
|
|
56
|
-
hideLabel,
|
|
57
|
-
isDisabled,
|
|
58
|
-
headerClassName,
|
|
59
|
-
errorClassName
|
|
60
|
-
};
|
|
61
|
-
const { labelProps, fieldProps } = useLabel({ label });
|
|
62
|
-
const triggerRef = useRef(null);
|
|
63
|
-
const closeComboBoxRef = useRef(null);
|
|
64
|
-
const [wrapperRef, { width }] = useMeasure();
|
|
65
|
-
const {
|
|
66
|
-
fieldState,
|
|
67
|
-
isOpen,
|
|
68
|
-
setIsOpen,
|
|
69
|
-
onInputChange,
|
|
70
|
-
onChange,
|
|
71
|
-
onClear,
|
|
72
|
-
onSelectAll,
|
|
73
|
-
listItems,
|
|
74
|
-
selectableListItems,
|
|
75
|
-
selectedIds,
|
|
76
|
-
isMultiple
|
|
77
|
-
} = SelectContext.useSelect();
|
|
78
|
-
const onSelectionChange = (value) => {
|
|
79
|
-
if (!value) {
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
if (value === SelectAllItemId) {
|
|
83
|
-
if (selectedIds.length === selectableListItems.length) {
|
|
84
|
-
onClear();
|
|
85
|
-
} else {
|
|
86
|
-
onSelectAll();
|
|
87
|
-
}
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
if (!isMultiple) {
|
|
91
|
-
onChange(value);
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
if (!Array.isArray(fieldState.value)) {
|
|
95
|
-
onChange([value]);
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
if (fieldState.value.includes(value)) {
|
|
99
|
-
onChange(fieldState.value.filter((id) => id !== value));
|
|
100
|
-
} else {
|
|
101
|
-
onChange(fieldState.value.concat(value));
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
const openChangeHandler = (value) => {
|
|
105
|
-
if (closeComboBoxRef.current && value) {
|
|
106
|
-
closeComboBoxRef.current.setOpen(false);
|
|
107
|
-
closeComboBoxRef.current = null;
|
|
108
|
-
} else {
|
|
109
|
-
setIsOpen(value);
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
const WrapperComponent = isSearchable ? ComboBox : Fragment;
|
|
113
|
-
const comboBoxProps = {
|
|
114
|
-
items: listItems,
|
|
115
|
-
selectedKey: isMultiple ? null : fieldState.value,
|
|
116
|
-
onSelectionChange,
|
|
117
|
-
inputValue: fieldState.inputValue,
|
|
118
|
-
onInputChange,
|
|
119
|
-
onOpenChange: openChangeHandler,
|
|
120
|
-
allowsEmptyCollection: true,
|
|
121
|
-
isDisabled,
|
|
122
|
-
isInvalid: !!error,
|
|
123
|
-
menuTrigger: "focus",
|
|
124
|
-
className: clsx("w-full", containerClassName)
|
|
125
|
-
};
|
|
126
|
-
const headerProps = {
|
|
127
|
-
label,
|
|
128
|
-
tooltipText,
|
|
129
|
-
helperText,
|
|
130
|
-
isRequired,
|
|
131
|
-
rightContent,
|
|
132
|
-
isHeaderHidden: hideLabel || isHeaderHidden,
|
|
133
|
-
isDisabled,
|
|
134
|
-
className: headerClassName,
|
|
135
|
-
labelProps
|
|
136
|
-
};
|
|
137
|
-
const dialogTriggerProps = {
|
|
138
|
-
isOpen,
|
|
139
|
-
onOpenChange: setIsOpen
|
|
140
|
-
};
|
|
141
|
-
const showPopover = useMemo(
|
|
142
|
-
() => listItems.filter((item) => !item.isSelectAllItem).length > 0 || isLoading,
|
|
143
|
-
[listItems, isLoading]
|
|
144
|
-
);
|
|
145
|
-
return /* @__PURE__ */ jsx(
|
|
146
|
-
TooltipWrapper,
|
|
147
|
-
{
|
|
148
|
-
as,
|
|
149
|
-
error,
|
|
150
|
-
children: /* @__PURE__ */ jsx(WrapperComponent, { ...isSearchable ? comboBoxProps : {}, children: /* @__PURE__ */ jsxs(
|
|
151
|
-
FormField,
|
|
152
|
-
{
|
|
153
|
-
...formFieldProps,
|
|
154
|
-
...!isSearchable && {
|
|
155
|
-
labelProps,
|
|
156
|
-
className: clsx("w-full", containerClassName)
|
|
157
|
-
},
|
|
158
|
-
as,
|
|
159
|
-
ref: wrapperRef,
|
|
160
|
-
children: [
|
|
161
|
-
customTrigger ? /* @__PURE__ */ jsx(DialogTrigger, { ...dialogTriggerProps, children: /* @__PURE__ */ jsx(
|
|
162
|
-
"div",
|
|
163
|
-
{
|
|
164
|
-
...fieldProps,
|
|
165
|
-
ref: mergeRefs(ref, triggerRef),
|
|
166
|
-
children: customTrigger
|
|
167
|
-
}
|
|
168
|
-
) }) : /* @__PURE__ */ jsx(
|
|
169
|
-
SelectInput,
|
|
170
|
-
{
|
|
171
|
-
ref: mergeRefs(ref, triggerRef),
|
|
172
|
-
placeholder,
|
|
173
|
-
variant,
|
|
174
|
-
as,
|
|
175
|
-
size,
|
|
176
|
-
isDisabled,
|
|
177
|
-
isInvalid: !!error,
|
|
178
|
-
className,
|
|
179
|
-
hideDropdownIcon,
|
|
180
|
-
isSearchable,
|
|
181
|
-
isClearable,
|
|
182
|
-
showSelectionContent,
|
|
183
|
-
inputClassName,
|
|
184
|
-
collapseAfter,
|
|
185
|
-
selectedTagsType,
|
|
186
|
-
onBlur,
|
|
187
|
-
onCloseComboBox: (state) => {
|
|
188
|
-
if (isSearchable) {
|
|
189
|
-
closeComboBoxRef.current = state;
|
|
190
|
-
}
|
|
191
|
-
},
|
|
192
|
-
fieldProps,
|
|
193
|
-
headerProps
|
|
194
|
-
}
|
|
195
|
-
),
|
|
196
|
-
(!isSearchable || showPopover) && /* @__PURE__ */ jsx(
|
|
197
|
-
Popover,
|
|
198
|
-
{
|
|
199
|
-
triggerRef,
|
|
200
|
-
isOpen,
|
|
201
|
-
onOpenChange: setIsOpen,
|
|
202
|
-
className: "my-4 outline-none",
|
|
203
|
-
style: { width: !ignoreTriggerWidth ? width : void 0 },
|
|
204
|
-
offset: 0,
|
|
205
|
-
children: /* @__PURE__ */ jsx(
|
|
206
|
-
SelectListBox,
|
|
207
|
-
{
|
|
208
|
-
...props,
|
|
209
|
-
className: "max-h-80 rounded-list-rounding-dropdown border border-elevation-outline-default-1 bg-elevation-fill-default-1 shadow-5 [scrollbar-width:thin]",
|
|
210
|
-
autoFocus: !isSearchable
|
|
211
|
-
}
|
|
212
|
-
)
|
|
213
|
-
}
|
|
214
|
-
)
|
|
215
|
-
]
|
|
216
|
-
}
|
|
217
|
-
) })
|
|
218
|
-
}
|
|
219
|
-
);
|
|
220
|
-
};
|
|
221
|
-
export {
|
|
222
|
-
SelectDesktop
|
|
223
|
-
};
|
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { clsx } from "clsx";
|
|
3
|
-
import { use, useState, useMemo } from "react";
|
|
4
|
-
import { useHover, useFocusWithin, useFocusVisible } from "react-aria";
|
|
5
|
-
import { ComboBoxStateContext, Input, Button } from "react-aria-components";
|
|
6
|
-
import { useTranslation } from "react-i18next";
|
|
7
|
-
import useMeasure from "react-use-measure";
|
|
8
|
-
import { ArrowDropDownIcon } from "../../../../assets/icons/ArrowDropDown.js";
|
|
9
|
-
import { FormFieldLabel } from "../../FormField/FormFieldLabel.js";
|
|
10
|
-
import { SelectInputTags } from "./SelectInputTags.js";
|
|
11
|
-
import { SelectContext } from "./select.context.js";
|
|
12
|
-
import { InputClear } from "../../shared/InputClear.js";
|
|
13
|
-
import { inputSize, inputBase, inputSide } from "../../shared/input.cva.js";
|
|
14
|
-
import { Typography } from "../../../text/Typography/Typography.js";
|
|
15
|
-
import { ns } from "../../../../config/i18n.js";
|
|
16
|
-
import { UIStyle } from "../../../../config/uiStyle.context.js";
|
|
17
|
-
const SelectInput = ({
|
|
18
|
-
ref,
|
|
19
|
-
placeholder,
|
|
20
|
-
variant,
|
|
21
|
-
as,
|
|
22
|
-
size,
|
|
23
|
-
isDisabled,
|
|
24
|
-
isInvalid,
|
|
25
|
-
className,
|
|
26
|
-
hideDropdownIcon,
|
|
27
|
-
isSearchable,
|
|
28
|
-
isClearable,
|
|
29
|
-
showSelectionContent,
|
|
30
|
-
inputClassName,
|
|
31
|
-
fieldProps,
|
|
32
|
-
headerProps,
|
|
33
|
-
selectedTagsType,
|
|
34
|
-
collapseAfter,
|
|
35
|
-
onCloseComboBox,
|
|
36
|
-
onBlur,
|
|
37
|
-
...props
|
|
38
|
-
}) => {
|
|
39
|
-
const uiStyle = UIStyle.useConfig();
|
|
40
|
-
const inputSizeCva = uiStyle?.input?.sizeCva ?? inputSize;
|
|
41
|
-
const inputBaseCva = uiStyle?.input?.baseCva ?? inputBase;
|
|
42
|
-
const inputSideCva = uiStyle?.input?.sideCva ?? inputSide;
|
|
43
|
-
const { t } = useTranslation(ns);
|
|
44
|
-
const state = use(ComboBoxStateContext);
|
|
45
|
-
const { hoverProps, isHovered } = useHover({ isDisabled });
|
|
46
|
-
const [isFocused, setIsFocused] = useState(false);
|
|
47
|
-
const { focusWithinProps } = useFocusWithin({
|
|
48
|
-
onFocusWithinChange: setIsFocused
|
|
49
|
-
});
|
|
50
|
-
const { isFocusVisible } = useFocusVisible();
|
|
51
|
-
const [labelContentRef, { width: labelWidth }] = useMeasure();
|
|
52
|
-
const {
|
|
53
|
-
fieldState,
|
|
54
|
-
isOpen,
|
|
55
|
-
setIsOpen,
|
|
56
|
-
listItems,
|
|
57
|
-
selectedItems,
|
|
58
|
-
onChange,
|
|
59
|
-
onClear,
|
|
60
|
-
onRemove,
|
|
61
|
-
isMultiple,
|
|
62
|
-
isLoading
|
|
63
|
-
} = SelectContext.useSelect();
|
|
64
|
-
const isEmpty = selectedItems.length === 0;
|
|
65
|
-
const showTags = isMultiple && !isEmpty;
|
|
66
|
-
const showClearButton = isClearable && isHovered && (selectedItems.length > 0 || isSearchable && fieldState.inputValue !== "");
|
|
67
|
-
const style = useMemo(() => {
|
|
68
|
-
if (as !== "filter") {
|
|
69
|
-
return {};
|
|
70
|
-
}
|
|
71
|
-
const paddingLeft = `calc(${isSearchable || showTags ? "1 * " : "2 * "}var(${inputSideCva({ size, type: "var" })}) + ${labelWidth}px)`;
|
|
72
|
-
return {
|
|
73
|
-
paddingLeft
|
|
74
|
-
};
|
|
75
|
-
}, [labelWidth, as, size, isSearchable, showTags, inputSideCva]);
|
|
76
|
-
const labelProps = useMemo(() => {
|
|
77
|
-
const { labelProps: headerLabelProps } = headerProps ?? {};
|
|
78
|
-
const isFilterOrFloating = as && ["filter", "floating"].includes(as);
|
|
79
|
-
if (!isFilterOrFloating || isSearchable) {
|
|
80
|
-
return headerLabelProps;
|
|
81
|
-
}
|
|
82
|
-
return {
|
|
83
|
-
...headerLabelProps,
|
|
84
|
-
className: clsx(headerLabelProps?.className, "pointer-events-none")
|
|
85
|
-
};
|
|
86
|
-
}, [as, headerProps, isSearchable]);
|
|
87
|
-
const onKeyDown = (e) => {
|
|
88
|
-
if (e.key === "Enter" && !isMultiple && !isLoading && listItems.length === 1 && !listItems[0].isDisabled) {
|
|
89
|
-
e.preventDefault();
|
|
90
|
-
onChange(listItems[0].id);
|
|
91
|
-
onCloseComboBox?.(state);
|
|
92
|
-
}
|
|
93
|
-
if (e.key === "Backspace" && isMultiple && fieldState.inputValue === "" && Array.isArray(fieldState.value) && fieldState.value.length > 0) {
|
|
94
|
-
onChange(fieldState.value.slice(0, -1));
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
return /* @__PURE__ */ jsxs(
|
|
98
|
-
"div",
|
|
99
|
-
{
|
|
100
|
-
ref,
|
|
101
|
-
className: inputBaseCva({
|
|
102
|
-
variant,
|
|
103
|
-
as,
|
|
104
|
-
...props,
|
|
105
|
-
className: clsx("group/select-content relative flex px-0!", isSearchable && "cursor-text", className)
|
|
106
|
-
}),
|
|
107
|
-
"data-rac": "",
|
|
108
|
-
"data-disabled": isDisabled,
|
|
109
|
-
"data-hovered": isHovered || void 0,
|
|
110
|
-
"data-focused": isOpen || isFocused || void 0,
|
|
111
|
-
"data-focus-within": isFocused || void 0,
|
|
112
|
-
"data-searchable-focus-within": isFocused && isSearchable || void 0,
|
|
113
|
-
"data-focus-visible": isFocused && isFocusVisible || void 0,
|
|
114
|
-
"data-has-selection": !isEmpty || void 0,
|
|
115
|
-
"data-has-search": fieldState.searchValue !== "" || void 0,
|
|
116
|
-
"data-invalid": isInvalid || void 0,
|
|
117
|
-
"data-is-empty": isEmpty || void 0,
|
|
118
|
-
...hoverProps,
|
|
119
|
-
...focusWithinProps,
|
|
120
|
-
children: [
|
|
121
|
-
/* @__PURE__ */ jsxs("div", { className: clsx("relative flex flex-1 items-center truncate", showTags && inputSizeCva({ size, ...props })), children: [
|
|
122
|
-
as && ["filter", "floating"].includes(as) && headerProps && /* @__PURE__ */ jsx(
|
|
123
|
-
FormFieldLabel,
|
|
124
|
-
{
|
|
125
|
-
ref: labelContentRef,
|
|
126
|
-
as,
|
|
127
|
-
...headerProps,
|
|
128
|
-
labelProps
|
|
129
|
-
}
|
|
130
|
-
),
|
|
131
|
-
(showTags || isSearchable) && /* @__PURE__ */ jsxs(
|
|
132
|
-
"div",
|
|
133
|
-
{
|
|
134
|
-
className: clsx("flex flex-1 flex-wrap gap-2 truncate", !isSearchable && "pointer-events-none z-1"),
|
|
135
|
-
style,
|
|
136
|
-
children: [
|
|
137
|
-
showTags && /* @__PURE__ */ jsx(
|
|
138
|
-
SelectInputTags,
|
|
139
|
-
{
|
|
140
|
-
selectedItems,
|
|
141
|
-
isDisabled,
|
|
142
|
-
collapseAfter,
|
|
143
|
-
selectedTagsType,
|
|
144
|
-
onRemove
|
|
145
|
-
}
|
|
146
|
-
),
|
|
147
|
-
isSearchable && /* @__PURE__ */ jsx(
|
|
148
|
-
Input,
|
|
149
|
-
{
|
|
150
|
-
placeholder,
|
|
151
|
-
onBlur,
|
|
152
|
-
className: clsx(
|
|
153
|
-
"flex-1 bg-transparent outline-none placeholder:text-text-default-3 disabled:text-interactive-text-secondary-disabled",
|
|
154
|
-
!showTags && inputSizeCva({
|
|
155
|
-
size,
|
|
156
|
-
...props,
|
|
157
|
-
className: "rounded-input-rounding-default"
|
|
158
|
-
}),
|
|
159
|
-
inputClassName
|
|
160
|
-
),
|
|
161
|
-
onKeyDown,
|
|
162
|
-
...fieldProps
|
|
163
|
-
}
|
|
164
|
-
)
|
|
165
|
-
]
|
|
166
|
-
}
|
|
167
|
-
),
|
|
168
|
-
!isSearchable && /* @__PURE__ */ jsx(
|
|
169
|
-
Button,
|
|
170
|
-
{
|
|
171
|
-
isDisabled,
|
|
172
|
-
onPress: () => setIsOpen(!isOpen),
|
|
173
|
-
onBlur,
|
|
174
|
-
"data-type": "select-trigger",
|
|
175
|
-
className: inputSizeCva({
|
|
176
|
-
size,
|
|
177
|
-
...props,
|
|
178
|
-
className: clsx(
|
|
179
|
-
"w-full truncate text-start outline-none disabled:text-interactive-text-secondary-disabled",
|
|
180
|
-
showTags && "absolute inset-0 z-0"
|
|
181
|
-
)
|
|
182
|
-
}),
|
|
183
|
-
style,
|
|
184
|
-
...fieldProps,
|
|
185
|
-
children: (isEmpty || !isMultiple) && /* @__PURE__ */ jsxs(
|
|
186
|
-
Typography,
|
|
187
|
-
{
|
|
188
|
-
size: "label-1",
|
|
189
|
-
className: clsx(
|
|
190
|
-
"truncate empty:before:inline-block empty:before:content-['']",
|
|
191
|
-
isEmpty && "text-text-default-3"
|
|
192
|
-
),
|
|
193
|
-
children: [
|
|
194
|
-
isEmpty && placeholder,
|
|
195
|
-
!isEmpty && (showSelectionContent ? selectedItems[0].content : selectedItems[0].label)
|
|
196
|
-
]
|
|
197
|
-
}
|
|
198
|
-
)
|
|
199
|
-
}
|
|
200
|
-
)
|
|
201
|
-
] }),
|
|
202
|
-
showClearButton && /* @__PURE__ */ jsx(InputClear, { onClear }),
|
|
203
|
-
!hideDropdownIcon && /* @__PURE__ */ jsx(
|
|
204
|
-
Button,
|
|
205
|
-
{
|
|
206
|
-
excludeFromTabOrder: true,
|
|
207
|
-
"aria-label": t(($) => isOpen ? $.ui.closeAlt : $.ui.openAlt),
|
|
208
|
-
className: clsx("self-stretch pl-1-5 outline-none", inputSizeCva({ size })),
|
|
209
|
-
isDisabled,
|
|
210
|
-
onPress: () => {
|
|
211
|
-
if (!isSearchable) {
|
|
212
|
-
setIsOpen(!isOpen);
|
|
213
|
-
}
|
|
214
|
-
},
|
|
215
|
-
children: /* @__PURE__ */ jsx(
|
|
216
|
-
ArrowDropDownIcon,
|
|
217
|
-
{
|
|
218
|
-
className: clsx(
|
|
219
|
-
"size-6 shrink-0",
|
|
220
|
-
isOpen && "rotate-180",
|
|
221
|
-
isDisabled ? "text-interactive-text-secondary-disabled" : "text-interactive-text-secondary-idle"
|
|
222
|
-
),
|
|
223
|
-
"aria-hidden": "true"
|
|
224
|
-
}
|
|
225
|
-
)
|
|
226
|
-
}
|
|
227
|
-
)
|
|
228
|
-
]
|
|
229
|
-
}
|
|
230
|
-
);
|
|
231
|
-
};
|
|
232
|
-
export {
|
|
233
|
-
SelectInput
|
|
234
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo } from "react";
|
|
3
|
-
import { Tag } from "../../../text/Tag/Tag.js";
|
|
4
|
-
const SelectInputTags = ({
|
|
5
|
-
selectedItems,
|
|
6
|
-
isDisabled,
|
|
7
|
-
selectedTagsType,
|
|
8
|
-
collapseAfter,
|
|
9
|
-
onRemove
|
|
10
|
-
}) => {
|
|
11
|
-
const { displayedItems, remainingCount } = useMemo(() => {
|
|
12
|
-
if (!collapseAfter || selectedItems.length <= collapseAfter) {
|
|
13
|
-
return { displayedItems: selectedItems, remainingCount: 0 };
|
|
14
|
-
}
|
|
15
|
-
return {
|
|
16
|
-
displayedItems: selectedItems.slice(0, collapseAfter - 1),
|
|
17
|
-
remainingCount: selectedItems.length - (collapseAfter - 1)
|
|
18
|
-
};
|
|
19
|
-
}, [selectedItems, collapseAfter]);
|
|
20
|
-
if (selectedTagsType === "tags") {
|
|
21
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
22
|
-
displayedItems.map((item) => /* @__PURE__ */ jsx(
|
|
23
|
-
Tag,
|
|
24
|
-
{
|
|
25
|
-
dismissable: true,
|
|
26
|
-
isDisabled,
|
|
27
|
-
onDismiss: () => onRemove(item.id),
|
|
28
|
-
excludeFromTabOrder: true,
|
|
29
|
-
className: "z-1",
|
|
30
|
-
children: item.label
|
|
31
|
-
},
|
|
32
|
-
item.id
|
|
33
|
-
)),
|
|
34
|
-
remainingCount > 0 && /* @__PURE__ */ jsx(
|
|
35
|
-
Tag,
|
|
36
|
-
{
|
|
37
|
-
isDisabled,
|
|
38
|
-
excludeFromTabOrder: true,
|
|
39
|
-
children: `+${remainingCount} more`
|
|
40
|
-
},
|
|
41
|
-
"remaining-count"
|
|
42
|
-
)
|
|
43
|
-
] });
|
|
44
|
-
}
|
|
45
|
-
return /* @__PURE__ */ jsx("p", { children: selectedItems.map((item) => item.label).join(", ") });
|
|
46
|
-
};
|
|
47
|
-
export {
|
|
48
|
-
SelectInputTags
|
|
49
|
-
};
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { clsx } from "clsx";
|
|
3
|
-
import { Virtualizer, ListLayout, ListBox } from "react-aria-components";
|
|
4
|
-
import { SelectListBoxItem } from "./SelectListBoxItem.js";
|
|
5
|
-
import { SelectListBoxItemSelectAll } from "./SelectListBoxItemSelectAll.js";
|
|
6
|
-
import { SelectListBoxLoadingItem } from "./SelectListBoxLoadingItem.js";
|
|
7
|
-
import { SelectContext } from "./select.context.js";
|
|
8
|
-
import { SelectAllItemId } from "./useSelectItems.js";
|
|
9
|
-
const SelectListBox = ({
|
|
10
|
-
label,
|
|
11
|
-
selectionMode,
|
|
12
|
-
isSearchable,
|
|
13
|
-
isScrollable = true,
|
|
14
|
-
virtualizerOptions,
|
|
15
|
-
newItemRender,
|
|
16
|
-
onLoadMore,
|
|
17
|
-
className,
|
|
18
|
-
onClose,
|
|
19
|
-
...props
|
|
20
|
-
}) => {
|
|
21
|
-
const { fieldState, onChange, listItems, selectableListItems, selectedIds, isMultiple, onClear, onSelectAll } = SelectContext.useSelect();
|
|
22
|
-
const onSelectionChange = (value) => {
|
|
23
|
-
const ids = Array.from(value);
|
|
24
|
-
if (!isMultiple && ids.length === 0) {
|
|
25
|
-
if (fieldState.value) {
|
|
26
|
-
onClose?.();
|
|
27
|
-
onChange(fieldState.value);
|
|
28
|
-
}
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
if (isMultiple && ids.includes(SelectAllItemId)) {
|
|
32
|
-
if (ids.length > selectableListItems.length) {
|
|
33
|
-
onClear();
|
|
34
|
-
} else {
|
|
35
|
-
onSelectAll();
|
|
36
|
-
}
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
if (isMultiple) {
|
|
40
|
-
onChange(ids);
|
|
41
|
-
} else {
|
|
42
|
-
onClose?.();
|
|
43
|
-
onChange(ids[0]);
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
const renderItem = (item) => {
|
|
47
|
-
if (item.isSelectAllItem) {
|
|
48
|
-
return /* @__PURE__ */ jsx(
|
|
49
|
-
SelectListBoxItemSelectAll,
|
|
50
|
-
{
|
|
51
|
-
...item
|
|
52
|
-
},
|
|
53
|
-
item.id
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
if (item.isLoadingItem) {
|
|
57
|
-
return /* @__PURE__ */ jsx(
|
|
58
|
-
SelectListBoxLoadingItem,
|
|
59
|
-
{
|
|
60
|
-
...item,
|
|
61
|
-
onLoadMore
|
|
62
|
-
},
|
|
63
|
-
item.id
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
return /* @__PURE__ */ jsx(
|
|
67
|
-
SelectListBoxItem,
|
|
68
|
-
{
|
|
69
|
-
...item,
|
|
70
|
-
isSearchable,
|
|
71
|
-
isNewItem: item.isNewItem,
|
|
72
|
-
newItemRender
|
|
73
|
-
},
|
|
74
|
-
item.id
|
|
75
|
-
);
|
|
76
|
-
};
|
|
77
|
-
if (virtualizerOptions || listItems.length > 100) {
|
|
78
|
-
return /* @__PURE__ */ jsx(
|
|
79
|
-
Virtualizer,
|
|
80
|
-
{
|
|
81
|
-
layout: ListLayout,
|
|
82
|
-
layoutOptions: virtualizerOptions,
|
|
83
|
-
children: /* @__PURE__ */ jsx(
|
|
84
|
-
ListBox,
|
|
85
|
-
{
|
|
86
|
-
...props,
|
|
87
|
-
"aria-label": label,
|
|
88
|
-
selectionMode,
|
|
89
|
-
className: clsx(
|
|
90
|
-
"flex-1 outline-none [&>div:last-child>*]:border-b-0",
|
|
91
|
-
isScrollable ? "overflow-y-auto overflow-x-hidden" : "overflow-hidden",
|
|
92
|
-
className
|
|
93
|
-
),
|
|
94
|
-
items: listItems,
|
|
95
|
-
selectedKeys: selectedIds,
|
|
96
|
-
onSelectionChange,
|
|
97
|
-
escapeKeyBehavior: "none",
|
|
98
|
-
shouldSelectOnPressUp: true,
|
|
99
|
-
children: renderItem
|
|
100
|
-
}
|
|
101
|
-
)
|
|
102
|
-
}
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
return /* @__PURE__ */ jsx(
|
|
106
|
-
ListBox,
|
|
107
|
-
{
|
|
108
|
-
...props,
|
|
109
|
-
"aria-label": label,
|
|
110
|
-
selectionMode,
|
|
111
|
-
className: clsx(
|
|
112
|
-
"flex-1 outline-none [&>div:last-child]:border-b-0",
|
|
113
|
-
isScrollable ? "overflow-y-auto overflow-x-hidden" : "overflow-hidden",
|
|
114
|
-
className
|
|
115
|
-
),
|
|
116
|
-
items: listItems,
|
|
117
|
-
selectedKeys: selectedIds,
|
|
118
|
-
onSelectionChange,
|
|
119
|
-
escapeKeyBehavior: "none",
|
|
120
|
-
shouldSelectOnPressUp: true,
|
|
121
|
-
children: renderItem
|
|
122
|
-
}
|
|
123
|
-
);
|
|
124
|
-
};
|
|
125
|
-
export {
|
|
126
|
-
SelectListBox
|
|
127
|
-
};
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { clsx } from "clsx";
|
|
3
|
-
import { useRef, useMemo } from "react";
|
|
4
|
-
import { ListBoxItem } from "react-aria-components";
|
|
5
|
-
import { useTranslation } from "react-i18next";
|
|
6
|
-
import { CheckboxCheckmark } from "../../Checkbox/CheckboxCheckmark.js";
|
|
7
|
-
import { SelectContext } from "./select.context.js";
|
|
8
|
-
import { ns } from "../../../../config/i18n.js";
|
|
9
|
-
const SelectListBoxItem = ({
|
|
10
|
-
isSearchable,
|
|
11
|
-
isNewItem,
|
|
12
|
-
newItemRender,
|
|
13
|
-
id,
|
|
14
|
-
label,
|
|
15
|
-
content,
|
|
16
|
-
isDisabled
|
|
17
|
-
}) => {
|
|
18
|
-
const ref = useRef(null);
|
|
19
|
-
const { t } = useTranslation(ns);
|
|
20
|
-
const { selectedIds, isMultiple } = SelectContext.useSelect();
|
|
21
|
-
const itemContent = useMemo(() => {
|
|
22
|
-
if (isNewItem) {
|
|
23
|
-
return newItemRender?.(label) ?? `${t(($) => $.ui.autocomplete.createNewBtn)} '${label}'`;
|
|
24
|
-
}
|
|
25
|
-
return content ?? label;
|
|
26
|
-
}, [isNewItem, newItemRender, label, content, t]);
|
|
27
|
-
return /* @__PURE__ */ jsxs(
|
|
28
|
-
ListBoxItem,
|
|
29
|
-
{
|
|
30
|
-
ref,
|
|
31
|
-
id,
|
|
32
|
-
textValue: label,
|
|
33
|
-
isDisabled,
|
|
34
|
-
className: clsx(
|
|
35
|
-
selectListBoxItemClass,
|
|
36
|
-
!isMultiple && "selected:bg-interactive-contained-primary-idle selected:text-interactive-contained-primary-on-idle",
|
|
37
|
-
isNewItem ? "text-interactive-text-primary-idle" : "text-interactive-text-secondary-idle"
|
|
38
|
-
),
|
|
39
|
-
children: [
|
|
40
|
-
isMultiple && !isSearchable && /* @__PURE__ */ jsx(
|
|
41
|
-
CheckboxCheckmark,
|
|
42
|
-
{
|
|
43
|
-
variant: "default",
|
|
44
|
-
className: "group-focus-visible:outline-none!"
|
|
45
|
-
}
|
|
46
|
-
),
|
|
47
|
-
isMultiple && isSearchable && /* @__PURE__ */ jsx(
|
|
48
|
-
"div",
|
|
49
|
-
{
|
|
50
|
-
className: "group",
|
|
51
|
-
"data-rac": "",
|
|
52
|
-
"data-selected": selectedIds.includes(id) || void 0,
|
|
53
|
-
children: /* @__PURE__ */ jsx(
|
|
54
|
-
CheckboxCheckmark,
|
|
55
|
-
{
|
|
56
|
-
variant: "default",
|
|
57
|
-
className: "group-focus-visible:outline-none!"
|
|
58
|
-
}
|
|
59
|
-
)
|
|
60
|
-
}
|
|
61
|
-
),
|
|
62
|
-
itemContent
|
|
63
|
-
]
|
|
64
|
-
}
|
|
65
|
-
);
|
|
66
|
-
};
|
|
67
|
-
const selectListBoxItemClass = clsx(
|
|
68
|
-
"group flex cursor-pointer items-center gap-2 px-list-side-item py-list-height-item",
|
|
69
|
-
"border-b border-b-elevation-outline-default-1 outline-none",
|
|
70
|
-
"font-labels-default text-interactive-text-secondary-idle text-label-2",
|
|
71
|
-
"hover:text-interactive-text-secondary-hover",
|
|
72
|
-
"focus-visible:bg-interactive-contained-primary-focus focus-visible:text-interactive-text-secondary-idle-inverted",
|
|
73
|
-
"disabled:cursor-default disabled:text-interactive-text-secondary-disabled"
|
|
74
|
-
);
|
|
75
|
-
export {
|
|
76
|
-
SelectListBoxItem,
|
|
77
|
-
selectListBoxItemClass
|
|
78
|
-
};
|