@lerianstudio/sindarian-ui 1.4.0-beta.3 → 1.4.0-beta.5
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/form/date-picker-field/index.d.ts +12 -2
- package/dist/components/form/date-picker-field/index.d.ts.map +1 -1
- package/dist/components/form/date-picker-field/index.js +7 -2
- package/dist/components/form/date-range-field/index.d.ts +12 -2
- package/dist/components/form/date-range-field/index.d.ts.map +1 -1
- package/dist/components/form/date-range-field/index.js +3 -2
- package/dist/components/form/date-time-picker-field/index.d.ts +12 -2
- package/dist/components/form/date-time-picker-field/index.d.ts.map +1 -1
- package/dist/components/form/date-time-picker-field/index.js +3 -2
- 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/calendar/index.d.ts.map +1 -1
- package/dist/components/ui/calendar/index.js +1 -4
- 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 +8 -1
- package/dist/enterprise/date-range-picker/index.d.ts.map +1 -1
- package/dist/enterprise/date-range-picker/index.js +10 -5
- 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/form/date-picker-field/index.d.ts +12 -2
- package/dist/esm/components/form/date-picker-field/index.d.ts.map +1 -1
- package/dist/esm/components/form/date-picker-field/index.js +7 -2
- package/dist/esm/components/form/date-range-field/index.d.ts +12 -2
- package/dist/esm/components/form/date-range-field/index.d.ts.map +1 -1
- package/dist/esm/components/form/date-range-field/index.js +3 -2
- package/dist/esm/components/form/date-time-picker-field/index.d.ts +12 -2
- package/dist/esm/components/form/date-time-picker-field/index.d.ts.map +1 -1
- package/dist/esm/components/form/date-time-picker-field/index.js +3 -2
- 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/calendar/index.d.ts.map +1 -1
- package/dist/esm/components/ui/calendar/index.js +1 -4
- 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 +8 -1
- package/dist/esm/enterprise/date-range-picker/index.d.ts.map +1 -1
- package/dist/esm/enterprise/date-range-picker/index.js +10 -5
- 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
|
@@ -58,14 +58,22 @@ export declare const MultipleSelectItem: React.ForwardRefExoticComponent<Omit<{
|
|
|
58
58
|
keywords?: string[];
|
|
59
59
|
forceMount?: boolean;
|
|
60
60
|
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
61
|
-
|
|
61
|
+
/**
|
|
62
|
+
* cmdk's own `value`/`defaultValue`/`onValueChange` are single-string search
|
|
63
|
+
* state. Spreading them and re-declaring the multi-select versions produced an
|
|
64
|
+
* INTERSECTION (`string & string[]`, and a handler taking both `string` and
|
|
65
|
+
* `string[]`), which no caller can satisfy — the controlled shape this
|
|
66
|
+
* component exists for was uncallable. They are omitted before the multi-value
|
|
67
|
+
* versions are declared; the component consumes cmdk's search state itself.
|
|
68
|
+
*/
|
|
69
|
+
export type MultipleSelectProps = Omit<React.ComponentPropsWithoutRef<typeof CommandPrimitive>, 'value' | 'defaultValue' | 'onValueChange'> & {
|
|
62
70
|
value?: string[] | [];
|
|
63
71
|
defaultValue?: string[] | [];
|
|
64
72
|
onValueChange?: (values: string[]) => void;
|
|
65
73
|
showValue?: boolean;
|
|
66
74
|
disabled?: boolean;
|
|
67
75
|
};
|
|
68
|
-
export declare const MultipleSelect: React.ForwardRefExoticComponent<Omit<{
|
|
76
|
+
export declare const MultipleSelect: React.ForwardRefExoticComponent<Omit<Omit<{
|
|
69
77
|
children?: React.ReactNode;
|
|
70
78
|
} & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
71
79
|
ref?: React.Ref<HTMLDivElement>;
|
|
@@ -81,7 +89,7 @@ export declare const MultipleSelect: React.ForwardRefExoticComponent<Omit<{
|
|
|
81
89
|
loop?: boolean;
|
|
82
90
|
disablePointerSelection?: boolean;
|
|
83
91
|
vimBindings?: boolean;
|
|
84
|
-
} & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
92
|
+
} & React.RefAttributes<HTMLDivElement>, "ref">, "value" | "defaultValue" | "onValueChange"> & {
|
|
85
93
|
value?: string[] | [];
|
|
86
94
|
defaultValue?: string[] | [];
|
|
87
95
|
onValueChange?: (values: string[]) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/multiple-select/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAmB,MAAM,MAAM,CAAA;AAgDnE,eAAO,MAAM,qBAAqB;;;eAG0B,OAAO;wCAyFjE,CAAA;AAGF,eAAO,MAAM,mBAAmB;;;;;;;0FAiD9B,CAAA;AAGF,eAAO,MAAM,mBAAmB;;;;;;uJAiB9B,CAAA;AAGF,MAAM,MAAM,0BAA0B,GAAG,KAAK,CAAC,wBAAwB,CACrE,OAAO,gBAAgB,CAAC,IAAI,CAC7B,GAAG;IACF,QAAQ,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAA;CAC/B,CAAA;AAED,eAAO,MAAM,qBAAqB;;;;;;;;;eAHrB,QAAQ,GAAG,QAAQ;wCA+D/B,CAAA;AAGD,eAAO,MAAM,mBAAmB;;;;;;;;;;sFAY9B,CAAA;AAGF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;sFAiC9B,CAAA;AAGD,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAC,wBAAwB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/multiple-select/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAmB,MAAM,MAAM,CAAA;AAgDnE,eAAO,MAAM,qBAAqB;;;eAG0B,OAAO;wCAyFjE,CAAA;AAGF,eAAO,MAAM,mBAAmB;;;;;;;0FAiD9B,CAAA;AAGF,eAAO,MAAM,mBAAmB;;;;;;uJAiB9B,CAAA;AAGF,MAAM,MAAM,0BAA0B,GAAG,KAAK,CAAC,wBAAwB,CACrE,OAAO,gBAAgB,CAAC,IAAI,CAC7B,GAAG;IACF,QAAQ,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAA;CAC/B,CAAA;AAED,eAAO,MAAM,qBAAqB;;;;;;;;;eAHrB,QAAQ,GAAG,QAAQ;wCA+D/B,CAAA;AAGD,eAAO,MAAM,mBAAmB;;;;;;;;;;sFAY9B,CAAA;AAGF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;sFAiC9B,CAAA;AAGD;;;;;;;GAOG;AACH,MAAM,MAAM,mBAAmB,GAAG,IAAI,CACpC,KAAK,CAAC,wBAAwB,CAAC,OAAO,gBAAgB,CAAC,EACvD,OAAO,GAAG,cAAc,GAAG,eAAe,CAC3C,GAAG;IACF,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,CAAA;IACrB,YAAY,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,CAAA;IAC5B,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;IAC1C,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;YAPjB,MAAM,EAAE,GAAG,EAAE;mBACN,MAAM,EAAE,GAAG,EAAE;oBACZ,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI;gBAC9B,OAAO;eACR,OAAO;wCA2HnB,CAAA"}
|
|
@@ -2,6 +2,11 @@ import * as React from 'react';
|
|
|
2
2
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
3
3
|
declare function Select({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>): React.JSX.Element;
|
|
4
4
|
declare function SelectGroup({ ...props }: React.ComponentProps<typeof SelectPrimitive.Group>): React.JSX.Element;
|
|
5
|
+
/**
|
|
6
|
+
* Radix strips `className` and `style` off its `Select.Value` before rendering
|
|
7
|
+
* the span, so this slot cannot be styled directly — it is styled from the
|
|
8
|
+
* trigger instead, see VALUE_OVERFLOW_CLASS.
|
|
9
|
+
*/
|
|
5
10
|
declare function SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>): React.JSX.Element;
|
|
6
11
|
type SelectTriggerProps = React.ComponentProps<typeof SelectPrimitive.Trigger> & {
|
|
7
12
|
readOnly?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/select/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AAKzD,iBAAS,MAAM,CAAC,EACd,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,qBAEnD;AAED,iBAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,qBAEpD;AAED,iBAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,qBAEpD;AAED,KAAK,kBAAkB,GAAG,KAAK,CAAC,cAAc,CAC5C,OAAO,eAAe,CAAC,OAAO,CAC/B,GAAG;IACF,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/select/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AAKzD,iBAAS,MAAM,CAAC,EACd,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,qBAEnD;AAED,iBAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK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K,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,SAAS,CAAC,qBAQxD;AAED,OAAO,EACL,MAAM,EACN,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,EACb,WAAW,EACX,WAAW,EACX,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,sBAAsB,EACvB,CAAA"}
|
|
@@ -56,11 +56,34 @@ function Select({ ...props }) {
|
|
|
56
56
|
function SelectGroup({ ...props }) {
|
|
57
57
|
return (0, jsx_runtime_1.jsx)(SelectPrimitive.Group, { "data-slot": "select-group", ...props });
|
|
58
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* Radix strips `className` and `style` off its `Select.Value` before rendering
|
|
61
|
+
* the span, so this slot cannot be styled directly — it is styled from the
|
|
62
|
+
* trigger instead, see VALUE_OVERFLOW_CLASS.
|
|
63
|
+
*/
|
|
59
64
|
function SelectValue({ ...props }) {
|
|
60
65
|
return (0, jsx_runtime_1.jsx)(SelectPrimitive.Value, { "data-slot": "select-value", ...props });
|
|
61
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* Truncate the selected value instead of letting it wrap out of the trigger.
|
|
69
|
+
*
|
|
70
|
+
* `.select-trigger` is a fixed-height `flex w-full items-center justify-between`
|
|
71
|
+
* box, and a flex item never shrinks below its own min-content width: a long
|
|
72
|
+
* value broke to a second line and overflowed the box. `min-w-0` lets the value
|
|
73
|
+
* slot shrink, `truncate` ellipsises what no longer fits — the chevron keeps its
|
|
74
|
+
* place because the value absorbs all the shrinkage.
|
|
75
|
+
*
|
|
76
|
+
* Written as a child-scoped variant on the TRIGGER because Radix strips
|
|
77
|
+
* `className` off `Select.Value` itself; the `>` combinator holds because Radix
|
|
78
|
+
* renders that span as the trigger's direct child.
|
|
79
|
+
*
|
|
80
|
+
* Truncation hides text, so a trigger showing a long value should also carry
|
|
81
|
+
* `title` — on the trigger, never on the value slot, which Radix renders
|
|
82
|
+
* `pointer-events: none`.
|
|
83
|
+
*/
|
|
84
|
+
const VALUE_OVERFLOW_CLASS = '[&>[data-slot=select-value]]:min-w-0 [&>[data-slot=select-value]]:truncate';
|
|
62
85
|
function SelectTrigger({ className, readOnly, children, ...props }) {
|
|
63
|
-
return ((0, jsx_runtime_1.jsxs)(SelectPrimitive.Trigger, { "data-slot": "select-trigger", "data-size": "default", className: (0, utils_1.cn)('select-trigger select-read-only select-disabled', className), "aria-readonly": readOnly, "data-read-only": readOnly ? '' : undefined, ...props, children: [children, !readOnly && ((0, jsx_runtime_1.jsx)(SelectPrimitive.Icon, { asChild: true, children: (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { className: "select-chevron" }) }))] }));
|
|
86
|
+
return ((0, jsx_runtime_1.jsxs)(SelectPrimitive.Trigger, { "data-slot": "select-trigger", "data-size": "default", className: (0, utils_1.cn)('select-trigger select-read-only select-disabled', VALUE_OVERFLOW_CLASS, className), "aria-readonly": readOnly, "data-read-only": readOnly ? '' : undefined, ...props, children: [children, !readOnly && ((0, jsx_runtime_1.jsx)(SelectPrimitive.Icon, { asChild: true, children: (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { className: "select-chevron" }) }))] }));
|
|
64
87
|
}
|
|
65
88
|
function SelectScrollUpButton({ className, ...props }) {
|
|
66
89
|
return ((0, jsx_runtime_1.jsx)(SelectPrimitive.ScrollUpButton, { "data-slot": "select-scroll-up-button", className: (0, utils_1.cn)('select-scroll-button', className), ...props, children: (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronUp, { className: "size-4" }) }));
|
|
@@ -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;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,+BAkHnB"}
|
|
@@ -110,6 +110,6 @@ function AgingBuckets({ buckets, currency, locale, showTotal = false, labels, he
|
|
|
110
110
|
: BAND[band].tint;
|
|
111
111
|
// Shallow merge: an unlisted band keeps its pt-BR default.
|
|
112
112
|
const bandWord = labels?.bands?.[band] ?? word;
|
|
113
|
-
return ((0, jsx_runtime_1.jsxs)("li", { className: "border-border flex items-center gap-3 border-b py-2.5 last:border-b-0", children: [(0, jsx_runtime_1.jsx)(Icon, { "aria-hidden": true, className: (0, utils_1.cn)('size-4 shrink-0', tint) }), (0, jsx_runtime_1.jsxs)("span", { className: "sr-only", children: [bandWord, ": "] }), (0, jsx_runtime_1.jsx)("span", { className: (0, utils_1.cn)(typography_1.LABEL_VOICE_CLASS, 'text-foreground min-w-0 flex-1
|
|
113
|
+
return ((0, jsx_runtime_1.jsxs)("li", { className: "border-border flex items-center gap-3 border-b py-2.5 last:border-b-0", children: [(0, jsx_runtime_1.jsx)(Icon, { "aria-hidden": true, className: (0, utils_1.cn)('size-4 shrink-0', tint) }), (0, jsx_runtime_1.jsxs)("span", { className: "sr-only", children: [bandWord, ": "] }), (0, jsx_runtime_1.jsx)("span", { className: (0, utils_1.cn)(typography_1.LABEL_VOICE_CLASS, 'text-foreground min-w-0 flex-1'), children: bucket.label }), (0, jsx_runtime_1.jsxs)("span", { className: "flex shrink-0 flex-col items-end leading-none", children: [(0, jsx_runtime_1.jsx)(figure_1.Figure, { size: "row", className: "text-foreground", children: (0, format_1.formatCount)(bucket.count, locale) }), (0, jsx_runtime_1.jsx)("span", { className: (0, utils_1.cn)(typography_1.LABEL_VOICE_CLASS, 'mt-1 text-xs'), children: countLabel })] }), (0, jsx_runtime_1.jsxs)("span", { className: "flex w-32 shrink-0 flex-col items-end leading-none sm:w-40", children: [(0, jsx_runtime_1.jsx)(figure_1.Figure, { size: "row", className: (0, utils_1.cn)(band === 'overdue' && 'text-credit'), children: (0, jsx_runtime_1.jsx)(money_text_1.MoneyText, { amount: bucket.total, currency: currency, fractionDigits: scale, locale: locale, signColor: false }) }), (0, jsx_runtime_1.jsx)("span", { className: (0, utils_1.cn)(typography_1.LABEL_VOICE_CLASS, 'mt-1 text-xs'), children: totalLabel })] })] }, `${bucket.label}-${i}`));
|
|
114
114
|
}) }), showTotal ? ((0, jsx_runtime_1.jsxs)("div", { className: "border-border flex items-center gap-3 border-t-2 pt-2.5", children: [(0, jsx_runtime_1.jsx)("span", { "aria-hidden": true, className: "size-4 shrink-0" }), (0, jsx_runtime_1.jsx)("span", { className: (0, utils_1.cn)(typography_1.LABEL_VOICE_CLASS, 'text-foreground min-w-0 flex-1'), children: grandTotalLabel }), (0, jsx_runtime_1.jsx)("span", { className: "w-32 shrink-0 text-right sm:w-40", children: grandTotal === null ? ((0, jsx_runtime_1.jsx)(figure_1.Figure, { size: "row", className: "text-muted-foreground", children: format_1.NO_VALUE })) : ((0, jsx_runtime_1.jsx)(figure_1.Figure, { size: "row", className: "text-foreground font-semibold", children: (0, jsx_runtime_1.jsx)(money_text_1.MoneyText, { amount: grandTotal, currency: currency, fractionDigits: scale, locale: locale, signColor: false }) })) })] })) : null] }));
|
|
115
115
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,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B,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,SAAS,EAAE,MAAM,CAAC,CAAC,CAAA;IACnD,uEAAuE;IACvE,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,+EAA+E;IAC/E,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B;;oBAEgB;IAChB,YAAY,CAAC,EAAE,kBAAkB,CAAA;IACjC;;;mDAG+C;IAC/C,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;yEACqE;IACrE,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,0EAA0E;IAC1E,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;;;;;;;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,+BA6EvB"}
|
|
@@ -213,5 +213,5 @@ function DelinquencyAging({ buckets, currency, locale, rateLabel = 'Inadimplênc
|
|
|
213
213
|
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, utils_1.cn)('flex flex-col gap-4', className), children: [(0, jsx_runtime_1.jsxs)("header", { className: "flex items-baseline justify-between gap-3", children: [(0, jsx_runtime_1.jsx)(section_label_1.SectionLabel, { as: "span", children: rateLabel }), hasRate ? ((0, jsx_runtime_1.jsxs)("span", {
|
|
214
214
|
// A distressed rate is a credit alarm: announced the moment it
|
|
215
215
|
// crosses the band, so assistive tech does not lean on the tint.
|
|
216
|
-
role: distressed ? 'alert' : undefined, className: (0, utils_1.cn)('inline-flex items-center gap-1.5', tint), children: [(0, jsx_runtime_1.jsx)(Icon, { "aria-hidden": true, className: "size-4 shrink-0" }), (0, jsx_runtime_1.jsxs)("span", { className: "sr-only", children: [bandWord, ": "] }), (0, jsx_runtime_1.jsx)(figure_1.Figure, { size: "row", className: tint, children: (0, format_1.formatPercent)(rate, { unit: 'ratio', locale }) })] })) : ((0, jsx_runtime_1.jsxs)("span", { className: "text-muted-foreground inline-flex items-center gap-1.5", children: [(0, jsx_runtime_1.jsx)("span", { className:
|
|
216
|
+
role: distressed ? 'alert' : undefined, className: (0, utils_1.cn)('inline-flex items-center gap-1.5', tint), children: [(0, jsx_runtime_1.jsx)(Icon, { "aria-hidden": true, className: "size-4 shrink-0" }), (0, jsx_runtime_1.jsxs)("span", { className: "sr-only", children: [bandWord, ": "] }), (0, jsx_runtime_1.jsx)(figure_1.Figure, { size: "row", className: tint, children: (0, format_1.formatPercent)(rate, { unit: 'ratio', locale }) })] })) : ((0, jsx_runtime_1.jsxs)("span", { className: "text-muted-foreground inline-flex items-center gap-1.5", children: [(0, jsx_runtime_1.jsx)("span", { className: typography_1.LABEL_VOICE_CLASS, children: indeterminate ? indeterminateLabel : emptyLabel }), (0, jsx_runtime_1.jsx)(figure_1.Figure, { size: "row", className: "text-muted-foreground", children: format_1.NO_VALUE })] }))] }), (0, jsx_runtime_1.jsx)(aging_buckets_1.AgingBuckets, { buckets: buckets, currency: currency, locale: locale, showTotal: showTotal, labels: bucketLabels, healthyTone: healthyTone })] }));
|
|
217
217
|
}
|
|
@@ -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"}
|
|
@@ -4,15 +4,15 @@ exports.FIGURE_CLASS = void 0;
|
|
|
4
4
|
exports.Figure = Figure;
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
const utils_1 = require("../../lib/utils");
|
|
7
|
-
/** Canonical class strings per figure size. The `tabular-nums`
|
|
8
|
-
*
|
|
7
|
+
/** Canonical class strings per figure size. The `tabular-nums` invariant lives
|
|
8
|
+
* here so it can never be forgotten at a call site. */
|
|
9
9
|
exports.FIGURE_CLASS = {
|
|
10
|
-
hero: '
|
|
11
|
-
'money-hero': '
|
|
12
|
-
panel: '
|
|
13
|
-
count: '
|
|
14
|
-
row: '
|
|
15
|
-
tick: '
|
|
10
|
+
hero: 'text-4xl font-semibold tracking-tight tabular-nums lg:text-5xl',
|
|
11
|
+
'money-hero': 'text-2xl font-semibold tracking-tight tabular-nums lg:text-3xl',
|
|
12
|
+
panel: 'text-3xl font-semibold tracking-tight tabular-nums',
|
|
13
|
+
count: 'text-2xl font-semibold tracking-tight tabular-nums',
|
|
14
|
+
row: 'text-sm tabular-nums',
|
|
15
|
+
tick: 'text-xs leading-none tabular-nums'
|
|
16
16
|
};
|
|
17
17
|
function Figure({ size, children, className, as: Tag = 'span' }) {
|
|
18
18
|
return (0, jsx_runtime_1.jsx)(Tag, { className: (0, utils_1.cn)(exports.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"}
|
|
@@ -139,7 +139,7 @@ function maskKeyId(value, kind) {
|
|
|
139
139
|
function KeyId({ value, kind = 'generic', label, mask, copyable = false, className }) {
|
|
140
140
|
const masked = mask ?? masksByDefault(kind);
|
|
141
141
|
const display = masked ? maskKeyId(value, kind) : truncateMiddle(value);
|
|
142
|
-
return ((0, jsx_runtime_1.jsxs)("span", { className: (0, utils_1.cn)('inline-flex min-w-0 items-center gap-2', className), children: [label ? ((0, jsx_runtime_1.jsx)("span", { className: (0, utils_1.cn)(typography_1.LABEL_VOICE_CLASS, 'shrink-0'), children: label })) : null, (0, jsx_runtime_1.jsx)("span", { className: "text-foreground truncate font-mono text-xs tabular-nums",
|
|
142
|
+
return ((0, jsx_runtime_1.jsxs)("span", { className: (0, utils_1.cn)('inline-flex min-w-0 items-center gap-2', className), children: [label ? ((0, jsx_runtime_1.jsx)("span", { className: (0, utils_1.cn)(typography_1.LABEL_VOICE_CLASS, 'shrink-0 text-xs'), children: label })) : null, (0, jsx_runtime_1.jsx)("span", { className: "text-foreground truncate font-mono text-xs tabular-nums",
|
|
143
143
|
// The raw value as a tooltip only when nothing is hidden — never leak a
|
|
144
144
|
// masked PII value through the title attribute.
|
|
145
145
|
title: masked ? undefined : value, children: display }), copyable ? (0, jsx_runtime_1.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"}
|
|
@@ -23,9 +23,13 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
23
23
|
* />
|
|
24
24
|
*
|
|
25
25
|
* The first token (`lead`) is `text-foreground font-medium`. Tape items are
|
|
26
|
-
* dot-separated; an item with a `label` renders the
|
|
27
|
-
*
|
|
28
|
-
* destructive.
|
|
26
|
+
* dot-separated; an item with a `label` renders the label inline before its
|
|
27
|
+
* value, in the rail's own `font-medium`. Chips pin right via `ml-auto`;
|
|
28
|
+
* `alarm` escalates a chip to destructive.
|
|
29
|
+
*
|
|
30
|
+
* Labels carry weight only: the rail root already supplies size, family and
|
|
31
|
+
* ink (`font-mono text-xs text-muted-foreground`), so re-stating
|
|
32
|
+
* LABEL_VOICE_CLASS here would import a `text-sm` that fights the tape.
|
|
29
33
|
*/
|
|
30
34
|
const lucide_react_1 = require("lucide-react");
|
|
31
35
|
const utils_1 = require("../../lib/utils");
|
|
@@ -42,7 +46,7 @@ function StatusRail({ lead, items = [], chips = [], className }) {
|
|
|
42
46
|
// Recessed instrument strip: the page surface inside a hairline border
|
|
43
47
|
// whose top edge runs one step darker — light-from-above recession
|
|
44
48
|
// without any inner shadow.
|
|
45
|
-
'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 ? ((0, jsx_runtime_1.jsx)("span", { className: "text-foreground font-medium", children: lead })) : null, items.map((item, i) => ((0, jsx_runtime_1.jsx)(RailFragment, { hasLead: hasLead || i > 0, children: item.label != null ? ((0, jsx_runtime_1.jsxs)("span", { className: "flex items-center gap-1.5", children: [(0, jsx_runtime_1.jsx)("span", { className: "
|
|
49
|
+
'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 ? ((0, jsx_runtime_1.jsx)("span", { className: "text-foreground font-medium", children: lead })) : null, items.map((item, i) => ((0, jsx_runtime_1.jsx)(RailFragment, { hasLead: hasLead || i > 0, children: item.label != null ? ((0, jsx_runtime_1.jsxs)("span", { className: "flex items-center gap-1.5", children: [(0, jsx_runtime_1.jsx)("span", { className: "font-medium", children: item.label }), item.value] })) : ((0, jsx_runtime_1.jsx)("span", { className: "flex items-center gap-1.5", children: item.value })) }, item.id ?? i))), chips.length ? ((0, jsx_runtime_1.jsx)("span", { className: "ml-auto flex flex-wrap items-center gap-x-3 gap-y-1.5", children: chips.map((chip, i) => ((0, jsx_runtime_1.jsxs)("span", { className: "inline-flex items-center gap-1.5", children: [(0, jsx_runtime_1.jsx)("span", { className: "font-medium", children: chip.label }), (0, jsx_runtime_1.jsxs)("span", { className: (0, utils_1.cn)(
|
|
46
50
|
// Tiny mono token: raised a hair off the sunken tape by the
|
|
47
51
|
// card surface + whisper shadow.
|
|
48
52
|
'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"}
|
|
@@ -19,6 +19,6 @@ const TONE_TITLE = {
|
|
|
19
19
|
success: 'text-system-success-text',
|
|
20
20
|
neutral: 'text-foreground'
|
|
21
21
|
};
|
|
22
|
-
function AlertBanner({ tone = 'neutral', title, children, detail, icon, className }) {
|
|
23
|
-
return ((0, jsx_runtime_1.jsxs)("div", { role: "alert", "data-tone": tone, className: (0, utils_1.cn)('flex gap-3 rounded-md border px-4 py-3', TONE_CONTAINER[tone], className), children: [icon != null ? ((0, jsx_runtime_1.jsx)("span", { className: (0, utils_1.cn)('mt-0.5 shrink-0', TONE_TITLE[tone]), "aria-hidden": true, children: icon })) : null, (0, jsx_runtime_1.jsxs)("div", { className: "min-w-0 flex-1 space-y-1", children: [title != null ? ((0, jsx_runtime_1.jsx)("p", { className: (0, utils_1.cn)('text-sm font-medium', TONE_TITLE[tone]), children: title })) : null, children != null ? ((0, jsx_runtime_1.jsx)("div", { className: "text-foreground text-xs leading-relaxed", children: children })) : null, detail != null ? ((0, jsx_runtime_1.jsx)("pre", { className: "text-muted-foreground overflow-x-auto font-mono text-xs break-words whitespace-pre-wrap", children: detail })) : null] })] }));
|
|
22
|
+
function AlertBanner({ tone = 'neutral', title, children, detail, icon, className, ...props }) {
|
|
23
|
+
return ((0, jsx_runtime_1.jsxs)("div", { ...props, role: "alert", "data-tone": tone, className: (0, utils_1.cn)('flex gap-3 rounded-md border px-4 py-3', TONE_CONTAINER[tone], className), children: [icon != null ? ((0, jsx_runtime_1.jsx)("span", { className: (0, utils_1.cn)('mt-0.5 shrink-0', TONE_TITLE[tone]), "aria-hidden": true, children: icon })) : null, (0, jsx_runtime_1.jsxs)("div", { className: "min-w-0 flex-1 space-y-1", children: [title != null ? ((0, jsx_runtime_1.jsx)("p", { className: (0, utils_1.cn)('text-sm font-medium', TONE_TITLE[tone]), children: title })) : null, children != null ? ((0, jsx_runtime_1.jsx)("div", { className: "text-foreground text-xs leading-relaxed", children: children })) : null, detail != null ? ((0, jsx_runtime_1.jsx)("pre", { className: "text-muted-foreground overflow-x-auto font-mono text-xs break-words whitespace-pre-wrap", children: detail })) : null] })] }));
|
|
24
24
|
}
|
|
@@ -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,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UNSIZED_DEFAULT_COLUMN = void 0;
|
|
4
|
+
exports.readDeclaredColumnSize = readDeclaredColumnSize;
|
|
5
|
+
exports.readDeclaredGroupSize = readDeclaredGroupSize;
|
|
6
|
+
exports.readPreferredColumnSize = readPreferredColumnSize;
|
|
7
|
+
/**
|
|
8
|
+
* The column sizing a ColumnDef actually DECLARED, or `undefined` when it
|
|
9
|
+
* declared none. This is VirtualizedTable's reading: flex rows honour all
|
|
10
|
+
* three, so `size`, `minSize` and `maxSize` all PIN. DataTable's `<th>`/`<td>`
|
|
11
|
+
* path reads the same declaration through {@link readPreferredColumnSize},
|
|
12
|
+
* which drops the ceiling CSS auto table layout cannot enforce.
|
|
13
|
+
*
|
|
14
|
+
* Reading the raw `columnDef` is only honest because both tables pass
|
|
15
|
+
* `defaultColumn: { size: undefined, minSize: undefined, maxSize: undefined }`
|
|
16
|
+
* to `useReactTable`. TanStack builds every columnDef as
|
|
17
|
+
* `{ ...featureDefaults, ...table.options.defaultColumn, ...userDef }`, so
|
|
18
|
+
* those three overrides blank out the `defaultColumnSizing` the ColumnSizing
|
|
19
|
+
* feature would otherwise stamp on every column (150 / 20 / MAX_SAFE_INTEGER).
|
|
20
|
+
* Without them a column asking for nothing reports `size: 150` and a column
|
|
21
|
+
* asking for exactly 150 is indistinguishable from it. `column.getSize()` is
|
|
22
|
+
* unaffected: it falls back to `defaultColumnSizing` with `??`, so column
|
|
23
|
+
* offsets and the table's total size are byte-identical either way.
|
|
24
|
+
*
|
|
25
|
+
* Width comes from `getSize()` rather than the raw `size` so it lands already
|
|
26
|
+
* clamped by the column's own min/max.
|
|
27
|
+
*/
|
|
28
|
+
function readDeclaredColumnSize(column) {
|
|
29
|
+
const { size, minSize, maxSize } = column.columnDef;
|
|
30
|
+
const width = size === undefined ? undefined : column.getSize();
|
|
31
|
+
if (width === undefined && minSize === undefined && maxSize === undefined) {
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
return { width, minWidth: minSize, maxWidth: maxSize };
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* A GROUP header cell is exactly as wide as the leaf columns it spans, so it
|
|
38
|
+
* can only be pinned when every one of them is: a group whose leaves are
|
|
39
|
+
* partly sized has no honest fixed width, and keeps its colSpan flex share so
|
|
40
|
+
* the header rule still tracks the cells beneath it. Reading the group's own
|
|
41
|
+
* ColumnDef instead would size the header against a declaration its body cells
|
|
42
|
+
* never see.
|
|
43
|
+
*
|
|
44
|
+
* Every dimension the leaves agree on carries up, CEILING INCLUDED. This is
|
|
45
|
+
* VirtualizedTable's path, where flex rows honour `maxSize` on a leaf — so a
|
|
46
|
+
* group of capped leaves whose header carried no `maxWidth` was free to grow
|
|
47
|
+
* past every column it names, which is the same header-vs-cells drift the
|
|
48
|
+
* width sum exists to prevent. Each dimension is decided on its own: a group
|
|
49
|
+
* can be uncapped and still have a floor.
|
|
50
|
+
*/
|
|
51
|
+
function readDeclaredGroupSize(leaves) {
|
|
52
|
+
if (leaves.length === 0)
|
|
53
|
+
return undefined;
|
|
54
|
+
const sizes = leaves.map(readDeclaredColumnSize);
|
|
55
|
+
const width = sum(sizes, 'width');
|
|
56
|
+
const minWidth = sum(sizes, 'minWidth');
|
|
57
|
+
const maxWidth = sum(sizes, 'maxWidth');
|
|
58
|
+
if (width === undefined && minWidth === undefined && maxWidth === undefined) {
|
|
59
|
+
return undefined;
|
|
60
|
+
}
|
|
61
|
+
return { width, minWidth, maxWidth };
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The total of one dimension, or `undefined` unless EVERY leaf declared it. One
|
|
65
|
+
* leaf short and the group has no honest total: an unsized leaf flexes, an
|
|
66
|
+
* unfloored one can shrink, and an uncapped one grows without limit.
|
|
67
|
+
*/
|
|
68
|
+
function sum(sizes, key) {
|
|
69
|
+
let total = 0;
|
|
70
|
+
for (const size of sizes) {
|
|
71
|
+
const value = size?.[key];
|
|
72
|
+
if (value === undefined)
|
|
73
|
+
return undefined;
|
|
74
|
+
total += value;
|
|
75
|
+
}
|
|
76
|
+
return total;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* The same declaration as {@link readDeclaredColumnSize}, minus `maxWidth`.
|
|
80
|
+
*
|
|
81
|
+
* DataTable renders real `<th>`/`<td>` under CSS AUTO table layout, where
|
|
82
|
+
* Chrome and Firefox ignore `max-width` on a cell. Emitting it would advertise
|
|
83
|
+
* a ceiling that never holds, so this path keeps only what the layout obeys:
|
|
84
|
+
* `size` as a PREFERRED width and `minSize` as a floor. A column that must not
|
|
85
|
+
* grow past a width belongs in VirtualizedTable.
|
|
86
|
+
*/
|
|
87
|
+
function readPreferredColumnSize(column) {
|
|
88
|
+
const { width, minWidth } = readDeclaredColumnSize(column) ?? {};
|
|
89
|
+
if (width === undefined && minWidth === undefined) {
|
|
90
|
+
return undefined;
|
|
91
|
+
}
|
|
92
|
+
return { width, minWidth };
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Blanks out the `defaultColumnSizing` TanStack stamps onto every ColumnDef, so
|
|
96
|
+
* `columnDef.size` / `minSize` / `maxSize` mean "the consumer asked for this"
|
|
97
|
+
* and nothing else. Both tables pass it to `useReactTable`.
|
|
98
|
+
*/
|
|
99
|
+
exports.UNSIZED_DEFAULT_COLUMN = {
|
|
100
|
+
size: undefined,
|
|
101
|
+
minSize: undefined,
|
|
102
|
+
maxSize: undefined
|
|
103
|
+
};
|
|
@@ -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,KAAK,KAAK,MAAM,CAAA;CAC9C,CAAA;AAEL,KAAK,kBAAkB,CAAC,KAAK,IAAI;IAC/B,OAAO,EAAE,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,CAAA;IACpC,IAA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