@povio/ui 3.0.0-rc.2 → 3.0.0-rc.3
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/components/inputs/DateTime/DatePicker/DatePicker.js +2 -2
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +2 -2
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +1 -0
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +5 -4
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +2 -1
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +126 -124
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +0 -11
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +3 -2
- package/dist/components/inputs/FormField/FormFieldHeader.js +2 -2
- package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +0 -9
- package/dist/components/inputs/FormField/formFieldHeader.cva.js +3 -2
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +4 -4
- package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +0 -4
- package/dist/components/inputs/Input/TextArea/TextArea.cva.js +3 -2
- package/dist/components/inputs/Input/TextArea/TextArea.js +2 -2
- package/dist/components/inputs/Input/shared/InputContent.js +2 -2
- package/dist/components/inputs/Inputs/InputItem.d.ts +1 -1
- package/dist/components/inputs/RadioGroup/RadioGroup.js +6 -6
- package/dist/components/inputs/RadioGroup/radio.cva.d.ts +0 -44
- package/dist/components/inputs/RadioGroup/radio.cva.js +3 -3
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +14 -11
- package/dist/components/inputs/Selection/Select/Select.js +3 -1
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +5 -5
- package/dist/components/inputs/Selection/shared/SelectInput.js +89 -87
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +2 -2
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +0 -4
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +3 -2
- package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +12 -5
- package/dist/components/inputs/Selection/shared/selectInput.cva.js +6 -3
- package/dist/components/inputs/Selection/shared/staticSelect.utils.js +25 -8
- package/dist/components/inputs/Skeleton/InputFrame.js +6 -6
- package/dist/components/inputs/shared/TooltipWrapper.js +2 -2
- package/dist/components/inputs/shared/input.cva.d.ts +0 -54
- package/dist/components/inputs/shared/input.cva.js +3 -5
- package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +0 -4
- package/dist/components/inputs/shared/tooltipWrapper.cva.js +3 -2
- package/dist/components/text/Typography/typography.cva.d.ts +0 -45
- package/dist/components/text/Typography/typography.cva.js +1 -2
- package/dist/config/uiOverrides.context.d.ts +1 -0
- package/dist/index.d.ts +8 -2
- package/dist/index.js +9 -3
- package/package.json +1 -1
|
@@ -14,7 +14,7 @@ declare const componentRegistry: {
|
|
|
14
14
|
readonly passwordInput: <TFieldValues extends import('react-hook-form').FieldValues>(props: import('../Input/PasswordInput/PasswordInput').ControlledPasswordInputProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
readonly textArea: <TFieldValues extends import('react-hook-form').FieldValues>(props: import('../Input/TextArea/TextArea').ControlledTextAreaProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
16
16
|
readonly select: typeof Select;
|
|
17
|
-
readonly querySelect: <TFieldValues extends import('react-hook-form').FieldValues, TQueryFn extends import('../Selection/shared/querySelect.utils').QueryFn, TKey extends import('react-aria').Key = import('react-aria').Key, TInitialSelectItem = import('../../..').DefaultInitialSelectItem<TKey>>(props: import('../Selection/Select/QuerySelect
|
|
17
|
+
readonly querySelect: <TFieldValues extends import('react-hook-form').FieldValues, TQueryFn extends import('../Selection/shared/querySelect.utils').QueryFn, TKey extends import('react-aria').Key = import('react-aria').Key, TInitialSelectItem = import('../../..').DefaultInitialSelectItem<TKey>>(props: import('../Selection/Select/QuerySelect').QuerySelectProps<TFieldValues, TQueryFn, TKey, TInitialSelectItem>) => import("react/jsx-runtime").JSX.Element;
|
|
18
18
|
readonly autocomplete: typeof Autocomplete;
|
|
19
19
|
readonly queryAutocomplete: <TFieldValues extends import('react-hook-form').FieldValues, TSelectItem extends import('../../..').SelectItem<any>, TQueryFn extends import('../Selection/Autocomplete/queryAutocomplete.types').QueryFn>(props: import('../Selection/Autocomplete/queryAutocomplete.types').QueryAutocompleteProps<TFieldValues, TSelectItem, TQueryFn>) => import("react/jsx-runtime").JSX.Element;
|
|
20
20
|
readonly segment: <TFieldValues extends import('react-hook-form').FieldValues, TKey extends import('react-aria').Key = import('react-aria').Key>(props: import('../../..').ControlledSegmentProps<TFieldValues, TKey>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,9 +2,9 @@ import { UIOverrides } from "../../../config/uiOverrides.context.js";
|
|
|
2
2
|
import { UIConfig } from "../../../config/uiConfig.context.js";
|
|
3
3
|
import { CheckContent } from "../shared/CheckContent.js";
|
|
4
4
|
import { FormFieldLabel } from "../FormField/FormFieldLabel.js";
|
|
5
|
-
import {
|
|
5
|
+
import { inputBaseDefinition, inputSizeDefinition } from "../shared/input.cva.js";
|
|
6
6
|
import { FormField } from "../FormField/FormField.js";
|
|
7
|
-
import { radioContentClassName,
|
|
7
|
+
import { radioContentClassName, radioContentRowDefinition, radioContentWrapperDefinition, radioDefinition, radioIndicatorClass, radioTypography } from "./radio.cva.js";
|
|
8
8
|
import { c } from "react/compiler-runtime";
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
import { clsx } from "clsx";
|
|
@@ -18,10 +18,10 @@ var RadioGroupBase = (props) => {
|
|
|
18
18
|
const ui = UIConfig.useConfig();
|
|
19
19
|
const radioCva = UIOverrides.useCva("radio.cva", radioDefinition);
|
|
20
20
|
const radioTypographyMap = UIOverrides.useMapper("radio.typography", radioTypography);
|
|
21
|
-
const radioContentWrapperCva = UIOverrides.useCva("radio.contentWrapperCva",
|
|
22
|
-
const radioContentRowCva = UIOverrides.useCva("radio.contentRowCva",
|
|
23
|
-
const inputBaseCva = UIOverrides.useCva("input.baseCva",
|
|
24
|
-
const inputSizeCva = UIOverrides.useCva("input.sizeCva",
|
|
21
|
+
const radioContentWrapperCva = UIOverrides.useCva("radio.contentWrapperCva", radioContentWrapperDefinition);
|
|
22
|
+
const radioContentRowCva = UIOverrides.useCva("radio.contentRowCva", radioContentRowDefinition);
|
|
23
|
+
const inputBaseCva = UIOverrides.useCva("input.baseCva", inputBaseDefinition);
|
|
24
|
+
const inputSizeCva = UIOverrides.useCva("input.sizeCva", inputSizeDefinition);
|
|
25
25
|
const radioContentClassNameMap = UIOverrides.useMapper("radio.contentClassName", radioContentClassName);
|
|
26
26
|
const { ref, label, tooltipText, helperText, isDirty, isRequired, rightContent, isDisabled, headerClassName, errorClassName, labelClassName, inputClassName, isHeaderHidden, error, className, options, value, defaultValue, onChange, onBlur, fireBlurOnChange: fireBlurOnChangeProp, as: asProp, size: sizeProp, variant: variantProp, hideLabel: hideLabelProp, ...rest } = props;
|
|
27
27
|
const as = asProp ?? ui.input.as;
|
|
@@ -11,14 +11,6 @@ export declare const radioDefinition: {
|
|
|
11
11
|
export type RadioConfig = NonNullable<typeof radioDefinition.config>;
|
|
12
12
|
export interface RadioVariantProps extends UIOverrides.VariantProps<RadioConfig> {
|
|
13
13
|
}
|
|
14
|
-
export declare const radio: {
|
|
15
|
-
base: string[];
|
|
16
|
-
config: import("../../../utils/style-merge.util").StyleMergeUtils.Config<{
|
|
17
|
-
readonly variant: {
|
|
18
|
-
readonly default: ["border-interactive-outlined-secondary-on-idle", "group-disabled:border-interactive-outlined-secondary-on-disabled", "group-hover:border-interactive-outlined-secondary-on-hover", "group-pressed:border-interactive-outlined-secondary-on-pressed", "group-selected:border-interactive-contained-primary-idle", "group-selected:bg-interactive-contained-primary-idle", "group-selected:group-disabled:bg-interactive-contained-primary-disabled", "group-selected:group-disabled:border-interactive-contained-primary-disabled", "group-invalid:border-interactive-outlined-error-on-idle", "group-focus-visible:outline-interactive-contained-primary-focus", "before:bg-interactive-contained-primary-on-idle", "group-hover:before:bg-interactive-contained-primary-on-hover", "group-selected:before:block"];
|
|
19
|
-
};
|
|
20
|
-
}>;
|
|
21
|
-
};
|
|
22
14
|
export declare const radioContentWrapperDefinition: {
|
|
23
15
|
base: string[];
|
|
24
16
|
config: import("../../../utils/style-merge.util").StyleMergeUtils.Config<{
|
|
@@ -37,24 +29,6 @@ export declare const radioContentWrapperDefinition: {
|
|
|
37
29
|
};
|
|
38
30
|
}>;
|
|
39
31
|
};
|
|
40
|
-
export declare const radioContentWrapper: {
|
|
41
|
-
base: string[];
|
|
42
|
-
config: import("../../../utils/style-merge.util").StyleMergeUtils.Config<{
|
|
43
|
-
readonly variant: {
|
|
44
|
-
readonly default: "";
|
|
45
|
-
};
|
|
46
|
-
readonly as: {
|
|
47
|
-
readonly default: "flex-col";
|
|
48
|
-
readonly floating: "flex-col";
|
|
49
|
-
readonly filter: "flex-row flex-wrap items-center gap-2";
|
|
50
|
-
readonly inline: "flex-row flex-wrap items-center gap-2";
|
|
51
|
-
};
|
|
52
|
-
readonly hasInputFrame: {
|
|
53
|
-
readonly true: "gap-2";
|
|
54
|
-
readonly false: "";
|
|
55
|
-
};
|
|
56
|
-
}>;
|
|
57
|
-
};
|
|
58
32
|
export type RadioContentWrapperConfig = NonNullable<typeof radioContentWrapperDefinition.config>;
|
|
59
33
|
export interface RadioContentWrapperVariantProps extends UIOverrides.VariantProps<RadioContentWrapperConfig> {
|
|
60
34
|
}
|
|
@@ -76,24 +50,6 @@ export declare const radioContentRowDefinition: {
|
|
|
76
50
|
};
|
|
77
51
|
}>;
|
|
78
52
|
};
|
|
79
|
-
export declare const radioContentRow: {
|
|
80
|
-
base: string[];
|
|
81
|
-
config: import("../../../utils/style-merge.util").StyleMergeUtils.Config<{
|
|
82
|
-
readonly variant: {
|
|
83
|
-
readonly default: "";
|
|
84
|
-
};
|
|
85
|
-
readonly as: {
|
|
86
|
-
readonly default: "flex-col";
|
|
87
|
-
readonly floating: "flex-col";
|
|
88
|
-
readonly filter: "flex-row flex-wrap items-center gap-2";
|
|
89
|
-
readonly inline: "flex-row flex-wrap items-center gap-2";
|
|
90
|
-
};
|
|
91
|
-
readonly hasInputFrame: {
|
|
92
|
-
readonly true: "gap-2";
|
|
93
|
-
readonly false: "";
|
|
94
|
-
};
|
|
95
|
-
}>;
|
|
96
|
-
};
|
|
97
53
|
export type RadioContentRowConfig = NonNullable<typeof radioContentRowDefinition.config>;
|
|
98
54
|
export interface RadioContentRowVariantProps extends UIOverrides.VariantProps<RadioContentRowConfig> {
|
|
99
55
|
}
|
|
@@ -28,7 +28,7 @@ var radioDefinition = UIOverrides.defineConfig({
|
|
|
28
28
|
defaultVariants: { variant: "default" }
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
|
-
var
|
|
31
|
+
var radioContentWrapperDefinition = UIOverrides.defineConfig({
|
|
32
32
|
base: ["relative flex"],
|
|
33
33
|
config: {
|
|
34
34
|
variants: {
|
|
@@ -51,7 +51,7 @@ var radioContentWrapper = UIOverrides.defineConfig({
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
|
-
var
|
|
54
|
+
var radioContentRowDefinition = UIOverrides.defineConfig({
|
|
55
55
|
base: ["flex"],
|
|
56
56
|
config: {
|
|
57
57
|
variants: {
|
|
@@ -82,4 +82,4 @@ var radioTypography = compoundMapper({ default: {
|
|
|
82
82
|
} });
|
|
83
83
|
var radioContentClassName = compoundMapper({ default: "text-text-default-2" });
|
|
84
84
|
//#endregion
|
|
85
|
-
export { radioContentClassName,
|
|
85
|
+
export { radioContentClassName, radioContentRowDefinition, radioContentWrapperDefinition, radioDefinition, radioIndicatorClass, radioTypography };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
1
2
|
import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
2
3
|
import { InputFrame } from "../../Skeleton/InputFrame.js";
|
|
3
4
|
import { useStaticInputHandoff } from "../../shared/useStaticInputHandoff.js";
|
|
4
|
-
import {
|
|
5
|
+
import { selectInputTagsContentWrapperDefinition } from "../shared/selectInput.cva.js";
|
|
5
6
|
import { SelectBase } from "../shared/SelectBase.js";
|
|
6
7
|
import { StaticSelectTrailingContent } from "../shared/StaticSelectTrailingContent.js";
|
|
7
8
|
import { getStaticSelectValue } from "../shared/staticSelect.utils.js";
|
|
@@ -13,9 +14,10 @@ import { mergeRefs } from "@react-aria/utils";
|
|
|
13
14
|
import { Controller } from "react-hook-form";
|
|
14
15
|
//#region src/components/inputs/Selection/Autocomplete/Autocomplete.tsx
|
|
15
16
|
function AutocompleteInner(t0) {
|
|
16
|
-
const $ = c(
|
|
17
|
+
const $ = c(8);
|
|
17
18
|
const { renderStaticInput, isFormControlDisabled, ...props } = t0;
|
|
18
19
|
const ui = UIConfig.useConfig();
|
|
20
|
+
const selectInputTagsContentWrapperCva = UIOverrides.useCva("select.tagsContentWrapperCva", selectInputTagsContentWrapperDefinition);
|
|
19
21
|
const [renderInput, setRenderInput] = useState(!(renderStaticInput ?? ui.renderStaticInput));
|
|
20
22
|
const rootRef = useRef(null);
|
|
21
23
|
let t1;
|
|
@@ -74,10 +76,11 @@ function AutocompleteInner(t0) {
|
|
|
74
76
|
const t3 = clsx("w-full", props.containerClassName);
|
|
75
77
|
const t4 = clsx(props.className, props.inputClassName);
|
|
76
78
|
let t5;
|
|
77
|
-
if ($[2]
|
|
79
|
+
if ($[2] !== selectInputTagsContentWrapperCva) {
|
|
78
80
|
t5 = selectInputTagsContentWrapperCva({ isSearchable: true });
|
|
79
|
-
$[2] =
|
|
80
|
-
|
|
81
|
+
$[2] = selectInputTagsContentWrapperCva;
|
|
82
|
+
$[3] = t5;
|
|
83
|
+
} else t5 = $[3];
|
|
81
84
|
return /* @__PURE__ */ jsx(InputFrame, {
|
|
82
85
|
...props,
|
|
83
86
|
isDisabled: t2,
|
|
@@ -115,17 +118,17 @@ function AutocompleteInner(t0) {
|
|
|
115
118
|
const T0 = SelectBase;
|
|
116
119
|
const t2 = mergeRefs(props.ref, rootRef);
|
|
117
120
|
let t3;
|
|
118
|
-
if ($[
|
|
121
|
+
if ($[4] !== T0 || $[5] !== props || $[6] !== t2) {
|
|
119
122
|
t3 = /* @__PURE__ */ jsx(T0, {
|
|
120
123
|
...props,
|
|
121
124
|
ref: t2,
|
|
122
125
|
isSearchable: true
|
|
123
126
|
});
|
|
124
|
-
$[
|
|
125
|
-
$[
|
|
126
|
-
$[
|
|
127
|
-
$[
|
|
128
|
-
} else t3 = $[
|
|
127
|
+
$[4] = T0;
|
|
128
|
+
$[5] = props;
|
|
129
|
+
$[6] = t2;
|
|
130
|
+
$[7] = t3;
|
|
131
|
+
} else t3 = $[7];
|
|
129
132
|
return t3;
|
|
130
133
|
}
|
|
131
134
|
function _temp(root) {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
1
2
|
import { Typography } from "../../../text/Typography/Typography.js";
|
|
2
3
|
import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
3
4
|
import { InputFrame } from "../../Skeleton/InputFrame.js";
|
|
4
5
|
import { useStaticInputHandoff } from "../../shared/useStaticInputHandoff.js";
|
|
5
|
-
import {
|
|
6
|
+
import { selectInputTagsContentWrapperDefinition } from "../shared/selectInput.cva.js";
|
|
6
7
|
import { SelectBase } from "../shared/SelectBase.js";
|
|
7
8
|
import { StaticSelectTrailingContent } from "../shared/StaticSelectTrailingContent.js";
|
|
8
9
|
import { getStaticSelectValue } from "../shared/staticSelect.utils.js";
|
|
@@ -17,6 +18,7 @@ function SelectInner(t0) {
|
|
|
17
18
|
const $ = c(6);
|
|
18
19
|
const { renderStaticInput, isFormControlDisabled, ...props } = t0;
|
|
19
20
|
const ui = UIConfig.useConfig();
|
|
21
|
+
const selectInputTagsContentWrapperCva = UIOverrides.useCva("select.tagsContentWrapperCva", selectInputTagsContentWrapperDefinition);
|
|
20
22
|
const [renderInput, setRenderInput] = useState(!(renderStaticInput ?? ui.renderStaticInput));
|
|
21
23
|
const rootRef = useRef(null);
|
|
22
24
|
let t1;
|
|
@@ -6,7 +6,7 @@ import "./useSelectItems.js";
|
|
|
6
6
|
import { SelectContext } from "./select.context.js";
|
|
7
7
|
import { SelectInput } from "./SelectInput.js";
|
|
8
8
|
import { SelectListBox } from "./SelectListBox.js";
|
|
9
|
-
import {
|
|
9
|
+
import { selectPopoverDefinition } from "./selectDesktop.cva.js";
|
|
10
10
|
import { c } from "react/compiler-runtime";
|
|
11
11
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
12
|
import { clsx } from "clsx";
|
|
@@ -63,7 +63,7 @@ var SelectDesktop = (t0) => {
|
|
|
63
63
|
}
|
|
64
64
|
const { label, tooltipText, helperText, isDirty, isRequired, rightContent, isHeaderHidden, headerClassName, errorClassName, placeholder, variant, isDisabled, className, hideLabel, hideDropdownIcon, isSearchable, isClearable, isLoading, as, size, collapseAfter, selectedTagsType } = props;
|
|
65
65
|
const popoverCva = UIOverrides.useCva("popover.cva", popoverDefinition);
|
|
66
|
-
const selectPopoverCva
|
|
66
|
+
const selectPopoverCva = UIOverrides.useCva("select.popoverCva", selectPopoverDefinition);
|
|
67
67
|
const t1 = isHeaderHidden || as === "inline" || as === "filter" || as === "floating";
|
|
68
68
|
let t2;
|
|
69
69
|
if ($[14] !== error || $[15] !== errorClassName || $[16] !== headerClassName || $[17] !== helperText || $[18] !== hideLabel || $[19] !== isDisabled || $[20] !== isRequired || $[21] !== label || $[22] !== rightContent || $[23] !== t1 || $[24] !== tooltipText) {
|
|
@@ -342,12 +342,12 @@ var SelectDesktop = (t0) => {
|
|
|
342
342
|
$[102] = t21;
|
|
343
343
|
} else t21 = $[102];
|
|
344
344
|
let t22;
|
|
345
|
-
if ($[103] !== ignoreTriggerWidth || $[104] !== isOpen || $[105] !== isSearchable || $[106] !== popoverCva || $[107] !== popoverWidth || $[108] !== props || $[109] !== selectPopoverCva
|
|
345
|
+
if ($[103] !== ignoreTriggerWidth || $[104] !== isOpen || $[105] !== isSearchable || $[106] !== popoverCva || $[107] !== popoverWidth || $[108] !== props || $[109] !== selectPopoverCva || $[110] !== setIsOpen || $[111] !== showPopover) {
|
|
346
346
|
t22 = (!isSearchable || showPopover) && /* @__PURE__ */ jsx(Popover, {
|
|
347
347
|
triggerRef,
|
|
348
348
|
isOpen,
|
|
349
349
|
onOpenChange: setIsOpen,
|
|
350
|
-
className: selectPopoverCva
|
|
350
|
+
className: selectPopoverCva({}),
|
|
351
351
|
style: { width: !ignoreTriggerWidth ? popoverWidth : void 0 },
|
|
352
352
|
offset: 0,
|
|
353
353
|
children: /* @__PURE__ */ jsx(SelectListBox, {
|
|
@@ -362,7 +362,7 @@ var SelectDesktop = (t0) => {
|
|
|
362
362
|
$[106] = popoverCva;
|
|
363
363
|
$[107] = popoverWidth;
|
|
364
364
|
$[108] = props;
|
|
365
|
-
$[109] = selectPopoverCva
|
|
365
|
+
$[109] = selectPopoverCva;
|
|
366
366
|
$[110] = setIsOpen;
|
|
367
367
|
$[111] = showPopover;
|
|
368
368
|
$[112] = t22;
|
|
@@ -4,10 +4,10 @@ import { Typography } from "../../../text/Typography/Typography.js";
|
|
|
4
4
|
import "../../../../config/i18n.js";
|
|
5
5
|
import { FormFieldLabel } from "../../FormField/FormFieldLabel.js";
|
|
6
6
|
import { InputClear } from "../../shared/InputClear.js";
|
|
7
|
-
import { inputBaseDefinition,
|
|
7
|
+
import { inputBaseDefinition, inputClearClassDefinition, inputSizeDefinition } from "../../shared/input.cva.js";
|
|
8
8
|
import { SelectInputTags } from "./SelectInputTags.js";
|
|
9
9
|
import { SelectContext } from "./select.context.js";
|
|
10
|
-
import {
|
|
10
|
+
import { selectInputTagsContentWrapperDefinition } from "./selectInput.cva.js";
|
|
11
11
|
import { useKeyInteractions } from "../../../../hooks/useKeyInteractions.js";
|
|
12
12
|
import { c } from "react/compiler-runtime";
|
|
13
13
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -18,11 +18,12 @@ import { useFocusVisible, useFocusWithin, useHover } from "react-aria";
|
|
|
18
18
|
import { useTranslation } from "react-i18next";
|
|
19
19
|
//#region src/components/inputs/Selection/shared/SelectInput.tsx
|
|
20
20
|
var SelectInput = (t0) => {
|
|
21
|
-
const $0 = c(
|
|
21
|
+
const $0 = c(124);
|
|
22
22
|
const { ref, placeholder, variant, as, size, isDisabled, isInvalid, className, hideDropdownIcon, isSearchable, isClearable, showSelectionContent, inputClassName, fieldProps, headerProps, selectedTagsType, collapseAfter, isRequired, isDirty, onCloseComboBox, onBlur, leadingContent, trailingContent, onMouseEnter, onFocusCapture, ...props } = t0;
|
|
23
23
|
const inputSizeCva = UIOverrides.useCva("input.sizeCva", inputSizeDefinition);
|
|
24
24
|
const inputBaseCva = UIOverrides.useCva("input.baseCva", inputBaseDefinition);
|
|
25
|
-
const inputClearClassCva = UIOverrides.useCva("input.clearClassCva",
|
|
25
|
+
const inputClearClassCva = UIOverrides.useCva("input.clearClassCva", inputClearClassDefinition);
|
|
26
|
+
const selectInputTagsContentWrapperCva = UIOverrides.useCva("select.tagsContentWrapperCva", selectInputTagsContentWrapperDefinition);
|
|
26
27
|
const { t } = useTranslation("ui");
|
|
27
28
|
const state = use(ComboBoxStateContext);
|
|
28
29
|
let t1;
|
|
@@ -227,7 +228,7 @@ var SelectInput = (t0) => {
|
|
|
227
228
|
$0[43] = t35;
|
|
228
229
|
} else t35 = $0[43];
|
|
229
230
|
let t36;
|
|
230
|
-
if ($0[44] !== as || $0[45] !== collapseAfter || $0[46] !== fieldProps || $0[47] !== inputClassName || $0[48] !== isDisabled || $0[49] !== isSearchable || $0[50] !== onBlur || $0[51] !== onKeyDown || $0[52] !== onRemove || $0[53] !== placeholder || $0[54] !==
|
|
231
|
+
if ($0[44] !== as || $0[45] !== collapseAfter || $0[46] !== fieldProps || $0[47] !== inputClassName || $0[48] !== isDisabled || $0[49] !== isSearchable || $0[50] !== onBlur || $0[51] !== onKeyDown || $0[52] !== onRemove || $0[53] !== placeholder || $0[54] !== selectInputTagsContentWrapperCva || $0[55] !== selectedItems || $0[56] !== selectedTagsType || $0[57] !== showTags) {
|
|
231
232
|
t36 = (showTags || isSearchable) && /* @__PURE__ */ jsxs("div", {
|
|
232
233
|
className: selectInputTagsContentWrapperCva({ isSearchable }),
|
|
233
234
|
children: [showTags && /* @__PURE__ */ jsx(SelectInputTags, {
|
|
@@ -255,13 +256,14 @@ var SelectInput = (t0) => {
|
|
|
255
256
|
$0[51] = onKeyDown;
|
|
256
257
|
$0[52] = onRemove;
|
|
257
258
|
$0[53] = placeholder;
|
|
258
|
-
$0[54] =
|
|
259
|
-
$0[55] =
|
|
260
|
-
$0[56] =
|
|
261
|
-
$0[57] =
|
|
262
|
-
|
|
259
|
+
$0[54] = selectInputTagsContentWrapperCva;
|
|
260
|
+
$0[55] = selectedItems;
|
|
261
|
+
$0[56] = selectedTagsType;
|
|
262
|
+
$0[57] = showTags;
|
|
263
|
+
$0[58] = t36;
|
|
264
|
+
} else t36 = $0[58];
|
|
263
265
|
let t37;
|
|
264
|
-
if ($0[
|
|
266
|
+
if ($0[59] !== as || $0[60] !== fieldProps || $0[61] !== isDisabled || $0[62] !== isEmpty || $0[63] !== isMultiple || $0[64] !== isOpen || $0[65] !== isSearchable || $0[66] !== onBlur || $0[67] !== onTriggerKeyDown || $0[68] !== placeholder || $0[69] !== selectedItems[0] || $0[70] !== setIsOpen || $0[71] !== showSelectionContent || $0[72] !== showTags) {
|
|
265
267
|
t37 = !isSearchable && /* @__PURE__ */ jsxs(Button, {
|
|
266
268
|
isDisabled,
|
|
267
269
|
onPress: () => setIsOpen(!isOpen),
|
|
@@ -276,24 +278,24 @@ var SelectInput = (t0) => {
|
|
|
276
278
|
children: [isEmpty && placeholder, !isEmpty && (showSelectionContent ? selectedItems[0].content : selectedItems[0].label)]
|
|
277
279
|
})]
|
|
278
280
|
});
|
|
279
|
-
$0[
|
|
280
|
-
$0[
|
|
281
|
-
$0[
|
|
282
|
-
$0[
|
|
283
|
-
$0[
|
|
284
|
-
$0[
|
|
285
|
-
$0[
|
|
286
|
-
$0[
|
|
287
|
-
$0[
|
|
288
|
-
$0[
|
|
289
|
-
$0[
|
|
290
|
-
$0[
|
|
291
|
-
$0[
|
|
292
|
-
$0[
|
|
293
|
-
$0[
|
|
294
|
-
} else t37 = $0[
|
|
281
|
+
$0[59] = as;
|
|
282
|
+
$0[60] = fieldProps;
|
|
283
|
+
$0[61] = isDisabled;
|
|
284
|
+
$0[62] = isEmpty;
|
|
285
|
+
$0[63] = isMultiple;
|
|
286
|
+
$0[64] = isOpen;
|
|
287
|
+
$0[65] = isSearchable;
|
|
288
|
+
$0[66] = onBlur;
|
|
289
|
+
$0[67] = onTriggerKeyDown;
|
|
290
|
+
$0[68] = placeholder;
|
|
291
|
+
$0[69] = selectedItems[0];
|
|
292
|
+
$0[70] = setIsOpen;
|
|
293
|
+
$0[71] = showSelectionContent;
|
|
294
|
+
$0[72] = showTags;
|
|
295
|
+
$0[73] = t37;
|
|
296
|
+
} else t37 = $0[73];
|
|
295
297
|
let t38;
|
|
296
|
-
if ($0[
|
|
298
|
+
if ($0[74] !== onClick || $0[75] !== t33 || $0[76] !== t34 || $0[77] !== t35 || $0[78] !== t36 || $0[79] !== t37) {
|
|
297
299
|
t38 = /* @__PURE__ */ jsxs("div", {
|
|
298
300
|
className: t33,
|
|
299
301
|
onClick,
|
|
@@ -304,16 +306,16 @@ var SelectInput = (t0) => {
|
|
|
304
306
|
t37
|
|
305
307
|
]
|
|
306
308
|
});
|
|
307
|
-
$0[
|
|
308
|
-
$0[
|
|
309
|
-
$0[
|
|
310
|
-
$0[
|
|
311
|
-
$0[
|
|
312
|
-
$0[
|
|
313
|
-
$0[
|
|
314
|
-
} else t38 = $0[
|
|
309
|
+
$0[74] = onClick;
|
|
310
|
+
$0[75] = t33;
|
|
311
|
+
$0[76] = t34;
|
|
312
|
+
$0[77] = t35;
|
|
313
|
+
$0[78] = t36;
|
|
314
|
+
$0[79] = t37;
|
|
315
|
+
$0[80] = t38;
|
|
316
|
+
} else t38 = $0[80];
|
|
315
317
|
let t39;
|
|
316
|
-
if ($0[
|
|
318
|
+
if ($0[81] !== as || $0[82] !== inputClearClassCva || $0[83] !== isClearable || $0[84] !== isDisabled || $0[85] !== onClear || $0[86] !== showClearButton) {
|
|
317
319
|
t39 = isClearable && !isDisabled && /* @__PURE__ */ jsx(InputClear, {
|
|
318
320
|
onClear: () => {
|
|
319
321
|
onClear();
|
|
@@ -321,25 +323,25 @@ var SelectInput = (t0) => {
|
|
|
321
323
|
className: inputClearClassCva({ as }),
|
|
322
324
|
show: showClearButton
|
|
323
325
|
});
|
|
324
|
-
$0[
|
|
325
|
-
$0[
|
|
326
|
-
$0[
|
|
327
|
-
$0[
|
|
328
|
-
$0[
|
|
329
|
-
$0[
|
|
330
|
-
$0[
|
|
331
|
-
} else t39 = $0[
|
|
326
|
+
$0[81] = as;
|
|
327
|
+
$0[82] = inputClearClassCva;
|
|
328
|
+
$0[83] = isClearable;
|
|
329
|
+
$0[84] = isDisabled;
|
|
330
|
+
$0[85] = onClear;
|
|
331
|
+
$0[86] = showClearButton;
|
|
332
|
+
$0[87] = t39;
|
|
333
|
+
} else t39 = $0[87];
|
|
332
334
|
let t40;
|
|
333
|
-
if ($0[
|
|
335
|
+
if ($0[88] !== trailingContent) {
|
|
334
336
|
t40 = trailingContent && /* @__PURE__ */ jsx("div", {
|
|
335
337
|
className: "flex shrink-0 items-center",
|
|
336
338
|
children: trailingContent
|
|
337
339
|
});
|
|
338
|
-
$0[
|
|
339
|
-
$0[
|
|
340
|
-
} else t40 = $0[
|
|
340
|
+
$0[88] = trailingContent;
|
|
341
|
+
$0[89] = t40;
|
|
342
|
+
} else t40 = $0[89];
|
|
341
343
|
let t41;
|
|
342
|
-
if ($0[
|
|
344
|
+
if ($0[90] !== hideDropdownIcon || $0[91] !== inputSizeCva || $0[92] !== isDisabled || $0[93] !== isOpen || $0[94] !== isSearchable || $0[95] !== setIsOpen || $0[96] !== size || $0[97] !== t) {
|
|
343
345
|
t41 = !hideDropdownIcon && /* @__PURE__ */ jsx(Button, {
|
|
344
346
|
excludeFromTabOrder: true,
|
|
345
347
|
"aria-label": t(($) => isOpen ? $.ui.closeAlt : $.ui.openAlt),
|
|
@@ -353,18 +355,18 @@ var SelectInput = (t0) => {
|
|
|
353
355
|
"aria-hidden": "true"
|
|
354
356
|
})
|
|
355
357
|
});
|
|
356
|
-
$0[
|
|
357
|
-
$0[
|
|
358
|
-
$0[
|
|
359
|
-
$0[
|
|
360
|
-
$0[
|
|
361
|
-
$0[
|
|
362
|
-
$0[
|
|
363
|
-
$0[
|
|
364
|
-
$0[
|
|
365
|
-
} else t41 = $0[
|
|
358
|
+
$0[90] = hideDropdownIcon;
|
|
359
|
+
$0[91] = inputSizeCva;
|
|
360
|
+
$0[92] = isDisabled;
|
|
361
|
+
$0[93] = isOpen;
|
|
362
|
+
$0[94] = isSearchable;
|
|
363
|
+
$0[95] = setIsOpen;
|
|
364
|
+
$0[96] = size;
|
|
365
|
+
$0[97] = t;
|
|
366
|
+
$0[98] = t41;
|
|
367
|
+
} else t41 = $0[98];
|
|
366
368
|
let t42;
|
|
367
|
-
if ($0[
|
|
369
|
+
if ($0[99] !== focusWithinProps || $0[100] !== hoverProps || $0[101] !== onFocusCapture || $0[102] !== onMouseEnter || $0[103] !== ref || $0[104] !== t16 || $0[105] !== t18 || $0[106] !== t19 || $0[107] !== t20 || $0[108] !== t21 || $0[109] !== t22 || $0[110] !== t23 || $0[111] !== t24 || $0[112] !== t25 || $0[113] !== t26 || $0[114] !== t27 || $0[115] !== t28 || $0[116] !== t29 || $0[117] !== t30 || $0[118] !== t31 || $0[119] !== t38 || $0[120] !== t39 || $0[121] !== t40 || $0[122] !== t41) {
|
|
368
370
|
t42 = /* @__PURE__ */ jsxs("div", {
|
|
369
371
|
ref,
|
|
370
372
|
className: t16,
|
|
@@ -395,32 +397,32 @@ var SelectInput = (t0) => {
|
|
|
395
397
|
t41
|
|
396
398
|
]
|
|
397
399
|
});
|
|
398
|
-
$0[
|
|
399
|
-
$0[
|
|
400
|
-
$0[
|
|
401
|
-
$0[
|
|
402
|
-
$0[
|
|
403
|
-
$0[
|
|
404
|
-
$0[
|
|
405
|
-
$0[
|
|
406
|
-
$0[
|
|
407
|
-
$0[
|
|
408
|
-
$0[
|
|
409
|
-
$0[
|
|
410
|
-
$0[
|
|
411
|
-
$0[
|
|
412
|
-
$0[
|
|
413
|
-
$0[
|
|
414
|
-
$0[
|
|
415
|
-
$0[
|
|
416
|
-
$0[
|
|
417
|
-
$0[
|
|
418
|
-
$0[
|
|
419
|
-
$0[
|
|
420
|
-
$0[
|
|
421
|
-
$0[
|
|
422
|
-
$0[
|
|
423
|
-
} else t42 = $0[
|
|
400
|
+
$0[99] = focusWithinProps;
|
|
401
|
+
$0[100] = hoverProps;
|
|
402
|
+
$0[101] = onFocusCapture;
|
|
403
|
+
$0[102] = onMouseEnter;
|
|
404
|
+
$0[103] = ref;
|
|
405
|
+
$0[104] = t16;
|
|
406
|
+
$0[105] = t18;
|
|
407
|
+
$0[106] = t19;
|
|
408
|
+
$0[107] = t20;
|
|
409
|
+
$0[108] = t21;
|
|
410
|
+
$0[109] = t22;
|
|
411
|
+
$0[110] = t23;
|
|
412
|
+
$0[111] = t24;
|
|
413
|
+
$0[112] = t25;
|
|
414
|
+
$0[113] = t26;
|
|
415
|
+
$0[114] = t27;
|
|
416
|
+
$0[115] = t28;
|
|
417
|
+
$0[116] = t29;
|
|
418
|
+
$0[117] = t30;
|
|
419
|
+
$0[118] = t31;
|
|
420
|
+
$0[119] = t38;
|
|
421
|
+
$0[120] = t39;
|
|
422
|
+
$0[121] = t40;
|
|
423
|
+
$0[122] = t41;
|
|
424
|
+
$0[123] = t42;
|
|
425
|
+
} else t42 = $0[123];
|
|
424
426
|
return t42;
|
|
425
427
|
};
|
|
426
428
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ArrowDropDownIcon } from "../../../../assets/icons/ArrowDropDown.js";
|
|
2
2
|
import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
3
|
-
import {
|
|
3
|
+
import { inputSizeDefinition } from "../../shared/input.cva.js";
|
|
4
4
|
import { c } from "react/compiler-runtime";
|
|
5
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { clsx } from "clsx";
|
|
@@ -8,7 +8,7 @@ import { clsx } from "clsx";
|
|
|
8
8
|
var StaticSelectTrailingContent = (t0) => {
|
|
9
9
|
const $ = c(10);
|
|
10
10
|
const { trailingContent, hideDropdownIcon, isDisabled, size } = t0;
|
|
11
|
-
const inputSizeCva = UIOverrides.useCva("input.sizeCva",
|
|
11
|
+
const inputSizeCva = UIOverrides.useCva("input.sizeCva", inputSizeDefinition);
|
|
12
12
|
if (!trailingContent && hideDropdownIcon) return null;
|
|
13
13
|
let t1;
|
|
14
14
|
if ($[0] !== trailingContent) {
|
|
@@ -3,8 +3,4 @@ export declare const selectPopoverDefinition: {
|
|
|
3
3
|
base: string[];
|
|
4
4
|
config?: import("../../../../utils/style-merge.util").StyleMergeUtils.Config<Record<never, never>>;
|
|
5
5
|
};
|
|
6
|
-
export declare const selectPopoverCva: {
|
|
7
|
-
base: string[];
|
|
8
|
-
config?: import("../../../../utils/style-merge.util").StyleMergeUtils.Config<Record<never, never>>;
|
|
9
|
-
};
|
|
10
6
|
export type SelectPopoverCva = UIOverrides.VariantProps<NonNullable<typeof selectPopoverDefinition.config>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
2
|
-
|
|
2
|
+
//#region src/components/inputs/Selection/shared/selectDesktop.cva.ts
|
|
3
|
+
var selectPopoverDefinition = UIOverrides.defineConfig({ base: ["my-4 outline-none"] });
|
|
3
4
|
//#endregion
|
|
4
|
-
export {
|
|
5
|
+
export { selectPopoverDefinition };
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { UIOverrides } from '../../../../config/uiOverrides.context';
|
|
2
|
+
export declare const selectInputTagsContentWrapperDefinition: {
|
|
3
|
+
base: string[];
|
|
4
|
+
config: import("../../../../utils/style-merge.util").StyleMergeUtils.Config<{
|
|
5
|
+
readonly isSearchable: {
|
|
6
|
+
readonly false: "pointer-events-none z-1";
|
|
7
|
+
};
|
|
8
|
+
}>;
|
|
9
|
+
};
|
|
10
|
+
export type SelectInputTagsContentWrapperConfig = NonNullable<typeof selectInputTagsContentWrapperDefinition.config>;
|
|
11
|
+
export interface SelectInputTagsContentWrapperVariantProps extends UIOverrides.VariantProps<SelectInputTagsContentWrapperConfig> {
|
|
12
|
+
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
2
2
|
//#region src/components/inputs/Selection/shared/selectInput.cva.ts
|
|
3
|
-
var
|
|
3
|
+
var selectInputTagsContentWrapperDefinition = UIOverrides.defineConfig({
|
|
4
|
+
base: ["flex flex-1 flex-wrap gap-input-gap-input-text-to-elements truncate"],
|
|
5
|
+
config: { variants: { isSearchable: { false: "pointer-events-none z-1" } } }
|
|
6
|
+
});
|
|
4
7
|
//#endregion
|
|
5
|
-
export {
|
|
8
|
+
export { selectInputTagsContentWrapperDefinition };
|
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
import { SelectInputTags } from "./SelectInputTags.js";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
//#region src/components/inputs/Selection/shared/staticSelect.utils.tsx
|
|
4
|
+
var getStaticMultipleDisplayValue = ({ selectedItems, isDisabled, collapseAfter, selectedTagsType }) => {
|
|
5
|
+
if (selectedItems.length === 0) return "";
|
|
6
|
+
return /* @__PURE__ */ jsx(SelectInputTags, {
|
|
7
|
+
selectedItems,
|
|
8
|
+
isDisabled,
|
|
9
|
+
collapseAfter,
|
|
10
|
+
selectedTagsType,
|
|
11
|
+
onRemove: () => void 0
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
var getStaticSingleDisplayValue = ({ selectedItem, showSelectionContent }) => {
|
|
15
|
+
if (!selectedItem) return "";
|
|
16
|
+
if (showSelectionContent && selectedItem.content) return selectedItem.content;
|
|
17
|
+
return /* @__PURE__ */ jsx("div", {
|
|
18
|
+
className: "min-w-0 flex-1 truncate",
|
|
19
|
+
children: selectedItem.label
|
|
20
|
+
});
|
|
21
|
+
};
|
|
4
22
|
var getStaticSelectValue = ({ items, value, selectionMode, initialSelection, mapInitialToSelectItem = ((item) => ({
|
|
5
23
|
id: item.id,
|
|
6
24
|
label: item.label ?? item.name ?? ""
|
|
@@ -14,22 +32,21 @@ var getStaticSelectValue = ({ items, value, selectionMode, initialSelection, map
|
|
|
14
32
|
if (selectionMode === "multiple") return {
|
|
15
33
|
selectedItem,
|
|
16
34
|
selectedItems,
|
|
17
|
-
displayValue:
|
|
35
|
+
displayValue: getStaticMultipleDisplayValue({
|
|
18
36
|
selectedItems,
|
|
19
37
|
isDisabled,
|
|
20
38
|
collapseAfter,
|
|
21
|
-
selectedTagsType
|
|
22
|
-
|
|
23
|
-
}) : "",
|
|
39
|
+
selectedTagsType
|
|
40
|
+
}),
|
|
24
41
|
isEmpty: selectedItems.length === 0
|
|
25
42
|
};
|
|
26
43
|
return {
|
|
27
44
|
selectedItem,
|
|
28
45
|
selectedItems,
|
|
29
|
-
displayValue:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
})
|
|
46
|
+
displayValue: getStaticSingleDisplayValue({
|
|
47
|
+
selectedItem,
|
|
48
|
+
showSelectionContent
|
|
49
|
+
}),
|
|
33
50
|
isEmpty: selectedItem == null
|
|
34
51
|
};
|
|
35
52
|
};
|