rift-ds 1.40.0 → 1.41.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/README.md +6 -2
- package/behaviors/shell.css +9 -11
- package/bin/templates/blocks/components/blocks/AppShell.tsx +2 -1
- package/chat/ChatLauncher.d.ts +2 -2
- package/chat/ChatWidget.css +7 -7
- package/chat/ChatWidget.d.ts +1 -1
- package/components/AppLayout/AppLayout.css +1 -1
- package/components/AppLayout/AppLayout.d.ts +2 -2
- package/components/AppSidebar/AppSidebar.css +12 -15
- package/components/AppSidebar/AppSidebar.d.ts +4 -4
- package/components/AppSidebar/AppSidebar.js +9 -5
- package/components/Avatar/Avatar.css +18 -5
- package/components/Avatar/Avatar.d.ts +2 -0
- package/components/Avatar/Avatar.js +2 -1
- package/components/AvatarGroup/AvatarGroup.css +8 -1
- package/components/AvatarGroup/AvatarGroup.d.ts +6 -0
- package/components/AvatarGroup/AvatarGroup.js +2 -2
- package/components/DataTable/DataTable.css +63 -0
- package/components/DataTable/DataTable.d.ts +26 -2
- package/components/DataTable/DataTable.js +116 -90
- package/components/DrillMenu/DrillMenu.d.ts +2 -1
- package/components/DrillMenu/DrillMenu.js +14 -3
- package/components/EntitySwitcher/EntitySwitcher.css +2 -1
- package/components/Icon/Icon.css +6 -1
- package/components/Icon/Icon.d.ts +3 -1
- package/components/Icon/Icon.js +2 -0
- package/components/PixelAvatar/PixelAvatar.css +7 -1
- package/components/PixelAvatar/PixelAvatar.d.ts +2 -0
- package/components/PixelAvatar/PixelAvatar.js +2 -1
- package/components/ShaderField/useShaderField.js +2 -2
- package/components/ShaderScene/ShaderScene.js +2 -2
- package/components/SiteHeader/SiteHeader.css +0 -9
- package/components/SourceChip/SourceChip.css +2 -1
- package/components/SubNavPanel/SubNavPanel.css +10 -9
- package/components/Table/Table.css +310 -0
- package/components/Table/Table.d.ts +28 -2
- package/components/Table/Table.js +26 -9
- package/components/registry.json +1 -1
- package/components/registry.json.d.ts +1 -1
- package/components/registry.json.js +1 -1
- package/package.json +3 -2
- package/tokens/motion.d.ts +2 -0
- package/tokens/motion.js +2 -0
- package/tokens/presets/contrast.css +34 -1
- package/tokens/presets/coral.css +38 -1
- package/tokens/presets/forest.css +41 -1
- package/tokens/presets/gold.css +35 -1
- package/tokens/presets/marquee.css +40 -1
- package/tokens/presets/mono.css +79 -1
- package/tokens/presets/pink.css +38 -1
- package/tokens/presets/plum.css +41 -1
- package/tokens/presets/terminal.css +36 -1
- package/tokens/presets/violet.css +41 -1
- package/tokens/presets/warm.css +33 -1
- package/tokens/presets/zest.css +45 -1
- package/tokens/registry.json +1 -0
- package/tokens/registry.json.d.ts +1 -0
- package/tokens/registry.json.js +1 -1
- package/tokens/tokens-dark.css +1 -0
- package/tokens/tokens-light.css +5 -0
- package/tokens/values.json.js +1 -1
|
@@ -266,6 +266,9 @@ function DataTable({
|
|
|
266
266
|
onRowOrderChange,
|
|
267
267
|
columnLabels,
|
|
268
268
|
columnDividers = false,
|
|
269
|
+
frameless: framelessProp = false,
|
|
270
|
+
roundMarks = false,
|
|
271
|
+
outerControl = false,
|
|
269
272
|
cellText = "wrap",
|
|
270
273
|
rowActions,
|
|
271
274
|
rowActionsVisibility = "hover",
|
|
@@ -719,6 +722,9 @@ function DataTable({
|
|
|
719
722
|
setMeasured(next);
|
|
720
723
|
}, [needsMeasure, measured, tableEl, byKey, cellText]);
|
|
721
724
|
const layoutReady = fixedLayout && !needsMeasure;
|
|
725
|
+
const frameless = framelessProp && !narrow;
|
|
726
|
+
const outer = frameless && outerControl && utilityKeys.length > 0;
|
|
727
|
+
const withFiller = layoutReady || outer;
|
|
722
728
|
const minWidthOf = (col) => {
|
|
723
729
|
if (col.minWidth !== void 0) return col.minWidth;
|
|
724
730
|
const header2 = 2 * CELL_PADDING[size] + LABEL_MIN_WIDTH + (col.sortable ? SORT_GLYPH_WIDTH + (multiSort ? SORT_RANK_WIDTH : 0) : 0) + (columnMenu ? MENU_BUTTON_WIDTH : 0) + // A filterable column keeps room for its filter mark, so a filter never squeezes the label.
|
|
@@ -1912,7 +1918,7 @@ function DataTable({
|
|
|
1912
1918
|
key
|
|
1913
1919
|
);
|
|
1914
1920
|
}),
|
|
1915
|
-
|
|
1921
|
+
withFiller && /* @__PURE__ */ jsx("td", { className: `ds-table__cell ${baseClass}__filler`, role: "presentation", "aria-hidden": "true" }),
|
|
1916
1922
|
showActions && /* @__PURE__ */ jsx(
|
|
1917
1923
|
"td",
|
|
1918
1924
|
{
|
|
@@ -1969,7 +1975,7 @@ function DataTable({
|
|
|
1969
1975
|
key
|
|
1970
1976
|
);
|
|
1971
1977
|
}),
|
|
1972
|
-
|
|
1978
|
+
withFiller && /* @__PURE__ */ jsx("td", { className: `ds-table__cell ${baseClass}__filler`, role: "presentation", "aria-hidden": "true" }),
|
|
1973
1979
|
showActions && /* @__PURE__ */ jsx(
|
|
1974
1980
|
"td",
|
|
1975
1981
|
{
|
|
@@ -2213,7 +2219,7 @@ function DataTable({
|
|
|
2213
2219
|
key
|
|
2214
2220
|
);
|
|
2215
2221
|
}),
|
|
2216
|
-
|
|
2222
|
+
withFiller && /* @__PURE__ */ jsx("td", { className: `ds-table__cell ${baseClass}__filler`, role: "presentation", "aria-hidden": "true" }),
|
|
2217
2223
|
showActions && /* @__PURE__ */ jsx(
|
|
2218
2224
|
"td",
|
|
2219
2225
|
{
|
|
@@ -2351,17 +2357,23 @@ function DataTable({
|
|
|
2351
2357
|
const skeletonRows = Array.from({ length: pageSize ?? 5 }, (_, index) => /* @__PURE__ */ jsxs("tr", { className: `ds-table__row ${baseClass}__skeleton-row`, "aria-hidden": "true", children: [
|
|
2352
2358
|
utilityKeys.map((key) => /* @__PURE__ */ jsx("td", { className: "ds-table__cell" }, key)),
|
|
2353
2359
|
visibleKeys.map((key) => /* @__PURE__ */ jsx("td", { className: "ds-table__cell", children: /* @__PURE__ */ jsx("div", { className: `${baseClass}__skeleton`, children: /* @__PURE__ */ jsx(Skeleton, { variant: "text" }) }) }, key)),
|
|
2354
|
-
|
|
2360
|
+
withFiller && /* @__PURE__ */ jsx("td", { className: `ds-table__cell ${baseClass}__filler` }),
|
|
2355
2361
|
showActions && /* @__PURE__ */ jsx("td", { className: "ds-table__cell" })
|
|
2356
2362
|
] }, index));
|
|
2357
2363
|
const hasChrome = searchable || Boolean(toolbar);
|
|
2358
|
-
const classes = [
|
|
2364
|
+
const classes = [
|
|
2365
|
+
baseClass,
|
|
2366
|
+
refreshing ? `${baseClass}--refreshing` : "",
|
|
2367
|
+
roundMarks ? `${baseClass}--round-marks` : "",
|
|
2368
|
+
className
|
|
2369
|
+
].filter(Boolean).join(" ");
|
|
2359
2370
|
const tableClasses = [
|
|
2360
2371
|
"ds-table",
|
|
2361
2372
|
`ds-table--${size}`,
|
|
2362
2373
|
striped ? "ds-table--striped" : "",
|
|
2363
|
-
"ds-table--bordered",
|
|
2364
|
-
|
|
2374
|
+
frameless ? "ds-table--frameless" : "ds-table--bordered",
|
|
2375
|
+
outer ? "ds-table--outer-control" : "",
|
|
2376
|
+
columnDividers && !frameless ? "ds-table--column-dividers" : "",
|
|
2365
2377
|
layoutReady ? `${baseClass}__grid--fixed` : "",
|
|
2366
2378
|
stickyHeader || virtual ? `${baseClass}__grid--sticky` : "",
|
|
2367
2379
|
stacked ? `${baseClass}__grid--stacked` : "",
|
|
@@ -2392,95 +2404,109 @@ function DataTable({
|
|
|
2392
2404
|
] }),
|
|
2393
2405
|
error && rows.length > 0 && /* @__PURE__ */ jsx(Banner, { variant: "error", title: loadWords.errorTitle, action: retryButton || void 0, className: `${baseClass}__banner`, children: error }),
|
|
2394
2406
|
firstLoad && /* @__PURE__ */ jsx("span", { className: "ds-visually-hidden", role: "status", children: loadWords.loading }),
|
|
2395
|
-
visibleRows.length > 0 || firstLoad ? /* @__PURE__ */ jsxs(
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
"aria-hidden": "true"
|
|
2422
|
-
}
|
|
2423
|
-
),
|
|
2424
|
-
showActions && /* @__PURE__ */ jsx(
|
|
2425
|
-
"th",
|
|
2426
|
-
{
|
|
2427
|
-
"data-col": "ds-data-table-actions",
|
|
2428
|
-
scope: "col",
|
|
2429
|
-
className: `ds-table__header-cell ${baseClass}__actions ${baseClass}__cell--pinned ${baseClass}__cell--pinned-end${actionsEdge}`,
|
|
2430
|
-
style: { width: actionsWidth, insetInlineEnd: 0 },
|
|
2431
|
-
...tabProps("header", "ds-data-table-actions"),
|
|
2432
|
-
children: /* @__PURE__ */ jsx("span", { className: "ds-visually-hidden", children: labels.actionsColumn })
|
|
2433
|
-
}
|
|
2434
|
-
)
|
|
2435
|
-
] }) }),
|
|
2436
|
-
firstLoad ? /* @__PURE__ */ jsx("tbody", { className: "ds-table__body", children: skeletonRows }) : groups ? groups.map((group) => ({ group, onPage: group.rows.filter((row) => pageRowSet.has(row)) })).filter(({ onPage }) => onPage.length > 0).map(({ group, onPage }) => /* @__PURE__ */ jsxs(
|
|
2437
|
-
"tbody",
|
|
2438
|
-
{
|
|
2439
|
-
className: `ds-table__body ${baseClass}__group`,
|
|
2440
|
-
"data-collapsed": collapsedGroups.includes(group.key) || void 0,
|
|
2441
|
-
children: [
|
|
2442
|
-
groupRow(group),
|
|
2443
|
-
!collapsedGroups.includes(group.key) && onPage.map((row) => bodyRow(row))
|
|
2444
|
-
]
|
|
2407
|
+
visibleRows.length > 0 || firstLoad ? /* @__PURE__ */ jsxs(
|
|
2408
|
+
ScrollRegion,
|
|
2409
|
+
{
|
|
2410
|
+
className: [
|
|
2411
|
+
"ds-table__wrapper",
|
|
2412
|
+
`${baseClass}__frame`,
|
|
2413
|
+
frameless ? `${baseClass}__frame--frameless` : "",
|
|
2414
|
+
outer ? `${baseClass}__frame--outer-control` : ""
|
|
2415
|
+
].filter(Boolean).join(" "),
|
|
2416
|
+
style: frameStyle,
|
|
2417
|
+
onNode: setFrameEl,
|
|
2418
|
+
children: [
|
|
2419
|
+
(refreshing || searching) && /* @__PURE__ */ jsx("div", { className: `${baseClass}__progress`, role: "progressbar", "aria-label": loadWords.loading }),
|
|
2420
|
+
/* @__PURE__ */ jsxs(
|
|
2421
|
+
"table",
|
|
2422
|
+
{
|
|
2423
|
+
ref: setTableEl,
|
|
2424
|
+
"aria-busy": loading || commandLanding || searching || void 0,
|
|
2425
|
+
className: tableClasses,
|
|
2426
|
+
role: gridMode ? "grid" : stacked ? "table" : void 0,
|
|
2427
|
+
"aria-rowcount": virtual ? virtualItems.length + 1 : void 0,
|
|
2428
|
+
"aria-multiselectable": gridMode && selectable ? true : void 0,
|
|
2429
|
+
"data-selecting": selectable && currentSelection.length > 0 ? "" : void 0,
|
|
2430
|
+
style: {
|
|
2431
|
+
...layoutReady ? layoutVars(widthsState) : {},
|
|
2432
|
+
...showActions ? { "--ds-dt-actions": actionsCount } : {}
|
|
2445
2433
|
},
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2434
|
+
onKeyDown: onGridKeyDown,
|
|
2435
|
+
children: [
|
|
2436
|
+
caption && /* @__PURE__ */ jsx("caption", { className: "ds-table__caption ds-visually-hidden", children: caption }),
|
|
2437
|
+
/* @__PURE__ */ jsx("thead", { className: stacked ? "ds-table__head ds-visually-hidden" : "ds-table__head", children: /* @__PURE__ */ jsxs("tr", { className: "ds-table__row ds-table__row--header", children: [
|
|
2438
|
+
utilityKeys.map(utilityHeader),
|
|
2439
|
+
visibleKeys.map(header),
|
|
2440
|
+
withFiller && /* @__PURE__ */ jsx(
|
|
2441
|
+
"th",
|
|
2442
|
+
{
|
|
2443
|
+
className: `ds-table__header-cell ${baseClass}__filler`,
|
|
2444
|
+
role: "presentation",
|
|
2445
|
+
"aria-hidden": "true"
|
|
2446
|
+
}
|
|
2447
|
+
),
|
|
2448
|
+
showActions && /* @__PURE__ */ jsx(
|
|
2449
|
+
"th",
|
|
2450
|
+
{
|
|
2451
|
+
"data-col": "ds-data-table-actions",
|
|
2452
|
+
scope: "col",
|
|
2453
|
+
className: `ds-table__header-cell ${baseClass}__actions ${baseClass}__cell--pinned ${baseClass}__cell--pinned-end${actionsEdge}`,
|
|
2454
|
+
style: { width: actionsWidth, insetInlineEnd: 0 },
|
|
2455
|
+
...tabProps("header", "ds-data-table-actions"),
|
|
2456
|
+
children: /* @__PURE__ */ jsx("span", { className: "ds-visually-hidden", children: labels.actionsColumn })
|
|
2457
|
+
}
|
|
2458
|
+
)
|
|
2459
|
+
] }) }),
|
|
2460
|
+
firstLoad ? /* @__PURE__ */ jsx("tbody", { className: "ds-table__body", children: skeletonRows }) : groups ? groups.map((group) => ({ group, onPage: group.rows.filter((row) => pageRowSet.has(row)) })).filter(({ onPage }) => onPage.length > 0).map(({ group, onPage }) => /* @__PURE__ */ jsxs(
|
|
2461
|
+
"tbody",
|
|
2462
|
+
{
|
|
2463
|
+
className: `ds-table__body ${baseClass}__group`,
|
|
2464
|
+
"data-collapsed": collapsedGroups.includes(group.key) || void 0,
|
|
2465
|
+
children: [
|
|
2466
|
+
groupRow(group),
|
|
2467
|
+
!collapsedGroups.includes(group.key) && onPage.map((row) => bodyRow(row))
|
|
2468
|
+
]
|
|
2469
|
+
},
|
|
2470
|
+
group.key
|
|
2471
|
+
)) : virtual ? /* @__PURE__ */ jsxs("tbody", { className: "ds-table__body", children: [
|
|
2472
|
+
/* @__PURE__ */ jsx(
|
|
2473
|
+
VirtualRows,
|
|
2474
|
+
{
|
|
2475
|
+
count: virtualItems.length,
|
|
2476
|
+
itemKey: (index) => `${virtualItems[index]?.row.id}:${virtualItems[index]?.part}`,
|
|
2477
|
+
estimate: ESTIMATED_ROW_HEIGHT[size],
|
|
2478
|
+
overscan: VIRTUAL_OVERSCAN,
|
|
2479
|
+
frame: frameEl,
|
|
2480
|
+
frameHeight,
|
|
2481
|
+
columnCount,
|
|
2482
|
+
onScroller: setScroller,
|
|
2483
|
+
renderItem: (index, measure) => {
|
|
2484
|
+
const entry = virtualItems[index];
|
|
2485
|
+
return bodyRow(entry.row, { index, measure }, entry.part);
|
|
2486
|
+
}
|
|
2487
|
+
}
|
|
2488
|
+
),
|
|
2489
|
+
hasMore && loadingRow
|
|
2490
|
+
] }) : /* @__PURE__ */ jsxs("tbody", { className: "ds-table__body", children: [
|
|
2491
|
+
visibleRows.map((row) => bodyRow(row)),
|
|
2492
|
+
hasMore && loadingRow
|
|
2493
|
+
] }),
|
|
2494
|
+
totalsRow && !stacked && totalsFooter()
|
|
2495
|
+
]
|
|
2496
|
+
}
|
|
2497
|
+
),
|
|
2498
|
+
/* @__PURE__ */ jsx("div", { ref: guideRef, className: `${baseClass}__guide`, hidden: true, "aria-hidden": "true" }),
|
|
2499
|
+
/* @__PURE__ */ jsx("div", { ref: dropRef, className: `${baseClass}__drop`, hidden: true, "aria-hidden": "true" })
|
|
2500
|
+
]
|
|
2501
|
+
}
|
|
2502
|
+
) : error ? /* @__PURE__ */ jsx(
|
|
2477
2503
|
EmptyState,
|
|
2478
2504
|
{
|
|
2479
2505
|
icon: "error",
|
|
2480
2506
|
title: loadWords.errorTitle,
|
|
2481
2507
|
description: error,
|
|
2482
2508
|
action: retryButton || void 0,
|
|
2483
|
-
variant: "bordered",
|
|
2509
|
+
variant: frameless ? "plain" : "bordered",
|
|
2484
2510
|
size: "compact",
|
|
2485
2511
|
role: "alert"
|
|
2486
2512
|
}
|
|
@@ -2490,7 +2516,7 @@ function DataTable({
|
|
|
2490
2516
|
icon: "search_off",
|
|
2491
2517
|
title: emptyStateLabels?.title ?? "No matching rows",
|
|
2492
2518
|
description: emptyStateLabels?.description ?? "Adjust the search or filters and try again.",
|
|
2493
|
-
variant: "bordered",
|
|
2519
|
+
variant: frameless ? "plain" : "bordered",
|
|
2494
2520
|
size: "compact"
|
|
2495
2521
|
}
|
|
2496
2522
|
),
|
|
@@ -5,7 +5,8 @@ export interface DrillMenuItem {
|
|
|
5
5
|
label: string;
|
|
6
6
|
/**
|
|
7
7
|
* Where the row links. On a row with `items` it is the level's landing
|
|
8
|
-
* page instead: the level opens with an overview row linking to it
|
|
8
|
+
* page instead: the level opens with an overview row linking to it, drawn
|
|
9
|
+
* as the first of the level's rows.
|
|
9
10
|
*/
|
|
10
11
|
href?: string;
|
|
11
12
|
/** Stable identity, used in `path`. Defaults to `href`, then `label`. */
|
|
@@ -144,6 +144,14 @@ function DrillMenu({
|
|
|
144
144
|
else groups.push({ key: `rows-${index}`, rows: [entry] });
|
|
145
145
|
}
|
|
146
146
|
});
|
|
147
|
+
const rowsHaveIcons = groups.some((group) => group.rows.some((row) => row.icon != null));
|
|
148
|
+
const overview = level?.href ? {
|
|
149
|
+
label: overviewLabel(level.label),
|
|
150
|
+
href: level.href,
|
|
151
|
+
icon: rowsHaveIcons ? level.icon ?? "grid_view" : void 0,
|
|
152
|
+
id: `${idOf(level)}#overview`
|
|
153
|
+
} : null;
|
|
154
|
+
const overviewJoins = groups.length > 0 && !groups[0].section?.label && groups[0].rows.length > 0;
|
|
147
155
|
return /* @__PURE__ */ jsx("nav", { ...rest, ref, "aria-label": navLabel, className: ["ds-drill-menu", className].filter(Boolean).join(" "), children: /* @__PURE__ */ jsxs(
|
|
148
156
|
"div",
|
|
149
157
|
{
|
|
@@ -160,10 +168,13 @@ function DrillMenu({
|
|
|
160
168
|
] }),
|
|
161
169
|
/* @__PURE__ */ jsx("h2", { ref: titleRef, tabIndex: -1, className: "ds-drill-menu__title", children: level.title ?? level.label })
|
|
162
170
|
] }) : header && /* @__PURE__ */ jsx("div", { className: "ds-drill-menu__header", children: header }),
|
|
163
|
-
|
|
164
|
-
groups.map(({ key, section, rows }) => /* @__PURE__ */ jsxs("section", { className: "ds-drill-menu__section", children: [
|
|
171
|
+
overview && !overviewJoins && /* @__PURE__ */ jsx("ul", { className: "ds-drill-menu__list", children: renderRow(overview) }),
|
|
172
|
+
groups.map(({ key, section, rows }, index) => /* @__PURE__ */ jsxs("section", { className: "ds-drill-menu__section", children: [
|
|
165
173
|
section?.label && /* @__PURE__ */ jsx("h3", { className: "ds-drill-menu__section-label", children: section.label }),
|
|
166
|
-
rows.length > 0 && /* @__PURE__ */
|
|
174
|
+
rows.length > 0 && /* @__PURE__ */ jsxs("ul", { className: "ds-drill-menu__list", children: [
|
|
175
|
+
overview && overviewJoins && index === 0 && renderRow(overview, section?.variant),
|
|
176
|
+
rows.map((item) => renderRow(item, section?.variant))
|
|
177
|
+
] }),
|
|
167
178
|
section?.content && /* @__PURE__ */ jsx("div", { className: "ds-drill-menu__section-content", children: section.content })
|
|
168
179
|
] }, key))
|
|
169
180
|
]
|
|
@@ -143,7 +143,8 @@
|
|
|
143
143
|
width: var(--icon-size-600);
|
|
144
144
|
height: var(--icon-size-600);
|
|
145
145
|
overflow: hidden;
|
|
146
|
-
|
|
146
|
+
/* The shared mark hook: a container's `roundMarks` rounds it. */
|
|
147
|
+
border-radius: var(--ds-mark-radius, var(--radius-200));
|
|
147
148
|
background-color: var(--color-bg-container-secondary);
|
|
148
149
|
color: var(--color-text-secondary);
|
|
149
150
|
transition: background-color var(--motion-duration-base) var(--motion-ease-standard);
|
package/components/Icon/Icon.css
CHANGED
|
@@ -48,10 +48,15 @@
|
|
|
48
48
|
.ds-icon--tile {
|
|
49
49
|
width: var(--control-height-default);
|
|
50
50
|
height: var(--control-height-default);
|
|
51
|
-
border-radius: var(--radius-pill);
|
|
51
|
+
border-radius: var(--ds-mark-radius, var(--radius-pill));
|
|
52
52
|
background-color: var(--color-icon-bg);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
/* Round: the shared mark hook at a true circle, as Avatar's `round`. */
|
|
56
|
+
.ds-icon--round {
|
|
57
|
+
--ds-mark-radius: 50%;
|
|
58
|
+
}
|
|
59
|
+
|
|
55
60
|
/* On the tile's fill the default glyph takes the primary text colour, the
|
|
56
61
|
mark's established ink, so it holds its weight against the disc. */
|
|
57
62
|
.ds-icon--tile.ds-icon--default {
|
|
@@ -13,6 +13,8 @@ type IconOwnProps = {
|
|
|
13
13
|
label?: string;
|
|
14
14
|
/** Sets the glyph on a round tile of the icon fill, the mark at the head of a stat card or a list row. */
|
|
15
15
|
tile?: boolean;
|
|
16
|
+
/** With `tile`, draws the tile as a true circle whatever the theme's radius. A container's `roundMarks` (Table, DataTable) does the same for every tile inside it. */
|
|
17
|
+
round?: boolean;
|
|
16
18
|
/** Additional CSS classes */
|
|
17
19
|
className?: string;
|
|
18
20
|
};
|
|
@@ -23,5 +25,5 @@ export interface IconProps extends IconOwnProps, Omit<React.ComponentPropsWithRe
|
|
|
23
25
|
* draws one: beside a heading, at the head of a stat card, in a row of text.
|
|
24
26
|
* Decorative unless it has a `label`. Presentational and server-renderable.
|
|
25
27
|
*/
|
|
26
|
-
export declare function Icon({ name, size, tone, filled, label, tile, className, style, ref, ...rest }: IconProps): React.JSX.Element;
|
|
28
|
+
export declare function Icon({ name, size, tone, filled, label, tile, round, className, style, ref, ...rest }: IconProps): React.JSX.Element;
|
|
27
29
|
export {};
|
package/components/Icon/Icon.js
CHANGED
|
@@ -10,6 +10,7 @@ function Icon({
|
|
|
10
10
|
filled = false,
|
|
11
11
|
label,
|
|
12
12
|
tile = false,
|
|
13
|
+
round = false,
|
|
13
14
|
className = "",
|
|
14
15
|
style,
|
|
15
16
|
ref,
|
|
@@ -21,6 +22,7 @@ function Icon({
|
|
|
21
22
|
`ds-icon--${tone}`,
|
|
22
23
|
filled ? "ds-icon--filled" : "",
|
|
23
24
|
tile ? "ds-icon--tile" : "",
|
|
25
|
+
tile && round ? "ds-icon--round" : "",
|
|
24
26
|
className
|
|
25
27
|
].filter(Boolean).join(" ");
|
|
26
28
|
return /* @__PURE__ */ jsx(
|
|
@@ -78,8 +78,14 @@
|
|
|
78
78
|
|
|
79
79
|
.ds-pixel-avatar--tile {
|
|
80
80
|
padding: calc(var(--icon-size) / 16);
|
|
81
|
-
|
|
81
|
+
/* The shared mark hook: `round` or a container's `roundMarks`. */
|
|
82
|
+
border-radius: var(--ds-mark-radius, var(--radius-200));
|
|
82
83
|
background-color: color-mix(in srgb, var(--ds-pixel-avatar-ink) 16%, transparent);
|
|
83
84
|
}
|
|
84
85
|
|
|
86
|
+
/* Round: the shared mark hook at a true circle, as Avatar's `round`. */
|
|
87
|
+
.ds-pixel-avatar--round {
|
|
88
|
+
--ds-mark-radius: 50%;
|
|
89
|
+
}
|
|
90
|
+
|
|
85
91
|
} /* @layer rift.components */
|
|
@@ -22,6 +22,8 @@ type PixelAvatarOwnProps = {
|
|
|
22
22
|
ink?: PixelInk;
|
|
23
23
|
/** `plain` draws the character alone; `tile` seats it on a rounded wash of its own ink, for a larger standalone mark. */
|
|
24
24
|
variant?: 'plain' | 'tile';
|
|
25
|
+
/** With `variant="tile"`, draws the tile as a true circle whatever the theme's radius. A container's `roundMarks` (Table, DataTable) does the same for every tile inside it. */
|
|
26
|
+
round?: boolean;
|
|
25
27
|
/**
|
|
26
28
|
* Accessible name. Omit it when the mark sits beside the name it was
|
|
27
29
|
* drawn from, which is the usual case: the character is then decorative
|
|
@@ -47,7 +47,7 @@ function spriteCells(name) {
|
|
|
47
47
|
return cells;
|
|
48
48
|
}
|
|
49
49
|
const PixelAvatar = React.forwardRef(
|
|
50
|
-
({ name, size = "md", variant = "plain", ink: inkOverride, label, className = "", ...rest }, ref) => {
|
|
50
|
+
({ name, size = "md", variant = "plain", round = false, ink: inkOverride, label, className = "", ...rest }, ref) => {
|
|
51
51
|
const baseClass = "ds-pixel-avatar";
|
|
52
52
|
const ink = inkOverride ?? pixelAvatarInk(name);
|
|
53
53
|
const classes = [
|
|
@@ -55,6 +55,7 @@ const PixelAvatar = React.forwardRef(
|
|
|
55
55
|
`${baseClass}--${size}`,
|
|
56
56
|
`${baseClass}--${variant}`,
|
|
57
57
|
`${baseClass}--ink-${ink}`,
|
|
58
|
+
variant === "tile" && round ? `${baseClass}--round` : "",
|
|
58
59
|
className
|
|
59
60
|
].filter(Boolean).join(" ");
|
|
60
61
|
const viewBox = `${-MARGIN} ${-MARGIN} ${GRID + MARGIN * 2} ${GRID + MARGIN * 2}`;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useState, useRef, useEffect } from "react";
|
|
3
3
|
import { BLOB_COUNT, vertexSource, fragmentSource } from "./field.glsl.js";
|
|
4
|
-
import { MOTION_CONTEXT_RESTORE_WAIT_MS, MOTION_SHADER_COLOR_CHECK_MS, MOTION_SHADER_COLOR_FADE_MS } from "../../tokens/motion.js";
|
|
4
|
+
import { MOTION_CONTEXT_RESTORE_WAIT_MS, MOTION_SHADER_FRAME_SLACK_MS, MOTION_SHADER_COLOR_CHECK_MS, MOTION_SHADER_COLOR_FADE_MS } from "../../tokens/motion.js";
|
|
5
5
|
import { whenProgramLinked } from "../../behaviors/whenProgramLinked.js";
|
|
6
6
|
const DEFAULT_SHADER_PARAMS = {
|
|
7
7
|
intensity: 0.5,
|
|
@@ -315,7 +315,7 @@ function useShaderField(canvasRef, params, enabled = true) {
|
|
|
315
315
|
function frame(now) {
|
|
316
316
|
raf = requestAnimationFrame(frame);
|
|
317
317
|
const elapsed = now - lastDraw;
|
|
318
|
-
if (elapsed < frameBudget -
|
|
318
|
+
if (elapsed < frameBudget - MOTION_SHADER_FRAME_SLACK_MS) return;
|
|
319
319
|
const dt = Math.min(elapsed, 100);
|
|
320
320
|
lastDraw = now;
|
|
321
321
|
if (now - colorsChecked >= COLOR_CHECK_MS) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import React from "react";
|
|
4
|
-
import { MOTION_RENDERER_WATCHDOG_MS, MOTION_SHADER_COLOR_CHECK_MS } from "../../tokens/motion.js";
|
|
4
|
+
import { MOTION_RENDERER_WATCHDOG_MS, MOTION_SHADER_COLOR_CHECK_MS, MOTION_SHADER_FRAME_SLACK_MS } from "../../tokens/motion.js";
|
|
5
5
|
import { PASSES } from "./passes.js";
|
|
6
6
|
import { warnOnce } from "../../behaviors/devWarning.js";
|
|
7
7
|
import { sceneProblems } from "./assemble.js";
|
|
@@ -207,7 +207,7 @@ function ShaderScene({
|
|
|
207
207
|
const draw = (now) => {
|
|
208
208
|
frame = requestAnimationFrame(draw);
|
|
209
209
|
if (lost) return;
|
|
210
|
-
if (painted && now - last < FRAME_MS -
|
|
210
|
+
if (painted && now - last < FRAME_MS - MOTION_SHADER_FRAME_SLACK_MS) return;
|
|
211
211
|
if (now - coloursChecked >= COLOUR_CHECK_MS) {
|
|
212
212
|
coloursChecked = now;
|
|
213
213
|
if (colourSignature() !== appliedColours) applyColours();
|
|
@@ -495,15 +495,6 @@
|
|
|
495
495
|
}
|
|
496
496
|
}
|
|
497
497
|
|
|
498
|
-
/* The list does the scrolling, as SideNav's scrollable mode: no scrollbar
|
|
499
|
-
until it moves and its ends fading out, the sidebar's treatment, so the
|
|
500
|
-
drawer's body only gives it the height. */
|
|
501
|
-
.ds-site-header__drawer .ds-drawer__body {
|
|
502
|
-
display: flex;
|
|
503
|
-
flex-direction: column;
|
|
504
|
-
overflow: hidden;
|
|
505
|
-
}
|
|
506
|
-
|
|
507
498
|
/* Icon side padding, Button's rule: a section with a mega menu trails a
|
|
508
499
|
caret, whose box carries its own side bearing, so that pill's end takes
|
|
509
500
|
the step below the label side (16 → 12). */
|
|
@@ -55,7 +55,8 @@
|
|
|
55
55
|
height: var(--icon-size-500);
|
|
56
56
|
/* Concentric with the pill: its radius less the inset between them. A
|
|
57
57
|
squared theme squares the badge with it. */
|
|
58
|
-
|
|
58
|
+
/* The shared mark hook: a container's `roundMarks` rounds it. */
|
|
59
|
+
border-radius: var(--ds-mark-radius, calc(var(--radius-pill) - var(--ds-source-chip-inset)));
|
|
59
60
|
/* A solid inverse disc, so the numeral carries the weight a logo's
|
|
60
61
|
full-colour disc does: dark on light in dark mode, light on dark in
|
|
61
62
|
light mode. It holds through hover and press — the pill's wash moves
|
|
@@ -72,15 +72,16 @@
|
|
|
72
72
|
flex-shrink: 0;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
+
/* The heading takes the face AppSidebar's section headings wear (the
|
|
76
|
+
paragraph-sm face on the tertiary text colour, in sentence case), so the
|
|
77
|
+
rail and the panel beside it label their groups one way. */
|
|
75
78
|
.ds-sub-nav-panel__title {
|
|
76
79
|
margin: 0;
|
|
77
|
-
font-family: var(--font-
|
|
78
|
-
font-size: var(--font-
|
|
79
|
-
font-weight: var(--font-
|
|
80
|
-
line-height: var(--font-
|
|
81
|
-
|
|
82
|
-
text-transform: uppercase;
|
|
83
|
-
color: var(--color-text-secondary);
|
|
80
|
+
font-family: var(--font-paragraph-sm-family);
|
|
81
|
+
font-size: var(--font-paragraph-sm-size);
|
|
82
|
+
font-weight: var(--font-paragraph-sm-weight);
|
|
83
|
+
line-height: var(--font-paragraph-sm-line-height);
|
|
84
|
+
color: var(--color-text-tertiary);
|
|
84
85
|
min-width: 0;
|
|
85
86
|
/* Wraps rather than truncates: the heading names the section, and a
|
|
86
87
|
clipped name is the one thing the reader cannot recover from. */
|
|
@@ -97,8 +98,8 @@
|
|
|
97
98
|
right edge as the rows' badges and chevrons. */
|
|
98
99
|
margin-inline-end: calc(var(--padding-100) * -1);
|
|
99
100
|
/* Centred on the heading's first line however many lines it wraps to. */
|
|
100
|
-
margin-top: calc((var(--font-
|
|
101
|
-
margin-bottom: calc((var(--font-
|
|
101
|
+
margin-top: calc((var(--font-paragraph-sm-line-height) - 32px) / 2);
|
|
102
|
+
margin-bottom: calc((var(--font-paragraph-sm-line-height) - 32px) / 2);
|
|
102
103
|
padding: 0;
|
|
103
104
|
flex-shrink: 0;
|
|
104
105
|
border: none;
|