@povio/ui 3.1.0 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/icons/AlignCenter.js +26 -11
- package/dist/assets/icons/AlignLeft.js +26 -11
- package/dist/assets/icons/AlignLeftRight.js +26 -11
- package/dist/assets/icons/AlignRight.js +26 -11
- package/dist/assets/icons/ArrowDropDown.js +26 -11
- package/dist/assets/icons/ArrowDropUp.js +26 -11
- package/dist/assets/icons/ArrowLeft.js +26 -11
- package/dist/assets/icons/ArrowRight.js +26 -11
- package/dist/assets/icons/Bold.js +26 -11
- package/dist/assets/icons/BulletedList.js +26 -11
- package/dist/assets/icons/Calendar.js +28 -13
- package/dist/assets/icons/Check.js +28 -13
- package/dist/assets/icons/CheckCircle.js +26 -11
- package/dist/assets/icons/CheckboxCheckmark.js +29 -14
- package/dist/assets/icons/CheckboxIndeterminate.js +29 -14
- package/dist/assets/icons/ChevronDown.js +28 -13
- package/dist/assets/icons/ChevronLeft.js +28 -13
- package/dist/assets/icons/ChevronRight.js +28 -13
- package/dist/assets/icons/ChevronUp.js +28 -13
- package/dist/assets/icons/ChevronsLeft.js +28 -13
- package/dist/assets/icons/ChevronsRight.js +28 -13
- package/dist/assets/icons/Clock.js +26 -11
- package/dist/assets/icons/Close.js +26 -11
- package/dist/assets/icons/DateTime.js +35 -14
- package/dist/assets/icons/DragIndicator.js +26 -11
- package/dist/assets/icons/File.js +28 -13
- package/dist/assets/icons/Highlight.js +26 -11
- package/dist/assets/icons/HighlightOn.js +49 -15
- package/dist/assets/icons/Home.js +26 -11
- package/dist/assets/icons/Info.js +37 -16
- package/dist/assets/icons/Italic.js +26 -11
- package/dist/assets/icons/Link.js +26 -11
- package/dist/assets/icons/Menu.js +26 -11
- package/dist/assets/icons/NumberedList.js +26 -11
- package/dist/assets/icons/PointerHorizontal.js +26 -11
- package/dist/assets/icons/PointerVertical.js +26 -11
- package/dist/assets/icons/Search.js +26 -11
- package/dist/assets/icons/Send.js +28 -13
- package/dist/assets/icons/Strikethrough.js +26 -11
- package/dist/assets/icons/TextColor.js +48 -14
- package/dist/assets/icons/Today.js +26 -11
- package/dist/assets/icons/Underlined.js +28 -13
- package/dist/assets/icons/Upload.js +35 -14
- package/dist/assets/icons/Visibility.js +26 -11
- package/dist/assets/icons/VisibilityOff.js +26 -11
- package/dist/assets/icons/WarningFilled.js +28 -13
- package/dist/components/Breadcrumbs/Breadcrumbs.js +207 -56
- package/dist/components/Menu/Menu.js +18 -2
- package/dist/components/Menu/MenuDesktop.js +41 -7
- package/dist/components/Menu/MenuItem.js +32 -9
- package/dist/components/Menu/MenuMobile.js +102 -39
- package/dist/components/Menu/MenuPopover.js +105 -29
- package/dist/components/buttons/Button/button.cva.d.ts +3 -3
- package/dist/components/buttons/IconButton/IconButton.js +40 -8
- package/dist/components/buttons/InlineIconButton/InlineIconButton.d.ts +2 -1
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +34 -9
- package/dist/components/buttons/PillButton/PillButton.js +55 -17
- package/dist/components/buttons/PillButton/pillButton.cva.d.ts +1 -1
- package/dist/components/buttons/SplitButton/SplitButton.js +103 -18
- package/dist/components/buttons/TextButton/TextButton.js +30 -8
- package/dist/components/buttons/ToggleButton/ToggleButton.js +28 -8
- package/dist/components/buttons/shared/ButtonContent.js +80 -22
- package/dist/components/inputs/Checkbox/Checkbox.d.ts +1 -0
- package/dist/components/inputs/Checkbox/Checkbox.js +201 -35
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +24 -10
- package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +3 -0
- package/dist/components/inputs/Checkbox/checkbox.cva.js +2 -1
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +12 -5
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +380 -75
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +12 -5
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +499 -186
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +14 -5
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +280 -46
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +7 -3
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +616 -121
- package/dist/components/inputs/DateTime/shared/Calendar.d.ts +5 -2
- package/dist/components/inputs/DateTime/shared/Calendar.js +342 -119
- package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +4 -2
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +310 -103
- package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +4 -2
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +150 -33
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +233 -98
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +318 -137
- package/dist/components/inputs/DateTime/shared/DateField.d.ts +2 -1
- package/dist/components/inputs/DateTime/shared/DateField.js +288 -112
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +14 -3
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +359 -129
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +18 -1
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +104 -11
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +83 -28
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +59 -10
- package/dist/components/inputs/DateTime/shared/MonthPicker.js +103 -58
- package/dist/components/inputs/DateTime/shared/RangeCalendar.js +193 -82
- package/dist/components/inputs/DateTime/shared/TimeField.js +27 -8
- package/dist/components/inputs/DateTime/shared/TimePickerForm.js +279 -110
- package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +4 -1
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +211 -65
- package/dist/components/inputs/DateTime/shared/YearPicker.js +119 -68
- package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +5 -0
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +16 -0
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +16 -0
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +15 -0
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +32 -0
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.d.ts +2 -0
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.spec.d.ts +1 -0
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +41 -0
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +99 -0
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.spec.d.ts +1 -0
- package/dist/components/inputs/File/FileUpload.js +91 -46
- package/dist/components/inputs/File/FileUploadContainer.js +15 -7
- package/dist/components/inputs/File/InputUpload.js +317 -79
- package/dist/components/inputs/File/index.d.ts +1 -1
- package/dist/components/inputs/File/shared/FileCard.js +104 -41
- package/dist/components/inputs/File/shared/FileCardList.js +47 -12
- package/dist/components/inputs/File/shared/FileUploadContent.js +175 -44
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +149 -46
- package/dist/components/inputs/File/shared/FileUploadContentError.js +234 -93
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +230 -97
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +199 -55
- package/dist/components/inputs/File/shared/InputUploadContent.js +148 -34
- package/dist/components/inputs/File/shared/InputUploadFilled.js +49 -8
- package/dist/components/inputs/File/shared/ProgressBar.js +102 -15
- package/dist/components/inputs/File/shared/fileUpload.cva.d.ts +0 -11
- package/dist/components/inputs/File/shared/fileUpload.cva.js +1 -18
- package/dist/components/inputs/FormField/FormField.d.ts +3 -3
- package/dist/components/inputs/FormField/FormField.js +119 -37
- package/dist/components/inputs/FormField/FormFieldError.js +25 -5
- package/dist/components/inputs/FormField/FormFieldHeader.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldHeader.js +81 -22
- package/dist/components/inputs/FormField/FormFieldHeaderClose.js +31 -7
- package/dist/components/inputs/FormField/FormFieldHelper.js +26 -6
- package/dist/components/inputs/FormField/FormFieldLabel.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldLabel.js +40 -9
- package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +13 -0
- package/dist/components/inputs/FormField/formFieldHeader.cva.js +14 -0
- package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +5 -2
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +446 -97
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.d.ts +45 -0
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +571 -0
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +35 -0
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +574 -0
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +48 -9
- package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +8 -0
- package/dist/components/inputs/Input/TextArea/TextArea.cva.js +5 -0
- package/dist/components/inputs/Input/TextArea/TextArea.js +305 -90
- package/dist/components/inputs/Input/TextInput/TextInput.d.ts +3 -1
- package/dist/components/inputs/Input/TextInput/TextInput.js +429 -90
- package/dist/components/inputs/Input/shared/InputContent.js +193 -59
- package/dist/components/inputs/Input/shared/numberStatic.utils.d.ts +1 -0
- package/dist/components/inputs/Input/shared/numberStatic.utils.js +7 -0
- package/dist/components/inputs/Inputs/Form.js +40 -11
- package/dist/components/inputs/Inputs/InputItem.d.ts +15 -21
- package/dist/components/inputs/Inputs/InputItem.js +69 -14
- package/dist/components/inputs/Inputs/Inputs.js +37 -11
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +3 -1
- package/dist/components/inputs/RadioGroup/RadioGroup.js +353 -61
- package/dist/components/inputs/RadioGroup/radio.cva.d.ts +45 -0
- package/dist/components/inputs/RadioGroup/radio.cva.js +48 -1
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +6 -2
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +217 -22
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +3 -18
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +107 -8
- package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +37 -0
- package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +14 -0
- package/dist/components/inputs/Selection/Select/QuerySelect.js +178 -0
- package/dist/components/inputs/Selection/Select/Select.d.ts +7 -3
- package/dist/components/inputs/Selection/Select/Select.js +227 -18
- package/dist/components/inputs/Selection/shared/SelectBase.d.ts +8 -1
- package/dist/components/inputs/Selection/shared/SelectBase.js +69 -18
- package/dist/components/inputs/Selection/shared/SelectDesktop.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +393 -138
- package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectInput.js +397 -116
- package/dist/components/inputs/Selection/shared/SelectInputTags.js +99 -25
- package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectListBox.js +164 -52
- package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +85 -35
- package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +69 -16
- package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +70 -21
- package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +58 -9
- package/dist/components/inputs/Selection/shared/SelectMobile.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectMobile.js +9 -3
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +9 -0
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +47 -0
- package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +14 -0
- package/dist/components/inputs/Selection/shared/querySelect.utils.js +43 -0
- package/dist/components/inputs/Selection/shared/select.context.d.ts +3 -2
- package/dist/components/inputs/Selection/shared/select.context.js +67 -36
- package/dist/components/inputs/Selection/shared/select.types.d.ts +3 -2
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +6 -0
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +5 -0
- package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +12 -0
- package/dist/components/inputs/Selection/shared/selectInput.cva.js +8 -0
- package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +23 -0
- package/dist/components/inputs/Selection/shared/staticSelect.utils.js +54 -0
- package/dist/components/inputs/Selection/shared/staticSelect.utils.spec.d.ts +1 -0
- package/dist/components/inputs/Selection/shared/useSelectItems.js +109 -49
- package/dist/components/inputs/Skeleton/InputFrame.d.ts +83 -0
- package/dist/components/inputs/Skeleton/InputFrame.js +612 -0
- package/dist/components/inputs/Slider/Slider.d.ts +2 -1
- package/dist/components/inputs/Slider/Slider.js +265 -76
- package/dist/components/inputs/TextEditor/TextEditor.d.ts +1 -0
- package/dist/components/inputs/TextEditor/TextEditor.js +447 -98
- package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +37 -11
- package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +102 -30
- package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +194 -45
- package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +88 -28
- package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +48 -14
- package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +66 -19
- package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +49 -15
- package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +92 -32
- package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +126 -54
- package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +141 -38
- package/dist/components/inputs/Toggle/Toggle.d.ts +1 -0
- package/dist/components/inputs/Toggle/Toggle.js +214 -37
- package/dist/components/inputs/Toggle/toggle.cva.d.ts +3 -0
- package/dist/components/inputs/Toggle/toggle.cva.js +2 -1
- package/dist/components/inputs/shared/CheckContent.d.ts +2 -1
- package/dist/components/inputs/shared/CheckContent.js +21 -11
- package/dist/components/inputs/shared/InputClear.d.ts +2 -1
- package/dist/components/inputs/shared/InputClear.js +88 -12
- package/dist/components/inputs/shared/TooltipWrapper.js +50 -11
- package/dist/components/inputs/shared/input.cva.d.ts +28 -0
- package/dist/components/inputs/shared/input.cva.js +38 -4
- package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +8 -0
- package/dist/components/inputs/shared/tooltipWrapper.cva.js +5 -0
- package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +15 -0
- package/dist/components/inputs/shared/useStaticInputHandoff.js +112 -0
- package/dist/components/navigation/Accordion/Accordion.js +69 -22
- package/dist/components/navigation/Accordion/AccordionItem.js +86 -41
- package/dist/components/navigation/Stepper/Stepper.js +67 -22
- package/dist/components/navigation/Stepper/StepperItem.js +104 -31
- package/dist/components/navigation/Stepper/StepperSeparator.js +23 -5
- package/dist/components/overlays/ActionModal/ActionModal.js +169 -35
- package/dist/components/overlays/BottomSheet/BottomSheet.js +96 -23
- package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +48 -8
- package/dist/components/overlays/Drawer/Drawer.js +62 -20
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +85 -28
- package/dist/components/overlays/Tooltip/Tooltip.js +137 -28
- package/dist/components/overlays/Tooltip/TooltipEllipsis.js +37 -12
- package/dist/components/segment/Segment.js +218 -57
- package/dist/components/segment/SegmentItem.js +67 -10
- package/dist/components/shared/pagination/Pagination.js +108 -22
- package/dist/components/shared/pagination/PaginationList.js +167 -64
- package/dist/components/shared/pagination/minWidth.cva.d.ts +1 -1
- package/dist/components/status/Alert/Alert.js +97 -30
- package/dist/components/status/Loader/Loader.js +77 -22
- package/dist/components/status/Toast/Toast.js +28 -14
- package/dist/components/status/Toast/toast.cva.d.ts +1 -1
- package/dist/components/status/Toast/useToast.js +62 -57
- package/dist/components/table/ColumnConfig.js +158 -54
- package/dist/components/table/InfiniteTable.js +67 -16
- package/dist/components/table/PaginatedTable.js +84 -18
- package/dist/components/table/Table.js +28 -27
- package/dist/components/text/Link/Link.js +19 -7
- package/dist/components/text/Typography/Typography.js +23 -8
- package/dist/config/confirmation.context.js +1 -1
- package/dist/config/link.context.js +23 -9
- package/dist/config/router.context.js +42 -16
- package/dist/config/theme.context.js +98 -45
- package/dist/config/uiConfig.context.d.ts +20 -6
- package/dist/config/uiConfig.context.js +68 -14
- package/dist/config/uiOverrides.context.d.ts +30 -11
- package/dist/config/uiOverrides.context.js +54 -14
- package/dist/helpers/dynamicInputs.d.ts +12 -9
- package/dist/helpers/dynamicInputs.js +13 -8
- package/dist/hooks/useAutosave.d.ts +2 -1
- package/dist/hooks/useAutosave.js +12 -4
- package/dist/hooks/useAutosave.spec.d.ts +1 -0
- package/dist/hooks/useBreakpoint.js +16 -3
- package/dist/hooks/useDebounceCallback.js +51 -17
- package/dist/hooks/useFilters.js +125 -64
- package/dist/hooks/useForm.js +42 -8
- package/dist/hooks/useFormAutosave.d.ts +3 -1
- package/dist/hooks/useFormAutosave.js +122 -30
- package/dist/hooks/useFormAutosave.spec.d.ts +1 -0
- package/dist/hooks/useIntersectionObserver.d.ts +1 -1
- package/dist/hooks/useIntersectionObserver.js +91 -24
- package/dist/hooks/useKeyInteractions.d.ts +20 -0
- package/dist/hooks/useKeyInteractions.js +54 -0
- package/dist/hooks/useKeyInteractions.spec.d.ts +1 -0
- package/dist/hooks/useLocalStorage.js +43 -10
- package/dist/hooks/useLongPressRepeat.js +55 -20
- package/dist/hooks/usePagination.js +49 -19
- package/dist/hooks/useQueryAutocomplete.d.ts +14 -0
- package/dist/hooks/useQueryAutocomplete.js +72 -0
- package/dist/hooks/useScrollableListBox.js +37 -16
- package/dist/hooks/useSorting.js +69 -28
- package/dist/hooks/useStateAndRef.js +21 -7
- package/dist/hooks/useTableColumnConfig.js +124 -31
- package/dist/hooks/useTranslationMemo.js +25 -5
- package/dist/index.d.ts +18 -3
- package/dist/index.js +15 -5
- package/dist/tw-ui-plugin.js +6 -0
- package/dist/utils/date-time.utils.d.ts +38 -10
- package/dist/utils/date-time.utils.js +136 -22
- package/dist/utils/query.utils.d.ts +4 -0
- package/dist/utils/query.utils.js +8 -0
- package/dist/utils/zod.utils.d.ts +2 -0
- package/dist/utils/zod.utils.js +5 -0
- package/package.json +2 -2
|
@@ -1,54 +1,157 @@
|
|
|
1
1
|
import { Typography } from "../../../text/Typography/Typography.js";
|
|
2
2
|
import "../../../../config/i18n.js";
|
|
3
3
|
import { Select } from "../../Selection/Select/Select.js";
|
|
4
|
+
import { c } from "react/compiler-runtime";
|
|
4
5
|
import { jsx } from "react/jsx-runtime";
|
|
5
6
|
import { useTranslation } from "react-i18next";
|
|
6
7
|
//#region src/components/inputs/TextEditor/Toolbar/TextStyleSelect.tsx
|
|
7
|
-
var TextStyleSelect = (
|
|
8
|
+
var TextStyleSelect = (t0) => {
|
|
9
|
+
const $0 = c(35);
|
|
10
|
+
const { editor } = t0;
|
|
8
11
|
const { t } = useTranslation("ui");
|
|
9
|
-
if (!!!editor.extensionManager.extensions.find(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
if (!!!editor.extensionManager.extensions.find(_temp)) return null;
|
|
13
|
+
let t1;
|
|
14
|
+
if ($0[0] !== t) {
|
|
15
|
+
t1 = (level) => ({
|
|
12
16
|
id: level,
|
|
13
17
|
label: t(($) => $.ui.textEditor.textStyle[`heading${level}`]),
|
|
14
18
|
content: /* @__PURE__ */ jsx(Typography, {
|
|
15
19
|
size: `title-${level}`,
|
|
16
|
-
children: t(($) =>
|
|
20
|
+
children: t(($_0) => $_0.ui.textEditor.textStyle[`heading${level}`])
|
|
17
21
|
})
|
|
22
|
+
});
|
|
23
|
+
$0[0] = t;
|
|
24
|
+
$0[1] = t1;
|
|
25
|
+
} else t1 = $0[1];
|
|
26
|
+
const getItem = t1;
|
|
27
|
+
let t2;
|
|
28
|
+
if ($0[2] !== editor) {
|
|
29
|
+
t2 = (val) => {
|
|
30
|
+
if (!val) {
|
|
31
|
+
const currentLevel = editor.getAttributes("heading")?.level;
|
|
32
|
+
if (!currentLevel) return;
|
|
33
|
+
editor.chain().focus().toggleHeading({ level: currentLevel }).run();
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (!editor.can().setHeading({ level: val })) return;
|
|
37
|
+
editor.chain().focus().setHeading({ level: val }).run();
|
|
18
38
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
]
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
39
|
+
$0[2] = editor;
|
|
40
|
+
$0[3] = t2;
|
|
41
|
+
} else t2 = $0[3];
|
|
42
|
+
const onChange = t2;
|
|
43
|
+
let t3;
|
|
44
|
+
if ($0[4] !== t) {
|
|
45
|
+
t3 = t(_temp2);
|
|
46
|
+
$0[4] = t;
|
|
47
|
+
$0[5] = t3;
|
|
48
|
+
} else t3 = $0[5];
|
|
49
|
+
let t4;
|
|
50
|
+
if ($0[6] !== t) {
|
|
51
|
+
t4 = t(_temp3);
|
|
52
|
+
$0[6] = t;
|
|
53
|
+
$0[7] = t4;
|
|
54
|
+
} else t4 = $0[7];
|
|
55
|
+
let t5;
|
|
56
|
+
if ($0[8] !== t) {
|
|
57
|
+
t5 = t(_temp4);
|
|
58
|
+
$0[8] = t;
|
|
59
|
+
$0[9] = t5;
|
|
60
|
+
} else t5 = $0[9];
|
|
61
|
+
let t6;
|
|
62
|
+
if ($0[10] !== t5) {
|
|
63
|
+
t6 = {
|
|
64
|
+
id: 0,
|
|
65
|
+
label: t5
|
|
66
|
+
};
|
|
67
|
+
$0[10] = t5;
|
|
68
|
+
$0[11] = t6;
|
|
69
|
+
} else t6 = $0[11];
|
|
70
|
+
let t10;
|
|
71
|
+
let t11;
|
|
72
|
+
let t12;
|
|
73
|
+
let t7;
|
|
74
|
+
let t8;
|
|
75
|
+
let t9;
|
|
76
|
+
if ($0[12] !== editor || $0[13] !== getItem) {
|
|
77
|
+
t7 = editor.can().toggleHeading({ level: 1 }) ? [getItem(1)] : [];
|
|
78
|
+
t8 = editor.can().toggleHeading({ level: 2 }) ? [getItem(2)] : [];
|
|
79
|
+
t9 = editor.can().toggleHeading({ level: 3 }) ? [getItem(3)] : [];
|
|
80
|
+
t10 = editor.can().toggleHeading({ level: 4 }) ? [getItem(4)] : [];
|
|
81
|
+
t11 = editor.can().toggleHeading({ level: 5 }) ? [getItem(5)] : [];
|
|
82
|
+
t12 = editor.can().toggleHeading({ level: 6 }) ? [getItem(6)] : [];
|
|
83
|
+
$0[12] = editor;
|
|
84
|
+
$0[13] = getItem;
|
|
85
|
+
$0[14] = t10;
|
|
86
|
+
$0[15] = t11;
|
|
87
|
+
$0[16] = t12;
|
|
88
|
+
$0[17] = t7;
|
|
89
|
+
$0[18] = t8;
|
|
90
|
+
$0[19] = t9;
|
|
91
|
+
} else {
|
|
92
|
+
t10 = $0[14];
|
|
93
|
+
t11 = $0[15];
|
|
94
|
+
t12 = $0[16];
|
|
95
|
+
t7 = $0[17];
|
|
96
|
+
t8 = $0[18];
|
|
97
|
+
t9 = $0[19];
|
|
98
|
+
}
|
|
99
|
+
let t13;
|
|
100
|
+
if ($0[20] !== t10 || $0[21] !== t11 || $0[22] !== t12 || $0[23] !== t6 || $0[24] !== t7 || $0[25] !== t8 || $0[26] !== t9) {
|
|
101
|
+
t13 = [
|
|
102
|
+
t6,
|
|
103
|
+
...t7,
|
|
104
|
+
...t8,
|
|
105
|
+
...t9,
|
|
106
|
+
...t10,
|
|
107
|
+
...t11,
|
|
108
|
+
...t12
|
|
109
|
+
];
|
|
110
|
+
$0[20] = t10;
|
|
111
|
+
$0[21] = t11;
|
|
112
|
+
$0[22] = t12;
|
|
113
|
+
$0[23] = t6;
|
|
114
|
+
$0[24] = t7;
|
|
115
|
+
$0[25] = t8;
|
|
116
|
+
$0[26] = t9;
|
|
117
|
+
$0[27] = t13;
|
|
118
|
+
} else t13 = $0[27];
|
|
119
|
+
const t14 = editor.getAttributes("heading")?.level || 0;
|
|
120
|
+
const t15 = !editor.isEditable;
|
|
121
|
+
let t16;
|
|
122
|
+
if ($0[28] !== onChange || $0[29] !== t13 || $0[30] !== t14 || $0[31] !== t15 || $0[32] !== t3 || $0[33] !== t4) {
|
|
123
|
+
t16 = /* @__PURE__ */ jsx(Select, {
|
|
124
|
+
as: "inline",
|
|
125
|
+
placeholder: t3,
|
|
126
|
+
label: t4,
|
|
127
|
+
hideLabel: true,
|
|
128
|
+
ignoreTriggerWidth: true,
|
|
129
|
+
onChange,
|
|
130
|
+
items: t13,
|
|
131
|
+
value: t14,
|
|
132
|
+
isDisabled: t15
|
|
133
|
+
});
|
|
134
|
+
$0[28] = onChange;
|
|
135
|
+
$0[29] = t13;
|
|
136
|
+
$0[30] = t14;
|
|
137
|
+
$0[31] = t15;
|
|
138
|
+
$0[32] = t3;
|
|
139
|
+
$0[33] = t4;
|
|
140
|
+
$0[34] = t16;
|
|
141
|
+
} else t16 = $0[34];
|
|
142
|
+
return t16;
|
|
52
143
|
};
|
|
144
|
+
function _temp(extension) {
|
|
145
|
+
return extension.name === "heading";
|
|
146
|
+
}
|
|
147
|
+
function _temp2($_1) {
|
|
148
|
+
return $_1.ui.textEditor.textStyle.label;
|
|
149
|
+
}
|
|
150
|
+
function _temp3($_2) {
|
|
151
|
+
return $_2.ui.textEditor.textStyle.label;
|
|
152
|
+
}
|
|
153
|
+
function _temp4($_3) {
|
|
154
|
+
return $_3.ui.textEditor.textStyle.normal;
|
|
155
|
+
}
|
|
53
156
|
//#endregion
|
|
54
157
|
export { TextStyleSelect };
|
|
@@ -9,6 +9,7 @@ interface ToggleBaseProps extends FormFieldErrorProps, ToggleVariantProps, Omit<
|
|
|
9
9
|
children?: string;
|
|
10
10
|
isDirty?: boolean;
|
|
11
11
|
isRequired?: boolean;
|
|
12
|
+
fireBlurOnChange?: boolean;
|
|
12
13
|
}
|
|
13
14
|
export type ToggleProps = ToggleBaseProps;
|
|
14
15
|
export type ControlledToggleProps<TFieldValues extends FieldValues> = ControlProps<ToggleProps, TFieldValues, "isSelected">;
|
|
@@ -2,7 +2,8 @@ import { UIOverrides } from "../../../config/uiOverrides.context.js";
|
|
|
2
2
|
import { UIConfig } from "../../../config/uiConfig.context.js";
|
|
3
3
|
import { FormFieldError } from "../FormField/FormFieldError.js";
|
|
4
4
|
import { CheckContent } from "../shared/CheckContent.js";
|
|
5
|
-
import { toggleDefinition, toggleTypography } from "./toggle.cva.js";
|
|
5
|
+
import { toggleContentClassName, toggleDefinition, toggleTypography } from "./toggle.cva.js";
|
|
6
|
+
import { c } from "react/compiler-runtime";
|
|
6
7
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
8
|
import { clsx } from "clsx";
|
|
8
9
|
import { Switch } from "react-aria-components";
|
|
@@ -10,52 +11,228 @@ import { mergeRefs } from "@react-aria/utils";
|
|
|
10
11
|
import { Controller } from "react-hook-form";
|
|
11
12
|
//#region src/components/inputs/Toggle/Toggle.tsx
|
|
12
13
|
var ToggleBase = (props) => {
|
|
14
|
+
const $ = c(50);
|
|
13
15
|
const ui = UIConfig.useConfig();
|
|
14
16
|
const toggleCva = UIOverrides.useCva("toggle.cva", toggleDefinition);
|
|
15
17
|
const toggleTypographyMap = UIOverrides.useMapper("toggle.typography", toggleTypography);
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
const toggleContentClassNameMap = UIOverrides.useMapper("toggle.contentClassName", toggleContentClassName);
|
|
19
|
+
let T0;
|
|
20
|
+
let T1;
|
|
21
|
+
let children;
|
|
22
|
+
let formFieldErrorProps;
|
|
23
|
+
let t0;
|
|
24
|
+
let t1;
|
|
25
|
+
let t2;
|
|
26
|
+
let t3;
|
|
27
|
+
let t4;
|
|
28
|
+
let t5;
|
|
29
|
+
let t6;
|
|
30
|
+
let t7;
|
|
31
|
+
let t8;
|
|
32
|
+
let t9;
|
|
33
|
+
if ($[0] !== props || $[1] !== toggleContentClassNameMap || $[2] !== toggleCva || $[3] !== toggleTypographyMap || $[4] !== ui) {
|
|
34
|
+
const { className, children: t10, isDisabled, error, variant: variantProp, fireBlurOnChange: fireBlurOnChangeProp, onChange, onBlur, ...rest } = props;
|
|
35
|
+
children = t10;
|
|
36
|
+
const variant = variantProp ?? ui.toggle.variant;
|
|
37
|
+
const fireBlurOnChange = fireBlurOnChangeProp ?? ui.toggle.fireBlurOnChange;
|
|
38
|
+
let t11;
|
|
39
|
+
if ($[19] !== error || $[20] !== isDisabled) {
|
|
40
|
+
t11 = {
|
|
41
|
+
error,
|
|
42
|
+
isDisabled
|
|
43
|
+
};
|
|
44
|
+
$[19] = error;
|
|
45
|
+
$[20] = isDisabled;
|
|
46
|
+
$[21] = t11;
|
|
47
|
+
} else t11 = $[21];
|
|
48
|
+
formFieldErrorProps = t11;
|
|
49
|
+
let t12;
|
|
50
|
+
if ($[22] !== fireBlurOnChange || $[23] !== onBlur || $[24] !== onChange) {
|
|
51
|
+
t12 = (isSelected) => {
|
|
52
|
+
onChange?.(isSelected);
|
|
53
|
+
if (fireBlurOnChange) onBlur?.({});
|
|
54
|
+
};
|
|
55
|
+
$[22] = fireBlurOnChange;
|
|
56
|
+
$[23] = onBlur;
|
|
57
|
+
$[24] = onChange;
|
|
58
|
+
$[25] = t12;
|
|
59
|
+
} else t12 = $[25];
|
|
60
|
+
const handleChange = t12;
|
|
61
|
+
T1 = Switch;
|
|
62
|
+
t2 = rest;
|
|
63
|
+
t3 = props.isDirty || void 0;
|
|
64
|
+
t4 = props.isRequired || void 0;
|
|
65
|
+
t5 = isDisabled;
|
|
66
|
+
t6 = handleChange;
|
|
67
|
+
t7 = onBlur;
|
|
68
|
+
const t13 = !isDisabled && "cursor-pointer";
|
|
69
|
+
if ($[26] !== className || $[27] !== t13) {
|
|
70
|
+
t8 = clsx("group flex items-center gap-2", t13, className);
|
|
71
|
+
$[26] = className;
|
|
72
|
+
$[27] = t13;
|
|
73
|
+
$[28] = t8;
|
|
74
|
+
} else t8 = $[28];
|
|
75
|
+
t9 = /* @__PURE__ */ jsx("div", { className: toggleCva({
|
|
28
76
|
variant,
|
|
29
77
|
...rest
|
|
30
|
-
}) })
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
78
|
+
}) });
|
|
79
|
+
T0 = CheckContent;
|
|
80
|
+
t0 = toggleTypographyMap({
|
|
81
|
+
variant,
|
|
82
|
+
...rest
|
|
83
|
+
});
|
|
84
|
+
t1 = toggleContentClassNameMap({
|
|
85
|
+
variant,
|
|
86
|
+
...rest
|
|
87
|
+
});
|
|
88
|
+
$[0] = props;
|
|
89
|
+
$[1] = toggleContentClassNameMap;
|
|
90
|
+
$[2] = toggleCva;
|
|
91
|
+
$[3] = toggleTypographyMap;
|
|
92
|
+
$[4] = ui;
|
|
93
|
+
$[5] = T0;
|
|
94
|
+
$[6] = T1;
|
|
95
|
+
$[7] = children;
|
|
96
|
+
$[8] = formFieldErrorProps;
|
|
97
|
+
$[9] = t0;
|
|
98
|
+
$[10] = t1;
|
|
99
|
+
$[11] = t2;
|
|
100
|
+
$[12] = t3;
|
|
101
|
+
$[13] = t4;
|
|
102
|
+
$[14] = t5;
|
|
103
|
+
$[15] = t6;
|
|
104
|
+
$[16] = t7;
|
|
105
|
+
$[17] = t8;
|
|
106
|
+
$[18] = t9;
|
|
107
|
+
} else {
|
|
108
|
+
T0 = $[5];
|
|
109
|
+
T1 = $[6];
|
|
110
|
+
children = $[7];
|
|
111
|
+
formFieldErrorProps = $[8];
|
|
112
|
+
t0 = $[9];
|
|
113
|
+
t1 = $[10];
|
|
114
|
+
t2 = $[11];
|
|
115
|
+
t3 = $[12];
|
|
116
|
+
t4 = $[13];
|
|
117
|
+
t5 = $[14];
|
|
118
|
+
t6 = $[15];
|
|
119
|
+
t7 = $[16];
|
|
120
|
+
t8 = $[17];
|
|
121
|
+
t9 = $[18];
|
|
122
|
+
}
|
|
123
|
+
let t10;
|
|
124
|
+
if ($[29] !== T0 || $[30] !== children || $[31] !== t0 || $[32] !== t1) {
|
|
125
|
+
t10 = /* @__PURE__ */ jsx(T0, {
|
|
126
|
+
typography: t0,
|
|
127
|
+
contentClassName: t1,
|
|
35
128
|
children
|
|
36
|
-
})
|
|
37
|
-
|
|
129
|
+
});
|
|
130
|
+
$[29] = T0;
|
|
131
|
+
$[30] = children;
|
|
132
|
+
$[31] = t0;
|
|
133
|
+
$[32] = t1;
|
|
134
|
+
$[33] = t10;
|
|
135
|
+
} else t10 = $[33];
|
|
136
|
+
let t11;
|
|
137
|
+
if ($[34] !== T1 || $[35] !== t10 || $[36] !== t2 || $[37] !== t3 || $[38] !== t4 || $[39] !== t5 || $[40] !== t6 || $[41] !== t7 || $[42] !== t8 || $[43] !== t9) {
|
|
138
|
+
t11 = /* @__PURE__ */ jsxs(T1, {
|
|
139
|
+
...t2,
|
|
140
|
+
"data-is-dirty": t3,
|
|
141
|
+
"data-is-required": t4,
|
|
142
|
+
isDisabled: t5,
|
|
143
|
+
onChange: t6,
|
|
144
|
+
onBlur: t7,
|
|
145
|
+
className: t8,
|
|
146
|
+
children: [t9, t10]
|
|
147
|
+
});
|
|
148
|
+
$[34] = T1;
|
|
149
|
+
$[35] = t10;
|
|
150
|
+
$[36] = t2;
|
|
151
|
+
$[37] = t3;
|
|
152
|
+
$[38] = t4;
|
|
153
|
+
$[39] = t5;
|
|
154
|
+
$[40] = t6;
|
|
155
|
+
$[41] = t7;
|
|
156
|
+
$[42] = t8;
|
|
157
|
+
$[43] = t9;
|
|
158
|
+
$[44] = t11;
|
|
159
|
+
} else t11 = $[44];
|
|
160
|
+
let t12;
|
|
161
|
+
if ($[45] !== formFieldErrorProps) {
|
|
162
|
+
t12 = /* @__PURE__ */ jsx(FormFieldError, { ...formFieldErrorProps });
|
|
163
|
+
$[45] = formFieldErrorProps;
|
|
164
|
+
$[46] = t12;
|
|
165
|
+
} else t12 = $[46];
|
|
166
|
+
let t13;
|
|
167
|
+
if ($[47] !== t11 || $[48] !== t12) {
|
|
168
|
+
t13 = /* @__PURE__ */ jsxs(Fragment, { children: [t11, t12] });
|
|
169
|
+
$[47] = t11;
|
|
170
|
+
$[48] = t12;
|
|
171
|
+
$[49] = t13;
|
|
172
|
+
} else t13 = $[49];
|
|
173
|
+
return t13;
|
|
38
174
|
};
|
|
39
175
|
var Toggle = (props) => {
|
|
176
|
+
const $ = c(15);
|
|
40
177
|
if ("formControl" in props && props.formControl) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
178
|
+
let formControl;
|
|
179
|
+
let innerProps;
|
|
180
|
+
let ref;
|
|
181
|
+
if ($[0] !== props) {
|
|
182
|
+
({formControl, ref, ...innerProps} = props);
|
|
183
|
+
$[0] = props;
|
|
184
|
+
$[1] = formControl;
|
|
185
|
+
$[2] = innerProps;
|
|
186
|
+
$[3] = ref;
|
|
187
|
+
} else {
|
|
188
|
+
formControl = $[1];
|
|
189
|
+
innerProps = $[2];
|
|
190
|
+
ref = $[3];
|
|
191
|
+
}
|
|
192
|
+
let t0;
|
|
193
|
+
if ($[4] !== innerProps || $[5] !== props.error || $[6] !== props.isDisabled || $[7] !== ref) {
|
|
194
|
+
t0 = (t1) => {
|
|
195
|
+
const { field, fieldState: t2 } = t1;
|
|
196
|
+
const { error, isDirty } = t2;
|
|
197
|
+
return /* @__PURE__ */ jsx(ToggleBase, {
|
|
198
|
+
...innerProps,
|
|
199
|
+
ref: mergeRefs(ref, field.ref),
|
|
200
|
+
isSelected: field.value,
|
|
201
|
+
onChange: field.onChange,
|
|
202
|
+
onBlur: field.onBlur,
|
|
203
|
+
name: field.name,
|
|
204
|
+
isDirty,
|
|
205
|
+
isDisabled: field.disabled || props.isDisabled,
|
|
206
|
+
error: props.error ?? error?.message
|
|
207
|
+
});
|
|
208
|
+
};
|
|
209
|
+
$[4] = innerProps;
|
|
210
|
+
$[5] = props.error;
|
|
211
|
+
$[6] = props.isDisabled;
|
|
212
|
+
$[7] = ref;
|
|
213
|
+
$[8] = t0;
|
|
214
|
+
} else t0 = $[8];
|
|
215
|
+
let t1;
|
|
216
|
+
if ($[9] !== formControl.control || $[10] !== formControl.name || $[11] !== t0) {
|
|
217
|
+
t1 = /* @__PURE__ */ jsx(Controller, {
|
|
218
|
+
control: formControl.control,
|
|
219
|
+
name: formControl.name,
|
|
220
|
+
render: t0
|
|
221
|
+
});
|
|
222
|
+
$[9] = formControl.control;
|
|
223
|
+
$[10] = formControl.name;
|
|
224
|
+
$[11] = t0;
|
|
225
|
+
$[12] = t1;
|
|
226
|
+
} else t1 = $[12];
|
|
227
|
+
return t1;
|
|
57
228
|
}
|
|
58
|
-
|
|
229
|
+
let t0;
|
|
230
|
+
if ($[13] !== props) {
|
|
231
|
+
t0 = /* @__PURE__ */ jsx(ToggleBase, { ...props });
|
|
232
|
+
$[13] = props;
|
|
233
|
+
$[14] = t0;
|
|
234
|
+
} else t0 = $[14];
|
|
235
|
+
return t0;
|
|
59
236
|
};
|
|
60
237
|
//#endregion
|
|
61
238
|
export { Toggle };
|
|
@@ -14,3 +14,6 @@ export interface ToggleVariantProps extends UIOverrides.VariantProps<ToggleConfi
|
|
|
14
14
|
export declare const toggleTypography: (props: {
|
|
15
15
|
readonly variant?: "default" | null | undefined;
|
|
16
16
|
}) => TypographyVariantProps | undefined;
|
|
17
|
+
export declare const toggleContentClassName: (props: {
|
|
18
|
+
readonly variant?: "default" | null | undefined;
|
|
19
|
+
}) => string | undefined;
|
|
@@ -30,5 +30,6 @@ var toggleTypography = compoundMapper({ default: {
|
|
|
30
30
|
sizeMobile: "label-1",
|
|
31
31
|
variant: "default"
|
|
32
32
|
} });
|
|
33
|
+
var toggleContentClassName = compoundMapper({ default: "text-text-default-2" });
|
|
33
34
|
//#endregion
|
|
34
|
-
export { toggleDefinition, toggleTypography };
|
|
35
|
+
export { toggleContentClassName, toggleDefinition, toggleTypography };
|
|
@@ -3,6 +3,7 @@ import { TypographyVariantProps } from '../../text/Typography/typography.cva';
|
|
|
3
3
|
interface CheckContentProps {
|
|
4
4
|
typography?: TypographyVariantProps;
|
|
5
5
|
className?: string;
|
|
6
|
+
contentClassName?: string;
|
|
6
7
|
}
|
|
7
|
-
export declare const CheckContent: ({ children, className, ...props }: PropsWithChildren<CheckContentProps>) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const CheckContent: ({ children, className, contentClassName, ...props }: PropsWithChildren<CheckContentProps>) => import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
export {};
|
|
@@ -1,19 +1,29 @@
|
|
|
1
1
|
import { UIOverrides } from "../../../config/uiOverrides.context.js";
|
|
2
2
|
import { typographyDefinition } from "../../text/Typography/typography.cva.js";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
3
4
|
import { jsx } from "react/jsx-runtime";
|
|
4
5
|
import clsx$1 from "clsx";
|
|
5
6
|
//#region src/components/inputs/shared/CheckContent.tsx
|
|
6
|
-
var CheckContent = (
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
var CheckContent = (t0) => {
|
|
8
|
+
const $ = c(3);
|
|
9
|
+
const { children, className, contentClassName, ...props } = t0;
|
|
10
|
+
const t1 = clsx$1(UIOverrides.useCva("typography.cva", typographyDefinition)({
|
|
11
|
+
size: "label-1",
|
|
12
|
+
sizeMobile: "label-1",
|
|
13
|
+
variant: "default",
|
|
14
|
+
...props.typography
|
|
15
|
+
}), contentClassName, className);
|
|
16
|
+
let t2;
|
|
17
|
+
if ($[0] !== children || $[1] !== t1) {
|
|
18
|
+
t2 = /* @__PURE__ */ jsx("div", {
|
|
19
|
+
className: t1,
|
|
20
|
+
children
|
|
21
|
+
});
|
|
22
|
+
$[0] = children;
|
|
23
|
+
$[1] = t1;
|
|
24
|
+
$[2] = t2;
|
|
25
|
+
} else t2 = $[2];
|
|
26
|
+
return t2;
|
|
17
27
|
};
|
|
18
28
|
//#endregion
|
|
19
29
|
export { CheckContent };
|
|
@@ -2,8 +2,9 @@ import { CSSProperties } from 'react';
|
|
|
2
2
|
interface InputClearProps {
|
|
3
3
|
onClear: () => void;
|
|
4
4
|
show?: boolean;
|
|
5
|
+
renderStatic?: boolean;
|
|
5
6
|
className?: string;
|
|
6
7
|
style?: CSSProperties;
|
|
7
8
|
}
|
|
8
|
-
export declare const InputClear: ({ onClear, className, style, show }: InputClearProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const InputClear: ({ onClear, className, style, show, renderStatic }: InputClearProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
export {};
|
|
@@ -2,23 +2,99 @@ import { CloseIcon } from "../../../assets/icons/Close.js";
|
|
|
2
2
|
import { UIConfig } from "../../../config/uiConfig.context.js";
|
|
3
3
|
import { InlineIconButton } from "../../buttons/InlineIconButton/InlineIconButton.js";
|
|
4
4
|
import "../../../config/i18n.js";
|
|
5
|
+
import { c } from "react/compiler-runtime";
|
|
5
6
|
import { jsx } from "react/jsx-runtime";
|
|
6
7
|
import { clsx } from "clsx";
|
|
7
8
|
import { useTranslation } from "react-i18next";
|
|
8
9
|
//#region src/components/inputs/shared/InputClear.tsx
|
|
9
|
-
var InputClear = (
|
|
10
|
-
const
|
|
10
|
+
var InputClear = (t0) => {
|
|
11
|
+
const $ = c(12);
|
|
12
|
+
const { onClear, className, style, show, renderStatic } = t0;
|
|
11
13
|
const alwaysShowClear = UIConfig.useConfig().input.alwaysShowClear;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
let clearClassName;
|
|
15
|
+
let t1;
|
|
16
|
+
if ($[0] !== alwaysShowClear || $[1] !== className || $[2] !== renderStatic || $[3] !== show || $[4] !== style) {
|
|
17
|
+
t1 = Symbol.for("react.early_return_sentinel");
|
|
18
|
+
bb0: {
|
|
19
|
+
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
|
+
if (renderStatic) {
|
|
21
|
+
let t2;
|
|
22
|
+
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
23
|
+
t2 = /* @__PURE__ */ jsx(CloseIcon, { className: "h-6 w-6 shrink-0" });
|
|
24
|
+
$[7] = t2;
|
|
25
|
+
} else t2 = $[7];
|
|
26
|
+
t1 = /* @__PURE__ */ jsx("button", {
|
|
27
|
+
type: "button",
|
|
28
|
+
"aria-hidden": "true",
|
|
29
|
+
tabIndex: -1,
|
|
30
|
+
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
|
+
style,
|
|
32
|
+
children: t2
|
|
33
|
+
});
|
|
34
|
+
break bb0;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
$[0] = alwaysShowClear;
|
|
38
|
+
$[1] = className;
|
|
39
|
+
$[2] = renderStatic;
|
|
40
|
+
$[3] = show;
|
|
41
|
+
$[4] = style;
|
|
42
|
+
$[5] = clearClassName;
|
|
43
|
+
$[6] = t1;
|
|
44
|
+
} else {
|
|
45
|
+
clearClassName = $[5];
|
|
46
|
+
t1 = $[6];
|
|
47
|
+
}
|
|
48
|
+
if (t1 !== Symbol.for("react.early_return_sentinel")) return t1;
|
|
49
|
+
let t2;
|
|
50
|
+
if ($[8] !== clearClassName || $[9] !== onClear || $[10] !== style) {
|
|
51
|
+
t2 = /* @__PURE__ */ jsx(InputClearButton, {
|
|
52
|
+
onClear,
|
|
53
|
+
className: clearClassName,
|
|
54
|
+
style
|
|
55
|
+
});
|
|
56
|
+
$[8] = clearClassName;
|
|
57
|
+
$[9] = onClear;
|
|
58
|
+
$[10] = style;
|
|
59
|
+
$[11] = t2;
|
|
60
|
+
} else t2 = $[11];
|
|
61
|
+
return t2;
|
|
62
|
+
};
|
|
63
|
+
var InputClearButton = (t0) => {
|
|
64
|
+
const $ = c(7);
|
|
65
|
+
const { onClear, className, style } = t0;
|
|
66
|
+
const { t } = useTranslation("ui");
|
|
67
|
+
let t1;
|
|
68
|
+
if ($[0] !== t) {
|
|
69
|
+
t1 = t(_temp);
|
|
70
|
+
$[0] = t;
|
|
71
|
+
$[1] = t1;
|
|
72
|
+
} else t1 = $[1];
|
|
73
|
+
let t2;
|
|
74
|
+
if ($[2] !== className || $[3] !== onClear || $[4] !== style || $[5] !== t1) {
|
|
75
|
+
t2 = /* @__PURE__ */ jsx(InlineIconButton, {
|
|
76
|
+
color: "secondary",
|
|
77
|
+
className,
|
|
78
|
+
label: t1,
|
|
79
|
+
icon: CloseIcon,
|
|
80
|
+
onPress: onClear,
|
|
81
|
+
onMouseDown: _temp2,
|
|
82
|
+
excludeFromTabOrder: true,
|
|
83
|
+
style
|
|
84
|
+
});
|
|
85
|
+
$[2] = className;
|
|
86
|
+
$[3] = onClear;
|
|
87
|
+
$[4] = style;
|
|
88
|
+
$[5] = t1;
|
|
89
|
+
$[6] = t2;
|
|
90
|
+
} else t2 = $[6];
|
|
91
|
+
return t2;
|
|
22
92
|
};
|
|
93
|
+
function _temp($) {
|
|
94
|
+
return $.ui.clearAlt;
|
|
95
|
+
}
|
|
96
|
+
function _temp2(e) {
|
|
97
|
+
return e.preventDefault();
|
|
98
|
+
}
|
|
23
99
|
//#endregion
|
|
24
100
|
export { InputClear };
|