@orianatech/pire 0.13.0 → 0.16.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 (38) 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/forms/Input.d.cts +20 -2
  10. package/dist/components/forms/Input.d.ts +20 -2
  11. package/dist/components/forms/Input.d.ts.map +1 -1
  12. package/dist/components/forms/ValueHelpField.d.cts +12 -1
  13. package/dist/components/forms/ValueHelpField.d.ts +12 -1
  14. package/dist/components/forms/ValueHelpField.d.ts.map +1 -1
  15. package/dist/components/navigation/Menu.d.cts +7 -2
  16. package/dist/components/navigation/Menu.d.ts +7 -2
  17. package/dist/components/navigation/Menu.d.ts.map +1 -1
  18. package/dist/components/navigation/ShellBar.d.cts +13 -1
  19. package/dist/components/navigation/ShellBar.d.ts +13 -1
  20. package/dist/components/navigation/ShellBar.d.ts.map +1 -1
  21. package/dist/components/patterns/CommandPalette.d.cts +97 -0
  22. package/dist/components/patterns/CommandPalette.d.ts +98 -0
  23. package/dist/components/patterns/CommandPalette.d.ts.map +1 -0
  24. package/dist/components/patterns/ValueHelpDialog.d.cts +22 -1
  25. package/dist/components/patterns/ValueHelpDialog.d.ts +22 -1
  26. package/dist/components/patterns/ValueHelpDialog.d.ts.map +1 -1
  27. package/dist/components.css +94 -2
  28. package/dist/i18n/messages.d.cts +28 -0
  29. package/dist/i18n/messages.d.ts +28 -0
  30. package/dist/i18n/messages.d.ts.map +1 -1
  31. package/dist/index.cjs +1071 -664
  32. package/dist/index.cjs.map +1 -1
  33. package/dist/index.d.cts +3 -0
  34. package/dist/index.d.ts +3 -0
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +985 -563
  37. package/dist/index.js.map +1 -1
  38. 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"}
@@ -1,4 +1,4 @@
1
- import type * as React from 'react';
1
+ import * as React from 'react';
2
2
  export interface InputProps {
3
3
  label?: React.ReactNode;
4
4
  value?: string;
@@ -16,6 +16,24 @@ export interface InputProps {
16
16
  icon?: string;
17
17
  /** Trailing static text: unit, currency, "of 40". */
18
18
  suffix?: React.ReactNode;
19
+ /**
20
+ * Adds a clear affordance once the field has a value.
21
+ *
22
+ * Use it on every search field. `type="search"` gets one from the browser for free, but only in
23
+ * Chrome and Safari, and it cannot be styled or sized — Pire hides that one so a search box does
24
+ * not look different per browser. This is the replacement, and it is a real button: focusable,
25
+ * labelled, and the same shape everywhere.
26
+ *
27
+ * Works controlled or uncontrolled.
28
+ */
29
+ isClearable?: boolean;
30
+ /**
31
+ * The clear button's visible text. Defaults to the dictionary's `inputClear`.
32
+ *
33
+ * Deliberately a word rather than an icon: an "x" beside a dialog's own close "x" reads as a
34
+ * second way to dismiss the dialog. Keep it short — it sits inside the field.
35
+ */
36
+ clearLabel?: string;
19
37
  /** Help text below the field. Replaced by errorMessage when invalid. */
20
38
  description?: React.ReactNode;
21
39
  errorMessage?: React.ReactNode;
@@ -35,4 +53,4 @@ export interface InputProps {
35
53
  }
36
54
  /** Single-line text entry. Labels, descriptions and errors are wired to the input by React Aria,
37
55
  * so no manual aria-describedby is ever needed. */
38
- export declare function Input({ label, icon, suffix, description, errorMessage, size, numeric, fullWidth, className, style, inputRef, onChange, ...rest }: InputProps): React.JSX.Element;
56
+ export declare function Input({ label, icon, suffix, description, errorMessage, size, numeric, isClearable, clearLabel, fullWidth, className, style, inputRef, onChange, ...rest }: InputProps): React.JSX.Element;
@@ -1,4 +1,4 @@
1
- import type * as React from 'react';
1
+ import * as React from 'react';
2
2
  export interface InputProps {
3
3
  label?: React.ReactNode;
4
4
  value?: string;
@@ -16,6 +16,24 @@ export interface InputProps {
16
16
  icon?: string;
17
17
  /** Trailing static text: unit, currency, "of 40". */
18
18
  suffix?: React.ReactNode;
19
+ /**
20
+ * Adds a clear affordance once the field has a value.
21
+ *
22
+ * Use it on every search field. `type="search"` gets one from the browser for free, but only in
23
+ * Chrome and Safari, and it cannot be styled or sized — Pire hides that one so a search box does
24
+ * not look different per browser. This is the replacement, and it is a real button: focusable,
25
+ * labelled, and the same shape everywhere.
26
+ *
27
+ * Works controlled or uncontrolled.
28
+ */
29
+ isClearable?: boolean;
30
+ /**
31
+ * The clear button's visible text. Defaults to the dictionary's `inputClear`.
32
+ *
33
+ * Deliberately a word rather than an icon: an "x" beside a dialog's own close "x" reads as a
34
+ * second way to dismiss the dialog. Keep it short — it sits inside the field.
35
+ */
36
+ clearLabel?: string;
19
37
  /** Help text below the field. Replaced by errorMessage when invalid. */
20
38
  description?: React.ReactNode;
21
39
  errorMessage?: React.ReactNode;
@@ -35,5 +53,5 @@ export interface InputProps {
35
53
  }
36
54
  /** Single-line text entry. Labels, descriptions and errors are wired to the input by React Aria,
37
55
  * so no manual aria-describedby is ever needed. */
38
- export declare function Input({ label, icon, suffix, description, errorMessage, size, numeric, fullWidth, className, style, inputRef, onChange, ...rest }: InputProps): React.JSX.Element;
56
+ export declare function Input({ label, icon, suffix, description, errorMessage, size, numeric, isClearable, clearLabel, fullWidth, className, style, inputRef, onChange, ...rest }: InputProps): React.JSX.Element;
39
57
  //# sourceMappingURL=Input.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/components/forms/Input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAKpC,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qCAAqC;IACrC,QAAQ,CAA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nB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;CACxC;AAED;oDACoD;AACpD,wBAAgB,KAAK,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,IAAW,EAAE,OAAO,EAC1F,WAAW,EAAE,UAAU,EAAE,SAAgB,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,UAAU,qBAyCvG"}
@@ -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,CAA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AAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAMD;8FAC8F;AAC9F,wBAAgB,cAAc,CAAC,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAsB,EAChH,IAAS,EAAE,OAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,oBAAoB,EAAE,SAAS,EAAE,UAAU,EAC3F,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAClD,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,mBAAmB,CAAC,CAAC,CAAC,qBAiC3F"}
@@ -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;
@@ -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,WAAW,GAAG,OAAO,CAAC;IACrD,wFAAwF;IACxF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qFAAqF;IACrF,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,yFAAyF;AACzF,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE,SAAS,CAAC,CAAC,CAAC,qBAapG;AAED,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,iBAAiB,EAAE,WAAW,GAAG,UAAU,CAAC;IACtF,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,oEAAoE;IACpE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6EAA6E;IAC7E,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,6EAA6E;IAC7E,QAAQ,CAAC,EA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E,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":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAIpC,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IACrF,kDAAkD;IAClD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mFAAmF;IACnF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mCAAmC;IACnC,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,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;CACf;AAID,8EAA8E;AAC9E,wBAAgB,QAAQ,CAAC,EAAE,OAAO,EAA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 +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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,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,0GAA0G;IAC1G,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,+FAA+F;IAC/F,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAiBD;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EAAE,YAAY,EAAE,MAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAC9E,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,UAAiB,EAChE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,GAC1C,EAAE,mBAAmB,qBAsFrB;AAED,MAAM,WAAW,6BAA6B;IAC5C,8FAA8F;IAC9F,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,sEAAsE;IACtE,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,MAAM,IAAI,EAAE,EAAE,GAAS,EAAE,UAAU,EAAE,GAAE,6BAAkC,GACnF,IAAI,CAiBN"}
@@ -10,6 +10,27 @@ export interface ValueHelpDialogProps<T extends {
10
10
  rows?: T[];
11
11
  searchPlaceholder?: string;
12
12
  emptyLabel?: string;
13
+ /**
14
+ * The query on every keystroke. **Debounce before calling the server.**
15
+ *
16
+ * On its own this only observes; it does not change how `rows` is treated. Pair it with
17
+ * `isFilteredExternally` to actually hand filtering to the server.
18
+ */
19
+ onSearch?: (query: string) => void;
20
+ /**
21
+ * `rows` is the final list and the dialog filters nothing locally. Required for server search:
22
+ * fuzzy matches, synonyms, code-to-description and server ranking do not survive a local
23
+ * "contains" pass over the fields that happen to be in the row.
24
+ *
25
+ * Named to match `ComboBox`, deliberately. The same idea under two names is worse than either
26
+ * name — the ERP's supplier, customer, product and purchase-order pickers all need this, and
27
+ * they already know the ComboBox spelling.
28
+ */
29
+ isFilteredExternally?: boolean;
30
+ /** Keeps the table's skeleton up instead of showing "no records" while a request is in flight. */
31
+ isLoading?: boolean;
32
+ /** Called when the table is scrolled near its end, for paginated results. */
33
+ onLoadMore?: () => void;
13
34
  /** Receives the picked row. */
14
35
  onSelect?: (row: T) => void;
15
36
  onClose?: () => void;
@@ -17,4 +38,4 @@ export interface ValueHelpDialogProps<T extends {
17
38
  /** The ERP value help: search a master-data list and pick one record back into a field. */
18
39
  export declare function ValueHelpDialog<T extends {
19
40
  id: string | number;
20
- }>({ isOpen, title, columns, rows, searchPlaceholder, emptyLabel, onSelect, onClose }: ValueHelpDialogProps<T>): React.JSX.Element;
41
+ }>({ isOpen, title, columns, rows, searchPlaceholder, emptyLabel, onSearch, isFilteredExternally, isLoading, onLoadMore, onSelect, onClose }: ValueHelpDialogProps<T>): React.JSX.Element;
@@ -10,6 +10,27 @@ export interface ValueHelpDialogProps<T extends {
10
10
  rows?: T[];
11
11
  searchPlaceholder?: string;
12
12
  emptyLabel?: string;
13
+ /**
14
+ * The query on every keystroke. **Debounce before calling the server.**
15
+ *
16
+ * On its own this only observes; it does not change how `rows` is treated. Pair it with
17
+ * `isFilteredExternally` to actually hand filtering to the server.
18
+ */
19
+ onSearch?: (query: string) => void;
20
+ /**
21
+ * `rows` is the final list and the dialog filters nothing locally. Required for server search:
22
+ * fuzzy matches, synonyms, code-to-description and server ranking do not survive a local
23
+ * "contains" pass over the fields that happen to be in the row.
24
+ *
25
+ * Named to match `ComboBox`, deliberately. The same idea under two names is worse than either
26
+ * name — the ERP's supplier, customer, product and purchase-order pickers all need this, and
27
+ * they already know the ComboBox spelling.
28
+ */
29
+ isFilteredExternally?: boolean;
30
+ /** Keeps the table's skeleton up instead of showing "no records" while a request is in flight. */
31
+ isLoading?: boolean;
32
+ /** Called when the table is scrolled near its end, for paginated results. */
33
+ onLoadMore?: () => void;
13
34
  /** Receives the picked row. */
14
35
  onSelect?: (row: T) => void;
15
36
  onClose?: () => void;
@@ -17,5 +38,5 @@ export interface ValueHelpDialogProps<T extends {
17
38
  /** The ERP value help: search a master-data list and pick one record back into a field. */
18
39
  export declare function ValueHelpDialog<T extends {
19
40
  id: string | number;
20
- }>({ isOpen, title, columns, rows, searchPlaceholder, emptyLabel, onSelect, onClose }: ValueHelpDialogProps<T>): React.JSX.Element;
41
+ }>({ isOpen, title, columns, rows, searchPlaceholder, emptyLabel, onSearch, isFilteredExternally, isLoading, onLoadMore, onSelect, onClose }: ValueHelpDialogProps<T>): React.JSX.Element;
21
42
  //# sourceMappingURL=ValueHelpDialog.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ValueHelpDialog.d.ts","sourceRoot":"","sources":["../../../src/components/patterns/ValueHelpDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAa,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAIpE,MAAM,WAAW,oBAAoB,CAAC,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,GAAG,GAAG;IAC3E,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,sDAAsD;IACtD,OAAO,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/B,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;IACX,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,2FAA2F;AAC3F,wBAAgB,eAAe,CAAC,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;CA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