@televet/kibble-ui 1.14.0 → 1.14.1-beta.2f7t91q.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.
@@ -0,0 +1,7 @@
1
+ interface DayProps {
2
+ dayLabel: string;
3
+ date: Date;
4
+ onDaySelected: () => void;
5
+ }
6
+ declare const Day: ({ dayLabel, date, onDaySelected }: DayProps) => JSX.Element;
7
+ export default Day;
@@ -0,0 +1,9 @@
1
+ import { FirstDayOfWeek } from '@datepicker-react/hooks';
2
+ export interface MonthProps {
3
+ year: number;
4
+ month: number;
5
+ firstDayOfWeek: FirstDayOfWeek;
6
+ onDaySelected: () => void;
7
+ }
8
+ declare const Month: ({ year, month, firstDayOfWeek, onDaySelected }: MonthProps) => JSX.Element;
9
+ export default Month;
@@ -0,0 +1,13 @@
1
+ export interface DatePickerProps {
2
+ date: Date | null;
3
+ onDateChange?: (date: Date | null) => void;
4
+ dateFormat?: string;
5
+ inputIsReadonly?: boolean;
6
+ }
7
+ /**
8
+ * A simple date picker component.
9
+ *
10
+ * Note: Be careful with dateFormat and allowing search (inputIsReadonly = false) as changing the format
11
+ * can cause exceptions to be thrown.
12
+ */
13
+ export declare const BetaDatePicker: ({ date, onDateChange, dateFormat, inputIsReadonly, }: DatePickerProps) => JSX.Element;
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ export interface IDatePickerContext {
3
+ focusedDate: Date | null;
4
+ isDateFocused: (date: Date) => boolean;
5
+ isDateSelected: (date: Date) => boolean;
6
+ isDateHovered: (date: Date) => boolean;
7
+ isDateBlocked: (date: Date) => boolean;
8
+ isFirstOrLastSelectedDate: (date: Date) => boolean;
9
+ onDateFocus: (date: Date) => void;
10
+ onDateHover: (date: Date) => void;
11
+ onDateSelect: (date: Date) => void;
12
+ }
13
+ export declare const DatePickerContext: React.Context<IDatePickerContext>;
14
+ export declare const useDatePickerContext: () => IDatePickerContext;
15
+ interface IDatePickerProvider extends IDatePickerContext {
16
+ date?: Date;
17
+ children: React.ReactNode;
18
+ }
19
+ declare const DatePickerProvider: ({ date, children, ...rest }: IDatePickerProvider) => JSX.Element;
20
+ export default DatePickerProvider;
@@ -0,0 +1,2 @@
1
+ export * from './datepicker.component';
2
+ export * from './datepicker.context';
@@ -1,18 +1,26 @@
1
- import React, { ReactNode } from 'react';
1
+ import React, { ReactNode, ChangeEvent } from 'react';
2
2
  import { SelectProps as CSelectProps } from '@chakra-ui/react';
3
+ import { MenuListProps } from 'components/Overlay/Menu/components/MenuList/menuList.component';
3
4
  import { WithFormControlProps } from '../FormControl/formControl.component';
4
5
  import { SelectOptionProps } from 'components/Forms/Select/select.types';
5
- export interface SelectProps extends WithFormControlProps, CSelectProps {
6
- useBrowserDefaultMenu?: boolean;
6
+ export interface SelectListProps extends Omit<MenuListProps, 'canSelectAll' | 'canSelectGroups' | 'isMultiSelect' | 'onSelectAll' | 'menuItems' | 'shouldTruncateText'> {
7
+ onClose?: (selectedOption: (SelectOptionProps | undefined)[]) => void;
8
+ defaultLeftElement?: ReactNode;
9
+ }
10
+ export interface SelectBaseProps extends WithFormControlProps, CSelectProps {
7
11
  options: SelectOptionProps[];
8
- listProps?: {
9
- isGrouped?: boolean;
10
- isSearchable?: boolean;
11
- onSelect?: (selectedOption: SelectOptionProps) => void;
12
- onClose?: (selectedOption: (SelectOptionProps | undefined)[]) => void;
13
- defaultLeftElement?: ReactNode;
14
- };
15
12
  shouldTruncateText?: boolean;
16
13
  }
14
+ export interface BrowserDefaultSelect extends SelectBaseProps {
15
+ useBrowserDefaultMenu?: boolean;
16
+ onChange: (e: ChangeEvent<HTMLSelectElement>) => void;
17
+ listProps?: never;
18
+ }
19
+ export interface CustomSelect extends SelectBaseProps {
20
+ useBrowserDefaultMenu?: never;
21
+ onChange?: never;
22
+ listProps?: SelectListProps;
23
+ }
24
+ export declare type SelectProps = BrowserDefaultSelect | CustomSelect;
17
25
  declare const WrappedSelect: React.FC<SelectProps>;
18
26
  export { WrappedSelect as Select };
@@ -1,3 +1,4 @@
1
1
  import { MenuItemProps } from '../../Overlay/Menu';
2
2
  export interface SelectOptionProps extends MenuItemProps {
3
+ isPlaceholder?: boolean;
3
4
  }
@@ -6,3 +6,4 @@ export * from './Radio';
6
6
  export * from './RatingDots';
7
7
  export * from './Select';
8
8
  export * from './Switch';
9
+ export * from './DatePicker';