@codefast/ui 0.3.11-canary.1 → 0.3.11
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/CHANGELOG.md +36 -0
- package/README.md +34 -14
- package/dist/components/accordion.d.ts +29 -10
- package/dist/components/accordion.js +38 -37
- package/dist/components/alert-dialog.d.ts +60 -24
- package/dist/components/alert-dialog.js +69 -72
- package/dist/components/alert.d.ts +27 -15
- package/dist/components/alert.js +29 -31
- package/dist/components/aspect-ratio.d.ts +8 -4
- package/dist/components/aspect-ratio.js +7 -5
- package/dist/components/avatar.d.ts +17 -6
- package/dist/components/avatar.js +19 -17
- package/dist/components/badge.d.ts +21 -14
- package/dist/components/badge.js +19 -22
- package/dist/components/breadcrumb.d.ts +35 -12
- package/dist/components/breadcrumb.js +48 -54
- package/dist/components/button-group.d.ts +29 -14
- package/dist/components/button-group.js +27 -32
- package/dist/components/button.d.ts +35 -25
- package/dist/components/button.js +50 -48
- package/dist/components/calendar.d.ts +24 -9
- package/dist/components/calendar.js +92 -98
- package/dist/components/card.d.ts +34 -10
- package/dist/components/card.js +39 -37
- package/dist/components/carousel.d.ts +55 -24
- package/dist/components/carousel.js +113 -130
- package/dist/components/chart.d.ts +72 -36
- package/dist/components/chart.js +154 -166
- package/dist/components/checkbox-cards.d.ts +15 -8
- package/dist/components/checkbox-cards.js +22 -25
- package/dist/components/checkbox-group.d.ts +16 -8
- package/dist/components/checkbox-group.js +19 -19
- package/dist/components/checkbox.d.ts +9 -4
- package/dist/components/checkbox.js +14 -14
- package/dist/components/collapsible.d.ts +14 -6
- package/dist/components/collapsible.js +18 -16
- package/dist/components/command.d.ts +55 -23
- package/dist/components/command.js +70 -85
- package/dist/components/context-menu.d.ts +72 -22
- package/dist/components/context-menu.js +88 -109
- package/dist/components/dialog.d.ts +53 -22
- package/dist/components/dialog.js +71 -85
- package/dist/components/drawer.d.ts +60 -28
- package/dist/components/drawer.js +59 -67
- package/dist/components/dropdown-menu.d.ts +73 -22
- package/dist/components/dropdown-menu.js +95 -112
- package/dist/components/empty.d.ts +37 -15
- package/dist/components/empty.js +43 -45
- package/dist/components/field.d.ts +63 -25
- package/dist/components/field.js +88 -104
- package/dist/components/form.d.ts +37 -15
- package/dist/components/form.js +65 -70
- package/dist/components/hover-card.d.ts +21 -7
- package/dist/components/hover-card.js +24 -24
- package/dist/components/input-group.d.ts +53 -28
- package/dist/components/input-group.js +63 -77
- package/dist/components/input-number.d.ts +28 -7
- package/dist/components/input-number.js +55 -59
- package/dist/components/input-otp.d.ts +24 -10
- package/dist/components/input-otp.js +33 -37
- package/dist/components/input-password.d.ts +12 -5
- package/dist/components/input-password.js +31 -32
- package/dist/components/input-search.d.ts +18 -8
- package/dist/components/input-search.js +43 -41
- package/dist/components/input.d.ts +10 -4
- package/dist/components/input.js +9 -7
- package/dist/components/item.d.ts +69 -32
- package/dist/components/item.js +89 -92
- package/dist/components/kbd.d.ts +13 -5
- package/dist/components/kbd.js +13 -11
- package/dist/components/label.d.ts +9 -4
- package/dist/components/label.js +9 -7
- package/dist/components/menubar.d.ts +80 -23
- package/dist/components/menubar.js +97 -118
- package/dist/components/native-select.d.ts +16 -6
- package/dist/components/native-select.js +25 -26
- package/dist/components/navigation-menu.d.ts +36 -12
- package/dist/components/navigation-menu.js +60 -75
- package/dist/components/pagination.d.ts +35 -14
- package/dist/components/pagination.js +54 -69
- package/dist/components/popover.d.ts +24 -8
- package/dist/components/popover.js +28 -28
- package/dist/components/progress-circle.d.ts +106 -88
- package/dist/components/progress-circle.js +106 -138
- package/dist/components/progress.d.ts +10 -4
- package/dist/components/progress.js +14 -14
- package/dist/components/radio-cards.d.ts +10 -4
- package/dist/components/radio-cards.js +22 -23
- package/dist/components/radio-group.d.ts +13 -5
- package/dist/components/radio-group.js +18 -16
- package/dist/components/radio.d.ts +12 -5
- package/dist/components/radio.js +10 -8
- package/dist/components/resizable.d.ts +18 -7
- package/dist/components/resizable.js +22 -22
- package/dist/components/scroll-area.d.ts +33 -20
- package/dist/components/scroll-area.js +84 -88
- package/dist/components/select.d.ts +50 -16
- package/dist/components/select.js +77 -96
- package/dist/components/separator.d.ts +29 -19
- package/dist/components/separator.js +36 -34
- package/dist/components/sheet.d.ts +62 -29
- package/dist/components/sheet.js +79 -100
- package/dist/components/sidebar.d.ts +160 -66
- package/dist/components/sidebar.js +294 -336
- package/dist/components/skeleton.d.ts +9 -4
- package/dist/components/skeleton.js +8 -6
- package/dist/components/slider.d.ts +13 -4
- package/dist/components/slider.js +34 -40
- package/dist/components/sonner.d.ts +10 -7
- package/dist/components/sonner.js +16 -14
- package/dist/components/spinner.d.ts +12 -5
- package/dist/components/spinner.js +33 -35
- package/dist/components/switch.d.ts +9 -4
- package/dist/components/switch.js +13 -11
- package/dist/components/table.d.ts +37 -11
- package/dist/components/table.js +47 -45
- package/dist/components/tabs.d.ts +21 -7
- package/dist/components/tabs.js +24 -22
- package/dist/components/textarea.d.ts +9 -4
- package/dist/components/textarea.js +8 -6
- package/dist/components/toggle-group.d.ts +24 -9
- package/dist/components/toggle-group.js +41 -42
- package/dist/components/toggle.d.ts +25 -17
- package/dist/components/toggle.js +30 -28
- package/dist/components/tooltip.d.ts +24 -8
- package/dist/components/tooltip.js +29 -32
- package/dist/hooks/use-animated-value.d.ts +4 -1
- package/dist/hooks/use-animated-value.js +57 -36
- package/dist/hooks/use-copy-to-clipboard.d.ts +11 -5
- package/dist/hooks/use-copy-to-clipboard.js +39 -20
- package/dist/hooks/use-is-mobile.d.ts +4 -1
- package/dist/hooks/use-is-mobile.js +21 -1
- package/dist/hooks/use-media-query.d.ts +4 -1
- package/dist/hooks/use-media-query.js +45 -18
- package/dist/hooks/use-mutation-observer.d.ts +6 -2
- package/dist/hooks/use-mutation-observer.js +34 -16
- package/dist/hooks/use-pagination.d.ts +22 -14
- package/dist/hooks/use-pagination.js +100 -49
- package/dist/index.d.ts +69 -130
- package/dist/index.js +11 -11
- package/dist/primitives/checkbox-group.d.ts +105 -83
- package/dist/primitives/checkbox-group.js +111 -84
- package/dist/primitives/input-number.d.ts +51 -40
- package/dist/primitives/input-number.js +483 -350
- package/dist/primitives/input.d.ts +48 -42
- package/dist/primitives/input.js +65 -43
- package/dist/primitives/progress-circle.d.ts +79 -48
- package/dist/primitives/progress-circle.js +154 -105
- package/package.json +6 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# @codefast/ui
|
|
2
2
|
|
|
3
|
+
## 0.3.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`dd5130a`](https://github.com/codefastlabs/codefast/commit/dd5130adb5649dca6773614ffda262cdde732d8f) Thanks [@thevuong](https://github.com/thevuong)! - chore(deps): downgrade @rslib/core to 0.19.1 in package.json and pnpm-lock.yaml
|
|
8
|
+
|
|
9
|
+
- [`bec9cfa`](https://github.com/codefastlabs/codefast/commit/bec9cfab879d59c877db130eb2c2522b1453bc8f) Thanks [@thevuong](https://github.com/thevuong)! - refactor(theme): reorganize imports for improved readability
|
|
10
|
+
|
|
11
|
+
- [`135c6be`](https://github.com/codefastlabs/codefast/commit/135c6bed9d1bc1e96bad3173adab1bf32d74322f) Thanks [@thevuong](https://github.com/thevuong)! - chore: update linting and formatting scripts in package.json
|
|
12
|
+
|
|
13
|
+
- [`610cf7a`](https://github.com/codefastlabs/codefast/commit/610cf7a7f9b6e5b37be21e7675ea363ef1020639) Thanks [@thevuong](https://github.com/thevuong)! - fix(hooks): handle missing `navigator.clipboard.writeText` gracefully
|
|
14
|
+
|
|
15
|
+
- [`42758ab`](https://github.com/codefastlabs/codefast/commit/42758ab9d8f548ea9f4a806a7dbb7ed295fe2390) Thanks [@thevuong](https://github.com/thevuong)! - chore: update package configurations and TypeScript settings
|
|
16
|
+
|
|
17
|
+
- [`b1d23c2`](https://github.com/codefastlabs/codefast/commit/b1d23c27dffff6686193e3cbb3f848970e253493) Thanks [@thevuong](https://github.com/thevuong)! - refactor(chart): update ChartTooltip types for improved compatibility
|
|
18
|
+
|
|
19
|
+
- [`d2abc63`](https://github.com/codefastlabs/codefast/commit/d2abc636245526ec402811d8585d93684865dde6) Thanks [@thevuong](https://github.com/thevuong)! - chore(deps): update package versions and configurations
|
|
20
|
+
|
|
21
|
+
- [`3e90474`](https://github.com/codefastlabs/codefast/commit/3e90474fbbb9f8ac626c5949bfdbac2eaf1cb3e8) Thanks [@thevuong](https://github.com/thevuong)! - chore: update project configuration and dependencies
|
|
22
|
+
|
|
23
|
+
- [`92d1ed7`](https://github.com/codefastlabs/codefast/commit/92d1ed7650b19f91824cfb38ec238857a3d95876) Thanks [@thevuong](https://github.com/thevuong)! - build: replace rslib with tsdown in library packages
|
|
24
|
+
|
|
25
|
+
- [`5c09d4c`](https://github.com/codefastlabs/codefast/commit/5c09d4ce2df564dc7ac6727b00cfa668164a1af4) Thanks [@thevuong](https://github.com/thevuong)! - refactor(config): rename `check-types` to `typecheck` and update usage
|
|
26
|
+
|
|
27
|
+
- Updated dependencies [[`dd5130a`](https://github.com/codefastlabs/codefast/commit/dd5130adb5649dca6773614ffda262cdde732d8f), [`135c6be`](https://github.com/codefastlabs/codefast/commit/135c6bed9d1bc1e96bad3173adab1bf32d74322f), [`610cf7a`](https://github.com/codefastlabs/codefast/commit/610cf7a7f9b6e5b37be21e7675ea363ef1020639), [`42758ab`](https://github.com/codefastlabs/codefast/commit/42758ab9d8f548ea9f4a806a7dbb7ed295fe2390), [`d2abc63`](https://github.com/codefastlabs/codefast/commit/d2abc636245526ec402811d8585d93684865dde6), [`49df885`](https://github.com/codefastlabs/codefast/commit/49df8854d51bad598381be68b6e41096e7da814c), [`3e90474`](https://github.com/codefastlabs/codefast/commit/3e90474fbbb9f8ac626c5949bfdbac2eaf1cb3e8), [`92d1ed7`](https://github.com/codefastlabs/codefast/commit/92d1ed7650b19f91824cfb38ec238857a3d95876), [`5c09d4c`](https://github.com/codefastlabs/codefast/commit/5c09d4ce2df564dc7ac6727b00cfa668164a1af4)]:
|
|
28
|
+
- @codefast/tailwind-variants@0.3.11
|
|
29
|
+
|
|
30
|
+
## 0.3.11-canary.2
|
|
31
|
+
|
|
32
|
+
### Patch Changes
|
|
33
|
+
|
|
34
|
+
- [`92d1ed7`](https://github.com/codefastlabs/codefast/commit/92d1ed7650b19f91824cfb38ec238857a3d95876) Thanks [@thevuong](https://github.com/thevuong)! - build: replace rslib with tsdown in library packages
|
|
35
|
+
|
|
36
|
+
- Updated dependencies [[`92d1ed7`](https://github.com/codefastlabs/codefast/commit/92d1ed7650b19f91824cfb38ec238857a3d95876)]:
|
|
37
|
+
- @codefast/tailwind-variants@0.3.11-canary.2
|
|
38
|
+
|
|
3
39
|
## 0.3.11-canary.1
|
|
4
40
|
|
|
5
41
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -162,34 +162,54 @@ import "@codefast/ui/css/style.css";
|
|
|
162
162
|
|
|
163
163
|
#### SSR with Nitro (TanStack Start)
|
|
164
164
|
|
|
165
|
-
|
|
165
|
+
Use this when you ship with **[Nitro](https://v3.nitro.build/)** (e.g. Vercel, Node) and **Vite 8** (Rolldown) via **TanStack Start**.
|
|
166
|
+
|
|
167
|
+
**If you see** a server `TypeError` about `__extends` and `__toESM(...).default` (sometimes minified as `__toESM$1`), often during SSR or route loaders, configure `vite.config.ts` as below.
|
|
168
|
+
|
|
169
|
+
##### Recommended: `nitro.exportConditions`
|
|
170
|
+
|
|
171
|
+
Prefer ESM entry points from dependencies (`import` / `module` in `package.json` `exports`). That avoids pulling CommonJS builds that `require("tslib")`, which can trip Rolldown’s CJS→ESM interop. Nitro still merges in `production` / `development`, `node`, and related conditions.
|
|
166
172
|
|
|
167
173
|
```ts
|
|
168
174
|
// vite.config.ts
|
|
169
175
|
import { defineConfig } from "vite";
|
|
170
176
|
|
|
177
|
+
export default defineConfig({
|
|
178
|
+
nitro: {
|
|
179
|
+
exportConditions: ["import", "module", "default"],
|
|
180
|
+
},
|
|
181
|
+
// plugins: [ tanstackStart(), nitro(), … ]
|
|
182
|
+
});
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
##### Fallback: `resolve.alias`
|
|
186
|
+
|
|
187
|
+
If the error persists, point `tslib` at its ESM file:
|
|
188
|
+
|
|
189
|
+
```ts
|
|
171
190
|
export default defineConfig({
|
|
172
191
|
resolve: {
|
|
173
|
-
alias: {
|
|
174
|
-
// Workaround: Rolldown mishandles tslib CJS; force ESM to avoid SSR 500.
|
|
175
|
-
tslib: "tslib/tslib.es6.mjs",
|
|
176
|
-
},
|
|
192
|
+
alias: { tslib: "tslib/tslib.es6.mjs" },
|
|
177
193
|
},
|
|
178
|
-
// ... other config
|
|
179
194
|
});
|
|
180
195
|
```
|
|
181
196
|
|
|
182
|
-
|
|
197
|
+
##### Why it happens (short)
|
|
198
|
+
|
|
199
|
+
- **Bundler:** Rolldown may wrap `tslib`’s CJS build and read helpers from `.default` in a way that breaks when the module is marked `__esModule`.
|
|
200
|
+
- **Dependencies:** Overlay-related packages (Dialog, Sheet, Menu, …) often pull in utilities such as [`react-remove-scroll-bar`](https://www.npmjs.com/package/react-remove-scroll-bar). Their legacy CJS output can use `require("tslib")` even when your app source is ESM.
|
|
201
|
+
|
|
202
|
+
> **Note:** Don’t use `nitro.alias` for the bare specifier `tslib`. In Nitro v3 that option is for unenv-style path overrides, not npm package names, and can produce broken paths.
|
|
183
203
|
|
|
184
204
|
### Troubleshooting
|
|
185
205
|
|
|
186
|
-
| Issue
|
|
187
|
-
|
|
|
188
|
-
| Components look unstyled
|
|
189
|
-
| Duplicate Tailwind CSS
|
|
190
|
-
| Dark mode not working
|
|
191
|
-
| Build: CSS not found
|
|
192
|
-
| SSR
|
|
206
|
+
| Issue | Solution |
|
|
207
|
+
| -------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
208
|
+
| Components look unstyled | Ensure CSS imports run before any component renders (entry point first). |
|
|
209
|
+
| Duplicate Tailwind CSS | Use Option 1 (theme + preset only), **not** `style.css`. |
|
|
210
|
+
| Dark mode not working | Add `class="dark"` to `<html>` when dark mode is active. |
|
|
211
|
+
| Build: CSS not found | Verify path: `@codefast/ui/css/[theme].css` (e.g. `slate.css`). |
|
|
212
|
+
| SSR / loaders: `Cannot destructure property '__extends'` | Set `nitro.exportConditions: ['import', 'module', 'default']`, or add `resolve.alias` for `tslib` (see [SSR with Nitro](#ssr-with-nitro-tanstack-start)). |
|
|
193
213
|
|
|
194
214
|
### Customizing Theme
|
|
195
215
|
|
|
@@ -1,18 +1,37 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from "react";
|
|
2
1
|
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
3
2
|
import { Slot } from "@radix-ui/react-slot";
|
|
3
|
+
import { ComponentProps, JSX } from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/accordion.d.ts
|
|
4
6
|
type AccordionProps = ComponentProps<typeof AccordionPrimitive.Root>;
|
|
5
|
-
declare function Accordion({
|
|
7
|
+
declare function Accordion({
|
|
8
|
+
...props
|
|
9
|
+
}: AccordionProps): JSX.Element;
|
|
6
10
|
type AccordionItemProps = ComponentProps<typeof AccordionPrimitive.Item>;
|
|
7
|
-
declare function AccordionItem({
|
|
11
|
+
declare function AccordionItem({
|
|
12
|
+
className,
|
|
13
|
+
...props
|
|
14
|
+
}: AccordionItemProps): JSX.Element;
|
|
8
15
|
interface AccordionIconProps extends ComponentProps<typeof Slot> {
|
|
9
|
-
|
|
10
|
-
|
|
16
|
+
asChild?: boolean;
|
|
17
|
+
className?: string;
|
|
11
18
|
}
|
|
12
|
-
declare function AccordionIcon({
|
|
19
|
+
declare function AccordionIcon({
|
|
20
|
+
asChild,
|
|
21
|
+
className,
|
|
22
|
+
...props
|
|
23
|
+
}: AccordionIconProps): JSX.Element;
|
|
13
24
|
type AccordionTriggerProps = ComponentProps<typeof AccordionPrimitive.Trigger>;
|
|
14
|
-
declare function AccordionTrigger({
|
|
25
|
+
declare function AccordionTrigger({
|
|
26
|
+
children,
|
|
27
|
+
className,
|
|
28
|
+
...props
|
|
29
|
+
}: AccordionTriggerProps): JSX.Element;
|
|
15
30
|
type AccordionContentProps = ComponentProps<typeof AccordionPrimitive.Content>;
|
|
16
|
-
declare function AccordionContent({
|
|
17
|
-
|
|
18
|
-
|
|
31
|
+
declare function AccordionContent({
|
|
32
|
+
children,
|
|
33
|
+
className,
|
|
34
|
+
...props
|
|
35
|
+
}: AccordionContentProps): JSX.Element;
|
|
36
|
+
//#endregion
|
|
37
|
+
export { Accordion, AccordionContent, type AccordionContentProps, AccordionIcon, type AccordionIconProps, AccordionItem, type AccordionItemProps, type AccordionProps, AccordionTrigger, type AccordionTriggerProps };
|
|
@@ -1,52 +1,53 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
2
|
import { cn } from "@codefast/tailwind-variants";
|
|
4
|
-
import
|
|
3
|
+
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
5
4
|
import { Slot } from "@radix-ui/react-slot";
|
|
6
5
|
import { ChevronDownIcon } from "lucide-react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/accordion.tsx
|
|
7
8
|
function Accordion({ ...props }) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
return /* @__PURE__ */ jsx(AccordionPrimitive.Root, {
|
|
10
|
+
"data-slot": "accordion",
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
12
13
|
}
|
|
13
14
|
function AccordionItem({ className, ...props }) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
return /* @__PURE__ */ jsx(AccordionPrimitive.Item, {
|
|
16
|
+
className: cn("border-b last:border-b-0", className),
|
|
17
|
+
"data-slot": "accordion-item",
|
|
18
|
+
...props
|
|
19
|
+
});
|
|
19
20
|
}
|
|
20
21
|
function AccordionIcon({ asChild, className, ...props }) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
});
|
|
22
|
+
return /* @__PURE__ */ jsx(asChild ? Slot : ChevronDownIcon, {
|
|
23
|
+
"aria-hidden": true,
|
|
24
|
+
className: cn("size-4 shrink-0 translate-y-0.5 text-muted-foreground transition-transform duration-200", className),
|
|
25
|
+
"data-slot": "accordion-icon",
|
|
26
|
+
...props
|
|
27
|
+
});
|
|
28
28
|
}
|
|
29
29
|
function AccordionTrigger({ children, className, ...props }) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
30
|
+
return /* @__PURE__ */ jsx(AccordionPrimitive.Header, {
|
|
31
|
+
className: "flex",
|
|
32
|
+
"data-slot": "accordion-trigger-wrapper",
|
|
33
|
+
children: /* @__PURE__ */ jsx(AccordionPrimitive.Trigger, {
|
|
34
|
+
className: cn("group/accordion-trigger flex grow items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium outline-hidden hover:not-disabled:underline focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50 [&[data-state=open]>svg]:rotate-180", className),
|
|
35
|
+
"data-slot": "accordion-trigger",
|
|
36
|
+
...props,
|
|
37
|
+
children
|
|
38
|
+
})
|
|
39
|
+
});
|
|
40
40
|
}
|
|
41
41
|
function AccordionContent({ children, className, ...props }) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
42
|
+
return /* @__PURE__ */ jsx(AccordionPrimitive.Content, {
|
|
43
|
+
className: "overflow-hidden data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down",
|
|
44
|
+
"data-slot": "accordion-content",
|
|
45
|
+
...props,
|
|
46
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
47
|
+
className: cn("pt-0 pb-4 text-sm", className),
|
|
48
|
+
children
|
|
49
|
+
})
|
|
50
|
+
});
|
|
51
51
|
}
|
|
52
|
+
//#endregion
|
|
52
53
|
export { Accordion, AccordionContent, AccordionIcon, AccordionItem, AccordionTrigger };
|
|
@@ -1,38 +1,74 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { buttonVariants } from "./button.js";
|
|
2
|
+
import { VariantProps } from "@codefast/tailwind-variants";
|
|
3
3
|
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
4
|
-
import {
|
|
4
|
+
import { ComponentProps, JSX } from "react";
|
|
5
|
+
|
|
6
|
+
//#region src/components/alert-dialog.d.ts
|
|
5
7
|
type AlertDialogProps = ComponentProps<typeof AlertDialogPrimitive.Root>;
|
|
6
|
-
declare function AlertDialog({
|
|
8
|
+
declare function AlertDialog({
|
|
9
|
+
...props
|
|
10
|
+
}: AlertDialogProps): JSX.Element;
|
|
7
11
|
type AlertDialogTriggerProps = ComponentProps<typeof AlertDialogPrimitive.Trigger>;
|
|
8
|
-
declare function AlertDialogTrigger({
|
|
12
|
+
declare function AlertDialogTrigger({
|
|
13
|
+
...props
|
|
14
|
+
}: AlertDialogTriggerProps): JSX.Element;
|
|
9
15
|
interface AlertDialogContentProps extends ComponentProps<typeof AlertDialogPrimitive.Content> {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
16
|
+
classNames?: {
|
|
17
|
+
content?: string;
|
|
18
|
+
overlay?: string;
|
|
19
|
+
wrapper?: string;
|
|
20
|
+
};
|
|
15
21
|
}
|
|
16
|
-
declare function AlertDialogContent({
|
|
22
|
+
declare function AlertDialogContent({
|
|
23
|
+
children,
|
|
24
|
+
className,
|
|
25
|
+
classNames,
|
|
26
|
+
...props
|
|
27
|
+
}: AlertDialogContentProps): JSX.Element;
|
|
17
28
|
type AlertDialogHeaderProps = ComponentProps<"div">;
|
|
18
|
-
declare function AlertDialogHeader({
|
|
29
|
+
declare function AlertDialogHeader({
|
|
30
|
+
className,
|
|
31
|
+
...props
|
|
32
|
+
}: AlertDialogHeaderProps): JSX.Element;
|
|
19
33
|
type AlertDialogBodyProps = ComponentProps<"div">;
|
|
20
|
-
declare function AlertDialogBody({
|
|
34
|
+
declare function AlertDialogBody({
|
|
35
|
+
className,
|
|
36
|
+
...props
|
|
37
|
+
}: AlertDialogBodyProps): JSX.Element;
|
|
21
38
|
type AlertDialogFooterProps = ComponentProps<"div">;
|
|
22
|
-
declare function AlertDialogFooter({
|
|
39
|
+
declare function AlertDialogFooter({
|
|
40
|
+
className,
|
|
41
|
+
...props
|
|
42
|
+
}: AlertDialogFooterProps): JSX.Element;
|
|
23
43
|
type AlertDialogTitleProps = ComponentProps<typeof AlertDialogPrimitive.Title>;
|
|
24
|
-
declare function AlertDialogTitle({
|
|
44
|
+
declare function AlertDialogTitle({
|
|
45
|
+
className,
|
|
46
|
+
...props
|
|
47
|
+
}: AlertDialogTitleProps): JSX.Element;
|
|
25
48
|
type AlertDialogDescriptionProps = ComponentProps<typeof AlertDialogPrimitive.Description>;
|
|
26
|
-
declare function AlertDialogDescription({
|
|
49
|
+
declare function AlertDialogDescription({
|
|
50
|
+
className,
|
|
51
|
+
...props
|
|
52
|
+
}: AlertDialogDescriptionProps): JSX.Element;
|
|
27
53
|
interface AlertDialogActionProps extends ComponentProps<typeof AlertDialogPrimitive.Action> {
|
|
28
|
-
|
|
29
|
-
|
|
54
|
+
size?: VariantProps<typeof buttonVariants>["size"];
|
|
55
|
+
variant?: VariantProps<typeof buttonVariants>["variant"];
|
|
30
56
|
}
|
|
31
|
-
declare function AlertDialogAction({
|
|
57
|
+
declare function AlertDialogAction({
|
|
58
|
+
className,
|
|
59
|
+
size,
|
|
60
|
+
variant,
|
|
61
|
+
...props
|
|
62
|
+
}: AlertDialogActionProps): JSX.Element;
|
|
32
63
|
interface AlertDialogCancelProps extends ComponentProps<typeof AlertDialogPrimitive.Cancel> {
|
|
33
|
-
|
|
34
|
-
|
|
64
|
+
size?: VariantProps<typeof buttonVariants>["size"];
|
|
65
|
+
variant?: VariantProps<typeof buttonVariants>["variant"];
|
|
35
66
|
}
|
|
36
|
-
declare function AlertDialogCancel({
|
|
37
|
-
|
|
38
|
-
|
|
67
|
+
declare function AlertDialogCancel({
|
|
68
|
+
className,
|
|
69
|
+
size,
|
|
70
|
+
variant,
|
|
71
|
+
...props
|
|
72
|
+
}: AlertDialogCancelProps): JSX.Element;
|
|
73
|
+
//#endregion
|
|
74
|
+
export { AlertDialog, AlertDialogAction, type AlertDialogActionProps, AlertDialogBody, type AlertDialogBodyProps, AlertDialogCancel, type AlertDialogCancelProps, AlertDialogContent, type AlertDialogContentProps, AlertDialogDescription, type AlertDialogDescriptionProps, AlertDialogFooter, type AlertDialogFooterProps, AlertDialogHeader, type AlertDialogHeaderProps, type AlertDialogProps, AlertDialogTitle, type AlertDialogTitleProps, AlertDialogTrigger, type AlertDialogTriggerProps };
|
|
@@ -1,95 +1,92 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { cn } from "@codefast/tailwind-variants";
|
|
4
|
-
import { Action, Cancel, Content, Description, Overlay, Portal, Root, Title, Trigger } from "@radix-ui/react-alert-dialog";
|
|
5
2
|
import { buttonVariants } from "./button.js";
|
|
3
|
+
import { cn } from "@codefast/tailwind-variants";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
6
|
+
//#region src/components/alert-dialog.tsx
|
|
6
7
|
function AlertDialog({ ...props }) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
return /* @__PURE__ */ jsx(AlertDialogPrimitive.Root, {
|
|
9
|
+
"data-slot": "alert-dialog",
|
|
10
|
+
...props
|
|
11
|
+
});
|
|
11
12
|
}
|
|
12
13
|
function AlertDialogTrigger({ ...props }) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
return /* @__PURE__ */ jsx(AlertDialogPrimitive.Trigger, {
|
|
15
|
+
"data-slot": "alert-dialog-trigger",
|
|
16
|
+
...props
|
|
17
|
+
});
|
|
17
18
|
}
|
|
18
19
|
function AlertDialogContent({ children, className, classNames, ...props }) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
children: children
|
|
33
|
-
})
|
|
34
|
-
})
|
|
35
|
-
]
|
|
36
|
-
});
|
|
20
|
+
return /* @__PURE__ */ jsxs(AlertDialogPrimitive.Portal, { children: [/* @__PURE__ */ jsx(AlertDialogPrimitive.Overlay, {
|
|
21
|
+
className: cn("fixed inset-0 z-50 bg-black/50 ease-ui data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0", classNames?.overlay),
|
|
22
|
+
"data-slot": "alert-dialog-overlay"
|
|
23
|
+
}), /* @__PURE__ */ jsx(AlertDialogPrimitive.Content, {
|
|
24
|
+
className: cn("fixed inset-0 z-50 grid grid-rows-[1fr_auto_1fr] justify-items-center overflow-auto p-8 ease-ui data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:grid-rows-[1fr_auto_3fr] sm:p-4", classNames?.wrapper),
|
|
25
|
+
"data-slot": "alert-dialog-content-wrapper",
|
|
26
|
+
...props,
|
|
27
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
28
|
+
className: cn("relative row-start-2 flex w-full max-w-lg flex-col rounded-2xl border bg-popover text-popover-foreground shadow-lg", classNames?.content, className),
|
|
29
|
+
"data-slot": "alert-dialog-content",
|
|
30
|
+
children
|
|
31
|
+
})
|
|
32
|
+
})] });
|
|
37
33
|
}
|
|
38
34
|
function AlertDialogHeader({ className, ...props }) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
35
|
+
return /* @__PURE__ */ jsx("div", {
|
|
36
|
+
className: cn("flex shrink-0 flex-col gap-1.5 px-6 pt-6 pb-4 text-center sm:text-left", className),
|
|
37
|
+
"data-slot": "alert-dialog-header",
|
|
38
|
+
...props
|
|
39
|
+
});
|
|
44
40
|
}
|
|
45
41
|
function AlertDialogBody({ className, ...props }) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
42
|
+
return /* @__PURE__ */ jsx("main", {
|
|
43
|
+
className: cn("overflow-auto px-6 py-2", className),
|
|
44
|
+
"data-slot": "alert-dialog-body",
|
|
45
|
+
...props
|
|
46
|
+
});
|
|
51
47
|
}
|
|
52
48
|
function AlertDialogFooter({ className, ...props }) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
49
|
+
return /* @__PURE__ */ jsx("div", {
|
|
50
|
+
className: cn("flex shrink-0 flex-col-reverse gap-2 px-6 pt-4 pb-6 sm:flex-row sm:justify-end", className),
|
|
51
|
+
"data-slot": "alert-dialog-footer",
|
|
52
|
+
...props
|
|
53
|
+
});
|
|
58
54
|
}
|
|
59
55
|
function AlertDialogTitle({ className, ...props }) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
56
|
+
return /* @__PURE__ */ jsx(AlertDialogPrimitive.Title, {
|
|
57
|
+
className: cn("text-lg leading-none font-semibold tracking-tight", className),
|
|
58
|
+
"data-slot": "alert-dialog-title",
|
|
59
|
+
...props
|
|
60
|
+
});
|
|
65
61
|
}
|
|
66
62
|
function AlertDialogDescription({ className, ...props }) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
63
|
+
return /* @__PURE__ */ jsx(AlertDialogPrimitive.Description, {
|
|
64
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
65
|
+
"data-slot": "alert-dialog-description",
|
|
66
|
+
...props
|
|
67
|
+
});
|
|
72
68
|
}
|
|
73
69
|
function AlertDialogAction({ className, size, variant, ...props }) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
70
|
+
return /* @__PURE__ */ jsx(AlertDialogPrimitive.Action, {
|
|
71
|
+
className: buttonVariants({
|
|
72
|
+
className,
|
|
73
|
+
size,
|
|
74
|
+
variant
|
|
75
|
+
}),
|
|
76
|
+
"data-slot": "alert-dialog-action",
|
|
77
|
+
...props
|
|
78
|
+
});
|
|
83
79
|
}
|
|
84
80
|
function AlertDialogCancel({ className, size, variant = "outline", ...props }) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
81
|
+
return /* @__PURE__ */ jsx(AlertDialogPrimitive.Cancel, {
|
|
82
|
+
className: buttonVariants({
|
|
83
|
+
className,
|
|
84
|
+
size,
|
|
85
|
+
variant
|
|
86
|
+
}),
|
|
87
|
+
"data-slot": "alert-dialog-cancel",
|
|
88
|
+
...props
|
|
89
|
+
});
|
|
94
90
|
}
|
|
91
|
+
//#endregion
|
|
95
92
|
export { AlertDialog, AlertDialogAction, AlertDialogBody, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger };
|
|
@@ -1,18 +1,30 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import * as _$_codefast_tailwind_variants0 from "@codefast/tailwind-variants";
|
|
2
|
+
import { VariantProps } from "@codefast/tailwind-variants";
|
|
3
|
+
import { ComponentProps, JSX } from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/alert.d.ts
|
|
6
|
+
declare const alertVariants: _$_codefast_tailwind_variants0.VariantFunctionType<{
|
|
7
|
+
variant: {
|
|
8
|
+
default: string;
|
|
9
|
+
destructive: string;
|
|
10
|
+
};
|
|
8
11
|
}, Record<string, never>>;
|
|
9
|
-
interface AlertProps extends ComponentProps<"div">, VariantProps<typeof alertVariants> {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
interface AlertProps extends ComponentProps<"div">, VariantProps<typeof alertVariants> {}
|
|
13
|
+
declare function Alert({
|
|
14
|
+
className,
|
|
15
|
+
variant,
|
|
16
|
+
...props
|
|
17
|
+
}: AlertProps): JSX.Element;
|
|
12
18
|
type AlertTitleProps = ComponentProps<"div">;
|
|
13
|
-
declare function AlertTitle({
|
|
19
|
+
declare function AlertTitle({
|
|
20
|
+
children,
|
|
21
|
+
className,
|
|
22
|
+
...props
|
|
23
|
+
}: AlertTitleProps): JSX.Element;
|
|
14
24
|
type AlertDescriptionProps = ComponentProps<"div">;
|
|
15
|
-
declare function AlertDescription({
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
25
|
+
declare function AlertDescription({
|
|
26
|
+
className,
|
|
27
|
+
...props
|
|
28
|
+
}: AlertDescriptionProps): JSX.Element;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { Alert, AlertDescription, type AlertDescriptionProps, type AlertProps, AlertTitle, type AlertTitleProps, alertVariants };
|