@luanthnh/cntt-ui 0.1.8 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 -193
  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,38 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
-
3
- import { Avatar, AvatarFallback, AvatarImage } from '../Avatar';
4
- import { HoverCard, HoverCardContent, HoverCardTrigger } from './index';
5
-
6
- const meta: Meta<typeof HoverCard> = {
7
- title: 'UI/HoverCard',
8
- component: HoverCard,
9
- tags: ['autodocs'],
10
- };
11
-
12
- export default meta;
13
- type Story = StoryObj<typeof HoverCard>;
14
-
15
- export const Default: Story = {
16
- render: (args) => (
17
- <HoverCard {...args}>
18
- <HoverCardTrigger asChild>
19
- <span className="cursor-pointer underline underline-offset-4">@nextjs</span>
20
- </HoverCardTrigger>
21
- <HoverCardContent className="w-80">
22
- <div className="flex justify-between space-x-4">
23
- <Avatar>
24
- <AvatarImage src="https://github.com/vercel.png" />
25
- <AvatarFallback>VC</AvatarFallback>
26
- </Avatar>
27
- <div className="space-y-1">
28
- <h4 className="text-sm font-semibold">@nextjs</h4>
29
- <p className="text-sm">The React Framework – created and maintained by @vercel.</p>
30
- <div className="flex items-center pt-2">
31
- <span className="text-muted-foreground text-xs">Joined December 2021</span>
32
- </div>
33
- </div>
34
- </div>
35
- </HoverCardContent>
36
- </HoverCard>
37
- ),
38
- };
@@ -1,38 +0,0 @@
1
- 'use client';
2
-
3
- import * as React from 'react';
4
- import * as HoverCardPrimitive from '@radix-ui/react-hover-card';
5
-
6
- import { cn } from '@/lib/utils';
7
-
8
- function HoverCard({ ...props }: React.ComponentProps<typeof HoverCardPrimitive.Root>) {
9
- return <HoverCardPrimitive.Root data-slot="hover-card" {...props} />;
10
- }
11
-
12
- function HoverCardTrigger({ ...props }: React.ComponentProps<typeof HoverCardPrimitive.Trigger>) {
13
- return <HoverCardPrimitive.Trigger data-slot="hover-card-trigger" {...props} />;
14
- }
15
-
16
- function HoverCardContent({
17
- className,
18
- align = 'center',
19
- sideOffset = 4,
20
- ...props
21
- }: React.ComponentProps<typeof HoverCardPrimitive.Content>) {
22
- return (
23
- <HoverCardPrimitive.Portal data-slot="hover-card-portal">
24
- <HoverCardPrimitive.Content
25
- data-slot="hover-card-content"
26
- align={align}
27
- sideOffset={sideOffset}
28
- className={cn(
29
- 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden',
30
- className,
31
- )}
32
- {...props}
33
- />
34
- </HoverCardPrimitive.Portal>
35
- );
36
- }
37
-
38
- export { HoverCard, HoverCardTrigger, HoverCardContent };
@@ -1,27 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
-
3
- import { Icons } from './index';
4
-
5
- const meta: Meta = {
6
- title: 'UI/Icons',
7
- tags: ['autodocs'],
8
- };
9
-
10
- export default meta;
11
- type Story = StoryObj;
12
-
13
- export const Default: Story = {
14
- render: () => (
15
- <div className="grid grid-cols-4 gap-4">
16
- {Object.entries(Icons).map(([name, Icon]) => (
17
- <div
18
- key={name}
19
- className="flex flex-col items-center justify-center gap-2 rounded-lg border p-4"
20
- >
21
- <Icon className="h-6 w-6" />
22
- <span className="text-muted-foreground text-xs">{name}</span>
23
- </div>
24
- ))}
25
- </div>
26
- ),
27
- };
@@ -1,33 +0,0 @@
1
- import { type ForwardRefExoticComponent, type RefAttributes, type SVGProps } from 'react';
2
- import arrowLeft from '@/assets/icons/arrow-left.svg';
3
- import file from '@/assets/icons/file.svg';
4
- import globe from '@/assets/icons/globe.svg';
5
- import logo_line from '@/assets/icons/logo-line.svg';
6
- import next from '@/assets/icons/next.svg';
7
- import panel_left_expand from '@/assets/icons/panel-left-expand.svg';
8
- import placeholder from '@/assets/icons/placeholder.svg';
9
- import vercel from '@/assets/icons/vercel.svg';
10
- import window from '@/assets/icons/window.svg';
11
-
12
- const IconList = {
13
- file,
14
- globe,
15
- next,
16
- vercel,
17
- window,
18
- placeholder,
19
- arrowLeft,
20
- panel_left_expand,
21
- logo_line,
22
- };
23
-
24
- type SVGAttributes = Partial<SVGProps<SVGSVGElement>>;
25
- type ComponentAttributes = RefAttributes<SVGSVGElement> & SVGAttributes;
26
- interface IconProps extends ComponentAttributes {
27
- size?: string | number;
28
- absoluteStrokeWidth?: boolean;
29
- }
30
-
31
- export type Icon = ForwardRefExoticComponent<IconProps>;
32
-
33
- export const Icons = IconList as Record<keyof typeof IconList, Icon>;
@@ -1,32 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
-
3
- import { ImageWithFallback } from './index';
4
-
5
- const meta: Meta<typeof ImageWithFallback> = {
6
- title: 'UI/ImageWithFallback',
7
- component: ImageWithFallback,
8
- tags: ['autodocs'],
9
- };
10
-
11
- export default meta;
12
- type Story = StoryObj<typeof ImageWithFallback>;
13
-
14
- export const Default: Story = {
15
- args: {
16
- src: 'https://images.unsplash.com/photo-1579546929518-9e396f3cc809?w=500&auto=format&fit=crop&q=60',
17
- alt: 'Beautiful Gradient',
18
- width: 300,
19
- height: 200,
20
- className: 'rounded-lg object-cover',
21
- },
22
- };
23
-
24
- export const Fallback: Story = {
25
- args: {
26
- src: 'invalid-image-url',
27
- alt: 'Failed image',
28
- width: 300,
29
- height: 200,
30
- className: 'rounded-lg object-cover',
31
- },
32
- };
@@ -1,34 +0,0 @@
1
- 'use client';
2
-
3
- import React, { useState } from 'react';
4
-
5
- const ERROR_IMG_SRC = '/images/placeholder.svg';
6
-
7
- export function ImageWithFallback(props: React.ImgHTMLAttributes<HTMLImageElement>) {
8
- const [didError, setDidError] = useState(false);
9
-
10
- const handleError = () => {
11
- setDidError(true);
12
- };
13
-
14
- const { src, alt, style, className, ...rest } = props;
15
-
16
- return didError ? (
17
- <div
18
- className={`dark:bg-card inline-block bg-gray-100 text-center align-middle ${className ?? ''}`}
19
- style={style}
20
- >
21
- <div className="flex h-full w-full items-center justify-center">
22
- <img
23
- src={ERROR_IMG_SRC}
24
- alt="Error loading image"
25
- className={className}
26
- {...rest}
27
- data-original-url={src}
28
- />
29
- </div>
30
- </div>
31
- ) : (
32
- <img src={src} alt={alt} className={className} style={style} {...rest} onError={handleError} />
33
- );
34
- }
@@ -1,47 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
-
3
- import { Input } from './index';
4
-
5
- const meta: Meta<typeof Input> = {
6
- title: 'UI/Input',
7
- component: Input,
8
- tags: ['autodocs'],
9
- argTypes: {
10
- type: {
11
- control: 'select',
12
- options: ['text', 'password', 'email', 'number', 'tel', 'url'],
13
- },
14
- disabled: {
15
- control: 'boolean',
16
- },
17
- },
18
- };
19
-
20
- export default meta;
21
- type Story = StoryObj<typeof Input>;
22
-
23
- export const Default: Story = {
24
- args: {
25
- placeholder: 'Type something...',
26
- },
27
- };
28
-
29
- export const Password: Story = {
30
- args: {
31
- type: 'password',
32
- placeholder: 'Enter password...',
33
- },
34
- };
35
-
36
- export const Disabled: Story = {
37
- args: {
38
- disabled: true,
39
- placeholder: 'Disabled input',
40
- },
41
- };
42
-
43
- export const WithValue: Story = {
44
- args: {
45
- defaultValue: 'Hello World',
46
- },
47
- };
@@ -1,21 +0,0 @@
1
- import * as React from 'react';
2
-
3
- import { cn } from '@/lib/utils';
4
-
5
- function Input({ className, type, ...props }: React.ComponentProps<'input'>) {
6
- return (
7
- <input
8
- type={type}
9
- data-slot="input"
10
- className={cn(
11
- 'file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-primary-100 flex h-10 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-base file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-base dark:border-gray-700 dark:shadow-gray-900/50',
12
- 'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]',
13
- 'aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',
14
- className,
15
- )}
16
- {...props}
17
- />
18
- );
19
- }
20
-
21
- export { Input };
@@ -1,35 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
-
3
- import { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot } from './index';
4
-
5
- const meta: Meta<typeof InputOTP> = {
6
- title: 'UI/InputOTP',
7
- component: InputOTP,
8
- tags: ['autodocs'],
9
- };
10
-
11
- export default meta;
12
- type Story = StoryObj<typeof InputOTP>;
13
-
14
- export const Default: Story = {
15
- args: {
16
- maxLength: 6,
17
- },
18
- render: (args) => {
19
- return (
20
- <InputOTP maxLength={args.maxLength} containerClassName={args.containerClassName}>
21
- <InputOTPGroup>
22
- <InputOTPSlot index={0} />
23
- <InputOTPSlot index={1} />
24
- <InputOTPSlot index={2} />
25
- </InputOTPGroup>
26
- <InputOTPSeparator />
27
- <InputOTPGroup>
28
- <InputOTPSlot index={3} />
29
- <InputOTPSlot index={4} />
30
- <InputOTPSlot index={5} />
31
- </InputOTPGroup>
32
- </InputOTP>
33
- );
34
- },
35
- };
@@ -1,70 +0,0 @@
1
- 'use client';
2
-
3
- import * as React from 'react';
4
- import { OTPInput, OTPInputContext } from 'input-otp';
5
- import { MinusIcon } from 'lucide-react';
6
-
7
- import { cn } from '@/lib/utils';
8
-
9
- function InputOTP({
10
- className,
11
- containerClassName,
12
- ...props
13
- }: React.ComponentProps<typeof OTPInput> & {
14
- containerClassName?: string;
15
- }) {
16
- return (
17
- <OTPInput
18
- data-slot="input-otp"
19
- containerClassName={cn('flex items-center gap-2 has-disabled:opacity-50', containerClassName)}
20
- className={cn('disabled:cursor-not-allowed', className)}
21
- {...props}
22
- />
23
- );
24
- }
25
-
26
- function InputOTPGroup({ className, ...props }: React.ComponentProps<'div'>) {
27
- return (
28
- <div data-slot="input-otp-group" className={cn('flex items-center', className)} {...props} />
29
- );
30
- }
31
-
32
- function InputOTPSlot({
33
- index,
34
- className,
35
- ...props
36
- }: React.ComponentProps<'div'> & {
37
- index: number;
38
- }) {
39
- const inputOTPContext = React.useContext(OTPInputContext);
40
- const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};
41
-
42
- return (
43
- <div
44
- data-slot="input-otp-slot"
45
- data-active={isActive}
46
- className={cn(
47
- 'data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]',
48
- className,
49
- )}
50
- {...props}
51
- >
52
- {char}
53
- {hasFakeCaret && (
54
- <div className="pointer-events-none absolute inset-0 flex items-center justify-center">
55
- <div className="animate-caret-blink bg-foreground h-4 w-px duration-1000" />
56
- </div>
57
- )}
58
- </div>
59
- );
60
- }
61
-
62
- function InputOTPSeparator({ ...props }: React.ComponentProps<'div'>) {
63
- return (
64
- <div data-slot="input-otp-separator" role="separator" {...props}>
65
- <MinusIcon />
66
- </div>
67
- );
68
- }
69
-
70
- export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator };
@@ -1,18 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
-
3
- import { Label } from './index';
4
-
5
- const meta: Meta<typeof Label> = {
6
- title: 'UI/Label',
7
- component: Label,
8
- tags: ['autodocs'],
9
- };
10
-
11
- export default meta;
12
- type Story = StoryObj<typeof Label>;
13
-
14
- export const Default: Story = {
15
- args: {
16
- children: 'Label Text',
17
- },
18
- };
@@ -1,21 +0,0 @@
1
- 'use client';
2
-
3
- import * as React from 'react';
4
- import * as LabelPrimitive from '@radix-ui/react-label';
5
-
6
- import { cn } from '@/lib/utils';
7
-
8
- function Label({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>) {
9
- return (
10
- <LabelPrimitive.Root
11
- data-slot="label"
12
- className={cn(
13
- 'flex items-center gap-2 text-base leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50',
14
- className,
15
- )}
16
- {...props}
17
- />
18
- );
19
- }
20
-
21
- export { Label };
@@ -1,71 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
-
3
- import { Marquee } from './index';
4
-
5
- const meta: Meta<typeof Marquee> = {
6
- title: 'UI/Marquee',
7
- component: Marquee,
8
- tags: ['autodocs'],
9
- argTypes: {
10
- direction: {
11
- control: 'select',
12
- options: ['left', 'up'],
13
- },
14
- pauseOnHover: {
15
- control: 'boolean',
16
- },
17
- reverse: {
18
- control: 'boolean',
19
- },
20
- fade: {
21
- control: 'boolean',
22
- },
23
- },
24
- };
25
-
26
- export default meta;
27
- type Story = StoryObj<typeof Marquee>;
28
-
29
- const logos = [
30
- 'Google',
31
- 'Microsoft',
32
- 'Apple',
33
- 'Amazon',
34
- 'Meta',
35
- 'Netflix',
36
- 'Twitter',
37
- 'LinkedIn',
38
- 'Adobe',
39
- 'Spotify',
40
- ];
41
-
42
- export const Default: Story = {
43
- args: {
44
- children: logos.map((name) => (
45
- <div
46
- key={name}
47
- className="bg-primary/10 text-primary border-primary/20 flex items-center justify-center rounded-xl border px-8 py-4 font-bold"
48
- >
49
- {name}
50
- </div>
51
- )),
52
- direction: 'left',
53
- },
54
- };
55
-
56
- export const Up: Story = {
57
- render: (args) => (
58
- <div className="h-100">
59
- <Marquee {...args} direction="up">
60
- {logos.map((name) => (
61
- <div
62
- key={name}
63
- className="bg-primary/10 text-primary border-primary/20 flex items-center justify-center rounded-xl border px-4 py-8 font-bold"
64
- >
65
- {name}
66
- </div>
67
- ))}
68
- </Marquee>
69
- </div>
70
- ),
71
- };
@@ -1,65 +0,0 @@
1
- import type { HTMLAttributes, ReactNode } from 'react';
2
-
3
- import { cn } from '@/lib/utils';
4
-
5
- export type MarqueeProps = HTMLAttributes<HTMLDivElement> & {
6
- children: ReactNode;
7
- direction?: 'left' | 'up';
8
- pauseOnHover?: boolean;
9
- reverse?: boolean;
10
- fade?: boolean;
11
- innerClassName?: string;
12
- numberOfCopies?: number;
13
- };
14
-
15
- export function Marquee({
16
- children,
17
- direction = 'left',
18
- pauseOnHover = true,
19
- reverse = false,
20
- fade = true,
21
- className,
22
- innerClassName,
23
- numberOfCopies = 3,
24
- ...rest
25
- }: MarqueeProps) {
26
- return (
27
- <div
28
- className={cn(
29
- 'group flex gap-[1rem] overflow-hidden',
30
- direction === 'left' ? 'flex-row' : 'flex-col',
31
- className,
32
- )}
33
- style={{
34
- maskImage: fade
35
- ? `linear-gradient(${
36
- direction === 'left' ? 'to right' : 'to bottom'
37
- }, transparent 0%, rgba(0, 0, 0, 1.0) 10%, rgba(0, 0, 0, 1.0) 90%, transparent 100%)`
38
- : undefined,
39
- WebkitMaskImage: fade
40
- ? `linear-gradient(${
41
- direction === 'left' ? 'to right' : 'to bottom'
42
- }, transparent 0%, rgba(0, 0, 0, 1.0) 10%, rgba(0, 0, 0, 1.0) 90%, transparent 100%)`
43
- : undefined,
44
- }}
45
- {...rest}
46
- >
47
- {Array(numberOfCopies)
48
- .fill(0)
49
- .map((_, i) => (
50
- <div
51
- key={i}
52
- className={cn(
53
- 'flex shrink-0 justify-around gap-[1rem] py-3 [--gap:1rem]',
54
- direction === 'left' ? 'marquee-left flex-row' : 'marquee-up flex-col',
55
- pauseOnHover && 'group-hover:[animation-play-state:paused]',
56
- reverse && 'direction-reverse',
57
- innerClassName,
58
- )}
59
- >
60
- {children}
61
- </div>
62
- ))}
63
- </div>
64
- );
65
- }
@@ -1,116 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
-
3
- import {
4
- Menubar,
5
- MenubarCheckboxItem,
6
- MenubarContent,
7
- MenubarItem,
8
- MenubarMenu,
9
- MenubarRadioGroup,
10
- MenubarRadioItem,
11
- MenubarSeparator,
12
- MenubarShortcut,
13
- MenubarSub,
14
- MenubarSubContent,
15
- MenubarSubTrigger,
16
- MenubarTrigger,
17
- } from './index';
18
-
19
- const meta: Meta<typeof Menubar> = {
20
- title: 'UI/Menubar',
21
- component: Menubar,
22
- tags: ['autodocs'],
23
- };
24
-
25
- export default meta;
26
- type Story = StoryObj<typeof Menubar>;
27
-
28
- export const Default: Story = {
29
- render: (args) => (
30
- <Menubar {...args}>
31
- <MenubarMenu>
32
- <MenubarTrigger>File</MenubarTrigger>
33
- <MenubarContent>
34
- <MenubarItem>
35
- New Tab <MenubarShortcut>⌘T</MenubarShortcut>
36
- </MenubarItem>
37
- <MenubarItem>
38
- New Window <MenubarShortcut>⌘N</MenubarShortcut>
39
- </MenubarItem>
40
- <MenubarItem disabled>New Incognito Window</MenubarItem>
41
- <MenubarSeparator />
42
- <MenubarSub>
43
- <MenubarSubTrigger>Share</MenubarSubTrigger>
44
- <MenubarSubContent>
45
- <MenubarItem>Email link</MenubarItem>
46
- <MenubarItem>Messages</MenubarItem>
47
- <MenubarItem>Notes</MenubarItem>
48
- </MenubarSubContent>
49
- </MenubarSub>
50
- <MenubarSeparator />
51
- <MenubarItem>
52
- Print... <MenubarShortcut>⌘P</MenubarShortcut>
53
- </MenubarItem>
54
- </MenubarContent>
55
- </MenubarMenu>
56
- <MenubarMenu>
57
- <MenubarTrigger>Edit</MenubarTrigger>
58
- <MenubarContent>
59
- <MenubarItem>
60
- Undo <MenubarShortcut>⌘Z</MenubarShortcut>
61
- </MenubarItem>
62
- <MenubarItem>
63
- Redo <MenubarShortcut>⇧⌘Z</MenubarShortcut>
64
- </MenubarItem>
65
- <MenubarSeparator />
66
- <MenubarSub>
67
- <MenubarSubTrigger>Find</MenubarSubTrigger>
68
- <MenubarSubContent>
69
- <MenubarItem>Search the web</MenubarItem>
70
- <MenubarSeparator />
71
- <MenubarItem>Find...</MenubarItem>
72
- <MenubarItem>Find Next</MenubarItem>
73
- <MenubarItem>Find Previous</MenubarItem>
74
- </MenubarSubContent>
75
- </MenubarSub>
76
- <MenubarSeparator />
77
- <MenubarItem>Cut</MenubarItem>
78
- <MenubarItem>Copy</MenubarItem>
79
- <MenubarItem>Paste</MenubarItem>
80
- </MenubarContent>
81
- </MenubarMenu>
82
- <MenubarMenu>
83
- <MenubarTrigger>View</MenubarTrigger>
84
- <MenubarContent>
85
- <MenubarCheckboxItem>Always Show Bookmarks Bar</MenubarCheckboxItem>
86
- <MenubarCheckboxItem checked>Always Show Full URLs</MenubarCheckboxItem>
87
- <MenubarSeparator />
88
- <MenubarItem inset>
89
- Reload <MenubarShortcut>⌘R</MenubarShortcut>
90
- </MenubarItem>
91
- <MenubarItem disabled inset>
92
- Force Reload <MenubarShortcut>⇧⌘R</MenubarShortcut>
93
- </MenubarItem>
94
- <MenubarSeparator />
95
- <MenubarItem inset>Toggle Fullscreen</MenubarItem>
96
- <MenubarSeparator />
97
- <MenubarItem inset>Hide Sidebar</MenubarItem>
98
- </MenubarContent>
99
- </MenubarMenu>
100
- <MenubarMenu>
101
- <MenubarTrigger>Profiles</MenubarTrigger>
102
- <MenubarContent>
103
- <MenubarRadioGroup value="benoit">
104
- <MenubarRadioItem value="andy">Andy</MenubarRadioItem>
105
- <MenubarRadioItem value="benoit">Benoit</MenubarRadioItem>
106
- <MenubarRadioItem value="Luis">Luis</MenubarRadioItem>
107
- </MenubarRadioGroup>
108
- <MenubarSeparator />
109
- <MenubarItem inset>Edit...</MenubarItem>
110
- <MenubarSeparator />
111
- <MenubarItem inset>Add Profile...</MenubarItem>
112
- </MenubarContent>
113
- </MenubarMenu>
114
- </Menubar>
115
- ),
116
- };