@woobee/ui 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +194 -0
- package/SKIPPED.md +58 -0
- package/dist/index.d.mts +578 -0
- package/dist/index.d.ts +578 -0
- package/dist/index.js +3653 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +3594 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +55 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,578 @@
|
|
|
1
|
+
import React, { ButtonHTMLAttributes, ReactNode, CSSProperties, ReactElement, ThHTMLAttributes } from 'react';
|
|
2
|
+
|
|
3
|
+
type ButtonVariant = 'primary' | 'secondary' | 'form-input' | 'flat';
|
|
4
|
+
type ButtonSize = 'small' | 'medium' | 'big' | 'huge';
|
|
5
|
+
interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
onClick?: () => void;
|
|
8
|
+
placeholder?: ReactNode;
|
|
9
|
+
variant?: ButtonVariant;
|
|
10
|
+
size?: ButtonSize;
|
|
11
|
+
className?: string;
|
|
12
|
+
type?: 'button' | 'submit' | 'reset';
|
|
13
|
+
loading?: boolean;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
leftIcon?: ReactNode;
|
|
16
|
+
rightIcon?: ReactNode;
|
|
17
|
+
compact?: boolean;
|
|
18
|
+
}
|
|
19
|
+
declare function Button({ children, onClick, placeholder, variant, size, className, type, loading, disabled, leftIcon, rightIcon, compact, ...props }: ButtonProps): React.JSX.Element;
|
|
20
|
+
|
|
21
|
+
type TagSize = 'small' | 'medium';
|
|
22
|
+
interface TagProps {
|
|
23
|
+
children?: ReactNode;
|
|
24
|
+
className?: string;
|
|
25
|
+
onRemove?: () => void;
|
|
26
|
+
color?: string;
|
|
27
|
+
style?: CSSProperties;
|
|
28
|
+
size?: TagSize;
|
|
29
|
+
}
|
|
30
|
+
declare function Tag({ children, className, onRemove, color, style, size, }: TagProps): React.JSX.Element;
|
|
31
|
+
|
|
32
|
+
interface TagItem {
|
|
33
|
+
id?: string;
|
|
34
|
+
name: string;
|
|
35
|
+
color?: string;
|
|
36
|
+
}
|
|
37
|
+
interface TagGroupProps {
|
|
38
|
+
tags?: TagItem[];
|
|
39
|
+
onRemove?: (tag: TagItem) => void;
|
|
40
|
+
placeholder?: string;
|
|
41
|
+
className?: string;
|
|
42
|
+
}
|
|
43
|
+
declare function TagGroup({ tags, onRemove, placeholder, className, }: TagGroupProps): React.JSX.Element;
|
|
44
|
+
|
|
45
|
+
interface TabOption {
|
|
46
|
+
id: string;
|
|
47
|
+
label: string;
|
|
48
|
+
}
|
|
49
|
+
interface TabsProps {
|
|
50
|
+
value: string;
|
|
51
|
+
onChange: (id: string) => void;
|
|
52
|
+
options?: TabOption[];
|
|
53
|
+
className?: string;
|
|
54
|
+
}
|
|
55
|
+
declare function Tabs({ value, onChange, options, className, }: TabsProps): React.JSX.Element;
|
|
56
|
+
|
|
57
|
+
type ToggleSize = 'small' | 'medium';
|
|
58
|
+
interface ToggleProps {
|
|
59
|
+
listening?: boolean;
|
|
60
|
+
size?: ToggleSize;
|
|
61
|
+
name?: string;
|
|
62
|
+
value: boolean;
|
|
63
|
+
onChange: (value: boolean) => void;
|
|
64
|
+
className?: string;
|
|
65
|
+
}
|
|
66
|
+
declare const Toggle: React.ForwardRefExoticComponent<ToggleProps & React.RefAttributes<HTMLSpanElement>>;
|
|
67
|
+
|
|
68
|
+
type LoadingLayout = 'fixed' | 'fill';
|
|
69
|
+
interface LoadingProps {
|
|
70
|
+
title?: string;
|
|
71
|
+
layout?: LoadingLayout;
|
|
72
|
+
className?: string;
|
|
73
|
+
spinClassName?: string;
|
|
74
|
+
spinSizeClassName?: string;
|
|
75
|
+
}
|
|
76
|
+
declare function Loading({ title, layout, className, spinClassName, spinSizeClassName, }: LoadingProps): React.JSX.Element;
|
|
77
|
+
|
|
78
|
+
interface CheckboxListProps<T = Record<string, unknown>> {
|
|
79
|
+
items?: T[];
|
|
80
|
+
selected?: (T | string)[];
|
|
81
|
+
onToggle?: (item: T) => void;
|
|
82
|
+
itemKey?: string | ((item: T) => string | number);
|
|
83
|
+
itemLabel?: string | ((item: T) => ReactNode);
|
|
84
|
+
isChecked?: (item: T, selected: (T | string)[]) => boolean;
|
|
85
|
+
loading?: boolean;
|
|
86
|
+
placeholder?: ReactNode;
|
|
87
|
+
}
|
|
88
|
+
declare function CheckboxList<T extends Record<string, unknown> = Record<string, unknown>>({ items, selected, onToggle, itemKey, itemLabel, isChecked, loading, placeholder, }: CheckboxListProps<T>): React.JSX.Element;
|
|
89
|
+
|
|
90
|
+
type ConfirmationType = 'danger' | 'warning' | 'info';
|
|
91
|
+
interface ConfirmationBoxProps {
|
|
92
|
+
open: boolean;
|
|
93
|
+
title?: string;
|
|
94
|
+
description?: string;
|
|
95
|
+
cancelText?: string;
|
|
96
|
+
confirmText?: string;
|
|
97
|
+
confirmColor?: string;
|
|
98
|
+
type?: ConfirmationType;
|
|
99
|
+
disabled?: boolean;
|
|
100
|
+
onClose?: () => void;
|
|
101
|
+
onConfirm?: () => void;
|
|
102
|
+
}
|
|
103
|
+
declare function ConfirmationBox({ open, title, description, cancelText, confirmText, confirmColor, type, disabled, onClose, onConfirm, }: ConfirmationBoxProps): React.JSX.Element;
|
|
104
|
+
|
|
105
|
+
type ModalSize = 'small' | 'medium' | 'large' | 'full';
|
|
106
|
+
interface ModalOpts {
|
|
107
|
+
darkMode?: boolean;
|
|
108
|
+
sidebarPosition?: 'left' | 'right';
|
|
109
|
+
mobileSidebarPosition?: 'top' | 'above' | 'bottom';
|
|
110
|
+
}
|
|
111
|
+
interface ModalProps {
|
|
112
|
+
wrapperClassName?: string;
|
|
113
|
+
open: boolean;
|
|
114
|
+
size?: ModalSize;
|
|
115
|
+
title?: string;
|
|
116
|
+
description?: string;
|
|
117
|
+
transparent?: boolean;
|
|
118
|
+
header?: ReactNode;
|
|
119
|
+
sidebar?: ReactNode;
|
|
120
|
+
footer?: ReactNode;
|
|
121
|
+
children?: ReactNode;
|
|
122
|
+
disabled?: boolean;
|
|
123
|
+
onClose?: () => void;
|
|
124
|
+
onExited?: () => void;
|
|
125
|
+
onCancel?: () => void;
|
|
126
|
+
onSubmit?: (e?: React.MouseEvent) => void;
|
|
127
|
+
onChange?: () => void;
|
|
128
|
+
closeText?: string;
|
|
129
|
+
submitText?: string;
|
|
130
|
+
submitColor?: string;
|
|
131
|
+
changeText?: string;
|
|
132
|
+
fullscreen?: boolean;
|
|
133
|
+
opts?: ModalOpts;
|
|
134
|
+
}
|
|
135
|
+
declare function Modal({ wrapperClassName, open, size, title, description, transparent, header, sidebar, footer, children, disabled, onClose, onExited, onCancel, onSubmit, onChange, closeText, submitText, submitColor, changeText, fullscreen, opts, }: ModalProps): React.ReactPortal | null;
|
|
136
|
+
|
|
137
|
+
type DrawerLevel = 'base' | 'middle' | 'top' | 'ceil' | 'extra-wide' | 'full';
|
|
138
|
+
type DrawerTheme = 'WHITE' | 'BLACK' | 'RED' | 'ORANGE' | 'YELLOW' | 'LIME' | 'GREEN' | 'BROWN' | 'BLUE' | 'DARK_BLUE' | 'PURPLE' | 'FLAMINGO' | 'PINK';
|
|
139
|
+
interface DrawerAnimationProps {
|
|
140
|
+
enter?: string;
|
|
141
|
+
enterFrom?: string;
|
|
142
|
+
enterTo?: string;
|
|
143
|
+
leave?: string;
|
|
144
|
+
leaveFrom?: string;
|
|
145
|
+
leaveTo?: string;
|
|
146
|
+
}
|
|
147
|
+
interface DrawerProps {
|
|
148
|
+
theme?: DrawerTheme;
|
|
149
|
+
open: boolean;
|
|
150
|
+
onClose?: () => void;
|
|
151
|
+
title?: string;
|
|
152
|
+
level?: DrawerLevel;
|
|
153
|
+
description?: string;
|
|
154
|
+
children?: ReactNode;
|
|
155
|
+
footer?: ReactNode;
|
|
156
|
+
animation?: DrawerAnimationProps;
|
|
157
|
+
wrapperClassName?: string;
|
|
158
|
+
sectionClassName?: string;
|
|
159
|
+
}
|
|
160
|
+
declare function Drawer({ theme, open, onClose, title, level, description, children, footer, animation, wrapperClassName, sectionClassName, }: DrawerProps): React.JSX.Element;
|
|
161
|
+
|
|
162
|
+
interface TransitionProps {
|
|
163
|
+
show?: boolean;
|
|
164
|
+
appear?: boolean;
|
|
165
|
+
enter?: string;
|
|
166
|
+
enterFrom?: string;
|
|
167
|
+
enterTo?: string;
|
|
168
|
+
leave?: string;
|
|
169
|
+
leaveFrom?: string;
|
|
170
|
+
leaveTo?: string;
|
|
171
|
+
children: ReactElement;
|
|
172
|
+
onEnter?: (node: HTMLElement) => void;
|
|
173
|
+
onEntering?: (node: HTMLElement) => void;
|
|
174
|
+
onEntered?: (node: HTMLElement) => void;
|
|
175
|
+
onExit?: (node: HTMLElement) => void;
|
|
176
|
+
onExiting?: (node: HTMLElement) => void;
|
|
177
|
+
onExited?: (node: HTMLElement) => void;
|
|
178
|
+
}
|
|
179
|
+
declare function Transition({ show, appear, ...rest }: TransitionProps): React.JSX.Element;
|
|
180
|
+
|
|
181
|
+
type SortDirection = 'ASC' | 'DESC';
|
|
182
|
+
interface SortIconProps {
|
|
183
|
+
direction?: SortDirection;
|
|
184
|
+
}
|
|
185
|
+
declare function SortIcon({ direction }: SortIconProps): React.JSX.Element | null;
|
|
186
|
+
|
|
187
|
+
interface InlinePromptProps {
|
|
188
|
+
title: ReactNode;
|
|
189
|
+
onConfirm: () => void;
|
|
190
|
+
className?: string;
|
|
191
|
+
withText?: boolean;
|
|
192
|
+
confirmText?: string;
|
|
193
|
+
cancelText?: string;
|
|
194
|
+
opts?: {
|
|
195
|
+
condensed?: boolean;
|
|
196
|
+
blocked?: boolean;
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
declare function InlinePrompt({ title, onConfirm, className, withText, confirmText, cancelText, opts, }: InlinePromptProps): React.JSX.Element;
|
|
200
|
+
|
|
201
|
+
interface HTMLHeadingProps {
|
|
202
|
+
id?: string;
|
|
203
|
+
className?: string;
|
|
204
|
+
children?: ReactNode;
|
|
205
|
+
}
|
|
206
|
+
declare function H1({ className, children }: HTMLHeadingProps): React.JSX.Element;
|
|
207
|
+
declare function H2({ className, children }: HTMLHeadingProps): React.JSX.Element;
|
|
208
|
+
declare function H3({ id, className, children }: HTMLHeadingProps): React.JSX.Element;
|
|
209
|
+
declare function H4({ id, className, children }: HTMLHeadingProps): React.JSX.Element;
|
|
210
|
+
interface BoldProps {
|
|
211
|
+
children?: ReactNode;
|
|
212
|
+
}
|
|
213
|
+
declare function B({ children }: BoldProps): React.JSX.Element;
|
|
214
|
+
|
|
215
|
+
interface TableProps {
|
|
216
|
+
children?: ReactNode;
|
|
217
|
+
className?: string;
|
|
218
|
+
}
|
|
219
|
+
declare function Table({ children, className }: TableProps): React.JSX.Element;
|
|
220
|
+
|
|
221
|
+
interface TheadProps {
|
|
222
|
+
children?: ReactNode;
|
|
223
|
+
}
|
|
224
|
+
declare function Thead({ children }: TheadProps): React.JSX.Element;
|
|
225
|
+
|
|
226
|
+
interface TrProps {
|
|
227
|
+
children?: ReactNode;
|
|
228
|
+
}
|
|
229
|
+
declare function Tr({ children }: TrProps): React.JSX.Element;
|
|
230
|
+
|
|
231
|
+
interface ThProps extends Omit<ThHTMLAttributes<HTMLTableCellElement>, 'className'> {
|
|
232
|
+
condensed?: boolean;
|
|
233
|
+
className?: string;
|
|
234
|
+
children?: ReactNode;
|
|
235
|
+
sticky?: boolean;
|
|
236
|
+
}
|
|
237
|
+
declare function Th({ condensed, className, children, sticky, ...opts }: ThProps): React.JSX.Element;
|
|
238
|
+
|
|
239
|
+
interface TbodyProps {
|
|
240
|
+
children?: ReactNode;
|
|
241
|
+
}
|
|
242
|
+
declare function Tbody({ children }: TbodyProps): React.JSX.Element;
|
|
243
|
+
|
|
244
|
+
interface TdProps {
|
|
245
|
+
className?: string;
|
|
246
|
+
align?: 'left' | 'center' | 'right';
|
|
247
|
+
colSpan?: number;
|
|
248
|
+
condensed?: boolean;
|
|
249
|
+
narrow?: boolean;
|
|
250
|
+
children?: ReactNode;
|
|
251
|
+
}
|
|
252
|
+
declare function Td({ className, align, colSpan, condensed, narrow, children }: TdProps): React.JSX.Element;
|
|
253
|
+
|
|
254
|
+
type InputType = 'text' | 'password' | 'email' | 'url' | 'date' | 'month' | 'time' | 'date-time' | 'datetime-local' | 'week' | 'number' | 'search' | 'tel' | 'color' | 'radio' | 'checkbox' | 'hidden' | 'button';
|
|
255
|
+
interface InputProps {
|
|
256
|
+
id?: string;
|
|
257
|
+
theme?: string;
|
|
258
|
+
className?: string;
|
|
259
|
+
label?: string;
|
|
260
|
+
placeholder?: string;
|
|
261
|
+
active?: boolean;
|
|
262
|
+
pattern?: string;
|
|
263
|
+
maxLength?: number;
|
|
264
|
+
inputMode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';
|
|
265
|
+
prefix?: string;
|
|
266
|
+
type?: InputType;
|
|
267
|
+
info?: string;
|
|
268
|
+
defaultValue?: string | number;
|
|
269
|
+
checked?: boolean;
|
|
270
|
+
min?: number | string;
|
|
271
|
+
max?: number | string;
|
|
272
|
+
error?: boolean;
|
|
273
|
+
errorMessage?: string;
|
|
274
|
+
readOnly?: boolean;
|
|
275
|
+
name?: string;
|
|
276
|
+
autoComplete?: 'on' | 'off';
|
|
277
|
+
autoFocus?: boolean;
|
|
278
|
+
spellCheck?: boolean;
|
|
279
|
+
noBorder?: boolean;
|
|
280
|
+
listening?: boolean;
|
|
281
|
+
onChange?: (value: string | boolean) => void;
|
|
282
|
+
onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
283
|
+
onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
284
|
+
onClick?: (e: React.MouseEvent<HTMLInputElement>) => void;
|
|
285
|
+
onKeyUp?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
286
|
+
onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
287
|
+
hideIndicator?: boolean;
|
|
288
|
+
darkMode?: boolean;
|
|
289
|
+
}
|
|
290
|
+
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
291
|
+
|
|
292
|
+
interface LabelProps {
|
|
293
|
+
className?: string;
|
|
294
|
+
error?: boolean;
|
|
295
|
+
htmlFor?: string;
|
|
296
|
+
info?: string;
|
|
297
|
+
mandatory?: boolean;
|
|
298
|
+
opts?: {
|
|
299
|
+
dark?: boolean;
|
|
300
|
+
};
|
|
301
|
+
children?: ReactNode;
|
|
302
|
+
}
|
|
303
|
+
declare function Label({ className, error, htmlFor, info, mandatory, opts, children, }: LabelProps): React.JSX.Element;
|
|
304
|
+
|
|
305
|
+
interface SelectProps {
|
|
306
|
+
id?: string;
|
|
307
|
+
loading?: boolean;
|
|
308
|
+
className?: string;
|
|
309
|
+
onChange?: (e: React.ChangeEvent<HTMLSelectElement>) => void;
|
|
310
|
+
error?: boolean;
|
|
311
|
+
errorMessage?: string;
|
|
312
|
+
info?: string;
|
|
313
|
+
readOnly?: boolean;
|
|
314
|
+
name?: string;
|
|
315
|
+
children?: ReactNode;
|
|
316
|
+
value?: string | number;
|
|
317
|
+
}
|
|
318
|
+
declare const Select: React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<HTMLSelectElement>>;
|
|
319
|
+
|
|
320
|
+
interface SelectInputItem {
|
|
321
|
+
id: string;
|
|
322
|
+
name: string;
|
|
323
|
+
}
|
|
324
|
+
interface SelectInputProps {
|
|
325
|
+
className?: string;
|
|
326
|
+
placeholder?: string;
|
|
327
|
+
items?: SelectInputItem[];
|
|
328
|
+
selectedValue?: string;
|
|
329
|
+
readOnly?: boolean;
|
|
330
|
+
error?: boolean;
|
|
331
|
+
onChange?: (value: string) => void;
|
|
332
|
+
}
|
|
333
|
+
declare const SelectInput: React.ForwardRefExoticComponent<SelectInputProps & React.RefAttributes<HTMLSelectElement>>;
|
|
334
|
+
|
|
335
|
+
interface TextareaProps {
|
|
336
|
+
id?: string;
|
|
337
|
+
className?: string;
|
|
338
|
+
onChange?: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
339
|
+
onFocus?: (e: React.FocusEvent<HTMLTextAreaElement>) => void;
|
|
340
|
+
onMouseDown?: (e: React.MouseEvent<HTMLTextAreaElement>) => void;
|
|
341
|
+
placeholder?: string;
|
|
342
|
+
error?: boolean;
|
|
343
|
+
errorMessage?: string;
|
|
344
|
+
info?: string;
|
|
345
|
+
readOnly?: boolean;
|
|
346
|
+
name?: string;
|
|
347
|
+
defaultValue?: string;
|
|
348
|
+
rows?: number;
|
|
349
|
+
opts?: {
|
|
350
|
+
plateFocus?: string;
|
|
351
|
+
};
|
|
352
|
+
autoFocus?: boolean;
|
|
353
|
+
}
|
|
354
|
+
declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
355
|
+
|
|
356
|
+
interface TagInputProps {
|
|
357
|
+
name?: string;
|
|
358
|
+
defaultValue?: string[];
|
|
359
|
+
onChange?: (tags: string[]) => void;
|
|
360
|
+
placeholder?: string;
|
|
361
|
+
}
|
|
362
|
+
declare function TagInput({ name, defaultValue, onChange, placeholder, }: TagInputProps): React.JSX.Element;
|
|
363
|
+
|
|
364
|
+
interface NoDataProps {
|
|
365
|
+
className?: string;
|
|
366
|
+
}
|
|
367
|
+
declare function NoData({ className }: NoDataProps): React.JSX.Element;
|
|
368
|
+
|
|
369
|
+
declare function ThemeToggle(): React.JSX.Element;
|
|
370
|
+
|
|
371
|
+
interface PopoverActionItem {
|
|
372
|
+
id: string;
|
|
373
|
+
label: string;
|
|
374
|
+
action?: () => void | Promise<void>;
|
|
375
|
+
onClick?: () => void | Promise<void>;
|
|
376
|
+
}
|
|
377
|
+
interface PopoverAction {
|
|
378
|
+
id: string;
|
|
379
|
+
section?: string;
|
|
380
|
+
items: PopoverActionItem[];
|
|
381
|
+
}
|
|
382
|
+
interface PopoverState {
|
|
383
|
+
show: boolean;
|
|
384
|
+
style: React.CSSProperties | null;
|
|
385
|
+
tooltipStyle: React.CSSProperties | null;
|
|
386
|
+
position: 'top' | 'bottom' | null;
|
|
387
|
+
description?: string | null;
|
|
388
|
+
actions: PopoverAction[] | null;
|
|
389
|
+
}
|
|
390
|
+
interface PopoverContextProps {
|
|
391
|
+
showPopover: boolean;
|
|
392
|
+
setPopover: (params: PopoverState) => void;
|
|
393
|
+
}
|
|
394
|
+
declare const PopoverContext: React.Context<PopoverContextProps | undefined>;
|
|
395
|
+
declare function PopoverProvider({ children }: {
|
|
396
|
+
children: React.ReactNode;
|
|
397
|
+
}): React.JSX.Element;
|
|
398
|
+
declare function usePopoverContext(): PopoverContextProps;
|
|
399
|
+
|
|
400
|
+
interface PopoverProps {
|
|
401
|
+
className?: string;
|
|
402
|
+
description?: string | null;
|
|
403
|
+
actions: PopoverAction[];
|
|
404
|
+
children: React.ReactNode;
|
|
405
|
+
opts?: {
|
|
406
|
+
activated?: boolean;
|
|
407
|
+
condensed?: boolean;
|
|
408
|
+
compact?: boolean;
|
|
409
|
+
asBlock?: boolean;
|
|
410
|
+
align?: string;
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
declare function Popover({ className, description, actions, children, opts }: PopoverProps): React.JSX.Element;
|
|
414
|
+
|
|
415
|
+
interface DraggerProps {
|
|
416
|
+
type?: 'table' | 'div';
|
|
417
|
+
parentClassName?: string;
|
|
418
|
+
header?: React.ReactNode;
|
|
419
|
+
records: any[];
|
|
420
|
+
timestamp?: any;
|
|
421
|
+
disabled?: boolean;
|
|
422
|
+
children: React.ReactElement;
|
|
423
|
+
onChange?: (updatedRecords: any[]) => void;
|
|
424
|
+
}
|
|
425
|
+
declare function Dragger({ type, parentClassName, header, records, timestamp, disabled, children, onChange }: DraggerProps): React.JSX.Element;
|
|
426
|
+
|
|
427
|
+
interface ExcelColumn {
|
|
428
|
+
id: string;
|
|
429
|
+
label: string | React.ReactNode;
|
|
430
|
+
width?: string;
|
|
431
|
+
align?: 'left' | 'center' | 'right';
|
|
432
|
+
type?: 'text' | 'number' | 'textarea' | 'checkbox';
|
|
433
|
+
}
|
|
434
|
+
interface ExcelTableProps {
|
|
435
|
+
columns: ExcelColumn[];
|
|
436
|
+
data: any[];
|
|
437
|
+
onChange?: (newData: any[]) => void;
|
|
438
|
+
onRowAdd?: () => void;
|
|
439
|
+
onRowDelete?: (index: number) => void;
|
|
440
|
+
placeholder?: string | ((rowIndex: number) => string);
|
|
441
|
+
isAddRowVisible?: boolean;
|
|
442
|
+
addRowLabel?: string;
|
|
443
|
+
}
|
|
444
|
+
declare function ExcelTable({ columns, data, onChange, onRowAdd, onRowDelete, placeholder, isAddRowVisible, addRowLabel }: ExcelTableProps): React.JSX.Element;
|
|
445
|
+
|
|
446
|
+
interface CoverflowImage {
|
|
447
|
+
id?: string | number;
|
|
448
|
+
imageUrl: string;
|
|
449
|
+
imageTitle?: string;
|
|
450
|
+
imageDescription?: string;
|
|
451
|
+
}
|
|
452
|
+
interface CoverflowProps {
|
|
453
|
+
images: CoverflowImage[];
|
|
454
|
+
onClose?: () => void;
|
|
455
|
+
}
|
|
456
|
+
declare function Coverflow({ images, onClose }: CoverflowProps): React.ReactPortal | null;
|
|
457
|
+
|
|
458
|
+
interface DataGridHeaderConfig {
|
|
459
|
+
id: string;
|
|
460
|
+
label: string;
|
|
461
|
+
align?: 'left' | 'center' | 'right';
|
|
462
|
+
grow?: boolean;
|
|
463
|
+
noWrap?: boolean;
|
|
464
|
+
sort?: boolean;
|
|
465
|
+
type?: 'currency' | 'number' | 'change' | 'datetime' | 'thumbnail' | 'text';
|
|
466
|
+
hidden?: boolean;
|
|
467
|
+
error?: string;
|
|
468
|
+
menu?: any[];
|
|
469
|
+
params?: any;
|
|
470
|
+
vertical?: string;
|
|
471
|
+
lineClamp?: number;
|
|
472
|
+
}
|
|
473
|
+
interface DataGridProps {
|
|
474
|
+
headers: DataGridHeaderConfig[];
|
|
475
|
+
data: any[];
|
|
476
|
+
selectedId?: string | null;
|
|
477
|
+
footers?: any[] | null;
|
|
478
|
+
opts?: {
|
|
479
|
+
stickyHeader?: boolean;
|
|
480
|
+
darkMode?: boolean;
|
|
481
|
+
showCurrency?: boolean;
|
|
482
|
+
labelTitle?: string;
|
|
483
|
+
labelCentered?: boolean;
|
|
484
|
+
vertical?: string;
|
|
485
|
+
};
|
|
486
|
+
onSelect?: (row: any) => void;
|
|
487
|
+
}
|
|
488
|
+
declare function DataGrid({ headers, data, selectedId, footers, opts, onSelect }: DataGridProps): React.JSX.Element;
|
|
489
|
+
|
|
490
|
+
interface ModalContextValue {
|
|
491
|
+
modalShowing: boolean;
|
|
492
|
+
drawerShowing: boolean;
|
|
493
|
+
setModalShowing: (value: boolean) => void;
|
|
494
|
+
setDrawerShowing: (value: boolean) => void;
|
|
495
|
+
}
|
|
496
|
+
declare const ModalContext: React.Context<ModalContextValue>;
|
|
497
|
+
declare function useModalContext(): ModalContextValue;
|
|
498
|
+
interface ModalProviderProps {
|
|
499
|
+
children: ReactNode;
|
|
500
|
+
}
|
|
501
|
+
declare function ModalProvider({ children }: ModalProviderProps): React.JSX.Element;
|
|
502
|
+
|
|
503
|
+
interface ThemeContextProps {
|
|
504
|
+
theme: string;
|
|
505
|
+
darkMode: boolean;
|
|
506
|
+
handleToggleTheme: (theme: string) => void;
|
|
507
|
+
}
|
|
508
|
+
declare const ThemeContext: React.Context<ThemeContextProps | undefined>;
|
|
509
|
+
interface ThemeProviderProps {
|
|
510
|
+
children: React.ReactNode;
|
|
511
|
+
defaultTheme?: string;
|
|
512
|
+
}
|
|
513
|
+
declare function ThemeProvider({ children, defaultTheme }: ThemeProviderProps): React.JSX.Element;
|
|
514
|
+
declare function useThemeContext(): ThemeContextProps;
|
|
515
|
+
|
|
516
|
+
declare function useDebounce<T extends (...args: any[]) => void>(callback: T, delay: number, deps?: any[]): ((this: any, ...args: Parameters<T>) => void)[];
|
|
517
|
+
|
|
518
|
+
interface ResizeListenerProps {
|
|
519
|
+
mobileAgent?: boolean;
|
|
520
|
+
}
|
|
521
|
+
interface ResizeValues {
|
|
522
|
+
screenWidth: number;
|
|
523
|
+
screenHeight: number;
|
|
524
|
+
viewport: 'mobile' | 'desktop' | null;
|
|
525
|
+
viewMode: 'portrait-view' | 'landscape-view' | null;
|
|
526
|
+
mobileView: boolean | null;
|
|
527
|
+
tabletView: boolean | null;
|
|
528
|
+
}
|
|
529
|
+
declare function useResizeListener(props?: ResizeListenerProps): {
|
|
530
|
+
screenWidth: number;
|
|
531
|
+
screenHeight: number;
|
|
532
|
+
viewport: "mobile" | "desktop" | null;
|
|
533
|
+
viewMode: "portrait-view" | "landscape-view" | null;
|
|
534
|
+
mobileView: boolean | null;
|
|
535
|
+
tabletView: boolean | null;
|
|
536
|
+
};
|
|
537
|
+
|
|
538
|
+
/**
|
|
539
|
+
* Builds a className string from an object mapping class names to boolean values.
|
|
540
|
+
*
|
|
541
|
+
* @example
|
|
542
|
+
* classNames({ "text-sm": true, "font-bold": isActive, "hidden": false })
|
|
543
|
+
* // => "text-sm font-bold" (if isActive is true)
|
|
544
|
+
*/
|
|
545
|
+
declare function classNames(classNameHash: Record<string, boolean | undefined | null>): string;
|
|
546
|
+
/**
|
|
547
|
+
* Converts a space-separated className string into an object mapping each
|
|
548
|
+
* class name to `true`. Useful for spreading into a `classNames()` call.
|
|
549
|
+
*
|
|
550
|
+
* @example
|
|
551
|
+
* classNameObject("text-sm font-bold")
|
|
552
|
+
* // => { "text-sm": true, "font-bold": true }
|
|
553
|
+
*/
|
|
554
|
+
declare function classNameObject(classNameString?: string | null): Record<string, boolean>;
|
|
555
|
+
|
|
556
|
+
declare function bestTextColorForBg(hex?: string | null): 'white' | 'black';
|
|
557
|
+
declare const numberFormatter: (x?: number | string | null, decimal?: number | null, opts?: {
|
|
558
|
+
decimalSign?: string;
|
|
559
|
+
thousandSign?: string;
|
|
560
|
+
}) => string;
|
|
561
|
+
declare function moveItem<T>(items: T[], movedItem: T, fromIndex: number, toIndex: number): T[];
|
|
562
|
+
|
|
563
|
+
declare function debounce<T extends (...args: any[]) => void>(fn: T, delay: number): (this: any, ...args: Parameters<T>) => void;
|
|
564
|
+
|
|
565
|
+
interface ModalFooterProps {
|
|
566
|
+
footer?: ReactNode;
|
|
567
|
+
disabled?: boolean;
|
|
568
|
+
onCancel?: () => void;
|
|
569
|
+
onSubmit?: (e?: React.MouseEvent) => void;
|
|
570
|
+
onChange?: () => void;
|
|
571
|
+
closeText?: string;
|
|
572
|
+
submitText?: string;
|
|
573
|
+
submitColor?: string;
|
|
574
|
+
changeText?: string;
|
|
575
|
+
darkMode?: boolean;
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
export { B, type BoldProps, Button, type ButtonProps, type ButtonSize, type ButtonVariant, CheckboxList, type CheckboxListProps, ConfirmationBox, type ConfirmationBoxProps, type ConfirmationType, Coverflow, type CoverflowImage, type CoverflowProps, DataGrid, type DataGridHeaderConfig, type DataGridProps, Dragger, type DraggerProps, Drawer, type DrawerAnimationProps, type DrawerLevel, type DrawerProps, type DrawerTheme, type ExcelColumn, ExcelTable, type ExcelTableProps, H1, H2, H3, H4, type HTMLHeadingProps, InlinePrompt, type InlinePromptProps, Input, type InputProps, type InputType, Label, type LabelProps, Loading, type LoadingLayout, type LoadingProps, Modal, ModalContext, type ModalFooterProps, type ModalOpts, type ModalProps, ModalProvider, type ModalSize, NoData, type NoDataProps, Popover, type PopoverAction, type PopoverActionItem, PopoverContext, type PopoverContextProps, type PopoverProps, PopoverProvider, type PopoverState, type ResizeListenerProps, type ResizeValues, Select, SelectInput, type SelectInputItem, type SelectInputProps, type SelectProps, type SortDirection, SortIcon, type SortIconProps, type TabOption, Table, type TableProps, Tabs, type TabsProps, Tag, TagGroup, type TagGroupProps, TagInput, type TagInputProps, type TagItem, type TagProps, type TagSize, Tbody, Td, type TdProps, Textarea, type TextareaProps, Th, type ThProps, Thead, ThemeContext, type ThemeContextProps, ThemeProvider, ThemeToggle, Toggle, type ToggleProps, type ToggleSize, Tr, Transition, type TransitionProps, bestTextColorForBg, classNameObject, classNames, debounce, moveItem, numberFormatter, useDebounce, useModalContext, usePopoverContext, useResizeListener, useThemeContext };
|