@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.
Files changed (149) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +34 -14
  3. package/dist/components/accordion.d.ts +29 -10
  4. package/dist/components/accordion.js +38 -37
  5. package/dist/components/alert-dialog.d.ts +60 -24
  6. package/dist/components/alert-dialog.js +69 -72
  7. package/dist/components/alert.d.ts +27 -15
  8. package/dist/components/alert.js +29 -31
  9. package/dist/components/aspect-ratio.d.ts +8 -4
  10. package/dist/components/aspect-ratio.js +7 -5
  11. package/dist/components/avatar.d.ts +17 -6
  12. package/dist/components/avatar.js +19 -17
  13. package/dist/components/badge.d.ts +21 -14
  14. package/dist/components/badge.js +19 -22
  15. package/dist/components/breadcrumb.d.ts +35 -12
  16. package/dist/components/breadcrumb.js +48 -54
  17. package/dist/components/button-group.d.ts +29 -14
  18. package/dist/components/button-group.js +27 -32
  19. package/dist/components/button.d.ts +35 -25
  20. package/dist/components/button.js +50 -48
  21. package/dist/components/calendar.d.ts +24 -9
  22. package/dist/components/calendar.js +92 -98
  23. package/dist/components/card.d.ts +34 -10
  24. package/dist/components/card.js +39 -37
  25. package/dist/components/carousel.d.ts +55 -24
  26. package/dist/components/carousel.js +113 -130
  27. package/dist/components/chart.d.ts +72 -36
  28. package/dist/components/chart.js +154 -166
  29. package/dist/components/checkbox-cards.d.ts +15 -8
  30. package/dist/components/checkbox-cards.js +22 -25
  31. package/dist/components/checkbox-group.d.ts +16 -8
  32. package/dist/components/checkbox-group.js +19 -19
  33. package/dist/components/checkbox.d.ts +9 -4
  34. package/dist/components/checkbox.js +14 -14
  35. package/dist/components/collapsible.d.ts +14 -6
  36. package/dist/components/collapsible.js +18 -16
  37. package/dist/components/command.d.ts +55 -23
  38. package/dist/components/command.js +70 -85
  39. package/dist/components/context-menu.d.ts +72 -22
  40. package/dist/components/context-menu.js +88 -109
  41. package/dist/components/dialog.d.ts +53 -22
  42. package/dist/components/dialog.js +71 -85
  43. package/dist/components/drawer.d.ts +60 -28
  44. package/dist/components/drawer.js +59 -67
  45. package/dist/components/dropdown-menu.d.ts +73 -22
  46. package/dist/components/dropdown-menu.js +95 -112
  47. package/dist/components/empty.d.ts +37 -15
  48. package/dist/components/empty.js +43 -45
  49. package/dist/components/field.d.ts +63 -25
  50. package/dist/components/field.js +88 -104
  51. package/dist/components/form.d.ts +37 -15
  52. package/dist/components/form.js +65 -70
  53. package/dist/components/hover-card.d.ts +21 -7
  54. package/dist/components/hover-card.js +24 -24
  55. package/dist/components/input-group.d.ts +53 -28
  56. package/dist/components/input-group.js +63 -77
  57. package/dist/components/input-number.d.ts +28 -7
  58. package/dist/components/input-number.js +55 -59
  59. package/dist/components/input-otp.d.ts +24 -10
  60. package/dist/components/input-otp.js +33 -37
  61. package/dist/components/input-password.d.ts +12 -5
  62. package/dist/components/input-password.js +31 -32
  63. package/dist/components/input-search.d.ts +18 -8
  64. package/dist/components/input-search.js +43 -41
  65. package/dist/components/input.d.ts +10 -4
  66. package/dist/components/input.js +9 -7
  67. package/dist/components/item.d.ts +69 -32
  68. package/dist/components/item.js +89 -92
  69. package/dist/components/kbd.d.ts +13 -5
  70. package/dist/components/kbd.js +13 -11
  71. package/dist/components/label.d.ts +9 -4
  72. package/dist/components/label.js +9 -7
  73. package/dist/components/menubar.d.ts +80 -23
  74. package/dist/components/menubar.js +97 -118
  75. package/dist/components/native-select.d.ts +16 -6
  76. package/dist/components/native-select.js +25 -26
  77. package/dist/components/navigation-menu.d.ts +36 -12
  78. package/dist/components/navigation-menu.js +60 -75
  79. package/dist/components/pagination.d.ts +35 -14
  80. package/dist/components/pagination.js +54 -69
  81. package/dist/components/popover.d.ts +24 -8
  82. package/dist/components/popover.js +28 -28
  83. package/dist/components/progress-circle.d.ts +106 -88
  84. package/dist/components/progress-circle.js +106 -138
  85. package/dist/components/progress.d.ts +10 -4
  86. package/dist/components/progress.js +14 -14
  87. package/dist/components/radio-cards.d.ts +10 -4
  88. package/dist/components/radio-cards.js +22 -23
  89. package/dist/components/radio-group.d.ts +13 -5
  90. package/dist/components/radio-group.js +18 -16
  91. package/dist/components/radio.d.ts +12 -5
  92. package/dist/components/radio.js +10 -8
  93. package/dist/components/resizable.d.ts +18 -7
  94. package/dist/components/resizable.js +22 -22
  95. package/dist/components/scroll-area.d.ts +33 -20
  96. package/dist/components/scroll-area.js +84 -88
  97. package/dist/components/select.d.ts +50 -16
  98. package/dist/components/select.js +77 -96
  99. package/dist/components/separator.d.ts +29 -19
  100. package/dist/components/separator.js +36 -34
  101. package/dist/components/sheet.d.ts +62 -29
  102. package/dist/components/sheet.js +79 -100
  103. package/dist/components/sidebar.d.ts +160 -66
  104. package/dist/components/sidebar.js +294 -336
  105. package/dist/components/skeleton.d.ts +9 -4
  106. package/dist/components/skeleton.js +8 -6
  107. package/dist/components/slider.d.ts +13 -4
  108. package/dist/components/slider.js +34 -40
  109. package/dist/components/sonner.d.ts +10 -7
  110. package/dist/components/sonner.js +16 -14
  111. package/dist/components/spinner.d.ts +12 -5
  112. package/dist/components/spinner.js +33 -35
  113. package/dist/components/switch.d.ts +9 -4
  114. package/dist/components/switch.js +13 -11
  115. package/dist/components/table.d.ts +37 -11
  116. package/dist/components/table.js +47 -45
  117. package/dist/components/tabs.d.ts +21 -7
  118. package/dist/components/tabs.js +24 -22
  119. package/dist/components/textarea.d.ts +9 -4
  120. package/dist/components/textarea.js +8 -6
  121. package/dist/components/toggle-group.d.ts +24 -9
  122. package/dist/components/toggle-group.js +41 -42
  123. package/dist/components/toggle.d.ts +25 -17
  124. package/dist/components/toggle.js +30 -28
  125. package/dist/components/tooltip.d.ts +24 -8
  126. package/dist/components/tooltip.js +29 -32
  127. package/dist/hooks/use-animated-value.d.ts +4 -1
  128. package/dist/hooks/use-animated-value.js +57 -36
  129. package/dist/hooks/use-copy-to-clipboard.d.ts +11 -5
  130. package/dist/hooks/use-copy-to-clipboard.js +39 -20
  131. package/dist/hooks/use-is-mobile.d.ts +4 -1
  132. package/dist/hooks/use-is-mobile.js +21 -1
  133. package/dist/hooks/use-media-query.d.ts +4 -1
  134. package/dist/hooks/use-media-query.js +45 -18
  135. package/dist/hooks/use-mutation-observer.d.ts +6 -2
  136. package/dist/hooks/use-mutation-observer.js +34 -16
  137. package/dist/hooks/use-pagination.d.ts +22 -14
  138. package/dist/hooks/use-pagination.js +100 -49
  139. package/dist/index.d.ts +69 -130
  140. package/dist/index.js +11 -11
  141. package/dist/primitives/checkbox-group.d.ts +105 -83
  142. package/dist/primitives/checkbox-group.js +111 -84
  143. package/dist/primitives/input-number.d.ts +51 -40
  144. package/dist/primitives/input-number.js +483 -350
  145. package/dist/primitives/input.d.ts +48 -42
  146. package/dist/primitives/input.js +65 -43
  147. package/dist/primitives/progress-circle.d.ts +79 -48
  148. package/dist/primitives/progress-circle.js +154 -105
  149. 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
- When deploying with [Nitro](https://v3.nitro.build/) (Vercel, self-host Node.js, etc.), add this to your `vite.config.ts` to avoid a Rolldown CJS→ESM interop error with `tslib` (used by Radix UI):
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
- **Symptom without this:** `TypeError: Cannot destructure property '__extends' of '__toESM(...).default' as it is undefined` when serving SSR pages.
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 | Solution |
187
- | -------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
188
- | Components look unstyled | Ensure CSS imports run before any component renders (entry point first). |
189
- | Duplicate Tailwind CSS | Use Option 1 (theme + preset only), **not** `style.css`. |
190
- | Dark mode not working | Add `class="dark"` to `<html>` when dark mode is active. |
191
- | Build: CSS not found | Verify path: `@codefast/ui/css/[theme].css` (e.g. `slate.css`). |
192
- | SSR 500: `Cannot destructure property '__extends'` | Add `resolve.alias: { tslib: 'tslib/tslib.es6.mjs' }` in `vite.config.ts` (see [SSR with Nitro](#ssr-with-nitro-tanstack-start)). |
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({ ...props }: AccordionProps): JSX.Element;
7
+ declare function Accordion({
8
+ ...props
9
+ }: AccordionProps): JSX.Element;
6
10
  type AccordionItemProps = ComponentProps<typeof AccordionPrimitive.Item>;
7
- declare function AccordionItem({ className, ...props }: AccordionItemProps): JSX.Element;
11
+ declare function AccordionItem({
12
+ className,
13
+ ...props
14
+ }: AccordionItemProps): JSX.Element;
8
15
  interface AccordionIconProps extends ComponentProps<typeof Slot> {
9
- asChild?: boolean;
10
- className?: string;
16
+ asChild?: boolean;
17
+ className?: string;
11
18
  }
12
- declare function AccordionIcon({ asChild, className, ...props }: AccordionIconProps): JSX.Element;
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({ children, className, ...props }: AccordionTriggerProps): JSX.Element;
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({ children, className, ...props }: AccordionContentProps): JSX.Element;
17
- export { Accordion, AccordionContent, AccordionIcon, AccordionItem, AccordionTrigger };
18
- export type { AccordionContentProps, AccordionIconProps, AccordionItemProps, AccordionProps, AccordionTriggerProps, };
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 { Content, Header, Item, Root, Trigger } from "@radix-ui/react-accordion";
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
- return /*#__PURE__*/ jsx(Root, {
9
- "data-slot": "accordion",
10
- ...props
11
- });
9
+ return /* @__PURE__ */ jsx(AccordionPrimitive.Root, {
10
+ "data-slot": "accordion",
11
+ ...props
12
+ });
12
13
  }
13
14
  function AccordionItem({ className, ...props }) {
14
- return /*#__PURE__*/ jsx(Item, {
15
- className: cn("border-b last:border-b-0", className),
16
- "data-slot": "accordion-item",
17
- ...props
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
- const Component = asChild ? Slot : ChevronDownIcon;
22
- return /*#__PURE__*/ jsx(Component, {
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
- });
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
- return /*#__PURE__*/ jsx(Header, {
31
- className: "flex",
32
- "data-slot": "accordion-trigger-wrapper",
33
- children: /*#__PURE__*/ jsx(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: children
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
- return /*#__PURE__*/ jsx(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: children
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 type { VariantProps } from "@codefast/tailwind-variants";
2
- import type { ComponentProps, JSX } from "react";
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 { buttonVariants } from "./button";
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({ ...props }: AlertDialogProps): JSX.Element;
8
+ declare function AlertDialog({
9
+ ...props
10
+ }: AlertDialogProps): JSX.Element;
7
11
  type AlertDialogTriggerProps = ComponentProps<typeof AlertDialogPrimitive.Trigger>;
8
- declare function AlertDialogTrigger({ ...props }: AlertDialogTriggerProps): JSX.Element;
12
+ declare function AlertDialogTrigger({
13
+ ...props
14
+ }: AlertDialogTriggerProps): JSX.Element;
9
15
  interface AlertDialogContentProps extends ComponentProps<typeof AlertDialogPrimitive.Content> {
10
- classNames?: {
11
- content?: string;
12
- overlay?: string;
13
- wrapper?: string;
14
- };
16
+ classNames?: {
17
+ content?: string;
18
+ overlay?: string;
19
+ wrapper?: string;
20
+ };
15
21
  }
16
- declare function AlertDialogContent({ children, className, classNames, ...props }: AlertDialogContentProps): JSX.Element;
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({ className, ...props }: AlertDialogHeaderProps): JSX.Element;
29
+ declare function AlertDialogHeader({
30
+ className,
31
+ ...props
32
+ }: AlertDialogHeaderProps): JSX.Element;
19
33
  type AlertDialogBodyProps = ComponentProps<"div">;
20
- declare function AlertDialogBody({ className, ...props }: AlertDialogBodyProps): JSX.Element;
34
+ declare function AlertDialogBody({
35
+ className,
36
+ ...props
37
+ }: AlertDialogBodyProps): JSX.Element;
21
38
  type AlertDialogFooterProps = ComponentProps<"div">;
22
- declare function AlertDialogFooter({ className, ...props }: AlertDialogFooterProps): JSX.Element;
39
+ declare function AlertDialogFooter({
40
+ className,
41
+ ...props
42
+ }: AlertDialogFooterProps): JSX.Element;
23
43
  type AlertDialogTitleProps = ComponentProps<typeof AlertDialogPrimitive.Title>;
24
- declare function AlertDialogTitle({ className, ...props }: AlertDialogTitleProps): JSX.Element;
44
+ declare function AlertDialogTitle({
45
+ className,
46
+ ...props
47
+ }: AlertDialogTitleProps): JSX.Element;
25
48
  type AlertDialogDescriptionProps = ComponentProps<typeof AlertDialogPrimitive.Description>;
26
- declare function AlertDialogDescription({ className, ...props }: AlertDialogDescriptionProps): JSX.Element;
49
+ declare function AlertDialogDescription({
50
+ className,
51
+ ...props
52
+ }: AlertDialogDescriptionProps): JSX.Element;
27
53
  interface AlertDialogActionProps extends ComponentProps<typeof AlertDialogPrimitive.Action> {
28
- size?: VariantProps<typeof buttonVariants>["size"];
29
- variant?: VariantProps<typeof buttonVariants>["variant"];
54
+ size?: VariantProps<typeof buttonVariants>["size"];
55
+ variant?: VariantProps<typeof buttonVariants>["variant"];
30
56
  }
31
- declare function AlertDialogAction({ className, size, variant, ...props }: AlertDialogActionProps): JSX.Element;
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
- size?: VariantProps<typeof buttonVariants>["size"];
34
- variant?: VariantProps<typeof buttonVariants>["variant"];
64
+ size?: VariantProps<typeof buttonVariants>["size"];
65
+ variant?: VariantProps<typeof buttonVariants>["variant"];
35
66
  }
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, };
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
- return /*#__PURE__*/ jsx(Root, {
8
- "data-slot": "alert-dialog",
9
- ...props
10
- });
8
+ return /* @__PURE__ */ jsx(AlertDialogPrimitive.Root, {
9
+ "data-slot": "alert-dialog",
10
+ ...props
11
+ });
11
12
  }
12
13
  function AlertDialogTrigger({ ...props }) {
13
- return /*#__PURE__*/ jsx(Trigger, {
14
- "data-slot": "alert-dialog-trigger",
15
- ...props
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
- return /*#__PURE__*/ jsxs(Portal, {
20
- children: [
21
- /*#__PURE__*/ jsx(Overlay, {
22
- 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),
23
- "data-slot": "alert-dialog-overlay"
24
- }),
25
- /*#__PURE__*/ jsx(Content, {
26
- 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),
27
- "data-slot": "alert-dialog-content-wrapper",
28
- ...props,
29
- children: /*#__PURE__*/ jsx("div", {
30
- 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),
31
- "data-slot": "alert-dialog-content",
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
- return /*#__PURE__*/ jsx("div", {
40
- className: cn("flex shrink-0 flex-col gap-1.5 px-6 pt-6 pb-4 text-center sm:text-left", className),
41
- "data-slot": "alert-dialog-header",
42
- ...props
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
- return /*#__PURE__*/ jsx("main", {
47
- className: cn("overflow-auto px-6 py-2", className),
48
- "data-slot": "alert-dialog-body",
49
- ...props
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
- return /*#__PURE__*/ jsx("div", {
54
- className: cn("flex shrink-0 flex-col-reverse gap-2 px-6 pt-4 pb-6 sm:flex-row sm:justify-end", className),
55
- "data-slot": "alert-dialog-footer",
56
- ...props
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
- return /*#__PURE__*/ jsx(Title, {
61
- className: cn("text-lg leading-none font-semibold tracking-tight", className),
62
- "data-slot": "alert-dialog-title",
63
- ...props
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
- return /*#__PURE__*/ jsx(Description, {
68
- className: cn("text-sm text-muted-foreground", className),
69
- "data-slot": "alert-dialog-description",
70
- ...props
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
- return /*#__PURE__*/ jsx(Action, {
75
- className: buttonVariants({
76
- className,
77
- size,
78
- variant
79
- }),
80
- "data-slot": "alert-dialog-action",
81
- ...props
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
- return /*#__PURE__*/ jsx(Cancel, {
86
- className: buttonVariants({
87
- className,
88
- size,
89
- variant
90
- }),
91
- "data-slot": "alert-dialog-cancel",
92
- ...props
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 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
- };
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
- declare function Alert({ className, variant, ...props }: AlertProps): JSX.Element;
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({ children, className, ...props }: AlertTitleProps): JSX.Element;
19
+ declare function AlertTitle({
20
+ children,
21
+ className,
22
+ ...props
23
+ }: AlertTitleProps): JSX.Element;
14
24
  type AlertDescriptionProps = ComponentProps<"div">;
15
- declare function AlertDescription({ className, ...props }: AlertDescriptionProps): JSX.Element;
16
- export { alertVariants };
17
- export { Alert, AlertDescription, AlertTitle };
18
- export type { AlertDescriptionProps, AlertProps, AlertTitleProps };
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 };