@brijbyte/agentic-ui 0.0.1-beta → 0.0.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 +736 -0
- package/dist/accordion/accordion.css +89 -0
- package/dist/accordion/accordion.d.ts +28 -0
- package/dist/accordion/accordion.d.ts.map +1 -0
- package/dist/accordion/accordion.js +51 -0
- package/dist/accordion/accordion.js.map +1 -0
- package/dist/accordion/accordion.module.css.d.ts +2 -0
- package/dist/accordion/accordion.module.js +14 -0
- package/dist/accordion/accordion.module.js.map +1 -0
- package/dist/accordion/index.d.ts +3 -0
- package/dist/accordion/index.js +4 -0
- package/dist/accordion/parts.d.ts +28 -0
- package/dist/accordion/parts.d.ts.map +1 -0
- package/dist/accordion/parts.js +55 -0
- package/dist/accordion/parts.js.map +1 -0
- package/dist/badge/badge.css +70 -0
- package/dist/badge/badge.d.ts +20 -0
- package/dist/badge/badge.d.ts.map +1 -0
- package/dist/badge/badge.js +21 -0
- package/dist/badge/badge.js.map +1 -0
- package/dist/badge/badge.module.css.d.ts +2 -0
- package/dist/badge/badge.module.js +16 -0
- package/dist/badge/badge.module.js.map +1 -0
- package/dist/badge/index.d.ts +2 -0
- package/dist/badge/index.js +3 -0
- package/dist/button/button.css +242 -0
- package/dist/button/button.d.ts +28 -0
- package/dist/button/button.d.ts.map +1 -0
- package/dist/button/button.js +34 -0
- package/dist/button/button.js.map +1 -0
- package/dist/button/button.module.css.d.ts +2 -0
- package/dist/button/button.module.js +27 -0
- package/dist/button/button.module.js.map +1 -0
- package/dist/button/index.d.ts +2 -0
- package/dist/button/index.js +3 -0
- package/dist/card/card.css +68 -0
- package/dist/card/card.d.ts +41 -0
- package/dist/card/card.d.ts.map +1 -0
- package/dist/card/card.js +50 -0
- package/dist/card/card.js.map +1 -0
- package/dist/card/card.module.css.d.ts +2 -0
- package/dist/card/card.module.js +15 -0
- package/dist/card/card.module.js.map +1 -0
- package/dist/card/index.d.ts +2 -0
- package/dist/card/index.js +3 -0
- package/dist/checkbox/checkbox.css +76 -0
- package/dist/checkbox/checkbox.d.ts +29 -0
- package/dist/checkbox/checkbox.d.ts.map +1 -0
- package/dist/checkbox/checkbox.js +40 -0
- package/dist/checkbox/checkbox.js.map +1 -0
- package/dist/checkbox/checkbox.module.css.d.ts +2 -0
- package/dist/checkbox/checkbox.module.js +11 -0
- package/dist/checkbox/checkbox.module.js.map +1 -0
- package/dist/checkbox/index.d.ts +3 -0
- package/dist/checkbox/index.js +4 -0
- package/dist/checkbox/parts.d.ts +20 -0
- package/dist/checkbox/parts.d.ts.map +1 -0
- package/dist/checkbox/parts.js +51 -0
- package/dist/checkbox/parts.js.map +1 -0
- package/dist/collapsible/collapsible.css +92 -0
- package/dist/collapsible/collapsible.d.ts +24 -0
- package/dist/collapsible/collapsible.d.ts.map +1 -0
- package/dist/collapsible/collapsible.js +44 -0
- package/dist/collapsible/collapsible.js.map +1 -0
- package/dist/collapsible/collapsible.module.css.d.ts +2 -0
- package/dist/collapsible/collapsible.module.js +12 -0
- package/dist/collapsible/collapsible.module.js.map +1 -0
- package/dist/collapsible/index.d.ts +3 -0
- package/dist/collapsible/index.js +4 -0
- package/dist/collapsible/parts.d.ts +23 -0
- package/dist/collapsible/parts.d.ts.map +1 -0
- package/dist/collapsible/parts.js +44 -0
- package/dist/collapsible/parts.js.map +1 -0
- package/dist/dialog/dialog.css +120 -0
- package/dist/dialog/dialog.d.ts +32 -0
- package/dist/dialog/dialog.d.ts.map +1 -0
- package/dist/dialog/dialog.js +54 -0
- package/dist/dialog/dialog.js.map +1 -0
- package/dist/dialog/dialog.module.css.d.ts +2 -0
- package/dist/dialog/dialog.module.js +15 -0
- package/dist/dialog/dialog.module.js.map +1 -0
- package/dist/dialog/index.d.ts +3 -0
- package/dist/dialog/index.js +4 -0
- package/dist/dialog/parts.d.ts +38 -0
- package/dist/dialog/parts.d.ts.map +1 -0
- package/dist/dialog/parts.js +75 -0
- package/dist/dialog/parts.js.map +1 -0
- package/dist/drawer/drawer.css +257 -0
- package/dist/drawer/drawer.d.ts +38 -0
- package/dist/drawer/drawer.d.ts.map +1 -0
- package/dist/drawer/drawer.js +87 -0
- package/dist/drawer/drawer.js.map +1 -0
- package/dist/drawer/drawer.module.css.d.ts +2 -0
- package/dist/drawer/drawer.module.js +20 -0
- package/dist/drawer/drawer.module.js.map +1 -0
- package/dist/drawer/index.d.ts +3 -0
- package/dist/drawer/index.js +4 -0
- package/dist/drawer/parts.d.ts +58 -0
- package/dist/drawer/parts.d.ts.map +1 -0
- package/dist/drawer/parts.js +107 -0
- package/dist/drawer/parts.js.map +1 -0
- package/dist/index.css +2424 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.js +53 -0
- package/dist/input/index.d.ts +2 -0
- package/dist/input/index.js +3 -0
- package/dist/input/input.css +107 -0
- package/dist/input/input.d.ts +17 -0
- package/dist/input/input.d.ts.map +1 -0
- package/dist/input/input.js +37 -0
- package/dist/input/input.js.map +1 -0
- package/dist/input/input.module.css.d.ts +2 -0
- package/dist/input/input.module.js +18 -0
- package/dist/input/input.module.js.map +1 -0
- package/dist/menu/index.d.ts +4 -0
- package/dist/menu/index.js +5 -0
- package/dist/menu/menu.css +158 -0
- package/dist/menu/menu.d.ts +50 -0
- package/dist/menu/menu.d.ts.map +1 -0
- package/dist/menu/menu.js +69 -0
- package/dist/menu/menu.js.map +1 -0
- package/dist/menu/menu.module.css.d.ts +2 -0
- package/dist/menu/menu.module.js +19 -0
- package/dist/menu/menu.module.js.map +1 -0
- package/dist/menu/menuitemshortcut.d.ts +9 -0
- package/dist/menu/menuitemshortcut.d.ts.map +1 -0
- package/dist/menu/menuitemshortcut.js +15 -0
- package/dist/menu/menuitemshortcut.js.map +1 -0
- package/dist/menu/parts.d.ts +39 -0
- package/dist/menu/parts.d.ts.map +1 -0
- package/dist/menu/parts.js +76 -0
- package/dist/menu/parts.js.map +1 -0
- package/dist/number-field/index.d.ts +3 -0
- package/dist/number-field/index.js +4 -0
- package/dist/number-field/number-field.css +115 -0
- package/dist/number-field/number-field.d.ts +31 -0
- package/dist/number-field/number-field.d.ts.map +1 -0
- package/dist/number-field/number-field.js +78 -0
- package/dist/number-field/number-field.js.map +1 -0
- package/dist/number-field/number-field.module.css.d.ts +2 -0
- package/dist/number-field/number-field.module.js +16 -0
- package/dist/number-field/number-field.module.js.map +1 -0
- package/dist/number-field/parts.d.ts +38 -0
- package/dist/number-field/parts.d.ts.map +1 -0
- package/dist/number-field/parts.js +74 -0
- package/dist/number-field/parts.js.map +1 -0
- package/dist/progress/index.d.ts +3 -0
- package/dist/progress/index.js +4 -0
- package/dist/progress/parts.d.ts +20 -0
- package/dist/progress/parts.d.ts.map +1 -0
- package/dist/progress/parts.js +42 -0
- package/dist/progress/parts.js.map +1 -0
- package/dist/progress/progress.css +75 -0
- package/dist/progress/progress.d.ts +27 -0
- package/dist/progress/progress.d.ts.map +1 -0
- package/dist/progress/progress.js +27 -0
- package/dist/progress/progress.js.map +1 -0
- package/dist/progress/progress.module.css.d.ts +2 -0
- package/dist/progress/progress.module.js +19 -0
- package/dist/progress/progress.module.js.map +1 -0
- package/dist/reset.css +91 -0
- package/dist/select/index.d.ts +3 -0
- package/dist/select/index.js +4 -0
- package/dist/select/parts.d.ts +65 -0
- package/dist/select/parts.d.ts.map +1 -0
- package/dist/select/parts.js +134 -0
- package/dist/select/parts.js.map +1 -0
- package/dist/select/select.css +159 -0
- package/dist/select/select.d.ts +38 -0
- package/dist/select/select.d.ts.map +1 -0
- package/dist/select/select.js +80 -0
- package/dist/select/select.js.map +1 -0
- package/dist/select/select.module.css.d.ts +2 -0
- package/dist/select/select.module.js +17 -0
- package/dist/select/select.module.js.map +1 -0
- package/dist/separator/index.d.ts +2 -0
- package/dist/separator/index.js +3 -0
- package/dist/separator/separator.css +20 -0
- package/dist/separator/separator.d.ts +16 -0
- package/dist/separator/separator.d.ts.map +1 -0
- package/dist/separator/separator.js +17 -0
- package/dist/separator/separator.js.map +1 -0
- package/dist/separator/separator.module.css.d.ts +2 -0
- package/dist/separator/separator.module.js +6 -0
- package/dist/separator/separator.module.js.map +1 -0
- package/dist/styles/reset.css +69 -0
- package/dist/styles/tokens.css +274 -0
- package/dist/switch/index.d.ts +3 -0
- package/dist/switch/index.js +4 -0
- package/dist/switch/parts.d.ts +18 -0
- package/dist/switch/parts.d.ts.map +1 -0
- package/dist/switch/parts.js +39 -0
- package/dist/switch/parts.js.map +1 -0
- package/dist/switch/switch.css +68 -0
- package/dist/switch/switch.d.ts +28 -0
- package/dist/switch/switch.d.ts.map +1 -0
- package/dist/switch/switch.js +26 -0
- package/dist/switch/switch.js.map +1 -0
- package/dist/switch/switch.module.css.d.ts +2 -0
- package/dist/switch/switch.module.js +11 -0
- package/dist/switch/switch.module.js.map +1 -0
- package/dist/tabs/index.d.ts +3 -0
- package/dist/tabs/index.js +4 -0
- package/dist/tabs/parts.d.ts +23 -0
- package/dist/tabs/parts.d.ts.map +1 -0
- package/dist/tabs/parts.js +48 -0
- package/dist/tabs/parts.js.map +1 -0
- package/dist/tabs/tabs.css +90 -0
- package/dist/tabs/tabs.d.ts +28 -0
- package/dist/tabs/tabs.d.ts.map +1 -0
- package/dist/tabs/tabs.js +30 -0
- package/dist/tabs/tabs.js.map +1 -0
- package/dist/tabs/tabs.module.css.d.ts +2 -0
- package/dist/tabs/tabs.module.js +11 -0
- package/dist/tabs/tabs.module.js.map +1 -0
- package/dist/tailwind-theme.css +142 -0
- package/dist/toast/index.d.ts +3 -0
- package/dist/toast/index.js +4 -0
- package/dist/toast/parts.d.ts +33 -0
- package/dist/toast/parts.d.ts.map +1 -0
- package/dist/toast/parts.js +62 -0
- package/dist/toast/parts.js.map +1 -0
- package/dist/toast/toast.css +211 -0
- package/dist/toast/toast.d.ts +43 -0
- package/dist/toast/toast.d.ts.map +1 -0
- package/dist/toast/toast.js +156 -0
- package/dist/toast/toast.js.map +1 -0
- package/dist/toast/toast.module.css.d.ts +2 -0
- package/dist/toast/toast.module.js +25 -0
- package/dist/toast/toast.module.js.map +1 -0
- package/dist/tokens.css +400 -0
- package/dist/tooltip/index.d.ts +3 -0
- package/dist/tooltip/index.js +4 -0
- package/dist/tooltip/parts.d.ts +23 -0
- package/dist/tooltip/parts.d.ts.map +1 -0
- package/dist/tooltip/parts.js +53 -0
- package/dist/tooltip/parts.js.map +1 -0
- package/dist/tooltip/tooltip.css +64 -0
- package/dist/tooltip/tooltip.d.ts +22 -0
- package/dist/tooltip/tooltip.d.ts.map +1 -0
- package/dist/tooltip/tooltip.js +23 -0
- package/dist/tooltip/tooltip.js.map +1 -0
- package/dist/tooltip/tooltip.module.css.d.ts +2 -0
- package/dist/tooltip/tooltip.module.js +10 -0
- package/dist/tooltip/tooltip.module.js.map +1 -0
- package/package.json +137 -4
- package/src/accordion/accordion.module.css +89 -0
- package/src/accordion/accordion.tsx +50 -0
- package/src/accordion/index.ts +6 -0
- package/src/accordion/parts.tsx +68 -0
- package/src/badge/badge.module.css +70 -0
- package/src/badge/badge.tsx +19 -0
- package/src/badge/index.ts +3 -0
- package/src/button/button.module.css +265 -0
- package/src/button/button.tsx +67 -0
- package/src/button/index.ts +3 -0
- package/src/card/card.module.css +67 -0
- package/src/card/card.tsx +54 -0
- package/src/card/index.ts +3 -0
- package/src/checkbox/checkbox.module.css +80 -0
- package/src/checkbox/checkbox.tsx +38 -0
- package/src/checkbox/index.ts +6 -0
- package/src/checkbox/parts.tsx +54 -0
- package/src/collapsible/collapsible.module.css +94 -0
- package/src/collapsible/collapsible.tsx +38 -0
- package/src/collapsible/index.ts +6 -0
- package/src/collapsible/parts.tsx +52 -0
- package/src/css.d.ts +8 -0
- package/src/dialog/dialog.module.css +123 -0
- package/src/dialog/dialog.tsx +60 -0
- package/src/dialog/index.ts +13 -0
- package/src/dialog/parts.tsx +96 -0
- package/src/drawer/drawer.module.css +289 -0
- package/src/drawer/drawer.tsx +96 -0
- package/src/drawer/index.ts +24 -0
- package/src/drawer/parts.tsx +122 -0
- package/src/index.ts +189 -0
- package/src/input/index.ts +3 -0
- package/src/input/input.module.css +109 -0
- package/src/input/input.tsx +39 -0
- package/src/menu/index.ts +7 -0
- package/src/menu/menu.module.css +172 -0
- package/src/menu/menu.tsx +108 -0
- package/src/menu/menuitemshortcut.tsx +9 -0
- package/src/menu/parts.tsx +90 -0
- package/src/number-field/index.ts +20 -0
- package/src/number-field/number-field.module.css +114 -0
- package/src/number-field/number-field.tsx +75 -0
- package/src/number-field/parts.tsx +91 -0
- package/src/progress/index.ts +6 -0
- package/src/progress/parts.tsx +51 -0
- package/src/progress/progress.module.css +70 -0
- package/src/progress/progress.tsx +42 -0
- package/src/select/index.ts +30 -0
- package/src/select/parts.tsx +171 -0
- package/src/select/select.module.css +167 -0
- package/src/select/select.tsx +89 -0
- package/src/separator/index.ts +3 -0
- package/src/separator/separator.module.css +18 -0
- package/src/separator/separator.tsx +20 -0
- package/src/styles/reset.css +91 -0
- package/src/styles/tailwind-theme.css +142 -0
- package/src/styles/tokens.css +400 -0
- package/src/switch/index.ts +6 -0
- package/src/switch/parts.tsx +44 -0
- package/src/switch/switch.module.css +67 -0
- package/src/switch/switch.tsx +33 -0
- package/src/tabs/index.ts +6 -0
- package/src/tabs/parts.tsx +48 -0
- package/src/tabs/tabs.module.css +92 -0
- package/src/tabs/tabs.tsx +48 -0
- package/src/toast/index.ts +6 -0
- package/src/toast/parts.tsx +76 -0
- package/src/toast/toast.module.css +252 -0
- package/src/toast/toast.tsx +129 -0
- package/src/tooltip/index.ts +6 -0
- package/src/tooltip/parts.tsx +62 -0
- package/src/tooltip/tooltip.module.css +67 -0
- package/src/tooltip/tooltip.tsx +30 -0
package/README.md
ADDED
|
@@ -0,0 +1,736 @@
|
|
|
1
|
+
# @brijbyte/agentic-ui
|
|
2
|
+
|
|
3
|
+
A developer-focused React component library with a macOS/iOS-inspired aesthetic. Built on top of [`@base-ui/react`](https://base-ui.com) for accessible behaviour, styled with CSS modules under `@layer` rules so every component style is overridable downstream.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Design philosophy
|
|
8
|
+
|
|
9
|
+
- **Monospace-first UI.** All chrome (buttons, labels, inputs, badges) uses a monospace font stack — feels native in developer tools and dashboards.
|
|
10
|
+
- **Serif display font for headings.** Titles use Apple's "New York" serif with a graceful fallback chain, giving the macOS/iOS native feel.
|
|
11
|
+
- **Semantic CSS custom properties.** Every visual value — colour, spacing, radius, shadow, easing — is a CSS variable. Dark mode and per-app theming are done by re-declaring variables, not by shipping a separate stylesheet.
|
|
12
|
+
- **Generic styled parts.** Every complex component exports both a high-level wrapper _and_ individual styled primitives. You can swap in a raw `@base-ui/react` root while keeping the styled children — or the other way around.
|
|
13
|
+
- **CSS-free JS output.** The built JavaScript never imports CSS. You import the stylesheet yourself, explicitly. This is standards-compliant and works with any bundler.
|
|
14
|
+
- **Layered component styles.** Component CSS modules live in `@layer components`. Every module file begins with `@layer theme, base, components, utilities` — because bundlers like Vite can inject module CSS before the app's entry stylesheet loads. Without this per-file declaration the browser would see `@layer base` (from Tailwind's preflight) after `@layer components`, making preflight higher priority. The per-file declaration ensures the correct order is established whichever file the browser sees first.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pnpm add @brijbyte/agentic-ui @base-ui/react react react-dom
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Peer dependencies: `react ^19`, `react-dom ^19`.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## CSS setup
|
|
29
|
+
|
|
30
|
+
### Without Tailwind
|
|
31
|
+
|
|
32
|
+
**Option A — full bundle (simplest):** one import loads all tokens, resets, and component CSS:
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
// main.tsx / entry.ts
|
|
36
|
+
import "@brijbyte/agentic-ui/styles";
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
```css
|
|
40
|
+
@import "@brijbyte/agentic-ui/styles";
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**Option B — per-component (smallest bundle):** import tokens + reset once, then add one `/<name>.css` import per component you actually use:
|
|
44
|
+
|
|
45
|
+
```css
|
|
46
|
+
@import "@brijbyte/agentic-ui/tokens";
|
|
47
|
+
@import "@brijbyte/agentic-ui/reset";
|
|
48
|
+
|
|
49
|
+
/* One line per component you use */
|
|
50
|
+
@import "@brijbyte/agentic-ui/button.css";
|
|
51
|
+
@import "@brijbyte/agentic-ui/dialog.css";
|
|
52
|
+
@import "@brijbyte/agentic-ui/toast.css";
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Every component has a plain `/<name>.css` subpath export. The JS and CSS are always separate explicit imports — the JS module never auto-injects CSS.
|
|
56
|
+
|
|
57
|
+
### With Tailwind v4
|
|
58
|
+
|
|
59
|
+
```css
|
|
60
|
+
/* app/globals.css */
|
|
61
|
+
@import "tailwindcss";
|
|
62
|
+
|
|
63
|
+
@import "@brijbyte/agentic-ui/tokens";
|
|
64
|
+
@import "@brijbyte/agentic-ui/reset";
|
|
65
|
+
@import "@brijbyte/agentic-ui/tailwind-theme";
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
`tokens.css` declares `@layer theme, base, components, utilities` — the same order Tailwind v4 uses — so component styles in `@layer components` always beat preflight resets in `@layer base`, and Tailwind utilities in `@layer utilities` always beat component styles.
|
|
69
|
+
|
|
70
|
+
After this, every token is available as a Tailwind utility class:
|
|
71
|
+
|
|
72
|
+
| Token | Tailwind class | CSS output |
|
|
73
|
+
| ---------------------- | -------------------------- | ---------------------------------------- |
|
|
74
|
+
| `--color-bg-base` | `bg-bg-base` | `background-color: var(--color-bg-base)` |
|
|
75
|
+
| `--color-text-primary` | `text-text-primary` | `color: var(--color-text-primary)` |
|
|
76
|
+
| `--color-border-base` | `border-border-base` | `border-color: var(--color-border-base)` |
|
|
77
|
+
| `--color-accent` | `bg-accent`, `text-accent` | references live CSS variable |
|
|
78
|
+
| `--font-mono` | `font-mono` | `font-family: var(--font-mono)` |
|
|
79
|
+
| `--font-display` | `font-display` | `font-family: var(--font-display)` |
|
|
80
|
+
| `--radius-md` | `rounded-md` | `border-radius: var(--radius-md)` |
|
|
81
|
+
| `--shadow-sm` | `shadow-sm` | `box-shadow: var(--shadow-sm)` |
|
|
82
|
+
|
|
83
|
+
Because `@theme inline` references live CSS variables (not baked-in values), **dark mode switches automatically** — no `dark:` prefix, no extra configuration.
|
|
84
|
+
|
|
85
|
+
> The `tailwind-theme` file contains `@theme inline {}` which is a Tailwind directive, not plain CSS. It must be processed by your Tailwind pipeline (`@tailwindcss/vite` or `@tailwindcss/postcss`).
|
|
86
|
+
|
|
87
|
+
### CSS layer order
|
|
88
|
+
|
|
89
|
+
Every component CSS module file begins with:
|
|
90
|
+
|
|
91
|
+
```css
|
|
92
|
+
@layer theme, base, components, utilities;
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
This declaration appears at the top of each `.module.css` file rather than only in an entry stylesheet. The reason: bundlers like Vite inject CSS module files into the document asynchronously and potentially **before** the app's entry CSS (`styles.css`) loads. If a module file declares `@layer components { ... }` without first establishing the full order, the browser would later see `@layer base` from Tailwind's preflight and treat it as higher priority — causing preflight resets like `* { border: 0 solid }` to override component styles.
|
|
96
|
+
|
|
97
|
+
By placing the full layer declaration in every module file, the correct cascade order is fixed whichever file the browser processes first:
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
@layer theme ← Tailwind defaults
|
|
101
|
+
@layer base ← tokens + element resets + Tailwind preflight (lowest priority)
|
|
102
|
+
@layer components ← component CSS modules (beat base)
|
|
103
|
+
@layer utilities ← Tailwind utilities (beat everything)
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Subsequent declarations of the same order (from `tailwindcss`, `tokens.css`, or other files) are harmless — CSS only honours the **first** time each layer name appears in an ordering statement.
|
|
107
|
+
|
|
108
|
+
### Dark mode
|
|
109
|
+
|
|
110
|
+
Tokens adapt automatically via `prefers-color-scheme`. To override programmatically, set `data-theme` on `<html>`:
|
|
111
|
+
|
|
112
|
+
```ts
|
|
113
|
+
document.documentElement.dataset.theme = "light"; // force light
|
|
114
|
+
document.documentElement.dataset.theme = "dark"; // follow OS again
|
|
115
|
+
delete document.documentElement.dataset.theme; // follow OS again
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## Design tokens
|
|
121
|
+
|
|
122
|
+
All tokens are CSS custom properties defined at `:root` under `@layer base`. Override any of them after importing the stylesheet.
|
|
123
|
+
|
|
124
|
+
### Typography
|
|
125
|
+
|
|
126
|
+
```css
|
|
127
|
+
--font-display "New York", "Iowan Old Style", "Palatino Linotype", Georgia, serif
|
|
128
|
+
--font-mono "Berkeley Mono", "JetBrains Mono", "Fira Code", "SF Mono", "Menlo", ui-monospace
|
|
129
|
+
--font-sans -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
**`--font-display`** is used for `h1`–`h6` and prominent page titles.
|
|
133
|
+
**`--font-mono`** is used for all UI chrome — buttons, inputs, labels, badges, body text.
|
|
134
|
+
|
|
135
|
+
### Colour roles (semantic, light + dark)
|
|
136
|
+
|
|
137
|
+
Shadows are theme-aware — light mode uses low-opacity black shadows; dark mode automatically uses higher-opacity values so elevation is visible against dark surfaces.
|
|
138
|
+
|
|
139
|
+
| Token | Role |
|
|
140
|
+
| --------------------------------------------------------- | ------------------------------------------- |
|
|
141
|
+
| `--color-bg-base` | Page background |
|
|
142
|
+
| `--color-bg-elevated` | Cards, popovers |
|
|
143
|
+
| `--color-bg-overlay` | Backdrop-blurred surfaces |
|
|
144
|
+
| `--color-bg-sidebar` | Sidebar / navigation panels |
|
|
145
|
+
| `--color-surface-1/2/3` | Layered surface hierarchy |
|
|
146
|
+
| `--color-surface-hover/active/selected` | Interactive surface states |
|
|
147
|
+
| `--color-text-primary/secondary/tertiary/disabled` | Text hierarchy |
|
|
148
|
+
| `--color-text-on-accent` | Text on filled accent backgrounds |
|
|
149
|
+
| `--color-text-code` | Inline code text |
|
|
150
|
+
| `--color-border-base/strong/subtle` | Border hierarchy |
|
|
151
|
+
| `--color-accent` | macOS blue — solid interactive colour |
|
|
152
|
+
| `--color-accent-hover` | Accent on hover |
|
|
153
|
+
| `--color-accent-pressed` | Accent on press |
|
|
154
|
+
| `--color-accent-tint` | Subtle accent fill (badges, soft buttons) |
|
|
155
|
+
| `--color-accent-tint-hover` | Tint on hover |
|
|
156
|
+
| `--color-focus-ring` | Focus ring colour (semi-transparent accent) |
|
|
157
|
+
| `--color-success/warning/error/info-bg/border/text/solid` | Status colours |
|
|
158
|
+
|
|
159
|
+
Dark mode is handled by `@media (prefers-color-scheme: dark)` and `[data-theme="dark"]` on `<html>`.
|
|
160
|
+
|
|
161
|
+
### Spacing
|
|
162
|
+
|
|
163
|
+
Full 4 px grid with no gaps. Tokens: `--space-px` (1px), `--space-0-5` (2px), `--space-1` (4px), `--space-1-5` (6px), `--space-2` (8px), `--space-2-5` (10px), `--space-3` (12px), `--space-4` (16px), `--space-5` (20px), `--space-6` (24px), `--space-7` (28px), `--space-8` (32px), `--space-9` (36px), `--space-10` (40px) … `--space-24` (96px).
|
|
164
|
+
|
|
165
|
+
### Border radius
|
|
166
|
+
|
|
167
|
+
`--radius-none`, `--radius-sm` (4px), `--radius-md` (6px), `--radius-lg` (8px), `--radius-xl` (10px), `--radius-2xl` (12px), `--radius-full` (9999px).
|
|
168
|
+
|
|
169
|
+
### Border width
|
|
170
|
+
|
|
171
|
+
`--border-width-base` (1px), `--border-width-medium` (1.5px), `--border-width-thick` (2px).
|
|
172
|
+
|
|
173
|
+
### Shadows
|
|
174
|
+
|
|
175
|
+
Theme-aware — defined inside the light/dark token blocks so they adapt automatically.
|
|
176
|
+
|
|
177
|
+
`--shadow-xs/sm/md/lg/xl`, `--shadow-popover` (dropdown/tooltip), `--shadow-focus` (two-layer ring: offset gap + coloured ring), `--shadow-inset`.
|
|
178
|
+
|
|
179
|
+
`--shadow-focus` uses a two-layer technique: `0 0 0 2px --color-bg-base, 0 0 0 4px --color-focus-ring`. The inner ring punches a gap in the page background colour, making the focus ring clearly visible on any background — light or dark.
|
|
180
|
+
|
|
181
|
+
### Animation
|
|
182
|
+
|
|
183
|
+
```css
|
|
184
|
+
/* Durations */
|
|
185
|
+
--duration-fast 100ms
|
|
186
|
+
--duration-normal 150ms
|
|
187
|
+
--duration-slow 200ms
|
|
188
|
+
--duration-slower 300ms
|
|
189
|
+
|
|
190
|
+
/* Easings — use the right one for the job */
|
|
191
|
+
--easing-ease-out cubic-bezier(0, 0, 0.2, 1) /* entering elements — starts fast */
|
|
192
|
+
--easing-ease-in cubic-bezier(0.4, 0, 1, 1) /* exiting elements — ends fast */
|
|
193
|
+
--easing-standard cubic-bezier(0.4, 0, 0.2, 1) /* on-screen movement / morphing */
|
|
194
|
+
--easing-spring cubic-bezier(0.34, 1.56, 0.64, 1) /* playful / physics-based */
|
|
195
|
+
--easing-linear linear /* constant motion (spinners, progress) */
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### Z-index scale
|
|
199
|
+
|
|
200
|
+
`--z-dropdown` (100), `--z-sticky` (200), `--z-overlay` (300), `--z-modal` (400), `--z-popover` (500), `--z-toast` (600), `--z-tooltip` (700).
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## Package exports
|
|
205
|
+
|
|
206
|
+
```
|
|
207
|
+
@brijbyte/agentic-ui ← barrel (all components + StylesObjects)
|
|
208
|
+
|
|
209
|
+
CSS bundles
|
|
210
|
+
@brijbyte/agentic-ui/styles ← full bundle: tokens + reset + all components
|
|
211
|
+
@brijbyte/agentic-ui/tokens ← CSS custom properties only (required)
|
|
212
|
+
@brijbyte/agentic-ui/reset ← element resets only (required)
|
|
213
|
+
@brijbyte/agentic-ui/tailwind-theme ← @theme inline block for Tailwind v4
|
|
214
|
+
|
|
215
|
+
Per-component JS (also exports <Name>Styles class-name map)
|
|
216
|
+
@brijbyte/agentic-ui/accordion @brijbyte/agentic-ui/menu
|
|
217
|
+
@brijbyte/agentic-ui/badge @brijbyte/agentic-ui/number-field
|
|
218
|
+
@brijbyte/agentic-ui/button @brijbyte/agentic-ui/progress
|
|
219
|
+
@brijbyte/agentic-ui/card @brijbyte/agentic-ui/select
|
|
220
|
+
@brijbyte/agentic-ui/checkbox @brijbyte/agentic-ui/separator
|
|
221
|
+
@brijbyte/agentic-ui/collapsible @brijbyte/agentic-ui/switch
|
|
222
|
+
@brijbyte/agentic-ui/dialog @brijbyte/agentic-ui/tabs
|
|
223
|
+
@brijbyte/agentic-ui/drawer @brijbyte/agentic-ui/toast
|
|
224
|
+
@brijbyte/agentic-ui/input @brijbyte/agentic-ui/tooltip
|
|
225
|
+
|
|
226
|
+
Per-component CSS (/<name>.css mirrors each JS subpath)
|
|
227
|
+
@brijbyte/agentic-ui/accordion.css @brijbyte/agentic-ui/menu.css
|
|
228
|
+
@brijbyte/agentic-ui/badge.css @brijbyte/agentic-ui/number-field.css
|
|
229
|
+
@brijbyte/agentic-ui/button.css @brijbyte/agentic-ui/progress.css
|
|
230
|
+
@brijbyte/agentic-ui/card.css @brijbyte/agentic-ui/select.css
|
|
231
|
+
@brijbyte/agentic-ui/checkbox.css @brijbyte/agentic-ui/separator.css
|
|
232
|
+
@brijbyte/agentic-ui/collapsible.css @brijbyte/agentic-ui/switch.css
|
|
233
|
+
@brijbyte/agentic-ui/dialog.css @brijbyte/agentic-ui/tabs.css
|
|
234
|
+
@brijbyte/agentic-ui/drawer.css @brijbyte/agentic-ui/toast.css
|
|
235
|
+
@brijbyte/agentic-ui/input.css @brijbyte/agentic-ui/tooltip.css
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## Components
|
|
241
|
+
|
|
242
|
+
Each component is available at its own deep-import path for tree-shaking:
|
|
243
|
+
|
|
244
|
+
```ts
|
|
245
|
+
import { Button } from "@brijbyte/agentic-ui/button";
|
|
246
|
+
import { Dialog, DialogPopup, DialogTitle } from "@brijbyte/agentic-ui/dialog";
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
Or import everything from the barrel (convenient for prototyping):
|
|
250
|
+
|
|
251
|
+
```ts
|
|
252
|
+
import { Button, Dialog, Input } from "@brijbyte/agentic-ui";
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
### Component list
|
|
256
|
+
|
|
257
|
+
| Import path | High-level wrapper | Styled parts |
|
|
258
|
+
| --------------- | --------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
259
|
+
| `/accordion` | `Accordion` | `AccordionItemPart`, `AccordionHeader`, `AccordionTrigger`, `AccordionPanel` |
|
|
260
|
+
| `/badge` | `Badge` | — |
|
|
261
|
+
| `/button` | `Button` | — |
|
|
262
|
+
| `/card` | `Card`, `CardHeader`, `CardBody`, `CardFooter` | — |
|
|
263
|
+
| `/checkbox` | `Checkbox` | `CheckboxRoot`, `CheckboxIndicator` |
|
|
264
|
+
| `/collapsible` | `Collapsible` | `CollapsibleRoot`, `CollapsibleTrigger`, `CollapsiblePanel` |
|
|
265
|
+
| `/dialog` | `Dialog` | `DialogBackdrop`, `DialogViewport`, `DialogPopup`, `DialogTitle`, `DialogDescription`, `DialogClose` |
|
|
266
|
+
| `/drawer` | `Drawer` | `DrawerBackdrop`, `DrawerViewport`, `DrawerPopup`, `DrawerContent`, `DrawerTitle`, `DrawerDescription`, `DrawerClose`, `DrawerHandleBar`, `DrawerFooter` |
|
|
267
|
+
| `/input` | `Input` | — |
|
|
268
|
+
| `/menu` | `Menu` | `MenuPositioner`, `MenuPopup`, `MenuItem`, `MenuSeparator`, `MenuGroupLabel`, `MenuArrow`, `MenuItemShortcut` |
|
|
269
|
+
| `/number-field` | `NumberField` | `NumberFieldGroup`, `NumberFieldInput`, `NumberFieldDecrement`, `NumberFieldIncrement`, `NumberFieldScrubArea`, `NumberFieldScrubAreaCursor` |
|
|
270
|
+
| `/progress` | `Progress` | `ProgressTrack`, `ProgressIndicator` |
|
|
271
|
+
| `/select` | `Select` | `SelectTrigger`, `SelectValue`, `SelectPositioner`, `SelectPopup`, `SelectList`, `SelectItem`, `SelectItemText`, `SelectItemIndicator`, `SelectGroupContainer`, `SelectGroupLabel`, `SelectSeparator` |
|
|
272
|
+
| `/separator` | `Separator` | — |
|
|
273
|
+
| `/switch` | `Switch` | `SwitchRoot`, `SwitchThumb` |
|
|
274
|
+
| `/tabs` | `Tabs` | `TabsList`, `TabsTab`, `TabsPanel` |
|
|
275
|
+
| `/toast` | `ToastViewport`, `ToastProvider`, `useToastManager` | `ToastRoot`, `ToastTitle`, `ToastDescription`, `ToastClose`, `ToastViewportPart` |
|
|
276
|
+
| `/tooltip` | `Tooltip` | `TooltipPositioner`, `TooltipPopup`, `TooltipArrow` |
|
|
277
|
+
|
|
278
|
+
Every deep-import path also exports a `<ComponentName>Styles` object — the CSS module class name map. See [Accessing class names](#accessing-class-names).
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## Usage patterns
|
|
283
|
+
|
|
284
|
+
### High-level wrapper (batteries included)
|
|
285
|
+
|
|
286
|
+
```tsx
|
|
287
|
+
import "@brijbyte/agentic-ui/styles";
|
|
288
|
+
import { Button } from "@brijbyte/agentic-ui/button";
|
|
289
|
+
import { Dialog } from "@brijbyte/agentic-ui/dialog";
|
|
290
|
+
|
|
291
|
+
<Button variant="solid" tone="primary" size="md">Deploy</Button>
|
|
292
|
+
|
|
293
|
+
<Dialog
|
|
294
|
+
trigger={<Button>Open settings</Button>}
|
|
295
|
+
title="API Settings"
|
|
296
|
+
description="Configure your endpoint."
|
|
297
|
+
footer={<Button size="sm">Save</Button>}
|
|
298
|
+
>
|
|
299
|
+
<Input placeholder="https://api.example.com" />
|
|
300
|
+
</Dialog>
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
### Composed: raw base-ui root + styled parts
|
|
304
|
+
|
|
305
|
+
Use a raw `@base-ui/react` Root for full control over behaviour (controlled state, custom refs, delays), while keeping all the pre-styled child parts:
|
|
306
|
+
|
|
307
|
+
```tsx
|
|
308
|
+
import * as BaseDialog from "@base-ui/react/dialog";
|
|
309
|
+
import { DialogBackdrop, DialogViewport, DialogPopup, DialogTitle, DialogClose } from "@brijbyte/agentic-ui/dialog";
|
|
310
|
+
|
|
311
|
+
<BaseDialog.Root open={open} onOpenChange={setOpen}>
|
|
312
|
+
<BaseDialog.Trigger render={<button>Open</button>} />
|
|
313
|
+
<BaseDialog.Portal>
|
|
314
|
+
<DialogBackdrop />
|
|
315
|
+
<BaseDialog.Viewport>
|
|
316
|
+
<DialogPopup>
|
|
317
|
+
<DialogTitle>Custom Dialog</DialogTitle>
|
|
318
|
+
<DialogClose aria-label="Close">✕</DialogClose>
|
|
319
|
+
{children}
|
|
320
|
+
</DialogPopup>
|
|
321
|
+
</BaseDialog.Viewport>
|
|
322
|
+
</BaseDialog.Portal>
|
|
323
|
+
</BaseDialog.Root>;
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
The same pattern applies to every component with sub-parts.
|
|
327
|
+
|
|
328
|
+
### Overriding component styles
|
|
329
|
+
|
|
330
|
+
Every styled part accepts `className`. Add your own classes — they append after the built-in ones. Because component styles live in `@layer components`, any `@layer utilities` rule or unlayered rule you write will win in the cascade.
|
|
331
|
+
|
|
332
|
+
```tsx
|
|
333
|
+
<Button className="my-custom-button">Click</Button>
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
```css
|
|
337
|
+
/* utility class → beats @layer components */
|
|
338
|
+
.my-custom-button {
|
|
339
|
+
border-radius: 0;
|
|
340
|
+
}
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
### Overriding tokens
|
|
344
|
+
|
|
345
|
+
Re-declare any CSS variable after importing the library stylesheet:
|
|
346
|
+
|
|
347
|
+
```css
|
|
348
|
+
@import "@brijbyte/agentic-ui/styles";
|
|
349
|
+
|
|
350
|
+
:root {
|
|
351
|
+
--font-mono: "Cascadia Code", monospace; /* swap the mono font */
|
|
352
|
+
--color-accent: #7c3aed; /* purple accent instead of blue */
|
|
353
|
+
--radius-md: 2px; /* sharper corners */
|
|
354
|
+
}
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
### Accessing class names
|
|
358
|
+
|
|
359
|
+
Every deep-import path exports a `<ComponentName>Styles` object — the CSS module class name map. Keys are the local names from source, values are the hashed runtime names. Useful for tests, runtime class lookups, or extending styles:
|
|
360
|
+
|
|
361
|
+
```ts
|
|
362
|
+
import { ButtonStyles } from "@brijbyte/agentic-ui/button";
|
|
363
|
+
|
|
364
|
+
// In a test — assert a class was applied
|
|
365
|
+
expect(el.className).toContain(ButtonStyles.root);
|
|
366
|
+
|
|
367
|
+
// At runtime — read the hashed name
|
|
368
|
+
const solidClass = ButtonStyles["variant-solid"]; // → "variant-solid_a1b2c3d4"
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
---
|
|
372
|
+
|
|
373
|
+
## Components reference
|
|
374
|
+
|
|
375
|
+
### Button
|
|
376
|
+
|
|
377
|
+
```tsx
|
|
378
|
+
import { Button } from "@brijbyte/agentic-ui/button";
|
|
379
|
+
|
|
380
|
+
// variant: solid | soft | outline | ghost
|
|
381
|
+
// tone: primary | secondary | destructive | success | warning
|
|
382
|
+
// size: xs | sm | md | lg
|
|
383
|
+
<Button variant="solid" tone="primary" size="md">Deploy</Button>
|
|
384
|
+
<Button variant="soft" tone="destructive">Delete</Button>
|
|
385
|
+
<Button variant="outline" size="sm" loading>Saving…</Button>
|
|
386
|
+
<Button variant="ghost" loading loadingText="Deploying…">Deploy</Button>
|
|
387
|
+
<Button variant="soft" nativeButton={false} render={<a href="/docs" />}>Docs</Button>
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
**`variant`** controls visual shape — `solid` (filled), `soft` (tinted), `outline` (bordered), `ghost` (borderless).
|
|
391
|
+
|
|
392
|
+
**`tone`** controls semantic colour — any tone works with any variant:
|
|
393
|
+
|
|
394
|
+
| Tone | Use case |
|
|
395
|
+
| ------------- | ------------------------------- |
|
|
396
|
+
| `primary` | Default. Primary action |
|
|
397
|
+
| `secondary` | Neutral / less prominent action |
|
|
398
|
+
| `destructive` | Irreversible / dangerous action |
|
|
399
|
+
| `success` | Confirm / complete action |
|
|
400
|
+
| `warning` | Caution required |
|
|
401
|
+
|
|
402
|
+
**`loading`** disables the button and shows a centred spinner. The button width stays stable — children are hidden with `visibility: hidden` so they still contribute to layout.
|
|
403
|
+
|
|
404
|
+
**`loadingText`** overrides the stable-width behaviour. When set, children swap to this text during loading (no spinner). Use when the loading state needs to communicate progress via text.
|
|
405
|
+
|
|
406
|
+
**`render`** passes through to `@base-ui/react` Button's `render` prop — use it to render an `<a>` or any custom element while keeping button behaviour. Set `nativeButton={false}` when rendering a non-`<button>` element.
|
|
407
|
+
|
|
408
|
+
### Badge
|
|
409
|
+
|
|
410
|
+
```tsx
|
|
411
|
+
import { Badge } from "@brijbyte/agentic-ui/badge";
|
|
412
|
+
|
|
413
|
+
// variants: default | solid | soft | success | warning | error | info
|
|
414
|
+
<Badge variant="success" dot>Active</Badge>
|
|
415
|
+
<Badge variant="error">Failed</Badge>
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
`dot` shows a small coloured dot before the label text.
|
|
419
|
+
|
|
420
|
+
### Input
|
|
421
|
+
|
|
422
|
+
```tsx
|
|
423
|
+
import { Input } from "@brijbyte/agentic-ui/input";
|
|
424
|
+
|
|
425
|
+
// sizes: sm | md | lg
|
|
426
|
+
<Input size="md" placeholder="Search…" leftAdornment={<SearchIcon />} />
|
|
427
|
+
<Input invalid defaultValue="bad-value" />
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
`size` overrides the native HTML `size` attribute — it maps to height and font-size design tokens.
|
|
431
|
+
|
|
432
|
+
### Checkbox
|
|
433
|
+
|
|
434
|
+
```tsx
|
|
435
|
+
import { Checkbox, CheckboxRoot, CheckboxIndicator } from "@brijbyte/agentic-ui/checkbox";
|
|
436
|
+
|
|
437
|
+
// High-level
|
|
438
|
+
<Checkbox checked={val} onCheckedChange={(v) => setVal(v as boolean)}>
|
|
439
|
+
Accept terms
|
|
440
|
+
</Checkbox>
|
|
441
|
+
|
|
442
|
+
// Composed — custom icon
|
|
443
|
+
<label htmlFor="cb">
|
|
444
|
+
<CheckboxRoot id="cb">
|
|
445
|
+
<CheckboxIndicator>
|
|
446
|
+
<StarIcon />
|
|
447
|
+
</CheckboxIndicator>
|
|
448
|
+
</CheckboxRoot>
|
|
449
|
+
Favourite
|
|
450
|
+
</label>
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
### Switch
|
|
454
|
+
|
|
455
|
+
```tsx
|
|
456
|
+
import { Switch } from "@brijbyte/agentic-ui/switch";
|
|
457
|
+
|
|
458
|
+
<Switch checked={enabled} onCheckedChange={(v) => setEnabled(v as boolean)}>
|
|
459
|
+
Enable notifications
|
|
460
|
+
</Switch>;
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
### Select
|
|
464
|
+
|
|
465
|
+
```tsx
|
|
466
|
+
import { Select } from "@brijbyte/agentic-ui/select";
|
|
467
|
+
|
|
468
|
+
<Select
|
|
469
|
+
placeholder="Choose a model…"
|
|
470
|
+
options={[
|
|
471
|
+
{ value: "claude-3-5-sonnet", label: "Claude 3.5 Sonnet" },
|
|
472
|
+
{ value: "gpt-4o", label: "GPT-4o", disabled: true },
|
|
473
|
+
]}
|
|
474
|
+
onValueChange={(v) => console.log(v)}
|
|
475
|
+
/>
|
|
476
|
+
|
|
477
|
+
// With groups
|
|
478
|
+
<Select
|
|
479
|
+
groups={[
|
|
480
|
+
{ label: "Anthropic", options: [{ value: "claude", label: "Claude" }] },
|
|
481
|
+
{ label: "OpenAI", options: [{ value: "gpt", label: "GPT" }] },
|
|
482
|
+
]}
|
|
483
|
+
/>
|
|
484
|
+
```
|
|
485
|
+
|
|
486
|
+
### Dialog
|
|
487
|
+
|
|
488
|
+
```tsx
|
|
489
|
+
import { Dialog } from "@brijbyte/agentic-ui/dialog";
|
|
490
|
+
|
|
491
|
+
<Dialog
|
|
492
|
+
trigger={<Button>Open</Button>}
|
|
493
|
+
title="Confirm deletion"
|
|
494
|
+
description="This cannot be undone."
|
|
495
|
+
footer={
|
|
496
|
+
<>
|
|
497
|
+
<Button variant="ghost" size="sm">
|
|
498
|
+
Cancel
|
|
499
|
+
</Button>
|
|
500
|
+
<Button variant="solid" tone="destructive" size="sm">
|
|
501
|
+
Delete
|
|
502
|
+
</Button>
|
|
503
|
+
</>
|
|
504
|
+
}
|
|
505
|
+
>
|
|
506
|
+
Optional body content
|
|
507
|
+
</Dialog>;
|
|
508
|
+
```
|
|
509
|
+
|
|
510
|
+
### Drawer
|
|
511
|
+
|
|
512
|
+
```tsx
|
|
513
|
+
import { Drawer, DrawerClose } from "@brijbyte/agentic-ui/drawer";
|
|
514
|
+
|
|
515
|
+
// sides: left | right (default) | top | bottom
|
|
516
|
+
// Supports swipe-to-dismiss gestures on all sides.
|
|
517
|
+
<Drawer
|
|
518
|
+
side="right"
|
|
519
|
+
trigger={<Button>Open</Button>}
|
|
520
|
+
title="Settings"
|
|
521
|
+
description="Configure your workspace."
|
|
522
|
+
footer={
|
|
523
|
+
<Button size="sm" render={<DrawerClose />}>
|
|
524
|
+
Done
|
|
525
|
+
</Button>
|
|
526
|
+
}
|
|
527
|
+
>
|
|
528
|
+
Content goes here
|
|
529
|
+
</Drawer>;
|
|
530
|
+
```
|
|
531
|
+
|
|
532
|
+
### Tooltip
|
|
533
|
+
|
|
534
|
+
```tsx
|
|
535
|
+
import { Tooltip } from "@brijbyte/agentic-ui/tooltip";
|
|
536
|
+
|
|
537
|
+
// side: top | bottom | left | right (default: "top")
|
|
538
|
+
<Tooltip content="Keyboard shortcut: ⌘K" side="bottom">
|
|
539
|
+
<Button variant="ghost">Open palette</Button>
|
|
540
|
+
</Tooltip>;
|
|
541
|
+
```
|
|
542
|
+
|
|
543
|
+
Tooltips animate from their trigger's origin using Base UI's `--transform-origin` CSS variable. When the user moves quickly between multiple tooltips, subsequent ones appear instantly (no animation delay) via the `data-instant` attribute.
|
|
544
|
+
|
|
545
|
+
### Tabs
|
|
546
|
+
|
|
547
|
+
```tsx
|
|
548
|
+
import { Tabs } from "@brijbyte/agentic-ui/tabs";
|
|
549
|
+
|
|
550
|
+
<Tabs
|
|
551
|
+
items={[
|
|
552
|
+
{ value: "overview", label: "Overview", content: <OverviewPanel /> },
|
|
553
|
+
{ value: "api", label: "API", content: <ApiPanel /> },
|
|
554
|
+
{ value: "old", label: "Legacy", content: null, disabled: true },
|
|
555
|
+
]}
|
|
556
|
+
/>;
|
|
557
|
+
```
|
|
558
|
+
|
|
559
|
+
The active tab is indicated by a 3px accent-coloured underline and full-brightness text vs dimmed inactive tabs. Tab panels fade in on switch.
|
|
560
|
+
|
|
561
|
+
### Accordion
|
|
562
|
+
|
|
563
|
+
```tsx
|
|
564
|
+
import { Accordion } from "@brijbyte/agentic-ui/accordion";
|
|
565
|
+
|
|
566
|
+
// multiple: true (default) allows multiple panels open at once
|
|
567
|
+
<Accordion
|
|
568
|
+
multiple={false}
|
|
569
|
+
items={[
|
|
570
|
+
{ value: "q1", header: "What is it?", content: "…" },
|
|
571
|
+
{ value: "q2", header: "How does it work?", content: "…" },
|
|
572
|
+
]}
|
|
573
|
+
/>;
|
|
574
|
+
```
|
|
575
|
+
|
|
576
|
+
### Collapsible
|
|
577
|
+
|
|
578
|
+
```tsx
|
|
579
|
+
import { Collapsible } from "@brijbyte/agentic-ui/collapsible";
|
|
580
|
+
|
|
581
|
+
<Collapsible trigger="Recovery keys" defaultOpen>
|
|
582
|
+
<div>alien-bean-pasta</div>
|
|
583
|
+
<div>wild-irish-burrito</div>
|
|
584
|
+
</Collapsible>;
|
|
585
|
+
```
|
|
586
|
+
|
|
587
|
+
When open, the trigger's bottom corners square off and connect flush with the content panel. When closing, the corners only round back after the panel has fully collapsed — no visible seam at any point during the animation.
|
|
588
|
+
|
|
589
|
+
### Menu
|
|
590
|
+
|
|
591
|
+
```tsx
|
|
592
|
+
import { Menu } from "@brijbyte/agentic-ui/menu";
|
|
593
|
+
import type { MenuEntry } from "@brijbyte/agentic-ui/menu";
|
|
594
|
+
|
|
595
|
+
const items: MenuEntry[] = [
|
|
596
|
+
{ label: "Edit", shortcut: "⌘E", onSelect: () => {} },
|
|
597
|
+
{ label: "Rename", shortcut: "⌘R", onSelect: () => {} },
|
|
598
|
+
{ type: "separator" },
|
|
599
|
+
{ label: "Delete", onSelect: () => {}, disabled: true },
|
|
600
|
+
];
|
|
601
|
+
|
|
602
|
+
<Menu
|
|
603
|
+
trigger={
|
|
604
|
+
<Button variant="outline" size="sm">
|
|
605
|
+
Actions ▾
|
|
606
|
+
</Button>
|
|
607
|
+
}
|
|
608
|
+
items={items}
|
|
609
|
+
/>;
|
|
610
|
+
```
|
|
611
|
+
|
|
612
|
+
Supports `type: "group"` entries with an optional `label` for grouped sections. The popup uses backdrop blur and the highlight uses inset rounded corners — matching macOS native menu aesthetics.
|
|
613
|
+
|
|
614
|
+
### NumberField
|
|
615
|
+
|
|
616
|
+
```tsx
|
|
617
|
+
import { NumberField } from "@brijbyte/agentic-ui/number-field";
|
|
618
|
+
|
|
619
|
+
<NumberField label="Quantity" defaultValue={1} min={0} max={100} />
|
|
620
|
+
<NumberField label="Price" defaultValue={9.99} step={0.01} format={{ style: "currency", currency: "USD" }} />
|
|
621
|
+
```
|
|
622
|
+
|
|
623
|
+
Click-and-drag on the label (scrub area) to change the value. Supports `min`, `max`, `step`, locale-aware `format`, and `allowWheelScrub`.
|
|
624
|
+
|
|
625
|
+
### Separator
|
|
626
|
+
|
|
627
|
+
```tsx
|
|
628
|
+
import { Separator } from "@brijbyte/agentic-ui/separator";
|
|
629
|
+
|
|
630
|
+
// Horizontal (default)
|
|
631
|
+
<Separator />
|
|
632
|
+
|
|
633
|
+
// Vertical — stretch to parent height
|
|
634
|
+
<Separator orientation="vertical" style={{ height: "1rem" }} />
|
|
635
|
+
```
|
|
636
|
+
|
|
637
|
+
### Progress
|
|
638
|
+
|
|
639
|
+
```tsx
|
|
640
|
+
import { Progress } from "@brijbyte/agentic-ui/progress";
|
|
641
|
+
|
|
642
|
+
// status: default | success | warning | error
|
|
643
|
+
// size: sm | md | lg
|
|
644
|
+
<Progress value={72} max={100} label="Uploading" showValue status="success" />
|
|
645
|
+
<Progress value={null} label="Loading…" /> {/* indeterminate — linear animation */}
|
|
646
|
+
```
|
|
647
|
+
|
|
648
|
+
### Toast
|
|
649
|
+
|
|
650
|
+
```tsx
|
|
651
|
+
import { ToastProvider, ToastViewport, useToastManager } from "@brijbyte/agentic-ui/toast";
|
|
652
|
+
|
|
653
|
+
// 1. Wrap your app — limit defaults to 3 (list) or 5 (stacked)
|
|
654
|
+
<ToastProvider variant="list">
|
|
655
|
+
<App />
|
|
656
|
+
<ToastViewport variant="list" />
|
|
657
|
+
</ToastProvider>;
|
|
658
|
+
|
|
659
|
+
// 2. Trigger from anywhere
|
|
660
|
+
function MyComponent() {
|
|
661
|
+
const toast = useToastManager();
|
|
662
|
+
toast.add({
|
|
663
|
+
title: "Deployed",
|
|
664
|
+
description: "Your app is live.",
|
|
665
|
+
type: "success", // default | success | warning | error | info
|
|
666
|
+
});
|
|
667
|
+
}
|
|
668
|
+
```
|
|
669
|
+
|
|
670
|
+
**`variant="stacked"`** — Sonner-style stacked toasts. Collapsed: toasts fan behind each other (scaled + nudged). Hover/focus expands the stack into a list. Hover gaps between toasts are filled so the stack doesn't collapse mid-hover.
|
|
671
|
+
|
|
672
|
+
```tsx
|
|
673
|
+
<ToastProvider variant="stacked">
|
|
674
|
+
<App />
|
|
675
|
+
<ToastViewport variant="stacked" />
|
|
676
|
+
</ToastProvider>
|
|
677
|
+
```
|
|
678
|
+
|
|
679
|
+
**`limit`** — maximum toasts shown simultaneously. Defaults to `3` for `list`, `5` for `stacked`. Hard-capped at `5` (list) and `10` (stacked) regardless of what is passed, to prevent viewport overflow.
|
|
680
|
+
|
|
681
|
+
Each toast type gets a subtle tinted background (`color-mix` of the status colour into the overlay) so variants are distinguishable without relying solely on the icon.
|
|
682
|
+
|
|
683
|
+
---
|
|
684
|
+
|
|
685
|
+
## Build system
|
|
686
|
+
|
|
687
|
+
Built with **[tsdown](https://tsdown.dev)** (powered by Rolldown + Lightning CSS).
|
|
688
|
+
|
|
689
|
+
```bash
|
|
690
|
+
pnpm build # tsdown → dist/
|
|
691
|
+
pnpm dev # tsdown --watch
|
|
692
|
+
```
|
|
693
|
+
|
|
694
|
+
### Output
|
|
695
|
+
|
|
696
|
+
```
|
|
697
|
+
dist/
|
|
698
|
+
index.js ← ESM barrel, no CSS imports
|
|
699
|
+
index.d.ts ← Type declarations
|
|
700
|
+
index.css ← All CSS: tokens + reset + every component
|
|
701
|
+
tokens.css ← Tokens only (for Tailwind setups)
|
|
702
|
+
reset.css ← Reset only (for Tailwind setups)
|
|
703
|
+
tailwind-theme.css ← @theme inline block for Tailwind v4
|
|
704
|
+
button/index.js ← Per-component ESM (no CSS imports)
|
|
705
|
+
button/index.d.ts
|
|
706
|
+
button/button.css ← Per-component plain CSS (no .module suffix)
|
|
707
|
+
… ← All 18 components follow the same pattern
|
|
708
|
+
```
|
|
709
|
+
|
|
710
|
+
### Two-pass build
|
|
711
|
+
|
|
712
|
+
The config runs two tsdown passes:
|
|
713
|
+
|
|
714
|
+
1. **Pass 1** — JS + DTS + `dist/index.css` (all CSS bundled into one file).
|
|
715
|
+
2. **Pass 2** — per-component split CSS. Each component's CSS is written to `dist/<name>/<Name>.css`. An `onSuccess` hook renames `*.module.css` output files to `*.css` (tsdown's CSS modules plugin requires `.module.css` source files, but consumers should see plain `.css`).
|
|
716
|
+
|
|
717
|
+
### Why no CSS in JS?
|
|
718
|
+
|
|
719
|
+
`@tsdown/css` with `inject: false` extracts all CSS to separate files and writes zero `import '…css'` statements into JS. Class name mappings from CSS modules are inlined into JS chunks as plain objects — the JS is self-contained, the CSS is an explicit dependency you control.
|
|
720
|
+
|
|
721
|
+
---
|
|
722
|
+
|
|
723
|
+
## Tooling
|
|
724
|
+
|
|
725
|
+
| Tool | Purpose |
|
|
726
|
+
| ------------------------------------- | ------------------------------------------ |
|
|
727
|
+
| `tsdown` | Library bundler (Rolldown + Lightning CSS) |
|
|
728
|
+
| `@typescript/native-preview` (`tsgo`) | Fast TypeScript type checking |
|
|
729
|
+
| `oxlint` | ESLint-compatible linter |
|
|
730
|
+
| `oxfmt` | Opinionated formatter |
|
|
731
|
+
|
|
732
|
+
```bash
|
|
733
|
+
pnpm typecheck # tsgo --noEmit across all packages
|
|
734
|
+
pnpm lint # oxlint packages/agentic-ui/src apps/docs/src
|
|
735
|
+
pnpm format # oxfmt packages/agentic-ui/src apps/docs/src
|
|
736
|
+
```
|