@codefast/ui 0.3.11-canary.0 → 0.3.11-canary.2
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 +22 -0
- 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 +81 -156
- package/dist/components/accordion.cjs +0 -98
- package/dist/components/alert-dialog.cjs +0 -156
- package/dist/components/alert.cjs +0 -84
- package/dist/components/aspect-ratio.cjs +0 -44
- package/dist/components/avatar.cjs +0 -66
- package/dist/components/badge.cjs +0 -67
- package/dist/components/breadcrumb.cjs +0 -125
- package/dist/components/button-group.cjs +0 -87
- package/dist/components/button.cjs +0 -92
- package/dist/components/calendar.cjs +0 -151
- package/dist/components/card.cjs +0 -105
- package/dist/components/carousel.cjs +0 -211
- package/dist/components/chart.cjs +0 -251
- package/dist/components/checkbox-cards.cjs +0 -70
- package/dist/components/checkbox-group.cjs +0 -64
- package/dist/components/checkbox.cjs +0 -54
- package/dist/components/collapsible.cjs +0 -62
- package/dist/components/command.cjs +0 -168
- package/dist/components/context-menu.cjs +0 -219
- package/dist/components/dialog.cjs +0 -165
- package/dist/components/drawer.cjs +0 -144
- package/dist/components/dropdown-menu.cjs +0 -222
- package/dist/components/empty.cjs +0 -113
- package/dist/components/field.cjs +0 -194
- package/dist/components/form.cjs +0 -152
- package/dist/components/hover-card.cjs +0 -78
- package/dist/components/input-group.cjs +0 -156
- package/dist/components/input-number.cjs +0 -99
- package/dist/components/input-otp.cjs +0 -102
- package/dist/components/input-password.cjs +0 -72
- package/dist/components/input-search.cjs +0 -81
- package/dist/components/input.cjs +0 -46
- package/dist/components/item.cjs +0 -186
- package/dist/components/kbd.cjs +0 -54
- package/dist/components/label.cjs +0 -46
- package/dist/components/menubar.cjs +0 -233
- package/dist/components/native-select.cjs +0 -75
- package/dist/components/navigation-menu.cjs +0 -146
- package/dist/components/pagination.cjs +0 -138
- package/dist/components/popover.cjs +0 -87
- package/dist/components/progress-circle.cjs +0 -185
- package/dist/components/progress.cjs +0 -53
- package/dist/components/radio-cards.cjs +0 -67
- package/dist/components/radio-group.cjs +0 -60
- package/dist/components/radio.cjs +0 -48
- package/dist/components/resizable.cjs +0 -72
- package/dist/components/scroll-area.cjs +0 -141
- package/dist/components/select.cjs +0 -181
- package/dist/components/separator.cjs +0 -83
- package/dist/components/sheet.cjs +0 -185
- package/dist/components/sidebar.cjs +0 -507
- package/dist/components/skeleton.cjs +0 -44
- package/dist/components/slider.cjs +0 -80
- package/dist/components/sonner.cjs +0 -58
- package/dist/components/spinner.cjs +0 -76
- package/dist/components/switch.cjs +0 -50
- package/dist/components/table.cjs +0 -118
- package/dist/components/tabs.cjs +0 -76
- package/dist/components/textarea.cjs +0 -44
- package/dist/components/toggle-group.cjs +0 -91
- package/dist/components/toggle.cjs +0 -72
- package/dist/components/tooltip.cjs +0 -91
- package/dist/hooks/use-animated-value.cjs +0 -75
- package/dist/hooks/use-copy-to-clipboard.cjs +0 -58
- package/dist/hooks/use-is-mobile.cjs +0 -40
- package/dist/hooks/use-media-query.cjs +0 -57
- package/dist/hooks/use-mutation-observer.cjs +0 -57
- package/dist/hooks/use-pagination.cjs +0 -93
- package/dist/index.cjs +0 -1081
- package/dist/primitives/checkbox-group.cjs +0 -151
- package/dist/primitives/input-number.cjs +0 -439
- package/dist/primitives/input.cjs +0 -99
- package/dist/primitives/progress-circle.cjs +0 -199
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @codefast/ui
|
|
2
2
|
|
|
3
|
+
## 0.3.11-canary.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`92d1ed7`](https://github.com/codefastlabs/codefast/commit/92d1ed7650b19f91824cfb38ec238857a3d95876) Thanks [@thevuong](https://github.com/thevuong)! - build: replace rslib with tsdown in library packages
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`92d1ed7`](https://github.com/codefastlabs/codefast/commit/92d1ed7650b19f91824cfb38ec238857a3d95876)]:
|
|
10
|
+
- @codefast/tailwind-variants@0.3.11-canary.2
|
|
11
|
+
|
|
12
|
+
## 0.3.11-canary.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [`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
|
|
17
|
+
|
|
18
|
+
- [`42758ab`](https://github.com/codefastlabs/codefast/commit/42758ab9d8f548ea9f4a806a7dbb7ed295fe2390) Thanks [@thevuong](https://github.com/thevuong)! - chore: update package configurations and TypeScript settings
|
|
19
|
+
|
|
20
|
+
- [`d2abc63`](https://github.com/codefastlabs/codefast/commit/d2abc636245526ec402811d8585d93684865dde6) Thanks [@thevuong](https://github.com/thevuong)! - chore(deps): update package versions and configurations
|
|
21
|
+
|
|
22
|
+
- Updated dependencies [[`dd5130a`](https://github.com/codefastlabs/codefast/commit/dd5130adb5649dca6773614ffda262cdde732d8f), [`42758ab`](https://github.com/codefastlabs/codefast/commit/42758ab9d8f548ea9f4a806a7dbb7ed295fe2390), [`d2abc63`](https://github.com/codefastlabs/codefast/commit/d2abc636245526ec402811d8585d93684865dde6), [`49df885`](https://github.com/codefastlabs/codefast/commit/49df8854d51bad598381be68b6e41096e7da814c)]:
|
|
23
|
+
- @codefast/tailwind-variants@0.3.11-canary.1
|
|
24
|
+
|
|
3
25
|
## 0.3.11-canary.0
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
|
@@ -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 };
|
package/dist/components/alert.js
CHANGED
|
@@ -1,41 +1,39 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
1
|
import { cn, tv } from "@codefast/tailwind-variants";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/alert.tsx
|
|
3
4
|
const alertVariants = tv({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
default: "text-card-foreground",
|
|
11
|
-
destructive: "text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current"
|
|
12
|
-
}
|
|
13
|
-
}
|
|
5
|
+
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",
|
|
6
|
+
defaultVariants: { variant: "default" },
|
|
7
|
+
variants: { variant: {
|
|
8
|
+
default: "text-card-foreground",
|
|
9
|
+
destructive: "text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current"
|
|
10
|
+
} }
|
|
14
11
|
});
|
|
15
12
|
function Alert({ className, variant, ...props }) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
13
|
+
return /* @__PURE__ */ jsx("div", {
|
|
14
|
+
className: alertVariants({
|
|
15
|
+
className,
|
|
16
|
+
variant
|
|
17
|
+
}),
|
|
18
|
+
"data-slot": "alert",
|
|
19
|
+
role: "alert",
|
|
20
|
+
...props
|
|
21
|
+
});
|
|
25
22
|
}
|
|
26
23
|
function AlertTitle({ children, className, ...props }) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
24
|
+
return /* @__PURE__ */ jsx("div", {
|
|
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
|
+
});
|
|
33
30
|
}
|
|
34
31
|
function AlertDescription({ className, ...props }) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
return /* @__PURE__ */ jsx("div", {
|
|
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
|
+
});
|
|
40
37
|
}
|
|
38
|
+
//#endregion
|
|
41
39
|
export { Alert, AlertDescription, AlertTitle, alertVariants };
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from "react";
|
|
2
1
|
import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio";
|
|
2
|
+
import { ComponentProps, JSX } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/aspect-ratio.d.ts
|
|
3
5
|
type AspectRatioProps = ComponentProps<typeof AspectRatioPrimitive.Root>;
|
|
4
|
-
declare function AspectRatio({
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
declare function AspectRatio({
|
|
7
|
+
...props
|
|
8
|
+
}: AspectRatioProps): JSX.Element;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { AspectRatio, type AspectRatioProps };
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
3
|
+
import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio";
|
|
4
|
+
//#region src/components/aspect-ratio.tsx
|
|
4
5
|
function AspectRatio({ ...props }) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
return /* @__PURE__ */ jsx(AspectRatioPrimitive.Root, {
|
|
7
|
+
"data-slot": "aspect-ratio",
|
|
8
|
+
...props
|
|
9
|
+
});
|
|
9
10
|
}
|
|
11
|
+
//#endregion
|
|
10
12
|
export { AspectRatio };
|
|
@@ -1,10 +1,21 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from "react";
|
|
2
1
|
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
2
|
+
import { ComponentProps, JSX } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/avatar.d.ts
|
|
3
5
|
type AvatarProps = ComponentProps<typeof AvatarPrimitive.Root>;
|
|
4
|
-
declare function Avatar({
|
|
6
|
+
declare function Avatar({
|
|
7
|
+
className,
|
|
8
|
+
...props
|
|
9
|
+
}: AvatarProps): JSX.Element;
|
|
5
10
|
type AvatarImageProps = ComponentProps<typeof AvatarPrimitive.Image>;
|
|
6
|
-
declare function AvatarImage({
|
|
11
|
+
declare function AvatarImage({
|
|
12
|
+
className,
|
|
13
|
+
...props
|
|
14
|
+
}: AvatarImageProps): JSX.Element;
|
|
7
15
|
type AvatarFallbackProps = ComponentProps<typeof AvatarPrimitive.Fallback>;
|
|
8
|
-
declare function AvatarFallback({
|
|
9
|
-
|
|
10
|
-
|
|
16
|
+
declare function AvatarFallback({
|
|
17
|
+
className,
|
|
18
|
+
...props
|
|
19
|
+
}: AvatarFallbackProps): JSX.Element;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { Avatar, AvatarFallback, type AvatarFallbackProps, AvatarImage, type AvatarImageProps, type AvatarProps };
|