@minimalstuff/ui 2.1.1 → 3.0.1
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/dist/index.d.ts +263 -49
- package/dist/minimalstuff-ui.css +1 -1
- package/dist/minimalstuff-ui.js +2021 -638
- package/package.json +28 -26
package/dist/index.d.ts
CHANGED
|
@@ -2,53 +2,78 @@ import { Callable } from 'react-call';
|
|
|
2
2
|
import { ComponentPropsWithRef } from 'react';
|
|
3
3
|
import { JSX } from 'react';
|
|
4
4
|
import { JSXElementConstructor } from 'react';
|
|
5
|
+
import { MouseEvent as MouseEvent_2 } from 'react';
|
|
5
6
|
import { ReactElement } from 'react';
|
|
6
7
|
import { ReactNode } from 'react';
|
|
7
8
|
import { ReactPortal } from 'react';
|
|
9
|
+
import { Ref } from 'react';
|
|
8
10
|
import { StoreApi } from 'zustand';
|
|
9
11
|
import { UseBoundStore } from 'zustand';
|
|
10
12
|
|
|
13
|
+
export declare const Badge: ({ children, color, variant, size, radius, className, ...props }: Readonly<BadgeProps>) => JSX.Element;
|
|
14
|
+
|
|
15
|
+
export declare interface BadgeProps extends ComponentPropsWithRef<'span'> {
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
color?: ButtonColor;
|
|
18
|
+
variant?: BadgeVariant;
|
|
19
|
+
size?: BadgeSize;
|
|
20
|
+
radius?: Radius;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export declare type BadgeSize = ControlSize;
|
|
24
|
+
|
|
25
|
+
export declare type BadgeVariant = 'solid' | 'outline' | 'subtle';
|
|
26
|
+
|
|
27
|
+
/** Chrome shared by every text-entry control (Input, Textarea, Select, Combobox). */
|
|
11
28
|
export declare const BASE_INPUT_STYLES = "w-full border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 placeholder-gray-500 dark:placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed";
|
|
12
29
|
|
|
13
|
-
export declare
|
|
30
|
+
export declare function Button(buttonProps: Readonly<ButtonProps>): JSX.Element;
|
|
14
31
|
|
|
15
|
-
|
|
32
|
+
declare type ButtonColor =
|
|
33
|
+
| 'primary'
|
|
34
|
+
| 'neutral'
|
|
35
|
+
| 'danger'
|
|
36
|
+
| 'success'
|
|
37
|
+
| 'warning';
|
|
38
|
+
export { ButtonColor as BadgeColor }
|
|
39
|
+
export { ButtonColor }
|
|
16
40
|
|
|
17
|
-
declare
|
|
18
|
-
variant?: ButtonVariant;
|
|
19
|
-
color?: ButtonColor;
|
|
20
|
-
size?: ButtonSize;
|
|
21
|
-
radius?: Radius;
|
|
41
|
+
export declare type ButtonProps = Omit<ComponentPropsWithRef<'button'>, 'children'> & {
|
|
22
42
|
children: ReactNode;
|
|
43
|
+
size?: ControlSize;
|
|
23
44
|
className?: string;
|
|
24
45
|
fullWidth?: boolean;
|
|
25
46
|
loading?: boolean;
|
|
26
47
|
startIcon?: string;
|
|
27
48
|
endIcon?: string;
|
|
28
|
-
}
|
|
49
|
+
} & ButtonStyle;
|
|
29
50
|
|
|
30
|
-
declare type
|
|
51
|
+
declare type ButtonStyle = {
|
|
52
|
+
unstyled: true;
|
|
53
|
+
} | {
|
|
54
|
+
unstyled?: false;
|
|
55
|
+
variant?: ButtonVariant;
|
|
56
|
+
color?: ButtonColor;
|
|
57
|
+
radius?: Radius;
|
|
58
|
+
};
|
|
31
59
|
|
|
32
|
-
export declare type ButtonVariant =
|
|
33
|
-
| 'solid'
|
|
34
|
-
| 'outline'
|
|
35
|
-
| 'ghost'
|
|
36
|
-
| 'subtle'
|
|
37
|
-
| 'unstyled';
|
|
60
|
+
export declare type ButtonVariant = 'solid' | 'outline' | 'ghost' | 'subtle';
|
|
38
61
|
|
|
39
|
-
export declare function CharacterCount({ current, min, max, showMin, showMax, }: CharacterCountProps): JSX.Element;
|
|
62
|
+
export declare function CharacterCount({ current, min, max, showMin, showMax, unstyled, className, }: Readonly<CharacterCountProps>): JSX.Element;
|
|
40
63
|
|
|
41
|
-
declare interface CharacterCountProps {
|
|
64
|
+
export declare interface CharacterCountProps {
|
|
42
65
|
current: number;
|
|
43
66
|
min?: number;
|
|
44
67
|
max?: number;
|
|
45
68
|
showMin?: boolean;
|
|
46
69
|
showMax?: boolean;
|
|
70
|
+
unstyled?: boolean;
|
|
71
|
+
className?: string;
|
|
47
72
|
}
|
|
48
73
|
|
|
49
|
-
export declare function Checkbox({ label, description, error, radius, unstyled, className, wrapperClassName, checked, defaultChecked, onChange, id, ...props }: CheckboxProps): JSX.Element;
|
|
74
|
+
export declare function Checkbox({ label, description, error, radius, unstyled, className, wrapperClassName, checked, defaultChecked, onChange, id, ...props }: Readonly<CheckboxProps>): JSX.Element;
|
|
50
75
|
|
|
51
|
-
declare interface CheckboxProps extends Omit<ComponentPropsWithRef<'input'>, 'type' | 'className'> {
|
|
76
|
+
export declare interface CheckboxProps extends Omit<ComponentPropsWithRef<'input'>, 'type' | 'className'> {
|
|
52
77
|
label?: string | React.ReactNode;
|
|
53
78
|
description?: string | React.ReactNode;
|
|
54
79
|
error?: string;
|
|
@@ -58,25 +83,26 @@ declare interface CheckboxProps extends Omit<ComponentPropsWithRef<'input'>, 'ty
|
|
|
58
83
|
wrapperClassName?: string;
|
|
59
84
|
}
|
|
60
85
|
|
|
61
|
-
export declare function ClientOnly({ children, fallback }: ClientOnlyProps): string | number | bigint | boolean | Iterable< ReactNode> | Promise<string | number | bigint | boolean | ReactPortal | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable< ReactNode> | null | undefined> | JSX.Element | null;
|
|
86
|
+
export declare function ClientOnly({ children, fallback }: Readonly<ClientOnlyProps>): string | number | bigint | boolean | Iterable< ReactNode> | Promise<string | number | bigint | boolean | ReactPortal | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable< ReactNode> | null | undefined> | JSX.Element | null;
|
|
62
87
|
|
|
63
|
-
declare interface ClientOnlyProps extends React.PropsWithChildren {
|
|
88
|
+
export declare interface ClientOnlyProps extends React.PropsWithChildren {
|
|
64
89
|
fallback?: React.ReactNode;
|
|
65
90
|
}
|
|
66
91
|
|
|
67
|
-
export declare function Combobox({ options, label, error, placeholder, noResultsText, radius, unstyled, disabled, required, className, wrapperClassName, value, defaultValue, onChange, id, }: ComboboxProps): JSX.Element;
|
|
92
|
+
export declare function Combobox({ options, label, error, placeholder, noResultsText, clearLabel, radius, unstyled, disabled, required, className, wrapperClassName, value, defaultValue, onChange, id, }: Readonly<ComboboxProps>): JSX.Element;
|
|
68
93
|
|
|
69
94
|
export declare interface ComboboxOption {
|
|
70
95
|
value: string;
|
|
71
96
|
label: string;
|
|
72
97
|
}
|
|
73
98
|
|
|
74
|
-
declare interface ComboboxProps {
|
|
99
|
+
export declare interface ComboboxProps {
|
|
75
100
|
options: ComboboxOption[];
|
|
76
101
|
label?: string | ReactNode;
|
|
77
102
|
error?: string;
|
|
78
103
|
placeholder?: string;
|
|
79
104
|
noResultsText?: string;
|
|
105
|
+
clearLabel?: string;
|
|
80
106
|
radius?: Radius;
|
|
81
107
|
unstyled?: boolean;
|
|
82
108
|
disabled?: boolean;
|
|
@@ -91,7 +117,7 @@ declare interface ComboboxProps {
|
|
|
91
117
|
|
|
92
118
|
export declare const ConfirmModal: Callable<ConfirmModalProps, boolean, {}>;
|
|
93
119
|
|
|
94
|
-
export declare type ConfirmModalColor = '
|
|
120
|
+
export declare type ConfirmModalColor = Extract<ButtonColor, 'primary' | 'danger' | 'success'>;
|
|
95
121
|
|
|
96
122
|
export declare interface ConfirmModalProps {
|
|
97
123
|
title: ReactNode;
|
|
@@ -100,31 +126,87 @@ export declare interface ConfirmModalProps {
|
|
|
100
126
|
cancelLabel?: ReactNode;
|
|
101
127
|
confirmColor?: ConfirmModalColor;
|
|
102
128
|
radius?: Radius;
|
|
129
|
+
closeLabel?: string;
|
|
103
130
|
onConfirm?: () => void | Promise<void>;
|
|
131
|
+
onError?: (error: unknown) => void;
|
|
104
132
|
}
|
|
105
133
|
|
|
106
134
|
export declare type ConfirmModalResponse = boolean;
|
|
107
135
|
|
|
136
|
+
/**
|
|
137
|
+
* Wraps `children` (the right-click target area) and opens `items`, a list
|
|
138
|
+
* of `MenuItem` elements as direct children (see `MenuItem`'s own doc
|
|
139
|
+
* comment), at the cursor position. Right-click again elsewhere on the
|
|
140
|
+
* wrapped area to reposition it.
|
|
141
|
+
*
|
|
142
|
+
* For a menu anchored to a specific button (e.g. a kebab icon) instead of a
|
|
143
|
+
* right-click, use `Menu`.
|
|
144
|
+
*/
|
|
145
|
+
export declare function ContextMenu({ children, items, radius, className, ref, }: Readonly<ContextMenuProps>): JSX.Element;
|
|
146
|
+
|
|
147
|
+
export declare interface ContextMenuProps {
|
|
148
|
+
/** The area that opens the menu on right-click. */
|
|
149
|
+
children: ReactNode;
|
|
150
|
+
/** `MenuItem` elements shown in the menu. */
|
|
151
|
+
items: ReactNode;
|
|
152
|
+
radius?: Radius;
|
|
153
|
+
className?: string;
|
|
154
|
+
ref?: Ref<HTMLDivElement>;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/** The size scale every inline control shares (Button, IconButton, Badge, Kbd). */
|
|
158
|
+
declare type ControlSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
159
|
+
|
|
160
|
+
export declare function CopyButton({ value, children, onError, }: Readonly<CopyButtonProps>): JSX.Element;
|
|
161
|
+
|
|
162
|
+
export declare interface CopyButtonProps {
|
|
163
|
+
value: string;
|
|
164
|
+
children: (props: {
|
|
165
|
+
copied: boolean;
|
|
166
|
+
copy: () => void | Promise<void>;
|
|
167
|
+
}) => ReactNode;
|
|
168
|
+
onError?: (error: unknown) => void;
|
|
169
|
+
}
|
|
170
|
+
|
|
108
171
|
declare interface GlobalHotkeysStore {
|
|
109
172
|
globalHotkeysEnabled: boolean;
|
|
110
173
|
setGlobalHotkeysEnabled: (value: boolean) => void;
|
|
111
174
|
}
|
|
112
175
|
|
|
113
|
-
|
|
176
|
+
declare function Highlight_2({ text, ranges }: Readonly<HighlightProps>): JSX.Element;
|
|
177
|
+
export { Highlight_2 as Highlight }
|
|
178
|
+
|
|
179
|
+
export declare interface HighlightProps {
|
|
180
|
+
text: string;
|
|
181
|
+
ranges: readonly number[];
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export declare interface HighlightSegment {
|
|
185
|
+
text: string;
|
|
186
|
+
isMatch: boolean;
|
|
187
|
+
}
|
|
114
188
|
|
|
115
|
-
declare
|
|
189
|
+
export declare function IconButton(iconButtonProps: Readonly<IconButtonProps>): JSX.Element;
|
|
190
|
+
|
|
191
|
+
export declare type IconButtonProps = ComponentPropsWithRef<'button'> & {
|
|
116
192
|
icon: string;
|
|
117
193
|
'aria-label': string;
|
|
194
|
+
size?: ControlSize;
|
|
195
|
+
children?: ReactNode;
|
|
196
|
+
} & IconButtonStyle;
|
|
197
|
+
|
|
198
|
+
declare type IconButtonStyle = {
|
|
199
|
+
unstyled: true;
|
|
200
|
+
} | {
|
|
201
|
+
unstyled?: false;
|
|
118
202
|
variant?: ButtonVariant;
|
|
119
203
|
color?: ButtonColor;
|
|
120
|
-
size?: 'sm' | 'md' | 'lg';
|
|
121
204
|
radius?: Radius;
|
|
122
|
-
|
|
123
|
-
}
|
|
205
|
+
};
|
|
124
206
|
|
|
125
|
-
export declare function Input({ label, error, showCharCount, minLength, maxLength, radius, unstyled, className, wrapperClassName, value, defaultValue, onChange, id, ...props }: InputProps): JSX.Element;
|
|
207
|
+
export declare function Input({ label, error, showCharCount, minLength, maxLength, radius, unstyled, className, wrapperClassName, value, defaultValue, onChange, id, ...props }: Readonly<InputProps>): JSX.Element;
|
|
126
208
|
|
|
127
|
-
declare interface InputProps extends ComponentPropsWithRef<'input'> {
|
|
209
|
+
export declare interface InputProps extends ComponentPropsWithRef<'input'> {
|
|
128
210
|
label?: string | ReactNode;
|
|
129
211
|
error?: string;
|
|
130
212
|
showCharCount?: boolean;
|
|
@@ -136,16 +218,88 @@ declare interface InputProps extends ComponentPropsWithRef<'input'> {
|
|
|
136
218
|
wrapperClassName?: string;
|
|
137
219
|
}
|
|
138
220
|
|
|
221
|
+
export declare const Kbd: ({ children, size, radius, unstyled, className, }: Readonly<KbdProps>) => JSX.Element;
|
|
222
|
+
|
|
223
|
+
export declare interface KbdProps {
|
|
224
|
+
children: ReactNode;
|
|
225
|
+
size?: KbdSize;
|
|
226
|
+
radius?: Radius;
|
|
227
|
+
unstyled?: boolean;
|
|
228
|
+
className?: string;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export declare type KbdSize = ControlSize;
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* A dropdown anchored to `trigger` (e.g. a kebab `IconButton`): click to
|
|
235
|
+
* open, click again/click outside/Escape to close. `children` must be
|
|
236
|
+
* `MenuItem` elements as direct children (see `MenuItem`'s own doc comment)
|
|
237
|
+
* for keyboard nav and close-on-select to work.
|
|
238
|
+
*
|
|
239
|
+
* For "right-click anywhere on this area" instead of a specific trigger
|
|
240
|
+
* button, use `ContextMenu`.
|
|
241
|
+
*/
|
|
242
|
+
export declare function Menu({ trigger, children, side, align, radius, className, ref, }: Readonly<MenuProps>): JSX.Element;
|
|
243
|
+
|
|
244
|
+
export declare type MenuAlign = 'start' | 'center' | 'end';
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* A row inside a `Menu` or `ContextMenu`. Must be a direct child of one of
|
|
248
|
+
* those (or of a `<>` fragment passed as their `children`/`items`): arrow
|
|
249
|
+
* key navigation and close-on-select both rely on `role="menuitem"` being a
|
|
250
|
+
* direct descendant. Wrapping items in another element (e.g. a `<div>` for
|
|
251
|
+
* a labeled section) will render fine but breaks both.
|
|
252
|
+
*
|
|
253
|
+
* Works standalone outside a `Menu`/`ContextMenu` too (e.g. in isolation in
|
|
254
|
+
* Storybook): `onClick` still fires, it just won't auto-close anything.
|
|
255
|
+
*/
|
|
256
|
+
export declare function MenuItem({ icon, onClick, danger, disabled, children, className, ref, }: Readonly<MenuItemProps>): JSX.Element;
|
|
257
|
+
|
|
258
|
+
export declare interface MenuItemProps {
|
|
259
|
+
icon?: string;
|
|
260
|
+
onClick: (event: MouseEvent_2<HTMLButtonElement>) => void;
|
|
261
|
+
danger?: boolean;
|
|
262
|
+
disabled?: boolean;
|
|
263
|
+
children: ReactNode;
|
|
264
|
+
className?: string;
|
|
265
|
+
ref?: Ref<HTMLButtonElement>;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
export declare interface MenuProps {
|
|
269
|
+
trigger: ReactElement;
|
|
270
|
+
children: ReactNode;
|
|
271
|
+
side?: MenuSide;
|
|
272
|
+
align?: MenuAlign;
|
|
273
|
+
radius?: Radius;
|
|
274
|
+
className?: string;
|
|
275
|
+
/** Attaches to the wrapper `<span>` around `trigger`, alongside `Menu`'s own internal ref. */
|
|
276
|
+
ref?: Ref<HTMLSpanElement>;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
export declare type MenuSide = 'top' | 'bottom' | 'left' | 'right';
|
|
280
|
+
|
|
139
281
|
export declare const Modal: Callable<ModalProps, void, {}>;
|
|
140
282
|
|
|
283
|
+
/**
|
|
284
|
+
* Declares `children` as the modal's pinned footer, wherever this is
|
|
285
|
+
* rendered in the content tree — including inside a separate content
|
|
286
|
+
* component, any number of levels below `Modal`'s own `children`. Renders
|
|
287
|
+
* nothing itself; `Modal` places the actual footer in its own layout.
|
|
288
|
+
*/
|
|
289
|
+
export declare function ModalFooter({ children }: Readonly<ModalFooterProps>): null;
|
|
290
|
+
|
|
291
|
+
export declare interface ModalFooterProps {
|
|
292
|
+
children: ReactNode;
|
|
293
|
+
}
|
|
294
|
+
|
|
141
295
|
export declare interface ModalProps {
|
|
142
296
|
title?: ReactNode;
|
|
143
297
|
children: ModalRenderProp;
|
|
144
|
-
footer?: ModalRenderProp;
|
|
145
298
|
size?: ModalSize;
|
|
146
299
|
radius?: Radius;
|
|
147
300
|
className?: string;
|
|
148
301
|
dismissible?: boolean;
|
|
302
|
+
closeLabel?: string;
|
|
149
303
|
}
|
|
150
304
|
|
|
151
305
|
export declare function ModalProvider(): JSX.Element;
|
|
@@ -162,9 +316,9 @@ export declare interface RadioOption {
|
|
|
162
316
|
disabled?: boolean;
|
|
163
317
|
}
|
|
164
318
|
|
|
165
|
-
export declare function RadioOptions({ options, orientation, value, defaultValue, onChange, name: nameProp, label, error, required, disabled, radius, unstyled, className, wrapperClassName, id, ...props }: RadioOptionsProps): JSX.Element;
|
|
319
|
+
export declare function RadioOptions({ options, orientation, value, defaultValue, onChange, name: nameProp, label, error, required, disabled, radius, unstyled, className, wrapperClassName, id, ...props }: Readonly<RadioOptionsProps>): JSX.Element;
|
|
166
320
|
|
|
167
|
-
declare interface RadioOptionsProps extends Omit<ComponentPropsWithRef<'fieldset'>, 'onChange'> {
|
|
321
|
+
export declare interface RadioOptionsProps extends Omit<ComponentPropsWithRef<'fieldset'>, 'onChange'> {
|
|
168
322
|
options: string[] | RadioOption[];
|
|
169
323
|
orientation?: 'vertical' | 'horizontal';
|
|
170
324
|
value?: string;
|
|
@@ -183,14 +337,14 @@ declare interface RadioOptionsProps extends Omit<ComponentPropsWithRef<'fieldset
|
|
|
183
337
|
|
|
184
338
|
declare type Radius = 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
185
339
|
|
|
186
|
-
export declare function Select({ options, label, error, placeholder, radius, unstyled, className, wrapperClassName, value, defaultValue, onChange, id, ...props }: SelectProps): JSX.Element;
|
|
340
|
+
export declare function Select({ options, label, error, placeholder, radius, unstyled, className, wrapperClassName, value, defaultValue, onChange, id, ...props }: Readonly<SelectProps>): JSX.Element;
|
|
187
341
|
|
|
188
342
|
export declare interface SelectOption {
|
|
189
343
|
value: string;
|
|
190
344
|
label: string;
|
|
191
345
|
}
|
|
192
346
|
|
|
193
|
-
declare interface SelectProps extends Omit<ComponentPropsWithRef<'select'>, 'children'> {
|
|
347
|
+
export declare interface SelectProps extends Omit<ComponentPropsWithRef<'select'>, 'children'> {
|
|
194
348
|
options: SelectOption[];
|
|
195
349
|
label?: string | ReactNode;
|
|
196
350
|
error?: string;
|
|
@@ -201,12 +355,53 @@ declare interface SelectProps extends Omit<ComponentPropsWithRef<'select'>, 'chi
|
|
|
201
355
|
wrapperClassName?: string;
|
|
202
356
|
}
|
|
203
357
|
|
|
204
|
-
|
|
358
|
+
/**
|
|
359
|
+
* Splits `text` into consecutive segments, flagging the ones covered by
|
|
360
|
+
* `ranges` (flat `[start0, end0, start1, end1, ...]` pairs, ascending and
|
|
361
|
+
* non-overlapping — the shape uFuzzy's match info returns). Returns a
|
|
362
|
+
* single unmatched segment when there are no ranges, so callers never
|
|
363
|
+
* special-case an unmatched row.
|
|
364
|
+
*/
|
|
365
|
+
export declare function splitIntoHighlightSegments(
|
|
366
|
+
text: string,
|
|
367
|
+
ranges: readonly number[]
|
|
368
|
+
): HighlightSegment[] {
|
|
369
|
+
if (ranges.length === 0) {
|
|
370
|
+
return [{ text, isMatch: false }];
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
const segments: HighlightSegment[] = [];
|
|
374
|
+
let cursor = 0;
|
|
375
|
+
|
|
376
|
+
for (let rangeIndex = 0; rangeIndex < ranges.length; rangeIndex += 2) {
|
|
377
|
+
const start = ranges[rangeIndex];
|
|
378
|
+
const end = ranges[rangeIndex + 1];
|
|
379
|
+
if (start === undefined || end === undefined) {
|
|
380
|
+
continue;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
if (start > cursor) {
|
|
384
|
+
segments.push({ text: text.slice(cursor, start), isMatch: false });
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
segments.push({ text: text.slice(start, end), isMatch: true });
|
|
388
|
+
cursor = end;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
if (cursor < text.length) {
|
|
392
|
+
segments.push({ text: text.slice(cursor), isMatch: false });
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
return segments;
|
|
396
|
+
}
|
|
205
397
|
|
|
206
|
-
declare
|
|
398
|
+
export declare function Switch({ label, description, error, unstyled, className, wrapperClassName, checked, defaultChecked, onChange, id, ...props }: Readonly<SwitchProps>): JSX.Element;
|
|
399
|
+
|
|
400
|
+
export declare interface SwitchProps extends Omit<ComponentPropsWithRef<'input'>, 'type' | 'className'> {
|
|
207
401
|
label?: string | ReactNode;
|
|
208
402
|
description?: string | ReactNode;
|
|
209
403
|
error?: string;
|
|
404
|
+
unstyled?: boolean;
|
|
210
405
|
className?: string;
|
|
211
406
|
wrapperClassName?: string;
|
|
212
407
|
}
|
|
@@ -218,21 +413,23 @@ export declare interface TabItem {
|
|
|
218
413
|
icon?: string;
|
|
219
414
|
}
|
|
220
415
|
|
|
221
|
-
export declare function Tabs({ items, defaultIndex, radius, className, tabListClassName, panelClassName, onChange, }: TabsProps): JSX.Element;
|
|
416
|
+
export declare function Tabs({ items, value, defaultIndex, radius, unstyled, className, tabListClassName, panelClassName, onChange, }: Readonly<TabsProps>): JSX.Element;
|
|
222
417
|
|
|
223
|
-
declare interface TabsProps {
|
|
418
|
+
export declare interface TabsProps {
|
|
224
419
|
items: TabItem[];
|
|
420
|
+
value?: number;
|
|
225
421
|
defaultIndex?: number;
|
|
226
422
|
radius?: Radius;
|
|
423
|
+
unstyled?: boolean;
|
|
227
424
|
className?: string;
|
|
228
425
|
tabListClassName?: string;
|
|
229
426
|
panelClassName?: string;
|
|
230
427
|
onChange?: (index: number) => void;
|
|
231
428
|
}
|
|
232
429
|
|
|
233
|
-
export declare function Textarea({ label, error, showCharCount, minLength, maxLength, radius, unstyled, className, wrapperClassName, value, defaultValue, onChange, id, ...props }: TextareaProps): JSX.Element;
|
|
430
|
+
export declare function Textarea({ label, error, showCharCount, minLength, maxLength, radius, unstyled, className, wrapperClassName, value, defaultValue, onChange, id, ...props }: Readonly<TextareaProps>): JSX.Element;
|
|
234
431
|
|
|
235
|
-
declare interface TextareaProps extends ComponentPropsWithRef<'textarea'> {
|
|
432
|
+
export declare interface TextareaProps extends ComponentPropsWithRef<'textarea'> {
|
|
236
433
|
label?: string | ReactNode;
|
|
237
434
|
error?: string;
|
|
238
435
|
showCharCount?: boolean;
|
|
@@ -253,18 +450,36 @@ declare interface ThemeStore {
|
|
|
253
450
|
setTheme: (theme: Theme_2) => void;
|
|
254
451
|
}
|
|
255
452
|
|
|
256
|
-
export declare function ThemeToggle({ isTransitionEnabled, transitionDuration, transitionEasing, size, radius, }: Readonly<ThemeToggleProps>): JSX.Element;
|
|
453
|
+
export declare function ThemeToggle({ isTransitionEnabled, transitionDuration, transitionEasing, size, radius, variant, getAriaLabel, }: Readonly<ThemeToggleProps>): JSX.Element;
|
|
257
454
|
|
|
258
|
-
declare interface ThemeToggleProps {
|
|
455
|
+
export declare interface ThemeToggleProps {
|
|
259
456
|
isTransitionEnabled?: boolean;
|
|
260
457
|
transitionDuration?: number;
|
|
261
458
|
transitionEasing?: string;
|
|
262
459
|
size?: 'sm' | 'md' | 'lg';
|
|
263
460
|
radius?: Radius;
|
|
461
|
+
variant?: ButtonVariant;
|
|
462
|
+
getAriaLabel?: (theme: Theme_2) => string;
|
|
264
463
|
}
|
|
265
464
|
|
|
266
|
-
|
|
267
|
-
|
|
465
|
+
export declare function Tooltip({ content, children, position, showOnClick, temporaryContent, temporaryDuration, disabled, radius, onTemporaryShow, className, ref, }: Readonly<TooltipProps>): JSX.Element;
|
|
466
|
+
|
|
467
|
+
export declare type TooltipPosition = 'top' | 'bottom' | 'left' | 'right';
|
|
468
|
+
|
|
469
|
+
export declare interface TooltipProps {
|
|
470
|
+
content: ReactNode;
|
|
471
|
+
children: ReactNode;
|
|
472
|
+
position?: TooltipPosition;
|
|
473
|
+
showOnClick?: boolean;
|
|
474
|
+
temporaryContent?: ReactNode;
|
|
475
|
+
temporaryDuration?: number;
|
|
476
|
+
disabled?: boolean;
|
|
477
|
+
radius?: Radius;
|
|
478
|
+
onTemporaryShow?: () => void;
|
|
479
|
+
className?: string;
|
|
480
|
+
/** Attaches to the wrapper `<span>` around `children`, alongside `Tooltip`'s own internal ref. */
|
|
481
|
+
ref?: Ref<HTMLSpanElement>;
|
|
482
|
+
}
|
|
268
483
|
|
|
269
484
|
export declare function useDisableHotkeysWhileMounted(): void;
|
|
270
485
|
|
|
@@ -272,10 +487,9 @@ export declare const useGlobalHotkeysStore: UseBoundStore<StoreApi<GlobalHotkeys
|
|
|
272
487
|
|
|
273
488
|
export declare const useIsClient: () => boolean;
|
|
274
489
|
|
|
275
|
-
export declare function useRunAfterAnimation(durationMs: number): (callback: () => void) => () => void;
|
|
276
|
-
|
|
277
490
|
export declare const useThemeStore: UseBoundStore<StoreApi<ThemeStore>>;
|
|
278
491
|
|
|
279
|
-
|
|
492
|
+
/** Wraps `Component` so it only renders once the client has mounted. */
|
|
493
|
+
export declare const withClientOnly: <TProps extends object>(Component: React.ComponentType<TProps>) => React.ComponentType<TProps>;
|
|
280
494
|
|
|
281
495
|
export { }
|