@taicode/common-web 3.2.0 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/output/components/alert-dialog.js +10 -10
- package/output/components/alert.js +5 -5
- package/output/components/avatar.js +7 -7
- package/output/components/badge.d.ts +7 -6
- package/output/components/badge.d.ts.map +1 -1
- package/output/components/badge.js +21 -13
- package/output/components/button.d.ts +8 -8
- package/output/components/button.d.ts.map +1 -1
- package/output/components/button.js +26 -22
- package/output/components/calendar.d.ts +13 -0
- package/output/components/calendar.d.ts.map +1 -0
- package/output/components/calendar.js +57 -0
- package/output/components/card.d.ts +12 -7
- package/output/components/card.d.ts.map +1 -1
- package/output/components/card.js +26 -21
- package/output/components/chart.d.ts +56 -0
- package/output/components/chart.d.ts.map +1 -0
- package/output/components/chart.js +127 -0
- package/output/components/checkbox.js +2 -2
- package/output/components/command.js +10 -10
- package/output/components/dialog.js +7 -7
- package/output/components/drawer.d.ts +14 -0
- package/output/components/drawer.d.ts.map +1 -0
- package/output/components/drawer.js +56 -0
- package/output/components/dropdown-menu.js +10 -10
- package/output/components/field.js +11 -11
- package/output/components/index.d.ts +6 -0
- package/output/components/index.d.ts.map +1 -1
- package/output/components/index.js +6 -0
- package/output/components/input-group.d.ts +1 -1
- package/output/components/input-group.js +7 -7
- package/output/components/input.d.ts +3 -2
- package/output/components/input.d.ts.map +1 -1
- package/output/components/input.js +7 -7
- package/output/components/item.d.ts +1 -1
- package/output/components/item.js +11 -11
- package/output/components/json-view/index.js +2 -2
- package/output/components/kbd.js +3 -3
- package/output/components/label.js +2 -2
- package/output/components/native-select.js +3 -3
- package/output/components/popover.js +5 -5
- package/output/components/progress.js +2 -2
- package/output/components/radio-group.js +3 -3
- package/output/components/scroll-area.js +3 -3
- package/output/components/select.js +9 -9
- package/output/components/separator.d.ts +4 -5
- package/output/components/separator.d.ts.map +1 -1
- package/output/components/separator.js +8 -7
- package/output/components/sheet.js +7 -7
- package/output/components/sidebar.d.ts +78 -0
- package/output/components/sidebar.d.ts.map +1 -0
- package/output/components/sidebar.js +233 -0
- package/output/components/skeleton.d.ts +2 -2
- package/output/components/skeleton.d.ts.map +1 -1
- package/output/components/skeleton.js +5 -4
- package/output/components/spinner.js +2 -2
- package/output/components/switch.js +2 -2
- package/output/components/table.js +9 -9
- package/output/components/tabs.js +5 -5
- package/output/components/textarea.js +2 -2
- package/output/components/toggle-group.d.ts +12 -0
- package/output/components/toggle-group.d.ts.map +1 -0
- package/output/components/toggle-group.js +38 -0
- package/output/components/toggle.d.ts +10 -0
- package/output/components/toggle.d.ts.map +1 -0
- package/output/components/toggle.js +38 -0
- package/output/components/tooltip.js +2 -2
- package/output/features/confirm-dialog/index.js +2 -2
- package/output/layout/app/index.js +7 -7
- package/output/layout/dashboard/index.js +2 -2
- package/output/layout/empty/index.d.ts +20 -0
- package/output/layout/empty/index.d.ts.map +1 -0
- package/output/layout/empty/index.js +14 -0
- package/output/layout/index.d.ts +4 -0
- package/output/layout/index.d.ts.map +1 -1
- package/output/layout/index.js +4 -0
- package/output/layout/list-actions/index.d.ts +23 -0
- package/output/layout/list-actions/index.d.ts.map +1 -0
- package/output/layout/list-actions/index.js +15 -0
- package/output/layout/page-back-button/index.d.ts +8 -0
- package/output/layout/page-back-button/index.d.ts.map +1 -0
- package/output/layout/page-back-button/index.js +7 -0
- package/output/layout/pagination/index.d.ts +34 -0
- package/output/layout/pagination/index.d.ts.map +1 -0
- package/output/layout/pagination/index.js +75 -0
- package/output/utils/merge-class-names/index.d.ts +3 -0
- package/output/utils/merge-class-names/index.d.ts.map +1 -0
- package/output/utils/{cn → merge-class-names}/index.js +1 -1
- package/output/utils/merge-class-names/index.test.d.ts.map +1 -0
- package/output/utils/merge-class-names/index.test.js +7 -0
- package/package.json +5 -46
- package/output/utils/cn/index.d.ts +0 -3
- package/output/utils/cn/index.d.ts.map +0 -1
- package/output/utils/cn/index.test.d.ts.map +0 -1
- package/output/utils/cn/index.test.js +0 -7
- /package/output/utils/{cn → merge-class-names}/index.test.d.ts +0 -0
|
@@ -12,13 +12,13 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import * as React from "react";
|
|
14
14
|
import { cva } from "class-variance-authority";
|
|
15
|
-
import {
|
|
15
|
+
import { mergeClassNames } from "../utils/merge-class-names/index.js";
|
|
16
16
|
import { Button } from "./button.js";
|
|
17
17
|
import { Input } from "./input.js";
|
|
18
18
|
import { Textarea } from "./textarea.js";
|
|
19
19
|
function InputGroup(params) {
|
|
20
20
|
const { className } = params, props = __rest(params, ["className"]);
|
|
21
|
-
return (_jsx("div", Object.assign({ "data-slot": "input-group", role: "group", className:
|
|
21
|
+
return (_jsx("div", Object.assign({ "data-slot": "input-group", role: "group", className: mergeClassNames("border-input dark:bg-input/30 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 h-9 rounded-md border shadow-xs transition-[color,box-shadow] has-[[data-slot=input-group-control]:focus-visible]:ring-[3px] has-[[data-slot][aria-invalid=true]]:ring-[3px] has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5 [[data-slot=combobox-content]_&]:focus-within:border-inherit [[data-slot=combobox-content]_&]:focus-within:ring-0 group/input-group relative flex w-full min-w-0 items-center outline-none has-[>textarea]:h-auto", className) }, props)));
|
|
22
22
|
}
|
|
23
23
|
const inputGroupAddonVariants = cva("text-muted-foreground h-auto gap-2 py-1.5 text-sm font-medium group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4 flex cursor-text items-center justify-center select-none", {
|
|
24
24
|
variants: {
|
|
@@ -35,7 +35,7 @@ const inputGroupAddonVariants = cva("text-muted-foreground h-auto gap-2 py-1.5 t
|
|
|
35
35
|
});
|
|
36
36
|
function InputGroupAddon(params) {
|
|
37
37
|
const { className, align = "inline-start" } = params, props = __rest(params, ["className", "align"]);
|
|
38
|
-
return (_jsx("div", Object.assign({ role: "group", "data-slot": "input-group-addon", "data-align": align, className:
|
|
38
|
+
return (_jsx("div", Object.assign({ role: "group", "data-slot": "input-group-addon", "data-align": align, className: mergeClassNames(inputGroupAddonVariants({ align }), className), onClick: (e) => {
|
|
39
39
|
var _a, _b;
|
|
40
40
|
if (e.target.closest("button")) {
|
|
41
41
|
return;
|
|
@@ -58,18 +58,18 @@ const inputGroupButtonVariants = cva("gap-2 text-sm shadow-none flex items-cente
|
|
|
58
58
|
});
|
|
59
59
|
function InputGroupButton(params) {
|
|
60
60
|
const { className, type = "button", variant = "ghost", size = "xs" } = params, props = __rest(params, ["className", "type", "variant", "size"]);
|
|
61
|
-
return (_jsx(Button, Object.assign({ type: type, "data-size": size, variant: variant, className:
|
|
61
|
+
return (_jsx(Button, Object.assign({ type: type, "data-size": size, variant: variant, className: mergeClassNames(inputGroupButtonVariants({ size }), className) }, props)));
|
|
62
62
|
}
|
|
63
63
|
function InputGroupText(params) {
|
|
64
64
|
const { className } = params, props = __rest(params, ["className"]);
|
|
65
|
-
return (_jsx("span", Object.assign({ className:
|
|
65
|
+
return (_jsx("span", Object.assign({ className: mergeClassNames("text-muted-foreground gap-2 text-sm [&_svg:not([class*='size-'])]:size-4 flex items-center [&_svg]:pointer-events-none", className) }, props)));
|
|
66
66
|
}
|
|
67
67
|
function InputGroupInput(params) {
|
|
68
68
|
const { className } = params, props = __rest(params, ["className"]);
|
|
69
|
-
return (_jsx(Input, Object.assign({ "data-slot": "input-group-control", className:
|
|
69
|
+
return (_jsx(Input, Object.assign({ "data-slot": "input-group-control", className: mergeClassNames("rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent flex-1", className) }, props)));
|
|
70
70
|
}
|
|
71
71
|
function InputGroupTextarea(params) {
|
|
72
72
|
const { className } = params, props = __rest(params, ["className"]);
|
|
73
|
-
return (_jsx(Textarea, Object.assign({ "data-slot": "input-group-control", className:
|
|
73
|
+
return (_jsx(Textarea, Object.assign({ "data-slot": "input-group-control", className: mergeClassNames("rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent flex-1 resize-none", className) }, props)));
|
|
74
74
|
}
|
|
75
75
|
export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupText, InputGroupInput, InputGroupTextarea, };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare function Input(params: React.ComponentProps<'input'>): React.JSX.Element;
|
|
3
|
+
export { Input };
|
|
3
4
|
//# sourceMappingURL=input.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../source/components/input.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../source/components/input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,iBAAS,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,qBAanD;AAED,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
|
@@ -10,10 +10,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return (_jsx("input", Object.assign({
|
|
18
|
-
}
|
|
19
|
-
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import { mergeClassNames } from '../utils/merge-class-names/index.js';
|
|
15
|
+
function Input(params) {
|
|
16
|
+
const { className, type } = params, props = __rest(params, ["className", "type"]);
|
|
17
|
+
return (_jsx("input", Object.assign({ type: type, "data-slot": "input", className: mergeClassNames('dark:bg-input/30 border-input focus-visible:border-ring aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 h-9 rounded-md border bg-transparent px-2.5 py-1 text-base transition-colors file:h-7 file:text-sm file:font-medium md:text-sm file:text-foreground placeholder:text-muted-foreground w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50', className) }, props)));
|
|
18
|
+
}
|
|
19
|
+
export { Input };
|
|
@@ -8,7 +8,7 @@ declare function ItemGroup(params: React.ComponentProps<"div">): React.JSX.Eleme
|
|
|
8
8
|
declare function ItemSeparator(params: React.ComponentProps<typeof Separator>): React.JSX.Element;
|
|
9
9
|
declare const itemVariants: (props?: ({
|
|
10
10
|
variant?: "default" | "outline" | "muted" | null | undefined;
|
|
11
|
-
size?: "default" | "
|
|
11
|
+
size?: "default" | "xs" | "sm" | null | undefined;
|
|
12
12
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
13
13
|
declare function Item(params: React.ComponentProps<"div"> & VariantProps<typeof itemVariants> & ItemParams): React.JSX.Element;
|
|
14
14
|
declare const itemMediaVariants: (props?: ({
|
|
@@ -13,15 +13,15 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
13
13
|
import * as React from "react";
|
|
14
14
|
import { cva } from "class-variance-authority";
|
|
15
15
|
import { Slot } from "radix-ui";
|
|
16
|
-
import {
|
|
16
|
+
import { mergeClassNames } from "../utils/merge-class-names/index.js";
|
|
17
17
|
import { Separator } from "./separator.js";
|
|
18
18
|
function ItemGroup(params) {
|
|
19
19
|
const { className } = params, props = __rest(params, ["className"]);
|
|
20
|
-
return (_jsx("div", Object.assign({ role: "list", "data-slot": "item-group", className:
|
|
20
|
+
return (_jsx("div", Object.assign({ role: "list", "data-slot": "item-group", className: mergeClassNames("gap-4 has-[[data-size=sm]]:gap-2.5 has-[[data-size=xs]]:gap-2 group/item-group flex w-full flex-col", className) }, props)));
|
|
21
21
|
}
|
|
22
22
|
function ItemSeparator(params) {
|
|
23
23
|
const { className } = params, props = __rest(params, ["className"]);
|
|
24
|
-
return (_jsx(Separator, Object.assign({ "data-slot": "item-separator", orientation: "horizontal", className:
|
|
24
|
+
return (_jsx(Separator, Object.assign({ "data-slot": "item-separator", orientation: "horizontal", className: mergeClassNames("my-2", className) }, props)));
|
|
25
25
|
}
|
|
26
26
|
const itemVariants = cva("[a]:hover:bg-muted rounded-md border text-sm w-full group/item focus-visible:border-ring focus-visible:ring-ring/50 flex items-center flex-wrap outline-none transition-colors duration-100 focus-visible:ring-[3px] [a]:transition-colors", {
|
|
27
27
|
variants: {
|
|
@@ -44,7 +44,7 @@ const itemVariants = cva("[a]:hover:bg-muted rounded-md border text-sm w-full gr
|
|
|
44
44
|
function Item(params) {
|
|
45
45
|
const { className, variant = "default", size = "default", asChild = false } = params, props = __rest(params, ["className", "variant", "size", "asChild"]);
|
|
46
46
|
const Comp = asChild ? Slot.Root : "div";
|
|
47
|
-
return (_jsx(Comp, Object.assign({ "data-slot": "item", "data-variant": variant, "data-size": size, className:
|
|
47
|
+
return (_jsx(Comp, Object.assign({ "data-slot": "item", "data-variant": variant, "data-size": size, className: mergeClassNames(itemVariants({ variant, size, className })) }, props)));
|
|
48
48
|
}
|
|
49
49
|
const itemMediaVariants = cva("gap-2 group-has-[[data-slot=item-description]]/item:translate-y-0.5 group-has-[[data-slot=item-description]]/item:self-start flex shrink-0 items-center justify-center [&_svg]:pointer-events-none", {
|
|
50
50
|
variants: {
|
|
@@ -60,30 +60,30 @@ const itemMediaVariants = cva("gap-2 group-has-[[data-slot=item-description]]/it
|
|
|
60
60
|
});
|
|
61
61
|
function ItemMedia(params) {
|
|
62
62
|
const { className, variant = "default" } = params, props = __rest(params, ["className", "variant"]);
|
|
63
|
-
return (_jsx("div", Object.assign({ "data-slot": "item-media", "data-variant": variant, className:
|
|
63
|
+
return (_jsx("div", Object.assign({ "data-slot": "item-media", "data-variant": variant, className: mergeClassNames(itemMediaVariants({ variant, className })) }, props)));
|
|
64
64
|
}
|
|
65
65
|
function ItemContent(params) {
|
|
66
66
|
const { className } = params, props = __rest(params, ["className"]);
|
|
67
|
-
return (_jsx("div", Object.assign({ "data-slot": "item-content", className:
|
|
67
|
+
return (_jsx("div", Object.assign({ "data-slot": "item-content", className: mergeClassNames("gap-1 group-data-[size=xs]/item:gap-0 flex flex-1 flex-col [&+[data-slot=item-content]]:flex-none", className) }, props)));
|
|
68
68
|
}
|
|
69
69
|
function ItemTitle(params) {
|
|
70
70
|
const { className } = params, props = __rest(params, ["className"]);
|
|
71
|
-
return (_jsx("div", Object.assign({ "data-slot": "item-title", className:
|
|
71
|
+
return (_jsx("div", Object.assign({ "data-slot": "item-title", className: mergeClassNames("gap-2 text-sm leading-snug font-medium underline-offset-4 line-clamp-1 flex w-fit items-center", className) }, props)));
|
|
72
72
|
}
|
|
73
73
|
function ItemDescription(params) {
|
|
74
74
|
const { className } = params, props = __rest(params, ["className"]);
|
|
75
|
-
return (_jsx("p", Object.assign({ "data-slot": "item-description", className:
|
|
75
|
+
return (_jsx("p", Object.assign({ "data-slot": "item-description", className: mergeClassNames("text-muted-foreground text-left text-sm leading-normal group-data-[size=xs]/item:text-xs [&>a:hover]:text-primary line-clamp-2 font-normal [&>a]:underline [&>a]:underline-offset-4", className) }, props)));
|
|
76
76
|
}
|
|
77
77
|
function ItemActions(params) {
|
|
78
78
|
const { className } = params, props = __rest(params, ["className"]);
|
|
79
|
-
return (_jsx("div", Object.assign({ "data-slot": "item-actions", className:
|
|
79
|
+
return (_jsx("div", Object.assign({ "data-slot": "item-actions", className: mergeClassNames("gap-2 flex items-center", className) }, props)));
|
|
80
80
|
}
|
|
81
81
|
function ItemHeader(params) {
|
|
82
82
|
const { className } = params, props = __rest(params, ["className"]);
|
|
83
|
-
return (_jsx("div", Object.assign({ "data-slot": "item-header", className:
|
|
83
|
+
return (_jsx("div", Object.assign({ "data-slot": "item-header", className: mergeClassNames("gap-2 flex basis-full items-center justify-between", className) }, props)));
|
|
84
84
|
}
|
|
85
85
|
function ItemFooter(params) {
|
|
86
86
|
const { className } = params, props = __rest(params, ["className"]);
|
|
87
|
-
return (_jsx("div", Object.assign({ "data-slot": "item-footer", className:
|
|
87
|
+
return (_jsx("div", Object.assign({ "data-slot": "item-footer", className: mergeClassNames("gap-2 flex basis-full items-center justify-between", className) }, props)));
|
|
88
88
|
}
|
|
89
89
|
export { Item, ItemMedia, ItemContent, ItemActions, ItemGroup, ItemSeparator, ItemTitle, ItemDescription, ItemHeader, ItemFooter, };
|
|
@@ -3,7 +3,7 @@ import 'jsoneditor/dist/jsoneditor.css';
|
|
|
3
3
|
import JSONEditor from 'jsoneditor';
|
|
4
4
|
import { observer } from 'mobx-react-lite';
|
|
5
5
|
import { useEffect, useRef } from 'react';
|
|
6
|
-
import {
|
|
6
|
+
import { mergeClassNames } from '../../utils/merge-class-names/index.js';
|
|
7
7
|
export const JsonView = observer((props) => {
|
|
8
8
|
const { value, onChange, readonly = false, className } = props;
|
|
9
9
|
const containerRef = useRef(null);
|
|
@@ -48,5 +48,5 @@ export const JsonView = observer((props) => {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
}, [value]);
|
|
51
|
-
return _jsx("div", { ref: containerRef, className:
|
|
51
|
+
return _jsx("div", { ref: containerRef, className: mergeClassNames('h-96 w-full', className) });
|
|
52
52
|
});
|
package/output/components/kbd.js
CHANGED
|
@@ -10,13 +10,13 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import {
|
|
13
|
+
import { mergeClassNames } from "../utils/merge-class-names/index.js";
|
|
14
14
|
function Kbd(params) {
|
|
15
15
|
const { className } = params, props = __rest(params, ["className"]);
|
|
16
|
-
return (_jsx("kbd", Object.assign({ "data-slot": "kbd", className:
|
|
16
|
+
return (_jsx("kbd", Object.assign({ "data-slot": "kbd", className: mergeClassNames("bg-muted text-muted-foreground [[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10 h-5 w-fit min-w-5 gap-1 rounded-sm px-1 font-sans text-xs font-medium [&_svg:not([class*='size-'])]:size-3 pointer-events-none inline-flex items-center justify-center select-none", className) }, props)));
|
|
17
17
|
}
|
|
18
18
|
function KbdGroup(params) {
|
|
19
19
|
const { className } = params, props = __rest(params, ["className"]);
|
|
20
|
-
return (_jsx("kbd", Object.assign({ "data-slot": "kbd-group", className:
|
|
20
|
+
return (_jsx("kbd", Object.assign({ "data-slot": "kbd-group", className: mergeClassNames("gap-1 inline-flex items-center", className) }, props)));
|
|
21
21
|
}
|
|
22
22
|
export { Kbd, KbdGroup };
|
|
@@ -12,9 +12,9 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import * as React from 'react';
|
|
14
14
|
import { Label as LabelPrimitive } from 'radix-ui';
|
|
15
|
-
import {
|
|
15
|
+
import { mergeClassNames } from '../utils/merge-class-names/index.js';
|
|
16
16
|
function Label(params) {
|
|
17
17
|
const { className } = params, props = __rest(params, ["className"]);
|
|
18
|
-
return (_jsx(LabelPrimitive.Root, Object.assign({ "data-slot": "label", className:
|
|
18
|
+
return (_jsx(LabelPrimitive.Root, Object.assign({ "data-slot": "label", className: mergeClassNames('gap-2 text-sm leading-none font-medium group-data-[disabled=true]:opacity-50 peer-disabled:opacity-50 flex items-center select-none group-data-[disabled=true]:pointer-events-none peer-disabled:cursor-not-allowed', className) }, props)));
|
|
19
19
|
}
|
|
20
20
|
export { Label };
|
|
@@ -11,11 +11,11 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import * as React from "react";
|
|
14
|
-
import {
|
|
14
|
+
import { mergeClassNames } from "../utils/merge-class-names/index.js";
|
|
15
15
|
import { ChevronDownIcon } from "lucide-react";
|
|
16
16
|
function NativeSelect(params) {
|
|
17
17
|
const { className, size = "default" } = params, props = __rest(params, ["className", "size"]);
|
|
18
|
-
return (_jsxs("div", { className:
|
|
18
|
+
return (_jsxs("div", { className: mergeClassNames("group/native-select relative w-fit has-[select:disabled]:opacity-50", className), "data-slot": "native-select-wrapper", "data-size": size, children: [_jsx("select", Object.assign({ "data-slot": "native-select", "data-size": size, className: "border-input placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 h-9 w-full min-w-0 appearance-none rounded-md border bg-transparent py-1 pr-8 pl-2.5 text-sm shadow-xs transition-[color,box-shadow] select-none focus-visible:ring-[3px] aria-invalid:ring-[3px] data-[size=sm]:h-8 outline-none disabled:pointer-events-none disabled:cursor-not-allowed" }, props)), _jsx(ChevronDownIcon, { className: "text-muted-foreground top-1/2 right-2.5 size-4 -translate-y-1/2 pointer-events-none absolute select-none", "aria-hidden": "true", "data-slot": "native-select-icon" })] }));
|
|
19
19
|
}
|
|
20
20
|
function NativeSelectOption(params) {
|
|
21
21
|
const props = __rest(params, []);
|
|
@@ -23,6 +23,6 @@ function NativeSelectOption(params) {
|
|
|
23
23
|
}
|
|
24
24
|
function NativeSelectOptGroup(params) {
|
|
25
25
|
const { className } = params, props = __rest(params, ["className"]);
|
|
26
|
-
return (_jsx("optgroup", Object.assign({ "data-slot": "native-select-optgroup", className:
|
|
26
|
+
return (_jsx("optgroup", Object.assign({ "data-slot": "native-select-optgroup", className: mergeClassNames(className) }, props)));
|
|
27
27
|
}
|
|
28
28
|
export { NativeSelect, NativeSelectOptGroup, NativeSelectOption };
|
|
@@ -12,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import * as React from "react";
|
|
14
14
|
import { Popover as PopoverPrimitive } from "radix-ui";
|
|
15
|
-
import {
|
|
15
|
+
import { mergeClassNames } from "../utils/merge-class-names/index.js";
|
|
16
16
|
function Popover(params) {
|
|
17
17
|
const props = __rest(params, []);
|
|
18
18
|
return _jsx(PopoverPrimitive.Root, Object.assign({ "data-slot": "popover" }, props));
|
|
@@ -23,7 +23,7 @@ function PopoverTrigger(params) {
|
|
|
23
23
|
}
|
|
24
24
|
function PopoverContent(params) {
|
|
25
25
|
const { className, align = "center", sideOffset = 4 } = params, props = __rest(params, ["className", "align", "sideOffset"]);
|
|
26
|
-
return (_jsx(PopoverPrimitive.Portal, { children: _jsx(PopoverPrimitive.Content, Object.assign({ "data-slot": "popover-content", align: align, sideOffset: sideOffset, className:
|
|
26
|
+
return (_jsx(PopoverPrimitive.Portal, { children: _jsx(PopoverPrimitive.Content, Object.assign({ "data-slot": "popover-content", align: align, sideOffset: sideOffset, className: mergeClassNames("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 flex flex-col gap-4 rounded-md p-4 text-sm shadow-md ring-1 duration-100 z-50 w-72 origin-(--radix-popover-content-transform-origin) outline-hidden", className) }, props)) }));
|
|
27
27
|
}
|
|
28
28
|
function PopoverAnchor(params) {
|
|
29
29
|
const props = __rest(params, []);
|
|
@@ -31,14 +31,14 @@ function PopoverAnchor(params) {
|
|
|
31
31
|
}
|
|
32
32
|
function PopoverHeader(params) {
|
|
33
33
|
const { className } = params, props = __rest(params, ["className"]);
|
|
34
|
-
return (_jsx("div", Object.assign({ "data-slot": "popover-header", className:
|
|
34
|
+
return (_jsx("div", Object.assign({ "data-slot": "popover-header", className: mergeClassNames("flex flex-col gap-1 text-sm", className) }, props)));
|
|
35
35
|
}
|
|
36
36
|
function PopoverTitle(params) {
|
|
37
37
|
const { className } = params, props = __rest(params, ["className"]);
|
|
38
|
-
return (_jsx("div", Object.assign({ "data-slot": "popover-title", className:
|
|
38
|
+
return (_jsx("div", Object.assign({ "data-slot": "popover-title", className: mergeClassNames("font-medium", className) }, props)));
|
|
39
39
|
}
|
|
40
40
|
function PopoverDescription(params) {
|
|
41
41
|
const { className } = params, props = __rest(params, ["className"]);
|
|
42
|
-
return (_jsx("p", Object.assign({ "data-slot": "popover-description", className:
|
|
42
|
+
return (_jsx("p", Object.assign({ "data-slot": "popover-description", className: mergeClassNames("text-muted-foreground", className) }, props)));
|
|
43
43
|
}
|
|
44
44
|
export { Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, };
|
|
@@ -13,9 +13,9 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
14
|
import * as React from "react";
|
|
15
15
|
import { Progress as ProgressPrimitive } from "radix-ui";
|
|
16
|
-
import {
|
|
16
|
+
import { mergeClassNames } from "../utils/merge-class-names/index.js";
|
|
17
17
|
function Progress(params) {
|
|
18
18
|
const { className, value } = params, props = __rest(params, ["className", "value"]);
|
|
19
|
-
return (_jsx(ProgressPrimitive.Root, Object.assign({ "data-slot": "progress", className:
|
|
19
|
+
return (_jsx(ProgressPrimitive.Root, Object.assign({ "data-slot": "progress", className: mergeClassNames("bg-muted h-1.5 rounded-full relative flex w-full items-center overflow-x-hidden", className) }, props, { children: _jsx(ProgressPrimitive.Indicator, { "data-slot": "progress-indicator", className: "bg-primary size-full flex-1 transition-all", style: { transform: `translateX(-${100 - (value || 0)}%)` } }) })));
|
|
20
20
|
}
|
|
21
21
|
export { Progress };
|
|
@@ -13,13 +13,13 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
13
13
|
import * as React from 'react';
|
|
14
14
|
import { RadioGroup as RadioGroupPrimitive } from 'radix-ui';
|
|
15
15
|
import { CircleIcon } from 'lucide-react';
|
|
16
|
-
import {
|
|
16
|
+
import { mergeClassNames } from '../utils/merge-class-names/index.js';
|
|
17
17
|
function RadioGroup(params) {
|
|
18
18
|
const { className } = params, props = __rest(params, ["className"]);
|
|
19
|
-
return _jsx(RadioGroupPrimitive.Root, Object.assign({ "data-slot": "radio-group", className:
|
|
19
|
+
return _jsx(RadioGroupPrimitive.Root, Object.assign({ "data-slot": "radio-group", className: mergeClassNames('grid gap-3 w-full', className) }, props));
|
|
20
20
|
}
|
|
21
21
|
function RadioGroupItem(params) {
|
|
22
22
|
const { className } = params, props = __rest(params, ["className"]);
|
|
23
|
-
return (_jsx(RadioGroupPrimitive.Item, Object.assign({ "data-slot": "radio-group-item", className:
|
|
23
|
+
return (_jsx(RadioGroupPrimitive.Item, Object.assign({ "data-slot": "radio-group-item", className: mergeClassNames('border-input text-primary dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 flex size-4 rounded-full shadow-xs focus-visible:ring-[3px] aria-invalid:ring-[3px] group/radio-group-item peer relative aspect-square shrink-0 border outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50', className) }, props, { children: _jsx(RadioGroupPrimitive.Indicator, { "data-slot": "radio-group-indicator", className: "group-aria-invalid/radio-group-item:text-destructive text-primary flex size-4 items-center justify-center", children: _jsx(CircleIcon, { className: "absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 fill-current" }) }) })));
|
|
24
24
|
}
|
|
25
25
|
export { RadioGroup, RadioGroupItem };
|
|
@@ -12,13 +12,13 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import * as React from "react";
|
|
14
14
|
import { ScrollArea as ScrollAreaPrimitive } from "radix-ui";
|
|
15
|
-
import {
|
|
15
|
+
import { mergeClassNames } from "../utils/merge-class-names/index.js";
|
|
16
16
|
function ScrollArea(params) {
|
|
17
17
|
const { className, children } = params, props = __rest(params, ["className", "children"]);
|
|
18
|
-
return (_jsxs(ScrollAreaPrimitive.Root, Object.assign({ "data-slot": "scroll-area", className:
|
|
18
|
+
return (_jsxs(ScrollAreaPrimitive.Root, Object.assign({ "data-slot": "scroll-area", className: mergeClassNames("relative", className) }, props, { children: [_jsx(ScrollAreaPrimitive.Viewport, { "data-slot": "scroll-area-viewport", className: "focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1", children: children }), _jsx(ScrollBar, {}), _jsx(ScrollAreaPrimitive.Corner, {})] })));
|
|
19
19
|
}
|
|
20
20
|
function ScrollBar(params) {
|
|
21
21
|
const { className, orientation = "vertical" } = params, props = __rest(params, ["className", "orientation"]);
|
|
22
|
-
return (_jsx(ScrollAreaPrimitive.ScrollAreaScrollbar, Object.assign({ "data-slot": "scroll-area-scrollbar", "data-orientation": orientation, orientation: orientation, className:
|
|
22
|
+
return (_jsx(ScrollAreaPrimitive.ScrollAreaScrollbar, Object.assign({ "data-slot": "scroll-area-scrollbar", "data-orientation": orientation, orientation: orientation, className: mergeClassNames("data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent flex touch-none p-px transition-colors select-none", className) }, props, { children: _jsx(ScrollAreaPrimitive.ScrollAreaThumb, { "data-slot": "scroll-area-thumb", className: "rounded-full bg-border relative flex-1" }) })));
|
|
23
23
|
}
|
|
24
24
|
export { ScrollArea, ScrollBar };
|
|
@@ -13,7 +13,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
13
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
14
|
import * as React from "react";
|
|
15
15
|
import { Select as SelectPrimitive } from "radix-ui";
|
|
16
|
-
import {
|
|
16
|
+
import { mergeClassNames } from "../utils/merge-class-names/index.js";
|
|
17
17
|
import { ChevronDownIcon, CheckIcon, ChevronUpIcon } from "lucide-react";
|
|
18
18
|
function Select(params) {
|
|
19
19
|
const props = __rest(params, []);
|
|
@@ -21,7 +21,7 @@ function Select(params) {
|
|
|
21
21
|
}
|
|
22
22
|
function SelectGroup(params) {
|
|
23
23
|
const { className } = params, props = __rest(params, ["className"]);
|
|
24
|
-
return (_jsx(SelectPrimitive.Group, Object.assign({ "data-slot": "select-group", className:
|
|
24
|
+
return (_jsx(SelectPrimitive.Group, Object.assign({ "data-slot": "select-group", className: mergeClassNames("scroll-my-1 p-1", className) }, props)));
|
|
25
25
|
}
|
|
26
26
|
function SelectValue(params) {
|
|
27
27
|
const props = __rest(params, []);
|
|
@@ -29,30 +29,30 @@ function SelectValue(params) {
|
|
|
29
29
|
}
|
|
30
30
|
function SelectTrigger(params) {
|
|
31
31
|
const { className, size = "default", children } = params, props = __rest(params, ["className", "size", "children"]);
|
|
32
|
-
return (_jsxs(SelectPrimitive.Trigger, Object.assign({ "data-slot": "select-trigger", "data-size": size, className:
|
|
32
|
+
return (_jsxs(SelectPrimitive.Trigger, Object.assign({ "data-slot": "select-trigger", "data-size": size, className: mergeClassNames("border-input data-[placeholder]:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 gap-1.5 rounded-md border bg-transparent py-2 pr-2 pl-2.5 text-sm shadow-xs transition-[color,box-shadow] focus-visible:ring-[3px] aria-invalid:ring-[3px] data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:flex *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*='size-'])]:size-4 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0", className) }, props, { children: [children, _jsx(SelectPrimitive.Icon, { asChild: true, children: _jsx(ChevronDownIcon, { className: "text-muted-foreground size-4 pointer-events-none" }) })] })));
|
|
33
33
|
}
|
|
34
34
|
function SelectContent(params) {
|
|
35
35
|
const { className, children, position = "item-aligned", align = "center" } = params, props = __rest(params, ["className", "children", "position", "align"]);
|
|
36
|
-
return (_jsx(SelectPrimitive.Portal, { children: _jsxs(SelectPrimitive.Content, Object.assign({ "data-slot": "select-content", "data-align-trigger": position === "item-aligned", className:
|
|
36
|
+
return (_jsx(SelectPrimitive.Portal, { children: _jsxs(SelectPrimitive.Content, Object.assign({ "data-slot": "select-content", "data-align-trigger": position === "item-aligned", className: mergeClassNames("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 min-w-36 rounded-md shadow-md ring-1 duration-100 relative z-50 max-h-(--radix-select-content-available-height) origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto data-[align-trigger=true]:animate-none", position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className), position: position, align: align }, props, { children: [_jsx(SelectScrollUpButton, {}), _jsx(SelectPrimitive.Viewport, { "data-position": position, className: mergeClassNames("data-[position=popper]:h-[var(--radix-select-trigger-height)] data-[position=popper]:w-full data-[position=popper]:min-w-[var(--radix-select-trigger-width)]", position === "popper" && ""), children: children }), _jsx(SelectScrollDownButton, {})] })) }));
|
|
37
37
|
}
|
|
38
38
|
function SelectLabel(params) {
|
|
39
39
|
const { className } = params, props = __rest(params, ["className"]);
|
|
40
|
-
return (_jsx(SelectPrimitive.Label, Object.assign({ "data-slot": "select-label", className:
|
|
40
|
+
return (_jsx(SelectPrimitive.Label, Object.assign({ "data-slot": "select-label", className: mergeClassNames("text-muted-foreground px-2 py-1.5 text-xs", className) }, props)));
|
|
41
41
|
}
|
|
42
42
|
function SelectItem(params) {
|
|
43
43
|
const { className, children } = params, props = __rest(params, ["className", "children"]);
|
|
44
|
-
return (_jsxs(SelectPrimitive.Item, Object.assign({ "data-slot": "select-item", className:
|
|
44
|
+
return (_jsxs(SelectPrimitive.Item, Object.assign({ "data-slot": "select-item", className: mergeClassNames("focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 relative flex w-full cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0", className) }, props, { children: [_jsx("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center", children: _jsx(SelectPrimitive.ItemIndicator, { children: _jsx(CheckIcon, { className: "pointer-events-none" }) }) }), _jsx(SelectPrimitive.ItemText, { children: children })] })));
|
|
45
45
|
}
|
|
46
46
|
function SelectSeparator(params) {
|
|
47
47
|
const { className } = params, props = __rest(params, ["className"]);
|
|
48
|
-
return (_jsx(SelectPrimitive.Separator, Object.assign({ "data-slot": "select-separator", className:
|
|
48
|
+
return (_jsx(SelectPrimitive.Separator, Object.assign({ "data-slot": "select-separator", className: mergeClassNames("bg-border -mx-1 my-1 h-px pointer-events-none", className) }, props)));
|
|
49
49
|
}
|
|
50
50
|
function SelectScrollUpButton(params) {
|
|
51
51
|
const { className } = params, props = __rest(params, ["className"]);
|
|
52
|
-
return (_jsx(SelectPrimitive.ScrollUpButton, Object.assign({ "data-slot": "select-scroll-up-button", className:
|
|
52
|
+
return (_jsx(SelectPrimitive.ScrollUpButton, Object.assign({ "data-slot": "select-scroll-up-button", className: mergeClassNames("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4", className) }, props, { children: _jsx(ChevronUpIcon, {}) })));
|
|
53
53
|
}
|
|
54
54
|
function SelectScrollDownButton(params) {
|
|
55
55
|
const { className } = params, props = __rest(params, ["className"]);
|
|
56
|
-
return (_jsx(SelectPrimitive.ScrollDownButton, Object.assign({ "data-slot": "select-scroll-down-button", className:
|
|
56
|
+
return (_jsx(SelectPrimitive.ScrollDownButton, Object.assign({ "data-slot": "select-scroll-down-button", className: mergeClassNames("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4", className) }, props, { children: _jsx(ChevronDownIcon, {}) })));
|
|
57
57
|
}
|
|
58
58
|
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
export declare const Separator: import("react").ForwardRefExoticComponent<SeparatorProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Separator as SeparatorPrimitive } from 'radix-ui';
|
|
3
|
+
declare function Separator(params: React.ComponentProps<typeof SeparatorPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
export { Separator };
|
|
6
5
|
//# sourceMappingURL=separator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"separator.d.ts","sourceRoot":"","sources":["../../source/components/separator.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"separator.d.ts","sourceRoot":"","sources":["../../source/components/separator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,SAAS,IAAI,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAI1D,iBAAS,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,IAAI,CAAC,qBAc9E;AAED,OAAO,EAAE,SAAS,EAAE,CAAA"}
|
|
@@ -10,10 +10,11 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
});
|
|
19
|
-
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import { Separator as SeparatorPrimitive } from 'radix-ui';
|
|
15
|
+
import { mergeClassNames } from '../utils/merge-class-names/index.js';
|
|
16
|
+
function Separator(params) {
|
|
17
|
+
const { className, orientation = 'horizontal', decorative = true } = params, props = __rest(params, ["className", "orientation", "decorative"]);
|
|
18
|
+
return (_jsx(SeparatorPrimitive.Root, Object.assign({ "data-slot": "separator", decorative: decorative, orientation: orientation, className: mergeClassNames('bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px data-[orientation=vertical]:self-stretch', className) }, props)));
|
|
19
|
+
}
|
|
20
|
+
export { Separator };
|
|
@@ -12,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import * as React from "react";
|
|
14
14
|
import { Dialog as SheetPrimitive } from "radix-ui";
|
|
15
|
-
import {
|
|
15
|
+
import { mergeClassNames } from "../utils/merge-class-names/index.js";
|
|
16
16
|
import { Button } from "./button.js";
|
|
17
17
|
import { XIcon } from "lucide-react";
|
|
18
18
|
function Sheet(params) {
|
|
@@ -33,26 +33,26 @@ function SheetPortal(params) {
|
|
|
33
33
|
}
|
|
34
34
|
function SheetOverlay(params) {
|
|
35
35
|
const { className } = params, props = __rest(params, ["className"]);
|
|
36
|
-
return (_jsx(SheetPrimitive.Overlay, Object.assign({ "data-slot": "sheet-overlay", className:
|
|
36
|
+
return (_jsx(SheetPrimitive.Overlay, Object.assign({ "data-slot": "sheet-overlay", className: mergeClassNames("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 z-50", className) }, props)));
|
|
37
37
|
}
|
|
38
38
|
function SheetContent(params) {
|
|
39
39
|
const { className, children, side = "right", showCloseButton = true } = params, props = __rest(params, ["className", "children", "side", "showCloseButton"]);
|
|
40
|
-
return (_jsxs(SheetPortal, { children: [_jsx(SheetOverlay, {}), _jsxs(SheetPrimitive.Content, Object.assign({ "data-slot": "sheet-content", "data-side": side, className:
|
|
40
|
+
return (_jsxs(SheetPortal, { children: [_jsx(SheetOverlay, {}), _jsxs(SheetPrimitive.Content, Object.assign({ "data-slot": "sheet-content", "data-side": side, className: mergeClassNames("bg-background data-open:animate-in data-closed:animate-out data-[side=right]:data-closed:slide-out-to-right-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=top]:data-closed:slide-out-to-top-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:fade-out-0 data-open:fade-in-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=bottom]:data-open:slide-in-from-bottom-10 fixed z-50 flex flex-col gap-4 bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm", className) }, props, { children: [children, showCloseButton && (_jsx(SheetPrimitive.Close, { "data-slot": "sheet-close", asChild: true, children: _jsxs(Button, { variant: "ghost", className: "absolute top-4 right-4", size: "icon-sm", children: [_jsx(XIcon, {}), _jsx("span", { className: "sr-only", children: "Close" })] }) }))] }))] }));
|
|
41
41
|
}
|
|
42
42
|
function SheetHeader(params) {
|
|
43
43
|
const { className } = params, props = __rest(params, ["className"]);
|
|
44
|
-
return (_jsx("div", Object.assign({ "data-slot": "sheet-header", className:
|
|
44
|
+
return (_jsx("div", Object.assign({ "data-slot": "sheet-header", className: mergeClassNames("gap-1.5 p-4 flex flex-col", className) }, props)));
|
|
45
45
|
}
|
|
46
46
|
function SheetFooter(params) {
|
|
47
47
|
const { className } = params, props = __rest(params, ["className"]);
|
|
48
|
-
return (_jsx("div", Object.assign({ "data-slot": "sheet-footer", className:
|
|
48
|
+
return (_jsx("div", Object.assign({ "data-slot": "sheet-footer", className: mergeClassNames("gap-2 p-4 mt-auto flex flex-col", className) }, props)));
|
|
49
49
|
}
|
|
50
50
|
function SheetTitle(params) {
|
|
51
51
|
const { className } = params, props = __rest(params, ["className"]);
|
|
52
|
-
return (_jsx(SheetPrimitive.Title, Object.assign({ "data-slot": "sheet-title", className:
|
|
52
|
+
return (_jsx(SheetPrimitive.Title, Object.assign({ "data-slot": "sheet-title", className: mergeClassNames("text-foreground font-medium", className) }, props)));
|
|
53
53
|
}
|
|
54
54
|
function SheetDescription(params) {
|
|
55
55
|
const { className } = params, props = __rest(params, ["className"]);
|
|
56
|
-
return (_jsx(SheetPrimitive.Description, Object.assign({ "data-slot": "sheet-description", className:
|
|
56
|
+
return (_jsx(SheetPrimitive.Description, Object.assign({ "data-slot": "sheet-description", className: mergeClassNames("text-muted-foreground text-sm", className) }, props)));
|
|
57
57
|
}
|
|
58
58
|
export { Sheet, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { Button } from './button.js';
|
|
4
|
+
import { Input } from './input.js';
|
|
5
|
+
import { Separator } from './separator.js';
|
|
6
|
+
import { TooltipContent } from './tooltip.js';
|
|
7
|
+
type SidebarGroupActionParams = {
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
};
|
|
10
|
+
type SidebarGroupLabelParams = {
|
|
11
|
+
asChild?: boolean;
|
|
12
|
+
};
|
|
13
|
+
type SidebarMenuActionParams = {
|
|
14
|
+
asChild?: boolean;
|
|
15
|
+
showOnHover?: boolean;
|
|
16
|
+
};
|
|
17
|
+
type SidebarMenuButtonParams = {
|
|
18
|
+
asChild?: boolean;
|
|
19
|
+
isActive?: boolean;
|
|
20
|
+
tooltip?: string | React.ComponentProps<typeof TooltipContent>;
|
|
21
|
+
};
|
|
22
|
+
type SidebarMenuSkeletonParams = {
|
|
23
|
+
showIcon?: boolean;
|
|
24
|
+
};
|
|
25
|
+
type SidebarMenuSubButtonParams = {
|
|
26
|
+
asChild?: boolean;
|
|
27
|
+
size?: 'sm' | 'md';
|
|
28
|
+
isActive?: boolean;
|
|
29
|
+
};
|
|
30
|
+
type SidebarParams = {
|
|
31
|
+
side?: 'left' | 'right';
|
|
32
|
+
variant?: 'sidebar' | 'floating' | 'inset';
|
|
33
|
+
collapsible?: 'offcanvas' | 'icon' | 'none';
|
|
34
|
+
};
|
|
35
|
+
type SidebarProviderParams = {
|
|
36
|
+
defaultOpen?: boolean;
|
|
37
|
+
open?: boolean;
|
|
38
|
+
onOpenChange?: (open: boolean) => void;
|
|
39
|
+
};
|
|
40
|
+
type SidebarContextProps = {
|
|
41
|
+
state: 'expanded' | 'collapsed';
|
|
42
|
+
open: boolean;
|
|
43
|
+
setOpen: (open: boolean) => void;
|
|
44
|
+
openMobile: boolean;
|
|
45
|
+
setOpenMobile: (open: boolean) => void;
|
|
46
|
+
isMobile: boolean;
|
|
47
|
+
toggleSidebar: () => void;
|
|
48
|
+
};
|
|
49
|
+
declare function useSidebar(): SidebarContextProps;
|
|
50
|
+
declare function SidebarProvider(params: React.ComponentProps<'div'> & SidebarProviderParams): React.JSX.Element;
|
|
51
|
+
declare function Sidebar(params: React.ComponentProps<'div'> & SidebarParams): React.JSX.Element;
|
|
52
|
+
declare function SidebarTrigger(params: React.ComponentProps<typeof Button>): React.JSX.Element;
|
|
53
|
+
declare function SidebarRail(params: React.ComponentProps<'button'>): React.JSX.Element;
|
|
54
|
+
declare function SidebarInset(params: React.ComponentProps<'main'>): React.JSX.Element;
|
|
55
|
+
declare function SidebarInput(params: React.ComponentProps<typeof Input>): React.JSX.Element;
|
|
56
|
+
declare function SidebarHeader(params: React.ComponentProps<'div'>): React.JSX.Element;
|
|
57
|
+
declare function SidebarFooter(params: React.ComponentProps<'div'>): React.JSX.Element;
|
|
58
|
+
declare function SidebarSeparator(params: React.ComponentProps<typeof Separator>): React.JSX.Element;
|
|
59
|
+
declare function SidebarContent(params: React.ComponentProps<'div'>): React.JSX.Element;
|
|
60
|
+
declare function SidebarGroup(params: React.ComponentProps<'div'>): React.JSX.Element;
|
|
61
|
+
declare function SidebarGroupLabel(params: React.ComponentProps<'div'> & SidebarGroupLabelParams): React.JSX.Element;
|
|
62
|
+
declare function SidebarGroupAction(params: React.ComponentProps<'button'> & SidebarGroupActionParams): React.JSX.Element;
|
|
63
|
+
declare function SidebarGroupContent(params: React.ComponentProps<'div'>): React.JSX.Element;
|
|
64
|
+
declare function SidebarMenu(params: React.ComponentProps<'ul'>): React.JSX.Element;
|
|
65
|
+
declare function SidebarMenuItem(params: React.ComponentProps<'li'>): React.JSX.Element;
|
|
66
|
+
declare const sidebarMenuButtonVariants: (props?: ({
|
|
67
|
+
variant?: "default" | "outline" | null | undefined;
|
|
68
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
69
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
70
|
+
declare function SidebarMenuButton(params: React.ComponentProps<'button'> & SidebarMenuButtonParams & VariantProps<typeof sidebarMenuButtonVariants>): React.JSX.Element;
|
|
71
|
+
declare function SidebarMenuAction(params: React.ComponentProps<'button'> & SidebarMenuActionParams): React.JSX.Element;
|
|
72
|
+
declare function SidebarMenuBadge(params: React.ComponentProps<'div'>): React.JSX.Element;
|
|
73
|
+
declare function SidebarMenuSkeleton(params: React.ComponentProps<'div'> & SidebarMenuSkeletonParams): React.JSX.Element;
|
|
74
|
+
declare function SidebarMenuSub(params: React.ComponentProps<'ul'>): React.JSX.Element;
|
|
75
|
+
declare function SidebarMenuSubItem(params: React.ComponentProps<'li'>): React.JSX.Element;
|
|
76
|
+
declare function SidebarMenuSubButton(params: React.ComponentProps<'a'> & SidebarMenuSubButtonParams): React.JSX.Element;
|
|
77
|
+
export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar, };
|
|
78
|
+
//# sourceMappingURL=sidebar.d.ts.map
|