@codefast/ui 0.3.16-canary.2 → 0.4.0-canary.4
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 +81 -0
- package/README.md +28 -17
- package/dist/components/accordion.d.mts +7 -22
- package/dist/components/accordion.mjs +26 -29
- package/dist/components/alert-dialog.d.mts +27 -26
- package/dist/components/alert-dialog.mjs +53 -45
- package/dist/components/alert.d.mts +14 -14
- package/dist/components/alert.mjs +17 -28
- package/dist/components/aspect-ratio.d.mts +2 -2
- package/dist/components/aspect-ratio.mjs +2 -3
- package/dist/components/avatar.d.mts +41 -5
- package/dist/components/avatar.mjs +40 -10
- package/dist/components/badge.d.mts +3 -15
- package/dist/components/badge.mjs +6 -48
- package/dist/components/breadcrumb.d.mts +1 -0
- package/dist/components/breadcrumb.mjs +11 -10
- package/dist/components/button-group.d.mts +3 -13
- package/dist/components/button-group.mjs +9 -31
- package/dist/components/button.d.mts +3 -26
- package/dist/components/button.mjs +9 -79
- package/dist/components/calendar.d.mts +6 -2
- package/dist/components/calendar.mjs +41 -44
- package/dist/components/card.d.mts +4 -2
- package/dist/components/card.mjs +9 -9
- package/dist/components/carousel.d.mts +16 -5
- package/dist/components/carousel.mjs +24 -11
- package/dist/components/chart.d.mts +9 -6
- package/dist/components/chart.mjs +21 -15
- package/dist/components/checkbox-cards.mjs +4 -4
- package/dist/components/checkbox-group.mjs +3 -4
- package/dist/components/checkbox.d.mts +2 -2
- package/dist/components/checkbox.mjs +6 -7
- package/dist/components/collapsible.d.mts +4 -4
- package/dist/components/collapsible.mjs +4 -5
- package/dist/components/command.d.mts +11 -1
- package/dist/components/command.mjs +35 -32
- package/dist/components/context-menu.d.mts +22 -15
- package/dist/components/context-menu.mjs +44 -39
- package/dist/components/dialog.d.mts +19 -23
- package/dist/components/dialog.mjs +48 -47
- package/dist/components/direction.d.mts +24 -0
- package/dist/components/direction.mjs +18 -0
- package/dist/components/drawer.d.mts +3 -21
- package/dist/components/drawer.mjs +19 -27
- package/dist/components/dropdown-menu.d.mts +22 -15
- package/dist/components/dropdown-menu.mjs +41 -37
- package/dist/components/empty.d.mts +3 -13
- package/dist/components/empty.mjs +8 -23
- package/dist/components/field.d.mts +3 -14
- package/dist/components/field.mjs +14 -44
- package/dist/components/form.d.mts +7 -10
- package/dist/components/form.mjs +6 -7
- package/dist/components/hover-card.d.mts +5 -5
- package/dist/components/hover-card.mjs +14 -12
- package/dist/components/input-group.d.mts +4 -31
- package/dist/components/input-group.mjs +14 -96
- package/dist/components/input-number.d.mts +3 -1
- package/dist/components/input-number.mjs +50 -28
- package/dist/components/input-otp.mjs +9 -7
- package/dist/components/input-password.mjs +1 -4
- package/dist/components/input-search.mjs +3 -5
- package/dist/components/input.mjs +1 -2
- package/dist/components/item.d.mts +4 -29
- package/dist/components/item.mjs +12 -65
- package/dist/components/kbd.mjs +1 -1
- package/dist/components/label.d.mts +2 -2
- package/dist/components/label.mjs +3 -4
- package/dist/components/menubar.d.mts +22 -16
- package/dist/components/menubar.mjs +54 -47
- package/dist/components/native-select.d.mts +5 -1
- package/dist/components/native-select.mjs +9 -6
- package/dist/components/navigation-menu.d.mts +30 -13
- package/dist/components/navigation-menu.mjs +35 -32
- package/dist/components/pagination.d.mts +7 -1
- package/dist/components/pagination.mjs +27 -12
- package/dist/components/popover.d.mts +40 -7
- package/dist/components/popover.mjs +46 -14
- package/dist/components/progress-circle.d.mts +3 -47
- package/dist/components/progress-circle.mjs +2 -48
- package/dist/components/progress.d.mts +2 -2
- package/dist/components/progress.mjs +5 -6
- package/dist/components/radio-cards.d.mts +3 -3
- package/dist/components/radio-cards.mjs +11 -11
- package/dist/components/radio-group.d.mts +3 -3
- package/dist/components/radio-group.mjs +9 -9
- package/dist/components/radio.mjs +2 -3
- package/dist/components/resizable.mjs +3 -8
- package/dist/components/scroll-area.d.mts +8 -24
- package/dist/components/scroll-area.mjs +16 -70
- package/dist/components/select.d.mts +14 -14
- package/dist/components/select.mjs +47 -47
- package/dist/components/separator.d.mts +4 -19
- package/dist/components/separator.mjs +6 -27
- package/dist/components/sheet.d.mts +18 -31
- package/dist/components/sheet.mjs +46 -87
- package/dist/components/sidebar.d.mts +3 -19
- package/dist/components/sidebar.mjs +48 -84
- package/dist/components/skeleton.mjs +1 -1
- package/dist/components/slider.d.mts +2 -2
- package/dist/components/slider.mjs +9 -11
- package/dist/components/sonner.mjs +11 -3
- package/dist/components/spinner.mjs +6 -7
- package/dist/components/switch.d.mts +5 -2
- package/dist/components/switch.mjs +7 -7
- package/dist/components/table.mjs +10 -10
- package/dist/components/tabs.d.mts +8 -5
- package/dist/components/tabs.mjs +18 -12
- package/dist/components/textarea.mjs +1 -1
- package/dist/components/toggle-group.d.mts +11 -7
- package/dist/components/toggle-group.mjs +20 -21
- package/dist/components/toggle.d.mts +4 -24
- package/dist/components/toggle.mjs +6 -45
- package/dist/components/tooltip.d.mts +7 -6
- package/dist/components/tooltip.mjs +19 -17
- package/dist/hooks/use-animated-value.mjs +0 -1
- package/dist/hooks/use-copy-to-clipboard.mjs +0 -1
- package/dist/hooks/use-is-mobile.mjs +0 -1
- package/dist/hooks/use-media-query.mjs +0 -1
- package/dist/hooks/use-mutation-observer.mjs +0 -1
- package/dist/hooks/use-pagination.mjs +0 -1
- package/dist/index.d.mts +38 -21
- package/dist/index.mjs +40 -23
- package/dist/lib/utils.d.mts +1 -12
- package/dist/lib/utils.mjs +1 -9
- package/dist/primitives/checkbox-group.d.mts +9 -11
- package/dist/primitives/checkbox-group.mjs +14 -19
- package/dist/primitives/input-number.d.mts +3 -4
- package/dist/primitives/input-number.mjs +3 -5
- package/dist/primitives/input.d.mts +4 -5
- package/dist/primitives/input.mjs +2 -3
- package/dist/primitives/progress-circle.d.mts +3 -4
- package/dist/primitives/progress-circle.mjs +2 -3
- package/dist/variants/alert.d.mts +18 -0
- package/dist/variants/alert.mjs +15 -0
- package/dist/variants/badge.d.mts +22 -0
- package/dist/variants/badge.mjs +19 -0
- package/dist/variants/button-group.d.mts +18 -0
- package/dist/variants/button-group.mjs +15 -0
- package/dist/variants/button.d.mts +32 -0
- package/dist/variants/button.mjs +34 -0
- package/dist/variants/empty.d.mts +18 -0
- package/dist/variants/empty.mjs +15 -0
- package/dist/variants/field.d.mts +19 -0
- package/dist/variants/field.mjs +16 -0
- package/dist/variants/input-group.d.mts +43 -0
- package/dist/variants/input-group.mjs +34 -0
- package/dist/variants/input-number.d.mts +45 -0
- package/dist/variants/input-number.mjs +40 -0
- package/dist/variants/item.d.mts +38 -0
- package/dist/variants/item.mjs +38 -0
- package/dist/variants/navigation-menu.d.mts +13 -0
- package/dist/variants/navigation-menu.mjs +8 -0
- package/dist/variants/progress-circle.d.mts +52 -0
- package/dist/variants/progress-circle.mjs +45 -0
- package/dist/variants/scroll-area.d.mts +24 -0
- package/dist/variants/scroll-area.mjs +58 -0
- package/dist/variants/separator.d.mts +23 -0
- package/dist/variants/separator.mjs +25 -0
- package/dist/variants/sheet.d.mts +20 -0
- package/dist/variants/sheet.mjs +17 -0
- package/dist/variants/sidebar.d.mts +23 -0
- package/dist/variants/sidebar.mjs +25 -0
- package/dist/variants/tabs.d.mts +18 -0
- package/dist/variants/tabs.mjs +15 -0
- package/dist/variants/toggle.d.mts +23 -0
- package/dist/variants/toggle.mjs +25 -0
- package/package.json +186 -55
- package/src/components/accordion.tsx +114 -0
- package/src/components/alert-dialog.tsx +298 -0
- package/src/components/alert.tsx +94 -0
- package/src/components/aspect-ratio.tsx +25 -0
- package/src/components/avatar.tsx +171 -0
- package/src/components/badge.tsx +35 -0
- package/src/components/breadcrumb.tsx +191 -0
- package/src/components/button-group.tsx +97 -0
- package/src/components/button.tsx +55 -0
- package/src/components/calendar.tsx +222 -0
- package/src/components/card.tsx +169 -0
- package/src/components/carousel.tsx +349 -0
- package/src/components/chart.tsx +536 -0
- package/src/components/checkbox-cards.tsx +72 -0
- package/src/components/checkbox-group.tsx +60 -0
- package/src/components/checkbox.tsx +44 -0
- package/src/components/collapsible.tsx +57 -0
- package/src/components/command.tsx +298 -0
- package/src/components/context-menu.tsx +410 -0
- package/src/components/dialog.tsx +243 -0
- package/src/components/direction.tsx +32 -0
- package/src/components/drawer.tsx +209 -0
- package/src/components/dropdown-menu.tsx +419 -0
- package/src/components/empty.tsx +155 -0
- package/src/components/field.tsx +329 -0
- package/src/components/form.tsx +258 -0
- package/src/components/hover-card.tsx +93 -0
- package/src/components/input-group.tsx +185 -0
- package/src/components/input-number.tsx +141 -0
- package/src/components/input-otp.tsx +132 -0
- package/src/components/input-password.tsx +50 -0
- package/src/components/input-search.tsx +81 -0
- package/src/components/input.tsx +36 -0
- package/src/components/item.tsx +266 -0
- package/src/components/kbd.tsx +47 -0
- package/src/components/label.tsx +36 -0
- package/src/components/menubar.tsx +440 -0
- package/src/components/native-select.tsx +87 -0
- package/src/components/navigation-menu.tsx +235 -0
- package/src/components/pagination.tsx +198 -0
- package/src/components/popover.tsx +170 -0
- package/src/components/progress-circle.tsx +185 -0
- package/src/components/progress.tsx +41 -0
- package/src/components/radio-cards.tsx +66 -0
- package/src/components/radio-group.tsx +59 -0
- package/src/components/radio.tsx +40 -0
- package/src/components/resizable.tsx +78 -0
- package/src/components/scroll-area.tsx +95 -0
- package/src/components/select.tsx +296 -0
- package/src/components/separator.tsx +60 -0
- package/src/components/sheet.tsx +241 -0
- package/src/components/sidebar.tsx +926 -0
- package/src/components/skeleton.tsx +35 -0
- package/src/components/slider.tsx +66 -0
- package/src/components/sonner.tsx +57 -0
- package/src/components/spinner.tsx +66 -0
- package/src/components/switch.tsx +44 -0
- package/src/components/table.tsx +183 -0
- package/src/components/tabs.tsx +110 -0
- package/src/components/textarea.tsx +35 -0
- package/src/components/toggle-group.tsx +137 -0
- package/src/components/toggle.tsx +30 -0
- package/src/components/tooltip.tsx +115 -0
- package/src/css/foundation/base.css +50 -0
- package/src/css/foundation/motion.css +36 -0
- package/src/css/foundation/source.css +3 -0
- package/src/css/foundation/tokens.css +71 -0
- package/src/css/foundation/variants.css +113 -0
- package/src/css/preset.css +5 -195
- package/src/css/style.css +1 -1
- package/src/css/{amber.css → themes/amber.css} +59 -22
- package/src/css/{blue.css → themes/blue.css} +59 -22
- package/src/css/{cyan.css → themes/cyan.css} +59 -22
- package/src/css/{emerald.css → themes/emerald.css} +59 -22
- package/src/css/{fuchsia.css → themes/fuchsia.css} +59 -22
- package/src/css/{gray.css → themes/gray.css} +59 -22
- package/src/css/{green.css → themes/green.css} +59 -22
- package/src/css/{indigo.css → themes/indigo.css} +59 -22
- package/src/css/{lime.css → themes/lime.css} +59 -22
- package/src/css/{neutral.css → themes/neutral.css} +59 -22
- package/src/css/{orange.css → themes/orange.css} +59 -22
- package/src/css/{pink.css → themes/pink.css} +59 -22
- package/src/css/{purple.css → themes/purple.css} +59 -22
- package/src/css/{red.css → themes/red.css} +59 -22
- package/src/css/{rose.css → themes/rose.css} +59 -22
- package/src/css/{sky.css → themes/sky.css} +59 -22
- package/src/css/{slate.css → themes/slate.css} +59 -22
- package/src/css/{stone.css → themes/stone.css} +59 -22
- package/src/css/{teal.css → themes/teal.css} +59 -22
- package/src/css/{violet.css → themes/violet.css} +59 -22
- package/src/css/{yellow.css → themes/yellow.css} +59 -22
- package/src/css/{zinc.css → themes/zinc.css} +59 -22
- package/src/hooks/use-animated-value.ts +91 -0
- package/src/hooks/use-copy-to-clipboard.ts +58 -0
- package/src/hooks/use-is-mobile.ts +25 -0
- package/src/hooks/use-media-query.ts +69 -0
- package/src/hooks/use-mutation-observer.ts +51 -0
- package/src/hooks/use-pagination.ts +164 -0
- package/src/index.ts +679 -0
- package/src/lib/utils.ts +5 -0
- package/src/primitives/checkbox-group.tsx +346 -0
- package/src/primitives/input-number.tsx +967 -0
- package/src/primitives/input.tsx +227 -0
- package/src/primitives/progress-circle.tsx +507 -0
- package/src/variants/alert.ts +34 -0
- package/src/variants/badge.ts +39 -0
- package/src/variants/button-group.ts +36 -0
- package/src/variants/button.ts +56 -0
- package/src/variants/empty.ts +34 -0
- package/src/variants/field.ts +37 -0
- package/src/variants/input-group.ts +80 -0
- package/src/variants/input-number.ts +65 -0
- package/src/variants/item.ts +68 -0
- package/src/variants/navigation-menu.ts +25 -0
- package/src/variants/progress-circle.ts +46 -0
- package/src/variants/scroll-area.ts +73 -0
- package/src/variants/separator.ts +40 -0
- package/src/variants/sheet.ts +37 -0
- package/src/variants/sidebar.ts +41 -0
- package/src/variants/tabs.ts +34 -0
- package/src/variants/toggle.ts +40 -0
- package/dist/node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/clsx.d.mts +0 -6
|
@@ -1,33 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { ScrollAreaScrollbarVariants } from "../variants/scroll-area.mjs";
|
|
2
|
+
import { ScrollArea as ScrollArea$1 } from "radix-ui";
|
|
3
3
|
import { ComponentProps, JSX } from "react";
|
|
4
|
-
import {
|
|
5
|
-
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
4
|
+
import { Context } from "radix-ui/internal";
|
|
6
5
|
|
|
7
6
|
//#region src/components/scroll-area.d.ts
|
|
8
|
-
/**
|
|
9
|
-
* @since 0.3.16-canary.0
|
|
10
|
-
*/
|
|
11
|
-
declare const scrollAreaScrollbarVariants: _$_codefast_tailwind_variants0.VariantResolver<{
|
|
12
|
-
orientation: {
|
|
13
|
-
horizontal: string[];
|
|
14
|
-
vertical: string[];
|
|
15
|
-
};
|
|
16
|
-
size: {
|
|
17
|
-
none: string;
|
|
18
|
-
sm: string;
|
|
19
|
-
md: string;
|
|
20
|
-
lg: string;
|
|
21
|
-
};
|
|
22
|
-
}, Record<string, never>>;
|
|
23
7
|
type ScopedProps<P> = P & {
|
|
24
|
-
__scopeScrollArea?: Scope;
|
|
8
|
+
__scopeScrollArea?: Context.Scope;
|
|
25
9
|
};
|
|
26
|
-
type ScrollAreaContextValue = Pick<
|
|
10
|
+
type ScrollAreaContextValue = Pick<ScrollAreaScrollbarVariants, "size">;
|
|
27
11
|
/**
|
|
28
12
|
* @since 0.3.16-canary.0
|
|
29
13
|
*/
|
|
30
|
-
type ScrollAreaProps = ScopedProps<ComponentProps<typeof
|
|
14
|
+
type ScrollAreaProps = ScopedProps<ComponentProps<typeof ScrollArea$1.Root> & ScrollAreaContextValue>;
|
|
31
15
|
/**
|
|
32
16
|
* @since 0.3.16-canary.0
|
|
33
17
|
*/
|
|
@@ -41,7 +25,7 @@ declare function ScrollArea({
|
|
|
41
25
|
/**
|
|
42
26
|
* @since 0.3.16-canary.0
|
|
43
27
|
*/
|
|
44
|
-
type ScrollAreaScrollbarProps = ScopedProps<ComponentProps<typeof
|
|
28
|
+
type ScrollAreaScrollbarProps = ScopedProps<ComponentProps<typeof ScrollArea$1.Scrollbar>>;
|
|
45
29
|
/**
|
|
46
30
|
* @since 0.3.16-canary.0
|
|
47
31
|
*/
|
|
@@ -52,4 +36,4 @@ declare function ScrollAreaScrollbar({
|
|
|
52
36
|
...props
|
|
53
37
|
}: ScrollAreaScrollbarProps): JSX.Element;
|
|
54
38
|
//#endregion
|
|
55
|
-
export { ScrollArea, type ScrollAreaProps, ScrollAreaScrollbar, type ScrollAreaScrollbarProps
|
|
39
|
+
export { ScrollArea, type ScrollAreaProps, ScrollAreaScrollbar, type ScrollAreaScrollbarProps };
|
|
@@ -1,69 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
1
|
+
import { cn } from "../lib/utils.mjs";
|
|
2
|
+
import { scrollAreaScrollbarVariants } from "../variants/scroll-area.mjs";
|
|
3
|
+
import { ScrollArea as ScrollArea$1 } from "radix-ui";
|
|
3
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
import {
|
|
5
|
-
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
5
|
+
import { Context } from "radix-ui/internal";
|
|
6
6
|
//#region src/components/scroll-area.tsx
|
|
7
|
-
/**
|
|
8
|
-
* @since 0.3.16-canary.0
|
|
9
|
-
*/
|
|
10
|
-
const scrollAreaScrollbarVariants = tv({
|
|
11
|
-
base: [
|
|
12
|
-
"flex",
|
|
13
|
-
"p-px",
|
|
14
|
-
"touch-none transition-colors select-none"
|
|
15
|
-
],
|
|
16
|
-
compoundVariants: [
|
|
17
|
-
{
|
|
18
|
-
className: "w-1.5",
|
|
19
|
-
orientation: "vertical",
|
|
20
|
-
size: "sm"
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
className: "w-2",
|
|
24
|
-
orientation: "vertical",
|
|
25
|
-
size: "md"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
className: "w-2.5",
|
|
29
|
-
orientation: "vertical",
|
|
30
|
-
size: "lg"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
className: "h-1.5",
|
|
34
|
-
orientation: "horizontal",
|
|
35
|
-
size: "sm"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
className: "h-2",
|
|
39
|
-
orientation: "horizontal",
|
|
40
|
-
size: "md"
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
className: "h-2.5",
|
|
44
|
-
orientation: "horizontal",
|
|
45
|
-
size: "lg"
|
|
46
|
-
}
|
|
47
|
-
],
|
|
48
|
-
defaultVariants: {
|
|
49
|
-
orientation: "vertical",
|
|
50
|
-
size: "md"
|
|
51
|
-
},
|
|
52
|
-
variants: {
|
|
53
|
-
orientation: {
|
|
54
|
-
horizontal: ["w-full flex-col", "border-t border-t-transparent"],
|
|
55
|
-
vertical: ["h-full flex-row", "border-l border-l-transparent"]
|
|
56
|
-
},
|
|
57
|
-
size: {
|
|
58
|
-
none: "",
|
|
59
|
-
sm: "",
|
|
60
|
-
md: "",
|
|
61
|
-
lg: ""
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
7
|
const SCROLL_AREA_NAME = "ScrollArea";
|
|
66
|
-
const [createScrollAreaContext] = createContextScope(SCROLL_AREA_NAME);
|
|
8
|
+
const [createScrollAreaContext] = Context.createContextScope(SCROLL_AREA_NAME);
|
|
67
9
|
const [ScrollAreaContextProvider, useScrollAreaContext] = createScrollAreaContext(SCROLL_AREA_NAME);
|
|
68
10
|
/**
|
|
69
11
|
* @since 0.3.16-canary.0
|
|
@@ -72,19 +14,19 @@ function ScrollArea({ __scopeScrollArea, children, className, size, ...props })
|
|
|
72
14
|
return /* @__PURE__ */ jsx(ScrollAreaContextProvider, {
|
|
73
15
|
scope: __scopeScrollArea,
|
|
74
16
|
size,
|
|
75
|
-
children: /* @__PURE__ */ jsxs(
|
|
17
|
+
children: /* @__PURE__ */ jsxs(ScrollArea$1.Root, {
|
|
76
18
|
className: cn("relative", className),
|
|
77
19
|
"data-slot": "scroll-area",
|
|
78
20
|
...props,
|
|
79
21
|
children: [
|
|
80
|
-
/* @__PURE__ */ jsx(
|
|
81
|
-
className:
|
|
22
|
+
/* @__PURE__ */ jsx(ScrollArea$1.Viewport, {
|
|
23
|
+
className: "size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-1",
|
|
82
24
|
"data-slot": "scroll-area-viewport",
|
|
83
25
|
children
|
|
84
26
|
}),
|
|
85
27
|
/* @__PURE__ */ jsx(ScrollAreaScrollbar, { orientation: "vertical" }),
|
|
86
28
|
/* @__PURE__ */ jsx(ScrollAreaScrollbar, { orientation: "horizontal" }),
|
|
87
|
-
/* @__PURE__ */ jsx(
|
|
29
|
+
/* @__PURE__ */ jsx(ScrollArea$1.Corner, {})
|
|
88
30
|
]
|
|
89
31
|
})
|
|
90
32
|
});
|
|
@@ -94,17 +36,21 @@ function ScrollArea({ __scopeScrollArea, children, className, size, ...props })
|
|
|
94
36
|
*/
|
|
95
37
|
function ScrollAreaScrollbar({ __scopeScrollArea, className, orientation, ...props }) {
|
|
96
38
|
const { size } = useScrollAreaContext(SCROLL_AREA_NAME, __scopeScrollArea);
|
|
97
|
-
return /* @__PURE__ */ jsx(
|
|
39
|
+
return /* @__PURE__ */ jsx(ScrollArea$1.Scrollbar, {
|
|
98
40
|
className: scrollAreaScrollbarVariants({
|
|
99
41
|
className,
|
|
100
42
|
orientation,
|
|
101
43
|
size
|
|
102
44
|
}),
|
|
45
|
+
"data-orientation": orientation,
|
|
103
46
|
"data-slot": "scroll-area-scrollbar",
|
|
104
47
|
orientation,
|
|
105
48
|
...props,
|
|
106
|
-
children: /* @__PURE__ */ jsx(
|
|
49
|
+
children: /* @__PURE__ */ jsx(ScrollArea$1.ScrollAreaThumb, {
|
|
50
|
+
className: "relative flex-1 rounded-full bg-border",
|
|
51
|
+
"data-slot": "scroll-area-thumb"
|
|
52
|
+
})
|
|
107
53
|
});
|
|
108
54
|
}
|
|
109
55
|
//#endregion
|
|
110
|
-
export { ScrollArea, ScrollAreaScrollbar
|
|
56
|
+
export { ScrollArea, ScrollAreaScrollbar };
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { buttonVariants } from "./button.mjs";
|
|
1
|
+
import { Select as Select$1 } from "radix-ui";
|
|
3
2
|
import { ComponentProps, JSX } from "react";
|
|
4
|
-
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
5
3
|
|
|
6
4
|
//#region src/components/select.d.ts
|
|
7
5
|
/**
|
|
8
6
|
* @since 0.3.16-canary.0
|
|
9
7
|
*/
|
|
10
|
-
type SelectProps = ComponentProps<typeof
|
|
8
|
+
type SelectProps = ComponentProps<typeof Select$1.Root>;
|
|
11
9
|
/**
|
|
12
10
|
* @since 0.3.16-canary.0
|
|
13
11
|
*/
|
|
@@ -17,17 +15,18 @@ declare function Select({
|
|
|
17
15
|
/**
|
|
18
16
|
* @since 0.3.16-canary.0
|
|
19
17
|
*/
|
|
20
|
-
type SelectGroupProps = ComponentProps<typeof
|
|
18
|
+
type SelectGroupProps = ComponentProps<typeof Select$1.Group>;
|
|
21
19
|
/**
|
|
22
20
|
* @since 0.3.16-canary.0
|
|
23
21
|
*/
|
|
24
22
|
declare function SelectGroup({
|
|
23
|
+
className,
|
|
25
24
|
...props
|
|
26
25
|
}: SelectGroupProps): JSX.Element;
|
|
27
26
|
/**
|
|
28
27
|
* @since 0.3.16-canary.0
|
|
29
28
|
*/
|
|
30
|
-
type SelectValueProps = ComponentProps<typeof
|
|
29
|
+
type SelectValueProps = ComponentProps<typeof Select$1.Value>;
|
|
31
30
|
/**
|
|
32
31
|
* @since 0.3.16-canary.0
|
|
33
32
|
*/
|
|
@@ -37,8 +36,8 @@ declare function SelectValue({
|
|
|
37
36
|
/**
|
|
38
37
|
* @since 0.3.16-canary.0
|
|
39
38
|
*/
|
|
40
|
-
interface SelectTriggerProps extends ComponentProps<typeof
|
|
41
|
-
size?:
|
|
39
|
+
interface SelectTriggerProps extends ComponentProps<typeof Select$1.Trigger> {
|
|
40
|
+
size?: "default" | "sm";
|
|
42
41
|
}
|
|
43
42
|
/**
|
|
44
43
|
* @since 0.3.16-canary.0
|
|
@@ -52,7 +51,7 @@ declare function SelectTrigger({
|
|
|
52
51
|
/**
|
|
53
52
|
* @since 0.3.16-canary.0
|
|
54
53
|
*/
|
|
55
|
-
type SelectScrollUpButtonProps = ComponentProps<typeof
|
|
54
|
+
type SelectScrollUpButtonProps = ComponentProps<typeof Select$1.ScrollUpButton>;
|
|
56
55
|
/**
|
|
57
56
|
* @since 0.3.16-canary.0
|
|
58
57
|
*/
|
|
@@ -63,7 +62,7 @@ declare function SelectScrollUpButton({
|
|
|
63
62
|
/**
|
|
64
63
|
* @since 0.3.16-canary.0
|
|
65
64
|
*/
|
|
66
|
-
type SelectScrollDownButtonProps = ComponentProps<typeof
|
|
65
|
+
type SelectScrollDownButtonProps = ComponentProps<typeof Select$1.ScrollDownButton>;
|
|
67
66
|
/**
|
|
68
67
|
* @since 0.3.16-canary.0
|
|
69
68
|
*/
|
|
@@ -74,11 +73,12 @@ declare function SelectScrollDownButton({
|
|
|
74
73
|
/**
|
|
75
74
|
* @since 0.3.16-canary.0
|
|
76
75
|
*/
|
|
77
|
-
type SelectContentProps = ComponentProps<typeof
|
|
76
|
+
type SelectContentProps = ComponentProps<typeof Select$1.Content>;
|
|
78
77
|
/**
|
|
79
78
|
* @since 0.3.16-canary.0
|
|
80
79
|
*/
|
|
81
80
|
declare function SelectContent({
|
|
81
|
+
align,
|
|
82
82
|
children,
|
|
83
83
|
className,
|
|
84
84
|
position,
|
|
@@ -87,7 +87,7 @@ declare function SelectContent({
|
|
|
87
87
|
/**
|
|
88
88
|
* @since 0.3.16-canary.0
|
|
89
89
|
*/
|
|
90
|
-
type SelectLabelProps = ComponentProps<typeof
|
|
90
|
+
type SelectLabelProps = ComponentProps<typeof Select$1.Label>;
|
|
91
91
|
/**
|
|
92
92
|
* @since 0.3.16-canary.0
|
|
93
93
|
*/
|
|
@@ -98,7 +98,7 @@ declare function SelectLabel({
|
|
|
98
98
|
/**
|
|
99
99
|
* @since 0.3.16-canary.0
|
|
100
100
|
*/
|
|
101
|
-
type SelectItemProps = ComponentProps<typeof
|
|
101
|
+
type SelectItemProps = ComponentProps<typeof Select$1.Item>;
|
|
102
102
|
/**
|
|
103
103
|
* @since 0.3.16-canary.0
|
|
104
104
|
*/
|
|
@@ -110,7 +110,7 @@ declare function SelectItem({
|
|
|
110
110
|
/**
|
|
111
111
|
* @since 0.3.16-canary.0
|
|
112
112
|
*/
|
|
113
|
-
type SelectSeparatorProps = ComponentProps<typeof
|
|
113
|
+
type SelectSeparatorProps = ComponentProps<typeof Select$1.Separator>;
|
|
114
114
|
/**
|
|
115
115
|
* @since 0.3.16-canary.0
|
|
116
116
|
*/
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { cn } from "../lib/utils.mjs";
|
|
3
|
-
import { buttonVariants } from "./button.mjs";
|
|
4
2
|
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
|
|
3
|
+
import { Select as Select$1 } from "radix-ui";
|
|
5
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
7
5
|
//#region src/components/select.tsx
|
|
8
6
|
/**
|
|
9
7
|
* @since 0.3.16-canary.0
|
|
10
8
|
*/
|
|
11
9
|
function Select({ ...props }) {
|
|
12
|
-
return /* @__PURE__ */ jsx(
|
|
10
|
+
return /* @__PURE__ */ jsx(Select$1.Root, {
|
|
13
11
|
"data-slot": "select",
|
|
14
12
|
...props
|
|
15
13
|
});
|
|
@@ -17,8 +15,9 @@ function Select({ ...props }) {
|
|
|
17
15
|
/**
|
|
18
16
|
* @since 0.3.16-canary.0
|
|
19
17
|
*/
|
|
20
|
-
function SelectGroup({ ...props }) {
|
|
21
|
-
return /* @__PURE__ */ jsx(
|
|
18
|
+
function SelectGroup({ className, ...props }) {
|
|
19
|
+
return /* @__PURE__ */ jsx(Select$1.Group, {
|
|
20
|
+
className: cn("scroll-my-1 p-1", className),
|
|
22
21
|
"data-slot": "select-group",
|
|
23
22
|
...props
|
|
24
23
|
});
|
|
@@ -27,7 +26,7 @@ function SelectGroup({ ...props }) {
|
|
|
27
26
|
* @since 0.3.16-canary.0
|
|
28
27
|
*/
|
|
29
28
|
function SelectValue({ ...props }) {
|
|
30
|
-
return /* @__PURE__ */ jsx(
|
|
29
|
+
return /* @__PURE__ */ jsx(Select$1.Value, {
|
|
31
30
|
"data-slot": "select-value",
|
|
32
31
|
...props
|
|
33
32
|
});
|
|
@@ -35,20 +34,15 @@ function SelectValue({ ...props }) {
|
|
|
35
34
|
/**
|
|
36
35
|
* @since 0.3.16-canary.0
|
|
37
36
|
*/
|
|
38
|
-
function SelectTrigger({ children, className, size, ...props }) {
|
|
39
|
-
return /* @__PURE__ */ jsxs(
|
|
40
|
-
className:
|
|
41
|
-
className: ["[&_svg:not([class*='text-'])]:text-muted-foreground focus:ring-ring/50 focus:border-ring w-fit justify-between px-3 font-normal focus:ring-3 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 *:data-[slot=select-value]:truncate", className],
|
|
42
|
-
size,
|
|
43
|
-
variant: "outline"
|
|
44
|
-
}),
|
|
37
|
+
function SelectTrigger({ children, className, size = "default", ...props }) {
|
|
38
|
+
return /* @__PURE__ */ jsxs(Select$1.Trigger, {
|
|
39
|
+
className: cn("flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
45
40
|
"data-size": size,
|
|
46
41
|
"data-slot": "select-trigger",
|
|
47
42
|
...props,
|
|
48
|
-
children: [children, /* @__PURE__ */ jsx(
|
|
43
|
+
children: [children, /* @__PURE__ */ jsx(Select$1.Icon, {
|
|
49
44
|
asChild: true,
|
|
50
|
-
className:
|
|
51
|
-
children: /* @__PURE__ */ jsx(ChevronDownIcon, {})
|
|
45
|
+
children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: "pointer-events-none size-4 text-muted-foreground" })
|
|
52
46
|
})]
|
|
53
47
|
});
|
|
54
48
|
}
|
|
@@ -56,49 +50,55 @@ function SelectTrigger({ children, className, size, ...props }) {
|
|
|
56
50
|
* @since 0.3.16-canary.0
|
|
57
51
|
*/
|
|
58
52
|
function SelectScrollUpButton({ className, ...props }) {
|
|
59
|
-
return /* @__PURE__ */ jsx(
|
|
60
|
-
className: cn("flex items-center justify-center
|
|
53
|
+
return /* @__PURE__ */ jsx(Select$1.ScrollUpButton, {
|
|
54
|
+
className: cn("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4", className),
|
|
61
55
|
"data-slot": "select-scroll-up-button",
|
|
62
56
|
...props,
|
|
63
|
-
children: /* @__PURE__ */ jsx(ChevronUpIcon, {
|
|
57
|
+
children: /* @__PURE__ */ jsx(ChevronUpIcon, {})
|
|
64
58
|
});
|
|
65
59
|
}
|
|
66
60
|
/**
|
|
67
61
|
* @since 0.3.16-canary.0
|
|
68
62
|
*/
|
|
69
63
|
function SelectScrollDownButton({ className, ...props }) {
|
|
70
|
-
return /* @__PURE__ */ jsx(
|
|
71
|
-
className: cn("flex items-center justify-center
|
|
64
|
+
return /* @__PURE__ */ jsx(Select$1.ScrollDownButton, {
|
|
65
|
+
className: cn("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4", className),
|
|
72
66
|
"data-slot": "select-scroll-down-button",
|
|
73
67
|
...props,
|
|
74
|
-
children: /* @__PURE__ */ jsx(ChevronDownIcon, {
|
|
68
|
+
children: /* @__PURE__ */ jsx(ChevronDownIcon, {})
|
|
75
69
|
});
|
|
76
70
|
}
|
|
77
71
|
/**
|
|
78
72
|
* @since 0.3.16-canary.0
|
|
79
73
|
*/
|
|
80
|
-
function SelectContent({ children, className, position = "
|
|
81
|
-
return /* @__PURE__ */ jsx(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
74
|
+
function SelectContent({ align = "center", children, className, position = "item-aligned", ...props }) {
|
|
75
|
+
return /* @__PURE__ */ jsx(Select$1.Portal, {
|
|
76
|
+
"data-slot": "select-portal",
|
|
77
|
+
children: /* @__PURE__ */ jsxs(Select$1.Content, {
|
|
78
|
+
align,
|
|
79
|
+
className: cn("relative z-50 max-h-(--radix-select-content-available-height) min-w-36 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 ease-snappy data-[align-trigger=true]:animate-none data-open:animate-in data-open:animation-duration-menu-in data-open:fade-in-0 data-open:zoom-in-95 data-open:data-side-top:slide-in-from-bottom-2 data-open:data-side-right:slide-in-from-left-2 data-open:data-side-bottom:slide-in-from-top-2 data-open:data-side-left:slide-in-from-right-2 data-closed:animate-out data-closed:ease-exit data-closed:animation-duration-menu-out data-closed:fade-out-0 data-closed:zoom-out-95 data-closed:data-side-top:slide-out-to-bottom-2 data-closed:data-side-right:slide-out-to-left-2 data-closed:data-side-bottom:slide-out-to-top-2 data-closed:data-side-left:slide-out-to-right-2", position === "popper" && "data-side-top:-translate-y-1 data-side-right:translate-x-1 data-side-bottom:translate-y-1 data-side-left:-translate-x-1", className),
|
|
80
|
+
"data-align-trigger": position === "item-aligned",
|
|
81
|
+
"data-slot": "select-content",
|
|
82
|
+
position,
|
|
83
|
+
...props,
|
|
84
|
+
children: [
|
|
85
|
+
/* @__PURE__ */ jsx(SelectScrollUpButton, {}),
|
|
86
|
+
/* @__PURE__ */ jsx(Select$1.Viewport, {
|
|
87
|
+
className: cn("data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)", position === "popper" && ""),
|
|
88
|
+
"data-position": position,
|
|
89
|
+
children
|
|
90
|
+
}),
|
|
91
|
+
/* @__PURE__ */ jsx(SelectScrollDownButton, {})
|
|
92
|
+
]
|
|
93
|
+
})
|
|
94
|
+
});
|
|
95
95
|
}
|
|
96
96
|
/**
|
|
97
97
|
* @since 0.3.16-canary.0
|
|
98
98
|
*/
|
|
99
99
|
function SelectLabel({ className, ...props }) {
|
|
100
|
-
return /* @__PURE__ */ jsx(
|
|
101
|
-
className: cn("
|
|
100
|
+
return /* @__PURE__ */ jsx(Select$1.Label, {
|
|
101
|
+
className: cn("px-2 py-1.5 text-xs text-muted-foreground", className),
|
|
102
102
|
"data-slot": "select-label",
|
|
103
103
|
...props
|
|
104
104
|
});
|
|
@@ -107,22 +107,22 @@ function SelectLabel({ className, ...props }) {
|
|
|
107
107
|
* @since 0.3.16-canary.0
|
|
108
108
|
*/
|
|
109
109
|
function SelectItem({ children, className, ...props }) {
|
|
110
|
-
return /* @__PURE__ */ jsxs(
|
|
111
|
-
className: cn("relative flex w-full items-center py-1.5 pr-8 pl-2
|
|
110
|
+
return /* @__PURE__ */ jsxs(Select$1.Item, {
|
|
111
|
+
className: cn("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className),
|
|
112
112
|
"data-slot": "select-item",
|
|
113
113
|
...props,
|
|
114
114
|
children: [/* @__PURE__ */ jsx("span", {
|
|
115
|
-
className:
|
|
116
|
-
children: /* @__PURE__ */ jsx(
|
|
117
|
-
}), /* @__PURE__ */ jsx(
|
|
115
|
+
className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center",
|
|
116
|
+
children: /* @__PURE__ */ jsx(Select$1.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "pointer-events-none" }) })
|
|
117
|
+
}), /* @__PURE__ */ jsx(Select$1.ItemText, { children })]
|
|
118
118
|
});
|
|
119
119
|
}
|
|
120
120
|
/**
|
|
121
121
|
* @since 0.3.16-canary.0
|
|
122
122
|
*/
|
|
123
123
|
function SelectSeparator({ className, ...props }) {
|
|
124
|
-
return /* @__PURE__ */ jsx(
|
|
125
|
-
className: cn("mx-
|
|
124
|
+
return /* @__PURE__ */ jsx(Select$1.Separator, {
|
|
125
|
+
className: cn("pointer-events-none -mx-1 my-1 h-px bg-border", className),
|
|
126
126
|
"data-slot": "select-separator",
|
|
127
127
|
...props
|
|
128
128
|
});
|
|
@@ -1,27 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
1
|
+
import { SeparatorVariants } from "../variants/separator.mjs";
|
|
2
|
+
import { Separator as Separator$1 } from "radix-ui";
|
|
4
3
|
import { ComponentProps, JSX } from "react";
|
|
5
4
|
|
|
6
5
|
//#region src/components/separator.d.ts
|
|
7
6
|
/**
|
|
8
7
|
* @since 0.3.16-canary.0
|
|
9
8
|
*/
|
|
10
|
-
|
|
11
|
-
align: {
|
|
12
|
-
center: string;
|
|
13
|
-
end: string;
|
|
14
|
-
start: string;
|
|
15
|
-
};
|
|
16
|
-
orientation: {
|
|
17
|
-
horizontal: string;
|
|
18
|
-
vertical: string;
|
|
19
|
-
};
|
|
20
|
-
}, Record<string, never>>;
|
|
21
|
-
/**
|
|
22
|
-
* @since 0.3.16-canary.0
|
|
23
|
-
*/
|
|
24
|
-
interface SeparatorProps extends ComponentProps<typeof SeparatorPrimitive.Root>, Omit<VariantProps<typeof separatorVariants>, "orientation"> {}
|
|
9
|
+
interface SeparatorProps extends ComponentProps<typeof Separator$1.Root>, Omit<SeparatorVariants, "orientation"> {}
|
|
25
10
|
/**
|
|
26
11
|
* @since 0.3.16-canary.0
|
|
27
12
|
*/
|
|
@@ -44,4 +29,4 @@ declare function SeparatorItem({
|
|
|
44
29
|
...props
|
|
45
30
|
}: SeparatorItemProps): JSX.Element;
|
|
46
31
|
//#endregion
|
|
47
|
-
export { Separator, SeparatorItem, type SeparatorItemProps, type SeparatorProps
|
|
32
|
+
export { Separator, SeparatorItem, type SeparatorItemProps, type SeparatorProps };
|
|
@@ -1,34 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
1
|
+
import { cn } from "../lib/utils.mjs";
|
|
2
|
+
import { separatorVariants } from "../variants/separator.mjs";
|
|
3
|
+
import { Separator as Separator$1 } from "radix-ui";
|
|
3
4
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
5
5
|
//#region src/components/separator.tsx
|
|
6
6
|
/**
|
|
7
7
|
* @since 0.3.16-canary.0
|
|
8
8
|
*/
|
|
9
|
-
const separatorVariants = tv({
|
|
10
|
-
base: ["relative flex shrink-0 items-center", "bg-border"],
|
|
11
|
-
defaultVariants: {
|
|
12
|
-
align: "center",
|
|
13
|
-
orientation: "horizontal"
|
|
14
|
-
},
|
|
15
|
-
variants: {
|
|
16
|
-
align: {
|
|
17
|
-
center: "justify-center",
|
|
18
|
-
end: "justify-end",
|
|
19
|
-
start: "justify-start"
|
|
20
|
-
},
|
|
21
|
-
orientation: {
|
|
22
|
-
horizontal: "h-px w-full",
|
|
23
|
-
vertical: "h-full w-px flex-col"
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
/**
|
|
28
|
-
* @since 0.3.16-canary.0
|
|
29
|
-
*/
|
|
30
9
|
function Separator({ align, className, decorative = true, orientation, ...props }) {
|
|
31
|
-
return /* @__PURE__ */ jsx(
|
|
10
|
+
return /* @__PURE__ */ jsx(Separator$1.Root, {
|
|
32
11
|
className: separatorVariants({
|
|
33
12
|
align,
|
|
34
13
|
className,
|
|
@@ -45,10 +24,10 @@ function Separator({ align, className, decorative = true, orientation, ...props
|
|
|
45
24
|
*/
|
|
46
25
|
function SeparatorItem({ className, ...props }) {
|
|
47
26
|
return /* @__PURE__ */ jsx("div", {
|
|
48
|
-
className: cn("absolute
|
|
27
|
+
className: cn("absolute mx-2 bg-background px-2 text-sm text-muted-foreground", className),
|
|
49
28
|
"data-slot": "separator-item",
|
|
50
29
|
...props
|
|
51
30
|
});
|
|
52
31
|
}
|
|
53
32
|
//#endregion
|
|
54
|
-
export { Separator, SeparatorItem
|
|
33
|
+
export { Separator, SeparatorItem };
|
|
@@ -1,36 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
1
|
+
import { ButtonVariants } from "../variants/button.mjs";
|
|
2
|
+
import { SheetContentVariants } from "../variants/sheet.mjs";
|
|
3
|
+
import { Dialog } from "radix-ui";
|
|
4
4
|
import { ComponentProps, JSX } from "react";
|
|
5
|
-
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
6
5
|
|
|
7
6
|
//#region src/components/sheet.d.ts
|
|
8
7
|
/**
|
|
9
8
|
* @since 0.3.16-canary.0
|
|
10
9
|
*/
|
|
11
|
-
|
|
12
|
-
side: {
|
|
13
|
-
bottom: string[];
|
|
14
|
-
left: string[];
|
|
15
|
-
right: string[];
|
|
16
|
-
top: string[];
|
|
17
|
-
};
|
|
18
|
-
}, Record<string, never>>;
|
|
19
|
-
/**
|
|
20
|
-
* @since 0.3.16-canary.0
|
|
21
|
-
*/
|
|
22
|
-
type SheetProps = ComponentProps<typeof SheetPrimitive.Root>;
|
|
10
|
+
type SheetProps = ComponentProps<typeof Dialog.Root>;
|
|
23
11
|
/**
|
|
24
12
|
* @since 0.3.16-canary.0
|
|
25
13
|
*/
|
|
26
14
|
declare function Sheet({
|
|
27
|
-
children,
|
|
28
15
|
...props
|
|
29
16
|
}: SheetProps): JSX.Element;
|
|
30
17
|
/**
|
|
31
18
|
* @since 0.3.16-canary.0
|
|
32
19
|
*/
|
|
33
|
-
type SheetTriggerProps = ComponentProps<typeof
|
|
20
|
+
type SheetTriggerProps = ComponentProps<typeof Dialog.Trigger>;
|
|
34
21
|
/**
|
|
35
22
|
* @since 0.3.16-canary.0
|
|
36
23
|
*/
|
|
@@ -40,12 +27,8 @@ declare function SheetTrigger({
|
|
|
40
27
|
/**
|
|
41
28
|
* @since 0.3.16-canary.0
|
|
42
29
|
*/
|
|
43
|
-
interface SheetContentProps extends ComponentProps<typeof
|
|
44
|
-
|
|
45
|
-
close?: string;
|
|
46
|
-
content?: string;
|
|
47
|
-
overlay?: string;
|
|
48
|
-
};
|
|
30
|
+
interface SheetContentProps extends ComponentProps<typeof Dialog.Content>, SheetContentVariants {
|
|
31
|
+
showCloseButton?: boolean;
|
|
49
32
|
}
|
|
50
33
|
/**
|
|
51
34
|
* @since 0.3.16-canary.0
|
|
@@ -53,7 +36,7 @@ interface SheetContentProps extends ComponentProps<typeof SheetPrimitive.Content
|
|
|
53
36
|
declare function SheetContent({
|
|
54
37
|
children,
|
|
55
38
|
className,
|
|
56
|
-
|
|
39
|
+
showCloseButton,
|
|
57
40
|
side,
|
|
58
41
|
...props
|
|
59
42
|
}: SheetContentProps): JSX.Element;
|
|
@@ -69,6 +52,10 @@ declare function SheetHeader({
|
|
|
69
52
|
...props
|
|
70
53
|
}: SheetHeaderProps): JSX.Element;
|
|
71
54
|
/**
|
|
55
|
+
* Optional scrollable region for long content. When used, the Header and Footer
|
|
56
|
+
* stay pinned (shrink-0) and only this body scrolls. A codefast enhancement over
|
|
57
|
+
* radix-vega.
|
|
58
|
+
*
|
|
72
59
|
* @since 0.3.16-canary.0
|
|
73
60
|
*/
|
|
74
61
|
type SheetBodyProps = ComponentProps<"div">;
|
|
@@ -93,7 +80,7 @@ declare function SheetFooter({
|
|
|
93
80
|
/**
|
|
94
81
|
* @since 0.3.16-canary.0
|
|
95
82
|
*/
|
|
96
|
-
type SheetTitleProps = ComponentProps<typeof
|
|
83
|
+
type SheetTitleProps = ComponentProps<typeof Dialog.Title>;
|
|
97
84
|
/**
|
|
98
85
|
* @since 0.3.16-canary.0
|
|
99
86
|
*/
|
|
@@ -104,7 +91,7 @@ declare function SheetTitle({
|
|
|
104
91
|
/**
|
|
105
92
|
* @since 0.3.16-canary.0
|
|
106
93
|
*/
|
|
107
|
-
type SheetDescriptionProps = ComponentProps<typeof
|
|
94
|
+
type SheetDescriptionProps = ComponentProps<typeof Dialog.Description>;
|
|
108
95
|
/**
|
|
109
96
|
* @since 0.3.16-canary.0
|
|
110
97
|
*/
|
|
@@ -115,9 +102,9 @@ declare function SheetDescription({
|
|
|
115
102
|
/**
|
|
116
103
|
* @since 0.3.16-canary.0
|
|
117
104
|
*/
|
|
118
|
-
interface SheetCloseProps extends ComponentProps<typeof
|
|
119
|
-
size?:
|
|
120
|
-
variant?:
|
|
105
|
+
interface SheetCloseProps extends ComponentProps<typeof Dialog.Close> {
|
|
106
|
+
size?: ButtonVariants["size"];
|
|
107
|
+
variant?: ButtonVariants["variant"];
|
|
121
108
|
}
|
|
122
109
|
/**
|
|
123
110
|
* @since 0.3.16-canary.0
|
|
@@ -129,4 +116,4 @@ declare function SheetClose({
|
|
|
129
116
|
...props
|
|
130
117
|
}: SheetCloseProps): JSX.Element;
|
|
131
118
|
//#endregion
|
|
132
|
-
export { Sheet, SheetBody, type SheetBodyProps, SheetClose, type SheetCloseProps, SheetContent, type SheetContentProps, SheetDescription, type SheetDescriptionProps, SheetFooter, type SheetFooterProps, SheetHeader, type SheetHeaderProps, type SheetProps, SheetTitle, type SheetTitleProps, SheetTrigger, type SheetTriggerProps
|
|
119
|
+
export { Sheet, SheetBody, type SheetBodyProps, SheetClose, type SheetCloseProps, SheetContent, type SheetContentProps, SheetDescription, type SheetDescriptionProps, SheetFooter, type SheetFooterProps, SheetHeader, type SheetHeaderProps, type SheetProps, SheetTitle, type SheetTitleProps, SheetTrigger, type SheetTriggerProps };
|