art-bd-ui 1.0.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/README.md +1 -0
- package/dist/cjs/components/buttons/button/button.js +43 -0
- package/dist/cjs/components/buttons/icon-button/icon-button.js +33 -0
- package/dist/cjs/components/buttons/toggle/toggle.js +34 -0
- package/dist/cjs/components/buttons/toggle-group/toggle-group.js +31 -0
- package/dist/cjs/components/forms/checkbox/checkbox.js +52 -0
- package/dist/cjs/components/forms/input/input.js +38 -0
- package/dist/cjs/components/forms/label/label.js +38 -0
- package/dist/cjs/components/forms/radio/radio.js +22 -0
- package/dist/cjs/components/forms/select/select.js +72 -0
- package/dist/cjs/components/forms/switch/switch.js +51 -0
- package/dist/cjs/components/forms/textarea/textarea.js +37 -0
- package/dist/cjs/components/layout/box/box.js +19 -0
- package/dist/cjs/components/layout/flex/flex.js +14 -0
- package/dist/cjs/components/layout/grid/grid.js +14 -0
- package/dist/cjs/components/media/aspect-ratio/aspect-ratio.js +31 -0
- package/dist/cjs/components/media/avatar/avatar.js +27 -0
- package/dist/cjs/components/media/icon/icon.js +27 -0
- package/dist/cjs/components/popovers/dialog/dialog.js +69 -0
- package/dist/cjs/components/popovers/drawer/drawer.js +82 -0
- package/dist/cjs/components/popovers/popover/popover.js +66 -0
- package/dist/cjs/components/popovers/sheet/sheet.js +94 -0
- package/dist/cjs/components/popovers/toast/toast.js +75 -0
- package/dist/cjs/components/popovers/tooltip/tooltip.js +45 -0
- package/dist/cjs/components/typography/heading/heading.js +55 -0
- package/dist/cjs/components/typography/text/text.js +57 -0
- package/dist/cjs/components/ui/alert/alert.js +34 -0
- package/dist/cjs/components/ui/badge/badge.js +31 -0
- package/dist/cjs/components/ui/button/button.js +42 -0
- package/dist/cjs/components/ui/calendar/calendar.js +24 -0
- package/dist/cjs/components/ui/command/command.js +83 -0
- package/dist/cjs/components/ui/data-table/components/cell.js +24 -0
- package/dist/cjs/components/ui/data-table/components/column-group.js +45 -0
- package/dist/cjs/components/ui/data-table/components/table-body.js +47 -0
- package/dist/cjs/components/ui/data-table/components/table-fallback.js +28 -0
- package/dist/cjs/components/ui/data-table/components/table-head.js +56 -0
- package/dist/cjs/components/ui/data-table/components/table-placeholder.js +18 -0
- package/dist/cjs/components/ui/data-table/data-table.js +97 -0
- package/dist/cjs/components/ui/data-table/hooks/contextHooks.js +75 -0
- package/dist/cjs/components/ui/data-table/hooks/useStickyColumns.js +98 -0
- package/dist/cjs/components/ui/data-table/utils.js +26 -0
- package/dist/cjs/components/ui/date-picker/date-picker.js +15 -0
- package/dist/cjs/components/ui/dropdown-menu/dropdown-menu.js +100 -0
- package/dist/cjs/components/ui/icon/icon.js +27 -0
- package/dist/cjs/components/ui/link/link.js +32 -0
- package/dist/cjs/components/ui/pagination/pagination.js +51 -0
- package/dist/cjs/components/ui/progress/progress.js +13 -0
- package/dist/cjs/components/ui/sidebar/sidebar.js +331 -0
- package/dist/cjs/components/ui/table/components/cell.js +30 -0
- package/dist/cjs/components/ui/table/components/row.js +25 -0
- package/dist/cjs/components/ui/table/components/table-body.js +13 -0
- package/dist/cjs/components/ui/table/components/table-caption.js +13 -0
- package/dist/cjs/components/ui/table/components/table-footer.js +13 -0
- package/dist/cjs/components/ui/table/components/table-head.js +30 -0
- package/dist/cjs/components/ui/table/components/table-header.js +13 -0
- package/dist/cjs/components/ui/table/table.js +36 -0
- package/dist/cjs/components/ui/tabs/tabs.js +47 -0
- package/dist/cjs/components/utility/empty-state/empty-state.js +29 -0
- package/dist/cjs/components/utility/separator/separator.js +14 -0
- package/dist/cjs/components/utility/skeleton/skeleton.js +13 -0
- package/dist/cjs/components/utility/status-controller/status-controller.js +12 -0
- package/dist/cjs/hooks/use-mobile.js +21 -0
- package/dist/cjs/hooks/useControlled.js +19 -0
- package/dist/cjs/hooks/useFirstMountState.js +16 -0
- package/dist/cjs/hooks/useForkRef.js +23 -0
- package/dist/cjs/hooks/useLatest.js +12 -0
- package/dist/cjs/hooks/usePrevious.js +14 -0
- package/dist/cjs/hooks/useScrollState.js +39 -0
- package/dist/cjs/hooks/useStateRef.js +12 -0
- package/dist/cjs/hooks/useUpdateEffect.js +17 -0
- package/dist/cjs/index.js +237 -0
- package/dist/cjs/lib/utils.js +16 -0
- package/dist/cjs/styles/responsive.js +84 -0
- package/dist/cjs/styles/typography.js +25 -0
- package/dist/cjs/utils/addIf.js +5 -0
- package/dist/cjs/utils/chain.js +30 -0
- package/dist/cjs/utils/getBoundingRect.js +19 -0
- package/dist/cjs/utils/mergeProps.js +42 -0
- package/dist/cjs/utils/mergeRefs.js +18 -0
- package/dist/cjs/utils/toggle.js +16 -0
- package/dist/esm/components/buttons/button/button.js +40 -0
- package/dist/esm/components/buttons/icon-button/icon-button.js +31 -0
- package/dist/esm/components/buttons/toggle/toggle.js +31 -0
- package/dist/esm/components/buttons/toggle-group/toggle-group.js +28 -0
- package/dist/esm/components/forms/checkbox/checkbox.js +50 -0
- package/dist/esm/components/forms/input/input.js +36 -0
- package/dist/esm/components/forms/label/label.js +36 -0
- package/dist/esm/components/forms/radio/radio.js +19 -0
- package/dist/esm/components/forms/select/select.js +61 -0
- package/dist/esm/components/forms/switch/switch.js +49 -0
- package/dist/esm/components/forms/textarea/textarea.js +35 -0
- package/dist/esm/components/layout/box/box.js +17 -0
- package/dist/esm/components/layout/flex/flex.js +12 -0
- package/dist/esm/components/layout/grid/grid.js +12 -0
- package/dist/esm/components/media/aspect-ratio/aspect-ratio.js +10 -0
- package/dist/esm/components/media/avatar/avatar.js +23 -0
- package/dist/esm/components/media/icon/icon.js +25 -0
- package/dist/esm/components/popovers/dialog/dialog.js +60 -0
- package/dist/esm/components/popovers/drawer/drawer.js +74 -0
- package/dist/esm/components/popovers/popover/popover.js +61 -0
- package/dist/esm/components/popovers/sheet/sheet.js +86 -0
- package/dist/esm/components/popovers/toast/toast.js +67 -0
- package/dist/esm/components/popovers/tooltip/tooltip.js +40 -0
- package/dist/esm/components/typography/heading/heading.js +53 -0
- package/dist/esm/components/typography/text/text.js +55 -0
- package/dist/esm/components/ui/alert/alert.js +30 -0
- package/dist/esm/components/ui/badge/badge.js +28 -0
- package/dist/esm/components/ui/button/button.js +40 -0
- package/dist/esm/components/ui/calendar/calendar.js +22 -0
- package/dist/esm/components/ui/command/command.js +73 -0
- package/dist/esm/components/ui/data-table/components/cell.js +22 -0
- package/dist/esm/components/ui/data-table/components/column-group.js +43 -0
- package/dist/esm/components/ui/data-table/components/table-body.js +45 -0
- package/dist/esm/components/ui/data-table/components/table-fallback.js +26 -0
- package/dist/esm/components/ui/data-table/components/table-head.js +54 -0
- package/dist/esm/components/ui/data-table/components/table-placeholder.js +16 -0
- package/dist/esm/components/ui/data-table/data-table.js +95 -0
- package/dist/esm/components/ui/data-table/hooks/contextHooks.js +60 -0
- package/dist/esm/components/ui/data-table/hooks/useStickyColumns.js +96 -0
- package/dist/esm/components/ui/data-table/utils.js +22 -0
- package/dist/esm/components/ui/date-picker/date-picker.js +13 -0
- package/dist/esm/components/ui/dropdown-menu/dropdown-menu.js +84 -0
- package/dist/esm/components/ui/icon/icon.js +25 -0
- package/dist/esm/components/ui/link/link.js +30 -0
- package/dist/esm/components/ui/pagination/pagination.js +43 -0
- package/dist/esm/components/ui/progress/progress.js +11 -0
- package/dist/esm/components/ui/sidebar/sidebar.js +306 -0
- package/dist/esm/components/ui/table/components/cell.js +28 -0
- package/dist/esm/components/ui/table/components/row.js +23 -0
- package/dist/esm/components/ui/table/components/table-body.js +11 -0
- package/dist/esm/components/ui/table/components/table-caption.js +11 -0
- package/dist/esm/components/ui/table/components/table-footer.js +11 -0
- package/dist/esm/components/ui/table/components/table-head.js +28 -0
- package/dist/esm/components/ui/table/components/table-header.js +11 -0
- package/dist/esm/components/ui/table/table.js +26 -0
- package/dist/esm/components/ui/tabs/tabs.js +23 -0
- package/dist/esm/components/utility/empty-state/empty-state.js +27 -0
- package/dist/esm/components/utility/separator/separator.js +12 -0
- package/dist/esm/components/utility/skeleton/skeleton.js +11 -0
- package/dist/esm/components/utility/status-controller/status-controller.js +10 -0
- package/dist/esm/hooks/use-mobile.js +19 -0
- package/dist/esm/hooks/useControlled.js +17 -0
- package/dist/esm/hooks/useFirstMountState.js +14 -0
- package/dist/esm/hooks/useForkRef.js +21 -0
- package/dist/esm/hooks/useLatest.js +10 -0
- package/dist/esm/hooks/usePrevious.js +12 -0
- package/dist/esm/hooks/useScrollState.js +37 -0
- package/dist/esm/hooks/useStateRef.js +10 -0
- package/dist/esm/hooks/useUpdateEffect.js +15 -0
- package/dist/esm/index.js +63 -0
- package/dist/esm/lib/utils.js +13 -0
- package/dist/esm/styles/responsive.js +81 -0
- package/dist/esm/styles/typography.js +21 -0
- package/dist/esm/utils/addIf.js +3 -0
- package/dist/esm/utils/chain.js +28 -0
- package/dist/esm/utils/getBoundingRect.js +16 -0
- package/dist/esm/utils/mergeProps.js +40 -0
- package/dist/esm/utils/mergeRefs.js +15 -0
- package/dist/esm/utils/toggle.js +14 -0
- package/dist/styles.css +1 -0
- package/dist/types/index.d.ts +1418 -0
- package/package.json +114 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const removeAtIndex = (arr, index) => {
|
|
4
|
+
const copy = [...arr];
|
|
5
|
+
copy.splice(index, 1);
|
|
6
|
+
return copy;
|
|
7
|
+
};
|
|
8
|
+
const toggle = (arr, item, getValue = (item) => item) => {
|
|
9
|
+
const index = arr.findIndex((i) => getValue(i) === getValue(item));
|
|
10
|
+
if (index === -1)
|
|
11
|
+
return [...arr, item];
|
|
12
|
+
else
|
|
13
|
+
return removeAtIndex(arr, index);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
exports.toggle = toggle;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { __rest } from 'tslib';
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { Slot, Slottable } from '@radix-ui/react-slot';
|
|
5
|
+
import { cva } from 'class-variance-authority';
|
|
6
|
+
import { cn } from '../../../lib/utils.js';
|
|
7
|
+
import { Icon } from '../../media/icon/icon.js';
|
|
8
|
+
|
|
9
|
+
const buttonVariants = cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", {
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
|
|
13
|
+
destructive: "bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
14
|
+
outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
15
|
+
secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
|
|
16
|
+
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
17
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
18
|
+
},
|
|
19
|
+
size: {
|
|
20
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
21
|
+
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
22
|
+
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
23
|
+
icon: "size-9",
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
variant: "default",
|
|
28
|
+
size: "default",
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
const Button = forwardRef((_a, ref) => {
|
|
32
|
+
var { className, variant, size, asChild = false, loading, children, leftIcon, rightIcon } = _a, props = __rest(_a, ["className", "variant", "size", "asChild", "loading", "children", "leftIcon", "rightIcon"]);
|
|
33
|
+
const Comp = asChild ? Slot : "button";
|
|
34
|
+
const leftElement = loading ? (jsx(Icon, { name: "loader-2", className: "animate-spin" })) : (leftIcon && jsx(Icon, { name: leftIcon }));
|
|
35
|
+
const rightElement = rightIcon && jsx(Icon, { name: rightIcon });
|
|
36
|
+
return (jsxs(Comp, Object.assign({ ref: ref, "data-slot": "button", className: cn(buttonVariants({ variant, size }), className) }, props, { children: [leftElement, jsx(Slottable, { children: children }), rightElement] })));
|
|
37
|
+
});
|
|
38
|
+
Button.displayName = "Button";
|
|
39
|
+
|
|
40
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { __rest } from 'tslib';
|
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { forwardRef } from 'react';
|
|
5
|
+
import { cva } from 'class-variance-authority';
|
|
6
|
+
import { cn } from '../../../lib/utils.js';
|
|
7
|
+
import { Icon } from '../../media/icon/icon.js';
|
|
8
|
+
import { Button } from '../button/button.js';
|
|
9
|
+
import { Tooltip, TooltipTrigger, TooltipContent } from '../../popovers/tooltip/tooltip.js';
|
|
10
|
+
|
|
11
|
+
const iconButtonVariants = cva("", {
|
|
12
|
+
variants: {
|
|
13
|
+
radius: {
|
|
14
|
+
none: "rounded-none",
|
|
15
|
+
small: "rounded-sm",
|
|
16
|
+
medium: "rounded-md",
|
|
17
|
+
large: "rounded-lg",
|
|
18
|
+
full: "rounded-full",
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
defaultVariants: {
|
|
22
|
+
radius: "medium",
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
const IconButton = forwardRef((_a, ref) => {
|
|
26
|
+
var { className, variant, radius, loading, icon, tooltip } = _a, props = __rest(_a, ["className", "variant", "radius", "loading", "icon", "tooltip"]);
|
|
27
|
+
return (jsxs(Tooltip, { children: [jsx(TooltipTrigger, { asChild: true, children: jsx(Button, Object.assign({ ref: ref, "data-slot": "icon-button", variant: variant, size: "icon", loading: loading, className: cn(iconButtonVariants({ radius }), className) }, props, { children: !loading && jsx(Icon, { name: icon }) })) }), jsx(TooltipContent, { sideOffset: 0, arrow: true, children: tooltip })] }));
|
|
28
|
+
});
|
|
29
|
+
IconButton.displayName = "IconButton";
|
|
30
|
+
|
|
31
|
+
export { IconButton };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { __rest } from 'tslib';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { Root } from '@radix-ui/react-toggle';
|
|
5
|
+
import { cva } from 'class-variance-authority';
|
|
6
|
+
import { cn } from '../../../lib/utils.js';
|
|
7
|
+
|
|
8
|
+
const toggleVariants = cva("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap", {
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default: "bg-transparent",
|
|
12
|
+
outline: "border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground",
|
|
13
|
+
},
|
|
14
|
+
size: {
|
|
15
|
+
default: "h-9 px-2 min-w-9",
|
|
16
|
+
sm: "h-8 px-1.5 min-w-8",
|
|
17
|
+
lg: "h-10 px-2.5 min-w-10",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
defaultVariants: {
|
|
21
|
+
variant: "default",
|
|
22
|
+
size: "default",
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
const Toggle = (_a) => {
|
|
26
|
+
var { className, variant, size } = _a, props = __rest(_a, ["className", "variant", "size"]);
|
|
27
|
+
return jsx(Root, Object.assign({ "data-slot": "toggle", className: cn(toggleVariants({ variant, size }), className) }, props));
|
|
28
|
+
};
|
|
29
|
+
Toggle.displayName = "Toggle";
|
|
30
|
+
|
|
31
|
+
export { Toggle, toggleVariants };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { __rest } from 'tslib';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { createContext, useContext } from 'react';
|
|
5
|
+
import { Root, Item } from '@radix-ui/react-toggle-group';
|
|
6
|
+
import { cn } from '../../../lib/utils.js';
|
|
7
|
+
import { toggleVariants } from '../toggle/toggle.js';
|
|
8
|
+
|
|
9
|
+
const ToggleGroupContext = createContext({
|
|
10
|
+
size: "default",
|
|
11
|
+
variant: "default",
|
|
12
|
+
});
|
|
13
|
+
const ToggleGroup = (_a) => {
|
|
14
|
+
var { className, variant, size, children } = _a, props = __rest(_a, ["className", "variant", "size", "children"]);
|
|
15
|
+
return (jsx(Root, Object.assign({ "data-slot": "toggle-group", "data-variant": variant, "data-size": size, className: cn("group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs", className) }, props, { children: jsx(ToggleGroupContext.Provider, { value: { variant, size }, children: children }) })));
|
|
16
|
+
};
|
|
17
|
+
ToggleGroup.displayName = "ToggleGroup";
|
|
18
|
+
const ToggleGroupItem = (_a) => {
|
|
19
|
+
var { className, children, variant, size } = _a, props = __rest(_a, ["className", "children", "variant", "size"]);
|
|
20
|
+
const context = useContext(ToggleGroupContext);
|
|
21
|
+
return (jsx(Item, Object.assign({ "data-slot": "toggle-group-item", "data-variant": context.variant || variant, "data-size": context.size || size, className: cn(toggleVariants({
|
|
22
|
+
variant: context.variant || variant,
|
|
23
|
+
size: context.size || size,
|
|
24
|
+
}), "min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md", "focus:z-10 focus-visible:z-10", "data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l", className) }, props, { children: children })));
|
|
25
|
+
};
|
|
26
|
+
ToggleGroupItem.displayName = "ToggleGroupItem";
|
|
27
|
+
|
|
28
|
+
export { ToggleGroup, ToggleGroupItem };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { __rest } from 'tslib';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { Root, Indicator } from '@radix-ui/react-checkbox';
|
|
5
|
+
import { cva } from 'class-variance-authority';
|
|
6
|
+
import { cn } from '../../../lib/utils.js';
|
|
7
|
+
import { Icon } from '../../media/icon/icon.js';
|
|
8
|
+
|
|
9
|
+
const checkboxVariants = cva([
|
|
10
|
+
"peer shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none",
|
|
11
|
+
"border-input dark:bg-input/30",
|
|
12
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
13
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
14
|
+
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
15
|
+
], {
|
|
16
|
+
variants: {
|
|
17
|
+
size: {
|
|
18
|
+
default: "size-4",
|
|
19
|
+
sm: "size-3.5",
|
|
20
|
+
lg: "size-5",
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
defaultVariants: {
|
|
24
|
+
size: "default",
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
const checkboxIndicatorVariants = cva(["flex items-center justify-center text-current transition-none"], {
|
|
28
|
+
variants: {
|
|
29
|
+
size: {
|
|
30
|
+
default: "size-3.5",
|
|
31
|
+
sm: "size-3",
|
|
32
|
+
lg: "size-4",
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
defaultVariants: {
|
|
36
|
+
size: "default",
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
const Checkbox = forwardRef((_a, ref) => {
|
|
40
|
+
var { className, checked, indeterminate = false, size } = _a, props = __rest(_a, ["className", "checked", "indeterminate", "size"]);
|
|
41
|
+
return (jsx(Root, Object.assign({ ref: ref, "data-slot": "checkbox", checked: checked, className: cn(checkboxVariants({ size }), [
|
|
42
|
+
"data-[state=checked]:bg-primary",
|
|
43
|
+
"data-[state=checked]:text-primary-foreground",
|
|
44
|
+
"dark:data-[state=checked]:bg-primary",
|
|
45
|
+
"data-[state=checked]:border-primary",
|
|
46
|
+
], className) }, props, { children: jsx(Indicator, { "data-slot": "checkbox-indicator", className: cn(checkboxIndicatorVariants({ size })), children: indeterminate ? (jsx(Icon, { name: "minus", size: 16 })) : (checked && jsx(Icon, { name: "check", size: 16, className: cn(checkboxIndicatorVariants({ size })) })) }) })));
|
|
47
|
+
});
|
|
48
|
+
Checkbox.displayName = "Checkbox";
|
|
49
|
+
|
|
50
|
+
export { Checkbox };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { __rest } from 'tslib';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { cva } from 'class-variance-authority';
|
|
5
|
+
import { cn } from '../../../lib/utils.js';
|
|
6
|
+
|
|
7
|
+
const inputVariants = cva([
|
|
8
|
+
"flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs",
|
|
9
|
+
"transition-[color,box-shadow] outline-none",
|
|
10
|
+
"border-input dark:bg-input/30",
|
|
11
|
+
"placeholder:text-muted-foreground",
|
|
12
|
+
"selection:bg-primary selection:text-primary-foreground",
|
|
13
|
+
"disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
14
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
15
|
+
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
16
|
+
"file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground",
|
|
17
|
+
"md:text-sm",
|
|
18
|
+
], {
|
|
19
|
+
variants: {
|
|
20
|
+
size: {
|
|
21
|
+
default: "h-9 px-3 py-1",
|
|
22
|
+
sm: "h-8 px-2.5 py-0.5 text-sm",
|
|
23
|
+
lg: "h-10 px-4 py-2 text-base",
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
size: "default",
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
const Input = forwardRef((_a, ref) => {
|
|
31
|
+
var { className, type, size } = _a, props = __rest(_a, ["className", "type", "size"]);
|
|
32
|
+
return (jsx("input", Object.assign({ ref: ref, type: type, "data-slot": "input", className: cn(inputVariants({ size }), className) }, props)));
|
|
33
|
+
});
|
|
34
|
+
Input.displayName = "Input";
|
|
35
|
+
|
|
36
|
+
export { Input };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { __rest } from 'tslib';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { Root } from '@radix-ui/react-label';
|
|
5
|
+
import { cva } from 'class-variance-authority';
|
|
6
|
+
import { cn } from '../../../lib/utils.js';
|
|
7
|
+
|
|
8
|
+
const labelVariants = cva([
|
|
9
|
+
"flex items-center gap-2 text-sm leading-none font-medium select-none",
|
|
10
|
+
"group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50",
|
|
11
|
+
"peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
|
|
12
|
+
], {
|
|
13
|
+
variants: {
|
|
14
|
+
size: {
|
|
15
|
+
default: "text-sm",
|
|
16
|
+
sm: "text-xs",
|
|
17
|
+
lg: "text-base",
|
|
18
|
+
},
|
|
19
|
+
weight: {
|
|
20
|
+
default: "font-medium",
|
|
21
|
+
light: "font-normal",
|
|
22
|
+
bold: "font-semibold",
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
defaultVariants: {
|
|
26
|
+
size: "default",
|
|
27
|
+
weight: "default",
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
const Label = forwardRef((_a, ref) => {
|
|
31
|
+
var { className, size, weight } = _a, props = __rest(_a, ["className", "size", "weight"]);
|
|
32
|
+
return jsx(Root, Object.assign({ ref: ref, "data-slot": "label", className: cn(labelVariants({ size, weight }), className) }, props));
|
|
33
|
+
});
|
|
34
|
+
Label.displayName = "Label";
|
|
35
|
+
|
|
36
|
+
export { Label };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { __rest } from 'tslib';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { Root, Item, Indicator } from '@radix-ui/react-radio-group';
|
|
5
|
+
import { cn } from '../../../lib/utils.js';
|
|
6
|
+
import { Icon } from '../../media/icon/icon.js';
|
|
7
|
+
|
|
8
|
+
const RadioGroup = (_a) => {
|
|
9
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
10
|
+
return jsx(Root, Object.assign({ "data-slot": "radio-group", className: cn("grid gap-3", className) }, props));
|
|
11
|
+
};
|
|
12
|
+
RadioGroup.displayName = "RadioGroup";
|
|
13
|
+
const RadioGroupItem = (_a) => {
|
|
14
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
15
|
+
return (jsx(Item, Object.assign({ "data-slot": "radio-group-item", className: cn("border-input text-primary 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:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50", className) }, props, { children: jsx(Indicator, { "data-slot": "radio-group-indicator", className: "relative flex items-center justify-center", children: jsx(Icon, { name: "circle", className: "fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2" }) }) })));
|
|
16
|
+
};
|
|
17
|
+
RadioGroupItem.displayName = "RadioGroupItem";
|
|
18
|
+
|
|
19
|
+
export { RadioGroup, RadioGroupItem };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { __rest } from 'tslib';
|
|
3
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
|
+
import { Root, Portal, Content, Viewport, Group, Item, ItemIndicator, ItemText, Label, ScrollDownButton, ScrollUpButton, Separator, Trigger, Icon as Icon$1, Value } from '@radix-ui/react-select';
|
|
5
|
+
import { cn } from '../../../lib/utils.js';
|
|
6
|
+
import { Icon } from '../../media/icon/icon.js';
|
|
7
|
+
|
|
8
|
+
const Select = (_a) => {
|
|
9
|
+
var props = __rest(_a, []);
|
|
10
|
+
return jsx(Root, Object.assign({ "data-slot": "select" }, props));
|
|
11
|
+
};
|
|
12
|
+
Select.displayName = "Select";
|
|
13
|
+
const SelectGroup = (_a) => {
|
|
14
|
+
var props = __rest(_a, []);
|
|
15
|
+
return jsx(Group, Object.assign({ "data-slot": "select-group" }, props));
|
|
16
|
+
};
|
|
17
|
+
SelectGroup.displayName = "SelectGroup";
|
|
18
|
+
const SelectValue = (_a) => {
|
|
19
|
+
var props = __rest(_a, []);
|
|
20
|
+
return jsx(Value, Object.assign({ "data-slot": "select-value" }, props));
|
|
21
|
+
};
|
|
22
|
+
SelectValue.displayName = "SelectValue";
|
|
23
|
+
const SelectTrigger = (_a) => {
|
|
24
|
+
var { className, size = "default", children } = _a, props = __rest(_a, ["className", "size", "children"]);
|
|
25
|
+
return (jsxs(Trigger, Object.assign({ "data-slot": "select-trigger", "data-size": size, className: cn("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground 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:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 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-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className) }, props, { children: [children, jsx(Icon$1, { asChild: true, children: jsx(Icon, { name: "chevron-down", className: "size-4 opacity-50" }) })] })));
|
|
26
|
+
};
|
|
27
|
+
SelectTrigger.displayName = "SelectTrigger";
|
|
28
|
+
const SelectScrollUpButton = (_a) => {
|
|
29
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
30
|
+
return (jsx(ScrollUpButton, Object.assign({ "data-slot": "select-scroll-up-button", className: cn("flex cursor-default items-center justify-center py-1", className) }, props, { children: jsx(Icon, { name: "chevron-up", className: "size-4" }) })));
|
|
31
|
+
};
|
|
32
|
+
SelectScrollUpButton.displayName = "SelectScrollUpButton";
|
|
33
|
+
const SelectScrollDownButton = (_a) => {
|
|
34
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
35
|
+
return (jsx(ScrollDownButton, Object.assign({ "data-slot": "select-scroll-down-button", className: cn("flex cursor-default items-center justify-center py-1", className) }, props, { children: jsx(Icon, { name: "chevron-down", className: "size-4" }) })));
|
|
36
|
+
};
|
|
37
|
+
SelectScrollDownButton.displayName = "SelectScrollDownButton";
|
|
38
|
+
const SelectContent = (_a) => {
|
|
39
|
+
var { className, children, position = "popper" } = _a, props = __rest(_a, ["className", "children", "position"]);
|
|
40
|
+
return (jsx(Portal, { children: jsxs(Content, Object.assign({ "data-slot": "select-content", className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md", position === "popper" &&
|
|
41
|
+
"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 }, props, { children: [jsx(SelectScrollUpButton, {}), jsx(Viewport, { className: cn("p-1", position === "popper" &&
|
|
42
|
+
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"), children: children }), jsx(SelectScrollDownButton, {})] })) }));
|
|
43
|
+
};
|
|
44
|
+
SelectContent.displayName = "SelectContent";
|
|
45
|
+
const SelectLabel = (_a) => {
|
|
46
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
47
|
+
return (jsx(Label, Object.assign({ "data-slot": "select-label", className: cn("text-muted-foreground px-2 py-1.5 text-xs", className) }, props)));
|
|
48
|
+
};
|
|
49
|
+
SelectLabel.displayName = "SelectLabel";
|
|
50
|
+
const SelectItem = (_a) => {
|
|
51
|
+
var { className, children } = _a, props = __rest(_a, ["className", "children"]);
|
|
52
|
+
return (jsxs(Item, Object.assign({ "data-slot": "select-item", className: cn("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground 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 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) }, props, { children: [jsx("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: jsx(ItemIndicator, { children: jsx(Icon, { name: "check", className: "size-4" }) }) }), jsx(ItemText, { children: children })] })));
|
|
53
|
+
};
|
|
54
|
+
SelectItem.displayName = "SelectItem";
|
|
55
|
+
const SelectSeparator = (_a) => {
|
|
56
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
57
|
+
return (jsx(Separator, Object.assign({ "data-slot": "select-separator", className: cn("bg-border pointer-events-none -mx-1 my-1 h-px", className) }, props)));
|
|
58
|
+
};
|
|
59
|
+
SelectSeparator.displayName = "SelectSeparator";
|
|
60
|
+
|
|
61
|
+
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { __rest } from 'tslib';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { Root, Thumb } from '@radix-ui/react-switch';
|
|
4
|
+
import { cva } from 'class-variance-authority';
|
|
5
|
+
import { cn } from '../../../lib/utils.js';
|
|
6
|
+
|
|
7
|
+
const switchVariants = cva([
|
|
8
|
+
"peer inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none",
|
|
9
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
10
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
11
|
+
"data-[state=checked]:bg-primary",
|
|
12
|
+
"data-[state=unchecked]:bg-input",
|
|
13
|
+
"dark:data-[state=unchecked]:bg-input/80",
|
|
14
|
+
], {
|
|
15
|
+
variants: {
|
|
16
|
+
size: {
|
|
17
|
+
default: "h-[1.15rem] w-8",
|
|
18
|
+
sm: "h-4 w-7",
|
|
19
|
+
lg: "h-5 w-10",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
defaultVariants: {
|
|
23
|
+
size: "default",
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
const switchThumbVariants = cva([
|
|
27
|
+
"bg-background pointer-events-none block rounded-full ring-0 transition-transform",
|
|
28
|
+
"data-[state=unchecked]:translate-x-0",
|
|
29
|
+
"dark:data-[state=checked]:bg-primary-foreground",
|
|
30
|
+
"dark:data-[state=unchecked]:bg-foreground",
|
|
31
|
+
], {
|
|
32
|
+
variants: {
|
|
33
|
+
size: {
|
|
34
|
+
default: ["size-4", "data-[state=checked]:translate-x-[calc(100%-2px)]"],
|
|
35
|
+
sm: ["size-3", "data-[state=checked]:translate-x-[calc(100%-1px)]"],
|
|
36
|
+
lg: ["size-5", "data-[state=checked]:translate-x-[calc(100%-3px)]"],
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
defaultVariants: {
|
|
40
|
+
size: "default",
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
const Switch = (_a) => {
|
|
44
|
+
var { className, thumbClassName, size } = _a, props = __rest(_a, ["className", "thumbClassName", "size"]);
|
|
45
|
+
return (jsx(Root, Object.assign({ "data-slot": "switch", className: cn(switchVariants({ size }), className) }, props, { children: jsx(Thumb, { "data-slot": "switch-thumb", className: cn(switchThumbVariants({ size }), thumbClassName) }) })));
|
|
46
|
+
};
|
|
47
|
+
Switch.displayName = "Switch";
|
|
48
|
+
|
|
49
|
+
export { Switch };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { __rest } from 'tslib';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { cva } from 'class-variance-authority';
|
|
5
|
+
import { cn } from '../../../lib/utils.js';
|
|
6
|
+
|
|
7
|
+
const textareaVariants = cva([
|
|
8
|
+
"flex w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs",
|
|
9
|
+
"min-h-16 field-sizing-content",
|
|
10
|
+
"transition-[color,box-shadow] outline-none",
|
|
11
|
+
"border-input dark:bg-input/30",
|
|
12
|
+
"placeholder:text-muted-foreground",
|
|
13
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
14
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
15
|
+
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
16
|
+
"md:text-sm",
|
|
17
|
+
], {
|
|
18
|
+
variants: {
|
|
19
|
+
size: {
|
|
20
|
+
default: "min-h-16 px-3 py-2",
|
|
21
|
+
sm: "min-h-12 px-2.5 py-1.5 text-sm",
|
|
22
|
+
lg: "min-h-20 px-4 py-3 text-base",
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
defaultVariants: {
|
|
26
|
+
size: "default",
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
const Textarea = forwardRef((_a, ref) => {
|
|
30
|
+
var { className, size } = _a, props = __rest(_a, ["className", "size"]);
|
|
31
|
+
return jsx("textarea", Object.assign({ ref: ref, "data-slot": "textarea", className: cn(textareaVariants({ size }), className) }, props));
|
|
32
|
+
});
|
|
33
|
+
Textarea.displayName = "Textarea";
|
|
34
|
+
|
|
35
|
+
export { Textarea };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { __rest } from 'tslib';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
5
|
+
import { cn } from '../../../lib/utils.js';
|
|
6
|
+
import { extractResponsiveProps, getResponsiveClass } from '../../../styles/responsive.js';
|
|
7
|
+
|
|
8
|
+
const Box = forwardRef((props, ref) => {
|
|
9
|
+
const { as: Tag = "div", asChild, className, children } = props, rest = __rest(props, ["as", "asChild", "className", "children"]);
|
|
10
|
+
const { classesProps, restProps } = extractResponsiveProps(rest);
|
|
11
|
+
const responsiveClasses = getResponsiveClass(classesProps);
|
|
12
|
+
const Comp = asChild ? Slot : Tag;
|
|
13
|
+
return (jsx(Comp, Object.assign({ ref: ref, "data-slot": "box", className: cn(responsiveClasses, className) }, restProps, { children: children })));
|
|
14
|
+
});
|
|
15
|
+
Box.displayName = "Box";
|
|
16
|
+
|
|
17
|
+
export { Box };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { __rest } from 'tslib';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { Box } from '../box/box.js';
|
|
5
|
+
|
|
6
|
+
const Flex = forwardRef((_a, ref) => {
|
|
7
|
+
var { children, inline } = _a, rest = __rest(_a, ["children", "inline"]);
|
|
8
|
+
return (jsx(Box, Object.assign({ ref: ref, "data-slot": "flex", display: inline ? "inline-flex" : "flex" }, rest, { children: children })));
|
|
9
|
+
});
|
|
10
|
+
Flex.displayName = "Flex";
|
|
11
|
+
|
|
12
|
+
export { Flex };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { __rest } from 'tslib';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { Box } from '../box/box.js';
|
|
5
|
+
|
|
6
|
+
const Grid = forwardRef((_a, ref) => {
|
|
7
|
+
var { children, inline } = _a, rest = __rest(_a, ["children", "inline"]);
|
|
8
|
+
return (jsx(Box, Object.assign({ ref: ref, "data-slot": "grid", display: inline ? "inline-grid" : "grid" }, rest, { children: children })));
|
|
9
|
+
});
|
|
10
|
+
Grid.displayName = "Grid";
|
|
11
|
+
|
|
12
|
+
export { Grid };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { __rest } from 'tslib';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import * as AspectRatioPrimitive from '@radix-ui/react-aspect-ratio';
|
|
4
|
+
|
|
5
|
+
function AspectRatio(_a) {
|
|
6
|
+
var props = __rest(_a, []);
|
|
7
|
+
return jsx(AspectRatioPrimitive.Root, Object.assign({ "data-slot": "aspect-ratio" }, props));
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { AspectRatio };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { __rest } from 'tslib';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { Root, Image, Fallback } from '@radix-ui/react-avatar';
|
|
5
|
+
import { cn } from '../../../lib/utils.js';
|
|
6
|
+
|
|
7
|
+
const Avatar = (_a) => {
|
|
8
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
9
|
+
return (jsx(Root, Object.assign({ "data-slot": "avatar", className: cn("relative flex size-8 shrink-0 overflow-hidden rounded-full", className) }, props)));
|
|
10
|
+
};
|
|
11
|
+
Avatar.displayName = "Avatar";
|
|
12
|
+
const AvatarImage = (_a) => {
|
|
13
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
14
|
+
return jsx(Image, Object.assign({ "data-slot": "avatar-image", className: cn("aspect-square size-full", className) }, props));
|
|
15
|
+
};
|
|
16
|
+
AvatarImage.displayName = "AvatarImage";
|
|
17
|
+
const AvatarFallback = (_a) => {
|
|
18
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
19
|
+
return (jsx(Fallback, Object.assign({ "data-slot": "avatar-fallback", className: cn("bg-muted flex size-full items-center justify-center rounded-full", className) }, props)));
|
|
20
|
+
};
|
|
21
|
+
AvatarFallback.displayName = "AvatarFallback";
|
|
22
|
+
|
|
23
|
+
export { Avatar, AvatarFallback, AvatarImage };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { __rest } from 'tslib';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { DynamicIcon } from 'lucide-react/dynamic';
|
|
5
|
+
import { cva } from 'class-variance-authority';
|
|
6
|
+
import { cn } from '../../../lib/utils.js';
|
|
7
|
+
|
|
8
|
+
const iconVariants = cva("", {
|
|
9
|
+
variants: {
|
|
10
|
+
disabled: {
|
|
11
|
+
true: "text-muted-foreground cursor-not-allowed",
|
|
12
|
+
false: "",
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
defaultVariants: {
|
|
16
|
+
disabled: false,
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
const Icon = forwardRef((_a, ref) => {
|
|
20
|
+
var { color, size = 24, disabled = false, className } = _a, rest = __rest(_a, ["color", "size", "disabled", "className"]);
|
|
21
|
+
return (jsx(DynamicIcon, Object.assign({ ref: ref, color: color, "aria-disabled": disabled, size: size, className: cn(iconVariants({ disabled }), className) }, rest)));
|
|
22
|
+
});
|
|
23
|
+
Icon.displayName = "Icon";
|
|
24
|
+
|
|
25
|
+
export { Icon };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { __rest } from 'tslib';
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { Root, Trigger, Close, Content, Description, Title, Portal, Overlay } from '@radix-ui/react-dialog';
|
|
4
|
+
import { cn } from '../../../lib/utils.js';
|
|
5
|
+
import { Icon } from '../../media/icon/icon.js';
|
|
6
|
+
|
|
7
|
+
const Dialog = (_a) => {
|
|
8
|
+
var props = __rest(_a, []);
|
|
9
|
+
return jsx(Root, Object.assign({ "data-slot": "dialog" }, props));
|
|
10
|
+
};
|
|
11
|
+
const DialogPortal = (_a) => {
|
|
12
|
+
var props = __rest(_a, []);
|
|
13
|
+
return jsx(Portal, Object.assign({ "data-slot": "dialog-portal" }, props));
|
|
14
|
+
};
|
|
15
|
+
const DialogTrigger = (_a) => {
|
|
16
|
+
var props = __rest(_a, []);
|
|
17
|
+
return jsx(Trigger, Object.assign({ "data-slot": "dialog-triger" }, props));
|
|
18
|
+
};
|
|
19
|
+
const DialogClose = (_a) => {
|
|
20
|
+
var props = __rest(_a, []);
|
|
21
|
+
return jsx(Close, Object.assign({ "data-slot": "dialog-close" }, props));
|
|
22
|
+
};
|
|
23
|
+
const DialogOverlay = (_a) => {
|
|
24
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
25
|
+
return (jsx(Overlay, Object.assign({ "data-slot": "dialog-overlay", className: cn("fixed inset-0 z-50 bg-black/50", [
|
|
26
|
+
"data-[state=open]:animate-in",
|
|
27
|
+
"data-[state=open]:fade-in-0",
|
|
28
|
+
"data-[state=closed]:animate-out",
|
|
29
|
+
"data-[state=closed]:fade-out-0",
|
|
30
|
+
], className) }, props)));
|
|
31
|
+
};
|
|
32
|
+
const DialogContent = (_a) => {
|
|
33
|
+
var { className, children } = _a, props = __rest(_a, ["className", "children"]);
|
|
34
|
+
return (jsxs(DialogPortal, { children: [jsx(DialogOverlay, {}), jsxs(Content, Object.assign({ "data-slot": "dialog-content", className: cn("bg-background grid gap-4 w-full max-w-[calc(100%-2rem)] rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg", "fixed top-[50%] left-[50%] translate-x-[-50%] translate-y-[-50%] z-50", [
|
|
35
|
+
"data-[state=open]:animate-in",
|
|
36
|
+
"data-[state=open]:fade-in-0",
|
|
37
|
+
"data-[state=open]:zoom-in-95",
|
|
38
|
+
"data-[state=closed]:animate-out",
|
|
39
|
+
"data-[state=closed]:fade-out-0",
|
|
40
|
+
"data-[state=closed]:zoom-out-95",
|
|
41
|
+
], className) }, props, { children: [children, jsxs(Close, { className: cn("ring-offset-background rounded-xs opacity-70 hover:opacity-100 transition-opacity disabled:pointer-events-none", "absolute top-4 right-4", "data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", "focus:ring-ring focus:ring-2 focus:ring-offset-2 focus:outline-hidden", ["[&_svg]:pointer-events-none", "[&_svg]:shrink-0", "[&_svg:not([class*='size-'])]:size-4"]), children: [jsx(Icon, { name: "x", size: 16 }), jsx("span", { className: "sr-only", children: "Close" })] })] }))] }));
|
|
42
|
+
};
|
|
43
|
+
const DialogHeader = (_a) => {
|
|
44
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
45
|
+
return (jsx("div", Object.assign({ "data-slot": "dialog-header", className: cn("flex flex-col gap-2 text-center sm:text-left", className) }, props)));
|
|
46
|
+
};
|
|
47
|
+
const DialogFooter = (_a) => {
|
|
48
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
49
|
+
return (jsx("div", Object.assign({ "data-slot": "dialog-footer", className: cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className) }, props)));
|
|
50
|
+
};
|
|
51
|
+
const DialogTitle = (_a) => {
|
|
52
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
53
|
+
return jsx(Title, Object.assign({ "data-slot": "dialog-title", className: cn("text-lg leading-none font-semibold", className) }, props));
|
|
54
|
+
};
|
|
55
|
+
const DialogDescription = (_a) => {
|
|
56
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
57
|
+
return (jsx(Description, Object.assign({ "data-slot": "dialog-description", className: cn("text-muted-foreground text-sm", className) }, props)));
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger };
|