@kerfjs/ui 5.0.0-beta.32 → 5.0.0-beta.34
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 +8 -1
- package/ai/component-catalog-v2-overrides.json +10 -0
- package/ai/component-catalog-v2.json +78 -2
- package/ai/component-catalog.json +90 -3
- package/ai/public-api-signatures-v1.md +8 -3
- package/ai/skill.md +11 -2
- package/ai/webawesome-jsx-signatures-v1.md +1 -1
- package/dist/browser/row.js +3 -0
- package/dist/catalog.js +2 -1
- package/dist/catalog.js.map +1 -1
- package/dist/{chunk-RL6COPKF.js → chunk-7JQAQWVC.js} +6 -1
- package/dist/chunk-7JQAQWVC.js.map +1 -0
- package/dist/chunk-OKRCKIVO.js +39 -0
- package/dist/chunk-OKRCKIVO.js.map +1 -0
- package/dist/chunk-R3EBGEAW.js +46 -0
- package/dist/chunk-R3EBGEAW.js.map +1 -0
- package/dist/flex-alignment-CF8NLj7i.d.ts +4 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +6 -4
- package/dist/list.d.ts +7 -2
- package/dist/list.js +2 -1
- package/dist/row.d.ts +21 -0
- package/dist/row.js +5 -0
- package/dist/row.js.map +1 -0
- package/dist/select-register.js +126 -1
- package/dist/select-register.js.map +1 -1
- package/dist/styles/list.css +29 -0
- package/dist/styles/row.css +45 -0
- package/dist/styles/styles.css +1 -0
- package/docs/accessibility.md +13 -0
- package/docs/component-selection.md +6 -4
- package/docs/layout.md +19 -1
- package/llms.txt +8 -2
- package/package.json +7 -1
- package/dist/chunk-RL6COPKF.js.map +0 -1
package/README.md
CHANGED
|
@@ -117,7 +117,7 @@ Do not concatenate a count into `label` or pass a numeric `badge`; the mutually
|
|
|
117
117
|
exclusive legacy `badge` slot remains available for non-count `SafeHtml` such
|
|
118
118
|
as a `New` marker.
|
|
119
119
|
|
|
120
|
-
`
|
|
120
|
+
`Row.gap` and `List.gap` accept a direct spacing name such as
|
|
121
121
|
`gap="xs"` or `gap="m"`, or a branded `CssLength`. Import `space`, `rem`, `em`,
|
|
122
122
|
`px`, `pct`, `lengthVar`, `plus`, and `calc` from the CSS-free
|
|
123
123
|
`@kerfjs/ui/css-values` subpath when a named step is not enough. `plus` returns
|
|
@@ -125,6 +125,12 @@ an incomplete expression, so wrap it with `calc` before passing it to a prop.
|
|
|
125
125
|
Raw CSS strings are deliberately rejected; the opaque brands catch authoring
|
|
126
126
|
mistakes but are not sanitizers.
|
|
127
127
|
|
|
128
|
+
Use `Row` for horizontal flex composition and `List` for vertical composition.
|
|
129
|
+
Both accept `hAlign` (`left`, `center`, `right`, `full`) and `vAlign` (`top`,
|
|
130
|
+
`middle`, `bottom`, `full`), plus their documented short/CSS aliases. `Row`
|
|
131
|
+
defaults to left/full alignment, the `xs` gap, and `wrap={false}`; List keeps
|
|
132
|
+
its existing full/top alignment and zero-gap defaults.
|
|
133
|
+
|
|
128
134
|
The same property-specific boundary applies beyond spacing: use `flex()` (or a
|
|
129
135
|
finite keyword) for `List.flex`; length builders and intrinsic-size keywords for
|
|
130
136
|
`Skeleton.width`/`height`; length builders for `Skeleton.radius`; and
|
|
@@ -144,6 +150,7 @@ interchangeable. `ListItem` and `ListActionRow` deliberately expose no raw
|
|
|
144
150
|
| `FloatingToolbar` | `@kerfjs/ui/floating-toolbar` | `@kerfjs/ui/floating-toolbar.css` |
|
|
145
151
|
| `ToolbarText` | `@kerfjs/ui/toolbar-text` | `@kerfjs/ui/toolbar-text.css` |
|
|
146
152
|
| `List` | `@kerfjs/ui/list` | `@kerfjs/ui/list.css` |
|
|
153
|
+
| `Row` | `@kerfjs/ui/row` | `@kerfjs/ui/row.css` |
|
|
147
154
|
| Typed CSS dimension builders | `@kerfjs/ui/css-values` | — |
|
|
148
155
|
| `ListActionRow` | `@kerfjs/ui/list-action-row` | `@kerfjs/ui/list-action-row.css` |
|
|
149
156
|
| `ListItem` | `@kerfjs/ui/list-item` | `@kerfjs/ui/list-item.css` |
|
|
@@ -98,6 +98,16 @@
|
|
|
98
98
|
"requiredConcepts": ["control"]
|
|
99
99
|
}
|
|
100
100
|
},
|
|
101
|
+
"@kerfjs/ui:row": {
|
|
102
|
+
"_source": "docs/layout.md#row-and-list-alignment",
|
|
103
|
+
"contexts": ["application-ui", "horizontal-layout"],
|
|
104
|
+
"children": {
|
|
105
|
+
"mode": "any",
|
|
106
|
+
"concepts": [],
|
|
107
|
+
"requiredConcepts": []
|
|
108
|
+
},
|
|
109
|
+
"zones": []
|
|
110
|
+
},
|
|
101
111
|
"@kerfjs/ui:list": {
|
|
102
112
|
"_source": "docs/component-selection.md#problem-to-component-matrix",
|
|
103
113
|
"contexts": ["application-ui", "navigation-list", "vertical-layout"],
|
|
@@ -1401,6 +1401,81 @@
|
|
|
1401
1401
|
"composition": "generated-permissive-default"
|
|
1402
1402
|
}
|
|
1403
1403
|
},
|
|
1404
|
+
{
|
|
1405
|
+
"key": "@kerfjs/ui:row",
|
|
1406
|
+
"package": "@kerfjs/ui",
|
|
1407
|
+
"id": "row",
|
|
1408
|
+
"name": "Row",
|
|
1409
|
+
"kind": "component",
|
|
1410
|
+
"source": "kerf",
|
|
1411
|
+
"parents": { "mode": "any", "entries": [] },
|
|
1412
|
+
"contexts": ["application-ui", "horizontal-layout"],
|
|
1413
|
+
"zones": [],
|
|
1414
|
+
"children": { "mode": "any", "concepts": [], "requiredConcepts": [] },
|
|
1415
|
+
"state": [
|
|
1416
|
+
{
|
|
1417
|
+
"id": "child semantics and content",
|
|
1418
|
+
"owner": "application",
|
|
1419
|
+
"required": false
|
|
1420
|
+
},
|
|
1421
|
+
{
|
|
1422
|
+
"id": "alignment and wrapping policy",
|
|
1423
|
+
"owner": "application",
|
|
1424
|
+
"required": false
|
|
1425
|
+
},
|
|
1426
|
+
{
|
|
1427
|
+
"id": "typed gap overrides",
|
|
1428
|
+
"owner": "application",
|
|
1429
|
+
"required": false
|
|
1430
|
+
}
|
|
1431
|
+
],
|
|
1432
|
+
"wiring": { "required": false, "helpers": [], "obligations": [] },
|
|
1433
|
+
"responsive": { "owner": "not-applicable", "behaviors": [] },
|
|
1434
|
+
"layout": {
|
|
1435
|
+
"roles": ["structure"],
|
|
1436
|
+
"geometry": {
|
|
1437
|
+
"margin": "none",
|
|
1438
|
+
"border": "none",
|
|
1439
|
+
"padding": "none",
|
|
1440
|
+
"notes": [
|
|
1441
|
+
"Row adds no margin, border, or padding; it owns only flex alignment, wrapping, and the gap between children."
|
|
1442
|
+
]
|
|
1443
|
+
}
|
|
1444
|
+
},
|
|
1445
|
+
"accessibility": {
|
|
1446
|
+
"obligations": [
|
|
1447
|
+
"Row adds layout only and no grouping role; children retain responsibility for native or ARIA semantics.",
|
|
1448
|
+
"Wrapping must preserve a readable source and focus order."
|
|
1449
|
+
]
|
|
1450
|
+
},
|
|
1451
|
+
"cssValueProps": [
|
|
1452
|
+
{
|
|
1453
|
+
"path": "gap",
|
|
1454
|
+
"grammar": "length",
|
|
1455
|
+
"helpers": ["px", "rem", "em", "pct", "space", "lengthVar", "calc"],
|
|
1456
|
+
"nonStandaloneHelpers": ["plus"],
|
|
1457
|
+
"shorthands": ["none", "2xs", "xs", "s", "m", "l", "xl"],
|
|
1458
|
+
"canonicalShorthands": ["none", "2xs", "xs", "m", "l"],
|
|
1459
|
+
"exceptionalShorthands": ["s", "xl"],
|
|
1460
|
+
"rawPolicy": "forbid",
|
|
1461
|
+
"examples": [
|
|
1462
|
+
"gap=\"xs\"",
|
|
1463
|
+
"gap={space(\"m\")}",
|
|
1464
|
+
"gap={calc(plus(rem(0.25), pct(10)))}"
|
|
1465
|
+
]
|
|
1466
|
+
}
|
|
1467
|
+
],
|
|
1468
|
+
"boundaries": {
|
|
1469
|
+
"rootClass": "kui-row",
|
|
1470
|
+
"publicClasses": ["kui-row"],
|
|
1471
|
+
"publicTokens": ["--kui-layout-item-gap", "--kui-row-gap"]
|
|
1472
|
+
},
|
|
1473
|
+
"diagnostics": [],
|
|
1474
|
+
"provenance": {
|
|
1475
|
+
"selection": "ai/component-catalog.json",
|
|
1476
|
+
"composition": "docs/layout.md#row-and-list-alignment"
|
|
1477
|
+
}
|
|
1478
|
+
},
|
|
1404
1479
|
{
|
|
1405
1480
|
"key": "@kerfjs/ui:list",
|
|
1406
1481
|
"package": "@kerfjs/ui",
|
|
@@ -1424,7 +1499,7 @@
|
|
|
1424
1499
|
"required": false
|
|
1425
1500
|
},
|
|
1426
1501
|
{
|
|
1427
|
-
"id": "typed gap, flex, and divider choices",
|
|
1502
|
+
"id": "typed gap, flex, alignment, and divider choices",
|
|
1428
1503
|
"owner": "application",
|
|
1429
1504
|
"required": false
|
|
1430
1505
|
}
|
|
@@ -2316,7 +2391,8 @@
|
|
|
2316
2391
|
"obligations": [
|
|
2317
2392
|
"Verify the live value, standard events, focus, and rendered output.",
|
|
2318
2393
|
"A nonempty label names the internal combobox; otherwise ariaLabel supplies a visually hidden label without adding control height, including custom selected content.",
|
|
2319
|
-
"Hint text is visible below the control through Web Awesome's native hint relationship; placeholderText remains the empty value inside the closed control."
|
|
2394
|
+
"Hint text is visible below the control through Web Awesome's native hint relationship; placeholderText remains the empty value inside the closed control.",
|
|
2395
|
+
"Import select/register once; its scoped lifecycle adapter keeps the latest open/close request authoritative across animation reversals, canceled transitions, and removal. Do not add consumer popup timing or position repairs."
|
|
2320
2396
|
]
|
|
2321
2397
|
},
|
|
2322
2398
|
"cssValueProps": [
|
|
@@ -1636,13 +1636,96 @@
|
|
|
1636
1636
|
"recipe": "docs/component-selection.md#problem-to-component-matrix"
|
|
1637
1637
|
}
|
|
1638
1638
|
},
|
|
1639
|
+
{
|
|
1640
|
+
"id": "row",
|
|
1641
|
+
"name": "Row",
|
|
1642
|
+
"category": "Structure",
|
|
1643
|
+
"kind": "component",
|
|
1644
|
+
"source": "kerf",
|
|
1645
|
+
"description": "A horizontal flex row with physical-axis alignment, a typed xs gap by default, and opt-in wrapping.",
|
|
1646
|
+
"uses": [],
|
|
1647
|
+
"purpose": "Arrange related content horizontally with consistent spacing and explicit left/center/right/full plus top/middle/bottom/full alignment instead of application-owned flex wrappers.",
|
|
1648
|
+
"publicExports": ["Row"],
|
|
1649
|
+
"cssValueProps": [
|
|
1650
|
+
{
|
|
1651
|
+
"path": "gap",
|
|
1652
|
+
"grammar": "length",
|
|
1653
|
+
"helpers": ["px", "rem", "em", "pct", "space", "lengthVar", "calc"],
|
|
1654
|
+
"nonStandaloneHelpers": ["plus"],
|
|
1655
|
+
"shorthands": ["none", "2xs", "xs", "s", "m", "l", "xl"],
|
|
1656
|
+
"canonicalShorthands": ["none", "2xs", "xs", "m", "l"],
|
|
1657
|
+
"exceptionalShorthands": ["s", "xl"],
|
|
1658
|
+
"rawPolicy": "forbid",
|
|
1659
|
+
"examples": ["gap=\"xs\"", "gap={space(\"m\")}", "gap={calc(plus(rem(0.25), pct(10)))}"]
|
|
1660
|
+
}
|
|
1661
|
+
],
|
|
1662
|
+
"useWhen": [
|
|
1663
|
+
"Arrange a group of sibling components horizontally.",
|
|
1664
|
+
"Choose physical horizontal distribution and vertical alignment without writing one-off flex CSS.",
|
|
1665
|
+
"Allow a bounded group to wrap while retaining the same typed gap and alignment contract."
|
|
1666
|
+
],
|
|
1667
|
+
"avoidWhen": [
|
|
1668
|
+
"Do not use Row when content belongs in a semantic list or when a named-zone component such as Toolbar owns the composition.",
|
|
1669
|
+
"Do not pass raw CSS strings to gap or use s/xl spacing steps without a deliberate exception.",
|
|
1670
|
+
"Do not use alignment to replace semantic grouping or responsive relocation."
|
|
1671
|
+
],
|
|
1672
|
+
"alternatives": [
|
|
1673
|
+
{
|
|
1674
|
+
"id": "list",
|
|
1675
|
+
"relationship": "axis-alternative",
|
|
1676
|
+
"when": "Use List when the main layout axis is vertical."
|
|
1677
|
+
},
|
|
1678
|
+
{
|
|
1679
|
+
"id": "toolbar",
|
|
1680
|
+
"relationship": "semantic-alternative",
|
|
1681
|
+
"when": "Use Toolbar when content belongs to named leading, center, and trailing application-chrome zones."
|
|
1682
|
+
}
|
|
1683
|
+
],
|
|
1684
|
+
"appOwns": [
|
|
1685
|
+
"child semantics and content",
|
|
1686
|
+
"alignment and wrapping policy",
|
|
1687
|
+
"typed gap overrides"
|
|
1688
|
+
],
|
|
1689
|
+
"variants": [
|
|
1690
|
+
"left/center/right/full horizontal alignment with l/c/r/f and flex aliases",
|
|
1691
|
+
"top/middle/bottom/full vertical alignment with t/m/c/b/f and flex aliases",
|
|
1692
|
+
"named none/2xs/xs/s/m/l/xl token gap",
|
|
1693
|
+
"typed CssLength gap",
|
|
1694
|
+
"nowrap or wrapping"
|
|
1695
|
+
],
|
|
1696
|
+
"accessibility": [
|
|
1697
|
+
"Row adds layout only and no grouping role; children retain responsibility for native or ARIA semantics.",
|
|
1698
|
+
"Wrapping must preserve a readable source and focus order."
|
|
1699
|
+
],
|
|
1700
|
+
"geometry": {
|
|
1701
|
+
"margin": "none",
|
|
1702
|
+
"border": "none",
|
|
1703
|
+
"padding": "none",
|
|
1704
|
+
"notes": [
|
|
1705
|
+
"Row adds no margin, border, or padding; it owns only flex alignment, wrapping, and the gap between children."
|
|
1706
|
+
]
|
|
1707
|
+
},
|
|
1708
|
+
"delivery": {
|
|
1709
|
+
"browserImport": "@kerfjs/ui/row",
|
|
1710
|
+
"manualCssImport": "@kerfjs/ui/row.css",
|
|
1711
|
+
"sideEffects": ["browser-condition-css"]
|
|
1712
|
+
},
|
|
1713
|
+
"wiring": [],
|
|
1714
|
+
"publicClasses": ["kui-row"],
|
|
1715
|
+
"publicTokens": ["--kui-layout-item-gap", "--kui-row-gap"],
|
|
1716
|
+
"links": {
|
|
1717
|
+
"catalogRoute": "?component=row",
|
|
1718
|
+
"documentation": "docs/layout.md",
|
|
1719
|
+
"recipe": "docs/layout.md#row-and-list-alignment"
|
|
1720
|
+
}
|
|
1721
|
+
},
|
|
1639
1722
|
{
|
|
1640
1723
|
"id": "list",
|
|
1641
1724
|
"name": "List",
|
|
1642
1725
|
"category": "Navigation",
|
|
1643
1726
|
"kind": "component",
|
|
1644
1727
|
"source": "kerf",
|
|
1645
|
-
"description": "A
|
|
1728
|
+
"description": "A vertical stack with physical-axis alignment, optional typed token/length gap, flex growth, vertical scrolling, and independently selectable divider edges.",
|
|
1646
1729
|
"uses": [
|
|
1647
1730
|
"list-header",
|
|
1648
1731
|
"list-action-row",
|
|
@@ -1689,6 +1772,7 @@
|
|
|
1689
1772
|
"Let one bounded list own vertical scrolling, flex growth, or one or more physical-edge dividers.",
|
|
1690
1773
|
"Choose a finite gap shorthand such as xs or m, or compose a typed length with @kerfjs/ui/css-values when the spacing scale is insufficient.",
|
|
1691
1774
|
"Use a finite flex keyword or the flex() builder when List participates in flexible layout."
|
|
1775
|
+
,"Align children horizontally or distribute them vertically with the same physical alignment vocabulary as Row."
|
|
1692
1776
|
],
|
|
1693
1777
|
"avoidWhen": [
|
|
1694
1778
|
"Do not use List as semantic list markup; use ul/ol when list semantics are required and apply layout deliberately.",
|
|
@@ -1699,7 +1783,7 @@
|
|
|
1699
1783
|
"appOwns": [
|
|
1700
1784
|
"child semantics and content",
|
|
1701
1785
|
"the bounded height needed for scrolling",
|
|
1702
|
-
"typed gap, flex, and divider choices"
|
|
1786
|
+
"typed gap, flex, alignment, and divider choices"
|
|
1703
1787
|
],
|
|
1704
1788
|
"variants": [
|
|
1705
1789
|
"no gap",
|
|
@@ -1708,6 +1792,8 @@
|
|
|
1708
1792
|
"typed CssLength gap",
|
|
1709
1793
|
"boolean, finite-keyword, or typed CssFlex flex",
|
|
1710
1794
|
"scrollable",
|
|
1795
|
+
"left/center/right/full horizontal alignment",
|
|
1796
|
+
"top/middle/bottom/full vertical alignment",
|
|
1711
1797
|
"top/right/bottom/left divider combinations"
|
|
1712
1798
|
],
|
|
1713
1799
|
"accessibility": [
|
|
@@ -2852,7 +2938,8 @@
|
|
|
2852
2938
|
"accessibility": [
|
|
2853
2939
|
"Verify the live value, standard events, focus, and rendered output.",
|
|
2854
2940
|
"A nonempty label names the internal combobox; otherwise ariaLabel supplies a visually hidden label without adding control height, including custom selected content.",
|
|
2855
|
-
"Hint text is visible below the control through Web Awesome's native hint relationship; placeholderText remains the empty value inside the closed control."
|
|
2941
|
+
"Hint text is visible below the control through Web Awesome's native hint relationship; placeholderText remains the empty value inside the closed control.",
|
|
2942
|
+
"Import select/register once; its scoped lifecycle adapter keeps the latest open/close request authoritative across animation reversals, canceled transitions, and removal. Do not add consumer popup timing or position repairs."
|
|
2856
2943
|
],
|
|
2857
2944
|
"geometry": {
|
|
2858
2945
|
"margin": "none",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Public API signatures for the UI authoring corpus
|
|
2
2
|
|
|
3
|
-
Generated from emitted declarations for `@kerfjs/ui@5.0.0-beta.
|
|
3
|
+
Generated from emitted declarations for `@kerfjs/ui@5.0.0-beta.34` and `kerfjs@5.0.0-beta.34`. This bounded reference covers only APIs used by the seven-task corpus. It is interface evidence, not an implementation or runtime guarantee.
|
|
4
4
|
|
|
5
5
|
## `@kerfjs/ui/css-values`
|
|
6
6
|
|
|
@@ -333,6 +333,7 @@ export { ListHeader, type ListHeaderProps };
|
|
|
333
333
|
import * as kerfjs from 'kerfjs';
|
|
334
334
|
import { UiSpaceName, CssLength, CssFlexKeyword, CssFlex } from './css-values.js';
|
|
335
335
|
import { D as DividerSides } from './divider-sides-267FA7sY.js';
|
|
336
|
+
import { H as HorizontalAlignment, V as VerticalAlignment } from './flex-alignment-CF8NLj7i.js';
|
|
336
337
|
import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
|
|
337
338
|
|
|
338
339
|
interface ListProps {
|
|
@@ -341,6 +342,10 @@ interface ListProps {
|
|
|
341
342
|
gap?: boolean | UiSpaceName | CssLength;
|
|
342
343
|
/** Allow this list to grow/shrink, use a keyword, or supply a typed CSS flex shorthand. */
|
|
343
344
|
flex?: boolean | CssFlexKeyword | CssFlex;
|
|
345
|
+
/** Horizontal alignment. Defaults to full to preserve stretch-aligned list children. */
|
|
346
|
+
hAlign?: HorizontalAlignment;
|
|
347
|
+
/** Vertical distribution. Defaults to top. */
|
|
348
|
+
vAlign?: VerticalAlignment;
|
|
344
349
|
/** Own vertical scrolling and overscroll containment. */
|
|
345
350
|
scrollable?: boolean;
|
|
346
351
|
/** Physical divider edges in canonical top/right/bottom/left order. */
|
|
@@ -348,9 +353,9 @@ interface ListProps {
|
|
|
348
353
|
className?: string;
|
|
349
354
|
}
|
|
350
355
|
/** A stretch-aligned vertical stack with optional gap, flex, scroll, and dividers. */
|
|
351
|
-
declare function List({ children, gap, flex, scrollable, dividerSides, className, }: ListProps): kerfjs.SafeHtml;
|
|
356
|
+
declare function List({ children, gap, flex, hAlign, vAlign, scrollable, dividerSides, className, }: ListProps): kerfjs.SafeHtml;
|
|
352
357
|
|
|
353
|
-
export { CssFlex, CssFlexKeyword, CssLength, DividerSides, List, type ListProps, UiSpaceName };
|
|
358
|
+
export { CssFlex, CssFlexKeyword, CssLength, DividerSides, HorizontalAlignment, List, type ListProps, UiSpaceName, VerticalAlignment };
|
|
354
359
|
```
|
|
355
360
|
|
|
356
361
|
## `@kerfjs/ui/list-action-row`
|
package/ai/skill.md
CHANGED
|
@@ -78,6 +78,7 @@ Quick routing:
|
|
|
78
78
|
| Need | Choose | Nearest alternatives / boundary |
|
|
79
79
|
| ------------------------------------- | ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
80
80
|
| Navigation row | `ListItem` | Use an ordinary link or button when sidebar/menu anatomy and state do not apply. Its rounded root clips overflowing descendants; set `multiline` when the primary label should wrap. Multiline leading icons stay aligned with the first text line. |
|
|
81
|
+
| Horizontal flex layout | `Row` | Use `hAlign`/`vAlign`, a typed `gap`, and opt-in `wrap`; use `List` when the main axis is vertical. |
|
|
81
82
|
| Navigation row with a trailing action | `ListActionRow` | Use `ListItem` when the trailing region is dormant; never put controls inside either component's SafeHtml slots. Multiline leading icons stay aligned with the first text line. |
|
|
82
83
|
| Page, panel, or dialog heading | `Toolbar` + `ToolbarText` | Use a direct extra-large `ToolbarText`, optional grouped icon, grouped trailing controls, and app-owned supporting copy below. |
|
|
83
84
|
| Exclusive choice | `TabBar`, `SegmentedControl`, or `Select` | Tabs switch tabpanels; segments expose a few choices; Select handles a longer value list. |
|
|
@@ -127,13 +128,13 @@ Hard rules:
|
|
|
127
128
|
12. Demo work uses public production component subpaths and their browser-selected CSS. Give every public visual component its own category-grouped catalog route; list themed third-party components under a clearly labeled collapsible ecosystem section, with a focused route for each. For the complete focused/composition decision, `CatalogExample` / `CatalogExampleStack` row/group nesting, exact specimen selection, geometry-overlay legend and exclusions, skip-marker behavior, and metadata ownership, follow the single [Catalog demo authoring contract](../docs/catalog.md#catalog-demo-authoring-contract), discovered machine-readably through [`catalog-authoring.json`](./catalog-authoring.json). Never infer structure from private `kui-catalog-*` classes. Project each component's deterministic repository-relative demo source and existing documentation path so the detail can expose `View demo source` and `Read guidance` links without a runtime export; also derive first-party component implementation paths from their canonical browser imports, and label Web Awesome documentation as Kerf integration guidance. Declare direct `uses` relationships so `Used by` stays derivable, and theme shell chrome through the same semantic tokens as the stage instead of drawing a substitute. Enable `wireCatalog({ revealSelection: true })` for long desktop sidebars so controlled selections remain visible without moving focus; keep its default compact media guard unless compact scrolling is an explicit product behavior, and use `revealCatalogEntry` for an initial deep link.
|
|
128
129
|
13. The Web Awesome theme makes Tooltip and Popover arrowless by default. Keep that default unless a pointer materially clarifies the anchor; opt back in with `--wa-tooltip-arrow-size`, `--kui-wa-popover-arrow-size`, or a popover's public `--arrow-size`, and use `without-arrow` when local no-arrow intent should survive theme changes. Its non-field chrome uses `--kui-wa-control-inset` (8px controls/items), `--kui-wa-surface-margin` / `--kui-wa-surface-inset` (8px around/inside Accordion, Card, Details, Callout, and Include), and `--kui-wa-container-inset` (16px Tab Panel content); Dialog maps its body to the 8px surface tier and its footer to the 16px container tier independently of `--spacing`. Override those tiers instead of restyling individual parts. When a dialog provides another dismissal affordance, put `hide-actions` on the `wa-dialog` host to hide its directly exported `header-actions` part; never chain `::part()` selectors through internal parts. Checkbox and Radio Group option regions, the Color Picker trigger, and Slider's complete interactive region receive the shared 8px logical inline outer inset because those controls have no bordered field shell. Known Date field captions and bordered text-like field hints align with values at the 9px border-plus-padding inset. OTP Input's label uses the same uppercase xs/650 treatment as other field labels, and both its label and hint use that 9px inset.
|
|
129
130
|
14. Treat the complete Web Awesome catalog as support coverage, not a recommendation list. Its UX sidebar marks superseded and exceptional entries `Discouraged`. Consider Popup when it replaces custom anchored positioning. Prefer Kerf `Select` over direct Dropdown/Dropdown Item/Select/Option composition, `SegmentedControl` over Button Group, `TabBar` or `SegmentedControl` over Web Awesome Tabs, `LucideIcon` over Web Awesome Icon, and `ResizableRegion` over Split Panel. Use Tree/Tree Item, Animated Image, and Comparison only for a specific required behavior; avoid Zoomable Frame.
|
|
130
|
-
15. Build sidebars, main areas, inspectors, and dialogs from `@kerfjs/ui/layout.css`: an unpadded `.kui-pane`, optional `.kui-pane__toolbar`, one scrolling `.kui-pane__content`, and optional `.kui-pane__footer`. Use `List` instead of a hand-written flex-column wrapper when
|
|
131
|
+
15. Build sidebars, main areas, inspectors, and dialogs from `@kerfjs/ui/layout.css`: an unpadded `.kui-pane`, optional `.kui-pane__toolbar`, one scrolling `.kui-pane__content`, and optional `.kui-pane__footer`. Use `Row` instead of a hand-written flex-row wrapper and `List` instead of a hand-written flex-column wrapper when children need shared physical-axis alignment and typed spacing. `Row` defaults to left/full with an `xs` gap and no wrapping; `List` retains full/top and zero-gap defaults. Use `List` when rows or sections also need flex growth, one vertical scroll owner, or physical-edge dividers; `dividerSides` uses canonical `t`/`r`/`b`/`l` order. A dialog body is generally a `List`: set `DialogSurface bodyInset="none"` when its list children own geometry, and wrap bare dialog prose in `ListInsetText` so it aligns with bordered siblings without a second inset. Add `.kui-content` for 24px major vertical separation and `.kui-content-item` for a child-owned 8px inline margin, 1px transparent-or-visible border, 8px padding, and 12px radius. Use the pill modifier for 22px. Do not pad pane shells, duplicate item geometry in wrappers, or create nested scroll owners.
|
|
131
132
|
16. Keep a visible collapsible pane's collapse control in its own toolbar. When hidden, move its restore control into the adjacent main toolbar on the corresponding logical edge: leading for an inline-start sidebar and trailing for an inline-end inspector. Collapse the pane completely; do not preserve an empty icon-only rail.
|
|
132
133
|
17. The only direct children of a `Toolbar` zone (`leading`/`center`/`trailing`) are `ToolbarText` (identity/title text) and `ToolbarControlGroup`; never drop bare buttons, inputs, links, or arbitrary markup straight into a zone. Put identity/title text directly in the zone as `ToolbarText`; wrap interactive controls and icon tiles in `ToolbarControlGroup`. `SegmentedControl`, `Select`, a collapsible `TokenSearchField`, and Web Awesome controls all live inside a group. For an ordinary icon/action control inside a group, use a plain `<button>` (the group styles `> button` fully) — that is the default; reach for `wa-button` only when you need a Web Awesome feature, chiefly a `wa-dropdown` popup trigger. A popup menu in a toolbar is a `single` group wrapping a `wa-dropdown` whose `slot="trigger"` `wa-button` is the toolbar button and whose `wa-dropdown-item`s are the menu, with the dropdown kept under `data-morph-skip-children`. For a compact mixed group, keep the standard item padding and raised selected chrome; the selected item paints over the outer border without an internal separator. For an avatar control, set `content="avatar"` and `avatarImage` on the group instead of inserting an `img`: a lone control paints the contained image on the outer group and a multi-button group paints it only on the pressed selection highlight. Compose panel/dialog/page headings with a direct extra-large `ToolbarText`, optional grouped icon, grouped trailing controls, and app-owned supporting copy below. A group remains 44px outside (`calc(2px + remify(42px))`) when its border/background are transparent; use 8px between groups and inside items. Split dormant and interactive regions: `ListHeader` fills the available inline width and keeps its label and mutually exclusive semantic count or non-count `badge` together, with an independent logical-end 44px action unless disclosure mode makes the title cluster the button. Its action visual defaults to 18px through `--kui-list-header-action-icon-size`; never shrink the target to match it. Pass every non-negative safe-integer section quantity through `count` with a localized full spoken `countLabel`; never concatenate it into `label` or put a number in `badge`. `ListItem.trailing` is dormant; use `ListActionRow` when primary and trailing actions need sibling 44px native buttons. Its `label`, `icon`, and `trailingActionIcon` slots are also dormant and cannot contain controls. Let panes relocate at narrow widths instead of shrinking targets.
|
|
133
134
|
18. When a recurring concept has no matching export or production recipe, keep its semantics in a thin application adapter while reusing the public layout vocabulary. The composer recipe uses one visible form surface, toolbar title/supporting-copy ids, shared 8px field/action gutters, 24px major rhythm, and a conditional StateBanner as its only nested semantic surface; do not turn every section into a card or double-inset intrinsically bordered controls. The application-local `../docs/examples/command-palette-adapter.tsx` is reference source for one such missing concept, not an `@kerfjs/ui` runtime export or catalog recipe. The application owns its registration, ranking, history, permissions, availability, shortcut policy, focus policy, dispatch, and copy. If a missing concept recurs across products, open an upstream component or recipe request.
|
|
134
135
|
19. Compose `ValueTable` from typed `ValueTableRow` entries instead of handwritten `dt`/`dd` wrappers. Pass `icon` for the optional 24px leading visual; the row owns 8px of root-scaled top and bottom padding, the 8px iconless or 40px icon-bearing separator start, and the common 8px right inset.
|
|
135
136
|
20. Use the standard direct `Toolbar` composition for a panel, dialog, or page heading, not a private wrapper or custom heading row. Put an optional icon in a `ToolbarControlGroup`, the title directly in the leading zone as extra-large `ToolbarText`, and actions in a trailing group. Set `headingLevel` for page/section landmarks. Supporting copy stays below the toolbar as app-owned content. The app owns modal behavior, focus, dismissal, command policy, ids, and action handling.
|
|
136
|
-
21. Space with the official five-step scale, picked by how connected two elements are — not by eye. `0` `--kui-space-none` = no separation (one unit); `4px` `--kui-space-2xs` = very minor air on a connected cluster; `8px` `--kui-space-xs` = standard, between elements within a group; `16px` `--kui-space-m` = minor, between homogeneous groups; `24px` `--kui-space-l` = major, between heterogeneous groups (the `.kui-content` rhythm). The 8px-vs-24px distinction is inside-a-group vs between-major-differing-regions. `--kui-space-s` (12px) and `--kui-space-xl` (32px) are off-scale exceptions. For `List.gap`, pass a finite shorthand such as `gap="xs"` or `gap="m"`; when one token is insufficient, import typed builders from the CSS-free `@kerfjs/ui/css-values` subpath. Preserve property grammar: lengths for gap/Skeleton geometry, `flex()` for List flex, and `uiColor()`/`colorVar()` for choice icons. Never cast between brands or emit raw row `style` declarations. `plus` is not standalone and must be wrapped in `calc`; `remify()` remains source-CSS syntax and is never a runtime prop value. See `docs/layout.md` "Spacing scale".
|
|
137
|
+
21. Space with the official five-step scale, picked by how connected two elements are — not by eye. `0` `--kui-space-none` = no separation (one unit); `4px` `--kui-space-2xs` = very minor air on a connected cluster; `8px` `--kui-space-xs` = standard, between elements within a group; `16px` `--kui-space-m` = minor, between homogeneous groups; `24px` `--kui-space-l` = major, between heterogeneous groups (the `.kui-content` rhythm). The 8px-vs-24px distinction is inside-a-group vs between-major-differing-regions. `--kui-space-s` (12px) and `--kui-space-xl` (32px) are off-scale exceptions. For `Row.gap` or `List.gap`, pass a finite shorthand such as `gap="xs"` or `gap="m"`; when one token is insufficient, import typed builders from the CSS-free `@kerfjs/ui/css-values` subpath. Preserve property grammar: lengths for gap/Skeleton geometry, `flex()` for List flex, and `uiColor()`/`colorVar()` for choice icons. Never cast between brands or emit raw row `style` declarations. `plus` is not standalone and must be wrapped in `calc`; `remify()` remains source-CSS syntax and is never a runtime prop value. See `docs/layout.md` "Spacing scale".
|
|
137
138
|
22. Pick a whole-screen layout from the opt-in, tree-shakeable subpaths by data + interaction + device, and derive responsiveness from `@kerfjs/ui/device-class`'s `deviceClass()` (`compact` = handset or portrait tablet = one pane at a time). Simple/flat → `NavStack` with one entry (single pane), plus `TabScaffold` (`@kerfjs/ui/tab-scaffold`, iOS bottom tabs, each tab its own `NavStack`) for 2–5 co-equal sections on `compact`. Drill-down → `NavStack` (`@kerfjs/ui/nav-stack`), upgrading to `SplitView` (`@kerfjs/ui/split-view`, list-detail) once both panes fit (`atLeast('tablet')` landscape); `SplitView` collapses to a `NavStack` on `compact`. Keep each stack's ordered views controlled; put view-specific bottom chrome on `NavStackView.bottomToolbar` (or use the component-level persistent fallback), then call `wireNavStack` so content slides while the active view's top and bottom chrome cross-fade and focus moves into the new top view/restores on pop. Mark a preferred initial heading or control with `data-nav-focus` when DOM order is not sufficient. Complex tool with peripheral panels → `Workbench` (`@kerfjs/ui/workbench`, collapsible rails + drawer) `atLeast('desktop')`, degrading to `NavStack`/overlays below. These are declarative (the app owns the stack/selection/collapsed/active state as signals) with disposer-returning `wire…` helpers; each ships a companion CSS import and stays out of the barrel. For a standalone collapsible rail or bottom drawer outside a full shell, use `CollapsiblePanel` + `CollapsiblePanelToggle` (`@kerfjs/ui/collapsible-panel`) with `wireSidebar` (`@kerfjs/ui/wire-sidebar`): the standard collapse animation and per-side icon convention (`PanelLeft*`/`PanelRight*`/`PanelBottom*`) plus toggle, focus, compact overlay, and persistence semantics. Dialogs pick the same inner layout, then present per device class (full-screen modal on `compact`, inline on desktop). See `docs/app-layouts.md` and `docs/collapsible-panel.md`.
|
|
138
139
|
|
|
139
140
|
Common mistakes:
|
|
@@ -166,3 +167,11 @@ Common mistakes:
|
|
|
166
167
|
| Put raw prose directly in a padded dialog body | Compose the body as `List`, set `bodyInset="none"` for list-owned geometry, and wrap bare prose in `ListInsetText` |
|
|
167
168
|
| Keep chrome, a label, or a readout that aids no decision | Delete it; every element must help a person decide or act |
|
|
168
169
|
| Override a component's default size or color because it "looks off" | Trust the default (a LucideIcon is 24px) and fix the surrounding layout instead |
|
|
170
|
+
|
|
171
|
+
## Select lifecycle ownership
|
|
172
|
+
|
|
173
|
+
Import `@kerfjs/ui/select/register` once. It owns the canonical Select animation
|
|
174
|
+
lifecycle: the latest request wins through open/close reversals, canceled
|
|
175
|
+
transitions, and removal. Native value, keyboard, dismissal, and anchor placement
|
|
176
|
+
remain with Web Awesome. Do not add popup delays, position repairs, or animation
|
|
177
|
+
completion handlers in consumers. Raw `wa-select` elements remain native.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Web Awesome JSX signatures for the UI authoring corpus
|
|
2
2
|
|
|
3
|
-
Generated from the emitted `@kerfjs/ui@5.0.0-beta.
|
|
3
|
+
Generated from the emitted `@kerfjs/ui@5.0.0-beta.34` declaration boundary. Import `@kerfjs/ui/webawesome` for type effects when authoring direct `wa-*` JSX. The module emits no runtime behavior and does not register custom elements.
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
6
|
import { KerfCustomElement } from 'kerfjs/jsx-runtime';
|
package/dist/catalog.js
CHANGED
|
@@ -3,7 +3,8 @@ import { Toolbar } from './chunk-VXFGMDA7.js';
|
|
|
3
3
|
import { Pane } from './chunk-I4V3UDSA.js';
|
|
4
4
|
import { ListHeader } from './chunk-OC275HHS.js';
|
|
5
5
|
import { ListItem } from './chunk-I45QO2IZ.js';
|
|
6
|
-
import { List } from './chunk-
|
|
6
|
+
import { List } from './chunk-7JQAQWVC.js';
|
|
7
|
+
|
|
7
8
|
import { filterDataAttributes } from './chunk-SRSJO5QE.js';
|
|
8
9
|
|
|
9
10
|
|
package/dist/catalog.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/catalog.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AA2GA,SAAS,SAAA,CACP,UACA,EAAA,EAC0B;AAC1B,EAAA,KAAA,MAAW,WAAW,QAAA,EAAU;AAC9B,IAAA,KAAA,MAAW,SAAS,OAAA,CAAQ,OAAA,MAAa,KAAA,CAAM,EAAA,KAAO,IAAI,OAAO,KAAA;AAAA,EACnE;AACA,EAAA,OAAO,MAAA;AACT;AAEA,SAAS,iBACP,IAAA,EACsB;AACtB,EAAA,IAAI,CAAC,IAAA,EAAM,MAAA,EAAQ,OAAO,MAAA;AAC1B,EAAA,uBACE,GAAA,CAAC,MAAA,EAAA,EAAK,KAAA,EAAM,mBAAA,EACT,eAAK,GAAA,CAAI,CAAC,GAAA,qBACT,GAAA,CAAC,MAAA,EAAA,EAAK,KAAA,EAAM,kBAAA,EAAoB,QAAA,EAAA,GAAA,EAAI,CACrC,CAAA,EACH,CAAA;AAEJ;AAQA,SAAS,gBAAA,CACP,SACA,YAAA,EACY;AACZ,EAAA,MAAM,SAAmB,EAAC;AAC1B,EAAA,KAAA,MAAW,KAAA,IAAS,OAAA;AAClB,IAAA,IAAI,CAAC,OAAO,QAAA,C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,SAAS,CAAA,CAAA,CAAG,IAAA,EAAK;AAAA,MACrD,4BAAA,EAA0B,IAAA;AAAA,MAC1B,YAAA,EAAY,KAAA;AAAA,MAEX;AAAA;AAAA,GACH;AAEJ","file":"catalog.js","sourcesContent":["import type { SafeHtml } from 'kerfjs';\nimport {\n ExternalLink,\n Moon,\n PanelLeftClose,\n PanelLeftOpen,\n Sun,\n Waypoints,\n} from 'lucide';\n\nimport { filterDataAttributes } from './extension-attributes.js';\nimport { List } from './list.js';\nimport { ListHeader } from './list-header.js';\nimport { ListItem } from './list-item.js';\nimport { LucideIcon } from './lucide-icon.js';\nimport { Pane } from './pane.js';\nimport type { KerfUiContent } from './semantic-content.js';\nimport { Toolbar } from './toolbar.js';\nimport { ToolbarControlGroup } from './toolbar-control-group.js';\n\n/** A reference link shown in the detail footer for the active entry. */\nexport interface CatalogResource {\n label: string;\n href: string;\n /** Optional monospace detail (e.g. a file path) shown after the label. */\n detail?: string;\n}\n\n/** A related entry offered in the detail footer's \"Related entries\" popup menu. */\nexport interface CatalogRelated {\n id: string;\n name: string;\n /** Group heading in the menu, e.g. \"Uses\" / \"Used by\". */\n group: string;\n}\n\nexport interface CatalogEntry {\n id: string;\n name: string;\n description?: string;\n /** Short metadata tags shown at the trailing edge of the sidebar row. */\n tags?: readonly string[];\n resources?: readonly CatalogResource[];\n related?: readonly CatalogRelated[];\n}\n\nexport interface CatalogSection {\n category: string;\n entries: readonly CatalogEntry[];\n}\n\n/**\n * A secondary group of sections shown below the primary sidebar sections with a\n * quieter \"ecosystem\" treatment (e.g. third-party components). Optionally\n * collapsible — the app owns `expanded` and toggles it from `wireCatalog`'s\n * `onToggleSecondary`.\n */\nexport interface CatalogSecondaryGroup {\n label: string;\n sections: readonly CatalogSection[];\n /** When true, the group's label is a disclosure toggle controlling `expanded`. */\n collapsible?: boolean;\n /** Whether the group is expanded (controlled). Ignored unless `collapsible`. */\n expanded?: boolean;\n}\n\nexport interface CatalogBrand {\n title: string;\n subtitle?: string;\n /** Logo image URL (rendered decorative). Omit for a text-only brand. */\n logoUrl?: string;\n}\n\nexport interface CatalogProps {\n brand: CatalogBrand;\n sections: readonly CatalogSection[];\n /** The controlled active entry id — the app owns this signal. */\n active: string;\n /** The rendered preview for the active entry; the app computes it from `active`. */\n content: KerfUiContent;\n /** Whether the sidebar is collapsed (controlled). */\n collapsed?: boolean;\n /** Current theme; when set, a theme toggle is shown that switches to the opposite. Omit to hide it. */\n theme?: 'light' | 'dark';\n /** Extra header controls placed before the theme toggle (each a `ToolbarControlGroup`). */\n headerActions?: KerfUiContent;\n /** A secondary \"ecosystem\" group of sections below the primary category groups. */\n secondarySections?: CatalogSecondaryGroup;\n /** Extra sidebar content below the category groups (and the secondary group). */\n sidebarFooter?: KerfUiContent;\n /** Status line content shown at the start of the detail footer. */\n status?: KerfUiContent;\n /**\n * Whether to highlight specimens' computed borders (or transparent outer\n * bounds) and non-zero margins. Pass a boolean (rather than omitting the\n * prop) when the active entry can switch between component and composition\n * previews; `wireCatalogGeometryOverlay` keeps the overlay synchronized.\n */\n geometryOverlay?: boolean;\n selectAction?: string;\n toggleSidebarAction?: string;\n toggleThemeAction?: string;\n /** Action fired by the secondary group's disclosure toggle (when collapsible). */\n toggleSecondaryAction?: string;\n className?: string;\n}\n\nfunction findEntry(\n sections: readonly CatalogSection[],\n id: string,\n): CatalogEntry | undefined {\n for (const section of sections) {\n for (const entry of section.entries) if (entry.id === id) return entry;\n }\n return undefined;\n}\n\nfunction catalogEntryTags(\n tags: readonly string[] | undefined,\n): SafeHtml | undefined {\n if (!tags?.length) return undefined;\n return (\n <span class=\"kui-catalog__tags\">\n {tags.map((tag) => (\n <span class=\"kui-catalog__tag\">{tag}</span>\n ))}\n </span>\n );\n}\n\n/**\n * Render the related entries as a `wa-dropdown` popup-menu body: a heading per\n * `group` (first-seen order) followed by that group's entries, each a navigable\n * item carrying the same `selectAction` the sidebar items use, so a chosen entry\n * routes through the one `wireCatalog` select handler.\n */\nfunction relatedMenuItems(\n related: readonly CatalogRelated[],\n selectAction: string,\n): SafeHtml[] {\n const groups: string[] = [];\n for (const entry of related)\n if (!groups.includes(entry.group)) groups.push(entry.group);\n const nodes: SafeHtml[] = [];\n groups.forEach((group, index) => {\n if (index > 0) nodes.push(<wa-divider></wa-divider>);\n nodes.push(<small class=\"kui-catalog__related-heading\">{group}</small>);\n for (const entry of related) {\n if (entry.group === group)\n nodes.push(\n <wa-dropdown-item data-action={selectAction} data-item-id={entry.id}>\n {entry.name}\n </wa-dropdown-item>,\n );\n }\n });\n return nodes;\n}\n\n/**\n * A reusable component-catalog shell: a collapsible category sidebar, a titled\n * detail stage that renders the active entry's preview, and a footer with\n * reference links and a related-entry popup menu. Built entirely from public\n * `@kerfjs/ui` primitives. Controlled and stateless — the app owns the `active`,\n * `collapsed`, and `theme` signals and computes `content` from `active` in its own\n * render; wire the sidebar/collapse/theme actions with `wireCatalog`.\n */\nexport function Catalog({\n brand,\n sections,\n active,\n content,\n collapsed = false,\n theme,\n headerActions,\n secondarySections,\n sidebarFooter,\n status,\n geometryOverlay,\n selectAction = 'catalog-select',\n toggleSidebarAction = 'catalog-toggle-sidebar',\n toggleThemeAction = 'catalog-toggle-theme',\n toggleSecondaryAction = 'catalog-toggle-secondary',\n className = '',\n}: CatalogProps) {\n const selected =\n findEntry(sections, active) ??\n (secondarySections\n ? findEntry(secondarySections.sections, active)\n : undefined);\n const name = selected?.name ?? '';\n const nextTheme = theme === 'dark' ? 'light' : 'dark';\n const resources = selected?.resources ?? [];\n const related = selected?.related ?? [];\n\n return (\n <main\n class={`kui-catalog ${className}`.trim()}\n data-component=\"catalog\"\n data-sidebar-collapsed={String(collapsed)}\n data-geometry-overlay={\n geometryOverlay === undefined ? undefined : String(geometryOverlay)\n }\n >\n <Pane\n element=\"aside\"\n className=\"kui-catalog__sidebar\"\n label={`${brand.title} catalog`}\n contentElement=\"nav\"\n contentLabel={`${brand.title} components`}\n separators={['inline-end']}\n headerClassName=\"kui-catalog__brand\"\n header={\n <>\n <Toolbar\n label={`${brand.title} catalog header`}\n dividerSides=\"\"\n leading={\n <ToolbarControlGroup\n appearance=\"borderless\"\n className=\"kui-catalog__identity\"\n >\n {brand.logoUrl ? (\n <img class=\"kui-catalog__mark\" src={brand.logoUrl} alt=\"\" />\n ) : (\n <></>\n )}\n <h1>{brand.title}</h1>\n </ToolbarControlGroup>\n }\n trailing={\n <ToolbarControlGroup appearance=\"borderless\" single>\n <button\n type=\"button\"\n data-action={toggleSidebarAction}\n aria-label={`Collapse ${brand.title} catalog`}\n >\n <LucideIcon icon={PanelLeftClose} name=\"panel-left-close\" />\n </button>\n </ToolbarControlGroup>\n }\n />\n {brand.subtitle ? (\n <p class=\"kui-catalog__subtitle\">{brand.subtitle}</p>\n ) : (\n <></>\n )}\n </>\n }\n >\n <>\n {sections.map((section) => (\n <section class=\"kui-catalog__group\">\n <ListHeader label={section.category} />\n <List className=\"kui-catalog__items\">\n {section.entries.map((entry) => (\n <ListItem\n action={selectAction}\n itemId={entry.id}\n label={entry.name}\n trailing={catalogEntryTags(entry.tags)}\n selected={active === entry.id}\n title={entry.description}\n multiline\n />\n ))}\n </List>\n </section>\n ))}\n {secondarySections ? (\n <section class=\"kui-catalog__group kui-catalog__group--secondary\">\n {secondarySections.collapsible ? (\n <ListHeader\n label={secondarySections.label}\n toggle\n expanded={Boolean(secondarySections.expanded)}\n action={toggleSecondaryAction}\n />\n ) : (\n <ListHeader label={secondarySections.label} />\n )}\n {!secondarySections.collapsible || secondarySections.expanded ? (\n <div class=\"kui-catalog__secondary\" data-catalog-secondary>\n {secondarySections.sections.map((section) => (\n <section class=\"kui-catalog__secondary-group\">\n <h3 class=\"kui-catalog__secondary-heading\">\n {section.category}\n </h3>\n <List className=\"kui-catalog__items\">\n {section.entries.map((entry) => (\n <ListItem\n action={selectAction}\n itemId={entry.id}\n label={entry.name}\n trailing={catalogEntryTags(entry.tags)}\n selected={active === entry.id}\n title={entry.description}\n multiline\n />\n ))}\n </List>\n </section>\n ))}\n </div>\n ) : (\n <></>\n )}\n </section>\n ) : (\n <></>\n )}\n {sidebarFooter ?? <></>}\n </>\n </Pane>\n <Pane\n element=\"article\"\n className=\"kui-catalog__detail\"\n contentElement=\"section\"\n contentLabel={`${name} preview`}\n contentClassName=\"kui-catalog__stage\"\n headerClassName=\"kui-catalog__header\"\n header={\n <>\n <Toolbar\n label={`${name} header`}\n dividerSides=\"\"\n leading={\n <>\n {collapsed ? (\n <ToolbarControlGroup appearance=\"borderless\" single>\n <button\n type=\"button\"\n data-action={toggleSidebarAction}\n aria-label={`Expand ${brand.title} catalog`}\n >\n <LucideIcon\n icon={PanelLeftOpen}\n name=\"panel-left-open\"\n />\n </button>\n </ToolbarControlGroup>\n ) : (\n <></>\n )}\n <ToolbarControlGroup\n appearance=\"borderless\"\n className=\"kui-catalog__title\"\n >\n <h2>{name}</h2>\n </ToolbarControlGroup>\n </>\n }\n trailing={\n <div class=\"kui-catalog__header-actions\">\n {headerActions}\n {theme ? (\n <ToolbarControlGroup\n className=\"kui-catalog__settings\"\n label=\"Catalog display\"\n >\n <button\n type=\"button\"\n data-action={toggleThemeAction}\n aria-label={`Use ${nextTheme} theme`}\n data-theme-preview={theme}\n >\n {nextTheme === 'dark' ? (\n <LucideIcon icon={Moon} name=\"moon\" />\n ) : (\n <LucideIcon icon={Sun} name=\"sun\" />\n )}\n <span>{nextTheme === 'dark' ? 'Dark' : 'Light'}</span>\n </button>\n </ToolbarControlGroup>\n ) : (\n <></>\n )}\n </div>\n }\n />\n {selected?.description ? (\n <p class=\"kui-catalog__description kui-content-item\">\n {selected.description}\n </p>\n ) : (\n <></>\n )}\n </>\n }\n footerClassName=\"kui-catalog__footer\"\n footer={\n <>\n {status ? <div class=\"kui-catalog__status\">{status}</div> : <></>}\n <Toolbar\n label={`${name} resources`}\n dividerSides=\"\"\n leading={\n resources.length > 0 ? (\n <nav\n class=\"kui-catalog__resources\"\n aria-label={`${name} resources`}\n >\n <ToolbarControlGroup\n className=\"kui-catalog__resource-group\"\n label={`${name} resources`}\n >\n {resources.map((resource) => (\n <a\n class=\"kui-catalog__resource\"\n href={resource.href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n aria-label={`${name}: ${resource.label} (opens in new tab)`}\n >\n <LucideIcon\n icon={ExternalLink}\n name=\"external-link\"\n />\n <span>{resource.label}</span>\n {resource.detail ? (\n <code>{resource.detail}</code>\n ) : (\n <></>\n )}\n </a>\n ))}\n </ToolbarControlGroup>\n </nav>\n ) : (\n <></>\n )\n }\n trailing={\n related.length > 0 ? (\n <div class=\"kui-catalog__related\" data-catalog-related>\n <ToolbarControlGroup\n single\n className=\"kui-catalog__related-group\"\n label=\"Related entries\"\n >\n <wa-dropdown\n class=\"kui-catalog__related-menu\"\n placement=\"top-end\"\n data-key={`kui-catalog-related-${active}`}\n data-morph-skip-children\n >\n <wa-button slot=\"trigger\" appearance=\"plain\" with-caret>\n <span class=\"kui-catalog__related-trigger\">\n <LucideIcon icon={Waypoints} name=\"waypoints\" />\n <span class=\"kui-catalog__related-label\">\n Components\n </span>\n </span>\n </wa-button>\n {relatedMenuItems(related, selectAction)}\n </wa-dropdown>\n </ToolbarControlGroup>\n </div>\n ) : (\n <></>\n )\n }\n />\n </>\n }\n >\n <div class=\"kui-catalog__canvas\">\n {content}\n {geometryOverlay !== undefined ? (\n <div\n class=\"kui-catalog__geometry-overlay\"\n data-catalog-geometry-overlay\n data-morph-skip-children\n aria-hidden=\"true\"\n />\n ) : (\n <></>\n )}\n </div>\n </Pane>\n </main>\n );\n}\n\n/**\n * How a {@link CatalogExample}'s content aligns its visible left edge with the\n * example's `ListHeader` label (which sits 16px in — 8px title + 8px label):\n * - `'glyph'` — a bare glyph/text specimen with no inline geometry insets the full 16px.\n * - `'inline-control'` — a control that already carries ~8px of its own inline padding insets 8px so its content lands on the same line.\n * - `'none'` — a content-item / composition that owns its geometry and already aligns; no inset (default).\n */\nexport type CatalogExampleAlign = 'glyph' | 'inline-control' | 'none';\n\nconst catalogExampleProtectedAttributes = new Set([\n 'data-catalog-example',\n 'data-catalog-example-stack',\n 'data-catalog-example-label',\n 'data-catalog-example-note',\n 'data-align',\n]);\n\ntype CatalogExampleRootAttributes = Readonly<\n Record<`data-${string}`, string | undefined> & {\n 'data-catalog-example'?: never;\n 'data-catalog-example-stack'?: never;\n 'data-catalog-example-label'?: never;\n 'data-catalog-example-note'?: never;\n 'data-align'?: never;\n }\n>;\n\ntype CatalogExampleStackRootAttributes = Readonly<\n Record<`data-${string}`, string | undefined> & {\n 'data-catalog-example'?: never;\n 'data-catalog-example-stack'?: never;\n 'data-catalog-example-label'?: never;\n 'data-catalog-example-note'?: never;\n 'data-align'?: never;\n }\n>;\n\nexport interface CatalogExampleProps {\n /** The example's label, shown as a `ListHeader` above the specimen. Omit for a bare specimen. */\n label?: string;\n /** Optional explanatory note between the label and the specimen. */\n note?: SafeHtml | string;\n /** Alignment inset for the specimen — see {@link CatalogExampleAlign}. Default `'none'`. */\n align?: CatalogExampleAlign;\n /** Safe authoring `data-*` metadata for the rendered section. Helper-owned structural attributes remain protected. */\n rootAttributes?: CatalogExampleRootAttributes;\n className?: string;\n children?: KerfUiContent;\n}\n\n/**\n * One labeled example in a catalog preview: a `ListHeader` label, an optional\n * note, and the specimen. `align` insets the specimen so its visible left edge\n * lines up with the label text, encoding the catalog's alignment rules as a\n * first-class prop instead of per-demo CSS. The inset is published as the\n * `--kui-catalog-example-align` custom property so a debug overlay can exclude it\n * from a specimen's measured margin.\n */\nexport function CatalogExample({\n label,\n note,\n align = 'none',\n rootAttributes = {},\n className = '',\n children,\n}: CatalogExampleProps) {\n const safeRootAttributes = filterDataAttributes(\n rootAttributes,\n catalogExampleProtectedAttributes,\n );\n return (\n <section\n {...safeRootAttributes}\n class={`kui-catalog-example ${className}`.trim()}\n data-catalog-example\n data-align={align}\n >\n {label !== undefined ? (\n <ListHeader\n label={label}\n rootAttributes={{ 'data-catalog-example-label': '' }}\n />\n ) : (\n <></>\n )}\n {note !== undefined ? (\n <p class=\"kui-catalog-example__note\" data-catalog-example-note>\n {note}\n </p>\n ) : (\n <></>\n )}\n {children}\n </section>\n );\n}\n\nexport interface CatalogExampleStackProps {\n /** Accessible label for the stack region. */\n label?: string;\n /** Safe authoring `data-*` metadata for the rendered stack. Helper-owned structural attributes remain protected. */\n rootAttributes?: CatalogExampleStackRootAttributes;\n className?: string;\n children?: KerfUiContent;\n}\n\n/**\n * A vertically-stacked group of {@link CatalogExample}s with the catalog's\n * example rhythm. The semantic `section` becomes a named `region` when `label`\n * is supplied; an unlabeled stack remains an ordinary grouping.\n */\nexport function CatalogExampleStack({\n label,\n rootAttributes = {},\n className = '',\n children,\n}: CatalogExampleStackProps) {\n const safeRootAttributes = filterDataAttributes(\n rootAttributes,\n catalogExampleProtectedAttributes,\n );\n return (\n <section\n {...safeRootAttributes}\n class={`kui-catalog-example-stack ${className}`.trim()}\n data-catalog-example-stack\n aria-label={label}\n >\n {children}\n </section>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/catalog.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AA2GA,SAAS,SAAA,CACP,UACA,EAAA,EAC0B;AAC1B,EAAA,KAAA,MAAW,WAAW,QAAA,EAAU;AAC9B,IAAA,KAAA,MAAW,SAAS,OAAA,CAAQ,OAAA,MAAa,KAAA,CAAM,EAAA,KAAO,IAAI,OAAO,KAAA;AAAA,EACnE;AACA,EAAA,OAAO,MAAA;AACT;AAEA,SAAS,iBACP,IAAA,EACsB;AACtB,EAAA,IAAI,CAAC,IAAA,EAAM,MAAA,EAAQ,OAAO,MAAA;AAC1B,EAAA,uBACE,GAAA,CAAC,MAAA,EAAA,EAAK,KAAA,EAAM,mBAAA,EACT,eAAK,GAAA,CAAI,CAAC,GAAA,qBACT,GAAA,CAAC,MAAA,EAAA,EAAK,KAAA,EAAM,kBAAA,EAAoB,QAAA,EAAA,GAAA,EAAI,CACrC,CAAA,EACH,CAAA;AAEJ;AAQA,SAAS,gBAAA,CACP,SACA,YAA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ACA,EAAA,uBACE,GAAA;AAAA,IAAC,SAAA;AAAA,IAAA;AAAA,MACE,GAAG,kBAAA;AAAA,MACJ,KAAA,EAAO,CAAA,0BAAA,EAA6B,SAAS,CAAA,CAAA,CAAG,IAAA,EAAK;AAAA,MACrD,4BAAA,EAA0B,IAAA;AAAA,MAC1B,YAAA,EAAY,KAAA;AAAA,MAEX;AAAA;AAAA,GACH;AAEJ","file":"catalog.js","sourcesContent":["import type { SafeHtml } from 'kerfjs';\nimport {\n ExternalLink,\n Moon,\n PanelLeftClose,\n PanelLeftOpen,\n Sun,\n Waypoints,\n} from 'lucide';\n\nimport { filterDataAttributes } from './extension-attributes.js';\nimport { List } from './list.js';\nimport { ListHeader } from './list-header.js';\nimport { ListItem } from './list-item.js';\nimport { LucideIcon } from './lucide-icon.js';\nimport { Pane } from './pane.js';\nimport type { KerfUiContent } from './semantic-content.js';\nimport { Toolbar } from './toolbar.js';\nimport { ToolbarControlGroup } from './toolbar-control-group.js';\n\n/** A reference link shown in the detail footer for the active entry. */\nexport interface CatalogResource {\n label: string;\n href: string;\n /** Optional monospace detail (e.g. a file path) shown after the label. */\n detail?: string;\n}\n\n/** A related entry offered in the detail footer's \"Related entries\" popup menu. */\nexport interface CatalogRelated {\n id: string;\n name: string;\n /** Group heading in the menu, e.g. \"Uses\" / \"Used by\". */\n group: string;\n}\n\nexport interface CatalogEntry {\n id: string;\n name: string;\n description?: string;\n /** Short metadata tags shown at the trailing edge of the sidebar row. */\n tags?: readonly string[];\n resources?: readonly CatalogResource[];\n related?: readonly CatalogRelated[];\n}\n\nexport interface CatalogSection {\n category: string;\n entries: readonly CatalogEntry[];\n}\n\n/**\n * A secondary group of sections shown below the primary sidebar sections with a\n * quieter \"ecosystem\" treatment (e.g. third-party components). Optionally\n * collapsible — the app owns `expanded` and toggles it from `wireCatalog`'s\n * `onToggleSecondary`.\n */\nexport interface CatalogSecondaryGroup {\n label: string;\n sections: readonly CatalogSection[];\n /** When true, the group's label is a disclosure toggle controlling `expanded`. */\n collapsible?: boolean;\n /** Whether the group is expanded (controlled). Ignored unless `collapsible`. */\n expanded?: boolean;\n}\n\nexport interface CatalogBrand {\n title: string;\n subtitle?: string;\n /** Logo image URL (rendered decorative). Omit for a text-only brand. */\n logoUrl?: string;\n}\n\nexport interface CatalogProps {\n brand: CatalogBrand;\n sections: readonly CatalogSection[];\n /** The controlled active entry id — the app owns this signal. */\n active: string;\n /** The rendered preview for the active entry; the app computes it from `active`. */\n content: KerfUiContent;\n /** Whether the sidebar is collapsed (controlled). */\n collapsed?: boolean;\n /** Current theme; when set, a theme toggle is shown that switches to the opposite. Omit to hide it. */\n theme?: 'light' | 'dark';\n /** Extra header controls placed before the theme toggle (each a `ToolbarControlGroup`). */\n headerActions?: KerfUiContent;\n /** A secondary \"ecosystem\" group of sections below the primary category groups. */\n secondarySections?: CatalogSecondaryGroup;\n /** Extra sidebar content below the category groups (and the secondary group). */\n sidebarFooter?: KerfUiContent;\n /** Status line content shown at the start of the detail footer. */\n status?: KerfUiContent;\n /**\n * Whether to highlight specimens' computed borders (or transparent outer\n * bounds) and non-zero margins. Pass a boolean (rather than omitting the\n * prop) when the active entry can switch between component and composition\n * previews; `wireCatalogGeometryOverlay` keeps the overlay synchronized.\n */\n geometryOverlay?: boolean;\n selectAction?: string;\n toggleSidebarAction?: string;\n toggleThemeAction?: string;\n /** Action fired by the secondary group's disclosure toggle (when collapsible). */\n toggleSecondaryAction?: string;\n className?: string;\n}\n\nfunction findEntry(\n sections: readonly CatalogSection[],\n id: string,\n): CatalogEntry | undefined {\n for (const section of sections) {\n for (const entry of section.entries) if (entry.id === id) return entry;\n }\n return undefined;\n}\n\nfunction catalogEntryTags(\n tags: readonly string[] | undefined,\n): SafeHtml | undefined {\n if (!tags?.length) return undefined;\n return (\n <span class=\"kui-catalog__tags\">\n {tags.map((tag) => (\n <span class=\"kui-catalog__tag\">{tag}</span>\n ))}\n </span>\n );\n}\n\n/**\n * Render the related entries as a `wa-dropdown` popup-menu body: a heading per\n * `group` (first-seen order) followed by that group's entries, each a navigable\n * item carrying the same `selectAction` the sidebar items use, so a chosen entry\n * routes through the one `wireCatalog` select handler.\n */\nfunction relatedMenuItems(\n related: readonly CatalogRelated[],\n selectAction: string,\n): SafeHtml[] {\n const groups: string[] = [];\n for (const entry of related)\n if (!groups.includes(entry.group)) groups.push(entry.group);\n const nodes: SafeHtml[] = [];\n groups.forEach((group, index) => {\n if (index > 0) nodes.push(<wa-divider></wa-divider>);\n nodes.push(<small class=\"kui-catalog__related-heading\">{group}</small>);\n for (const entry of related) {\n if (entry.group === group)\n nodes.push(\n <wa-dropdown-item data-action={selectAction} data-item-id={entry.id}>\n {entry.name}\n </wa-dropdown-item>,\n );\n }\n });\n return nodes;\n}\n\n/**\n * A reusable component-catalog shell: a collapsible category sidebar, a titled\n * detail stage that renders the active entry's preview, and a footer with\n * reference links and a related-entry popup menu. Built entirely from public\n * `@kerfjs/ui` primitives. Controlled and stateless — the app owns the `active`,\n * `collapsed`, and `theme` signals and computes `content` from `active` in its own\n * render; wire the sidebar/collapse/theme actions with `wireCatalog`.\n */\nexport function Catalog({\n brand,\n sections,\n active,\n content,\n collapsed = false,\n theme,\n headerActions,\n secondarySections,\n sidebarFooter,\n status,\n geometryOverlay,\n selectAction = 'catalog-select',\n toggleSidebarAction = 'catalog-toggle-sidebar',\n toggleThemeAction = 'catalog-toggle-theme',\n toggleSecondaryAction = 'catalog-toggle-secondary',\n className = '',\n}: CatalogProps) {\n const selected =\n findEntry(sections, active) ??\n (secondarySections\n ? findEntry(secondarySections.sections, active)\n : undefined);\n const name = selected?.name ?? '';\n const nextTheme = theme === 'dark' ? 'light' : 'dark';\n const resources = selected?.resources ?? [];\n const related = selected?.related ?? [];\n\n return (\n <main\n class={`kui-catalog ${className}`.trim()}\n data-component=\"catalog\"\n data-sidebar-collapsed={String(collapsed)}\n data-geometry-overlay={\n geometryOverlay === undefined ? undefined : String(geometryOverlay)\n }\n >\n <Pane\n element=\"aside\"\n className=\"kui-catalog__sidebar\"\n label={`${brand.title} catalog`}\n contentElement=\"nav\"\n contentLabel={`${brand.title} components`}\n separators={['inline-end']}\n headerClassName=\"kui-catalog__brand\"\n header={\n <>\n <Toolbar\n label={`${brand.title} catalog header`}\n dividerSides=\"\"\n leading={\n <ToolbarControlGroup\n appearance=\"borderless\"\n className=\"kui-catalog__identity\"\n >\n {brand.logoUrl ? (\n <img class=\"kui-catalog__mark\" src={brand.logoUrl} alt=\"\" />\n ) : (\n <></>\n )}\n <h1>{brand.title}</h1>\n </ToolbarControlGroup>\n }\n trailing={\n <ToolbarControlGroup appearance=\"borderless\" single>\n <button\n type=\"button\"\n data-action={toggleSidebarAction}\n aria-label={`Collapse ${brand.title} catalog`}\n >\n <LucideIcon icon={PanelLeftClose} name=\"panel-left-close\" />\n </button>\n </ToolbarControlGroup>\n }\n />\n {brand.subtitle ? (\n <p class=\"kui-catalog__subtitle\">{brand.subtitle}</p>\n ) : (\n <></>\n )}\n </>\n }\n >\n <>\n {sections.map((section) => (\n <section class=\"kui-catalog__group\">\n <ListHeader label={section.category} />\n <List className=\"kui-catalog__items\">\n {section.entries.map((entry) => (\n <ListItem\n action={selectAction}\n itemId={entry.id}\n label={entry.name}\n trailing={catalogEntryTags(entry.tags)}\n selected={active === entry.id}\n title={entry.description}\n multiline\n />\n ))}\n </List>\n </section>\n ))}\n {secondarySections ? (\n <section class=\"kui-catalog__group kui-catalog__group--secondary\">\n {secondarySections.collapsible ? (\n <ListHeader\n label={secondarySections.label}\n toggle\n expanded={Boolean(secondarySections.expanded)}\n action={toggleSecondaryAction}\n />\n ) : (\n <ListHeader label={secondarySections.label} />\n )}\n {!secondarySections.collapsible || secondarySections.expanded ? (\n <div class=\"kui-catalog__secondary\" data-catalog-secondary>\n {secondarySections.sections.map((section) => (\n <section class=\"kui-catalog__secondary-group\">\n <h3 class=\"kui-catalog__secondary-heading\">\n {section.category}\n </h3>\n <List className=\"kui-catalog__items\">\n {section.entries.map((entry) => (\n <ListItem\n action={selectAction}\n itemId={entry.id}\n label={entry.name}\n trailing={catalogEntryTags(entry.tags)}\n selected={active === entry.id}\n title={entry.description}\n multiline\n />\n ))}\n </List>\n </section>\n ))}\n </div>\n ) : (\n <></>\n )}\n </section>\n ) : (\n <></>\n )}\n {sidebarFooter ?? <></>}\n </>\n </Pane>\n <Pane\n element=\"article\"\n className=\"kui-catalog__detail\"\n contentElement=\"section\"\n contentLabel={`${name} preview`}\n contentClassName=\"kui-catalog__stage\"\n headerClassName=\"kui-catalog__header\"\n header={\n <>\n <Toolbar\n label={`${name} header`}\n dividerSides=\"\"\n leading={\n <>\n {collapsed ? (\n <ToolbarControlGroup appearance=\"borderless\" single>\n <button\n type=\"button\"\n data-action={toggleSidebarAction}\n aria-label={`Expand ${brand.title} catalog`}\n >\n <LucideIcon\n icon={PanelLeftOpen}\n name=\"panel-left-open\"\n />\n </button>\n </ToolbarControlGroup>\n ) : (\n <></>\n )}\n <ToolbarControlGroup\n appearance=\"borderless\"\n className=\"kui-catalog__title\"\n >\n <h2>{name}</h2>\n </ToolbarControlGroup>\n </>\n }\n trailing={\n <div class=\"kui-catalog__header-actions\">\n {headerActions}\n {theme ? (\n <ToolbarControlGroup\n className=\"kui-catalog__settings\"\n label=\"Catalog display\"\n >\n <button\n type=\"button\"\n data-action={toggleThemeAction}\n aria-label={`Use ${nextTheme} theme`}\n data-theme-preview={theme}\n >\n {nextTheme === 'dark' ? (\n <LucideIcon icon={Moon} name=\"moon\" />\n ) : (\n <LucideIcon icon={Sun} name=\"sun\" />\n )}\n <span>{nextTheme === 'dark' ? 'Dark' : 'Light'}</span>\n </button>\n </ToolbarControlGroup>\n ) : (\n <></>\n )}\n </div>\n }\n />\n {selected?.description ? (\n <p class=\"kui-catalog__description kui-content-item\">\n {selected.description}\n </p>\n ) : (\n <></>\n )}\n </>\n }\n footerClassName=\"kui-catalog__footer\"\n footer={\n <>\n {status ? <div class=\"kui-catalog__status\">{status}</div> : <></>}\n <Toolbar\n label={`${name} resources`}\n dividerSides=\"\"\n leading={\n resources.length > 0 ? (\n <nav\n class=\"kui-catalog__resources\"\n aria-label={`${name} resources`}\n >\n <ToolbarControlGroup\n className=\"kui-catalog__resource-group\"\n label={`${name} resources`}\n >\n {resources.map((resource) => (\n <a\n class=\"kui-catalog__resource\"\n href={resource.href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n aria-label={`${name}: ${resource.label} (opens in new tab)`}\n >\n <LucideIcon\n icon={ExternalLink}\n name=\"external-link\"\n />\n <span>{resource.label}</span>\n {resource.detail ? (\n <code>{resource.detail}</code>\n ) : (\n <></>\n )}\n </a>\n ))}\n </ToolbarControlGroup>\n </nav>\n ) : (\n <></>\n )\n }\n trailing={\n related.length > 0 ? (\n <div class=\"kui-catalog__related\" data-catalog-related>\n <ToolbarControlGroup\n single\n className=\"kui-catalog__related-group\"\n label=\"Related entries\"\n >\n <wa-dropdown\n class=\"kui-catalog__related-menu\"\n placement=\"top-end\"\n data-key={`kui-catalog-related-${active}`}\n data-morph-skip-children\n >\n <wa-button slot=\"trigger\" appearance=\"plain\" with-caret>\n <span class=\"kui-catalog__related-trigger\">\n <LucideIcon icon={Waypoints} name=\"waypoints\" />\n <span class=\"kui-catalog__related-label\">\n Components\n </span>\n </span>\n </wa-button>\n {relatedMenuItems(related, selectAction)}\n </wa-dropdown>\n </ToolbarControlGroup>\n </div>\n ) : (\n <></>\n )\n }\n />\n </>\n }\n >\n <div class=\"kui-catalog__canvas\">\n {content}\n {geometryOverlay !== undefined ? (\n <div\n class=\"kui-catalog__geometry-overlay\"\n data-catalog-geometry-overlay\n data-morph-skip-children\n aria-hidden=\"true\"\n />\n ) : (\n <></>\n )}\n </div>\n </Pane>\n </main>\n );\n}\n\n/**\n * How a {@link CatalogExample}'s content aligns its visible left edge with the\n * example's `ListHeader` label (which sits 16px in — 8px title + 8px label):\n * - `'glyph'` — a bare glyph/text specimen with no inline geometry insets the full 16px.\n * - `'inline-control'` — a control that already carries ~8px of its own inline padding insets 8px so its content lands on the same line.\n * - `'none'` — a content-item / composition that owns its geometry and already aligns; no inset (default).\n */\nexport type CatalogExampleAlign = 'glyph' | 'inline-control' | 'none';\n\nconst catalogExampleProtectedAttributes = new Set([\n 'data-catalog-example',\n 'data-catalog-example-stack',\n 'data-catalog-example-label',\n 'data-catalog-example-note',\n 'data-align',\n]);\n\ntype CatalogExampleRootAttributes = Readonly<\n Record<`data-${string}`, string | undefined> & {\n 'data-catalog-example'?: never;\n 'data-catalog-example-stack'?: never;\n 'data-catalog-example-label'?: never;\n 'data-catalog-example-note'?: never;\n 'data-align'?: never;\n }\n>;\n\ntype CatalogExampleStackRootAttributes = Readonly<\n Record<`data-${string}`, string | undefined> & {\n 'data-catalog-example'?: never;\n 'data-catalog-example-stack'?: never;\n 'data-catalog-example-label'?: never;\n 'data-catalog-example-note'?: never;\n 'data-align'?: never;\n }\n>;\n\nexport interface CatalogExampleProps {\n /** The example's label, shown as a `ListHeader` above the specimen. Omit for a bare specimen. */\n label?: string;\n /** Optional explanatory note between the label and the specimen. */\n note?: SafeHtml | string;\n /** Alignment inset for the specimen — see {@link CatalogExampleAlign}. Default `'none'`. */\n align?: CatalogExampleAlign;\n /** Safe authoring `data-*` metadata for the rendered section. Helper-owned structural attributes remain protected. */\n rootAttributes?: CatalogExampleRootAttributes;\n className?: string;\n children?: KerfUiContent;\n}\n\n/**\n * One labeled example in a catalog preview: a `ListHeader` label, an optional\n * note, and the specimen. `align` insets the specimen so its visible left edge\n * lines up with the label text, encoding the catalog's alignment rules as a\n * first-class prop instead of per-demo CSS. The inset is published as the\n * `--kui-catalog-example-align` custom property so a debug overlay can exclude it\n * from a specimen's measured margin.\n */\nexport function CatalogExample({\n label,\n note,\n align = 'none',\n rootAttributes = {},\n className = '',\n children,\n}: CatalogExampleProps) {\n const safeRootAttributes = filterDataAttributes(\n rootAttributes,\n catalogExampleProtectedAttributes,\n );\n return (\n <section\n {...safeRootAttributes}\n class={`kui-catalog-example ${className}`.trim()}\n data-catalog-example\n data-align={align}\n >\n {label !== undefined ? (\n <ListHeader\n label={label}\n rootAttributes={{ 'data-catalog-example-label': '' }}\n />\n ) : (\n <></>\n )}\n {note !== undefined ? (\n <p class=\"kui-catalog-example__note\" data-catalog-example-note>\n {note}\n </p>\n ) : (\n <></>\n )}\n {children}\n </section>\n );\n}\n\nexport interface CatalogExampleStackProps {\n /** Accessible label for the stack region. */\n label?: string;\n /** Safe authoring `data-*` metadata for the rendered stack. Helper-owned structural attributes remain protected. */\n rootAttributes?: CatalogExampleStackRootAttributes;\n className?: string;\n children?: KerfUiContent;\n}\n\n/**\n * A vertically-stacked group of {@link CatalogExample}s with the catalog's\n * example rhythm. The semantic `section` becomes a named `region` when `label`\n * is supplied; an unlabeled stack remains an ordinary grouping.\n */\nexport function CatalogExampleStack({\n label,\n rootAttributes = {},\n className = '',\n children,\n}: CatalogExampleStackProps) {\n const safeRootAttributes = filterDataAttributes(\n rootAttributes,\n catalogExampleProtectedAttributes,\n );\n return (\n <section\n {...safeRootAttributes}\n class={`kui-catalog-example-stack ${className}`.trim()}\n data-catalog-example-stack\n aria-label={label}\n >\n {children}\n </section>\n );\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { verticalAlignment, horizontalAlignment } from './chunk-R3EBGEAW.js';
|
|
1
2
|
import { space } from './chunk-OL4TC3U2.js';
|
|
2
3
|
import { jsx } from 'kerfjs/jsx-runtime';
|
|
3
4
|
|
|
@@ -14,6 +15,8 @@ function List({
|
|
|
14
15
|
children,
|
|
15
16
|
gap = false,
|
|
16
17
|
flex = false,
|
|
18
|
+
hAlign = "full",
|
|
19
|
+
vAlign = "top",
|
|
17
20
|
scrollable = false,
|
|
18
21
|
dividerSides = "",
|
|
19
22
|
className = ""
|
|
@@ -31,6 +34,8 @@ function List({
|
|
|
31
34
|
"data-component": "list",
|
|
32
35
|
"data-gap": String(Boolean(gap)),
|
|
33
36
|
"data-flex": String(Boolean(flex)),
|
|
37
|
+
"data-h-align": horizontalAlignment(hAlign),
|
|
38
|
+
"data-v-align": verticalAlignment(vAlign),
|
|
34
39
|
"data-scrollable": String(scrollable),
|
|
35
40
|
"divider-sides": dividerSides || void 0,
|
|
36
41
|
style: style || void 0,
|
|
@@ -41,4 +46,4 @@ function List({
|
|
|
41
46
|
|
|
42
47
|
export { List };
|
|
43
48
|
|
|
44
|
-
//# sourceMappingURL=chunk-
|
|
49
|
+
//# sourceMappingURL=chunk-7JQAQWVC.js.map
|