@povio/ui 2.3.0 → 2.3.2-rc.1
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 +97 -38
- package/dist/components/Menu/MenuPopover.js +105 -29
- 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/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 +4 -1
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +11 -5
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +364 -76
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +11 -5
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +452 -167
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +12 -5
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +269 -57
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +6 -3
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +605 -130
- package/dist/components/inputs/DateTime/shared/Calendar.d.ts +5 -2
- package/dist/components/inputs/DateTime/shared/Calendar.js +332 -119
- package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +3 -2
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +301 -102
- package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +3 -2
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +146 -33
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +249 -93
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +318 -137
- package/dist/components/inputs/DateTime/shared/DateField.js +311 -112
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +12 -3
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +382 -138
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +15 -0
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +96 -11
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +81 -27
- 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 +210 -65
- package/dist/components/inputs/DateTime/shared/YearPicker.js +119 -68
- package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +4 -0
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +7 -0
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +13 -0
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +14 -0
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +117 -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 +39 -0
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +85 -0
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.spec.d.ts +1 -0
- package/dist/components/inputs/File/FileUpload.js +87 -44
- package/dist/components/inputs/File/FileUploadContainer.js +15 -7
- package/dist/components/inputs/File/InputUpload.js +317 -79
- 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 +50 -9
- package/dist/components/inputs/File/shared/ProgressBar.js +48 -9
- 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 +6 -0
- package/dist/components/inputs/FormField/formFieldHeader.cva.js +11 -0
- package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +5 -2
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +450 -95
- 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 +575 -0
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +48 -9
- package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +4 -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 +421 -91
- package/dist/components/inputs/Input/shared/InputContent.js +192 -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 -60
- package/dist/components/inputs/RadioGroup/radio.cva.d.ts +17 -0
- package/dist/components/inputs/RadioGroup/radio.cva.js +42 -1
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +6 -2
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +213 -22
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +3 -18
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +34 -8
- package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +36 -0
- package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +14 -0
- package/dist/components/inputs/Selection/Select/QuerySelect.js +104 -0
- package/dist/components/inputs/Selection/Select/Select.d.ts +7 -3
- package/dist/components/inputs/Selection/Select/Select.js +224 -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 +330 -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 +12 -5
- 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 +7 -0
- package/dist/components/inputs/Selection/shared/querySelect.utils.js +24 -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 +3 -0
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +5 -0
- package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +5 -0
- package/dist/components/inputs/Selection/shared/selectInput.cva.js +5 -0
- package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +23 -0
- package/dist/components/inputs/Selection/shared/staticSelect.utils.js +37 -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 +80 -0
- package/dist/components/inputs/Skeleton/InputFrame.js +528 -0
- package/dist/components/inputs/Slider/Slider.d.ts +2 -1
- package/dist/components/inputs/Slider/Slider.js +265 -75
- 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 +4 -2
- 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 +89 -10
- package/dist/components/inputs/shared/StaticInput.d.ts +38 -0
- package/dist/components/inputs/shared/TooltipWrapper.js +50 -11
- package/dist/components/inputs/shared/input.cva.d.ts +10 -0
- package/dist/components/inputs/shared/input.cva.js +54 -14
- package/dist/components/inputs/shared/label.cva.js +2 -2
- package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +4 -0
- package/dist/components/inputs/shared/tooltipWrapper.cva.js +5 -0
- package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +14 -0
- package/dist/components/inputs/shared/useStaticInputHandoff.js +100 -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 +122 -25
- 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 +83 -27
- 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/status/Alert/Alert.js +97 -30
- package/dist/components/status/Loader/Loader.js +77 -22
- package/dist/components/status/Toast/Toast.js +21 -13
- 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 +21 -7
- package/dist/config/uiConfig.context.js +68 -15
- package/dist/config/uiStyle.context.d.ts +27 -4
- package/dist/config/uiStyle.context.js +15 -5
- package/dist/helpers/dynamicInputs.d.ts +5 -5
- package/dist/helpers/dynamicInputs.js +3 -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.js +101 -30
- package/dist/hooks/useIntersectionObserver.d.ts +1 -1
- package/dist/hooks/useIntersectionObserver.js +91 -24
- 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 +57 -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 +7 -0
- package/dist/index.js +4 -2
- package/dist/tw-ui-plugin.js +8 -1
- package/dist/utils/date-time.utils.d.ts +38 -10
- package/dist/utils/date-time.utils.js +134 -22
- package/dist/utils/dom.utils.js +1 -1
- package/dist/utils/query.utils.d.ts +4 -0
- package/dist/utils/query.utils.js +8 -0
- package/package.json +1 -1
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { FC, FocusEventHandler, MouseEventHandler, ReactElement, ReactNode, Ref, SVGProps } from 'react';
|
|
2
|
+
import { InlineIconButtonProps } from '../../buttons/InlineIconButton/InlineIconButton';
|
|
3
|
+
import { FormFieldProps } from '../FormField/FormField';
|
|
4
|
+
import { FormFieldHeaderProps } from '../FormField/FormFieldHeader';
|
|
5
|
+
import { InputVariantProps } from '../shared/input.cva';
|
|
6
|
+
import { TypographyVariantProps } from '../../text/Typography/typography.cva';
|
|
7
|
+
type InputFrameIcon = FC<SVGProps<SVGSVGElement>> | ReactElement;
|
|
8
|
+
interface InputFrameAction {
|
|
9
|
+
icon: InlineIconButtonProps["icon"];
|
|
10
|
+
onClick: () => void;
|
|
11
|
+
altText: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
interface InputFrameDataAttributes {
|
|
15
|
+
dataDisabled?: boolean;
|
|
16
|
+
dataHasSearch?: boolean;
|
|
17
|
+
dataHasSelection?: boolean;
|
|
18
|
+
dataInvalid?: boolean;
|
|
19
|
+
dataIsDirty?: boolean;
|
|
20
|
+
dataIsDisabled?: boolean;
|
|
21
|
+
dataIsEmpty?: boolean;
|
|
22
|
+
dataIsFilled?: boolean;
|
|
23
|
+
dataIsRequired?: boolean;
|
|
24
|
+
}
|
|
25
|
+
type InputFrameDataAttributeProps = {
|
|
26
|
+
"data-disabled"?: boolean;
|
|
27
|
+
"data-has-search"?: boolean;
|
|
28
|
+
"data-has-selection"?: boolean;
|
|
29
|
+
"data-invalid"?: boolean;
|
|
30
|
+
"data-is-dirty"?: boolean;
|
|
31
|
+
"data-is-disabled"?: boolean;
|
|
32
|
+
"data-is-empty"?: boolean;
|
|
33
|
+
"data-is-filled"?: boolean;
|
|
34
|
+
"data-is-required"?: boolean;
|
|
35
|
+
};
|
|
36
|
+
type InputFrameChildProps = InputFrameDataAttributeProps & {
|
|
37
|
+
id: string;
|
|
38
|
+
};
|
|
39
|
+
type InputFrameChildren = ReactNode | ((childProps: InputFrameChildProps) => ReactNode);
|
|
40
|
+
type InputFrameLabelPlacement = "content-wrapper" | "content-row";
|
|
41
|
+
type InputFrameActionContentPlacement = "content-wrapper" | "content-row";
|
|
42
|
+
export interface InputFrameProps extends InputVariantProps, Partial<FormFieldProps> {
|
|
43
|
+
ref?: Ref<HTMLDivElement>;
|
|
44
|
+
children: InputFrameChildren;
|
|
45
|
+
formFieldRef?: Ref<HTMLDivElement>;
|
|
46
|
+
onMouseEnter?: MouseEventHandler<HTMLDivElement>;
|
|
47
|
+
onFocusCapture?: FocusEventHandler<HTMLDivElement>;
|
|
48
|
+
labelProps?: FormFieldHeaderProps["labelProps"];
|
|
49
|
+
headerProps?: FormFieldHeaderProps;
|
|
50
|
+
leadingContent?: ReactNode;
|
|
51
|
+
leadingIcon?: InputFrameIcon;
|
|
52
|
+
actionContent?: ReactNode;
|
|
53
|
+
actionContentPlacement?: InputFrameActionContentPlacement;
|
|
54
|
+
trailingContent?: ReactNode;
|
|
55
|
+
trailingIcon?: InputFrameIcon;
|
|
56
|
+
trailingAction?: ReactNode;
|
|
57
|
+
unit?: string;
|
|
58
|
+
isLoading?: boolean;
|
|
59
|
+
action?: InputFrameAction;
|
|
60
|
+
isClearable?: boolean;
|
|
61
|
+
showClear?: boolean;
|
|
62
|
+
renderStatic?: boolean;
|
|
63
|
+
onStaticInteract?: (shouldFocus: boolean) => void;
|
|
64
|
+
clearClassName?: string;
|
|
65
|
+
onClear?: () => void;
|
|
66
|
+
dataAttributes?: InputFrameDataAttributes;
|
|
67
|
+
typographySize?: TypographyVariantProps["size"];
|
|
68
|
+
id?: string;
|
|
69
|
+
inputClassName?: string;
|
|
70
|
+
contentClassName?: string;
|
|
71
|
+
contentWrapperClassName?: string;
|
|
72
|
+
contentAndTrailingClassName?: string;
|
|
73
|
+
wrapContentAndTrailing?: boolean;
|
|
74
|
+
wrapTrailingContent?: boolean;
|
|
75
|
+
reserveTrailingContent?: boolean;
|
|
76
|
+
labelPlacement?: InputFrameLabelPlacement;
|
|
77
|
+
trailingClassName?: string;
|
|
78
|
+
}
|
|
79
|
+
export declare const InputFrame: (props: InputFrameProps) => import("react/jsx-runtime").JSX.Element;
|
|
80
|
+
export {};
|
|
@@ -0,0 +1,528 @@
|
|
|
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 { UIConfig } from "../../../config/uiConfig.context.js";
|
|
5
|
+
import { InlineIconButton } from "../../buttons/InlineIconButton/InlineIconButton.js";
|
|
6
|
+
import { FormFieldLabel } from "../FormField/FormFieldLabel.js";
|
|
7
|
+
import { InputClear } from "../shared/InputClear.js";
|
|
8
|
+
import { inputBase, inputContentWrapper, inputSize } from "../shared/input.cva.js";
|
|
9
|
+
import { FormField } from "../FormField/FormField.js";
|
|
10
|
+
import { TooltipWrapper } from "../shared/TooltipWrapper.js";
|
|
11
|
+
import { c } from "react/compiler-runtime";
|
|
12
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { clsx } from "clsx";
|
|
14
|
+
import { isValidElement, useId } from "react";
|
|
15
|
+
//#region src/components/inputs/Skeleton/InputFrame.tsx
|
|
16
|
+
var InputFrame = (props) => {
|
|
17
|
+
const $ = c(183);
|
|
18
|
+
const ui = UIConfig.useConfig();
|
|
19
|
+
const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
|
|
20
|
+
const inputSizeCva = UIStyle.useCva("input.sizeCva", inputSize);
|
|
21
|
+
const inputContentWrapperCva = UIStyle.useCva("input.contentWrapperCva", inputContentWrapper);
|
|
22
|
+
const typographyCva = UIStyle.useCva("typography.cva", typography);
|
|
23
|
+
const generatedInputId = useId();
|
|
24
|
+
const { ref, children, formFieldRef, labelProps: labelPropsProp, headerProps, error, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isHeaderHidden, hideLabel: hideLabelProp, headerClassName, errorClassName, className, leadingContent, leadingIcon, actionContent, actionContentPlacement: t0, trailingContent, trailingIcon, trailingAction, unit, isLoading, action, isClearable: isClearableProp, showClear, renderStatic, onStaticInteract, clearClassName, onClear, dataAttributes, typographySize, id: idProp, inputClassName, contentClassName, contentWrapperClassName, contentAndTrailingClassName, wrapContentAndTrailing, wrapTrailingContent: t1, reserveTrailingContent, labelPlacement: t2, trailingClassName, onMouseEnter, onFocusCapture, variant: variantProp, as: asProp, size: sizeProp } = props;
|
|
25
|
+
const actionContentPlacement = t0 === void 0 ? "content-wrapper" : t0;
|
|
26
|
+
const wrapTrailingContent = t1 === void 0 ? true : t1;
|
|
27
|
+
const labelPlacement = t2 === void 0 ? "content-wrapper" : t2;
|
|
28
|
+
const as = asProp ?? ui.input.as;
|
|
29
|
+
const size = sizeProp ?? ui.input.size;
|
|
30
|
+
const variant = variantProp ?? ui.input.variant;
|
|
31
|
+
const hideLabel = hideLabelProp ?? ui.input.hideLabel;
|
|
32
|
+
const hasClear = !!(isClearableProp ?? ui.input.isClearable);
|
|
33
|
+
let t3;
|
|
34
|
+
if ($[0] !== leadingIcon) {
|
|
35
|
+
t3 = leadingIcon && isValidElement(leadingIcon);
|
|
36
|
+
$[0] = leadingIcon;
|
|
37
|
+
$[1] = t3;
|
|
38
|
+
} else t3 = $[1];
|
|
39
|
+
const isLeadingIconElement = t3;
|
|
40
|
+
let t4;
|
|
41
|
+
if ($[2] !== trailingIcon) {
|
|
42
|
+
t4 = trailingIcon && isValidElement(trailingIcon);
|
|
43
|
+
$[2] = trailingIcon;
|
|
44
|
+
$[3] = t4;
|
|
45
|
+
} else t4 = $[3];
|
|
46
|
+
const isTrailingIconElement = t4;
|
|
47
|
+
const hasTrailingContent = reserveTrailingContent || hasClear || !!trailingContent || !!unit || !!isLoading || !!action || !!trailingIcon || !!trailingAction;
|
|
48
|
+
const isTrailingInteractive = !!action || !!trailingAction || !!isTrailingIconElement || hasClear && !!showClear || !!trailingContent;
|
|
49
|
+
let dataAttributeProps;
|
|
50
|
+
let formFieldProps;
|
|
51
|
+
let labelProps;
|
|
52
|
+
let t10;
|
|
53
|
+
let t11;
|
|
54
|
+
let t12;
|
|
55
|
+
let t13;
|
|
56
|
+
let t5;
|
|
57
|
+
let t6;
|
|
58
|
+
let t7;
|
|
59
|
+
let t8;
|
|
60
|
+
let t9;
|
|
61
|
+
if ($[4] !== actionContent || $[5] !== actionContentPlacement || $[6] !== as || $[7] !== children || $[8] !== className || $[9] !== contentClassName || $[10] !== contentWrapperClassName || $[11] !== dataAttributes || $[12] !== error || $[13] !== errorClassName || $[14] !== generatedInputId || $[15] !== headerClassName || $[16] !== headerProps || $[17] !== helperText || $[18] !== hideLabel || $[19] !== idProp || $[20] !== inputContentWrapperCva || $[21] !== inputSizeCva || $[22] !== isDisabled || $[23] !== isHeaderHidden || $[24] !== isLeadingIconElement || $[25] !== isRequired || $[26] !== label || $[27] !== labelPlacement || $[28] !== labelPropsProp || $[29] !== leadingContent || $[30] !== leadingIcon || $[31] !== rightContent || $[32] !== size || $[33] !== tooltipText || $[34] !== typographyCva || $[35] !== typographySize) {
|
|
62
|
+
dataAttributeProps = getInputFrameDataAttributeProps(dataAttributes);
|
|
63
|
+
const baseLabelProps = headerProps?.labelProps ?? labelPropsProp;
|
|
64
|
+
const inputId = idProp ?? baseLabelProps?.htmlFor ?? `input-frame_${generatedInputId}`;
|
|
65
|
+
let t14;
|
|
66
|
+
if ($[48] !== baseLabelProps || $[49] !== inputId) {
|
|
67
|
+
t14 = {
|
|
68
|
+
...baseLabelProps,
|
|
69
|
+
htmlFor: inputId
|
|
70
|
+
};
|
|
71
|
+
$[48] = baseLabelProps;
|
|
72
|
+
$[49] = inputId;
|
|
73
|
+
$[50] = t14;
|
|
74
|
+
} else t14 = $[50];
|
|
75
|
+
labelProps = t14;
|
|
76
|
+
const t15 = label ?? "";
|
|
77
|
+
const t16 = isHeaderHidden || as === "inline" || as === "filter" || as === "floating";
|
|
78
|
+
let t17;
|
|
79
|
+
if ($[51] !== className || $[52] !== error || $[53] !== errorClassName || $[54] !== headerClassName || $[55] !== helperText || $[56] !== hideLabel || $[57] !== isDisabled || $[58] !== isRequired || $[59] !== rightContent || $[60] !== t15 || $[61] !== t16 || $[62] !== tooltipText) {
|
|
80
|
+
t17 = {
|
|
81
|
+
error,
|
|
82
|
+
label: t15,
|
|
83
|
+
tooltipText,
|
|
84
|
+
helperText,
|
|
85
|
+
isRequired,
|
|
86
|
+
rightContent,
|
|
87
|
+
isHeaderHidden: t16,
|
|
88
|
+
hideLabel,
|
|
89
|
+
isDisabled,
|
|
90
|
+
headerClassName,
|
|
91
|
+
errorClassName,
|
|
92
|
+
className
|
|
93
|
+
};
|
|
94
|
+
$[51] = className;
|
|
95
|
+
$[52] = error;
|
|
96
|
+
$[53] = errorClassName;
|
|
97
|
+
$[54] = headerClassName;
|
|
98
|
+
$[55] = helperText;
|
|
99
|
+
$[56] = hideLabel;
|
|
100
|
+
$[57] = isDisabled;
|
|
101
|
+
$[58] = isRequired;
|
|
102
|
+
$[59] = rightContent;
|
|
103
|
+
$[60] = t15;
|
|
104
|
+
$[61] = t16;
|
|
105
|
+
$[62] = tooltipText;
|
|
106
|
+
$[63] = t17;
|
|
107
|
+
} else t17 = $[63];
|
|
108
|
+
formFieldProps = t17;
|
|
109
|
+
let t18;
|
|
110
|
+
if ($[64] !== headerClassName || $[65] !== headerProps || $[66] !== helperText || $[67] !== hideLabel || $[68] !== isDisabled || $[69] !== isHeaderHidden || $[70] !== isRequired || $[71] !== label || $[72] !== labelProps || $[73] !== rightContent || $[74] !== tooltipText) {
|
|
111
|
+
t18 = headerProps ? {
|
|
112
|
+
...headerProps,
|
|
113
|
+
labelProps
|
|
114
|
+
} : {
|
|
115
|
+
label: label ?? "",
|
|
116
|
+
tooltipText,
|
|
117
|
+
helperText,
|
|
118
|
+
isRequired,
|
|
119
|
+
rightContent,
|
|
120
|
+
isHeaderHidden: hideLabel || isHeaderHidden,
|
|
121
|
+
isDisabled,
|
|
122
|
+
className: headerClassName,
|
|
123
|
+
labelProps
|
|
124
|
+
};
|
|
125
|
+
$[64] = headerClassName;
|
|
126
|
+
$[65] = headerProps;
|
|
127
|
+
$[66] = helperText;
|
|
128
|
+
$[67] = hideLabel;
|
|
129
|
+
$[68] = isDisabled;
|
|
130
|
+
$[69] = isHeaderHidden;
|
|
131
|
+
$[70] = isRequired;
|
|
132
|
+
$[71] = label;
|
|
133
|
+
$[72] = labelProps;
|
|
134
|
+
$[73] = rightContent;
|
|
135
|
+
$[74] = tooltipText;
|
|
136
|
+
$[75] = t18;
|
|
137
|
+
} else t18 = $[75];
|
|
138
|
+
const resolvedHeaderProps = t18;
|
|
139
|
+
let t19;
|
|
140
|
+
if ($[76] !== as) {
|
|
141
|
+
t19 = as && ["filter", "floating"].includes(as);
|
|
142
|
+
$[76] = as;
|
|
143
|
+
$[77] = t19;
|
|
144
|
+
} else t19 = $[77];
|
|
145
|
+
const shouldRenderLabel = t19;
|
|
146
|
+
let t20;
|
|
147
|
+
if ($[78] !== as || $[79] !== resolvedHeaderProps || $[80] !== shouldRenderLabel || $[81] !== size) {
|
|
148
|
+
t20 = shouldRenderLabel ? /* @__PURE__ */ jsx(FormFieldLabel, {
|
|
149
|
+
as,
|
|
150
|
+
size,
|
|
151
|
+
...resolvedHeaderProps
|
|
152
|
+
}) : null;
|
|
153
|
+
$[78] = as;
|
|
154
|
+
$[79] = resolvedHeaderProps;
|
|
155
|
+
$[80] = shouldRenderLabel;
|
|
156
|
+
$[81] = size;
|
|
157
|
+
$[82] = t20;
|
|
158
|
+
} else t20 = $[82];
|
|
159
|
+
const labelContent = t20;
|
|
160
|
+
let t21;
|
|
161
|
+
if ($[83] !== as || $[84] !== contentWrapperClassName || $[85] !== inputContentWrapperCva) {
|
|
162
|
+
t21 = contentWrapperClassName ?? inputContentWrapperCva({ as });
|
|
163
|
+
$[83] = as;
|
|
164
|
+
$[84] = contentWrapperClassName;
|
|
165
|
+
$[85] = inputContentWrapperCva;
|
|
166
|
+
$[86] = t21;
|
|
167
|
+
} else t21 = $[86];
|
|
168
|
+
const resolvedContentWrapperClassName = t21;
|
|
169
|
+
if ($[87] !== as || $[88] !== contentClassName || $[89] !== inputSizeCva || $[90] !== size || $[91] !== typographyCva || $[92] !== typographySize) {
|
|
170
|
+
let t22;
|
|
171
|
+
if ($[94] !== typographyCva || $[95] !== typographySize) {
|
|
172
|
+
t22 = typographySize && typographyCva({ size: typographySize });
|
|
173
|
+
$[94] = typographyCva;
|
|
174
|
+
$[95] = typographySize;
|
|
175
|
+
$[96] = t22;
|
|
176
|
+
} else t22 = $[96];
|
|
177
|
+
t9 = clsx("group/input-frame flex min-w-0 w-full items-center gap-input-gap-input-text-to-elements", inputSizeCva({
|
|
178
|
+
size,
|
|
179
|
+
as
|
|
180
|
+
}), t22, contentClassName);
|
|
181
|
+
$[87] = as;
|
|
182
|
+
$[88] = contentClassName;
|
|
183
|
+
$[89] = inputSizeCva;
|
|
184
|
+
$[90] = size;
|
|
185
|
+
$[91] = typographyCva;
|
|
186
|
+
$[92] = typographySize;
|
|
187
|
+
$[93] = t9;
|
|
188
|
+
} else t9 = $[93];
|
|
189
|
+
t10 = leadingContent;
|
|
190
|
+
if ($[97] !== isLeadingIconElement || $[98] !== leadingIcon) {
|
|
191
|
+
t11 = leadingIcon && /* @__PURE__ */ jsx("div", {
|
|
192
|
+
className: clsx(!isLeadingIconElement && "pointer-events-none"),
|
|
193
|
+
children: renderIconVisual(leadingIcon)
|
|
194
|
+
});
|
|
195
|
+
$[97] = isLeadingIconElement;
|
|
196
|
+
$[98] = leadingIcon;
|
|
197
|
+
$[99] = t11;
|
|
198
|
+
} else t11 = $[99];
|
|
199
|
+
t12 = labelPlacement === "content-row" && labelContent;
|
|
200
|
+
t13 = actionContentPlacement === "content-row" && actionContent;
|
|
201
|
+
t5 = resolvedContentWrapperClassName;
|
|
202
|
+
t6 = labelPlacement === "content-wrapper" && labelContent;
|
|
203
|
+
t7 = actionContentPlacement === "content-wrapper" && actionContent;
|
|
204
|
+
t8 = typeof children === "function" ? children({
|
|
205
|
+
...dataAttributeProps,
|
|
206
|
+
id: inputId
|
|
207
|
+
}) : children;
|
|
208
|
+
$[4] = actionContent;
|
|
209
|
+
$[5] = actionContentPlacement;
|
|
210
|
+
$[6] = as;
|
|
211
|
+
$[7] = children;
|
|
212
|
+
$[8] = className;
|
|
213
|
+
$[9] = contentClassName;
|
|
214
|
+
$[10] = contentWrapperClassName;
|
|
215
|
+
$[11] = dataAttributes;
|
|
216
|
+
$[12] = error;
|
|
217
|
+
$[13] = errorClassName;
|
|
218
|
+
$[14] = generatedInputId;
|
|
219
|
+
$[15] = headerClassName;
|
|
220
|
+
$[16] = headerProps;
|
|
221
|
+
$[17] = helperText;
|
|
222
|
+
$[18] = hideLabel;
|
|
223
|
+
$[19] = idProp;
|
|
224
|
+
$[20] = inputContentWrapperCva;
|
|
225
|
+
$[21] = inputSizeCva;
|
|
226
|
+
$[22] = isDisabled;
|
|
227
|
+
$[23] = isHeaderHidden;
|
|
228
|
+
$[24] = isLeadingIconElement;
|
|
229
|
+
$[25] = isRequired;
|
|
230
|
+
$[26] = label;
|
|
231
|
+
$[27] = labelPlacement;
|
|
232
|
+
$[28] = labelPropsProp;
|
|
233
|
+
$[29] = leadingContent;
|
|
234
|
+
$[30] = leadingIcon;
|
|
235
|
+
$[31] = rightContent;
|
|
236
|
+
$[32] = size;
|
|
237
|
+
$[33] = tooltipText;
|
|
238
|
+
$[34] = typographyCva;
|
|
239
|
+
$[35] = typographySize;
|
|
240
|
+
$[36] = dataAttributeProps;
|
|
241
|
+
$[37] = formFieldProps;
|
|
242
|
+
$[38] = labelProps;
|
|
243
|
+
$[39] = t10;
|
|
244
|
+
$[40] = t11;
|
|
245
|
+
$[41] = t12;
|
|
246
|
+
$[42] = t13;
|
|
247
|
+
$[43] = t5;
|
|
248
|
+
$[44] = t6;
|
|
249
|
+
$[45] = t7;
|
|
250
|
+
$[46] = t8;
|
|
251
|
+
$[47] = t9;
|
|
252
|
+
} else {
|
|
253
|
+
dataAttributeProps = $[36];
|
|
254
|
+
formFieldProps = $[37];
|
|
255
|
+
labelProps = $[38];
|
|
256
|
+
t10 = $[39];
|
|
257
|
+
t11 = $[40];
|
|
258
|
+
t12 = $[41];
|
|
259
|
+
t13 = $[42];
|
|
260
|
+
t5 = $[43];
|
|
261
|
+
t6 = $[44];
|
|
262
|
+
t7 = $[45];
|
|
263
|
+
t8 = $[46];
|
|
264
|
+
t9 = $[47];
|
|
265
|
+
}
|
|
266
|
+
let t14;
|
|
267
|
+
if ($[100] !== t5 || $[101] !== t6 || $[102] !== t7 || $[103] !== t8) {
|
|
268
|
+
t14 = /* @__PURE__ */ jsxs("div", {
|
|
269
|
+
className: t5,
|
|
270
|
+
children: [
|
|
271
|
+
t6,
|
|
272
|
+
t7,
|
|
273
|
+
t8
|
|
274
|
+
]
|
|
275
|
+
});
|
|
276
|
+
$[100] = t5;
|
|
277
|
+
$[101] = t6;
|
|
278
|
+
$[102] = t7;
|
|
279
|
+
$[103] = t8;
|
|
280
|
+
$[104] = t14;
|
|
281
|
+
} else t14 = $[104];
|
|
282
|
+
let t15;
|
|
283
|
+
if ($[105] !== t10 || $[106] !== t11 || $[107] !== t12 || $[108] !== t13 || $[109] !== t14 || $[110] !== t9) {
|
|
284
|
+
t15 = /* @__PURE__ */ jsxs("div", {
|
|
285
|
+
className: t9,
|
|
286
|
+
children: [
|
|
287
|
+
t10,
|
|
288
|
+
t11,
|
|
289
|
+
t12,
|
|
290
|
+
t13,
|
|
291
|
+
t14
|
|
292
|
+
]
|
|
293
|
+
});
|
|
294
|
+
$[105] = t10;
|
|
295
|
+
$[106] = t11;
|
|
296
|
+
$[107] = t12;
|
|
297
|
+
$[108] = t13;
|
|
298
|
+
$[109] = t14;
|
|
299
|
+
$[110] = t9;
|
|
300
|
+
$[111] = t15;
|
|
301
|
+
} else t15 = $[111];
|
|
302
|
+
const contentRow = t15;
|
|
303
|
+
let t16;
|
|
304
|
+
if ($[112] !== action || $[113] !== clearClassName || $[114] !== hasClear || $[115] !== hasTrailingContent || $[116] !== isDisabled || $[117] !== isLoading || $[118] !== onClear || $[119] !== renderStatic || $[120] !== showClear || $[121] !== trailingAction || $[122] !== trailingContent || $[123] !== trailingIcon || $[124] !== typographyCva || $[125] !== unit) {
|
|
305
|
+
t16 = hasTrailingContent ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
306
|
+
hasClear && /* @__PURE__ */ jsx(InputClear, {
|
|
307
|
+
onClear: () => onClear?.(),
|
|
308
|
+
className: clearClassName,
|
|
309
|
+
show: !!showClear,
|
|
310
|
+
style: showClear ? { visibility: "visible" } : void 0,
|
|
311
|
+
renderStatic
|
|
312
|
+
}),
|
|
313
|
+
trailingContent,
|
|
314
|
+
unit && /* @__PURE__ */ jsx("span", {
|
|
315
|
+
className: typographyCva({
|
|
316
|
+
size: "label-2",
|
|
317
|
+
sizeMobile: "label-2",
|
|
318
|
+
variant: "prominent-1",
|
|
319
|
+
className: "text-text-default-3"
|
|
320
|
+
}),
|
|
321
|
+
children: unit
|
|
322
|
+
}),
|
|
323
|
+
isLoading && /* @__PURE__ */ jsx("div", {
|
|
324
|
+
className: "inline-flex",
|
|
325
|
+
children: /* @__PURE__ */ jsx(Loader, {})
|
|
326
|
+
}),
|
|
327
|
+
!isLoading && action && /* @__PURE__ */ jsx(InlineIconButton, {
|
|
328
|
+
color: "secondary",
|
|
329
|
+
icon: action.icon,
|
|
330
|
+
isDisabled,
|
|
331
|
+
onPress: action.onClick,
|
|
332
|
+
excludeFromTabOrder: true,
|
|
333
|
+
label: action.altText,
|
|
334
|
+
className: clsx("border-0!", action.className)
|
|
335
|
+
}),
|
|
336
|
+
!isLoading && !action && trailingIcon && renderIconVisual(trailingIcon),
|
|
337
|
+
trailingAction
|
|
338
|
+
] }) : null;
|
|
339
|
+
$[112] = action;
|
|
340
|
+
$[113] = clearClassName;
|
|
341
|
+
$[114] = hasClear;
|
|
342
|
+
$[115] = hasTrailingContent;
|
|
343
|
+
$[116] = isDisabled;
|
|
344
|
+
$[117] = isLoading;
|
|
345
|
+
$[118] = onClear;
|
|
346
|
+
$[119] = renderStatic;
|
|
347
|
+
$[120] = showClear;
|
|
348
|
+
$[121] = trailingAction;
|
|
349
|
+
$[122] = trailingContent;
|
|
350
|
+
$[123] = trailingIcon;
|
|
351
|
+
$[124] = typographyCva;
|
|
352
|
+
$[125] = unit;
|
|
353
|
+
$[126] = t16;
|
|
354
|
+
} else t16 = $[126];
|
|
355
|
+
const trailingContentNodes = t16;
|
|
356
|
+
let t17;
|
|
357
|
+
if ($[127] !== as || $[128] !== inputSizeCva || $[129] !== isDisabled || $[130] !== isTrailingInteractive || $[131] !== size || $[132] !== trailingClassName || $[133] !== trailingContentNodes || $[134] !== wrapTrailingContent) {
|
|
358
|
+
t17 = wrapTrailingContent && trailingContentNodes ? /* @__PURE__ */ jsx("div", {
|
|
359
|
+
className: clsx("flex items-center gap-input-gap-trailing-elements", inputSizeCva({
|
|
360
|
+
size,
|
|
361
|
+
as
|
|
362
|
+
}), !isTrailingInteractive && "pointer-events-none", isDisabled && "text-interactive-text-secondary-disabled", trailingClassName),
|
|
363
|
+
children: trailingContentNodes
|
|
364
|
+
}) : trailingContentNodes;
|
|
365
|
+
$[127] = as;
|
|
366
|
+
$[128] = inputSizeCva;
|
|
367
|
+
$[129] = isDisabled;
|
|
368
|
+
$[130] = isTrailingInteractive;
|
|
369
|
+
$[131] = size;
|
|
370
|
+
$[132] = trailingClassName;
|
|
371
|
+
$[133] = trailingContentNodes;
|
|
372
|
+
$[134] = wrapTrailingContent;
|
|
373
|
+
$[135] = t17;
|
|
374
|
+
} else t17 = $[135];
|
|
375
|
+
const trailingRow = t17;
|
|
376
|
+
let t18;
|
|
377
|
+
if ($[136] !== contentAndTrailingClassName || $[137] !== contentRow || $[138] !== trailingRow || $[139] !== wrapContentAndTrailing) {
|
|
378
|
+
t18 = wrapContentAndTrailing ? /* @__PURE__ */ jsxs("div", {
|
|
379
|
+
className: clsx("flex w-full items-center gap-input-gap-input-text-to-elements", contentAndTrailingClassName),
|
|
380
|
+
children: [contentRow, trailingRow]
|
|
381
|
+
}) : /* @__PURE__ */ jsxs(Fragment, { children: [contentRow, trailingRow] });
|
|
382
|
+
$[136] = contentAndTrailingClassName;
|
|
383
|
+
$[137] = contentRow;
|
|
384
|
+
$[138] = trailingRow;
|
|
385
|
+
$[139] = wrapContentAndTrailing;
|
|
386
|
+
$[140] = t18;
|
|
387
|
+
} else t18 = $[140];
|
|
388
|
+
const inputFrameContent = t18;
|
|
389
|
+
const t19 = as === "inline" ? -1 : void 0;
|
|
390
|
+
const t20 = as === "inline" ? -1 : void 0;
|
|
391
|
+
let t21;
|
|
392
|
+
if ($[141] !== onMouseEnter || $[142] !== onStaticInteract || $[143] !== renderStatic) {
|
|
393
|
+
t21 = (event) => {
|
|
394
|
+
onMouseEnter?.(event);
|
|
395
|
+
if (renderStatic) onStaticInteract?.(false);
|
|
396
|
+
};
|
|
397
|
+
$[141] = onMouseEnter;
|
|
398
|
+
$[142] = onStaticInteract;
|
|
399
|
+
$[143] = renderStatic;
|
|
400
|
+
$[144] = t21;
|
|
401
|
+
} else t21 = $[144];
|
|
402
|
+
let t22;
|
|
403
|
+
if ($[145] !== onFocusCapture || $[146] !== onStaticInteract || $[147] !== renderStatic) {
|
|
404
|
+
t22 = (event_0) => {
|
|
405
|
+
onFocusCapture?.(event_0);
|
|
406
|
+
if (renderStatic) onStaticInteract?.(true);
|
|
407
|
+
};
|
|
408
|
+
$[145] = onFocusCapture;
|
|
409
|
+
$[146] = onStaticInteract;
|
|
410
|
+
$[147] = renderStatic;
|
|
411
|
+
$[148] = t22;
|
|
412
|
+
} else t22 = $[148];
|
|
413
|
+
let t23;
|
|
414
|
+
if ($[149] !== as || $[150] !== inputBaseCva || $[151] !== inputClassName || $[152] !== variant) {
|
|
415
|
+
t23 = clsx("relative flex cursor-text has-disabled:cursor-default", inputBaseCva({
|
|
416
|
+
variant,
|
|
417
|
+
as
|
|
418
|
+
}), inputClassName);
|
|
419
|
+
$[149] = as;
|
|
420
|
+
$[150] = inputBaseCva;
|
|
421
|
+
$[151] = inputClassName;
|
|
422
|
+
$[152] = variant;
|
|
423
|
+
$[153] = t23;
|
|
424
|
+
} else t23 = $[153];
|
|
425
|
+
const t24 = renderStatic ? isDisabled ? -1 : 0 : void 0;
|
|
426
|
+
let t25;
|
|
427
|
+
let t26;
|
|
428
|
+
let t27;
|
|
429
|
+
if ($[154] !== onStaticInteract || $[155] !== renderStatic) {
|
|
430
|
+
t25 = () => {
|
|
431
|
+
if (renderStatic) onStaticInteract?.(true);
|
|
432
|
+
};
|
|
433
|
+
t26 = () => {
|
|
434
|
+
if (renderStatic) onStaticInteract?.(true);
|
|
435
|
+
};
|
|
436
|
+
t27 = () => {
|
|
437
|
+
if (renderStatic) onStaticInteract?.(true);
|
|
438
|
+
};
|
|
439
|
+
$[154] = onStaticInteract;
|
|
440
|
+
$[155] = renderStatic;
|
|
441
|
+
$[156] = t25;
|
|
442
|
+
$[157] = t26;
|
|
443
|
+
$[158] = t27;
|
|
444
|
+
} else {
|
|
445
|
+
t25 = $[156];
|
|
446
|
+
t26 = $[157];
|
|
447
|
+
t27 = $[158];
|
|
448
|
+
}
|
|
449
|
+
let t28;
|
|
450
|
+
if ($[159] !== dataAttributeProps || $[160] !== inputFrameContent || $[161] !== ref || $[162] !== t23 || $[163] !== t24 || $[164] !== t25 || $[165] !== t26 || $[166] !== t27) {
|
|
451
|
+
t28 = /* @__PURE__ */ jsx("div", {
|
|
452
|
+
ref,
|
|
453
|
+
...dataAttributeProps,
|
|
454
|
+
className: t23,
|
|
455
|
+
tabIndex: t24,
|
|
456
|
+
onFocus: t25,
|
|
457
|
+
onClick: t26,
|
|
458
|
+
onPointerDown: t27,
|
|
459
|
+
"data-rac": "",
|
|
460
|
+
children: inputFrameContent
|
|
461
|
+
});
|
|
462
|
+
$[159] = dataAttributeProps;
|
|
463
|
+
$[160] = inputFrameContent;
|
|
464
|
+
$[161] = ref;
|
|
465
|
+
$[162] = t23;
|
|
466
|
+
$[163] = t24;
|
|
467
|
+
$[164] = t25;
|
|
468
|
+
$[165] = t26;
|
|
469
|
+
$[166] = t27;
|
|
470
|
+
$[167] = t28;
|
|
471
|
+
} else t28 = $[167];
|
|
472
|
+
let t29;
|
|
473
|
+
if ($[168] !== as || $[169] !== dataAttributeProps || $[170] !== formFieldProps || $[171] !== formFieldRef || $[172] !== labelProps || $[173] !== t20 || $[174] !== t21 || $[175] !== t22 || $[176] !== t28) {
|
|
474
|
+
t29 = /* @__PURE__ */ jsx(FormField, {
|
|
475
|
+
...formFieldProps,
|
|
476
|
+
...dataAttributeProps,
|
|
477
|
+
ref: formFieldRef,
|
|
478
|
+
as,
|
|
479
|
+
labelProps,
|
|
480
|
+
tabIndex: t20,
|
|
481
|
+
onMouseEnter: t21,
|
|
482
|
+
onFocusCapture: t22,
|
|
483
|
+
children: t28
|
|
484
|
+
});
|
|
485
|
+
$[168] = as;
|
|
486
|
+
$[169] = dataAttributeProps;
|
|
487
|
+
$[170] = formFieldProps;
|
|
488
|
+
$[171] = formFieldRef;
|
|
489
|
+
$[172] = labelProps;
|
|
490
|
+
$[173] = t20;
|
|
491
|
+
$[174] = t21;
|
|
492
|
+
$[175] = t22;
|
|
493
|
+
$[176] = t28;
|
|
494
|
+
$[177] = t29;
|
|
495
|
+
} else t29 = $[177];
|
|
496
|
+
let t30;
|
|
497
|
+
if ($[178] !== as || $[179] !== error || $[180] !== t19 || $[181] !== t29) {
|
|
498
|
+
t30 = /* @__PURE__ */ jsx(TooltipWrapper, {
|
|
499
|
+
as,
|
|
500
|
+
error,
|
|
501
|
+
triggerTabIndex: t19,
|
|
502
|
+
children: t29
|
|
503
|
+
});
|
|
504
|
+
$[178] = as;
|
|
505
|
+
$[179] = error;
|
|
506
|
+
$[180] = t19;
|
|
507
|
+
$[181] = t29;
|
|
508
|
+
$[182] = t30;
|
|
509
|
+
} else t30 = $[182];
|
|
510
|
+
return t30;
|
|
511
|
+
};
|
|
512
|
+
var renderIconVisual = (icon) => {
|
|
513
|
+
if (isValidElement(icon)) return icon;
|
|
514
|
+
return /* @__PURE__ */ jsx(icon, { className: "size-6 text-interactive-text-secondary-idle" });
|
|
515
|
+
};
|
|
516
|
+
var getInputFrameDataAttributeProps = (dataAttributes) => ({
|
|
517
|
+
"data-is-empty": dataAttributes?.dataIsEmpty || void 0,
|
|
518
|
+
"data-is-filled": dataAttributes?.dataIsFilled || void 0,
|
|
519
|
+
"data-is-dirty": dataAttributes?.dataIsDirty || void 0,
|
|
520
|
+
"data-is-required": dataAttributes?.dataIsRequired || void 0,
|
|
521
|
+
"data-is-disabled": dataAttributes?.dataIsDisabled || void 0,
|
|
522
|
+
"data-disabled": dataAttributes?.dataDisabled || void 0,
|
|
523
|
+
"data-has-search": dataAttributes?.dataHasSearch || void 0,
|
|
524
|
+
"data-invalid": dataAttributes?.dataInvalid || void 0,
|
|
525
|
+
"data-has-selection": dataAttributes?.dataHasSelection || void 0
|
|
526
|
+
});
|
|
527
|
+
//#endregion
|
|
528
|
+
export { InputFrame };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ref } from 'react';
|
|
1
|
+
import { FocusEvent, Ref } from 'react';
|
|
2
2
|
import { SliderProps as AriaSliderProps } from 'react-aria-components';
|
|
3
3
|
import { FieldValues } from 'react-hook-form';
|
|
4
4
|
import { FormFieldProps } from '../FormField/FormField';
|
|
@@ -10,6 +10,7 @@ interface SliderBaseProps<IsRange extends boolean = false> extends FormFieldProp
|
|
|
10
10
|
isRange?: IsRange;
|
|
11
11
|
defaultValue?: SliderValue<IsRange>;
|
|
12
12
|
value?: SliderValue<IsRange>;
|
|
13
|
+
onBlur?: (event: FocusEvent<HTMLInputElement>) => void;
|
|
13
14
|
onChange?: (value: SliderValue<IsRange>) => void;
|
|
14
15
|
}
|
|
15
16
|
export type SliderProps<IsRange extends boolean = false> = SliderBaseProps<IsRange>;
|