@tanishraj/ui-kit 1.1.1 → 2.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/dist/index.cjs.js +2 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +263 -1
- package/dist/index.es.js +50 -13
- package/dist/index.es.js.map +1 -1
- package/package.json +2 -1
- package/readme.md +154 -24
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,47 @@
|
|
|
1
|
+
import { AnchorHTMLAttributes } from 'react';
|
|
1
2
|
import { ClassProp } from 'class-variance-authority/types';
|
|
2
3
|
import { ClassValue } from 'clsx';
|
|
3
4
|
import { ComponentPropsWithoutRef } from 'react';
|
|
4
5
|
import { ComponentPropsWithRef } from 'react';
|
|
5
6
|
import { FC } from 'react';
|
|
7
|
+
import { FieldsetHTMLAttributes } from 'react';
|
|
6
8
|
import { ForwardRefExoticComponent } from 'react';
|
|
7
9
|
import { HTMLAttributes } from 'react';
|
|
10
|
+
import { ReactElement } from 'react';
|
|
8
11
|
import { ReactNode } from 'react';
|
|
12
|
+
import { Ref } from 'react';
|
|
9
13
|
import { RefAttributes } from 'react';
|
|
14
|
+
import { RefObject } from 'react';
|
|
10
15
|
import { RemoveNull as RemoveNull_2 } from '../../../utils';
|
|
11
16
|
import { SVGProps } from 'react';
|
|
12
17
|
import { VariantProps } from 'class-variance-authority';
|
|
13
18
|
|
|
19
|
+
export declare const Accordion: FC<AccordionProps>;
|
|
20
|
+
|
|
21
|
+
export declare interface AccordionItem {
|
|
22
|
+
value: string;
|
|
23
|
+
title: ReactNode;
|
|
24
|
+
content: ReactNode;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export declare interface AccordionProps extends ComponentPropsWithRef<'div'>, RemoveNull_2<VariantProps<typeof accordionRootStyles>> {
|
|
29
|
+
items: AccordionItem[];
|
|
30
|
+
type?: AccordionType;
|
|
31
|
+
value?: string | string[];
|
|
32
|
+
defaultValue?: string | string[];
|
|
33
|
+
onValueChange?: (value: string | string[] | undefined) => void;
|
|
34
|
+
collapsible?: boolean;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
declare const accordionRootStyles: (props?: ({
|
|
38
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
39
|
+
} & ClassProp) | undefined) => string;
|
|
40
|
+
|
|
41
|
+
export declare type AccordionSizes = RemoveNull_2<VariantProps<typeof accordionRootStyles>>['size'];
|
|
42
|
+
|
|
43
|
+
export declare type AccordionType = 'single' | 'multiple';
|
|
44
|
+
|
|
14
45
|
export declare const Alert: FC<AlertProps>;
|
|
15
46
|
|
|
16
47
|
export declare type AlertAppearances = RemoveNull_2<VariantProps<typeof alertWrapperStyles>>['appearance'];
|
|
@@ -33,6 +64,15 @@ declare const alertWrapperStyles: (props?: ({
|
|
|
33
64
|
inverted?: boolean | null | undefined;
|
|
34
65
|
} & ClassProp) | undefined) => string;
|
|
35
66
|
|
|
67
|
+
export declare const AnimatePresence: FC<AnimatePresenceProps>;
|
|
68
|
+
|
|
69
|
+
export declare const AnimatePresenceChild: FC<PresenceChildProps>;
|
|
70
|
+
|
|
71
|
+
declare interface AnimatePresenceProps {
|
|
72
|
+
children: ReactElement | ReactElement[];
|
|
73
|
+
presence: boolean;
|
|
74
|
+
}
|
|
75
|
+
|
|
36
76
|
export declare const Avatar: FC<AvatarProps>;
|
|
37
77
|
|
|
38
78
|
declare const avatarContainerStyles: (props?: ({
|
|
@@ -114,13 +154,37 @@ export declare type BadgeVariants = RemoveNull_2<VariantProps<typeof badgeVarian
|
|
|
114
154
|
|
|
115
155
|
declare const badgeVariants: (props?: ({
|
|
116
156
|
variant?: "default" | "primary" | "info" | "success" | "warning" | "danger" | null | undefined;
|
|
117
|
-
appearance?: "icon" | "
|
|
157
|
+
appearance?: "icon" | "text" | "dots" | null | undefined;
|
|
118
158
|
size?: "sm" | "md" | "lg" | null | undefined;
|
|
119
159
|
shape?: "circle" | "square" | null | undefined;
|
|
120
160
|
inverted?: boolean | null | undefined;
|
|
121
161
|
hasIcon?: boolean | null | undefined;
|
|
122
162
|
} & ClassProp) | undefined) => string;
|
|
123
163
|
|
|
164
|
+
export declare const Breadcrumb: FC<BreadcrumbProps>;
|
|
165
|
+
|
|
166
|
+
export declare type BreadcrumbAppearances = RemoveNull_2<VariantProps<typeof breadcrumbStyles>>['appearance'];
|
|
167
|
+
|
|
168
|
+
export declare interface BreadcrumbItem extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'children'> {
|
|
169
|
+
id?: string;
|
|
170
|
+
label: ReactNode;
|
|
171
|
+
icon?: FC<SVGProps<SVGSVGElement>>;
|
|
172
|
+
current?: boolean;
|
|
173
|
+
disabled?: boolean;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export declare interface BreadcrumbProps extends HTMLAttributes<HTMLElement> {
|
|
177
|
+
items: BreadcrumbItem[];
|
|
178
|
+
appearance?: BreadcrumbAppearances;
|
|
179
|
+
separator?: BreadcrumbSeparators;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export declare type BreadcrumbSeparators = '/' | '>';
|
|
183
|
+
|
|
184
|
+
declare const breadcrumbStyles: (props?: ({
|
|
185
|
+
appearance?: "outline" | "ghost" | null | undefined;
|
|
186
|
+
} & ClassProp) | undefined) => string;
|
|
187
|
+
|
|
124
188
|
export declare const Button: FC<ButtonProps>;
|
|
125
189
|
|
|
126
190
|
export declare type ButtonAppearances = RemoveNull_2<VariantProps<typeof buttonStyles>>['appearance'];
|
|
@@ -164,13 +228,164 @@ declare const buttonStyles: (props?: ({
|
|
|
164
228
|
|
|
165
229
|
export declare type ButtonVariants = RemoveNull_2<VariantProps<typeof buttonStyles>>['variant'];
|
|
166
230
|
|
|
231
|
+
export declare const Checkbox: FC<CheckboxProps>;
|
|
232
|
+
|
|
233
|
+
declare const checkboxControlStyles: (props?: ({
|
|
234
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
235
|
+
shape?: "circle" | "square" | null | undefined;
|
|
236
|
+
invalid?: boolean | null | undefined;
|
|
237
|
+
indeterminate?: boolean | null | undefined;
|
|
238
|
+
} & ClassProp) | undefined) => string;
|
|
239
|
+
|
|
240
|
+
export declare const CheckboxGroup: FC<CheckboxGroupProps>;
|
|
241
|
+
|
|
242
|
+
export declare interface CheckboxGroupOption extends Omit<CheckboxProps, 'checked' | 'defaultChecked' | 'children' | 'error' | 'name' | 'ref' | 'size' | 'type' | 'value'> {
|
|
243
|
+
value: string;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export declare type CheckboxGroupOrientation = 'horizontal' | 'vertical';
|
|
247
|
+
|
|
248
|
+
export declare interface CheckboxGroupProps extends Omit<FieldsetHTMLAttributes<HTMLFieldSetElement>, 'children' | 'defaultValue' | 'onChange' | 'value'> {
|
|
249
|
+
options: CheckboxGroupOption[];
|
|
250
|
+
value?: string[];
|
|
251
|
+
defaultValue?: string[];
|
|
252
|
+
onValueChange?: (value: string[]) => void;
|
|
253
|
+
name?: string;
|
|
254
|
+
label?: ReactNode;
|
|
255
|
+
description?: ReactNode;
|
|
256
|
+
error?: ReactNode;
|
|
257
|
+
size?: CheckboxGroupSizes;
|
|
258
|
+
shape?: CheckboxGroupShapes;
|
|
259
|
+
orientation?: CheckboxGroupOrientation;
|
|
260
|
+
required?: boolean;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
export declare type CheckboxGroupShapes = CheckboxShapes;
|
|
264
|
+
|
|
265
|
+
export declare type CheckboxGroupSizes = CheckboxSizes;
|
|
266
|
+
|
|
267
|
+
export declare interface CheckboxProps extends Omit<ComponentPropsWithRef<'input'>, 'children' | 'size' | 'type'> {
|
|
268
|
+
label?: ReactNode;
|
|
269
|
+
description?: ReactNode;
|
|
270
|
+
error?: ReactNode;
|
|
271
|
+
size?: CheckboxSizes;
|
|
272
|
+
shape?: CheckboxShapes;
|
|
273
|
+
indeterminate?: boolean;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
export declare type CheckboxShapes = RemoveNull_2<VariantProps<typeof checkboxControlStyles>>['shape'];
|
|
277
|
+
|
|
278
|
+
export declare type CheckboxSizes = RemoveNull_2<VariantProps<typeof checkboxControlStyles>>['size'];
|
|
279
|
+
|
|
280
|
+
export declare const Chip: FC<ChipProps>;
|
|
281
|
+
|
|
282
|
+
export declare type ChipIcon = FC<SVGProps<SVGSVGElement>>;
|
|
283
|
+
|
|
284
|
+
export declare interface ChipProps extends Omit<ComponentPropsWithoutRef<'span'>, 'children'>, RemoveNull_2<Omit<VariantProps<typeof chipStyles>, 'disabled' | 'hasLeadingVisual' | 'removable'>> {
|
|
285
|
+
children: string | number;
|
|
286
|
+
icon?: ChipIcon;
|
|
287
|
+
disabled?: boolean;
|
|
288
|
+
onClose?: () => void;
|
|
289
|
+
closeLabel?: string;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
export declare type ChipShapes = RemoveNull_2<VariantProps<typeof chipStyles>>['shape'];
|
|
293
|
+
|
|
294
|
+
export declare type ChipSizes = RemoveNull_2<VariantProps<typeof chipStyles>>['size'];
|
|
295
|
+
|
|
296
|
+
declare const chipStyles: (props?: ({
|
|
297
|
+
variant?: "default" | "primary" | "info" | "success" | "warning" | "danger" | null | undefined;
|
|
298
|
+
appearance?: "filled" | "outline" | null | undefined;
|
|
299
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
300
|
+
shape?: "circle" | "square" | null | undefined;
|
|
301
|
+
disabled?: boolean | null | undefined;
|
|
302
|
+
hasLeadingVisual?: boolean | null | undefined;
|
|
303
|
+
removable?: boolean | null | undefined;
|
|
304
|
+
inverted?: boolean | null | undefined;
|
|
305
|
+
} & ClassProp) | undefined) => string;
|
|
306
|
+
|
|
307
|
+
export declare type ChipVariants = RemoveNull_2<VariantProps<typeof chipStyles>>['variant'];
|
|
308
|
+
|
|
167
309
|
export declare const cn: (...inputs: ClassValue[]) => string;
|
|
168
310
|
|
|
311
|
+
export declare const Divider: FC<DividerProps>;
|
|
312
|
+
|
|
313
|
+
export declare type DividerOrientations = RemoveNull_2<VariantProps<typeof dividerRootStyles>>['orientation'];
|
|
314
|
+
|
|
315
|
+
export declare interface DividerProps extends HTMLAttributes<HTMLDivElement> {
|
|
316
|
+
children?: ReactNode;
|
|
317
|
+
orientation?: DividerOrientations;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
declare const dividerRootStyles: (props?: ({
|
|
321
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
322
|
+
hasContent?: boolean | null | undefined;
|
|
323
|
+
} & ClassProp) | undefined) => string;
|
|
324
|
+
|
|
325
|
+
export declare const Drawer: FC<DrawerProps>;
|
|
326
|
+
|
|
327
|
+
declare const drawerPanelStyles: (props?: ({
|
|
328
|
+
placement?: "right" | "left" | "top" | "bottom" | null | undefined;
|
|
329
|
+
size?: "sm" | "md" | "lg" | "full" | null | undefined;
|
|
330
|
+
} & ClassProp) | undefined) => string;
|
|
331
|
+
|
|
332
|
+
export declare type DrawerPlacements = RemoveNull_2<VariantProps<typeof drawerPanelStyles>>['placement'];
|
|
333
|
+
|
|
334
|
+
export declare interface DrawerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'>, RemoveNull_2<VariantProps<typeof drawerPanelStyles>> {
|
|
335
|
+
open: boolean;
|
|
336
|
+
children?: ReactNode;
|
|
337
|
+
title?: ReactNode;
|
|
338
|
+
description?: ReactNode;
|
|
339
|
+
footer?: ReactNode;
|
|
340
|
+
onClose?: () => void;
|
|
341
|
+
closeLabel?: string;
|
|
342
|
+
closeOnEscape?: boolean;
|
|
343
|
+
closeOnOverlayClick?: boolean;
|
|
344
|
+
container?: HTMLElement | null | undefined;
|
|
345
|
+
containerId?: string | undefined;
|
|
346
|
+
containerRef?: RefObject<HTMLElement | null> | undefined;
|
|
347
|
+
disablePortal?: boolean;
|
|
348
|
+
showCloseButton?: boolean;
|
|
349
|
+
showOverlay?: boolean;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
export declare type DrawerSizes = RemoveNull_2<VariantProps<typeof drawerPanelStyles>>['size'];
|
|
353
|
+
|
|
169
354
|
declare enum EThemeOptions {
|
|
170
355
|
LIGHT = "light",
|
|
171
356
|
DARK = "dark"
|
|
172
357
|
}
|
|
173
358
|
|
|
359
|
+
export declare const Link: FC<LinkProps>;
|
|
360
|
+
|
|
361
|
+
export declare type LinkIcon = FC<SVGProps<SVGSVGElement>>;
|
|
362
|
+
|
|
363
|
+
export declare interface LinkProps extends Omit<ComponentPropsWithRef<'a'>, 'children'>, RemoveNull_2<Omit<VariantProps<typeof linkStyles>, 'disabled' | 'truncate'>> {
|
|
364
|
+
children: ReactNode;
|
|
365
|
+
leadingIcon?: LinkIcon;
|
|
366
|
+
trailingIcon?: LinkIcon;
|
|
367
|
+
external?: boolean;
|
|
368
|
+
disabled?: boolean;
|
|
369
|
+
truncate?: boolean;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
export declare type LinkSizes = RemoveNull_2<VariantProps<typeof linkStyles>>['size'];
|
|
373
|
+
|
|
374
|
+
declare const linkStyles: (props?: ({
|
|
375
|
+
variant?: "default" | "primary" | "info" | "success" | "warning" | "danger" | null | undefined;
|
|
376
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
377
|
+
underline?: "none" | "hover" | "always" | null | undefined;
|
|
378
|
+
disabled?: boolean | null | undefined;
|
|
379
|
+
inverted?: boolean | null | undefined;
|
|
380
|
+
truncate?: boolean | null | undefined;
|
|
381
|
+
} & ClassProp) | undefined) => string;
|
|
382
|
+
|
|
383
|
+
export declare type LinkUnderline = RemoveNull_2<VariantProps<typeof linkStyles>>['underline'];
|
|
384
|
+
|
|
385
|
+
export declare type LinkVariants = RemoveNull_2<VariantProps<typeof linkStyles>>['variant'];
|
|
386
|
+
|
|
387
|
+
export declare const mergeRefs: <T>(...refs: Array<PossibleRef<T>>) => (node: T | null) => (() => void) | undefined;
|
|
388
|
+
|
|
174
389
|
export declare const OrganizationChart: ForwardRefExoticComponent<OrgChartComponentProps & RefAttributes<OrgChartRef>>;
|
|
175
390
|
|
|
176
391
|
export declare interface OrgChartApiNodeData {
|
|
@@ -241,6 +456,53 @@ export declare interface OrgChartRef {
|
|
|
241
456
|
collapseAll: () => void;
|
|
242
457
|
}
|
|
243
458
|
|
|
459
|
+
export declare const Popover: FC<PopoverProps>;
|
|
460
|
+
|
|
461
|
+
export declare type PopoverAlignments = 'start' | 'center' | 'end';
|
|
462
|
+
|
|
463
|
+
declare const popoverIconStyles: (props?: ({
|
|
464
|
+
variant?: "default" | "primary" | "info" | "success" | "warning" | "danger" | null | undefined;
|
|
465
|
+
} & ClassProp) | undefined) => string;
|
|
466
|
+
|
|
467
|
+
export declare type PopoverPlacements = 'top' | 'right' | 'bottom' | 'left';
|
|
468
|
+
|
|
469
|
+
export declare interface PopoverProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'>, RemoveNull_2<VariantProps<typeof popoverIconStyles>> {
|
|
470
|
+
trigger?: ReactNode;
|
|
471
|
+
title?: ReactNode;
|
|
472
|
+
children?: ReactNode;
|
|
473
|
+
placement?: PopoverPlacements;
|
|
474
|
+
align?: PopoverAlignments;
|
|
475
|
+
open?: boolean;
|
|
476
|
+
defaultOpen?: boolean;
|
|
477
|
+
onOpenChange?: (open: boolean) => void;
|
|
478
|
+
closeLabel?: string;
|
|
479
|
+
closeOnEscape?: boolean;
|
|
480
|
+
closeOnOutsideClick?: boolean;
|
|
481
|
+
showArrow?: boolean;
|
|
482
|
+
showCloseButton?: boolean;
|
|
483
|
+
showSlotBorder?: boolean;
|
|
484
|
+
contentClassName?: string;
|
|
485
|
+
triggerClassName?: string;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
export declare type PopoverVariants = RemoveNull_2<VariantProps<typeof popoverIconStyles>>['variant'];
|
|
489
|
+
|
|
490
|
+
export declare const Portal: FC<PortalProps>;
|
|
491
|
+
|
|
492
|
+
export declare interface PortalProps {
|
|
493
|
+
children: ReactNode;
|
|
494
|
+
container?: HTMLElement | null | undefined;
|
|
495
|
+
containerId?: string | undefined;
|
|
496
|
+
containerRef?: RefObject<HTMLElement | null> | undefined;
|
|
497
|
+
disabled?: boolean;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
declare type PossibleRef<T> = Ref<T> | undefined;
|
|
501
|
+
|
|
502
|
+
declare interface PresenceChildProps {
|
|
503
|
+
children: ReactElement;
|
|
504
|
+
}
|
|
505
|
+
|
|
244
506
|
export declare type RemoveNull<T> = {
|
|
245
507
|
[K in keyof T]: Exclude<T[K], null>;
|
|
246
508
|
};
|