@candy.thieves/ui-kit-lumos 0.0.57 → 0.0.60
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.css +1 -1
- package/dist/index.js +2013 -1535
- package/dist/index.js.map +1 -1
- package/dist/types/components/DatePicker/DatePicker.d.ts +15 -0
- package/dist/types/components/DatePicker/DatePickerDateCell.d.ts +14 -0
- package/dist/types/components/DatePicker/index.d.ts +2 -0
- package/dist/types/components/Input/Input.d.ts +2 -0
- package/dist/types/components/SearchableSelect/SearchableSelect.d.ts +49 -0
- package/dist/types/components/SearchableSelect/index.d.ts +1 -0
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/constants/constants.d.ts +2 -0
- package/dist/types/hooks/index.d.ts +1 -0
- package/dist/types/hooks/useDebounce.d.ts +1 -0
- package/dist/types/utils/datePicker.d.ts +24 -0
- package/dist/types/utils/getOptions.d.ts +2 -0
- package/dist/types/utils/index.d.ts +3 -0
- package/package.json +2 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ReactNode } from 'react';
|
|
2
|
+
import { type DatePickerMode, type DatePickerValue } from '@/utils';
|
|
3
|
+
export type { DatePickerMode, DatePickerValue, DateRange } from '@/utils';
|
|
4
|
+
export type DatePickerProps = Omit<ComponentPropsWithoutRef<'button'>, 'defaultValue' | 'onChange' | 'value'> & {
|
|
5
|
+
clearable?: boolean;
|
|
6
|
+
defaultValue?: DatePickerValue;
|
|
7
|
+
error?: ReactNode;
|
|
8
|
+
label?: string;
|
|
9
|
+
maxDate?: Date;
|
|
10
|
+
minDate?: Date;
|
|
11
|
+
mode?: DatePickerMode;
|
|
12
|
+
onChange?: (value: DatePickerValue) => void;
|
|
13
|
+
value?: DatePickerValue;
|
|
14
|
+
};
|
|
15
|
+
export declare const DatePicker: ({ className, clearable, defaultValue, disabled, error, label, maxDate, minDate, mode, onChange, onClick, value, ...buttonProps }: DatePickerProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type DatePickerMode, type DatePickerValue, type DateRange } from '@/utils';
|
|
2
|
+
type DatePickerDateCellProps = {
|
|
3
|
+
date: Date;
|
|
4
|
+
disabled: boolean;
|
|
5
|
+
displayedMonth: Date;
|
|
6
|
+
focusedDate: Date;
|
|
7
|
+
mode: DatePickerMode;
|
|
8
|
+
onFocus: (date: Date) => void;
|
|
9
|
+
onSelect: (date: Date) => void;
|
|
10
|
+
selectedRange: DateRange;
|
|
11
|
+
selectedValue: DatePickerValue;
|
|
12
|
+
};
|
|
13
|
+
export declare const DatePickerDateCell: ({ date, disabled, displayedMonth, focusedDate, mode, onFocus, onSelect, selectedRange, selectedValue, }: DatePickerDateCellProps) => import("react").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -4,10 +4,12 @@ export type InputProps = {
|
|
|
4
4
|
error?: string;
|
|
5
5
|
startAdornment?: ReactNode;
|
|
6
6
|
endAdornment?: ReactNode;
|
|
7
|
+
containerClassName?: string;
|
|
7
8
|
} & ComponentPropsWithoutRef<'input'>;
|
|
8
9
|
export declare const Input: import("react").ForwardRefExoticComponent<{
|
|
9
10
|
label?: string;
|
|
10
11
|
error?: string;
|
|
11
12
|
startAdornment?: ReactNode;
|
|
12
13
|
endAdornment?: ReactNode;
|
|
14
|
+
containerClassName?: string;
|
|
13
15
|
} & Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Select as SelectPrimitive } from 'radix-ui';
|
|
2
|
+
import { type ComponentPropsWithoutRef, type ReactNode } from 'react';
|
|
3
|
+
import { type SelectItem } from '@/components';
|
|
4
|
+
export type SearchableSelectProps = Omit<ComponentPropsWithoutRef<typeof SelectPrimitive.Root>, 'children'> & {
|
|
5
|
+
className?: string;
|
|
6
|
+
contentProps?: ComponentPropsWithoutRef<typeof SelectPrimitive.Content>;
|
|
7
|
+
contentClassName?: string;
|
|
8
|
+
debounceDelay?: number;
|
|
9
|
+
groupLabelClassName?: string;
|
|
10
|
+
iconProps?: ComponentPropsWithoutRef<typeof SelectPrimitive.Icon>;
|
|
11
|
+
itemClassName?: string;
|
|
12
|
+
label?: ReactNode;
|
|
13
|
+
labelProps?: ComponentPropsWithoutRef<'label'>;
|
|
14
|
+
onSearchChange?: (value: string) => void;
|
|
15
|
+
options: SelectItem[];
|
|
16
|
+
placeholder?: ReactNode;
|
|
17
|
+
portalProps?: ComponentPropsWithoutRef<typeof SelectPrimitive.Portal>;
|
|
18
|
+
searchPlaceholder?: string;
|
|
19
|
+
separatorClassName?: string;
|
|
20
|
+
triggerIcon?: ReactNode;
|
|
21
|
+
triggerProps?: Omit<ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>, 'children'>;
|
|
22
|
+
valueProps?: ComponentPropsWithoutRef<typeof SelectPrimitive.Value>;
|
|
23
|
+
viewportProps?: ComponentPropsWithoutRef<typeof SelectPrimitive.Viewport>;
|
|
24
|
+
};
|
|
25
|
+
export declare const SearchableSelect: import("react").ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSharedProps & {
|
|
26
|
+
value?: string;
|
|
27
|
+
defaultValue?: string;
|
|
28
|
+
onValueChange?(value: string): void;
|
|
29
|
+
}, "children"> & {
|
|
30
|
+
className?: string;
|
|
31
|
+
contentProps?: ComponentPropsWithoutRef<typeof SelectPrimitive.Content>;
|
|
32
|
+
contentClassName?: string;
|
|
33
|
+
debounceDelay?: number;
|
|
34
|
+
groupLabelClassName?: string;
|
|
35
|
+
iconProps?: ComponentPropsWithoutRef<typeof SelectPrimitive.Icon>;
|
|
36
|
+
itemClassName?: string;
|
|
37
|
+
label?: ReactNode;
|
|
38
|
+
labelProps?: ComponentPropsWithoutRef<"label">;
|
|
39
|
+
onSearchChange?: (value: string) => void;
|
|
40
|
+
options: SelectItem[];
|
|
41
|
+
placeholder?: ReactNode;
|
|
42
|
+
portalProps?: ComponentPropsWithoutRef<typeof SelectPrimitive.Portal>;
|
|
43
|
+
searchPlaceholder?: string;
|
|
44
|
+
separatorClassName?: string;
|
|
45
|
+
triggerIcon?: ReactNode;
|
|
46
|
+
triggerProps?: Omit<ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>, "children">;
|
|
47
|
+
valueProps?: ComponentPropsWithoutRef<typeof SelectPrimitive.Value>;
|
|
48
|
+
viewportProps?: ComponentPropsWithoutRef<typeof SelectPrimitive.Viewport>;
|
|
49
|
+
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SearchableSelect';
|
|
@@ -7,6 +7,7 @@ export * from './Cards';
|
|
|
7
7
|
export * from './Carousel';
|
|
8
8
|
export * from './Checkbox';
|
|
9
9
|
export * from './CircularProgress';
|
|
10
|
+
export * from './DatePicker';
|
|
10
11
|
export * from './Header';
|
|
11
12
|
export * from './Input';
|
|
12
13
|
export * from './LinearProgress';
|
|
@@ -19,6 +20,7 @@ export * from './ReadMore';
|
|
|
19
20
|
export * from './Scroll';
|
|
20
21
|
export * from './SearchInput';
|
|
21
22
|
export * from './Select';
|
|
23
|
+
export * from './SearchableSelect';
|
|
22
24
|
export * from './Sidebar';
|
|
23
25
|
export * from './Slider';
|
|
24
26
|
export * from './Table';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useDebounce: <T>(value: T, delay: number) => T;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type DateRange = {
|
|
2
|
+
end?: Date;
|
|
3
|
+
start?: Date;
|
|
4
|
+
};
|
|
5
|
+
export type DatePickerMode = 'range' | 'single';
|
|
6
|
+
export type DatePickerValue = Date | DateRange | undefined;
|
|
7
|
+
export declare const DAYS_IN_WEEK = 7;
|
|
8
|
+
export declare const getStartOfDay: (date: Date) => Date;
|
|
9
|
+
export declare const getStartOfMonth: (date: Date) => Date;
|
|
10
|
+
export declare const getClosestEnabledDate: (date: Date, minDate?: Date, maxDate?: Date) => Date;
|
|
11
|
+
export declare const getDatesEqual: (firstDate: Date, secondDate: Date) => boolean;
|
|
12
|
+
export declare const getDateBetween: (date: Date, startDate: Date, endDate: Date) => boolean;
|
|
13
|
+
export declare const getCalendarDates: (month: Date) => Date[];
|
|
14
|
+
export declare const getDateRange: (value: DatePickerValue) => DateRange;
|
|
15
|
+
export declare const formatValue: (value: DatePickerValue, mode: DatePickerMode) => string;
|
|
16
|
+
export declare const isYearSelectable: (date: Date) => boolean;
|
|
17
|
+
export declare const MONTH_OPTIONS: {
|
|
18
|
+
label: string;
|
|
19
|
+
value: string;
|
|
20
|
+
}[];
|
|
21
|
+
export declare const YEAR_OPTIONS: {
|
|
22
|
+
label: string;
|
|
23
|
+
value: string;
|
|
24
|
+
}[];
|
|
@@ -6,3 +6,6 @@ export { isThemeColor } from './isThemeColor';
|
|
|
6
6
|
export { getFirstLetterCapitalized } from './getFirstLetterCapitalized';
|
|
7
7
|
export { isAudioAttachment } from './isAudioAttachment';
|
|
8
8
|
export { formatTime } from './formatTime';
|
|
9
|
+
export { getOptions } from './getOptions';
|
|
10
|
+
export { DAYS_IN_WEEK, formatValue, getCalendarDates, getClosestEnabledDate, getDateBetween, getDateRange, getDatesEqual, getStartOfDay, getStartOfMonth, isYearSelectable, MONTH_OPTIONS, YEAR_OPTIONS, } from './datePicker';
|
|
11
|
+
export type { DatePickerMode, DatePickerValue, DateRange } from './datePicker';
|