@dilipod/ui 0.1.0 → 0.2.0

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.
@@ -0,0 +1,49 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import { Textarea } from './textarea'
3
+
4
+ const meta: Meta<typeof Textarea> = {
5
+ title: 'Components/Textarea',
6
+ component: Textarea,
7
+ tags: ['autodocs'],
8
+ argTypes: {
9
+ rows: {
10
+ control: 'number',
11
+ },
12
+ disabled: {
13
+ control: 'boolean',
14
+ },
15
+ placeholder: {
16
+ control: 'text',
17
+ },
18
+ },
19
+ }
20
+
21
+ export default meta
22
+ type Story = StoryObj<typeof Textarea>
23
+
24
+ export const Default: Story = {
25
+ args: {
26
+ placeholder: 'Enter your message...',
27
+ },
28
+ }
29
+
30
+ export const WithRows: Story = {
31
+ args: {
32
+ placeholder: 'Enter your message...',
33
+ rows: 6,
34
+ },
35
+ }
36
+
37
+ export const Disabled: Story = {
38
+ args: {
39
+ placeholder: 'Disabled textarea',
40
+ disabled: true,
41
+ },
42
+ }
43
+
44
+ export const WithValue: Story = {
45
+ args: {
46
+ value: 'This is a sample textarea with some content.',
47
+ readOnly: true,
48
+ },
49
+ }
@@ -0,0 +1,25 @@
1
+ 'use client'
2
+
3
+ import * as React from 'react'
4
+ import { cn } from '../lib/utils'
5
+
6
+ export interface TextareaProps
7
+ extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {}
8
+
9
+ const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
10
+ ({ className, ...props }, ref) => {
11
+ return (
12
+ <textarea
13
+ className={cn(
14
+ 'flex min-h-[80px] w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-base text-[var(--black)] ring-offset-background placeholder:text-gray-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--cyan)] focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm transition-colors',
15
+ className
16
+ )}
17
+ ref={ref}
18
+ {...props}
19
+ />
20
+ )
21
+ }
22
+ )
23
+ Textarea.displayName = 'Textarea'
24
+
25
+ export { Textarea }
package/src/index.ts CHANGED
@@ -43,6 +43,39 @@ export type { TagProps } from './components/tag'
43
43
  export { Stat, statVariants, valueVariants } from './components/stat'
44
44
  export type { StatProps } from './components/stat'
45
45
 
46
+ // Form Components
47
+ export { Input } from './components/input'
48
+ export type { InputProps } from './components/input'
49
+
50
+ export { Label } from './components/label'
51
+ export type { LabelProps } from '@radix-ui/react-label'
52
+
53
+ export { Textarea } from './components/textarea'
54
+ export type { TextareaProps } from './components/textarea'
55
+
56
+ // Navigation & Layout Components
57
+ export {
58
+ Accordion,
59
+ AccordionItem,
60
+ AccordionTrigger,
61
+ AccordionContent,
62
+ } from './components/accordion'
63
+
64
+ export { Separator } from './components/separator'
65
+ export type { SeparatorProps } from '@radix-ui/react-separator'
66
+
67
+ export {
68
+ navigationMenuTriggerStyle,
69
+ NavigationMenu,
70
+ NavigationMenuList,
71
+ NavigationMenuItem,
72
+ NavigationMenuContent,
73
+ NavigationMenuTrigger,
74
+ NavigationMenuLink,
75
+ NavigationMenuIndicator,
76
+ NavigationMenuViewport,
77
+ } from './components/navigation-menu'
78
+
46
79
  // Utilities
47
80
  export { cn } from './lib/utils'
48
81