@leitware/composables 1.6.1 → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -530,30 +530,97 @@ All normal components import from `@leitware/composables`; AI components import
530
530
 
531
531
  ### Navigation
532
532
 
533
- | Component | Description |
534
- | --------------- | ------------------------------------------------------ |
535
- | `tabs` | Tabbed content navigation with items array API |
536
- | `breadcrumb` | Navigation trail with items array API |
537
- | `pagination` | Page navigation with currentPage and totalPages API |
538
- | `sidebar` | Application sidebar with collapsible navigation groups |
539
- | `dropdown-menu` | Contextual menu triggered by a button |
533
+ | Component | Description |
534
+ | ------------------- | -------------------------------------------------------------------------- |
535
+ | `tabs` | Tabbed content navigation with items array API |
536
+ | `breadcrumb` | Navigation trail with items array API |
537
+ | `pagination` | Page navigation with currentPage and totalPages API |
538
+ | `sidebar` | Application sidebar with collapsible navigation groups |
539
+ | `dropdown-menu` | Contextual menu triggered by a button |
540
+ | `table-of-contents` | Nested section navigation with an active rail and optional scroll tracking |
541
+
542
+ Tabs default to `variant="segmented"`, with an animated selection surface.
543
+ Use `variant="underline"` for the line treatment; the existing `default` and
544
+ `line` variant names remain supported as aliases. Labels use semantic text
545
+ colours in every preset. Flow uses `--flow-border-width` with a minimum of 1px,
546
+ so canvas and node outlines survive a zero global border width.
540
547
 
541
548
  ### Data Display
542
549
 
543
- | Component | Description |
544
- | ------------- | ---------------------------------------------------------------------------- |
545
- | `table` | Semantic HTML table with styled rows and cells |
546
- | `card` | Bordered content container with title, description, action, and footer props |
547
- | `accordion` | Vertically collapsible content sections with items array API |
548
- | `collapsible` | Expandable and collapsible content panel with trigger prop |
549
- | `item` | Flexible list item with title, description, icon, and actions |
550
- | `message` | Message row primitives for chat, activity, and assistant UIs |
551
- | `bubble` | Message bubble primitives with semantic variants |
552
- | `marker` | Inline metadata marker with icon, separator, and border variants |
553
- | `empty` | Empty state placeholder with icon, title, and description |
554
- | `carousel` | Horizontally scrollable content slider with items array API |
555
- | `code-block` | Monospace code display with line numbers |
556
- | `list` | Variant list renderer: arrow, bullet |
550
+ | Component | Description |
551
+ | ---------------- | ---------------------------------------------------------------------------- |
552
+ | `table` | Semantic HTML table with styled rows and cells |
553
+ | `card` | Bordered content container with title, description, action, and footer props |
554
+ | `accordion` | Vertically collapsible content sections with items array API |
555
+ | `collapsible` | Expandable and collapsible content panel with trigger prop |
556
+ | `item` | Flexible list item with title, description, icon, and actions |
557
+ | `message` | Message row primitives for chat, activity, and assistant UIs |
558
+ | `bubble` | Message bubble primitives with semantic variants |
559
+ | `marker` | Inline metadata marker with icon, separator, and border variants |
560
+ | `empty` | Empty state placeholder with icon, title, and description |
561
+ | `carousel` | Horizontally scrollable content slider with items array API |
562
+ | `code-block` | Monospace code display with line numbers |
563
+ | `list` | Variant list renderer: arrow, bullet |
564
+ | `layer-card` | Layered content surface with recessed header and footer |
565
+ | `flow` | Connected workflow steps and parallel branches |
566
+ | `clipboard-text` | Read-only copy field with success and error feedback |
567
+
568
+ ### Kumo-inspired compositions
569
+
570
+ `LayerCard`, `TableOfContents`, `Flow`, and `ClipboardText` are available from the
571
+ package root. They use the same semantic tokens as the rest of the library and
572
+ adapt to every preset; Kumo adds its soft layered surfaces and diagram canvas.
573
+ Their treatments follow the [Kumo component references](https://kumo-ui.com/components/layer-card/).
574
+
575
+ ```tsx
576
+ import { LayerCard, TableOfContents, Flow, ClipboardText } from '@leitware/composables'
577
+
578
+ <LayerCard title="Next steps" footer="Last updated just now">
579
+ <ClipboardText text="bun add @leitware/composables" />
580
+ </LayerCard>
581
+
582
+ <TableOfContents
583
+ items={[
584
+ { id: 'overview', label: 'Overview' },
585
+ { id: 'setup', label: 'Setup', children: [{ id: 'install', label: 'Installation' }] },
586
+ ]}
587
+ trackScroll
588
+ />
589
+
590
+ <Flow
591
+ steps={[
592
+ { id: 'request', label: 'Request' },
593
+ { id: 'parallel', branches: [
594
+ [{ id: 'cache', label: 'Cache lookup' }],
595
+ [{ id: 'worker', label: 'Worker' }, { id: 'validate', label: 'Validate' }],
596
+ ] },
597
+ { id: 'response', label: 'Response' },
598
+ ]}
599
+ />
600
+ ```
601
+
602
+ LayerCard exposes `.Root`, `.Primary`, and `.Secondary` for custom composition.
603
+ TableOfContents exposes `.Title`, `.List`, `.Item`, and `.Group`; items support
604
+ Base UI's `render` prop for router links. `activeId` and `onActiveIdChange` support
605
+ controlled selection. Optional `trackScroll` follows matching document section
606
+ IDs with `scrollOffset` for sticky headers. `useTableOfContentsActiveId` also
607
+ supports a custom scroll root.
608
+
609
+ Flow exposes `.Node`, `.Parallel`, `.List`, and `.Anchor`. Use `orientation="vertical"`
610
+ for a top-to-bottom diagram, `align="center"` for centered branches, or `canvas={false}`
611
+ for an inline diagram. Connectors update when nodes, anchors, or the viewport
612
+ resize. The canvas supports native scrolling and mouse dragging; node controls
613
+ retain their normal interactions. Node IDs should be unique within the document.
614
+
615
+ ClipboardText supports `sm`, `default`, and `lg` sizes, `textToCopy` for a value
616
+ that differs from the display, optional tooltips, localized `labels`, and
617
+ `onCopy` / `onCopyError` callbacks. Feedback resets after `feedbackDuration`
618
+ (default 1500ms). Failed clipboard writes never display a success state.
619
+
620
+ Component tokens include `--layer-card-radius`, `--layer-card-padding`,
621
+ `--layer-card-shadow`, `--clipboard-text-height` (and `-sm` / `-lg`),
622
+ `--clipboard-text-radius`, `--flow-gap`, `--flow-branch-gap`, `--flow-node-radius`,
623
+ `--flow-node-shadow`, and the `--flow-canvas-*` controls.
557
624
 
558
625
  ### Form Components
559
626
 
@@ -153,7 +153,7 @@
153
153
  --transition-slow: var(--motion-duration-slow) var(--motion-ease-linear);
154
154
  --hover-transform: none;
155
155
  --hover-shadow: none;
156
- --active-scale: 1;
156
+ --active-scale: 0.98;
157
157
  --heading-font-weight: 700;
158
158
  --heading-letter-spacing: var(--tracking-tight);
159
159
  --body-letter-spacing: var(--tracking-normal);
@@ -153,7 +153,7 @@
153
153
  --transition-slow: var(--motion-duration-slow) var(--motion-ease-decelerate);
154
154
  --hover-transform: none;
155
155
  --hover-shadow: none;
156
- --active-scale: 1;
156
+ --active-scale: 0.98;
157
157
  --heading-font-weight: 700;
158
158
  --heading-letter-spacing: var(--tracking-tight);
159
159
  --body-letter-spacing: var(--tracking-normal);
@@ -153,7 +153,7 @@
153
153
  --transition-slow: var(--motion-duration-slow) var(--motion-ease-decelerate);
154
154
  --hover-transform: none;
155
155
  --hover-shadow: none;
156
- --active-scale: 1;
156
+ --active-scale: 0.98;
157
157
  --heading-font-weight: 600;
158
158
  --heading-letter-spacing: var(--tracking-tight);
159
159
  --body-letter-spacing: var(--tracking-normal);
@@ -182,6 +182,13 @@
182
182
  --button-gap: calc(var(--spacing) * 1.5);
183
183
  --button-brand-font-weight: 600;
184
184
  --button-brand-text-shadow: 0 1px 1px #00000059, 0 0 1px #00000040;
185
+ --layer-card-radius: var(--radius-lg);
186
+ --layer-card-shadow: 0 1px 2px #0000000d;
187
+ --tabs-tab-height: calc(var(--spacing) * 8);
188
+ --tabs-list-shadow: 0 0 0 1px var(--border-secondary);
189
+ --tabs-indicator-shadow: 0 1px 2px #0000000d;
190
+ --flow-node-shadow: 0 1px 2px #0000000d;
191
+ --flow-canvas-background-image: radial-gradient(var(--border-disabled) 1px, transparent 1px);
185
192
  --button-secondary-border: var(--border-secondary);
186
193
  --button-secondary-hover-bg: var(--bg-surface-hover);
187
194
  --button-secondary-shadow: 0 1px 2px #0000000d;
@@ -495,6 +502,13 @@
495
502
  --button-brand-font-weight: 600;
496
503
  --button-brand-text-shadow: 0 1px 1px #00000059, 0 0 1px #00000040;
497
504
  --card-radius: var(--radius-xl);
505
+ --layer-card-radius: var(--radius-lg);
506
+ --layer-card-shadow: 0 1px 2px #0000000d;
507
+ --tabs-tab-height: calc(var(--spacing) * 8);
508
+ --tabs-list-shadow: 0 0 0 1px var(--border-secondary);
509
+ --tabs-indicator-shadow: 0 1px 2px #0000000d;
510
+ --flow-node-shadow: 0 1px 2px #0000000d;
511
+ --flow-canvas-background-image: radial-gradient(var(--border-disabled) 1px, transparent 1px);
498
512
  --input-radius: var(--radius-lg);
499
513
  --input-height: calc(var(--spacing) * 9);
500
514
  --badge-radius: var(--radius-md);
@@ -518,7 +532,7 @@
518
532
  --hover-ring-color: var(--border-secondary);
519
533
  --hover-transform: none;
520
534
  --hover-shadow: none;
521
- --active-scale: 1;
535
+ --active-scale: 0.98;
522
536
  --heading-font-weight: 600;
523
537
  --hero-font-weight: 600;
524
538
  --section-title-font-weight: 600;