@algorithm-shift/design-system 1.2.10 → 1.2.12

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 (92) hide show
  1. package/dist/index.css +1 -2314
  2. package/dist/index.css.map +1 -1
  3. package/dist/index.js.map +1 -1
  4. package/package.json +2 -2
  5. package/src/components/Basic/Image/Image.stories.tsx +13 -0
  6. package/src/components/Basic/Image/Image.tsx +52 -0
  7. package/src/components/Basic/Shape/Shape.tsx +16 -0
  8. package/src/components/Basic/Typography/Typography.stories.tsx +18 -0
  9. package/src/components/Basic/Typography/Typography.tsx +31 -0
  10. package/src/components/DataDisplay/Table/Table.stories.tsx +35 -0
  11. package/src/components/DataDisplay/Table/Table.tsx +15 -0
  12. package/src/components/DataDisplay/index.ts +1 -0
  13. package/src/components/Global/SelectDropdown.tsx +61 -0
  14. package/src/components/Global/TinyMceEditor.tsx +81 -0
  15. package/src/components/Inputs/Checkbox/Checkbox.tsx +18 -0
  16. package/src/components/Inputs/DatePicker/DatePicker.tsx +81 -0
  17. package/src/components/Inputs/DateRange/DateRange.tsx +64 -0
  18. package/src/components/Inputs/Dropdown/Dropdown.tsx +62 -0
  19. package/src/components/Inputs/EmailInput/EmailInput.tsx +64 -0
  20. package/src/components/Inputs/FileInput/FileInput.tsx +24 -0
  21. package/src/components/Inputs/MultiCheckbox/MultiCheckbox.tsx +24 -0
  22. package/src/components/Inputs/NumberInput/NumberInput.tsx +66 -0
  23. package/src/components/Inputs/PasswordInput/PasswordInput.tsx +66 -0
  24. package/src/components/Inputs/PhoneInput/PhoneInput.tsx +58 -0
  25. package/src/components/Inputs/RadioInput/RadioInput.tsx +24 -0
  26. package/src/components/Inputs/RichText/RichText.tsx +10 -0
  27. package/src/components/Inputs/SearchInput/SearchInput.tsx +64 -0
  28. package/src/components/Inputs/SwitchToggle/SwitchToggle.tsx +22 -0
  29. package/src/components/Inputs/TextInput/TextInput.tsx +59 -0
  30. package/src/components/Inputs/Textarea/Textarea.tsx +58 -0
  31. package/src/components/Inputs/UrlInput/UrlInput.tsx +66 -0
  32. package/src/components/Layout/Flex.tsx +13 -0
  33. package/src/components/Layout/Grid.tsx +13 -0
  34. package/src/components/Navigation/Logo/Logo.stories.tsx +25 -0
  35. package/src/components/Navigation/Logo/Logo.tsx +33 -0
  36. package/src/components/Navigation/Notification/Notification.stories.tsx +20 -0
  37. package/src/components/Navigation/Notification/Notification.tsx +20 -0
  38. package/src/components/Navigation/Profile/Profile.stories.tsx +20 -0
  39. package/src/components/Navigation/Profile/Profile.tsx +25 -0
  40. package/src/components/Navigation/Spacer/Spacer.stories.tsx +18 -0
  41. package/src/components/Navigation/Spacer/Spacer.tsx +11 -0
  42. package/src/components/Navigation/Stages/Stages.stories.tsx +24 -0
  43. package/src/components/Navigation/Stages/Stages.tsx +49 -0
  44. package/src/components/Navigation/Tabs/Tabs.stories.tsx +38 -0
  45. package/src/components/Navigation/Tabs/Tabs.tsx +72 -0
  46. package/src/components/Navigation/index.ts +6 -0
  47. package/src/components/index.ts +27 -0
  48. package/src/components/ui/button.stories.tsx +24 -0
  49. package/src/components/ui/button.tsx +59 -0
  50. package/src/components/ui/calendar.tsx +211 -0
  51. package/src/components/ui/checkbox.tsx +30 -0
  52. package/src/components/ui/data-table.tsx +138 -0
  53. package/src/components/ui/dropdown-menu.tsx +258 -0
  54. package/src/components/ui/input.tsx +21 -0
  55. package/src/components/ui/label.tsx +22 -0
  56. package/src/components/ui/popover.tsx +46 -0
  57. package/src/components/ui/radio-group.tsx +43 -0
  58. package/src/components/ui/select.tsx +183 -0
  59. package/src/components/ui/switch.tsx +29 -0
  60. package/src/components/ui/table.tsx +121 -0
  61. package/src/components/ui/textarea.tsx +18 -0
  62. package/src/global.css +6 -0
  63. package/src/index.css +119 -0
  64. package/src/index.ts +4 -0
  65. package/src/lib/utils.ts +6 -0
  66. package/src/stories/Button.stories.ts +54 -0
  67. package/src/stories/Button.tsx +35 -0
  68. package/src/stories/Configure.mdx +364 -0
  69. package/src/stories/Header.stories.ts +34 -0
  70. package/src/stories/Header.tsx +54 -0
  71. package/src/stories/Page.stories.ts +33 -0
  72. package/src/stories/Page.tsx +73 -0
  73. package/src/stories/assets/accessibility.png +0 -0
  74. package/src/stories/assets/accessibility.svg +1 -0
  75. package/src/stories/assets/addon-library.png +0 -0
  76. package/src/stories/assets/assets.png +0 -0
  77. package/src/stories/assets/avif-test-image.avif +0 -0
  78. package/src/stories/assets/context.png +0 -0
  79. package/src/stories/assets/discord.svg +1 -0
  80. package/src/stories/assets/docs.png +0 -0
  81. package/src/stories/assets/figma-plugin.png +0 -0
  82. package/src/stories/assets/github.svg +1 -0
  83. package/src/stories/assets/share.png +0 -0
  84. package/src/stories/assets/styling.png +0 -0
  85. package/src/stories/assets/testing.png +0 -0
  86. package/src/stories/assets/theming.png +0 -0
  87. package/src/stories/assets/tutorials.svg +1 -0
  88. package/src/stories/assets/youtube.svg +1 -0
  89. package/src/stories/button.css +30 -0
  90. package/src/stories/header.css +32 -0
  91. package/src/stories/page.css +68 -0
  92. package/src/types/global.d.ts +85 -0
@@ -0,0 +1,183 @@
1
+ import * as React from "react"
2
+ import * as SelectPrimitive from "@radix-ui/react-select"
3
+ import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react"
4
+
5
+ import { cn } from "@/lib/utils"
6
+
7
+ function Select({
8
+ ...props
9
+ }: React.ComponentProps<typeof SelectPrimitive.Root>) {
10
+ return <SelectPrimitive.Root data-slot="select" {...props} />
11
+ }
12
+
13
+ function SelectGroup({
14
+ ...props
15
+ }: React.ComponentProps<typeof SelectPrimitive.Group>) {
16
+ return <SelectPrimitive.Group data-slot="select-group" {...props} />
17
+ }
18
+
19
+ function SelectValue({
20
+ ...props
21
+ }: React.ComponentProps<typeof SelectPrimitive.Value>) {
22
+ return <SelectPrimitive.Value data-slot="select-value" {...props} />
23
+ }
24
+
25
+ function SelectTrigger({
26
+ className,
27
+ size = "default",
28
+ children,
29
+ ...props
30
+ }: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
31
+ size?: "sm" | "default"
32
+ }) {
33
+ return (
34
+ <SelectPrimitive.Trigger
35
+ data-slot="select-trigger"
36
+ data-size={size}
37
+ className={cn(
38
+ "border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]: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 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
39
+ className
40
+ )}
41
+ {...props}
42
+ >
43
+ {children}
44
+ <SelectPrimitive.Icon asChild>
45
+ <ChevronDownIcon className="size-4 opacity-50" />
46
+ </SelectPrimitive.Icon>
47
+ </SelectPrimitive.Trigger>
48
+ )
49
+ }
50
+
51
+ function SelectContent({
52
+ className,
53
+ children,
54
+ position = "popper",
55
+ ...props
56
+ }: React.ComponentProps<typeof SelectPrimitive.Content>) {
57
+ return (
58
+ <SelectPrimitive.Portal>
59
+ <SelectPrimitive.Content
60
+ data-slot="select-content"
61
+ className={cn(
62
+ "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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",
63
+ position === "popper" &&
64
+ "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
65
+ className
66
+ )}
67
+ position={position}
68
+ {...props}
69
+ >
70
+ <SelectScrollUpButton />
71
+ <SelectPrimitive.Viewport
72
+ className={cn(
73
+ "p-1",
74
+ position === "popper" &&
75
+ "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
76
+ )}
77
+ >
78
+ {children}
79
+ </SelectPrimitive.Viewport>
80
+ <SelectScrollDownButton />
81
+ </SelectPrimitive.Content>
82
+ </SelectPrimitive.Portal>
83
+ )
84
+ }
85
+
86
+ function SelectLabel({
87
+ className,
88
+ ...props
89
+ }: React.ComponentProps<typeof SelectPrimitive.Label>) {
90
+ return (
91
+ <SelectPrimitive.Label
92
+ data-slot="select-label"
93
+ className={cn("text-muted-foreground px-2 py-1.5 text-xs", className)}
94
+ {...props}
95
+ />
96
+ )
97
+ }
98
+
99
+ function SelectItem({
100
+ className,
101
+ children,
102
+ ...props
103
+ }: React.ComponentProps<typeof SelectPrimitive.Item>) {
104
+ return (
105
+ <SelectPrimitive.Item
106
+ data-slot="select-item"
107
+ className={cn(
108
+ "focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
109
+ className
110
+ )}
111
+ {...props}
112
+ >
113
+ <span className="absolute right-2 flex size-3.5 items-center justify-center">
114
+ <SelectPrimitive.ItemIndicator>
115
+ <CheckIcon className="size-4" />
116
+ </SelectPrimitive.ItemIndicator>
117
+ </span>
118
+ <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
119
+ </SelectPrimitive.Item>
120
+ )
121
+ }
122
+
123
+ function SelectSeparator({
124
+ className,
125
+ ...props
126
+ }: React.ComponentProps<typeof SelectPrimitive.Separator>) {
127
+ return (
128
+ <SelectPrimitive.Separator
129
+ data-slot="select-separator"
130
+ className={cn("bg-border pointer-events-none -mx-1 my-1 h-px", className)}
131
+ {...props}
132
+ />
133
+ )
134
+ }
135
+
136
+ function SelectScrollUpButton({
137
+ className,
138
+ ...props
139
+ }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
140
+ return (
141
+ <SelectPrimitive.ScrollUpButton
142
+ data-slot="select-scroll-up-button"
143
+ className={cn(
144
+ "flex cursor-default items-center justify-center py-1",
145
+ className
146
+ )}
147
+ {...props}
148
+ >
149
+ <ChevronUpIcon className="size-4" />
150
+ </SelectPrimitive.ScrollUpButton>
151
+ )
152
+ }
153
+
154
+ function SelectScrollDownButton({
155
+ className,
156
+ ...props
157
+ }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {
158
+ return (
159
+ <SelectPrimitive.ScrollDownButton
160
+ data-slot="select-scroll-down-button"
161
+ className={cn(
162
+ "flex cursor-default items-center justify-center py-1",
163
+ className
164
+ )}
165
+ {...props}
166
+ >
167
+ <ChevronDownIcon className="size-4" />
168
+ </SelectPrimitive.ScrollDownButton>
169
+ )
170
+ }
171
+
172
+ export {
173
+ Select,
174
+ SelectContent,
175
+ SelectGroup,
176
+ SelectItem,
177
+ SelectLabel,
178
+ SelectScrollDownButton,
179
+ SelectScrollUpButton,
180
+ SelectSeparator,
181
+ SelectTrigger,
182
+ SelectValue,
183
+ }
@@ -0,0 +1,29 @@
1
+ import * as React from "react"
2
+ import * as SwitchPrimitive from "@radix-ui/react-switch"
3
+
4
+ import { cn } from "@/lib/utils"
5
+
6
+ function Switch({
7
+ className,
8
+ ...props
9
+ }: React.ComponentProps<typeof SwitchPrimitive.Root>) {
10
+ return (
11
+ <SwitchPrimitive.Root
12
+ data-slot="switch"
13
+ className={cn(
14
+ "peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
15
+ className
16
+ )}
17
+ {...props}
18
+ >
19
+ <SwitchPrimitive.Thumb
20
+ data-slot="switch-thumb"
21
+ className={cn(
22
+ "bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0"
23
+ )}
24
+ />
25
+ </SwitchPrimitive.Root>
26
+ )
27
+ }
28
+
29
+ export { Switch }
@@ -0,0 +1,121 @@
1
+
2
+ import * as React from 'react';
3
+
4
+ import { cn } from '@/lib/utils';
5
+
6
+ function Table({ className, ...props }: React.ComponentProps<'table'>) {
7
+ return (
8
+ <div
9
+ data-slot="table-container"
10
+ className="relative w-full overflow-x-auto rounded-md border border-gray-200 bg-white"
11
+ >
12
+ <table
13
+ data-slot="table"
14
+ className={cn('w-full text-sm', className)}
15
+ {...props}
16
+ />
17
+ </div>
18
+ );
19
+ }
20
+
21
+ function TableHeader({ className, ...props }: React.ComponentProps<'thead'>) {
22
+ return (
23
+ <thead
24
+ data-slot="table-header"
25
+ className={cn(
26
+ 'bg-gray-100 text-gray-700 [&>tr]:border-b [&>tr]:border-gray-200 [&>tr>th]:border-r [&>tr>th]:border-gray-200 [&>tr>th]:last:border-r-0',
27
+ className
28
+ )}
29
+ {...props}
30
+ />
31
+ );
32
+ }
33
+
34
+ function TableBody({ className, ...props }: React.ComponentProps<'tbody'>) {
35
+ return (
36
+ <tbody
37
+ data-slot="table-body"
38
+ className={cn(
39
+ '[&>tr]:border-b [&>tr]:border-gray-200 [&>tr:last-child]:border-0 [&>tr>td]:border-r [&>tr>td]:border-gray-200 [&>tr>td]:last:border-r-0',
40
+ className
41
+ )}
42
+ {...props}
43
+ />
44
+ );
45
+ }
46
+
47
+ function TableFooter({ className, ...props }: React.ComponentProps<'tfoot'>) {
48
+ return (
49
+ <tfoot
50
+ data-slot="table-footer"
51
+ className={cn(
52
+ 'bg-gray-50 border-t border-gray-200 font-medium [&>tr]:last:border-b-0',
53
+ className
54
+ )}
55
+ {...props}
56
+ />
57
+ );
58
+ }
59
+
60
+ function TableRow({ className, ...props }: React.ComponentProps<'tr'>) {
61
+ return (
62
+ <tr
63
+ data-slot="table-row"
64
+ className={cn(
65
+ 'border-b border-gray-200 hover:bg-gray-50 transition-colors',
66
+ className
67
+ )}
68
+ {...props}
69
+ />
70
+ );
71
+ }
72
+
73
+ function TableHead({ className, ...props }: React.ComponentProps<'th'>) {
74
+ return (
75
+ <th
76
+ data-slot="table-head"
77
+ className={cn(
78
+ 'h-12 px-6 text-left align-middle font-semibold whitespace-nowrap',
79
+ className
80
+ )}
81
+ {...props}
82
+ />
83
+ );
84
+ }
85
+
86
+ function TableCell({ className, ...props }: React.ComponentProps<'td'>) {
87
+ return (
88
+ <td
89
+ data-slot="table-cell"
90
+ className={cn(
91
+ 'px-6 py-4 align-middle text-gray-700',
92
+ className
93
+ )}
94
+ {...props}
95
+ />
96
+ );
97
+ }
98
+
99
+ function TableCaption({
100
+ className,
101
+ ...props
102
+ }: React.ComponentProps<'caption'>) {
103
+ return (
104
+ <caption
105
+ data-slot="table-caption"
106
+ className={cn('mt-4 text-sm text-gray-500', className)}
107
+ {...props}
108
+ />
109
+ );
110
+ }
111
+
112
+ export {
113
+ Table,
114
+ TableHeader,
115
+ TableBody,
116
+ TableFooter,
117
+ TableHead,
118
+ TableRow,
119
+ TableCell,
120
+ TableCaption,
121
+ };
@@ -0,0 +1,18 @@
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-input 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-sm",
11
+ className
12
+ )}
13
+ {...props}
14
+ />
15
+ )
16
+ }
17
+
18
+ export { Textarea }
package/src/global.css ADDED
@@ -0,0 +1,6 @@
1
+ @import "tailwindcss";
2
+ @import "tw-animate-css";
3
+
4
+ @custom-variant dark (&:is(.dark *));
5
+
6
+ @import "./index.css";
package/src/index.css ADDED
@@ -0,0 +1,119 @@
1
+ :root {
2
+ --background: oklch(1 0 0);
3
+ --foreground: oklch(0.145 0 0);
4
+ --card: oklch(1 0 0);
5
+ --card-foreground: oklch(0.145 0 0);
6
+ --popover: oklch(1 0 0);
7
+ --popover-foreground: oklch(0.145 0 0);
8
+ --primary: oklch(0.205 0 0);
9
+ --primary-foreground: oklch(0.985 0 0);
10
+ --secondary: oklch(0.97 0 0);
11
+ --secondary-foreground: oklch(0.205 0 0);
12
+ --muted: oklch(0.97 0 0);
13
+ --muted-foreground: oklch(0.556 0 0);
14
+ --accent: oklch(0.97 0 0);
15
+ --accent-foreground: oklch(0.205 0 0);
16
+ --destructive: oklch(0.577 0.245 27.325);
17
+ --destructive-foreground: oklch(0.577 0.245 27.325);
18
+ --border: oklch(0.922 0 0);
19
+ --input: oklch(0.922 0 0);
20
+ --ring: oklch(0.708 0 0);
21
+ --chart-1: oklch(0.646 0.222 41.116);
22
+ --chart-2: oklch(0.6 0.118 184.704);
23
+ --chart-3: oklch(0.398 0.07 227.392);
24
+ --chart-4: oklch(0.828 0.189 84.429);
25
+ --chart-5: oklch(0.769 0.188 70.08);
26
+ --radius: 0.625rem;
27
+ --sidebar: oklch(0.985 0 0);
28
+ --sidebar-foreground: oklch(0.145 0 0);
29
+ --sidebar-primary: oklch(0.205 0 0);
30
+ --sidebar-primary-foreground: oklch(0.985 0 0);
31
+ --sidebar-accent: oklch(0.97 0 0);
32
+ --sidebar-accent-foreground: oklch(0.205 0 0);
33
+ --sidebar-border: oklch(0.922 0 0);
34
+ --sidebar-ring: oklch(0.708 0 0);
35
+ }
36
+
37
+ .dark {
38
+ --background: oklch(0.145 0 0);
39
+ --foreground: oklch(0.985 0 0);
40
+ --card: oklch(0.145 0 0);
41
+ --card-foreground: oklch(0.985 0 0);
42
+ --popover: oklch(0.145 0 0);
43
+ --popover-foreground: oklch(0.985 0 0);
44
+ --primary: oklch(0.985 0 0);
45
+ --primary-foreground: oklch(0.205 0 0);
46
+ --secondary: oklch(0.269 0 0);
47
+ --secondary-foreground: oklch(0.985 0 0);
48
+ --muted: oklch(0.269 0 0);
49
+ --muted-foreground: oklch(0.708 0 0);
50
+ --accent: oklch(0.269 0 0);
51
+ --accent-foreground: oklch(0.985 0 0);
52
+ --destructive: oklch(0.396 0.141 25.723);
53
+ --destructive-foreground: oklch(0.637 0.237 25.331);
54
+ --border: oklch(0.269 0 0);
55
+ --input: oklch(0.269 0 0);
56
+ --ring: oklch(0.439 0 0);
57
+ --chart-1: oklch(0.488 0.243 264.376);
58
+ --chart-2: oklch(0.696 0.17 162.48);
59
+ --chart-3: oklch(0.769 0.188 70.08);
60
+ --chart-4: oklch(0.627 0.265 303.9);
61
+ --chart-5: oklch(0.645 0.246 16.439);
62
+ --sidebar: oklch(0.205 0 0);
63
+ --sidebar-foreground: oklch(0.985 0 0);
64
+ --sidebar-primary: oklch(0.488 0.243 264.376);
65
+ --sidebar-primary-foreground: oklch(0.985 0 0);
66
+ --sidebar-accent: oklch(0.269 0 0);
67
+ --sidebar-accent-foreground: oklch(0.985 0 0);
68
+ --sidebar-border: oklch(0.269 0 0);
69
+ --sidebar-ring: oklch(0.439 0 0);
70
+ }
71
+
72
+ @theme inline {
73
+ --color-background: var(--background);
74
+ --color-foreground: var(--foreground);
75
+ --color-card: var(--card);
76
+ --color-card-foreground: var(--card-foreground);
77
+ --color-popover: var(--popover);
78
+ --color-popover-foreground: var(--popover-foreground);
79
+ --color-primary: var(--primary);
80
+ --color-primary-foreground: var(--primary-foreground);
81
+ --color-secondary: var(--secondary);
82
+ --color-secondary-foreground: var(--secondary-foreground);
83
+ --color-muted: var(--muted);
84
+ --color-muted-foreground: var(--muted-foreground);
85
+ --color-accent: var(--accent);
86
+ --color-accent-foreground: var(--accent-foreground);
87
+ --color-destructive: var(--destructive);
88
+ --color-destructive-foreground: var(--destructive-foreground);
89
+ --color-border: var(--border);
90
+ --color-input: var(--input);
91
+ --color-ring: var(--ring);
92
+ --color-chart-1: var(--chart-1);
93
+ --color-chart-2: var(--chart-2);
94
+ --color-chart-3: var(--chart-3);
95
+ --color-chart-4: var(--chart-4);
96
+ --color-chart-5: var(--chart-5);
97
+ --radius-sm: calc(var(--radius) - 4px);
98
+ --radius-md: calc(var(--radius) - 2px);
99
+ --radius-lg: var(--radius);
100
+ --radius-xl: calc(var(--radius) + 4px);
101
+ --color-sidebar: var(--sidebar);
102
+ --color-sidebar-foreground: var(--sidebar-foreground);
103
+ --color-sidebar-primary: var(--sidebar-primary);
104
+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
105
+ --color-sidebar-accent: var(--sidebar-accent);
106
+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
107
+ --color-sidebar-border: var(--sidebar-border);
108
+ --color-sidebar-ring: var(--sidebar-ring);
109
+ }
110
+
111
+ @layer base {
112
+ * {
113
+ @apply border-border outline-ring/50;
114
+ }
115
+
116
+ body {
117
+ @apply bg-background text-foreground;
118
+ }
119
+ }
package/src/index.ts ADDED
@@ -0,0 +1,4 @@
1
+ import './index.css'
2
+
3
+ export * from "@/components";
4
+ export * from "@/lib/utils";
@@ -0,0 +1,6 @@
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
+ }
@@ -0,0 +1,54 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-webpack5';
2
+
3
+ import { fn } from 'storybook/test';
4
+
5
+ import { Button } from './Button';
6
+
7
+ // More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
8
+ const meta = {
9
+ title: 'Example/Button',
10
+ component: Button,
11
+ parameters: {
12
+ // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
13
+ layout: 'centered',
14
+ },
15
+ // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
16
+ tags: ['autodocs'],
17
+ // More on argTypes: https://storybook.js.org/docs/api/argtypes
18
+ argTypes: {
19
+ backgroundColor: { control: 'color' },
20
+ },
21
+ // Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
22
+ args: { onClick: fn() },
23
+ } satisfies Meta<typeof Button>;
24
+
25
+ export default meta;
26
+ type Story = StoryObj<typeof meta>;
27
+
28
+ // More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
29
+ export const Primary: Story = {
30
+ args: {
31
+ primary: true,
32
+ label: 'Button',
33
+ },
34
+ };
35
+
36
+ export const Secondary: Story = {
37
+ args: {
38
+ label: 'Button',
39
+ },
40
+ };
41
+
42
+ export const Large: Story = {
43
+ args: {
44
+ size: 'large',
45
+ label: 'Button',
46
+ },
47
+ };
48
+
49
+ export const Small: Story = {
50
+ args: {
51
+ size: 'small',
52
+ label: 'Button',
53
+ },
54
+ };
@@ -0,0 +1,35 @@
1
+ import './button.css';
2
+
3
+ export interface ButtonProps {
4
+ /** Is this the principal call to action on the page? */
5
+ primary?: boolean;
6
+ /** What background color to use */
7
+ backgroundColor?: string;
8
+ /** How large should the button be? */
9
+ size?: 'small' | 'medium' | 'large';
10
+ /** Button contents */
11
+ label: string;
12
+ /** Optional click handler */
13
+ onClick?: () => void;
14
+ }
15
+
16
+ /** Primary UI component for user interaction */
17
+ export const Button = ({
18
+ primary = false,
19
+ size = 'medium',
20
+ backgroundColor,
21
+ label,
22
+ ...props
23
+ }: ButtonProps) => {
24
+ const mode = primary ? 'storybook-button--primary' : 'storybook-button--secondary';
25
+ return (
26
+ <button
27
+ type="button"
28
+ className={['storybook-button', `storybook-button--${size}`, mode].join(' ')}
29
+ style={{ backgroundColor }}
30
+ {...props}
31
+ >
32
+ {label}
33
+ </button>
34
+ );
35
+ };