@trembus/ui 0.1.0 → 0.2.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 +39 -5
- package/dist/index.d.ts +46 -0
- package/dist/index.js +2013 -1490
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +14 -1
package/README.md
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
# @trembus/ui
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/@trembus/ui)
|
|
4
|
+
[](https://github.com/nicholasosto/Trembus-Component-Library/blob/main/LICENSE)
|
|
5
|
+
[](https://nicholasosto.github.io/Trembus-Component-Library/)
|
|
6
|
+
|
|
3
7
|
Trembus React component library — first-principles UX (tokens → primitives →
|
|
4
8
|
components), each component carrying a machine-checked "3 UI jobs" contract
|
|
5
9
|
(Reveal State · Afford Action · Acknowledge Input). claude.ai-clean **light** +
|
|
6
|
-
Trembus **dark** + blood-dark **reliquary** themes.
|
|
10
|
+
Trembus **dark** + blood-dark **reliquary** themes, zero styling config.
|
|
11
|
+
|
|
12
|
+
**🔭 [Browse every component + theme in the live Storybook →](https://nicholasosto.github.io/Trembus-Component-Library/)**
|
|
13
|
+
|
|
14
|
+
## Install
|
|
7
15
|
|
|
8
16
|
```sh
|
|
9
17
|
pnpm add @trembus/ui react react-dom
|
|
@@ -32,11 +40,37 @@ export function App() {
|
|
|
32
40
|
}
|
|
33
41
|
```
|
|
34
42
|
|
|
35
|
-
|
|
36
|
-
|
|
43
|
+
No Tailwind, no build-tool config. Theming is pure CSS custom properties — override
|
|
44
|
+
any `--tcl-*` token to re-skin, or flip `[data-theme]` (`light` · `dark` ·
|
|
45
|
+
`reliquary`). Surfaces can wear a **material** skin via `<Box material="glass">`.
|
|
46
|
+
|
|
47
|
+
## What's inside
|
|
48
|
+
|
|
49
|
+
**Primitives** — `Box` (Surface), `Stack` / `Inline` (Relation), `Text` (Mark),
|
|
50
|
+
`Pressable` (Affordance; owns the idle→hover→pressed→focus FSM). Compose these into
|
|
51
|
+
your own components.
|
|
52
|
+
|
|
53
|
+
**Afford-Action** — `Button`, `IconButton`, `Tabs`, `Menu`.
|
|
54
|
+
|
|
55
|
+
**Reveal-State** — `Badge`, `Avatar`, `Spinner`, `Skeleton`, `Card`, `Callout`,
|
|
56
|
+
`EmptyState`, `Stat`, `Table`, `Progress`, `Meter`.
|
|
57
|
+
|
|
58
|
+
**Acknowledge-Input** — `Input`, `Textarea`, `Select`, `Checkbox`, `RadioGroup`,
|
|
59
|
+
`Switch`, `Tooltip`, `Dialog`, `Toast`.
|
|
60
|
+
|
|
61
|
+
**Visualizations** (Tier-1, data-driven) — `Hub`, `BarChart`, `LineChart`,
|
|
62
|
+
`DonutChart`, `Heatmap`, `Gauge`, `Sparkline`, `Funnel`, `Treemap`, `Timeline`,
|
|
63
|
+
`Swimlane`. (Node-link graphs live in [`@trembus/viz`](https://www.npmjs.com/package/@trembus/viz).)
|
|
64
|
+
|
|
65
|
+
Hooks (`useAffordanceState`, `useFocusTrap`, `useReturnFocus`, `useReducedMotion`,
|
|
66
|
+
`useDismissable`) and utils (`Portal`, `Slot`, `cx`) are exported too.
|
|
67
|
+
|
|
68
|
+
## Theming tokens
|
|
37
69
|
|
|
38
|
-
|
|
70
|
+
A type-safe `tokens` object (var references) is exported for inline use:
|
|
71
|
+
`style={{ color: tokens.color.accent }}`. The full token vocabulary lives in
|
|
72
|
+
[`@trembus/tokens`](https://www.npmjs.com/package/@trembus/tokens).
|
|
39
73
|
|
|
40
74
|
## License
|
|
41
75
|
|
|
42
|
-
MIT © Nicholas Osto
|
|
76
|
+
MIT © Nicholas Osto · [source & contributing](https://github.com/nicholasosto/Trembus-Component-Library)
|
package/dist/index.d.ts
CHANGED
|
@@ -597,6 +597,52 @@ declare type FillBarSize = 'sm' | 'md' | 'lg';
|
|
|
597
597
|
|
|
598
598
|
declare type FillBarTone = 'accent' | 'info' | 'success' | 'warning' | 'danger' | 'neutral';
|
|
599
599
|
|
|
600
|
+
/**
|
|
601
|
+
* A node in the folder forest. The shape is **nested** (children inline) — the
|
|
602
|
+
* natural file-tree idiom, and the one that makes lazy loading clean. Ids are
|
|
603
|
+
* optional: an omitted id is derived from the node's position (`${parentId}/${i}`),
|
|
604
|
+
* so a literal filesystem dump renders without bookkeeping.
|
|
605
|
+
*/
|
|
606
|
+
export declare interface FolderNode {
|
|
607
|
+
/** Stable unique id. Omitted → derived from position; provide it if the tree reorders. */
|
|
608
|
+
id?: string;
|
|
609
|
+
/** Display name, e.g. "Button.tsx". Doubles as the accessible name. */
|
|
610
|
+
label: string;
|
|
611
|
+
/** Folder vs file. Inferred when omitted: children/hasChildren ⇒ folder, else file. */
|
|
612
|
+
kind?: 'folder' | 'file';
|
|
613
|
+
/** Explicit glyph name override (else inferred: folder/folder-open, or file type). */
|
|
614
|
+
icon?: string;
|
|
615
|
+
/** Nested children. A folder with no children is still expandable if `hasChildren`. */
|
|
616
|
+
children?: FolderNode[];
|
|
617
|
+
/** Lazy: mark a folder expandable before its children are loaded. */
|
|
618
|
+
hasChildren?: boolean;
|
|
619
|
+
/** Non-interactive row (no select / no check), still focusable for reading. */
|
|
620
|
+
disabled?: boolean;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
export declare function FolderTree({ data, label, expandedIds, defaultExpandedIds, onExpandedChange, selectedId, defaultSelectedId, onSelect, checkable, checkedIds, defaultCheckedIds, onCheckedChange, filter, onFilterChange, onLoadChildren, className, }: FolderTreeProps): JSX.Element;
|
|
624
|
+
|
|
625
|
+
export declare interface FolderTreeProps {
|
|
626
|
+
/** The forest — one or more roots. */
|
|
627
|
+
data: FolderNode[];
|
|
628
|
+
/** Accessible name for the tree (announced by screen readers). */
|
|
629
|
+
label?: string;
|
|
630
|
+
expandedIds?: string[];
|
|
631
|
+
defaultExpandedIds?: string[];
|
|
632
|
+
onExpandedChange?: (ids: string[]) => void;
|
|
633
|
+
selectedId?: string;
|
|
634
|
+
defaultSelectedId?: string;
|
|
635
|
+
onSelect?: (id: string, node: FolderNode) => void;
|
|
636
|
+
checkable?: boolean;
|
|
637
|
+
checkedIds?: string[];
|
|
638
|
+
defaultCheckedIds?: string[];
|
|
639
|
+
onCheckedChange?: (ids: string[]) => void;
|
|
640
|
+
filter?: boolean | string;
|
|
641
|
+
onFilterChange?: (query: string) => void;
|
|
642
|
+
onLoadChildren?: (node: FolderNode) => FolderNode[] | Promise<FolderNode[]>;
|
|
643
|
+
className?: string;
|
|
644
|
+
}
|
|
645
|
+
|
|
600
646
|
export { FontWeightToken }
|
|
601
647
|
|
|
602
648
|
/**
|