@luanthnh/cntt-ui 0.1.5
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/.storybook/globals.d.ts +1 -0
- package/.storybook/main.ts +29 -0
- package/.storybook/preview.ts +32 -0
- package/README.md +86 -0
- 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 +1 -0
- package/assets/icons/file.svg +1 -0
- package/assets/icons/globe.svg +1 -0
- package/assets/icons/logo-line.svg +1 -0
- package/assets/icons/next.svg +1 -0
- package/assets/icons/panel-left-expand.svg +1 -0
- package/assets/icons/placeholder.svg +57 -0
- package/assets/icons/vercel.svg +1 -0
- package/assets/icons/window.svg +1 -0
- package/assets/lotties/error-404.json +19642 -0
- package/assets/lotties/error.json +2414 -0
- package/assets/lotties/loader.json +305 -0
- package/components/Welcome.mdx +74 -0
- package/components/lenis/index.tsx +48 -0
- package/components/motion/auto-height.tsx +56 -0
- package/components/motion/cursor.tsx +108 -0
- package/components/motion/highlight.tsx +605 -0
- package/components/motion/number-ticker.tsx +55 -0
- package/components/motion/slot.tsx +106 -0
- package/components/motion/waves.tsx +417 -0
- package/components/primitives/tabs.tsx +174 -0
- package/components/ui/Accordion/index.stories.tsx +39 -0
- package/components/ui/Accordion/index.tsx +170 -0
- package/components/ui/Alert/index.stories.tsx +39 -0
- package/components/ui/Alert/index.tsx +60 -0
- package/components/ui/AlertDialog/index.stories.tsx +47 -0
- package/components/ui/AlertDialog/index.tsx +172 -0
- package/components/ui/AspectRatio/index.stories.tsx +40 -0
- package/components/ui/AspectRatio/index.tsx +9 -0
- package/components/ui/Avatar/index.stories.tsx +39 -0
- package/components/ui/Avatar/index.tsx +44 -0
- package/components/ui/Badge/index.stories.tsx +64 -0
- package/components/ui/Badge/index.tsx +46 -0
- package/components/ui/Breadcrumb/index.stories.tsx +64 -0
- package/components/ui/Breadcrumb/index.tsx +102 -0
- package/components/ui/Button/index.stories.tsx +232 -0
- package/components/ui/Button/index.tsx +114 -0
- package/components/ui/Calendar/index.stories.tsx +20 -0
- package/components/ui/Calendar/index.tsx +149 -0
- package/components/ui/Card/index.stories.tsx +39 -0
- package/components/ui/Card/index.tsx +65 -0
- package/components/ui/Carousel/index.stories.tsx +37 -0
- package/components/ui/Carousel/index.tsx +242 -0
- package/components/ui/Chart/index.stories.tsx +53 -0
- package/components/ui/Chart/index.tsx +322 -0
- package/components/ui/Checkbox/index.stories.tsx +56 -0
- package/components/ui/Checkbox/index.tsx +167 -0
- package/components/ui/CircleProcess/index.stories.tsx +29 -0
- package/components/ui/CircleProcess/index.tsx +50 -0
- package/components/ui/Collapsible/index.stories.tsx +33 -0
- package/components/ui/Collapsible/index.tsx +124 -0
- package/components/ui/Command/index.stories.tsx +65 -0
- package/components/ui/Command/index.tsx +161 -0
- package/components/ui/Container/index.stories.tsx +22 -0
- package/components/ui/Container/index.tsx +30 -0
- package/components/ui/ContextMenu/index.stories.tsx +51 -0
- package/components/ui/ContextMenu/index.tsx +224 -0
- package/components/ui/Dialog/index.stories.tsx +44 -0
- package/components/ui/Dialog/index.tsx +156 -0
- package/components/ui/Drawer/index.stories.tsx +54 -0
- package/components/ui/Drawer/index.tsx +124 -0
- package/components/ui/DropdownMenu/index.stories.tsx +83 -0
- package/components/ui/DropdownMenu/index.tsx +231 -0
- package/components/ui/Dropzone/index.stories.tsx +18 -0
- package/components/ui/Dropzone/index.tsx +47 -0
- package/components/ui/Form/date-field.tsx +77 -0
- package/components/ui/Form/index.stories.tsx +67 -0
- package/components/ui/Form/index.tsx +188 -0
- package/components/ui/Form/select-field.tsx +55 -0
- package/components/ui/Form/text-area-field.tsx +37 -0
- package/components/ui/Form/text-field.tsx +72 -0
- package/components/ui/HStack/index.stories.tsx +48 -0
- package/components/ui/HStack/index.tsx +73 -0
- package/components/ui/HoverCard/index.stories.tsx +38 -0
- package/components/ui/HoverCard/index.tsx +38 -0
- package/components/ui/Icons/index.stories.tsx +27 -0
- package/components/ui/Icons/index.tsx +33 -0
- package/components/ui/ImageWithFallback/index.stories.tsx +32 -0
- package/components/ui/ImageWithFallback/index.tsx +34 -0
- package/components/ui/Input/index.stories.tsx +47 -0
- package/components/ui/Input/index.tsx +21 -0
- package/components/ui/InputOtp/index.stories.tsx +35 -0
- package/components/ui/InputOtp/index.tsx +70 -0
- package/components/ui/Label/index.stories.tsx +18 -0
- package/components/ui/Label/index.tsx +21 -0
- package/components/ui/Marquee/index.stories.tsx +71 -0
- package/components/ui/Marquee/index.tsx +65 -0
- package/components/ui/Menubar/index.stories.tsx +116 -0
- package/components/ui/Menubar/index.tsx +252 -0
- package/components/ui/NavigationMenu/index.stories.tsx +112 -0
- package/components/ui/NavigationMenu/index.tsx +185 -0
- package/components/ui/NoData/index.stories.tsx +24 -0
- package/components/ui/NoData/index.tsx +19 -0
- package/components/ui/Pagination/index.stories.tsx +53 -0
- package/components/ui/Pagination/index.tsx +114 -0
- package/components/ui/Popover/index.stories.tsx +31 -0
- package/components/ui/Popover/index.tsx +42 -0
- package/components/ui/Progress/index.stories.tsx +35 -0
- package/components/ui/Progress/index.tsx +28 -0
- package/components/ui/RadioGroup/index.stories.tsx +28 -0
- package/components/ui/RadioGroup/index.tsx +45 -0
- package/components/ui/Resizable/index.stories.tsx +44 -0
- package/components/ui/Resizable/index.tsx +54 -0
- package/components/ui/ScrollArea/index.stories.tsx +31 -0
- package/components/ui/ScrollArea/index.tsx +56 -0
- package/components/ui/Select/index.stories.tsx +64 -0
- package/components/ui/Select/index.tsx +170 -0
- package/components/ui/Separator/index.stories.tsx +31 -0
- package/components/ui/Separator/index.tsx +28 -0
- package/components/ui/Sheet/index.stories.tsx +45 -0
- package/components/ui/Sheet/index.tsx +130 -0
- package/components/ui/Sidebar/index.stories.tsx +82 -0
- package/components/ui/Sidebar/index.tsx +676 -0
- package/components/ui/Skeleton/index.stories.tsx +36 -0
- package/components/ui/Skeleton/index.tsx +13 -0
- package/components/ui/Slider/index.stories.tsx +48 -0
- package/components/ui/Slider/index.tsx +82 -0
- package/components/ui/Slot/index.stories.tsx +29 -0
- package/components/ui/Slot/index.tsx +106 -0
- package/components/ui/Sonner/index.stories.tsx +36 -0
- package/components/ui/Sonner/index.tsx +31 -0
- package/components/ui/Switch/index.stories.tsx +33 -0
- package/components/ui/Switch/index.tsx +28 -0
- package/components/ui/Table/index.stories.tsx +74 -0
- package/components/ui/Table/index.tsx +95 -0
- package/components/ui/Tabs/index.stories.tsx +38 -0
- package/components/ui/Tabs/index.tsx +78 -0
- package/components/ui/Text/index.stories.tsx +53 -0
- package/components/ui/Text/index.tsx +138 -0
- package/components/ui/Textarea/index.stories.tsx +25 -0
- package/components/ui/Textarea/index.tsx +18 -0
- package/components/ui/Toggle/index.stories.tsx +52 -0
- package/components/ui/Toggle/index.tsx +46 -0
- package/components/ui/ToggleGroup/index.stories.tsx +52 -0
- package/components/ui/ToggleGroup/index.tsx +69 -0
- package/components/ui/Tooltip/index.stories.tsx +29 -0
- package/components/ui/Tooltip/index.tsx +35 -0
- package/components/ui/VStack/index.stories.tsx +45 -0
- package/components/ui/VStack/index.tsx +69 -0
- package/components/ui/colors.stories.tsx +148 -0
- package/dist/arrow-left-46B4CAEY.svg +1 -0
- package/dist/file-4IXBJF4J.svg +1 -0
- package/dist/globe-KVAXBN2U.svg +1 -0
- package/dist/index.cjs +6001 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +693 -0
- package/dist/index.d.ts +693 -0
- package/dist/index.js +5714 -0
- package/dist/index.js.map +1 -0
- package/dist/logo-line-QLUD5DAV.svg +1 -0
- package/dist/next-HOXZBJQP.svg +1 -0
- package/dist/panel-left-expand-SIPFBG4J.svg +1 -0
- package/dist/placeholder-H3V4XYVI.svg +57 -0
- package/dist/vercel-KFYFHF3A.svg +1 -0
- package/dist/window-JNUL4Q2E.svg +1 -0
- package/eslint.config.js +10 -0
- package/globals.css +994 -0
- package/hooks/index.ts +3 -0
- package/hooks/use-auto-height.tsx +99 -0
- package/hooks/use-controlled-state.tsx +32 -0
- package/hooks/use-mobile.ts +19 -0
- package/index.ts +58 -0
- package/lib/get-strict-context.ts +15 -0
- package/lib/utils.ts +10 -0
- package/package.json +107 -0
- package/scripts/generate-exports.ts +32 -0
- package/tsconfig.json +12 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/tsup.config.ts +11 -0
- package/types/svg.d.ts +10 -0
- package/vercel.json +5 -0
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
{
|
|
2
|
+
"nm": "Main Scene",
|
|
3
|
+
"ddd": 0,
|
|
4
|
+
"h": 500,
|
|
5
|
+
"w": 500,
|
|
6
|
+
"meta": { "g": "@lottiefiles/creator 1.15.0" },
|
|
7
|
+
"layers": [
|
|
8
|
+
{
|
|
9
|
+
"ty": 4,
|
|
10
|
+
"nm": "Ellipse 1",
|
|
11
|
+
"sr": 1,
|
|
12
|
+
"st": 0,
|
|
13
|
+
"op": 120,
|
|
14
|
+
"ip": 0,
|
|
15
|
+
"hd": false,
|
|
16
|
+
"ddd": 0,
|
|
17
|
+
"bm": 0,
|
|
18
|
+
"hasMask": false,
|
|
19
|
+
"ao": 0,
|
|
20
|
+
"ks": {
|
|
21
|
+
"a": { "a": 0, "k": [0, 0] },
|
|
22
|
+
"s": { "a": 0, "k": [80, 80] },
|
|
23
|
+
"sk": { "a": 0, "k": 0 },
|
|
24
|
+
"p": { "a": 0, "k": [246, 247] },
|
|
25
|
+
"r": {
|
|
26
|
+
"a": 1,
|
|
27
|
+
"k": [
|
|
28
|
+
{ "o": { "x": 0, "y": 0 }, "i": { "x": 1, "y": 1 }, "s": [160], "t": 0 },
|
|
29
|
+
{ "s": [-200], "t": 119 }
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"sa": { "a": 0, "k": 0 },
|
|
33
|
+
"o": { "a": 0, "k": 100 }
|
|
34
|
+
},
|
|
35
|
+
"ef": [],
|
|
36
|
+
"shapes": [
|
|
37
|
+
{
|
|
38
|
+
"ty": "sh",
|
|
39
|
+
"bm": 0,
|
|
40
|
+
"hd": false,
|
|
41
|
+
"nm": "Ellipse Path 1",
|
|
42
|
+
"d": 1,
|
|
43
|
+
"ks": {
|
|
44
|
+
"a": 0,
|
|
45
|
+
"k": {
|
|
46
|
+
"c": true,
|
|
47
|
+
"i": [
|
|
48
|
+
[-73.9546, 0],
|
|
49
|
+
[0, -73.9546],
|
|
50
|
+
[73.9546, 0],
|
|
51
|
+
[0, 73.9546]
|
|
52
|
+
],
|
|
53
|
+
"o": [
|
|
54
|
+
[73.9546, 0],
|
|
55
|
+
[0, 73.9546],
|
|
56
|
+
[-73.9546, 0],
|
|
57
|
+
[0, -73.9546]
|
|
58
|
+
],
|
|
59
|
+
"v": [
|
|
60
|
+
[0, -134],
|
|
61
|
+
[134, 0],
|
|
62
|
+
[0, 134],
|
|
63
|
+
[-134, 0]
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"ty": "tm",
|
|
70
|
+
"bm": 0,
|
|
71
|
+
"hd": false,
|
|
72
|
+
"nm": "Trim Path",
|
|
73
|
+
"e": {
|
|
74
|
+
"a": 1,
|
|
75
|
+
"k": [
|
|
76
|
+
{ "o": { "x": 0.65, "y": 0 }, "i": { "x": 0.36, "y": 1 }, "s": [100], "t": 4 },
|
|
77
|
+
{ "s": [0], "t": 120 }
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
"o": { "a": 0, "k": 0 },
|
|
81
|
+
"s": {
|
|
82
|
+
"a": 1,
|
|
83
|
+
"k": [
|
|
84
|
+
{ "o": { "x": 0.55, "y": 0.06 }, "i": { "x": 0.36, "y": 1 }, "s": [100], "t": 0 },
|
|
85
|
+
{ "s": [0], "t": 116 }
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
"m": 1
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"ty": "st",
|
|
92
|
+
"bm": 0,
|
|
93
|
+
"hd": false,
|
|
94
|
+
"nm": "Stroke",
|
|
95
|
+
"lc": 2,
|
|
96
|
+
"lj": 2,
|
|
97
|
+
"ml": 1,
|
|
98
|
+
"o": { "a": 0, "k": 100 },
|
|
99
|
+
"w": { "a": 0, "k": 28 },
|
|
100
|
+
"c": { "a": 0, "k": [0.0627, 0.3255, 0.9529, 1] }
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
"ind": 1
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"ty": 4,
|
|
107
|
+
"nm": "Ellipse 1",
|
|
108
|
+
"sr": 1,
|
|
109
|
+
"st": 0,
|
|
110
|
+
"op": 120,
|
|
111
|
+
"ip": 0,
|
|
112
|
+
"hd": false,
|
|
113
|
+
"ddd": 0,
|
|
114
|
+
"bm": 0,
|
|
115
|
+
"hasMask": false,
|
|
116
|
+
"ao": 0,
|
|
117
|
+
"ks": {
|
|
118
|
+
"a": { "a": 0, "k": [0, 0] },
|
|
119
|
+
"s": { "a": 0, "k": [80, 80] },
|
|
120
|
+
"sk": { "a": 0, "k": 0 },
|
|
121
|
+
"p": { "a": 0, "k": [246, 247] },
|
|
122
|
+
"r": {
|
|
123
|
+
"a": 1,
|
|
124
|
+
"k": [
|
|
125
|
+
{ "o": { "x": 0, "y": 0 }, "i": { "x": 1, "y": 1 }, "s": [60], "t": 0 },
|
|
126
|
+
{ "s": [-300], "t": 119 }
|
|
127
|
+
]
|
|
128
|
+
},
|
|
129
|
+
"sa": { "a": 0, "k": 0 },
|
|
130
|
+
"o": { "a": 0, "k": 100 }
|
|
131
|
+
},
|
|
132
|
+
"ef": [],
|
|
133
|
+
"shapes": [
|
|
134
|
+
{
|
|
135
|
+
"ty": "sh",
|
|
136
|
+
"bm": 0,
|
|
137
|
+
"hd": false,
|
|
138
|
+
"nm": "Ellipse Path 1",
|
|
139
|
+
"d": 1,
|
|
140
|
+
"ks": {
|
|
141
|
+
"a": 0,
|
|
142
|
+
"k": {
|
|
143
|
+
"c": true,
|
|
144
|
+
"i": [
|
|
145
|
+
[-73.9546, 0],
|
|
146
|
+
[0, -73.9546],
|
|
147
|
+
[73.9546, 0],
|
|
148
|
+
[0, 73.9546]
|
|
149
|
+
],
|
|
150
|
+
"o": [
|
|
151
|
+
[73.9546, 0],
|
|
152
|
+
[0, 73.9546],
|
|
153
|
+
[-73.9546, 0],
|
|
154
|
+
[0, -73.9546]
|
|
155
|
+
],
|
|
156
|
+
"v": [
|
|
157
|
+
[0, -134],
|
|
158
|
+
[134, 0],
|
|
159
|
+
[0, 134],
|
|
160
|
+
[-134, 0]
|
|
161
|
+
]
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"ty": "tm",
|
|
167
|
+
"bm": 0,
|
|
168
|
+
"hd": false,
|
|
169
|
+
"nm": "Trim Path",
|
|
170
|
+
"e": {
|
|
171
|
+
"a": 1,
|
|
172
|
+
"k": [
|
|
173
|
+
{ "o": { "x": 0.65, "y": 0 }, "i": { "x": 0.36, "y": 1 }, "s": [100], "t": 26 },
|
|
174
|
+
{ "s": [0], "t": 120 }
|
|
175
|
+
]
|
|
176
|
+
},
|
|
177
|
+
"o": { "a": 0, "k": 0 },
|
|
178
|
+
"s": {
|
|
179
|
+
"a": 1,
|
|
180
|
+
"k": [
|
|
181
|
+
{ "o": { "x": 0.55, "y": 0.06 }, "i": { "x": 0.36, "y": 1 }, "s": [100], "t": 0 },
|
|
182
|
+
{ "s": [0], "t": 96 }
|
|
183
|
+
]
|
|
184
|
+
},
|
|
185
|
+
"m": 1
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"ty": "st",
|
|
189
|
+
"bm": 0,
|
|
190
|
+
"hd": false,
|
|
191
|
+
"nm": "Stroke",
|
|
192
|
+
"lc": 2,
|
|
193
|
+
"lj": 2,
|
|
194
|
+
"ml": 1,
|
|
195
|
+
"o": { "a": 0, "k": 100 },
|
|
196
|
+
"w": { "a": 0, "k": 28 },
|
|
197
|
+
"c": { "a": 0, "k": [0.0627, 0.3255, 0.9529, 1] }
|
|
198
|
+
}
|
|
199
|
+
],
|
|
200
|
+
"ind": 2
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"ty": 4,
|
|
204
|
+
"nm": "Ellipse 1",
|
|
205
|
+
"sr": 1,
|
|
206
|
+
"st": 0,
|
|
207
|
+
"op": 122,
|
|
208
|
+
"ip": 0,
|
|
209
|
+
"hd": false,
|
|
210
|
+
"ddd": 0,
|
|
211
|
+
"bm": 0,
|
|
212
|
+
"hasMask": false,
|
|
213
|
+
"ao": 0,
|
|
214
|
+
"ks": {
|
|
215
|
+
"a": { "a": 0, "k": [0, 0] },
|
|
216
|
+
"s": { "a": 0, "k": [100, 100] },
|
|
217
|
+
"sk": { "a": 0, "k": 0 },
|
|
218
|
+
"p": { "a": 0, "k": [246, 247] },
|
|
219
|
+
"r": {
|
|
220
|
+
"a": 1,
|
|
221
|
+
"k": [
|
|
222
|
+
{ "o": { "x": 0, "y": 0 }, "i": { "x": 1, "y": 1 }, "s": [0], "t": 0 },
|
|
223
|
+
{ "s": [-359], "t": 120 }
|
|
224
|
+
]
|
|
225
|
+
},
|
|
226
|
+
"sa": { "a": 0, "k": 0 },
|
|
227
|
+
"o": { "a": 0, "k": 100 }
|
|
228
|
+
},
|
|
229
|
+
"ef": [],
|
|
230
|
+
"shapes": [
|
|
231
|
+
{
|
|
232
|
+
"ty": "sh",
|
|
233
|
+
"bm": 0,
|
|
234
|
+
"hd": false,
|
|
235
|
+
"nm": "Ellipse Path 1",
|
|
236
|
+
"d": 1,
|
|
237
|
+
"ks": {
|
|
238
|
+
"a": 0,
|
|
239
|
+
"k": {
|
|
240
|
+
"c": true,
|
|
241
|
+
"i": [
|
|
242
|
+
[-73.9546, 0],
|
|
243
|
+
[0, -73.9546],
|
|
244
|
+
[73.9546, 0],
|
|
245
|
+
[0, 73.9546]
|
|
246
|
+
],
|
|
247
|
+
"o": [
|
|
248
|
+
[73.9546, 0],
|
|
249
|
+
[0, 73.9546],
|
|
250
|
+
[-73.9546, 0],
|
|
251
|
+
[0, -73.9546]
|
|
252
|
+
],
|
|
253
|
+
"v": [
|
|
254
|
+
[0, -134],
|
|
255
|
+
[134, 0],
|
|
256
|
+
[0, 134],
|
|
257
|
+
[-134, 0]
|
|
258
|
+
]
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
"ty": "tm",
|
|
264
|
+
"bm": 0,
|
|
265
|
+
"hd": false,
|
|
266
|
+
"nm": "Trim Path",
|
|
267
|
+
"e": {
|
|
268
|
+
"a": 1,
|
|
269
|
+
"k": [
|
|
270
|
+
{ "o": { "x": 0.65, "y": 0 }, "i": { "x": 0.36, "y": 1 }, "s": [100], "t": 26 },
|
|
271
|
+
{ "s": [0], "t": 120 }
|
|
272
|
+
]
|
|
273
|
+
},
|
|
274
|
+
"o": { "a": 0, "k": 0 },
|
|
275
|
+
"s": {
|
|
276
|
+
"a": 1,
|
|
277
|
+
"k": [
|
|
278
|
+
{ "o": { "x": 0.55, "y": 0.06 }, "i": { "x": 0.36, "y": 1 }, "s": [100], "t": 0 },
|
|
279
|
+
{ "s": [0], "t": 96 }
|
|
280
|
+
]
|
|
281
|
+
},
|
|
282
|
+
"m": 1
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
"ty": "st",
|
|
286
|
+
"bm": 0,
|
|
287
|
+
"hd": false,
|
|
288
|
+
"nm": "Stroke",
|
|
289
|
+
"lc": 2,
|
|
290
|
+
"lj": 2,
|
|
291
|
+
"ml": 1,
|
|
292
|
+
"o": { "a": 0, "k": 100 },
|
|
293
|
+
"w": { "a": 0, "k": 10 },
|
|
294
|
+
"c": { "a": 0, "k": [0.8992, 0.9237, 0.9808, 1] }
|
|
295
|
+
}
|
|
296
|
+
],
|
|
297
|
+
"ind": 3
|
|
298
|
+
}
|
|
299
|
+
],
|
|
300
|
+
"v": "5.7.0",
|
|
301
|
+
"fr": 60,
|
|
302
|
+
"op": 120,
|
|
303
|
+
"ip": 0,
|
|
304
|
+
"assets": []
|
|
305
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Meta } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
<Meta title="Welcome" />
|
|
4
|
+
|
|
5
|
+
# Welcome 👋🏼
|
|
6
|
+
|
|
7
|
+
Welcome to the **@luanthnh/cntt-ui** component library. A modern, high-performance UI component library built with **React**, **Tailwind CSS (v4)**, **Radix UI**, and **Framer Motion**.
|
|
8
|
+
|
|
9
|
+
🔗 **Live Demo**: [https://cntt-ui.vercel.app/](https://cntt-ui.vercel.app/)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 📦 Install
|
|
14
|
+
|
|
15
|
+
Use your preferred package manager to install the library:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# npm
|
|
19
|
+
npm install @luanthnh/cntt-ui
|
|
20
|
+
|
|
21
|
+
# pnpm
|
|
22
|
+
pnpm add @luanthnh/cntt-ui
|
|
23
|
+
|
|
24
|
+
# yarn
|
|
25
|
+
yarn add @luanthnh/cntt-ui
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 🛠️ Setup
|
|
31
|
+
|
|
32
|
+
To get started, follow these simple steps:
|
|
33
|
+
|
|
34
|
+
### 1. Import Global CSS
|
|
35
|
+
|
|
36
|
+
Include the global styles in your application's entry point (e.g., `layout.tsx` or `index.tsx`):
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
import '@luanthnh/cntt-ui/globals.css';
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### 2. Configure Tailwind CSS (v4)
|
|
43
|
+
|
|
44
|
+
Ensure your project is set up with Tailwind CSS v4. If you are using Next.js, make sure to configure `@tailwindcss/postcss` for optimal performance.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## 🚀 Use the component
|
|
49
|
+
|
|
50
|
+
Start using our premium components in your project:
|
|
51
|
+
|
|
52
|
+
```tsx
|
|
53
|
+
import { Button, Card, Text } from '@luanthnh/cntt-ui';
|
|
54
|
+
|
|
55
|
+
export default function App() {
|
|
56
|
+
return (
|
|
57
|
+
<Card className="max-w-sm p-6">
|
|
58
|
+
<Text variant="h3" className="mb-4">
|
|
59
|
+
Hello World!
|
|
60
|
+
</Text>
|
|
61
|
+
<Text className="mb-6 opacity-80">
|
|
62
|
+
You are now using the powerful @luanthnh/cntt-ui components.
|
|
63
|
+
</Text>
|
|
64
|
+
<Button variant="primary" onClick={() => alert('Ready to build!')}>
|
|
65
|
+
Get Started
|
|
66
|
+
</Button>
|
|
67
|
+
</Card>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
Designed with ❤️ for a superior developer experience.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import type { LenisOptions } from 'lenis';
|
|
4
|
+
|
|
5
|
+
import 'lenis/dist/lenis.css';
|
|
6
|
+
|
|
7
|
+
import { useRef } from 'react';
|
|
8
|
+
import { LenisRef, ReactLenis, LenisProps as ReactLenisProps } from 'lenis/react';
|
|
9
|
+
import { useTempus } from 'tempus/react';
|
|
10
|
+
|
|
11
|
+
interface LenisProps extends Omit<ReactLenisProps, 'ref'> {
|
|
12
|
+
root: boolean;
|
|
13
|
+
options: LenisOptions;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function Lenis({ root, options }: LenisProps) {
|
|
17
|
+
const lenisRef = useRef<LenisRef>(null);
|
|
18
|
+
// const lenis = useLenis();
|
|
19
|
+
|
|
20
|
+
useTempus((time: number) => {
|
|
21
|
+
if (lenisRef.current?.lenis) {
|
|
22
|
+
lenisRef.current.lenis.raf(time);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// useEffect(() => {
|
|
27
|
+
// if (isNavOpened) {
|
|
28
|
+
// lenis?.stop();
|
|
29
|
+
// } else {
|
|
30
|
+
// lenis?.start();
|
|
31
|
+
// }
|
|
32
|
+
// }, [isNavOpened, lenis]);
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<ReactLenis
|
|
36
|
+
ref={lenisRef}
|
|
37
|
+
root={root}
|
|
38
|
+
options={{
|
|
39
|
+
...options,
|
|
40
|
+
lerp: options?.lerp ?? 0.125,
|
|
41
|
+
autoRaf: false,
|
|
42
|
+
anchors: true,
|
|
43
|
+
prevent: (node: Element | null) =>
|
|
44
|
+
node?.nodeName === 'VERCEL-LIVE-FEEDBACK' || node?.id === 'theatrejs-studio-root',
|
|
45
|
+
}}
|
|
46
|
+
/>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import {
|
|
5
|
+
motion,
|
|
6
|
+
type AnimationControls,
|
|
7
|
+
type HTMLMotionProps,
|
|
8
|
+
type TargetAndTransition,
|
|
9
|
+
type Transition,
|
|
10
|
+
} from 'motion/react';
|
|
11
|
+
|
|
12
|
+
import { useAutoHeight } from '@/hooks/use-auto-height';
|
|
13
|
+
|
|
14
|
+
import { Slot, WithAsChild } from './slot';
|
|
15
|
+
|
|
16
|
+
type AutoHeightProps = WithAsChild<
|
|
17
|
+
{
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
deps?: React.DependencyList;
|
|
20
|
+
animate?: TargetAndTransition | AnimationControls;
|
|
21
|
+
transition?: Transition;
|
|
22
|
+
} & Omit<HTMLMotionProps<'div'>, 'animate'>
|
|
23
|
+
>;
|
|
24
|
+
|
|
25
|
+
function AutoHeight({
|
|
26
|
+
children,
|
|
27
|
+
deps = [],
|
|
28
|
+
transition = {
|
|
29
|
+
type: 'spring',
|
|
30
|
+
stiffness: 300,
|
|
31
|
+
damping: 30,
|
|
32
|
+
bounce: 0,
|
|
33
|
+
restDelta: 0.01,
|
|
34
|
+
},
|
|
35
|
+
style,
|
|
36
|
+
animate,
|
|
37
|
+
asChild = false,
|
|
38
|
+
...props
|
|
39
|
+
}: AutoHeightProps) {
|
|
40
|
+
const { ref, height } = useAutoHeight<HTMLDivElement>(deps);
|
|
41
|
+
|
|
42
|
+
const Comp = asChild ? Slot : motion.div;
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<Comp
|
|
46
|
+
style={{ overflow: 'hidden', ...style }}
|
|
47
|
+
animate={{ height, ...animate }}
|
|
48
|
+
transition={transition}
|
|
49
|
+
{...props}
|
|
50
|
+
>
|
|
51
|
+
<div ref={ref}>{children}</div>
|
|
52
|
+
</Comp>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export { AutoHeight, type AutoHeightProps };
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useEffect, useRef, useState } from 'react';
|
|
4
|
+
|
|
5
|
+
export default function Cursor() {
|
|
6
|
+
const mousePosition = useRef({ x: 0, y: 0 });
|
|
7
|
+
|
|
8
|
+
const dotPosition = useRef({ x: 0, y: 0 });
|
|
9
|
+
const borderDotPosition = useRef({ x: 0, y: 0 });
|
|
10
|
+
|
|
11
|
+
const [renderPos, setRenderPos] = useState({ dot: { x: 0, y: 0 }, border: { x: 0, y: 0 } });
|
|
12
|
+
const [isHovering, setIsHovering] = useState(false);
|
|
13
|
+
|
|
14
|
+
const DOT_SMOOTHNESS = 0.2;
|
|
15
|
+
const BORDER_DOT_SMOOTHNESS = 0.1;
|
|
16
|
+
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
const handleMouseMove = (e: MouseEvent) => {
|
|
19
|
+
mousePosition.current = { x: e.clientX, y: e.clientY };
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const handleMouseEnter = () => setIsHovering(true);
|
|
23
|
+
const handleMouseLeave = () => setIsHovering(false);
|
|
24
|
+
|
|
25
|
+
// Add event listeners
|
|
26
|
+
window.addEventListener('mousemove', handleMouseMove);
|
|
27
|
+
|
|
28
|
+
const interactiveElements = document.querySelectorAll(
|
|
29
|
+
'a, button, img, input, textarea, select',
|
|
30
|
+
);
|
|
31
|
+
interactiveElements.forEach((element) => {
|
|
32
|
+
element.addEventListener('mouseenter', handleMouseEnter);
|
|
33
|
+
element.addEventListener('mouseleave', handleMouseLeave);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
// Animation function for smooth movement
|
|
37
|
+
const animate = () => {
|
|
38
|
+
const lerp = (start: number, end: number, factor: number) => {
|
|
39
|
+
return start + (end - start) * factor;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
dotPosition.current.x = lerp(dotPosition.current.x, mousePosition.current.x, DOT_SMOOTHNESS);
|
|
43
|
+
dotPosition.current.y = lerp(dotPosition.current.y, mousePosition.current.y, DOT_SMOOTHNESS);
|
|
44
|
+
|
|
45
|
+
borderDotPosition.current.x = lerp(
|
|
46
|
+
borderDotPosition.current.x,
|
|
47
|
+
mousePosition.current.x,
|
|
48
|
+
BORDER_DOT_SMOOTHNESS,
|
|
49
|
+
);
|
|
50
|
+
borderDotPosition.current.y = lerp(
|
|
51
|
+
borderDotPosition.current.y,
|
|
52
|
+
mousePosition.current.y,
|
|
53
|
+
BORDER_DOT_SMOOTHNESS,
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
setRenderPos({
|
|
57
|
+
dot: { x: dotPosition.current.x, y: dotPosition.current.y },
|
|
58
|
+
border: { x: borderDotPosition.current.x, y: borderDotPosition.current.y },
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
requestAnimationFrame(animate);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
// Start animation loop
|
|
65
|
+
const animationId = requestAnimationFrame(animate);
|
|
66
|
+
|
|
67
|
+
// Clean up
|
|
68
|
+
return () => {
|
|
69
|
+
window.removeEventListener('mousemove', handleMouseMove);
|
|
70
|
+
|
|
71
|
+
interactiveElements.forEach((element) => {
|
|
72
|
+
element.removeEventListener('mouseenter', handleMouseEnter);
|
|
73
|
+
element.removeEventListener('mouseleave', handleMouseLeave);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
cancelAnimationFrame(animationId);
|
|
77
|
+
};
|
|
78
|
+
}, []);
|
|
79
|
+
|
|
80
|
+
if (typeof window === 'undefined') return null;
|
|
81
|
+
|
|
82
|
+
return (
|
|
83
|
+
<div className="pointer-events-none fixed inset-0 z-[999]">
|
|
84
|
+
<div
|
|
85
|
+
className="bg-primary absolute rounded-full"
|
|
86
|
+
style={{
|
|
87
|
+
width: '8px',
|
|
88
|
+
height: '8px',
|
|
89
|
+
transform: 'translate(-50%, -50%)',
|
|
90
|
+
left: `${renderPos.dot.x}px`,
|
|
91
|
+
top: `${renderPos.dot.y}px`,
|
|
92
|
+
}}
|
|
93
|
+
/>
|
|
94
|
+
|
|
95
|
+
<div
|
|
96
|
+
className="border-primary absolute rounded-full border"
|
|
97
|
+
style={{
|
|
98
|
+
width: isHovering ? '32px' : '24px',
|
|
99
|
+
height: isHovering ? '32px' : '24px',
|
|
100
|
+
transform: 'translate(-50%, -50%)',
|
|
101
|
+
left: `${renderPos.border.x}px`,
|
|
102
|
+
top: `${renderPos.border.y}px`,
|
|
103
|
+
transition: 'width 0.3s, height 0.3s',
|
|
104
|
+
}}
|
|
105
|
+
/>
|
|
106
|
+
</div>
|
|
107
|
+
);
|
|
108
|
+
}
|