@povio/ui 2.3.0-rc.39 → 2.3.0-rc.40

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.
Files changed (49) hide show
  1. package/dist/components/inputs/Checkbox/Checkbox.js +50 -45
  2. package/dist/components/inputs/Checkbox/checkbox.cva.js +2 -0
  3. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +25 -6
  4. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +31 -7
  5. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +18 -5
  6. package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +97 -68
  7. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +131 -136
  8. package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +1 -1
  9. package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +39 -37
  10. package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +9 -1
  11. package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +43 -7
  12. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +16 -8
  13. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +43 -40
  14. package/dist/components/inputs/File/InputUpload.js +1 -1
  15. package/dist/components/inputs/File/shared/InputUploadFilled.js +1 -1
  16. package/dist/components/inputs/Input/NumberInput/NumberInput.js +103 -97
  17. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +2 -2
  18. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +52 -29
  19. package/dist/components/inputs/Input/TextArea/TextArea.js +2 -2
  20. package/dist/components/inputs/Input/TextInput/TextInput.js +2 -1
  21. package/dist/components/inputs/RadioGroup/RadioGroup.js +29 -43
  22. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +1 -0
  23. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +2 -2
  24. package/dist/components/inputs/Selection/Select/QuerySelect.js +45 -63
  25. package/dist/components/inputs/Selection/Select/Select.js +1 -0
  26. package/dist/components/inputs/Selection/shared/SelectDesktop.js +2 -2
  27. package/dist/components/inputs/Selection/shared/SelectInput.js +54 -53
  28. package/dist/components/inputs/Selection/shared/SelectMobile.js +3 -2
  29. package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +1 -0
  30. package/dist/components/inputs/Selection/shared/querySelect.utils.js +12 -1
  31. package/dist/components/inputs/Selection/shared/select.context.js +3 -1
  32. package/dist/components/inputs/Skeleton/InputFrame.d.ts +1 -0
  33. package/dist/components/inputs/Skeleton/InputFrame.js +100 -92
  34. package/dist/components/inputs/Slider/Slider.d.ts +2 -1
  35. package/dist/components/inputs/Slider/Slider.js +170 -156
  36. package/dist/components/inputs/TextEditor/TextEditor.js +1 -1
  37. package/dist/components/inputs/Toggle/Toggle.js +70 -64
  38. package/dist/components/inputs/Toggle/toggle.cva.js +2 -1
  39. package/dist/components/inputs/shared/InputClear.js +71 -61
  40. package/dist/components/inputs/shared/input.cva.js +22 -10
  41. package/dist/components/inputs/shared/label.cva.js +2 -2
  42. package/dist/components/overlays/BottomSheet/BottomSheet.js +26 -2
  43. package/dist/config/uiConfig.context.d.ts +3 -1
  44. package/dist/config/uiConfig.context.js +2 -1
  45. package/dist/tw-ui-plugin.js +6 -1
  46. package/dist/utils/date-time.utils.d.ts +5 -0
  47. package/dist/utils/date-time.utils.js +10 -0
  48. package/dist/utils/dom.utils.js +1 -1
  49. package/package.json +1 -1
@@ -4,7 +4,6 @@ import { CheckContent } from "../shared/CheckContent.js";
4
4
  import { FormFieldLabel } from "../FormField/FormFieldLabel.js";
5
5
  import { inputBase, inputSize } from "../shared/input.cva.js";
6
6
  import { FormField } from "../FormField/FormField.js";
7
- import { TooltipWrapper } from "../shared/TooltipWrapper.js";
8
7
  import { radio, radioContentClassName, radioContentRow, radioContentWrapper, radioIndicatorClass, radioTypography } from "./radio.cva.js";
9
8
  import { c } from "react/compiler-runtime";
10
9
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -15,7 +14,7 @@ import { mergeRefs } from "@react-aria/utils";
15
14
  import { Controller } from "react-hook-form";
16
15
  //#region src/components/inputs/RadioGroup/RadioGroup.tsx
17
16
  var RadioGroupBase = (props) => {
18
- const $ = c(96);
17
+ const $ = c(91);
19
18
  const ui = UIConfig.useConfig();
20
19
  const radioCva = UIStyle.useCva("radio.cva", radio);
21
20
  const radioContentWrapperCva = UIStyle.useCva("radio.contentWrapperCva", radioContentWrapper);
@@ -121,13 +120,12 @@ var RadioGroupBase = (props) => {
121
120
  $[28] = t5;
122
121
  } else t5 = $[28];
123
122
  const handleChange = t5;
124
- const T0 = TooltipWrapper;
125
- const t6 = as === "inline" ? -1 : void 0;
126
- const T1 = RadioGroup;
127
- const t7 = !!error;
128
- const t8 = isDirty || void 0;
129
- const t9 = isRequired || void 0;
130
- const T2 = FormField;
123
+ const T0 = RadioGroup;
124
+ const t6 = !!error;
125
+ const t7 = isDirty || void 0;
126
+ const t8 = isRequired || void 0;
127
+ const t9 = "group";
128
+ const T1 = FormField;
131
129
  const t10 = as === "inline" && "h-full";
132
130
  let t11;
133
131
  if ($[29] !== className || $[30] !== t10) {
@@ -259,8 +257,8 @@ var RadioGroupBase = (props) => {
259
257
  $[68] = t28;
260
258
  } else t28 = $[68];
261
259
  let t29;
262
- if ($[69] !== T2 || $[70] !== as || $[71] !== formFieldProps || $[72] !== labelProps || $[73] !== t11 || $[74] !== t12 || $[75] !== t28) {
263
- t29 = /* @__PURE__ */ jsx(T2, {
260
+ if ($[69] !== T1 || $[70] !== as || $[71] !== formFieldProps || $[72] !== labelProps || $[73] !== t11 || $[74] !== t12 || $[75] !== t28) {
261
+ t29 = /* @__PURE__ */ jsx(T1, {
264
262
  ...formFieldProps,
265
263
  as,
266
264
  labelProps,
@@ -268,7 +266,7 @@ var RadioGroupBase = (props) => {
268
266
  tabIndex: t12,
269
267
  children: t28
270
268
  });
271
- $[69] = T2;
269
+ $[69] = T1;
272
270
  $[70] = as;
273
271
  $[71] = formFieldProps;
274
272
  $[72] = labelProps;
@@ -278,50 +276,38 @@ var RadioGroupBase = (props) => {
278
276
  $[76] = t29;
279
277
  } else t29 = $[76];
280
278
  let t30;
281
- if ($[77] !== T1 || $[78] !== defaultValue || $[79] !== fieldProps || $[80] !== handleChange || $[81] !== isDisabled || $[82] !== ref || $[83] !== rest || $[84] !== t29 || $[85] !== t7 || $[86] !== t8 || $[87] !== t9 || $[88] !== value) {
282
- t30 = /* @__PURE__ */ jsx(T1, {
279
+ if ($[77] !== T0 || $[78] !== defaultValue || $[79] !== fieldProps || $[80] !== handleChange || $[81] !== isDisabled || $[82] !== onBlur || $[83] !== ref || $[84] !== rest || $[85] !== t29 || $[86] !== t6 || $[87] !== t7 || $[88] !== t8 || $[89] !== value) {
280
+ t30 = /* @__PURE__ */ jsx(T0, {
283
281
  ...rest,
284
282
  ...fieldProps,
285
283
  ref,
286
284
  value,
287
285
  defaultValue,
288
286
  onChange: handleChange,
287
+ onBlur,
289
288
  isDisabled,
290
- isInvalid: t7,
291
- "data-is-dirty": t8,
292
- "data-is-required": t9,
289
+ isInvalid: t6,
290
+ "data-is-dirty": t7,
291
+ "data-is-required": t8,
292
+ className: t9,
293
293
  children: t29
294
294
  });
295
- $[77] = T1;
295
+ $[77] = T0;
296
296
  $[78] = defaultValue;
297
297
  $[79] = fieldProps;
298
298
  $[80] = handleChange;
299
299
  $[81] = isDisabled;
300
- $[82] = ref;
301
- $[83] = rest;
302
- $[84] = t29;
303
- $[85] = t7;
304
- $[86] = t8;
305
- $[87] = t9;
306
- $[88] = value;
307
- $[89] = t30;
308
- } else t30 = $[89];
309
- let t31;
310
- if ($[90] !== T0 || $[91] !== as || $[92] !== error || $[93] !== t30 || $[94] !== t6) {
311
- t31 = /* @__PURE__ */ jsx(T0, {
312
- as,
313
- error,
314
- triggerTabIndex: t6,
315
- children: t30
316
- });
317
- $[90] = T0;
318
- $[91] = as;
319
- $[92] = error;
320
- $[93] = t30;
321
- $[94] = t6;
322
- $[95] = t31;
323
- } else t31 = $[95];
324
- return t31;
300
+ $[82] = onBlur;
301
+ $[83] = ref;
302
+ $[84] = rest;
303
+ $[85] = t29;
304
+ $[86] = t6;
305
+ $[87] = t7;
306
+ $[88] = t8;
307
+ $[89] = value;
308
+ $[90] = t30;
309
+ } else t30 = $[90];
310
+ return t30;
325
311
  };
326
312
  var RadioGroup$1 = (props) => {
327
313
  const $ = c(15);
@@ -81,6 +81,7 @@ function AutocompleteInner(t0) {
81
81
  return /* @__PURE__ */ jsx(InputFrame, {
82
82
  ...props,
83
83
  isDisabled: t2,
84
+ isLoading: false,
84
85
  className: t3,
85
86
  inputClassName: t4,
86
87
  contentWrapperClassName: t5,
@@ -1,6 +1,6 @@
1
1
  import { UIConfig } from "../../../../config/uiConfig.context.js";
2
2
  import { Autocomplete } from "./Autocomplete.js";
3
- import { getQueryItems } from "../shared/querySelect.utils.js";
3
+ import { getQueryItems, isInitialSelectionLabelMissing } from "../shared/querySelect.utils.js";
4
4
  import { useQueryAutocomplete } from "../../../../hooks/useQueryAutocomplete.js";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
  import { useState } from "react";
@@ -16,7 +16,7 @@ var QueryAutocomplete = ({ query, queryParams, queryOptions, queryMap, leadingCo
16
16
  queryOptions,
17
17
  mapItems: (data) => getQueryItems(data, queryMap),
18
18
  search,
19
- initialQueryState: props.isInitialQueryDisabled ?? ui.queryAutocomplete?.isInitialQueryDisabled
19
+ initialQueryState: isInitialSelectionLabelMissing(props.initialSelection, props.mapInitialToSelectItem) ? false : props.isInitialQueryDisabled ?? ui.queryAutocomplete?.isInitialQueryDisabled
20
20
  });
21
21
  const handleChange = (value) => {
22
22
  onChange?.(value);
@@ -1,46 +1,27 @@
1
1
  import { UIConfig } from "../../../../config/uiConfig.context.js";
2
2
  import { Select } from "./Select.js";
3
- import { getQueryItems } from "../shared/querySelect.utils.js";
3
+ import { getQueryItems, isInitialSelectionLabelMissing } 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
8
  //#region src/components/inputs/Selection/Select/QuerySelect.tsx
9
9
  var QuerySelect = (t0) => {
10
- const $ = c(33);
11
- let props;
12
- let query;
13
- let queryMap;
14
- let queryOptions;
15
- let queryParams;
16
- if ($[0] !== t0) {
17
- ({query, queryParams, queryOptions, queryMap, ...props} = t0);
18
- $[0] = t0;
19
- $[1] = props;
20
- $[2] = query;
21
- $[3] = queryMap;
22
- $[4] = queryOptions;
23
- $[5] = queryParams;
24
- } else {
25
- props = $[1];
26
- query = $[2];
27
- queryMap = $[3];
28
- queryOptions = $[4];
29
- queryParams = $[5];
30
- }
10
+ const $ = c(28);
11
+ const { query, queryParams, queryOptions, queryMap, ...props } = t0;
31
12
  const ui = UIConfig.useConfig();
32
13
  const [search, setSearch] = useState("");
33
14
  const isSearchable = props.isSearchable ?? ui.select.isSearchable;
34
15
  let t1;
35
- if ($[6] !== queryMap) {
16
+ if ($[0] !== queryMap) {
36
17
  t1 = (data) => getQueryItems(data, queryMap);
37
- $[6] = queryMap;
38
- $[7] = t1;
39
- } else t1 = $[7];
18
+ $[0] = queryMap;
19
+ $[1] = t1;
20
+ } else t1 = $[1];
40
21
  const t2 = isSearchable ? search : void 0;
41
- const t3 = props.isInitialQueryDisabled ?? ui.querySelect?.isInitialQueryDisabled;
22
+ const t3 = isInitialSelectionLabelMissing(props.initialSelection, props.mapInitialToSelectItem) ? false : props.isInitialQueryDisabled ?? ui.querySelect?.isInitialQueryDisabled;
42
23
  let t4;
43
- if ($[8] !== query || $[9] !== queryOptions || $[10] !== queryParams || $[11] !== t1 || $[12] !== t2 || $[13] !== t3) {
24
+ if ($[2] !== query || $[3] !== queryOptions || $[4] !== queryParams || $[5] !== t1 || $[6] !== t2 || $[7] !== t3) {
44
25
  t4 = {
45
26
  query,
46
27
  queryParams,
@@ -49,52 +30,53 @@ var QuerySelect = (t0) => {
49
30
  search: t2,
50
31
  initialQueryState: t3
51
32
  };
52
- $[8] = query;
53
- $[9] = queryOptions;
54
- $[10] = queryParams;
55
- $[11] = t1;
56
- $[12] = t2;
57
- $[13] = t3;
58
- $[14] = t4;
59
- } else t4 = $[14];
33
+ $[2] = query;
34
+ $[3] = queryOptions;
35
+ $[4] = queryParams;
36
+ $[5] = t1;
37
+ $[6] = t2;
38
+ $[7] = t3;
39
+ $[8] = t4;
40
+ } else t4 = $[8];
60
41
  const { items, totalItems, isLoading, handleEnableQuery, hasNextPage, fetchNextPage } = useQueryAutocomplete(t4);
61
42
  let onSearchChange;
62
43
  let selectProps;
63
- if ($[15] !== props) {
44
+ if ($[9] !== props) {
64
45
  const { isInitialQueryDisabled: _, onSearchChange: t5, ...t6 } = props;
65
46
  onSearchChange = t5;
66
47
  selectProps = t6;
67
- $[15] = props;
68
- $[16] = onSearchChange;
69
- $[17] = selectProps;
48
+ $[9] = props;
49
+ $[10] = onSearchChange;
50
+ $[11] = selectProps;
70
51
  } else {
71
- onSearchChange = $[16];
72
- selectProps = $[17];
52
+ onSearchChange = $[10];
53
+ selectProps = $[11];
73
54
  }
74
55
  let t5;
75
- if ($[18] !== handleEnableQuery || $[19] !== onSearchChange) {
56
+ if ($[12] !== handleEnableQuery || $[13] !== onSearchChange || $[14] !== setSearch) {
76
57
  t5 = (value) => {
77
58
  setSearch(value);
78
59
  handleEnableQuery();
79
60
  onSearchChange?.(value);
80
61
  };
81
- $[18] = handleEnableQuery;
82
- $[19] = onSearchChange;
83
- $[20] = t5;
84
- } else t5 = $[20];
62
+ $[12] = handleEnableQuery;
63
+ $[13] = onSearchChange;
64
+ $[14] = setSearch;
65
+ $[15] = t5;
66
+ } else t5 = $[15];
85
67
  const handleSearchChange = t5;
86
68
  let t6;
87
- if ($[21] !== handleSearchChange || $[22] !== isSearchable) {
69
+ if ($[16] !== handleSearchChange || $[17] !== isSearchable) {
88
70
  t6 = isSearchable && {
89
71
  isClientSearchDisabled: true,
90
72
  onSearchChange: handleSearchChange
91
73
  };
92
- $[21] = handleSearchChange;
93
- $[22] = isSearchable;
94
- $[23] = t6;
95
- } else t6 = $[23];
74
+ $[16] = handleSearchChange;
75
+ $[17] = isSearchable;
76
+ $[18] = t6;
77
+ } else t6 = $[18];
96
78
  let t7;
97
- if ($[24] !== fetchNextPage || $[25] !== handleEnableQuery || $[26] !== hasNextPage || $[27] !== isLoading || $[28] !== items || $[29] !== selectProps || $[30] !== t6 || $[31] !== totalItems) {
79
+ if ($[19] !== fetchNextPage || $[20] !== handleEnableQuery || $[21] !== hasNextPage || $[22] !== isLoading || $[23] !== items || $[24] !== selectProps || $[25] !== t6 || $[26] !== totalItems) {
98
80
  t7 = /* @__PURE__ */ jsx(Select, {
99
81
  ...selectProps,
100
82
  items,
@@ -106,16 +88,16 @@ var QuerySelect = (t0) => {
106
88
  onFocusCapture: handleEnableQuery,
107
89
  ...t6
108
90
  });
109
- $[24] = fetchNextPage;
110
- $[25] = handleEnableQuery;
111
- $[26] = hasNextPage;
112
- $[27] = isLoading;
113
- $[28] = items;
114
- $[29] = selectProps;
115
- $[30] = t6;
116
- $[31] = totalItems;
117
- $[32] = t7;
118
- } else t7 = $[32];
91
+ $[19] = fetchNextPage;
92
+ $[20] = handleEnableQuery;
93
+ $[21] = hasNextPage;
94
+ $[22] = isLoading;
95
+ $[23] = items;
96
+ $[24] = selectProps;
97
+ $[25] = t6;
98
+ $[26] = totalItems;
99
+ $[27] = t7;
100
+ } else t7 = $[27];
119
101
  return t7;
120
102
  };
121
103
  //#endregion
@@ -87,6 +87,7 @@ function SelectInner(t0) {
87
87
  return /* @__PURE__ */ jsx(InputFrame, {
88
88
  ...props,
89
89
  isDisabled,
90
+ isLoading: false,
90
91
  className: clsx("w-full", props.containerClassName),
91
92
  inputClassName: clsx(props.className, props.inputClassName),
92
93
  contentWrapperClassName: selectInputTagsContentWrapperCva({ isSearchable }),
@@ -185,7 +185,7 @@ var SelectDesktop = (t0) => {
185
185
  const t12 = !!error;
186
186
  let t13;
187
187
  if ($[43] !== containerClassName) {
188
- t13 = clsx("w-full", containerClassName);
188
+ t13 = clsx("group w-full", containerClassName);
189
189
  $[43] = containerClassName;
190
190
  $[44] = t13;
191
191
  } else t13 = $[44];
@@ -272,7 +272,7 @@ var SelectDesktop = (t0) => {
272
272
  if ($[74] !== containerClassName || $[75] !== isSearchable || $[76] !== labelProps) {
273
273
  t20 = !isSearchable && {
274
274
  labelProps,
275
- className: clsx("w-full", containerClassName)
275
+ className: clsx("group w-full", containerClassName)
276
276
  };
277
277
  $[74] = containerClassName;
278
278
  $[75] = isSearchable;
@@ -17,7 +17,7 @@ import { useFocusVisible, useFocusWithin, useHover } from "react-aria";
17
17
  import { useTranslation } from "react-i18next";
18
18
  //#region src/components/inputs/Selection/shared/SelectInput.tsx
19
19
  var SelectInput = (t0) => {
20
- const $0 = c(107);
20
+ const $0 = c(108);
21
21
  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;
22
22
  const inputSizeCva = UIStyle.useCva("input.sizeCva", inputSize);
23
23
  const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
@@ -43,7 +43,7 @@ var SelectInput = (t0) => {
43
43
  const { fieldState, isOpen, setIsOpen, listItems, selectedItems, onChange, onClear, onRemove, isMultiple, isLoading } = SelectContext.useSelect();
44
44
  const isEmpty = selectedItems.length === 0;
45
45
  const showTags = isMultiple && !isEmpty;
46
- const showClearButton = isClearable && isHovered && (selectedItems.length > 0 || isSearchable && fieldState.inputValue !== "");
46
+ const showClearButton = !isDisabled && isClearable && (selectedItems.length > 0 || isSearchable && fieldState.inputValue !== "");
47
47
  let t3;
48
48
  bb0: {
49
49
  let t4;
@@ -177,7 +177,7 @@ var SelectInput = (t0) => {
177
177
  ref: inputRef,
178
178
  placeholder: as === "floating" ? void 0 : placeholder,
179
179
  onBlur,
180
- className: clsx("w-full flex-1 bg-transparent outline-none placeholder:text-text-default-3 disabled:text-interactive-text-secondary-disabled", inputClassName),
180
+ className: clsx("w-full flex-1 bg-transparent outline-none placeholder:text-text-default-3", "disabled:text-text-default-3 disabled:placeholder:text-interactive-text-secondary-disabled", inputClassName),
181
181
  onKeyDown,
182
182
  ...fieldProps
183
183
  })]
@@ -204,11 +204,11 @@ var SelectInput = (t0) => {
204
204
  onPress: () => setIsOpen(!isOpen),
205
205
  onBlur,
206
206
  "data-type": "select-trigger",
207
- className: clsx("w-full truncate text-start outline-none disabled:text-interactive-text-secondary-disabled", showTags && "absolute inset-0 z-0"),
207
+ className: clsx("group/select-trigger w-full truncate text-start outline-none disabled:text-text-default-3", showTags && "absolute inset-0 z-0"),
208
208
  ...fieldProps,
209
209
  children: [(as === "floating" && isEmpty || isMultiple && !isEmpty) && /* @__PURE__ */ jsx(Fragment, { children: "\xA0" }), (isEmpty || !isMultiple) && (as !== "floating" || !isEmpty) && /* @__PURE__ */ jsxs(Typography, {
210
210
  size: "label-1",
211
- className: clsx("truncate empty:before:inline-block empty:before:content-['']", isEmpty && "text-text-default-3"),
211
+ className: clsx("truncate empty:before:inline-block empty:before:content-['']", isEmpty && "text-text-default-3 group-disabled/select-trigger:text-interactive-text-secondary-disabled"),
212
212
  children: [isEmpty && placeholder, !isEmpty && (showSelectionContent ? selectedItems[0].content : selectedItems[0].label)]
213
213
  })]
214
214
  });
@@ -248,8 +248,8 @@ var SelectInput = (t0) => {
248
248
  $0[64] = t28;
249
249
  } else t28 = $0[64];
250
250
  let t29;
251
- if ($0[65] !== as || $0[66] !== inputClearClassCva || $0[67] !== isClearable || $0[68] !== onClear || $0[69] !== showClearButton) {
252
- t29 = isClearable && /* @__PURE__ */ jsx(InputClear, {
251
+ if ($0[65] !== as || $0[66] !== inputClearClassCva || $0[67] !== isClearable || $0[68] !== isDisabled || $0[69] !== onClear || $0[70] !== showClearButton) {
252
+ t29 = isClearable && !isDisabled && /* @__PURE__ */ jsx(InputClear, {
253
253
  onClear: () => {
254
254
  onClear();
255
255
  },
@@ -259,21 +259,22 @@ var SelectInput = (t0) => {
259
259
  $0[65] = as;
260
260
  $0[66] = inputClearClassCva;
261
261
  $0[67] = isClearable;
262
- $0[68] = onClear;
263
- $0[69] = showClearButton;
264
- $0[70] = t29;
265
- } else t29 = $0[70];
262
+ $0[68] = isDisabled;
263
+ $0[69] = onClear;
264
+ $0[70] = showClearButton;
265
+ $0[71] = t29;
266
+ } else t29 = $0[71];
266
267
  let t30;
267
- if ($0[71] !== trailingContent) {
268
+ if ($0[72] !== trailingContent) {
268
269
  t30 = trailingContent && /* @__PURE__ */ jsx("div", {
269
270
  className: "flex shrink-0 items-center",
270
271
  children: trailingContent
271
272
  });
272
- $0[71] = trailingContent;
273
- $0[72] = t30;
274
- } else t30 = $0[72];
273
+ $0[72] = trailingContent;
274
+ $0[73] = t30;
275
+ } else t30 = $0[73];
275
276
  let t31;
276
- if ($0[73] !== hideDropdownIcon || $0[74] !== inputSizeCva || $0[75] !== isDisabled || $0[76] !== isOpen || $0[77] !== isSearchable || $0[78] !== setIsOpen || $0[79] !== size || $0[80] !== t) {
277
+ if ($0[74] !== hideDropdownIcon || $0[75] !== inputSizeCva || $0[76] !== isDisabled || $0[77] !== isOpen || $0[78] !== isSearchable || $0[79] !== setIsOpen || $0[80] !== size || $0[81] !== t) {
277
278
  t31 = !hideDropdownIcon && /* @__PURE__ */ jsx(Button, {
278
279
  excludeFromTabOrder: true,
279
280
  "aria-label": t(($) => isOpen ? $.ui.closeAlt : $.ui.openAlt),
@@ -287,18 +288,18 @@ var SelectInput = (t0) => {
287
288
  "aria-hidden": "true"
288
289
  })
289
290
  });
290
- $0[73] = hideDropdownIcon;
291
- $0[74] = inputSizeCva;
292
- $0[75] = isDisabled;
293
- $0[76] = isOpen;
294
- $0[77] = isSearchable;
295
- $0[78] = setIsOpen;
296
- $0[79] = size;
297
- $0[80] = t;
298
- $0[81] = t31;
299
- } else t31 = $0[81];
291
+ $0[74] = hideDropdownIcon;
292
+ $0[75] = inputSizeCva;
293
+ $0[76] = isDisabled;
294
+ $0[77] = isOpen;
295
+ $0[78] = isSearchable;
296
+ $0[79] = setIsOpen;
297
+ $0[80] = size;
298
+ $0[81] = t;
299
+ $0[82] = t31;
300
+ } else t31 = $0[82];
300
301
  let t32;
301
- if ($0[82] !== focusWithinProps || $0[83] !== hoverProps || $0[84] !== onFocusCapture || $0[85] !== onMouseEnter || $0[86] !== ref || $0[87] !== t10 || $0[88] !== t11 || $0[89] !== t12 || $0[90] !== t13 || $0[91] !== t14 || $0[92] !== t15 || $0[93] !== t16 || $0[94] !== t17 || $0[95] !== t18 || $0[96] !== t19 || $0[97] !== t20 || $0[98] !== t21 || $0[99] !== t28 || $0[100] !== t29 || $0[101] !== t30 || $0[102] !== t31 || $0[103] !== t6 || $0[104] !== t8 || $0[105] !== t9) {
302
+ if ($0[83] !== focusWithinProps || $0[84] !== hoverProps || $0[85] !== onFocusCapture || $0[86] !== onMouseEnter || $0[87] !== ref || $0[88] !== t10 || $0[89] !== t11 || $0[90] !== t12 || $0[91] !== t13 || $0[92] !== t14 || $0[93] !== t15 || $0[94] !== t16 || $0[95] !== t17 || $0[96] !== t18 || $0[97] !== t19 || $0[98] !== t20 || $0[99] !== t21 || $0[100] !== t28 || $0[101] !== t29 || $0[102] !== t30 || $0[103] !== t31 || $0[104] !== t6 || $0[105] !== t8 || $0[106] !== t9) {
302
303
  t32 = /* @__PURE__ */ jsxs("div", {
303
304
  ref,
304
305
  className: t6,
@@ -329,32 +330,32 @@ var SelectInput = (t0) => {
329
330
  t31
330
331
  ]
331
332
  });
332
- $0[82] = focusWithinProps;
333
- $0[83] = hoverProps;
334
- $0[84] = onFocusCapture;
335
- $0[85] = onMouseEnter;
336
- $0[86] = ref;
337
- $0[87] = t10;
338
- $0[88] = t11;
339
- $0[89] = t12;
340
- $0[90] = t13;
341
- $0[91] = t14;
342
- $0[92] = t15;
343
- $0[93] = t16;
344
- $0[94] = t17;
345
- $0[95] = t18;
346
- $0[96] = t19;
347
- $0[97] = t20;
348
- $0[98] = t21;
349
- $0[99] = t28;
350
- $0[100] = t29;
351
- $0[101] = t30;
352
- $0[102] = t31;
353
- $0[103] = t6;
354
- $0[104] = t8;
355
- $0[105] = t9;
356
- $0[106] = t32;
357
- } else t32 = $0[106];
333
+ $0[83] = focusWithinProps;
334
+ $0[84] = hoverProps;
335
+ $0[85] = onFocusCapture;
336
+ $0[86] = onMouseEnter;
337
+ $0[87] = ref;
338
+ $0[88] = t10;
339
+ $0[89] = t11;
340
+ $0[90] = t12;
341
+ $0[91] = t13;
342
+ $0[92] = t14;
343
+ $0[93] = t15;
344
+ $0[94] = t16;
345
+ $0[95] = t17;
346
+ $0[96] = t18;
347
+ $0[97] = t19;
348
+ $0[98] = t20;
349
+ $0[99] = t21;
350
+ $0[100] = t28;
351
+ $0[101] = t29;
352
+ $0[102] = t30;
353
+ $0[103] = t31;
354
+ $0[104] = t6;
355
+ $0[105] = t8;
356
+ $0[106] = t9;
357
+ $0[107] = t32;
358
+ } else t32 = $0[107];
358
359
  return t32;
359
360
  };
360
361
  //#endregion
@@ -56,7 +56,7 @@ var SelectMobile = ({ ref, error, showSelectionContent, inputClassName, containe
56
56
  ...formFieldProps,
57
57
  as,
58
58
  labelProps,
59
- className: clsx("w-full", containerClassName),
59
+ className: clsx("group w-full", containerClassName),
60
60
  onMouseEnter,
61
61
  onFocusCapture,
62
62
  children: /* @__PURE__ */ jsxs(DialogTrigger, {
@@ -109,7 +109,8 @@ var SelectMobile = ({ ref, error, showSelectionContent, inputClassName, containe
109
109
  inputClassName,
110
110
  className: "mb-list-height-title-bottom px-list-side-title",
111
111
  leadingIcon: !hideSearchIcon ? /* @__PURE__ */ jsx(SearchIcon, { className: "size-6" }) : void 0,
112
- size: "default"
112
+ size: "default",
113
+ isClearable
113
114
  }), /* @__PURE__ */ jsx(SelectListBox, {
114
115
  ...props,
115
116
  autoFocus: !isSearchable,
@@ -3,4 +3,5 @@ import { Key } from 'react-aria-components';
3
3
  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
+ export declare const isInitialSelectionLabelMissing: <TInitialSelectItem>(initialSelection: TInitialSelectItem | TInitialSelectItem[] | null | undefined, mapInitialToSelectItem?: (item: TInitialSelectItem) => SelectItem) => boolean;
6
7
  export declare const getQueryItems: <TQueryFn extends QueryFn, TKey extends Key = Key>(data: QueryDataType<TQueryFn> | undefined, queryMap?: (data: QueryDataType<TQueryFn>) => SelectItem<TKey>[]) => SelectItem<TKey>[];
@@ -1,4 +1,15 @@
1
1
  //#region src/components/inputs/Selection/shared/querySelect.utils.ts
2
+ var getDefaultInitialSelectionLabel = (initialSelection) => {
3
+ if (typeof initialSelection !== "object" || initialSelection === null) return "";
4
+ if ("label" in initialSelection && typeof initialSelection.label === "string") return initialSelection.label;
5
+ if ("name" in initialSelection && typeof initialSelection.name === "string") return initialSelection.name;
6
+ return "";
7
+ };
8
+ var isInitialSelectionLabelMissing = (initialSelection, mapInitialToSelectItem) => {
9
+ return (Array.isArray(initialSelection) ? initialSelection : initialSelection != null ? [initialSelection] : []).some((item) => {
10
+ return (mapInitialToSelectItem?.(item).label ?? getDefaultInitialSelectionLabel(item)) === "";
11
+ });
12
+ };
2
13
  var getQueryItems = (data, queryMap) => {
3
14
  if (!data) return [];
4
15
  if (queryMap) return queryMap(data);
@@ -10,4 +21,4 @@ var getQueryItems = (data, queryMap) => {
10
21
  return [];
11
22
  };
12
23
  //#endregion
13
- export { getQueryItems };
24
+ export { getQueryItems, isInitialSelectionLabelMissing };
@@ -166,10 +166,12 @@ var SelectContext;
166
166
  emitStateChanges(newFieldState_2);
167
167
  setShowAll(true);
168
168
  }
169
+ fieldOnBlur?.({});
169
170
  }, [
170
171
  props.isSearchable,
171
172
  isMultiple,
172
- fieldState
173
+ fieldState,
174
+ fieldOnBlur
173
175
  ]);
174
176
  const value_5 = useMemo(() => ({
175
177
  fieldState,
@@ -72,6 +72,7 @@ export interface InputFrameProps extends InputVariantProps, Partial<FormFieldPro
72
72
  contentAndTrailingClassName?: string;
73
73
  wrapContentAndTrailing?: boolean;
74
74
  wrapTrailingContent?: boolean;
75
+ reserveTrailingContent?: boolean;
75
76
  labelPlacement?: InputFrameLabelPlacement;
76
77
  trailingClassName?: string;
77
78
  }