impact-nova 3.0.0-alpha.4 → 3.0.0-alpha.5

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 (27) hide show
  1. package/dist/components/data/expandable-list-item/sku-picker-chrome.d.ts +2 -1
  2. package/dist/components/data/expandable-list-item/sku-picker-chrome.js +41 -35
  3. package/dist/components/data/expandable-list-item/useServerSkuInfinitePages.d.ts +2 -1
  4. package/dist/components/data/expandable-list-item/virtualized-responsive-grid.catalog.d.ts +4 -3
  5. package/dist/components/feedback/tooltip/button-icon-tooltip.d.ts +4 -1
  6. package/dist/components/feedback/tooltip/button-icon-tooltip.js +14 -12
  7. package/dist/components/feedback/tooltip/use-overflow-tooltip.js +44 -36
  8. package/dist/components/flows/iris-chat/iris-chat-menu.js +100 -73
  9. package/dist/components/forms/select/components/SelectMenuPanel.js +15 -15
  10. package/dist/components/layout/horizontal-scroller/horizontal-scroller-mask.d.ts +3 -0
  11. package/dist/components/layout/horizontal-scroller/horizontal-scroller-mask.js +12 -0
  12. package/dist/components/layout/horizontal-scroller/horizontal-scroller.js +181 -125
  13. package/dist/components/layout/horizontal-scroller/horizontal-scroller.types.d.ts +2 -0
  14. package/dist/components/layout/horizontal-scroller/scroll-overflow-affordance.d.ts +3 -1
  15. package/dist/components/layout/horizontal-scroller/scroll-overflow-affordance.js +77 -67
  16. package/dist/components/primitives/iris/iris-insight-truncated-text.d.ts +3 -0
  17. package/dist/components/primitives/iris/iris-insight-truncated-text.js +33 -0
  18. package/dist/components/primitives/iris/iris.d.ts +2 -1
  19. package/dist/components/primitives/iris/iris.js +57 -67
  20. package/dist/components/primitives/iris/iris.types.d.ts +7 -0
  21. package/dist/form-react/Fields/VirtualizedListField.js +69 -64
  22. package/dist/impact-nova-components.css +3 -4
  23. package/dist/impact-nova.css +1 -1
  24. package/dist/lib/alphabetical-sort.js +13 -0
  25. package/dist/llms/rules/installation.js +1 -1
  26. package/dist/llms/rules/requirements.js +1 -1
  27. package/package.json +2 -2
@@ -1,4 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
+ import { AlphabeticalSortDirection } from '../../../lib/alphabetical-sort';
2
3
  export type SkuPickerView = "card" | "list";
3
4
  export type SkuPickerGridProps = {
4
5
  /** Fold the toolbar and choices behind the title row. */
@@ -12,7 +13,7 @@ export type SkuPickerGridProps = {
12
13
  export declare function SkuPickerChrome(props: {
13
14
  view: SkuPickerView;
14
15
  search: string;
15
- sortAlphabetically: boolean;
16
+ sortDirection: AlphabeticalSortDirection;
16
17
  selectedCount: number;
17
18
  /** True when every choice Select All would touch is already selected. */
18
19
  allSelected?: boolean;
@@ -1,54 +1,54 @@
1
1
  import { jsx as t, jsxs as l } from "react/jsx-runtime";
2
- import { Search as s, CardView as m, ListFilter as h, TextFormat as u, Back as b } from "impact-nova-icons";
2
+ import { Search as s, CardView as m, ListFilter as u, SortZa as h, SortAz as b, Back as v } from "impact-nova-icons";
3
3
  import "react";
4
- import { Badge as v } from "../../data-display/badge/badge.js";
5
- import { ButtonIconTooltip as r } from "../../feedback/tooltip/button-icon-tooltip.js";
6
- import { Input as f } from "../../forms/input/input.js";
7
- import { Accordion as x, AccordionItem as g, AccordionTrigger as w, AccordionContent as C } from "../../primitives/accordion/accordion.js";
4
+ import { Badge as f } from "../../data-display/badge/badge.js";
5
+ import { ButtonIconTooltip as c } from "../../feedback/tooltip/button-icon-tooltip.js";
6
+ import { Input as x } from "../../forms/input/input.js";
7
+ import { Accordion as g, AccordionItem as w, AccordionTrigger as S, AccordionContent as C } from "../../primitives/accordion/accordion.js";
8
8
  import { Button as i } from "../../primitives/button/button.js";
9
9
  import { cn as N } from "../../../lib/utils.js";
10
- const d = "picker";
11
- function S(e) {
10
+ const o = "picker";
11
+ function y(e) {
12
12
  return N(
13
13
  e && "border-brand bg-accent text-brand hover:bg-accent hover:text-brand"
14
14
  );
15
15
  }
16
- function y(e) {
16
+ function k(e) {
17
17
  if (e.selectedCount === 0)
18
18
  return /* @__PURE__ */ t("p", { className: "text-xs font-medium text-content-muted", children: e.emptyLabel });
19
19
  const a = Math.max(0, e.selectedCount - e.previewCodes.length);
20
20
  return /* @__PURE__ */ l("div", { className: "flex min-w-0 items-center gap-1", children: [
21
21
  /* @__PURE__ */ t("p", { className: "truncate text-xs font-medium text-content-muted", children: e.previewCodes.join(", ") }),
22
- a > 0 ? /* @__PURE__ */ l(v, { variant: "subtle", color: "primary", size: "sm", shape: "square", children: [
22
+ a > 0 ? /* @__PURE__ */ l(f, { variant: "subtle", color: "primary", size: "sm", shape: "square", children: [
23
23
  "+",
24
24
  a
25
25
  ] }) : null
26
26
  ] });
27
27
  }
28
- function V(e) {
28
+ function U(e) {
29
29
  const a = e.title ?? "SKU", n = /* @__PURE__ */ t(
30
- y,
30
+ k,
31
31
  {
32
32
  selectedCount: e.selectedCount,
33
33
  previewCodes: e.previewCodes,
34
34
  emptyLabel: e.emptyLabel ?? "No SKUs selected"
35
35
  }
36
- ), c = /* @__PURE__ */ l("div", { className: "flex items-center justify-between gap-3", children: [
36
+ ), r = /* @__PURE__ */ l("div", { className: "flex items-center justify-between gap-3", children: [
37
37
  /* @__PURE__ */ l("div", { className: "flex items-center gap-3", children: [
38
38
  /* @__PURE__ */ t(
39
- f,
39
+ x,
40
40
  {
41
41
  size: "default",
42
42
  className: "w-[200px]",
43
43
  placeholder: "Search",
44
44
  value: e.search,
45
- onChange: (o) => e.onSearchChange(o.target.value),
45
+ onChange: (d) => e.onSearchChange(d.target.value),
46
46
  prefix: /* @__PURE__ */ t(s, { className: "size-4 text-content-placeholder", "aria-hidden": !0 }),
47
47
  "aria-label": e.searchLabel ?? "Search SKUs"
48
48
  }
49
49
  ),
50
50
  /* @__PURE__ */ t(
51
- r,
51
+ c,
52
52
  {
53
53
  label: e.view === "card" ? "Switch to list view" : "Switch to card view",
54
54
  children: /* @__PURE__ */ t(
@@ -60,24 +60,30 @@ function V(e) {
60
60
  "aria-label": e.view === "card" ? "Switch to list view" : "Switch to card view",
61
61
  "aria-pressed": e.view === "list",
62
62
  onClick: () => e.onViewChange(e.view === "card" ? "list" : "card"),
63
- children: e.view === "card" ? /* @__PURE__ */ t(m, {}) : /* @__PURE__ */ t(h, {})
63
+ children: e.view === "card" ? /* @__PURE__ */ t(m, {}) : /* @__PURE__ */ t(u, {})
64
64
  }
65
65
  )
66
66
  }
67
67
  ),
68
- /* @__PURE__ */ t(r, { label: "Sort Alphabetically", children: /* @__PURE__ */ t(
69
- i,
68
+ /* @__PURE__ */ t(
69
+ c,
70
70
  {
71
- type: "button",
72
- size: "icon",
73
- variant: "tertiary",
74
- "aria-label": "Sort alphabetically",
75
- "aria-pressed": e.sortAlphabetically,
76
- className: S(e.sortAlphabetically),
77
- onClick: e.onToggleSort,
78
- children: /* @__PURE__ */ t(u, {})
71
+ label: e.sortDirection === "desc" ? "Sort Z to A" : "Sort A to Z",
72
+ children: /* @__PURE__ */ t(
73
+ i,
74
+ {
75
+ type: "button",
76
+ size: "icon",
77
+ variant: "tertiary",
78
+ "aria-label": e.sortDirection === "desc" ? "Sort Z to A" : "Sort A to Z",
79
+ "aria-pressed": e.sortDirection !== "none",
80
+ className: y(e.sortDirection !== "none"),
81
+ onClick: e.onToggleSort,
82
+ children: e.sortDirection === "desc" ? /* @__PURE__ */ t(h, {}) : /* @__PURE__ */ t(b, {})
83
+ }
84
+ )
79
85
  }
80
- ) })
86
+ )
81
87
  ] }),
82
88
  /* @__PURE__ */ l("div", { className: "flex items-center gap-3", children: [
83
89
  /* @__PURE__ */ t(
@@ -105,19 +111,19 @@ function V(e) {
105
111
  ] })
106
112
  ] });
107
113
  return e.collapsible ? /* @__PURE__ */ t(
108
- x,
114
+ g,
109
115
  {
110
116
  type: "single",
111
117
  collapsible: !0,
112
- defaultValue: e.defaultCollapsed ? void 0 : d,
118
+ defaultValue: e.defaultCollapsed ? void 0 : o,
113
119
  className: "w-full",
114
- children: /* @__PURE__ */ l(g, { value: d, className: "border border-stroke-subtle", children: [
115
- /* @__PURE__ */ t(w, { headingLevel: 3, rightActions: n, children: /* @__PURE__ */ l("span", { className: "truncate text-sm font-semibold leading-6 text-content-title", children: [
120
+ children: /* @__PURE__ */ l(w, { value: o, className: "border border-stroke-subtle", children: [
121
+ /* @__PURE__ */ t(S, { headingLevel: 3, rightActions: n, children: /* @__PURE__ */ l("span", { className: "truncate text-sm font-semibold leading-6 text-content-title", children: [
116
122
  a,
117
123
  e.required ? /* @__PURE__ */ t("span", { className: "text-destructive", children: " *" }) : null
118
124
  ] }) }),
119
125
  /* @__PURE__ */ l(C, { className: "flex flex-col gap-3", children: [
120
- c,
126
+ r,
121
127
  e.children,
122
128
  e.footer
123
129
  ] })
@@ -126,7 +132,7 @@ function V(e) {
126
132
  ) : /* @__PURE__ */ l("div", { className: "flex w-full flex-col gap-3 overflow-hidden rounded-lg border border-stroke-subtle bg-canvas-elevated px-4 py-2", children: [
127
133
  /* @__PURE__ */ l("div", { className: "flex items-center justify-between gap-3", children: [
128
134
  /* @__PURE__ */ l("div", { className: "flex items-center gap-3", children: [
129
- e.showBack === !1 ? null : /* @__PURE__ */ t(i, { type: "button", size: "icon", variant: "ghost", "aria-label": "Back", children: /* @__PURE__ */ t(b, {}) }),
135
+ e.showBack === !1 ? null : /* @__PURE__ */ t(i, { type: "button", size: "icon", variant: "ghost", "aria-label": "Back", children: /* @__PURE__ */ t(v, {}) }),
130
136
  /* @__PURE__ */ l("p", { className: "text-sm font-semibold leading-6 text-content-title", children: [
131
137
  a,
132
138
  e.required ? /* @__PURE__ */ t("span", { className: "text-destructive", children: " *" }) : null
@@ -134,11 +140,11 @@ function V(e) {
134
140
  ] }),
135
141
  n
136
142
  ] }),
137
- c,
143
+ r,
138
144
  e.children,
139
145
  e.footer
140
146
  ] });
141
147
  }
142
148
  export {
143
- V as SkuPickerChrome
149
+ U as SkuPickerChrome
144
150
  };
@@ -1,4 +1,5 @@
1
- export declare function useServerSkuInfinitePages(search: string, sortAlphabetically: boolean): {
1
+ import { AlphabeticalSortDirection } from '../../../lib/alphabetical-sort';
2
+ export declare function useServerSkuInfinitePages(search: string, sortDirection: AlphabeticalSortDirection): {
2
3
  debouncedSearch: string;
3
4
  query: import('@tanstack/react-query').UseInfiniteQueryResult<import('@tanstack/query-core').InfiniteData<import('./virtualized-responsive-grid.catalog').SkuServerPage, unknown>, Error>;
4
5
  loadedCatalogIndices: number[];
@@ -1,4 +1,5 @@
1
1
  import { ImageComponent } from 'impact-nova-icons';
2
+ import { AlphabeticalSortDirection } from '../../../lib/alphabetical-sort';
2
3
  export declare const SKU_CATALOG_TOTAL = 50000;
3
4
  export declare const ITEM_CATALOG_TOTAL = 50000;
4
5
  export declare const SERVER_PAGE_SIZE = 200;
@@ -57,11 +58,11 @@ export type SkuServerPage = {
57
58
  nextStartIndex?: number;
58
59
  };
59
60
  /** Reuse the filtered catalog for later pages of the same search. Does not mutate cached arrays. */
60
- export declare function getCachedSkuMatchingIndices(searchQuery: string, sortAlphabetically: boolean): number[] | null;
61
+ export declare function getCachedSkuMatchingIndices(searchQuery: string, sortDirection: AlphabeticalSortDirection): number[] | null;
61
62
  export declare function fetchSkuServerPage(options: {
62
63
  startIndex: number;
63
64
  searchQuery: string;
64
- sortAlphabetically: boolean;
65
+ sortDirection: AlphabeticalSortDirection;
65
66
  pageSize?: number;
66
67
  }): Promise<SkuServerPage>;
67
68
  export declare function getItemCatalogRecord(catalogIndex: number): ItemCatalogRecord;
@@ -75,7 +76,7 @@ export declare function collectStripCatalogIndices(options: {
75
76
  export declare function filterAndSortCatalogIndices(options: {
76
77
  totalCount: number;
77
78
  searchQuery: string;
78
- sortAlphabetically: boolean;
79
+ sortDirection: AlphabeticalSortDirection;
79
80
  getSearchText: (catalogIndex: number) => string;
80
81
  getSortKey: (catalogIndex: number) => string;
81
82
  }): number[] | null;
@@ -1,9 +1,12 @@
1
1
  import { KeyBinding } from '../../primitives/kbd';
2
+ import { TooltipContentProps } from './tooltip.types';
2
3
  import * as React from "react";
3
4
  export interface ButtonIconTooltipProps {
4
5
  children: React.ReactElement;
5
6
  label?: string;
6
7
  side?: "top" | "bottom" | "left" | "right";
8
+ align?: TooltipContentProps["align"];
9
+ variant?: TooltipContentProps["variant"];
7
10
  keybinding?: KeyBinding;
8
11
  disabled?: boolean;
9
12
  }
@@ -11,4 +14,4 @@ export interface ButtonIconTooltipProps {
11
14
  * Wraps icon buttons with tooltip + optional Kbd badge.
12
15
  * Use at app/feature layer — keeps Button free of feedback imports.
13
16
  */
14
- export declare function ButtonIconTooltip({ children, label, side, keybinding, disabled, }: ButtonIconTooltipProps): import("react/jsx-runtime").JSX.Element;
17
+ export declare function ButtonIconTooltip({ children, label, side, align, variant, keybinding, disabled, }: ButtonIconTooltipProps): import("react/jsx-runtime").JSX.Element;
@@ -1,23 +1,25 @@
1
- import { jsxs as n, jsx as t } from "react/jsx-runtime";
1
+ import { jsxs as i, jsx as t } from "react/jsx-runtime";
2
2
  import "react";
3
- import { Kbd as s } from "../../primitives/kbd/kbd.js";
4
- import { Tooltip as m, TooltipTrigger as a, TooltipContent as l } from "./tooltip.js";
5
- function T({
3
+ import { Kbd as c } from "../../primitives/kbd/kbd.js";
4
+ import { Tooltip as l, TooltipTrigger as a, TooltipContent as f } from "./tooltip.js";
5
+ function h({
6
6
  children: o,
7
7
  label: r,
8
- side: e = "top",
9
- keybinding: i,
10
- disabled: p
8
+ side: n = "top",
9
+ align: p = "center",
10
+ variant: s = "tertiary",
11
+ keybinding: e,
12
+ disabled: m
11
13
  }) {
12
- return r ? /* @__PURE__ */ n(m, { children: [
13
- /* @__PURE__ */ t(a, { asChild: !0, children: p ? /* @__PURE__ */ t("span", { tabIndex: -1, className: "inline-block outline-none", children: o }) : o }),
14
- /* @__PURE__ */ t(l, { variant: "tertiary", side: e, children: i ? /* @__PURE__ */ n("span", { className: "flex items-center gap-2", children: [
14
+ return r ? /* @__PURE__ */ i(l, { children: [
15
+ /* @__PURE__ */ t(a, { asChild: !0, children: m ? /* @__PURE__ */ t("span", { tabIndex: -1, className: "inline-block outline-none", children: o }) : o }),
16
+ /* @__PURE__ */ t(f, { variant: s, side: n, align: p, children: e ? /* @__PURE__ */ i("span", { className: "flex items-center gap-2", children: [
15
17
  r,
16
18
  " ",
17
- /* @__PURE__ */ t(s, { keybinding: i, size: "sm" })
19
+ /* @__PURE__ */ t(c, { keybinding: e, size: "sm" })
18
20
  ] }) : r })
19
21
  ] }) : o;
20
22
  }
21
23
  export {
22
- T as ButtonIconTooltip
24
+ h as ButtonIconTooltip
23
25
  };
@@ -4,106 +4,114 @@ const H = 500;
4
4
  function N(o, s) {
5
5
  return o !== void 0 ? o : typeof s == "string" ? s : null;
6
6
  }
7
- function B(o, {
7
+ function z(o, {
8
8
  content: s,
9
- overflowMode: p = "ellipsis",
9
+ overflowMode: g = "ellipsis",
10
10
  alwaysShow: i = !1,
11
- disabled: f = !1,
12
- focusable: d = !1,
11
+ disabled: a = !1,
12
+ focusable: E = !1,
13
13
  contentDependency: h
14
14
  } = {}) {
15
- const g = t.useRef(null), a = t.useRef(!1), u = t.useRef(
15
+ const m = t.useRef(null), T = t.useRef(!1), u = t.useRef(
16
16
  null
17
- ), m = t.useRef(null), [D, r] = t.useState(!1), [I, n] = t.useState(!1), O = t.useRef(!1), v = t.useRef(!1), T = N(s, o), P = typeof T == "string" ? T.trim().length > 0 : T != null, l = () => {
17
+ ), O = t.useRef(null), [D, r] = t.useState(!1), [I, n] = t.useState(!1), v = t.useRef(!1), P = t.useRef(!1), p = N(s, o), C = typeof p == "string" ? p.trim().length > 0 : p != null, l = () => {
18
18
  u.current && (clearTimeout(u.current), u.current = null);
19
19
  }, c = () => {
20
- const e = m.current;
21
- e && (document.removeEventListener("scroll", e, !0), m.current = null);
20
+ const e = O.current;
21
+ e && (document.removeEventListener("scroll", e, !0), O.current = null);
22
22
  }, A = () => {
23
23
  l(), n(!1), r(!1);
24
24
  }, _ = () => {
25
25
  c();
26
26
  const e = () => {
27
- a.current = !1, A(), c();
27
+ T.current = !1, A(), c();
28
28
  };
29
- m.current = e, document.addEventListener("scroll", e, {
29
+ O.current = e, document.addEventListener("scroll", e, {
30
30
  capture: !0,
31
31
  passive: !0
32
32
  });
33
33
  };
34
34
  t.useEffect(() => {
35
35
  r(!1), n(!1), l(), c();
36
- }, [h, s, o, i, f, p]), t.useEffect(
36
+ }, [h, s, o, i, a, g]), t.useEffect(
37
37
  () => () => {
38
38
  l(), c();
39
39
  },
40
40
  []
41
41
  );
42
42
  const k = t.useCallback((e) => {
43
- g.current = e;
44
- }, []), E = (e) => i || L(e, p), C = (e, R) => {
45
- if (!(f || !P)) {
46
- if (E(e)) {
43
+ m.current = e;
44
+ }, []), R = (e) => i || L(e, g), d = (e, f) => {
45
+ if (!(a || !C)) {
46
+ if (R(e)) {
47
47
  r(!0), n(!0);
48
48
  return;
49
49
  }
50
50
  r(!1), n(!1);
51
51
  }
52
52
  }, F = (e) => {
53
- l(), u.current = setTimeout(() => {
54
- u.current = null, a.current && C(e);
53
+ l();
54
+ const f = R(e);
55
+ u.current = setTimeout(() => {
56
+ if (u.current = null, !!T.current) {
57
+ if (f) {
58
+ r(!0), n(!0);
59
+ return;
60
+ }
61
+ d(e);
62
+ }
55
63
  }, H);
56
64
  };
57
65
  return {
58
66
  setTriggerRef: k,
59
67
  onTriggerPointerEnter: (e) => {
60
- if (!(f || !P)) {
61
- if (a.current = !0, _(), i) {
62
- C(e.currentTarget);
68
+ if (!(a || !C)) {
69
+ if (T.current = !0, _(), i) {
70
+ d(e.currentTarget);
63
71
  return;
64
72
  }
65
73
  F(e.currentTarget);
66
74
  }
67
75
  },
68
76
  onTriggerPointerLeave: () => {
69
- a.current = !1, l();
77
+ T.current = !1, l();
70
78
  },
71
- onTriggerFocus: d ? (e) => {
72
- C(e.currentTarget);
79
+ onTriggerFocus: E ? (e) => {
80
+ d(e.currentTarget);
73
81
  } : void 0,
74
82
  onContentPointerEnter: () => {
75
- O.current = !0, n(!0);
83
+ v.current = !0, n(!0);
76
84
  },
77
85
  onContentPointerDown: () => {
78
- v.current = !0, n(!0);
86
+ P.current = !0, n(!0);
79
87
  },
80
88
  onContentPointerLeave: () => {
81
- O.current = !1;
89
+ v.current = !1;
82
90
  },
83
91
  onContentPointerUp: () => {
84
- v.current = !1;
92
+ P.current = !1;
85
93
  },
86
- triggerTabIndex: d ? 0 : void 0,
94
+ triggerTabIndex: E ? 0 : void 0,
87
95
  isTooltipArmed: D,
88
96
  isTooltipOpen: I,
89
- tooltipContent: T,
97
+ tooltipContent: p,
90
98
  recheckOverflow: () => {
91
- const e = g.current;
92
- return !e || f || !P ? !1 : E(e) ? (r(!0), !0) : (r(!1), n(!1), !1);
99
+ const e = m.current;
100
+ return !e || a || !C ? !1 : R(e) ? (r(!0), !0) : (r(!1), n(!1), !1);
93
101
  },
94
102
  handleTooltipOpenChange: (e) => {
95
- if (!e && (O.current || v.current) || e && !D && !i || (n(e), e))
103
+ if (!e && (v.current || P.current) || e && !D && !i || (n(e), e))
96
104
  return;
97
105
  c();
98
- const R = g.current;
99
- if (!R) {
106
+ const f = m.current;
107
+ if (!f) {
100
108
  r(!1);
101
109
  return;
102
110
  }
103
- !i && !L(R, p) && r(!1);
111
+ !i && !L(f, g) && r(!1);
104
112
  }
105
113
  };
106
114
  }
107
115
  export {
108
- B as useOverflowTooltip
116
+ z as useOverflowTooltip
109
117
  };