@react-fabric/superdate 1.0.0-beta.49 → 1.0.0-beta.52
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.
|
@@ -104,18 +104,50 @@ var SuperDateTabs = function SuperDateTabs(_ref) {
|
|
|
104
104
|
};
|
|
105
105
|
|
|
106
106
|
/**
|
|
107
|
-
*
|
|
107
|
+
* SuperDate component provides a date selection interface with quick, relative, and absolute date options.
|
|
108
|
+
* It allows users to select dates using predefined presets, relative date calculations, or absolute date ranges.
|
|
109
|
+
* It can be used in various applications where date selection is required, such as event scheduling, calendar applications, and date filtering.
|
|
110
|
+
* The component supports both Gregorian and Hijri calendars, and it can display relative date labels and tooltips based on the selected calendar.
|
|
111
|
+
* It is designed to be used as a button or a chip, depending on the `as` prop.
|
|
112
|
+
* It also supports event selection and recurring events.
|
|
108
113
|
*
|
|
109
|
-
*
|
|
110
|
-
* `$now
|
|
111
|
-
* `$
|
|
112
|
-
* `$
|
|
113
|
-
* `$
|
|
114
|
-
* `$
|
|
115
|
-
* `$
|
|
116
|
-
* `$
|
|
117
|
-
* `$
|
|
118
|
-
* `$
|
|
114
|
+
* Date Keys:
|
|
115
|
+
* - `$now`: Current date and time.
|
|
116
|
+
* - `$decade`: Current decade.
|
|
117
|
+
* - `$year`: Current year.
|
|
118
|
+
* - `$quarter`: Current quarter.
|
|
119
|
+
* - `$month`: Current month.
|
|
120
|
+
* - `$week`: Current week.
|
|
121
|
+
* - `$day`: Current day.
|
|
122
|
+
* - `$hour`: Current hour.
|
|
123
|
+
* - `$minute`: Current minute.
|
|
124
|
+
*
|
|
125
|
+
* Relative Date Format:
|
|
126
|
+
* - `$now+1|$now+2`: Represents a range from one day after now to two days after now.
|
|
127
|
+
* - `$now-1|$now+1`: Represents a range from one day before now to one day after now.
|
|
128
|
+
* - `$week|$now`: Represents the current week starting from the beginning of the week to now.
|
|
129
|
+
* - `$month|$week`: Represents the current month starting from the beginning of the month to the end of current week.
|
|
130
|
+
*
|
|
131
|
+
* @param {SuperDateProps} props - The properties for the SuperDate component.
|
|
132
|
+
* @returns {JSX.Element} The rendered SuperDate component.
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* ```jsx
|
|
136
|
+
* <SuperDate
|
|
137
|
+
* as="button"
|
|
138
|
+
* color="primary"
|
|
139
|
+
* size="medium"
|
|
140
|
+
* variant="filled"
|
|
141
|
+
* disabled={false}
|
|
142
|
+
* fullWidth={true}
|
|
143
|
+
* onChange={(value, range) => console.log("Selected date:", value, range)}
|
|
144
|
+
* value="$now+1|$now+2"
|
|
145
|
+
* data-test-value="superdate-value"
|
|
146
|
+
* data-testid="superdate"
|
|
147
|
+
* />
|
|
148
|
+
* ```
|
|
149
|
+
*
|
|
150
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/superdate-superdate--docs}
|
|
119
151
|
*/
|
|
120
152
|
var SuperDate = function SuperDate(_ref4) {
|
|
121
153
|
var _DateUtil$relativeLab;
|
|
@@ -104,18 +104,50 @@ var SuperDateTabs = function SuperDateTabs(_ref) {
|
|
|
104
104
|
};
|
|
105
105
|
|
|
106
106
|
/**
|
|
107
|
-
*
|
|
107
|
+
* SuperDate component provides a date selection interface with quick, relative, and absolute date options.
|
|
108
|
+
* It allows users to select dates using predefined presets, relative date calculations, or absolute date ranges.
|
|
109
|
+
* It can be used in various applications where date selection is required, such as event scheduling, calendar applications, and date filtering.
|
|
110
|
+
* The component supports both Gregorian and Hijri calendars, and it can display relative date labels and tooltips based on the selected calendar.
|
|
111
|
+
* It is designed to be used as a button or a chip, depending on the `as` prop.
|
|
112
|
+
* It also supports event selection and recurring events.
|
|
108
113
|
*
|
|
109
|
-
*
|
|
110
|
-
* `$now
|
|
111
|
-
* `$
|
|
112
|
-
* `$
|
|
113
|
-
* `$
|
|
114
|
-
* `$
|
|
115
|
-
* `$
|
|
116
|
-
* `$
|
|
117
|
-
* `$
|
|
118
|
-
* `$
|
|
114
|
+
* Date Keys:
|
|
115
|
+
* - `$now`: Current date and time.
|
|
116
|
+
* - `$decade`: Current decade.
|
|
117
|
+
* - `$year`: Current year.
|
|
118
|
+
* - `$quarter`: Current quarter.
|
|
119
|
+
* - `$month`: Current month.
|
|
120
|
+
* - `$week`: Current week.
|
|
121
|
+
* - `$day`: Current day.
|
|
122
|
+
* - `$hour`: Current hour.
|
|
123
|
+
* - `$minute`: Current minute.
|
|
124
|
+
*
|
|
125
|
+
* Relative Date Format:
|
|
126
|
+
* - `$now+1|$now+2`: Represents a range from one day after now to two days after now.
|
|
127
|
+
* - `$now-1|$now+1`: Represents a range from one day before now to one day after now.
|
|
128
|
+
* - `$week|$now`: Represents the current week starting from the beginning of the week to now.
|
|
129
|
+
* - `$month|$week`: Represents the current month starting from the beginning of the month to the end of current week.
|
|
130
|
+
*
|
|
131
|
+
* @param {SuperDateProps} props - The properties for the SuperDate component.
|
|
132
|
+
* @returns {JSX.Element} The rendered SuperDate component.
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* ```jsx
|
|
136
|
+
* <SuperDate
|
|
137
|
+
* as="button"
|
|
138
|
+
* color="primary"
|
|
139
|
+
* size="medium"
|
|
140
|
+
* variant="filled"
|
|
141
|
+
* disabled={false}
|
|
142
|
+
* fullWidth={true}
|
|
143
|
+
* onChange={(value, range) => console.log("Selected date:", value, range)}
|
|
144
|
+
* value="$now+1|$now+2"
|
|
145
|
+
* data-test-value="superdate-value"
|
|
146
|
+
* data-testid="superdate"
|
|
147
|
+
* />
|
|
148
|
+
* ```
|
|
149
|
+
*
|
|
150
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/superdate-superdate--docs}
|
|
119
151
|
*/
|
|
120
152
|
var SuperDate = function SuperDate(_ref4) {
|
|
121
153
|
var _DateUtil$relativeLab;
|
|
@@ -1,17 +1,49 @@
|
|
|
1
1
|
import { type SuperDateProps } from "../types";
|
|
2
2
|
export declare const SuperDateTabs: ({ events, value, presets, recurringEvents, onChange, }: SuperDateProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* SuperDate component provides a date selection interface with quick, relative, and absolute date options.
|
|
5
|
+
* It allows users to select dates using predefined presets, relative date calculations, or absolute date ranges.
|
|
6
|
+
* It can be used in various applications where date selection is required, such as event scheduling, calendar applications, and date filtering.
|
|
7
|
+
* The component supports both Gregorian and Hijri calendars, and it can display relative date labels and tooltips based on the selected calendar.
|
|
8
|
+
* It is designed to be used as a button or a chip, depending on the `as` prop.
|
|
9
|
+
* It also supports event selection and recurring events.
|
|
5
10
|
*
|
|
6
|
-
*
|
|
7
|
-
* `$now
|
|
8
|
-
* `$
|
|
9
|
-
* `$
|
|
10
|
-
* `$
|
|
11
|
-
* `$
|
|
12
|
-
* `$
|
|
13
|
-
* `$
|
|
14
|
-
* `$
|
|
15
|
-
* `$
|
|
11
|
+
* Date Keys:
|
|
12
|
+
* - `$now`: Current date and time.
|
|
13
|
+
* - `$decade`: Current decade.
|
|
14
|
+
* - `$year`: Current year.
|
|
15
|
+
* - `$quarter`: Current quarter.
|
|
16
|
+
* - `$month`: Current month.
|
|
17
|
+
* - `$week`: Current week.
|
|
18
|
+
* - `$day`: Current day.
|
|
19
|
+
* - `$hour`: Current hour.
|
|
20
|
+
* - `$minute`: Current minute.
|
|
21
|
+
*
|
|
22
|
+
* Relative Date Format:
|
|
23
|
+
* - `$now+1|$now+2`: Represents a range from one day after now to two days after now.
|
|
24
|
+
* - `$now-1|$now+1`: Represents a range from one day before now to one day after now.
|
|
25
|
+
* - `$week|$now`: Represents the current week starting from the beginning of the week to now.
|
|
26
|
+
* - `$month|$week`: Represents the current month starting from the beginning of the month to the end of current week.
|
|
27
|
+
*
|
|
28
|
+
* @param {SuperDateProps} props - The properties for the SuperDate component.
|
|
29
|
+
* @returns {JSX.Element} The rendered SuperDate component.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```jsx
|
|
33
|
+
* <SuperDate
|
|
34
|
+
* as="button"
|
|
35
|
+
* color="primary"
|
|
36
|
+
* size="medium"
|
|
37
|
+
* variant="filled"
|
|
38
|
+
* disabled={false}
|
|
39
|
+
* fullWidth={true}
|
|
40
|
+
* onChange={(value, range) => console.log("Selected date:", value, range)}
|
|
41
|
+
* value="$now+1|$now+2"
|
|
42
|
+
* data-test-value="superdate-value"
|
|
43
|
+
* data-testid="superdate"
|
|
44
|
+
* />
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/superdate-superdate--docs}
|
|
16
48
|
*/
|
|
17
49
|
export declare const SuperDate: ({ as, color, size, variant, disabled, fullWidth, onChange, value, "data-test-value": testValue, "data-testid": testId, ...props }: SuperDateProps) => import("react/jsx-runtime").JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-fabric/superdate",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.52",
|
|
4
4
|
"description": "RUF: Superdate package for relative dates",
|
|
5
5
|
"author": "Adarsh Pastakia <adarshpastakia@outlook.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,19 +36,19 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@floating-ui/react": "^0.27.9",
|
|
39
|
-
"@react-fabric/core": "^1.0.0-beta.
|
|
40
|
-
"@react-fabric/date": "^1.0.0-beta.
|
|
41
|
-
"@react-fabric/form": "^1.0.0-beta.
|
|
42
|
-
"@react-fabric/utilities": "^1.0.0-beta.
|
|
39
|
+
"@react-fabric/core": "^1.0.0-beta.52",
|
|
40
|
+
"@react-fabric/date": "^1.0.0-beta.52",
|
|
41
|
+
"@react-fabric/form": "^1.0.0-beta.52",
|
|
42
|
+
"@react-fabric/utilities": "^1.0.0-beta.52",
|
|
43
43
|
"classnames": "^2.5.1",
|
|
44
44
|
"date-fns": "^4.1.0",
|
|
45
45
|
"resize-observer-polyfill": "^1.5.1"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"i18next": "^
|
|
48
|
+
"i18next": "^25.2.1",
|
|
49
49
|
"react": "^19.0.0",
|
|
50
50
|
"react-dom": "^19.0.0",
|
|
51
|
-
"react-i18next": "^15.
|
|
51
|
+
"react-i18next": "^15.5.2"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@types/react-color": "^3.0.12"
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"node": ">=18.12.0",
|
|
58
58
|
"npm": ">=8.19.0"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "0eabb9d88d91af93d657bcc209b226fd576e8260"
|
|
61
61
|
}
|
|
@@ -128,18 +128,50 @@ export const SuperDateTabs = ({
|
|
|
128
128
|
};
|
|
129
129
|
|
|
130
130
|
/**
|
|
131
|
-
*
|
|
131
|
+
* SuperDate component provides a date selection interface with quick, relative, and absolute date options.
|
|
132
|
+
* It allows users to select dates using predefined presets, relative date calculations, or absolute date ranges.
|
|
133
|
+
* It can be used in various applications where date selection is required, such as event scheduling, calendar applications, and date filtering.
|
|
134
|
+
* The component supports both Gregorian and Hijri calendars, and it can display relative date labels and tooltips based on the selected calendar.
|
|
135
|
+
* It is designed to be used as a button or a chip, depending on the `as` prop.
|
|
136
|
+
* It also supports event selection and recurring events.
|
|
132
137
|
*
|
|
133
|
-
*
|
|
134
|
-
* `$now
|
|
135
|
-
* `$
|
|
136
|
-
* `$
|
|
137
|
-
* `$
|
|
138
|
-
* `$
|
|
139
|
-
* `$
|
|
140
|
-
* `$
|
|
141
|
-
* `$
|
|
142
|
-
* `$
|
|
138
|
+
* Date Keys:
|
|
139
|
+
* - `$now`: Current date and time.
|
|
140
|
+
* - `$decade`: Current decade.
|
|
141
|
+
* - `$year`: Current year.
|
|
142
|
+
* - `$quarter`: Current quarter.
|
|
143
|
+
* - `$month`: Current month.
|
|
144
|
+
* - `$week`: Current week.
|
|
145
|
+
* - `$day`: Current day.
|
|
146
|
+
* - `$hour`: Current hour.
|
|
147
|
+
* - `$minute`: Current minute.
|
|
148
|
+
*
|
|
149
|
+
* Relative Date Format:
|
|
150
|
+
* - `$now+1|$now+2`: Represents a range from one day after now to two days after now.
|
|
151
|
+
* - `$now-1|$now+1`: Represents a range from one day before now to one day after now.
|
|
152
|
+
* - `$week|$now`: Represents the current week starting from the beginning of the week to now.
|
|
153
|
+
* - `$month|$week`: Represents the current month starting from the beginning of the month to the end of current week.
|
|
154
|
+
*
|
|
155
|
+
* @param {SuperDateProps} props - The properties for the SuperDate component.
|
|
156
|
+
* @returns {JSX.Element} The rendered SuperDate component.
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* ```jsx
|
|
160
|
+
* <SuperDate
|
|
161
|
+
* as="button"
|
|
162
|
+
* color="primary"
|
|
163
|
+
* size="medium"
|
|
164
|
+
* variant="filled"
|
|
165
|
+
* disabled={false}
|
|
166
|
+
* fullWidth={true}
|
|
167
|
+
* onChange={(value, range) => console.log("Selected date:", value, range)}
|
|
168
|
+
* value="$now+1|$now+2"
|
|
169
|
+
* data-test-value="superdate-value"
|
|
170
|
+
* data-testid="superdate"
|
|
171
|
+
* />
|
|
172
|
+
* ```
|
|
173
|
+
*
|
|
174
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/superdate-superdate--docs}
|
|
143
175
|
*/
|
|
144
176
|
export const SuperDate = ({
|
|
145
177
|
as = "button",
|