@memelabui/ui 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.
@@ -0,0 +1,232 @@
1
+ import * as react from 'react';
2
+ import { ButtonHTMLAttributes, ReactNode, InputHTMLAttributes, SelectHTMLAttributes, TextareaHTMLAttributes, HTMLAttributes, ReactElement } from 'react';
3
+ import * as react_jsx_runtime from 'react/jsx-runtime';
4
+
5
+ type ClassValue = string | number | null | undefined | boolean | Record<string, boolean | null | undefined> | ClassValue[];
6
+ /**
7
+ * Tailwind/CSS-module friendly className composer.
8
+ * Similar to `clsx`, but tiny and dependency-free.
9
+ */
10
+ declare function cn(...values: ClassValue[]): string;
11
+
12
+ declare function getFocusableElements(container: HTMLElement): HTMLElement[];
13
+ declare function focusSafely(el: HTMLElement | null | undefined): void;
14
+
15
+ type Size = 'sm' | 'md' | 'lg';
16
+
17
+ type ButtonVariant = 'primary' | 'success' | 'warning' | 'danger' | 'secondary' | 'ghost';
18
+ type ButtonSize = 'sm' | 'md' | 'lg';
19
+ type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
20
+ variant?: ButtonVariant;
21
+ size?: ButtonSize;
22
+ leftIcon?: ReactNode;
23
+ rightIcon?: ReactNode;
24
+ loading?: boolean;
25
+ };
26
+ declare const Button: react.ForwardRefExoticComponent<ButtonHTMLAttributes<HTMLButtonElement> & {
27
+ variant?: ButtonVariant;
28
+ size?: ButtonSize;
29
+ leftIcon?: ReactNode;
30
+ rightIcon?: ReactNode;
31
+ loading?: boolean;
32
+ } & react.RefAttributes<HTMLButtonElement>>;
33
+
34
+ type IconButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'aria-label'> & {
35
+ icon: ReactNode;
36
+ variant?: 'primary' | 'success' | 'warning' | 'danger' | 'secondary' | 'ghost';
37
+ size?: 'sm' | 'md' | 'lg';
38
+ 'aria-label': string;
39
+ };
40
+ declare const IconButton: react.ForwardRefExoticComponent<Omit<ButtonHTMLAttributes<HTMLButtonElement>, "aria-label" | "children"> & {
41
+ icon: ReactNode;
42
+ variant?: "primary" | "success" | "warning" | "danger" | "secondary" | "ghost";
43
+ size?: "sm" | "md" | "lg";
44
+ 'aria-label': string;
45
+ } & react.RefAttributes<HTMLButtonElement>>;
46
+
47
+ type InputProps = InputHTMLAttributes<HTMLInputElement> & {
48
+ hasError?: boolean;
49
+ label?: string;
50
+ error?: string;
51
+ helperText?: string;
52
+ };
53
+ declare const Input: react.ForwardRefExoticComponent<InputHTMLAttributes<HTMLInputElement> & {
54
+ hasError?: boolean;
55
+ label?: string;
56
+ error?: string;
57
+ helperText?: string;
58
+ } & react.RefAttributes<HTMLInputElement>>;
59
+
60
+ type SelectProps = SelectHTMLAttributes<HTMLSelectElement> & {
61
+ hasError?: boolean;
62
+ label?: string;
63
+ error?: string;
64
+ };
65
+ declare const Select: react.ForwardRefExoticComponent<SelectHTMLAttributes<HTMLSelectElement> & {
66
+ hasError?: boolean;
67
+ label?: string;
68
+ error?: string;
69
+ } & react.RefAttributes<HTMLSelectElement>>;
70
+
71
+ type TextareaProps = TextareaHTMLAttributes<HTMLTextAreaElement> & {
72
+ hasError?: boolean;
73
+ label?: string;
74
+ error?: string;
75
+ };
76
+ declare const Textarea: react.ForwardRefExoticComponent<TextareaHTMLAttributes<HTMLTextAreaElement> & {
77
+ hasError?: boolean;
78
+ label?: string;
79
+ error?: string;
80
+ } & react.RefAttributes<HTMLTextAreaElement>>;
81
+
82
+ type BadgeVariant = 'neutral' | 'primary' | 'success' | 'successSolid' | 'warning' | 'danger' | 'dangerSolid' | 'accent';
83
+ type BadgeSize = 'sm' | 'md';
84
+ type BadgeProps = Omit<HTMLAttributes<HTMLSpanElement>, 'children'> & {
85
+ children: ReactNode;
86
+ variant?: BadgeVariant;
87
+ size?: BadgeSize;
88
+ };
89
+ declare const Badge: react.ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLSpanElement>, "children"> & {
90
+ children: ReactNode;
91
+ variant?: BadgeVariant;
92
+ size?: BadgeSize;
93
+ } & react.RefAttributes<HTMLSpanElement>>;
94
+ /** Backward-compatible alias */
95
+ declare const Pill: react.ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLSpanElement>, "children"> & {
96
+ children: ReactNode;
97
+ variant?: BadgeVariant;
98
+ size?: BadgeSize;
99
+ } & react.RefAttributes<HTMLSpanElement>>;
100
+
101
+ type ToggleSize = 'sm' | 'md';
102
+ type ToggleProps = {
103
+ checked: boolean;
104
+ onChange: (checked: boolean) => void;
105
+ disabled?: boolean;
106
+ label?: string;
107
+ size?: ToggleSize;
108
+ 'aria-label'?: string;
109
+ };
110
+ declare function Toggle({ checked, onChange, disabled, label, size, 'aria-label': ariaLabel }: ToggleProps): react_jsx_runtime.JSX.Element;
111
+
112
+ type SpinnerSize = 'sm' | 'md' | 'lg';
113
+ type SpinnerProps = {
114
+ className?: string;
115
+ size?: SpinnerSize;
116
+ };
117
+ declare function Spinner({ className, size }: SpinnerProps): react_jsx_runtime.JSX.Element;
118
+
119
+ type SkeletonProps = {
120
+ className?: string;
121
+ circle?: boolean;
122
+ };
123
+ declare function Skeleton({ className, circle }: SkeletonProps): react_jsx_runtime.JSX.Element;
124
+
125
+ type CardVariant = 'surface' | 'glass';
126
+ type CardProps = HTMLAttributes<HTMLDivElement> & {
127
+ hoverable?: boolean;
128
+ variant?: CardVariant;
129
+ children: ReactNode;
130
+ };
131
+ declare function Card({ hoverable, variant, className, ...props }: CardProps): react_jsx_runtime.JSX.Element;
132
+
133
+ type ModalProps = {
134
+ isOpen: boolean;
135
+ onClose: () => void;
136
+ children: ReactNode;
137
+ ariaLabel?: string;
138
+ ariaLabelledBy?: string;
139
+ closeOnBackdrop?: boolean;
140
+ closeOnEsc?: boolean;
141
+ useGlass?: boolean;
142
+ overlayClassName?: string;
143
+ contentClassName?: string;
144
+ zIndexClassName?: string;
145
+ };
146
+ declare function Modal({ isOpen, onClose, children, ariaLabel, ariaLabelledBy, closeOnBackdrop, closeOnEsc, useGlass, overlayClassName, contentClassName, zIndexClassName, }: ModalProps): react_jsx_runtime.JSX.Element | null;
147
+
148
+ type ConfirmDialogVariant = 'danger' | 'warning' | 'primary';
149
+ type ConfirmDialogProps = {
150
+ isOpen: boolean;
151
+ onClose: () => void;
152
+ onConfirm: () => void;
153
+ title: string;
154
+ message: string | ReactNode;
155
+ confirmText?: string;
156
+ cancelText?: string;
157
+ loadingText?: string;
158
+ variant?: ConfirmDialogVariant;
159
+ isLoading?: boolean;
160
+ };
161
+ declare function ConfirmDialog({ isOpen, onClose, onConfirm, title, message, confirmText, cancelText, loadingText, variant, isLoading, }: ConfirmDialogProps): react_jsx_runtime.JSX.Element;
162
+
163
+ type TooltipPlacement = 'top' | 'bottom';
164
+ type TooltipProps = {
165
+ content: ReactNode;
166
+ delayMs?: number;
167
+ placement?: TooltipPlacement;
168
+ className?: string;
169
+ children: ReactElement;
170
+ };
171
+ declare function Tooltip({ content, delayMs, placement, className, children }: TooltipProps): react_jsx_runtime.JSX.Element;
172
+
173
+ type EmptyStateProps = {
174
+ icon?: (props: {
175
+ className?: string;
176
+ }) => JSX.Element;
177
+ title: string;
178
+ description?: string;
179
+ actionLabel?: string;
180
+ onAction?: () => void;
181
+ children?: ReactNode;
182
+ className?: string;
183
+ };
184
+ declare function EmptyState({ icon: Icon, title, description, actionLabel, onAction, children, className }: EmptyStateProps): react_jsx_runtime.JSX.Element;
185
+
186
+ type CollapsibleSectionProps = {
187
+ title: string;
188
+ defaultOpen?: boolean;
189
+ children: ReactNode;
190
+ right?: ReactNode;
191
+ className?: string;
192
+ };
193
+ declare function CollapsibleSection({ title, defaultOpen, children, right, className }: CollapsibleSectionProps): react_jsx_runtime.JSX.Element;
194
+
195
+ type PageShellVariant = 'plain' | 'glass' | 'minimal';
196
+ type PageShellProps = {
197
+ header?: ReactNode;
198
+ background?: ReactNode;
199
+ variant?: PageShellVariant;
200
+ children: ReactNode;
201
+ className?: string;
202
+ mainClassName?: string;
203
+ containerClassName?: string;
204
+ maxWidth?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'full';
205
+ };
206
+ declare function PageShell({ header, background, variant, className, mainClassName, containerClassName, maxWidth, children, }: PageShellProps): react_jsx_runtime.JSX.Element;
207
+
208
+ type NavbarProps = {
209
+ logo?: ReactNode;
210
+ children?: ReactNode;
211
+ className?: string;
212
+ glass?: boolean;
213
+ };
214
+ declare function Navbar({ logo, children, className, glass }: NavbarProps): react_jsx_runtime.JSX.Element;
215
+
216
+ type SidebarProps = {
217
+ children: ReactNode;
218
+ collapsed?: boolean;
219
+ onToggle?: () => void;
220
+ className?: string;
221
+ };
222
+ declare function Sidebar({ children, collapsed, onToggle, className }: SidebarProps): react_jsx_runtime.JSX.Element;
223
+
224
+ type DashboardLayoutProps = {
225
+ children: ReactNode;
226
+ navbar?: ReactNode;
227
+ sidebar?: ReactNode;
228
+ className?: string;
229
+ };
230
+ declare function DashboardLayout({ children, navbar, sidebar, className }: DashboardLayoutProps): react_jsx_runtime.JSX.Element;
231
+
232
+ export { Badge, type BadgeProps, type BadgeSize, type BadgeVariant, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, type CardProps, type CardVariant, CollapsibleSection, type CollapsibleSectionProps, ConfirmDialog, type ConfirmDialogProps, type ConfirmDialogVariant, DashboardLayout, type DashboardLayoutProps, EmptyState, type EmptyStateProps, IconButton, type IconButtonProps, Input, type InputProps, Modal, type ModalProps, Navbar, type NavbarProps, PageShell, type PageShellProps, type PageShellVariant, Pill, Select, type SelectProps, Sidebar, type SidebarProps, type Size, Skeleton, type SkeletonProps, Spinner, type SpinnerProps, type SpinnerSize, Textarea, type TextareaProps, Toggle, type ToggleProps, type ToggleSize, Tooltip, type TooltipProps, cn, focusSafely, getFocusableElements };
@@ -0,0 +1,232 @@
1
+ import * as react from 'react';
2
+ import { ButtonHTMLAttributes, ReactNode, InputHTMLAttributes, SelectHTMLAttributes, TextareaHTMLAttributes, HTMLAttributes, ReactElement } from 'react';
3
+ import * as react_jsx_runtime from 'react/jsx-runtime';
4
+
5
+ type ClassValue = string | number | null | undefined | boolean | Record<string, boolean | null | undefined> | ClassValue[];
6
+ /**
7
+ * Tailwind/CSS-module friendly className composer.
8
+ * Similar to `clsx`, but tiny and dependency-free.
9
+ */
10
+ declare function cn(...values: ClassValue[]): string;
11
+
12
+ declare function getFocusableElements(container: HTMLElement): HTMLElement[];
13
+ declare function focusSafely(el: HTMLElement | null | undefined): void;
14
+
15
+ type Size = 'sm' | 'md' | 'lg';
16
+
17
+ type ButtonVariant = 'primary' | 'success' | 'warning' | 'danger' | 'secondary' | 'ghost';
18
+ type ButtonSize = 'sm' | 'md' | 'lg';
19
+ type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
20
+ variant?: ButtonVariant;
21
+ size?: ButtonSize;
22
+ leftIcon?: ReactNode;
23
+ rightIcon?: ReactNode;
24
+ loading?: boolean;
25
+ };
26
+ declare const Button: react.ForwardRefExoticComponent<ButtonHTMLAttributes<HTMLButtonElement> & {
27
+ variant?: ButtonVariant;
28
+ size?: ButtonSize;
29
+ leftIcon?: ReactNode;
30
+ rightIcon?: ReactNode;
31
+ loading?: boolean;
32
+ } & react.RefAttributes<HTMLButtonElement>>;
33
+
34
+ type IconButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'aria-label'> & {
35
+ icon: ReactNode;
36
+ variant?: 'primary' | 'success' | 'warning' | 'danger' | 'secondary' | 'ghost';
37
+ size?: 'sm' | 'md' | 'lg';
38
+ 'aria-label': string;
39
+ };
40
+ declare const IconButton: react.ForwardRefExoticComponent<Omit<ButtonHTMLAttributes<HTMLButtonElement>, "aria-label" | "children"> & {
41
+ icon: ReactNode;
42
+ variant?: "primary" | "success" | "warning" | "danger" | "secondary" | "ghost";
43
+ size?: "sm" | "md" | "lg";
44
+ 'aria-label': string;
45
+ } & react.RefAttributes<HTMLButtonElement>>;
46
+
47
+ type InputProps = InputHTMLAttributes<HTMLInputElement> & {
48
+ hasError?: boolean;
49
+ label?: string;
50
+ error?: string;
51
+ helperText?: string;
52
+ };
53
+ declare const Input: react.ForwardRefExoticComponent<InputHTMLAttributes<HTMLInputElement> & {
54
+ hasError?: boolean;
55
+ label?: string;
56
+ error?: string;
57
+ helperText?: string;
58
+ } & react.RefAttributes<HTMLInputElement>>;
59
+
60
+ type SelectProps = SelectHTMLAttributes<HTMLSelectElement> & {
61
+ hasError?: boolean;
62
+ label?: string;
63
+ error?: string;
64
+ };
65
+ declare const Select: react.ForwardRefExoticComponent<SelectHTMLAttributes<HTMLSelectElement> & {
66
+ hasError?: boolean;
67
+ label?: string;
68
+ error?: string;
69
+ } & react.RefAttributes<HTMLSelectElement>>;
70
+
71
+ type TextareaProps = TextareaHTMLAttributes<HTMLTextAreaElement> & {
72
+ hasError?: boolean;
73
+ label?: string;
74
+ error?: string;
75
+ };
76
+ declare const Textarea: react.ForwardRefExoticComponent<TextareaHTMLAttributes<HTMLTextAreaElement> & {
77
+ hasError?: boolean;
78
+ label?: string;
79
+ error?: string;
80
+ } & react.RefAttributes<HTMLTextAreaElement>>;
81
+
82
+ type BadgeVariant = 'neutral' | 'primary' | 'success' | 'successSolid' | 'warning' | 'danger' | 'dangerSolid' | 'accent';
83
+ type BadgeSize = 'sm' | 'md';
84
+ type BadgeProps = Omit<HTMLAttributes<HTMLSpanElement>, 'children'> & {
85
+ children: ReactNode;
86
+ variant?: BadgeVariant;
87
+ size?: BadgeSize;
88
+ };
89
+ declare const Badge: react.ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLSpanElement>, "children"> & {
90
+ children: ReactNode;
91
+ variant?: BadgeVariant;
92
+ size?: BadgeSize;
93
+ } & react.RefAttributes<HTMLSpanElement>>;
94
+ /** Backward-compatible alias */
95
+ declare const Pill: react.ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLSpanElement>, "children"> & {
96
+ children: ReactNode;
97
+ variant?: BadgeVariant;
98
+ size?: BadgeSize;
99
+ } & react.RefAttributes<HTMLSpanElement>>;
100
+
101
+ type ToggleSize = 'sm' | 'md';
102
+ type ToggleProps = {
103
+ checked: boolean;
104
+ onChange: (checked: boolean) => void;
105
+ disabled?: boolean;
106
+ label?: string;
107
+ size?: ToggleSize;
108
+ 'aria-label'?: string;
109
+ };
110
+ declare function Toggle({ checked, onChange, disabled, label, size, 'aria-label': ariaLabel }: ToggleProps): react_jsx_runtime.JSX.Element;
111
+
112
+ type SpinnerSize = 'sm' | 'md' | 'lg';
113
+ type SpinnerProps = {
114
+ className?: string;
115
+ size?: SpinnerSize;
116
+ };
117
+ declare function Spinner({ className, size }: SpinnerProps): react_jsx_runtime.JSX.Element;
118
+
119
+ type SkeletonProps = {
120
+ className?: string;
121
+ circle?: boolean;
122
+ };
123
+ declare function Skeleton({ className, circle }: SkeletonProps): react_jsx_runtime.JSX.Element;
124
+
125
+ type CardVariant = 'surface' | 'glass';
126
+ type CardProps = HTMLAttributes<HTMLDivElement> & {
127
+ hoverable?: boolean;
128
+ variant?: CardVariant;
129
+ children: ReactNode;
130
+ };
131
+ declare function Card({ hoverable, variant, className, ...props }: CardProps): react_jsx_runtime.JSX.Element;
132
+
133
+ type ModalProps = {
134
+ isOpen: boolean;
135
+ onClose: () => void;
136
+ children: ReactNode;
137
+ ariaLabel?: string;
138
+ ariaLabelledBy?: string;
139
+ closeOnBackdrop?: boolean;
140
+ closeOnEsc?: boolean;
141
+ useGlass?: boolean;
142
+ overlayClassName?: string;
143
+ contentClassName?: string;
144
+ zIndexClassName?: string;
145
+ };
146
+ declare function Modal({ isOpen, onClose, children, ariaLabel, ariaLabelledBy, closeOnBackdrop, closeOnEsc, useGlass, overlayClassName, contentClassName, zIndexClassName, }: ModalProps): react_jsx_runtime.JSX.Element | null;
147
+
148
+ type ConfirmDialogVariant = 'danger' | 'warning' | 'primary';
149
+ type ConfirmDialogProps = {
150
+ isOpen: boolean;
151
+ onClose: () => void;
152
+ onConfirm: () => void;
153
+ title: string;
154
+ message: string | ReactNode;
155
+ confirmText?: string;
156
+ cancelText?: string;
157
+ loadingText?: string;
158
+ variant?: ConfirmDialogVariant;
159
+ isLoading?: boolean;
160
+ };
161
+ declare function ConfirmDialog({ isOpen, onClose, onConfirm, title, message, confirmText, cancelText, loadingText, variant, isLoading, }: ConfirmDialogProps): react_jsx_runtime.JSX.Element;
162
+
163
+ type TooltipPlacement = 'top' | 'bottom';
164
+ type TooltipProps = {
165
+ content: ReactNode;
166
+ delayMs?: number;
167
+ placement?: TooltipPlacement;
168
+ className?: string;
169
+ children: ReactElement;
170
+ };
171
+ declare function Tooltip({ content, delayMs, placement, className, children }: TooltipProps): react_jsx_runtime.JSX.Element;
172
+
173
+ type EmptyStateProps = {
174
+ icon?: (props: {
175
+ className?: string;
176
+ }) => JSX.Element;
177
+ title: string;
178
+ description?: string;
179
+ actionLabel?: string;
180
+ onAction?: () => void;
181
+ children?: ReactNode;
182
+ className?: string;
183
+ };
184
+ declare function EmptyState({ icon: Icon, title, description, actionLabel, onAction, children, className }: EmptyStateProps): react_jsx_runtime.JSX.Element;
185
+
186
+ type CollapsibleSectionProps = {
187
+ title: string;
188
+ defaultOpen?: boolean;
189
+ children: ReactNode;
190
+ right?: ReactNode;
191
+ className?: string;
192
+ };
193
+ declare function CollapsibleSection({ title, defaultOpen, children, right, className }: CollapsibleSectionProps): react_jsx_runtime.JSX.Element;
194
+
195
+ type PageShellVariant = 'plain' | 'glass' | 'minimal';
196
+ type PageShellProps = {
197
+ header?: ReactNode;
198
+ background?: ReactNode;
199
+ variant?: PageShellVariant;
200
+ children: ReactNode;
201
+ className?: string;
202
+ mainClassName?: string;
203
+ containerClassName?: string;
204
+ maxWidth?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'full';
205
+ };
206
+ declare function PageShell({ header, background, variant, className, mainClassName, containerClassName, maxWidth, children, }: PageShellProps): react_jsx_runtime.JSX.Element;
207
+
208
+ type NavbarProps = {
209
+ logo?: ReactNode;
210
+ children?: ReactNode;
211
+ className?: string;
212
+ glass?: boolean;
213
+ };
214
+ declare function Navbar({ logo, children, className, glass }: NavbarProps): react_jsx_runtime.JSX.Element;
215
+
216
+ type SidebarProps = {
217
+ children: ReactNode;
218
+ collapsed?: boolean;
219
+ onToggle?: () => void;
220
+ className?: string;
221
+ };
222
+ declare function Sidebar({ children, collapsed, onToggle, className }: SidebarProps): react_jsx_runtime.JSX.Element;
223
+
224
+ type DashboardLayoutProps = {
225
+ children: ReactNode;
226
+ navbar?: ReactNode;
227
+ sidebar?: ReactNode;
228
+ className?: string;
229
+ };
230
+ declare function DashboardLayout({ children, navbar, sidebar, className }: DashboardLayoutProps): react_jsx_runtime.JSX.Element;
231
+
232
+ export { Badge, type BadgeProps, type BadgeSize, type BadgeVariant, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, type CardProps, type CardVariant, CollapsibleSection, type CollapsibleSectionProps, ConfirmDialog, type ConfirmDialogProps, type ConfirmDialogVariant, DashboardLayout, type DashboardLayoutProps, EmptyState, type EmptyStateProps, IconButton, type IconButtonProps, Input, type InputProps, Modal, type ModalProps, Navbar, type NavbarProps, PageShell, type PageShellProps, type PageShellVariant, Pill, Select, type SelectProps, Sidebar, type SidebarProps, type Size, Skeleton, type SkeletonProps, Spinner, type SpinnerProps, type SpinnerSize, Textarea, type TextareaProps, Toggle, type ToggleProps, type ToggleSize, Tooltip, type TooltipProps, cn, focusSafely, getFocusableElements };