marclayui 0.0.0-stage → 0.3.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/README.md +50 -3
- package/dist/index.cjs +1551 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.mts +394 -0
- package/dist/index.d.ts +394 -0
- package/dist/index.js +1483 -0
- package/dist/index.js.map +1 -0
- package/dist/theme-init.cjs +31 -0
- package/dist/theme-init.cjs.map +1 -0
- package/dist/theme-init.d.mts +8 -0
- package/dist/theme-init.d.ts +8 -0
- package/dist/theme-init.js +6 -0
- package/dist/theme-init.js.map +1 -0
- package/package.json +71 -4
- package/src/components/accordion/accordion.css +66 -0
- package/src/components/accordion/accordion.tsx +86 -0
- package/src/components/alert/alert.css +86 -0
- package/src/components/alert/alert.tsx +45 -0
- package/src/components/avatar/avatar.css +75 -0
- package/src/components/avatar/avatar.tsx +59 -0
- package/src/components/badge/badge.css +106 -0
- package/src/components/badge/badge.tsx +26 -0
- package/src/components/button/button.css +118 -0
- package/src/components/button/button.tsx +86 -0
- package/src/components/card/card.css +41 -0
- package/src/components/card/card.tsx +26 -0
- package/src/components/checks/checks.css +157 -0
- package/src/components/checks/checks.tsx +167 -0
- package/src/components/divider/divider.css +41 -0
- package/src/components/divider/divider.tsx +24 -0
- package/src/components/dropdown/dropdown.css +182 -0
- package/src/components/dropdown/dropdown.tsx +268 -0
- package/src/components/input/input.css +73 -0
- package/src/components/input/input.tsx +85 -0
- package/src/components/kbd/kbd.css +66 -0
- package/src/components/kbd/kbd.tsx +14 -0
- package/src/components/modal/modal.css +93 -0
- package/src/components/modal/modal.tsx +114 -0
- package/src/components/navbar/navbar.css +127 -0
- package/src/components/navbar/navbar.tsx +64 -0
- package/src/components/progress/progress.css +62 -0
- package/src/components/progress/progress.tsx +50 -0
- package/src/components/range/range.css +68 -0
- package/src/components/range/range.tsx +60 -0
- package/src/components/select/select.css +58 -0
- package/src/components/select/select.tsx +72 -0
- package/src/components/skeleton/skeleton.css +43 -0
- package/src/components/skeleton/skeleton.tsx +35 -0
- package/src/components/spinner/spinner.css +21 -0
- package/src/components/spinner/spinner.tsx +10 -0
- package/src/components/stack/stack.css +60 -0
- package/src/components/stack/stack.tsx +34 -0
- package/src/components/stat/stat.css +54 -0
- package/src/components/stat/stat.tsx +19 -0
- package/src/components/tabs/tabs.css +58 -0
- package/src/components/tabs/tabs.tsx +84 -0
- package/src/components/toast/toast.css +94 -0
- package/src/components/toast/toast.tsx +100 -0
- package/src/components/tooltip/tooltip.css +100 -0
- package/src/components/tooltip/tooltip.tsx +19 -0
- package/src/index.ts +115 -0
- package/src/styles/base.css +78 -0
- package/src/styles/index.css +27 -0
- package/src/styles/theme.css +246 -0
- package/src/theme-init.ts +6 -0
- package/src/theming/ThemeMenu.tsx +158 -0
- package/src/theming/ThemeProvider.tsx +234 -0
- package/src/theming/ThemeToggle.tsx +27 -0
- package/src/theming/presets.ts +33 -0
- package/src/theming/theming.css +155 -0
- package/src/utils/color.ts +58 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
/** Built-in style presets. Each preset defines its own light AND dark palette
|
|
4
|
+
* (see styles/theme.css); switching a preset swaps both at once. */
|
|
5
|
+
type PresetName = "clay" | "neo";
|
|
6
|
+
interface PresetInfo {
|
|
7
|
+
id: PresetName;
|
|
8
|
+
label: string;
|
|
9
|
+
description: string;
|
|
10
|
+
}
|
|
11
|
+
declare const PRESETS: PresetInfo[];
|
|
12
|
+
/** Quick primary-color swatches used by ThemeMenu and the docs playground. */
|
|
13
|
+
declare const COLOR_SWATCHES: Array<{
|
|
14
|
+
name: string;
|
|
15
|
+
color: string;
|
|
16
|
+
}>;
|
|
17
|
+
|
|
18
|
+
type ThemeMode = "light" | "dark";
|
|
19
|
+
type ModePreference = ThemeMode | "system";
|
|
20
|
+
/** Colors you can override at runtime, like Bootstrap's SCSS variables but live. */
|
|
21
|
+
interface ColorOverrides {
|
|
22
|
+
primary?: string;
|
|
23
|
+
secondary?: string;
|
|
24
|
+
accent?: string;
|
|
25
|
+
success?: string;
|
|
26
|
+
danger?: string;
|
|
27
|
+
warning?: string;
|
|
28
|
+
info?: string;
|
|
29
|
+
bg?: string;
|
|
30
|
+
ink?: string;
|
|
31
|
+
muted?: string;
|
|
32
|
+
}
|
|
33
|
+
interface ThemeContextValue {
|
|
34
|
+
/** Resolved mode after applying "system". */
|
|
35
|
+
mode: ThemeMode;
|
|
36
|
+
/** What the user asked for: "light" | "dark" | "system". */
|
|
37
|
+
preference: ModePreference;
|
|
38
|
+
setPreference: (p: ModePreference) => void;
|
|
39
|
+
toggle: () => void;
|
|
40
|
+
/** Active style preset — swaps the whole light+dark palette pair. */
|
|
41
|
+
preset: PresetName;
|
|
42
|
+
setPreset: (p: PresetName) => void;
|
|
43
|
+
colors: ColorOverrides;
|
|
44
|
+
setColors: (c: ColorOverrides) => void;
|
|
45
|
+
resetColors: () => void;
|
|
46
|
+
}
|
|
47
|
+
/** Tip: import { themeInitScript } from "marclayui/theme-init" — it lives in its own
|
|
48
|
+
* Server-Component-safe module and the main bundle is marked "use client". */
|
|
49
|
+
interface MarclayProviderProps {
|
|
50
|
+
children: React.ReactNode;
|
|
51
|
+
/** "system" follows the OS preference; persisted to localStorage. */
|
|
52
|
+
defaultMode?: ModePreference;
|
|
53
|
+
/** Style preset: "clay" (claymorphism) or "neo" (neumorphism). Persisted. */
|
|
54
|
+
preset?: PresetName;
|
|
55
|
+
/** Optional initial color overrides (react-bootstrap-style runtime theming). */
|
|
56
|
+
colors?: ColorOverrides;
|
|
57
|
+
}
|
|
58
|
+
declare function MarclayProvider({ children, defaultMode, preset: initialPreset, colors: initialColors, }: MarclayProviderProps): React.JSX.Element;
|
|
59
|
+
declare function useTheme(): ThemeContextValue;
|
|
60
|
+
/** Backwards-friendly alias. */
|
|
61
|
+
declare const ThemeProvider: typeof MarclayProvider;
|
|
62
|
+
|
|
63
|
+
interface ThemeToggleProps {
|
|
64
|
+
className?: string;
|
|
65
|
+
}
|
|
66
|
+
/** Raised clay pill that flips light/dark. Uses useTheme, so it must sit inside <MarclayProvider>. */
|
|
67
|
+
declare function ThemeToggle({ className }: ThemeToggleProps): React.JSX.Element;
|
|
68
|
+
|
|
69
|
+
interface ThemeMenuProps {
|
|
70
|
+
className?: string;
|
|
71
|
+
}
|
|
72
|
+
/** Navbar theme button that opens a customization panel: mode, style preset
|
|
73
|
+
* and primary color swatches. Closes on Escape or outside click. */
|
|
74
|
+
declare function ThemeMenu({ className }: ThemeMenuProps): React.JSX.Element;
|
|
75
|
+
|
|
76
|
+
type ButtonVariant = "primary" | "secondary" | "accent" | "soft" | "ghost" | "danger";
|
|
77
|
+
type ButtonSize = "sm" | "md" | "lg";
|
|
78
|
+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
79
|
+
variant?: ButtonVariant;
|
|
80
|
+
size?: ButtonSize;
|
|
81
|
+
/** Shows a spinner and blocks interaction. */
|
|
82
|
+
loading?: boolean;
|
|
83
|
+
/** Stretch to fill the container width. */
|
|
84
|
+
block?: boolean;
|
|
85
|
+
/** Renders an anchor with button styling — use with Next `<Link>` styling or plain routes. */
|
|
86
|
+
href?: string;
|
|
87
|
+
}
|
|
88
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLAnchorElement & HTMLButtonElement>>;
|
|
89
|
+
interface ButtonGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
90
|
+
children: React.ReactNode;
|
|
91
|
+
}
|
|
92
|
+
/** Segmented control: renders children Buttons as flat segments inside an
|
|
93
|
+
* inset clay well — the active variant keeps its gradient. */
|
|
94
|
+
declare function ButtonGroup({ children, className, ...rest }: ButtonGroupProps): React.JSX.Element;
|
|
95
|
+
|
|
96
|
+
interface KbdProps extends React.HTMLAttributes<HTMLElement> {
|
|
97
|
+
children: React.ReactNode;
|
|
98
|
+
}
|
|
99
|
+
/** Small keyboard key cap — inset clay well with a pressed bottom edge. */
|
|
100
|
+
declare function Kbd({ children, className, ...rest }: KbdProps): React.JSX.Element;
|
|
101
|
+
|
|
102
|
+
interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
103
|
+
/** Lifts on hover — nice for clickable cards. */
|
|
104
|
+
hover?: boolean;
|
|
105
|
+
}
|
|
106
|
+
declare function Card({ hover, className, ...rest }: CardProps): React.JSX.Element;
|
|
107
|
+
declare function CardHeader({ className, ...rest }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
108
|
+
declare function CardTitle({ className, ...rest }: React.HTMLAttributes<HTMLHeadingElement>): React.JSX.Element;
|
|
109
|
+
declare function CardBody({ className, ...rest }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
110
|
+
declare function CardFooter({ className, ...rest }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
111
|
+
|
|
112
|
+
type FieldSize = "sm" | "md" | "lg";
|
|
113
|
+
interface FieldChrome {
|
|
114
|
+
label?: React.ReactNode;
|
|
115
|
+
hint?: React.ReactNode;
|
|
116
|
+
error?: string;
|
|
117
|
+
size?: FieldSize;
|
|
118
|
+
block?: boolean;
|
|
119
|
+
}
|
|
120
|
+
interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size">, FieldChrome {
|
|
121
|
+
}
|
|
122
|
+
declare function Input({ label, hint, error, size, block, className, id, ...rest }: InputProps): React.JSX.Element;
|
|
123
|
+
interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement>, FieldChrome {
|
|
124
|
+
}
|
|
125
|
+
declare function Textarea({ label, hint, error, size, block, className, id, rows, ...rest }: TextareaProps): React.JSX.Element;
|
|
126
|
+
|
|
127
|
+
interface SelectOption {
|
|
128
|
+
value: string;
|
|
129
|
+
label: string;
|
|
130
|
+
}
|
|
131
|
+
interface SelectProps extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, "size"> {
|
|
132
|
+
label?: React.ReactNode;
|
|
133
|
+
hint?: React.ReactNode;
|
|
134
|
+
error?: string;
|
|
135
|
+
size?: "sm" | "md" | "lg";
|
|
136
|
+
/** Convenience over children: [{ value, label }] */
|
|
137
|
+
options?: SelectOption[];
|
|
138
|
+
placeholder?: string;
|
|
139
|
+
}
|
|
140
|
+
declare function Select({ label, hint, error, size, options, placeholder, className, id, children, ...rest }: SelectProps): React.JSX.Element;
|
|
141
|
+
|
|
142
|
+
interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "type"> {
|
|
143
|
+
label?: React.ReactNode;
|
|
144
|
+
/** Shows a dash instead of a tick — the classic "some children selected" state. */
|
|
145
|
+
indeterminate?: boolean;
|
|
146
|
+
}
|
|
147
|
+
declare function Checkbox({ label, indeterminate, className, ...rest }: CheckboxProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
|
|
148
|
+
interface CheckboxGroupOption {
|
|
149
|
+
value: string;
|
|
150
|
+
label: React.ReactNode;
|
|
151
|
+
disabled?: boolean;
|
|
152
|
+
}
|
|
153
|
+
interface CheckboxGroupProps {
|
|
154
|
+
options: CheckboxGroupOption[];
|
|
155
|
+
/** Controlled selected values. */
|
|
156
|
+
value?: string[];
|
|
157
|
+
/** Uncontrolled initial selection. */
|
|
158
|
+
defaultValue?: string[];
|
|
159
|
+
onChange?: (values: string[]) => void;
|
|
160
|
+
/** Renders a parent "select all" checkbox with an indeterminate state. */
|
|
161
|
+
selectAll?: boolean;
|
|
162
|
+
selectAllLabel?: React.ReactNode;
|
|
163
|
+
label?: React.ReactNode;
|
|
164
|
+
disabled?: boolean;
|
|
165
|
+
className?: string;
|
|
166
|
+
}
|
|
167
|
+
declare function CheckboxGroup({ options, value, defaultValue, onChange, selectAll, selectAllLabel, label, disabled, className, }: CheckboxGroupProps): React.JSX.Element;
|
|
168
|
+
interface RadioProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
169
|
+
label?: React.ReactNode;
|
|
170
|
+
}
|
|
171
|
+
declare function Radio({ label, className, ...rest }: RadioProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
|
|
172
|
+
interface SwitchProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
173
|
+
label?: React.ReactNode;
|
|
174
|
+
}
|
|
175
|
+
declare function Switch({ label, className, ...rest }: SwitchProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
|
|
176
|
+
|
|
177
|
+
interface DropdownItem {
|
|
178
|
+
value: string;
|
|
179
|
+
label: React.ReactNode;
|
|
180
|
+
disabled?: boolean;
|
|
181
|
+
}
|
|
182
|
+
interface DropdownProps {
|
|
183
|
+
items: DropdownItem[];
|
|
184
|
+
/** Controlled selected value (single) or values (multiple). */
|
|
185
|
+
value?: string | string[];
|
|
186
|
+
/** Uncontrolled initial selection. */
|
|
187
|
+
defaultValue?: string | string[];
|
|
188
|
+
onChange?: (value: string | string[]) => void;
|
|
189
|
+
/** Allow several selections — the menu shows checkboxes. */
|
|
190
|
+
multiple?: boolean;
|
|
191
|
+
placeholder?: string;
|
|
192
|
+
label?: React.ReactNode;
|
|
193
|
+
hint?: React.ReactNode;
|
|
194
|
+
size?: "sm" | "md" | "lg";
|
|
195
|
+
/** Stretch trigger and menu to full width. */
|
|
196
|
+
block?: boolean;
|
|
197
|
+
disabled?: boolean;
|
|
198
|
+
className?: string;
|
|
199
|
+
}
|
|
200
|
+
/** Custom dropdown menu — renders its own popup listbox (no native browser
|
|
201
|
+
* option menu), with full keyboard support: open with Enter/Space/ArrowDown,
|
|
202
|
+
* navigate with the arrows, select with Enter/Space, close with Escape. */
|
|
203
|
+
declare function Dropdown({ items, value, defaultValue, onChange, multiple, placeholder, label, hint, size, block, disabled, className, }: DropdownProps): React.JSX.Element;
|
|
204
|
+
|
|
205
|
+
interface RangeProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "type"> {
|
|
206
|
+
label?: React.ReactNode;
|
|
207
|
+
/** Helper text under the slider. */
|
|
208
|
+
hint?: React.ReactNode;
|
|
209
|
+
/** Shows the current value on the right of the label. Works with both
|
|
210
|
+
* controlled `value` and uncontrolled `defaultValue`. */
|
|
211
|
+
showValue?: boolean;
|
|
212
|
+
}
|
|
213
|
+
declare function Range({ label, hint, showValue, value, defaultValue, onChange, className, id, ...rest }: RangeProps): React.JSX.Element;
|
|
214
|
+
|
|
215
|
+
type BadgeVariant = "primary" | "secondary" | "accent" | "success" | "danger" | "warning" | "info" | "neutral";
|
|
216
|
+
interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
217
|
+
variant?: BadgeVariant;
|
|
218
|
+
/** Solid = filled clay gradient; soft (default) = inset well with colored text. */
|
|
219
|
+
solid?: boolean;
|
|
220
|
+
}
|
|
221
|
+
declare function Badge({ variant, solid, className, ...rest }: BadgeProps): React.JSX.Element;
|
|
222
|
+
|
|
223
|
+
type AlertVariant = "success" | "danger" | "warning" | "info";
|
|
224
|
+
interface AlertProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
|
|
225
|
+
variant?: AlertVariant;
|
|
226
|
+
title?: React.ReactNode;
|
|
227
|
+
/** Overrides the variant's default glyph. */
|
|
228
|
+
icon?: React.ReactNode;
|
|
229
|
+
onClose?: () => void;
|
|
230
|
+
}
|
|
231
|
+
declare function Alert({ variant, title, icon, onClose, className, children, ...rest }: AlertProps): React.JSX.Element;
|
|
232
|
+
|
|
233
|
+
type AvatarSize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
234
|
+
type AvatarStatus = "online" | "offline" | "busy";
|
|
235
|
+
interface AvatarProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
236
|
+
src?: string;
|
|
237
|
+
alt?: string;
|
|
238
|
+
/** Used to derive initials when no src is given. */
|
|
239
|
+
name?: string;
|
|
240
|
+
size?: AvatarSize;
|
|
241
|
+
status?: AvatarStatus;
|
|
242
|
+
/** Filled clay gradient look. */
|
|
243
|
+
gradient?: boolean;
|
|
244
|
+
}
|
|
245
|
+
declare function Avatar({ src, alt, name, size, status, gradient, className, children, ...rest }: AvatarProps): React.JSX.Element;
|
|
246
|
+
type AvatarGroupProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
247
|
+
declare function AvatarGroup({ className, children, ...rest }: AvatarGroupProps): React.JSX.Element;
|
|
248
|
+
|
|
249
|
+
type ProgressTone = "primary" | "secondary" | "accent" | "danger";
|
|
250
|
+
interface ProgressProps {
|
|
251
|
+
value?: number;
|
|
252
|
+
max?: number;
|
|
253
|
+
/** "indeterminate" animates a sliding chunk. */
|
|
254
|
+
tone?: ProgressTone;
|
|
255
|
+
size?: "sm" | "md" | "lg";
|
|
256
|
+
label?: React.ReactNode;
|
|
257
|
+
showValue?: boolean;
|
|
258
|
+
indeterminate?: boolean;
|
|
259
|
+
className?: string;
|
|
260
|
+
}
|
|
261
|
+
declare function Progress({ value, max, tone, size, label, showValue, indeterminate, className, }: ProgressProps): React.JSX.Element;
|
|
262
|
+
|
|
263
|
+
interface SpinnerProps {
|
|
264
|
+
size?: "sm" | "md" | "lg";
|
|
265
|
+
className?: string;
|
|
266
|
+
}
|
|
267
|
+
declare function Spinner({ size, className }: SpinnerProps): React.JSX.Element;
|
|
268
|
+
|
|
269
|
+
interface SkeletonProps {
|
|
270
|
+
variant?: "text" | "circle" | "rect";
|
|
271
|
+
width?: number | string;
|
|
272
|
+
height?: number | string;
|
|
273
|
+
/** Render several text lines; the last one is shorter, like real copy. */
|
|
274
|
+
count?: number;
|
|
275
|
+
className?: string;
|
|
276
|
+
}
|
|
277
|
+
declare function Skeleton({ variant, width, height, count, className }: SkeletonProps): React.JSX.Element;
|
|
278
|
+
|
|
279
|
+
interface ModalProps {
|
|
280
|
+
open: boolean;
|
|
281
|
+
onClose: () => void;
|
|
282
|
+
title?: React.ReactNode;
|
|
283
|
+
footer?: React.ReactNode;
|
|
284
|
+
size?: "sm" | "md" | "lg";
|
|
285
|
+
closeOnBackdrop?: boolean;
|
|
286
|
+
closeOnEsc?: boolean;
|
|
287
|
+
children: React.ReactNode;
|
|
288
|
+
className?: string;
|
|
289
|
+
}
|
|
290
|
+
declare function Modal({ open, onClose, title, footer, size, closeOnBackdrop, closeOnEsc, children, className, }: ModalProps): React.ReactPortal | null;
|
|
291
|
+
|
|
292
|
+
type TooltipPlacement = "top" | "bottom" | "left" | "right";
|
|
293
|
+
interface TooltipProps {
|
|
294
|
+
label: string;
|
|
295
|
+
placement?: TooltipPlacement;
|
|
296
|
+
className?: string;
|
|
297
|
+
children: React.ReactNode;
|
|
298
|
+
}
|
|
299
|
+
/** CSS-only tooltip: shows on hover and when the wrapped control has keyboard focus. */
|
|
300
|
+
declare function Tooltip({ label, placement, className, children }: TooltipProps): React.JSX.Element;
|
|
301
|
+
|
|
302
|
+
interface TabItem {
|
|
303
|
+
key: string;
|
|
304
|
+
label: React.ReactNode;
|
|
305
|
+
content: React.ReactNode;
|
|
306
|
+
disabled?: boolean;
|
|
307
|
+
}
|
|
308
|
+
interface TabsProps {
|
|
309
|
+
items: TabItem[];
|
|
310
|
+
/** Controlled active index. */
|
|
311
|
+
value?: number;
|
|
312
|
+
onChange?: (index: number) => void;
|
|
313
|
+
className?: string;
|
|
314
|
+
}
|
|
315
|
+
declare function Tabs({ items, value, onChange, className }: TabsProps): React.JSX.Element;
|
|
316
|
+
|
|
317
|
+
interface AccordionEntry {
|
|
318
|
+
title: React.ReactNode;
|
|
319
|
+
content: React.ReactNode;
|
|
320
|
+
}
|
|
321
|
+
interface AccordionProps {
|
|
322
|
+
items: AccordionEntry[];
|
|
323
|
+
/** Index opened initially. */
|
|
324
|
+
defaultOpen?: number;
|
|
325
|
+
/** When false, several panels can stay open at once. */
|
|
326
|
+
exclusive?: boolean;
|
|
327
|
+
className?: string;
|
|
328
|
+
}
|
|
329
|
+
declare function Accordion({ items, defaultOpen, exclusive, className }: AccordionProps): React.JSX.Element;
|
|
330
|
+
|
|
331
|
+
type ToastVariant = "info" | "success" | "danger" | "warning";
|
|
332
|
+
interface ToastOptions {
|
|
333
|
+
title?: React.ReactNode;
|
|
334
|
+
message?: React.ReactNode;
|
|
335
|
+
variant?: ToastVariant;
|
|
336
|
+
/** ms before auto-dismiss; 0 keeps it until closed manually. */
|
|
337
|
+
duration?: number;
|
|
338
|
+
}
|
|
339
|
+
interface ToastContextValue {
|
|
340
|
+
toast: (t: ToastOptions) => void;
|
|
341
|
+
dismiss: (id: number) => void;
|
|
342
|
+
}
|
|
343
|
+
type ToastPlacement = "top-right" | "top-center" | "bottom-right" | "bottom-left";
|
|
344
|
+
interface ToastProviderProps {
|
|
345
|
+
children: React.ReactNode;
|
|
346
|
+
placement?: ToastPlacement;
|
|
347
|
+
}
|
|
348
|
+
declare function ToastProvider({ children, placement }: ToastProviderProps): React.JSX.Element;
|
|
349
|
+
declare function useToast(): ToastContextValue;
|
|
350
|
+
|
|
351
|
+
interface NavLinkItem {
|
|
352
|
+
href: string;
|
|
353
|
+
label: React.ReactNode;
|
|
354
|
+
}
|
|
355
|
+
interface NavbarProps {
|
|
356
|
+
brand?: React.ReactNode;
|
|
357
|
+
links?: NavLinkItem[];
|
|
358
|
+
/** Href to highlight as active (matches a link's href). */
|
|
359
|
+
activeHref?: string;
|
|
360
|
+
/** Right-side slot: theme toggle, actions, etc. */
|
|
361
|
+
right?: React.ReactNode;
|
|
362
|
+
sticky?: boolean;
|
|
363
|
+
className?: string;
|
|
364
|
+
}
|
|
365
|
+
/** Clay pill navbar — framework-agnostic (plain <a> links, works everywhere). */
|
|
366
|
+
declare function Navbar({ brand, links, activeHref, right, sticky, className }: NavbarProps): React.JSX.Element;
|
|
367
|
+
|
|
368
|
+
type StatTone = "primary" | "secondary" | "accent" | "danger" | "info";
|
|
369
|
+
interface StatProps {
|
|
370
|
+
value: React.ReactNode;
|
|
371
|
+
label?: React.ReactNode;
|
|
372
|
+
tone?: StatTone;
|
|
373
|
+
className?: string;
|
|
374
|
+
}
|
|
375
|
+
declare function Stat({ value, label, tone, className }: StatProps): React.JSX.Element;
|
|
376
|
+
|
|
377
|
+
interface DividerProps extends React.HTMLAttributes<HTMLElement> {
|
|
378
|
+
orientation?: "horizontal" | "vertical";
|
|
379
|
+
/** Renders an inset line — text — inset line. */
|
|
380
|
+
label?: React.ReactNode;
|
|
381
|
+
}
|
|
382
|
+
declare function Divider({ orientation, label, className, ...rest }: DividerProps): React.JSX.Element;
|
|
383
|
+
|
|
384
|
+
type StackGap = "none" | "xs" | "sm" | "md" | "lg" | "xl";
|
|
385
|
+
interface StackProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
386
|
+
direction?: "row" | "column";
|
|
387
|
+
gap?: StackGap;
|
|
388
|
+
wrap?: boolean;
|
|
389
|
+
align?: "start" | "center" | "end" | "stretch" | "baseline";
|
|
390
|
+
justify?: "start" | "center" | "end" | "between" | "around";
|
|
391
|
+
}
|
|
392
|
+
declare function Stack({ direction, gap, wrap, align, justify, className, ...rest }: StackProps): React.JSX.Element;
|
|
393
|
+
|
|
394
|
+
export { Accordion, type AccordionEntry, type AccordionProps, Alert, type AlertProps, type AlertVariant, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, type AvatarSize, type AvatarStatus, Badge, type BadgeProps, type BadgeVariant, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, type ButtonSize, type ButtonVariant, COLOR_SWATCHES, Card, CardBody, CardFooter, CardHeader, type CardProps, CardTitle, Checkbox, CheckboxGroup, type CheckboxGroupOption, type CheckboxGroupProps, type CheckboxProps, type ColorOverrides, Divider, type DividerProps, Dropdown, type DropdownItem, type DropdownProps, type FieldSize, Input, type InputProps, Kbd, type KbdProps, MarclayProvider, type MarclayProviderProps, Modal, type ModalProps, type ModePreference, type NavLinkItem, Navbar, type NavbarProps, PRESETS, type PresetInfo, type PresetName, Progress, type ProgressProps, type ProgressTone, Radio, type RadioProps, Range, type RangeProps, Select, type SelectOption, type SelectProps, Skeleton, type SkeletonProps, Spinner, type SpinnerProps, Stack, type StackGap, type StackProps, Stat, type StatProps, type StatTone, Switch, type SwitchProps, type TabItem, Tabs, type TabsProps, Textarea, type TextareaProps, ThemeMenu, type ThemeMenuProps, type ThemeMode, ThemeProvider, ThemeToggle, type ThemeToggleProps, type ToastOptions, type ToastPlacement, ToastProvider, type ToastProviderProps, type ToastVariant, Tooltip, type TooltipPlacement, type TooltipProps, useTheme, useToast };
|