@tanishraj/ui-kit 2.1.1 → 2.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/dist/index.cjs.js +2 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +79 -1
- package/dist/index.es.js +53 -48
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
- package/readme.md +10 -0
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { FC } from 'react';
|
|
|
7
7
|
import { FieldsetHTMLAttributes } from 'react';
|
|
8
8
|
import { ForwardRefExoticComponent } from 'react';
|
|
9
9
|
import { HTMLAttributes } from 'react';
|
|
10
|
+
import { Placement } from '@floating-ui/react';
|
|
10
11
|
import { ReactElement } from 'react';
|
|
11
12
|
import { ReactNode } from 'react';
|
|
12
13
|
import { Ref } from 'react';
|
|
@@ -325,7 +326,7 @@ declare const dividerRootStyles: (props?: ({
|
|
|
325
326
|
export declare const Drawer: FC<DrawerProps>;
|
|
326
327
|
|
|
327
328
|
declare const drawerPanelStyles: (props?: ({
|
|
328
|
-
placement?: "
|
|
329
|
+
placement?: "top" | "right" | "bottom" | "left" | null | undefined;
|
|
329
330
|
size?: "sm" | "md" | "lg" | "full" | null | undefined;
|
|
330
331
|
} & ClassProp) | undefined) => string;
|
|
331
332
|
|
|
@@ -351,6 +352,83 @@ export declare interface DrawerProps extends Omit<HTMLAttributes<HTMLDivElement>
|
|
|
351
352
|
|
|
352
353
|
export declare type DrawerSizes = RemoveNull_2<VariantProps<typeof drawerPanelStyles>>['size'];
|
|
353
354
|
|
|
355
|
+
export declare const Dropdown: FC<DropdownProps>;
|
|
356
|
+
|
|
357
|
+
export declare type DropdownAlignments = 'start' | 'center' | 'end';
|
|
358
|
+
|
|
359
|
+
export declare type DropdownAppearances = ButtonAppearances;
|
|
360
|
+
|
|
361
|
+
export declare type DropdownIcon = NonNullable<ButtonProps['leadingIcon']>;
|
|
362
|
+
|
|
363
|
+
export declare const DropdownItem: ForwardRefExoticComponent<DropdownItemComponentProps & RefAttributes<HTMLButtonElement>>;
|
|
364
|
+
|
|
365
|
+
declare interface DropdownItem_2 {
|
|
366
|
+
disabled?: boolean;
|
|
367
|
+
id?: string;
|
|
368
|
+
label: ReactNode;
|
|
369
|
+
leadingIcon?: DropdownIcon;
|
|
370
|
+
value: string;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
export declare interface DropdownItemComponentProps extends Omit<ComponentPropsWithoutRef<'button'>, 'children' | 'disabled' | 'onSelect' | 'value'> {
|
|
374
|
+
item: DropdownItem_2;
|
|
375
|
+
onSelect?: (item: DropdownItem_2) => void;
|
|
376
|
+
selected?: boolean;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
export declare const DropdownList: ForwardRefExoticComponent<DropdownListProps & RefAttributes<HTMLDivElement>>;
|
|
380
|
+
|
|
381
|
+
export declare interface DropdownListProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children'> {
|
|
382
|
+
children?: ReactNode;
|
|
383
|
+
closeMenu?: () => void;
|
|
384
|
+
closeOnSelect?: boolean;
|
|
385
|
+
items?: DropdownItem_2[];
|
|
386
|
+
leadingSlot?: ReactNode;
|
|
387
|
+
onItemSelect?: (item: DropdownItem_2) => void;
|
|
388
|
+
selectedValue?: string;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
export declare type DropdownPlacements = 'top' | 'right' | 'bottom' | 'left';
|
|
392
|
+
|
|
393
|
+
export declare interface DropdownProps extends Omit<ButtonProps, 'children' | 'trailingIcon' | 'value'> {
|
|
394
|
+
children?: ReactNode;
|
|
395
|
+
chevronIcon?: DropdownIcon;
|
|
396
|
+
clickOutsideToClose?: boolean;
|
|
397
|
+
closeOnSelect?: boolean;
|
|
398
|
+
defaultOpen?: boolean;
|
|
399
|
+
icon?: DropdownIcon;
|
|
400
|
+
iconOnly?: boolean;
|
|
401
|
+
inline?: boolean;
|
|
402
|
+
items?: DropdownItem_2[];
|
|
403
|
+
align?: DropdownAlignments;
|
|
404
|
+
menuClassName?: string;
|
|
405
|
+
menuContent?: ReactNode | ((closeMenu: () => void) => ReactNode);
|
|
406
|
+
menuOffset?: [number, number];
|
|
407
|
+
menuPlacement?: Placement;
|
|
408
|
+
onItemSelect?: (item: DropdownItem_2) => void;
|
|
409
|
+
onOpenChange?: (open: boolean) => void;
|
|
410
|
+
open?: boolean;
|
|
411
|
+
placement?: DropdownPlacements;
|
|
412
|
+
portalTarget?: HTMLElement | null;
|
|
413
|
+
renderAs?: DropdownRenderAs;
|
|
414
|
+
selectedValue?: string;
|
|
415
|
+
showChevron?: boolean;
|
|
416
|
+
trigger?: ReactNode | ((open: boolean) => ReactNode);
|
|
417
|
+
triggerAction?: DropdownTriggerAction;
|
|
418
|
+
triggerClassName?: string;
|
|
419
|
+
menuProps?: Omit<ComponentPropsWithoutRef<'div'>, 'children'>;
|
|
420
|
+
usePortal?: boolean;
|
|
421
|
+
withArrow?: boolean;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
export declare type DropdownRenderAs = 'button' | 'unstyled';
|
|
425
|
+
|
|
426
|
+
export declare type DropdownSizes = ButtonSizes;
|
|
427
|
+
|
|
428
|
+
export declare type DropdownTriggerAction = 'click' | 'hover';
|
|
429
|
+
|
|
430
|
+
export declare type DropdownVariants = ButtonVariants;
|
|
431
|
+
|
|
354
432
|
declare enum EThemeOptions {
|
|
355
433
|
LIGHT = "light",
|
|
356
434
|
DARK = "dark"
|