@zentauri-ui/zentauri-components 0.0.92 → 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/README.md +108 -38
- package/dist/chunk-B23TPTVG.mjs +11 -0
- package/dist/chunk-B23TPTVG.mjs.map +1 -0
- package/dist/{chunk-BZSIXBA7.js → chunk-BITDSQMR.js} +8 -6
- package/dist/chunk-BITDSQMR.js.map +1 -0
- package/dist/{chunk-VJHD7QZH.mjs → chunk-BORK3BJO.mjs} +4 -7
- package/dist/chunk-BORK3BJO.mjs.map +1 -0
- package/dist/chunk-WZ2GOU2J.js +13 -0
- package/dist/chunk-WZ2GOU2J.js.map +1 -0
- package/dist/ui/accordion.d.mts +1 -1
- package/dist/ui/accordion.d.ts +1 -1
- package/dist/ui/accordion.js +80 -61
- package/dist/ui/accordion.js.map +1 -1
- package/dist/ui/accordion.mjs +46 -39
- package/dist/ui/accordion.mjs.map +1 -1
- package/dist/ui/alert.d.mts +1 -1
- package/dist/ui/alert.d.ts +1 -1
- package/dist/ui/alert.js +57 -46
- package/dist/ui/alert.js.map +1 -1
- package/dist/ui/alert.mjs +28 -30
- package/dist/ui/alert.mjs.map +1 -1
- package/dist/ui/badge.js +20 -25
- package/dist/ui/badge.js.map +1 -1
- package/dist/ui/badge.mjs +8 -20
- package/dist/ui/badge.mjs.map +1 -1
- package/dist/ui/buttons.js +19 -21
- package/dist/ui/buttons.js.map +1 -1
- package/dist/ui/buttons.mjs +8 -18
- package/dist/ui/buttons.mjs.map +1 -1
- package/dist/ui/card.js +59 -54
- package/dist/ui/card.js.map +1 -1
- package/dist/ui/card.mjs +29 -39
- package/dist/ui/card.mjs.map +1 -1
- package/dist/ui/divider.js +39 -35
- package/dist/ui/divider.js.map +1 -1
- package/dist/ui/divider.mjs +18 -23
- package/dist/ui/divider.mjs.map +1 -1
- package/dist/ui/drawer.d.mts +1 -1
- package/dist/ui/drawer.d.ts +1 -1
- package/dist/ui/drawer.js +106 -73
- package/dist/ui/drawer.js.map +1 -1
- package/dist/ui/drawer.mjs +64 -45
- package/dist/ui/drawer.mjs.map +1 -1
- package/dist/ui/dropdown.js +42 -48
- package/dist/ui/dropdown.js.map +1 -1
- package/dist/ui/dropdown.mjs +13 -29
- package/dist/ui/dropdown.mjs.map +1 -1
- package/dist/ui/empty-state.d.mts +3 -3
- package/dist/ui/empty-state.d.ts +3 -3
- package/dist/ui/empty-state.js +83 -59
- package/dist/ui/empty-state.js.map +1 -1
- package/dist/ui/empty-state.mjs +64 -52
- package/dist/ui/empty-state.mjs.map +1 -1
- package/dist/ui/inputs.js +26 -31
- package/dist/ui/inputs.js.map +1 -1
- package/dist/ui/inputs.mjs +8 -19
- package/dist/ui/inputs.mjs.map +1 -1
- package/dist/ui/modal.d.mts +1 -1
- package/dist/ui/modal.d.ts +1 -1
- package/dist/ui/modal.js +116 -78
- package/dist/ui/modal.js.map +1 -1
- package/dist/ui/modal.mjs +74 -51
- package/dist/ui/modal.mjs.map +1 -1
- package/dist/ui/pagination.js +47 -60
- package/dist/ui/pagination.js.map +1 -1
- package/dist/ui/pagination.mjs +10 -32
- package/dist/ui/pagination.mjs.map +1 -1
- package/dist/ui/progress.js +70 -58
- package/dist/ui/progress.js.map +1 -1
- package/dist/ui/progress.mjs +44 -43
- package/dist/ui/progress.mjs.map +1 -1
- package/dist/ui/select.js +73 -81
- package/dist/ui/select.js.map +1 -1
- package/dist/ui/select.mjs +38 -59
- package/dist/ui/select.mjs.map +1 -1
- package/dist/ui/skeleton.js +45 -50
- package/dist/ui/skeleton.js.map +1 -1
- package/dist/ui/skeleton.mjs +8 -25
- package/dist/ui/skeleton.mjs.map +1 -1
- package/dist/ui/spinner.js +37 -38
- package/dist/ui/spinner.js.map +1 -1
- package/dist/ui/spinner.mjs +11 -18
- package/dist/ui/spinner.mjs.map +1 -1
- package/dist/ui/table.js +77 -79
- package/dist/ui/table.js.map +1 -1
- package/dist/ui/table.mjs +43 -60
- package/dist/ui/table.mjs.map +1 -1
- package/dist/ui/tabs.js +75 -75
- package/dist/ui/tabs.js.map +1 -1
- package/dist/ui/tabs.mjs +48 -59
- package/dist/ui/tabs.mjs.map +1 -1
- package/dist/ui/toast.d.mts +2 -2
- package/dist/ui/toast.d.ts +2 -2
- package/dist/ui/toast.js +111 -88
- package/dist/ui/toast.js.map +1 -1
- package/dist/ui/toast.mjs +77 -69
- package/dist/ui/toast.mjs.map +1 -1
- package/dist/ui/toggle.js +26 -28
- package/dist/ui/toggle.js.map +1 -1
- package/dist/ui/toggle.mjs +12 -21
- package/dist/ui/toggle.mjs.map +1 -1
- package/dist/ui/tooltip.js +29 -36
- package/dist/ui/tooltip.js.map +1 -1
- package/dist/ui/tooltip.mjs +8 -23
- package/dist/ui/tooltip.mjs.map +1 -1
- package/package.json +5 -3
- package/dist/chunk-BZSIXBA7.js.map +0 -1
- package/dist/chunk-E5UX537J.js +0 -11
- package/dist/chunk-E5UX537J.js.map +0 -1
- package/dist/chunk-MEWYFWBX.mjs +0 -14
- package/dist/chunk-MEWYFWBX.mjs.map +0 -1
- package/dist/chunk-VJHD7QZH.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -10,9 +10,9 @@ Published artifacts live under `dist/`. You can import either the **UI barrel**
|
|
|
10
10
|
|
|
11
11
|
## Package exports
|
|
12
12
|
|
|
13
|
-
| Subpath
|
|
14
|
-
|
|
|
15
|
-
| `@zentauri-ui/zentauri-components/ui`
|
|
13
|
+
| Subpath | Description |
|
|
14
|
+
| -------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
|
|
15
|
+
| `@zentauri-ui/zentauri-components/ui` | Full UI barrel: all components, hooks, and types (ESM `.js`, CJS `.cjs`, `.d.ts`) |
|
|
16
16
|
| `@zentauri-ui/zentauri-components/ui/<name>` | Single area entry (same artifacts per file). Use this when you import from one module only to keep the dependency graph smaller. |
|
|
17
17
|
|
|
18
18
|
The `<name>` segment matches the folder under `src/ui/` (for example `accordion`, `select`, `empty-state`, `buttons` for `Button`, `inputs` for `Input`).
|
|
@@ -20,39 +20,39 @@ The `<name>` segment matches the folder under `src/ui/` (for example `accordion`
|
|
|
20
20
|
## Requirements
|
|
21
21
|
|
|
22
22
|
- **React** and **React DOM** `>= 18` (peer dependencies)
|
|
23
|
-
- A Tailwind pipeline that can **scan** this package (see Step
|
|
23
|
+
- A Tailwind pipeline that can **scan** this package (see Step 3 below)
|
|
24
24
|
|
|
25
25
|
## Components
|
|
26
26
|
|
|
27
27
|
Each area is available from the barrel and from its own subpath (`…/ui/<subpath>`):
|
|
28
28
|
|
|
29
|
-
| Area
|
|
30
|
-
|
|
|
31
|
-
| Accordion
|
|
32
|
-
| Alert
|
|
33
|
-
| Badge
|
|
34
|
-
| Button
|
|
35
|
-
| Card
|
|
36
|
-
| Divider
|
|
37
|
-
| Drawer
|
|
38
|
-
| Dropdown
|
|
39
|
-
| Empty state | `empty-state`
|
|
40
|
-
| Input
|
|
41
|
-
| Modal
|
|
42
|
-
| Pagination
|
|
43
|
-
| Progress
|
|
44
|
-
| Select
|
|
45
|
-
| Skeleton
|
|
46
|
-
| Spinner
|
|
47
|
-
| Table
|
|
48
|
-
| Tabs
|
|
49
|
-
| Toast
|
|
50
|
-
| Toggle
|
|
51
|
-
| Tooltip
|
|
29
|
+
| Area | Subpath `…/ui/…` |
|
|
30
|
+
| ----------- | ---------------- |
|
|
31
|
+
| Accordion | `accordion` |
|
|
32
|
+
| Alert | `alert` |
|
|
33
|
+
| Badge | `badge` |
|
|
34
|
+
| Button | `buttons` |
|
|
35
|
+
| Card | `card` |
|
|
36
|
+
| Divider | `divider` |
|
|
37
|
+
| Drawer | `drawer` |
|
|
38
|
+
| Dropdown | `dropdown` |
|
|
39
|
+
| Empty state | `empty-state` |
|
|
40
|
+
| Input | `inputs` |
|
|
41
|
+
| Modal | `modal` |
|
|
42
|
+
| Pagination | `pagination` |
|
|
43
|
+
| Progress | `progress` |
|
|
44
|
+
| Select | `select` |
|
|
45
|
+
| Skeleton | `skeleton` |
|
|
46
|
+
| Spinner | `spinner` |
|
|
47
|
+
| Table | `table` |
|
|
48
|
+
| Tabs | `tabs` |
|
|
49
|
+
| Toast | `toast` |
|
|
50
|
+
| Toggle | `toggle` |
|
|
51
|
+
| Tooltip | `tooltip` |
|
|
52
52
|
|
|
53
53
|
## Installation
|
|
54
54
|
|
|
55
|
-
**Getting started** — Add the package, point Tailwind at the library sources, then import from the UI barrel or from a specific `ui/<name>` subpath.
|
|
55
|
+
**Getting started** — Add the package, install peer dependencies so primitives resolve correctly, point Tailwind at the library sources, then import from the UI barrel or from a specific `ui/<name>` subpath.
|
|
56
56
|
|
|
57
57
|
### Step 1 — Install the package
|
|
58
58
|
|
|
@@ -70,7 +70,58 @@ pnpm install @zentauri-ui/zentauri-components
|
|
|
70
70
|
yarn add @zentauri-ui/zentauri-components
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
-
### Step 2 —
|
|
73
|
+
### Step 2 — Install peer dependencies
|
|
74
|
+
|
|
75
|
+
The library expects `react`, `react-dom`, `class-variance-authority`, `clsx`, and `tailwind-merge` in your app. Install them alongside the components package.
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
npm install react react-dom class-variance-authority clsx tailwind-merge
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
pnpm add react react-dom class-variance-authority clsx tailwind-merge
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
yarn add react react-dom class-variance-authority clsx tailwind-merge
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
#### Optional: animations and icons
|
|
90
|
+
|
|
91
|
+
Add `framer-motion` when using motion-based UI, and `react-icons` when using icon sets from that package.
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
npm install framer-motion react-icons
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
pnpm add framer-motion react-icons
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
yarn add framer-motion react-icons
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Published `dist/` files **import** these packages; they are **not** vendored inside `@zentauri-ui/zentauri-components`. Your app installs them via `dependencies` (or optional peers above), and your bundler resolves them from `node_modules`.
|
|
106
|
+
|
|
107
|
+
### Next.js: smaller route chunks
|
|
108
|
+
|
|
109
|
+
In **Next.js 13+**, enable [optimizePackageImports](https://nextjs.org/docs/app/api-reference/config/next-config-js/optimizePackageImports) so `framer-motion` and `react-icons` are resolved in a more tree-shakeable way:
|
|
110
|
+
|
|
111
|
+
```ts
|
|
112
|
+
// next.config.ts (example — API may be stable in your Next version)
|
|
113
|
+
import type { NextConfig } from "next";
|
|
114
|
+
|
|
115
|
+
const nextConfig: NextConfig = {
|
|
116
|
+
experimental: {
|
|
117
|
+
optimizePackageImports: ["framer-motion", "react-icons"],
|
|
118
|
+
},
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export default nextConfig;
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Step 3 — Include library paths in globals.css
|
|
74
125
|
|
|
75
126
|
Add an `@source` entry so Tailwind scans class names inside `@zentauri-ui/zentauri-components`. The path is relative to this CSS file—adjust `../` if your file lives elsewhere.
|
|
76
127
|
|
|
@@ -79,7 +130,7 @@ Add an `@source` entry so Tailwind scans class names inside `@zentauri-ui/zentau
|
|
|
79
130
|
@source "../node_modules/@zentauri-ui/zentauri-components";
|
|
80
131
|
```
|
|
81
132
|
|
|
82
|
-
### Step
|
|
133
|
+
### Step 4 — Import and use components
|
|
83
134
|
|
|
84
135
|
Prefer a **subpath** when you only need one area (smaller resolved graph than the full barrel). The barrel remains valid when you use many primitives from different areas.
|
|
85
136
|
|
|
@@ -98,26 +149,43 @@ import {
|
|
|
98
149
|
|
|
99
150
|
```tsx
|
|
100
151
|
import { Button } from "@zentauri-ui/zentauri-components/ui/buttons";
|
|
101
|
-
import {
|
|
152
|
+
import {
|
|
153
|
+
Select,
|
|
154
|
+
SelectTrigger,
|
|
155
|
+
SelectValue,
|
|
156
|
+
SelectContent,
|
|
157
|
+
SelectItem,
|
|
158
|
+
} from "@zentauri-ui/zentauri-components/ui/select";
|
|
102
159
|
```
|
|
103
160
|
|
|
104
161
|
#### Imports (barrel — one entry for symbols from several areas)
|
|
105
162
|
|
|
106
163
|
```tsx
|
|
107
|
-
import {
|
|
164
|
+
import {
|
|
165
|
+
Button,
|
|
166
|
+
Select,
|
|
167
|
+
SelectTrigger,
|
|
168
|
+
SelectValue,
|
|
169
|
+
SelectContent,
|
|
170
|
+
SelectItem,
|
|
171
|
+
} from "@zentauri-ui/zentauri-components/ui";
|
|
108
172
|
```
|
|
109
173
|
|
|
110
174
|
#### Usage
|
|
111
175
|
|
|
112
176
|
```tsx
|
|
113
177
|
<div className="rounded-3xl border border-white/10 bg-white/5 p-5 shadow-2xl shadow-slate-950/40 backdrop-blur-xl">
|
|
114
|
-
<Accordion
|
|
178
|
+
<Accordion
|
|
179
|
+
type="single"
|
|
180
|
+
defaultValue="item-1"
|
|
181
|
+
appearance="separated"
|
|
182
|
+
size="md"
|
|
183
|
+
>
|
|
115
184
|
<AccordionItem value="item-1">
|
|
116
185
|
<AccordionTrigger>Shipping</AccordionTrigger>
|
|
117
186
|
<AccordionContent>
|
|
118
187
|
<p className="text-sm text-slate-300">
|
|
119
|
-
Standard delivery in 3-5 business days. Express options at
|
|
120
|
-
checkout.
|
|
188
|
+
Standard delivery in 3-5 business days. Express options at checkout.
|
|
121
189
|
</p>
|
|
122
190
|
</AccordionContent>
|
|
123
191
|
</AccordionItem>
|
|
@@ -134,17 +202,19 @@ import { Button, Select, SelectTrigger, SelectValue, SelectContent, SelectItem }
|
|
|
134
202
|
```
|
|
135
203
|
|
|
136
204
|
## Checkout the components:
|
|
205
|
+
|
|
137
206
|
https://zentauri-ui.vercel.app/
|
|
138
207
|
|
|
139
208
|
## Development
|
|
140
209
|
|
|
141
210
|
From this package directory in the monorepo:
|
|
142
211
|
|
|
143
|
-
- `pnpm build` (or `npm run build`) — production bundle via `tsup`
|
|
144
|
-
- `pnpm dev` — `tsup` watch mode
|
|
212
|
+
- `pnpm build` (or `npm run build`) — production bundle via `tsup` (Rollup treeshake + `scripts/prepend-use-client.mjs` via `onSuccess` so each `dist/ui/*.mjs` / `*.js` entry starts with `"use client"`)
|
|
213
|
+
- `pnpm dev` — `tsup` watch mode (same `onSuccess` hook after each rebuild)
|
|
145
214
|
- `pnpm test` / `pnpm test:watch` — **Vitest** and **Testing Library** unit tests
|
|
146
215
|
|
|
147
|
-
## NOTE:
|
|
216
|
+
## NOTE:
|
|
217
|
+
|
|
148
218
|
This package is in initial phase of development and you might see some minor or major breaking changes in the future. If you want to contribute to this project, email me at @shubhmtiwri00@gmail.com or ping me on linkeded https://www.linkedin.com/in/shubham-tiwari-b7544b193/
|
|
149
219
|
|
|
150
220
|
## License
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { clsx } from 'clsx';
|
|
2
|
+
import { twMerge } from 'tailwind-merge';
|
|
3
|
+
|
|
4
|
+
// src/lib/utils.ts
|
|
5
|
+
function cn(...inputs) {
|
|
6
|
+
return twMerge(clsx(inputs));
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { cn };
|
|
10
|
+
//# sourceMappingURL=chunk-B23TPTVG.mjs.map
|
|
11
|
+
//# sourceMappingURL=chunk-B23TPTVG.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/utils.ts"],"names":[],"mappings":";;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B","file":"chunk-B23TPTVG.mjs","sourcesContent":["import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"]}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
4
|
+
|
|
5
|
+
// src/ui/buttons/variants.ts
|
|
6
|
+
var buttonVariants = classVarianceAuthority.cva(
|
|
4
7
|
[
|
|
5
8
|
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-xl",
|
|
6
9
|
"text-sm font-medium ring-offset-slate-950 transition-colors",
|
|
@@ -64,7 +67,6 @@ var buttonVariants = _classvarianceauthority.cva.call(void 0,
|
|
|
64
67
|
}
|
|
65
68
|
);
|
|
66
69
|
|
|
67
|
-
|
|
68
|
-
|
|
69
70
|
exports.buttonVariants = buttonVariants;
|
|
70
|
-
//# sourceMappingURL=chunk-
|
|
71
|
+
//# sourceMappingURL=chunk-BITDSQMR.js.map
|
|
72
|
+
//# sourceMappingURL=chunk-BITDSQMR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ui/buttons/variants.ts"],"names":["cva"],"mappings":";;;;;AAEO,IAAM,cAAA,GAAiBA,0BAAA;AAAA,EAC5B;AAAA,IACE,4EAAA;AAAA,IACA,6DAAA;AAAA,IACA,0GAAA;AAAA,IACA,kDAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,UAAA,EAAY;AAAA,QACV,OAAA,EACE,kFAAA;AAAA,QACF,SAAA,EAAW,+CAAA;AAAA,QACX,WAAA,EAAa,0CAAA;AAAA,QACb,OAAA,EACE,mEAAA;AAAA,QACF,KAAA,EAAO,gDAAA;AAAA,QACP,IAAA,EAAM,iEAAA;AAAA,QACN,KAAA,EACE,kFAAA;AAAA,QACF,OAAA,EAAS,gDAAA;AAAA,QACT,MAAA,EAAQ,8CAAA;AAAA,QACR,MAAA,EAAQ,8CAAA;AAAA,QACR,IAAA,EAAM,0CAAA;AAAA,QACN,IAAA,EAAM,0CAAA;AAAA,QACN,GAAA,EAAK,wCAAA;AAAA,QACL,IAAA,EAAM,0CAAA;AAAA,QACN,MAAA,EAAQ,8CAAA;AAAA,QACR,MAAA,EAAQ,8CAAA;AAAA,QACR,IAAA,EAAM,0CAAA;AAAA,QACN,KAAA,EAAO,4CAAA;AAAA,QACP,MAAA,EAAQ,8CAAA;AAAA,QACR,eAAA,EACE,iGAAA;AAAA,QACF,gBAAA,EACE,+FAAA;AAAA,QACF,cAAA,EACE,2FAAA;AAAA,QACF,iBAAA,EACE,qGAAA;AAAA,QACF,iBAAA,EACE,iGAAA;AAAA,QACF,eAAA,EACE,6FAAA;AAAA,QACF,iBAAA,EACE,qGAAA;AAAA,QACF,eAAA,EACE,6FAAA;AAAA,QACF,iBAAA,EACE;AAAA,OACJ;AAAA,MACA,IAAA,EAAM;AAAA,QACJ,EAAA,EAAI,yBAAA;AAAA,QACJ,EAAA,EAAI,kBAAA;AAAA,QACJ,EAAA,EAAI,6BAAA;AAAA,QACJ,EAAA,EAAI,2BAAA;AAAA,QACJ,KAAA,EAAO,mCAAA;AAAA,QACP,KAAA,EAAO,qCAAA;AAAA,QACP,KAAA,EAAO,sCAAA;AAAA,QACP,KAAA,EAAO,sCAAA;AAAA,QACP,KAAA,EAAO,sCAAA;AAAA,QACP,KAAA,EAAO,sCAAA;AAAA,QACP,KAAA,EAAO,6BAAA;AAAA,QACP,KAAA,EAAO,sCAAA;AAAA,QACP,MAAA,EAAQ,sCAAA;AAAA,QACR,IAAA,EAAM;AAAA;AACR,KACF;AAAA,IACA,eAAA,EAAiB;AAAA,MACf,UAAA,EAAY,SAAA;AAAA,MACZ,IAAA,EAAM;AAAA;AACR;AAEJ","file":"chunk-BITDSQMR.js","sourcesContent":["import { cva } from \"class-variance-authority\";\n\nexport const buttonVariants = cva(\n [\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-xl\",\n \"text-sm font-medium ring-offset-slate-950 transition-colors\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-300 focus-visible:ring-offset-2\",\n \"disabled:pointer-events-none disabled:opacity-50\",\n \"select-none\",\n ],\n {\n variants: {\n appearance: {\n default:\n \"bg-slate-50 text-slate-950 shadow-[0_1px_2px_rgba(15,23,42,0.12)] hover:bg-white\",\n secondary: \"bg-slate-800 text-slate-50 hover:bg-slate-700\",\n destructive: \"bg-rose-600 text-white hover:bg-rose-600\",\n outline:\n \"border border-white/10 bg-white/5 text-slate-50 hover:bg-white/10\",\n ghost: \"bg-transparent text-slate-200 hover:bg-white/5\",\n link: \"bg-transparent text-cyan-300 underline-offset-4 hover:underline\",\n glass:\n \"border border-white/15 bg-white/10 text-white backdrop-blur-md hover:bg-white/15\",\n emerald: \"bg-emerald-600 text-white hover:bg-emerald-600\",\n indigo: \"bg-indigo-600 text-white hover:bg-indigo-600\",\n purple: \"bg-purple-600 text-white hover:bg-purple-600\",\n pink: \"bg-pink-600 text-white hover:bg-pink-600\",\n rose: \"bg-rose-600 text-white hover:bg-rose-600\",\n sky: \"bg-sky-600 text-white hover:bg-sky-600\",\n teal: \"bg-teal-600 text-white hover:bg-teal-600\",\n yellow: \"bg-yellow-600 text-white hover:bg-yellow-600\",\n orange: \"bg-orange-600 text-white hover:bg-orange-600\",\n gray: \"bg-gray-600 text-white hover:bg-gray-600\",\n amber: \"bg-amber-600 text-white hover:bg-amber-600\",\n violet: \"bg-violet-600 text-white hover:bg-violet-600\",\n \"gradient-blue\":\n \"bg-gradient-to-r from-blue-600 to-purple-600 text-white hover:from-blue-600 hover:to-purple-600\",\n \"gradient-green\":\n \"bg-gradient-to-r from-green-600 to-lime-600 text-white hover:from-green-600 hover:to-lime-600\",\n \"gradient-red\":\n \"bg-gradient-to-r from-red-600 to-pink-600 text-white hover:from-red-600 hover:to-pink-600\",\n \"gradient-yellow\":\n \"bg-gradient-to-r from-yellow-600 to-orange-600 text-white hover:from-yellow-600 hover:to-orange-600\",\n \"gradient-purple\":\n \"bg-gradient-to-r from-purple-600 to-pink-600 text-white hover:from-purple-600 hover:to-pink-600\",\n \"gradient-teal\":\n \"bg-gradient-to-r from-teal-600 to-cyan-600 text-white hover:from-teal-600 hover:to-cyan-600\",\n \"gradient-indigo\":\n \"bg-gradient-to-r from-indigo-600 to-purple-600 text-white hover:from-indigo-600 hover:to-purple-600\",\n \"gradient-pink\":\n \"bg-gradient-to-r from-pink-600 to-rose-600 text-white hover:from-pink-600 hover:to-rose-600\",\n \"gradient-orange\":\n \"bg-gradient-to-r from-orange-600 to-red-600 text-white hover:from-orange-600 hover:to-red-600\",\n },\n size: {\n sm: \"h-7 md:h-9 px-3 text-xs\",\n md: \"h-9 md:h-11 px-4\",\n lg: \"h-10 md:h-12 px-5 text-base\",\n xl: \"h-12 md:h-14 px-6 text-lg\",\n \"2xl\": \"h-14 md:h-16 px-6 md:px-8 text-xl\",\n \"3xl\": \"h-16 md:h-18 px-8 md:px-10 text-2xl\",\n \"4xl\": \"h-18 md:h-20 px-10 md:px-12 text-2xl\",\n \"5xl\": \"h-20 md:h-22 px-12 md:px-14 text-2xl\",\n \"6xl\": \"h-22 md:h-24 px-14 md:px-16 text-2xl\",\n \"7xl\": \"h-24 md:h-26 px-16 md:px-18 text-2xl\",\n \"8xl\": \"h-26 md:h-28 px-20 text-2xl\",\n \"9xl\": \"h-24 md:h-30 px-18 md:px-22 text-2xl\",\n \"10xl\": \"h-26 md:h-32 px-20 md:px-24 text-2xl\",\n icon: \"h-10 w-10\",\n },\n },\n defaultVariants: {\n appearance: \"default\",\n size: \"md\",\n },\n },\n);\n"]}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { cva } from 'class-variance-authority';
|
|
3
2
|
|
|
4
3
|
// src/ui/buttons/variants.ts
|
|
5
|
-
import { cva } from "class-variance-authority";
|
|
6
4
|
var buttonVariants = cva(
|
|
7
5
|
[
|
|
8
6
|
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-xl",
|
|
@@ -67,7 +65,6 @@ var buttonVariants = cva(
|
|
|
67
65
|
}
|
|
68
66
|
);
|
|
69
67
|
|
|
70
|
-
export {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
//# sourceMappingURL=chunk-VJHD7QZH.mjs.map
|
|
68
|
+
export { buttonVariants };
|
|
69
|
+
//# sourceMappingURL=chunk-BORK3BJO.mjs.map
|
|
70
|
+
//# sourceMappingURL=chunk-BORK3BJO.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ui/buttons/variants.ts"],"names":[],"mappings":";;;AAEO,IAAM,cAAA,GAAiB,GAAA;AAAA,EAC5B;AAAA,IACE,4EAAA;AAAA,IACA,6DAAA;AAAA,IACA,0GAAA;AAAA,IACA,kDAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,UAAA,EAAY;AAAA,QACV,OAAA,EACE,kFAAA;AAAA,QACF,SAAA,EAAW,+CAAA;AAAA,QACX,WAAA,EAAa,0CAAA;AAAA,QACb,OAAA,EACE,mEAAA;AAAA,QACF,KAAA,EAAO,gDAAA;AAAA,QACP,IAAA,EAAM,iEAAA;AAAA,QACN,KAAA,EACE,kFAAA;AAAA,QACF,OAAA,EAAS,gDAAA;AAAA,QACT,MAAA,EAAQ,8CAAA;AAAA,QACR,MAAA,EAAQ,8CAAA;AAAA,QACR,IAAA,EAAM,0CAAA;AAAA,QACN,IAAA,EAAM,0CAAA;AAAA,QACN,GAAA,EAAK,wCAAA;AAAA,QACL,IAAA,EAAM,0CAAA;AAAA,QACN,MAAA,EAAQ,8CAAA;AAAA,QACR,MAAA,EAAQ,8CAAA;AAAA,QACR,IAAA,EAAM,0CAAA;AAAA,QACN,KAAA,EAAO,4CAAA;AAAA,QACP,MAAA,EAAQ,8CAAA;AAAA,QACR,eAAA,EACE,iGAAA;AAAA,QACF,gBAAA,EACE,+FAAA;AAAA,QACF,cAAA,EACE,2FAAA;AAAA,QACF,iBAAA,EACE,qGAAA;AAAA,QACF,iBAAA,EACE,iGAAA;AAAA,QACF,eAAA,EACE,6FAAA;AAAA,QACF,iBAAA,EACE,qGAAA;AAAA,QACF,eAAA,EACE,6FAAA;AAAA,QACF,iBAAA,EACE;AAAA,OACJ;AAAA,MACA,IAAA,EAAM;AAAA,QACJ,EAAA,EAAI,yBAAA;AAAA,QACJ,EAAA,EAAI,kBAAA;AAAA,QACJ,EAAA,EAAI,6BAAA;AAAA,QACJ,EAAA,EAAI,2BAAA;AAAA,QACJ,KAAA,EAAO,mCAAA;AAAA,QACP,KAAA,EAAO,qCAAA;AAAA,QACP,KAAA,EAAO,sCAAA;AAAA,QACP,KAAA,EAAO,sCAAA;AAAA,QACP,KAAA,EAAO,sCAAA;AAAA,QACP,KAAA,EAAO,sCAAA;AAAA,QACP,KAAA,EAAO,6BAAA;AAAA,QACP,KAAA,EAAO,sCAAA;AAAA,QACP,MAAA,EAAQ,sCAAA;AAAA,QACR,IAAA,EAAM;AAAA;AACR,KACF;AAAA,IACA,eAAA,EAAiB;AAAA,MACf,UAAA,EAAY,SAAA;AAAA,MACZ,IAAA,EAAM;AAAA;AACR;AAEJ","file":"chunk-BORK3BJO.mjs","sourcesContent":["import { cva } from \"class-variance-authority\";\n\nexport const buttonVariants = cva(\n [\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-xl\",\n \"text-sm font-medium ring-offset-slate-950 transition-colors\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-300 focus-visible:ring-offset-2\",\n \"disabled:pointer-events-none disabled:opacity-50\",\n \"select-none\",\n ],\n {\n variants: {\n appearance: {\n default:\n \"bg-slate-50 text-slate-950 shadow-[0_1px_2px_rgba(15,23,42,0.12)] hover:bg-white\",\n secondary: \"bg-slate-800 text-slate-50 hover:bg-slate-700\",\n destructive: \"bg-rose-600 text-white hover:bg-rose-600\",\n outline:\n \"border border-white/10 bg-white/5 text-slate-50 hover:bg-white/10\",\n ghost: \"bg-transparent text-slate-200 hover:bg-white/5\",\n link: \"bg-transparent text-cyan-300 underline-offset-4 hover:underline\",\n glass:\n \"border border-white/15 bg-white/10 text-white backdrop-blur-md hover:bg-white/15\",\n emerald: \"bg-emerald-600 text-white hover:bg-emerald-600\",\n indigo: \"bg-indigo-600 text-white hover:bg-indigo-600\",\n purple: \"bg-purple-600 text-white hover:bg-purple-600\",\n pink: \"bg-pink-600 text-white hover:bg-pink-600\",\n rose: \"bg-rose-600 text-white hover:bg-rose-600\",\n sky: \"bg-sky-600 text-white hover:bg-sky-600\",\n teal: \"bg-teal-600 text-white hover:bg-teal-600\",\n yellow: \"bg-yellow-600 text-white hover:bg-yellow-600\",\n orange: \"bg-orange-600 text-white hover:bg-orange-600\",\n gray: \"bg-gray-600 text-white hover:bg-gray-600\",\n amber: \"bg-amber-600 text-white hover:bg-amber-600\",\n violet: \"bg-violet-600 text-white hover:bg-violet-600\",\n \"gradient-blue\":\n \"bg-gradient-to-r from-blue-600 to-purple-600 text-white hover:from-blue-600 hover:to-purple-600\",\n \"gradient-green\":\n \"bg-gradient-to-r from-green-600 to-lime-600 text-white hover:from-green-600 hover:to-lime-600\",\n \"gradient-red\":\n \"bg-gradient-to-r from-red-600 to-pink-600 text-white hover:from-red-600 hover:to-pink-600\",\n \"gradient-yellow\":\n \"bg-gradient-to-r from-yellow-600 to-orange-600 text-white hover:from-yellow-600 hover:to-orange-600\",\n \"gradient-purple\":\n \"bg-gradient-to-r from-purple-600 to-pink-600 text-white hover:from-purple-600 hover:to-pink-600\",\n \"gradient-teal\":\n \"bg-gradient-to-r from-teal-600 to-cyan-600 text-white hover:from-teal-600 hover:to-cyan-600\",\n \"gradient-indigo\":\n \"bg-gradient-to-r from-indigo-600 to-purple-600 text-white hover:from-indigo-600 hover:to-purple-600\",\n \"gradient-pink\":\n \"bg-gradient-to-r from-pink-600 to-rose-600 text-white hover:from-pink-600 hover:to-rose-600\",\n \"gradient-orange\":\n \"bg-gradient-to-r from-orange-600 to-red-600 text-white hover:from-orange-600 hover:to-red-600\",\n },\n size: {\n sm: \"h-7 md:h-9 px-3 text-xs\",\n md: \"h-9 md:h-11 px-4\",\n lg: \"h-10 md:h-12 px-5 text-base\",\n xl: \"h-12 md:h-14 px-6 text-lg\",\n \"2xl\": \"h-14 md:h-16 px-6 md:px-8 text-xl\",\n \"3xl\": \"h-16 md:h-18 px-8 md:px-10 text-2xl\",\n \"4xl\": \"h-18 md:h-20 px-10 md:px-12 text-2xl\",\n \"5xl\": \"h-20 md:h-22 px-12 md:px-14 text-2xl\",\n \"6xl\": \"h-22 md:h-24 px-14 md:px-16 text-2xl\",\n \"7xl\": \"h-24 md:h-26 px-16 md:px-18 text-2xl\",\n \"8xl\": \"h-26 md:h-28 px-20 text-2xl\",\n \"9xl\": \"h-24 md:h-30 px-18 md:px-22 text-2xl\",\n \"10xl\": \"h-26 md:h-32 px-20 md:px-24 text-2xl\",\n icon: \"h-10 w-10\",\n },\n },\n defaultVariants: {\n appearance: \"default\",\n size: \"md\",\n },\n },\n);\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var clsx = require('clsx');
|
|
4
|
+
var tailwindMerge = require('tailwind-merge');
|
|
5
|
+
|
|
6
|
+
// src/lib/utils.ts
|
|
7
|
+
function cn(...inputs) {
|
|
8
|
+
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
exports.cn = cn;
|
|
12
|
+
//# sourceMappingURL=chunk-WZ2GOU2J.js.map
|
|
13
|
+
//# sourceMappingURL=chunk-WZ2GOU2J.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/utils.ts"],"names":["twMerge","clsx"],"mappings":";;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAOA,qBAAA,CAAQC,SAAA,CAAK,MAAM,CAAC,CAAA;AAC7B","file":"chunk-WZ2GOU2J.js","sourcesContent":["import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"]}
|
package/dist/ui/accordion.d.mts
CHANGED
|
@@ -62,7 +62,7 @@ declare function AccordionTrigger({ className, children, ref, ...rest }: Accordi
|
|
|
62
62
|
declare namespace AccordionTrigger {
|
|
63
63
|
var displayName: string;
|
|
64
64
|
}
|
|
65
|
-
declare function AccordionContent({ className, children, ref }: AccordionContentProps): react_jsx_runtime.JSX.Element | null;
|
|
65
|
+
declare function AccordionContent({ className, children, ref, }: AccordionContentProps): react_jsx_runtime.JSX.Element | null;
|
|
66
66
|
declare namespace AccordionContent {
|
|
67
67
|
var displayName: string;
|
|
68
68
|
}
|
package/dist/ui/accordion.d.ts
CHANGED
|
@@ -62,7 +62,7 @@ declare function AccordionTrigger({ className, children, ref, ...rest }: Accordi
|
|
|
62
62
|
declare namespace AccordionTrigger {
|
|
63
63
|
var displayName: string;
|
|
64
64
|
}
|
|
65
|
-
declare function AccordionContent({ className, children, ref }: AccordionContentProps): react_jsx_runtime.JSX.Element | null;
|
|
65
|
+
declare function AccordionContent({ className, children, ref, }: AccordionContentProps): react_jsx_runtime.JSX.Element | null;
|
|
66
66
|
declare namespace AccordionContent {
|
|
67
67
|
var displayName: string;
|
|
68
68
|
}
|
package/dist/ui/accordion.js
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
"use
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
2
3
|
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var _react = require('react');
|
|
4
|
+
var chunkWZ2GOU2J_js = require('../chunk-WZ2GOU2J.js');
|
|
5
|
+
var framerMotion = require('framer-motion');
|
|
6
|
+
var react = require('react');
|
|
7
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
8
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
15
9
|
|
|
16
10
|
// src/ui/accordion/animations.ts
|
|
17
11
|
var accordionContentTransitionPresets = {
|
|
@@ -20,10 +14,7 @@ var accordionContentTransitionPresets = {
|
|
|
20
14
|
smooth: { duration: 0.28, ease: [0.22, 1, 0.36, 1] },
|
|
21
15
|
slow: { duration: 0.38, ease: [0.4, 0, 0.2, 1] }
|
|
22
16
|
};
|
|
23
|
-
|
|
24
|
-
// src/ui/accordion/variants.ts
|
|
25
|
-
var _classvarianceauthority = require('class-variance-authority');
|
|
26
|
-
var accordionVariants = _classvarianceauthority.cva.call(void 0, "w-full", {
|
|
17
|
+
var accordionVariants = classVarianceAuthority.cva("w-full", {
|
|
27
18
|
variants: {
|
|
28
19
|
appearance: {
|
|
29
20
|
default: "divide-y divide-white/10 rounded-xl border border-white/10",
|
|
@@ -61,7 +52,7 @@ var accordionVariants = _classvarianceauthority.cva.call(void 0, "w-full", {
|
|
|
61
52
|
size: "md"
|
|
62
53
|
}
|
|
63
54
|
});
|
|
64
|
-
var accordionItemVariants =
|
|
55
|
+
var accordionItemVariants = classVarianceAuthority.cva("", {
|
|
65
56
|
variants: {
|
|
66
57
|
appearance: {
|
|
67
58
|
default: "",
|
|
@@ -91,7 +82,7 @@ var accordionItemVariants = _classvarianceauthority.cva.call(void 0, "", {
|
|
|
91
82
|
},
|
|
92
83
|
defaultVariants: { appearance: "default" }
|
|
93
84
|
});
|
|
94
|
-
var accordionTriggerVariants =
|
|
85
|
+
var accordionTriggerVariants = classVarianceAuthority.cva(
|
|
95
86
|
"flex w-full items-center justify-between gap-3 py-3 text-left font-medium text-slate-50 outline-none transition hover:text-white focus-visible:ring-2 focus-visible:ring-white/30",
|
|
96
87
|
{
|
|
97
88
|
variants: {
|
|
@@ -104,7 +95,7 @@ var accordionTriggerVariants = _classvarianceauthority.cva.call(void 0,
|
|
|
104
95
|
defaultVariants: { size: "md" }
|
|
105
96
|
}
|
|
106
97
|
);
|
|
107
|
-
var accordionContentVariants =
|
|
98
|
+
var accordionContentVariants = classVarianceAuthority.cva("pb-3 text-sm", {
|
|
108
99
|
variants: {
|
|
109
100
|
size: {
|
|
110
101
|
sm: "pb-2 text-xs",
|
|
@@ -114,20 +105,17 @@ var accordionContentVariants = _classvarianceauthority.cva.call(void 0, "pb-3 te
|
|
|
114
105
|
},
|
|
115
106
|
defaultVariants: { size: "md" }
|
|
116
107
|
});
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
var _jsxruntime = require('react/jsx-runtime');
|
|
120
|
-
var AccordionContext = _react.createContext.call(void 0, null);
|
|
121
|
-
var AccordionItemValueContext = _react.createContext.call(void 0, null);
|
|
108
|
+
var AccordionContext = react.createContext(null);
|
|
109
|
+
var AccordionItemValueContext = react.createContext(null);
|
|
122
110
|
function useAccordionContext(component) {
|
|
123
|
-
const ctx =
|
|
111
|
+
const ctx = react.useContext(AccordionContext);
|
|
124
112
|
if (!ctx) {
|
|
125
113
|
throw new Error(`${component} must be used within <Accordion>`);
|
|
126
114
|
}
|
|
127
115
|
return ctx;
|
|
128
116
|
}
|
|
129
117
|
function useAccordionItemValue(component) {
|
|
130
|
-
const value =
|
|
118
|
+
const value = react.useContext(AccordionItemValueContext);
|
|
131
119
|
if (!value) {
|
|
132
120
|
throw new Error(`${component} must be used within <AccordionItem>`);
|
|
133
121
|
}
|
|
@@ -149,11 +137,16 @@ function Accordion({
|
|
|
149
137
|
}) {
|
|
150
138
|
const isSingleControlled = value !== void 0;
|
|
151
139
|
const isMultipleControlled = values !== void 0;
|
|
152
|
-
const [singleUncontrolled, setSingleUncontrolled] =
|
|
153
|
-
const [multipleUncontrolled, setMultipleUncontrolled] =
|
|
140
|
+
const [singleUncontrolled, setSingleUncontrolled] = react.useState(defaultValue);
|
|
141
|
+
const [multipleUncontrolled, setMultipleUncontrolled] = react.useState(
|
|
142
|
+
defaultValues ?? []
|
|
143
|
+
);
|
|
154
144
|
const singleValue = isSingleControlled ? value : singleUncontrolled;
|
|
155
|
-
const multipleValues =
|
|
156
|
-
|
|
145
|
+
const multipleValues = react.useMemo(
|
|
146
|
+
() => isMultipleControlled ? values ?? [] : multipleUncontrolled,
|
|
147
|
+
[isMultipleControlled, values, multipleUncontrolled]
|
|
148
|
+
);
|
|
149
|
+
const isOpen = react.useCallback(
|
|
157
150
|
(itemValue) => {
|
|
158
151
|
if (type === "single") {
|
|
159
152
|
return singleValue === itemValue;
|
|
@@ -162,14 +155,14 @@ function Accordion({
|
|
|
162
155
|
},
|
|
163
156
|
[multipleValues, singleValue, type]
|
|
164
157
|
);
|
|
165
|
-
const toggle =
|
|
158
|
+
const toggle = react.useCallback(
|
|
166
159
|
(itemValue) => {
|
|
167
160
|
if (type === "single") {
|
|
168
161
|
const next2 = singleValue === itemValue ? void 0 : itemValue;
|
|
169
162
|
if (!isSingleControlled) {
|
|
170
163
|
setSingleUncontrolled(next2);
|
|
171
164
|
}
|
|
172
|
-
|
|
165
|
+
onValueChange?.(next2);
|
|
173
166
|
return;
|
|
174
167
|
}
|
|
175
168
|
const exists = multipleValues.includes(itemValue);
|
|
@@ -177,7 +170,7 @@ function Accordion({
|
|
|
177
170
|
if (!isMultipleControlled) {
|
|
178
171
|
setMultipleUncontrolled(next);
|
|
179
172
|
}
|
|
180
|
-
|
|
173
|
+
onValuesChange?.(next);
|
|
181
174
|
},
|
|
182
175
|
[
|
|
183
176
|
isMultipleControlled,
|
|
@@ -189,42 +182,60 @@ function Accordion({
|
|
|
189
182
|
type
|
|
190
183
|
]
|
|
191
184
|
);
|
|
192
|
-
const ctx =
|
|
185
|
+
const ctx = react.useMemo(
|
|
193
186
|
() => ({
|
|
194
187
|
type,
|
|
195
|
-
transition:
|
|
196
|
-
appearance:
|
|
197
|
-
size:
|
|
188
|
+
transition: transition ?? "default",
|
|
189
|
+
appearance: appearance ?? "default",
|
|
190
|
+
size: size ?? "md",
|
|
198
191
|
isOpen,
|
|
199
192
|
toggle
|
|
200
193
|
}),
|
|
201
194
|
[appearance, isOpen, size, toggle, transition, type]
|
|
202
195
|
);
|
|
203
|
-
return /* @__PURE__ */
|
|
196
|
+
return /* @__PURE__ */ jsxRuntime.jsx(AccordionContext.Provider, { value: ctx, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
197
|
+
"div",
|
|
198
|
+
{
|
|
199
|
+
"data-slot": "accordion",
|
|
200
|
+
className: chunkWZ2GOU2J_js.cn(accordionVariants({ appearance, size }), className),
|
|
201
|
+
children
|
|
202
|
+
}
|
|
203
|
+
) });
|
|
204
204
|
}
|
|
205
205
|
Accordion.displayName = "Accordion";
|
|
206
|
-
function AccordionItem({
|
|
206
|
+
function AccordionItem({
|
|
207
|
+
className,
|
|
208
|
+
value,
|
|
209
|
+
children,
|
|
210
|
+
ref,
|
|
211
|
+
...rest
|
|
212
|
+
}) {
|
|
207
213
|
const { appearance } = useAccordionContext("AccordionItem");
|
|
208
|
-
return /* @__PURE__ */
|
|
214
|
+
return /* @__PURE__ */ jsxRuntime.jsx(AccordionItemValueContext.Provider, { value, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
209
215
|
"div",
|
|
210
216
|
{
|
|
211
217
|
ref,
|
|
212
218
|
"data-slot": "accordion-item",
|
|
213
219
|
"data-value": value,
|
|
214
|
-
className:
|
|
220
|
+
className: chunkWZ2GOU2J_js.cn(accordionItemVariants({ appearance }), className),
|
|
215
221
|
...rest,
|
|
216
222
|
children
|
|
217
223
|
}
|
|
218
224
|
) });
|
|
219
225
|
}
|
|
220
226
|
AccordionItem.displayName = "AccordionItem";
|
|
221
|
-
function AccordionTrigger({
|
|
227
|
+
function AccordionTrigger({
|
|
228
|
+
className,
|
|
229
|
+
children,
|
|
230
|
+
ref,
|
|
231
|
+
...rest
|
|
232
|
+
}) {
|
|
222
233
|
const itemValue = useAccordionItemValue("AccordionTrigger");
|
|
223
234
|
const { isOpen, toggle, size } = useAccordionContext("AccordionTrigger");
|
|
224
235
|
const open = isOpen(itemValue);
|
|
225
236
|
const panelId = `${itemValue}-panel`;
|
|
226
|
-
const baseId =
|
|
227
|
-
return /* @__PURE__ */
|
|
237
|
+
const baseId = react.useId();
|
|
238
|
+
return /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "m-0", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
228
239
|
"button",
|
|
229
240
|
{
|
|
230
241
|
ref,
|
|
@@ -233,7 +244,7 @@ function AccordionTrigger({ className, children, ref, ...rest }) {
|
|
|
233
244
|
id: `${baseId}-trigger-${itemValue}`,
|
|
234
245
|
"aria-expanded": open,
|
|
235
246
|
"aria-controls": panelId,
|
|
236
|
-
className:
|
|
247
|
+
className: chunkWZ2GOU2J_js.cn(accordionTriggerVariants({ size }), className),
|
|
237
248
|
onClick: () => toggle(itemValue),
|
|
238
249
|
...rest,
|
|
239
250
|
children
|
|
@@ -241,21 +252,29 @@ function AccordionTrigger({ className, children, ref, ...rest }) {
|
|
|
241
252
|
) });
|
|
242
253
|
}
|
|
243
254
|
AccordionTrigger.displayName = "AccordionTrigger";
|
|
244
|
-
function AccordionContent({
|
|
255
|
+
function AccordionContent({
|
|
256
|
+
className,
|
|
257
|
+
children,
|
|
258
|
+
ref
|
|
259
|
+
}) {
|
|
245
260
|
const itemValue = useAccordionItemValue("AccordionContent");
|
|
246
|
-
const {
|
|
261
|
+
const {
|
|
262
|
+
isOpen,
|
|
263
|
+
transition: transitionVariant,
|
|
264
|
+
size
|
|
265
|
+
} = useAccordionContext("AccordionContent");
|
|
247
266
|
const open = isOpen(itemValue);
|
|
248
267
|
const panelId = `${itemValue}-panel`;
|
|
249
268
|
const transitionConfig = accordionContentTransitionPresets[transitionVariant];
|
|
250
269
|
const motionless = transitionVariant === "none";
|
|
251
|
-
return open ? /* @__PURE__ */
|
|
252
|
-
|
|
270
|
+
return open ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
271
|
+
framerMotion.motion.div,
|
|
253
272
|
{
|
|
254
273
|
ref,
|
|
255
274
|
id: panelId,
|
|
256
275
|
role: "region",
|
|
257
276
|
"data-slot": "accordion-content",
|
|
258
|
-
className:
|
|
277
|
+
className: chunkWZ2GOU2J_js.cn(accordionContentVariants({ size }), className),
|
|
259
278
|
initial: motionless ? false : { opacity: 0 },
|
|
260
279
|
animate: motionless ? void 0 : { opacity: 1 },
|
|
261
280
|
exit: motionless ? void 0 : { opacity: 0 },
|
|
@@ -267,14 +286,14 @@ function AccordionContent({ className, children, ref }) {
|
|
|
267
286
|
}
|
|
268
287
|
AccordionContent.displayName = "AccordionContent";
|
|
269
288
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
289
|
+
exports.Accordion = Accordion;
|
|
290
|
+
exports.AccordionContent = AccordionContent;
|
|
291
|
+
exports.AccordionItem = AccordionItem;
|
|
292
|
+
exports.AccordionTrigger = AccordionTrigger;
|
|
293
|
+
exports.accordionContentTransitionPresets = accordionContentTransitionPresets;
|
|
294
|
+
exports.accordionContentVariants = accordionContentVariants;
|
|
295
|
+
exports.accordionItemVariants = accordionItemVariants;
|
|
296
|
+
exports.accordionTriggerVariants = accordionTriggerVariants;
|
|
297
|
+
exports.accordionVariants = accordionVariants;
|
|
298
|
+
//# sourceMappingURL=accordion.js.map
|
|
280
299
|
//# sourceMappingURL=accordion.js.map
|