@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,78 +0,0 @@
1
- import { cn } from '@/lib/utils';
2
- import {
3
- TabsContent as TabsContentPrimitive,
4
- TabsContents as TabsContentsPrimitive,
5
- TabsHighlightItem as TabsHighlightItemPrimitive,
6
- TabsHighlight as TabsHighlightPrimitive,
7
- TabsList as TabsListPrimitive,
8
- Tabs as TabsPrimitive,
9
- TabsTrigger as TabsTriggerPrimitive,
10
- type TabsContentProps as TabsContentPrimitiveProps,
11
- type TabsContentsProps as TabsContentsPrimitiveProps,
12
- type TabsListProps as TabsListPrimitiveProps,
13
- type TabsProps as TabsPrimitiveProps,
14
- type TabsTriggerProps as TabsTriggerPrimitiveProps,
15
- } from '@/components/primitives/tabs';
16
-
17
- type TabsProps = TabsPrimitiveProps;
18
-
19
- function Tabs({ className, ...props }: TabsProps) {
20
- return <TabsPrimitive className={cn('flex flex-col gap-2', className)} {...props} />;
21
- }
22
-
23
- type TabsListProps = TabsListPrimitiveProps;
24
-
25
- function TabsList({ className, ...props }: TabsListProps) {
26
- return (
27
- <TabsHighlightPrimitive className="bg-background dark:bg-primary-900/30 dark:border-primary-700/40 absolute inset-0 z-0 rounded-md border border-transparent shadow-sm">
28
- <TabsListPrimitive
29
- className={cn(
30
- 'bg-muted text-muted-foreground inline-flex h-10 w-fit items-center justify-center rounded-lg p-[3px]',
31
- className,
32
- )}
33
- {...props}
34
- />
35
- </TabsHighlightPrimitive>
36
- );
37
- }
38
-
39
- type TabsTriggerProps = TabsTriggerPrimitiveProps;
40
-
41
- function TabsTrigger({ className, ...props }: TabsTriggerProps) {
42
- return (
43
- <TabsHighlightItemPrimitive value={props.value} className="h-full flex-1">
44
- <TabsTriggerPrimitive
45
- className={cn(
46
- "data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-muted-foreground inline-flex h-[calc(100%-1px)] w-full flex-1 items-center justify-center gap-1.5 rounded-md px-2 py-1 text-sm font-medium whitespace-nowrap transition-colors duration-500 ease-in-out focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
47
- className,
48
- )}
49
- {...props}
50
- />
51
- </TabsHighlightItemPrimitive>
52
- );
53
- }
54
-
55
- type TabsContentsProps = TabsContentsPrimitiveProps;
56
-
57
- function TabsContents(props: TabsContentsProps) {
58
- return <TabsContentsPrimitive {...props} />;
59
- }
60
-
61
- type TabsContentProps = TabsContentPrimitiveProps;
62
-
63
- function TabsContent({ className, ...props }: TabsContentProps) {
64
- return <TabsContentPrimitive className={cn('flex-1 outline-none', className)} {...props} />;
65
- }
66
-
67
- export {
68
- Tabs,
69
- TabsList,
70
- TabsTrigger,
71
- TabsContents,
72
- TabsContent,
73
- type TabsProps,
74
- type TabsListProps,
75
- type TabsTriggerProps,
76
- type TabsContentsProps,
77
- type TabsContentProps,
78
- };
@@ -1,53 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
-
3
- import { Text } from './index';
4
-
5
- const meta: Meta<typeof Text> = {
6
- title: 'UI/Text',
7
- component: Text,
8
- tags: ['autodocs'],
9
- argTypes: {
10
- size: {
11
- control: 'select',
12
- options: ['h1', 'h2', 'h3', 'h4', 'cap1', 'cap2', 10, 12, 14, 16, 18, 20, 24, 32, 40, 56, 72],
13
- },
14
- weight: {
15
- control: 'select',
16
- options: [100, 200, 300, 400, 500, 600, 700, 800, 900],
17
- },
18
- },
19
- };
20
-
21
- export default meta;
22
- type Story = StoryObj<typeof Text>;
23
-
24
- export const Paragraph: Story = {
25
- args: {
26
- children: 'This is a standard paragraph text.',
27
- size: 16,
28
- },
29
- };
30
-
31
- export const Titles: Story = {
32
- render: () => (
33
- <div className="space-y-4">
34
- <Text size="h1">Heading 1</Text>
35
- <Text size="h2">Heading 2</Text>
36
- <Text size="h3">Heading 3</Text>
37
- <Text size="h4">Heading 4</Text>
38
- <Text size={20}>Heading 5</Text>
39
- <Text size={18}>Heading 6</Text>
40
- </div>
41
- ),
42
- };
43
-
44
- export const Weights: Story = {
45
- render: () => (
46
- <div className="space-y-4">
47
- <Text weight={400}>Normal Weight</Text>
48
- <Text weight={500}>Medium Weight</Text>
49
- <Text weight={600}>Semibold Weight</Text>
50
- <Text weight={700}>Bold Weight</Text>
51
- </div>
52
- ),
53
- };
@@ -1,138 +0,0 @@
1
- 'use client';
2
-
3
- import React from 'react';
4
- import { cva, type VariantProps } from 'class-variance-authority';
5
-
6
- import { cn } from '@/lib/utils';
7
- import { Tooltip } from '@/components/ui/Tooltip';
8
-
9
- const textVariants = cva('inline-block align-middle', {
10
- variants: {
11
- size: {
12
- h1: 'text-3xl sm:text-4xl md:text-5xl',
13
- h2: 'text-2xl sm:text-3xl md:text-4xl',
14
- h3: 'text-xl sm:text-2xl md:text-3xl',
15
- h4: 'text-lg sm:text-xl md:text-2xl',
16
- cap1: 'text-base sm:text-lg',
17
- cap2: 'text-sm sm:text-base',
18
- 10: 'text-[10px] sm:text-xs',
19
- 12: 'text-xs sm:text-sm',
20
- 14: 'text-sm sm:text-base',
21
- 16: 'text-base sm:text-lg',
22
- 18: 'text-lg sm:text-xl',
23
- 20: 'text-xl sm:text-2xl',
24
- 24: 'text-2xl sm:text-3xl',
25
- 32: 'text-3xl sm:text-4xl',
26
- 40: 'text-4xl sm:text-5xl',
27
- 56: 'text-5xl sm:text-6xl',
28
- 72: 'text-6xl sm:text-7xl',
29
- },
30
- weight: {
31
- 100: 'font-thin',
32
- 200: 'font-extralight',
33
- 300: 'font-light',
34
- 400: 'font-normal',
35
- 500: 'font-medium',
36
- 600: 'font-semibold',
37
- 700: 'font-bold',
38
- 800: 'font-extrabold',
39
- 900: 'font-black',
40
- },
41
- height: {
42
- 14: 'leading-[14px]',
43
- 16: 'leading-[16px]',
44
- 18: 'leading-[18px]',
45
- 20: 'leading-[20px]',
46
- 24: 'leading-[24px]',
47
- 28: 'leading-[28px]',
48
- 32: 'leading-[32px]',
49
- 40: 'leading-[40px]',
50
- 48: 'leading-[48px]',
51
- 64: 'leading-[64px]',
52
- 80: 'leading-[80px]',
53
- },
54
- spacing: {
55
- '-1': 'tracking-[-0.01em]',
56
- '-1.5': 'tracking-[-0.015em]',
57
- '-2': 'tracking-[-0.02em]',
58
- },
59
- color: {
60
- default: 'text-foreground',
61
- muted: 'text-muted-foreground',
62
- primary: 'text-primary',
63
- destructive: 'text-destructive',
64
- success: 'text-green-600',
65
- warning: 'text-yellow-600',
66
- },
67
- clamp: {
68
- 1: 'line-clamp-1',
69
- 2: 'line-clamp-2',
70
- 3: 'line-clamp-3',
71
- 4: 'line-clamp-4',
72
- },
73
- },
74
- defaultVariants: {
75
- size: 16,
76
- weight: 400,
77
- color: 'default',
78
- },
79
- });
80
-
81
- type ElementProps = Omit<React.HTMLAttributes<HTMLElement>, 'color'>;
82
- export interface TextProps extends ElementProps, VariantProps<typeof textVariants> {
83
- as?: React.ElementType;
84
- maxWidth?: string | number;
85
- uppercase?: boolean;
86
- }
87
-
88
- export const clamp = (min: string, preferred: string, max: string) =>
89
- `clamp(${min}, ${preferred}, ${max})`;
90
-
91
- export const Text = React.forwardRef<HTMLElement, TextProps>(
92
- (
93
- {
94
- as: Comp = 'p',
95
- size,
96
- weight,
97
- height,
98
- spacing,
99
- color,
100
- clamp,
101
- maxWidth,
102
- uppercase,
103
- className,
104
- children,
105
- ...props
106
- },
107
- ref,
108
- ) => {
109
- const isTruncated = maxWidth !== undefined;
110
- const styles: React.CSSProperties = {
111
- ...(maxWidth && {
112
- maxWidth: typeof maxWidth === 'number' ? `${maxWidth}px` : maxWidth,
113
- overflow: 'hidden',
114
- textOverflow: 'ellipsis',
115
- whiteSpace: 'nowrap',
116
- }),
117
- };
118
-
119
- const content = (
120
- <Comp
121
- ref={ref}
122
- className={cn(
123
- textVariants({ size, weight, height, spacing, color, clamp }),
124
- uppercase && 'uppercase',
125
- className,
126
- )}
127
- style={styles}
128
- {...props}
129
- >
130
- {children}
131
- </Comp>
132
- );
133
-
134
- return isTruncated ? <Tooltip label={children}>{children}</Tooltip> : content;
135
- },
136
- );
137
-
138
- Text.displayName = 'Text';
@@ -1,25 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
-
3
- import { Textarea } from './index';
4
-
5
- const meta: Meta<typeof Textarea> = {
6
- title: 'UI/Textarea',
7
- component: Textarea,
8
- tags: ['autodocs'],
9
- };
10
-
11
- export default meta;
12
- type Story = StoryObj<typeof Textarea>;
13
-
14
- export const Default: Story = {
15
- args: {
16
- placeholder: 'Type your message here...',
17
- },
18
- };
19
-
20
- export const Disabled: Story = {
21
- args: {
22
- placeholder: 'Disabled textarea',
23
- disabled: true,
24
- },
25
- };
@@ -1,18 +0,0 @@
1
- import * as React from 'react';
2
-
3
- import { cn } from '@/lib/utils';
4
-
5
- function Textarea({ className, ...props }: React.ComponentProps<'textarea'>) {
6
- return (
7
- <textarea
8
- data-slot="textarea"
9
- className={cn(
10
- 'border-primary-100 placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-base dark:border-gray-700',
11
- className,
12
- )}
13
- {...props}
14
- />
15
- );
16
- }
17
-
18
- export { Textarea };
@@ -1,52 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import { Bold, Italic, Underline } from 'lucide-react';
3
-
4
- import { Toggle } from './index';
5
-
6
- const meta: Meta<typeof Toggle> = {
7
- title: 'UI/Toggle',
8
- component: Toggle,
9
- tags: ['autodocs'],
10
- argTypes: {
11
- variant: {
12
- control: 'select',
13
- options: ['default', 'outline'],
14
- },
15
- size: {
16
- control: 'select',
17
- options: ['default', 'sm', 'lg'],
18
- },
19
- },
20
- };
21
-
22
- export default meta;
23
- type Story = StoryObj<typeof Toggle>;
24
-
25
- export const Default: Story = {
26
- args: {
27
- variant: 'default',
28
- size: 'default',
29
- children: <Bold className="h-4 w-4" />,
30
- 'aria-label': 'Toggle bold',
31
- },
32
- };
33
-
34
- export const Outline: Story = {
35
- args: {
36
- variant: 'outline',
37
- children: <Italic className="h-4 w-4" />,
38
- 'aria-label': 'Toggle italic',
39
- },
40
- };
41
-
42
- export const WithText: Story = {
43
- args: {
44
- children: (
45
- <>
46
- <Underline className="mr-2 h-4 w-4" />
47
- Underline
48
- </>
49
- ),
50
- 'aria-label': 'Toggle underline',
51
- },
52
- };
@@ -1,46 +0,0 @@
1
- 'use client';
2
-
3
- import * as React from 'react';
4
- import * as TogglePrimitive from '@radix-ui/react-toggle';
5
- import { cva, type VariantProps } from 'class-variance-authority';
6
-
7
- import { cn } from '@/lib/utils';
8
-
9
- const toggleVariants = cva(
10
- "hover:bg-muted hover:text-muted-foreground data-[state=on]:bg-accent data-[state=on]:text-accent-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
11
- {
12
- variants: {
13
- variant: {
14
- default: 'bg-transparent',
15
- outline:
16
- 'border-input hover:bg-accent hover:text-accent-foreground border bg-transparent shadow-xs',
17
- },
18
- size: {
19
- default: 'h-9 min-w-9 px-2',
20
- sm: 'h-8 min-w-8 px-1.5',
21
- lg: 'h-10 min-w-10 px-2.5',
22
- },
23
- },
24
- defaultVariants: {
25
- variant: 'default',
26
- size: 'default',
27
- },
28
- },
29
- );
30
-
31
- function Toggle({
32
- className,
33
- variant,
34
- size,
35
- ...props
36
- }: React.ComponentProps<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>) {
37
- return (
38
- <TogglePrimitive.Root
39
- data-slot="toggle"
40
- className={cn(toggleVariants({ variant, size, className }))}
41
- {...props}
42
- />
43
- );
44
- }
45
-
46
- export { Toggle, toggleVariants };
@@ -1,52 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import { Bold, Italic, Underline } from 'lucide-react';
3
-
4
- import { ToggleGroup, ToggleGroupItem } from './index';
5
-
6
- const meta: Meta<typeof ToggleGroup> = {
7
- title: 'UI/ToggleGroup',
8
- component: ToggleGroup,
9
- tags: ['autodocs'],
10
- };
11
-
12
- export default meta;
13
- type Story = StoryObj<typeof ToggleGroup>;
14
-
15
- export const Default: Story = {
16
- args: {
17
- type: 'multiple',
18
- },
19
- render: (args) => (
20
- <ToggleGroup {...args}>
21
- <ToggleGroupItem value="bold" aria-label="Toggle bold">
22
- <Bold className="h-4 w-4" />
23
- </ToggleGroupItem>
24
- <ToggleGroupItem value="italic" aria-label="Toggle italic">
25
- <Italic className="h-4 w-4" />
26
- </ToggleGroupItem>
27
- <ToggleGroupItem value="underline" aria-label="Toggle underline">
28
- <Underline className="h-4 w-4" />
29
- </ToggleGroupItem>
30
- </ToggleGroup>
31
- ),
32
- };
33
-
34
- export const Outline: Story = {
35
- args: {
36
- type: 'single',
37
- variant: 'outline',
38
- },
39
- render: (args) => (
40
- <ToggleGroup {...args}>
41
- <ToggleGroupItem value="bold" aria-label="Toggle bold">
42
- <Bold className="h-4 w-4" />
43
- </ToggleGroupItem>
44
- <ToggleGroupItem value="italic" aria-label="Toggle italic">
45
- <Italic className="h-4 w-4" />
46
- </ToggleGroupItem>
47
- <ToggleGroupItem value="underline" aria-label="Toggle underline">
48
- <Underline className="h-4 w-4" />
49
- </ToggleGroupItem>
50
- </ToggleGroup>
51
- ),
52
- };
@@ -1,69 +0,0 @@
1
- 'use client';
2
-
3
- import * as React from 'react';
4
- import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
5
- import { type VariantProps } from 'class-variance-authority';
6
-
7
- import { cn } from '@/lib/utils';
8
- import { toggleVariants } from '@/components/ui/Toggle';
9
-
10
- const ToggleGroupContext = React.createContext<VariantProps<typeof toggleVariants>>({
11
- size: 'default',
12
- variant: 'default',
13
- });
14
-
15
- function ToggleGroup({
16
- className,
17
- variant,
18
- size,
19
- children,
20
- ...props
21
- }: React.ComponentProps<typeof ToggleGroupPrimitive.Root> & VariantProps<typeof toggleVariants>) {
22
- return (
23
- <ToggleGroupPrimitive.Root
24
- data-slot="toggle-group"
25
- data-variant={variant}
26
- data-size={size}
27
- className={cn(
28
- 'group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs',
29
- className,
30
- )}
31
- {...props}
32
- >
33
- <ToggleGroupContext.Provider value={{ variant, size }}>
34
- {children}
35
- </ToggleGroupContext.Provider>
36
- </ToggleGroupPrimitive.Root>
37
- );
38
- }
39
-
40
- function ToggleGroupItem({
41
- className,
42
- children,
43
- variant,
44
- size,
45
- ...props
46
- }: React.ComponentProps<typeof ToggleGroupPrimitive.Item> & VariantProps<typeof toggleVariants>) {
47
- const context = React.useContext(ToggleGroupContext);
48
-
49
- return (
50
- <ToggleGroupPrimitive.Item
51
- data-slot="toggle-group-item"
52
- data-variant={context.variant || variant}
53
- data-size={context.size || size}
54
- className={cn(
55
- toggleVariants({
56
- variant: context.variant || variant,
57
- size: context.size || size,
58
- }),
59
- 'min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l',
60
- className,
61
- )}
62
- {...props}
63
- >
64
- {children}
65
- </ToggleGroupPrimitive.Item>
66
- );
67
- }
68
-
69
- export { ToggleGroup, ToggleGroupItem };
@@ -1,29 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
-
3
- import { Button } from '../Button';
4
- import { Tooltip, TooltipProvider } from './index';
5
-
6
- const meta: Meta<typeof Tooltip> = {
7
- title: 'UI/Tooltip',
8
- component: Tooltip,
9
- tags: ['autodocs'],
10
- decorators: [
11
- (Story) => (
12
- <TooltipProvider>
13
- <div className="flex items-center justify-center p-12">
14
- <Story />
15
- </div>
16
- </TooltipProvider>
17
- ),
18
- ],
19
- };
20
-
21
- export default meta;
22
- type Story = StoryObj<typeof Tooltip>;
23
-
24
- export const Default: Story = {
25
- args: {
26
- label: 'I am a tooltip',
27
- children: <Button variant="outline">Hover me</Button>,
28
- },
29
- };
@@ -1,35 +0,0 @@
1
- 'use client';
2
-
3
- import * as React from 'react';
4
- import * as TooltipPrimitive from '@radix-ui/react-tooltip';
5
-
6
- import { cn } from '@/lib/utils';
7
-
8
- export const TooltipProvider = TooltipPrimitive.Provider;
9
-
10
- export interface TooltipProps {
11
- label: React.ReactNode;
12
- children: React.ReactNode;
13
- sideOffset?: number;
14
- className?: string;
15
- }
16
-
17
- export function Tooltip({ label, children, sideOffset = 4, className }: TooltipProps) {
18
- return (
19
- <TooltipPrimitive.Root delayDuration={0}>
20
- <TooltipPrimitive.Trigger asChild>{children}</TooltipPrimitive.Trigger>
21
- <TooltipPrimitive.Portal>
22
- <TooltipPrimitive.Content
23
- sideOffset={sideOffset}
24
- className={cn(
25
- 'bg-primary-50 dark:bg-primary-900/20 text-primary animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 z-50 w-fit rounded-md px-3 py-1.5 text-xs text-balance',
26
- className,
27
- )}
28
- >
29
- {label}
30
- <TooltipPrimitive.Arrow className="bg-primary-50 dark:bg-primary-900/20 fill-primary-50 dark:fill-primary-900/20 z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" />
31
- </TooltipPrimitive.Content>
32
- </TooltipPrimitive.Portal>
33
- </TooltipPrimitive.Root>
34
- );
35
- }
@@ -1,45 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
-
3
- import { VStack } from './index';
4
-
5
- const meta: Meta<typeof VStack> = {
6
- title: 'UI/Layout/VStack',
7
- component: VStack,
8
- tags: ['autodocs'],
9
- argTypes: {
10
- spacing: {
11
- control: 'select',
12
- options: [0, 2, 4, 6, 8, 12, 16, 20, 24, 32, 40, 48, 64, 'none'],
13
- },
14
- justify: {
15
- control: 'select',
16
- options: ['left', 'right', 'center', 'between', 'around', 'evenly'],
17
- },
18
- align: {
19
- control: 'select',
20
- options: ['default', 'center', 'start', 'end', 'baseline'],
21
- },
22
- },
23
- };
24
-
25
- export default meta;
26
- type Story = StoryObj<typeof VStack>;
27
-
28
- export const Default: Story = {
29
- args: {
30
- children: (
31
- <>
32
- <div className="bg-primary flex h-10 w-20 items-center justify-center rounded text-white">
33
- 1
34
- </div>
35
- <div className="bg-primary flex h-10 w-20 items-center justify-center rounded text-white">
36
- 2
37
- </div>
38
- <div className="bg-primary flex h-10 w-20 items-center justify-center rounded text-white">
39
- 3
40
- </div>
41
- </>
42
- ),
43
- spacing: 16,
44
- },
45
- };