impact-nova 1.5.14 → 1.6.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 (149) hide show
  1. package/dist/components/ui/accordion.d.ts +4 -1
  2. package/dist/components/ui/accordion.js +28 -22
  3. package/dist/components/ui/ag-grid-react/cell-renderers/badge-cell-renderer.js +11 -11
  4. package/dist/components/ui/ag-grid-react/cell-renderers/checkbox-display-renderer.js +12 -12
  5. package/dist/components/ui/ag-grid-react/cell-renderers/date-display-renderer.js +13 -13
  6. package/dist/components/ui/ag-grid-react/cell-renderers/editors/date-cell-editor.js +13 -13
  7. package/dist/components/ui/ag-grid-react/cell-renderers/editors/input-cell-editor.js +30 -30
  8. package/dist/components/ui/ag-grid-react/cell-renderers/editors/percent-progress-cell-editor.js +13 -13
  9. package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.js +16 -16
  10. package/dist/components/ui/ag-grid-react/cell-renderers/editors/textarea-cell-editor.js +17 -17
  11. package/dist/components/ui/ag-grid-react/cell-renderers/input-display-renderer.js +11 -11
  12. package/dist/components/ui/ag-grid-react/cell-renderers/link-with-batch-cell-renderer.js +2 -2
  13. package/dist/components/ui/ag-grid-react/cell-renderers/percent-progress-display-renderer.js +11 -13
  14. package/dist/components/ui/ag-grid-react/cell-renderers/select-display-renderer.js +8 -8
  15. package/dist/components/ui/ag-grid-react/cell-renderers/split-cell-renderer.js +6 -6
  16. package/dist/components/ui/ag-grid-react/cell-renderers/status-badge-renderer.d.ts +1 -1
  17. package/dist/components/ui/ag-grid-react/cell-renderers/status-badge-renderer.js +14 -14
  18. package/dist/components/ui/ag-grid-react/cell-renderers/switch-display-renderer.js +18 -18
  19. package/dist/components/ui/ag-grid-react/cell-renderers/textarea-display-renderer.js +6 -6
  20. package/dist/components/ui/ag-grid-react/headers/advanced-filter/advanced-filter-dialog.js +14 -14
  21. package/dist/components/ui/ag-grid-react/headers/advanced-filter/column-filter-section.js +35 -35
  22. package/dist/components/ui/ag-grid-react/headers/column-menu/column-settings-menu.js +49 -49
  23. package/dist/components/ui/ag-grid-react/headers/components/header-info.js +29 -29
  24. package/dist/components/ui/ag-grid-react/headers/components/info-modal.js +9 -9
  25. package/dist/components/ui/ag-grid-react/headers/components/section-renderers.js +20 -20
  26. package/dist/components/ui/ag-grid-react/headers/custom-header-group.js +10 -10
  27. package/dist/components/ui/ag-grid-react/headers/custom-header.js +76 -76
  28. package/dist/components/ui/ag-grid-react/headers/header-search-input.js +118 -118
  29. package/dist/components/ui/ag-grid-react/index.js +121 -102
  30. package/dist/components/ui/alert-dialog.js +6 -6
  31. package/dist/components/ui/alert.d.ts +4 -3
  32. package/dist/components/ui/alert.js +182 -64
  33. package/dist/components/ui/avatar.js +5 -5
  34. package/dist/components/ui/badge.d.ts +7 -2
  35. package/dist/components/ui/badge.js +105 -32
  36. package/dist/components/ui/breadcrumb.js +26 -21
  37. package/dist/components/ui/button-group.d.ts +7 -0
  38. package/dist/components/ui/button-group.js +116 -91
  39. package/dist/components/ui/button-variants.d.ts +7 -2
  40. package/dist/components/ui/button-variants.js +31 -16
  41. package/dist/components/ui/button.d.ts +2 -2
  42. package/dist/components/ui/button.js +10 -10
  43. package/dist/components/ui/calendar.js +185 -184
  44. package/dist/components/ui/card.js +24 -24
  45. package/dist/components/ui/chart/chart.js +27 -27
  46. package/dist/components/ui/chart/chart.utils.js +50 -50
  47. package/dist/components/ui/checkbox.js +22 -22
  48. package/dist/components/ui/chips.d.ts +19 -3
  49. package/dist/components/ui/chips.js +140 -41
  50. package/dist/components/ui/command-palette/command-palette-layout.d.ts +28 -0
  51. package/dist/components/ui/command-palette/command-palette-layout.js +59 -0
  52. package/dist/components/ui/command-palette/command-palette.js +254 -264
  53. package/dist/components/ui/command-palette/index.d.ts +1 -1
  54. package/dist/components/ui/command-palette/index.js +42 -41
  55. package/dist/components/ui/command-palette/kbd.js +18 -18
  56. package/dist/components/ui/command-palette/shortcut-settings.d.ts +3 -3
  57. package/dist/components/ui/command-palette/shortcut-settings.js +105 -111
  58. package/dist/components/ui/command-palette/utils.d.ts +6 -1
  59. package/dist/components/ui/command-palette/utils.js +81 -74
  60. package/dist/components/ui/data-table/data-table-column-list.js +31 -31
  61. package/dist/components/ui/data-table/data-table-constants.d.ts +6 -0
  62. package/dist/components/ui/data-table/data-table-constants.js +4 -0
  63. package/dist/components/ui/data-table/data-table-context.d.ts +4 -0
  64. package/dist/components/ui/data-table/data-table-format-options.js +35 -35
  65. package/dist/components/ui/data-table/data-table-sheet.d.ts +4 -4
  66. package/dist/components/ui/data-table/data-table-sheet.js +91 -58
  67. package/dist/components/ui/data-table/data-table-view-options.js +29 -29
  68. package/dist/components/ui/data-table/data-table.js +84 -52
  69. package/dist/components/ui/data-table/index.d.ts +1 -0
  70. package/dist/components/ui/data-table/index.js +15 -13
  71. package/dist/components/ui/date-picker/date-picker.js +35 -35
  72. package/dist/components/ui/date-picker/date-range-picker.js +166 -164
  73. package/dist/components/ui/date-picker/month-picker.js +14 -14
  74. package/dist/components/ui/date-picker/month-range-picker.js +198 -189
  75. package/dist/components/ui/date-picker/multi-date-picker.js +14 -14
  76. package/dist/components/ui/date-picker/multi-month-picker.js +1 -1
  77. package/dist/components/ui/date-picker/multi-week-picker.js +1 -1
  78. package/dist/components/ui/date-picker/week-picker.js +2 -2
  79. package/dist/components/ui/date-picker/week-range-picker.js +164 -162
  80. package/dist/components/ui/dialog.js +25 -28
  81. package/dist/components/ui/drawer.js +40 -40
  82. package/dist/components/ui/dropdown-menu.js +72 -72
  83. package/dist/components/ui/empty-container.js +73 -69
  84. package/dist/components/ui/file-upload.js +137 -135
  85. package/dist/components/ui/filter-panel/filter-panel.d.ts +2 -2
  86. package/dist/components/ui/filter-panel/filter-panel.js +175 -97
  87. package/dist/components/ui/filter-strip/filter-strip.d.ts +1 -1
  88. package/dist/components/ui/filter-strip/filter-strip.js +63 -50
  89. package/dist/components/ui/filter-strip/filter-summary.d.ts +4 -1
  90. package/dist/components/ui/filter-strip/filter-summary.js +230 -146
  91. package/dist/components/ui/filter-strip/filter-tag-list.js +125 -91
  92. package/dist/components/ui/header.d.ts +7 -3
  93. package/dist/components/ui/header.js +87 -79
  94. package/dist/components/ui/horizontal-scroller/horizontal-scroller.js +44 -44
  95. package/dist/components/ui/hover-card.js +10 -10
  96. package/dist/components/ui/input.js +79 -70
  97. package/dist/components/ui/loader.js +16 -16
  98. package/dist/components/ui/nested-list/components/NestedListCategoryFilters.js +16 -16
  99. package/dist/components/ui/nested-list/components/NestedListHeader.js +27 -27
  100. package/dist/components/ui/nested-list/components/SortableItem.js +58 -58
  101. package/dist/components/ui/notification-panel/notification-item.js +32 -32
  102. package/dist/components/ui/notification-panel/notification-list.js +24 -24
  103. package/dist/components/ui/notification-panel/notification-panel.js +26 -26
  104. package/dist/components/ui/popover.js +22 -22
  105. package/dist/components/ui/progress.js +34 -34
  106. package/dist/components/ui/prompt.js +48 -48
  107. package/dist/components/ui/radio-group.js +63 -54
  108. package/dist/components/ui/select/components/LabelWithSequence.js +6 -6
  109. package/dist/components/ui/select/components/Submenu.js +33 -33
  110. package/dist/components/ui/select/select.js +425 -376
  111. package/dist/components/ui/sheet.js +88 -66
  112. package/dist/components/ui/sidebar.js +342 -296
  113. package/dist/components/ui/skeleton.js +6 -6
  114. package/dist/components/ui/slider.js +17 -17
  115. package/dist/components/ui/statistics-card.d.ts +86 -0
  116. package/dist/components/ui/statistics-card.hooks.d.ts +150 -0
  117. package/dist/components/ui/statistics-card.hooks.js +100 -0
  118. package/dist/components/ui/statistics-card.js +259 -0
  119. package/dist/components/ui/stepper.js +51 -51
  120. package/dist/components/ui/switch.js +7 -7
  121. package/dist/components/ui/tabs.js +70 -70
  122. package/dist/components/ui/tag-group.d.ts +1 -0
  123. package/dist/components/ui/tag-group.js +14 -13
  124. package/dist/components/ui/tag.js +43 -43
  125. package/dist/components/ui/textarea.js +86 -58
  126. package/dist/components/ui/toast.js +39 -39
  127. package/dist/components/ui/tooltip.js +23 -23
  128. package/dist/components/ui/types/date-picker.types.d.ts +1 -0
  129. package/dist/components/ui/types/filter-panel.types.d.ts +3 -0
  130. package/dist/components/ui/types/filter-strip.types.d.ts +14 -0
  131. package/dist/components/ui/types/horizontal-scroller.types.d.ts +1 -1
  132. package/dist/components/ui/types/statistics-card.types.d.ts +1 -0
  133. package/dist/i18n/defaultMessages.d.ts +8 -0
  134. package/dist/i18n/defaultMessages.js +15 -9
  135. package/dist/i18n/locales/de.js +7 -1
  136. package/dist/i18n/locales/es.js +7 -1
  137. package/dist/i18n/locales/hi.js +7 -1
  138. package/dist/i18n/locales/kn.js +7 -1
  139. package/dist/icons/assets/bulk-edit.svg.js +5 -0
  140. package/dist/icons/assets/clock.svg.js +5 -0
  141. package/dist/icons/assets/statistics.svg.js +5 -0
  142. package/dist/icons/index.d.ts +3 -0
  143. package/dist/icons/index.js +254 -206
  144. package/dist/impact-nova.css +1 -1
  145. package/dist/index.d.ts +1 -0
  146. package/dist/index.js +361 -347
  147. package/package.json +3 -2
  148. package/tailwind.config.js +259 -152
  149. /package/dist/icons/assets/{PivotMode.svg.js → pivotMode.svg.js} +0 -0
@@ -1,63 +1,163 @@
1
- import { jsxs as l, jsx as t } from "react/jsx-runtime";
2
- import * as f from "react";
3
- import { Slot as g } from "@radix-ui/react-slot";
4
- import { cva as x } from "class-variance-authority";
5
- import { Cross as b } from "../../icons/index.js";
6
- import { cn as v } from "../../lib/utils.js";
7
- import { useImpactNovaI18n as h } from "../../i18n/ImpactNovaI18nContext.js";
8
- const y = x(
9
- "inline-flex items-center gap-1.5 px-2.5 py-0.5 text-xs font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
1
+ import { jsxs as l, jsx as e, Fragment as v } from "react/jsx-runtime";
2
+ import * as C from "react";
3
+ import { Slot as w } from "@radix-ui/react-slot";
4
+ import { cva as j } from "class-variance-authority";
5
+ import { Check as I } from "lucide-react";
6
+ import { Cross as R } from "../../icons/index.js";
7
+ import { cn as m } from "../../lib/utils.js";
8
+ import { useImpactNovaI18n as V } from "../../i18n/ImpactNovaI18nContext.js";
9
+ function _({
10
+ selected: n,
11
+ disabled: d
12
+ }) {
13
+ return d ? /* @__PURE__ */ e(
14
+ "span",
15
+ {
16
+ className: "relative flex size-5 shrink-0 items-center justify-center",
17
+ "aria-hidden": !0,
18
+ children: n ? /* @__PURE__ */ l(v, { children: [
19
+ /* @__PURE__ */ e("span", { className: "absolute size-5 rounded-full border-[1.25px] border-disabled-border" }),
20
+ /* @__PURE__ */ e("span", { className: "absolute size-[13px] rounded-full bg-disabled-foreground" })
21
+ ] }) : /* @__PURE__ */ e("span", { className: "absolute size-5 rounded-full border border-disabled-border bg-transparent" })
22
+ }
23
+ ) : /* @__PURE__ */ e(
24
+ "span",
25
+ {
26
+ className: "relative flex size-5 shrink-0 items-center justify-center",
27
+ "aria-hidden": !0,
28
+ children: n ? /* @__PURE__ */ l(v, { children: [
29
+ /* @__PURE__ */ e("span", { className: "absolute size-5 rounded-full border-[1.25px] border-brand" }),
30
+ /* @__PURE__ */ e("span", { className: "absolute size-[13px] rounded-full bg-brand" })
31
+ ] }) : /* @__PURE__ */ e("span", { className: "absolute size-5 rounded-full border border-border bg-transparent" })
32
+ }
33
+ );
34
+ }
35
+ const S = j(
36
+ "inline-flex min-h-8 max-w-full min-w-0 items-center gap-1 border text-sm font-medium leading-5 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-focus-ring/25 focus-visible:ring-offset-1 focus-visible:ring-offset-canvas disabled:pointer-events-none disabled:opacity-100",
10
37
  {
11
38
  variants: {
12
39
  variant: {
13
- default: "bg-primary text-primary-foreground",
14
- secondary: "bg-secondary text-secondary-foreground",
15
- tertiary: "border border-tertiary-border bg-background text-[#60697d] hover:bg-accent hover:text-secondary-hover-foreground hover:border-secondary-hover-foreground",
16
- outline: "border border-input bg-background",
17
- destructive: "bg-destructive text-destructive-foreground"
40
+ /** IA default chip — same as `neutral` (Figma “Default” type). */
41
+ default: "border-border bg-canvas-elevated text-[#60697d] hover:bg-accent hover:border-primary-hover hover:text-primary-hover",
42
+ /** Figma default / outline chip */
43
+ neutral: "border-border bg-canvas-elevated text-[#60697d] hover:bg-accent hover:border-primary-hover hover:text-primary-hover",
44
+ /** Alias for neutral (legacy docs) */
45
+ outline: "border-border bg-canvas-elevated text-[#60697d] hover:bg-accent hover:border-primary-hover hover:text-primary-hover",
46
+ /** Solid brand (legacy “default”) */
47
+ primary: "border-transparent bg-brand text-brand-foreground hover:bg-brand-strong",
48
+ secondary: "border-transparent bg-secondary text-secondary-foreground",
49
+ tertiary: "border border-stroke-field bg-canvas text-content-tertiary hover:bg-accent hover:text-secondary-hover-foreground hover:border-secondary-hover-foreground",
50
+ destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive-hover"
51
+ },
52
+ shape: {
53
+ rounded: "rounded-xl",
54
+ pill: "rounded-full"
18
55
  },
19
56
  size: {
20
- sm: "px-2 py-0.5 text-xs",
21
- md: "px-2.5 py-0.5 text-xs",
22
- lg: "px-3 py-1 text-sm"
57
+ sm: "min-h-7 gap-1 px-2 py-1 text-xs leading-4",
58
+ md: "px-3 py-1.5",
59
+ lg: "min-h-9 gap-1.5 px-4 py-2 text-sm leading-5"
23
60
  },
24
- shape: {
25
- pill: "rounded-full",
26
- rounded: "rounded-[12px]"
61
+ selected: {
62
+ true: "",
63
+ false: ""
27
64
  }
28
65
  },
66
+ compoundVariants: [
67
+ {
68
+ variant: "default",
69
+ selected: !0,
70
+ class: "border-brand bg-canvas-elevated text-brand hover:border-brand hover:bg-canvas-elevated hover:text-brand"
71
+ },
72
+ {
73
+ variant: "neutral",
74
+ selected: !0,
75
+ class: "border-brand bg-canvas-elevated text-brand hover:border-brand hover:bg-canvas-elevated hover:text-brand"
76
+ },
77
+ {
78
+ variant: "outline",
79
+ selected: !0,
80
+ class: "border-brand bg-canvas-elevated text-brand hover:border-brand hover:bg-canvas-elevated hover:text-brand"
81
+ }
82
+ ],
29
83
  defaultVariants: {
30
84
  variant: "default",
85
+ shape: "rounded",
31
86
  size: "md",
32
- shape: "pill"
87
+ selected: !1
33
88
  }
34
89
  }
35
- ), C = f.forwardRef(
36
- ({ className: a, variant: r, size: o, shape: e, onRemove: n, removable: i, asChild: s = !1, children: d, ...p }, c) => {
37
- const { t: u } = h();
90
+ ), B = C.forwardRef(
91
+ ({
92
+ className: n,
93
+ variant: d,
94
+ size: b,
95
+ shape: c,
96
+ selected: r = !1,
97
+ selectionMode: a = "none",
98
+ trailing: s,
99
+ onRemove: f,
100
+ removable: p,
101
+ asChild: h = !1,
102
+ disabled: o,
103
+ children: i,
104
+ ...g
105
+ }, x) => {
106
+ const { t: y } = V(), N = h ? w : "div", t = d ?? "default", u = !!(r && (t === "default" || t === "neutral" || t === "outline")), k = t === "primary" ? r ? "text-brand-foreground" : "text-brand-foreground/75" : t === "destructive" ? r ? "text-destructive-foreground" : "text-destructive-foreground/75" : t === "secondary" ? r ? "text-secondary-foreground" : "text-secondary-foreground/80" : r ? "text-brand" : "text-[#60697d]";
38
107
  return /* @__PURE__ */ l(
39
- s ? g : "div",
108
+ N,
40
109
  {
41
- ref: c,
42
- className: v(y({ variant: r, size: o, shape: e }), a),
110
+ ref: x,
111
+ className: m(
112
+ S({
113
+ variant: d,
114
+ size: b,
115
+ shape: c,
116
+ selected: u
117
+ }),
118
+ o && "!border-disabled-border !bg-disabled-surface !text-[#b4bac7] hover:!border-disabled-border hover:!bg-disabled-surface hover:!text-[#b4bac7] [&_.chip-trailing]:!text-[#b4bac7] hover:[&_.chip-trailing]:!text-[#b4bac7] [&_svg]:!text-[#b4bac7]",
119
+ o && u && "!border-disabled-border !text-disabled-foreground",
120
+ n
121
+ ),
43
122
  "data-component": "chip",
44
- "data-variant": r ?? "default",
45
- "data-size": o ?? "md",
46
- "data-shape": e ?? "pill",
47
- ...p,
123
+ "data-variant": t,
124
+ "data-size": b ?? "md",
125
+ "data-shape": c ?? "rounded",
126
+ "data-selected": r ? "true" : "false",
127
+ "data-selection-mode": a,
128
+ role: a !== "none" ? "button" : void 0,
129
+ tabIndex: a !== "none" && !o ? 0 : void 0,
130
+ "aria-disabled": o || void 0,
131
+ "aria-pressed": a === "single" ? r : void 0,
132
+ "aria-checked": a === "multi" ? r : void 0,
133
+ ...g,
48
134
  children: [
49
- d,
50
- i && /* @__PURE__ */ t(
135
+ a === "single" && /* @__PURE__ */ e("span", { className: "chip-leading flex shrink-0", children: /* @__PURE__ */ e(_, { selected: r, disabled: o }) }),
136
+ a === "multi" && /* @__PURE__ */ e(
137
+ I,
138
+ {
139
+ className: m(
140
+ "chip-leading size-5 shrink-0 stroke-[1.75]",
141
+ k
142
+ ),
143
+ "aria-hidden": !0,
144
+ stroke: "currentColor"
145
+ }
146
+ ),
147
+ i != null && i !== !1 && /* @__PURE__ */ e("span", { className: "flex min-w-0 items-center gap-1 truncate [&>*]:min-w-0", children: i }),
148
+ s != null && s !== !1 && /* @__PURE__ */ e("span", { className: "chip-trailing shrink-0 font-medium tabular-nums text-current", children: s }),
149
+ p && /* @__PURE__ */ e(
51
150
  "button",
52
151
  {
53
152
  type: "button",
54
- onClick: (m) => {
55
- m.stopPropagation(), n?.();
153
+ onClick: (z) => {
154
+ z.stopPropagation(), f?.();
56
155
  },
57
- className: "ml-1 p-1 rounded-full hover:bg-black/20 focus:outline-none focus:ring-2 focus:ring-ring",
58
- "aria-label": u("aria.remove"),
156
+ className: "-mr-0.5 ml-0.5 inline-flex size-6 shrink-0 items-center justify-center rounded-md text-current hover:bg-content/10 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-focus-ring/30",
157
+ "aria-label": y("aria.remove"),
59
158
  "data-component": "chip-remove",
60
- children: /* @__PURE__ */ t(b, { size: 8 })
159
+ disabled: o,
160
+ children: /* @__PURE__ */ e(R, { size: 8 })
61
161
  }
62
162
  )
63
163
  ]
@@ -65,8 +165,7 @@ const y = x(
65
165
  );
66
166
  }
67
167
  );
68
- C.displayName = "Chip";
168
+ B.displayName = "Chip";
69
169
  export {
70
- C as Chip,
71
- y as chipVariants
170
+ B as Chip
72
171
  };
@@ -0,0 +1,28 @@
1
+ import { CommandDefinition } from './utils';
2
+ /** One visual section (heading + rows). `rowStart` is the index in `orderedCommands` of the first row. */
3
+ export type CommandPaletteLayoutGroup = {
4
+ heading: string;
5
+ items: CommandDefinition[];
6
+ rowStart: number;
7
+ };
8
+ /**
9
+ * Single model for the palette list: groups define structure; `orderedCommands` is the flat
10
+ * top-to-bottom order. Keyboard selection always indexes `orderedCommands`.
11
+ */
12
+ export type CommandPaletteLayout = {
13
+ groups: CommandPaletteLayoutGroup[];
14
+ orderedCommands: CommandDefinition[];
15
+ };
16
+ export type BuildCommandPaletteLayoutInput = {
17
+ /** Commands after fuzzy filter and recency sort (palette pipeline output). */
18
+ filteredCommands: CommandDefinition[];
19
+ /** When true, “Recently Used” is split into its own group; when false, group only by category. */
20
+ emptyQuery: boolean;
21
+ recentCommandIds: readonly string[];
22
+ recentGroupLabel: string;
23
+ defaultGroupLabel: string;
24
+ };
25
+ /**
26
+ * Pure: filtered commands → visible groups + flat row list in screen order.
27
+ */
28
+ export declare function buildCommandPaletteLayout(input: BuildCommandPaletteLayoutInput): CommandPaletteLayout;
@@ -0,0 +1,59 @@
1
+ const w = {
2
+ modal: 4,
3
+ page: 3,
4
+ module: 2,
5
+ global: 1
6
+ }, G = {
7
+ user: 2,
8
+ "ag-grid": 1,
9
+ browser: 0,
10
+ system: 0
11
+ };
12
+ function I(l) {
13
+ const {
14
+ filteredCommands: m,
15
+ emptyQuery: u,
16
+ recentCommandIds: p,
17
+ recentGroupLabel: n,
18
+ defaultGroupLabel: i
19
+ } = l, g = new Set(p), o = /* @__PURE__ */ new Map();
20
+ if (u) {
21
+ const t = m.filter((s) => g.has(s.id));
22
+ t.length > 0 && o.set(n, t);
23
+ const e = m.filter((s) => !g.has(s.id));
24
+ for (const s of e) {
25
+ const r = s.category || i;
26
+ o.has(r) || o.set(r, []), o.get(r).push(s);
27
+ }
28
+ } else
29
+ for (const t of m) {
30
+ const e = t.category || i;
31
+ o.has(e) || o.set(e, []), o.get(e).push(t);
32
+ }
33
+ const d = /* @__PURE__ */ new Map();
34
+ for (const [t, e] of o.entries()) {
35
+ let s = -1;
36
+ for (const r of e) {
37
+ const b = w[r.scope] ?? 1, C = G[r.source ?? "user"] ?? 0;
38
+ s = Math.max(s, b * 10 + C);
39
+ }
40
+ d.set(t, s);
41
+ }
42
+ const h = Array.from(o.entries()).filter(([t]) => t !== n).sort(
43
+ ([t], [e]) => (d.get(e) ?? 0) - (d.get(t) ?? 0)
44
+ ), c = [];
45
+ let a = 0;
46
+ const f = o.get(n);
47
+ f && (c.push({
48
+ heading: n,
49
+ items: f,
50
+ rowStart: a
51
+ }), a += f.length);
52
+ for (const [t, e] of h)
53
+ c.push({ heading: t, items: e, rowStart: a }), a += e.length;
54
+ const y = c.flatMap((t) => t.items);
55
+ return { groups: c, orderedCommands: y };
56
+ }
57
+ export {
58
+ I as buildCommandPaletteLayout
59
+ };