klun-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.
- package/LICENSE +21 -0
- package/README.md +106 -0
- package/dist/charts/index.cjs +160 -0
- package/dist/charts/index.cjs.map +1 -0
- package/dist/charts/index.d.cts +89 -0
- package/dist/charts/index.d.ts +89 -0
- package/dist/charts/index.js +154 -0
- package/dist/charts/index.js.map +1 -0
- package/dist/chunk-FTYQRXS5.cjs +10152 -0
- package/dist/chunk-FTYQRXS5.cjs.map +1 -0
- package/dist/chunk-T225J6LV.js +13 -0
- package/dist/chunk-T225J6LV.js.map +1 -0
- package/dist/chunk-TPGAXYFU.cjs +15 -0
- package/dist/chunk-TPGAXYFU.cjs.map +1 -0
- package/dist/chunk-XDAR7UMF.js +10009 -0
- package/dist/chunk-XDAR7UMF.js.map +1 -0
- package/dist/fonts/DMMono-Light.ttf +0 -0
- package/dist/fonts/DMMono-Medium.ttf +0 -0
- package/dist/fonts/DMMono-Regular.ttf +0 -0
- package/dist/fonts/InterDisplay-Bold.woff2 +0 -0
- package/dist/fonts/InterDisplay-Medium.woff2 +0 -0
- package/dist/fonts/InterDisplay-Regular.woff2 +0 -0
- package/dist/fonts/InterDisplay-SemiBold.woff2 +0 -0
- package/dist/fonts/InterVariable-Italic.woff2 +0 -0
- package/dist/fonts/InterVariable.woff2 +0 -0
- package/dist/index.cjs +581 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +2701 -0
- package/dist/index.d.ts +2701 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +9137 -0
- package/dist/templates/index.cjs +1132 -0
- package/dist/templates/index.cjs.map +1 -0
- package/dist/templates/index.d.cts +43 -0
- package/dist/templates/index.d.ts +43 -0
- package/dist/templates/index.js +1120 -0
- package/dist/templates/index.js.map +1 -0
- package/package.json +95 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,2701 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ButtonHTMLAttributes, ReactNode, HTMLAttributes, CSSProperties, TimeHTMLAttributes, InputHTMLAttributes, LabelHTMLAttributes, SelectHTMLAttributes, FormHTMLAttributes, ReactElement, ChangeEvent, TextareaHTMLAttributes, ElementType } from 'react';
|
|
3
|
+
|
|
4
|
+
type ClassValue = string | number | false | null | undefined;
|
|
5
|
+
/** Tiny classnames joiner — filters falsy values and joins with a space. */
|
|
6
|
+
declare function cx(...args: ClassValue[]): string;
|
|
7
|
+
|
|
8
|
+
type MoneyPeriod = "month" | "quarter" | "half" | "year";
|
|
9
|
+
interface MoneyOptions {
|
|
10
|
+
currency?: string;
|
|
11
|
+
/** When true, `amount` is in minor units (cents): 1250 → $12.50. */
|
|
12
|
+
cents?: boolean;
|
|
13
|
+
locale?: string;
|
|
14
|
+
minimumFractionDigits?: number;
|
|
15
|
+
maximumFractionDigits?: number;
|
|
16
|
+
period?: MoneyPeriod;
|
|
17
|
+
periodLabels?: Partial<Record<MoneyPeriod, string>>;
|
|
18
|
+
signDisplay?: "auto" | "never" | "always" | "exceptZero";
|
|
19
|
+
}
|
|
20
|
+
interface MoneyResult {
|
|
21
|
+
text: string;
|
|
22
|
+
value: number;
|
|
23
|
+
period: string | null;
|
|
24
|
+
}
|
|
25
|
+
interface SizeOptions {
|
|
26
|
+
si?: boolean;
|
|
27
|
+
locale?: string;
|
|
28
|
+
digits?: number;
|
|
29
|
+
}
|
|
30
|
+
interface PctOptions {
|
|
31
|
+
digits?: number;
|
|
32
|
+
fraction?: boolean;
|
|
33
|
+
locale?: string;
|
|
34
|
+
signDisplay?: "auto" | "never" | "always" | "exceptZero";
|
|
35
|
+
}
|
|
36
|
+
interface RelTimeOptions {
|
|
37
|
+
locale?: string;
|
|
38
|
+
now?: number;
|
|
39
|
+
numeric?: "always" | "auto";
|
|
40
|
+
}
|
|
41
|
+
interface CountdownResult {
|
|
42
|
+
expired: boolean;
|
|
43
|
+
total: number;
|
|
44
|
+
days: number;
|
|
45
|
+
hours: number;
|
|
46
|
+
minutes: number;
|
|
47
|
+
seconds: number;
|
|
48
|
+
}
|
|
49
|
+
type DateInput = Date | number | string;
|
|
50
|
+
interface FormatApi {
|
|
51
|
+
setLocale(locale: string): void;
|
|
52
|
+
getLocale(locale?: string): string;
|
|
53
|
+
money(amount: number, opts?: MoneyOptions): MoneyResult;
|
|
54
|
+
number(n: number, opts?: Intl.NumberFormatOptions & {
|
|
55
|
+
locale?: string;
|
|
56
|
+
}): string;
|
|
57
|
+
humanSize(bytes: number, opts?: SizeOptions): string;
|
|
58
|
+
humanBps(bps: number, opts?: SizeOptions): string;
|
|
59
|
+
pct(n: number, opts?: PctOptions): string;
|
|
60
|
+
relTime(date: DateInput, opts?: RelTimeOptions): string;
|
|
61
|
+
absTime(date: DateInput, opts?: Intl.DateTimeFormatOptions & {
|
|
62
|
+
locale?: string;
|
|
63
|
+
}): string;
|
|
64
|
+
countdown(target: DateInput, opts?: {
|
|
65
|
+
now?: number;
|
|
66
|
+
}): CountdownResult;
|
|
67
|
+
}
|
|
68
|
+
/** Locale-aware formatting utilities. See individual method docs. */
|
|
69
|
+
declare const Format: FormatApi;
|
|
70
|
+
|
|
71
|
+
/** Which visual family the button belongs to. */
|
|
72
|
+
type ButtonKind = "default" | "fancy" | "compact" | "link";
|
|
73
|
+
type ButtonVariant = "primary" | "neutral" | "error";
|
|
74
|
+
type ButtonAppearance = "filled" | "stroke" | "lighter" | "ghost";
|
|
75
|
+
type ButtonSize = "xsmall" | "small" | "medium" | "large";
|
|
76
|
+
type FancyButtonVariant = "accent" | "dark" | "feature" | "glass";
|
|
77
|
+
type FancyButtonSize = "small" | "medium" | "large";
|
|
78
|
+
type CompactButtonAppearance = "stroke" | "ghost" | "white" | "filled";
|
|
79
|
+
type CompactButtonSize = "small" | "medium";
|
|
80
|
+
type LinkButtonVariant = "gray" | "primary" | "error";
|
|
81
|
+
type LinkButtonSize = "small" | "medium";
|
|
82
|
+
interface CommonButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "type"> {
|
|
83
|
+
/** Native button type. Default `"button"`. */
|
|
84
|
+
type?: "button" | "submit" | "reset";
|
|
85
|
+
/** Show a spinner, hide icons and make the button non-interactive. */
|
|
86
|
+
loading?: boolean;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* The standard button — a labelled action, or a square icon-only control via
|
|
90
|
+
* `iconOnly`. Pick a `variant` (color intent), an `appearance` (surface) and a
|
|
91
|
+
* `size`.
|
|
92
|
+
*/
|
|
93
|
+
interface DefaultButtonProps extends CommonButtonProps {
|
|
94
|
+
kind?: "default";
|
|
95
|
+
/** Color intent. Default `"primary"`. */
|
|
96
|
+
variant?: ButtonVariant;
|
|
97
|
+
/** Surface style. Default `"filled"`. */
|
|
98
|
+
appearance?: ButtonAppearance;
|
|
99
|
+
/** Default `"medium"`. */
|
|
100
|
+
size?: ButtonSize;
|
|
101
|
+
/** Icon node before the label. */
|
|
102
|
+
leadingIcon?: ReactNode;
|
|
103
|
+
/** Icon node after the label. */
|
|
104
|
+
trailingIcon?: ReactNode;
|
|
105
|
+
/** Render as a square icon-only button. */
|
|
106
|
+
iconOnly?: boolean;
|
|
107
|
+
/** Icon node for `iconOnly` (falls back to `leadingIcon`, then `children`). */
|
|
108
|
+
icon?: ReactNode;
|
|
109
|
+
/** Stretch to the full width of the container. */
|
|
110
|
+
fullWidth?: boolean;
|
|
111
|
+
}
|
|
112
|
+
/** Elevated, sheened CTA — for hero / marketing actions. */
|
|
113
|
+
interface FancyButtonProps extends CommonButtonProps {
|
|
114
|
+
kind: "fancy";
|
|
115
|
+
/** Visual treatment. Default `"accent"`. */
|
|
116
|
+
variant?: FancyButtonVariant;
|
|
117
|
+
/** Default `"medium"`. */
|
|
118
|
+
size?: FancyButtonSize;
|
|
119
|
+
leadingIcon?: ReactNode;
|
|
120
|
+
trailingIcon?: ReactNode;
|
|
121
|
+
fullWidth?: boolean;
|
|
122
|
+
}
|
|
123
|
+
/** Small square/full-radius icon-or-text control for dense toolbars. */
|
|
124
|
+
interface CompactButtonProps extends CommonButtonProps {
|
|
125
|
+
kind: "compact";
|
|
126
|
+
/** Surface style. Default `"stroke"`. */
|
|
127
|
+
appearance?: CompactButtonAppearance;
|
|
128
|
+
/** Default `"medium"`. */
|
|
129
|
+
size?: CompactButtonSize;
|
|
130
|
+
/** Use a pill radius instead of the default small radius. */
|
|
131
|
+
fullRadius?: boolean;
|
|
132
|
+
/** Icon node (compact is icon-first). */
|
|
133
|
+
icon?: ReactNode;
|
|
134
|
+
}
|
|
135
|
+
/** Text-only link styled as an inline action. */
|
|
136
|
+
interface LinkButtonProps extends CommonButtonProps {
|
|
137
|
+
kind: "link";
|
|
138
|
+
/** Color intent. Default `"gray"`. */
|
|
139
|
+
variant?: LinkButtonVariant;
|
|
140
|
+
/** Default `"medium"`. */
|
|
141
|
+
size?: LinkButtonSize;
|
|
142
|
+
/** Underline the label. */
|
|
143
|
+
underline?: boolean;
|
|
144
|
+
leadingIcon?: ReactNode;
|
|
145
|
+
trailingIcon?: ReactNode;
|
|
146
|
+
}
|
|
147
|
+
type ButtonProps = DefaultButtonProps | FancyButtonProps | CompactButtonProps | LinkButtonProps;
|
|
148
|
+
/**
|
|
149
|
+
* Button — the single action control for the whole button family. The `kind`
|
|
150
|
+
* prop selects the visual family and which other props apply:
|
|
151
|
+
*
|
|
152
|
+
* - `kind="default"` (omit): standard button. `variant` × `appearance` × `size`;
|
|
153
|
+
* set `iconOnly` for a square icon button.
|
|
154
|
+
* - `kind="fancy"`: elevated sheened CTA. `variant` = accent | dark | feature | glass.
|
|
155
|
+
* - `kind="compact"`: dense toolbar control. `appearance`, `fullRadius`, `icon`.
|
|
156
|
+
* - `kind="link"`: inline text link. `variant` = gray | primary | error, `underline`.
|
|
157
|
+
*
|
|
158
|
+
* For connected segmented buttons, see `ButtonGroup`.
|
|
159
|
+
*/
|
|
160
|
+
declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
161
|
+
|
|
162
|
+
type ButtonGroupSize = "small" | "medium" | "large";
|
|
163
|
+
interface ButtonGroupItem {
|
|
164
|
+
value: string;
|
|
165
|
+
label?: ReactNode;
|
|
166
|
+
icon?: ReactNode;
|
|
167
|
+
}
|
|
168
|
+
interface ButtonGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
169
|
+
/** Segments to render. */
|
|
170
|
+
items: ButtonGroupItem[];
|
|
171
|
+
/** Currently selected segment value. */
|
|
172
|
+
value?: string;
|
|
173
|
+
/** Fired with the value of the clicked segment. */
|
|
174
|
+
onChange?: (value: string) => void;
|
|
175
|
+
/** Default `"medium"`. */
|
|
176
|
+
size?: ButtonGroupSize;
|
|
177
|
+
/** Stretch segments to fill the container. */
|
|
178
|
+
fullWidth?: boolean;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* ButtonGroup — connected segmented buttons sharing a single border.
|
|
182
|
+
* Pick a `size`, pass `items`, and track the active `value`.
|
|
183
|
+
*/
|
|
184
|
+
declare const ButtonGroup: react.ForwardRefExoticComponent<ButtonGroupProps & react.RefAttributes<HTMLDivElement>>;
|
|
185
|
+
|
|
186
|
+
/** Box size of the control. */
|
|
187
|
+
type CopyButtonSize = "sm" | "md" | "lg";
|
|
188
|
+
/** Surface style. */
|
|
189
|
+
type CopyButtonVariant = "ghost" | "stroke";
|
|
190
|
+
interface CopyButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "value"> {
|
|
191
|
+
/** The value copied to the clipboard. */
|
|
192
|
+
value: string;
|
|
193
|
+
/** Optional label — turns the icon-only square into a labelled pill. */
|
|
194
|
+
children?: ReactNode;
|
|
195
|
+
/** Fired after a successful copy — use to show a toast. */
|
|
196
|
+
onCopied?: (value: string) => void;
|
|
197
|
+
size?: CopyButtonSize;
|
|
198
|
+
variant?: CopyButtonVariant;
|
|
199
|
+
copyIcon?: string;
|
|
200
|
+
doneIcon?: string;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* CopyButton — copies `value` to the clipboard and flips to a transient success
|
|
204
|
+
* state for 1400ms. Icon-only square by default; pass `children` for a labelled
|
|
205
|
+
* pill. Fire `onCopied` to show a toast.
|
|
206
|
+
*/
|
|
207
|
+
declare const CopyButton: react.ForwardRefExoticComponent<CopyButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
208
|
+
|
|
209
|
+
interface Locale {
|
|
210
|
+
/** BCP-47 language tag, e.g. `"en-US"`. */
|
|
211
|
+
locale: string;
|
|
212
|
+
datePicker: {
|
|
213
|
+
/** 12 month names (or numeric forms), January-first — as shown in the header. */
|
|
214
|
+
months: string[];
|
|
215
|
+
/** 7 short weekday labels, Monday-first. */
|
|
216
|
+
weekdaysShort: string[];
|
|
217
|
+
/** Calendar header template with `{month}` and `{year}` placeholders. */
|
|
218
|
+
title: string;
|
|
219
|
+
};
|
|
220
|
+
timePicker: {
|
|
221
|
+
am: string;
|
|
222
|
+
pm: string;
|
|
223
|
+
};
|
|
224
|
+
pagination: {
|
|
225
|
+
previous: string;
|
|
226
|
+
next: string;
|
|
227
|
+
};
|
|
228
|
+
modal: {
|
|
229
|
+
close: string;
|
|
230
|
+
};
|
|
231
|
+
drawer: {
|
|
232
|
+
close: string;
|
|
233
|
+
};
|
|
234
|
+
alert: {
|
|
235
|
+
dismiss: string;
|
|
236
|
+
};
|
|
237
|
+
banner: {
|
|
238
|
+
dismiss: string;
|
|
239
|
+
};
|
|
240
|
+
toast: {
|
|
241
|
+
dismiss: string;
|
|
242
|
+
};
|
|
243
|
+
fileUpload: {
|
|
244
|
+
clickToUpload: string;
|
|
245
|
+
orDragAndDrop: string;
|
|
246
|
+
};
|
|
247
|
+
imageUpload: {
|
|
248
|
+
label: string;
|
|
249
|
+
remove: string;
|
|
250
|
+
};
|
|
251
|
+
passwordStrength: {
|
|
252
|
+
weak: string;
|
|
253
|
+
fair: string;
|
|
254
|
+
good: string;
|
|
255
|
+
strong: string;
|
|
256
|
+
};
|
|
257
|
+
/** `noResults` contains a `{query}` placeholder. */
|
|
258
|
+
commandMenu: {
|
|
259
|
+
placeholder: string;
|
|
260
|
+
esc: string;
|
|
261
|
+
noResults: string;
|
|
262
|
+
};
|
|
263
|
+
selectMenu: {
|
|
264
|
+
placeholder: string;
|
|
265
|
+
};
|
|
266
|
+
chip: {
|
|
267
|
+
remove: string;
|
|
268
|
+
};
|
|
269
|
+
tag: {
|
|
270
|
+
remove: string;
|
|
271
|
+
};
|
|
272
|
+
/** `star` contains a `{count}` placeholder. */
|
|
273
|
+
rating: {
|
|
274
|
+
star: string;
|
|
275
|
+
};
|
|
276
|
+
spinner: {
|
|
277
|
+
loading: string;
|
|
278
|
+
};
|
|
279
|
+
richEditorToolbar: {
|
|
280
|
+
bold: string;
|
|
281
|
+
italic: string;
|
|
282
|
+
underline: string;
|
|
283
|
+
strike: string;
|
|
284
|
+
h1: string;
|
|
285
|
+
h2: string;
|
|
286
|
+
quote: string;
|
|
287
|
+
code: string;
|
|
288
|
+
ul: string;
|
|
289
|
+
ol: string;
|
|
290
|
+
link: string;
|
|
291
|
+
image: string;
|
|
292
|
+
};
|
|
293
|
+
list: {
|
|
294
|
+
noData: string;
|
|
295
|
+
loading: string;
|
|
296
|
+
};
|
|
297
|
+
autoComplete: {
|
|
298
|
+
noResults: string;
|
|
299
|
+
};
|
|
300
|
+
cascader: {
|
|
301
|
+
placeholder: string;
|
|
302
|
+
};
|
|
303
|
+
popconfirm: {
|
|
304
|
+
title: string;
|
|
305
|
+
confirm: string;
|
|
306
|
+
cancel: string;
|
|
307
|
+
};
|
|
308
|
+
/** `goToSlide` has an `{n}` placeholder. */
|
|
309
|
+
carousel: {
|
|
310
|
+
previous: string;
|
|
311
|
+
next: string;
|
|
312
|
+
goToSlide: string;
|
|
313
|
+
};
|
|
314
|
+
input: {
|
|
315
|
+
clear: string;
|
|
316
|
+
};
|
|
317
|
+
notification: {
|
|
318
|
+
close: string;
|
|
319
|
+
};
|
|
320
|
+
/** `minChars`/`maxChars` have `{min}`/`{max}`; `exactChars` has `{len}`; `oneOf` has `{values}`; `min`/`max` have `{min}`/`{max}`. */
|
|
321
|
+
form: {
|
|
322
|
+
required: string;
|
|
323
|
+
empty: string;
|
|
324
|
+
minChars: string;
|
|
325
|
+
maxChars: string;
|
|
326
|
+
exactChars: string;
|
|
327
|
+
oneOf: string;
|
|
328
|
+
invalidFormat: string;
|
|
329
|
+
email: string;
|
|
330
|
+
url: string;
|
|
331
|
+
number: string;
|
|
332
|
+
integer: string;
|
|
333
|
+
min: string;
|
|
334
|
+
max: string;
|
|
335
|
+
};
|
|
336
|
+
/** `pageRange` has `{from}`/`{to}`/`{total}`; `perPage` has `{size}`. */
|
|
337
|
+
table: {
|
|
338
|
+
noData: string;
|
|
339
|
+
columns: string;
|
|
340
|
+
copy: string;
|
|
341
|
+
copyRow: string;
|
|
342
|
+
exportCsv: string;
|
|
343
|
+
filter: string;
|
|
344
|
+
expand: string;
|
|
345
|
+
collapse: string;
|
|
346
|
+
dragToReorder: string;
|
|
347
|
+
dragToResize: string;
|
|
348
|
+
editHint: string;
|
|
349
|
+
previous: string;
|
|
350
|
+
next: string;
|
|
351
|
+
pageRange: string;
|
|
352
|
+
perPage: string;
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
/** Fill a `{placeholder}` template, e.g. `fmt(locale.rating.star, { count: 3 })`. */
|
|
356
|
+
declare function fmt(template: string, vars: Record<string, string | number>): string;
|
|
357
|
+
/** English (US) — the default locale used when no ConfigProvider is present. */
|
|
358
|
+
declare const enUS: Locale;
|
|
359
|
+
/** 简体中文 (Simplified Chinese). */
|
|
360
|
+
declare const zhCN: Locale;
|
|
361
|
+
/** 繁體中文 (Traditional Chinese). */
|
|
362
|
+
declare const zhTW: Locale;
|
|
363
|
+
/** 日本語 (Japanese). */
|
|
364
|
+
declare const jaJP: Locale;
|
|
365
|
+
/** 한국어 (Korean). */
|
|
366
|
+
declare const koKR: Locale;
|
|
367
|
+
/** Français (French). */
|
|
368
|
+
declare const frFR: Locale;
|
|
369
|
+
/** Deutsch (German). */
|
|
370
|
+
declare const deDE: Locale;
|
|
371
|
+
/** Español (Spanish). */
|
|
372
|
+
declare const esES: Locale;
|
|
373
|
+
/** Português (Brasil) (Brazilian Portuguese). */
|
|
374
|
+
declare const ptBR: Locale;
|
|
375
|
+
/** Русский (Russian). */
|
|
376
|
+
declare const ruRU: Locale;
|
|
377
|
+
/** العربية (Arabic). Pairs with `dir="rtl"` on the ConfigProvider. */
|
|
378
|
+
declare const arSA: Locale;
|
|
379
|
+
/** Italiano (Italian). */
|
|
380
|
+
declare const itIT: Locale;
|
|
381
|
+
/** Nederlands (Dutch). */
|
|
382
|
+
declare const nlNL: Locale;
|
|
383
|
+
/** Polski (Polish). */
|
|
384
|
+
declare const plPL: Locale;
|
|
385
|
+
/** Türkçe (Turkish). */
|
|
386
|
+
declare const trTR: Locale;
|
|
387
|
+
/** Tiếng Việt (Vietnamese). */
|
|
388
|
+
declare const viVN: Locale;
|
|
389
|
+
/** Bahasa Indonesia (Indonesian). */
|
|
390
|
+
declare const idID: Locale;
|
|
391
|
+
/** All built-in locales, keyed by their export name. */
|
|
392
|
+
declare const locales: {
|
|
393
|
+
enUS: Locale;
|
|
394
|
+
zhCN: Locale;
|
|
395
|
+
zhTW: Locale;
|
|
396
|
+
jaJP: Locale;
|
|
397
|
+
koKR: Locale;
|
|
398
|
+
frFR: Locale;
|
|
399
|
+
deDE: Locale;
|
|
400
|
+
esES: Locale;
|
|
401
|
+
ptBR: Locale;
|
|
402
|
+
ruRU: Locale;
|
|
403
|
+
arSA: Locale;
|
|
404
|
+
itIT: Locale;
|
|
405
|
+
nlNL: Locale;
|
|
406
|
+
plPL: Locale;
|
|
407
|
+
trTR: Locale;
|
|
408
|
+
viVN: Locale;
|
|
409
|
+
idID: Locale;
|
|
410
|
+
};
|
|
411
|
+
|
|
412
|
+
/** Global default size for components whose scale includes these values. */
|
|
413
|
+
type ComponentSize = "small" | "medium" | "large";
|
|
414
|
+
/** Text direction. */
|
|
415
|
+
type Direction = "ltr" | "rtl";
|
|
416
|
+
/** Color scheme. */
|
|
417
|
+
type Theme = "light" | "dark";
|
|
418
|
+
/**
|
|
419
|
+
* Accent / primary color ramp (maps to the design system's `data-mode`).
|
|
420
|
+
* `"metronic"` is a full Metronic 9.0 skin — it re-points the whole semantic
|
|
421
|
+
* palette (surfaces, text, strokes, intents, radii) onto Metronic colors, not
|
|
422
|
+
* just the primary ramp. Orthogonal to `theme`, so it works in light and dark.
|
|
423
|
+
*/
|
|
424
|
+
type Accent = "blue" | "purple" | "orange" | "green" | "slate" | "metronic";
|
|
425
|
+
/**
|
|
426
|
+
* Global corner-radius scale (maps to `data-radius`). `"square"` = 0-radius
|
|
427
|
+
* (sharp) corners, `"sharp"` = tight, `"rounded"` = soft. The functional pill
|
|
428
|
+
* radius (round avatars / switches / pill badges) is always preserved.
|
|
429
|
+
*/
|
|
430
|
+
type Radius = "default" | "sharp" | "square" | "rounded";
|
|
431
|
+
interface KlunConfig {
|
|
432
|
+
/** Active locale dictionary. */
|
|
433
|
+
locale: Locale;
|
|
434
|
+
/** Default size applied to components that receive no explicit `size` prop. */
|
|
435
|
+
size?: ComponentSize;
|
|
436
|
+
/** Text direction. */
|
|
437
|
+
dir: Direction;
|
|
438
|
+
/** Color scheme. `undefined` inherits the document/default (light) theme. */
|
|
439
|
+
theme?: Theme;
|
|
440
|
+
/** Accent (primary) color ramp. `undefined` inherits the default (blue). */
|
|
441
|
+
accent?: Accent;
|
|
442
|
+
/** Global corner-radius scale. `undefined` inherits the default. */
|
|
443
|
+
radius?: Radius;
|
|
444
|
+
/** Custom primary color (e.g. a hex). Overrides `accent`; a shade/tint ramp is derived. */
|
|
445
|
+
primaryColor?: string;
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* Derive the `--klun-primary-*` token ramp from a single base color. A hex input
|
|
449
|
+
* produces the full shade/tint ramp + alpha tints; any other CSS color sets just
|
|
450
|
+
* the base. Used by ConfigProvider's `primaryColor`, exported for manual use.
|
|
451
|
+
*/
|
|
452
|
+
declare function primaryColorVars(color: string): Record<string, string>;
|
|
453
|
+
interface ConfigProviderProps {
|
|
454
|
+
/** Locale dictionary. Defaults to `enUS` (or the nearest parent provider's). */
|
|
455
|
+
locale?: Locale;
|
|
456
|
+
/** Global default component size. */
|
|
457
|
+
size?: ComponentSize;
|
|
458
|
+
/** Text direction. Default `"ltr"`. */
|
|
459
|
+
dir?: Direction;
|
|
460
|
+
/** Color scheme applied to the subtree (`light` | `dark`). */
|
|
461
|
+
theme?: Theme;
|
|
462
|
+
/** Accent (primary) color ramp applied to the subtree. */
|
|
463
|
+
accent?: Accent;
|
|
464
|
+
/** Global corner-radius scale applied to the subtree. */
|
|
465
|
+
radius?: Radius;
|
|
466
|
+
/** Custom primary color (e.g. a hex). Overrides `accent`; a ramp is derived. */
|
|
467
|
+
primaryColor?: string;
|
|
468
|
+
children?: ReactNode;
|
|
469
|
+
}
|
|
470
|
+
/**
|
|
471
|
+
* ConfigProvider — supplies a global locale, default size, text direction and
|
|
472
|
+
* theme/accent to the klun-ui components rendered below it. Values are inherited
|
|
473
|
+
* from a parent provider when present, so providers can be nested to scope
|
|
474
|
+
* overrides. `theme`/`accent` set `data-theme`/`data-mode` on the wrapper, which
|
|
475
|
+
* re-points the design tokens for the whole subtree; `primaryColor` overrides the
|
|
476
|
+
* accent with a ramp derived from any hex. Without any provider, components fall
|
|
477
|
+
* back to en-US / ltr / default theme, so usage is fully optional.
|
|
478
|
+
*/
|
|
479
|
+
declare function ConfigProvider({ locale, size, dir, theme, accent, radius, primaryColor, children, }: ConfigProviderProps): react.JSX.Element;
|
|
480
|
+
declare namespace ConfigProvider {
|
|
481
|
+
var displayName: string;
|
|
482
|
+
}
|
|
483
|
+
/** Read the full klun-ui config from the nearest provider (or built-in defaults). */
|
|
484
|
+
declare function useConfig(): KlunConfig;
|
|
485
|
+
/** Read the active locale dictionary. */
|
|
486
|
+
declare function useLocale(): Locale;
|
|
487
|
+
/**
|
|
488
|
+
* Resolve a component's size: explicit prop wins, then the provider's global
|
|
489
|
+
* `size`, then `"medium"`. Returns the explicit prop's own size type.
|
|
490
|
+
*/
|
|
491
|
+
declare function useSize<S extends string = ComponentSize>(explicit?: S): S;
|
|
492
|
+
/**
|
|
493
|
+
* Resolve a size for a component whose own scale differs from the global one —
|
|
494
|
+
* it lacks a tier (e.g. no `large`) or uses different names (`sm`/`md`/`lg`).
|
|
495
|
+
* `explicit` wins; otherwise the provider's global size is translated through
|
|
496
|
+
* `map` (which clamps/renames each global tier to a value this component
|
|
497
|
+
* supports); with no provider size it returns `fallback`.
|
|
498
|
+
*/
|
|
499
|
+
declare function useMappedSize<S extends string>(explicit: S | undefined, map: Record<ComponentSize, S>, fallback: S): S;
|
|
500
|
+
|
|
501
|
+
type AvatarSize = "20" | "24" | "32" | "40" | "48" | "56" | "64" | "72" | "80";
|
|
502
|
+
type AvatarStatus = "online" | "busy" | "away" | "offline";
|
|
503
|
+
interface AvatarProps extends HTMLAttributes<HTMLSpanElement> {
|
|
504
|
+
size?: AvatarSize;
|
|
505
|
+
src?: string;
|
|
506
|
+
alt?: string;
|
|
507
|
+
initials?: string;
|
|
508
|
+
color?: "gray" | "blue" | "purple" | "green" | "orange" | "yellow";
|
|
509
|
+
status?: AvatarStatus;
|
|
510
|
+
icon?: ReactNode;
|
|
511
|
+
}
|
|
512
|
+
/**
|
|
513
|
+
* Avatar — user image, initials, or icon with optional status dot.
|
|
514
|
+
*/
|
|
515
|
+
declare const Avatar: react.ForwardRefExoticComponent<AvatarProps & react.RefAttributes<HTMLSpanElement>>;
|
|
516
|
+
|
|
517
|
+
interface AvatarGroupProps extends HTMLAttributes<HTMLDivElement> {
|
|
518
|
+
avatars?: AvatarProps[];
|
|
519
|
+
size?: "24" | "32" | "40" | "48";
|
|
520
|
+
max?: number;
|
|
521
|
+
/** Container chrome around the stack. Default `"none"`. */
|
|
522
|
+
variant?: "none" | "stroke" | "filled";
|
|
523
|
+
}
|
|
524
|
+
/**
|
|
525
|
+
* AvatarGroup — overlapping avatar stack with optional +N overflow.
|
|
526
|
+
*/
|
|
527
|
+
declare const AvatarGroup: react.ForwardRefExoticComponent<AvatarGroupProps & react.RefAttributes<HTMLDivElement>>;
|
|
528
|
+
|
|
529
|
+
type BadgeColor = "gray" | "blue" | "orange" | "red" | "green" | "yellow" | "purple" | "sky" | "pink" | "teal";
|
|
530
|
+
type BadgeVariant = "filled" | "light" | "lighter" | "stroke";
|
|
531
|
+
interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
532
|
+
color?: BadgeColor;
|
|
533
|
+
variant?: BadgeVariant;
|
|
534
|
+
size?: "small" | "medium";
|
|
535
|
+
leadingIcon?: ReactNode;
|
|
536
|
+
dot?: boolean;
|
|
537
|
+
children?: ReactNode;
|
|
538
|
+
}
|
|
539
|
+
/**
|
|
540
|
+
* Badge — compact status / category marker. 10 colors × 4 variants × 2 sizes.
|
|
541
|
+
*/
|
|
542
|
+
declare const Badge: react.ForwardRefExoticComponent<BadgeProps & react.RefAttributes<HTMLSpanElement>>;
|
|
543
|
+
|
|
544
|
+
interface BulkActionBarProps extends HTMLAttributes<HTMLDivElement> {
|
|
545
|
+
count?: number;
|
|
546
|
+
/** Force visibility (defaults to `count > 0`). */
|
|
547
|
+
open?: boolean;
|
|
548
|
+
onClear?: () => void;
|
|
549
|
+
label?: ReactNode;
|
|
550
|
+
position?: "top" | "bottom";
|
|
551
|
+
/** CSS position: "fixed" (viewport) or "sticky"/"absolute". */
|
|
552
|
+
sticky?: "fixed" | "sticky" | "absolute";
|
|
553
|
+
}
|
|
554
|
+
/**
|
|
555
|
+
* Klun UI BulkActionBar — floating pill toolbar that appears when table rows are selected.
|
|
556
|
+
* Renders a selection count chip, a label, a divider, your action buttons and an optional
|
|
557
|
+
* clear control. Mounts/unmounts with a slide+fade driven by `count > 0` (or the `open` prop).
|
|
558
|
+
*/
|
|
559
|
+
declare const BulkActionBar: react.ForwardRefExoticComponent<BulkActionBarProps & react.RefAttributes<HTMLDivElement>>;
|
|
560
|
+
interface BulkActionProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
561
|
+
tone?: "default" | "danger";
|
|
562
|
+
}
|
|
563
|
+
/** Button styled for use inside a BulkActionBar (on the dark pill). */
|
|
564
|
+
declare const BulkAction: react.ForwardRefExoticComponent<BulkActionProps & react.RefAttributes<HTMLButtonElement>>;
|
|
565
|
+
|
|
566
|
+
interface CarouselProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
567
|
+
children?: ReactNode;
|
|
568
|
+
/** Controlled active index. */
|
|
569
|
+
index?: number;
|
|
570
|
+
defaultIndex?: number;
|
|
571
|
+
onChange?: (index: number) => void;
|
|
572
|
+
autoplay?: boolean;
|
|
573
|
+
/** Autoplay interval in ms. */
|
|
574
|
+
interval?: number;
|
|
575
|
+
dots?: boolean;
|
|
576
|
+
arrows?: boolean;
|
|
577
|
+
loop?: boolean;
|
|
578
|
+
height?: number | string;
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* Klun UI Carousel — sliding content rotator with optional dots, arrows and
|
|
582
|
+
* autoplay. Each direct child is one slide. Controlled or uncontrolled.
|
|
583
|
+
*/
|
|
584
|
+
declare const Carousel: react.ForwardRefExoticComponent<CarouselProps & react.RefAttributes<HTMLDivElement>>;
|
|
585
|
+
|
|
586
|
+
interface ChartLegendItem {
|
|
587
|
+
label: string;
|
|
588
|
+
/** Any CSS color or token var() for the series swatch. */
|
|
589
|
+
color: string;
|
|
590
|
+
/** Optional trailing value, e.g. "$24,500" or "42%". */
|
|
591
|
+
value?: string;
|
|
592
|
+
}
|
|
593
|
+
interface ChartLegendProps extends HTMLAttributes<HTMLDivElement> {
|
|
594
|
+
items: ChartLegendItem[];
|
|
595
|
+
direction?: "row" | "column";
|
|
596
|
+
dot?: "round" | "line";
|
|
597
|
+
size?: "sm" | "md";
|
|
598
|
+
}
|
|
599
|
+
/** Klun UI ChartLegend — keyed list of series with color dots and optional values. */
|
|
600
|
+
declare const ChartLegend: react.ForwardRefExoticComponent<ChartLegendProps & react.RefAttributes<HTMLDivElement>>;
|
|
601
|
+
|
|
602
|
+
interface ChartTooltipRow {
|
|
603
|
+
label: ReactNode;
|
|
604
|
+
value: ReactNode;
|
|
605
|
+
color?: string;
|
|
606
|
+
}
|
|
607
|
+
interface ChartTooltipProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
608
|
+
title?: ReactNode;
|
|
609
|
+
rows: ChartTooltipRow[];
|
|
610
|
+
/** Optional pointer arrow side. */
|
|
611
|
+
arrow?: "none" | "top" | "bottom";
|
|
612
|
+
}
|
|
613
|
+
/** Klun UI ChartTooltip — floating chart readout with title + keyed series rows. */
|
|
614
|
+
declare const ChartTooltip: react.ForwardRefExoticComponent<ChartTooltipProps & react.RefAttributes<HTMLDivElement>>;
|
|
615
|
+
|
|
616
|
+
type ChipColor = "gray" | "blue" | "orange" | "red" | "green" | "purple" | "yellow" | "teal" | "sky" | "pink";
|
|
617
|
+
interface ChipProps extends HTMLAttributes<HTMLSpanElement> {
|
|
618
|
+
color?: ChipColor;
|
|
619
|
+
selected?: boolean;
|
|
620
|
+
/** Show a leading color dot. */
|
|
621
|
+
dot?: boolean;
|
|
622
|
+
/** Show a dismiss (×) button; receives the click handler. */
|
|
623
|
+
onDismiss?: () => void;
|
|
624
|
+
disabled?: boolean;
|
|
625
|
+
children?: ReactNode;
|
|
626
|
+
}
|
|
627
|
+
/** Klun UI Chip — compact, optionally-selectable color category pill. */
|
|
628
|
+
declare const Chip: react.ForwardRefExoticComponent<ChipProps & react.RefAttributes<HTMLSpanElement>>;
|
|
629
|
+
|
|
630
|
+
interface CodeViewerProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
631
|
+
code: string;
|
|
632
|
+
title?: ReactNode;
|
|
633
|
+
language?: string;
|
|
634
|
+
lineNumbers?: boolean;
|
|
635
|
+
wrap?: boolean;
|
|
636
|
+
maxHeight?: number;
|
|
637
|
+
dark?: boolean;
|
|
638
|
+
onCopied?: (value: string) => void;
|
|
639
|
+
}
|
|
640
|
+
/**
|
|
641
|
+
* Klun UI CodeViewer — read-only monospace block for error stacks, config, snippets.
|
|
642
|
+
* Dark surface, horizontal scroll, optional line numbers, copy button, max-height inner scroll.
|
|
643
|
+
*/
|
|
644
|
+
declare const CodeViewer: react.ForwardRefExoticComponent<CodeViewerProps & react.RefAttributes<HTMLDivElement>>;
|
|
645
|
+
type LogLevel = "error" | "warn" | "warning" | "info" | "debug" | "success";
|
|
646
|
+
interface LogLine {
|
|
647
|
+
ts?: string;
|
|
648
|
+
level?: LogLevel | string;
|
|
649
|
+
text: string;
|
|
650
|
+
}
|
|
651
|
+
interface LogViewerProps extends HTMLAttributes<HTMLDivElement> {
|
|
652
|
+
lines: (string | LogLine)[];
|
|
653
|
+
maxHeight?: number;
|
|
654
|
+
showTimestamp?: boolean;
|
|
655
|
+
dark?: boolean;
|
|
656
|
+
onCopied?: (value: string) => void;
|
|
657
|
+
}
|
|
658
|
+
/**
|
|
659
|
+
* Klun UI LogViewer — read-only log stream with optional per-line level coloring + timestamps.
|
|
660
|
+
* `lines`: string[] OR [{ ts?, level?, text }]. Monospace, dark, inner-scroll.
|
|
661
|
+
*/
|
|
662
|
+
declare const LogViewer: react.ForwardRefExoticComponent<LogViewerProps & react.RefAttributes<HTMLDivElement>>;
|
|
663
|
+
|
|
664
|
+
type ContentLabelColor = "gray" | "blue" | "green" | "orange" | "purple";
|
|
665
|
+
interface ContentLabelProps extends HTMLAttributes<HTMLSpanElement> {
|
|
666
|
+
icon?: ReactNode;
|
|
667
|
+
color?: ContentLabelColor;
|
|
668
|
+
size?: "sm" | "md";
|
|
669
|
+
children?: ReactNode;
|
|
670
|
+
}
|
|
671
|
+
/** Klun UI ContentLabel — tracked uppercase section overline with optional icon. */
|
|
672
|
+
declare const ContentLabel: react.ForwardRefExoticComponent<ContentLabelProps & react.RefAttributes<HTMLSpanElement>>;
|
|
673
|
+
|
|
674
|
+
interface DescriptionItem {
|
|
675
|
+
label: ReactNode;
|
|
676
|
+
children: ReactNode;
|
|
677
|
+
/** How many columns this item spans. */
|
|
678
|
+
span?: number;
|
|
679
|
+
}
|
|
680
|
+
type DescriptionsVariant = "plain" | "bordered";
|
|
681
|
+
type DescriptionsSize = "small" | "medium" | "large";
|
|
682
|
+
type DescriptionsLayout = "horizontal" | "vertical";
|
|
683
|
+
interface DescriptionsProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
684
|
+
title?: ReactNode;
|
|
685
|
+
extra?: ReactNode;
|
|
686
|
+
items: DescriptionItem[];
|
|
687
|
+
column?: number;
|
|
688
|
+
variant?: DescriptionsVariant;
|
|
689
|
+
size?: DescriptionsSize;
|
|
690
|
+
colon?: boolean;
|
|
691
|
+
layout?: DescriptionsLayout;
|
|
692
|
+
}
|
|
693
|
+
/**
|
|
694
|
+
* Descriptions — key/value detail list for entity/detail pages.
|
|
695
|
+
* `items`: [{ label, children, span? }]. `column` sets grid columns.
|
|
696
|
+
* variant: "plain" (rows) or "bordered" (boxed cells).
|
|
697
|
+
*/
|
|
698
|
+
declare const Descriptions: react.ForwardRefExoticComponent<DescriptionsProps & react.RefAttributes<HTMLDivElement>>;
|
|
699
|
+
|
|
700
|
+
interface KbdProps extends HTMLAttributes<HTMLElement> {
|
|
701
|
+
children?: ReactNode;
|
|
702
|
+
}
|
|
703
|
+
/**
|
|
704
|
+
* Kbd — keyboard key cap.
|
|
705
|
+
*/
|
|
706
|
+
declare const Kbd: react.ForwardRefExoticComponent<KbdProps & react.RefAttributes<HTMLElement>>;
|
|
707
|
+
|
|
708
|
+
type KeyIconColor = "gray" | "blue" | "orange" | "red" | "green" | "purple" | "yellow" | "teal" | "sky" | "pink";
|
|
709
|
+
type KeyIconAppearance = "light" | "filled" | "stroke";
|
|
710
|
+
type KeyIconSize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
711
|
+
interface KeyIconProps extends Omit<HTMLAttributes<HTMLSpanElement>, "color"> {
|
|
712
|
+
icon: ReactNode;
|
|
713
|
+
/** Color ramp. Default `"blue"`. */
|
|
714
|
+
color?: KeyIconColor;
|
|
715
|
+
/** Surface style. Default `"light"`. */
|
|
716
|
+
appearance?: KeyIconAppearance;
|
|
717
|
+
/** Default `"md"`. */
|
|
718
|
+
size?: KeyIconSize;
|
|
719
|
+
/** Extra inline style for the tile. */
|
|
720
|
+
css?: CSSProperties;
|
|
721
|
+
}
|
|
722
|
+
/** Klun UI KeyIcon — featured icon tile in a themed rounded container. */
|
|
723
|
+
declare const KeyIcon: react.ForwardRefExoticComponent<KeyIconProps & react.RefAttributes<HTMLSpanElement>>;
|
|
724
|
+
|
|
725
|
+
interface ListProps<T = any> extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
726
|
+
dataSource?: T[];
|
|
727
|
+
renderItem?: (item: T, index: number) => ReactNode;
|
|
728
|
+
header?: ReactNode;
|
|
729
|
+
footer?: ReactNode;
|
|
730
|
+
bordered?: boolean;
|
|
731
|
+
split?: boolean;
|
|
732
|
+
loading?: boolean;
|
|
733
|
+
empty?: ReactNode;
|
|
734
|
+
size?: "small" | "medium" | "large";
|
|
735
|
+
/** Node rendered in a centered footer band, e.g. a "Load more" button. */
|
|
736
|
+
loadMore?: ReactNode;
|
|
737
|
+
children?: ReactNode;
|
|
738
|
+
}
|
|
739
|
+
/**
|
|
740
|
+
* Klun UI List — vertical list of items with optional header/footer, dividers,
|
|
741
|
+
* loading and "load more". Use `dataSource` + `renderItem`, or compose <ListItem>.
|
|
742
|
+
*/
|
|
743
|
+
declare function List<T = any>({ dataSource, renderItem, header, footer, bordered, split, loading, empty, size: sizeProp, loadMore, className, children, ...props }: ListProps<T>): react.JSX.Element;
|
|
744
|
+
declare namespace List {
|
|
745
|
+
var displayName: string;
|
|
746
|
+
}
|
|
747
|
+
interface ListItemProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
748
|
+
avatar?: ReactNode;
|
|
749
|
+
title?: ReactNode;
|
|
750
|
+
description?: ReactNode;
|
|
751
|
+
extra?: ReactNode;
|
|
752
|
+
actions?: ReactNode[];
|
|
753
|
+
align?: CSSProperties["alignItems"];
|
|
754
|
+
children?: ReactNode;
|
|
755
|
+
}
|
|
756
|
+
/**
|
|
757
|
+
* Klun UI ListItem — a single row: optional avatar/media, title, description,
|
|
758
|
+
* and trailing actions. Use inside List's renderItem.
|
|
759
|
+
*/
|
|
760
|
+
declare const ListItem: react.ForwardRefExoticComponent<ListItemProps & react.RefAttributes<HTMLDivElement>>;
|
|
761
|
+
|
|
762
|
+
type MoneyTone = "default" | "muted" | "increase" | "refund";
|
|
763
|
+
type MoneySize = "sm" | "md" | "lg" | "big";
|
|
764
|
+
interface MoneyProps extends Omit<HTMLAttributes<HTMLSpanElement>, "prefix"> {
|
|
765
|
+
/** Amount in major units, or minor units when `cents` is true. */
|
|
766
|
+
value: number;
|
|
767
|
+
cents?: boolean;
|
|
768
|
+
currency?: string;
|
|
769
|
+
locale?: string;
|
|
770
|
+
period?: MoneyPeriod;
|
|
771
|
+
periodLabels?: Partial<Record<MoneyPeriod, string>>;
|
|
772
|
+
minimumFractionDigits?: number;
|
|
773
|
+
maximumFractionDigits?: number;
|
|
774
|
+
signDisplay?: "auto" | "never" | "always" | "exceptZero";
|
|
775
|
+
tone?: MoneyTone;
|
|
776
|
+
size?: MoneySize;
|
|
777
|
+
strikethrough?: boolean;
|
|
778
|
+
prefix?: ReactNode;
|
|
779
|
+
suffix?: ReactNode;
|
|
780
|
+
}
|
|
781
|
+
/**
|
|
782
|
+
* Klun UI Money — formatted currency amount with optional period suffix and tone.
|
|
783
|
+
* One place to change currency / locale across a product. Pass `cents` for minor units.
|
|
784
|
+
*/
|
|
785
|
+
declare const Money: react.ForwardRefExoticComponent<MoneyProps & react.RefAttributes<HTMLSpanElement>>;
|
|
786
|
+
|
|
787
|
+
interface RatingProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "style"> {
|
|
788
|
+
/** Current rating. Default `0`. */
|
|
789
|
+
value?: number;
|
|
790
|
+
/** Number of stars. Default `5`. */
|
|
791
|
+
max?: number;
|
|
792
|
+
onChange?: (value: number) => void;
|
|
793
|
+
/** Disable interaction. Default `false`. */
|
|
794
|
+
readOnly?: boolean;
|
|
795
|
+
/** Star size in px. Default `20`. */
|
|
796
|
+
size?: number;
|
|
797
|
+
style?: CSSProperties;
|
|
798
|
+
}
|
|
799
|
+
/** Klun UI Rating — star rating, interactive or read-only. */
|
|
800
|
+
declare const Rating: react.ForwardRefExoticComponent<RatingProps & react.RefAttributes<HTMLDivElement>>;
|
|
801
|
+
|
|
802
|
+
interface RelativeTimeProps extends TimeHTMLAttributes<HTMLTimeElement> {
|
|
803
|
+
date: Date | number | string;
|
|
804
|
+
locale?: string;
|
|
805
|
+
/** Re-render on an interval (default true). */
|
|
806
|
+
live?: boolean;
|
|
807
|
+
every?: number;
|
|
808
|
+
/** Show the absolute time as the label instead of the relative one. */
|
|
809
|
+
absolute?: boolean;
|
|
810
|
+
}
|
|
811
|
+
/**
|
|
812
|
+
* Klun UI RelativeTime — locale relative time ("2 hours ago") that re-renders on an interval.
|
|
813
|
+
* Shows the absolute time in a native tooltip. Set `live={false}` to render once.
|
|
814
|
+
*/
|
|
815
|
+
declare const RelativeTime: react.ForwardRefExoticComponent<RelativeTimeProps & react.RefAttributes<HTMLTimeElement>>;
|
|
816
|
+
interface ExpiryCountdownProps extends HTMLAttributes<HTMLSpanElement> {
|
|
817
|
+
date: Date | number | string;
|
|
818
|
+
/** Days remaining at/under which the tone turns amber. */
|
|
819
|
+
warnDays?: number;
|
|
820
|
+
every?: number;
|
|
821
|
+
showIcon?: boolean;
|
|
822
|
+
/** Custom label formatter (for i18n). */
|
|
823
|
+
format?: (c: CountdownResult) => ReactNode;
|
|
824
|
+
}
|
|
825
|
+
/**
|
|
826
|
+
* Klun UI ExpiryCountdown — counts down to an expiry date. Goes amber within `warnDays`
|
|
827
|
+
* and red once expired. Language-neutral: pass a `format` fn for copy, or use the default
|
|
828
|
+
* compact "5d 3h" / "expired".
|
|
829
|
+
*/
|
|
830
|
+
declare const ExpiryCountdown: react.ForwardRefExoticComponent<ExpiryCountdownProps & react.RefAttributes<HTMLSpanElement>>;
|
|
831
|
+
|
|
832
|
+
interface StatisticProps extends Omit<HTMLAttributes<HTMLDivElement>, "prefix"> {
|
|
833
|
+
label?: ReactNode;
|
|
834
|
+
value: ReactNode;
|
|
835
|
+
prefix?: ReactNode;
|
|
836
|
+
suffix?: ReactNode;
|
|
837
|
+
/** Decimal places when value is a number. */
|
|
838
|
+
precision?: number;
|
|
839
|
+
trend?: "up" | "down" | "flat";
|
|
840
|
+
trendValue?: ReactNode;
|
|
841
|
+
icon?: ReactNode;
|
|
842
|
+
size?: "small" | "medium" | "large";
|
|
843
|
+
}
|
|
844
|
+
/**
|
|
845
|
+
* Klun UI Statistic — a single metric: label, big value (prefix/suffix) and an
|
|
846
|
+
* optional trend delta. Compose several with `Space` for a stat row.
|
|
847
|
+
*/
|
|
848
|
+
declare const Statistic: react.ForwardRefExoticComponent<StatisticProps & react.RefAttributes<HTMLDivElement>>;
|
|
849
|
+
|
|
850
|
+
type StatusTone = "ok" | "warn" | "err" | "info" | "neutral" | "busy";
|
|
851
|
+
interface StatusBadgeProps extends Omit<HTMLAttributes<HTMLSpanElement>, "color"> {
|
|
852
|
+
status: string;
|
|
853
|
+
/** Display text override (defaults to a humanized `status`). */
|
|
854
|
+
label?: ReactNode;
|
|
855
|
+
/** Force a tone instead of using the lookup table. */
|
|
856
|
+
tone?: StatusTone;
|
|
857
|
+
/** Extra/override status→tone entries, e.g. { custom: "ok" }. */
|
|
858
|
+
map?: Record<string, StatusTone>;
|
|
859
|
+
dot?: boolean;
|
|
860
|
+
pulse?: boolean;
|
|
861
|
+
variant?: BadgeVariant;
|
|
862
|
+
size?: "small" | "medium";
|
|
863
|
+
}
|
|
864
|
+
/**
|
|
865
|
+
* Klun UI StatusBadge — maps a domain status string to a tone-consistent Badge.
|
|
866
|
+
* Centralizes status→color so every list/detail page reads identically.
|
|
867
|
+
* Override or extend with the `map` prop ({ statusKey: tone }) or pass an explicit `tone`.
|
|
868
|
+
*/
|
|
869
|
+
declare function StatusBadge({ status, label, tone, map, dot, variant, size, pulse, className, ...props }: StatusBadgeProps): react.JSX.Element;
|
|
870
|
+
declare namespace StatusBadge {
|
|
871
|
+
var displayName: string;
|
|
872
|
+
var STATUS_TONE: Record<string, StatusTone>;
|
|
873
|
+
var TONE_COLOR: Record<StatusTone, BadgeColor>;
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
type DotTone = "ok" | "warn" | "err" | "info" | "neutral";
|
|
877
|
+
interface StatusDotProps extends Omit<HTMLAttributes<HTMLSpanElement>, "color"> {
|
|
878
|
+
tone?: DotTone;
|
|
879
|
+
size?: "xs" | "sm" | "md" | "lg";
|
|
880
|
+
pulse?: boolean;
|
|
881
|
+
label?: ReactNode;
|
|
882
|
+
}
|
|
883
|
+
/**
|
|
884
|
+
* StatusDot — small colored dot for resource/system state, with optional pulse
|
|
885
|
+
* ring and trailing label.
|
|
886
|
+
*/
|
|
887
|
+
declare const StatusDot: react.ForwardRefExoticComponent<StatusDotProps & react.RefAttributes<HTMLSpanElement>>;
|
|
888
|
+
interface LiveDotProps extends Omit<StatusDotProps, "pulse"> {
|
|
889
|
+
}
|
|
890
|
+
/** A StatusDot preset that always pulses (for "live"/"running" indicators). */
|
|
891
|
+
declare const LiveDot: react.ForwardRefExoticComponent<LiveDotProps & react.RefAttributes<HTMLSpanElement>>;
|
|
892
|
+
|
|
893
|
+
type SortDir = "asc" | "desc";
|
|
894
|
+
interface TableSort {
|
|
895
|
+
key: string;
|
|
896
|
+
dir: SortDir;
|
|
897
|
+
}
|
|
898
|
+
interface TableMenuItem {
|
|
899
|
+
label?: ReactNode;
|
|
900
|
+
icon?: string;
|
|
901
|
+
onClick?: () => void;
|
|
902
|
+
danger?: boolean;
|
|
903
|
+
disabled?: boolean;
|
|
904
|
+
divider?: boolean;
|
|
905
|
+
shortcut?: ReactNode;
|
|
906
|
+
}
|
|
907
|
+
interface TableColumn<Row = any> {
|
|
908
|
+
key: string;
|
|
909
|
+
header: ReactNode;
|
|
910
|
+
width?: number | string;
|
|
911
|
+
align?: "left" | "center" | "right";
|
|
912
|
+
/** Make this column sortable (or force off with false while `sortable` is on). */
|
|
913
|
+
sortable?: boolean;
|
|
914
|
+
/** Value used for sorting; defaults to row[key]. */
|
|
915
|
+
sortAccessor?: (row: Row) => string | number | null | undefined;
|
|
916
|
+
/** Filter options shown in the header dropdown. */
|
|
917
|
+
filters?: Array<{
|
|
918
|
+
label: ReactNode;
|
|
919
|
+
value: any;
|
|
920
|
+
}>;
|
|
921
|
+
/** Predicate for a filter value against a row; defaults to row[key] === value. */
|
|
922
|
+
onFilter?: (value: any, row: Row) => boolean;
|
|
923
|
+
/** Allow selecting multiple filter values. Default true. */
|
|
924
|
+
filterMultiple?: boolean;
|
|
925
|
+
/** Pin this column to the left or right edge while scrolling horizontally. */
|
|
926
|
+
fixed?: "left" | "right";
|
|
927
|
+
/** Truncate overflow with an ellipsis (and native title tooltip for strings). */
|
|
928
|
+
ellipsis?: boolean;
|
|
929
|
+
/** Show a hover copy button in the cell; copies copyValue(row) or row[key]. */
|
|
930
|
+
copyable?: boolean;
|
|
931
|
+
/** Value used for copy (cell and row). Defaults to row[key]. */
|
|
932
|
+
copyValue?: (row: Row) => string | number | null | undefined;
|
|
933
|
+
/** Allow drag-resizing this column (or force off with false while `resizable` is on). */
|
|
934
|
+
resizable?: boolean;
|
|
935
|
+
/** Min width in px when resizing. Default 64. */
|
|
936
|
+
minWidth?: number;
|
|
937
|
+
/** Exclude this column from CSV export. */
|
|
938
|
+
exportable?: boolean;
|
|
939
|
+
/** Hidden by default (toggle via the column-settings menu). */
|
|
940
|
+
hidden?: boolean;
|
|
941
|
+
/** Allow inline editing of this cell (double-click to edit). */
|
|
942
|
+
editable?: boolean;
|
|
943
|
+
/** Editor control used when editable. Default "text". */
|
|
944
|
+
editor?: "text" | "number" | "select";
|
|
945
|
+
/** Options for the select editor: values or { label, value }. */
|
|
946
|
+
options?: Array<string | number | {
|
|
947
|
+
label: ReactNode;
|
|
948
|
+
value: any;
|
|
949
|
+
}>;
|
|
950
|
+
/** Custom cell renderer; defaults to row[key]. */
|
|
951
|
+
render?: (row: Row) => ReactNode;
|
|
952
|
+
/** Custom header renderer. */
|
|
953
|
+
headerRender?: () => ReactNode;
|
|
954
|
+
/** Prevent the cell text from wrapping. */
|
|
955
|
+
nowrap?: boolean;
|
|
956
|
+
}
|
|
957
|
+
interface TableProps<Row = any> extends Omit<HTMLAttributes<HTMLDivElement>, "style" | "contextMenu" | "title" | "onCopy"> {
|
|
958
|
+
columns: TableColumn<Row>[];
|
|
959
|
+
rows: Row[];
|
|
960
|
+
getRowId?: (row: Row, index: number) => string | number;
|
|
961
|
+
/** Row selection. */
|
|
962
|
+
selectable?: boolean;
|
|
963
|
+
selected?: Array<string | number>;
|
|
964
|
+
onSelectRow?: (id: string | number) => void;
|
|
965
|
+
/** Receives the full id list (or []) when the header box is toggled. */
|
|
966
|
+
onSelectAll?: (ids: Array<string | number>) => void;
|
|
967
|
+
/** Enable sorting on all columns (per-column `sortable` still wins). */
|
|
968
|
+
sortable?: boolean;
|
|
969
|
+
/** Controlled sort state; omit for built-in uncontrolled sorting. */
|
|
970
|
+
sort?: TableSort | null;
|
|
971
|
+
onSortChange?: (sort: TableSort | null) => void;
|
|
972
|
+
/** Initial sort for uncontrolled mode. */
|
|
973
|
+
defaultSort?: TableSort | null;
|
|
974
|
+
/** Controlled column filters: { [columnKey]: selectedValues[] }. Omit for built-in. */
|
|
975
|
+
filters?: Record<string, any[]>;
|
|
976
|
+
onFiltersChange?: (filters: Record<string, any[]>) => void;
|
|
977
|
+
/** Built-in pagination. `true` for defaults, or configure it. */
|
|
978
|
+
pagination?: boolean | {
|
|
979
|
+
page?: number;
|
|
980
|
+
pageSize?: number;
|
|
981
|
+
defaultPageSize?: number;
|
|
982
|
+
total?: number;
|
|
983
|
+
pageSizeOptions?: number[];
|
|
984
|
+
onChange?: (page: number, pageSize: number) => void;
|
|
985
|
+
};
|
|
986
|
+
/** Expandable rows with a per-row detail panel. */
|
|
987
|
+
expandable?: {
|
|
988
|
+
render: (row: Row) => ReactNode;
|
|
989
|
+
rowExpandable?: (row: Row) => boolean;
|
|
990
|
+
defaultExpandedKeys?: Array<string | number>;
|
|
991
|
+
onExpand?: (row: Row, expanded: boolean) => void;
|
|
992
|
+
};
|
|
993
|
+
/** Row height / padding scale. */
|
|
994
|
+
density?: "compact" | "comfortable" | "spacious";
|
|
995
|
+
/** Striped alternate rows. */
|
|
996
|
+
zebra?: boolean;
|
|
997
|
+
/** Sticky header for scrolling bodies. */
|
|
998
|
+
stickyHeader?: boolean;
|
|
999
|
+
/** Row hover highlight. Default true. */
|
|
1000
|
+
hover?: boolean;
|
|
1001
|
+
/** Draw vertical cell dividers (grid look). */
|
|
1002
|
+
bordered?: boolean;
|
|
1003
|
+
/** Selection control style. */
|
|
1004
|
+
selectionType?: "checkbox" | "radio";
|
|
1005
|
+
/** Tint a row by status, with a colored left accent bar. */
|
|
1006
|
+
rowStatus?: (row: Row) => "success" | "warning" | "error" | "info" | null | undefined;
|
|
1007
|
+
/** Summary/total row: receives the current page rows, returns one node per column. */
|
|
1008
|
+
summary?: (rows: Row[]) => ReactNode[];
|
|
1009
|
+
/** Right-click menu items for a row. Receives clipboard helpers; return [] to suppress. */
|
|
1010
|
+
contextMenu?: (row: Row, helpers: {
|
|
1011
|
+
copyRow: (row: Row) => void;
|
|
1012
|
+
copyText: (text: any) => void;
|
|
1013
|
+
}) => TableMenuItem[];
|
|
1014
|
+
/** Enable the built-in right-click "Copy row" (tab-separated) when no contextMenu is given. */
|
|
1015
|
+
copyable?: boolean;
|
|
1016
|
+
/** Notified after any copy. kind is "row" or "cell". */
|
|
1017
|
+
onCopy?: (kind: "row" | "cell", row: Row, columnKey?: string) => void;
|
|
1018
|
+
/** Enable drag-to-resize on all columns (per-column `resizable` still wins). */
|
|
1019
|
+
resizable?: boolean;
|
|
1020
|
+
/** Hierarchical rows: each row may carry a children array (see childrenKey). */
|
|
1021
|
+
tree?: boolean;
|
|
1022
|
+
/** Property holding child rows. Default "children". */
|
|
1023
|
+
childrenKey?: string;
|
|
1024
|
+
/** Indent per depth level in px. Default 22. */
|
|
1025
|
+
indentSize?: number;
|
|
1026
|
+
/** Row ids expanded by default in tree mode. */
|
|
1027
|
+
defaultExpandedRowKeys?: Array<string | number>;
|
|
1028
|
+
/** Show a toolbar "Columns" menu to toggle column visibility. */
|
|
1029
|
+
columnSettings?: boolean;
|
|
1030
|
+
/** Enable drag-to-reorder rows (native HTML5 DnD; disabled in tree mode). */
|
|
1031
|
+
rowDraggable?: boolean;
|
|
1032
|
+
/** Called with the reordered rows after a drop. */
|
|
1033
|
+
onReorder?: (rows: Row[], from: number, to: number) => void;
|
|
1034
|
+
/** Commit handler for inline cell edits (enable per column with `editable`). */
|
|
1035
|
+
onCellEdit?: (row: Row, columnKey: string, value: any) => void;
|
|
1036
|
+
/** Optional toolbar title (left side). */
|
|
1037
|
+
title?: ReactNode;
|
|
1038
|
+
/** Custom toolbar content (right side, before Export). */
|
|
1039
|
+
toolbar?: ReactNode;
|
|
1040
|
+
/** Show an "Export CSV" button. Pass { filename, selectedOnly } to configure. */
|
|
1041
|
+
exportable?: boolean | {
|
|
1042
|
+
filename?: string;
|
|
1043
|
+
selectedOnly?: boolean;
|
|
1044
|
+
};
|
|
1045
|
+
/** Render bulk actions in a bar shown while rows are selected. */
|
|
1046
|
+
selectionActions?: (selectedRows: Row[], clear: () => void) => ReactNode;
|
|
1047
|
+
/** Make rows clickable. */
|
|
1048
|
+
onRowClick?: (row: Row) => void;
|
|
1049
|
+
/** Make rows navigate to a URL. */
|
|
1050
|
+
rowHref?: (row: Row) => string;
|
|
1051
|
+
/** Shimmer skeleton rows. */
|
|
1052
|
+
loading?: boolean;
|
|
1053
|
+
loadingRows?: number;
|
|
1054
|
+
/** Custom empty-state node. */
|
|
1055
|
+
empty?: ReactNode;
|
|
1056
|
+
/** Caption above the table. */
|
|
1057
|
+
caption?: ReactNode;
|
|
1058
|
+
/** Footer row content (spans all columns). */
|
|
1059
|
+
footer?: ReactNode;
|
|
1060
|
+
style?: CSSProperties;
|
|
1061
|
+
}
|
|
1062
|
+
/**
|
|
1063
|
+
* Klun UI Table — full data-grid: sortable/filterable columns, selection,
|
|
1064
|
+
* pagination, expandable & tree rows, density/zebra/sticky, fixed columns,
|
|
1065
|
+
* inline editing, drag resize/reorder, CSV export, copy & context menu.
|
|
1066
|
+
*/
|
|
1067
|
+
declare function Table<Row = any>({ columns, rows, getRowId, selectable, selected, onSelectRow, onSelectAll, sortable, sort, onSortChange, defaultSort, filters, onFiltersChange, pagination, expandable, density, zebra, stickyHeader, hover, bordered, selectionType, rowStatus, summary, contextMenu, copyable, onCopy, resizable, tree, childrenKey, indentSize, defaultExpandedRowKeys, columnSettings, rowDraggable, onReorder, onCellEdit, title, toolbar, exportable, selectionActions, onRowClick, rowHref, loading, loadingRows, empty, caption, footer, className, style, ...props }: TableProps<Row>): react.JSX.Element;
|
|
1068
|
+
|
|
1069
|
+
interface TagProps extends HTMLAttributes<HTMLSpanElement> {
|
|
1070
|
+
leadingIcon?: ReactNode;
|
|
1071
|
+
/** Show a dismiss (×) button; receives the click handler. */
|
|
1072
|
+
onDismiss?: () => void;
|
|
1073
|
+
variant?: "stroke" | "gray";
|
|
1074
|
+
disabled?: boolean;
|
|
1075
|
+
children?: ReactNode;
|
|
1076
|
+
}
|
|
1077
|
+
/**
|
|
1078
|
+
* Tag — rounded-rectangle label, optionally dismissible.
|
|
1079
|
+
*/
|
|
1080
|
+
declare const Tag: react.ForwardRefExoticComponent<TagProps & react.RefAttributes<HTMLSpanElement>>;
|
|
1081
|
+
|
|
1082
|
+
interface TimelineItem {
|
|
1083
|
+
/** Token color name or any CSS color for the node. */
|
|
1084
|
+
color?: "primary" | "gray" | "success" | "error" | "warning" | "information" | (string & {});
|
|
1085
|
+
/** Custom dot node (e.g. an icon) replacing the ring. */
|
|
1086
|
+
dot?: ReactNode;
|
|
1087
|
+
label?: ReactNode;
|
|
1088
|
+
time?: ReactNode;
|
|
1089
|
+
children: ReactNode;
|
|
1090
|
+
}
|
|
1091
|
+
interface TimelineProps extends HTMLAttributes<HTMLDivElement> {
|
|
1092
|
+
items: TimelineItem[];
|
|
1093
|
+
mode?: "left" | "alternate";
|
|
1094
|
+
}
|
|
1095
|
+
/**
|
|
1096
|
+
* Timeline — vertical sequence of events with colored nodes. Each item carries a
|
|
1097
|
+
* `color` (token name or any CSS color), an optional custom `dot`, a `label`,
|
|
1098
|
+
* a `time`, and body `children`. `mode="alternate"` flips odd rows to the right.
|
|
1099
|
+
*/
|
|
1100
|
+
declare const Timeline: react.ForwardRefExoticComponent<TimelineProps & react.RefAttributes<HTMLDivElement>>;
|
|
1101
|
+
|
|
1102
|
+
interface TooltipProps {
|
|
1103
|
+
content: ReactNode;
|
|
1104
|
+
side?: "top" | "bottom" | "left" | "right";
|
|
1105
|
+
/** Hover-in delay in ms before showing. Default 200. */
|
|
1106
|
+
delay?: number;
|
|
1107
|
+
/** Suppress the tooltip entirely. */
|
|
1108
|
+
disabled?: boolean;
|
|
1109
|
+
children: ReactNode;
|
|
1110
|
+
/** Style applied to the tooltip bubble. */
|
|
1111
|
+
style?: CSSProperties;
|
|
1112
|
+
/** Class applied to the wrapper. */
|
|
1113
|
+
className?: string;
|
|
1114
|
+
}
|
|
1115
|
+
/**
|
|
1116
|
+
* Tooltip — hover label wrapping a single trigger child. `style` targets the
|
|
1117
|
+
* tooltip bubble; `side` chooses placement. `ref` forwards to the wrapper.
|
|
1118
|
+
*/
|
|
1119
|
+
declare const Tooltip: react.ForwardRefExoticComponent<TooltipProps & react.RefAttributes<HTMLSpanElement>>;
|
|
1120
|
+
|
|
1121
|
+
interface TreeNode {
|
|
1122
|
+
key: string;
|
|
1123
|
+
title: ReactNode;
|
|
1124
|
+
icon?: ReactNode;
|
|
1125
|
+
disabled?: boolean;
|
|
1126
|
+
children?: TreeNode[];
|
|
1127
|
+
}
|
|
1128
|
+
interface TreeProps extends Omit<HTMLAttributes<HTMLDivElement>, "onSelect"> {
|
|
1129
|
+
treeData: TreeNode[];
|
|
1130
|
+
expandedKeys?: string[];
|
|
1131
|
+
defaultExpandedKeys?: string[];
|
|
1132
|
+
onExpand?: (keys: string[]) => void;
|
|
1133
|
+
selectedKey?: string;
|
|
1134
|
+
onSelect?: (key: string, node: TreeNode) => void;
|
|
1135
|
+
checkable?: boolean;
|
|
1136
|
+
checkedKeys?: string[];
|
|
1137
|
+
onCheck?: (keys: string[]) => void;
|
|
1138
|
+
showLine?: boolean;
|
|
1139
|
+
/** Make the whole row the click target. Default true. */
|
|
1140
|
+
blockNode?: boolean;
|
|
1141
|
+
}
|
|
1142
|
+
/**
|
|
1143
|
+
* Klun UI Tree — hierarchical list with expand/collapse, single-select and
|
|
1144
|
+
* optional checkboxes (with parent/child cascade). Controlled via
|
|
1145
|
+
* expandedKeys / selectedKey / checkedKeys + their onChange callbacks.
|
|
1146
|
+
* `treeData`: [{ key, title, icon?, disabled?, children? }]
|
|
1147
|
+
*/
|
|
1148
|
+
declare const Tree: react.ForwardRefExoticComponent<TreeProps & react.RefAttributes<HTMLDivElement>>;
|
|
1149
|
+
|
|
1150
|
+
interface AccordionItem {
|
|
1151
|
+
id: string;
|
|
1152
|
+
title: ReactNode;
|
|
1153
|
+
content: ReactNode;
|
|
1154
|
+
icon?: ReactNode;
|
|
1155
|
+
}
|
|
1156
|
+
interface AccordionProps extends HTMLAttributes<HTMLDivElement> {
|
|
1157
|
+
items: AccordionItem[];
|
|
1158
|
+
defaultOpen?: string;
|
|
1159
|
+
/** Allow multiple panels open at once. */
|
|
1160
|
+
multiple?: boolean;
|
|
1161
|
+
}
|
|
1162
|
+
/** Klun UI Accordion — stacked expandable panels. */
|
|
1163
|
+
declare const Accordion: react.ForwardRefExoticComponent<AccordionProps & react.RefAttributes<HTMLDivElement>>;
|
|
1164
|
+
|
|
1165
|
+
type AlertStatus = "information" | "success" | "warning" | "error" | "feature";
|
|
1166
|
+
type AlertVariant = "filled" | "light" | "lighter" | "stroke";
|
|
1167
|
+
interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
1168
|
+
/** Status color. Default `"information"`. */
|
|
1169
|
+
status?: AlertStatus;
|
|
1170
|
+
/** Surface style. Default `"lighter"`. */
|
|
1171
|
+
variant?: AlertVariant;
|
|
1172
|
+
/** Leading icon node. */
|
|
1173
|
+
icon?: ReactNode;
|
|
1174
|
+
/** Title line. */
|
|
1175
|
+
title?: ReactNode;
|
|
1176
|
+
/** Action row rendered below the body. */
|
|
1177
|
+
action?: ReactNode;
|
|
1178
|
+
/** Renders a dismiss button when provided. */
|
|
1179
|
+
onClose?: () => void;
|
|
1180
|
+
children?: ReactNode;
|
|
1181
|
+
}
|
|
1182
|
+
/**
|
|
1183
|
+
* Alert — inline message block. Pick a `status` (color) and a `variant`
|
|
1184
|
+
* (filled / light / lighter / stroke surface).
|
|
1185
|
+
*/
|
|
1186
|
+
declare const Alert: react.ForwardRefExoticComponent<AlertProps & react.RefAttributes<HTMLDivElement>>;
|
|
1187
|
+
|
|
1188
|
+
type BannerStatus = "information" | "success" | "warning" | "error" | "feature";
|
|
1189
|
+
type BannerVariant = "filled" | "lighter";
|
|
1190
|
+
interface BannerProps extends HTMLAttributes<HTMLDivElement> {
|
|
1191
|
+
/** Status color. Default `"information"`. */
|
|
1192
|
+
status?: BannerStatus;
|
|
1193
|
+
/** Surface style. Default `"filled"`. */
|
|
1194
|
+
variant?: BannerVariant;
|
|
1195
|
+
/** Leading icon node. */
|
|
1196
|
+
icon?: ReactNode;
|
|
1197
|
+
/** Trailing action node. */
|
|
1198
|
+
action?: ReactNode;
|
|
1199
|
+
/** Renders a dismiss button when provided. */
|
|
1200
|
+
onClose?: () => void;
|
|
1201
|
+
children?: ReactNode;
|
|
1202
|
+
}
|
|
1203
|
+
/** Banner — full-width page-level announcement bar. */
|
|
1204
|
+
declare const Banner: react.ForwardRefExoticComponent<BannerProps & react.RefAttributes<HTMLDivElement>>;
|
|
1205
|
+
|
|
1206
|
+
type CircularProgressColor = "primary" | "success" | "warning" | "error";
|
|
1207
|
+
interface CircularProgressProps extends Omit<HTMLAttributes<HTMLDivElement>, "style"> {
|
|
1208
|
+
value?: number;
|
|
1209
|
+
max?: number;
|
|
1210
|
+
size?: number;
|
|
1211
|
+
stroke?: number;
|
|
1212
|
+
color?: CircularProgressColor;
|
|
1213
|
+
label?: ReactNode;
|
|
1214
|
+
style?: CSSProperties;
|
|
1215
|
+
}
|
|
1216
|
+
/** Klun UI CircularProgress — ring progress with optional center label. */
|
|
1217
|
+
declare const CircularProgress: react.ForwardRefExoticComponent<CircularProgressProps & react.RefAttributes<HTMLDivElement>>;
|
|
1218
|
+
|
|
1219
|
+
type GaugeBarColor = "gray" | "blue" | "orange" | "red" | "green" | "purple" | "yellow" | "teal" | "sky" | "pink";
|
|
1220
|
+
type GaugeBarSize = "sm" | "md" | "lg";
|
|
1221
|
+
interface GaugeBarProps extends Omit<HTMLAttributes<HTMLDivElement>, "color"> {
|
|
1222
|
+
value?: number;
|
|
1223
|
+
max?: number;
|
|
1224
|
+
label?: ReactNode;
|
|
1225
|
+
/** Override the auto "value / max" caption; pass false-y string to customize. */
|
|
1226
|
+
caption?: ReactNode;
|
|
1227
|
+
color?: GaugeBarColor;
|
|
1228
|
+
size?: GaugeBarSize;
|
|
1229
|
+
showValue?: boolean;
|
|
1230
|
+
}
|
|
1231
|
+
/** Klun UI GaugeBar — labeled usage meter (used / total) with a value caption. */
|
|
1232
|
+
declare const GaugeBar: react.ForwardRefExoticComponent<GaugeBarProps & react.RefAttributes<HTMLDivElement>>;
|
|
1233
|
+
|
|
1234
|
+
type MessageStatus = "info" | "success" | "warning" | "error" | "loading";
|
|
1235
|
+
interface MessageProps extends HTMLAttributes<HTMLDivElement> {
|
|
1236
|
+
status?: MessageStatus;
|
|
1237
|
+
/** Override the status icon (Remix icon class). */
|
|
1238
|
+
icon?: string;
|
|
1239
|
+
children?: ReactNode;
|
|
1240
|
+
}
|
|
1241
|
+
interface MessageOptions {
|
|
1242
|
+
content?: ReactNode;
|
|
1243
|
+
status?: MessageStatus;
|
|
1244
|
+
icon?: string;
|
|
1245
|
+
/** ms before auto-close; null (or loading) keeps it open. Default 3000. */
|
|
1246
|
+
duration?: number | null;
|
|
1247
|
+
/** Stable key — re-opening updates the existing message (loading → done). */
|
|
1248
|
+
key?: string | number;
|
|
1249
|
+
}
|
|
1250
|
+
interface MessageApi {
|
|
1251
|
+
open: (opts: MessageOptions | string) => string | number;
|
|
1252
|
+
close: (key: string | number) => void;
|
|
1253
|
+
info: (opts: MessageOptions | string) => string | number;
|
|
1254
|
+
success: (opts: MessageOptions | string) => string | number;
|
|
1255
|
+
warning: (opts: MessageOptions | string) => string | number;
|
|
1256
|
+
error: (opts: MessageOptions | string) => string | number;
|
|
1257
|
+
loading: (opts: MessageOptions | string) => string | number;
|
|
1258
|
+
}
|
|
1259
|
+
interface UseMessageDefaults {
|
|
1260
|
+
top?: number;
|
|
1261
|
+
duration?: number;
|
|
1262
|
+
max?: number;
|
|
1263
|
+
}
|
|
1264
|
+
/**
|
|
1265
|
+
* Message — compact single-line status pill (presentational). Pick a `status`
|
|
1266
|
+
* (info / success / warning / error / loading) for the icon + tint. Pair with
|
|
1267
|
+
* `useMessage` for the top-center transient message system.
|
|
1268
|
+
*/
|
|
1269
|
+
declare const Message: react.ForwardRefExoticComponent<MessageProps & react.RefAttributes<HTMLDivElement>>;
|
|
1270
|
+
/**
|
|
1271
|
+
* useMessage — antd-style top-center transient messages. Returns `[api, holder]`;
|
|
1272
|
+
* render `{holder}` once, then call `api.success("Saved")` etc. Each option may be
|
|
1273
|
+
* a string or `{ content, status?, icon?, duration?, key? }`.
|
|
1274
|
+
*/
|
|
1275
|
+
declare function useMessage(defaults?: UseMessageDefaults): [MessageApi, ReactNode];
|
|
1276
|
+
|
|
1277
|
+
type NotificationStatus = "default" | "information" | "success" | "warning" | "error" | "loading";
|
|
1278
|
+
interface NotificationProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
1279
|
+
status?: NotificationStatus;
|
|
1280
|
+
/** Override the status icon (Remix icon class). */
|
|
1281
|
+
icon?: string;
|
|
1282
|
+
title?: ReactNode;
|
|
1283
|
+
description?: ReactNode;
|
|
1284
|
+
/** Action buttons row. */
|
|
1285
|
+
actions?: ReactNode;
|
|
1286
|
+
closable?: boolean;
|
|
1287
|
+
onClose?: () => void;
|
|
1288
|
+
/** When set (ms), shows an auto-dismiss progress bar. */
|
|
1289
|
+
duration?: number;
|
|
1290
|
+
}
|
|
1291
|
+
/**
|
|
1292
|
+
* Klun UI Notification — corner notification card (presentational). Pair with
|
|
1293
|
+
* `useNotification` for the stacked, auto-dismissing system, or render alone.
|
|
1294
|
+
*/
|
|
1295
|
+
declare const Notification: react.ForwardRefExoticComponent<NotificationProps & react.RefAttributes<HTMLDivElement>>;
|
|
1296
|
+
type NotificationPlacement = "topRight" | "topLeft" | "bottomRight" | "bottomLeft" | "top" | "bottom";
|
|
1297
|
+
interface NotificationOptions {
|
|
1298
|
+
title?: ReactNode;
|
|
1299
|
+
description?: ReactNode;
|
|
1300
|
+
status?: NotificationStatus;
|
|
1301
|
+
icon?: string;
|
|
1302
|
+
/** ms before auto-close; null to keep open. Defaults to the hook duration. */
|
|
1303
|
+
duration?: number | null;
|
|
1304
|
+
actions?: ReactNode;
|
|
1305
|
+
closable?: boolean;
|
|
1306
|
+
/** Stable key — re-opening with the same key updates the existing toast. */
|
|
1307
|
+
key?: string | number;
|
|
1308
|
+
onClose?: () => void;
|
|
1309
|
+
}
|
|
1310
|
+
interface NotificationApi {
|
|
1311
|
+
open: (opts: NotificationOptions) => string | number;
|
|
1312
|
+
close: (key: string | number) => void;
|
|
1313
|
+
success: (opts: NotificationOptions | string) => string | number;
|
|
1314
|
+
error: (opts: NotificationOptions | string) => string | number;
|
|
1315
|
+
warning: (opts: NotificationOptions | string) => string | number;
|
|
1316
|
+
info: (opts: NotificationOptions | string) => string | number;
|
|
1317
|
+
loading: (opts: NotificationOptions | string) => string | number;
|
|
1318
|
+
}
|
|
1319
|
+
interface UseNotificationDefaults {
|
|
1320
|
+
placement?: NotificationPlacement;
|
|
1321
|
+
/** Default auto-dismiss in ms. Default 4500. */
|
|
1322
|
+
duration?: number;
|
|
1323
|
+
/** Max concurrent toasts before the oldest is dropped. Default 5. */
|
|
1324
|
+
max?: number;
|
|
1325
|
+
}
|
|
1326
|
+
/**
|
|
1327
|
+
* Klun UI useNotification — antd-style imperative API.
|
|
1328
|
+
* Returns [api, holder]; render {holder} once, then call api.success(opts) etc.
|
|
1329
|
+
* Each opts: { title, description, status?, icon?, duration?, actions?, closable?, key?, onClose? }.
|
|
1330
|
+
*/
|
|
1331
|
+
declare function useNotification(defaults?: UseNotificationDefaults): [NotificationApi, ReactNode];
|
|
1332
|
+
|
|
1333
|
+
type ProgressColor = "primary" | "success" | "warning" | "error";
|
|
1334
|
+
interface ProgressBarProps extends HTMLAttributes<HTMLDivElement> {
|
|
1335
|
+
value?: number;
|
|
1336
|
+
max?: number;
|
|
1337
|
+
color?: ProgressColor;
|
|
1338
|
+
}
|
|
1339
|
+
/** Klun UI ProgressBar — horizontal determinate progress track. */
|
|
1340
|
+
declare const ProgressBar: react.ForwardRefExoticComponent<ProgressBarProps & react.RefAttributes<HTMLDivElement>>;
|
|
1341
|
+
|
|
1342
|
+
type SegmentedProgressColor = "primary" | "success" | "warning" | "error";
|
|
1343
|
+
interface SegmentedProgressProps extends HTMLAttributes<HTMLDivElement> {
|
|
1344
|
+
/** Number of filled segments. */
|
|
1345
|
+
value?: number;
|
|
1346
|
+
segments?: number;
|
|
1347
|
+
color?: SegmentedProgressColor;
|
|
1348
|
+
}
|
|
1349
|
+
/** Klun UI SegmentedProgress — multi-segment bar (strength meters, steps). */
|
|
1350
|
+
declare const SegmentedProgress: react.ForwardRefExoticComponent<SegmentedProgressProps & react.RefAttributes<HTMLDivElement>>;
|
|
1351
|
+
|
|
1352
|
+
interface SkeletonProps extends Omit<HTMLAttributes<HTMLSpanElement>, "style"> {
|
|
1353
|
+
width?: number | string;
|
|
1354
|
+
height?: number | string;
|
|
1355
|
+
circle?: boolean;
|
|
1356
|
+
style?: CSSProperties;
|
|
1357
|
+
}
|
|
1358
|
+
/** Klun UI Skeleton — shimmering loading placeholder. */
|
|
1359
|
+
declare const Skeleton: react.ForwardRefExoticComponent<SkeletonProps & react.RefAttributes<HTMLSpanElement>>;
|
|
1360
|
+
|
|
1361
|
+
type SpinnerSize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
1362
|
+
interface SpinnerProps extends Omit<HTMLAttributes<HTMLSpanElement>, "color"> {
|
|
1363
|
+
/** Named size or pixel number. */
|
|
1364
|
+
size?: SpinnerSize | number;
|
|
1365
|
+
/** Stroke width override. */
|
|
1366
|
+
thickness?: number;
|
|
1367
|
+
/** Arc color (defaults to currentColor). */
|
|
1368
|
+
color?: string;
|
|
1369
|
+
/** Track ring color behind the arc. */
|
|
1370
|
+
track?: string;
|
|
1371
|
+
/** Accessible label. */
|
|
1372
|
+
label?: string;
|
|
1373
|
+
}
|
|
1374
|
+
/**
|
|
1375
|
+
* Spinner — indeterminate loading indicator. Inherits `currentColor` by default
|
|
1376
|
+
* so it tints to its surrounding text/button color.
|
|
1377
|
+
*/
|
|
1378
|
+
declare const Spinner: react.ForwardRefExoticComponent<SpinnerProps & react.RefAttributes<HTMLSpanElement>>;
|
|
1379
|
+
|
|
1380
|
+
type ToastStatus = "information" | "success" | "warning" | "error";
|
|
1381
|
+
interface ToastProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
1382
|
+
/** Status color of the icon badge. Default `"success"`. */
|
|
1383
|
+
status?: ToastStatus;
|
|
1384
|
+
/** Icon node rendered in the badge. */
|
|
1385
|
+
icon?: ReactNode;
|
|
1386
|
+
/** Title line. */
|
|
1387
|
+
title?: ReactNode;
|
|
1388
|
+
/** Action row rendered below the body. */
|
|
1389
|
+
action?: ReactNode;
|
|
1390
|
+
/** Renders a dismiss button when provided. */
|
|
1391
|
+
onClose?: () => void;
|
|
1392
|
+
/** Tint the whole card by status (not just the icon badge). */
|
|
1393
|
+
rich?: boolean;
|
|
1394
|
+
children?: ReactNode;
|
|
1395
|
+
}
|
|
1396
|
+
/** Toast — transient notification card (presentational). */
|
|
1397
|
+
declare const Toast: react.ForwardRefExoticComponent<ToastProps & react.RefAttributes<HTMLDivElement>>;
|
|
1398
|
+
|
|
1399
|
+
type ToastPosition = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
1400
|
+
/** Convenience action — rendered as a button that runs `onClick` and dismisses. */
|
|
1401
|
+
interface ToastAction {
|
|
1402
|
+
label: ReactNode;
|
|
1403
|
+
onClick?: () => void;
|
|
1404
|
+
/** Dismiss the toast after the action runs. Default `true`. */
|
|
1405
|
+
dismiss?: boolean;
|
|
1406
|
+
}
|
|
1407
|
+
interface ToastOptions {
|
|
1408
|
+
/** Stable id. Calling `toast` again with the same id updates that toast. */
|
|
1409
|
+
id?: string | number;
|
|
1410
|
+
/** Title line shown above the message. */
|
|
1411
|
+
title?: ReactNode;
|
|
1412
|
+
/** Status color + default icon. Default `"information"`. */
|
|
1413
|
+
status?: ToastStatus;
|
|
1414
|
+
/** Override the default status icon. */
|
|
1415
|
+
icon?: ReactNode;
|
|
1416
|
+
/** ms before auto-dismiss. `0` / `Infinity` keep it until dismissed. */
|
|
1417
|
+
duration?: number;
|
|
1418
|
+
/** Action row — a node, or `{ label, onClick }` rendered as a button that dismisses on click. */
|
|
1419
|
+
action?: ReactNode | ToastAction;
|
|
1420
|
+
/** Tint the whole card by status. Overrides the Toaster's `richColors`. */
|
|
1421
|
+
rich?: boolean;
|
|
1422
|
+
}
|
|
1423
|
+
interface ToastPromiseMessages<T> {
|
|
1424
|
+
loading: ReactNode;
|
|
1425
|
+
success: ReactNode | ((data: T) => ReactNode);
|
|
1426
|
+
error: ReactNode | ((err: unknown) => ReactNode);
|
|
1427
|
+
}
|
|
1428
|
+
type ToastFn = (message: ReactNode, opts?: ToastOptions) => string | number;
|
|
1429
|
+
/**
|
|
1430
|
+
* Imperative toast API — call from anywhere (`toast("Saved")`,
|
|
1431
|
+
* `toast.success(...)`, `toast.dismiss(id)`). Render a single `<Toaster />`
|
|
1432
|
+
* near the app root to display them.
|
|
1433
|
+
*/
|
|
1434
|
+
declare const toast: ToastFn & {
|
|
1435
|
+
success: ToastFn;
|
|
1436
|
+
error: ToastFn;
|
|
1437
|
+
warning: ToastFn;
|
|
1438
|
+
info: ToastFn;
|
|
1439
|
+
/** Dismiss one toast by id, or all when called with no argument. */
|
|
1440
|
+
dismiss: (id?: string | number) => void;
|
|
1441
|
+
/** Show a loading toast that updates to success/error when the promise settles. */
|
|
1442
|
+
promise: <T>(p: Promise<T>, msgs: ToastPromiseMessages<T>, opts?: ToastOptions) => Promise<T>;
|
|
1443
|
+
};
|
|
1444
|
+
interface ToasterProps {
|
|
1445
|
+
/** Corner the stack is anchored to. Default `"bottom-right"`. */
|
|
1446
|
+
position?: ToastPosition;
|
|
1447
|
+
/** Default auto-dismiss duration (ms) for toasts that don't set their own. Default `4000`. */
|
|
1448
|
+
duration?: number;
|
|
1449
|
+
/** Max toasts shown at once; extras queue and appear as visible ones leave. */
|
|
1450
|
+
max?: number;
|
|
1451
|
+
/** Tint every toast card by status (per-toast `rich` overrides this). */
|
|
1452
|
+
richColors?: boolean;
|
|
1453
|
+
/** Space between stacked toasts, px. Default `12`. */
|
|
1454
|
+
gap?: number;
|
|
1455
|
+
/** Distance from the viewport edge, px. Default `16`. */
|
|
1456
|
+
offset?: number;
|
|
1457
|
+
className?: string;
|
|
1458
|
+
style?: CSSProperties;
|
|
1459
|
+
}
|
|
1460
|
+
/**
|
|
1461
|
+
* Toaster — renders the active toasts in a fixed, portaled stack. Mount it once
|
|
1462
|
+
* (inside your ConfigProvider, so toasts inherit its locale/theme/dir). Toasts
|
|
1463
|
+
* auto-dismiss after their `duration` and pause while the pointer is over the stack.
|
|
1464
|
+
*/
|
|
1465
|
+
declare function Toaster({ position, duration, max, richColors, gap, offset, className, style, }: ToasterProps): react.ReactPortal | null;
|
|
1466
|
+
declare namespace Toaster {
|
|
1467
|
+
var displayName: string;
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1470
|
+
interface AutoCompleteOption {
|
|
1471
|
+
value: string;
|
|
1472
|
+
label?: ReactNode;
|
|
1473
|
+
icon?: ReactNode;
|
|
1474
|
+
description?: ReactNode;
|
|
1475
|
+
}
|
|
1476
|
+
interface AutoCompleteProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "onSelect"> {
|
|
1477
|
+
options: (AutoCompleteOption | string)[];
|
|
1478
|
+
value?: string;
|
|
1479
|
+
onChange?: (value: string) => void;
|
|
1480
|
+
onSelect?: (value: string, option: AutoCompleteOption) => void;
|
|
1481
|
+
placeholder?: string;
|
|
1482
|
+
size?: "small" | "medium" | "large";
|
|
1483
|
+
disabled?: boolean;
|
|
1484
|
+
/** Filter options by the typed text (default true). Set false for async lists. */
|
|
1485
|
+
filter?: boolean;
|
|
1486
|
+
leadingIcon?: ReactNode;
|
|
1487
|
+
emptyText?: ReactNode;
|
|
1488
|
+
maxVisible?: number;
|
|
1489
|
+
}
|
|
1490
|
+
/**
|
|
1491
|
+
* AutoComplete — text input with a filtered suggestion dropdown + keyboard nav.
|
|
1492
|
+
* `className`/`style` target the root wrapper; `ref` forwards to the `<input>`.
|
|
1493
|
+
*/
|
|
1494
|
+
declare const AutoComplete: react.ForwardRefExoticComponent<AutoCompleteProps & react.RefAttributes<HTMLInputElement>>;
|
|
1495
|
+
|
|
1496
|
+
interface CascaderOption {
|
|
1497
|
+
value: string;
|
|
1498
|
+
label: ReactNode;
|
|
1499
|
+
disabled?: boolean;
|
|
1500
|
+
children?: CascaderOption[];
|
|
1501
|
+
}
|
|
1502
|
+
interface CascaderProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
1503
|
+
options: CascaderOption[];
|
|
1504
|
+
value?: string[];
|
|
1505
|
+
onChange?: (path: string[]) => void;
|
|
1506
|
+
placeholder?: string;
|
|
1507
|
+
size?: "small" | "medium" | "large";
|
|
1508
|
+
disabled?: boolean;
|
|
1509
|
+
error?: boolean;
|
|
1510
|
+
/** Joins the label path in the trigger. */
|
|
1511
|
+
separator?: string;
|
|
1512
|
+
/** Emit onChange on every level, not just leaves. */
|
|
1513
|
+
changeOnSelect?: boolean;
|
|
1514
|
+
}
|
|
1515
|
+
/**
|
|
1516
|
+
* Cascader — multi-column drill-down selector for hierarchical data
|
|
1517
|
+
* (region, category…). Controlled via `value` (array of keys) / `onChange`.
|
|
1518
|
+
* `options`: [{ value, label, disabled?, children? }]. `ref` forwards to the root.
|
|
1519
|
+
*/
|
|
1520
|
+
declare const Cascader: react.ForwardRefExoticComponent<CascaderProps & react.RefAttributes<HTMLDivElement>>;
|
|
1521
|
+
|
|
1522
|
+
interface CharacterCounterProps extends HTMLAttributes<HTMLSpanElement> {
|
|
1523
|
+
/** Current character count. Default `0`. */
|
|
1524
|
+
value?: number;
|
|
1525
|
+
/** Maximum allowed count. Default `100`. */
|
|
1526
|
+
max?: number;
|
|
1527
|
+
}
|
|
1528
|
+
/**
|
|
1529
|
+
* CharacterCounter — "current / max" count that turns into an error tone once
|
|
1530
|
+
* the limit is exceeded. Pair under an Input or Textarea.
|
|
1531
|
+
*/
|
|
1532
|
+
declare const CharacterCounter: react.ForwardRefExoticComponent<CharacterCounterProps & react.RefAttributes<HTMLSpanElement>>;
|
|
1533
|
+
|
|
1534
|
+
type CheckboxSize = "small" | "medium" | "large";
|
|
1535
|
+
interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "onChange" | "type"> {
|
|
1536
|
+
checked?: boolean;
|
|
1537
|
+
indeterminate?: boolean;
|
|
1538
|
+
disabled?: boolean;
|
|
1539
|
+
/** Red error ring. */
|
|
1540
|
+
error?: boolean;
|
|
1541
|
+
size?: CheckboxSize;
|
|
1542
|
+
onChange?: (checked: boolean) => void;
|
|
1543
|
+
style?: CSSProperties;
|
|
1544
|
+
}
|
|
1545
|
+
/** Klun UI Checkbox — square boolean control with checked / indeterminate states. */
|
|
1546
|
+
declare const Checkbox: react.ForwardRefExoticComponent<CheckboxProps & react.RefAttributes<HTMLInputElement>>;
|
|
1547
|
+
|
|
1548
|
+
type CheckboxCardAlign = "start" | "center";
|
|
1549
|
+
interface CheckboxCardProps extends Omit<LabelHTMLAttributes<HTMLLabelElement>, "onChange" | "title"> {
|
|
1550
|
+
title?: ReactNode;
|
|
1551
|
+
description?: ReactNode;
|
|
1552
|
+
icon?: ReactNode;
|
|
1553
|
+
checked?: boolean;
|
|
1554
|
+
disabled?: boolean;
|
|
1555
|
+
onChange?: (checked: boolean) => void;
|
|
1556
|
+
/** Vertical alignment of the row. Default `"start"`. */
|
|
1557
|
+
align?: CheckboxCardAlign;
|
|
1558
|
+
children?: ReactNode;
|
|
1559
|
+
}
|
|
1560
|
+
/**
|
|
1561
|
+
* CheckboxCard — selectable bordered card wrapping a checkbox, title,
|
|
1562
|
+
* description and optional leading icon. Use in checkbox-group choice grids.
|
|
1563
|
+
* `ref` forwards to the `<input>`.
|
|
1564
|
+
*/
|
|
1565
|
+
declare const CheckboxCard: react.ForwardRefExoticComponent<CheckboxCardProps & react.RefAttributes<HTMLInputElement>>;
|
|
1566
|
+
|
|
1567
|
+
type ColorDotSize = "sm" | "md" | "lg";
|
|
1568
|
+
interface ColorDotProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "color"> {
|
|
1569
|
+
/** Any CSS color or token var() for the swatch fill. Default `var(--klun-primary-base)`. */
|
|
1570
|
+
color?: string;
|
|
1571
|
+
selected?: boolean;
|
|
1572
|
+
size?: ColorDotSize;
|
|
1573
|
+
disabled?: boolean;
|
|
1574
|
+
/** Show a white check when selected. Default `true`. */
|
|
1575
|
+
showCheck?: boolean;
|
|
1576
|
+
}
|
|
1577
|
+
/** ColorDot — selectable color swatch with a selected ring + check. */
|
|
1578
|
+
declare const ColorDot: react.ForwardRefExoticComponent<ColorDotProps & react.RefAttributes<HTMLButtonElement>>;
|
|
1579
|
+
|
|
1580
|
+
interface ColorPickerProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "style"> {
|
|
1581
|
+
/** Currently selected hex color. Default `"#335CFF"`. */
|
|
1582
|
+
value?: string;
|
|
1583
|
+
/** Called with the newly chosen hex color. */
|
|
1584
|
+
onChange?: (hex: string) => void;
|
|
1585
|
+
/** Swatch colors to render. */
|
|
1586
|
+
swatches?: string[];
|
|
1587
|
+
/** Style applied to the picker root. */
|
|
1588
|
+
style?: CSSProperties;
|
|
1589
|
+
}
|
|
1590
|
+
/** ColorPicker — swatch grid + hex input. */
|
|
1591
|
+
declare const ColorPicker: react.ForwardRefExoticComponent<ColorPickerProps & react.RefAttributes<HTMLDivElement>>;
|
|
1592
|
+
|
|
1593
|
+
type ColorSliderSize = "small" | "medium" | "large";
|
|
1594
|
+
interface ColorSliderProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
1595
|
+
/** Position 0–100. Default `50`. */
|
|
1596
|
+
value?: number;
|
|
1597
|
+
onChange?: (value: number) => void;
|
|
1598
|
+
/** "hue", "alpha", or a custom CSS gradient string for the track. Default `"hue"`. */
|
|
1599
|
+
track?: "hue" | "alpha" | string;
|
|
1600
|
+
/** Base color used by the alpha track. Default `var(--klun-primary-base)`. */
|
|
1601
|
+
color?: string;
|
|
1602
|
+
disabled?: boolean;
|
|
1603
|
+
/** Track size. Default `"medium"`. */
|
|
1604
|
+
size?: ColorSliderSize;
|
|
1605
|
+
}
|
|
1606
|
+
/**
|
|
1607
|
+
* ColorSlider — single-channel slider (hue, alpha or a custom gradient) with a
|
|
1608
|
+
* draggable thumb. Controlled via `value` (0–100) / `onChange`. `ref` forwards
|
|
1609
|
+
* to the track element.
|
|
1610
|
+
*/
|
|
1611
|
+
declare const ColorSlider: react.ForwardRefExoticComponent<ColorSliderProps & react.RefAttributes<HTMLDivElement>>;
|
|
1612
|
+
|
|
1613
|
+
type CompactSelectSize = "xsmall" | "small" | "medium";
|
|
1614
|
+
/** Visual chrome: bordered (stroke), borderless (ghost) or weak gray fill. */
|
|
1615
|
+
type CompactSelectAppearance = "stroke" | "ghost" | "weak";
|
|
1616
|
+
interface CompactSelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, "size" | "style"> {
|
|
1617
|
+
size?: CompactSelectSize;
|
|
1618
|
+
/** Visual chrome: bordered (stroke), borderless (ghost) or weak gray fill. */
|
|
1619
|
+
appearance?: CompactSelectAppearance;
|
|
1620
|
+
leadingIcon?: ReactNode;
|
|
1621
|
+
placeholder?: string;
|
|
1622
|
+
disabled?: boolean;
|
|
1623
|
+
/** <option> elements. */
|
|
1624
|
+
children?: ReactNode;
|
|
1625
|
+
/** Style applied to the outer wrapper. */
|
|
1626
|
+
style?: CSSProperties;
|
|
1627
|
+
}
|
|
1628
|
+
/**
|
|
1629
|
+
* CompactSelect — small toolbar/filter dropdown with a fully custom, themed
|
|
1630
|
+
* dropdown (not the native OS menu). Use for sort, period, density pickers.
|
|
1631
|
+
* Keeps the familiar `<option>` children API and native form semantics: a
|
|
1632
|
+
* visually-hidden `<select>` carries the value for form submission, receives
|
|
1633
|
+
* `name`/native `onChange`, and is what `ref` forwards to. Controlled via
|
|
1634
|
+
* `value` or uncontrolled via `defaultValue`. `className`/`style` target the
|
|
1635
|
+
* wrapper.
|
|
1636
|
+
*/
|
|
1637
|
+
declare const CompactSelect: react.ForwardRefExoticComponent<CompactSelectProps & react.RefAttributes<HTMLSelectElement>>;
|
|
1638
|
+
|
|
1639
|
+
type CompactSelectForInputSide = "leading" | "trailing";
|
|
1640
|
+
type CompactSelectForInputSize = "small" | "medium" | "large";
|
|
1641
|
+
interface CompactSelectForInputProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, "size" | "style"> {
|
|
1642
|
+
/** Which edge it attaches to — decides which side draws the divider. */
|
|
1643
|
+
side?: CompactSelectForInputSide;
|
|
1644
|
+
size?: CompactSelectForInputSize;
|
|
1645
|
+
leadingIcon?: ReactNode;
|
|
1646
|
+
disabled?: boolean;
|
|
1647
|
+
/** <option> elements. */
|
|
1648
|
+
children?: ReactNode;
|
|
1649
|
+
/** Style applied to the outer wrapper. */
|
|
1650
|
+
style?: CSSProperties;
|
|
1651
|
+
}
|
|
1652
|
+
/**
|
|
1653
|
+
* CompactSelectForInput — borderless inline unit selector designed to butt up
|
|
1654
|
+
* against an Input on the left or right (currency, country code, unit). Render
|
|
1655
|
+
* it inside an Input's leading/trailing slot; it draws its own divider. Uses a
|
|
1656
|
+
* fully custom, themed dropdown (not the native OS menu): a visually-hidden
|
|
1657
|
+
* `<select>` carries the value for form submission, receives `name`/native
|
|
1658
|
+
* `onChange`, and is what `ref` forwards to. The trigger always shows a value
|
|
1659
|
+
* (no placeholder) — the current selection or the first option.
|
|
1660
|
+
*/
|
|
1661
|
+
declare const CompactSelectForInput: react.ForwardRefExoticComponent<CompactSelectForInputProps & react.RefAttributes<HTMLSelectElement>>;
|
|
1662
|
+
|
|
1663
|
+
type CounterInputSize = "small" | "medium" | "large";
|
|
1664
|
+
interface CounterInputProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
1665
|
+
value?: number;
|
|
1666
|
+
min?: number;
|
|
1667
|
+
max?: number;
|
|
1668
|
+
step?: number;
|
|
1669
|
+
size?: CounterInputSize;
|
|
1670
|
+
onChange?: (value: number) => void;
|
|
1671
|
+
disabled?: boolean;
|
|
1672
|
+
/** Optional unit shown after the value, e.g. "kg". */
|
|
1673
|
+
suffix?: ReactNode;
|
|
1674
|
+
}
|
|
1675
|
+
/**
|
|
1676
|
+
* CounterInput — numeric stepper with decrement / increment controls.
|
|
1677
|
+
* `ref` forwards to the root wrapper.
|
|
1678
|
+
*/
|
|
1679
|
+
declare const CounterInput: react.ForwardRefExoticComponent<CounterInputProps & react.RefAttributes<HTMLDivElement>>;
|
|
1680
|
+
|
|
1681
|
+
interface DatePickerProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "style"> {
|
|
1682
|
+
value?: Date | string | null;
|
|
1683
|
+
onChange?: (date: Date) => void;
|
|
1684
|
+
style?: CSSProperties;
|
|
1685
|
+
}
|
|
1686
|
+
/** Klun UI DatePicker — inline month calendar with single-date selection. */
|
|
1687
|
+
declare const DatePicker: react.ForwardRefExoticComponent<DatePickerProps & react.RefAttributes<HTMLDivElement>>;
|
|
1688
|
+
|
|
1689
|
+
interface DateRange {
|
|
1690
|
+
start: Date | null;
|
|
1691
|
+
end: Date | null;
|
|
1692
|
+
}
|
|
1693
|
+
interface DateRangePickerProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "style"> {
|
|
1694
|
+
start?: Date | string | null;
|
|
1695
|
+
end?: Date | string | null;
|
|
1696
|
+
onChange?: (range: DateRange) => void;
|
|
1697
|
+
style?: CSSProperties;
|
|
1698
|
+
}
|
|
1699
|
+
/** Klun UI DateRangePicker — inline calendar selecting a start–end range. */
|
|
1700
|
+
declare const DateRangePicker: react.ForwardRefExoticComponent<DateRangePickerProps & react.RefAttributes<HTMLDivElement>>;
|
|
1701
|
+
|
|
1702
|
+
type DigitInputSize = "small" | "medium" | "large";
|
|
1703
|
+
interface DigitInputProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "style"> {
|
|
1704
|
+
length?: number;
|
|
1705
|
+
value?: string;
|
|
1706
|
+
onChange?: (value: string) => void;
|
|
1707
|
+
error?: boolean;
|
|
1708
|
+
disabled?: boolean;
|
|
1709
|
+
/** Cell size. Default `"medium"`. */
|
|
1710
|
+
size?: DigitInputSize;
|
|
1711
|
+
style?: CSSProperties;
|
|
1712
|
+
}
|
|
1713
|
+
/**
|
|
1714
|
+
* DigitInput — segmented OTP / PIN code input. Keeps a ref to each cell for
|
|
1715
|
+
* focus management; `ref` forwards to the wrapping `<div>`.
|
|
1716
|
+
*/
|
|
1717
|
+
declare const DigitInput: react.ForwardRefExoticComponent<DigitInputProps & react.RefAttributes<HTMLDivElement>>;
|
|
1718
|
+
|
|
1719
|
+
interface FileUploadProps extends Omit<HTMLAttributes<HTMLDivElement>, "style"> {
|
|
1720
|
+
/** Called with the dropped/selected files. */
|
|
1721
|
+
onFiles?: (files: File[]) => void;
|
|
1722
|
+
/** Helper text under the prompt. */
|
|
1723
|
+
hint?: ReactNode;
|
|
1724
|
+
/** Style applied to the dropzone root. */
|
|
1725
|
+
style?: CSSProperties;
|
|
1726
|
+
}
|
|
1727
|
+
/**
|
|
1728
|
+
* FileUpload — drag-and-drop drop zone. Click or drop files to upload;
|
|
1729
|
+
* `onFiles` receives the selected `File[]`. Drag-over state is exposed via
|
|
1730
|
+
* `data-dragover` and styled in CSS.
|
|
1731
|
+
*/
|
|
1732
|
+
declare const FileUpload: react.ForwardRefExoticComponent<FileUploadProps & react.RefAttributes<HTMLDivElement>>;
|
|
1733
|
+
|
|
1734
|
+
type NamePath = string | (string | number)[];
|
|
1735
|
+
interface FormRule {
|
|
1736
|
+
required?: boolean;
|
|
1737
|
+
message?: string;
|
|
1738
|
+
/** String length (or array length) bounds; for number/integer types these bound the value. */
|
|
1739
|
+
min?: number;
|
|
1740
|
+
max?: number;
|
|
1741
|
+
/** Exact string length. */
|
|
1742
|
+
len?: number;
|
|
1743
|
+
/** Reject whitespace-only strings. */
|
|
1744
|
+
whitespace?: boolean;
|
|
1745
|
+
pattern?: RegExp;
|
|
1746
|
+
/** Value must be one of these. */
|
|
1747
|
+
enum?: any[];
|
|
1748
|
+
type?: "email" | "url" | "number" | "integer";
|
|
1749
|
+
/** Normalize the value before checking (e.g. trim). */
|
|
1750
|
+
transform?: (value: any) => any;
|
|
1751
|
+
/** Sync (string|null) or async (Promise<string|null>) validator. Return a message to fail. */
|
|
1752
|
+
validator?: (value: any, allValues: Record<string, any>) => string | null | undefined | Promise<string | null | undefined>;
|
|
1753
|
+
}
|
|
1754
|
+
/** Rules may be a static array or computed from the current form values. */
|
|
1755
|
+
type Rules = FormRule[] | ((allValues: Record<string, any>) => FormRule[]);
|
|
1756
|
+
interface FormInstance {
|
|
1757
|
+
values: Record<string, any>;
|
|
1758
|
+
errors: Record<string, string | undefined>;
|
|
1759
|
+
touched: Record<string, boolean>;
|
|
1760
|
+
/** True while an async validator is running, keyed by field. */
|
|
1761
|
+
validating: Record<string, boolean>;
|
|
1762
|
+
setFieldValue: (name: NamePath, value: any) => void;
|
|
1763
|
+
setFieldTouched: (name: NamePath) => void;
|
|
1764
|
+
/** Imperatively set error messages: { [name]: message }. */
|
|
1765
|
+
setFields: (map: Record<string, string | undefined>) => void;
|
|
1766
|
+
setValues: (v: Record<string, any>) => void;
|
|
1767
|
+
getFieldValue: (name: NamePath) => any;
|
|
1768
|
+
getFieldsValue: () => Record<string, any>;
|
|
1769
|
+
/** Validate one field; resolves to its error message or null. */
|
|
1770
|
+
validateField: (name: NamePath) => Promise<string | null | undefined>;
|
|
1771
|
+
/** Validate all fields; resolves true when valid (scrolls to the first error). */
|
|
1772
|
+
validate: () => Promise<boolean>;
|
|
1773
|
+
/** Scroll to + focus a field. */
|
|
1774
|
+
scrollToField: (name: NamePath) => void;
|
|
1775
|
+
reset: () => void;
|
|
1776
|
+
/** @deprecated use FormItem rules; kept for back-compat. */
|
|
1777
|
+
registerRules: (name: NamePath, rules: FormRule[]) => void;
|
|
1778
|
+
}
|
|
1779
|
+
interface UseFormOptions {
|
|
1780
|
+
initialValues?: Record<string, any>;
|
|
1781
|
+
}
|
|
1782
|
+
interface FormProps extends Omit<FormHTMLAttributes<HTMLFormElement>, "onSubmit"> {
|
|
1783
|
+
form: FormInstance;
|
|
1784
|
+
onFinish?: (values: Record<string, any>) => void;
|
|
1785
|
+
onFinishFailed?: (errors: Record<string, string | undefined>) => void;
|
|
1786
|
+
layout?: "vertical" | "horizontal";
|
|
1787
|
+
children?: ReactNode;
|
|
1788
|
+
}
|
|
1789
|
+
interface FormItemProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
1790
|
+
/** Field name; string, dotted path ("user.email"), array path, or a numeric
|
|
1791
|
+
* index when used inside a `FormList` render (relative to the list). */
|
|
1792
|
+
name?: NamePath | number;
|
|
1793
|
+
label?: ReactNode;
|
|
1794
|
+
rules?: Rules;
|
|
1795
|
+
required?: boolean;
|
|
1796
|
+
/** Re-validate this field when any of these fields change (after it's been touched). */
|
|
1797
|
+
dependencies?: NamePath[];
|
|
1798
|
+
/** When to validate this field. Default "onChange". */
|
|
1799
|
+
validateTrigger?: "onChange" | "onBlur";
|
|
1800
|
+
/** Helper text shown when there's no error. */
|
|
1801
|
+
help?: ReactNode;
|
|
1802
|
+
/** A single control; receives value/onChange/error cloned in. */
|
|
1803
|
+
children?: ReactElement;
|
|
1804
|
+
}
|
|
1805
|
+
interface FormListField {
|
|
1806
|
+
key: string;
|
|
1807
|
+
name: number;
|
|
1808
|
+
path: (string | number)[];
|
|
1809
|
+
}
|
|
1810
|
+
interface FormListOperations {
|
|
1811
|
+
add: (defaultValue?: any) => void;
|
|
1812
|
+
remove: (index: number) => void;
|
|
1813
|
+
move: (from: number, to: number) => void;
|
|
1814
|
+
}
|
|
1815
|
+
interface FormListProps {
|
|
1816
|
+
name: NamePath;
|
|
1817
|
+
children: (fields: FormListField[], ops: FormListOperations) => ReactNode;
|
|
1818
|
+
}
|
|
1819
|
+
/**
|
|
1820
|
+
* Klun UI useForm — antd-grade form store: nested name paths, async + dependency
|
|
1821
|
+
* validation, per-field triggers, dynamic lists, and scroll-to-error.
|
|
1822
|
+
*/
|
|
1823
|
+
declare function useForm(opts?: UseFormOptions): FormInstance;
|
|
1824
|
+
/**
|
|
1825
|
+
* Klun UI Form — layout + validation container. Async submit aware.
|
|
1826
|
+
*/
|
|
1827
|
+
declare function Form({ form, onFinish, onFinishFailed, layout, children, className, ...props }: FormProps): react.JSX.Element;
|
|
1828
|
+
declare namespace Form {
|
|
1829
|
+
var displayName: string;
|
|
1830
|
+
var useForm: typeof useForm;
|
|
1831
|
+
var Item: typeof FormItem;
|
|
1832
|
+
var List: typeof FormList;
|
|
1833
|
+
}
|
|
1834
|
+
/**
|
|
1835
|
+
* Klun UI FormItem — labels a field, wires value/onChange, shows the error.
|
|
1836
|
+
* Supports nested `name` paths, `rules` (sync/async/fn-of-values), `dependencies`,
|
|
1837
|
+
* and `validateTrigger`. With no `children` it renders nothing (use inside Form.List).
|
|
1838
|
+
*/
|
|
1839
|
+
declare function FormItem({ name, label, rules, required, help, dependencies, validateTrigger, children, className, ...props }: FormItemProps): react.JSX.Element;
|
|
1840
|
+
declare namespace FormItem {
|
|
1841
|
+
var displayName: string;
|
|
1842
|
+
}
|
|
1843
|
+
/**
|
|
1844
|
+
* Klun UI FormList — dynamic array fields (antd Form.List).
|
|
1845
|
+
* <FormList name="users">{(fields, { add, remove, move }) => ...}</FormList>
|
|
1846
|
+
* Each field is { key, name, path }; render a FormItem with name={field.name} inside.
|
|
1847
|
+
*/
|
|
1848
|
+
declare function FormList({ name, children }: FormListProps): react.JSX.Element;
|
|
1849
|
+
declare namespace FormList {
|
|
1850
|
+
var displayName: string;
|
|
1851
|
+
}
|
|
1852
|
+
|
|
1853
|
+
interface HintProps extends HTMLAttributes<HTMLSpanElement> {
|
|
1854
|
+
error?: boolean;
|
|
1855
|
+
icon?: ReactNode;
|
|
1856
|
+
}
|
|
1857
|
+
/** Klun UI HintText — helper / error text beneath a field. */
|
|
1858
|
+
declare const Hint: react.ForwardRefExoticComponent<HintProps & react.RefAttributes<HTMLSpanElement>>;
|
|
1859
|
+
|
|
1860
|
+
type ImageUploadShape = "circle" | "square";
|
|
1861
|
+
interface ImageUploadProps extends Omit<HTMLAttributes<HTMLDivElement>, "style"> {
|
|
1862
|
+
/** Current image URL; shows the preview when set. */
|
|
1863
|
+
src?: string;
|
|
1864
|
+
/** Preview shape. Default `"circle"`. */
|
|
1865
|
+
shape?: ImageUploadShape;
|
|
1866
|
+
/** Preview edge length in px. Default `96`. */
|
|
1867
|
+
size?: number;
|
|
1868
|
+
label?: ReactNode;
|
|
1869
|
+
hint?: ReactNode;
|
|
1870
|
+
onPick?: (file: File | null, e: ChangeEvent<HTMLInputElement>) => void;
|
|
1871
|
+
onRemove?: () => void;
|
|
1872
|
+
disabled?: boolean;
|
|
1873
|
+
/** Style applied to the root element. */
|
|
1874
|
+
style?: CSSProperties;
|
|
1875
|
+
}
|
|
1876
|
+
/**
|
|
1877
|
+
* ImageUpload — avatar/image picker with a circular or square preview, a
|
|
1878
|
+
* change overlay and a remove control. Click or drop an image to pick; the
|
|
1879
|
+
* drag-over state is exposed via `data-dragover` and styled in CSS.
|
|
1880
|
+
*/
|
|
1881
|
+
declare const ImageUpload: react.ForwardRefExoticComponent<ImageUploadProps & react.RefAttributes<HTMLDivElement>>;
|
|
1882
|
+
|
|
1883
|
+
type InlineInputTone = "strong" | "sub" | "accent";
|
|
1884
|
+
type InlineInputWeight = "regular" | "medium";
|
|
1885
|
+
interface InlineInputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
1886
|
+
tone?: InlineInputTone;
|
|
1887
|
+
weight?: InlineInputWeight;
|
|
1888
|
+
error?: boolean;
|
|
1889
|
+
leadingIcon?: ReactNode;
|
|
1890
|
+
/** Class applied to the outer wrapper. */
|
|
1891
|
+
className?: string;
|
|
1892
|
+
/** Style applied to the outer wrapper. */
|
|
1893
|
+
style?: CSSProperties;
|
|
1894
|
+
/** Style applied to the inner `<input>`. */
|
|
1895
|
+
inputStyle?: CSSProperties;
|
|
1896
|
+
}
|
|
1897
|
+
/**
|
|
1898
|
+
* InlineInput — borderless text input that reads as editable text in a row or
|
|
1899
|
+
* table cell. Shows a soft underline on focus instead of a box. `className`/
|
|
1900
|
+
* `style` target the wrapper; `ref` forwards to the `<input>`.
|
|
1901
|
+
*/
|
|
1902
|
+
declare const InlineInput: react.ForwardRefExoticComponent<InlineInputProps & react.RefAttributes<HTMLInputElement>>;
|
|
1903
|
+
|
|
1904
|
+
type InlineSelectTone = "sub" | "strong" | "accent";
|
|
1905
|
+
type InlineSelectWeight = "regular" | "medium";
|
|
1906
|
+
interface InlineSelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, "style"> {
|
|
1907
|
+
/** Text color role. */
|
|
1908
|
+
tone?: InlineSelectTone;
|
|
1909
|
+
weight?: InlineSelectWeight;
|
|
1910
|
+
leadingIcon?: ReactNode;
|
|
1911
|
+
disabled?: boolean;
|
|
1912
|
+
/** <option> elements. */
|
|
1913
|
+
children?: ReactNode;
|
|
1914
|
+
/** Style applied to the outer wrapper. */
|
|
1915
|
+
style?: CSSProperties;
|
|
1916
|
+
}
|
|
1917
|
+
/**
|
|
1918
|
+
* InlineSelect — borderless, text-styled dropdown that sits inside a sentence
|
|
1919
|
+
* or label row. Backed by a fully custom, themed dropdown (not the native OS
|
|
1920
|
+
* menu). Keeps the familiar `<option>` children API and native form semantics:
|
|
1921
|
+
* a visually-hidden `<select>` carries the value for form submission, receives
|
|
1922
|
+
* `name`/`required`/native `onChange`, and is what `ref` forwards to. With no
|
|
1923
|
+
* selection the trigger shows the first option's label (mirrors a native
|
|
1924
|
+
* select's default). `className`/`style` target the wrapper.
|
|
1925
|
+
*/
|
|
1926
|
+
declare const InlineSelect: react.ForwardRefExoticComponent<InlineSelectProps & react.RefAttributes<HTMLSelectElement>>;
|
|
1927
|
+
|
|
1928
|
+
type FieldSize = "small" | "medium" | "large";
|
|
1929
|
+
interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size"> {
|
|
1930
|
+
/** Default `"medium"`. */
|
|
1931
|
+
size?: FieldSize;
|
|
1932
|
+
/** Icon node before the field. */
|
|
1933
|
+
leadingIcon?: ReactNode;
|
|
1934
|
+
/** Icon node after the field. */
|
|
1935
|
+
trailingIcon?: ReactNode;
|
|
1936
|
+
/** Arbitrary node before the field (e.g. an inline Select). */
|
|
1937
|
+
leadingNode?: ReactNode;
|
|
1938
|
+
/** Arbitrary node after the field. */
|
|
1939
|
+
trailingNode?: ReactNode;
|
|
1940
|
+
/** Show the error ring. */
|
|
1941
|
+
error?: boolean;
|
|
1942
|
+
/** Read-only field — selectable text, no editing, gray surface. */
|
|
1943
|
+
readOnly?: boolean;
|
|
1944
|
+
/** Show a trailing spinner. */
|
|
1945
|
+
loading?: boolean;
|
|
1946
|
+
/** Show a clear (×) button when the field has a value. */
|
|
1947
|
+
clearable?: boolean;
|
|
1948
|
+
/** Called when the clear button is pressed. */
|
|
1949
|
+
onClear?: () => void;
|
|
1950
|
+
/** Class applied to the outer field wrapper (the bordered surface). */
|
|
1951
|
+
className?: string;
|
|
1952
|
+
/** Style applied to the outer field wrapper. */
|
|
1953
|
+
style?: CSSProperties;
|
|
1954
|
+
}
|
|
1955
|
+
/**
|
|
1956
|
+
* Input — text field with optional leading/trailing icons or nodes.
|
|
1957
|
+
* `className`/`style` target the wrapper; `ref` forwards to the `<input>`.
|
|
1958
|
+
*/
|
|
1959
|
+
declare const Input: react.ForwardRefExoticComponent<InputProps & react.RefAttributes<HTMLInputElement>>;
|
|
1960
|
+
|
|
1961
|
+
interface LabelProps extends LabelHTMLAttributes<HTMLLabelElement> {
|
|
1962
|
+
required?: boolean;
|
|
1963
|
+
sublabel?: ReactNode;
|
|
1964
|
+
disabled?: boolean;
|
|
1965
|
+
}
|
|
1966
|
+
/** Klun UI Label — field label with optional required asterisk + sublabel. */
|
|
1967
|
+
declare const Label: react.ForwardRefExoticComponent<LabelProps & react.RefAttributes<HTMLLabelElement>>;
|
|
1968
|
+
|
|
1969
|
+
type PasswordStrengthLevel = "weak" | "fair" | "good" | "strong";
|
|
1970
|
+
interface PasswordStrengthProps extends HTMLAttributes<HTMLDivElement> {
|
|
1971
|
+
/** Named strength level — sets lit bars + color + caption. */
|
|
1972
|
+
strength?: PasswordStrengthLevel;
|
|
1973
|
+
/** Or a raw 0–4 score (overrides `strength` for lit-bar count). */
|
|
1974
|
+
score?: number;
|
|
1975
|
+
bars?: number;
|
|
1976
|
+
showLabel?: boolean;
|
|
1977
|
+
/** Override the auto caption text. */
|
|
1978
|
+
label?: ReactNode;
|
|
1979
|
+
}
|
|
1980
|
+
/**
|
|
1981
|
+
* PasswordStrength — 4-segment meter with a strength caption. Pass either
|
|
1982
|
+
* `strength` ("weak" | "fair" | "good" | "strong") or a raw 0–4 `score`. The
|
|
1983
|
+
* resolved level is exposed via `data-level` and drives the bar/caption color.
|
|
1984
|
+
*/
|
|
1985
|
+
declare const PasswordStrength: react.ForwardRefExoticComponent<PasswordStrengthProps & react.RefAttributes<HTMLDivElement>>;
|
|
1986
|
+
|
|
1987
|
+
type RadioSize = "small" | "medium" | "large";
|
|
1988
|
+
interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "type" | "size"> {
|
|
1989
|
+
checked?: boolean;
|
|
1990
|
+
disabled?: boolean;
|
|
1991
|
+
/** Red error ring. */
|
|
1992
|
+
error?: boolean;
|
|
1993
|
+
/** Control size. Default `"medium"`. */
|
|
1994
|
+
size?: RadioSize;
|
|
1995
|
+
name?: string;
|
|
1996
|
+
value?: string;
|
|
1997
|
+
onChange?: (value: string | true) => void;
|
|
1998
|
+
style?: CSSProperties;
|
|
1999
|
+
}
|
|
2000
|
+
/** Klun UI Radio — circular single-select control. */
|
|
2001
|
+
declare const Radio: react.ForwardRefExoticComponent<RadioProps & react.RefAttributes<HTMLInputElement>>;
|
|
2002
|
+
|
|
2003
|
+
type RadioCardAlign = "start" | "center";
|
|
2004
|
+
interface RadioCardProps extends Omit<HTMLAttributes<HTMLLabelElement>, "onChange" | "title"> {
|
|
2005
|
+
title?: ReactNode;
|
|
2006
|
+
description?: ReactNode;
|
|
2007
|
+
icon?: ReactNode;
|
|
2008
|
+
value: string;
|
|
2009
|
+
name?: string;
|
|
2010
|
+
checked?: boolean;
|
|
2011
|
+
disabled?: boolean;
|
|
2012
|
+
onChange?: (value: string, e: ChangeEvent<HTMLInputElement>) => void;
|
|
2013
|
+
price?: ReactNode;
|
|
2014
|
+
unit?: ReactNode;
|
|
2015
|
+
/** Vertical alignment of the row. Default `"start"`. */
|
|
2016
|
+
align?: RadioCardAlign;
|
|
2017
|
+
children?: ReactNode;
|
|
2018
|
+
}
|
|
2019
|
+
/**
|
|
2020
|
+
* RadioCard — single-select bordered card wrapping a radio control, title,
|
|
2021
|
+
* description, optional leading icon and trailing price/unit. The single-select
|
|
2022
|
+
* counterpart to CheckboxCard; pass a shared `name` to group cards.
|
|
2023
|
+
* `ref` forwards to the `<input type="radio">`.
|
|
2024
|
+
*/
|
|
2025
|
+
declare const RadioCard: react.ForwardRefExoticComponent<RadioCardProps & react.RefAttributes<HTMLInputElement>>;
|
|
2026
|
+
|
|
2027
|
+
/** Track/thumb scale. */
|
|
2028
|
+
type RangeSliderSize = "sm" | "md" | "lg";
|
|
2029
|
+
interface RangeSliderProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue"> {
|
|
2030
|
+
/** Controlled value as `[low, high]`. */
|
|
2031
|
+
value?: [number, number];
|
|
2032
|
+
/** Uncontrolled initial value. Default `[20, 70]`. */
|
|
2033
|
+
defaultValue?: [number, number];
|
|
2034
|
+
min?: number;
|
|
2035
|
+
max?: number;
|
|
2036
|
+
step?: number;
|
|
2037
|
+
/** Track/thumb scale. Default `"md"`. */
|
|
2038
|
+
size?: RangeSliderSize;
|
|
2039
|
+
disabled?: boolean;
|
|
2040
|
+
onChange?: (value: [number, number]) => void;
|
|
2041
|
+
style?: CSSProperties;
|
|
2042
|
+
}
|
|
2043
|
+
/**
|
|
2044
|
+
* RangeSlider — dual-handle range selector. Two overlaid native range inputs
|
|
2045
|
+
* drive the low/high values (controlled or uncontrolled); the visible track,
|
|
2046
|
+
* fill and thumbs are rendered as elements positioned via the
|
|
2047
|
+
* `--klun-range-slider-lo` / `--klun-range-slider-hi` custom properties.
|
|
2048
|
+
* `ref` forwards to the root element.
|
|
2049
|
+
*/
|
|
2050
|
+
declare const RangeSlider: react.ForwardRefExoticComponent<RangeSliderProps & react.RefAttributes<HTMLDivElement>>;
|
|
2051
|
+
|
|
2052
|
+
interface RichEditorToolbarProps extends HTMLAttributes<HTMLDivElement> {
|
|
2053
|
+
/** Ids of active formatting buttons (bold, italic, h1, ul, …). */
|
|
2054
|
+
active?: string[];
|
|
2055
|
+
/** Called with the button id when a tool is pressed. */
|
|
2056
|
+
onAction?: (id: string) => void;
|
|
2057
|
+
}
|
|
2058
|
+
/** RichEditorToolbar — formatting toolbar for a text editor (presentational). */
|
|
2059
|
+
declare const RichEditorToolbar: react.ForwardRefExoticComponent<RichEditorToolbarProps & react.RefAttributes<HTMLDivElement>>;
|
|
2060
|
+
|
|
2061
|
+
interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, "size" | "style"> {
|
|
2062
|
+
size?: "small" | "medium" | "large";
|
|
2063
|
+
placeholder?: string;
|
|
2064
|
+
leadingIcon?: ReactNode;
|
|
2065
|
+
error?: boolean;
|
|
2066
|
+
disabled?: boolean;
|
|
2067
|
+
/** Replace the chevron with a spinner. */
|
|
2068
|
+
loading?: boolean;
|
|
2069
|
+
/** Style applied to the outer field wrapper. */
|
|
2070
|
+
style?: CSSProperties;
|
|
2071
|
+
}
|
|
2072
|
+
/**
|
|
2073
|
+
* Select — single-select with a fully custom, themed dropdown (not the native
|
|
2074
|
+
* OS menu). Keeps the familiar `<option>` children API and native form
|
|
2075
|
+
* semantics: a visually-hidden `<select>` carries the value for form submission,
|
|
2076
|
+
* receives `name`/`required`/native `onChange`, and is what `ref` forwards to.
|
|
2077
|
+
* Controlled via `value` or uncontrolled via `defaultValue`.
|
|
2078
|
+
*/
|
|
2079
|
+
declare const Select: react.ForwardRefExoticComponent<SelectProps & react.RefAttributes<HTMLSelectElement>>;
|
|
2080
|
+
|
|
2081
|
+
interface SelectMenuOption {
|
|
2082
|
+
value: string;
|
|
2083
|
+
label: ReactNode;
|
|
2084
|
+
icon?: ReactNode;
|
|
2085
|
+
description?: ReactNode;
|
|
2086
|
+
disabled?: boolean;
|
|
2087
|
+
}
|
|
2088
|
+
type SelectMenuSize = "small" | "medium" | "large";
|
|
2089
|
+
interface SelectMenuProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
2090
|
+
options: SelectMenuOption[];
|
|
2091
|
+
value?: string;
|
|
2092
|
+
onChange?: (value: string) => void;
|
|
2093
|
+
placeholder?: string;
|
|
2094
|
+
size?: SelectMenuSize;
|
|
2095
|
+
leadingIcon?: ReactNode;
|
|
2096
|
+
error?: boolean;
|
|
2097
|
+
disabled?: boolean;
|
|
2098
|
+
/** Side the popup aligns to. */
|
|
2099
|
+
align?: "left" | "right";
|
|
2100
|
+
/** Style applied to the outer wrapper. */
|
|
2101
|
+
style?: CSSProperties;
|
|
2102
|
+
}
|
|
2103
|
+
/**
|
|
2104
|
+
* SelectMenu — custom, fully-styled single-select with a popup panel. Unlike
|
|
2105
|
+
* the native-backed Select, options can carry icons + descriptions and the
|
|
2106
|
+
* selected row shows a check. Controlled via `value` / `onChange`. `ref`
|
|
2107
|
+
* forwards to the trigger `<button>`.
|
|
2108
|
+
*/
|
|
2109
|
+
declare const SelectMenu: react.ForwardRefExoticComponent<SelectMenuProps & react.RefAttributes<HTMLButtonElement>>;
|
|
2110
|
+
|
|
2111
|
+
type SliderSize = "small" | "medium" | "large";
|
|
2112
|
+
interface SliderProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "style" | "size"> {
|
|
2113
|
+
value?: number;
|
|
2114
|
+
min?: number;
|
|
2115
|
+
max?: number;
|
|
2116
|
+
step?: number;
|
|
2117
|
+
onChange?: (value: number) => void;
|
|
2118
|
+
disabled?: boolean;
|
|
2119
|
+
/** Track size. Default `"medium"`. */
|
|
2120
|
+
size?: SliderSize;
|
|
2121
|
+
style?: CSSProperties;
|
|
2122
|
+
}
|
|
2123
|
+
/**
|
|
2124
|
+
* Slider — single-thumb range control with a filled track. The filled portion is
|
|
2125
|
+
* driven by the `--klun-slider-value` custom property; `ref` forwards to the `<input>`.
|
|
2126
|
+
*/
|
|
2127
|
+
declare const Slider: react.ForwardRefExoticComponent<SliderProps & react.RefAttributes<HTMLInputElement>>;
|
|
2128
|
+
|
|
2129
|
+
type SwitchSize = "small" | "medium" | "large";
|
|
2130
|
+
interface SwitchProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "onChange" | "type" | "size"> {
|
|
2131
|
+
checked?: boolean;
|
|
2132
|
+
disabled?: boolean;
|
|
2133
|
+
/** Control size. Default `"medium"`. */
|
|
2134
|
+
size?: SwitchSize;
|
|
2135
|
+
onChange?: (checked: boolean) => void;
|
|
2136
|
+
style?: CSSProperties;
|
|
2137
|
+
}
|
|
2138
|
+
/** Klun UI Switch — on/off toggle. */
|
|
2139
|
+
declare const Switch: react.ForwardRefExoticComponent<SwitchProps & react.RefAttributes<HTMLInputElement>>;
|
|
2140
|
+
|
|
2141
|
+
type TextareaSize = "small" | "medium" | "large";
|
|
2142
|
+
interface TextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "style"> {
|
|
2143
|
+
error?: boolean;
|
|
2144
|
+
disabled?: boolean;
|
|
2145
|
+
/** Control size. Default `"medium"`. */
|
|
2146
|
+
size?: TextareaSize;
|
|
2147
|
+
rows?: number;
|
|
2148
|
+
/** Style applied to the outer field wrapper. */
|
|
2149
|
+
style?: CSSProperties;
|
|
2150
|
+
}
|
|
2151
|
+
/**
|
|
2152
|
+
* Textarea — multiline text field. The wrapper holds the border / focus-within
|
|
2153
|
+
* ring; `className`/`style` target the wrapper and `ref` forwards to the `<textarea>`.
|
|
2154
|
+
*/
|
|
2155
|
+
declare const Textarea: react.ForwardRefExoticComponent<TextareaProps & react.RefAttributes<HTMLTextAreaElement>>;
|
|
2156
|
+
|
|
2157
|
+
interface TimePickerProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "style"> {
|
|
2158
|
+
/** 24-hour "HH:MM". */
|
|
2159
|
+
value?: string;
|
|
2160
|
+
onChange?: (value: string) => void;
|
|
2161
|
+
style?: CSSProperties;
|
|
2162
|
+
}
|
|
2163
|
+
/** Klun UI TimePicker — hour / minute / meridiem selector. */
|
|
2164
|
+
declare const TimePicker: react.ForwardRefExoticComponent<TimePickerProps & react.RefAttributes<HTMLDivElement>>;
|
|
2165
|
+
|
|
2166
|
+
type CardVariant = "stroke" | "shadow" | "flat";
|
|
2167
|
+
interface CardProps extends HTMLAttributes<HTMLDivElement> {
|
|
2168
|
+
/** Surface treatment. Default `"stroke"`. */
|
|
2169
|
+
variant?: CardVariant;
|
|
2170
|
+
/** Inner padding (number → px). Defaults to 16px via CSS. */
|
|
2171
|
+
padding?: number | string;
|
|
2172
|
+
children?: ReactNode;
|
|
2173
|
+
}
|
|
2174
|
+
/** Card — elevated/outlined surface container. */
|
|
2175
|
+
declare const Card: react.ForwardRefExoticComponent<CardProps & react.RefAttributes<HTMLDivElement>>;
|
|
2176
|
+
|
|
2177
|
+
type Breakpoint = "xs" | "sm" | "md" | "lg" | "xl" | "xxl";
|
|
2178
|
+
/** A scalar value, or per-breakpoint values (`{ xs, sm, md, lg, xl, xxl }`). */
|
|
2179
|
+
type Responsive<T> = T | Partial<Record<Breakpoint, T>>;
|
|
2180
|
+
/** A single gutter value, or per-breakpoint values. */
|
|
2181
|
+
type Gutter = Responsive<number>;
|
|
2182
|
+
type RowJustify = "start" | "end" | "center" | "space-around" | "space-between" | "space-evenly";
|
|
2183
|
+
type RowAlign = "top" | "middle" | "bottom" | "stretch";
|
|
2184
|
+
interface RowProps extends HTMLAttributes<HTMLDivElement> {
|
|
2185
|
+
/** Spacing between columns. `number` → horizontal px; `[h, v]` → [horizontal, vertical] px.
|
|
2186
|
+
* Each value may be a per-breakpoint object, e.g. `{ xs: 8, md: 24 }`. Default `0`. */
|
|
2187
|
+
gutter?: Gutter | [Gutter, Gutter];
|
|
2188
|
+
/** `justify-content` of the flex row. Accepts a per-breakpoint object. */
|
|
2189
|
+
justify?: Responsive<RowJustify>;
|
|
2190
|
+
/** `align-items` of the flex row. Accepts a per-breakpoint object. */
|
|
2191
|
+
align?: Responsive<RowAlign>;
|
|
2192
|
+
/** Wrap columns onto multiple lines. Default `true`. */
|
|
2193
|
+
wrap?: boolean;
|
|
2194
|
+
children?: ReactNode;
|
|
2195
|
+
}
|
|
2196
|
+
/** Klun UI Row — flex container for a 24-column responsive grid. */
|
|
2197
|
+
declare const Row: react.ForwardRefExoticComponent<RowProps & react.RefAttributes<HTMLDivElement>>;
|
|
2198
|
+
/** Per-breakpoint settings, or a bare `number` meaning `span` at that breakpoint. */
|
|
2199
|
+
type ColSize = number | {
|
|
2200
|
+
span?: number;
|
|
2201
|
+
offset?: number;
|
|
2202
|
+
order?: number;
|
|
2203
|
+
push?: number;
|
|
2204
|
+
pull?: number;
|
|
2205
|
+
};
|
|
2206
|
+
interface ColProps extends HTMLAttributes<HTMLDivElement> {
|
|
2207
|
+
/** Columns to span, 0–24. `0` hides the column. */
|
|
2208
|
+
span?: number;
|
|
2209
|
+
/** Columns to push the column to the right. */
|
|
2210
|
+
offset?: number;
|
|
2211
|
+
/** Flex order. */
|
|
2212
|
+
order?: number;
|
|
2213
|
+
/** Columns the column is moved to the right (relative positioning). */
|
|
2214
|
+
push?: number;
|
|
2215
|
+
/** Columns the column is moved to the left (relative positioning). */
|
|
2216
|
+
pull?: number;
|
|
2217
|
+
/** `flex` layout style; overrides span/max-width when set. */
|
|
2218
|
+
flex?: string | number;
|
|
2219
|
+
/** `<576px` (also the base). */
|
|
2220
|
+
xs?: ColSize;
|
|
2221
|
+
/** `≥576px`. */
|
|
2222
|
+
sm?: ColSize;
|
|
2223
|
+
/** `≥768px`. */
|
|
2224
|
+
md?: ColSize;
|
|
2225
|
+
/** `≥992px`. */
|
|
2226
|
+
lg?: ColSize;
|
|
2227
|
+
/** `≥1200px`. */
|
|
2228
|
+
xl?: ColSize;
|
|
2229
|
+
/** `≥1600px`. */
|
|
2230
|
+
xxl?: ColSize;
|
|
2231
|
+
children?: ReactNode;
|
|
2232
|
+
}
|
|
2233
|
+
/** Klun UI Col — a 24-column grid cell with per-breakpoint sizing. */
|
|
2234
|
+
declare const Col: react.ForwardRefExoticComponent<ColProps & react.RefAttributes<HTMLDivElement>>;
|
|
2235
|
+
/** Map of which breakpoints currently match. */
|
|
2236
|
+
type ScreenMap = Partial<Record<Breakpoint, boolean>>;
|
|
2237
|
+
/**
|
|
2238
|
+
* useBreakpoint — reactive map of which breakpoints currently match, e.g.
|
|
2239
|
+
* `{ xs: false, sm: true, md: true, ... }`. Mirrors Ant Design's `useBreakpoint`.
|
|
2240
|
+
*/
|
|
2241
|
+
declare function useBreakpoint(): ScreenMap;
|
|
2242
|
+
/**
|
|
2243
|
+
* Grid — namespace bundling the 24-column grid primitives so consumers can write
|
|
2244
|
+
* `<Grid.Row><Grid.Col span={12} /></Grid.Row>`. `Row` and `Col` remain
|
|
2245
|
+
* available as standalone named exports too.
|
|
2246
|
+
*/
|
|
2247
|
+
declare const Grid: {
|
|
2248
|
+
Row: react.ForwardRefExoticComponent<RowProps & react.RefAttributes<HTMLDivElement>>;
|
|
2249
|
+
Col: react.ForwardRefExoticComponent<ColProps & react.RefAttributes<HTMLDivElement>>;
|
|
2250
|
+
};
|
|
2251
|
+
|
|
2252
|
+
interface LayoutHeaderProps extends HTMLAttributes<HTMLElement> {
|
|
2253
|
+
children?: ReactNode;
|
|
2254
|
+
}
|
|
2255
|
+
/** Layout.Header — top band of the app shell. */
|
|
2256
|
+
declare const LayoutHeader: react.ForwardRefExoticComponent<LayoutHeaderProps & react.RefAttributes<HTMLElement>>;
|
|
2257
|
+
interface LayoutContentProps extends HTMLAttributes<HTMLElement> {
|
|
2258
|
+
children?: ReactNode;
|
|
2259
|
+
}
|
|
2260
|
+
/** Layout.Content — flexible main area. */
|
|
2261
|
+
declare const LayoutContent: react.ForwardRefExoticComponent<LayoutContentProps & react.RefAttributes<HTMLElement>>;
|
|
2262
|
+
interface LayoutFooterProps extends HTMLAttributes<HTMLElement> {
|
|
2263
|
+
children?: ReactNode;
|
|
2264
|
+
}
|
|
2265
|
+
/** Layout.Footer — bottom band of the app shell. */
|
|
2266
|
+
declare const LayoutFooter: react.ForwardRefExoticComponent<LayoutFooterProps & react.RefAttributes<HTMLElement>>;
|
|
2267
|
+
type SiderTheme = "light" | "dark";
|
|
2268
|
+
interface SiderProps extends HTMLAttributes<HTMLDivElement> {
|
|
2269
|
+
/** Expanded width in px. Default `200`. */
|
|
2270
|
+
width?: number;
|
|
2271
|
+
/** Width in px when collapsed. Default `80`. */
|
|
2272
|
+
collapsedWidth?: number;
|
|
2273
|
+
/** Show a trigger to toggle collapsed state. */
|
|
2274
|
+
collapsible?: boolean;
|
|
2275
|
+
/** Controlled collapsed state. */
|
|
2276
|
+
collapsed?: boolean;
|
|
2277
|
+
/** Initial collapsed state when uncontrolled. Default `false`. */
|
|
2278
|
+
defaultCollapsed?: boolean;
|
|
2279
|
+
/** Fired whenever the collapsed state changes. */
|
|
2280
|
+
onCollapse?: (collapsed: boolean) => void;
|
|
2281
|
+
/** Surface theme. Default `"dark"`. */
|
|
2282
|
+
theme?: SiderTheme;
|
|
2283
|
+
/** Custom trigger node. Pass `null` to hide the default trigger. */
|
|
2284
|
+
trigger?: ReactNode | null;
|
|
2285
|
+
/** Reverse the default trigger arrow direction. */
|
|
2286
|
+
reverseArrow?: boolean;
|
|
2287
|
+
children?: ReactNode;
|
|
2288
|
+
}
|
|
2289
|
+
/** Layout.Sider — collapsible side rail. */
|
|
2290
|
+
declare const LayoutSider: react.ForwardRefExoticComponent<SiderProps & react.RefAttributes<HTMLDivElement>>;
|
|
2291
|
+
interface LayoutProps extends HTMLAttributes<HTMLDivElement> {
|
|
2292
|
+
children?: ReactNode;
|
|
2293
|
+
}
|
|
2294
|
+
interface LayoutComponent extends React.ForwardRefExoticComponent<LayoutProps & React.RefAttributes<HTMLDivElement>> {
|
|
2295
|
+
Header: typeof LayoutHeader;
|
|
2296
|
+
Sider: typeof LayoutSider;
|
|
2297
|
+
Content: typeof LayoutContent;
|
|
2298
|
+
Footer: typeof LayoutFooter;
|
|
2299
|
+
}
|
|
2300
|
+
/** Layout — app-shell container. Lays out children as a column unless it has a
|
|
2301
|
+
* direct Sider child, in which case it becomes a row. */
|
|
2302
|
+
declare const Layout: LayoutComponent;
|
|
2303
|
+
|
|
2304
|
+
/** Per-breakpoint column counts. Each key is optional; the active breakpoint
|
|
2305
|
+
* falls back to the next-smaller defined value. */
|
|
2306
|
+
interface MasonryBreakpoints {
|
|
2307
|
+
xs?: number;
|
|
2308
|
+
sm?: number;
|
|
2309
|
+
md?: number;
|
|
2310
|
+
lg?: number;
|
|
2311
|
+
xl?: number;
|
|
2312
|
+
xxl?: number;
|
|
2313
|
+
}
|
|
2314
|
+
type MasonryColumns = number | MasonryBreakpoints;
|
|
2315
|
+
/** `[horizontal, vertical]` gutter, or a single number applied to both. */
|
|
2316
|
+
type MasonryGutter = number | [number, number];
|
|
2317
|
+
interface MasonryProps<T = unknown> extends HTMLAttributes<HTMLDivElement> {
|
|
2318
|
+
/** Column count — a fixed number or a responsive breakpoint map. Default `3`. */
|
|
2319
|
+
columns?: MasonryColumns;
|
|
2320
|
+
/** Gutter in px: a single number, or `[horizontal, vertical]`. Default `16`. */
|
|
2321
|
+
gutter?: MasonryGutter;
|
|
2322
|
+
/** Tiles, one per direct child. Ignored when `items` is provided. */
|
|
2323
|
+
children?: ReactNode;
|
|
2324
|
+
/** Data-driven alternative to `children`. */
|
|
2325
|
+
items?: T[];
|
|
2326
|
+
/** Render a tile for each `items` entry. */
|
|
2327
|
+
itemRender?: (item: T, index: number) => ReactNode;
|
|
2328
|
+
/** Stable key for each `items` entry. */
|
|
2329
|
+
itemKey?: (item: T, index: number) => string | number;
|
|
2330
|
+
}
|
|
2331
|
+
/**
|
|
2332
|
+
* Masonry — multi-column waterfall that balances columns by measured height:
|
|
2333
|
+
* each tile is placed into the currently shortest column (antd-style), so tiles
|
|
2334
|
+
* flow in source order across columns rather than column-major. Re-balances on
|
|
2335
|
+
* resize and when tile heights change. Before measurement (and in SSR), tiles
|
|
2336
|
+
* fall back to a round-robin distribution.
|
|
2337
|
+
*/
|
|
2338
|
+
declare function Masonry<T = unknown>({ columns, gutter, children, items, itemRender, itemKey, className, style, ...props }: MasonryProps<T>): react.JSX.Element;
|
|
2339
|
+
declare namespace Masonry {
|
|
2340
|
+
var displayName: string;
|
|
2341
|
+
}
|
|
2342
|
+
|
|
2343
|
+
type SpaceSize = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | number;
|
|
2344
|
+
interface SpaceProps extends HTMLAttributes<HTMLDivElement> {
|
|
2345
|
+
direction?: "row" | "column";
|
|
2346
|
+
size?: SpaceSize;
|
|
2347
|
+
align?: CSSProperties["alignItems"];
|
|
2348
|
+
justify?: CSSProperties["justifyContent"];
|
|
2349
|
+
wrap?: boolean;
|
|
2350
|
+
/** Node rendered between each child (e.g. a divider). */
|
|
2351
|
+
split?: ReactNode;
|
|
2352
|
+
children?: ReactNode;
|
|
2353
|
+
}
|
|
2354
|
+
/** Klun UI Space — inline spacing primitive with token-based gap. */
|
|
2355
|
+
declare const Space: react.ForwardRefExoticComponent<SpaceProps & react.RefAttributes<HTMLDivElement>>;
|
|
2356
|
+
|
|
2357
|
+
type FlexGap = "small" | "middle" | "large";
|
|
2358
|
+
interface FlexProps extends HTMLAttributes<HTMLElement> {
|
|
2359
|
+
/** Lay children out in a column (`flex-direction: column`). Default `false`. */
|
|
2360
|
+
vertical?: boolean;
|
|
2361
|
+
/** `flex-wrap`. A boolean is accepted for convenience (`true` → `wrap`). Default `nowrap`. */
|
|
2362
|
+
wrap?: CSSProperties["flexWrap"] | boolean;
|
|
2363
|
+
/** `justify-content`. Default `normal`. */
|
|
2364
|
+
justify?: CSSProperties["justifyContent"];
|
|
2365
|
+
/** `align-items`. Default `normal`. */
|
|
2366
|
+
align?: CSSProperties["alignItems"];
|
|
2367
|
+
/** `flex` shorthand. Default `normal`. */
|
|
2368
|
+
flex?: CSSProperties["flex"];
|
|
2369
|
+
/** Gap between items: a preset (`small`/`middle`/`large`), a number (px) or any CSS length. */
|
|
2370
|
+
gap?: FlexGap | number | string;
|
|
2371
|
+
/** Element/component to render. Default `"div"`. */
|
|
2372
|
+
component?: ElementType;
|
|
2373
|
+
children?: ReactNode;
|
|
2374
|
+
}
|
|
2375
|
+
/**
|
|
2376
|
+
* Flex — flexbox layout primitive. Mirrors Ant Design's `<Flex>`:
|
|
2377
|
+
* `vertical`, `wrap`, `justify`, `align`, `flex`, preset `gap` and a
|
|
2378
|
+
* polymorphic `component`. For evenly-gapped stacks of fixed items prefer
|
|
2379
|
+
* `Space`; for two-dimensional layouts use `Grid`.
|
|
2380
|
+
*/
|
|
2381
|
+
declare const Flex: react.ForwardRefExoticComponent<FlexProps & react.RefAttributes<HTMLElement>>;
|
|
2382
|
+
|
|
2383
|
+
type SplitterLayout = "horizontal" | "vertical";
|
|
2384
|
+
interface SplitterPanelProps extends HTMLAttributes<HTMLDivElement> {
|
|
2385
|
+
/** Initial size — number (px) or string ("30%" / "200px"). */
|
|
2386
|
+
defaultSize?: number | string;
|
|
2387
|
+
/** Controlled size — number (px) or string. */
|
|
2388
|
+
size?: number | string;
|
|
2389
|
+
/** Minimum size the panel may shrink to (px or "%"). */
|
|
2390
|
+
min?: number | string;
|
|
2391
|
+
/** Maximum size the panel may grow to (px or "%"). */
|
|
2392
|
+
max?: number | string;
|
|
2393
|
+
/** Show collapse buttons on the adjacent bar. `true` = both directions. */
|
|
2394
|
+
collapsible?: boolean | {
|
|
2395
|
+
start?: boolean;
|
|
2396
|
+
end?: boolean;
|
|
2397
|
+
};
|
|
2398
|
+
/** Whether the bar AFTER this panel can resize. Default `true`. */
|
|
2399
|
+
resizable?: boolean;
|
|
2400
|
+
children?: ReactNode;
|
|
2401
|
+
}
|
|
2402
|
+
interface SplitterProps extends HTMLAttributes<HTMLDivElement> {
|
|
2403
|
+
/** Panel arrangement. `"horizontal"` = side by side (resize along X). Default. */
|
|
2404
|
+
layout?: SplitterLayout;
|
|
2405
|
+
/** Fired continuously during a drag with the live panel sizes (percentages). */
|
|
2406
|
+
onResize?: (sizes: number[]) => void;
|
|
2407
|
+
/** Fired once a drag/keyboard resize settles, with the final sizes (percentages). */
|
|
2408
|
+
onResizeEnd?: (sizes: number[]) => void;
|
|
2409
|
+
/** `Splitter.Panel` children. */
|
|
2410
|
+
children?: ReactNode;
|
|
2411
|
+
}
|
|
2412
|
+
/** A panel inside a `Splitter`. Rendered by the parent; not standalone. */
|
|
2413
|
+
declare const SplitterPanel: react.ForwardRefExoticComponent<SplitterPanelProps & react.RefAttributes<HTMLDivElement>>;
|
|
2414
|
+
/** Splitter — resizable split panels (Ant-Design-style). */
|
|
2415
|
+
declare const SplitterRoot: react.ForwardRefExoticComponent<SplitterProps & react.RefAttributes<HTMLDivElement>>;
|
|
2416
|
+
type SplitterComponent = typeof SplitterRoot & {
|
|
2417
|
+
Panel: typeof SplitterPanel;
|
|
2418
|
+
};
|
|
2419
|
+
declare const Splitter: SplitterComponent;
|
|
2420
|
+
|
|
2421
|
+
interface BreadcrumbItem {
|
|
2422
|
+
label: ReactNode;
|
|
2423
|
+
icon?: ReactNode;
|
|
2424
|
+
href?: string;
|
|
2425
|
+
}
|
|
2426
|
+
interface BreadcrumbProps extends HTMLAttributes<HTMLElement> {
|
|
2427
|
+
items: BreadcrumbItem[];
|
|
2428
|
+
}
|
|
2429
|
+
/** Klun UI Breadcrumb — path navigation with chevron separators. */
|
|
2430
|
+
declare const Breadcrumb: react.ForwardRefExoticComponent<BreadcrumbProps & react.RefAttributes<HTMLElement>>;
|
|
2431
|
+
|
|
2432
|
+
type DividerVariant = "line" | "text" | "left" | "right";
|
|
2433
|
+
interface DividerProps extends HTMLAttributes<HTMLElement> {
|
|
2434
|
+
variant?: DividerVariant;
|
|
2435
|
+
children?: ReactNode;
|
|
2436
|
+
}
|
|
2437
|
+
/** Klun UI Divider — horizontal rule, optionally with centered uppercase text. */
|
|
2438
|
+
declare const Divider: react.ForwardRefExoticComponent<DividerProps & react.RefAttributes<HTMLElement>>;
|
|
2439
|
+
|
|
2440
|
+
type HorizontalFilterSize = "small" | "medium";
|
|
2441
|
+
interface HorizontalFilterItem {
|
|
2442
|
+
value: string;
|
|
2443
|
+
label: ReactNode;
|
|
2444
|
+
count?: number;
|
|
2445
|
+
icon?: ReactNode;
|
|
2446
|
+
}
|
|
2447
|
+
interface HorizontalFilterProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
2448
|
+
items: HorizontalFilterItem[];
|
|
2449
|
+
value?: string;
|
|
2450
|
+
onChange?: (value: string) => void;
|
|
2451
|
+
size?: HorizontalFilterSize;
|
|
2452
|
+
}
|
|
2453
|
+
/** HorizontalFilter — scrollable filter-pill row with active state + counts. */
|
|
2454
|
+
declare const HorizontalFilter: react.ForwardRefExoticComponent<HorizontalFilterProps & react.RefAttributes<HTMLDivElement>>;
|
|
2455
|
+
|
|
2456
|
+
type MenuItem = {
|
|
2457
|
+
key: string;
|
|
2458
|
+
label: ReactNode;
|
|
2459
|
+
icon?: ReactNode;
|
|
2460
|
+
badge?: ReactNode;
|
|
2461
|
+
disabled?: boolean;
|
|
2462
|
+
danger?: boolean;
|
|
2463
|
+
} | {
|
|
2464
|
+
key: string;
|
|
2465
|
+
label: ReactNode;
|
|
2466
|
+
icon?: ReactNode;
|
|
2467
|
+
children: MenuItem[];
|
|
2468
|
+
} | {
|
|
2469
|
+
type: "group";
|
|
2470
|
+
label: ReactNode;
|
|
2471
|
+
children: MenuItem[];
|
|
2472
|
+
} | {
|
|
2473
|
+
type: "divider";
|
|
2474
|
+
};
|
|
2475
|
+
interface MenuProps extends Omit<HTMLAttributes<HTMLElement>, "onSelect"> {
|
|
2476
|
+
items: MenuItem[];
|
|
2477
|
+
selectedKey?: string;
|
|
2478
|
+
onSelect?: (key: string, item: MenuItem) => void;
|
|
2479
|
+
/** Submenu keys open by default. */
|
|
2480
|
+
defaultOpenKeys?: string[];
|
|
2481
|
+
/** Icon-only rail mode. */
|
|
2482
|
+
collapsed?: boolean;
|
|
2483
|
+
}
|
|
2484
|
+
/**
|
|
2485
|
+
* Klun UI Menu — vertical navigation menu with groups, icons, badges and
|
|
2486
|
+
* collapsible submenus. Controlled via `selectedKey`/`onSelect`.
|
|
2487
|
+
*/
|
|
2488
|
+
declare const Menu: react.ForwardRefExoticComponent<MenuProps & react.RefAttributes<HTMLElement>>;
|
|
2489
|
+
|
|
2490
|
+
interface PaginationProps extends Omit<HTMLAttributes<HTMLElement>, "onChange"> {
|
|
2491
|
+
page?: number;
|
|
2492
|
+
total?: number;
|
|
2493
|
+
onChange?: (page: number) => void;
|
|
2494
|
+
/** Page numbers shown either side of the current page. */
|
|
2495
|
+
siblings?: number;
|
|
2496
|
+
}
|
|
2497
|
+
/** Klun UI Pagination — prev/next + numbered page cells with ellipsis. */
|
|
2498
|
+
declare const Pagination: react.ForwardRefExoticComponent<PaginationProps & react.RefAttributes<HTMLElement>>;
|
|
2499
|
+
|
|
2500
|
+
interface SegmentItem {
|
|
2501
|
+
value: string;
|
|
2502
|
+
label: ReactNode;
|
|
2503
|
+
icon?: ReactNode;
|
|
2504
|
+
}
|
|
2505
|
+
interface SegmentedControlProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
2506
|
+
items: SegmentItem[];
|
|
2507
|
+
value?: string;
|
|
2508
|
+
onChange?: (value: string) => void;
|
|
2509
|
+
}
|
|
2510
|
+
/** Klun UI SegmentedControl — equal-width segmented toggle. */
|
|
2511
|
+
declare const SegmentedControl: react.ForwardRefExoticComponent<SegmentedControlProps & react.RefAttributes<HTMLDivElement>>;
|
|
2512
|
+
|
|
2513
|
+
interface Step {
|
|
2514
|
+
label: ReactNode;
|
|
2515
|
+
description?: ReactNode;
|
|
2516
|
+
}
|
|
2517
|
+
interface StepIndicatorProps extends HTMLAttributes<HTMLDivElement> {
|
|
2518
|
+
steps: Step[];
|
|
2519
|
+
/** 0-based index of the active step. */
|
|
2520
|
+
current?: number;
|
|
2521
|
+
}
|
|
2522
|
+
/** Klun UI StepIndicator — horizontal numbered progress stepper. */
|
|
2523
|
+
declare const StepIndicator: react.ForwardRefExoticComponent<StepIndicatorProps & react.RefAttributes<HTMLDivElement>>;
|
|
2524
|
+
|
|
2525
|
+
interface TabItem {
|
|
2526
|
+
value: string;
|
|
2527
|
+
label: ReactNode;
|
|
2528
|
+
icon?: ReactNode;
|
|
2529
|
+
badge?: ReactNode;
|
|
2530
|
+
}
|
|
2531
|
+
type TabsVariant = "underline" | "pill";
|
|
2532
|
+
interface TabsProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
2533
|
+
items: TabItem[];
|
|
2534
|
+
value?: string;
|
|
2535
|
+
onChange?: (value: string) => void;
|
|
2536
|
+
variant?: TabsVariant;
|
|
2537
|
+
}
|
|
2538
|
+
/** Klun UI Tabs — underline or pill tab bar. */
|
|
2539
|
+
declare const Tabs: react.ForwardRefExoticComponent<TabsProps & react.RefAttributes<HTMLDivElement>>;
|
|
2540
|
+
|
|
2541
|
+
interface WizardStep {
|
|
2542
|
+
title?: ReactNode;
|
|
2543
|
+
content?: ReactNode;
|
|
2544
|
+
}
|
|
2545
|
+
interface WizardProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
2546
|
+
/** Ordered steps; each provides a rail `title` and a body `content`. */
|
|
2547
|
+
steps?: WizardStep[];
|
|
2548
|
+
/** Controlled active step index (0-based). When set, the component is controlled. */
|
|
2549
|
+
current?: number;
|
|
2550
|
+
/** Uncontrolled initial active step index. Default `0`. */
|
|
2551
|
+
defaultCurrent?: number;
|
|
2552
|
+
/** Fired with the new index whenever the active step changes (Back/Next). */
|
|
2553
|
+
onStepChange?: (index: number) => void;
|
|
2554
|
+
/** Fired when Finish is pressed on the last step. */
|
|
2555
|
+
onFinish?: () => void;
|
|
2556
|
+
/** Rail layout. Default `"horizontal"`. */
|
|
2557
|
+
orientation?: "horizontal" | "vertical";
|
|
2558
|
+
}
|
|
2559
|
+
/**
|
|
2560
|
+
* Wizard — multi-step flow container: numbered step rail + body + footer with
|
|
2561
|
+
* Back / Next / Finish. Controlled (`current`) or uncontrolled (`defaultCurrent`)
|
|
2562
|
+
* active step. Visual state is driven entirely through CSS classes / `data-*`.
|
|
2563
|
+
*/
|
|
2564
|
+
declare const Wizard: react.ForwardRefExoticComponent<WizardProps & react.RefAttributes<HTMLDivElement>>;
|
|
2565
|
+
|
|
2566
|
+
interface CommandItem {
|
|
2567
|
+
id: string;
|
|
2568
|
+
label: ReactNode;
|
|
2569
|
+
icon?: ReactNode;
|
|
2570
|
+
shortcut?: ReactNode;
|
|
2571
|
+
}
|
|
2572
|
+
interface CommandGroup {
|
|
2573
|
+
label: ReactNode;
|
|
2574
|
+
items: CommandItem[];
|
|
2575
|
+
}
|
|
2576
|
+
interface CommandMenuProps extends Omit<HTMLAttributes<HTMLDivElement>, "onSelect" | "style"> {
|
|
2577
|
+
open: boolean;
|
|
2578
|
+
onClose?: () => void;
|
|
2579
|
+
groups: CommandGroup[];
|
|
2580
|
+
placeholder?: string;
|
|
2581
|
+
onSelect?: (item: CommandItem) => void;
|
|
2582
|
+
style?: CSSProperties;
|
|
2583
|
+
}
|
|
2584
|
+
/** Klun UI CommandMenu — ⌘K search palette with grouped, filterable items. */
|
|
2585
|
+
declare const CommandMenu: react.ForwardRefExoticComponent<CommandMenuProps & react.RefAttributes<HTMLDivElement>>;
|
|
2586
|
+
|
|
2587
|
+
type ConfirmIntent = "primary" | "danger" | "warning";
|
|
2588
|
+
interface ConfirmRequireInput {
|
|
2589
|
+
label?: ReactNode;
|
|
2590
|
+
placeholder?: string;
|
|
2591
|
+
type?: string;
|
|
2592
|
+
/** If set, the confirm button is disabled until the typed value equals this. */
|
|
2593
|
+
match?: string;
|
|
2594
|
+
}
|
|
2595
|
+
interface ConfirmOptions {
|
|
2596
|
+
title?: ReactNode;
|
|
2597
|
+
description?: ReactNode;
|
|
2598
|
+
icon?: string;
|
|
2599
|
+
intent?: ConfirmIntent;
|
|
2600
|
+
confirmText?: ReactNode;
|
|
2601
|
+
cancelText?: ReactNode;
|
|
2602
|
+
requireInput?: ConfirmRequireInput;
|
|
2603
|
+
/** Async handler; the dialog shows a spinner until it settles, stays open if it rejects. */
|
|
2604
|
+
onConfirm?: (value?: string) => void | Promise<void>;
|
|
2605
|
+
}
|
|
2606
|
+
type ConfirmResult = false | true | {
|
|
2607
|
+
confirmed: true;
|
|
2608
|
+
value: string;
|
|
2609
|
+
};
|
|
2610
|
+
/**
|
|
2611
|
+
* Klun UI Confirm — imperative confirmation dialog. Returns a Promise that resolves to
|
|
2612
|
+
* `false` on cancel, `true` (or `{ confirmed, value }` when `requireInput` is set) on confirm.
|
|
2613
|
+
*
|
|
2614
|
+
* const ok = await Confirm({ title: "Destroy server?", intent: "danger", confirmText: "Destroy" });
|
|
2615
|
+
* if (ok) destroy();
|
|
2616
|
+
*
|
|
2617
|
+
* Pass an async `onConfirm` to keep the dialog in a loading state until it resolves
|
|
2618
|
+
* (and open if it rejects). Use `requireInput` to force the user to type a value to proceed.
|
|
2619
|
+
*/
|
|
2620
|
+
declare function Confirm(opts?: ConfirmOptions): Promise<ConfirmResult>;
|
|
2621
|
+
|
|
2622
|
+
interface DrawerProps extends Omit<HTMLAttributes<HTMLDivElement>, "title" | "style"> {
|
|
2623
|
+
open: boolean;
|
|
2624
|
+
onClose?: () => void;
|
|
2625
|
+
title?: ReactNode;
|
|
2626
|
+
side?: "left" | "right";
|
|
2627
|
+
width?: number | string;
|
|
2628
|
+
footer?: ReactNode;
|
|
2629
|
+
children?: ReactNode;
|
|
2630
|
+
style?: CSSProperties;
|
|
2631
|
+
}
|
|
2632
|
+
/** Klun UI Drawer — slide-over panel anchored to an edge. */
|
|
2633
|
+
declare const Drawer: react.ForwardRefExoticComponent<DrawerProps & react.RefAttributes<HTMLDivElement>>;
|
|
2634
|
+
|
|
2635
|
+
interface DropdownItem {
|
|
2636
|
+
label?: ReactNode;
|
|
2637
|
+
icon?: ReactNode;
|
|
2638
|
+
shortcut?: ReactNode;
|
|
2639
|
+
onClick?: () => void;
|
|
2640
|
+
danger?: boolean;
|
|
2641
|
+
divider?: boolean;
|
|
2642
|
+
}
|
|
2643
|
+
interface DropdownProps extends HTMLAttributes<HTMLSpanElement> {
|
|
2644
|
+
trigger: ReactNode;
|
|
2645
|
+
items: DropdownItem[];
|
|
2646
|
+
align?: "left" | "right";
|
|
2647
|
+
width?: number;
|
|
2648
|
+
}
|
|
2649
|
+
/** Klun UI Dropdown — click-to-open menu anchored to a trigger. */
|
|
2650
|
+
declare const Dropdown: react.ForwardRefExoticComponent<DropdownProps & react.RefAttributes<HTMLSpanElement>>;
|
|
2651
|
+
|
|
2652
|
+
interface ModalProps extends Omit<HTMLAttributes<HTMLDivElement>, "title" | "style"> {
|
|
2653
|
+
open: boolean;
|
|
2654
|
+
onClose?: () => void;
|
|
2655
|
+
title?: ReactNode;
|
|
2656
|
+
description?: ReactNode;
|
|
2657
|
+
icon?: ReactNode;
|
|
2658
|
+
footer?: ReactNode;
|
|
2659
|
+
width?: number | string;
|
|
2660
|
+
/** Show the close button + allow Esc/backdrop close. Default true. */
|
|
2661
|
+
closable?: boolean;
|
|
2662
|
+
/** Close when the dimmed backdrop is clicked. Default true. */
|
|
2663
|
+
closeOnBackdrop?: boolean;
|
|
2664
|
+
children?: ReactNode;
|
|
2665
|
+
style?: CSSProperties;
|
|
2666
|
+
}
|
|
2667
|
+
/** Klun UI Modal — centered dialog with dimmed backdrop. Controlled via `open` / `onClose`. */
|
|
2668
|
+
declare const Modal: react.ForwardRefExoticComponent<ModalProps & react.RefAttributes<HTMLDivElement>>;
|
|
2669
|
+
|
|
2670
|
+
interface PopconfirmProps extends Omit<HTMLAttributes<HTMLSpanElement>, "title"> {
|
|
2671
|
+
title?: ReactNode;
|
|
2672
|
+
description?: ReactNode;
|
|
2673
|
+
/** Leading icon (Remix class). Pass "" to hide. */
|
|
2674
|
+
icon?: string;
|
|
2675
|
+
status?: "warning" | "error" | "information" | "success";
|
|
2676
|
+
okText?: ReactNode;
|
|
2677
|
+
cancelText?: ReactNode;
|
|
2678
|
+
/** Red confirm button for destructive actions. */
|
|
2679
|
+
okDanger?: boolean;
|
|
2680
|
+
placement?: "top" | "bottom" | "left" | "right";
|
|
2681
|
+
/** May return a promise; the confirm button shows a spinner until it resolves. */
|
|
2682
|
+
onConfirm?: () => void | Promise<any>;
|
|
2683
|
+
onCancel?: () => void;
|
|
2684
|
+
disabled?: boolean;
|
|
2685
|
+
/** The trigger element. */
|
|
2686
|
+
children: ReactNode;
|
|
2687
|
+
}
|
|
2688
|
+
/** Klun UI Popconfirm — confirmation bubble anchored to its trigger child. */
|
|
2689
|
+
declare const Popconfirm: react.ForwardRefExoticComponent<PopconfirmProps & react.RefAttributes<HTMLSpanElement>>;
|
|
2690
|
+
|
|
2691
|
+
interface PopoverProps extends Omit<HTMLAttributes<HTMLSpanElement>, "children"> {
|
|
2692
|
+
trigger: ReactNode;
|
|
2693
|
+
align?: "left" | "right";
|
|
2694
|
+
width?: number;
|
|
2695
|
+
/** Panel content, or a render-fn receiving a close() callback. */
|
|
2696
|
+
children: ReactNode | ((close: () => void) => ReactNode);
|
|
2697
|
+
}
|
|
2698
|
+
/** Klun UI Popover — click-triggered floating panel anchored to a trigger. */
|
|
2699
|
+
declare const Popover: react.ForwardRefExoticComponent<PopoverProps & react.RefAttributes<HTMLSpanElement>>;
|
|
2700
|
+
|
|
2701
|
+
export { type Accent, Accordion, type AccordionItem, type AccordionProps, Alert, type AlertProps, type AlertStatus, type AlertVariant, AutoComplete, type AutoCompleteOption, type AutoCompleteProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, type AvatarSize, type AvatarStatus, Badge, type BadgeColor, type BadgeProps, type BadgeVariant, Banner, type BannerProps, type BannerStatus, type BannerVariant, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, type Breakpoint, BulkAction, BulkActionBar, type BulkActionBarProps, type BulkActionProps, Button, type ButtonAppearance, ButtonGroup, type ButtonGroupItem, type ButtonGroupProps, type ButtonGroupSize, type ButtonKind, type ButtonProps, type ButtonSize, type ButtonVariant, Card, type CardProps, type CardVariant, Carousel, type CarouselProps, Cascader, type CascaderOption, type CascaderProps, CharacterCounter, type CharacterCounterProps, ChartLegend, type ChartLegendItem, type ChartLegendProps, ChartTooltip, type ChartTooltipProps, type ChartTooltipRow, Checkbox, CheckboxCard, type CheckboxCardAlign, type CheckboxCardProps, type CheckboxProps, type CheckboxSize, Chip, type ChipColor, type ChipProps, CircularProgress, type CircularProgressColor, type CircularProgressProps, type ClassValue, CodeViewer, type CodeViewerProps, Col, type ColProps, type ColSize, ColorDot, type ColorDotProps, type ColorDotSize, ColorPicker, type ColorPickerProps, ColorSlider, type ColorSliderProps, type ColorSliderSize, type CommandGroup, type CommandItem, CommandMenu, type CommandMenuProps, type CompactButtonAppearance, type CompactButtonProps, type CompactButtonSize, CompactSelect, type CompactSelectAppearance, CompactSelectForInput, type CompactSelectForInputProps, type CompactSelectForInputSide, type CompactSelectForInputSize, type CompactSelectProps, type CompactSelectSize, type ComponentSize, ConfigProvider, type ConfigProviderProps, Confirm, type ConfirmIntent, type ConfirmOptions, type ConfirmRequireInput, type ConfirmResult, ContentLabel, type ContentLabelColor, type ContentLabelProps, CopyButton, type CopyButtonProps, type CopyButtonSize, type CopyButtonVariant, type CountdownResult, CounterInput, type CounterInputProps, type CounterInputSize, DatePicker, type DatePickerProps, type DateRange, DateRangePicker, type DateRangePickerProps, type DefaultButtonProps, type DescriptionItem, Descriptions, type DescriptionsLayout, type DescriptionsProps, type DescriptionsSize, type DescriptionsVariant, DigitInput, type DigitInputProps, type DigitInputSize, type Direction, Divider, type DividerProps, type DividerVariant, type DotTone, Drawer, type DrawerProps, Dropdown, type DropdownItem, type DropdownProps, ExpiryCountdown, type ExpiryCountdownProps, type FancyButtonProps, type FancyButtonSize, type FancyButtonVariant, type FieldSize, FileUpload, type FileUploadProps, Flex, type FlexGap, type FlexProps, Form, type FormInstance, FormItem, type FormItemProps, FormList, type FormListField, type FormListOperations, type FormListProps, type FormProps, type FormRule, Format, type FormatApi, GaugeBar, type GaugeBarColor, type GaugeBarProps, type GaugeBarSize, Grid, type Gutter, Hint, type HintProps, HorizontalFilter, type HorizontalFilterItem, type HorizontalFilterProps, type HorizontalFilterSize, ImageUpload, type ImageUploadProps, type ImageUploadShape, InlineInput, type InlineInputProps, type InlineInputTone, type InlineInputWeight, InlineSelect, type InlineSelectProps, type InlineSelectTone, type InlineSelectWeight, Input, type InputProps, Kbd, type KbdProps, KeyIcon, type KeyIconAppearance, type KeyIconColor, type KeyIconProps, type KeyIconSize, type KlunConfig, Label, type LabelProps, Layout, LayoutContent, type LayoutContentProps, LayoutFooter, type LayoutFooterProps, LayoutHeader, type LayoutHeaderProps, type LayoutProps, LayoutSider, type LinkButtonProps, type LinkButtonSize, type LinkButtonVariant, List, ListItem, type ListItemProps, type ListProps, LiveDot, type LiveDotProps, type Locale, type LogLevel, type LogLine, LogViewer, type LogViewerProps, Masonry, type MasonryBreakpoints, type MasonryColumns, type MasonryGutter, type MasonryProps, Menu, type MenuItem, type MenuProps, Message, type MessageApi, type MessageOptions, type MessageProps, type MessageStatus, Modal, type ModalProps, Money, type MoneyOptions, type MoneyPeriod, type MoneyProps, type MoneyResult, type MoneySize, type MoneyTone, type NamePath, Notification, type NotificationApi, type NotificationOptions, type NotificationPlacement, type NotificationProps, type NotificationStatus, Pagination, type PaginationProps, PasswordStrength, type PasswordStrengthLevel, type PasswordStrengthProps, type PctOptions, Popconfirm, type PopconfirmProps, Popover, type PopoverProps, ProgressBar, type ProgressBarProps, type ProgressColor, Radio, RadioCard, type RadioCardAlign, type RadioCardProps, type RadioProps, type RadioSize, type Radius, RangeSlider, type RangeSliderProps, type RangeSliderSize, Rating, type RatingProps, type RelTimeOptions, RelativeTime, type RelativeTimeProps, type Responsive, RichEditorToolbar, type RichEditorToolbarProps, Row, type RowAlign, type RowJustify, type RowProps, type Rules, type ScreenMap, type SegmentItem, SegmentedControl, type SegmentedControlProps, SegmentedProgress, type SegmentedProgressColor, type SegmentedProgressProps, Select, SelectMenu, type SelectMenuOption, type SelectMenuProps, type SelectMenuSize, type SelectProps, type SiderProps, type SiderTheme, type SizeOptions, Skeleton, type SkeletonProps, Slider, type SliderProps, type SliderSize, type SortDir, Space, type SpaceProps, type SpaceSize, Spinner, type SpinnerProps, type SpinnerSize, Splitter, type SplitterLayout, SplitterPanel, type SplitterPanelProps, type SplitterProps, Statistic, type StatisticProps, StatusBadge, type StatusBadgeProps, StatusDot, type StatusDotProps, type StatusTone, type Step, StepIndicator, type StepIndicatorProps, Switch, type SwitchProps, type SwitchSize, type TabItem, Table, type TableColumn, type TableMenuItem, type TableProps, type TableSort, Tabs, type TabsProps, type TabsVariant, Tag, type TagProps, Textarea, type TextareaProps, type TextareaSize, type Theme, TimePicker, type TimePickerProps, Timeline, type TimelineItem, type TimelineProps, Toast, type ToastAction, type ToastOptions, type ToastPosition, type ToastPromiseMessages, type ToastProps, type ToastStatus, Toaster, type ToasterProps, Tooltip, type TooltipProps, Tree, type TreeNode, type TreeProps, type UseFormOptions, type UseMessageDefaults, type UseNotificationDefaults, Wizard, type WizardProps, type WizardStep, arSA, cx, deDE, enUS, esES, fmt, frFR, idID, itIT, jaJP, koKR, locales, nlNL, plPL, primaryColorVars, ptBR, ruRU, toast, trTR, useBreakpoint, useConfig, useForm, useLocale, useMappedSize, useMessage, useNotification, useSize, viVN, zhCN, zhTW };
|