@lerianstudio/sindarian-ui 1.4.0-beta.7 → 2.0.0-beta.1

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 (98) hide show
  1. package/dist/components/card/account-card/index.d.ts.map +1 -1
  2. package/dist/components/card/account-card/index.js +1 -1
  3. package/dist/components/card/entity-card/index.js +3 -3
  4. package/dist/components/dialog/confirmation-dialog/index.d.ts +36 -5
  5. package/dist/components/dialog/confirmation-dialog/index.d.ts.map +1 -1
  6. package/dist/components/dialog/confirmation-dialog/index.js +2 -2
  7. package/dist/components/entity-box/index.js +1 -1
  8. package/dist/components/entity-data-table/index.d.ts.map +1 -1
  9. package/dist/components/entity-data-table/index.js +1 -1
  10. package/dist/components/page-header/index.d.ts.map +1 -1
  11. package/dist/components/page-header/index.js +2 -2
  12. package/dist/components/ui/autocomplete/index.d.ts +34 -6
  13. package/dist/components/ui/autocomplete/index.d.ts.map +1 -1
  14. package/dist/components/ui/autocomplete/index.js +72 -16
  15. package/dist/components/ui/badge/index.d.ts.map +1 -1
  16. package/dist/components/ui/badge/index.js +11 -1
  17. package/dist/components/ui/card/index.d.ts.map +1 -1
  18. package/dist/components/ui/card/index.js +1 -1
  19. package/dist/components/ui/dropdown-menu/index.d.ts.map +1 -1
  20. package/dist/components/ui/dropdown-menu/index.js +4 -1
  21. package/dist/components/ui/field/index.d.ts.map +1 -1
  22. package/dist/components/ui/field/index.js +5 -2
  23. package/dist/components/ui/file-upload/index.js +1 -1
  24. package/dist/components/ui/form.d.ts.map +1 -1
  25. package/dist/components/ui/form.js +5 -2
  26. package/dist/components/ui/multiple-select/index.js +2 -2
  27. package/dist/components/ui/progress/index.d.ts +15 -1
  28. package/dist/components/ui/progress/index.d.ts.map +1 -1
  29. package/dist/components/ui/progress/index.js +25 -2
  30. package/dist/components/ui/sidebar/sidebar-expand-button.d.ts.map +1 -1
  31. package/dist/components/ui/sidebar/sidebar-expand-button.js +17 -1
  32. package/dist/components/ui/tooltip/index.d.ts +15 -0
  33. package/dist/components/ui/tooltip/index.d.ts.map +1 -1
  34. package/dist/components/ui/tooltip/index.js +16 -1
  35. package/dist/domain/blotter/index.d.ts +4 -2
  36. package/dist/domain/blotter/index.d.ts.map +1 -1
  37. package/dist/domain/delinquency-aging/aging-buckets.d.ts.map +1 -1
  38. package/dist/domain/delinquency-aging/aging-buckets.js +8 -3
  39. package/dist/domain/delinquency-aging/index.d.ts.map +1 -1
  40. package/dist/domain/delinquency-aging/index.js +8 -3
  41. package/dist/domain/key-id/index.js +1 -1
  42. package/dist/domain/money-text/index.d.ts.map +1 -1
  43. package/dist/domain/money-text/index.js +13 -5
  44. package/dist/domain/status-rail/index.js +1 -1
  45. package/dist/domain/threshold-gauge/index.d.ts.map +1 -1
  46. package/dist/domain/threshold-gauge/index.js +9 -5
  47. package/dist/enterprise/stat-card/index.d.ts.map +1 -1
  48. package/dist/enterprise/stat-card/index.js +12 -4
  49. package/dist/esm/components/card/account-card/index.d.ts.map +1 -1
  50. package/dist/esm/components/card/account-card/index.js +1 -1
  51. package/dist/esm/components/card/entity-card/index.js +3 -3
  52. package/dist/esm/components/dialog/confirmation-dialog/index.d.ts +36 -5
  53. package/dist/esm/components/dialog/confirmation-dialog/index.d.ts.map +1 -1
  54. package/dist/esm/components/dialog/confirmation-dialog/index.js +2 -2
  55. package/dist/esm/components/entity-box/index.js +1 -1
  56. package/dist/esm/components/entity-data-table/index.d.ts.map +1 -1
  57. package/dist/esm/components/entity-data-table/index.js +1 -1
  58. package/dist/esm/components/page-header/index.d.ts.map +1 -1
  59. package/dist/esm/components/page-header/index.js +2 -2
  60. package/dist/esm/components/ui/autocomplete/index.d.ts +34 -6
  61. package/dist/esm/components/ui/autocomplete/index.d.ts.map +1 -1
  62. package/dist/esm/components/ui/autocomplete/index.js +72 -16
  63. package/dist/esm/components/ui/badge/index.d.ts.map +1 -1
  64. package/dist/esm/components/ui/badge/index.js +11 -1
  65. package/dist/esm/components/ui/card/index.d.ts.map +1 -1
  66. package/dist/esm/components/ui/card/index.js +1 -1
  67. package/dist/esm/components/ui/dropdown-menu/index.d.ts.map +1 -1
  68. package/dist/esm/components/ui/dropdown-menu/index.js +4 -1
  69. package/dist/esm/components/ui/field/index.d.ts.map +1 -1
  70. package/dist/esm/components/ui/field/index.js +5 -2
  71. package/dist/esm/components/ui/file-upload/index.js +1 -1
  72. package/dist/esm/components/ui/form.d.ts.map +1 -1
  73. package/dist/esm/components/ui/form.js +5 -2
  74. package/dist/esm/components/ui/multiple-select/index.js +2 -2
  75. package/dist/esm/components/ui/progress/index.d.ts +15 -1
  76. package/dist/esm/components/ui/progress/index.d.ts.map +1 -1
  77. package/dist/esm/components/ui/progress/index.js +25 -2
  78. package/dist/esm/components/ui/sidebar/sidebar-expand-button.d.ts.map +1 -1
  79. package/dist/esm/components/ui/sidebar/sidebar-expand-button.js +17 -1
  80. package/dist/esm/components/ui/tooltip/index.d.ts +15 -0
  81. package/dist/esm/components/ui/tooltip/index.d.ts.map +1 -1
  82. package/dist/esm/components/ui/tooltip/index.js +16 -1
  83. package/dist/esm/domain/blotter/index.d.ts +4 -2
  84. package/dist/esm/domain/blotter/index.d.ts.map +1 -1
  85. package/dist/esm/domain/delinquency-aging/aging-buckets.d.ts.map +1 -1
  86. package/dist/esm/domain/delinquency-aging/aging-buckets.js +8 -3
  87. package/dist/esm/domain/delinquency-aging/index.d.ts.map +1 -1
  88. package/dist/esm/domain/delinquency-aging/index.js +8 -3
  89. package/dist/esm/domain/key-id/index.js +1 -1
  90. package/dist/esm/domain/money-text/index.d.ts.map +1 -1
  91. package/dist/esm/domain/money-text/index.js +13 -5
  92. package/dist/esm/domain/status-rail/index.js +1 -1
  93. package/dist/esm/domain/threshold-gauge/index.d.ts.map +1 -1
  94. package/dist/esm/domain/threshold-gauge/index.js +9 -5
  95. package/dist/esm/enterprise/stat-card/index.d.ts.map +1 -1
  96. package/dist/esm/enterprise/stat-card/index.js +12 -4
  97. package/dist/globals.css +24 -1
  98. package/package.json +1 -1
@@ -8,7 +8,7 @@ function EntityDataTableFooter({ className, ...props }) {
8
8
  return (_jsx("div", { "data-slot": "data-table-footer", className: cn('flex flex-row items-center justify-between px-6 py-3', className), ...props }));
9
9
  }
10
10
  function EntityDataTableFooterText({ className, ...props }) {
11
- return (_jsx("p", { "data-slot": "data-table-footer-text", className: cn('text-shadcn-400 text-sm leading-8 italic', className), ...props }));
11
+ return (_jsx("p", { "data-slot": "data-table-footer-text", className: cn('text-muted-foreground text-sm leading-8 italic', className), ...props }));
12
12
  }
13
13
  export const EntityDataTable = {
14
14
  Root: EntityDataTableRoot,
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/page-header/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAA2B,SAAS,EAAwB,MAAM,OAAO,CAAA;AAmBhF,wBAAgB,uBAAuB,CAAC,EACtC,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,+BAQ7B;AAED,wBAAgB,iBAAiB,CAAC,EAChC,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,+BAc7B;AAED,KAAK,eAAe,GAAG;IACrB,QAAQ,EAAE,SAAS,CAAA;IACnB,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,CAAA;AAED,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,SAAS,EACT,aAAa,EACd,EAAE,eAAe,+BAmBjB;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,uBAAuB,CAAC,EAAE,OAAO,CAAA;IACjC,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;OAIG;IACH,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;IAC5C;;;;;;;;;OASG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB,CAAA;AAED,wBAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,QAAQ,EACR,SAAS,EACT,kBAAkB,EAClB,QAAQ,EACR,EAAE,EAAE,OAAc,EACnB,EAAE,wBAAwB,+BA2D1B;AAED,MAAM,MAAM,0BAA0B,GAAG;IACvC,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,wBAAgB,qBAAqB,CAAC,EACpC,QAAQ,EACT,EAAE,0BAA0B,+BAqC5B;AAED,MAAM,MAAM,qCAAqC,GAAG;IAClD,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,wBAAgB,gCAAgC,CAAC,EAC/C,QAAQ,EACT,EAAE,qCAAqC,+BAavC;AAED,MAAM,MAAM,8BAA8B,GAAG;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAED,wBAAgB,yBAAyB,CAAC,EACxC,QAAQ,EACR,MAAM,EACN,OAAO,EACP,IAAI,EACL,EAAE,8BAA8B,+BA+ChC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/page-header/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAA2B,SAAS,EAAwB,MAAM,OAAO,CAAA;AAmBhF,wBAAgB,uBAAuB,CAAC,EACtC,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,+BAQ7B;AAED,wBAAgB,iBAAiB,CAAC,EAChC,SAAS,EACT,GAAG,KAAK,EACT,EAAE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M,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAED,wBAAgB,yBAAyB,CAAC,EACxC,QAAQ,EACR,MAAM,EACN,OAAO,EACP,IAAI,EACL,EAAE,8BAA8B,+BA+ChC"}
@@ -61,11 +61,11 @@ export function PageHeaderInfoTooltip({ subtitle }) {
61
61
  description: 'Copied to clipboard!'
62
62
  });
63
63
  };
64
- return (_jsx("div", { "data-slot": "page-header-info-tooltip", children: _jsx(TooltipProvider, { children: _jsxs(Tooltip, { delayDuration: 300, children: [_jsx(TooltipTrigger, { onClick: () => handleCopyToClipboard(subtitle), children: _jsx(Copy, { size: 16, className: "cursor-pointer" }) }), _jsxs(TooltipContent, { className: "bg-shadcn-600 border-none", arrowPadding: 0, children: [_jsx("p", { className: "text-shadcn-400 text-sm font-medium", children: subtitle }), _jsx("p", { className: "text-center text-white", children: "Click to copy" }), _jsx(Arrow, { height: 8, width: 15 })] })] }) }) }));
64
+ return (_jsx("div", { "data-slot": "page-header-info-tooltip", children: _jsx(TooltipProvider, { children: _jsxs(Tooltip, { delayDuration: 300, children: [_jsx(TooltipTrigger, { onClick: () => handleCopyToClipboard(subtitle), children: _jsx(Copy, { size: 16, className: "cursor-pointer" }) }), _jsxs(TooltipContent, { className: "bg-shadcn-600 border-none", arrowPadding: 0, children: [_jsx("p", { className: "text-shadcn-300 text-sm font-medium", children: subtitle }), _jsx("p", { className: "text-center text-white", children: "Click to copy" }), _jsx(Arrow, { height: 8, width: 15 })] })] }) }) }));
65
65
  }
66
66
  export function PageHeaderCollapsibleInfoTrigger({ question }) {
67
67
  return (_jsx("div", { "data-slot": "page-header-collapsible-info-trigger", children: _jsx(CollapsibleTrigger, { asChild: true, children: _jsxs(Button, { variant: "link", className: "flex gap-2 pr-0", children: [_jsx("span", { className: "text-foreground text-sm font-medium", children: question }), _jsx(HelpCircle, { className: "h-4 w-4" })] }) }) }));
68
68
  }
69
69
  export function PageHeaderCollapsibleInfo({ question, answer, seeMore, href }) {
70
- return (_jsx("div", { "data-slot": "page-header-collapsible-info", children: _jsx(CollapsibleContent, { children: _jsxs("div", { className: "flex w-full justify-between pt-6", children: [_jsxs("div", { className: "mt-12 flex grow flex-col gap-3 pr-6", children: [_jsx("h2", { className: "text-foreground text-xl font-bold", children: question }), _jsxs("p", { className: "text-shadcn-500 text-sm leading-relaxed font-medium", children: [answer, seeMore && href && (_jsxs(_Fragment, { children: [' ', _jsxs("a", { target: "_blank", rel: "noopener noreferrer", href: href, className: "text-shadcn-600 dark:text-shadcn-400 font-medium", children: [_jsx("span", { className: "underline underline-offset-4", children: seeMore }), _jsx(ExternalLink, { size: 16, className: "ml-1 inline align-middle" })] })] }))] })] }), _jsx(CollapsibleTrigger, { asChild: true, children: _jsx(Button, { variant: "link", className: "cursor-pointer self-start", children: _jsx(ChevronUp, { size: 24, className: "text-shadcn-500" }) }) })] }) }) }));
70
+ return (_jsx("div", { "data-slot": "page-header-collapsible-info", children: _jsx(CollapsibleContent, { children: _jsxs("div", { className: "flex w-full justify-between pt-6", children: [_jsxs("div", { className: "mt-12 flex grow flex-col gap-3 pr-6", children: [_jsx("h2", { className: "text-foreground text-xl font-bold", children: question }), _jsxs("p", { className: "text-shadcn-500 text-sm leading-relaxed font-medium", children: [answer, seeMore && href && (_jsxs(_Fragment, { children: [' ', _jsxs("a", { target: "_blank", rel: "noopener noreferrer", href: href, className: "text-muted-foreground font-medium", children: [_jsx("span", { className: "underline underline-offset-4", children: seeMore }), _jsx(ExternalLink, { size: 16, className: "ml-1 inline align-middle" })] })] }))] })] }), _jsx(CollapsibleTrigger, { asChild: true, children: _jsx(Button, { variant: "link", className: "cursor-pointer self-start", children: _jsx(ChevronUp, { size: 24, className: "text-shadcn-500" }) }) })] }) }) }));
71
71
  }
@@ -21,10 +21,16 @@ export type AutocompleteContextType = React.HtmlHTMLAttributes<HTMLInputElement>
21
21
  };
22
22
  export type AutocompleteTriggerProps = React.ComponentProps<'div'> & {
23
23
  onClear?: () => void;
24
+ /** Accessible label for the clear button. */
25
+ clearLabel?: string;
24
26
  };
25
- export declare function AutocompleteTrigger({ ref, className, onClear, children }: AutocompleteTriggerProps): React.JSX.Element;
27
+ export declare function AutocompleteTrigger({ ref, className, onClear, clearLabel, children }: AutocompleteTriggerProps): React.JSX.Element;
26
28
  export declare function AutocompleteValue({ ref, className, value: valueProp, onValueChange, onBlur, ...props }: React.ComponentProps<typeof CommandPrimitive.Input>): React.JSX.Element;
27
- export declare function AutocompleteMultipleValue({ ref, className, ...props }: React.ComponentProps<typeof CommandPrimitive.Input>): React.JSX.Element;
29
+ export type AutocompleteMultipleValueProps = React.ComponentProps<typeof CommandPrimitive.Input> & {
30
+ /** Accessible label for each chip's remove button, prefixed to its value. */
31
+ clearLabel?: string;
32
+ };
33
+ export declare function AutocompleteMultipleValue({ ref, className, clearLabel, ...props }: AutocompleteMultipleValueProps): React.JSX.Element;
28
34
  export declare function AutocompleteEmpty({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Empty>): React.JSX.Element | null;
29
35
  export declare function AutocompleteLoading({ className, ref, ...props }: React.ComponentProps<typeof CommandPrimitive.Loading>): React.JSX.Element;
30
36
  export declare const SIDE_OPTIONS: string[];
@@ -36,10 +42,32 @@ export type AutocompleteContentProps = React.ComponentProps<typeof CommandPrimit
36
42
  };
37
43
  export declare function AutocompleteContent({ className, position, side, ref, children, onMouseEnter, onMouseLeave, onPointerDownOutside, ...props }: AutocompleteContentProps): React.JSX.Element;
38
44
  export declare function AutocompleteGroup({ className, ...props }: React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>): React.JSX.Element;
39
- export declare function AutocompleteItem({ className, value, onSelect, ...props }: React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>): React.JSX.Element;
40
- export type AutocompleteProps = React.ComponentProps<typeof CommandPrimitive> & {
41
- value?: string | string[] | [];
42
- defaultValue?: string | string[] | [];
45
+ export type AutocompleteItemProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item> & {
46
+ /** Text this option reads as wherever it is rendered outside the list (the
47
+ * input, a chip and its remove button). Required only when the children are
48
+ * markup rather than a plain string, which cannot be read as text. */
49
+ label?: string;
50
+ };
51
+ export declare function AutocompleteItem({ className, value, label: _label, onSelect, ...props }: AutocompleteItemProps): React.JSX.Element;
52
+ export declare namespace AutocompleteItem {
53
+ var displayName: string;
54
+ }
55
+ /**
56
+ * ⛔ THE THREE OMITS ARE THE POINT. cmdk's `Command` types `value`,
57
+ * `defaultValue` and `onValueChange` for a single-select command palette: bare
58
+ * `string`, and `(value: string) => void`. Intersecting rather than omitting
59
+ * collapsed each one to the cmdk half — `string & (string | string[])` is
60
+ * `string` — so `defaultValue={['next']}` was a type error on a component whose
61
+ * whole `multiple` mode passes arrays, and every consumer reached it through a
62
+ * cast.
63
+ *
64
+ * These are exactly the three this component destructures and re-implements
65
+ * below, so none of them reaches `CommandPrimitive` through `...props` and
66
+ * omitting them drops no behaviour.
67
+ */
68
+ export type AutocompleteProps = Omit<React.ComponentProps<typeof CommandPrimitive>, 'value' | 'defaultValue' | 'onValueChange'> & {
69
+ value?: string | string[];
70
+ defaultValue?: string | string[];
43
71
  onValueChange?: (values: string | string[]) => void;
44
72
  onClear?: () => void;
45
73
  open?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/autocomplete/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAmB,MAAM,MAAM,CAAA;AAInE,MAAM,MAAM,uBAAuB,GACjC,KAAK,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,GAAG;IAC3C,sCAAsC;IACtC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,EAAE,CAAA;IAC7B,aAAa,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,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AC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,SAAS,EACT,KAAK,EAIL,KAAK,EAAE,MAAM,EACb,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,qBAAqB,qBAsBvB;yBA/Be,gBAAgB;;;AA4ChC;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAClC,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,EAC7C,OAAO,GAAG,cAAc,GAAG,eAAe,CAC3C,GAAG;IACF,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IACzB,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAChC,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,IAAI,CAAA;IACnD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IAEpB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IAEtC,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,wBAAgB,YAAY,CAAC,EAC3B,GAAG,EACH,KAAK,EACL,YAAY,EACZ,aAAa,EACb,OAAO,EACP,SAAS,EACT,IAAI,EAAE,QAAQ,EACd,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,iBAAiB,qBAmInB"}
@@ -27,12 +27,31 @@ const useAutocomplete = () => {
27
27
  }
28
28
  return context;
29
29
  };
30
- export function AutocompleteTrigger({ ref, className, onClear, children }) {
30
+ /**
31
+ * The text a value reads as.
32
+ *
33
+ * An item registers a label only when it HAS one to give: a string child, or an
34
+ * explicit `label` when its children are markup. Everything downstream renders
35
+ * this map as text (the input's value, a chip's `aria-label`), so a value with
36
+ * no registered label falls back to the value itself. The alternatives are both
37
+ * defects that shipped: `undefined` drops a controlled input to uncontrolled,
38
+ * and a React element interpolates into a template literal as "[object
39
+ * Object]".
40
+ */
41
+ function labelOf(options, value) {
42
+ return options[value] ?? value;
43
+ }
44
+ export function AutocompleteTrigger({ ref, className, onClear, clearLabel = 'Clear', children }) {
31
45
  const _ref = React.useRef(null);
32
46
  const { open, readOnly, setOpen, disabled, value, inputRef, handleClear } = useAutocomplete();
33
47
  React.useImperativeHandle(ref, () => _ref.current);
34
48
  const isNoSelection = disabled || readOnly || value.length < 1;
35
- return (_jsxs("div", { ref: _ref, className: cn('bg-background ring-offset-background placeholder:text-shadcn-400 data-[disabled=true]:bg-shadcn-100 data-[read-only=true]:bg-shadcn-100 border-input flex rounded-md border text-sm focus:outline-hidden focus-visible:outline-hidden data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-50 data-[read-only=true]:opacity-50 md:text-sm [&>span]:line-clamp-1', {
49
+ return (_jsxs("div", { ref: _ref, className: cn(
50
+ // `border-input-border`, NOT `border-input`: `--input` is a SURFACE
51
+ // token and is white in light, so the border it paints is invisible
52
+ // against the field's own `bg-background`. This is the same edge
53
+ // MultipleSelect and DateRangePicker draw, and the same token.
54
+ 'bg-background ring-offset-background placeholder:text-input-placeholder data-[disabled=true]:bg-shadcn-100 data-[read-only=true]:bg-shadcn-100 border-input-border flex rounded-md border text-sm focus:outline-hidden focus-visible:outline-hidden data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-50 data-[read-only=true]:opacity-50 md:text-sm [&>span]:line-clamp-1', {
36
55
  'h-9': value.length === 0,
37
56
  'min-h-9': value.length > 0,
38
57
  'cursor-text': !disabled && value.length !== 0
@@ -48,11 +67,19 @@ export function AutocompleteTrigger({ ref, className, onClear, children }) {
48
67
  inputRef?.current?.focus();
49
68
  }
50
69
  setOpen(!open);
51
- }, "data-disabled": disabled, "data-read-only": readOnly, children: [_jsx("div", { className: "flex grow flex-wrap gap-1 px-3 py-2", children: children }), _jsxs("div", { className: "flex shrink-0 items-center justify-end", children: [_jsx("button", { type: "button", className: cn(isNoSelection && 'hidden'), children: _jsx(X, { className: "text-muted-foreground mx-2 h-4 cursor-pointer", onClick: (event) => {
70
+ }, "data-disabled": disabled, "data-read-only": readOnly, children: [_jsx("div", { className: "flex grow flex-wrap gap-1 px-3 py-2", children: children }), _jsxs("div", { className: "flex shrink-0 items-center justify-end", children: [_jsx("button", { type: "button", "aria-label": clearLabel, className: cn('cursor-pointer', isNoSelection && 'hidden'), onKeyDown: (event) => {
71
+ // cmdk's Command root calls preventDefault() on EVERY Enter that
72
+ // reaches it, which cancels this button's implicit activation, so
73
+ // the keydown must not get there. Enter only: the root's other
74
+ // keys (Escape, the arrows) still belong to the panel.
75
+ if (event.key === 'Enter') {
52
76
  event.stopPropagation();
53
- handleClear();
54
- onClear?.();
55
- } }) }), _jsx(Separator, { orientation: "vertical", className: cn(isNoSelection && 'hidden') }), _jsx(SelectPrimitive.Icon, { className: "cursor-pointer data-[disabled=true]:cursor-not-allowed data-[read-only=true]:cursor-default", "data-disabled": disabled, "data-read-only": readOnly, children: _jsx(ChevronDown, { className: "mx-3 my-2 h-4 w-4 opacity-50" }) })] })] }));
77
+ }
78
+ }, onClick: (event) => {
79
+ event.stopPropagation();
80
+ handleClear();
81
+ onClear?.();
82
+ }, children: _jsx(X, { "aria-hidden": true, className: "text-muted-foreground mx-2 h-4" }) }), _jsx(Separator, { orientation: "vertical", className: cn(isNoSelection && 'hidden') }), _jsx(SelectPrimitive.Icon, { className: "cursor-pointer data-[disabled=true]:cursor-not-allowed data-[read-only=true]:cursor-default", "data-disabled": disabled, "data-read-only": readOnly, children: _jsx(ChevronDown, { className: "mx-3 my-2 h-4 w-4 opacity-50" }) })] })] }));
56
83
  }
57
84
  export function AutocompleteValue({ ref, className, value: valueProp, onValueChange, onBlur, ...props }) {
58
85
  const [search, setSearch] = React.useState(valueProp);
@@ -67,7 +94,7 @@ export function AutocompleteValue({ ref, className, value: valueProp, onValueCha
67
94
  handleValueChange('');
68
95
  return;
69
96
  }
70
- handleValueChange(showValue ? v : options[v]);
97
+ handleValueChange(showValue ? v : labelOf(options, v));
71
98
  };
72
99
  const handleValueChange = (value) => {
73
100
  setSearch(value);
@@ -86,21 +113,29 @@ export function AutocompleteValue({ ref, className, value: valueProp, onValueCha
86
113
  if (v === '') {
87
114
  return;
88
115
  }
89
- setSearch(showValue ? v : options[v]);
116
+ setSearch(showValue ? v : labelOf(options, v));
90
117
  }, [options]);
91
118
  React.useEffect(() => {
92
119
  updateSearch(value);
93
120
  }, [value]);
94
121
  return (_jsx(CommandPrimitive.Input, { ...props, ref: inputRef, value: search, onValueChange: handleValueChange, disabled: disabled, readOnly: readOnly, className: cn('placeholder:text-muted-foreground w-full bg-transparent outline-hidden read-only:opacity-50 read-only:placeholder:opacity-0 focus:outline-hidden disabled:cursor-not-allowed disabled:opacity-50 disabled:placeholder:opacity-0', className), onBlur: handleBlur }));
95
122
  }
96
- export function AutocompleteMultipleValue({ ref, className, ...props }) {
123
+ export function AutocompleteMultipleValue({ ref, className, clearLabel = 'Clear', ...props }) {
97
124
  const { value, disabled, handleChange, options, showValue, inputRef } = useAutocomplete();
98
125
  React.useImperativeHandle(ref, () => inputRef.current);
99
126
  return (_jsxs(_Fragment, { children: [options &&
100
- value?.map((value) => (_jsxs(Badge, { variant: "secondary", className: cn('data-disabled:bg-muted-foreground data-fixed:bg-muted-foreground data-disabled:text-muted data-fixed:text-muted data-disabled:hover:bg-muted-foreground data-fixed:hover:bg-muted-foreground'), children: [showValue ? value : options[value], _jsx("button", { type: "button", className: cn('ring-offset-background focus:ring-ring ml-1 rounded-full outline-hidden focus:ring-2 focus:ring-offset-2', disabled && 'hidden'), children: _jsx(X, { className: "text-muted-foreground hover:text-foreground h-3 w-3", onClick: (event) => {
127
+ value?.map((value) => (_jsxs(Badge, { variant: "secondary", className: cn('data-disabled:bg-muted-foreground data-fixed:bg-muted-foreground data-disabled:text-muted data-fixed:text-muted data-disabled:hover:bg-muted-foreground data-fixed:hover:bg-muted-foreground'), children: [showValue ? value : labelOf(options, value), _jsx("button", { type: "button", "aria-label": `${clearLabel} ${showValue ? value : labelOf(options, value)}`, className: cn('ring-offset-background focus:ring-ring ml-1 rounded-full outline-hidden focus:ring-2 focus:ring-offset-2', disabled && 'hidden'), onKeyDown: (event) => {
128
+ // cmdk's Command root calls preventDefault() on EVERY Enter that
129
+ // reaches it, which cancels this button's implicit activation, so
130
+ // the keydown must not get there. Enter only: the root's other
131
+ // keys (Escape, the arrows) still belong to the panel.
132
+ if (event.key === 'Enter') {
101
133
  event.stopPropagation();
102
- handleChange(value);
103
- } }) })] }, value))), _jsx(CommandPrimitive.Input, { ...props, ref: inputRef, disabled: disabled, className: cn('placeholder:text-muted-foreground w-full bg-transparent outline-hidden focus:outline-hidden disabled:cursor-not-allowed disabled:opacity-50 disabled:placeholder:opacity-0', className) })] }));
134
+ }
135
+ }, onClick: (event) => {
136
+ event.stopPropagation();
137
+ handleChange(value);
138
+ }, children: _jsx(X, { "aria-hidden": true, className: "text-muted-foreground hover:text-foreground h-3 w-3" }) })] }, value))), _jsx(CommandPrimitive.Input, { ...props, ref: inputRef, disabled: disabled, className: cn('placeholder:text-muted-foreground w-full bg-transparent outline-hidden focus:outline-hidden disabled:cursor-not-allowed disabled:opacity-50 disabled:placeholder:opacity-0', className) })] }));
104
139
  }
105
140
  export function AutocompleteEmpty({ className, ...props }) {
106
141
  const render = useCommandState((state) => state.filtered.count === 0);
@@ -152,9 +187,16 @@ export function AutocompleteContent({ className, position = 'popper', side = 'bo
152
187
  child.type.displayName === 'AutocompleteItem') {
153
188
  // Check if the item was proper filled with a value prop
154
189
  if (child.props.value) {
155
- addOption({
156
- [child.props.value]: child.props.children
157
- });
190
+ // NOT `children as string`. That cast is how a React ELEMENT got into
191
+ // a map every reader treats as text. An item with markup children
192
+ // registers nothing unless it declares a `label`, and `labelOf` reads
193
+ // the absence as "use the value".
194
+ const { label, children: itemChildren } = child.props;
195
+ const text = label ??
196
+ (typeof itemChildren === 'string' ? itemChildren : undefined);
197
+ if (text !== undefined) {
198
+ addOption({ [child.props.value]: text });
199
+ }
158
200
  }
159
201
  return;
160
202
  }
@@ -210,7 +252,11 @@ export function AutocompleteContent({ className, position = 'popper', side = 'bo
210
252
  export function AutocompleteGroup({ className, ...props }) {
211
253
  return (_jsx(CommandPrimitive.Group, { "data-slot": "autocomplete-group", className: cn('text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium', className), ...props }));
212
254
  }
213
- export function AutocompleteItem({ className, value, onSelect, ...props }) {
255
+ export function AutocompleteItem({ className, value,
256
+ // Read off the element by `AutocompleteContent._searchChildren`, never
257
+ // rendered: destructured here only to keep it out of `...props` and off the
258
+ // div cmdk spreads them onto.
259
+ label: _label, onSelect, ...props }) {
214
260
  const { handleChange } = useAutocomplete();
215
261
  return (_jsx(CommandPrimitive.Item, { "data-slot": "autocomplete-item", value: value, className: cn("data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", className), ...props, onMouseDown: (e) => {
216
262
  e.preventDefault();
@@ -220,6 +266,16 @@ export function AutocompleteItem({ className, value, onSelect, ...props }) {
220
266
  onSelect?.(value);
221
267
  } }));
222
268
  }
269
+ /**
270
+ * ⛔ LOAD-BEARING, NOT A DEBUG LABEL. `AutocompleteContent._searchChildren`
271
+ * recognises an option by `child.type.displayName === 'AutocompleteItem'`, and
272
+ * a function component carries no displayName unless it is assigned one. It
273
+ * never was, so the walk matched nothing and the option registry stayed empty
274
+ * for every consumer: a multiple-select chip rendered `options[value]` as
275
+ * `undefined` (an empty chip), and `AutocompleteValue.updateSearch` set the
276
+ * input to `undefined` on every selection outside `showValue` mode.
277
+ */
278
+ AutocompleteItem.displayName = 'AutocompleteItem';
223
279
  export function Autocomplete({ ref, value, defaultValue, onValueChange, onClear, className, open: openProp, onOpenChange, showValue, readOnly, disabled, multiple, onKeyDown, children, ...props }) {
224
280
  const _ref = React.useRef(null);
225
281
  const [open, _setOpen] = React.useState(openProp);
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/badge/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAKjE;;;;;;GAMG;AACH;;;;;;;GAOG;AACH,QAAA,MAAM,aAAa;;;8EA6ClB,CAAA;AAED,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,GACnD,YAAY,CAAC,OAAO,aAAa,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAA;AAE5D,iBAAS,KAAK,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,qBAUzE;AAED,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/badge/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAKjE;;;;;;GAMG;AACH;;;;;;;GAOG;AACH,QAAA,MAAM,aAAa;;;8EA6ClB,CAAA;AAED,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,GACnD,YAAY,CAAC,OAAO,aAAa,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAA;AAE5D,iBAAS,KAAK,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,qBAsBzE;AAED,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAA"}
@@ -52,6 +52,16 @@ const badgeVariants = cva('inline-flex items-center gap-1 rounded-full border bo
52
52
  });
53
53
  function Badge({ className, variant, size, asChild, ...props }) {
54
54
  const Comp = asChild ? Slot : 'span';
55
- return (_jsx(Comp, { "data-slot": "badge", className: cn(badgeVariants({ variant, size }), className), ...props }));
55
+ /**
56
+ * A bare `span` is generic, and ARIA prohibits an accessible name on a
57
+ * generic element: a caller's `aria-label` was dropped by assistive tech and
58
+ * flagged by axe as `aria-prohibited-attr`. `role="img"` is the smallest role
59
+ * that permits the name and lets it stand in for the visible text, which is
60
+ * exactly what a labelled span badge wants. Unlabelled badges stay generic;
61
+ * `asChild` keeps the child's native role; and a caller's own `role` still wins
62
+ * because it arrives with the spread below.
63
+ */
64
+ const labelled = props['aria-label'] !== undefined || props['aria-labelledby'] !== undefined;
65
+ return (_jsx(Comp, { "data-slot": "badge", role: !asChild && labelled ? 'img' : undefined, className: cn(badgeVariants({ variant, size }), className), ...props }));
56
66
  }
57
67
  export { Badge, badgeVariants };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/card/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,iBAAS,IAAI,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAWjE;AAED,iBAAS,UAAU,CAAC,EA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AAC,cAAc,CAAC,KAAK,CAAC,qBAQvE;AAED,KAAK,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG;IACjD;;;;OAIG;IACH,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;CAC7C,CAAA;AAED,iBAAS,SAAS,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,IAAW,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,qBAQ1E;AAED,iBAAS,eAAe,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,qBAQ1E;AAED,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAWvE;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAQxE;AAED,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAQvE;AAED,OAAO,EACL,IAAI,EACJ,UAAU,EACV,UAAU,EACV,SAAS,EACT,UAAU,EACV,eAAe,EACf,WAAW,EACZ,CAAA"}
@@ -7,7 +7,7 @@ function CardHeader({ className, ...props }) {
7
7
  return (_jsx("div", { "data-slot": "card-header", className: cn('flex flex-col space-y-1.5', className), ...props }));
8
8
  }
9
9
  function CardTitle({ className, as: Comp = 'h3', ...props }) {
10
- return (_jsx(Comp, { "data-slot": "card-title", className: cn('text-sm leading-none font-medium tracking-tight', className), ...props }));
10
+ return (_jsx(Comp, { "data-slot": "card-title", className: cn('text-sm leading-none font-medium', className), ...props }));
11
11
  }
12
12
  function CardDescription({ className, ...props }) {
13
13
  return (_jsx("p", { "data-slot": "card-description", className: cn('text-muted-foreground text-sm', className), ...props }));
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/dropdown-menu/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,qBAAqB,MAAM,+BAA+B,CAAA;AAKtE,iBAAS,YAAY,CAAC,EACpB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,IAAI,CAAC,qBAEzD;AAED,iBAAS,kBAAkB,CAAC,EAC1B,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,MAAM,CAAC,qBAI3D;AAED,iBAAS,mBAAmB,CAAC,EAC3B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,OAAO,CAAC,qBAW5D;AAED,iBAAS,mBAAmB,CAAC,EAC3B,SAAS,EACT,UAAc,EACd,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,OAAO,CAAC,qBAc5D;AAED,iBAAS,iBAAiB,CAAC,EACzB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,KAAK,CAAC,qBAI1D;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,KAAK,EACL,OAAmB,EACnB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,IAAI,CAAC,GAAG;IAC3D,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,OAAO,CAAC,EAAE,SAAS,GAAG,aAAa,CAAA;CACpC,qBAaA;AAED,iBAAS,oBAAoB,CAAC,EAC5B,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,qBAc9B;A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EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,UAAU,CAAC,qBAW/D;AAED,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,wBAAwB,EACxB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACvB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/dropdown-menu/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,qBAAqB,MAAM,+BAA+B,CAAA;AAKtE,iBAAS,YAAY,CAAC,EACpB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,IAAI,CAAC,qBAEzD;AAED,iBAAS,kBAAkB,CAAC,EAC1B,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,MAAM,CAAC,qBAI3D;AAED,iBAAS,mBAAmB,CAAC,EAC3B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,OAAO,CAAC,qBAW5D;AAED,iBAAS,mBAAmB,CAAC,EAC3B,SAAS,EACT,UAAc,EACd,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,OAAO,CAAC,qBAc5D;AAED,iBAAS,iBAAiB,CAAC,EACzB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,KAAK,CAAC,qBAI1D;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,KAAK,EACL,OAAmB,EACnB,GAAG,KAAK,EACT,EAAE,KA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CAAC,GAAG,CAAC,qBAExD;AAED,iBAAS,sBAAsB,CAAC,EAC9B,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,UAAU,CAAC,GAAG;IACjE,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,qBAeA;AAED,iBAAS,sBAAsB,CAAC,EAC9B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,UAAU,CAAC,qBAW/D;AAED,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,wBAAwB,EACxB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACvB,CAAA"}
@@ -23,7 +23,10 @@ function DropdownMenuItem({ className, inset, variant = 'default', ...props }) {
23
23
  return (_jsx(DropdownMenuPrimitive.Item, { "data-slot": "dropdown-menu-item", "data-inset": inset, "data-variant": variant, className: cn('focus:bg-shadcn-100 focus:text-accent-foreground text-muted-foreground relative flex cursor-pointer items-center gap-3 px-3 py-2 text-sm font-medium outline-hidden transition-colors select-none data-disabled:pointer-events-none data-disabled:opacity-50', className), ...props }));
24
24
  }
25
25
  function DropdownMenuItemIcon({ className, children, ...props }) {
26
- return (_jsx("span", { "data-slot": "dropdown-menu-item-icon", className: cn('text-shadcn-400', className), ...props, children: React.Children.map(React.Children.toArray(children), (child) => React.isValidElement(child)
26
+ return (_jsx("span", { "data-slot": "dropdown-menu-item-icon",
27
+ // A meaningful glyph inside an interactive item answers to the 3:1 floor
28
+ // of SC 1.4.11. base/400 reads 2.56:1 on the popover surface in light.
29
+ className: cn('text-muted-foreground', className), ...props, children: React.Children.map(React.Children.toArray(children), (child) => React.isValidElement(child)
27
30
  ? React.cloneElement(child, { size: 16 })
28
31
  : child) }));
29
32
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/field/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAGjE,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAG7C,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,UAAU,CAAC,+BAW1E;AAED,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,OAAkB,EAClB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAA;CAAE,+BAYnE;AAED,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,+BAWvE;AAED,QAAA,MAAM,aAAa;;8EAgBlB,CAAA;AAED,iBAAS,KAAK,CAAC,EACb,SAAS,EACT,WAAwB,EACxB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,YAAY,CAAC,OAAO,aAAa,CAAC,+BAUlE;AAED,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,+BAWzE;AAED,iBAAS,UAAU,CAAC,EAClB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,KAAK,CAAC,+BAYpC;AAED,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,+BAWvE;AAED,iBAAS,gBAAgB,CAAC,EAAE,SAA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7 +14,7 @@ function FieldLegend({ className, variant = 'legend', ...props }) {
14
14
  function FieldGroup({ className, ...props }) {
15
15
  return (_jsx("div", { "data-slot": "field-group", className: cn('group/field-group @container/field-group flex w-full flex-col gap-5 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4', className), ...props }));
16
16
  }
17
- const fieldVariants = cva('data-[invalid=true]:text-destructive gap-2 group/field flex w-full', {
17
+ const fieldVariants = cva('data-[invalid=true]:text-system-error-h1a gap-2 group/field flex w-full', {
18
18
  variants: {
19
19
  orientation: {
20
20
  vertical: 'flex-col [&>*]:w-full [&>.sr-only]:w-auto',
@@ -63,6 +63,9 @@ function FieldError({ className, children, errors, ...props }) {
63
63
  if (!content) {
64
64
  return null;
65
65
  }
66
- return (_jsx("div", { role: "alert", "data-slot": "field-error", className: cn('text-destructive text-sm font-normal', className), ...props, children: content }));
66
+ return (_jsx("div", { role: "alert", "data-slot": "field-error",
67
+ // The error TEXT token, not `text-destructive`: that is the badge/fill
68
+ // family and measures 3.80:1 as ink on the dark card, under AA.
69
+ className: cn('text-system-error-h1a text-sm font-normal', className), ...props, children: content }));
67
70
  }
68
71
  export { Field, FieldLabel, FieldDescription, FieldError, FieldGroup, FieldLegend, FieldSeparator, FieldSet, FieldContent, FieldTitle };
@@ -195,6 +195,6 @@ export const FileUpload = React.forwardRef(function FileUpload({ accept, maxSize
195
195
  // Don't bubble to the zone's openPicker and re-open the dialog.
196
196
  event.stopPropagation();
197
197
  clear();
198
- }, children: _jsx(X, { className: "size-4", "aria-hidden": "true" }) })] })) : (_jsxs("span", { className: "text-muted-foreground", children: [_jsx("span", { className: "text-foreground font-medium", children: "Choose a file" }), ' ', "or drag and drop"] }))] }), error ? (_jsx("p", { id: errorId, role: "alert", className: "text-destructive text-xs font-medium", children: errorMessage(error) })) : null] }));
198
+ }, children: _jsx(X, { className: "size-4", "aria-hidden": "true" }) })] })) : (_jsxs("span", { className: "text-muted-foreground", children: [_jsx("span", { className: "text-foreground font-medium", children: "Choose a file" }), ' ', "or drag and drop"] }))] }), error ? (_jsx("p", { id: errorId, role: "alert", className: "text-system-error-h1a text-xs font-medium", children: errorMessage(error) })) : null] }));
199
199
  });
200
200
  FileUpload.displayName = 'FileUpload';
@@ -1 +1 @@
1
- {"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/form.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,cAAc,MAAM,uBAAuB,CAAA;AAEvD,OAAO,EAEL,eAAe,EACf,SAAS,EACT,WAAW,EAGZ,MAAM,iBAAiB,CAAA;AAKxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAS9D,QAAA,MAAM,IAAI,4MAAe,CAAA;AAazB,QAAA,MAAM,SAAS,GACb,YAAY,SAAS,WAAW,GAAG,WAAW,EAC9C,KAAK,SAAS,SAAS,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC,YAAY,CAAC,EAC/D,cAEC,eAAe,CAAC,YAAY,EAAE,KAAK,CAAC,sBAMtC,CAAA;AAED,QAAA,MAAM,YAAY;;;;;;;;;;;;CAyBjB,CAAA;AAWD,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG;IACjE,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,QAAA,MAAM,QAAQ;eAHD,OAAO;wCAanB,CAAA;AAGD,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,wBAAwB,CACzD,OAAO,cAAc,CAAC,IAAI,CAC3B,GAAG;IACF,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CACxB,CAAA;AAED,QAAA,MAAM,SAAS;YAHL,KAAK,CAAC,SAAS;0CA2BvB,CAAA;AAGF,eAAO,MAAM,WAAW,GAAI,yBAAyB,oBAAoB,sBASxE,CAAA;AAED,QAAA,MAAM,WAAW;;gFAmBf,CAAA;AAGF,Q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;gFAmBf,CAAA;AAGF,QAAA,MAAM,eAAe,yHAcnB,CAAA;AAGF,QAAA,MAAM,WAAW,yHAuBf,CAAA;AAGF,OAAO,EACL,YAAY,EACZ,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,WAAW,EACX,eAAe,EACf,WAAW,EACX,SAAS,EACV,CAAA"}
@@ -42,7 +42,10 @@ const FormItem = React.forwardRef(({ className, required, ...props }, ref) => {
42
42
  FormItem.displayName = 'FormItem';
43
43
  const FormLabel = React.forwardRef(({ className, extra, children, ...props }, ref) => {
44
44
  const { required, error, formItemId } = useFormField();
45
- return (_jsxs(Label, { ref: ref, className: cn('text-muted-foreground flex justify-between text-sm font-semibold', error && 'text-destructive', className), htmlFor: formItemId, ...props, children: [_jsxs("span", { children: [children, required ? ' *' : ''] }), extra] }));
45
+ return (_jsxs(Label, { ref: ref, className: cn('text-muted-foreground flex justify-between text-sm font-semibold',
46
+ // The error TEXT token, matching FormMessage below: `--destructive`
47
+ // is the badge/fill family and reads 3.80:1 as ink on the dark card.
48
+ error && 'text-system-error-h1a', className), htmlFor: formItemId, ...props, children: [_jsxs("span", { children: [children, required ? ' *' : ''] }), extra] }));
46
49
  });
47
50
  FormLabel.displayName = 'FormLabel';
48
51
  export const FormTooltip = ({ children, ...others }) => (_jsx(TooltipProvider, { ...others, children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx(HelpCircle, { className: "text-container-text ml-2 h-4 w-4" }) }), _jsx(TooltipContent, { children: children })] }) }));
@@ -55,7 +58,7 @@ const FormControl = React.forwardRef(({ ...props }, ref) => {
55
58
  FormControl.displayName = 'FormControl';
56
59
  const FormDescription = React.forwardRef(({ className, ...props }, ref) => {
57
60
  const { formDescriptionId } = useFormField();
58
- return (_jsx("p", { ref: ref, id: formDescriptionId, className: cn('text-shadcn-400 text-xs font-medium', className), ...props }));
61
+ return (_jsx("p", { ref: ref, id: formDescriptionId, className: cn('text-muted-foreground text-xs font-medium', className), ...props }));
59
62
  });
60
63
  FormDescription.displayName = 'FormDescription';
61
64
  const FormMessage = React.forwardRef(({ className, children, ...props }, ref) => {
@@ -38,7 +38,7 @@ export const MultipleSelectTrigger = React.forwardRef(({ className, children, re
38
38
  setOpen(false);
39
39
  inputRef.current?.blur();
40
40
  });
41
- return (_jsxs("div", { ref: _ref, className: cn('bg-background ring-offset-background placeholder:text-shadcn-400 focus:ring-ring border-shadcn-400 flex flex-row rounded-md border text-sm focus:ring-2 focus:ring-offset-0 focus:outline-hidden focus-visible:outline-hidden md:text-sm [&>span]:line-clamp-1', {
41
+ return (_jsxs("div", { ref: _ref, className: cn('bg-background ring-offset-background placeholder:text-input-placeholder focus:ring-ring border-input-border flex flex-row rounded-md border text-sm focus:ring-2 focus:ring-offset-0 focus:outline-hidden focus-visible:outline-hidden md:text-sm [&>span]:line-clamp-1', {
42
42
  'h-10': value.length === 0,
43
43
  'min-h-10': value.length > 0,
44
44
  'cursor-text': !disabled && !readOnly && value.length !== 0,
@@ -77,7 +77,7 @@ export const MultipleSelectValue = React.forwardRef(({ className, ...props }, re
77
77
  value?.map((value) => (_jsxs(Badge, { variant: "secondary", className: cn('data-disabled:bg-muted-foreground data-fixed:bg-muted-foreground data-disabled:text-muted data-fixed:text-muted data-disabled:hover:bg-muted-foreground data-fixed:hover:bg-muted-foreground'), children: [showValue ? value : options[value], _jsx("button", { type: "button", className: cn('ring-offset-background focus:ring-ring ml-1 rounded-full outline-hidden focus:ring-2 focus:ring-offset-2', disabled && 'hidden'), children: _jsx(X, { className: "text-muted-foreground hover:text-foreground h-3 w-3", onClick: (event) => {
78
78
  event.stopPropagation();
79
79
  handleChange(value);
80
- } }) })] }, value))), _jsx(CommandPrimitive.Input, { ...props, ref: inputRef, disabled: disabled, className: cn('placeholder:text-muted-foreground bg-transparent outline-hidden focus:outline-hidden disabled:cursor-not-allowed disabled:opacity-50 disabled:placeholder:opacity-0', className) })] }));
80
+ } }) })] }, value))), _jsx(CommandPrimitive.Input, { ...props, ref: inputRef, disabled: disabled, className: cn('placeholder:text-input-placeholder bg-transparent outline-hidden focus:outline-hidden disabled:cursor-not-allowed disabled:opacity-50 disabled:placeholder:opacity-0', className) })] }));
81
81
  });
82
82
  MultipleSelectValue.displayName = 'MultipleSelectValue';
83
83
  export const MultipleSelectEmpty = React.forwardRef(({ className, ...props }, forwardedRef) => {
@@ -3,6 +3,20 @@ import * as ProgressPrimitive from '@radix-ui/react-progress';
3
3
  type ProgressProps = React.ComponentProps<typeof ProgressPrimitive.Root> & {
4
4
  indicatorColor?: string;
5
5
  };
6
- declare function Progress({ className, value, indicatorColor, ...props }: ProgressProps): React.JSX.Element;
6
+ /**
7
+ * `value` and `max` are Radix's own props, so the bar reports `aria-valuenow` /
8
+ * `aria-valuemax` and flips `data-state` between `loading` and `complete`.
9
+ * Omitting `value`, or passing `null`, is Radix's indeterminate state and draws
10
+ * an empty track.
11
+ *
12
+ * Both numbers are BOUNDED BEFORE THE ROOT SEES THEM, so the drawn width and
13
+ * the announced value can never disagree. Radix accepts a value only inside
14
+ * `[0, max]`: hand it one outside and the root drops `aria-valuenow`, sticks
15
+ * `data-state` on `indeterminate` and logs an error, while the indicator here
16
+ * goes on drawing the clamped bar. Substituting 100 for a non-positive max is
17
+ * Radix's own fallback, and is also what keeps a `max` of 0 from dividing by
18
+ * zero.
19
+ */
20
+ declare function Progress({ className, value, max, indicatorColor, ...props }: ProgressProps): React.JSX.Element;
7
21
  export { Progress };
8
22
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/progress/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,iBAAiB,MAAM,0BAA0B,CAAA;AAI7D,KAAK,aAAa,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,iBAAiB,CAAC,IAAI,CAAC,GAAG;IACzE,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,CAAA;AAED,iBAAS,QAAQ,CAAC,EAChB,SAAS,EACT,KAAK,EACL,cAA6B,EAC7B,GAAG,KAAK,EACT,EAAE,aAAa,qBAiBf;AAED,OAAO,EAAE,QAAQ,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/progress/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,iBAAiB,MAAM,0BAA0B,CAAA;AAI7D,KAAK,aAAa,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,iBAAiB,CAAC,IAAI,CAAC,GAAG;IACzE,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,iBAAS,QAAQ,CAAC,EAChB,SAAS,EACT,KAAK,EACL,GAAG,EACH,cAA6B,EAC7B,GAAG,KAAK,EACT,EAAE,aAAa,qBA6Bf;AAED,OAAO,EAAE,QAAQ,EAAE,CAAA"}
@@ -2,7 +2,30 @@
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import * as ProgressPrimitive from '@radix-ui/react-progress';
4
4
  import { cn } from '../../../lib/utils.js';
5
- function Progress({ className, value, indicatorColor = 'bg-primary', ...props }) {
6
- return (_jsx(ProgressPrimitive.Root, { "data-slot": "progress", className: cn('bg-primary/20 relative h-4 w-full overflow-hidden rounded-full', className), ...props, children: _jsx(ProgressPrimitive.Indicator, { "data-slot": "progress-indicator", className: cn('h-full w-full flex-1 transition-all', indicatorColor), style: { transform: `translateX(-${100 - (value || 0)}%)` } }) }));
5
+ /**
6
+ * `value` and `max` are Radix's own props, so the bar reports `aria-valuenow` /
7
+ * `aria-valuemax` and flips `data-state` between `loading` and `complete`.
8
+ * Omitting `value`, or passing `null`, is Radix's indeterminate state and draws
9
+ * an empty track.
10
+ *
11
+ * Both numbers are BOUNDED BEFORE THE ROOT SEES THEM, so the drawn width and
12
+ * the announced value can never disagree. Radix accepts a value only inside
13
+ * `[0, max]`: hand it one outside and the root drops `aria-valuenow`, sticks
14
+ * `data-state` on `indeterminate` and logs an error, while the indicator here
15
+ * goes on drawing the clamped bar. Substituting 100 for a non-positive max is
16
+ * Radix's own fallback, and is also what keeps a `max` of 0 from dividing by
17
+ * zero.
18
+ */
19
+ function Progress({ className, value, max, indicatorColor = 'bg-primary', ...props }) {
20
+ const scale = Number.isFinite(max) && max > 0 ? max : 100;
21
+ // Bound against `scale`, not against the rejected `max`: with `max={0}` the
22
+ // scale is already 100, and clamping to 0 would report a finished bar empty.
23
+ // Non-finite values are indeterminate, matching Radix without producing an
24
+ // invalid CSS transform.
25
+ const bounded = Number.isFinite(value)
26
+ ? Math.min(scale, Math.max(0, value))
27
+ : null;
28
+ const percent = ((bounded ?? 0) / scale) * 100;
29
+ return (_jsx(ProgressPrimitive.Root, { "data-slot": "progress", value: bounded, max: scale, className: cn('bg-primary/20 relative h-4 w-full overflow-hidden rounded-full', className), ...props, children: _jsx(ProgressPrimitive.Indicator, { "data-slot": "progress-indicator", className: cn('h-full w-full flex-1 transition-all', indicatorColor), style: { transform: `translateX(-${100 - percent}%)` } }) }));
7
30
  }
8
31
  export { Progress };
@@ -1 +1 @@
1
- {"version":3,"file":"sidebar-expand-button.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/sidebar/sidebar-expand-button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AAYzB,KAAK,wBAAwB,GAAG;IAC9B;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,eAAO,MAAM,mBAAmB,GAAI,aAAa,wBAAwB,sBA6CxE,CAAA"}
1
+ {"version":3,"file":"sidebar-expand-button.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/sidebar/sidebar-expand-button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AAYzB,KAAK,wBAAwB,GAAG;IAC9B;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,eAAO,MAAM,mBAAmB,GAAI,aAAa,wBAAwB,sBAyDxE,CAAA"}
@@ -8,5 +8,21 @@ import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '../../
8
8
  import { IconButton } from '../icon-button/index.js';
9
9
  export const SidebarExpandButton = ({ tooltip }) => {
10
10
  const { isCollapsed, toggleSidebar } = useSidebar();
11
- return (_jsxs(React.Fragment, { children: [!isCollapsed && (_jsx("div", { "data-slot": "sidebar-expand-button", className: "border-border bg-card flex w-full", children: _jsx("div", { className: "absolute right-[-20px] bottom-4", children: _jsx(IconButton, { variant: "secondary", rounded: true, onClick: toggleSidebar, "aria-label": tooltip || 'Collapse sidebar', "aria-expanded": true, children: _jsx(PanelLeftClose, { className: "text-shadcn-400" }) }) }) })), isCollapsed && (_jsx(SidebarFooter, { children: _jsx(TooltipProvider, { children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { className: "group/expand-button text-shadcn-400 hover:bg-accent rounded-sm bg-transparent p-2", onClick: toggleSidebar, "aria-label": tooltip || 'Expand sidebar', "aria-expanded": false, children: _jsx(PanelRightClose, { className: "group-hover/expand-button:text-white dark:text-white" }) }), _jsx(TooltipContent, { side: "right", children: tooltip || 'Expand' })] }) }) }))] }));
11
+ return (_jsxs(React.Fragment, { children: [!isCollapsed && (_jsx("div", { "data-slot": "sidebar-expand-button", className: "border-border bg-card flex w-full", children: _jsx("div", { className: "absolute right-[-20px] bottom-4", children: _jsx(IconButton, { variant: "secondary", rounded: true, onClick: toggleSidebar, "aria-label": tooltip || 'Collapse sidebar', "aria-expanded": true, children: _jsx(PanelLeftClose, { className: "text-muted-foreground" }) }) }) })), isCollapsed && (_jsx(SidebarFooter, { children: _jsx(TooltipProvider, { children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger
12
+ // `hover:text-accent-foreground` on the TRIGGER, not only on
13
+ // the glyph below. The base ink here used to be base/400, which
14
+ // no rule paired with anything; now that it is the muted token,
15
+ // it is the ink anything inside this trigger inherits, and the
16
+ // muted token reads 1.07:1 on sunglow in dark. The glyph
17
+ // overrides it today, so this pairs the fill for whatever the
18
+ // trigger holds next.
19
+ , {
20
+ // `hover:text-accent-foreground` on the TRIGGER, not only on
21
+ // the glyph below. The base ink here used to be base/400, which
22
+ // no rule paired with anything; now that it is the muted token,
23
+ // it is the ink anything inside this trigger inherits, and the
24
+ // muted token reads 1.07:1 on sunglow in dark. The glyph
25
+ // overrides it today, so this pairs the fill for whatever the
26
+ // trigger holds next.
27
+ className: "group/expand-button text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded-sm bg-transparent p-2", onClick: toggleSidebar, "aria-label": tooltip || 'Expand sidebar', "aria-expanded": false, children: _jsx(PanelRightClose, { className: "group-hover/expand-button:text-accent-foreground dark:text-white" }) }), _jsx(TooltipContent, { side: "right", children: tooltip || 'Expand' })] }) }) }))] }));
12
28
  };
@@ -6,6 +6,21 @@ export type TooltipProps = React.ComponentProps<typeof TooltipPrimitive.Root> &
6
6
  };
7
7
  declare function Tooltip({ open: _open, onOpenChange, disabled, ...props }: TooltipProps): React.JSX.Element;
8
8
  declare function TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>): React.JSX.Element;
9
+ /**
10
+ * The fill is a RAW palette step, not a theme token: `--color-shadcn-600` is a
11
+ * flat hex, so an inverted tooltip stays #27272A under both themes. The ink has
12
+ * to be theme-fixed too, which rules out `--primary-foreground` and
13
+ * `--background`: both invert, and both land on 1.00:1 against this fill in
14
+ * dark.
15
+ *
16
+ * base/400 was not unreadable here (5.81:1 on this fill; the 2.56:1 figure that
17
+ * class earns elsewhere is against a LIGHT ground, which this is not). It moved
18
+ * one step to base/300 because base/400 is banned kit-wide in
19
+ * `__tests__/ink-classes.test.ts`: its only safe ground is a fixed-dark fill,
20
+ * and that narrow exception had already leaked into eight slots that were not
21
+ * one. base/300 reads 10.08:1 here, and keeps this line quieter than the
22
+ * `text-white` a consumer puts beside it (`page-header/index.tsx:226`).
23
+ */
9
24
  declare function TooltipContent({ className, sideOffset, children, ...props }: React.ComponentProps<typeof TooltipPrimitive.Content>): React.JSX.Element;
10
25
  export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
11
26
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/tooltip/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAA;AAI3D,iBAAS,eAAe,CAAC,EACvB,aAAiB,EACjB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,QAAQ,CAAC,qBAQxD;AAED,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,cAAc,CAC7C,OAAO,gBAAgB,CAAC,IAAI,CAC7B,GAAG;IACF,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,iBAAS,OAAO,CAAC,EACf,IAAI,EAAE,KAAK,EACX,YAAY,EACZ,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,YAAY,qBAwBd;AAED,iBAAS,cAAc,CAAC,EACtB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,OAAO,CAAC,qBAEvD;AAED,iBAAS,cAAc,CAAC,EACtB,SAAS,EACT,UAAc,EACd,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,OAAO,CAAC,qBAiBvD;AAED,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/tooltip/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,K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