@devalok/shilp-sutra 0.23.3 → 0.24.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.
@@ -8,21 +8,51 @@
8
8
  import * as React from 'react';
9
9
  export interface CommandItem {
10
10
  id: string;
11
- label: string;
12
- description?: string;
11
+ /** Display label string or ReactNode. When ReactNode, provide `filterValue` for search filtering. */
12
+ label: string | React.ReactNode;
13
+ /** Optional description — string or ReactNode. */
14
+ description?: string | React.ReactNode;
13
15
  icon?: React.ReactNode;
16
+ /** Keyboard shortcut hint displayed as keycap badges (e.g., "G D", "Ctrl+N"). */
14
17
  shortcut?: string;
18
+ /** Custom render override for the label. Receives the current search query for match highlighting. */
19
+ renderLabel?: (query: string) => React.ReactNode;
20
+ /** Plain-text value used for search filtering when `label` is a ReactNode. Falls back to `label` if string. */
21
+ filterValue?: string;
15
22
  onSelect: () => void;
16
23
  }
17
24
  export interface CommandGroup {
18
25
  label: string;
19
26
  items: CommandItem[];
20
27
  }
28
+ /** A single keyboard hint shown in the footer. */
29
+ export interface FooterHint {
30
+ /** Key(s) to display — rendered as text inside `<kbd>` or as an icon. */
31
+ keys: string;
32
+ /** Human-readable label for the hint (e.g., "Navigate", "Select"). */
33
+ label: string;
34
+ }
21
35
  export interface CommandPaletteProps extends React.ComponentPropsWithoutRef<'div'> {
22
36
  groups?: CommandGroup[];
23
37
  placeholder?: string;
24
38
  onSearch?: (query: string) => void;
25
39
  emptyMessage?: string;
40
+ /** Full custom empty state ReactNode — overrides `emptyMessage` when provided. */
41
+ emptyState?: React.ReactNode;
42
+ /** Controlled open state. */
43
+ open?: boolean;
44
+ /** Default open state for uncontrolled usage. */
45
+ defaultOpen?: boolean;
46
+ /** Called when the open state changes. */
47
+ onOpenChange?: (open: boolean) => void;
48
+ /** Keybinding(s) to toggle the palette. Pass `false` to disable.
49
+ * String format: modifier+key, e.g., 'mod+k', 'ctrl+shift+p'.
50
+ * 'mod' maps to Meta on macOS, Ctrl otherwise. */
51
+ keybinding?: string | string[] | false;
52
+ /** Max height of the results container. CSS value. Default '320px'. */
53
+ maxHeight?: string | number;
54
+ /** Custom footer keyboard hints. Pass `false` to hide the footer entirely. */
55
+ footerHints?: FooterHint[] | false;
26
56
  }
27
57
  declare const CommandPalette: React.ForwardRefExoticComponent<CommandPaletteProps & React.RefAttributes<HTMLDivElement>>;
28
58
  export { CommandPalette };
@@ -1 +1 @@
1
- {"version":3,"file":"command-palette.d.ts","sourceRoot":"","sources":["../../src/composed/command-palette.tsx"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAmB9B,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,IAAI,CAAA;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,WAAW,EAAE,CAAA;CACrB;AAED,MAAM,WAAW,mBAAoB,SAAQ,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC;IAChF,MAAM,CAAC,EAAE,YAAY,EAAE,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAMD,QAAA,MAAM,cAAc,4FAqVnB,CAAA;AAID,OAAO,EAAE,cAAc,EAAE,CAAA"}
1
+ {"version":3,"file":"command-palette.d.ts","sourceRoot":"","sources":["../../src/composed/command-palette.tsx"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAoB9B,M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,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,KAAK,CAAA;IAEtC,uEAAuE;IACvE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAE3B,8EAA8E;IAC9E,WAAW,CAAC,EAAE,UAAU,EAAE,GAAG,KAAK,CAAA;CACnC;AAyED,QAAA,MAAM,cAAc,4FAmanB,CAAA;AAID,OAAO,EAAE,cAAc,EAAE,CAAA"}
@@ -1,104 +1,154 @@
1
1
  "use client";
2
- import { jsx as t, jsxs as r } from "react/jsx-runtime";
2
+ import { jsx as t, jsxs as i } from "react/jsx-runtime";
3
3
  import * as n from "react";
4
- import { Dialog as S, DialogPortal as $, DialogOverlay as K, DialogContentRaw as q, DialogTitle as z, DialogDescription as O } from "../ui/dialog.js";
5
- import { IconSearch as Q, IconCornerDownLeft as C, IconArrowUp as U, IconArrowDown as V } from "@tabler/icons-react";
6
- import { cn as p } from "../ui/lib/utils.js";
7
- import { springs as D, tweens as b } from "../ui/lib/motion.js";
8
- import { VisuallyHidden as F } from "../ui/visually-hidden.js";
9
- import { m as c, A as G } from "../_chunks/framer.js";
10
- const H = n.forwardRef(
4
+ import { Dialog as ne, DialogPortal as oe, DialogOverlay as ie, DialogContentRaw as de, DialogTitle as le, DialogDescription as ce } from "../ui/dialog.js";
5
+ import { IconSearch as fe, IconCornerDownLeft as B, IconArrowUp as ue, IconArrowDown as me } from "@tabler/icons-react";
6
+ import { cn as I } from "../ui/lib/utils.js";
7
+ import { springs as Q, tweens as T } from "../ui/lib/motion.js";
8
+ import { VisuallyHidden as pe } from "../ui/visually-hidden.js";
9
+ import { u as be } from "../_chunks/motion-provider.js";
10
+ import { m as h, A as xe } from "../_chunks/framer.js";
11
+ function U() {
12
+ var o;
13
+ if (typeof navigator > "u") return !1;
14
+ const a = ((o = navigator.userAgentData) == null ? void 0 : o.platform) ?? navigator.userAgent;
15
+ return /mac|iphone|ipad|ipod/i.test(a);
16
+ }
17
+ function ge(a) {
18
+ return a.filterValue ? a.filterValue : typeof a.label == "string" ? a.label : "";
19
+ }
20
+ function he(a) {
21
+ return typeof a.description == "string" ? a.description : "";
22
+ }
23
+ function ye(a, o) {
24
+ const y = o.toLowerCase().split("+"), w = y[y.length - 1], f = new Set(y.slice(0, -1)), A = U(), v = f.has("mod"), N = f.has("ctrl") || !A && v, d = f.has("meta") || A && v, l = f.has("shift"), b = f.has("alt");
25
+ return N && !a.ctrlKey || d && !a.metaKey || l && !a.shiftKey || b && !a.altKey || !N && !d && a.ctrlKey || !d && !N && a.metaKey || !l && a.shiftKey || !b && a.altKey ? !1 : a.key.toLowerCase() === w;
26
+ }
27
+ function we(a) {
28
+ return a.includes("+") ? a.split("+").map((o) => o.trim()).filter(Boolean) : a.split(/\s+/).filter(Boolean);
29
+ }
30
+ function ve(a) {
31
+ return a ? "⌘" : "Ctrl";
32
+ }
33
+ const Ne = n.forwardRef(
11
34
  function({
12
- groups: h = [],
13
- placeholder: I = "Search or jump to...",
14
- onSearch: g,
15
- emptyMessage: j = "No results found.",
16
- className: A,
17
- ...E
18
- }, M) {
19
- const [y, l] = n.useState(!1), [x, N] = n.useState(""), [d, f] = n.useState(0), v = n.useRef(null), k = n.useRef(null), w = n.useId(), _ = `command-palette-listbox-${w}`, i = n.useMemo(() => {
20
- if (!x.trim()) return h;
21
- const e = x.toLowerCase();
22
- return h.map((s) => ({
35
+ groups: o = [],
36
+ placeholder: y = "Search or jump to...",
37
+ onSearch: w,
38
+ emptyMessage: f = "No results found.",
39
+ emptyState: A,
40
+ open: v,
41
+ defaultOpen: N,
42
+ onOpenChange: d,
43
+ keybinding: l = "mod+k",
44
+ maxHeight: b = "320px",
45
+ footerHints: E,
46
+ className: G,
47
+ ...H
48
+ }, J) {
49
+ const j = v !== void 0, [W, X] = n.useState(N ?? !1), k = j ? v : W, $ = n.useRef(k);
50
+ $.current = k;
51
+ const u = n.useCallback(
52
+ (e) => {
53
+ const s = typeof e == "function" ? e($.current) : e;
54
+ j || X(s), d == null || d(s);
55
+ },
56
+ [j, d]
57
+ ), [_, V] = n.useState(""), [x, C] = n.useState(0), F = n.useRef(null), P = n.useRef(null), L = n.useId(), q = `command-palette-listbox-${L}`, { reducedMotion: m } = be(), K = { duration: 0 }, Y = n.useMemo(() => U(), []), g = n.useMemo(() => {
58
+ if (!_.trim()) return o;
59
+ const e = _.toLowerCase();
60
+ return o.map((s) => ({
23
61
  ...s,
24
62
  items: s.items.filter(
25
- (a) => {
26
- var o;
27
- return a.label.toLowerCase().includes(e) || ((o = a.description) == null ? void 0 : o.toLowerCase().includes(e));
28
- }
63
+ (r) => ge(r).toLowerCase().includes(e) || he(r).toLowerCase().includes(e)
29
64
  )
30
65
  })).filter((s) => s.items.length > 0);
31
- }, [h, x]), m = n.useMemo(
32
- () => i.flatMap((e) => e.items),
33
- [i]
66
+ }, [o, _]), D = n.useMemo(
67
+ () => g.flatMap((e) => e.items),
68
+ [g]
34
69
  );
35
70
  n.useEffect(() => {
36
- function e(s) {
37
- (s.metaKey || s.ctrlKey) && s.key === "k" && (s.preventDefault(), l((a) => !a));
71
+ if (l === !1) return;
72
+ const e = Array.isArray(l) ? l : [l];
73
+ function s(r) {
74
+ for (const c of e)
75
+ if (ye(r, c)) {
76
+ r.preventDefault(), u((p) => !p);
77
+ return;
78
+ }
38
79
  }
39
- return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
40
- }, []), n.useEffect(() => {
41
- y && (N(""), f(0), requestAnimationFrame(() => {
80
+ return document.addEventListener("keydown", s), () => document.removeEventListener("keydown", s);
81
+ }, [l, u]), n.useEffect(() => {
82
+ k && (V(""), C(0), requestAnimationFrame(() => {
42
83
  var e;
43
- (e = v.current) == null || e.focus();
84
+ (e = F.current) == null || e.focus();
44
85
  }));
45
- }, [y]);
46
- const R = (e) => {
86
+ }, [k]);
87
+ const Z = (e) => {
47
88
  switch (e.key) {
48
89
  case "ArrowDown": {
49
- e.preventDefault(), f(
50
- (s) => s < m.length - 1 ? s + 1 : 0
90
+ e.preventDefault(), C(
91
+ (s) => s < D.length - 1 ? s + 1 : 0
51
92
  );
52
93
  break;
53
94
  }
54
95
  case "ArrowUp": {
55
- e.preventDefault(), f(
56
- (s) => s > 0 ? s - 1 : m.length - 1
96
+ e.preventDefault(), C(
97
+ (s) => s > 0 ? s - 1 : D.length - 1
57
98
  );
58
99
  break;
59
100
  }
60
101
  case "Enter": {
61
102
  e.preventDefault();
62
- const s = m[d];
63
- s && (s.onSelect(), l(!1));
103
+ const s = D[x];
104
+ s && (s.onSelect(), u(!1));
64
105
  break;
65
106
  }
66
107
  case "Escape": {
67
- e.preventDefault(), l(!1);
108
+ e.preventDefault(), u(!1);
68
109
  break;
69
110
  }
70
111
  }
71
112
  };
72
113
  n.useEffect(() => {
73
114
  var s;
74
- const e = (s = k.current) == null ? void 0 : s.querySelector(
75
- `[data-command-index="${d}"]`
115
+ const e = (s = P.current) == null ? void 0 : s.querySelector(
116
+ `[data-command-index="${x}"]`
76
117
  );
77
118
  e == null || e.scrollIntoView({ block: "nearest" });
78
- }, [d]);
79
- const L = (e) => {
80
- N(e), f(0), g == null || g(e);
81
- }, P = n.useMemo(() => {
119
+ }, [x]);
120
+ const O = (e) => {
121
+ V(e), C(0), w == null || w(e);
122
+ }, ee = n.useMemo(() => {
82
123
  const e = /* @__PURE__ */ new Map();
83
124
  let s = 0;
84
- for (const a of i)
85
- for (const o of a.items)
86
- e.set(o.id, s++);
125
+ for (const r of g)
126
+ for (const c of r.items)
127
+ e.set(c.id, s++);
87
128
  return e;
88
- }, [i]);
89
- return /* @__PURE__ */ t(S, { open: y, onOpenChange: l, children: /* @__PURE__ */ r($, { children: [
129
+ }, [g]), te = m ? K : Q.snappy, R = m ? K : T.fade, M = m ? { opacity: 1, scale: 1, y: 0 } : void 0, se = typeof b == "number" ? `${b}px` : b, z = E === !1 ? !1 : E ?? [
130
+ { keys: "↑↓", label: "Navigate" },
131
+ { keys: "↵", label: "Select" },
132
+ { keys: "Esc", label: "Close" }
133
+ ], ae = n.useCallback(
134
+ (e) => {
135
+ u(e);
136
+ },
137
+ [u]
138
+ );
139
+ return /* @__PURE__ */ t(ne, { open: k, onOpenChange: ae, children: /* @__PURE__ */ i(oe, { children: [
90
140
  /* @__PURE__ */ t(
91
- K,
141
+ ie,
92
142
  {
93
143
  className: "fixed inset-0 z-overlay bg-overlay data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"
94
144
  }
95
145
  ),
96
- /* @__PURE__ */ r(
97
- q,
146
+ /* @__PURE__ */ i(
147
+ de,
98
148
  {
99
- ref: M,
100
- ...E,
101
- className: p(
149
+ ref: J,
150
+ ...H,
151
+ className: I(
102
152
  "fixed left-1/2 top-[20%] z-modal w-full max-w-[560px] -translate-x-1/2",
103
153
  "overflow-hidden rounded-ds-xl border border-surface-border-strong bg-surface-overlay shadow-overlay",
104
154
  "duration-moderate-02 data-[state=open]:animate-in data-[state=closed]:animate-out",
@@ -106,24 +156,24 @@ const H = n.forwardRef(
106
156
  "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
107
157
  "data-[state=closed]:slide-out-to-left-1/2 data-[state=open]:slide-in-from-left-1/2",
108
158
  "data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2",
109
- A
159
+ G
110
160
  ),
111
- onKeyDown: R,
161
+ onKeyDown: Z,
112
162
  children: [
113
- /* @__PURE__ */ r(F, { children: [
114
- /* @__PURE__ */ t(z, { children: "Command Palette" }),
115
- /* @__PURE__ */ t(O, { children: "Search or jump to pages, projects, tasks, and actions" })
163
+ /* @__PURE__ */ i(pe, { children: [
164
+ /* @__PURE__ */ t(le, { children: "Command Palette" }),
165
+ /* @__PURE__ */ t(ce, { children: "Search or jump to pages, projects, tasks, and actions" })
116
166
  ] }),
117
- /* @__PURE__ */ r("div", { className: "flex items-center gap-ds-04 border-b border-surface-border-strong px-ds-05 py-ds-04", children: [
167
+ /* @__PURE__ */ i("div", { className: "flex items-center gap-ds-04 border-b border-surface-border-strong px-ds-05 py-ds-04", children: [
118
168
  /* @__PURE__ */ t(
119
- c.span,
169
+ h.span,
120
170
  {
121
- initial: { opacity: 0, scale: 0.96 },
171
+ initial: M ?? { opacity: 0, scale: 0.96 },
122
172
  animate: { opacity: 1, scale: 1 },
123
- transition: D.snappy,
173
+ transition: te,
124
174
  className: "inline-flex shrink-0",
125
175
  children: /* @__PURE__ */ t(
126
- Q,
176
+ fe,
127
177
  {
128
178
  className: "h-ico-sm w-ico-sm text-surface-fg-subtle",
129
179
  stroke: 1.5
@@ -134,16 +184,16 @@ const H = n.forwardRef(
134
184
  /* @__PURE__ */ t(
135
185
  "input",
136
186
  {
137
- ref: v,
138
- value: x,
139
- onChange: (e) => L(e.target.value),
140
- placeholder: I,
187
+ ref: F,
188
+ value: _,
189
+ onChange: (e) => O(e.target.value),
190
+ placeholder: y,
141
191
  role: "combobox",
142
192
  "aria-expanded": !0,
143
- "aria-controls": _,
144
- "aria-activedescendant": m[d] ? `command-item-${w}-${m[d].id}` : void 0,
193
+ "aria-controls": q,
194
+ "aria-activedescendant": D[x] ? `command-item-${L}-${D[x].id}` : void 0,
145
195
  "aria-autocomplete": "list",
146
- className: p(
196
+ className: I(
147
197
  "flex-1 bg-transparent text-ds-base text-surface-fg outline-none",
148
198
  "placeholder:text-surface-fg-subtle"
149
199
  ),
@@ -154,85 +204,93 @@ const H = n.forwardRef(
154
204
  ),
155
205
  /* @__PURE__ */ t("kbd", { className: "hidden shrink-0 select-none rounded-ds-md border border-surface-border-strong bg-surface-raised px-ds-02b py-ds-01 text-ds-sm font-medium text-surface-fg-subtle shadow-[inset_0_-1px_0_rgba(0,0,0,0.1)] sm:inline-flex", children: "Esc" })
156
206
  ] }),
157
- /* @__PURE__ */ r(
207
+ /* @__PURE__ */ i(
158
208
  "div",
159
209
  {
160
- ref: k,
161
- id: _,
210
+ ref: P,
211
+ id: q,
162
212
  role: "listbox",
163
213
  "aria-label": "Command results",
164
- className: "max-h-[320px] overflow-y-auto px-ds-03 py-ds-03",
214
+ className: "overflow-y-auto px-ds-03 py-ds-03",
215
+ style: { maxHeight: se },
165
216
  children: [
166
- i.length === 0 && /* @__PURE__ */ t(
167
- c.div,
217
+ g.length === 0 && /* @__PURE__ */ t(
218
+ h.div,
168
219
  {
169
- initial: { opacity: 0 },
220
+ initial: M ?? { opacity: 0 },
170
221
  animate: { opacity: 1 },
171
- transition: b.fade,
222
+ transition: R,
172
223
  className: "flex items-center justify-center py-ds-07",
173
- children: /* @__PURE__ */ t("p", { className: "text-ds-md text-surface-fg-subtle", children: j })
224
+ children: A ?? /* @__PURE__ */ t("p", { className: "text-ds-md text-surface-fg-subtle", children: f })
174
225
  }
175
226
  ),
176
- i.map((e, s) => /* @__PURE__ */ r(
177
- c.div,
227
+ g.map((e, s) => /* @__PURE__ */ i(
228
+ h.div,
178
229
  {
179
- initial: { opacity: 0 },
230
+ initial: M ?? { opacity: 0 },
180
231
  animate: { opacity: 1 },
181
- transition: { ...b.fade, delay: s * 0.06 },
232
+ transition: m ? K : { ...T.fade, delay: s * 0.06 },
182
233
  className: "mb-ds-02",
183
234
  children: [
184
235
  /* @__PURE__ */ t("div", { className: "px-ds-03 pb-ds-02 pt-ds-03", children: /* @__PURE__ */ t("span", { className: "text-ds-xs font-semibold uppercase tracking-wider text-surface-fg-subtle", children: e.label }) }),
185
- e.items.map((a) => {
186
- const o = P.get(a.id) ?? 0, u = o === d;
187
- return /* @__PURE__ */ r(
188
- c.button,
236
+ e.items.map((r) => {
237
+ const c = ee.get(r.id) ?? 0, p = c === x;
238
+ return /* @__PURE__ */ i(
239
+ h.button,
189
240
  {
190
- id: `command-item-${w}-${a.id}`,
241
+ id: `command-item-${L}-${r.id}`,
191
242
  type: "button",
192
243
  role: "option",
193
- "aria-selected": u,
194
- "data-command-index": o,
195
- initial: { opacity: 0, y: 4 },
244
+ "aria-selected": p,
245
+ "data-command-index": c,
246
+ initial: M ?? { opacity: 0, y: 4 },
196
247
  animate: { opacity: 1, y: 0 },
197
- transition: { ...D.snappy, delay: o * 0.03 },
248
+ transition: m ? K : { ...Q.snappy, delay: c * 0.03 },
198
249
  onClick: () => {
199
- a.onSelect(), l(!1);
250
+ r.onSelect(), u(!1);
200
251
  },
201
- onMouseEnter: () => f(o),
202
- className: p(
252
+ onMouseEnter: () => C(c),
253
+ className: I(
203
254
  "flex w-full items-center gap-ds-04 rounded-ds-lg px-ds-03 py-ds-03 text-left transition-[color,background-color] duration-fast-02 ease-productive-standard",
204
- u ? "bg-surface-raised-hover text-surface-fg" : "text-surface-fg-muted hover:bg-surface-raised"
255
+ p ? "bg-surface-raised-hover text-surface-fg" : "text-surface-fg-muted hover:bg-surface-raised"
205
256
  ),
206
257
  children: [
207
- a.icon && /* @__PURE__ */ t(
258
+ r.icon && /* @__PURE__ */ t(
208
259
  "span",
209
260
  {
210
- className: p(
261
+ className: I(
211
262
  "[&>svg]:h-ico-sm [&>svg]:w-ico-sm shrink-0 transition-colors duration-fast-02 ease-productive-standard",
212
- u ? "text-accent-11" : "text-surface-fg-subtle"
263
+ p ? "text-accent-11" : "text-surface-fg-subtle"
213
264
  ),
214
265
  "aria-hidden": "true",
215
- children: a.icon
266
+ children: r.icon
216
267
  }
217
268
  ),
218
- /* @__PURE__ */ r("div", { className: "flex flex-1 flex-col", children: [
219
- /* @__PURE__ */ t("span", { className: "text-ds-md", children: a.label }),
220
- a.description && /* @__PURE__ */ t("span", { className: "text-ds-sm text-surface-fg-subtle", children: a.description })
269
+ /* @__PURE__ */ i("div", { className: "flex flex-1 flex-col", children: [
270
+ /* @__PURE__ */ t("span", { className: "text-ds-md", children: r.renderLabel ? r.renderLabel(_) : r.label }),
271
+ r.description && /* @__PURE__ */ t("span", { className: "text-ds-sm text-surface-fg-subtle", children: r.description })
221
272
  ] }),
222
- a.shortcut && /* @__PURE__ */ t("kbd", { className: p(
223
- "shrink-0 rounded border border-surface-border-strong px-ds-02b py-ds-01 text-ds-xs font-medium shadow-[inset_0_-1px_0_rgba(0,0,0,0.1)] transition-colors duration-fast-02 ease-productive-standard",
224
- u ? "bg-accent-2 text-accent-11 border-accent-6" : "bg-surface-raised text-surface-fg-subtle"
225
- ), children: a.shortcut }),
226
- /* @__PURE__ */ t(G, { children: u && /* @__PURE__ */ t(
227
- c.span,
273
+ r.shortcut && /* @__PURE__ */ t("span", { className: "flex shrink-0 items-center gap-ds-01", children: we(r.shortcut).map((S, re) => /* @__PURE__ */ t(
274
+ "kbd",
228
275
  {
229
- initial: { opacity: 0 },
276
+ className: I(
277
+ "inline-flex min-w-[20px] items-center justify-center rounded border px-ds-02b py-ds-01 text-ds-xs font-medium shadow-[inset_0_-1px_0_rgba(0,0,0,0.1)] transition-colors duration-fast-02 ease-productive-standard",
278
+ p ? "bg-accent-2 text-accent-11 border-accent-6" : "bg-surface-raised text-surface-fg-subtle border-surface-border-strong"
279
+ ),
280
+ children: S === "Ctrl" || S === "ctrl" ? ve(Y) : S
281
+ },
282
+ re
283
+ )) }),
284
+ /* @__PURE__ */ t(xe, { children: p && /* @__PURE__ */ t(
285
+ h.span,
286
+ {
287
+ initial: m ? void 0 : { opacity: 0 },
230
288
  animate: { opacity: 1 },
231
- exit: { opacity: 0 },
232
- transition: b.fade,
289
+ exit: m ? void 0 : { opacity: 0 },
290
+ transition: R,
233
291
  className: "inline-flex shrink-0",
234
292
  children: /* @__PURE__ */ t(
235
- C,
293
+ B,
236
294
  {
237
295
  className: "h-ico-sm w-ico-sm text-surface-fg-subtle",
238
296
  stroke: 1.5
@@ -242,7 +300,7 @@ const H = n.forwardRef(
242
300
  ) })
243
301
  ]
244
302
  },
245
- a.id
303
+ r.id
246
304
  );
247
305
  })
248
306
  ]
@@ -252,30 +310,20 @@ const H = n.forwardRef(
252
310
  ]
253
311
  }
254
312
  ),
255
- /* @__PURE__ */ r(
256
- c.div,
313
+ z !== !1 && /* @__PURE__ */ t(
314
+ h.div,
257
315
  {
258
- initial: { opacity: 0 },
316
+ initial: M ?? { opacity: 0 },
259
317
  animate: { opacity: 1 },
260
- transition: b.fade,
318
+ transition: R,
261
319
  className: "flex items-center gap-ds-05 border-t border-surface-border-strong px-ds-05 py-ds-03",
262
- children: [
263
- /* @__PURE__ */ r("div", { className: "flex items-center gap-ds-02b", children: [
264
- /* @__PURE__ */ r("div", { className: "flex items-center gap-ds-01", children: [
265
- /* @__PURE__ */ t("kbd", { className: "inline-flex h-ico-md w-ico-md items-center justify-center rounded border border-surface-border-strong bg-surface-raised shadow-[inset_0_-1px_0_rgba(0,0,0,0.1)]", children: /* @__PURE__ */ t(U, { className: "h-ds-03 w-ds-03 text-surface-fg-subtle", stroke: 2 }) }),
266
- /* @__PURE__ */ t("kbd", { className: "inline-flex h-ico-md w-ico-md items-center justify-center rounded border border-surface-border-strong bg-surface-raised shadow-[inset_0_-1px_0_rgba(0,0,0,0.1)]", children: /* @__PURE__ */ t(V, { className: "h-ds-03 w-ds-03 text-surface-fg-subtle", stroke: 2 }) })
267
- ] }),
268
- /* @__PURE__ */ t("span", { className: "text-ds-xs text-surface-fg-subtle", children: "Navigate" })
269
- ] }),
270
- /* @__PURE__ */ r("div", { className: "flex items-center gap-ds-02b", children: [
271
- /* @__PURE__ */ t("kbd", { className: "inline-flex h-[20px] items-center justify-center rounded-ds-md border border-surface-border-strong bg-surface-raised px-ds-02b shadow-[inset_0_-1px_0_rgba(0,0,0,0.1)]", children: /* @__PURE__ */ t(C, { className: "h-ds-03 w-ds-03 text-surface-fg-subtle", stroke: 2 }) }),
272
- /* @__PURE__ */ t("span", { className: "text-ds-xs text-surface-fg-subtle", children: "Select" })
273
- ] }),
274
- /* @__PURE__ */ r("div", { className: "flex items-center gap-ds-02b", children: [
275
- /* @__PURE__ */ t("kbd", { className: "inline-flex h-[20px] items-center justify-center rounded-ds-md border border-surface-border-strong bg-surface-raised px-ds-02b text-ds-xs font-medium text-surface-fg-subtle shadow-[inset_0_-1px_0_rgba(0,0,0,0.1)]", children: "Esc" }),
276
- /* @__PURE__ */ t("span", { className: "text-ds-xs text-surface-fg-subtle", children: "Close" })
277
- ] })
278
- ]
320
+ children: z.map((e, s) => /* @__PURE__ */ i("div", { className: "flex items-center gap-ds-02b", children: [
321
+ e.keys === "↑↓" ? /* @__PURE__ */ i("div", { className: "flex items-center gap-ds-01", children: [
322
+ /* @__PURE__ */ t("kbd", { className: "inline-flex h-ico-md w-ico-md items-center justify-center rounded border border-surface-border-strong bg-surface-raised shadow-[inset_0_-1px_0_rgba(0,0,0,0.1)]", children: /* @__PURE__ */ t(ue, { className: "h-ds-03 w-ds-03 text-surface-fg-subtle", stroke: 2 }) }),
323
+ /* @__PURE__ */ t("kbd", { className: "inline-flex h-ico-md w-ico-md items-center justify-center rounded border border-surface-border-strong bg-surface-raised shadow-[inset_0_-1px_0_rgba(0,0,0,0.1)]", children: /* @__PURE__ */ t(me, { className: "h-ds-03 w-ds-03 text-surface-fg-subtle", stroke: 2 }) })
324
+ ] }) : e.keys === "↵" ? /* @__PURE__ */ t("kbd", { className: "inline-flex h-[20px] items-center justify-center rounded-ds-md border border-surface-border-strong bg-surface-raised px-ds-02b shadow-[inset_0_-1px_0_rgba(0,0,0,0.1)]", children: /* @__PURE__ */ t(B, { className: "h-ds-03 w-ds-03 text-surface-fg-subtle", stroke: 2 }) }) : /* @__PURE__ */ t("kbd", { className: "inline-flex h-[20px] items-center justify-center rounded-ds-md border border-surface-border-strong bg-surface-raised px-ds-02b text-ds-xs font-medium text-surface-fg-subtle shadow-[inset_0_-1px_0_rgba(0,0,0,0.1)]", children: e.keys }),
325
+ /* @__PURE__ */ t("span", { className: "text-ds-xs text-surface-fg-subtle", children: e.label })
326
+ ] }, s))
279
327
  }
280
328
  )
281
329
  ]
@@ -284,7 +332,7 @@ const H = n.forwardRef(
284
332
  ] }) });
285
333
  }
286
334
  );
287
- H.displayName = "CommandPalette";
335
+ Ne.displayName = "CommandPalette";
288
336
  export {
289
- H as CommandPalette
337
+ Ne as CommandPalette
290
338
  };
@@ -37,7 +37,7 @@ export type { ErrorDisplayProps } from './error-boundary';
37
37
  export { GlobalLoading } from './global-loading';
38
38
  export type { GlobalLoadingProps } from './global-loading';
39
39
  export { CommandPalette } from './command-palette';
40
- export type { CommandPaletteProps, CommandGroup, CommandItem } from './command-palette';
40
+ export type { CommandPaletteProps, CommandGroup, CommandItem, FooterHint } from './command-palette';
41
41
  export { MemberPicker } from './member-picker';
42
42
  export type { MemberPickerProps, MemberPickerMember } from './member-picker';
43
43
  export { SimpleTooltip } from './simple-tooltip';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/composed/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,YAAY,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAEhE,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACjE,YAAY,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAEtD,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACjE,YAAY,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAEtD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAEpD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,YAAY,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAElE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,YAAY,EAAE,sBAAsB,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAE5E,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnE,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAE/F,OAAO,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AAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAEvE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAE1D,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAChE,YAAY,EAAE,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAEnF,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA"}
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { CommandGroup } from '../composed/command-palette';
2
+ import { CommandGroup, CommandPaletteProps, FooterHint } from '../composed/command-palette';
3
3
  /**
4
4
  * AppCommandPalette -- Application-level command palette wrapper.
5
5
  *
@@ -7,8 +7,6 @@ import { CommandGroup } from '../composed/command-palette';
7
7
  * info instead of reading from Zustand stores or Remix hooks.
8
8
  *
9
9
  * Depends on the CommandPalette shared component being available.
10
- * If you haven't created `src/shared/command-palette.tsx`, this
11
- * component re-exports a minimal inline implementation.
12
10
  */
13
11
  import * as React from 'react';
14
12
  export interface SearchResult {
@@ -18,6 +16,17 @@ export interface SearchResult {
18
16
  entityType: string;
19
17
  projectId?: string | null;
20
18
  metadata?: Record<string, unknown>;
19
+ /** Custom icon for this result. Overrides the default entity-type icon. */
20
+ icon?: React.ReactNode;
21
+ /** Relevance score for sorting (higher = more relevant). */
22
+ rank?: number;
23
+ /** Keyboard shortcut hint to display on this result. */
24
+ shortcut?: string;
25
+ }
26
+ /** A group of search results with a label. */
27
+ export interface SearchResultGroup {
28
+ label: string;
29
+ results: SearchResult[];
21
30
  }
22
31
  export interface AppCommandPaletteUser {
23
32
  name: string;
@@ -34,12 +43,34 @@ export interface AppCommandPaletteProps extends Omit<React.ComponentPropsWithRef
34
43
  onNavigate?: (path: string) => void;
35
44
  /** Called when the search input changes (for server-side search) */
36
45
  onSearch?: (query: string) => void;
37
- /** IconSearch results from external search provider */
46
+ /** Flat search results (displayed in a single "Search Results" group).
47
+ * For grouped results, use `searchResultGroups` instead. */
38
48
  searchResults?: SearchResult[];
49
+ /** Grouped search results — displayed as multiple labeled sections.
50
+ * Takes precedence over `searchResults` when provided. */
51
+ searchResultGroups?: SearchResultGroup[];
39
52
  /** Whether a search is currently in progress */
40
53
  isSearching?: boolean;
41
- /** Called when the user selects a search result */
54
+ /** Called when the user selects a search result. When provided, the component
55
+ * does NOT perform internal navigation — the consumer owns routing entirely. */
42
56
  onSearchResultSelect?: (result: SearchResult) => void;
57
+ /** Custom label for the search results group. Overrides "Search Results" / "Searching...".
58
+ * Can be a string or a function receiving the result count. */
59
+ searchResultsLabel?: string | ((count: number) => string);
60
+ /** Controlled open state. */
61
+ open?: boolean;
62
+ /** Default open state. */
63
+ defaultOpen?: boolean;
64
+ /** Called when the open state changes. */
65
+ onOpenChange?: (open: boolean) => void;
66
+ /** Keybinding(s) to toggle. Pass `false` to disable. Default: 'mod+k'. */
67
+ keybinding?: CommandPaletteProps['keybinding'];
68
+ /** Max height of results. Default '320px'. */
69
+ maxHeight?: CommandPaletteProps['maxHeight'];
70
+ /** Custom empty state. */
71
+ emptyState?: React.ReactNode;
72
+ /** Custom footer hints. Pass `false` to hide. */
73
+ footerHints?: FooterHint[] | false;
43
74
  }
44
75
  declare const AppCommandPalette: React.ForwardRefExoticComponent<Omit<AppCommandPaletteProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
45
76
  export { AppCommandPalette };
@@ -1 +1 @@
1
- {"version":3,"file":"app-command-palette.d.ts","sourceRoot":"","sources":["../../src/shell/app-command-palette.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAsB9B,OAAO,EAAkB,KAAK,YAAY,EAAoB,MAAM,6BAA6B,CAAA;AAQjG,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAA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AgD;IAChD,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;qFACiF;IACjF,oBAAoB,CAAC,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAA;IACrD;oEACgE;IAChE,kBAAkB,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC,CAAA;IAEzD,6BAA6B;IAC7B,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,0BAA0B;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,0CAA0C;IAC1C,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACtC,0EAA0E;IAC1E,UAAU,CAAC,EAAE,mBAAmB,CAAC,YAAY,CAAC,CAAA;IAC9C,8CAA8C;IAC9C,SAAS,CAAC,EAAE,mBAAmB,CAAC,WAAW,CAAC,CAAA;IAC5C,0BAA0B;IAC1B,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC5B,iDAAiD;IACjD,WAAW,CAAC,EAAE,UAAU,EAAE,GAAG,KAAK,CAAA;CACnC;AA+KD,QAAA,MAAM,iBAAiB,4GAuJtB,CAAA;AAID,OAAO,EAAE,iBAAiB,EAAE,CAAA"}
@@ -1,220 +1,241 @@
1
1
  "use client";
2
- import { jsx as a } from "react/jsx-runtime";
3
- import * as w from "react";
4
- import { useCallback as g, useMemo as r } from "react";
5
- import { IconFileText as D, IconLayoutDashboard as N, IconCalendarCheck as A, IconUmbrella as C, IconLayoutKanban as E, IconListCheck as h, IconBook as O, IconAdjustmentsHorizontal as U, IconUserCircle as B, IconShieldCheck as K, IconClipboardList as G, IconUserPlus as R, IconSettings as V, IconPackage as v, IconLink as x, IconVideo as J, IconMessage as Y, IconUsers as _ } from "@tabler/icons-react";
6
- import { CommandPalette as z } from "../composed/command-palette.js";
7
- import { cn as F } from "../ui/lib/utils.js";
8
- import { useCommandRegistry as H } from "./command-registry.js";
9
- const q = {
10
- TASK: /* @__PURE__ */ a(h, {}),
11
- PROJECT: /* @__PURE__ */ a(E, {}),
12
- USER: /* @__PURE__ */ a(_, {}),
13
- COMMENT: /* @__PURE__ */ a(Y, {}),
14
- MEETING: /* @__PURE__ */ a(J, {}),
15
- LINK: /* @__PURE__ */ a(x, {}),
16
- DELIVERABLE: /* @__PURE__ */ a(v, {})
2
+ import { jsx as n } from "react/jsx-runtime";
3
+ import * as _ from "react";
4
+ import { useCallback as g, useMemo as b } from "react";
5
+ import { IconLayoutDashboard as z, IconCalendarCheck as P, IconUmbrella as M, IconLayoutKanban as $, IconListCheck as w, IconBook as G, IconAdjustmentsHorizontal as H, IconUserCircle as q, IconShieldCheck as Q, IconClipboardList as W, IconUserPlus as X, IconSettings as Z, IconFileText as R, IconPackage as ee, IconLink as ne, IconVideo as te, IconMessage as oe, IconUsers as ae } from "@tabler/icons-react";
6
+ import { CommandPalette as ie } from "../composed/command-palette.js";
7
+ import { cn as ce } from "../ui/lib/utils.js";
8
+ import { useCommandRegistry as de } from "./command-registry.js";
9
+ const le = {
10
+ TASK: /* @__PURE__ */ n(w, {}),
11
+ PROJECT: /* @__PURE__ */ n($, {}),
12
+ USER: /* @__PURE__ */ n(ae, {}),
13
+ COMMENT: /* @__PURE__ */ n(oe, {}),
14
+ MEETING: /* @__PURE__ */ n(te, {}),
15
+ LINK: /* @__PURE__ */ n(ne, {}),
16
+ DELIVERABLE: /* @__PURE__ */ n(ee, {})
17
17
  };
18
- function Q(o) {
18
+ function se(e) {
19
19
  return [
20
20
  {
21
21
  id: "nav-dashboard",
22
22
  label: "Dashboard",
23
- icon: /* @__PURE__ */ a(N, {}),
24
- onSelect: () => o("/")
23
+ icon: /* @__PURE__ */ n(z, {}),
24
+ onSelect: () => e("/")
25
25
  },
26
26
  {
27
27
  id: "nav-attendance",
28
28
  label: "Attendance",
29
- icon: /* @__PURE__ */ a(A, {}),
30
- onSelect: () => o("/attendance")
29
+ icon: /* @__PURE__ */ n(P, {}),
30
+ onSelect: () => e("/attendance")
31
31
  },
32
32
  {
33
33
  id: "nav-breaks",
34
34
  label: "Breaks",
35
- icon: /* @__PURE__ */ a(C, {}),
36
- onSelect: () => o("/breaks")
35
+ icon: /* @__PURE__ */ n(M, {}),
36
+ onSelect: () => e("/breaks")
37
37
  },
38
38
  {
39
39
  id: "nav-projects",
40
40
  label: "Projects",
41
- icon: /* @__PURE__ */ a(E, {}),
42
- onSelect: () => o("/projects")
41
+ icon: /* @__PURE__ */ n($, {}),
42
+ onSelect: () => e("/projects")
43
43
  },
44
44
  {
45
45
  id: "nav-my-tasks",
46
46
  label: "My Tasks",
47
- icon: /* @__PURE__ */ a(h, {}),
48
- onSelect: () => o("/my-tasks")
47
+ icon: /* @__PURE__ */ n(w, {}),
48
+ onSelect: () => e("/my-tasks")
49
49
  },
50
50
  {
51
51
  id: "nav-devsabha",
52
52
  label: "Devsabha",
53
- icon: /* @__PURE__ */ a(O, {}),
54
- onSelect: () => o("/devsabha")
53
+ icon: /* @__PURE__ */ n(G, {}),
54
+ onSelect: () => e("/devsabha")
55
55
  },
56
56
  {
57
57
  id: "nav-adjustments",
58
58
  label: "Adjustments",
59
- icon: /* @__PURE__ */ a(U, {}),
60
- onSelect: () => o("/adjustments")
59
+ icon: /* @__PURE__ */ n(H, {}),
60
+ onSelect: () => e("/adjustments")
61
61
  },
62
62
  {
63
63
  id: "nav-profile",
64
64
  label: "Profile",
65
- icon: /* @__PURE__ */ a(B, {}),
66
- onSelect: () => o("/profile")
65
+ icon: /* @__PURE__ */ n(q, {}),
66
+ onSelect: () => e("/profile")
67
67
  }
68
68
  ];
69
69
  }
70
- function W(o) {
70
+ function re(e) {
71
71
  return [
72
72
  {
73
73
  id: "nav-admin-dashboard",
74
74
  label: "Admin Dashboard",
75
- icon: /* @__PURE__ */ a(K, {}),
76
- onSelect: () => o("/admin")
75
+ icon: /* @__PURE__ */ n(Q, {}),
76
+ onSelect: () => e("/admin")
77
77
  },
78
78
  {
79
79
  id: "nav-admin-breaks",
80
80
  label: "Manage Breaks",
81
- icon: /* @__PURE__ */ a(C, {}),
82
- onSelect: () => o("/admin/breaks")
81
+ icon: /* @__PURE__ */ n(M, {}),
82
+ onSelect: () => e("/admin/breaks")
83
83
  },
84
84
  {
85
85
  id: "nav-admin-attendance",
86
86
  label: "Manage Attendance",
87
- icon: /* @__PURE__ */ a(A, {}),
88
- onSelect: () => o("/admin/attendance")
87
+ icon: /* @__PURE__ */ n(P, {}),
88
+ onSelect: () => e("/admin/attendance")
89
89
  },
90
90
  {
91
91
  id: "nav-admin-lokwasi",
92
92
  label: "Lokwasi",
93
- icon: /* @__PURE__ */ a(G, {}),
94
- onSelect: () => o("/admin/lokwasi")
93
+ icon: /* @__PURE__ */ n(W, {}),
94
+ onSelect: () => e("/admin/lokwasi")
95
95
  },
96
96
  {
97
97
  id: "nav-admin-onboarding",
98
98
  label: "Onboarding",
99
- icon: /* @__PURE__ */ a(R, {}),
100
- onSelect: () => o("/admin/onboarding")
99
+ icon: /* @__PURE__ */ n(X, {}),
100
+ onSelect: () => e("/admin/onboarding")
101
101
  },
102
102
  {
103
103
  id: "nav-admin-config",
104
104
  label: "System Config",
105
- icon: /* @__PURE__ */ a(V, {}),
106
- onSelect: () => o("/admin/system-config")
105
+ icon: /* @__PURE__ */ n(Z, {}),
106
+ onSelect: () => e("/admin/system-config")
107
107
  }
108
108
  ];
109
109
  }
110
- const X = w.forwardRef(
110
+ function me(e) {
111
+ var o;
112
+ switch (e.entityType) {
113
+ case "TASK":
114
+ return e.projectId ? `/projects/${e.projectId}?taskId=${e.id}` : "/";
115
+ case "PROJECT":
116
+ return `/projects/${e.id}`;
117
+ case "USER":
118
+ return "/teammates";
119
+ case "COMMENT":
120
+ return e.projectId && ((o = e.metadata) != null && o.taskId) ? `/projects/${e.projectId}?taskId=${e.metadata.taskId}` : "/";
121
+ case "MEETING":
122
+ return e.projectId ? `/projects/${e.projectId}?tab=meetings` : "/";
123
+ case "LINK":
124
+ return e.projectId ? `/projects/${e.projectId}?tab=karyakram` : "/";
125
+ case "DELIVERABLE":
126
+ return e.projectId ? `/projects/${e.projectId}?tab=deliverables` : "/";
127
+ default:
128
+ return "/";
129
+ }
130
+ }
131
+ function h(e, o, I) {
132
+ return {
133
+ id: `search-${e.entityType}-${e.id}`,
134
+ label: e.title,
135
+ filterValue: e.title,
136
+ description: e.snippet,
137
+ icon: e.icon ?? le[e.entityType] ?? /* @__PURE__ */ n(R, {}),
138
+ shortcut: e.shortcut,
139
+ onSelect: () => {
140
+ o ? o(e) : I(me(e));
141
+ }
142
+ };
143
+ }
144
+ const pe = _.forwardRef(
111
145
  function({
112
- user: c,
113
- isAdmin: T,
114
- extraGroups: I = [],
115
- onNavigate: s,
116
- onSearch: l,
117
- searchResults: b = [],
118
- isSearching: k = !1,
119
- onSearchResultSelect: m,
120
- className: S,
121
- ...P
122
- }, L) {
123
- const f = T ?? ((c == null ? void 0 : c.role) === "Admin" || (c == null ? void 0 : c.role) === "SuperAdmin"), d = H(), t = g(
124
- (e) => {
125
- s == null || s(e);
146
+ user: o,
147
+ isAdmin: I,
148
+ extraGroups: j = [],
149
+ onNavigate: r,
150
+ onSearch: m,
151
+ searchResults: d = [],
152
+ searchResultGroups: p,
153
+ isSearching: y = !1,
154
+ onSearchResultSelect: k,
155
+ searchResultsLabel: l,
156
+ open: D,
157
+ defaultOpen: L,
158
+ onOpenChange: N,
159
+ keybinding: O,
160
+ maxHeight: U,
161
+ emptyState: B,
162
+ footerHints: K,
163
+ className: V,
164
+ ...v
165
+ }, x) {
166
+ const C = I ?? ((o == null ? void 0 : o.role) === "Admin" || (o == null ? void 0 : o.role) === "SuperAdmin"), c = de(), i = g(
167
+ (t) => {
168
+ r == null || r(t);
126
169
  },
127
- [s]
128
- ), j = r(
170
+ [r]
171
+ ), S = b(
129
172
  () => ({
130
173
  label: "Pages",
131
- items: d ? d.pages.map((e) => ({
132
- id: e.id,
133
- label: e.label,
134
- icon: e.icon,
135
- keywords: e.keywords,
136
- onSelect: () => t(e.path)
137
- })) : Q(t)
174
+ items: c ? c.pages.map((t) => ({
175
+ id: t.id,
176
+ label: t.label,
177
+ icon: t.icon,
178
+ keywords: t.keywords,
179
+ onSelect: () => i(t.path)
180
+ })) : se(i)
138
181
  }),
139
- [t, d]
140
- ), y = r(
182
+ [i, c]
183
+ ), A = b(
141
184
  () => ({
142
185
  label: "Admin",
143
- items: d ? d.adminPages.map((e) => ({
144
- id: e.id,
145
- label: e.label,
146
- icon: e.icon,
147
- keywords: e.keywords,
148
- onSelect: () => t(e.path)
149
- })) : W(t)
186
+ items: c ? c.adminPages.map((t) => ({
187
+ id: t.id,
188
+ label: t.label,
189
+ icon: t.icon,
190
+ keywords: t.keywords,
191
+ onSelect: () => i(t.path)
192
+ })) : re(i)
150
193
  }),
151
- [t, d]
152
- ), p = r(() => {
153
- if (b.length === 0) return null;
154
- const e = b.map((n) => {
155
- var u;
156
- let i = "/";
157
- switch (n.entityType) {
158
- case "TASK":
159
- i = n.projectId ? `/projects/${n.projectId}?taskId=${n.id}` : "/";
160
- break;
161
- case "PROJECT":
162
- i = `/projects/${n.id}`;
163
- break;
164
- case "USER":
165
- i = "/teammates";
166
- break;
167
- case "COMMENT":
168
- i = n.projectId && ((u = n.metadata) != null && u.taskId) ? `/projects/${n.projectId}?taskId=${n.metadata.taskId}` : "/";
169
- break;
170
- case "MEETING":
171
- i = n.projectId ? `/projects/${n.projectId}?tab=meetings` : "/";
172
- break;
173
- case "LINK":
174
- i = n.projectId ? `/projects/${n.projectId}?tab=karyakram` : "/";
175
- break;
176
- case "DELIVERABLE":
177
- i = n.projectId ? `/projects/${n.projectId}?tab=deliverables` : "/";
178
- break;
179
- }
180
- return {
181
- id: `search-${n.entityType}-${n.id}`,
182
- label: n.title,
183
- description: n.snippet,
184
- icon: q[n.entityType] ?? /* @__PURE__ */ a(D, {}),
185
- onSelect: () => {
186
- m == null || m(n), t(i);
187
- }
188
- };
189
- });
190
- return {
191
- label: k ? "Searching..." : "Search Results",
192
- items: e
193
- };
194
- }, [b, k, t, m]), M = r(() => {
195
- const e = [];
196
- return p && e.push(p), e.push(j), f && e.push(y), e.push(...I), e;
197
- }, [p, j, f, y, I]), $ = g(
198
- (e) => {
199
- l == null || l(e);
194
+ [i, c]
195
+ ), E = b(() => {
196
+ if (p && p.length > 0)
197
+ return p.map((a) => {
198
+ const u = a.results.some((s) => s.rank != null) ? [...a.results].sort((s, Y) => (Y.rank ?? 0) - (s.rank ?? 0)) : a.results;
199
+ return {
200
+ label: a.label,
201
+ items: u.map((s) => h(s, k, i))
202
+ };
203
+ });
204
+ if (d.length === 0) return [];
205
+ const T = (d.some((a) => a.rank != null) ? [...d].sort((a, u) => (u.rank ?? 0) - (a.rank ?? 0)) : d).map((a) => h(a, k, i));
206
+ let f;
207
+ return l ? f = typeof l == "function" ? l(T.length) : l : f = y ? "Searching..." : "Search Results", [{ label: f, items: T }];
208
+ }, [d, p, y, i, k, l]), F = b(() => {
209
+ const t = [];
210
+ return t.push(...E), t.push(S), C && t.push(A), t.push(...j), t;
211
+ }, [E, S, C, A, j]), J = g(
212
+ (t) => {
213
+ m == null || m(t);
200
214
  },
201
- [l]
215
+ [m]
202
216
  );
203
- return /* @__PURE__ */ a(
204
- z,
217
+ return /* @__PURE__ */ n(
218
+ ie,
205
219
  {
206
- ref: L,
207
- groups: M,
220
+ ref: x,
221
+ groups: F,
208
222
  placeholder: "Search or jump to...",
209
- onSearch: $,
223
+ onSearch: J,
210
224
  emptyMessage: "No results found. Try a different search term.",
211
- className: F(S),
212
- ...P
225
+ open: D,
226
+ defaultOpen: L,
227
+ onOpenChange: N,
228
+ keybinding: O,
229
+ maxHeight: U,
230
+ emptyState: B,
231
+ footerHints: K,
232
+ className: ce(V),
233
+ ...v
213
234
  }
214
235
  );
215
236
  }
216
237
  );
217
- X.displayName = "AppCommandPalette";
238
+ pe.displayName = "AppCommandPalette";
218
239
  export {
219
- X as AppCommandPalette
240
+ pe as AppCommandPalette
220
241
  };
@@ -15,6 +15,6 @@ export { TopBar, type TopBarUser, type UserMenuItem, type TopBarProps, } from '.
15
15
  export { BottomNavbar, type BottomNavItem, type BottomNavbarUser, type BottomNavbarProps, } from './bottom-navbar';
16
16
  export { NotificationCenter, type Notification, type NotificationCenterProps, } from './notification-center';
17
17
  export { NotificationPreferences, type NotificationPreference, type NotificationProject, type NotificationPreferencesProps, } from './notification-preferences';
18
- export { AppCommandPalette, type SearchResult, type AppCommandPaletteUser, type AppCommandPaletteProps, } from './app-command-palette';
18
+ export { AppCommandPalette, type SearchResult, type SearchResultGroup, type AppCommandPaletteUser, type AppCommandPaletteProps, } from './app-command-palette';
19
19
  export { CommandRegistryProvider, useCommandRegistry, type CommandRegistry, type CommandPageItem, type CommandRegistryProviderProps, } from './command-registry';
20
20
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shell/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAE9E,OAAO,EACL,UAAU,EACV,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,eAAe,GACrB,MAAM,WAAW,CAAA;AAElB,OAAO,EACL,MAAM,EACN,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,WAAW,GACjB,MAAM,WAAW,CAAA;AAElB,OAAO,EACL,YAAY,EACZ,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,GACvB,MAAM,iBAAiB,CAAA;AAExB,OAAO,EACL,kBAAkB,EAClB,KAAK,YAAY,EACjB,KAAK,uBAAuB,GAC7B,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EACL,uBAAuB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,4BAA4B,GAClC,MAAM,4BAA4B,CAAA;AAEnC,OAAO,EACL,iBAAiB,EACjB,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,GAC5B,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,4BAA4B,GAClC,MAAM,oBAAoB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shell/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAE9E,OAAO,EACL,UAAU,EACV,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,eAAe,GACrB,MAAM,WAAW,CAAA;AAElB,OAAO,EACL,MAAM,EACN,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,WAAW,GACjB,MAAM,WAAW,CAAA;AAElB,OAAO,EACL,YAAY,EACZ,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,GACvB,MAAM,iBAAiB,CAAA;AAExB,OAAO,EACL,kBAAkB,EAClB,KAAK,YAAY,EACjB,KAAK,uBAAuB,GAC7B,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EACL,uBAAuB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,4BAA4B,GAClC,MAAM,4BAA4B,CAAA;AAEnC,OAAO,EACL,iBAAiB,EACjB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,GAC5B,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,4BAA4B,GAClC,MAAM,oBAAoB,CAAA"}
package/llms-full.txt CHANGED
@@ -5,7 +5,7 @@
5
5
  > All variant values and props verified from source CVA definitions.
6
6
  >
7
7
  > Package: @devalok/shilp-sutra
8
- > Version: 0.23.3
8
+ > Version: 0.24.0
9
9
 
10
10
  ---
11
11
 
package/llms.txt CHANGED
@@ -320,7 +320,8 @@ NOTIFICATION SELECTION GUIDE:
320
320
  - RichTextEditor: Tiptap editor — bold/italic/underline/strike/highlight, headings, blockquote, lists (bullet/ordered/task), code, links, images (paste/drop/upload), file attachments, @mentions, emoji picker + :shortcode:, text alignment, HR. Props: onImageUpload?, onFileUpload?, mentions?, onMentionSearch?, onMentionSelect?(item: MentionItem)
321
321
  - RichTextViewer: read-only renderer for RichTextEditor HTML content (renders all above content types)
322
322
  - ActivityFeed: items(ActivityItem[]), onLoadMore, loading, hasMore, emptyState, compact, maxInitialItems, groupBy?('time'|'none'), groupLabels?({ today, yesterday, thisWeek, older }). Type: ActivityItem = { id, actor?, action, timestamp, icon?, color?, detail? }. Utility: groupItemsByTime(items, labels) exported.
323
- - CommandPalette, MemberPicker
323
+ - CommandPalette: open, defaultOpen, onOpenChange (controlled/uncontrolled), keybinding(string|string[]|false), maxHeight, emptyState(ReactNode), footerHints(FooterHint[]|false). CommandItem: label(string|ReactNode), description(string|ReactNode), renderLabel(query=>ReactNode), filterValue(string), shortcut(rendered as keycap badges). Keyboard shortcuts rendered per-key with platform-aware Cmd/Ctrl. Reduced-motion support via MotionProvider.
324
+ - MemberPicker
324
325
  - ErrorDisplay, GlobalLoading
325
326
  - Loading skeletons: CardSkeleton, TableSkeleton, BoardSkeleton, ListSkeleton
326
327
  - Page skeletons: DashboardSkeleton, ProjectListSkeleton, TaskDetailSkeleton (no props, server-safe)
@@ -342,7 +343,7 @@ NOTIFICATION SELECTION GUIDE:
342
343
  - BottomNavbar: mobile navigation, user is optional. Types: BottomNavItem = { title, href, icon, exact?, badge? }, BottomNavbarUser = { name, role? }
343
344
  - NotificationCenter: notifications[], onMarkRead, onMarkAllRead, onNavigate, getNotificationRoute?, footerSlot?, emptyState?, headerActions?, popoverClassName?, onDismiss?(id). Types: Notification = { id, title, body?, tier, isRead, createdAt, entityType?, entityId?, projectId?, project?, actions? }, NotificationAction = { label, variant?, onClick }
344
345
  - NotificationPreferences: preferences[], projects[], onSave, onToggleMute, onUpdateTier, onDelete. Types: NotificationPreference = { id, userId?, projectId, channel, minTier, muted }, NotificationProject = { id, title }
345
- - AppCommandPalette: user, isAdmin, onNavigate, onSearch, searchResults, isSearching, onSearchResultSelect. Types: SearchResult = { id, title, snippet?, entityType, projectId?, metadata? }, AppCommandPaletteUser = { name, role? }
346
+ - AppCommandPalette: user, isAdmin, onNavigate, onSearch, searchResults, searchResultGroups(SearchResultGroup[]), isSearching, onSearchResultSelect (when provided, consumer owns routing — no internal URL computation), searchResultsLabel(string|((count)=>string)), open, defaultOpen, onOpenChange, keybinding, maxHeight, emptyState, footerHints. Types: SearchResult = { id, title, snippet?, entityType, projectId?, metadata?, icon?(ReactNode), rank?(number), shortcut?(string) }, SearchResultGroup = { label, results: SearchResult[] }, AppCommandPaletteUser = { name, role? }
346
347
  - LinkProvider: wraps app with router-agnostic Link component — component(ForwardRefComponent), children. useLink() hook returns the Link component.
347
348
 
348
349
  ### Motion System (Framer Motion)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devalok/shilp-sutra",
3
- "version": "0.23.3",
3
+ "version": "0.24.0",
4
4
  "description": "Devalok Design System — tokens, components, and patterns for Next.js",
5
5
  "license": "MIT",
6
6
  "type": "module",