@povio/ui 2.2.0 → 2.2.2
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 +9 -2
- package/dist/{rolldown_runtime.js → _virtual/rolldown:runtime.js} +17 -2
- package/dist/{HighlightOn.js → assets/icons/HighlightOn.js} +1 -1
- package/dist/{TextColor.js → assets/icons/TextColor.js} +1 -1
- package/dist/{Breadcrumbs.js → components/Breadcrumbs/Breadcrumbs.js} +11 -12
- package/dist/components/Menu/Menu.d.ts +0 -1
- package/dist/{Menu2.js → components/Menu/Menu.js} +1 -1
- package/dist/components/Menu/MenuDesktop.d.ts +1 -1
- package/dist/components/Menu/MenuDesktop.js +12 -0
- package/dist/{MenuItem.js → components/Menu/MenuItem.js} +4 -4
- package/dist/{MenuMobile.js → components/Menu/MenuMobile.js} +6 -7
- package/dist/{MenuPopover.js → components/Menu/MenuPopover.js} +10 -9
- package/dist/components/buttons/Button/Button.d.ts +3 -3
- package/dist/components/buttons/Button/Button.js +64 -0
- package/dist/{button.cva.js → components/buttons/Button/button.cva.js} +3 -12
- package/dist/components/buttons/IconButton/IconButton.d.ts +1 -1
- package/dist/components/buttons/IconButton/IconButton.js +17 -0
- package/dist/{InlineIconButton.js → components/buttons/InlineIconButton/InlineIconButton.js} +2 -2
- package/dist/components/buttons/PillButton/PillButton.d.ts +3 -2
- package/dist/components/buttons/PillButton/PillButton.js +32 -0
- package/dist/{pillButton.cva.js → components/buttons/PillButton/pillButton.cva.js} +4 -4
- package/dist/{SplitButton.js → components/buttons/SplitButton/SplitButton.js} +5 -5
- package/dist/components/buttons/TextButton/TextButton.d.ts +0 -1
- package/dist/{TextButton.js → components/buttons/TextButton/TextButton.js} +2 -3
- package/dist/components/buttons/ToggleButton/ToggleButton.d.ts +0 -1
- package/dist/{ToggleButton.js → components/buttons/ToggleButton/ToggleButton.js} +2 -3
- package/dist/components/buttons/shared/ButtonContent.d.ts +3 -5
- package/dist/components/buttons/shared/ButtonContent.js +35 -0
- package/dist/components/buttons/shared/buttonContent.cva.d.ts +4 -0
- package/dist/components/buttons/shared/buttonContent.cva.js +36 -0
- package/dist/{Checkbox.js → components/inputs/Checkbox/Checkbox.js} +8 -8
- package/dist/{CheckboxCheckmark2.js → components/inputs/Checkbox/CheckboxCheckmark.js} +6 -7
- package/dist/{checkbox.cva.js → components/inputs/Checkbox/checkbox.cva.js} +2 -2
- package/dist/{DatePicker.js → components/inputs/DateTime/DatePicker/DatePicker.js} +13 -17
- package/dist/{DateRangePicker.js → components/inputs/DateTime/DateRangePicker/DateRangePicker.js} +16 -23
- package/dist/{DateTimePicker.js → components/inputs/DateTime/DateTimePicker/DateTimePicker.js} +12 -14
- package/dist/{TimePicker.js → components/inputs/DateTime/TimePicker/TimePicker.js} +10 -10
- package/dist/{Calendar2.js → components/inputs/DateTime/shared/Calendar.js} +1 -1
- package/dist/{CalendarCell.js → components/inputs/DateTime/shared/CalendarCell.js} +2 -2
- package/dist/{CalendarGrid.js → components/inputs/DateTime/shared/CalendarGrid.js} +2 -2
- package/dist/{CalendarHeader.js → components/inputs/DateTime/shared/CalendarHeader.js} +5 -5
- package/dist/{CalendarSelectHeader.js → components/inputs/DateTime/shared/CalendarSelectHeader.js} +9 -9
- package/dist/{DateField.js → components/inputs/DateTime/shared/DateField.js} +1 -1
- package/dist/{DatePickerInput.js → components/inputs/DateTime/shared/DatePickerInput.js} +73 -88
- package/dist/{DateTimeDialog.js → components/inputs/DateTime/shared/DateTimeDialog.js} +4 -4
- package/dist/{DateTimeDialogFooter.js → components/inputs/DateTime/shared/DateTimeDialogFooter.js} +2 -2
- package/dist/{MonthPicker.js → components/inputs/DateTime/shared/MonthPicker.js} +1 -1
- package/dist/{TimePickerForm.js → components/inputs/DateTime/shared/TimePickerForm.js} +6 -6
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +88 -0
- package/dist/{YearPicker.js → components/inputs/DateTime/shared/YearPicker.js} +2 -2
- package/dist/{FileUpload.js → components/inputs/File/FileUpload.js} +10 -10
- package/dist/{InputUpload.js → components/inputs/File/InputUpload.js} +7 -7
- package/dist/{FileUploadContent.js → components/inputs/File/shared/FileUploadContent.js} +1 -1
- package/dist/{FileUploadContentEmpty.js → components/inputs/File/shared/FileUploadContentEmpty.js} +4 -4
- package/dist/{FileUploadContentError.js → components/inputs/File/shared/FileUploadContentError.js} +7 -7
- package/dist/{FileUploadContentFilled.js → components/inputs/File/shared/FileUploadContentFilled.js} +8 -8
- package/dist/{FileUploadContentLoading.js → components/inputs/File/shared/FileUploadContentLoading.js} +7 -7
- package/dist/{InputUploadContent.js → components/inputs/File/shared/InputUploadContent.js} +9 -9
- package/dist/{InputUploadFilled.js → components/inputs/File/shared/InputUploadFilled.js} +6 -6
- package/dist/{ProgressBar.js → components/inputs/File/shared/ProgressBar.js} +1 -1
- package/dist/{fileUpload.cva.js → components/inputs/File/shared/fileUpload.cva.js} +1 -1
- package/dist/{inputUploadButton.cva.js → components/inputs/File/shared/inputUploadButton.cva.js} +1 -1
- package/dist/{FormField.js → components/inputs/FormField/FormField.js} +1 -1
- package/dist/components/inputs/FormField/FormFieldError.js +11 -0
- package/dist/{FormFieldHeader.js → components/inputs/FormField/FormFieldHeader.js} +3 -3
- package/dist/{FormFieldHeaderClose.js → components/inputs/FormField/FormFieldHeaderClose.js} +2 -2
- package/dist/components/inputs/FormField/FormFieldLabel.d.ts +2 -1
- package/dist/components/inputs/FormField/FormFieldLabel.js +25 -0
- package/dist/{NumberInput.js → components/inputs/Input/NumberInput/NumberInput.js} +35 -32
- package/dist/{PasswordInput.js → components/inputs/Input/PasswordInput/PasswordInput.js} +4 -4
- package/dist/{TextArea.js → components/inputs/Input/TextArea/TextArea.js} +23 -15
- package/dist/{TextInput.js → components/inputs/Input/TextInput/TextInput.js} +36 -33
- package/dist/components/inputs/Input/shared/InputContent.d.ts +2 -2
- package/dist/components/inputs/Input/shared/InputContent.js +74 -0
- package/dist/{Form.js → components/inputs/Inputs/Form.js} +4 -4
- package/dist/{InputItem.js → components/inputs/Inputs/InputItem.js} +15 -15
- package/dist/{RadioGroup.js → components/inputs/RadioGroup/RadioGroup.js} +8 -9
- package/dist/{radio.cva.js → components/inputs/RadioGroup/radio.cva.js} +2 -2
- package/dist/{Autocomplete.js → components/inputs/Selection/Autocomplete/Autocomplete.js} +2 -2
- package/dist/{QueryAutocomplete.js → components/inputs/Selection/Autocomplete/QueryAutocomplete.js} +1 -1
- package/dist/{Select.js → components/inputs/Selection/Select/Select.js} +2 -2
- package/dist/{SelectBase.js → components/inputs/Selection/shared/SelectBase.js} +2 -2
- package/dist/{SelectDesktop.js → components/inputs/Selection/shared/SelectDesktop.js} +21 -9
- package/dist/{SelectInput.js → components/inputs/Selection/shared/SelectInput.js} +31 -48
- package/dist/{SelectInputTags.js → components/inputs/Selection/shared/SelectInputTags.js} +1 -1
- package/dist/{SelectListBox.js → components/inputs/Selection/shared/SelectListBox.js} +1 -1
- package/dist/{SelectListBoxItem.js → components/inputs/Selection/shared/SelectListBoxItem.js} +2 -2
- package/dist/{SelectListBoxItemSelectAll.js → components/inputs/Selection/shared/SelectListBoxItemSelectAll.js} +2 -2
- package/dist/{SelectListBoxLoadingItem.js → components/inputs/Selection/shared/SelectListBoxLoadingItem.js} +3 -3
- package/dist/{SelectListBoxSelectionBar.js → components/inputs/Selection/shared/SelectListBoxSelectionBar.js} +2 -2
- package/dist/{SelectMobile.js → components/inputs/Selection/shared/SelectMobile.js} +6 -6
- package/dist/{select.context.js → components/inputs/Selection/shared/select.context.js} +2 -2
- package/dist/{Slider.js → components/inputs/Slider/Slider.js} +6 -6
- package/dist/{TextEditor.js → components/inputs/TextEditor/TextEditor.js} +14 -7
- package/dist/{ColorPickerDropdown.js → components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js} +3 -3
- package/dist/{HyperlinkAction.js → components/inputs/TextEditor/Toolbar/HyperlinkAction.js} +6 -6
- package/dist/{TextAlignSelect.js → components/inputs/TextEditor/Toolbar/TextAlignSelect.js} +6 -6
- package/dist/{TextColorSelect.js → components/inputs/TextEditor/Toolbar/TextColorSelect.js} +2 -2
- package/dist/{TextHighlightSelect.js → components/inputs/TextEditor/Toolbar/TextHighlightSelect.js} +3 -3
- package/dist/{TextListActions.js → components/inputs/TextEditor/Toolbar/TextListActions.js} +4 -4
- package/dist/{TextMarksActions.js → components/inputs/TextEditor/Toolbar/TextMarksActions.js} +6 -6
- package/dist/{TextStyleSelect.js → components/inputs/TextEditor/Toolbar/TextStyleSelect.js} +3 -3
- package/dist/{Toggle.js → components/inputs/Toggle/Toggle.js} +8 -9
- package/dist/{toggle.cva.js → components/inputs/Toggle/toggle.cva.js} +2 -2
- package/dist/{CheckContent.js → components/inputs/shared/CheckContent.js} +4 -4
- package/dist/components/inputs/shared/InputClear.d.ts +2 -1
- package/dist/components/inputs/shared/InputClear.js +19 -0
- package/dist/{TooltipWrapper.js → components/inputs/shared/TooltipWrapper.js} +1 -1
- package/dist/components/inputs/shared/input.cva.d.ts +4 -4
- package/dist/{input.cva.js → components/inputs/shared/input.cva.js} +38 -29
- package/dist/components/inputs/shared/label.cva.d.ts +2 -2
- package/dist/components/inputs/shared/label.cva.js +64 -0
- package/dist/{Accordion.js → components/navigation/Accordion/Accordion.js} +2 -2
- package/dist/{AccordionItem.js → components/navigation/Accordion/AccordionItem.js} +12 -13
- package/dist/{Stepper.js → components/navigation/Stepper/Stepper.js} +2 -2
- package/dist/{StepperItem.js → components/navigation/Stepper/StepperItem.js} +8 -9
- package/dist/{StepperSeparator.js → components/navigation/Stepper/StepperSeparator.js} +2 -2
- package/dist/{outline.clsx.js → components/outline.clsx.js} +1 -1
- package/dist/components/overlays/ActionModal/ActionModal.d.ts +6 -1
- package/dist/{ActionModal.js → components/overlays/ActionModal/ActionModal.js} +10 -9
- package/dist/{BottomSheet.js → components/overlays/BottomSheet/BottomSheet.js} +7 -7
- package/dist/{Drawer.js → components/overlays/Drawer/Drawer.js} +1 -1
- package/dist/components/overlays/Modal/Modal.d.ts +2 -1
- package/dist/{Modal.js → components/overlays/Modal/Modal.js} +9 -9
- package/dist/{ResponsivePopover.js → components/overlays/ResponsivePopover/ResponsivePopover.js} +4 -4
- package/dist/{Tooltip.js → components/overlays/Tooltip/Tooltip.js} +11 -11
- package/dist/components/overlays/Tooltip/TooltipEllipsis.d.ts +3 -2
- package/dist/{TooltipEllipsis.js → components/overlays/Tooltip/TooltipEllipsis.js} +2 -1
- package/dist/{Segment.js → components/segment/Segment.js} +5 -6
- package/dist/{SegmentItem.js → components/segment/SegmentItem.js} +4 -4
- package/dist/{Pagination.js → components/shared/pagination/Pagination.js} +3 -3
- package/dist/{PaginationList.js → components/shared/pagination/PaginationList.js} +6 -6
- package/dist/{Alert.js → components/status/Alert/Alert.js} +7 -8
- package/dist/{Loader.js → components/status/Loader/Loader.js} +1 -1
- package/dist/{Toast.js → components/status/Toast/Toast.js} +10 -11
- package/dist/{toast.cva.js → components/status/Toast/toast.cva.js} +1 -1
- package/dist/{CellText.js → components/table/CellText.js} +1 -1
- package/dist/{ColumnConfig.js → components/table/ColumnConfig.js} +5 -5
- package/dist/{HeaderText.js → components/table/HeaderText.js} +1 -1
- package/dist/{InfiniteTable.js → components/table/InfiniteTable.js} +3 -3
- package/dist/{PaginatedTable.js → components/table/PaginatedTable.js} +2 -2
- package/dist/{Table.js → components/table/Table.js} +25 -20
- package/dist/{table.cva.js → components/table/table.cva.js} +1 -1
- package/dist/{Link2.js → components/text/Link/Link.js} +4 -4
- package/dist/{link.cva.js → components/text/Link/link.cva.js} +1 -1
- package/dist/components/text/Tag/Tag.d.ts +3 -1
- package/dist/components/text/Tag/Tag.js +38 -0
- package/dist/{tag.cva.js → components/text/Tag/tag.cva.js} +1 -1
- package/dist/components/text/Typography/Typography.d.ts +1 -1
- package/dist/{Typography.js → components/text/Typography/Typography.js} +3 -3
- package/dist/{confirmation.context.js → config/confirmation.context.js} +1 -1
- package/dist/config/i18n.js +8 -0
- package/dist/{theme.context.js → config/theme.context.js} +1 -1
- package/dist/config/uiConfig.context.d.ts +4 -0
- package/dist/{uiConfig.context.js → config/uiConfig.context.js} +13 -2
- package/dist/config/uiStyle.context.d.ts +7 -3
- package/dist/config/uiStyle.context.js +28 -0
- package/dist/{dynamicColumns.js → helpers/dynamicColumns.js} +3 -3
- package/dist/{dynamicInputs.js → helpers/dynamicInputs.js} +2 -2
- package/dist/{useAutosave.js → hooks/useAutosave.js} +2 -2
- package/dist/{useDeepCompare.js → hooks/useDeepCompare.js} +1 -1
- package/dist/{useFilters.js → hooks/useFilters.js} +1 -1
- package/dist/{useForm.js → hooks/useForm.js} +1 -1
- package/dist/{useFormAutosave.js → hooks/useFormAutosave.js} +2 -2
- package/dist/{usePagination.js → hooks/usePagination.js} +1 -1
- package/dist/{useSorting.js → hooks/useSorting.js} +1 -1
- package/dist/{useStateAndRef.js → hooks/useStateAndRef.js} +1 -1
- package/dist/{useTableNav.js → hooks/useTableNav.js} +1 -1
- package/dist/index.js +137 -137
- package/dist/node_modules/.pnpm/motion@12.23.28_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/motion/dist/es/react.js +10 -0
- package/dist/text-editor.js +1 -1
- package/dist/tw-ui-plugin.d.ts +3 -0
- package/dist/utils/compoundMapper.d.ts +1 -1
- package/package.json +25 -26
- package/dist/Button.js +0 -54
- package/dist/ButtonContent.js +0 -28
- package/dist/FormFieldError.js +0 -11
- package/dist/FormFieldLabel.js +0 -32
- package/dist/IconButton.js +0 -12
- package/dist/InputClear.js +0 -19
- package/dist/InputContent.js +0 -94
- package/dist/MenuDesktop.js +0 -54
- package/dist/PillButton.js +0 -37
- package/dist/Tag.js +0 -42
- package/dist/TimePickerInput.js +0 -105
- package/dist/buttonContent.cva.js +0 -10
- package/dist/i18n.js +0 -8
- package/dist/label.cva.js +0 -92
- package/dist/react.js +0 -6
- package/dist/uiStyle.context.js +0 -16
- /package/dist/{AlignCenter.js → assets/icons/AlignCenter.js} +0 -0
- /package/dist/{AlignLeft.js → assets/icons/AlignLeft.js} +0 -0
- /package/dist/{AlignLeftRight.js → assets/icons/AlignLeftRight.js} +0 -0
- /package/dist/{AlignRight.js → assets/icons/AlignRight.js} +0 -0
- /package/dist/{ArrowDropDown.js → assets/icons/ArrowDropDown.js} +0 -0
- /package/dist/{ArrowDropUp.js → assets/icons/ArrowDropUp.js} +0 -0
- /package/dist/{ArrowLeft.js → assets/icons/ArrowLeft.js} +0 -0
- /package/dist/{ArrowRight.js → assets/icons/ArrowRight.js} +0 -0
- /package/dist/{Bold.js → assets/icons/Bold.js} +0 -0
- /package/dist/{BulletedList.js → assets/icons/BulletedList.js} +0 -0
- /package/dist/{Calendar.js → assets/icons/Calendar.js} +0 -0
- /package/dist/{Check.js → assets/icons/Check.js} +0 -0
- /package/dist/{CheckCircle.js → assets/icons/CheckCircle.js} +0 -0
- /package/dist/{CheckboxCheckmark.js → assets/icons/CheckboxCheckmark.js} +0 -0
- /package/dist/{CheckboxIndeterminate.js → assets/icons/CheckboxIndeterminate.js} +0 -0
- /package/dist/{ChevronDown.js → assets/icons/ChevronDown.js} +0 -0
- /package/dist/{ChevronLeft.js → assets/icons/ChevronLeft.js} +0 -0
- /package/dist/{ChevronRight.js → assets/icons/ChevronRight.js} +0 -0
- /package/dist/{ChevronUp.js → assets/icons/ChevronUp.js} +0 -0
- /package/dist/{ChevronsLeft.js → assets/icons/ChevronsLeft.js} +0 -0
- /package/dist/{ChevronsRight.js → assets/icons/ChevronsRight.js} +0 -0
- /package/dist/{Clock.js → assets/icons/Clock.js} +0 -0
- /package/dist/{Close.js → assets/icons/Close.js} +0 -0
- /package/dist/{DateTime.js → assets/icons/DateTime.js} +0 -0
- /package/dist/{DragIndicator.js → assets/icons/DragIndicator.js} +0 -0
- /package/dist/{File.js → assets/icons/File.js} +0 -0
- /package/dist/{Highlight.js → assets/icons/Highlight.js} +0 -0
- /package/dist/{Home.js → assets/icons/Home.js} +0 -0
- /package/dist/{Info.js → assets/icons/Info.js} +0 -0
- /package/dist/{Italic.js → assets/icons/Italic.js} +0 -0
- /package/dist/{Link.js → assets/icons/Link.js} +0 -0
- /package/dist/{Menu.js → assets/icons/Menu.js} +0 -0
- /package/dist/{NumberedList.js → assets/icons/NumberedList.js} +0 -0
- /package/dist/{PointerHorizontal.js → assets/icons/PointerHorizontal.js} +0 -0
- /package/dist/{PointerVertical.js → assets/icons/PointerVertical.js} +0 -0
- /package/dist/{Send.js → assets/icons/Send.js} +0 -0
- /package/dist/{Strikethrough.js → assets/icons/Strikethrough.js} +0 -0
- /package/dist/{Today.js → assets/icons/Today.js} +0 -0
- /package/dist/{Underlined.js → assets/icons/Underlined.js} +0 -0
- /package/dist/{Upload.js → assets/icons/Upload.js} +0 -0
- /package/dist/{Visibility.js → assets/icons/Visibility.js} +0 -0
- /package/dist/{VisibilityOff.js → assets/icons/VisibilityOff.js} +0 -0
- /package/dist/{WarningFilled.js → assets/icons/WarningFilled.js} +0 -0
- /package/dist/{translation.js → assets/locales/en/translation.json.js} +0 -0
- /package/dist/{translation2.js → assets/locales/sl/translation.json.js} +0 -0
- /package/dist/{breadcrumbs.cva.js → components/Breadcrumbs/breadcrumbs.cva.js} +0 -0
- /package/dist/{menu.cva.js → components/Menu/menu.cva.js} +0 -0
- /package/dist/{DateSegmentItem.js → components/inputs/DateTime/shared/DateSegmentItem.js} +0 -0
- /package/dist/{RangeCalendar.js → components/inputs/DateTime/shared/RangeCalendar.js} +0 -0
- /package/dist/{TimeField.js → components/inputs/DateTime/shared/TimeField.js} +0 -0
- /package/dist/{FileUploadContainer.js → components/inputs/File/FileUploadContainer.js} +0 -0
- /package/dist/{FileCard.js → components/inputs/File/shared/FileCard.js} +0 -0
- /package/dist/{FileCardList.js → components/inputs/File/shared/FileCardList.js} +0 -0
- /package/dist/{Inputs.js → components/inputs/Inputs/Inputs.js} +0 -0
- /package/dist/{useSelectItems.js → components/inputs/Selection/shared/useSelectItems.js} +0 -0
- /package/dist/{ColorPicker.js → components/inputs/TextEditor/Toolbar/ColorPicker.js} +0 -0
- /package/dist/{TextEditorToolbar.js → components/inputs/TextEditor/Toolbar/TextEditorToolbar.js} +0 -0
- /package/dist/{textEditor.types.js → components/inputs/TextEditor/textEditor.types.js} +0 -0
- /package/dist/{accordion.cva.js → components/navigation/Accordion/accordion.cva.js} +0 -0
- /package/dist/{stepper.cva.js → components/navigation/Stepper/stepper.cva.js} +0 -0
- /package/dist/{modal.cva.js → components/overlays/Modal/modal.cva.js} +0 -0
- /package/dist/{tooltip.cva.js → components/overlays/Tooltip/tooltip.cva.js} +0 -0
- /package/dist/{segment.cva.js → components/segment/segment.cva.js} +0 -0
- /package/dist/{minWidth.cva.js → components/shared/pagination/minWidth.cva.js} +0 -0
- /package/dist/{alert.cva.js → components/status/Alert/alert.cva.js} +0 -0
- /package/dist/{loader.cva.js → components/status/Loader/loader.cva.js} +0 -0
- /package/dist/{useToast.js → components/status/Toast/useToast.js} +0 -0
- /package/dist/{status.cva.js → components/status/shared/status.cva.js} +0 -0
- /package/dist/{typography.cva.js → components/text/Typography/typography.cva.js} +0 -0
- /package/dist/{link.context.js → config/link.context.js} +0 -0
- /package/dist/{router.context.js → config/router.context.js} +0 -0
- /package/dist/{useBreakpoint.js → hooks/useBreakpoint.js} +0 -0
- /package/dist/{useDebounceCallback.js → hooks/useDebounceCallback.js} +0 -0
- /package/dist/{useIntersectionObserver.js → hooks/useIntersectionObserver.js} +0 -0
- /package/dist/{useLocalStorage.js → hooks/useLocalStorage.js} +0 -0
- /package/dist/{useLongPressRepeat.js → hooks/useLongPressRepeat.js} +0 -0
- /package/dist/{useScrollableListBox.js → hooks/useScrollableListBox.js} +0 -0
- /package/dist/{useTableColumnConfig.js → hooks/useTableColumnConfig.js} +0 -0
- /package/dist/{useTranslationMemo.js → hooks/useTranslationMemo.js} +0 -0
- /package/dist/{array.utils.js → utils/array.utils.js} +0 -0
- /package/dist/{compoundMapper.js → utils/compoundMapper.js} +0 -0
- /package/dist/{date-time.utils.js → utils/date-time.utils.js} +0 -0
- /package/dist/{date.utils.js → utils/date.utils.js} +0 -0
- /package/dist/{dom.utils.js → utils/dom.utils.js} +0 -0
- /package/dist/{file.utils.js → utils/file.utils.js} +0 -0
- /package/dist/{isEqual.js → utils/isEqual.js} +0 -0
- /package/dist/{logger.js → utils/logger.js} +0 -0
- /package/dist/{object.utils.js → utils/object.utils.js} +0 -0
- /package/dist/{queries.utils.js → utils/queries.utils.js} +0 -0
- /package/dist/{rest.utils.js → utils/rest.utils.js} +0 -0
- /package/dist/{routing.utils.js → utils/routing.utils.js} +0 -0
- /package/dist/{string.utils.js → utils/string.utils.js} +0 -0
- /package/dist/{zod.utils.js → utils/zod.utils.js} +0 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { UIStyle } from "../../../../config/uiStyle.context.js";
|
|
2
|
+
import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
3
|
+
import { inputBase } from "../../shared/input.cva.js";
|
|
4
|
+
import { FormField } from "../../FormField/FormField.js";
|
|
5
|
+
import { TooltipWrapper } from "../../shared/TooltipWrapper.js";
|
|
6
|
+
import { InputContent } from "../shared/InputContent.js";
|
|
6
7
|
import { jsx } from "react/jsx-runtime";
|
|
7
8
|
import { clsx } from "clsx";
|
|
8
9
|
import { useRef } from "react";
|
|
@@ -12,8 +13,9 @@ import { mergeRefs } from "@react-aria/utils";
|
|
|
12
13
|
import { Controller } from "react-hook-form";
|
|
13
14
|
var TextInputBase = (props) => {
|
|
14
15
|
const ui = UIConfig.useConfig();
|
|
15
|
-
const
|
|
16
|
-
const
|
|
16
|
+
const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
|
|
17
|
+
const inputRef = useRef(null);
|
|
18
|
+
const { ref, inputClassName, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, className, unit, isLoading, action, leadingIcon, trailingIcon, value, onChange, onBlur, as = ui.input.as, hideLabel = ui.input.hideLabel, variant = ui.input.variant, size = ui.input.size, isClearable = ui.input.isClearable, ...rest } = props;
|
|
17
19
|
const textFieldRef = useRef(null);
|
|
18
20
|
const { isFocusVisible } = useFocusVisible();
|
|
19
21
|
const { labelProps, inputProps } = useTextField({
|
|
@@ -72,31 +74,32 @@ var TextInputBase = (props) => {
|
|
|
72
74
|
labelProps,
|
|
73
75
|
className: clsx("group w-full", as === "inline" && "h-full", className),
|
|
74
76
|
tabIndex: as === "inline" ? -1 : void 0,
|
|
75
|
-
children: /* @__PURE__ */ jsx(
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
77
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
78
|
+
className: clsx("relative flex cursor-text has-disabled:cursor-default", inputBaseCva({
|
|
79
|
+
variant,
|
|
80
|
+
as,
|
|
81
|
+
...rest
|
|
82
|
+
}), inputClassName),
|
|
83
|
+
onClick: () => inputRef.current?.focus(),
|
|
84
|
+
children: /* @__PURE__ */ jsx(InputContent, {
|
|
85
|
+
...inputContentProps,
|
|
86
|
+
headerProps,
|
|
87
|
+
as,
|
|
88
|
+
size,
|
|
89
|
+
children: /* @__PURE__ */ jsx(Input, {
|
|
90
|
+
...inputProps,
|
|
91
|
+
ref: mergeRefs(ref, inputRef),
|
|
92
|
+
"data-is-empty": value === "" || value === null || value === void 0 || void 0,
|
|
93
|
+
"data-is-dirty": isDirty || void 0,
|
|
94
|
+
"data-is-required": isRequired || void 0,
|
|
95
|
+
"data-is-disabled": isDisabled || void 0,
|
|
96
|
+
placeholder: as === "floating" ? "" : inputProps.placeholder,
|
|
97
|
+
className: "w-full outline-none",
|
|
98
|
+
onFocus: (e) => {
|
|
99
|
+
inputProps.onFocus?.(e);
|
|
100
|
+
if (isFocusVisible) e.target.select();
|
|
101
|
+
}
|
|
102
|
+
})
|
|
100
103
|
})
|
|
101
104
|
})
|
|
102
105
|
})
|
|
@@ -104,7 +107,7 @@ var TextInputBase = (props) => {
|
|
|
104
107
|
};
|
|
105
108
|
const TextInput = (props) => {
|
|
106
109
|
if ("formControl" in props && props.formControl) {
|
|
107
|
-
const { formControl, ref
|
|
110
|
+
const { formControl, ref, ...innerProps } = props;
|
|
108
111
|
return /* @__PURE__ */ jsx(Controller, {
|
|
109
112
|
control: formControl.control,
|
|
110
113
|
name: formControl.name,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FC, FocusEvent, ReactElement, ReactNode, SVGProps } from 'react';
|
|
2
2
|
import { InlineIconButtonProps } from '../../../buttons/InlineIconButton/InlineIconButton';
|
|
3
3
|
import { FormFieldHeaderProps } from '../../FormField/FormFieldHeader';
|
|
4
4
|
import { InputVariantProps } from '../../shared/input.cva';
|
|
@@ -22,7 +22,7 @@ export interface InputContentProps {
|
|
|
22
22
|
headerProps?: FormFieldHeaderProps;
|
|
23
23
|
}
|
|
24
24
|
interface InputContentComponentProps extends InputContentProps, InputVariantProps {
|
|
25
|
-
children:
|
|
25
|
+
children: ReactNode;
|
|
26
26
|
}
|
|
27
27
|
export declare const InputContent: ({ leadingIcon: LeadingIcon, trailingIcon: TrailingIcon, unit, isLoading, isDisabled, action, isClearable, value, onChange, onBlur, children, headerProps, as, size, }: InputContentComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
28
|
export {};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { UIStyle } from "../../../../config/uiStyle.context.js";
|
|
2
|
+
import { typography } from "../../../text/Typography/typography.cva.js";
|
|
3
|
+
import { Loader } from "../../../status/Loader/Loader.js";
|
|
4
|
+
import { InlineIconButton } from "../../../buttons/InlineIconButton/InlineIconButton.js";
|
|
5
|
+
import { FormFieldLabel } from "../../FormField/FormFieldLabel.js";
|
|
6
|
+
import { InputClear } from "../../shared/InputClear.js";
|
|
7
|
+
import { inputSize } from "../../shared/input.cva.js";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { clsx } from "clsx";
|
|
10
|
+
import { isValidElement } from "react";
|
|
11
|
+
const InputContent = ({ leadingIcon: LeadingIcon, trailingIcon: TrailingIcon, unit, isLoading, isDisabled, action, isClearable, value, onChange, onBlur, children, headerProps, as, size }) => {
|
|
12
|
+
const typographyCva = UIStyle.useCva("typography.cva", typography);
|
|
13
|
+
const inputSizeCva = UIStyle.useCva("input.sizeCva", inputSize);
|
|
14
|
+
const isLeadingIconElement = LeadingIcon && isValidElement(LeadingIcon);
|
|
15
|
+
const isTrailingIconElement = TrailingIcon && isValidElement(TrailingIcon);
|
|
16
|
+
const showClear = value != null && value !== "" && !isDisabled;
|
|
17
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
18
|
+
className: "flex w-full items-center gap-input-gap-input-text-to-elements",
|
|
19
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
20
|
+
className: clsx(inputSizeCva({
|
|
21
|
+
size,
|
|
22
|
+
as
|
|
23
|
+
}), "group/input-content flex w-full items-center gap-input-gap-input-text-to-elements pr-0!", as === "inline" && "h-full"),
|
|
24
|
+
children: [LeadingIcon && /* @__PURE__ */ jsx("div", {
|
|
25
|
+
className: clsx(!isLeadingIconElement && "pointer-events-none"),
|
|
26
|
+
children: isLeadingIconElement ? LeadingIcon : /* @__PURE__ */ jsx(LeadingIcon, { className: "size-6 text-interactive-text-secondary-idle" })
|
|
27
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
28
|
+
className: clsx("flex w-full", as === "floating" && "flex-col", as === "filter" && "gap-input-gap-input-text-to-elements"),
|
|
29
|
+
children: [as && ["filter", "floating"].includes(as) && headerProps && /* @__PURE__ */ jsx(FormFieldLabel, {
|
|
30
|
+
as,
|
|
31
|
+
size,
|
|
32
|
+
...headerProps
|
|
33
|
+
}), children]
|
|
34
|
+
})]
|
|
35
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
36
|
+
className: clsx(inputSizeCva({
|
|
37
|
+
size,
|
|
38
|
+
as
|
|
39
|
+
}), "flex items-center gap-input-gap-trailing-elements py-0! pl-0!", !isTrailingIconElement && !action && !(isClearable && showClear) && "pointer-events-none"),
|
|
40
|
+
children: [
|
|
41
|
+
isClearable && /* @__PURE__ */ jsx(InputClear, {
|
|
42
|
+
onClear: () => {
|
|
43
|
+
onChange?.("");
|
|
44
|
+
onBlur?.({ target: { value: "" } });
|
|
45
|
+
},
|
|
46
|
+
show: showClear
|
|
47
|
+
}),
|
|
48
|
+
unit && /* @__PURE__ */ jsx("span", {
|
|
49
|
+
className: typographyCva({
|
|
50
|
+
size: "label-2",
|
|
51
|
+
variant: "prominent-1",
|
|
52
|
+
className: "text-text-default-3"
|
|
53
|
+
}),
|
|
54
|
+
children: unit
|
|
55
|
+
}),
|
|
56
|
+
isLoading && /* @__PURE__ */ jsx("div", {
|
|
57
|
+
className: "inline-flex",
|
|
58
|
+
children: /* @__PURE__ */ jsx(Loader, {})
|
|
59
|
+
}),
|
|
60
|
+
!isLoading && action && /* @__PURE__ */ jsx(InlineIconButton, {
|
|
61
|
+
color: "secondary",
|
|
62
|
+
icon: action.icon,
|
|
63
|
+
isDisabled,
|
|
64
|
+
onPress: action.onClick,
|
|
65
|
+
excludeFromTabOrder: true,
|
|
66
|
+
label: action.altText,
|
|
67
|
+
className: clsx("border-0!", action.className)
|
|
68
|
+
}),
|
|
69
|
+
!isLoading && !action && TrailingIcon && (isTrailingIconElement ? TrailingIcon : /* @__PURE__ */ jsx(TrailingIcon, { className: "size-6 text-interactive-text-secondary-idle" }))
|
|
70
|
+
]
|
|
71
|
+
})]
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
export { InputContent };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { InputItem } from "./InputItem.js";
|
|
2
|
-
import { StringUtils } from "
|
|
3
|
-
import { ZodUtils } from "
|
|
4
|
-
import { getDefaultInputComponentType } from "
|
|
2
|
+
import { StringUtils } from "../../../utils/string.utils.js";
|
|
3
|
+
import { ZodUtils } from "../../../utils/zod.utils.js";
|
|
4
|
+
import { getDefaultInputComponentType } from "../../../helpers/dynamicInputs.js";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
import { useMemo } from "react";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
var createFieldComponent = (field, schemaKeyType, form) => {
|
|
9
|
-
return function FieldComponent({ inputType, label, placeholder
|
|
9
|
+
return function FieldComponent({ inputType, label, placeholder, ...inputProps }) {
|
|
10
10
|
return /* @__PURE__ */ jsx(InputItem, {
|
|
11
11
|
form,
|
|
12
12
|
inputDef: {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { Checkbox } from "
|
|
2
|
-
import { DatePicker } from "
|
|
3
|
-
import { TextInput } from "
|
|
4
|
-
import { Select } from "
|
|
5
|
-
import { DateRangePicker } from "
|
|
6
|
-
import { DateTimePicker } from "
|
|
7
|
-
import { TimePicker } from "
|
|
8
|
-
import { NumberInput } from "
|
|
9
|
-
import { PasswordInput } from "
|
|
10
|
-
import { TextArea } from "
|
|
11
|
-
import { Autocomplete } from "
|
|
12
|
-
import { QueryAutocomplete } from "
|
|
13
|
-
import { Slider } from "
|
|
14
|
-
import { Toggle } from "
|
|
15
|
-
import { Segment } from "
|
|
1
|
+
import { Checkbox } from "../Checkbox/Checkbox.js";
|
|
2
|
+
import { DatePicker } from "../DateTime/DatePicker/DatePicker.js";
|
|
3
|
+
import { TextInput } from "../Input/TextInput/TextInput.js";
|
|
4
|
+
import { Select } from "../Selection/Select/Select.js";
|
|
5
|
+
import { DateRangePicker } from "../DateTime/DateRangePicker/DateRangePicker.js";
|
|
6
|
+
import { DateTimePicker } from "../DateTime/DateTimePicker/DateTimePicker.js";
|
|
7
|
+
import { TimePicker } from "../DateTime/TimePicker/TimePicker.js";
|
|
8
|
+
import { NumberInput } from "../Input/NumberInput/NumberInput.js";
|
|
9
|
+
import { PasswordInput } from "../Input/PasswordInput/PasswordInput.js";
|
|
10
|
+
import { TextArea } from "../Input/TextArea/TextArea.js";
|
|
11
|
+
import { Autocomplete } from "../Selection/Autocomplete/Autocomplete.js";
|
|
12
|
+
import { QueryAutocomplete } from "../Selection/Autocomplete/QueryAutocomplete.js";
|
|
13
|
+
import { Slider } from "../Slider/Slider.js";
|
|
14
|
+
import { Toggle } from "../Toggle/Toggle.js";
|
|
15
|
+
import { Segment } from "../../segment/Segment.js";
|
|
16
16
|
import { jsx } from "react/jsx-runtime";
|
|
17
17
|
var componentRegistry = {
|
|
18
18
|
toggle: Toggle,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { UIStyle } from "
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { FormField } from "
|
|
1
|
+
import { UIStyle } from "../../../config/uiStyle.context.js";
|
|
2
|
+
import { UIConfig } from "../../../config/uiConfig.context.js";
|
|
3
|
+
import { CheckContent } from "../shared/CheckContent.js";
|
|
4
|
+
import { FormField } from "../FormField/FormField.js";
|
|
5
5
|
import { radio, radioIndicatorClass, radioTypography } from "./radio.cva.js";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import clsx$1 from "clsx";
|
|
@@ -10,10 +10,9 @@ import { mergeRefs } from "@react-aria/utils";
|
|
|
10
10
|
import { Controller } from "react-hook-form";
|
|
11
11
|
var RadioGroupBase = (props) => {
|
|
12
12
|
const ui = UIConfig.useConfig();
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
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;
|
|
13
|
+
const radioCva = UIStyle.useCva("radio.cva", radio);
|
|
14
|
+
const radioTypographyMap = UIStyle.useMapper("radio.typography", radioTypography);
|
|
15
|
+
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
16
|
const formFieldProps = {
|
|
18
17
|
className,
|
|
19
18
|
error,
|
|
@@ -59,7 +58,7 @@ var RadioGroupBase = (props) => {
|
|
|
59
58
|
};
|
|
60
59
|
const RadioGroup$1 = (props) => {
|
|
61
60
|
if ("formControl" in props && props.formControl) {
|
|
62
|
-
const { formControl, ref
|
|
61
|
+
const { formControl, ref, ...innerProps } = props;
|
|
63
62
|
return /* @__PURE__ */ jsx(Controller, {
|
|
64
63
|
control: formControl.control,
|
|
65
64
|
name: formControl.name,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { uiGroupOutlineClass } from "
|
|
2
|
-
import { compoundMapper } from "
|
|
1
|
+
import { uiGroupOutlineClass } from "../../outline.clsx.js";
|
|
2
|
+
import { compoundMapper } from "../../../utils/compoundMapper.js";
|
|
3
3
|
import { cva } from "class-variance-authority";
|
|
4
4
|
const radio = cva([
|
|
5
5
|
"flex items-center justify-center border-2",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { SelectBase } from "
|
|
1
|
+
import { SelectBase } from "../shared/SelectBase.js";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { mergeRefs } from "@react-aria/utils";
|
|
4
4
|
import { Controller } from "react-hook-form";
|
|
5
5
|
const Autocomplete = (props) => {
|
|
6
6
|
if ("formControl" in props && props.formControl) {
|
|
7
|
-
const { formControl, ref
|
|
7
|
+
const { formControl, ref, ...innerProps } = props;
|
|
8
8
|
return /* @__PURE__ */ jsx(Controller, {
|
|
9
9
|
control: formControl.control,
|
|
10
10
|
name: formControl.name,
|
package/dist/{QueryAutocomplete.js → components/inputs/Selection/Autocomplete/QueryAutocomplete.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Autocomplete } from "./Autocomplete.js";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useState } from "react";
|
|
4
|
-
const QueryAutocomplete = ({ query, queryParams, queryOptions
|
|
4
|
+
const QueryAutocomplete = ({ query, queryParams, queryOptions, ...props }) => {
|
|
5
5
|
const [search, setSearch] = useState("");
|
|
6
6
|
const { data: items, isLoading } = query({
|
|
7
7
|
search,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { SelectBase } from "
|
|
1
|
+
import { SelectBase } from "../shared/SelectBase.js";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { mergeRefs } from "@react-aria/utils";
|
|
4
4
|
import { Controller } from "react-hook-form";
|
|
5
5
|
const Select = (props) => {
|
|
6
6
|
if ("formControl" in props && props.formControl) {
|
|
7
|
-
const { formControl, ref
|
|
7
|
+
const { formControl, ref, ...innerProps } = props;
|
|
8
8
|
return /* @__PURE__ */ jsx(Controller, {
|
|
9
9
|
control: formControl.control,
|
|
10
10
|
name: formControl.name,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
2
|
+
import { useBreakpoint } from "../../../../hooks/useBreakpoint.js";
|
|
3
3
|
import { SelectContext } from "./select.context.js";
|
|
4
4
|
import { SelectDesktop } from "./SelectDesktop.js";
|
|
5
5
|
import { SelectMobile } from "./SelectMobile.js";
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { FormField } from "
|
|
2
|
-
import { TooltipWrapper } from "
|
|
1
|
+
import { FormField } from "../../FormField/FormField.js";
|
|
2
|
+
import { TooltipWrapper } from "../../shared/TooltipWrapper.js";
|
|
3
3
|
import { SelectAllItemId } from "./useSelectItems.js";
|
|
4
4
|
import { SelectContext } from "./select.context.js";
|
|
5
5
|
import { SelectInput } from "./SelectInput.js";
|
|
6
6
|
import { SelectListBox } from "./SelectListBox.js";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { clsx } from "clsx";
|
|
9
|
-
import { Fragment as Fragment$1, useMemo, useRef } from "react";
|
|
9
|
+
import { Fragment as Fragment$1, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
10
10
|
import { ComboBox, DialogTrigger, Popover } from "react-aria-components";
|
|
11
|
-
import { useLabel } from "react-aria";
|
|
11
|
+
import { useLabel, usePreventScroll } from "react-aria";
|
|
12
12
|
import { mergeRefs } from "@react-aria/utils";
|
|
13
|
-
|
|
14
|
-
const SelectDesktop = ({ ref, error, ignoreTriggerWidth, showSelectionContent, inputClassName, containerClassName, customTrigger, onBlur,...props }) => {
|
|
13
|
+
const SelectDesktop = ({ ref, error, ignoreTriggerWidth, showSelectionContent, inputClassName, containerClassName, customTrigger, onBlur, ...props }) => {
|
|
15
14
|
const { label, tooltipText, helperText, isRequired, rightContent, isHeaderHidden, headerClassName, errorClassName, placeholder, variant, isDisabled, className, hideLabel, hideDropdownIcon, isSearchable, isClearable, isLoading, as, size, collapseAfter, selectedTagsType } = props;
|
|
16
15
|
const formFieldProps = {
|
|
17
16
|
error,
|
|
@@ -29,8 +28,21 @@ const SelectDesktop = ({ ref, error, ignoreTriggerWidth, showSelectionContent, i
|
|
|
29
28
|
const { labelProps, fieldProps } = useLabel({ label });
|
|
30
29
|
const triggerRef = useRef(null);
|
|
31
30
|
const closeComboBoxRef = useRef(null);
|
|
32
|
-
const
|
|
31
|
+
const wrapperRef = useRef(null);
|
|
32
|
+
const [popoverWidth, setPopoverWidth] = useState(void 0);
|
|
33
33
|
const { fieldState, isOpen, setIsOpen, onInputChange, onChange, onClear, onSelectAll, listItems, selectableListItems, selectedIds, isMultiple } = SelectContext.useSelect();
|
|
34
|
+
usePreventScroll({ isDisabled: !isOpen });
|
|
35
|
+
useLayoutEffect(() => {
|
|
36
|
+
if (!isOpen || !wrapperRef.current) return;
|
|
37
|
+
setPopoverWidth(wrapperRef.current.getBoundingClientRect().width);
|
|
38
|
+
const observer = new ResizeObserver((entries) => {
|
|
39
|
+
setPopoverWidth(entries[0].contentRect.width);
|
|
40
|
+
});
|
|
41
|
+
observer.observe(wrapperRef.current);
|
|
42
|
+
return () => {
|
|
43
|
+
observer.disconnect();
|
|
44
|
+
};
|
|
45
|
+
}, [isOpen]);
|
|
34
46
|
const onSelectionChange = (value) => {
|
|
35
47
|
if (!value) return;
|
|
36
48
|
if (value === "all-item-id") {
|
|
@@ -132,11 +144,11 @@ const SelectDesktop = ({ ref, error, ignoreTriggerWidth, showSelectionContent, i
|
|
|
132
144
|
isOpen,
|
|
133
145
|
onOpenChange: setIsOpen,
|
|
134
146
|
className: "my-4 outline-none",
|
|
135
|
-
style: { width: !ignoreTriggerWidth ?
|
|
147
|
+
style: { width: !ignoreTriggerWidth ? popoverWidth : void 0 },
|
|
136
148
|
offset: 0,
|
|
137
149
|
children: /* @__PURE__ */ jsx(SelectListBox, {
|
|
138
150
|
...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]",
|
|
151
|
+
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
152
|
autoFocus: !isSearchable
|
|
141
153
|
})
|
|
142
154
|
})]
|
|
@@ -1,49 +1,32 @@
|
|
|
1
|
-
import { ArrowDropDownIcon } from "
|
|
2
|
-
import { UIStyle } from "
|
|
3
|
-
import { Typography } from "
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { ArrowDropDownIcon } from "../../../../assets/icons/ArrowDropDown.js";
|
|
2
|
+
import { UIStyle } from "../../../../config/uiStyle.context.js";
|
|
3
|
+
import { Typography } from "../../../text/Typography/Typography.js";
|
|
4
|
+
import { FormFieldLabel } from "../../FormField/FormFieldLabel.js";
|
|
5
|
+
import { ns } from "../../../../config/i18n.js";
|
|
6
|
+
import { InputClear } from "../../shared/InputClear.js";
|
|
7
|
+
import { inputBase, inputSize } from "../../shared/input.cva.js";
|
|
8
8
|
import { SelectInputTags } from "./SelectInputTags.js";
|
|
9
9
|
import { SelectContext } from "./select.context.js";
|
|
10
10
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { clsx } from "clsx";
|
|
12
|
-
import { use, useMemo, useState } from "react";
|
|
12
|
+
import { use, useMemo, useRef, useState } from "react";
|
|
13
13
|
import { Button, ComboBoxStateContext, Input } from "react-aria-components";
|
|
14
14
|
import { useFocusVisible, useFocusWithin, useHover } from "react-aria";
|
|
15
|
-
import useMeasure from "react-use-measure";
|
|
16
15
|
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
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const inputBaseCva = uiStyle?.input?.baseCva ?? inputBase;
|
|
21
|
-
const inputSideCva = uiStyle?.input?.sideCva ?? inputSide;
|
|
16
|
+
const SelectInput = ({ ref, placeholder, variant, as, size, isDisabled, isInvalid, className, hideDropdownIcon, isSearchable, isClearable, showSelectionContent, inputClassName, fieldProps, headerProps, selectedTagsType, collapseAfter, onCloseComboBox, onBlur, ...props }) => {
|
|
17
|
+
const inputSizeCva = UIStyle.useCva("input.sizeCva", inputSize);
|
|
18
|
+
const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
|
|
22
19
|
const { t } = useTranslation("ui");
|
|
23
20
|
const state = use(ComboBoxStateContext);
|
|
24
21
|
const { hoverProps, isHovered } = useHover({ isDisabled });
|
|
25
22
|
const [isFocused, setIsFocused] = useState(false);
|
|
26
23
|
const { focusWithinProps } = useFocusWithin({ onFocusWithinChange: setIsFocused });
|
|
27
24
|
const { isFocusVisible } = useFocusVisible();
|
|
28
|
-
const
|
|
25
|
+
const inputRef = useRef(null);
|
|
29
26
|
const { fieldState, isOpen, setIsOpen, listItems, selectedItems, onChange, onClear, onRemove, isMultiple, isLoading } = SelectContext.useSelect();
|
|
30
27
|
const isEmpty = selectedItems.length === 0;
|
|
31
28
|
const showTags = isMultiple && !isEmpty;
|
|
32
29
|
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
30
|
const labelProps = useMemo(() => {
|
|
48
31
|
const { labelProps: headerLabelProps } = headerProps ?? {};
|
|
49
32
|
if (!(as && ["filter", "floating"].includes(as)) || isSearchable) return headerLabelProps;
|
|
@@ -64,13 +47,21 @@ const SelectInput = ({ ref, placeholder, variant, as, size, isDisabled, isInvali
|
|
|
64
47
|
}
|
|
65
48
|
if (e.key === "Backspace" && isMultiple && fieldState.inputValue === "" && Array.isArray(fieldState.value) && fieldState.value.length > 0) onChange(fieldState.value.slice(0, -1));
|
|
66
49
|
};
|
|
50
|
+
const onClick = () => {
|
|
51
|
+
if (isDisabled) return;
|
|
52
|
+
if (!isSearchable) {
|
|
53
|
+
setIsOpen(!isOpen);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
inputRef.current?.focus();
|
|
57
|
+
};
|
|
67
58
|
return /* @__PURE__ */ jsxs("div", {
|
|
68
59
|
ref,
|
|
69
60
|
className: inputBaseCva({
|
|
70
61
|
variant,
|
|
71
62
|
as,
|
|
72
63
|
...props,
|
|
73
|
-
className: clsx("group/select-content relative flex px-0!", isSearchable && "cursor-text", className)
|
|
64
|
+
className: clsx("group/select-content relative flex px-0!", !isDisabled && isSearchable && "cursor-text", className)
|
|
74
65
|
}),
|
|
75
66
|
"data-rac": "",
|
|
76
67
|
"data-disabled": isDisabled || void 0,
|
|
@@ -88,21 +79,20 @@ const SelectInput = ({ ref, placeholder, variant, as, size, isDisabled, isInvali
|
|
|
88
79
|
...focusWithinProps,
|
|
89
80
|
children: [
|
|
90
81
|
/* @__PURE__ */ jsxs("div", {
|
|
91
|
-
className: clsx("relative flex flex-1 items-center truncate",
|
|
82
|
+
className: clsx("relative flex flex-1 items-center gap-input-gap-input-text-to-elements truncate", !isDisabled && isSearchable && "cursor-text", !isDisabled && !isSearchable && "cursor-pointer", inputSizeCva({
|
|
92
83
|
as,
|
|
93
84
|
size,
|
|
94
85
|
...props
|
|
95
86
|
})),
|
|
87
|
+
onClick,
|
|
96
88
|
children: [
|
|
97
89
|
as && ["filter", "floating"].includes(as) && headerProps && /* @__PURE__ */ jsx(FormFieldLabel, {
|
|
98
|
-
ref: labelContentRef,
|
|
99
90
|
as,
|
|
100
91
|
...headerProps,
|
|
101
92
|
labelProps
|
|
102
93
|
}),
|
|
103
94
|
(showTags || isSearchable) && /* @__PURE__ */ jsxs("div", {
|
|
104
|
-
className: clsx("flex flex-1 flex-wrap gap-
|
|
105
|
-
style,
|
|
95
|
+
className: clsx("flex flex-1 flex-wrap gap-input-gap-input-text-to-elements truncate", !isSearchable && "pointer-events-none z-1"),
|
|
106
96
|
children: [showTags && /* @__PURE__ */ jsx(SelectInputTags, {
|
|
107
97
|
selectedItems,
|
|
108
98
|
isDisabled,
|
|
@@ -110,14 +100,10 @@ const SelectInput = ({ ref, placeholder, variant, as, size, isDisabled, isInvali
|
|
|
110
100
|
selectedTagsType,
|
|
111
101
|
onRemove
|
|
112
102
|
}), isSearchable && /* @__PURE__ */ jsx(Input, {
|
|
103
|
+
ref: inputRef,
|
|
113
104
|
placeholder: as === "floating" ? void 0 : placeholder,
|
|
114
105
|
onBlur,
|
|
115
|
-
className: clsx("w-full flex-1 bg-transparent outline-none placeholder:text-text-default-3 disabled:text-interactive-text-secondary-disabled",
|
|
116
|
-
as,
|
|
117
|
-
size,
|
|
118
|
-
...props,
|
|
119
|
-
className: "rounded-input-rounding-default"
|
|
120
|
-
}), inputClassName),
|
|
106
|
+
className: clsx("w-full flex-1 bg-transparent outline-none placeholder:text-text-default-3 disabled:text-interactive-text-secondary-disabled", inputClassName),
|
|
121
107
|
onKeyDown,
|
|
122
108
|
...fieldProps
|
|
123
109
|
})]
|
|
@@ -127,13 +113,7 @@ const SelectInput = ({ ref, placeholder, variant, as, size, isDisabled, isInvali
|
|
|
127
113
|
onPress: () => setIsOpen(!isOpen),
|
|
128
114
|
onBlur,
|
|
129
115
|
"data-type": "select-trigger",
|
|
130
|
-
className:
|
|
131
|
-
size,
|
|
132
|
-
as,
|
|
133
|
-
...props,
|
|
134
|
-
className: clsx("w-full truncate text-start outline-none disabled:text-interactive-text-secondary-disabled", showTags && "absolute inset-0 z-0")
|
|
135
|
-
}),
|
|
136
|
-
style,
|
|
116
|
+
className: clsx("w-full truncate text-start outline-none disabled:text-interactive-text-secondary-disabled", showTags && "absolute inset-0 z-0"),
|
|
137
117
|
...fieldProps,
|
|
138
118
|
children: [(as === "floating" && isEmpty || isMultiple && !isEmpty) && /* @__PURE__ */ jsx(Fragment, { children: "\xA0" }), (isEmpty || !isMultiple) && (as !== "floating" || !isEmpty) && /* @__PURE__ */ jsxs(Typography, {
|
|
139
119
|
size: "label-1",
|
|
@@ -143,7 +123,10 @@ const SelectInput = ({ ref, placeholder, variant, as, size, isDisabled, isInvali
|
|
|
143
123
|
})
|
|
144
124
|
]
|
|
145
125
|
}),
|
|
146
|
-
|
|
126
|
+
isClearable && /* @__PURE__ */ jsx(InputClear, {
|
|
127
|
+
onClear,
|
|
128
|
+
show: showClearButton
|
|
129
|
+
}),
|
|
147
130
|
!hideDropdownIcon && /* @__PURE__ */ jsx(Button, {
|
|
148
131
|
excludeFromTabOrder: true,
|
|
149
132
|
"aria-label": t(($) => isOpen ? $.ui.closeAlt : $.ui.openAlt),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Tag } from "
|
|
1
|
+
import { Tag } from "../../../text/Tag/Tag.js";
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useMemo } from "react";
|
|
4
4
|
const SelectInputTags = ({ selectedItems, isDisabled, selectedTagsType, collapseAfter, onRemove }) => {
|
|
@@ -6,7 +6,7 @@ import { SelectListBoxLoadingItem } from "./SelectListBoxLoadingItem.js";
|
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
import { clsx } from "clsx";
|
|
8
8
|
import { ListBox, ListLayout, Virtualizer } from "react-aria-components";
|
|
9
|
-
const SelectListBox = ({ label, selectionMode, isSearchable, isScrollable = true, virtualizerOptions, newItemRender, onLoadMore, className, onClose
|
|
9
|
+
const SelectListBox = ({ label, selectionMode, isSearchable, isScrollable = true, virtualizerOptions, newItemRender, onLoadMore, className, onClose, ...props }) => {
|
|
10
10
|
const { fieldState, onChange, listItems, selectableListItems, selectedIds, isMultiple, onClear, onSelectAll } = SelectContext.useSelect();
|
|
11
11
|
const onSelectionChange = (value) => {
|
|
12
12
|
const ids = Array.from(value);
|
package/dist/{SelectListBoxItem.js → components/inputs/Selection/shared/SelectListBoxItem.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CheckboxCheckmark } from "
|
|
2
|
-
import { ns } from "
|
|
1
|
+
import { CheckboxCheckmark } from "../../Checkbox/CheckboxCheckmark.js";
|
|
2
|
+
import { ns } from "../../../../config/i18n.js";
|
|
3
3
|
import { SelectContext } from "./select.context.js";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { clsx } from "clsx";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CheckboxCheckmark } from "
|
|
2
|
-
import { ns } from "
|
|
1
|
+
import { CheckboxCheckmark } from "../../Checkbox/CheckboxCheckmark.js";
|
|
2
|
+
import { ns } from "../../../../config/i18n.js";
|
|
3
3
|
import { SelectContext } from "./select.context.js";
|
|
4
4
|
import { selectListBoxItemClass } from "./SelectListBoxItem.js";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Loader } from "
|
|
2
|
-
import { ns } from "
|
|
1
|
+
import { Loader } from "../../../status/Loader/Loader.js";
|
|
2
|
+
import { ns } from "../../../../config/i18n.js";
|
|
3
3
|
import { SelectContext } from "./select.context.js";
|
|
4
4
|
import { selectListBoxItemClass } from "./SelectListBoxItem.js";
|
|
5
|
-
import { useIntersectionObserver } from "
|
|
5
|
+
import { useIntersectionObserver } from "../../../../hooks/useIntersectionObserver.js";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
import { useCallback } from "react";
|
|
8
8
|
import { ListBoxItem } from "react-aria-components";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TextButton } from "
|
|
2
|
-
import { ns } from "
|
|
1
|
+
import { TextButton } from "../../../buttons/TextButton/TextButton.js";
|
|
2
|
+
import { ns } from "../../../../config/i18n.js";
|
|
3
3
|
import { SelectContext } from "./select.context.js";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { clsx } from "clsx";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { BottomSheet } from "
|
|
2
|
-
import { FormFieldHeader } from "
|
|
3
|
-
import { FormFieldHeaderClose } from "
|
|
4
|
-
import { FormField } from "
|
|
1
|
+
import { BottomSheet } from "../../../overlays/BottomSheet/BottomSheet.js";
|
|
2
|
+
import { FormFieldHeader } from "../../FormField/FormFieldHeader.js";
|
|
3
|
+
import { FormFieldHeaderClose } from "../../FormField/FormFieldHeaderClose.js";
|
|
4
|
+
import { FormField } from "../../FormField/FormField.js";
|
|
5
5
|
import { SelectContext } from "./select.context.js";
|
|
6
6
|
import { SelectInput } from "./SelectInput.js";
|
|
7
7
|
import { SelectListBox } from "./SelectListBox.js";
|
|
8
|
-
import { TextInput } from "
|
|
8
|
+
import { TextInput } from "../../Input/TextInput/TextInput.js";
|
|
9
9
|
import { SelectListBoxSelectionBar } from "./SelectListBoxSelectionBar.js";
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { clsx } from "clsx";
|
|
12
12
|
import { useRef } from "react";
|
|
13
13
|
import { DialogTrigger } from "react-aria-components";
|
|
14
14
|
import { useLabel } from "react-aria";
|
|
15
|
-
const SelectMobile = ({ ref, error, showSelectionContent, inputClassName, containerClassName, customTrigger, onBlur
|
|
15
|
+
const SelectMobile = ({ ref, error, showSelectionContent, inputClassName, containerClassName, customTrigger, onBlur, ...props }) => {
|
|
16
16
|
const { label, tooltipText, helperText, isRequired, rightContent, isHeaderHidden, headerClassName, errorClassName, placeholder, variant, isDisabled, className, hideLabel, hideDropdownIcon, isSearchable, isClearable, as, collapseAfter, selectedTagsType } = props;
|
|
17
17
|
const formFieldProps = {
|
|
18
18
|
error,
|