@npm-questionpro/wick-ui-lib 1.5.2 → 1.7.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/src/components/calendar/components/datePicker/WuDatePicker.d.ts +1 -1
- package/dist/src/components/calendar/components/dateRangePicker/WuDateRangePicker.d.ts +1 -1
- package/dist/src/components/listbox/WuListbox.d.ts +4 -2
- package/dist/src/components/listbox/ui/_item.d.ts +7 -8
- package/dist/src/components/listbox/ui/_trigger.d.ts +4 -6
- package/dist/src/components/listbox/utils/search.d.ts +2 -0
- package/dist/src/components/modal/WuModal.d.ts +5 -4
- package/dist/src/components/monthPicker/WuMonthPicker.d.ts +1 -1
- package/dist/src/components/spotlight/WuSpotlight.d.ts +16 -0
- package/dist/src/components/spotlight/WuSpotlight.test.d.ts +1 -0
- package/dist/src/components/spotlight/index.d.ts +2 -0
- package/dist/src/components/tab/WuTab.d.ts +4 -2
- package/dist/src/components/tab/components/BaseTabContent.d.ts +8 -0
- package/dist/src/components/tab/hooks/useHorizontalTabScroll.d.ts +8 -0
- package/dist/src/components/tab/hooks/useTabIndicator.d.ts +9 -0
- package/dist/src/components/tab/hooks/useVerticalTabScroll.d.ts +8 -0
- package/dist/src/components/tab/ui/_horizontalTab.d.ts +3 -0
- package/dist/src/components/tab/ui/_verticalTab.d.ts +3 -0
- package/dist/src/components/timePicker/WuTimePicker.d.ts +9 -0
- package/dist/src/components/timePicker/WuTimePicker.test.d.ts +1 -0
- package/dist/src/components/timePicker/components/timeColumn.d.ts +11 -0
- package/dist/src/components/timePicker/hooks/useRotatedArrays.d.ts +5 -0
- package/dist/src/components/timePicker/hooks/useTimePickerScroll.d.ts +1 -0
- package/dist/src/components/timePicker/index.d.ts +2 -0
- package/dist/src/components/timePicker/utils/timePickerUtils.d.ts +12 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/style.css +1 -1
- package/dist/wick-ui-lib/es/index.js +3568 -2985
- package/dist/wick-ui-lib/umd/index.js +7 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
export type IWuDatePickerProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'value'> & {
|
|
2
|
+
export type IWuDatePickerProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'value' | 'onChange'> & {
|
|
3
3
|
value?: Date | string;
|
|
4
4
|
onChange?: (date?: Date) => void;
|
|
5
5
|
onReset?: () => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { DateRange } from 'react-day-picker';
|
|
3
|
-
export type IWuDateRangePickerProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'value'> & {
|
|
3
|
+
export type IWuDateRangePickerProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'value' | 'onChange'> & {
|
|
4
4
|
value?: DateRange;
|
|
5
5
|
onChange?: (date: DateRange | undefined) => void;
|
|
6
6
|
onReset?: () => void;
|
|
@@ -3,8 +3,9 @@ import { IWuChipProp } from './ui/_trigger';
|
|
|
3
3
|
export type IWuListboxProps<T extends object> = {
|
|
4
4
|
data: T[];
|
|
5
5
|
accessorKey: {
|
|
6
|
-
value:
|
|
7
|
-
label:
|
|
6
|
+
value: string;
|
|
7
|
+
label: string;
|
|
8
|
+
group?: string;
|
|
8
9
|
};
|
|
9
10
|
value?: T | T[];
|
|
10
11
|
Item?: (props: {
|
|
@@ -12,6 +13,7 @@ export type IWuListboxProps<T extends object> = {
|
|
|
12
13
|
isSelected?: boolean;
|
|
13
14
|
}) => React.ReactNode;
|
|
14
15
|
Label?: React.ReactNode;
|
|
16
|
+
GroupLabel?: string | ((option: T) => React.ReactNode);
|
|
15
17
|
CustomHeader?: React.ReactNode;
|
|
16
18
|
CustomTrigger?: (value?: T | T[]) => React.ReactElement<HTMLButtonElement>;
|
|
17
19
|
NoDataContent?: React.ReactNode;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { CommandItem } from '../../../base/ui/command';
|
|
2
2
|
import { default as React } from 'react';
|
|
3
|
-
|
|
3
|
+
import { IWuListboxProps } from '../WuListbox';
|
|
4
|
+
type IWuListItemProps<T extends object> = Omit<React.ComponentProps<typeof CommandItem>, 'value' | 'onSelect'> & {
|
|
4
5
|
option: T;
|
|
5
|
-
accessorKey:
|
|
6
|
-
value: keyof T;
|
|
7
|
-
label: keyof T;
|
|
8
|
-
};
|
|
6
|
+
accessorKey: IWuListboxProps<T>['accessorKey'];
|
|
9
7
|
multiple?: boolean;
|
|
10
|
-
boolean?: boolean;
|
|
11
8
|
onSelect?: (value: T) => void;
|
|
12
|
-
|
|
9
|
+
GroupLabel?: IWuListboxProps<T>['GroupLabel'];
|
|
10
|
+
Item?: IWuListboxProps<T>['Item'];
|
|
11
|
+
isSelected?: (item: T) => boolean;
|
|
13
12
|
};
|
|
14
|
-
export declare const WuListboxItem: <T>(props: IWuListItemProps<T>) => React.ReactElement;
|
|
13
|
+
export declare const WuListboxItem: <T extends object>(props: IWuListItemProps<T>) => React.ReactElement;
|
|
15
14
|
export {};
|
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
import { IWuListboxProps } from '../WuListbox';
|
|
2
3
|
export type IWuChipProp<T> = {
|
|
3
4
|
value: T;
|
|
4
5
|
unselect: (value: T) => void;
|
|
5
6
|
key?: string | number;
|
|
6
7
|
};
|
|
7
|
-
type IWuListboxTriggerProps<T> = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'value'> & {
|
|
8
|
+
type IWuListboxTriggerProps<T extends object> = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'value'> & {
|
|
8
9
|
CustomTrigger?: (value?: T | T[]) => React.ReactElement<HTMLButtonElement>;
|
|
9
10
|
disabled?: boolean;
|
|
10
11
|
value?: T | T[];
|
|
11
12
|
placeholder?: string;
|
|
12
|
-
accessorKey:
|
|
13
|
-
value: keyof T;
|
|
14
|
-
label: keyof T;
|
|
15
|
-
};
|
|
13
|
+
accessorKey: IWuListboxProps<T>['accessorKey'];
|
|
16
14
|
Chip?: (props: IWuChipProp<T>) => React.ReactNode;
|
|
17
15
|
handleUnselect: (value: T) => void;
|
|
18
16
|
variant?: 'flat' | 'outlined';
|
|
19
17
|
dir?: 'rtl' | 'ltr';
|
|
20
18
|
};
|
|
21
|
-
export declare const ListboxTrigger: <T>(props: IWuListboxTriggerProps<T>) => React.JSX.Element;
|
|
19
|
+
export declare const ListboxTrigger: <T extends object>(props: IWuListboxTriggerProps<T>) => React.JSX.Element;
|
|
22
20
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DialogClose, DialogContent, DialogFooter, DialogHeader } from '../../base/ui/dialog';
|
|
2
2
|
import { default as React, FC, ReactNode } from 'react';
|
|
3
3
|
declare const MAX_WIDTH: {
|
|
4
4
|
readonly sm: "400px";
|
|
@@ -12,9 +12,8 @@ declare const BUTTON_VARIANTS: {
|
|
|
12
12
|
};
|
|
13
13
|
type IModalSize = keyof typeof MAX_WIDTH;
|
|
14
14
|
type IButtonVariant = keyof typeof BUTTON_VARIANTS;
|
|
15
|
-
export
|
|
15
|
+
export interface IWuModalProps extends React.ComponentProps<typeof DialogContent> {
|
|
16
16
|
Trigger?: ReactNode;
|
|
17
|
-
children?: ReactNode;
|
|
18
17
|
size?: IModalSize;
|
|
19
18
|
hideCloseButton?: boolean;
|
|
20
19
|
preventClickOutside?: boolean;
|
|
@@ -23,7 +22,9 @@ export type IWuModalProps = React.ComponentProps<typeof Dialog> & {
|
|
|
23
22
|
dir?: 'ltr' | 'rtl';
|
|
24
23
|
maxWidth?: string;
|
|
25
24
|
maxHeight?: string;
|
|
26
|
-
|
|
25
|
+
children?: ReactNode;
|
|
26
|
+
variant?: 'action' | 'critical' | 'upgrade';
|
|
27
|
+
}
|
|
27
28
|
export declare const WuModal: FC<IWuModalProps>;
|
|
28
29
|
export declare const WuModalContent: FC<React.HTMLAttributes<HTMLDivElement>>;
|
|
29
30
|
export declare const WuModalHeader: FC<React.ComponentProps<typeof DialogHeader>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { WuDatePickerTrigger } from '../calendar/ui/_trigger';
|
|
3
|
-
export type IWuMonthPickerProps = React.ComponentProps<typeof WuDatePickerTrigger> & {
|
|
3
|
+
export type IWuMonthPickerProps = Omit<React.ComponentProps<typeof WuDatePickerTrigger>, 'value' | 'onChange'> & {
|
|
4
4
|
value?: Date | string;
|
|
5
5
|
onChange?: (value: Date) => void;
|
|
6
6
|
min?: Date | string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface IWuSpotlightProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
colors: string[];
|
|
4
|
+
/** Size of the spotlight circle in % of height & width. Defaults to 0.6 * element width. */
|
|
5
|
+
size?: number;
|
|
6
|
+
strokeWidth?: number;
|
|
7
|
+
centerOffset?: {
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* WuSpotlight component that creates an interactive spotlight effect following the mouse cursor.
|
|
14
|
+
* The spotlight uses a radial gradient that tracks the mouse position within the component bounds.
|
|
15
|
+
*/
|
|
16
|
+
export declare const WuSpotlight: React.FC<IWuSpotlightProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Tabs } from './shadcn/tabs';
|
|
2
2
|
import { default as React, FC } from 'react';
|
|
3
3
|
import { IWuTabItem } from './types/IWuItems';
|
|
4
|
-
export
|
|
4
|
+
export interface IWuTabProps extends React.ComponentProps<typeof Tabs> {
|
|
5
5
|
items: IWuTabItem[];
|
|
6
6
|
defaultValue?: string;
|
|
7
7
|
value?: string;
|
|
@@ -9,5 +9,7 @@ export type IWuTabProps = React.ComponentProps<typeof Tabs> & {
|
|
|
9
9
|
dir?: 'ltr' | 'rtl';
|
|
10
10
|
orientation?: 'horizontal' | 'vertical';
|
|
11
11
|
className?: string;
|
|
12
|
-
|
|
12
|
+
enableAnimation?: boolean;
|
|
13
|
+
position?: 'top' | 'bottom' | 'left' | 'right';
|
|
14
|
+
}
|
|
13
15
|
export declare const WuTab: FC<IWuTabProps>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
type IUseTabScrollReturn = {
|
|
3
|
+
showLeftArrow: boolean;
|
|
4
|
+
showRightArrow: boolean;
|
|
5
|
+
scrollByTab: (direction: 'left' | 'right') => void;
|
|
6
|
+
};
|
|
7
|
+
export declare const useTabScroll: (listRef: React.RefObject<HTMLElement | null>) => IUseTabScrollReturn;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
type IRect = {
|
|
3
|
+
width: number;
|
|
4
|
+
left: number;
|
|
5
|
+
height: number;
|
|
6
|
+
top: number;
|
|
7
|
+
};
|
|
8
|
+
export declare const useTabIndicator: (listRef: React.RefObject<HTMLElement | null>, orientation: "horizontal" | "vertical") => IRect;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
type IUseVerticalTabScrollReturn = {
|
|
3
|
+
showTopArrow: boolean;
|
|
4
|
+
showBottomArrow: boolean;
|
|
5
|
+
scrollByTab: (direction: 'up' | 'down') => void;
|
|
6
|
+
};
|
|
7
|
+
export declare const useVerticalTabScroll: (listRef: React.RefObject<HTMLElement | null>) => IUseVerticalTabScrollReturn;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface IWuTimePickerProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
3
|
+
className?: string;
|
|
4
|
+
time?: string;
|
|
5
|
+
Label?: React.ReactNode;
|
|
6
|
+
labelPosition?: 'left' | 'top' | 'right';
|
|
7
|
+
dir?: 'ltr' | 'rtl';
|
|
8
|
+
}
|
|
9
|
+
export declare const WuTimePicker: React.FC<IWuTimePickerProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface ITimeColumnProps {
|
|
3
|
+
values: string[];
|
|
4
|
+
selectedValue: string;
|
|
5
|
+
scrollRef?: React.RefObject<HTMLDivElement>;
|
|
6
|
+
onSelect: (value: string) => void;
|
|
7
|
+
className?: string;
|
|
8
|
+
repeatItems?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const TimeColumn: ({ values, selectedValue, scrollRef, onSelect, repeatItems, className, }: ITimeColumnProps) => React.JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useTimePickerScroll(isDropdownOpen: boolean, hourScrollRef: React.RefObject<HTMLDivElement>, minuteScrollRef: React.RefObject<HTMLDivElement>): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare function formatTime(input: string): string;
|
|
2
|
+
export declare const HOURS_12: string[];
|
|
3
|
+
export declare const MINUTES: string[];
|
|
4
|
+
export declare const MERIDIEM_OPTIONS: string[];
|
|
5
|
+
export declare const SCROLL_REPEAT_COUNT = 50;
|
|
6
|
+
export declare function getRepeatedItems(items: string[]): string[];
|
|
7
|
+
export declare function rotateArray<T>(arr: T[], startValue: T): T[];
|
|
8
|
+
export declare function to24HourFormat(hour: string, meridiem: string): string;
|
|
9
|
+
export declare function to12HourFormat(hour24: string): {
|
|
10
|
+
hour: string;
|
|
11
|
+
meridiem: string;
|
|
12
|
+
};
|
package/dist/src/index.d.ts
CHANGED
|
@@ -31,11 +31,13 @@ export * from './components/radio';
|
|
|
31
31
|
export * from './components/scrollArea';
|
|
32
32
|
export * from './components/select';
|
|
33
33
|
export * from './components/sidebar';
|
|
34
|
+
export * from './components/spotlight';
|
|
34
35
|
export * from './components/stepper';
|
|
35
36
|
export * from './components/switcher';
|
|
36
37
|
export * from './components/tab';
|
|
37
38
|
export * from './components/table';
|
|
38
39
|
export * from './components/textarea';
|
|
40
|
+
export * from './components/timePicker';
|
|
39
41
|
export * from './components/toast';
|
|
40
42
|
export * from './components/toggle';
|
|
41
43
|
export * from './components/tooltip';
|