@povio/ui 2.3.0-rc.9 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/icons/AlignCenter.js +11 -26
- package/dist/assets/icons/AlignLeft.js +11 -26
- package/dist/assets/icons/AlignLeftRight.js +11 -26
- package/dist/assets/icons/AlignRight.js +11 -26
- package/dist/assets/icons/ArrowDropDown.js +11 -26
- package/dist/assets/icons/ArrowDropUp.js +11 -26
- package/dist/assets/icons/ArrowLeft.js +11 -26
- package/dist/assets/icons/ArrowRight.js +11 -26
- package/dist/assets/icons/Bold.js +11 -26
- package/dist/assets/icons/BulletedList.js +11 -26
- package/dist/assets/icons/Calendar.js +13 -28
- package/dist/assets/icons/Check.js +13 -28
- package/dist/assets/icons/CheckCircle.js +11 -26
- package/dist/assets/icons/CheckboxCheckmark.js +14 -29
- package/dist/assets/icons/CheckboxIndeterminate.js +14 -29
- package/dist/assets/icons/ChevronDown.js +13 -28
- package/dist/assets/icons/ChevronLeft.js +13 -28
- package/dist/assets/icons/ChevronRight.js +13 -28
- package/dist/assets/icons/ChevronUp.js +13 -28
- package/dist/assets/icons/ChevronsLeft.js +13 -28
- package/dist/assets/icons/ChevronsRight.js +13 -28
- package/dist/assets/icons/Clock.js +11 -26
- package/dist/assets/icons/Close.js +11 -26
- package/dist/assets/icons/DateTime.js +14 -35
- package/dist/assets/icons/DragIndicator.js +11 -26
- package/dist/assets/icons/File.js +13 -28
- package/dist/assets/icons/Highlight.js +11 -26
- package/dist/assets/icons/HighlightOn.js +15 -49
- package/dist/assets/icons/Home.js +11 -26
- package/dist/assets/icons/Info.js +16 -37
- package/dist/assets/icons/Italic.js +11 -26
- package/dist/assets/icons/Link.js +11 -26
- package/dist/assets/icons/Menu.js +11 -26
- package/dist/assets/icons/NumberedList.js +11 -26
- package/dist/assets/icons/PointerHorizontal.js +11 -26
- package/dist/assets/icons/PointerVertical.js +11 -26
- package/dist/assets/icons/Search.js +11 -26
- package/dist/assets/icons/Send.js +13 -28
- package/dist/assets/icons/Strikethrough.js +11 -26
- package/dist/assets/icons/TextColor.js +14 -48
- package/dist/assets/icons/Today.js +11 -26
- package/dist/assets/icons/Underlined.js +13 -28
- package/dist/assets/icons/Upload.js +14 -35
- package/dist/assets/icons/Visibility.js +11 -26
- package/dist/assets/icons/VisibilityOff.js +11 -26
- package/dist/assets/icons/WarningFilled.js +13 -28
- package/dist/components/Breadcrumbs/Breadcrumbs.js +56 -207
- package/dist/components/Menu/Menu.js +2 -18
- package/dist/components/Menu/MenuDesktop.js +7 -41
- package/dist/components/Menu/MenuItem.js +9 -32
- package/dist/components/Menu/MenuMobile.js +38 -97
- package/dist/components/Menu/MenuPopover.js +29 -105
- package/dist/components/buttons/IconButton/IconButton.js +8 -40
- package/dist/components/buttons/InlineIconButton/InlineIconButton.d.ts +1 -2
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +9 -34
- package/dist/components/buttons/PillButton/PillButton.js +17 -55
- package/dist/components/buttons/SplitButton/SplitButton.js +18 -103
- package/dist/components/buttons/TextButton/TextButton.js +8 -30
- package/dist/components/buttons/ToggleButton/ToggleButton.js +8 -28
- package/dist/components/buttons/shared/ButtonContent.js +22 -80
- package/dist/components/inputs/Checkbox/Checkbox.js +35 -172
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +10 -24
- package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +0 -3
- package/dist/components/inputs/Checkbox/checkbox.cva.js +1 -2
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +5 -10
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +20 -121
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +5 -10
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +111 -215
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +5 -11
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +19 -123
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +3 -5
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +104 -448
- package/dist/components/inputs/DateTime/shared/Calendar.d.ts +2 -5
- package/dist/components/inputs/DateTime/shared/Calendar.js +119 -330
- package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +1 -1
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +102 -283
- package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +1 -1
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +33 -142
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +93 -249
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +137 -318
- package/dist/components/inputs/DateTime/shared/DateField.js +112 -296
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +3 -6
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +136 -355
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +0 -14
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +11 -97
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +27 -81
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +10 -59
- package/dist/components/inputs/DateTime/shared/MonthPicker.js +58 -103
- package/dist/components/inputs/DateTime/shared/RangeCalendar.js +82 -193
- package/dist/components/inputs/DateTime/shared/TimeField.js +8 -27
- package/dist/components/inputs/DateTime/shared/TimePickerForm.js +110 -279
- package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +1 -2
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +65 -207
- package/dist/components/inputs/DateTime/shared/YearPicker.js +68 -119
- package/dist/components/inputs/File/FileUpload.js +44 -87
- package/dist/components/inputs/File/FileUploadContainer.js +7 -15
- package/dist/components/inputs/File/InputUpload.js +79 -317
- package/dist/components/inputs/File/shared/FileCard.js +41 -104
- package/dist/components/inputs/File/shared/FileCardList.js +12 -47
- package/dist/components/inputs/File/shared/FileUploadContent.js +44 -175
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +46 -149
- package/dist/components/inputs/File/shared/FileUploadContentError.js +93 -234
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +97 -230
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +55 -199
- package/dist/components/inputs/File/shared/InputUploadContent.js +34 -148
- package/dist/components/inputs/File/shared/InputUploadFilled.js +8 -49
- package/dist/components/inputs/File/shared/ProgressBar.js +9 -48
- package/dist/components/inputs/FormField/FormField.d.ts +3 -3
- package/dist/components/inputs/FormField/FormField.js +37 -119
- package/dist/components/inputs/FormField/FormFieldError.js +5 -25
- package/dist/components/inputs/FormField/FormFieldHeader.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldHeader.js +22 -81
- package/dist/components/inputs/FormField/FormFieldHeaderClose.js +7 -31
- package/dist/components/inputs/FormField/FormFieldHelper.js +6 -26
- package/dist/components/inputs/FormField/FormFieldLabel.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldLabel.js +9 -40
- package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +2 -5
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +88 -334
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +9 -48
- package/dist/components/inputs/Input/TextArea/TextArea.js +90 -305
- package/dist/components/inputs/Input/TextInput/TextInput.d.ts +1 -3
- package/dist/components/inputs/Input/TextInput/TextInput.js +79 -319
- package/dist/components/inputs/Input/shared/InputContent.js +59 -192
- package/dist/components/inputs/Inputs/Form.js +11 -40
- package/dist/components/inputs/Inputs/InputItem.d.ts +21 -16
- package/dist/components/inputs/Inputs/InputItem.js +14 -71
- package/dist/components/inputs/Inputs/Inputs.js +11 -37
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +1 -2
- package/dist/components/inputs/RadioGroup/RadioGroup.js +60 -352
- package/dist/components/inputs/RadioGroup/radio.cva.d.ts +0 -17
- package/dist/components/inputs/RadioGroup/radio.cva.js +1 -42
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +2 -6
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +7 -109
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +18 -3
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +8 -34
- package/dist/components/inputs/Selection/Select/Select.d.ts +3 -7
- package/dist/components/inputs/Selection/Select/Select.js +5 -132
- package/dist/components/inputs/Selection/shared/SelectBase.d.ts +1 -8
- package/dist/components/inputs/Selection/shared/SelectBase.js +18 -69
- package/dist/components/inputs/Selection/shared/SelectDesktop.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +138 -393
- package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectInput.js +116 -338
- package/dist/components/inputs/Selection/shared/SelectInputTags.js +25 -99
- package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectListBox.js +52 -164
- package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +35 -85
- package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +16 -69
- package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +21 -70
- package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +9 -58
- package/dist/components/inputs/Selection/shared/SelectMobile.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectMobile.js +3 -9
- package/dist/components/inputs/Selection/shared/select.context.d.ts +2 -3
- package/dist/components/inputs/Selection/shared/select.context.js +34 -57
- package/dist/components/inputs/Selection/shared/select.types.d.ts +2 -3
- package/dist/components/inputs/Selection/shared/useSelectItems.js +49 -109
- package/dist/components/inputs/Slider/Slider.js +74 -250
- package/dist/components/inputs/TextEditor/TextEditor.d.ts +0 -1
- package/dist/components/inputs/TextEditor/TextEditor.js +98 -447
- package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +11 -37
- package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +30 -102
- package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +45 -194
- package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +28 -88
- package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +14 -48
- package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +19 -66
- package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +15 -49
- package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +32 -92
- package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +54 -126
- package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +38 -141
- package/dist/components/inputs/Toggle/Toggle.js +37 -189
- package/dist/components/inputs/Toggle/toggle.cva.d.ts +0 -3
- package/dist/components/inputs/Toggle/toggle.cva.js +1 -2
- package/dist/components/inputs/shared/CheckContent.d.ts +1 -2
- package/dist/components/inputs/shared/CheckContent.js +11 -21
- package/dist/components/inputs/shared/InputClear.d.ts +1 -2
- package/dist/components/inputs/shared/InputClear.js +13 -79
- package/dist/components/inputs/shared/TooltipWrapper.js +11 -50
- package/dist/components/inputs/shared/input.cva.d.ts +0 -10
- package/dist/components/inputs/shared/input.cva.js +4 -32
- package/dist/components/navigation/Accordion/Accordion.js +22 -69
- package/dist/components/navigation/Accordion/AccordionItem.js +41 -86
- package/dist/components/navigation/Stepper/Stepper.js +22 -67
- package/dist/components/navigation/Stepper/StepperItem.js +31 -104
- package/dist/components/navigation/Stepper/StepperSeparator.js +5 -23
- package/dist/components/overlays/ActionModal/ActionModal.js +35 -169
- package/dist/components/overlays/BottomSheet/BottomSheet.js +49 -98
- package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +8 -48
- package/dist/components/overlays/Drawer/Drawer.js +20 -62
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +27 -83
- package/dist/components/overlays/Tooltip/Tooltip.js +28 -137
- package/dist/components/overlays/Tooltip/TooltipEllipsis.js +12 -37
- package/dist/components/segment/Segment.js +57 -218
- package/dist/components/segment/SegmentItem.js +10 -67
- package/dist/components/shared/pagination/Pagination.js +22 -108
- package/dist/components/shared/pagination/PaginationList.js +64 -167
- package/dist/components/status/Alert/Alert.js +30 -97
- package/dist/components/status/Loader/Loader.js +22 -77
- package/dist/components/status/Toast/Toast.js +13 -21
- package/dist/components/status/Toast/useToast.js +57 -62
- package/dist/components/table/ColumnConfig.js +54 -158
- package/dist/components/table/InfiniteTable.js +16 -67
- package/dist/components/table/PaginatedTable.js +18 -84
- package/dist/components/table/Table.js +27 -28
- package/dist/components/text/Link/Link.js +7 -19
- package/dist/components/text/Typography/Typography.js +8 -23
- package/dist/config/confirmation.context.js +1 -1
- package/dist/config/link.context.js +9 -23
- package/dist/config/router.context.js +16 -42
- package/dist/config/theme.context.js +45 -98
- package/dist/config/uiConfig.context.d.ts +6 -16
- package/dist/config/uiConfig.context.js +13 -56
- package/dist/config/uiStyle.context.d.ts +4 -27
- package/dist/config/uiStyle.context.js +5 -15
- package/dist/helpers/dynamicInputs.d.ts +5 -5
- package/dist/helpers/dynamicInputs.js +0 -3
- package/dist/hooks/useBreakpoint.js +3 -16
- package/dist/hooks/useDebounceCallback.js +17 -51
- package/dist/hooks/useFilters.js +64 -125
- package/dist/hooks/useForm.js +8 -42
- package/dist/hooks/useFormAutosave.js +30 -101
- package/dist/hooks/useIntersectionObserver.d.ts +1 -1
- package/dist/hooks/useIntersectionObserver.js +24 -91
- package/dist/hooks/useLocalStorage.js +10 -43
- package/dist/hooks/useLongPressRepeat.js +20 -55
- package/dist/hooks/usePagination.js +19 -49
- package/dist/hooks/useScrollableListBox.js +16 -37
- package/dist/hooks/useSorting.js +28 -69
- package/dist/hooks/useStateAndRef.js +7 -21
- package/dist/hooks/useTableColumnConfig.js +31 -124
- package/dist/hooks/useTranslationMemo.js +5 -25
- package/dist/index.d.ts +0 -7
- package/dist/index.js +3 -5
- package/dist/tw-ui-plugin.js +0 -2
- package/dist/utils/date-time.utils.d.ts +10 -31
- package/dist/utils/date-time.utils.js +22 -123
- package/dist/utils/dom.utils.js +1 -1
- package/package.json +1 -1
- package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +0 -4
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +0 -7
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +0 -13
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +0 -6
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +0 -21
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.d.ts +0 -2
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.spec.d.ts +0 -1
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +0 -31
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +0 -80
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.spec.d.ts +0 -1
- package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +0 -6
- package/dist/components/inputs/FormField/formFieldHeader.cva.js +0 -11
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.d.ts +0 -45
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +0 -571
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +0 -35
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +0 -479
- package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +0 -4
- package/dist/components/inputs/Input/TextArea/TextArea.cva.js +0 -5
- package/dist/components/inputs/Input/shared/numberStatic.utils.d.ts +0 -1
- package/dist/components/inputs/Input/shared/numberStatic.utils.js +0 -7
- package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +0 -36
- package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +0 -14
- package/dist/components/inputs/Selection/Select/QuerySelect.js +0 -122
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +0 -9
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +0 -47
- package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +0 -6
- package/dist/components/inputs/Selection/shared/querySelect.utils.js +0 -13
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +0 -3
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +0 -5
- package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +0 -5
- package/dist/components/inputs/Selection/shared/selectInput.cva.js +0 -5
- package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +0 -23
- package/dist/components/inputs/Selection/shared/staticSelect.utils.js +0 -37
- package/dist/components/inputs/Selection/shared/staticSelect.utils.spec.d.ts +0 -1
- package/dist/components/inputs/Skeleton/InputFrame.d.ts +0 -79
- package/dist/components/inputs/Skeleton/InputFrame.js +0 -526
- package/dist/components/inputs/shared/StaticInput.d.ts +0 -38
- package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +0 -4
- package/dist/components/inputs/shared/tooltipWrapper.cva.js +0 -5
- package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +0 -14
- package/dist/components/inputs/shared/useStaticInputHandoff.js +0 -100
- package/dist/hooks/useQueryAutocomplete.d.ts +0 -14
- package/dist/hooks/useQueryAutocomplete.js +0 -57
- package/dist/utils/query.utils.d.ts +0 -4
- package/dist/utils/query.utils.js +0 -8
|
@@ -2,122 +2,37 @@ import { ChevronDownIcon } from "../../../assets/icons/ChevronDown.js";
|
|
|
2
2
|
import { Button } from "../Button/Button.js";
|
|
3
3
|
import { IconButton } from "../IconButton/IconButton.js";
|
|
4
4
|
import { Menu } from "../../Menu/Menu.js";
|
|
5
|
-
import { c } from "react/compiler-runtime";
|
|
6
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
6
|
import { clsx } from "clsx";
|
|
8
7
|
//#region src/components/buttons/SplitButton/SplitButton.tsx
|
|
9
|
-
var SplitButton = (
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
let items;
|
|
15
|
-
let label;
|
|
16
|
-
let labelRight;
|
|
17
|
-
let link;
|
|
18
|
-
let props;
|
|
19
|
-
let size;
|
|
20
|
-
let variant;
|
|
21
|
-
let width;
|
|
22
|
-
if ($[0] !== t0) {
|
|
23
|
-
({variant, color, width, size, label, labelRight, link, items, className, isLoading, ...props} = t0);
|
|
24
|
-
$[0] = t0;
|
|
25
|
-
$[1] = className;
|
|
26
|
-
$[2] = color;
|
|
27
|
-
$[3] = isLoading;
|
|
28
|
-
$[4] = items;
|
|
29
|
-
$[5] = label;
|
|
30
|
-
$[6] = labelRight;
|
|
31
|
-
$[7] = link;
|
|
32
|
-
$[8] = props;
|
|
33
|
-
$[9] = size;
|
|
34
|
-
$[10] = variant;
|
|
35
|
-
$[11] = width;
|
|
36
|
-
} else {
|
|
37
|
-
className = $[1];
|
|
38
|
-
color = $[2];
|
|
39
|
-
isLoading = $[3];
|
|
40
|
-
items = $[4];
|
|
41
|
-
label = $[5];
|
|
42
|
-
labelRight = $[6];
|
|
43
|
-
link = $[7];
|
|
44
|
-
props = $[8];
|
|
45
|
-
size = $[9];
|
|
46
|
-
variant = $[10];
|
|
47
|
-
width = $[11];
|
|
48
|
-
}
|
|
49
|
-
let t1;
|
|
50
|
-
if ($[12] !== className) {
|
|
51
|
-
t1 = clsx("rounded-r-none! border-r border-solid", className);
|
|
52
|
-
$[12] = className;
|
|
53
|
-
$[13] = t1;
|
|
54
|
-
} else t1 = $[13];
|
|
55
|
-
let t2;
|
|
56
|
-
if ($[14] !== color || $[15] !== isLoading || $[16] !== label || $[17] !== link || $[18] !== props || $[19] !== size || $[20] !== t1 || $[21] !== variant || $[22] !== width) {
|
|
57
|
-
t2 = /* @__PURE__ */ jsx(Button, {
|
|
8
|
+
var SplitButton = ({ variant, color, width, size, label, labelRight, link, items, className, isLoading, ...props }) => {
|
|
9
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
10
|
+
className: "group/split flex items-center",
|
|
11
|
+
"data-split": "",
|
|
12
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
58
13
|
...props,
|
|
59
14
|
width,
|
|
60
15
|
size,
|
|
61
16
|
variant,
|
|
62
17
|
color,
|
|
63
18
|
link,
|
|
64
|
-
className:
|
|
19
|
+
className: clsx("rounded-r-none! border-r border-solid", className),
|
|
65
20
|
"data-separator": "",
|
|
66
21
|
isLoading,
|
|
67
22
|
children: label
|
|
68
|
-
})
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
$[23] = t2;
|
|
79
|
-
} else t2 = $[23];
|
|
80
|
-
const t3 = props.isDisabled || isLoading;
|
|
81
|
-
let t4;
|
|
82
|
-
if ($[24] !== color || $[25] !== labelRight || $[26] !== size || $[27] !== t3 || $[28] !== variant) {
|
|
83
|
-
t4 = /* @__PURE__ */ jsx(IconButton, {
|
|
84
|
-
size,
|
|
85
|
-
variant,
|
|
86
|
-
color,
|
|
87
|
-
label: labelRight,
|
|
88
|
-
icon: ChevronDownIcon,
|
|
89
|
-
className: "rounded-l-none! border-l-0!",
|
|
90
|
-
isDisabled: t3
|
|
91
|
-
});
|
|
92
|
-
$[24] = color;
|
|
93
|
-
$[25] = labelRight;
|
|
94
|
-
$[26] = size;
|
|
95
|
-
$[27] = t3;
|
|
96
|
-
$[28] = variant;
|
|
97
|
-
$[29] = t4;
|
|
98
|
-
} else t4 = $[29];
|
|
99
|
-
let t5;
|
|
100
|
-
if ($[30] !== items || $[31] !== t4) {
|
|
101
|
-
t5 = /* @__PURE__ */ jsx(Menu, {
|
|
102
|
-
trigger: t4,
|
|
23
|
+
}), /* @__PURE__ */ jsx(Menu, {
|
|
24
|
+
trigger: /* @__PURE__ */ jsx(IconButton, {
|
|
25
|
+
size,
|
|
26
|
+
variant,
|
|
27
|
+
color,
|
|
28
|
+
label: labelRight,
|
|
29
|
+
icon: ChevronDownIcon,
|
|
30
|
+
className: "rounded-l-none! border-l-0!",
|
|
31
|
+
isDisabled: props.isDisabled || isLoading
|
|
32
|
+
}),
|
|
103
33
|
items
|
|
104
|
-
})
|
|
105
|
-
|
|
106
|
-
$[31] = t4;
|
|
107
|
-
$[32] = t5;
|
|
108
|
-
} else t5 = $[32];
|
|
109
|
-
let t6;
|
|
110
|
-
if ($[33] !== t2 || $[34] !== t5) {
|
|
111
|
-
t6 = /* @__PURE__ */ jsxs("div", {
|
|
112
|
-
className: "group/split flex items-center",
|
|
113
|
-
"data-split": "",
|
|
114
|
-
children: [t2, t5]
|
|
115
|
-
});
|
|
116
|
-
$[33] = t2;
|
|
117
|
-
$[34] = t5;
|
|
118
|
-
$[35] = t6;
|
|
119
|
-
} else t6 = $[35];
|
|
120
|
-
return t6;
|
|
34
|
+
})]
|
|
35
|
+
});
|
|
121
36
|
};
|
|
122
37
|
//#endregion
|
|
123
38
|
export { SplitButton };
|
|
@@ -1,36 +1,14 @@
|
|
|
1
1
|
import { Button } from "../Button/Button.js";
|
|
2
|
-
import { c } from "react/compiler-runtime";
|
|
3
2
|
import { jsx } from "react/jsx-runtime";
|
|
4
3
|
//#region src/components/buttons/TextButton/TextButton.tsx
|
|
5
|
-
var TextButton = (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
$[2] = props;
|
|
14
|
-
} else {
|
|
15
|
-
children = $[1];
|
|
16
|
-
props = $[2];
|
|
17
|
-
}
|
|
18
|
-
const t1 = props.width ?? "hug";
|
|
19
|
-
let t2;
|
|
20
|
-
if ($[3] !== children || $[4] !== props || $[5] !== t1) {
|
|
21
|
-
t2 = /* @__PURE__ */ jsx(Button, {
|
|
22
|
-
...props,
|
|
23
|
-
variant: "text",
|
|
24
|
-
size: "none",
|
|
25
|
-
width: t1,
|
|
26
|
-
children
|
|
27
|
-
});
|
|
28
|
-
$[3] = children;
|
|
29
|
-
$[4] = props;
|
|
30
|
-
$[5] = t1;
|
|
31
|
-
$[6] = t2;
|
|
32
|
-
} else t2 = $[6];
|
|
33
|
-
return t2;
|
|
4
|
+
var TextButton = ({ children, ...props }) => {
|
|
5
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
6
|
+
...props,
|
|
7
|
+
variant: "text",
|
|
8
|
+
size: "none",
|
|
9
|
+
width: props.width ?? "hug",
|
|
10
|
+
children
|
|
11
|
+
});
|
|
34
12
|
};
|
|
35
13
|
//#endregion
|
|
36
14
|
export { TextButton };
|
|
@@ -1,34 +1,14 @@
|
|
|
1
1
|
import { Button } from "../Button/Button.js";
|
|
2
|
-
import { c } from "react/compiler-runtime";
|
|
3
2
|
import { jsx } from "react/jsx-runtime";
|
|
4
3
|
//#region src/components/buttons/ToggleButton/ToggleButton.tsx
|
|
5
|
-
var ToggleButton = (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
$[2] = props;
|
|
14
|
-
} else {
|
|
15
|
-
children = $[1];
|
|
16
|
-
props = $[2];
|
|
17
|
-
}
|
|
18
|
-
let t1;
|
|
19
|
-
if ($[3] !== children || $[4] !== props) {
|
|
20
|
-
t1 = /* @__PURE__ */ jsx(Button, {
|
|
21
|
-
...props,
|
|
22
|
-
toggle: true,
|
|
23
|
-
variant: "outlined",
|
|
24
|
-
color: "primary",
|
|
25
|
-
children
|
|
26
|
-
});
|
|
27
|
-
$[3] = children;
|
|
28
|
-
$[4] = props;
|
|
29
|
-
$[5] = t1;
|
|
30
|
-
} else t1 = $[5];
|
|
31
|
-
return t1;
|
|
4
|
+
var ToggleButton = ({ children, ...props }) => {
|
|
5
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
6
|
+
...props,
|
|
7
|
+
toggle: true,
|
|
8
|
+
variant: "outlined",
|
|
9
|
+
color: "primary",
|
|
10
|
+
children
|
|
11
|
+
});
|
|
32
12
|
};
|
|
33
13
|
//#endregion
|
|
34
14
|
export { ToggleButton };
|
|
@@ -2,94 +2,36 @@ import { UIStyle } from "../../../config/uiStyle.context.js";
|
|
|
2
2
|
import { typography } from "../../text/Typography/typography.cva.js";
|
|
3
3
|
import { buttonContentLabel } from "./buttonContent.cva.js";
|
|
4
4
|
import { Loader } from "../../status/Loader/Loader.js";
|
|
5
|
-
import { c } from "react/compiler-runtime";
|
|
6
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
6
|
import { clsx } from "clsx";
|
|
8
7
|
import { isValidElement } from "react";
|
|
9
8
|
//#region src/components/buttons/shared/ButtonContent.tsx
|
|
10
|
-
var ButtonContent = (
|
|
11
|
-
const $ = c(21);
|
|
12
|
-
const { ref, content, isLoading, icon: Icon, iconClassName, hideText, iconPosition: t1, typography: typographyOverrides } = t0;
|
|
13
|
-
const iconPosition = t1 === void 0 ? "left" : t1;
|
|
9
|
+
var ButtonContent = ({ ref, content, isLoading, icon: Icon, iconClassName, hideText, iconPosition = "left", typography: typographyOverrides }) => {
|
|
14
10
|
const typographyCva = UIStyle.useCva("typography.cva", typography);
|
|
15
11
|
let iconOrLoader = null;
|
|
16
|
-
if (isLoading) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
$[3] = Icon;
|
|
35
|
-
$[4] = t2;
|
|
36
|
-
$[5] = t3;
|
|
37
|
-
} else t3 = $[5];
|
|
38
|
-
iconOrLoader = t3;
|
|
39
|
-
}
|
|
40
|
-
let t2;
|
|
41
|
-
let t3;
|
|
42
|
-
if ($[6] !== hideText || $[7] !== iconOrLoader || $[8] !== iconPosition || $[9] !== typographyCva || $[10] !== typographyOverrides) {
|
|
43
|
-
const resolvedTypography = {
|
|
44
|
-
size: "label-2",
|
|
45
|
-
variant: "prominent-1",
|
|
46
|
-
...typographyOverrides
|
|
47
|
-
};
|
|
48
|
-
t3 = iconOrLoader && iconPosition === "left" && iconOrLoader;
|
|
49
|
-
t2 = clsx(typographyCva({
|
|
50
|
-
...resolvedTypography,
|
|
51
|
-
sizeMobile: resolvedTypography.sizeMobile ?? resolvedTypography.size
|
|
52
|
-
}), buttonContentLabel({
|
|
53
|
-
iconPosition: iconOrLoader ? iconPosition : "none",
|
|
54
|
-
hideText: !!hideText
|
|
55
|
-
}));
|
|
56
|
-
$[6] = hideText;
|
|
57
|
-
$[7] = iconOrLoader;
|
|
58
|
-
$[8] = iconPosition;
|
|
59
|
-
$[9] = typographyCva;
|
|
60
|
-
$[10] = typographyOverrides;
|
|
61
|
-
$[11] = t2;
|
|
62
|
-
$[12] = t3;
|
|
63
|
-
} else {
|
|
64
|
-
t2 = $[11];
|
|
65
|
-
t3 = $[12];
|
|
66
|
-
}
|
|
67
|
-
let t4;
|
|
68
|
-
if ($[13] !== content || $[14] !== ref || $[15] !== t2) {
|
|
69
|
-
t4 = /* @__PURE__ */ jsx("span", {
|
|
70
|
-
className: t2,
|
|
12
|
+
if (isLoading) iconOrLoader = /* @__PURE__ */ jsx(Loader, { className: "shrink-0" });
|
|
13
|
+
else if (Icon) if (isValidElement(Icon)) iconOrLoader = Icon;
|
|
14
|
+
else iconOrLoader = /* @__PURE__ */ jsx(Icon, { className: clsx("shrink-0", iconClassName) });
|
|
15
|
+
const resolvedTypography = {
|
|
16
|
+
size: "label-2",
|
|
17
|
+
variant: "prominent-1",
|
|
18
|
+
...typographyOverrides
|
|
19
|
+
};
|
|
20
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
21
|
+
iconOrLoader && iconPosition === "left" && iconOrLoader,
|
|
22
|
+
/* @__PURE__ */ jsx("span", {
|
|
23
|
+
className: clsx(typographyCva({
|
|
24
|
+
...resolvedTypography,
|
|
25
|
+
sizeMobile: resolvedTypography.sizeMobile ?? resolvedTypography.size
|
|
26
|
+
}), buttonContentLabel({
|
|
27
|
+
iconPosition: iconOrLoader ? iconPosition : "none",
|
|
28
|
+
hideText: !!hideText
|
|
29
|
+
})),
|
|
71
30
|
ref,
|
|
72
31
|
children: content
|
|
73
|
-
})
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
$[15] = t2;
|
|
77
|
-
$[16] = t4;
|
|
78
|
-
} else t4 = $[16];
|
|
79
|
-
const t5 = iconOrLoader && iconPosition === "right" && iconOrLoader;
|
|
80
|
-
let t6;
|
|
81
|
-
if ($[17] !== t3 || $[18] !== t4 || $[19] !== t5) {
|
|
82
|
-
t6 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
83
|
-
t3,
|
|
84
|
-
t4,
|
|
85
|
-
t5
|
|
86
|
-
] });
|
|
87
|
-
$[17] = t3;
|
|
88
|
-
$[18] = t4;
|
|
89
|
-
$[19] = t5;
|
|
90
|
-
$[20] = t6;
|
|
91
|
-
} else t6 = $[20];
|
|
92
|
-
return t6;
|
|
32
|
+
}),
|
|
33
|
+
iconOrLoader && iconPosition === "right" && iconOrLoader
|
|
34
|
+
] });
|
|
93
35
|
};
|
|
94
36
|
//#endregion
|
|
95
37
|
export { ButtonContent };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { UIStyle } from "../../../config/uiStyle.context.js";
|
|
2
2
|
import { UIConfig } from "../../../config/uiConfig.context.js";
|
|
3
|
-
import {
|
|
3
|
+
import { checkboxIndicatorClass, checkboxTypography } from "./checkbox.cva.js";
|
|
4
4
|
import { FormFieldError } from "../FormField/FormFieldError.js";
|
|
5
5
|
import { CheckContent } from "../shared/CheckContent.js";
|
|
6
6
|
import { CheckboxCheckmark } from "./CheckboxCheckmark.js";
|
|
7
|
-
import { c } from "react/compiler-runtime";
|
|
8
7
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
8
|
import { clsx } from "clsx";
|
|
10
9
|
import { Checkbox } from "react-aria-components";
|
|
@@ -12,189 +11,53 @@ import { mergeRefs } from "@react-aria/utils";
|
|
|
12
11
|
import { Controller } from "react-hook-form";
|
|
13
12
|
//#region src/components/inputs/Checkbox/Checkbox.tsx
|
|
14
13
|
var CheckboxBase = (props) => {
|
|
15
|
-
const $ = c(38);
|
|
16
14
|
const ui = UIConfig.useConfig();
|
|
17
15
|
const checkboxTypographyMap = UIStyle.useMapper("checkbox.typography", checkboxTypography);
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
$[4] = hideLabelProp;
|
|
33
|
-
$[5] = isDisabled;
|
|
34
|
-
$[6] = rest;
|
|
35
|
-
$[7] = variantProp;
|
|
36
|
-
} else {
|
|
37
|
-
children = $[1];
|
|
38
|
-
className = $[2];
|
|
39
|
-
error = $[3];
|
|
40
|
-
hideLabelProp = $[4];
|
|
41
|
-
isDisabled = $[5];
|
|
42
|
-
rest = $[6];
|
|
43
|
-
variantProp = $[7];
|
|
44
|
-
}
|
|
45
|
-
const variant = variantProp ?? ui.checkbox.variant;
|
|
46
|
-
const hideLabel = hideLabelProp ?? ui.input.hideLabel;
|
|
47
|
-
let t0;
|
|
48
|
-
if ($[8] !== error || $[9] !== isDisabled) {
|
|
49
|
-
t0 = {
|
|
50
|
-
error,
|
|
51
|
-
isDisabled
|
|
52
|
-
};
|
|
53
|
-
$[8] = error;
|
|
54
|
-
$[9] = isDisabled;
|
|
55
|
-
$[10] = t0;
|
|
56
|
-
} else t0 = $[10];
|
|
57
|
-
const formFieldErrorProps = t0;
|
|
58
|
-
const t1 = !!error;
|
|
59
|
-
const t2 = error || void 0;
|
|
60
|
-
const t3 = props.isDirty || void 0;
|
|
61
|
-
const t4 = props.isRequired || void 0;
|
|
62
|
-
let t5;
|
|
63
|
-
if ($[11] !== className) {
|
|
64
|
-
t5 = clsx("relative", checkboxIndicatorClass, className);
|
|
65
|
-
$[11] = className;
|
|
66
|
-
$[12] = t5;
|
|
67
|
-
} else t5 = $[12];
|
|
68
|
-
let t6;
|
|
69
|
-
if ($[13] !== rest || $[14] !== variant) {
|
|
70
|
-
t6 = /* @__PURE__ */ jsx(CheckboxCheckmark, {
|
|
16
|
+
const { className, children, isDisabled, error, variant = ui.checkbox.variant, hideLabel = ui.input.hideLabel, ...rest } = props;
|
|
17
|
+
const formFieldErrorProps = {
|
|
18
|
+
error,
|
|
19
|
+
isDisabled
|
|
20
|
+
};
|
|
21
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(Checkbox, {
|
|
22
|
+
...rest,
|
|
23
|
+
isDisabled,
|
|
24
|
+
isInvalid: !!error,
|
|
25
|
+
"aria-errormessage": error || void 0,
|
|
26
|
+
"data-is-dirty": props.isDirty || void 0,
|
|
27
|
+
"data-is-required": props.isRequired || void 0,
|
|
28
|
+
className: clsx("relative", checkboxIndicatorClass, className),
|
|
29
|
+
children: [/* @__PURE__ */ jsx(CheckboxCheckmark, {
|
|
71
30
|
variant,
|
|
72
31
|
...rest
|
|
73
|
-
})
|
|
74
|
-
$[13] = rest;
|
|
75
|
-
$[14] = variant;
|
|
76
|
-
$[15] = t6;
|
|
77
|
-
} else t6 = $[15];
|
|
78
|
-
let t7;
|
|
79
|
-
if ($[16] !== checkboxContentClassNameMap || $[17] !== checkboxTypographyMap || $[18] !== children || $[19] !== hideLabel || $[20] !== rest || $[21] !== variant) {
|
|
80
|
-
t7 = !hideLabel && /* @__PURE__ */ jsx(CheckContent, {
|
|
32
|
+
}), !hideLabel && /* @__PURE__ */ jsx(CheckContent, {
|
|
81
33
|
typography: checkboxTypographyMap({
|
|
82
34
|
variant,
|
|
83
35
|
...rest
|
|
84
36
|
}),
|
|
85
|
-
contentClassName: checkboxContentClassNameMap({
|
|
86
|
-
variant,
|
|
87
|
-
...rest
|
|
88
|
-
}),
|
|
89
37
|
children
|
|
90
|
-
})
|
|
91
|
-
|
|
92
|
-
$[17] = checkboxTypographyMap;
|
|
93
|
-
$[18] = children;
|
|
94
|
-
$[19] = hideLabel;
|
|
95
|
-
$[20] = rest;
|
|
96
|
-
$[21] = variant;
|
|
97
|
-
$[22] = t7;
|
|
98
|
-
} else t7 = $[22];
|
|
99
|
-
let t8;
|
|
100
|
-
if ($[23] !== isDisabled || $[24] !== rest || $[25] !== t1 || $[26] !== t2 || $[27] !== t3 || $[28] !== t4 || $[29] !== t5 || $[30] !== t6 || $[31] !== t7) {
|
|
101
|
-
t8 = /* @__PURE__ */ jsxs(Checkbox, {
|
|
102
|
-
...rest,
|
|
103
|
-
isDisabled,
|
|
104
|
-
isInvalid: t1,
|
|
105
|
-
"aria-errormessage": t2,
|
|
106
|
-
"data-is-dirty": t3,
|
|
107
|
-
"data-is-required": t4,
|
|
108
|
-
className: t5,
|
|
109
|
-
children: [t6, t7]
|
|
110
|
-
});
|
|
111
|
-
$[23] = isDisabled;
|
|
112
|
-
$[24] = rest;
|
|
113
|
-
$[25] = t1;
|
|
114
|
-
$[26] = t2;
|
|
115
|
-
$[27] = t3;
|
|
116
|
-
$[28] = t4;
|
|
117
|
-
$[29] = t5;
|
|
118
|
-
$[30] = t6;
|
|
119
|
-
$[31] = t7;
|
|
120
|
-
$[32] = t8;
|
|
121
|
-
} else t8 = $[32];
|
|
122
|
-
let t9;
|
|
123
|
-
if ($[33] !== formFieldErrorProps) {
|
|
124
|
-
t9 = /* @__PURE__ */ jsx(FormFieldError, { ...formFieldErrorProps });
|
|
125
|
-
$[33] = formFieldErrorProps;
|
|
126
|
-
$[34] = t9;
|
|
127
|
-
} else t9 = $[34];
|
|
128
|
-
let t10;
|
|
129
|
-
if ($[35] !== t8 || $[36] !== t9) {
|
|
130
|
-
t10 = /* @__PURE__ */ jsxs(Fragment, { children: [t8, t9] });
|
|
131
|
-
$[35] = t8;
|
|
132
|
-
$[36] = t9;
|
|
133
|
-
$[37] = t10;
|
|
134
|
-
} else t10 = $[37];
|
|
135
|
-
return t10;
|
|
38
|
+
})]
|
|
39
|
+
}), /* @__PURE__ */ jsx(FormFieldError, { ...formFieldErrorProps })] });
|
|
136
40
|
};
|
|
137
41
|
var Checkbox$1 = (props) => {
|
|
138
|
-
const $ = c(15);
|
|
139
42
|
if ("formControl" in props && props.formControl) {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
({
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
t0 = (t1) => {
|
|
157
|
-
const { field, fieldState: t2 } = t1;
|
|
158
|
-
const { error, isDirty } = t2;
|
|
159
|
-
return /* @__PURE__ */ jsx(CheckboxBase, {
|
|
160
|
-
...innerProps,
|
|
161
|
-
ref: mergeRefs(ref, field.ref),
|
|
162
|
-
isSelected: field.value,
|
|
163
|
-
onChange: field.onChange,
|
|
164
|
-
onBlur: field.onBlur,
|
|
165
|
-
name: field.name,
|
|
166
|
-
isDirty,
|
|
167
|
-
isDisabled: field.disabled || props.isDisabled,
|
|
168
|
-
error: props.error ?? error?.message
|
|
169
|
-
});
|
|
170
|
-
};
|
|
171
|
-
$[4] = innerProps;
|
|
172
|
-
$[5] = props.error;
|
|
173
|
-
$[6] = props.isDisabled;
|
|
174
|
-
$[7] = ref;
|
|
175
|
-
$[8] = t0;
|
|
176
|
-
} else t0 = $[8];
|
|
177
|
-
let t1;
|
|
178
|
-
if ($[9] !== formControl.control || $[10] !== formControl.name || $[11] !== t0) {
|
|
179
|
-
t1 = /* @__PURE__ */ jsx(Controller, {
|
|
180
|
-
control: formControl.control,
|
|
181
|
-
name: formControl.name,
|
|
182
|
-
render: t0
|
|
183
|
-
});
|
|
184
|
-
$[9] = formControl.control;
|
|
185
|
-
$[10] = formControl.name;
|
|
186
|
-
$[11] = t0;
|
|
187
|
-
$[12] = t1;
|
|
188
|
-
} else t1 = $[12];
|
|
189
|
-
return t1;
|
|
43
|
+
const { formControl, ref, ...innerProps } = props;
|
|
44
|
+
return /* @__PURE__ */ jsx(Controller, {
|
|
45
|
+
control: formControl.control,
|
|
46
|
+
name: formControl.name,
|
|
47
|
+
render: ({ field, fieldState: { error, isDirty } }) => /* @__PURE__ */ jsx(CheckboxBase, {
|
|
48
|
+
...innerProps,
|
|
49
|
+
ref: mergeRefs(ref, field.ref),
|
|
50
|
+
isSelected: field.value,
|
|
51
|
+
onChange: field.onChange,
|
|
52
|
+
onBlur: field.onBlur,
|
|
53
|
+
name: field.name,
|
|
54
|
+
isDirty,
|
|
55
|
+
isDisabled: field.disabled || props.isDisabled,
|
|
56
|
+
error: props.error ?? error?.message
|
|
57
|
+
})
|
|
58
|
+
});
|
|
190
59
|
}
|
|
191
|
-
|
|
192
|
-
if ($[13] !== props) {
|
|
193
|
-
t0 = /* @__PURE__ */ jsx(CheckboxBase, { ...props });
|
|
194
|
-
$[13] = props;
|
|
195
|
-
$[14] = t0;
|
|
196
|
-
} else t0 = $[14];
|
|
197
|
-
return t0;
|
|
60
|
+
return /* @__PURE__ */ jsx(CheckboxBase, { ...props });
|
|
198
61
|
};
|
|
199
62
|
//#endregion
|
|
200
63
|
export { Checkbox$1 as Checkbox };
|
|
@@ -2,38 +2,24 @@ import { CheckboxCheckmarkIcon } from "../../../assets/icons/CheckboxCheckmark.j
|
|
|
2
2
|
import { CheckboxIndeterminateIcon } from "../../../assets/icons/CheckboxIndeterminate.js";
|
|
3
3
|
import { UIStyle } from "../../../config/uiStyle.context.js";
|
|
4
4
|
import { checkbox, checkboxIcon } from "./checkbox.cva.js";
|
|
5
|
-
import { c } from "react/compiler-runtime";
|
|
6
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
6
|
//#region src/components/inputs/Checkbox/CheckboxCheckmark.tsx
|
|
8
|
-
var CheckboxCheckmark = (
|
|
9
|
-
const $ = c(3);
|
|
10
|
-
const { variant, className, selectedIcon: t1, indeterminateIcon: t2, ...props } = t0;
|
|
11
|
-
const SelectedIcon = t1 === void 0 ? CheckboxCheckmarkIcon : t1;
|
|
12
|
-
const IndeterminateIcon = t2 === void 0 ? CheckboxIndeterminateIcon : t2;
|
|
7
|
+
var CheckboxCheckmark = ({ variant, className, selectedIcon: SelectedIcon = CheckboxCheckmarkIcon, indeterminateIcon: IndeterminateIcon = CheckboxIndeterminateIcon, ...props }) => {
|
|
13
8
|
const checkboxCva = UIStyle.useCva("checkbox.cva", checkbox);
|
|
14
9
|
const checkboxIconCva = UIStyle.useCva("checkbox.iconCva", checkboxIcon);
|
|
15
|
-
const t3 = checkboxCva({
|
|
16
|
-
variant,
|
|
17
|
-
...props,
|
|
18
|
-
className
|
|
19
|
-
});
|
|
20
|
-
const t4 = checkboxIconCva({
|
|
21
|
-
...props,
|
|
22
|
-
iconVariant: "indeterminate"
|
|
23
|
-
});
|
|
24
|
-
let t5;
|
|
25
|
-
if ($[0] !== IndeterminateIcon || $[1] !== t4) {
|
|
26
|
-
t5 = /* @__PURE__ */ jsx(IndeterminateIcon, { className: t4 });
|
|
27
|
-
$[0] = IndeterminateIcon;
|
|
28
|
-
$[1] = t4;
|
|
29
|
-
$[2] = t5;
|
|
30
|
-
} else t5 = $[2];
|
|
31
10
|
return /* @__PURE__ */ jsxs("div", {
|
|
32
|
-
className:
|
|
11
|
+
className: checkboxCva({
|
|
12
|
+
variant,
|
|
13
|
+
...props,
|
|
14
|
+
className
|
|
15
|
+
}),
|
|
33
16
|
children: [/* @__PURE__ */ jsx(SelectedIcon, { className: checkboxIconCva({
|
|
34
17
|
...props,
|
|
35
18
|
iconVariant: "selected"
|
|
36
|
-
}) }),
|
|
19
|
+
}) }), /* @__PURE__ */ jsx(IndeterminateIcon, { className: checkboxIconCva({
|
|
20
|
+
...props,
|
|
21
|
+
iconVariant: "indeterminate"
|
|
22
|
+
}) })]
|
|
37
23
|
});
|
|
38
24
|
};
|
|
39
25
|
//#endregion
|
|
@@ -9,9 +9,6 @@ export declare const checkboxIndicatorClass = "group flex items-center gap-2";
|
|
|
9
9
|
export declare const checkboxTypography: (props: {
|
|
10
10
|
variant?: "default" | null | undefined;
|
|
11
11
|
}) => TypographyVariantProps | undefined;
|
|
12
|
-
export declare const checkboxContentClassName: (props: {
|
|
13
|
-
variant?: "default" | null | undefined;
|
|
14
|
-
}) => string | undefined;
|
|
15
12
|
export declare const checkboxIcon: (props?: ({
|
|
16
13
|
iconVariant?: "selected" | "indeterminate" | null | undefined;
|
|
17
14
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
@@ -39,7 +39,6 @@ var checkboxTypography = compoundMapper({ default: {
|
|
|
39
39
|
sizeMobile: "label-1",
|
|
40
40
|
variant: "default"
|
|
41
41
|
} });
|
|
42
|
-
var checkboxContentClassName = compoundMapper({ default: "text-text-default-2" });
|
|
43
42
|
var checkboxIcon = cva(["absolute hidden size-3"], {
|
|
44
43
|
variants: { iconVariant: {
|
|
45
44
|
selected: ["group-selected:block"],
|
|
@@ -48,4 +47,4 @@ var checkboxIcon = cva(["absolute hidden size-3"], {
|
|
|
48
47
|
defaultVariants: { iconVariant: "selected" }
|
|
49
48
|
});
|
|
50
49
|
//#endregion
|
|
51
|
-
export { checkbox,
|
|
50
|
+
export { checkbox, checkboxIcon, checkboxIndicatorClass, checkboxTypography };
|