@akanaka-design/components 0.6.2

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,191 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as react from 'react';
3
+ import { HTMLAttributes, ReactNode, ImgHTMLAttributes, ButtonHTMLAttributes, InputHTMLAttributes, LabelHTMLAttributes, ComponentPropsWithoutRef, TdHTMLAttributes, ThHTMLAttributes } from 'react';
4
+ import * as SelectPrimitive from '@radix-ui/react-select';
5
+ export * from '@akanaka-design/tokens';
6
+
7
+ type AlertVariant = "info" | "success" | "warning" | "error";
8
+ interface AlertProps extends HTMLAttributes<HTMLDivElement> {
9
+ /** Visual style variant */
10
+ variant?: AlertVariant;
11
+ /** Alert title */
12
+ title?: string;
13
+ /** Alert content */
14
+ children: ReactNode;
15
+ /** Dismiss handler */
16
+ onDismiss?: () => void;
17
+ }
18
+ declare function Alert({ variant, title, children, onDismiss, className, ...props }: AlertProps): react_jsx_runtime.JSX.Element;
19
+
20
+ type AvatarSize = "sm" | "md" | "lg" | "xl";
21
+ interface AvatarProps extends Omit<ImgHTMLAttributes<HTMLImageElement>, "size"> {
22
+ /** Size of the avatar */
23
+ size?: AvatarSize;
24
+ /** Fallback initials when no image */
25
+ initials?: string;
26
+ /** Image source */
27
+ src?: string;
28
+ /** Alt text */
29
+ alt?: string;
30
+ }
31
+ declare function Avatar({ size, initials, src, alt, className, ...props }: AvatarProps): react_jsx_runtime.JSX.Element;
32
+
33
+ type BadgeVariant = "default" | "primary" | "success" | "warning" | "error" | "info";
34
+ interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
35
+ /** Visual style variant */
36
+ variant?: BadgeVariant;
37
+ /** Badge content */
38
+ children: ReactNode;
39
+ }
40
+ declare function Badge({ variant, children, className, ...props }: BadgeProps): react_jsx_runtime.JSX.Element;
41
+
42
+ type ButtonVariant = "primary" | "secondary" | "ghost" | "danger" | "default" | "outline" | "destructive" | "link";
43
+ type ButtonSize = "sm" | "md" | "lg";
44
+ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
45
+ /** Visual style variant */
46
+ variant?: ButtonVariant;
47
+ /** Size of the button */
48
+ size?: ButtonSize;
49
+ /** Full width button */
50
+ fullWidth?: boolean;
51
+ }
52
+ declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
53
+
54
+ type CardVariant = "elevated" | "flat";
55
+ interface CardProps extends HTMLAttributes<HTMLDivElement> {
56
+ variant?: CardVariant;
57
+ children: ReactNode;
58
+ }
59
+ interface CardSectionProps extends HTMLAttributes<HTMLDivElement> {
60
+ children: ReactNode;
61
+ }
62
+ declare function Card({ variant, children, className, ...props }: CardProps): react_jsx_runtime.JSX.Element;
63
+ declare function CardHeader({ children, className, ...props }: CardSectionProps): react_jsx_runtime.JSX.Element;
64
+ declare function CardTitle({ children, className, ...props }: CardSectionProps): react_jsx_runtime.JSX.Element;
65
+ declare function CardDescription({ children, className, ...props }: CardSectionProps): react_jsx_runtime.JSX.Element;
66
+ declare function CardContent({ children, className, ...props }: CardSectionProps): react_jsx_runtime.JSX.Element;
67
+ /** @deprecated Use CardContent instead */
68
+ declare const CardBody: typeof CardContent;
69
+ declare function CardFooter({ children, className, ...props }: CardSectionProps): react_jsx_runtime.JSX.Element;
70
+
71
+ type StatCardAccent = "primary" | "secondary" | "success" | "warning" | "destructive";
72
+ interface StatCardProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
73
+ /** Metric label (muted, 13px) */
74
+ label: string;
75
+ /** Primary metric value */
76
+ value: ReactNode;
77
+ /** Top accent bar color */
78
+ accent?: StatCardAccent;
79
+ }
80
+ declare function StatCard({ label, value, accent, className, ...props }: StatCardProps): react_jsx_runtime.JSX.Element;
81
+
82
+ interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type"> {
83
+ /** Label text */
84
+ label?: string;
85
+ }
86
+ declare const Checkbox: react.ForwardRefExoticComponent<CheckboxProps & react.RefAttributes<HTMLInputElement>>;
87
+
88
+ type InputSize = "sm" | "md" | "lg";
89
+ interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size"> {
90
+ /** Size of the input */
91
+ size?: InputSize;
92
+ /** Error message to display */
93
+ error?: string;
94
+ /** Label text */
95
+ label?: string;
96
+ /** Helper text below input */
97
+ helperText?: string;
98
+ }
99
+ declare const Input: react.ForwardRefExoticComponent<InputProps & react.RefAttributes<HTMLInputElement>>;
100
+
101
+ type LabelSize = "sm" | "md" | "lg";
102
+ interface LabelProps extends LabelHTMLAttributes<HTMLLabelElement> {
103
+ /** Size of the label */
104
+ size?: LabelSize;
105
+ /** Show error styling (red text) */
106
+ error?: boolean;
107
+ /** Show required indicator (red asterisk) */
108
+ required?: boolean;
109
+ }
110
+ declare const Label: react.ForwardRefExoticComponent<LabelProps & react.RefAttributes<HTMLLabelElement>>;
111
+
112
+ interface ProgressProps extends HTMLAttributes<HTMLDivElement> {
113
+ /** Current value (0-100) */
114
+ value: number;
115
+ /** Maximum value */
116
+ max?: number;
117
+ /** Show percentage label */
118
+ showLabel?: boolean;
119
+ }
120
+ declare function Progress({ value, max, showLabel, className, ...props }: ProgressProps): react_jsx_runtime.JSX.Element;
121
+
122
+ type SelectProps = ComponentPropsWithoutRef<typeof SelectPrimitive.Root> & {
123
+ /** Shown when no value is selected; also used by default `SelectTrigger` + `SelectValue` */
124
+ placeholder?: string;
125
+ };
126
+ declare function Select({ placeholder, children, ...props }: SelectProps): react_jsx_runtime.JSX.Element;
127
+ type SelectTriggerProps = ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>;
128
+ declare const SelectTrigger: react.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & react.RefAttributes<HTMLButtonElement>, "ref"> & react.RefAttributes<HTMLButtonElement>>;
129
+ type SelectValueProps = ComponentPropsWithoutRef<typeof SelectPrimitive.Value>;
130
+ declare const SelectValue: react.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectValueProps & react.RefAttributes<HTMLSpanElement>, "ref"> & react.RefAttributes<HTMLSpanElement>>;
131
+ type SelectContentProps = ComponentPropsWithoutRef<typeof SelectPrimitive.Content>;
132
+ declare const SelectContent: react.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
133
+ type SelectItemProps = ComponentPropsWithoutRef<typeof SelectPrimitive.Item>;
134
+ declare const SelectItem: react.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
135
+
136
+ type TableHeaderVariant = "default" | "primary" | "secondary" | "muted";
137
+ interface TableProps extends HTMLAttributes<HTMLTableElement> {
138
+ }
139
+ interface TableHeaderProps extends HTMLAttributes<HTMLTableSectionElement> {
140
+ /** Header background and automatic header cell text color */
141
+ variant?: TableHeaderVariant;
142
+ }
143
+ interface TableBodyProps extends HTMLAttributes<HTMLTableSectionElement> {
144
+ }
145
+ interface TableRowProps extends HTMLAttributes<HTMLTableRowElement> {
146
+ }
147
+ interface TableHeadProps extends ThHTMLAttributes<HTMLTableCellElement> {
148
+ }
149
+ interface TableCellProps extends TdHTMLAttributes<HTMLTableCellElement> {
150
+ }
151
+ declare function Table({ className, children, ...props }: TableProps): react_jsx_runtime.JSX.Element;
152
+ declare function TableHeader({ className, children, variant, ...props }: TableHeaderProps): react_jsx_runtime.JSX.Element;
153
+ declare function TableBody({ className, children, ...props }: TableBodyProps): react_jsx_runtime.JSX.Element;
154
+ declare function TableRow({ className, children, ...props }: TableRowProps): react_jsx_runtime.JSX.Element;
155
+ declare function TableHead({ className, children, ...props }: TableHeadProps): react_jsx_runtime.JSX.Element;
156
+ declare function TableCell({ className, children, ...props }: TableCellProps): react_jsx_runtime.JSX.Element;
157
+
158
+ interface TabsProps extends HTMLAttributes<HTMLDivElement> {
159
+ /** Default active tab value */
160
+ defaultValue: string;
161
+ /** Controlled active tab value */
162
+ value?: string;
163
+ /** Callback when tab changes */
164
+ onValueChange?: (value: string) => void;
165
+ children: ReactNode;
166
+ }
167
+ interface TabsListProps extends HTMLAttributes<HTMLDivElement> {
168
+ children: ReactNode;
169
+ }
170
+ interface TabsTriggerProps extends HTMLAttributes<HTMLButtonElement> {
171
+ /** Value that identifies this tab */
172
+ value: string;
173
+ children: ReactNode;
174
+ }
175
+ interface TabsContentProps extends HTMLAttributes<HTMLDivElement> {
176
+ /** Value that identifies this content */
177
+ value: string;
178
+ children: ReactNode;
179
+ }
180
+ declare function Tabs({ defaultValue, value, onValueChange, children, className, ...props }: TabsProps): react_jsx_runtime.JSX.Element;
181
+ declare function TabsList({ children, className, ...props }: TabsListProps): react_jsx_runtime.JSX.Element;
182
+ declare function TabsTrigger({ value, children, className, ...props }: TabsTriggerProps): react_jsx_runtime.JSX.Element;
183
+ declare function TabsContent({ value, children, className, ...props }: TabsContentProps): react_jsx_runtime.JSX.Element | null;
184
+
185
+ interface ToggleProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type"> {
186
+ /** Label text */
187
+ label?: string;
188
+ }
189
+ declare const Toggle: react.ForwardRefExoticComponent<ToggleProps & react.RefAttributes<HTMLInputElement>>;
190
+
191
+ 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, CardContent, CardDescription, CardFooter, CardHeader, type CardProps, type CardSectionProps, CardTitle, type CardVariant, Checkbox, type CheckboxProps, Input, type InputProps, type InputSize, Label, type LabelProps, type LabelSize, Progress, type ProgressProps, Select, SelectContent, type SelectContentProps, SelectItem, type SelectItemProps, type SelectProps, SelectTrigger, type SelectTriggerProps, SelectValue, type SelectValueProps, StatCard, type StatCardAccent, type StatCardProps, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableHead, type TableHeadProps, TableHeader, type TableHeaderProps, type TableHeaderVariant, type TableProps, TableRow, type TableRowProps, Tabs, TabsContent, type TabsContentProps, TabsList, type TabsListProps, type TabsProps, TabsTrigger, type TabsTriggerProps, Toggle, type ToggleProps };