@leitware/composables 1.6.1 → 1.7.0

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,91 @@ 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 |
540
541
 
541
542
  ### Data Display
542
543
 
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 |
544
+ | Component | Description |
545
+ | ---------------- | ---------------------------------------------------------------------------- |
546
+ | `table` | Semantic HTML table with styled rows and cells |
547
+ | `card` | Bordered content container with title, description, action, and footer props |
548
+ | `accordion` | Vertically collapsible content sections with items array API |
549
+ | `collapsible` | Expandable and collapsible content panel with trigger prop |
550
+ | `item` | Flexible list item with title, description, icon, and actions |
551
+ | `message` | Message row primitives for chat, activity, and assistant UIs |
552
+ | `bubble` | Message bubble primitives with semantic variants |
553
+ | `marker` | Inline metadata marker with icon, separator, and border variants |
554
+ | `empty` | Empty state placeholder with icon, title, and description |
555
+ | `carousel` | Horizontally scrollable content slider with items array API |
556
+ | `code-block` | Monospace code display with line numbers |
557
+ | `list` | Variant list renderer: arrow, bullet |
558
+ | `layer-card` | Layered content surface with recessed header and footer |
559
+ | `flow` | Connected workflow steps and parallel branches |
560
+ | `clipboard-text` | Read-only copy field with success and error feedback |
561
+
562
+ ### Kumo-inspired compositions
563
+
564
+ `LayerCard`, `TableOfContents`, `Flow`, and `ClipboardText` are available from the
565
+ package root. They use the same semantic tokens as the rest of the library and
566
+ adapt to every preset; Kumo adds its soft layered surfaces and diagram canvas.
567
+ Their treatments follow the [Kumo component references](https://kumo-ui.com/components/layer-card/).
568
+
569
+ ```tsx
570
+ import { LayerCard, TableOfContents, Flow, ClipboardText } from '@leitware/composables'
571
+
572
+ <LayerCard title="Next steps" footer="Last updated just now">
573
+ <ClipboardText text="bun add @leitware/composables" />
574
+ </LayerCard>
575
+
576
+ <TableOfContents
577
+ items={[
578
+ { id: 'overview', label: 'Overview' },
579
+ { id: 'setup', label: 'Setup', children: [{ id: 'install', label: 'Installation' }] },
580
+ ]}
581
+ trackScroll
582
+ />
583
+
584
+ <Flow
585
+ steps={[
586
+ { id: 'request', label: 'Request' },
587
+ { id: 'parallel', branches: [
588
+ [{ id: 'cache', label: 'Cache lookup' }],
589
+ [{ id: 'worker', label: 'Worker' }, { id: 'validate', label: 'Validate' }],
590
+ ] },
591
+ { id: 'response', label: 'Response' },
592
+ ]}
593
+ />
594
+ ```
595
+
596
+ LayerCard exposes `.Root`, `.Primary`, and `.Secondary` for custom composition.
597
+ TableOfContents exposes `.Title`, `.List`, `.Item`, and `.Group`; items support
598
+ Base UI's `render` prop for router links. `activeId` and `onActiveIdChange` support
599
+ controlled selection. Optional `trackScroll` follows matching document section
600
+ IDs with `scrollOffset` for sticky headers. `useTableOfContentsActiveId` also
601
+ supports a custom scroll root.
602
+
603
+ Flow exposes `.Node`, `.Parallel`, `.List`, and `.Anchor`. Use `orientation="vertical"`
604
+ for a top-to-bottom diagram, `align="center"` for centered branches, or `canvas={false}`
605
+ for an inline diagram. Connectors update when nodes, anchors, or the viewport
606
+ resize. The canvas supports native scrolling and mouse dragging; node controls
607
+ retain their normal interactions. Node IDs should be unique within the document.
608
+
609
+ ClipboardText supports `sm`, `default`, and `lg` sizes, `textToCopy` for a value
610
+ that differs from the display, optional tooltips, localized `labels`, and
611
+ `onCopy` / `onCopyError` callbacks. Feedback resets after `feedbackDuration`
612
+ (default 1500ms). Failed clipboard writes never display a success state.
613
+
614
+ Component tokens include `--layer-card-radius`, `--layer-card-padding`,
615
+ `--layer-card-shadow`, `--clipboard-text-height` (and `-sm` / `-lg`),
616
+ `--clipboard-text-radius`, `--flow-gap`, `--flow-branch-gap`, `--flow-node-radius`,
617
+ `--flow-node-shadow`, and the `--flow-canvas-*` controls.
557
618
 
558
619
  ### Form Components
559
620
 
@@ -182,6 +182,10 @@
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
+ --flow-node-shadow: 0 1px 2px #0000000d;
188
+ --flow-canvas-background-image: radial-gradient(var(--border-disabled) 1px, transparent 1px);
185
189
  --button-secondary-border: var(--border-secondary);
186
190
  --button-secondary-hover-bg: var(--bg-surface-hover);
187
191
  --button-secondary-shadow: 0 1px 2px #0000000d;
@@ -495,6 +499,10 @@
495
499
  --button-brand-font-weight: 600;
496
500
  --button-brand-text-shadow: 0 1px 1px #00000059, 0 0 1px #00000040;
497
501
  --card-radius: var(--radius-xl);
502
+ --layer-card-radius: var(--radius-lg);
503
+ --layer-card-shadow: 0 1px 2px #0000000d;
504
+ --flow-node-shadow: 0 1px 2px #0000000d;
505
+ --flow-canvas-background-image: radial-gradient(var(--border-disabled) 1px, transparent 1px);
498
506
  --input-radius: var(--radius-lg);
499
507
  --input-height: calc(var(--spacing) * 9);
500
508
  --badge-radius: var(--radius-md);