@povio/ui 3.1.0 → 3.2.0
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/dist/assets/icons/AlignCenter.js +26 -11
- package/dist/assets/icons/AlignLeft.js +26 -11
- package/dist/assets/icons/AlignLeftRight.js +26 -11
- package/dist/assets/icons/AlignRight.js +26 -11
- package/dist/assets/icons/ArrowDropDown.js +26 -11
- package/dist/assets/icons/ArrowDropUp.js +26 -11
- package/dist/assets/icons/ArrowLeft.js +26 -11
- package/dist/assets/icons/ArrowRight.js +26 -11
- package/dist/assets/icons/Bold.js +26 -11
- package/dist/assets/icons/BulletedList.js +26 -11
- package/dist/assets/icons/Calendar.js +28 -13
- package/dist/assets/icons/Check.js +28 -13
- package/dist/assets/icons/CheckCircle.js +26 -11
- package/dist/assets/icons/CheckboxCheckmark.js +29 -14
- package/dist/assets/icons/CheckboxIndeterminate.js +29 -14
- package/dist/assets/icons/ChevronDown.js +28 -13
- package/dist/assets/icons/ChevronLeft.js +28 -13
- package/dist/assets/icons/ChevronRight.js +28 -13
- package/dist/assets/icons/ChevronUp.js +28 -13
- package/dist/assets/icons/ChevronsLeft.js +28 -13
- package/dist/assets/icons/ChevronsRight.js +28 -13
- package/dist/assets/icons/Clock.js +26 -11
- package/dist/assets/icons/Close.js +26 -11
- package/dist/assets/icons/DateTime.js +35 -14
- package/dist/assets/icons/DragIndicator.js +26 -11
- package/dist/assets/icons/File.js +28 -13
- package/dist/assets/icons/Highlight.js +26 -11
- package/dist/assets/icons/HighlightOn.js +49 -15
- package/dist/assets/icons/Home.js +26 -11
- package/dist/assets/icons/Info.js +37 -16
- package/dist/assets/icons/Italic.js +26 -11
- package/dist/assets/icons/Link.js +26 -11
- package/dist/assets/icons/Menu.js +26 -11
- package/dist/assets/icons/NumberedList.js +26 -11
- package/dist/assets/icons/PointerHorizontal.js +26 -11
- package/dist/assets/icons/PointerVertical.js +26 -11
- package/dist/assets/icons/Search.js +26 -11
- package/dist/assets/icons/Send.js +28 -13
- package/dist/assets/icons/Strikethrough.js +26 -11
- package/dist/assets/icons/TextColor.js +48 -14
- package/dist/assets/icons/Today.js +26 -11
- package/dist/assets/icons/Underlined.js +28 -13
- package/dist/assets/icons/Upload.js +35 -14
- package/dist/assets/icons/Visibility.js +26 -11
- package/dist/assets/icons/VisibilityOff.js +26 -11
- package/dist/assets/icons/WarningFilled.js +28 -13
- package/dist/components/Breadcrumbs/Breadcrumbs.js +207 -56
- package/dist/components/Menu/Menu.js +18 -2
- package/dist/components/Menu/MenuDesktop.js +41 -7
- package/dist/components/Menu/MenuItem.js +32 -9
- package/dist/components/Menu/MenuMobile.js +102 -39
- package/dist/components/Menu/MenuPopover.js +105 -29
- package/dist/components/buttons/Button/button.cva.d.ts +3 -3
- package/dist/components/buttons/IconButton/IconButton.js +40 -8
- package/dist/components/buttons/InlineIconButton/InlineIconButton.d.ts +2 -1
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +34 -9
- package/dist/components/buttons/PillButton/PillButton.js +55 -17
- package/dist/components/buttons/PillButton/pillButton.cva.d.ts +1 -1
- package/dist/components/buttons/SplitButton/SplitButton.js +103 -18
- package/dist/components/buttons/TextButton/TextButton.js +30 -8
- package/dist/components/buttons/ToggleButton/ToggleButton.js +28 -8
- package/dist/components/buttons/shared/ButtonContent.js +80 -22
- package/dist/components/inputs/Checkbox/Checkbox.d.ts +1 -0
- package/dist/components/inputs/Checkbox/Checkbox.js +201 -35
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +24 -10
- package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +3 -0
- package/dist/components/inputs/Checkbox/checkbox.cva.js +2 -1
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +12 -5
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +380 -75
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +12 -5
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +499 -186
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +14 -5
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +280 -46
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +7 -3
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +616 -121
- package/dist/components/inputs/DateTime/shared/Calendar.d.ts +5 -2
- package/dist/components/inputs/DateTime/shared/Calendar.js +342 -119
- package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +4 -2
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +310 -103
- package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +4 -2
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +150 -33
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +233 -98
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +318 -137
- package/dist/components/inputs/DateTime/shared/DateField.d.ts +2 -1
- package/dist/components/inputs/DateTime/shared/DateField.js +288 -112
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +14 -3
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +359 -129
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +18 -1
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +104 -11
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +83 -28
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +59 -10
- package/dist/components/inputs/DateTime/shared/MonthPicker.js +103 -58
- package/dist/components/inputs/DateTime/shared/RangeCalendar.js +193 -82
- package/dist/components/inputs/DateTime/shared/TimeField.js +27 -8
- package/dist/components/inputs/DateTime/shared/TimePickerForm.js +279 -110
- package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +4 -1
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +211 -65
- package/dist/components/inputs/DateTime/shared/YearPicker.js +119 -68
- package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +5 -0
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +16 -0
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +16 -0
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +15 -0
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +32 -0
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.d.ts +2 -0
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.spec.d.ts +1 -0
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +41 -0
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +99 -0
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.spec.d.ts +1 -0
- package/dist/components/inputs/File/FileUpload.js +91 -46
- package/dist/components/inputs/File/FileUploadContainer.js +15 -7
- package/dist/components/inputs/File/InputUpload.js +317 -79
- package/dist/components/inputs/File/index.d.ts +1 -1
- package/dist/components/inputs/File/shared/FileCard.js +104 -41
- package/dist/components/inputs/File/shared/FileCardList.js +47 -12
- package/dist/components/inputs/File/shared/FileUploadContent.js +175 -44
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +149 -46
- package/dist/components/inputs/File/shared/FileUploadContentError.js +234 -93
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +230 -97
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +199 -55
- package/dist/components/inputs/File/shared/InputUploadContent.js +148 -34
- package/dist/components/inputs/File/shared/InputUploadFilled.js +49 -8
- package/dist/components/inputs/File/shared/ProgressBar.js +102 -15
- package/dist/components/inputs/File/shared/fileUpload.cva.d.ts +0 -11
- package/dist/components/inputs/File/shared/fileUpload.cva.js +1 -18
- package/dist/components/inputs/FormField/FormField.d.ts +3 -3
- package/dist/components/inputs/FormField/FormField.js +119 -37
- package/dist/components/inputs/FormField/FormFieldError.js +25 -5
- package/dist/components/inputs/FormField/FormFieldHeader.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldHeader.js +81 -22
- package/dist/components/inputs/FormField/FormFieldHeaderClose.js +31 -7
- package/dist/components/inputs/FormField/FormFieldHelper.js +26 -6
- package/dist/components/inputs/FormField/FormFieldLabel.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldLabel.js +40 -9
- package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +13 -0
- package/dist/components/inputs/FormField/formFieldHeader.cva.js +14 -0
- package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +5 -2
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +446 -97
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.d.ts +45 -0
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +571 -0
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +35 -0
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +574 -0
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +48 -9
- package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +8 -0
- package/dist/components/inputs/Input/TextArea/TextArea.cva.js +5 -0
- package/dist/components/inputs/Input/TextArea/TextArea.js +305 -90
- package/dist/components/inputs/Input/TextInput/TextInput.d.ts +3 -1
- package/dist/components/inputs/Input/TextInput/TextInput.js +429 -90
- package/dist/components/inputs/Input/shared/InputContent.js +193 -59
- package/dist/components/inputs/Input/shared/numberStatic.utils.d.ts +1 -0
- package/dist/components/inputs/Input/shared/numberStatic.utils.js +7 -0
- package/dist/components/inputs/Inputs/Form.js +40 -11
- package/dist/components/inputs/Inputs/InputItem.d.ts +15 -21
- package/dist/components/inputs/Inputs/InputItem.js +69 -14
- package/dist/components/inputs/Inputs/Inputs.js +37 -11
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +3 -1
- package/dist/components/inputs/RadioGroup/RadioGroup.js +353 -61
- package/dist/components/inputs/RadioGroup/radio.cva.d.ts +45 -0
- package/dist/components/inputs/RadioGroup/radio.cva.js +48 -1
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +6 -2
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +217 -22
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +3 -18
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +107 -8
- package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +37 -0
- package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +14 -0
- package/dist/components/inputs/Selection/Select/QuerySelect.js +178 -0
- package/dist/components/inputs/Selection/Select/Select.d.ts +7 -3
- package/dist/components/inputs/Selection/Select/Select.js +227 -18
- package/dist/components/inputs/Selection/shared/SelectBase.d.ts +8 -1
- package/dist/components/inputs/Selection/shared/SelectBase.js +69 -18
- package/dist/components/inputs/Selection/shared/SelectDesktop.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +393 -138
- package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectInput.js +397 -116
- package/dist/components/inputs/Selection/shared/SelectInputTags.js +99 -25
- package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectListBox.js +164 -52
- package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +85 -35
- package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +69 -16
- package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +70 -21
- package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +58 -9
- package/dist/components/inputs/Selection/shared/SelectMobile.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectMobile.js +9 -3
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +9 -0
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +47 -0
- package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +14 -0
- package/dist/components/inputs/Selection/shared/querySelect.utils.js +43 -0
- package/dist/components/inputs/Selection/shared/select.context.d.ts +3 -2
- package/dist/components/inputs/Selection/shared/select.context.js +67 -36
- package/dist/components/inputs/Selection/shared/select.types.d.ts +3 -2
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +6 -0
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +5 -0
- package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +12 -0
- package/dist/components/inputs/Selection/shared/selectInput.cva.js +8 -0
- package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +23 -0
- package/dist/components/inputs/Selection/shared/staticSelect.utils.js +54 -0
- package/dist/components/inputs/Selection/shared/staticSelect.utils.spec.d.ts +1 -0
- package/dist/components/inputs/Selection/shared/useSelectItems.js +109 -49
- package/dist/components/inputs/Skeleton/InputFrame.d.ts +83 -0
- package/dist/components/inputs/Skeleton/InputFrame.js +612 -0
- package/dist/components/inputs/Slider/Slider.d.ts +2 -1
- package/dist/components/inputs/Slider/Slider.js +265 -76
- package/dist/components/inputs/TextEditor/TextEditor.d.ts +1 -0
- package/dist/components/inputs/TextEditor/TextEditor.js +447 -98
- package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +37 -11
- package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +102 -30
- package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +194 -45
- package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +88 -28
- package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +48 -14
- package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +66 -19
- package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +49 -15
- package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +92 -32
- package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +126 -54
- package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +141 -38
- package/dist/components/inputs/Toggle/Toggle.d.ts +1 -0
- package/dist/components/inputs/Toggle/Toggle.js +214 -37
- package/dist/components/inputs/Toggle/toggle.cva.d.ts +3 -0
- package/dist/components/inputs/Toggle/toggle.cva.js +2 -1
- package/dist/components/inputs/shared/CheckContent.d.ts +2 -1
- package/dist/components/inputs/shared/CheckContent.js +21 -11
- package/dist/components/inputs/shared/InputClear.d.ts +2 -1
- package/dist/components/inputs/shared/InputClear.js +88 -12
- package/dist/components/inputs/shared/TooltipWrapper.js +50 -11
- package/dist/components/inputs/shared/input.cva.d.ts +28 -0
- package/dist/components/inputs/shared/input.cva.js +38 -4
- package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +8 -0
- package/dist/components/inputs/shared/tooltipWrapper.cva.js +5 -0
- package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +15 -0
- package/dist/components/inputs/shared/useStaticInputHandoff.js +112 -0
- package/dist/components/navigation/Accordion/Accordion.js +69 -22
- package/dist/components/navigation/Accordion/AccordionItem.js +86 -41
- package/dist/components/navigation/Stepper/Stepper.js +67 -22
- package/dist/components/navigation/Stepper/StepperItem.js +104 -31
- package/dist/components/navigation/Stepper/StepperSeparator.js +23 -5
- package/dist/components/overlays/ActionModal/ActionModal.js +169 -35
- package/dist/components/overlays/BottomSheet/BottomSheet.js +96 -23
- package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +48 -8
- package/dist/components/overlays/Drawer/Drawer.js +62 -20
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +85 -28
- package/dist/components/overlays/Tooltip/Tooltip.js +137 -28
- package/dist/components/overlays/Tooltip/TooltipEllipsis.js +37 -12
- package/dist/components/segment/Segment.js +218 -57
- package/dist/components/segment/SegmentItem.js +67 -10
- package/dist/components/shared/pagination/Pagination.js +108 -22
- package/dist/components/shared/pagination/PaginationList.js +167 -64
- package/dist/components/shared/pagination/minWidth.cva.d.ts +1 -1
- package/dist/components/status/Alert/Alert.js +97 -30
- package/dist/components/status/Loader/Loader.js +77 -22
- package/dist/components/status/Toast/Toast.js +28 -14
- package/dist/components/status/Toast/toast.cva.d.ts +1 -1
- package/dist/components/status/Toast/useToast.js +62 -57
- package/dist/components/table/ColumnConfig.js +158 -54
- package/dist/components/table/InfiniteTable.js +67 -16
- package/dist/components/table/PaginatedTable.js +84 -18
- package/dist/components/table/Table.js +28 -27
- package/dist/components/text/Link/Link.js +19 -7
- package/dist/components/text/Typography/Typography.js +23 -8
- package/dist/config/confirmation.context.js +1 -1
- package/dist/config/link.context.js +23 -9
- package/dist/config/router.context.js +42 -16
- package/dist/config/theme.context.js +98 -45
- package/dist/config/uiConfig.context.d.ts +20 -6
- package/dist/config/uiConfig.context.js +68 -14
- package/dist/config/uiOverrides.context.d.ts +30 -11
- package/dist/config/uiOverrides.context.js +54 -14
- package/dist/helpers/dynamicInputs.d.ts +12 -9
- package/dist/helpers/dynamicInputs.js +13 -8
- package/dist/hooks/useAutosave.d.ts +2 -1
- package/dist/hooks/useAutosave.js +12 -4
- package/dist/hooks/useAutosave.spec.d.ts +1 -0
- package/dist/hooks/useBreakpoint.js +16 -3
- package/dist/hooks/useDebounceCallback.js +51 -17
- package/dist/hooks/useFilters.js +125 -64
- package/dist/hooks/useForm.js +42 -8
- package/dist/hooks/useFormAutosave.d.ts +3 -1
- package/dist/hooks/useFormAutosave.js +122 -30
- package/dist/hooks/useFormAutosave.spec.d.ts +1 -0
- package/dist/hooks/useIntersectionObserver.d.ts +1 -1
- package/dist/hooks/useIntersectionObserver.js +91 -24
- package/dist/hooks/useKeyInteractions.d.ts +20 -0
- package/dist/hooks/useKeyInteractions.js +54 -0
- package/dist/hooks/useKeyInteractions.spec.d.ts +1 -0
- package/dist/hooks/useLocalStorage.js +43 -10
- package/dist/hooks/useLongPressRepeat.js +55 -20
- package/dist/hooks/usePagination.js +49 -19
- package/dist/hooks/useQueryAutocomplete.d.ts +14 -0
- package/dist/hooks/useQueryAutocomplete.js +72 -0
- package/dist/hooks/useScrollableListBox.js +37 -16
- package/dist/hooks/useSorting.js +69 -28
- package/dist/hooks/useStateAndRef.js +21 -7
- package/dist/hooks/useTableColumnConfig.js +124 -31
- package/dist/hooks/useTranslationMemo.js +25 -5
- package/dist/index.d.ts +18 -3
- package/dist/index.js +15 -5
- package/dist/tw-ui-plugin.js +6 -0
- package/dist/utils/date-time.utils.d.ts +38 -10
- package/dist/utils/date-time.utils.js +136 -22
- package/dist/utils/query.utils.d.ts +4 -0
- package/dist/utils/query.utils.js +8 -0
- package/dist/utils/zod.utils.d.ts +2 -0
- package/dist/utils/zod.utils.js +5 -0
- package/package.json +2 -2
|
@@ -1,26 +1,235 @@
|
|
|
1
|
+
import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
2
|
+
import { Typography } from "../../../text/Typography/Typography.js";
|
|
3
|
+
import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
4
|
+
import { InputFrame } from "../../Skeleton/InputFrame.js";
|
|
5
|
+
import { useStaticInputHandoff } from "../../shared/useStaticInputHandoff.js";
|
|
6
|
+
import { selectInputTagsContentWrapperDefinition } from "../shared/selectInput.cva.js";
|
|
1
7
|
import { SelectBase } from "../shared/SelectBase.js";
|
|
2
|
-
import {
|
|
8
|
+
import { StaticSelectTrailingContent } from "../shared/StaticSelectTrailingContent.js";
|
|
9
|
+
import { getStaticSelectValue } from "../shared/staticSelect.utils.js";
|
|
10
|
+
import { c } from "react/compiler-runtime";
|
|
11
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
import { clsx } from "clsx";
|
|
13
|
+
import { useRef, useState } from "react";
|
|
3
14
|
import { mergeRefs } from "@react-aria/utils";
|
|
4
15
|
import { Controller } from "react-hook-form";
|
|
5
16
|
//#region src/components/inputs/Selection/Select/Select.tsx
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
function SelectInner(t0) {
|
|
18
|
+
const $ = c(6);
|
|
19
|
+
const { renderStaticInput, isFormControlDisabled, ...props } = t0;
|
|
20
|
+
const ui = UIConfig.useConfig();
|
|
21
|
+
const selectInputTagsContentWrapperCva = UIOverrides.useCva("select.tagsContentWrapperCva", selectInputTagsContentWrapperDefinition);
|
|
22
|
+
const [renderInput, setRenderInput] = useState(!(renderStaticInput ?? ui.renderStaticInput));
|
|
23
|
+
const rootRef = useRef(null);
|
|
24
|
+
let t1;
|
|
25
|
+
if ($[0] !== renderInput) {
|
|
26
|
+
t1 = {
|
|
27
|
+
inputRef: rootRef,
|
|
28
|
+
renderInput,
|
|
29
|
+
setRenderInput,
|
|
30
|
+
getFocusTarget: _temp
|
|
31
|
+
};
|
|
32
|
+
$[0] = renderInput;
|
|
33
|
+
$[1] = t1;
|
|
34
|
+
} else t1 = $[1];
|
|
35
|
+
const { renderRealInput, replayStaticInputChange, replayStaticInputPress } = useStaticInputHandoff(t1);
|
|
36
|
+
const currentValue = props.value;
|
|
37
|
+
if (!renderInput && props.selectionMode !== "multiple" && !!props.showSelectionContent && currentValue != null) setRenderInput(true);
|
|
38
|
+
if (!renderInput && !!props.customTrigger) setRenderInput(true);
|
|
39
|
+
if (!renderInput) {
|
|
40
|
+
const as = props.as ?? ui.input.as;
|
|
41
|
+
const size = props.size ?? ui.input.size;
|
|
42
|
+
let isDisabled = !!props.isDisabled;
|
|
43
|
+
if (isFormControlDisabled) isDisabled = true;
|
|
44
|
+
const mode = props.selectionMode ?? ui.select.selectionMode;
|
|
45
|
+
const isMultiple = mode === "multiple";
|
|
46
|
+
const { selectedItem, displayValue, isEmpty } = getStaticSelectValue({
|
|
47
|
+
items: props.items,
|
|
48
|
+
value: currentValue,
|
|
49
|
+
selectionMode: mode,
|
|
50
|
+
initialSelection: props.initialSelection,
|
|
51
|
+
mapInitialToSelectItem: props.mapInitialToSelectItem,
|
|
52
|
+
showSelectionContent: props.showSelectionContent,
|
|
53
|
+
isDisabled,
|
|
54
|
+
collapseAfter: props.collapseAfter ?? ui.select.collapseAfter,
|
|
55
|
+
selectedTagsType: props.selectedTagsType ?? ui.select.selectedTagsType
|
|
56
|
+
});
|
|
57
|
+
const isSearchable = props.isSearchable ?? ui.select.isSearchable;
|
|
58
|
+
const trailingContent = /* @__PURE__ */ jsx(StaticSelectTrailingContent, {
|
|
59
|
+
trailingContent: props.trailingContent,
|
|
60
|
+
hideDropdownIcon: props.hideDropdownIcon,
|
|
61
|
+
isDisabled,
|
|
62
|
+
size
|
|
63
|
+
});
|
|
64
|
+
const placeholder = as === "floating" ? null : props.placeholder;
|
|
65
|
+
const inputValue = !isMultiple && selectedItem ? selectedItem.label : "";
|
|
66
|
+
const shouldRenderPlaceholderAfterValue = isMultiple && props.placeholder && !isEmpty;
|
|
67
|
+
const dataAttributes = {
|
|
68
|
+
dataIsEmpty: isEmpty,
|
|
69
|
+
dataIsFilled: !isEmpty,
|
|
70
|
+
dataIsDirty: props.isDirty,
|
|
71
|
+
dataIsRequired: props.isRequired,
|
|
72
|
+
dataIsDisabled: isDisabled,
|
|
73
|
+
dataDisabled: isDisabled,
|
|
74
|
+
dataInvalid: !!props.error,
|
|
75
|
+
dataHasSelection: !isEmpty,
|
|
76
|
+
dataHasSearch: false
|
|
77
|
+
};
|
|
78
|
+
const buttonContent = isMultiple && !isEmpty ? /* @__PURE__ */ jsx(Fragment, { children: "\xA0" }) : isEmpty ? /* @__PURE__ */ jsx(Typography, {
|
|
79
|
+
size: "label-1",
|
|
80
|
+
as: "span",
|
|
81
|
+
className: "block truncate text-text-default-3",
|
|
82
|
+
children: placeholder
|
|
83
|
+
}) : /* @__PURE__ */ jsx(Typography, {
|
|
84
|
+
size: "label-1",
|
|
85
|
+
as: "span",
|
|
86
|
+
className: "block truncate",
|
|
87
|
+
children: displayValue
|
|
88
|
+
});
|
|
89
|
+
return /* @__PURE__ */ jsx(InputFrame, {
|
|
90
|
+
...props,
|
|
91
|
+
isDisabled,
|
|
92
|
+
isLoading: false,
|
|
93
|
+
className: clsx("w-full", props.containerClassName),
|
|
94
|
+
inputClassName: clsx(props.className, props.inputClassName),
|
|
95
|
+
contentWrapperClassName: selectInputTagsContentWrapperCva({ isSearchable }),
|
|
96
|
+
contentGroup: "select",
|
|
97
|
+
typographySize: "label-1",
|
|
98
|
+
labelPlacement: "content-row",
|
|
99
|
+
dataAttributes,
|
|
100
|
+
wrapTrailingContent: false,
|
|
101
|
+
onStaticInteract: renderRealInput,
|
|
102
|
+
onStaticPress: replayStaticInputPress,
|
|
103
|
+
leadingContent: props.leadingContent && /* @__PURE__ */ jsx("div", {
|
|
104
|
+
className: "ml-input-side-default flex shrink-0 items-center",
|
|
105
|
+
children: props.leadingContent
|
|
106
|
+
}),
|
|
107
|
+
showClear: false,
|
|
108
|
+
trailingContent,
|
|
109
|
+
children: (dataAttributeProps) => /* @__PURE__ */ jsxs(Fragment, { children: [isMultiple && !isEmpty && displayValue, isSearchable ? /* @__PURE__ */ jsx("input", {
|
|
110
|
+
disabled: isDisabled,
|
|
111
|
+
tabIndex: -1,
|
|
112
|
+
role: "combobox",
|
|
113
|
+
"aria-autocomplete": "list",
|
|
114
|
+
"aria-controls": `${dataAttributeProps.id}-listbox`,
|
|
115
|
+
"aria-expanded": false,
|
|
116
|
+
value: inputValue,
|
|
117
|
+
placeholder: shouldRenderPlaceholderAfterValue ? props.placeholder : placeholder ?? void 0,
|
|
118
|
+
className: clsx("w-full flex-1 bg-transparent outline-none placeholder:text-text-default-3 disabled:text-interactive-text-secondary-disabled", props.inputClassName),
|
|
119
|
+
onChange: (event) => replayStaticInputChange(event.target.value),
|
|
120
|
+
...dataAttributeProps,
|
|
121
|
+
"data-rac": true
|
|
122
|
+
}) : /* @__PURE__ */ jsx("button", {
|
|
123
|
+
type: "button",
|
|
124
|
+
disabled: isDisabled,
|
|
125
|
+
tabIndex: -1,
|
|
126
|
+
"data-type": "select-trigger",
|
|
127
|
+
className: clsx("w-full truncate bg-transparent text-start outline-none disabled:text-interactive-text-secondary-disabled", isMultiple && !isEmpty && "absolute inset-0 z-0"),
|
|
128
|
+
onClick: replayStaticInputPress,
|
|
129
|
+
...dataAttributeProps,
|
|
130
|
+
"data-rac": true,
|
|
131
|
+
children: buttonContent
|
|
132
|
+
})] })
|
|
21
133
|
});
|
|
22
134
|
}
|
|
23
|
-
|
|
24
|
-
|
|
135
|
+
const T0 = SelectBase;
|
|
136
|
+
const t2 = mergeRefs(props.ref, rootRef);
|
|
137
|
+
let t3;
|
|
138
|
+
if ($[2] !== T0 || $[3] !== props || $[4] !== t2) {
|
|
139
|
+
t3 = /* @__PURE__ */ jsx(T0, {
|
|
140
|
+
...props,
|
|
141
|
+
ref: t2
|
|
142
|
+
});
|
|
143
|
+
$[2] = T0;
|
|
144
|
+
$[3] = props;
|
|
145
|
+
$[4] = t2;
|
|
146
|
+
$[5] = t3;
|
|
147
|
+
} else t3 = $[5];
|
|
148
|
+
return t3;
|
|
149
|
+
}
|
|
150
|
+
function _temp(root) {
|
|
151
|
+
return root.querySelector("[data-type='select-trigger'], input, button, [tabindex]");
|
|
152
|
+
}
|
|
153
|
+
function Select(t0) {
|
|
154
|
+
const $ = c(21);
|
|
155
|
+
let props;
|
|
156
|
+
let renderStaticInput;
|
|
157
|
+
if ($[0] !== t0) {
|
|
158
|
+
({renderStaticInput, ...props} = t0);
|
|
159
|
+
$[0] = t0;
|
|
160
|
+
$[1] = props;
|
|
161
|
+
$[2] = renderStaticInput;
|
|
162
|
+
} else {
|
|
163
|
+
props = $[1];
|
|
164
|
+
renderStaticInput = $[2];
|
|
165
|
+
}
|
|
166
|
+
if ("formControl" in props && props.formControl) {
|
|
167
|
+
let formControl;
|
|
168
|
+
let innerProps;
|
|
169
|
+
let ref;
|
|
170
|
+
if ($[3] !== props) {
|
|
171
|
+
({formControl, ref, ...innerProps} = props);
|
|
172
|
+
$[3] = props;
|
|
173
|
+
$[4] = formControl;
|
|
174
|
+
$[5] = innerProps;
|
|
175
|
+
$[6] = ref;
|
|
176
|
+
} else {
|
|
177
|
+
formControl = $[4];
|
|
178
|
+
innerProps = $[5];
|
|
179
|
+
ref = $[6];
|
|
180
|
+
}
|
|
181
|
+
const controlWithOptions = formControl.control;
|
|
182
|
+
let t1;
|
|
183
|
+
if ($[7] !== controlWithOptions._options?.disabled || $[8] !== innerProps || $[9] !== props.error || $[10] !== props.isDisabled || $[11] !== ref || $[12] !== renderStaticInput) {
|
|
184
|
+
t1 = (t2) => {
|
|
185
|
+
const { field, fieldState: t3 } = t2;
|
|
186
|
+
const { error, isDirty } = t3;
|
|
187
|
+
return /* @__PURE__ */ jsx(SelectInner, {
|
|
188
|
+
...innerProps,
|
|
189
|
+
ref: mergeRefs(ref, field.ref),
|
|
190
|
+
value: field.value,
|
|
191
|
+
onChange: field.onChange,
|
|
192
|
+
onBlur: field.onBlur,
|
|
193
|
+
isDirty,
|
|
194
|
+
isDisabled: field.disabled || props.isDisabled,
|
|
195
|
+
isFormControlDisabled: !!controlWithOptions._options?.disabled,
|
|
196
|
+
error: props.error ?? error?.message,
|
|
197
|
+
renderStaticInput
|
|
198
|
+
});
|
|
199
|
+
};
|
|
200
|
+
$[7] = controlWithOptions._options?.disabled;
|
|
201
|
+
$[8] = innerProps;
|
|
202
|
+
$[9] = props.error;
|
|
203
|
+
$[10] = props.isDisabled;
|
|
204
|
+
$[11] = ref;
|
|
205
|
+
$[12] = renderStaticInput;
|
|
206
|
+
$[13] = t1;
|
|
207
|
+
} else t1 = $[13];
|
|
208
|
+
let t2;
|
|
209
|
+
if ($[14] !== formControl.control || $[15] !== formControl.name || $[16] !== t1) {
|
|
210
|
+
t2 = /* @__PURE__ */ jsx(Controller, {
|
|
211
|
+
control: formControl.control,
|
|
212
|
+
name: formControl.name,
|
|
213
|
+
render: t1
|
|
214
|
+
});
|
|
215
|
+
$[14] = formControl.control;
|
|
216
|
+
$[15] = formControl.name;
|
|
217
|
+
$[16] = t1;
|
|
218
|
+
$[17] = t2;
|
|
219
|
+
} else t2 = $[17];
|
|
220
|
+
return t2;
|
|
221
|
+
}
|
|
222
|
+
let t1;
|
|
223
|
+
if ($[18] !== props || $[19] !== renderStaticInput) {
|
|
224
|
+
t1 = /* @__PURE__ */ jsx(SelectInner, {
|
|
225
|
+
...props,
|
|
226
|
+
renderStaticInput
|
|
227
|
+
});
|
|
228
|
+
$[18] = props;
|
|
229
|
+
$[19] = renderStaticInput;
|
|
230
|
+
$[20] = t1;
|
|
231
|
+
} else t1 = $[20];
|
|
232
|
+
return t1;
|
|
233
|
+
}
|
|
25
234
|
//#endregion
|
|
26
235
|
export { Select };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactElement, Ref } from 'react';
|
|
1
|
+
import { FocusEventHandler, MouseEventHandler, ReactElement, ReactNode, Ref } from 'react';
|
|
2
2
|
import { AriaButtonProps } from 'react-aria';
|
|
3
3
|
import { Key } from 'react-aria-components';
|
|
4
4
|
import { FormFieldProps } from '../../FormField/FormField';
|
|
@@ -8,22 +8,29 @@ import { InputVariantProps } from '../../shared/input.cva';
|
|
|
8
8
|
export type SelectBaseProps<TKey extends Key = Key, TInitialSelectItem = DefaultInitialSelectItem<TKey>> = FormFieldProps & GroupedSelectProps<TKey, TInitialSelectItem> & SelectNewItemProps & SelectAsyncProps & SelectVirtualizationProps & InputVariantProps & Pick<AriaButtonProps, "onBlur"> & {
|
|
9
9
|
ref?: Ref<HTMLDivElement>;
|
|
10
10
|
className?: string;
|
|
11
|
+
isDirty?: boolean;
|
|
11
12
|
placeholder?: string;
|
|
12
13
|
hideDropdownIcon?: boolean;
|
|
13
14
|
hideSearchIcon?: boolean;
|
|
14
15
|
isSearchable?: boolean;
|
|
15
16
|
isClearable?: boolean;
|
|
16
17
|
isClientSearchDisabled?: boolean;
|
|
18
|
+
ignoreInputValueFiltering?: boolean;
|
|
17
19
|
ignoreTriggerWidth?: boolean;
|
|
18
20
|
items: SelectItem<TKey>[];
|
|
19
21
|
inputClassName?: string;
|
|
20
22
|
containerClassName?: string;
|
|
23
|
+
leadingContent?: ReactNode;
|
|
24
|
+
trailingContent?: ReactNode;
|
|
21
25
|
customTrigger?: ReactElement;
|
|
22
26
|
selectedTagsType?: "tags" | "list";
|
|
23
27
|
collapseAfter?: number;
|
|
28
|
+
fireBlurOnChange?: boolean;
|
|
24
29
|
onInputChange?: (value: string) => void;
|
|
25
30
|
onSearchChange?: (value: string) => void;
|
|
26
31
|
mapInitialToSelectItem?: (item: TInitialSelectItem) => SelectItem<TKey>;
|
|
32
|
+
onMouseEnter?: MouseEventHandler<HTMLDivElement>;
|
|
33
|
+
onFocusCapture?: FocusEventHandler<HTMLDivElement>;
|
|
27
34
|
bottomSheetProps?: Partial<Omit<BottomSheetProps, "children" | "isOpen" | "onOpenChange" | "onStateChange" | "label" | "footer">>;
|
|
28
35
|
};
|
|
29
36
|
export declare const SelectBase: <TKey extends Key = Key, TInitialSelectItem = DefaultInitialSelectItem<TKey>>(dProps: SelectBaseProps<TKey, TInitialSelectItem>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,29 +3,80 @@ 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";
|
|
6
|
+
import { c } from "react/compiler-runtime";
|
|
6
7
|
import { jsx } from "react/jsx-runtime";
|
|
7
8
|
//#region src/components/inputs/Selection/shared/SelectBase.tsx
|
|
8
9
|
var SelectBase = (dProps) => {
|
|
10
|
+
const $ = c(21);
|
|
9
11
|
const ui = UIConfig.useConfig();
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
12
|
+
const t0 = dProps.selectionMode ?? ui.select.selectionMode;
|
|
13
|
+
const t1 = dProps.variant ?? ui.input.variant;
|
|
14
|
+
const t2 = dProps.as ?? ui.input.as;
|
|
15
|
+
const t3 = dProps.size ?? ui.input.size;
|
|
16
|
+
const t4 = dProps.hideLabel ?? ui.input.hideLabel;
|
|
17
|
+
const t5 = dProps.isClearable ?? ui.input.isClearable;
|
|
18
|
+
const t6 = dProps.isSearchable ?? ui.select.isSearchable;
|
|
19
|
+
const t7 = dProps.selectedTagsType ?? ui.select.selectedTagsType;
|
|
20
|
+
const t8 = dProps.virtualizerOptions || (dProps.totalItems ?? 0) > 100 || dProps.hasLoadMore ? false : dProps.ignoreTriggerWidth ?? false;
|
|
21
|
+
const t9 = dProps.collapseAfter ?? ui.select.collapseAfter;
|
|
22
|
+
const t10 = dProps.hideSearchIcon ?? ui.select.hideSearchIcon;
|
|
23
|
+
const t11 = dProps.fireBlurOnChange ?? ui.select.fireBlurOnChange;
|
|
24
|
+
const t12 = dProps.ignoreInputValueFiltering ?? dProps.isClientSearchDisabled;
|
|
25
|
+
let t13;
|
|
26
|
+
if ($[0] !== dProps || $[1] !== t0 || $[2] !== t1 || $[3] !== t10 || $[4] !== t11 || $[5] !== t12 || $[6] !== t2 || $[7] !== t3 || $[8] !== t4 || $[9] !== t5 || $[10] !== t6 || $[11] !== t7 || $[12] !== t8 || $[13] !== t9) {
|
|
27
|
+
t13 = {
|
|
28
|
+
...dProps,
|
|
29
|
+
selectionMode: t0,
|
|
30
|
+
variant: t1,
|
|
31
|
+
as: t2,
|
|
32
|
+
size: t3,
|
|
33
|
+
hideLabel: t4,
|
|
34
|
+
isClearable: t5,
|
|
35
|
+
isSearchable: t6,
|
|
36
|
+
selectedTagsType: t7,
|
|
37
|
+
ignoreTriggerWidth: t8,
|
|
38
|
+
collapseAfter: t9,
|
|
39
|
+
hideSearchIcon: t10,
|
|
40
|
+
fireBlurOnChange: t11,
|
|
41
|
+
isClientSearchDisabled: t12
|
|
42
|
+
};
|
|
43
|
+
$[0] = dProps;
|
|
44
|
+
$[1] = t0;
|
|
45
|
+
$[2] = t1;
|
|
46
|
+
$[3] = t10;
|
|
47
|
+
$[4] = t11;
|
|
48
|
+
$[5] = t12;
|
|
49
|
+
$[6] = t2;
|
|
50
|
+
$[7] = t3;
|
|
51
|
+
$[8] = t4;
|
|
52
|
+
$[9] = t5;
|
|
53
|
+
$[10] = t6;
|
|
54
|
+
$[11] = t7;
|
|
55
|
+
$[12] = t8;
|
|
56
|
+
$[13] = t9;
|
|
57
|
+
$[14] = t13;
|
|
58
|
+
} else t13 = $[14];
|
|
59
|
+
const props = t13;
|
|
24
60
|
const isDesktop = useBreakpoint("md");
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
61
|
+
const t14 = props;
|
|
62
|
+
let t15;
|
|
63
|
+
if ($[15] !== isDesktop || $[16] !== props) {
|
|
64
|
+
t15 = isDesktop ? /* @__PURE__ */ jsx(SelectDesktop, { ...props }) : /* @__PURE__ */ jsx(SelectMobile, { ...props });
|
|
65
|
+
$[15] = isDesktop;
|
|
66
|
+
$[16] = props;
|
|
67
|
+
$[17] = t15;
|
|
68
|
+
} else t15 = $[17];
|
|
69
|
+
let t16;
|
|
70
|
+
if ($[18] !== t14 || $[19] !== t15) {
|
|
71
|
+
t16 = /* @__PURE__ */ jsx(SelectContext.Provider, {
|
|
72
|
+
...t14,
|
|
73
|
+
children: t15
|
|
74
|
+
});
|
|
75
|
+
$[18] = t14;
|
|
76
|
+
$[19] = t15;
|
|
77
|
+
$[20] = t16;
|
|
78
|
+
} else t16 = $[20];
|
|
79
|
+
return t16;
|
|
29
80
|
};
|
|
30
81
|
//#endregion
|
|
31
82
|
export { SelectBase };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Key } from 'react-aria-components';
|
|
2
2
|
import { SelectBaseProps } from './SelectBase';
|
|
3
3
|
type SelectDesktopProps<TKey extends Key = Key> = SelectBaseProps<TKey>;
|
|
4
|
-
export declare const SelectDesktop: <TKey extends Key = Key>({ ref, error, ignoreTriggerWidth, showSelectionContent, inputClassName, containerClassName, customTrigger, onBlur, ...props }: SelectDesktopProps<TKey>) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare const SelectDesktop: <TKey extends Key = Key>({ ref, error, ignoreTriggerWidth, showSelectionContent, inputClassName, containerClassName, leadingContent, trailingContent, customTrigger, onBlur, onMouseEnter, onFocusCapture, ...props }: SelectDesktopProps<TKey>) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export {};
|