xiod-ui 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +73 -0
- package/README.md +167 -0
- package/dist/components/accordion.d.ts +9 -0
- package/dist/components/accordion.js +46 -0
- package/dist/components/agent-steps.d.ts +47 -0
- package/dist/components/agent-steps.js +223 -0
- package/dist/components/alert-dialog.d.ts +21 -0
- package/dist/components/alert-dialog.js +74 -0
- package/dist/components/alert.d.ts +12 -0
- package/dist/components/alert.js +45 -0
- package/dist/components/aspect-ratio.d.ts +9 -0
- package/dist/components/aspect-ratio.js +22 -0
- package/dist/components/autocomplete.d.ts +35 -0
- package/dist/components/autocomplete.js +160 -0
- package/dist/components/avatar.d.ts +17 -0
- package/dist/components/avatar.js +65 -0
- package/dist/components/badge.d.ts +15 -0
- package/dist/components/badge.js +46 -0
- package/dist/components/breadcrumb.d.ts +12 -0
- package/dist/components/breadcrumb.js +75 -0
- package/dist/components/button-group.d.ts +14 -0
- package/dist/components/button-group.js +45 -0
- package/dist/components/button-split.d.ts +19 -0
- package/dist/components/button-split.js +73 -0
- package/dist/components/button.d.ts +15 -0
- package/dist/components/button.js +54 -0
- package/dist/components/calendar.d.ts +63 -0
- package/dist/components/calendar.js +425 -0
- package/dist/components/card.d.ts +17 -0
- package/dist/components/card.js +139 -0
- package/dist/components/carousel.d.ts +59 -0
- package/dist/components/carousel.js +503 -0
- package/dist/components/checkbox.d.ts +16 -0
- package/dist/components/checkbox.js +86 -0
- package/dist/components/circular-progress.d.ts +28 -0
- package/dist/components/circular-progress.js +127 -0
- package/dist/components/collapsible.d.ts +8 -0
- package/dist/components/collapsible.js +27 -0
- package/dist/components/color-picker.d.ts +159 -0
- package/dist/components/color-picker.js +1589 -0
- package/dist/components/combobox.d.ts +46 -0
- package/dist/components/combobox.js +237 -0
- package/dist/components/command.d.ts +22 -0
- package/dist/components/command.js +129 -0
- package/dist/components/context-menu.d.ts +38 -0
- package/dist/components/context-menu.js +164 -0
- package/dist/components/copy-to-clipboard.d.ts +32 -0
- package/dist/components/copy-to-clipboard.js +83 -0
- package/dist/components/corner-badge.d.ts +22 -0
- package/dist/components/corner-badge.js +84 -0
- package/dist/components/dashboard-grid.d.ts +83 -0
- package/dist/components/dashboard-grid.js +486 -0
- package/dist/components/date-picker.d.ts +29 -0
- package/dist/components/date-picker.js +261 -0
- package/dist/components/dialog.d.ts +26 -0
- package/dist/components/dialog.js +97 -0
- package/dist/components/dot-matrix.d.ts +32 -0
- package/dist/components/dot-matrix.js +707 -0
- package/dist/components/draggable.d.ts +42 -0
- package/dist/components/draggable.js +346 -0
- package/dist/components/drawer.d.ts +66 -0
- package/dist/components/drawer.js +304 -0
- package/dist/components/empty.d.ts +14 -0
- package/dist/components/empty.js +75 -0
- package/dist/components/field.d.ts +12 -0
- package/dist/components/field.js +44 -0
- package/dist/components/fieldset.d.ts +7 -0
- package/dist/components/fieldset.js +21 -0
- package/dist/components/file-upload.d.ts +61 -0
- package/dist/components/file-upload.js +482 -0
- package/dist/components/form.d.ts +6 -0
- package/dist/components/form.js +14 -0
- package/dist/components/frame.d.ts +10 -0
- package/dist/components/frame.js +47 -0
- package/dist/components/gauge.d.ts +27 -0
- package/dist/components/gauge.js +74 -0
- package/dist/components/grid.d.ts +26 -0
- package/dist/components/grid.js +204 -0
- package/dist/components/group.d.ts +19 -0
- package/dist/components/group.js +45 -0
- package/dist/components/input-group.d.ts +15 -0
- package/dist/components/input-group.js +61 -0
- package/dist/components/input-otp.d.ts +24 -0
- package/dist/components/input-otp.js +50 -0
- package/dist/components/input-payment.d.ts +131 -0
- package/dist/components/input-payment.js +1140 -0
- package/dist/components/input-phone.d.ts +70 -0
- package/dist/components/input-phone.js +657 -0
- package/dist/components/input-sensitive.d.ts +12 -0
- package/dist/components/input-sensitive.js +169 -0
- package/dist/components/input.d.ts +13 -0
- package/dist/components/input.js +26 -0
- package/dist/components/kbd.d.ts +6 -0
- package/dist/components/kbd.js +19 -0
- package/dist/components/kinetic-click.d.ts +48 -0
- package/dist/components/kinetic-click.js +1184 -0
- package/dist/components/label.d.ts +6 -0
- package/dist/components/label.js +18 -0
- package/dist/components/list-box.d.ts +20 -0
- package/dist/components/list-box.js +148 -0
- package/dist/components/loader.d.ts +13 -0
- package/dist/components/loader.js +430 -0
- package/dist/components/marker.d.ts +15 -0
- package/dist/components/marker.js +59 -0
- package/dist/components/menu.d.ts +42 -0
- package/dist/components/menu.js +186 -0
- package/dist/components/menubar.d.ts +40 -0
- package/dist/components/menubar.js +107 -0
- package/dist/components/message.d.ts +33 -0
- package/dist/components/message.js +112 -0
- package/dist/components/meter.d.ts +10 -0
- package/dist/components/meter.js +42 -0
- package/dist/components/morphic-toast.d.ts +61 -0
- package/dist/components/morphic-toast.js +916 -0
- package/dist/components/navigation-menu.d.ts +26 -0
- package/dist/components/navigation-menu.js +116 -0
- package/dist/components/number-field.d.ts +15 -0
- package/dist/components/number-field.js +86 -0
- package/dist/components/option-picker.d.ts +18 -0
- package/dist/components/option-picker.js +89 -0
- package/dist/components/orb.d.ts +38 -0
- package/dist/components/orb.js +1413 -0
- package/dist/components/pagination.d.ts +25 -0
- package/dist/components/pagination.js +147 -0
- package/dist/components/popover.d.ts +22 -0
- package/dist/components/popover.js +79 -0
- package/dist/components/preview-card.d.ts +16 -0
- package/dist/components/preview-card.js +60 -0
- package/dist/components/progress.d.ts +21 -0
- package/dist/components/progress.js +139 -0
- package/dist/components/radio.d.ts +16 -0
- package/dist/components/radio.js +68 -0
- package/dist/components/resizable.d.ts +58 -0
- package/dist/components/resizable.js +964 -0
- package/dist/components/ruler-picker.d.ts +27 -0
- package/dist/components/ruler-picker.js +253 -0
- package/dist/components/scroll-area.d.ts +13 -0
- package/dist/components/scroll-area.js +34 -0
- package/dist/components/scroll-bar.d.ts +13 -0
- package/dist/components/scroll-bar.js +47 -0
- package/dist/components/select.d.ts +29 -0
- package/dist/components/select.js +140 -0
- package/dist/components/separator.d.ts +6 -0
- package/dist/components/separator.js +15 -0
- package/dist/components/sidebar.d.ts +65 -0
- package/dist/components/sidebar.js +408 -0
- package/dist/components/skeleton.d.ts +5 -0
- package/dist/components/skeleton.js +12 -0
- package/dist/components/slider.d.ts +12 -0
- package/dist/components/slider.js +96 -0
- package/dist/components/sortable.d.ts +44 -0
- package/dist/components/sortable.js +327 -0
- package/dist/components/switch.d.ts +15 -0
- package/dist/components/switch.js +63 -0
- package/dist/components/table.d.ts +12 -0
- package/dist/components/table.js +65 -0
- package/dist/components/tabs.d.ts +12 -0
- package/dist/components/tabs.js +39 -0
- package/dist/components/text.d.ts +14 -0
- package/dist/components/text.js +69 -0
- package/dist/components/textarea.d.ts +9 -0
- package/dist/components/textarea.js +20 -0
- package/dist/components/theme-provider.d.ts +52 -0
- package/dist/components/theme-provider.js +148 -0
- package/dist/components/timeline.d.ts +34 -0
- package/dist/components/timeline.js +147 -0
- package/dist/components/toast.d.ts +17 -0
- package/dist/components/toast.js +161 -0
- package/dist/components/toggle-group.d.ts +14 -0
- package/dist/components/toggle-group.js +53 -0
- package/dist/components/toggle.d.ts +11 -0
- package/dist/components/toggle.js +36 -0
- package/dist/components/toolbar.d.ts +11 -0
- package/dist/components/toolbar.js +49 -0
- package/dist/components/tooltip.d.ts +17 -0
- package/dist/components/tooltip.js +56 -0
- package/dist/components/waveform.d.ts +61 -0
- package/dist/components/waveform.js +500 -0
- package/dist/components/wheel-picker.d.ts +44 -0
- package/dist/components/wheel-picker.js +771 -0
- package/dist/hooks/use-copy-to-clipboard.d.ts +9 -0
- package/dist/hooks/use-copy-to-clipboard.js +36 -0
- package/dist/hooks/use-media-query.d.ts +21 -0
- package/dist/hooks/use-media-query.js +58 -0
- package/dist/styles.css +202 -0
- package/dist/themes/afterglow.css +89 -0
- package/dist/themes/afterglow.scoped.css +90 -0
- package/dist/themes/blacklight.css +89 -0
- package/dist/themes/blacklight.scoped.css +90 -0
- package/dist/themes/cathode.css +89 -0
- package/dist/themes/cathode.scoped.css +90 -0
- package/dist/themes/cel.css +89 -0
- package/dist/themes/cel.scoped.css +90 -0
- package/dist/themes/cinder.css +89 -0
- package/dist/themes/cinder.scoped.css +90 -0
- package/dist/themes/clay.css +89 -0
- package/dist/themes/clay.scoped.css +90 -0
- package/dist/themes/cobalt.css +89 -0
- package/dist/themes/cobalt.scoped.css +90 -0
- package/dist/themes/crimson.css +89 -0
- package/dist/themes/crimson.scoped.css +90 -0
- package/dist/themes/ion.css +89 -0
- package/dist/themes/ion.scoped.css +90 -0
- package/dist/themes/iris.css +89 -0
- package/dist/themes/iris.scoped.css +90 -0
- package/dist/themes/lagoon.css +89 -0
- package/dist/themes/lagoon.scoped.css +90 -0
- package/dist/themes/mochi.css +89 -0
- package/dist/themes/mochi.scoped.css +90 -0
- package/dist/themes/riso.css +89 -0
- package/dist/themes/riso.scoped.css +90 -0
- package/dist/themes/roast.css +89 -0
- package/dist/themes/roast.scoped.css +90 -0
- package/dist/themes/sage.css +89 -0
- package/dist/themes/sage.scoped.css +90 -0
- package/dist/themes/sepia.css +89 -0
- package/dist/themes/sepia.scoped.css +90 -0
- package/dist/themes/sorbet.css +89 -0
- package/dist/themes/sorbet.scoped.css +90 -0
- package/dist/themes/taffy.css +89 -0
- package/dist/themes/taffy.scoped.css +90 -0
- package/dist/themes/toxin.css +89 -0
- package/dist/themes/toxin.scoped.css +90 -0
- package/package.json +140 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
Required Notice: Copyright 2026 ImKKingshuk (https://github.com/ImKKingshuk)
|
|
2
|
+
|
|
3
|
+
# PolyForm Perimeter License 1.0.1
|
|
4
|
+
|
|
5
|
+
<https://polyformproject.org/licenses/perimeter/1.0.1>
|
|
6
|
+
|
|
7
|
+
## Acceptance
|
|
8
|
+
|
|
9
|
+
In order to get any license under these terms, you must agree to them as both strict obligations and conditions to all your licenses.
|
|
10
|
+
|
|
11
|
+
## Copyright License
|
|
12
|
+
|
|
13
|
+
The licensor grants you a copyright license for the software to do everything you might do with the software that would otherwise infringe the licensor's copyright in it for any permitted purpose. However, you may only distribute the software according to [Distribution License](#distribution-license) and make changes or new works based on the software according to [Changes and New Works License](#changes-and-new-works-license).
|
|
14
|
+
|
|
15
|
+
## Distribution License
|
|
16
|
+
|
|
17
|
+
The licensor grants you an additional copyright license to distribute copies of the software. Your license to distribute covers distributing the software with changes and new works permitted by [Changes and New Works License](#changes-and-new-works-license).
|
|
18
|
+
|
|
19
|
+
## Notices
|
|
20
|
+
|
|
21
|
+
You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms or the URL for them above, as well as copies of any plain-text lines beginning with `Required Notice:` that the licensor provided with the software. For example:
|
|
22
|
+
|
|
23
|
+
> Required Notice: Copyright Yoyodyne, Inc. (http://example.com)
|
|
24
|
+
|
|
25
|
+
## Changes and New Works License
|
|
26
|
+
|
|
27
|
+
The licensor grants you an additional copyright license to make changes and new works based on the software for any permitted purpose.
|
|
28
|
+
|
|
29
|
+
## Patent License
|
|
30
|
+
|
|
31
|
+
The licensor grants you a patent license for the software that covers patent claims the licensor can license, or becomes able to license, that you would infringe by using the software.
|
|
32
|
+
|
|
33
|
+
## Noncompete
|
|
34
|
+
|
|
35
|
+
Any purpose is a permitted purpose, except for providing to others any product that competes with the software.
|
|
36
|
+
|
|
37
|
+
## Competition
|
|
38
|
+
|
|
39
|
+
If you use this software to market a product as a substitute for the functionality or value of the software, it competes with the software. A product may compete regardless how it is designed or deployed. For example, a product may compete even if it provides its functionality via any kind of interface (including services, libraries or plug-ins), even if it is ported to a different platform or programming language, and even if it is provided free of charge.
|
|
40
|
+
|
|
41
|
+
## Fair Use
|
|
42
|
+
|
|
43
|
+
You may have "fair use" rights for the software under the law. These terms do not limit them.
|
|
44
|
+
|
|
45
|
+
## No Other Rights
|
|
46
|
+
|
|
47
|
+
These terms do not allow you to sublicense or transfer any of your licenses to anyone else, or prevent the licensor from granting licenses to anyone else. These terms do not imply any other licenses.
|
|
48
|
+
|
|
49
|
+
## Patent Defense
|
|
50
|
+
|
|
51
|
+
If you make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
|
|
52
|
+
|
|
53
|
+
## Violations
|
|
54
|
+
|
|
55
|
+
The first time you are notified in writing that you have violated any of these terms, or done anything with the software not covered by your licenses, your licenses can nonetheless continue if you come into full compliance with these terms, and take practical steps to correct past violations, within 32 days of receiving notice. Otherwise, all your licenses end immediately.
|
|
56
|
+
|
|
57
|
+
## No Liability
|
|
58
|
+
|
|
59
|
+
***As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.***
|
|
60
|
+
|
|
61
|
+
## Definitions
|
|
62
|
+
|
|
63
|
+
The **licensor** is the individual or entity offering these terms, and the **software** is the software the licensor makes available under these terms.
|
|
64
|
+
|
|
65
|
+
A **product** can be a good or service, or a combination of them.
|
|
66
|
+
|
|
67
|
+
**You** refers to the individual or entity agreeing to these terms.
|
|
68
|
+
|
|
69
|
+
**Your company** is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. **Control** means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
|
|
70
|
+
|
|
71
|
+
**Your licenses** are all the licenses granted to you for the software under these terms.
|
|
72
|
+
|
|
73
|
+
**Use** means anything you do with the software requiring one of your licenses.
|
package/README.md
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
# XiodUI
|
|
2
|
+
|
|
3
|
+
A React component library for building interfaces with consistent styling, flexible composition, and built-in light and dark themes.
|
|
4
|
+
|
|
5
|
+
XiodUI includes 89 components built with Base UI, Tailwind CSS 4, and XiodIcons.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- **Composable components** — combine buttons, forms, navigation, overlays, and layouts.
|
|
10
|
+
- **Accessible foundations** — Base UI primitives provide behavior for supported interactive components.
|
|
11
|
+
- **Customizable styling** — adjust CSS variables, component variants, and `className`.
|
|
12
|
+
- **Light and dark themes** — use the default colors or choose from 19 palettes.
|
|
13
|
+
- **TypeScript support** — typed props and individual component imports.
|
|
14
|
+
- **XiodIcons included** — built-in icons use the `xiod-icons` package.
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
XiodUI requires React 19.3 or later within React 19, matching React DOM, Node.js 20 or later, and a project configured with Tailwind CSS 4.3 or later.
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install xiod-ui
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
If React is not already installed:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm install react@^19 react-dom@^19
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Base UI and XiodIcons are installed automatically. You do not need to install them separately to use XiodUI's built-in components.
|
|
31
|
+
|
|
32
|
+
## Quick start
|
|
33
|
+
|
|
34
|
+
Import XiodUI's stylesheet after Tailwind in the global CSS loaded by your application:
|
|
35
|
+
|
|
36
|
+
```css
|
|
37
|
+
@import "tailwindcss";
|
|
38
|
+
@import "xiod-ui/styles";
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
This provides the design tokens and registers the component files for Tailwind's utility generation. Your project's Tailwind integration must already be configured.
|
|
42
|
+
|
|
43
|
+
Then import the components you need:
|
|
44
|
+
|
|
45
|
+
```tsx
|
|
46
|
+
"use client";
|
|
47
|
+
|
|
48
|
+
import { Button } from "xiod-ui/button";
|
|
49
|
+
import {
|
|
50
|
+
Dialog,
|
|
51
|
+
DialogDescription,
|
|
52
|
+
DialogHeader,
|
|
53
|
+
DialogPopup,
|
|
54
|
+
DialogTitle,
|
|
55
|
+
DialogTrigger,
|
|
56
|
+
} from "xiod-ui/dialog";
|
|
57
|
+
|
|
58
|
+
export function Example() {
|
|
59
|
+
return (
|
|
60
|
+
<Dialog>
|
|
61
|
+
<DialogTrigger render={<Button>View details</Button>} />
|
|
62
|
+
<DialogPopup>
|
|
63
|
+
<DialogHeader>
|
|
64
|
+
<DialogTitle>Everything in one place</DialogTitle>
|
|
65
|
+
<DialogDescription>
|
|
66
|
+
Build your interface with components that work together.
|
|
67
|
+
</DialogDescription>
|
|
68
|
+
</DialogHeader>
|
|
69
|
+
</DialogPopup>
|
|
70
|
+
</Dialog>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
In frameworks that support React Server Components, place interactive code in a client component, as shown above.
|
|
76
|
+
|
|
77
|
+
## Imports
|
|
78
|
+
|
|
79
|
+
Each component has its own import path. Root imports such as `import { Button } from "xiod-ui"` are not supported.
|
|
80
|
+
|
|
81
|
+
```tsx
|
|
82
|
+
import { Button } from "xiod-ui/button";
|
|
83
|
+
import { Input } from "xiod-ui/input";
|
|
84
|
+
import { useCopyToClipboard } from "xiod-ui/hooks/use-copy-to-clipboard";
|
|
85
|
+
import { useIsMobile, useMediaQuery } from "xiod-ui/hooks/use-media-query";
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Individual JavaScript modules allow bundlers to include the components you use. The shared stylesheet registers the full component collection for Tailwind scanning; its CSS output does not follow JavaScript tree-shaking.
|
|
89
|
+
|
|
90
|
+
## Components
|
|
91
|
+
|
|
92
|
+
| Category | Examples |
|
|
93
|
+
| ------------------ | --------------------------------------------------------------------------- |
|
|
94
|
+
| Actions | Button, ButtonGroup, Toggle, Toolbar, CopyToClipboard |
|
|
95
|
+
| Forms | Input, Checkbox, Select, Combobox, Slider, Calendar, DatePicker, FileUpload |
|
|
96
|
+
| Navigation | Breadcrumb, Sidebar, Tabs, Menu, Pagination |
|
|
97
|
+
| Overlays | Dialog, AlertDialog, Drawer, Popover, Tooltip, Toast |
|
|
98
|
+
| Content | Card, Table, Accordion, Avatar, Badge, Message, Timeline |
|
|
99
|
+
| Feedback | Alert, Progress, CircularProgress, Gauge, Loader, Skeleton |
|
|
100
|
+
| Layout | Grid, DashboardGrid, Carousel, Resizable, ScrollArea |
|
|
101
|
+
| Specialized inputs | ColorPicker, InputPhone, InputPayment, InputOtp, InputSensitive |
|
|
102
|
+
| Visuals | Orb, Waveform, DotMatrix, Marker |
|
|
103
|
+
|
|
104
|
+
Components expose their own typed props and variants. Use your editor's TypeScript suggestions to explore the available options.
|
|
105
|
+
|
|
106
|
+
## Theming
|
|
107
|
+
|
|
108
|
+
Override design tokens after the stylesheet imports to customize colors and the corner radius:
|
|
109
|
+
|
|
110
|
+
```css
|
|
111
|
+
:root {
|
|
112
|
+
--radius: 0.5rem;
|
|
113
|
+
--primary: oklch(0.55 0.22 264);
|
|
114
|
+
--primary-foreground: white;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.dark {
|
|
118
|
+
--primary: oklch(0.72 0.19 264);
|
|
119
|
+
--primary-foreground: oklch(0.15 0.02 264);
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
For a ready-made palette, add its stylesheet after the base styles:
|
|
124
|
+
|
|
125
|
+
```css
|
|
126
|
+
@import "tailwindcss";
|
|
127
|
+
@import "xiod-ui/styles";
|
|
128
|
+
@import "xiod-ui/themes/iris";
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Dark mode
|
|
132
|
+
|
|
133
|
+
Add the `dark` class to your page's `<html>` element, or wrap your application with `ThemeProvider`:
|
|
134
|
+
|
|
135
|
+
```tsx
|
|
136
|
+
"use client";
|
|
137
|
+
|
|
138
|
+
import type { ReactNode } from "react";
|
|
139
|
+
import { ThemeProvider } from "xiod-ui/theme-provider";
|
|
140
|
+
|
|
141
|
+
export function Providers({ children }: { children: ReactNode }) {
|
|
142
|
+
return <ThemeProvider defaultTheme="system">{children}</ThemeProvider>;
|
|
143
|
+
}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
The provider follows your system's theme preference and remembers your selection. Within the provider, `useTheme()` returns `theme`, `resolvedTheme`, and `setTheme`. Call `setTheme` with `"light"`, `"dark"`, or `"system"` to change the theme.
|
|
147
|
+
|
|
148
|
+
## Support
|
|
149
|
+
|
|
150
|
+
Report bugs and request features in [GitHub Issues](https://github.com/ImKKingshuk/XiodUI/issues). When reporting a problem, include the component name, package version, and a minimal example that reproduces the issue.
|
|
151
|
+
|
|
152
|
+
## License
|
|
153
|
+
|
|
154
|
+
Licensed under [PolyForm Perimeter 1.0.1](https://polyformproject.org/licenses/perimeter/1.0.1).
|
|
155
|
+
Use in personal projects, hobby projects, and commercial projects
|
|
156
|
+
is permitted subject to the license, including its restriction on providing
|
|
157
|
+
competing products. This is not an unrestricted open-source license.
|
|
158
|
+
|
|
159
|
+
When distributing any part of the package, include the license terms or their
|
|
160
|
+
URL and the required copyright notice below. The complete license and notice are
|
|
161
|
+
also included in the package's `LICENSE` file.
|
|
162
|
+
|
|
163
|
+
```text
|
|
164
|
+
Required Notice: Copyright 2026 ImKKingshuk (https://github.com/ImKKingshuk)
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Dependencies, including `xiod-icons`, retain their own licenses.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Accordion as Accordion$1 } from "@base-ui/react/accordion";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
//#region src/components/accordion.d.ts
|
|
4
|
+
declare function Accordion(props: Accordion$1.Root.Props): React$1.JSX.Element;
|
|
5
|
+
declare function AccordionItem({ className, ...props }: Accordion$1.Item.Props): React$1.JSX.Element;
|
|
6
|
+
declare function AccordionTrigger({ className, children, ...props }: Accordion$1.Trigger.Props): React$1.JSX.Element;
|
|
7
|
+
declare function AccordionPanel({ className, children, ...props }: Accordion$1.Panel.Props): React$1.JSX.Element;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { Accordion, AccordionPanel as AccordionContent, AccordionPanel, AccordionItem, AccordionTrigger };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Accordion as Accordion$1 } from "@base-ui/react/accordion";
|
|
3
|
+
import { cn } from "cn";
|
|
4
|
+
import { ChevronDown } from "xiod-icons/icons/ChevronDown";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/accordion.tsx
|
|
7
|
+
function Accordion(props) {
|
|
8
|
+
return /* @__PURE__ */ jsx(Accordion$1.Root, {
|
|
9
|
+
"data-slot": "accordion",
|
|
10
|
+
...props
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function AccordionItem({ className, ...props }) {
|
|
14
|
+
return /* @__PURE__ */ jsx(Accordion$1.Item, {
|
|
15
|
+
className: cn("border-b last:border-b-0", className),
|
|
16
|
+
"data-slot": "accordion-item",
|
|
17
|
+
...props
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function AccordionTrigger({ className, children, ...props }) {
|
|
21
|
+
return /* @__PURE__ */ jsx(Accordion$1.Header, {
|
|
22
|
+
className: "flex",
|
|
23
|
+
children: /* @__PURE__ */ jsxs(Accordion$1.Trigger, {
|
|
24
|
+
className: cn("relative flex flex-1 cursor-pointer items-start justify-between gap-4 rounded-md py-4 text-left font-medium text-sm outline-none transition-[color,background-color,box-shadow,opacity] focus-visible:ring-[3px] focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-64 data-panel-open:*:data-[slot=accordion-indicator]:rotate-180 pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", className),
|
|
25
|
+
"data-slot": "accordion-trigger",
|
|
26
|
+
...props,
|
|
27
|
+
children: [children, /* @__PURE__ */ jsx(ChevronDown, {
|
|
28
|
+
className: "pointer-events-none size-4 shrink-0 translate-y-0.5 opacity-80 transition-transform duration-200 ease-in-out",
|
|
29
|
+
"data-slot": "accordion-indicator"
|
|
30
|
+
})]
|
|
31
|
+
})
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function AccordionPanel({ className, children, ...props }) {
|
|
35
|
+
return /* @__PURE__ */ jsx(Accordion$1.Panel, {
|
|
36
|
+
className: "h-(--accordion-panel-height) overflow-hidden text-muted-foreground text-sm transition-[height] duration-200 ease-in-out data-ending-style:h-0 data-starting-style:h-0",
|
|
37
|
+
"data-slot": "accordion-panel",
|
|
38
|
+
...props,
|
|
39
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
40
|
+
className: cn("pt-0 pb-4", className),
|
|
41
|
+
children
|
|
42
|
+
})
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
export { Accordion, AccordionPanel as AccordionContent, AccordionPanel, AccordionItem, AccordionTrigger };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { VariantProps } from "class-variance-authority";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import { IconComponent } from "xiod-icons";
|
|
4
|
+
//#region src/components/agent-steps.d.ts
|
|
5
|
+
export declare const agentStepsVariants: (props?: ({
|
|
6
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
type AgentStepIconValue = "thinking" | "searching" | "editing" | "executing" | "planning" | "completed" | "execute" | "verify" | "done" | "error" | IconComponent | Exclude<React$1.ReactNode, string>;
|
|
9
|
+
export interface AgentStepItem {
|
|
10
|
+
label: React$1.ReactNode;
|
|
11
|
+
icon?: AgentStepIconValue;
|
|
12
|
+
status?: "waiting" | "running" | "completed" | "failed";
|
|
13
|
+
}
|
|
14
|
+
export interface AgentStepsProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof agentStepsVariants> {
|
|
15
|
+
/** [Single-mode] The current active step label */
|
|
16
|
+
label?: React$1.ReactNode;
|
|
17
|
+
/** [Single-mode] The icon type or XiodIcons component to show */
|
|
18
|
+
icon?: AgentStepIconValue;
|
|
19
|
+
/** [Single-mode] The status of the step. Default is "running". */
|
|
20
|
+
status?: "waiting" | "running" | "completed" | "failed";
|
|
21
|
+
/** [Single-mode] Whether to show the icon. Default is true. */
|
|
22
|
+
showIcon?: boolean;
|
|
23
|
+
/** [Single-mode] Optional array of steps to cycle through automatically */
|
|
24
|
+
steps?: AgentStepItem[] | string[];
|
|
25
|
+
/** [Single-mode] Transition interval for automatic cycling in milliseconds. Default is 4000. */
|
|
26
|
+
interval?: number;
|
|
27
|
+
/** [Single-mode] Whether to disable the shimmering text sweep. Default is false. */
|
|
28
|
+
disableShimmer?: boolean;
|
|
29
|
+
/** [Single-mode] Whether to show the spinning dashed ring. Default is false. */
|
|
30
|
+
showSpinner?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export declare function AgentSteps({ size, label: labelProp, icon: iconProp, status, showIcon, steps, interval, disableShimmer, showSpinner, className, children, ...props }: AgentStepsProps): React$1.JSX.Element;
|
|
33
|
+
export interface AgentStepProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
34
|
+
status?: "waiting" | "running" | "completed" | "failed";
|
|
35
|
+
}
|
|
36
|
+
export declare function AgentStep({ status, className, children, ...props }: AgentStepProps): React$1.JSX.Element;
|
|
37
|
+
export interface AgentStepIconProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
38
|
+
icon?: AgentStepIconValue;
|
|
39
|
+
showSpinner?: boolean;
|
|
40
|
+
}
|
|
41
|
+
export declare function AgentStepIcon({ icon, showSpinner, className, ...props }: AgentStepIconProps): React$1.JSX.Element;
|
|
42
|
+
export interface AgentStepLabelProps extends React$1.HTMLAttributes<HTMLSpanElement> {
|
|
43
|
+
shimmer?: boolean;
|
|
44
|
+
}
|
|
45
|
+
export declare function AgentStepLabel({ shimmer, className, children, ...props }: AgentStepLabelProps): React$1.JSX.Element;
|
|
46
|
+
//#endregion
|
|
47
|
+
export { AgentSteps as AgentStepIndicator };
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "cn";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import * as React$1 from "react";
|
|
6
|
+
import { Cancel } from "xiod-icons/icons/Cancel";
|
|
7
|
+
import { Check } from "xiod-icons/icons/Check";
|
|
8
|
+
import { Pencil } from "xiod-icons/icons/Pencil";
|
|
9
|
+
import { Search } from "xiod-icons/icons/Search";
|
|
10
|
+
import { SecurityCheck } from "xiod-icons/icons/SecurityCheck";
|
|
11
|
+
import { Terminal } from "xiod-icons/icons/Terminal";
|
|
12
|
+
//#region src/components/agent-steps.tsx
|
|
13
|
+
const pathCircleA = "M 12 8 C 14.21 8 16 9.79 16 12 C 16 14.21 14.21 16 12 16 C 9.79 16 8 14.21 8 12 C 8 9.79 9.79 8 12 8 Z";
|
|
14
|
+
const pathInfinity = "M 12 12 C 14 8.5 19 8.5 19 12 C 19 15.5 14 15.5 12 12 C 10 8.5 5 8.5 5 12 C 5 15.5 10 15.5 12 12 Z";
|
|
15
|
+
const pathCircleB = "M 12 16 C 14.21 16 16 14.21 16 12 C 16 9.79 14.21 8 12 8 C 9.79 8 8 9.79 8 12 C 8 14.21 9.79 16 12 16 Z";
|
|
16
|
+
const STYLE_INLINE = `
|
|
17
|
+
@keyframes agent-step-icon-in {
|
|
18
|
+
from { opacity: 0; transform: scale(0.92); }
|
|
19
|
+
to { opacity: 1; transform: scale(1); }
|
|
20
|
+
}
|
|
21
|
+
@keyframes agent-shimmer-sweep {
|
|
22
|
+
0% { background-position: 200% 0; }
|
|
23
|
+
100% { background-position: -200% 0; }
|
|
24
|
+
}
|
|
25
|
+
.animate-agent-step-icon {
|
|
26
|
+
animation: agent-step-icon-in 350ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
|
|
27
|
+
}
|
|
28
|
+
.agent-step-text-base {
|
|
29
|
+
transition: opacity 450ms cubic-bezier(0.2, 0.8, 0.2, 1);
|
|
30
|
+
}
|
|
31
|
+
.agent-shimmer-text-base {
|
|
32
|
+
background: linear-gradient(
|
|
33
|
+
90deg,
|
|
34
|
+
color-mix(in srgb, var(--color-foreground) 40%, transparent) 0%,
|
|
35
|
+
color-mix(in srgb, var(--color-foreground) 40%, transparent) 40%,
|
|
36
|
+
var(--color-foreground) 50%,
|
|
37
|
+
color-mix(in srgb, var(--color-foreground) 40%, transparent) 60%,
|
|
38
|
+
color-mix(in srgb, var(--color-foreground) 40%, transparent) 100%
|
|
39
|
+
);
|
|
40
|
+
background-size: 200% auto;
|
|
41
|
+
background-clip: text;
|
|
42
|
+
-webkit-background-clip: text;
|
|
43
|
+
-webkit-text-fill-color: transparent;
|
|
44
|
+
animation: agent-shimmer-sweep 5s infinite linear;
|
|
45
|
+
}
|
|
46
|
+
`;
|
|
47
|
+
const AgentStepsContext = React$1.createContext(null);
|
|
48
|
+
function useAgentSteps() {
|
|
49
|
+
const context = React$1.useContext(AgentStepsContext);
|
|
50
|
+
if (!context) throw new Error("AgentSteps compound subcomponents must be used within <AgentSteps />");
|
|
51
|
+
return context;
|
|
52
|
+
}
|
|
53
|
+
const AgentStepContext = React$1.createContext(null);
|
|
54
|
+
function useAgentStep() {
|
|
55
|
+
const context = React$1.useContext(AgentStepContext);
|
|
56
|
+
if (!context) throw new Error("AgentStep subcomponents must be used within <AgentStep />");
|
|
57
|
+
return context;
|
|
58
|
+
}
|
|
59
|
+
const agentStepsVariants = cva("inline-flex select-none items-center gap-2 justify-center bg-transparent p-0", {
|
|
60
|
+
variants: { size: {
|
|
61
|
+
sm: "text-xs",
|
|
62
|
+
md: "text-sm",
|
|
63
|
+
lg: "text-base"
|
|
64
|
+
} },
|
|
65
|
+
defaultVariants: { size: "md" }
|
|
66
|
+
});
|
|
67
|
+
function AgentSteps({ size = "md", label: labelProp, icon: iconProp, status = "running", showIcon = true, steps, interval = 4e3, disableShimmer = false, showSpinner = false, className, children, ...props }) {
|
|
68
|
+
const isSingleMode = !children;
|
|
69
|
+
const [cycleIndex, setCycleIndex] = React$1.useState(0);
|
|
70
|
+
const normalizedSteps = React$1.useMemo(() => {
|
|
71
|
+
if (!steps || steps.length === 0) return [];
|
|
72
|
+
return steps.map((step) => {
|
|
73
|
+
if (typeof step === "string") return {
|
|
74
|
+
label: step,
|
|
75
|
+
icon: "thinking",
|
|
76
|
+
status: "running"
|
|
77
|
+
};
|
|
78
|
+
return step;
|
|
79
|
+
});
|
|
80
|
+
}, [steps]);
|
|
81
|
+
React$1.useEffect(() => {
|
|
82
|
+
if (!isSingleMode || normalizedSteps.length <= 1) return;
|
|
83
|
+
const timer = setInterval(() => {
|
|
84
|
+
setCycleIndex((prev) => (prev + 1) % normalizedSteps.length);
|
|
85
|
+
}, interval);
|
|
86
|
+
return () => clearInterval(timer);
|
|
87
|
+
}, [
|
|
88
|
+
isSingleMode,
|
|
89
|
+
normalizedSteps,
|
|
90
|
+
interval
|
|
91
|
+
]);
|
|
92
|
+
const activeStep = normalizedSteps[cycleIndex];
|
|
93
|
+
const activeLabel = activeStep ? activeStep.label : labelProp;
|
|
94
|
+
const activeIcon = activeStep ? activeStep.icon : iconProp;
|
|
95
|
+
const activeStatus = activeStep ? activeStep.status ?? status : status;
|
|
96
|
+
const contextValue = React$1.useMemo(() => ({ size: size ?? "md" }), [size]);
|
|
97
|
+
return /* @__PURE__ */ jsx(AgentStepsContext.Provider, {
|
|
98
|
+
value: contextValue,
|
|
99
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
100
|
+
className: cn(agentStepsVariants({ size }), "[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", className),
|
|
101
|
+
"data-slot": "agent-steps",
|
|
102
|
+
...props,
|
|
103
|
+
children: [/* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: STYLE_INLINE } }), isSingleMode ? /* @__PURE__ */ jsxs(AgentStep, {
|
|
104
|
+
status: activeStatus,
|
|
105
|
+
className: "bg-transparent border-none p-0 flex-row",
|
|
106
|
+
children: [showIcon && /* @__PURE__ */ jsx(AgentStepIcon, {
|
|
107
|
+
icon: activeIcon,
|
|
108
|
+
showSpinner
|
|
109
|
+
}), activeLabel && /* @__PURE__ */ jsx(AgentStepLabel, {
|
|
110
|
+
shimmer: !disableShimmer,
|
|
111
|
+
children: activeLabel
|
|
112
|
+
})]
|
|
113
|
+
}) : children]
|
|
114
|
+
})
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
function AgentStep({ status = "running", className, children, ...props }) {
|
|
118
|
+
const contextValue = React$1.useMemo(() => ({ status }), [status]);
|
|
119
|
+
return /* @__PURE__ */ jsx(AgentStepContext.Provider, {
|
|
120
|
+
value: contextValue,
|
|
121
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
122
|
+
className: cn("flex items-center gap-2", className),
|
|
123
|
+
"data-status": status,
|
|
124
|
+
"data-slot": "agent-step",
|
|
125
|
+
...props,
|
|
126
|
+
children
|
|
127
|
+
})
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
function AgentStepIcon({ icon, showSpinner = false, className, ...props }) {
|
|
131
|
+
const { size } = useAgentSteps();
|
|
132
|
+
const { status } = useAgentStep();
|
|
133
|
+
const iconElement = React$1.useMemo(() => {
|
|
134
|
+
const iconSizeClass = size === "sm" ? "size-3" : size === "lg" ? "size-5" : "size-3.5";
|
|
135
|
+
if (status === "completed" || icon === "done") return /* @__PURE__ */ jsx(Check, {
|
|
136
|
+
className: iconSizeClass,
|
|
137
|
+
strokeWidth: 3
|
|
138
|
+
});
|
|
139
|
+
if (status === "failed" || icon === "error") return /* @__PURE__ */ jsx(Cancel, {
|
|
140
|
+
className: iconSizeClass,
|
|
141
|
+
strokeWidth: 3
|
|
142
|
+
});
|
|
143
|
+
if (status === "waiting") return /* @__PURE__ */ jsx("div", { className: cn("rounded-full bg-muted-foreground/40", size === "sm" ? "size-1" : size === "lg" ? "size-2" : "size-1.5") });
|
|
144
|
+
if (!icon || icon === "thinking") return /* @__PURE__ */ jsx("svg", {
|
|
145
|
+
"aria-hidden": true,
|
|
146
|
+
viewBox: "0 0 24 24",
|
|
147
|
+
fill: "none",
|
|
148
|
+
stroke: "currentColor",
|
|
149
|
+
strokeWidth: 2,
|
|
150
|
+
strokeLinecap: "round",
|
|
151
|
+
strokeLinejoin: "round",
|
|
152
|
+
className: cn("text-primary shrink-0", size === "sm" ? "size-3.5" : size === "lg" ? "size-5.5" : "size-4.5"),
|
|
153
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
154
|
+
d: pathCircleA,
|
|
155
|
+
children: /* @__PURE__ */ jsx("animate", {
|
|
156
|
+
attributeName: "d",
|
|
157
|
+
dur: "6s",
|
|
158
|
+
repeatCount: "indefinite",
|
|
159
|
+
values: `${pathCircleA}; ${pathInfinity}; ${pathCircleB}; ${pathInfinity}; ${pathCircleA}`,
|
|
160
|
+
keyTimes: "0; 0.25; 0.5; 0.75; 1"
|
|
161
|
+
})
|
|
162
|
+
})
|
|
163
|
+
});
|
|
164
|
+
if (icon === "searching") return /* @__PURE__ */ jsx(Search, { className: iconSizeClass });
|
|
165
|
+
if (icon === "editing") return /* @__PURE__ */ jsx(Pencil, { className: iconSizeClass });
|
|
166
|
+
if (icon === "execute") return /* @__PURE__ */ jsx(Terminal, { className: iconSizeClass });
|
|
167
|
+
if (icon === "verify") return /* @__PURE__ */ jsx(SecurityCheck, { className: iconSizeClass });
|
|
168
|
+
if (typeof icon === "function" || typeof icon === "object" && icon !== null && "displayName" in icon) return /* @__PURE__ */ jsx(icon, { className: iconSizeClass });
|
|
169
|
+
return icon;
|
|
170
|
+
}, [
|
|
171
|
+
icon,
|
|
172
|
+
status,
|
|
173
|
+
size
|
|
174
|
+
]);
|
|
175
|
+
const iconFrameClasses = cn("relative flex items-center justify-center rounded-full shrink-0 select-none bg-transparent text-muted-foreground transition-[color,background-color,opacity] duration-300", size === "sm" && "size-5", size === "md" && "size-6", size === "lg" && "size-8", className);
|
|
176
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
177
|
+
className: iconFrameClasses,
|
|
178
|
+
"data-slot": "agent-step-icon",
|
|
179
|
+
...props,
|
|
180
|
+
children: [status === "running" && showSpinner && /* @__PURE__ */ jsx("div", { className: cn("absolute inset-[-1.5px] rounded-full border border-dashed border-primary/60 animate-spin pointer-events-none", size === "sm" && "inset-[-1.5px]", size === "md" && "inset-[-2px]", size === "lg" && "inset-[-3px]") }), /* @__PURE__ */ jsx("div", {
|
|
181
|
+
className: "flex items-center justify-center size-full animate-agent-step-icon",
|
|
182
|
+
children: iconElement
|
|
183
|
+
}, `${status}-${typeof icon === "string" ? icon : "custom"}`)]
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
function AgentStepLabel({ shimmer = true, className, children, ...props }) {
|
|
187
|
+
const { status } = useAgentStep();
|
|
188
|
+
const [activeBuffer, setActiveBuffer] = React$1.useState("A");
|
|
189
|
+
const [labelA, setLabelA] = React$1.useState(children);
|
|
190
|
+
const [labelB, setLabelB] = React$1.useState("");
|
|
191
|
+
React$1.useEffect(() => {
|
|
192
|
+
if (activeBuffer === "A") {
|
|
193
|
+
if (children !== labelA) {
|
|
194
|
+
setLabelB(children);
|
|
195
|
+
setActiveBuffer("B");
|
|
196
|
+
}
|
|
197
|
+
} else if (children !== labelB) {
|
|
198
|
+
setLabelA(children);
|
|
199
|
+
setActiveBuffer("A");
|
|
200
|
+
}
|
|
201
|
+
}, [
|
|
202
|
+
children,
|
|
203
|
+
activeBuffer,
|
|
204
|
+
labelA,
|
|
205
|
+
labelB
|
|
206
|
+
]);
|
|
207
|
+
const isAActive = activeBuffer === "A";
|
|
208
|
+
const isRunning = status === "running" && shimmer;
|
|
209
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
210
|
+
className: cn("relative inline-grid grid-cols-1 grid-rows-1 items-center overflow-hidden h-5 min-w-[80px]", className),
|
|
211
|
+
"data-slot": "agent-step-label",
|
|
212
|
+
...props,
|
|
213
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
214
|
+
className: cn("col-start-1 row-start-1 flex items-center whitespace-nowrap agent-step-text-base", isAActive ? "opacity-100" : "opacity-0 pointer-events-none", isRunning && "agent-shimmer-text-base", status === "waiting" && "text-muted-foreground", status === "completed" && "text-foreground font-semibold", status === "failed" && "text-destructive font-semibold"),
|
|
215
|
+
children: labelA
|
|
216
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
217
|
+
className: cn("col-start-1 row-start-1 flex items-center whitespace-nowrap agent-step-text-base", !isAActive ? "opacity-100" : "opacity-0 pointer-events-none", isRunning && "agent-shimmer-text-base", status === "waiting" && "text-muted-foreground", status === "completed" && "text-foreground font-semibold", status === "failed" && "text-destructive font-semibold"),
|
|
218
|
+
children: labelB
|
|
219
|
+
})]
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
//#endregion
|
|
223
|
+
export { AgentStep, AgentStepIcon, AgentSteps as AgentStepIndicator, AgentSteps, AgentStepLabel, agentStepsVariants };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { AlertDialog as AlertDialog$1 } from "@base-ui/react/alert-dialog";
|
|
3
|
+
//#region src/components/alert-dialog.d.ts
|
|
4
|
+
declare const AlertDialogCreateHandle: typeof AlertDialog$1.createHandle;
|
|
5
|
+
declare const AlertDialog: typeof AlertDialog$1.Root;
|
|
6
|
+
declare const AlertDialogPortal: React$1.ForwardRefExoticComponent<Omit<import("@base-ui/react").AlertDialogPortalProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
declare function AlertDialogTrigger(props: AlertDialog$1.Trigger.Props): React$1.JSX.Element;
|
|
8
|
+
declare function AlertDialogBackdrop({ className, ...props }: AlertDialog$1.Backdrop.Props): React$1.JSX.Element;
|
|
9
|
+
declare function AlertDialogViewport({ className, ...props }: AlertDialog$1.Viewport.Props): React$1.JSX.Element;
|
|
10
|
+
declare function AlertDialogPopup({ className, bottomStickOnMobile, ...props }: AlertDialog$1.Popup.Props & {
|
|
11
|
+
bottomStickOnMobile?: boolean;
|
|
12
|
+
}): React$1.JSX.Element;
|
|
13
|
+
declare function AlertDialogHeader({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
14
|
+
declare function AlertDialogFooter({ className, variant, ...props }: React$1.ComponentProps<"div"> & {
|
|
15
|
+
variant?: "default" | "bare";
|
|
16
|
+
}): React$1.JSX.Element;
|
|
17
|
+
declare function AlertDialogTitle({ className, ...props }: AlertDialog$1.Title.Props): React$1.JSX.Element;
|
|
18
|
+
declare function AlertDialogDescription({ className, ...props }: AlertDialog$1.Description.Props): React$1.JSX.Element;
|
|
19
|
+
declare function AlertDialogClose(props: AlertDialog$1.Close.Props): React$1.JSX.Element;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { AlertDialog, AlertDialogBackdrop, AlertDialogBackdrop as AlertDialogOverlay, AlertDialogClose, AlertDialogPopup as AlertDialogContent, AlertDialogPopup, AlertDialogCreateHandle, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertDialogViewport };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "cn";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { AlertDialog as AlertDialog$1 } from "@base-ui/react/alert-dialog";
|
|
5
|
+
//#region src/components/alert-dialog.tsx
|
|
6
|
+
const AlertDialogCreateHandle = AlertDialog$1.createHandle;
|
|
7
|
+
const AlertDialog = AlertDialog$1.Root;
|
|
8
|
+
const AlertDialogPortal = AlertDialog$1.Portal;
|
|
9
|
+
function AlertDialogTrigger(props) {
|
|
10
|
+
return /* @__PURE__ */ jsx(AlertDialog$1.Trigger, {
|
|
11
|
+
"data-slot": "alert-dialog-trigger",
|
|
12
|
+
...props
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
function AlertDialogBackdrop({ className, ...props }) {
|
|
16
|
+
return /* @__PURE__ */ jsx(AlertDialog$1.Backdrop, {
|
|
17
|
+
className: cn("fixed inset-0 z-50 bg-black/32 backdrop-blur-sm transition-all duration-200 ease-out data-ending-style:opacity-0 data-starting-style:opacity-0", className),
|
|
18
|
+
"data-slot": "alert-dialog-backdrop",
|
|
19
|
+
...props
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
function AlertDialogViewport({ className, ...props }) {
|
|
23
|
+
return /* @__PURE__ */ jsx(AlertDialog$1.Viewport, {
|
|
24
|
+
className: cn("fixed inset-0 z-50 grid grid-rows-[1fr_auto_3fr] justify-items-center p-4", className),
|
|
25
|
+
"data-slot": "alert-dialog-viewport",
|
|
26
|
+
...props
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function AlertDialogPopup({ className, bottomStickOnMobile = true, ...props }) {
|
|
30
|
+
return /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [/* @__PURE__ */ jsx(AlertDialogBackdrop, {}), /* @__PURE__ */ jsx(AlertDialogViewport, {
|
|
31
|
+
className: cn(bottomStickOnMobile && "max-sm:grid-rows-[1fr_auto] max-sm:p-0 max-sm:pt-12"),
|
|
32
|
+
children: /* @__PURE__ */ jsx(AlertDialog$1.Popup, {
|
|
33
|
+
className: cn("translate-y-[calc(-1.25rem*var(--nested-dialogs))] relative row-start-2 flex max-h-full min-h-0 w-full min-w-0 max-w-lg scale-[calc(1-0.1*var(--nested-dialogs))] flex-col rounded-2xl border bg-popover not-dark:bg-clip-padding text-popover-foreground opacity-[calc(1-0.1*var(--nested-dialogs))] shadow-lg/5 transition-[scale,opacity,translate] duration-200 ease-in-out will-change-transform before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] data-nested:data-ending-style:translate-y-8 data-nested:data-starting-style:translate-y-8 data-nested-dialog-open:origin-top data-ending-style:scale-98 data-starting-style:scale-98 data-ending-style:opacity-0 data-starting-style:opacity-0 dark:before:shadow-[0_-1px_--theme(--color-white/6%)]", bottomStickOnMobile && "max-sm:max-w-none max-sm:rounded-none max-sm:border-x-0 max-sm:border-t max-sm:border-b-0 max-sm:opacity-[calc(1-min(var(--nested-dialogs),1))] max-sm:data-ending-style:translate-y-4 max-sm:data-starting-style:translate-y-4 max-sm:before:hidden max-sm:before:rounded-none", className),
|
|
34
|
+
"data-slot": "alert-dialog-popup",
|
|
35
|
+
...props
|
|
36
|
+
})
|
|
37
|
+
})] });
|
|
38
|
+
}
|
|
39
|
+
function AlertDialogHeader({ className, ...props }) {
|
|
40
|
+
return /* @__PURE__ */ jsx("div", {
|
|
41
|
+
className: cn("flex flex-col gap-2 p-6 text-center max-sm:pb-4 sm:text-left", className),
|
|
42
|
+
"data-slot": "alert-dialog-header",
|
|
43
|
+
...props
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
function AlertDialogFooter({ className, variant = "default", ...props }) {
|
|
47
|
+
return /* @__PURE__ */ jsx("div", {
|
|
48
|
+
className: cn("flex flex-col-reverse gap-2 px-6 sm:flex-row sm:justify-end sm:rounded-b-[calc(var(--radius-2xl)-1px)]", variant === "default" && "border-t bg-muted/72 pt-[calc(--spacing(4)-1px)] pb-4", variant === "bare" && "pb-6", className),
|
|
49
|
+
"data-slot": "alert-dialog-footer",
|
|
50
|
+
...props
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function AlertDialogTitle({ className, ...props }) {
|
|
54
|
+
return /* @__PURE__ */ jsx(AlertDialog$1.Title, {
|
|
55
|
+
className: cn("font-heading font-semibold text-xl leading-none", className),
|
|
56
|
+
"data-slot": "alert-dialog-title",
|
|
57
|
+
...props
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
function AlertDialogDescription({ className, ...props }) {
|
|
61
|
+
return /* @__PURE__ */ jsx(AlertDialog$1.Description, {
|
|
62
|
+
className: cn("text-muted-foreground text-sm", className),
|
|
63
|
+
"data-slot": "alert-dialog-description",
|
|
64
|
+
...props
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
function AlertDialogClose(props) {
|
|
68
|
+
return /* @__PURE__ */ jsx(AlertDialog$1.Close, {
|
|
69
|
+
"data-slot": "alert-dialog-close",
|
|
70
|
+
...props
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
//#endregion
|
|
74
|
+
export { AlertDialog, AlertDialogBackdrop, AlertDialogBackdrop as AlertDialogOverlay, AlertDialogClose, AlertDialogPopup as AlertDialogContent, AlertDialogPopup, AlertDialogCreateHandle, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertDialogViewport };
|