@povio/ui 3.3.0 → 3.4.0-rc.10
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/locales/en/translation.json.d.ts +158 -0
- package/dist/assets/locales/sl/translation.json.d.ts +154 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.js +7 -7
- package/dist/components/Menu/MenuDesktop.js +1 -1
- package/dist/components/Menu/MenuItem.js +4 -4
- package/dist/components/Menu/MenuMobile.js +5 -5
- package/dist/components/Menu/MenuPopover.js +2 -2
- package/dist/components/buttons/Button/Button.js +1 -1
- package/dist/components/buttons/PillButton/PillButton.js +4 -4
- package/dist/components/buttons/PillButton/pillButton.cva.d.ts +1 -1
- package/dist/components/buttons/SplitButton/SplitButton.js +3 -3
- package/dist/components/buttons/shared/ButtonContent.js +2 -2
- package/dist/components/buttons/shared/buttonContent.cva.d.ts +1 -1
- package/dist/components/inputs/Checkbox/Checkbox.d.ts +1 -2
- package/dist/components/inputs/Checkbox/Checkbox.js +95 -102
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +2 -3
- package/dist/components/inputs/Checkbox/CheckboxGroup.d.ts +1 -2
- package/dist/components/inputs/Checkbox/CheckboxGroup.js +111 -115
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +2 -2
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +17 -22
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +2 -2
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +17 -23
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +2 -2
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +21 -25
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +2 -2
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +225 -238
- package/dist/components/inputs/DateTime/shared/Calendar.js +1 -1
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +1 -1
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +1 -1
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +7 -10
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +8 -12
- package/dist/components/inputs/DateTime/shared/DateField.d.ts +2 -1
- package/dist/components/inputs/DateTime/shared/DateField.js +4 -4
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +2 -2
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +8 -16
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +3 -3
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +2 -2
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +1 -1
- package/dist/components/inputs/DateTime/shared/MonthPicker.js +2 -2
- package/dist/components/inputs/DateTime/shared/RangeCalendar.js +2 -2
- package/dist/components/inputs/DateTime/shared/TimePickerForm.js +4 -5
- package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +2 -2
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +10 -11
- package/dist/components/inputs/DateTime/shared/YearPicker.js +2 -2
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +46 -1
- package/dist/components/inputs/DateTime/shared/useFirefoxDateSegmentSelectionGuard.js +1 -1
- package/dist/components/inputs/File/FileUpload.d.ts +1 -1
- package/dist/components/inputs/File/FileUpload.js +20 -20
- package/dist/components/inputs/File/InputUpload.d.ts +1 -1
- package/dist/components/inputs/File/InputUpload.js +19 -19
- package/dist/components/inputs/File/fileUpload.types.d.ts +1 -1
- package/dist/components/inputs/File/inputUpload.types.d.ts +1 -1
- package/dist/components/inputs/File/shared/FileCard.js +1 -1
- package/dist/components/inputs/File/shared/FileCardList.js +1 -1
- package/dist/components/inputs/File/shared/FileUploadContent.js +1 -1
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +3 -3
- package/dist/components/inputs/File/shared/FileUploadContentError.js +5 -6
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +5 -6
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +4 -5
- package/dist/components/inputs/File/shared/InputUploadContent.js +4 -4
- package/dist/components/inputs/File/shared/InputUploadFilled.js +3 -3
- package/dist/components/inputs/FormField/FormFieldError.js +1 -1
- package/dist/components/inputs/FormField/FormFieldHeader.js +4 -4
- package/dist/components/inputs/FormField/FormFieldHeaderClose.js +3 -3
- package/dist/components/inputs/FormField/FormFieldHelper.js +1 -1
- package/dist/components/inputs/FormField/FormFieldLabel.js +2 -2
- package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +1 -1
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +109 -107
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.d.ts +2 -1
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +265 -254
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +2 -1
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +25 -24
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.d.ts +1 -1
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +3 -4
- package/dist/components/inputs/Input/TextArea/TextArea.d.ts +2 -1
- package/dist/components/inputs/Input/TextArea/TextArea.js +118 -117
- package/dist/components/inputs/Input/TextInput/TextInput.d.ts +2 -2
- package/dist/components/inputs/Input/TextInput/TextInput.js +129 -129
- package/dist/components/inputs/Input/shared/InputContent.d.ts +2 -1
- package/dist/components/inputs/Input/shared/InputContent.js +50 -48
- package/dist/components/inputs/Inputs/Form.d.ts +4 -4
- package/dist/components/inputs/Inputs/Form.js +1 -1
- package/dist/components/inputs/Inputs/InputItem.d.ts +22 -22
- package/dist/components/inputs/Inputs/InputItem.js +36 -37
- package/dist/components/inputs/Inputs/Inputs.d.ts +2 -2
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +1 -2
- package/dist/components/inputs/RadioGroup/RadioGroup.js +109 -113
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +1 -1
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +16 -16
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +1 -1
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +20 -20
- package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +1 -1
- package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +1 -1
- package/dist/components/inputs/Selection/Select/QuerySelect.js +20 -20
- package/dist/components/inputs/Selection/Select/Select.d.ts +1 -1
- package/dist/components/inputs/Selection/Select/Select.js +23 -23
- package/dist/components/inputs/Selection/shared/SelectBase.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectBase.js +34 -37
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +58 -56
- package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectInput.js +57 -56
- package/dist/components/inputs/Selection/shared/SelectListBox.js +1 -1
- package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +2 -2
- package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +2 -2
- package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +1 -1
- package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +1 -1
- package/dist/components/inputs/Selection/shared/SelectMobile.js +5 -4
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +3 -3
- package/dist/components/inputs/Selection/shared/select.context.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/select.context.js +5 -9
- package/dist/components/inputs/Selection/shared/select.types.d.ts +1 -1
- package/dist/components/inputs/Skeleton/InputFrame.d.ts +1 -0
- package/dist/components/inputs/Skeleton/InputFrame.js +10 -7
- package/dist/components/inputs/Slider/Slider.d.ts +1 -1
- package/dist/components/inputs/Slider/Slider.js +20 -20
- package/dist/components/inputs/TextEditor/TextEditor.d.ts +1 -1
- package/dist/components/inputs/TextEditor/TextEditor.js +20 -20
- package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +2 -2
- package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +4 -4
- package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +4 -4
- package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +5 -8
- package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +3 -3
- package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +4 -5
- package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +4 -5
- package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +6 -9
- package/dist/components/inputs/Toggle/Toggle.d.ts +1 -2
- package/dist/components/inputs/Toggle/Toggle.js +61 -65
- package/dist/components/inputs/shared/CheckContent.js +1 -1
- package/dist/components/inputs/shared/InputClear.js +45 -28
- package/dist/components/inputs/shared/TooltipWrapper.d.ts +1 -1
- package/dist/components/inputs/shared/form.binding.d.ts +27 -0
- package/dist/components/inputs/shared/form.binding.js +57 -0
- package/dist/components/inputs/shared/form.types.d.ts +9 -8
- package/dist/components/inputs/shared/form.types.js +8 -0
- package/dist/components/inputs/shared/input.cva.js +1 -1
- package/dist/components/inputs/shared/useStaticInputHandoff.js +64 -38
- package/dist/components/navigation/Accordion/Accordion.js +1 -1
- package/dist/components/navigation/Accordion/AccordionItem.js +3 -3
- package/dist/components/navigation/Stepper/Stepper.js +2 -2
- package/dist/components/navigation/Stepper/StepperItem.js +4 -4
- package/dist/components/overlays/ActionModal/ActionModal.js +1 -1
- package/dist/components/overlays/BottomSheet/BottomSheet.js +3 -3
- package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +4 -4
- package/dist/components/overlays/Drawer/Drawer.js +2 -2
- package/dist/components/overlays/Modal/Modal.js +3 -3
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +1 -1
- package/dist/components/overlays/Tooltip/Tooltip.js +15 -8
- package/dist/components/overlays/Tooltip/TooltipEllipsis.js +1 -1
- package/dist/components/segment/Segment.d.ts +1 -1
- package/dist/components/segment/Segment.js +21 -21
- package/dist/components/segment/SegmentItem.js +1 -1
- package/dist/components/segment/segment.types.d.ts +1 -1
- package/dist/components/shared/pagination/Pagination.js +1 -1
- package/dist/components/shared/pagination/PaginationList.js +6 -9
- package/dist/components/table/ColumnConfig.js +1 -1
- package/dist/components/table/InfiniteTable.js +1 -1
- package/dist/components/table/Table.js +6 -8
- package/dist/components/text/Link/Link.js +1 -1
- package/dist/components/text/Pill/Pill.js +3 -3
- package/dist/components/text/Tag/Tag.js +3 -3
- package/dist/config/confirmation.context.js +1 -1
- package/dist/config/link.context.js +1 -1
- package/dist/config/router.context.js +1 -1
- package/dist/config/theme.context.js +1 -1
- package/dist/config/uiConfig.context.d.ts +14 -5
- package/dist/config/uiConfig.context.js +9 -11
- package/dist/config/uiOverrides.context.js +2 -2
- package/dist/helpers/dynamicColumns.d.ts +1 -1
- package/dist/helpers/dynamicInputs.d.ts +7 -7
- package/dist/hooks/useAutosave.d.ts +4 -4
- package/dist/hooks/useAutosave.js +64 -49
- package/dist/hooks/useFilters.js +1 -1
- package/dist/hooks/useForm.d.ts +39 -15
- package/dist/hooks/useForm.js +96 -43
- package/dist/hooks/useFormAutosave.d.ts +8 -9
- package/dist/hooks/useFormAutosave.js +23 -9
- package/dist/hooks/useIntersectionObserver.js +1 -1
- package/dist/hooks/useLocalStorage.js +1 -1
- package/dist/hooks/usePagination.js +1 -1
- package/dist/hooks/useScrollableListBox.js +1 -1
- package/dist/hooks/useSorting.js +1 -1
- package/dist/hooks/useStateAndRef.js +1 -1
- package/dist/hooks/useTableColumnConfig.js +1 -1
- package/dist/index.d.ts +1 -263
- package/dist/index.js +11 -71
- package/dist/rhf/Inputs.d.ts +60 -0
- package/dist/rhf/Inputs.js +148 -0
- package/dist/rhf/components.d.ts +80 -0
- package/dist/rhf/components.js +101 -0
- package/dist/rhf/dynamicInputs.d.ts +18 -0
- package/dist/rhf/dynamicInputs.js +5 -0
- package/dist/rhf/fieldAdapter.d.ts +7 -0
- package/dist/rhf/fieldAdapter.js +40 -0
- package/dist/rhf/form.types.d.ts +12 -0
- package/dist/rhf/useAutosave.d.ts +10 -0
- package/dist/rhf/useAutosave.js +71 -0
- package/dist/rhf/useForm.d.ts +18 -0
- package/dist/rhf/useForm.js +48 -0
- package/dist/rhf/useFormAutosave.d.ts +15 -0
- package/dist/rhf/useFormAutosave.js +59 -0
- package/dist/rhf.d.ts +225 -0
- package/dist/tanstack.d.ts +224 -0
- package/dist/tanstack.js +141 -0
- package/package.json +15 -3
- package/dist/assets/icons/Account.d.ts +0 -2
- package/dist/assets/icons/AlignCenter.d.ts +0 -2
- package/dist/assets/icons/AlignCenter.js +0 -30
- package/dist/assets/icons/AlignLeft.d.ts +0 -2
- package/dist/assets/icons/AlignLeft.js +0 -30
- package/dist/assets/icons/AlignLeftRight.d.ts +0 -2
- package/dist/assets/icons/AlignLeftRight.js +0 -30
- package/dist/assets/icons/AlignRight.d.ts +0 -2
- package/dist/assets/icons/AlignRight.js +0 -30
- package/dist/assets/icons/ArrowDropDown.d.ts +0 -2
- package/dist/assets/icons/ArrowDropDown.js +0 -30
- package/dist/assets/icons/ArrowDropUp.d.ts +0 -2
- package/dist/assets/icons/ArrowDropUp.js +0 -30
- package/dist/assets/icons/ArrowLeft.d.ts +0 -2
- package/dist/assets/icons/ArrowLeft.js +0 -30
- package/dist/assets/icons/ArrowRight.d.ts +0 -2
- package/dist/assets/icons/ArrowRight.js +0 -30
- package/dist/assets/icons/Board.d.ts +0 -2
- package/dist/assets/icons/Bold.d.ts +0 -2
- package/dist/assets/icons/Bold.js +0 -30
- package/dist/assets/icons/BulletedList.d.ts +0 -2
- package/dist/assets/icons/BulletedList.js +0 -30
- package/dist/assets/icons/Calendar.d.ts +0 -2
- package/dist/assets/icons/Calendar.js +0 -32
- package/dist/assets/icons/Check.d.ts +0 -2
- package/dist/assets/icons/Check.js +0 -32
- package/dist/assets/icons/CheckCircle.d.ts +0 -2
- package/dist/assets/icons/CheckCircle.js +0 -30
- package/dist/assets/icons/CheckboxCheckmark.d.ts +0 -2
- package/dist/assets/icons/CheckboxCheckmark.js +0 -33
- package/dist/assets/icons/CheckboxIndeterminate.d.ts +0 -2
- package/dist/assets/icons/CheckboxIndeterminate.js +0 -33
- package/dist/assets/icons/ChevronDown.d.ts +0 -2
- package/dist/assets/icons/ChevronDown.js +0 -32
- package/dist/assets/icons/ChevronLeft.d.ts +0 -2
- package/dist/assets/icons/ChevronLeft.js +0 -32
- package/dist/assets/icons/ChevronRight.d.ts +0 -2
- package/dist/assets/icons/ChevronRight.js +0 -32
- package/dist/assets/icons/ChevronUp.d.ts +0 -2
- package/dist/assets/icons/ChevronUp.js +0 -32
- package/dist/assets/icons/ChevronsLeft.d.ts +0 -2
- package/dist/assets/icons/ChevronsLeft.js +0 -32
- package/dist/assets/icons/ChevronsRight.d.ts +0 -2
- package/dist/assets/icons/ChevronsRight.js +0 -32
- package/dist/assets/icons/Clock.d.ts +0 -2
- package/dist/assets/icons/Clock.js +0 -30
- package/dist/assets/icons/Close.d.ts +0 -2
- package/dist/assets/icons/Close.js +0 -30
- package/dist/assets/icons/DateTime.d.ts +0 -2
- package/dist/assets/icons/DateTime.js +0 -39
- package/dist/assets/icons/DragIndicator.d.ts +0 -2
- package/dist/assets/icons/DragIndicator.js +0 -30
- package/dist/assets/icons/Edit.d.ts +0 -2
- package/dist/assets/icons/Emoji.d.ts +0 -2
- package/dist/assets/icons/File.d.ts +0 -2
- package/dist/assets/icons/File.js +0 -32
- package/dist/assets/icons/Grid.d.ts +0 -2
- package/dist/assets/icons/Highlight.d.ts +0 -2
- package/dist/assets/icons/Highlight.js +0 -30
- package/dist/assets/icons/HighlightOn.d.ts +0 -6
- package/dist/assets/icons/HighlightOn.js +0 -55
- package/dist/assets/icons/Home.d.ts +0 -2
- package/dist/assets/icons/Home.js +0 -30
- package/dist/assets/icons/Image.d.ts +0 -2
- package/dist/assets/icons/ImageError.d.ts +0 -2
- package/dist/assets/icons/Info.d.ts +0 -2
- package/dist/assets/icons/Info.js +0 -41
- package/dist/assets/icons/Italic.d.ts +0 -2
- package/dist/assets/icons/Italic.js +0 -30
- package/dist/assets/icons/Link.d.ts +0 -2
- package/dist/assets/icons/Link.js +0 -30
- package/dist/assets/icons/Loader.d.ts +0 -2
- package/dist/assets/icons/MapPin.d.ts +0 -2
- package/dist/assets/icons/Menu.d.ts +0 -2
- package/dist/assets/icons/Menu.js +0 -30
- package/dist/assets/icons/Minus.d.ts +0 -2
- package/dist/assets/icons/MoreHoriz.d.ts +0 -2
- package/dist/assets/icons/NumberedList.d.ts +0 -2
- package/dist/assets/icons/NumberedList.js +0 -30
- package/dist/assets/icons/Pause.d.ts +0 -2
- package/dist/assets/icons/Plus.d.ts +0 -2
- package/dist/assets/icons/PointerHorizontal.d.ts +0 -2
- package/dist/assets/icons/PointerHorizontal.js +0 -30
- package/dist/assets/icons/PointerVertical.d.ts +0 -2
- package/dist/assets/icons/PointerVertical.js +0 -30
- package/dist/assets/icons/Retry.d.ts +0 -2
- package/dist/assets/icons/Search.d.ts +0 -2
- package/dist/assets/icons/Search.js +0 -30
- package/dist/assets/icons/Send.d.ts +0 -2
- package/dist/assets/icons/Send.js +0 -32
- package/dist/assets/icons/Share.d.ts +0 -2
- package/dist/assets/icons/Slash.d.ts +0 -2
- package/dist/assets/icons/Strikethrough.d.ts +0 -2
- package/dist/assets/icons/Strikethrough.js +0 -30
- package/dist/assets/icons/TextColor.d.ts +0 -6
- package/dist/assets/icons/TextColor.js +0 -52
- package/dist/assets/icons/Today.d.ts +0 -2
- package/dist/assets/icons/Today.js +0 -30
- package/dist/assets/icons/Trash.d.ts +0 -2
- package/dist/assets/icons/Underlined.d.ts +0 -2
- package/dist/assets/icons/Underlined.js +0 -32
- package/dist/assets/icons/Upload.d.ts +0 -2
- package/dist/assets/icons/Upload.js +0 -39
- package/dist/assets/icons/User.d.ts +0 -2
- package/dist/assets/icons/Visibility.d.ts +0 -2
- package/dist/assets/icons/Visibility.js +0 -30
- package/dist/assets/icons/VisibilityOff.d.ts +0 -2
- package/dist/assets/icons/VisibilityOff.js +0 -30
- package/dist/assets/icons/WarningFilled.d.ts +0 -2
- package/dist/assets/icons/WarningFilled.js +0 -32
- package/dist/assets/icons/WarningOutlined.d.ts +0 -2
- /package/dist/{hooks/useAutosave.spec.d.ts → rhf/entrypoints.type-test.d.ts} +0 -0
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { UIOverrides } from "../../../config/uiOverrides.context.js";
|
|
2
2
|
import { UIConfig } from "../../../config/uiConfig.context.js";
|
|
3
|
+
import { FieldController } from "../shared/form.binding.js";
|
|
3
4
|
import { FormFieldError } from "../FormField/FormFieldError.js";
|
|
4
5
|
import { CheckContent } from "../shared/CheckContent.js";
|
|
5
6
|
import { toggleContentClassName, toggleDefinition, toggleTypography } from "./toggle.cva.js";
|
|
6
|
-
import { c } from "react/compiler-runtime";
|
|
7
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
7
|
import { clsx } from "clsx";
|
|
9
8
|
import { Switch } from "react-aria-components";
|
|
9
|
+
import { c } from "react/compiler-runtime";
|
|
10
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
11
|
import { mergeRefs } from "@react-aria/utils";
|
|
11
|
-
import { Controller } from "react-hook-form";
|
|
12
12
|
//#region src/components/inputs/Toggle/Toggle.tsx
|
|
13
13
|
var ToggleBase = (props) => {
|
|
14
|
-
const $ = c(
|
|
14
|
+
const $ = c(48);
|
|
15
15
|
const ui = UIConfig.useConfig();
|
|
16
16
|
const toggleCva = UIOverrides.useCva("toggle.cva", toggleDefinition);
|
|
17
17
|
const toggleTypographyMap = UIOverrides.useMapper("toggle.typography", toggleTypography);
|
|
@@ -31,10 +31,9 @@ var ToggleBase = (props) => {
|
|
|
31
31
|
let t8;
|
|
32
32
|
let t9;
|
|
33
33
|
if ($[0] !== props || $[1] !== toggleContentClassNameMap || $[2] !== toggleCva || $[3] !== toggleTypographyMap || $[4] !== ui) {
|
|
34
|
-
const { className, children: t10, isDisabled, error, variant: variantProp,
|
|
34
|
+
const { className, children: t10, isDisabled, error, variant: variantProp, onChange, onBlur, ...rest } = props;
|
|
35
35
|
children = t10;
|
|
36
36
|
const variant = variantProp ?? ui.toggle.variant;
|
|
37
|
-
const fireBlurOnChange = fireBlurOnChangeProp ?? ui.toggle.fireBlurOnChange;
|
|
38
37
|
let t11;
|
|
39
38
|
if ($[19] !== error || $[20] !== isDisabled) {
|
|
40
39
|
t11 = {
|
|
@@ -47,16 +46,13 @@ var ToggleBase = (props) => {
|
|
|
47
46
|
} else t11 = $[21];
|
|
48
47
|
formFieldErrorProps = t11;
|
|
49
48
|
let t12;
|
|
50
|
-
if ($[22] !==
|
|
49
|
+
if ($[22] !== onChange) {
|
|
51
50
|
t12 = (isSelected) => {
|
|
52
51
|
onChange?.(isSelected);
|
|
53
|
-
if (fireBlurOnChange) onBlur?.({});
|
|
54
52
|
};
|
|
55
|
-
$[22] =
|
|
56
|
-
$[23] =
|
|
57
|
-
|
|
58
|
-
$[25] = t12;
|
|
59
|
-
} else t12 = $[25];
|
|
53
|
+
$[22] = onChange;
|
|
54
|
+
$[23] = t12;
|
|
55
|
+
} else t12 = $[23];
|
|
60
56
|
const handleChange = t12;
|
|
61
57
|
T1 = Switch;
|
|
62
58
|
t2 = rest;
|
|
@@ -66,12 +62,12 @@ var ToggleBase = (props) => {
|
|
|
66
62
|
t6 = handleChange;
|
|
67
63
|
t7 = onBlur;
|
|
68
64
|
const t13 = !isDisabled && "cursor-pointer";
|
|
69
|
-
if ($[
|
|
65
|
+
if ($[24] !== className || $[25] !== t13) {
|
|
70
66
|
t8 = clsx("group flex items-center gap-2", t13, className);
|
|
71
|
-
$[
|
|
72
|
-
$[
|
|
73
|
-
$[
|
|
74
|
-
} else t8 = $[
|
|
67
|
+
$[24] = className;
|
|
68
|
+
$[25] = t13;
|
|
69
|
+
$[26] = t8;
|
|
70
|
+
} else t8 = $[26];
|
|
75
71
|
t9 = /* @__PURE__ */ jsx("div", { className: toggleCva({
|
|
76
72
|
variant,
|
|
77
73
|
...rest
|
|
@@ -121,20 +117,20 @@ var ToggleBase = (props) => {
|
|
|
121
117
|
t9 = $[18];
|
|
122
118
|
}
|
|
123
119
|
let t10;
|
|
124
|
-
if ($[
|
|
120
|
+
if ($[27] !== T0 || $[28] !== children || $[29] !== t0 || $[30] !== t1) {
|
|
125
121
|
t10 = /* @__PURE__ */ jsx(T0, {
|
|
126
122
|
typography: t0,
|
|
127
123
|
contentClassName: t1,
|
|
128
124
|
children
|
|
129
125
|
});
|
|
130
|
-
$[
|
|
131
|
-
$[
|
|
132
|
-
$[
|
|
133
|
-
$[
|
|
134
|
-
$[
|
|
135
|
-
} else t10 = $[
|
|
126
|
+
$[27] = T0;
|
|
127
|
+
$[28] = children;
|
|
128
|
+
$[29] = t0;
|
|
129
|
+
$[30] = t1;
|
|
130
|
+
$[31] = t10;
|
|
131
|
+
} else t10 = $[31];
|
|
136
132
|
let t11;
|
|
137
|
-
if ($[
|
|
133
|
+
if ($[32] !== T1 || $[33] !== t10 || $[34] !== t2 || $[35] !== t3 || $[36] !== t4 || $[37] !== t5 || $[38] !== t6 || $[39] !== t7 || $[40] !== t8 || $[41] !== t9) {
|
|
138
134
|
t11 = /* @__PURE__ */ jsxs(T1, {
|
|
139
135
|
...t2,
|
|
140
136
|
"data-is-dirty": t3,
|
|
@@ -145,64 +141,64 @@ var ToggleBase = (props) => {
|
|
|
145
141
|
className: t8,
|
|
146
142
|
children: [t9, t10]
|
|
147
143
|
});
|
|
148
|
-
$[
|
|
149
|
-
$[
|
|
150
|
-
$[
|
|
151
|
-
$[
|
|
152
|
-
$[
|
|
153
|
-
$[
|
|
154
|
-
$[
|
|
155
|
-
$[
|
|
156
|
-
$[
|
|
157
|
-
$[
|
|
158
|
-
$[
|
|
159
|
-
} else t11 = $[
|
|
144
|
+
$[32] = T1;
|
|
145
|
+
$[33] = t10;
|
|
146
|
+
$[34] = t2;
|
|
147
|
+
$[35] = t3;
|
|
148
|
+
$[36] = t4;
|
|
149
|
+
$[37] = t5;
|
|
150
|
+
$[38] = t6;
|
|
151
|
+
$[39] = t7;
|
|
152
|
+
$[40] = t8;
|
|
153
|
+
$[41] = t9;
|
|
154
|
+
$[42] = t11;
|
|
155
|
+
} else t11 = $[42];
|
|
160
156
|
let t12;
|
|
161
|
-
if ($[
|
|
157
|
+
if ($[43] !== formFieldErrorProps) {
|
|
162
158
|
t12 = /* @__PURE__ */ jsx(FormFieldError, { ...formFieldErrorProps });
|
|
163
|
-
$[
|
|
164
|
-
$[
|
|
165
|
-
} else t12 = $[
|
|
159
|
+
$[43] = formFieldErrorProps;
|
|
160
|
+
$[44] = t12;
|
|
161
|
+
} else t12 = $[44];
|
|
166
162
|
let t13;
|
|
167
|
-
if ($[
|
|
163
|
+
if ($[45] !== t11 || $[46] !== t12) {
|
|
168
164
|
t13 = /* @__PURE__ */ jsxs(Fragment, { children: [t11, t12] });
|
|
169
|
-
$[
|
|
170
|
-
$[
|
|
171
|
-
$[
|
|
172
|
-
} else t13 = $[
|
|
165
|
+
$[45] = t11;
|
|
166
|
+
$[46] = t12;
|
|
167
|
+
$[47] = t13;
|
|
168
|
+
} else t13 = $[47];
|
|
173
169
|
return t13;
|
|
174
170
|
};
|
|
175
171
|
var Toggle = (props) => {
|
|
176
172
|
const $ = c(15);
|
|
177
|
-
if ("
|
|
178
|
-
let
|
|
173
|
+
if ("field" in props && props.field) {
|
|
174
|
+
let field;
|
|
179
175
|
let innerProps;
|
|
180
176
|
let ref;
|
|
181
177
|
if ($[0] !== props) {
|
|
182
|
-
({
|
|
178
|
+
({field, ref, ...innerProps} = props);
|
|
183
179
|
$[0] = props;
|
|
184
|
-
$[1] =
|
|
180
|
+
$[1] = field;
|
|
185
181
|
$[2] = innerProps;
|
|
186
182
|
$[3] = ref;
|
|
187
183
|
} else {
|
|
188
|
-
|
|
184
|
+
field = $[1];
|
|
189
185
|
innerProps = $[2];
|
|
190
186
|
ref = $[3];
|
|
191
187
|
}
|
|
192
188
|
let t0;
|
|
193
189
|
if ($[4] !== innerProps || $[5] !== props.error || $[6] !== props.isDisabled || $[7] !== ref) {
|
|
194
190
|
t0 = (t1) => {
|
|
195
|
-
const { field, fieldState: t2 } = t1;
|
|
191
|
+
const { field: field_0, fieldState: t2 } = t1;
|
|
196
192
|
const { error, isDirty } = t2;
|
|
197
193
|
return /* @__PURE__ */ jsx(ToggleBase, {
|
|
198
194
|
...innerProps,
|
|
199
|
-
ref: mergeRefs(ref,
|
|
200
|
-
isSelected:
|
|
201
|
-
onChange:
|
|
202
|
-
onBlur:
|
|
203
|
-
name:
|
|
195
|
+
ref: mergeRefs(ref, field_0.ref),
|
|
196
|
+
isSelected: field_0.value,
|
|
197
|
+
onChange: field_0.onChange,
|
|
198
|
+
onBlur: field_0.onBlur,
|
|
199
|
+
name: field_0.name,
|
|
204
200
|
isDirty,
|
|
205
|
-
isDisabled:
|
|
201
|
+
isDisabled: field_0.disabled || props.isDisabled,
|
|
206
202
|
error: props.error ?? error?.message
|
|
207
203
|
});
|
|
208
204
|
};
|
|
@@ -213,14 +209,14 @@ var Toggle = (props) => {
|
|
|
213
209
|
$[8] = t0;
|
|
214
210
|
} else t0 = $[8];
|
|
215
211
|
let t1;
|
|
216
|
-
if ($[9] !==
|
|
217
|
-
t1 = /* @__PURE__ */ jsx(
|
|
218
|
-
control:
|
|
219
|
-
name:
|
|
212
|
+
if ($[9] !== field.form || $[10] !== field.name || $[11] !== t0) {
|
|
213
|
+
t1 = /* @__PURE__ */ jsx(FieldController, {
|
|
214
|
+
control: field.form,
|
|
215
|
+
name: field.name,
|
|
220
216
|
render: t0
|
|
221
217
|
});
|
|
222
|
-
$[9] =
|
|
223
|
-
$[10] =
|
|
218
|
+
$[9] = field.form;
|
|
219
|
+
$[10] = field.name;
|
|
224
220
|
$[11] = t0;
|
|
225
221
|
$[12] = t1;
|
|
226
222
|
} else t1 = $[12];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { UIOverrides } from "../../../config/uiOverrides.context.js";
|
|
2
2
|
import { typographyDefinition } from "../../text/Typography/typography.cva.js";
|
|
3
|
+
import clsx$1 from "clsx";
|
|
3
4
|
import { c } from "react/compiler-runtime";
|
|
4
5
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
import clsx$1 from "clsx";
|
|
6
6
|
//#region src/components/inputs/shared/CheckContent.tsx
|
|
7
7
|
var CheckContent = (t0) => {
|
|
8
8
|
const $ = c(3);
|
|
@@ -1,63 +1,77 @@
|
|
|
1
|
-
import { CloseIcon } from "../../../assets/icons/Close.js";
|
|
2
1
|
import { UIConfig } from "../../../config/uiConfig.context.js";
|
|
3
2
|
import { InlineIconButton } from "../../buttons/InlineIconButton/InlineIconButton.js";
|
|
4
3
|
import "../../../config/i18n.js";
|
|
4
|
+
import { X } from "lucide-react";
|
|
5
|
+
import { clsx } from "clsx";
|
|
5
6
|
import { c } from "react/compiler-runtime";
|
|
6
7
|
import { jsx } from "react/jsx-runtime";
|
|
7
|
-
import { clsx } from "clsx";
|
|
8
8
|
import { useTranslation } from "react-i18next";
|
|
9
9
|
//#region src/components/inputs/shared/InputClear.tsx
|
|
10
10
|
var InputClear = (t0) => {
|
|
11
|
-
const $ = c(
|
|
11
|
+
const $ = c(17);
|
|
12
12
|
const { onClear, className, style, show, renderStatic } = t0;
|
|
13
|
-
const
|
|
13
|
+
const ui = UIConfig.useConfig();
|
|
14
|
+
const { t } = useTranslation("ui");
|
|
15
|
+
const alwaysShowClear = ui.input.alwaysShowClear;
|
|
14
16
|
let clearClassName;
|
|
15
17
|
let t1;
|
|
16
|
-
if ($[0] !== alwaysShowClear || $[1] !== className || $[2] !==
|
|
18
|
+
if ($[0] !== alwaysShowClear || $[1] !== className || $[2] !== onClear || $[3] !== renderStatic || $[4] !== show || $[5] !== style || $[6] !== t) {
|
|
17
19
|
t1 = Symbol.for("react.early_return_sentinel");
|
|
18
20
|
bb0: {
|
|
19
21
|
clearClassName = clsx("relative z-raised flex items-center", !alwaysShowClear && "md:invisible group-focus-within:visible group-hover/date-picker-content:visible group-hover/select-content:visible group-hover/text-area:visible group-hover:visible", "border-0!", !show && "invisible!", className);
|
|
20
22
|
if (renderStatic) {
|
|
21
23
|
let t2;
|
|
22
|
-
if ($[
|
|
23
|
-
t2 =
|
|
24
|
-
$[
|
|
25
|
-
|
|
24
|
+
if ($[9] !== show || $[10] !== t) {
|
|
25
|
+
t2 = show ? t(_temp) : void 0;
|
|
26
|
+
$[9] = show;
|
|
27
|
+
$[10] = t;
|
|
28
|
+
$[11] = t2;
|
|
29
|
+
} else t2 = $[11];
|
|
30
|
+
let t3;
|
|
31
|
+
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
32
|
+
t3 = /* @__PURE__ */ jsx(X, { className: "h-6 w-6 shrink-0" });
|
|
33
|
+
$[12] = t3;
|
|
34
|
+
} else t3 = $[12];
|
|
26
35
|
t1 = /* @__PURE__ */ jsx("button", {
|
|
27
36
|
type: "button",
|
|
28
|
-
"aria-hidden":
|
|
37
|
+
"aria-hidden": !show,
|
|
38
|
+
"aria-label": t2,
|
|
39
|
+
"data-static-clear-action": true,
|
|
29
40
|
tabIndex: -1,
|
|
41
|
+
onClick: onClear,
|
|
30
42
|
className: clsx("group inline-flex items-center justify-center border border-solid border-support-transparent-outline", "rounded-button-rounding-s p-0 text-interactive-text-secondary-idle", clearClassName),
|
|
31
43
|
style,
|
|
32
|
-
children:
|
|
44
|
+
children: t3
|
|
33
45
|
});
|
|
34
46
|
break bb0;
|
|
35
47
|
}
|
|
36
48
|
}
|
|
37
49
|
$[0] = alwaysShowClear;
|
|
38
50
|
$[1] = className;
|
|
39
|
-
$[2] =
|
|
40
|
-
$[3] =
|
|
41
|
-
$[4] =
|
|
42
|
-
$[5] =
|
|
43
|
-
$[6] =
|
|
51
|
+
$[2] = onClear;
|
|
52
|
+
$[3] = renderStatic;
|
|
53
|
+
$[4] = show;
|
|
54
|
+
$[5] = style;
|
|
55
|
+
$[6] = t;
|
|
56
|
+
$[7] = clearClassName;
|
|
57
|
+
$[8] = t1;
|
|
44
58
|
} else {
|
|
45
|
-
clearClassName = $[
|
|
46
|
-
t1 = $[
|
|
59
|
+
clearClassName = $[7];
|
|
60
|
+
t1 = $[8];
|
|
47
61
|
}
|
|
48
62
|
if (t1 !== Symbol.for("react.early_return_sentinel")) return t1;
|
|
49
63
|
let t2;
|
|
50
|
-
if ($[
|
|
64
|
+
if ($[13] !== clearClassName || $[14] !== onClear || $[15] !== style) {
|
|
51
65
|
t2 = /* @__PURE__ */ jsx(InputClearButton, {
|
|
52
66
|
onClear,
|
|
53
67
|
className: clearClassName,
|
|
54
68
|
style
|
|
55
69
|
});
|
|
56
|
-
$[
|
|
57
|
-
$[
|
|
58
|
-
$[
|
|
59
|
-
$[
|
|
60
|
-
} else t2 = $[
|
|
70
|
+
$[13] = clearClassName;
|
|
71
|
+
$[14] = onClear;
|
|
72
|
+
$[15] = style;
|
|
73
|
+
$[16] = t2;
|
|
74
|
+
} else t2 = $[16];
|
|
61
75
|
return t2;
|
|
62
76
|
};
|
|
63
77
|
var InputClearButton = (t0) => {
|
|
@@ -66,7 +80,7 @@ var InputClearButton = (t0) => {
|
|
|
66
80
|
const { t } = useTranslation("ui");
|
|
67
81
|
let t1;
|
|
68
82
|
if ($[0] !== t) {
|
|
69
|
-
t1 = t(
|
|
83
|
+
t1 = t(_temp2);
|
|
70
84
|
$[0] = t;
|
|
71
85
|
$[1] = t1;
|
|
72
86
|
} else t1 = $[1];
|
|
@@ -76,9 +90,9 @@ var InputClearButton = (t0) => {
|
|
|
76
90
|
color: "secondary",
|
|
77
91
|
className,
|
|
78
92
|
label: t1,
|
|
79
|
-
icon:
|
|
93
|
+
icon: X,
|
|
80
94
|
onPress: onClear,
|
|
81
|
-
onMouseDown:
|
|
95
|
+
onMouseDown: _temp3,
|
|
82
96
|
excludeFromTabOrder: true,
|
|
83
97
|
style
|
|
84
98
|
});
|
|
@@ -93,7 +107,10 @@ var InputClearButton = (t0) => {
|
|
|
93
107
|
function _temp($) {
|
|
94
108
|
return $.ui.clearAlt;
|
|
95
109
|
}
|
|
96
|
-
function _temp2(
|
|
110
|
+
function _temp2($) {
|
|
111
|
+
return $.ui.clearAlt;
|
|
112
|
+
}
|
|
113
|
+
function _temp3(e) {
|
|
97
114
|
return e.preventDefault();
|
|
98
115
|
}
|
|
99
116
|
//#endregion
|
|
@@ -6,5 +6,5 @@ interface TooltipWrapperProps {
|
|
|
6
6
|
triggerClassName?: string;
|
|
7
7
|
triggerTabIndex?: number;
|
|
8
8
|
}
|
|
9
|
-
export declare const TooltipWrapper: (props: TooltipWrapperProps) => string | number | bigint | boolean |
|
|
9
|
+
export declare const TooltipWrapper: (props: TooltipWrapperProps) => string | number | bigint | boolean | Iterable<import('react').ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<import('react').ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
10
10
|
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { DeepKeys, DeepValue, UIForm } from '../../../hooks/useForm';
|
|
2
|
+
export type FieldValues = Record<string, any>;
|
|
3
|
+
export type FieldPath<TFieldValues extends FieldValues> = DeepKeys<TFieldValues>;
|
|
4
|
+
export type FieldPathValue<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>> = DeepValue<TFieldValues, TName>;
|
|
5
|
+
export type FormInstance<TFieldValues extends FieldValues> = UIForm<TFieldValues>;
|
|
6
|
+
interface FieldControllerProps<TFieldValues extends FieldValues> {
|
|
7
|
+
control: UIForm<TFieldValues>;
|
|
8
|
+
name: DeepKeys<TFieldValues>;
|
|
9
|
+
render: (props: {
|
|
10
|
+
field: {
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
name: string;
|
|
13
|
+
onBlur: () => void;
|
|
14
|
+
onChange: (value: any) => void;
|
|
15
|
+
ref: () => void;
|
|
16
|
+
value: any;
|
|
17
|
+
};
|
|
18
|
+
fieldState: {
|
|
19
|
+
error?: {
|
|
20
|
+
message: string;
|
|
21
|
+
};
|
|
22
|
+
isDirty: boolean;
|
|
23
|
+
};
|
|
24
|
+
}) => React.ReactNode;
|
|
25
|
+
}
|
|
26
|
+
export declare function FieldController<TFieldValues extends FieldValues>({ control: form, name, render, }: FieldControllerProps<TFieldValues>): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { getFieldError } from "./form.types.js";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/inputs/shared/form.binding.tsx
|
|
5
|
+
function FieldController(t0) {
|
|
6
|
+
const $ = c(12);
|
|
7
|
+
const { control: form, name, render } = t0;
|
|
8
|
+
const T0 = form.Field;
|
|
9
|
+
let t1;
|
|
10
|
+
if ($[0] !== form || $[1] !== name) {
|
|
11
|
+
t1 = form.getFieldValidators(name);
|
|
12
|
+
$[0] = form;
|
|
13
|
+
$[1] = name;
|
|
14
|
+
$[2] = t1;
|
|
15
|
+
} else t1 = $[2];
|
|
16
|
+
let t2;
|
|
17
|
+
if ($[3] !== form || $[4] !== name || $[5] !== render) {
|
|
18
|
+
t2 = (field) => render({
|
|
19
|
+
field: {
|
|
20
|
+
disabled: form.disabled,
|
|
21
|
+
name: field.name,
|
|
22
|
+
onBlur: () => {
|
|
23
|
+
field.handleBlur();
|
|
24
|
+
form.notifyBlur(name);
|
|
25
|
+
},
|
|
26
|
+
onChange: field.handleChange,
|
|
27
|
+
ref: _temp,
|
|
28
|
+
value: field.state.value
|
|
29
|
+
},
|
|
30
|
+
fieldState: {
|
|
31
|
+
error: getFieldError(field.state.meta.errors) ? { message: getFieldError(field.state.meta.errors) } : void 0,
|
|
32
|
+
isDirty: field.state.meta.isDirty
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
$[3] = form;
|
|
36
|
+
$[4] = name;
|
|
37
|
+
$[5] = render;
|
|
38
|
+
$[6] = t2;
|
|
39
|
+
} else t2 = $[6];
|
|
40
|
+
let t3;
|
|
41
|
+
if ($[7] !== form.Field || $[8] !== name || $[9] !== t1 || $[10] !== t2) {
|
|
42
|
+
t3 = /* @__PURE__ */ jsx(T0, {
|
|
43
|
+
name,
|
|
44
|
+
validators: t1,
|
|
45
|
+
children: t2
|
|
46
|
+
});
|
|
47
|
+
$[7] = form.Field;
|
|
48
|
+
$[8] = name;
|
|
49
|
+
$[9] = t1;
|
|
50
|
+
$[10] = t2;
|
|
51
|
+
$[11] = t3;
|
|
52
|
+
} else t3 = $[11];
|
|
53
|
+
return t3;
|
|
54
|
+
}
|
|
55
|
+
function _temp() {}
|
|
56
|
+
//#endregion
|
|
57
|
+
export { FieldController };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DeepKeys, DeepValue, UIForm } from '../../../hooks/useForm';
|
|
2
2
|
export type ControlKeys<TProps, TValueProp extends keyof TProps = "value" extends keyof TProps ? "value" : never> = TValueProp | "onChange" | "onBlur";
|
|
3
|
-
export interface FormControl<TFieldValues extends
|
|
4
|
-
|
|
3
|
+
export interface FormControl<TFieldValues extends Record<string, unknown>, TType> {
|
|
4
|
+
form: UIForm<TFieldValues>;
|
|
5
5
|
name: {
|
|
6
|
-
[K in
|
|
7
|
-
}[
|
|
6
|
+
[K in DeepKeys<TFieldValues>]: DeepValue<TFieldValues, K> extends TType ? K : never;
|
|
7
|
+
}[DeepKeys<TFieldValues>];
|
|
8
8
|
}
|
|
9
|
-
export type FormControlProps<TProps, TFieldValues extends
|
|
10
|
-
|
|
9
|
+
export type FormControlProps<TProps, TFieldValues extends Record<string, unknown>, TValueProp extends keyof TProps = "value" extends keyof TProps ? "value" : never> = {
|
|
10
|
+
field: FormControl<TFieldValues, TProps[TValueProp] | null>;
|
|
11
11
|
} & Omit<TProps, ControlKeys<TProps, TValueProp>> & Partial<Record<ControlKeys<TProps, TValueProp>, never>>;
|
|
12
|
-
export type ControlProps<TProps, TFieldValues extends
|
|
12
|
+
export type ControlProps<TProps, TFieldValues extends Record<string, unknown>, TValueProp extends keyof TProps = "value" extends keyof TProps ? "value" : never> = FormControlProps<TProps, TFieldValues, TValueProp> | TProps;
|
|
13
|
+
export declare const getFieldError: (errors: unknown[]) => string | undefined;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region src/components/inputs/shared/form.types.ts
|
|
2
|
+
var getFieldError = (errors) => errors.flatMap((error) => {
|
|
3
|
+
if (typeof error === "string") return [error];
|
|
4
|
+
if (error && typeof error === "object" && "message" in error) return [String(error.message)];
|
|
5
|
+
return [];
|
|
6
|
+
}).at(0);
|
|
7
|
+
//#endregion
|
|
8
|
+
export { getFieldError };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UIOverrides } from "../../../config/uiOverrides.context.js";
|
|
2
2
|
import { uiOutlineClass } from "../../outline.clsx.js";
|
|
3
|
-
import { c } from "react/compiler-runtime";
|
|
4
3
|
import { clsx } from "clsx";
|
|
4
|
+
import { c } from "react/compiler-runtime";
|
|
5
5
|
//#region src/components/inputs/shared/input.cva.ts
|
|
6
6
|
var inputBaseDefinition = UIOverrides.defineConfig({
|
|
7
7
|
base: [uiOutlineClass, "flex w-full not-[textarea]:truncate"],
|
|
@@ -1,18 +1,33 @@
|
|
|
1
|
-
import { c } from "react/compiler-runtime";
|
|
2
1
|
import { useLayoutEffect, useRef, useState } from "react";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
3
|
//#region src/components/inputs/shared/useStaticInputHandoff.ts
|
|
4
4
|
var useStaticInputHandoff = (t0) => {
|
|
5
|
-
const $ = c(
|
|
5
|
+
const $ = c(18);
|
|
6
6
|
const { inputRef, renderInput, setRenderInput, getFocusTarget, getPressTarget } = t0;
|
|
7
7
|
const [shouldFocus, setShouldFocus] = useState(false);
|
|
8
8
|
const pendingStaticChangeRef = useRef(null);
|
|
9
9
|
const pendingStaticFocusTargetRef = useRef(null);
|
|
10
10
|
const resolvedFocusTargetRef = useRef(null);
|
|
11
11
|
const shouldReplayStaticPressRef = useRef(false);
|
|
12
|
+
const hoverHandoffFrameRef = useRef(null);
|
|
12
13
|
let t1;
|
|
13
14
|
let t2;
|
|
14
|
-
if ($[0]
|
|
15
|
-
t1 = () => {
|
|
15
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
16
|
+
t1 = () => () => {
|
|
17
|
+
if (hoverHandoffFrameRef.current !== null) cancelAnimationFrame(hoverHandoffFrameRef.current);
|
|
18
|
+
};
|
|
19
|
+
t2 = [];
|
|
20
|
+
$[0] = t1;
|
|
21
|
+
$[1] = t2;
|
|
22
|
+
} else {
|
|
23
|
+
t1 = $[0];
|
|
24
|
+
t2 = $[1];
|
|
25
|
+
}
|
|
26
|
+
useLayoutEffect(t1, t2);
|
|
27
|
+
let t3;
|
|
28
|
+
let t4;
|
|
29
|
+
if ($[2] !== getFocusTarget || $[3] !== getPressTarget || $[4] !== inputRef || $[5] !== renderInput || $[6] !== shouldFocus) {
|
|
30
|
+
t3 = () => {
|
|
16
31
|
if (!renderInput || !shouldFocus) return;
|
|
17
32
|
const focusRealInput = (replayPendingInteraction) => {
|
|
18
33
|
const input = inputRef.current;
|
|
@@ -45,68 +60,79 @@ var useStaticInputHandoff = (t0) => {
|
|
|
45
60
|
cancelAnimationFrame(frame);
|
|
46
61
|
};
|
|
47
62
|
};
|
|
48
|
-
|
|
63
|
+
t4 = [
|
|
49
64
|
getFocusTarget,
|
|
50
65
|
getPressTarget,
|
|
51
66
|
inputRef,
|
|
52
67
|
renderInput,
|
|
53
68
|
shouldFocus
|
|
54
69
|
];
|
|
55
|
-
$[
|
|
56
|
-
$[
|
|
57
|
-
$[
|
|
58
|
-
$[
|
|
59
|
-
$[
|
|
60
|
-
$[
|
|
61
|
-
$[
|
|
70
|
+
$[2] = getFocusTarget;
|
|
71
|
+
$[3] = getPressTarget;
|
|
72
|
+
$[4] = inputRef;
|
|
73
|
+
$[5] = renderInput;
|
|
74
|
+
$[6] = shouldFocus;
|
|
75
|
+
$[7] = t3;
|
|
76
|
+
$[8] = t4;
|
|
62
77
|
} else {
|
|
63
|
-
|
|
64
|
-
|
|
78
|
+
t3 = $[7];
|
|
79
|
+
t4 = $[8];
|
|
65
80
|
}
|
|
66
|
-
useLayoutEffect(
|
|
67
|
-
let t3;
|
|
68
|
-
let t4;
|
|
81
|
+
useLayoutEffect(t3, t4);
|
|
69
82
|
let t5;
|
|
70
|
-
|
|
71
|
-
|
|
83
|
+
let t6;
|
|
84
|
+
let t7;
|
|
85
|
+
if ($[9] !== setRenderInput) {
|
|
86
|
+
t5 = (focus, target) => {
|
|
72
87
|
pendingStaticFocusTargetRef.current = target ?? null;
|
|
73
88
|
setShouldFocus(focus);
|
|
74
|
-
|
|
89
|
+
if (focus) {
|
|
90
|
+
if (hoverHandoffFrameRef.current !== null) {
|
|
91
|
+
cancelAnimationFrame(hoverHandoffFrameRef.current);
|
|
92
|
+
hoverHandoffFrameRef.current = null;
|
|
93
|
+
}
|
|
94
|
+
setRenderInput(true);
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
hoverHandoffFrameRef.current = requestAnimationFrame(() => {
|
|
98
|
+
hoverHandoffFrameRef.current = null;
|
|
99
|
+
setRenderInput(true);
|
|
100
|
+
});
|
|
75
101
|
};
|
|
76
|
-
|
|
102
|
+
t6 = (value) => {
|
|
77
103
|
pendingStaticChangeRef.current = value;
|
|
78
104
|
setShouldFocus(true);
|
|
79
105
|
setRenderInput(true);
|
|
80
106
|
};
|
|
81
|
-
|
|
107
|
+
t7 = () => {
|
|
82
108
|
shouldReplayStaticPressRef.current = true;
|
|
83
109
|
setShouldFocus(true);
|
|
84
110
|
setRenderInput(true);
|
|
85
111
|
};
|
|
86
|
-
$[
|
|
87
|
-
$[8] = t3;
|
|
88
|
-
$[9] = t4;
|
|
112
|
+
$[9] = setRenderInput;
|
|
89
113
|
$[10] = t5;
|
|
114
|
+
$[11] = t6;
|
|
115
|
+
$[12] = t7;
|
|
90
116
|
} else {
|
|
91
|
-
t3 = $[8];
|
|
92
|
-
t4 = $[9];
|
|
93
117
|
t5 = $[10];
|
|
118
|
+
t6 = $[11];
|
|
119
|
+
t7 = $[12];
|
|
94
120
|
}
|
|
95
|
-
let
|
|
96
|
-
if ($[
|
|
97
|
-
|
|
121
|
+
let t8;
|
|
122
|
+
if ($[13] !== shouldFocus || $[14] !== t5 || $[15] !== t6 || $[16] !== t7) {
|
|
123
|
+
t8 = {
|
|
98
124
|
shouldFocus,
|
|
99
|
-
renderRealInput:
|
|
100
|
-
replayStaticInputChange:
|
|
101
|
-
replayStaticInputPress:
|
|
125
|
+
renderRealInput: t5,
|
|
126
|
+
replayStaticInputChange: t6,
|
|
127
|
+
replayStaticInputPress: t7
|
|
102
128
|
};
|
|
103
|
-
$[
|
|
104
|
-
$[12] = t3;
|
|
105
|
-
$[13] = t4;
|
|
129
|
+
$[13] = shouldFocus;
|
|
106
130
|
$[14] = t5;
|
|
107
131
|
$[15] = t6;
|
|
108
|
-
|
|
109
|
-
|
|
132
|
+
$[16] = t7;
|
|
133
|
+
$[17] = t8;
|
|
134
|
+
} else t8 = $[17];
|
|
135
|
+
return t8;
|
|
110
136
|
};
|
|
111
137
|
//#endregion
|
|
112
138
|
export { useStaticInputHandoff };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { UIOverrides } from "../../../config/uiOverrides.context.js";
|
|
2
2
|
import { accordionDefinition } from "./accordion.cva.js";
|
|
3
3
|
import { AccordionItem } from "./AccordionItem.js";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
5
4
|
import { clsx } from "clsx";
|
|
6
5
|
import { DisclosureGroup } from "react-aria-components";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
//#region src/components/navigation/Accordion/Accordion.tsx
|
|
8
8
|
var Accordion = ({ items, variant = "filled", actionPosition = "right", allowsMultipleExpanded = false, expandedKeys, defaultExpandedKeys, onExpandedChange, className, disabled }) => {
|
|
9
9
|
return /* @__PURE__ */ jsx(DisclosureGroup, {
|