@tecsinapse/cortex-react 1.13.3 → 1.13.4
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/cjs/components/Calendar/Calendar.js +18 -4
- package/dist/cjs/components/Calendar/CalendarCell.js +7 -12
- package/dist/cjs/components/Calendar/CalendarGrid.js +3 -0
- package/dist/cjs/components/Calendar/CalendarGridHeaderRow.js +1 -1
- package/dist/cjs/components/Calendar/RangeCalendar.js +15 -4
- package/dist/cjs/components/DatePicker/DatePickerInput.js +20 -3
- package/dist/cjs/components/DatePicker/DateRangePickerInput.js +20 -5
- package/dist/cjs/components/Input/Mask.js +3 -0
- package/dist/cjs/components/Input/Search.js +3 -0
- package/dist/cjs/components/Menubar/Categories.js +3 -0
- package/dist/cjs/components/Menubar/Dropdown.js +1 -0
- package/dist/cjs/components/Menubar/Header.js +1 -0
- package/dist/cjs/components/Menubar/Item.js +1 -0
- package/dist/cjs/components/Menubar/MostUsed.js +3 -0
- package/dist/cjs/components/Menubar/Root.js +1 -0
- package/dist/cjs/components/Menubar/Search.js +1 -0
- package/dist/cjs/components/Menubar/SubItem.js +1 -0
- package/dist/cjs/components/Popover/Provider.js +3 -0
- package/dist/cjs/components/Select/GroupedOptions.js +3 -0
- package/dist/cjs/components/Select/MultiGroupedOptions.js +3 -0
- package/dist/cjs/components/Select/MultiOptions.js +3 -0
- package/dist/cjs/components/Select/Options.js +3 -0
- package/dist/cjs/components/TimePicker/TimePickerInput.js +3 -0
- package/dist/cjs/components/Tooltip.js +3 -0
- package/dist/cjs/hooks/useCalendar.js +9 -2
- package/dist/cjs/hooks/useCalendarCell.js +17 -2
- package/dist/cjs/hooks/useDatePickerInput.js +6 -2
- package/dist/cjs/hooks/useDateRangePickerInput.js +6 -2
- package/dist/cjs/hooks/useRangeCalendar.js +6 -2
- package/dist/cjs/index.js +3 -0
- package/dist/cjs/provider/CalendarProvider.js +24 -0
- package/dist/cjs/provider/MenubarProvider.js +3 -1
- package/dist/cjs/styles/calendar-cell.js +10 -5
- package/dist/esm/components/Calendar/Calendar.js +19 -5
- package/dist/esm/components/Calendar/CalendarCell.js +7 -12
- package/dist/esm/components/Calendar/CalendarGrid.js +3 -0
- package/dist/esm/components/Calendar/CalendarGridHeaderRow.js +1 -1
- package/dist/esm/components/Calendar/RangeCalendar.js +16 -5
- package/dist/esm/components/DatePicker/DatePickerInput.js +20 -3
- package/dist/esm/components/DatePicker/DateRangePickerInput.js +20 -5
- package/dist/esm/components/Input/Mask.js +3 -0
- package/dist/esm/components/Input/Search.js +3 -0
- package/dist/esm/components/Menubar/Categories.js +3 -0
- package/dist/esm/components/Menubar/Dropdown.js +1 -0
- package/dist/esm/components/Menubar/Header.js +1 -0
- package/dist/esm/components/Menubar/Item.js +1 -0
- package/dist/esm/components/Menubar/MostUsed.js +3 -0
- package/dist/esm/components/Menubar/Root.js +1 -0
- package/dist/esm/components/Menubar/Search.js +1 -0
- package/dist/esm/components/Menubar/SubItem.js +1 -0
- package/dist/esm/components/Popover/Provider.js +3 -0
- package/dist/esm/components/Select/GroupedOptions.js +3 -0
- package/dist/esm/components/Select/MultiGroupedOptions.js +3 -0
- package/dist/esm/components/Select/MultiOptions.js +3 -0
- package/dist/esm/components/Select/Options.js +3 -0
- package/dist/esm/components/TimePicker/TimePickerInput.js +3 -0
- package/dist/esm/components/Tooltip.js +3 -0
- package/dist/esm/hooks/useCalendar.js +9 -2
- package/dist/esm/hooks/useCalendarCell.js +18 -3
- package/dist/esm/hooks/useDatePickerInput.js +6 -2
- package/dist/esm/hooks/useDateRangePickerInput.js +6 -2
- package/dist/esm/hooks/useRangeCalendar.js +6 -2
- package/dist/esm/index.js +1 -0
- package/dist/esm/provider/CalendarProvider.js +21 -0
- package/dist/esm/provider/MenubarProvider.js +3 -1
- package/dist/esm/styles/calendar-cell.js +10 -5
- package/dist/types/components/Calendar/Calendar.d.ts +3 -2
- package/dist/types/components/Calendar/CalendarProvider.d.ts +10 -0
- package/dist/types/components/Calendar/RangeCalendar.d.ts +3 -2
- package/dist/types/components/Calendar/types.d.ts +5 -0
- package/dist/types/components/DatePicker/DatePickerInput.d.ts +2 -4
- package/dist/types/components/DatePicker/DateRangePickerInput.d.ts +3 -5
- package/dist/types/components/DatePicker/types.d.ts +8 -0
- package/dist/types/hooks/useCalendar.d.ts +3 -1
- package/dist/types/hooks/useCalendarCell.d.ts +2 -0
- package/dist/types/hooks/useDatePickerInput.d.ts +3 -1
- package/dist/types/hooks/useDateRangePickerInput.d.ts +3 -1
- package/dist/types/hooks/useRangeCalendar.d.ts +3 -1
- package/dist/types/provider/CalendarProvider.d.ts +10 -0
- package/dist/types/provider/index.d.ts +1 -0
- package/dist/types/styles/calendar-cell.d.ts +18 -3
- package/package.json +2 -2
|
@@ -6,27 +6,32 @@ const calendarCell = tv({
|
|
|
6
6
|
button: "flex aspect-square items-center justify-center"
|
|
7
7
|
},
|
|
8
8
|
variants: {
|
|
9
|
+
isToday: {
|
|
10
|
+
true: {
|
|
11
|
+
cell: "border-primary-light border-2"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
9
14
|
isSelected: {
|
|
10
15
|
true: {
|
|
11
|
-
cell: "bg-primary-medium text-white hover:bg-primary-medium"
|
|
16
|
+
cell: "bg-primary-medium border-2 border-primary-medium text-white hover:bg-primary-medium"
|
|
12
17
|
}
|
|
13
18
|
},
|
|
14
19
|
isSelectionStart: {
|
|
15
20
|
true: {
|
|
16
|
-
cell: "bg-primary-medium rounded-r-none text-white"
|
|
21
|
+
cell: "bg-primary-medium border-2 border-primary-medium rounded-r-none text-white"
|
|
17
22
|
}
|
|
18
23
|
},
|
|
19
24
|
isSelectionEnd: {
|
|
20
25
|
true: {
|
|
21
|
-
cell: "bg-primary-medium rounded-l-none text-white"
|
|
26
|
+
cell: "bg-primary-medium border-2 border-primary-medium rounded-l-none text-white"
|
|
22
27
|
}
|
|
23
28
|
},
|
|
24
29
|
inRange: {
|
|
25
30
|
true: {
|
|
26
|
-
cell: "bg-primary-light rounded-none text-black"
|
|
31
|
+
cell: "bg-primary-light border-0 rounded-none text-black"
|
|
27
32
|
}
|
|
28
33
|
},
|
|
29
|
-
|
|
34
|
+
isDisabled: {
|
|
30
35
|
true: {
|
|
31
36
|
cell: "text-secondary-light cursor-default hover:bg-white-500",
|
|
32
37
|
button: "cursor-default"
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { BaseCalendarProps } from './types';
|
|
2
|
+
interface CalendarProps extends BaseCalendarProps {
|
|
2
3
|
value?: Date;
|
|
3
4
|
onChange: (value?: Date) => void;
|
|
4
5
|
}
|
|
5
|
-
export declare const Calendar: ({ value, onChange }: CalendarProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const Calendar: ({ value, onChange, isTodayHighlited, minValue, maxValue, }: CalendarProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
7
|
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface CalendarContextProps {
|
|
3
|
+
isTodayHighlited: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare const CalendarProvider: ({ isTodayHighlited, children, }: {
|
|
6
|
+
isTodayHighlited: boolean;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const useCalendarContext: () => CalendarContextProps;
|
|
10
|
+
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { BaseCalendarProps } from './types';
|
|
1
2
|
export type DateRange = {
|
|
2
3
|
start?: Date;
|
|
3
4
|
end?: Date;
|
|
4
5
|
};
|
|
5
|
-
export interface RangeCalendarProps {
|
|
6
|
+
export interface RangeCalendarProps extends BaseCalendarProps {
|
|
6
7
|
value?: DateRange;
|
|
7
8
|
onChange: (value: DateRange) => void;
|
|
8
9
|
}
|
|
9
|
-
export declare const RangeCalendar: ({ value, onChange }: RangeCalendarProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const RangeCalendar: ({ value, onChange, isTodayHighlited, minValue, maxValue, }: RangeCalendarProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { Granularity } from '@react-types/datepicker';
|
|
2
1
|
import { InputProps } from '../Input';
|
|
3
|
-
|
|
2
|
+
import { BaseDatePickerInputProps } from './types';
|
|
3
|
+
export interface DatePickerInputProps extends Omit<InputProps, 'value' | 'onChange'>, BaseDatePickerInputProps {
|
|
4
4
|
value?: Date;
|
|
5
5
|
onChange: (date?: Date) => void;
|
|
6
|
-
hourCycle?: 12 | 24;
|
|
7
|
-
granularity?: Granularity;
|
|
8
6
|
}
|
|
9
7
|
export declare const DatePickerInput: (props: DatePickerInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { DateRange } from '../Calendar/RangeCalendar';
|
|
1
|
+
import { BaseDatePickerInputProps } from './types';
|
|
3
2
|
import { InputProps } from '../Input';
|
|
4
|
-
|
|
3
|
+
import { DateRange } from '../Calendar/RangeCalendar';
|
|
4
|
+
export interface DateRangePickerInputProps extends Omit<InputProps, 'value' | 'onChange'>, BaseDatePickerInputProps {
|
|
5
5
|
value?: DateRange;
|
|
6
6
|
onChange: (date?: DateRange) => void;
|
|
7
|
-
hourCycle?: 12 | 24;
|
|
8
|
-
granularity?: Granularity;
|
|
9
7
|
}
|
|
10
8
|
export declare const DateRangePickerInput: (props: DateRangePickerInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
interface useCalendarProps {
|
|
2
2
|
value?: Date;
|
|
3
3
|
onChange: (value?: Date) => void;
|
|
4
|
+
minValue?: Date;
|
|
5
|
+
maxValue?: Date;
|
|
4
6
|
}
|
|
5
|
-
export declare const useCalendar: ({ value, onChange }: useCalendarProps) => {
|
|
7
|
+
export declare const useCalendar: ({ value, onChange, minValue, maxValue, }: useCalendarProps) => {
|
|
6
8
|
calendarProps: import("@react-types/shared").DOMAttributes<import("@react-types/shared").FocusableElement>;
|
|
7
9
|
title: string;
|
|
8
10
|
state: import("react-stately").CalendarState;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
interface useDatePickerInputProps {
|
|
2
2
|
value?: Date;
|
|
3
3
|
onChange: (date?: Date) => void;
|
|
4
|
+
minValue?: Date;
|
|
5
|
+
maxValue?: Date;
|
|
4
6
|
}
|
|
5
|
-
export declare const useDatePickerInput: ({ value, onChange, }: useDatePickerInputProps) => {
|
|
7
|
+
export declare const useDatePickerInput: ({ value, onChange, minValue, maxValue, }: useDatePickerInputProps) => {
|
|
6
8
|
fieldProps: import("react-aria").AriaDatePickerProps<import("react-aria").DateValue>;
|
|
7
9
|
state: import("react-stately").DatePickerState;
|
|
8
10
|
ref: import("react").MutableRefObject<null>;
|
|
@@ -2,8 +2,10 @@ import { DateRange } from '../components';
|
|
|
2
2
|
interface useDateRangePickerInputProps {
|
|
3
3
|
value?: DateRange;
|
|
4
4
|
onChange: (date?: DateRange) => void;
|
|
5
|
+
minValue?: Date;
|
|
6
|
+
maxValue?: Date;
|
|
5
7
|
}
|
|
6
|
-
export declare const useDateRangePickerInput: ({ value, onChange, }: useDateRangePickerInputProps) => {
|
|
8
|
+
export declare const useDateRangePickerInput: ({ value, onChange, minValue, maxValue, }: useDateRangePickerInputProps) => {
|
|
7
9
|
startFieldProps: import("react-aria").AriaDatePickerProps<import("react-aria").DateValue>;
|
|
8
10
|
endFieldProps: import("react-aria").AriaDatePickerProps<import("react-aria").DateValue>;
|
|
9
11
|
state: import("react-stately").DateRangePickerState;
|
|
@@ -2,8 +2,10 @@ import { DateRange } from '../components';
|
|
|
2
2
|
interface useRangeCalendarProps {
|
|
3
3
|
value?: DateRange;
|
|
4
4
|
onChange: (value: DateRange) => void;
|
|
5
|
+
minValue?: Date;
|
|
6
|
+
maxValue?: Date;
|
|
5
7
|
}
|
|
6
|
-
export declare const useRangeCalendar: ({ value, onChange, }: useRangeCalendarProps) => {
|
|
8
|
+
export declare const useRangeCalendar: ({ value, onChange, minValue, maxValue, }: useRangeCalendarProps) => {
|
|
7
9
|
calendarProps: import("@react-types/shared").DOMAttributes<import("@react-types/shared").FocusableElement>;
|
|
8
10
|
title: string;
|
|
9
11
|
state: import("react-stately").RangeCalendarState;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface CalendarContextProps {
|
|
3
|
+
isTodayHighlited: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare const CalendarProvider: ({ isTodayHighlited, children, }: {
|
|
6
|
+
isTodayHighlited: boolean;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const useCalendarContext: () => CalendarContextProps;
|
|
10
|
+
export {};
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
export declare const calendarCell: import("tailwind-variants").TVReturnType<{
|
|
2
|
+
isToday: {
|
|
3
|
+
true: {
|
|
4
|
+
cell: string;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
2
7
|
isSelected: {
|
|
3
8
|
true: {
|
|
4
9
|
cell: string;
|
|
@@ -19,7 +24,7 @@ export declare const calendarCell: import("tailwind-variants").TVReturnType<{
|
|
|
19
24
|
cell: string;
|
|
20
25
|
};
|
|
21
26
|
};
|
|
22
|
-
|
|
27
|
+
isDisabled: {
|
|
23
28
|
true: {
|
|
24
29
|
cell: string;
|
|
25
30
|
button: string;
|
|
@@ -29,6 +34,11 @@ export declare const calendarCell: import("tailwind-variants").TVReturnType<{
|
|
|
29
34
|
cell: string;
|
|
30
35
|
button: string;
|
|
31
36
|
}, undefined, {
|
|
37
|
+
isToday: {
|
|
38
|
+
true: {
|
|
39
|
+
cell: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
32
42
|
isSelected: {
|
|
33
43
|
true: {
|
|
34
44
|
cell: string;
|
|
@@ -49,7 +59,7 @@ export declare const calendarCell: import("tailwind-variants").TVReturnType<{
|
|
|
49
59
|
cell: string;
|
|
50
60
|
};
|
|
51
61
|
};
|
|
52
|
-
|
|
62
|
+
isDisabled: {
|
|
53
63
|
true: {
|
|
54
64
|
cell: string;
|
|
55
65
|
button: string;
|
|
@@ -59,6 +69,11 @@ export declare const calendarCell: import("tailwind-variants").TVReturnType<{
|
|
|
59
69
|
cell: string;
|
|
60
70
|
button: string;
|
|
61
71
|
}, import("tailwind-variants").TVReturnType<{
|
|
72
|
+
isToday: {
|
|
73
|
+
true: {
|
|
74
|
+
cell: string;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
62
77
|
isSelected: {
|
|
63
78
|
true: {
|
|
64
79
|
cell: string;
|
|
@@ -79,7 +94,7 @@ export declare const calendarCell: import("tailwind-variants").TVReturnType<{
|
|
|
79
94
|
cell: string;
|
|
80
95
|
};
|
|
81
96
|
};
|
|
82
|
-
|
|
97
|
+
isDisabled: {
|
|
83
98
|
true: {
|
|
84
99
|
cell: string;
|
|
85
100
|
button: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tecsinapse/cortex-react",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.4",
|
|
4
4
|
"description": "React components based in @tecsinapse/cortex-core",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/esm/index.js",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"react-icons": ">=5.2.0",
|
|
48
48
|
"tailwind": ">=3.3.0"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "740c1416aadf2a2b8e385cc094c51f441fe8e334"
|
|
51
51
|
}
|