@lerianstudio/sindarian-ui 1.3.0-beta.2 → 1.3.0-beta.4

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 (123) hide show
  1. package/dist/components/card/account-card/index.d.ts.map +1 -1
  2. package/dist/components/card/account-card/index.js +2 -2
  3. package/dist/components/dialog/confirmation-dialog/index.d.ts +10 -2
  4. package/dist/components/dialog/confirmation-dialog/index.d.ts.map +1 -1
  5. package/dist/components/dialog/confirmation-dialog/index.js +72 -7
  6. package/dist/components/page-header/index.d.ts +14 -2
  7. package/dist/components/page-header/index.d.ts.map +1 -1
  8. package/dist/components/page-header/index.js +4 -4
  9. package/dist/components/ui/accordion/index.js +1 -1
  10. package/dist/components/ui/alert/index.d.ts +1 -1
  11. package/dist/components/ui/alert-dialog/index.d.ts +5 -1
  12. package/dist/components/ui/alert-dialog/index.d.ts.map +1 -1
  13. package/dist/components/ui/alert-dialog/index.js +2 -2
  14. package/dist/components/ui/autocomplete/index.js +2 -2
  15. package/dist/components/ui/badge/index.d.ts +8 -1
  16. package/dist/components/ui/badge/index.d.ts.map +1 -1
  17. package/dist/components/ui/badge/index.js +9 -1
  18. package/dist/components/ui/button/index.d.ts +2 -2
  19. package/dist/components/ui/button/index.d.ts.map +1 -1
  20. package/dist/components/ui/button/index.js +2 -1
  21. package/dist/components/ui/button/styles.css +17 -4
  22. package/dist/components/ui/dialog/styles.css +3 -3
  23. package/dist/components/ui/dropdown-menu/index.js +2 -2
  24. package/dist/components/ui/hover-card/index.js +1 -1
  25. package/dist/components/ui/input/adornment.d.ts +1 -1
  26. package/dist/components/ui/loading-button/index.js +1 -1
  27. package/dist/components/ui/multiple-select/index.js +1 -1
  28. package/dist/components/ui/otp-input/index.js +1 -1
  29. package/dist/components/ui/paper-collapsible/index.js +1 -1
  30. package/dist/components/ui/popover/index.js +1 -1
  31. package/dist/components/ui/select/styles.css +1 -1
  32. package/dist/components/ui/sheet/index.d.ts +1 -1
  33. package/dist/components/ui/sheet/index.js +2 -2
  34. package/dist/components/ui/sidebar/sidebar-expand-button.d.ts +5 -0
  35. package/dist/components/ui/sidebar/sidebar-expand-button.d.ts.map +1 -1
  36. package/dist/components/ui/sidebar/sidebar-expand-button.js +1 -1
  37. package/dist/components/ui/sidebar/sidebar-item-collapsible.js +1 -1
  38. package/dist/components/ui/skeleton/index.js +1 -1
  39. package/dist/components/ui/tooltip/index.js +1 -1
  40. package/dist/domain/blotter/index.d.ts +7 -1
  41. package/dist/domain/blotter/index.d.ts.map +1 -1
  42. package/dist/domain/blotter/index.js +7 -3
  43. package/dist/domain/delinquency-aging/aging-buckets.d.ts +4 -1
  44. package/dist/domain/delinquency-aging/aging-buckets.d.ts.map +1 -1
  45. package/dist/domain/delinquency-aging/aging-buckets.js +7 -2
  46. package/dist/domain/delinquency-aging/index.d.ts +11 -1
  47. package/dist/domain/delinquency-aging/index.d.ts.map +1 -1
  48. package/dist/domain/delinquency-aging/index.js +7 -3
  49. package/dist/domain/figure/index.d.ts +13 -6
  50. package/dist/domain/figure/index.d.ts.map +1 -1
  51. package/dist/domain/figure/index.js +1 -0
  52. package/dist/domain/section-label/index.d.ts +7 -1
  53. package/dist/domain/section-label/index.d.ts.map +1 -1
  54. package/dist/domain/section-label/index.js +6 -2
  55. package/dist/enterprise/data-table/index.d.ts +13 -1
  56. package/dist/enterprise/data-table/index.d.ts.map +1 -1
  57. package/dist/enterprise/data-table/index.js +7 -3
  58. package/dist/enterprise/search-input/index.d.ts +7 -1
  59. package/dist/enterprise/search-input/index.d.ts.map +1 -1
  60. package/dist/enterprise/search-input/index.js +2 -2
  61. package/dist/esm/components/card/account-card/index.d.ts.map +1 -1
  62. package/dist/esm/components/card/account-card/index.js +2 -2
  63. package/dist/esm/components/dialog/confirmation-dialog/index.d.ts +10 -2
  64. package/dist/esm/components/dialog/confirmation-dialog/index.d.ts.map +1 -1
  65. package/dist/esm/components/dialog/confirmation-dialog/index.js +39 -7
  66. package/dist/esm/components/page-header/index.d.ts +14 -2
  67. package/dist/esm/components/page-header/index.d.ts.map +1 -1
  68. package/dist/esm/components/page-header/index.js +4 -4
  69. package/dist/esm/components/ui/accordion/index.js +1 -1
  70. package/dist/esm/components/ui/alert/index.d.ts +1 -1
  71. package/dist/esm/components/ui/alert-dialog/index.d.ts +5 -1
  72. package/dist/esm/components/ui/alert-dialog/index.d.ts.map +1 -1
  73. package/dist/esm/components/ui/alert-dialog/index.js +2 -2
  74. package/dist/esm/components/ui/autocomplete/index.js +2 -2
  75. package/dist/esm/components/ui/badge/index.d.ts +8 -1
  76. package/dist/esm/components/ui/badge/index.d.ts.map +1 -1
  77. package/dist/esm/components/ui/badge/index.js +9 -1
  78. package/dist/esm/components/ui/button/index.d.ts +2 -2
  79. package/dist/esm/components/ui/button/index.d.ts.map +1 -1
  80. package/dist/esm/components/ui/button/index.js +2 -1
  81. package/dist/esm/components/ui/dropdown-menu/index.js +2 -2
  82. package/dist/esm/components/ui/hover-card/index.js +1 -1
  83. package/dist/esm/components/ui/input/adornment.d.ts +1 -1
  84. package/dist/esm/components/ui/loading-button/index.js +1 -1
  85. package/dist/esm/components/ui/multiple-select/index.js +1 -1
  86. package/dist/esm/components/ui/otp-input/index.js +1 -1
  87. package/dist/esm/components/ui/paper-collapsible/index.js +1 -1
  88. package/dist/esm/components/ui/popover/index.js +1 -1
  89. package/dist/esm/components/ui/sheet/index.d.ts +1 -1
  90. package/dist/esm/components/ui/sheet/index.js +2 -2
  91. package/dist/esm/components/ui/sidebar/sidebar-expand-button.d.ts +5 -0
  92. package/dist/esm/components/ui/sidebar/sidebar-expand-button.d.ts.map +1 -1
  93. package/dist/esm/components/ui/sidebar/sidebar-expand-button.js +1 -1
  94. package/dist/esm/components/ui/sidebar/sidebar-item-collapsible.js +1 -1
  95. package/dist/esm/components/ui/skeleton/index.js +1 -1
  96. package/dist/esm/components/ui/tooltip/index.js +1 -1
  97. package/dist/esm/domain/blotter/index.d.ts +7 -1
  98. package/dist/esm/domain/blotter/index.d.ts.map +1 -1
  99. package/dist/esm/domain/blotter/index.js +7 -3
  100. package/dist/esm/domain/delinquency-aging/aging-buckets.d.ts +4 -1
  101. package/dist/esm/domain/delinquency-aging/aging-buckets.d.ts.map +1 -1
  102. package/dist/esm/domain/delinquency-aging/aging-buckets.js +7 -2
  103. package/dist/esm/domain/delinquency-aging/index.d.ts +11 -1
  104. package/dist/esm/domain/delinquency-aging/index.d.ts.map +1 -1
  105. package/dist/esm/domain/delinquency-aging/index.js +7 -3
  106. package/dist/esm/domain/figure/index.d.ts +13 -6
  107. package/dist/esm/domain/figure/index.d.ts.map +1 -1
  108. package/dist/esm/domain/figure/index.js +1 -0
  109. package/dist/esm/domain/section-label/index.d.ts +7 -1
  110. package/dist/esm/domain/section-label/index.d.ts.map +1 -1
  111. package/dist/esm/domain/section-label/index.js +6 -2
  112. package/dist/esm/enterprise/data-table/index.d.ts +13 -1
  113. package/dist/esm/enterprise/data-table/index.d.ts.map +1 -1
  114. package/dist/esm/enterprise/data-table/index.js +8 -4
  115. package/dist/esm/enterprise/search-input/index.d.ts +7 -1
  116. package/dist/esm/enterprise/search-input/index.d.ts.map +1 -1
  117. package/dist/esm/enterprise/search-input/index.js +2 -2
  118. package/dist/esm/lib/utils.d.ts.map +1 -1
  119. package/dist/esm/lib/utils.js +27 -1
  120. package/dist/globals.css +70 -58
  121. package/dist/lib/utils.d.ts.map +1 -1
  122. package/dist/lib/utils.js +27 -1
  123. package/package.json +1 -1
@@ -84,7 +84,7 @@ export function sumBucketTotals(buckets, scale) {
84
84
  const total = sumMinor(buckets.map((b) => b.total), scale);
85
85
  return total === null ? null : minorToDecimal(total, scale);
86
86
  }
87
- export function AgingBuckets({ buckets, currency, locale, showTotal = false, labels, className }) {
87
+ export function AgingBuckets({ buckets, currency, locale, showTotal = false, labels, healthyTone = 'success', className }) {
88
88
  const countLabel = labels?.count ?? 'Itens';
89
89
  const totalLabel = labels?.total ?? 'Total';
90
90
  const grandTotalLabel = labels?.grandTotal ?? 'Total geral';
@@ -97,7 +97,12 @@ export function AgingBuckets({ buckets, currency, locale, showTotal = false, lab
97
97
  const grandTotal = showTotal ? sumBucketTotals(buckets, scale) : null;
98
98
  return (_jsxs("div", { className: cn('flex flex-col', className), children: [_jsx("ul", { className: "flex flex-col", children: buckets.map((bucket, i) => {
99
99
  const band = bucketBand(i, buckets.length);
100
- const { Icon, tint, word } = BAND[band];
100
+ const { Icon, word } = BAND[band];
101
+ // `ink` retones ONLY the healthy band — the escalated bands keep their
102
+ // alert and credit-red tints, which are the whole point of the scale.
103
+ const tint = healthyTone === 'ink' && band === 'current'
104
+ ? 'text-foreground'
105
+ : BAND[band].tint;
101
106
  // Shallow merge: an unlisted band keeps its pt-BR default.
102
107
  const bandWord = labels?.bands?.[band] ?? word;
103
108
  return (_jsxs("li", { className: "border-border flex items-center gap-3 border-b py-2.5 last:border-b-0", children: [_jsx(Icon, { "aria-hidden": true, className: cn('size-4 shrink-0', tint) }), _jsxs("span", { className: "sr-only", children: [bandWord, ": "] }), _jsx("span", { className: cn(LABEL_VOICE_CLASS, 'text-foreground min-w-0 flex-1 tracking-normal normal-case'), children: bucket.label }), _jsxs("span", { className: "flex shrink-0 flex-col items-end leading-none", children: [_jsx(Figure, { size: "row", className: "text-foreground", children: formatCount(bucket.count, locale) }), _jsx("span", { className: cn(LABEL_VOICE_CLASS, 'mt-1'), children: countLabel })] }), _jsxs("span", { className: "flex w-32 shrink-0 flex-col items-end leading-none sm:w-40", children: [_jsx(Figure, { size: "row", className: cn(band === 'overdue' && 'text-credit'), children: _jsx(MoneyText, { amount: bucket.total, currency: currency, fractionDigits: scale, locale: locale, signColor: false }) }), _jsx("span", { className: cn(LABEL_VOICE_CLASS, 'mt-1'), children: totalLabel })] })] }, `${bucket.label}-${i}`));
@@ -65,7 +65,17 @@ export interface DelinquencyAgingProps {
65
65
  breach?: number;
66
66
  /** Render the money-math-exact grand total row under the distribution. */
67
67
  showTotal?: boolean;
68
+ /**
69
+ * Tint of the healthy band — the low delinquency rate AND the `current`
70
+ * aging bucket. `'success'` (default) is the ambient green; `'ink'` retones
71
+ * both to `text-foreground`, which is the Ledger canon for a healthy-but-
72
+ * nonzero book: green reads as "achievement", and a book merely not in
73
+ * arrears has achieved nothing. Scoped to the healthy band only — elevated,
74
+ * distressed and overdue keep their alert and credit-red tints, since the
75
+ * glyph + sr-only word (not the tint) are the load-bearing cue either way.
76
+ */
77
+ healthyTone?: 'success' | 'ink';
68
78
  className?: string;
69
79
  }
70
- export declare function DelinquencyAging({ buckets, currency, locale, rateLabel, rateBandLabels, emptyLabel, indeterminateLabel, bucketLabels, warn, breach, showTotal, className }: DelinquencyAgingProps): import("react").JSX.Element;
80
+ export declare function DelinquencyAging({ buckets, currency, locale, rateLabel, rateBandLabels, emptyLabel, indeterminateLabel, bucketLabels, warn, breach, showTotal, healthyTone, className }: DelinquencyAgingProps): import("react").JSX.Element;
71
81
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/domain/delinquency-aging/index.tsx"],"names":[],"mappings":"AAoDA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAEnD,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAKtE,YAAY,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAOpE;;wEAEwE;AACxE,MAAM,WAAW,iBAAkB,SAAQ,WAAW;IACpD,wEAAwE;IACxE,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED;oEACoE;AACpE,MAAM,WAAW,eAAe;IAC9B,sEAAsE;IACtE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,iFAAiF;IACjF,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,6EAA6E;IAC7E,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB;;0EAEsE;IACtE,aAA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B;;;;;;;;OAQG;IACH,WAAW,CAAC,EAAE,SAAS,GAAG,KAAK,CAAA;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,OAAO,EACP,QAAQ,EACR,MAAM,EACN,SAA2B,EAC3B,cAAc,EACd,UAA2B,EAC3B,kBAAoC,EACpC,YAAY,EACZ,IAAW,EACX,MAAY,EACZ,SAAiB,EACjB,WAAuB,EACvB,SAAS,EACV,EAAE,qBAAqB,+BA+EvB"}
@@ -184,7 +184,7 @@ const RATE_BAND = {
184
184
  warn: { Icon: TriangleAlert, tint: 'text-system-alert', word: 'Elevada' },
185
185
  breach: { Icon: AlertOctagon, tint: 'text-credit', word: 'Em estresse' }
186
186
  };
187
- export function DelinquencyAging({ buckets, currency, locale, rateLabel = 'Inadimplência', rateBandLabels, emptyLabel = 'sem carteira', indeterminateLabel = 'indeterminada', bucketLabels, warn = 0.05, breach = 0.1, showTotal = false, className }) {
187
+ export function DelinquencyAging({ buckets, currency, locale, rateLabel = 'Inadimplência', rateBandLabels, emptyLabel = 'sem carteira', indeterminateLabel = 'indeterminada', bucketLabels, warn = 0.05, breach = 0.1, showTotal = false, healthyTone = 'success', className }) {
188
188
  // THIRD RAIL: the rate scale and the two totals come from money-math, never
189
189
  // float. The division below is of two exact BigInt-derived integers.
190
190
  const scale = currency ? minorDigitsOf(currency) : 2;
@@ -198,12 +198,16 @@ export function DelinquencyAging({ buckets, currency, locale, rateLabel = 'Inadi
198
198
  const band = hasRate && overdueMinor !== null && totalMinor !== null
199
199
  ? exactBand(overdueMinor, totalMinor, warn, breach)
200
200
  : 'low';
201
- const { Icon, tint, word } = RATE_BAND[band];
201
+ const { Icon, word } = RATE_BAND[band];
202
+ // `ink` retones ONLY the healthy band; `warn`/`breach` keep their alarm tints.
203
+ const tint = healthyTone === 'ink' && band === 'low'
204
+ ? 'text-foreground'
205
+ : RATE_BAND[band].tint;
202
206
  // Shallow merge: an unlisted band keeps its pt-BR default.
203
207
  const bandWord = rateBandLabels?.[band] ?? word;
204
208
  const distressed = band === 'breach';
205
209
  return (_jsxs("div", { className: cn('flex flex-col gap-4', className), children: [_jsxs("header", { className: "flex items-baseline justify-between gap-3", children: [_jsx(SectionLabel, { as: "span", children: rateLabel }), hasRate ? (_jsxs("span", {
206
210
  // A distressed rate is a credit alarm: announced the moment it
207
211
  // crosses the band, so assistive tech does not lean on the tint.
208
- role: distressed ? 'alert' : undefined, className: cn('inline-flex items-center gap-1.5', tint), children: [_jsx(Icon, { "aria-hidden": true, className: "size-4 shrink-0" }), _jsxs("span", { className: "sr-only", children: [bandWord, ": "] }), _jsx(Figure, { size: "row", className: tint, children: formatPercent(rate, { unit: 'ratio', locale }) })] })) : (_jsxs("span", { className: "text-muted-foreground inline-flex items-center gap-1.5", children: [_jsx("span", { className: cn(LABEL_VOICE_CLASS, 'tracking-normal normal-case'), children: indeterminate ? indeterminateLabel : emptyLabel }), _jsx(Figure, { size: "row", className: "text-muted-foreground", children: NO_VALUE })] }))] }), _jsx(AgingBuckets, { buckets: buckets, currency: currency, locale: locale, showTotal: showTotal, labels: bucketLabels })] }));
212
+ role: distressed ? 'alert' : undefined, className: cn('inline-flex items-center gap-1.5', tint), children: [_jsx(Icon, { "aria-hidden": true, className: "size-4 shrink-0" }), _jsxs("span", { className: "sr-only", children: [bandWord, ": "] }), _jsx(Figure, { size: "row", className: tint, children: formatPercent(rate, { unit: 'ratio', locale }) })] })) : (_jsxs("span", { className: "text-muted-foreground inline-flex items-center gap-1.5", children: [_jsx("span", { className: cn(LABEL_VOICE_CLASS, 'tracking-normal normal-case'), children: indeterminate ? indeterminateLabel : emptyLabel }), _jsx(Figure, { size: "row", className: "text-muted-foreground", children: NO_VALUE })] }))] }), _jsx(AgingBuckets, { buckets: buckets, currency: currency, locale: locale, showTotal: showTotal, labels: bucketLabels, healthyTone: healthyTone })] }));
209
213
  }
@@ -8,14 +8,21 @@
8
8
  * `FIGURE_CLASS` constants when composing className strings inline.
9
9
  *
10
10
  * Scale:
11
- * - hero : the dominant in-bar figure — text-4xl/5xl, semibold, tracking-tight
12
- * - panel : compliance / exposure — text-3xl, semibold, tracking-tight
13
- * - count : ledger count — text-2xl, semibold, tracking-tight
14
- * - row : inline / row figure — text-sm
15
- * - tick : ruler / micro figure — text-[10px], leading-none
11
+ * - hero : the dominant in-bar figure — text-4xl/5xl, semibold, tracking-tight
12
+ * - money-hero : hero-role MONEY figure — text-2xl/3xl, semibold, tracking-tight
13
+ * - panel : compliance / exposure — text-3xl, semibold, tracking-tight
14
+ * - count : ledger count — text-2xl, semibold, tracking-tight
15
+ * - row : inline / row figure — text-sm
16
+ * - tick : ruler / micro figure — text-[10px], leading-none
17
+ *
18
+ * `money-hero` is `hero`'s role at one step down the scale: a formatted BRL
19
+ * amount runs ~13 characters, which clips a three-column panel at 4xl/5xl, so
20
+ * consoles were hand-rolling `text-2xl lg:text-3xl` at the call site and losing
21
+ * the mono/tabular/weight invariants along the way. Same responsive shape as
22
+ * `hero`, same weight and tracking — only the two size steps differ.
16
23
  */
17
24
  import type { ElementType, ReactNode } from 'react';
18
- export type FigureSize = 'hero' | 'panel' | 'count' | 'row' | 'tick';
25
+ export type FigureSize = 'hero' | 'money-hero' | 'panel' | 'count' | 'row' | 'tick';
19
26
  /** Canonical class strings per figure size. The `tabular-nums` and `font-mono`
20
27
  * invariants live here so they can never be forgotten at a call site. */
21
28
  export declare const FIGURE_CLASS: Record<FigureSize, string>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/domain/figure/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAInD,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,CAAA;AAEpE;0EAC0E;AAC1E,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAMnD,CAAA;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,UAAU,CAAA;IAChB,QAAQ,EAAE,SAAS,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,8EAA8E;IAC9E,EAAE,CAAC,EAAE,WAAW,CAAA;CACjB,CAAA;AAED,wBAAgB,MAAM,CAAC,EACrB,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,EAAE,EAAE,GAAY,EACjB,EAAE,WAAW,+BAEb"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/domain/figure/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAInD,MAAM,MAAM,UAAU,GACpB,MAAM,GAAG,YAAY,GAAG,OAAO,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,CAAA;AAE5D;0EAC0E;AAC1E,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAQnD,CAAA;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,UAAU,CAAA;IAChB,QAAQ,EAAE,SAAS,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,8EAA8E;IAC9E,EAAE,CAAC,EAAE,WAAW,CAAA;CACjB,CAAA;AAED,wBAAgB,MAAM,CAAC,EACrB,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,EAAE,EAAE,GAAY,EACjB,EAAE,WAAW,+BAEb"}
@@ -4,6 +4,7 @@ import { cn } from '../../lib/utils.js';
4
4
  * invariants live here so they can never be forgotten at a call site. */
5
5
  export const FIGURE_CLASS = {
6
6
  hero: 'font-mono text-4xl font-semibold tracking-tight tabular-nums lg:text-5xl',
7
+ 'money-hero': 'font-mono text-2xl font-semibold tracking-tight tabular-nums lg:text-3xl',
7
8
  panel: 'font-mono text-3xl font-semibold tracking-tight tabular-nums',
8
9
  count: 'font-mono text-2xl font-semibold tracking-tight tabular-nums',
9
10
  row: 'font-mono text-sm tabular-nums',
@@ -16,6 +16,12 @@ export type SectionLabelProps = {
16
16
  className?: string;
17
17
  /** Render element. Defaults to `h2` (the ledger-sheet cell heading). */
18
18
  as?: ElementType;
19
+ /**
20
+ * Rule the label as an entry-section head (hairline double border, `pb-2`)
21
+ * and stamp `data-variant="ruled"`. Mirrors `EmptyState.ruled`. Default off,
22
+ * so an unruled label renders exactly as before.
23
+ */
24
+ ruled?: boolean;
19
25
  } & Omit<HTMLAttributes<HTMLElement>, 'children' | 'className'>;
20
- export declare function SectionLabel({ children, className, as: Tag, ...rest }: SectionLabelProps): import("react").JSX.Element;
26
+ export declare function SectionLabel({ children, className, as: Tag, ruled, ...rest }: SectionLabelProps): import("react").JSX.Element;
21
27
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/domain/section-label/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKnE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,SAAS,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,wEAAwE;IACxE,EAAE,CAAC,EAAE,WAAW,CAAA;CACjB,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,UAAU,GAAG,WAAW,CAAC,CAAA;AAE/D,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,SAAS,EACT,EAAE,EAAE,GAAU,EACd,GAAG,IAAI,EACR,EAAE,iBAAiB,+BAUnB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/domain/section-label/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAUnE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,SAAS,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,wEAAwE;IACxE,EAAE,CAAC,EAAE,WAAW,CAAA;IAChB;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,UAAU,GAAG,WAAW,CAAC,CAAA;AAE/D,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,SAAS,EACT,EAAE,EAAE,GAAU,EACd,KAAa,EACb,GAAG,IAAI,EACR,EAAE,iBAAiB,+BAcnB"}
@@ -1,10 +1,14 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { SECTION_LABEL_CLASS } from '../../lib/typography.js';
3
3
  import { cn } from '../../lib/utils.js';
4
- export function SectionLabel({ children, className, as: Tag = 'h2', ...rest }) {
4
+ /** The entry-section head treatment: a hairline double rule under the label.
5
+ * `border-border`, NOT the register head's ink — this is the quieter of the two
6
+ * head rules. Pinned here because ~20 call sites were restating it. */
7
+ const RULED_CLASS = 'border-b-[3px] border-double border-border pb-2';
8
+ export function SectionLabel({ children, className, as: Tag = 'h2', ruled = false, ...rest }) {
5
9
  // The remaining element props reach the rendered tag, so a panel can point
6
10
  // `aria-labelledby` at this heading via `id`, and tests can hang a `data-*`
7
11
  // hook off it. Without the spread there was no way to reference the heading
8
12
  // from its own container.
9
- return (_jsx(Tag, { className: cn(SECTION_LABEL_CLASS, className), ...rest, children: children }));
13
+ return (_jsx(Tag, { ...rest, "data-variant": ruled ? 'ruled' : undefined, className: cn(SECTION_LABEL_CLASS, ruled && RULED_CLASS, className), children: children }));
10
14
  }
@@ -81,8 +81,20 @@ type DataTableBaseProps<TData> = {
81
81
  */
82
82
  rowHref?: (row: TData) => string;
83
83
  className?: string;
84
+ /**
85
+ * Extra classes merged onto every header cell, after the kit label voice —
86
+ * so a caller can override the voice's size/tracking/color for one table
87
+ * without restating the cluster. Per-column alignment stays `meta.numeric`.
88
+ */
89
+ headClassName?: string;
90
+ /**
91
+ * Footed-total row(s) rendered inside the kit `TableFooter` after the body.
92
+ * The caller supplies the row markup (`<tr><td>…</td></tr>`) so the footer
93
+ * can span, align and format its own figures. Omitted → no `tfoot`.
94
+ */
95
+ footer?: React.ReactNode;
84
96
  };
85
97
  export type DataTableProps<TData> = DataTableBaseProps<TData> & RowSelectionProps<TData>;
86
- export declare function DataTable<TData>({ columns, data, loading, skeletonRows, loadingLabel, empty, getRowId, flush, density, enableRowSelection, rowSelection, onRowSelectionChange, getRowSelectionLabel, onRowActivate, rowHref, className }: DataTableProps<TData>): import("react").JSX.Element;
98
+ export declare function DataTable<TData>({ columns, data, loading, skeletonRows, loadingLabel, empty, getRowId, flush, density, enableRowSelection, rowSelection, onRowSelectionChange, getRowSelectionLabel, onRowActivate, rowHref, className, headClassName, footer }: DataTableProps<TData>): import("react").JSX.Element;
87
99
  export {};
88
100
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/enterprise/data-table/index.tsx"],"names":[],"mappings":"AAmCA,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,UAAU,EAEf,KAAK,OAAO,EACZ,KAAK,iBAAiB,EAEvB,MAAM,uBAAuB,CAAA;AAY9B,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAEjE;;;;GAIG;AACH,OAAO,QAAQ,uBAAuB,CAAC;IAIrC,UAAU,UAAU,CAAC,KAAK,SAAS,OAAO,EAAE,MAAM;QAChD,OAAO,CAAC,EAAE,OAAO,CAAA;KAClB;CACF;AAED;;;;;;;;GAQG;AACH,KAAK,iBAAiB,CAAC,KAAK,IACxB;IACE,kBAAkB,CAAC,EAAE,K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,cAAc,CAAC,KAAK,CAAC,+BAiSvB"}
@@ -10,6 +10,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
10
  * - empty → EmptyState (data resolved, zero rows)
11
11
  * - data → semantic table rows; cells own any links/actions
12
12
  *
13
+ * Column heads speak the kit's LABEL_VOICE_CLASS; `headClassName` overrides it
14
+ * per table. An optional `footer` node renders in a `tfoot` for footed totals.
15
+ *
13
16
  * Columns are standard TanStack `ColumnDef<T>`; cells receive the row's
14
17
  * `original` value, so screens compose money / date / status cells directly in
15
18
  * their column `cell` renderers.
@@ -34,8 +37,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
34
37
  */
35
38
  import { useEffect, useMemo, useRef, useState } from 'react';
36
39
  import { flexRender, getCoreRowModel, useReactTable } from '@tanstack/react-table';
37
- import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '../../components/ui/table/index.js';
40
+ import { Table, TableBody, TableCell, TableFooter, TableHead, TableHeader, TableRow } from '../../components/ui/table/index.js';
38
41
  import { Skeleton } from '../../components/ui/skeleton/index.js';
42
+ import { LABEL_VOICE_CLASS } from '../../lib/typography.js';
39
43
  import { cn } from '../../lib/utils.js';
40
44
  import { EmptyState } from '../empty-state/index.js';
41
45
  const SELECTION_COLUMN_ID = '__select__';
@@ -75,7 +79,7 @@ function createSelectionColumn(getLabel) {
75
79
  cell: ({ row }) => _jsx(RowSelectionCheckbox, { row: row, getLabel: getLabel })
76
80
  };
77
81
  }
78
- export function DataTable({ columns, data, loading = false, skeletonRows = 8, loadingLabel = 'Loading table rows', empty, getRowId, flush = false, density = 'comfortable', enableRowSelection = false, rowSelection, onRowSelectionChange, getRowSelectionLabel, onRowActivate, rowHref, className }) {
82
+ export function DataTable({ columns, data, loading = false, skeletonRows = 8, loadingLabel = 'Loading table rows', empty, getRowId, flush = false, density = 'comfortable', enableRowSelection = false, rowSelection, onRowSelectionChange, getRowSelectionLabel, onRowActivate, rowHref, className, headClassName, footer }) {
79
83
  const tableColumns = useMemo(() => enableRowSelection
80
84
  ? [createSelectionColumn(getRowSelectionLabel), ...columns]
81
85
  : columns, [columns, enableRowSelection, getRowSelectionLabel]);
@@ -213,7 +217,7 @@ export function DataTable({ columns, data, loading = false, skeletonRows = 8, lo
213
217
  ? 'No rows'
214
218
  : `${rowCount} rows` }), _jsxs(Table, { "aria-busy": loading ? 'true' : undefined, children: [_jsx(TableHeader, { children: table.getHeaderGroups().map((headerGroup) => (_jsx(TableRow, { className: "hover:bg-transparent", children: headerGroup.headers.map((header) => {
215
219
  const numeric = header.column.columnDef.meta?.numeric;
216
- return (_jsx(TableHead, { align: numeric ? 'right' : undefined, className: cn('tracking-wide uppercase', headDensityClass, header.column.id === SELECTION_COLUMN_ID && 'w-10'), children: header.isPlaceholder
220
+ return (_jsx(TableHead, { align: numeric ? 'right' : undefined, className: cn(LABEL_VOICE_CLASS, headDensityClass, header.column.id === SELECTION_COLUMN_ID && 'w-10', headClassName), children: header.isPlaceholder
217
221
  ? null
218
222
  : flexRender(header.column.columnDef.header, header.getContext()) }, header.id));
219
223
  }) }, headerGroup.id))) }), _jsx(TableBody, { children: loading ? (Array.from({ length: skeletonRows }).map((_, rowIndex) => (_jsx(TableRow, { className: "hover:bg-transparent", children: Array.from({ length: colCount }).map((__, cellIndex) => (_jsx(TableCell, { className: cellDensityClass, children: _jsx(Skeleton, { className: "h-4 w-full max-w-[160px]" }) }, `skeleton-${rowIndex}-${cellIndex}`))) }, `skeleton-${rowIndex}`)))) : rowCount === 0 ? (_jsx(TableRow, { className: "hover:bg-transparent", children: _jsx(TableCell, { colSpan: colCount, className: "p-0", children: _jsx(EmptyState, { title: empty?.title ?? 'Nothing here yet', description: empty?.description, icon: empty?.icon, action: empty?.action,
@@ -238,5 +242,5 @@ export function DataTable({ columns, data, loading = false, skeletonRows = 8, lo
238
242
  ? 'selected'
239
243
  : undefined, children: row.getVisibleCells().map((cell) => (_jsx(TableCell, { className: cn(cell.column.columnDef.meta?.numeric && NUMERIC_CELL_CLASS, cellDensityClass, cell.column.id === SELECTION_COLUMN_ID && 'w-10'), onClick: cell.column.id === SELECTION_COLUMN_ID
240
244
  ? stopPropagation
241
- : undefined, children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))) }, row.id)))) })] })] }));
245
+ : undefined, children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))) }, row.id)))) }), footer ? _jsx(TableFooter, { children: footer }) : null] })] }));
242
246
  }
@@ -27,6 +27,12 @@ export type SearchInputProps = {
27
27
  disabled?: boolean;
28
28
  className?: string;
29
29
  id?: string;
30
+ /**
31
+ * Key events on the field, passed straight through. The component adds no
32
+ * Escape behaviour of its own: Escape-to-clear is a consumer gesture (some
33
+ * filter rows clear the field, others close a popover), so it owns it.
34
+ */
35
+ onKeyDown?: React.KeyboardEventHandler<HTMLInputElement>;
30
36
  };
31
- export declare function SearchInput({ value, onValueChange, debounceMs, placeholder, 'aria-label': ariaLabel, clearLabel, disabled, className, id }: SearchInputProps): React.JSX.Element;
37
+ export declare function SearchInput({ value, onValueChange, debounceMs, placeholder, 'aria-label': ariaLabel, clearLabel, disabled, className, id, onKeyDown }: SearchInputProps): React.JSX.Element;
32
38
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/enterprise/search-input/index.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAa9B,MAAM,MAAM,gBAAgB,GAAG;IAC7B,2EAA2E;IAC3E,KAAK,EAAE,MAAM,CAAA;IACb,8CAA8C;IAC9C,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACtC,yEAAyE;IACzE,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,gFAAgF;IAChF,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,6CAA6C;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,EAAE,CAAC,EAAE,MAAM,CAAA;CACZ,CAAA;AAED,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,aAAa,EACb,UAAgB,EAChB,WAAuB,EACvB,YAAY,EAAE,SAAS,EACvB,UAA2B,EAC3B,QAAgB,EAChB,SAAS,EACT,EAAE,EACH,EAAE,gBAAgB,qBAsGlB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/enterprise/search-input/index.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAa9B,MAAM,MAAM,gBAAgB,GAAG;IAC7B,2EAA2E;IAC3E,KAAK,EAAE,MAAM,CAAA;IACb,8CAA8C;IAC9C,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACtC,yEAAyE;IACzE,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,gFAAgF;IAChF,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,6CAA6C;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX;;;;OAIG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,CAAA;CACzD,CAAA;AAED,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,aAAa,EACb,UAAgB,EAChB,WAAuB,EACvB,YAAY,EAAE,SAAS,EACvB,UAA2B,EAC3B,QAAgB,EAChB,SAAS,EACT,EAAE,EACF,SAAS,EACV,EAAE,gBAAgB,qBAuGlB"}
@@ -23,7 +23,7 @@ import { cn } from '../../lib/utils.js';
23
23
  * string: any string sentinel is a value a parent could legitimately pass.
24
24
  */
25
25
  const NO_PENDING_ECHO = Symbol('no pending echo');
26
- export function SearchInput({ value, onValueChange, debounceMs = 250, placeholder = 'Search…', 'aria-label': ariaLabel, clearLabel = 'Clear search', disabled = false, className, id }) {
26
+ export function SearchInput({ value, onValueChange, debounceMs = 250, placeholder = 'Search…', 'aria-label': ariaLabel, clearLabel = 'Clear search', disabled = false, className, id, onKeyDown }) {
27
27
  // Local draft keeps typing instant; the controlled `value` is the source of
28
28
  // truth between edits. When the parent changes `value` out of band (reset,
29
29
  // programmatic set), the draft follows.
@@ -79,7 +79,7 @@ export function SearchInput({ value, onValueChange, debounceMs = 250, placeholde
79
79
  onValueChange('');
80
80
  };
81
81
  const hasValue = draft.length > 0;
82
- return (_jsx("div", { className: cn('relative w-full sm:w-64', className), children: _jsx(Input, { id: id, type: "search", role: "searchbox", value: draft, onChange: handleChange, placeholder: placeholder, "aria-label": ariaLabel ?? placeholder ?? 'Search', disabled: disabled,
82
+ return (_jsx("div", { className: cn('relative w-full sm:w-64', className), children: _jsx(Input, { id: id, type: "search", role: "searchbox", value: draft, onChange: handleChange, onKeyDown: onKeyDown, placeholder: placeholder, "aria-label": ariaLabel ?? placeholder ?? 'Search', disabled: disabled,
83
83
  // The native search clear glyph would duplicate our button.
84
84
  className: "[&::-webkit-search-cancel-button]:appearance-none", startAdornment: _jsx(InputAdornment, { position: "start", children: _jsx(Search, { "aria-hidden": true }) }), endAdornment: hasValue ? (_jsx(InputAdornment, { position: "end", children: _jsx(IconButton, { type: "button", variant: "plain", size: "small", "aria-label": clearLabel, disabled: disabled, onClick: handleClear, className: "text-muted-foreground hover:text-foreground", children: _jsx(X, { className: "size-4", "aria-hidden": true }) }) })) : undefined }) }));
85
85
  }
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAQ,MAAM,MAAM,CAAA;AAG5C,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAQ,MAAM,MAAM,CAAA;AA8B5C,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC"}
@@ -1,5 +1,31 @@
1
1
  import { clsx } from 'clsx';
2
- import { twMerge } from 'tailwind-merge';
2
+ import { extendTailwindMerge } from 'tailwind-merge';
3
+ /**
4
+ * The kit's button variants are component classes in `@layer components`, not
5
+ * Tailwind utilities, so stock tailwind-merge has no group for them: it kept
6
+ * `button-primary button-destructive` together and let stylesheet source order
7
+ * pick the winner. Declaring the group makes the last one win, like every other
8
+ * conflict `cn` resolves.
9
+ *
10
+ * Variant classes only. `button-base`, `button-disabled`, `button-read-only`
11
+ * and `button-small` compose with a variant instead of conflicting with it, so
12
+ * they stay out of the group and are never merged away.
13
+ */
14
+ const twMerge = extendTailwindMerge({
15
+ extend: {
16
+ classGroups: {
17
+ 'sindarian-button-variant': [
18
+ 'button-plain',
19
+ 'button-primary',
20
+ 'button-secondary',
21
+ 'button-tertiary',
22
+ 'button-outline',
23
+ 'button-link',
24
+ 'button-destructive'
25
+ ]
26
+ }
27
+ }
28
+ });
3
29
  export function cn(...inputs) {
4
30
  return twMerge(clsx(inputs));
5
31
  }
package/dist/globals.css CHANGED
@@ -13,7 +13,8 @@
13
13
  @custom-variant dark (&:is(.dark *));
14
14
 
15
15
  @theme inline {
16
- --font-sans: var(--font-inter), Inter, ui-sans-serif, system-ui, sans-serif;
16
+ --font-sans:
17
+ var(--font-inter, 'Inter'), 'Inter', ui-sans-serif, system-ui, sans-serif;
17
18
 
18
19
  --shadow-sidebar: 5px 0px 15px -3px hsl(var(--shadow-color) / 0.05);
19
20
  --shadow-data-table:
@@ -358,6 +359,17 @@
358
359
  --accent-hover: 46 98% 57%; /* sunglow/400 = #FDCB28 - opacity via /70 */
359
360
  --accent-mute: 46 98% 57%; /* sunglow/400 = #FDCB28 - opacity via /50 */
360
361
 
362
+ /*
363
+ Shadcn — Destructive. Lifted to red/400 like every other red in this
364
+ block (--system-error, --credit, --chart-2): the light red/500 inherited
365
+ here before, which left `text-destructive` at 2.76:1 on a --card surface
366
+ and `bg-destructive`/`text-destructive-foreground` at 3.78:1. The
367
+ foreground inverts to red/950 — the deep end this theme already uses as
368
+ --system-error-surface — so the pair reads 5.94:1.
369
+ */
370
+ --destructive: 0 91% 71%; /* red/400 = #F87171 */
371
+ --destructive-foreground: 0 75% 15%; /* red/950 = #450A0A */
372
+
361
373
  /* Shadcn — System Error */
362
374
  --system-error: 0 91% 71%; /* red/400 = #F87171 */
363
375
  --system-error-surface: 0 75% 15%; /* red/950 = #450A0A */
@@ -396,9 +408,23 @@
396
408
  /* Shadow color for dark mode */
397
409
  --shadow-color: 0 0% 100%;
398
410
 
399
- /* Ledger credit semantic — lifted for the dark canvas; foreground mirrors. */
400
- --credit: 0 91% 71%; /* red/400 = #F87171 */
401
- --credit-foreground: 0 91% 71%; /* mirrors --credit */
411
+ /*
412
+ Ledger credit semantic — lifted for the dark canvas; foreground mirrors.
413
+ Sized by the composite the mirror actually produces, not by the plain
414
+ pair: components write `bg-credit/10` + `text-credit`, so the real
415
+ measurement is credit-as-text over a 10% credit tint composited on
416
+ --card. red/400 read only 3.34:1 there. red/300 — the channel this block
417
+ already uses for --system-error-text — reaches 4.59:1, and 5.54:1 as
418
+ plain text on --card.
419
+
420
+ Credit stays one step further from the canvas than --destructive
421
+ (red/400 here), the way light keeps credit at red/700 against a red/500
422
+ destructive: on a dark ground "further from the canvas" means lighter,
423
+ so the direction inverts but the separation holds and the two never read
424
+ as the same signal.
425
+ */
426
+ --credit: 0 94% 82%; /* red/300 = #FCA5A5 */
427
+ --credit-foreground: 0 94% 82%; /* mirrors --credit */
402
428
 
403
429
  /* Reconciliation matte fills — raised surfaces over base/800, one step apart. */
404
430
  --matched-surface: 240 5% 26%; /* base/700 = #3F3F46 */
@@ -433,21 +459,30 @@
433
459
  0 4px 6px -4px rgba(0, 0, 0, 0.1);
434
460
  }
435
461
 
462
+ /*
463
+ Type fills come from the system token families, so a toast themes with the
464
+ rest of the app. Ink is picked per family by polarity, not per theme:
465
+ --primary-foreground is the ink that sits on a solid fill and already
466
+ inverts (white in light, base/800 in dark), which is what the success and
467
+ error fills need — they darken in light and lift in dark. --system-alert is
468
+ bright in BOTH themes, so warning takes --accent-foreground, the token that
469
+ means "ink on yellow" and is near-black in both.
470
+ */
436
471
  [data-sonner-toast][data-type='success'] {
437
- --normal-bg: #22c55e;
438
- --normal-text: #ffffff;
472
+ --normal-bg: hsl(var(--system-success));
473
+ --normal-text: hsl(var(--primary-foreground));
439
474
  --normal-border: transparent;
440
475
  }
441
476
 
442
477
  [data-sonner-toast][data-type='error'] {
443
- --normal-bg: #ef4444;
444
- --normal-text: #ffffff;
478
+ --normal-bg: hsl(var(--system-error));
479
+ --normal-text: hsl(var(--primary-foreground));
445
480
  --normal-border: transparent;
446
481
  }
447
482
 
448
483
  [data-sonner-toast][data-type='warning'] {
449
- --normal-bg: #f59e0b;
450
- --normal-text: #422006;
484
+ --normal-bg: hsl(var(--system-alert));
485
+ --normal-text: hsl(var(--accent-foreground));
451
486
  --normal-border: transparent;
452
487
  }
453
488
 
@@ -476,42 +511,35 @@
476
511
  display: none !important;
477
512
  }
478
513
 
514
+ /*
515
+ The close button derives from the toast's own --normal-text, so it is legible
516
+ on every fill and in both themes by construction. That is what replaced the
517
+ six rules previously here: one per-theme pair plus one pair per coloured
518
+ type, each hardcoding the ink it assumed the fill needed.
519
+
520
+ Both rules keep !important. Sonner's own resting rule is
521
+ `[data-sonner-toast][data-styled='true'] [data-close-button]` (0,3,0,
522
+ color: var(--gray12)) and its dark rule adds a fourth compound, so a plain
523
+ descendant selector here cannot win the cascade against a stylesheet that is
524
+ injected at runtime — the fade this rule intends was previously decided by
525
+ source order rather than by the sheet.
526
+ */
479
527
  [data-sonner-toast] [data-close-button] {
480
- color: hsl(var(--foreground) / 0.5);
528
+ color: color-mix(in srgb, var(--normal-text) 50%, transparent) !important;
481
529
  }
482
530
 
483
531
  [data-sonner-toast] [data-close-button]:hover {
484
- color: #ffffff !important;
485
- background-color: hsl(var(--foreground)) !important;
486
- border-color: hsl(var(--foreground)) !important;
487
- }
488
-
489
- .dark [data-sonner-toast] [data-close-button]:hover {
490
- color: #ffffff !important;
491
- background-color: hsl(240 5% 26%) !important;
492
- border-color: hsl(240 5% 26%) !important;
493
- }
494
-
495
- [data-sonner-toast][data-type='success'] [data-close-button],
496
- [data-sonner-toast][data-type='error'] [data-close-button] {
497
- color: rgba(255, 255, 255, 0.6);
498
- }
499
-
500
- [data-sonner-toast][data-type='success'] [data-close-button]:hover,
501
- [data-sonner-toast][data-type='error'] [data-close-button]:hover {
502
- color: #ffffff !important;
503
- background-color: hsl(var(--foreground)) !important;
504
- border-color: hsl(var(--foreground)) !important;
505
- }
506
-
507
- [data-sonner-toast][data-type='warning'] [data-close-button] {
508
- color: rgba(66, 32, 6, 0.5);
509
- }
510
-
511
- [data-sonner-toast][data-type='warning'] [data-close-button]:hover {
512
- color: #422006 !important;
513
- background-color: rgba(66, 32, 6, 0.15) !important;
514
- border-color: rgba(66, 32, 6, 0.15) !important;
532
+ color: var(--normal-text) !important;
533
+ background-color: color-mix(
534
+ in srgb,
535
+ var(--normal-text) 15%,
536
+ transparent
537
+ ) !important;
538
+ border-color: color-mix(
539
+ in srgb,
540
+ var(--normal-text) 15%,
541
+ transparent
542
+ ) !important;
515
543
  }
516
544
 
517
545
  .dark [data-sonner-toast] {
@@ -557,22 +585,6 @@
557
585
  }
558
586
  }
559
587
 
560
- @keyframes caret-blink {
561
- 0%,
562
- 70%,
563
- 100% {
564
- opacity: 1;
565
- }
566
- 20%,
567
- 50% {
568
- opacity: 0;
569
- }
570
- }
571
-
572
- @utility animate-caret-blink {
573
- animation: caret-blink 1.25s ease-out infinite;
574
- }
575
-
576
588
  .ticket {
577
589
  mask: radial-gradient(21px 13px at 50% 102%, #0000 98%, #000) 50%
578
590
  calc(100% - 16px) / 64px 100% repeat-x;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAQ,MAAM,MAAM,CAAA;AAG5C,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAQ,MAAM,MAAM,CAAA;AA8B5C,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC"}
package/dist/lib/utils.js CHANGED
@@ -3,6 +3,32 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.cn = cn;
4
4
  const clsx_1 = require("clsx");
5
5
  const tailwind_merge_1 = require("tailwind-merge");
6
+ /**
7
+ * The kit's button variants are component classes in `@layer components`, not
8
+ * Tailwind utilities, so stock tailwind-merge has no group for them: it kept
9
+ * `button-primary button-destructive` together and let stylesheet source order
10
+ * pick the winner. Declaring the group makes the last one win, like every other
11
+ * conflict `cn` resolves.
12
+ *
13
+ * Variant classes only. `button-base`, `button-disabled`, `button-read-only`
14
+ * and `button-small` compose with a variant instead of conflicting with it, so
15
+ * they stay out of the group and are never merged away.
16
+ */
17
+ const twMerge = (0, tailwind_merge_1.extendTailwindMerge)({
18
+ extend: {
19
+ classGroups: {
20
+ 'sindarian-button-variant': [
21
+ 'button-plain',
22
+ 'button-primary',
23
+ 'button-secondary',
24
+ 'button-tertiary',
25
+ 'button-outline',
26
+ 'button-link',
27
+ 'button-destructive'
28
+ ]
29
+ }
30
+ }
31
+ });
6
32
  function cn(...inputs) {
7
- return (0, tailwind_merge_1.twMerge)((0, clsx_1.clsx)(inputs));
33
+ return twMerge((0, clsx_1.clsx)(inputs));
8
34
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lerianstudio/sindarian-ui",
3
- "version": "1.3.0-beta.2",
3
+ "version": "1.3.0-beta.4",
4
4
  "description": "Sindarian UI - A UI library for Midaz Console",
5
5
  "license": "ISC",
6
6
  "author": {