@luanthnh/cntt-ui 0.1.8 → 0.1.9
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/package.json +5 -1
- package/.storybook/globals.d.ts +0 -1
- package/.storybook/main.ts +0 -29
- package/.storybook/preview.ts +0 -32
- package/assets/fonts/Montserrat-Black.eot +0 -0
- package/assets/fonts/Montserrat-Black.ttf +0 -0
- package/assets/fonts/Montserrat-Black.woff +0 -0
- package/assets/fonts/Montserrat-Black.woff2 +0 -0
- package/assets/fonts/Montserrat-BlackItalic.eot +0 -0
- package/assets/fonts/Montserrat-BlackItalic.ttf +0 -0
- package/assets/fonts/Montserrat-BlackItalic.woff +0 -0
- package/assets/fonts/Montserrat-BlackItalic.woff2 +0 -0
- package/assets/fonts/Montserrat-Bold.eot +0 -0
- package/assets/fonts/Montserrat-Bold.ttf +0 -0
- package/assets/fonts/Montserrat-Bold.woff +0 -0
- package/assets/fonts/Montserrat-Bold.woff2 +0 -0
- package/assets/fonts/Montserrat-BoldItalic.eot +0 -0
- package/assets/fonts/Montserrat-BoldItalic.ttf +0 -0
- package/assets/fonts/Montserrat-BoldItalic.woff +0 -0
- package/assets/fonts/Montserrat-BoldItalic.woff2 +0 -0
- package/assets/fonts/Montserrat-ExtraBold.eot +0 -0
- package/assets/fonts/Montserrat-ExtraBold.ttf +0 -0
- package/assets/fonts/Montserrat-ExtraBold.woff +0 -0
- package/assets/fonts/Montserrat-ExtraBold.woff2 +0 -0
- package/assets/fonts/Montserrat-ExtraBoldItalic.eot +0 -0
- package/assets/fonts/Montserrat-ExtraBoldItalic.ttf +0 -0
- package/assets/fonts/Montserrat-ExtraBoldItalic.woff +0 -0
- package/assets/fonts/Montserrat-ExtraBoldItalic.woff2 +0 -0
- package/assets/fonts/Montserrat-ExtraLight.eot +0 -0
- package/assets/fonts/Montserrat-ExtraLight.ttf +0 -0
- package/assets/fonts/Montserrat-ExtraLight.woff +0 -0
- package/assets/fonts/Montserrat-ExtraLight.woff2 +0 -0
- package/assets/fonts/Montserrat-ExtraLightItalic.eot +0 -0
- package/assets/fonts/Montserrat-ExtraLightItalic.ttf +0 -0
- package/assets/fonts/Montserrat-ExtraLightItalic.woff +0 -0
- package/assets/fonts/Montserrat-ExtraLightItalic.woff2 +0 -0
- package/assets/fonts/Montserrat-Italic.eot +0 -0
- package/assets/fonts/Montserrat-Italic.ttf +0 -0
- package/assets/fonts/Montserrat-Italic.woff +0 -0
- package/assets/fonts/Montserrat-Italic.woff2 +0 -0
- package/assets/fonts/Montserrat-Light.eot +0 -0
- package/assets/fonts/Montserrat-Light.ttf +0 -0
- package/assets/fonts/Montserrat-Light.woff +0 -0
- package/assets/fonts/Montserrat-Light.woff2 +0 -0
- package/assets/fonts/Montserrat-LightItalic.eot +0 -0
- package/assets/fonts/Montserrat-LightItalic.ttf +0 -0
- package/assets/fonts/Montserrat-LightItalic.woff +0 -0
- package/assets/fonts/Montserrat-LightItalic.woff2 +0 -0
- package/assets/fonts/Montserrat-Medium.eot +0 -0
- package/assets/fonts/Montserrat-Medium.ttf +0 -0
- package/assets/fonts/Montserrat-Medium.woff +0 -0
- package/assets/fonts/Montserrat-Medium.woff2 +0 -0
- package/assets/fonts/Montserrat-MediumItalic.eot +0 -0
- package/assets/fonts/Montserrat-MediumItalic.ttf +0 -0
- package/assets/fonts/Montserrat-MediumItalic.woff +0 -0
- package/assets/fonts/Montserrat-MediumItalic.woff2 +0 -0
- package/assets/fonts/Montserrat-Regular.eot +0 -0
- package/assets/fonts/Montserrat-Regular.ttf +0 -0
- package/assets/fonts/Montserrat-Regular.woff +0 -0
- package/assets/fonts/Montserrat-Regular.woff2 +0 -0
- package/assets/fonts/Montserrat-SemiBold.eot +0 -0
- package/assets/fonts/Montserrat-SemiBold.ttf +0 -0
- package/assets/fonts/Montserrat-SemiBold.woff +0 -0
- package/assets/fonts/Montserrat-SemiBold.woff2 +0 -0
- package/assets/fonts/Montserrat-SemiBoldItalic.eot +0 -0
- package/assets/fonts/Montserrat-SemiBoldItalic.ttf +0 -0
- package/assets/fonts/Montserrat-SemiBoldItalic.woff +0 -0
- package/assets/fonts/Montserrat-SemiBoldItalic.woff2 +0 -0
- package/assets/fonts/Montserrat-Thin.eot +0 -0
- package/assets/fonts/Montserrat-Thin.ttf +0 -0
- package/assets/fonts/Montserrat-Thin.woff +0 -0
- package/assets/fonts/Montserrat-Thin.woff2 +0 -0
- package/assets/fonts/Montserrat-ThinItalic.eot +0 -0
- package/assets/fonts/Montserrat-ThinItalic.ttf +0 -0
- package/assets/fonts/Montserrat-ThinItalic.woff +0 -0
- package/assets/fonts/Montserrat-ThinItalic.woff2 +0 -0
- package/assets/fonts/Montserrat-Variable.eot +0 -0
- package/assets/fonts/Montserrat-Variable.ttf +0 -0
- package/assets/fonts/Montserrat-Variable.woff +0 -0
- package/assets/fonts/Montserrat-Variable.woff2 +0 -0
- package/assets/fonts/Montserrat-VariableItalic.eot +0 -0
- package/assets/fonts/Montserrat-VariableItalic.ttf +0 -0
- package/assets/fonts/Montserrat-VariableItalic.woff +0 -0
- package/assets/fonts/Montserrat-VariableItalic.woff2 +0 -0
- package/assets/icons/arrow-left.svg +0 -1
- package/assets/icons/file.svg +0 -1
- package/assets/icons/globe.svg +0 -1
- package/assets/icons/logo-line.svg +0 -1
- package/assets/icons/next.svg +0 -1
- package/assets/icons/panel-left-expand.svg +0 -1
- package/assets/icons/placeholder.svg +0 -57
- package/assets/icons/vercel.svg +0 -1
- package/assets/icons/window.svg +0 -1
- package/assets/lotties/error-404.json +0 -19642
- package/assets/lotties/error.json +0 -2414
- package/assets/lotties/loader.json +0 -305
- package/components/Welcome.mdx +0 -74
- package/components/lenis/index.tsx +0 -48
- package/components/motion/auto-height.tsx +0 -56
- package/components/motion/cursor.tsx +0 -108
- package/components/motion/highlight.tsx +0 -605
- package/components/motion/number-ticker.tsx +0 -55
- package/components/motion/slot.tsx +0 -106
- package/components/motion/waves.tsx +0 -417
- package/components/primitives/tabs.tsx +0 -174
- package/components/ui/Accordion/index.stories.tsx +0 -39
- package/components/ui/Accordion/index.tsx +0 -170
- package/components/ui/Alert/index.stories.tsx +0 -39
- package/components/ui/Alert/index.tsx +0 -60
- package/components/ui/AlertDialog/index.stories.tsx +0 -47
- package/components/ui/AlertDialog/index.tsx +0 -172
- package/components/ui/AspectRatio/index.stories.tsx +0 -40
- package/components/ui/AspectRatio/index.tsx +0 -9
- package/components/ui/Avatar/index.stories.tsx +0 -39
- package/components/ui/Avatar/index.tsx +0 -44
- package/components/ui/Badge/index.stories.tsx +0 -64
- package/components/ui/Badge/index.tsx +0 -46
- package/components/ui/Breadcrumb/index.stories.tsx +0 -64
- package/components/ui/Breadcrumb/index.tsx +0 -102
- package/components/ui/Button/index.stories.tsx +0 -232
- package/components/ui/Button/index.tsx +0 -114
- package/components/ui/Calendar/index.stories.tsx +0 -20
- package/components/ui/Calendar/index.tsx +0 -149
- package/components/ui/Card/index.stories.tsx +0 -39
- package/components/ui/Card/index.tsx +0 -65
- package/components/ui/Carousel/index.stories.tsx +0 -37
- package/components/ui/Carousel/index.tsx +0 -242
- package/components/ui/Chart/index.stories.tsx +0 -53
- package/components/ui/Chart/index.tsx +0 -322
- package/components/ui/Checkbox/index.stories.tsx +0 -56
- package/components/ui/Checkbox/index.tsx +0 -167
- package/components/ui/CircleProcess/index.stories.tsx +0 -29
- package/components/ui/CircleProcess/index.tsx +0 -50
- package/components/ui/Collapsible/index.stories.tsx +0 -33
- package/components/ui/Collapsible/index.tsx +0 -124
- package/components/ui/Command/index.stories.tsx +0 -65
- package/components/ui/Command/index.tsx +0 -161
- package/components/ui/Container/index.stories.tsx +0 -22
- package/components/ui/Container/index.tsx +0 -30
- package/components/ui/ContextMenu/index.stories.tsx +0 -51
- package/components/ui/ContextMenu/index.tsx +0 -224
- package/components/ui/Dialog/index.stories.tsx +0 -44
- package/components/ui/Dialog/index.tsx +0 -156
- package/components/ui/Drawer/index.stories.tsx +0 -54
- package/components/ui/Drawer/index.tsx +0 -124
- package/components/ui/DropdownMenu/index.stories.tsx +0 -83
- package/components/ui/DropdownMenu/index.tsx +0 -231
- package/components/ui/Dropzone/index.stories.tsx +0 -18
- package/components/ui/Dropzone/index.tsx +0 -47
- package/components/ui/Form/date-field.tsx +0 -77
- package/components/ui/Form/index.stories.tsx +0 -67
- package/components/ui/Form/index.tsx +0 -193
- package/components/ui/Form/select-field.tsx +0 -55
- package/components/ui/Form/text-area-field.tsx +0 -37
- package/components/ui/Form/text-field.tsx +0 -72
- package/components/ui/HStack/index.stories.tsx +0 -48
- package/components/ui/HStack/index.tsx +0 -73
- package/components/ui/HoverCard/index.stories.tsx +0 -38
- package/components/ui/HoverCard/index.tsx +0 -38
- package/components/ui/Icons/index.stories.tsx +0 -27
- package/components/ui/Icons/index.tsx +0 -33
- package/components/ui/ImageWithFallback/index.stories.tsx +0 -32
- package/components/ui/ImageWithFallback/index.tsx +0 -34
- package/components/ui/Input/index.stories.tsx +0 -47
- package/components/ui/Input/index.tsx +0 -21
- package/components/ui/InputOtp/index.stories.tsx +0 -35
- package/components/ui/InputOtp/index.tsx +0 -70
- package/components/ui/Label/index.stories.tsx +0 -18
- package/components/ui/Label/index.tsx +0 -21
- package/components/ui/Marquee/index.stories.tsx +0 -71
- package/components/ui/Marquee/index.tsx +0 -65
- package/components/ui/Menubar/index.stories.tsx +0 -116
- package/components/ui/Menubar/index.tsx +0 -252
- package/components/ui/NavigationMenu/index.stories.tsx +0 -112
- package/components/ui/NavigationMenu/index.tsx +0 -185
- package/components/ui/NoData/index.stories.tsx +0 -24
- package/components/ui/NoData/index.tsx +0 -19
- package/components/ui/Pagination/index.stories.tsx +0 -53
- package/components/ui/Pagination/index.tsx +0 -114
- package/components/ui/Popover/index.stories.tsx +0 -31
- package/components/ui/Popover/index.tsx +0 -42
- package/components/ui/Progress/index.stories.tsx +0 -35
- package/components/ui/Progress/index.tsx +0 -28
- package/components/ui/RadioGroup/index.stories.tsx +0 -28
- package/components/ui/RadioGroup/index.tsx +0 -45
- package/components/ui/Resizable/index.stories.tsx +0 -44
- package/components/ui/Resizable/index.tsx +0 -54
- package/components/ui/ScrollArea/index.stories.tsx +0 -31
- package/components/ui/ScrollArea/index.tsx +0 -56
- package/components/ui/Select/index.stories.tsx +0 -64
- package/components/ui/Select/index.tsx +0 -170
- package/components/ui/Separator/index.stories.tsx +0 -31
- package/components/ui/Separator/index.tsx +0 -28
- package/components/ui/Sheet/index.stories.tsx +0 -45
- package/components/ui/Sheet/index.tsx +0 -130
- package/components/ui/Sidebar/index.stories.tsx +0 -82
- package/components/ui/Sidebar/index.tsx +0 -676
- package/components/ui/Skeleton/index.stories.tsx +0 -36
- package/components/ui/Skeleton/index.tsx +0 -13
- package/components/ui/Slider/index.stories.tsx +0 -48
- package/components/ui/Slider/index.tsx +0 -82
- package/components/ui/Slot/index.stories.tsx +0 -29
- package/components/ui/Slot/index.tsx +0 -106
- package/components/ui/Sonner/index.stories.tsx +0 -36
- package/components/ui/Sonner/index.tsx +0 -31
- package/components/ui/Switch/index.stories.tsx +0 -33
- package/components/ui/Switch/index.tsx +0 -28
- package/components/ui/Table/index.stories.tsx +0 -74
- package/components/ui/Table/index.tsx +0 -95
- package/components/ui/Tabs/index.stories.tsx +0 -38
- package/components/ui/Tabs/index.tsx +0 -78
- package/components/ui/Text/index.stories.tsx +0 -53
- package/components/ui/Text/index.tsx +0 -138
- package/components/ui/Textarea/index.stories.tsx +0 -25
- package/components/ui/Textarea/index.tsx +0 -18
- package/components/ui/Toggle/index.stories.tsx +0 -52
- package/components/ui/Toggle/index.tsx +0 -46
- package/components/ui/ToggleGroup/index.stories.tsx +0 -52
- package/components/ui/ToggleGroup/index.tsx +0 -69
- package/components/ui/Tooltip/index.stories.tsx +0 -29
- package/components/ui/Tooltip/index.tsx +0 -35
- package/components/ui/VStack/index.stories.tsx +0 -45
- package/components/ui/VStack/index.tsx +0 -69
- package/components/ui/colors.stories.tsx +0 -148
- package/eslint.config.js +0 -10
- package/hooks/index.ts +0 -3
- package/hooks/use-auto-height.tsx +0 -99
- package/hooks/use-controlled-state.tsx +0 -32
- package/hooks/use-mobile.ts +0 -19
- package/index.ts +0 -58
- package/lib/get-strict-context.ts +0 -15
- package/lib/utils.ts +0 -10
- package/scripts/generate-exports.ts +0 -32
- package/tsconfig.json +0 -12
- package/tsconfig.tsbuildinfo +0 -1
- package/tsup.config.ts +0 -11
- package/types/svg.d.ts +0 -10
- package/vercel.json +0 -5
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
5
|
-
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from 'lucide-react';
|
|
6
|
-
|
|
7
|
-
import { cn } from '@/lib/utils';
|
|
8
|
-
|
|
9
|
-
function Select({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>) {
|
|
10
|
-
return <SelectPrimitive.Root data-slot="select" {...props} />;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
function SelectGroup({ ...props }: React.ComponentProps<typeof SelectPrimitive.Group>) {
|
|
14
|
-
return <SelectPrimitive.Group data-slot="select-group" {...props} />;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>) {
|
|
18
|
-
return <SelectPrimitive.Value data-slot="select-value" {...props} />;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function SelectTrigger({
|
|
22
|
-
className,
|
|
23
|
-
size = 'default',
|
|
24
|
-
children,
|
|
25
|
-
...props
|
|
26
|
-
}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
|
|
27
|
-
size?: 'md' | 'sm' | 'default';
|
|
28
|
-
}) {
|
|
29
|
-
return (
|
|
30
|
-
<SelectPrimitive.Trigger
|
|
31
|
-
data-slot="select-trigger"
|
|
32
|
-
data-size={size}
|
|
33
|
-
className={cn(
|
|
34
|
-
"border-primary-100 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-base 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=md]:h-10 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 dark:border-gray-700 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
35
|
-
className,
|
|
36
|
-
)}
|
|
37
|
-
{...props}
|
|
38
|
-
>
|
|
39
|
-
{children}
|
|
40
|
-
<SelectPrimitive.Icon asChild>
|
|
41
|
-
<ChevronDownIcon className="size-4 opacity-50" />
|
|
42
|
-
</SelectPrimitive.Icon>
|
|
43
|
-
</SelectPrimitive.Trigger>
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function SelectContent({
|
|
48
|
-
className,
|
|
49
|
-
children,
|
|
50
|
-
position = 'popper',
|
|
51
|
-
...props
|
|
52
|
-
}: React.ComponentProps<typeof SelectPrimitive.Content>) {
|
|
53
|
-
return (
|
|
54
|
-
<SelectPrimitive.Portal>
|
|
55
|
-
<SelectPrimitive.Content
|
|
56
|
-
data-slot="select-content"
|
|
57
|
-
className={cn(
|
|
58
|
-
'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',
|
|
59
|
-
position === 'popper' &&
|
|
60
|
-
'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',
|
|
61
|
-
className,
|
|
62
|
-
)}
|
|
63
|
-
position={position}
|
|
64
|
-
{...props}
|
|
65
|
-
>
|
|
66
|
-
<SelectScrollUpButton />
|
|
67
|
-
<SelectPrimitive.Viewport
|
|
68
|
-
className={cn(
|
|
69
|
-
'p-1',
|
|
70
|
-
position === 'popper' &&
|
|
71
|
-
'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1',
|
|
72
|
-
)}
|
|
73
|
-
>
|
|
74
|
-
{children}
|
|
75
|
-
</SelectPrimitive.Viewport>
|
|
76
|
-
<SelectScrollDownButton />
|
|
77
|
-
</SelectPrimitive.Content>
|
|
78
|
-
</SelectPrimitive.Portal>
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
function SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>) {
|
|
83
|
-
return (
|
|
84
|
-
<SelectPrimitive.Label
|
|
85
|
-
data-slot="select-label"
|
|
86
|
-
className={cn('text-muted-foreground px-2 py-1.5 text-xs', className)}
|
|
87
|
-
{...props}
|
|
88
|
-
/>
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
function SelectItem({
|
|
93
|
-
className,
|
|
94
|
-
children,
|
|
95
|
-
...props
|
|
96
|
-
}: React.ComponentProps<typeof SelectPrimitive.Item>) {
|
|
97
|
-
return (
|
|
98
|
-
<SelectPrimitive.Item
|
|
99
|
-
data-slot="select-item"
|
|
100
|
-
className={cn(
|
|
101
|
-
"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-base 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",
|
|
102
|
-
className,
|
|
103
|
-
)}
|
|
104
|
-
{...props}
|
|
105
|
-
>
|
|
106
|
-
<span className="absolute right-2 flex size-3.5 items-center justify-center">
|
|
107
|
-
<SelectPrimitive.ItemIndicator>
|
|
108
|
-
<CheckIcon className="size-4" />
|
|
109
|
-
</SelectPrimitive.ItemIndicator>
|
|
110
|
-
</span>
|
|
111
|
-
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
112
|
-
</SelectPrimitive.Item>
|
|
113
|
-
);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
function SelectSeparator({
|
|
117
|
-
className,
|
|
118
|
-
...props
|
|
119
|
-
}: React.ComponentProps<typeof SelectPrimitive.Separator>) {
|
|
120
|
-
return (
|
|
121
|
-
<SelectPrimitive.Separator
|
|
122
|
-
data-slot="select-separator"
|
|
123
|
-
className={cn('bg-border pointer-events-none -mx-1 my-1 h-px', className)}
|
|
124
|
-
{...props}
|
|
125
|
-
/>
|
|
126
|
-
);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
function SelectScrollUpButton({
|
|
130
|
-
className,
|
|
131
|
-
...props
|
|
132
|
-
}: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
|
|
133
|
-
return (
|
|
134
|
-
<SelectPrimitive.ScrollUpButton
|
|
135
|
-
data-slot="select-scroll-up-button"
|
|
136
|
-
className={cn('flex cursor-default items-center justify-center py-1', className)}
|
|
137
|
-
{...props}
|
|
138
|
-
>
|
|
139
|
-
<ChevronUpIcon className="size-4" />
|
|
140
|
-
</SelectPrimitive.ScrollUpButton>
|
|
141
|
-
);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
function SelectScrollDownButton({
|
|
145
|
-
className,
|
|
146
|
-
...props
|
|
147
|
-
}: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {
|
|
148
|
-
return (
|
|
149
|
-
<SelectPrimitive.ScrollDownButton
|
|
150
|
-
data-slot="select-scroll-down-button"
|
|
151
|
-
className={cn('flex cursor-default items-center justify-center py-1', className)}
|
|
152
|
-
{...props}
|
|
153
|
-
>
|
|
154
|
-
<ChevronDownIcon className="size-4" />
|
|
155
|
-
</SelectPrimitive.ScrollDownButton>
|
|
156
|
-
);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
export {
|
|
160
|
-
Select,
|
|
161
|
-
SelectContent,
|
|
162
|
-
SelectGroup,
|
|
163
|
-
SelectItem,
|
|
164
|
-
SelectLabel,
|
|
165
|
-
SelectScrollDownButton,
|
|
166
|
-
SelectScrollUpButton,
|
|
167
|
-
SelectSeparator,
|
|
168
|
-
SelectTrigger,
|
|
169
|
-
SelectValue,
|
|
170
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
|
|
3
|
-
import { Separator } from './index';
|
|
4
|
-
|
|
5
|
-
const meta: Meta<typeof Separator> = {
|
|
6
|
-
title: 'UI/Separator',
|
|
7
|
-
component: Separator,
|
|
8
|
-
tags: ['autodocs'],
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export default meta;
|
|
12
|
-
type Story = StoryObj<typeof Separator>;
|
|
13
|
-
|
|
14
|
-
export const Horizontal: Story = {
|
|
15
|
-
render: (args) => (
|
|
16
|
-
<div>
|
|
17
|
-
<div className="space-y-1">
|
|
18
|
-
<h4 className="text-sm leading-none font-medium">Radix Primitives</h4>
|
|
19
|
-
<p className="text-muted-foreground text-sm">An open-source UI component library.</p>
|
|
20
|
-
</div>
|
|
21
|
-
<Separator {...args} className="my-4" />
|
|
22
|
-
<div className="flex h-5 items-center space-x-4 text-sm">
|
|
23
|
-
<div>Blog</div>
|
|
24
|
-
<Separator orientation="vertical" />
|
|
25
|
-
<div>Docs</div>
|
|
26
|
-
<Separator orientation="vertical" />
|
|
27
|
-
<div>Source</div>
|
|
28
|
-
</div>
|
|
29
|
-
</div>
|
|
30
|
-
),
|
|
31
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
5
|
-
|
|
6
|
-
import { cn } from '@/lib/utils';
|
|
7
|
-
|
|
8
|
-
function Separator({
|
|
9
|
-
className,
|
|
10
|
-
orientation = 'horizontal',
|
|
11
|
-
decorative = true,
|
|
12
|
-
...props
|
|
13
|
-
}: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
|
|
14
|
-
return (
|
|
15
|
-
<SeparatorPrimitive.Root
|
|
16
|
-
data-slot="separator"
|
|
17
|
-
decorative={decorative}
|
|
18
|
-
orientation={orientation}
|
|
19
|
-
className={cn(
|
|
20
|
-
'bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px',
|
|
21
|
-
className,
|
|
22
|
-
)}
|
|
23
|
-
{...props}
|
|
24
|
-
/>
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export { Separator };
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
|
|
3
|
-
import { Button } from '../Button';
|
|
4
|
-
import {
|
|
5
|
-
Sheet,
|
|
6
|
-
SheetContent,
|
|
7
|
-
SheetDescription,
|
|
8
|
-
SheetFooter,
|
|
9
|
-
SheetHeader,
|
|
10
|
-
SheetTitle,
|
|
11
|
-
SheetTrigger,
|
|
12
|
-
} from './index';
|
|
13
|
-
|
|
14
|
-
const meta: Meta<typeof Sheet> = {
|
|
15
|
-
title: 'UI/Sheet',
|
|
16
|
-
component: Sheet,
|
|
17
|
-
tags: ['autodocs'],
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export default meta;
|
|
21
|
-
type Story = StoryObj<typeof Sheet>;
|
|
22
|
-
|
|
23
|
-
export const Default: Story = {
|
|
24
|
-
render: (args) => (
|
|
25
|
-
<Sheet {...args}>
|
|
26
|
-
<SheetTrigger asChild>
|
|
27
|
-
<Button variant="outline">Open Sheet</Button>
|
|
28
|
-
</SheetTrigger>
|
|
29
|
-
<SheetContent>
|
|
30
|
-
<SheetHeader>
|
|
31
|
-
<SheetTitle>Edit profile</SheetTitle>
|
|
32
|
-
<SheetDescription>
|
|
33
|
-
Make changes to your profile here. Click save when you're done.
|
|
34
|
-
</SheetDescription>
|
|
35
|
-
</SheetHeader>
|
|
36
|
-
<div className="grid gap-4 py-4">
|
|
37
|
-
<p>Content goes here...</p>
|
|
38
|
-
</div>
|
|
39
|
-
<SheetFooter>
|
|
40
|
-
<Button type="submit">Save changes</Button>
|
|
41
|
-
</SheetFooter>
|
|
42
|
-
</SheetContent>
|
|
43
|
-
</Sheet>
|
|
44
|
-
),
|
|
45
|
-
};
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as SheetPrimitive from '@radix-ui/react-dialog';
|
|
5
|
-
import { XIcon } from 'lucide-react';
|
|
6
|
-
|
|
7
|
-
import { cn } from '@/lib/utils';
|
|
8
|
-
|
|
9
|
-
function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {
|
|
10
|
-
return <SheetPrimitive.Root data-slot="sheet" {...props} />;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
function SheetTrigger({ ...props }: React.ComponentProps<typeof SheetPrimitive.Trigger>) {
|
|
14
|
-
return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function SheetClose({ ...props }: React.ComponentProps<typeof SheetPrimitive.Close>) {
|
|
18
|
-
return <SheetPrimitive.Close data-slot="sheet-close" {...props} />;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function SheetPortal({ ...props }: React.ComponentProps<typeof SheetPrimitive.Portal>) {
|
|
22
|
-
return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function SheetOverlay({
|
|
26
|
-
className,
|
|
27
|
-
...props
|
|
28
|
-
}: React.ComponentProps<typeof SheetPrimitive.Overlay>) {
|
|
29
|
-
return (
|
|
30
|
-
<SheetPrimitive.Overlay
|
|
31
|
-
data-slot="sheet-overlay"
|
|
32
|
-
className={cn(
|
|
33
|
-
'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50',
|
|
34
|
-
className,
|
|
35
|
-
)}
|
|
36
|
-
{...props}
|
|
37
|
-
/>
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function SheetContent({
|
|
42
|
-
className,
|
|
43
|
-
children,
|
|
44
|
-
side = 'right',
|
|
45
|
-
...props
|
|
46
|
-
}: React.ComponentProps<typeof SheetPrimitive.Content> & {
|
|
47
|
-
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
48
|
-
}) {
|
|
49
|
-
return (
|
|
50
|
-
<SheetPortal>
|
|
51
|
-
<SheetOverlay />
|
|
52
|
-
<SheetPrimitive.Content
|
|
53
|
-
data-slot="sheet-content"
|
|
54
|
-
className={cn(
|
|
55
|
-
'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500',
|
|
56
|
-
side === 'right' &&
|
|
57
|
-
'data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm',
|
|
58
|
-
side === 'left' &&
|
|
59
|
-
'data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm',
|
|
60
|
-
side === 'top' &&
|
|
61
|
-
'data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b',
|
|
62
|
-
side === 'bottom' &&
|
|
63
|
-
'data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t',
|
|
64
|
-
className,
|
|
65
|
-
)}
|
|
66
|
-
{...props}
|
|
67
|
-
>
|
|
68
|
-
{children}
|
|
69
|
-
<SheetPrimitive.Close className="ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none">
|
|
70
|
-
<XIcon className="size-4" />
|
|
71
|
-
<span className="sr-only">Close</span>
|
|
72
|
-
</SheetPrimitive.Close>
|
|
73
|
-
</SheetPrimitive.Content>
|
|
74
|
-
</SheetPortal>
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function SheetHeader({ className, ...props }: React.ComponentProps<'div'>) {
|
|
79
|
-
return (
|
|
80
|
-
<div
|
|
81
|
-
data-slot="sheet-header"
|
|
82
|
-
className={cn('flex flex-col gap-1.5 p-4', className)}
|
|
83
|
-
{...props}
|
|
84
|
-
/>
|
|
85
|
-
);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
function SheetFooter({ className, ...props }: React.ComponentProps<'div'>) {
|
|
89
|
-
return (
|
|
90
|
-
<div
|
|
91
|
-
data-slot="sheet-footer"
|
|
92
|
-
className={cn('mt-auto flex flex-col gap-2 p-4', className)}
|
|
93
|
-
{...props}
|
|
94
|
-
/>
|
|
95
|
-
);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
function SheetTitle({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Title>) {
|
|
99
|
-
return (
|
|
100
|
-
<SheetPrimitive.Title
|
|
101
|
-
data-slot="sheet-title"
|
|
102
|
-
className={cn('text-foreground font-semibold', className)}
|
|
103
|
-
{...props}
|
|
104
|
-
/>
|
|
105
|
-
);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
function SheetDescription({
|
|
109
|
-
className,
|
|
110
|
-
...props
|
|
111
|
-
}: React.ComponentProps<typeof SheetPrimitive.Description>) {
|
|
112
|
-
return (
|
|
113
|
-
<SheetPrimitive.Description
|
|
114
|
-
data-slot="sheet-description"
|
|
115
|
-
className={cn('text-muted-foreground text-sm', className)}
|
|
116
|
-
{...props}
|
|
117
|
-
/>
|
|
118
|
-
);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
export {
|
|
122
|
-
Sheet,
|
|
123
|
-
SheetTrigger,
|
|
124
|
-
SheetClose,
|
|
125
|
-
SheetContent,
|
|
126
|
-
SheetHeader,
|
|
127
|
-
SheetFooter,
|
|
128
|
-
SheetTitle,
|
|
129
|
-
SheetDescription,
|
|
130
|
-
};
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Home, Search, Settings } from 'lucide-react';
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
Sidebar,
|
|
6
|
-
SidebarContent,
|
|
7
|
-
SidebarFooter,
|
|
8
|
-
SidebarGroup,
|
|
9
|
-
SidebarGroupContent,
|
|
10
|
-
SidebarGroupLabel,
|
|
11
|
-
SidebarHeader,
|
|
12
|
-
SidebarMenu,
|
|
13
|
-
SidebarMenuButton,
|
|
14
|
-
SidebarMenuItem,
|
|
15
|
-
SidebarProvider,
|
|
16
|
-
SidebarRail,
|
|
17
|
-
SidebarTrigger,
|
|
18
|
-
} from './index';
|
|
19
|
-
|
|
20
|
-
const meta: Meta<typeof Sidebar> = {
|
|
21
|
-
title: 'UI/Sidebar',
|
|
22
|
-
component: Sidebar,
|
|
23
|
-
tags: ['autodocs'],
|
|
24
|
-
decorators: [
|
|
25
|
-
(Story) => (
|
|
26
|
-
<SidebarProvider>
|
|
27
|
-
<div className="flex h-screen w-full">
|
|
28
|
-
<Story />
|
|
29
|
-
<main className="flex-1 p-4">
|
|
30
|
-
<SidebarTrigger />
|
|
31
|
-
<p className="mt-4">Content goes here...</p>
|
|
32
|
-
</main>
|
|
33
|
-
</div>
|
|
34
|
-
</SidebarProvider>
|
|
35
|
-
),
|
|
36
|
-
],
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export default meta;
|
|
40
|
-
type Story = StoryObj<typeof Sidebar>;
|
|
41
|
-
|
|
42
|
-
const items = [
|
|
43
|
-
{ title: 'Home', icon: Home, url: '#' },
|
|
44
|
-
{ title: 'Search', icon: Search, url: '#' },
|
|
45
|
-
{ title: 'Settings', icon: Settings, url: '#' },
|
|
46
|
-
];
|
|
47
|
-
|
|
48
|
-
export const Default: Story = {
|
|
49
|
-
render: (args) => (
|
|
50
|
-
<Sidebar {...args}>
|
|
51
|
-
<SidebarHeader>
|
|
52
|
-
<div className="flex items-center gap-2 px-2 py-4">
|
|
53
|
-
<div className="bg-primary size-6 rounded-md" />
|
|
54
|
-
<span className="font-semibold">Acme Inc</span>
|
|
55
|
-
</div>
|
|
56
|
-
</SidebarHeader>
|
|
57
|
-
<SidebarContent>
|
|
58
|
-
<SidebarGroup>
|
|
59
|
-
<SidebarGroupLabel>Application</SidebarGroupLabel>
|
|
60
|
-
<SidebarGroupContent>
|
|
61
|
-
<SidebarMenu>
|
|
62
|
-
{items.map((item) => (
|
|
63
|
-
<SidebarMenuItem key={item.title}>
|
|
64
|
-
<SidebarMenuButton asChild>
|
|
65
|
-
<a href={item.url}>
|
|
66
|
-
<item.icon />
|
|
67
|
-
<span>{item.title}</span>
|
|
68
|
-
</a>
|
|
69
|
-
</SidebarMenuButton>
|
|
70
|
-
</SidebarMenuItem>
|
|
71
|
-
))}
|
|
72
|
-
</SidebarMenu>
|
|
73
|
-
</SidebarGroupContent>
|
|
74
|
-
</SidebarGroup>
|
|
75
|
-
</SidebarContent>
|
|
76
|
-
<SidebarFooter>
|
|
77
|
-
<div className="text-muted-foreground p-4 text-xs">© 2024 Acme Inc</div>
|
|
78
|
-
</SidebarFooter>
|
|
79
|
-
<SidebarRail />
|
|
80
|
-
</Sidebar>
|
|
81
|
-
),
|
|
82
|
-
};
|