@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
|
@@ -7,49 +7,163 @@ import { inputSizeDefinition } from "../../shared/input.cva.js";
|
|
|
7
7
|
import { UploadIcon } from "../../../../assets/icons/Upload.js";
|
|
8
8
|
import { inputButtonSizeMapping } from "../inputUpload.types.js";
|
|
9
9
|
import { inputUploadButton, inputUploadDropZone } from "./inputUploadButton.cva.js";
|
|
10
|
+
import { c } from "react/compiler-runtime";
|
|
10
11
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
12
|
import { clsx } from "clsx";
|
|
12
13
|
import { DropZone, FileTrigger } from "react-aria-components";
|
|
13
14
|
import { useTranslation } from "react-i18next";
|
|
14
15
|
//#region src/components/inputs/File/shared/InputUploadContent.tsx
|
|
15
16
|
var InputUploadContent = (props) => {
|
|
16
|
-
const
|
|
17
|
+
const $ = c(46);
|
|
18
|
+
let buttonText;
|
|
19
|
+
let error;
|
|
20
|
+
let isDisabled;
|
|
21
|
+
let placeholder;
|
|
22
|
+
let rest;
|
|
23
|
+
let size;
|
|
24
|
+
let variant;
|
|
25
|
+
if ($[0] !== props) {
|
|
26
|
+
({variant, isDisabled, error, placeholder, buttonText, size, ...rest} = props);
|
|
27
|
+
$[0] = props;
|
|
28
|
+
$[1] = buttonText;
|
|
29
|
+
$[2] = error;
|
|
30
|
+
$[3] = isDisabled;
|
|
31
|
+
$[4] = placeholder;
|
|
32
|
+
$[5] = rest;
|
|
33
|
+
$[6] = size;
|
|
34
|
+
$[7] = variant;
|
|
35
|
+
} else {
|
|
36
|
+
buttonText = $[1];
|
|
37
|
+
error = $[2];
|
|
38
|
+
isDisabled = $[3];
|
|
39
|
+
placeholder = $[4];
|
|
40
|
+
rest = $[5];
|
|
41
|
+
size = $[6];
|
|
42
|
+
variant = $[7];
|
|
43
|
+
}
|
|
17
44
|
const { t } = useTranslation("ui");
|
|
18
45
|
const inputSizeCva = UIOverrides.useCva("input.sizeCva", inputSizeDefinition);
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
46
|
+
const t0 = isDisabled || void 0;
|
|
47
|
+
const t1 = isDisabled || void 0;
|
|
48
|
+
const t2 = !!error || void 0;
|
|
49
|
+
let t3;
|
|
50
|
+
if ($[8] !== variant) {
|
|
51
|
+
t3 = inputUploadButton({
|
|
52
|
+
variant,
|
|
53
|
+
className: "group/input-upload"
|
|
54
|
+
});
|
|
55
|
+
$[8] = variant;
|
|
56
|
+
$[9] = t3;
|
|
57
|
+
} else t3 = $[9];
|
|
58
|
+
let t4;
|
|
59
|
+
if ($[10] !== inputSizeCva || $[11] !== size || $[12] !== variant) {
|
|
60
|
+
t4 = clsx(inputUploadDropZone({ variant }), inputSizeCva({ size }));
|
|
61
|
+
$[10] = inputSizeCva;
|
|
62
|
+
$[11] = size;
|
|
63
|
+
$[12] = variant;
|
|
64
|
+
$[13] = t4;
|
|
65
|
+
} else t4 = $[13];
|
|
66
|
+
let t5;
|
|
67
|
+
if ($[14] !== placeholder || $[15] !== t) {
|
|
68
|
+
t5 = placeholder ?? t(_temp);
|
|
69
|
+
$[14] = placeholder;
|
|
70
|
+
$[15] = t;
|
|
71
|
+
$[16] = t5;
|
|
72
|
+
} else t5 = $[16];
|
|
73
|
+
let t6;
|
|
74
|
+
if ($[17] !== t5) {
|
|
75
|
+
t6 = /* @__PURE__ */ jsx(Typography, {
|
|
76
|
+
variant: "default",
|
|
77
|
+
size: "label-1",
|
|
78
|
+
as: "span",
|
|
79
|
+
className: "min-w-0 flex-fill select-none truncate text-text-default-3",
|
|
80
|
+
children: t5
|
|
81
|
+
});
|
|
82
|
+
$[17] = t5;
|
|
83
|
+
$[18] = t6;
|
|
84
|
+
} else t6 = $[18];
|
|
85
|
+
let t7;
|
|
86
|
+
if ($[19] !== buttonText || $[20] !== isDisabled || $[21] !== t || $[22] !== variant) {
|
|
87
|
+
t7 = variant === "nested" && /* @__PURE__ */ jsx(TextButton, {
|
|
88
|
+
isDisabled,
|
|
89
|
+
icon: UploadIcon,
|
|
90
|
+
children: buttonText ?? t(_temp2)
|
|
91
|
+
});
|
|
92
|
+
$[19] = buttonText;
|
|
93
|
+
$[20] = isDisabled;
|
|
94
|
+
$[21] = t;
|
|
95
|
+
$[22] = variant;
|
|
96
|
+
$[23] = t7;
|
|
97
|
+
} else t7 = $[23];
|
|
98
|
+
let t8;
|
|
99
|
+
if ($[24] !== isDisabled || $[25] !== rest || $[26] !== t4 || $[27] !== t6 || $[28] !== t7) {
|
|
100
|
+
t8 = /* @__PURE__ */ jsxs(DropZone, {
|
|
101
|
+
...rest,
|
|
102
|
+
isDisabled,
|
|
103
|
+
className: t4,
|
|
104
|
+
children: [t6, t7]
|
|
105
|
+
});
|
|
106
|
+
$[24] = isDisabled;
|
|
107
|
+
$[25] = rest;
|
|
108
|
+
$[26] = t4;
|
|
109
|
+
$[27] = t6;
|
|
110
|
+
$[28] = t7;
|
|
111
|
+
$[29] = t8;
|
|
112
|
+
} else t8 = $[29];
|
|
113
|
+
let t9;
|
|
114
|
+
if ($[30] !== buttonText || $[31] !== isDisabled || $[32] !== size || $[33] !== t || $[34] !== variant) {
|
|
115
|
+
t9 = variant !== "nested" && /* @__PURE__ */ jsx(Button$1, {
|
|
116
|
+
size: inputButtonSizeMapping[size ?? "default"],
|
|
117
|
+
width: "hug",
|
|
118
|
+
isDisabled,
|
|
119
|
+
className: "truncate",
|
|
120
|
+
children: buttonText ?? t(_temp3)
|
|
121
|
+
});
|
|
122
|
+
$[30] = buttonText;
|
|
123
|
+
$[31] = isDisabled;
|
|
124
|
+
$[32] = size;
|
|
125
|
+
$[33] = t;
|
|
126
|
+
$[34] = variant;
|
|
127
|
+
$[35] = t9;
|
|
128
|
+
} else t9 = $[35];
|
|
129
|
+
let t10;
|
|
130
|
+
if ($[36] !== t0 || $[37] !== t1 || $[38] !== t2 || $[39] !== t3 || $[40] !== t8 || $[41] !== t9) {
|
|
131
|
+
t10 = /* @__PURE__ */ jsxs("div", {
|
|
22
132
|
"data-rac": "",
|
|
23
|
-
"data-disabled":
|
|
24
|
-
"data-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
className: "truncate",
|
|
49
|
-
children: buttonText ?? t(($) => $.ui.fileUpload.uploadFile)
|
|
50
|
-
})]
|
|
51
|
-
})
|
|
52
|
-
});
|
|
133
|
+
"data-disabled": t0,
|
|
134
|
+
"data-is-disabled": t1,
|
|
135
|
+
"data-invalid": t2,
|
|
136
|
+
className: t3,
|
|
137
|
+
children: [t8, t9]
|
|
138
|
+
});
|
|
139
|
+
$[36] = t0;
|
|
140
|
+
$[37] = t1;
|
|
141
|
+
$[38] = t2;
|
|
142
|
+
$[39] = t3;
|
|
143
|
+
$[40] = t8;
|
|
144
|
+
$[41] = t9;
|
|
145
|
+
$[42] = t10;
|
|
146
|
+
} else t10 = $[42];
|
|
147
|
+
let t11;
|
|
148
|
+
if ($[43] !== rest || $[44] !== t10) {
|
|
149
|
+
t11 = /* @__PURE__ */ jsx(FileTrigger, {
|
|
150
|
+
...rest,
|
|
151
|
+
children: t10
|
|
152
|
+
});
|
|
153
|
+
$[43] = rest;
|
|
154
|
+
$[44] = t10;
|
|
155
|
+
$[45] = t11;
|
|
156
|
+
} else t11 = $[45];
|
|
157
|
+
return t11;
|
|
53
158
|
};
|
|
159
|
+
function _temp($) {
|
|
160
|
+
return $.ui.fileUpload.emptyText;
|
|
161
|
+
}
|
|
162
|
+
function _temp2($_0) {
|
|
163
|
+
return $_0.ui.fileUpload.upload;
|
|
164
|
+
}
|
|
165
|
+
function _temp3($_1) {
|
|
166
|
+
return $_1.ui.fileUpload.uploadFile;
|
|
167
|
+
}
|
|
54
168
|
//#endregion
|
|
55
169
|
export { InputUploadContent };
|
|
@@ -3,26 +3,67 @@ import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
|
3
3
|
import { Typography } from "../../../text/Typography/Typography.js";
|
|
4
4
|
import { InlineIconButton } from "../../../buttons/InlineIconButton/InlineIconButton.js";
|
|
5
5
|
import { inputSizeDefinition } from "../../shared/input.cva.js";
|
|
6
|
+
import { c } from "react/compiler-runtime";
|
|
6
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
8
|
import { clsx } from "clsx";
|
|
8
9
|
//#region src/components/inputs/File/shared/InputUploadFilled.tsx
|
|
9
|
-
var InputUploadFilled = (
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
var InputUploadFilled = (t0) => {
|
|
11
|
+
const $ = c(14);
|
|
12
|
+
const { files, onRemove, isDisabled, size } = t0;
|
|
13
|
+
const inputSizeCva = UIOverrides.useCva("input.sizeCva", inputSizeDefinition);
|
|
14
|
+
let t1;
|
|
15
|
+
if ($[0] !== inputSizeCva || $[1] !== size) {
|
|
16
|
+
t1 = clsx("flex items-center rounded-input-rounding-default border border-input-outlined-outline-idle border-solid bg-input-outlined-idle", inputSizeCva({ size }));
|
|
17
|
+
$[0] = inputSizeCva;
|
|
18
|
+
$[1] = size;
|
|
19
|
+
$[2] = t1;
|
|
20
|
+
} else t1 = $[2];
|
|
21
|
+
let t2;
|
|
22
|
+
if ($[3] !== files) {
|
|
23
|
+
t2 = files.map(_temp).join(", ");
|
|
24
|
+
$[3] = files;
|
|
25
|
+
$[4] = t2;
|
|
26
|
+
} else t2 = $[4];
|
|
27
|
+
let t3;
|
|
28
|
+
if ($[5] !== t2) {
|
|
29
|
+
t3 = /* @__PURE__ */ jsx(Typography, {
|
|
13
30
|
variant: "default",
|
|
14
31
|
size: "label-1",
|
|
15
32
|
as: "span",
|
|
16
33
|
className: "flex-fill select-none truncate text-ellipsis text-text-default-1 input-disabled:text-text-default-3",
|
|
17
|
-
children:
|
|
18
|
-
})
|
|
34
|
+
children: t2
|
|
35
|
+
});
|
|
36
|
+
$[5] = t2;
|
|
37
|
+
$[6] = t3;
|
|
38
|
+
} else t3 = $[6];
|
|
39
|
+
let t4;
|
|
40
|
+
if ($[7] !== isDisabled || $[8] !== onRemove) {
|
|
41
|
+
t4 = /* @__PURE__ */ jsx(InlineIconButton, {
|
|
19
42
|
label: "Remove files",
|
|
20
43
|
color: "secondary",
|
|
21
44
|
icon: CloseIcon,
|
|
22
45
|
isDisabled,
|
|
23
46
|
onPress: onRemove
|
|
24
|
-
})
|
|
25
|
-
|
|
47
|
+
});
|
|
48
|
+
$[7] = isDisabled;
|
|
49
|
+
$[8] = onRemove;
|
|
50
|
+
$[9] = t4;
|
|
51
|
+
} else t4 = $[9];
|
|
52
|
+
let t5;
|
|
53
|
+
if ($[10] !== t1 || $[11] !== t3 || $[12] !== t4) {
|
|
54
|
+
t5 = /* @__PURE__ */ jsxs("div", {
|
|
55
|
+
className: t1,
|
|
56
|
+
children: [t3, t4]
|
|
57
|
+
});
|
|
58
|
+
$[10] = t1;
|
|
59
|
+
$[11] = t3;
|
|
60
|
+
$[12] = t4;
|
|
61
|
+
$[13] = t5;
|
|
62
|
+
} else t5 = $[13];
|
|
63
|
+
return t5;
|
|
26
64
|
};
|
|
65
|
+
function _temp(file) {
|
|
66
|
+
return file.name;
|
|
67
|
+
}
|
|
27
68
|
//#endregion
|
|
28
69
|
export { InputUploadFilled };
|
|
@@ -1,33 +1,120 @@
|
|
|
1
1
|
import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
2
2
|
import { Typography } from "../../../text/Typography/Typography.js";
|
|
3
3
|
import { progressBarDefinition, progressBarFillDefinition, progressBarTrackDefinition, progressBarTrackWrapperDefinition, progressBarValueDefinition } from "./progressBar.cva.js";
|
|
4
|
+
import { c } from "react/compiler-runtime";
|
|
4
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
6
|
//#region src/components/inputs/File/shared/ProgressBar.tsx
|
|
6
|
-
var ProgressBar = (
|
|
7
|
+
var ProgressBar = (t0) => {
|
|
8
|
+
const $ = c(33);
|
|
9
|
+
const { progress: t1, valueLabel: t2 } = t0;
|
|
10
|
+
const progress = t1 === void 0 ? 0 : t1;
|
|
11
|
+
const valueLabel = t2 === void 0 ? "trailing" : t2;
|
|
7
12
|
const progressBarCva = UIOverrides.useCva("progressBar.cva", progressBarDefinition);
|
|
8
13
|
const progressBarTrackWrapperCva = UIOverrides.useCva("progressBar.trackWrapperCva", progressBarTrackWrapperDefinition);
|
|
9
14
|
const progressBarTrackCva = UIOverrides.useCva("progressBar.trackCva", progressBarTrackDefinition);
|
|
10
15
|
const progressBarFillCva = UIOverrides.useCva("progressBar.fillCva", progressBarFillDefinition);
|
|
11
16
|
const progressBarValueCva = UIOverrides.useCva("progressBar.valueCva", progressBarValueDefinition);
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
let t3;
|
|
18
|
+
if ($[0] !== progressBarCva || $[1] !== valueLabel) {
|
|
19
|
+
t3 = progressBarCva({ valueLabel });
|
|
20
|
+
$[0] = progressBarCva;
|
|
21
|
+
$[1] = valueLabel;
|
|
22
|
+
$[2] = t3;
|
|
23
|
+
} else t3 = $[2];
|
|
24
|
+
let t4;
|
|
25
|
+
if ($[3] !== progressBarTrackWrapperCva) {
|
|
26
|
+
t4 = progressBarTrackWrapperCva();
|
|
27
|
+
$[3] = progressBarTrackWrapperCva;
|
|
28
|
+
$[4] = t4;
|
|
29
|
+
} else t4 = $[4];
|
|
30
|
+
let t5;
|
|
31
|
+
if ($[5] !== progressBarTrackCva) {
|
|
32
|
+
t5 = progressBarTrackCva({ part: "container" });
|
|
33
|
+
$[5] = progressBarTrackCva;
|
|
34
|
+
$[6] = t5;
|
|
35
|
+
} else t5 = $[6];
|
|
36
|
+
let t6;
|
|
37
|
+
if ($[7] !== progressBarTrackCva) {
|
|
38
|
+
t6 = progressBarTrackCva({ part: "background" });
|
|
39
|
+
$[7] = progressBarTrackCva;
|
|
40
|
+
$[8] = t6;
|
|
41
|
+
} else t6 = $[8];
|
|
42
|
+
let t7;
|
|
43
|
+
if ($[9] !== t6) {
|
|
44
|
+
t7 = /* @__PURE__ */ jsx("div", { className: t6 });
|
|
45
|
+
$[9] = t6;
|
|
46
|
+
$[10] = t7;
|
|
47
|
+
} else t7 = $[10];
|
|
48
|
+
let t8;
|
|
49
|
+
if ($[11] !== progressBarFillCva) {
|
|
50
|
+
t8 = progressBarFillCva();
|
|
51
|
+
$[11] = progressBarFillCva;
|
|
52
|
+
$[12] = t8;
|
|
53
|
+
} else t8 = $[12];
|
|
54
|
+
const t9 = `${progress}%`;
|
|
55
|
+
let t10;
|
|
56
|
+
if ($[13] !== t9) {
|
|
57
|
+
t10 = { width: t9 };
|
|
58
|
+
$[13] = t9;
|
|
59
|
+
$[14] = t10;
|
|
60
|
+
} else t10 = $[14];
|
|
61
|
+
let t11;
|
|
62
|
+
if ($[15] !== t10 || $[16] !== t8) {
|
|
63
|
+
t11 = /* @__PURE__ */ jsx("div", {
|
|
64
|
+
className: t8,
|
|
65
|
+
style: t10
|
|
66
|
+
});
|
|
67
|
+
$[15] = t10;
|
|
68
|
+
$[16] = t8;
|
|
69
|
+
$[17] = t11;
|
|
70
|
+
} else t11 = $[17];
|
|
71
|
+
let t12;
|
|
72
|
+
if ($[18] !== t11 || $[19] !== t5 || $[20] !== t7) {
|
|
73
|
+
t12 = /* @__PURE__ */ jsxs("div", {
|
|
74
|
+
className: t5,
|
|
75
|
+
children: [t7, t11]
|
|
76
|
+
});
|
|
77
|
+
$[18] = t11;
|
|
78
|
+
$[19] = t5;
|
|
79
|
+
$[20] = t7;
|
|
80
|
+
$[21] = t12;
|
|
81
|
+
} else t12 = $[21];
|
|
82
|
+
let t13;
|
|
83
|
+
if ($[22] !== t12 || $[23] !== t4) {
|
|
84
|
+
t13 = /* @__PURE__ */ jsx("div", {
|
|
85
|
+
className: t4,
|
|
86
|
+
children: t12
|
|
87
|
+
});
|
|
88
|
+
$[22] = t12;
|
|
89
|
+
$[23] = t4;
|
|
90
|
+
$[24] = t13;
|
|
91
|
+
} else t13 = $[24];
|
|
92
|
+
let t14;
|
|
93
|
+
if ($[25] !== progress || $[26] !== progressBarValueCva || $[27] !== valueLabel) {
|
|
94
|
+
t14 = valueLabel !== "none" && /* @__PURE__ */ jsxs(Typography, {
|
|
24
95
|
variant: "default",
|
|
25
96
|
size: "label-2",
|
|
26
97
|
as: "span",
|
|
27
98
|
className: progressBarValueCva(),
|
|
28
99
|
children: [progress, "%"]
|
|
29
|
-
})
|
|
30
|
-
|
|
100
|
+
});
|
|
101
|
+
$[25] = progress;
|
|
102
|
+
$[26] = progressBarValueCva;
|
|
103
|
+
$[27] = valueLabel;
|
|
104
|
+
$[28] = t14;
|
|
105
|
+
} else t14 = $[28];
|
|
106
|
+
let t15;
|
|
107
|
+
if ($[29] !== t13 || $[30] !== t14 || $[31] !== t3) {
|
|
108
|
+
t15 = /* @__PURE__ */ jsxs("div", {
|
|
109
|
+
className: t3,
|
|
110
|
+
children: [t13, t14]
|
|
111
|
+
});
|
|
112
|
+
$[29] = t13;
|
|
113
|
+
$[30] = t14;
|
|
114
|
+
$[31] = t3;
|
|
115
|
+
$[32] = t15;
|
|
116
|
+
} else t15 = $[32];
|
|
117
|
+
return t15;
|
|
31
118
|
};
|
|
32
119
|
//#endregion
|
|
33
120
|
export { ProgressBar };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ClassProp } from 'class-variance-authority/types';
|
|
2
1
|
import { UIOverrides } from '../../../../config/uiOverrides.context';
|
|
3
2
|
export declare const fileUploadDropZoneDefinition: {
|
|
4
3
|
base: string[];
|
|
@@ -16,13 +15,3 @@ export declare const fileUploadDropZoneDefinition: {
|
|
|
16
15
|
export type FileUploadDropZoneConfig = NonNullable<typeof fileUploadDropZoneDefinition.config>;
|
|
17
16
|
export interface FileUploadDropZoneProps extends UIOverrides.VariantProps<FileUploadDropZoneConfig> {
|
|
18
17
|
}
|
|
19
|
-
export declare const fileUploadDropZone: (props: FileUploadDropZoneProps & ClassProp) => string;
|
|
20
|
-
export declare const fileCardListDefinition: {
|
|
21
|
-
base: string[];
|
|
22
|
-
config: import("../../../../utils/style-merge.util").StyleMergeUtils.Config<{
|
|
23
|
-
readonly variant: {
|
|
24
|
-
readonly vertical: ["flex-col"];
|
|
25
|
-
readonly horizontal: ["flex-row flex-wrap"];
|
|
26
|
-
};
|
|
27
|
-
}>;
|
|
28
|
-
};
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
2
|
-
import { clsx } from "clsx";
|
|
3
|
-
import { cva } from "class-variance-authority";
|
|
4
2
|
//#region src/components/inputs/File/shared/fileUpload.cva.ts
|
|
5
3
|
var fileUploadDropZoneDefinition = UIOverrides.defineConfig({
|
|
6
4
|
base: ["relative w-full rounded-file-upload-container-rounding-default"],
|
|
@@ -40,20 +38,5 @@ var fileUploadDropZoneDefinition = UIOverrides.defineConfig({
|
|
|
40
38
|
defaultVariants: { variant: "vertical" }
|
|
41
39
|
}
|
|
42
40
|
});
|
|
43
|
-
var fileUploadDropZoneBase = cva(fileUploadDropZoneDefinition.base, fileUploadDropZoneDefinition.config);
|
|
44
|
-
var fileUploadDropZone = (props) => {
|
|
45
|
-
const { className, ...rest } = props;
|
|
46
|
-
return clsx(fileUploadDropZoneBase(rest), className);
|
|
47
|
-
};
|
|
48
|
-
var fileCardListDefinition = UIOverrides.defineConfig({
|
|
49
|
-
base: ["flex gap-3"],
|
|
50
|
-
config: {
|
|
51
|
-
variants: { variant: {
|
|
52
|
-
vertical: ["flex-col"],
|
|
53
|
-
horizontal: ["flex-row flex-wrap"]
|
|
54
|
-
} },
|
|
55
|
-
defaultVariants: { variant: "vertical" }
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
41
|
//#endregion
|
|
59
|
-
export {
|
|
42
|
+
export { fileUploadDropZoneDefinition };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PropsWithChildren, Ref } from 'react';
|
|
1
|
+
import { FocusEventHandler, MouseEventHandler, PropsWithChildren, Ref } from 'react';
|
|
2
2
|
import { FormFieldErrorProps } from './FormFieldError';
|
|
3
3
|
import { FormFieldHeaderProps } from './FormFieldHeader';
|
|
4
4
|
import { TextInputProps } from '../Input/TextInput/TextInput';
|
|
@@ -13,8 +13,8 @@ interface FormFieldComponentProps extends PropsWithChildren<FormFieldProps> {
|
|
|
13
13
|
labelProps?: FormFieldHeaderProps["labelProps"];
|
|
14
14
|
as?: TextInputProps["as"];
|
|
15
15
|
tabIndex?: number;
|
|
16
|
-
onMouseEnter?:
|
|
17
|
-
onFocusCapture?:
|
|
16
|
+
onMouseEnter?: MouseEventHandler<HTMLDivElement>;
|
|
17
|
+
onFocusCapture?: FocusEventHandler<HTMLDivElement>;
|
|
18
18
|
}
|
|
19
19
|
export declare const FormField: ({ ref, as, label, tooltipText, helperText, isRequired, rightContent, isDisabled, error, hideLabel, headerClassName, errorClassName, children, className, labelProps, isHeaderHidden, tabIndex, onMouseEnter, onFocusCapture, }: FormFieldComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
20
|
export {};
|
|
@@ -1,45 +1,127 @@
|
|
|
1
1
|
import { FormFieldError } from "./FormFieldError.js";
|
|
2
2
|
import { FormFieldHeader } from "./FormFieldHeader.js";
|
|
3
3
|
import { FormFieldHelper } from "./FormFieldHelper.js";
|
|
4
|
+
import { c } from "react/compiler-runtime";
|
|
4
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
6
|
//#region src/components/inputs/FormField/FormField.tsx
|
|
6
|
-
var FormField = (
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
7
|
+
var FormField = (t0) => {
|
|
8
|
+
const $ = c(39);
|
|
9
|
+
const { ref, as, label, tooltipText, helperText, isRequired, rightContent, isDisabled, error, hideLabel, headerClassName, errorClassName, children, className, labelProps, isHeaderHidden, tabIndex, onMouseEnter, onFocusCapture } = t0;
|
|
10
|
+
const t1 = hideLabel || isHeaderHidden;
|
|
11
|
+
let t2;
|
|
12
|
+
if ($[0] !== headerClassName || $[1] !== helperText || $[2] !== isDisabled || $[3] !== isRequired || $[4] !== label || $[5] !== labelProps || $[6] !== rightContent || $[7] !== t1 || $[8] !== tooltipText) {
|
|
13
|
+
t2 = {
|
|
14
|
+
label,
|
|
15
|
+
tooltipText,
|
|
16
|
+
helperText,
|
|
17
|
+
isRequired,
|
|
18
|
+
rightContent,
|
|
19
|
+
isHeaderHidden: t1,
|
|
20
|
+
isDisabled,
|
|
21
|
+
className: headerClassName,
|
|
22
|
+
labelProps
|
|
23
|
+
};
|
|
24
|
+
$[0] = headerClassName;
|
|
25
|
+
$[1] = helperText;
|
|
26
|
+
$[2] = isDisabled;
|
|
27
|
+
$[3] = isRequired;
|
|
28
|
+
$[4] = label;
|
|
29
|
+
$[5] = labelProps;
|
|
30
|
+
$[6] = rightContent;
|
|
31
|
+
$[7] = t1;
|
|
32
|
+
$[8] = tooltipText;
|
|
33
|
+
$[9] = t2;
|
|
34
|
+
} else t2 = $[9];
|
|
35
|
+
const headerProps = t2;
|
|
36
|
+
let t3;
|
|
37
|
+
if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
|
|
38
|
+
t3 = ["filter", "floating"];
|
|
39
|
+
$[10] = t3;
|
|
40
|
+
} else t3 = $[10];
|
|
41
|
+
const t4 = !t3.includes(as ?? "");
|
|
42
|
+
const t5 = !!error;
|
|
43
|
+
let t6;
|
|
44
|
+
if ($[11] !== helperText || $[12] !== isDisabled || $[13] !== t4 || $[14] !== t5) {
|
|
45
|
+
t6 = {
|
|
46
|
+
helperText,
|
|
47
|
+
isDisabled,
|
|
48
|
+
isHidden: t4,
|
|
49
|
+
hasError: t5
|
|
50
|
+
};
|
|
51
|
+
$[11] = helperText;
|
|
52
|
+
$[12] = isDisabled;
|
|
53
|
+
$[13] = t4;
|
|
54
|
+
$[14] = t5;
|
|
55
|
+
$[15] = t6;
|
|
56
|
+
} else t6 = $[15];
|
|
57
|
+
const helperProps = t6;
|
|
58
|
+
let t7;
|
|
59
|
+
if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
|
|
60
|
+
t7 = ["filter", "inline"];
|
|
61
|
+
$[16] = t7;
|
|
62
|
+
} else t7 = $[16];
|
|
63
|
+
const t8 = t7.includes(as ?? "");
|
|
64
|
+
let t9;
|
|
65
|
+
if ($[17] !== error || $[18] !== errorClassName || $[19] !== isDisabled || $[20] !== t8) {
|
|
66
|
+
t9 = {
|
|
67
|
+
error,
|
|
68
|
+
isDisabled,
|
|
69
|
+
isHidden: t8,
|
|
70
|
+
className: errorClassName
|
|
71
|
+
};
|
|
72
|
+
$[17] = error;
|
|
73
|
+
$[18] = errorClassName;
|
|
74
|
+
$[19] = isDisabled;
|
|
75
|
+
$[20] = t8;
|
|
76
|
+
$[21] = t9;
|
|
77
|
+
} else t9 = $[21];
|
|
78
|
+
const errorProps = t9;
|
|
79
|
+
let t10;
|
|
80
|
+
if ($[22] !== as || $[23] !== headerProps) {
|
|
81
|
+
t10 = !["filter", "floating"].includes(as ?? "") && /* @__PURE__ */ jsx(FormFieldHeader, { ...headerProps });
|
|
82
|
+
$[22] = as;
|
|
83
|
+
$[23] = headerProps;
|
|
84
|
+
$[24] = t10;
|
|
85
|
+
} else t10 = $[24];
|
|
86
|
+
let t11;
|
|
87
|
+
if ($[25] !== helperProps) {
|
|
88
|
+
t11 = /* @__PURE__ */ jsx(FormFieldHelper, { ...helperProps });
|
|
89
|
+
$[25] = helperProps;
|
|
90
|
+
$[26] = t11;
|
|
91
|
+
} else t11 = $[26];
|
|
92
|
+
let t12;
|
|
93
|
+
if ($[27] !== errorProps) {
|
|
94
|
+
t12 = /* @__PURE__ */ jsx(FormFieldError, { ...errorProps });
|
|
95
|
+
$[27] = errorProps;
|
|
96
|
+
$[28] = t12;
|
|
97
|
+
} else t12 = $[28];
|
|
98
|
+
let t13;
|
|
99
|
+
if ($[29] !== children || $[30] !== className || $[31] !== onFocusCapture || $[32] !== onMouseEnter || $[33] !== ref || $[34] !== t10 || $[35] !== t11 || $[36] !== t12 || $[37] !== tabIndex) {
|
|
100
|
+
t13 = /* @__PURE__ */ jsxs("div", {
|
|
101
|
+
ref,
|
|
102
|
+
className,
|
|
103
|
+
tabIndex,
|
|
104
|
+
onMouseEnter,
|
|
105
|
+
onFocusCapture,
|
|
106
|
+
children: [
|
|
107
|
+
t10,
|
|
108
|
+
children,
|
|
109
|
+
t11,
|
|
110
|
+
t12
|
|
111
|
+
]
|
|
112
|
+
});
|
|
113
|
+
$[29] = children;
|
|
114
|
+
$[30] = className;
|
|
115
|
+
$[31] = onFocusCapture;
|
|
116
|
+
$[32] = onMouseEnter;
|
|
117
|
+
$[33] = ref;
|
|
118
|
+
$[34] = t10;
|
|
119
|
+
$[35] = t11;
|
|
120
|
+
$[36] = t12;
|
|
121
|
+
$[37] = tabIndex;
|
|
122
|
+
$[38] = t13;
|
|
123
|
+
} else t13 = $[38];
|
|
124
|
+
return t13;
|
|
43
125
|
};
|
|
44
126
|
//#endregion
|
|
45
127
|
export { FormField };
|
|
@@ -1,13 +1,33 @@
|
|
|
1
1
|
import { UIOverrides } from "../../../config/uiOverrides.context.js";
|
|
2
2
|
import { formFieldErrorDefinition } from "./formFieldError.cva.js";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
3
4
|
import { jsx } from "react/jsx-runtime";
|
|
4
5
|
import { clsx } from "clsx";
|
|
5
6
|
//#region src/components/inputs/FormField/FormFieldError.tsx
|
|
6
|
-
var FormFieldError = (
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
var FormFieldError = (t0) => {
|
|
8
|
+
const $ = c(7);
|
|
9
|
+
const { error, isDisabled, isHidden, className } = t0;
|
|
10
|
+
const formFieldErrorCva = UIOverrides.useCva("formField.errorLabelCva", formFieldErrorDefinition);
|
|
11
|
+
const visible = !!error && !isDisabled && !isHidden;
|
|
12
|
+
let t1;
|
|
13
|
+
if ($[0] !== className || $[1] !== formFieldErrorCva || $[2] !== visible) {
|
|
14
|
+
t1 = clsx(formFieldErrorCva({ visible }), className);
|
|
15
|
+
$[0] = className;
|
|
16
|
+
$[1] = formFieldErrorCva;
|
|
17
|
+
$[2] = visible;
|
|
18
|
+
$[3] = t1;
|
|
19
|
+
} else t1 = $[3];
|
|
20
|
+
let t2;
|
|
21
|
+
if ($[4] !== error || $[5] !== t1) {
|
|
22
|
+
t2 = /* @__PURE__ */ jsx("p", {
|
|
23
|
+
className: t1,
|
|
24
|
+
children: error
|
|
25
|
+
});
|
|
26
|
+
$[4] = error;
|
|
27
|
+
$[5] = t1;
|
|
28
|
+
$[6] = t2;
|
|
29
|
+
} else t2 = $[6];
|
|
30
|
+
return t2;
|
|
11
31
|
};
|
|
12
32
|
//#endregion
|
|
13
33
|
export { FormFieldError };
|