cursedbelt 5.71.0 → 5.72.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/react/components/MeterList.d.ts.map +1 -1
- package/dist/react/components/MeterList.js +1 -1
- package/dist/react/components/MeterList.js.map +1 -1
- package/dist/styles-areas/stats.css +12 -12
- package/dist/styles-utilities.css +8 -0
- package/package.json +1 -1
- package/scripts/fixtureAppCss.ts +6 -0
- package/src/fixtureAppCss.spec.ts +15 -0
- package/src/react/components/MeterList.spec.tsx +34 -0
- package/src/react/components/MeterList.tsx +15 -6
- package/src/styles-areas/stats.css +12 -12
- package/src/styles-utilities.css +8 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MeterList.d.ts","sourceRoot":"","sources":["../../../src/react/components/MeterList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAC;AAGtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAkBlD,MAAM,WAAW,aAAa;IAC5B,6CAA6C;IAC7C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,wEAAwE;IACxE,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,+DAA+D;IAC/D,KAAK,EAAE,SAAS,CAAC;IACjB,oEAAoE;IACpE,QAAQ,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACjE,mCAAmC;IACnC,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,kEAAkE;IAClE,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,0CAA0C;IAC1C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,uFAAuF;IACvF,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB;AAED;;;;;;;;;;;;;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CAAC;AAOrD,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,0EAA0E;IAC1E,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,kFAAkF;IAClF,UAAU,CAAC,EAAE,mBAAmB,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CAAC,EAAE,KAAK,EAAE,IAAY,EAAE,UAAsB,EAAE,SAAS,EAAE,EAAE,cAAc,+BAqFnG"}
|
|
@@ -49,7 +49,7 @@ export function MeterList({ items, flat = false, labelWidth = 'default', classNa
|
|
|
49
49
|
return (_jsxs("div", { className: cn('group/meter grid min-h-11 grid-cols-[minmax(0,1fr)_auto] items-center gap-x-4 gap-y-1 py-2', LABEL_COLUMN[labelWidth], interactive &&
|
|
50
50
|
'cursor-pointer rounded-sm transition-colors hover:bg-accent/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring'), ...(interactive
|
|
51
51
|
? { role: 'button', tabIndex: 0, onClick: item.onClick, onKeyDown, 'aria-label': item.label }
|
|
52
|
-
: {}), children: [_jsxs("div", { className: 'flex min-w-0 flex-col', children: [_jsxs("span", { className: 'flex items-center gap-1.5 text-sm font-medium text-foreground', children: [item.tone ? (_jsx("span", { "aria-hidden": true, className: cn('
|
|
52
|
+
: {}), children: [_jsxs("div", { className: 'flex min-w-0 flex-col', children: [_jsxs("span", { className: 'flex flex-wrap items-center gap-x-1.5 text-sm font-medium text-foreground sm:flex-nowrap', children: [_jsxs("span", { className: 'min-w-0 [overflow-wrap:anywhere] sm:truncate', children: [item.tone ? (_jsx("span", { "aria-hidden": true, className: cn('mr-1.5 inline-block size-1.5 rounded-full align-middle', TONE_DOT[item.tone]) })) : null, item.label] }), item.actionHint ? (_jsx("span", { className: `text-caption font-medium text-muted-foreground opacity-0 transition-opacity group-hover/meter:opacity-100 group-focus-visible/meter:opacity-100 ${TAP_TARGET_ALWAYS}`, children: item.actionHint })) : null] }), item.sub ? _jsx("span", { className: 'text-xs text-muted-foreground [overflow-wrap:anywhere] sm:truncate', children: item.sub }) : null] }), pct !== null ? (_jsx("div", { className: 'col-span-2 h-1.5 w-full overflow-hidden rounded-full bg-muted sm:col-span-1', "aria-hidden": true, children: _jsx("div", {
|
|
53
53
|
// The bar takes the row's warning/danger tone: a red dot beside a calm accent bar
|
|
54
54
|
// said "fine" and "full" at once (forge task 2593). `barClassName` still wins.
|
|
55
55
|
className: cn('h-full rounded-full', TONE_BAR[item.tone ?? 'neutral'], item.progress?.barClassName), style: { width: `${pct}%` } }) })) : (_jsx("span", { "aria-hidden": true, className: 'hidden sm:block' })), _jsxs("span", { className: cn('flex items-center justify-end gap-2 tabular-nums text-sm font-semibold text-foreground', pct !== null && 'row-start-1 col-start-2 sm:row-auto sm:col-auto'), children: [item.value, item.trailing] })] }, item.key ?? item.label));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MeterList.js","sourceRoot":"","sources":["../../../src/react/components/MeterList.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,QAAQ,GAAiC;IAC7C,OAAO,EAAE,YAAY;IACrB,OAAO,EAAE,YAAY;IACrB,MAAM,EAAE,gBAAgB;IACxB,OAAO,EAAE,kBAAkB;CAC5B,CAAC;AAEF,gGAAgG;AAChG,MAAM,QAAQ,GAAiC;IAC7C,OAAO,EAAE,iBAAiB;IAC1B,OAAO,EAAE,YAAY;IACrB,MAAM,EAAE,gBAAgB;IACxB,OAAO,EAAE,iBAAiB;CAC3B,CAAC;AAuCF,MAAM,YAAY,GAAwC;IACxD,OAAO,EAAE,yDAAyD;IAClE,IAAI,EAAE,yDAAyD;CAChE,CAAC;AAWF;;;;;;;;;;;;GAYG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,eAAM,SAAS,EAAC,oEAAoE,YAAE,IAAI,CAAC,GAAG,GAAQ,CAAC,CAAC,CAAC,IAAI,IACrH,EACL,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,CACd,cAAK,SAAS,EAAC,6EAA6E,iCAC1F;4BACE,kFAAkF;4BAClF,+EAA+E;4BAC/E,SAAS,EAAE,EAAE,CAAC,qBAAqB,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,SAAS,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,YAAY,CAAC,EACnG,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,GAAG,GAAG,EAAE,GAC3B,GACE,CACP,CAAC,CAAC,CAAC,CACF,oCAAkB,SAAS,EAAC,iBAAiB,GAAG,CACjD,EACD,gBACE,SAAS,EAAE,EAAE,CACX,wFAAwF,EACxF,GAAG,KAAK,IAAI,IAAI,iDAAiD,CAClE,aAEA,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,QAAQ,IACT,KAtDF,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,KAAK,CAuDvB,CACP,CAAC;QACJ,CAAC,CAAC,GACE,CACP,CAAC;IACF,IAAI,IAAI;QAAE,OAAO,IAAI,CAAC;IACtB,OAAO,CACL,KAAC,OAAO,IAAC,KAAK,EAAC,MAAM,EAAC,GAAG,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,YACvC,IAAI,GACG,CACX,CAAC;AACJ,CAAC"}
|
|
@@ -18,22 +18,22 @@
|
|
|
18
18
|
* after an app's responsive variant (task 2124). An app that imports every area gets exactly
|
|
19
19
|
* what `cursedbelt/styles-utilities.css` emits — proved rule by rule in
|
|
20
20
|
* src/stylesAreas.spec.ts, which is also what fails when this file is stale.
|
|
21
|
-
*
|
|
21
|
+
* 64 candidate(s).
|
|
22
22
|
*
|
|
23
23
|
* Written by scripts/generateAreaStyles.ts (`bun run styles:areas`), which
|
|
24
24
|
* `bun run build` runs. The map of what is in which area, and why the areas are
|
|
25
25
|
* import closures rather than a hand-written list, is scripts/styleAreas.ts.
|
|
26
26
|
*/
|
|
27
|
-
@source inline("[&>div]:sm:[grid-template-columns:…] [&_svg]:size-3.5
|
|
28
|
-
@source inline("bg-background/70 border-l-2 border-l-border-strong
|
|
29
|
-
@source inline("bottom-3 col-span-2 col-start-2 collapse cursor-help
|
|
30
|
-
@source inline("grid-cols-[minmax(0,1fr)_auto]
|
|
31
|
-
@source inline("group-focus-visible/
|
|
32
|
-
@source inline("group-
|
|
33
|
-
@source inline("group/meter group/stat group/tile hover:bg-muted/50 last:pr-1
|
|
34
|
-
@source inline("left-[var(--timeline-rail-x)] list-none min-h-9 min-w-34 min-w-full mr-0.5
|
|
35
|
-
@source inline("rounded-b-md rounded-t-md row-start-1 self-stretch shadow-md sm:col-auto
|
|
36
|
-
@source inline("sm:grid-cols-[minmax(7rem,18rem)_minmax(4rem,1fr)_auto]");
|
|
37
|
-
@source inline("sm:grid-cols-[minmax(7rem,34rem)_minmax(4rem,1fr)_auto] sm:row-auto text-3xl");
|
|
27
|
+
@source inline("[&>div]:sm:[grid-template-columns:…] [&_svg]:size-3.5 [overflow-wrap:anywhere] basis-40");
|
|
28
|
+
@source inline("bg-accent/15 bg-accent/40 bg-background/70 border-l-2 border-l-border-strong");
|
|
29
|
+
@source inline("border-l-destructive border-l-warning bottom-3 col-span-2 col-start-2 collapse cursor-help");
|
|
30
|
+
@source inline("divide-x first:pl-1 gap-x-1.5 gap-x-2 gap-y-0.5 grid-cols-[minmax(0,1fr)_auto]");
|
|
31
|
+
@source inline("group-focus-visible/meter:opacity-100 group-focus-visible/stat:opacity-100");
|
|
32
|
+
@source inline("group-focus-visible/tile:opacity-100 group-hover/meter:opacity-100 group-hover/stat:opacity-100");
|
|
33
|
+
@source inline("group-hover/tile:opacity-100 group/meter group/stat group/tile hover:bg-muted/50 last:pr-1");
|
|
34
|
+
@source inline("left-3 left-[var(--timeline-rail-x)] list-none min-h-9 min-w-34 min-w-full mr-0.5 mr-1.5");
|
|
35
|
+
@source inline("normal-case pt-1 rounded-b-md rounded-t-md row-start-1 self-stretch shadow-md sm:col-auto");
|
|
36
|
+
@source inline("sm:col-span-1 sm:flex-nowrap sm:grid-cols-[minmax(7rem,18rem)_minmax(4rem,1fr)_auto]");
|
|
37
|
+
@source inline("sm:grid-cols-[minmax(7rem,34rem)_minmax(4rem,1fr)_auto] sm:row-auto sm:truncate text-3xl");
|
|
38
38
|
@source inline("text-[length:var(--text-glyph)] text-foreground/80 text-success top-7 tracking-normal w-48");
|
|
39
39
|
@source inline("whitespace-pre z-[1]");
|
|
@@ -1474,6 +1474,9 @@
|
|
|
1474
1474
|
.gap-x-0 {
|
|
1475
1475
|
column-gap: 0px;
|
|
1476
1476
|
}
|
|
1477
|
+
.gap-x-1\.5 {
|
|
1478
|
+
column-gap: calc(var(--spacing) * 1.5);
|
|
1479
|
+
}
|
|
1477
1480
|
.gap-x-2 {
|
|
1478
1481
|
column-gap: calc(var(--spacing) * 2);
|
|
1479
1482
|
}
|
|
@@ -4688,6 +4691,11 @@
|
|
|
4688
4691
|
.sm\:gap-3 {
|
|
4689
4692
|
gap: calc(var(--spacing) * 3);
|
|
4690
4693
|
}
|
|
4694
|
+
.sm\:truncate {
|
|
4695
|
+
overflow: hidden;
|
|
4696
|
+
text-overflow: ellipsis;
|
|
4697
|
+
white-space: nowrap;
|
|
4698
|
+
}
|
|
4691
4699
|
.sm\:rounded-xl {
|
|
4692
4700
|
border-radius: 1rem;
|
|
4693
4701
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cursedbelt",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.72.0",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "The React design system of the cursedbelt split — components, styles, theme. cursedbelt-core below it; server tier in cursedbelt-server.",
|
package/scripts/fixtureAppCss.ts
CHANGED
|
@@ -268,6 +268,12 @@ export const parseBaseline = (text: string): Baseline => {
|
|
|
268
268
|
for (const line of text.split('\n')) {
|
|
269
269
|
if (line.startsWith('#') || line.trim() === '') {
|
|
270
270
|
if (counts.size === 0) header.push(line);
|
|
271
|
+
// 🔴 The header is everything ABOVE the first count, and `--prune` writes header + counts —
|
|
272
|
+
// so a note below a count is deleted by the next prune. Found 2026-10-09 (forge task 2966):
|
|
273
|
+
// a stale count pair at line 17 had 270 lines of raise notes below it, every one of them
|
|
274
|
+
// one `--prune` from gone, and a hand raise edited the stale pair the parser never read.
|
|
275
|
+
else if (line.startsWith('#'))
|
|
276
|
+
throw new Error(`${BASELINE}: a note follows a count line — \`--prune\` keeps only what is above the first count and would delete it. Keep the counts as the file's last lines, once:\n ${line}`);
|
|
271
277
|
continue;
|
|
272
278
|
}
|
|
273
279
|
const [bytes, route] = line.trim().split(/\s+/);
|
|
@@ -47,6 +47,7 @@ import {
|
|
|
47
47
|
fixtureImports,
|
|
48
48
|
measure,
|
|
49
49
|
missingNeeds,
|
|
50
|
+
parseBaseline,
|
|
50
51
|
readBaseline,
|
|
51
52
|
requiredCss,
|
|
52
53
|
uncoveredModules,
|
|
@@ -104,6 +105,20 @@ describe('the fixture app measures a real consumer', () => {
|
|
|
104
105
|
});
|
|
105
106
|
});
|
|
106
107
|
|
|
108
|
+
describe('the baseline survives its own --prune', () => {
|
|
109
|
+
// `--prune` writes back only what is above the first count, so a note below one is a note the
|
|
110
|
+
// next prune deletes. The parser refuses it; this is the refusal, and the file passing it.
|
|
111
|
+
it('refuses a note that follows a count line', () => {
|
|
112
|
+
expect(() => parseBaseline('# header\n 10 union\n# a raise, written below\n 20 areas\n')).toThrow(/a note follows a count line/);
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
it('accepts counts as the last lines, and keeps every note above them', () => {
|
|
116
|
+
const parsed = parseBaseline('# header\n\n# a raise\n\n 10 union\n 20 areas\n');
|
|
117
|
+
expect(parsed.header).toContain('# a raise');
|
|
118
|
+
expect([...parsed.counts]).toEqual([['union', 10], ['areas', 20]]);
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
|
|
107
122
|
describe('the fixture app is materially smaller on the area route', () => {
|
|
108
123
|
it('has a baseline recording both routes', () => {
|
|
109
124
|
// A missing baseline must fail, not seed itself: a check that writes its own
|
|
@@ -42,3 +42,37 @@ describe('MeterList label width', () => {
|
|
|
42
42
|
expect(rowOf(container).className).not.toContain('mt-2');
|
|
43
43
|
});
|
|
44
44
|
});
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* A label that is a sentence (station's costliest slowdowns, forge task 2966) was cut to two words on
|
|
48
|
+
* a phone: the label truncated beside the value AND beside an invisible hover hint. Below `sm` the
|
|
49
|
+
* label and sub wrap and the hint may drop to its own line; from `sm` up they truncate as before.
|
|
50
|
+
*/
|
|
51
|
+
describe('MeterList on a phone', () => {
|
|
52
|
+
const items = [
|
|
53
|
+
{
|
|
54
|
+
label: 'Phone check fails on a lossy network and is rerun',
|
|
55
|
+
sub: '↑ from 4m 50s · 9 batches hit',
|
|
56
|
+
value: '5m 10s a batch',
|
|
57
|
+
tone: 'warning' as const,
|
|
58
|
+
onClick: () => {},
|
|
59
|
+
actionHint: 'Open its notes and chart',
|
|
60
|
+
},
|
|
61
|
+
];
|
|
62
|
+
|
|
63
|
+
test('the label and sub wrap below sm and truncate from sm up', () => {
|
|
64
|
+
const { container, getByText } = render(<MeterList items={items} flat />);
|
|
65
|
+
const label = getByText(/Phone check fails/);
|
|
66
|
+
for (const el of [label, getByText(/from 4m 50s/)]) {
|
|
67
|
+
expect(el.className.split(' ')).not.toContain('truncate');
|
|
68
|
+
expect(el.className).toContain('sm:truncate');
|
|
69
|
+
expect(el.className).toContain('[overflow-wrap:anywhere]');
|
|
70
|
+
}
|
|
71
|
+
const line = label.parentElement as HTMLElement;
|
|
72
|
+
expect(line.className).toContain('flex-wrap');
|
|
73
|
+
expect(line.className).toContain('sm:flex-nowrap');
|
|
74
|
+
// The tone dot rides inside the label, so a wrapped label keeps it on its first line.
|
|
75
|
+
expect(label.querySelector('.bg-warning')).not.toBeNull();
|
|
76
|
+
expect(rowOf(container).getAttribute('aria-label')).toBe(items[0]?.label ?? '');
|
|
77
|
+
});
|
|
78
|
+
});
|
|
@@ -114,18 +114,27 @@ export function MeterList({ items, flat = false, labelWidth = 'default', classNa
|
|
|
114
114
|
: {})}
|
|
115
115
|
>
|
|
116
116
|
<div className='flex min-w-0 flex-col'>
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
117
|
+
{/*
|
|
118
|
+
* Below `sm` the label and sub WRAP: a phone gives the label column what is left
|
|
119
|
+
* beside the value, and a label that is a sentence was cut to two words (forge
|
|
120
|
+
* task 2966). The dot rides inside the label so a wrapped label keeps it, and the
|
|
121
|
+
* line wraps so the hint — in the layout even while invisible — drops under a long
|
|
122
|
+
* label instead of squeezing it. From `sm` up, one line each, truncated, as before.
|
|
123
|
+
*/}
|
|
124
|
+
<span className='flex flex-wrap items-center gap-x-1.5 text-sm font-medium text-foreground sm:flex-nowrap'>
|
|
125
|
+
<span className='min-w-0 [overflow-wrap:anywhere] sm:truncate'>
|
|
126
|
+
{item.tone ? (
|
|
127
|
+
<span aria-hidden className={cn('mr-1.5 inline-block size-1.5 rounded-full align-middle', TONE_DOT[item.tone])} />
|
|
128
|
+
) : null}
|
|
129
|
+
{item.label}
|
|
130
|
+
</span>
|
|
122
131
|
{item.actionHint ? (
|
|
123
132
|
<span className={`text-caption font-medium text-muted-foreground opacity-0 transition-opacity group-hover/meter:opacity-100 group-focus-visible/meter:opacity-100 ${TAP_TARGET_ALWAYS}`}>
|
|
124
133
|
{item.actionHint}
|
|
125
134
|
</span>
|
|
126
135
|
) : null}
|
|
127
136
|
</span>
|
|
128
|
-
{item.sub ? <span className='
|
|
137
|
+
{item.sub ? <span className='text-xs text-muted-foreground [overflow-wrap:anywhere] sm:truncate'>{item.sub}</span> : null}
|
|
129
138
|
</div>
|
|
130
139
|
{pct !== null ? (
|
|
131
140
|
<div className='col-span-2 h-1.5 w-full overflow-hidden rounded-full bg-muted sm:col-span-1' aria-hidden>
|
|
@@ -18,22 +18,22 @@
|
|
|
18
18
|
* after an app's responsive variant (task 2124). An app that imports every area gets exactly
|
|
19
19
|
* what `cursedbelt/styles-utilities.css` emits — proved rule by rule in
|
|
20
20
|
* src/stylesAreas.spec.ts, which is also what fails when this file is stale.
|
|
21
|
-
*
|
|
21
|
+
* 64 candidate(s).
|
|
22
22
|
*
|
|
23
23
|
* Written by scripts/generateAreaStyles.ts (`bun run styles:areas`), which
|
|
24
24
|
* `bun run build` runs. The map of what is in which area, and why the areas are
|
|
25
25
|
* import closures rather than a hand-written list, is scripts/styleAreas.ts.
|
|
26
26
|
*/
|
|
27
|
-
@source inline("[&>div]:sm:[grid-template-columns:…] [&_svg]:size-3.5
|
|
28
|
-
@source inline("bg-background/70 border-l-2 border-l-border-strong
|
|
29
|
-
@source inline("bottom-3 col-span-2 col-start-2 collapse cursor-help
|
|
30
|
-
@source inline("grid-cols-[minmax(0,1fr)_auto]
|
|
31
|
-
@source inline("group-focus-visible/
|
|
32
|
-
@source inline("group-
|
|
33
|
-
@source inline("group/meter group/stat group/tile hover:bg-muted/50 last:pr-1
|
|
34
|
-
@source inline("left-[var(--timeline-rail-x)] list-none min-h-9 min-w-34 min-w-full mr-0.5
|
|
35
|
-
@source inline("rounded-b-md rounded-t-md row-start-1 self-stretch shadow-md sm:col-auto
|
|
36
|
-
@source inline("sm:grid-cols-[minmax(7rem,18rem)_minmax(4rem,1fr)_auto]");
|
|
37
|
-
@source inline("sm:grid-cols-[minmax(7rem,34rem)_minmax(4rem,1fr)_auto] sm:row-auto text-3xl");
|
|
27
|
+
@source inline("[&>div]:sm:[grid-template-columns:…] [&_svg]:size-3.5 [overflow-wrap:anywhere] basis-40");
|
|
28
|
+
@source inline("bg-accent/15 bg-accent/40 bg-background/70 border-l-2 border-l-border-strong");
|
|
29
|
+
@source inline("border-l-destructive border-l-warning bottom-3 col-span-2 col-start-2 collapse cursor-help");
|
|
30
|
+
@source inline("divide-x first:pl-1 gap-x-1.5 gap-x-2 gap-y-0.5 grid-cols-[minmax(0,1fr)_auto]");
|
|
31
|
+
@source inline("group-focus-visible/meter:opacity-100 group-focus-visible/stat:opacity-100");
|
|
32
|
+
@source inline("group-focus-visible/tile:opacity-100 group-hover/meter:opacity-100 group-hover/stat:opacity-100");
|
|
33
|
+
@source inline("group-hover/tile:opacity-100 group/meter group/stat group/tile hover:bg-muted/50 last:pr-1");
|
|
34
|
+
@source inline("left-3 left-[var(--timeline-rail-x)] list-none min-h-9 min-w-34 min-w-full mr-0.5 mr-1.5");
|
|
35
|
+
@source inline("normal-case pt-1 rounded-b-md rounded-t-md row-start-1 self-stretch shadow-md sm:col-auto");
|
|
36
|
+
@source inline("sm:col-span-1 sm:flex-nowrap sm:grid-cols-[minmax(7rem,18rem)_minmax(4rem,1fr)_auto]");
|
|
37
|
+
@source inline("sm:grid-cols-[minmax(7rem,34rem)_minmax(4rem,1fr)_auto] sm:row-auto sm:truncate text-3xl");
|
|
38
38
|
@source inline("text-[length:var(--text-glyph)] text-foreground/80 text-success top-7 tracking-normal w-48");
|
|
39
39
|
@source inline("whitespace-pre z-[1]");
|
package/src/styles-utilities.css
CHANGED
|
@@ -1474,6 +1474,9 @@
|
|
|
1474
1474
|
.gap-x-0 {
|
|
1475
1475
|
column-gap: 0px;
|
|
1476
1476
|
}
|
|
1477
|
+
.gap-x-1\.5 {
|
|
1478
|
+
column-gap: calc(var(--spacing) * 1.5);
|
|
1479
|
+
}
|
|
1477
1480
|
.gap-x-2 {
|
|
1478
1481
|
column-gap: calc(var(--spacing) * 2);
|
|
1479
1482
|
}
|
|
@@ -4688,6 +4691,11 @@
|
|
|
4688
4691
|
.sm\:gap-3 {
|
|
4689
4692
|
gap: calc(var(--spacing) * 3);
|
|
4690
4693
|
}
|
|
4694
|
+
.sm\:truncate {
|
|
4695
|
+
overflow: hidden;
|
|
4696
|
+
text-overflow: ellipsis;
|
|
4697
|
+
white-space: nowrap;
|
|
4698
|
+
}
|
|
4691
4699
|
.sm\:rounded-xl {
|
|
4692
4700
|
border-radius: 1rem;
|
|
4693
4701
|
}
|