impact-nova 1.8.1 → 1.8.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.
Files changed (29) hide show
  1. package/dist/components/ui/ag-grid-react/cell-renderers/default-text-cell-renderer.d.ts +6 -0
  2. package/dist/components/ui/ag-grid-react/cell-renderers/default-text-cell-renderer.js +9 -0
  3. package/dist/components/ui/ag-grid-react/headers/custom-header-group.d.ts +5 -6
  4. package/dist/components/ui/ag-grid-react/headers/custom-header-group.js +19 -19
  5. package/dist/components/ui/ag-grid-react/index.d.ts +1 -1
  6. package/dist/components/ui/ag-grid-react/index.js +164 -165
  7. package/dist/components/ui/button-group.d.ts +10 -6
  8. package/dist/components/ui/button-group.js +1 -2
  9. package/dist/components/ui/calendar.js +2 -3
  10. package/dist/components/ui/combobox.d.ts +1 -0
  11. package/dist/components/ui/combobox.js +116 -102
  12. package/dist/components/ui/date-picker/date-picker.js +52 -50
  13. package/dist/components/ui/date-picker/date-range-picker.js +92 -90
  14. package/dist/components/ui/date-picker/month-picker.js +57 -55
  15. package/dist/components/ui/date-picker/month-range-picker.js +84 -82
  16. package/dist/components/ui/date-picker/multi-date-picker.js +45 -43
  17. package/dist/components/ui/date-picker/week-range-picker.js +77 -75
  18. package/dist/components/ui/expandable-sku/expandable-sku.js +10 -10
  19. package/dist/components/ui/filter-strip/filter-tag-list.d.ts +8 -1
  20. package/dist/components/ui/filter-strip/filter-tag-list.js +99 -85
  21. package/dist/components/ui/input.js +12 -13
  22. package/dist/components/ui/smart-input.d.ts +2 -2
  23. package/dist/components/ui/smart-input.js +52 -51
  24. package/dist/components/ui/textarea.d.ts +10 -8
  25. package/dist/components/ui/textarea.js +52 -52
  26. package/dist/components/ui/types/ag-grid.types.d.ts +5 -0
  27. package/dist/components/ui/types/button-group.types.d.ts +1 -1
  28. package/dist/index.js +425 -426
  29. package/package.json +1 -1
@@ -1,15 +1,19 @@
1
1
  import { VariantProps } from 'class-variance-authority';
2
2
  import { HelperTextPosition } from './types/helper-text.types';
3
+ import { ReactNode } from 'react';
3
4
  import * as React from "react";
4
- /**
5
- * Button group — IA Design System v3.1 (Figma: Button group).
6
- * - Fused (`spacing="none"`): shared #C3C8D4 borders, 8px outer radius; selected = #ECEEFD fill + #4259EE border/text.
7
- * - Spaced: independent 8px rounded segments with gap (Figma “split” row).
8
- */
9
5
  declare const buttonGroupVariants: (props?: {
10
6
  orientation?: "horizontal" | "vertical";
11
7
  spacing?: "sm" | "md" | "lg" | "none";
12
8
  } & import('class-variance-authority/types').ClassProp) => string;
9
+ export interface ButtonOption {
10
+ label: string | ReactNode;
11
+ value: string;
12
+ icon?: string | ReactNode;
13
+ iconPosition?: 'left' | 'right';
14
+ iconSize?: number;
15
+ isDisabled?: boolean;
16
+ }
13
17
  export interface ButtonGroupProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof buttonGroupVariants> {
14
18
  value?: string;
15
19
  onValueChange?: (value: string) => void;
@@ -24,4 +28,4 @@ export interface ButtonGroupProps extends React.HTMLAttributes<HTMLDivElement>,
24
28
  "aria-label"?: string;
25
29
  }
26
30
  declare const ButtonGroup: React.ForwardRefExoticComponent<ButtonGroupProps & React.RefAttributes<HTMLDivElement>>;
27
- export { ButtonGroup, buttonGroupVariants };
31
+ export { ButtonGroup };
@@ -176,6 +176,5 @@ const H = A("inline-flex", {
176
176
  );
177
177
  M.displayName = "ButtonGroup";
178
178
  export {
179
- M as ButtonGroup,
180
- H as buttonGroupVariants
179
+ M as ButtonGroup
181
180
  };
@@ -4,13 +4,12 @@ import { ChevronLeftIcon as Ne, ChevronRightIcon as Se } from "lucide-react";
4
4
  import { getDefaultClassNames as Te, DayPicker as We } from "react-day-picker";
5
5
  import { cn as d } from "../../lib/utils.js";
6
6
  import { Button as R } from "./button.js";
7
- import "./button-variants.js";
8
7
  import de from "./select/select.js";
9
8
  import { FISCAL_PATTERNS as qe, resolveWeekSelection as Ge } from "../../lib/fiscal-calendar.js";
10
9
  import { getIntlLocale as Je, getDateFnsLocale as Qe } from "../../i18n/getDateFnsLocale.js";
11
10
  import { useImpactNovaI18n as Xe } from "../../i18n/ImpactNovaI18nContext.js";
12
11
  const me = u.createContext(0);
13
- function ct({
12
+ function it({
14
13
  className: oe,
15
14
  classNames: Q,
16
15
  showOutsideDays: y = !1,
@@ -841,6 +840,6 @@ function Ze({
841
840
  );
842
841
  }
843
842
  export {
844
- ct as Calendar,
843
+ it as Calendar,
845
844
  Ze as CalendarDayButton
846
845
  };
@@ -61,6 +61,7 @@ export interface ComboboxProps {
61
61
  * CSS selectors:
62
62
  * - `[data-component="combobox"]`
63
63
  * - `[data-numeric="true"]`
64
+ * - `[data-combobox-item]` / `[data-combobox-value]`
64
65
  */
65
66
  declare const Combobox: React.ForwardRefExoticComponent<ComboboxProps & React.RefAttributes<HTMLInputElement>>;
66
67
  export { Combobox };
@@ -1,106 +1,106 @@
1
- import { jsxs as v, jsx as o } from "react/jsx-runtime";
2
- import * as fe from "react";
3
- import { useMemo as B, useState as I, useRef as M, useCallback as x, useEffect as me } from "react";
4
- import * as V from "@radix-ui/react-popover";
1
+ import { jsxs as v, jsx as n } from "react/jsx-runtime";
2
+ import * as me from "react";
3
+ import { useMemo as _, useState as I, useRef as P, useCallback as d, useEffect as xe } from "react";
4
+ import * as M from "@radix-ui/react-popover";
5
5
  import { cn as a } from "../../lib/utils.js";
6
6
  import { Info as X } from "../../icons/index.js";
7
- function xe(c) {
7
+ function pe(c) {
8
8
  if (c.options) return c.options;
9
- const { min: u, max: d, step: f } = c;
10
- if (u == null || d == null || f == null || f <= 0 || u > d) return [];
9
+ const { min: u, max: f, step: m } = c;
10
+ if (u == null || f == null || m == null || m <= 0 || u > f) return [];
11
11
  const L = [];
12
- for (let h = u; h <= d; h += f) {
12
+ for (let h = u; h <= f; h += m) {
13
13
  const A = Math.round(h * 1e10) / 1e10;
14
14
  L.push(String(A));
15
15
  }
16
16
  return L;
17
17
  }
18
- function pe(c, u) {
18
+ function ge(c, u) {
19
19
  if (!u) return c;
20
- const d = u.toLowerCase();
21
- return c.filter((f) => f.toLowerCase().includes(d));
20
+ const f = u.toLowerCase();
21
+ return c.filter((m) => m.toLowerCase().includes(f));
22
22
  }
23
23
  const Y = {
24
24
  default: "h-8",
25
25
  sm: "h-6",
26
26
  md: "h-[28px]",
27
27
  lg: "h-10"
28
- }, ge = fe.forwardRef(
28
+ }, he = me.forwardRef(
29
29
  ({
30
30
  options: c,
31
31
  min: u,
32
- max: d,
33
- step: f,
32
+ max: f,
33
+ step: m,
34
34
  defaultValue: L = "",
35
35
  value: h,
36
36
  onChange: A,
37
- onBlur: F,
37
+ onBlur: B,
38
38
  placeholder: Z,
39
- label: K,
39
+ label: F,
40
40
  helperText: w,
41
- helperTextPosition: j = "absolute",
42
- isError: m,
41
+ helperTextPosition: V = "absolute",
42
+ isError: x,
43
43
  disabled: p,
44
- isNumeric: z,
44
+ isNumeric: j,
45
45
  size: $ = "default",
46
46
  className: E,
47
47
  emptyMessage: T = "No options found",
48
48
  allowFreeText: R = !1,
49
49
  required: ee
50
50
  }, y) => {
51
- const U = B(
52
- () => xe({ options: c, min: u, max: d, step: f }),
53
- [c, u, d, f]
54
- ), P = h !== void 0, [te, oe] = I(L), S = P ? h : te, [ne, W] = I(""), [r, C] = I(!1), n = r ? ne : S, [O, g] = I(-1), q = M(-1), [se, k] = I("keyboard"), G = M(null), H = M(null), re = x(
51
+ const K = _(
52
+ () => pe({ options: c, min: u, max: f, step: m }),
53
+ [c, u, f, m]
54
+ ), z = h !== void 0, [te, oe] = I(L), S = z ? h : te, [ne, U] = I(""), [i, C] = I(!1), r = i ? ne : S, [O, g] = I(-1), W = P(-1), [re, k] = I("keyboard"), q = P(null), H = P(null), se = d(
55
55
  (e) => {
56
- G.current = e, typeof y == "function" ? y(e) : y && (y.current = e);
56
+ q.current = e, typeof y == "function" ? y(e) : y && (y.current = e);
57
57
  },
58
58
  [y]
59
- ), s = B(
60
- () => pe(U, n),
61
- [U, n]
62
- ), J = M(s), ie = B(() => {
63
- if (!r || !n) return -1;
59
+ ), s = _(
60
+ () => ge(K, r),
61
+ [K, r]
62
+ ), G = P(s), ie = _(() => {
63
+ if (!i || !r) return -1;
64
64
  const e = s.findIndex(
65
- (t) => t.toLowerCase() === n.toLowerCase()
65
+ (t) => t.toLowerCase() === r.toLowerCase()
66
66
  );
67
67
  return e >= 0 ? e : -1;
68
- }, [r, n, s]), N = O >= 0 ? O : ie, Q = O >= 0 ? se : "mouse";
69
- me(() => {
70
- q.current = N, J.current = s, r && N >= 0 && H.current && H.current.querySelectorAll("[data-combobox-item]")[N]?.scrollIntoView({ block: "nearest" });
71
- }, [N, r, s]);
72
- const l = x(
68
+ }, [i, r, s]), N = O >= 0 ? O : ie, J = O >= 0 ? re : "mouse";
69
+ xe(() => {
70
+ W.current = N, G.current = s, i && N >= 0 && H.current && H.current.querySelectorAll("[data-combobox-item]")[N]?.scrollIntoView({ block: "nearest" });
71
+ }, [N, i, s]);
72
+ const l = d(
73
73
  (e) => {
74
- P || oe(e), A?.(e), C(!1), g(-1);
74
+ z || oe(e), A?.(e), C(!1), g(-1);
75
75
  },
76
- [P, A]
77
- ), D = x(() => {
76
+ [z, A]
77
+ ), D = d(() => {
78
78
  C(!1), g(-1);
79
- }, []), ae = x(
79
+ }, []), ae = d(
80
80
  (e) => {
81
81
  const t = e.target.value;
82
- W(t), g(-1), k("mouse"), r || C(!0);
82
+ U(t), g(-1), k("mouse"), i || C(!0);
83
83
  },
84
- [r]
85
- ), le = x(() => {
86
- p || (W(S), C(!0));
87
- }, [p, S]), ce = x(
84
+ [i]
85
+ ), le = d(() => {
86
+ p || (U(S), C(!0));
87
+ }, [p, S]), ce = d(
88
88
  (e) => {
89
89
  const t = e.relatedTarget;
90
90
  if (!H.current?.contains(t)) {
91
- if (r) {
92
- const i = s.find(
93
- (b) => b.toLowerCase() === n.toLowerCase()
91
+ if (i) {
92
+ const o = s.find(
93
+ (b) => b.toLowerCase() === r.toLowerCase()
94
94
  );
95
- i ? l(i) : s.length === 1 ? l(s[0]) : R && n ? l(n) : D();
95
+ o ? l(o) : s.length === 1 ? l(s[0]) : R && r ? l(r) : D();
96
96
  }
97
- F?.(e);
97
+ B?.(e);
98
98
  }
99
99
  },
100
- [r, s, n, l, D, R, F]
101
- ), ue = x(
100
+ [i, s, r, l, D, R, B]
101
+ ), ue = d(
102
102
  (e) => {
103
- if (!r) {
103
+ if (!i) {
104
104
  (e.key === "ArrowDown" || e.key === "ArrowUp") && (e.preventDefault(), C(!0));
105
105
  return;
106
106
  }
@@ -122,44 +122,59 @@ const Y = {
122
122
  }
123
123
  if (e.key === "Enter" || e.key === "Tab") {
124
124
  e.preventDefault();
125
- const t = q.current, i = J.current;
126
- if (t >= 0 && t < i.length)
127
- l(i[t]);
125
+ const t = W.current, o = G.current;
126
+ if (t >= 0 && t < o.length)
127
+ l(o[t]);
128
128
  else {
129
- const b = i.find(
130
- (_) => _.toLowerCase() === n.toLowerCase()
129
+ const b = o.find(
130
+ (fe) => fe.toLowerCase() === r.toLowerCase()
131
131
  );
132
- b ? l(b) : i.length === 1 ? l(i[0]) : R && n ? l(n) : D();
132
+ b ? l(b) : o.length === 1 ? l(o[0]) : R && r ? l(r) : D();
133
133
  }
134
134
  return;
135
135
  }
136
136
  },
137
- [r, s, n, l, D, R]
138
- ), de = x(
137
+ [i, s, r, l, D, R]
138
+ ), Q = d(
139
139
  (e) => {
140
- l(e), setTimeout(() => G.current?.focus(), 0);
140
+ l(e), setTimeout(() => q.current?.focus(), 0);
141
141
  },
142
142
  [l]
143
+ ), de = d(
144
+ (e) => {
145
+ const t = e.target.closest(
146
+ "[data-combobox-item]"
147
+ );
148
+ if (t) {
149
+ if (e.button !== 0) return;
150
+ e.preventDefault();
151
+ const o = t.getAttribute("data-combobox-value");
152
+ o != null && Q(o);
153
+ return;
154
+ }
155
+ e.preventDefault();
156
+ },
157
+ [Q]
143
158
  );
144
159
  return /* @__PURE__ */ v(
145
160
  "div",
146
161
  {
147
162
  "data-component": "combobox",
148
- "data-numeric": z || void 0,
163
+ "data-numeric": j || void 0,
149
164
  className: a("flex w-full flex-col gap-[6px]", E),
150
165
  children: [
151
- K && /* @__PURE__ */ v(
166
+ F && /* @__PURE__ */ v(
152
167
  "label",
153
168
  {
154
169
  className: a(
155
170
  "text-xs font-medium leading-[18px] text-content-tertiary",
156
171
  p && "opacity-70",
157
- m && "text-destructive"
172
+ x && "text-destructive"
158
173
  ),
159
174
  children: [
160
- K,
175
+ F,
161
176
  " ",
162
- ee && /* @__PURE__ */ o("span", { className: "text-destructive", children: "*" })
177
+ ee && /* @__PURE__ */ n("span", { className: "text-destructive", children: "*" })
163
178
  ]
164
179
  }
165
180
  ),
@@ -167,11 +182,11 @@ const Y = {
167
182
  "div",
168
183
  {
169
184
  className: a(
170
- w && j === "absolute" && "relative"
185
+ w && V === "absolute" && "relative"
171
186
  ),
172
187
  children: [
173
- /* @__PURE__ */ v(V.Root, { open: r && !p, modal: !1, children: [
174
- /* @__PURE__ */ o(V.Anchor, { asChild: !0, children: /* @__PURE__ */ o(
188
+ /* @__PURE__ */ v(M.Root, { open: i && !p, modal: !1, children: [
189
+ /* @__PURE__ */ n(M.Anchor, { asChild: !0, children: /* @__PURE__ */ n(
175
190
  "div",
176
191
  {
177
192
  "data-component": "combobox-input-border",
@@ -179,17 +194,17 @@ const Y = {
179
194
  className: a(
180
195
  "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",
181
196
  "focus-within:outline-none focus-within:ring-0 focus-within:border-brand hover:border-brand",
182
- m ? "border-destructive hover:border-destructive" : "border-field",
197
+ x ? "border-destructive hover:border-destructive" : "border-field",
183
198
  p && "pointer-events-none opacity-100 bg-disabled-surface border-stroke text-disabled-foreground hover:border-stroke",
184
199
  Y[$] ?? Y.default,
185
200
  "bg-canvas"
186
201
  ),
187
- children: /* @__PURE__ */ o(
202
+ children: /* @__PURE__ */ n(
188
203
  "input",
189
204
  {
190
- ref: re,
205
+ ref: se,
191
206
  type: "text",
192
- value: n,
207
+ value: r,
193
208
  onChange: ae,
194
209
  onFocus: le,
195
210
  onBlur: ce,
@@ -203,20 +218,20 @@ const Y = {
203
218
  "focus-visible:outline-none focus-visible:ring-0 focus-visible:shadow-none focus-visible:border-none",
204
219
  "placeholder:font-medium placeholder:text-content-empty",
205
220
  p && "opacity-100 text-disabled-foreground placeholder:text-disabled-foreground cursor-not-allowed",
206
- z && "text-right"
221
+ j && "text-right"
207
222
  ),
208
223
  style: { boxShadow: "none", outline: "none" },
209
224
  autoComplete: "off",
210
225
  role: "combobox",
211
- "aria-expanded": r,
226
+ "aria-expanded": i,
212
227
  "aria-autocomplete": "list",
213
228
  "aria-haspopup": "listbox"
214
229
  }
215
230
  )
216
231
  }
217
232
  ) }),
218
- /* @__PURE__ */ o(V.Portal, { children: /* @__PURE__ */ o(
219
- V.Content,
233
+ /* @__PURE__ */ n(M.Portal, { children: /* @__PURE__ */ n(
234
+ M.Content,
220
235
  {
221
236
  align: "start",
222
237
  side: "bottom",
@@ -232,37 +247,36 @@ const Y = {
232
247
  style: {
233
248
  maxHeight: "var(--radix-popover-content-available-height)"
234
249
  },
235
- children: /* @__PURE__ */ o(
250
+ children: /* @__PURE__ */ n(
236
251
  "div",
237
252
  {
238
253
  ref: H,
239
254
  className: "flex-1 overflow-auto py-1 px-[6px]",
240
255
  style: { maxHeight: 240, overscrollBehavior: "contain" },
241
256
  role: "listbox",
257
+ onPointerDown: de,
242
258
  onWheel: (e) => e.stopPropagation(),
243
259
  onMouseLeave: () => {
244
260
  k("mouse"), g(-1);
245
261
  },
246
- children: s.length === 0 ? /* @__PURE__ */ o("div", { className: "flex items-center justify-center py-6 text-sm text-gray-500", children: T }) : s.map((e, t) => {
247
- const i = t === N, b = e.toLowerCase() === S.toLowerCase();
248
- return /* @__PURE__ */ o("div", { className: "w-full pb-[2px]", children: /* @__PURE__ */ o(
262
+ children: s.length === 0 ? /* @__PURE__ */ n("div", { className: "flex items-center justify-center py-6 text-sm text-gray-500", children: T }) : s.map((e, t) => {
263
+ const o = t === N, b = e.toLowerCase() === S.toLowerCase();
264
+ return /* @__PURE__ */ n("div", { className: "w-full pb-[2px]", children: /* @__PURE__ */ n(
249
265
  "div",
250
266
  {
251
267
  "data-combobox-item": !0,
268
+ "data-combobox-value": e,
252
269
  role: "option",
253
- "aria-selected": i,
270
+ "aria-selected": o,
254
271
  className: a(
255
272
  "cursor-default select-none py-[6px] px-3 flex items-center transition-colors rounded-md",
256
- z ? "justify-end text-right" : "justify-between",
257
- i && Q === "keyboard" ? "ring-2 ring-inset ring-primary bg-[#edf0ff] text-[#1f2b4d]" : i && Q === "mouse" ? "bg-gray-100 text-[#1f2b4d]" : b ? "bg-[#edf0ff] text-[#1f2b4d]" : "text-[#1f2b4d] hover:bg-gray-100 cursor-pointer"
273
+ j ? "justify-end text-right" : "justify-between",
274
+ o && J === "keyboard" ? "ring-2 ring-inset ring-primary bg-[#edf0ff] text-[#1f2b4d]" : o && J === "mouse" ? "bg-gray-100 text-[#1f2b4d]" : b ? "bg-[#edf0ff] text-[#1f2b4d]" : "text-[#1f2b4d] hover:bg-gray-100 cursor-pointer"
258
275
  ),
259
- onMouseDown: (_) => {
260
- _.preventDefault(), de(e);
261
- },
262
276
  onMouseEnter: () => {
263
277
  k("mouse"), g(t);
264
278
  },
265
- children: /* @__PURE__ */ o("span", { className: "text-sm", children: e })
279
+ children: /* @__PURE__ */ n("span", { className: "text-sm", children: e })
266
280
  }
267
281
  ) }, e);
268
282
  })
@@ -271,30 +285,30 @@ const Y = {
271
285
  }
272
286
  ) })
273
287
  ] }),
274
- w && j === "absolute" && /* @__PURE__ */ v(
288
+ w && V === "absolute" && /* @__PURE__ */ v(
275
289
  "div",
276
290
  {
277
291
  className: a(
278
292
  "absolute left-0 top-full z-10 mt-1 flex min-w-0 max-w-full items-center gap-[6px]",
279
- m && "text-destructive"
293
+ x && "text-destructive"
280
294
  ),
281
295
  children: [
282
- /* @__PURE__ */ o(
296
+ /* @__PURE__ */ n(
283
297
  X,
284
298
  {
285
299
  size: "xs",
286
300
  className: a(
287
301
  "shrink-0",
288
- m ? "text-destructive" : "text-content-muted"
302
+ x ? "text-destructive" : "text-content-muted"
289
303
  )
290
304
  }
291
305
  ),
292
- /* @__PURE__ */ o(
306
+ /* @__PURE__ */ n(
293
307
  "p",
294
308
  {
295
309
  className: a(
296
310
  "min-w-0 text-[12px] font-medium leading-[18px] text-navigation-muted",
297
- m && "text-destructive"
311
+ x && "text-destructive"
298
312
  ),
299
313
  children: w
300
314
  }
@@ -305,30 +319,30 @@ const Y = {
305
319
  ]
306
320
  }
307
321
  ),
308
- w && j === "flow" && /* @__PURE__ */ v(
322
+ w && V === "flow" && /* @__PURE__ */ v(
309
323
  "div",
310
324
  {
311
325
  className: a(
312
326
  "flex items-center gap-[6px]",
313
- m && "text-destructive"
327
+ x && "text-destructive"
314
328
  ),
315
329
  children: [
316
- /* @__PURE__ */ o(
330
+ /* @__PURE__ */ n(
317
331
  X,
318
332
  {
319
333
  size: "xs",
320
334
  className: a(
321
335
  "shrink-0",
322
- m ? "text-destructive" : "text-content-muted"
336
+ x ? "text-destructive" : "text-content-muted"
323
337
  )
324
338
  }
325
339
  ),
326
- /* @__PURE__ */ o(
340
+ /* @__PURE__ */ n(
327
341
  "p",
328
342
  {
329
343
  className: a(
330
344
  "text-[12px] font-medium leading-[18px] text-navigation-muted",
331
- m && "text-destructive"
345
+ x && "text-destructive"
332
346
  ),
333
347
  children: w
334
348
  }
@@ -341,7 +355,7 @@ const Y = {
341
355
  );
342
356
  }
343
357
  );
344
- ge.displayName = "Combobox";
358
+ he.displayName = "Combobox";
345
359
  export {
346
- ge as Combobox
360
+ he as Combobox
347
361
  };