impact-nova 2.2.6 → 2.2.8

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 (40) hide show
  1. package/dist/components/data/ag-grid-react/cell-renderers/link-with-batch-cell-renderer.js +96 -120
  2. package/dist/components/data/ag-grid-react/headers/components/section-renderers.js +19 -18
  3. package/dist/components/data/ag-grid-react/info-system-story-columns.d.ts +38 -1
  4. package/dist/components/data/data-table/data-table-saved-views.js +70 -79
  5. package/dist/components/data-display/badge/badge.variants.d.ts +2 -2
  6. package/dist/components/feedback/alert/alert.variants.d.ts +1 -1
  7. package/dist/components/feedback/tooltip/badge-overflow-tooltip.d.ts +19 -0
  8. package/dist/components/feedback/tooltip/badge-overflow-tooltip.js +48 -0
  9. package/dist/components/feedback/tooltip/index.d.ts +2 -0
  10. package/dist/components/feedback/tooltip/index.js +11 -9
  11. package/dist/components/feedback/tooltip/overflow-tooltip.js +73 -50
  12. package/dist/components/feedback/tooltip/overflow-tooltip.types.d.ts +5 -0
  13. package/dist/components/feedback/tooltip/tooltip.d.ts +2 -2
  14. package/dist/components/feedback/tooltip/tooltip.js +65 -28
  15. package/dist/components/feedback/tooltip/tooltip.variants.js +1 -1
  16. package/dist/components/feedback/tooltip/use-overflow-tooltip.js +89 -35
  17. package/dist/components/flows/filter-panel/filter-panel.js +33 -29
  18. package/dist/components/flows/filter-strip/filter-summary.js +126 -137
  19. package/dist/components/flows/filter-strip/filter-tag-list.js +97 -89
  20. package/dist/components/forms/prompt/prompt.js +13 -13
  21. package/dist/components/forms/prompt/prompt.variants.d.ts +1 -1
  22. package/dist/components/forms/select/components/SelectMenuPanel.js +26 -22
  23. package/dist/components/forms/select/components/SelectOptionRow.js +67 -64
  24. package/dist/components/forms/select/components/Submenu.js +40 -35
  25. package/dist/components/forms/select/hooks/useSuppressOptionClickForTextSelection.d.ts +5 -0
  26. package/dist/components/forms/select/hooks/useSuppressOptionClickForTextSelection.js +28 -0
  27. package/dist/components/forms/select/select.js +121 -120
  28. package/dist/components/forms/select/utils/shouldSuppressOptionClickForTextSelection.d.ts +5 -0
  29. package/dist/components/forms/select/utils/shouldSuppressOptionClickForTextSelection.js +16 -0
  30. package/dist/components/primitives/tag/tag.variants.d.ts +1 -1
  31. package/dist/impact-nova.css +1 -1
  32. package/dist/index.js +153 -151
  33. package/dist/lib/overlay/prevent-dismiss-on-tooltip-outside.d.ts +3 -0
  34. package/dist/lib/overlay/prevent-dismiss-on-tooltip-outside.js +34 -0
  35. package/dist/lib/tooltip/tooltip-content-interaction.d.ts +4 -0
  36. package/dist/lib/tooltip/tooltip-content-interaction.js +21 -0
  37. package/dist/llms/rules/installation.js +1 -1
  38. package/dist/llms/rules/requirements.js +1 -1
  39. package/dist/providers/app-providers.js +18 -11
  40. package/package.json +1 -1
@@ -1,45 +1,82 @@
1
- import { jsx as i, jsxs as m } from "react/jsx-runtime";
2
- import * as s from "react";
1
+ import { jsx as n, jsxs as u } from "react/jsx-runtime";
2
+ import * as T from "react";
3
3
  import * as r from "@radix-ui/react-tooltip";
4
- import { wrapRadixPart as c } from "../../../lib/primitives/create-compound.js";
5
- import { cn as a } from "../../../lib/utils.js";
6
- import { tooltipVariants as f } from "./tooltip.variants.js";
7
- function g(t) {
4
+ import { wrapRadixPart as y } from "../../../lib/primitives/create-compound.js";
5
+ import { useOverlayPortalContainer as C } from "../../../lib/overlay/overlay-portal-context.js";
6
+ import { clearTooltipContentPointerGestureEnd as k, markTooltipContentPointerGestureStart as b } from "../../../lib/tooltip/tooltip-content-interaction.js";
7
+ import { cn as l } from "../../../lib/utils.js";
8
+ import { tooltipVariants as v } from "./tooltip.variants.js";
9
+ function w(t) {
8
10
  return t === "primary" ? "default" : t ?? "tertiary";
9
11
  }
10
- const x = r.Provider, N = (t) => /* @__PURE__ */ i(r.Root, { "data-component": "tooltip", ...t }), R = c(
12
+ const G = ({
13
+ disableHoverableContent: t = !1,
14
+ ...i
15
+ }) => /* @__PURE__ */ n(
16
+ r.Provider,
17
+ {
18
+ disableHoverableContent: t,
19
+ ...i
20
+ }
21
+ ), A = ({
22
+ disableHoverableContent: t = !1,
23
+ ...i
24
+ }) => /* @__PURE__ */ n(
25
+ r.Root,
26
+ {
27
+ "data-component": "tooltip",
28
+ disableHoverableContent: t,
29
+ ...i
30
+ }
31
+ ), E = y(
11
32
  "tooltip",
12
33
  "trigger",
13
34
  "TooltipTrigger",
14
35
  r.Trigger
15
- ), u = s.forwardRef(
36
+ ), x = T.forwardRef(
16
37
  ({
17
38
  className: t,
18
- sideOffset: n = 4,
19
- variant: l = "tertiary",
20
- showArrow: p = !0,
39
+ sideOffset: i = 4,
40
+ variant: p = "tertiary",
41
+ showArrow: s = !0,
42
+ onPointerDown: m,
43
+ onPointerUp: c,
44
+ onClick: d,
45
+ onDoubleClick: f,
21
46
  ...e
22
- }, d) => {
23
- const o = g(l);
24
- return /* @__PURE__ */ i(r.Portal, { children: /* @__PURE__ */ m(
47
+ }, P) => {
48
+ const a = w(p), g = C();
49
+ return /* @__PURE__ */ n(r.Portal, { container: g, children: /* @__PURE__ */ u(
25
50
  r.Content,
26
51
  {
27
- ref: d,
28
- sideOffset: n,
52
+ ref: P,
53
+ sideOffset: i,
29
54
  "data-component": "tooltip-content",
30
- "data-variant": o,
31
- className: a(f({ variant: o }), t),
55
+ "data-variant": a,
56
+ className: l(v({ variant: a }), t),
57
+ onPointerDown: (o) => {
58
+ b(), o.stopPropagation(), m?.(o);
59
+ },
60
+ onPointerUp: (o) => {
61
+ k(), o.stopPropagation(), c?.(o);
62
+ },
63
+ onClick: (o) => {
64
+ o.stopPropagation(), d?.(o);
65
+ },
66
+ onDoubleClick: (o) => {
67
+ o.stopPropagation(), f?.(o);
68
+ },
32
69
  ...e,
33
70
  children: [
34
71
  e.children,
35
- p && /* @__PURE__ */ i(
72
+ s && /* @__PURE__ */ n(
36
73
  r.Arrow,
37
74
  {
38
- className: a(
75
+ className: l(
39
76
  "fill-current",
40
- o === "default" && "fill-brand",
41
- o === "secondary" && "fill-background stroke-border",
42
- o === "tertiary" && "fill-foreground"
77
+ a === "default" && "fill-brand",
78
+ a === "secondary" && "fill-background stroke-border",
79
+ a === "tertiary" && "fill-foreground"
43
80
  )
44
81
  }
45
82
  )
@@ -48,10 +85,10 @@ const x = r.Provider, N = (t) => /* @__PURE__ */ i(r.Root, { "data-component": "
48
85
  ) });
49
86
  }
50
87
  );
51
- u.displayName = r.Content.displayName;
88
+ x.displayName = r.Content.displayName;
52
89
  export {
53
- N as Tooltip,
54
- u as TooltipContent,
55
- x as TooltipProvider,
56
- R as TooltipTrigger
90
+ A as Tooltip,
91
+ x as TooltipContent,
92
+ G as TooltipProvider,
93
+ E as TooltipTrigger
57
94
  };
@@ -1,6 +1,6 @@
1
1
  import { cva as t } from "class-variance-authority";
2
2
  const o = t(
3
- "z-[100] overflow-hidden rounded-md px-4 py-2 text-sm animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin] motion-reduce:animate-none motion-reduce:transition-none",
3
+ "z-[100] select-text overflow-hidden rounded-md px-4 py-2 text-sm animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin] motion-reduce:animate-none motion-reduce:transition-none",
4
4
  {
5
5
  variants: {
6
6
  variant: {
@@ -1,55 +1,109 @@
1
- import * as s from "react";
2
- import { isTextOverflowing as v } from "../../../lib/overflow/is-text-overflowing.js";
3
- function R(r, n) {
4
- return r !== void 0 ? r : typeof n == "string" ? n : null;
1
+ import * as t from "react";
2
+ import { isTextOverflowing as L } from "../../../lib/overflow/is-text-overflowing.js";
3
+ const H = 500;
4
+ function N(o, s) {
5
+ return o !== void 0 ? o : typeof s == "string" ? s : null;
5
6
  }
6
- function F(r, {
7
- content: n,
8
- overflowMode: f = "ellipsis",
7
+ function B(o, {
8
+ content: s,
9
+ overflowMode: p = "ellipsis",
9
10
  alwaysShow: i = !1,
10
- disabled: u = !1,
11
- focusable: g = !1,
12
- contentDependency: C
11
+ disabled: f = !1,
12
+ focusable: d = !1,
13
+ contentDependency: h
13
14
  } = {}) {
14
- const c = s.useRef(null), [p, t] = s.useState(!1), [h, o] = s.useState(!1), l = R(n, r), T = typeof l == "string" ? l.trim().length > 0 : l != null;
15
- s.useEffect(() => {
16
- t(!1), o(!1);
17
- }, [C, n, r, i, u, f]);
18
- const I = s.useCallback((e) => {
19
- c.current = e;
20
- }, []), m = (e) => i || v(e, f), O = (e, a) => {
21
- if (!(u || !T)) {
22
- if (m(e)) {
23
- t(!0), o(!0);
15
+ const g = t.useRef(null), a = t.useRef(!1), u = t.useRef(
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 = () => {
18
+ u.current && (clearTimeout(u.current), u.current = null);
19
+ }, c = () => {
20
+ const e = m.current;
21
+ e && (document.removeEventListener("scroll", e, !0), m.current = null);
22
+ }, A = () => {
23
+ l(), n(!1), r(!1);
24
+ }, _ = () => {
25
+ c();
26
+ const e = () => {
27
+ a.current = !1, A(), c();
28
+ };
29
+ m.current = e, document.addEventListener("scroll", e, {
30
+ capture: !0,
31
+ passive: !0
32
+ });
33
+ };
34
+ t.useEffect(() => {
35
+ r(!1), n(!1), l(), c();
36
+ }, [h, s, o, i, f, p]), t.useEffect(
37
+ () => () => {
38
+ l(), c();
39
+ },
40
+ []
41
+ );
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)) {
47
+ r(!0), n(!0);
24
48
  return;
25
49
  }
26
- t(!1), o(!1);
50
+ r(!1), n(!1);
27
51
  }
52
+ }, F = (e) => {
53
+ l(), u.current = setTimeout(() => {
54
+ u.current = null, a.current && C(e);
55
+ }, H);
28
56
  };
29
57
  return {
30
- setTriggerRef: I,
58
+ setTriggerRef: k,
31
59
  onTriggerPointerEnter: (e) => {
32
- O(e.currentTarget);
60
+ if (!(f || !P)) {
61
+ if (a.current = !0, _(), i) {
62
+ C(e.currentTarget);
63
+ return;
64
+ }
65
+ F(e.currentTarget);
66
+ }
33
67
  },
34
- onTriggerFocus: g ? (e) => {
35
- O(e.currentTarget);
68
+ onTriggerPointerLeave: () => {
69
+ a.current = !1, l();
70
+ },
71
+ onTriggerFocus: d ? (e) => {
72
+ C(e.currentTarget);
36
73
  } : void 0,
37
- triggerTabIndex: g ? 0 : void 0,
38
- isTooltipArmed: p,
39
- isTooltipOpen: h,
40
- tooltipContent: l,
74
+ onContentPointerEnter: () => {
75
+ O.current = !0, n(!0);
76
+ },
77
+ onContentPointerDown: () => {
78
+ v.current = !0, n(!0);
79
+ },
80
+ onContentPointerLeave: () => {
81
+ O.current = !1;
82
+ },
83
+ onContentPointerUp: () => {
84
+ v.current = !1;
85
+ },
86
+ triggerTabIndex: d ? 0 : void 0,
87
+ isTooltipArmed: D,
88
+ isTooltipOpen: I,
89
+ tooltipContent: T,
41
90
  recheckOverflow: () => {
42
- const e = c.current;
43
- return !e || u || !T ? !1 : m(e) ? (t(!0), !0) : (t(!1), o(!1), !1);
91
+ const e = g.current;
92
+ return !e || f || !P ? !1 : E(e) ? (r(!0), !0) : (r(!1), n(!1), !1);
44
93
  },
45
94
  handleTooltipOpenChange: (e) => {
46
- if (e && !p && !i || (o(e), e || i))
95
+ if (!e && (O.current || v.current) || e && !D && !i || (n(e), e))
47
96
  return;
48
- const a = c.current;
49
- a && (v(a, f) || t(!1));
97
+ c();
98
+ const R = g.current;
99
+ if (!R) {
100
+ r(!1);
101
+ return;
102
+ }
103
+ !i && !L(R, p) && r(!1);
50
104
  }
51
105
  };
52
106
  }
53
107
  export {
54
- F as useOverflowTooltip
108
+ B as useOverflowTooltip
55
109
  };
@@ -1,21 +1,22 @@
1
1
  import { jsx as e, jsxs as a } from "react/jsx-runtime";
2
- import v from "react";
3
- import { Sheet as b, SheetContent as g, SheetDescription as N, SheetTitle as y, SheetClose as w } from "../../feedback/sheet/sheet.js";
4
- import { createCompoundPart as k } from "../../../lib/primitives/create-compound.js";
2
+ import b from "react";
3
+ import { Sheet as g, SheetContent as N, SheetDescription as y, SheetTitle as w, SheetClose as k } from "../../feedback/sheet/sheet.js";
4
+ import { createCompoundPart as C } from "../../../lib/primitives/create-compound.js";
5
5
  import { cn as o } from "../../../lib/utils.js";
6
- import { MultiColorFilter as C, Cross as F, InfoBadge as u } from "impact-nova-icons";
7
- import { Button as P } from "../../primitives/button/button.js";
6
+ import { MultiColorFilter as F, Cross as P, InfoBadge as u } from "impact-nova-icons";
7
+ import { Button as D } from "../../primitives/button/button.js";
8
8
  import { Tooltip as d, TooltipTrigger as f, TooltipContent as h } from "../../feedback/tooltip/tooltip.js";
9
9
  import { Kbd as S } from "../../primitives/kbd/kbd.js";
10
10
  import { OverflowTooltip as j } from "../../feedback/tooltip/overflow-tooltip.js";
11
- import { useImpactNovaI18n as x } from "../../../i18n/use-impact-nova-i18n.js";
11
+ import { useImpactNovaI18n as v } from "../../../i18n/use-impact-nova-i18n.js";
12
12
  import { useOverlayHostDismissNestedLayersOnNavigation as I } from "../../../lib/overlay/overlay-portal-context.js";
13
- const T = ({
13
+ import { preventDismissOnTooltipOutside as x } from "../../../lib/overlay/prevent-dismiss-on-tooltip-outside.js";
14
+ const O = ({
14
15
  title: i,
15
16
  children: n,
16
17
  className: l
17
18
  }) => {
18
- const { t: c } = x();
19
+ const { t: c } = v();
19
20
  return /* @__PURE__ */ a(
20
21
  "div",
21
22
  {
@@ -31,29 +32,29 @@ const T = ({
31
32
  {
32
33
  className: "flex size-8 shrink-0 items-center justify-center rounded-md border border-brand-tint bg-canvas-elevated",
33
34
  "aria-hidden": !0,
34
- children: /* @__PURE__ */ e(C, { className: "size-5 shrink-0" })
35
+ children: /* @__PURE__ */ e(F, { className: "size-5 shrink-0" })
35
36
  }
36
37
  ),
37
- /* @__PURE__ */ e(y, { className: "text-lg font-bold text-content", children: i })
38
+ /* @__PURE__ */ e(w, { className: "text-lg font-bold text-content", children: i })
38
39
  ] }),
39
40
  /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
40
41
  n,
41
- /* @__PURE__ */ e(w, { asChild: !0, children: /* @__PURE__ */ e(
42
- P,
42
+ /* @__PURE__ */ e(k, { asChild: !0, children: /* @__PURE__ */ e(
43
+ D,
43
44
  {
44
45
  variant: "secondary",
45
46
  size: "icon",
46
47
  tabIndex: -1,
47
48
  "aria-label": c("aria.close"),
48
49
  "data-component": "filter-panel-close",
49
- children: /* @__PURE__ */ e(F, { className: "h-3 w-3" })
50
+ children: /* @__PURE__ */ e(P, { className: "h-3 w-3" })
50
51
  }
51
52
  ) })
52
53
  ] })
53
54
  ]
54
55
  }
55
56
  );
56
- }, _ = ({
57
+ }, G = ({
57
58
  open: i,
58
59
  onOpenChange: n,
59
60
  title: l = "Filter panel",
@@ -62,8 +63,8 @@ const T = ({
62
63
  sidebar: p,
63
64
  className: m,
64
65
  preventClose: t = !1
65
- }) => /* @__PURE__ */ e(b, { open: i, onOpenChange: n, children: /* @__PURE__ */ a(
66
- g,
66
+ }) => /* @__PURE__ */ e(g, { open: i, onOpenChange: n, children: /* @__PURE__ */ a(
67
+ N,
67
68
  {
68
69
  side: "right",
69
70
  className: o(
@@ -71,15 +72,18 @@ const T = ({
71
72
  m
72
73
  ),
73
74
  onInteractOutside: (r) => {
74
- t && r.preventDefault();
75
+ x(r), t && r.preventDefault();
76
+ },
77
+ onPointerDownOutside: (r) => {
78
+ x(r), t && r.preventDefault();
75
79
  },
76
80
  onEscapeKeyDown: (r) => {
77
81
  t && r.preventDefault();
78
82
  },
79
83
  children: [
80
- /* @__PURE__ */ e(N, { className: "sr-only", children: "Select filters to apply to the current view." }),
84
+ /* @__PURE__ */ e(y, { className: "sr-only", children: "Select filters to apply to the current view." }),
81
85
  /* @__PURE__ */ a("div", { className: "flex h-full flex-col bg-canvas-elevated", "data-component": "filter-panel", children: [
82
- s || /* @__PURE__ */ e(T, { title: l }),
86
+ s || /* @__PURE__ */ e(O, { title: l }),
83
87
  /* @__PURE__ */ a("div", { className: "flex flex-1 overflow-hidden", children: [
84
88
  p,
85
89
  /* @__PURE__ */ e("div", { className: "flex flex-col flex-1 overflow-hidden", children: c })
@@ -87,13 +91,13 @@ const T = ({
87
91
  ] })
88
92
  ]
89
93
  }
90
- ) }), q = ({
94
+ ) }), J = ({
91
95
  items: i,
92
96
  activeTab: n,
93
97
  onTabChange: l,
94
98
  className: c
95
99
  }) => {
96
- const { t: s } = x(), p = I(), m = (t) => {
100
+ const { t: s } = v(), p = I(), m = (t) => {
97
101
  t !== n && p(), l(t);
98
102
  };
99
103
  return /* @__PURE__ */ e(
@@ -106,7 +110,7 @@ const T = ({
106
110
  ),
107
111
  children: /* @__PURE__ */ e("div", { className: "flex flex-1 flex-col py-2 gap-1 overflow-y-auto", children: i.map((t) => {
108
112
  const r = n === t.id;
109
- return /* @__PURE__ */ a(v.Fragment, { children: [
113
+ return /* @__PURE__ */ a(b.Fragment, { children: [
110
114
  t.separator && /* @__PURE__ */ e("div", { className: "my-2 h-px bg-stroke-hairline" }),
111
115
  /* @__PURE__ */ a(
112
116
  "button",
@@ -195,12 +199,12 @@ const T = ({
195
199
  }) })
196
200
  }
197
201
  );
198
- }, G = k("filter-panel", {
202
+ }, Q = C("filter-panel", {
199
203
  part: "body",
200
204
  displayName: "FilterPanelBody",
201
205
  className: "flex flex-1 flex-col overflow-auto bg-canvas-elevated p-4",
202
206
  scrollSurface: !0
203
- }), J = ({
207
+ }), U = ({
204
208
  children: i,
205
209
  className: n,
206
210
  leftAction: l
@@ -219,9 +223,9 @@ const T = ({
219
223
  }
220
224
  );
221
225
  export {
222
- _ as FilterPanel,
223
- G as FilterPanelBody,
224
- J as FilterPanelFooter,
225
- T as FilterPanelHeader,
226
- q as FilterPanelSidebar
226
+ G as FilterPanel,
227
+ Q as FilterPanelBody,
228
+ U as FilterPanelFooter,
229
+ O as FilterPanelHeader,
230
+ J as FilterPanelSidebar
227
231
  };