@starci/grammar 0.9.4 → 0.9.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/.build-stamp.json +4 -4
- package/dist/common/components-navigation.css +192 -0
- package/dist/common/registry.d.ts +3 -2
- package/dist/common/registry.d.ts.map +1 -1
- package/dist/common/renderers-navigation.d.ts +3 -1
- package/dist/common/renderers-navigation.d.ts.map +1 -1
- package/dist/common/renderers-navigation.js +3 -1
- package/dist/common/renderers-navigation.js.map +1 -1
- package/dist/common/styles.css +6 -0
- package/dist/core/branch/DataTable/index.d.ts +7 -2
- package/dist/core/branch/DataTable/index.d.ts.map +1 -1
- package/dist/core/branch/DataTable/index.js +9 -4
- package/dist/core/branch/DataTable/index.js.map +1 -1
- package/dist/core/branch/FlowGraph/index.d.ts +34 -0
- package/dist/core/branch/FlowGraph/index.d.ts.map +1 -0
- package/dist/core/branch/FlowGraph/index.js +83 -0
- package/dist/core/branch/FlowGraph/index.js.map +1 -0
- package/dist/core/branch/FlowGraph/layout.d.ts +17 -0
- package/dist/core/branch/FlowGraph/layout.d.ts.map +1 -0
- package/dist/core/branch/FlowGraph/layout.js +51 -0
- package/dist/core/branch/FlowGraph/layout.js.map +1 -0
- package/dist/core/branch/FlowGraph/types.d.ts +28 -0
- package/dist/core/branch/FlowGraph/types.d.ts.map +1 -0
- package/dist/core/branch/FlowGraph/types.js +2 -0
- package/dist/core/branch/FlowGraph/types.js.map +1 -0
- package/dist/core/branch/SurfaceListCard/index.d.ts +6 -0
- package/dist/core/branch/SurfaceListCard/index.d.ts.map +1 -1
- package/dist/core/branch/SurfaceListCard/index.js +10 -3
- package/dist/core/branch/SurfaceListCard/index.js.map +1 -1
- package/dist/core/composite/DescriptionList/index.d.ts +5 -0
- package/dist/core/composite/DescriptionList/index.d.ts.map +1 -1
- package/dist/core/composite/DescriptionList/index.js +6 -4
- package/dist/core/composite/DescriptionList/index.js.map +1 -1
- package/dist/core/composite/ListRow/index.d.ts +8 -1
- package/dist/core/composite/ListRow/index.d.ts.map +1 -1
- package/dist/core/composite/ListRow/index.js +5 -1
- package/dist/core/composite/ListRow/index.js.map +1 -1
- package/dist/offset-pop/components-navigation.css +14 -0
- package/package.json +6 -4
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ npm install @starci/grammar @heroui/react react react-dom
|
|
|
17
17
|
npm install ./.claude/packages/grammar
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
The package needs Node.js 20 or newer. Its peer dependencies are React 18
|
|
20
|
+
The package needs Node.js 20 or newer. Its peer dependencies are React 18+, `@xyflow/react` 12 (for `FlowGraph`) and `@heroui/react`
|
|
21
21
|
3.2+. Load the HeroUI stylesheet once in the app, as HeroUI's own setup describes. Then import
|
|
22
22
|
exactly one Grammar family stylesheet. Each family sheet already imports Common anatomy first.
|
|
23
23
|
|
package/dist/.build-stamp.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": "starci/grammar-build-stamp@1",
|
|
3
3
|
"package": "@starci/grammar",
|
|
4
|
-
"version": "0.9.
|
|
4
|
+
"version": "0.9.5",
|
|
5
5
|
"algorithm": "starci/grammar-source-digest@1",
|
|
6
|
-
"sourceDigest": "sha256:
|
|
7
|
-
"distDigest": "sha256:
|
|
8
|
-
"builtAt": "2026-10-
|
|
6
|
+
"sourceDigest": "sha256:5e06ab35c59bdb6d3b3b19ec8a4e0263df365ebbad219603304091b708a3421e",
|
|
7
|
+
"distDigest": "sha256:0e854f8925ecf978f6e1153debd167ac6d2230c0ca6e20e3071c0bc685ec66dc",
|
|
8
|
+
"builtAt": "2026-10-11T14:02:49.571Z"
|
|
9
9
|
}
|
|
@@ -1274,4 +1274,196 @@
|
|
|
1274
1274
|
forced-color-adjust: none;
|
|
1275
1275
|
}
|
|
1276
1276
|
}
|
|
1277
|
+
|
|
1278
|
+
/* ---------- FlowGraph ----------
|
|
1279
|
+
* The structural base rules of React Flow, scoped to the graph so a host needs no @xyflow/react stylesheet import.
|
|
1280
|
+
* Its colours (edges, background, nodes) are replaced by grammar tokens below. */
|
|
1281
|
+
.starci-core-flow-graph {
|
|
1282
|
+
display: block;
|
|
1283
|
+
position: relative;
|
|
1284
|
+
min-width: 0;
|
|
1285
|
+
margin: 0;
|
|
1286
|
+
overflow: hidden;
|
|
1287
|
+
border: 1px solid var(--separator, CanvasText);
|
|
1288
|
+
border-radius: var(--starci-core-surface-radius, 1rem);
|
|
1289
|
+
background: var(--surface, Canvas);
|
|
1290
|
+
color: var(--foreground, CanvasText);
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1293
|
+
.starci-core-flow-graph-canvas {
|
|
1294
|
+
position: relative;
|
|
1295
|
+
inline-size: 100%;
|
|
1296
|
+
block-size: 24rem;
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
.starci-core-flow-graph[data-grammar-flow-height="sm"] .starci-core-flow-graph-canvas { block-size: 16rem; }
|
|
1300
|
+
.starci-core-flow-graph[data-grammar-flow-height="lg"] .starci-core-flow-graph-canvas { block-size: 32rem; }
|
|
1301
|
+
|
|
1302
|
+
.starci-core-flow-graph-loading > .starci-core-skeleton { block-size: 100%; aspect-ratio: auto; border-radius: 0; }
|
|
1303
|
+
|
|
1304
|
+
.starci-core-flow-graph-empty {
|
|
1305
|
+
display: flex;
|
|
1306
|
+
align-items: center;
|
|
1307
|
+
justify-content: center;
|
|
1308
|
+
min-block-size: 8rem;
|
|
1309
|
+
margin: 0;
|
|
1310
|
+
padding: 1.5rem;
|
|
1311
|
+
color: var(--muted, GrayText);
|
|
1312
|
+
text-align: center;
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1315
|
+
.starci-core-flow-graph .react-flow {
|
|
1316
|
+
direction: ltr;
|
|
1317
|
+
--xy-edge-stroke: var(--separator, CanvasText);
|
|
1318
|
+
--xy-edge-stroke-width: 1.5;
|
|
1319
|
+
--xy-edge-stroke-selected: var(--separator, CanvasText);
|
|
1320
|
+
--xy-background-color: transparent;
|
|
1321
|
+
background: transparent;
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
.starci-core-flow-graph .react-flow__container { position: absolute; inline-size: 100%; block-size: 100%; inset-block-start: 0; inset-inline-start: 0; }
|
|
1325
|
+
.starci-core-flow-graph .react-flow__pane { z-index: 1; touch-action: none; }
|
|
1326
|
+
.starci-core-flow-graph[data-grammar-flow-interactive="true"] .react-flow__pane.draggable { cursor: grab; }
|
|
1327
|
+
.starci-core-flow-graph[data-grammar-flow-interactive="true"] .react-flow__pane.dragging { cursor: grabbing; }
|
|
1328
|
+
.starci-core-flow-graph .react-flow__viewport { transform-origin: 0 0; z-index: 2; pointer-events: none; }
|
|
1329
|
+
.starci-core-flow-graph .react-flow__renderer { z-index: 4; }
|
|
1330
|
+
.starci-core-flow-graph .react-flow__background { pointer-events: none; z-index: -1; }
|
|
1331
|
+
.starci-core-flow-graph .react-flow__edges { position: absolute; }
|
|
1332
|
+
.starci-core-flow-graph .react-flow__edges svg { position: absolute; overflow: visible; pointer-events: none; }
|
|
1333
|
+
.starci-core-flow-graph .react-flow__edge-path { fill: none; stroke: var(--xy-edge-stroke); stroke-width: var(--xy-edge-stroke-width); stroke-linecap: round; }
|
|
1334
|
+
.starci-core-flow-graph .starci-core-flow-graph-edge-placeholder .react-flow__edge-path { stroke-dasharray: 4 5; }
|
|
1335
|
+
.starci-core-flow-graph .react-flow__nodes { pointer-events: none; transform-origin: 0 0; }
|
|
1336
|
+
.starci-core-flow-graph .react-flow__node {
|
|
1337
|
+
position: absolute;
|
|
1338
|
+
box-sizing: border-box;
|
|
1339
|
+
transform-origin: 0 0;
|
|
1340
|
+
pointer-events: all;
|
|
1341
|
+
user-select: none;
|
|
1342
|
+
cursor: default;
|
|
1343
|
+
outline: none;
|
|
1344
|
+
}
|
|
1345
|
+
.starci-core-flow-graph .react-flow__node.selectable { cursor: pointer; }
|
|
1346
|
+
.starci-core-flow-graph .react-flow__panel { position: absolute; z-index: 5; margin: 0.75rem; }
|
|
1347
|
+
.starci-core-flow-graph .react-flow__panel.bottom { inset-block-end: 0; }
|
|
1348
|
+
.starci-core-flow-graph .react-flow__panel.left { inset-inline-start: 0; }
|
|
1349
|
+
.starci-core-flow-graph .react-flow__panel.right { inset-inline-end: 0; }
|
|
1350
|
+
.starci-core-flow-graph .react-flow__panel.top { inset-block-start: 0; }
|
|
1351
|
+
|
|
1352
|
+
/* The edge ends meet at the node centre: the handle is a hidden point in the middle of the card. */
|
|
1353
|
+
.starci-core-flow-graph .starci-core-flow-graph-handle {
|
|
1354
|
+
position: absolute;
|
|
1355
|
+
inset-block-start: 50%;
|
|
1356
|
+
inset-inline-start: 50%;
|
|
1357
|
+
min-inline-size: 1px;
|
|
1358
|
+
min-block-size: 1px;
|
|
1359
|
+
inline-size: 1px;
|
|
1360
|
+
block-size: 1px;
|
|
1361
|
+
border: 0;
|
|
1362
|
+
opacity: 0;
|
|
1363
|
+
pointer-events: none;
|
|
1364
|
+
transform: none;
|
|
1365
|
+
background: transparent;
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1368
|
+
.starci-core-flow-graph-node {
|
|
1369
|
+
--starci-flow-tint: var(--default-soft, transparent);
|
|
1370
|
+
--starci-flow-ink: var(--foreground, CanvasText);
|
|
1371
|
+
position: relative;
|
|
1372
|
+
display: inline-flex;
|
|
1373
|
+
align-items: center;
|
|
1374
|
+
gap: 0.5rem;
|
|
1375
|
+
max-inline-size: 14rem;
|
|
1376
|
+
padding: 0.375rem 0.875rem;
|
|
1377
|
+
border: 1px solid var(--separator, CanvasText);
|
|
1378
|
+
border-radius: 999px;
|
|
1379
|
+
background-color: var(--surface, Canvas);
|
|
1380
|
+
background-image: linear-gradient(var(--starci-flow-tint), var(--starci-flow-tint));
|
|
1381
|
+
color: var(--starci-flow-ink);
|
|
1382
|
+
font-size: 0.875rem;
|
|
1383
|
+
line-height: 1.25;
|
|
1384
|
+
}
|
|
1385
|
+
|
|
1386
|
+
.starci-core-flow-graph-node[data-size="sm"] { padding: 0.25rem 0.625rem; font-size: 0.75rem; }
|
|
1387
|
+
.starci-core-flow-graph-node[data-size="lg"] { padding: 0.625rem 1.25rem; font-size: 1rem; font-weight: 600; }
|
|
1388
|
+
.starci-core-flow-graph-node[data-tone="accent"] { --starci-flow-tint: var(--accent-soft, transparent); --starci-flow-ink: var(--accent-soft-foreground, CanvasText); }
|
|
1389
|
+
.starci-core-flow-graph-node[data-tone="success"] { --starci-flow-tint: var(--success-soft, transparent); --starci-flow-ink: var(--success-soft-foreground, CanvasText); }
|
|
1390
|
+
.starci-core-flow-graph-node[data-tone="warning"] { --starci-flow-tint: var(--warning-soft, transparent); --starci-flow-ink: var(--warning-soft-foreground, CanvasText); }
|
|
1391
|
+
.starci-core-flow-graph-node[data-tone="danger"] { --starci-flow-tint: var(--danger-soft, transparent); --starci-flow-ink: var(--danger-soft-foreground, CanvasText); }
|
|
1392
|
+
.starci-core-flow-graph-node[data-tone="muted"] { --starci-flow-tint: transparent; --starci-flow-ink: var(--muted, GrayText); }
|
|
1393
|
+
.starci-core-flow-graph-node[data-placeholder="true"] { border-style: dashed; }
|
|
1394
|
+
|
|
1395
|
+
.starci-core-flow-graph-copy {
|
|
1396
|
+
display: flex;
|
|
1397
|
+
min-width: 0;
|
|
1398
|
+
flex-direction: column;
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
.starci-core-flow-graph-label {
|
|
1402
|
+
overflow: hidden;
|
|
1403
|
+
text-overflow: ellipsis;
|
|
1404
|
+
white-space: nowrap;
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1407
|
+
.starci-core-flow-graph-description {
|
|
1408
|
+
overflow: hidden;
|
|
1409
|
+
color: var(--muted, GrayText);
|
|
1410
|
+
font-size: 0.75rem;
|
|
1411
|
+
text-overflow: ellipsis;
|
|
1412
|
+
white-space: nowrap;
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
.starci-core-flow-graph-count {
|
|
1416
|
+
flex: 0 0 auto;
|
|
1417
|
+
min-inline-size: 1.25rem;
|
|
1418
|
+
padding: 0 0.375rem;
|
|
1419
|
+
border-radius: 999px;
|
|
1420
|
+
background: var(--surface, Canvas);
|
|
1421
|
+
color: var(--foreground, CanvasText);
|
|
1422
|
+
font-size: 0.6875rem;
|
|
1423
|
+
font-variant-numeric: tabular-nums;
|
|
1424
|
+
line-height: 1.25rem;
|
|
1425
|
+
text-align: center;
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1428
|
+
/* Selection and keyboard focus draw the package focus ring on the card, not on the React Flow wrapper. */
|
|
1429
|
+
.starci-core-flow-graph-node[data-grammar-selected="true"],
|
|
1430
|
+
.starci-core-flow-graph .react-flow__node:focus-visible > .starci-core-flow-graph-node {
|
|
1431
|
+
outline: 2px solid var(--focus, var(--starci-core-focus, Highlight));
|
|
1432
|
+
outline-offset: 2px;
|
|
1433
|
+
}
|
|
1434
|
+
|
|
1435
|
+
.starci-core-flow-graph-controls {
|
|
1436
|
+
display: flex;
|
|
1437
|
+
flex-direction: column;
|
|
1438
|
+
overflow: hidden;
|
|
1439
|
+
border: 1px solid var(--separator, CanvasText);
|
|
1440
|
+
border-radius: 0.75rem;
|
|
1441
|
+
background: var(--surface, Canvas);
|
|
1442
|
+
}
|
|
1443
|
+
|
|
1444
|
+
.starci-core-flow-graph-controls .react-flow__controls-button {
|
|
1445
|
+
display: flex;
|
|
1446
|
+
align-items: center;
|
|
1447
|
+
justify-content: center;
|
|
1448
|
+
inline-size: 2rem;
|
|
1449
|
+
block-size: 2rem;
|
|
1450
|
+
padding: 0.375rem;
|
|
1451
|
+
border: 0;
|
|
1452
|
+
background: transparent;
|
|
1453
|
+
color: var(--foreground, CanvasText);
|
|
1454
|
+
cursor: pointer;
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
.starci-core-flow-graph-controls .react-flow__controls-button + .react-flow__controls-button { border-block-start: 1px solid var(--separator, CanvasText); }
|
|
1458
|
+
.starci-core-flow-graph-controls .react-flow__controls-button svg { inline-size: 100%; max-inline-size: 0.75rem; max-block-size: 0.75rem; fill: currentColor; }
|
|
1459
|
+
.starci-core-flow-graph-controls .react-flow__controls-button:focus-visible { outline: 2px solid var(--focus, var(--starci-core-focus, Highlight)); outline-offset: -2px; }
|
|
1460
|
+
.starci-core-flow-graph-controls .react-flow__controls-button:disabled { opacity: 0.4; cursor: default; }
|
|
1461
|
+
|
|
1462
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1463
|
+
.starci-core-flow-graph .react-flow__edge.animated path { animation: none; }
|
|
1464
|
+
}
|
|
1465
|
+
|
|
1466
|
+
@media (forced-colors: active) {
|
|
1467
|
+
.starci-core-flow-graph-node[data-grammar-selected="true"] { outline-color: Highlight; forced-color-adjust: none; }
|
|
1468
|
+
}
|
|
1277
1469
|
}
|
|
@@ -14,9 +14,10 @@ export declare const COMMON_GRAMMAR_COMPONENTS: Readonly<{
|
|
|
14
14
|
readonly BottomNav: ({ label, items, currentId, onSelect, position, visibility, className }: import("./renderers-navigation.js").BottomNavProps) => import("react").JSX.Element;
|
|
15
15
|
readonly Breadcrumbs: ({ label, items, separator, onAction, className }: import("./renderers-navigation.js").BreadcrumbsProps) => import("react").JSX.Element;
|
|
16
16
|
readonly Calendar: ({ label, value, defaultValue, onChange, minValue, maxValue, isDateUnavailable, isDisabled, isReadOnly, previousLabel, nextLabel, className, }: import("./renderers-navigation.js").CalendarProps) => import("react").JSX.Element;
|
|
17
|
-
readonly DataTable: <Row extends import("./renderers-navigation.js").DataTableRow>({ label, columns, rows, renderCell, sort, onSortChange, selectionMode, selectedIds, defaultSelectedIds, onSelectionChange, selectAllLabel, selectRowLabel, isLoading, loadingContent, emptyContent, stickyHeader, maxBlockSize, onRowAction, className, }: import("./renderers-navigation.js").DataTableProps<Row>) => import("react").JSX.Element;
|
|
17
|
+
readonly DataTable: <Row extends import("./renderers-navigation.js").DataTableRow>({ label, columns, rows, renderCell, sort, onSortChange, selectionMode, selectedIds, defaultSelectedIds, onSelectionChange, selectAllLabel, selectRowLabel, isLoading, loadingContent, loadingRows, emptyContent, stickyHeader, maxBlockSize, onRowAction, className, }: import("./renderers-navigation.js").DataTableProps<Row>) => import("react").JSX.Element;
|
|
18
18
|
readonly DescriptionList: (props: import("./renderers-navigation.js").DescriptionListProps) => import("react").JSX.Element;
|
|
19
19
|
readonly Disclosure: ({ title, children, isExpanded, defaultExpanded, onExpandedChange, isDisabled, headingLevel, className, }: import("./renderers-navigation.js").DisclosureProps) => import("react").JSX.Element;
|
|
20
|
+
readonly FlowGraph: ({ label, nodes, edges, selectedId, onSelect, height, isInteractive, showControls, layout, emptyLabel, isLoading, className, }: import("./renderers-navigation.js").FlowGraphProps) => import("react").JSX.Element;
|
|
20
21
|
readonly Footer: ({ label, brand, groups, legal, externalHint, children, className }: import("./renderers-navigation.js").FooterProps) => import("react").JSX.Element;
|
|
21
22
|
readonly Image: ({ src, alt, aspect, fit, fallback, loading, srcSet, sizes, width, height, onLoadStateChange, plate, className, ...assetSlot }: import("./renderers-navigation.js").ImageProps) => import("react").JSX.Element;
|
|
22
23
|
readonly Link: ({ children, href, kind, isCurrent, visited, externalHint, externalIcon, isDisabled, onFollow, className, }: import("./renderers-navigation.js").LinkProps) => import("react").JSX.Element;
|
|
@@ -89,7 +90,7 @@ export declare const COMMON_GRAMMAR_COMPONENTS: Readonly<{
|
|
|
89
90
|
readonly LeadingNumber: (props: import("./renderers.js").LeadingNumberProps) => import("react").JSX.Element;
|
|
90
91
|
readonly List: (props: import("./renderers.js").ListProps) => import("react").JSX.Element;
|
|
91
92
|
readonly ListItem: (props: import("./renderers.js").ListItemProps) => import("react").JSX.Element;
|
|
92
|
-
readonly ListRow: ({ title, description, leading, badges, actions, children, state, verdict }: import("./renderers.js").ListRowProps) => import("react").JSX.Element;
|
|
93
|
+
readonly ListRow: ({ title, description, leading, badges, actions, children, state, verdict, isSkeleton }: import("./renderers.js").ListRowProps) => import("react").JSX.Element;
|
|
93
94
|
readonly MarkdownArticle: (props: import("./renderers.js").MarkdownArticleProps) => import("react").JSX.Element;
|
|
94
95
|
readonly MarkdownTableFrame: (props: import("./renderers.js").MarkdownTableFrameProps) => import("react").JSX.Element;
|
|
95
96
|
readonly MediaFrame: ({ children, caption, aspect, fit, treatment, className, ...assetSlot }: import("./renderers.js").MediaFrameProps) => import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/common/registry.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AAEvE,MAAM,MAAM,wBAAwB,CAAC,KAAK,IAAI,aAAa,CAAC,KAAK,CAAC,CAAA;AAClE,KAAK,uBAAuB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAA;AACpE,KAAK,sBAAsB,CAAC,MAAM,SAAS,uBAAuB,IAAI;IAClE,QAAQ,EAAE,IAAI,IAAI,MAAM,MAAM,CAAC,CAAC,EAAE,wBAAwB,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;CAC3F,CAAA;AACD,KAAK,gCAAgC,CAAC,MAAM,SAAS,uBAAuB,EAAE,UAAU,SAAS,uBAAuB,IACpH,UAAU,GAAG;IAAE,QAAQ,EAAE,IAAI,IAAI,OAAO,CAAC,MAAM,UAAU,EAAE,MAAM,MAAM,CAAC,GAAG,KAAK;CAAE,CAAA;AAEtF,eAAO,MAAM,yBAAyB
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/common/registry.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AAEvE,MAAM,MAAM,wBAAwB,CAAC,KAAK,IAAI,aAAa,CAAC,KAAK,CAAC,CAAA;AAClE,KAAK,uBAAuB,GAAG,QAAQ,CAA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AU,EAAE,QAAQ,CAAC;QAAE,qBAAqB,EAAE,QAAQ,CAAA;KAAE,CAAC,CAAA;CACrE,CAAA;AAED,yEAAyE;AACzE,eAAO,MAAM,mBAAmB,GAC5B,KAAK,CAAC,QAAQ,SAAS,MAAM,EAC7B,KAAK,CAAC,YAAY,SAAS,sBAAsB,CAAC,OAAO,yBAAyB,CAAC,EACnF,KAAK,CAAC,UAAU,SAAS,uBAAuB,EAClD,YAAY;IACV,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAA;IACrB,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAA;IAC9C,QAAQ,CAAC,UAAU,EAAE;QACjB,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAA;QACnC,QAAQ,CAAC,UAAU,EAAE,gCAAgC,CAAC,OAAO,yBAAyB,EAAE,UAAU,CAAC,CAAA;KACtG,CAAA;CACJ,KAAG,qBAAqB,CAAC,QAAQ,EAAE,UAAU,CAuB7C,CAAA"}
|
|
@@ -2,6 +2,7 @@ export { Accordion, type AccordionItem, type AccordionProps } from "../core/bran
|
|
|
2
2
|
export { Calendar, type CalendarProps } from "../core/branch/Calendar/index.js";
|
|
3
3
|
export { DataTable, type DataTableColumn, type DataTableProps, type DataTableRow, type DataTableSort } from "../core/branch/DataTable/index.js";
|
|
4
4
|
export { Disclosure, type DisclosureProps } from "../core/branch/Disclosure/index.js";
|
|
5
|
+
export { FlowGraph, radialPositions, type FlowGraphEdge, type FlowGraphHeight, type FlowGraphLayout, type FlowGraphNode, type FlowGraphNodeSize, type FlowGraphProps, type FlowGraphTone } from "../core/branch/FlowGraph/index.js";
|
|
5
6
|
export { ListBox, type ListBoxItem, type ListBoxProps } from "../core/branch/ListBox/index.js";
|
|
6
7
|
export { AvatarGroup, type AvatarGroupItem, type AvatarGroupProps } from "../core/composite/AvatarGroup/index.js";
|
|
7
8
|
export { Breadcrumbs, type BreadcrumbItem, type BreadcrumbsProps } from "../core/composite/Breadcrumbs/index.js";
|
|
@@ -25,9 +26,10 @@ export declare const COMMON_NAVIGATION_COMPONENTS: Readonly<{
|
|
|
25
26
|
readonly BottomNav: ({ label, items, currentId, onSelect, position, visibility, className }: import("./renderers-navigation.js").BottomNavProps) => import("react").JSX.Element;
|
|
26
27
|
readonly Breadcrumbs: ({ label, items, separator, onAction, className }: import("./renderers-navigation.js").BreadcrumbsProps) => import("react").JSX.Element;
|
|
27
28
|
readonly Calendar: ({ label, value, defaultValue, onChange, minValue, maxValue, isDateUnavailable, isDisabled, isReadOnly, previousLabel, nextLabel, className, }: import("./renderers-navigation.js").CalendarProps) => import("react").JSX.Element;
|
|
28
|
-
readonly DataTable: <Row extends import("./renderers-navigation.js").DataTableRow>({ label, columns, rows, renderCell, sort, onSortChange, selectionMode, selectedIds, defaultSelectedIds, onSelectionChange, selectAllLabel, selectRowLabel, isLoading, loadingContent, emptyContent, stickyHeader, maxBlockSize, onRowAction, className, }: import("./renderers-navigation.js").DataTableProps<Row>) => import("react").JSX.Element;
|
|
29
|
+
readonly DataTable: <Row extends import("./renderers-navigation.js").DataTableRow>({ label, columns, rows, renderCell, sort, onSortChange, selectionMode, selectedIds, defaultSelectedIds, onSelectionChange, selectAllLabel, selectRowLabel, isLoading, loadingContent, loadingRows, emptyContent, stickyHeader, maxBlockSize, onRowAction, className, }: import("./renderers-navigation.js").DataTableProps<Row>) => import("react").JSX.Element;
|
|
29
30
|
readonly DescriptionList: (props: import("./renderers-navigation.js").DescriptionListProps) => import("react").JSX.Element;
|
|
30
31
|
readonly Disclosure: ({ title, children, isExpanded, defaultExpanded, onExpandedChange, isDisabled, headingLevel, className, }: import("./renderers-navigation.js").DisclosureProps) => import("react").JSX.Element;
|
|
32
|
+
readonly FlowGraph: ({ label, nodes, edges, selectedId, onSelect, height, isInteractive, showControls, layout, emptyLabel, isLoading, className, }: import("./renderers-navigation.js").FlowGraphProps) => import("react").JSX.Element;
|
|
31
33
|
readonly Footer: ({ label, brand, groups, legal, externalHint, children, className }: import("./renderers-navigation.js").FooterProps) => import("react").JSX.Element;
|
|
32
34
|
readonly Image: ({ src, alt, aspect, fit, fallback, loading, srcSet, sizes, width, height, onLoadStateChange, plate, className, ...assetSlot }: import("./renderers-navigation.js").ImageProps) => import("react").JSX.Element;
|
|
33
35
|
readonly Link: ({ children, href, kind, isCurrent, visited, externalHint, externalIcon, isDisabled, onFollow, className, }: import("./renderers-navigation.js").LinkProps) => import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderers-navigation.d.ts","sourceRoot":"","sources":["../../src/common/renderers-navigation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"renderers-navigation.d.ts","sourceRoot":"","sources":["../../src/common/renderers-navigation.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,SAAS,EAAE,KAAK,aAAa,EAAE,KAAK,cAAc,EAAE,MAAM,mCAAmC,CAAA;AACtG,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,kCAAkC,CAAA;AAC/E,OAAO,EAAE,SAAS,EAAE,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,KAAK,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,mCAAmC,CAAA;AAC/I,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,oCAAoC,CAAA;AACrF,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,KAAK,aAAa,EAAE,KAAK,eAAe,EAAE,KAAK,eAAe,EAAE,KAAK,aAAa,EAAE,KAAK,iBAAiB,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,mCAAmC,CAAA;AACnO,OAAO,EAAE,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAC9F,OAAO,EAAE,WAAW,EAAE,KAAK,eAAe,EAAE,KAAK,gBAAgB,EAAE,MAAM,wCAAwC,CAAA;AACjH,OAAO,EAAE,WAAW,EAAE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M,mCAAmC,CAAA;AAE5E,gFAAgF;AAChF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;EAG9B,CAAA"}
|
|
@@ -4,6 +4,7 @@ import { Accordion } from "../core/branch/Accordion/index.js";
|
|
|
4
4
|
import { Calendar } from "../core/branch/Calendar/index.js";
|
|
5
5
|
import { DataTable } from "../core/branch/DataTable/index.js";
|
|
6
6
|
import { Disclosure } from "../core/branch/Disclosure/index.js";
|
|
7
|
+
import { FlowGraph } from "../core/branch/FlowGraph/index.js";
|
|
7
8
|
import { ListBox } from "../core/branch/ListBox/index.js";
|
|
8
9
|
import { AvatarGroup } from "../core/composite/AvatarGroup/index.js";
|
|
9
10
|
import { Breadcrumbs } from "../core/composite/Breadcrumbs/index.js";
|
|
@@ -23,6 +24,7 @@ export { Accordion } from "../core/branch/Accordion/index.js";
|
|
|
23
24
|
export { Calendar } from "../core/branch/Calendar/index.js";
|
|
24
25
|
export { DataTable } from "../core/branch/DataTable/index.js";
|
|
25
26
|
export { Disclosure } from "../core/branch/Disclosure/index.js";
|
|
27
|
+
export { FlowGraph, radialPositions } from "../core/branch/FlowGraph/index.js";
|
|
26
28
|
export { ListBox } from "../core/branch/ListBox/index.js";
|
|
27
29
|
export { AvatarGroup } from "../core/composite/AvatarGroup/index.js";
|
|
28
30
|
export { Breadcrumbs } from "../core/composite/Breadcrumbs/index.js";
|
|
@@ -41,6 +43,6 @@ export { Rating } from "../core/primitive/Rating/index.js";
|
|
|
41
43
|
/** Every navigation-group renderer, spread into `COMMON_GRAMMAR_COMPONENTS`. */
|
|
42
44
|
export const COMMON_NAVIGATION_COMPONENTS = Object.freeze({
|
|
43
45
|
Accordion, Avatar, AvatarGroup, BottomNav, Breadcrumbs, Calendar, DataTable, DescriptionList,
|
|
44
|
-
Disclosure, Footer, Image, Link, ListBox, Pagination, Rating, Stepper, TagGroup, Timeline, TopBar,
|
|
46
|
+
Disclosure, FlowGraph, Footer, Image, Link, ListBox, Pagination, Rating, Stepper, TagGroup, Timeline, TopBar,
|
|
45
47
|
});
|
|
46
48
|
//# sourceMappingURL=renderers-navigation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderers-navigation.js","sourceRoot":"","sources":["../../src/common/renderers-navigation.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,8EAA8E;AAC9E,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAA;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAA;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAA;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAA;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAA;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAA;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAA;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAA;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAA;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAA;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAA;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAA;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAA;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAA;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAA;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,iCAAiC,CAAA;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAA;AAE1D,OAAO,EAAE,SAAS,EAA2C,MAAM,mC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QAAQ,EAAE,SAAS,EAAE,eAAe;IAC5F,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM;CACtG,CAAC,CAAA"}
|
package/dist/common/styles.css
CHANGED
|
@@ -1319,6 +1319,12 @@
|
|
|
1319
1319
|
gap: var(--grammar-inline-gap, 0.5rem);
|
|
1320
1320
|
}
|
|
1321
1321
|
|
|
1322
|
+
/* Skeleton row (knowledge STATE-8): the copy lines take a share of the row, the action keeps a button footprint. */
|
|
1323
|
+
.starci-core-list-row[data-grammar-skeleton="true"] .starci-core-list-row-name { flex: 0 1 55%; }
|
|
1324
|
+
.starci-core-list-row[data-grammar-skeleton="true"] .starci-core-list-row-description { inline-size: 85%; }
|
|
1325
|
+
.starci-core-list-row-skeleton-action { display: block; inline-size: 4.5rem; block-size: 2rem; }
|
|
1326
|
+
.starci-core-list-row-skeleton-action > .starci-core-skeleton { block-size: 100%; aspect-ratio: auto; border-radius: 0.5rem; }
|
|
1327
|
+
|
|
1322
1328
|
.starci-core-list-row-detail {
|
|
1323
1329
|
display: flex;
|
|
1324
1330
|
min-width: 0;
|
|
@@ -30,8 +30,13 @@ export type DataTableProps<Row extends DataTableRow> = {
|
|
|
30
30
|
/** App-owned accessible names of the selection checkboxes in multiple mode. */
|
|
31
31
|
readonly selectAllLabel?: string;
|
|
32
32
|
readonly selectRowLabel?: (row: Row) => string;
|
|
33
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* Marks the table busy and replaces the rows (knowledge STATE-8). With no `loadingContent` the real column headers stay
|
|
35
|
+
* and the body draws `loadingRows` skeleton rows; `loadingContent` replaces the body with that content instead.
|
|
36
|
+
*/
|
|
34
37
|
readonly isLoading?: boolean;
|
|
38
|
+
/** Skeleton rows drawn while loading without `loadingContent` (default 3, 1 to 12). */
|
|
39
|
+
readonly loadingRows?: number;
|
|
35
40
|
readonly loadingContent?: ReactNode;
|
|
36
41
|
/** Shown when there are no rows and the table is not loading. */
|
|
37
42
|
readonly emptyContent: ReactNode;
|
|
@@ -48,5 +53,5 @@ export type DataTableProps<Row extends DataTableRow> = {
|
|
|
48
53
|
* horizontal scroll so a wide table never widens a 360px page.
|
|
49
54
|
* Contract: scroll LAYOUT-3, grid FOCUS-2 CONTROL-STATE-3, row FOCUS-1, empty STATE-3.
|
|
50
55
|
*/
|
|
51
|
-
export declare const DataTable: <Row extends DataTableRow>({ label, columns, rows, renderCell, sort, onSortChange, selectionMode, selectedIds, defaultSelectedIds, onSelectionChange, selectAllLabel, selectRowLabel, isLoading, loadingContent, emptyContent, stickyHeader, maxBlockSize, onRowAction, className, }: DataTableProps<Row>) => import("react").JSX.Element;
|
|
56
|
+
export declare const DataTable: <Row extends DataTableRow>({ label, columns, rows, renderCell, sort, onSortChange, selectionMode, selectedIds, defaultSelectedIds, onSelectionChange, selectAllLabel, selectRowLabel, isLoading, loadingContent, loadingRows, emptyContent, stickyHeader, maxBlockSize, onRowAction, className, }: DataTableProps<Row>) => import("react").JSX.Element;
|
|
52
57
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/branch/DataTable/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAgC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/branch/DataTable/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAgC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAIpE,MAAM,MAAM,eAAe,GAAG;IAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,6FAA6F;IAC7F,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAA;IAC9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CAAA;IAChC,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,MAAM,CAAA;IAC9C;;;OAGG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAA;IAC5B,uFAAuF;IACvF,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,cAAc,CAAC,EAAE,SAAS,CAAA;IACnC,iEAAiE;IACjE,QAAQ,CAAC,YAAY,EAAE,SAAS,CAAA;IAChC,mFAAmF;IACnF,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAA;IAC/B,uEAAuE;IACvE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IAC3C,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC9B,CAAA;AA8BD;;;;;GAKG;AACH,eAAO,MAAM,SAAS,GAAI,GAAG,SAAS,YAAY,EAAE,wQAqBjD,cAAc,CAAC,GAAG,CAAC,gCAsGrB,CAAA"}
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Checkbox as HeroCheckbox, Table as HeroTable } from "@heroui/react";
|
|
4
4
|
import { useState } from "react";
|
|
5
|
+
import { Skeleton } from "../../primitive/Skeleton/index.js";
|
|
5
6
|
import { navigationClassName } from "../../navigationClassNames.js";
|
|
7
|
+
/** The row primitive filters aria-hidden out of its props, so the skeleton rows take it by ref (knowledge STATE-8). */
|
|
8
|
+
const hideFromAssistiveTechnology = (node) => node?.setAttribute("aria-hidden", "true");
|
|
6
9
|
const SELECTION_COLUMN = "starci-data-table-selection";
|
|
7
10
|
const toSortDescriptor = (sort) => ({ column: sort.columnId, direction: sort.direction });
|
|
8
11
|
const toIds = (selection) => selection === "all" ? "all" : [...selection].map(String);
|
|
@@ -20,17 +23,19 @@ const SelectionCheckbox = ({ label }) => (_jsx(HeroCheckbox, { className: "starc
|
|
|
20
23
|
* horizontal scroll so a wide table never widens a 360px page.
|
|
21
24
|
* Contract: scroll LAYOUT-3, grid FOCUS-2 CONTROL-STATE-3, row FOCUS-1, empty STATE-3.
|
|
22
25
|
*/
|
|
23
|
-
export const DataTable = ({ label, columns, rows, renderCell, sort, onSortChange, selectionMode = "none", selectedIds, defaultSelectedIds, onSelectionChange, selectAllLabel, selectRowLabel, isLoading = false, loadingContent, emptyContent, stickyHeader = false, maxBlockSize, onRowAction, className, }) => {
|
|
26
|
+
export const DataTable = ({ label, columns, rows, renderCell, sort, onSortChange, selectionMode = "none", selectedIds, defaultSelectedIds, onSelectionChange, selectAllLabel, selectRowLabel, isLoading = false, loadingContent, loadingRows = 3, emptyContent, stickyHeader = false, maxBlockSize, onRowAction, className, }) => {
|
|
24
27
|
const rowHeaderId = columns.find((column) => column.isRowHeader)?.id ?? columns[0]?.id;
|
|
25
28
|
const multiple = selectionMode === "multiple";
|
|
26
29
|
// Selection is always held here so every row can expose its own `data-grammar-selected`.
|
|
27
30
|
const [uncontrolledSelection, setUncontrolledSelection] = useState(defaultSelectedIds ?? []);
|
|
28
31
|
const selection = selectedIds ?? uncontrolledSelection;
|
|
29
32
|
const isRowSelected = (id) => selection === "all" || selection.includes(id);
|
|
33
|
+
const isSkeleton = isLoading && loadingContent === undefined;
|
|
34
|
+
const skeletonRows = isSkeleton ? Array.from({ length: Math.min(12, Math.max(1, Math.floor(Number.isFinite(loadingRows) ? loadingRows : 3))) }, (_, index) => ({ id: `starci-skeleton-${index}` })) : [];
|
|
30
35
|
const visibleRows = isLoading ? [] : rows;
|
|
31
36
|
const state = isLoading ? "loading" : rows.length === 0 ? "empty" : "ready";
|
|
32
37
|
const scrollStyle = maxBlockSize === undefined ? undefined : { "--starci-core-data-table-max-block-size": maxBlockSize };
|
|
33
|
-
return (_jsx(HeroTable, { "aria-busy": isLoading || undefined, className: navigationClassName("starci-core-data-table", className), "data-component": "DataTable", "data-tier": "branch", "data-grammar-table-state": state, "data-grammar-table-sticky": stickyHeader ? "true" : "false", "data-grammar-table-bounded": maxBlockSize === undefined ? "false" : "true", children: _jsx(HeroTable.ScrollContainer, { className: "starci-core-data-table-scroll", "data-contract": "LAYOUT-3", "data-grammar-table-scroll": "true", style: scrollStyle, children: _jsxs(HeroTable.Content, { "aria-label": label, className: "starci-core-data-table-content", "data-contract": "FOCUS-2 CONTROL-STATE-3", selectionMode: selectionMode, ...(sort === undefined ? {} : { sortDescriptor: toSortDescriptor(sort) }), ...(onSortChange === undefined ? {} : {
|
|
38
|
+
return (_jsx(HeroTable, { "aria-busy": isLoading || undefined, className: navigationClassName("starci-core-data-table", className), "data-component": "DataTable", "data-tier": "branch", "data-grammar-table-state": state, "data-grammar-table-sticky": stickyHeader ? "true" : "false", "data-grammar-table-bounded": maxBlockSize === undefined ? "false" : "true", children: _jsx(HeroTable.ScrollContainer, { className: "starci-core-data-table-scroll", "data-contract": "LAYOUT-3", "data-grammar-table-scroll": "true", style: scrollStyle, children: _jsxs(HeroTable.Content, { "aria-label": label, className: "starci-core-data-table-content", "data-contract": "FOCUS-2 CONTROL-STATE-3", selectionMode: isSkeleton ? "none" : selectionMode, ...(sort === undefined ? {} : { sortDescriptor: toSortDescriptor(sort) }), ...(onSortChange === undefined ? {} : {
|
|
34
39
|
onSortChange: (descriptor) => onSortChange({ columnId: String(descriptor.column), direction: descriptor.direction }),
|
|
35
40
|
}), selectedKeys: toSelection(selection), onSelectionChange: (next) => {
|
|
36
41
|
const ids = toIds(next);
|
|
@@ -39,8 +44,8 @@ export const DataTable = ({ label, columns, rows, renderCell, sort, onSortChange
|
|
|
39
44
|
onSelectionChange?.(ids);
|
|
40
45
|
}, ...(onRowAction === undefined ? {} : { onRowAction: (key) => onRowAction(String(key)) }), children: [_jsxs(HeroTable.Header, { className: "starci-core-data-table-header", children: [multiple ? (_jsx(HeroTable.Column, { className: "starci-core-data-table-column", "data-grammar-table-selection": "true", id: SELECTION_COLUMN, children: _jsx(SelectionCheckbox, { label: selectAllLabel }) })) : null, columns.map((column) => (_jsx(HeroTable.Column, { id: column.id, allowsSorting: column.allowsSorting === true, className: "starci-core-data-table-column", "data-grammar-table-align": column.align ?? "start", isRowHeader: column.id === rowHeaderId, textValue: column.label, children: ({ sortDirection }) => column.allowsSorting === true
|
|
41
46
|
? _jsx(HeroTable.SortableColumnHeader, { className: "starci-core-data-table-sort", ...(sortDirection === undefined ? {} : { sortDirection }), children: column.label })
|
|
42
|
-
: column.label }, column.id)))] }),
|
|
47
|
+
: column.label }, column.id)))] }), _jsxs(HeroTable.Body, { className: "starci-core-data-table-body", renderEmptyState: () => isLoading
|
|
43
48
|
? _jsx("div", { className: "starci-core-data-table-placeholder", "data-grammar-table-loading": "true", role: "status", children: loadingContent })
|
|
44
|
-
: _jsx("div", { className: "starci-core-data-table-placeholder", "data-contract": "STATE-3", "data-grammar-table-empty": "true", children: emptyContent }), children: visibleRows.map((row) => (_jsxs(HeroTable.Row, { id: row.id, className: "starci-core-data-table-row", "data-contract": "FOCUS-1", "data-grammar-table-row": "true", "data-grammar-selected": selectionMode !== "none" && isRowSelected(row.id) ? "true" : "false", children: [multiple ? (_jsx(HeroTable.Cell, { className: "starci-core-data-table-cell", "data-grammar-table-selection": "true", children: _jsx(SelectionCheckbox, { label: selectRowLabel?.(row) }) })) : null, columns.map((column) => (_jsx(HeroTable.Cell, { className: "starci-core-data-table-cell", "data-grammar-table-align": column.align ?? "start", children: renderCell(row, column.id) }, column.id)))] }, row.id))) })] }) }) }));
|
|
49
|
+
: _jsx("div", { className: "starci-core-data-table-placeholder", "data-contract": "STATE-3", "data-grammar-table-empty": "true", children: emptyContent }), children: [skeletonRows.map((row) => (_jsxs(HeroTable.Row, { id: row.id, ref: hideFromAssistiveTechnology, className: "starci-core-data-table-row", "data-grammar-table-row": "true", "data-grammar-skeleton": "true", "data-grammar-selected": "false", children: [multiple ? _jsx(HeroTable.Cell, { className: "starci-core-data-table-cell", "data-grammar-table-selection": "true", children: null }) : null, columns.map((column) => (_jsx(HeroTable.Cell, { className: "starci-core-data-table-cell", "data-grammar-table-align": column.align ?? "start", children: _jsx(Skeleton, { shape: "text" }) }, column.id)))] }, row.id))), visibleRows.map((row) => (_jsxs(HeroTable.Row, { id: row.id, className: "starci-core-data-table-row", "data-contract": "FOCUS-1", "data-grammar-table-row": "true", "data-grammar-selected": selectionMode !== "none" && isRowSelected(row.id) ? "true" : "false", children: [multiple ? (_jsx(HeroTable.Cell, { className: "starci-core-data-table-cell", "data-grammar-table-selection": "true", children: _jsx(SelectionCheckbox, { label: selectRowLabel?.(row) }) })) : null, columns.map((column) => (_jsx(HeroTable.Cell, { className: "starci-core-data-table-cell", "data-grammar-table-align": column.align ?? "start", children: renderCell(row, column.id) }, column.id)))] }, row.id)))] })] }) }) }));
|
|
45
50
|
};
|
|
46
51
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/branch/DataTable/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,KAAK,IAAI,SAAS,EAAuC,MAAM,eAAe,CAAA;AACjH,OAAO,EAAE,QAAQ,EAAsC,MAAM,OAAO,CAAA;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/branch/DataTable/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,KAAK,IAAI,SAAS,EAAuC,MAAM,eAAe,CAAA;AACjH,OAAO,EAAE,QAAQ,EAAsC,MAAM,OAAO,CAAA;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAA;AAC5D,OAAO,EA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AC,CACtB,MAAC,SAAS,CAAC,GAAG,IAEV,EAAE,EAAE,GAAG,CAAC,EAAE,EACV,SAAS,EAAC,4BAA4B,mBACxB,SAAS,4BACA,MAAM,2BACN,aAAa,KAAK,MAAM,IAAI,aAAa,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,aAE1F,QAAQ,CAAC,CAAC,CAAC,CACJ,KAAC,SAAS,CAAC,IAAI,IAAC,SAAS,EAAC,6BAA6B,kCAA8B,MAAM,YACvF,KAAC,iBAAiB,IAAC,KAAK,EAAE,cAAc,EAAE,CAAC,GAAG,CAAC,GAAI,GACtC,CACpB,CAAC,CAAC,CAAC,IAAI,EACP,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CACrB,KAAC,SAAS,CAAC,IAAI,IAAiB,SAAS,EAAC,6BAA6B,8BAA2B,MAAM,CAAC,KAAK,IAAI,OAAO,YACpH,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,CAAC,IADV,MAAM,CAAC,EAAE,CAEb,CACpB,CAAC,KAhBD,GAAG,CAAC,EAAE,CAiBC,CACnB,CAAC,IACW,IACD,GACI,GACpB,CACf,CAAA;AACL,CAAC,CAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { FlowGraphEdge, FlowGraphHeight, FlowGraphLayout, FlowGraphNode } from "./types.js";
|
|
2
|
+
export { radialPositions } from "./layout.js";
|
|
3
|
+
export type { FlowGraphEdge, FlowGraphHeight, FlowGraphLayout, FlowGraphNode, FlowGraphNodeSize, FlowGraphTone } from "./types.js";
|
|
4
|
+
export type FlowGraphProps = {
|
|
5
|
+
/** Names the graph for assistive technology, e.g. "Second brain". */
|
|
6
|
+
readonly label: string;
|
|
7
|
+
readonly nodes: ReadonlyArray<FlowGraphNode>;
|
|
8
|
+
readonly edges: ReadonlyArray<FlowGraphEdge>;
|
|
9
|
+
/** The selected node. Pass it (with `onSelect`) to control selection; leave it out and the graph keeps its own. */
|
|
10
|
+
readonly selectedId?: string | null;
|
|
11
|
+
/** Fires with the node id on click, Enter or Space, and with `null` when the empty canvas is clicked or Escape is pressed. */
|
|
12
|
+
readonly onSelect?: (id: string | null) => void;
|
|
13
|
+
/** Fixed canvas height: 16rem, 24rem or 32rem. */
|
|
14
|
+
readonly height?: FlowGraphHeight;
|
|
15
|
+
/** Pan and zoom. `false` draws a static picture. */
|
|
16
|
+
readonly isInteractive?: boolean;
|
|
17
|
+
/** Zoom buttons. Defaults to on while the graph is interactive. */
|
|
18
|
+
readonly showControls?: boolean;
|
|
19
|
+
/** `radial` places the nodes itself; `manual` uses each node's `position`. */
|
|
20
|
+
readonly layout?: FlowGraphLayout;
|
|
21
|
+
/** Shown instead of the canvas when there are no nodes. */
|
|
22
|
+
readonly emptyLabel?: string;
|
|
23
|
+
/** Unresolved graph (knowledge STATE-8): the frame at its height with a Skeleton block, no React Flow mounted, `aria-busy`. */
|
|
24
|
+
readonly isLoading?: boolean;
|
|
25
|
+
readonly className?: string;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* A node-and-edge map drawn with React Flow (`@xyflow/react`, a peer dependency) in grammar tokens. The radial layout
|
|
29
|
+
* puts the root in the centre with its children on a ring and their children on an outer ring around them. Nodes are
|
|
30
|
+
* keyboard focusable (Tab) and selectable with Enter or Space; a visually hidden list repeats the nodes for screen readers.
|
|
31
|
+
* Contract: focus FOCUS-2, selection CONTROL-STATE-3, empty STATE-3.
|
|
32
|
+
*/
|
|
33
|
+
export declare const FlowGraph: ({ label, nodes, edges, selectedId, onSelect, height, isInteractive, showControls, layout, emptyLabel, isLoading, className, }: FlowGraphProps) => import("react").JSX.Element;
|
|
34
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/branch/FlowGraph/index.tsx"],"names":[],"mappings":"AAkBA,O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jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { Background, Controls, Handle, Position, ReactFlow, useNodesInitialized, useReactFlow, } from "@xyflow/react";
|
|
4
|
+
import { memo, useEffect, useMemo, useState } from "react";
|
|
5
|
+
import { Skeleton } from "../../primitive/Skeleton/index.js";
|
|
6
|
+
import { flowGraphRoot, radialPositions } from "./layout.js";
|
|
7
|
+
export { radialPositions } from "./layout.js";
|
|
8
|
+
const FlowGraphNodeView = memo(({ data }) => {
|
|
9
|
+
const { graphNode, isSelected } = data;
|
|
10
|
+
const hasCount = graphNode.count !== undefined && graphNode.count !== "";
|
|
11
|
+
return (_jsxs("div", { className: "starci-core-flow-graph-node", "data-grammar-flow-node": graphNode.id, "data-grammar-selected": isSelected ? "true" : "false", "data-placeholder": graphNode.isPlaceholder === true ? "true" : undefined, "data-root": graphNode.isRoot === true ? "true" : undefined, "data-size": graphNode.size ?? "md", "data-tone": graphNode.isPlaceholder === true ? "muted" : graphNode.tone ?? "neutral", children: [_jsx(Handle, { className: "starci-core-flow-graph-handle", isConnectable: false, position: Position.Top, type: "target" }), _jsxs("span", { className: "starci-core-flow-graph-copy", children: [_jsx("span", { className: "starci-core-flow-graph-label", children: graphNode.label }), graphNode.description === undefined ? null : _jsx("span", { className: "starci-core-flow-graph-description", children: graphNode.description })] }), hasCount ? _jsx("span", { className: "starci-core-flow-graph-count", children: graphNode.count }) : null, _jsx(Handle, { className: "starci-core-flow-graph-handle", isConnectable: false, position: Position.Top, type: "source" })] }));
|
|
12
|
+
});
|
|
13
|
+
FlowGraphNodeView.displayName = "FlowGraphNodeView";
|
|
14
|
+
const NODE_TYPES = { flowGraph: FlowGraphNodeView };
|
|
15
|
+
const FIT_OPTIONS = { padding: 0.2, duration: 0 };
|
|
16
|
+
/** Re-fits the viewport once the nodes are measured, and again whenever the set of nodes or the layout changes. */
|
|
17
|
+
const Refit = ({ signature }) => {
|
|
18
|
+
const { fitView } = useReactFlow();
|
|
19
|
+
const isReady = useNodesInitialized();
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
if (isReady)
|
|
22
|
+
void fitView(FIT_OPTIONS);
|
|
23
|
+
}, [fitView, isReady, signature]);
|
|
24
|
+
return null;
|
|
25
|
+
};
|
|
26
|
+
const labelFor = (node) => node.count === undefined || node.count === "" ? node.label : `${node.label} (${node.count})`;
|
|
27
|
+
/**
|
|
28
|
+
* A node-and-edge map drawn with React Flow (`@xyflow/react`, a peer dependency) in grammar tokens. The radial layout
|
|
29
|
+
* puts the root in the centre with its children on a ring and their children on an outer ring around them. Nodes are
|
|
30
|
+
* keyboard focusable (Tab) and selectable with Enter or Space; a visually hidden list repeats the nodes for screen readers.
|
|
31
|
+
* Contract: focus FOCUS-2, selection CONTROL-STATE-3, empty STATE-3.
|
|
32
|
+
*/
|
|
33
|
+
export const FlowGraph = ({ label, nodes, edges, selectedId, onSelect, height = "md", isInteractive = true, showControls, layout = "radial", emptyLabel = "Nothing to show yet.", isLoading = false, className, }) => {
|
|
34
|
+
const [ownSelectedId, setOwnSelectedId] = useState(null);
|
|
35
|
+
const currentId = selectedId === undefined ? ownSelectedId : selectedId;
|
|
36
|
+
const select = (id) => {
|
|
37
|
+
if (selectedId === undefined)
|
|
38
|
+
setOwnSelectedId(id);
|
|
39
|
+
onSelect?.(id);
|
|
40
|
+
};
|
|
41
|
+
const positions = useMemo(() => layout === "radial" ? radialPositions(nodes, edges) : null, [layout, nodes, edges]);
|
|
42
|
+
const rootId = flowGraphRoot(nodes)?.id;
|
|
43
|
+
const flowNodes = useMemo(() => nodes.map((graphNode) => ({
|
|
44
|
+
id: graphNode.id,
|
|
45
|
+
type: "flowGraph",
|
|
46
|
+
position: positions?.get(graphNode.id) ?? graphNode.position ?? { x: 0, y: 0 },
|
|
47
|
+
data: { graphNode: layout === "radial" ? { ...graphNode, isRoot: graphNode.id === rootId } : graphNode, isSelected: graphNode.id === currentId },
|
|
48
|
+
selected: graphNode.id === currentId,
|
|
49
|
+
ariaLabel: labelFor(graphNode),
|
|
50
|
+
draggable: false,
|
|
51
|
+
connectable: false,
|
|
52
|
+
})), [nodes, positions, layout, rootId, currentId]);
|
|
53
|
+
const flowEdges = useMemo(() => edges.map((edge) => ({
|
|
54
|
+
id: edge.id,
|
|
55
|
+
source: edge.source,
|
|
56
|
+
target: edge.target,
|
|
57
|
+
type: layout === "radial" ? "straight" : "default",
|
|
58
|
+
className: edge.isPlaceholder === true ? "starci-core-flow-graph-edge starci-core-flow-graph-edge-placeholder" : "starci-core-flow-graph-edge",
|
|
59
|
+
focusable: false,
|
|
60
|
+
selectable: false,
|
|
61
|
+
animated: false,
|
|
62
|
+
})), [edges, layout]);
|
|
63
|
+
const signature = `${layout}:${nodes.map((node) => node.id).join("|")}`;
|
|
64
|
+
const onKeyDown = (event) => {
|
|
65
|
+
if (event.key === "Escape") {
|
|
66
|
+
if (currentId !== null)
|
|
67
|
+
select(null);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (event.key !== "Enter" && event.key !== " ")
|
|
71
|
+
return;
|
|
72
|
+
const target = event.target instanceof Element ? event.target.closest(".react-flow__node") : null;
|
|
73
|
+
const id = target?.getAttribute("data-id");
|
|
74
|
+
if (id === null || id === undefined)
|
|
75
|
+
return;
|
|
76
|
+
event.preventDefault();
|
|
77
|
+
select(id);
|
|
78
|
+
};
|
|
79
|
+
const controls = showControls ?? isInteractive;
|
|
80
|
+
return (_jsx("figure", { "aria-label": label, className: ["starci-core-flow-graph", className].filter(Boolean).join(" "), "data-component": "FlowGraph", "data-contract": "FOCUS-2 CONTROL-STATE-3 STATE-3", "data-grammar-flow-height": height, "data-grammar-flow-interactive": isInteractive ? "true" : "false", "data-grammar-flow-layout": layout, "data-tier": "branch", ...(isLoading ? { "aria-busy": true, "data-loading": "true" } : {}), onKeyDown: onKeyDown, children: isLoading ? (_jsx("div", { className: "starci-core-flow-graph-canvas starci-core-flow-graph-loading", "data-grammar-flow-loading": "true", children: _jsx(Skeleton, { shape: "rect" }) })) : nodes.length === 0 ? (_jsx("p", { className: "starci-core-flow-graph-empty", "data-contract": "STATE-3", "data-grammar-flow-empty": "true", children: emptyLabel })) : (_jsxs(_Fragment, { children: [_jsx("div", { className: "starci-core-flow-graph-canvas", children: _jsxs(ReactFlow, { edges: flowEdges, edgesFocusable: false, elementsSelectable: true, fitView: true, fitViewOptions: FIT_OPTIONS, maxZoom: 2, minZoom: 0.2, nodeOrigin: [0.5, 0.5], nodeTypes: NODE_TYPES, nodes: flowNodes, nodesConnectable: false, nodesDraggable: false, nodesFocusable: true, onNodeClick: (_event, node) => select(node.id), onPaneClick: () => { if (currentId !== null)
|
|
81
|
+
select(null); }, panOnDrag: isInteractive, panOnScroll: false, preventScrolling: isInteractive, proOptions: { hideAttribution: true }, zoomOnDoubleClick: false, zoomOnPinch: isInteractive, zoomOnScroll: isInteractive, children: [_jsx(Background, { className: "starci-core-flow-graph-background", gap: 1000, size: 0 }), controls ? _jsx(Controls, { "aria-label": `${label}: zoom`, className: "starci-core-flow-graph-controls", showInteractive: false }) : null, _jsx(Refit, { signature: signature })] }) }), _jsx("ul", { className: "starci-core-visually-hidden", "data-grammar-flow-fallback": "true", children: nodes.map((node) => _jsx("li", { children: labelFor(node) }, node.id)) })] })) }));
|
|
82
|
+
};
|
|
83
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/branch/FlowGraph/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EACH,UAAU,EACV,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,SAAS,EACT,mBAAmB,EACnB,YAAY,GAKf,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAsB,MAAM,OAAO,CAAA;AAC9E,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAA;AAC5D,OAAO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N,GACI,CACZ,CAAA;AACL,CAAC,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { FlowGraphEdge, FlowGraphNode } from "./types.js";
|
|
2
|
+
export type FlowGraphPoint = {
|
|
3
|
+
readonly x: number;
|
|
4
|
+
readonly y: number;
|
|
5
|
+
};
|
|
6
|
+
/** Distance of the first ring from the root, and the step between the rings after it. */
|
|
7
|
+
export declare const FLOW_GRAPH_FIRST_RING = 200;
|
|
8
|
+
export declare const FLOW_GRAPH_RING_STEP = 170;
|
|
9
|
+
/** The node the radial layout puts in the centre: the one flagged `isRoot`, else the first. */
|
|
10
|
+
export declare const flowGraphRoot: (nodes: ReadonlyArray<FlowGraphNode>) => FlowGraphNode | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Radial positions, node centres in graph units, the root at (0, 0). Direct children of the root sit evenly on
|
|
13
|
+
* the first ring; each deeper level sits on the next ring, spread over the wedge of its parent so a branch
|
|
14
|
+
* stays together. Nodes the root cannot reach through any edge (either direction) share an outer ring.
|
|
15
|
+
*/
|
|
16
|
+
export declare const radialPositions: (nodes: ReadonlyArray<FlowGraphNode>, edges: ReadonlyArray<FlowGraphEdge>) => ReadonlyMap<string, FlowGraphPoint>;
|
|
17
|
+
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../../src/core/branch/FlowGraph/layout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE9D,MAAM,MAAM,cAAc,GAAG;IAAE,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAEvE,yFAAyF;AACzF,eAAO,MAAM,qBAAqB,MAAM,CAAA;AACxC,eAAO,MAAM,oBAAoB,MAAM,CAAA;AAEvC,+FAA+F;AAC/F,eAAO,MAAM,aAAa,GAAI,OAAO,aAAa,CAAC,aAAa,CAAC,KAAG,aAAa,GAAG,SAC1B,CAAA;AAE1D;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAI,OAAO,aAAa,CAAC,aAAa,CAAC,EAAE,OAAO,aAAa,CAAC,aAAa,CAAC,KAAG,WAAW,CAAC,MAAM,EAAE,cAAc,CAqC5I,CAAA"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/** Distance of the first ring from the root, and the step between the rings after it. */
|
|
2
|
+
export const FLOW_GRAPH_FIRST_RING = 200;
|
|
3
|
+
export const FLOW_GRAPH_RING_STEP = 170;
|
|
4
|
+
/** The node the radial layout puts in the centre: the one flagged `isRoot`, else the first. */
|
|
5
|
+
export const flowGraphRoot = (nodes) => nodes.find((node) => node.isRoot === true) ?? nodes[0];
|
|
6
|
+
/**
|
|
7
|
+
* Radial positions, node centres in graph units, the root at (0, 0). Direct children of the root sit evenly on
|
|
8
|
+
* the first ring; each deeper level sits on the next ring, spread over the wedge of its parent so a branch
|
|
9
|
+
* stays together. Nodes the root cannot reach through any edge (either direction) share an outer ring.
|
|
10
|
+
*/
|
|
11
|
+
export const radialPositions = (nodes, edges) => {
|
|
12
|
+
const positions = new Map();
|
|
13
|
+
const root = flowGraphRoot(nodes);
|
|
14
|
+
if (root === undefined)
|
|
15
|
+
return positions;
|
|
16
|
+
const known = new Set(nodes.map((node) => node.id));
|
|
17
|
+
const neighbours = new Map();
|
|
18
|
+
for (const edge of edges) {
|
|
19
|
+
if (!known.has(edge.source) || !known.has(edge.target))
|
|
20
|
+
continue;
|
|
21
|
+
neighbours.set(edge.source, [...(neighbours.get(edge.source) ?? []), edge.target]);
|
|
22
|
+
neighbours.set(edge.target, [...(neighbours.get(edge.target) ?? []), edge.source]);
|
|
23
|
+
}
|
|
24
|
+
positions.set(root.id, { x: 0, y: 0 });
|
|
25
|
+
const radius = (depth) => FLOW_GRAPH_FIRST_RING + (depth - 1) * FLOW_GRAPH_RING_STEP;
|
|
26
|
+
const place = (id, depth, angle) => {
|
|
27
|
+
positions.set(id, { x: Math.cos(angle) * radius(depth), y: Math.sin(angle) * radius(depth) });
|
|
28
|
+
};
|
|
29
|
+
// A level at a time. The root shares the full circle out evenly; every other parent spreads its unplaced
|
|
30
|
+
// neighbours over its own wedge, centred on the direction it was placed in, so a branch stays together.
|
|
31
|
+
let level = [{ id: root.id, angle: -Math.PI / 2, wedge: Math.PI * 2 }];
|
|
32
|
+
let deepest = 0;
|
|
33
|
+
for (let depth = 1; level.length > 0; depth += 1) {
|
|
34
|
+
const next = [];
|
|
35
|
+
for (const parent of level) {
|
|
36
|
+
const children = (neighbours.get(parent.id) ?? []).filter((id, index, all) => !positions.has(id) && all.indexOf(id) === index);
|
|
37
|
+
const slot = parent.wedge / Math.max(children.length, 1);
|
|
38
|
+
children.forEach((id, index) => {
|
|
39
|
+
const angle = depth === 1 ? parent.angle + index * slot : parent.angle + (index - (children.length - 1) / 2) * slot;
|
|
40
|
+
place(id, depth, angle);
|
|
41
|
+
deepest = depth;
|
|
42
|
+
next.push({ id, angle, wedge: Math.min(slot, Math.PI * 0.9) });
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
level = next;
|
|
46
|
+
}
|
|
47
|
+
const orphans = nodes.filter((node) => !positions.has(node.id));
|
|
48
|
+
orphans.forEach((node, index) => place(node.id, deepest + 1, -Math.PI / 2 + (index * Math.PI * 2) / orphans.length));
|
|
49
|
+
return positions;
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../../../../src/core/branch/FlowGraph/layout.ts"],"names":[],"mappings":"AAIA,yFAAyF;AACzF,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAA;AACxC,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,CAAA;AAEvC,+FAA+F;AAC/F,MAAM,CAAC,MAAM,aAA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1
|
+
export type FlowGraphTone = "neutral" | "accent" | "success" | "warning" | "danger" | "muted";
|
|
2
|
+
export type FlowGraphNodeSize = "sm" | "md" | "lg";
|
|
3
|
+
export type FlowGraphHeight = "sm" | "md" | "lg";
|
|
4
|
+
export type FlowGraphLayout = "radial" | "manual";
|
|
5
|
+
export type FlowGraphNode = {
|
|
6
|
+
readonly id: string;
|
|
7
|
+
readonly label: string;
|
|
8
|
+
readonly description?: string;
|
|
9
|
+
readonly tone?: FlowGraphTone;
|
|
10
|
+
readonly size?: FlowGraphNodeSize;
|
|
11
|
+
readonly count?: number | string;
|
|
12
|
+
/** The centre of a radial layout. Defaults to the first node. */
|
|
13
|
+
readonly isRoot?: boolean;
|
|
14
|
+
/** A slot not filled yet: dashed outline, muted. */
|
|
15
|
+
readonly isPlaceholder?: boolean;
|
|
16
|
+
/** Where the node sits in `layout="manual"`, as its centre in graph units. */
|
|
17
|
+
readonly position?: {
|
|
18
|
+
readonly x: number;
|
|
19
|
+
readonly y: number;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export type FlowGraphEdge = {
|
|
23
|
+
readonly id: string;
|
|
24
|
+
readonly source: string;
|
|
25
|
+
readonly target: string;
|
|
26
|
+
readonly isPlaceholder?: boolean;
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/core/branch/FlowGraph/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAA;AAC7F,MAAM,MAAM,iBAAiB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;AAClD,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;AAChD,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAEjD,MAAM,MAAM,aAAa,GAAG;IACxB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,IAAI,CAAC,EAAE,aAAa,CAAA;IAC7B,QAAQ,CAAC,IAAI,CAAC,EAAE,iBAAiB,CAAA;IACjC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAChC,iEAAiE;IACjE,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAA;IACzB,oDAAoD;IACpD,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAA;IAChC,8EAA8E;IAC9E,QAAQ,CAAC,QAAQ,CAAC,EAAE;QAAE,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CACjE,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IACxB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAA;CACnC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/core/branch/FlowGraph/types.ts"],"names":[],"mappings":""}
|
|
@@ -20,7 +20,13 @@ type SurfaceListFrameProps = (LabelledSurfaceList | SelfNamedSurfaceList) & {
|
|
|
20
20
|
* above this surface so the page never skips a level.
|
|
21
21
|
*/
|
|
22
22
|
readonly headingLevel?: SurfaceHeadingLevel;
|
|
23
|
+
/**
|
|
24
|
+
* The collection is loading (knowledge STATE-8). With no `children` it draws `loadingRows` skeleton rows (ListRow
|
|
25
|
+
* anatomy, `aria-hidden`) and is `aria-busy`; real `children` win over the skeleton rows.
|
|
26
|
+
*/
|
|
23
27
|
readonly isLoading?: boolean;
|
|
28
|
+
/** How many skeleton rows a loading card draws (default 3, 1 to 12). */
|
|
29
|
+
readonly loadingRows?: number;
|
|
24
30
|
/**
|
|
25
31
|
* The collection reports outcomes: it squares its corners and paints each row's verdict edge.
|
|
26
32
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/branch/SurfaceListCard/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/branch/SurfaceListCard/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAEvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAA;AAEzE,OAAO,EAAwC,KAAK,mBAAmB,EAAE,MAAM,gCAAgC,CAAA;AAG/G,KAAK,mBAAmB,GAAG;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC9B,CAAA;AAED,KAAK,oBAAoB,GAAG;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAA;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAC7B,CAAA;AAED,KAAK,qBAAqB,GAAG,CAAC,mBAAmB,GAAG,oBAAoB,CAAC,GAAG;IACxE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;IAC7B,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAA;IAC9B,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,CAAA;IAC3B,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAA;IACjC;;;OAGG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,mBAAmB,CAAA;IAC3C;;;OAGG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAA;IAC5B,wEAAwE;IACxE,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAC7B;;;;;;;OAOG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAA;IAC5B,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAA;CAClC,CAAA;AAED,sEAAsE;AACtE,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAA;AAE9C,MAAM,MAAM,oBAAoB,GAAG,qBAAqB,GAAG;IACvD;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;IAC7B;;;OAGG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAA;CAC7B,CAAA;AAKD,eAAO,MAAM,eAAe,GAAI,OAAO,oBAAoB,gCAuF1D,CAAA"}
|
|
@@ -1,19 +1,26 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Children, useId } from "react";
|
|
4
|
+
import { ListRow } from "../../composite/ListRow/index.js";
|
|
4
5
|
import { VerticalScrollRegion } from "../../composite/VerticalScrollRegion/index.js";
|
|
5
6
|
import { DEFAULT_SURFACE_HEADING_LEVEL, Label } from "../../primitive/Label/index.js";
|
|
6
7
|
import { collectionClassName, listShellClassName, surfaceFactClassName, surfaceFooterClassName, surfaceLabelClassName, surfaceListClassName } from "./classNames.js";
|
|
8
|
+
const DEFAULT_LOADING_ROWS = 3;
|
|
9
|
+
const clampRows = (rows) => Math.min(12, Math.max(1, Math.floor(Number.isFinite(rows) ? rows : DEFAULT_LOADING_ROWS)));
|
|
7
10
|
export const SurfaceListCard = (props) => {
|
|
8
|
-
const { label, ariaLabel, children, empty, fact, labelEnd, labelHidden = false, footer, depth = "top", headingLevel = DEFAULT_SURFACE_HEADING_LEVEL, isLoading = false, isVerdict = false, isScrollable = false, } = props;
|
|
11
|
+
const { label, ariaLabel, children, empty, fact, labelEnd, labelHidden = false, footer, depth = "top", headingLevel = DEFAULT_SURFACE_HEADING_LEVEL, isLoading = false, loadingRows = DEFAULT_LOADING_ROWS, isVerdict = false, isScrollable = false, } = props;
|
|
9
12
|
const headingId = useId();
|
|
10
13
|
const accessibleName = ariaLabel ?? label;
|
|
11
|
-
const
|
|
14
|
+
const hasRows = Children.toArray(children).length > 0;
|
|
15
|
+
const isSkeleton = isLoading && !hasRows;
|
|
16
|
+
const isEmpty = !isSkeleton && empty !== undefined && !hasRows;
|
|
12
17
|
const collectionSemantics = isEmpty
|
|
13
18
|
? {}
|
|
14
19
|
: isScrollable
|
|
15
20
|
? { role: "list", ...(!labelHidden && label !== undefined ? { "aria-labelledby": headingId } : accessibleName === undefined ? {} : { "aria-label": accessibleName }) }
|
|
16
21
|
: { as: "ul", role: "list" };
|
|
17
|
-
return (_jsxs("section", { className: surfaceListClassName, "data-grammar-label-visibility": labelHidden ? "hidden" : "visible", "data-grammar-surface-list": "true", "data-component": "SurfaceListCard", "data-tier": "branch", "data-grammar-surface-depth": depth, children: [label === undefined || labelHidden ? null : (_jsxs("div", { className: surfaceLabelClassName, "data-contract": "GAP-2", "data-grammar-surface-label": "true", "data-grammar-label-end": labelEnd === undefined ? "false" : "true", children: [_jsx(Label, { as: `h${headingLevel}`, id: headingId, depth: depth, children: label }), fact === undefined ? null : (_jsx("span", { className: surfaceFactClassName, "data-grammar-surface-depth": depth, "data-contract": `TONE-2 ${depth === "nested" ? "FONT-1" : "FONT-2"}`, children: fact })), labelEnd === undefined ? null : _jsx("span", { className: "starci-core-surface-label-end", children: labelEnd })] })), _jsx("div", { "aria-label": labelHidden || label === undefined ? accessibleName : undefined, "aria-labelledby": !labelHidden && label !== undefined ? headingId : undefined, className: listShellClassName, "data-contract": "SURFACE-2 PADDING-0 OVERFLOW-2", "data-grammar-surface": "true", "data-grammar-scroll": isScrollable ? "contained" : "page", "data-grammar-surface-depth": depth, "data-surface-context": depth === "nested" ? "nested" : "page", "data-verdict": String(isVerdict), children: _jsx(VerticalScrollRegion, { ...collectionSemantics, className: collectionClassName, "data-grammar-collection": isVerdict ? "verdict" : "list", "data-grammar-list": "true", "data-loading": String(isLoading),
|
|
22
|
+
return (_jsxs("section", { className: surfaceListClassName, "data-grammar-label-visibility": labelHidden ? "hidden" : "visible", "data-grammar-surface-list": "true", "data-component": "SurfaceListCard", "data-tier": "branch", "data-grammar-surface-depth": depth, children: [label === undefined || labelHidden ? null : (_jsxs("div", { className: surfaceLabelClassName, "data-contract": "GAP-2", "data-grammar-surface-label": "true", "data-grammar-label-end": labelEnd === undefined ? "false" : "true", children: [_jsx(Label, { as: `h${headingLevel}`, id: headingId, depth: depth, children: label }), fact === undefined ? null : (_jsx("span", { className: surfaceFactClassName, "data-grammar-surface-depth": depth, "data-contract": `TONE-2 ${depth === "nested" ? "FONT-1" : "FONT-2"}`, children: fact })), labelEnd === undefined ? null : _jsx("span", { className: "starci-core-surface-label-end", children: labelEnd })] })), _jsx("div", { "aria-label": labelHidden || label === undefined ? accessibleName : undefined, "aria-labelledby": !labelHidden && label !== undefined ? headingId : undefined, className: listShellClassName, "data-contract": "SURFACE-2 PADDING-0 OVERFLOW-2", "data-grammar-surface": "true", "data-grammar-scroll": isScrollable ? "contained" : "page", "data-grammar-surface-depth": depth, "data-surface-context": depth === "nested" ? "nested" : "page", "data-verdict": String(isVerdict), children: _jsx(VerticalScrollRegion, { ...collectionSemantics, className: collectionClassName, "data-grammar-collection": isVerdict ? "verdict" : "list", "data-grammar-list": "true", "data-loading": String(isLoading), ...(isLoading ? { "aria-busy": true } : {}), isScrollable: isScrollable, children: isSkeleton
|
|
23
|
+
? Array.from({ length: clampRows(loadingRows) }, (_, index) => _jsx(ListRow, { isSkeleton: true, title: "", description: "", leading: "", actions: "" }, index))
|
|
24
|
+
: isEmpty ? empty : children }) }), footer === undefined ? null : (_jsx("div", { className: surfaceFooterClassName, "data-grammar-surface-footer": "true", children: footer }))] }));
|
|
18
25
|
};
|
|
19
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/branch/SurfaceListCard/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAkB,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/branch/SurfaceListCard/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAkB,MAAM,OAAO,CAAA;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAA;AAE1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAA;AACpF,OAAO,EAAE,6BAA6B,EAAE,KAAK,EAA4B,MAAM,gCAAgC,CAAA;AAC/G,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AA2DpK,MAAM,oBAAoB,GAAG,CAAC,CAAA;AAC9B,MAAM,SAAS,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAA;AAE9H,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAA2B,EAAE,EAAE;IAC3D,MAAM,EACF,KAAK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,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAC5C,YAAY,EAAE,YAAY,YAEzB,UAAU;wBACP,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,WAAW,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,KAAC,OAAO,IAAa,UAAU,QAAC,KAAK,EAAC,EAAE,EAAC,WAAW,EAAC,EAAE,EAAC,OAAO,EAAC,EAAE,EAAC,OAAO,EAAC,EAAE,IAA/D,KAAK,CAA6D,CAAC;wBAChJ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,GACb,GACrB,EACL,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAC3B,cAAK,SAAS,EAAE,sBAAsB,iCAA8B,MAAM,YAAE,MAAM,GAAO,CAC5F,IACK,CACb,CAAA;AACL,CAAC,CAAA"}
|
|
@@ -35,6 +35,11 @@ type StatStripLayout = {
|
|
|
35
35
|
export type DescriptionListProps = (PairLayout | StatStripLayout) & {
|
|
36
36
|
/** Draw a separator between pairs (between cells, for `stat-strip`). */
|
|
37
37
|
readonly isDivided?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Unresolved values (knowledge STATE-8): every `term` stays real text, each `description` (and a stat item meta)
|
|
40
|
+
* becomes a Skeleton text line so the cells keep their size, a stat `unit` is dropped, and the list is `aria-busy`.
|
|
41
|
+
*/
|
|
42
|
+
readonly isLoading?: boolean;
|
|
38
43
|
readonly className?: string;
|
|
39
44
|
};
|
|
40
45
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/composite/DescriptionList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAA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AAO,CAAA;IAC5B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC9B,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAAI,OAAO,oBAAoB,gCAsC1D,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { navigationClassName } from "../../navigationClassNames.js";
|
|
3
|
+
import { Skeleton } from "../../primitive/Skeleton/index.js";
|
|
3
4
|
import { IconTile } from "../../primitive/IconTile/index.js";
|
|
4
5
|
/**
|
|
5
6
|
* Term/value pairs (details, metadata, settings summaries) as a real `<dl>`.
|
|
@@ -8,10 +9,11 @@ import { IconTile } from "../../primitive/IconTile/index.js";
|
|
|
8
9
|
* second `<dd>` of the same term.
|
|
9
10
|
*/
|
|
10
11
|
export const DescriptionList = (props) => {
|
|
11
|
-
const { isDivided = true, className } = props;
|
|
12
|
+
const { isDivided = true, isLoading = false, className } = props;
|
|
13
|
+
const pending = _jsx(Skeleton, { shape: "text" });
|
|
12
14
|
const layout = props.layout ?? "columns";
|
|
13
|
-
return (_jsx("dl", { className: navigationClassName("starci-core-description-list", className), "data-component": "DescriptionList", "data-contract": "HIERARCHY-3 TRUTH-1", "data-tier": "composite", "data-grammar-description-layout": layout, "data-grammar-description-divided": isDivided ? "true" : "false", children: props.layout === "stat-strip"
|
|
14
|
-
? props.items.map((item) => (_jsxs("div", { className: "starci-core-description-pair", "data-grammar-description-pair": "true", children: [_jsxs("dt", { className: "starci-core-description-term starci-core-description-stat-term", children: [item.icon === undefined ? null : _jsx(IconTile, { source: item.icon, size: "sm", tone: "neutral" }), _jsx("span", { children: item.term })] }), _jsxs("dd", { className: "starci-core-description-value starci-core-description-figure", "data-contract": "FONT-5", children: [_jsx("span", { className: "starci-core-description-figure-value", children: item.description }), item.unit === undefined ? null : _jsx("span", { className: "starci-core-description-unit", children: item.unit })] }), item.meta === undefined ? null : (_jsx("dd", { className: "starci-core-description-meta", "data-contract": "FONT-2", children: item.meta }))] }, item.id)))
|
|
15
|
-
: props.items.map((item) => (_jsxs("div", { className: "starci-core-description-pair", "data-grammar-description-pair": "true", children: [_jsx("dt", { className: "starci-core-description-term", children: item.term }), _jsx("dd", { className: "starci-core-description-value", children: item.description })] }, item.id))) }));
|
|
15
|
+
return (_jsx("dl", { className: navigationClassName("starci-core-description-list", className), "data-component": "DescriptionList", "data-contract": "HIERARCHY-3 TRUTH-1", "data-tier": "composite", ...(isLoading ? { "aria-busy": true, "data-loading": "true" } : {}), "data-grammar-description-layout": layout, "data-grammar-description-divided": isDivided ? "true" : "false", children: props.layout === "stat-strip"
|
|
16
|
+
? props.items.map((item) => (_jsxs("div", { className: "starci-core-description-pair", "data-grammar-description-pair": "true", children: [_jsxs("dt", { className: "starci-core-description-term starci-core-description-stat-term", children: [item.icon === undefined ? null : _jsx(IconTile, { source: item.icon, size: "sm", tone: "neutral" }), _jsx("span", { children: item.term })] }), _jsxs("dd", { className: "starci-core-description-value starci-core-description-figure", "data-contract": "FONT-5", children: [_jsx("span", { className: "starci-core-description-figure-value", children: isLoading ? pending : item.description }), item.unit === undefined || isLoading ? null : _jsx("span", { className: "starci-core-description-unit", children: item.unit })] }), item.meta === undefined ? null : (_jsx("dd", { className: "starci-core-description-meta", "data-contract": "FONT-2", children: isLoading ? pending : item.meta }))] }, item.id)))
|
|
17
|
+
: props.items.map((item) => (_jsxs("div", { className: "starci-core-description-pair", "data-grammar-description-pair": "true", children: [_jsx("dt", { className: "starci-core-description-term", children: item.term }), _jsx("dd", { className: "starci-core-description-value", children: isLoading ? pending : item.description })] }, item.id))) }));
|
|
16
18
|
};
|
|
17
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/composite/DescriptionList/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAA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AM,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAC,IAAI,EAAC,IAAI,EAAC,SAAS,GAAG,EAC1F,yBAAO,IAAI,CAAC,IAAI,GAAQ,IACvB,EACL,cAAI,SAAS,EAAC,8DAA8D,mBAAe,QAAQ,aAC/F,eAAM,SAAS,EAAC,sCAAsC,YAAE,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,GAAQ,EACrG,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,eAAM,SAAS,EAAC,8BAA8B,YAAE,IAAI,CAAC,IAAI,GAAQ,IAC/G,EACJ,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAC9B,aAAI,SAAS,EAAC,8BAA8B,mBAAe,QAAQ,YAAE,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,GAAM,CAC7G,KAXK,IAAI,CAAC,EAAE,CAYX,CACT,CAAC;YACF,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACxB,eAAmB,SAAS,EAAC,8BAA8B,mCAA+B,MAAM,aAC5F,aAAI,SAAS,EAAC,8BAA8B,YAAE,IAAI,CAAC,IAAI,GAAM,EAC7D,aAAI,SAAS,EAAC,+BAA+B,YAAE,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,GAAM,KAFrF,IAAI,CAAC,EAAE,CAGX,CACT,CAAC,GACL,CACR,CAAA;AACL,CAAC,CAAA"}
|
|
@@ -18,6 +18,13 @@ export type ListRowProps = {
|
|
|
18
18
|
readonly state?: PresentationState;
|
|
19
19
|
/** In a verdict collection, the outcome this row reports (the collection's leading edge). */
|
|
20
20
|
readonly verdict?: RowVerdict;
|
|
21
|
+
/**
|
|
22
|
+
* Draw the row as inert geometry while its content is unresolved (knowledge STATE-8): `title` becomes a Skeleton
|
|
23
|
+
* text line, `description` a second line, `leading` a Skeleton circle and `actions` a small Skeleton footprint,
|
|
24
|
+
* each only if it is passed, so the loading row has the size of the loaded one. The row is `aria-hidden` and
|
|
25
|
+
* renders no interactive child, `badges` and `children` included; the collection owns `aria-busy`.
|
|
26
|
+
*/
|
|
27
|
+
readonly isSkeleton?: boolean;
|
|
21
28
|
};
|
|
22
29
|
/**
|
|
23
30
|
* One interactive row in a `SurfaceListCard` (or an app-owned `<ul>`): leading mark, title with its badges,
|
|
@@ -27,5 +34,5 @@ export type ListRowProps = {
|
|
|
27
34
|
* between consecutive rows - so static and interactive rows mix in one collection. It is an `<li>`: render it
|
|
28
35
|
* inside a list, never loose. The actions keep their own semantics; the row itself is not a target.
|
|
29
36
|
*/
|
|
30
|
-
export declare const ListRow: ({ title, description, leading, badges, actions, children, state, verdict }: ListRowProps) => import("react").JSX.Element;
|
|
37
|
+
export declare const ListRow: ({ title, description, leading, badges, actions, children, state, verdict, isSkeleton }: ListRowProps) => import("react").JSX.Element;
|
|
31
38
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/composite/ListRow/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/composite/ListRow/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AACrE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAE5D,MAAM,MAAM,YAAY,GAAG;IACvB,yEAAyE;IACzE,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAA;IACzB,gFAAgF;IAChF,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,CAAA;IAChC,wIAAwI;IACxI,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,CAAA;IAC5B,sGAAsG;IACtG,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,CAAA;IAC3B,uGAAuG;IACvG,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,CAAA;IAC5B,6GAA6G;IAC7G,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;IAC7B,oGAAoG;IACpG,QAAQ,CAAC,KAAK,CAAC,EAAE,iBAAiB,CAAA;IAClC,6FAA6F;IAC7F,QAAQ,CAAC,OAAO,CAAC,EAAE,UAAU,CAAA;IAC7B;;;;;OAKG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;CAChC,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,OAAO,GAAI,wFAA4G,YAAY,gCAmD/I,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { staticRowClassName } from "../../classNames.js";
|
|
3
|
+
import { Skeleton } from "../../primitive/Skeleton/index.js";
|
|
3
4
|
import { treatmentFor } from "../../state.js";
|
|
4
5
|
/**
|
|
5
6
|
* One interactive row in a `SurfaceListCard` (or an app-owned `<ul>`): leading mark, title with its badges,
|
|
@@ -9,8 +10,11 @@ import { treatmentFor } from "../../state.js";
|
|
|
9
10
|
* between consecutive rows - so static and interactive rows mix in one collection. It is an `<li>`: render it
|
|
10
11
|
* inside a list, never loose. The actions keep their own semantics; the row itself is not a target.
|
|
11
12
|
*/
|
|
12
|
-
export const ListRow = ({ title, description, leading, badges, actions, children, state = "neutral", verdict }) => {
|
|
13
|
+
export const ListRow = ({ title, description, leading, badges, actions, children, state = "neutral", verdict, isSkeleton = false }) => {
|
|
13
14
|
const treatment = treatmentFor(state);
|
|
15
|
+
if (isSkeleton) {
|
|
16
|
+
return (_jsxs("li", { "aria-hidden": "true", className: `${staticRowClassName} starci-core-list-row`, "data-grammar-row": "true", "data-component": "ListRow", "data-tier": "composite", "data-grammar-skeleton": "true", "data-grammar-state": "neutral", "data-grammar-treatment": treatmentFor("neutral").tone, "data-grammar-leading": leading == null ? "false" : "true", "data-grammar-actions": actions == null ? "false" : "true", "data-contract": "GAP-3 PADDING-4 BOUNDARY-3 STATE-8", children: [leading == null ? null : _jsx("span", { className: "starci-core-list-row-leading", children: _jsx(Skeleton, { shape: "circle", size: "md" }) }), _jsxs("span", { className: "starci-core-list-row-copy", "data-contract": "GAP-1", children: [_jsx("span", { className: "starci-core-list-row-title", children: _jsx("span", { className: "starci-core-list-row-name", children: _jsx(Skeleton, { shape: "text" }) }) }), description == null ? null : _jsx("span", { className: "starci-core-list-row-description", children: _jsx(Skeleton, { shape: "text" }) })] }), actions == null ? null : _jsx("span", { className: "starci-core-list-row-actions", children: _jsx("span", { className: "starci-core-list-row-skeleton-action", children: _jsx(Skeleton, { shape: "rect" }) }) })] }));
|
|
17
|
+
}
|
|
14
18
|
return (_jsxs("li", { className: `${staticRowClassName} starci-core-list-row`, "data-grammar-row": "true", "data-component": "ListRow", "data-tier": "composite", "data-grammar-state": state, "data-grammar-treatment": treatment.tone, "data-grammar-leading": leading == null ? "false" : "true", "data-grammar-actions": actions == null ? "false" : "true", ...(verdict === undefined ? {} : { "data-verdict": verdict }), "data-contract": "GAP-3 PADDING-4 BOUNDARY-3", children: [leading == null ? null : _jsx("span", { className: "starci-core-list-row-leading", children: leading }), _jsxs("span", { className: "starci-core-list-row-copy", "data-contract": "GAP-1", children: [_jsxs("span", { className: "starci-core-list-row-title", children: [_jsx("span", { className: "starci-core-list-row-name", children: title }), badges == null ? null : _jsx("span", { className: "starci-core-list-row-badges", "data-contract": "GAP-2", children: badges })] }), description == null ? null : _jsx("span", { className: "starci-core-list-row-description", "data-contract": "TONE-2 FONT-2", children: description })] }), actions == null ? null : _jsx("span", { className: "starci-core-list-row-actions", "data-contract": "GAP-2", children: actions }), children == null ? null : _jsx("div", { className: "starci-core-list-row-detail", "data-contract": "GAP-3", children: children })] }));
|
|
15
19
|
};
|
|
16
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/composite/ListRow/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,EAAE,YAAY,EAA0B,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/composite/ListRow/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAA;AAC5D,OAAO,EAAE,YAAY,EAA0B,MAAM,gBAAgB,CAAA;AA6BrE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,GAAG,SAAS,EAAE,OAAO,EAAE,UAAU,GAAG,KAAK,EAAgB,EAAE,EAAE;IAChJ,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,CAAA;IACrC,IAAI,UAAU,EAAE,CAAC;QACb,OAAO,CACH,6BACgB,MAAM,EAClB,SAAS,EAAE,GAAG,kBAAkB,uBAAuB,sBACtC,MAAM,oBACR,SAAS,eACd,WAAW,2BACC,MAAM,wBACT,SAAS,4BACJ,YAAY,CAAC,SAAS,CAAC,CAAC,IAAI,0BAC9B,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,0BAClC,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,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AAM,SAAS,EAAC,8BAA8B,YAAE,OAAO,GAAQ,EACzF,gBAAM,SAAS,EAAC,2BAA2B,mBAAe,OAAO,aAC7D,gBAAM,SAAS,EAAC,4BAA4B,aACxC,eAAM,SAAS,EAAC,2BAA2B,YAAE,KAAK,GAAQ,EACzD,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,eAAM,SAAS,EAAC,6BAA6B,mBAAe,OAAO,YAAE,MAAM,GAAQ,IACzG,EACN,WAAW,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,eAAM,SAAS,EAAC,kCAAkC,mBAAe,eAAe,YAAE,WAAW,GAAQ,IAChI,EACN,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,eAAM,SAAS,EAAC,8BAA8B,mBAAe,OAAO,YAAE,OAAO,GAAQ,EAC9G,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,cAAK,SAAS,EAAC,6BAA6B,mBAAe,OAAO,YAAE,QAAQ,GAAO,IAC7G,CACR,CAAA;AACL,CAAC,CAAA"}
|
|
@@ -371,6 +371,20 @@
|
|
|
371
371
|
}
|
|
372
372
|
|
|
373
373
|
/* Reduced motion removes family transforms and transitions. */
|
|
374
|
+
/*
|
|
375
|
+
* FlowGraph: the family frame (ink outline, small hard shadow) round the canvas, and the selected node in the
|
|
376
|
+
* ink outline with its hard shadow; the edges, tints and ring stay on the Common tokens.
|
|
377
|
+
*/
|
|
378
|
+
.grammar-common-root[data-grammar-family="offset-pop"] [data-component="FlowGraph"] {
|
|
379
|
+
border: var(--offset-pop-outline-width) solid var(--offset-pop-ink);
|
|
380
|
+
box-shadow: 0.125rem 0.1875rem 0 var(--offset-pop-shadow-ink);
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
.grammar-common-root[data-grammar-family="offset-pop"] [data-component="FlowGraph"] [data-grammar-selected="true"] {
|
|
384
|
+
border-color: var(--offset-pop-ink);
|
|
385
|
+
box-shadow: 0.125rem 0.1875rem 0 var(--offset-pop-shadow-ink);
|
|
386
|
+
}
|
|
387
|
+
|
|
374
388
|
@media (prefers-reduced-motion: reduce) {
|
|
375
389
|
.grammar-common-root[data-grammar-family="offset-pop"] [data-component="Disclosure"] *,
|
|
376
390
|
.grammar-common-root[data-grammar-family="offset-pop"] [data-component="Accordion"] *,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@starci/grammar",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.5",
|
|
4
4
|
"description": "Reusable StarCi React components, compositions, and packaged visual DNA.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"starci",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"scripts": {
|
|
60
60
|
"build": "node scripts/clean.mjs && tsc -p tsconfig.build.json && node scripts/copy-css.mjs && node scripts/build-stamp.mjs",
|
|
61
61
|
"typecheck": "tsc -p tsconfig.build.json --noEmit && tsc -p tsconfig.stories.json",
|
|
62
|
-
"test": "npm run build && node --test src/common/index.spec.mjs src/core/index.spec.mjs src/offset-pop/index.spec.mjs src/package-boundary.spec.mjs && vitest run --config vitest.config.ts src/shipped-geometry.spec.ts src/core/shipped-claims.spec.tsx src/common/conformance.spec.ts src/common/styles.spec.ts src/core/family.spec.tsx src/core/styles.spec.ts src/core/surface-card-family.spec.tsx src/core/scrollable-surfaces.spec.tsx src/core/primitive/Badge/index.spec.tsx src/core/primitive/Button/index.spec.tsx src/core/primitive/Divider/index.spec.tsx src/core/primitive/Region/index.spec.tsx src/core/primitive/NavLandmark/index.spec.tsx src/core/primitive/List/index.spec.tsx src/core/primitive/Heading/index.spec.tsx src/core/primitive/Icon/index.spec.tsx src/core/primitive/IconButton/index.spec.tsx src/core/primitive/IconTile/index.spec.tsx src/core/primitive/Input/index.spec.tsx src/core/primitive/Input/copyable.spec.tsx src/core/composite/ChatBubble/index.spec.tsx src/core/composite/FillViewport/index.spec.tsx src/core/primitive/IconButton/badge.spec.tsx src/core/primitive/Textarea/mentions.spec.tsx src/core/v090.spec.tsx src/core/v093.spec.tsx src/core/v094.spec.tsx src/core/primitive/PressableField/index.spec.tsx src/core/primitive/Progress/index.spec.tsx src/core/primitive/Text/index.spec.tsx src/core/primitive/TextAction/index.spec.tsx src/core/primitive/Label/index.spec.tsx src/core/primitive/RankArtwork/index.spec.tsx src/core/composite/EmptyNotice/index.spec.tsx src/core/composite/ListRow/index.spec.tsx src/core/branch/Tabs/index.spec.tsx src/core/branch/Subnav/index.spec.tsx src/core/branch/Subnav/styles.spec.ts src/core/branch/Tooltip/index.spec.tsx src/core/composition/NavigationFeatureNav/index.spec.tsx src/core/composition/NavigationFeatureNav/styles.spec.ts src/core/composition/Sidebar/index.spec.tsx src/core/composition/Sidebar/styles.spec.ts src/core/composition/collapse.spec.tsx src/core/composition/WorkspaceShell/index.spec.tsx src/core/composition/ChatWorkspace/index.spec.tsx src/heritage/index.spec.tsx src/heritage/styles.spec.ts src/offset-pop/index.spec.tsx src/offset-pop/render.spec.tsx src/offset-pop/styles.spec.ts src/offset-pop/family.spec.tsx src/offset-pop/shipped-claims.spec.tsx src/offset-pop/surface-card-family.spec.tsx src/offset-pop/scrollable-surfaces.spec.tsx src/offset-pop/conformance.spec.ts src/core/branch/Accordion/index.spec.tsx src/core/branch/AlertDialog/index.spec.tsx src/core/branch/Calendar/index.spec.tsx src/core/branch/ComboBox/index.spec.tsx src/core/branch/DataTable/index.spec.tsx src/core/branch/DatePicker/index.spec.tsx src/core/branch/DateRangePicker/index.spec.tsx src/core/branch/Dialog/index.spec.tsx src/core/branch/Disclosure/index.spec.tsx src/core/branch/Drawer/index.spec.tsx src/core/branch/DropdownMenu/index.spec.tsx src/core/branch/ListBox/index.spec.tsx src/core/branch/Popover/index.spec.tsx src/core/branch/Select/index.spec.tsx src/core/branch/Toast/index.spec.tsx src/core/composite/Alert/index.spec.tsx src/core/composite/AvatarGroup/index.spec.tsx src/core/composite/Breadcrumbs/index.spec.tsx src/core/composite/ButtonGroup/index.spec.tsx src/core/composite/CheckboxGroup/index.spec.tsx src/core/composite/DescriptionList/index.spec.tsx src/core/composite/Fieldset/index.spec.tsx src/core/composite/Form/index.spec.tsx src/core/composite/Pagination/index.spec.tsx src/core/composite/RadioGroup/index.spec.tsx src/core/composite/SegmentedControl/index.spec.tsx src/core/composite/Stepper/index.spec.tsx src/core/composite/TagGroup/index.spec.tsx src/core/composite/Timeline/index.spec.tsx src/core/composition/BottomNav/index.spec.tsx src/core/composition/Footer/index.spec.tsx src/core/composition/TopBar/index.spec.tsx src/core/primitive/Avatar/index.spec.tsx src/core/primitive/Checkbox/index.spec.tsx src/core/primitive/CloseButton/index.spec.tsx src/core/primitive/DateField/index.spec.tsx src/core/primitive/Field/index.spec.tsx src/core/primitive/FileDropzone/index.spec.tsx src/core/primitive/Image/index.spec.tsx src/core/primitive/Kbd/index.spec.tsx src/core/primitive/Link/index.spec.tsx src/core/primitive/Meter/index.spec.tsx src/core/primitive/NumberField/index.spec.tsx src/core/primitive/ProgressCircle/index.spec.tsx src/core/primitive/Rating/index.spec.tsx src/core/primitive/SearchField/index.spec.tsx src/core/primitive/Skeleton/index.spec.tsx src/core/primitive/Slider/index.spec.tsx src/core/primitive/Spinner/index.spec.tsx src/core/primitive/Switch/index.spec.tsx src/core/primitive/Textarea/index.spec.tsx src/core/primitive/TimeField/index.spec.tsx src/offset-pop/components-forms.spec.ts src/offset-pop/components-navigation.spec.ts src/offset-pop/components-overlays.spec.ts src/core/branch/SurfaceCard/index.spec.tsx src/core/branch/SurfaceListCard/index.spec.tsx src/core/branch/SurfaceAccordionCard/index.spec.tsx src/core/branch/Rail/index.spec.tsx src/core/branch/MarkdownArticle/index.spec.tsx src/core/composite/VerticalScrollRegion/index.spec.tsx src/core/primitive/SectionHeader/index.spec.tsx src/core/primitive/PinnedActionBar/index.spec.tsx src/core/branch/SurfaceCard/ink.spec.ts src/core/data-component.spec.tsx src/core/OtpInput.spec.tsx src/core/field-variant.spec.tsx src/stories/catalog.spec.ts",
|
|
62
|
+
"test": "npm run build && node --test src/common/index.spec.mjs src/core/index.spec.mjs src/offset-pop/index.spec.mjs src/package-boundary.spec.mjs && vitest run --config vitest.config.ts src/shipped-geometry.spec.ts src/core/shipped-claims.spec.tsx src/common/conformance.spec.ts src/common/styles.spec.ts src/core/family.spec.tsx src/core/styles.spec.ts src/core/surface-card-family.spec.tsx src/core/scrollable-surfaces.spec.tsx src/core/primitive/Badge/index.spec.tsx src/core/primitive/Button/index.spec.tsx src/core/primitive/Divider/index.spec.tsx src/core/primitive/Region/index.spec.tsx src/core/primitive/NavLandmark/index.spec.tsx src/core/primitive/List/index.spec.tsx src/core/primitive/Heading/index.spec.tsx src/core/primitive/Icon/index.spec.tsx src/core/primitive/IconButton/index.spec.tsx src/core/primitive/IconTile/index.spec.tsx src/core/primitive/Input/index.spec.tsx src/core/primitive/Input/copyable.spec.tsx src/core/composite/ChatBubble/index.spec.tsx src/core/composite/FillViewport/index.spec.tsx src/core/primitive/IconButton/badge.spec.tsx src/core/primitive/Textarea/mentions.spec.tsx src/core/v090.spec.tsx src/core/v093.spec.tsx src/core/v094.spec.tsx src/core/v095.spec.tsx src/core/loading.spec.tsx src/core/branch/FlowGraph/index.spec.tsx src/core/primitive/PressableField/index.spec.tsx src/core/primitive/Progress/index.spec.tsx src/core/primitive/Text/index.spec.tsx src/core/primitive/TextAction/index.spec.tsx src/core/primitive/Label/index.spec.tsx src/core/primitive/RankArtwork/index.spec.tsx src/core/composite/EmptyNotice/index.spec.tsx src/core/composite/ListRow/index.spec.tsx src/core/branch/Tabs/index.spec.tsx src/core/branch/Subnav/index.spec.tsx src/core/branch/Subnav/styles.spec.ts src/core/branch/Tooltip/index.spec.tsx src/core/composition/NavigationFeatureNav/index.spec.tsx src/core/composition/NavigationFeatureNav/styles.spec.ts src/core/composition/Sidebar/index.spec.tsx src/core/composition/Sidebar/styles.spec.ts src/core/composition/collapse.spec.tsx src/core/composition/WorkspaceShell/index.spec.tsx src/core/composition/ChatWorkspace/index.spec.tsx src/heritage/index.spec.tsx src/heritage/styles.spec.ts src/offset-pop/index.spec.tsx src/offset-pop/render.spec.tsx src/offset-pop/styles.spec.ts src/offset-pop/family.spec.tsx src/offset-pop/shipped-claims.spec.tsx src/offset-pop/surface-card-family.spec.tsx src/offset-pop/scrollable-surfaces.spec.tsx src/offset-pop/conformance.spec.ts src/core/branch/Accordion/index.spec.tsx src/core/branch/AlertDialog/index.spec.tsx src/core/branch/Calendar/index.spec.tsx src/core/branch/ComboBox/index.spec.tsx src/core/branch/DataTable/index.spec.tsx src/core/branch/DatePicker/index.spec.tsx src/core/branch/DateRangePicker/index.spec.tsx src/core/branch/Dialog/index.spec.tsx src/core/branch/Disclosure/index.spec.tsx src/core/branch/Drawer/index.spec.tsx src/core/branch/DropdownMenu/index.spec.tsx src/core/branch/ListBox/index.spec.tsx src/core/branch/Popover/index.spec.tsx src/core/branch/Select/index.spec.tsx src/core/branch/Toast/index.spec.tsx src/core/composite/Alert/index.spec.tsx src/core/composite/AvatarGroup/index.spec.tsx src/core/composite/Breadcrumbs/index.spec.tsx src/core/composite/ButtonGroup/index.spec.tsx src/core/composite/CheckboxGroup/index.spec.tsx src/core/composite/DescriptionList/index.spec.tsx src/core/composite/Fieldset/index.spec.tsx src/core/composite/Form/index.spec.tsx src/core/composite/Pagination/index.spec.tsx src/core/composite/RadioGroup/index.spec.tsx src/core/composite/SegmentedControl/index.spec.tsx src/core/composite/Stepper/index.spec.tsx src/core/composite/TagGroup/index.spec.tsx src/core/composite/Timeline/index.spec.tsx src/core/composition/BottomNav/index.spec.tsx src/core/composition/Footer/index.spec.tsx src/core/composition/TopBar/index.spec.tsx src/core/primitive/Avatar/index.spec.tsx src/core/primitive/Checkbox/index.spec.tsx src/core/primitive/CloseButton/index.spec.tsx src/core/primitive/DateField/index.spec.tsx src/core/primitive/Field/index.spec.tsx src/core/primitive/FileDropzone/index.spec.tsx src/core/primitive/Image/index.spec.tsx src/core/primitive/Kbd/index.spec.tsx src/core/primitive/Link/index.spec.tsx src/core/primitive/Meter/index.spec.tsx src/core/primitive/NumberField/index.spec.tsx src/core/primitive/ProgressCircle/index.spec.tsx src/core/primitive/Rating/index.spec.tsx src/core/primitive/SearchField/index.spec.tsx src/core/primitive/Skeleton/index.spec.tsx src/core/primitive/Slider/index.spec.tsx src/core/primitive/Spinner/index.spec.tsx src/core/primitive/Switch/index.spec.tsx src/core/primitive/Textarea/index.spec.tsx src/core/primitive/TimeField/index.spec.tsx src/offset-pop/components-forms.spec.ts src/offset-pop/components-navigation.spec.ts src/offset-pop/components-overlays.spec.ts src/core/branch/SurfaceCard/index.spec.tsx src/core/branch/SurfaceListCard/index.spec.tsx src/core/branch/SurfaceAccordionCard/index.spec.tsx src/core/branch/Rail/index.spec.tsx src/core/branch/MarkdownArticle/index.spec.tsx src/core/composite/VerticalScrollRegion/index.spec.tsx src/core/primitive/SectionHeader/index.spec.tsx src/core/primitive/PinnedActionBar/index.spec.tsx src/core/branch/SurfaceCard/ink.spec.ts src/core/data-component.spec.tsx src/core/OtpInput.spec.tsx src/core/field-variant.spec.tsx src/stories/catalog.spec.ts",
|
|
63
63
|
"test:a11y": "vitest run --config vitest.a11y.config.ts",
|
|
64
64
|
"pack:check": "npm run build && node --test src/package-boundary.spec.mjs",
|
|
65
65
|
"prepack": "npm run typecheck && npm test",
|
|
@@ -71,7 +71,8 @@
|
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
73
|
"react": ">=18",
|
|
74
|
-
"@heroui/react": ">=3.2.0"
|
|
74
|
+
"@heroui/react": ">=3.2.0",
|
|
75
|
+
"@xyflow/react": "^12.11.6"
|
|
75
76
|
},
|
|
76
77
|
"devDependencies": {
|
|
77
78
|
"@types/react": "^19.0.0",
|
|
@@ -94,7 +95,8 @@
|
|
|
94
95
|
"react-dom": "^19.0.0",
|
|
95
96
|
"@internationalized/date": "^3.12.4",
|
|
96
97
|
"vite": "^8.3.0",
|
|
97
|
-
"@types/node": "^22.0.0"
|
|
98
|
+
"@types/node": "^22.0.0",
|
|
99
|
+
"@xyflow/react": "12.11.6"
|
|
98
100
|
},
|
|
99
101
|
"license": "MIT",
|
|
100
102
|
"publishConfig": {
|