impact-nova 3.0.0-alpha.17 → 3.0.0-alpha.19

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 (111) hide show
  1. package/dist/components/data/ag-grid-react/ag-grid.types.d.ts +15 -0
  2. package/dist/components/data/ag-grid-react/cell-renderers/badge-cell-renderer.d.ts +2 -0
  3. package/dist/components/data/ag-grid-react/cell-renderers/badge-cell-renderer.js +15 -14
  4. package/dist/components/data/ag-grid-react/cell-renderers/badge-icon-registry.d.ts +10 -0
  5. package/dist/components/data/ag-grid-react/cell-renderers/badge-icon-registry.js +17 -0
  6. package/dist/components/data/ag-grid-react/cell-renderers/index.d.ts +45 -7
  7. package/dist/components/data/ag-grid-react/cell-renderers/index.js +70 -58
  8. package/dist/components/data/ag-grid-react/cell-renderers/style-description-display-renderer.d.ts +5 -11
  9. package/dist/components/data/ag-grid-react/cell-renderers/style-description-display-renderer.js +127 -51
  10. package/dist/components/data/ag-grid-react/headers/custom-header.js +56 -56
  11. package/dist/components/data/ag-grid-react/index.d.ts +2 -1
  12. package/dist/components/data/ag-grid-react/index.js +315 -296
  13. package/dist/components/data/ag-grid-react/list-drag-grid-options.d.ts +14 -1
  14. package/dist/components/data/ag-grid-react/list-drag-grid-options.js +95 -31
  15. package/dist/components/data/ag-grid-react/list-drag-preview-card.d.ts +4 -0
  16. package/dist/components/data/ag-grid-react/list-drag-preview-card.js +14 -0
  17. package/dist/components/data/ag-grid-react/list-drag-preview-snapshot.d.ts +20 -0
  18. package/dist/components/data/ag-grid-react/list-drag-preview-snapshot.js +42 -0
  19. package/dist/components/data/ag-grid-react/list-find-highlight.d.ts +6 -0
  20. package/dist/components/data/ag-grid-react/list-find-highlight.js +7 -0
  21. package/dist/components/data/ag-grid-react/numeric-column-header-alignment.d.ts +9 -0
  22. package/dist/components/data/ag-grid-react/numeric-column-header-alignment.js +67 -0
  23. package/dist/components/data/ag-grid-react/process-backend-columndefs.d.ts +10 -2
  24. package/dist/components/data/ag-grid-react/process-backend-columndefs.js +84 -0
  25. package/dist/components/data/ag-grid-react/use-ag-grid-list-drag.d.ts +10 -2
  26. package/dist/components/data/ag-grid-react/use-ag-grid-list-drag.js +130 -107
  27. package/dist/components/data/ag-grid-react/use-list-drag-preview.d.ts +4 -1
  28. package/dist/components/data/ag-grid-react/use-list-drag-preview.js +131 -32
  29. package/dist/components/data/ag-grid-react/use-list-find.d.ts +36 -0
  30. package/dist/components/data/ag-grid-react/use-list-row-drop-zones.d.ts +2 -0
  31. package/dist/components/data/ag-grid-react/use-list-row-drop-zones.js +60 -41
  32. package/dist/components/data/data-table/data-table-list-header.js +1 -1
  33. package/dist/components/data/data-table/data-table-overlay.d.ts +6 -0
  34. package/dist/components/data/data-table/data-table-overlay.js +18 -0
  35. package/dist/components/data/data-table/data-table.types.d.ts +1 -0
  36. package/dist/components/data/data-table/index.d.ts +3 -0
  37. package/dist/components/data/data-table/index.js +67 -63
  38. package/dist/components/data/expandable-list-item/expandable-list-item-attributes.js +3 -2
  39. package/dist/components/data/expandable-list-item/expandable-list-item-metrics.js +3 -2
  40. package/dist/components/data/scenario-comparison/flatten-scenario-comparison-rows.d.ts +2 -0
  41. package/dist/components/data/scenario-comparison/flatten-scenario-comparison-rows.js +16 -0
  42. package/dist/components/data/scenario-comparison/index.d.ts +3 -0
  43. package/dist/components/data/scenario-comparison/index.js +6 -0
  44. package/dist/components/data/scenario-comparison/scenario-comparison-column.d.ts +12 -0
  45. package/dist/components/data/scenario-comparison/scenario-comparison-column.js +172 -0
  46. package/dist/components/data/scenario-comparison/scenario-comparison-label.d.ts +6 -0
  47. package/dist/components/data/scenario-comparison/scenario-comparison-label.js +64 -0
  48. package/dist/components/data/scenario-comparison/scenario-comparison.d.ts +5 -0
  49. package/dist/components/data/scenario-comparison/scenario-comparison.js +127 -0
  50. package/dist/components/data/scenario-comparison/scenario-comparison.types.d.ts +56 -0
  51. package/dist/components/data/scenario-comparison/scenario-comparison.variants.d.ts +7 -0
  52. package/dist/components/data/scenario-comparison/scenario-comparison.variants.js +29 -0
  53. package/dist/components/data-display/badge/index.d.ts +2 -0
  54. package/dist/components/data-display/badge/index.js +4 -2
  55. package/dist/components/data-display/badge/trophy-icon.d.ts +6 -0
  56. package/dist/components/data-display/badge/trophy-icon.js +28 -0
  57. package/dist/components/feedback/find-bar/collect-find-matches.d.ts +35 -0
  58. package/dist/components/feedback/find-bar/collect-find-matches.js +68 -0
  59. package/dist/components/feedback/find-bar/find-bar-shortcuts.d.ts +5 -0
  60. package/dist/components/feedback/find-bar/find-bar-shortcuts.js +27 -0
  61. package/dist/components/feedback/find-bar/find-bar.d.ts +7 -0
  62. package/dist/components/feedback/find-bar/find-bar.js +266 -0
  63. package/dist/components/feedback/find-bar/find-bar.types.d.ts +32 -0
  64. package/dist/components/feedback/find-bar/index.d.ts +4 -0
  65. package/dist/components/feedback/find-bar/index.js +11 -0
  66. package/dist/components/feedback/tooltip/tab-tooltip-render.js +3 -2
  67. package/dist/components/flows/command-palette/shortcut-settings.js +10 -10
  68. package/dist/components/flows/filter-panel/filter-panel.js +4 -4
  69. package/dist/components/flows/iris-chat/iris-chat-composer.js +213 -184
  70. package/dist/components/flows/iris-chat/iris-chat-icons.d.ts +1 -0
  71. package/dist/components/flows/iris-chat/iris-chat-icons.js +23 -10
  72. package/dist/components/flows/iris-chat/iris-chat.variants.js +4 -4
  73. package/dist/components/flows/iris-chat/sync-iris-chat-composer-textarea.d.ts +6 -0
  74. package/dist/components/flows/iris-chat/sync-iris-chat-composer-textarea.js +23 -0
  75. package/dist/components/forms/choice-card/choice-card-compare-scroll.d.ts +4 -0
  76. package/dist/components/forms/choice-card/choice-card-compare-scroll.js +6 -0
  77. package/dist/components/forms/choice-card/choice-card.d.ts +13 -2
  78. package/dist/components/forms/choice-card/choice-card.js +432 -342
  79. package/dist/components/forms/choice-card/choice-card.types.d.ts +9 -2
  80. package/dist/components/forms/select/components/SelectTriggerValue.js +3 -2
  81. package/dist/components/forms/select/components/Submenu.js +3 -2
  82. package/dist/components/primitives/tabs/folder-tab-path.d.ts +6 -0
  83. package/dist/components/primitives/tabs/folder-tab-path.js +16 -0
  84. package/dist/components/primitives/tabs/tabs.js +178 -112
  85. package/dist/components/primitives/tabs/tabs.types.d.ts +1 -1
  86. package/dist/i18n/defaultMessages.d.ts +19 -0
  87. package/dist/i18n/defaultMessages.js +54 -38
  88. package/dist/i18n/impact-nova-i18n-defaults.d.ts +5 -0
  89. package/dist/i18n/impact-nova-i18n-defaults.js +4 -9
  90. package/dist/i18n/index.d.ts +1 -1
  91. package/dist/i18n/locales/de.js +17 -1
  92. package/dist/i18n/locales/es.js +17 -1
  93. package/dist/i18n/locales/hi.js +17 -1
  94. package/dist/i18n/locales/kn.js +17 -1
  95. package/dist/impact-nova-components.css +189 -14
  96. package/dist/impact-nova-tokens.scss +2 -0
  97. package/dist/impact-nova.css +1 -1
  98. package/dist/index.d.ts +1 -0
  99. package/dist/index.js +621 -607
  100. package/dist/lib/virtualized/index.d.ts +2 -0
  101. package/dist/lib/virtualized/index.js +35 -31
  102. package/dist/lib/virtualized/list-index.d.ts +5 -0
  103. package/dist/lib/virtualized/list-index.js +13 -0
  104. package/dist/lib/virtualized/read-infinite-query-list.d.ts +14 -0
  105. package/dist/lib/virtualized/read-infinite-query-list.js +12 -0
  106. package/dist/lib/virtualized/types.d.ts +4 -2
  107. package/dist/lib/virtualized/useRowState.js +60 -56
  108. package/dist/lib/virtualized/useVirtualizedList.d.ts +5 -0
  109. package/dist/llms/rules/installation.js +1 -1
  110. package/dist/llms/rules/requirements.js +1 -1
  111. package/package.json +1 -1
@@ -0,0 +1,56 @@
1
+ import { ReactNode } from 'react';
2
+ export interface ScenarioComparisonCell {
3
+ /** One entry per metric header, in the same order. A third header needs a third entry. */
4
+ values?: readonly ReactNode[];
5
+ /** Indexes in `values` that render as a success badge. Omit to keep every value as text. */
6
+ badgeIndexes?: readonly number[];
7
+ emphasized?: boolean;
8
+ }
9
+ export interface ScenarioComparisonRow {
10
+ id: string;
11
+ label: ReactNode;
12
+ icon?: ReactNode;
13
+ swatch?: string;
14
+ children?: readonly ScenarioComparisonRow[];
15
+ }
16
+ export interface ScenarioComparisonColumn {
17
+ id: string;
18
+ title: ReactNode;
19
+ values?: Record<string, ScenarioComparisonCell>;
20
+ disabled?: boolean;
21
+ }
22
+ export interface FlatScenarioComparisonRow {
23
+ id: string;
24
+ label: ReactNode;
25
+ icon?: ReactNode;
26
+ swatch?: string;
27
+ depth: number;
28
+ emphasized: boolean;
29
+ }
30
+ export interface ScenarioComparisonLabelState {
31
+ row: FlatScenarioComparisonRow;
32
+ hovered: boolean;
33
+ }
34
+ export interface ScenarioComparisonCellState {
35
+ row: FlatScenarioComparisonRow;
36
+ column: ScenarioComparisonColumn;
37
+ cell?: ScenarioComparisonCell;
38
+ hovered: boolean;
39
+ }
40
+ export interface ScenarioComparisonProps {
41
+ title?: ReactNode;
42
+ badge?: ReactNode;
43
+ toolbar?: ReactNode;
44
+ rows: readonly ScenarioComparisonRow[];
45
+ columns: readonly ScenarioComparisonColumn[];
46
+ value?: string;
47
+ defaultValue?: string;
48
+ onValueChange?: (value: string) => void;
49
+ metricHeaders?: readonly ReactNode[];
50
+ selectLabel?: string;
51
+ selectedLabel?: string;
52
+ renderLabel?: (state: ScenarioComparisonLabelState) => ReactNode;
53
+ renderCell?: (state: ScenarioComparisonCellState) => ReactNode;
54
+ className?: string;
55
+ disabled?: boolean;
56
+ }
@@ -0,0 +1,7 @@
1
+ export declare const scenarioComparisonRootVariants: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
2
+ export declare const scenarioComparisonCardVariants: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
3
+ export declare const scenarioComparisonRowsClassName = "min-h-0 overflow-x-hidden overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden";
4
+ export declare const scenarioComparisonLabelVariants: (props?: ({
5
+ kind?: "child" | "parent" | null | undefined;
6
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
+ export declare const scenarioComparisonConnectorClassName = "h-px w-10 shrink-0 border-t border-dotted border-stroke-accent";
@@ -0,0 +1,29 @@
1
+ import { cva as e } from "class-variance-authority";
2
+ const a = e(
3
+ "flex h-full min-h-0 min-w-0 flex-col gap-4 overflow-hidden rounded-lg bg-canvas-elevated px-4 py-3 shadow-elevation-header"
4
+ ), o = e(
5
+ [
6
+ "grid h-full min-h-0 grid-rows-subgrid gap-0 overflow-hidden rounded-xl border border-solid border-stroke bg-none bg-canvas-elevated p-0 px-4 shadow-none [grid-row:1/-1]",
7
+ "data-[selected]:border-brand data-[selected]:bg-gradient-to-b data-[selected]:from-canvas-muted data-[selected]:to-canvas-elevated data-[selected]:shadow-[inset_3px_0_0_0_var(--color-primary)]"
8
+ ]
9
+ ), n = "min-h-0 overflow-x-hidden overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", d = e(
10
+ "inline-flex max-w-full min-w-0 items-center justify-center gap-1 rounded-full px-2 py-1 text-sm font-medium leading-[21px] capitalize",
11
+ {
12
+ variants: {
13
+ kind: {
14
+ parent: "border border-stroke-accent bg-accent text-accent-foreground",
15
+ child: "border-transparent"
16
+ }
17
+ },
18
+ defaultVariants: {
19
+ kind: "child"
20
+ }
21
+ }
22
+ ), t = "h-px w-10 shrink-0 border-t border-dotted border-stroke-accent";
23
+ export {
24
+ o as scenarioComparisonCardVariants,
25
+ t as scenarioComparisonConnectorClassName,
26
+ d as scenarioComparisonLabelVariants,
27
+ a as scenarioComparisonRootVariants,
28
+ n as scenarioComparisonRowsClassName
29
+ };
@@ -1,3 +1,5 @@
1
1
  export { Badge } from './badge';
2
2
  export type { BadgeProps } from './badge.types';
3
3
  export { badgeVariants } from './badge.variants';
4
+ export { Trophy } from './trophy-icon';
5
+ export type { TrophyIconProps } from './trophy-icon';
@@ -1,6 +1,8 @@
1
1
  import { Badge as e } from "./badge.js";
2
- import { badgeVariants as t } from "./badge.variants.js";
2
+ import { badgeVariants as p } from "./badge.variants.js";
3
+ import { Trophy as f } from "./trophy-icon.js";
3
4
  export {
4
5
  e as Badge,
5
- t as badgeVariants
6
+ f as Trophy,
7
+ p as badgeVariants
6
8
  };
@@ -0,0 +1,6 @@
1
+ import { SVGProps } from 'react';
2
+ export interface TrophyIconProps extends SVGProps<SVGSVGElement> {
3
+ size?: number | string;
4
+ }
5
+ /** Outline trophy used on rank badges. The icon set has a medal, not this cup. */
6
+ export declare const Trophy: import('react').ForwardRefExoticComponent<Omit<TrophyIconProps, "ref"> & import('react').RefAttributes<SVGSVGElement>>;
@@ -0,0 +1,28 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { forwardRef as n } from "react";
3
+ const h = n(function({ size: C = 16, className: t, ...e }, i) {
4
+ const r = typeof C == "number" ? C : 16;
5
+ return /* @__PURE__ */ o(
6
+ "svg",
7
+ {
8
+ ref: i,
9
+ width: r,
10
+ height: r,
11
+ viewBox: "0 0 16 16",
12
+ fill: "none",
13
+ "aria-hidden": !0,
14
+ className: t,
15
+ ...e,
16
+ children: /* @__PURE__ */ o(
17
+ "path",
18
+ {
19
+ d: "M7.33333 12.6667V10.6C6.78889 10.4778 6.30278 10.2472 5.875 9.90833C5.44722 9.56944 5.13333 9.14444 4.93333 8.63333C4.1 8.53333 3.40278 8.16944 2.84167 7.54167C2.28056 6.91389 2 6.17778 2 5.33333V4.66667C2 4.3 2.13056 3.98611 2.39167 3.725C2.65278 3.46389 2.96667 3.33333 3.33333 3.33333H4.66667C4.66667 2.96667 4.79722 2.65278 5.05833 2.39167C5.31944 2.13056 5.63333 2 6 2H10C10.3667 2 10.6806 2.13056 10.9417 2.39167C11.2028 2.65278 11.3333 2.96667 11.3333 3.33333H12.6667C13.0333 3.33333 13.3472 3.46389 13.6083 3.725C13.8694 3.98611 14 4.3 14 4.66667V5.33333C14 6.17778 13.7194 6.91389 13.1583 7.54167C12.5972 8.16944 11.9 8.53333 11.0667 8.63333C10.8667 9.14444 10.5528 9.56944 10.125 9.90833C9.69722 10.2472 9.21111 10.4778 8.66667 10.6V12.6667H10.6667C10.8556 12.6667 11.0139 12.7306 11.1417 12.8583C11.2694 12.9861 11.3333 13.1444 11.3333 13.3333C11.3333 13.5222 11.2694 13.6806 11.1417 13.8083C11.0139 13.9361 10.8556 14 10.6667 14H5.33333C5.14444 14 4.98611 13.9361 4.85833 13.8083C4.73056 13.6806 4.66667 13.5222 4.66667 13.3333C4.66667 13.1444 4.73056 12.9861 4.85833 12.8583C4.98611 12.7306 5.14444 12.6667 5.33333 12.6667H7.33333ZM4.66667 7.2V4.66667H3.33333V5.33333C3.33333 5.75556 3.45556 6.13611 3.7 6.475C3.94444 6.81389 4.26667 7.05556 4.66667 7.2ZM9.41667 8.75C9.80556 8.36111 10 7.88889 10 7.33333V3.33333H6V7.33333C6 7.88889 6.19444 8.36111 6.58333 8.75C6.97222 9.13889 7.44444 9.33333 8 9.33333C8.55556 9.33333 9.02778 9.13889 9.41667 8.75ZM11.3333 7.2C11.7333 7.05556 12.0556 6.81389 12.3 6.475C12.5444 6.13611 12.6667 5.75556 12.6667 5.33333V4.66667H11.3333V7.2Z",
20
+ fill: "currentColor"
21
+ }
22
+ )
23
+ }
24
+ );
25
+ });
26
+ export {
27
+ h as Trophy
28
+ };
@@ -0,0 +1,35 @@
1
+ /** Case-insensitive substring match. Empty or whitespace-only queries match nothing. */
2
+ export declare function collectFindMatches<TItem>(items: TItem[], query: string, getText: (item: TItem) => string): TItem[];
3
+ export interface FindTextOccurrence<TItem> {
4
+ item: TItem;
5
+ /** 0-based index of this needle hit within getText(item) (Chrome find steps per occurrence). */
6
+ occurrenceIndexInText: number;
7
+ }
8
+ /** Flat list of every substring hit in order — use for match count and active index. */
9
+ export declare function collectFindMatchOccurrences<TItem>(items: TItem[], query: string, getText: (item: TItem) => string): FindTextOccurrence<TItem>[];
10
+ /** Clamp a 0-based index into `[0, matchCount)`. Returns 0 when there are no matches. */
11
+ export declare function clampFindMatchIndex(activeIndex: number, matchCount: number): number;
12
+ /** 0-based wrap. Stale indexes are clamped before stepping. Returns 0 when there are no matches. */
13
+ export declare function stepFindMatchIndex(activeIndex: number, matchCount: number, direction: "next" | "previous"): number;
14
+ export interface FindCounterState {
15
+ visible: boolean;
16
+ currentDisplay: number;
17
+ matchCount: number;
18
+ status: string;
19
+ noMatch: boolean;
20
+ }
21
+ /** Chrome/Safari: hide count while empty; "No results" when the query misses. */
22
+ export declare function getFindCounterState(options: {
23
+ query: string;
24
+ activeIndex: number;
25
+ matchCount: number;
26
+ noResultsLabel?: string;
27
+ }): FindCounterState;
28
+ /** Map an index in `text.toLowerCase()` back onto `text` when casing changes length (e.g. İ). */
29
+ export declare function mapLowerIndexToOriginal(text: string, lowerIndex: number): number;
30
+ export interface FindHighlightPart {
31
+ value: string;
32
+ match: boolean;
33
+ }
34
+ /** Split `text` so hosts can mark the matched substring like find-in-page. */
35
+ export declare function splitFindHighlight(text: string, query: string): FindHighlightPart[];
@@ -0,0 +1,68 @@
1
+ function m(e, t, n) {
2
+ const r = t.trim().toLowerCase();
3
+ return r ? e.filter((l) => n(l).toLowerCase().includes(r)) : [];
4
+ }
5
+ function g(e, t, n) {
6
+ const r = t.trim();
7
+ if (!r) return [];
8
+ const l = r.toLowerCase(), c = [];
9
+ for (const o of e) {
10
+ const i = n(o).toLowerCase();
11
+ let u = 0, f = 0, a = i.indexOf(l, u);
12
+ for (; a !== -1; )
13
+ c.push({ item: o, occurrenceIndexInText: f }), f += 1, u = a + l.length, a = i.indexOf(l, u);
14
+ }
15
+ return c;
16
+ }
17
+ function d(e, t) {
18
+ return t <= 0 || e < 0 ? 0 : e >= t ? t - 1 : e;
19
+ }
20
+ function w(e, t, n) {
21
+ return t <= 0 ? 0 : (d(e, t) + (n === "next" ? 1 : -1) + t) % t;
22
+ }
23
+ function C(e) {
24
+ const t = e.noResultsLabel ?? "No results";
25
+ if (!e.query.trim())
26
+ return { visible: !1, currentDisplay: 0, matchCount: 0, status: "", noMatch: !1 };
27
+ if (e.matchCount <= 0)
28
+ return { visible: !0, currentDisplay: 0, matchCount: 0, status: t, noMatch: !0 };
29
+ const n = d(e.activeIndex, e.matchCount) + 1;
30
+ return {
31
+ visible: !0,
32
+ currentDisplay: n,
33
+ matchCount: e.matchCount,
34
+ status: `${n} of ${e.matchCount}`,
35
+ noMatch: !1
36
+ };
37
+ }
38
+ function h(e, t) {
39
+ if (t <= 0) return 0;
40
+ let n = 0, r = 0;
41
+ for (; r < e.length && n < t; ) {
42
+ const l = e.codePointAt(r);
43
+ if (l == null) break;
44
+ const c = String.fromCodePoint(l);
45
+ n += c.toLowerCase().length, r += c.length;
46
+ }
47
+ return r;
48
+ }
49
+ function L(e, t) {
50
+ const n = t.trim();
51
+ if (!n || !e) return [{ value: e, match: !1 }];
52
+ const r = e.toLowerCase(), l = n.toLowerCase(), c = [];
53
+ let o = 0, s = r.indexOf(l, o);
54
+ for (; s !== -1; ) {
55
+ const i = h(e, s), u = h(e, s + l.length);
56
+ i > o && c.push({ value: e.slice(o, i), match: !1 }), c.push({ value: e.slice(i, u), match: !0 }), o = u, s = r.indexOf(l, s + l.length);
57
+ }
58
+ return o < e.length && c.push({ value: e.slice(o), match: !1 }), c;
59
+ }
60
+ export {
61
+ d as clampFindMatchIndex,
62
+ g as collectFindMatchOccurrences,
63
+ m as collectFindMatches,
64
+ C as getFindCounterState,
65
+ h as mapLowerIndexToOriginal,
66
+ L as splitFindHighlight,
67
+ w as stepFindMatchIndex
68
+ };
@@ -0,0 +1,5 @@
1
+ export declare function createFindBarShortcutId(): symbol;
2
+ export declare function registerFindBarShortcutCapture(id: symbol): () => void;
3
+ export declare function setFindBarShortcutFocus(id: symbol, focused: boolean): void;
4
+ /** Focused capturing bar wins; otherwise the most recently mounted capturing bar. */
5
+ export declare function isFindBarShortcutOwner(id: symbol): boolean;
@@ -0,0 +1,27 @@
1
+ const r = [];
2
+ let t = null;
3
+ function e() {
4
+ return /* @__PURE__ */ Symbol("find-bar");
5
+ }
6
+ function c(n) {
7
+ return r.push(n), () => {
8
+ const u = r.lastIndexOf(n);
9
+ u >= 0 && r.splice(u, 1), t === n && (t = null);
10
+ };
11
+ }
12
+ function i(n, u) {
13
+ if (u) {
14
+ t = n;
15
+ return;
16
+ }
17
+ t === n && (t = null);
18
+ }
19
+ function l(n) {
20
+ return r.includes(n) ? t != null && r.includes(t) ? t === n : r[r.length - 1] === n : !1;
21
+ }
22
+ export {
23
+ e as createFindBarShortcutId,
24
+ l as isFindBarShortcutOwner,
25
+ c as registerFindBarShortcutCapture,
26
+ i as setFindBarShortcutFocus
27
+ };
@@ -0,0 +1,7 @@
1
+ import { FindBarProps } from './find-bar.types';
2
+ /**
3
+ * Compact in-view find chrome (⌘F / Ctrl+F). Host owns matching and navigation.
4
+ */
5
+ declare const FindBar: import('react').ForwardRefExoticComponent<FindBarProps & import('react').RefAttributes<HTMLDivElement>>;
6
+ export { FindBar };
7
+ export type { FindBarProps } from './find-bar.types';
@@ -0,0 +1,266 @@
1
+ import { jsxs as C, jsx as a } from "react/jsx-runtime";
2
+ import { useRef as w, useId as Z, useState as $, useEffect as m } from "react";
3
+ import { Search as q, ArrowUp as ee, ArrowDown as te, Cross as re } from "impact-nova-icons";
4
+ import { createComponent as ne } from "../../../lib/primitives/create-component.js";
5
+ import { cn as R } from "../../../lib/utils.js";
6
+ import { useImpactNovaI18n as ie } from "../../../i18n/use-impact-nova-i18n.js";
7
+ import { getFindCounterState as oe } from "./collect-find-matches.js";
8
+ import { createFindBarShortcutId as ae, setFindBarShortcutFocus as K, registerFindBarShortcutCapture as se, isFindBarShortcutOwner as ce } from "./find-bar-shortcuts.js";
9
+ function M(e) {
10
+ return e.metaKey || e.ctrlKey;
11
+ }
12
+ function le(e) {
13
+ if (e.key === "Enter" || e.key === "F3" || M(e) && e.key.toLowerCase() === "g")
14
+ return e.shiftKey ? "previous" : "next";
15
+ }
16
+ const ue = 500;
17
+ function de(e, t, i) {
18
+ const [o, l] = $(e), c = w(t), s = w(e);
19
+ m(() => {
20
+ c.current = t;
21
+ }, [t]), m(() => {
22
+ e !== s.current && (s.current = e, l(e));
23
+ }, [e]), m(() => {
24
+ if (i <= 0 || o === s.current) return;
25
+ const u = window.setTimeout(() => {
26
+ s.current = o, c.current(o);
27
+ }, i);
28
+ return () => window.clearTimeout(u);
29
+ }, [o, i]);
30
+ function d(u) {
31
+ l(u), i <= 0 && (s.current = u, c.current(u));
32
+ }
33
+ function f() {
34
+ o !== s.current && (s.current = o, c.current(o));
35
+ }
36
+ return { draft: o, emitDraft: d, commitDraft: f };
37
+ }
38
+ function fe(e) {
39
+ const {
40
+ inputRef: t,
41
+ query: i,
42
+ autoFocus: o,
43
+ captureShortcuts: l,
44
+ ownerId: c,
45
+ commitDraft: s,
46
+ onPrevious: d,
47
+ onNext: f,
48
+ onClose: u,
49
+ onKeyDown: h
50
+ } = e;
51
+ return m(() => {
52
+ o && (t.current?.focus(), t.current?.select());
53
+ }, [o, t]), m(() => {
54
+ if (l)
55
+ return se(c);
56
+ }, [l, c]), m(() => {
57
+ if (!l) return;
58
+ function p(r) {
59
+ if (!ce(c)) return;
60
+ if (M(r) && r.key.toLowerCase() === "f") {
61
+ r.preventDefault(), t.current?.focus(), t.current?.select();
62
+ return;
63
+ }
64
+ const v = le(r);
65
+ !v || r.key === "Enter" || !i.trim() || (r.preventDefault(), v === "previous" ? d?.() : f?.());
66
+ }
67
+ return window.addEventListener("keydown", p), () => window.removeEventListener("keydown", p);
68
+ }, [l, t, f, d, c, i]), function(r) {
69
+ if (h?.(r), !r.defaultPrevented) {
70
+ if (r.key === "Escape") {
71
+ r.preventDefault(), u?.();
72
+ return;
73
+ }
74
+ r.key === "Enter" && (r.target instanceof HTMLButtonElement || (s(), !(!i.trim() && !t.current?.value.trim()) && (r.preventDefault(), r.shiftKey ? d?.() : f?.())));
75
+ }
76
+ };
77
+ }
78
+ function me(e) {
79
+ const { counter: t } = e, i = !t.visible || t.noMatch;
80
+ return e.idle ? /* @__PURE__ */ a("span", { id: e.statusId, className: "sr-only", "aria-live": "polite", children: t.status }) : /* @__PURE__ */ C("div", { className: "flex shrink-0 items-center gap-2", "data-component": "find-bar-trail", children: [
81
+ t.visible ? /* @__PURE__ */ C(
82
+ "p",
83
+ {
84
+ className: R(
85
+ "whitespace-nowrap text-xs font-semibold leading-5",
86
+ t.noMatch ? "text-destructive" : "text-content-icon"
87
+ ),
88
+ "aria-hidden": !0,
89
+ children: [
90
+ /* @__PURE__ */ a("span", { className: t.noMatch ? "text-destructive" : "text-content-secondary", children: t.currentDisplay }),
91
+ "/",
92
+ t.matchCount
93
+ ]
94
+ }
95
+ ) : null,
96
+ /* @__PURE__ */ a("span", { id: e.statusId, className: "sr-only", "aria-live": "polite", children: t.status }),
97
+ /* @__PURE__ */ a("span", { className: "h-3 w-px shrink-0 bg-stroke", "aria-hidden": !0 }),
98
+ /* @__PURE__ */ C("div", { className: "flex items-center gap-2", children: [
99
+ /* @__PURE__ */ a(
100
+ "button",
101
+ {
102
+ type: "button",
103
+ "aria-label": e.previousLabel,
104
+ disabled: i,
105
+ className: "inline-flex size-4 shrink-0 items-center justify-center text-content-icon hover:text-content disabled:opacity-40",
106
+ onClick: e.onPrevious,
107
+ children: /* @__PURE__ */ a(ee, { size: 16, "aria-hidden": !0 })
108
+ }
109
+ ),
110
+ /* @__PURE__ */ a(
111
+ "button",
112
+ {
113
+ type: "button",
114
+ "aria-label": e.nextLabel,
115
+ disabled: i,
116
+ className: "inline-flex size-4 shrink-0 items-center justify-center text-content-icon hover:text-content disabled:opacity-40",
117
+ onClick: e.onNext,
118
+ children: /* @__PURE__ */ a(te, { size: 16, "aria-hidden": !0 })
119
+ }
120
+ )
121
+ ] }),
122
+ e.onClose ? /* @__PURE__ */ a(
123
+ "button",
124
+ {
125
+ type: "button",
126
+ "aria-label": e.closeLabel,
127
+ className: "inline-flex size-3.5 shrink-0 items-center justify-center text-content-icon hover:text-content",
128
+ onClick: e.onClose,
129
+ children: /* @__PURE__ */ a(re, { size: 14, "aria-hidden": !0 })
130
+ }
131
+ ) : null
132
+ ] });
133
+ }
134
+ const De = ne(
135
+ "FindBar",
136
+ ({
137
+ className: e,
138
+ query: t,
139
+ onQueryChange: i,
140
+ debounceMs: o = ue,
141
+ activeIndex: l = 0,
142
+ matchCount: c = 0,
143
+ onPrevious: s,
144
+ onNext: d,
145
+ onClose: f,
146
+ autoFocus: u = !0,
147
+ captureShortcuts: h = !0,
148
+ placeholder: p,
149
+ findLabel: r,
150
+ previousLabel: v,
151
+ nextLabel: S,
152
+ closeLabel: T,
153
+ noResultsLabel: z,
154
+ onKeyDown: j,
155
+ onFocus: _,
156
+ onBlur: A,
157
+ ...O
158
+ }, P) => {
159
+ const { t: b } = ie(), k = r ?? b("findBar.find"), U = v ?? b("findBar.previousMatch"), H = S ?? b("findBar.nextMatch"), W = T ?? b("findBar.closeFind"), Y = z ?? b("findBar.noResults"), D = w(null), g = w(ae()), F = Z(), y = oe({
160
+ query: t,
161
+ activeIndex: l,
162
+ matchCount: c,
163
+ noResultsLabel: Y
164
+ }), B = w(!1), { draft: N, emitDraft: L, commitDraft: E } = de(
165
+ t,
166
+ i,
167
+ o
168
+ );
169
+ function I() {
170
+ E(), f?.();
171
+ }
172
+ const G = fe({
173
+ inputRef: D,
174
+ query: t,
175
+ autoFocus: u,
176
+ captureShortcuts: h,
177
+ ownerId: g.current,
178
+ commitDraft: E,
179
+ onPrevious: s,
180
+ onNext: d,
181
+ onClose: I,
182
+ onKeyDown: j
183
+ });
184
+ function J(n) {
185
+ n.target instanceof Element && n.target.closest("button, input") || (n.preventDefault(), D.current?.focus());
186
+ }
187
+ function Q() {
188
+ h && K(g.current, !0);
189
+ }
190
+ function V(n) {
191
+ if (!h) return;
192
+ const x = n.relatedTarget;
193
+ x instanceof Node && n.currentTarget.contains(x) || K(g.current, !1);
194
+ }
195
+ function X(n) {
196
+ const x = n.nativeEvent;
197
+ B.current || "isComposing" in x && x.isComposing || L(n.currentTarget.value);
198
+ }
199
+ return /* @__PURE__ */ C(
200
+ "div",
201
+ {
202
+ ref: P,
203
+ role: "search",
204
+ "data-component": "find-bar",
205
+ "data-no-match": y.noMatch ? "true" : void 0,
206
+ className: R(
207
+ "inline-flex h-8 w-[200px] max-w-full shrink-0 items-center gap-2 overflow-hidden rounded-md border bg-canvas px-2 transition-colors focus-within:outline-none",
208
+ y.noMatch ? "border-destructive hover:border-destructive" : "border-stroke-field hover:border-brand focus-within:border-brand",
209
+ e
210
+ ),
211
+ ...O,
212
+ onKeyDown: G,
213
+ onMouseDown: J,
214
+ onFocus: (n) => {
215
+ _?.(n), Q();
216
+ },
217
+ onBlur: (n) => {
218
+ A?.(n), V(n);
219
+ },
220
+ children: [
221
+ /* @__PURE__ */ a(q, { size: 16, className: "shrink-0 text-content-icon", "aria-hidden": !0 }),
222
+ /* @__PURE__ */ a(
223
+ "input",
224
+ {
225
+ ref: D,
226
+ type: "text",
227
+ value: N,
228
+ placeholder: p ?? k,
229
+ "aria-label": k,
230
+ "aria-invalid": y.noMatch || void 0,
231
+ "aria-describedby": F,
232
+ autoComplete: "off",
233
+ autoCorrect: "off",
234
+ spellCheck: !1,
235
+ className: "min-w-0 flex-1 truncate bg-transparent p-0 text-sm font-medium leading-5 text-content-title outline-none placeholder:font-normal placeholder:leading-4 placeholder:text-content-placeholder",
236
+ onCompositionStart: () => {
237
+ B.current = !0;
238
+ },
239
+ onCompositionEnd: (n) => {
240
+ B.current = !1, L(n.currentTarget.value);
241
+ },
242
+ onChange: X
243
+ }
244
+ ),
245
+ /* @__PURE__ */ a(
246
+ me,
247
+ {
248
+ counter: y,
249
+ statusId: F,
250
+ previousLabel: U,
251
+ nextLabel: H,
252
+ closeLabel: W,
253
+ onPrevious: s,
254
+ onNext: d,
255
+ onClose: f ? I : void 0,
256
+ idle: N.trim() === ""
257
+ }
258
+ )
259
+ ]
260
+ }
261
+ );
262
+ }
263
+ );
264
+ export {
265
+ De as FindBar
266
+ };
@@ -0,0 +1,32 @@
1
+ import type * as React from "react";
2
+ export interface FindBarProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> {
3
+ /** Current find query. */
4
+ query: string;
5
+ onQueryChange: (query: string) => void;
6
+ /**
7
+ * Delay before `onQueryChange` while typing. The field still updates immediately.
8
+ * Escape / close / Enter flush. Pass `0` to emit on every keystroke.
9
+ */
10
+ debounceMs?: number;
11
+ /** 0-based index of the current match. */
12
+ activeIndex?: number;
13
+ /** Number of matches for `query`. */
14
+ matchCount?: number;
15
+ onPrevious?: () => void;
16
+ onNext?: () => void;
17
+ onClose?: () => void;
18
+ /** Focus the field on mount. Overlay find should leave this on; persistent bars should pass false. */
19
+ autoFocus?: boolean;
20
+ /**
21
+ * When true (default), this instance may own window ⌘F / Ctrl+F, ⌘G / Ctrl+G, and F3.
22
+ * Only the focused capturing bar — or the most recently mounted one if none is focused —
23
+ * actually handles those keys. Persistent bars that must leave browser find alone pass false.
24
+ */
25
+ captureShortcuts?: boolean;
26
+ placeholder?: string;
27
+ findLabel?: string;
28
+ previousLabel?: string;
29
+ nextLabel?: string;
30
+ closeLabel?: string;
31
+ noResultsLabel?: string;
32
+ }
@@ -0,0 +1,4 @@
1
+ export { FindBar } from './find-bar';
2
+ export type { FindBarProps } from './find-bar.types';
3
+ export { clampFindMatchIndex, collectFindMatches, collectFindMatchOccurrences, getFindCounterState, splitFindHighlight, stepFindMatchIndex, } from './collect-find-matches';
4
+ export type { FindCounterState, FindHighlightPart, FindTextOccurrence, } from './collect-find-matches';
@@ -0,0 +1,11 @@
1
+ import { FindBar as c } from "./find-bar.js";
2
+ import { clampFindMatchIndex as i, collectFindMatchOccurrences as d, collectFindMatches as r, getFindCounterState as a, splitFindHighlight as l, stepFindMatchIndex as o } from "./collect-find-matches.js";
3
+ export {
4
+ c as FindBar,
5
+ i as clampFindMatchIndex,
6
+ d as collectFindMatchOccurrences,
7
+ r as collectFindMatches,
8
+ a as getFindCounterState,
9
+ l as splitFindHighlight,
10
+ o as stepFindMatchIndex
11
+ };
@@ -1,6 +1,7 @@
1
1
  import { jsxs as t, jsx as e } from "react/jsx-runtime";
2
2
  import { Tooltip as l, TooltipTrigger as n, TooltipContent as o } from "./tooltip.js";
3
- const d = (i, r, a) => /* @__PURE__ */ t(l, { children: [
3
+ import "react";
4
+ const p = (i, r, a) => /* @__PURE__ */ t(l, { children: [
4
5
  /* @__PURE__ */ e(n, { asChild: !0, children: /* @__PURE__ */ e("span", { className: "inline-flex items-center justify-center h-full w-full", children: i }) }),
5
6
  /* @__PURE__ */ e(o, { variant: "tertiary", className: a, children: r })
6
7
  ] }), h = (i, r) => /* @__PURE__ */ t(l, { children: [
@@ -9,5 +10,5 @@ const d = (i, r, a) => /* @__PURE__ */ t(l, { children: [
9
10
  ] });
10
11
  export {
11
12
  h as defaultAccordionTooltipRender,
12
- d as defaultTabTooltipRender
13
+ p as defaultTabTooltipRender
13
14
  };