@kerfjs/ui 5.0.0-beta.136 → 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 (56) hide show
  1. package/ai/component-catalog.json +14 -4
  2. package/ai/component-composition-rules.json +7 -0
  3. package/ai/component-composition.json +18 -0
  4. package/ai/components/empty-state.md +1 -0
  5. package/ai/components/text.md +7 -4
  6. package/ai/public-api-signatures-v1.md +37 -10
  7. package/ai/webawesome-jsx-signatures-v1.md +1 -1
  8. package/dist/catalog.js +2 -2
  9. package/dist/{chunk-OW2ODKHN.js → chunk-44C2K6V6.js} +33 -9
  10. package/dist/chunk-44C2K6V6.js.map +1 -0
  11. package/dist/{chunk-AUYGZ3UP.js → chunk-D4KXWVNG.js} +2 -2
  12. package/dist/{chunk-AUYGZ3UP.js.map → chunk-D4KXWVNG.js.map} +1 -1
  13. package/dist/{chunk-LK3QJHVX.js → chunk-GP3G3ZY3.js} +1 -1
  14. package/dist/chunk-GP3G3ZY3.js.map +1 -0
  15. package/dist/{chunk-QNA27ABY.js → chunk-TNHJMOWJ.js} +4 -2
  16. package/dist/chunk-TNHJMOWJ.js.map +1 -0
  17. package/dist/{chunk-LSFPZR52.js → chunk-WBNUX4LA.js} +2 -2
  18. package/dist/{chunk-LSFPZR52.js.map → chunk-WBNUX4LA.js.map} +1 -1
  19. package/dist/{chunk-XZ253TGP.js → chunk-XZWEKC5F.js} +27 -5
  20. package/dist/chunk-XZWEKC5F.js.map +1 -0
  21. package/dist/column-explorer.js +1 -1
  22. package/dist/empty-state.d.ts +3 -1
  23. package/dist/empty-state.js +1 -1
  24. package/dist/index.d.ts +3 -3
  25. package/dist/index.js +5 -5
  26. package/dist/list-header.js +1 -1
  27. package/dist/message-composer.js +1 -1
  28. package/dist/split-middle-BNI0Rni-.d.ts +9 -0
  29. package/dist/styles/components/feedback/empty-state/empty-state.css +7 -0
  30. package/dist/styles/components/navigation/tab-bar-item/tab-bar-item.css +31 -1
  31. package/dist/styles/components/typography/text/text.css +59 -0
  32. package/dist/styles/empty-state.css +7 -0
  33. package/dist/styles/tab-bar-item.css +31 -1
  34. package/dist/styles/text.css +59 -0
  35. package/dist/tab-bar-item.d.ts +9 -4
  36. package/dist/tab-bar-item.js +1 -1
  37. package/dist/text.d.ts +24 -4
  38. package/dist/text.js +1 -1
  39. package/docs/component-selection.md +8 -1
  40. package/docs/design/sketch/Kerf-UI.sketch +0 -0
  41. package/docs/design/sketch/README.md +12 -10
  42. package/docs/design/sketch/unified/README.md +22 -9
  43. package/docs/design/sketch/unified/pages/advanced.png +0 -0
  44. package/docs/design/sketch/unified/pages/content.png +0 -0
  45. package/docs/design/sketch/unified/pages/toolbar.png +0 -0
  46. package/docs/design/sketch/unified/variant-link-investigation.md +45 -0
  47. package/docs/layout.md +7 -0
  48. package/doctor/eslint-diagnostics.d.mts +4 -0
  49. package/doctor/eslint-diagnostics.mjs +13 -0
  50. package/doctor/index.mjs +2 -1
  51. package/package.json +1 -1
  52. package/dist/chunk-LK3QJHVX.js.map +0 -1
  53. package/dist/chunk-OW2ODKHN.js.map +0 -1
  54. package/dist/chunk-QNA27ABY.js.map +0 -1
  55. package/dist/chunk-XZ253TGP.js.map +0 -1
  56. package/dist/split-middle-De745N2j.d.ts +0 -7
@@ -3158,16 +3158,18 @@
3158
3158
  "category": "Structure",
3159
3159
  "kind": "component",
3160
3160
  "source": "kerf",
3161
- "description": "Semantic native text plus a FieldLabel heading for read-only field previews that matches themed Web Awesome form labels.",
3161
+ "description": "Semantic native text, a native Mark for find-in-content matches, and a FieldLabel heading for read-only field previews that matches themed Web Awesome form labels.",
3162
3162
  "uses": [],
3163
3163
  "purpose": "Render paragraph semantics by default, h1 through h6 when selected, or geometry-free inline secondary text as a span while independently configuring quiet or danger tone, compact through extra-large size, or monospace font.",
3164
3164
  "publicExports": [
3165
3165
  "Text",
3166
- "FieldLabel"
3166
+ "FieldLabel",
3167
+ "Mark"
3167
3168
  ],
3168
3169
  "useWhen": [
3169
3170
  "Render ordinary application headings or paragraphs with native document semantics, or inline secondary text inside rows, labels, and table cells.",
3170
3171
  "Render FieldLabel over a read-only or click-to-edit preview that replaces a Web Awesome form control.",
3172
+ "Wrap find-in-content matches in Mark; set current on the active result. It inherits surrounding typography, including monospaced code.",
3171
3173
  "Set weight=\"strong\" for a title or key phrase that matters more than its neighbors, such as a card or row title; it renders a <strong> element, so never hand-write <strong> inside Text."
3172
3174
  ],
3173
3175
  "avoidWhen": [
@@ -3191,7 +3193,8 @@
3191
3193
  "font",
3192
3194
  "copy",
3193
3195
  "document heading hierarchy",
3194
- "FieldLabel copy, preview/edit state, and aria-labelledby association"
3196
+ "FieldLabel copy, preview/edit state, and aria-labelledby association",
3197
+ "match ranges, active match, and find navigation"
3195
3198
  ],
3196
3199
  "variants": [
3197
3200
  "p, h1 through h6, or inline span semantic variant",
@@ -3202,13 +3205,15 @@
3202
3205
  "align start (default), center, or end for centered status copy or trailing values",
3203
3206
  "controlMargins selects exterior 8px gutters with canonical physical Sides",
3204
3207
  "wrap normal, anywhere, nowrap, or truncate; truncate places its ellipsis at the end, the start (keeping the tail), or the middle (keeping the last path segment or a character suffix)",
3205
- "size=\"medium\" for a 16px heading, such as an in-list group title that wraps a long name"
3208
+ "size=\"medium\" for a 16px heading, such as an in-list group title that wraps a long name",
3209
+ "Mark quiet match and current match"
3206
3210
  ],
3207
3211
  "accessibility": [
3208
3212
  "Text renders a native paragraph by default; choose an h1 through h6 variant by document outline rather than appearance, or span for inline secondary text.",
3209
3213
  "Ordinary global, data, and ARIA attributes pass through to the native element.",
3210
3214
  "Choose tone, size, and font independently of the heading level so appearance does not distort the document outline.",
3211
3215
  "FieldLabel is plain text, not a native label; give it an id and associate the preview group with aria-labelledby.",
3216
+ "Mark uses the native mark element and aria-current on the active result; search status and navigation announcements remain the application's responsibility.",
3212
3217
  "Start and middle truncation clip visually only: the whole value stays in the DOM in reading order, and Text shows it as the element's title unless the app supplies one."
3213
3218
  ],
3214
3219
  "content": {
@@ -3246,6 +3251,11 @@
3246
3251
  "publicTokens": [
3247
3252
  "--kui-color-danger-on-quiet",
3248
3253
  "--kui-color-text-quiet",
3254
+ "--kui-color-warning-border-loud",
3255
+ "--kui-color-warning-fill-loud",
3256
+ "--kui-color-warning-fill-quiet",
3257
+ "--kui-color-warning-on-fill",
3258
+ "--kui-color-warning-on-loud",
3249
3259
  "--kui-font-2xl",
3250
3260
  "--kui-font-l",
3251
3261
  "--kui-font-mono",
@@ -383,6 +383,13 @@
383
383
  "accepts": ["control"],
384
384
  "cardinality": { "min": 0, "max": 1 },
385
385
  "exclusiveWith": []
386
+ },
387
+ {
388
+ "id": "secondary-content",
389
+ "jsx": { "prop": "secondaryContent" },
390
+ "accepts": ["disclosure", "diagnostic-content"],
391
+ "cardinality": { "min": 0, "max": 1 },
392
+ "exclusiveWith": []
386
393
  }
387
394
  ]
388
395
  },
@@ -2740,6 +2740,11 @@
2740
2740
  "id": "FieldLabel copy, preview/edit state, and aria-labelledby association",
2741
2741
  "owner": "application",
2742
2742
  "required": false
2743
+ },
2744
+ {
2745
+ "id": "match ranges, active match, and find navigation",
2746
+ "owner": "application",
2747
+ "required": false
2743
2748
  }
2744
2749
  ],
2745
2750
  "wiring": {
@@ -2767,6 +2772,7 @@
2767
2772
  "Ordinary global, data, and ARIA attributes pass through to the native element.",
2768
2773
  "Choose tone, size, and font independently of the heading level so appearance does not distort the document outline.",
2769
2774
  "FieldLabel is plain text, not a native label; give it an id and associate the preview group with aria-labelledby.",
2775
+ "Mark uses the native mark element and aria-current on the active result; search status and navigation announcements remain the application's responsibility.",
2770
2776
  "Start and middle truncation clip visually only: the whole value stays in the DOM in reading order, and Text shows it as the element's title unless the app supplies one."
2771
2777
  ]
2772
2778
  },
@@ -2780,6 +2786,11 @@
2780
2786
  "publicTokens": [
2781
2787
  "--kui-color-danger-on-quiet",
2782
2788
  "--kui-color-text-quiet",
2789
+ "--kui-color-warning-border-loud",
2790
+ "--kui-color-warning-fill-loud",
2791
+ "--kui-color-warning-fill-quiet",
2792
+ "--kui-color-warning-on-fill",
2793
+ "--kui-color-warning-on-loud",
2783
2794
  "--kui-font-2xl",
2784
2795
  "--kui-font-l",
2785
2796
  "--kui-font-mono",
@@ -7571,6 +7582,13 @@
7571
7582
  "accepts": ["control"],
7572
7583
  "cardinality": { "min": 0, "max": 1 },
7573
7584
  "exclusiveWith": []
7585
+ },
7586
+ {
7587
+ "id": "secondary-content",
7588
+ "jsx": { "prop": "secondaryContent" },
7589
+ "accepts": ["disclosure", "diagnostic-content"],
7590
+ "cardinality": { "min": 0, "max": 1 },
7591
+ "exclusiveWith": []
7574
7592
  }
7575
7593
  ],
7576
7594
  "children": { "mode": "any", "concepts": [], "requiredConcepts": [] },
@@ -46,6 +46,7 @@ Zones (a zone is bound to JSX only through its listed prop; never assume the zon
46
46
 
47
47
  - `icon` — JSX prop `icon`; accepts `dormant-decoration`; 0–1.
48
48
  - `action` — JSX prop `action`; accepts `control`; 0–1.
49
+ - `secondary-content` — JSX prop `secondaryContent`; accepts [Disclosure](./disclosure.md), `diagnostic-content`; 0–1.
49
50
 
50
51
  ## State and wiring
51
52
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  `@kerfjs/ui:text` · Kerf UI · component · Structure
6
6
 
7
- Semantic native text plus a FieldLabel heading for read-only field previews that matches themed Web Awesome form labels.
7
+ Semantic native text, a native Mark for find-in-content matches, and a FieldLabel heading for read-only field previews that matches themed Web Awesome form labels.
8
8
 
9
9
  ## When to use
10
10
 
@@ -12,6 +12,7 @@ Render paragraph semantics by default, h1 through h6 when selected, or geometry-
12
12
 
13
13
  - Render ordinary application headings or paragraphs with native document semantics, or inline secondary text inside rows, labels, and table cells.
14
14
  - Render FieldLabel over a read-only or click-to-edit preview that replaces a Web Awesome form control.
15
+ - Wrap find-in-content matches in Mark; set current on the active result. It inherits surrounding typography, including monospaced code.
15
16
  - Set weight="strong" for a title or key phrase that matters more than its neighbors, such as a card or row title; it renders a \<strong> element, so never hand-write \<strong> inside Text.
16
17
 
17
18
  **Not when:**
@@ -26,7 +27,7 @@ Render paragraph semantics by default, h1 through h6 when selected, or geometry-
26
27
 
27
28
  ## Imports
28
29
 
29
- - JavaScript: `@kerfjs/ui/text` — exports `Text`, `FieldLabel`.
30
+ - JavaScript: `@kerfjs/ui/text` — exports `Text`, `FieldLabel`, `Mark`.
30
31
  - CSS: the browser build of `@kerfjs/ui/text` pulls its CSS automatically; import `@kerfjs/ui/text.css` manually only without the `browser` export condition.
31
32
  - Declared side effects: browser-condition-css.
32
33
 
@@ -45,6 +46,7 @@ Exact prop names and types: [`@kerfjs/ui/text`](../public-api-signatures-v1.md#k
45
46
  - controlMargins selects exterior 8px gutters with canonical physical Sides
46
47
  - wrap normal, anywhere, nowrap, or truncate; truncate places its ellipsis at the end, the start (keeping the tail), or the middle (keeping the last path segment or a character suffix)
47
48
  - size="medium" for a 16px heading, such as an in-list group title that wraps a long name
49
+ - Mark quiet match and current match
48
50
 
49
51
  ## Composition
50
52
 
@@ -54,7 +56,7 @@ Exact prop names and types: [`@kerfjs/ui/text`](../public-api-signatures-v1.md#k
54
56
 
55
57
  ## State and wiring
56
58
 
57
- **The app owns:** semantic variant; tone; size; font; copy; document heading hierarchy; FieldLabel copy, preview/edit state, and aria-labelledby association.
59
+ **The app owns:** semantic variant; tone; size; font; copy; document heading hierarchy; FieldLabel copy, preview/edit state, and aria-labelledby association; match ranges, active match, and find navigation.
58
60
 
59
61
  No wiring helper.
60
62
 
@@ -73,6 +75,7 @@ Inset-free (no margin, border, or padding) when `flush` or `variant="span"`: the
73
75
  - Ordinary global, data, and ARIA attributes pass through to the native element.
74
76
  - Choose tone, size, and font independently of the heading level so appearance does not distort the document outline.
75
77
  - FieldLabel is plain text, not a native label; give it an id and associate the preview group with aria-labelledby.
78
+ - Mark uses the native mark element and aria-current on the active result; search status and navigation announcements remain the application's responsibility.
76
79
  - Start and middle truncation clip visually only: the whole value stays in the DOM in reading order, and Text shows it as the element's title unless the app supplies one.
77
80
 
78
81
  `FieldLabel` renders a native control or link as its root, so it cannot sit in another such component's zones, and its own zones cannot hold a control, a link, or a component that renders one. (`KUI-V014`)
@@ -85,7 +88,7 @@ Public class hooks (select for layout placement only, never to change the compon
85
88
 
86
89
  Never put `kui-text`, `kui-text__field-label` on an element you write; render `Text` instead (`KUI-L103`).
87
90
 
88
- Public tokens it reads: `--kui-color-danger-on-quiet`, `--kui-color-text-quiet`, `--kui-font-2xl`, `--kui-font-l`, `--kui-font-mono`, `--kui-font-xs`, `--kui-layout-item-padding`. Set a token only where its public contract allows; prefer a prop.
91
+ Public tokens it reads: `--kui-color-danger-on-quiet`, `--kui-color-text-quiet`, `--kui-color-warning-border-loud`, `--kui-color-warning-fill-loud`, `--kui-color-warning-fill-quiet`, `--kui-color-warning-on-fill`, `--kui-color-warning-on-loud`, `--kui-font-2xl`, `--kui-font-l`, `--kui-font-mono`, `--kui-font-xs`, `--kui-layout-item-padding`. Set a token only where its public contract allows; prefer a prop.
89
92
 
90
93
  Everything else is internal: `kerf-ui-analyze` reports private or unknown `.kui-*` selectors (`KUI-L001`, `KUI-L010`), unknown or private tokens (`KUI-L002`, `KUI-L012`), and any application rule that restyles the component, forced dimensions included (`KUI-L019`).
91
94
 
@@ -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.136` and `kerfjs@5.0.0-beta.136`. This bounded reference covers only APIs used by the seven-task corpus. It is interface evidence, not an implementation or runtime guarantee.
3
+ Generated from emitted declarations for `@kerfjs/ui@5.0.0-beta.137` and `kerfjs@5.0.0-beta.137`. 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
 
@@ -1803,7 +1803,7 @@ export { ValueTable, type ValueTablePresentation, type ValueTableProps, ValueTab
1803
1803
  ```ts
1804
1804
  import { SafeHtml } from 'kerfjs';
1805
1805
  import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
1806
- import { M as MiddleTruncateKeep } from './split-middle-De745N2j.js';
1806
+ import { M as MiddleTruncateKeep, a as MiddleTruncatePriority } from './split-middle-BNI0Rni-.js';
1807
1807
 
1808
1808
  type TabBarItemRootAttributes = Readonly<Record<`data-${string}`, string | undefined> & {
1809
1809
  'data-component'?: never;
@@ -1816,6 +1816,7 @@ type TabBarItemRootAttributes = Readonly<Record<`data-${string}`, string | undef
1816
1816
  'data-drop-target'?: never;
1817
1817
  'data-name-overflow'?: never;
1818
1818
  'data-name-truncate'?: never;
1819
+ 'data-name-truncate-priority'?: never;
1819
1820
  'data-disabled'?: never;
1820
1821
  }>;
1821
1822
  type TabBarItemPresentation = 'pill' | 'segmented' | 'icon-only';
@@ -1828,11 +1829,13 @@ type TabBarItemNameOverflow = 'ellipsis' | 'visible';
1828
1829
  */
1829
1830
  type TabBarItemNameTruncate = 'end' | 'middle' | 'start';
1830
1831
  /**
1831
- * The suffix `nameTruncate="middle"` always keeps: a number of trailing
1832
+ * The suffix `nameTruncate="middle"` selects: a number of trailing
1832
1833
  * characters, or `segment` (default) for the last path segment, or the last
1833
1834
  * 10 characters when the name has no separator.
1834
1835
  */
1835
1836
  type TabBarItemNameTruncateKeep = MiddleTruncateKeep;
1837
+ /** Which part wins in a narrow middle-truncated tab; defaults to `head`. */
1838
+ type TabBarItemNameTruncatePriority = MiddleTruncatePriority;
1836
1839
  interface TabBarItemProps {
1837
1840
  id: string;
1838
1841
  name: string;
@@ -1876,6 +1879,8 @@ interface TabBarItemProps {
1876
1879
  nameTruncate?: TabBarItemNameTruncate;
1877
1880
  /** The suffix `nameTruncate="middle"` keeps (default `segment`). */
1878
1881
  nameTruncateKeep?: TabBarItemNameTruncateKeep;
1882
+ /** `head` (default) keeps a head sliver; `suffix` keeps the full suffix. */
1883
+ nameTruncatePriority?: TabBarItemNameTruncatePriority;
1879
1884
  /** Decorative dormant content for the close button. Must not contain interactive descendants. */
1880
1885
  closeIcon?: SafeHtml;
1881
1886
  selectAction?: string;
@@ -1898,9 +1903,9 @@ interface TabBarItemProps {
1898
1903
  /** Native named-slot assignment when composed inside a web component. */
1899
1904
  slot?: string;
1900
1905
  }
1901
- 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;
1906
+ 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;
1902
1907
 
1903
- export { TabBarItem, type TabBarItemNameOverflow, type TabBarItemNameTruncate, type TabBarItemNameTruncateKeep, type TabBarItemPresentation, type TabBarItemProps, type TabBarItemSize };
1908
+ export { TabBarItem, type TabBarItemNameOverflow, type TabBarItemNameTruncate, type TabBarItemNameTruncateKeep, type TabBarItemNameTruncatePriority, type TabBarItemPresentation, type TabBarItemProps, type TabBarItemSize };
1904
1909
  ```
1905
1910
 
1906
1911
  ## `@kerfjs/ui/tab-bar`
@@ -4659,6 +4664,8 @@ interface EmptyStateProps {
4659
4664
  detail?: string;
4660
4665
  icon?: SafeHtml;
4661
4666
  action?: KerfUiContent;
4667
+ /** Start-aligned secondary content, such as diagnostic Disclosure details. */
4668
+ secondaryContent?: KerfUiContent;
4662
4669
  busy?: boolean;
4663
4670
  className?: string;
4664
4671
  /** Native named-slot assignment when composed inside a web component. */
@@ -4667,7 +4674,7 @@ interface EmptyStateProps {
4667
4674
  * test hook; the component's own markers stay protected. */
4668
4675
  rootAttributes?: RootDataAttributes;
4669
4676
  }
4670
- declare function EmptyState({ title, detail, icon, action, busy, className, slot, rootAttributes, }: EmptyStateProps): SafeHtml;
4677
+ declare function EmptyState({ title, detail, icon, action, secondaryContent, busy, className, slot, rootAttributes, }: EmptyStateProps): SafeHtml;
4671
4678
 
4672
4679
  export { EmptyState, type EmptyStateProps };
4673
4680
  ```
@@ -6068,12 +6075,13 @@ export { WorkbenchDialog, type WorkbenchDialogProps, type WorkbenchDialogRootAtt
6068
6075
 
6069
6076
  ```ts
6070
6077
  import * as kerfjs from 'kerfjs';
6078
+ import { SafeHtml } from 'kerfjs';
6071
6079
  import { KerfBaseAttrs } from 'kerfjs/jsx-runtime';
6072
6080
  import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
6073
6081
  import { R as RootDataAttributes } from './extension-attributes-CnqvBmj3.js';
6074
6082
  import { S as Sides } from './sides-BPSWde0A.js';
6075
6083
  import { CssForegroundColor } from './css-values.js';
6076
- import { M as MiddleTruncateKeep } from './split-middle-De745N2j.js';
6084
+ import { M as MiddleTruncateKeep, a as MiddleTruncatePriority } from './split-middle-BNI0Rni-.js';
6077
6085
 
6078
6086
  type FieldLabelProps = Omit<KerfBaseAttrs, 'children' | 'class' | 'className' | 'id'> & {
6079
6087
  children: string;
@@ -6111,10 +6119,12 @@ type TextAlign = 'start' | 'center' | 'end';
6111
6119
  */
6112
6120
  type TextTruncate = 'end' | 'middle' | 'start';
6113
6121
  /**
6114
- * The suffix `truncate="middle"` always keeps: a number of trailing
6122
+ * The suffix `truncate="middle"` selects: a number of trailing
6115
6123
  * characters, or `segment` for the last path segment with its separator.
6116
6124
  */
6117
6125
  type TextTruncateKeep = MiddleTruncateKeep;
6126
+ /** Which part wins in a narrow middle-truncated box; defaults to `head`. */
6127
+ type TextTruncatePriority = MiddleTruncatePriority;
6118
6128
  type TextContent = KerfUiContent | string | number | readonly TextContent[];
6119
6129
  type TextCommonProps = Omit<KerfBaseAttrs, 'children' | 'class' | 'className' | 'id' | 'lang'> & {
6120
6130
  /**
@@ -6172,12 +6182,14 @@ type TextProps = TextCommonProps & ({
6172
6182
  maxLines?: number;
6173
6183
  truncate?: never;
6174
6184
  truncateKeep?: never;
6185
+ truncatePriority?: never;
6175
6186
  } | {
6176
6187
  /** Keep one line without an ellipsis. */
6177
6188
  wrap: 'nowrap';
6178
6189
  maxLines?: never;
6179
6190
  truncate?: never;
6180
6191
  truncateKeep?: never;
6192
+ truncatePriority?: never;
6181
6193
  } | {
6182
6194
  /** Keep one line with an ellipsis. */
6183
6195
  wrap: 'truncate';
@@ -6194,15 +6206,30 @@ type TextProps = TextCommonProps & ({
6194
6206
  * `\\` separator).
6195
6207
  */
6196
6208
  truncateKeep?: TextTruncateKeep;
6209
+ /**
6210
+ * Narrow-box policy for `truncate="middle"`: `head` (default)
6211
+ * reserves a head sliver and ellipsizes the suffix; `suffix` keeps
6212
+ * the suffix whole while the head shrinks to an ellipsis or nothing.
6213
+ */
6214
+ truncatePriority?: TextTruncatePriority;
6197
6215
  });
6198
6216
  /**
6199
6217
  * Semantic heading, paragraph, or inline text. Block variants use the standard
6200
6218
  * content-item padding; `span` adds no box geometry.
6201
6219
  * All ordinary native heading/paragraph attributes pass through to the element.
6202
6220
  */
6203
- 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;
6221
+ 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;
6222
+
6223
+ interface MarkProps {
6224
+ /** Matched content; inherits the surrounding font, including code typography. */
6225
+ children: SafeHtml | string | number;
6226
+ /** Emphasize the active result among otherwise quiet matches. */
6227
+ current?: boolean;
6228
+ }
6229
+ /** A native text highlight for find-in-content results. */
6230
+ declare function Mark({ children, current }: MarkProps): SafeHtml;
6204
6231
 
6205
- 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 };
6232
+ 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 };
6206
6233
  ```
6207
6234
 
6208
6235
  ## `@kerfjs/ui/editor-frame`
@@ -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.136` 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.
3
+ Generated from the emitted `@kerfjs/ui@5.0.0-beta.137` declaration boundary. Import `@kerfjs/ui/webawesome` for type effects when authoring direct `wa-*` JSX. The module emits no runtime behavior and does not register custom elements.
4
4
 
5
5
  ```ts
6
6
  import { KerfCustomElement } from 'kerfjs/jsx-runtime';
package/dist/catalog.js CHANGED
@@ -28,8 +28,8 @@ import { ListItem } from './chunk-UWLJ7UEK.js';
28
28
 
29
29
 
30
30
 
31
- import { ListHeader } from './chunk-AUYGZ3UP.js';
32
- import { Text } from './chunk-OW2ODKHN.js';
31
+ import { ListHeader } from './chunk-D4KXWVNG.js';
32
+ import { Text } from './chunk-44C2K6V6.js';
33
33
 
34
34
 
35
35
 
@@ -1,6 +1,6 @@
1
- import { splitMiddle } from './chunk-LK3QJHVX.js';
1
+ import { splitMiddle } from './chunk-GP3G3ZY3.js';
2
2
  import { filterDataAttributes } from './chunk-BRDTP3RT.js';
3
- import { jsx, jsxs } from 'kerfjs/jsx-runtime';
3
+ import { jsx, jsxs, Fragment } from 'kerfjs/jsx-runtime';
4
4
 
5
5
  function FieldLabel({
6
6
  children,
@@ -24,7 +24,8 @@ var textProtectedAttributes = /* @__PURE__ */ new Set([
24
24
  "data-align",
25
25
  "data-wrap",
26
26
  "data-max-lines",
27
- "data-truncate"
27
+ "data-truncate",
28
+ "data-truncate-priority"
28
29
  ]);
29
30
  function Text({
30
31
  variant: Variant = "p",
@@ -45,6 +46,7 @@ function Text({
45
46
  maxLines,
46
47
  truncate,
47
48
  truncateKeep,
49
+ truncatePriority,
48
50
  children,
49
51
  class: classValue = "",
50
52
  className = "",
@@ -64,6 +66,10 @@ function Text({
64
66
  throw new RangeError(
65
67
  'Text truncateKeep requires truncate="middle" and a positive integer or "segment"'
66
68
  );
69
+ if (truncatePriority !== void 0 && (position !== "middle" || !["head", "suffix"].includes(truncatePriority)))
70
+ throw new RangeError(
71
+ 'Text truncatePriority requires truncate="middle" and one of head or suffix'
72
+ );
67
73
  const textValue = typeof children === "string" || typeof children === "number" ? String(children) : void 0;
68
74
  if (position === "middle" && textValue === void 0)
69
75
  throw new TypeError(
@@ -91,6 +97,7 @@ function Text({
91
97
  "data-wrap": wrap === "normal" ? void 0 : wrap,
92
98
  "data-max-lines": maxLines === void 0 ? void 0 : String(maxLines),
93
99
  "data-truncate": position === "end" ? void 0 : position,
100
+ "data-truncate-priority": position === "middle" && truncatePriority === "suffix" ? "suffix" : void 0,
94
101
  title,
95
102
  style: color === void 0 ? style : `${style === void 0 || style === null ? "" : `${style};`}color:${color}`,
96
103
  children: textBody(
@@ -98,6 +105,7 @@ function Text({
98
105
  children,
99
106
  textValue,
100
107
  truncateKeep,
108
+ truncatePriority,
101
109
  maxLines,
102
110
  weight === "strong"
103
111
  )
@@ -105,7 +113,7 @@ function Text({
105
113
  );
106
114
  }
107
115
  var LRM = "\u200E";
108
- function textBody(position, children, textValue, truncateKeep, maxLines, strong) {
116
+ function textBody(position, children, textValue, truncateKeep, truncatePriority, maxLines, strong) {
109
117
  const content = strong ? /* @__PURE__ */ jsx("strong", { children }) : children;
110
118
  switch (position) {
111
119
  case "start":
@@ -119,7 +127,8 @@ function textBody(position, children, textValue, truncateKeep, maxLines, strong)
119
127
  TruncateMiddle,
120
128
  {
121
129
  parts: splitMiddle(textValue, truncateKeep ?? "segment"),
122
- strong
130
+ strong,
131
+ suffixPriority: truncatePriority === "suffix"
123
132
  }
124
133
  );
125
134
  case "end":
@@ -135,15 +144,30 @@ function textBody(position, children, textValue, truncateKeep, maxLines, strong)
135
144
  }
136
145
  function TruncateMiddle({
137
146
  parts: [head, tail],
138
- strong
147
+ strong,
148
+ suffixPriority
139
149
  }) {
140
150
  const mark = (part) => strong ? /* @__PURE__ */ jsx("strong", { children: part }) : part;
141
151
  return /* @__PURE__ */ jsxs("span", { class: "kui-text__truncate-middle", children: [
142
- /* @__PURE__ */ jsx("span", { class: "kui-text__truncate-head", children: mark(head) }),
152
+ /* @__PURE__ */ jsx("span", { class: "kui-text__truncate-head", children: suffixPriority ? /* @__PURE__ */ jsxs(Fragment, { children: [
153
+ /* @__PURE__ */ jsx("span", { class: "kui-text__truncate-head-sizer", "aria-hidden": "true", children: mark(head) }),
154
+ /* @__PURE__ */ jsx("span", { class: "kui-text__truncate-head-clip", children: /* @__PURE__ */ jsx("span", { class: "kui-text__truncate-head-content", children: mark(head) }) })
155
+ ] }) : mark(head) }),
143
156
  tail ? /* @__PURE__ */ jsx("span", { class: "kui-text__truncate-tail", children: mark(tail) }) : ""
144
157
  ] });
145
158
  }
159
+ function Mark({ children, current = false }) {
160
+ return /* @__PURE__ */ jsx(
161
+ "mark",
162
+ {
163
+ class: "kui-text__mark",
164
+ "data-current": current ? "true" : void 0,
165
+ "aria-current": current ? "true" : void 0,
166
+ children
167
+ }
168
+ );
169
+ }
146
170
 
147
- export { FieldLabel, Text };
171
+ export { FieldLabel, Mark, Text };
148
172
 
149
- //# sourceMappingURL=chunk-OW2ODKHN.js.map
173
+ //# sourceMappingURL=chunk-44C2K6V6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/forms/field-label/field-label.tsx","../src/components/typography/text/text.tsx"],"names":["jsx"],"mappings":";;;;AAiBO,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","file":"chunk-44C2K6V6.js","sourcesContent":["import type { KerfBaseAttrs } from 'kerfjs/jsx-runtime';\n\nexport type FieldLabelProps = Omit<\n KerfBaseAttrs,\n 'children' | 'class' | 'className' | 'id'\n> & {\n children: string;\n /**\n * The label's id: what a group's `labelledBy` (a ChoiceChips or a preview\n * group's `aria-labelledby`) names, so the label is that group's name.\n */\n id?: string;\n class?: string;\n className?: string;\n};\n\n/** Visible field heading for a read-only preview; use its id with aria-labelledby on the preview group. */\nexport function FieldLabel({\n children,\n id,\n class: classValue = '',\n className = '',\n ...attributes\n}: FieldLabelProps) {\n const classes = ['kui-text__field-label', classValue, className]\n .filter(Boolean)\n .join(' ');\n return (\n <div {...attributes} id={id} class={classes} data-component=\"field-label\">\n {children}\n </div>\n );\n}\n","import type { SafeHtml } from 'kerfjs';\nimport type { KerfBaseAttrs } from 'kerfjs/jsx-runtime';\n\nimport type { KerfUiContent } from '../../../shared/content/semantic-content.js';\nimport {\n filterDataAttributes,\n type RootDataAttributes,\n} from '../../../shared/dom/extension-attributes.js';\nimport type { Sides } from '../../../shared/layout/sides.js';\nimport type { CssForegroundColor } from '../../../shared/styles/css-values.js';\n\nexport {\n FieldLabel,\n type FieldLabelProps,\n} from '../../forms/field-label/field-label.js';\nimport {\n type MiddleTruncateKeep,\n type MiddleTruncatePriority,\n splitMiddle,\n} from '../../../shared/text/split-middle.js';\n\nexport type TextVariant =\n 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span';\nexport type TextTone = 'default' | 'quiet' | 'danger';\n/** `strong` marks the text as important with a `<strong>` element. */\nexport type TextWeight = 'regular' | 'strong';\n/**\n * `compact` (xs), `default` (the element's own size), `medium` (the 16px\n * body size, for a heading such as an in-list group title), `large`, or\n * `xlarge`.\n */\nexport type TextSize = 'compact' | 'default' | 'medium' | 'large' | 'xlarge';\nexport type TextFont = 'default' | 'monospace';\nexport type TextBorder = 'transparent' | 'none';\nexport type TextLineHeight = 'default' | 'tight';\nexport type TextWrap = 'normal' | 'anywhere' | 'nowrap' | 'truncate';\n/** Inline alignment of the text's lines, in logical (writing-direction) terms. */\nexport type TextAlign = 'start' | 'center' | 'end';\n/**\n * Where `wrap=\"truncate\"` places its ellipsis: `end` (default) keeps the\n * start, `start` keeps the tail (branch names, the end of an identifier), and\n * `middle` keeps both the start and a suffix (file paths).\n */\nexport type TextTruncate = 'end' | 'middle' | 'start';\n/**\n * The suffix `truncate=\"middle\"` selects: a number of trailing\n * characters, or `segment` for the last path segment with its separator.\n */\nexport type TextTruncateKeep = MiddleTruncateKeep;\n/** Which part wins in a narrow middle-truncated box; defaults to `head`. */\nexport type TextTruncatePriority = MiddleTruncatePriority;\n\nexport type TextContent =\n KerfUiContent | string | number | readonly TextContent[];\n\ntype TextCommonProps = Omit<\n KerfBaseAttrs,\n 'children' | 'class' | 'className' | 'id' | 'lang'\n> & {\n /**\n * The element's id, for a link or `aria-*` reference to target (a\n * `ListItemLink href=\"#…\"` destination, for example).\n */\n id?: string;\n /** The text's language (`lang`), when it differs from the page's (KF-AC7AFR). */\n lang?: string;\n /**\n * An accessible name for the element (`aria-label`), such as a named\n * example paragraph (KF-AC7AFR). Visible text names most Text already.\n */\n ariaLabel?: string;\n /** Native heading, paragraph, or inline span element to render. Defaults to `p`. */\n variant?: TextVariant;\n /** Semantic foreground treatment. Defaults to the inherited foreground. */\n tone?: TextTone;\n /**\n * `strong` wraps the text in `<strong>`, for a title or key phrase that\n * matters more than its neighbors. Defaults to `regular`.\n */\n weight?: TextWeight;\n /** Foreground color; overrides tone when supplied, or inherits when omitted. */\n color?: CssForegroundColor;\n /** Text sizing independent of the native semantic element. */\n size?: TextSize;\n /** Font family independent of the native semantic element. */\n font?: TextFont;\n /** Transparent alignment border or no border when embedded in owner chrome. */\n border?: TextBorder;\n /** Add the shared control gutter outside selected physical edges. */\n controlMargins?: Sides;\n /** Remove the block variant's item padding and border in compact content. */\n flush?: boolean;\n /** Use compact leading for short dialog or metadata copy. */\n lineHeight?: TextLineHeight;\n /** Inline alignment of the lines (default `start`), for centered status copy. */\n align?: TextAlign;\n /**\n * Announce changes to this text as a live region (`aria-live`), for a\n * status or result readout that updates without moving focus.\n */\n live?: 'polite' | 'assertive';\n /** Application `data-*` metadata (test hooks, row keys); Text's own stay protected. */\n rootAttributes?: RootDataAttributes;\n children: TextContent;\n class?: string;\n className?: string;\n};\n\nexport type TextProps = TextCommonProps &\n (\n | {\n /** Wrap normally or break long unbroken strings. Defaults to normal. */\n wrap?: 'normal' | 'anywhere';\n /** Cap wrapped text to this positive number of lines. */\n maxLines?: number;\n truncate?: never;\n truncateKeep?: never;\n truncatePriority?: never;\n }\n | {\n /** Keep one line without an ellipsis. */\n wrap: 'nowrap';\n maxLines?: never;\n truncate?: never;\n truncateKeep?: never;\n truncatePriority?: never;\n }\n | {\n /** Keep one line with an ellipsis. */\n wrap: 'truncate';\n maxLines?: never;\n /**\n * Where the ellipsis goes (default `end`). `start` and `middle` are\n * for left-to-right identifiers and paths, and `middle` requires\n * string or number children so it can split them.\n */\n truncate?: TextTruncate;\n /**\n * The suffix `truncate=\"middle\"` keeps (default `segment`: the last\n * path segment, or the last 10 characters when there is no `/` or\n * `\\\\` separator).\n */\n truncateKeep?: TextTruncateKeep;\n /**\n * Narrow-box policy for `truncate=\"middle\"`: `head` (default)\n * reserves a head sliver and ellipsizes the suffix; `suffix` keeps\n * the suffix whole while the head shrinks to an ellipsis or nothing.\n */\n truncatePriority?: TextTruncatePriority;\n }\n );\n\n/** Attributes Text writes itself, which `rootAttributes` cannot replace. */\nconst textProtectedAttributes = new Set([\n 'data-component',\n 'data-tone',\n 'data-size',\n 'data-font',\n 'data-border',\n 'data-control-margins',\n 'data-flush',\n 'data-line-height',\n 'data-align',\n 'data-wrap',\n 'data-max-lines',\n 'data-truncate',\n 'data-truncate-priority',\n]);\n\n/**\n * Semantic heading, paragraph, or inline text. Block variants use the standard\n * content-item padding; `span` adds no box geometry.\n * All ordinary native heading/paragraph attributes pass through to the element.\n */\nexport function Text({\n variant: Variant = 'p',\n tone = 'default',\n weight = 'regular',\n color,\n size = 'default',\n font = 'default',\n border = 'transparent',\n flush = false,\n controlMargins = '',\n lineHeight = 'default',\n align = 'start',\n live,\n ariaLabel,\n rootAttributes = {},\n wrap = 'normal',\n maxLines,\n truncate,\n truncateKeep,\n truncatePriority,\n children,\n class: classValue = '',\n className = '',\n style,\n ...attributes\n}: TextProps) {\n if (\n maxLines !== undefined &&\n (!Number.isSafeInteger(maxLines) ||\n maxLines < 1 ||\n wrap === 'nowrap' ||\n wrap === 'truncate')\n )\n throw new RangeError(\n 'Text maxLines requires a positive integer and wrapping',\n );\n const position = truncate ?? 'end';\n if (\n (truncate !== undefined && wrap !== 'truncate') ||\n !['end', 'middle', 'start'].includes(position)\n )\n throw new RangeError(\n 'Text truncate requires wrap=\"truncate\" and one of end, middle, or start',\n );\n if (\n truncateKeep !== undefined &&\n (position !== 'middle' ||\n (truncateKeep !== 'segment' &&\n (!Number.isSafeInteger(truncateKeep) || truncateKeep < 1)))\n )\n throw new RangeError(\n 'Text truncateKeep requires truncate=\"middle\" and a positive integer or \"segment\"',\n );\n if (\n truncatePriority !== undefined &&\n (position !== 'middle' || !['head', 'suffix'].includes(truncatePriority))\n )\n throw new RangeError(\n 'Text truncatePriority requires truncate=\"middle\" and one of head or suffix',\n );\n const textValue =\n typeof children === 'string' || typeof children === 'number'\n ? String(children)\n : undefined;\n if (position === 'middle' && textValue === undefined)\n throw new TypeError(\n 'Text truncate=\"middle\" requires string or number children',\n );\n // Visually clipped start/middle text keeps its full value in the DOM; the\n // title shows it to pointer users unless the app supplied its own.\n const title =\n attributes.title === undefined && position !== 'end'\n ? textValue\n : attributes.title;\n const classes = ['kui-text', classValue, className].filter(Boolean).join(' ');\n return (\n <Variant\n {...filterDataAttributes(rootAttributes, textProtectedAttributes)}\n {...attributes}\n aria-live={live ?? attributes['aria-live']}\n aria-label={ariaLabel ?? attributes['aria-label']}\n class={classes}\n data-component=\"text\"\n data-tone={tone}\n data-size={size}\n data-font={font}\n data-border={border}\n data-control-margins={controlMargins || undefined}\n data-flush={flush ? 'true' : undefined}\n data-line-height={lineHeight === 'tight' ? 'tight' : undefined}\n data-align={align === 'start' ? undefined : align}\n data-wrap={wrap === 'normal' ? undefined : wrap}\n data-max-lines={maxLines === undefined ? undefined : String(maxLines)}\n data-truncate={position === 'end' ? undefined : position}\n data-truncate-priority={\n position === 'middle' && truncatePriority === 'suffix'\n ? 'suffix'\n : undefined\n }\n title={title}\n style={\n color === undefined\n ? style\n : `${style === undefined || style === null ? '' : `${style};`}color:${color}`\n }\n >\n {textBody(\n position,\n children,\n textValue,\n truncateKeep,\n truncatePriority,\n maxLines,\n weight === 'strong',\n )}\n </Variant>\n );\n}\n\n/** U+200E LEFT-TO-RIGHT MARK. */\nconst LRM = '\\u200E';\n\n/** The element's content for its truncation position or line cap. */\nfunction textBody(\n position: TextTruncate,\n children: TextContent,\n textValue: string | undefined,\n truncateKeep: TextTruncateKeep | undefined,\n truncatePriority: TextTruncatePriority | undefined,\n maxLines: number | undefined,\n strong: boolean,\n): TextContent {\n const content = strong ? <strong>{children}</strong> : children;\n switch (position) {\n case 'start':\n // KF-FM2NWN: left-to-right marks keep the text's own order and edge\n // punctuation in the right-to-left clip box. An isolating `dir=\"ltr\"`\n // span would too, but WebKit then draws no leading ellipsis once the\n // text has a space.\n return (\n <span class=\"kui-text__truncate-start\">\n {LRM}\n {content}\n {LRM}\n </span>\n );\n case 'middle':\n return (\n <TruncateMiddle\n parts={splitMiddle(textValue!, truncateKeep ?? 'segment')}\n strong={strong}\n suffixPriority={truncatePriority === 'suffix'}\n />\n );\n case 'end':\n return maxLines === undefined ? (\n content\n ) : (\n <span\n class=\"kui-text__clamp\"\n style={`--_kui-text-max-lines:${maxLines}`}\n >\n {content}\n </span>\n );\n }\n}\n\nfunction TruncateMiddle({\n parts: [head, tail],\n strong,\n suffixPriority,\n}: {\n parts: [string, string];\n strong: boolean;\n suffixPriority: boolean;\n}) {\n // A strong middle truncation keeps its two shrinking parts and marks each.\n const mark = (part: string) => (strong ? <strong>{part}</strong> : part);\n return (\n <span class=\"kui-text__truncate-middle\">\n <span class=\"kui-text__truncate-head\">\n {suffixPriority ? (\n <>\n <span class=\"kui-text__truncate-head-sizer\" aria-hidden=\"true\">\n {mark(head)}\n </span>\n <span class=\"kui-text__truncate-head-clip\">\n <span class=\"kui-text__truncate-head-content\">{mark(head)}</span>\n </span>\n </>\n ) : (\n mark(head)\n )}\n </span>\n {tail ? <span class=\"kui-text__truncate-tail\">{mark(tail)}</span> : ''}\n </span>\n );\n}\n\nexport type { Sides } from '../../../shared/layout/sides.js';\n\nexport interface MarkProps {\n /** Matched content; inherits the surrounding font, including code typography. */\n children: SafeHtml | string | number;\n /** Emphasize the active result among otherwise quiet matches. */\n current?: boolean;\n}\n\n/** A native text highlight for find-in-content results. */\nexport function Mark({ children, current = false }: MarkProps) {\n return (\n <mark\n class=\"kui-text__mark\"\n data-current={current ? 'true' : undefined}\n aria-current={current ? 'true' : undefined}\n >\n {children}\n </mark>\n );\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { Text } from './chunk-OW2ODKHN.js';
1
+ import { Text } from './chunk-44C2K6V6.js';
2
2
  import { Skeleton } from './chunk-LH7YRRY7.js';
3
3
  import { DisclosureArrow } from './chunk-3UIZ36BP.js';
4
4
  import { Badge } from './chunk-VHAYQGWR.js';
@@ -228,4 +228,4 @@ function ListHeader({
228
228
 
229
229
  export { ListHeader };
230
230
 
231
- //# sourceMappingURL=chunk-AUYGZ3UP.js.map
231
+ //# sourceMappingURL=chunk-D4KXWVNG.js.map