@akanaka/components 0.1.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,169 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as react from 'react';
3
+ import { HTMLAttributes, ReactNode, ImgHTMLAttributes, ButtonHTMLAttributes, InputHTMLAttributes, SelectHTMLAttributes, TdHTMLAttributes, ThHTMLAttributes } from 'react';
4
+ export * from '@akanaka/tokens';
5
+
6
+ type AlertVariant = "info" | "success" | "warning" | "error";
7
+ interface AlertProps extends HTMLAttributes<HTMLDivElement> {
8
+ /** Visual style variant */
9
+ variant?: AlertVariant;
10
+ /** Alert title */
11
+ title?: string;
12
+ /** Alert content */
13
+ children: ReactNode;
14
+ /** Dismiss handler */
15
+ onDismiss?: () => void;
16
+ }
17
+ declare function Alert({ variant, title, children, onDismiss, className, ...props }: AlertProps): react_jsx_runtime.JSX.Element;
18
+
19
+ type AvatarSize = "sm" | "md" | "lg" | "xl";
20
+ interface AvatarProps extends Omit<ImgHTMLAttributes<HTMLImageElement>, "size"> {
21
+ /** Size of the avatar */
22
+ size?: AvatarSize;
23
+ /** Fallback initials when no image */
24
+ initials?: string;
25
+ /** Image source */
26
+ src?: string;
27
+ /** Alt text */
28
+ alt?: string;
29
+ }
30
+ declare function Avatar({ size, initials, src, alt, className, ...props }: AvatarProps): react_jsx_runtime.JSX.Element;
31
+
32
+ type BadgeVariant = "default" | "primary" | "success" | "warning" | "error" | "info";
33
+ interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
34
+ /** Visual style variant */
35
+ variant?: BadgeVariant;
36
+ /** Badge content */
37
+ children: ReactNode;
38
+ }
39
+ declare function Badge({ variant, children, className, ...props }: BadgeProps): react_jsx_runtime.JSX.Element;
40
+
41
+ type ButtonVariant = "primary" | "secondary" | "ghost" | "danger";
42
+ type ButtonSize = "sm" | "md" | "lg";
43
+ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
44
+ /** Visual style variant */
45
+ variant?: ButtonVariant;
46
+ /** Size of the button */
47
+ size?: ButtonSize;
48
+ /** Full width button */
49
+ fullWidth?: boolean;
50
+ }
51
+ declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
52
+
53
+ type CardVariant = "elevated" | "flat";
54
+ interface CardProps extends HTMLAttributes<HTMLDivElement> {
55
+ /** Visual style variant */
56
+ variant?: CardVariant;
57
+ /** Card content */
58
+ children: ReactNode;
59
+ }
60
+ interface CardHeaderProps extends HTMLAttributes<HTMLDivElement> {
61
+ children: ReactNode;
62
+ }
63
+ interface CardBodyProps extends HTMLAttributes<HTMLDivElement> {
64
+ children: ReactNode;
65
+ }
66
+ interface CardFooterProps extends HTMLAttributes<HTMLDivElement> {
67
+ children: ReactNode;
68
+ }
69
+ declare function Card({ variant, children, className, ...props }: CardProps): react_jsx_runtime.JSX.Element;
70
+ declare function CardHeader({ children, className, ...props }: CardHeaderProps): react_jsx_runtime.JSX.Element;
71
+ declare function CardBody({ children, className, ...props }: CardBodyProps): react_jsx_runtime.JSX.Element;
72
+ declare function CardFooter({ children, className, ...props }: CardFooterProps): react_jsx_runtime.JSX.Element;
73
+
74
+ interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type"> {
75
+ /** Label text */
76
+ label?: string;
77
+ }
78
+ declare const Checkbox: react.ForwardRefExoticComponent<CheckboxProps & react.RefAttributes<HTMLInputElement>>;
79
+
80
+ interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
81
+ /** Error message to display */
82
+ error?: string;
83
+ /** Label text */
84
+ label?: string;
85
+ /** Helper text below input */
86
+ helperText?: string;
87
+ }
88
+ declare const Input: react.ForwardRefExoticComponent<InputProps & react.RefAttributes<HTMLInputElement>>;
89
+
90
+ interface ProgressProps extends HTMLAttributes<HTMLDivElement> {
91
+ /** Current value (0-100) */
92
+ value: number;
93
+ /** Maximum value */
94
+ max?: number;
95
+ /** Show percentage label */
96
+ showLabel?: boolean;
97
+ }
98
+ declare function Progress({ value, max, showLabel, className, ...props }: ProgressProps): react_jsx_runtime.JSX.Element;
99
+
100
+ interface SelectOption {
101
+ value: string;
102
+ label: string;
103
+ disabled?: boolean;
104
+ }
105
+ interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, "children"> {
106
+ /** Options to display */
107
+ options: SelectOption[];
108
+ /** Placeholder text */
109
+ placeholder?: string;
110
+ /** Error message */
111
+ error?: string;
112
+ /** Label text */
113
+ label?: string;
114
+ }
115
+ declare const Select: react.ForwardRefExoticComponent<SelectProps & react.RefAttributes<HTMLSelectElement>>;
116
+
117
+ interface TableProps extends HTMLAttributes<HTMLTableElement> {
118
+ }
119
+ interface TableHeaderProps extends HTMLAttributes<HTMLTableSectionElement> {
120
+ }
121
+ interface TableBodyProps extends HTMLAttributes<HTMLTableSectionElement> {
122
+ }
123
+ interface TableRowProps extends HTMLAttributes<HTMLTableRowElement> {
124
+ }
125
+ interface TableHeadProps extends ThHTMLAttributes<HTMLTableCellElement> {
126
+ }
127
+ interface TableCellProps extends TdHTMLAttributes<HTMLTableCellElement> {
128
+ }
129
+ declare function Table({ className, children, ...props }: TableProps): react_jsx_runtime.JSX.Element;
130
+ declare function TableHeader({ className, children, ...props }: TableHeaderProps): react_jsx_runtime.JSX.Element;
131
+ declare function TableBody({ className, children, ...props }: TableBodyProps): react_jsx_runtime.JSX.Element;
132
+ declare function TableRow({ className, children, ...props }: TableRowProps): react_jsx_runtime.JSX.Element;
133
+ declare function TableHead({ className, children, ...props }: TableHeadProps): react_jsx_runtime.JSX.Element;
134
+ declare function TableCell({ className, children, ...props }: TableCellProps): react_jsx_runtime.JSX.Element;
135
+
136
+ interface TabsProps extends HTMLAttributes<HTMLDivElement> {
137
+ /** Default active tab value */
138
+ defaultValue: string;
139
+ /** Controlled active tab value */
140
+ value?: string;
141
+ /** Callback when tab changes */
142
+ onValueChange?: (value: string) => void;
143
+ children: ReactNode;
144
+ }
145
+ interface TabsListProps extends HTMLAttributes<HTMLDivElement> {
146
+ children: ReactNode;
147
+ }
148
+ interface TabsTriggerProps extends HTMLAttributes<HTMLButtonElement> {
149
+ /** Value that identifies this tab */
150
+ value: string;
151
+ children: ReactNode;
152
+ }
153
+ interface TabsContentProps extends HTMLAttributes<HTMLDivElement> {
154
+ /** Value that identifies this content */
155
+ value: string;
156
+ children: ReactNode;
157
+ }
158
+ declare function Tabs({ defaultValue, value, onValueChange, children, className, ...props }: TabsProps): react_jsx_runtime.JSX.Element;
159
+ declare function TabsList({ children, className, ...props }: TabsListProps): react_jsx_runtime.JSX.Element;
160
+ declare function TabsTrigger({ value, children, className, ...props }: TabsTriggerProps): react_jsx_runtime.JSX.Element;
161
+ declare function TabsContent({ value, children, className, ...props }: TabsContentProps): react_jsx_runtime.JSX.Element | null;
162
+
163
+ interface ToggleProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type"> {
164
+ /** Label text */
165
+ label?: string;
166
+ }
167
+ declare const Toggle: react.ForwardRefExoticComponent<ToggleProps & react.RefAttributes<HTMLInputElement>>;
168
+
169
+ export { Alert, type AlertProps, type AlertVariant, Avatar, type AvatarProps, type AvatarSize, Badge, type BadgeProps, type BadgeVariant, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, CardBody, type CardBodyProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, type CardVariant, Checkbox, type CheckboxProps, Input, type InputProps, Progress, type ProgressProps, Select, type SelectOption, type SelectProps, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableHead, type TableHeadProps, TableHeader, type TableHeaderProps, type TableProps, TableRow, type TableRowProps, Tabs, TabsContent, type TabsContentProps, TabsList, type TabsListProps, type TabsProps, TabsTrigger, type TabsTriggerProps, Toggle, type ToggleProps };
package/dist/index.js ADDED
@@ -0,0 +1,623 @@
1
+ // src/Alert/Alert.tsx
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ var variantStyles = {
4
+ info: {
5
+ container: "bg-blue-50 border-blue-200 text-blue-800",
6
+ icon: "text-blue-500"
7
+ },
8
+ success: {
9
+ container: "bg-green-50 border-green-200 text-green-800",
10
+ icon: "text-green-500"
11
+ },
12
+ warning: {
13
+ container: "bg-amber-50 border-amber-200 text-amber-800",
14
+ icon: "text-amber-500"
15
+ },
16
+ error: {
17
+ container: "bg-red-50 border-red-200 text-red-800",
18
+ icon: "text-red-500"
19
+ }
20
+ };
21
+ var icons = {
22
+ info: /* @__PURE__ */ jsx("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z", clipRule: "evenodd" }) }),
23
+ success: /* @__PURE__ */ jsx("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z", clipRule: "evenodd" }) }),
24
+ warning: /* @__PURE__ */ jsx("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z", clipRule: "evenodd" }) }),
25
+ error: /* @__PURE__ */ jsx("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z", clipRule: "evenodd" }) })
26
+ };
27
+ function Alert({
28
+ variant = "info",
29
+ title,
30
+ children,
31
+ onDismiss,
32
+ className = "",
33
+ ...props
34
+ }) {
35
+ const baseStyles = "flex gap-3 p-4 rounded-lg border";
36
+ const styles = variantStyles[variant];
37
+ const classes = [baseStyles, styles.container, className].filter(Boolean).join(" ");
38
+ return /* @__PURE__ */ jsxs("div", { role: "alert", className: classes, ...props, children: [
39
+ /* @__PURE__ */ jsx("span", { className: `flex-shrink-0 ${styles.icon}`, children: icons[variant] }),
40
+ /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
41
+ title && /* @__PURE__ */ jsx("p", { className: "font-semibold mb-1", children: title }),
42
+ /* @__PURE__ */ jsx("div", { className: "text-body-sm", children })
43
+ ] }),
44
+ onDismiss && /* @__PURE__ */ jsx(
45
+ "button",
46
+ {
47
+ onClick: onDismiss,
48
+ className: "flex-shrink-0 opacity-70 hover:opacity-100 transition-opacity",
49
+ "aria-label": "Dismiss",
50
+ children: /* @__PURE__ */ jsx("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z", clipRule: "evenodd" }) })
51
+ }
52
+ )
53
+ ] });
54
+ }
55
+
56
+ // src/Avatar/Avatar.tsx
57
+ import { jsx as jsx2 } from "react/jsx-runtime";
58
+ var sizeStyles = {
59
+ sm: "w-8 h-8 text-caption",
60
+ md: "w-10 h-10 text-body-sm",
61
+ lg: "w-12 h-12 text-body",
62
+ xl: "w-16 h-16 text-h3"
63
+ };
64
+ function Avatar({
65
+ size = "md",
66
+ initials,
67
+ src,
68
+ alt = "",
69
+ className = "",
70
+ ...props
71
+ }) {
72
+ const baseStyles = [
73
+ "inline-flex items-center justify-center",
74
+ "rounded-full",
75
+ "bg-primary-100 text-primary-700",
76
+ "font-semibold",
77
+ "overflow-hidden",
78
+ "flex-shrink-0"
79
+ ].join(" ");
80
+ const classes = [baseStyles, sizeStyles[size], className].filter(Boolean).join(" ");
81
+ if (src) {
82
+ return /* @__PURE__ */ jsx2(
83
+ "img",
84
+ {
85
+ src,
86
+ alt,
87
+ className: `${sizeStyles[size]} rounded-full object-cover ${className}`,
88
+ ...props
89
+ }
90
+ );
91
+ }
92
+ return /* @__PURE__ */ jsx2("span", { className: classes, role: "img", "aria-label": alt || initials, children: initials?.slice(0, 2).toUpperCase() });
93
+ }
94
+
95
+ // src/Badge/Badge.tsx
96
+ import { jsx as jsx3 } from "react/jsx-runtime";
97
+ var variantStyles2 = {
98
+ default: "bg-neutral-100 text-neutral-700",
99
+ primary: "bg-primary-100 text-primary-700",
100
+ success: "bg-green-100 text-green-700",
101
+ warning: "bg-amber-100 text-amber-700",
102
+ error: "bg-red-100 text-red-700",
103
+ info: "bg-blue-100 text-blue-700"
104
+ };
105
+ function Badge({
106
+ variant = "default",
107
+ children,
108
+ className = "",
109
+ ...props
110
+ }) {
111
+ const baseStyles = [
112
+ "inline-flex items-center",
113
+ "px-2 py-0.5",
114
+ "text-caption font-medium",
115
+ "rounded-full"
116
+ ].join(" ");
117
+ const classes = [baseStyles, variantStyles2[variant], className].filter(Boolean).join(" ");
118
+ return /* @__PURE__ */ jsx3("span", { className: classes, ...props, children });
119
+ }
120
+
121
+ // src/Button/Button.tsx
122
+ import { forwardRef } from "react";
123
+ import { jsx as jsx4 } from "react/jsx-runtime";
124
+ var variantStyles3 = {
125
+ primary: [
126
+ "bg-primary-500 text-white",
127
+ "hover:bg-primary-600",
128
+ "active:bg-primary-700",
129
+ "focus-visible:shadow-focus focus-visible:outline-none",
130
+ "disabled:bg-[rgb(39,52,236)] disabled:text-white"
131
+ ].join(" "),
132
+ secondary: [
133
+ "bg-neutral-100 text-neutral-900",
134
+ "border border-neutral-300",
135
+ "hover:bg-neutral-200",
136
+ "active:bg-neutral-300",
137
+ "focus-visible:shadow-focus focus-visible:outline-none",
138
+ "disabled:bg-neutral-100 disabled:text-neutral-500 disabled:border-neutral-200"
139
+ ].join(" "),
140
+ ghost: [
141
+ "bg-transparent text-neutral-700",
142
+ "hover:bg-neutral-100",
143
+ "active:bg-neutral-200",
144
+ "focus-visible:shadow-focus focus-visible:outline-none",
145
+ "disabled:text-neutral-500 disabled:bg-transparent"
146
+ ].join(" "),
147
+ danger: [
148
+ "bg-error text-white",
149
+ "hover:bg-red-600",
150
+ "active:bg-red-700",
151
+ "focus-visible:shadow-focus focus-visible:outline-none",
152
+ "disabled:bg-neutral-300 disabled:text-neutral-500"
153
+ ].join(" ")
154
+ };
155
+ var sizeStyles2 = {
156
+ sm: "px-3 py-1.5 text-body-sm rounded-sm",
157
+ md: "px-4 py-2 text-body rounded-md",
158
+ lg: "px-6 py-3 text-h3 rounded-lg"
159
+ };
160
+ var Button = forwardRef(
161
+ ({
162
+ variant = "primary",
163
+ size = "md",
164
+ fullWidth = false,
165
+ className = "",
166
+ disabled,
167
+ children,
168
+ ...props
169
+ }, ref) => {
170
+ const baseStyles = [
171
+ "inline-flex items-center justify-center",
172
+ "font-semibold",
173
+ "transition-colors duration-fast",
174
+ "cursor-pointer",
175
+ "disabled:cursor-not-allowed"
176
+ ].join(" ");
177
+ const classes = [
178
+ baseStyles,
179
+ variantStyles3[variant],
180
+ sizeStyles2[size],
181
+ fullWidth ? "w-full" : "",
182
+ className
183
+ ].filter(Boolean).join(" ");
184
+ return /* @__PURE__ */ jsx4(
185
+ "button",
186
+ {
187
+ ref,
188
+ className: classes,
189
+ disabled,
190
+ ...props,
191
+ children
192
+ }
193
+ );
194
+ }
195
+ );
196
+ Button.displayName = "Button";
197
+
198
+ // src/Card/Card.tsx
199
+ import { jsx as jsx5 } from "react/jsx-runtime";
200
+ var variantStyles4 = {
201
+ elevated: "bg-white shadow-md border border-neutral-200",
202
+ flat: "bg-neutral-50 border border-neutral-200"
203
+ };
204
+ function Card({
205
+ variant = "elevated",
206
+ children,
207
+ className = "",
208
+ ...props
209
+ }) {
210
+ const baseStyles = "rounded-lg overflow-hidden";
211
+ const classes = [baseStyles, variantStyles4[variant], className].filter(Boolean).join(" ");
212
+ return /* @__PURE__ */ jsx5("div", { className: classes, ...props, children });
213
+ }
214
+ function CardHeader({ children, className = "", ...props }) {
215
+ return /* @__PURE__ */ jsx5("div", { className: `px-4 py-3 border-b border-neutral-200 ${className}`, ...props, children });
216
+ }
217
+ function CardBody({ children, className = "", ...props }) {
218
+ return /* @__PURE__ */ jsx5("div", { className: `px-4 py-4 ${className}`, ...props, children });
219
+ }
220
+ function CardFooter({ children, className = "", ...props }) {
221
+ return /* @__PURE__ */ jsx5("div", { className: `px-4 py-3 border-t border-neutral-200 bg-neutral-50 ${className}`, ...props, children });
222
+ }
223
+
224
+ // src/Checkbox/Checkbox.tsx
225
+ import { forwardRef as forwardRef2 } from "react";
226
+ import { jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
227
+ var Checkbox = forwardRef2(
228
+ ({ label, disabled, className = "", id, ...props }, ref) => {
229
+ const checkboxId = id || props.name;
230
+ const checkboxStyles = [
231
+ "w-4 h-4",
232
+ "rounded-sm",
233
+ "border border-neutral-300",
234
+ "text-primary-500",
235
+ "transition-colors duration-fast",
236
+ "focus:outline-none focus:shadow-focus",
237
+ "checked:bg-primary-500 checked:border-primary-500",
238
+ "hover:border-neutral-500",
239
+ "disabled:bg-neutral-100 disabled:border-neutral-300 disabled:cursor-not-allowed",
240
+ "cursor-pointer",
241
+ "accent-primary-500"
242
+ ].join(" ");
243
+ return /* @__PURE__ */ jsxs2("div", { className: `flex items-center gap-2 ${className}`, children: [
244
+ /* @__PURE__ */ jsx6(
245
+ "input",
246
+ {
247
+ ref,
248
+ type: "checkbox",
249
+ id: checkboxId,
250
+ disabled,
251
+ className: checkboxStyles,
252
+ ...props
253
+ }
254
+ ),
255
+ label && /* @__PURE__ */ jsx6(
256
+ "label",
257
+ {
258
+ htmlFor: checkboxId,
259
+ className: `text-body text-neutral-900 select-none ${disabled ? "text-neutral-500 cursor-not-allowed" : "cursor-pointer"}`,
260
+ children: label
261
+ }
262
+ )
263
+ ] });
264
+ }
265
+ );
266
+ Checkbox.displayName = "Checkbox";
267
+
268
+ // src/Input/Input.tsx
269
+ import { forwardRef as forwardRef3 } from "react";
270
+ import { jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
271
+ var Input = forwardRef3(
272
+ ({ error, label, helperText, disabled, className = "", id, ...props }, ref) => {
273
+ const inputId = id || props.name;
274
+ const baseStyles = [
275
+ "w-full px-3 py-2",
276
+ "text-body text-neutral-900",
277
+ "bg-white",
278
+ "border rounded-md",
279
+ "transition-colors duration-fast",
280
+ "placeholder:text-neutral-500",
281
+ "focus:outline-none focus:shadow-focus"
282
+ ].join(" ");
283
+ const stateStyles = error ? "border-error focus:border-error" : "border-neutral-300 hover:border-neutral-500 focus:border-primary-500";
284
+ const disabledStyles = disabled ? "bg-neutral-100 text-neutral-500 cursor-not-allowed hover:border-neutral-300" : "";
285
+ const classes = [baseStyles, stateStyles, disabledStyles, className].filter(Boolean).join(" ");
286
+ return /* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-1", children: [
287
+ label && /* @__PURE__ */ jsx7(
288
+ "label",
289
+ {
290
+ htmlFor: inputId,
291
+ className: "text-body-sm font-medium text-neutral-700",
292
+ children: label
293
+ }
294
+ ),
295
+ /* @__PURE__ */ jsx7(
296
+ "input",
297
+ {
298
+ ref,
299
+ id: inputId,
300
+ disabled,
301
+ className: classes,
302
+ "aria-invalid": !!error,
303
+ "aria-describedby": error ? `${inputId}-error` : helperText ? `${inputId}-helper` : void 0,
304
+ ...props
305
+ }
306
+ ),
307
+ error && /* @__PURE__ */ jsx7("p", { id: `${inputId}-error`, className: "text-body-sm text-error", children: error }),
308
+ !error && helperText && /* @__PURE__ */ jsx7("p", { id: `${inputId}-helper`, className: "text-body-sm text-neutral-500", children: helperText })
309
+ ] });
310
+ }
311
+ );
312
+ Input.displayName = "Input";
313
+
314
+ // src/Progress/Progress.tsx
315
+ import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
316
+ function Progress({
317
+ value,
318
+ max = 100,
319
+ showLabel = false,
320
+ className = "",
321
+ ...props
322
+ }) {
323
+ const percentage = Math.min(Math.max(value / max * 100, 0), 100);
324
+ return /* @__PURE__ */ jsxs4("div", { className: `flex items-center gap-3 ${className}`, ...props, children: [
325
+ /* @__PURE__ */ jsx8(
326
+ "div",
327
+ {
328
+ role: "progressbar",
329
+ "aria-valuenow": value,
330
+ "aria-valuemin": 0,
331
+ "aria-valuemax": max,
332
+ className: "flex-1 h-2 bg-neutral-200 rounded-full overflow-hidden",
333
+ children: /* @__PURE__ */ jsx8(
334
+ "div",
335
+ {
336
+ className: "h-full bg-primary-500 rounded-full transition-all duration-base",
337
+ style: { width: `${percentage}%` }
338
+ }
339
+ )
340
+ }
341
+ ),
342
+ showLabel && /* @__PURE__ */ jsxs4("span", { className: "text-body-sm text-neutral-500 min-w-[3ch]", children: [
343
+ Math.round(percentage),
344
+ "%"
345
+ ] })
346
+ ] });
347
+ }
348
+
349
+ // src/Select/Select.tsx
350
+ import { forwardRef as forwardRef4 } from "react";
351
+ import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
352
+ var Select = forwardRef4(
353
+ ({ options, placeholder, error, label, disabled, className = "", id, ...props }, ref) => {
354
+ const selectId = id || props.name;
355
+ const baseStyles = [
356
+ "w-full px-3 py-2",
357
+ "text-body text-neutral-900",
358
+ "bg-white",
359
+ "border rounded-md",
360
+ "transition-colors duration-fast",
361
+ "focus:outline-none focus:shadow-focus",
362
+ "appearance-none",
363
+ "bg-[url('data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%20viewBox%3D%220%200%2012%2012%22%3E%3Cpath%20fill%3D%22%2378716C%22%20d%3D%22M6%208L2%204h8z%22%2F%3E%3C%2Fsvg%3E')]",
364
+ "bg-[length:12px] bg-[right_12px_center] bg-no-repeat",
365
+ "pr-10"
366
+ ].join(" ");
367
+ const stateStyles = error ? "border-error focus:border-error" : "border-neutral-300 hover:border-neutral-500 focus:border-primary-500";
368
+ const disabledStyles = disabled ? "bg-neutral-100 text-neutral-500 cursor-not-allowed hover:border-neutral-300" : "cursor-pointer";
369
+ const classes = [baseStyles, stateStyles, disabledStyles, className].filter(Boolean).join(" ");
370
+ return /* @__PURE__ */ jsxs5("div", { className: "flex flex-col gap-1", children: [
371
+ label && /* @__PURE__ */ jsx9(
372
+ "label",
373
+ {
374
+ htmlFor: selectId,
375
+ className: "text-body-sm font-medium text-neutral-700",
376
+ children: label
377
+ }
378
+ ),
379
+ /* @__PURE__ */ jsxs5(
380
+ "select",
381
+ {
382
+ ref,
383
+ id: selectId,
384
+ disabled,
385
+ className: classes,
386
+ "aria-invalid": !!error,
387
+ ...props,
388
+ children: [
389
+ placeholder && /* @__PURE__ */ jsx9("option", { value: "", disabled: true, children: placeholder }),
390
+ options.map((option) => /* @__PURE__ */ jsx9(
391
+ "option",
392
+ {
393
+ value: option.value,
394
+ disabled: option.disabled,
395
+ children: option.label
396
+ },
397
+ option.value
398
+ ))
399
+ ]
400
+ }
401
+ ),
402
+ error && /* @__PURE__ */ jsx9("p", { className: "text-body-sm text-error", children: error })
403
+ ] });
404
+ }
405
+ );
406
+ Select.displayName = "Select";
407
+
408
+ // src/Table/Table.tsx
409
+ import { jsx as jsx10 } from "react/jsx-runtime";
410
+ function Table({ className = "", children, ...props }) {
411
+ return /* @__PURE__ */ jsx10("div", { className: "w-full overflow-auto", children: /* @__PURE__ */ jsx10(
412
+ "table",
413
+ {
414
+ className: `w-full border-collapse text-body ${className}`,
415
+ ...props,
416
+ children
417
+ }
418
+ ) });
419
+ }
420
+ function TableHeader({ className = "", children, ...props }) {
421
+ return /* @__PURE__ */ jsx10("thead", { className: `bg-neutral-50 ${className}`, ...props, children });
422
+ }
423
+ function TableBody({ className = "", children, ...props }) {
424
+ return /* @__PURE__ */ jsx10("tbody", { className: `divide-y divide-neutral-200 ${className}`, ...props, children });
425
+ }
426
+ function TableRow({ className = "", children, ...props }) {
427
+ return /* @__PURE__ */ jsx10(
428
+ "tr",
429
+ {
430
+ className: `border-b border-neutral-200 hover:bg-neutral-50 transition-colors ${className}`,
431
+ ...props,
432
+ children
433
+ }
434
+ );
435
+ }
436
+ function TableHead({ className = "", children, ...props }) {
437
+ return /* @__PURE__ */ jsx10(
438
+ "th",
439
+ {
440
+ className: `px-4 py-3 text-left text-body-sm font-semibold text-neutral-700 ${className}`,
441
+ ...props,
442
+ children
443
+ }
444
+ );
445
+ }
446
+ function TableCell({ className = "", children, ...props }) {
447
+ return /* @__PURE__ */ jsx10(
448
+ "td",
449
+ {
450
+ className: `px-4 py-3 text-neutral-900 ${className}`,
451
+ ...props,
452
+ children
453
+ }
454
+ );
455
+ }
456
+
457
+ // src/Tabs/Tabs.tsx
458
+ import {
459
+ createContext,
460
+ useContext,
461
+ useState
462
+ } from "react";
463
+ import { jsx as jsx11 } from "react/jsx-runtime";
464
+ var TabsContext = createContext(null);
465
+ function useTabsContext() {
466
+ const context = useContext(TabsContext);
467
+ if (!context) {
468
+ throw new Error("Tabs components must be used within a Tabs provider");
469
+ }
470
+ return context;
471
+ }
472
+ function Tabs({
473
+ defaultValue,
474
+ value,
475
+ onValueChange,
476
+ children,
477
+ className = "",
478
+ ...props
479
+ }) {
480
+ const [internalValue, setInternalValue] = useState(defaultValue);
481
+ const activeTab = value ?? internalValue;
482
+ const setActiveTab = (newValue) => {
483
+ if (!value) {
484
+ setInternalValue(newValue);
485
+ }
486
+ onValueChange?.(newValue);
487
+ };
488
+ return /* @__PURE__ */ jsx11(TabsContext.Provider, { value: { activeTab, setActiveTab }, children: /* @__PURE__ */ jsx11("div", { className, ...props, children }) });
489
+ }
490
+ function TabsList({ children, className = "", ...props }) {
491
+ return /* @__PURE__ */ jsx11(
492
+ "div",
493
+ {
494
+ role: "tablist",
495
+ className: `flex border-b border-neutral-200 ${className}`,
496
+ ...props,
497
+ children
498
+ }
499
+ );
500
+ }
501
+ function TabsTrigger({
502
+ value,
503
+ children,
504
+ className = "",
505
+ ...props
506
+ }) {
507
+ const { activeTab, setActiveTab } = useTabsContext();
508
+ const isActive = activeTab === value;
509
+ const baseStyles = [
510
+ "px-4 py-2",
511
+ "text-body font-medium",
512
+ "border-b-2 -mb-px",
513
+ "transition-colors duration-fast",
514
+ "focus:outline-none focus-visible:shadow-focus"
515
+ ].join(" ");
516
+ const stateStyles = isActive ? "border-primary-500 text-primary-600" : "border-transparent text-neutral-500 hover:text-neutral-700 hover:border-neutral-300";
517
+ return /* @__PURE__ */ jsx11(
518
+ "button",
519
+ {
520
+ role: "tab",
521
+ "aria-selected": isActive,
522
+ onClick: () => setActiveTab(value),
523
+ className: `${baseStyles} ${stateStyles} ${className}`,
524
+ ...props,
525
+ children
526
+ }
527
+ );
528
+ }
529
+ function TabsContent({
530
+ value,
531
+ children,
532
+ className = "",
533
+ ...props
534
+ }) {
535
+ const { activeTab } = useTabsContext();
536
+ if (activeTab !== value) {
537
+ return null;
538
+ }
539
+ return /* @__PURE__ */ jsx11("div", { role: "tabpanel", className: `py-4 ${className}`, ...props, children });
540
+ }
541
+
542
+ // src/Toggle/Toggle.tsx
543
+ import { forwardRef as forwardRef5 } from "react";
544
+ import { jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
545
+ var Toggle = forwardRef5(
546
+ ({ label, disabled, checked, className = "", id, ...props }, ref) => {
547
+ const toggleId = id || props.name;
548
+ const trackStyles = [
549
+ "relative inline-flex",
550
+ "w-10 h-6",
551
+ "rounded-full",
552
+ "transition-colors duration-fast",
553
+ "cursor-pointer",
554
+ checked ? "bg-primary-500" : "bg-neutral-300",
555
+ disabled ? "opacity-50 cursor-not-allowed" : ""
556
+ ].join(" ");
557
+ const thumbStyles = [
558
+ "absolute top-1 left-1",
559
+ "w-4 h-4",
560
+ "bg-white rounded-full",
561
+ "shadow-sm",
562
+ "transition-transform duration-fast",
563
+ checked ? "translate-x-4" : "translate-x-0"
564
+ ].join(" ");
565
+ return /* @__PURE__ */ jsxs6("div", { className: `flex items-center gap-2 ${className}`, children: [
566
+ /* @__PURE__ */ jsxs6("label", { htmlFor: toggleId, className: trackStyles, children: [
567
+ /* @__PURE__ */ jsx12(
568
+ "input",
569
+ {
570
+ ref,
571
+ type: "checkbox",
572
+ role: "switch",
573
+ id: toggleId,
574
+ disabled,
575
+ checked,
576
+ className: "sr-only",
577
+ "aria-checked": checked,
578
+ ...props
579
+ }
580
+ ),
581
+ /* @__PURE__ */ jsx12("span", { className: thumbStyles })
582
+ ] }),
583
+ label && /* @__PURE__ */ jsx12(
584
+ "label",
585
+ {
586
+ htmlFor: toggleId,
587
+ className: `text-body text-neutral-900 select-none ${disabled ? "text-neutral-500 cursor-not-allowed" : "cursor-pointer"}`,
588
+ children: label
589
+ }
590
+ )
591
+ ] });
592
+ }
593
+ );
594
+ Toggle.displayName = "Toggle";
595
+
596
+ // src/index.ts
597
+ export * from "@akanaka/tokens";
598
+ export {
599
+ Alert,
600
+ Avatar,
601
+ Badge,
602
+ Button,
603
+ Card,
604
+ CardBody,
605
+ CardFooter,
606
+ CardHeader,
607
+ Checkbox,
608
+ Input,
609
+ Progress,
610
+ Select,
611
+ Table,
612
+ TableBody,
613
+ TableCell,
614
+ TableHead,
615
+ TableHeader,
616
+ TableRow,
617
+ Tabs,
618
+ TabsContent,
619
+ TabsList,
620
+ TabsTrigger,
621
+ Toggle
622
+ };
623
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/Alert/Alert.tsx","../src/Avatar/Avatar.tsx","../src/Badge/Badge.tsx","../src/Button/Button.tsx","../src/Card/Card.tsx","../src/Checkbox/Checkbox.tsx","../src/Input/Input.tsx","../src/Progress/Progress.tsx","../src/Select/Select.tsx","../src/Table/Table.tsx","../src/Tabs/Tabs.tsx","../src/Toggle/Toggle.tsx","../src/index.ts"],"sourcesContent":["import type { HTMLAttributes, ReactNode } from \"react\";\n\nexport type AlertVariant = \"info\" | \"success\" | \"warning\" | \"error\";\n\nexport interface AlertProps extends HTMLAttributes<HTMLDivElement> {\n /** Visual style variant */\n variant?: AlertVariant;\n /** Alert title */\n title?: string;\n /** Alert content */\n children: ReactNode;\n /** Dismiss handler */\n onDismiss?: () => void;\n}\n\nconst variantStyles: Record<AlertVariant, { container: string; icon: string }> = {\n info: {\n container: \"bg-blue-50 border-blue-200 text-blue-800\",\n icon: \"text-blue-500\",\n },\n success: {\n container: \"bg-green-50 border-green-200 text-green-800\",\n icon: \"text-green-500\",\n },\n warning: {\n container: \"bg-amber-50 border-amber-200 text-amber-800\",\n icon: \"text-amber-500\",\n },\n error: {\n container: \"bg-red-50 border-red-200 text-red-800\",\n icon: \"text-red-500\",\n },\n};\n\nconst icons: Record<AlertVariant, ReactNode> = {\n info: (\n <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\">\n <path fillRule=\"evenodd\" d=\"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z\" clipRule=\"evenodd\" />\n </svg>\n ),\n success: (\n <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\">\n <path fillRule=\"evenodd\" d=\"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z\" clipRule=\"evenodd\" />\n </svg>\n ),\n warning: (\n <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\">\n <path fillRule=\"evenodd\" d=\"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z\" clipRule=\"evenodd\" />\n </svg>\n ),\n error: (\n <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\">\n <path fillRule=\"evenodd\" d=\"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z\" clipRule=\"evenodd\" />\n </svg>\n ),\n};\n\nexport function Alert({\n variant = \"info\",\n title,\n children,\n onDismiss,\n className = \"\",\n ...props\n}: AlertProps) {\n const baseStyles = \"flex gap-3 p-4 rounded-lg border\";\n const styles = variantStyles[variant];\n const classes = [baseStyles, styles.container, className].filter(Boolean).join(\" \");\n\n return (\n <div role=\"alert\" className={classes} {...props}>\n <span className={`flex-shrink-0 ${styles.icon}`}>{icons[variant]}</span>\n <div className=\"flex-1\">\n {title && <p className=\"font-semibold mb-1\">{title}</p>}\n <div className=\"text-body-sm\">{children}</div>\n </div>\n {onDismiss && (\n <button\n onClick={onDismiss}\n className=\"flex-shrink-0 opacity-70 hover:opacity-100 transition-opacity\"\n aria-label=\"Dismiss\"\n >\n <svg className=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\">\n <path fillRule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clipRule=\"evenodd\" />\n </svg>\n </button>\n )}\n </div>\n );\n}\n","import type { ImgHTMLAttributes } from \"react\";\n\nexport type AvatarSize = \"sm\" | \"md\" | \"lg\" | \"xl\";\n\nexport interface AvatarProps extends Omit<ImgHTMLAttributes<HTMLImageElement>, \"size\"> {\n /** Size of the avatar */\n size?: AvatarSize;\n /** Fallback initials when no image */\n initials?: string;\n /** Image source */\n src?: string;\n /** Alt text */\n alt?: string;\n}\n\nconst sizeStyles: Record<AvatarSize, string> = {\n sm: \"w-8 h-8 text-caption\",\n md: \"w-10 h-10 text-body-sm\",\n lg: \"w-12 h-12 text-body\",\n xl: \"w-16 h-16 text-h3\",\n};\n\nexport function Avatar({\n size = \"md\",\n initials,\n src,\n alt = \"\",\n className = \"\",\n ...props\n}: AvatarProps) {\n const baseStyles = [\n \"inline-flex items-center justify-center\",\n \"rounded-full\",\n \"bg-primary-100 text-primary-700\",\n \"font-semibold\",\n \"overflow-hidden\",\n \"flex-shrink-0\",\n ].join(\" \");\n\n const classes = [baseStyles, sizeStyles[size], className]\n .filter(Boolean)\n .join(\" \");\n\n if (src) {\n return (\n <img\n src={src}\n alt={alt}\n className={`${sizeStyles[size]} rounded-full object-cover ${className}`}\n {...props}\n />\n );\n }\n\n return (\n <span className={classes} role=\"img\" aria-label={alt || initials}>\n {initials?.slice(0, 2).toUpperCase()}\n </span>\n );\n}\n","import type { HTMLAttributes, ReactNode } from \"react\";\n\nexport type BadgeVariant = \"default\" | \"primary\" | \"success\" | \"warning\" | \"error\" | \"info\";\n\nexport interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {\n /** Visual style variant */\n variant?: BadgeVariant;\n /** Badge content */\n children: ReactNode;\n}\n\nconst variantStyles: Record<BadgeVariant, string> = {\n default: \"bg-neutral-100 text-neutral-700\",\n primary: \"bg-primary-100 text-primary-700\",\n success: \"bg-green-100 text-green-700\",\n warning: \"bg-amber-100 text-amber-700\",\n error: \"bg-red-100 text-red-700\",\n info: \"bg-blue-100 text-blue-700\",\n};\n\nexport function Badge({\n variant = \"default\",\n children,\n className = \"\",\n ...props\n}: BadgeProps) {\n const baseStyles = [\n \"inline-flex items-center\",\n \"px-2 py-0.5\",\n \"text-caption font-medium\",\n \"rounded-full\",\n ].join(\" \");\n\n const classes = [baseStyles, variantStyles[variant], className]\n .filter(Boolean)\n .join(\" \");\n\n return (\n <span className={classes} {...props}>\n {children}\n </span>\n );\n}\n","import { forwardRef, type ButtonHTMLAttributes } from \"react\";\n\nexport type ButtonVariant = \"primary\" | \"secondary\" | \"ghost\" | \"danger\";\nexport type ButtonSize = \"sm\" | \"md\" | \"lg\";\n\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n /** Visual style variant */\n variant?: ButtonVariant;\n /** Size of the button */\n size?: ButtonSize;\n /** Full width button */\n fullWidth?: boolean;\n}\n\nconst variantStyles: Record<ButtonVariant, string> = {\n primary: [\n \"bg-primary-500 text-white\",\n \"hover:bg-primary-600\",\n \"active:bg-primary-700\",\n \"focus-visible:shadow-focus focus-visible:outline-none\",\n \"disabled:bg-[rgb(39,52,236)] disabled:text-white\",\n ].join(\" \"),\n secondary: [\n \"bg-neutral-100 text-neutral-900\",\n \"border border-neutral-300\",\n \"hover:bg-neutral-200\",\n \"active:bg-neutral-300\",\n \"focus-visible:shadow-focus focus-visible:outline-none\",\n \"disabled:bg-neutral-100 disabled:text-neutral-500 disabled:border-neutral-200\",\n ].join(\" \"),\n ghost: [\n \"bg-transparent text-neutral-700\",\n \"hover:bg-neutral-100\",\n \"active:bg-neutral-200\",\n \"focus-visible:shadow-focus focus-visible:outline-none\",\n \"disabled:text-neutral-500 disabled:bg-transparent\",\n ].join(\" \"),\n danger: [\n \"bg-error text-white\",\n \"hover:bg-red-600\",\n \"active:bg-red-700\",\n \"focus-visible:shadow-focus focus-visible:outline-none\",\n \"disabled:bg-neutral-300 disabled:text-neutral-500\",\n ].join(\" \"),\n};\n\nconst sizeStyles: Record<ButtonSize, string> = {\n sm: \"px-3 py-1.5 text-body-sm rounded-sm\",\n md: \"px-4 py-2 text-body rounded-md\",\n lg: \"px-6 py-3 text-h3 rounded-lg\",\n};\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n variant = \"primary\",\n size = \"md\",\n fullWidth = false,\n className = \"\",\n disabled,\n children,\n ...props\n },\n ref\n ) => {\n const baseStyles = [\n \"inline-flex items-center justify-center\",\n \"font-semibold\",\n \"transition-colors duration-fast\",\n \"cursor-pointer\",\n \"disabled:cursor-not-allowed\",\n ].join(\" \");\n\n const classes = [\n baseStyles,\n variantStyles[variant],\n sizeStyles[size],\n fullWidth ? \"w-full\" : \"\",\n className,\n ]\n .filter(Boolean)\n .join(\" \");\n\n return (\n <button\n ref={ref}\n className={classes}\n disabled={disabled}\n {...props}\n >\n {children}\n </button>\n );\n }\n);\n\nButton.displayName = \"Button\";\n","import type { HTMLAttributes, ReactNode } from \"react\";\n\nexport type CardVariant = \"elevated\" | \"flat\";\n\nexport interface CardProps extends HTMLAttributes<HTMLDivElement> {\n /** Visual style variant */\n variant?: CardVariant;\n /** Card content */\n children: ReactNode;\n}\n\nexport interface CardHeaderProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n}\n\nexport interface CardBodyProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n}\n\nexport interface CardFooterProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n}\n\nconst variantStyles: Record<CardVariant, string> = {\n elevated: \"bg-white shadow-md border border-neutral-200\",\n flat: \"bg-neutral-50 border border-neutral-200\",\n};\n\nexport function Card({\n variant = \"elevated\",\n children,\n className = \"\",\n ...props\n}: CardProps) {\n const baseStyles = \"rounded-lg overflow-hidden\";\n const classes = [baseStyles, variantStyles[variant], className]\n .filter(Boolean)\n .join(\" \");\n\n return (\n <div className={classes} {...props}>\n {children}\n </div>\n );\n}\n\nexport function CardHeader({ children, className = \"\", ...props }: CardHeaderProps) {\n return (\n <div className={`px-4 py-3 border-b border-neutral-200 ${className}`} {...props}>\n {children}\n </div>\n );\n}\n\nexport function CardBody({ children, className = \"\", ...props }: CardBodyProps) {\n return (\n <div className={`px-4 py-4 ${className}`} {...props}>\n {children}\n </div>\n );\n}\n\nexport function CardFooter({ children, className = \"\", ...props }: CardFooterProps) {\n return (\n <div className={`px-4 py-3 border-t border-neutral-200 bg-neutral-50 ${className}`} {...props}>\n {children}\n </div>\n );\n}\n","import { forwardRef, type InputHTMLAttributes } from \"react\";\n\nexport interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, \"type\"> {\n /** Label text */\n label?: string;\n}\n\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(\n ({ label, disabled, className = \"\", id, ...props }, ref) => {\n const checkboxId = id || props.name;\n\n const checkboxStyles = [\n \"w-4 h-4\",\n \"rounded-sm\",\n \"border border-neutral-300\",\n \"text-primary-500\",\n \"transition-colors duration-fast\",\n \"focus:outline-none focus:shadow-focus\",\n \"checked:bg-primary-500 checked:border-primary-500\",\n \"hover:border-neutral-500\",\n \"disabled:bg-neutral-100 disabled:border-neutral-300 disabled:cursor-not-allowed\",\n \"cursor-pointer\",\n \"accent-primary-500\",\n ].join(\" \");\n\n return (\n <div className={`flex items-center gap-2 ${className}`}>\n <input\n ref={ref}\n type=\"checkbox\"\n id={checkboxId}\n disabled={disabled}\n className={checkboxStyles}\n {...props}\n />\n {label && (\n <label\n htmlFor={checkboxId}\n className={`text-body text-neutral-900 select-none ${\n disabled ? \"text-neutral-500 cursor-not-allowed\" : \"cursor-pointer\"\n }`}\n >\n {label}\n </label>\n )}\n </div>\n );\n }\n);\n\nCheckbox.displayName = \"Checkbox\";\n","import { forwardRef, type InputHTMLAttributes } from \"react\";\n\nexport interface InputProps extends InputHTMLAttributes<HTMLInputElement> {\n /** Error message to display */\n error?: string;\n /** Label text */\n label?: string;\n /** Helper text below input */\n helperText?: string;\n}\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(\n ({ error, label, helperText, disabled, className = \"\", id, ...props }, ref) => {\n const inputId = id || props.name;\n\n const baseStyles = [\n \"w-full px-3 py-2\",\n \"text-body text-neutral-900\",\n \"bg-white\",\n \"border rounded-md\",\n \"transition-colors duration-fast\",\n \"placeholder:text-neutral-500\",\n \"focus:outline-none focus:shadow-focus\",\n ].join(\" \");\n\n const stateStyles = error\n ? \"border-error focus:border-error\"\n : \"border-neutral-300 hover:border-neutral-500 focus:border-primary-500\";\n\n const disabledStyles = disabled\n ? \"bg-neutral-100 text-neutral-500 cursor-not-allowed hover:border-neutral-300\"\n : \"\";\n\n const classes = [baseStyles, stateStyles, disabledStyles, className]\n .filter(Boolean)\n .join(\" \");\n\n return (\n <div className=\"flex flex-col gap-1\">\n {label && (\n <label\n htmlFor={inputId}\n className=\"text-body-sm font-medium text-neutral-700\"\n >\n {label}\n </label>\n )}\n <input\n ref={ref}\n id={inputId}\n disabled={disabled}\n className={classes}\n aria-invalid={!!error}\n aria-describedby={error ? `${inputId}-error` : helperText ? `${inputId}-helper` : undefined}\n {...props}\n />\n {error && (\n <p id={`${inputId}-error`} className=\"text-body-sm text-error\">\n {error}\n </p>\n )}\n {!error && helperText && (\n <p id={`${inputId}-helper`} className=\"text-body-sm text-neutral-500\">\n {helperText}\n </p>\n )}\n </div>\n );\n }\n);\n\nInput.displayName = \"Input\";\n","import type { HTMLAttributes } from \"react\";\n\nexport interface ProgressProps extends HTMLAttributes<HTMLDivElement> {\n /** Current value (0-100) */\n value: number;\n /** Maximum value */\n max?: number;\n /** Show percentage label */\n showLabel?: boolean;\n}\n\nexport function Progress({\n value,\n max = 100,\n showLabel = false,\n className = \"\",\n ...props\n}: ProgressProps) {\n const percentage = Math.min(Math.max((value / max) * 100, 0), 100);\n\n return (\n <div className={`flex items-center gap-3 ${className}`} {...props}>\n <div\n role=\"progressbar\"\n aria-valuenow={value}\n aria-valuemin={0}\n aria-valuemax={max}\n className=\"flex-1 h-2 bg-neutral-200 rounded-full overflow-hidden\"\n >\n <div\n className=\"h-full bg-primary-500 rounded-full transition-all duration-base\"\n style={{ width: `${percentage}%` }}\n />\n </div>\n {showLabel && (\n <span className=\"text-body-sm text-neutral-500 min-w-[3ch]\">\n {Math.round(percentage)}%\n </span>\n )}\n </div>\n );\n}\n","import { forwardRef, type SelectHTMLAttributes } from \"react\";\n\nexport interface SelectOption {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\nexport interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, \"children\"> {\n /** Options to display */\n options: SelectOption[];\n /** Placeholder text */\n placeholder?: string;\n /** Error message */\n error?: string;\n /** Label text */\n label?: string;\n}\n\nexport const Select = forwardRef<HTMLSelectElement, SelectProps>(\n ({ options, placeholder, error, label, disabled, className = \"\", id, ...props }, ref) => {\n const selectId = id || props.name;\n\n const baseStyles = [\n \"w-full px-3 py-2\",\n \"text-body text-neutral-900\",\n \"bg-white\",\n \"border rounded-md\",\n \"transition-colors duration-fast\",\n \"focus:outline-none focus:shadow-focus\",\n \"appearance-none\",\n \"bg-[url('data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%20viewBox%3D%220%200%2012%2012%22%3E%3Cpath%20fill%3D%22%2378716C%22%20d%3D%22M6%208L2%204h8z%22%2F%3E%3C%2Fsvg%3E')]\",\n \"bg-[length:12px] bg-[right_12px_center] bg-no-repeat\",\n \"pr-10\",\n ].join(\" \");\n\n const stateStyles = error\n ? \"border-error focus:border-error\"\n : \"border-neutral-300 hover:border-neutral-500 focus:border-primary-500\";\n\n const disabledStyles = disabled\n ? \"bg-neutral-100 text-neutral-500 cursor-not-allowed hover:border-neutral-300\"\n : \"cursor-pointer\";\n\n const classes = [baseStyles, stateStyles, disabledStyles, className]\n .filter(Boolean)\n .join(\" \");\n\n return (\n <div className=\"flex flex-col gap-1\">\n {label && (\n <label\n htmlFor={selectId}\n className=\"text-body-sm font-medium text-neutral-700\"\n >\n {label}\n </label>\n )}\n <select\n ref={ref}\n id={selectId}\n disabled={disabled}\n className={classes}\n aria-invalid={!!error}\n {...props}\n >\n {placeholder && (\n <option value=\"\" disabled>\n {placeholder}\n </option>\n )}\n {options.map((option) => (\n <option\n key={option.value}\n value={option.value}\n disabled={option.disabled}\n >\n {option.label}\n </option>\n ))}\n </select>\n {error && (\n <p className=\"text-body-sm text-error\">{error}</p>\n )}\n </div>\n );\n }\n);\n\nSelect.displayName = \"Select\";\n","import type { HTMLAttributes, TdHTMLAttributes, ThHTMLAttributes } from \"react\";\n\nexport interface TableProps extends HTMLAttributes<HTMLTableElement> {}\nexport interface TableHeaderProps extends HTMLAttributes<HTMLTableSectionElement> {}\nexport interface TableBodyProps extends HTMLAttributes<HTMLTableSectionElement> {}\nexport interface TableRowProps extends HTMLAttributes<HTMLTableRowElement> {}\nexport interface TableHeadProps extends ThHTMLAttributes<HTMLTableCellElement> {}\nexport interface TableCellProps extends TdHTMLAttributes<HTMLTableCellElement> {}\n\nexport function Table({ className = \"\", children, ...props }: TableProps) {\n return (\n <div className=\"w-full overflow-auto\">\n <table\n className={`w-full border-collapse text-body ${className}`}\n {...props}\n >\n {children}\n </table>\n </div>\n );\n}\n\nexport function TableHeader({ className = \"\", children, ...props }: TableHeaderProps) {\n return (\n <thead className={`bg-neutral-50 ${className}`} {...props}>\n {children}\n </thead>\n );\n}\n\nexport function TableBody({ className = \"\", children, ...props }: TableBodyProps) {\n return (\n <tbody className={`divide-y divide-neutral-200 ${className}`} {...props}>\n {children}\n </tbody>\n );\n}\n\nexport function TableRow({ className = \"\", children, ...props }: TableRowProps) {\n return (\n <tr\n className={`border-b border-neutral-200 hover:bg-neutral-50 transition-colors ${className}`}\n {...props}\n >\n {children}\n </tr>\n );\n}\n\nexport function TableHead({ className = \"\", children, ...props }: TableHeadProps) {\n return (\n <th\n className={`px-4 py-3 text-left text-body-sm font-semibold text-neutral-700 ${className}`}\n {...props}\n >\n {children}\n </th>\n );\n}\n\nexport function TableCell({ className = \"\", children, ...props }: TableCellProps) {\n return (\n <td\n className={`px-4 py-3 text-neutral-900 ${className}`}\n {...props}\n >\n {children}\n </td>\n );\n}\n","import {\n createContext,\n useContext,\n useState,\n type ReactNode,\n type HTMLAttributes,\n} from \"react\";\n\ninterface TabsContextValue {\n activeTab: string;\n setActiveTab: (value: string) => void;\n}\n\nconst TabsContext = createContext<TabsContextValue | null>(null);\n\nfunction useTabsContext() {\n const context = useContext(TabsContext);\n if (!context) {\n throw new Error(\"Tabs components must be used within a Tabs provider\");\n }\n return context;\n}\n\nexport interface TabsProps extends HTMLAttributes<HTMLDivElement> {\n /** Default active tab value */\n defaultValue: string;\n /** Controlled active tab value */\n value?: string;\n /** Callback when tab changes */\n onValueChange?: (value: string) => void;\n children: ReactNode;\n}\n\nexport interface TabsListProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n}\n\nexport interface TabsTriggerProps extends HTMLAttributes<HTMLButtonElement> {\n /** Value that identifies this tab */\n value: string;\n children: ReactNode;\n}\n\nexport interface TabsContentProps extends HTMLAttributes<HTMLDivElement> {\n /** Value that identifies this content */\n value: string;\n children: ReactNode;\n}\n\nexport function Tabs({\n defaultValue,\n value,\n onValueChange,\n children,\n className = \"\",\n ...props\n}: TabsProps) {\n const [internalValue, setInternalValue] = useState(defaultValue);\n const activeTab = value ?? internalValue;\n\n const setActiveTab = (newValue: string) => {\n if (!value) {\n setInternalValue(newValue);\n }\n onValueChange?.(newValue);\n };\n\n return (\n <TabsContext.Provider value={{ activeTab, setActiveTab }}>\n <div className={className} {...props}>\n {children}\n </div>\n </TabsContext.Provider>\n );\n}\n\nexport function TabsList({ children, className = \"\", ...props }: TabsListProps) {\n return (\n <div\n role=\"tablist\"\n className={`flex border-b border-neutral-200 ${className}`}\n {...props}\n >\n {children}\n </div>\n );\n}\n\nexport function TabsTrigger({\n value,\n children,\n className = \"\",\n ...props\n}: TabsTriggerProps) {\n const { activeTab, setActiveTab } = useTabsContext();\n const isActive = activeTab === value;\n\n const baseStyles = [\n \"px-4 py-2\",\n \"text-body font-medium\",\n \"border-b-2 -mb-px\",\n \"transition-colors duration-fast\",\n \"focus:outline-none focus-visible:shadow-focus\",\n ].join(\" \");\n\n const stateStyles = isActive\n ? \"border-primary-500 text-primary-600\"\n : \"border-transparent text-neutral-500 hover:text-neutral-700 hover:border-neutral-300\";\n\n return (\n <button\n role=\"tab\"\n aria-selected={isActive}\n onClick={() => setActiveTab(value)}\n className={`${baseStyles} ${stateStyles} ${className}`}\n {...props}\n >\n {children}\n </button>\n );\n}\n\nexport function TabsContent({\n value,\n children,\n className = \"\",\n ...props\n}: TabsContentProps) {\n const { activeTab } = useTabsContext();\n\n if (activeTab !== value) {\n return null;\n }\n\n return (\n <div role=\"tabpanel\" className={`py-4 ${className}`} {...props}>\n {children}\n </div>\n );\n}\n","import { forwardRef, type InputHTMLAttributes } from \"react\";\n\nexport interface ToggleProps extends Omit<InputHTMLAttributes<HTMLInputElement>, \"type\"> {\n /** Label text */\n label?: string;\n}\n\nexport const Toggle = forwardRef<HTMLInputElement, ToggleProps>(\n ({ label, disabled, checked, className = \"\", id, ...props }, ref) => {\n const toggleId = id || props.name;\n\n const trackStyles = [\n \"relative inline-flex\",\n \"w-10 h-6\",\n \"rounded-full\",\n \"transition-colors duration-fast\",\n \"cursor-pointer\",\n checked ? \"bg-primary-500\" : \"bg-neutral-300\",\n disabled ? \"opacity-50 cursor-not-allowed\" : \"\",\n ].join(\" \");\n\n const thumbStyles = [\n \"absolute top-1 left-1\",\n \"w-4 h-4\",\n \"bg-white rounded-full\",\n \"shadow-sm\",\n \"transition-transform duration-fast\",\n checked ? \"translate-x-4\" : \"translate-x-0\",\n ].join(\" \");\n\n return (\n <div className={`flex items-center gap-2 ${className}`}>\n <label htmlFor={toggleId} className={trackStyles}>\n <input\n ref={ref}\n type=\"checkbox\"\n role=\"switch\"\n id={toggleId}\n disabled={disabled}\n checked={checked}\n className=\"sr-only\"\n aria-checked={checked}\n {...props}\n />\n <span className={thumbStyles} />\n </label>\n {label && (\n <label\n htmlFor={toggleId}\n className={`text-body text-neutral-900 select-none ${\n disabled ? \"text-neutral-500 cursor-not-allowed\" : \"cursor-pointer\"\n }`}\n >\n {label}\n </label>\n )}\n </div>\n );\n }\n);\n\nToggle.displayName = \"Toggle\";\n","// Components\nexport * from \"./Alert\";\nexport * from \"./Avatar\";\nexport * from \"./Badge\";\nexport * from \"./Button\";\nexport * from \"./Card\";\nexport * from \"./Checkbox\";\nexport * from \"./Input\";\nexport * from \"./Progress\";\nexport * from \"./Select\";\nexport * from \"./Table\";\nexport * from \"./Tabs\";\nexport * from \"./Toggle\";\n\n// Re-export tokens for convenience\nexport * from \"@akanaka/tokens\";\n"],"mappings":";AAqCM,cAmCA,YAnCA;AAtBN,IAAM,gBAA2E;AAAA,EAC/E,MAAM;AAAA,IACJ,WAAW;AAAA,IACX,MAAM;AAAA,EACR;AAAA,EACA,SAAS;AAAA,IACP,WAAW;AAAA,IACX,MAAM;AAAA,EACR;AAAA,EACA,SAAS;AAAA,IACP,WAAW;AAAA,IACX,MAAM;AAAA,EACR;AAAA,EACA,OAAO;AAAA,IACL,WAAW;AAAA,IACX,MAAM;AAAA,EACR;AACF;AAEA,IAAM,QAAyC;AAAA,EAC7C,MACE,oBAAC,SAAI,WAAU,WAAU,MAAK,gBAAe,SAAQ,aACnD,8BAAC,UAAK,UAAS,WAAU,GAAE,oIAAmI,UAAS,WAAU,GACnL;AAAA,EAEF,SACE,oBAAC,SAAI,WAAU,WAAU,MAAK,gBAAe,SAAQ,aACnD,8BAAC,UAAK,UAAS,WAAU,GAAE,yIAAwI,UAAS,WAAU,GACxL;AAAA,EAEF,SACE,oBAAC,SAAI,WAAU,WAAU,MAAK,gBAAe,SAAQ,aACnD,8BAAC,UAAK,UAAS,WAAU,GAAE,qNAAoN,UAAS,WAAU,GACpQ;AAAA,EAEF,OACE,oBAAC,SAAI,WAAU,WAAU,MAAK,gBAAe,SAAQ,aACnD,8BAAC,UAAK,UAAS,WAAU,GAAE,2NAA0N,UAAS,WAAU,GAC1Q;AAEJ;AAEO,SAAS,MAAM;AAAA,EACpB,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ,GAAG;AACL,GAAe;AACb,QAAM,aAAa;AACnB,QAAM,SAAS,cAAc,OAAO;AACpC,QAAM,UAAU,CAAC,YAAY,OAAO,WAAW,SAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAElF,SACE,qBAAC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;AAAA;AAAA,MACH;AAAA,OAEJ;AAAA,EAEJ;AACF;AAEA,OAAO,cAAc;;;AC9CrB,cAAc;","names":["jsx","jsx","variantStyles","jsx","variantStyles","sizeStyles","jsx","variantStyles","forwardRef","jsx","jsxs","forwardRef","jsx","jsxs","jsx","jsxs","forwardRef","jsx","jsxs","jsx","jsx","forwardRef","jsx","jsxs"]}
package/package.json ADDED
@@ -0,0 +1,70 @@
1
+ {
2
+ "name": "@akanaka/components",
3
+ "version": "0.1.0",
4
+ "description": "React components for the design system",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js"
13
+ },
14
+ "./styles.css": "./dist/styles.css",
15
+ "./tailwind.config": "./tailwind.config.ts"
16
+ },
17
+ "files": [
18
+ "dist",
19
+ "tailwind.config.ts"
20
+ ],
21
+ "sideEffects": [
22
+ "*.css"
23
+ ],
24
+ "publishConfig": {
25
+ "access": "public"
26
+ },
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "https://github.com/YOUR_ORG/design-system.git",
30
+ "directory": "packages/components"
31
+ },
32
+ "license": "MIT",
33
+ "keywords": [
34
+ "react",
35
+ "components",
36
+ "design-system",
37
+ "tailwindcss"
38
+ ],
39
+ "dependencies": {
40
+ "@akanaka/tokens": "0.1.0"
41
+ },
42
+ "peerDependencies": {
43
+ "react": ">=18.0.0",
44
+ "react-dom": ">=18.0.0"
45
+ },
46
+ "devDependencies": {
47
+ "@testing-library/jest-dom": "^6.6.0",
48
+ "@testing-library/react": "^16.0.0",
49
+ "@testing-library/user-event": "^14.5.0",
50
+ "@types/react": "^18.3.0",
51
+ "@types/react-dom": "^18.3.0",
52
+ "autoprefixer": "^10.4.0",
53
+ "postcss": "^8.4.0",
54
+ "react": "^18.3.0",
55
+ "react-dom": "^18.3.0",
56
+ "tailwindcss": "^3.4.0",
57
+ "tsup": "^8.4.0",
58
+ "typescript": "^5.7.0",
59
+ "vitest": "^2.1.0",
60
+ "@vitejs/plugin-react": "^4.3.0",
61
+ "jsdom": "^25.0.0"
62
+ },
63
+ "scripts": {
64
+ "build": "tsup",
65
+ "dev": "tsup --watch",
66
+ "lint": "eslint src",
67
+ "test": "vitest run",
68
+ "test:watch": "vitest"
69
+ }
70
+ }
@@ -0,0 +1,75 @@
1
+ import type { Config } from "tailwindcss";
2
+
3
+ const config: Config = {
4
+ content: ["./src/**/*.{ts,tsx}"],
5
+ theme: {
6
+ extend: {
7
+ colors: {
8
+ primary: {
9
+ 50: "var(--color-primary-50)",
10
+ 100: "var(--color-primary-100)",
11
+ 200: "var(--color-primary-200)",
12
+ 500: "var(--color-primary-500)",
13
+ 600: "var(--color-primary-600)",
14
+ 700: "var(--color-primary-700)",
15
+ },
16
+ neutral: {
17
+ 50: "var(--color-neutral-50)",
18
+ 100: "var(--color-neutral-100)",
19
+ 200: "var(--color-neutral-200)",
20
+ 300: "var(--color-neutral-300)",
21
+ 500: "var(--color-neutral-500)",
22
+ 700: "var(--color-neutral-700)",
23
+ 900: "var(--color-neutral-900)",
24
+ },
25
+ success: "var(--color-success)",
26
+ warning: "var(--color-warning)",
27
+ error: "var(--color-error)",
28
+ info: "var(--color-info)",
29
+ },
30
+ fontFamily: {
31
+ sans: "var(--font-sans)",
32
+ mono: "var(--font-mono)",
33
+ },
34
+ fontSize: {
35
+ caption: "var(--font-size-caption)",
36
+ overline: "var(--font-size-overline)",
37
+ "body-sm": "var(--font-size-body-sm)",
38
+ body: "var(--font-size-body)",
39
+ h3: "var(--font-size-h3)",
40
+ h2: "var(--font-size-h2)",
41
+ h1: "var(--font-size-h1)",
42
+ display: "var(--font-size-display)",
43
+ },
44
+ spacing: {
45
+ 1: "var(--spacing-1)",
46
+ 2: "var(--spacing-2)",
47
+ 3: "var(--spacing-3)",
48
+ 4: "var(--spacing-4)",
49
+ 6: "var(--spacing-6)",
50
+ 8: "var(--spacing-8)",
51
+ 12: "var(--spacing-12)",
52
+ },
53
+ borderRadius: {
54
+ sm: "var(--radius-sm)",
55
+ md: "var(--radius-md)",
56
+ lg: "var(--radius-lg)",
57
+ full: "var(--radius-full)",
58
+ },
59
+ boxShadow: {
60
+ sm: "var(--shadow-sm)",
61
+ md: "var(--shadow-md)",
62
+ lg: "var(--shadow-lg)",
63
+ focus: "var(--shadow-focus)",
64
+ },
65
+ transitionDuration: {
66
+ fast: "150ms",
67
+ base: "200ms",
68
+ slow: "300ms",
69
+ },
70
+ },
71
+ },
72
+ plugins: [],
73
+ };
74
+
75
+ export default config;