@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,114 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { ChevronLeftIcon, ChevronRightIcon, MoreHorizontalIcon } from 'lucide-react';
|
|
3
|
-
|
|
4
|
-
import { cn } from '@/lib/utils';
|
|
5
|
-
import { Button, buttonVariants } from '@/components/ui/Button';
|
|
6
|
-
|
|
7
|
-
function Pagination({ className, ...props }: React.ComponentProps<'nav'>) {
|
|
8
|
-
return (
|
|
9
|
-
<nav
|
|
10
|
-
role="navigation"
|
|
11
|
-
aria-label="pagination"
|
|
12
|
-
data-slot="pagination"
|
|
13
|
-
className={cn('mx-auto flex w-full justify-center', className)}
|
|
14
|
-
{...props}
|
|
15
|
-
/>
|
|
16
|
-
);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function PaginationContent({ className, ...props }: React.ComponentProps<'ul'>) {
|
|
20
|
-
return (
|
|
21
|
-
<ul
|
|
22
|
-
data-slot="pagination-content"
|
|
23
|
-
className={cn('flex flex-row items-center gap-1', className)}
|
|
24
|
-
{...props}
|
|
25
|
-
/>
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function PaginationItem({ ...props }: React.ComponentProps<'li'>) {
|
|
30
|
-
return <li data-slot="pagination-item" {...props} />;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
type PaginationLinkProps = {
|
|
34
|
-
isActive?: boolean;
|
|
35
|
-
} & Pick<React.ComponentProps<typeof Button>, 'size'> &
|
|
36
|
-
React.ComponentProps<'a'>;
|
|
37
|
-
|
|
38
|
-
function PaginationLink({ className, isActive, size = 'icon', ...props }: PaginationLinkProps) {
|
|
39
|
-
return (
|
|
40
|
-
<a
|
|
41
|
-
aria-current={isActive ? 'page' : undefined}
|
|
42
|
-
data-slot="pagination-link"
|
|
43
|
-
data-active={isActive}
|
|
44
|
-
className={cn(
|
|
45
|
-
buttonVariants({
|
|
46
|
-
variant: isActive ? 'outline' : 'ghost',
|
|
47
|
-
size,
|
|
48
|
-
}),
|
|
49
|
-
className,
|
|
50
|
-
)}
|
|
51
|
-
{...props}
|
|
52
|
-
/>
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function PaginationPrevious({
|
|
57
|
-
className,
|
|
58
|
-
size = 'icon',
|
|
59
|
-
...props
|
|
60
|
-
}: React.ComponentProps<typeof PaginationLink>) {
|
|
61
|
-
return (
|
|
62
|
-
<PaginationLink
|
|
63
|
-
aria-label="Go to previous page"
|
|
64
|
-
size={size}
|
|
65
|
-
className={cn('gap-1 px-2.5 sm:pl-2.5', className)}
|
|
66
|
-
{...props}
|
|
67
|
-
>
|
|
68
|
-
<ChevronLeftIcon />
|
|
69
|
-
<span className="hidden sm:block">Previous</span>
|
|
70
|
-
</PaginationLink>
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function PaginationNext({
|
|
75
|
-
className,
|
|
76
|
-
size = 'icon',
|
|
77
|
-
...props
|
|
78
|
-
}: React.ComponentProps<typeof PaginationLink>) {
|
|
79
|
-
return (
|
|
80
|
-
<PaginationLink
|
|
81
|
-
aria-label="Go to next page"
|
|
82
|
-
size={size}
|
|
83
|
-
className={cn('gap-1 px-2.5 sm:pr-2.5', className)}
|
|
84
|
-
{...props}
|
|
85
|
-
>
|
|
86
|
-
<span className="hidden sm:block">Next</span>
|
|
87
|
-
<ChevronRightIcon />
|
|
88
|
-
</PaginationLink>
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
function PaginationEllipsis({ className, ...props }: React.ComponentProps<'span'>) {
|
|
93
|
-
return (
|
|
94
|
-
<span
|
|
95
|
-
aria-hidden
|
|
96
|
-
data-slot="pagination-ellipsis"
|
|
97
|
-
className={cn('flex size-9 items-center justify-center', className)}
|
|
98
|
-
{...props}
|
|
99
|
-
>
|
|
100
|
-
<MoreHorizontalIcon className="size-4" />
|
|
101
|
-
<span className="sr-only">More pages</span>
|
|
102
|
-
</span>
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
export {
|
|
107
|
-
Pagination,
|
|
108
|
-
PaginationContent,
|
|
109
|
-
PaginationLink,
|
|
110
|
-
PaginationItem,
|
|
111
|
-
PaginationPrevious,
|
|
112
|
-
PaginationNext,
|
|
113
|
-
PaginationEllipsis,
|
|
114
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
|
|
3
|
-
import { Button } from '../Button';
|
|
4
|
-
import { Popover, PopoverContent, PopoverTrigger } from './index';
|
|
5
|
-
|
|
6
|
-
const meta: Meta<typeof Popover> = {
|
|
7
|
-
title: 'UI/Popover',
|
|
8
|
-
component: Popover,
|
|
9
|
-
tags: ['autodocs'],
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export default meta;
|
|
13
|
-
type Story = StoryObj<typeof Popover>;
|
|
14
|
-
|
|
15
|
-
export const Default: Story = {
|
|
16
|
-
render: (args) => (
|
|
17
|
-
<Popover {...args}>
|
|
18
|
-
<PopoverTrigger asChild>
|
|
19
|
-
<Button variant="outline">Open Popover</Button>
|
|
20
|
-
</PopoverTrigger>
|
|
21
|
-
<PopoverContent className="w-80">
|
|
22
|
-
<div className="grid gap-4">
|
|
23
|
-
<div className="space-y-2">
|
|
24
|
-
<h4 className="leading-none font-medium">Dimensions</h4>
|
|
25
|
-
<p className="text-muted-foreground text-sm">Set the dimensions for the layer.</p>
|
|
26
|
-
</div>
|
|
27
|
-
</div>
|
|
28
|
-
</PopoverContent>
|
|
29
|
-
</Popover>
|
|
30
|
-
),
|
|
31
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
5
|
-
|
|
6
|
-
import { cn } from '@/lib/utils';
|
|
7
|
-
|
|
8
|
-
function Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>) {
|
|
9
|
-
return <PopoverPrimitive.Root data-slot="popover" {...props} />;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
function PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
|
|
13
|
-
return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
function PopoverContent({
|
|
17
|
-
className,
|
|
18
|
-
align = 'center',
|
|
19
|
-
sideOffset = 4,
|
|
20
|
-
...props
|
|
21
|
-
}: React.ComponentProps<typeof PopoverPrimitive.Content>) {
|
|
22
|
-
return (
|
|
23
|
-
<PopoverPrimitive.Portal>
|
|
24
|
-
<PopoverPrimitive.Content
|
|
25
|
-
data-slot="popover-content"
|
|
26
|
-
align={align}
|
|
27
|
-
sideOffset={sideOffset}
|
|
28
|
-
className={cn(
|
|
29
|
-
'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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden',
|
|
30
|
-
className,
|
|
31
|
-
)}
|
|
32
|
-
{...props}
|
|
33
|
-
/>
|
|
34
|
-
</PopoverPrimitive.Portal>
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
|
|
39
|
-
return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
|
|
3
|
-
import { Progress } from './index';
|
|
4
|
-
|
|
5
|
-
const meta: Meta<typeof Progress> = {
|
|
6
|
-
title: 'UI/Progress',
|
|
7
|
-
component: Progress,
|
|
8
|
-
tags: ['autodocs'],
|
|
9
|
-
argTypes: {
|
|
10
|
-
value: {
|
|
11
|
-
control: { type: 'range', min: 0, max: 100 },
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export default meta;
|
|
17
|
-
type Story = StoryObj<typeof Progress>;
|
|
18
|
-
|
|
19
|
-
export const Default: Story = {
|
|
20
|
-
args: {
|
|
21
|
-
value: 33,
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const Complete: Story = {
|
|
26
|
-
args: {
|
|
27
|
-
value: 100,
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export const Zero: Story = {
|
|
32
|
-
args: {
|
|
33
|
-
value: 0,
|
|
34
|
-
},
|
|
35
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as ProgressPrimitive from '@radix-ui/react-progress';
|
|
5
|
-
|
|
6
|
-
import { cn } from '@/lib/utils';
|
|
7
|
-
|
|
8
|
-
function Progress({
|
|
9
|
-
className,
|
|
10
|
-
value,
|
|
11
|
-
...props
|
|
12
|
-
}: React.ComponentProps<typeof ProgressPrimitive.Root>) {
|
|
13
|
-
return (
|
|
14
|
-
<ProgressPrimitive.Root
|
|
15
|
-
data-slot="progress"
|
|
16
|
-
className={cn('bg-primary/20 relative h-2 w-full overflow-hidden rounded-full', className)}
|
|
17
|
-
{...props}
|
|
18
|
-
>
|
|
19
|
-
<ProgressPrimitive.Indicator
|
|
20
|
-
data-slot="progress-indicator"
|
|
21
|
-
className="bg-primary h-full w-full flex-1 transition-all"
|
|
22
|
-
style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
|
|
23
|
-
/>
|
|
24
|
-
</ProgressPrimitive.Root>
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export { Progress };
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
|
|
3
|
-
import { Label } from '../Label';
|
|
4
|
-
import { RadioGroup, RadioGroupItem } from './index';
|
|
5
|
-
|
|
6
|
-
const meta: Meta<typeof RadioGroup> = {
|
|
7
|
-
title: 'UI/RadioGroup',
|
|
8
|
-
component: RadioGroup,
|
|
9
|
-
tags: ['autodocs'],
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export default meta;
|
|
13
|
-
type Story = StoryObj<typeof RadioGroup>;
|
|
14
|
-
|
|
15
|
-
export const Default: Story = {
|
|
16
|
-
render: (args) => (
|
|
17
|
-
<RadioGroup defaultValue="option-one" {...args}>
|
|
18
|
-
<div className="flex items-center space-x-2">
|
|
19
|
-
<RadioGroupItem value="option-one" id="option-one" />
|
|
20
|
-
<Label htmlFor="option-one">Option One</Label>
|
|
21
|
-
</div>
|
|
22
|
-
<div className="flex items-center space-x-2">
|
|
23
|
-
<RadioGroupItem value="option-two" id="option-two" />
|
|
24
|
-
<Label htmlFor="option-two">Option Two</Label>
|
|
25
|
-
</div>
|
|
26
|
-
</RadioGroup>
|
|
27
|
-
),
|
|
28
|
-
};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
5
|
-
import { CircleIcon } from 'lucide-react';
|
|
6
|
-
|
|
7
|
-
import { cn } from '@/lib/utils';
|
|
8
|
-
|
|
9
|
-
function RadioGroup({
|
|
10
|
-
className,
|
|
11
|
-
...props
|
|
12
|
-
}: React.ComponentProps<typeof RadioGroupPrimitive.Root>) {
|
|
13
|
-
return (
|
|
14
|
-
<RadioGroupPrimitive.Root
|
|
15
|
-
data-slot="radio-group"
|
|
16
|
-
className={cn('grid gap-3', className)}
|
|
17
|
-
{...props}
|
|
18
|
-
/>
|
|
19
|
-
);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function RadioGroupItem({
|
|
23
|
-
className,
|
|
24
|
-
...props
|
|
25
|
-
}: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {
|
|
26
|
-
return (
|
|
27
|
-
<RadioGroupPrimitive.Item
|
|
28
|
-
data-slot="radio-group-item"
|
|
29
|
-
className={cn(
|
|
30
|
-
'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 dark:border-gray-700',
|
|
31
|
-
className,
|
|
32
|
-
)}
|
|
33
|
-
{...props}
|
|
34
|
-
>
|
|
35
|
-
<RadioGroupPrimitive.Indicator
|
|
36
|
-
data-slot="radio-group-indicator"
|
|
37
|
-
className="relative flex items-center justify-center"
|
|
38
|
-
>
|
|
39
|
-
<CircleIcon className="fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2" />
|
|
40
|
-
</RadioGroupPrimitive.Indicator>
|
|
41
|
-
</RadioGroupPrimitive.Item>
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export { RadioGroup, RadioGroupItem };
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
|
|
3
|
-
import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from './index';
|
|
4
|
-
|
|
5
|
-
const meta: Meta<typeof ResizablePanelGroup> = {
|
|
6
|
-
title: 'UI/Resizable',
|
|
7
|
-
component: ResizablePanelGroup,
|
|
8
|
-
tags: ['autodocs'],
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export default meta;
|
|
12
|
-
type Story = StoryObj<typeof ResizablePanelGroup>;
|
|
13
|
-
|
|
14
|
-
export const Default: Story = {
|
|
15
|
-
render: (args) => (
|
|
16
|
-
<ResizablePanelGroup
|
|
17
|
-
{...args}
|
|
18
|
-
orientation="horizontal"
|
|
19
|
-
className="min-h-[200px] max-w-md rounded-lg border"
|
|
20
|
-
>
|
|
21
|
-
<ResizablePanel defaultSize={50}>
|
|
22
|
-
<div className="flex h-full items-center justify-center p-6">
|
|
23
|
-
<span className="font-semibold">One</span>
|
|
24
|
-
</div>
|
|
25
|
-
</ResizablePanel>
|
|
26
|
-
<ResizableHandle />
|
|
27
|
-
<ResizablePanel defaultSize={50}>
|
|
28
|
-
<ResizablePanelGroup orientation="vertical">
|
|
29
|
-
<ResizablePanel defaultSize={25}>
|
|
30
|
-
<div className="flex h-full items-center justify-center p-6">
|
|
31
|
-
<span className="font-semibold">Two</span>
|
|
32
|
-
</div>
|
|
33
|
-
</ResizablePanel>
|
|
34
|
-
<ResizableHandle />
|
|
35
|
-
<ResizablePanel defaultSize={75}>
|
|
36
|
-
<div className="flex h-full items-center justify-center p-6">
|
|
37
|
-
<span className="font-semibold">Three</span>
|
|
38
|
-
</div>
|
|
39
|
-
</ResizablePanel>
|
|
40
|
-
</ResizablePanelGroup>
|
|
41
|
-
</ResizablePanel>
|
|
42
|
-
</ResizablePanelGroup>
|
|
43
|
-
),
|
|
44
|
-
};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { GripVerticalIcon } from 'lucide-react';
|
|
4
|
-
import {
|
|
5
|
-
Group,
|
|
6
|
-
Panel,
|
|
7
|
-
Separator,
|
|
8
|
-
type GroupProps,
|
|
9
|
-
type PanelProps,
|
|
10
|
-
type SeparatorProps,
|
|
11
|
-
} from 'react-resizable-panels';
|
|
12
|
-
|
|
13
|
-
import { cn } from '@/lib/utils';
|
|
14
|
-
|
|
15
|
-
function ResizablePanelGroup({ className, ...props }: GroupProps) {
|
|
16
|
-
return (
|
|
17
|
-
<Group
|
|
18
|
-
data-slot="resizable-panel-group"
|
|
19
|
-
className={cn('flex h-full w-full data-[orientation=vertical]:flex-col', className)}
|
|
20
|
-
{...props}
|
|
21
|
-
/>
|
|
22
|
-
);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function ResizablePanel({ ...props }: PanelProps) {
|
|
26
|
-
return <Panel data-slot="resizable-panel" {...props} />;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function ResizableHandle({
|
|
30
|
-
withHandle,
|
|
31
|
-
className,
|
|
32
|
-
...props
|
|
33
|
-
}: SeparatorProps & {
|
|
34
|
-
withHandle?: boolean;
|
|
35
|
-
}) {
|
|
36
|
-
return (
|
|
37
|
-
<Separator
|
|
38
|
-
data-slot="resizable-handle"
|
|
39
|
-
className={cn(
|
|
40
|
-
'bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[orientation=vertical]:h-px data-[orientation=vertical]:w-full data-[orientation=vertical]:after:left-0 data-[orientation=vertical]:after:h-1 data-[orientation=vertical]:after:w-full data-[orientation=vertical]:after:translate-x-0 data-[orientation=vertical]:after:-translate-y-1/2 [&[data-orientation=vertical]>div]:rotate-90',
|
|
41
|
-
className,
|
|
42
|
-
)}
|
|
43
|
-
{...props}
|
|
44
|
-
>
|
|
45
|
-
{withHandle && (
|
|
46
|
-
<div className="bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border">
|
|
47
|
-
<GripVerticalIcon className="size-2.5" />
|
|
48
|
-
</div>
|
|
49
|
-
)}
|
|
50
|
-
</Separator>
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export { ResizablePanelGroup, ResizablePanel, ResizableHandle };
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
-
|
|
4
|
-
import { ScrollArea } from './index';
|
|
5
|
-
|
|
6
|
-
const meta: Meta<typeof ScrollArea> = {
|
|
7
|
-
title: 'UI/ScrollArea',
|
|
8
|
-
component: ScrollArea,
|
|
9
|
-
tags: ['autodocs'],
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export default meta;
|
|
13
|
-
type Story = StoryObj<typeof ScrollArea>;
|
|
14
|
-
|
|
15
|
-
const tags = Array.from({ length: 50 }).map((_, i, a) => `v1.2.0-beta.${a.length - i}`);
|
|
16
|
-
|
|
17
|
-
export const Default: Story = {
|
|
18
|
-
render: (args) => (
|
|
19
|
-
<ScrollArea {...args} className="h-72 w-48 rounded-md border">
|
|
20
|
-
<div className="p-4">
|
|
21
|
-
<h4 className="mb-4 text-sm leading-none font-medium">Tags</h4>
|
|
22
|
-
{tags.map((tag) => (
|
|
23
|
-
<React.Fragment key={tag}>
|
|
24
|
-
<div className="text-sm">{tag}</div>
|
|
25
|
-
<hr className="my-2" />
|
|
26
|
-
</React.Fragment>
|
|
27
|
-
))}
|
|
28
|
-
</div>
|
|
29
|
-
</ScrollArea>
|
|
30
|
-
),
|
|
31
|
-
};
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
|
|
5
|
-
|
|
6
|
-
import { cn } from '@/lib/utils';
|
|
7
|
-
|
|
8
|
-
function ScrollArea({
|
|
9
|
-
className,
|
|
10
|
-
children,
|
|
11
|
-
...props
|
|
12
|
-
}: React.ComponentProps<typeof ScrollAreaPrimitive.Root>) {
|
|
13
|
-
return (
|
|
14
|
-
<ScrollAreaPrimitive.Root
|
|
15
|
-
data-slot="scroll-area"
|
|
16
|
-
className={cn('relative', className)}
|
|
17
|
-
{...props}
|
|
18
|
-
>
|
|
19
|
-
<ScrollAreaPrimitive.Viewport
|
|
20
|
-
data-slot="scroll-area-viewport"
|
|
21
|
-
className="focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1"
|
|
22
|
-
>
|
|
23
|
-
{children}
|
|
24
|
-
</ScrollAreaPrimitive.Viewport>
|
|
25
|
-
<ScrollBar />
|
|
26
|
-
<ScrollAreaPrimitive.Corner />
|
|
27
|
-
</ScrollAreaPrimitive.Root>
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function ScrollBar({
|
|
32
|
-
className,
|
|
33
|
-
orientation = 'vertical',
|
|
34
|
-
...props
|
|
35
|
-
}: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>) {
|
|
36
|
-
return (
|
|
37
|
-
<ScrollAreaPrimitive.ScrollAreaScrollbar
|
|
38
|
-
data-slot="scroll-area-scrollbar"
|
|
39
|
-
orientation={orientation}
|
|
40
|
-
className={cn(
|
|
41
|
-
'flex touch-none p-px transition-colors select-none',
|
|
42
|
-
orientation === 'vertical' && 'h-full w-2.5 border-l border-l-transparent',
|
|
43
|
-
orientation === 'horizontal' && 'h-2.5 flex-col border-t border-t-transparent',
|
|
44
|
-
className,
|
|
45
|
-
)}
|
|
46
|
-
{...props}
|
|
47
|
-
>
|
|
48
|
-
<ScrollAreaPrimitive.ScrollAreaThumb
|
|
49
|
-
data-slot="scroll-area-thumb"
|
|
50
|
-
className="bg-border relative flex-1 rounded-full"
|
|
51
|
-
/>
|
|
52
|
-
</ScrollAreaPrimitive.ScrollAreaScrollbar>
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export { ScrollArea, ScrollBar };
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
Select,
|
|
5
|
-
SelectContent,
|
|
6
|
-
SelectGroup,
|
|
7
|
-
SelectItem,
|
|
8
|
-
SelectLabel,
|
|
9
|
-
SelectSeparator,
|
|
10
|
-
SelectTrigger,
|
|
11
|
-
SelectValue,
|
|
12
|
-
} from './index';
|
|
13
|
-
|
|
14
|
-
const meta: Meta<typeof Select> = {
|
|
15
|
-
title: 'UI/Select',
|
|
16
|
-
component: Select,
|
|
17
|
-
tags: ['autodocs'],
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export default meta;
|
|
21
|
-
type Story = StoryObj<typeof Select>;
|
|
22
|
-
|
|
23
|
-
export const Default: Story = {
|
|
24
|
-
render: (args) => (
|
|
25
|
-
<Select {...args}>
|
|
26
|
-
<SelectTrigger className="w-45">
|
|
27
|
-
<SelectValue placeholder="Select a fruit" />
|
|
28
|
-
</SelectTrigger>
|
|
29
|
-
<SelectContent>
|
|
30
|
-
<SelectGroup>
|
|
31
|
-
<SelectLabel>Fruits</SelectLabel>
|
|
32
|
-
<SelectItem value="apple">Apple</SelectItem>
|
|
33
|
-
<SelectItem value="banana">Banana</SelectItem>
|
|
34
|
-
<SelectItem value="blueberry">Blueberry</SelectItem>
|
|
35
|
-
<SelectItem value="grapes">Grapes</SelectItem>
|
|
36
|
-
<SelectItem value="pineapple">Pineapple</SelectItem>
|
|
37
|
-
</SelectGroup>
|
|
38
|
-
</SelectContent>
|
|
39
|
-
</Select>
|
|
40
|
-
),
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export const WithSeparator: Story = {
|
|
44
|
-
render: (args) => (
|
|
45
|
-
<Select {...args}>
|
|
46
|
-
<SelectTrigger className="w-45">
|
|
47
|
-
<SelectValue placeholder="Select an option" />
|
|
48
|
-
</SelectTrigger>
|
|
49
|
-
<SelectContent>
|
|
50
|
-
<SelectGroup>
|
|
51
|
-
<SelectLabel>Group 1</SelectLabel>
|
|
52
|
-
<SelectItem value="1">Option 1</SelectItem>
|
|
53
|
-
<SelectItem value="2">Option 2</SelectItem>
|
|
54
|
-
</SelectGroup>
|
|
55
|
-
<SelectSeparator />
|
|
56
|
-
<SelectGroup>
|
|
57
|
-
<SelectLabel>Group 2</SelectLabel>
|
|
58
|
-
<SelectItem value="3">Option 3</SelectItem>
|
|
59
|
-
<SelectItem value="4">Option 4</SelectItem>
|
|
60
|
-
</SelectGroup>
|
|
61
|
-
</SelectContent>
|
|
62
|
-
</Select>
|
|
63
|
-
),
|
|
64
|
-
};
|