@kerfjs/ui 5.0.0-beta.135 → 5.0.0-beta.137

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.
Files changed (125) hide show
  1. package/README.md +19 -0
  2. package/ai/component-catalog.json +17 -5
  3. package/ai/component-composition-rules.json +7 -0
  4. package/ai/component-composition.json +18 -0
  5. package/ai/components/empty-state.md +1 -0
  6. package/ai/components/popup-menu.md +1 -1
  7. package/ai/components/text.md +7 -4
  8. package/ai/public-api-signatures-v1.md +99 -21
  9. package/ai/skill.md +10 -0
  10. package/ai/webawesome-jsx-signatures-v1.md +1 -1
  11. package/dist/catalog-library.d.ts +2 -2
  12. package/dist/catalog-resources.d.ts +1 -1
  13. package/dist/catalog.d.ts +3 -3
  14. package/dist/catalog.js +4 -4
  15. package/dist/{chunk-OW2ODKHN.js → chunk-44C2K6V6.js} +33 -9
  16. package/dist/chunk-44C2K6V6.js.map +1 -0
  17. package/dist/{chunk-IXT2ARIM.js → chunk-6FQFZVRV.js} +2 -2
  18. package/dist/{chunk-IXT2ARIM.js.map → chunk-6FQFZVRV.js.map} +1 -1
  19. package/dist/{chunk-LH5V6XGH.js → chunk-7G6BSG4B.js} +1 -1
  20. package/dist/{chunk-LH5V6XGH.js.map → chunk-7G6BSG4B.js.map} +1 -1
  21. package/dist/{chunk-XNSYDA6G.js → chunk-B4UWDIUL.js} +5 -5
  22. package/dist/{chunk-XNSYDA6G.js.map → chunk-B4UWDIUL.js.map} +1 -1
  23. package/dist/{chunk-42NLFCIN.js → chunk-D4KXWVNG.js} +33 -4
  24. package/dist/chunk-D4KXWVNG.js.map +1 -0
  25. package/dist/{chunk-LK3QJHVX.js → chunk-GP3G3ZY3.js} +1 -1
  26. package/dist/chunk-GP3G3ZY3.js.map +1 -0
  27. package/dist/{chunk-QNB5DKKP.js → chunk-LMBSIRGQ.js} +2 -2
  28. package/dist/{chunk-QNB5DKKP.js.map → chunk-LMBSIRGQ.js.map} +1 -1
  29. package/dist/{chunk-YRQ4KKLG.js → chunk-NPPL3NXM.js} +16 -2
  30. package/dist/chunk-NPPL3NXM.js.map +1 -0
  31. package/dist/{chunk-MPT6Y7Z2.js → chunk-QOZABB23.js} +29 -1
  32. package/dist/chunk-QOZABB23.js.map +1 -0
  33. package/dist/{chunk-EI55KWHP.js → chunk-QWB4FEWD.js} +2 -1
  34. package/dist/chunk-QWB4FEWD.js.map +1 -0
  35. package/dist/{chunk-ZDI5I2HT.js → chunk-RMGHAIV5.js} +3 -3
  36. package/dist/{chunk-ZDI5I2HT.js.map → chunk-RMGHAIV5.js.map} +1 -1
  37. package/dist/{chunk-QNA27ABY.js → chunk-TNHJMOWJ.js} +4 -2
  38. package/dist/chunk-TNHJMOWJ.js.map +1 -0
  39. package/dist/{chunk-LSFPZR52.js → chunk-WBNUX4LA.js} +2 -2
  40. package/dist/{chunk-LSFPZR52.js.map → chunk-WBNUX4LA.js.map} +1 -1
  41. package/dist/{chunk-XZ253TGP.js → chunk-XZWEKC5F.js} +27 -5
  42. package/dist/chunk-XZWEKC5F.js.map +1 -0
  43. package/dist/{chunk-QWAAR5JX.js → chunk-ZS4WBHQG.js} +3 -3
  44. package/dist/{chunk-QWAAR5JX.js.map → chunk-ZS4WBHQG.js.map} +1 -1
  45. package/dist/collapsible-panel.js +2 -2
  46. package/dist/column-explorer.js +1 -1
  47. package/dist/{compose-B_GFfFhm.d.ts → compose-Qkitwg3x.d.ts} +1 -1
  48. package/dist/empty-state.d.ts +3 -1
  49. package/dist/empty-state.js +1 -1
  50. package/dist/index.d.ts +4 -4
  51. package/dist/index.js +9 -9
  52. package/dist/list-action-row.js +1 -1
  53. package/dist/list-detail-dialog.js +2 -2
  54. package/dist/list-header.d.ts +41 -1
  55. package/dist/list-header.js +1 -1
  56. package/dist/message-composer.js +1 -1
  57. package/dist/nav-stack.js +1 -1
  58. package/dist/pane.d.ts +2 -2
  59. package/dist/pane.js +1 -1
  60. package/dist/popup-menu.d.ts +12 -1
  61. package/dist/popup-menu.js +1 -1
  62. package/dist/split-middle-BNI0Rni-.d.ts +9 -0
  63. package/dist/split-view.js +1 -1
  64. package/dist/styles/backdrop-image.css +26 -0
  65. package/dist/styles/color-picker.css +4 -0
  66. package/dist/styles/components/actions/toolbar-control-group/toolbar-control-group.css +15 -0
  67. package/dist/styles/components/collections/list-header/list-header.css +60 -4
  68. package/dist/styles/components/feedback/empty-state/empty-state.css +7 -0
  69. package/dist/styles/components/forms/color-picker/color-picker.css +4 -0
  70. package/dist/styles/components/layout/pane/pane.css +6 -0
  71. package/dist/styles/components/navigation/nav-stack/nav-stack.css +12 -0
  72. package/dist/styles/components/navigation/paged-view/paged-view.css +4 -0
  73. package/dist/styles/components/navigation/tab-bar-item/tab-bar-item.css +31 -1
  74. package/dist/styles/components/navigation/tab-navigator/tab-navigator.css +6 -0
  75. package/dist/styles/components/surfaces/backdrop-image/backdrop-image.css +22 -0
  76. package/dist/styles/components/surfaces/scroll-effect/scroll-effect.css +4 -0
  77. package/dist/styles/components/typography/text/text.css +64 -2
  78. package/dist/styles/content-item.css +26 -0
  79. package/dist/styles/empty-state.css +7 -0
  80. package/dist/styles/foundation.css +28 -4
  81. package/dist/styles/list-header.css +60 -4
  82. package/dist/styles/nav-stack.css +12 -0
  83. package/dist/styles/paged-view.css +4 -0
  84. package/dist/styles/pane.css +6 -0
  85. package/dist/styles/scroll-effect.css +4 -0
  86. package/dist/styles/tab-bar-item.css +31 -1
  87. package/dist/styles/tab-navigator.css +6 -0
  88. package/dist/styles/text.css +64 -2
  89. package/dist/styles/toolbar-control-group.css +15 -0
  90. package/dist/styles/webawesome.css +19 -0
  91. package/dist/tab-bar-item.d.ts +9 -4
  92. package/dist/tab-bar-item.js +1 -1
  93. package/dist/text.d.ts +24 -4
  94. package/dist/text.js +1 -1
  95. package/dist/{types-CuKf5G87.d.ts → types-PGGOsJug.d.ts} +2 -1
  96. package/dist/wire-catalog.d.ts +1 -1
  97. package/dist/wire-search-fields.js +1 -1
  98. package/dist/wire-tag-fields.js +1 -1
  99. package/dist/workbench-dialog.js +1 -1
  100. package/dist/workbench.js +1 -1
  101. package/docs/accessibility.md +1 -1
  102. package/docs/component-selection.md +15 -1
  103. package/docs/design/sketch/Kerf-UI.sketch +0 -0
  104. package/docs/design/sketch/README.md +13 -8
  105. package/docs/design/sketch/unified/README.md +23 -10
  106. package/docs/design/sketch/unified/pages/advanced.png +0 -0
  107. package/docs/design/sketch/unified/pages/content.png +0 -0
  108. package/docs/design/sketch/unified/pages/toolbar.png +0 -0
  109. package/docs/design/sketch/unified/variant-link-investigation.md +45 -0
  110. package/docs/design/templates.md +1 -1
  111. package/docs/layout.md +7 -0
  112. package/docs/workbench.md +6 -1
  113. package/doctor/eslint-diagnostics.d.mts +4 -0
  114. package/doctor/eslint-diagnostics.mjs +13 -0
  115. package/doctor/index.mjs +2 -1
  116. package/package.json +1 -1
  117. package/dist/chunk-42NLFCIN.js.map +0 -1
  118. package/dist/chunk-EI55KWHP.js.map +0 -1
  119. package/dist/chunk-LK3QJHVX.js.map +0 -1
  120. package/dist/chunk-MPT6Y7Z2.js.map +0 -1
  121. package/dist/chunk-OW2ODKHN.js.map +0 -1
  122. package/dist/chunk-QNA27ABY.js.map +0 -1
  123. package/dist/chunk-XZ253TGP.js.map +0 -1
  124. package/dist/chunk-YRQ4KKLG.js.map +0 -1
  125. package/dist/split-middle-De745N2j.d.ts +0 -7
@@ -183,12 +183,42 @@
183
183
  }
184
184
  .kui-tab-bar-item__name-head {
185
185
  flex: 0 1 auto;
186
- min-width: 0;
186
+ min-width: 1em;
187
187
  overflow: hidden;
188
188
  text-overflow: ellipsis;
189
189
  }
190
190
  .kui-tab-bar-item__name-tail {
191
191
  flex: 0 0 auto;
192
+ max-width: calc(100% - 1em);
193
+ overflow: hidden;
194
+ text-overflow: ellipsis;
195
+ }
196
+ .kui-tab-bar-item[data-name-truncate-priority="suffix"]
197
+ .kui-tab-bar-item__name-head {
198
+ position: relative;
199
+ min-width: 0;
200
+ }
201
+ .kui-tab-bar-item__name-head-sizer {
202
+ visibility: hidden;
203
+ }
204
+ .kui-tab-bar-item__name-head-clip {
205
+ position: absolute;
206
+ inset: 0;
207
+ overflow: hidden;
208
+ text-overflow: ellipsis;
209
+ white-space: pre;
210
+ container: kui-tab-name-head / inline-size;
211
+ }
212
+ @container kui-tab-name-head (max-width: 0.8em) {
213
+ .kui-tab-bar-item__name-head-content {
214
+ opacity: 0;
215
+ }
216
+ }
217
+ .kui-tab-bar-item[data-name-truncate-priority="suffix"]
218
+ .kui-tab-bar-item__name-tail {
219
+ max-width: none;
220
+ overflow: visible;
221
+ text-overflow: clip;
192
222
  }
193
223
  /* A visible name keeps the tab at its full width with no label cap. A tab
194
224
  wider than its whole strip (KF-0M3ZPT) is the exception: it takes the
@@ -337,6 +337,12 @@
337
337
  }
338
338
  }
339
339
 
340
+ :where(:root[data-kui-contrast="more"])
341
+ .kui-tab-scaffold[data-bar-material="clear"]
342
+ > .kui-tab-scaffold__bar {
343
+ background: var(--kui-chrome-material);
344
+ }
345
+
340
346
  @media (forced-colors: active) {
341
347
  .kui-tab-scaffold[data-bar-material="clear"] > .kui-tab-scaffold__bar {
342
348
  background: Canvas;
@@ -7,6 +7,35 @@
7
7
  overflow-wrap: normal;
8
8
  }
9
9
 
10
+ /* Mark keeps native inline flow and inherits the surrounding font, so matches
11
+ in code occupy the same glyph cells as unmarked text. */
12
+ .kui-text__mark {
13
+ color: var(--kui-color-warning-on-fill);
14
+ background: var(--kui-color-warning-fill-quiet);
15
+ border-radius: 2px;
16
+ box-decoration-break: clone;
17
+ }
18
+
19
+ .kui-text__mark[data-current="true"] {
20
+ color: var(--kui-color-warning-on-loud);
21
+ background: var(--kui-color-warning-fill-loud);
22
+ outline: 1px solid var(--kui-color-warning-border-loud);
23
+ }
24
+
25
+ @media (forced-colors: active) {
26
+ .kui-text__mark {
27
+ color: CanvasText;
28
+ background: Canvas;
29
+ outline: 1px solid Highlight;
30
+ }
31
+
32
+ .kui-text__mark[data-current="true"] {
33
+ color: HighlightText;
34
+ background: Highlight;
35
+ outline-color: Highlight;
36
+ }
37
+ }
38
+
10
39
  /* Native heading and paragraph typography belongs to Text. Web Awesome's
11
40
  native.css supplies these rules when installed, but Text also works without
12
41
  that optional stylesheet. Size props below still override the tag defaults. */
@@ -93,8 +122,8 @@ span.kui-text[data-wrap="truncate"] {
93
122
  white-space: nowrap;
94
123
  }
95
124
 
96
- /* Middle truncation: the head shrinks to an ellipsis while the kept suffix
97
- (the last path segment) stays whole. Pre keeps a space at the split. */
125
+ /* Middle truncation: reserve room for the cut marker, then let the kept suffix
126
+ yield when both pieces cannot fit. Pre keeps a space at the split. */
98
127
  .kui-text__truncate-middle {
99
128
  display: flex;
100
129
  min-width: 0;
@@ -108,13 +137,46 @@ span.kui-text[data-wrap="truncate"] {
108
137
 
109
138
  .kui-text__truncate-head {
110
139
  flex: 0 1 auto;
140
+ min-width: 1em;
141
+ overflow: hidden;
142
+ text-overflow: ellipsis;
143
+ }
144
+
145
+ .kui-text[data-truncate-priority="suffix"] .kui-text__truncate-head {
146
+ position: relative;
111
147
  min-width: 0;
148
+ }
149
+
150
+ .kui-text__truncate-head-sizer {
151
+ visibility: hidden;
152
+ }
153
+
154
+ .kui-text__truncate-head-clip {
155
+ position: absolute;
156
+ inset: 0;
112
157
  overflow: hidden;
113
158
  text-overflow: ellipsis;
159
+ white-space: pre;
160
+ container: kui-text-head / inline-size;
161
+ }
162
+
163
+ @container kui-text-head (max-width: 0.8em) {
164
+ .kui-text__truncate-head-content {
165
+ opacity: 0;
166
+ }
167
+ }
168
+
169
+ .kui-text[data-truncate-priority="suffix"] .kui-text__truncate-tail {
170
+ max-width: none;
171
+ overflow: visible;
172
+ text-overflow: clip;
114
173
  }
115
174
 
116
175
  .kui-text__truncate-tail {
117
176
  flex: 0 0 auto;
177
+ max-width: calc(100% - 1em);
178
+ overflow: hidden;
179
+ text-overflow: ellipsis;
118
180
  }
119
181
 
120
182
  .kui-text__clamp {
@@ -555,6 +555,21 @@
555
555
  }
556
556
  }
557
557
 
558
+ :where(:root[data-kui-contrast="more"])
559
+ .kui-toolbar-control-group[data-material="glass"]:not(
560
+ [data-appearance="borderless"]
561
+ ) {
562
+ --kui-toolbar-control-border: var(--kui-color-neutral-border-normal);
563
+ }
564
+
565
+ :where(:root[data-kui-contrast="more"])
566
+ .kui-toolbar-control-group[data-material="glass"][data-tone="dark"]:not(
567
+ [data-appearance="borderless"]
568
+ ) {
569
+ --kui-toolbar-control-background: var(--kui-color-neutral-fill-loud);
570
+ --kui-toolbar-control-border: var(--kui-toolbar-control-dark-border, #353536);
571
+ }
572
+
558
573
  :root[data-kui-effects="static"]
559
574
  .kui-toolbar-control-group[data-material="glass"]:not(
560
575
  [data-appearance="borderless"]
@@ -752,6 +752,25 @@
752
752
  }
753
753
  }
754
754
 
755
+ @layer wa-theme-overrides {
756
+ :root[data-kui-contrast="more"],
757
+ :root[data-kui-contrast="more"]
758
+ :is(
759
+ .wa-theme-default,
760
+ .wa-light,
761
+ .wa-dark,
762
+ .wa-invert,
763
+ .kui-light,
764
+ .kui-dark,
765
+ .kui-invert,
766
+ [data-kui-scheme]
767
+ ) {
768
+ --wa-color-surface-border: currentColor;
769
+ --wa-color-neutral-border-normal: currentColor;
770
+ --wa-focus-ring: 3px solid currentColor;
771
+ }
772
+ }
773
+
755
774
  /*
756
775
  * Raw Web Awesome children inside Kerf containers.
757
776
  *
@@ -1,6 +1,6 @@
1
1
  import { SafeHtml } from 'kerfjs';
2
2
  import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
3
- import { M as MiddleTruncateKeep } from './split-middle-De745N2j.js';
3
+ import { M as MiddleTruncateKeep, a as MiddleTruncatePriority } from './split-middle-BNI0Rni-.js';
4
4
 
5
5
  type TabBarItemRootAttributes = Readonly<Record<`data-${string}`, string | undefined> & {
6
6
  'data-component'?: never;
@@ -13,6 +13,7 @@ type TabBarItemRootAttributes = Readonly<Record<`data-${string}`, string | undef
13
13
  'data-drop-target'?: never;
14
14
  'data-name-overflow'?: never;
15
15
  'data-name-truncate'?: never;
16
+ 'data-name-truncate-priority'?: never;
16
17
  'data-disabled'?: never;
17
18
  }>;
18
19
  type TabBarItemPresentation = 'pill' | 'segmented' | 'icon-only';
@@ -25,11 +26,13 @@ type TabBarItemNameOverflow = 'ellipsis' | 'visible';
25
26
  */
26
27
  type TabBarItemNameTruncate = 'end' | 'middle' | 'start';
27
28
  /**
28
- * The suffix `nameTruncate="middle"` always keeps: a number of trailing
29
+ * The suffix `nameTruncate="middle"` selects: a number of trailing
29
30
  * characters, or `segment` (default) for the last path segment, or the last
30
31
  * 10 characters when the name has no separator.
31
32
  */
32
33
  type TabBarItemNameTruncateKeep = MiddleTruncateKeep;
34
+ /** Which part wins in a narrow middle-truncated tab; defaults to `head`. */
35
+ type TabBarItemNameTruncatePriority = MiddleTruncatePriority;
33
36
  interface TabBarItemProps {
34
37
  id: string;
35
38
  name: string;
@@ -73,6 +76,8 @@ interface TabBarItemProps {
73
76
  nameTruncate?: TabBarItemNameTruncate;
74
77
  /** The suffix `nameTruncate="middle"` keeps (default `segment`). */
75
78
  nameTruncateKeep?: TabBarItemNameTruncateKeep;
79
+ /** `head` (default) keeps a head sliver; `suffix` keeps the full suffix. */
80
+ nameTruncatePriority?: TabBarItemNameTruncatePriority;
76
81
  /** Decorative dormant content for the close button. Must not contain interactive descendants. */
77
82
  closeIcon?: SafeHtml;
78
83
  selectAction?: string;
@@ -95,6 +100,6 @@ interface TabBarItemProps {
95
100
  /** Native named-slot assignment when composed inside a web component. */
96
101
  slot?: string;
97
102
  }
98
- declare function TabBarItem({ id, name, selected, disabled, tabId, panelId, attention, dropTarget, closable, draggable, leading, trailing, presentation, size, labelMaxWidth, nameOverflow, nameTruncate, nameTruncateKeep, closeIcon, selectAction, closeAction, className, placeholder, pending, rootAttributes, slot, }: TabBarItemProps): SafeHtml;
103
+ declare function TabBarItem({ id, name, selected, disabled, tabId, panelId, attention, dropTarget, closable, draggable, leading, trailing, presentation, size, labelMaxWidth, nameOverflow, nameTruncate, nameTruncateKeep, nameTruncatePriority, closeIcon, selectAction, closeAction, className, placeholder, pending, rootAttributes, slot, }: TabBarItemProps): SafeHtml;
99
104
 
100
- export { TabBarItem, type TabBarItemNameOverflow, type TabBarItemNameTruncate, type TabBarItemNameTruncateKeep, type TabBarItemPresentation, type TabBarItemProps, type TabBarItemSize };
105
+ export { TabBarItem, type TabBarItemNameOverflow, type TabBarItemNameTruncate, type TabBarItemNameTruncateKeep, type TabBarItemNameTruncatePriority, type TabBarItemPresentation, type TabBarItemProps, type TabBarItemSize };
@@ -1,4 +1,4 @@
1
- export { TabBarItem } from './chunk-XZ253TGP.js';
1
+ export { TabBarItem } from './chunk-XZWEKC5F.js';
2
2
 
3
3
 
4
4
 
package/dist/text.d.ts CHANGED
@@ -1,10 +1,11 @@
1
1
  import * as kerfjs from 'kerfjs';
2
+ import { SafeHtml } from 'kerfjs';
2
3
  import { KerfBaseAttrs } from 'kerfjs/jsx-runtime';
3
4
  import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
4
5
  import { R as RootDataAttributes } from './extension-attributes-CnqvBmj3.js';
5
6
  import { S as Sides } from './sides-BPSWde0A.js';
6
7
  import { CssForegroundColor } from './css-values.js';
7
- import { M as MiddleTruncateKeep } from './split-middle-De745N2j.js';
8
+ import { M as MiddleTruncateKeep, a as MiddleTruncatePriority } from './split-middle-BNI0Rni-.js';
8
9
 
9
10
  type FieldLabelProps = Omit<KerfBaseAttrs, 'children' | 'class' | 'className' | 'id'> & {
10
11
  children: string;
@@ -42,10 +43,12 @@ type TextAlign = 'start' | 'center' | 'end';
42
43
  */
43
44
  type TextTruncate = 'end' | 'middle' | 'start';
44
45
  /**
45
- * The suffix `truncate="middle"` always keeps: a number of trailing
46
+ * The suffix `truncate="middle"` selects: a number of trailing
46
47
  * characters, or `segment` for the last path segment with its separator.
47
48
  */
48
49
  type TextTruncateKeep = MiddleTruncateKeep;
50
+ /** Which part wins in a narrow middle-truncated box; defaults to `head`. */
51
+ type TextTruncatePriority = MiddleTruncatePriority;
49
52
  type TextContent = KerfUiContent | string | number | readonly TextContent[];
50
53
  type TextCommonProps = Omit<KerfBaseAttrs, 'children' | 'class' | 'className' | 'id' | 'lang'> & {
51
54
  /**
@@ -103,12 +106,14 @@ type TextProps = TextCommonProps & ({
103
106
  maxLines?: number;
104
107
  truncate?: never;
105
108
  truncateKeep?: never;
109
+ truncatePriority?: never;
106
110
  } | {
107
111
  /** Keep one line without an ellipsis. */
108
112
  wrap: 'nowrap';
109
113
  maxLines?: never;
110
114
  truncate?: never;
111
115
  truncateKeep?: never;
116
+ truncatePriority?: never;
112
117
  } | {
113
118
  /** Keep one line with an ellipsis. */
114
119
  wrap: 'truncate';
@@ -125,12 +130,27 @@ type TextProps = TextCommonProps & ({
125
130
  * `\\` separator).
126
131
  */
127
132
  truncateKeep?: TextTruncateKeep;
133
+ /**
134
+ * Narrow-box policy for `truncate="middle"`: `head` (default)
135
+ * reserves a head sliver and ellipsizes the suffix; `suffix` keeps
136
+ * the suffix whole while the head shrinks to an ellipsis or nothing.
137
+ */
138
+ truncatePriority?: TextTruncatePriority;
128
139
  });
129
140
  /**
130
141
  * Semantic heading, paragraph, or inline text. Block variants use the standard
131
142
  * content-item padding; `span` adds no box geometry.
132
143
  * All ordinary native heading/paragraph attributes pass through to the element.
133
144
  */
134
- declare function Text({ variant: Variant, tone, weight, color, size, font, border, flush, controlMargins, lineHeight, align, live, ariaLabel, rootAttributes, wrap, maxLines, truncate, truncateKeep, children, class: classValue, className, style, ...attributes }: TextProps): kerfjs.SafeHtml;
145
+ declare function Text({ variant: Variant, tone, weight, color, size, font, border, flush, controlMargins, lineHeight, align, live, ariaLabel, rootAttributes, wrap, maxLines, truncate, truncateKeep, truncatePriority, children, class: classValue, className, style, ...attributes }: TextProps): SafeHtml;
146
+
147
+ interface MarkProps {
148
+ /** Matched content; inherits the surrounding font, including code typography. */
149
+ children: SafeHtml | string | number;
150
+ /** Emphasize the active result among otherwise quiet matches. */
151
+ current?: boolean;
152
+ }
153
+ /** A native text highlight for find-in-content results. */
154
+ declare function Mark({ children, current }: MarkProps): SafeHtml;
135
155
 
136
- export { FieldLabel, type FieldLabelProps, Sides, Text, type TextAlign, type TextBorder, type TextContent, type TextFont, type TextLineHeight, type TextProps, type TextSize, type TextTone, type TextTruncate, type TextTruncateKeep, type TextVariant, type TextWeight, type TextWrap };
156
+ export { FieldLabel, type FieldLabelProps, Mark, type MarkProps, Sides, Text, type TextAlign, type TextBorder, type TextContent, type TextFont, type TextLineHeight, type TextProps, type TextSize, type TextTone, type TextTruncate, type TextTruncateKeep, type TextTruncatePriority, type TextVariant, type TextWeight, type TextWrap };
package/dist/text.js CHANGED
@@ -1,4 +1,4 @@
1
- export { FieldLabel, Text } from './chunk-OW2ODKHN.js';
1
+ export { FieldLabel, Mark, Text } from './chunk-44C2K6V6.js';
2
2
 
3
3
 
4
4
 
@@ -122,7 +122,8 @@ interface CatalogProps {
122
122
  content: KerfUiContent;
123
123
  collapsed?: boolean;
124
124
  theme?: 'light' | 'dark';
125
- /** Show the controlled increased-contrast toggle when supplied. The app applies the preference. */
125
+ /** Show the controlled increased-contrast toggle when supplied. Set
126
+ * data-kui-contrast="more" on the document root while enabled. */
126
127
  increasedContrast?: boolean;
127
128
  /** Show the controlled reduced-motion toggle when supplied. The app applies the preference. */
128
129
  reducedMotion?: boolean;
@@ -1,5 +1,5 @@
1
1
  import { Signal } from 'kerfjs';
2
- import { c as CatalogBackgroundStyle } from './types-CuKf5G87.js';
2
+ import { c as CatalogBackgroundStyle } from './types-PGGOsJug.js';
3
3
  import './toolbar.js';
4
4
  import './semantic-content-BbzjvSu9.js';
5
5
  import './extension-attributes-CnqvBmj3.js';
@@ -1,4 +1,4 @@
1
- export { wireSearchFields } from './chunk-MPT6Y7Z2.js';
1
+ export { wireSearchFields } from './chunk-QOZABB23.js';
2
2
 
3
3
 
4
4
 
@@ -1,5 +1,5 @@
1
1
  import { tagFieldActions } from './chunk-U5SQOZNK.js';
2
- import { wireSearchFields } from './chunk-MPT6Y7Z2.js';
2
+ import { wireSearchFields } from './chunk-QOZABB23.js';
3
3
 
4
4
  import { placeSearchFieldCaret, readSearchField } from './chunk-T7M5FKCE.js';
5
5
 
@@ -2,7 +2,7 @@ import { DialogSurface } from './chunk-2OYMXGW2.js';
2
2
  export { closeDialog, openDialog } from './chunk-R4JK2C6D.js';
3
3
 
4
4
 
5
- import { Workbench } from './chunk-XNSYDA6G.js';
5
+ import { Workbench } from './chunk-B4UWDIUL.js';
6
6
 
7
7
 
8
8
 
package/dist/workbench.js CHANGED
@@ -1,4 +1,4 @@
1
- export { Workbench } from './chunk-XNSYDA6G.js';
1
+ export { Workbench } from './chunk-B4UWDIUL.js';
2
2
 
3
3
 
4
4
 
@@ -8,7 +8,7 @@ These are normative contracts for package components and consuming applications.
8
8
  - Decorative `LucideIcon` output is `aria-hidden`; pass `label` only when the SVG itself conveys meaning. `size="xs|s|m|l|xl"` selects the 12/16/20/24/32px root-scaled icon steps, and a positive numeric `size` converts pixels to rem; omitting `size` keeps 1em. Size changes the visual only, never the owning control's hit target or accessible name.
9
9
  - `ListItem` uses native button Enter/Space behavior. `selected` maps to `aria-current="page"`; `pressed` maps to `aria-pressed`. Selected rows keep the normal foreground over their brand-tinted fill so text retains WCAG AA contrast in light and dark themes. Its leading icon visual is 18px while the row retains its 44px minimum target; multiline icons align to the first text line. Its `trailing` content is dormant and must not contain controls. Its `rootAttributes` slot accepts only application `data-*` metadata and deliberately cannot emit `role="menuitem"` in isolation—a true ARIA menu must own arrow, Home/End, Escape, and focus behavior as one widget.
10
10
  - `ListItemLink` shares that row content and geometry but uses native anchor Enter behavior and requires `href`. It has no `action` or `pressed` state. `external` opens a new tab with `rel="noopener noreferrer"`; the default accessible name announces the new tab for a string label, so an explicit `accessibleLabel` should do the same. Disabled and loading links omit `href`, expose `aria-disabled`, and leave the tab order. Its trailing content remains dormant.
11
- - `ListHeader` owns action naming, disabled state, and disclosure `aria-expanded`. Toggle mode supplies one decorative 18px `DisclosureArrow` when `actionIcon` is omitted; it mirrors `expanded` while the native button's accessible name stays stable. The application must update that controlled state and reveal or hide real content. A valid `count` is visually rendered in an `aria-hidden` neutral pill while the required localized `countLabel` becomes part of the owning heading or disclosure button's accessible name; zero remains a real count. Optional `badge` and `status` content can appear together and should each carry meaningful text. Name the region a toggle shows or hides with `controls` (its id, reported as `aria-controls`) and hide that region with `List hidden` when it is a List. Its narrow `triggerAttributes` slot may describe a native popover relationship with `popoverTarget`, `popoverTargetAction`, `aria-controls`, and `aria-haspopup`; the application owns the target surface and its focus/dismissal behavior. A toggle header may also carry one trailing overflow button (`overflowAction`, `overflowLabel`, `overflowIcon`, optional `overflowDisabled` and `overflowTriggerAttributes` with the same popover fields) for the section's own commands: it is a separate button with its own focus stop at the logical end, outside the disclosure button, named by `overflowLabel`, and never toggles the section or carries its `aria-expanded`.
11
+ - `ListHeader` owns action naming, disabled state, and disclosure `aria-expanded`. Toggle mode supplies one decorative 18px `DisclosureArrow` when `actionIcon` is omitted; it mirrors `expanded` while the native button's accessible name stays stable. The application must update that controlled state and reveal or hide real content. The `titleAction` mode instead puts a native button inside a heading: `titleActionLabel` names its operation, and it has no disclosure arrow or `aria-expanded`. It may have a separate trailing `action` button. A valid `count` is visually rendered in an `aria-hidden` neutral pill while the required localized `countLabel` becomes part of the passive heading or disclosure button's accessible name; zero remains a real count. Optional `badge` and `status` content can appear together and should each carry meaningful text. Name the region a toggle or title action shows or hides with `controls` (its id, reported as `aria-controls` on that button) and hide that region with `List hidden` when it is a List. `titleTriggerAttributes` describes a title action's native popover relationship; `triggerAttributes` describes a toggle or trailing action. A toggle header may also carry one trailing overflow button (`overflowAction`, `overflowLabel`, `overflowIcon`, optional `overflowDisabled` and `overflowTriggerAttributes` with the same popover fields) for the section's own commands: it is a separate button with its own focus stop at the logical end, outside the disclosure button, named by `overflowLabel`, and never toggles the section or carries its `aria-expanded`.
12
12
  - Dispose `wireTabBars` and `wireSearchFields` with their owning view. Disposal cancels queued controlled-render focus restoration, so a torn-down view cannot reclaim focus from its successor.
13
13
  - `wireNavStack` moves focus into every newly active top view and remembers the last focused descendant of each mounted view for pop restoration. Mark a preferred initial heading or control with `data-nav-focus` (and `tabindex="-1"` when it is not normally tabbable); otherwise the helper uses the first enabled focusable descendant, then a programmatically focusable view-container fallback.
14
14
  - In any `.kui-pane`, menu rows, `ListHeader` actions, and toolbar groups keep a minimum 44px target in both dimensions. A `ListHeader` fills the available inline width and keeps that action at the logical end, including in RTL. Its action visual defaults to 18px through `--kui-list-header-action-icon-size` inside a fitted 36px hover square; a transparent hit layer extends the pointer target to at least 44 × 44 around that square without moving layout or enlarging the painted surface. Compact headers are 36px tall like the rest of the compact List family, so their action target is 44px wide and clamped to the 36px header height instead of reaching into a neighboring row. Do not reduce the target to the visible icon, and do not force the button itself to 44px.
@@ -438,6 +438,10 @@ resets native margins. Center short status copy with `Text align="center"`
438
438
  (`end` aligns a trailing value) instead of setting `text-align` on `.kui-text`. `ValueTable density="compact"` reduces row padding and
439
439
  gap. Its `--kui-value-table-row-columns`, `--kui-value-table-row-padding-block`,
440
440
  and `--kui-value-table-row-gap` tokens support a specific metadata layout.
441
+ For find-in-content, wrap each matched span in `Mark` from `@kerfjs/ui/text`
442
+ and set `current` on the active result. It renders native `<mark>` with quiet
443
+ and stronger states, including inside monospaced `Text` or `<code>`; the app
444
+ still owns match ranges, navigation, and the result count announcement.
441
445
  Use `ToolbarText size="xsmall"` for a dense rail heading. Use
442
446
  `size="xlarge-fixed"` for a toolbar heading at the fixed 20px step; `xlarge`
443
447
  retains the responsive page-title clamp. Pass `headingLevel` when the text is
@@ -467,7 +471,10 @@ instead of the default ellipsis; a visible-name tab wider than its whole strip
467
471
  falls back to an ellipsis with the full name as its title. When tabs differ only at the end of their names
468
472
  (a run id, a file path), set `nameTruncate="start"` to keep the tail, or
469
473
  `nameTruncate="middle"` to keep the start and the last path segment
470
- (`nameTruncateKeep` sets another suffix length). A `TabBar` owns its
474
+ (`nameTruncateKeep` sets another suffix length). By default a narrow middle
475
+ name keeps a sliver of the head and ellipsizes the suffix; set
476
+ `nameTruncatePriority="suffix"` when the suffix identifies the tab and must
477
+ stay whole. The suffix still needs to fit inside the name box. A `TabBar` owns its
471
478
  scrolling strip; its public `--kui-tab-bar-strip-*` tokens configure strip
472
479
  height, spacing, border, radius, background, and scroll inset without styling
473
480
  its internal classes. `--kui-tab-bar-trailing-flex` controls the trailing zone.
@@ -849,6 +856,13 @@ point, at its `placement` unless the call names one for that opening
849
856
  keeps the same collision placement, focus management, submenu keyboard
850
857
  navigation, and outside/Escape dismissal as a trigger-anchored one.
851
858
 
859
+ Read a rendered root's state with `isPopupMenuOpen` (`root`). To observe root
860
+ dismissal, capture native `toggle` events on an ancestor and pass each event
861
+ to `closedPopupMenuRoot` (`event`); it returns the root only for its own closed
862
+ panel, not for a submenu closure or opening. The controller resets open state
863
+ and handles focus return before the closed toggle notification. This keeps app
864
+ code independent of PopupMenu's internal trigger and panel selectors.
865
+
852
866
  The menu opens in the browser top layer, flips and shifts at viewport edges,
853
867
  and limits its height to the available space, scrolling past it. It shifts
854
868
  only along its trigger's (or point's) edge, never across it: when neither
Binary file
@@ -1,12 +1,13 @@
1
1
  # Kerf UI Sketch catalog
2
2
 
3
3
  [Kerf-UI.sketch](Kerf-UI.sketch) is the one Kerf UI Sketch Library. It holds
4
- all 326 editable light and dark Symbols for the 114 template variants, on one
4
+ all 328 editable light and dark Symbols in 35 linked Variant Sets for the 115 template variants, on one
5
5
  page per family: Button, Form Controls, Advanced Inputs, Lists and Data,
6
6
  Toolbars and Navigation, and Content and Feedback. Each page shows its light
7
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
8
+ The component browser exposes a Variant Set per component; its inspector has
9
+ `State` and `Theme` properties. The 141 Color Variables are named
10
+ `Kerf/<Theme>/<Role>`. See the
10
11
  [unified Library guide](unified/README.md) for its identity contract, build,
11
12
  and verification. [Coverage](coverage.md) accounts for every source variant.
12
13
  Source SVG sheets in [templates](../templates.md) are review material, not
@@ -14,8 +15,12 @@ substitutes for editable Symbols.
14
15
 
15
16
  ## Install and update
16
17
 
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
18
+ The Library was created with **Sketch 2026.3.1** and its shipped file was
19
+ reverified with **Sketch 2026.4** on 26 November 2026: all 328 Symbols were
20
+ grouped into 35 Variant Sets, and 12 linked cross-family consumer instances
21
+ passed override, resize, and save/reopen checks. Six representative sets,
22
+ including both themes, retained their text overrides and widths after a Library
23
+ update. Kerf UI ships it as a Sketch Library: documents link its Symbols
19
24
  and Color Variables, so a new release reaches every design that uses them.
20
25
 
21
26
  To install:
@@ -37,15 +42,15 @@ To install:
37
42
  4. In Sketch, open **Settings → Libraries**, choose **Add Library…**, and
38
43
  select the copy.
39
44
 
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.
45
+ To use it, insert a Variant Set from the component browser, then choose its
46
+ State and Theme in the inspector. Typing `Button` finds the Button set.
42
47
  Kerf's Color Variables (`Kerf/<Theme>/<Role>`) appear in the color picker
43
48
  under the Library's name.
44
49
 
45
50
  To update, copy the newly published file over the same installed path. Sketch
46
51
  then offers the Library update in any open document that uses it; accept it to
47
52
  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
53
+ IDs, Variant Set IDs, Text layer IDs, and Color Variable IDs stay the same across releases, and
49
54
  the build fails if any of them changes. Don't add the new file as a second
50
55
  Library alongside the old one. If the native format or supported Sketch version changes, this guide
51
56
  and the unified guide must record the new verification result before
@@ -1,9 +1,10 @@
1
1
  # Unified Kerf UI Sketch Library
2
2
 
3
3
  [Kerf-UI.sketch](../Kerf-UI.sketch) is the Library designers install. It is
4
- rebuilt from the six family Libraries by `npm run sketch:library` and holds 326
4
+ rebuilt from the six family Libraries by `npm run sketch:library` and holds 328
5
5
  Symbols, 141 Color Variables, and Button's 42 shared layer styles and 38 shared
6
- text styles.
6
+ text styles. All 328 masters belong to 35 linked Variant Sets, one per
7
+ component across all six families.
7
8
 
8
9
  ## Pages and naming
9
10
 
@@ -14,8 +15,13 @@ surface so dark-theme masters stay legible. The page labels and the dark
14
15
  surface are page layers outside every Symbol. [Page overviews](pages/) are
15
16
  exported on each build.
16
17
 
17
- Symbols keep their family names, `Component / Variant / State / Theme`, which
18
- group them in Sketch's component browser. Color Variables are named
18
+ Family source Symbols use `Component / Variant / State / Theme`. The unified
19
+ Library groups them into a component Variant Set with `State` and `Theme`
20
+ properties. `State` joins the intermediate name segments with `·`, so
21
+ `Text Field / Labeled / Project Name / Light` becomes `Text Field` with
22
+ `State = Labeled · Project Name` and `Theme = Light`. Sketch renames its
23
+ child master to `Labeled · Project Name/Light`. Insert the Variant Set, then
24
+ choose its State and Theme in the inspector. Color Variables are named
19
25
  `Kerf/<Theme>/<Role>`, for example `Kerf/Light/Text Quiet` or
20
26
  `Kerf/Dark/Button Primary Brand Fill`. Where families agree on a role's color,
21
27
  they share one variable. Six roles have different colors in different
@@ -35,6 +41,9 @@ releases:
35
41
  These equal the family Library's IDs, which each family pipeline already
36
42
  keeps stable. The merge copies each master and then sets its Symbol ID and
37
43
  every layer's object ID back to the family values.
44
+ - **Variant Set IDs.** The first grouped build records them in the manifest;
45
+ later builds pin them to those values. Child Symbol identities stay stable
46
+ through grouping and save/reopen.
38
47
  - **Color Variable IDs.** Each variable takes the ID of its first source
39
48
  swatch in family order. A cross-document copy drops swatch references, so
40
49
  the merge rebinds every fill, border, and text paint, and checks that each
@@ -57,13 +66,17 @@ npm run sketch:library -- sync
57
66
  ```
58
67
 
59
68
  `npm run sketch:library` runs all three. `verify` opens the Library, checks
60
- every family page, and builds a consumer linked to one master per family and
61
- theme. Each instance gets a text override and an 80px resize, and the
69
+ every family page, 35 importable Variant Set references, and the corresponding
70
+ 35 Symbol references (down from 328 before grouping), and builds a consumer
71
+ linked to one set per family with Light and Dark instances. Each instance gets
72
+ a text override and an 80px resize, and the
62
73
  consumer is saved and reopened ([verification.json](https://github.com/brianwestphal/kerf/blob/main/ui/docs/design/sketch/unified/verification.json),
63
- [consumer exports](https://github.com/brianwestphal/kerf/tree/main/ui/docs/design/sketch/unified/consumer-exports)). `sync` publishes a next version with
64
- one master text edited under the same document ID, syncs a consumer through
65
- Sketch's libraries controller, and checks that the edit arrives and the
66
- overrides survive save/reopen ([sync-verification.json](https://github.com/brianwestphal/kerf/blob/main/ui/docs/design/sketch/unified/sync-verification.json)).
74
+ [consumer exports](https://github.com/brianwestphal/kerf/tree/main/ui/docs/design/sketch/unified/consumer-exports)).
75
+ For Button's auto-sized masters, the test sets the instance to fixed horizontal
76
+ sizing before resizing. `sync` edits both themes of one representative set
77
+ per family under the same document ID, updates six detached-set consumers
78
+ through Sketch's libraries controller, and checks that the edit, overrides,
79
+ and resized widths survive save/reopen ([sync-verification.json](https://github.com/brianwestphal/kerf/blob/main/ui/docs/design/sketch/unified/sync-verification.json)).
67
80
 
68
81
  Rebuild after any family Library changes. A Library with an unchanged set of
69
82
  family masters rebuilds with identical IDs.
@@ -0,0 +1,45 @@
1
+ # Variant Set library linkage (Sketch 2026.4)
2
+
3
+ The [repeatable investigation](../../../../scripts/sketch/catalog/variant-link-investigation.mjs)
4
+ uses disposable copies of the shipped `Kerf-UI.sketch`. Run it from `ui/` with
5
+ `node scripts/sketch/catalog/variant-link-investigation.mjs`; it writes the
6
+ [machine-readable report](variant-link-report.json). The shipped Library is
7
+ unchanged. The normal `npm run sketch:library -- sync` command writes the same
8
+ six-family check to [sync-verification.json](sync-verification.json).
9
+
10
+ ## Linked import and update
11
+
12
+ `VariantSetReference.import()` creates a library-linked set. Keep that set
13
+ detached, choose a child master with
14
+ `getBestVariantMasterForConfiguration({ State, Theme })`, and place its instance
15
+ on the consumer page. The saved document retains a native
16
+ `foreignVariantSets` record. Six representative sets, one per family, each
17
+ kept Light and Dark text overrides and 80 px width changes through save/reopen,
18
+ then received a source text edit through Sketch's Library sync and kept both
19
+ overrides and widths through a second save/reopen. Button's auto-sized instances
20
+ require fixed horizontal sizing before the width change.
21
+
22
+ The child masters receive local Symbol IDs and individually return false for
23
+ `getLibrary()` and `foreignObject()`. The imported set's native foreign object
24
+ and the document's foreign Variant Set record carry the Library link. Placing
25
+ the imported set itself on the consumer page was tested in the earlier
26
+ [prototype](variant-prototype-report.json): its native sync reported current,
27
+ but placed instances did not receive the source text edit. Keep the set
28
+ detached and place instances only.
29
+
30
+ ## Source identity and import surface
31
+
32
+ Grouping all 328 masters into 35 component sets preserved Symbol, master,
33
+ descendant, and Color Variable IDs after save/reopen. The unified
34
+ [manifest](symbol-manifest.json) pins each new Variant Set ID for subsequent
35
+ builds. Sketch presents each set as the import target and renames children by
36
+ their `State/Theme` configuration; the original family Symbol IDs remain the
37
+ source identity. Grouping reduced the individual importable Symbol reference
38
+ count from 328 to 35, while all 35 Variant Sets are importable. The production
39
+ verification asserts both counts. The earlier four-master prototype measured
40
+ the first reduction, from 328 to 325.
41
+
42
+ Sketch's [2026.4 API guide](https://developer.sketch.com/plugins/updates/new-in-sketch-20264)
43
+ documents Variant Set references. The [API reference](https://developer.sketch.com/reference/api/)
44
+ documents the imported Symbol and instance sizing APIs; the saved-document
45
+ and update checks above establish the behavior of this detached-set path.
@@ -2,7 +2,7 @@
2
2
 
3
3
  The SVG sheets remain the broad, static catalog. The native
4
4
  [Kerf UI Sketch Library](sketch/unified/README.md), `Kerf-UI.sketch`, adds
5
- 312 editable Symbols for every template variant, built from production CSS
5
+ 328 editable Symbols for every template variant, built from production CSS
6
6
  captures and verified through resize, override, linked-consumer sync, and
7
7
  save/reopen checks. It ships with the UI package under `docs/design/sketch/`.
8
8
  The [native Sketch coverage matrix](sketch/coverage.md) tracks each template
package/docs/layout.md CHANGED
@@ -792,6 +792,13 @@ none), or a number keeps that many trailing characters. `middle` needs string
792
792
  or number children so it can split them. Both positions are for left-to-right
793
793
  identifiers and paths, keep the whole value in the DOM in order for assistive
794
794
  technology, and show it as the element's `title` unless you pass your own.
795
+ When the box is too narrow for both parts, `truncatePriority="head"` (default)
796
+ keeps a small piece of the head and ellipsizes the suffix. Set
797
+ `truncatePriority="suffix"` for an identity-bearing tail such as a run ID:
798
+ the suffix keeps its natural width while the head reduces to an ellipsis or
799
+ disappears. If the suffix alone exceeds the box, the box still clips it; give
800
+ identity suffixes enough width to fit. The property applies only to
801
+ `truncate="middle"`.
795
802
  Never hand-roll these with `direction: rtl` or split spans in app CSS.
796
803
 
797
804
  ```tsx