@luanthnh/cntt-ui 0.1.7 → 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 -188
- 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,69 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { cva, type VariantProps } from 'class-variance-authority';
|
|
5
|
-
import { motion, type HTMLMotionProps } from 'motion/react';
|
|
6
|
-
|
|
7
|
-
import { cn } from '@/lib/utils';
|
|
8
|
-
|
|
9
|
-
/* ---------- VStack ---------- */
|
|
10
|
-
const vStackVariants = cva('flex flex-col', {
|
|
11
|
-
variants: {
|
|
12
|
-
justify: {
|
|
13
|
-
top: 'justify-start',
|
|
14
|
-
bottom: 'justify-end',
|
|
15
|
-
center: 'justify-center',
|
|
16
|
-
apart: 'justify-between',
|
|
17
|
-
around: 'justify-around',
|
|
18
|
-
evenly: 'justify-evenly',
|
|
19
|
-
},
|
|
20
|
-
align: {
|
|
21
|
-
default: 'items-stretch',
|
|
22
|
-
center: 'items-center',
|
|
23
|
-
start: 'items-start',
|
|
24
|
-
end: 'items-end',
|
|
25
|
-
baseline: 'items-baseline',
|
|
26
|
-
},
|
|
27
|
-
spacing: {
|
|
28
|
-
0: 'gap-0',
|
|
29
|
-
2: 'gap-0.5',
|
|
30
|
-
4: 'gap-1',
|
|
31
|
-
6: 'gap-1.5',
|
|
32
|
-
8: 'gap-2',
|
|
33
|
-
12: 'gap-3',
|
|
34
|
-
16: 'gap-4',
|
|
35
|
-
20: 'gap-5',
|
|
36
|
-
24: 'gap-6',
|
|
37
|
-
32: 'gap-8',
|
|
38
|
-
40: 'gap-10',
|
|
39
|
-
48: 'gap-12',
|
|
40
|
-
64: 'gap-16',
|
|
41
|
-
none: 'gap-0',
|
|
42
|
-
},
|
|
43
|
-
noWrap: {
|
|
44
|
-
true: 'flex-nowrap',
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
defaultVariants: {
|
|
48
|
-
spacing: 16,
|
|
49
|
-
justify: 'top',
|
|
50
|
-
align: 'default',
|
|
51
|
-
},
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
export interface VStackProps extends VariantProps<typeof vStackVariants>, HTMLMotionProps<'div'> {}
|
|
55
|
-
|
|
56
|
-
const VStack = React.forwardRef<HTMLDivElement, VStackProps>(
|
|
57
|
-
({ className, noWrap, justify, align, spacing, children, ...motionProps }, ref) => (
|
|
58
|
-
<motion.div
|
|
59
|
-
ref={ref}
|
|
60
|
-
className={cn(vStackVariants({ spacing, align, justify, noWrap }), className)}
|
|
61
|
-
{...motionProps}
|
|
62
|
-
>
|
|
63
|
-
{children}
|
|
64
|
-
</motion.div>
|
|
65
|
-
),
|
|
66
|
-
);
|
|
67
|
-
VStack.displayName = 'VStack';
|
|
68
|
-
|
|
69
|
-
export { VStack, vStackVariants };
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import type { Meta } from '@storybook/react';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Display existing color palettes from `globals.css`.
|
|
5
|
-
* Colors are defined as CSS variables with Dark Mode support.
|
|
6
|
-
*/
|
|
7
|
-
const meta: Meta = {
|
|
8
|
-
title: 'Theme/Colors',
|
|
9
|
-
parameters: {
|
|
10
|
-
layout: 'fullscreen',
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export default meta;
|
|
15
|
-
|
|
16
|
-
const ColorGroup = ({ title, colors }: { title: string; colors: Record<string, string> }) => (
|
|
17
|
-
<div className="mb-10">
|
|
18
|
-
<h3 className="text-foreground mb-4 text-lg font-bold">{title}</h3>
|
|
19
|
-
<div className="grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6">
|
|
20
|
-
{Object.entries(colors).map(([name, variable]) => (
|
|
21
|
-
<div key={name} className="flex flex-col gap-2">
|
|
22
|
-
<div
|
|
23
|
-
className="border-border h-20 w-full rounded-lg border shadow-sm transition-transform hover:scale-105"
|
|
24
|
-
style={{ backgroundColor: variable }}
|
|
25
|
-
/>
|
|
26
|
-
<div className="flex flex-col">
|
|
27
|
-
<span className="text-foreground text-sm font-medium">{name}</span>
|
|
28
|
-
<span className="text-muted-foreground text-xs uppercase">
|
|
29
|
-
{variable.replace('var(', '').replace(')', '')}
|
|
30
|
-
</span>
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
))}
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
export const Palettes = {
|
|
39
|
-
render: () => (
|
|
40
|
-
<div className="bg-background min-h-screen p-8">
|
|
41
|
-
<div className="border-border mb-8 border-b pb-4">
|
|
42
|
-
<h1 className="text-foreground text-3xl font-bold">Color Palette</h1>
|
|
43
|
-
<p className="text-muted-foreground mt-2">
|
|
44
|
-
The color system used in the application, defined in <code>globals.css</code>.
|
|
45
|
-
</p>
|
|
46
|
-
</div>
|
|
47
|
-
|
|
48
|
-
<ColorGroup
|
|
49
|
-
title="Primary (Blue)"
|
|
50
|
-
colors={{
|
|
51
|
-
'Primary 50': 'var(--primary-50)',
|
|
52
|
-
'Primary 100': 'var(--primary-100)',
|
|
53
|
-
'Primary 200': 'var(--primary-200)',
|
|
54
|
-
'Primary 300': 'var(--primary-300)',
|
|
55
|
-
'Primary 400': 'var(--primary-400)',
|
|
56
|
-
'Primary 500': 'var(--primary-500)',
|
|
57
|
-
'Primary 600': 'var(--primary-600)',
|
|
58
|
-
'Primary 700': 'var(--primary-700)',
|
|
59
|
-
'Primary 800': 'var(--primary-800)',
|
|
60
|
-
'Primary 900': 'var(--primary-900)',
|
|
61
|
-
'Primary 950': 'var(--primary-950)',
|
|
62
|
-
Default: 'var(--primary)',
|
|
63
|
-
}}
|
|
64
|
-
/>
|
|
65
|
-
|
|
66
|
-
<ColorGroup
|
|
67
|
-
title="Secondary & Muted"
|
|
68
|
-
colors={{
|
|
69
|
-
'Secondary 50': 'var(--secondary-50)',
|
|
70
|
-
'Secondary 100': 'var(--secondary-100)',
|
|
71
|
-
'Secondary 200': 'var(--secondary-200)',
|
|
72
|
-
Secondary: 'var(--secondary)',
|
|
73
|
-
Muted: 'var(--muted)',
|
|
74
|
-
'Muted Foreground': 'var(--muted-foreground)',
|
|
75
|
-
}}
|
|
76
|
-
/>
|
|
77
|
-
|
|
78
|
-
<ColorGroup
|
|
79
|
-
title="Accent & Status"
|
|
80
|
-
colors={{
|
|
81
|
-
Accent: 'var(--accent)',
|
|
82
|
-
'Accent Foreground': 'var(--accent-foreground)',
|
|
83
|
-
Success: 'var(--success)',
|
|
84
|
-
Warning: 'var(--warning)',
|
|
85
|
-
Destructive: 'var(--destructive)',
|
|
86
|
-
}}
|
|
87
|
-
/>
|
|
88
|
-
|
|
89
|
-
<ColorGroup
|
|
90
|
-
title="Base UI Colors"
|
|
91
|
-
colors={{
|
|
92
|
-
Background: 'var(--background)',
|
|
93
|
-
Foreground: 'var(--foreground)',
|
|
94
|
-
Card: 'var(--card)',
|
|
95
|
-
Popover: 'var(--popover)',
|
|
96
|
-
Border: 'var(--border)',
|
|
97
|
-
Input: 'var(--input)',
|
|
98
|
-
Ring: 'var(--ring)',
|
|
99
|
-
}}
|
|
100
|
-
/>
|
|
101
|
-
|
|
102
|
-
<ColorGroup
|
|
103
|
-
title="Chart Colors"
|
|
104
|
-
colors={{
|
|
105
|
-
'Chart 1': 'var(--chart-1)',
|
|
106
|
-
'Chart 2': 'var(--chart-2)',
|
|
107
|
-
'Chart 3': 'var(--chart-3)',
|
|
108
|
-
'Chart 4': 'var(--chart-4)',
|
|
109
|
-
'Chart 5': 'var(--chart-5)',
|
|
110
|
-
}}
|
|
111
|
-
/>
|
|
112
|
-
|
|
113
|
-
<ColorGroup
|
|
114
|
-
title="Sidebar Colors"
|
|
115
|
-
colors={{
|
|
116
|
-
'Sidebar BG': 'var(--sidebar)',
|
|
117
|
-
'Sidebar FG': 'var(--sidebar-foreground)',
|
|
118
|
-
'Sidebar Primary': 'var(--sidebar-primary)',
|
|
119
|
-
'Sidebar Accent': 'var(--sidebar-accent)',
|
|
120
|
-
'Sidebar Border': 'var(--sidebar-border)',
|
|
121
|
-
'Sidebar Ring': 'var(--sidebar-ring)',
|
|
122
|
-
}}
|
|
123
|
-
/>
|
|
124
|
-
|
|
125
|
-
<ColorGroup
|
|
126
|
-
title="Solid Colors"
|
|
127
|
-
colors={{
|
|
128
|
-
'Primary Solid': 'var(--color-primary-solid)',
|
|
129
|
-
'Secondary Solid': 'var(--color-secondary-solid)',
|
|
130
|
-
'Success Solid': 'var(--color-success-solid)',
|
|
131
|
-
'Warning Solid': 'var(--color-warning-solid)',
|
|
132
|
-
'Danger Solid': 'var(--color-danger-solid)',
|
|
133
|
-
'Surface Solid': 'var(--color-surface-solid)',
|
|
134
|
-
}}
|
|
135
|
-
/>
|
|
136
|
-
|
|
137
|
-
<ColorGroup
|
|
138
|
-
title="Glass & Shadows"
|
|
139
|
-
colors={{
|
|
140
|
-
'Glass BG': 'var(--glass-bg)',
|
|
141
|
-
'Glass Border': 'var(--glass-border)',
|
|
142
|
-
'Shadow Glow': 'var(--shadow-glow)',
|
|
143
|
-
'Shadow Glow LG': 'var(--shadow-glow-lg)',
|
|
144
|
-
}}
|
|
145
|
-
/>
|
|
146
|
-
</div>
|
|
147
|
-
),
|
|
148
|
-
};
|
package/eslint.config.js
DELETED
package/hooks/index.ts
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
|
|
5
|
-
type AutoHeightOptions = {
|
|
6
|
-
includeParentBox?: boolean;
|
|
7
|
-
includeSelfBox?: boolean;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export function useAutoHeight<T extends HTMLElement = HTMLDivElement>(
|
|
11
|
-
deps: React.DependencyList = [],
|
|
12
|
-
options: AutoHeightOptions = {
|
|
13
|
-
includeParentBox: true,
|
|
14
|
-
includeSelfBox: false,
|
|
15
|
-
},
|
|
16
|
-
) {
|
|
17
|
-
const ref = React.useRef<T | null>(null);
|
|
18
|
-
const roRef = React.useRef<ResizeObserver | null>(null);
|
|
19
|
-
const [height, setHeight] = React.useState(0);
|
|
20
|
-
|
|
21
|
-
const measure = React.useCallback(() => {
|
|
22
|
-
const el = ref.current;
|
|
23
|
-
if (!el) return 0;
|
|
24
|
-
|
|
25
|
-
const base = el.getBoundingClientRect().height || 0;
|
|
26
|
-
|
|
27
|
-
let extra = 0;
|
|
28
|
-
|
|
29
|
-
if (options.includeParentBox && el.parentElement) {
|
|
30
|
-
const cs = getComputedStyle(el.parentElement);
|
|
31
|
-
const paddingY =
|
|
32
|
-
(parseFloat(cs.paddingTop || '0') || 0) + (parseFloat(cs.paddingBottom || '0') || 0);
|
|
33
|
-
const borderY =
|
|
34
|
-
(parseFloat(cs.borderTopWidth || '0') || 0) +
|
|
35
|
-
(parseFloat(cs.borderBottomWidth || '0') || 0);
|
|
36
|
-
const isBorderBox = cs.boxSizing === 'border-box';
|
|
37
|
-
if (isBorderBox) {
|
|
38
|
-
extra += paddingY + borderY;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
if (options.includeSelfBox) {
|
|
43
|
-
const cs = getComputedStyle(el);
|
|
44
|
-
const paddingY =
|
|
45
|
-
(parseFloat(cs.paddingTop || '0') || 0) + (parseFloat(cs.paddingBottom || '0') || 0);
|
|
46
|
-
const borderY =
|
|
47
|
-
(parseFloat(cs.borderTopWidth || '0') || 0) +
|
|
48
|
-
(parseFloat(cs.borderBottomWidth || '0') || 0);
|
|
49
|
-
const isBorderBox = cs.boxSizing === 'border-box';
|
|
50
|
-
if (isBorderBox) {
|
|
51
|
-
extra += paddingY + borderY;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const dpr = typeof window !== 'undefined' ? window.devicePixelRatio || 1 : 1;
|
|
56
|
-
const total = Math.ceil((base + extra) * dpr) / dpr;
|
|
57
|
-
|
|
58
|
-
return total;
|
|
59
|
-
}, [options.includeParentBox, options.includeSelfBox]);
|
|
60
|
-
|
|
61
|
-
React.useLayoutEffect(() => {
|
|
62
|
-
const el = ref.current;
|
|
63
|
-
if (!el) return;
|
|
64
|
-
|
|
65
|
-
setHeight(measure());
|
|
66
|
-
|
|
67
|
-
if (roRef.current) {
|
|
68
|
-
roRef.current.disconnect();
|
|
69
|
-
roRef.current = null;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
const ro = new ResizeObserver(() => {
|
|
73
|
-
const next = measure();
|
|
74
|
-
requestAnimationFrame(() => setHeight(next));
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
ro.observe(el);
|
|
78
|
-
if (options.includeParentBox && el.parentElement) {
|
|
79
|
-
ro.observe(el.parentElement);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
roRef.current = ro;
|
|
83
|
-
|
|
84
|
-
return () => {
|
|
85
|
-
ro.disconnect();
|
|
86
|
-
roRef.current = null;
|
|
87
|
-
};
|
|
88
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
89
|
-
}, deps);
|
|
90
|
-
|
|
91
|
-
React.useLayoutEffect(() => {
|
|
92
|
-
if (height === 0) {
|
|
93
|
-
const next = measure();
|
|
94
|
-
if (next !== 0) setHeight(next);
|
|
95
|
-
}
|
|
96
|
-
}, [height, measure]);
|
|
97
|
-
|
|
98
|
-
return { ref, height } as const;
|
|
99
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
interface CommonControlledStateProps<T> {
|
|
4
|
-
value?: T;
|
|
5
|
-
defaultValue?: T;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export function useControlledState<T, Rest extends unknown[] = []>(
|
|
9
|
-
props: CommonControlledStateProps<T> & {
|
|
10
|
-
onChange?: (value: T, ...args: Rest) => void;
|
|
11
|
-
},
|
|
12
|
-
): readonly [T, (next: T, ...args: Rest) => void] {
|
|
13
|
-
const { value, defaultValue, onChange } = props;
|
|
14
|
-
|
|
15
|
-
const [state, setInternalState] = React.useState<T>(
|
|
16
|
-
value !== undefined ? value : (defaultValue as T),
|
|
17
|
-
);
|
|
18
|
-
|
|
19
|
-
React.useEffect(() => {
|
|
20
|
-
if (value !== undefined) setInternalState(value);
|
|
21
|
-
}, [value]);
|
|
22
|
-
|
|
23
|
-
const setState = React.useCallback(
|
|
24
|
-
(next: T, ...args: Rest) => {
|
|
25
|
-
setInternalState(next);
|
|
26
|
-
onChange?.(next, ...args);
|
|
27
|
-
},
|
|
28
|
-
[onChange],
|
|
29
|
-
);
|
|
30
|
-
|
|
31
|
-
return [state, setState] as const;
|
|
32
|
-
}
|
package/hooks/use-mobile.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
const MOBILE_BREAKPOINT = 768;
|
|
4
|
-
|
|
5
|
-
export function useIsMobile() {
|
|
6
|
-
const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined);
|
|
7
|
-
|
|
8
|
-
React.useEffect(() => {
|
|
9
|
-
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
10
|
-
const onChange = () => {
|
|
11
|
-
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
12
|
-
};
|
|
13
|
-
mql.addEventListener('change', onChange);
|
|
14
|
-
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
15
|
-
return () => mql.removeEventListener('change', onChange);
|
|
16
|
-
}, []);
|
|
17
|
-
|
|
18
|
-
return !!isMobile;
|
|
19
|
-
}
|
package/index.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
// Auto-generated file. Do not edit manually.
|
|
2
|
-
export * from './components/ui/Accordion';
|
|
3
|
-
export * from './components/ui/Alert';
|
|
4
|
-
export * from './components/ui/AlertDialog';
|
|
5
|
-
export * from './components/ui/AspectRatio';
|
|
6
|
-
export * from './components/ui/Avatar';
|
|
7
|
-
export * from './components/ui/Badge';
|
|
8
|
-
export * from './components/ui/Breadcrumb';
|
|
9
|
-
export * from './components/ui/Button';
|
|
10
|
-
export * from './components/ui/Calendar';
|
|
11
|
-
export * from './components/ui/Card';
|
|
12
|
-
export * from './components/ui/Carousel';
|
|
13
|
-
export * from './components/ui/Chart';
|
|
14
|
-
export * from './components/ui/Checkbox';
|
|
15
|
-
export * from './components/ui/CircleProcess';
|
|
16
|
-
export * from './components/ui/Collapsible';
|
|
17
|
-
export * from './components/ui/Command';
|
|
18
|
-
export * from './components/ui/Container';
|
|
19
|
-
export * from './components/ui/ContextMenu';
|
|
20
|
-
export * from './components/ui/Dialog';
|
|
21
|
-
export * from './components/ui/Drawer';
|
|
22
|
-
export * from './components/ui/DropdownMenu';
|
|
23
|
-
export * from './components/ui/Dropzone';
|
|
24
|
-
export * from './components/ui/Form';
|
|
25
|
-
export * from './components/ui/HStack';
|
|
26
|
-
export * from './components/ui/HoverCard';
|
|
27
|
-
export * from './components/ui/Icons';
|
|
28
|
-
export * from './components/ui/ImageWithFallback';
|
|
29
|
-
export * from './components/ui/Input';
|
|
30
|
-
export * from './components/ui/InputOtp';
|
|
31
|
-
export * from './components/ui/Label';
|
|
32
|
-
export * from './components/ui/Marquee';
|
|
33
|
-
export * from './components/ui/Menubar';
|
|
34
|
-
export * from './components/ui/NavigationMenu';
|
|
35
|
-
export * from './components/ui/NoData';
|
|
36
|
-
export * from './components/ui/Pagination';
|
|
37
|
-
export * from './components/ui/Popover';
|
|
38
|
-
export * from './components/ui/Progress';
|
|
39
|
-
export * from './components/ui/RadioGroup';
|
|
40
|
-
export * from './components/ui/Resizable';
|
|
41
|
-
export * from './components/ui/ScrollArea';
|
|
42
|
-
export * from './components/ui/Select';
|
|
43
|
-
export * from './components/ui/Separator';
|
|
44
|
-
export * from './components/ui/Sheet';
|
|
45
|
-
export * from './components/ui/Sidebar';
|
|
46
|
-
export * from './components/ui/Skeleton';
|
|
47
|
-
export * from './components/ui/Slider';
|
|
48
|
-
export * from './components/ui/Slot';
|
|
49
|
-
export * from './components/ui/Sonner';
|
|
50
|
-
export * from './components/ui/Switch';
|
|
51
|
-
export * from './components/ui/Table';
|
|
52
|
-
export * from './components/ui/Tabs';
|
|
53
|
-
export * from './components/ui/Text';
|
|
54
|
-
export * from './components/ui/Textarea';
|
|
55
|
-
export * from './components/ui/Toggle';
|
|
56
|
-
export * from './components/ui/ToggleGroup';
|
|
57
|
-
export * from './components/ui/Tooltip';
|
|
58
|
-
export * from './components/ui/VStack';
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
export function getStrictContext<T>(name: string) {
|
|
4
|
-
const Context = React.createContext<T | undefined>(undefined);
|
|
5
|
-
|
|
6
|
-
function useContext() {
|
|
7
|
-
const context = React.useContext(Context);
|
|
8
|
-
if (context === undefined) {
|
|
9
|
-
throw new Error(`use${name} must be used within a ${name}Provider`);
|
|
10
|
-
}
|
|
11
|
-
return context;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
return [Context.Provider, useContext] as const;
|
|
15
|
-
}
|
package/lib/utils.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { clsx, type ClassValue } from 'clsx';
|
|
2
|
-
import { twMerge } from 'tailwind-merge';
|
|
3
|
-
|
|
4
|
-
export function cn(...inputs: ClassValue[]) {
|
|
5
|
-
return twMerge(clsx(inputs));
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export function onMutateError(error: unknown) {
|
|
9
|
-
console.error('Mutation error:', error);
|
|
10
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import fs from 'fs/promises';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
|
|
4
|
-
async function generateExports() {
|
|
5
|
-
const componentsDir = path.join(process.cwd(), 'components/ui');
|
|
6
|
-
const componentDirs = await fs.readdir(componentsDir, { withFileTypes: true });
|
|
7
|
-
|
|
8
|
-
const exports = [];
|
|
9
|
-
|
|
10
|
-
for (const dir of componentDirs) {
|
|
11
|
-
if (dir.isDirectory()) {
|
|
12
|
-
const componentName = dir.name;
|
|
13
|
-
const indexPath = path.join(dir.path, dir.name, 'index.tsx');
|
|
14
|
-
|
|
15
|
-
try {
|
|
16
|
-
await fs.access(indexPath);
|
|
17
|
-
exports.push(`export * from "./components/ui/${componentName}"`);
|
|
18
|
-
} catch {
|
|
19
|
-
console.warn(`No index.tsx found for component: ${componentName}`);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const content = `// Auto-generated file. Do not edit manually.
|
|
25
|
-
${exports.join('\n')}
|
|
26
|
-
`;
|
|
27
|
-
|
|
28
|
-
await fs.writeFile(path.join(process.cwd(), 'index.ts'), content);
|
|
29
|
-
console.log('Exports generated successfully!');
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
generateExports().catch(console.error);
|
package/tsconfig.json
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"baseUrl": ".",
|
|
5
|
-
"ignoreDeprecations": "5.0",
|
|
6
|
-
"paths": {
|
|
7
|
-
"@/*": ["./*"]
|
|
8
|
-
},
|
|
9
|
-
"incremental": false
|
|
10
|
-
},
|
|
11
|
-
"include": ["**/*.ts", "**/*.tsx", "types/*.d.ts", "lib", "scripts", "hooks", "components"]
|
|
12
|
-
}
|