@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.
Files changed (238) hide show
  1. package/package.json +5 -1
  2. package/.storybook/globals.d.ts +0 -1
  3. package/.storybook/main.ts +0 -29
  4. package/.storybook/preview.ts +0 -32
  5. package/assets/fonts/Montserrat-Black.eot +0 -0
  6. package/assets/fonts/Montserrat-Black.ttf +0 -0
  7. package/assets/fonts/Montserrat-Black.woff +0 -0
  8. package/assets/fonts/Montserrat-Black.woff2 +0 -0
  9. package/assets/fonts/Montserrat-BlackItalic.eot +0 -0
  10. package/assets/fonts/Montserrat-BlackItalic.ttf +0 -0
  11. package/assets/fonts/Montserrat-BlackItalic.woff +0 -0
  12. package/assets/fonts/Montserrat-BlackItalic.woff2 +0 -0
  13. package/assets/fonts/Montserrat-Bold.eot +0 -0
  14. package/assets/fonts/Montserrat-Bold.ttf +0 -0
  15. package/assets/fonts/Montserrat-Bold.woff +0 -0
  16. package/assets/fonts/Montserrat-Bold.woff2 +0 -0
  17. package/assets/fonts/Montserrat-BoldItalic.eot +0 -0
  18. package/assets/fonts/Montserrat-BoldItalic.ttf +0 -0
  19. package/assets/fonts/Montserrat-BoldItalic.woff +0 -0
  20. package/assets/fonts/Montserrat-BoldItalic.woff2 +0 -0
  21. package/assets/fonts/Montserrat-ExtraBold.eot +0 -0
  22. package/assets/fonts/Montserrat-ExtraBold.ttf +0 -0
  23. package/assets/fonts/Montserrat-ExtraBold.woff +0 -0
  24. package/assets/fonts/Montserrat-ExtraBold.woff2 +0 -0
  25. package/assets/fonts/Montserrat-ExtraBoldItalic.eot +0 -0
  26. package/assets/fonts/Montserrat-ExtraBoldItalic.ttf +0 -0
  27. package/assets/fonts/Montserrat-ExtraBoldItalic.woff +0 -0
  28. package/assets/fonts/Montserrat-ExtraBoldItalic.woff2 +0 -0
  29. package/assets/fonts/Montserrat-ExtraLight.eot +0 -0
  30. package/assets/fonts/Montserrat-ExtraLight.ttf +0 -0
  31. package/assets/fonts/Montserrat-ExtraLight.woff +0 -0
  32. package/assets/fonts/Montserrat-ExtraLight.woff2 +0 -0
  33. package/assets/fonts/Montserrat-ExtraLightItalic.eot +0 -0
  34. package/assets/fonts/Montserrat-ExtraLightItalic.ttf +0 -0
  35. package/assets/fonts/Montserrat-ExtraLightItalic.woff +0 -0
  36. package/assets/fonts/Montserrat-ExtraLightItalic.woff2 +0 -0
  37. package/assets/fonts/Montserrat-Italic.eot +0 -0
  38. package/assets/fonts/Montserrat-Italic.ttf +0 -0
  39. package/assets/fonts/Montserrat-Italic.woff +0 -0
  40. package/assets/fonts/Montserrat-Italic.woff2 +0 -0
  41. package/assets/fonts/Montserrat-Light.eot +0 -0
  42. package/assets/fonts/Montserrat-Light.ttf +0 -0
  43. package/assets/fonts/Montserrat-Light.woff +0 -0
  44. package/assets/fonts/Montserrat-Light.woff2 +0 -0
  45. package/assets/fonts/Montserrat-LightItalic.eot +0 -0
  46. package/assets/fonts/Montserrat-LightItalic.ttf +0 -0
  47. package/assets/fonts/Montserrat-LightItalic.woff +0 -0
  48. package/assets/fonts/Montserrat-LightItalic.woff2 +0 -0
  49. package/assets/fonts/Montserrat-Medium.eot +0 -0
  50. package/assets/fonts/Montserrat-Medium.ttf +0 -0
  51. package/assets/fonts/Montserrat-Medium.woff +0 -0
  52. package/assets/fonts/Montserrat-Medium.woff2 +0 -0
  53. package/assets/fonts/Montserrat-MediumItalic.eot +0 -0
  54. package/assets/fonts/Montserrat-MediumItalic.ttf +0 -0
  55. package/assets/fonts/Montserrat-MediumItalic.woff +0 -0
  56. package/assets/fonts/Montserrat-MediumItalic.woff2 +0 -0
  57. package/assets/fonts/Montserrat-Regular.eot +0 -0
  58. package/assets/fonts/Montserrat-Regular.ttf +0 -0
  59. package/assets/fonts/Montserrat-Regular.woff +0 -0
  60. package/assets/fonts/Montserrat-Regular.woff2 +0 -0
  61. package/assets/fonts/Montserrat-SemiBold.eot +0 -0
  62. package/assets/fonts/Montserrat-SemiBold.ttf +0 -0
  63. package/assets/fonts/Montserrat-SemiBold.woff +0 -0
  64. package/assets/fonts/Montserrat-SemiBold.woff2 +0 -0
  65. package/assets/fonts/Montserrat-SemiBoldItalic.eot +0 -0
  66. package/assets/fonts/Montserrat-SemiBoldItalic.ttf +0 -0
  67. package/assets/fonts/Montserrat-SemiBoldItalic.woff +0 -0
  68. package/assets/fonts/Montserrat-SemiBoldItalic.woff2 +0 -0
  69. package/assets/fonts/Montserrat-Thin.eot +0 -0
  70. package/assets/fonts/Montserrat-Thin.ttf +0 -0
  71. package/assets/fonts/Montserrat-Thin.woff +0 -0
  72. package/assets/fonts/Montserrat-Thin.woff2 +0 -0
  73. package/assets/fonts/Montserrat-ThinItalic.eot +0 -0
  74. package/assets/fonts/Montserrat-ThinItalic.ttf +0 -0
  75. package/assets/fonts/Montserrat-ThinItalic.woff +0 -0
  76. package/assets/fonts/Montserrat-ThinItalic.woff2 +0 -0
  77. package/assets/fonts/Montserrat-Variable.eot +0 -0
  78. package/assets/fonts/Montserrat-Variable.ttf +0 -0
  79. package/assets/fonts/Montserrat-Variable.woff +0 -0
  80. package/assets/fonts/Montserrat-Variable.woff2 +0 -0
  81. package/assets/fonts/Montserrat-VariableItalic.eot +0 -0
  82. package/assets/fonts/Montserrat-VariableItalic.ttf +0 -0
  83. package/assets/fonts/Montserrat-VariableItalic.woff +0 -0
  84. package/assets/fonts/Montserrat-VariableItalic.woff2 +0 -0
  85. package/assets/icons/arrow-left.svg +0 -1
  86. package/assets/icons/file.svg +0 -1
  87. package/assets/icons/globe.svg +0 -1
  88. package/assets/icons/logo-line.svg +0 -1
  89. package/assets/icons/next.svg +0 -1
  90. package/assets/icons/panel-left-expand.svg +0 -1
  91. package/assets/icons/placeholder.svg +0 -57
  92. package/assets/icons/vercel.svg +0 -1
  93. package/assets/icons/window.svg +0 -1
  94. package/assets/lotties/error-404.json +0 -19642
  95. package/assets/lotties/error.json +0 -2414
  96. package/assets/lotties/loader.json +0 -305
  97. package/components/Welcome.mdx +0 -74
  98. package/components/lenis/index.tsx +0 -48
  99. package/components/motion/auto-height.tsx +0 -56
  100. package/components/motion/cursor.tsx +0 -108
  101. package/components/motion/highlight.tsx +0 -605
  102. package/components/motion/number-ticker.tsx +0 -55
  103. package/components/motion/slot.tsx +0 -106
  104. package/components/motion/waves.tsx +0 -417
  105. package/components/primitives/tabs.tsx +0 -174
  106. package/components/ui/Accordion/index.stories.tsx +0 -39
  107. package/components/ui/Accordion/index.tsx +0 -170
  108. package/components/ui/Alert/index.stories.tsx +0 -39
  109. package/components/ui/Alert/index.tsx +0 -60
  110. package/components/ui/AlertDialog/index.stories.tsx +0 -47
  111. package/components/ui/AlertDialog/index.tsx +0 -172
  112. package/components/ui/AspectRatio/index.stories.tsx +0 -40
  113. package/components/ui/AspectRatio/index.tsx +0 -9
  114. package/components/ui/Avatar/index.stories.tsx +0 -39
  115. package/components/ui/Avatar/index.tsx +0 -44
  116. package/components/ui/Badge/index.stories.tsx +0 -64
  117. package/components/ui/Badge/index.tsx +0 -46
  118. package/components/ui/Breadcrumb/index.stories.tsx +0 -64
  119. package/components/ui/Breadcrumb/index.tsx +0 -102
  120. package/components/ui/Button/index.stories.tsx +0 -232
  121. package/components/ui/Button/index.tsx +0 -114
  122. package/components/ui/Calendar/index.stories.tsx +0 -20
  123. package/components/ui/Calendar/index.tsx +0 -149
  124. package/components/ui/Card/index.stories.tsx +0 -39
  125. package/components/ui/Card/index.tsx +0 -65
  126. package/components/ui/Carousel/index.stories.tsx +0 -37
  127. package/components/ui/Carousel/index.tsx +0 -242
  128. package/components/ui/Chart/index.stories.tsx +0 -53
  129. package/components/ui/Chart/index.tsx +0 -322
  130. package/components/ui/Checkbox/index.stories.tsx +0 -56
  131. package/components/ui/Checkbox/index.tsx +0 -167
  132. package/components/ui/CircleProcess/index.stories.tsx +0 -29
  133. package/components/ui/CircleProcess/index.tsx +0 -50
  134. package/components/ui/Collapsible/index.stories.tsx +0 -33
  135. package/components/ui/Collapsible/index.tsx +0 -124
  136. package/components/ui/Command/index.stories.tsx +0 -65
  137. package/components/ui/Command/index.tsx +0 -161
  138. package/components/ui/Container/index.stories.tsx +0 -22
  139. package/components/ui/Container/index.tsx +0 -30
  140. package/components/ui/ContextMenu/index.stories.tsx +0 -51
  141. package/components/ui/ContextMenu/index.tsx +0 -224
  142. package/components/ui/Dialog/index.stories.tsx +0 -44
  143. package/components/ui/Dialog/index.tsx +0 -156
  144. package/components/ui/Drawer/index.stories.tsx +0 -54
  145. package/components/ui/Drawer/index.tsx +0 -124
  146. package/components/ui/DropdownMenu/index.stories.tsx +0 -83
  147. package/components/ui/DropdownMenu/index.tsx +0 -231
  148. package/components/ui/Dropzone/index.stories.tsx +0 -18
  149. package/components/ui/Dropzone/index.tsx +0 -47
  150. package/components/ui/Form/date-field.tsx +0 -77
  151. package/components/ui/Form/index.stories.tsx +0 -67
  152. package/components/ui/Form/index.tsx +0 -188
  153. package/components/ui/Form/select-field.tsx +0 -55
  154. package/components/ui/Form/text-area-field.tsx +0 -37
  155. package/components/ui/Form/text-field.tsx +0 -72
  156. package/components/ui/HStack/index.stories.tsx +0 -48
  157. package/components/ui/HStack/index.tsx +0 -73
  158. package/components/ui/HoverCard/index.stories.tsx +0 -38
  159. package/components/ui/HoverCard/index.tsx +0 -38
  160. package/components/ui/Icons/index.stories.tsx +0 -27
  161. package/components/ui/Icons/index.tsx +0 -33
  162. package/components/ui/ImageWithFallback/index.stories.tsx +0 -32
  163. package/components/ui/ImageWithFallback/index.tsx +0 -34
  164. package/components/ui/Input/index.stories.tsx +0 -47
  165. package/components/ui/Input/index.tsx +0 -21
  166. package/components/ui/InputOtp/index.stories.tsx +0 -35
  167. package/components/ui/InputOtp/index.tsx +0 -70
  168. package/components/ui/Label/index.stories.tsx +0 -18
  169. package/components/ui/Label/index.tsx +0 -21
  170. package/components/ui/Marquee/index.stories.tsx +0 -71
  171. package/components/ui/Marquee/index.tsx +0 -65
  172. package/components/ui/Menubar/index.stories.tsx +0 -116
  173. package/components/ui/Menubar/index.tsx +0 -252
  174. package/components/ui/NavigationMenu/index.stories.tsx +0 -112
  175. package/components/ui/NavigationMenu/index.tsx +0 -185
  176. package/components/ui/NoData/index.stories.tsx +0 -24
  177. package/components/ui/NoData/index.tsx +0 -19
  178. package/components/ui/Pagination/index.stories.tsx +0 -53
  179. package/components/ui/Pagination/index.tsx +0 -114
  180. package/components/ui/Popover/index.stories.tsx +0 -31
  181. package/components/ui/Popover/index.tsx +0 -42
  182. package/components/ui/Progress/index.stories.tsx +0 -35
  183. package/components/ui/Progress/index.tsx +0 -28
  184. package/components/ui/RadioGroup/index.stories.tsx +0 -28
  185. package/components/ui/RadioGroup/index.tsx +0 -45
  186. package/components/ui/Resizable/index.stories.tsx +0 -44
  187. package/components/ui/Resizable/index.tsx +0 -54
  188. package/components/ui/ScrollArea/index.stories.tsx +0 -31
  189. package/components/ui/ScrollArea/index.tsx +0 -56
  190. package/components/ui/Select/index.stories.tsx +0 -64
  191. package/components/ui/Select/index.tsx +0 -170
  192. package/components/ui/Separator/index.stories.tsx +0 -31
  193. package/components/ui/Separator/index.tsx +0 -28
  194. package/components/ui/Sheet/index.stories.tsx +0 -45
  195. package/components/ui/Sheet/index.tsx +0 -130
  196. package/components/ui/Sidebar/index.stories.tsx +0 -82
  197. package/components/ui/Sidebar/index.tsx +0 -676
  198. package/components/ui/Skeleton/index.stories.tsx +0 -36
  199. package/components/ui/Skeleton/index.tsx +0 -13
  200. package/components/ui/Slider/index.stories.tsx +0 -48
  201. package/components/ui/Slider/index.tsx +0 -82
  202. package/components/ui/Slot/index.stories.tsx +0 -29
  203. package/components/ui/Slot/index.tsx +0 -106
  204. package/components/ui/Sonner/index.stories.tsx +0 -36
  205. package/components/ui/Sonner/index.tsx +0 -31
  206. package/components/ui/Switch/index.stories.tsx +0 -33
  207. package/components/ui/Switch/index.tsx +0 -28
  208. package/components/ui/Table/index.stories.tsx +0 -74
  209. package/components/ui/Table/index.tsx +0 -95
  210. package/components/ui/Tabs/index.stories.tsx +0 -38
  211. package/components/ui/Tabs/index.tsx +0 -78
  212. package/components/ui/Text/index.stories.tsx +0 -53
  213. package/components/ui/Text/index.tsx +0 -138
  214. package/components/ui/Textarea/index.stories.tsx +0 -25
  215. package/components/ui/Textarea/index.tsx +0 -18
  216. package/components/ui/Toggle/index.stories.tsx +0 -52
  217. package/components/ui/Toggle/index.tsx +0 -46
  218. package/components/ui/ToggleGroup/index.stories.tsx +0 -52
  219. package/components/ui/ToggleGroup/index.tsx +0 -69
  220. package/components/ui/Tooltip/index.stories.tsx +0 -29
  221. package/components/ui/Tooltip/index.tsx +0 -35
  222. package/components/ui/VStack/index.stories.tsx +0 -45
  223. package/components/ui/VStack/index.tsx +0 -69
  224. package/components/ui/colors.stories.tsx +0 -148
  225. package/eslint.config.js +0 -10
  226. package/hooks/index.ts +0 -3
  227. package/hooks/use-auto-height.tsx +0 -99
  228. package/hooks/use-controlled-state.tsx +0 -32
  229. package/hooks/use-mobile.ts +0 -19
  230. package/index.ts +0 -58
  231. package/lib/get-strict-context.ts +0 -15
  232. package/lib/utils.ts +0 -10
  233. package/scripts/generate-exports.ts +0 -32
  234. package/tsconfig.json +0 -12
  235. package/tsconfig.tsbuildinfo +0 -1
  236. package/tsup.config.ts +0 -11
  237. package/types/svg.d.ts +0 -10
  238. 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
@@ -1,10 +0,0 @@
1
- import { baseEslintConfig } from '@luanthnh/eslint-config';
2
-
3
- const config = [
4
- {
5
- ignores: ['dist/**', 'node_modules/**', 'storybook-static/**', 'index.ts'],
6
- },
7
- ...baseEslintConfig,
8
- ];
9
-
10
- export default config;
package/hooks/index.ts DELETED
@@ -1,3 +0,0 @@
1
- export { useAutoHeight } from './use-auto-height';
2
- export { useControlledState } from './use-controlled-state';
3
- export { useIsMobile } from './use-mobile';
@@ -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
- }
@@ -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
- }