impact-nova 2.2.9 → 2.4.0

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 (154) hide show
  1. package/dist/components/data/ag-grid-react/headers/utils/filter-utils.js +9 -9
  2. package/dist/components/data-display/calendar/calendar-day-picker-components.js +69 -56
  3. package/dist/components/data-display/calendar/calendar-padding-week.utils.d.ts +5 -0
  4. package/dist/components/data-display/calendar/calendar-padding-week.utils.js +6 -0
  5. package/dist/components/data-display/calendar/calendar.types.d.ts +1 -1
  6. package/dist/components/forms/combobox/combobox.js +185 -160
  7. package/dist/components/forms/combobox/combobox.types.d.ts +2 -0
  8. package/dist/filter-shell/index.d.ts +12 -0
  9. package/dist/filter-shell/index.js +9 -0
  10. package/dist/filter-shell/utils/buildFilterFieldValidationRules.d.ts +1 -0
  11. package/dist/filter-shell/utils/validateVisibleRequiredFilterFields.d.ts +1 -0
  12. package/dist/filter-shell/utils/validationNavigation.utils.d.ts +26 -0
  13. package/dist/filter-shell/utils/validationNavigation.utils.js +38 -0
  14. package/dist/form-engine/field-dependency-graph.d.ts +17 -0
  15. package/dist/form-engine/field-dependency-graph.js +90 -0
  16. package/dist/form-engine/index.d.ts +9 -0
  17. package/dist/form-engine/index.js +16 -0
  18. package/dist/form-engine/is-empty-value.d.ts +1 -0
  19. package/dist/form-engine/is-empty-value.js +8 -0
  20. package/dist/form-engine/types.d.ts +17 -0
  21. package/dist/form-react/Fields/ButtonsGroupField.d.ts +3 -0
  22. package/dist/form-react/Fields/ButtonsGroupField.js +52 -0
  23. package/dist/form-react/Fields/CheckboxField.d.ts +3 -0
  24. package/dist/form-react/Fields/CheckboxField.js +46 -0
  25. package/dist/form-react/Fields/ChipsField.d.ts +3 -0
  26. package/dist/form-react/Fields/ChipsField.js +146 -0
  27. package/dist/form-react/Fields/DateInputField.d.ts +8 -0
  28. package/dist/form-react/Fields/DateInputField.js +134 -0
  29. package/dist/form-react/Fields/DateRangeField.d.ts +8 -0
  30. package/dist/form-react/Fields/DateRangeField.js +57 -0
  31. package/dist/form-react/Fields/DividerField.d.ts +3 -0
  32. package/dist/form-react/Fields/DividerField.js +9 -0
  33. package/dist/form-react/Fields/DividerWithLabelField.d.ts +3 -0
  34. package/dist/form-react/Fields/DividerWithLabelField.js +31 -0
  35. package/dist/form-react/Fields/FileUploadField.d.ts +3 -0
  36. package/dist/form-react/Fields/FileUploadField.js +42 -0
  37. package/dist/form-react/Fields/FillFormByFileUploadField.d.ts +3 -0
  38. package/dist/form-react/Fields/FillFormByFileUploadField.js +65 -0
  39. package/dist/form-react/Fields/FillFormByPasteField.d.ts +3 -0
  40. package/dist/form-react/Fields/FillFormByPasteField.js +106 -0
  41. package/dist/form-react/Fields/LabelField.d.ts +3 -0
  42. package/dist/form-react/Fields/LabelField.js +14 -0
  43. package/dist/form-react/Fields/MonthRangeField.d.ts +8 -0
  44. package/dist/form-react/Fields/MonthRangeField.js +72 -0
  45. package/dist/form-react/Fields/MultiMonthPickerField.d.ts +8 -0
  46. package/dist/form-react/Fields/MultiMonthPickerField.js +46 -0
  47. package/dist/form-react/Fields/MultiWeekPickerField.d.ts +8 -0
  48. package/dist/form-react/Fields/MultiWeekPickerField.js +47 -0
  49. package/dist/form-react/Fields/NumericComboboxField.d.ts +18 -0
  50. package/dist/form-react/Fields/NumericComboboxField.js +51 -0
  51. package/dist/form-react/Fields/RadioField.d.ts +3 -0
  52. package/dist/form-react/Fields/RadioField.js +68 -0
  53. package/dist/form-react/Fields/SelectField.d.ts +3 -0
  54. package/dist/form-react/Fields/SelectField.js +76 -0
  55. package/dist/form-react/Fields/SwitchField.d.ts +3 -0
  56. package/dist/form-react/Fields/SwitchField.js +47 -0
  57. package/dist/form-react/Fields/TextAreaField.d.ts +3 -0
  58. package/dist/form-react/Fields/TextAreaField.js +41 -0
  59. package/dist/form-react/Fields/TextField.d.ts +3 -0
  60. package/dist/form-react/Fields/TextField.js +75 -0
  61. package/dist/form-react/Fields/TextFieldWithBackendValidation.d.ts +3 -0
  62. package/dist/form-react/Fields/TextFieldWithBackendValidation.js +117 -0
  63. package/dist/form-react/Fields/WeekRangePicker.d.ts +8 -0
  64. package/dist/form-react/Fields/WeekRangePicker.js +71 -0
  65. package/dist/form-react/ReactHooksForm.d.ts +3 -0
  66. package/dist/form-react/ReactHooksForm.js +132 -0
  67. package/dist/form-react/components/ArrayFieldRenderer.d.ts +13 -0
  68. package/dist/form-react/components/ArrayFieldRenderer.js +90 -0
  69. package/dist/form-react/components/FieldRenderer.d.ts +16 -0
  70. package/dist/form-react/components/FieldRenderer.js +68 -0
  71. package/dist/form-react/components/FormFieldRow.d.ts +13 -0
  72. package/dist/form-react/components/FormFieldRow.js +47 -0
  73. package/dist/form-react/components/FormFileUploadWrapper.d.ts +22 -0
  74. package/dist/form-react/components/FormFileUploadWrapper.js +88 -0
  75. package/dist/form-react/components/ObjectFieldRenderer.d.ts +13 -0
  76. package/dist/form-react/components/ObjectFieldRenderer.js +46 -0
  77. package/dist/form-react/components/SetToEmptyWrapper.d.ts +16 -0
  78. package/dist/form-react/components/SetToEmptyWrapper.js +49 -0
  79. package/dist/form-react/fields.d.ts +23 -0
  80. package/dist/form-react/fields.js +40 -0
  81. package/dist/form-react/hooks/useCascadingForm.d.ts +17 -0
  82. package/dist/form-react/hooks/useCascadingForm.js +122 -0
  83. package/dist/form-react/hooks/useFieldVisibility.d.ts +14 -0
  84. package/dist/form-react/hooks/useFieldVisibility.js +60 -0
  85. package/dist/form-react/hooks/useFillFormByFileUpload.d.ts +33 -0
  86. package/dist/form-react/hooks/useFillFormByFileUpload.js +199 -0
  87. package/dist/form-react/hooks/useFillFormByPaste.d.ts +33 -0
  88. package/dist/form-react/hooks/useFillFormByPaste.js +104 -0
  89. package/dist/form-react/hooks/useFormFieldChangeSubscription.d.ts +13 -0
  90. package/dist/form-react/hooks/useFormFieldChangeSubscription.js +42 -0
  91. package/dist/form-react/hooks/useReactHookForm.d.ts +3 -0
  92. package/dist/form-react/hooks/useReactHookForm.js +161 -0
  93. package/dist/form-react/hooks/useSelectOptions.d.ts +8 -0
  94. package/dist/form-react/hooks/useSelectOptions.js +116 -0
  95. package/dist/form-react/index.d.ts +62 -0
  96. package/dist/form-react/index.js +97 -0
  97. package/dist/form-react/registry/defaultFieldRegistrations.d.ts +2 -0
  98. package/dist/form-react/registry/defaultFieldRegistrations.js +30 -0
  99. package/dist/form-react/registry/fieldRegistry.d.ts +14 -0
  100. package/dist/form-react/registry/fieldRegistry.js +19 -0
  101. package/dist/form-react/registry/resolveFieldComponent.d.ts +10 -0
  102. package/dist/form-react/registry/resolveFieldComponent.js +137 -0
  103. package/dist/form-react/types/fields.types.d.ts +402 -0
  104. package/dist/form-react/types/fieldsOutput.types.d.ts +73 -0
  105. package/dist/form-react/types/reactHookForm.types.d.ts +196 -0
  106. package/dist/form-react/utils/batchFormFieldUpdates.d.ts +14 -0
  107. package/dist/form-react/utils/batchFormFieldUpdates.js +13 -0
  108. package/dist/form-react/utils/buildFieldValidationRules.d.ts +6 -0
  109. package/dist/form-react/utils/buildFieldValidationRules.js +13 -0
  110. package/dist/form-react/utils/buildSelectRemountKey.d.ts +14 -0
  111. package/dist/form-react/utils/buildSelectRemountKey.js +14 -0
  112. package/dist/form-react/utils/calendar-boundary.d.ts +3 -0
  113. package/dist/form-react/utils/calendar-boundary.js +33 -0
  114. package/dist/form-react/utils/date.utils.d.ts +31 -0
  115. package/dist/form-react/utils/date.utils.js +86 -0
  116. package/dist/form-react/utils/evaluateFieldValidation.d.ts +19 -0
  117. package/dist/form-react/utils/evaluateFieldValidation.js +53 -0
  118. package/dist/form-react/utils/fieldDefaults.utils.d.ts +6 -0
  119. package/dist/form-react/utils/fieldDefaults.utils.js +25 -0
  120. package/dist/form-react/utils/fieldPath.utils.d.ts +23 -0
  121. package/dist/form-react/utils/fieldPath.utils.js +26 -0
  122. package/dist/form-react/utils/fieldRangeValidation.utils.d.ts +3 -0
  123. package/dist/form-react/utils/fieldRangeValidation.utils.js +24 -0
  124. package/dist/form-react/utils/fieldRendererUtils.d.ts +10 -0
  125. package/dist/form-react/utils/fieldRendererUtils.js +47 -0
  126. package/dist/form-react/utils/fieldTestIds.d.ts +3 -0
  127. package/dist/form-react/utils/fieldTestIds.js +13 -0
  128. package/dist/form-react/utils/formDate.utils.d.ts +13 -0
  129. package/dist/form-react/utils/formDate.utils.js +9 -0
  130. package/dist/form-react/utils/formValidationFeedback.utils.d.ts +32 -0
  131. package/dist/form-react/utils/formValidationFeedback.utils.js +153 -0
  132. package/dist/form-react/utils/icons.d.ts +5 -0
  133. package/dist/form-react/utils/icons.js +10 -0
  134. package/dist/form-react/utils/optionFlag.d.ts +11 -0
  135. package/dist/form-react/utils/optionFlag.js +17 -0
  136. package/dist/form-react/utils/pastedValues.d.ts +1 -0
  137. package/dist/form-react/utils/resolveFormSubmittable.d.ts +18 -0
  138. package/dist/form-react/utils/resolveFormSubmittable.js +32 -0
  139. package/dist/form-react/utils/select-option-filter-values.d.ts +5 -0
  140. package/dist/form-react/utils/select-option-filter-values.js +30 -0
  141. package/dist/form-react/utils/serializeFormStateForQueryKey.d.ts +1 -0
  142. package/dist/form-react/utils/serializeFormStateForQueryKey.js +21 -0
  143. package/dist/form-react/utils/stableSerialize.d.ts +5 -0
  144. package/dist/form-react/utils/stableSerialize.js +11 -0
  145. package/dist/form-react/utils/validateVisibleRequiredFormFields.d.ts +21 -0
  146. package/dist/form-react/utils/validateVisibleRequiredFormFields.js +64 -0
  147. package/dist/form-react/utils/validationUtils.d.ts +3 -0
  148. package/dist/form-react/utils/validationUtils.js +77 -0
  149. package/dist/impact-nova.css +1 -1
  150. package/dist/lib/primitives/use-field-chrome.js +16 -16
  151. package/dist/llms/rules/installation.js +1 -1
  152. package/dist/llms/rules/real-world-patterns.js +1 -1
  153. package/dist/llms/rules/requirements.js +1 -1
  154. package/package.json +21 -2
@@ -1,161 +1,170 @@
1
- import { jsx as a, jsxs as we } from "react/jsx-runtime";
2
- import { useId as J, useMemo as _, useState as C, useCallback as c, useRef as E, useEffect as ye } from "react";
3
- import * as O from "@radix-ui/react-popover";
4
- import { createComponent as Ce } from "../../../lib/primitives/create-component.js";
5
- import { cn as P } from "../../../lib/utils.js";
6
- import { useFieldChrome as Ie } from "../../../lib/primitives/use-field-chrome.js";
7
- import { useOverlayNestedLayerDismiss as De, useOverlayPortalContainer as Le } from "../../../lib/overlay/overlay-portal-context.js";
8
- import { OVERLAY_NESTED_FLOATING_INSTANT_HIDE_CLASS as ke } from "../../../lib/overlay/overlay-host.constants.js";
9
- import { comboboxSizeVariants as Ae } from "./combobox.variants.js";
10
- function Se(l) {
1
+ import { jsx as i, jsxs as $ } from "react/jsx-runtime";
2
+ import { useId as Z, useMemo as z, useState as k, useCallback as c, useRef as T, useEffect as ke } from "react";
3
+ import * as E from "@radix-ui/react-popover";
4
+ import { Cross as Le } from "impact-nova-icons";
5
+ import { Tooltip as Ae, TooltipTrigger as Ne, TooltipContent as Se } from "../../feedback/tooltip/tooltip.js";
6
+ import { useImpactNovaI18n as Pe } from "../../../i18n/use-impact-nova-i18n.js";
7
+ import { createComponent as Te } from "../../../lib/primitives/create-component.js";
8
+ import { cn as O } from "../../../lib/utils.js";
9
+ import { useFieldChrome as Ee } from "../../../lib/primitives/use-field-chrome.js";
10
+ import { useOverlayNestedLayerDismiss as Oe, useOverlayPortalContainer as He } from "../../../lib/overlay/overlay-portal-context.js";
11
+ import { OVERLAY_NESTED_FLOATING_INSTANT_HIDE_CLASS as Re } from "../../../lib/overlay/overlay-host.constants.js";
12
+ import { comboboxSizeVariants as Ve } from "./combobox.variants.js";
13
+ function Me(l) {
11
14
  if (l.options) return l.options;
12
- const { min: u, max: d, step: f } = l;
13
- if (u == null || d == null || f == null || f <= 0 || u > d) return [];
14
- const I = [];
15
- for (let b = u; b <= d; b += f) {
16
- const D = Math.round(b * 1e10) / 1e10;
17
- I.push(String(D));
15
+ const { min: u, max: f, step: p } = l;
16
+ if (u == null || f == null || p == null || p <= 0 || u > f) return [];
17
+ const L = [];
18
+ for (let x = u; x <= f; x += p) {
19
+ const v = Math.round(x * 1e10) / 1e10;
20
+ L.push(String(v));
18
21
  }
19
- return I;
22
+ return L;
20
23
  }
21
- function Ne(l, u) {
24
+ function je(l, u) {
22
25
  if (!u) return l;
23
- const d = u.toLowerCase();
24
- return l.filter((f) => f.toLowerCase().includes(d));
26
+ const f = u.toLowerCase();
27
+ return l.filter((p) => p.toLowerCase().includes(f));
25
28
  }
26
- const je = Ce(
29
+ const Je = Te(
27
30
  "Combobox",
28
31
  ({
29
32
  options: l,
30
33
  min: u,
31
- max: d,
32
- step: f,
33
- defaultValue: I = "",
34
- value: b,
35
- onChange: D,
36
- onBlur: F,
37
- placeholder: $,
38
- label: L,
39
- helperText: Q,
40
- helperTextPosition: X = "absolute",
41
- error: Z,
42
- isError: ee,
43
- disabled: m,
34
+ max: f,
35
+ step: p,
36
+ defaultValue: L = "",
37
+ value: x,
38
+ onChange: v,
39
+ onBlur: B,
40
+ placeholder: K,
41
+ label: A,
42
+ helperText: ee,
43
+ helperTextPosition: te = "absolute",
44
+ error: oe,
45
+ isError: ne,
46
+ disabled: d,
44
47
  isNumeric: H,
45
- size: te = "default",
46
- className: oe,
47
- emptyMessage: ne = "No options found",
48
- allowFreeText: k = !1,
49
- required: z,
50
- labelOrientation: re
51
- }, v) => {
52
- const se = J(), A = J(), R = typeof L == "string" ? L : $ ?? "Options", T = Ie({
53
- label: L,
54
- helperText: Q,
55
- helperTextPosition: X,
56
- labelOrientation: re,
57
- error: Z ?? ee,
58
- required: z,
59
- disabled: m,
60
- id: se,
61
- className: oe
62
- }), B = _(
63
- () => Se({ options: l, min: u, max: d, step: f }),
64
- [l, u, d, f]
65
- ), V = b !== void 0, [ie, ae] = C(I), S = V ? b : ie, [ce, K] = C(""), [o, x] = C(!1), le = c((e) => {
66
- x(e);
48
+ size: re = "default",
49
+ className: se,
50
+ emptyMessage: ie = "No options found",
51
+ allowFreeText: N = !1,
52
+ clearable: ae = !1,
53
+ required: U,
54
+ labelOrientation: ce
55
+ }, w) => {
56
+ const le = Z(), S = Z(), { t: W } = Pe(), R = typeof A == "string" ? A : K ?? "Options", V = Ee({
57
+ label: A,
58
+ helperText: ee,
59
+ helperTextPosition: te,
60
+ labelOrientation: ce,
61
+ error: oe ?? ne,
62
+ required: U,
63
+ disabled: d,
64
+ id: le,
65
+ className: se
66
+ }), q = z(
67
+ () => Me({ options: l, min: u, max: f, step: p }),
68
+ [l, u, f, p]
69
+ ), y = x !== void 0, [ue, G] = k(L), C = y ? x : ue, [de, M] = k(""), [o, h] = k(!1), fe = c((e) => {
70
+ h(e);
67
71
  }, []);
68
- De(o && !m, le);
69
- const ue = Le(), n = o ? ce : S, [M, p] = C(-1), U = E(-1), [de, w] = C("keyboard"), W = E(null), N = E(null), fe = c(
72
+ Oe(o && !d, fe);
73
+ const pe = He(), n = o ? de : C, [j, m] = k(-1), Y = T(-1), [me, I] = k("keyboard"), _ = T(null), P = T(null), he = c(
70
74
  (e) => {
71
- W.current = e, typeof v == "function" ? v(e) : v && (v.current = e);
75
+ _.current = e, typeof w == "function" ? w(e) : w && (w.current = e);
72
76
  },
73
- [v]
74
- ), r = _(
75
- () => Ne(B, n),
76
- [B, n]
77
- ), q = E(r), me = _(() => {
77
+ [w]
78
+ ), r = z(
79
+ () => je(q, n),
80
+ [q, n]
81
+ ), J = T(r), ge = z(() => {
78
82
  if (!o || !n) return -1;
79
83
  const e = r.findIndex(
80
84
  (t) => t.toLowerCase() === n.toLowerCase()
81
85
  );
82
86
  return e >= 0 ? e : -1;
83
- }, [o, n, r]), h = M >= 0 ? M : me, G = M >= 0 ? de : "mouse", pe = o && h >= 0 ? `${A}-option-${h}` : void 0;
84
- ye(() => {
85
- U.current = h, q.current = r, o && h >= 0 && N.current && N.current.querySelectorAll("[data-combobox-item]")[h]?.scrollIntoView({ block: "nearest" });
86
- }, [h, o, r]);
87
- const i = c(
87
+ }, [o, n, r]), g = j >= 0 ? j : ge, Q = j >= 0 ? me : "mouse", be = o && g >= 0 ? `${S}-option-${g}` : void 0;
88
+ ke(() => {
89
+ Y.current = g, J.current = r, o && g >= 0 && P.current && P.current.querySelectorAll("[data-combobox-item]")[g]?.scrollIntoView({ block: "nearest" });
90
+ }, [g, o, r]);
91
+ const a = c(
88
92
  (e) => {
89
- V || ae(e), D?.(e), x(!1), p(-1);
93
+ y || G(e), v?.(e), h(!1), m(-1);
90
94
  },
91
- [V, D]
92
- ), y = c(() => {
93
- x(!1), p(-1);
94
- }, []), he = c(
95
+ [y, v]
96
+ ), D = c(() => {
97
+ h(!1), m(-1);
98
+ }, []), xe = c(
99
+ (e) => {
100
+ e.preventDefault(), e.stopPropagation(), y || G(""), v?.(""), M(""), h(!1), m(-1), setTimeout(() => _.current?.focus(), 0);
101
+ },
102
+ [y, v]
103
+ ), ve = ae && !d && C.length > 0, we = c(
95
104
  (e) => {
96
105
  const t = e.target.value;
97
- K(t), p(-1), w("mouse"), o || x(!0);
106
+ M(t), m(-1), I("mouse"), o || h(!0);
98
107
  },
99
108
  [o]
100
- ), ge = c(() => {
101
- m || (K(S), x(!0));
102
- }, [m, S]), be = c(
109
+ ), ye = c(() => {
110
+ d || (M(C), h(!0));
111
+ }, [d, C]), Ce = c(
103
112
  (e) => {
104
113
  const t = e.relatedTarget;
105
- if (!N.current?.contains(t)) {
114
+ if (!P.current?.contains(t)) {
106
115
  if (o) {
107
116
  const s = r.find(
108
- (g) => g.toLowerCase() === n.toLowerCase()
117
+ (b) => b.toLowerCase() === n.toLowerCase()
109
118
  );
110
- s ? i(s) : r.length === 1 ? i(r[0]) : k && n ? i(n) : y();
119
+ s ? a(s) : r.length === 1 ? a(r[0]) : N && n ? a(n) : D();
111
120
  }
112
- F?.(e);
121
+ B?.(e);
113
122
  }
114
123
  },
115
- [o, r, n, i, y, k, F]
116
- ), xe = c(
124
+ [o, r, n, a, D, N, B]
125
+ ), Ie = c(
117
126
  (e) => {
118
127
  if (!o) {
119
- (e.key === "ArrowDown" || e.key === "ArrowUp") && (e.preventDefault(), x(!0));
128
+ (e.key === "ArrowDown" || e.key === "ArrowUp") && (e.preventDefault(), h(!0));
120
129
  return;
121
130
  }
122
131
  if (e.key === "Escape") {
123
- e.preventDefault(), e.stopPropagation(), y();
132
+ e.preventDefault(), e.stopPropagation(), D();
124
133
  return;
125
134
  }
126
135
  if (e.key === "ArrowDown") {
127
- e.preventDefault(), w("keyboard"), p(
136
+ e.preventDefault(), I("keyboard"), m(
128
137
  (t) => t < r.length - 1 ? t + 1 : 0
129
138
  );
130
139
  return;
131
140
  }
132
141
  if (e.key === "ArrowUp") {
133
- e.preventDefault(), w("keyboard"), p(
142
+ e.preventDefault(), I("keyboard"), m(
134
143
  (t) => t > 0 ? t - 1 : r.length - 1
135
144
  );
136
145
  return;
137
146
  }
138
147
  if (e.key === "Enter" || e.key === "Tab") {
139
148
  e.preventDefault();
140
- const t = U.current, s = q.current;
149
+ const t = Y.current, s = J.current;
141
150
  if (t >= 0 && t < s.length)
142
- i(s[t]);
151
+ a(s[t]);
143
152
  else {
144
- const g = s.find(
145
- (j) => j.toLowerCase() === n.toLowerCase()
153
+ const b = s.find(
154
+ (F) => F.toLowerCase() === n.toLowerCase()
146
155
  );
147
- g ? i(g) : s.length === 1 ? i(s[0]) : k && n ? i(n) : y();
156
+ b ? a(b) : s.length === 1 ? a(s[0]) : N && n ? a(n) : D();
148
157
  }
149
158
  return;
150
159
  }
151
160
  },
152
- [o, r, n, i, y, k]
153
- ), Y = c(
161
+ [o, r, n, a, D, N]
162
+ ), X = c(
154
163
  (e) => {
155
- i(e), setTimeout(() => W.current?.focus(), 0);
164
+ a(e), setTimeout(() => _.current?.focus(), 0);
156
165
  },
157
- [i]
158
- ), ve = c(
166
+ [a]
167
+ ), De = c(
159
168
  (e) => {
160
169
  const t = e.target.closest(
161
170
  "[data-combobox-item]"
@@ -164,66 +173,82 @@ const je = Ce(
164
173
  if (e.button !== 0) return;
165
174
  e.preventDefault();
166
175
  const s = t.getAttribute("data-combobox-value");
167
- s != null && Y(s);
176
+ s != null && X(s);
168
177
  return;
169
178
  }
170
179
  e.preventDefault();
171
180
  },
172
- [Y]
181
+ [X]
173
182
  );
174
- return /* @__PURE__ */ a("div", { "data-component": "combobox", "data-numeric": H || void 0, children: T.wrapControl(
175
- /* @__PURE__ */ we(O.Root, { open: o && !m, modal: !1, children: [
176
- /* @__PURE__ */ a(O.Anchor, { asChild: !0, children: /* @__PURE__ */ a(
183
+ return /* @__PURE__ */ i("div", { "data-component": "combobox", "data-numeric": H || void 0, children: V.wrapControl(
184
+ /* @__PURE__ */ $(E.Root, { open: o && !d, modal: !1, children: [
185
+ /* @__PURE__ */ i(E.Anchor, { asChild: !0, children: /* @__PURE__ */ $(
177
186
  "div",
178
187
  {
179
188
  "data-component": "combobox-input-border",
180
189
  tabIndex: -1,
181
- className: P(
190
+ className: O(
182
191
  "flex w-full items-center gap-1 rounded-md border bg-transparent px-3 text-sm transition-colors outline-none ring-0 focus:outline-none focus:ring-0",
183
192
  "focus-within:outline-none focus-within:ring-0 focus-within:border-brand hover:border-brand",
184
- T.hasError ? "border-destructive hover:border-destructive" : "border-field",
185
- m && "pointer-events-none opacity-100 bg-disabled-surface border-stroke text-disabled-foreground hover:border-stroke",
186
- Ae({ size: te }),
193
+ V.hasError ? "border-destructive hover:border-destructive" : "border-field",
194
+ d && "pointer-events-none opacity-100 bg-disabled-surface border-stroke text-disabled-foreground hover:border-stroke",
195
+ Ve({ size: re }),
187
196
  "bg-canvas"
188
197
  ),
189
- children: /* @__PURE__ */ a(
190
- "input",
191
- {
192
- ref: fe,
193
- type: "text",
194
- value: n,
195
- onChange: he,
196
- onFocus: ge,
197
- onBlur: be,
198
- onKeyDown: xe,
199
- placeholder: $,
200
- disabled: !!m,
201
- className: P(
202
- "flex h-full w-full bg-transparent p-0 text-sm font-medium",
203
- "outline-none ring-0 shadow-none border-none",
204
- "focus:outline-none focus:ring-0 focus:shadow-none focus:border-none",
205
- "focus-visible:outline-none focus-visible:ring-0 focus-visible:shadow-none focus-visible:border-none",
206
- "placeholder:font-medium placeholder:text-content-empty",
207
- m && "opacity-100 text-disabled-foreground placeholder:text-disabled-foreground cursor-not-allowed",
208
- H && "text-right"
209
- ),
210
- style: { boxShadow: "none", outline: "none" },
211
- autoComplete: "off",
212
- role: "combobox",
213
- "aria-expanded": o,
214
- "aria-autocomplete": "list",
215
- "aria-haspopup": "listbox",
216
- "aria-controls": o ? A : void 0,
217
- "aria-activedescendant": pe,
218
- "aria-required": z || void 0,
219
- "aria-label": L ? void 0 : R,
220
- ...T.controlAria
221
- }
222
- )
198
+ children: [
199
+ /* @__PURE__ */ i(
200
+ "input",
201
+ {
202
+ ref: he,
203
+ type: "text",
204
+ value: n,
205
+ onChange: we,
206
+ onFocus: ye,
207
+ onBlur: Ce,
208
+ onKeyDown: Ie,
209
+ placeholder: K,
210
+ disabled: !!d,
211
+ className: O(
212
+ "flex h-full w-full bg-transparent p-0 text-sm font-medium",
213
+ "outline-none ring-0 shadow-none border-none",
214
+ "focus:outline-none focus:ring-0 focus:shadow-none focus:border-none",
215
+ "focus-visible:outline-none focus-visible:ring-0 focus-visible:shadow-none focus-visible:border-none",
216
+ "placeholder:font-medium placeholder:text-content-empty",
217
+ d && "opacity-100 text-disabled-foreground placeholder:text-disabled-foreground cursor-not-allowed",
218
+ H && "text-right"
219
+ ),
220
+ style: { boxShadow: "none", outline: "none" },
221
+ autoComplete: "off",
222
+ role: "combobox",
223
+ "aria-expanded": o,
224
+ "aria-autocomplete": "list",
225
+ "aria-haspopup": "listbox",
226
+ "aria-controls": o ? S : void 0,
227
+ "aria-activedescendant": be,
228
+ "aria-required": U || void 0,
229
+ "aria-label": A ? void 0 : R,
230
+ ...V.controlAria
231
+ }
232
+ ),
233
+ ve ? /* @__PURE__ */ $(Ae, { children: [
234
+ /* @__PURE__ */ i(Ne, { asChild: !0, children: /* @__PURE__ */ i(
235
+ "button",
236
+ {
237
+ type: "button",
238
+ "data-clear-button": !0,
239
+ "aria-label": W("select.clear"),
240
+ className: "inline-flex shrink-0 cursor-pointer border-none bg-transparent p-0.5 text-content-icon hover:text-content-secondary",
241
+ onPointerDown: xe,
242
+ children: /* @__PURE__ */ i(Le, { size: "11px", className: "text-content-icon" })
243
+ }
244
+ ) }),
245
+ /* @__PURE__ */ i(Se, { variant: "tertiary", side: "top", children: W("select.clear") })
246
+ ] }) : null
247
+ ]
223
248
  }
224
249
  ) }),
225
- /* @__PURE__ */ a(O.Portal, { container: ue, children: /* @__PURE__ */ a(
226
- O.Content,
250
+ /* @__PURE__ */ i(E.Portal, { container: pe, children: /* @__PURE__ */ i(
251
+ E.Content,
227
252
  {
228
253
  align: "start",
229
254
  side: "bottom",
@@ -237,46 +262,46 @@ const je = Ce(
237
262
  onInteractOutside: () => {
238
263
  },
239
264
  onWheel: (e) => e.stopPropagation(),
240
- className: P(
265
+ className: O(
241
266
  "z-[9999] overflow-hidden rounded-[12px] bg-canvas text-base shadow-elevation-select focus:outline-none sm:text-sm flex flex-col border-none w-[var(--radix-popover-trigger-width)]",
242
- ke
267
+ Re
243
268
  ),
244
269
  style: {
245
270
  maxHeight: "var(--radix-popover-content-available-height)"
246
271
  },
247
- children: /* @__PURE__ */ a(
272
+ children: /* @__PURE__ */ i(
248
273
  "div",
249
274
  {
250
- ref: N,
251
- id: A,
275
+ ref: P,
276
+ id: S,
252
277
  className: "flex-1 overflow-auto py-1 px-[6px]",
253
278
  style: { maxHeight: 240, overscrollBehavior: "contain" },
254
279
  role: "listbox",
255
280
  "aria-label": R,
256
- onPointerDown: ve,
281
+ onPointerDown: De,
257
282
  onWheel: (e) => e.stopPropagation(),
258
283
  onMouseLeave: () => {
259
- w("mouse"), p(-1);
284
+ I("mouse"), m(-1);
260
285
  },
261
- children: r.length === 0 ? /* @__PURE__ */ a("div", { className: "flex items-center justify-center py-6 text-sm text-secondary-foreground", children: ne }) : r.map((e, t) => {
262
- const s = t === h, g = e.toLowerCase() === S.toLowerCase(), j = `${A}-option-${t}`;
263
- return /* @__PURE__ */ a("div", { className: "w-full pb-[2px]", children: /* @__PURE__ */ a(
286
+ children: r.length === 0 ? /* @__PURE__ */ i("div", { className: "flex items-center justify-center py-6 text-sm text-secondary-foreground", children: ie }) : r.map((e, t) => {
287
+ const s = t === g, b = e.toLowerCase() === C.toLowerCase(), F = `${S}-option-${t}`;
288
+ return /* @__PURE__ */ i("div", { className: "w-full pb-[2px]", children: /* @__PURE__ */ i(
264
289
  "div",
265
290
  {
266
291
  "data-combobox-item": !0,
267
292
  "data-combobox-value": e,
268
- id: j,
293
+ id: F,
269
294
  role: "option",
270
- "aria-selected": g,
271
- className: P(
295
+ "aria-selected": b,
296
+ className: O(
272
297
  "cursor-default select-none py-[6px] px-3 flex items-center transition-colors rounded-md",
273
298
  H ? "justify-end text-right" : "justify-between",
274
- s && G === "keyboard" ? "ring-2 ring-inset ring-primary bg-accent text-content" : s && G === "mouse" ? "bg-canvas-muted text-content" : g ? "bg-accent text-content" : "text-content hover:bg-canvas-muted cursor-pointer"
299
+ s && Q === "keyboard" ? "ring-2 ring-inset ring-primary bg-accent text-content" : s && Q === "mouse" ? "bg-canvas-muted text-content" : b ? "bg-accent text-content" : "text-content hover:bg-canvas-muted cursor-pointer"
275
300
  ),
276
301
  onMouseEnter: () => {
277
- w("mouse"), p(t);
302
+ I("mouse"), m(t);
278
303
  },
279
- children: /* @__PURE__ */ a("span", { className: "text-sm", children: e })
304
+ children: /* @__PURE__ */ i("span", { className: "text-sm", children: e })
280
305
  }
281
306
  ) }, e);
282
307
  })
@@ -289,5 +314,5 @@ const je = Ce(
289
314
  }
290
315
  );
291
316
  export {
292
- je as Combobox
317
+ Je as Combobox
293
318
  };
@@ -36,4 +36,6 @@ export interface ComboboxProps extends FieldControlProps {
36
36
  emptyMessage?: string;
37
37
  /** If true, typed text is committed even when it doesn't match any option */
38
38
  allowFreeText?: boolean;
39
+ /** When true, shows a clear button to reset the committed value */
40
+ clearable?: boolean;
39
41
  }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Optional headless validation helpers for filter-panel UIs.
3
+ * Does not include filter orchestration, saved filters, or network I/O.
4
+ *
5
+ * @packageDocumentation
6
+ */
7
+ export { buildFilterFieldValidationRules, isFilterFieldValueValid, } from './utils/buildFilterFieldValidationRules';
8
+ export type { FilterFieldValidationShape } from './utils/buildFilterFieldValidationRules';
9
+ export { validateVisibleRequiredFilterFields, } from './utils/validateVisibleRequiredFilterFields';
10
+ export type { FilterFormValues, ValidateVisibleRequiredFilterFieldsResult, } from './utils/validateVisibleRequiredFilterFields';
11
+ export { navigateToFirstFilterValidationError } from './utils/validationNavigation.utils';
12
+ export type { FilterValidationNavigationConfig, FilterValidationNavigationOptions, } from './utils/validationNavigation.utils';
@@ -0,0 +1,9 @@
1
+ import { navigateToFirstFilterValidationError as l } from "./utils/validationNavigation.utils.js";
2
+ import { buildFieldValidationRules as d, isFieldValueValid as r } from "../form-react/utils/buildFieldValidationRules.js";
3
+ import { validateVisibleRequiredFormFields as o } from "../form-react/utils/validateVisibleRequiredFormFields.js";
4
+ export {
5
+ d as buildFilterFieldValidationRules,
6
+ r as isFilterFieldValueValid,
7
+ l as navigateToFirstFilterValidationError,
8
+ o as validateVisibleRequiredFilterFields
9
+ };
@@ -0,0 +1 @@
1
+ export { buildFieldValidationRules as buildFilterFieldValidationRules, isFieldValueValid as isFilterFieldValueValid, type FieldValidationShape as FilterFieldValidationShape, } from '../../form-react/utils/buildFieldValidationRules';
@@ -0,0 +1 @@
1
+ export { validateVisibleRequiredFormFields as validateVisibleRequiredFilterFields, type ValidateVisibleRequiredFormFieldsResult as ValidateVisibleRequiredFilterFieldsResult, type FormValidationValues as FilterFormValues, } from '../../form-react/utils/validateVisibleRequiredFormFields';
@@ -0,0 +1,26 @@
1
+ export interface FilterValidationNavigationConfig {
2
+ dimensions: Array<{
3
+ id: string;
4
+ label?: string;
5
+ sections: Array<{
6
+ id: string;
7
+ label?: string;
8
+ fields: Array<{
9
+ id: string;
10
+ label?: string;
11
+ }>;
12
+ }>;
13
+ }>;
14
+ }
15
+ export interface FilterValidationNavigationOptions {
16
+ filterConfig: FilterValidationNavigationConfig;
17
+ errorFieldIds: string[];
18
+ getFieldTestId: (fieldId: string) => string;
19
+ onNavigateToDimension?: (dimensionId: string) => void;
20
+ buildValidationToastMessage?: (params: {
21
+ errorFieldLabels: string[];
22
+ dimensionLabel?: string;
23
+ }) => string;
24
+ showToast?: (message: string) => void;
25
+ }
26
+ export declare function navigateToFirstFilterValidationError({ filterConfig, errorFieldIds, getFieldTestId, onNavigateToDimension, buildValidationToastMessage, showToast, }: FilterValidationNavigationOptions): void;
@@ -0,0 +1,38 @@
1
+ function b({
2
+ filterConfig: f,
3
+ errorFieldIds: i,
4
+ getFieldTestId: s,
5
+ onNavigateToDimension: d,
6
+ buildValidationToastMessage: t,
7
+ showToast: o
8
+ }) {
9
+ if (i.length === 0)
10
+ return;
11
+ const r = i[0];
12
+ for (const n of f.dimensions)
13
+ for (const l of n.sections)
14
+ if (l.fields.find(
15
+ (e) => e.id === r
16
+ )) {
17
+ if (d?.(n.id), t && o) {
18
+ const e = i.map((c) => l.fields.find(
19
+ (a) => a.id === c
20
+ )?.label || c).filter(Boolean);
21
+ o(
22
+ t({
23
+ errorFieldLabels: e,
24
+ dimensionLabel: n.label
25
+ })
26
+ );
27
+ }
28
+ requestAnimationFrame(() => {
29
+ document.querySelector(
30
+ `[data-testid="${s(r)}"]`
31
+ )?.scrollIntoView({ behavior: "smooth", block: "center" });
32
+ });
33
+ return;
34
+ }
35
+ }
36
+ export {
37
+ b as navigateToFirstFilterValidationError
38
+ };
@@ -0,0 +1,17 @@
1
+ import { FieldDependency, FieldVisibilityBase, FormValuesSnapshot } from './types';
2
+ export declare function collectFieldDependencyIds(field: FieldVisibilityBase): string[];
3
+ export declare function computeIsFieldVisible(field: FieldVisibilityBase, formValues: FormValuesSnapshot): boolean;
4
+ export declare function computeIsFieldDisabled(field: FieldVisibilityBase, formValues: FormValuesSnapshot, options?: {
5
+ isCascadingDisabled?: (field: FieldVisibilityBase) => boolean;
6
+ }): boolean;
7
+ export declare function computeIsCascadingDisabled(field: FieldVisibilityBase, formValues: FormValuesSnapshot, isCascadingEnabled: boolean): boolean;
8
+ export declare function getDependentFieldIds(allFields: FieldVisibilityBase[], changedFieldName: string): string[];
9
+ export declare function buildCascadeParentFormState(cascadingDependency: FieldDependency[] | undefined, formValues: FormValuesSnapshot): Record<string, unknown> | null;
10
+ export declare function collectFormWatchFieldIds(fields: FieldVisibilityBase[]): string[];
11
+ /**
12
+ * @deprecated Use {@link collectFormWatchFieldIds}. Kept for backwards compatibility.
13
+ */
14
+ export declare function collectFilterSidebarWatchFieldIds(fields: FieldVisibilityBase[]): string[];
15
+ export declare function collectSectionWatchFieldIds(fields: FieldVisibilityBase[]): string[];
16
+ export declare function hasVisibleFieldErrors(fields: FieldVisibilityBase[], formErrors: Record<string, unknown>, formValues: FormValuesSnapshot): boolean;
17
+ export declare function collectVisibleFieldIds(fields: FieldVisibilityBase[], formValues: FormValuesSnapshot): string[];