@loworbitstudio/visor-theme-engine 0.17.1 → 0.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/dist/adapters/index.d.ts +16 -2
- package/dist/adapters/index.js +85 -3
- package/dist/{chunk-BUWBBUFG.js → chunk-32DC5DAR.js} +490 -0
- package/dist/index.d.ts +141 -2
- package/dist/index.js +160 -3
- package/dist/{types-Cvm7vFwe.d.ts → types-DF5StphJ.d.ts} +164 -1
- package/package.json +1 -1
- package/src/visor-theme.schema.json +133 -0
|
@@ -1242,6 +1242,489 @@ function serializeColor(parsed) {
|
|
|
1242
1242
|
}
|
|
1243
1243
|
}
|
|
1244
1244
|
|
|
1245
|
+
// src/component-tokens.ts
|
|
1246
|
+
function componentTokenName(family, key) {
|
|
1247
|
+
return `${family.prefix}-${key}`;
|
|
1248
|
+
}
|
|
1249
|
+
var TABLE = "components/ui/table/table.module.css";
|
|
1250
|
+
var DATA_TABLE = "components/ui/data-table/data-table.module.css";
|
|
1251
|
+
var CHIP = "components/ui/chip/chip.module.css";
|
|
1252
|
+
var BADGE = "components/ui/badge/badge.module.css";
|
|
1253
|
+
var STATUS_BADGE = "components/ui/status-badge/status-badge.module.css";
|
|
1254
|
+
var FILTER_BAR = "components/ui/filter-bar/filter-bar.module.css";
|
|
1255
|
+
var PAGE_HEADER = "components/ui/page-header/page-header.module.css";
|
|
1256
|
+
var EMPTY_STATE = "components/ui/empty-state/empty-state.module.css";
|
|
1257
|
+
var BANNER = "components/ui/banner/banner.module.css";
|
|
1258
|
+
var SIDEBAR = "components/ui/sidebar/sidebar.module.css";
|
|
1259
|
+
var TABS = "components/ui/tabs/tabs.module.css";
|
|
1260
|
+
var SKELETON = "components/ui/skeleton/skeleton.module.css";
|
|
1261
|
+
var SPINNER = "components/ui/spinner/spinner.module.css";
|
|
1262
|
+
var CHECKBOX = "components/ui/checkbox/checkbox.module.css";
|
|
1263
|
+
function at(file, fallback) {
|
|
1264
|
+
return [{ file, fallback }];
|
|
1265
|
+
}
|
|
1266
|
+
var tableFamily = {
|
|
1267
|
+
family: "table",
|
|
1268
|
+
prefix: "table",
|
|
1269
|
+
description: "Table head, row and cell treatment. The retro measured the same header cell rendered four ways across one admin app; binding this family pins it once.",
|
|
1270
|
+
tokens: [
|
|
1271
|
+
{ key: "font-size", property: "font-size", description: "Base table type size.", consumers: at(TABLE, "var(--font-size-sm, 0.875rem)") },
|
|
1272
|
+
{ key: "text-color", property: "color", description: "Base table text colour.", consumers: at(TABLE, "var(--text-primary, #111827)") },
|
|
1273
|
+
{ key: "head-height", property: "height", description: "Header row height.", consumers: at(TABLE, "3rem") },
|
|
1274
|
+
{ key: "head-padding-x", property: "padding-left / padding-right", description: "Header cell horizontal padding.", consumers: at(TABLE, "var(--spacing-3, 0.75rem)") },
|
|
1275
|
+
{ key: "head-font-family", property: "font-family", description: "Header cell family \u2014 set a mono/condensed face for a chrome-style header.", consumers: at(TABLE, "inherit") },
|
|
1276
|
+
{ key: "head-font-size", property: "font-size", description: "Header cell type size.", consumers: at(TABLE, "inherit") },
|
|
1277
|
+
{ key: "head-font-weight", property: "font-weight", description: "Header cell weight.", consumers: at(TABLE, "var(--font-weight-medium, 500)") },
|
|
1278
|
+
{ key: "head-letter-spacing", property: "letter-spacing", description: "Header cell tracking.", consumers: at(TABLE, "inherit") },
|
|
1279
|
+
{ key: "head-text-transform", property: "text-transform", description: "Header cell casing \u2014 `uppercase` for the editorial admin header.", consumers: at(TABLE, "inherit") },
|
|
1280
|
+
{ key: "head-color", property: "color", description: "Header cell text colour.", consumers: at(TABLE, "var(--text-primary, #111827)") },
|
|
1281
|
+
{ key: "head-bg", property: "background-color", description: "Header cell fill. Sits above the shared `--dt-header-bg` surface role.", consumers: at(TABLE, "var(--dt-header-bg, transparent)") },
|
|
1282
|
+
{ key: "row-border", property: "border-bottom", description: "Row separator (width, style and colour).", consumers: at(TABLE, "1px solid var(--border-default, #e5e7eb)") },
|
|
1283
|
+
{ key: "row-hover-bg", property: "background-color", description: "Row hover fill.", consumers: at(TABLE, "var(--surface-muted, #f3f4f6)") },
|
|
1284
|
+
{ key: "row-selected-bg", property: "background-color", description: "Selected-row fill.", consumers: at(TABLE, "var(--surface-muted, #f3f4f6)") },
|
|
1285
|
+
{ key: "cell-padding", property: "padding", description: "Body cell padding.", consumers: at(TABLE, "var(--spacing-3, 0.75rem)") },
|
|
1286
|
+
{ key: "cell-font-size", property: "font-size", description: "Body cell type size.", consumers: at(TABLE, "inherit") },
|
|
1287
|
+
{ key: "cell-color", property: "color", description: "Body cell text colour.", consumers: at(TABLE, "var(--text-primary, #111827)") },
|
|
1288
|
+
{ key: "cell-bg", property: "background-color", description: "Body cell fill. Sits above the shared `--dt-row-bg` surface role.", consumers: at(TABLE, "var(--dt-row-bg, transparent)") },
|
|
1289
|
+
{ key: "cell-border-top", property: "border-top", description: "Cell hairline.", consumers: at(TABLE, "1px solid var(--hairline, transparent)") },
|
|
1290
|
+
{ key: "footer-bg", property: "background-color", description: "Footer row fill.", consumers: at(TABLE, "var(--surface-muted, #f3f4f6)") },
|
|
1291
|
+
{ key: "caption-color", property: "color", description: "Caption text colour.", consumers: at(TABLE, "var(--text-secondary, #6b7280)") }
|
|
1292
|
+
]
|
|
1293
|
+
};
|
|
1294
|
+
var dataTableFamily = {
|
|
1295
|
+
family: "data-table",
|
|
1296
|
+
prefix: "dt",
|
|
1297
|
+
description: "The admin-ui Tier-2 data-table surface stack (D3). Shared between the Table primitive and the DataTable shell so a list page and its table read as one surface.",
|
|
1298
|
+
tokens: [
|
|
1299
|
+
{
|
|
1300
|
+
key: "header-bg",
|
|
1301
|
+
property: "background-color",
|
|
1302
|
+
description: "Header-row surface tier.",
|
|
1303
|
+
consumers: [
|
|
1304
|
+
{ file: TABLE, fallback: "transparent" },
|
|
1305
|
+
{ file: DATA_TABLE, fallback: "var(--surface-card)" }
|
|
1306
|
+
]
|
|
1307
|
+
},
|
|
1308
|
+
{
|
|
1309
|
+
key: "row-bg",
|
|
1310
|
+
property: "background-color",
|
|
1311
|
+
description: "Data-row surface tier \u2014 a hair above the page so rows track any palette.",
|
|
1312
|
+
consumers: [
|
|
1313
|
+
{ file: TABLE, fallback: "transparent" },
|
|
1314
|
+
{ file: DATA_TABLE, fallback: "color-mix(in srgb, var(--surface-page) 75%, var(--surface-card) 25%)" }
|
|
1315
|
+
]
|
|
1316
|
+
},
|
|
1317
|
+
{
|
|
1318
|
+
key: "container-radius",
|
|
1319
|
+
property: "border-radius",
|
|
1320
|
+
description: "Table container rounding \u2014 `0` lets the consumer shell own the corners.",
|
|
1321
|
+
consumers: [
|
|
1322
|
+
{ file: TABLE, fallback: "var(--radius-lg, 0.5rem)" },
|
|
1323
|
+
{ file: DATA_TABLE, fallback: "0" }
|
|
1324
|
+
]
|
|
1325
|
+
},
|
|
1326
|
+
{
|
|
1327
|
+
key: "container-shadow",
|
|
1328
|
+
property: "box-shadow",
|
|
1329
|
+
description: "Table container elevation.",
|
|
1330
|
+
consumers: [
|
|
1331
|
+
{ file: TABLE, fallback: "var(--shadow-sm)" },
|
|
1332
|
+
{ file: DATA_TABLE, fallback: "none" }
|
|
1333
|
+
]
|
|
1334
|
+
},
|
|
1335
|
+
{ key: "row-py", property: "padding-top / padding-bottom", description: "Row vertical rhythm (the density axis).", consumers: at(DATA_TABLE, "var(--spacing-3, 0.75rem)") },
|
|
1336
|
+
{ key: "cell-px", property: "padding-left / padding-right", description: "Cell horizontal inset.", consumers: at(DATA_TABLE, "var(--spacing-5, 1.25rem)") },
|
|
1337
|
+
{ key: "header-font-size", property: "font-size", description: "Sort-header type size.", consumers: at(DATA_TABLE, "11px") }
|
|
1338
|
+
]
|
|
1339
|
+
};
|
|
1340
|
+
var chipFamily = {
|
|
1341
|
+
family: "chip",
|
|
1342
|
+
prefix: "chip",
|
|
1343
|
+
description: "Chip / filter-pill treatment. The retro found the same mono status chip at 8.5 / 9 / 9.5 / 10 / 11px with tracking .03\u2013.14em across nine implementations; this family is the single dial.",
|
|
1344
|
+
tokens: [
|
|
1345
|
+
{ key: "radius", property: "border-radius", description: "Chip corner rounding.", consumers: at(CHIP, "var(--radius-full, 9999px)") },
|
|
1346
|
+
{ key: "border", property: "border", description: "Chip outline.", consumers: at(CHIP, "var(--stroke-width-thin, 1px) solid var(--border-default, #e5e7eb)") },
|
|
1347
|
+
{ key: "bg", property: "background-color", description: "Resting chip fill.", consumers: at(CHIP, "var(--surface-card, #ffffff)") },
|
|
1348
|
+
{ key: "text-color", property: "color", description: "Chip label colour.", consumers: at(CHIP, "var(--text-primary, #111827)") },
|
|
1349
|
+
{ key: "font-family", property: "font-family", description: "Chip label family \u2014 bind a mono face for token/ID chips.", consumers: at(CHIP, "var(--font-body, inherit)") },
|
|
1350
|
+
{ key: "font-weight", property: "font-weight", description: "Chip label weight.", consumers: at(CHIP, "var(--font-weight-medium, 500)") },
|
|
1351
|
+
{ key: "letter-spacing", property: "letter-spacing", description: "Chip label tracking.", consumers: at(CHIP, "inherit") },
|
|
1352
|
+
{ key: "text-transform", property: "text-transform", description: "Chip label casing.", consumers: at(CHIP, "inherit") },
|
|
1353
|
+
{ key: "sm-height", property: "height", description: "Small chip height.", consumers: at(CHIP, "1.5rem") },
|
|
1354
|
+
{ key: "sm-padding-x", property: "padding", description: "Small chip horizontal padding.", consumers: at(CHIP, "var(--spacing-2, 0.5rem)") },
|
|
1355
|
+
{ key: "sm-font-size", property: "font-size", description: "Small chip type size.", consumers: at(CHIP, "var(--font-size-xs, 0.75rem)") },
|
|
1356
|
+
{ key: "md-height", property: "height", description: "Default chip height.", consumers: at(CHIP, "2rem") },
|
|
1357
|
+
{ key: "md-padding-x", property: "padding", description: "Default chip horizontal padding.", consumers: at(CHIP, "var(--spacing-3, 0.75rem)") },
|
|
1358
|
+
{ key: "md-font-size", property: "font-size", description: "Default chip type size.", consumers: at(CHIP, "var(--font-size-sm, 0.875rem)") },
|
|
1359
|
+
{ key: "lg-height", property: "height", description: "Large chip height.", consumers: at(CHIP, "2.5rem") },
|
|
1360
|
+
{ key: "lg-padding-x", property: "padding", description: "Large chip horizontal padding.", consumers: at(CHIP, "var(--spacing-4, 1rem)") },
|
|
1361
|
+
{ key: "lg-font-size", property: "font-size", description: "Large chip type size.", consumers: at(CHIP, "var(--font-size-base, 1rem)") },
|
|
1362
|
+
{ key: "selected-bg", property: "background-color", description: "Selected chip fill.", consumers: at(CHIP, "var(--surface-accent-subtle, #eff6ff)") },
|
|
1363
|
+
{ key: "selected-border-color", property: "border-color", description: "Selected chip outline colour.", consumers: at(CHIP, "var(--surface-accent-default, #3b82f6)") },
|
|
1364
|
+
{ key: "selected-text-color", property: "color", description: "Selected chip label colour.", consumers: at(CHIP, "var(--text-link, #2563eb)") }
|
|
1365
|
+
]
|
|
1366
|
+
};
|
|
1367
|
+
var badgeFamily = {
|
|
1368
|
+
family: "badge",
|
|
1369
|
+
prefix: "badge",
|
|
1370
|
+
description: "Badge treatment \u2014 the D3 Tier-2 `--badge-text-transform` / `-letter-spacing` / `-font-size` / `-font-weight` set, promoted from the admin-ui audit to a bindable contract.",
|
|
1371
|
+
tokens: [
|
|
1372
|
+
{ key: "radius", property: "border-radius", description: "Badge corner rounding.", consumers: at(BADGE, "var(--radius-full, 9999px)") },
|
|
1373
|
+
{ key: "border", property: "border", description: "Badge outline.", consumers: at(BADGE, "1px solid transparent") },
|
|
1374
|
+
{ key: "font-family", property: "font-family", description: "Badge label family.", consumers: at(BADGE, "inherit") },
|
|
1375
|
+
{ key: "font-weight", property: "font-weight", description: "Badge label weight (Tier-2: 600).", consumers: at(BADGE, "var(--font-weight-medium, 500)") },
|
|
1376
|
+
{ key: "text-transform", property: "text-transform", description: "Badge casing (Tier-2: uppercase).", consumers: at(BADGE, "none") },
|
|
1377
|
+
{ key: "letter-spacing", property: "letter-spacing", description: "Badge tracking (Tier-2: 0.04em).", consumers: at(BADGE, "normal") },
|
|
1378
|
+
{
|
|
1379
|
+
key: "font-size",
|
|
1380
|
+
property: "font-size",
|
|
1381
|
+
description: "Default badge type size (Tier-2: 11px). Drives both the standard and editorial-density steps.",
|
|
1382
|
+
consumers: [
|
|
1383
|
+
{ file: BADGE, fallback: "var(--font-size-xs, 0.75rem)" },
|
|
1384
|
+
{ file: BADGE, fallback: "11px" }
|
|
1385
|
+
]
|
|
1386
|
+
},
|
|
1387
|
+
{ key: "md-padding", property: "padding", description: "Default badge padding.", consumers: at(BADGE, "calc(var(--spacing-1, 0.25rem) / 2) var(--spacing-2, 0.5rem)") },
|
|
1388
|
+
{ key: "md-gap", property: "gap", description: "Default badge icon gap.", consumers: at(BADGE, "var(--spacing-1, 0.25rem)") }
|
|
1389
|
+
]
|
|
1390
|
+
};
|
|
1391
|
+
var statusBadgeFamily = {
|
|
1392
|
+
family: "status-badge",
|
|
1393
|
+
prefix: "status-badge",
|
|
1394
|
+
description: "Status-badge indicator dot and the mono readout label. Chrome is inherited from the Badge family.",
|
|
1395
|
+
tokens: [
|
|
1396
|
+
{ key: "dot-size", property: "width / height", description: "Indicator dot diameter.", consumers: at(STATUS_BADGE, "0.5rem") },
|
|
1397
|
+
{ key: "dot-radius", property: "border-radius", description: "Indicator dot rounding \u2014 square it for a Linear-style status marker.", consumers: at(STATUS_BADGE, "var(--radius-full, 9999px)") },
|
|
1398
|
+
{ key: "mono-font-family", property: "font-family", description: "Mono-label family.", consumers: at(STATUS_BADGE, 'var(--font-mono, "SF Mono", "Fira Code", "Fira Mono", monospace)') },
|
|
1399
|
+
{ key: "mono-font-size", property: "font-size", description: "Mono-label type size.", consumers: at(STATUS_BADGE, "var(--text-11, 0.6875rem)") },
|
|
1400
|
+
{ key: "mono-letter-spacing", property: "letter-spacing", description: "Mono-label tracking.", consumers: at(STATUS_BADGE, "0.02em") }
|
|
1401
|
+
]
|
|
1402
|
+
};
|
|
1403
|
+
var filterBarFamily = {
|
|
1404
|
+
family: "filter-bar",
|
|
1405
|
+
prefix: "filter-bar",
|
|
1406
|
+
description: `The operator's named case: "the filter bar above the table in many admin pages was pretty different from one to the next; that should be streamlined."`,
|
|
1407
|
+
tokens: [
|
|
1408
|
+
{ key: "bg", property: "background-color", description: "Filter-bar fill.", consumers: at(FILTER_BAR, "var(--surface-card, #ffffff)") },
|
|
1409
|
+
{ key: "border", property: "border", description: "Filter-bar frame.", consumers: at(FILTER_BAR, "1px solid var(--border-default, #e5e7eb)") },
|
|
1410
|
+
{ key: "radius", property: "border-radius", description: "Filter-bar corner rounding.", consumers: at(FILTER_BAR, "var(--radius-lg, 0.75rem)") },
|
|
1411
|
+
{ key: "padding", property: "padding", description: "Filter-bar inset.", consumers: at(FILTER_BAR, "var(--spacing-3, 0.75rem) var(--spacing-4, 1rem)") },
|
|
1412
|
+
{ key: "gap", property: "gap", description: "Vertical rhythm between the control row and the chip row.", consumers: at(FILTER_BAR, "var(--spacing-3, 0.75rem)") },
|
|
1413
|
+
{ key: "text-color", property: "color", description: "Filter-bar text colour.", consumers: at(FILTER_BAR, "var(--text-primary, #111827)") },
|
|
1414
|
+
{ key: "dense-padding", property: "padding", description: "Dense-variant inset.", consumers: at(FILTER_BAR, "var(--spacing-2, 0.5rem) var(--spacing-3, 0.75rem)") },
|
|
1415
|
+
{ key: "dense-gap", property: "gap", description: "Dense-variant rhythm.", consumers: at(FILTER_BAR, "var(--spacing-2, 0.5rem)") },
|
|
1416
|
+
{ key: "control-radius", property: "border-radius", description: "Rounding of the search input and filter triggers inside the bar.", consumers: at(FILTER_BAR, "var(--radius-md, 0.25rem)") },
|
|
1417
|
+
{ key: "results-font-size", property: "font-size", description: "Results-count type size.", consumers: at(FILTER_BAR, "var(--font-size-sm, 0.875rem)") },
|
|
1418
|
+
{ key: "results-color", property: "color", description: "Results-count colour.", consumers: at(FILTER_BAR, "var(--text-secondary, #6b7280)") }
|
|
1419
|
+
]
|
|
1420
|
+
};
|
|
1421
|
+
var pageHeaderFamily = {
|
|
1422
|
+
family: "page-header",
|
|
1423
|
+
prefix: "page-header",
|
|
1424
|
+
description: "Page-header lockup. The retro found the page title rendered five ways across one app.",
|
|
1425
|
+
tokens: [
|
|
1426
|
+
{ key: "gap", property: "gap", description: "Header stack rhythm.", consumers: at(PAGE_HEADER, "var(--spacing-4, 1rem)") },
|
|
1427
|
+
{ key: "text-color", property: "color", description: "Header text colour.", consumers: at(PAGE_HEADER, "var(--text-primary, #111827)") },
|
|
1428
|
+
{ key: "leading-gap", property: "gap", description: "Gap between the leading media slot and the text stack.", consumers: at(PAGE_HEADER, "var(--spacing-3, 0.75rem)") },
|
|
1429
|
+
{ key: "eyebrow-font-size", property: "font-size", description: "Eyebrow type size.", consumers: at(PAGE_HEADER, "var(--font-size-xs, 0.75rem)") },
|
|
1430
|
+
{ key: "eyebrow-font-weight", property: "font-weight", description: "Eyebrow weight.", consumers: at(PAGE_HEADER, "var(--font-weight-semibold, 600)") },
|
|
1431
|
+
{ key: "eyebrow-letter-spacing", property: "letter-spacing", description: "Eyebrow tracking.", consumers: at(PAGE_HEADER, "var(--letter-spacing-wide, 0.05em)") },
|
|
1432
|
+
{ key: "eyebrow-text-transform", property: "text-transform", description: "Eyebrow casing.", consumers: at(PAGE_HEADER, "uppercase") },
|
|
1433
|
+
{ key: "eyebrow-color", property: "color", description: "Eyebrow colour.", consumers: at(PAGE_HEADER, "var(--text-tertiary, #6b7280)") },
|
|
1434
|
+
{
|
|
1435
|
+
key: "title-family",
|
|
1436
|
+
property: "font-family",
|
|
1437
|
+
description: 'Marquee title family (`titleFamily="display"`). Falls through to the admin-ui marquee role before the theme display font.',
|
|
1438
|
+
consumers: at(PAGE_HEADER, "var(--admin-ui-marquee-family, var(--font-display, var(--font-family-heading, inherit)))")
|
|
1439
|
+
},
|
|
1440
|
+
{ key: "title-size", property: "font-size", description: 'Marquee title size (`titleSize="marquee"`).', consumers: at(PAGE_HEADER, "3.5rem") },
|
|
1441
|
+
{ key: "title-leading", property: "line-height", description: "Title leading.", consumers: [{ file: PAGE_HEADER, fallback: "var(--line-height-tight, 1.2)" }, { file: PAGE_HEADER, fallback: "1" }] },
|
|
1442
|
+
{ key: "title-font-size", property: "font-size", description: "Standard title size.", consumers: at(PAGE_HEADER, "var(--font-size-2xl, 1.5rem)") },
|
|
1443
|
+
{ key: "title-font-weight", property: "font-weight", description: "Title weight.", consumers: at(PAGE_HEADER, "var(--font-weight-semibold, 600)") },
|
|
1444
|
+
{ key: "title-letter-spacing", property: "letter-spacing", description: "Title tracking.", consumers: at(PAGE_HEADER, "var(--letter-spacing-tight, -0.01em)") },
|
|
1445
|
+
{ key: "title-color", property: "color", description: "Title colour.", consumers: at(PAGE_HEADER, "var(--text-primary, #111827)") },
|
|
1446
|
+
{ key: "description-font-size", property: "font-size", description: "Description type size.", consumers: at(PAGE_HEADER, "var(--font-size-sm, 0.875rem)") },
|
|
1447
|
+
{ key: "description-color", property: "color", description: "Description colour.", consumers: at(PAGE_HEADER, "var(--text-secondary, #6b7280)") },
|
|
1448
|
+
{ key: "actions-gap", property: "gap", description: "Gap between header action buttons.", consumers: at(PAGE_HEADER, "var(--spacing-2, 0.5rem)") }
|
|
1449
|
+
]
|
|
1450
|
+
};
|
|
1451
|
+
var emptyStateFamily = {
|
|
1452
|
+
family: "empty-state",
|
|
1453
|
+
prefix: "empty-state",
|
|
1454
|
+
description: "Empty-state placard \u2014 surface, icon chip and copy scale.",
|
|
1455
|
+
tokens: [
|
|
1456
|
+
{ key: "radius", property: "border-radius", description: "Placard corner rounding.", consumers: at(EMPTY_STATE, "var(--radius-lg, 0.75rem)") },
|
|
1457
|
+
{ key: "text-color", property: "color", description: "Placard base text colour.", consumers: at(EMPTY_STATE, "var(--text-secondary, #6b7280)") },
|
|
1458
|
+
{ key: "gap", property: "gap", description: "Placard stack rhythm.", consumers: at(EMPTY_STATE, "var(--spacing-2, 0.5rem)") },
|
|
1459
|
+
{ key: "padding", property: "padding", description: "Default-size placard inset.", consumers: at(EMPTY_STATE, "var(--spacing-8, 2rem) var(--spacing-5, 1.25rem)") },
|
|
1460
|
+
{ key: "bg", property: "background-color", description: "Default-tone fill.", consumers: at(EMPTY_STATE, "var(--surface-muted, #f9fafb)") },
|
|
1461
|
+
{ key: "border", property: "border", description: "Default-tone frame (dashed by default).", consumers: at(EMPTY_STATE, "1px dashed var(--border-default, #e5e7eb)") },
|
|
1462
|
+
{ key: "icon-size", property: "width / height", description: "Icon-chip diameter.", consumers: at(EMPTY_STATE, "72px") },
|
|
1463
|
+
{ key: "icon-radius", property: "border-radius", description: "Icon-chip rounding.", consumers: at(EMPTY_STATE, "var(--radius-full, 9999px)") },
|
|
1464
|
+
{ key: "icon-bg", property: "background-color", description: "Icon-chip fill.", consumers: at(EMPTY_STATE, "var(--surface-subtle, #f5f5f6)") },
|
|
1465
|
+
{ key: "icon-color", property: "color", description: "Icon-chip glyph colour.", consumers: at(EMPTY_STATE, "var(--text-tertiary, #6b7280)") },
|
|
1466
|
+
{ key: "heading-font-family", property: "font-family", description: "Heading family.", consumers: at(EMPTY_STATE, "var(--font-family-heading, inherit)") },
|
|
1467
|
+
{ key: "heading-font-size", property: "font-size", description: "Default-size heading type size.", consumers: at(EMPTY_STATE, "var(--font-size-base, 1rem)") },
|
|
1468
|
+
{ key: "heading-font-weight", property: "font-weight", description: "Heading weight.", consumers: at(EMPTY_STATE, "var(--font-weight-semibold, 600)") },
|
|
1469
|
+
{ key: "heading-color", property: "color", description: "Heading colour.", consumers: at(EMPTY_STATE, "var(--text-primary, #111827)") },
|
|
1470
|
+
{ key: "description-font-size", property: "font-size", description: "Description type size.", consumers: at(EMPTY_STATE, "var(--font-size-sm, 0.875rem)") },
|
|
1471
|
+
{ key: "description-color", property: "color", description: "Description colour.", consumers: at(EMPTY_STATE, "var(--text-secondary, #6b7280)") },
|
|
1472
|
+
{ key: "actions-gap", property: "gap", description: "Gap between placard actions.", consumers: at(EMPTY_STATE, "var(--spacing-2, 0.5rem)") }
|
|
1473
|
+
]
|
|
1474
|
+
};
|
|
1475
|
+
var bannerFamily = {
|
|
1476
|
+
family: "banner",
|
|
1477
|
+
prefix: "banner",
|
|
1478
|
+
description: "Full-width notice bar. The retro found six separate banner systems across ~180 instances in one app; binding this family collapses them to one.",
|
|
1479
|
+
tokens: [
|
|
1480
|
+
{ key: "padding", property: "padding", description: "Banner inset.", consumers: at(BANNER, "var(--spacing-3, 0.75rem) var(--spacing-4, 1rem)") },
|
|
1481
|
+
{ key: "gap", property: "gap", description: "Gap between icon, content and actions.", consumers: at(BANNER, "var(--spacing-3, 0.75rem)") },
|
|
1482
|
+
{ key: "font-size", property: "font-size", description: "Banner base type size.", consumers: at(BANNER, "var(--font-size-sm, 0.875rem)") },
|
|
1483
|
+
{ key: "radius", property: "border-radius", description: "Banner corner rounding \u2014 `0` keeps the full-bleed bar.", consumers: at(BANNER, "0") },
|
|
1484
|
+
{ key: "border-width", property: "border-bottom-width", description: "Banner rule weight.", consumers: at(BANNER, "1px") },
|
|
1485
|
+
{ key: "shadow", property: "box-shadow", description: "Banner elevation.", consumers: at(BANNER, "var(--shadow-sm)") },
|
|
1486
|
+
{ key: "title-font-weight", property: "font-weight", description: "Banner title weight.", consumers: at(BANNER, "var(--font-weight-semibold, 600)") },
|
|
1487
|
+
{ key: "description-font-size", property: "font-size", description: "Banner description type size.", consumers: at(BANNER, "var(--font-size-sm, 0.875rem)") },
|
|
1488
|
+
{ key: "info-bg", property: "background-color", description: "Info-intent fill.", consumers: at(BANNER, "var(--surface-info-subtle, transparent)") },
|
|
1489
|
+
{ key: "info-text-color", property: "color", description: "Info-intent text colour.", consumers: at(BANNER, "var(--text-info, currentColor)") },
|
|
1490
|
+
{ key: "info-border-color", property: "border-color", description: "Info-intent rule colour.", consumers: at(BANNER, "var(--border-info, currentColor)") },
|
|
1491
|
+
{ key: "warning-bg", property: "background-color", description: "Warning-intent fill.", consumers: at(BANNER, "var(--surface-warning-subtle, transparent)") },
|
|
1492
|
+
{ key: "warning-text-color", property: "color", description: "Warning-intent text colour.", consumers: at(BANNER, "var(--text-warning, currentColor)") },
|
|
1493
|
+
{ key: "warning-border-color", property: "border-color", description: "Warning-intent rule colour.", consumers: at(BANNER, "var(--border-warning, currentColor)") },
|
|
1494
|
+
{ key: "error-bg", property: "background-color", description: "Error-intent fill.", consumers: at(BANNER, "var(--surface-error-subtle, transparent)") },
|
|
1495
|
+
{ key: "error-text-color", property: "color", description: "Error-intent text colour.", consumers: at(BANNER, "var(--text-error, currentColor)") },
|
|
1496
|
+
{ key: "error-border-color", property: "border-color", description: "Error-intent rule colour.", consumers: at(BANNER, "var(--border-error, currentColor)") },
|
|
1497
|
+
{ key: "success-bg", property: "background-color", description: "Success-intent fill.", consumers: at(BANNER, "var(--surface-success-subtle, transparent)") },
|
|
1498
|
+
{ key: "success-text-color", property: "color", description: "Success-intent text colour.", consumers: at(BANNER, "var(--text-success, currentColor)") },
|
|
1499
|
+
{ key: "success-border-color", property: "border-color", description: "Success-intent rule colour.", consumers: at(BANNER, "var(--border-success, currentColor)") }
|
|
1500
|
+
]
|
|
1501
|
+
};
|
|
1502
|
+
var sidebarFamily = {
|
|
1503
|
+
family: "sidebar",
|
|
1504
|
+
prefix: "sidebar",
|
|
1505
|
+
description: "Sidebar chrome and nav-item treatment. The palette roles (`bg`, `text`, `border`, `accent-*`) already ship defaults from visor-core's `visor-semantic` layer and are read bare; the structural roles below are new in VI-625.",
|
|
1506
|
+
tokens: [
|
|
1507
|
+
{ key: "bg", property: "background-color", description: "Sidebar rail fill. Defaulted by visor-core.", consumers: at(SIDEBAR, null) },
|
|
1508
|
+
{ key: "text", property: "color", description: "Sidebar text colour. Defaulted by visor-core.", consumers: at(SIDEBAR, null) },
|
|
1509
|
+
{ key: "text-muted", property: "color", description: "Sidebar group-label colour. Defaulted by visor-core.", consumers: at(SIDEBAR, null) },
|
|
1510
|
+
{ key: "border", property: "background-color / box-shadow", description: "Sidebar separator + rail colour. Defaulted by visor-core.", consumers: at(SIDEBAR, null) },
|
|
1511
|
+
{ key: "accent-bg", property: "background-color", description: "Active / hover nav-item fill. Defaulted by visor-core.", consumers: at(SIDEBAR, null) },
|
|
1512
|
+
{ key: "accent-text", property: "color", description: "Active / hover nav-item text. Defaulted by visor-core.", consumers: at(SIDEBAR, null) },
|
|
1513
|
+
{ key: "header-padding", property: "padding", description: "Sidebar header inset.", consumers: at(SIDEBAR, "var(--spacing-2, 0.5rem)") },
|
|
1514
|
+
{ key: "footer-padding", property: "padding", description: "Sidebar footer inset.", consumers: at(SIDEBAR, "var(--spacing-2, 0.5rem)") },
|
|
1515
|
+
{ key: "content-padding", property: "padding", description: "Scrollable nav-area inset.", consumers: at(SIDEBAR, "var(--spacing-1, 0.25rem)") },
|
|
1516
|
+
{ key: "menu-gap", property: "gap", description: "Gap between nav items.", consumers: at(SIDEBAR, "var(--spacing-1, 0.25rem)") },
|
|
1517
|
+
{ key: "group-label-height", property: "height", description: "Nav group-label height.", consumers: at(SIDEBAR, "2rem") },
|
|
1518
|
+
{ key: "group-label-font-size", property: "font-size", description: "Nav group-label type size.", consumers: at(SIDEBAR, "var(--font-size-xs, 0.75rem)") },
|
|
1519
|
+
{ key: "group-label-font-weight", property: "font-weight", description: "Nav group-label weight.", consumers: at(SIDEBAR, "var(--font-weight-medium, 500)") },
|
|
1520
|
+
{ key: "group-label-letter-spacing", property: "letter-spacing", description: "Nav group-label tracking.", consumers: at(SIDEBAR, "inherit") },
|
|
1521
|
+
{ key: "group-label-text-transform", property: "text-transform", description: "Nav group-label casing.", consumers: at(SIDEBAR, "inherit") },
|
|
1522
|
+
{ key: "item-radius", property: "border-radius", description: "Nav-item corner rounding.", consumers: at(SIDEBAR, "var(--radius-md, 0.375rem)") },
|
|
1523
|
+
{ key: "item-gap", property: "gap", description: "Nav-item icon gap.", consumers: at(SIDEBAR, "var(--spacing-2, 0.5rem)") },
|
|
1524
|
+
{ key: "item-font-size", property: "font-size", description: "Nav-item type size.", consumers: at(SIDEBAR, "var(--font-size-sm, 0.875rem)") },
|
|
1525
|
+
{ key: "item-font-weight", property: "font-weight", description: "Nav-item resting weight.", consumers: at(SIDEBAR, "inherit") },
|
|
1526
|
+
{ key: "item-letter-spacing", property: "letter-spacing", description: "Nav-item tracking.", consumers: at(SIDEBAR, "inherit") },
|
|
1527
|
+
{ key: "item-text-transform", property: "text-transform", description: "Nav-item casing.", consumers: at(SIDEBAR, "inherit") },
|
|
1528
|
+
{ key: "item-height", property: "height", description: "Default nav-item height.", consumers: at(SIDEBAR, "2.25rem") },
|
|
1529
|
+
{ key: "item-padding", property: "padding", description: "Default nav-item inset.", consumers: at(SIDEBAR, "0 var(--spacing-3, 0.75rem)") },
|
|
1530
|
+
{ key: "item-active-font-weight", property: "font-weight", description: "Active nav-item weight.", consumers: at(SIDEBAR, "var(--font-weight-medium, 500)") }
|
|
1531
|
+
]
|
|
1532
|
+
};
|
|
1533
|
+
var tabsFamily = {
|
|
1534
|
+
family: "tabs",
|
|
1535
|
+
prefix: "tabs",
|
|
1536
|
+
description: "Tab rail and trigger treatment, for both the segmented (`default`) and underlined (`line`) variants.",
|
|
1537
|
+
tokens: [
|
|
1538
|
+
{ key: "list-radius", property: "border-radius", description: "Tab-rail corner rounding.", consumers: at(TABS, "var(--radius-full, 9999px)") },
|
|
1539
|
+
{ key: "list-height", property: "height", description: "Tab-rail height.", consumers: at(TABS, "2.25rem") },
|
|
1540
|
+
{ key: "list-padding", property: "padding", description: "Tab-rail inset.", consumers: at(TABS, "calc(var(--spacing-1, 0.25rem) * 0.75)") },
|
|
1541
|
+
{ key: "list-color", property: "color", description: "Tab-rail base text colour.", consumers: at(TABS, "var(--text-secondary, #6b7280)") },
|
|
1542
|
+
{ key: "list-bg", property: "background-color", description: "Segmented-variant rail fill.", consumers: at(TABS, "var(--surface-muted, #f3f4f6)") },
|
|
1543
|
+
{ key: "line-border-bottom", property: "border-bottom", description: "Underlined-variant rail rule.", consumers: at(TABS, "1px solid var(--hairline, var(--border-default, #e5e7eb))") },
|
|
1544
|
+
{ key: "trigger-radius", property: "border-radius", description: "Trigger corner rounding.", consumers: at(TABS, "var(--radius-md, 0.375rem)") },
|
|
1545
|
+
{ key: "trigger-padding", property: "padding", description: "Trigger inset.", consumers: at(TABS, "var(--spacing-1, 0.25rem) var(--spacing-2, 0.5rem)") },
|
|
1546
|
+
{ key: "trigger-font-size", property: "font-size", description: "Trigger type size.", consumers: at(TABS, "var(--font-size-sm, 0.875rem)") },
|
|
1547
|
+
{ key: "trigger-font-weight", property: "font-weight", description: "Trigger weight.", consumers: at(TABS, "var(--font-weight-medium, 500)") },
|
|
1548
|
+
{ key: "trigger-letter-spacing", property: "letter-spacing", description: "Trigger tracking.", consumers: at(TABS, "inherit") },
|
|
1549
|
+
{ key: "trigger-text-transform", property: "text-transform", description: "Trigger casing.", consumers: at(TABS, "inherit") },
|
|
1550
|
+
{ key: "trigger-color", property: "color", description: "Resting trigger colour.", consumers: at(TABS, "var(--text-secondary, #6b7280)") },
|
|
1551
|
+
{ key: "trigger-active-bg", property: "background-color", description: "Active trigger fill.", consumers: at(TABS, "var(--surface-page, #ffffff)") },
|
|
1552
|
+
{ key: "trigger-active-color", property: "color", description: "Active trigger colour.", consumers: at(TABS, "var(--text-primary, #111827)") },
|
|
1553
|
+
{ key: "trigger-active-shadow", property: "box-shadow", description: "Active trigger elevation.", consumers: at(TABS, "var(--shadow-sm)") },
|
|
1554
|
+
{ key: "indicator-height", property: "height", description: "Underline indicator thickness.", consumers: at(TABS, "2px") },
|
|
1555
|
+
{ key: "indicator-color", property: "background-color", description: "Underline indicator colour.", consumers: at(TABS, "var(--text-primary, #111827)") }
|
|
1556
|
+
]
|
|
1557
|
+
};
|
|
1558
|
+
var skeletonFamily = {
|
|
1559
|
+
family: "skeleton",
|
|
1560
|
+
prefix: "skeleton",
|
|
1561
|
+
description: "Loading-placeholder shimmer and the content-shape geometry the admin list/table/detail skeletons use.",
|
|
1562
|
+
tokens: [
|
|
1563
|
+
{ key: "from", property: "background (gradient stop)", description: "Shimmer gradient start.", consumers: at(SKELETON, "#f3f4f6") },
|
|
1564
|
+
{ key: "to", property: "background (gradient stop)", description: "Shimmer gradient peak.", consumers: at(SKELETON, "#e5e7eb") },
|
|
1565
|
+
{ key: "radius", property: "border-radius", description: "Default placeholder rounding.", consumers: at(SKELETON, "var(--radius-md, 0.375rem)") },
|
|
1566
|
+
{ key: "duration", property: "animation-duration", description: "Shimmer cycle length.", consumers: at(SKELETON, "1.5s") },
|
|
1567
|
+
{ key: "logo-width", property: "width", description: "Logo-plate placeholder width.", consumers: at(SKELETON, "104px") },
|
|
1568
|
+
{ key: "logo-height", property: "height", description: "Logo-plate placeholder height.", consumers: at(SKELETON, "24px") },
|
|
1569
|
+
{ key: "pill-width", property: "width", description: "Badge-pill placeholder width.", consumers: at(SKELETON, "64px") },
|
|
1570
|
+
{ key: "pill-height", property: "height", description: "Badge-pill placeholder height.", consumers: at(SKELETON, "18px") },
|
|
1571
|
+
{ key: "line-h1-height", property: "height", description: "Display-line placeholder height.", consumers: at(SKELETON, "24px") },
|
|
1572
|
+
{ key: "line-heading-height", property: "height", description: "Heading-line placeholder height.", consumers: at(SKELETON, "18px") },
|
|
1573
|
+
{ key: "line-body-height", property: "height", description: "Body-line placeholder height.", consumers: at(SKELETON, "14px") },
|
|
1574
|
+
{ key: "avatar-size", property: "width / height", description: "Avatar placeholder diameter.", consumers: at(SKELETON, "40px") },
|
|
1575
|
+
{ key: "avatar-lg-size", property: "width / height", description: "Large avatar placeholder diameter.", consumers: at(SKELETON, "64px") },
|
|
1576
|
+
{ key: "badge-width", property: "width", description: "Row-badge placeholder width.", consumers: at(SKELETON, "72px") },
|
|
1577
|
+
{ key: "badge-height", property: "height", description: "Row-badge placeholder height.", consumers: at(SKELETON, "22px") },
|
|
1578
|
+
{ key: "row-gap", property: "gap", description: "Skeleton row gap.", consumers: at(SKELETON, "var(--spacing-3, 0.75rem)") },
|
|
1579
|
+
{ key: "row-padding", property: "padding", description: "Skeleton row inset.", consumers: at(SKELETON, "var(--spacing-3, 0.75rem) 0") },
|
|
1580
|
+
{ key: "row-border-bottom", property: "border-bottom", description: "Skeleton row separator.", consumers: at(SKELETON, "1px solid var(--border-default, #e5e7eb)") }
|
|
1581
|
+
]
|
|
1582
|
+
};
|
|
1583
|
+
var spinnerFamily = {
|
|
1584
|
+
family: "spinner",
|
|
1585
|
+
prefix: "spinner",
|
|
1586
|
+
description: "Inline loading ring \u2014 track, leading edge, per-size geometry and cycle length.",
|
|
1587
|
+
tokens: [
|
|
1588
|
+
{ key: "track-color", property: "border-color", description: "Ring track colour.", consumers: at(SPINNER, "var(--border-default, #e5e7eb)") },
|
|
1589
|
+
{ key: "edge-color", property: "border-top-color", description: "Leading-edge colour (default tone).", consumers: at(SPINNER, "var(--text-tertiary, #6b7280)") },
|
|
1590
|
+
{ key: "primary-edge-color", property: "border-top-color", description: "Leading-edge colour (primary tone).", consumers: at(SPINNER, "var(--primary, #111827)") },
|
|
1591
|
+
{ key: "radius", property: "border-radius", description: "Ring rounding.", consumers: at(SPINNER, "var(--radius-full, 9999px)") },
|
|
1592
|
+
{ key: "duration", property: "animation-duration", description: "Rotation cycle length.", consumers: at(SPINNER, "var(--motion-duration-1500, 1500ms)") },
|
|
1593
|
+
{ key: "xs-size", property: "width / height", description: "Extra-small ring diameter.", consumers: at(SPINNER, "12px") },
|
|
1594
|
+
{ key: "xs-border-width", property: "border-width", description: "Extra-small ring stroke.", consumers: at(SPINNER, "var(--stroke-width-thin, 1px)") },
|
|
1595
|
+
{ key: "sm-size", property: "width / height", description: "Small ring diameter.", consumers: at(SPINNER, "16px") },
|
|
1596
|
+
{ key: "sm-border-width", property: "border-width", description: "Small ring stroke.", consumers: at(SPINNER, "var(--stroke-width-regular, 1.5px)") },
|
|
1597
|
+
{ key: "md-size", property: "width / height", description: "Default ring diameter.", consumers: at(SPINNER, "24px") },
|
|
1598
|
+
{ key: "md-border-width", property: "border-width", description: "Default ring stroke.", consumers: at(SPINNER, "var(--stroke-width-medium, 2px)") }
|
|
1599
|
+
]
|
|
1600
|
+
};
|
|
1601
|
+
var checkboxFamily = {
|
|
1602
|
+
family: "checkbox",
|
|
1603
|
+
prefix: "checkbox",
|
|
1604
|
+
description: "Control sizing \u2014 the D3 Tier-2 `--checkbox-size` / `-radius` / `-bg` / `-border` set, promoted from the admin-ui audit to a bindable contract.",
|
|
1605
|
+
tokens: [
|
|
1606
|
+
{ key: "size", property: "width / height", description: "Checkbox box size.", consumers: at(CHECKBOX, "1rem") },
|
|
1607
|
+
{ key: "radius", property: "border-radius", description: "Checkbox corner rounding \u2014 square it for the editorial admin look.", consumers: at(CHECKBOX, "var(--radius-sm, 0.25rem)") },
|
|
1608
|
+
{ key: "bg", property: "background-color", description: "Unchecked fill.", consumers: at(CHECKBOX, "transparent") },
|
|
1609
|
+
{ key: "border", property: "border", description: "Unchecked outline.", consumers: at(CHECKBOX, "1px solid var(--border-default, #e5e7eb)") },
|
|
1610
|
+
{ key: "bg-checked", property: "background-color", description: "Checked fill.", consumers: at(CHECKBOX, "var(--interactive-primary-bg, var(--primary, #111827))") },
|
|
1611
|
+
{ key: "border-checked", property: "border-color", description: "Checked outline colour.", consumers: at(CHECKBOX, "var(--interactive-primary-bg, var(--primary, #111827))") }
|
|
1612
|
+
]
|
|
1613
|
+
};
|
|
1614
|
+
var adminUiFamily = {
|
|
1615
|
+
family: "admin-ui",
|
|
1616
|
+
prefix: "admin-ui",
|
|
1617
|
+
description: "Structural roles the admin-ui pattern owns. `marquee-family` is the display face for KPI hero figures and marquee page titles \u2014 the role the admin-ui portability audit named as the one piece of ENTR brand coupling a new theme must rebind.",
|
|
1618
|
+
tokens: [
|
|
1619
|
+
{
|
|
1620
|
+
key: "marquee-family",
|
|
1621
|
+
property: "font-family",
|
|
1622
|
+
description: "Marquee / hero-figure display family.",
|
|
1623
|
+
consumers: at(PAGE_HEADER, "var(--font-display, var(--font-family-heading, inherit))")
|
|
1624
|
+
}
|
|
1625
|
+
]
|
|
1626
|
+
};
|
|
1627
|
+
var COMPONENT_TOKEN_FAMILIES = [
|
|
1628
|
+
tableFamily,
|
|
1629
|
+
dataTableFamily,
|
|
1630
|
+
chipFamily,
|
|
1631
|
+
badgeFamily,
|
|
1632
|
+
statusBadgeFamily,
|
|
1633
|
+
filterBarFamily,
|
|
1634
|
+
pageHeaderFamily,
|
|
1635
|
+
emptyStateFamily,
|
|
1636
|
+
bannerFamily,
|
|
1637
|
+
sidebarFamily,
|
|
1638
|
+
tabsFamily,
|
|
1639
|
+
skeletonFamily,
|
|
1640
|
+
spinnerFamily,
|
|
1641
|
+
checkboxFamily,
|
|
1642
|
+
adminUiFamily
|
|
1643
|
+
];
|
|
1644
|
+
var COMPONENT_TOKEN_FAMILY_BY_NAME = new Map(
|
|
1645
|
+
COMPONENT_TOKEN_FAMILIES.map((f) => [f.family, f])
|
|
1646
|
+
);
|
|
1647
|
+
function allComponentTokenNames() {
|
|
1648
|
+
const names = [];
|
|
1649
|
+
for (const family of COMPONENT_TOKEN_FAMILIES) {
|
|
1650
|
+
for (const token of family.tokens) {
|
|
1651
|
+
names.push(componentTokenName(family, token.key));
|
|
1652
|
+
}
|
|
1653
|
+
}
|
|
1654
|
+
return names;
|
|
1655
|
+
}
|
|
1656
|
+
function resolveComponentBindings(bindings) {
|
|
1657
|
+
const resolved = { light: {}, dark: {} };
|
|
1658
|
+
if (!bindings) return resolved;
|
|
1659
|
+
for (const [familyName, familyBindings] of Object.entries(bindings)) {
|
|
1660
|
+
const family = COMPONENT_TOKEN_FAMILY_BY_NAME.get(familyName);
|
|
1661
|
+
if (!family || !familyBindings || typeof familyBindings !== "object") continue;
|
|
1662
|
+
const knownKeys = new Set(family.tokens.map((t) => t.key));
|
|
1663
|
+
for (const [key, value] of Object.entries(familyBindings)) {
|
|
1664
|
+
if (!knownKeys.has(key)) continue;
|
|
1665
|
+
const name = componentTokenName(family, key);
|
|
1666
|
+
if (typeof value === "string") {
|
|
1667
|
+
resolved.light[name] = value;
|
|
1668
|
+
resolved.dark[name] = value;
|
|
1669
|
+
} else if (value && typeof value === "object") {
|
|
1670
|
+
if (typeof value.light === "string") resolved.light[name] = value.light;
|
|
1671
|
+
if (typeof value.dark === "string") resolved.dark[name] = value.dark;
|
|
1672
|
+
}
|
|
1673
|
+
}
|
|
1674
|
+
}
|
|
1675
|
+
return resolved;
|
|
1676
|
+
}
|
|
1677
|
+
function hasComponentBindings(bindings) {
|
|
1678
|
+
const resolved = resolveComponentBindings(bindings);
|
|
1679
|
+
return Object.keys(resolved.light).length > 0 || Object.keys(resolved.dark).length > 0;
|
|
1680
|
+
}
|
|
1681
|
+
function validateComponentBindings(bindings) {
|
|
1682
|
+
const errors = [];
|
|
1683
|
+
if (bindings === void 0) return errors;
|
|
1684
|
+
if (typeof bindings !== "object" || bindings === null || Array.isArray(bindings)) {
|
|
1685
|
+
errors.push("'components' must be an object");
|
|
1686
|
+
return errors;
|
|
1687
|
+
}
|
|
1688
|
+
const knownFamilies = COMPONENT_TOKEN_FAMILIES.map((f) => f.family).join(", ");
|
|
1689
|
+
for (const [familyName, familyBindings] of Object.entries(bindings)) {
|
|
1690
|
+
const family = COMPONENT_TOKEN_FAMILY_BY_NAME.get(familyName);
|
|
1691
|
+
if (!family) {
|
|
1692
|
+
errors.push(`Unknown key 'components.${familyName}'. Valid keys: ${knownFamilies}`);
|
|
1693
|
+
continue;
|
|
1694
|
+
}
|
|
1695
|
+
if (typeof familyBindings !== "object" || familyBindings === null || Array.isArray(familyBindings)) {
|
|
1696
|
+
errors.push(`'components.${familyName}' must be an object`);
|
|
1697
|
+
continue;
|
|
1698
|
+
}
|
|
1699
|
+
const knownKeys = family.tokens.map((t) => t.key);
|
|
1700
|
+
for (const [key, value] of Object.entries(familyBindings)) {
|
|
1701
|
+
if (!knownKeys.includes(key)) {
|
|
1702
|
+
errors.push(
|
|
1703
|
+
`Unknown key 'components.${familyName}.${key}'. Valid keys: ${knownKeys.join(", ")}`
|
|
1704
|
+
);
|
|
1705
|
+
continue;
|
|
1706
|
+
}
|
|
1707
|
+
if (typeof value === "string") continue;
|
|
1708
|
+
if (typeof value === "object" && value !== null && !Array.isArray(value)) {
|
|
1709
|
+
for (const [mode, modeValue] of Object.entries(value)) {
|
|
1710
|
+
if (mode !== "light" && mode !== "dark") {
|
|
1711
|
+
errors.push(
|
|
1712
|
+
`Unknown key 'components.${familyName}.${key}.${mode}'. Valid keys: light, dark`
|
|
1713
|
+
);
|
|
1714
|
+
} else if (typeof modeValue !== "string") {
|
|
1715
|
+
errors.push(`'components.${familyName}.${key}.${mode}' must be a string`);
|
|
1716
|
+
}
|
|
1717
|
+
}
|
|
1718
|
+
continue;
|
|
1719
|
+
}
|
|
1720
|
+
errors.push(
|
|
1721
|
+
`'components.${familyName}.${key}' must be a string or an object with 'light' / 'dark' keys`
|
|
1722
|
+
);
|
|
1723
|
+
}
|
|
1724
|
+
}
|
|
1725
|
+
return errors;
|
|
1726
|
+
}
|
|
1727
|
+
|
|
1245
1728
|
// src/shades.ts
|
|
1246
1729
|
var FULL_SHADE_STEPS = [
|
|
1247
1730
|
50,
|
|
@@ -1967,6 +2450,13 @@ export {
|
|
|
1967
2450
|
compositeOverBackground,
|
|
1968
2451
|
serializeColor,
|
|
1969
2452
|
MATERIAL_TEXT_SLOTS,
|
|
2453
|
+
componentTokenName,
|
|
2454
|
+
COMPONENT_TOKEN_FAMILIES,
|
|
2455
|
+
COMPONENT_TOKEN_FAMILY_BY_NAME,
|
|
2456
|
+
allComponentTokenNames,
|
|
2457
|
+
resolveComponentBindings,
|
|
2458
|
+
hasComponentBindings,
|
|
2459
|
+
validateComponentBindings,
|
|
1970
2460
|
FULL_SHADE_STEPS,
|
|
1971
2461
|
SELECTIVE_SHADE_STEPS,
|
|
1972
2462
|
TAILWIND_GRAY,
|