basalt-ui 2.18.0 → 2.19.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/CHANGELOG.md +40 -0
- package/MIGRATING.md +76 -12
- package/agent/agents/basalt-design-reviewer.md +2 -2
- package/dist/commands/notifications/center.d.ts.map +1 -1
- package/dist/commands/notifications/center.js +18 -26
- package/dist/content/callout.d.ts +1 -1
- package/dist/content/callout.d.ts.map +1 -1
- package/dist/content/callout.js +10 -1
- package/dist/content/callout.module.css +15 -3
- package/dist/content/callout.module.css.d.ts +1 -0
- package/dist/dashboard/bar-list.d.ts.map +1 -1
- package/dist/dashboard/bar-list.js +31 -18
- package/dist/dashboard/bar-list.module.css +33 -15
- package/dist/dashboard/bar-list.module.css.d.ts +1 -0
- package/dist/dashboard/meter-model.d.ts +49 -1
- package/dist/dashboard/meter-model.d.ts.map +1 -1
- package/dist/dashboard/meter-model.js +47 -3
- package/dist/dashboard/meter-parts.d.ts.map +1 -1
- package/dist/dashboard/meter-parts.js +143 -9
- package/dist/dashboard/meter.d.ts +16 -5
- package/dist/dashboard/meter.d.ts.map +1 -1
- package/dist/dashboard/meter.module.css +127 -9
- package/dist/dashboard/meter.module.css.d.ts +11 -0
- package/dist/dashboard/stat-card-parts.d.ts +3 -1
- package/dist/dashboard/stat-card-parts.d.ts.map +1 -1
- package/dist/dashboard/stat-card-parts.js +18 -3
- package/dist/dashboard/stat-card.d.ts +6 -5
- package/dist/dashboard/stat-card.d.ts.map +1 -1
- package/dist/dashboard/stat-card.js +48 -77
- package/dist/dashboard/stat-card.module.css +27 -7
- package/dist/dashboard/widget-header.d.ts.map +1 -1
- package/dist/dashboard/widget-header.js +2 -1
- package/dist/dashboard/widget-header.module.css +28 -1
- package/dist/theme/chrome-vars.d.ts +29 -17
- package/dist/theme/chrome-vars.d.ts.map +1 -1
- package/dist/theme/chrome-vars.js +18 -8
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +9 -5
- package/dist/theme/status-dot.d.ts +6 -0
- package/dist/theme/status-dot.d.ts.map +1 -0
- package/dist/theme/status-dot.js +9 -0
- package/dist/theme/status-dot.module.css +9 -0
- package/dist/theme/status-dot.module.css.d.ts +8 -0
- package/dist/theme/status-verdict.d.ts +9 -0
- package/dist/theme/status-verdict.d.ts.map +1 -0
- package/dist/theme/status-verdict.js +13 -0
- package/dist/theme/status-verdict.module.css +23 -0
- package/dist/theme/status-verdict.module.css.d.ts +9 -0
- package/llms.txt +2 -2
- package/package.json +1 -1
- package/src/commands/notifications/center.tsx +29 -32
- package/src/content/callout.module.css +15 -3
- package/src/content/callout.module.css.d.ts +1 -0
- package/src/content/callout.tsx +15 -2
- package/src/dashboard/bar-list.module.css +33 -15
- package/src/dashboard/bar-list.module.css.d.ts +1 -0
- package/src/dashboard/bar-list.tsx +29 -16
- package/src/dashboard/meter-model.ts +97 -4
- package/src/dashboard/meter-parts.tsx +195 -11
- package/src/dashboard/meter.module.css +127 -9
- package/src/dashboard/meter.module.css.d.ts +11 -0
- package/src/dashboard/meter.tsx +16 -5
- package/src/dashboard/stat-card-parts.tsx +22 -2
- package/src/dashboard/stat-card.module.css +27 -7
- package/src/dashboard/stat-card.tsx +18 -52
- package/src/dashboard/widget-header.module.css +28 -1
- package/src/dashboard/widget-header.tsx +4 -1
- package/src/theme/__snapshots__/plain-theme.test.ts.snap +88 -16
- package/src/theme/chrome-vars.ts +48 -23
- package/src/theme/index.ts +10 -6
- package/src/theme/status-dot.module.css +9 -0
- package/src/theme/status-dot.module.css.d.ts +8 -0
- package/src/theme/status-dot.tsx +19 -0
- package/src/theme/status-verdict.module.css +23 -0
- package/src/theme/status-verdict.module.css.d.ts +9 -0
- package/src/theme/status-verdict.tsx +27 -0
|
@@ -4,17 +4,28 @@
|
|
|
4
4
|
*/
|
|
5
5
|
declare const classes: {
|
|
6
6
|
readonly root: string
|
|
7
|
+
readonly zoned: string
|
|
7
8
|
readonly track: string
|
|
8
9
|
readonly trackBox: string
|
|
9
10
|
readonly fill: string
|
|
10
11
|
readonly forecastFill: string
|
|
11
12
|
readonly zone: string
|
|
13
|
+
readonly zoneBand: string
|
|
14
|
+
readonly zoneLabel: string
|
|
15
|
+
readonly zoneLabelHolding: string
|
|
16
|
+
readonly zoneList: string
|
|
17
|
+
readonly zoneListItem: string
|
|
18
|
+
readonly zoneReadingRow: string
|
|
19
|
+
readonly zoneReading: string
|
|
12
20
|
readonly marker: string
|
|
13
21
|
readonly tick: string
|
|
14
22
|
readonly boundaryTick: string
|
|
15
23
|
readonly captions: string
|
|
16
24
|
readonly caption: string
|
|
17
25
|
readonly captionEnd: string
|
|
26
|
+
readonly partCaptions: string
|
|
27
|
+
readonly partCaption: string
|
|
28
|
+
readonly swatch: string
|
|
18
29
|
readonly empty: string
|
|
19
30
|
readonly skeletonTrack: string
|
|
20
31
|
readonly skeletonCaption: string
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import type { Tone } from '../common/props.js';
|
|
2
3
|
export type CaptionRowProps = {
|
|
3
4
|
title: string;
|
|
4
5
|
icon?: ReactNode;
|
|
5
6
|
info?: string;
|
|
6
7
|
qualifier?: string;
|
|
8
|
+
tone?: Tone;
|
|
7
9
|
actions?: ReactNode;
|
|
8
10
|
};
|
|
9
11
|
/**
|
|
@@ -11,7 +13,7 @@ export type CaptionRowProps = {
|
|
|
11
13
|
* caption + info + qualifier do not fit, the qualifier wraps UNDER the caption instead of truncating
|
|
12
14
|
* either: the container's width decides, never the viewport's.
|
|
13
15
|
*/
|
|
14
|
-
export declare function CaptionRow({ title, icon, info, qualifier, actions }: CaptionRowProps): import("react").JSX.Element;
|
|
16
|
+
export declare function CaptionRow({ title, icon, info, qualifier, tone, actions }: CaptionRowProps): import("react").JSX.Element;
|
|
15
17
|
export type FootProps = {
|
|
16
18
|
/** Reserve the foot's height (a visual AND a footer line) even when a branch shows neither. */
|
|
17
19
|
reserve: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stat-card-parts.d.ts","sourceRoot":"","sources":["../../src/dashboard/stat-card-parts.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"stat-card-parts.d.ts","sourceRoot":"","sources":["../../src/dashboard/stat-card-parts.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKrD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAI3C,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,OAAO,CAAC,EAAE,SAAS,CAAA;CACpB,CAAA;AASD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,eAAe,+BAgC1F;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,+FAA+F;IAC/F,OAAO,EAAE,OAAO,CAAA;IAChB;qFACiF;IACjF,UAAU,EAAE,OAAO,CAAA;IACnB,UAAU,EAAE,SAAS,CAAA;IACrB,UAAU,EAAE,SAAS,CAAA;CACtB,CAAA;AAED;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,EAAE,SAAS,sCAQ9E;AAED;0FAC0F;AAC1F,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,aAAa,CAK3E;AAED,wBAAgB,aAAa,gCAE5B;AAED,wBAAgB,cAAc,gCAE7B;AAED,wBAAgB,cAAc,gCAE7B;AAED,8EAA8E;AAC9E,wBAAgB,iBAAiB,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,+BAU3D"}
|
|
@@ -2,17 +2,32 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Skeleton } from "@mantine/core";
|
|
3
3
|
import { IconSlot } from "../theme/icon-slot.js";
|
|
4
4
|
import { CtlSlot } from "../theme/index.js";
|
|
5
|
+
import { StatusVerdict } from "../theme/status-verdict.js";
|
|
6
|
+
import { VX } from "../tokens/index.js";
|
|
5
7
|
import { InfoGlyph } from "./widget-header.js";
|
|
6
8
|
import classes from "./stat-card.module.css";
|
|
7
|
-
|
|
9
|
+
const TONE_WORD = {
|
|
10
|
+
good: { word: "OK", phrase: "Within the good threshold" },
|
|
11
|
+
warn: { word: "Watch", phrase: "Past the warning threshold" },
|
|
12
|
+
bad: { word: "Over", phrase: "Past the severe threshold" }
|
|
13
|
+
};
|
|
14
|
+
function CaptionRow({ title, icon, info, qualifier, tone, actions }) {
|
|
8
15
|
return /* @__PURE__ */ jsxs("div", { className: classes.captionRow, children: [
|
|
9
16
|
/* @__PURE__ */ jsxs("div", { className: classes.captionMain, children: [
|
|
10
17
|
/* @__PURE__ */ jsxs("div", { className: classes.lead, children: [
|
|
11
18
|
/* @__PURE__ */ jsxs("h3", { className: classes.caption, children: [
|
|
12
19
|
icon !== void 0 && /* @__PURE__ */ jsx(IconSlot, { className: classes.icon, children: icon }),
|
|
13
|
-
/* @__PURE__ */ jsx("span", { className: classes.captionText, children: title })
|
|
20
|
+
/* @__PURE__ */ jsx("span", { className: classes.captionText, "data-widget-title": true, children: title })
|
|
14
21
|
] }),
|
|
15
|
-
info !== void 0 && /* @__PURE__ */ jsx(InfoGlyph, { text: info })
|
|
22
|
+
info !== void 0 && /* @__PURE__ */ jsx(InfoGlyph, { text: info }),
|
|
23
|
+
tone !== void 0 && /* @__PURE__ */ jsx(
|
|
24
|
+
StatusVerdict,
|
|
25
|
+
{
|
|
26
|
+
color: VX.status[tone],
|
|
27
|
+
word: TONE_WORD[tone].word,
|
|
28
|
+
phrase: TONE_WORD[tone].phrase
|
|
29
|
+
}
|
|
30
|
+
)
|
|
16
31
|
] }),
|
|
17
32
|
qualifier !== void 0 && /* @__PURE__ */ jsx("span", { className: classes.qualifier, children: qualifier })
|
|
18
33
|
] }),
|
|
@@ -12,7 +12,7 @@ export type StatCardSlot = 'root' | 'header' | 'body' | 'sparkline';
|
|
|
12
12
|
*
|
|
13
13
|
* `value` is a pre-formatted `string` for the same reason the hero's is: the card cannot know the
|
|
14
14
|
* locale, the currency or the precision the number was measured at. `tone` marks ONE row as past a
|
|
15
|
-
* threshold and is the same vocabulary as the card's own `tone`, so a row saying `bad` and a
|
|
15
|
+
* threshold and is the same vocabulary as the card's own `tone`, so a row saying `bad` and a dot
|
|
16
16
|
* saying `bad` are the same claim at two scales; omitting it is untinted, never `'good'`.
|
|
17
17
|
*/
|
|
18
18
|
export type StatCardBreakdownRow = {
|
|
@@ -128,10 +128,11 @@ export type StatCardProps = BasaltProps & SlotStylesProps<StatCardSlot> & Omit<W
|
|
|
128
128
|
/** Caption-row right slot (e.g. a ghost "..." menu trigger) — wrapped in `CtlSlot tier="widget"`,
|
|
129
129
|
* so a raw `ActionIcon` with no `size` lands on the 24px step the caption row holds (C1/C5). */
|
|
130
130
|
actions?: ReactNode;
|
|
131
|
-
/** Threshold verdict —
|
|
132
|
-
* assistive tech. Omitting it is NOT `'good'`: omitted covers a
|
|
133
|
-
* is absent, and stays untinted so a card with nothing
|
|
134
|
-
* `'good'` only to assert a measured value that has
|
|
131
|
+
/** Threshold verdict — a status dot plus a short word (`OK` / `Watch` / `Over`) on the caption
|
|
132
|
+
* row, with the full phrase for assistive tech. Omitting it is NOT `'good'`: omitted covers a
|
|
133
|
+
* reading that is fine AND one that is absent, and stays untinted so a card with nothing
|
|
134
|
+
* measured can never render green. Pass `'good'` only to assert a measured value that has
|
|
135
|
+
* earned the verdict. */
|
|
135
136
|
tone?: Tone;
|
|
136
137
|
};
|
|
137
138
|
export declare function StatCard({ title, icon, info, qualifier, subtitle, value, unit, breakdown, query, loading, emptyText, delta, deltaPeriod, deltaPolarity, deltaFormat, deltaGlyph, sparkline, sparklinePlacement, actions, tone, className, style, classNames, }: StatCardProps): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stat-card.d.ts","sourceRoot":"","sources":["../../src/dashboard/stat-card.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stat-card.d.ts","sourceRoot":"","sources":["../../src/dashboard/stat-card.tsx"],"names":[],"mappings":"AA6FA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAUtC,OAAO,KAAK,EACV,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EACvB,MAAM,iBAAiB,CAAA;AAGxB,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAEzE,OAAO,KAAK,EAAe,cAAc,EAAE,MAAM,eAAe,CAAA;AAGhE;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAA;AAEnE;;;;;;;GAOG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,CAAA;CACrB,CAAA;AAaD;;;;;;;;GAQG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAmCD;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,aAAa,GAAG,WAAW,GACrC,eAAe,CA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2
|
-
import {
|
|
2
|
+
import { Card, VisuallyHidden } from "@mantine/core";
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
4
|
import {
|
|
5
5
|
BreakdownSkeleton,
|
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
rightSlotStyle
|
|
12
12
|
} from "./stat-card-parts.js";
|
|
13
13
|
import { DeltaBadge } from "./delta-badge.js";
|
|
14
|
-
import { VX } from "../tokens/index.js";
|
|
15
14
|
import { cx } from "../common/props.js";
|
|
16
15
|
import { ErrorState, QueryState, resolveQueryBranch } from "./query-state.js";
|
|
17
16
|
import classes from "./stat-card.module.css";
|
|
@@ -35,12 +34,6 @@ function useSlotWidth(active) {
|
|
|
35
34
|
}, [active, node]);
|
|
36
35
|
return { ref: setNode, width };
|
|
37
36
|
}
|
|
38
|
-
const TONE_RAIL_WIDTH = 3;
|
|
39
|
-
const TONE_LABEL = {
|
|
40
|
-
good: "Within the good threshold",
|
|
41
|
-
warn: "Past the warning threshold",
|
|
42
|
-
bad: "Past the severe threshold"
|
|
43
|
-
};
|
|
44
37
|
function renderValueBody({
|
|
45
38
|
pending,
|
|
46
39
|
resolved,
|
|
@@ -169,7 +162,7 @@ function StatCard({
|
|
|
169
162
|
const hasBleedVisual = sparkline !== void 0 && bleeds;
|
|
170
163
|
const visualNode = renderVisualNode({ show: hasBleedVisual, pending, slot: sparklineSlot });
|
|
171
164
|
const footerNode = renderFooterNode({ subtitle, pending });
|
|
172
|
-
return /* @__PURE__ */
|
|
165
|
+
return /* @__PURE__ */ jsx(
|
|
173
166
|
Card,
|
|
174
167
|
{
|
|
175
168
|
className: cx(classNames?.root, className),
|
|
@@ -188,8 +181,7 @@ function StatCard({
|
|
|
188
181
|
// grid row stretch to the tallest.
|
|
189
182
|
padding: "var(--vx-space-card-inset-y, 0.75rem) var(--vx-space-card-inset-x, 1rem)",
|
|
190
183
|
overflow: "hidden",
|
|
191
|
-
//
|
|
192
|
-
// depending on whether it happens to have crossed a threshold this render.
|
|
184
|
+
// Consumers may anchor overlays (badges, menus) to the card, so it stays a positioned box.
|
|
193
185
|
position: "relative",
|
|
194
186
|
// The card's own width drives its chrome (`stat-card.module.css`).
|
|
195
187
|
containerType: "inline-size",
|
|
@@ -197,76 +189,55 @@ function StatCard({
|
|
|
197
189
|
...style
|
|
198
190
|
},
|
|
199
191
|
"data-tone": tone,
|
|
200
|
-
children:
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
insetBlock: 0,
|
|
210
|
-
insetInlineStart: 0,
|
|
211
|
-
width: TONE_RAIL_WIDTH,
|
|
212
|
-
// `Tone`'s members are `VX.status` keys by construction, so the rail reads the
|
|
213
|
-
// per-scheme `--vx-status-*` solid directly — never a hex, so it re-resolves in both
|
|
214
|
-
// schemes and under a consumer's `derive` retune. Contrast against
|
|
215
|
-
// `--vx-surface-panel` is measured in `theme/contrast.test.ts`.
|
|
216
|
-
background: VX.status[tone]
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
)
|
|
220
|
-
] }),
|
|
221
|
-
/* @__PURE__ */ jsxs(
|
|
222
|
-
"div",
|
|
223
|
-
{
|
|
224
|
-
className: cx(classes.body, classNames?.body),
|
|
225
|
-
"data-placement": sparklinePlacement,
|
|
226
|
-
...pending && { "aria-busy": true },
|
|
227
|
-
children: [
|
|
228
|
-
pending && /* @__PURE__ */ jsx(VisuallyHidden, { children: `Loading ${title}` }),
|
|
229
|
-
/* @__PURE__ */ jsxs("div", { className: cx(classes.header, classNames?.header), children: [
|
|
230
|
-
/* @__PURE__ */ jsx(
|
|
231
|
-
CaptionRow,
|
|
232
|
-
{
|
|
233
|
-
title,
|
|
234
|
-
...icon !== void 0 && { icon },
|
|
235
|
-
...info !== void 0 && { info },
|
|
236
|
-
...qualifier !== void 0 && { qualifier },
|
|
237
|
-
...actions !== void 0 && { actions }
|
|
238
|
-
}
|
|
239
|
-
),
|
|
240
|
-
valueBody,
|
|
241
|
-
bleeds && (pending ? hasBreakdown && /* @__PURE__ */ jsx(BreakdownSkeleton, { rows: breakdownCount }) : ready && breakdownContent)
|
|
242
|
-
] }),
|
|
243
|
-
rightRow && /* @__PURE__ */ jsx("div", { className: classes.metricsRow, children: ready ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
244
|
-
breakdownContent,
|
|
245
|
-
sparklineSlot
|
|
246
|
-
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
247
|
-
hasBreakdown && /* @__PURE__ */ jsx(BreakdownSkeleton, { rows: breakdownCount }),
|
|
248
|
-
sparkline !== void 0 && /* @__PURE__ */ jsx(
|
|
249
|
-
"div",
|
|
250
|
-
{
|
|
251
|
-
className: classes.sparklineRight,
|
|
252
|
-
style: rightSlotStyle(SPARKLINE_RIGHT_WIDTH, SPARKLINE_HEIGHT),
|
|
253
|
-
children: /* @__PURE__ */ jsx(VisualSkeleton, {})
|
|
254
|
-
}
|
|
255
|
-
)
|
|
256
|
-
] }) }),
|
|
192
|
+
children: /* @__PURE__ */ jsxs(
|
|
193
|
+
"div",
|
|
194
|
+
{
|
|
195
|
+
className: cx(classes.body, classNames?.body),
|
|
196
|
+
"data-placement": sparklinePlacement,
|
|
197
|
+
...pending && { "aria-busy": true },
|
|
198
|
+
children: [
|
|
199
|
+
pending && /* @__PURE__ */ jsx(VisuallyHidden, { children: `Loading ${title}` }),
|
|
200
|
+
/* @__PURE__ */ jsxs("div", { className: cx(classes.header, classNames?.header), children: [
|
|
257
201
|
/* @__PURE__ */ jsx(
|
|
258
|
-
|
|
202
|
+
CaptionRow,
|
|
259
203
|
{
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
204
|
+
title,
|
|
205
|
+
...icon !== void 0 && { icon },
|
|
206
|
+
...info !== void 0 && { info },
|
|
207
|
+
...qualifier !== void 0 && { qualifier },
|
|
208
|
+
...tone !== void 0 && { tone },
|
|
209
|
+
...actions !== void 0 && { actions }
|
|
210
|
+
}
|
|
211
|
+
),
|
|
212
|
+
valueBody,
|
|
213
|
+
bleeds && (pending ? hasBreakdown && /* @__PURE__ */ jsx(BreakdownSkeleton, { rows: breakdownCount }) : ready && breakdownContent)
|
|
214
|
+
] }),
|
|
215
|
+
rightRow && /* @__PURE__ */ jsx("div", { className: classes.metricsRow, children: ready ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
216
|
+
breakdownContent,
|
|
217
|
+
sparklineSlot
|
|
218
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
219
|
+
hasBreakdown && /* @__PURE__ */ jsx(BreakdownSkeleton, { rows: breakdownCount }),
|
|
220
|
+
sparkline !== void 0 && /* @__PURE__ */ jsx(
|
|
221
|
+
"div",
|
|
222
|
+
{
|
|
223
|
+
className: classes.sparklineRight,
|
|
224
|
+
style: rightSlotStyle(SPARKLINE_RIGHT_WIDTH, SPARKLINE_HEIGHT),
|
|
225
|
+
children: /* @__PURE__ */ jsx(VisualSkeleton, {})
|
|
264
226
|
}
|
|
265
227
|
)
|
|
266
|
-
]
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
228
|
+
] }) }),
|
|
229
|
+
/* @__PURE__ */ jsx(
|
|
230
|
+
Foot,
|
|
231
|
+
{
|
|
232
|
+
reserve: hasBleedVisual || subtitle !== void 0,
|
|
233
|
+
visualBand: bleeds,
|
|
234
|
+
visualNode,
|
|
235
|
+
footerNode
|
|
236
|
+
}
|
|
237
|
+
)
|
|
238
|
+
]
|
|
239
|
+
}
|
|
240
|
+
)
|
|
270
241
|
}
|
|
271
242
|
);
|
|
272
243
|
}
|
|
@@ -173,15 +173,15 @@
|
|
|
173
173
|
height: var(--basalt-stat-figure-h);
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
+
/* Inset on both sides, unlike the sparkline at rest (which bleeds): a placeholder that touches one
|
|
177
|
+
* card edge and stops short of the other reads as misaligned, and a Meter in the slot is inset anyway. */
|
|
176
178
|
.skeletonVisual {
|
|
177
179
|
--skeleton-radius: 0;
|
|
178
180
|
height: var(--basalt-stat-visual-h);
|
|
179
|
-
margin-inline: calc(-1 * var(--vx-space-card-inset-x, 1rem));
|
|
180
181
|
}
|
|
181
182
|
|
|
182
183
|
.sparklineRight .skeletonVisual {
|
|
183
184
|
flex: 1 1 auto;
|
|
184
|
-
margin-inline: 0;
|
|
185
185
|
}
|
|
186
186
|
|
|
187
187
|
.skeletonRowBox {
|
|
@@ -318,11 +318,11 @@
|
|
|
318
318
|
}
|
|
319
319
|
|
|
320
320
|
/*
|
|
321
|
-
* A row past a threshold. Same vocabulary and the same per-scheme solids as the card's own tone
|
|
322
|
-
* (`
|
|
323
|
-
*
|
|
324
|
-
*
|
|
325
|
-
*
|
|
321
|
+
* A row past a threshold. Same vocabulary and the same per-scheme solids as the card's own tone dot
|
|
322
|
+
* (`VX.status[tone]`), so a row saying `bad` and a dot saying `bad` are one claim at two scales.
|
|
323
|
+
* Colour is not the only carrier at the CARD level (the dot ships a word); at
|
|
324
|
+
* the ROW level the label is the carrier — a row reading `Paid · 1,204` states its own subject
|
|
325
|
+
* either way, and the tint only ranks it.
|
|
326
326
|
*/
|
|
327
327
|
.breakdownRow[data-tone='good'] .breakdownValue {
|
|
328
328
|
color: var(--vx-status-good);
|
|
@@ -341,6 +341,22 @@
|
|
|
341
341
|
margin-inline: calc(-1 * var(--vx-space-card-inset-x, 1rem));
|
|
342
342
|
}
|
|
343
343
|
|
|
344
|
+
/* A Meter in the visual slot is a block, not a chart: it sizes to its content and keeps the card's
|
|
345
|
+
* inline inset instead of the sparkline's fixed 22px and side bleed. */
|
|
346
|
+
.sparklineBleed:has(> [data-basalt-meter]) {
|
|
347
|
+
height: auto;
|
|
348
|
+
margin-inline: 0;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
/* The `right` placement: the fixed basis, 22px height and clip are a sparkline's box. A Meter takes the
|
|
352
|
+
* row's remaining width and its own height, unclipped. */
|
|
353
|
+
.sparklineRight:has(> [data-basalt-meter]) {
|
|
354
|
+
flex: 1 1 auto;
|
|
355
|
+
height: auto;
|
|
356
|
+
overflow: visible;
|
|
357
|
+
align-items: stretch;
|
|
358
|
+
}
|
|
359
|
+
|
|
344
360
|
/* Asks for `StatCard`'s `SPARKLINE_RIGHT_WIDTH`/`_HEIGHT` (handed down as custom properties, so this
|
|
345
361
|
* rule and the narrow-card reset below can both reach them). `align-self: flex-end` is the one alignment
|
|
346
362
|
* this restructure keeps at the SPARKLINE's own level rather than the row's: `.metricsRow` does not
|
|
@@ -375,4 +391,8 @@
|
|
|
375
391
|
margin-top: auto;
|
|
376
392
|
margin-inline: calc(-1 * var(--vx-space-card-inset-x, 1rem));
|
|
377
393
|
}
|
|
394
|
+
|
|
395
|
+
.metricsRow .sparklineRight:has(> [data-basalt-meter], > .skeletonVisual) {
|
|
396
|
+
margin-inline: 0;
|
|
397
|
+
}
|
|
378
398
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget-header.d.ts","sourceRoot":"","sources":["../../src/dashboard/widget-header.tsx"],"names":[],"mappings":"AAgCA,OAAO,KAAK,EAAE,SAAS,EAAa,MAAM,OAAO,CAAA;AAGjD,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAGnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAGlD,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAA;AAE7D;;;;;;;;;GASG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAA;AAEnE,MAAM,MAAM,iBAAiB,GAAG,WAAW,GACzC,eAAe,CAAC,gBAAgB,CAAC,GAAG;IAClC;;;;gDAI4C;IAC5C,IAAI,EAAE,gBAAgB,CAAA;IACtB,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAA;IACb,iGAAiG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ref: triggerRef,
|
|
78
78
|
type: "button",
|
|
79
79
|
"data-basalt-hit": true,
|
|
80
|
+
"data-info-trigger": true,
|
|
80
81
|
className: classes.infoTrigger,
|
|
81
82
|
"aria-label": ariaLabel,
|
|
82
83
|
"aria-describedby": open ? tipId : void 0,
|
|
@@ -145,7 +146,7 @@ function WidgetHeader({
|
|
|
145
146
|
/* @__PURE__ */ jsxs("div", { className: classes.titleRow, children: [
|
|
146
147
|
/* @__PURE__ */ jsxs(Heading, { className: cx(classes.heading, classNames?.title), children: [
|
|
147
148
|
icon !== void 0 && /* @__PURE__ */ jsx(IconSlot, { className: cx(classes.icon, classNames?.icon), children: icon }),
|
|
148
|
-
/* @__PURE__ */ jsx("span", { className: classes.titleText, children: title })
|
|
149
|
+
/* @__PURE__ */ jsx("span", { className: classes.titleText, "data-widget-title": true, children: title })
|
|
149
150
|
] }),
|
|
150
151
|
info !== void 0 && /* @__PURE__ */ jsx(InfoGlyph, { text: info, ...subtitle !== void 0 && { note: subtitle } }),
|
|
151
152
|
info === void 0 && subtitle !== void 0 && /* @__PURE__ */ jsx(
|
|
@@ -247,12 +247,16 @@
|
|
|
247
247
|
* overlay — axe and assistive tech measure the element. The negative margin hands the extra
|
|
248
248
|
* (24 - 11) / 2 back on every side, so the glyph and the row around it keep their drawn size. */
|
|
249
249
|
.infoTrigger {
|
|
250
|
+
--basalt-info-glyph: 11px;
|
|
251
|
+
--basalt-info-ring-offset: 2px;
|
|
252
|
+
--basalt-info-ring-width: 2px;
|
|
250
253
|
display: inline-flex;
|
|
251
254
|
align-items: center;
|
|
252
255
|
justify-content: center;
|
|
253
256
|
min-width: 24px;
|
|
254
257
|
min-height: 24px;
|
|
255
|
-
margin: calc((
|
|
258
|
+
margin: calc((var(--basalt-info-glyph) - 24px) / 2);
|
|
259
|
+
position: relative;
|
|
256
260
|
appearance: none;
|
|
257
261
|
padding: 0;
|
|
258
262
|
border: none;
|
|
@@ -261,6 +265,29 @@
|
|
|
261
265
|
cursor: help;
|
|
262
266
|
}
|
|
263
267
|
|
|
268
|
+
/* The keyboard ring hugs the glyph, not the 24px hit box: drawn on the box it reached 6.5px past
|
|
269
|
+
* the glyph and painted over the title's last letter and a neighbouring status dot. The `::before`
|
|
270
|
+
* is the glyph + the offset on each side, outlined by the ring width, so the ring ends 4px from the
|
|
271
|
+
* glyph — inside the 6px control gap. (`::after` is the hit overlay's.)
|
|
272
|
+
* Forced colors: the ring is an `outline`, which the UA keeps and recolours to a system colour, so
|
|
273
|
+
* it stays visible without a `forced-colors` override. */
|
|
274
|
+
.infoTrigger:focus-visible {
|
|
275
|
+
outline: none;
|
|
276
|
+
|
|
277
|
+
&::before {
|
|
278
|
+
content: '';
|
|
279
|
+
position: absolute;
|
|
280
|
+
top: 50%;
|
|
281
|
+
left: 50%;
|
|
282
|
+
translate: -50% -50%;
|
|
283
|
+
width: calc(var(--basalt-info-glyph) + 2 * var(--basalt-info-ring-offset));
|
|
284
|
+
height: calc(var(--basalt-info-glyph) + 2 * var(--basalt-info-ring-offset));
|
|
285
|
+
border-radius: var(--vx-radius-fine);
|
|
286
|
+
outline: var(--basalt-info-ring-width) solid var(--vx-accent);
|
|
287
|
+
pointer-events: none;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
264
291
|
.infoTrigger:hover,
|
|
265
292
|
.infoTrigger:focus-visible,
|
|
266
293
|
.infoTrigger[data-open='true'] {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Component `vars` that carry the Wave 33 chrome (`
|
|
2
|
+
* Component `vars` that carry the Wave 33 chrome (`MIGRATING.md` § Light and outline Buttons are ink, D27) and the
|
|
3
3
|
* ON-COLOR re-point they sit beside. Pure functions of theme + props, kept out of `theme/index.ts`
|
|
4
4
|
* so the tests can call them directly.
|
|
5
5
|
*/
|
|
@@ -39,32 +39,43 @@ import type { MantineTheme } from '@mantine/core';
|
|
|
39
39
|
* Stepper / Indicator / Timeline all call Mantine's `getContrastColor` directly) are re-pointed at
|
|
40
40
|
* it too, in `components` below. Regression-locked by `contrast.test.ts`.
|
|
41
41
|
*/
|
|
42
|
-
export declare function onColor(theme: MantineTheme, color: string | undefined): string | undefined;
|
|
42
|
+
export declare function onColor(theme: MantineTheme, color: string | null | undefined): string | undefined;
|
|
43
43
|
/**
|
|
44
44
|
* The on-color for a component that bypasses the variant resolver and calls Mantine's
|
|
45
45
|
* `getContrastColor` directly. `undefined` (autoContrast off, or a hex / indexed color) leaves
|
|
46
46
|
* Mantine's own value in place — `mergeVars` strips undefined before merging.
|
|
47
47
|
*/
|
|
48
48
|
export declare function onColorFor(theme: MantineTheme, props: {
|
|
49
|
-
color?: string | undefined;
|
|
49
|
+
color?: string | null | undefined;
|
|
50
50
|
autoContrast?: boolean | undefined;
|
|
51
51
|
}): string | undefined;
|
|
52
|
-
/** The chrome opt-out: a call site that names a colour (even the primary one) keeps its hue. */
|
|
53
|
-
export declare function hasExplicitColor(color: string | undefined): boolean;
|
|
54
52
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* carries its hue as the whole signal. Mantine hands the variant resolver `color || primaryColor`,
|
|
59
|
-
* so only the component props can tell "unnamed" from "primary" — hence vars, not the resolver.
|
|
53
|
+
* The chrome opt-out: a call site that names a colour (even the primary one) keeps its hue. An
|
|
54
|
+
* empty string and `null` name nothing — Mantine reads `color || primaryColor`, so they fall back to
|
|
55
|
+
* the primary colour too.
|
|
60
56
|
*/
|
|
61
|
-
export declare function
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
57
|
+
export declare function hasExplicitColor(color: string | null | undefined): boolean;
|
|
58
|
+
type InkVars = {
|
|
59
|
+
color?: string;
|
|
60
|
+
hover?: string;
|
|
61
|
+
bg?: string;
|
|
62
|
+
border?: string;
|
|
67
63
|
};
|
|
64
|
+
/**
|
|
65
|
+
* A `subtle`, `light` or `outline` Button / ActionIcon that names no colour is ink, not the accent
|
|
66
|
+
* (`MIGRATING.md` § Light and outline Buttons are ink, D27). `subtle`: ink label, ink-6% hover
|
|
67
|
+
* (`docs/DESIGN-SPEC.md` §5 ghost idiom). `light`: the subtle surface with an ink label, hover one
|
|
68
|
+
* ink step on top (Mantine's gray-light roles collapse bg and hover to one colour in light). `outline`:
|
|
69
|
+
* the surface border, ink label, subtle-surface hover. An explicit `color=` — the primary one
|
|
70
|
+
* included — keeps Mantine's tinted vars: `color="red"` on a destructive action carries its hue as
|
|
71
|
+
* the whole signal. Mantine hands the variant resolver `color || primaryColor`, so only the
|
|
72
|
+
* component props can tell "unnamed" from "primary" — hence vars, not the resolver. Disabled needs no
|
|
73
|
+
* gate: Mantine's disabled rule sets colour, background and border directly, not through these vars.
|
|
74
|
+
*/
|
|
75
|
+
export declare function inkVars(props: {
|
|
76
|
+
color?: string | null | undefined;
|
|
77
|
+
variant?: string | undefined;
|
|
78
|
+
}): InkVars;
|
|
68
79
|
/**
|
|
69
80
|
* Tabs vars: the on-color re-point plus the active underline in ink (SPEC § 6.12). Only the
|
|
70
81
|
* underline `default` variant takes ink (`pills` fills with the colour); an explicit `color=` opts
|
|
@@ -73,10 +84,11 @@ export declare function subtleInkVars(props: {
|
|
|
73
84
|
* varsResolver writes `--tabs-text-color` (an upstream type gap).
|
|
74
85
|
*/
|
|
75
86
|
export declare function tabsVars(theme: MantineTheme, props: {
|
|
76
|
-
color?: string | undefined;
|
|
87
|
+
color?: string | null | undefined;
|
|
77
88
|
variant?: string | undefined;
|
|
78
89
|
autoContrast?: boolean | undefined;
|
|
79
90
|
}): {
|
|
80
91
|
root: Record<'--tabs-color' | '--tabs-radius' | '--tabs-text-color', string | undefined>;
|
|
81
92
|
};
|
|
93
|
+
export {};
|
|
82
94
|
//# sourceMappingURL=chrome-vars.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chrome-vars.d.ts","sourceRoot":"","sources":["../../src/theme/chrome-vars.ts"],"names":[],"mappings":"AAAA;;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,GAAG,OAAO,CAKV;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CACtB,KAAK,EAAE,YAAY,EACnB,KAAK,EAAE;IACL,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;IACjC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B,YAAY,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CACnC,GACA;IAAE,IAAI,EAAE,MAAM,CAAC,cAAc,GAAG,eAAe,GAAG,mBAAmB,EAAE,MAAM,GAAG,SAAS,CAAC,CAAA;CAAE,CAS9F"}
|
|
@@ -8,14 +8,24 @@ function onColorFor(theme, props) {
|
|
|
8
8
|
return autoContrast ? onColor(theme, props.color) : void 0;
|
|
9
9
|
}
|
|
10
10
|
function hasExplicitColor(color) {
|
|
11
|
-
return color !==
|
|
11
|
+
return typeof color === "string" && color !== "";
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
const INK = "var(--vx-ink)";
|
|
14
|
+
const SUBTLE = "var(--vx-surface-subtle)";
|
|
15
|
+
const INK_BY_VARIANT = {
|
|
16
|
+
subtle: { color: INK, hover: "color-mix(in srgb, var(--vx-ink) 6%, transparent)" },
|
|
17
|
+
light: { color: INK, bg: SUBTLE, hover: `color-mix(in srgb, var(--vx-ink) 6%, ${SUBTLE})` },
|
|
18
|
+
outline: {
|
|
19
|
+
color: INK,
|
|
20
|
+
border: "calc(0.0625rem * var(--mantine-scale)) solid var(--vx-surface-border)",
|
|
21
|
+
hover: SUBTLE
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
function inkVars(props) {
|
|
25
|
+
const { variant } = props;
|
|
26
|
+
if (hasExplicitColor(props.color) || variant === void 0) return {};
|
|
27
|
+
if (!Object.hasOwn(INK_BY_VARIANT, variant)) return {};
|
|
28
|
+
return INK_BY_VARIANT[variant] ?? {};
|
|
19
29
|
}
|
|
20
30
|
function tabsVars(theme, props) {
|
|
21
31
|
const underline = !hasExplicitColor(props.color) && (props.variant ?? "default") === "default";
|
|
@@ -29,8 +39,8 @@ function tabsVars(theme, props) {
|
|
|
29
39
|
}
|
|
30
40
|
export {
|
|
31
41
|
hasExplicitColor,
|
|
42
|
+
inkVars,
|
|
32
43
|
onColor,
|
|
33
44
|
onColorFor,
|
|
34
|
-
subtleInkVars,
|
|
35
45
|
tabsVars
|
|
36
46
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EA0CV,oBAAoB,EAGpB,oBAAoB,EAErB,MAAM,eAAe,CAAA;AAStB,OAAO,KAAK,EAAe,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAKpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAUvD;;;;;GAKG;AACH,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAIvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAMvD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;AAenE,OAAO,QAAQ,eAAe,CAAC;IAC7B,UAAU,iBAAiB;QACzB,YAAY,CAAC,EAAE,YAAY,CAAA;QAC3B,WAAW,CAAC,EAAE,iBAAiB,CAAA;QAC/B,YAAY,CAAC,EAAE,YAAY,CAAA;QAC3B,aAAa,CAAC,EAAE,WAAW,CAAA;KAC5B;CACF;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EA0CV,oBAAoB,EAGpB,oBAAoB,EAErB,MAAM,eAAe,CAAA;A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;;;;;;;;;;;OAgBG;IACH,KAAK,CAAC,EAAE,iBAAiB,CAAA;IAEzB;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,EAAE,iBAAiB,CAAA;IAE1B;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,OAAO,CAAC,EAAE,kBAAkB,CAAA;CAC7B,CAAA;AAYD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,CAAC,EAAE,IAAI,CAAC,oBAAoB,EAAE,aAAa,CAAC,EACrD,OAAO,CAAC,EAAE,wBAAwB,GACjC,oBAAoB,CAiCtB"}
|
package/dist/theme/index.js
CHANGED
|
@@ -17,7 +17,7 @@ import { DEFAULT_DERIVE_CONFIG, isDefaultDeriveConfig, resolveDeriveConfig } fro
|
|
|
17
17
|
import { pxRem, TEXT_LINE, VX } from "../tokens/core.js";
|
|
18
18
|
import { CTL_HEIGHT_VARS } from "../tokens/ctl-vars.js";
|
|
19
19
|
import { SIZE_CLASS_BREAKPOINTS } from "../tokens/size-classes.js";
|
|
20
|
-
import { onColor, onColorFor,
|
|
20
|
+
import { onColor, onColorFor, inkVars, tabsVars } from "./chrome-vars.js";
|
|
21
21
|
import controlsClasses from "./controls.module.css";
|
|
22
22
|
import floatingClasses from "./floating.module.css";
|
|
23
23
|
import navLinkClasses from "./nav-link.module.css";
|
|
@@ -416,12 +416,14 @@ function buildTheme(data, options = {}) {
|
|
|
416
416
|
Button: ext({
|
|
417
417
|
classNames: { root: controlsClasses.buttonRoot },
|
|
418
418
|
vars: (_theme, props) => {
|
|
419
|
-
const ink =
|
|
419
|
+
const ink = inkVars(props);
|
|
420
420
|
return {
|
|
421
421
|
root: {
|
|
422
422
|
"--button-height": props.size === "md" ? "calc(var(--vx-space-control-height) * var(--mantine-scale))" : void 0,
|
|
423
423
|
"--button-color": ink.color,
|
|
424
|
-
"--button-hover": ink.hover
|
|
424
|
+
"--button-hover": ink.hover,
|
|
425
|
+
"--button-bg": ink.bg,
|
|
426
|
+
"--button-bd": ink.border
|
|
425
427
|
}
|
|
426
428
|
};
|
|
427
429
|
}
|
|
@@ -429,12 +431,14 @@ function buildTheme(data, options = {}) {
|
|
|
429
431
|
ActionIcon: ext({
|
|
430
432
|
classNames: { root: controlsClasses.actionIconRoot },
|
|
431
433
|
vars: (_theme, props) => {
|
|
432
|
-
const ink =
|
|
434
|
+
const ink = inkVars(props);
|
|
433
435
|
return {
|
|
434
436
|
root: {
|
|
435
437
|
"--ai-size": props.size === "md" ? "calc(var(--vx-space-control-height) * var(--mantine-scale))" : void 0,
|
|
436
438
|
"--ai-color": ink.color,
|
|
437
|
-
"--ai-hover": ink.hover
|
|
439
|
+
"--ai-hover": ink.hover,
|
|
440
|
+
"--ai-bg": ink.bg,
|
|
441
|
+
"--ai-bd": ink.border
|
|
438
442
|
}
|
|
439
443
|
};
|
|
440
444
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type StatusDotProps = {
|
|
2
|
+
/** Any CSS colour; callers pass a `VX.status.*` token so it re-resolves per scheme. */
|
|
3
|
+
color: string;
|
|
4
|
+
};
|
|
5
|
+
export declare function StatusDot({ color }: StatusDotProps): import("react").JSX.Element;
|
|
6
|
+
//# sourceMappingURL=status-dot.d.ts.map
|