@codefast/ui 0.3.11-canary.2 → 0.3.12-canary.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/CHANGELOG.md +42 -0
- package/README.md +38 -14
- package/dist/components/accordion.d.ts +11 -29
- package/dist/components/accordion.d.ts.map +1 -0
- package/dist/components/accordion.js +10 -37
- package/dist/components/alert-dialog.d.ts +25 -60
- package/dist/components/alert-dialog.d.ts.map +1 -0
- package/dist/components/alert-dialog.js +16 -69
- package/dist/components/alert.d.ts +16 -27
- package/dist/components/alert.d.ts.map +1 -0
- package/dist/components/alert.js +22 -30
- package/dist/components/aspect-ratio.d.ts +5 -8
- package/dist/components/aspect-ratio.d.ts.map +1 -0
- package/dist/components/aspect-ratio.js +5 -7
- package/dist/components/avatar.d.ts +7 -17
- package/dist/components/avatar.d.ts.map +1 -0
- package/dist/components/avatar.js +7 -18
- package/dist/components/badge.d.ts +15 -21
- package/dist/components/badge.d.ts.map +1 -0
- package/dist/components/badge.js +23 -20
- package/dist/components/breadcrumb.d.ts +13 -35
- package/dist/components/breadcrumb.d.ts.map +1 -0
- package/dist/components/breadcrumb.js +13 -49
- package/dist/components/button-group.d.ts +15 -29
- package/dist/components/button-group.d.ts.map +1 -0
- package/dist/components/button-group.js +22 -27
- package/dist/components/button.d.ts +26 -35
- package/dist/components/button.d.ts.map +1 -0
- package/dist/components/button.js +43 -51
- package/dist/components/calendar.d.ts +10 -24
- package/dist/components/calendar.d.ts.map +1 -0
- package/dist/components/calendar.js +75 -92
- package/dist/components/card.d.ts +11 -34
- package/dist/components/card.d.ts.map +1 -0
- package/dist/components/card.js +11 -39
- package/dist/components/carousel.d.ts +25 -55
- package/dist/components/carousel.d.ts.map +1 -0
- package/dist/components/carousel.js +82 -114
- package/dist/components/chart.d.ts +37 -72
- package/dist/components/chart.d.ts.map +1 -0
- package/dist/components/chart.js +161 -150
- package/dist/components/checkbox-cards.d.ts +9 -15
- package/dist/components/checkbox-cards.d.ts.map +1 -0
- package/dist/components/checkbox-cards.js +8 -22
- package/dist/components/checkbox-group.d.ts +9 -16
- package/dist/components/checkbox-group.d.ts.map +1 -0
- package/dist/components/checkbox-group.js +7 -19
- package/dist/components/checkbox.d.ts +5 -9
- package/dist/components/checkbox.d.ts.map +1 -0
- package/dist/components/checkbox.js +6 -14
- package/dist/components/collapsible.d.ts +7 -14
- package/dist/components/collapsible.d.ts.map +1 -0
- package/dist/components/collapsible.js +7 -15
- package/dist/components/command.d.ts +24 -55
- package/dist/components/command.d.ts.map +1 -0
- package/dist/components/command.js +18 -69
- package/dist/components/context-menu.d.ts +23 -72
- package/dist/components/context-menu.d.ts.map +1 -0
- package/dist/components/context-menu.js +21 -89
- package/dist/components/dialog.d.ts +23 -53
- package/dist/components/dialog.d.ts.map +1 -0
- package/dist/components/dialog.js +20 -72
- package/dist/components/drawer.d.ts +29 -60
- package/dist/components/drawer.d.ts.map +1 -0
- package/dist/components/drawer.js +16 -58
- package/dist/components/dropdown-menu.d.ts +23 -73
- package/dist/components/dropdown-menu.d.ts.map +1 -0
- package/dist/components/dropdown-menu.js +21 -96
- package/dist/components/empty.d.ts +16 -37
- package/dist/components/empty.d.ts.map +1 -0
- package/dist/components/empty.js +24 -44
- package/dist/components/field.d.ts +26 -63
- package/dist/components/field.d.ts.map +1 -0
- package/dist/components/field.js +46 -89
- package/dist/components/form.d.ts +16 -37
- package/dist/components/form.d.ts.map +1 -0
- package/dist/components/form.js +50 -66
- package/dist/components/hover-card.d.ts +8 -21
- package/dist/components/hover-card.d.ts.map +1 -0
- package/dist/components/hover-card.js +8 -23
- package/dist/components/input-group.d.ts +29 -53
- package/dist/components/input-group.d.ts.map +1 -0
- package/dist/components/input-group.js +59 -66
- package/dist/components/input-number.d.ts +8 -28
- package/dist/components/input-number.d.ts.map +1 -0
- package/dist/components/input-number.js +14 -55
- package/dist/components/input-otp.d.ts +11 -24
- package/dist/components/input-otp.d.ts.map +1 -0
- package/dist/components/input-otp.js +13 -34
- package/dist/components/input-password.d.ts +6 -12
- package/dist/components/input-password.d.ts.map +1 -0
- package/dist/components/input-password.js +10 -31
- package/dist/components/input-search.d.ts +9 -18
- package/dist/components/input-search.d.ts.map +1 -0
- package/dist/components/input-search.js +16 -44
- package/dist/components/input.d.ts +5 -10
- package/dist/components/input.d.ts.map +1 -0
- package/dist/components/input.js +5 -9
- package/dist/components/item.d.ts +33 -69
- package/dist/components/item.d.ts.map +1 -0
- package/dist/components/item.js +47 -90
- package/dist/components/kbd.d.ts +6 -13
- package/dist/components/kbd.d.ts.map +1 -0
- package/dist/components/kbd.js +6 -13
- package/dist/components/label.d.ts +5 -9
- package/dist/components/label.d.ts.map +1 -0
- package/dist/components/label.js +5 -8
- package/dist/components/menubar.d.ts +24 -80
- package/dist/components/menubar.d.ts.map +1 -0
- package/dist/components/menubar.js +23 -99
- package/dist/components/native-select.d.ts +7 -16
- package/dist/components/native-select.d.ts.map +1 -0
- package/dist/components/native-select.js +7 -25
- package/dist/components/navigation-menu.d.ts +13 -36
- package/dist/components/navigation-menu.d.ts.map +1 -0
- package/dist/components/navigation-menu.js +25 -61
- package/dist/components/pagination.d.ts +15 -35
- package/dist/components/pagination.d.ts.map +1 -0
- package/dist/components/pagination.js +13 -55
- package/dist/components/popover.d.ts +9 -24
- package/dist/components/popover.d.ts.map +1 -0
- package/dist/components/popover.js +9 -27
- package/dist/components/progress-circle.d.ts +89 -106
- package/dist/components/progress-circle.d.ts.map +1 -0
- package/dist/components/progress-circle.js +70 -103
- package/dist/components/progress.d.ts +5 -10
- package/dist/components/progress.d.ts.map +1 -0
- package/dist/components/progress.js +7 -13
- package/dist/components/radio-cards.d.ts +5 -10
- package/dist/components/radio-cards.d.ts.map +1 -0
- package/dist/components/radio-cards.js +7 -21
- package/dist/components/radio-group.d.ts +6 -13
- package/dist/components/radio-group.d.ts.map +1 -0
- package/dist/components/radio-group.js +6 -17
- package/dist/components/radio.d.ts +6 -12
- package/dist/components/radio.d.ts.map +1 -0
- package/dist/components/radio.js +5 -10
- package/dist/components/resizable.d.ts +8 -18
- package/dist/components/resizable.d.ts.map +1 -0
- package/dist/components/resizable.js +7 -21
- package/dist/components/scroll-area.d.ts +21 -33
- package/dist/components/scroll-area.d.ts.map +1 -0
- package/dist/components/scroll-area.js +64 -84
- package/dist/components/select.d.ts +17 -50
- package/dist/components/select.d.ts.map +1 -0
- package/dist/components/select.js +26 -78
- package/dist/components/separator.d.ts +20 -29
- package/dist/components/separator.d.ts.map +1 -0
- package/dist/components/separator.js +27 -36
- package/dist/components/sheet.d.ts +30 -62
- package/dist/components/sheet.d.ts.map +1 -0
- package/dist/components/sheet.js +36 -80
- package/dist/components/sidebar.d.ts +67 -160
- package/dist/components/sidebar.d.ts.map +1 -0
- package/dist/components/sidebar.js +166 -301
- package/dist/components/skeleton.d.ts +5 -9
- package/dist/components/skeleton.d.ts.map +1 -0
- package/dist/components/skeleton.js +5 -8
- package/dist/components/slider.d.ts +5 -13
- package/dist/components/slider.d.ts.map +1 -0
- package/dist/components/slider.js +12 -34
- package/dist/components/sonner.d.ts +8 -10
- package/dist/components/sonner.d.ts.map +1 -0
- package/dist/components/sonner.js +13 -16
- package/dist/components/spinner.d.ts +6 -12
- package/dist/components/spinner.d.ts.map +1 -0
- package/dist/components/spinner.js +20 -33
- package/dist/components/switch.d.ts +5 -9
- package/dist/components/switch.d.ts.map +1 -0
- package/dist/components/switch.js +5 -12
- package/dist/components/table.d.ts +12 -37
- package/dist/components/table.d.ts.map +1 -0
- package/dist/components/table.js +12 -47
- package/dist/components/tabs.d.ts +8 -21
- package/dist/components/tabs.d.ts.map +1 -0
- package/dist/components/tabs.js +8 -23
- package/dist/components/textarea.d.ts +5 -9
- package/dist/components/textarea.d.ts.map +1 -0
- package/dist/components/textarea.js +5 -8
- package/dist/components/toggle-group.d.ts +10 -24
- package/dist/components/toggle-group.d.ts.map +1 -0
- package/dist/components/toggle-group.js +20 -38
- package/dist/components/toggle.d.ts +18 -25
- package/dist/components/toggle.d.ts.map +1 -0
- package/dist/components/toggle.js +24 -29
- package/dist/components/tooltip.d.ts +9 -24
- package/dist/components/tooltip.d.ts.map +1 -0
- package/dist/components/tooltip.js +9 -28
- package/dist/hooks/use-animated-value.d.ts +2 -4
- package/dist/hooks/use-animated-value.d.ts.map +1 -0
- package/dist/hooks/use-animated-value.js +67 -58
- package/dist/hooks/use-copy-to-clipboard.d.ts +6 -11
- package/dist/hooks/use-copy-to-clipboard.d.ts.map +1 -0
- package/dist/hooks/use-copy-to-clipboard.js +42 -39
- package/dist/hooks/use-is-mobile.d.ts +2 -4
- package/dist/hooks/use-is-mobile.d.ts.map +1 -0
- package/dist/hooks/use-is-mobile.js +20 -23
- package/dist/hooks/use-media-query.d.ts +2 -4
- package/dist/hooks/use-media-query.d.ts.map +1 -0
- package/dist/hooks/use-media-query.js +49 -46
- package/dist/hooks/use-mutation-observer.d.ts +3 -6
- package/dist/hooks/use-mutation-observer.d.ts.map +1 -0
- package/dist/hooks/use-mutation-observer.js +33 -34
- package/dist/hooks/use-pagination.d.ts +15 -22
- package/dist/hooks/use-pagination.d.ts.map +1 -0
- package/dist/hooks/use-pagination.js +99 -99
- package/dist/index.d.ts +131 -69
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +68 -69
- package/dist/primitives/checkbox-group.d.ts +84 -105
- package/dist/primitives/checkbox-group.d.ts.map +1 -0
- package/dist/primitives/checkbox-group.js +91 -105
- package/dist/primitives/input-number.d.ts +41 -51
- package/dist/primitives/input-number.d.ts.map +1 -0
- package/dist/primitives/input-number.js +417 -473
- package/dist/primitives/input.d.ts +43 -48
- package/dist/primitives/input.d.ts.map +1 -0
- package/dist/primitives/input.js +67 -66
- package/dist/primitives/progress-circle.d.ts +49 -79
- package/dist/primitives/progress-circle.d.ts.map +1 -0
- package/dist/primitives/progress-circle.js +134 -149
- package/package.json +17 -10
- package/{dist → src}/css/preset.css +1 -1
- /package/{dist → src}/css/amber.css +0 -0
- /package/{dist → src}/css/blue.css +0 -0
- /package/{dist → src}/css/cyan.css +0 -0
- /package/{dist → src}/css/emerald.css +0 -0
- /package/{dist → src}/css/fuchsia.css +0 -0
- /package/{dist → src}/css/gray.css +0 -0
- /package/{dist → src}/css/green.css +0 -0
- /package/{dist → src}/css/indigo.css +0 -0
- /package/{dist → src}/css/lime.css +0 -0
- /package/{dist → src}/css/neutral.css +0 -0
- /package/{dist → src}/css/orange.css +0 -0
- /package/{dist → src}/css/pink.css +0 -0
- /package/{dist → src}/css/purple.css +0 -0
- /package/{dist → src}/css/red.css +0 -0
- /package/{dist → src}/css/rose.css +0 -0
- /package/{dist → src}/css/sky.css +0 -0
- /package/{dist → src}/css/slate.css +0 -0
- /package/{dist → src}/css/stone.css +0 -0
- /package/{dist → src}/css/style.css +0 -0
- /package/{dist → src}/css/teal.css +0 -0
- /package/{dist → src}/css/violet.css +0 -0
- /package/{dist → src}/css/yellow.css +0 -0
- /package/{dist → src}/css/zinc.css +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,47 @@
|
|
|
1
1
|
# @codefast/ui
|
|
2
2
|
|
|
3
|
+
## 0.3.12-canary.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`b3dfccb`](https://github.com/codefastlabs/codefast/commit/b3dfccbccff8961ca75a4671ae39e7616a7fa59c) Thanks [@thevuong](https://github.com/thevuong)! - refactor: switch package build scripts from tsdown to TypeScript build configs, align UI CSS exports to source CSS paths, and remove obsolete migration tooling
|
|
8
|
+
|
|
9
|
+
- [`cb53569`](https://github.com/codefastlabs/codefast/commit/cb5356985d4f349dd12a32f9de85cc7d13e8cc74) Thanks [@thevuong](https://github.com/thevuong)! - refactor: migrate package dependencies to catalog references
|
|
10
|
+
|
|
11
|
+
- [`82b37c0`](https://github.com/codefastlabs/codefast/commit/82b37c02ad0086114082cc02be54a60d0c4478a6) Thanks [@thevuong](https://github.com/thevuong)! - refactor: rename typecheck scripts to check-types for consistency
|
|
12
|
+
|
|
13
|
+
- [`3f647bc`](https://github.com/codefastlabs/codefast/commit/3f647bce65e4c12d3349f06a5a3a80acf13b03de) Thanks [@thevuong](https://github.com/thevuong)! - refactor: align remaining alias references to subpath imports
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [[`b3dfccb`](https://github.com/codefastlabs/codefast/commit/b3dfccbccff8961ca75a4671ae39e7616a7fa59c), [`cb53569`](https://github.com/codefastlabs/codefast/commit/cb5356985d4f349dd12a32f9de85cc7d13e8cc74), [`e032524`](https://github.com/codefastlabs/codefast/commit/e032524a496132bb3ff6377a7348a7771c1d97dd), [`82b37c0`](https://github.com/codefastlabs/codefast/commit/82b37c02ad0086114082cc02be54a60d0c4478a6), [`3f647bc`](https://github.com/codefastlabs/codefast/commit/3f647bce65e4c12d3349f06a5a3a80acf13b03de)]:
|
|
16
|
+
- @codefast/tailwind-variants@0.3.12-canary.0
|
|
17
|
+
|
|
18
|
+
## 0.3.11
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- [`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
|
|
23
|
+
|
|
24
|
+
- [`bec9cfa`](https://github.com/codefastlabs/codefast/commit/bec9cfab879d59c877db130eb2c2522b1453bc8f) Thanks [@thevuong](https://github.com/thevuong)! - refactor(theme): reorganize imports for improved readability
|
|
25
|
+
|
|
26
|
+
- [`135c6be`](https://github.com/codefastlabs/codefast/commit/135c6bed9d1bc1e96bad3173adab1bf32d74322f) Thanks [@thevuong](https://github.com/thevuong)! - chore: update linting and formatting scripts in package.json
|
|
27
|
+
|
|
28
|
+
- [`610cf7a`](https://github.com/codefastlabs/codefast/commit/610cf7a7f9b6e5b37be21e7675ea363ef1020639) Thanks [@thevuong](https://github.com/thevuong)! - fix(hooks): handle missing `navigator.clipboard.writeText` gracefully
|
|
29
|
+
|
|
30
|
+
- [`42758ab`](https://github.com/codefastlabs/codefast/commit/42758ab9d8f548ea9f4a806a7dbb7ed295fe2390) Thanks [@thevuong](https://github.com/thevuong)! - chore: update package configurations and TypeScript settings
|
|
31
|
+
|
|
32
|
+
- [`b1d23c2`](https://github.com/codefastlabs/codefast/commit/b1d23c27dffff6686193e3cbb3f848970e253493) Thanks [@thevuong](https://github.com/thevuong)! - refactor(chart): update ChartTooltip types for improved compatibility
|
|
33
|
+
|
|
34
|
+
- [`d2abc63`](https://github.com/codefastlabs/codefast/commit/d2abc636245526ec402811d8585d93684865dde6) Thanks [@thevuong](https://github.com/thevuong)! - chore(deps): update package versions and configurations
|
|
35
|
+
|
|
36
|
+
- [`3e90474`](https://github.com/codefastlabs/codefast/commit/3e90474fbbb9f8ac626c5949bfdbac2eaf1cb3e8) Thanks [@thevuong](https://github.com/thevuong)! - chore: update project configuration and dependencies
|
|
37
|
+
|
|
38
|
+
- [`92d1ed7`](https://github.com/codefastlabs/codefast/commit/92d1ed7650b19f91824cfb38ec238857a3d95876) Thanks [@thevuong](https://github.com/thevuong)! - build: replace rslib with tsdown in library packages
|
|
39
|
+
|
|
40
|
+
- [`5c09d4c`](https://github.com/codefastlabs/codefast/commit/5c09d4ce2df564dc7ac6727b00cfa668164a1af4) Thanks [@thevuong](https://github.com/thevuong)! - refactor(config): rename `check-types` to `typecheck` and update usage
|
|
41
|
+
|
|
42
|
+
- 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)]:
|
|
43
|
+
- @codefast/tailwind-variants@0.3.11
|
|
44
|
+
|
|
3
45
|
## 0.3.11-canary.2
|
|
4
46
|
|
|
5
47
|
### 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
|
|
|
@@ -464,6 +484,10 @@ pnpm test --filter=@codefast/ui
|
|
|
464
484
|
pnpm test:coverage --filter=@codefast/ui
|
|
465
485
|
```
|
|
466
486
|
|
|
487
|
+
Package build/dev scripts use TypeScript directly via `tsc -p tsconfig.build.json` (watch mode for `pnpm dev --filter=@codefast/ui`).
|
|
488
|
+
|
|
489
|
+
CSS entry exports under `@codefast/ui/css/*` are sourced from `src/css/*`.
|
|
490
|
+
|
|
467
491
|
### Adding New Components
|
|
468
492
|
|
|
469
493
|
1. Create component files in `src/components/[component-name]/`.
|
|
@@ -1,37 +1,19 @@
|
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
1
2
|
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
2
3
|
import { Slot } from "@radix-ui/react-slot";
|
|
3
|
-
import { ComponentProps, JSX } from "react";
|
|
4
|
-
|
|
5
|
-
//#region src/components/accordion.d.ts
|
|
6
4
|
type AccordionProps = ComponentProps<typeof AccordionPrimitive.Root>;
|
|
7
|
-
declare function Accordion({
|
|
8
|
-
...props
|
|
9
|
-
}: AccordionProps): JSX.Element;
|
|
5
|
+
declare function Accordion({ ...props }: AccordionProps): JSX.Element;
|
|
10
6
|
type AccordionItemProps = ComponentProps<typeof AccordionPrimitive.Item>;
|
|
11
|
-
declare function AccordionItem({
|
|
12
|
-
className,
|
|
13
|
-
...props
|
|
14
|
-
}: AccordionItemProps): JSX.Element;
|
|
7
|
+
declare function AccordionItem({ className, ...props }: AccordionItemProps): JSX.Element;
|
|
15
8
|
interface AccordionIconProps extends ComponentProps<typeof Slot> {
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
asChild?: boolean;
|
|
10
|
+
className?: string;
|
|
18
11
|
}
|
|
19
|
-
declare function AccordionIcon({
|
|
20
|
-
asChild,
|
|
21
|
-
className,
|
|
22
|
-
...props
|
|
23
|
-
}: AccordionIconProps): JSX.Element;
|
|
12
|
+
declare function AccordionIcon({ asChild, className, ...props }: AccordionIconProps): JSX.Element;
|
|
24
13
|
type AccordionTriggerProps = ComponentProps<typeof AccordionPrimitive.Trigger>;
|
|
25
|
-
declare function AccordionTrigger({
|
|
26
|
-
children,
|
|
27
|
-
className,
|
|
28
|
-
...props
|
|
29
|
-
}: AccordionTriggerProps): JSX.Element;
|
|
14
|
+
declare function AccordionTrigger({ children, className, ...props }: AccordionTriggerProps): JSX.Element;
|
|
30
15
|
type AccordionContentProps = ComponentProps<typeof AccordionPrimitive.Content>;
|
|
31
|
-
declare function AccordionContent({
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}: AccordionContentProps): JSX.Element;
|
|
36
|
-
//#endregion
|
|
37
|
-
export { Accordion, AccordionContent, type AccordionContentProps, AccordionIcon, type AccordionIconProps, AccordionItem, type AccordionItemProps, type AccordionProps, AccordionTrigger, type AccordionTriggerProps };
|
|
16
|
+
declare function AccordionContent({ children, className, ...props }: AccordionContentProps): JSX.Element;
|
|
17
|
+
export { Accordion, AccordionContent, AccordionIcon, AccordionItem, AccordionTrigger };
|
|
18
|
+
export type { AccordionContentProps, AccordionIconProps, AccordionItemProps, AccordionProps, AccordionTriggerProps, };
|
|
19
|
+
//# sourceMappingURL=accordion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordion.d.ts","sourceRoot":"","sources":["../../src/components/accordion.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGjD,OAAO,KAAK,kBAAkB,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAO5C,KAAK,c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|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
3
|
import { cn } from "@codefast/tailwind-variants";
|
|
3
4
|
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
4
5
|
import { Slot } from "@radix-ui/react-slot";
|
|
5
6
|
import { ChevronDownIcon } from "lucide-react";
|
|
6
|
-
import { jsx } from "react/jsx-runtime";
|
|
7
|
-
//#region src/components/accordion.tsx
|
|
8
7
|
function Accordion({ ...props }) {
|
|
9
|
-
|
|
10
|
-
"data-slot": "accordion",
|
|
11
|
-
...props
|
|
12
|
-
});
|
|
8
|
+
return _jsx(AccordionPrimitive.Root, { "data-slot": "accordion", ...props });
|
|
13
9
|
}
|
|
14
10
|
function AccordionItem({ className, ...props }) {
|
|
15
|
-
|
|
16
|
-
className: cn("border-b last:border-b-0", className),
|
|
17
|
-
"data-slot": "accordion-item",
|
|
18
|
-
...props
|
|
19
|
-
});
|
|
11
|
+
return (_jsx(AccordionPrimitive.Item, { className: cn("border-b last:border-b-0", className), "data-slot": "accordion-item", ...props }));
|
|
20
12
|
}
|
|
21
13
|
function AccordionIcon({ asChild, className, ...props }) {
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
});
|
|
14
|
+
const Component = (asChild ? Slot : ChevronDownIcon);
|
|
15
|
+
return (_jsx(Component, { "aria-hidden": true, className: cn("size-4 shrink-0 translate-y-0.5 text-muted-foreground transition-transform duration-200", className), "data-slot": "accordion-icon", ...props }));
|
|
28
16
|
}
|
|
29
17
|
function AccordionTrigger({ children, className, ...props }) {
|
|
30
|
-
|
|
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
|
-
});
|
|
18
|
+
return (_jsx(AccordionPrimitive.Header, { className: "flex", "data-slot": "accordion-trigger-wrapper", children: _jsx(AccordionPrimitive.Trigger, { 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), "data-slot": "accordion-trigger", ...props, children: children }) }));
|
|
40
19
|
}
|
|
41
20
|
function AccordionContent({ children, className, ...props }) {
|
|
42
|
-
|
|
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
|
-
});
|
|
21
|
+
return (_jsx(AccordionPrimitive.Content, { className: "overflow-hidden data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down", "data-slot": "accordion-content", ...props, children: _jsx("div", { className: cn("pt-0 pb-4 text-sm", className), children: children }) }));
|
|
51
22
|
}
|
|
52
|
-
|
|
23
|
+
/* -----------------------------------------------------------------------------
|
|
24
|
+
* Exports
|
|
25
|
+
* -------------------------------------------------------------------------- */
|
|
53
26
|
export { Accordion, AccordionContent, AccordionIcon, AccordionItem, AccordionTrigger };
|
|
@@ -1,74 +1,39 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { VariantProps } from "@codefast/tailwind-variants";
|
|
2
|
+
import type { ComponentProps, JSX } from "react";
|
|
3
3
|
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
//#region src/components/alert-dialog.d.ts
|
|
4
|
+
import { buttonVariants } from "#components/button";
|
|
7
5
|
type AlertDialogProps = ComponentProps<typeof AlertDialogPrimitive.Root>;
|
|
8
|
-
declare function AlertDialog({
|
|
9
|
-
...props
|
|
10
|
-
}: AlertDialogProps): JSX.Element;
|
|
6
|
+
declare function AlertDialog({ ...props }: AlertDialogProps): JSX.Element;
|
|
11
7
|
type AlertDialogTriggerProps = ComponentProps<typeof AlertDialogPrimitive.Trigger>;
|
|
12
|
-
declare function AlertDialogTrigger({
|
|
13
|
-
...props
|
|
14
|
-
}: AlertDialogTriggerProps): JSX.Element;
|
|
8
|
+
declare function AlertDialogTrigger({ ...props }: AlertDialogTriggerProps): JSX.Element;
|
|
15
9
|
interface AlertDialogContentProps extends ComponentProps<typeof AlertDialogPrimitive.Content> {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
10
|
+
classNames?: {
|
|
11
|
+
content?: string;
|
|
12
|
+
overlay?: string;
|
|
13
|
+
wrapper?: string;
|
|
14
|
+
};
|
|
21
15
|
}
|
|
22
|
-
declare function AlertDialogContent({
|
|
23
|
-
children,
|
|
24
|
-
className,
|
|
25
|
-
classNames,
|
|
26
|
-
...props
|
|
27
|
-
}: AlertDialogContentProps): JSX.Element;
|
|
16
|
+
declare function AlertDialogContent({ children, className, classNames, ...props }: AlertDialogContentProps): JSX.Element;
|
|
28
17
|
type AlertDialogHeaderProps = ComponentProps<"div">;
|
|
29
|
-
declare function AlertDialogHeader({
|
|
30
|
-
className,
|
|
31
|
-
...props
|
|
32
|
-
}: AlertDialogHeaderProps): JSX.Element;
|
|
18
|
+
declare function AlertDialogHeader({ className, ...props }: AlertDialogHeaderProps): JSX.Element;
|
|
33
19
|
type AlertDialogBodyProps = ComponentProps<"div">;
|
|
34
|
-
declare function AlertDialogBody({
|
|
35
|
-
className,
|
|
36
|
-
...props
|
|
37
|
-
}: AlertDialogBodyProps): JSX.Element;
|
|
20
|
+
declare function AlertDialogBody({ className, ...props }: AlertDialogBodyProps): JSX.Element;
|
|
38
21
|
type AlertDialogFooterProps = ComponentProps<"div">;
|
|
39
|
-
declare function AlertDialogFooter({
|
|
40
|
-
className,
|
|
41
|
-
...props
|
|
42
|
-
}: AlertDialogFooterProps): JSX.Element;
|
|
22
|
+
declare function AlertDialogFooter({ className, ...props }: AlertDialogFooterProps): JSX.Element;
|
|
43
23
|
type AlertDialogTitleProps = ComponentProps<typeof AlertDialogPrimitive.Title>;
|
|
44
|
-
declare function AlertDialogTitle({
|
|
45
|
-
className,
|
|
46
|
-
...props
|
|
47
|
-
}: AlertDialogTitleProps): JSX.Element;
|
|
24
|
+
declare function AlertDialogTitle({ className, ...props }: AlertDialogTitleProps): JSX.Element;
|
|
48
25
|
type AlertDialogDescriptionProps = ComponentProps<typeof AlertDialogPrimitive.Description>;
|
|
49
|
-
declare function AlertDialogDescription({
|
|
50
|
-
className,
|
|
51
|
-
...props
|
|
52
|
-
}: AlertDialogDescriptionProps): JSX.Element;
|
|
26
|
+
declare function AlertDialogDescription({ className, ...props }: AlertDialogDescriptionProps): JSX.Element;
|
|
53
27
|
interface AlertDialogActionProps extends ComponentProps<typeof AlertDialogPrimitive.Action> {
|
|
54
|
-
|
|
55
|
-
|
|
28
|
+
size?: VariantProps<typeof buttonVariants>["size"];
|
|
29
|
+
variant?: VariantProps<typeof buttonVariants>["variant"];
|
|
56
30
|
}
|
|
57
|
-
declare function AlertDialogAction({
|
|
58
|
-
className,
|
|
59
|
-
size,
|
|
60
|
-
variant,
|
|
61
|
-
...props
|
|
62
|
-
}: AlertDialogActionProps): JSX.Element;
|
|
31
|
+
declare function AlertDialogAction({ className, size, variant, ...props }: AlertDialogActionProps): JSX.Element;
|
|
63
32
|
interface AlertDialogCancelProps extends ComponentProps<typeof AlertDialogPrimitive.Cancel> {
|
|
64
|
-
|
|
65
|
-
|
|
33
|
+
size?: VariantProps<typeof buttonVariants>["size"];
|
|
34
|
+
variant?: VariantProps<typeof buttonVariants>["variant"];
|
|
66
35
|
}
|
|
67
|
-
declare function AlertDialogCancel({
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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 };
|
|
36
|
+
declare function AlertDialogCancel({ className, size, variant, ...props }: AlertDialogCancelProps): JSX.Element;
|
|
37
|
+
export { AlertDialog, AlertDialogAction, AlertDialogBody, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, };
|
|
38
|
+
export type { AlertDialogActionProps, AlertDialogBodyProps, AlertDialogCancelProps, AlertDialogContentProps, AlertDialogDescriptionProps, AlertDialogFooterProps, AlertDialogHeaderProps, AlertDialogProps, AlertDialogTitleProps, AlertDialogTriggerProps, };
|
|
39
|
+
//# sourceMappingURL=alert-dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-dialog.d.ts","sourceRoot":"","sources":["../../src/components/alert-dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGjD,OAAO,KAAK,oBAAoB,MAA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,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,GACnB,CAAC;AACF,YAAY,EACV,sBAAsB,EACtB,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,EACvB,2BAA2B,EAC3B,sBAAsB,EACtB,sBAAsB,EACtB,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,GACxB,CAAC"}
|
|
@@ -1,92 +1,39 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { cn } from "@codefast/tailwind-variants";
|
|
4
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
4
|
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
6
|
-
|
|
5
|
+
import { buttonVariants } from "#components/button";
|
|
7
6
|
function AlertDialog({ ...props }) {
|
|
8
|
-
|
|
9
|
-
"data-slot": "alert-dialog",
|
|
10
|
-
...props
|
|
11
|
-
});
|
|
7
|
+
return _jsx(AlertDialogPrimitive.Root, { "data-slot": "alert-dialog", ...props });
|
|
12
8
|
}
|
|
13
9
|
function AlertDialogTrigger({ ...props }) {
|
|
14
|
-
|
|
15
|
-
"data-slot": "alert-dialog-trigger",
|
|
16
|
-
...props
|
|
17
|
-
});
|
|
10
|
+
return _jsx(AlertDialogPrimitive.Trigger, { "data-slot": "alert-dialog-trigger", ...props });
|
|
18
11
|
}
|
|
19
12
|
function AlertDialogContent({ children, className, classNames, ...props }) {
|
|
20
|
-
|
|
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
|
-
})] });
|
|
13
|
+
return (_jsxs(AlertDialogPrimitive.Portal, { children: [_jsx(AlertDialogPrimitive.Overlay, { 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), "data-slot": "alert-dialog-overlay" }), _jsx(AlertDialogPrimitive.Content, { 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), "data-slot": "alert-dialog-content-wrapper", ...props, children: _jsx("div", { 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), "data-slot": "alert-dialog-content", children: children }) })] }));
|
|
33
14
|
}
|
|
34
15
|
function AlertDialogHeader({ className, ...props }) {
|
|
35
|
-
|
|
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
|
-
});
|
|
16
|
+
return (_jsx("div", { className: cn("flex shrink-0 flex-col gap-1.5 px-6 pt-6 pb-4 text-center sm:text-left", className), "data-slot": "alert-dialog-header", ...props }));
|
|
40
17
|
}
|
|
41
18
|
function AlertDialogBody({ className, ...props }) {
|
|
42
|
-
|
|
43
|
-
className: cn("overflow-auto px-6 py-2", className),
|
|
44
|
-
"data-slot": "alert-dialog-body",
|
|
45
|
-
...props
|
|
46
|
-
});
|
|
19
|
+
return (_jsx("main", { className: cn("overflow-auto px-6 py-2", className), "data-slot": "alert-dialog-body", ...props }));
|
|
47
20
|
}
|
|
48
21
|
function AlertDialogFooter({ className, ...props }) {
|
|
49
|
-
|
|
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
|
-
});
|
|
22
|
+
return (_jsx("div", { className: cn("flex shrink-0 flex-col-reverse gap-2 px-6 pt-4 pb-6 sm:flex-row sm:justify-end", className), "data-slot": "alert-dialog-footer", ...props }));
|
|
54
23
|
}
|
|
55
24
|
function AlertDialogTitle({ className, ...props }) {
|
|
56
|
-
|
|
57
|
-
className: cn("text-lg leading-none font-semibold tracking-tight", className),
|
|
58
|
-
"data-slot": "alert-dialog-title",
|
|
59
|
-
...props
|
|
60
|
-
});
|
|
25
|
+
return (_jsx(AlertDialogPrimitive.Title, { className: cn("text-lg leading-none font-semibold tracking-tight", className), "data-slot": "alert-dialog-title", ...props }));
|
|
61
26
|
}
|
|
62
27
|
function AlertDialogDescription({ className, ...props }) {
|
|
63
|
-
|
|
64
|
-
className: cn("text-sm text-muted-foreground", className),
|
|
65
|
-
"data-slot": "alert-dialog-description",
|
|
66
|
-
...props
|
|
67
|
-
});
|
|
28
|
+
return (_jsx(AlertDialogPrimitive.Description, { className: cn("text-sm text-muted-foreground", className), "data-slot": "alert-dialog-description", ...props }));
|
|
68
29
|
}
|
|
69
30
|
function AlertDialogAction({ className, size, variant, ...props }) {
|
|
70
|
-
|
|
71
|
-
className: buttonVariants({
|
|
72
|
-
className,
|
|
73
|
-
size,
|
|
74
|
-
variant
|
|
75
|
-
}),
|
|
76
|
-
"data-slot": "alert-dialog-action",
|
|
77
|
-
...props
|
|
78
|
-
});
|
|
31
|
+
return (_jsx(AlertDialogPrimitive.Action, { className: buttonVariants({ className, size, variant }), "data-slot": "alert-dialog-action", ...props }));
|
|
79
32
|
}
|
|
80
33
|
function AlertDialogCancel({ className, size, variant = "outline", ...props }) {
|
|
81
|
-
|
|
82
|
-
className: buttonVariants({
|
|
83
|
-
className,
|
|
84
|
-
size,
|
|
85
|
-
variant
|
|
86
|
-
}),
|
|
87
|
-
"data-slot": "alert-dialog-cancel",
|
|
88
|
-
...props
|
|
89
|
-
});
|
|
34
|
+
return (_jsx(AlertDialogPrimitive.Cancel, { className: buttonVariants({ className, size, variant }), "data-slot": "alert-dialog-cancel", ...props }));
|
|
90
35
|
}
|
|
91
|
-
|
|
92
|
-
|
|
36
|
+
/* -----------------------------------------------------------------------------
|
|
37
|
+
* Exports
|
|
38
|
+
* -------------------------------------------------------------------------- */
|
|
39
|
+
export { AlertDialog, AlertDialogAction, AlertDialogBody, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, };
|
|
@@ -1,30 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
default: string;
|
|
9
|
-
destructive: string;
|
|
10
|
-
};
|
|
1
|
+
import type { VariantProps } from "@codefast/tailwind-variants";
|
|
2
|
+
import type { ComponentProps, JSX } from "react";
|
|
3
|
+
declare const alertVariants: import("@codefast/tailwind-variants").VariantFunctionType<{
|
|
4
|
+
variant: {
|
|
5
|
+
default: string;
|
|
6
|
+
destructive: string;
|
|
7
|
+
};
|
|
11
8
|
}, Record<string, never>>;
|
|
12
|
-
interface AlertProps extends ComponentProps<"div">, VariantProps<typeof alertVariants> {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
variant,
|
|
16
|
-
...props
|
|
17
|
-
}: AlertProps): JSX.Element;
|
|
9
|
+
interface AlertProps extends ComponentProps<"div">, VariantProps<typeof alertVariants> {
|
|
10
|
+
}
|
|
11
|
+
declare function Alert({ className, variant, ...props }: AlertProps): JSX.Element;
|
|
18
12
|
type AlertTitleProps = ComponentProps<"div">;
|
|
19
|
-
declare function AlertTitle({
|
|
20
|
-
children,
|
|
21
|
-
className,
|
|
22
|
-
...props
|
|
23
|
-
}: AlertTitleProps): JSX.Element;
|
|
13
|
+
declare function AlertTitle({ children, className, ...props }: AlertTitleProps): JSX.Element;
|
|
24
14
|
type AlertDescriptionProps = ComponentProps<"div">;
|
|
25
|
-
declare function AlertDescription({
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
//#
|
|
30
|
-
export { Alert, AlertDescription, type AlertDescriptionProps, type AlertProps, AlertTitle, type AlertTitleProps, alertVariants };
|
|
15
|
+
declare function AlertDescription({ className, ...props }: AlertDescriptionProps): JSX.Element;
|
|
16
|
+
export { alertVariants };
|
|
17
|
+
export { Alert, AlertDescription, AlertTitle };
|
|
18
|
+
export type { AlertDescriptionProps, AlertProps, AlertTitleProps };
|
|
19
|
+
//# sourceMappingURL=alert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../src/components/alert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAQjD,QAAA,MAAM,aAAa;;;;;yBAYjB,CAAC;AAMH,UAAU,UAAW,SAAQ,cAAc,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC,OAAO,aAAa,CAAC;CAAG;AAEzF,iBAAS,KAAK,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,GAAG,GAAG,CAAC,OAAO,CASxE;AAMD,KAAK,eAAe,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAE7C,iBAAS,UAAU,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,GAAG,GAAG,CAAC,OAAO,CAUnF;AAMD,KAAK,qBAAqB,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAEnD,iBAAS,gBAAgB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,qBAAqB,GAAG,GAAG,CAAC,OAAO,CAWrF;AAMD,OAAO,EAAE,aAAa,EAAE,CAAC;AACzB,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,CAAC;AAC/C,YAAY,EAAE,qBAAqB,EAAE,UAAU,EAAE,eAAe,EAAE,CAAC"}
|
package/dist/components/alert.js
CHANGED
|
@@ -1,39 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { cn, tv } from "@codefast/tailwind-variants";
|
|
2
|
-
|
|
3
|
-
|
|
3
|
+
/* -----------------------------------------------------------------------------
|
|
4
|
+
* Variant: Alert
|
|
5
|
+
* -------------------------------------------------------------------------- */
|
|
4
6
|
const alertVariants = tv({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
base: "relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-xl border bg-card px-4 py-3 text-sm has-[>svg]:grid-cols-[--spacing(4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",
|
|
8
|
+
defaultVariants: {
|
|
9
|
+
variant: "default",
|
|
10
|
+
},
|
|
11
|
+
variants: {
|
|
12
|
+
variant: {
|
|
13
|
+
default: "text-card-foreground",
|
|
14
|
+
destructive: "text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current",
|
|
15
|
+
},
|
|
16
|
+
},
|
|
11
17
|
});
|
|
12
18
|
function Alert({ className, variant, ...props }) {
|
|
13
|
-
|
|
14
|
-
className: alertVariants({
|
|
15
|
-
className,
|
|
16
|
-
variant
|
|
17
|
-
}),
|
|
18
|
-
"data-slot": "alert",
|
|
19
|
-
role: "alert",
|
|
20
|
-
...props
|
|
21
|
-
});
|
|
19
|
+
return (_jsx("div", { className: alertVariants({ className, variant }), "data-slot": "alert", role: "alert", ...props }));
|
|
22
20
|
}
|
|
23
21
|
function AlertTitle({ children, className, ...props }) {
|
|
24
|
-
|
|
25
|
-
className: cn("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight", className),
|
|
26
|
-
"data-slot": "alert-title",
|
|
27
|
-
...props,
|
|
28
|
-
children
|
|
29
|
-
});
|
|
22
|
+
return (_jsx("div", { className: cn("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight", className), "data-slot": "alert-title", ...props, children: children }));
|
|
30
23
|
}
|
|
31
24
|
function AlertDescription({ className, ...props }) {
|
|
32
|
-
|
|
33
|
-
className: cn("col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed", className),
|
|
34
|
-
"data-slot": "alert-description",
|
|
35
|
-
...props
|
|
36
|
-
});
|
|
25
|
+
return (_jsx("div", { className: cn("col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed", className), "data-slot": "alert-description", ...props }));
|
|
37
26
|
}
|
|
38
|
-
|
|
39
|
-
|
|
27
|
+
/* -----------------------------------------------------------------------------
|
|
28
|
+
* Exports
|
|
29
|
+
* -------------------------------------------------------------------------- */
|
|
30
|
+
export { alertVariants };
|
|
31
|
+
export { Alert, AlertDescription, AlertTitle };
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
1
2
|
import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio";
|
|
2
|
-
import { ComponentProps, JSX } from "react";
|
|
3
|
-
|
|
4
|
-
//#region src/components/aspect-ratio.d.ts
|
|
5
3
|
type AspectRatioProps = ComponentProps<typeof AspectRatioPrimitive.Root>;
|
|
6
|
-
declare function AspectRatio({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
//#
|
|
10
|
-
export { AspectRatio, type AspectRatioProps };
|
|
4
|
+
declare function AspectRatio({ ...props }: AspectRatioProps): JSX.Element;
|
|
5
|
+
export { AspectRatio };
|
|
6
|
+
export type { AspectRatioProps };
|
|
7
|
+
//# sourceMappingURL=aspect-ratio.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aspect-ratio.d.ts","sourceRoot":"","sources":["../../src/components/aspect-ratio.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,KAAK,oBAAoB,MAAM,8BAA8B,CAAC;AAMrE,KAAK,gBAAgB,GAAG,cAAc,CAAC,OAAO,oBAAoB,CAAC,IAAI,CAAC,CAAC;AAEzE,iBAAS,WAAW,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,GAAG,GAAG,CAAC,OAAO,CAEhE;AAMD,OAAO,EAAE,WAAW,EAAE,CAAC;AACvB,YAAY,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio";
|
|
4
|
-
//#region src/components/aspect-ratio.tsx
|
|
5
4
|
function AspectRatio({ ...props }) {
|
|
6
|
-
|
|
7
|
-
"data-slot": "aspect-ratio",
|
|
8
|
-
...props
|
|
9
|
-
});
|
|
5
|
+
return _jsx(AspectRatioPrimitive.Root, { "data-slot": "aspect-ratio", ...props });
|
|
10
6
|
}
|
|
11
|
-
|
|
7
|
+
/* -----------------------------------------------------------------------------
|
|
8
|
+
* Exports
|
|
9
|
+
* -------------------------------------------------------------------------- */
|
|
12
10
|
export { AspectRatio };
|