@kerfjs/ui 5.0.0-beta.121 → 5.0.0-beta.123
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/ai/component-catalog.json +5 -8
- package/ai/component-composition.json +0 -2
- package/ai/components/README.md +1 -1
- package/ai/components/document-baseline.md +2 -2
- package/ai/components/tabs.md +3 -4
- package/ai/public-api-signatures-v1.md +3 -6
- package/ai/skill.md +4 -4
- package/ai/webawesome-jsx-signatures-v1.md +1 -1
- package/dist/{chunk-BSNKDW4X.js → chunk-ROEBKSIY.js} +1 -4
- package/dist/chunk-ROEBKSIY.js.map +1 -0
- package/dist/{chunk-HJWFHJ3Z.js → chunk-WPP5Q4A5.js} +10 -82
- package/dist/chunk-WPP5Q4A5.js.map +1 -0
- package/dist/{chunk-7AK5I7U7.js → chunk-YWLDLNAV.js} +1 -1
- package/dist/{chunk-7AK5I7U7.js.map → chunk-YWLDLNAV.js.map} +1 -1
- package/dist/index.js +3 -3
- package/dist/styles/components/collections/list-header/list-header.css +11 -25
- package/dist/styles/components/navigation/tab-bar/tab-bar.css +15 -17
- package/dist/styles/components/navigation/tab-bar-item/tab-bar-item.css +1 -58
- package/dist/styles/document.css +9 -0
- package/dist/styles/list-header.css +11 -25
- package/dist/styles/tab-bar-item.css +1 -58
- package/dist/styles/tab-bar.css +15 -17
- package/dist/tab-bar-item.d.ts +1 -4
- package/dist/tab-bar-item.js +1 -1
- package/dist/tab-bar.d.ts +1 -1
- package/dist/tab-bar.js +1 -1
- package/dist/wire-tab-bars.js +1 -1
- package/docs/component-contract.md +6 -7
- package/docs/component-selection.md +11 -19
- package/docs/design/sketch/Kerf-UI.sketch +0 -0
- package/docs/design/sketch/README.md +73 -0
- package/docs/design/sketch/advanced/README.md +75 -0
- package/docs/design/sketch/button/README.md +270 -0
- package/docs/design/sketch/content/README.md +70 -0
- package/docs/design/sketch/coverage.md +157 -0
- package/docs/design/sketch/forms/README.md +97 -0
- package/docs/design/sketch/lists/README.md +65 -0
- package/docs/design/sketch/toolbar/README.md +73 -0
- package/docs/design/sketch/unified/README.md +69 -0
- package/docs/design/sketch/unified/pages/advanced.png +0 -0
- package/docs/design/sketch/unified/pages/button.png +0 -0
- package/docs/design/sketch/unified/pages/content.png +0 -0
- package/docs/design/sketch/unified/pages/forms.png +0 -0
- package/docs/design/sketch/unified/pages/lists.png +0 -0
- package/docs/design/sketch/unified/pages/toolbar.png +0 -0
- package/docs/design/sketch-runner.md +87 -0
- package/docs/design/templates/list-header/action-dark.svg +1 -1
- package/docs/design/templates/list-header/action.svg +1 -1
- package/docs/design/templates/list-header/toggle-collapsed-dark.svg +1 -1
- package/docs/design/templates/list-header/toggle-collapsed.svg +1 -1
- package/docs/design/templates/list-header/toggle-expanded-dark.svg +1 -1
- package/docs/design/templates/list-header/toggle-expanded.svg +1 -1
- package/docs/design/templates/list-header-dark.svg +1 -1
- package/docs/design/templates/list-header.svg +1 -1
- package/docs/design/templates/tab-bar/workspace-tabs-dark.svg +1 -1
- package/docs/design/templates/tab-bar/workspace-tabs.svg +1 -1
- package/docs/design/templates/tab-bar-dark.svg +1 -1
- package/docs/design/templates/tab-bar.svg +1 -1
- package/docs/design/templates.md +9 -0
- package/docs/document-baseline.md +5 -0
- package/docs/interaction-conventions.md +1 -1
- package/docs/layout.md +7 -6
- package/docs/ux-demo.md +1 -1
- package/docs/webawesome-migration.md +10 -2
- package/llms.txt +5 -4
- package/package.json +17 -6
- package/dist/chunk-BSNKDW4X.js.map +0 -1
- package/dist/chunk-HJWFHJ3Z.js.map +0 -1
|
@@ -887,11 +887,10 @@ the only shrinking, horizontally scrolling region; `leading`, `trailing`, and
|
|
|
887
887
|
trailing action belongs immediately after the final tab and use `end` for a
|
|
888
888
|
separate action pinned to the far edge. Applications own the action content,
|
|
889
889
|
but must not restyle TabBar descendants to recreate that allocation.
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
last peer can align there. That room is scrollable content after the last tab,
|
|
890
|
+
Fixed controls belong in those outer zones, outside the scrolling tablist.
|
|
891
|
+
With `snapTabs`, `wireTabBars` settles tabs at whole-tab starts after scroll and
|
|
892
|
+
selection changes, reserving end room so the last tab can align with the strip's
|
|
893
|
+
inline-start edge in LTR and RTL. That room is scrollable content after the last tab,
|
|
895
894
|
inside the strip, so it lengthens the scroll range without widening the strip:
|
|
896
895
|
the strip still shrinks to its allocation, and `trailing` and `end` stay inside
|
|
897
896
|
the bar. The room is still in-flow content, so it counts toward the strip's
|
|
@@ -902,11 +901,11 @@ frames and never pushes `trailing` or `end` out of the bar; keep the trailing
|
|
|
902
901
|
zone non-shrinking with `snapTabs` to avoid it. The application still owns
|
|
903
902
|
selection and tab order.
|
|
904
903
|
ResizeObserver notifications coalesce snap measurements into the next animation
|
|
905
|
-
frame, so
|
|
904
|
+
frame, so geometry writes cannot resize the observed strip during observer delivery.
|
|
906
905
|
`wireTabBars` watches the whole root it is given, but a mutation re-measures only
|
|
907
906
|
the bars it touched: a change inside a bar, a newly inserted bar, or a `dir`
|
|
908
907
|
change on an element above one. Content elsewhere in the root (terminal output,
|
|
909
|
-
list updates, streamed text) triggers no style or layout reads. A
|
|
908
|
+
list updates, streamed text) triggers no style or layout reads. A snap strip
|
|
910
909
|
re-measures when its own size changes, so a layout change outside the bar still
|
|
911
910
|
reaches it.
|
|
912
911
|
|
|
@@ -455,25 +455,17 @@ For a distinct application action, use `end` to pin it at the far edge; use
|
|
|
455
455
|
strip. Each zone accepts one `ToolbarControlGroup` or one standalone
|
|
456
456
|
`Button` for a primary action with its own chrome. Avoid wrappers and
|
|
457
457
|
application flex overrides.
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
`
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
`--kui-tab-bar-item-pinned-background` token if the surrounding surface differs from
|
|
470
|
-
the default; the pinned tab must cover peers as they scroll beneath it. Its
|
|
471
|
-
background also covers the strip's inline padding and border so scrolled labels
|
|
472
|
-
cannot paint beside the pinned edge, including in right-to-left strips. The
|
|
473
|
-
backing follows the tab's pill radius, keeping a selected pinned tab's corners
|
|
474
|
-
and shadow whole beside the overflow divider. Call
|
|
475
|
-
`wireTabBars` for keyboard selection and reorder behavior and its WebKit RTL
|
|
476
|
-
scroll correction.
|
|
458
|
+
Put controls that must stay visible outside the scrolling tabs in `leading`,
|
|
459
|
+
`trailing`, or `end`. Use a `ToolbarControlGroup` with a button or a standalone
|
|
460
|
+
`Button` for a fixed action, rather than a sticky TabBarItem inside the tablist.
|
|
461
|
+
Set `snapTabs` when scrolling tabs should settle at whole-tab starts.
|
|
462
|
+
`wireTabBars` aligns the selected tab with the strip's inline-start edge in LTR
|
|
463
|
+
and RTL and reserves enough end scroll room for the final tab to align there.
|
|
464
|
+
A partial tab can still appear at the trailing edge as an overflow cue.
|
|
465
|
+
Keep the trailing zone non-shrinking (the default
|
|
466
|
+
`--kui-tab-bar-trailing-flex`) when using `snapTabs`: the reserved end room
|
|
467
|
+
counts toward the strip's share when both zones shrink.
|
|
468
|
+
Call `wireTabBars` for keyboard selection and reorder behavior.
|
|
477
469
|
|
|
478
470
|
- `StateBanner` persists beside affected work; `EmptyState` replaces absent content; a `kerfjs/overlay` `toast()` is transient and must not carry the only copy of important state. With the Web Awesome integration, `wa-callout` is contextual ecosystem content and `wa-toast` is the transient equivalent.
|
|
479
471
|
|
|
Binary file
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Kerf UI Sketch catalog
|
|
2
|
+
|
|
3
|
+
[Kerf-UI.sketch](Kerf-UI.sketch) is the one Kerf UI Sketch Library. It holds
|
|
4
|
+
all 308 editable light and dark Symbols for the 110 template variants, on one
|
|
5
|
+
page per family: Button, Form Controls, Advanced Inputs, Lists and Data,
|
|
6
|
+
Toolbars and Navigation, and Content and Feedback. Each page shows its light
|
|
7
|
+
masters beside its dark masters on a dark surface, ordered by Symbol name.
|
|
8
|
+
Symbols are named `Component / Variant / State / Theme` in the component
|
|
9
|
+
browser, and 141 Color Variables are named `Kerf/<Theme>/<Role>`. See the
|
|
10
|
+
[unified Library guide](unified/README.md) for its identity contract, build,
|
|
11
|
+
and verification. [Coverage](coverage.md) accounts for every source variant.
|
|
12
|
+
Source SVG sheets in [templates](../templates.md) are review material, not
|
|
13
|
+
substitutes for editable Symbols.
|
|
14
|
+
|
|
15
|
+
## Install and update
|
|
16
|
+
|
|
17
|
+
The Library was created and verified with **Sketch 2026.3.1**. Kerf UI ships
|
|
18
|
+
it as a Sketch Library, not a document template: documents link its Symbols
|
|
19
|
+
and Color Variables, so a new release reaches every design that uses them.
|
|
20
|
+
|
|
21
|
+
To install:
|
|
22
|
+
|
|
23
|
+
1. Install Apple's [SF Pro](https://developer.apple.com/fonts/) fonts if they
|
|
24
|
+
aren't already installed. The Library's text uses SF Pro, the font
|
|
25
|
+
production's `system-ui` resolves to on macOS. Without it, Sketch reports
|
|
26
|
+
missing fonts and substitutes another face. Sketch can't embed SF Pro, so
|
|
27
|
+
its Embed Fonts settings leave it unembedded, and viewers without SF Pro
|
|
28
|
+
see a fallback font.
|
|
29
|
+
2. Find the file. In a project that depends on `@kerfjs/ui` it is
|
|
30
|
+
`node_modules/@kerfjs/ui/docs/design/sketch/Kerf-UI.sketch`; you can also
|
|
31
|
+
download it from the
|
|
32
|
+
[repository](https://github.com/brianwestphal/kerf/blob/main/ui/docs/design/sketch/Kerf-UI.sketch).
|
|
33
|
+
3. Copy it to a stable folder outside any package or repository checkout, for
|
|
34
|
+
example `~/Design Libraries/Kerf-UI.sketch`. Don't add it from
|
|
35
|
+
`node_modules`: a reinstall or branch switch would move or delete the file
|
|
36
|
+
your designs link to.
|
|
37
|
+
4. In Sketch, open **Settings → Libraries**, choose **Add Library…**, and
|
|
38
|
+
select the copy.
|
|
39
|
+
|
|
40
|
+
To use it, insert a Symbol from the component browser. Symbols are named
|
|
41
|
+
`Component / Variant / State / Theme`, so typing `Button` finds every Button.
|
|
42
|
+
Kerf's Color Variables (`Kerf/<Theme>/<Role>`) appear in the color picker
|
|
43
|
+
under the Library's name.
|
|
44
|
+
|
|
45
|
+
To update, copy the newly published file over the same installed path. Sketch
|
|
46
|
+
then offers the Library update in any open document that uses it; accept it to
|
|
47
|
+
sync. Linked instances keep their overrides: the Library's document ID, Symbol
|
|
48
|
+
IDs, Text layer IDs, and Color Variable IDs stay the same across releases, and
|
|
49
|
+
the build fails if any of them changes. Don't add the new file as a second
|
|
50
|
+
Library alongside the old one. If the native format or supported Sketch version changes, this guide
|
|
51
|
+
and the unified guide must record the new verification result before
|
|
52
|
+
publication.
|
|
53
|
+
|
|
54
|
+
## Family build inputs
|
|
55
|
+
|
|
56
|
+
`Kerf-UI.sketch` is assembled from six family Libraries, which are the
|
|
57
|
+
maintained build inputs rather than files to install:
|
|
58
|
+
[Button](button/README.md), [Forms](forms/README.md),
|
|
59
|
+
[Advanced inputs](advanced/README.md), [Lists and data](lists/README.md),
|
|
60
|
+
[Toolbars and navigation](toolbar/README.md), and
|
|
61
|
+
[Content and feedback](content/README.md). Each family pipeline owns capture,
|
|
62
|
+
semantic layout, edited-source migration, and Color Variable binding for its
|
|
63
|
+
masters, and pins its own document ID (Sketch assigns a new one on each save).
|
|
64
|
+
After a family changes, rebuild the unified Library with
|
|
65
|
+
`npm run sketch:library` from `ui/`.
|
|
66
|
+
|
|
67
|
+
A multi-control SVG variant is a showcase page; it is not an individual
|
|
68
|
+
reusable component.
|
|
69
|
+
|
|
70
|
+
The `@kerfjs/ui` npm package ships `Kerf-UI.sketch`, its page overviews, and
|
|
71
|
+
these guides. The family build-input Libraries, manifests, captured fixtures,
|
|
72
|
+
and verification evidence the guides mention live in the
|
|
73
|
+
[repository](https://github.com/brianwestphal/kerf/tree/main/ui/docs/design/sketch).
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Advanced inputs Sketch library
|
|
2
|
+
|
|
3
|
+
[Kerf-Advanced.sketch](Kerf-Advanced.sketch) contains 34 editable light and
|
|
4
|
+
dark Symbols for 17 source variants across Select, SearchField, TagField,
|
|
5
|
+
Slider, ColorField, ColorPicker, and ColorSwatches. Each template variant has
|
|
6
|
+
its own master in each theme. All imported content remains native Text and
|
|
7
|
+
vector paths, with no bitmap layers. Shared Color Variables bind native text,
|
|
8
|
+
input fills, and borders; [the manifest](symbol-manifest.json) pins
|
|
9
|
+
Symbol, Text, and Color Variable IDs.
|
|
10
|
+
|
|
11
|
+
The builder reads each captured string's CSS weight and font family, so native
|
|
12
|
+
Text matches the production capture: 650 becomes semibold, 500 medium, and a
|
|
13
|
+
monospace capture keeps its named face. A label that outgrows its fixed frame
|
|
14
|
+
at the heavier weight is refitted instead of wrapping.
|
|
15
|
+
|
|
16
|
+
This library was created and tested with Sketch 2026.3.1. Designers install the unified [Kerf-UI.sketch](../Kerf-UI.sketch), which
|
|
17
|
+
`npm run sketch:library` rebuilds from this file with the same Symbol, Text,
|
|
18
|
+
and Color Variable identities; this family file is its build input.
|
|
19
|
+
The exporter checks previously published identities.
|
|
20
|
+
|
|
21
|
+
When a source SVG changes, `generate` updates the published layers in place,
|
|
22
|
+
including text, geometry, gradients, and checkerboard paints, so the Symbol,
|
|
23
|
+
Text override, and layer IDs stay the same. Unchanged paint colors keep their
|
|
24
|
+
Color Variables; run `assets` afterward to bind changed colors. Published
|
|
25
|
+
Color Variables stay in the library even when no Symbol uses them. A changed
|
|
26
|
+
layer count, layer or path type, or a reordered label is rejected before any
|
|
27
|
+
published layer changes; such an edit needs a deliberate override-key
|
|
28
|
+
migration.
|
|
29
|
+
|
|
30
|
+
## Regenerate and verify
|
|
31
|
+
|
|
32
|
+
From `ui/`, with the project's login-shell Node toolchain and one existing
|
|
33
|
+
Sketch process:
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
npm run sketch:advanced -- capture
|
|
37
|
+
npm run sketch:advanced -- generate
|
|
38
|
+
npm run sketch:advanced -- assets
|
|
39
|
+
npm run sketch:advanced -- verify
|
|
40
|
+
npm run sketch:advanced -- sync
|
|
41
|
+
node scripts/sketch/advanced/compare.mjs
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
`sync` proves linked consumers follow an update. It builds a consumer on the
|
|
45
|
+
published Library with a Text override per instance, publishes a next version
|
|
46
|
+
with one master text edited under the same document ID, syncs through Sketch's
|
|
47
|
+
libraries controller, and checks that the edit arrives, the overrides survive,
|
|
48
|
+
and save/reopen keeps both (`sync-verification.json`).
|
|
49
|
+
|
|
50
|
+
The capture renders the production templates in Chromium, clips each
|
|
51
|
+
component root, and converts it to SVG. It turns `hsl(...)` gradient stops
|
|
52
|
+
into equivalent hex values because Sketch's SVG importer loses their hue.
|
|
53
|
+
It also flattens the opacity track's translucent checker squares to their
|
|
54
|
+
displayed light/dark colors; both changes retain editable vector shapes.
|
|
55
|
+
The native tasks use the serial runner in the existing Sketch process and
|
|
56
|
+
preserve preexisting documents and Library registrations.
|
|
57
|
+
|
|
58
|
+
Verification saves and reopens the library, imports 14 linked instances across
|
|
59
|
+
all seven families and both themes, applies short text overrides and an 80px
|
|
60
|
+
width increase, and saves and reopens the consumer document. The reviewed
|
|
61
|
+
`comparison-*.png` files show the production capture, native master, and
|
|
62
|
+
linked wide instance side by side. Select, SearchField, TagField, Slider,
|
|
63
|
+
and ColorField stretch their field surfaces with the instance while leading
|
|
64
|
+
content stays left and trailing controls stay right. ColorPicker and
|
|
65
|
+
ColorSwatches are fixed-size widgets: a wider instance keeps them at their
|
|
66
|
+
authored size, pinned left. The builder turns the imported capture from a
|
|
67
|
+
Sketch Graphic, which would scale its contents, into a plain group so these
|
|
68
|
+
pins apply, and re-applies the layout to every master on each build. Captured blurred box shadows import as hard offset
|
|
69
|
+
rectangles, so the builder gives each imported shadow layer a native Gaussian
|
|
70
|
+
blur with the captured radius.
|
|
71
|
+
|
|
72
|
+
The captured Slider value, ColorPicker selection, and popup/field states are
|
|
73
|
+
static design states. Browser interaction, range input behavior, and live
|
|
74
|
+
gradient selection remain in `@kerfjs/ui`; the Sketch file provides editable
|
|
75
|
+
appearance at the captured state.
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
# Native Sketch Button library
|
|
2
|
+
|
|
3
|
+
`Kerf-Button.sketch` contains 40 editable native Symbols: the six pilot
|
|
4
|
+
presentations plus 34 visual variants, each captured in light and dark from
|
|
5
|
+
the production Button. The original six are primary brand,
|
|
6
|
+
secondary, and primary brand with a Plus icon, each in light and dark. They are
|
|
7
|
+
captured from the production `Button` and `LucideIcon` components, not from
|
|
8
|
+
the multi-control SVG design-template sheet. Text remains a native Text layer,
|
|
9
|
+
icons remain vector paths, and the Symbol frame owns its fill, border, and
|
|
10
|
+
12px corners. No bitmap layers are present.
|
|
11
|
+
|
|
12
|
+
The library is part of the `@kerfjs/ui` package under
|
|
13
|
+
`docs/design/sketch/button/`. It targets Sketch 2026.3.1, which was used for
|
|
14
|
+
the native save/reopen and Library import checks. A licensed macOS Sketch
|
|
15
|
+
installation and Python 3 are required for native generation and verification.
|
|
16
|
+
Python restores the Library document ID in the staged Sketch archive. Browser
|
|
17
|
+
capture and source checks need the repository's Node toolchain and Playwright
|
|
18
|
+
Chromium, but no Sketch installation.
|
|
19
|
+
|
|
20
|
+
## Reproduce from a fresh checkout
|
|
21
|
+
|
|
22
|
+
From `ui/`, run Node package commands through the configured login shell:
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
npm ci
|
|
26
|
+
npm run build
|
|
27
|
+
npx playwright install chromium
|
|
28
|
+
npm run sketch:button -- capture
|
|
29
|
+
npm run sketch:button -- check-source
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Open Sketch normally and wait for its startup to finish. Leave the app running
|
|
33
|
+
for the native steps:
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
npm run sketch:button -- generate
|
|
37
|
+
npm run sketch:button -- verify
|
|
38
|
+
npm run sketch:button -- render
|
|
39
|
+
npm run sketch:button -- fill
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
`npm run sketch:button -- all` performs the capture, native, fill-width, and render
|
|
43
|
+
steps in order after `npm run build`. The native commands refuse to start
|
|
44
|
+
without an existing Sketch process and fail explicitly if Sketch or its
|
|
45
|
+
license is unavailable. They use the serial runner documented in
|
|
46
|
+
[Sketch job runner](../../sketch-runner.md), never `--new-instance`. Each job
|
|
47
|
+
records only documents and temporary Library registrations it created and
|
|
48
|
+
closes/removes only those after save/reopen. Existing documents, Libraries,
|
|
49
|
+
and the app process remain open. If cleanup cannot be acknowledged, follow
|
|
50
|
+
the runner's recovery instructions before starting another job.
|
|
51
|
+
Regeneration builds into a uniquely named sibling `.sketch` file, then
|
|
52
|
+
replaces the published library only after native build and layout both finish.
|
|
53
|
+
This avoids Sketch's modal overwrite panel and preserves the previous library
|
|
54
|
+
if generation fails. Recover the runner before inspecting a leftover staged
|
|
55
|
+
file after any interrupted job. When a library already exists, the staged file
|
|
56
|
+
starts as a copy of it. The generator matches each Button variant by its
|
|
57
|
+
stable fixture key in `identity-manifest.json`, updates the master and existing
|
|
58
|
+
Text/Icon layers in place, and rejects a changed master, Symbol, or non-path
|
|
59
|
+
layer ID before replacing the published file. The staged archive retains the
|
|
60
|
+
original document ID, which is the consumer's Library link; the manifest
|
|
61
|
+
checks that ID too. Renamed variants keep their key
|
|
62
|
+
and IDs. Removed variants remain in the library and are marked `retired` in
|
|
63
|
+
the manifest, so their IDs cannot silently move to another component.
|
|
64
|
+
|
|
65
|
+
The pilot capture uses a normal 600×200 browser viewport for domotion, then crops
|
|
66
|
+
each SVG to the measured control bounds without scaling. `fixtures.json`
|
|
67
|
+
holds the six appearance captures; `layout.json` records separate semantic
|
|
68
|
+
layout values measured from resolved production CSS. The native generator
|
|
69
|
+
maps the CSS system font to SF Pro (`scripts/sketch/shared/sans-family.js`) at
|
|
70
|
+
16px medium and constructs
|
|
71
|
+
a centered horizontal Stack with a fixed 16px icon, 8px gap, and 9px insets
|
|
72
|
+
(8px padding plus the border). Existing icon vector paths retain their IDs,
|
|
73
|
+
and their paint follows the production text color. `icon-path-identities.json`
|
|
74
|
+
assigns an author key to each source SVG path in source order. Add a new key
|
|
75
|
+
at the path's position; move a removed path's key from `active` to `retired`.
|
|
76
|
+
Retired keys and IDs cannot be reused. Reorder the keys when reordering paths.
|
|
77
|
+
The generator reconciles by key, preserving native IDs and consumer overrides
|
|
78
|
+
even when multiple paths have identical commands. The identity and variant
|
|
79
|
+
manifests record active key-to-ID bindings and retired tombstones. A changed
|
|
80
|
+
native shape type under an existing key is rejected; retire that key and add
|
|
81
|
+
a new one. Run a baseline generation before making structural edits to a
|
|
82
|
+
library whose manifest does not yet have `iconPaths`. The importer currently
|
|
83
|
+
expects one vector group directly under `Icon`, with ShapePaths under it.
|
|
84
|
+
|
|
85
|
+
## Outputs and checks
|
|
86
|
+
|
|
87
|
+
- `Kerf-Button.sketch`: 40-Symbol library to copy or import.
|
|
88
|
+
- `identity-manifest.json`: stable variant, layer, Color Variable, and shared
|
|
89
|
+
style IDs; `asset-report.json` lists the current semantic assets and colors.
|
|
90
|
+
- `Button-Consumer-Test.sketch`: linked instances with saved text overrides.
|
|
91
|
+
- `Button-Resizing-Test.sketch`: five layouts per Symbol, 30 in total.
|
|
92
|
+
- `verification.json`, `resizing-verification.json`, and
|
|
93
|
+
`layout-checks.json`: editable layers, Library links, round trips,
|
|
94
|
+
dimensions, alignment, and layout assertions.
|
|
95
|
+
- `comparison.png` and `resizing-comparison.png`: browser and native renders
|
|
96
|
+
for visual review. Text rasterization differs slightly between Chromium and
|
|
97
|
+
Sketch; the comparison metrics are descriptive, not a pixel-perfect gate.
|
|
98
|
+
- `variant-fixtures.json`, `variant-manifest.json`, `variant-build-report.json`,
|
|
99
|
+
`variant-asset-report.json`, `variant-verification.json`, and
|
|
100
|
+
`Button-Variant-Consumer-Test.sketch`: source
|
|
101
|
+
measurements, stable new Symbol IDs, editable layers, 102 imported instance
|
|
102
|
+
checks, and save/reopen evidence for the added variants.
|
|
103
|
+
- `variant-comparison-light.png`, `variant-comparison-dark.png`, and
|
|
104
|
+
`variant-comparison.json`: side-by-side production/Sketch appearance review.
|
|
105
|
+
- `variant-resize-comparison.png`: 12 wide browser/linked-instance comparisons
|
|
106
|
+
for icon-only, loading, badges, and both focus appearances in light/dark.
|
|
107
|
+
|
|
108
|
+
Designers install the unified [Kerf-UI.sketch](../Kerf-UI.sketch), which
|
|
109
|
+
`npm run sketch:library` rebuilds from this file with the same Symbol, Text,
|
|
110
|
+
and Color Variable identities; this family file is its build input. When regenerating, rebuild the unified Library afterward. The verification command uses a temporary registration
|
|
111
|
+
and removes it after the job; it never changes an existing registration.
|
|
112
|
+
In the native update check, a separate saved consumer retained its Library
|
|
113
|
+
link plus text and icon-color overrides after a source-fill change, Library
|
|
114
|
+
refresh, and save/reopen. The `verify` command covers fresh imports and saved
|
|
115
|
+
text overrides. A separate scratch regeneration also preserved a user-added
|
|
116
|
+
Text layer outside the generated Symbols.
|
|
117
|
+
|
|
118
|
+
## Shared colors and styles
|
|
119
|
+
|
|
120
|
+
The Library includes eight Color Variables, four shared layer styles, and four
|
|
121
|
+
shared text styles for the six pilot Button presentations, plus 92 Color
|
|
122
|
+
Variables, 38 shared layer styles, and 34 shared text styles for the 34 expanded
|
|
123
|
+
light/dark variants. Pilot names follow semantic
|
|
124
|
+
roles and theme: `Kerf/Light/Brand/Fill Loud`,
|
|
125
|
+
`Kerf/Dark/Neutral/Border Loud`, and so on. Light and dark assets remain
|
|
126
|
+
separate even if their resolved colors match. The two brand presentations
|
|
127
|
+
share their theme's assets. Secondary Buttons use the neutral `On Quiet` text
|
|
128
|
+
and `Border Loud` variables; their transparent fill stays transparent. The
|
|
129
|
+
border variables retain their alpha from the production capture.
|
|
130
|
+
The mapped source roles are `--kui-color-brand-fill-loud`,
|
|
131
|
+
`--kui-color-brand-on-loud`, `--kui-color-neutral-border-loud`, and
|
|
132
|
+
`--kui-color-neutral-on-quiet` in each theme context; their values come from
|
|
133
|
+
the real rendered Button, not a separate Sketch palette.
|
|
134
|
+
|
|
135
|
+
Expanded variant assets have stable role names under each semantic appearance,
|
|
136
|
+
such as `Kerf/Button/Primary Success/Light/Fill`,
|
|
137
|
+
`Kerf/Button/Primary Success/Light/Surface`, and
|
|
138
|
+
`Kerf/Button/Focus Brand/Dark/Focus Outline`. Surface fill, visible border,
|
|
139
|
+
label, icon, loading spinner, badge, focus contrast/outline, and pressed-shadow
|
|
140
|
+
colors bind to Color Variables; the surface, label, and badge layers use shared
|
|
141
|
+
styles. `variant-manifest.json` records every asset ID, and
|
|
142
|
+
`variant-asset-report.json` records current source colors. Regeneration updates
|
|
143
|
+
these assets in place and refuses missing IDs or duplicate names. The native
|
|
144
|
+
`verify-variants` command reopens the saved Library, checks the bindings, then
|
|
145
|
+
imports and reopens linked light/dark instances.
|
|
146
|
+
|
|
147
|
+
Choose the Light or Dark Symbol for the corresponding product theme. Its
|
|
148
|
+
background, border, label, and icon paths reference the appropriate Color
|
|
149
|
+
Variables. Shared layer styles own visual paint, border, and corners; shared
|
|
150
|
+
text styles own the system family, 16px medium weight, centered alignment,
|
|
151
|
+
automatic line height, and semantic text color. The Symbol's Stack owns the
|
|
152
|
+
44px control height, gap, insets, and Fit/Fixed sizing. Instance label and icon
|
|
153
|
+
color overrides remain available. An explicit icon color override wins over
|
|
154
|
+
a later source token change when that Library Symbol is refreshed.
|
|
155
|
+
|
|
156
|
+
`identity-manifest.json` records stable IDs for each Color Variable and
|
|
157
|
+
shared style. Regeneration updates these assets in place and rejects missing
|
|
158
|
+
IDs or name collisions. To propagate a theme token change, recapture the
|
|
159
|
+
production Button, regenerate the Library at its installed stable path, and
|
|
160
|
+
refresh its linked Symbols in consumer documents. A saved consumer retained
|
|
161
|
+
its Library link, text override, and icon color override after a brand fill
|
|
162
|
+
and foreground token update; the regenerated Symbol picked up both new
|
|
163
|
+
semantic colors on save/reopen. The native `verify` command checks serialized
|
|
164
|
+
pilot asset IDs and bindings after reopening the Library. An isolated
|
|
165
|
+
light/dark success-token change kept all 164 expanded asset IDs and the
|
|
166
|
+
affected Symbol IDs; a saved consumer adopted the new source fill while
|
|
167
|
+
keeping an explicit fill override, text override, and Library link through
|
|
168
|
+
sync and save/reopen.
|
|
169
|
+
|
|
170
|
+
Sketch creates a private linked copy of a shared style for each imported
|
|
171
|
+
Symbol. Those consumer IDs include the source style ID in brackets and may
|
|
172
|
+
repeat a style name across separate Symbols; they are Sketch's sync records,
|
|
173
|
+
not duplicate assets in the source Library. Import a Color Variable explicitly
|
|
174
|
+
from the Library when using it on a new consumer-owned layer.
|
|
175
|
+
|
|
176
|
+
## Visual variant coverage
|
|
177
|
+
|
|
178
|
+
The variant matrix is deliberately a covering set of Button visual options,
|
|
179
|
+
not every combination of its independent props. Every row exists in Light
|
|
180
|
+
and Dark. The six pilot Symbols remain available with their original IDs.
|
|
181
|
+
|
|
182
|
+
| Public visual option | Source-backed Symbols |
|
|
183
|
+
| --------------------------------- | ---------------------------------------------------------------------------------------------- |
|
|
184
|
+
| Four tones, primary emphasis | Primary Brand (pilot), Primary Neutral, Primary Success, Primary Danger |
|
|
185
|
+
| Secondary and plain emphasis | Secondary Neutral (pilot), Secondary Danger, Pressed Secondary Brand, Plain Neutral |
|
|
186
|
+
| Default and compact size | All default rows, Compact Neutral |
|
|
187
|
+
| Rounded and pill shape | Rounded rows, Pill Brand |
|
|
188
|
+
| Label, icon with label, icon only | Labeled rows, Primary with Icon (pilot), Icon Only |
|
|
189
|
+
| Disabled | Disabled Neutral at 50% opacity, Disabled Success with quiet fill and full contrast |
|
|
190
|
+
| Pressed | Pressed Neutral with brand accent, Pressed Secondary Brand with quiet fill and doubled outline |
|
|
191
|
+
| Loading | Loading Brand with its original label width retained and a centered 16px static spinner vector |
|
|
192
|
+
| Badge | Badge Brand with editable count, Badge Dot; both follow the top-trailing corner at fixed size |
|
|
193
|
+
| Focus | Focus Standard outside the frame, Focus Brand with the two-tone inset ring |
|
|
194
|
+
| Full width | Use the separate fill-width instance workflow below; width is not a Symbol variant |
|
|
195
|
+
|
|
196
|
+
The matrix names ready-to-import presentations, not all combinations of the
|
|
197
|
+
independent props. The default danger badge tone is represented by count and
|
|
198
|
+
dot examples; other `badgeTone` values use the Badge component's own palette
|
|
199
|
+
and are not separate Button Symbols. `currentStep`, form behavior, link target,
|
|
200
|
+
action, title, and accessible labels do not add a visual Button treatment.
|
|
201
|
+
Hover and active transitions remain browser behavior rather than static
|
|
202
|
+
Library presentations.
|
|
203
|
+
|
|
204
|
+
The `variant-capture.mjs` case table is the source of the 17 named extra
|
|
205
|
+
presentations per theme. It renders the real `Button`, `Badge`, `LoadingSpinner`,
|
|
206
|
+
and `LucideIcon` with production CSS, measuring fill, border, typography,
|
|
207
|
+
size, spacing, opacity, and state colors. The native generator creates editable
|
|
208
|
+
Text, vector icon/spinner/badge, and frame styles; no raster layers are used.
|
|
209
|
+
The content Stack keeps the label on one line and centers it with a fixed icon
|
|
210
|
+
and 8px gap. The icon-only Symbol is a fixed 44px square, independent of a
|
|
211
|
+
label. A loading Symbol keeps the editable label at zero opacity to retain its
|
|
212
|
+
width; its fixed-size spinner is centered through an overlay host. Badge
|
|
213
|
+
vectors and the editable count stay outside the content Stack and pin to the
|
|
214
|
+
trailing edge. The focus rings belong to the Symbol frame style, so they
|
|
215
|
+
follow resizing. Both regular and inset focus appearances are static Sketch
|
|
216
|
+
presentations. Likewise, disabled, pressed, loading, and badge Symbols show
|
|
217
|
+
visual states only; Sketch does not supply Button events, ARIA state, or
|
|
218
|
+
spinner animation.
|
|
219
|
+
|
|
220
|
+
`variant-manifest.json` preserves master, Symbol, and direct layer IDs for
|
|
221
|
+
these 34 Symbols and records icon SVG path structure and geometry. A compatible
|
|
222
|
+
source icon edit updates existing native vector paths in place. Added,
|
|
223
|
+
removed, reordered, or ambiguous paths are rejected before staging so a
|
|
224
|
+
consumer path override cannot silently remap. An isolated Plus path edit kept
|
|
225
|
+
both native path IDs while changing geometry; a third path was rejected before
|
|
226
|
+
any native job.
|
|
227
|
+
|
|
228
|
+
`npm run sketch:button -- verify` reopens the 40-Symbol library, tests all six
|
|
229
|
+
pilot imports and 30 pilot resize cases, then imports each of the 34 extra
|
|
230
|
+
Symbols into a consumer document. The extra check tests its natural size, a
|
|
231
|
+
longer editable label, and a fixed-width instance: 102 linked instances in
|
|
232
|
+
all. It asserts badge anchoring, fixed badge dimensions, fixed-size centered
|
|
233
|
+
spinner, source height/typography, editable label presence, and save/reopen
|
|
234
|
+
override persistence. `npm run sketch:button -- render` generates the two
|
|
235
|
+
variant comparison sheets alongside the pilot review; the screenshots include
|
|
236
|
+
the badge's protrusion and the outside focus ring. It also captures 12 fixed
|
|
237
|
+
180px state comparisons to show that icon, spinner, badge, and focus treatments
|
|
238
|
+
remain aligned after widening. The color differences from
|
|
239
|
+
browser and Sketch text antialiasing remain descriptive metrics.
|
|
240
|
+
|
|
241
|
+
## Fill-width instances
|
|
242
|
+
|
|
243
|
+
The six Library Symbols remain content-fit masters. `fill-layout.json` records
|
|
244
|
+
36 real `Button({ fill: true })` browser references: short and long labels,
|
|
245
|
+
primary, secondary, and icon variants in light and dark, at widths above, equal to, and
|
|
246
|
+
below natural content width. `Button-Fill-Test.sketch` contains editable,
|
|
247
|
+
Library-linked fixed-width instances for those cases. `fill-checks.json` and
|
|
248
|
+
the two `fill-comparison*.png` captures verify the supported workflow.
|
|
249
|
+
|
|
250
|
+
To make a fill-width Button in Sketch, import the matching Symbol, set the
|
|
251
|
+
instance's horizontal size to **Fixed**, and set its width to the parent
|
|
252
|
+
track. Keep the label override as the full source text while it fits. Below
|
|
253
|
+
its natural width, shorten the editable label override to a prefix followed
|
|
254
|
+
by `…` that fits between the 9px side insets (and the fixed 16px icon plus
|
|
255
|
+
8px gap, if present). Keep the full text separately in the design annotation
|
|
256
|
+
or handoff data; `fill-layout.json` records both `sourceLabel` and
|
|
257
|
+
`displayLabel` for the verified examples. On widening, restore the full
|
|
258
|
+
label override. To return to natural width, set horizontal size to **Fit**
|
|
259
|
+
and run Sketch's Smart Layout resize.
|
|
260
|
+
|
|
261
|
+
Sketch 2026.3.1 wraps a long editable Text override inside a narrowed Stack;
|
|
262
|
+
it does not reproduce CSS `text-overflow: ellipsis` automatically. The manual
|
|
263
|
+
override keeps the 44px frame, unscaled 16px text and icon, 8px gap, centered
|
|
264
|
+
content group, original border, and editable text without spill. Extremely narrow widths that
|
|
265
|
+
cannot fit the icon plus a readable ellipsis need a different product label
|
|
266
|
+
or a wider track. The 36-case native/browser review and six resize cycles
|
|
267
|
+
are the supported bounds of this template; automatic truncation after any
|
|
268
|
+
arbitrary override or resize is not implied.
|
|
269
|
+
|
|
270
|
+
The wider component catalog is tracked in KF-P8AS51.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Content and feedback Sketch library
|
|
2
|
+
|
|
3
|
+
[Kerf-Content.sketch](Kerf-Content.sketch) contains 56 editable light and dark
|
|
4
|
+
Symbols for 28 reusable roots across 20 source variants: Disclosure,
|
|
5
|
+
MessageComposer, ProgressBar, ProgressRing, StateBanner, EmptyState, and
|
|
6
|
+
Skeleton. Multi-control Disclosure and progress sheets become separate native
|
|
7
|
+
masters. This library was created and tested with Sketch 2026.3.1.
|
|
8
|
+
|
|
9
|
+
ProgressRing geometry stays fixed. Other components stretch their tracks and
|
|
10
|
+
container surfaces with the instance: leading content stays left, the trailing
|
|
11
|
+
half (a banner's action button, a composer's send button, a value label) moves
|
|
12
|
+
to the right edge as one cluster, and EmptyState content stays centered. The
|
|
13
|
+
builder turns the imported capture from a Sketch Graphic, which would scale
|
|
14
|
+
its contents, into a plain group so these pins apply.
|
|
15
|
+
|
|
16
|
+
The masters use native Text and vector paths with shared Color Variables for
|
|
17
|
+
matching text, progress, status, fill, and border paints.
|
|
18
|
+
[The manifest](symbol-manifest.json) records stable Symbol, Text, and Color
|
|
19
|
+
Variable IDs.
|
|
20
|
+
|
|
21
|
+
When a source SVG changes, `generate` imports it into a temporary master,
|
|
22
|
+
applies the same layout, and updates the published layers in place
|
|
23
|
+
(`scripts/sketch/shared/migrate-layers.js`), so Symbol, Text override, and
|
|
24
|
+
layer IDs stay the same. Unchanged paint colors keep their Color Variables;
|
|
25
|
+
run `assets` afterward to bind changed colors. A changed layer count, layer
|
|
26
|
+
or shape type, or a reordered label is rejected with the fixture and tree
|
|
27
|
+
path before any published layer changes. When an edit only adds non-Text layers, they are
|
|
28
|
+
inserted beside the matched layers. When the importer reshapes the tree so
|
|
29
|
+
no layer-by-layer mapping exists but the ordered labels still match, the
|
|
30
|
+
builder keeps the Symbol and moves each published Text layer (the override
|
|
31
|
+
keys) into the fresh tree, and the build report flags it as `retreed`.
|
|
32
|
+
|
|
33
|
+
## Regenerate and verify
|
|
34
|
+
|
|
35
|
+
From `ui/`, with the project's login-shell Node toolchain and one existing
|
|
36
|
+
Sketch process:
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
npm run sketch:content -- capture
|
|
40
|
+
npm run sketch:content -- generate
|
|
41
|
+
npm run sketch:content -- assets
|
|
42
|
+
npm run sketch:content -- verify
|
|
43
|
+
npm run sketch:content -- sync
|
|
44
|
+
node scripts/sketch/content/compare.mjs
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
`sync` proves linked consumers follow an update. It builds a consumer on the
|
|
48
|
+
published Library with a Text override per instance, publishes a next version
|
|
49
|
+
with one master text edited under the same document ID, syncs through Sketch's
|
|
50
|
+
libraries controller, and checks that the edit arrives, the overrides survive,
|
|
51
|
+
and save/reopen keeps both (`sync-verification.json`).
|
|
52
|
+
|
|
53
|
+
The capture renders production templates in Chromium and clips each reusable
|
|
54
|
+
root. Sketch's SVG import cannot reproduce three browser features, so the
|
|
55
|
+
pipeline translates them: a ProgressRing's dashed arc becomes an explicit arc
|
|
56
|
+
path, a translucent stroke's alpha moves into `stroke-opacity`, and a blurred
|
|
57
|
+
box shadow becomes a native Gaussian blur on the imported shadow layer. A
|
|
58
|
+
native shadow extends past the master's frame, as a CSS box shadow does, so
|
|
59
|
+
exports of MessageComposer include it. Native tasks use the serial runner in the existing Sketch process and
|
|
60
|
+
preserve preexisting documents and Library registrations. Verification
|
|
61
|
+
imports fourteen linked instances across all seven families and both themes,
|
|
62
|
+
tests text overrides where text exists, increases width by 80px, then saves
|
|
63
|
+
and reopens the Library and consumer document. The reviewed
|
|
64
|
+
`comparison-*.png` files show production, native, and widened instances.
|
|
65
|
+
|
|
66
|
+
Designers install the unified [Kerf-UI.sketch](../Kerf-UI.sketch), which
|
|
67
|
+
`npm run sketch:library` rebuilds from this file with the same Symbol, Text,
|
|
68
|
+
and Color Variable identities; this family file is its build input. Captured progress values, disclosure states, and skeleton frames
|
|
69
|
+
are static design states. Runtime progress, expansion, and animation remain in
|
|
70
|
+
`@kerfjs/ui`.
|