@kerfjs/ui 5.0.0-beta.78 → 5.0.0-beta.79
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 -6
- package/ai/application-ui-diagnostic-ids-v1.json +1 -0
- package/ai/compile-time-contracts-v1.json +3 -3
- package/ai/component-catalog.json +31 -22
- package/ai/component-composition-rules.json +6 -14
- package/ai/component-composition.json +21 -23
- package/ai/components/README.md +1 -1
- package/ai/components/document-baseline.md +1 -1
- package/ai/components/nav-stack.md +3 -3
- package/ai/components/pane.md +3 -1
- package/ai/components/{tab-scaffold.md → tab-navigator.md} +14 -14
- package/ai/components/token-search-field.md +1 -0
- package/ai/components/toolbar.md +4 -8
- package/ai/public-api-signatures-v1.md +20 -20
- package/ai/skill.md +7 -6
- package/ai/webawesome-jsx-signatures-v1.md +1 -1
- package/dist/browser/tab-navigator.js +4 -0
- package/dist/{chunk-QYXKMLHO.js → chunk-3CXRQAYT.js} +2 -2
- package/dist/chunk-3CXRQAYT.js.map +1 -0
- package/dist/{chunk-G4VKQP7B.js → chunk-3SXWV2IR.js} +5 -1
- package/dist/chunk-3SXWV2IR.js.map +1 -0
- package/dist/{chunk-VLPE6OPN.js → chunk-62VMNBV2.js} +6 -2
- package/dist/chunk-62VMNBV2.js.map +1 -0
- package/dist/index.js +3 -3
- package/dist/styles/components/actions/toolbar/toolbar.css +7 -14
- package/dist/styles/components/actions/toolbar-control-group/toolbar-control-group.css +3 -0
- package/dist/styles/components/actions/toolbar-text/toolbar-text.css +1 -0
- package/dist/styles/components/forms/token-search-field/token-search-field.css +12 -1
- package/dist/styles/components/layout/pane/pane.css +13 -3
- package/dist/styles/components/navigation/tab-scaffold/tab-scaffold.css +1 -1
- package/dist/styles/pane.css +13 -3
- package/dist/styles/{tab-scaffold.css → tab-navigator.css} +1 -1
- package/dist/styles/token-search-field.css +12 -1
- package/dist/styles/toolbar-control-group.css +3 -0
- package/dist/styles/toolbar-text.css +1 -0
- package/dist/styles/toolbar.css +7 -14
- package/dist/{tab-scaffold.d.ts → tab-navigator.d.ts} +10 -10
- package/dist/{tab-scaffold.js → tab-navigator.js} +3 -3
- package/dist/tab-navigator.js.map +1 -0
- package/dist/token-search-field.js +1 -1
- package/dist/wire-catalog.js +1 -1
- package/dist/wire-scroll-dividers.d.ts +3 -3
- package/dist/wire-scroll-dividers.js +1 -1
- package/dist/wire-tab-navigator.d.ts +11 -0
- package/dist/{wire-tab-scaffold.js → wire-tab-navigator.js} +3 -3
- package/dist/wire-tab-navigator.js.map +1 -0
- package/dist/wire-token-search-fields.js +1 -1
- package/docs/app-layouts.md +44 -11
- package/docs/component-contract.md +1 -1
- package/docs/component-selection.md +16 -14
- package/docs/design/templates/token-search-field/empty-dark.svg +1 -1
- package/docs/design/templates/token-search-field/empty.svg +1 -1
- package/docs/design/templates/token-search-field-dark.svg +1 -1
- package/docs/design/templates/token-search-field.svg +1 -1
- package/docs/design/templates.md +1 -1
- package/docs/examples/application-ui-profile.json +4 -4
- package/docs/layout.md +11 -8
- package/docs/recipes.md +1 -1
- package/docs/{tab-scaffold.md → tab-navigator.md} +32 -17
- package/docs/type-contracts.md +3 -3
- package/docs/ui-analyzer.md +5 -0
- package/docs/ui-doctor.md +18 -8
- package/doctor/component-style-checks.mjs +253 -20
- package/doctor/index.mjs +1 -0
- package/llms.txt +10 -8
- package/package.json +10 -10
- package/dist/browser/tab-scaffold.js +0 -4
- package/dist/chunk-G4VKQP7B.js.map +0 -1
- package/dist/chunk-QYXKMLHO.js.map +0 -1
- package/dist/chunk-VLPE6OPN.js.map +0 -1
- package/dist/tab-scaffold.js.map +0 -1
- package/dist/wire-tab-scaffold.d.ts +0 -11
- package/dist/wire-tab-scaffold.js.map +0 -1
|
@@ -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.79` and `kerfjs@5.0.0-beta.79`. 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
|
|
|
@@ -1238,7 +1238,7 @@ interface WireScrollDividersOptions {
|
|
|
1238
1238
|
/**
|
|
1239
1239
|
* App-owned scroll arrangements to pair beyond the ones found by structure
|
|
1240
1240
|
* (every `Pane`'s header and footer around its content, every `NavStack`'s
|
|
1241
|
-
* and `
|
|
1241
|
+
* and `TabNavigator`'s chrome around its active region, and every `TabBar`
|
|
1242
1242
|
* strip).
|
|
1243
1243
|
*/
|
|
1244
1244
|
targets?: readonly ScrollDividerTarget[];
|
|
@@ -1258,11 +1258,11 @@ type Root = HTMLElement | Document;
|
|
|
1258
1258
|
* - every `Pane` with a header or footer: its header shows a bottom divider and
|
|
1259
1259
|
* its footer a top divider (drawn by the Pane, per its `chromeDividers`);
|
|
1260
1260
|
* - every `NavStack`'s top chrome and bottom toolbar around its active view,
|
|
1261
|
-
* and every `
|
|
1261
|
+
* and every `TabNavigator`'s bar under its active scene: the chrome shows a
|
|
1262
1262
|
* bottom (top chrome) or top (bottom toolbar, bar) divider. The scroller is
|
|
1263
1263
|
* whichever element actually scrolls there: the view or scene itself, or,
|
|
1264
1264
|
* through a sole child with no chrome of its own on that edge, a `Pane`'s
|
|
1265
|
-
* content or a nested `NavStack` / `
|
|
1265
|
+
* content or a nested `NavStack` / `TabNavigator` region (a Pane's own header
|
|
1266
1266
|
* or footer draws that boundary instead);
|
|
1267
1267
|
* - every `TabBar` strip: the bar draws a divider on each side of the strip
|
|
1268
1268
|
* whose tabs are scrolled out of view;
|
|
@@ -2115,14 +2115,14 @@ declare function wireSidebar(root: HTMLElement, { panels, deviceClass, compactPr
|
|
|
2115
2115
|
export { type SidebarStorage, type WireSidebarOptions, type WireSidebarPanel, wireSidebar };
|
|
2116
2116
|
```
|
|
2117
2117
|
|
|
2118
|
-
## `@kerfjs/ui/tab-
|
|
2118
|
+
## `@kerfjs/ui/tab-navigator`
|
|
2119
2119
|
|
|
2120
2120
|
```ts
|
|
2121
2121
|
import { SafeHtml } from 'kerfjs';
|
|
2122
2122
|
import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
|
|
2123
2123
|
import { PaneAppearance } from './pane.js';
|
|
2124
2124
|
|
|
2125
|
-
interface
|
|
2125
|
+
interface TabNavigatorTabBase<Id extends string> {
|
|
2126
2126
|
id: Id;
|
|
2127
2127
|
label: string;
|
|
2128
2128
|
/** Decorative icon shown above the label in the bottom bar. */
|
|
@@ -2135,7 +2135,7 @@ interface TabScaffoldTabBase<Id extends string> {
|
|
|
2135
2135
|
deepInset?: boolean;
|
|
2136
2136
|
}
|
|
2137
2137
|
/** A tab with an optional count or short-status badge. */
|
|
2138
|
-
interface
|
|
2138
|
+
interface TabNavigatorTabCountBadge {
|
|
2139
2139
|
/**
|
|
2140
2140
|
* Optional count or short status shown as a solid danger `Badge` at the
|
|
2141
2141
|
* top-trailing corner of the tab icon (the iOS tab-bar badge). Omitted, `''`,
|
|
@@ -2153,7 +2153,7 @@ interface TabScaffoldTabCountBadge {
|
|
|
2153
2153
|
badgeLabel?: string;
|
|
2154
2154
|
}
|
|
2155
2155
|
/** A tab with the text-free dot badge (new content without a count). */
|
|
2156
|
-
interface
|
|
2156
|
+
interface TabNavigatorTabDotBadge {
|
|
2157
2157
|
/**
|
|
2158
2158
|
* `true` shows a solid danger dot `Badge` at the top-trailing corner of the
|
|
2159
2159
|
* tab icon — the iOS tab-bar dot for new content without a count.
|
|
@@ -2167,12 +2167,12 @@ interface TabScaffoldTabDotBadge {
|
|
|
2167
2167
|
badgeLabel: string;
|
|
2168
2168
|
}
|
|
2169
2169
|
/** One bottom-bar destination: its label, optional icon and badge, and content. */
|
|
2170
|
-
type
|
|
2171
|
-
interface
|
|
2170
|
+
type TabNavigatorTab<Id extends string = string> = TabNavigatorTabBase<Id> & (TabNavigatorTabCountBadge | TabNavigatorTabDotBadge);
|
|
2171
|
+
interface TabNavigatorProps<Id extends string = string> {
|
|
2172
2172
|
id: string;
|
|
2173
2173
|
/** Accessible name for the tab bar. */
|
|
2174
2174
|
label: string;
|
|
2175
|
-
tabs: readonly
|
|
2175
|
+
tabs: readonly TabNavigatorTab<Id>[];
|
|
2176
2176
|
/** The controlled active tab id (the app owns selection). */
|
|
2177
2177
|
active: NoInfer<Id>;
|
|
2178
2178
|
/**
|
|
@@ -2190,32 +2190,32 @@ interface TabScaffoldProps<Id extends string = string> {
|
|
|
2190
2190
|
slot?: string;
|
|
2191
2191
|
}
|
|
2192
2192
|
/**
|
|
2193
|
-
* A mobile-first, iOS-like bottom tab
|
|
2193
|
+
* A mobile-first, iOS-like bottom tab navigator: a bottom tab bar that switches
|
|
2194
2194
|
* between major sections, each tab keeping its own content (usually a `NavStack`)
|
|
2195
2195
|
* mounted so its stack and scroll survive a switch. Controlled — the app owns
|
|
2196
|
-
* `active`; wire selection with `@kerfjs/ui/wire-tab-
|
|
2196
|
+
* `active`; wire selection with `@kerfjs/ui/wire-tab-navigator`'s `wireTabNavigator`.
|
|
2197
2197
|
* On larger classes, promote the tabs to a `Workbench` rail or sidebar instead of
|
|
2198
2198
|
* a bottom bar. See `docs/23-app-layouts.md` §3.4.
|
|
2199
2199
|
*/
|
|
2200
|
-
declare function
|
|
2200
|
+
declare function TabNavigator<Id extends string>({ id, label, tabs, active, chromeDividers, className, slot, }: TabNavigatorProps<Id>): SafeHtml;
|
|
2201
2201
|
|
|
2202
|
-
export {
|
|
2202
|
+
export { TabNavigator, type TabNavigatorProps, type TabNavigatorTab };
|
|
2203
2203
|
```
|
|
2204
2204
|
|
|
2205
|
-
## `@kerfjs/ui/wire-tab-
|
|
2205
|
+
## `@kerfjs/ui/wire-tab-navigator`
|
|
2206
2206
|
|
|
2207
2207
|
```ts
|
|
2208
|
-
interface
|
|
2208
|
+
interface WireTabNavigatorOptions {
|
|
2209
2209
|
/** Invoked with the selected tab id when a bottom-bar tab is activated. */
|
|
2210
2210
|
onSelect: (tabId: string) => void;
|
|
2211
2211
|
}
|
|
2212
2212
|
/**
|
|
2213
|
-
* Wire a `
|
|
2213
|
+
* Wire a `TabNavigator`'s bottom tab bar: clicking a tab calls `onSelect` with its
|
|
2214
2214
|
* id (the app then updates its controlled `active`). Returns a disposer.
|
|
2215
2215
|
*/
|
|
2216
|
-
declare function
|
|
2216
|
+
declare function wireTabNavigator(root: Element, options: WireTabNavigatorOptions): () => void;
|
|
2217
2217
|
|
|
2218
|
-
export { type
|
|
2218
|
+
export { type WireTabNavigatorOptions, wireTabNavigator };
|
|
2219
2219
|
```
|
|
2220
2220
|
|
|
2221
2221
|
## `@kerfjs/ui/resizable-region`
|
package/ai/skill.md
CHANGED
|
@@ -253,8 +253,8 @@ Hard rules:
|
|
|
253
253
|
15a. Use `Text` from `@kerfjs/ui/text` for ordinary headings, paragraphs, and inline secondary text outside toolbar title zones. Omit `variant` for the default `p`, pass `h1`–`h6` according to the document outline, or use `variant="span"` inside a row, label, or table cell; ordinary native attributes pass through. Express supporting, error, compact, or code text with the independent finite `tone="quiet|danger"`, `size="compact"`, and `font="monospace"` props instead of global utility classes or appearance-only heading choices. Block Text variants own a transparent 1px border and the standard item padding; `span` owns no box geometry. Keep toolbar identity/title content on `ToolbarText` and list-aligned bare prose on `ListInsetText`. `ToolbarText` below `xlarge` is intentionally quiet identity text in default tone; a normal-color subsection title is `Text` with an `h2`–`h6` variant (or `ListHeader` for a list or menu section), never a recolored `ToolbarText`. Use `controlMargins` with canonical physical Sides for an exterior 8px control gutter without a Row wrapper; avoid stacking parent insets, and remember spans retain native inline margin behavior.
|
|
254
254
|
|
|
255
255
|
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.
|
|
256
|
-
16a. Dividers between pinned chrome and scrolling content are component chrome: a `Toolbar` draws none by default (`dividerSides` is for a permanent edge only). Call `wireScrollDividers(appRoot)` from `@kerfjs/ui/wire-scroll-dividers` once and retain its disposer; a plain `Pane` with `chromeDividers="scroll"` draws the line under its header only while content is scrolled beneath it and over its footer only while more content lies below (never when the content fits), every `NavStack`'s top chrome and bottom toolbar and every `
|
|
257
|
-
17.
|
|
256
|
+
16a. Dividers between pinned chrome and scrolling content are component chrome: a `Toolbar` draws none by default (`dividerSides` is for a permanent edge only). Call `wireScrollDividers(appRoot)` from `@kerfjs/ui/wire-scroll-dividers` once and retain its disposer; a plain `Pane` with `chromeDividers="scroll"` draws the line under its header only while content is scrolled beneath it and over its footer only while more content lies below (never when the content fits), every `NavStack`'s top chrome and bottom toolbar and every `TabNavigator` bar do the same around the active view or scene (keyed on whatever actually scrolls there, including a sole `Pane`'s content), and every `TabBar` marks each side of its strip with tabs scrolled out of view. Configure a pane with `chromeDividers` (`scroll` by default for plain panes, `always` by default for sunken panes, or explicit `scroll`, `always`, `none`, also via `PaneConfig`); `always` draws both lines even when content fits. A `NavStack` or `TabNavigator` has its own `chromeDividers` (same values: `always` draws the chrome lines without the wiring, `none` never, even when wired; a `SplitView` forwards it through `compactStack`); a `toolbarConfig.dividerSides` edge stays the Toolbar's own. Name app-owned chrome by id in `targets`. The wiring writes only `data-scroll-overflow` / `data-scroll-divider` state; never write a border onto a component to show a divider.
|
|
257
|
+
17. Each `Toolbar` zone accepts `KerfUiContent` directly, including status content, native controls, and application markup. Put identity/title text directly in the zone as `ToolbarText`; use `ToolbarControlGroup` when related controls need shared toolbar chrome, sizing, hover treatment, or overflow behavior. Bare controls keep their own styling and accessibility responsibilities. A standalone primary `wa-button` in trailing keeps its own Web Awesome chrome. `SegmentedControl`, `Select`, and `TokenSearchField` can live inside a group when they need that shared presentation. Configure zone behavior with `Toolbar.centerAlign` and its `responsive` / `responsiveAt` policy instead of selecting toolbar zone classes. No policy clips an action: trailing (and stacked center) zones wrap whole groups onto another row, and the center zone never compresses below its content (a leading title too long for the row truncates with an ellipsis instead), so never hide or shrink a toolbar control to make it fit; use `responsive="wrap"` for a heading whose title must stay whole, and move genuinely lower-priority commands into an app-owned "More" popup menu. 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. A popup menu in a toolbar is a `PopupMenu` (`@kerfjs/ui/popup-menu`, registered once via `@kerfjs/ui/popup-menu/register`) in a `single` group with `nestedDropdown` and a `menuInset`: give it typed `items` (commands with `action`s, `heading`s, `divider`s) and a trigger `icon` plus visible `text` or an accessible `label`; never hand-write `wa-dropdown` / `wa-dropdown-item` markup for a menu. Let the group size that trigger from its icon, localized text, and caret; do not force a width on the menu or button. By default a group stays on one row: each icon sits beside its label, and the toolbar's `responsive` policy relocates whole groups when needed. Set `overflow="wrap"` only for independent links that should move as whole actions to another row within the group; use `overflow="scroll"` for a bounded one-row action strip. A `ToolbarText` is one line ending in an ellipsis by default; opt into `wrap` (capped by `maxLines`) or `ellipsis={false}` deliberately. Inside a group, a `Select` or `PopupMenu` trigger drops its focus ring while its popup is open (the open popup and its current row show where focus is) and the ring returns when the popup closes; a ring follows the control's shape (a pill for an icon-and-caret trigger, a circle for a compact icon button) — set `focusRingOwner="group"` on a Select whose group paints the composed ring, and never add CSS to show, hide, or reshape a ring. 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 non-interactive heading icon is an icon tile: put the `LucideIcon` directly in its `ToolbarControlGroup` (it takes an icon button's 40px slot and centers), never inside a `<button>` that does nothing. A group remains 44px outside (`calc(2px + remify(42px))`) when its border/background are transparent; use 8px between groups and inside items. Each zone item sits in the toolbar's top 44px control band, centered by its own size; a taller item (a wrapped title, a second trailing row) starts at the band's top and grows down without moving the others, so a wrapped `ToolbarText` keeps trailing controls beside its first line — do not add alignment CSS for this. Split dormant and interactive regions: `ListHeader` fills the available inline width by default; set `width="content"` to shrink-wrap while retaining its normal geometry, or `inline` when it belongs in surrounding text without outer margin, border, or padding. It keeps its label and mutually exclusive semantic count or non-count `badge` together, with an independent logical-end action unless disclosure mode makes the title cluster the button. Its action visual defaults to 18px through `--kui-list-header-action-icon-size` inside a fitted 36px hover square whose transparent hit layer keeps the pointer target at least 44px (44px wide by the 36px row in `density="compact"`); never shrink the target to match the visual, and never force the button to 44px. 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 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. Dividers are chrome and earn their place: a `Toolbar` draws none by default, and the line between pinned chrome and scrolling content comes from scroll state (rule 16a), so never add a border, a permanent `dividerSides`, or a margin to fake or adjust one.
|
|
258
258
|
For a toolbar heading that must remain at the 20px `--kui-font-l` step, use `ToolbarText size="xlarge-fixed"`; `xlarge` retains the responsive page-title clamp. Pass `headingLevel` when it is a section landmark.
|
|
259
259
|
|
|
260
260
|
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. For multi-line banner copy use `copyLayout="stacked"`; use `actionPlacement="below"` for an action on its own trailing row. 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.
|
|
@@ -267,7 +267,7 @@ For a rail view heading, use `presentation="title"` for the 36px bold,
|
|
|
267
267
|
flush-start trigger and adjacent caret. Set `focusRingInset` when an ancestor
|
|
268
268
|
clips focus painting; never restyle Select shadow parts from application CSS.
|
|
269
269
|
|
|
270
|
-
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. 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. 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`, `Grid.gap`, or `List.gap`, pass a finite shorthand such as `gap="xs"` or `gap="m"`; use `Spacer` for one intentional typed empty width/height or a flexible main-axis gap. When one token is insufficient, import typed builders from the CSS-free `@kerfjs/ui/css-values` subpath. Preserve property grammar: lengths for gap/Spacer/Skeleton geometry, `flex()` for Row/Grid/List flex, and a foreground color for choice icons: `uiColor()` with a `*-on-*` or text token (`success-on-quiet`, `text-quiet`) or `foregroundColorVar()`. Fill tokens (`*-fill-*`) are backgrounds, not foregrounds, and `SelectChoice.color` rejects them. 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". 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`; show an unread count on a tab with its `badge` (a number or short string, rendered as the top-trailing danger `Badge` on the icon) plus a localized `badgeLabel` ("3 unread", folded into the tab's name as "Inbox, 3 unread"), never by concatenating the count into `label` or restyling the badge; for new content without a count pass `badge: true` (the text-free dot) with its required `badgeLabel` ("New activity"). 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. The stack's top chrome is a real `Toolbar`: put a view's title and groups on `NavStackView.toolbar` (`title`, `leading`, `center`, `trailing`), where its Toolbar configuration overrides stack-wide `toolbarConfig` defaults; configure `backIcon` / `backText` through the stack, never with CSS. Each view and the stack fallback use a structured `bottomToolbar` with an accessible `label`; a view can also provide `header` / `footer`, `headerList` / `footerList`, and `pane` configuration, which render a Pane around that view's scrolling content. `SplitView` forwards both of its inner components: `resizable` takes the list `ResizableRegion`'s `separator`, `handleIcon`, `contentOverflow`, and collapse props (`collapsed`, `transitioning`, `collapseMotion`, `restoreControl`, `restorePosition`), and `compactStack` takes the compact stack's `toolbarConfig`, `backIcon`, `backText`, `hideToolbar`, `bottomToolbar`, plus `list` / `detail` view toolbars (structured `toolbar` and `bottomToolbar`). Complex tool with peripheral panels → `Workbench` (`@kerfjs/ui/workbench`, collapsible rails + drawer) `atLeast('desktop')`, degrading to `NavStack`/overlays below. Workbench panels are fixed-size unless a panel opts in with `resizable` (`true` or `{ min, max }`); then render `size={sizeSignal.value}` and call `wireWorkbench(root, { id, panels: { leftRail: { size: sizeSignal, storageKey? } }, deviceClass })` from `@kerfjs/ui/wire-workbench` for pointer drags, arrow/Shift+arrow/Home/End on the separator, persistence, and no resizing on `compact` classes. Inline rails, fixed or resizable, leave the work area `mainMinSize` px of width (a `Workbench` prop, default 320, `0` off), and an inline bottom drawer leaves it `mainMinHeight` px of height (default 120, `0` off): resizable panels stop growing there, rails shrink in proportion when the Workbench narrows and the drawer when it gets shorter, so do not add your own main-area `min-width` / `min-height`. Rails present as overlays below the `narrow` Workbench container breakpoint (704px) by default — `responsiveOverlayAt: "compact"` moves that to 448px and `"never"` keeps a rail inline — and a bottom drawer opts in the same way; do not derive `presentation` from `deviceClass`, and overlays never resize. At compact widths an overlay rail fills the Workbench less a 44px dismiss strip (`--kui-workbench-overlay-dismiss-margin`) on the side away from its edge; `compactOverlay: "full"` makes one rail fill it. Pass each such panel's `collapsed` signal to `wireWorkbench` too (`panels: { leftRail: { collapsed: navCollapsed } }`, `size` optional) so the overlay is transient like `wireSidebar`'s compact overlay: it collapses when the breakpoint begins to apply (the inline state returns when it ends), takes focus on its first control and keeps Tab inside it while open, and closes on Escape or an outside press with focus returned to its toggle (give each toggle `aria-controls` naming its panel's derived id, `<workbench id>-left-rail` / `-right-rail` / `-bottom-drawer`, so a panel open at wire-up has a focus target too); opening one overlay closes the other open overlays, so they never cover each other's controls; do not hand-roll those listeners (`dismissOverlays: false` opts out of all of it, `exclusiveOverlays: false` of exclusivity only). Collapse stays the app's `collapsed` flag and keeps the size, so an expanded panel returns at its last size. Let the Workbench compose panel toolbars: give each panel `toolbar: { label, title?, leading?, center?, trailing?, toggle: { action, name, showLabel?, hideLabel? } }` and the work area `mainToolbar` (and `mainBottomToolbar` for a drawer). Each of these toolbars takes the `Toolbar`'s configuration (`ToolbarConfig`: `dividerSides`, `centerAlign`, `responsive`, `responsiveAt`, `safeAreaEdges`); configure a composed toolbar through those props (for example `dividerSides: ""` to drop its divider), never with CSS. Configure the composed panes and chrome lists the same way: a panel's `pane` (and `CollapsiblePanel`'s `pane`) and the Workbench's `mainPane` take `PaneConfig` (`contentElement`, `contentLabel`, `separators`, `safeAreaEdges` — for example `{ contentElement: "nav", contentLabel: "Files" }` for a navigator rail), and `mainHeaderList` / `mainFooterList` take `ListConfig` (`gap`, `hAlign`, `vAlign`, `dividerSides`, `textInsets`, `controlInsets`). Open, a panel's toolbar places groups in its leading, center, and trailing zones, with the toggle last; mark a ToolbarControlGroup relocateOnCollapse to keep it available when closed (pass marked groups directly or in arrays rather than JSX fragments); closed, marked groups follow zone order into the work area before the toggle — a left rail's lead `mainToolbar`, a right rail's end it, a drawer's trail `mainBottomToolbar` or float in a corner `FloatingToolbar` — and panel-only groups stay behind. A control sits near where its effect appears: a collapsed drawer's restore belongs in the bottom toolbar or a `FloatingToolbar` beside the drawer, not in a distant top toolbar. Do not hand-place panel toggles in the work-area toolbar or render a second copy, and handle only the toggle's `data-action`. A collapsed panel renders `inert` and `aria-hidden` by itself, on the rail/drawer and its content (its `restoreControl` stays outside and reachable), so do not add your own `tabindex`, `aria-hidden`, or `inert` to hide it. These are declarative (the app owns the stack/selection/collapsed/active state as signals) with disposer-returning `wire…` helpers; each stays out of the barrel, and its CSS-aware browser import loads the layout's CSS plus that of every component it renders (`Pane`, `Toolbar`, `List`, …), so do not hand-import `pane.css` or the other internal stylesheets; the companion `.css` subpath is only for pipelines without the `browser` condition. 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. Give a standalone panel the same `toolbar` roles and render `CollapsiblePanelRelocated` in your work-area toolbar (first in leading for a left rail, last in trailing for a right rail, a bottom toolbar or a `FloatingToolbar` restoreControl for a drawer) instead of hand-placing a second toggle. A collapsed `CollapsiblePanel`, `ResizableRegion`, or Workbench panel renders `inert` and `aria-hidden` by itself, so do not hide collapsed content yourself either. Likewise an open side overlay (a Workbench rail overlay, a `wireSidebar` compact overlay, an overlay `CollapsiblePanel` or horizontal `ResizableRegion`) hides the covered work area's `FloatingToolbar`s and restore corners by itself until it closes, so do not hide them from overlay state. A compact overlay opens only on a user action: wire-up on a compact device and a wide-to-compact crossing collapse every panel, and a wide crossing restores the inline state. Seed the signal with `signal(device.value.compact)` and pass the panel's `inlineCollapsed` default so the first compact render has no overlay. Dialogs pick the same inner layout, then present per device class (full-screen modal on `compact`, inline on desktop). A list-detail dialog is a Workbench-shaped layout on roomy devices: a full-height list sidebar and a full-height main column, each a `Pane` with its own top `Toolbar`; the main column holds the primary xl title, the close control (`data-dialog="close"` in a `without-header` Web Awesome dialog), and the record actions, never a header spanning both columns. A top-level percentage-height shell needs a definite containing height: opt into `@kerfjs/ui/document.css` and put `.kui-app-root` on the one direct mount container, or provide equivalent application-owned geometry. The global baseline is deliberately absent from `styles.css` and component imports. See `docs/app-layouts.md`, `docs/document-baseline.md`, and `docs/collapsible-panel.md`. 23. Layouts and `Pane` are safe-area aware without configuration: backgrounds, separators, and dividers paint through a device's unsafe areas (a collapsible rail or drawer grows by the inset it docks to), content is padded only on the sides a region actually reaches, and block insets are scroll padding inside the scroller so first/last content can always be scrolled clear. Interior edges get nothing, and a collapsed rail hands its edge back to the center. Never add your own `env(safe-area-inset-*)` padding around a kerf layout or pane — that double-insets. In an app-owned arrangement of panes, pass `Pane.safeAreaEdges` (the sides that pane reaches; `[]` opts out); give an app bar or bottom bar that sits at a screen edge outside a Pane header or footer `Toolbar.safeAreaEdges` for the sides it reaches (for example `['block-start', 'inline-start', 'inline-end']`); the Workbench `mainToolbar` / `mainBottomToolbar` and panel `toolbar` configurations forward the same `safeAreaEdges` to their `Toolbar`. Do not set the internal `--kui-edge-inset-*` context yourself. The device insets are `--kui-safe-area-*` (defaulting to `env()`), overridable on `:root`. See `docs/app-layouts.md` "Safe areas".
|
|
270
|
+
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. 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. 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`, `Grid.gap`, or `List.gap`, pass a finite shorthand such as `gap="xs"` or `gap="m"`; use `Spacer` for one intentional typed empty width/height or a flexible main-axis gap. When one token is insufficient, import typed builders from the CSS-free `@kerfjs/ui/css-values` subpath. Preserve property grammar: lengths for gap/Spacer/Skeleton geometry, `flex()` for Row/Grid/List flex, and a foreground color for choice icons: `uiColor()` with a `*-on-*` or text token (`success-on-quiet`, `text-quiet`) or `foregroundColorVar()`. Fill tokens (`*-fill-*`) are backgrounds, not foregrounds, and `SelectChoice.color` rejects them. 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". 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 `TabNavigator` (`@kerfjs/ui/tab-navigator`, iOS bottom tabs, each tab its own `NavStack`) for 2–5 co-equal sections on `compact`; show an unread count on a tab with its `badge` (a number or short string, rendered as the top-trailing danger `Badge` on the icon) plus a localized `badgeLabel` ("3 unread", folded into the tab's name as "Inbox, 3 unread"), never by concatenating the count into `label` or restyling the badge; for new content without a count pass `badge: true` (the text-free dot) with its required `badgeLabel` ("New activity"). 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. The stack's top chrome is a real `Toolbar`: put a view's title and groups on `NavStackView.toolbar` (`title`, `leading`, `center`, `trailing`), where its Toolbar configuration overrides stack-wide `toolbarConfig` defaults; configure `backIcon` / `backText` through the stack, never with CSS. Each view and the stack fallback use a structured `bottomToolbar` with an accessible `label`; a view can also provide `header` / `footer`, `headerList` / `footerList`, and `pane` configuration, which render a Pane around that view's scrolling content. `SplitView` forwards both of its inner components: `resizable` takes the list `ResizableRegion`'s `separator`, `handleIcon`, `contentOverflow`, and collapse props (`collapsed`, `transitioning`, `collapseMotion`, `restoreControl`, `restorePosition`), and `compactStack` takes the compact stack's `toolbarConfig`, `backIcon`, `backText`, `hideToolbar`, `bottomToolbar`, plus `list` / `detail` view toolbars (structured `toolbar` and `bottomToolbar`). Complex tool with peripheral panels → `Workbench` (`@kerfjs/ui/workbench`, collapsible rails + drawer) `atLeast('desktop')`, degrading to `NavStack`/overlays below. Workbench panels are fixed-size unless a panel opts in with `resizable` (`true` or `{ min, max }`); then render `size={sizeSignal.value}` and call `wireWorkbench(root, { id, panels: { leftRail: { size: sizeSignal, storageKey? } }, deviceClass })` from `@kerfjs/ui/wire-workbench` for pointer drags, arrow/Shift+arrow/Home/End on the separator, persistence, and no resizing on `compact` classes. Inline rails, fixed or resizable, leave the work area `mainMinSize` px of width (a `Workbench` prop, default 320, `0` off), and an inline bottom drawer leaves it `mainMinHeight` px of height (default 120, `0` off): resizable panels stop growing there, rails shrink in proportion when the Workbench narrows and the drawer when it gets shorter, so do not add your own main-area `min-width` / `min-height`. Rails present as overlays below the `narrow` Workbench container breakpoint (704px) by default — `responsiveOverlayAt: "compact"` moves that to 448px and `"never"` keeps a rail inline — and a bottom drawer opts in the same way; do not derive `presentation` from `deviceClass`, and overlays never resize. At compact widths an overlay rail fills the Workbench less a 44px dismiss strip (`--kui-workbench-overlay-dismiss-margin`) on the side away from its edge; `compactOverlay: "full"` makes one rail fill it. Pass each such panel's `collapsed` signal to `wireWorkbench` too (`panels: { leftRail: { collapsed: navCollapsed } }`, `size` optional) so the overlay is transient like `wireSidebar`'s compact overlay: it collapses when the breakpoint begins to apply (the inline state returns when it ends), takes focus on its first control and keeps Tab inside it while open, and closes on Escape or an outside press with focus returned to its toggle (give each toggle `aria-controls` naming its panel's derived id, `<workbench id>-left-rail` / `-right-rail` / `-bottom-drawer`, so a panel open at wire-up has a focus target too); opening one overlay closes the other open overlays, so they never cover each other's controls; do not hand-roll those listeners (`dismissOverlays: false` opts out of all of it, `exclusiveOverlays: false` of exclusivity only). Collapse stays the app's `collapsed` flag and keeps the size, so an expanded panel returns at its last size. Let the Workbench compose panel toolbars: give each panel `toolbar: { label, title?, leading?, center?, trailing?, toggle: { action, name, showLabel?, hideLabel? } }` and the work area `mainToolbar` (and `mainBottomToolbar` for a drawer). Each of these toolbars takes the `Toolbar`'s configuration (`ToolbarConfig`: `dividerSides`, `centerAlign`, `responsive`, `responsiveAt`, `safeAreaEdges`); configure a composed toolbar through those props (for example `dividerSides: ""` to drop its divider), never with CSS. Configure the composed panes and chrome lists the same way: a panel's `pane` (and `CollapsiblePanel`'s `pane`) and the Workbench's `mainPane` take `PaneConfig` (`contentElement`, `contentLabel`, `separators`, `safeAreaEdges` — for example `{ contentElement: "nav", contentLabel: "Files" }` for a navigator rail), and `mainHeaderList` / `mainFooterList` take `ListConfig` (`gap`, `hAlign`, `vAlign`, `dividerSides`, `textInsets`, `controlInsets`). Open, a panel's toolbar places groups in its leading, center, and trailing zones, with the toggle last; mark a ToolbarControlGroup relocateOnCollapse to keep it available when closed (pass marked groups directly or in arrays rather than JSX fragments); closed, marked groups follow zone order into the work area before the toggle — a left rail's lead `mainToolbar`, a right rail's end it, a drawer's trail `mainBottomToolbar` or float in a corner `FloatingToolbar` — and panel-only groups stay behind. A control sits near where its effect appears: a collapsed drawer's restore belongs in the bottom toolbar or a `FloatingToolbar` beside the drawer, not in a distant top toolbar. Do not hand-place panel toggles in the work-area toolbar or render a second copy, and handle only the toggle's `data-action`. A collapsed panel renders `inert` and `aria-hidden` by itself, on the rail/drawer and its content (its `restoreControl` stays outside and reachable), so do not add your own `tabindex`, `aria-hidden`, or `inert` to hide it. These are declarative (the app owns the stack/selection/collapsed/active state as signals) with disposer-returning `wire…` helpers; each stays out of the barrel, and its CSS-aware browser import loads the layout's CSS plus that of every component it renders (`Pane`, `Toolbar`, `List`, …), so do not hand-import `pane.css` or the other internal stylesheets; the companion `.css` subpath is only for pipelines without the `browser` condition. 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. Give a standalone panel the same `toolbar` roles and render `CollapsiblePanelRelocated` in your work-area toolbar (first in leading for a left rail, last in trailing for a right rail, a bottom toolbar or a `FloatingToolbar` restoreControl for a drawer) instead of hand-placing a second toggle. A collapsed `CollapsiblePanel`, `ResizableRegion`, or Workbench panel renders `inert` and `aria-hidden` by itself, so do not hide collapsed content yourself either. Likewise an open side overlay (a Workbench rail overlay, a `wireSidebar` compact overlay, an overlay `CollapsiblePanel` or horizontal `ResizableRegion`) hides the covered work area's `FloatingToolbar`s and restore corners by itself until it closes, so do not hide them from overlay state. A compact overlay opens only on a user action: wire-up on a compact device and a wide-to-compact crossing collapse every panel, and a wide crossing restores the inline state. Seed the signal with `signal(device.value.compact)` and pass the panel's `inlineCollapsed` default so the first compact render has no overlay. Dialogs pick the same inner layout, then present per device class (full-screen modal on `compact`, inline on desktop). A list-detail dialog is a Workbench-shaped layout on roomy devices: a full-height list sidebar and a full-height main column, each a `Pane` with its own top `Toolbar`; the main column holds the primary xl title, the close control (`data-dialog="close"` in a `without-header` Web Awesome dialog), and the record actions, never a header spanning both columns. A top-level percentage-height shell needs a definite containing height: opt into `@kerfjs/ui/document.css` and put `.kui-app-root` on the one direct mount container, or provide equivalent application-owned geometry. The global baseline is deliberately absent from `styles.css` and component imports. See `docs/app-layouts.md`, `docs/document-baseline.md`, and `docs/collapsible-panel.md`. 23. Layouts and `Pane` are safe-area aware without configuration: backgrounds, separators, and dividers paint through a device's unsafe areas (a collapsible rail or drawer grows by the inset it docks to), content is padded only on the sides a region actually reaches, and block insets are scroll padding inside the scroller so first/last content can always be scrolled clear. Interior edges get nothing, and a collapsed rail hands its edge back to the center. Never add your own `env(safe-area-inset-*)` padding around a kerf layout or pane — that double-insets. In an app-owned arrangement of panes, pass `Pane.safeAreaEdges` (the sides that pane reaches; `[]` opts out); give an app bar or bottom bar that sits at a screen edge outside a Pane header or footer `Toolbar.safeAreaEdges` for the sides it reaches (for example `['block-start', 'inline-start', 'inline-end']`); the Workbench `mainToolbar` / `mainBottomToolbar` and panel `toolbar` configurations forward the same `safeAreaEdges` to their `Toolbar`. Do not set the internal `--kui-edge-inset-*` context yourself. The device insets are `--kui-safe-area-*` (defaulting to `env()`), overridable on `:root`. See `docs/app-layouts.md` "Safe areas".
|
|
271
271
|
|
|
272
272
|
For application tabs, `AppTab presentation="icon-only"` retains its accessible `name`, `labelMaxWidth` truncates the visible name, and `attention` colors it through `--kui-app-tab-attention-color`. Configure TabBar strip geometry through public `--kui-tab-bar-strip-*` tokens.
|
|
273
273
|
|
|
@@ -312,7 +312,7 @@ Common mistakes:
|
|
|
312
312
|
| Add demo-only markup for a production state | Add the state to the production component, then render that export in the catalog |
|
|
313
313
|
| Choose a listed ecosystem component by default | Apply the component-selection guidance above; catalog coverage means supported and themed, not preferred |
|
|
314
314
|
| Add sidebar-specific wrapper padding | Use the unpadded `.kui-pane`; let `ListHeader`, `ListItem`, and `ContentItem` own their 8/1/8 geometry |
|
|
315
|
-
|
|
|
315
|
+
| Expect a bare toolbar control to receive group chrome automatically | Style and name the direct control itself, or use `ToolbarControlGroup` when controls need shared chrome |
|
|
316
316
|
| Reach for `wa-button` for a plain control inside a `ToolbarControlGroup` | Use a plain `<button>` (the group styles it fully); for a popup menu use `PopupMenu`, which renders its own trigger |
|
|
317
317
|
| Render a `Discouraged` Web Awesome element (`wa-dropdown`, `wa-button-group`, `wa-select`, `wa-tab-group`, `wa-icon`, …) directly | Use the Kerf component that wraps or replaces it (`PopupMenu`, `SegmentedControl`, `Select`, `TabBar`, `LucideIcon`); file a component gap rather than dropping to the raw element. `KUI-L301` (`ui-preferences`, also run by `kerf-ui-doctor`) reports the raw tag and names the replacement |
|
|
318
318
|
| Let a toolbar group wrap, or stack an icon above its label | Keep icon and label on one row and let the group size to its content; relocate whole groups with the toolbar's `responsive` policy |
|
|
@@ -361,9 +361,10 @@ titles at every size; default tone retains existing identity and heading colors.
|
|
|
361
361
|
|
|
362
362
|
Navigation transition continuity: `wireNavStack` slides the incoming view over the preserved previous view on push and the outgoing view off on pop, cross-fades both live chrome surfaces with inert snapshots, and settles/cancels an interrupted transition before starting the next. Reduced motion and duration zero settle immediately.
|
|
363
363
|
|
|
364
|
-
For a tab scene with drill-down, place a `NavStack` directly in `
|
|
364
|
+
For a tab scene with drill-down, place a `NavStack` directly in `TabNavigatorTab.content`. Give its views structured `toolbar` and `pane` configuration and omit both stack and view `bottomToolbar`; the navigator bar remains the only bottom chrome. Wire the navigator and stack on their respective roots. See `docs/tab-navigator.md` and the catalog's **NavStack inside a tab** example.
|
|
365
365
|
|
|
366
|
-
Use `Pane.deepInset` (also in `PaneConfig`) or `
|
|
366
|
+
Use `Pane.deepInset` (also in `PaneConfig`) or `TabNavigatorTab.deepInset` for a plain scene when its scrolling content needs a 16px outer gutter. The extra 8px is applied to the scroll surface, while nested Row/List/Grid item margins stay 8px. When a tab scene is a sole Pane or NavStack, configure deep inset on that child's Pane; the tab bar and top toolbar stay full width.
|
|
367
|
+
An edge-to-edge table or similar Pane child can read `--kui-pane-content-inset-inline-start` and `--kui-pane-content-inset-inline-end`: negate them for the child's logical margins, then add them to the child's text padding. The inherited values include routed safe areas and `deepInset`; keep the child in the Pane's single scroll slot. See `docs/app-layouts.md` for the CSS recipe.
|
|
367
368
|
|
|
368
369
|
Expanded search groups accept `expandedOverflow="visible"` to anchor app-owned suggestion/date/help surfaces below their relative root; collapsed/default groups retain existing clipping. Apps own surface placement/dismissal and use `data-token-search-keep-open` or `collapsible.keepOpenOn` for focus.
|
|
369
370
|
|
|
@@ -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.79` 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';
|
|
@@ -248,7 +248,7 @@ function createController(ownerDocument) {
|
|
|
248
248
|
subtree: true,
|
|
249
249
|
childList: true,
|
|
250
250
|
attributes: true,
|
|
251
|
-
// The shown NavStack view and
|
|
251
|
+
// The shown NavStack view and TabNavigator scene change by attribute.
|
|
252
252
|
attributeFilter: [
|
|
253
253
|
SCROLL_OVERFLOW,
|
|
254
254
|
SCROLL_DIVIDER,
|
|
@@ -285,4 +285,4 @@ function createController(ownerDocument) {
|
|
|
285
285
|
|
|
286
286
|
export { wireScrollDividers };
|
|
287
287
|
|
|
288
|
-
//# sourceMappingURL=chunk-
|
|
288
|
+
//# sourceMappingURL=chunk-3CXRQAYT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/wiring/wire-scroll-dividers.ts"],"names":["view"],"mappings":";AAuCA,IAAM,KAAA,GAAyB,CAAC,GAAA,EAAK,GAAA,EAAK,KAAK,GAAG,CAAA;AAGlD,IAAM,MAAA,GAA6B,EAAE,CAAA,EAAG,GAAA,EAAK,GAAG,GAAA,EAAK,CAAA,EAAG,GAAA,EAAK,CAAA,EAAG,GAAA,EAAI;AAEpE,IAAM,YAAA,GAAkE;AAAA,EACtE,CAAA,EAAG,KAAA;AAAA,EACH,CAAA,EAAG,OAAA;AAAA,EACH,CAAA,EAAG,QAAA;AAAA,EACH,CAAA,EAAG;AACL,CAAA;AAGA,IAAM,eAAA,GAAkB,sBAAA;AAExB,IAAM,cAAA,GAAiB,qBAAA;AAQvB,IAAM,SAAA,GAAY,CAAA;AAQlB,IAAM,MAAA,GAAS,CAAC,KAAA,KACd,CAAA,CAAA,EAAI,KAAA,CAAM,UAAA,CAAW,IAAA,EAAM,MAAM,CAAA,CAAE,UAAA,CAAW,GAAA,EAAK,KAAK,CAAC,CAAA,CAAA,CAAA;AAG3D,SAAS,MAAA,CACP,MACA,QAAA,EACK;AACL,EAAA,MAAM,QAAQ,CAAC,GAAG,IAAA,CAAK,gBAAA,CAAoB,QAAQ,CAAC,CAAA;AACpD,EAAA,IAAI,IAAA,CAAK,QAAA,KAAa,CAAA,IAAM,IAAA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MAAW,QAAQ,MAAA,CAAO,IAAA,IAAQ,KAAA,CAAM,OAAA,EAAS,MAAM,EAAE,CAAA;AAC3D,QAAA,OAAA,CAAQ,KAAA,EAAM;AACd,QAAA,QAAA,CAAS,KAAA,EAAM;AACf,QAAA,QAAA,CAAS,KAAA,EAAM;AACf,QAAA,QAAA,GAAW,EAAC;AACZ,QAAA,WAAA,CAAY,OAAO,aAAa,CAAA;AAAA,MAClC;AAAA,IACF,CAAA;AAAA,EACF,CAAA;AACF","file":"chunk-3CXRQAYT.js","sourcesContent":["/**\n * An app-owned scroll arrangement outside a `Pane`: the `id` of the element\n * that scrolls and the `id`s of the pinned chrome on each physical side of it.\n * Each named chrome element shows its divider on the side facing the scroller\n * while content is scrolled away beyond that side. Ids are resolved below the\n * wired root on every refresh, so a re-render that replaces an element keeps\n * the pairing.\n */\nexport interface ScrollDividerTarget {\n /** The `id` of the scrolling element. */\n scroller: string;\n /** Chrome above the scroller: shows its bottom divider once scrolled down. */\n top?: string;\n /**\n * Chrome right of the scroller: shows its left divider while content is\n * hidden beyond the scroller's right edge (never when nothing overflows).\n */\n right?: string;\n /**\n * Chrome below the scroller: shows its top divider while content is hidden\n * beyond the scroller's bottom edge (never when nothing overflows).\n */\n bottom?: string;\n /** Chrome left of the scroller: shows its right divider once scrolled right. */\n left?: string;\n}\n\nexport interface WireScrollDividersOptions {\n /**\n * App-owned scroll arrangements to pair beyond the ones found by structure\n * (every `Pane`'s header and footer around its content, every `NavStack`'s\n * and `TabNavigator`'s chrome around its active region, and every `TabBar`\n * strip).\n */\n targets?: readonly ScrollDividerTarget[];\n}\n\ntype Edge = 't' | 'r' | 'b' | 'l';\n\nconst EDGES: readonly Edge[] = ['t', 'r', 'b', 'l'];\n\n/** The side of a chrome element that faces a scroller it sits on `edge` of. */\nconst FACING: Record<Edge, Edge> = { t: 'b', r: 'l', b: 't', l: 'r' };\n\nconst TARGET_EDGES: Record<Edge, 'top' | 'right' | 'bottom' | 'left'> = {\n t: 'top',\n r: 'right',\n b: 'bottom',\n l: 'left',\n};\n\n/** On a scroller: the edges beyond which content is currently hidden. */\nconst SCROLL_OVERFLOW = 'data-scroll-overflow';\n/** On a chrome element: its sides that currently show a scroll divider. */\nconst SCROLL_DIVIDER = 'data-scroll-divider';\n\n/**\n * Scroll distance, in px, that must be exceeded to count as \"away from an\n * edge\": `scrollWidth`/`scrollHeight` are rounded to whole pixels while the\n * scroll position is fractional, so a scroller at its end can report up to a\n * pixel still to go.\n */\nconst THRESHOLD = 1;\n\ninterface Pairing {\n scroller: HTMLElement;\n chrome: Partial<Record<Edge, HTMLElement>>;\n}\n\n/** A double-quoted CSS attribute-selector value. */\nconst quoted = (value: string) =>\n `\"${value.replaceAll('\\\\', '\\\\\\\\').replaceAll('\"', '\\\\\"')}\"`;\n\n/** Elements matching `selector` at and below root. */\nfunction within<T extends Element>(\n root: HTMLElement | Document,\n selector: string,\n): T[] {\n const found = [...root.querySelectorAll<T>(selector)];\n if (root.nodeType === 1 && (root as HTMLElement).matches(selector))\n found.unshift(root as unknown as T);\n return found;\n}\n\nconst directChild = (parent: Element, selector: string) =>\n [...parent.children].find((child): child is HTMLElement =>\n child.matches(selector),\n );\n\nconst PANE_CHROME = {\n t: '.kui-pane__header, .kui-pane__toolbar',\n b: '.kui-pane__footer',\n} as const;\n\n/** A NavStack's live (not cross-fading copy) chrome on `edge`. */\nconst NAV_STACK_CHROME = {\n t: '.kui-nav-stack__chrome:not([data-nav-chrome-copy])',\n b: '.kui-nav-stack__bottom:not([data-nav-chrome-copy])',\n} as const;\n\n/** A NavStack's active view: the top entry, never one sliding out. */\nfunction activeView(stack: Element): HTMLElement | undefined {\n const viewport = directChild(stack, '.kui-nav-stack__viewport');\n if (!viewport) return undefined;\n return [...viewport.children]\n .filter((child): child is HTMLElement =>\n child.matches(\n '.kui-nav-stack__view[data-nav-active=\"true\"]:not([data-nav-exiting=\"true\"])',\n ),\n )\n .at(-1);\n}\n\n/** A TabNavigator's shown scene. */\nfunction activeScene(scaffold: Element): HTMLElement | undefined {\n const scenes = directChild(scaffold, '.kui-tab-scaffold__scenes');\n return scenes\n ? directChild(scenes, '.kui-tab-scaffold__scene[data-active=\"true\"]')\n : undefined;\n}\n\n/**\n * The elements that may scroll against a layout region's `edge` (the top or\n * bottom of a NavStack view or a TabNavigator scene): the region itself, then,\n * through a sole child that puts no chrome of its own on that edge, a Pane's\n * content slot or a nested NavStack's or TabNavigator's active region. Every\n * candidate is paired with the layout's chrome; one that does not overflow\n * reports nothing, so the chrome keys on whichever element actually scrolls.\n * A sole child with chrome on that edge (a Pane header, a nested NavStack's\n * top chrome, a TabNavigator's bar) stops the walk: that chrome draws its own\n * divider against its own content.\n */\nfunction regionScrollers(region: HTMLElement, edge: 't' | 'b'): HTMLElement[] {\n const found: HTMLElement[] = [];\n let current: HTMLElement | undefined = region;\n while (current) {\n found.push(current);\n if (current.children.length !== 1) break;\n const child: Element = current.children[0]!;\n if (child.matches('.kui-pane')) {\n current = directChild(child, PANE_CHROME[edge])\n ? undefined\n : directChild(child, '.kui-pane__content');\n if (current) found.push(current);\n break;\n }\n if (child.matches('.kui-nav-stack'))\n current = directChild(child, NAV_STACK_CHROME[edge])\n ? undefined\n : activeView(child);\n else if (child.matches('.kui-tab-scaffold') && edge === 't')\n current = activeScene(child);\n else current = undefined;\n }\n return found;\n}\n\n/** Canonical top/right/bottom/left string of the given edges. */\nconst sides = (edges: ReadonlySet<Edge>) =>\n EDGES.filter((edge) => edges.has(edge)).join('');\n\n/**\n * Which edges of `scroller` currently have content hidden beyond them. Nothing\n * overflows when the content fits, so the far edges report no divider then.\n * Horizontal edges are physical, so a right-to-left scroller (whose\n * `scrollLeft` runs from the negative maximum to 0) reports the same sides.\n */\nfunction measure(scroller: HTMLElement): string {\n const edges = new Set<Edge>();\n const maxY = scroller.scrollHeight - scroller.clientHeight;\n if (maxY > THRESHOLD) {\n if (scroller.scrollTop > THRESHOLD) edges.add('t');\n if (maxY - scroller.scrollTop > THRESHOLD) edges.add('b');\n }\n const maxX = scroller.scrollWidth - scroller.clientWidth;\n if (maxX > THRESHOLD) {\n const view = scroller.ownerDocument.defaultView;\n const rtl = view?.getComputedStyle(scroller).direction === 'rtl';\n const left = rtl ? maxX + scroller.scrollLeft : scroller.scrollLeft;\n if (left > THRESHOLD) edges.add('l');\n if (maxX - left > THRESHOLD) edges.add('r');\n }\n return sides(edges);\n}\n\ntype StateAttribute = typeof SCROLL_OVERFLOW | typeof SCROLL_DIVIDER;\ntype Root = HTMLElement | Document;\n\ninterface Registration {\n root: Root;\n targets: readonly ScrollDividerTarget[];\n}\n\n// A document has one attribute writer even when registrations overlap. The\n// WeakMap ties this coordination cache to the document's lifetime.\nconst CONTROLLERS = new WeakMap<\n Document,\n (registration: Registration) => () => void\n>();\n\n/** Set (or, for an empty value, remove) one of this wiring's attributes. */\nfunction write(element: Element, name: StateAttribute, value: string) {\n if (element.getAttribute(name) === (value || null)) return;\n if (name === SCROLL_OVERFLOW) {\n if (value) element.setAttribute(SCROLL_OVERFLOW, value);\n else element.removeAttribute(SCROLL_OVERFLOW);\n } else if (value) element.setAttribute(SCROLL_DIVIDER, value);\n else element.removeAttribute(SCROLL_DIVIDER);\n}\n\n/**\n * Wire scroll dividers below `root`: a divider between pinned chrome and the\n * content that scrolls beside it shows only while content is scrolled away\n * from that edge. Near edges (top, left) hide at the scroll start; far edges\n * (bottom, right) hide at the scroll end and whenever nothing overflows.\n *\n * The wiring only reports scroll state; each component draws its own divider\n * from it. It writes `data-scroll-overflow` (the edges with hidden content, in\n * canonical `t`/`r`/`b`/`l` order) on each scroller, and `data-scroll-divider`\n * (the sides to draw) on each paired chrome element:\n *\n * - every `Pane` with a header or footer: its header shows a bottom divider and\n * its footer a top divider (drawn by the Pane, per its `chromeDividers`);\n * - every `NavStack`'s top chrome and bottom toolbar around its active view,\n * and every `TabNavigator`'s bar under its active scene: the chrome shows a\n * bottom (top chrome) or top (bottom toolbar, bar) divider. The scroller is\n * whichever element actually scrolls there: the view or scene itself, or,\n * through a sole child with no chrome of its own on that edge, a `Pane`'s\n * content or a nested `NavStack` / `TabNavigator` region (a Pane's own header\n * or footer draws that boundary instead);\n * - every `TabBar` strip: the bar draws a divider on each side of the strip\n * whose tabs are scrolled out of view;\n * - each app-owned `targets` pairing: a `Toolbar` or `List` named as chrome\n * draws the divider on its facing side.\n *\n * Structure is re-read after every DOM change below root (a re-render that\n * drops the attributes gets them back before paint), scroll is tracked with\n * one capturing listener per registered root, and size changes of each\n * scroller and its children with a `ResizeObserver`. Overlapping registrations\n * share one attribute writer; each disposer removes its registration, and the\n * final disposer removes the wiring-owned attributes. See\n * `docs/23-app-layouts.md` §3.7.\n */\nexport function wireScrollDividers(\n root: Root,\n { targets = [] }: WireScrollDividersOptions = {},\n): () => void {\n const ownerDocument = (\n root.nodeType === 9 ? (root as Document) : root.ownerDocument\n )!;\n let register = CONTROLLERS.get(ownerDocument);\n if (!register) {\n register = createController(ownerDocument);\n CONTROLLERS.set(ownerDocument, register);\n }\n return register({ root, targets });\n}\n\nfunction createController(\n ownerDocument: Document,\n): (registration: Registration) => () => void {\n const view = ownerDocument.defaultView;\n let disposed = false;\n const registrations = new Set<Registration>();\n const listenedRoots = new Set<Root>();\n let pairings: Pairing[] = [];\n const overflow = new Map<HTMLElement, string>();\n /** Every element this wiring has written, with what it wrote. */\n const written = new Map<Element, Map<StateAttribute, string>>();\n\n const byId = (root: Root, id: string | undefined) => {\n if (!id) return undefined;\n const [match] = within<HTMLElement>(root, `[id=${quoted(id)}]`);\n return match;\n };\n\n const collect = (): Pairing[] => {\n const found: Pairing[] = [];\n for (const { root, targets } of registrations) {\n for (const pane of within<HTMLElement>(root, '.kui-pane')) {\n const scroller = directChild(pane, '.kui-pane__content');\n const header = directChild(pane, PANE_CHROME.t);\n const footer = directChild(pane, PANE_CHROME.b);\n if (scroller && (header || footer))\n found.push({ scroller, chrome: { t: header, b: footer } });\n }\n const pairRegion = (\n region: HTMLElement | undefined,\n edge: 't' | 'b',\n chrome: HTMLElement | undefined,\n ) => {\n if (!region || !chrome) return;\n for (const scroller of regionScrollers(region, edge))\n found.push({ scroller, chrome: { [edge]: chrome } });\n };\n for (const stack of within<HTMLElement>(root, '.kui-nav-stack')) {\n const view = activeView(stack);\n for (const edge of ['t', 'b'] as const)\n pairRegion(view, edge, directChild(stack, NAV_STACK_CHROME[edge]));\n }\n for (const scaffold of within<HTMLElement>(root, '.kui-tab-scaffold'))\n pairRegion(\n activeScene(scaffold),\n 'b',\n directChild(scaffold, '.kui-tab-scaffold__bar'),\n );\n for (const strip of within<HTMLElement>(root, '[data-kui-tab-list]'))\n found.push({ scroller: strip, chrome: {} });\n for (const target of targets) {\n const scroller = byId(root, target.scroller);\n if (!scroller) continue;\n const chrome: Pairing['chrome'] = {};\n for (const edge of EDGES)\n chrome[edge] = byId(root, target[TARGET_EDGES[edge]]);\n found.push({ scroller, chrome });\n }\n }\n return found;\n };\n\n /** Write every paired element's attributes from the measured overflow. */\n const apply = () => {\n const current = new Map<Element, Map<StateAttribute, string>>();\n const dividers = new Map<HTMLElement, Set<Edge>>();\n for (const { scroller, chrome } of pairings) {\n const edges = overflow.get(scroller)!;\n (\n current.get(scroller) ?? current.set(scroller, new Map()).get(scroller)!\n ).set(SCROLL_OVERFLOW, edges);\n for (const edge of EDGES) {\n const element = chrome[edge];\n if (!element) continue;\n const shown = dividers.get(element) ?? new Set<Edge>();\n dividers.set(element, shown);\n if (edges.includes(edge)) shown.add(FACING[edge]);\n }\n }\n for (const [element, shown] of dividers)\n (\n current.get(element) ?? current.set(element, new Map()).get(element)!\n ).set(SCROLL_DIVIDER, sides(shown));\n // Anything written before that is no longer paired gets its attributes back.\n for (const [element, values] of written)\n for (const name of values.keys())\n if (!current.get(element)?.has(name)) write(element, name, '');\n written.clear();\n for (const [element, values] of current) {\n written.set(element, values);\n for (const [name, value] of values) write(element, name, value);\n }\n };\n\n const observed = new Set<Element>();\n const resizeObserver = view?.ResizeObserver\n ? new view.ResizeObserver((entries) => {\n if (disposed) return;\n const scrollers = new Set(pairings.map(({ scroller }) => scroller));\n for (const { target } of entries) {\n const scroller = scrollers.has(target as HTMLElement)\n ? (target as HTMLElement)\n : target.parentElement;\n if (scroller && scrollers.has(scroller))\n overflow.set(scroller, measure(scroller));\n }\n apply();\n })\n : undefined;\n\n const observeSizes = () => {\n if (!resizeObserver) return;\n const wanted = new Set<Element>();\n for (const { scroller } of pairings) {\n wanted.add(scroller);\n for (const child of scroller.children) wanted.add(child);\n }\n for (const element of observed)\n if (!wanted.has(element)) {\n resizeObserver.unobserve(element);\n observed.delete(element);\n }\n for (const element of wanted)\n if (!observed.has(element)) {\n resizeObserver.observe(element);\n observed.add(element);\n }\n };\n\n const refresh = () => {\n pairings = collect();\n overflow.clear();\n for (const { scroller } of pairings)\n overflow.set(scroller, measure(scroller));\n observeSizes();\n apply();\n };\n\n const onScroll = (event: Event) => {\n const scroller = event.target as HTMLElement;\n if (!overflow.has(scroller)) return;\n const edges = measure(scroller);\n if (edges === overflow.get(scroller)) return;\n overflow.set(scroller, edges);\n apply();\n };\n\n const mutationObserver = view?.MutationObserver\n ? new view.MutationObserver((records) => {\n if (disposed) return;\n // A re-render that only dropped or changed attributes this wiring\n // owns gets them back without re-measuring; structure changes\n // re-read every pairing.\n if (\n records.every(\n ({ type, attributeName }) =>\n type === 'attributes' &&\n (attributeName === SCROLL_OVERFLOW ||\n attributeName === SCROLL_DIVIDER),\n )\n )\n apply();\n else refresh();\n })\n : undefined;\n\n const syncRoots = () => {\n const roots = new Set([...registrations].map(({ root }) => root));\n for (const root of listenedRoots)\n if (!roots.has(root)) {\n root.removeEventListener('scroll', onScroll, { capture: true });\n listenedRoots.delete(root);\n }\n for (const root of roots)\n if (!listenedRoots.has(root)) {\n root.addEventListener('scroll', onScroll, {\n capture: true,\n passive: true,\n });\n listenedRoots.add(root);\n }\n mutationObserver?.disconnect();\n for (const root of roots)\n mutationObserver?.observe(root, {\n subtree: true,\n childList: true,\n attributes: true,\n // The shown NavStack view and TabNavigator scene change by attribute.\n attributeFilter: [\n SCROLL_OVERFLOW,\n SCROLL_DIVIDER,\n 'id',\n 'class',\n 'data-nav-active',\n 'data-nav-exiting',\n 'data-active',\n ],\n });\n };\n\n return (registration) => {\n registrations.add(registration);\n syncRoots();\n refresh();\n return () => {\n if (!registrations.delete(registration)) return;\n syncRoots();\n if (registrations.size) refresh();\n else {\n disposed = true;\n resizeObserver?.disconnect();\n for (const [element, values] of written)\n for (const name of values.keys()) write(element, name, '');\n written.clear();\n overflow.clear();\n observed.clear();\n pairings = [];\n CONTROLLERS.delete(ownerDocument);\n }\n };\n };\n}\n"]}
|
|
@@ -75,6 +75,10 @@ function TokenSearchField({
|
|
|
75
75
|
"data-fill": String(fill),
|
|
76
76
|
"data-has-trailing": String(Boolean(trailing || trailingAction)),
|
|
77
77
|
"data-presentation": presentation,
|
|
78
|
+
"data-placeholder": tokens.length ? tokenPlaceholder : placeholder,
|
|
79
|
+
"data-placeholder-visible": String(
|
|
80
|
+
query.length === 0 && tokens.length === 0
|
|
81
|
+
),
|
|
78
82
|
slot,
|
|
79
83
|
children: !resolvedExpanded ? /* @__PURE__ */ jsx(
|
|
80
84
|
"button",
|
|
@@ -288,4 +292,4 @@ function placeTokenSearchCaret(editor, offset) {
|
|
|
288
292
|
|
|
289
293
|
export { TokenSearchField, placeTokenSearchCaret, readTokenSearchField };
|
|
290
294
|
|
|
291
|
-
//# sourceMappingURL=chunk-
|
|
295
|
+
//# sourceMappingURL=chunk-3SXWV2IR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/forms/token-search-field/token-search-field.tsx"],"names":[],"mappings":";;;;AAmHA,SAAS,YAAA,CACP,OACA,MAAA,EACmB;AACnB,EAAA,MAAM,OAAA,GAAU,MAAA,CACb,GAAA,CAAI,CAAC,OAAO,KAAA,MAAW;AAAA,IACtB,KAAA;AAAA,IACA,KAAA;AAAA,IACA,MAAA,EAAQ,IAAA,CAAK,GAAA,CAAI,CAAA,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A,CAAI,CAAA,EAAG,MAAM,CAAA;AAClC,IAAA,IAAI,KAAA,GAAQ,KAAA;AACZ,IAAA,MAAM,MAAA,GAAS,QAAA,CAAS,gBAAA,CAAiB,MAAA,EAAQ,WAAW,SAAA,EAAW;AAAA,MACrE,UAAA,EAAY,CAAC,IAAA,KACX,IAAA,CAAK,aAAA,EAAe,QAAQ,uCAAuC,CAAA,GAC/D,UAAA,CAAW,aAAA,GACX,UAAA,CAAW;AAAA,KAClB,CAAA;AACD,IAAA,KAAA,IAAS,IAAA,GAAO,OAAO,QAAA,EAAS,EAAG,MAAM,IAAA,GAAO,MAAA,CAAO,UAAS,EAAG;AACjE,MAAA,MAAM,MAAA,GAAS,KAAK,WAAA,IAAe,EAAA;AACnC,MAAA,MAAM,MAAA,GAAS,MAAA,CAAO,UAAA,CAAW,QAAA,EAAU,EAAE,CAAA,CAAE,MAAA;AAC/C,MAAA,IAAI,aAAa,MAAA,EAAQ;AACvB,QAAA,KAAA,CAAM,QAAA;AAAA,UACJ,IAAA;AAAA,UACA,WAAW,QAAA,GAAW,CAAA,GAAI,KAAK,GAAA,CAAI,SAAA,EAAW,OAAO,MAAM;AAAA,SAC7D;AACA,QAAA,KAAA,CAAM,SAAS,IAAI,CAAA;AACnB,QAAA,KAAA,GAAQ,IAAA;AACR,QAAA;AAAA,MACF;AACA,MAAA,SAAA,IAAa,MAAA;AAAA,IACf;AACA,IAAA,IAAI,CAAC,KAAA,EAAO;AACV,MAAA,KAAA,CAAM,mBAAmB,MAAM,CAAA;AAC/B,MAAA,KAAA,CAAM,SAAS,KAAK,CAAA;AAAA,IACtB;AAAA,EACF;AACA,EAAA,SAAA,CAAU,eAAA,EAAgB;AAC1B,EAAA,SAAA,CAAU,SAAS,KAAK,CAAA;AAC1B","file":"chunk-3SXWV2IR.js","sourcesContent":["import type { SafeHtml } from 'kerfjs';\nimport { Search, X } from 'lucide';\n\nimport type { KerfUiContent } from '../../../shared/content/semantic-content.js';\nimport { LucideIcon } from '../../media/lucide-icon/lucide-icon.js';\nimport type { TokenSearchModel } from './model/token-search-model.js';\n\nexport interface TokenSearchToken {\n value: string;\n label: string;\n offset?: number;\n accessibleLabel?: string;\n}\n\nexport interface TokenSearchTrailingAction {\n icon: SafeHtml;\n label: string;\n action: string;\n id?: string;\n}\n\nexport type TokenSearchEditorAttributes = Readonly<\n Record<`data-${string}`, string | undefined> & {\n 'data-component'?: never;\n 'data-key'?: never;\n 'data-morph-skip'?: never;\n 'data-token-search-editor'?: never;\n 'data-token-count'?: never;\n 'data-placeholder'?: never;\n }\n>;\n\ninterface TokenSearchFieldBaseProps {\n id: string;\n label: string;\n query?: string;\n tokens?: readonly TokenSearchToken[];\n /** Opt-in grammar, suggestion, and evaluation state. Overrides `query` and `tokens`. */\n model?: TokenSearchModel;\n /**\n * Editor identity for a programmatic text replacement. The editor's text is\n * DOM-owned between token changes, so a new `query` with the same tokens\n * does not re-render it (that would reset the caret on every keystroke).\n * Change `revision` when the app replaces the text itself — reseeding a\n * persistent dialog's field on reopen, applying a saved search — and the\n * editor is rebuilt from `query` and `tokens`.\n */\n revision?: string | number;\n placeholder?: string;\n tokenPlaceholder?: string;\n disabled?: boolean;\n autofocus?: boolean;\n /** Let an expanded collapsible field consume the available inline width. */\n fill?: boolean;\n leading?: KerfUiContent;\n editAction?: string;\n removeAction?: string;\n clearAction?: string;\n clearLabel?: string;\n /** Icon for the clear button. Default: the Lucide `x` glyph token chips also use. */\n clearIcon?: SafeHtml;\n className?: string;\n editorAttributes?: TokenSearchEditorAttributes;\n /** Native named-slot assignment when composed inside a web component. */\n slot?: string;\n}\n\ntype TokenSearchTrailingProps =\n | { trailing?: KerfUiContent; trailingAction?: never }\n | { trailing?: never; trailingAction: TokenSearchTrailingAction };\n\ntype TokenSearchPresentationProps =\n | {\n /** Standalone field chrome or the inset visual layer of a configured toolbar group. */\n presentation?: 'standalone' | 'toolbar-group';\n hint?: never;\n required?: never;\n }\n | {\n /** Visible form label and optional hint around the full-width standalone control. */\n presentation: 'form-field';\n hint?: string;\n /** Marks the editor required; the app validates its value. */\n required?: boolean;\n };\n\ntype TokenSearchCollapsibleProps =\n | {\n /** Allow an empty field to render as one iconic action. */\n collapsible: true;\n /** Keep an empty collapsible field open while the application owns focus. */\n expanded?: boolean;\n expandAction?: string;\n expandLabel?: string;\n }\n | {\n collapsible?: false;\n expanded?: never;\n expandAction?: never;\n expandLabel?: never;\n };\n\nexport type TokenSearchFieldProps = TokenSearchFieldBaseProps &\n TokenSearchCollapsibleProps &\n TokenSearchTrailingProps &\n TokenSearchPresentationProps;\n\nexport interface TokenSearchFieldValue {\n query: string;\n tokens: TokenSearchToken[];\n}\n\ntype TokenSearchPart =\n { kind: 'text'; value: string } | { kind: 'token'; token: TokenSearchToken };\n\nfunction orderedParts(\n query: string,\n tokens: readonly TokenSearchToken[],\n): TokenSearchPart[] {\n const ordered = tokens\n .map((token, index) => ({\n token,\n index,\n offset: Math.max(0, Math.min(query.length, token.offset ?? query.length)),\n }))\n .sort(\n (left, right) => left.offset - right.offset || left.index - right.index,\n );\n const parts: TokenSearchPart[] = [];\n let cursor = 0;\n for (const { token, offset } of ordered) {\n parts.push({ kind: 'text', value: query.slice(cursor, offset) });\n parts.push({ kind: 'token', token: { ...token, offset } });\n cursor = offset;\n }\n parts.push({ kind: 'text', value: query.slice(cursor) });\n return parts;\n}\n\nfunction CloseIcon() {\n return <LucideIcon icon={X} name=\"x\" />;\n}\n\nexport function TokenSearchField({\n id,\n label,\n query = '',\n tokens = [],\n model,\n revision,\n placeholder = 'Search',\n tokenPlaceholder = 'Add search…',\n disabled = false,\n autofocus = false,\n fill = false,\n collapsible = false,\n expanded = false,\n expandAction = 'expand-token-search',\n expandLabel,\n leading,\n trailing,\n trailingAction,\n presentation = 'standalone',\n hint,\n required = false,\n editAction = 'edit-search-token',\n removeAction = 'remove-search-token',\n clearAction = 'clear-token-search',\n clearLabel = 'Clear search',\n clearIcon,\n className = '',\n editorAttributes = {},\n slot,\n}: TokenSearchFieldProps) {\n if (model) {\n query = model.state.value.query;\n tokens = model.state.value.tokens;\n }\n const suggestions = model?.suggestions.value ?? [];\n const parts = orderedParts(query, tokens);\n const tokenKey = tokens.map((token) => token.value).join('|');\n const key = model\n ? `${id}@${String(revision ?? '')}:${model.editorRevision.value}:${tokenKey}`\n : revision === undefined\n ? `${id}:${tokenKey}`\n : `${id}@${String(revision)}:${tokenKey}`;\n const resolvedExpanded =\n !collapsible || expanded || query.length > 0 || tokens.length > 0;\n const control = (\n <div\n class={`kui-token-search ${presentation === 'form-field' ? '' : className}`.trim()}\n data-component=\"token-search-field\"\n data-token-search-id={id}\n data-disabled={String(disabled)}\n data-collapsible={String(collapsible)}\n data-expanded={String(resolvedExpanded)}\n data-fill={String(fill)}\n data-has-trailing={String(Boolean(trailing || trailingAction))}\n data-presentation={presentation}\n data-placeholder={tokens.length ? tokenPlaceholder : placeholder}\n data-placeholder-visible={String(\n query.length === 0 && tokens.length === 0,\n )}\n slot={slot}\n >\n {!resolvedExpanded ? (\n <button\n type=\"button\"\n class=\"kui-token-search__expand\"\n data-action={expandAction}\n aria-label={expandLabel ?? label}\n title={expandLabel ?? label}\n disabled={disabled}\n >\n <LucideIcon icon={Search} name=\"search\" />\n </button>\n ) : (\n <>\n <span class=\"kui-token-search__leading\" aria-hidden=\"true\">\n {leading ?? <LucideIcon icon={Search} name=\"search\" />}\n </span>\n <div\n {...editorAttributes}\n class=\"kui-token-search__editor\"\n data-key={key}\n data-morph-skip\n data-token-search-editor={id}\n data-token-count={tokens.length}\n data-placeholder={tokens.length ? tokenPlaceholder : placeholder}\n role=\"searchbox\"\n aria-label={presentation === 'form-field' ? undefined : label}\n aria-labelledby={\n presentation === 'form-field' ? `${id}-label` : undefined\n }\n aria-describedby={\n presentation === 'form-field' && hint ? `${id}-hint` : undefined\n }\n aria-required={required ? 'true' : undefined}\n aria-disabled={disabled ? 'true' : undefined}\n contenteditable={disabled ? 'false' : 'true'}\n spellcheck=\"false\"\n autofocus={autofocus}\n >\n {parts.map((part) =>\n part.kind === 'text' ? (\n <span\n data-token-search-text\n data-empty={String(part.value.length === 0)}\n >\n {part.value || (tokens.length ? '\\u200b' : '')}\n </span>\n ) : (\n <span\n class=\"kui-token-search__token\"\n contenteditable=\"false\"\n data-component=\"token-search-token\"\n data-token-value={part.token.value}\n >\n <button\n type=\"button\"\n class=\"kui-token-search__token-edit\"\n data-action={editAction}\n data-token-value={part.token.value}\n aria-label={`Edit ${part.token.accessibleLabel ?? part.token.label}`}\n disabled={disabled}\n >\n {part.token.label}\n </button>\n <button\n type=\"button\"\n class=\"kui-token-search__token-remove\"\n data-action={removeAction}\n data-token-value={part.token.value}\n aria-label={`Remove ${part.token.accessibleLabel ?? part.token.label}`}\n disabled={disabled}\n >\n <CloseIcon />\n </button>\n </span>\n ),\n )}\n </div>\n {(query || tokens.length > 0) && (\n <button\n type=\"button\"\n class=\"kui-token-search__clear\"\n data-action={clearAction}\n aria-label={clearLabel}\n title={clearLabel}\n disabled={disabled}\n >\n {clearIcon ?? <CloseIcon />}\n </button>\n )}\n {trailingAction ? (\n <button\n type=\"button\"\n class=\"kui-token-search__trailing-action\"\n id={trailingAction.id}\n data-action={trailingAction.action}\n aria-label={trailingAction.label}\n title={trailingAction.label}\n disabled={disabled}\n >\n {trailingAction.icon}\n </button>\n ) : trailing ? (\n <span class=\"kui-token-search__trailing\">{trailing}</span>\n ) : null}\n {!disabled && suggestions.length > 0 && (\n <div\n class=\"kui-token-search__suggestions\"\n data-token-search-keep-open\n >\n {suggestions.map((suggestion) => (\n <button\n type=\"button\"\n class=\"kui-token-search__suggestion\"\n data-token-search-suggestion={suggestion.value}\n >\n {suggestion.label}\n </button>\n ))}\n </div>\n )}\n </>\n )}\n </div>\n );\n if (presentation !== 'form-field') return control;\n return (\n <div\n class={`kui-token-search__field ${className}`.trim()}\n data-token-search-form-field={id}\n >\n <div\n class=\"kui-token-search__field-label\"\n id={`${id}-label`}\n data-token-search-form-label={id}\n >\n {label}\n {required && (\n <span class=\"kui-token-search__field-required\" aria-hidden=\"true\">\n *\n </span>\n )}\n </div>\n {control}\n {hint && (\n <div class=\"kui-token-search__field-hint\" id={`${id}-hint`}>\n {hint}\n </div>\n )}\n </div>\n );\n}\n\n/** Read editable text and ordered token offsets from a rendered TokenSearchField editor. */\nexport function readTokenSearchField(\n editor: HTMLElement,\n knownTokens: readonly TokenSearchToken[] = [],\n): TokenSearchFieldValue {\n let query = '';\n const tokens: TokenSearchToken[] = [];\n const visit = (node: Node): void => {\n if (node.nodeType === Node.TEXT_NODE) {\n query += (node.textContent ?? '')\n .replaceAll('\\u00a0', ' ')\n .replaceAll('\\u200b', '');\n return;\n }\n if (!(node instanceof HTMLElement)) return;\n if (node.matches('[data-component=\"token-search-token\"]')) {\n const value = node.dataset.tokenValue;\n const known = knownTokens.find((token) => token.value === value);\n if (known) tokens.push({ ...known, offset: query.length });\n else if (value)\n tokens.push({ value, label: value, offset: query.length });\n return;\n }\n if (node.tagName === 'BR') {\n query += ' ';\n return;\n }\n for (const child of node.childNodes) visit(child);\n };\n for (const child of editor.childNodes) visit(child);\n return { query, tokens };\n}\n\n/** Focus an editor and place its caret at a text offset, skipping atomic token chips. */\nexport function placeTokenSearchCaret(\n editor: HTMLElement,\n offset?: number,\n): void {\n editor.focus({ preventScroll: true });\n const selection = globalThis.getSelection();\n if (!selection) return;\n const range = document.createRange();\n if (offset === undefined) {\n range.selectNodeContents(editor);\n range.collapse(false);\n } else {\n let remaining = Math.max(0, offset);\n let found = false;\n const walker = document.createTreeWalker(editor, NodeFilter.SHOW_TEXT, {\n acceptNode: (node) =>\n node.parentElement?.closest('[data-component=\"token-search-token\"]')\n ? NodeFilter.FILTER_REJECT\n : NodeFilter.FILTER_ACCEPT,\n });\n for (let node = walker.nextNode(); node; node = walker.nextNode()) {\n const source = node.textContent ?? '';\n const length = source.replaceAll('\\u200b', '').length;\n if (remaining <= length) {\n range.setStart(\n node,\n source === '\\u200b' ? 0 : Math.min(remaining, source.length),\n );\n range.collapse(true);\n found = true;\n break;\n }\n remaining -= length;\n }\n if (!found) {\n range.selectNodeContents(editor);\n range.collapse(false);\n }\n }\n selection.removeAllRanges();\n selection.addRange(range);\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { readTokenSearchField, placeTokenSearchCaret } from './chunk-
|
|
1
|
+
import { readTokenSearchField, placeTokenSearchCaret } from './chunk-3SXWV2IR.js';
|
|
2
2
|
import { autoUpdate, computePosition, offset, flip, shift, size } from '@floating-ui/dom';
|
|
3
3
|
import { delegate, delegateCapture, signal } from 'kerfjs';
|
|
4
4
|
|
|
@@ -379,6 +379,10 @@ function wireTokenSearchFields(root, {
|
|
|
379
379
|
const field = editor.closest(
|
|
380
380
|
'[data-component="token-search-field"]'
|
|
381
381
|
);
|
|
382
|
+
if (field)
|
|
383
|
+
field.dataset.placeholderVisible = String(
|
|
384
|
+
!editor.querySelector(TOKEN_SELECTOR) && readTokenSearchField(editor).query.length === 0
|
|
385
|
+
);
|
|
382
386
|
const id = field?.dataset.tokenSearchId;
|
|
383
387
|
if (id && field?.dataset.disabled !== "true") {
|
|
384
388
|
const model = models[id];
|
|
@@ -772,4 +776,4 @@ function wireTokenSearchFields(root, {
|
|
|
772
776
|
|
|
773
777
|
export { wireTokenSearchFields };
|
|
774
778
|
|
|
775
|
-
//# sourceMappingURL=chunk-
|
|
779
|
+
//# sourceMappingURL=chunk-62VMNBV2.js.map
|