@lerianstudio/sindarian-ui 1.4.0-beta.2 → 1.4.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.
- package/dist/components/entity-box/index.d.ts +11 -2
- package/dist/components/entity-box/index.d.ts.map +1 -1
- package/dist/components/entity-box/index.js +3 -3
- package/dist/components/form/input-field/index.d.ts +12 -2
- package/dist/components/form/input-field/index.d.ts.map +1 -1
- package/dist/components/form/input-field/index.js +29 -5
- package/dist/components/form/select-field/index.d.ts +29 -5
- package/dist/components/form/select-field/index.d.ts.map +1 -1
- package/dist/components/form/select-field/index.js +33 -10
- package/dist/components/page-header/index.d.ts +8 -2
- package/dist/components/page-header/index.d.ts.map +1 -1
- package/dist/components/page-header/index.js +4 -4
- package/dist/components/ui/badge/index.d.ts +8 -0
- package/dist/components/ui/badge/index.d.ts.map +1 -1
- package/dist/components/ui/badge/index.js +9 -1
- package/dist/components/ui/form.d.ts +4 -4
- package/dist/components/ui/form.d.ts.map +1 -1
- package/dist/components/ui/form.js +12 -6
- package/dist/components/ui/multiple-select/index.d.ts +11 -3
- package/dist/components/ui/multiple-select/index.d.ts.map +1 -1
- package/dist/components/ui/select/index.d.ts +5 -0
- package/dist/components/ui/select/index.d.ts.map +1 -1
- package/dist/components/ui/select/index.js +24 -1
- package/dist/domain/blotter/index.d.ts +2 -2
- package/dist/domain/delinquency-aging/aging-buckets.d.ts.map +1 -1
- package/dist/domain/delinquency-aging/aging-buckets.js +1 -1
- package/dist/domain/delinquency-aging/index.d.ts.map +1 -1
- package/dist/domain/delinquency-aging/index.js +1 -1
- package/dist/domain/figure/index.d.ts +11 -9
- package/dist/domain/figure/index.d.ts.map +1 -1
- package/dist/domain/figure/index.js +8 -8
- package/dist/domain/key-id/index.d.ts +1 -1
- package/dist/domain/key-id/index.d.ts.map +1 -1
- package/dist/domain/key-id/index.js +1 -1
- package/dist/domain/section-label/index.d.ts +10 -7
- package/dist/domain/section-label/index.d.ts.map +1 -1
- package/dist/domain/status-rail/index.d.ts +1 -1
- package/dist/domain/status-rail/index.d.ts.map +1 -1
- package/dist/domain/status-rail/index.js +8 -4
- package/dist/enterprise/alert-banner/index.d.ts +5 -3
- package/dist/enterprise/alert-banner/index.d.ts.map +1 -1
- package/dist/enterprise/alert-banner/index.js +2 -2
- package/dist/enterprise/data-table/column-size.d.ts +70 -0
- package/dist/enterprise/data-table/column-size.d.ts.map +1 -0
- package/dist/enterprise/data-table/column-size.js +103 -0
- package/dist/enterprise/data-table/index.d.ts.map +1 -1
- package/dist/enterprise/data-table/index.js +22 -2
- package/dist/enterprise/date-range-picker/index.d.ts.map +1 -1
- package/dist/enterprise/date-range-picker/index.js +1 -2
- package/dist/enterprise/stat-card/index.d.ts +3 -3
- package/dist/enterprise/stat-card/index.d.ts.map +1 -1
- package/dist/enterprise/stat-card/index.js +1 -1
- package/dist/enterprise/status-badge/index.js +1 -1
- package/dist/enterprise/virtualized-table/index.d.ts +18 -2
- package/dist/enterprise/virtualized-table/index.d.ts.map +1 -1
- package/dist/enterprise/virtualized-table/index.js +31 -4
- package/dist/esm/components/entity-box/index.d.ts +11 -2
- package/dist/esm/components/entity-box/index.d.ts.map +1 -1
- package/dist/esm/components/entity-box/index.js +3 -3
- package/dist/esm/components/form/input-field/index.d.ts +12 -2
- package/dist/esm/components/form/input-field/index.d.ts.map +1 -1
- package/dist/esm/components/form/input-field/index.js +29 -5
- package/dist/esm/components/form/select-field/index.d.ts +29 -5
- package/dist/esm/components/form/select-field/index.d.ts.map +1 -1
- package/dist/esm/components/form/select-field/index.js +33 -10
- package/dist/esm/components/page-header/index.d.ts +8 -2
- package/dist/esm/components/page-header/index.d.ts.map +1 -1
- package/dist/esm/components/page-header/index.js +4 -4
- package/dist/esm/components/ui/badge/index.d.ts +8 -0
- package/dist/esm/components/ui/badge/index.d.ts.map +1 -1
- package/dist/esm/components/ui/badge/index.js +9 -1
- package/dist/esm/components/ui/form.d.ts +4 -4
- package/dist/esm/components/ui/form.d.ts.map +1 -1
- package/dist/esm/components/ui/form.js +12 -6
- package/dist/esm/components/ui/multiple-select/index.d.ts +11 -3
- package/dist/esm/components/ui/multiple-select/index.d.ts.map +1 -1
- package/dist/esm/components/ui/select/index.d.ts +5 -0
- package/dist/esm/components/ui/select/index.d.ts.map +1 -1
- package/dist/esm/components/ui/select/index.js +24 -1
- package/dist/esm/domain/blotter/index.d.ts +2 -2
- package/dist/esm/domain/delinquency-aging/aging-buckets.d.ts.map +1 -1
- package/dist/esm/domain/delinquency-aging/aging-buckets.js +1 -1
- package/dist/esm/domain/delinquency-aging/index.d.ts.map +1 -1
- package/dist/esm/domain/delinquency-aging/index.js +1 -1
- package/dist/esm/domain/figure/index.d.ts +11 -9
- package/dist/esm/domain/figure/index.d.ts.map +1 -1
- package/dist/esm/domain/figure/index.js +8 -8
- package/dist/esm/domain/key-id/index.d.ts +1 -1
- package/dist/esm/domain/key-id/index.d.ts.map +1 -1
- package/dist/esm/domain/key-id/index.js +1 -1
- package/dist/esm/domain/section-label/index.d.ts +10 -7
- package/dist/esm/domain/section-label/index.d.ts.map +1 -1
- package/dist/esm/domain/status-rail/index.d.ts +1 -1
- package/dist/esm/domain/status-rail/index.d.ts.map +1 -1
- package/dist/esm/domain/status-rail/index.js +8 -4
- package/dist/esm/enterprise/alert-banner/index.d.ts +5 -3
- package/dist/esm/enterprise/alert-banner/index.d.ts.map +1 -1
- package/dist/esm/enterprise/alert-banner/index.js +2 -2
- package/dist/esm/enterprise/data-table/column-size.d.ts +70 -0
- package/dist/esm/enterprise/data-table/column-size.d.ts.map +1 -0
- package/dist/esm/enterprise/data-table/column-size.js +97 -0
- package/dist/esm/enterprise/data-table/index.d.ts.map +1 -1
- package/dist/esm/enterprise/data-table/index.js +22 -2
- package/dist/esm/enterprise/date-range-picker/index.d.ts.map +1 -1
- package/dist/esm/enterprise/date-range-picker/index.js +1 -2
- package/dist/esm/enterprise/stat-card/index.d.ts +3 -3
- package/dist/esm/enterprise/stat-card/index.d.ts.map +1 -1
- package/dist/esm/enterprise/stat-card/index.js +1 -1
- package/dist/esm/enterprise/status-badge/index.js +1 -1
- package/dist/esm/enterprise/virtualized-table/index.d.ts +18 -2
- package/dist/esm/enterprise/virtualized-table/index.d.ts.map +1 -1
- package/dist/esm/enterprise/virtualized-table/index.js +31 -4
- package/dist/esm/lib/typography.d.ts +21 -6
- package/dist/esm/lib/typography.d.ts.map +1 -1
- package/dist/esm/lib/typography.js +20 -5
- package/dist/globals.css +51 -16
- package/dist/lib/typography.d.ts +21 -6
- package/dist/lib/typography.d.ts.map +1 -1
- package/dist/lib/typography.js +20 -5
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Blotter + BlotterRow — the
|
|
2
|
+
* Blotter + BlotterRow — the key/value readout of the console.
|
|
3
3
|
*
|
|
4
4
|
* Clean key/value rows separated by hairline borders (`divide-y divide-border`)
|
|
5
|
-
* — no zebra fills. Each row:
|
|
5
|
+
* — no zebra fills. Each row: a quiet sentence-case sans label on the left, a mono
|
|
6
6
|
* `tabular-nums` value on the right, `hover:bg-body-surface` as the quiet row
|
|
7
7
|
* affordance (the recessed page surface, one step behind `bg-card`, in both
|
|
8
8
|
* themes). Escalate the value color (`text-credit`, `text-system-alert`) only
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aging-buckets.d.ts","sourceRoot":"","sources":["../../../../src/domain/delinquency-aging/aging-buckets.tsx"],"names":[],"mappings":"AAyCA,MAAM,WAAW,WAAW;IAC1B,iEAAiE;IACjE,KAAK,EAAE,MAAM,CAAA;IACb,8EAA8E;IAC9E,KAAK,EAAE,MAAM,CAAA;IACb,yEAAyE;IACzE,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CACvB;AAED,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAA;AAElE;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB;IACjC,6EAA6E;IAC7E,KAAK,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAA;IAC1C,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,+DAA+D;IAC/D,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,iFAAiF;IACjF,OAAO,EAAE,WAAW,EAAE,CAAA;IACtB,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,gFAAgF;IAChF,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,oEAAoE;IACpE,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,yEAAyE;IACzE,MAAM,CAAC,EAAE,kBAAkB,CAAA;IAC3B;oFACgF;IAChF,WAAW,CAAC,EAAE,SAAS,GAAG,KAAK,CAAA;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AA2BD;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,CAMlE;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,WAAW,EAAE,EACtB,KAAK,EAAE,MAAM,GACZ,MAAM,GAAG,IAAI,CAMf;AAED,wBAAgB,YAAY,CAAC,EAC3B,OAAO,EACP,QAAQ,EACR,MAAM,EACN,SAAiB,EACjB,MAAM,EACN,WAAuB,EACvB,SAAS,EACV,EAAE,iBAAiB,+
|
|
1
|
+
{"version":3,"file":"aging-buckets.d.ts","sourceRoot":"","sources":["../../../../src/domain/delinquency-aging/aging-buckets.tsx"],"names":[],"mappings":"AAyCA,MAAM,WAAW,WAAW;IAC1B,iEAAiE;IACjE,KAAK,EAAE,MAAM,CAAA;IACb,8EAA8E;IAC9E,KAAK,EAAE,MAAM,CAAA;IACb,yEAAyE;IAC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showTotal = false, lab
|
|
|
105
105
|
: BAND[band].tint;
|
|
106
106
|
// Shallow merge: an unlisted band keeps its pt-BR default.
|
|
107
107
|
const bandWord = labels?.bands?.[band] ?? word;
|
|
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
|
|
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'), 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 text-xs'), 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 text-xs'), children: totalLabel })] })] }, `${bucket.label}-${i}`));
|
|
109
109
|
}) }), showTotal ? (_jsxs("div", { className: "border-border flex items-center gap-3 border-t-2 pt-2.5", children: [_jsx("span", { "aria-hidden": true, className: "size-4 shrink-0" }), _jsx("span", { className: cn(LABEL_VOICE_CLASS, 'text-foreground min-w-0 flex-1'), children: grandTotalLabel }), _jsx("span", { className: "w-32 shrink-0 text-right sm:w-40", children: grandTotal === null ? (_jsx(Figure, { size: "row", className: "text-muted-foreground", children: NO_VALUE })) : (_jsx(Figure, { size: "row", className: "text-foreground font-semibold", children: _jsx(MoneyText, { amount: grandTotal, currency: currency, fractionDigits: scale, locale: locale, signColor: false }) })) })] })) : null] }));
|
|
110
110
|
}
|
|
@@ -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,aAAa,EAAE,OAAO,CAAA;CACvB;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,iBAAiB,EAAE,EAC5B,KAAK,EAAE,MAAM,GACZ,eAAe,CAuDjB;AAoFD,MAAM,WAAW,qBAAqB;IACpC;yEACqE;IACrE,OAAO,EAAE,iBAAiB,EAAE,CAAA;IAC5B,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,yEAAyE;IACzE,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;sBAGkB;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,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ging({ buckets, currency, locale, rateLabel = 'Inadi
|
|
|
209
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", {
|
|
210
210
|
// A distressed rate is a credit alarm: announced the moment it
|
|
211
211
|
// crosses the band, so assistive tech does not lean on the tint.
|
|
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:
|
|
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: LABEL_VOICE_CLASS, 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 })] }));
|
|
213
213
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Figure — the
|
|
2
|
+
* Figure — the figure type scale of the enterprise console.
|
|
3
3
|
*
|
|
4
|
-
* All numbers are the hero:
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
* All numbers are the hero: tabular and visually dominant, on the console's own
|
|
5
|
+
* Inter — NOT a second typeface. `tabular-nums` (Inter's `tnum`) is what keeps
|
|
6
|
+
* digits column-aligned, so the mono lock the scale used to carry bought
|
|
7
|
+
* nothing the console needed. This file is the single source of truth for the
|
|
8
|
+
* canonical figure sizes so screens stop re-typing `tabular-nums` strings and
|
|
9
|
+
* drifting on size/weight/tracking. Use `<Figure size>` for new markup, or
|
|
10
|
+
* import the `FIGURE_CLASS` constants when composing className strings inline.
|
|
9
11
|
*
|
|
10
12
|
* Scale:
|
|
11
13
|
* - hero : the dominant in-bar figure — text-4xl/5xl, semibold, tracking-tight
|
|
@@ -18,13 +20,13 @@
|
|
|
18
20
|
* `money-hero` is `hero`'s role at one step down the scale: a formatted BRL
|
|
19
21
|
* amount runs ~13 characters, which clips a three-column panel at 4xl/5xl, so
|
|
20
22
|
* consoles were hand-rolling `text-2xl lg:text-3xl` at the call site and losing
|
|
21
|
-
* the
|
|
23
|
+
* the tabular/weight invariants along the way. Same responsive shape as
|
|
22
24
|
* `hero`, same weight and tracking — only the two size steps differ.
|
|
23
25
|
*/
|
|
24
26
|
import type { ElementType, ReactNode } from 'react';
|
|
25
27
|
export type FigureSize = 'hero' | 'money-hero' | 'panel' | 'count' | 'row' | 'tick';
|
|
26
|
-
/** Canonical class strings per figure size. The `tabular-nums`
|
|
27
|
-
*
|
|
28
|
+
/** Canonical class strings per figure size. The `tabular-nums` invariant lives
|
|
29
|
+
* here so it can never be forgotten at a call site. */
|
|
28
30
|
export declare const FIGURE_CLASS: Record<FigureSize, string>;
|
|
29
31
|
export type FigureProps = {
|
|
30
32
|
size: FigureSize;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/domain/figure/index.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/domain/figure/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;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;wDACwD;AACxD,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"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from '../../lib/utils.js';
|
|
3
|
-
/** Canonical class strings per figure size. The `tabular-nums`
|
|
4
|
-
*
|
|
3
|
+
/** Canonical class strings per figure size. The `tabular-nums` invariant lives
|
|
4
|
+
* here so it can never be forgotten at a call site. */
|
|
5
5
|
export const FIGURE_CLASS = {
|
|
6
|
-
hero: '
|
|
7
|
-
'money-hero': '
|
|
8
|
-
panel: '
|
|
9
|
-
count: '
|
|
10
|
-
row: '
|
|
11
|
-
tick: '
|
|
6
|
+
hero: 'text-4xl font-semibold tracking-tight tabular-nums lg:text-5xl',
|
|
7
|
+
'money-hero': 'text-2xl font-semibold tracking-tight tabular-nums lg:text-3xl',
|
|
8
|
+
panel: 'text-3xl font-semibold tracking-tight tabular-nums',
|
|
9
|
+
count: 'text-2xl font-semibold tracking-tight tabular-nums',
|
|
10
|
+
row: 'text-sm tabular-nums',
|
|
11
|
+
tick: 'text-xs leading-none tabular-nums'
|
|
12
12
|
};
|
|
13
13
|
export function Figure({ size, children, className, as: Tag = 'span' }) {
|
|
14
14
|
return _jsx(Tag, { className: cn(FIGURE_CLASS[size], className), children: children });
|
|
@@ -3,7 +3,7 @@ export interface KeyIdProps {
|
|
|
3
3
|
value: string;
|
|
4
4
|
/** What the value is. Drives the mask shape and the default mask state. */
|
|
5
5
|
kind?: KeyIdKind;
|
|
6
|
-
/** Optional
|
|
6
|
+
/** Optional quiet label rendered before the value (e.g. 'Payer', 'E2E'). */
|
|
7
7
|
label?: string;
|
|
8
8
|
/** Override the per-kind mask default. PII kinds default true, ids default false. */
|
|
9
9
|
mask?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/domain/key-id/index.tsx"],"names":[],"mappings":"AA2BA,MAAM,MAAM,SAAS,GACjB,SAAS,GACT,UAAU,GACV,WAAW,GACX,WAAW,GACX,SAAS,GACT,KAAK,GACL,aAAa,GACb,SAAS,CAAA;AAEb,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,2EAA2E;IAC3E,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/domain/key-id/index.tsx"],"names":[],"mappings":"AA2BA,MAAM,MAAM,SAAS,GACjB,SAAS,GACT,UAAU,GACV,WAAW,GACX,WAAW,GACX,SAAS,GACT,KAAK,GACL,aAAa,GACb,SAAS,CAAA;AAEb,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,2EAA2E;IAC3E,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,4EAA4E;IAC5E,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,qFAAqF;IACrF,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,sEAAsE;IACtE,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAeD;+EAC+E;AAC/E,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAEvD;AAuED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,MAAM,CAahE;AAED,wBAAgB,KAAK,CAAC,EACpB,KAAK,EACL,IAAgB,EAChB,KAAK,EACL,IAAI,EACJ,QAAgB,EAChB,SAAS,EACV,EAAE,UAAU,+BA0BZ"}
|
|
@@ -134,7 +134,7 @@ export function maskKeyId(value, kind) {
|
|
|
134
134
|
export function KeyId({ value, kind = 'generic', label, mask, copyable = false, className }) {
|
|
135
135
|
const masked = mask ?? masksByDefault(kind);
|
|
136
136
|
const display = masked ? maskKeyId(value, kind) : truncateMiddle(value);
|
|
137
|
-
return (_jsxs("span", { className: cn('inline-flex min-w-0 items-center gap-2', className), children: [label ? (_jsx("span", { className: cn(LABEL_VOICE_CLASS, 'shrink-0'), children: label })) : null, _jsx("span", { className: "text-foreground truncate font-mono text-xs tabular-nums",
|
|
137
|
+
return (_jsxs("span", { className: cn('inline-flex min-w-0 items-center gap-2', className), children: [label ? (_jsx("span", { className: cn(LABEL_VOICE_CLASS, 'shrink-0 text-xs'), children: label })) : null, _jsx("span", { className: "text-foreground truncate font-mono text-xs tabular-nums",
|
|
138
138
|
// The raw value as a tooltip only when nothing is hidden — never leak a
|
|
139
139
|
// masked PII value through the title attribute.
|
|
140
140
|
title: masked ? undefined : value, children: display }), copyable ? _jsx(CopyValue, { value: value }) : null] }));
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* SectionLabel — THE canonical
|
|
2
|
+
* SectionLabel — THE canonical quiet label of the console.
|
|
3
3
|
*
|
|
4
|
-
* Every panel heading, section title, and caption
|
|
5
|
-
*
|
|
6
|
-
* loud. The class itself
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
* Every panel heading, section title, and caption speaks product-console's
|
|
5
|
+
* table-head voice: sentence case, `text-sm`, medium weight, muted-foreground
|
|
6
|
+
* — the recessive foil that lets the figures be loud. The class itself
|
|
7
|
+
* lives in `@/lib/typography` (`SECTION_LABEL_CLASS`, an alias of
|
|
8
|
+
* `LABEL_VOICE_CLASS`) and is NEVER re-stated here, so the voice cannot drift
|
|
9
|
+
* between this component and the `ui/` layer that shares it.
|
|
9
10
|
*
|
|
10
11
|
* Renders an `<h2>` by default (the ledger-sheet cell heading), but `as` lets
|
|
11
|
-
* it become a `<p>`/`<span>`/`<dt>` for captions and inline labels.
|
|
12
|
+
* it become a `<p>`/`<span>`/`<dt>` for captions and inline labels. For an
|
|
13
|
+
* EntityBox-scale panel TITLE, reach for `EntityBoxHeaderTitle` instead — that
|
|
14
|
+
* is the kit's `text-lg` heading voice.
|
|
12
15
|
*/
|
|
13
16
|
import type { ElementType, HTMLAttributes, ReactNode } from 'react';
|
|
14
17
|
export type SectionLabelProps = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/domain/section-label/index.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/domain/section-label/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;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"}
|
|
@@ -2,7 +2,7 @@ import type { ReactNode } from 'react';
|
|
|
2
2
|
export type StatusRailItem = {
|
|
3
3
|
/** Optional stable key for dynamic (reordered/filtered) rails; falls back to index. */
|
|
4
4
|
id?: string;
|
|
5
|
-
/** Optional
|
|
5
|
+
/** Optional quiet label rendered inline before the value. */
|
|
6
6
|
label?: ReactNode;
|
|
7
7
|
value: ReactNode;
|
|
8
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/domain/status-rail/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/domain/status-rail/index.tsx"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItC,MAAM,MAAM,cAAc,GAAG;IAC3B,uFAAuF;IACvF,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,6DAA6D;IAC7D,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,KAAK,EAAE,SAAS,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,uFAAuF;IACvF,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,SAAS,CAAA;IAChB,KAAK,EAAE,SAAS,CAAA;IAChB,yEAAyE;IACzE,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,qEAAqE;IACrE,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,qCAAqC;IACrC,KAAK,CAAC,EAAE,cAAc,EAAE,CAAA;IACxB,gCAAgC;IAChC,KAAK,CAAC,EAAE,cAAc,EAAE,CAAA;IACxB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,KAAU,EACV,KAAU,EACV,SAAS,EACV,EAAE,eAAe,+BAwEjB;AAkBD,qFAAqF;AACrF,wBAAgB,GAAG,gCAMlB;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,gCAOxB"}
|
|
@@ -18,9 +18,13 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
18
18
|
* />
|
|
19
19
|
*
|
|
20
20
|
* The first token (`lead`) is `text-foreground font-medium`. Tape items are
|
|
21
|
-
* dot-separated; an item with a `label` renders the
|
|
22
|
-
*
|
|
23
|
-
* destructive.
|
|
21
|
+
* dot-separated; an item with a `label` renders the label inline before its
|
|
22
|
+
* value, in the rail's own `font-medium`. Chips pin right via `ml-auto`;
|
|
23
|
+
* `alarm` escalates a chip to destructive.
|
|
24
|
+
*
|
|
25
|
+
* Labels carry weight only: the rail root already supplies size, family and
|
|
26
|
+
* ink (`font-mono text-xs text-muted-foreground`), so re-stating
|
|
27
|
+
* LABEL_VOICE_CLASS here would import a `text-sm` that fights the tape.
|
|
24
28
|
*/
|
|
25
29
|
import { TriangleAlert } from 'lucide-react';
|
|
26
30
|
import { cn } from '../../lib/utils.js';
|
|
@@ -37,7 +41,7 @@ export function StatusRail({ lead, items = [], chips = [], className }) {
|
|
|
37
41
|
// Recessed instrument strip: the page surface inside a hairline border
|
|
38
42
|
// whose top edge runs one step darker — light-from-above recession
|
|
39
43
|
// without any inner shadow.
|
|
40
|
-
'border-border border-t-foreground/10 bg-body-surface text-muted-foreground flex flex-wrap items-center gap-x-3 gap-y-1.5 rounded-lg border px-4 py-2 font-mono text-xs tabular-nums', className), children: [hasLead ? (_jsx("span", { className: "text-foreground font-medium", children: lead })) : null, items.map((item, i) => (_jsx(RailFragment, { hasLead: hasLead || i > 0, children: item.label != null ? (_jsxs("span", { className: "flex items-center gap-1.5", children: [_jsx("span", { className: "
|
|
44
|
+
'border-border border-t-foreground/10 bg-body-surface text-muted-foreground flex flex-wrap items-center gap-x-3 gap-y-1.5 rounded-lg border px-4 py-2 font-mono text-xs tabular-nums', className), children: [hasLead ? (_jsx("span", { className: "text-foreground font-medium", children: lead })) : null, items.map((item, i) => (_jsx(RailFragment, { hasLead: hasLead || i > 0, children: item.label != null ? (_jsxs("span", { className: "flex items-center gap-1.5", children: [_jsx("span", { className: "font-medium", children: item.label }), item.value] })) : (_jsx("span", { className: "flex items-center gap-1.5", children: item.value })) }, item.id ?? i))), chips.length ? (_jsx("span", { className: "ml-auto flex flex-wrap items-center gap-x-3 gap-y-1.5", children: chips.map((chip, i) => (_jsxs("span", { className: "inline-flex items-center gap-1.5", children: [_jsx("span", { className: "font-medium", children: chip.label }), _jsxs("span", { className: cn(
|
|
41
45
|
// Tiny mono token: raised a hair off the sunken tape by the
|
|
42
46
|
// card surface + whisper shadow.
|
|
43
47
|
'inline-flex items-center gap-1 rounded-sm border px-1.5 py-0.5 shadow-sm', chip.alarm
|
|
@@ -12,9 +12,11 @@
|
|
|
12
12
|
* Renders `role="alert"`. Tones map to sindarian-ui's `system-*` semantic token
|
|
13
13
|
* families, so they track the active light/dark palette automatically.
|
|
14
14
|
*/
|
|
15
|
-
import type { ReactNode } from 'react';
|
|
15
|
+
import type { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
16
16
|
export type AlertBannerTone = 'destructive' | 'warning' | 'info' | 'success' | 'neutral';
|
|
17
|
-
|
|
17
|
+
/** `title` is widened to ReactNode, so the DOM `title` attribute (a string)
|
|
18
|
+
* is omitted rather than conflicting. */
|
|
19
|
+
export type AlertBannerProps = Omit<ComponentPropsWithoutRef<'div'>, 'title'> & {
|
|
18
20
|
tone?: AlertBannerTone;
|
|
19
21
|
/** Bold lead line, carries the tone color. */
|
|
20
22
|
title?: ReactNode;
|
|
@@ -26,5 +28,5 @@ export type AlertBannerProps = {
|
|
|
26
28
|
icon?: ReactNode;
|
|
27
29
|
className?: string;
|
|
28
30
|
};
|
|
29
|
-
export declare function AlertBanner({ tone, title, children, detail, icon, className }: AlertBannerProps): import("react").JSX.Element;
|
|
31
|
+
export declare function AlertBanner({ tone, title, children, detail, icon, className, ...props }: AlertBannerProps): import("react").JSX.Element;
|
|
30
32
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/enterprise/alert-banner/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/enterprise/alert-banner/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,wBAAwB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAIhE,MAAM,MAAM,eAAe,GACzB,aAAa,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,CAAA;AAoB5D;0CAC0C;AAC1C,MAAM,MAAM,gBAAgB,GAAG,IAAI,CACjC,wBAAwB,CAAC,KAAK,CAAC,EAC/B,OAAO,CACR,GAAG;IACF,IAAI,CAAC,EAAE,eAAe,CAAA;IACtB,8CAA8C;IAC9C,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,+DAA+D;IAC/D,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,yEAAyE;IACzE,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,wBAAgB,WAAW,CAAC,EAC1B,IAAgB,EAChB,KAAK,EACL,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,SAAS,EACT,GAAG,KAAK,EACT,EAAE,gBAAgB,+BAuClB"}
|
|
@@ -16,6 +16,6 @@ const TONE_TITLE = {
|
|
|
16
16
|
success: 'text-system-success-text',
|
|
17
17
|
neutral: 'text-foreground'
|
|
18
18
|
};
|
|
19
|
-
export function AlertBanner({ tone = 'neutral', title, children, detail, icon, className }) {
|
|
20
|
-
return (_jsxs("div", { role: "alert", "data-tone": tone, className: cn('flex gap-3 rounded-md border px-4 py-3', TONE_CONTAINER[tone], className), children: [icon != null ? (_jsx("span", { className: cn('mt-0.5 shrink-0', TONE_TITLE[tone]), "aria-hidden": true, children: icon })) : null, _jsxs("div", { className: "min-w-0 flex-1 space-y-1", children: [title != null ? (_jsx("p", { className: cn('text-sm font-medium', TONE_TITLE[tone]), children: title })) : null, children != null ? (_jsx("div", { className: "text-foreground text-xs leading-relaxed", children: children })) : null, detail != null ? (_jsx("pre", { className: "text-muted-foreground overflow-x-auto font-mono text-xs break-words whitespace-pre-wrap", children: detail })) : null] })] }));
|
|
19
|
+
export function AlertBanner({ tone = 'neutral', title, children, detail, icon, className, ...props }) {
|
|
20
|
+
return (_jsxs("div", { ...props, role: "alert", "data-tone": tone, className: cn('flex gap-3 rounded-md border px-4 py-3', TONE_CONTAINER[tone], className), children: [icon != null ? (_jsx("span", { className: cn('mt-0.5 shrink-0', TONE_TITLE[tone]), "aria-hidden": true, children: icon })) : null, _jsxs("div", { className: "min-w-0 flex-1 space-y-1", children: [title != null ? (_jsx("p", { className: cn('text-sm font-medium', TONE_TITLE[tone]), children: title })) : null, children != null ? (_jsx("div", { className: "text-foreground text-xs leading-relaxed", children: children })) : null, detail != null ? (_jsx("pre", { className: "text-muted-foreground overflow-x-auto font-mono text-xs break-words whitespace-pre-wrap", children: detail })) : null] })] }));
|
|
21
21
|
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { Column } from '@tanstack/react-table';
|
|
2
|
+
/**
|
|
3
|
+
* The sizing a column DECLARED, in px. Only keys the ColumnDef actually carried
|
|
4
|
+
* are present, so an undeclared column reads back as `undefined` and keeps
|
|
5
|
+
* whatever width its layout gives it.
|
|
6
|
+
*/
|
|
7
|
+
export type DeclaredColumnSize = {
|
|
8
|
+
width?: number;
|
|
9
|
+
minWidth?: number;
|
|
10
|
+
maxWidth?: number;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* The column sizing a ColumnDef actually DECLARED, or `undefined` when it
|
|
14
|
+
* declared none. This is VirtualizedTable's reading: flex rows honour all
|
|
15
|
+
* three, so `size`, `minSize` and `maxSize` all PIN. DataTable's `<th>`/`<td>`
|
|
16
|
+
* path reads the same declaration through {@link readPreferredColumnSize},
|
|
17
|
+
* which drops the ceiling CSS auto table layout cannot enforce.
|
|
18
|
+
*
|
|
19
|
+
* Reading the raw `columnDef` is only honest because both tables pass
|
|
20
|
+
* `defaultColumn: { size: undefined, minSize: undefined, maxSize: undefined }`
|
|
21
|
+
* to `useReactTable`. TanStack builds every columnDef as
|
|
22
|
+
* `{ ...featureDefaults, ...table.options.defaultColumn, ...userDef }`, so
|
|
23
|
+
* those three overrides blank out the `defaultColumnSizing` the ColumnSizing
|
|
24
|
+
* feature would otherwise stamp on every column (150 / 20 / MAX_SAFE_INTEGER).
|
|
25
|
+
* Without them a column asking for nothing reports `size: 150` and a column
|
|
26
|
+
* asking for exactly 150 is indistinguishable from it. `column.getSize()` is
|
|
27
|
+
* unaffected: it falls back to `defaultColumnSizing` with `??`, so column
|
|
28
|
+
* offsets and the table's total size are byte-identical either way.
|
|
29
|
+
*
|
|
30
|
+
* Width comes from `getSize()` rather than the raw `size` so it lands already
|
|
31
|
+
* clamped by the column's own min/max.
|
|
32
|
+
*/
|
|
33
|
+
export declare function readDeclaredColumnSize<TData>(column: Column<TData, unknown>): DeclaredColumnSize | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* A GROUP header cell is exactly as wide as the leaf columns it spans, so it
|
|
36
|
+
* can only be pinned when every one of them is: a group whose leaves are
|
|
37
|
+
* partly sized has no honest fixed width, and keeps its colSpan flex share so
|
|
38
|
+
* the header rule still tracks the cells beneath it. Reading the group's own
|
|
39
|
+
* ColumnDef instead would size the header against a declaration its body cells
|
|
40
|
+
* never see.
|
|
41
|
+
*
|
|
42
|
+
* Every dimension the leaves agree on carries up, CEILING INCLUDED. This is
|
|
43
|
+
* VirtualizedTable's path, where flex rows honour `maxSize` on a leaf — so a
|
|
44
|
+
* group of capped leaves whose header carried no `maxWidth` was free to grow
|
|
45
|
+
* past every column it names, which is the same header-vs-cells drift the
|
|
46
|
+
* width sum exists to prevent. Each dimension is decided on its own: a group
|
|
47
|
+
* can be uncapped and still have a floor.
|
|
48
|
+
*/
|
|
49
|
+
export declare function readDeclaredGroupSize<TData>(leaves: Column<TData, unknown>[]): DeclaredColumnSize | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* The same declaration as {@link readDeclaredColumnSize}, minus `maxWidth`.
|
|
52
|
+
*
|
|
53
|
+
* DataTable renders real `<th>`/`<td>` under CSS AUTO table layout, where
|
|
54
|
+
* Chrome and Firefox ignore `max-width` on a cell. Emitting it would advertise
|
|
55
|
+
* a ceiling that never holds, so this path keeps only what the layout obeys:
|
|
56
|
+
* `size` as a PREFERRED width and `minSize` as a floor. A column that must not
|
|
57
|
+
* grow past a width belongs in VirtualizedTable.
|
|
58
|
+
*/
|
|
59
|
+
export declare function readPreferredColumnSize<TData>(column: Column<TData, unknown>): DeclaredColumnSize | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* Blanks out the `defaultColumnSizing` TanStack stamps onto every ColumnDef, so
|
|
62
|
+
* `columnDef.size` / `minSize` / `maxSize` mean "the consumer asked for this"
|
|
63
|
+
* and nothing else. Both tables pass it to `useReactTable`.
|
|
64
|
+
*/
|
|
65
|
+
export declare const UNSIZED_DEFAULT_COLUMN: {
|
|
66
|
+
size: undefined;
|
|
67
|
+
minSize: undefined;
|
|
68
|
+
maxSize: undefined;
|
|
69
|
+
};
|
|
70
|
+
//# sourceMappingURL=column-size.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"column-size.d.ts","sourceRoot":"","sources":["../../../../src/enterprise/data-table/column-size.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAEnD;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAC1C,MAAM,EAAE,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,GAC7B,kBAAkB,GAAG,SAAS,CAUhC;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EACzC,MAAM,EAAE,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,GAC/B,kBAAkB,GAAG,SAAS,CAchC;AAsBD;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAC3C,MAAM,EAAE,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,GAC7B,kBAAkB,GAAG,SAAS,CAQhC;AAED;;;;GAIG;AACH,eAAO,MAAM,sBAAsB;;;;CAIlC,CAAA"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The column sizing a ColumnDef actually DECLARED, or `undefined` when it
|
|
3
|
+
* declared none. This is VirtualizedTable's reading: flex rows honour all
|
|
4
|
+
* three, so `size`, `minSize` and `maxSize` all PIN. DataTable's `<th>`/`<td>`
|
|
5
|
+
* path reads the same declaration through {@link readPreferredColumnSize},
|
|
6
|
+
* which drops the ceiling CSS auto table layout cannot enforce.
|
|
7
|
+
*
|
|
8
|
+
* Reading the raw `columnDef` is only honest because both tables pass
|
|
9
|
+
* `defaultColumn: { size: undefined, minSize: undefined, maxSize: undefined }`
|
|
10
|
+
* to `useReactTable`. TanStack builds every columnDef as
|
|
11
|
+
* `{ ...featureDefaults, ...table.options.defaultColumn, ...userDef }`, so
|
|
12
|
+
* those three overrides blank out the `defaultColumnSizing` the ColumnSizing
|
|
13
|
+
* feature would otherwise stamp on every column (150 / 20 / MAX_SAFE_INTEGER).
|
|
14
|
+
* Without them a column asking for nothing reports `size: 150` and a column
|
|
15
|
+
* asking for exactly 150 is indistinguishable from it. `column.getSize()` is
|
|
16
|
+
* unaffected: it falls back to `defaultColumnSizing` with `??`, so column
|
|
17
|
+
* offsets and the table's total size are byte-identical either way.
|
|
18
|
+
*
|
|
19
|
+
* Width comes from `getSize()` rather than the raw `size` so it lands already
|
|
20
|
+
* clamped by the column's own min/max.
|
|
21
|
+
*/
|
|
22
|
+
export function readDeclaredColumnSize(column) {
|
|
23
|
+
const { size, minSize, maxSize } = column.columnDef;
|
|
24
|
+
const width = size === undefined ? undefined : column.getSize();
|
|
25
|
+
if (width === undefined && minSize === undefined && maxSize === undefined) {
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
return { width, minWidth: minSize, maxWidth: maxSize };
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A GROUP header cell is exactly as wide as the leaf columns it spans, so it
|
|
32
|
+
* can only be pinned when every one of them is: a group whose leaves are
|
|
33
|
+
* partly sized has no honest fixed width, and keeps its colSpan flex share so
|
|
34
|
+
* the header rule still tracks the cells beneath it. Reading the group's own
|
|
35
|
+
* ColumnDef instead would size the header against a declaration its body cells
|
|
36
|
+
* never see.
|
|
37
|
+
*
|
|
38
|
+
* Every dimension the leaves agree on carries up, CEILING INCLUDED. This is
|
|
39
|
+
* VirtualizedTable's path, where flex rows honour `maxSize` on a leaf — so a
|
|
40
|
+
* group of capped leaves whose header carried no `maxWidth` was free to grow
|
|
41
|
+
* past every column it names, which is the same header-vs-cells drift the
|
|
42
|
+
* width sum exists to prevent. Each dimension is decided on its own: a group
|
|
43
|
+
* can be uncapped and still have a floor.
|
|
44
|
+
*/
|
|
45
|
+
export function readDeclaredGroupSize(leaves) {
|
|
46
|
+
if (leaves.length === 0)
|
|
47
|
+
return undefined;
|
|
48
|
+
const sizes = leaves.map(readDeclaredColumnSize);
|
|
49
|
+
const width = sum(sizes, 'width');
|
|
50
|
+
const minWidth = sum(sizes, 'minWidth');
|
|
51
|
+
const maxWidth = sum(sizes, 'maxWidth');
|
|
52
|
+
if (width === undefined && minWidth === undefined && maxWidth === undefined) {
|
|
53
|
+
return undefined;
|
|
54
|
+
}
|
|
55
|
+
return { width, minWidth, maxWidth };
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* The total of one dimension, or `undefined` unless EVERY leaf declared it. One
|
|
59
|
+
* leaf short and the group has no honest total: an unsized leaf flexes, an
|
|
60
|
+
* unfloored one can shrink, and an uncapped one grows without limit.
|
|
61
|
+
*/
|
|
62
|
+
function sum(sizes, key) {
|
|
63
|
+
let total = 0;
|
|
64
|
+
for (const size of sizes) {
|
|
65
|
+
const value = size?.[key];
|
|
66
|
+
if (value === undefined)
|
|
67
|
+
return undefined;
|
|
68
|
+
total += value;
|
|
69
|
+
}
|
|
70
|
+
return total;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* The same declaration as {@link readDeclaredColumnSize}, minus `maxWidth`.
|
|
74
|
+
*
|
|
75
|
+
* DataTable renders real `<th>`/`<td>` under CSS AUTO table layout, where
|
|
76
|
+
* Chrome and Firefox ignore `max-width` on a cell. Emitting it would advertise
|
|
77
|
+
* a ceiling that never holds, so this path keeps only what the layout obeys:
|
|
78
|
+
* `size` as a PREFERRED width and `minSize` as a floor. A column that must not
|
|
79
|
+
* grow past a width belongs in VirtualizedTable.
|
|
80
|
+
*/
|
|
81
|
+
export function readPreferredColumnSize(column) {
|
|
82
|
+
const { width, minWidth } = readDeclaredColumnSize(column) ?? {};
|
|
83
|
+
if (width === undefined && minWidth === undefined) {
|
|
84
|
+
return undefined;
|
|
85
|
+
}
|
|
86
|
+
return { width, minWidth };
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Blanks out the `defaultColumnSizing` TanStack stamps onto every ColumnDef, so
|
|
90
|
+
* `columnDef.size` / `minSize` / `maxSize` mean "the consumer asked for this"
|
|
91
|
+
* and nothing else. Both tables pass it to `useReactTable`.
|
|
92
|
+
*/
|
|
93
|
+
export const UNSIZED_DEFAULT_COLUMN = {
|
|
94
|
+
size: undefined,
|
|
95
|
+
minSize: undefined,
|
|
96
|
+
maxSize: undefined
|
|
97
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/enterprise/data-table/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/enterprise/data-table/index.tsx"],"names":[],"mappings":"AAkDA,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,UAAU,EAEf,KAAK,OAAO,EACZ,KAAK,iBAAiB,EAEvB,MAAM,uBAAuB,CAAA;AAc9B,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAGjE;;;;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,KAAK,CAAA;IAC1B,YAAY,CAAC,EAAE,KAAK,CAAA;IACpB,oBAAoB,CAAC,EAAE,KAAK,CAAA;IAC5B,oBAAoB,CAAC,EAAE,KAAK,CAAA;CAC7B,GACD;IACE,kBAAkB,EAAE,IAAI,CAAA;IACxB,kFAAkF;IAClF,YAAY,EAAE,iBAAiB,CAAA;IAC/B,4DAA4D;IAC5D,oBAAoB,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAA;IACnD;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,CAAC,GAAG,EAAE,K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oBAAoB,EACpB,aAAa,EACb,OAAO,EACP,SAAS,EACT,aAAa,EACb,MAAM,EACP,EAAE,cAAc,CAAC,KAAK,CAAC,+BAySvB"}
|
|
@@ -17,6 +17,18 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
17
17
|
* `original` value, so screens compose money / date / status cells directly in
|
|
18
18
|
* their column `cell` renderers.
|
|
19
19
|
*
|
|
20
|
+
* Declared column sizing (see `./column-size`) does NOT mean the same thing in
|
|
21
|
+
* the kit's two table paths, because their layouts differ:
|
|
22
|
+
* - DataTable renders real `<th>`/`<td>` under CSS AUTO table layout (the
|
|
23
|
+
* `Table` primitive sets no `table-fixed`). There, `size` is a PREFERRED
|
|
24
|
+
* width the browser may exceed to fit content, `minSize` acts as a floor,
|
|
25
|
+
* and `maxSize` is ignored outright — Chrome and Firefox do not apply
|
|
26
|
+
* `max-width` to table cells. A column declaring none keeps auto width.
|
|
27
|
+
* - VirtualizedTable renders flex rows, where all three PIN: `size`,
|
|
28
|
+
* `minSize` and `maxSize` are honoured exactly as declared.
|
|
29
|
+
* So a column that must not grow past a width belongs in VirtualizedTable, or
|
|
30
|
+
* in a cell renderer that truncates its own content.
|
|
31
|
+
*
|
|
20
32
|
* Row selection is opt-in and controlled: pass `enableRowSelection` plus
|
|
21
33
|
* `rowSelection` / `onRowSelectionChange` (TanStack-native types). When
|
|
22
34
|
* enabled, a checkbox column is prepended — header checkbox selects the
|
|
@@ -42,6 +54,7 @@ import { Skeleton } from '../../components/ui/skeleton/index.js';
|
|
|
42
54
|
import { LABEL_VOICE_CLASS } from '../../lib/typography.js';
|
|
43
55
|
import { cn } from '../../lib/utils.js';
|
|
44
56
|
import { EmptyState } from '../empty-state/index.js';
|
|
57
|
+
import { readPreferredColumnSize, UNSIZED_DEFAULT_COLUMN } from './column-size.js';
|
|
45
58
|
const SELECTION_COLUMN_ID = '__select__';
|
|
46
59
|
const CHECKBOX_CLASS = 'accent-primary block size-4';
|
|
47
60
|
/** Right-aligned mono treatment for `meta: { numeric: true }` columns. */
|
|
@@ -86,6 +99,10 @@ export function DataTable({ columns, data, loading = false, skeletonRows = 8, lo
|
|
|
86
99
|
const table = useReactTable({
|
|
87
100
|
data,
|
|
88
101
|
columns: tableColumns,
|
|
102
|
+
// Keeps `columnDef.size`/`minSize`/`maxSize` meaning "declared" — see
|
|
103
|
+
// ./column-size. `getSize()` is unaffected; it falls back to the library
|
|
104
|
+
// defaults itself.
|
|
105
|
+
defaultColumn: UNSIZED_DEFAULT_COLUMN,
|
|
89
106
|
getCoreRowModel: getCoreRowModel(),
|
|
90
107
|
getRowId,
|
|
91
108
|
enableRowSelection,
|
|
@@ -217,7 +234,10 @@ export function DataTable({ columns, data, loading = false, skeletonRows = 8, lo
|
|
|
217
234
|
? 'No rows'
|
|
218
235
|
: `${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) => {
|
|
219
236
|
const numeric = header.column.columnDef.meta?.numeric;
|
|
220
|
-
return (_jsx(TableHead, { align: numeric ? 'right' : undefined,
|
|
237
|
+
return (_jsx(TableHead, { align: numeric ? 'right' : undefined,
|
|
238
|
+
// Only a column that DECLARED sizing gets an inline width;
|
|
239
|
+
// everything else keeps the auto table layout it has today.
|
|
240
|
+
style: readPreferredColumnSize(header.column), className: cn(LABEL_VOICE_CLASS, headDensityClass, header.column.id === SELECTION_COLUMN_ID && 'w-10', headClassName), children: header.isPlaceholder
|
|
221
241
|
? null
|
|
222
242
|
: flexRender(header.column.columnDef.header, header.getContext()) }, header.id));
|
|
223
243
|
}) }, 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,
|
|
@@ -240,7 +260,7 @@ export function DataTable({ columns, data, loading = false, skeletonRows = 8, lo
|
|
|
240
260
|
? (event) => handleRowKeyDown(event, row, rowIndex)
|
|
241
261
|
: undefined, className: keyboardNav ? ROW_FOCUS_CLASS : undefined, "data-state": enableRowSelection && row.getIsSelected()
|
|
242
262
|
? 'selected'
|
|
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
|
|
263
|
+
: undefined, children: row.getVisibleCells().map((cell) => (_jsx(TableCell, { style: readPreferredColumnSize(cell.column), 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
|
|
244
264
|
? stopPropagation
|
|
245
265
|
: undefined, children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))) }, row.id)))) }), footer ? _jsx(TableFooter, { children: footer }) : null] })] }));
|
|
246
266
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/enterprise/date-range-picker/index.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAMtD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/enterprise/date-range-picker/index.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAMtD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AASnD;;;;GAIG;AACH,KAAK,cAAc,GAAG,cAAc,CAAC,OAAO,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAA;AAE/D,MAAM,MAAM,cAAc,GAAG;IAC3B,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAA;IACZ,mCAAmC;IACnC,EAAE,EAAE,MAAM,CAAA;CACX,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,EAAE,cAAc,CAAA;IACrB,aAAa,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAA;IAC7C,8EAA8E;IAC9E,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,SAAS,CAAA;IACpB,OAAO,EAAE,SAAS,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,yEAAyE;IACzE,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,sCAAsC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,kCAAkC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,2DAA2D;IAC3D,MAAM,CAAC,EAAE,cAAc,CAAA;CACxB,CAAA;AAkCD,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,aAAa,EACb,MAAM,EACN,IAAI,EACJ,SAAS,EACT,OAAO,EACP,OAAe,EACf,OAAO,EACP,WAAwB,EACxB,SAA+B,EAC/B,UAAoB,EACpB,MAAa,EACd,EAAE,oBAAoB,+BAsHtB"}
|
|
@@ -27,7 +27,6 @@ import { Button } from '../../components/ui/button/index.js';
|
|
|
27
27
|
import { Calendar } from '../../components/ui/calendar/index.js';
|
|
28
28
|
import { Label } from '../../components/ui/label/index.js';
|
|
29
29
|
import { Popover, PopoverContent, PopoverTrigger } from '../../components/ui/popover/index.js';
|
|
30
|
-
import { SECTION_LABEL_CLASS } from '../../lib/typography.js';
|
|
31
30
|
import { cn } from '../../lib/utils.js';
|
|
32
31
|
/** Leading YYYY-MM-DD of an ISO date (or date-time) string. */
|
|
33
32
|
const ISO_DAY = /^(\d{4})-(\d{2})-(\d{2})/;
|
|
@@ -84,6 +83,6 @@ export function DateRangePicker({ value, onValueChange, fromId, toId, fromLabel,
|
|
|
84
83
|
// segments read and write the SAME range selection, so which one you opened
|
|
85
84
|
// changes only the anchor, never the state.
|
|
86
85
|
const calendar = (_jsxs(_Fragment, { children: [_jsx(Calendar, { mode: "range", numberOfMonths: 2, defaultMonth: fromDate ?? toDate ?? new Date(), selected: selected, onSelect: onSelect, locale: locale }), _jsx("div", { className: "border-border flex items-center justify-end border-t px-3 py-2", children: _jsx(Button, { type: "button", variant: "plain", size: "small", disabled: !hasValue, onClick: () => onValueChange({ from: '', to: '' }), children: clearLabel }) })] }));
|
|
87
|
-
const renderSegment = (segment, id, label, dateValue) => (_jsxs(Popover, { open: openSegment === segment, onOpenChange: (next) => setOpenSegment(next ? segment : null), children: [_jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx(Label, { htmlFor: id,
|
|
86
|
+
const renderSegment = (segment, id, label, dateValue) => (_jsxs(Popover, { open: openSegment === segment, onOpenChange: (next) => setOpenSegment(next ? segment : null), children: [_jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx(Label, { htmlFor: id, children: label }), _jsxs(PopoverTrigger, { type: "button", id: id, className: triggerClass, "aria-invalid": invalid || undefined, "aria-describedby": invalid ? errorId : undefined, children: [_jsx(CalendarDays, { className: "text-muted-foreground size-4 shrink-0", "aria-hidden": true }), dateValue ? (_jsx("span", { children: dateValue })) : (_jsx("span", { className: "text-muted-foreground font-sans", children: placeholder }))] })] }), _jsx(PopoverContent, { align: "start", className: "w-auto p-0", "aria-label": ariaLabel, children: calendar })] }, segment));
|
|
88
87
|
return (_jsxs("div", { className: "flex flex-col gap-3 sm:flex-row sm:items-end", children: [renderSegment('from', fromId, fromLabel, value.from), renderSegment('to', toId, toLabel, value.to)] }));
|
|
89
88
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* StatCard — a single headline-figure cell of the console.
|
|
3
3
|
*
|
|
4
|
-
* A `LedgerPanel` holding a recessive `SectionLabel`, the dominant
|
|
4
|
+
* A `LedgerPanel` holding a recessive `SectionLabel`, the dominant
|
|
5
5
|
* `Figure`, an optional delta line, an optional inline trend, and optional
|
|
6
6
|
* secondary `BlotterRow` key/value rows. Drop StatCards into a `LedgerSheet` so
|
|
7
7
|
* they read as connected hairline-seamed panels rather than floating cards.
|
|
@@ -23,9 +23,9 @@ export type StatCardRow = {
|
|
|
23
23
|
value: ReactNode;
|
|
24
24
|
};
|
|
25
25
|
export type StatCardProps = {
|
|
26
|
-
/** Recessive
|
|
26
|
+
/** Recessive heading, rendered through `SectionLabel`'s quiet label voice. */
|
|
27
27
|
label: string;
|
|
28
|
-
/** The dominant headline value — rendered in the hero
|
|
28
|
+
/** The dominant headline value — rendered in the hero figure. */
|
|
29
29
|
value: ReactNode;
|
|
30
30
|
/** Optional delta line below the value (e.g. `+0.6 pts`, `-3`). Inherits the tone color. */
|
|
31
31
|
delta?: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/enterprise/stat-card/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAQtC,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,aAAa,CAAA;AAoB5E,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,SAAS,CAAA;IAChB,KAAK,EAAE,SAAS,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/enterprise/stat-card/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAQtC,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,aAAa,CAAA;AAoB5E,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,SAAS,CAAA;IAChB,KAAK,EAAE,SAAS,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,8EAA8E;IAC9E,KAAK,EAAE,MAAM,CAAA;IACb,iEAAiE;IACjE,KAAK,EAAE,SAAS,CAAA;IAChB,4FAA4F;IAC5F,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,uDAAuD;IACvD,IAAI,CAAC,EAAE,YAAY,CAAA;IACnB,sDAAsD;IACtD,KAAK,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC,CAAC,CAAA;IAC7D,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,yCAAyC;IACzC,IAAI,CAAC,EAAE,WAAW,EAAE,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAwED,wBAAgB,QAAQ,CAAC,EACvB,KAAK,EACL,KAAK,EACL,KAAK,EACL,IAAgB,EAChB,KAAK,EACL,QAAkB,EAClB,IAAI,EACJ,SAAS,EACV,EAAE,aAAa,+BAgCf"}
|
|
@@ -60,5 +60,5 @@ function TrendSpark({ data, dataKey, color }) {
|
|
|
60
60
|
export function StatCard({ label, value, delta, tone = 'default', trend, trendKey = 'value', rows, className }) {
|
|
61
61
|
const hasTrend = trend !== undefined && trend.length > 0;
|
|
62
62
|
const hasRows = rows !== undefined && rows.length > 0;
|
|
63
|
-
return (_jsxs(LedgerPanel, { "data-tone": tone, className: className, children: [_jsx(SectionLabel, { children: label }), _jsxs("div", { className: "space-y-1", children: [_jsx(Figure, { size: "hero", className: cn('block', TONE_VALUE[tone]), children: value }), delta !== undefined ? (_jsx("p", { className: cn('
|
|
63
|
+
return (_jsxs(LedgerPanel, { "data-tone": tone, className: className, children: [_jsx(SectionLabel, { children: label }), _jsxs("div", { className: "space-y-1", children: [_jsx(Figure, { size: "hero", className: cn('block', TONE_VALUE[tone]), children: value }), delta !== undefined ? (_jsx("p", { className: cn('text-xs tabular-nums', TONE_VALUE[tone]), children: delta })) : null] }), hasTrend ? (_jsx(TrendSpark, { data: trend, dataKey: trendKey, color: TONE_TREND[tone] })) : null, hasRows ? (_jsx(Blotter, { className: "mt-auto", children: rows.map((row, i) => (_jsx(BlotterRow, { label: row.label, value: row.value }, i))) })) : null] }));
|
|
64
64
|
}
|