@povio/ui 2.3.0 → 2.3.2-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/icons/AlignCenter.js +26 -11
- package/dist/assets/icons/AlignLeft.js +26 -11
- package/dist/assets/icons/AlignLeftRight.js +26 -11
- package/dist/assets/icons/AlignRight.js +26 -11
- package/dist/assets/icons/ArrowDropDown.js +26 -11
- package/dist/assets/icons/ArrowDropUp.js +26 -11
- package/dist/assets/icons/ArrowLeft.js +26 -11
- package/dist/assets/icons/ArrowRight.js +26 -11
- package/dist/assets/icons/Bold.js +26 -11
- package/dist/assets/icons/BulletedList.js +26 -11
- package/dist/assets/icons/Calendar.js +28 -13
- package/dist/assets/icons/Check.js +28 -13
- package/dist/assets/icons/CheckCircle.js +26 -11
- package/dist/assets/icons/CheckboxCheckmark.js +29 -14
- package/dist/assets/icons/CheckboxIndeterminate.js +29 -14
- package/dist/assets/icons/ChevronDown.js +28 -13
- package/dist/assets/icons/ChevronLeft.js +28 -13
- package/dist/assets/icons/ChevronRight.js +28 -13
- package/dist/assets/icons/ChevronUp.js +28 -13
- package/dist/assets/icons/ChevronsLeft.js +28 -13
- package/dist/assets/icons/ChevronsRight.js +28 -13
- package/dist/assets/icons/Clock.js +26 -11
- package/dist/assets/icons/Close.js +26 -11
- package/dist/assets/icons/DateTime.js +35 -14
- package/dist/assets/icons/DragIndicator.js +26 -11
- package/dist/assets/icons/File.js +28 -13
- package/dist/assets/icons/Highlight.js +26 -11
- package/dist/assets/icons/HighlightOn.js +49 -15
- package/dist/assets/icons/Home.js +26 -11
- package/dist/assets/icons/Info.js +37 -16
- package/dist/assets/icons/Italic.js +26 -11
- package/dist/assets/icons/Link.js +26 -11
- package/dist/assets/icons/Menu.js +26 -11
- package/dist/assets/icons/NumberedList.js +26 -11
- package/dist/assets/icons/PointerHorizontal.js +26 -11
- package/dist/assets/icons/PointerVertical.js +26 -11
- package/dist/assets/icons/Search.js +26 -11
- package/dist/assets/icons/Send.js +28 -13
- package/dist/assets/icons/Strikethrough.js +26 -11
- package/dist/assets/icons/TextColor.js +48 -14
- package/dist/assets/icons/Today.js +26 -11
- package/dist/assets/icons/Underlined.js +28 -13
- package/dist/assets/icons/Upload.js +35 -14
- package/dist/assets/icons/Visibility.js +26 -11
- package/dist/assets/icons/VisibilityOff.js +26 -11
- package/dist/assets/icons/WarningFilled.js +28 -13
- package/dist/components/Breadcrumbs/Breadcrumbs.js +207 -56
- package/dist/components/Menu/Menu.js +18 -2
- package/dist/components/Menu/MenuDesktop.js +41 -7
- package/dist/components/Menu/MenuItem.js +32 -9
- package/dist/components/Menu/MenuMobile.js +97 -38
- package/dist/components/Menu/MenuPopover.js +105 -29
- package/dist/components/buttons/IconButton/IconButton.js +40 -8
- package/dist/components/buttons/InlineIconButton/InlineIconButton.d.ts +2 -1
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +34 -9
- package/dist/components/buttons/PillButton/PillButton.js +55 -17
- package/dist/components/buttons/SplitButton/SplitButton.js +103 -18
- package/dist/components/buttons/TextButton/TextButton.js +30 -8
- package/dist/components/buttons/ToggleButton/ToggleButton.js +28 -8
- package/dist/components/buttons/shared/ButtonContent.js +80 -22
- package/dist/components/inputs/Checkbox/Checkbox.d.ts +1 -0
- package/dist/components/inputs/Checkbox/Checkbox.js +201 -35
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +24 -10
- package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +3 -0
- package/dist/components/inputs/Checkbox/checkbox.cva.js +4 -1
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +11 -5
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +364 -76
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +11 -5
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +452 -167
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +12 -5
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +269 -57
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +6 -3
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +605 -130
- package/dist/components/inputs/DateTime/shared/Calendar.d.ts +5 -2
- package/dist/components/inputs/DateTime/shared/Calendar.js +332 -119
- package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +3 -2
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +301 -102
- package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +3 -2
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +146 -33
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +249 -93
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +318 -137
- package/dist/components/inputs/DateTime/shared/DateField.js +311 -112
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +12 -3
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +382 -138
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +15 -0
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +96 -11
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +81 -27
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +59 -10
- package/dist/components/inputs/DateTime/shared/MonthPicker.js +103 -58
- package/dist/components/inputs/DateTime/shared/RangeCalendar.js +193 -82
- package/dist/components/inputs/DateTime/shared/TimeField.js +27 -8
- package/dist/components/inputs/DateTime/shared/TimePickerForm.js +279 -110
- package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +4 -1
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +210 -65
- package/dist/components/inputs/DateTime/shared/YearPicker.js +119 -68
- package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +4 -0
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +7 -0
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +13 -0
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +14 -0
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +117 -0
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.d.ts +2 -0
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.spec.d.ts +1 -0
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +39 -0
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +85 -0
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.spec.d.ts +1 -0
- package/dist/components/inputs/File/FileUpload.js +87 -44
- package/dist/components/inputs/File/FileUploadContainer.js +15 -7
- package/dist/components/inputs/File/InputUpload.js +317 -79
- package/dist/components/inputs/File/shared/FileCard.js +104 -41
- package/dist/components/inputs/File/shared/FileCardList.js +47 -12
- package/dist/components/inputs/File/shared/FileUploadContent.js +175 -44
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +149 -46
- package/dist/components/inputs/File/shared/FileUploadContentError.js +234 -93
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +230 -97
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +199 -55
- package/dist/components/inputs/File/shared/InputUploadContent.js +148 -34
- package/dist/components/inputs/File/shared/InputUploadFilled.js +50 -9
- package/dist/components/inputs/File/shared/ProgressBar.js +48 -9
- package/dist/components/inputs/FormField/FormField.d.ts +3 -3
- package/dist/components/inputs/FormField/FormField.js +119 -37
- package/dist/components/inputs/FormField/FormFieldError.js +25 -5
- package/dist/components/inputs/FormField/FormFieldHeader.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldHeader.js +81 -22
- package/dist/components/inputs/FormField/FormFieldHeaderClose.js +31 -7
- package/dist/components/inputs/FormField/FormFieldHelper.js +26 -6
- package/dist/components/inputs/FormField/FormFieldLabel.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldLabel.js +40 -9
- package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +6 -0
- package/dist/components/inputs/FormField/formFieldHeader.cva.js +11 -0
- package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +5 -2
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +450 -95
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.d.ts +45 -0
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +571 -0
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +35 -0
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +575 -0
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +48 -9
- package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +4 -0
- package/dist/components/inputs/Input/TextArea/TextArea.cva.js +5 -0
- package/dist/components/inputs/Input/TextArea/TextArea.js +305 -90
- package/dist/components/inputs/Input/TextInput/TextInput.d.ts +3 -1
- package/dist/components/inputs/Input/TextInput/TextInput.js +421 -91
- package/dist/components/inputs/Input/shared/InputContent.js +192 -59
- package/dist/components/inputs/Input/shared/numberStatic.utils.d.ts +1 -0
- package/dist/components/inputs/Input/shared/numberStatic.utils.js +7 -0
- package/dist/components/inputs/Inputs/Form.js +40 -11
- package/dist/components/inputs/Inputs/InputItem.d.ts +15 -21
- package/dist/components/inputs/Inputs/InputItem.js +69 -14
- package/dist/components/inputs/Inputs/Inputs.js +37 -11
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +3 -1
- package/dist/components/inputs/RadioGroup/RadioGroup.js +353 -60
- package/dist/components/inputs/RadioGroup/radio.cva.d.ts +17 -0
- package/dist/components/inputs/RadioGroup/radio.cva.js +42 -1
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +6 -2
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +213 -22
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +3 -18
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +34 -8
- package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +36 -0
- package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +14 -0
- package/dist/components/inputs/Selection/Select/QuerySelect.js +104 -0
- package/dist/components/inputs/Selection/Select/Select.d.ts +7 -3
- package/dist/components/inputs/Selection/Select/Select.js +224 -18
- package/dist/components/inputs/Selection/shared/SelectBase.d.ts +8 -1
- package/dist/components/inputs/Selection/shared/SelectBase.js +69 -18
- package/dist/components/inputs/Selection/shared/SelectDesktop.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +393 -138
- package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectInput.js +330 -116
- package/dist/components/inputs/Selection/shared/SelectInputTags.js +99 -25
- package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectListBox.js +164 -52
- package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +85 -35
- package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +69 -16
- package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +70 -21
- package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +58 -9
- package/dist/components/inputs/Selection/shared/SelectMobile.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectMobile.js +12 -5
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +9 -0
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +47 -0
- package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +7 -0
- package/dist/components/inputs/Selection/shared/querySelect.utils.js +24 -0
- package/dist/components/inputs/Selection/shared/select.context.d.ts +3 -2
- package/dist/components/inputs/Selection/shared/select.context.js +67 -36
- package/dist/components/inputs/Selection/shared/select.types.d.ts +3 -2
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +3 -0
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +5 -0
- package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +5 -0
- package/dist/components/inputs/Selection/shared/selectInput.cva.js +5 -0
- package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +23 -0
- package/dist/components/inputs/Selection/shared/staticSelect.utils.js +37 -0
- package/dist/components/inputs/Selection/shared/staticSelect.utils.spec.d.ts +1 -0
- package/dist/components/inputs/Selection/shared/useSelectItems.js +109 -49
- package/dist/components/inputs/Skeleton/InputFrame.d.ts +80 -0
- package/dist/components/inputs/Skeleton/InputFrame.js +528 -0
- package/dist/components/inputs/Slider/Slider.d.ts +2 -1
- package/dist/components/inputs/Slider/Slider.js +265 -75
- package/dist/components/inputs/TextEditor/TextEditor.d.ts +1 -0
- package/dist/components/inputs/TextEditor/TextEditor.js +447 -98
- package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +37 -11
- package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +102 -30
- package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +194 -45
- package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +88 -28
- package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +48 -14
- package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +66 -19
- package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +49 -15
- package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +92 -32
- package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +126 -54
- package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +141 -38
- package/dist/components/inputs/Toggle/Toggle.d.ts +1 -0
- package/dist/components/inputs/Toggle/Toggle.js +214 -37
- package/dist/components/inputs/Toggle/toggle.cva.d.ts +3 -0
- package/dist/components/inputs/Toggle/toggle.cva.js +4 -2
- package/dist/components/inputs/shared/CheckContent.d.ts +2 -1
- package/dist/components/inputs/shared/CheckContent.js +21 -11
- package/dist/components/inputs/shared/InputClear.d.ts +2 -1
- package/dist/components/inputs/shared/InputClear.js +89 -10
- package/dist/components/inputs/shared/StaticInput.d.ts +38 -0
- package/dist/components/inputs/shared/TooltipWrapper.js +50 -11
- package/dist/components/inputs/shared/input.cva.d.ts +10 -0
- package/dist/components/inputs/shared/input.cva.js +54 -14
- package/dist/components/inputs/shared/label.cva.js +2 -2
- package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +4 -0
- package/dist/components/inputs/shared/tooltipWrapper.cva.js +5 -0
- package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +14 -0
- package/dist/components/inputs/shared/useStaticInputHandoff.js +100 -0
- package/dist/components/navigation/Accordion/Accordion.js +69 -22
- package/dist/components/navigation/Accordion/AccordionItem.js +86 -41
- package/dist/components/navigation/Stepper/Stepper.js +67 -22
- package/dist/components/navigation/Stepper/StepperItem.js +104 -31
- package/dist/components/navigation/Stepper/StepperSeparator.js +23 -5
- package/dist/components/overlays/ActionModal/ActionModal.js +169 -35
- package/dist/components/overlays/BottomSheet/BottomSheet.js +122 -25
- package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +48 -8
- package/dist/components/overlays/Drawer/Drawer.js +62 -20
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +83 -27
- package/dist/components/overlays/Tooltip/Tooltip.js +137 -28
- package/dist/components/overlays/Tooltip/TooltipEllipsis.js +37 -12
- package/dist/components/segment/Segment.js +218 -57
- package/dist/components/segment/SegmentItem.js +67 -10
- package/dist/components/shared/pagination/Pagination.js +108 -22
- package/dist/components/shared/pagination/PaginationList.js +167 -64
- package/dist/components/status/Alert/Alert.js +97 -30
- package/dist/components/status/Loader/Loader.js +77 -22
- package/dist/components/status/Toast/Toast.js +21 -13
- package/dist/components/status/Toast/useToast.js +62 -57
- package/dist/components/table/ColumnConfig.js +158 -54
- package/dist/components/table/InfiniteTable.js +67 -16
- package/dist/components/table/PaginatedTable.js +84 -18
- package/dist/components/table/Table.js +28 -27
- package/dist/components/text/Link/Link.js +19 -7
- package/dist/components/text/Typography/Typography.js +23 -8
- package/dist/config/confirmation.context.js +1 -1
- package/dist/config/link.context.js +23 -9
- package/dist/config/router.context.js +42 -16
- package/dist/config/theme.context.js +98 -45
- package/dist/config/uiConfig.context.d.ts +21 -7
- package/dist/config/uiConfig.context.js +68 -15
- package/dist/config/uiStyle.context.d.ts +27 -4
- package/dist/config/uiStyle.context.js +15 -5
- package/dist/helpers/dynamicInputs.d.ts +5 -5
- package/dist/helpers/dynamicInputs.js +3 -0
- package/dist/hooks/useBreakpoint.js +16 -3
- package/dist/hooks/useDebounceCallback.js +51 -17
- package/dist/hooks/useFilters.js +125 -64
- package/dist/hooks/useForm.js +42 -8
- package/dist/hooks/useFormAutosave.js +101 -30
- package/dist/hooks/useIntersectionObserver.d.ts +1 -1
- package/dist/hooks/useIntersectionObserver.js +91 -24
- package/dist/hooks/useLocalStorage.js +43 -10
- package/dist/hooks/useLongPressRepeat.js +55 -20
- package/dist/hooks/usePagination.js +49 -19
- package/dist/hooks/useQueryAutocomplete.d.ts +14 -0
- package/dist/hooks/useQueryAutocomplete.js +57 -0
- package/dist/hooks/useScrollableListBox.js +37 -16
- package/dist/hooks/useSorting.js +69 -28
- package/dist/hooks/useStateAndRef.js +21 -7
- package/dist/hooks/useTableColumnConfig.js +124 -31
- package/dist/hooks/useTranslationMemo.js +25 -5
- package/dist/index.d.ts +7 -0
- package/dist/index.js +4 -2
- package/dist/tw-ui-plugin.js +8 -1
- package/dist/utils/date-time.utils.d.ts +38 -10
- package/dist/utils/date-time.utils.js +134 -22
- package/dist/utils/dom.utils.js +1 -1
- package/dist/utils/query.utils.d.ts +4 -0
- package/dist/utils/query.utils.js +8 -0
- package/package.json +1 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { FormFieldProps } from '../FormField/FormField';
|
|
3
|
+
import { TextInputProps } from '../Input/TextInput/TextInput';
|
|
4
|
+
import { InputSizeProps, InputVariantProps } from './input.cva';
|
|
5
|
+
import { TypographyVariantProps } from '../../text/Typography/typography.cva';
|
|
6
|
+
type StaticInputDataAttributes = {
|
|
7
|
+
dataDisabled?: boolean;
|
|
8
|
+
dataHasSearch?: boolean;
|
|
9
|
+
dataHasSelection?: boolean;
|
|
10
|
+
dataInvalid?: boolean;
|
|
11
|
+
dataIsDirty?: boolean;
|
|
12
|
+
dataIsDisabled?: boolean;
|
|
13
|
+
dataIsEmpty?: boolean;
|
|
14
|
+
dataIsFilled?: boolean;
|
|
15
|
+
dataIsRequired?: boolean;
|
|
16
|
+
};
|
|
17
|
+
interface StaticInputProps extends FormFieldProps {
|
|
18
|
+
onInteract: (shouldFocus: boolean) => void;
|
|
19
|
+
as?: TextInputProps["as"];
|
|
20
|
+
typographySize?: TypographyVariantProps["size"];
|
|
21
|
+
size?: InputSizeProps["size"];
|
|
22
|
+
variant?: InputVariantProps["variant"];
|
|
23
|
+
applyMinInputWidth?: boolean;
|
|
24
|
+
placeholder?: ReactNode;
|
|
25
|
+
showPlacholderIfFilled?: boolean;
|
|
26
|
+
displayValue?: ReactNode;
|
|
27
|
+
isEmpty?: boolean;
|
|
28
|
+
leadingVisual?: ReactNode;
|
|
29
|
+
leadingContent?: ReactNode;
|
|
30
|
+
leadingContentClassName?: string;
|
|
31
|
+
hasClearIcon?: boolean;
|
|
32
|
+
trailingContent?: ReactNode;
|
|
33
|
+
contentRowClassName?: string;
|
|
34
|
+
inputClassName?: string;
|
|
35
|
+
dataAttributes?: StaticInputDataAttributes;
|
|
36
|
+
}
|
|
37
|
+
export declare const StaticInput: ({ onInteract, as, typographySize, size, variant, applyMinInputWidth, placeholder, showPlacholderIfFilled, displayValue, isEmpty, leadingVisual, leadingContent, leadingContentClassName, hasClearIcon, trailingContent, contentRowClassName, inputClassName, dataAttributes, className, ...formFieldProps }: StaticInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
export {};
|
|
@@ -1,21 +1,60 @@
|
|
|
1
|
+
import { UIStyle } from "../../../config/uiStyle.context.js";
|
|
1
2
|
import { Tooltip } from "../../overlays/Tooltip/Tooltip.js";
|
|
3
|
+
import { tooltipWrapperTrigger } from "./tooltipWrapper.cva.js";
|
|
4
|
+
import { c } from "react/compiler-runtime";
|
|
2
5
|
import { jsx } from "react/jsx-runtime";
|
|
3
6
|
//#region src/components/inputs/shared/TooltipWrapper.tsx
|
|
4
7
|
var TooltipWrapper = (props) => {
|
|
8
|
+
const $ = c(14);
|
|
9
|
+
const tooltipWrapperTriggerCva = UIStyle.useCva("tooltipWrapper.triggerCva", tooltipWrapperTrigger);
|
|
5
10
|
if (props.as !== "inline") return props.children;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
const t0 = props.error || void 0;
|
|
12
|
+
const t1 = !props.error;
|
|
13
|
+
let t2;
|
|
14
|
+
if ($[0] !== props.triggerClassName || $[1] !== tooltipWrapperTriggerCva) {
|
|
15
|
+
t2 = tooltipWrapperTriggerCva({ className: props.triggerClassName });
|
|
16
|
+
$[0] = props.triggerClassName;
|
|
17
|
+
$[1] = tooltipWrapperTriggerCva;
|
|
18
|
+
$[2] = t2;
|
|
19
|
+
} else t2 = $[2];
|
|
20
|
+
const t3 = props.triggerTabIndex;
|
|
21
|
+
let t4;
|
|
22
|
+
if ($[3] !== tooltipWrapperTriggerCva) {
|
|
23
|
+
t4 = tooltipWrapperTriggerCva({});
|
|
24
|
+
$[3] = tooltipWrapperTriggerCva;
|
|
25
|
+
$[4] = t4;
|
|
26
|
+
} else t4 = $[4];
|
|
27
|
+
let t5;
|
|
28
|
+
if ($[5] !== props.children || $[6] !== t4) {
|
|
29
|
+
t5 = /* @__PURE__ */ jsx("div", {
|
|
15
30
|
tabIndex: -1,
|
|
31
|
+
className: t4,
|
|
16
32
|
children: props.children
|
|
17
|
-
})
|
|
18
|
-
|
|
33
|
+
});
|
|
34
|
+
$[5] = props.children;
|
|
35
|
+
$[6] = t4;
|
|
36
|
+
$[7] = t5;
|
|
37
|
+
} else t5 = $[7];
|
|
38
|
+
let t6;
|
|
39
|
+
if ($[8] !== props.triggerTabIndex || $[9] !== t0 || $[10] !== t1 || $[11] !== t2 || $[12] !== t5) {
|
|
40
|
+
t6 = /* @__PURE__ */ jsx(Tooltip, {
|
|
41
|
+
text: t0,
|
|
42
|
+
placement: "bottom",
|
|
43
|
+
color: "error",
|
|
44
|
+
hidden: t1,
|
|
45
|
+
isNonInteractiveTrigger: true,
|
|
46
|
+
triggerClassName: t2,
|
|
47
|
+
triggerTabIndex: t3,
|
|
48
|
+
children: t5
|
|
49
|
+
});
|
|
50
|
+
$[8] = props.triggerTabIndex;
|
|
51
|
+
$[9] = t0;
|
|
52
|
+
$[10] = t1;
|
|
53
|
+
$[11] = t2;
|
|
54
|
+
$[12] = t5;
|
|
55
|
+
$[13] = t6;
|
|
56
|
+
} else t6 = $[13];
|
|
57
|
+
return t6;
|
|
19
58
|
};
|
|
20
59
|
//#endregion
|
|
21
60
|
export { TooltipWrapper };
|
|
@@ -12,6 +12,16 @@ export declare const inputSize: (props?: ({
|
|
|
12
12
|
} & ClassProp) | undefined) => string;
|
|
13
13
|
export interface InputSizeProps extends VariantProps<typeof inputSize> {
|
|
14
14
|
}
|
|
15
|
+
export declare const inputContentWrapper: (props?: ({
|
|
16
|
+
as?: "filter" | "default" | "floating" | "inline" | null | undefined;
|
|
17
|
+
} & ClassProp) | undefined) => string;
|
|
18
|
+
export interface InputContentWrapperProps extends VariantProps<typeof inputContentWrapper> {
|
|
19
|
+
}
|
|
20
|
+
export declare const inputClearClass: (props?: ({
|
|
21
|
+
as?: "filter" | "default" | "floating" | "inline" | null | undefined;
|
|
22
|
+
} & ClassProp) | undefined) => string;
|
|
23
|
+
export interface InputClearClassProps extends VariantProps<typeof inputClearClass> {
|
|
24
|
+
}
|
|
15
25
|
export declare const inputSide: (props?: ({
|
|
16
26
|
size?: "small" | "default" | "extra-small" | "large" | null | undefined;
|
|
17
27
|
type?: "left" | "right" | "var" | null | undefined;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { UIStyle } from "../../../config/uiStyle.context.js";
|
|
2
2
|
import { uiOutlineClass } from "../../outline.clsx.js";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
3
4
|
import { clsx } from "clsx";
|
|
4
5
|
import { cva } from "class-variance-authority";
|
|
5
6
|
//#region src/components/inputs/shared/input.cva.ts
|
|
@@ -35,9 +36,11 @@ var inputBase = cva([uiOutlineClass, "flex w-full not-[textarea]:truncate"], {
|
|
|
35
36
|
"focus-within:border-input-outlined-outline-active focus-within:border-solid focus-within:bg-input-outlined-active focus-within:text-text-default-1",
|
|
36
37
|
"invalid:border-input-outlined-outline-error invalid:border-solid invalid:bg-input-outlined-error invalid:text-text-default-1",
|
|
37
38
|
"has-invalid:border-input-outlined-outline-error has-invalid:border-solid has-invalid:bg-input-outlined-error has-invalid:text-text-default-1",
|
|
38
|
-
"disabled:border-input-outlined-outline-disabled disabled:border-solid disabled:bg-input-outlined-disabled disabled:text-text-default-
|
|
39
|
-
"has-disabled:border-input-outlined-outline-disabled has-disabled:border-solid has-disabled:bg-input-outlined-disabled has-disabled:text-text-default-
|
|
39
|
+
"disabled:border-input-outlined-outline-disabled disabled:border-solid disabled:bg-input-outlined-disabled disabled:text-text-default-3",
|
|
40
|
+
"has-disabled:border-input-outlined-outline-disabled has-disabled:border-solid has-disabled:bg-input-outlined-disabled has-disabled:text-text-default-3",
|
|
40
41
|
"placeholder:text-text-default-3",
|
|
42
|
+
"disabled:placeholder:text-interactive-text-secondary-disabled",
|
|
43
|
+
"has-disabled:placeholder:text-interactive-text-secondary-disabled",
|
|
41
44
|
"focus-visible:outline-interactive-contained-primary-focus",
|
|
42
45
|
"has-focus-visible:outline-interactive-contained-primary-focus"
|
|
43
46
|
]
|
|
@@ -51,9 +54,11 @@ var inputBase = cva([uiOutlineClass, "flex w-full not-[textarea]:truncate"], {
|
|
|
51
54
|
"focus-within:border-input-filled-outline-active focus-within:border-solid focus-within:bg-input-filled-active focus-within:text-text-default-1",
|
|
52
55
|
"invalid:border-input-filled-outline-error invalid:border-solid invalid:bg-input-filled-error invalid:text-text-default-1",
|
|
53
56
|
"has-invalid:border-input-filled-outline-error has-invalid:border-solid has-invalid:bg-input-filled-error has-invalid:text-text-default-1",
|
|
54
|
-
"disabled:bg-input-filled-disabled disabled:text-text-default-
|
|
55
|
-
"has-disabled:bg-input-filled-disabled has-disabled:text-text-default-
|
|
57
|
+
"disabled:bg-input-filled-disabled disabled:text-text-default-3",
|
|
58
|
+
"has-disabled:bg-input-filled-disabled has-disabled:text-text-default-3",
|
|
56
59
|
"placeholder:text-text-default-3",
|
|
60
|
+
"disabled:placeholder:text-interactive-text-secondary-disabled",
|
|
61
|
+
"has-disabled:placeholder:text-interactive-text-secondary-disabled",
|
|
57
62
|
"focus-visible:outline-interactive-contained-primary-focus",
|
|
58
63
|
"has-focus-visible:outline-interactive-contained-primary-focus"
|
|
59
64
|
]
|
|
@@ -67,9 +72,11 @@ var inputBase = cva([uiOutlineClass, "flex w-full not-[textarea]:truncate"], {
|
|
|
67
72
|
"focus-within:border-input-outlined-outline-active focus-within:border-solid focus-within:bg-input-outlined-active focus-within:text-text-default-1",
|
|
68
73
|
"invalid:border-input-outlined-outline-error invalid:border-solid invalid:bg-input-outlined-error invalid:text-text-default-1",
|
|
69
74
|
"has-invalid:border-input-outlined-outline-error has-invalid:border-solid has-invalid:bg-input-outlined-error has-invalid:text-text-default-1",
|
|
70
|
-
"disabled:border-input-outlined-outline-disabled disabled:border-solid disabled:bg-input-outlined-disabled disabled:text-text-default-
|
|
71
|
-
"has-disabled:border-input-outlined-outline-disabled has-disabled:border-solid has-disabled:bg-input-outlined-disabled has-disabled:text-text-default-
|
|
75
|
+
"disabled:border-input-outlined-outline-disabled disabled:border-solid disabled:bg-input-outlined-disabled disabled:text-text-default-3",
|
|
76
|
+
"has-disabled:border-input-outlined-outline-disabled has-disabled:border-solid has-disabled:bg-input-outlined-disabled has-disabled:text-text-default-3",
|
|
72
77
|
"placeholder:text-text-default-3",
|
|
78
|
+
"disabled:placeholder:text-interactive-text-secondary-disabled",
|
|
79
|
+
"has-disabled:placeholder:text-interactive-text-secondary-disabled",
|
|
73
80
|
"focus-visible:outline-interactive-contained-primary-focus",
|
|
74
81
|
"has-focus-visible:outline-interactive-contained-primary-focus"
|
|
75
82
|
]
|
|
@@ -83,9 +90,11 @@ var inputBase = cva([uiOutlineClass, "flex w-full not-[textarea]:truncate"], {
|
|
|
83
90
|
"focus-within:border-input-outlined-outline-active focus-within:border-solid focus-within:bg-input-outlined-idle focus-within:text-text-default-1",
|
|
84
91
|
"invalid:border-input-filled-outline-error invalid:border-solid invalid:bg-input-filled-error invalid:text-text-default-1",
|
|
85
92
|
"has-invalid:border-input-filled-outline-error has-invalid:border-solid has-invalid:bg-input-filled-error has-invalid:text-text-default-1",
|
|
86
|
-
"disabled:bg-input-filled-disabled disabled:text-text-default-
|
|
87
|
-
"has-disabled:bg-input-filled-disabled has-disabled:text-text-default-
|
|
93
|
+
"disabled:bg-input-filled-disabled disabled:text-text-default-3",
|
|
94
|
+
"has-disabled:bg-input-filled-disabled has-disabled:text-text-default-3",
|
|
88
95
|
"placeholder:text-text-default-3",
|
|
96
|
+
"disabled:placeholder:text-interactive-text-secondary-disabled",
|
|
97
|
+
"has-disabled:placeholder:text-interactive-text-secondary-disabled",
|
|
89
98
|
"focus-visible:outline-interactive-contained-primary-focus",
|
|
90
99
|
"has-focus-visible:outline-interactive-contained-primary-focus"
|
|
91
100
|
]
|
|
@@ -99,9 +108,11 @@ var inputBase = cva([uiOutlineClass, "flex w-full not-[textarea]:truncate"], {
|
|
|
99
108
|
"focus-within:border-input-outlined-outline-active focus-within:border-solid focus-within:bg-input-outlined-active focus-within:text-text-default-1",
|
|
100
109
|
"invalid:border-input-outlined-outline-error invalid:border-solid invalid:bg-input-outlined-error invalid:text-text-default-1",
|
|
101
110
|
"has-invalid:border-input-outlined-outline-error has-invalid:border-solid has-invalid:bg-input-outlined-error has-invalid:text-text-default-1",
|
|
102
|
-
"disabled:border-input-outlined-outline-disabled disabled:border-solid disabled:bg-input-outlined-disabled disabled:text-text-default-
|
|
103
|
-
"has-disabled:border-input-outlined-outline-disabled has-disabled:border-solid has-disabled:bg-input-outlined-disabled has-disabled:text-text-default-
|
|
111
|
+
"disabled:border-input-outlined-outline-disabled disabled:border-solid disabled:bg-input-outlined-disabled disabled:text-text-default-3",
|
|
112
|
+
"has-disabled:border-input-outlined-outline-disabled has-disabled:border-solid has-disabled:bg-input-outlined-disabled has-disabled:text-text-default-3",
|
|
104
113
|
"placeholder:text-text-default-3",
|
|
114
|
+
"disabled:placeholder:text-interactive-text-secondary-disabled",
|
|
115
|
+
"has-disabled:placeholder:text-interactive-text-secondary-disabled",
|
|
105
116
|
"focus-visible:outline-interactive-contained-primary-focus",
|
|
106
117
|
"has-focus-visible:outline-interactive-contained-primary-focus"
|
|
107
118
|
]
|
|
@@ -118,6 +129,8 @@ var inputBase = cva([uiOutlineClass, "flex w-full not-[textarea]:truncate"], {
|
|
|
118
129
|
"disabled:bg-input-filled-disabled disabled:text-text-default-1",
|
|
119
130
|
"has-disabled:bg-input-filled-disabled has-disabled:text-text-default-1",
|
|
120
131
|
"placeholder:text-text-default-3",
|
|
132
|
+
"disabled:placeholder:text-interactive-text-secondary-disabled",
|
|
133
|
+
"has-disabled:placeholder:text-interactive-text-secondary-disabled",
|
|
121
134
|
"focus-visible:outline-interactive-contained-primary-focus",
|
|
122
135
|
"has-focus-visible:outline-interactive-contained-primary-focus"
|
|
123
136
|
]
|
|
@@ -191,6 +204,24 @@ var inputSize = cva("", {
|
|
|
191
204
|
as: "default"
|
|
192
205
|
}
|
|
193
206
|
});
|
|
207
|
+
var inputContentWrapper = cva("flex w-full", {
|
|
208
|
+
variants: { as: {
|
|
209
|
+
default: "",
|
|
210
|
+
floating: "flex-col",
|
|
211
|
+
filter: "gap-input-gap-input-text-to-elements",
|
|
212
|
+
inline: ""
|
|
213
|
+
} },
|
|
214
|
+
defaultVariants: { as: "default" }
|
|
215
|
+
});
|
|
216
|
+
var inputClearClass = cva("", {
|
|
217
|
+
variants: { as: {
|
|
218
|
+
default: "",
|
|
219
|
+
floating: "",
|
|
220
|
+
filter: "",
|
|
221
|
+
inline: ""
|
|
222
|
+
} },
|
|
223
|
+
defaultVariants: { as: "default" }
|
|
224
|
+
});
|
|
194
225
|
var inputSide = cva("", {
|
|
195
226
|
variants: {
|
|
196
227
|
size: {
|
|
@@ -270,11 +301,20 @@ var inputSide = cva("", {
|
|
|
270
301
|
defaultVariants: { size: "default" }
|
|
271
302
|
});
|
|
272
303
|
var useInputCva = () => {
|
|
304
|
+
const $ = c(3);
|
|
273
305
|
const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
|
|
274
306
|
const inputSizeCva = UIStyle.useCva("input.sizeCva", inputSize);
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
307
|
+
let t0;
|
|
308
|
+
if ($[0] !== inputBaseCva || $[1] !== inputSizeCva) {
|
|
309
|
+
t0 = (t1) => {
|
|
310
|
+
const { className, ...rest } = t1;
|
|
311
|
+
return clsx(inputBaseCva(rest), inputSizeCva(rest), className);
|
|
312
|
+
};
|
|
313
|
+
$[0] = inputBaseCva;
|
|
314
|
+
$[1] = inputSizeCva;
|
|
315
|
+
$[2] = t0;
|
|
316
|
+
} else t0 = $[2];
|
|
317
|
+
return t0;
|
|
278
318
|
};
|
|
279
319
|
//#endregion
|
|
280
|
-
export { inputBase, inputSide, inputSize, useInputCva };
|
|
320
|
+
export { inputBase, inputClearClass, inputContentWrapper, inputSide, inputSize, useInputCva };
|
|
@@ -3,8 +3,8 @@ import { cva } from "class-variance-authority";
|
|
|
3
3
|
//#region src/components/inputs/shared/label.cva.ts
|
|
4
4
|
var labelBase = cva("", {
|
|
5
5
|
variants: { as: {
|
|
6
|
-
default: ["flex items-start gap-1 text-text-default-1"],
|
|
7
|
-
filter: ["text-text-default-1"],
|
|
6
|
+
default: ["flex items-start gap-1 text-text-default-1 input-disabled:text-text-default-3"],
|
|
7
|
+
filter: ["text-text-default-1 input-disabled:text-text-default-3"],
|
|
8
8
|
inline: ["flex items-start gap-1 text-text-default-1"],
|
|
9
9
|
floating: [
|
|
10
10
|
"pointer-events-none",
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
export declare const tooltipWrapperTrigger: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
|
|
3
|
+
export interface TooltipWrapperTriggerVariantProps extends VariantProps<typeof tooltipWrapperTrigger> {
|
|
4
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Dispatch, RefObject, SetStateAction } from 'react';
|
|
2
|
+
interface StaticInputHandoffOptions<TElement extends HTMLElement> {
|
|
3
|
+
inputRef: RefObject<TElement | null>;
|
|
4
|
+
renderInput: boolean;
|
|
5
|
+
setRenderInput: Dispatch<SetStateAction<boolean>>;
|
|
6
|
+
getFocusTarget?: (element: TElement) => HTMLElement | null | undefined;
|
|
7
|
+
}
|
|
8
|
+
export declare const useStaticInputHandoff: <TElement extends HTMLElement = HTMLInputElement>({ inputRef, renderInput, setRenderInput, getFocusTarget, }: StaticInputHandoffOptions<TElement>) => {
|
|
9
|
+
shouldFocus: boolean;
|
|
10
|
+
renderRealInput: (focus: boolean) => void;
|
|
11
|
+
replayStaticInputChange: (value: string) => void;
|
|
12
|
+
replayStaticInputPress: () => void;
|
|
13
|
+
};
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { c } from "react/compiler-runtime";
|
|
2
|
+
import { useLayoutEffect, useRef, useState } from "react";
|
|
3
|
+
//#region src/components/inputs/shared/useStaticInputHandoff.ts
|
|
4
|
+
var useStaticInputHandoff = (t0) => {
|
|
5
|
+
const $ = c(15);
|
|
6
|
+
const { inputRef, renderInput, setRenderInput, getFocusTarget } = t0;
|
|
7
|
+
const [shouldFocus, setShouldFocus] = useState(false);
|
|
8
|
+
const pendingStaticChangeRef = useRef(null);
|
|
9
|
+
const shouldReplayStaticPressRef = useRef(false);
|
|
10
|
+
let t1;
|
|
11
|
+
let t2;
|
|
12
|
+
if ($[0] !== getFocusTarget || $[1] !== inputRef || $[2] !== renderInput || $[3] !== shouldFocus) {
|
|
13
|
+
t1 = () => {
|
|
14
|
+
if (!renderInput || !shouldFocus) return;
|
|
15
|
+
const focusRealInput = (replayPendingInteraction) => {
|
|
16
|
+
const input = inputRef.current;
|
|
17
|
+
const pendingValue = pendingStaticChangeRef.current;
|
|
18
|
+
const focusTarget = input ? getFocusTarget?.(input) ?? input : null;
|
|
19
|
+
if (replayPendingInteraction && focusTarget instanceof HTMLInputElement && pendingValue != null) {
|
|
20
|
+
(Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value")?.set)?.call(focusTarget, pendingValue);
|
|
21
|
+
focusTarget.dispatchEvent(new Event("input", { bubbles: true }));
|
|
22
|
+
pendingStaticChangeRef.current = null;
|
|
23
|
+
}
|
|
24
|
+
focusTarget?.focus();
|
|
25
|
+
if (replayPendingInteraction && shouldReplayStaticPressRef.current) {
|
|
26
|
+
shouldReplayStaticPressRef.current = false;
|
|
27
|
+
focusTarget?.click();
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
focusRealInput(true);
|
|
31
|
+
const frame = requestAnimationFrame(() => {
|
|
32
|
+
focusRealInput(false);
|
|
33
|
+
setShouldFocus(false);
|
|
34
|
+
});
|
|
35
|
+
return () => {
|
|
36
|
+
cancelAnimationFrame(frame);
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
t2 = [
|
|
40
|
+
getFocusTarget,
|
|
41
|
+
inputRef,
|
|
42
|
+
renderInput,
|
|
43
|
+
shouldFocus
|
|
44
|
+
];
|
|
45
|
+
$[0] = getFocusTarget;
|
|
46
|
+
$[1] = inputRef;
|
|
47
|
+
$[2] = renderInput;
|
|
48
|
+
$[3] = shouldFocus;
|
|
49
|
+
$[4] = t1;
|
|
50
|
+
$[5] = t2;
|
|
51
|
+
} else {
|
|
52
|
+
t1 = $[4];
|
|
53
|
+
t2 = $[5];
|
|
54
|
+
}
|
|
55
|
+
useLayoutEffect(t1, t2);
|
|
56
|
+
let t3;
|
|
57
|
+
let t4;
|
|
58
|
+
let t5;
|
|
59
|
+
if ($[6] !== setRenderInput) {
|
|
60
|
+
t3 = (focus) => {
|
|
61
|
+
setShouldFocus(focus);
|
|
62
|
+
setRenderInput(true);
|
|
63
|
+
};
|
|
64
|
+
t4 = (value) => {
|
|
65
|
+
pendingStaticChangeRef.current = value;
|
|
66
|
+
setShouldFocus(true);
|
|
67
|
+
setRenderInput(true);
|
|
68
|
+
};
|
|
69
|
+
t5 = () => {
|
|
70
|
+
shouldReplayStaticPressRef.current = true;
|
|
71
|
+
setShouldFocus(true);
|
|
72
|
+
setRenderInput(true);
|
|
73
|
+
};
|
|
74
|
+
$[6] = setRenderInput;
|
|
75
|
+
$[7] = t3;
|
|
76
|
+
$[8] = t4;
|
|
77
|
+
$[9] = t5;
|
|
78
|
+
} else {
|
|
79
|
+
t3 = $[7];
|
|
80
|
+
t4 = $[8];
|
|
81
|
+
t5 = $[9];
|
|
82
|
+
}
|
|
83
|
+
let t6;
|
|
84
|
+
if ($[10] !== shouldFocus || $[11] !== t3 || $[12] !== t4 || $[13] !== t5) {
|
|
85
|
+
t6 = {
|
|
86
|
+
shouldFocus,
|
|
87
|
+
renderRealInput: t3,
|
|
88
|
+
replayStaticInputChange: t4,
|
|
89
|
+
replayStaticInputPress: t5
|
|
90
|
+
};
|
|
91
|
+
$[10] = shouldFocus;
|
|
92
|
+
$[11] = t3;
|
|
93
|
+
$[12] = t4;
|
|
94
|
+
$[13] = t5;
|
|
95
|
+
$[14] = t6;
|
|
96
|
+
} else t6 = $[14];
|
|
97
|
+
return t6;
|
|
98
|
+
};
|
|
99
|
+
//#endregion
|
|
100
|
+
export { useStaticInputHandoff };
|
|
@@ -1,34 +1,81 @@
|
|
|
1
1
|
import { UIStyle } from "../../../config/uiStyle.context.js";
|
|
2
2
|
import { accordionCva } from "./accordion.cva.js";
|
|
3
3
|
import { AccordionItem } from "./AccordionItem.js";
|
|
4
|
+
import { c } from "react/compiler-runtime";
|
|
4
5
|
import { jsx } from "react/jsx-runtime";
|
|
5
6
|
import { clsx } from "clsx";
|
|
6
7
|
import { DisclosureGroup } from "react-aria-components";
|
|
7
8
|
//#region src/components/navigation/Accordion/Accordion.tsx
|
|
8
|
-
var Accordion = (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
var Accordion = (t0) => {
|
|
10
|
+
const $ = c(23);
|
|
11
|
+
const { items, variant: t1, actionPosition: t2, allowsMultipleExpanded: t3, expandedKeys, defaultExpandedKeys, onExpandedChange, className, disabled } = t0;
|
|
12
|
+
const variant = t1 === void 0 ? "filled" : t1;
|
|
13
|
+
const actionPosition = t2 === void 0 ? "right" : t2;
|
|
14
|
+
const allowsMultipleExpanded = t3 === void 0 ? false : t3;
|
|
15
|
+
const accordionCva$1 = UIStyle.useCva("accordion.cva", accordionCva);
|
|
16
|
+
const t4 = items.length === 1;
|
|
17
|
+
let t5;
|
|
18
|
+
if ($[0] !== accordionCva$1 || $[1] !== className || $[2] !== t4 || $[3] !== variant) {
|
|
19
|
+
t5 = clsx(accordionCva$1({
|
|
15
20
|
className,
|
|
16
21
|
variant,
|
|
17
|
-
singleItem:
|
|
18
|
-
}))
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
singleItem: t4
|
|
23
|
+
}));
|
|
24
|
+
$[0] = accordionCva$1;
|
|
25
|
+
$[1] = className;
|
|
26
|
+
$[2] = t4;
|
|
27
|
+
$[3] = variant;
|
|
28
|
+
$[4] = t5;
|
|
29
|
+
} else t5 = $[4];
|
|
30
|
+
let t6;
|
|
31
|
+
if ($[5] !== actionPosition || $[6] !== disabled || $[7] !== items || $[8] !== variant) {
|
|
32
|
+
let t7;
|
|
33
|
+
if ($[10] !== actionPosition || $[11] !== disabled || $[12] !== items.length || $[13] !== variant) {
|
|
34
|
+
t7 = (item) => /* @__PURE__ */ jsx(AccordionItem, {
|
|
35
|
+
id: item.id,
|
|
36
|
+
heading: item.heading,
|
|
37
|
+
subheading: item.subheading,
|
|
38
|
+
icon: item.icon,
|
|
39
|
+
variant,
|
|
40
|
+
actionPosition,
|
|
41
|
+
disabled: item.disabled || disabled,
|
|
42
|
+
isSingle: items.length === 1,
|
|
43
|
+
children: item.children
|
|
44
|
+
}, item.id);
|
|
45
|
+
$[10] = actionPosition;
|
|
46
|
+
$[11] = disabled;
|
|
47
|
+
$[12] = items.length;
|
|
48
|
+
$[13] = variant;
|
|
49
|
+
$[14] = t7;
|
|
50
|
+
} else t7 = $[14];
|
|
51
|
+
t6 = items.map(t7);
|
|
52
|
+
$[5] = actionPosition;
|
|
53
|
+
$[6] = disabled;
|
|
54
|
+
$[7] = items;
|
|
55
|
+
$[8] = variant;
|
|
56
|
+
$[9] = t6;
|
|
57
|
+
} else t6 = $[9];
|
|
58
|
+
let t7;
|
|
59
|
+
if ($[15] !== allowsMultipleExpanded || $[16] !== defaultExpandedKeys || $[17] !== disabled || $[18] !== expandedKeys || $[19] !== onExpandedChange || $[20] !== t5 || $[21] !== t6) {
|
|
60
|
+
t7 = /* @__PURE__ */ jsx(DisclosureGroup, {
|
|
61
|
+
allowsMultipleExpanded,
|
|
62
|
+
expandedKeys,
|
|
63
|
+
defaultExpandedKeys,
|
|
64
|
+
onExpandedChange,
|
|
65
|
+
className: t5,
|
|
66
|
+
isDisabled: disabled,
|
|
67
|
+
children: t6
|
|
68
|
+
});
|
|
69
|
+
$[15] = allowsMultipleExpanded;
|
|
70
|
+
$[16] = defaultExpandedKeys;
|
|
71
|
+
$[17] = disabled;
|
|
72
|
+
$[18] = expandedKeys;
|
|
73
|
+
$[19] = onExpandedChange;
|
|
74
|
+
$[20] = t5;
|
|
75
|
+
$[21] = t6;
|
|
76
|
+
$[22] = t7;
|
|
77
|
+
} else t7 = $[22];
|
|
78
|
+
return t7;
|
|
32
79
|
};
|
|
33
80
|
//#endregion
|
|
34
81
|
export { Accordion };
|
|
@@ -2,10 +2,15 @@ import { ChevronDownIcon } from "../../../assets/icons/ChevronDown.js";
|
|
|
2
2
|
import { UIStyle } from "../../../config/uiStyle.context.js";
|
|
3
3
|
import { Typography } from "../../text/Typography/Typography.js";
|
|
4
4
|
import { accordionChevronCva, accordionHeadingCva, accordionHeadingSubtitleCva, accordionHeadingTitleCva, accordionIconCva, accordionItemCva, accordionPanelContentCva, accordionPanelCva, accordionTriggerCva } from "./accordion.cva.js";
|
|
5
|
+
import { c } from "react/compiler-runtime";
|
|
5
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
7
|
import { Button, Disclosure, DisclosurePanel, Heading } from "react-aria-components";
|
|
7
8
|
//#region src/components/navigation/Accordion/AccordionItem.tsx
|
|
8
|
-
var AccordionItem = (
|
|
9
|
+
var AccordionItem = (t0) => {
|
|
10
|
+
const $ = c(25);
|
|
11
|
+
const { id, disabled, heading, subheading, children, icon: Icon, variant: t1, actionPosition: t2, isSingle } = t0;
|
|
12
|
+
const variant = t1 === void 0 ? "filled" : t1;
|
|
13
|
+
const actionPosition = t2 === void 0 ? "right" : t2;
|
|
9
14
|
const itemCva = UIStyle.useCva("accordion.itemCva", accordionItemCva);
|
|
10
15
|
const triggerCva = UIStyle.useCva("accordion.triggerCva", accordionTriggerCva);
|
|
11
16
|
const headingCva = UIStyle.useCva("accordion.headingCva", accordionHeadingCva);
|
|
@@ -15,49 +20,89 @@ var AccordionItem = ({ id, disabled, heading, subheading, children, icon: Icon,
|
|
|
15
20
|
const iconCva = UIStyle.useCva("accordion.iconCva", accordionIconCva);
|
|
16
21
|
const panelCva = UIStyle.useCva("accordion.panelCva", accordionPanelCva);
|
|
17
22
|
const panelContentCva = UIStyle.useCva("accordion.panelContentCva", accordionPanelContentCva);
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
let t3;
|
|
24
|
+
if ($[0] !== isSingle || $[1] !== itemCva || $[2] !== variant) {
|
|
25
|
+
t3 = itemCva({
|
|
21
26
|
variant,
|
|
22
27
|
singleItem: isSingle
|
|
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
|
-
|
|
28
|
+
});
|
|
29
|
+
$[0] = isSingle;
|
|
30
|
+
$[1] = itemCva;
|
|
31
|
+
$[2] = variant;
|
|
32
|
+
$[3] = t3;
|
|
33
|
+
} else t3 = $[3];
|
|
34
|
+
let t4;
|
|
35
|
+
if ($[4] !== Icon || $[5] !== actionPosition || $[6] !== chevronCva || $[7] !== children || $[8] !== disabled || $[9] !== heading || $[10] !== headingCva || $[11] !== headingSubtitleCva || $[12] !== headingTitleCva || $[13] !== iconCva || $[14] !== panelContentCva || $[15] !== panelCva || $[16] !== subheading || $[17] !== triggerCva || $[18] !== variant) {
|
|
36
|
+
t4 = (t5) => {
|
|
37
|
+
const { isExpanded } = t5;
|
|
38
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Heading, { children: /* @__PURE__ */ jsxs(Button, {
|
|
39
|
+
slot: "trigger",
|
|
40
|
+
className: triggerCva({
|
|
41
|
+
variant,
|
|
42
|
+
actionPosition,
|
|
43
|
+
disabled
|
|
44
|
+
}),
|
|
45
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
46
|
+
className: headingCva({}),
|
|
47
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
48
|
+
className: "flex flex-1 items-center gap-accordion-gap-icon-to-text",
|
|
49
|
+
children: [
|
|
50
|
+
Icon && /* @__PURE__ */ jsx(Icon, { className: iconCva({}) }),
|
|
51
|
+
/* @__PURE__ */ jsx(Typography, {
|
|
52
|
+
size: "label-2",
|
|
53
|
+
variant: "default",
|
|
54
|
+
className: headingTitleCva({}),
|
|
55
|
+
children: heading
|
|
56
|
+
}),
|
|
57
|
+
subheading && /* @__PURE__ */ jsx(Typography, {
|
|
58
|
+
size: "label-3",
|
|
59
|
+
variant: "default",
|
|
60
|
+
className: headingSubtitleCva({}),
|
|
61
|
+
children: subheading
|
|
62
|
+
})
|
|
63
|
+
]
|
|
64
|
+
})
|
|
65
|
+
}), /* @__PURE__ */ jsx(ChevronDownIcon, { className: chevronCva({ isExpanded }) })]
|
|
66
|
+
}) }), /* @__PURE__ */ jsx(DisclosurePanel, {
|
|
67
|
+
className: panelCva({ isExpanded }),
|
|
68
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
69
|
+
className: panelContentCva({}),
|
|
70
|
+
children
|
|
51
71
|
})
|
|
52
|
-
})
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
72
|
+
})] });
|
|
73
|
+
};
|
|
74
|
+
$[4] = Icon;
|
|
75
|
+
$[5] = actionPosition;
|
|
76
|
+
$[6] = chevronCva;
|
|
77
|
+
$[7] = children;
|
|
78
|
+
$[8] = disabled;
|
|
79
|
+
$[9] = heading;
|
|
80
|
+
$[10] = headingCva;
|
|
81
|
+
$[11] = headingSubtitleCva;
|
|
82
|
+
$[12] = headingTitleCva;
|
|
83
|
+
$[13] = iconCva;
|
|
84
|
+
$[14] = panelContentCva;
|
|
85
|
+
$[15] = panelCva;
|
|
86
|
+
$[16] = subheading;
|
|
87
|
+
$[17] = triggerCva;
|
|
88
|
+
$[18] = variant;
|
|
89
|
+
$[19] = t4;
|
|
90
|
+
} else t4 = $[19];
|
|
91
|
+
let t5;
|
|
92
|
+
if ($[20] !== disabled || $[21] !== id || $[22] !== t3 || $[23] !== t4) {
|
|
93
|
+
t5 = /* @__PURE__ */ jsx(Disclosure, {
|
|
94
|
+
id,
|
|
95
|
+
className: t3,
|
|
96
|
+
isDisabled: disabled,
|
|
97
|
+
children: t4
|
|
98
|
+
});
|
|
99
|
+
$[20] = disabled;
|
|
100
|
+
$[21] = id;
|
|
101
|
+
$[22] = t3;
|
|
102
|
+
$[23] = t4;
|
|
103
|
+
$[24] = t5;
|
|
104
|
+
} else t5 = $[24];
|
|
105
|
+
return t5;
|
|
61
106
|
};
|
|
62
107
|
//#endregion
|
|
63
108
|
export { AccordionItem };
|