@orianatech/pire 0.12.0 → 0.15.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 (46) hide show
  1. package/dist/components/core/Icon.d.ts.map +1 -1
  2. package/dist/components/core/Kbd.d.cts +17 -0
  3. package/dist/components/core/Kbd.d.ts +18 -0
  4. package/dist/components/core/Kbd.d.ts.map +1 -0
  5. package/dist/components/core/icon-data.generated.d.ts.map +1 -1
  6. package/dist/components/core/icon-map.d.cts +9 -0
  7. package/dist/components/core/icon-map.d.ts +9 -0
  8. package/dist/components/core/icon-map.d.ts.map +1 -1
  9. package/dist/components/data/LinkList.d.cts +10 -1
  10. package/dist/components/data/LinkList.d.ts +10 -1
  11. package/dist/components/data/LinkList.d.ts.map +1 -1
  12. package/dist/components/feedback/Dialog.d.ts.map +1 -1
  13. package/dist/components/forms/ComboBox.d.cts +10 -1
  14. package/dist/components/forms/ComboBox.d.ts +10 -1
  15. package/dist/components/forms/ComboBox.d.ts.map +1 -1
  16. package/dist/components/forms/Select.d.cts +7 -1
  17. package/dist/components/forms/Select.d.ts +7 -1
  18. package/dist/components/forms/Select.d.ts.map +1 -1
  19. package/dist/components/forms/ValueHelpField.d.cts +12 -1
  20. package/dist/components/forms/ValueHelpField.d.ts +12 -1
  21. package/dist/components/forms/ValueHelpField.d.ts.map +1 -1
  22. package/dist/components/navigation/Menu.d.cts +7 -2
  23. package/dist/components/navigation/Menu.d.ts +7 -2
  24. package/dist/components/navigation/Menu.d.ts.map +1 -1
  25. package/dist/components/navigation/ShellBar.d.cts +13 -1
  26. package/dist/components/navigation/ShellBar.d.ts +13 -1
  27. package/dist/components/navigation/ShellBar.d.ts.map +1 -1
  28. package/dist/components/patterns/CommandPalette.d.cts +97 -0
  29. package/dist/components/patterns/CommandPalette.d.ts +98 -0
  30. package/dist/components/patterns/CommandPalette.d.ts.map +1 -0
  31. package/dist/components/patterns/ValueHelpDialog.d.cts +22 -1
  32. package/dist/components/patterns/ValueHelpDialog.d.ts +22 -1
  33. package/dist/components/patterns/ValueHelpDialog.d.ts.map +1 -1
  34. package/dist/components.css +96 -2
  35. package/dist/i18n/messages.d.cts +29 -0
  36. package/dist/i18n/messages.d.ts +29 -0
  37. package/dist/i18n/messages.d.ts.map +1 -1
  38. package/dist/index.cjs +1001 -593
  39. package/dist/index.cjs.map +1 -1
  40. package/dist/index.d.cts +3 -0
  41. package/dist/index.d.ts +3 -0
  42. package/dist/index.d.ts.map +1 -1
  43. package/dist/index.js +920 -505
  44. package/dist/index.js.map +1 -1
  45. package/dist/tokens/base.css +10 -8
  46. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../src/components/core/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AA2BpC;6FAC6F;AAC7F,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE3C,MAAM,WAAW,UAAU;IACzB;wEACoE;IACpE,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB;;yEAEqE;IACrE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;qFAEiF;IACjF,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;CAChD;AAID;2CAC2C;AAC3C,wBAAgB,cAAc,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,CAerD;AAED,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,UAAU,CAAC;IACxF,kGAAkG;IAClG,IAAI,EAAE,MAAM,CAAC;IACb,6DAA6D;IAC7D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wFAAwF;IACxF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wDAAwD;IACxD,IAAI,CAAC,EAAE,QAAQ,CAAC;CACjB;AAED;;;;;4EAK4E;AAC5E,wBAAgB,IAAI,CAAC,EAAE,IAAI,EAAE,IAAS,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE,SAAS,qBAqC/E"}
1
+ {"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../src/components/core/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AA2BpC;6FAC6F;AAC7F,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE3C,MAAM,WAAW,UAAU;IACzB;wEACoE;IACpE,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB;;yEAEqE;IACrE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;qFAEiF;IACjF,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;CAChD;AAID;2CAC2C;AAC3C,wBAAgB,cAAc,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,CAerD;AAED,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,UAAU,CAAC;IACxF,kGAAkG;IAClG,IAAI,EAAE,MAAM,CAAC;IACb,6DAA6D;IAC7D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wFAAwF;IACxF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wDAAwD;IACxD,IAAI,CAAC,EAAE,QAAQ,CAAC;CACjB;AAED;;;;;4EAK4E;AAC5E,wBAAgB,IAAI,CAAC,EAAE,IAAI,EAAE,IAAS,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE,SAAS,qBA4C/E"}
@@ -0,0 +1,17 @@
1
+ import type * as React from 'react';
2
+ export interface KbdProps extends React.HTMLAttributes<HTMLElement> {
3
+ /** One key per element — compose several for a chord: `<Kbd>⌘</Kbd><Kbd>K</Kbd>`. */
4
+ children: React.ReactNode;
5
+ /** `sm` for inline use inside running text, where a full-size cap sits taller than the line. */
6
+ size?: 'sm' | 'md';
7
+ }
8
+ /**
9
+ * A single key, drawn as a key cap.
10
+ *
11
+ * Renders a real `<kbd>`, so assistive tech announces it as keyboard input rather than as loose
12
+ * text. It is painted only — nothing here binds a shortcut; that stays with the app.
13
+ *
14
+ * One key per element. A chord is several of these side by side, which keeps each cap the size of
15
+ * its own glyph instead of stretching one cap across "Ctrl+Shift+K".
16
+ */
17
+ export declare function Kbd({ children, size, className, ...rest }: KbdProps): React.JSX.Element;
@@ -0,0 +1,18 @@
1
+ import type * as React from 'react';
2
+ export interface KbdProps extends React.HTMLAttributes<HTMLElement> {
3
+ /** One key per element — compose several for a chord: `<Kbd>⌘</Kbd><Kbd>K</Kbd>`. */
4
+ children: React.ReactNode;
5
+ /** `sm` for inline use inside running text, where a full-size cap sits taller than the line. */
6
+ size?: 'sm' | 'md';
7
+ }
8
+ /**
9
+ * A single key, drawn as a key cap.
10
+ *
11
+ * Renders a real `<kbd>`, so assistive tech announces it as keyboard input rather than as loose
12
+ * text. It is painted only — nothing here binds a shortcut; that stays with the app.
13
+ *
14
+ * One key per element. A chord is several of these side by side, which keeps each cap the size of
15
+ * its own glyph instead of stretching one cap across "Ctrl+Shift+K".
16
+ */
17
+ export declare function Kbd({ children, size, className, ...rest }: KbdProps): React.JSX.Element;
18
+ //# sourceMappingURL=Kbd.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Kbd.d.ts","sourceRoot":"","sources":["../../../src/components/core/Kbd.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAGpC,MAAM,WAAW,QAAS,SAAQ,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC;IACjE,qFAAqF;IACrF,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,gGAAgG;IAChG,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,wBAAgB,GAAG,CAAC,EAAE,QAAQ,EAAE,IAAW,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,QAAQ,qBAI1E"}
@@ -1 +1 @@
1
- {"version":3,"file":"icon-data.generated.d.ts","sourceRoot":"","sources":["../../../src/components/core/icon-data.generated.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAgE9C,CAAC"}
1
+ {"version":3,"file":"icon-data.generated.d.ts","sourceRoot":"","sources":["../../../src/components/core/icon-data.generated.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA2I9C,CAAC"}
@@ -11,3 +11,12 @@
11
11
  * point at one slug (`boxes` and `package` both mean `box`); the generator de-duplicates.
12
12
  */
13
13
  export declare const CARBON_MAP: Record<string, string>;
14
+ /**
15
+ * Every name `Icon` can render, frozen and sorted.
16
+ *
17
+ * Exported because an unknown slug fails quietly — an empty box and one dev-only console warning,
18
+ * which is easy to lose in a busy log. A consumer that generates icon names from data can assert
19
+ * against this list at build time instead of discovering the gap in production, which is how
20
+ * `credit-card` shipped as a blank square.
21
+ */
22
+ export declare const ICON_NAMES: readonly string[];
@@ -11,4 +11,13 @@
11
11
  * point at one slug (`boxes` and `package` both mean `box`); the generator de-duplicates.
12
12
  */
13
13
  export declare const CARBON_MAP: Record<string, string>;
14
+ /**
15
+ * Every name `Icon` can render, frozen and sorted.
16
+ *
17
+ * Exported because an unknown slug fails quietly — an empty box and one dev-only console warning,
18
+ * which is easy to lose in a busy log. A consumer that generates icon names from data can assert
19
+ * against this list at build time instead of discovering the gap in production, which is how
20
+ * `credit-card` shipped as a blank square.
21
+ */
22
+ export declare const ICON_NAMES: readonly string[];
14
23
  //# sourceMappingURL=icon-map.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"icon-map.d.ts","sourceRoot":"","sources":["../../../src/components/core/icon-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAiB7C,CAAC"}
1
+ {"version":3,"file":"icon-map.d.ts","sourceRoot":"","sources":["../../../src/components/core/icon-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAuD7C,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,EAAE,SAAS,MAAM,EAAkD,CAAC"}
@@ -11,8 +11,17 @@ export interface LinkListItem {
11
11
  export interface LinkListProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'> {
12
12
  items: LinkListItem[];
13
13
  onSelect?: (id: string) => void;
14
+ /**
15
+ * Which slot gets the primary treatment. `'key'` (the default) sets `key` in mono and `text`
16
+ * in secondary — right for "OC-2026-000004 · Alfa S.A.", where the code is what you scan.
17
+ *
18
+ * Use `'text'` when the name is what you scan and the code is the qualifier — a supplier or
19
+ * customer list. It swaps the two treatments only; the slots keep their meanings, so `key`
20
+ * stays the technical key and sorting or copying it still works.
21
+ */
22
+ emphasis?: 'key' | 'text';
14
23
  /** Names the list for assistive tech, e.g. "Recently viewed orders". */
15
24
  'aria-label': string;
16
25
  }
17
26
  /** Compact list of records that navigate somewhere: recently viewed, related documents, shortcuts. */
18
- export declare function LinkList({ items, onSelect, className, ...rest }: LinkListProps): React.JSX.Element;
27
+ export declare function LinkList({ items, onSelect, emphasis, className, ...rest }: LinkListProps): React.JSX.Element;
@@ -11,9 +11,18 @@ export interface LinkListItem {
11
11
  export interface LinkListProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'> {
12
12
  items: LinkListItem[];
13
13
  onSelect?: (id: string) => void;
14
+ /**
15
+ * Which slot gets the primary treatment. `'key'` (the default) sets `key` in mono and `text`
16
+ * in secondary — right for "OC-2026-000004 · Alfa S.A.", where the code is what you scan.
17
+ *
18
+ * Use `'text'` when the name is what you scan and the code is the qualifier — a supplier or
19
+ * customer list. It swaps the two treatments only; the slots keep their meanings, so `key`
20
+ * stays the technical key and sorting or copying it still works.
21
+ */
22
+ emphasis?: 'key' | 'text';
14
23
  /** Names the list for assistive tech, e.g. "Recently viewed orders". */
15
24
  'aria-label': string;
16
25
  }
17
26
  /** Compact list of records that navigate somewhere: recently viewed, related documents, shortcuts. */
18
- export declare function LinkList({ items, onSelect, className, ...rest }: LinkListProps): React.JSX.Element;
27
+ export declare function LinkList({ items, onSelect, emphasis, className, ...rest }: LinkListProps): React.JSX.Element;
19
28
  //# sourceMappingURL=LinkList.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"LinkList.d.ts","sourceRoot":"","sources":["../../../src/components/data/LinkList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAKpC,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,mEAAmE;IACnE,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,wCAAwC;IACxC,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IAC3F,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,wEAAwE;IACxE,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,sGAAsG;AACtG,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,aAAa,qBAmB9E"}
1
+ {"version":3,"file":"LinkList.d.ts","sourceRoot":"","sources":["../../../src/components/data/LinkList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAKpC,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,mEAAmE;IACnE,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,wCAAwC;IACxC,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IAC3F,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IAC1B,wEAAwE;IACxE,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,sGAAsG;AACtG,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAgB,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,aAAa,qBA4BhG"}
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../src/components/feedback/Dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAMpC,MAAM,WAAW,WAAW;IAC1B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,QA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AAa,CAAC,EAAE,OAAO,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED;0DAC0D;AAC1D,wBAAgB,MAAM,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EACvF,IAAW,EAAE,aAAoB,EAAE,SAAgB,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,WAAW,qBA2BrF"}
@@ -17,6 +17,15 @@ export interface ComboBoxProps {
17
17
  * so a result whose label does not literally contain the typed text is hidden client-side.
18
18
  */
19
19
  onInputChange?: (text: string) => void;
20
+ /**
21
+ * The text in the input, controlled. Pair it with `onInputChange` or typing stops working.
22
+ *
23
+ * Needed whenever the parent has to *impose* the text rather than read it: clearing the field
24
+ * on a form reset or a context switch, and rehydrating an edited line whose key is known but
25
+ * whose label is not in `options` until the search comes back. Remounting via `key` also
26
+ * clears the field, but it drops focus.
27
+ */
28
+ inputValue?: string;
20
29
  options?: Array<string | ComboBoxOption>;
21
30
  /**
22
31
  * `options` is the final list and React Aria filters nothing locally. Required for server
@@ -61,4 +70,4 @@ export interface ComboBoxProps {
61
70
  }
62
71
  /** Type-ahead picker for lists too long to scroll — material, cost centre, G/L account.
63
72
  * Below ~10 fixed options use Select; for master-data search with several columns use ValueHelpField. */
64
- export declare function ComboBox({ label, value, defaultValue, onChange, onInputChange, options, description, errorMessage, size, fullWidth, isFilteredExternally, isLoading, loadingLabel, emptyLabel, onLoadMore, className, style, ...rest }: ComboBoxProps): React.JSX.Element;
73
+ export declare function ComboBox({ label, value, defaultValue, onChange, onInputChange, inputValue, options, description, errorMessage, size, fullWidth, isFilteredExternally, isLoading, loadingLabel, emptyLabel, onLoadMore, className, style, ...rest }: ComboBoxProps): React.JSX.Element;
@@ -17,6 +17,15 @@ export interface ComboBoxProps {
17
17
  * so a result whose label does not literally contain the typed text is hidden client-side.
18
18
  */
19
19
  onInputChange?: (text: string) => void;
20
+ /**
21
+ * The text in the input, controlled. Pair it with `onInputChange` or typing stops working.
22
+ *
23
+ * Needed whenever the parent has to *impose* the text rather than read it: clearing the field
24
+ * on a form reset or a context switch, and rehydrating an edited line whose key is known but
25
+ * whose label is not in `options` until the search comes back. Remounting via `key` also
26
+ * clears the field, but it drops focus.
27
+ */
28
+ inputValue?: string;
20
29
  options?: Array<string | ComboBoxOption>;
21
30
  /**
22
31
  * `options` is the final list and React Aria filters nothing locally. Required for server
@@ -61,5 +70,5 @@ export interface ComboBoxProps {
61
70
  }
62
71
  /** Type-ahead picker for lists too long to scroll — material, cost centre, G/L account.
63
72
  * Below ~10 fixed options use Select; for master-data search with several columns use ValueHelpField. */
64
- export declare function ComboBox({ label, value, defaultValue, onChange, onInputChange, options, description, errorMessage, size, fullWidth, isFilteredExternally, isLoading, loadingLabel, emptyLabel, onLoadMore, className, style, ...rest }: ComboBoxProps): React.JSX.Element;
73
+ export declare function ComboBox({ label, value, defaultValue, onChange, onInputChange, inputValue, options, description, errorMessage, size, fullWidth, isFilteredExternally, isLoading, loadingLabel, emptyLabel, onLoadMore, className, style, ...rest }: ComboBoxProps): React.JSX.Element;
65
74
  //# sourceMappingURL=ComboBox.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ComboBox.d.ts","sourceRoot":"","sources":["../../../src/components/forms/ComboBox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAOpC,MAAM,WAAW,cAAc;IAAG,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE;AAE1G,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,KAAK,CAAC,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AW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,4GAA4G;IAC5G,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAKD;0GAC0G;AAC1G,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,UAAU,EAAE,OAAY,EACtG,WAAW,EAAE,YAAY,EAAE,IAAW,EAAE,SAAgB,EAAE,oBAAoB,EAAE,SAAS,EACzF,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE,aAAa,qBAmEjF"}
@@ -12,6 +12,12 @@ export interface SelectProps {
12
12
  options?: SelectOption[];
13
13
  /** Shown when nothing is selected. */
14
14
  placeholder?: string;
15
+ /**
16
+ * Replaces the dictionary's `selectEmpty` inside the popover when `options` is empty. Worth
17
+ * setting whenever you can say *why* the list is empty — "Pick a company first" beats the
18
+ * generic default, and an empty reference table is the usual cause.
19
+ */
20
+ emptyLabel?: React.ReactNode;
15
21
  description?: React.ReactNode;
16
22
  errorMessage?: React.ReactNode;
17
23
  isInvalid?: boolean;
@@ -25,4 +31,4 @@ export interface SelectProps {
25
31
  }
26
32
  /** Single-choice picker. Uses a listbox popover rather than a native <select> so the option
27
33
  * rows can carry Pire typography and keyboard behaviour is identical across browsers. */
28
- export declare function Select({ label, value, defaultValue, onChange, options, placeholder, description, errorMessage, size, fullWidth, className, style, ...rest }: SelectProps): React.JSX.Element;
34
+ export declare function Select({ label, value, defaultValue, onChange, options, placeholder, description, errorMessage, emptyLabel, size, fullWidth, className, style, ...rest }: SelectProps): React.JSX.Element;
@@ -12,6 +12,12 @@ export interface SelectProps {
12
12
  options?: SelectOption[];
13
13
  /** Shown when nothing is selected. */
14
14
  placeholder?: string;
15
+ /**
16
+ * Replaces the dictionary's `selectEmpty` inside the popover when `options` is empty. Worth
17
+ * setting whenever you can say *why* the list is empty — "Pick a company first" beats the
18
+ * generic default, and an empty reference table is the usual cause.
19
+ */
20
+ emptyLabel?: React.ReactNode;
15
21
  description?: React.ReactNode;
16
22
  errorMessage?: React.ReactNode;
17
23
  isInvalid?: boolean;
@@ -25,5 +31,5 @@ export interface SelectProps {
25
31
  }
26
32
  /** Single-choice picker. Uses a listbox popover rather than a native <select> so the option
27
33
  * rows can carry Pire typography and keyboard behaviour is identical across browsers. */
28
- export declare function Select({ label, value, defaultValue, onChange, options, placeholder, description, errorMessage, size, fullWidth, className, style, ...rest }: SelectProps): React.JSX.Element;
34
+ export declare function Select({ label, value, defaultValue, onChange, options, placeholder, description, errorMessage, emptyLabel, size, fullWidth, className, style, ...rest }: SelectProps): React.JSX.Element;
29
35
  //# sourceMappingURL=Select.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/components/forms/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAMpC,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAE3F,MAAM,WAAW,WA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AE,CAAC;AAE3F,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,sCAAsC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAID;0FAC0F;AAC1F,wBAAgB,MAAM,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAY,EAAE,WAAuB,EAClG,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,IAAW,EAAE,SAAgB,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE,WAAW,qBA2C/G"}
@@ -13,6 +13,17 @@ export interface ValueHelpFieldProps<T extends {
13
13
  rows?: T[];
14
14
  columns?: DataTableColumn<T>[];
15
15
  dialogTitle?: React.ReactNode;
16
+ /**
17
+ * Forwarded to {@link ValueHelpDialog}. Set `isFilteredExternally` and feed `rows` from
18
+ * `onSearch` when the list is too large to sit in the browser — which is the usual case for
19
+ * suppliers, customers and products.
20
+ */
21
+ onSearch?: (query: string) => void;
22
+ isFilteredExternally?: boolean;
23
+ isLoading?: boolean;
24
+ onLoadMore?: () => void;
25
+ /** Shown in the dialog when the search returns nothing. */
26
+ emptyLabel?: string;
16
27
  placeholder?: string;
17
28
  description?: React.ReactNode;
18
29
  errorMessage?: React.ReactNode;
@@ -28,4 +39,4 @@ export interface ValueHelpFieldProps<T extends {
28
39
  * the value-help trigger. Pairs Input with ValueHelpDialog so screens stop rewiring both. */
29
40
  export declare function ValueHelpField<T extends {
30
41
  id: string | number;
31
- }>({ label, value, onChange, format, rows, columns, dialogTitle, placeholder, description, errorMessage, isInvalid, isDisabled, isRequired, allowsClear, className, style }: ValueHelpFieldProps<T>): React.JSX.Element;
42
+ }>({ label, value, onChange, format, rows, columns, dialogTitle, onSearch, isFilteredExternally, isLoading, onLoadMore, emptyLabel, placeholder, description, errorMessage, isInvalid, isDisabled, isRequired, allowsClear, className, style }: ValueHelpFieldProps<T>): React.JSX.Element;
@@ -13,6 +13,17 @@ export interface ValueHelpFieldProps<T extends {
13
13
  rows?: T[];
14
14
  columns?: DataTableColumn<T>[];
15
15
  dialogTitle?: React.ReactNode;
16
+ /**
17
+ * Forwarded to {@link ValueHelpDialog}. Set `isFilteredExternally` and feed `rows` from
18
+ * `onSearch` when the list is too large to sit in the browser — which is the usual case for
19
+ * suppliers, customers and products.
20
+ */
21
+ onSearch?: (query: string) => void;
22
+ isFilteredExternally?: boolean;
23
+ isLoading?: boolean;
24
+ onLoadMore?: () => void;
25
+ /** Shown in the dialog when the search returns nothing. */
26
+ emptyLabel?: string;
16
27
  placeholder?: string;
17
28
  description?: React.ReactNode;
18
29
  errorMessage?: React.ReactNode;
@@ -28,5 +39,5 @@ export interface ValueHelpFieldProps<T extends {
28
39
  * the value-help trigger. Pairs Input with ValueHelpDialog so screens stop rewiring both. */
29
40
  export declare function ValueHelpField<T extends {
30
41
  id: string | number;
31
- }>({ label, value, onChange, format, rows, columns, dialogTitle, placeholder, description, errorMessage, isInvalid, isDisabled, isRequired, allowsClear, className, style }: ValueHelpFieldProps<T>): React.JSX.Element;
42
+ }>({ label, value, onChange, format, rows, columns, dialogTitle, onSearch, isFilteredExternally, isLoading, onLoadMore, emptyLabel, placeholder, description, errorMessage, isInvalid, isDisabled, isRequired, allowsClear, className, style }: ValueHelpFieldProps<T>): React.JSX.Element;
32
43
  //# sourceMappingURL=ValueHelpField.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ValueHelpField.d.ts","sourceRoot":"","sources":["../../../src/components/forms/ValueHelpField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAIzD,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,GAAG,GAAG;IAC1E,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,kCAAkC;IAClC,KAAK,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;IACjB,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,IAAI,KAAK,IAAI,CAAC;IACnC,6EAA6E;IAC7E,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,MAAM,CAAC;IAC5B,yEAAyE;IACzE,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;IACX,OAAO,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/B,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,SAAS,CA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
  /** Second line, for an action whose effect is not obvious from its label. */
18
18
  description?: React.ReactNode;
19
- /** Keyboard shortcut, right-aligned. Painted only — it registers nothing. */
20
- shortcut?: string;
19
+ /**
20
+ * Keyboard shortcut, right-aligned and drawn as key caps. Painted only — it registers nothing.
21
+ *
22
+ * A string is split on `+` and spaces, so `"Ctrl+Shift+P"` renders as three caps. Pass an array
23
+ * when the split cannot be inferred: `['⌘', 'N']`, since `"⌘N"` has no separator to split on.
24
+ */
25
+ shortcut?: string | string[];
21
26
  /** `danger` for a destructive action. Put it last, behind a `MenuSeparator`. */
22
27
  tone?: 'default' | 'danger';
23
28
  className?: string;
@@ -16,8 +16,13 @@ export interface MenuItemProps extends Omit<AriaMenuItemProps, 'className' | 'ch
16
16
  icon?: string;
17
17
  /** Second line, for an action whose effect is not obvious from its label. */
18
18
  description?: React.ReactNode;
19
- /** Keyboard shortcut, right-aligned. Painted only — it registers nothing. */
20
- shortcut?: string;
19
+ /**
20
+ * Keyboard shortcut, right-aligned and drawn as key caps. Painted only — it registers nothing.
21
+ *
22
+ * A string is split on `+` and spaces, so `"Ctrl+Shift+P"` renders as three caps. Pass an array
23
+ * when the split cannot be inferred: `['⌘', 'N']`, since `"⌘N"` has no separator to split on.
24
+ */
25
+ shortcut?: string | string[];
21
26
  /** `danger` for a destructive action. Put it last, behind a `MenuSeparator`. */
22
27
  tone?: 'default' | 'danger';
23
28
  className?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../src/components/navigation/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,EAGL,KAAK,SAAS,IAAI,aAAa,EAAE,KAAK,aAAa,IAAI,iBAAiB,EACzE,MAAM,uBAAuB,CAAC;AAI/B,MAAM,WAAW,SAAS,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CAClD,SAAQ,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE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AE,KAAK,CAAC,SAAS,CAAC;IAC9B;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC7B,gFAAgF;IAChF,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAUD,kFAAkF;AAClF,wBAAgB,QAAQ,CAAC,EACvB,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAgB,EAAE,SAAS,EAAE,GAAG,IAAI,EAC5E,EAAE,aAAa,qBAqBf;AAGD,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IACxF,wEAAwE;IACxE,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,yDAAyD;AACzD,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,gBAAgB,qBAOpF;AAED,MAAM,WAAW,kBAAkB;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,iFAAiF;AACjF,wBAAgB,aAAa,CAAC,EAAE,SAAS,EAAE,EAAE,kBAAkB,qBAE9D"}
@@ -19,6 +19,18 @@ export interface ShellBarProps extends Omit<React.HTMLAttributes<HTMLElement>, '
19
19
  actions?: React.ReactNode;
20
20
  /** Full name — initials render into the avatar. */
21
21
  user?: string;
22
+ /**
23
+ * Turns the avatar into a menu trigger. Pass a `Menu` — the entries are the product's, because
24
+ * they differ per app; only the trigger belongs here.
25
+ *
26
+ * Without it the avatar stays a plain `role="img"`, so nothing that renders a bare `user` today
27
+ * changes. With it the avatar becomes a real `<button>` carrying `aria-haspopup` and
28
+ * `aria-expanded`.
29
+ */
30
+ userMenu?: React.ReactNode;
31
+ /** Accessible name of the avatar button. `{user}` is replaced with the name. Defaults to the
32
+ * dictionary's `shellBarUserMenu`, for the same reason as {@link ShellBarProps.menuLabel}. */
33
+ userMenuLabel?: string;
22
34
  }
23
35
  /** Fixed 48px application chrome. One per page, always the first landmark. */
24
- export declare function ShellBar({ product, monogram, title, onMenu, onSearch, menuLabel, searchLabel, actions, user, className, ...rest }: ShellBarProps): React.JSX.Element;
36
+ export declare function ShellBar({ product, monogram, title, onMenu, onSearch, menuLabel, searchLabel, actions, user, userMenu, userMenuLabel, className, ...rest }: ShellBarProps): React.JSX.Element;
@@ -19,7 +19,19 @@ export interface ShellBarProps extends Omit<React.HTMLAttributes<HTMLElement>, '
19
19
  actions?: React.ReactNode;
20
20
  /** Full name — initials render into the avatar. */
21
21
  user?: string;
22
+ /**
23
+ * Turns the avatar into a menu trigger. Pass a `Menu` — the entries are the product's, because
24
+ * they differ per app; only the trigger belongs here.
25
+ *
26
+ * Without it the avatar stays a plain `role="img"`, so nothing that renders a bare `user` today
27
+ * changes. With it the avatar becomes a real `<button>` carrying `aria-haspopup` and
28
+ * `aria-expanded`.
29
+ */
30
+ userMenu?: React.ReactNode;
31
+ /** Accessible name of the avatar button. `{user}` is replaced with the name. Defaults to the
32
+ * dictionary's `shellBarUserMenu`, for the same reason as {@link ShellBarProps.menuLabel}. */
33
+ userMenuLabel?: string;
22
34
  }
23
35
  /** Fixed 48px application chrome. One per page, always the first landmark. */
24
- export declare function ShellBar({ product, monogram, title, onMenu, onSearch, menuLabel, searchLabel, actions, user, className, ...rest }: ShellBarProps): React.JSX.Element;
36
+ export declare function ShellBar({ product, monogram, title, onMenu, onSearch, menuLabel, searchLabel, actions, user, userMenu, userMenuLabel, className, ...rest }: ShellBarProps): React.JSX.Element;
25
37
  //# sourceMappingURL=ShellBar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ShellBar.d.ts","sourceRoot":"","sources":["../../../src/components/navigation/ShellBar.tsx"],"names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AAS,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB;kGAC8F;IAC9F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;oEAEgE;IAChE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0CAA0C;IAC1C,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,mDAAmD;IACnD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;mGAC+F;IAC/F,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAID,8EAA8E;AAC9E,wBAAgB,QAAQ,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,SAA6B,EAClG,WAAsB,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,aAAa,qBA2BpG"}
@@ -0,0 +1,97 @@
1
+ import * as React from 'react';
2
+ export interface CommandPaletteItem {
3
+ /** Passed back to `onAction`. Must be unique across every group in the palette. */
4
+ id: string;
5
+ label: string;
6
+ /** Second line — what the command does, or what identifies the record. */
7
+ description?: string;
8
+ /** Icon slug, same vocabulary as `Button.icon`. */
9
+ icon?: string;
10
+ /**
11
+ * Painted on the right as key caps. Registers nothing; bind the key yourself.
12
+ *
13
+ * A string is split on `+` and spaces; pass an array when it cannot be — `['⌘', 'N']`.
14
+ */
15
+ shortcut?: string | string[];
16
+ /**
17
+ * Extra terms this item should match on, beyond its label. The place to put synonyms, the
18
+ * English name of a Spanish command, and the abbreviations people actually type — a palette
19
+ * that only matches the visible label makes users guess the wording.
20
+ *
21
+ * Matched against, never announced: the accessible name stays the label alone.
22
+ */
23
+ keywords?: string;
24
+ isDisabled?: boolean;
25
+ }
26
+ export interface CommandPaletteGroup {
27
+ id: string;
28
+ /** Heading above the group. Omit for a single unlabelled list. */
29
+ label?: string;
30
+ items: CommandPaletteItem[];
31
+ }
32
+ export interface CommandPaletteProps {
33
+ isOpen?: boolean;
34
+ onOpenChange?: (isOpen: boolean) => void;
35
+ /**
36
+ * Static groups — navigation targets and actions. Filtered locally as the user types, so these
37
+ * are the whole list, not a page of it.
38
+ */
39
+ groups?: CommandPaletteGroup[];
40
+ /**
41
+ * Server-backed results, appended after the static groups and **never filtered locally**: the
42
+ * server already ranked them, and a local "contains" pass would drop fuzzy and synonym matches.
43
+ * Feed it from `onSearch`.
44
+ */
45
+ resultsGroup?: CommandPaletteGroup;
46
+ /** The chosen item's `id`. The palette does not close itself — decide in the handler. */
47
+ onAction?: (id: string) => void;
48
+ /**
49
+ * The query on every keystroke. **Debounce before calling the server.**
50
+ *
51
+ * Only needed for `resultsGroup`; the static groups filter without it.
52
+ */
53
+ onSearch?: (query: string) => void;
54
+ /** Shows a status row rather than an empty list while a request is in flight. */
55
+ isLoading?: boolean;
56
+ /** Overrides the dictionary's `commandPaletteEmpty`. */
57
+ emptyLabel?: React.ReactNode;
58
+ /** Overrides the dictionary's `commandPaletteLoading`. */
59
+ loadingLabel?: string;
60
+ placeholder?: string;
61
+ /**
62
+ * Replaces the default key hints along the bottom. Use it for a product-specific affordance —
63
+ * a scope switch, a "search everything" toggle.
64
+ */
65
+ footer?: React.ReactNode;
66
+ /** Drops the footer entirely. The hints are worth their space until an app teaches the keys elsewhere. */
67
+ showFooter?: boolean;
68
+ /** Names the dialog for assistive tech. Defaults to the dictionary's `commandPaletteLabel`. */
69
+ 'aria-label'?: string;
70
+ className?: string;
71
+ style?: React.CSSProperties;
72
+ }
73
+ /**
74
+ * Application-wide search over commands, navigation targets and records — the Cmd/Ctrl+K surface.
75
+ *
76
+ * Behaviour is React Aria's `Autocomplete`: focus stays in the input while the arrow keys move
77
+ * `aria-activedescendant` through the list, so typing and choosing never fight each other. Pire
78
+ * supplies the overlay, the grouping and the empty/loading states.
79
+ *
80
+ * Open state is always the product's. Bind the shortcut with {@link useCommandPaletteShortcut},
81
+ * or with anything else — an ERP may already own that key.
82
+ */
83
+ export declare function CommandPalette({ isOpen, onOpenChange, groups, resultsGroup, onAction, onSearch, isLoading, emptyLabel, loadingLabel, placeholder, footer, showFooter, 'aria-label': ariaLabel, className, style, }: CommandPaletteProps): React.JSX.Element;
84
+ export interface CommandPaletteShortcutOptions {
85
+ /** The key pressed with Cmd (macOS) or Ctrl. Single character, matched case-insensitively. */
86
+ key?: string;
87
+ /** Stop listening — while a modal owns the keyboard, for instance. */
88
+ isDisabled?: boolean;
89
+ }
90
+ /**
91
+ * Binds Cmd+K / Ctrl+K to open the palette.
92
+ *
93
+ * Opt-in rather than built into {@link CommandPalette}, because a global key listener is the
94
+ * component's to grant and the app's to own: an ERP may already bind that combination, and a
95
+ * component that claims it on mount takes it silently.
96
+ */
97
+ export declare function useCommandPaletteShortcut(onTrigger: () => void, { key, isDisabled }?: CommandPaletteShortcutOptions): void;
@@ -0,0 +1,98 @@
1
+ import * as React from 'react';
2
+ export interface CommandPaletteItem {
3
+ /** Passed back to `onAction`. Must be unique across every group in the palette. */
4
+ id: string;
5
+ label: string;
6
+ /** Second line — what the command does, or what identifies the record. */
7
+ description?: string;
8
+ /** Icon slug, same vocabulary as `Button.icon`. */
9
+ icon?: string;
10
+ /**
11
+ * Painted on the right as key caps. Registers nothing; bind the key yourself.
12
+ *
13
+ * A string is split on `+` and spaces; pass an array when it cannot be — `['⌘', 'N']`.
14
+ */
15
+ shortcut?: string | string[];
16
+ /**
17
+ * Extra terms this item should match on, beyond its label. The place to put synonyms, the
18
+ * English name of a Spanish command, and the abbreviations people actually type — a palette
19
+ * that only matches the visible label makes users guess the wording.
20
+ *
21
+ * Matched against, never announced: the accessible name stays the label alone.
22
+ */
23
+ keywords?: string;
24
+ isDisabled?: boolean;
25
+ }
26
+ export interface CommandPaletteGroup {
27
+ id: string;
28
+ /** Heading above the group. Omit for a single unlabelled list. */
29
+ label?: string;
30
+ items: CommandPaletteItem[];
31
+ }
32
+ export interface CommandPaletteProps {
33
+ isOpen?: boolean;
34
+ onOpenChange?: (isOpen: boolean) => void;
35
+ /**
36
+ * Static groups — navigation targets and actions. Filtered locally as the user types, so these
37
+ * are the whole list, not a page of it.
38
+ */
39
+ groups?: CommandPaletteGroup[];
40
+ /**
41
+ * Server-backed results, appended after the static groups and **never filtered locally**: the
42
+ * server already ranked them, and a local "contains" pass would drop fuzzy and synonym matches.
43
+ * Feed it from `onSearch`.
44
+ */
45
+ resultsGroup?: CommandPaletteGroup;
46
+ /** The chosen item's `id`. The palette does not close itself — decide in the handler. */
47
+ onAction?: (id: string) => void;
48
+ /**
49
+ * The query on every keystroke. **Debounce before calling the server.**
50
+ *
51
+ * Only needed for `resultsGroup`; the static groups filter without it.
52
+ */
53
+ onSearch?: (query: string) => void;
54
+ /** Shows a status row rather than an empty list while a request is in flight. */
55
+ isLoading?: boolean;
56
+ /** Overrides the dictionary's `commandPaletteEmpty`. */
57
+ emptyLabel?: React.ReactNode;
58
+ /** Overrides the dictionary's `commandPaletteLoading`. */
59
+ loadingLabel?: string;
60
+ placeholder?: string;
61
+ /**
62
+ * Replaces the default key hints along the bottom. Use it for a product-specific affordance —
63
+ * a scope switch, a "search everything" toggle.
64
+ */
65
+ footer?: React.ReactNode;
66
+ /** Drops the footer entirely. The hints are worth their space until an app teaches the keys elsewhere. */
67
+ showFooter?: boolean;
68
+ /** Names the dialog for assistive tech. Defaults to the dictionary's `commandPaletteLabel`. */
69
+ 'aria-label'?: string;
70
+ className?: string;
71
+ style?: React.CSSProperties;
72
+ }
73
+ /**
74
+ * Application-wide search over commands, navigation targets and records — the Cmd/Ctrl+K surface.
75
+ *
76
+ * Behaviour is React Aria's `Autocomplete`: focus stays in the input while the arrow keys move
77
+ * `aria-activedescendant` through the list, so typing and choosing never fight each other. Pire
78
+ * supplies the overlay, the grouping and the empty/loading states.
79
+ *
80
+ * Open state is always the product's. Bind the shortcut with {@link useCommandPaletteShortcut},
81
+ * or with anything else — an ERP may already own that key.
82
+ */
83
+ export declare function CommandPalette({ isOpen, onOpenChange, groups, resultsGroup, onAction, onSearch, isLoading, emptyLabel, loadingLabel, placeholder, footer, showFooter, 'aria-label': ariaLabel, className, style, }: CommandPaletteProps): React.JSX.Element;
84
+ export interface CommandPaletteShortcutOptions {
85
+ /** The key pressed with Cmd (macOS) or Ctrl. Single character, matched case-insensitively. */
86
+ key?: string;
87
+ /** Stop listening — while a modal owns the keyboard, for instance. */
88
+ isDisabled?: boolean;
89
+ }
90
+ /**
91
+ * Binds Cmd+K / Ctrl+K to open the palette.
92
+ *
93
+ * Opt-in rather than built into {@link CommandPalette}, because a global key listener is the
94
+ * component's to grant and the app's to own: an ERP may already bind that combination, and a
95
+ * component that claims it on mount takes it silently.
96
+ */
97
+ export declare function useCommandPaletteShortcut(onTrigger: () => void, { key, isDisabled }?: CommandPaletteShortcutOptions): void;
98
+ //# sourceMappingURL=CommandPalette.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommandPalette.d.ts","sourceRoot":"","sources":["../../../src/components/patterns/CommandPalette.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAY/B,MAAM,WAAW,kBAAkB;IACjC,mFAAmF;IACnF,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,0EAA0E;IAC1E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC7B;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,kEAAkE;IAClE,KAAK,CA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