@brijbyte/agentic-ui 0.0.3 → 0.0.4
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 +132 -35
- package/dist/accordion/accordion.d.ts +14 -0
- package/dist/accordion/accordion.d.ts.map +1 -1
- package/dist/accordion/accordion.js +5 -0
- package/dist/accordion/accordion.js.map +1 -1
- package/dist/alert-dialog/alert-dialog.d.ts +11 -0
- package/dist/alert-dialog/alert-dialog.d.ts.map +1 -1
- package/dist/alert-dialog/alert-dialog.js +5 -0
- package/dist/alert-dialog/alert-dialog.js.map +1 -1
- package/dist/badge/badge.d.ts +6 -0
- package/dist/badge/badge.d.ts.map +1 -1
- package/dist/badge/badge.js +4 -0
- package/dist/badge/badge.js.map +1 -1
- package/dist/button/button.d.ts +12 -1
- package/dist/button/button.d.ts.map +1 -1
- package/dist/button/button.js +5 -0
- package/dist/button/button.js.map +1 -1
- package/dist/card/card.d.ts +10 -0
- package/dist/card/card.d.ts.map +1 -1
- package/dist/card/card.js +7 -0
- package/dist/card/card.js.map +1 -1
- package/dist/checkbox/checkbox.d.ts +13 -0
- package/dist/checkbox/checkbox.d.ts.map +1 -1
- package/dist/checkbox/checkbox.js +4 -0
- package/dist/checkbox/checkbox.js.map +1 -1
- package/dist/collapsible/collapsible.d.ts +11 -0
- package/dist/collapsible/collapsible.d.ts.map +1 -1
- package/dist/collapsible/collapsible.js +5 -0
- package/dist/collapsible/collapsible.js.map +1 -1
- package/dist/context-menu/context-menu.d.ts +5 -0
- package/dist/context-menu/context-menu.d.ts.map +1 -1
- package/dist/context-menu/context-menu.js +4 -0
- package/dist/context-menu/context-menu.js.map +1 -1
- package/dist/dialog/dialog.d.ts +13 -1
- package/dist/dialog/dialog.d.ts.map +1 -1
- package/dist/dialog/dialog.js +6 -0
- package/dist/dialog/dialog.js.map +1 -1
- package/dist/drawer/drawer.d.ts +11 -0
- package/dist/drawer/drawer.d.ts.map +1 -1
- package/dist/drawer/drawer.js +5 -0
- package/dist/drawer/drawer.js.map +1 -1
- package/dist/index.css +1681 -1251
- package/dist/index.d.ts +19 -10
- package/dist/index.js +14 -1
- package/dist/input/input.d.ts +8 -0
- package/dist/input/input.d.ts.map +1 -1
- package/dist/input/input.js +5 -0
- package/dist/input/input.js.map +1 -1
- package/dist/menu/menu.css +3 -8
- package/dist/menu/menu.d.ts +11 -4
- package/dist/menu/menu.d.ts.map +1 -1
- package/dist/menu/menu.js +10 -24
- package/dist/menu/menu.js.map +1 -1
- package/dist/menu/menu.module.js +1 -1
- package/dist/menu/menu.module.js.map +1 -1
- package/dist/meter/circular-meter.d.ts +48 -0
- package/dist/meter/circular-meter.d.ts.map +1 -0
- package/dist/meter/circular-meter.js +86 -0
- package/dist/meter/circular-meter.js.map +1 -0
- package/dist/meter/index.d.ts +4 -0
- package/dist/meter/index.js +5 -0
- package/dist/meter/meter.css +152 -0
- package/dist/meter/meter.d.ts +58 -0
- package/dist/meter/meter.d.ts.map +1 -0
- package/dist/meter/meter.js +50 -0
- package/dist/meter/meter.js.map +1 -0
- package/dist/meter/meter.module.css.d.ts +2 -0
- package/dist/meter/meter.module.js +27 -0
- package/dist/meter/meter.module.js.map +1 -0
- package/dist/meter/meterState.js +18 -0
- package/dist/meter/meterState.js.map +1 -0
- package/dist/meter/parts.d.ts +31 -0
- package/dist/meter/parts.d.ts.map +1 -0
- package/dist/meter/parts.js +56 -0
- package/dist/meter/parts.js.map +1 -0
- package/dist/number-field/number-field.d.ts +16 -0
- package/dist/number-field/number-field.d.ts.map +1 -1
- package/dist/number-field/number-field.js +4 -0
- package/dist/number-field/number-field.js.map +1 -1
- package/dist/popover/index.d.ts +3 -0
- package/dist/popover/index.js +4 -0
- package/dist/popover/parts.d.ts +43 -0
- package/dist/popover/parts.d.ts.map +1 -0
- package/dist/popover/parts.js +96 -0
- package/dist/popover/parts.js.map +1 -0
- package/dist/popover/popover.css +173 -0
- package/dist/popover/popover.d.ts +49 -0
- package/dist/popover/popover.d.ts.map +1 -0
- package/dist/popover/popover.js +68 -0
- package/dist/popover/popover.js.map +1 -0
- package/dist/popover/popover.module.css.d.ts +2 -0
- package/dist/popover/popover.module.js +16 -0
- package/dist/popover/popover.module.js.map +1 -0
- package/dist/progress/progress.d.ts +11 -0
- package/dist/progress/progress.d.ts.map +1 -1
- package/dist/progress/progress.js +5 -0
- package/dist/progress/progress.js.map +1 -1
- package/dist/radio/index.d.ts +3 -0
- package/dist/radio/index.js +4 -0
- package/dist/radio/parts.d.ts +18 -0
- package/dist/radio/parts.d.ts.map +1 -0
- package/dist/radio/parts.js +42 -0
- package/dist/radio/parts.js.map +1 -0
- package/dist/radio/radio.css +84 -0
- package/dist/radio/radio.d.ts +31 -0
- package/dist/radio/radio.d.ts.map +1 -0
- package/dist/radio/radio.js +33 -0
- package/dist/radio/radio.js.map +1 -0
- package/dist/radio/radio.module.css.d.ts +2 -0
- package/dist/radio/radio.module.js +11 -0
- package/dist/radio/radio.module.js.map +1 -0
- package/dist/radio-group/index.d.ts +3 -0
- package/dist/radio-group/index.js +4 -0
- package/dist/radio-group/parts.d.ts +13 -0
- package/dist/radio-group/parts.d.ts.map +1 -0
- package/dist/radio-group/parts.js +31 -0
- package/dist/radio-group/parts.js.map +1 -0
- package/dist/radio-group/radio-group.css +17 -0
- package/dist/radio-group/radio-group.d.ts +37 -0
- package/dist/radio-group/radio-group.d.ts.map +1 -0
- package/dist/radio-group/radio-group.js +28 -0
- package/dist/radio-group/radio-group.js.map +1 -0
- package/dist/radio-group/radio-group.module.css.d.ts +2 -0
- package/dist/radio-group/radio-group.module.js +9 -0
- package/dist/radio-group/radio-group.module.js.map +1 -0
- package/dist/select/select.d.ts +14 -1
- package/dist/select/select.d.ts.map +1 -1
- package/dist/select/select.js +4 -0
- package/dist/select/select.js.map +1 -1
- package/dist/separator/separator.d.ts +4 -0
- package/dist/separator/separator.d.ts.map +1 -1
- package/dist/separator/separator.js +4 -0
- package/dist/separator/separator.js.map +1 -1
- package/dist/shared/PopupArrow.js +22 -0
- package/dist/shared/PopupArrow.js.map +1 -0
- package/dist/slider/slider.d.ts +18 -0
- package/dist/slider/slider.d.ts.map +1 -1
- package/dist/slider/slider.js +6 -0
- package/dist/slider/slider.js.map +1 -1
- package/dist/switch/switch.css +11 -2
- package/dist/switch/switch.d.ts +12 -0
- package/dist/switch/switch.d.ts.map +1 -1
- package/dist/switch/switch.js +4 -0
- package/dist/switch/switch.js.map +1 -1
- package/dist/switch/switch.module.js.map +1 -1
- package/dist/tabs/tabs.d.ts +8 -1
- package/dist/tabs/tabs.d.ts.map +1 -1
- package/dist/tabs/tabs.js +4 -0
- package/dist/tabs/tabs.js.map +1 -1
- package/dist/toast/toast.d.ts +11 -0
- package/dist/toast/toast.d.ts.map +1 -1
- package/dist/toast/toast.js +8 -0
- package/dist/toast/toast.js.map +1 -1
- package/dist/tooltip/tooltip.d.ts +9 -0
- package/dist/tooltip/tooltip.d.ts.map +1 -1
- package/dist/tooltip/tooltip.js +4 -0
- package/dist/tooltip/tooltip.js.map +1 -1
- package/package.json +22 -2
- package/src/accordion/accordion.tsx +14 -0
- package/src/alert-dialog/alert-dialog.tsx +11 -0
- package/src/badge/badge.tsx +6 -0
- package/src/button/button.tsx +12 -1
- package/src/card/card.tsx +10 -0
- package/src/checkbox/checkbox.tsx +13 -0
- package/src/collapsible/collapsible.tsx +11 -0
- package/src/context-menu/context-menu.tsx +5 -0
- package/src/dialog/dialog.tsx +13 -1
- package/src/drawer/drawer.tsx +11 -0
- package/src/index.ts +4 -0
- package/src/input/input.tsx +8 -0
- package/src/menu/menu.module.css +3 -10
- package/src/menu/menu.tsx +13 -26
- package/src/meter/circular-meter.tsx +114 -0
- package/src/meter/index.ts +9 -0
- package/src/meter/meter.module.css +162 -0
- package/src/meter/meter.tsx +86 -0
- package/src/meter/meterState.ts +29 -0
- package/src/meter/parts.tsx +72 -0
- package/src/number-field/number-field.tsx +16 -0
- package/src/popover/index.ts +14 -0
- package/src/popover/parts.tsx +120 -0
- package/src/popover/popover.module.css +189 -0
- package/src/popover/popover.tsx +80 -0
- package/src/progress/progress.tsx +11 -0
- package/src/radio/index.ts +6 -0
- package/src/radio/parts.tsx +43 -0
- package/src/radio/radio.module.css +96 -0
- package/src/radio/radio.tsx +37 -0
- package/src/radio-group/index.ts +5 -0
- package/src/radio-group/parts.tsx +32 -0
- package/src/radio-group/radio-group.module.css +17 -0
- package/src/radio-group/radio-group.tsx +63 -0
- package/src/select/select.tsx +14 -1
- package/src/separator/separator.tsx +4 -0
- package/src/shared/PopupArrow.tsx +41 -0
- package/src/slider/slider.tsx +18 -0
- package/src/switch/switch.module.css +11 -2
- package/src/switch/switch.tsx +12 -0
- package/src/tabs/tabs.tsx +8 -1
- package/src/toast/toast.tsx +11 -0
- package/src/tooltip/tooltip.tsx +9 -0
package/README.md
CHANGED
|
@@ -135,34 +135,37 @@ All tokens live in `@layer theme` — the lowest-priority layer. `@layer base` (
|
|
|
135
135
|
|
|
136
136
|
Shadows are theme-aware — light mode uses low-opacity black shadows; dark mode uses higher-opacity values so elevation is visible against dark surfaces.
|
|
137
137
|
|
|
138
|
-
| Token | Tailwind class | Role
|
|
139
|
-
| --------------------------------------------------------- | -------------------- |
|
|
140
|
-
| `--color-canvas` | `bg-canvas` | Page background
|
|
141
|
-
| `--color-elevated` | `bg-elevated` | Cards, popovers
|
|
142
|
-
| `--color-sunken` | `bg-sunken` | Code blocks, inset areas
|
|
143
|
-
| `--color-overlay` | `bg-overlay` | Backdrop-blurred surfaces
|
|
144
|
-
| `--color-sidebar` | `bg-sidebar` | Sidebar / navigation panels
|
|
145
|
-
| `--color-surface-1/2/3` | `bg-surface-1/2/3` | Layered surface hierarchy
|
|
146
|
-
| `--color-hover` | `bg-hover` | Hovered interactive surface
|
|
147
|
-
| `--color-active` | `bg-active` | Pressed interactive surface
|
|
148
|
-
| `--color-selected` | `bg-selected` | Selected interactive surface
|
|
149
|
-
| `--color-primary` | `text-primary` | Primary text
|
|
150
|
-
| `--color-secondary` | `text-secondary` | Secondary text
|
|
151
|
-
| `--color-tertiary` | `text-tertiary` | Tertiary / hint text
|
|
152
|
-
| `--color-disabled` | `text-disabled` | Disabled text
|
|
153
|
-
| `--color-inverse` | `text-inverse` | Text on inverse (dark) backgrounds
|
|
154
|
-
| `--color-on-accent` | `text-on-accent` | Text on filled accent backgrounds
|
|
155
|
-
| `--color-code` | `text-code` | Inline code text
|
|
156
|
-
| `--color-line` | `border-line` | Base border
|
|
157
|
-
| `--color-line-strong` | `border-line-strong` | Stronger border
|
|
158
|
-
| `--color-line-subtle` | `border-line-subtle` | Subtle / decorative border
|
|
159
|
-
| `--color-accent` | `bg-accent` | macOS blue —
|
|
160
|
-
| `--color-accent-
|
|
161
|
-
| `--color-accent-
|
|
162
|
-
| `--color-accent-
|
|
163
|
-
| `--color-accent-
|
|
164
|
-
| `--color-
|
|
165
|
-
| `--color-
|
|
138
|
+
| Token | Tailwind class | Role |
|
|
139
|
+
| --------------------------------------------------------- | -------------------- | -------------------------------------------- |
|
|
140
|
+
| `--color-canvas` | `bg-canvas` | Page background |
|
|
141
|
+
| `--color-elevated` | `bg-elevated` | Cards, popovers |
|
|
142
|
+
| `--color-sunken` | `bg-sunken` | Code blocks, inset areas |
|
|
143
|
+
| `--color-overlay` | `bg-overlay` | Backdrop-blurred surfaces |
|
|
144
|
+
| `--color-sidebar` | `bg-sidebar` | Sidebar / navigation panels |
|
|
145
|
+
| `--color-surface-1/2/3` | `bg-surface-1/2/3` | Layered surface hierarchy |
|
|
146
|
+
| `--color-hover` | `bg-hover` | Hovered interactive surface |
|
|
147
|
+
| `--color-active` | `bg-active` | Pressed interactive surface |
|
|
148
|
+
| `--color-selected` | `bg-selected` | Selected interactive surface |
|
|
149
|
+
| `--color-primary` | `text-primary` | Primary text |
|
|
150
|
+
| `--color-secondary` | `text-secondary` | Secondary text |
|
|
151
|
+
| `--color-tertiary` | `text-tertiary` | Tertiary / hint text |
|
|
152
|
+
| `--color-disabled` | `text-disabled` | Disabled text |
|
|
153
|
+
| `--color-inverse` | `text-inverse` | Text on inverse (dark) backgrounds |
|
|
154
|
+
| `--color-on-accent` | `text-on-accent` | Text on filled accent backgrounds |
|
|
155
|
+
| `--color-code` | `text-code` | Inline code text |
|
|
156
|
+
| `--color-line` | `border-line` | Base border |
|
|
157
|
+
| `--color-line-strong` | `border-line-strong` | Stronger border |
|
|
158
|
+
| `--color-line-subtle` | `border-line-subtle` | Subtle / decorative border |
|
|
159
|
+
| `--color-accent` | `bg-accent` | macOS blue — links, focus rings, tints |
|
|
160
|
+
| `--color-accent-solid` | — | Filled button bg — AA contrast vs white |
|
|
161
|
+
| `--color-accent-text` | — | Accent text on tinted surfaces — AA contrast |
|
|
162
|
+
| `--color-accent-hover` | — | Accent on hover |
|
|
163
|
+
| `--color-accent-pressed` | — | Accent on press |
|
|
164
|
+
| `--color-accent-tint` | `bg-accent-tint` | Subtle accent fill (badges, soft buttons) |
|
|
165
|
+
| `--color-accent-tint-hover` | — | Tint on hover |
|
|
166
|
+
| `--color-focus-ring` | — | Focus ring colour (semi-transparent accent) |
|
|
167
|
+
| `--color-success/warning/error/info-bg/border/text/solid` | — | Status colours |
|
|
168
|
+
| `--color-success/warning/error-on-solid` | — | Text on filled status buttons (AA contrast) |
|
|
166
169
|
|
|
167
170
|
### Spacing
|
|
168
171
|
|
|
@@ -230,7 +233,7 @@ Per-component JS (also exports <Name>Styles class-name map)
|
|
|
230
233
|
@brijbyte/agentic-ui/context-menu @brijbyte/agentic-ui/tabs
|
|
231
234
|
@brijbyte/agentic-ui/dialog @brijbyte/agentic-ui/toast
|
|
232
235
|
@brijbyte/agentic-ui/drawer @brijbyte/agentic-ui/tooltip
|
|
233
|
-
@brijbyte/agentic-ui/input
|
|
236
|
+
@brijbyte/agentic-ui/input @brijbyte/agentic-ui/popover
|
|
234
237
|
|
|
235
238
|
Per-component CSS (/<name>.css mirrors each JS subpath)
|
|
236
239
|
@brijbyte/agentic-ui/accordion.css @brijbyte/agentic-ui/menu.css
|
|
@@ -243,7 +246,7 @@ Per-component CSS (/<name>.css mirrors each JS subpath)
|
|
|
243
246
|
@brijbyte/agentic-ui/context-menu.css @brijbyte/agentic-ui/tabs.css
|
|
244
247
|
@brijbyte/agentic-ui/dialog.css @brijbyte/agentic-ui/toast.css
|
|
245
248
|
@brijbyte/agentic-ui/drawer.css @brijbyte/agentic-ui/tooltip.css
|
|
246
|
-
@brijbyte/agentic-ui/input.css
|
|
249
|
+
@brijbyte/agentic-ui/input.css @brijbyte/agentic-ui/popover.css
|
|
247
250
|
```
|
|
248
251
|
|
|
249
252
|
---
|
|
@@ -280,6 +283,7 @@ import { Button, Dialog, Input } from "@brijbyte/agentic-ui";
|
|
|
280
283
|
| `/input` | `Input` | — |
|
|
281
284
|
| `/menu` | `Menu` | `MenuPositioner`, `MenuPopup`, `MenuItem`, `MenuSeparator`, `MenuGroupLabel`, `MenuArrow`, `MenuItemShortcut` |
|
|
282
285
|
| `/number-field` | `NumberField` | `NumberFieldGroup`, `NumberFieldInput`, `NumberFieldDecrement`, `NumberFieldIncrement`, `NumberFieldScrubArea`, `NumberFieldScrubAreaCursor` |
|
|
286
|
+
| `/popover` | `Popover` | `PopoverPositioner`, `PopoverPopup`, `PopoverTitle`, `PopoverDescription`, `PopoverClose`, `PopoverArrow`, `PopoverViewport` |
|
|
283
287
|
| `/progress` | `Progress` | `ProgressTrack`, `ProgressIndicator` |
|
|
284
288
|
| `/select` | `Select` | `SelectTrigger`, `SelectValue`, `SelectPositioner`, `SelectPopup`, `SelectList`, `SelectItem`, `SelectItemText`, `SelectItemIndicator`, `SelectGroupContainer`, `SelectGroupLabel`, `SelectSeparator` |
|
|
285
289
|
| `/separator` | `Separator` | — |
|
|
@@ -413,6 +417,8 @@ import { Button } from "@brijbyte/agentic-ui/button";
|
|
|
413
417
|
| `success` | Confirm / complete action |
|
|
414
418
|
| `warning` | Caution required |
|
|
415
419
|
|
|
420
|
+
All tone/variant combinations meet WCAG AA contrast (4.5:1 for text, 3:1 for borders). Each tone exposes two colour roles internally — a solid fill colour (`--btn-color`) and a separate text colour (`--btn-text-color`) optimised for legibility on tinted surfaces — so `soft`, `outline`, and `ghost` variants are always readable regardless of mode.
|
|
421
|
+
|
|
416
422
|
**`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.
|
|
417
423
|
|
|
418
424
|
**`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.
|
|
@@ -597,6 +603,97 @@ import { Collapsible } from "@brijbyte/agentic-ui/collapsible";
|
|
|
597
603
|
|
|
598
604
|
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.
|
|
599
605
|
|
|
606
|
+
### Popover
|
|
607
|
+
|
|
608
|
+
```tsx
|
|
609
|
+
import { Popover } from "@brijbyte/agentic-ui/popover";
|
|
610
|
+
|
|
611
|
+
// side: top | bottom (default) | left | right
|
|
612
|
+
// align: start | center (default) | end
|
|
613
|
+
<Popover
|
|
614
|
+
trigger={<Button variant="outline" size="sm">Details</Button>}
|
|
615
|
+
title="Deployment info"
|
|
616
|
+
description="Last deployed 3 minutes ago from main."
|
|
617
|
+
side="bottom"
|
|
618
|
+
align="start"
|
|
619
|
+
/>
|
|
620
|
+
|
|
621
|
+
// With body content and a close button
|
|
622
|
+
<Popover
|
|
623
|
+
trigger={<Button>Settings</Button>}
|
|
624
|
+
title="API Settings"
|
|
625
|
+
dismissible
|
|
626
|
+
>
|
|
627
|
+
<Input placeholder="API key" style={{ marginTop: "var(--space-3)" }} />
|
|
628
|
+
</Popover>
|
|
629
|
+
```
|
|
630
|
+
|
|
631
|
+
**`trigger`** is rendered as-is and receives the open/close handler from base-ui.
|
|
632
|
+
|
|
633
|
+
**`dismissible`** renders a close (×) button in the top-right corner. Omit it for simple informational popovers that dismiss on outside click.
|
|
634
|
+
|
|
635
|
+
**`side`** / **`align`** control positioning. The popup auto-repositions to avoid viewport overflow — it will flip sides when there isn't enough space.
|
|
636
|
+
|
|
637
|
+
#### Shared trigger (one popover, many triggers)
|
|
638
|
+
|
|
639
|
+
Use `Popover.createHandle` from base-ui to connect multiple triggers to a single popup instance. Each trigger passes its own `payload`; the Root receives it via a render-function child. Switching triggers while the popup is open animates the content transition with `PopoverViewport`:
|
|
640
|
+
|
|
641
|
+
```tsx
|
|
642
|
+
import { Popover as BasePopover } from "@base-ui/react/popover";
|
|
643
|
+
import { PopoverPopup, PopoverTitle, PopoverDescription, PopoverArrow, PopoverViewport } from "@brijbyte/agentic-ui/popover";
|
|
644
|
+
|
|
645
|
+
interface Item {
|
|
646
|
+
id: string;
|
|
647
|
+
name: string;
|
|
648
|
+
detail: string;
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
// Create once outside the component — typed with the payload shape
|
|
652
|
+
const handle = BasePopover.createHandle<Item>();
|
|
653
|
+
|
|
654
|
+
function MyList({ items }: { items: Item[] }) {
|
|
655
|
+
return (
|
|
656
|
+
<>
|
|
657
|
+
{/* Single Root — content driven by whichever trigger is active */}
|
|
658
|
+
<BasePopover.Root handle={handle}>
|
|
659
|
+
{({ payload }) =>
|
|
660
|
+
payload ? (
|
|
661
|
+
<BasePopover.Portal>
|
|
662
|
+
<BasePopover.Positioner side="right" sideOffset={8}>
|
|
663
|
+
<PopoverPopup>
|
|
664
|
+
<PopoverArrow />
|
|
665
|
+
{/* Viewport animates between triggers */}
|
|
666
|
+
<PopoverViewport>
|
|
667
|
+
<PopoverTitle>{payload.name}</PopoverTitle>
|
|
668
|
+
<PopoverDescription>{payload.detail}</PopoverDescription>
|
|
669
|
+
</PopoverViewport>
|
|
670
|
+
</PopoverPopup>
|
|
671
|
+
</BasePopover.Positioner>
|
|
672
|
+
</BasePopover.Portal>
|
|
673
|
+
) : null
|
|
674
|
+
}
|
|
675
|
+
</BasePopover.Root>
|
|
676
|
+
|
|
677
|
+
{/* Each trigger passes its item as the payload */}
|
|
678
|
+
{items.map((item) => (
|
|
679
|
+
<BasePopover.Trigger
|
|
680
|
+
key={item.id}
|
|
681
|
+
handle={handle}
|
|
682
|
+
payload={item}
|
|
683
|
+
render={
|
|
684
|
+
<Button variant="ghost" size="xs">
|
|
685
|
+
Info
|
|
686
|
+
</Button>
|
|
687
|
+
}
|
|
688
|
+
/>
|
|
689
|
+
))}
|
|
690
|
+
</>
|
|
691
|
+
);
|
|
692
|
+
}
|
|
693
|
+
```
|
|
694
|
+
|
|
695
|
+
`PopoverViewport` detects the direction between the old and new trigger and slides content in/out accordingly — down when moving to a lower trigger, up when moving higher, left/right for horizontal layouts.
|
|
696
|
+
|
|
600
697
|
### Menu
|
|
601
698
|
|
|
602
699
|
```tsx
|
|
@@ -726,15 +823,15 @@ import { ContextMenu } from "@brijbyte/agentic-ui/context-menu";
|
|
|
726
823
|
|
|
727
824
|
<ContextMenu
|
|
728
825
|
items={[
|
|
729
|
-
{ label: "Cut",
|
|
730
|
-
{ label: "Copy",
|
|
826
|
+
{ label: "Cut", shortcut: "⌘X" },
|
|
827
|
+
{ label: "Copy", shortcut: "⌘C" },
|
|
731
828
|
{ label: "Paste", shortcut: "⌘V", disabled: true },
|
|
732
829
|
{ type: "separator" },
|
|
733
830
|
{ label: "Select All", shortcut: "⌘A" },
|
|
734
831
|
]}
|
|
735
832
|
>
|
|
736
833
|
<div>Right click me</div>
|
|
737
|
-
</ContextMenu
|
|
834
|
+
</ContextMenu>;
|
|
738
835
|
```
|
|
739
836
|
|
|
740
837
|
Activated by right-click or long press on the child element. Supports `items` with `label`, `shortcut`, `icon`, `onSelect`, and `disabled`. Use `type: "separator"` for dividers and `type: "group"` with nested `items` for logical sections.
|
|
@@ -755,7 +852,7 @@ import { ContextMenuPopup, ContextMenuItem, ContextMenuSubmenuTrigger } from "@b
|
|
|
755
852
|
</ContextMenuPopup>
|
|
756
853
|
</BaseContextMenu.Positioner>
|
|
757
854
|
</BaseContextMenu.Portal>
|
|
758
|
-
</BaseContextMenu.SubmenuRoot
|
|
855
|
+
</BaseContextMenu.SubmenuRoot>;
|
|
759
856
|
```
|
|
760
857
|
|
|
761
858
|
---
|
|
@@ -783,7 +880,7 @@ dist/
|
|
|
783
880
|
button/index.js ← Per-component ESM (no CSS imports)
|
|
784
881
|
button/index.d.ts
|
|
785
882
|
button/button.css ← Per-component plain CSS
|
|
786
|
-
… ← All
|
|
883
|
+
… ← All 20 components follow the same pattern
|
|
787
884
|
```
|
|
788
885
|
|
|
789
886
|
### Why no CSS in JS?
|
|
@@ -4,19 +4,33 @@ import styles from "./accordion.module.css";
|
|
|
4
4
|
|
|
5
5
|
//#region src/accordion/accordion.d.ts
|
|
6
6
|
interface AccordionItem {
|
|
7
|
+
/** Unique identifier for this panel. */
|
|
7
8
|
value: string;
|
|
9
|
+
/** Content rendered inside the trigger button. */
|
|
8
10
|
header: ReactNode;
|
|
11
|
+
/** Content revealed when the panel is expanded. */
|
|
9
12
|
content: ReactNode;
|
|
13
|
+
/** When `true`, the item cannot be toggled. */
|
|
10
14
|
disabled?: boolean;
|
|
11
15
|
}
|
|
12
16
|
interface AccordionProps {
|
|
17
|
+
/** Array of items to render as collapsible panels. */
|
|
13
18
|
items: AccordionItem[];
|
|
19
|
+
/** Allow multiple panels open at once. @default true */
|
|
14
20
|
multiple?: boolean;
|
|
21
|
+
/** Initially expanded panel values (uncontrolled). */
|
|
15
22
|
defaultValue?: string[];
|
|
23
|
+
/** Currently expanded panel values (controlled). */
|
|
16
24
|
value?: string[];
|
|
25
|
+
/** Called when the set of open panels changes. */
|
|
17
26
|
onValueChange?: (value: string[]) => void;
|
|
18
27
|
className?: string;
|
|
19
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Collapsible content panels. Wraps `@base-ui/react` Accordion with pre-styled
|
|
31
|
+
* headers, triggers, and animated panels. Pass `multiple` to allow more than one
|
|
32
|
+
* panel open at a time.
|
|
33
|
+
*/
|
|
20
34
|
declare function Accordion({
|
|
21
35
|
items,
|
|
22
36
|
className,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion.d.ts","names":[],"sources":["../../src/accordion/accordion.tsx"],"mappings":";;;;;UAIiB,aAAA
|
|
1
|
+
{"version":3,"file":"accordion.d.ts","names":[],"sources":["../../src/accordion/accordion.tsx"],"mappings":";;;;;UAIiB,aAAA;;EAEf,KAAA;EAFe;EAIf,MAAA,EAAQ,SAAA;;EAER,OAAA,EAAS,SAAA;EAJT;EAMA,QAAA;AAAA;AAAA,UAGe,cAAA;EALN;EAOT,KAAA,EAAO,aAAA;EALC;EAOR,QAAA;EAJe;EAMf,YAAA;;EAEA,KAAA;EANA;EAQA,aAAA,IAAiB,KAAA;EACjB,SAAA;AAAA;;;;;;iBAgBc,SAAA,CAAA;EAAY,KAAA;EAAO,SAAA;EAAW,QAAA;EAAA,GAAoB;AAAA,GAAS,cAAA,GAAc,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -17,6 +17,11 @@ function ChevronIcon() {
|
|
|
17
17
|
})
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Collapsible content panels. Wraps `@base-ui/react` Accordion with pre-styled
|
|
22
|
+
* headers, triggers, and animated panels. Pass `multiple` to allow more than one
|
|
23
|
+
* panel open at a time.
|
|
24
|
+
*/
|
|
20
25
|
function Accordion$1({ items, className, multiple = true, ...props }) {
|
|
21
26
|
return /* @__PURE__ */ jsx(Accordion.Root, {
|
|
22
27
|
className: `${accordion_module_default.root} ${className ?? ""}`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion.js","names":["Accordion","BaseAccordion","styles"],"sources":["../../src/accordion/accordion.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { Accordion as BaseAccordion } from \"@base-ui/react/accordion\";\nimport styles from \"./accordion.module.css\";\n\nexport interface AccordionItem {\n value: string;\n header: ReactNode;\n content: ReactNode;\n disabled?: boolean;\n}\n\nexport interface AccordionProps {\n items: AccordionItem[];\n multiple?: boolean;\n defaultValue?: string[];\n value?: string[];\n onValueChange?: (value: string[]) => void;\n className?: string;\n}\n\nfunction ChevronIcon() {\n return (\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\n <path d=\"M2.5 4.5L6 8L9.5 4.5\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n );\n}\n\nexport function Accordion({ items, className, multiple = true, ...props }: AccordionProps) {\n return (\n <BaseAccordion.Root className={`${styles.root} ${className ?? \"\"}`} multiple={multiple} {...props}>\n {items.map((item) => (\n <BaseAccordion.Item key={item.value} value={item.value} className={styles.item} disabled={item.disabled ?? false}>\n <BaseAccordion.Header className={styles.header}>\n <BaseAccordion.Trigger className={styles.trigger}>\n {item.header}\n <span className={styles[\"trigger-icon\"]}>\n <ChevronIcon />\n </span>\n </BaseAccordion.Trigger>\n </BaseAccordion.Header>\n <BaseAccordion.Panel className={styles.panel}>\n <div className={styles[\"panel-content\"]}>{item.content}</div>\n </BaseAccordion.Panel>\n </BaseAccordion.Item>\n ))}\n </BaseAccordion.Root>\n );\n}\nexport { styles as AccordionStyles };\n"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"accordion.js","names":["Accordion","BaseAccordion","styles"],"sources":["../../src/accordion/accordion.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { Accordion as BaseAccordion } from \"@base-ui/react/accordion\";\nimport styles from \"./accordion.module.css\";\n\nexport interface AccordionItem {\n /** Unique identifier for this panel. */\n value: string;\n /** Content rendered inside the trigger button. */\n header: ReactNode;\n /** Content revealed when the panel is expanded. */\n content: ReactNode;\n /** When `true`, the item cannot be toggled. */\n disabled?: boolean;\n}\n\nexport interface AccordionProps {\n /** Array of items to render as collapsible panels. */\n items: AccordionItem[];\n /** Allow multiple panels open at once. @default true */\n multiple?: boolean;\n /** Initially expanded panel values (uncontrolled). */\n defaultValue?: string[];\n /** Currently expanded panel values (controlled). */\n value?: string[];\n /** Called when the set of open panels changes. */\n onValueChange?: (value: string[]) => void;\n className?: string;\n}\n\nfunction ChevronIcon() {\n return (\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\n <path d=\"M2.5 4.5L6 8L9.5 4.5\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n );\n}\n\n/**\n * Collapsible content panels. Wraps `@base-ui/react` Accordion with pre-styled\n * headers, triggers, and animated panels. Pass `multiple` to allow more than one\n * panel open at a time.\n */\nexport function Accordion({ items, className, multiple = true, ...props }: AccordionProps) {\n return (\n <BaseAccordion.Root className={`${styles.root} ${className ?? \"\"}`} multiple={multiple} {...props}>\n {items.map((item) => (\n <BaseAccordion.Item key={item.value} value={item.value} className={styles.item} disabled={item.disabled ?? false}>\n <BaseAccordion.Header className={styles.header}>\n <BaseAccordion.Trigger className={styles.trigger}>\n {item.header}\n <span className={styles[\"trigger-icon\"]}>\n <ChevronIcon />\n </span>\n </BaseAccordion.Trigger>\n </BaseAccordion.Header>\n <BaseAccordion.Panel className={styles.panel}>\n <div className={styles[\"panel-content\"]}>{item.content}</div>\n </BaseAccordion.Panel>\n </BaseAccordion.Item>\n ))}\n </BaseAccordion.Root>\n );\n}\nexport { styles as AccordionStyles };\n"],"mappings":";;;;AA6BA,SAAS,cAAc;AACrB,QACE,oBAAC,OAAD;EAAK,OAAM;EAAK,QAAO;EAAK,SAAQ;EAAY,MAAK;YACnD,oBAAC,QAAD;GAAM,GAAE;GAAuB,QAAO;GAAe,aAAY;GAAM,eAAc;GAAQ,gBAAe;GAAU,CAAA;EAClH,CAAA;;;;;;;AASV,SAAgBA,YAAU,EAAE,OAAO,WAAW,WAAW,MAAM,GAAG,SAAyB;AACzF,QACE,oBAACC,UAAc,MAAf;EAAoB,WAAW,GAAGC,yBAAO,KAAK,GAAG,aAAa;EAAgB;EAAU,GAAI;YACzF,MAAM,KAAK,SACV,qBAACD,UAAc,MAAf;GAAqC,OAAO,KAAK;GAAO,WAAWC,yBAAO;GAAM,UAAU,KAAK,YAAY;aAA3G,CACE,oBAACD,UAAc,QAAf;IAAsB,WAAWC,yBAAO;cACtC,qBAACD,UAAc,SAAf;KAAuB,WAAWC,yBAAO;eAAzC,CACG,KAAK,QACN,oBAAC,QAAD;MAAM,WAAWA,yBAAO;gBACtB,oBAAC,aAAD,EAAe,CAAA;MACV,CAAA,CACe;;IACH,CAAA,EACvB,oBAACD,UAAc,OAAf;IAAqB,WAAWC,yBAAO;cACrC,oBAAC,OAAD;KAAK,WAAWA,yBAAO;eAAmB,KAAK;KAAc,CAAA;IACzC,CAAA,CACH;KAZI,KAAK,MAYT,CACrB;EACiB,CAAA"}
|
|
@@ -13,13 +13,19 @@ interface AlertAction {
|
|
|
13
13
|
destructive?: boolean;
|
|
14
14
|
}
|
|
15
15
|
interface AlertDialogProps {
|
|
16
|
+
/** Controlled open state. */
|
|
16
17
|
open?: boolean;
|
|
18
|
+
/** Whether the dialog is initially open (uncontrolled). */
|
|
17
19
|
defaultOpen?: boolean;
|
|
20
|
+
/** Called when the dialog opens or closes. */
|
|
18
21
|
onOpenChange?: (open: boolean, eventDetails: unknown) => void;
|
|
22
|
+
/** Element that opens the dialog when clicked. */
|
|
19
23
|
trigger?: ReactElement;
|
|
20
24
|
/** Optional icon shown above the title. */
|
|
21
25
|
icon?: ReactNode;
|
|
26
|
+
/** Dialog heading text. */
|
|
22
27
|
title: ReactNode;
|
|
28
|
+
/** Supplementary text below the title. */
|
|
23
29
|
description?: ReactNode;
|
|
24
30
|
/**
|
|
25
31
|
* Action buttons rendered right-aligned.
|
|
@@ -29,6 +35,11 @@ interface AlertDialogProps {
|
|
|
29
35
|
actions: AlertAction[];
|
|
30
36
|
className?: string;
|
|
31
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* A modal that requires a user response before continuing. Blocks interaction
|
|
40
|
+
* with the rest of the page until dismissed. Two actions render side-by-side;
|
|
41
|
+
* three or more stack vertically.
|
|
42
|
+
*/
|
|
32
43
|
declare function AlertDialog({
|
|
33
44
|
trigger,
|
|
34
45
|
icon,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert-dialog.d.ts","names":[],"sources":["../../src/alert-dialog/alert-dialog.tsx"],"mappings":";;;;;UAKiB,WAAA;EACf,KAAA,EAAO,SAAA;;EAEP,QAAA;EAH0B;EAK1B,OAAA;EAJgB;EAMhB,WAAA;AAAA;AAAA,UAGe,gBAAA;
|
|
1
|
+
{"version":3,"file":"alert-dialog.d.ts","names":[],"sources":["../../src/alert-dialog/alert-dialog.tsx"],"mappings":";;;;;UAKiB,WAAA;EACf,KAAA,EAAO,SAAA;;EAEP,QAAA;EAH0B;EAK1B,OAAA;EAJgB;EAMhB,WAAA;AAAA;AAAA,UAGe,gBAAA;EALf;EAOA,IAAA;EALW;EAOX,WAAA;EAJe;EAMf,YAAA,IAAgB,IAAA,WAAe,YAAA;;EAE/B,OAAA,GAAU,YAAA;EAEH;EAAP,IAAA,GAAO,SAAA;EAIO;EAFd,KAAA,EAAO,SAAA;EAQa;EANpB,WAAA,GAAc,SAAA;EAZd;;;;;EAkBA,OAAA,EAAS,WAAA;EACT,SAAA;AAAA;;;;;;iBAQc,WAAA,CAAA;EAAc,OAAA;EAAS,IAAA;EAAM,KAAA;EAAO,WAAA;EAAa,OAAA;EAAS,SAAA;EAAW,YAAA;EAAA,GAAiB;AAAA,GAAS,gBAAA,GAAgB,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -3,6 +3,11 @@ import alert_dialog_module_default from "./alert-dialog.module.js";
|
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { AlertDialog } from "@base-ui/react/alert-dialog";
|
|
5
5
|
//#region src/alert-dialog/alert-dialog.tsx
|
|
6
|
+
/**
|
|
7
|
+
* A modal that requires a user response before continuing. Blocks interaction
|
|
8
|
+
* with the rest of the page until dismissed. Two actions render side-by-side;
|
|
9
|
+
* three or more stack vertically.
|
|
10
|
+
*/
|
|
6
11
|
function AlertDialog$1({ trigger, icon, title, description, actions, className, onOpenChange, ...props }) {
|
|
7
12
|
return /* @__PURE__ */ jsxs(AlertDialog.Root, {
|
|
8
13
|
onOpenChange,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert-dialog.js","names":["AlertDialog","BaseAlertDialog","styles"],"sources":["../../src/alert-dialog/alert-dialog.tsx"],"sourcesContent":["import type { ReactNode, ReactElement } from \"react\";\nimport { AlertDialog as BaseAlertDialog } from \"@base-ui/react/alert-dialog\";\nimport { Button } from \"../button/button\";\nimport styles from \"./alert-dialog.module.css\";\n\nexport interface AlertAction {\n label: ReactNode;\n /** Called when the action button is clicked. The dialog closes automatically. */\n onAction?: () => void;\n /** Renders as a filled accent button — use for the primary confirm action. */\n primary?: boolean;\n /** Renders as a soft destructive button. Sits on the left when combined with other actions. */\n destructive?: boolean;\n}\n\nexport interface AlertDialogProps {\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean, eventDetails: unknown) => void;\n trigger?: ReactElement;\n /** Optional icon shown above the title. */\n icon?: ReactNode;\n title: ReactNode;\n description?: ReactNode;\n /**\n * Action buttons rendered right-aligned.\n * Use `primary: true` for the confirm action (solid), leave unset for cancel (outline).\n * Use `destructive: true` to apply destructive tone to the confirm action.\n */\n actions: AlertAction[];\n className?: string;\n}\n\nexport function AlertDialog({ trigger, icon, title, description, actions, className, onOpenChange, ...props }: AlertDialogProps) {\n return (\n <BaseAlertDialog.Root onOpenChange={onOpenChange as never} {...props}>\n {trigger && <BaseAlertDialog.Trigger render={trigger} />}\n <BaseAlertDialog.Portal>\n <BaseAlertDialog.Backdrop className={styles.backdrop} />\n <BaseAlertDialog.Popup className={`${styles.popup} ${className ?? \"\"}`}>\n <div className={styles.header}>\n {icon && <div className={styles.icon}>{icon}</div>}\n <BaseAlertDialog.Title className={styles.title}>{title}</BaseAlertDialog.Title>\n {description && <BaseAlertDialog.Description className={styles.description}>{description}</BaseAlertDialog.Description>}\n </div>\n <div className={styles.actions}>\n {actions.map((action, i) => (\n <BaseAlertDialog.Close\n key={i}\n render={\n <Button\n variant={action.primary ? \"solid\" : \"outline\"}\n tone={action.destructive ? \"destructive\" : \"primary\"}\n size=\"sm\"\n onClick={action.onAction}\n />\n }\n >\n {action.label}\n </BaseAlertDialog.Close>\n ))}\n </div>\n </BaseAlertDialog.Popup>\n </BaseAlertDialog.Portal>\n </BaseAlertDialog.Root>\n );\n}\n\nexport { styles as AlertDialogStyles };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"alert-dialog.js","names":["AlertDialog","BaseAlertDialog","styles"],"sources":["../../src/alert-dialog/alert-dialog.tsx"],"sourcesContent":["import type { ReactNode, ReactElement } from \"react\";\nimport { AlertDialog as BaseAlertDialog } from \"@base-ui/react/alert-dialog\";\nimport { Button } from \"../button/button\";\nimport styles from \"./alert-dialog.module.css\";\n\nexport interface AlertAction {\n label: ReactNode;\n /** Called when the action button is clicked. The dialog closes automatically. */\n onAction?: () => void;\n /** Renders as a filled accent button — use for the primary confirm action. */\n primary?: boolean;\n /** Renders as a soft destructive button. Sits on the left when combined with other actions. */\n destructive?: boolean;\n}\n\nexport interface AlertDialogProps {\n /** Controlled open state. */\n open?: boolean;\n /** Whether the dialog is initially open (uncontrolled). */\n defaultOpen?: boolean;\n /** Called when the dialog opens or closes. */\n onOpenChange?: (open: boolean, eventDetails: unknown) => void;\n /** Element that opens the dialog when clicked. */\n trigger?: ReactElement;\n /** Optional icon shown above the title. */\n icon?: ReactNode;\n /** Dialog heading text. */\n title: ReactNode;\n /** Supplementary text below the title. */\n description?: ReactNode;\n /**\n * Action buttons rendered right-aligned.\n * Use `primary: true` for the confirm action (solid), leave unset for cancel (outline).\n * Use `destructive: true` to apply destructive tone to the confirm action.\n */\n actions: AlertAction[];\n className?: string;\n}\n\n/**\n * A modal that requires a user response before continuing. Blocks interaction\n * with the rest of the page until dismissed. Two actions render side-by-side;\n * three or more stack vertically.\n */\nexport function AlertDialog({ trigger, icon, title, description, actions, className, onOpenChange, ...props }: AlertDialogProps) {\n return (\n <BaseAlertDialog.Root onOpenChange={onOpenChange as never} {...props}>\n {trigger && <BaseAlertDialog.Trigger render={trigger} />}\n <BaseAlertDialog.Portal>\n <BaseAlertDialog.Backdrop className={styles.backdrop} />\n <BaseAlertDialog.Popup className={`${styles.popup} ${className ?? \"\"}`}>\n <div className={styles.header}>\n {icon && <div className={styles.icon}>{icon}</div>}\n <BaseAlertDialog.Title className={styles.title}>{title}</BaseAlertDialog.Title>\n {description && <BaseAlertDialog.Description className={styles.description}>{description}</BaseAlertDialog.Description>}\n </div>\n <div className={styles.actions}>\n {actions.map((action, i) => (\n <BaseAlertDialog.Close\n key={i}\n render={\n <Button\n variant={action.primary ? \"solid\" : \"outline\"}\n tone={action.destructive ? \"destructive\" : \"primary\"}\n size=\"sm\"\n onClick={action.onAction}\n />\n }\n >\n {action.label}\n </BaseAlertDialog.Close>\n ))}\n </div>\n </BaseAlertDialog.Popup>\n </BaseAlertDialog.Portal>\n </BaseAlertDialog.Root>\n );\n}\n\nexport { styles as AlertDialogStyles };\n"],"mappings":";;;;;;;;;;AA4CA,SAAgBA,cAAY,EAAE,SAAS,MAAM,OAAO,aAAa,SAAS,WAAW,cAAc,GAAG,SAA2B;AAC/H,QACE,qBAACC,YAAgB,MAAjB;EAAoC;EAAuB,GAAI;YAA/D,CACG,WAAW,oBAACA,YAAgB,SAAjB,EAAyB,QAAQ,SAAW,CAAA,EACxD,qBAACA,YAAgB,QAAjB,EAAA,UAAA,CACE,oBAACA,YAAgB,UAAjB,EAA0B,WAAWC,4BAAO,UAAY,CAAA,EACxD,qBAACD,YAAgB,OAAjB;GAAuB,WAAW,GAAGC,4BAAO,MAAM,GAAG,aAAa;aAAlE,CACE,qBAAC,OAAD;IAAK,WAAWA,4BAAO;cAAvB;KACG,QAAQ,oBAAC,OAAD;MAAK,WAAWA,4BAAO;gBAAO;MAAW,CAAA;KAClD,oBAACD,YAAgB,OAAjB;MAAuB,WAAWC,4BAAO;gBAAQ;MAA8B,CAAA;KAC9E,eAAe,oBAACD,YAAgB,aAAjB;MAA6B,WAAWC,4BAAO;gBAAc;MAA0C,CAAA;KACnH;OACN,oBAAC,OAAD;IAAK,WAAWA,4BAAO;cACpB,QAAQ,KAAK,QAAQ,MACpB,oBAACD,YAAgB,OAAjB;KAEE,QACE,oBAAC,QAAD;MACE,SAAS,OAAO,UAAU,UAAU;MACpC,MAAM,OAAO,cAAc,gBAAgB;MAC3C,MAAK;MACL,SAAS,OAAO;MAChB,CAAA;eAGH,OAAO;KACc,EAXjB,EAWiB,CACxB;IACE,CAAA,CACgB;KACD,EAAA,CAAA,CACJ"}
|
package/dist/badge/badge.d.ts
CHANGED
|
@@ -5,9 +5,15 @@ import styles from "./badge.module.css";
|
|
|
5
5
|
//#region src/badge/badge.d.ts
|
|
6
6
|
type BadgeVariant = "default" | "solid" | "soft" | "success" | "warning" | "error" | "info";
|
|
7
7
|
interface BadgeProps extends ComponentPropsWithoutRef<"span"> {
|
|
8
|
+
/** Visual style and semantic colour. @default "default" */
|
|
8
9
|
variant?: BadgeVariant;
|
|
10
|
+
/** Show a small coloured dot indicator before the label. */
|
|
9
11
|
dot?: boolean;
|
|
10
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Compact label for status, counts, and categories. A plain styled `<span>` —
|
|
15
|
+
* no base-ui dependency.
|
|
16
|
+
*/
|
|
11
17
|
declare function Badge({
|
|
12
18
|
variant,
|
|
13
19
|
dot,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.d.ts","names":[],"sources":["../../src/badge/badge.tsx"],"mappings":";;;;;KAGY,YAAA;AAAA,UAEK,UAAA,SAAmB,wBAAA
|
|
1
|
+
{"version":3,"file":"badge.d.ts","names":[],"sources":["../../src/badge/badge.tsx"],"mappings":";;;;;KAGY,YAAA;AAAA,UAEK,UAAA,SAAmB,wBAAA;;EAElC,OAAA,GAAU,YAAA;EAJY;EAMtB,GAAA;AAAA;;AAJF;;;iBAWgB,KAAA,CAAA;EAAQ,OAAA;EAAqB,GAAA;EAAa,SAAA;EAAW,QAAA;EAAA,GAAa;AAAA,GAAS,UAAA,GAAU,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
package/dist/badge/badge.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import badge_module_default from "./badge.module.js";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
//#region src/badge/badge.tsx
|
|
4
|
+
/**
|
|
5
|
+
* Compact label for status, counts, and categories. A plain styled `<span>` —
|
|
6
|
+
* no base-ui dependency.
|
|
7
|
+
*/
|
|
4
8
|
function Badge({ variant = "default", dot = false, className, children, ...props }) {
|
|
5
9
|
return /* @__PURE__ */ jsxs("span", {
|
|
6
10
|
className: [
|
package/dist/badge/badge.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.js","names":["styles"],"sources":["../../src/badge/badge.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef } from \"react\";\nimport styles from \"./badge.module.css\";\n\nexport type BadgeVariant = \"default\" | \"solid\" | \"soft\" | \"success\" | \"warning\" | \"error\" | \"info\";\n\nexport interface BadgeProps extends ComponentPropsWithoutRef<\"span\"> {\n variant?: BadgeVariant;\n dot?: boolean;\n}\n\nexport function Badge({ variant = \"default\", dot = false, className, children, ...props }: BadgeProps) {\n return (\n <span className={[styles.root, styles[`variant-${variant}`], className ?? \"\"].filter(Boolean).join(\" \")} {...props}>\n {dot && <span className={styles.dot} aria-hidden=\"true\" />}\n {children}\n </span>\n );\n}\nexport { styles as BadgeStyles };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"badge.js","names":["styles"],"sources":["../../src/badge/badge.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef } from \"react\";\nimport styles from \"./badge.module.css\";\n\nexport type BadgeVariant = \"default\" | \"solid\" | \"soft\" | \"success\" | \"warning\" | \"error\" | \"info\";\n\nexport interface BadgeProps extends ComponentPropsWithoutRef<\"span\"> {\n /** Visual style and semantic colour. @default \"default\" */\n variant?: BadgeVariant;\n /** Show a small coloured dot indicator before the label. */\n dot?: boolean;\n}\n\n/**\n * Compact label for status, counts, and categories. A plain styled `<span>` —\n * no base-ui dependency.\n */\nexport function Badge({ variant = \"default\", dot = false, className, children, ...props }: BadgeProps) {\n return (\n <span className={[styles.root, styles[`variant-${variant}`], className ?? \"\"].filter(Boolean).join(\" \")} {...props}>\n {dot && <span className={styles.dot} aria-hidden=\"true\" />}\n {children}\n </span>\n );\n}\nexport { styles as BadgeStyles };\n"],"mappings":";;;;;;;AAgBA,SAAgB,MAAM,EAAE,UAAU,WAAW,MAAM,OAAO,WAAW,UAAU,GAAG,SAAqB;AACrG,QACE,qBAAC,QAAD;EAAM,WAAW;GAACA,qBAAO;GAAMA,qBAAO,WAAW;GAAY,aAAa;GAAG,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;EAAE,GAAI;YAA7G,CACG,OAAO,oBAAC,QAAD;GAAM,WAAWA,qBAAO;GAAK,eAAY;GAAS,CAAA,EACzD,SACI"}
|
package/dist/button/button.d.ts
CHANGED
|
@@ -7,10 +7,13 @@ type ButtonVariant = "solid" | "soft" | "outline" | "ghost";
|
|
|
7
7
|
type ButtonTone = "primary" | "secondary" | "destructive" | "success" | "warning";
|
|
8
8
|
type ButtonSize = "xs" | "sm" | "md" | "lg";
|
|
9
9
|
interface ButtonProps extends ComponentPropsWithoutRef<"button"> {
|
|
10
|
+
/** Visual shape — filled, tinted, outlined, or borderless. @default "solid" */
|
|
10
11
|
variant?: ButtonVariant;
|
|
11
|
-
/** Semantic
|
|
12
|
+
/** Semantic colour. @default "primary" */
|
|
12
13
|
tone?: ButtonTone | undefined;
|
|
14
|
+
/** Controls padding and font size. @default "md" */
|
|
13
15
|
size?: ButtonSize | undefined;
|
|
16
|
+
/** Shows a spinner overlay and disables interaction. */
|
|
14
17
|
loading?: boolean | undefined;
|
|
15
18
|
/**
|
|
16
19
|
* Text shown in place of children while loading.
|
|
@@ -18,10 +21,18 @@ interface ButtonProps extends ComponentPropsWithoutRef<"button"> {
|
|
|
18
21
|
* When omitted, children stay rendered invisibly — width stays stable.
|
|
19
22
|
*/
|
|
20
23
|
loadingText?: string | undefined;
|
|
24
|
+
/** Renders as a square button with equal padding on all sides. */
|
|
21
25
|
iconOnly?: boolean | undefined;
|
|
26
|
+
/** Custom render element forwarded to base-ui Button. */
|
|
22
27
|
render?: ReactElement | undefined;
|
|
28
|
+
/** Use a native `<button>` element. @default true */
|
|
23
29
|
nativeButton?: boolean | undefined;
|
|
24
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* Pressable button with multiple variants, tones, and sizes. Composes
|
|
33
|
+
* `@base-ui/react` Button with focus management and disabled-while-loading.
|
|
34
|
+
* Supports a spinner overlay that preserves button width.
|
|
35
|
+
*/
|
|
25
36
|
declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
26
37
|
//#endregion
|
|
27
38
|
export { Button, ButtonProps, ButtonSize, ButtonTone, ButtonVariant, styles };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","names":[],"sources":["../../src/button/button.tsx"],"mappings":";;;;;KAKY,aAAA;AAAA,KACA,UAAA;AAAA,KACA,UAAA;AAAA,UAEK,WAAA,SAAoB,wBAAA;
|
|
1
|
+
{"version":3,"file":"button.d.ts","names":[],"sources":["../../src/button/button.tsx"],"mappings":";;;;;KAKY,aAAA;AAAA,KACA,UAAA;AAAA,KACA,UAAA;AAAA,UAEK,WAAA,SAAoB,wBAAA;EAJZ;EAMvB,OAAA,GAAU,aAAA;EANa;EAQvB,IAAA,GAAO,UAAA;EAPG;EASV,IAAA,GAAO,UAAA;;EAEP,OAAA;EAXoB;AACtB;;;;EAgBE,WAAA;EAde;EAgBf,QAAA;;EAEA,MAAA,GAAS,YAAA;EAdF;EAgBP,YAAA;AAAA;;;;;;cAQW,MAAA,EAAM,KAAA,CAAA,yBAAA,CAAA,WAAA,GAAA,KAAA,CAAA,aAAA,CAAA,iBAAA"}
|
package/dist/button/button.js
CHANGED
|
@@ -3,6 +3,11 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { forwardRef } from "react";
|
|
4
4
|
import { Button } from "@base-ui/react/button";
|
|
5
5
|
//#region src/button/button.tsx
|
|
6
|
+
/**
|
|
7
|
+
* Pressable button with multiple variants, tones, and sizes. Composes
|
|
8
|
+
* `@base-ui/react` Button with focus management and disabled-while-loading.
|
|
9
|
+
* Supports a spinner overlay that preserves button width.
|
|
10
|
+
*/
|
|
6
11
|
const Button$1 = forwardRef(function Button$2({ variant = "solid", tone = "primary", size = "md", loading = false, loadingText, iconOnly = false, nativeButton = true, disabled, className, children, render, ...props }, ref) {
|
|
7
12
|
return /* @__PURE__ */ jsxs(Button, {
|
|
8
13
|
ref,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","names":["Button","BaseButton","styles"],"sources":["../../src/button/button.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactElement } from \"react\";\nimport { Button as BaseButton } from \"@base-ui/react/button\";\nimport styles from \"./button.module.css\";\n\nexport type ButtonVariant = \"solid\" | \"soft\" | \"outline\" | \"ghost\";\nexport type ButtonTone = \"primary\" | \"secondary\" | \"destructive\" | \"success\" | \"warning\";\nexport type ButtonSize = \"xs\" | \"sm\" | \"md\" | \"lg\";\n\nexport interface ButtonProps extends ComponentPropsWithoutRef<\"button\"> {\n variant?: ButtonVariant;\n /** Semantic
|
|
1
|
+
{"version":3,"file":"button.js","names":["Button","BaseButton","styles"],"sources":["../../src/button/button.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactElement } from \"react\";\nimport { Button as BaseButton } from \"@base-ui/react/button\";\nimport styles from \"./button.module.css\";\n\nexport type ButtonVariant = \"solid\" | \"soft\" | \"outline\" | \"ghost\";\nexport type ButtonTone = \"primary\" | \"secondary\" | \"destructive\" | \"success\" | \"warning\";\nexport type ButtonSize = \"xs\" | \"sm\" | \"md\" | \"lg\";\n\nexport interface ButtonProps extends ComponentPropsWithoutRef<\"button\"> {\n /** Visual shape — filled, tinted, outlined, or borderless. @default \"solid\" */\n variant?: ButtonVariant;\n /** Semantic colour. @default \"primary\" */\n tone?: ButtonTone | undefined;\n /** Controls padding and font size. @default \"md\" */\n size?: ButtonSize | undefined;\n /** Shows a spinner overlay and disables interaction. */\n loading?: boolean | undefined;\n /**\n * Text shown in place of children while loading.\n * When provided the button width adapts to this text (variable width).\n * When omitted, children stay rendered invisibly — width stays stable.\n */\n loadingText?: string | undefined;\n /** Renders as a square button with equal padding on all sides. */\n iconOnly?: boolean | undefined;\n /** Custom render element forwarded to base-ui Button. */\n render?: ReactElement | undefined;\n /** Use a native `<button>` element. @default true */\n nativeButton?: boolean | undefined;\n}\n\n/**\n * Pressable button with multiple variants, tones, and sizes. Composes\n * `@base-ui/react` Button with focus management and disabled-while-loading.\n * Supports a spinner overlay that preserves button width.\n */\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n variant = \"solid\",\n tone = \"primary\",\n size = \"md\",\n loading = false,\n loadingText,\n iconOnly = false,\n nativeButton = true,\n disabled,\n className,\n children,\n render,\n ...props\n },\n ref,\n) {\n const classes = [\n styles.root,\n styles[`variant-${variant}`],\n styles[`tone-${tone}`],\n styles[`size-${size}`],\n iconOnly ? styles[\"icon-only\"] : \"\",\n className ?? \"\",\n ]\n .filter(Boolean)\n .join(\" \");\n\n return (\n <BaseButton ref={ref} className={classes} disabled={disabled ?? loading} render={render} nativeButton={nativeButton} {...props}>\n <span className={`${styles.loader} ${loading && !loadingText ? styles[\"loader-visible\"] : \"\"}`} aria-hidden=\"true\">\n <span className={styles.spinner} />\n </span>\n <span className={loading && !loadingText ? styles[\"content-loading\"] : undefined}>\n {loading && loadingText ? loadingText : children}\n </span>\n </BaseButton>\n );\n});\n\nexport { styles as ButtonStyles };\n"],"mappings":";;;;;;;;;;AAqCA,MAAaA,WAAS,WAA2C,SAASA,SACxE,EACE,UAAU,SACV,OAAO,WACP,OAAO,MACP,UAAU,OACV,aACA,WAAW,OACX,eAAe,MACf,UACA,WACA,UACA,QACA,GAAG,SAEL,KACA;AAYA,QACE,qBAACC,QAAD;EAAiB;EAAK,WAZR;GACdC,sBAAO;GACPA,sBAAO,WAAW;GAClBA,sBAAO,QAAQ;GACfA,sBAAO,QAAQ;GACf,WAAWA,sBAAO,eAAe;GACjC,aAAa;GACd,CACE,OAAO,QAAQ,CACf,KAAK,IAAI;EAGgC,UAAU,YAAY;EAAiB;EAAsB;EAAc,GAAI;YAAzH,CACE,oBAAC,QAAD;GAAM,WAAW,GAAGA,sBAAO,OAAO,GAAG,WAAW,CAAC,cAAcA,sBAAO,oBAAoB;GAAM,eAAY;aAC1G,oBAAC,QAAD,EAAM,WAAWA,sBAAO,SAAW,CAAA;GAC9B,CAAA,EACP,oBAAC,QAAD;GAAM,WAAW,WAAW,CAAC,cAAcA,sBAAO,qBAAqB,KAAA;aACpE,WAAW,cAAc,cAAc;GACnC,CAAA,CACI;;EAEf"}
|
package/dist/card/card.d.ts
CHANGED
|
@@ -4,14 +4,21 @@ import styles from "./card.module.css";
|
|
|
4
4
|
|
|
5
5
|
//#region src/card/card.d.ts
|
|
6
6
|
interface CardProps extends ComponentPropsWithoutRef<"div"> {
|
|
7
|
+
/** Apply a raised shadow for layered surfaces. */
|
|
7
8
|
elevated?: boolean;
|
|
9
|
+
/** Add hover/active states for clickable cards. */
|
|
8
10
|
interactive?: boolean;
|
|
9
11
|
}
|
|
10
12
|
interface CardHeaderProps extends Omit<ComponentPropsWithoutRef<"div">, "title"> {
|
|
11
13
|
/** Card heading rendered in the header area. */
|
|
12
14
|
heading?: ReactNode;
|
|
15
|
+
/** Secondary text below the heading. */
|
|
13
16
|
description?: ReactNode;
|
|
14
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Surface container with optional header, body, and footer slots.
|
|
20
|
+
* Pure HTML — no base-ui dependency.
|
|
21
|
+
*/
|
|
15
22
|
declare function Card({
|
|
16
23
|
elevated,
|
|
17
24
|
interactive,
|
|
@@ -19,6 +26,7 @@ declare function Card({
|
|
|
19
26
|
children,
|
|
20
27
|
...props
|
|
21
28
|
}: CardProps): react_jsx_runtime0.JSX.Element;
|
|
29
|
+
/** Header area with optional heading and description. */
|
|
22
30
|
declare function CardHeader({
|
|
23
31
|
heading,
|
|
24
32
|
description,
|
|
@@ -26,11 +34,13 @@ declare function CardHeader({
|
|
|
26
34
|
children,
|
|
27
35
|
...props
|
|
28
36
|
}: CardHeaderProps): react_jsx_runtime0.JSX.Element;
|
|
37
|
+
/** Padded body content area. */
|
|
29
38
|
declare function CardBody({
|
|
30
39
|
className,
|
|
31
40
|
children,
|
|
32
41
|
...props
|
|
33
42
|
}: ComponentPropsWithoutRef<"div">): react_jsx_runtime0.JSX.Element;
|
|
43
|
+
/** Footer area, typically used for actions. */
|
|
34
44
|
declare function CardFooter({
|
|
35
45
|
className,
|
|
36
46
|
children,
|
package/dist/card/card.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.d.ts","names":[],"sources":["../../src/card/card.tsx"],"mappings":";;;;;UAGiB,SAAA,SAAkB,wBAAA
|
|
1
|
+
{"version":3,"file":"card.d.ts","names":[],"sources":["../../src/card/card.tsx"],"mappings":";;;;;UAGiB,SAAA,SAAkB,wBAAA;;EAEjC,QAAA;EAFe;EAIf,WAAA;AAAA;AAAA,UAIe,eAAA,SAAwB,IAAA,CAAK,wBAAA;EARX;EAUjC,OAAA,GAAU,SAAA;EANV;EAQA,WAAA,GAAc,SAAA;AAAA;AAJhB;;;;AAAA,iBAWgB,IAAA,CAAA;EAAO,QAAA;EAAU,WAAA;EAAa,SAAA;EAAW,QAAA;EAAA,GAAa;AAAA,GAAS,SAAA,GAAS,kBAAA,CAAA,GAAA,CAAA,OAAA;;iBAcxE,UAAA,CAAA;EAAa,OAAA;EAAS,WAAA;EAAa,SAAA;EAAW,QAAA;EAAA,GAAa;AAAA,GAAS,eAAA,GAAe,kBAAA,CAAA,GAAA,CAAA,OAAA;;iBAWnF,QAAA,CAAA;EAAW,SAAA;EAAW,QAAA;EAAA,GAAa;AAAA,GAAS,wBAAA,UAA+B,kBAAA,CAAA,GAAA,CAAA,OAAA;;iBAS3E,UAAA,CAAA;EAAa,SAAA;EAAW,QAAA;EAAA,GAAa;AAAA,GAAS,wBAAA,UAA+B,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
package/dist/card/card.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import card_module_default from "./card.module.js";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
//#region src/card/card.tsx
|
|
4
|
+
/**
|
|
5
|
+
* Surface container with optional header, body, and footer slots.
|
|
6
|
+
* Pure HTML — no base-ui dependency.
|
|
7
|
+
*/
|
|
4
8
|
function Card({ elevated, interactive, className, children, ...props }) {
|
|
5
9
|
return /* @__PURE__ */ jsx("div", {
|
|
6
10
|
className: [
|
|
@@ -13,6 +17,7 @@ function Card({ elevated, interactive, className, children, ...props }) {
|
|
|
13
17
|
children
|
|
14
18
|
});
|
|
15
19
|
}
|
|
20
|
+
/** Header area with optional heading and description. */
|
|
16
21
|
function CardHeader({ heading, description, className, children, ...props }) {
|
|
17
22
|
return /* @__PURE__ */ jsxs("div", {
|
|
18
23
|
className: `${card_module_default.header} ${className ?? ""}`,
|
|
@@ -30,6 +35,7 @@ function CardHeader({ heading, description, className, children, ...props }) {
|
|
|
30
35
|
]
|
|
31
36
|
});
|
|
32
37
|
}
|
|
38
|
+
/** Padded body content area. */
|
|
33
39
|
function CardBody({ className, children, ...props }) {
|
|
34
40
|
return /* @__PURE__ */ jsx("div", {
|
|
35
41
|
className: `${card_module_default.body} ${className ?? ""}`,
|
|
@@ -37,6 +43,7 @@ function CardBody({ className, children, ...props }) {
|
|
|
37
43
|
children
|
|
38
44
|
});
|
|
39
45
|
}
|
|
46
|
+
/** Footer area, typically used for actions. */
|
|
40
47
|
function CardFooter({ className, children, ...props }) {
|
|
41
48
|
return /* @__PURE__ */ jsx("div", {
|
|
42
49
|
className: `${card_module_default.footer} ${className ?? ""}`,
|
package/dist/card/card.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.js","names":["styles"],"sources":["../../src/card/card.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport styles from \"./card.module.css\";\n\nexport interface CardProps extends ComponentPropsWithoutRef<\"div\"> {\n elevated?: boolean;\n interactive?: boolean;\n}\n\n// Omit `title` (HTML string attr) so we can accept ReactNode as `heading`\nexport interface CardHeaderProps extends Omit<ComponentPropsWithoutRef<\"div\">, \"title\"> {\n /** Card heading rendered in the header area. */\n heading?: ReactNode;\n description?: ReactNode;\n}\n\nexport function Card({ elevated, interactive, className, children, ...props }: CardProps) {\n return (\n <div\n className={[styles.root, elevated ? styles[\"root-elevated\"] : \"\", interactive ? styles[\"root-interactive\"] : \"\", className ?? \"\"]\n .filter(Boolean)\n .join(\" \")}\n {...props}\n >\n {children}\n </div>\n );\n}\n\nexport function CardHeader({ heading, description, className, children, ...props }: CardHeaderProps) {\n return (\n <div className={`${styles.header} ${className ?? \"\"}`} {...props}>\n {heading && <span className={styles.title}>{heading}</span>}\n {description && <span className={styles.description}>{description}</span>}\n {children}\n </div>\n );\n}\n\nexport function CardBody({ className, children, ...props }: ComponentPropsWithoutRef<\"div\">) {\n return (\n <div className={`${styles.body} ${className ?? \"\"}`} {...props}>\n {children}\n </div>\n );\n}\n\nexport function CardFooter({ className, children, ...props }: ComponentPropsWithoutRef<\"div\">) {\n return (\n <div className={`${styles.footer} ${className ?? \"\"}`} {...props}>\n {children}\n </div>\n );\n}\nexport { styles as CardStyles };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"card.js","names":["styles"],"sources":["../../src/card/card.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport styles from \"./card.module.css\";\n\nexport interface CardProps extends ComponentPropsWithoutRef<\"div\"> {\n /** Apply a raised shadow for layered surfaces. */\n elevated?: boolean;\n /** Add hover/active states for clickable cards. */\n interactive?: boolean;\n}\n\n// Omit `title` (HTML string attr) so we can accept ReactNode as `heading`\nexport interface CardHeaderProps extends Omit<ComponentPropsWithoutRef<\"div\">, \"title\"> {\n /** Card heading rendered in the header area. */\n heading?: ReactNode;\n /** Secondary text below the heading. */\n description?: ReactNode;\n}\n\n/**\n * Surface container with optional header, body, and footer slots.\n * Pure HTML — no base-ui dependency.\n */\nexport function Card({ elevated, interactive, className, children, ...props }: CardProps) {\n return (\n <div\n className={[styles.root, elevated ? styles[\"root-elevated\"] : \"\", interactive ? styles[\"root-interactive\"] : \"\", className ?? \"\"]\n .filter(Boolean)\n .join(\" \")}\n {...props}\n >\n {children}\n </div>\n );\n}\n\n/** Header area with optional heading and description. */\nexport function CardHeader({ heading, description, className, children, ...props }: CardHeaderProps) {\n return (\n <div className={`${styles.header} ${className ?? \"\"}`} {...props}>\n {heading && <span className={styles.title}>{heading}</span>}\n {description && <span className={styles.description}>{description}</span>}\n {children}\n </div>\n );\n}\n\n/** Padded body content area. */\nexport function CardBody({ className, children, ...props }: ComponentPropsWithoutRef<\"div\">) {\n return (\n <div className={`${styles.body} ${className ?? \"\"}`} {...props}>\n {children}\n </div>\n );\n}\n\n/** Footer area, typically used for actions. */\nexport function CardFooter({ className, children, ...props }: ComponentPropsWithoutRef<\"div\">) {\n return (\n <div className={`${styles.footer} ${className ?? \"\"}`} {...props}>\n {children}\n </div>\n );\n}\nexport { styles as CardStyles };\n"],"mappings":";;;;;;;AAsBA,SAAgB,KAAK,EAAE,UAAU,aAAa,WAAW,UAAU,GAAG,SAAoB;AACxF,QACE,oBAAC,OAAD;EACE,WAAW;GAACA,oBAAO;GAAM,WAAWA,oBAAO,mBAAmB;GAAI,cAAcA,oBAAO,sBAAsB;GAAI,aAAa;GAAG,CAC9H,OAAO,QAAQ,CACf,KAAK,IAAI;EACZ,GAAI;EAEH;EACG,CAAA;;;AAKV,SAAgB,WAAW,EAAE,SAAS,aAAa,WAAW,UAAU,GAAG,SAA0B;AACnG,QACE,qBAAC,OAAD;EAAK,WAAW,GAAGA,oBAAO,OAAO,GAAG,aAAa;EAAM,GAAI;YAA3D;GACG,WAAW,oBAAC,QAAD;IAAM,WAAWA,oBAAO;cAAQ;IAAe,CAAA;GAC1D,eAAe,oBAAC,QAAD;IAAM,WAAWA,oBAAO;cAAc;IAAmB,CAAA;GACxE;GACG;;;;AAKV,SAAgB,SAAS,EAAE,WAAW,UAAU,GAAG,SAA0C;AAC3F,QACE,oBAAC,OAAD;EAAK,WAAW,GAAGA,oBAAO,KAAK,GAAG,aAAa;EAAM,GAAI;EACtD;EACG,CAAA;;;AAKV,SAAgB,WAAW,EAAE,WAAW,UAAU,GAAG,SAA0C;AAC7F,QACE,oBAAC,OAAD;EAAK,WAAW,GAAGA,oBAAO,OAAO,GAAG,aAAa;EAAM,GAAI;EACxD;EACG,CAAA"}
|