@kerfjs/ui 5.0.0-beta.60 → 5.0.0-beta.61

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 (95) hide show
  1. package/README.md +1 -0
  2. package/ai/component-catalog.json +129 -19
  3. package/ai/component-composition-rules.json +8 -0
  4. package/ai/component-composition.d.ts +10 -0
  5. package/ai/component-composition.json +109 -7
  6. package/ai/component-composition.schema.json +21 -0
  7. package/ai/components/README.md +5 -4
  8. package/ai/components/chip.md +72 -0
  9. package/ai/components/grid.md +10 -7
  10. package/ai/components/list-item.md +10 -7
  11. package/ai/components/select.md +5 -2
  12. package/ai/components/tabs.md +8 -4
  13. package/ai/components/toolbar.md +3 -2
  14. package/ai/public-api-signatures-v1.md +90 -14
  15. package/ai/skill.md +21 -3
  16. package/ai/webawesome-jsx-signatures-v1.md +1 -1
  17. package/dist/app-tab.d.ts +12 -2
  18. package/dist/app-tab.js +1 -1
  19. package/dist/browser/chip.js +3 -0
  20. package/dist/catalog.js +6 -6
  21. package/dist/chip.d.ts +29 -0
  22. package/dist/chip.js +3 -0
  23. package/dist/chip.js.map +1 -0
  24. package/dist/{chunk-F7F7KRO2.js → chunk-4SQK27MR.js} +33 -18
  25. package/dist/chunk-4SQK27MR.js.map +1 -0
  26. package/dist/{chunk-46263QLK.js → chunk-C4OYOKWX.js} +18 -6
  27. package/dist/chunk-C4OYOKWX.js.map +1 -0
  28. package/dist/chunk-EAC4CDY7.js +57 -0
  29. package/dist/chunk-EAC4CDY7.js.map +1 -0
  30. package/dist/{chunk-T57AXDFM.js → chunk-NYL63PSD.js} +2 -2
  31. package/dist/{chunk-T57AXDFM.js.map → chunk-NYL63PSD.js.map} +1 -1
  32. package/dist/{chunk-T66UNBXL.js → chunk-Q6YU3BT7.js} +11 -2
  33. package/dist/chunk-Q6YU3BT7.js.map +1 -0
  34. package/dist/chunk-SWVW56CV.js +188 -0
  35. package/dist/chunk-SWVW56CV.js.map +1 -0
  36. package/dist/{chunk-WPLIO5WJ.js → chunk-TEYARRAK.js} +37 -5
  37. package/dist/chunk-TEYARRAK.js.map +1 -0
  38. package/dist/{chunk-AGXQQFKZ.js → chunk-UCKKT6KO.js} +13 -4
  39. package/dist/chunk-UCKKT6KO.js.map +1 -0
  40. package/dist/{chunk-UWONG4QE.js → chunk-VCBTX62E.js} +11 -3
  41. package/dist/chunk-VCBTX62E.js.map +1 -0
  42. package/dist/{chunk-2OXQHM7I.js → chunk-Y74NWGQW.js} +3 -3
  43. package/dist/{chunk-2OXQHM7I.js.map → chunk-Y74NWGQW.js.map} +1 -1
  44. package/dist/collapsible-panel.js +2 -2
  45. package/dist/grid.d.ts +13 -5
  46. package/dist/grid.js +1 -1
  47. package/dist/index.d.ts +4 -3
  48. package/dist/index.js +14 -13
  49. package/dist/list-item.d.ts +11 -1
  50. package/dist/list-item.js +1 -1
  51. package/dist/popup-menu.d.ts +2 -2
  52. package/dist/popup-menu.js +1 -1
  53. package/dist/select-register.js +46 -0
  54. package/dist/select-register.js.map +1 -1
  55. package/dist/select.d.ts +14 -0
  56. package/dist/select.js +1 -1
  57. package/dist/styles/app-tab.css +35 -0
  58. package/dist/styles/chip.css +118 -0
  59. package/dist/styles/grid.css +7 -0
  60. package/dist/styles/list-item.css +14 -9
  61. package/dist/styles/popup-menu.css +2 -1
  62. package/dist/styles/segmented-control.css +2 -1
  63. package/dist/styles/select.css +30 -0
  64. package/dist/styles/styles.css +1 -0
  65. package/dist/styles/toolbar.css +8 -5
  66. package/dist/{token-search-field-CCke1yvQ.d.ts → token-search-field-DvgFLhLL.d.ts} +6 -2
  67. package/dist/token-search-field.d.ts +1 -1
  68. package/dist/token-search-model.d.ts +1 -1
  69. package/dist/token-search-model.js +1 -1
  70. package/dist/wire-catalog.js +1 -1
  71. package/dist/wire-tab-bars.js +1 -1
  72. package/dist/wire-token-search-fields.d.ts +1 -1
  73. package/dist/workbench.js +1 -1
  74. package/docs/accessibility.md +29 -3
  75. package/docs/component-contract.md +5 -0
  76. package/docs/component-selection.md +66 -4
  77. package/docs/design/templates/segmented-control/equal-dark.svg +1 -1
  78. package/docs/design/templates/segmented-control/equal.svg +1 -1
  79. package/docs/design/templates/segmented-control/pill-small-dark.svg +1 -1
  80. package/docs/design/templates/segmented-control/pill-small.svg +1 -1
  81. package/docs/design/templates/segmented-control-dark.svg +1 -1
  82. package/docs/design/templates/segmented-control.svg +1 -1
  83. package/docs/layout.md +20 -9
  84. package/docs/sunken-panel.md +5 -0
  85. package/docs/webawesome-theme.md +32 -0
  86. package/llms.txt +36 -8
  87. package/package.json +7 -1
  88. package/dist/chunk-46263QLK.js.map +0 -1
  89. package/dist/chunk-5I7OHCIP.js +0 -96
  90. package/dist/chunk-5I7OHCIP.js.map +0 -1
  91. package/dist/chunk-AGXQQFKZ.js.map +0 -1
  92. package/dist/chunk-F7F7KRO2.js.map +0 -1
  93. package/dist/chunk-T66UNBXL.js.map +0 -1
  94. package/dist/chunk-UWONG4QE.js.map +0 -1
  95. package/dist/chunk-WPLIO5WJ.js.map +0 -1
package/ai/skill.md CHANGED
@@ -139,7 +139,7 @@ Quick routing:
139
139
  | ------------------------------------- | ---------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
140
140
  | Navigation row | `ListItem` | Use an ordinary link or button when sidebar/menu anatomy and state do not apply. Its rounded root clips overflowing descendants; set `multiline` when the primary label should wrap. Multiline leading icons stay aligned with the first text line. |
141
141
  | Horizontal flex layout | `Row` | Use `hAlign`/`vAlign`, a typed `gap`, and opt-in `wrap`; use `List` when the main axis is vertical. |
142
- | Equal-width columns | `Grid` | Use a positive fixed `columns` count plus typed `gap`/`flex`. The app owns responsive count changes; use CSS grid for asymmetric/intrinsic tracks and `ResizableRegion` for adjustable boundaries. |
142
+ | Equal-width columns | `Grid` | Use fixed `columns` or typed `minColumnWidth` for automatic container-width collapse, plus typed `gap`/`flex`. Use CSS grid for asymmetric/intrinsic tracks and `ResizableRegion` for adjustable boundaries. |
143
143
  | Navigation row with a trailing action | `ListActionRow` | Use `ListItem` when the trailing region is dormant; never put controls inside either component's SafeHtml slots. Multiline leading icons stay aligned with the first text line. |
144
144
  | Page, panel, or dialog heading | `Toolbar` + `ToolbarText` | Use a direct extra-large `ToolbarText`, optional grouped icon, grouped trailing controls, and app-owned supporting copy below. |
145
145
  | Exclusive choice | `TabBar`, `SegmentedControl`, or `Select` | Tabs switch tabpanels; segments expose a few choices; Select handles a longer value list. |
@@ -152,6 +152,11 @@ Quick routing:
152
152
  | Key/value facts | `ValueTable` with `ValueTableRow` | Use rows with `icon` only when the optional 24px leading visual adds context. |
153
153
  | Command search | Application-local semantics using shared layout vocabulary | No runtime component or production recipe is exported; the app owns behavior, policy, and copy. |
154
154
 
155
+ For equal-width responsive forms, set `Grid minColumnWidth={px(376)}` instead of
156
+ `columns`. Grid fits tracks from its own container width and collapses to one
157
+ when a second minimum-width track plus the gap no longer fits. Constrain the
158
+ outer Grid width when the form should have a maximum column count.
159
+
155
160
  For a complete shell, sidebar, workspace header, list-detail dialog, composer
156
161
  form, list-state lifecycle, or mixed-control toolbar, start from the runnable
157
162
  reference in [`docs/recipes.md`](../docs/recipes.md). Preserve its production
@@ -194,7 +199,8 @@ Hard rules:
194
199
  8. `ResizableRegion` uses `wireResizableRegions()` for Arrow, Shift+Arrow, Home/End, and pointer behavior. The app owns size persistence. `handleIcon` replaces decorative dormant glyph content only. Set `responsiveFillAt="narrow"` or `"compact"` when a responsive composition exposes the pane as its only inline track; the component fills that track and hides its dormant separator. For compact overlays, set `presentation="overlay"` and the overlay maximum variables. A lone child (normally a `Pane`) fills the region and owns scrolling; several children stack at natural height. Do not add descendant width/height overrides.
195
200
  9. Use controlled `SegmentedControl` for a small exclusive choice set. Select `appearance="toolbar"` when nesting it inside `ToolbarControlGroup`; use rounded or pill shapes for standalone contexts. The package derives inset hover/selection radii from the owning outer shape through `--kui-layout-highlight-inset`; do not restyle an inner highlight to an independent radius. Handle its action, update `value`, keep meaningful choice labels, and preserve every enabled native button in sequential Tab order.
196
201
  10. Compose `AppTab` inside controlled `TabBar`; call `wireTabBars()` once and retain its disposer. It owns same-bar drag mechanics, including proximity-based horizontal edge autoscroll, while the app applies `onReorder` and owns order, selection, panels, close policy, routing, and persistence. For a tab-local action followed by a separately pinned workspace action, set `trailingPlacement="adjacent"`, put the local action in `trailing`, and the workspace action in `end`; TabBar owns the shrinking/scrolling tabs and fixed action geometry, so do not add descendant flex overrides. Arrow/Home/End select on move by default and restore focus by bar/tab identity when controlled activation replaces the strip; pass `activation: 'manual'` (or `TabBar activation="manual"` per strip) so arrow keys move focus only and the user selects with Enter/Space/click — use it when selecting a tab is a heavy action. Use runtime-filtered `rootAttributes` for domain metadata and keep an optional `closeIcon` decorative and noninteractive.
197
- 11. Use token-controlled `TokenSearchField` when free text and removable structured filters share one editor. Editable text stays DOM-owned between token changes; to replace the text programmatically (reseeding a persistent dialog's field on reopen, applying a saved search) change the field's `revision` along with `query`, never re-key a wrapper. The leading icon, first text line, clear action, and trailing slot share one fixed row when content wraps. For automatic parsing, chips, suggestions, and evaluation, use createTokenSearchModel with grammar rules, pass it as TokenSearchField.model, and register it in wireTokenSearchFields models; otherwise the app owns parsing and suggestions; call `readTokenSearchField()` on input, empty `textContent` on clear, use `placeTokenSearchCaret()` after explicit controlled focus changes, and call `wireTokenSearchFields()` once so Enter submits without inserting a line break and keyboard chip deletion restores focus plus the text-relative caret after controlled replacement. `clearIcon` replaces the clear action's glyph (its `clearLabel` still names it). Enable `collapsible` for an animated iconic closed state, standalone or inside `ToolbarControlGroup`; the field keeps text or tokens expanded, and `wireTokenSearchFields()` manages the transient expand/collapse/focus by default (activate to reveal + focus, Escape or empty blur to collapse). Bind the field's `expanded` to the returned handle's `expanded(id)` signal or adopt your own via `collapsible.signals`; opt a behavior out only when the app must own it. Do not hand-roll the open handler, the focusout collapse, a clear-button mousedown guard, or reopening after controlled clear or Select All deletion — the helper keeps the replacement editor open and focused. Clear and deletion restoration finish at the replacement mutation checkpoint before the next input task, so shortcut-letter typing cannot escape to the page and delayed animation frames cannot overwrite a later selection. Persist both query and tokens returned by the DOM read. For real-app adoption it also provides a focusout keep-open exception (`data-token-search-keep-open` regions or `collapsible.keepOpenOn(target)`, so a sibling suggestions/date/help surface does not collapse an empty field), opt-in atomic-chip keyboard (`keyboard`: Backspace/Delete remove the adjacent chip via `onRemoveToken`, ArrowRight moves the caret past a trailing chip), and an `onEdit({id, editor, event})` input callback (the `InputEvent` lets you gate on `inputType`/`data`) — reach for these instead of re-adding hand-rolled keydown/input handlers around the field.
202
+ 11. Use token-controlled `TokenSearchField` when free text and removable structured filters share one editor. Editable text stays DOM-owned between token changes; to replace the text programmatically (reseeding a persistent dialog's field on reopen, applying a saved search) change the field's `revision` along with `query` for an unmanaged field, or call `model.replace({ query, tokens })` for a model-managed field; never re-key a wrapper. The leading icon, first text line, clear action, and trailing slot share one fixed row when content wraps. For automatic parsing, chips, suggestions, and evaluation, use createTokenSearchModel with grammar rules, pass it as TokenSearchField.model, and register it in wireTokenSearchFields models; a rule's `suggest(input, state)` receives committed tokens so it can exclude selected values. Otherwise the app owns parsing and suggestions; call `readTokenSearchField()` on input, empty `textContent` on clear, use `placeTokenSearchCaret()` after explicit controlled focus changes, and call `wireTokenSearchFields()` once so Enter submits without inserting a line break and keyboard chip deletion restores focus plus the text-relative caret after controlled replacement. `clearIcon` replaces the clear action's glyph (its `clearLabel` still names it). Enable `collapsible` for an animated iconic closed state, standalone or inside `ToolbarControlGroup`; the field keeps text or tokens expanded, and `wireTokenSearchFields()` manages the transient expand/collapse/focus by default (activate to reveal + focus, Escape or empty blur to collapse). Bind the field's `expanded` to the returned handle's `expanded(id)` signal or adopt your own via `collapsible.signals`; opt a behavior out only when the app must own it. Do not hand-roll the open handler, the focusout collapse, a clear-button mousedown guard, or reopening after controlled clear or Select All deletion — the helper keeps the replacement editor open and focused. Clear and deletion restoration finish at the replacement mutation checkpoint before the next input task, so shortcut-letter typing cannot escape to the page and delayed animation frames cannot overwrite a later selection. Persist both query and tokens returned by the DOM read. For real-app adoption it also provides a focusout keep-open exception (`data-token-search-keep-open` regions or `collapsible.keepOpenOn(target)`, so a sibling suggestions/date/help surface does not collapse an empty field), opt-in atomic-chip keyboard (`keyboard`: Backspace/Delete remove the adjacent chip via `onRemoveToken`, ArrowRight moves the caret past a trailing chip), and an `onEdit({id, editor, event})` input callback (the `InputEvent` lets you gate on `inputType`/`data`) — reach for these instead of re-adding hand-rolled keydown/input handlers around the field.
203
+ An application helper can call `model.commit(value)` for the active `name:` prefix when it computes a valid value outside suggestions; invalid values and missing prefixes leave the query unchanged.
198
204
  12. Demo work uses public production component subpaths and their browser-selected CSS. Focused demos and recipes have no local stylesheet, inline style, or styling-only class; use public components and `CatalogExample.viewport` for unavoidable specimen constraints (a recipe declares its frame through its exported `presentation`). When a recipe needs a capability no component offers, report the component gap instead of adding CSS. Use exactly three demo kinds: a `component` is one component with variants/states, a `composition` is a focused container of components commonly used together, and a `recipe` is the recommended production approach to a task. Organize catalog routes into product-important functional groups; within each group put all components before compositions, order each kind by importance with display-name alphabetical tie-breaking, and put recipes after every component/composition group. Show `Composition` as an entry tag instead of repeating the word in its name. Give every public visual component its own category-grouped catalog route; list themed third-party components under a clearly labeled collapsible ecosystem section, with a focused route for each. For the complete taxonomy, focused/composition decision, `CatalogExample` / `CatalogExampleStack` row/group nesting, exact specimen selection, geometry-overlay legend and exclusions, skip-marker behavior, and metadata ownership, follow the single [Catalog demo authoring contract](../docs/catalog.md#catalog-demo-authoring-contract), discovered machine-readably through [`catalog-authoring.json`](./catalog-authoring.json). Never infer structure from private `kui-catalog-*` classes. Project each component's deterministic repository-relative demo source and existing documentation path so the detail can expose `View demo source` and `Read guidance` links without a runtime export; also derive first-party component implementation paths from their canonical browser imports, and label Web Awesome documentation as Kerf integration guidance. Declare direct `uses` relationships so `Used by` stays derivable, and theme shell chrome through the same semantic tokens as the stage instead of drawing a substitute. Enable `wireCatalog({ revealSelection: true })` for long desktop sidebars so controlled selections remain visible without moving focus; keep its default compact media guard unless compact scrolling is an explicit product behavior, and use `revealCatalogEntry` for an initial deep link.
199
205
  13. The Web Awesome theme makes Tooltip and Popover arrowless by default. Keep that default unless a pointer materially clarifies the anchor; opt back in with `--wa-tooltip-arrow-size`, `--kui-wa-popover-arrow-size`, or a popover's public `--arrow-size`, and use `without-arrow` when local no-arrow intent should survive theme changes. Its non-field chrome uses `--kui-wa-control-inset` (8px controls/items), `--kui-wa-surface-margin` / `--kui-wa-surface-inset` (8px around/inside Accordion, Card, Details, Callout, and Include), and `--kui-wa-container-inset` (16px Tab Panel content and framed disclosure regions). Plain Details use the 8px surface inset on the trigger and keep the body flush; plain Accordion items use it on both trigger and body. Outlined and sunken Details use the 16px container inset on the trigger and 8px on the body; framed Accordion items use 16px on both. Dialog maps its body to the 8px surface tier and its footer to the 16px container tier independently of `--spacing`. Override those tiers instead of restyling individual parts. Filled badges use each variant's quiet fill with normal text so their compact copy stays WCAG-AA readable; override the pair with `--kui-wa-badge-filled-background` / `--kui-wa-badge-filled-foreground`, not host selectors. When a dialog provides another dismissal affordance, put `hide-actions` on the `wa-dialog` host to hide its directly exported `header-actions` part; never chain `::part()` selectors through internal parts. Checkbox and Radio Group option regions, the Color Picker trigger, and Slider's complete interactive region receive the shared 8px logical inline outer inset because those controls have no bordered field shell. Known Date field captions and bordered text-like field hints align with values at the 9px border-plus-padding inset. OTP Input's label uses the same uppercase xs/650 treatment as other field labels, and both its label and hint use that 9px inset.
200
206
  14. Treat the complete Web Awesome catalog as support coverage, not a recommendation list. Its UX sidebar marks superseded and exceptional entries `Discouraged`. Consider Popup when it replaces custom anchored positioning. Prefer Kerf `Select` over direct Dropdown/Dropdown Item/Select/Option composition, `SegmentedControl` over Button Group, `TabBar` or `SegmentedControl` over Web Awesome Tabs, `LucideIcon` over Web Awesome Icon, and `ResizableRegion` over Split Panel. Use Tree/Tree Item, Animated Image, and Comparison only for a specific required behavior; avoid Zoomable Frame. Never render a `Discouraged` element directly in application, demo, or recipe markup; reach it only through the Kerf component that wraps it (`PopupMenu` renders `wa-dropdown`, `Select` renders `wa-select` / `wa-option`), and treat a Kerf component gap as a request to file, not a reason to drop to the raw element.
@@ -214,12 +220,20 @@ tokens; plain text ellipsizes in a narrow trigger.
214
220
 
215
221
  For application tabs, `AppTab presentation="icon-only"` retains its accessible `name`, `labelMaxWidth` truncates the visible name, and `attention` colors it through `--kui-app-tab-attention-color`. Configure TabBar strip geometry through public `--kui-tab-bar-strip-*` tokens.
216
222
 
223
+ Set `AppTab dropTarget` while content is dragged over a tab to highlight the target without changing selection. Use `nameOverflow="visible"` for an inline loading treatment that needs the full visible name; the default is an ellipsis.
224
+
225
+ Set `pinned` on the first `AppTab` when it must stay visible while peers scroll. Keep it inside `TabBar` children so it remains in the tablist and roving focus order. Use `--kui-app-tab-pinned-background` for a non-default surrounding surface; the pinned backdrop must cover tabs beneath it.
226
+
217
227
  Use `--kui-resizable-region-background` for a region surface and `contentOverflow="visible"` while its anchored popup needs to escape. Choose a top or bottom `restorePosition`, typed `restoreInset`, or `restorePlacement="inline"` for its collapsed restore control. `FloatingToolbar placement="inline"` stays in normal flow; its per-edge inset tokens and `safeAreaInsets` configure floating placement.
218
228
 
219
229
  Use `ListItem density="spacious"` for larger option rows, `multiline` plus `multilineIconAlign="center"` when its icon should center on wrapped copy, `divider` for row separators, and `state="drag-target"` for the drop target treatment. Public `--kui-list-item-*` tokens adjust row, icon, label, and trailing geometry and color; ListHeader height, title padding, and border tokens adjust section density.
220
230
 
231
+ For a filled command list, scope `--kui-list-item-background`, `--kui-list-item-border`, `--kui-list-item-hover-border`, and `--kui-list-item-selected-border` at the List or ListItem boundary. Keep global neutral and brand border colors semantic.
232
+
221
233
  Use `Toolbar responsive="trailing-priority"` when an expanded trailing search needs a full second row below its heading at `responsiveAt`. Configure a leading minimum width, trailing gap and justification, or zone inline padding with the public `--kui-toolbar-*` tokens rather than selectors into toolbar zones.
222
234
 
235
+ Set `--kui-toolbar-inset: 0px` on an embedded Toolbar to remove its outer padding while retaining `--kui-toolbar-gap` between zones. The same inset token controls the minimum-height allowance; safe-area padding still applies at claimed edges.
236
+
223
237
  For compact dialog copy, use `Text flush lineHeight="tight"`; for compact metadata, use `ValueTable density="compact"` and its public row columns/padding/gap tokens. `ToolbarText size="xsmall"` fits a dense rail heading. A `TokenSearchField` editor shrinks inside a narrow group by default; set `--kui-token-search-editor-min-width` when a minimum is needed. A full-height shell uses the one `.kui-app-root` mount container documented in `docs/document-baseline.md`.
224
238
 
225
239
  Common mistakes:
@@ -264,7 +278,11 @@ Common mistakes:
264
278
 
265
279
  For prominent content text, use `Text size="large"`; use `size="xlarge"` for display copy. Both sizes work with semantic `variant`, `tone`, and `font`, so keep heading levels based on the document outline.
266
280
 
267
- For nested action menus, use `PopupMenuItem.submenu` and its `checked`, `icon`, `details`, `disabledReason`, and `tone` options. The app owns choice state. For a right-click menu, use `PopupMenu` with `context: true` and call `openPopupMenuAt` from the app's `contextmenu` handler; the package positions and opens the menu. Call `closePopupMenu` for programmatic dismissal.
281
+ For removable tags use `Chip`, with `removeAction` for delegated handling and a specific `removeLabel` for the native button. `itemId` identifies the tag; the app owns removal. `size="compact"` and `disabled` replace app styling of raw `wa-tag` internals. Use `Badge` for non-interactive metadata.
282
+
283
+ For `Select`, mark an unavailable choice with `disabled` and optionally `disabledReason`. In a multiple Select, `selectAllLabel` and `clearLabel` opt in to localized footer actions that select enabled choices or clear the selection through normal input/change events; the app still owns the controlled `value`.
284
+
285
+ For nested action menus, use `PopupMenuItem.submenu` with item, heading, and divider entries; headings and dividers do not enter keyboard navigation. Items support `checked`, `icon`, `details`, `disabledReason`, and `tone`. The app owns choice state. For a right-click menu, use `PopupMenu` with `context: true` and call `openPopupMenuAt` from the app's `contextmenu` handler; the package positions and opens the menu. Call `closePopupMenu` for programmatic dismissal.
268
286
 
269
287
  ## Select lifecycle ownership
270
288
 
@@ -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.60` 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.61` 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/app-tab.d.ts CHANGED
@@ -9,15 +9,23 @@ type AppTabRootAttributes = Readonly<Record<`data-${string}`, string | undefined
9
9
  'data-tab-dragging'?: never;
10
10
  'data-tab-drop-position'?: never;
11
11
  'data-attention'?: never;
12
+ 'data-drop-target'?: never;
13
+ 'data-name-overflow'?: never;
14
+ 'data-pinned'?: never;
12
15
  }>;
13
16
  type AppTabPresentation = 'pill' | 'segmented' | 'icon-only';
14
17
  type AppTabSize = 'default' | 'compact';
18
+ type AppTabNameOverflow = 'ellipsis' | 'visible';
15
19
  interface AppTabProps {
16
20
  id: string;
17
21
  name: string;
18
22
  selected?: boolean;
19
23
  /** Emphasize the visible tab name with the attention color token. */
20
24
  attention?: boolean;
25
+ /** Highlight this tab as the target of a drag over its content. */
26
+ dropTarget?: boolean;
27
+ /** Keep the leading tab visible within its TabBar tablist while peers scroll. */
28
+ pinned?: boolean;
21
29
  closable?: boolean;
22
30
  draggable?: boolean;
23
31
  leading?: KerfUiContent;
@@ -28,6 +36,8 @@ interface AppTabProps {
28
36
  size?: AppTabSize;
29
37
  /** Maximum visible label width in CSS pixels before ellipsis. */
30
38
  labelMaxWidth?: number;
39
+ /** Keep the full name visible for an inline loading treatment. */
40
+ nameOverflow?: AppTabNameOverflow;
31
41
  /** Decorative dormant content for the close button. Must not contain interactive descendants. */
32
42
  closeIcon?: SafeHtml;
33
43
  selectAction?: string;
@@ -50,6 +60,6 @@ interface AppTabProps {
50
60
  /** Native named-slot assignment when composed inside a web component. */
51
61
  slot?: string;
52
62
  }
53
- declare function AppTab({ id, name, selected, attention, closable, draggable, leading, trailing, presentation, size, labelMaxWidth, closeIcon, selectAction, closeAction, className, placeholder, pending, rootAttributes, slot, }: AppTabProps): SafeHtml;
63
+ declare function AppTab({ id, name, selected, attention, dropTarget, pinned, closable, draggable, leading, trailing, presentation, size, labelMaxWidth, nameOverflow, closeIcon, selectAction, closeAction, className, placeholder, pending, rootAttributes, slot, }: AppTabProps): SafeHtml;
54
64
 
55
- export { AppTab, type AppTabPresentation, type AppTabProps, type AppTabSize };
65
+ export { AppTab, type AppTabNameOverflow, type AppTabPresentation, type AppTabProps, type AppTabSize };
package/dist/app-tab.js CHANGED
@@ -1,4 +1,4 @@
1
- export { AppTab } from './chunk-T66UNBXL.js';
1
+ export { AppTab } from './chunk-Q6YU3BT7.js';
2
2
 
3
3
 
4
4
 
@@ -0,0 +1,3 @@
1
+ import '../styles/foundation.css';
2
+ import '../styles/chip.css';
3
+ export * from '../chip.js';
package/dist/catalog.js CHANGED
@@ -1,25 +1,25 @@
1
- import { Workbench } from './chunk-2OXQHM7I.js';
1
+ import { Workbench } from './chunk-Y74NWGQW.js';
2
2
 
3
- import { PopupMenu } from './chunk-UWONG4QE.js';
3
+ import { PopupMenu } from './chunk-VCBTX62E.js';
4
4
 
5
5
  import { Row } from './chunk-VZOFZPSO.js';
6
+ import { ListHeader } from './chunk-5Q3N6EV7.js';
7
+ import { Text } from './chunk-AUKT3KMG.js';
6
8
  import { ListInsetText } from './chunk-DG6G5EPF.js';
7
- import { ListItem } from './chunk-5I7OHCIP.js';
9
+ import { ListItem } from './chunk-SWVW56CV.js';
8
10
  import { List } from './chunk-NAPE7WUS.js';
9
11
 
10
12
  import { ToolbarText } from './chunk-3SXMEK3B.js';
11
13
 
12
14
 
13
15
 
14
- import { ListHeader } from './chunk-5Q3N6EV7.js';
15
- import { Text } from './chunk-AUKT3KMG.js';
16
+
16
17
 
17
18
 
18
19
 
19
20
 
20
21
  import { ToolbarControlGroup, ToolbarActionLink } from './chunk-7JUBXOIV.js';
21
22
  import { Toolbar } from './chunk-MERWRTBG.js';
22
-
23
23
  import { LucideIcon } from './chunk-4R777DUZ.js';
24
24
  import { filterDataAttributes } from './chunk-SRSJO5QE.js';
25
25
 
package/dist/chip.d.ts ADDED
@@ -0,0 +1,29 @@
1
+ import { SafeHtml } from 'kerfjs';
2
+ import { BadgeTone, BadgeAppearance, BadgeShape, BadgeSize } from './badge.js';
3
+
4
+ interface ChipCommonProps {
5
+ /** Visible, non-interactive chip content. */
6
+ children: SafeHtml | string | number;
7
+ tone?: BadgeTone;
8
+ appearance?: BadgeAppearance;
9
+ shape?: BadgeShape;
10
+ size?: BadgeSize;
11
+ disabled?: boolean;
12
+ /** Record identifier available to an application delegated action handler. */
13
+ itemId?: string;
14
+ className?: string;
15
+ /** Native named-slot assignment when composed inside a web component. */
16
+ slot?: string;
17
+ }
18
+ /** A removable chip needs both a delegated action and a specific accessible name. */
19
+ type ChipProps = ChipCommonProps & ({
20
+ removeAction: string;
21
+ removeLabel: string;
22
+ } | {
23
+ removeAction?: never;
24
+ removeLabel?: never;
25
+ });
26
+ /** A short label with an optional native remove button. The application owns removal. */
27
+ declare function Chip({ children, tone, appearance, shape, size, disabled, itemId, className, slot, ...remove }: ChipProps): SafeHtml;
28
+
29
+ export { Chip, type ChipProps };
package/dist/chip.js ADDED
@@ -0,0 +1,3 @@
1
+ export { Chip } from './chunk-EAC4CDY7.js';
2
+
3
+ //# sourceMappingURL=chip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"chip.js"}
@@ -54,23 +54,27 @@ function createTokenSearchModel({
54
54
  const suggestions = signal([]);
55
55
  const result = signal(evaluate?.(state.value));
56
56
  let activeStart;
57
+ let activeRule;
57
58
  const refreshSuggestions = () => {
58
59
  const match = activePattern?.exec(state.value.query);
59
60
  const raw = match?.[1];
60
61
  const separator = raw?.indexOf(":") ?? -1;
61
62
  const rule = separator < 0 ? void 0 : byName.get(raw.slice(0, separator).toLowerCase());
63
+ activeRule = rule;
62
64
  const input = separator < 0 ? "" : unquote(raw.slice(separator + 1));
63
65
  activeStart = match && raw ? match.index + match[0].lastIndexOf(raw) : void 0;
64
- suggestions.value = (rule?.suggest?.(input) ?? []).flatMap((candidate) => {
65
- const value = typeof candidate === "string" ? candidate : candidate.value;
66
- const token = resolve(`${rule.name}:${quote(value)}`, 0);
67
- return token ? [
68
- {
69
- value: token.value,
70
- label: typeof candidate === "string" ? token.label : candidate.label
71
- }
72
- ] : [];
73
- });
66
+ suggestions.value = (rule?.suggest?.(input, state.value) ?? []).flatMap(
67
+ (candidate) => {
68
+ const value = typeof candidate === "string" ? candidate : candidate.value;
69
+ const token = resolve(`${rule.name}:${quote(value)}`, 0);
70
+ return token ? [
71
+ {
72
+ value: token.value,
73
+ label: typeof candidate === "string" ? token.label : candidate.label
74
+ }
75
+ ] : [];
76
+ }
77
+ );
74
78
  };
75
79
  const publish = (next) => {
76
80
  state.value = next;
@@ -78,7 +82,7 @@ function createTokenSearchModel({
78
82
  refreshSuggestions();
79
83
  };
80
84
  refreshSuggestions();
81
- const edit = (value, commit = false) => {
85
+ const edit = (value, commit2 = false) => {
82
86
  let query = "";
83
87
  let cursor = 0;
84
88
  const added = [];
@@ -87,7 +91,7 @@ function createTokenSearchModel({
87
91
  const raw = match[1];
88
92
  const start = match.index + match[0].lastIndexOf(raw);
89
93
  const end = start + raw.length;
90
- if (end === value.query.length && !commit && !/\s$/.test(value.query))
94
+ if (end === value.query.length && !commit2 && !/\s$/.test(value.query))
91
95
  continue;
92
96
  const token = resolve(raw, query.length + start - cursor);
93
97
  if (!token) continue;
@@ -118,25 +122,36 @@ function createTokenSearchModel({
118
122
  );
119
123
  publish({ query, tokens });
120
124
  };
121
- const choose = (value) => {
122
- if (!suggestions.value.some((suggestion) => suggestion.value === value) || activeStart === void 0)
123
- return;
124
- const token = resolve(value, activeStart);
125
- if (!token) return;
125
+ const commitResolved = (token) => {
126
+ if (!token || activeStart === void 0) return;
126
127
  const query = state.value.query.slice(0, activeStart);
127
128
  publish({ query, tokens: [...state.value.tokens, token] });
128
129
  };
130
+ const choose = (value) => {
131
+ if (activeStart === void 0 || !suggestions.value.some((suggestion) => suggestion.value === value))
132
+ return;
133
+ commitResolved(resolve(value, activeStart));
134
+ };
135
+ const commit = (value) => {
136
+ if (!activeRule || activeStart === void 0) return;
137
+ commitResolved(resolve(`${activeRule.name}:${quote(value)}`, activeStart));
138
+ };
129
139
  return {
130
140
  state,
131
141
  editorRevision,
132
142
  suggestions,
133
143
  result,
134
144
  edit,
145
+ replace(value) {
146
+ edit(value);
147
+ editorRevision.value++;
148
+ },
135
149
  submit(value) {
136
150
  edit(value, true);
137
151
  onSubmit?.(state.value, result.value);
138
152
  },
139
153
  choose,
154
+ commit,
140
155
  expandToken(value) {
141
156
  const index = state.value.tokens.findIndex(
142
157
  (token) => token.value === value
@@ -184,4 +199,4 @@ function createTokenSearchModel({
184
199
 
185
200
  export { createTokenSearchModel };
186
201
 
187
- //# sourceMappingURL=chunk-F7F7KRO2.js.map
202
+ //# sourceMappingURL=chunk-4SQK27MR.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/token-search-model.ts"],"names":["commit"],"mappings":";;;AA+DA,IAAM,gBAAgB,CAAC,IAAA,KACrB,IAAA,CAAK,OAAA,CAAQ,uBAAuB,MAAM,CAAA;AAC5C,IAAM,QAAQ,CAAC,IAAA,KACb,WAAA,CAAY,IAAA,CAAK,IAAI,CAAA,GACjB,CAAA,CAAA,EAAI,IAAA,CAAK,UAAA,CAAW,MAAM,MAAM,CAAA,CAAE,WAAW,GAAA,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zC,EAAA,KAAO,KAAA,GACH,EAAC,GACD;AAAA,YACE;AAAA,cACE,GAAG,KAAA;AAAA,cACH,SACG,KAAA,CAAM,MAAA,IAAU,MAAM,EAAA,GAAK,KAAA,GAAQ,UAAU,MAAA,GAAS,CAAA;AAAA;AAC3D;AACF;AACN,OACD,CAAA;AAAA,IACH,CAAA;AAAA,IACA,OAAO,KAAA,EAAO;AACZ,MAAA,MAAM,KAAA,GAAQ,KAAA,CAAM,KAAA,CAAM,MAAA,CAAO,SAAA;AAAA,QAC/B,CAAC,KAAA,KAAU,KAAA,CAAM,KAAA,KAAU;AAAA,OAC7B;AACA,MAAA,IAAI,QAAQ,CAAA,EAAG;AACf,MAAA,OAAA,CAAQ;AAAA,QACN,GAAG,KAAA,CAAM,KAAA;AAAA,QACT,MAAA,EAAQ,MAAM,KAAA,CAAM,MAAA,CAAO,OAAO,CAAC,CAAA,EAAG,EAAA,KAAO,EAAA,KAAO,KAAK;AAAA,OAC1D,CAAA;AAAA,IACH,CAAA;AAAA,IACA,KAAA,GAAQ;AACN,MAAA,OAAA,CAAQ,EAAE,KAAA,EAAO,EAAA,EAAI,MAAA,EAAQ,IAAI,CAAA;AACjC,MAAA,cAAA,CAAe,KAAA,EAAA;AAAA,IACjB,CAAA;AAAA,IACA,OAAA,GAAU;AACR,MAAA,WAAA,CAAY,QAAQ,EAAC;AAAA,IACvB;AAAA,GACF;AACF","file":"chunk-4SQK27MR.js","sourcesContent":["import { type Signal, signal } from 'kerfjs';\n\nimport type {\n TokenSearchFieldValue,\n TokenSearchToken,\n} from './token-search-field.js';\n\nexport interface TokenSearchRule {\n /** The word before `:` (for example `tag` or `status`). */\n name: string;\n /** Return a canonical value, or undefined to leave invalid input as text. */\n parse?: (input: string) => string | undefined;\n /** Label for a committed chip. Defaults to `name:input`. */\n label?: (value: string, input: string) => string;\n /** Suggestions for the unfinished value after `name:`, with current committed tokens. */\n suggest?: (\n input: string,\n state: TokenSearchState,\n ) => readonly (string | { value: string; label: string })[];\n}\n\nexport interface TokenSearchResolvedToken extends TokenSearchToken {\n kind: string;\n parsedValue: string;\n}\n\nexport interface TokenSearchState {\n query: string;\n tokens: TokenSearchResolvedToken[];\n}\n\nexport interface TokenSearchSuggestion {\n value: string;\n label: string;\n}\n\nexport interface TokenSearchModel<Result = unknown> {\n state: Signal<TokenSearchState>;\n /** Changes when a model action must replace DOM-owned editor text. */\n editorRevision: Signal<number>;\n suggestions: Signal<readonly TokenSearchSuggestion[]>;\n result: Signal<Result | undefined>;\n edit(value: TokenSearchFieldValue, commit?: boolean): void;\n /** Replace app-owned search state and rebuild the DOM-owned editor text. */\n replace(value: TokenSearchFieldValue): void;\n submit(value: TokenSearchFieldValue): void;\n choose(value: string): void;\n /** Commit a value for the active `name:` prefix, even when it is not suggested. */\n commit(value: string): void;\n expandToken(value: string): void;\n remove(value: string): void;\n clear(): void;\n dismiss(): void;\n}\n\nexport interface TokenSearchModelOptions<Result> {\n rules?: readonly TokenSearchRule[];\n initial?: TokenSearchFieldValue;\n /** Runs after every state change, including initial state. */\n evaluate?: (state: TokenSearchState) => Result;\n onSubmit?: (state: TokenSearchState, result: Result | undefined) => void;\n}\n\nconst escapePattern = (text: string) =>\n text.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\nconst quote = (text: string) =>\n /[\\s()\"\\\\]/.test(text)\n ? `\"${text.replaceAll('\\\\', '\\\\\\\\').replaceAll('\"', '\\\\\"')}\"`\n : text;\nconst unquote = (text: string) =>\n text.startsWith('\"') && text.endsWith('\"')\n ? text.slice(1, -1).replace(/\\\\([\"\\\\])/g, '$1')\n : text;\n\n/** Opt-in state, token parsing, suggestions, and evaluation for TokenSearchField. */\nexport function createTokenSearchModel<Result = unknown>({\n rules = [],\n initial = { query: '', tokens: [] },\n evaluate,\n onSubmit,\n}: TokenSearchModelOptions<Result> = {}): TokenSearchModel<Result> {\n const byName = new Map(rules.map((rule) => [rule.name.toLowerCase(), rule]));\n if (\n byName.size !== rules.length ||\n rules.some((rule) => !/^[\\w-]+$/.test(rule.name))\n )\n throw new Error('Token search rule names must be unique words');\n const names = [...byName.keys()].map(escapePattern).join('|');\n const pattern = names\n ? new RegExp(\n `(?:^|[\\\\s(])((?:${names}):(?:\"(?:\\\\\\\\.|[^\"])*\"|[^\"\\\\s()][^\\\\s()]*))(?=$|[\\\\s)])`,\n 'gi',\n )\n : undefined;\n const activePattern = names\n ? new RegExp(\n `(?:^|[\\\\s(])((?:${names}):(?:\"(?:\\\\\\\\.|[^\"])*|[^\\\\s()]*))$`,\n 'i',\n )\n : undefined;\n\n const resolve = (\n raw: string,\n offset: number,\n ): TokenSearchResolvedToken | undefined => {\n const separator = raw.indexOf(':');\n const kind = raw.slice(0, separator).toLowerCase();\n const rule = byName.get(kind);\n if (!rule || separator < 0) return;\n const input = unquote(raw.slice(separator + 1));\n if (!input) return;\n const parsedValue = rule.parse ? rule.parse(input) : input;\n if (parsedValue === undefined) return;\n return {\n kind,\n parsedValue,\n value: `${kind}:${quote(input)}`,\n label: rule.label?.(parsedValue, input) ?? `${kind}:${input}`,\n offset,\n };\n };\n\n const rehydrate = (\n token: TokenSearchToken,\n ): TokenSearchResolvedToken | undefined => {\n const resolved = resolve(token.value, token.offset ?? 0);\n return resolved ? { ...resolved, ...token } : undefined;\n };\n\n const state = signal<TokenSearchState>({\n query: initial.query,\n tokens: initial.tokens.flatMap((token) => {\n const resolved = rehydrate(token);\n return resolved ? [resolved] : [];\n }),\n });\n const editorRevision = signal(0);\n const suggestions = signal<readonly TokenSearchSuggestion[]>([]);\n const result = signal<Result | undefined>(evaluate?.(state.value));\n let activeStart: number | undefined;\n let activeRule: TokenSearchRule | undefined;\n\n const refreshSuggestions = () => {\n const match = activePattern?.exec(state.value.query);\n const raw = match?.[1];\n const separator = raw?.indexOf(':') ?? -1;\n const rule =\n separator < 0\n ? undefined\n : byName.get(raw!.slice(0, separator).toLowerCase());\n activeRule = rule;\n const input = separator < 0 ? '' : unquote(raw!.slice(separator + 1));\n activeStart =\n match && raw ? match.index + match[0].lastIndexOf(raw) : undefined;\n suggestions.value = (rule?.suggest?.(input, state.value) ?? []).flatMap(\n (candidate) => {\n const value =\n typeof candidate === 'string' ? candidate : candidate.value;\n const token = resolve(`${rule!.name}:${quote(value)}`, 0);\n return token\n ? [\n {\n value: token.value,\n label:\n typeof candidate === 'string' ? token.label : candidate.label,\n },\n ]\n : [];\n },\n );\n };\n const publish = (next: TokenSearchState) => {\n state.value = next;\n result.value = evaluate?.(next);\n refreshSuggestions();\n };\n refreshSuggestions();\n\n const edit = (value: TokenSearchFieldValue, commit = false) => {\n let query = '';\n let cursor = 0;\n const added: TokenSearchResolvedToken[] = [];\n const removed: Array<{ start: number; end: number }> = [];\n for (const match of value.query.matchAll(pattern ?? /(?!) /g)) {\n const raw = match[1];\n const start = match.index + match[0].lastIndexOf(raw);\n const end = start + raw.length;\n if (end === value.query.length && !commit && !/\\s$/.test(value.query))\n continue;\n const token = resolve(raw, query.length + start - cursor);\n if (!token) continue;\n query += value.query.slice(cursor, start);\n token.offset = query.length;\n added.push(token);\n removed.push({ start, end });\n cursor = end;\n }\n const suffix = value.query.slice(cursor);\n query += added.length && /^\\s+$/.test(suffix) ? '' : suffix;\n const existing = value.tokens.flatMap((token) => {\n const resolved = rehydrate(token);\n if (!resolved) return [];\n const offset = token.offset ?? value.query.length;\n return [\n {\n ...resolved,\n offset:\n offset -\n removed.reduce(\n (total, range) =>\n total + Math.max(0, Math.min(offset, range.end) - range.start),\n 0,\n ),\n },\n ];\n });\n const tokens = [...existing, ...added].sort(\n (left, right) => (left.offset ?? 0) - (right.offset ?? 0),\n );\n publish({ query, tokens });\n };\n\n const commitResolved = (token: TokenSearchResolvedToken | undefined) => {\n if (!token || activeStart === undefined) return;\n const query = state.value.query.slice(0, activeStart);\n publish({ query, tokens: [...state.value.tokens, token] });\n };\n const choose = (value: string) => {\n if (\n activeStart === undefined ||\n !suggestions.value.some((suggestion) => suggestion.value === value)\n )\n return;\n commitResolved(resolve(value, activeStart));\n };\n const commit = (value: string) => {\n if (!activeRule || activeStart === undefined) return;\n commitResolved(resolve(`${activeRule.name}:${quote(value)}`, activeStart));\n };\n\n return {\n state,\n editorRevision,\n suggestions,\n result,\n edit,\n replace(value) {\n edit(value);\n editorRevision.value++;\n },\n submit(value) {\n edit(value, true);\n onSubmit?.(state.value, result.value);\n },\n choose,\n commit,\n expandToken(value) {\n const index = state.value.tokens.findIndex(\n (token) => token.value === value,\n );\n if (index < 0) return;\n const offset = Math.max(\n 0,\n Math.min(\n state.value.query.length,\n state.value.tokens[index].offset ?? state.value.query.length,\n ),\n );\n const insertion = `${value} `;\n publish({\n query: `${state.value.query.slice(0, offset)}${insertion}${state.value.query.slice(offset)}`,\n tokens: state.value.tokens.flatMap((token, at) =>\n at === index\n ? []\n : [\n {\n ...token,\n offset:\n (token.offset ?? 0) + (at > index ? insertion.length : 0),\n },\n ],\n ),\n });\n },\n remove(value) {\n const index = state.value.tokens.findIndex(\n (token) => token.value === value,\n );\n if (index < 0) return;\n publish({\n ...state.value,\n tokens: state.value.tokens.filter((_, at) => at !== index),\n });\n },\n clear() {\n publish({ query: '', tokens: [] });\n editorRevision.value++;\n },\n dismiss() {\n suggestions.value = [];\n },\n };\n}\n"]}
@@ -37,18 +37,30 @@ function tabsIn(bar) {
37
37
  }
38
38
  function reveal(tab) {
39
39
  tab?.scrollIntoView({ block: "nearest", inline: "nearest" });
40
+ if (tab?.closest("[data-kui-tab-list]")?.querySelector(':scope > .kui-app-tab[data-pinned="true"]'))
41
+ revealInStrip(tab);
40
42
  }
41
43
  function revealInStrip(tab) {
42
44
  const strip = tab.closest("[data-kui-tab-list]");
43
45
  if (!strip || strip.scrollWidth <= strip.clientWidth) return;
44
46
  const bounds = strip.getBoundingClientRect();
45
47
  const box = tab.getBoundingClientRect();
46
- if (box.left < bounds.left) strip.scrollLeft -= bounds.left - box.left;
48
+ const pinned = strip.querySelector(
49
+ ':scope > .kui-app-tab[data-pinned="true"]'
50
+ );
51
+ if (pinned?.contains(tab)) return;
52
+ const pinnedBox = pinned?.getBoundingClientRect();
53
+ if (strip.ownerDocument.defaultView?.getComputedStyle(strip).direction === "rtl") {
54
+ const right = pinnedBox ? Math.min(bounds.right, pinnedBox.left) : bounds.right;
55
+ if (box.right > right) strip.scrollLeft += box.right - right;
56
+ else if (box.left < bounds.left)
57
+ strip.scrollLeft -= Math.min(bounds.left - box.left, right - box.right);
58
+ return;
59
+ }
60
+ const left = pinnedBox ? Math.max(bounds.left, pinnedBox.right) : bounds.left;
61
+ if (box.left < left) strip.scrollLeft -= left - box.left;
47
62
  else if (box.right > bounds.right)
48
- strip.scrollLeft += Math.min(
49
- box.right - bounds.right,
50
- box.left - bounds.left
51
- );
63
+ strip.scrollLeft += Math.min(box.right - bounds.right, box.left - left);
52
64
  }
53
65
  function selectedTabs(root) {
54
66
  const selected = /* @__PURE__ */ new Map();
@@ -328,4 +340,4 @@ function wireTabBars(root, { onReorder, activation = "automatic" }) {
328
340
 
329
341
  export { reorderTabs, wireTabBars };
330
342
 
331
- //# sourceMappingURL=chunk-46263QLK.js.map
343
+ //# sourceMappingURL=chunk-C4OYOKWX.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/wire-tab-bars.ts"],"names":["target"],"mappings":";AAkCA,IAAM,mBAAA,GAAsB,EAAA;AAC5B,IAAM,6BAAA,GAAgC,GAAA;AACtC,IAAM,6BAAA,GAAgC,GAAA;AAE/B,SAAS,WAAA,CACd,KAAA,EACA,KAAA,EACA,QAAA,EACA,UACA,QAAA,EACK;AACL,EAAA,IAAI,QAAA,KAAa,QAAA,EAAU,OAAO,CAAC,GAAG,KAAK,CAAA;AAC3C,EAAA,MAAM,MAAA,GAAS,MAAM,IAAA,CAAK,CAAC,SAAS,KAAA,CAAM,IAAI,MAAM,QAAQ,CAAA;AAC5D,EAAA,IAAI,CAAC,MAAA,IAAU,CAAC,KAAA,CAAM,IAAA,CAAK,CAAC,IAAA,KAAS,KAAA,CAAM,IAAI,CAAA,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AAgB;AACnC,MAAA,IAAI,aAAA,CAAc,aAAA,KAAkB,MAAA,EAAQ,aAAA,CAAc,MAAM,CAAA;AAAA,EACpE,CAAC,CAAA;AACD,EAAA,iBAAA,CAAkB,QAAQ,IAAA,EAAM;AAAA,IAC9B,OAAA,EAAS,IAAA;AAAA,IACT,SAAA,EAAW,IAAA;AAAA,IACX,UAAA,EAAY,IAAA;AAAA,IACZ,eAAA,EAAiB,CAAC,eAAe;AAAA,GAClC,CAAA;AAED,EAAA,OAAO,MAAM;AACX,IAAA,QAAA,GAAW,IAAA;AACX,IAAA,iBAAA,CAAkB,UAAA,EAAW;AAC7B,IAAA,KAAA,EAAM;AACN,IAAA,IAAA,CAAK,mBAAA,CAAoB,aAAa,WAAW,CAAA;AACjD,IAAA,IAAA,CAAK,mBAAA,CAAoB,YAAY,UAAU,CAAA;AAC/C,IAAA,IAAA,CAAK,mBAAA,CAAoB,QAAQ,MAAM,CAAA;AACvC,IAAA,IAAA,CAAK,mBAAA,CAAoB,WAAW,KAAK,CAAA;AACzC,IAAA,IAAA,CAAK,mBAAA,CAAoB,WAAW,SAAS,CAAA;AAC7C,IAAA,IAAA,CAAK,mBAAA,CAAoB,WAAW,SAAS,CAAA;AAAA,EAC/C,CAAA;AACF","file":"chunk-C4OYOKWX.js","sourcesContent":["import type { TabActivation } from './tab-bar.js';\n\nexport type TabReorderSource = 'pointer' | 'keyboard';\nexport type TabDropPosition = 'before' | 'after';\n\nexport interface TabReorder {\n barId: string;\n sourceId: string;\n targetId: string;\n position: TabDropPosition;\n source: TabReorderSource;\n}\n\nexport type { TabActivation } from './tab-bar.js';\n\nexport interface WireTabBarsOptions {\n onReorder: (change: TabReorder) => void;\n /**\n * How arrow / Home / End keys activate tabs (default `'automatic'`):\n * - `'automatic'` moves roving focus **and** selects the focused tab (clicks it).\n * - `'manual'` moves roving focus only; the user selects with Enter / Space / click\n * (the ARIA Tabs manual-activation pattern). Use this when activation is a heavy or\n * side-effecting action (e.g. a tab that loads a project) so arrowing through the\n * strip doesn't trigger it on every tab.\n *\n * A per-bar `data-tab-activation=\"manual\" | \"automatic\"` attribute (see the `TabBar`\n * `activation` prop) overrides this option for that strip.\n */\n activation?: TabActivation;\n}\n\ntype TabRoot = HTMLElement;\ntype TabBarRoot = HTMLElement;\n\nconst AUTO_SCROLL_EDGE_PX = 56;\nconst AUTO_SCROLL_MIN_PX_PER_SECOND = 180;\nconst AUTO_SCROLL_MAX_PX_PER_SECOND = 900;\n\nexport function reorderTabs<T>(\n items: readonly T[],\n getId: (item: T) => string,\n sourceId: string,\n targetId: string,\n position: TabDropPosition,\n): T[] {\n if (sourceId === targetId) return [...items];\n const source = items.find((item) => getId(item) === sourceId);\n if (!source || !items.some((item) => getId(item) === targetId))\n return [...items];\n const remaining = items.filter((item) => getId(item) !== sourceId);\n const targetIndex = remaining.findIndex((item) => getId(item) === targetId);\n remaining.splice(targetIndex + (position === 'after' ? 1 : 0), 0, source);\n return remaining;\n}\n\nfunction tabRoot(target: EventTarget | null): TabRoot | undefined {\n return target instanceof Element\n ? (target.closest<TabRoot>('[data-component=\"app-tab\"]') ?? undefined)\n : undefined;\n}\n\nfunction tabBar(tab: TabRoot): TabBarRoot | undefined {\n return tab.closest<TabBarRoot>('[data-component=\"tab-bar\"]') ?? undefined;\n}\n\nfunction tabId(tab: TabRoot): string | undefined {\n return tab.dataset.tabId || undefined;\n}\n\nfunction barId(bar: TabBarRoot): string | undefined {\n return bar.dataset.tabBarId || undefined;\n}\n\nfunction positionFor(event: DragEvent, tab: TabRoot): TabDropPosition {\n const bounds = tab.getBoundingClientRect();\n return event.clientX < bounds.left + bounds.width / 2 ? 'before' : 'after';\n}\n\nfunction tabsIn(bar: TabBarRoot): HTMLButtonElement[] {\n return [\n ...bar.querySelectorAll<HTMLButtonElement>(\n '[data-kui-tab-list] [role=\"tab\"]',\n ),\n ];\n}\n\nfunction reveal(tab: HTMLElement | null | undefined): void {\n tab?.scrollIntoView({ block: 'nearest', inline: 'nearest' });\n if (\n tab\n ?.closest('[data-kui-tab-list]')\n ?.querySelector(':scope > .kui-app-tab[data-pinned=\"true\"]')\n )\n revealInStrip(tab);\n}\n\n/**\n * Scroll a tab's own strip, and nothing else, so the tab is fully visible.\n * Used for selection changes the application makes without focus (adding and\n * selecting a tab): unlike `scrollIntoView`, it never scrolls the page to a\n * bar that is out of view.\n */\nfunction revealInStrip(tab: HTMLElement): void {\n const strip = tab.closest<HTMLElement>('[data-kui-tab-list]');\n if (!strip || strip.scrollWidth <= strip.clientWidth) return;\n const bounds = strip.getBoundingClientRect();\n const box = tab.getBoundingClientRect();\n const pinned = strip.querySelector<HTMLElement>(\n ':scope > .kui-app-tab[data-pinned=\"true\"]',\n );\n if (pinned?.contains(tab)) return;\n const pinnedBox = pinned?.getBoundingClientRect();\n if (\n strip.ownerDocument.defaultView?.getComputedStyle(strip).direction === 'rtl'\n ) {\n const right = pinnedBox\n ? Math.min(bounds.right, pinnedBox.left)\n : bounds.right;\n if (box.right > right) strip.scrollLeft += box.right - right;\n else if (box.left < bounds.left)\n strip.scrollLeft -= Math.min(bounds.left - box.left, right - box.right);\n return;\n }\n const left = pinnedBox ? Math.max(bounds.left, pinnedBox.right) : bounds.left;\n if (box.left < left) strip.scrollLeft -= left - box.left;\n else if (box.right > bounds.right)\n strip.scrollLeft += Math.min(box.right - bounds.right, box.left - left);\n}\n\n/** The selected tab button of every bar below root, keyed by bar. */\nfunction selectedTabs(root: HTMLElement | Document) {\n const selected = new Map<TabBarRoot, HTMLElement>();\n root\n .querySelectorAll<HTMLElement>(\n '[data-kui-tab-list] [role=\"tab\"][aria-selected=\"true\"]',\n )\n .forEach((button) => {\n const tab = tabRoot(button);\n const bar = tab && tabBar(tab);\n if (bar && !selected.has(bar)) selected.set(bar, button);\n });\n return selected;\n}\n\n/** Wire reordering and keyboard navigation while leaving controlled state in the application. */\nexport function wireTabBars(\n root: HTMLElement | Document,\n { onReorder, activation = 'automatic' }: WireTabBarsOptions,\n): () => void {\n const ownerDocument = (\n root.nodeType === 9 ? (root as Document) : root.ownerDocument\n )!;\n const view = ownerDocument.defaultView!;\n let autoScroll:\n | {\n strip: HTMLElement;\n velocity: number;\n frame: number | undefined;\n previousTime: number | undefined;\n }\n | undefined;\n const stopAutoScroll = () => {\n if (!autoScroll) return;\n if (autoScroll.frame !== undefined)\n view.cancelAnimationFrame(autoScroll.frame);\n delete autoScroll.strip.dataset.tabAutoscroll;\n autoScroll = undefined;\n };\n const runAutoScroll = (time: number) => {\n const current = autoScroll;\n if (!current) return;\n current.frame = undefined;\n const elapsed =\n current.previousTime === undefined\n ? 1000 / 60\n : Math.min(40, Math.max(1, time - current.previousTime));\n current.previousTime = time;\n const maximum = Math.max(\n 0,\n current.strip.scrollWidth - current.strip.clientWidth,\n );\n const previous = current.strip.scrollLeft;\n current.strip.scrollLeft = Math.max(\n 0,\n Math.min(maximum, previous + (current.velocity * elapsed) / 1000),\n );\n if (current.strip.scrollLeft === previous) {\n stopAutoScroll();\n return;\n }\n current.frame = view.requestAnimationFrame(runAutoScroll);\n };\n const updateAutoScroll = (event: DragEvent, strip: HTMLElement) => {\n if (strip.scrollWidth <= strip.clientWidth) {\n stopAutoScroll();\n return;\n }\n const bounds = strip.getBoundingClientRect();\n const edge = Math.min(AUTO_SCROLL_EDGE_PX, bounds.width / 3);\n const startDistance = event.clientX - bounds.left;\n const endDistance = bounds.right - event.clientX;\n let direction = 0;\n let strength = 0;\n if (startDistance >= 0 && startDistance < edge) {\n direction = -1;\n strength = 1 - startDistance / edge;\n } else if (endDistance >= 0 && endDistance < edge) {\n direction = 1;\n strength = 1 - endDistance / edge;\n }\n if (direction === 0) {\n stopAutoScroll();\n return;\n }\n const maximum = Math.max(0, strip.scrollWidth - strip.clientWidth);\n if (\n (direction < 0 && strip.scrollLeft <= 0) ||\n (direction > 0 && strip.scrollLeft >= maximum)\n ) {\n stopAutoScroll();\n return;\n }\n const speed =\n AUTO_SCROLL_MIN_PX_PER_SECOND +\n (AUTO_SCROLL_MAX_PX_PER_SECOND - AUTO_SCROLL_MIN_PX_PER_SECOND) *\n strength *\n strength;\n if (autoScroll?.strip !== strip) stopAutoScroll();\n autoScroll ??= {\n strip,\n velocity: 0,\n frame: undefined,\n previousTime: undefined,\n };\n autoScroll.velocity = direction * speed;\n strip.dataset.tabAutoscroll = direction < 0 ? 'start' : 'end';\n autoScroll.frame ??= view.requestAnimationFrame(runAutoScroll);\n };\n let dragged: { barId: string; tabId: string } | undefined;\n const clearDropPositions = () =>\n root\n .querySelectorAll<HTMLElement>('[data-tab-drop-position]')\n .forEach((tab) => delete tab.dataset.tabDropPosition);\n const clear = () => {\n stopAutoScroll();\n dragged = undefined;\n root\n .querySelectorAll<HTMLElement>(\n '[data-tab-dragging], [data-tab-drop-position]',\n )\n .forEach((tab) => {\n delete tab.dataset.tabDragging;\n delete tab.dataset.tabDropPosition;\n });\n };\n let disposed = false;\n const afterControlledRender = (sourceBarId: string, sourceTabId: string) =>\n globalThis.queueMicrotask(() => {\n if (disposed) return;\n const tab = [\n ...root.querySelectorAll<TabRoot>('[data-component=\"app-tab\"]'),\n ].find((candidate) => {\n const candidateBar = tabBar(candidate);\n return (\n tabId(candidate) === sourceTabId &&\n candidateBar !== undefined &&\n barId(candidateBar) === sourceBarId\n );\n });\n const button = tab?.querySelector<HTMLButtonElement>('[role=\"tab\"]');\n button?.focus();\n reveal(button);\n });\n\n const onDragStart = (event: Event) => {\n const dragEvent = event as DragEvent;\n const tab = tabRoot(event.target);\n const bar = tab && tabBar(tab);\n const sourceId = tab && tabId(tab);\n const sourceBarId = bar && barId(bar);\n if (\n !tab ||\n tab.getAttribute('draggable') !== 'true' ||\n !sourceId ||\n !sourceBarId\n )\n return;\n dragged = { barId: sourceBarId, tabId: sourceId };\n tab.dataset.tabDragging = 'true';\n if (dragEvent.dataTransfer) {\n dragEvent.dataTransfer.effectAllowed = 'move';\n dragEvent.dataTransfer.setData(\n 'application/x-kerf-tab',\n `${sourceBarId}:${sourceId}`,\n );\n }\n };\n const onDragOver = (event: Event) => {\n const dragEvent = event as DragEvent;\n const tab = tabRoot(event.target);\n const bar =\n event.target instanceof Element\n ? (event.target.closest<TabBarRoot>('[data-component=\"tab-bar\"]') ??\n undefined)\n : undefined;\n const targetId = tab && tabId(tab);\n const targetBarId = bar && barId(bar);\n if (!dragged || !bar || targetBarId !== dragged.barId) {\n stopAutoScroll();\n clearDropPositions();\n return;\n }\n dragEvent.preventDefault();\n const strip = bar.querySelector<HTMLElement>('[data-kui-tab-list]');\n if (strip) updateAutoScroll(dragEvent, strip);\n else stopAutoScroll();\n clearDropPositions();\n if (!tab || !targetId || targetId === dragged.tabId) return;\n tab.dataset.tabDropPosition = positionFor(dragEvent, tab);\n if (dragEvent.dataTransfer) dragEvent.dataTransfer.dropEffect = 'move';\n };\n const onDrop = (event: Event) => {\n const dragEvent = event as DragEvent;\n const tab = tabRoot(event.target);\n const bar = tab && tabBar(tab);\n const targetId = tab && tabId(tab);\n const targetBarId = bar && barId(bar);\n if (\n !dragged ||\n !tab ||\n !targetId ||\n targetId === dragged.tabId ||\n targetBarId !== dragged.barId\n ) {\n clear();\n return;\n }\n dragEvent.preventDefault();\n const change: TabReorder = {\n barId: dragged.barId,\n sourceId: dragged.tabId,\n targetId,\n position: positionFor(dragEvent, tab),\n source: 'pointer',\n };\n clear();\n onReorder(change);\n afterControlledRender(change.barId, change.sourceId);\n };\n const onKeyDown = (event: Event) => {\n const keyboardEvent = event as KeyboardEvent;\n const button =\n event.target instanceof Element\n ? event.target.closest<HTMLButtonElement>('[role=\"tab\"]')\n : null;\n const tab = button && tabRoot(button);\n const bar = tab && tabBar(tab);\n if (!button || !tab || !bar) return;\n if (keyboardEvent.key === 'Delete' || keyboardEvent.key === 'Backspace') {\n const close = tab.querySelector<HTMLButtonElement>('.kui-app-tab__close');\n if (!close) return;\n keyboardEvent.preventDefault();\n close.click();\n return;\n }\n const tabs = tabsIn(bar);\n const current = tabs.indexOf(button);\n if (current < 0) return;\n if (\n keyboardEvent.altKey &&\n keyboardEvent.shiftKey &&\n (keyboardEvent.key === 'ArrowLeft' || keyboardEvent.key === 'ArrowRight')\n ) {\n const target =\n tabs[current + (keyboardEvent.key === 'ArrowLeft' ? -1 : 1)];\n const sourceId = tabId(tab);\n const targetRoot = target && tabRoot(target);\n const targetId = targetRoot && tabId(targetRoot);\n const sourceBarId = barId(bar);\n if (\n !target ||\n !sourceId ||\n !targetId ||\n !sourceBarId ||\n tab.getAttribute('draggable') !== 'true'\n )\n return;\n keyboardEvent.preventDefault();\n onReorder({\n barId: sourceBarId,\n sourceId,\n targetId,\n position: keyboardEvent.key === 'ArrowLeft' ? 'before' : 'after',\n source: 'keyboard',\n });\n afterControlledRender(sourceBarId, sourceId);\n return;\n }\n let next: number | undefined;\n if (keyboardEvent.key === 'ArrowRight') next = (current + 1) % tabs.length;\n else if (keyboardEvent.key === 'ArrowLeft')\n next = (current - 1 + tabs.length) % tabs.length;\n else if (keyboardEvent.key === 'Home') next = 0;\n else if (keyboardEvent.key === 'End') next = tabs.length - 1;\n if (next === undefined) return;\n keyboardEvent.preventDefault();\n // A per-bar data-tab-activation attribute overrides the wireTabBars option.\n const perBar = bar.dataset.tabActivation;\n const mode: TabActivation =\n perBar === 'manual' || perBar === 'automatic' ? perBar : activation;\n const target = tabs[next]!;\n target.focus();\n // Manual activation moves roving focus only; the user selects with Enter / Space\n // (native on the tab <button>) or click. Automatic also selects the focused tab.\n if (mode === 'automatic') {\n target.click();\n // Activation can synchronously replace the controlled strip. Resolve the\n // logical tab again after rendering instead of leaving focus on a dead node.\n if (!target.isConnected)\n afterControlledRender(\n bar.dataset.tabBarId!,\n tabRoot(target)!.dataset.tabId!,\n );\n }\n reveal(target);\n };\n const onFocusIn = (event: Event) => {\n const tab =\n event.target instanceof HTMLElement &&\n event.target.matches('[role=\"tab\"]')\n ? event.target\n : undefined;\n reveal(tab);\n };\n\n root.addEventListener('dragstart', onDragStart);\n root.addEventListener('dragover', onDragOver);\n root.addEventListener('drop', onDrop);\n root.addEventListener('dragend', clear);\n root.addEventListener('keydown', onKeyDown);\n root.addEventListener('focusin', onFocusIn);\n root\n .querySelectorAll<HTMLElement>(\n '[data-kui-tab-list] [role=\"tab\"][aria-selected=\"true\"]',\n )\n .forEach(reveal);\n\n // Reveal a tab the application selects without focus (for example a tab it\n // adds and selects) once its controlled render lands. Only a change of a\n // bar's selected tab reveals, so a re-render that keeps the selection never\n // pulls a strip the user scrolled back to it.\n const selectedIds = new Map<string, string>();\n const recordSelection = () => {\n const changed: HTMLElement[] = [];\n for (const [bar, button] of selectedTabs(root)) {\n const id = barId(bar);\n const tab = tabRoot(button);\n const selectedId = tab && tabId(tab);\n if (!id || !selectedId) continue;\n if (selectedIds.has(id) && selectedIds.get(id) !== selectedId)\n changed.push(button);\n selectedIds.set(id, selectedId);\n }\n return changed;\n };\n recordSelection();\n const selectionObserver = new view.MutationObserver(() => {\n if (disposed) return;\n for (const button of recordSelection())\n if (ownerDocument.activeElement !== button) revealInStrip(button);\n });\n selectionObserver.observe(root, {\n subtree: true,\n childList: true,\n attributes: true,\n attributeFilter: ['aria-selected'],\n });\n\n return () => {\n disposed = true;\n selectionObserver.disconnect();\n clear();\n root.removeEventListener('dragstart', onDragStart);\n root.removeEventListener('dragover', onDragOver);\n root.removeEventListener('drop', onDrop);\n root.removeEventListener('dragend', clear);\n root.removeEventListener('keydown', onKeyDown);\n root.removeEventListener('focusin', onFocusIn);\n };\n}\n"]}
@@ -0,0 +1,57 @@
1
+ import { jsxs, jsx } from 'kerfjs/jsx-runtime';
2
+
3
+ // src/chip.tsx
4
+ function Chip({
5
+ children,
6
+ tone = "neutral",
7
+ appearance = "quiet",
8
+ shape = "pill",
9
+ size = "default",
10
+ disabled = false,
11
+ itemId,
12
+ className = "",
13
+ slot,
14
+ ...remove
15
+ }) {
16
+ return /* @__PURE__ */ jsxs(
17
+ "span",
18
+ {
19
+ class: `kui-chip ${className}`.trim(),
20
+ "data-component": "chip",
21
+ "data-tone": tone,
22
+ "data-appearance": appearance,
23
+ "data-shape": shape,
24
+ "data-size": size,
25
+ "data-disabled": disabled ? "" : void 0,
26
+ "data-item-id": itemId,
27
+ slot,
28
+ children: [
29
+ /* @__PURE__ */ jsx("span", { class: "kui-chip__label", children }),
30
+ remove.removeAction !== void 0 ? /* @__PURE__ */ jsx(
31
+ "button",
32
+ {
33
+ class: "kui-chip__remove",
34
+ type: "button",
35
+ "data-action": remove.removeAction,
36
+ "aria-label": remove.removeLabel,
37
+ disabled,
38
+ children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", width: "12", height: "12", "aria-hidden": "true", children: /* @__PURE__ */ jsx(
39
+ "path",
40
+ {
41
+ d: "M3.5 3.5 12.5 12.5M12.5 3.5 3.5 12.5",
42
+ fill: "none",
43
+ stroke: "currentColor",
44
+ "stroke-width": "1.75",
45
+ "stroke-linecap": "round"
46
+ }
47
+ ) })
48
+ }
49
+ ) : null
50
+ ]
51
+ }
52
+ );
53
+ }
54
+
55
+ export { Chip };
56
+
57
+ //# sourceMappingURL=chunk-EAC4CDY7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/chip.tsx"],"names":[],"mappings":";;;AAgCO,SAAS,IAAA,CAAK;AAAA,EACnB,QAAA;AAAA,EACA,IAAA,GAAO,SAAA;AAAA,EACP,UAAA,GAAa,OAAA;AAAA,EACb,KAAA,GAAQ,MAAA;AAAA,EACR,IAAA,GAAO,SAAA;AAAA,EACP,QAAA,GAAW,KAAA;AAAA,EACX,MAAA;AAAA,EACA,SAAA,GAAY,EAAA;AAAA,EACZ,IAAA;AAAA,EACA,GAAG;AACL,CAAA,EAAc;AACZ,EAAA,uBACE,IAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,KAAA,EAAO,CAAA,SAAA,EAAY,SAAS,CAAA,CAAA,CAAG,IAAA,EAAK;AAAA,MACpC,gBAAA,EAAe,MAAA;AAAA,MACf,WAAA,EAAW,IAAA;AAAA,MACX,iBAAA,EAAiB,UAAA;AAAA,MACjB,YAAA,EAAY,KAAA;AAAA,MACZ,WAAA,EAAW,IAAA;AAAA,MACX,eAAA,EAAe,WAAW,EAAA,GAAK,MAAA;AAAA,MAC/B,cAAA,EAAc,MAAA;AAAA,MACd,IAAA;AAAA,MAEA,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,MAAA,EAAA,EAAK,KAAA,EAAM,iBAAA,EAAmB,QAAA,EAAS,CAAA;AAAA,QACvC,MAAA,CAAO,iBAAiB,MAAA,mBACvB,GAAA;AAAA,UAAC,QAAA;AAAA,UAAA;AAAA,YACC,KAAA,EAAM,kBAAA;AAAA,YACN,IAAA,EAAK,QAAA;AAAA,YACL,eAAa,MAAA,CAAO,YAAA;AAAA,YACpB,cAAY,MAAA,CAAO,WAAA;AAAA,YACnB,QAAA;AAAA,YAEA,QAAA,kBAAA,GAAA,CAAC,SAAI,OAAA,EAAQ,WAAA,EAAY,OAAM,IAAA,EAAK,MAAA,EAAO,IAAA,EAAK,aAAA,EAAY,MAAA,EAC1D,QAAA,kBAAA,GAAA;AAAA,cAAC,MAAA;AAAA,cAAA;AAAA,gBACC,CAAA,EAAE,sCAAA;AAAA,gBACF,IAAA,EAAK,MAAA;AAAA,gBACL,MAAA,EAAO,cAAA;AAAA,gBACP,cAAA,EAAa,MAAA;AAAA,gBACb,gBAAA,EAAe;AAAA;AAAA,aACjB,EACF;AAAA;AAAA,SACF,GACE;AAAA;AAAA;AAAA,GACN;AAEJ","file":"chunk-EAC4CDY7.js","sourcesContent":["import type { SafeHtml } from 'kerfjs';\n\nimport type {\n BadgeAppearance,\n BadgeShape,\n BadgeSize,\n BadgeTone,\n} from './badge.js';\n\ninterface ChipCommonProps {\n /** Visible, non-interactive chip content. */\n children: SafeHtml | string | number;\n tone?: BadgeTone;\n appearance?: BadgeAppearance;\n shape?: BadgeShape;\n size?: BadgeSize;\n disabled?: boolean;\n /** Record identifier available to an application delegated action handler. */\n itemId?: string;\n className?: string;\n /** Native named-slot assignment when composed inside a web component. */\n slot?: string;\n}\n\n/** A removable chip needs both a delegated action and a specific accessible name. */\nexport type ChipProps = ChipCommonProps &\n (\n | { removeAction: string; removeLabel: string }\n | { removeAction?: never; removeLabel?: never }\n );\n\n/** A short label with an optional native remove button. The application owns removal. */\nexport function Chip({\n children,\n tone = 'neutral',\n appearance = 'quiet',\n shape = 'pill',\n size = 'default',\n disabled = false,\n itemId,\n className = '',\n slot,\n ...remove\n}: ChipProps) {\n return (\n <span\n class={`kui-chip ${className}`.trim()}\n data-component=\"chip\"\n data-tone={tone}\n data-appearance={appearance}\n data-shape={shape}\n data-size={size}\n data-disabled={disabled ? '' : undefined}\n data-item-id={itemId}\n slot={slot}\n >\n <span class=\"kui-chip__label\">{children}</span>\n {remove.removeAction !== undefined ? (\n <button\n class=\"kui-chip__remove\"\n type=\"button\"\n data-action={remove.removeAction}\n aria-label={remove.removeLabel}\n disabled={disabled}\n >\n <svg viewBox=\"0 0 16 16\" width=\"12\" height=\"12\" aria-hidden=\"true\">\n <path\n d=\"M3.5 3.5 12.5 12.5M12.5 3.5 3.5 12.5\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.75\"\n stroke-linecap=\"round\"\n />\n </svg>\n </button>\n ) : null}\n </span>\n );\n}\n"]}
@@ -1,6 +1,6 @@
1
+ import { Pane } from './chunk-EZVNC4J6.js';
1
2
  import { isRelocatableGroup, ToolbarControlGroup } from './chunk-7JUBXOIV.js';
2
3
  import { Toolbar } from './chunk-MERWRTBG.js';
3
- import { Pane } from './chunk-EZVNC4J6.js';
4
4
  import { LucideIcon } from './chunk-4R777DUZ.js';
5
5
  import { PanelLeftOpen, PanelLeftClose, PanelRightOpen, PanelRightClose, PanelBottomOpen, PanelBottomClose } from 'lucide';
6
6
  import { jsx, jsxs, Fragment } from 'kerfjs/jsx-runtime';
@@ -92,4 +92,4 @@ function relocatedPanelGroups(toolbar, side, collapsed, attributes) {
92
92
 
93
93
  export { collapsiblePanelToggleIcon, composedPanelBody, relocatedPanelGroups };
94
94
 
95
- //# sourceMappingURL=chunk-T57AXDFM.js.map
95
+ //# sourceMappingURL=chunk-NYL63PSD.js.map