@povio/ui 2.3.2-rc.2 → 2.3.2-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.
@@ -371,6 +371,7 @@ var DatePickerInner = (t0) => {
371
371
  inputClassName: clsx("min-w-input-width-min-width", props.inputClassName),
372
372
  contentClassName: "pr-0!",
373
373
  contentWrapperClassName: datePickerInputContentRowCva({ size }),
374
+ contentGroup: "date-picker",
374
375
  labelPlacement: "content-row",
375
376
  dataAttributes: {
376
377
  dataIsEmpty: dateValue == null,
@@ -719,6 +719,7 @@ var DateRangePickerInner = (t0) => {
719
719
  inputClassName: clsx("min-w-input-width-min-width", props.inputClassName),
720
720
  contentClassName: "pr-0!",
721
721
  contentWrapperClassName: datePickerInputContentRowCva({ size }),
722
+ contentGroup: "date-picker",
722
723
  labelPlacement: "content-row",
723
724
  dataAttributes: {
724
725
  dataIsEmpty: !hasProvidedRangeValue,
@@ -295,6 +295,7 @@ var DateTimePickerInner = (t0) => {
295
295
  inputClassName: clsx("min-w-input-width-min-width", props.inputClassName),
296
296
  contentClassName: "pr-0!",
297
297
  contentWrapperClassName: datePickerInputContentRowCva({ size }),
298
+ contentGroup: "date-picker",
298
299
  labelPlacement: "content-row",
299
300
  dataAttributes: {
300
301
  dataIsEmpty: dateTimeValue == null,
@@ -498,6 +498,7 @@ var TimePickerInner = (t0) => {
498
498
  className: clsx("group relative inline-flex w-full flex-col text-left", props.className),
499
499
  inputClassName: clsx("min-w-input-width-min-width", props.inputClassName),
500
500
  contentClassName: "pr-0!",
501
+ contentGroup: "date-picker",
501
502
  labelPlacement: "content-row",
502
503
  dataAttributes: {
503
504
  dataIsEmpty: timeValue_0 == null,
@@ -328,8 +328,7 @@ var DatePickerInput = (t0) => {
328
328
  if ($[76] !== clearInput || $[77] !== isClearable || $[78] !== showClear) {
329
329
  t39 = isClearable && /* @__PURE__ */ jsx(InputClear, {
330
330
  onClear: clearInput,
331
- show: showClear,
332
- style: showClear ? { visibility: "visible" } : void 0
331
+ show: showClear
333
332
  });
334
333
  $[76] = clearInput;
335
334
  $[77] = isClearable;
@@ -14,9 +14,9 @@ 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>({ query, queryParams, queryOptions, queryMap, ...props }: import('../Selection/Select/QuerySelect.js').QuerySelectProps<TFieldValues, TQueryFn, TKey>) => import("react/jsx-runtime").JSX.Element;
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.js').QuerySelectProps<TFieldValues, TQueryFn, TKey, TInitialSelectItem>) => import("react/jsx-runtime").JSX.Element;
18
18
  readonly autocomplete: typeof Autocomplete;
19
- readonly queryAutocomplete: <TFieldValues extends import('react-hook-form').FieldValues, TSelectItem extends import('../../..').SelectItem<any>, TQueryFn extends import('../Selection/Autocomplete/queryAutocomplete.types').QueryFn>({ query, queryParams, queryOptions, queryMap, leadingContent, ...props }: import('../Selection/Autocomplete/queryAutocomplete.types').QueryAutocompleteProps<TFieldValues, TSelectItem, TQueryFn>) => import("react/jsx-runtime").JSX.Element;
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;
21
21
  readonly datePicker: <TFieldValues extends import('react-hook-form').FieldValues>({ fullIso, granularity, minValue, maxValue, renderStaticInput, ...props }: import('../DateTime/DatePicker/DatePicker').ControlledDatePickerProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
22
22
  readonly dateTimePicker: <TFieldValues extends import('react-hook-form').FieldValues>({ fullIso, renderStaticInput, ...props }: import('../DateTime/DateTimePicker/DateTimePicker').ControlledDateTimePickerProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
@@ -85,6 +85,7 @@ function AutocompleteInner(t0) {
85
85
  className: t3,
86
86
  inputClassName: t4,
87
87
  contentWrapperClassName: t5,
88
+ contentGroup: "select",
88
89
  labelPlacement: "content-row",
89
90
  dataAttributes,
90
91
  renderStatic: true,
@@ -1,4 +1,4 @@
1
1
  import { FieldValues } from 'react-hook-form';
2
2
  import { QueryAutocompleteProps, QueryFn } from './queryAutocomplete.types';
3
3
  import { SelectItem } from '../shared/select.types';
4
- export declare const QueryAutocomplete: <TFieldValues extends FieldValues, TSelectItem extends SelectItem<any>, TQueryFn extends QueryFn>({ query, queryParams, queryOptions, queryMap, leadingContent, ...props }: QueryAutocompleteProps<TFieldValues, TSelectItem, TQueryFn>) => import("react/jsx-runtime").JSX.Element;
4
+ export declare const QueryAutocomplete: <TFieldValues extends FieldValues, TSelectItem extends SelectItem<any>, TQueryFn extends QueryFn>(props: QueryAutocompleteProps<TFieldValues, TSelectItem, TQueryFn>) => import("react/jsx-runtime").JSX.Element;
@@ -1,11 +1,14 @@
1
1
  import { UIConfig } from "../../../../config/uiConfig.context.js";
2
2
  import { Autocomplete } from "./Autocomplete.js";
3
- import { getQueryItems, isInitialSelectionLabelMissing } from "../shared/querySelect.utils.js";
3
+ import { getQueryItems, shouldEnableQueryForSelection } from "../shared/querySelect.utils.js";
4
4
  import { useQueryAutocomplete } from "../../../../hooks/useQueryAutocomplete.js";
5
+ import { c } from "react/compiler-runtime";
5
6
  import { jsx } from "react/jsx-runtime";
6
7
  import { useState } from "react";
8
+ import { mergeRefs } from "@react-aria/utils";
9
+ import { Controller } from "react-hook-form";
7
10
  //#region src/components/inputs/Selection/Autocomplete/QueryAutocomplete.tsx
8
- var QueryAutocomplete = ({ query, queryParams, queryOptions, queryMap, leadingContent, ...props }) => {
11
+ var QueryAutocompleteContent = ({ query, queryParams, queryOptions, queryMap, leadingContent, ...props }) => {
9
12
  "use no memo";
10
13
  const ui = UIConfig.useConfig();
11
14
  const [search, setSearch] = useState("");
@@ -16,7 +19,11 @@ var QueryAutocomplete = ({ query, queryParams, queryOptions, queryMap, leadingCo
16
19
  queryOptions,
17
20
  mapItems: (data) => getQueryItems(data, queryMap),
18
21
  search,
19
- initialQueryState: isInitialSelectionLabelMissing(props.initialSelection, props.mapInitialToSelectItem) ? false : props.isInitialQueryDisabled ?? ui.queryAutocomplete?.isInitialQueryDisabled
22
+ initialQueryState: shouldEnableQueryForSelection({
23
+ initialSelection: props.initialSelection,
24
+ value: "value" in props ? props.value : void 0,
25
+ mapInitialToSelectItem: props.mapInitialToSelectItem
26
+ }) ? false : props.isInitialQueryDisabled ?? ui.queryAutocomplete?.isInitialQueryDisabled
20
27
  });
21
28
  const handleChange = (value) => {
22
29
  onChange?.(value);
@@ -42,5 +49,68 @@ var QueryAutocomplete = ({ query, queryParams, queryOptions, queryMap, leadingCo
42
49
  onLoadMore: fetchNextPage
43
50
  });
44
51
  };
52
+ var QueryAutocomplete = (props) => {
53
+ const $ = c(16);
54
+ if ("formControl" in props && props.formControl) {
55
+ let formControl;
56
+ let innerProps;
57
+ let ref;
58
+ if ($[0] !== props) {
59
+ ({formControl, ref, ...innerProps} = props);
60
+ $[0] = props;
61
+ $[1] = formControl;
62
+ $[2] = innerProps;
63
+ $[3] = ref;
64
+ } else {
65
+ formControl = $[1];
66
+ innerProps = $[2];
67
+ ref = $[3];
68
+ }
69
+ const controlWithOptions = formControl.control;
70
+ let t0;
71
+ if ($[4] !== controlWithOptions || $[5] !== innerProps || $[6] !== props.error || $[7] !== props.isDisabled || $[8] !== ref) {
72
+ t0 = (t1) => {
73
+ const { field, fieldState: t2 } = t1;
74
+ const { error, isDirty } = t2;
75
+ return /* @__PURE__ */ jsx(QueryAutocompleteContent, {
76
+ ...innerProps,
77
+ ref: mergeRefs(ref, field.ref),
78
+ value: field.value,
79
+ onChange: field.onChange,
80
+ onBlur: field.onBlur,
81
+ isDirty,
82
+ isDisabled: field.disabled || props.isDisabled || !!controlWithOptions._options?.disabled,
83
+ error: props.error ?? error?.message
84
+ });
85
+ };
86
+ $[4] = controlWithOptions;
87
+ $[5] = innerProps;
88
+ $[6] = props.error;
89
+ $[7] = props.isDisabled;
90
+ $[8] = ref;
91
+ $[9] = t0;
92
+ } else t0 = $[9];
93
+ let t1;
94
+ if ($[10] !== formControl.control || $[11] !== formControl.name || $[12] !== t0) {
95
+ t1 = /* @__PURE__ */ jsx(Controller, {
96
+ control: formControl.control,
97
+ name: formControl.name,
98
+ render: t0
99
+ });
100
+ $[10] = formControl.control;
101
+ $[11] = formControl.name;
102
+ $[12] = t0;
103
+ $[13] = t1;
104
+ } else t1 = $[13];
105
+ return t1;
106
+ }
107
+ let t0;
108
+ if ($[14] !== props) {
109
+ t0 = /* @__PURE__ */ jsx(QueryAutocompleteContent, { ...props });
110
+ $[14] = props;
111
+ $[15] = t0;
112
+ } else t0 = $[15];
113
+ return t0;
114
+ };
45
115
  //#endregion
46
116
  export { QueryAutocomplete };
@@ -1,9 +1,9 @@
1
+ import { Key } from 'react-aria-components';
2
+ import { FieldValues } from 'react-hook-form';
1
3
  import { DefaultInitialSelectItem, GroupedSelectControlProps, GroupedSelectProps, SelectItem } from '../shared/select.types';
2
4
  import { SelectProps } from './Select';
3
5
  import { QueryDataType, QueryFn } from '../shared/querySelect.utils';
4
6
  import { OmitDiscriminatedUnion } from '../../../../types/common';
5
- import { Key } from 'react-aria-components';
6
- import { FieldValues } from 'react-hook-form';
7
7
  export type QuerySelectProps<TFieldValues extends FieldValues, TQueryFn extends QueryFn, TKey extends Key = Key, TInitialSelectItem = DefaultInitialSelectItem<TKey>> = OmitDiscriminatedUnion<SelectProps<TKey, TInitialSelectItem>, "items" | "totalItems" | keyof GroupedSelectProps> & GroupedSelectControlProps<TFieldValues, TKey, TInitialSelectItem> & {
8
8
  query: TQueryFn;
9
9
  queryParams?: Parameters<TQueryFn>[0];
@@ -11,4 +11,4 @@ export type QuerySelectProps<TFieldValues extends FieldValues, TQueryFn extends
11
11
  queryMap?: (data: QueryDataType<TQueryFn>) => SelectItem<TKey>[];
12
12
  isInitialQueryDisabled?: boolean;
13
13
  };
14
- export declare const QuerySelect: <TFieldValues extends FieldValues, TQueryFn extends QueryFn, TKey extends Key = Key>({ query, queryParams, queryOptions, queryMap, ...props }: QuerySelectProps<TFieldValues, TQueryFn, TKey>) => import("react/jsx-runtime").JSX.Element;
14
+ export declare const QuerySelect: <TFieldValues extends FieldValues, TQueryFn extends QueryFn, TKey extends Key = Key, TInitialSelectItem = DefaultInitialSelectItem<TKey>>(props: QuerySelectProps<TFieldValues, TQueryFn, TKey, TInitialSelectItem>) => import("react/jsx-runtime").JSX.Element;
@@ -1,12 +1,14 @@
1
1
  import { UIConfig } from "../../../../config/uiConfig.context.js";
2
2
  import { Select } from "./Select.js";
3
- import { getQueryItems, isInitialSelectionLabelMissing } from "../shared/querySelect.utils.js";
3
+ import { getQueryItems, shouldEnableQueryForSelection } from "../shared/querySelect.utils.js";
4
4
  import { useQueryAutocomplete } from "../../../../hooks/useQueryAutocomplete.js";
5
5
  import { c } from "react/compiler-runtime";
6
6
  import { jsx } from "react/jsx-runtime";
7
7
  import { useState } from "react";
8
+ import { mergeRefs } from "@react-aria/utils";
9
+ import { Controller } from "react-hook-form";
8
10
  //#region src/components/inputs/Selection/Select/QuerySelect.tsx
9
- var QuerySelect = (t0) => {
11
+ var QuerySelectContent = (t0) => {
10
12
  const $ = c(28);
11
13
  const { query, queryParams, queryOptions, queryMap, ...props } = t0;
12
14
  const ui = UIConfig.useConfig();
@@ -19,7 +21,11 @@ var QuerySelect = (t0) => {
19
21
  $[1] = t1;
20
22
  } else t1 = $[1];
21
23
  const t2 = isSearchable ? search : void 0;
22
- const t3 = isInitialSelectionLabelMissing(props.initialSelection, props.mapInitialToSelectItem) ? false : props.isInitialQueryDisabled ?? ui.querySelect?.isInitialQueryDisabled;
24
+ const t3 = shouldEnableQueryForSelection({
25
+ initialSelection: props.initialSelection,
26
+ value: "value" in props ? props.value : void 0,
27
+ mapInitialToSelectItem: props.mapInitialToSelectItem
28
+ }) ? false : props.isInitialQueryDisabled ?? ui.querySelect?.isInitialQueryDisabled;
23
29
  let t4;
24
30
  if ($[2] !== query || $[3] !== queryOptions || $[4] !== queryParams || $[5] !== t1 || $[6] !== t2 || $[7] !== t3) {
25
31
  t4 = {
@@ -100,5 +106,68 @@ var QuerySelect = (t0) => {
100
106
  } else t7 = $[27];
101
107
  return t7;
102
108
  };
109
+ var QuerySelect = (props) => {
110
+ const $ = c(16);
111
+ if ("formControl" in props && props.formControl) {
112
+ let formControl;
113
+ let innerProps;
114
+ let ref;
115
+ if ($[0] !== props) {
116
+ ({formControl, ref, ...innerProps} = props);
117
+ $[0] = props;
118
+ $[1] = formControl;
119
+ $[2] = innerProps;
120
+ $[3] = ref;
121
+ } else {
122
+ formControl = $[1];
123
+ innerProps = $[2];
124
+ ref = $[3];
125
+ }
126
+ const controlWithOptions = formControl.control;
127
+ let t0;
128
+ if ($[4] !== controlWithOptions || $[5] !== innerProps || $[6] !== props.error || $[7] !== props.isDisabled || $[8] !== ref) {
129
+ t0 = (t1) => {
130
+ const { field, fieldState: t2 } = t1;
131
+ const { error, isDirty } = t2;
132
+ return /* @__PURE__ */ jsx(QuerySelectContent, {
133
+ ...innerProps,
134
+ ref: mergeRefs(ref, field.ref),
135
+ value: field.value,
136
+ onChange: field.onChange,
137
+ onBlur: field.onBlur,
138
+ isDirty,
139
+ isDisabled: field.disabled || props.isDisabled || !!controlWithOptions._options?.disabled,
140
+ error: props.error ?? error?.message
141
+ });
142
+ };
143
+ $[4] = controlWithOptions;
144
+ $[5] = innerProps;
145
+ $[6] = props.error;
146
+ $[7] = props.isDisabled;
147
+ $[8] = ref;
148
+ $[9] = t0;
149
+ } else t0 = $[9];
150
+ let t1;
151
+ if ($[10] !== formControl.control || $[11] !== formControl.name || $[12] !== t0) {
152
+ t1 = /* @__PURE__ */ jsx(Controller, {
153
+ control: formControl.control,
154
+ name: formControl.name,
155
+ render: t0
156
+ });
157
+ $[10] = formControl.control;
158
+ $[11] = formControl.name;
159
+ $[12] = t0;
160
+ $[13] = t1;
161
+ } else t1 = $[13];
162
+ return t1;
163
+ }
164
+ let t0;
165
+ if ($[14] !== props) {
166
+ t0 = /* @__PURE__ */ jsx(QuerySelectContent, { ...props });
167
+ $[14] = props;
168
+ $[15] = t0;
169
+ } else t0 = $[15];
170
+ return t0;
171
+ };
103
172
  //#endregion
104
173
  export { QuerySelect };
@@ -91,6 +91,7 @@ function SelectInner(t0) {
91
91
  className: clsx("w-full", props.containerClassName),
92
92
  inputClassName: clsx(props.className, props.inputClassName),
93
93
  contentWrapperClassName: selectInputTagsContentWrapperCva({ isSearchable }),
94
+ contentGroup: "select",
94
95
  typographySize: "label-1",
95
96
  labelPlacement: "content-row",
96
97
  dataAttributes,
@@ -4,4 +4,9 @@ import { SelectItem } from './select.types';
4
4
  export type QueryFn<TData = any> = (...args: any[]) => UseQueryResult<TData> | UseInfiniteQueryResult<TData>;
5
5
  export type QueryDataType<TQueryFn extends QueryFn> = Exclude<ReturnType<TQueryFn>["data"], undefined>;
6
6
  export declare const isInitialSelectionLabelMissing: <TInitialSelectItem>(initialSelection: TInitialSelectItem | TInitialSelectItem[] | null | undefined, mapInitialToSelectItem?: (item: TInitialSelectItem) => SelectItem) => boolean;
7
+ export declare const shouldEnableQueryForSelection: <TInitialSelectItem, TKey extends Key = Key>({ initialSelection, value, mapInitialToSelectItem, }: {
8
+ initialSelection: TInitialSelectItem | TInitialSelectItem[] | null | undefined;
9
+ value: TKey | TKey[] | null | undefined;
10
+ mapInitialToSelectItem?: (item: TInitialSelectItem) => SelectItem<TKey>;
11
+ }) => boolean;
7
12
  export declare const getQueryItems: <TQueryFn extends QueryFn, TKey extends Key = Key>(data: QueryDataType<TQueryFn> | undefined, queryMap?: (data: QueryDataType<TQueryFn>) => SelectItem<TKey>[]) => SelectItem<TKey>[];
@@ -5,11 +5,23 @@ var getDefaultInitialSelectionLabel = (initialSelection) => {
5
5
  if ("name" in initialSelection && typeof initialSelection.name === "string") return initialSelection.name;
6
6
  return "";
7
7
  };
8
+ var getInitialSelectionItems = (initialSelection) => {
9
+ return Array.isArray(initialSelection) ? initialSelection : initialSelection != null ? [initialSelection] : [];
10
+ };
11
+ var getInitialSelectionLabel = (initialSelection, mapInitialToSelectItem) => mapInitialToSelectItem?.(initialSelection).label ?? getDefaultInitialSelectionLabel(initialSelection);
8
12
  var isInitialSelectionLabelMissing = (initialSelection, mapInitialToSelectItem) => {
9
- return (Array.isArray(initialSelection) ? initialSelection : initialSelection != null ? [initialSelection] : []).some((item) => {
10
- return (mapInitialToSelectItem?.(item).label ?? getDefaultInitialSelectionLabel(item)) === "";
13
+ return getInitialSelectionItems(initialSelection).some((item) => {
14
+ return getInitialSelectionLabel(item, mapInitialToSelectItem) === "";
11
15
  });
12
16
  };
17
+ var shouldEnableQueryForSelection = ({ initialSelection, value, mapInitialToSelectItem }) => {
18
+ if (isInitialSelectionLabelMissing(initialSelection, mapInitialToSelectItem)) return true;
19
+ const values = Array.isArray(value) ? value : value != null ? [value] : [];
20
+ if (values.length === 0) return false;
21
+ const initialSelections = getInitialSelectionItems(initialSelection);
22
+ const labeledInitialSelectionIds = new Set(initialSelections.filter((item) => getInitialSelectionLabel(item, mapInitialToSelectItem) !== "").map((item) => mapInitialToSelectItem?.(item).id ?? item.id));
23
+ return values.some((id) => !labeledInitialSelectionIds.has(id));
24
+ };
13
25
  var getQueryItems = (data, queryMap) => {
14
26
  if (!data) return [];
15
27
  if (queryMap) return queryMap(data);
@@ -21,4 +33,4 @@ var getQueryItems = (data, queryMap) => {
21
33
  return [];
22
34
  };
23
35
  //#endregion
24
- export { getQueryItems, isInitialSelectionLabelMissing };
36
+ export { getQueryItems, shouldEnableQueryForSelection };
@@ -39,6 +39,7 @@ type InputFrameChildProps = InputFrameDataAttributeProps & {
39
39
  type InputFrameChildren = ReactNode | ((childProps: InputFrameChildProps) => ReactNode);
40
40
  type InputFrameLabelPlacement = "content-wrapper" | "content-row";
41
41
  type InputFrameActionContentPlacement = "content-wrapper" | "content-row";
42
+ type InputFrameContentGroup = "date-picker" | "input" | "select";
42
43
  export interface InputFrameProps extends InputVariantProps, Partial<FormFieldProps> {
43
44
  ref?: Ref<HTMLDivElement>;
44
45
  children: InputFrameChildren;
@@ -69,6 +70,7 @@ export interface InputFrameProps extends InputVariantProps, Partial<FormFieldPro
69
70
  inputClassName?: string;
70
71
  contentClassName?: string;
71
72
  contentWrapperClassName?: string;
73
+ contentGroup?: InputFrameContentGroup;
72
74
  contentAndTrailingClassName?: string;
73
75
  wrapContentAndTrailing?: boolean;
74
76
  wrapTrailingContent?: boolean;
@@ -14,101 +14,104 @@ import { clsx } from "clsx";
14
14
  import { isValidElement, useId } from "react";
15
15
  //#region src/components/inputs/Skeleton/InputFrame.tsx
16
16
  var InputFrame = (props) => {
17
- const $ = c(183);
17
+ const $ = c(189);
18
18
  const ui = UIConfig.useConfig();
19
19
  const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
20
20
  const inputSizeCva = UIStyle.useCva("input.sizeCva", inputSize);
21
21
  const inputContentWrapperCva = UIStyle.useCva("input.contentWrapperCva", inputContentWrapper);
22
22
  const typographyCva = UIStyle.useCva("typography.cva", typography);
23
23
  const generatedInputId = useId();
24
- const { ref, children, formFieldRef, labelProps: labelPropsProp, headerProps, error, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isHeaderHidden, hideLabel: hideLabelProp, headerClassName, errorClassName, className, leadingContent, leadingIcon, actionContent, actionContentPlacement: t0, trailingContent, trailingIcon, trailingAction, unit, isLoading, action, isClearable: isClearableProp, showClear, renderStatic, onStaticInteract, clearClassName, onClear, dataAttributes, typographySize, id: idProp, inputClassName, contentClassName, contentWrapperClassName, contentAndTrailingClassName, wrapContentAndTrailing, wrapTrailingContent: t1, reserveTrailingContent, labelPlacement: t2, trailingClassName, onMouseEnter, onFocusCapture, variant: variantProp, as: asProp, size: sizeProp } = props;
24
+ const { ref, children, formFieldRef, labelProps: labelPropsProp, headerProps, error, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isHeaderHidden, hideLabel: hideLabelProp, headerClassName, errorClassName, className, leadingContent, leadingIcon, actionContent, actionContentPlacement: t0, trailingContent, trailingIcon, trailingAction, unit, isLoading, action, isClearable: isClearableProp, showClear, renderStatic, onStaticInteract, clearClassName, onClear, dataAttributes, typographySize, id: idProp, inputClassName, contentClassName, contentWrapperClassName, contentGroup: t1, contentAndTrailingClassName, wrapContentAndTrailing, wrapTrailingContent: t2, reserveTrailingContent, labelPlacement: t3, trailingClassName, onMouseEnter, onFocusCapture, variant: variantProp, as: asProp, size: sizeProp } = props;
25
25
  const actionContentPlacement = t0 === void 0 ? "content-wrapper" : t0;
26
- const wrapTrailingContent = t1 === void 0 ? true : t1;
27
- const labelPlacement = t2 === void 0 ? "content-wrapper" : t2;
26
+ const contentGroup = t1 === void 0 ? "input" : t1;
27
+ const wrapTrailingContent = t2 === void 0 ? true : t2;
28
+ const labelPlacement = t3 === void 0 ? "content-wrapper" : t3;
28
29
  const as = asProp ?? ui.input.as;
29
30
  const size = sizeProp ?? ui.input.size;
30
31
  const variant = variantProp ?? ui.input.variant;
31
32
  const hideLabel = hideLabelProp ?? ui.input.hideLabel;
32
33
  const hasClear = !!(isClearableProp ?? ui.input.isClearable);
33
- let t3;
34
+ let t4;
34
35
  if ($[0] !== leadingIcon) {
35
- t3 = leadingIcon && isValidElement(leadingIcon);
36
+ t4 = leadingIcon && isValidElement(leadingIcon);
36
37
  $[0] = leadingIcon;
37
- $[1] = t3;
38
- } else t3 = $[1];
39
- const isLeadingIconElement = t3;
40
- let t4;
38
+ $[1] = t4;
39
+ } else t4 = $[1];
40
+ const isLeadingIconElement = t4;
41
+ let t5;
41
42
  if ($[2] !== trailingIcon) {
42
- t4 = trailingIcon && isValidElement(trailingIcon);
43
+ t5 = trailingIcon && isValidElement(trailingIcon);
43
44
  $[2] = trailingIcon;
44
- $[3] = t4;
45
- } else t4 = $[3];
46
- const isTrailingIconElement = t4;
45
+ $[3] = t5;
46
+ } else t5 = $[3];
47
+ const isTrailingIconElement = t5;
47
48
  const hasTrailingContent = reserveTrailingContent || hasClear || !!trailingContent || !!unit || !!isLoading || !!action || !!trailingIcon || !!trailingAction;
48
49
  const isTrailingInteractive = !!action || !!trailingAction || !!isTrailingIconElement || hasClear && !!showClear || !!trailingContent;
49
50
  let dataAttributeProps;
50
51
  let formFieldProps;
52
+ let isInputContentGroup;
51
53
  let labelProps;
52
54
  let t10;
53
55
  let t11;
54
56
  let t12;
55
57
  let t13;
56
- let t5;
58
+ let t14;
59
+ let t15;
57
60
  let t6;
58
61
  let t7;
59
62
  let t8;
60
63
  let t9;
61
- if ($[4] !== actionContent || $[5] !== actionContentPlacement || $[6] !== as || $[7] !== children || $[8] !== className || $[9] !== contentClassName || $[10] !== contentWrapperClassName || $[11] !== dataAttributes || $[12] !== error || $[13] !== errorClassName || $[14] !== generatedInputId || $[15] !== headerClassName || $[16] !== headerProps || $[17] !== helperText || $[18] !== hideLabel || $[19] !== idProp || $[20] !== inputContentWrapperCva || $[21] !== inputSizeCva || $[22] !== isDisabled || $[23] !== isHeaderHidden || $[24] !== isLeadingIconElement || $[25] !== isRequired || $[26] !== label || $[27] !== labelPlacement || $[28] !== labelPropsProp || $[29] !== leadingContent || $[30] !== leadingIcon || $[31] !== rightContent || $[32] !== size || $[33] !== tooltipText || $[34] !== typographyCva || $[35] !== typographySize) {
64
+ if ($[4] !== actionContent || $[5] !== actionContentPlacement || $[6] !== as || $[7] !== children || $[8] !== className || $[9] !== contentClassName || $[10] !== contentGroup || $[11] !== contentWrapperClassName || $[12] !== dataAttributes || $[13] !== error || $[14] !== errorClassName || $[15] !== generatedInputId || $[16] !== headerClassName || $[17] !== headerProps || $[18] !== helperText || $[19] !== hideLabel || $[20] !== idProp || $[21] !== inputContentWrapperCva || $[22] !== inputSizeCva || $[23] !== isDisabled || $[24] !== isHeaderHidden || $[25] !== isLeadingIconElement || $[26] !== isRequired || $[27] !== label || $[28] !== labelPlacement || $[29] !== labelPropsProp || $[30] !== leadingContent || $[31] !== leadingIcon || $[32] !== rightContent || $[33] !== size || $[34] !== tooltipText || $[35] !== typographyCva || $[36] !== typographySize) {
62
65
  dataAttributeProps = getInputFrameDataAttributeProps(dataAttributes);
63
66
  const baseLabelProps = headerProps?.labelProps ?? labelPropsProp;
64
67
  const inputId = idProp ?? baseLabelProps?.htmlFor ?? `input-frame_${generatedInputId}`;
65
- let t14;
66
- if ($[48] !== baseLabelProps || $[49] !== inputId) {
67
- t14 = {
68
+ let t16;
69
+ if ($[51] !== baseLabelProps || $[52] !== inputId) {
70
+ t16 = {
68
71
  ...baseLabelProps,
69
72
  htmlFor: inputId
70
73
  };
71
- $[48] = baseLabelProps;
72
- $[49] = inputId;
73
- $[50] = t14;
74
- } else t14 = $[50];
75
- labelProps = t14;
76
- const t15 = label ?? "";
77
- const t16 = isHeaderHidden || as === "inline" || as === "filter" || as === "floating";
78
- let t17;
79
- if ($[51] !== className || $[52] !== error || $[53] !== errorClassName || $[54] !== headerClassName || $[55] !== helperText || $[56] !== hideLabel || $[57] !== isDisabled || $[58] !== isRequired || $[59] !== rightContent || $[60] !== t15 || $[61] !== t16 || $[62] !== tooltipText) {
80
- t17 = {
74
+ $[51] = baseLabelProps;
75
+ $[52] = inputId;
76
+ $[53] = t16;
77
+ } else t16 = $[53];
78
+ labelProps = t16;
79
+ const t17 = label ?? "";
80
+ const t18 = isHeaderHidden || as === "inline" || as === "filter" || as === "floating";
81
+ let t19;
82
+ if ($[54] !== className || $[55] !== error || $[56] !== errorClassName || $[57] !== headerClassName || $[58] !== helperText || $[59] !== hideLabel || $[60] !== isDisabled || $[61] !== isRequired || $[62] !== rightContent || $[63] !== t17 || $[64] !== t18 || $[65] !== tooltipText) {
83
+ t19 = {
81
84
  error,
82
- label: t15,
85
+ label: t17,
83
86
  tooltipText,
84
87
  helperText,
85
88
  isRequired,
86
89
  rightContent,
87
- isHeaderHidden: t16,
90
+ isHeaderHidden: t18,
88
91
  hideLabel,
89
92
  isDisabled,
90
93
  headerClassName,
91
94
  errorClassName,
92
95
  className
93
96
  };
94
- $[51] = className;
95
- $[52] = error;
96
- $[53] = errorClassName;
97
- $[54] = headerClassName;
98
- $[55] = helperText;
99
- $[56] = hideLabel;
100
- $[57] = isDisabled;
101
- $[58] = isRequired;
102
- $[59] = rightContent;
103
- $[60] = t15;
104
- $[61] = t16;
105
- $[62] = tooltipText;
97
+ $[54] = className;
98
+ $[55] = error;
99
+ $[56] = errorClassName;
100
+ $[57] = headerClassName;
101
+ $[58] = helperText;
102
+ $[59] = hideLabel;
103
+ $[60] = isDisabled;
104
+ $[61] = isRequired;
105
+ $[62] = rightContent;
106
106
  $[63] = t17;
107
- } else t17 = $[63];
108
- formFieldProps = t17;
109
- let t18;
110
- if ($[64] !== headerClassName || $[65] !== headerProps || $[66] !== helperText || $[67] !== hideLabel || $[68] !== isDisabled || $[69] !== isHeaderHidden || $[70] !== isRequired || $[71] !== label || $[72] !== labelProps || $[73] !== rightContent || $[74] !== tooltipText) {
111
- t18 = headerProps ? {
107
+ $[64] = t18;
108
+ $[65] = tooltipText;
109
+ $[66] = t19;
110
+ } else t19 = $[66];
111
+ formFieldProps = t19;
112
+ let t20;
113
+ if ($[67] !== headerClassName || $[68] !== headerProps || $[69] !== helperText || $[70] !== hideLabel || $[71] !== isDisabled || $[72] !== isHeaderHidden || $[73] !== isRequired || $[74] !== label || $[75] !== labelProps || $[76] !== rightContent || $[77] !== tooltipText) {
114
+ t20 = headerProps ? {
112
115
  ...headerProps,
113
116
  labelProps
114
117
  } : {
@@ -122,86 +125,90 @@ var InputFrame = (props) => {
122
125
  className: headerClassName,
123
126
  labelProps
124
127
  };
125
- $[64] = headerClassName;
126
- $[65] = headerProps;
127
- $[66] = helperText;
128
- $[67] = hideLabel;
129
- $[68] = isDisabled;
130
- $[69] = isHeaderHidden;
131
- $[70] = isRequired;
132
- $[71] = label;
133
- $[72] = labelProps;
134
- $[73] = rightContent;
135
- $[74] = tooltipText;
136
- $[75] = t18;
137
- } else t18 = $[75];
138
- const resolvedHeaderProps = t18;
139
- let t19;
140
- if ($[76] !== as) {
141
- t19 = as && ["filter", "floating"].includes(as);
142
- $[76] = as;
143
- $[77] = t19;
144
- } else t19 = $[77];
145
- const shouldRenderLabel = t19;
146
- let t20;
147
- if ($[78] !== as || $[79] !== resolvedHeaderProps || $[80] !== shouldRenderLabel || $[81] !== size) {
148
- t20 = shouldRenderLabel ? /* @__PURE__ */ jsx(FormFieldLabel, {
128
+ $[67] = headerClassName;
129
+ $[68] = headerProps;
130
+ $[69] = helperText;
131
+ $[70] = hideLabel;
132
+ $[71] = isDisabled;
133
+ $[72] = isHeaderHidden;
134
+ $[73] = isRequired;
135
+ $[74] = label;
136
+ $[75] = labelProps;
137
+ $[76] = rightContent;
138
+ $[77] = tooltipText;
139
+ $[78] = t20;
140
+ } else t20 = $[78];
141
+ const resolvedHeaderProps = t20;
142
+ let t21;
143
+ if ($[79] !== as) {
144
+ t21 = as && ["filter", "floating"].includes(as);
145
+ $[79] = as;
146
+ $[80] = t21;
147
+ } else t21 = $[80];
148
+ const shouldRenderLabel = t21;
149
+ let t22;
150
+ if ($[81] !== as || $[82] !== resolvedHeaderProps || $[83] !== shouldRenderLabel || $[84] !== size) {
151
+ t22 = shouldRenderLabel ? /* @__PURE__ */ jsx(FormFieldLabel, {
149
152
  as,
150
153
  size,
151
154
  ...resolvedHeaderProps
152
155
  }) : null;
153
- $[78] = as;
154
- $[79] = resolvedHeaderProps;
155
- $[80] = shouldRenderLabel;
156
- $[81] = size;
157
- $[82] = t20;
158
- } else t20 = $[82];
159
- const labelContent = t20;
160
- let t21;
161
- if ($[83] !== as || $[84] !== contentWrapperClassName || $[85] !== inputContentWrapperCva) {
162
- t21 = contentWrapperClassName ?? inputContentWrapperCva({ as });
163
- $[83] = as;
164
- $[84] = contentWrapperClassName;
165
- $[85] = inputContentWrapperCva;
166
- $[86] = t21;
167
- } else t21 = $[86];
168
- const resolvedContentWrapperClassName = t21;
169
- if ($[87] !== as || $[88] !== contentClassName || $[89] !== inputSizeCva || $[90] !== size || $[91] !== typographyCva || $[92] !== typographySize) {
170
- let t22;
171
- if ($[94] !== typographyCva || $[95] !== typographySize) {
172
- t22 = typographySize && typographyCva({ size: typographySize });
173
- $[94] = typographyCva;
174
- $[95] = typographySize;
175
- $[96] = t22;
176
- } else t22 = $[96];
177
- t9 = clsx("group/input-frame flex min-w-0 w-full items-center gap-input-gap-input-text-to-elements", inputSizeCva({
156
+ $[81] = as;
157
+ $[82] = resolvedHeaderProps;
158
+ $[83] = shouldRenderLabel;
159
+ $[84] = size;
160
+ $[85] = t22;
161
+ } else t22 = $[85];
162
+ const labelContent = t22;
163
+ let t23;
164
+ if ($[86] !== as || $[87] !== contentWrapperClassName || $[88] !== inputContentWrapperCva) {
165
+ t23 = contentWrapperClassName ?? inputContentWrapperCva({ as });
166
+ $[86] = as;
167
+ $[87] = contentWrapperClassName;
168
+ $[88] = inputContentWrapperCva;
169
+ $[89] = t23;
170
+ } else t23 = $[89];
171
+ const resolvedContentWrapperClassName = t23;
172
+ isInputContentGroup = contentGroup === "input";
173
+ t10 = dataAttributeProps;
174
+ const t24 = isInputContentGroup && inputFrameContentGroupClassNames.input;
175
+ if ($[90] !== as || $[91] !== contentClassName || $[92] !== inputSizeCva || $[93] !== size || $[94] !== t24 || $[95] !== typographyCva || $[96] !== typographySize) {
176
+ let t25;
177
+ if ($[98] !== typographyCva || $[99] !== typographySize) {
178
+ t25 = typographySize && typographyCva({ size: typographySize });
179
+ $[98] = typographyCva;
180
+ $[99] = typographySize;
181
+ $[100] = t25;
182
+ } else t25 = $[100];
183
+ t11 = clsx(t24, "group/input-frame flex min-w-0 w-full items-center gap-input-gap-input-text-to-elements", inputSizeCva({
178
184
  size,
179
185
  as
180
- }), t22, contentClassName);
181
- $[87] = as;
182
- $[88] = contentClassName;
183
- $[89] = inputSizeCva;
184
- $[90] = size;
185
- $[91] = typographyCva;
186
- $[92] = typographySize;
187
- $[93] = t9;
188
- } else t9 = $[93];
189
- t10 = leadingContent;
190
- if ($[97] !== isLeadingIconElement || $[98] !== leadingIcon) {
191
- t11 = leadingIcon && /* @__PURE__ */ jsx("div", {
186
+ }), t25, contentClassName);
187
+ $[90] = as;
188
+ $[91] = contentClassName;
189
+ $[92] = inputSizeCva;
190
+ $[93] = size;
191
+ $[94] = t24;
192
+ $[95] = typographyCva;
193
+ $[96] = typographySize;
194
+ $[97] = t11;
195
+ } else t11 = $[97];
196
+ t12 = leadingContent;
197
+ if ($[101] !== isLeadingIconElement || $[102] !== leadingIcon) {
198
+ t13 = leadingIcon && /* @__PURE__ */ jsx("div", {
192
199
  className: clsx(!isLeadingIconElement && "pointer-events-none"),
193
200
  children: renderIconVisual(leadingIcon)
194
201
  });
195
- $[97] = isLeadingIconElement;
196
- $[98] = leadingIcon;
197
- $[99] = t11;
198
- } else t11 = $[99];
199
- t12 = labelPlacement === "content-row" && labelContent;
200
- t13 = actionContentPlacement === "content-row" && actionContent;
201
- t5 = resolvedContentWrapperClassName;
202
- t6 = labelPlacement === "content-wrapper" && labelContent;
203
- t7 = actionContentPlacement === "content-wrapper" && actionContent;
204
- t8 = typeof children === "function" ? children({
202
+ $[101] = isLeadingIconElement;
203
+ $[102] = leadingIcon;
204
+ $[103] = t13;
205
+ } else t13 = $[103];
206
+ t14 = labelPlacement === "content-row" && labelContent;
207
+ t15 = actionContentPlacement === "content-row" && actionContent;
208
+ t6 = resolvedContentWrapperClassName;
209
+ t7 = labelPlacement === "content-wrapper" && labelContent;
210
+ t8 = actionContentPlacement === "content-wrapper" && actionContent;
211
+ t9 = typeof children === "function" ? children({
205
212
  ...dataAttributeProps,
206
213
  id: inputId
207
214
  }) : children;
@@ -211,103 +218,109 @@ var InputFrame = (props) => {
211
218
  $[7] = children;
212
219
  $[8] = className;
213
220
  $[9] = contentClassName;
214
- $[10] = contentWrapperClassName;
215
- $[11] = dataAttributes;
216
- $[12] = error;
217
- $[13] = errorClassName;
218
- $[14] = generatedInputId;
219
- $[15] = headerClassName;
220
- $[16] = headerProps;
221
- $[17] = helperText;
222
- $[18] = hideLabel;
223
- $[19] = idProp;
224
- $[20] = inputContentWrapperCva;
225
- $[21] = inputSizeCva;
226
- $[22] = isDisabled;
227
- $[23] = isHeaderHidden;
228
- $[24] = isLeadingIconElement;
229
- $[25] = isRequired;
230
- $[26] = label;
231
- $[27] = labelPlacement;
232
- $[28] = labelPropsProp;
233
- $[29] = leadingContent;
234
- $[30] = leadingIcon;
235
- $[31] = rightContent;
236
- $[32] = size;
237
- $[33] = tooltipText;
238
- $[34] = typographyCva;
239
- $[35] = typographySize;
240
- $[36] = dataAttributeProps;
241
- $[37] = formFieldProps;
242
- $[38] = labelProps;
243
- $[39] = t10;
244
- $[40] = t11;
245
- $[41] = t12;
246
- $[42] = t13;
247
- $[43] = t5;
248
- $[44] = t6;
249
- $[45] = t7;
250
- $[46] = t8;
251
- $[47] = t9;
221
+ $[10] = contentGroup;
222
+ $[11] = contentWrapperClassName;
223
+ $[12] = dataAttributes;
224
+ $[13] = error;
225
+ $[14] = errorClassName;
226
+ $[15] = generatedInputId;
227
+ $[16] = headerClassName;
228
+ $[17] = headerProps;
229
+ $[18] = helperText;
230
+ $[19] = hideLabel;
231
+ $[20] = idProp;
232
+ $[21] = inputContentWrapperCva;
233
+ $[22] = inputSizeCva;
234
+ $[23] = isDisabled;
235
+ $[24] = isHeaderHidden;
236
+ $[25] = isLeadingIconElement;
237
+ $[26] = isRequired;
238
+ $[27] = label;
239
+ $[28] = labelPlacement;
240
+ $[29] = labelPropsProp;
241
+ $[30] = leadingContent;
242
+ $[31] = leadingIcon;
243
+ $[32] = rightContent;
244
+ $[33] = size;
245
+ $[34] = tooltipText;
246
+ $[35] = typographyCva;
247
+ $[36] = typographySize;
248
+ $[37] = dataAttributeProps;
249
+ $[38] = formFieldProps;
250
+ $[39] = isInputContentGroup;
251
+ $[40] = labelProps;
252
+ $[41] = t10;
253
+ $[42] = t11;
254
+ $[43] = t12;
255
+ $[44] = t13;
256
+ $[45] = t14;
257
+ $[46] = t15;
258
+ $[47] = t6;
259
+ $[48] = t7;
260
+ $[49] = t8;
261
+ $[50] = t9;
252
262
  } else {
253
- dataAttributeProps = $[36];
254
- formFieldProps = $[37];
255
- labelProps = $[38];
256
- t10 = $[39];
257
- t11 = $[40];
258
- t12 = $[41];
259
- t13 = $[42];
260
- t5 = $[43];
261
- t6 = $[44];
262
- t7 = $[45];
263
- t8 = $[46];
264
- t9 = $[47];
263
+ dataAttributeProps = $[37];
264
+ formFieldProps = $[38];
265
+ isInputContentGroup = $[39];
266
+ labelProps = $[40];
267
+ t10 = $[41];
268
+ t11 = $[42];
269
+ t12 = $[43];
270
+ t13 = $[44];
271
+ t14 = $[45];
272
+ t15 = $[46];
273
+ t6 = $[47];
274
+ t7 = $[48];
275
+ t8 = $[49];
276
+ t9 = $[50];
265
277
  }
266
- let t14;
267
- if ($[100] !== t5 || $[101] !== t6 || $[102] !== t7 || $[103] !== t8) {
268
- t14 = /* @__PURE__ */ jsxs("div", {
269
- className: t5,
278
+ let t16;
279
+ if ($[104] !== t6 || $[105] !== t7 || $[106] !== t8 || $[107] !== t9) {
280
+ t16 = /* @__PURE__ */ jsxs("div", {
281
+ className: t6,
270
282
  children: [
271
- t6,
272
283
  t7,
273
- t8
284
+ t8,
285
+ t9
274
286
  ]
275
287
  });
276
- $[100] = t5;
277
- $[101] = t6;
278
- $[102] = t7;
279
- $[103] = t8;
280
- $[104] = t14;
281
- } else t14 = $[104];
282
- let t15;
283
- if ($[105] !== t10 || $[106] !== t11 || $[107] !== t12 || $[108] !== t13 || $[109] !== t14 || $[110] !== t9) {
284
- t15 = /* @__PURE__ */ jsxs("div", {
285
- className: t9,
288
+ $[104] = t6;
289
+ $[105] = t7;
290
+ $[106] = t8;
291
+ $[107] = t9;
292
+ $[108] = t16;
293
+ } else t16 = $[108];
294
+ let t17;
295
+ if ($[109] !== t10 || $[110] !== t11 || $[111] !== t12 || $[112] !== t13 || $[113] !== t14 || $[114] !== t15 || $[115] !== t16) {
296
+ t17 = /* @__PURE__ */ jsxs("div", {
297
+ ...t10,
298
+ className: t11,
286
299
  children: [
287
- t10,
288
- t11,
289
300
  t12,
290
301
  t13,
291
- t14
302
+ t14,
303
+ t15,
304
+ t16
292
305
  ]
293
306
  });
294
- $[105] = t10;
295
- $[106] = t11;
296
- $[107] = t12;
297
- $[108] = t13;
298
- $[109] = t14;
299
- $[110] = t9;
300
- $[111] = t15;
301
- } else t15 = $[111];
302
- const contentRow = t15;
303
- let t16;
304
- if ($[112] !== action || $[113] !== clearClassName || $[114] !== hasClear || $[115] !== hasTrailingContent || $[116] !== isDisabled || $[117] !== isLoading || $[118] !== onClear || $[119] !== renderStatic || $[120] !== showClear || $[121] !== trailingAction || $[122] !== trailingContent || $[123] !== trailingIcon || $[124] !== typographyCva || $[125] !== unit) {
305
- t16 = hasTrailingContent ? /* @__PURE__ */ jsxs(Fragment, { children: [
307
+ $[109] = t10;
308
+ $[110] = t11;
309
+ $[111] = t12;
310
+ $[112] = t13;
311
+ $[113] = t14;
312
+ $[114] = t15;
313
+ $[115] = t16;
314
+ $[116] = t17;
315
+ } else t17 = $[116];
316
+ const contentRow = t17;
317
+ let t18;
318
+ if ($[117] !== action || $[118] !== clearClassName || $[119] !== hasClear || $[120] !== hasTrailingContent || $[121] !== isDisabled || $[122] !== isLoading || $[123] !== onClear || $[124] !== renderStatic || $[125] !== showClear || $[126] !== trailingAction || $[127] !== trailingContent || $[128] !== trailingIcon || $[129] !== typographyCva || $[130] !== unit) {
319
+ t18 = hasTrailingContent ? /* @__PURE__ */ jsxs(Fragment, { children: [
306
320
  hasClear && /* @__PURE__ */ jsx(InputClear, {
307
321
  onClear: () => onClear?.(),
308
322
  className: clearClassName,
309
323
  show: !!showClear,
310
- style: showClear ? { visibility: "visible" } : void 0,
311
324
  renderStatic
312
325
  }),
313
326
  trailingContent,
@@ -336,178 +349,185 @@ var InputFrame = (props) => {
336
349
  !isLoading && !action && trailingIcon && renderIconVisual(trailingIcon),
337
350
  trailingAction
338
351
  ] }) : null;
339
- $[112] = action;
340
- $[113] = clearClassName;
341
- $[114] = hasClear;
342
- $[115] = hasTrailingContent;
343
- $[116] = isDisabled;
344
- $[117] = isLoading;
345
- $[118] = onClear;
346
- $[119] = renderStatic;
347
- $[120] = showClear;
348
- $[121] = trailingAction;
349
- $[122] = trailingContent;
350
- $[123] = trailingIcon;
351
- $[124] = typographyCva;
352
- $[125] = unit;
353
- $[126] = t16;
354
- } else t16 = $[126];
355
- const trailingContentNodes = t16;
356
- let t17;
357
- if ($[127] !== as || $[128] !== inputSizeCva || $[129] !== isDisabled || $[130] !== isTrailingInteractive || $[131] !== size || $[132] !== trailingClassName || $[133] !== trailingContentNodes || $[134] !== wrapTrailingContent) {
358
- t17 = wrapTrailingContent && trailingContentNodes ? /* @__PURE__ */ jsx("div", {
352
+ $[117] = action;
353
+ $[118] = clearClassName;
354
+ $[119] = hasClear;
355
+ $[120] = hasTrailingContent;
356
+ $[121] = isDisabled;
357
+ $[122] = isLoading;
358
+ $[123] = onClear;
359
+ $[124] = renderStatic;
360
+ $[125] = showClear;
361
+ $[126] = trailingAction;
362
+ $[127] = trailingContent;
363
+ $[128] = trailingIcon;
364
+ $[129] = typographyCva;
365
+ $[130] = unit;
366
+ $[131] = t18;
367
+ } else t18 = $[131];
368
+ const trailingContentNodes = t18;
369
+ let t19;
370
+ if ($[132] !== as || $[133] !== inputSizeCva || $[134] !== isDisabled || $[135] !== isTrailingInteractive || $[136] !== size || $[137] !== trailingClassName || $[138] !== trailingContentNodes || $[139] !== wrapTrailingContent) {
371
+ t19 = wrapTrailingContent && trailingContentNodes ? /* @__PURE__ */ jsx("div", {
359
372
  className: clsx("flex items-center gap-input-gap-trailing-elements", inputSizeCva({
360
373
  size,
361
374
  as
362
375
  }), !isTrailingInteractive && "pointer-events-none", isDisabled && "text-interactive-text-secondary-disabled", trailingClassName),
363
376
  children: trailingContentNodes
364
377
  }) : trailingContentNodes;
365
- $[127] = as;
366
- $[128] = inputSizeCva;
367
- $[129] = isDisabled;
368
- $[130] = isTrailingInteractive;
369
- $[131] = size;
370
- $[132] = trailingClassName;
371
- $[133] = trailingContentNodes;
372
- $[134] = wrapTrailingContent;
373
- $[135] = t17;
374
- } else t17 = $[135];
375
- const trailingRow = t17;
376
- let t18;
377
- if ($[136] !== contentAndTrailingClassName || $[137] !== contentRow || $[138] !== trailingRow || $[139] !== wrapContentAndTrailing) {
378
- t18 = wrapContentAndTrailing ? /* @__PURE__ */ jsxs("div", {
378
+ $[132] = as;
379
+ $[133] = inputSizeCva;
380
+ $[134] = isDisabled;
381
+ $[135] = isTrailingInteractive;
382
+ $[136] = size;
383
+ $[137] = trailingClassName;
384
+ $[138] = trailingContentNodes;
385
+ $[139] = wrapTrailingContent;
386
+ $[140] = t19;
387
+ } else t19 = $[140];
388
+ const trailingRow = t19;
389
+ let t20;
390
+ if ($[141] !== contentAndTrailingClassName || $[142] !== contentRow || $[143] !== trailingRow || $[144] !== wrapContentAndTrailing) {
391
+ t20 = wrapContentAndTrailing ? /* @__PURE__ */ jsxs("div", {
379
392
  className: clsx("flex w-full items-center gap-input-gap-input-text-to-elements", contentAndTrailingClassName),
380
393
  children: [contentRow, trailingRow]
381
394
  }) : /* @__PURE__ */ jsxs(Fragment, { children: [contentRow, trailingRow] });
382
- $[136] = contentAndTrailingClassName;
383
- $[137] = contentRow;
384
- $[138] = trailingRow;
385
- $[139] = wrapContentAndTrailing;
386
- $[140] = t18;
387
- } else t18 = $[140];
388
- const inputFrameContent = t18;
389
- const t19 = as === "inline" ? -1 : void 0;
390
- const t20 = as === "inline" ? -1 : void 0;
391
- let t21;
392
- if ($[141] !== onMouseEnter || $[142] !== onStaticInteract || $[143] !== renderStatic) {
393
- t21 = (event) => {
395
+ $[141] = contentAndTrailingClassName;
396
+ $[142] = contentRow;
397
+ $[143] = trailingRow;
398
+ $[144] = wrapContentAndTrailing;
399
+ $[145] = t20;
400
+ } else t20 = $[145];
401
+ const inputFrameContent = t20;
402
+ const t21 = as === "inline" ? -1 : void 0;
403
+ const t22 = as === "inline" ? -1 : void 0;
404
+ let t23;
405
+ if ($[146] !== onMouseEnter || $[147] !== onStaticInteract || $[148] !== renderStatic) {
406
+ t23 = (event) => {
394
407
  onMouseEnter?.(event);
395
408
  if (renderStatic) onStaticInteract?.(false);
396
409
  };
397
- $[141] = onMouseEnter;
398
- $[142] = onStaticInteract;
399
- $[143] = renderStatic;
400
- $[144] = t21;
401
- } else t21 = $[144];
402
- let t22;
403
- if ($[145] !== onFocusCapture || $[146] !== onStaticInteract || $[147] !== renderStatic) {
404
- t22 = (event_0) => {
410
+ $[146] = onMouseEnter;
411
+ $[147] = onStaticInteract;
412
+ $[148] = renderStatic;
413
+ $[149] = t23;
414
+ } else t23 = $[149];
415
+ let t24;
416
+ if ($[150] !== onFocusCapture || $[151] !== onStaticInteract || $[152] !== renderStatic) {
417
+ t24 = (event_0) => {
405
418
  onFocusCapture?.(event_0);
406
419
  if (renderStatic) onStaticInteract?.(true);
407
420
  };
408
- $[145] = onFocusCapture;
409
- $[146] = onStaticInteract;
410
- $[147] = renderStatic;
411
- $[148] = t22;
412
- } else t22 = $[148];
413
- let t23;
414
- if ($[149] !== as || $[150] !== inputBaseCva || $[151] !== inputClassName || $[152] !== variant) {
415
- t23 = clsx("relative flex cursor-text has-disabled:cursor-default", inputBaseCva({
421
+ $[150] = onFocusCapture;
422
+ $[151] = onStaticInteract;
423
+ $[152] = renderStatic;
424
+ $[153] = t24;
425
+ } else t24 = $[153];
426
+ const t25 = !isInputContentGroup && inputFrameContentGroupClassNames[contentGroup];
427
+ let t26;
428
+ if ($[154] !== as || $[155] !== inputBaseCva || $[156] !== inputClassName || $[157] !== t25 || $[158] !== variant) {
429
+ t26 = clsx("relative flex cursor-text has-disabled:cursor-default", t25, inputBaseCva({
416
430
  variant,
417
431
  as
418
432
  }), inputClassName);
419
- $[149] = as;
420
- $[150] = inputBaseCva;
421
- $[151] = inputClassName;
422
- $[152] = variant;
423
- $[153] = t23;
424
- } else t23 = $[153];
425
- const t24 = renderStatic ? isDisabled ? -1 : 0 : void 0;
426
- let t25;
427
- let t26;
428
- let t27;
429
- if ($[154] !== onStaticInteract || $[155] !== renderStatic) {
430
- t25 = () => {
433
+ $[154] = as;
434
+ $[155] = inputBaseCva;
435
+ $[156] = inputClassName;
436
+ $[157] = t25;
437
+ $[158] = variant;
438
+ $[159] = t26;
439
+ } else t26 = $[159];
440
+ const t27 = renderStatic ? isDisabled ? -1 : 0 : void 0;
441
+ let t28;
442
+ let t29;
443
+ let t30;
444
+ if ($[160] !== onStaticInteract || $[161] !== renderStatic) {
445
+ t28 = () => {
431
446
  if (renderStatic) onStaticInteract?.(true);
432
447
  };
433
- t26 = () => {
448
+ t29 = () => {
434
449
  if (renderStatic) onStaticInteract?.(true);
435
450
  };
436
- t27 = () => {
451
+ t30 = () => {
437
452
  if (renderStatic) onStaticInteract?.(true);
438
453
  };
439
- $[154] = onStaticInteract;
440
- $[155] = renderStatic;
441
- $[156] = t25;
442
- $[157] = t26;
443
- $[158] = t27;
454
+ $[160] = onStaticInteract;
455
+ $[161] = renderStatic;
456
+ $[162] = t28;
457
+ $[163] = t29;
458
+ $[164] = t30;
444
459
  } else {
445
- t25 = $[156];
446
- t26 = $[157];
447
- t27 = $[158];
460
+ t28 = $[162];
461
+ t29 = $[163];
462
+ t30 = $[164];
448
463
  }
449
- let t28;
450
- if ($[159] !== dataAttributeProps || $[160] !== inputFrameContent || $[161] !== ref || $[162] !== t23 || $[163] !== t24 || $[164] !== t25 || $[165] !== t26 || $[166] !== t27) {
451
- t28 = /* @__PURE__ */ jsx("div", {
464
+ let t31;
465
+ if ($[165] !== dataAttributeProps || $[166] !== inputFrameContent || $[167] !== ref || $[168] !== t26 || $[169] !== t27 || $[170] !== t28 || $[171] !== t29 || $[172] !== t30) {
466
+ t31 = /* @__PURE__ */ jsx("div", {
452
467
  ref,
453
468
  ...dataAttributeProps,
454
- className: t23,
455
- tabIndex: t24,
456
- onFocus: t25,
457
- onClick: t26,
458
- onPointerDown: t27,
469
+ className: t26,
470
+ tabIndex: t27,
471
+ onFocus: t28,
472
+ onClick: t29,
473
+ onPointerDown: t30,
459
474
  "data-rac": "",
460
475
  children: inputFrameContent
461
476
  });
462
- $[159] = dataAttributeProps;
463
- $[160] = inputFrameContent;
464
- $[161] = ref;
465
- $[162] = t23;
466
- $[163] = t24;
467
- $[164] = t25;
468
- $[165] = t26;
469
- $[166] = t27;
470
- $[167] = t28;
471
- } else t28 = $[167];
472
- let t29;
473
- if ($[168] !== as || $[169] !== dataAttributeProps || $[170] !== formFieldProps || $[171] !== formFieldRef || $[172] !== labelProps || $[173] !== t20 || $[174] !== t21 || $[175] !== t22 || $[176] !== t28) {
474
- t29 = /* @__PURE__ */ jsx(FormField, {
477
+ $[165] = dataAttributeProps;
478
+ $[166] = inputFrameContent;
479
+ $[167] = ref;
480
+ $[168] = t26;
481
+ $[169] = t27;
482
+ $[170] = t28;
483
+ $[171] = t29;
484
+ $[172] = t30;
485
+ $[173] = t31;
486
+ } else t31 = $[173];
487
+ let t32;
488
+ if ($[174] !== as || $[175] !== dataAttributeProps || $[176] !== formFieldProps || $[177] !== formFieldRef || $[178] !== labelProps || $[179] !== t22 || $[180] !== t23 || $[181] !== t24 || $[182] !== t31) {
489
+ t32 = /* @__PURE__ */ jsx(FormField, {
475
490
  ...formFieldProps,
476
491
  ...dataAttributeProps,
477
492
  ref: formFieldRef,
478
493
  as,
479
494
  labelProps,
480
- tabIndex: t20,
481
- onMouseEnter: t21,
482
- onFocusCapture: t22,
483
- children: t28
495
+ tabIndex: t22,
496
+ onMouseEnter: t23,
497
+ onFocusCapture: t24,
498
+ children: t31
484
499
  });
485
- $[168] = as;
486
- $[169] = dataAttributeProps;
487
- $[170] = formFieldProps;
488
- $[171] = formFieldRef;
489
- $[172] = labelProps;
490
- $[173] = t20;
491
- $[174] = t21;
492
- $[175] = t22;
493
- $[176] = t28;
494
- $[177] = t29;
495
- } else t29 = $[177];
496
- let t30;
497
- if ($[178] !== as || $[179] !== error || $[180] !== t19 || $[181] !== t29) {
498
- t30 = /* @__PURE__ */ jsx(TooltipWrapper, {
500
+ $[174] = as;
501
+ $[175] = dataAttributeProps;
502
+ $[176] = formFieldProps;
503
+ $[177] = formFieldRef;
504
+ $[178] = labelProps;
505
+ $[179] = t22;
506
+ $[180] = t23;
507
+ $[181] = t24;
508
+ $[182] = t31;
509
+ $[183] = t32;
510
+ } else t32 = $[183];
511
+ let t33;
512
+ if ($[184] !== as || $[185] !== error || $[186] !== t21 || $[187] !== t32) {
513
+ t33 = /* @__PURE__ */ jsx(TooltipWrapper, {
499
514
  as,
500
515
  error,
501
- triggerTabIndex: t19,
502
- children: t29
516
+ triggerTabIndex: t21,
517
+ children: t32
503
518
  });
504
- $[178] = as;
505
- $[179] = error;
506
- $[180] = t19;
507
- $[181] = t29;
508
- $[182] = t30;
509
- } else t30 = $[182];
510
- return t30;
519
+ $[184] = as;
520
+ $[185] = error;
521
+ $[186] = t21;
522
+ $[187] = t32;
523
+ $[188] = t33;
524
+ } else t33 = $[188];
525
+ return t33;
526
+ };
527
+ var inputFrameContentGroupClassNames = {
528
+ "date-picker": "group/date-picker-content",
529
+ input: "group/input-content",
530
+ select: "group/select-content"
511
531
  };
512
532
  var renderIconVisual = (icon) => {
513
533
  if (isValidElement(icon)) return icon;
@@ -4,6 +4,10 @@ var uiPlugin = plugin(({ addVariant }) => {
4
4
  addVariant("input-filled", [
5
5
  "&:has(input:not(:placeholder-shown))",
6
6
  "&:is(:where(.group\\/input-content):has(:is(input:not(:placeholder-shown))) *)",
7
+ "&:is(:where(.group\\/input-content)[data-is-filled])",
8
+ "&:is(:where(.group\\/input-content)[data-is-filled] *)",
9
+ "&:is(:where(.group\\/input-content)[data-has-selection])",
10
+ "&:is(:where(.group\\/input-content)[data-has-selection] *)",
7
11
  "&:is(:where(.group\\/select-content)[data-has-selection] *)",
8
12
  "&:is(:where(.group\\/select-content)[data-has-search] *)",
9
13
  "&:is(:where(.group\\/select-content)[data-searchable-focus-within] *)",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@povio/ui",
3
- "version": "2.3.2-rc.2",
3
+ "version": "2.3.2-rc.3",
4
4
  "type": "module",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,38 +0,0 @@
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 {};