@react-fabric/date 1.0.0-beta.62 → 1.0.0-beta.63
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/TimeSliders.js +1 -1
- package/dist/cjs/display/DateDisplay.js +4 -4
- package/dist/cjs/display/DateDuration.js +1 -1
- package/dist/cjs/panels/DatePanel.js +4 -4
- package/dist/cjs/panels/RangePanel.js +4 -4
- package/dist/esm/components/TimeSliders.js +1 -1
- package/dist/esm/display/DateDisplay.js +5 -5
- package/dist/esm/display/DateDuration.js +1 -1
- package/dist/esm/panels/DatePanel.js +5 -5
- package/dist/esm/panels/RangePanel.js +5 -5
- package/dist/types/display/DateDisplay.d.ts +1 -1
- package/dist/types/display/DateDuration.d.ts +1 -1
- package/dist/types/panels/DatePanel.d.ts +1 -1
- package/dist/types/panels/RangePanel.d.ts +1 -1
- package/package.json +11 -12
- package/src/components/TimeSliders.tsx +1 -1
- package/src/display/DateDisplay.tsx +3 -3
- package/src/display/DateDuration.tsx +1 -1
- package/src/panels/DatePanel.tsx +4 -4
- package/src/panels/RangePanel.tsx +4 -4
|
@@ -53,7 +53,7 @@ var TimeSlider = function TimeSlider(_ref) {
|
|
|
53
53
|
});
|
|
54
54
|
}, [onTimeChange]);
|
|
55
55
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
56
|
-
className: classNames("area-[time] flex flex-col flex-nowrap border-s border-s-tint-50 overflow-hidden bg-
|
|
56
|
+
className: classNames("area-[time] flex flex-col flex-nowrap border-s border-s-tint-50 overflow-hidden bg-default"),
|
|
57
57
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
58
58
|
className: "flex",
|
|
59
59
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -18,7 +18,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
18
18
|
* If `children` are provided, it wraps the date in a dropdown.
|
|
19
19
|
*
|
|
20
20
|
* @param {Object} props - The component props.
|
|
21
|
-
* @returns {
|
|
21
|
+
* @returns {React.ReactElement} - The rendered component.
|
|
22
22
|
*
|
|
23
23
|
* @example
|
|
24
24
|
* ```jsx
|
|
@@ -35,9 +35,9 @@ var DateDisplay = function DateDisplay(_ref) {
|
|
|
35
35
|
children = _ref.children,
|
|
36
36
|
showAlternateDate = _ref.showAlternateDate,
|
|
37
37
|
aria = _objectWithoutProperties(_ref, _excluded);
|
|
38
|
-
var
|
|
39
|
-
currentCalendar =
|
|
40
|
-
currentLocale =
|
|
38
|
+
var _useApplicationContex = core.useApplicationContext(),
|
|
39
|
+
currentCalendar = _useApplicationContex.currentCalendar,
|
|
40
|
+
currentLocale = _useApplicationContex.currentLocale;
|
|
41
41
|
var dtLabel = /*#__PURE__*/jsxRuntime.jsx(core.Tooltip, {
|
|
42
42
|
disabled: !showAlternateDate,
|
|
43
43
|
content: dateUtil.DateUtil.format(date, format, currentLocale, currentCalendar !== "hijri"),
|
|
@@ -22,7 +22,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
22
22
|
* It uses the current locale for translations.
|
|
23
23
|
*
|
|
24
24
|
* @param {Props} props - The properties for the component.
|
|
25
|
-
* @returns {
|
|
25
|
+
* @returns {React.ReactElement} The rendered component.
|
|
26
26
|
*
|
|
27
27
|
* @example
|
|
28
28
|
* ```jsx
|
|
@@ -25,7 +25,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
25
25
|
* It also supports disabling specific dates and setting minimum and maximum date limits.
|
|
26
26
|
*
|
|
27
27
|
* @param {DateProps} props - The properties for the DatePanel component.
|
|
28
|
-
* @return {
|
|
28
|
+
* @return {React.ReactElement} The rendered DatePanel component.
|
|
29
29
|
*
|
|
30
30
|
* @example
|
|
31
31
|
* ```jsx
|
|
@@ -55,8 +55,8 @@ var DatePanel = function DatePanel(_ref) {
|
|
|
55
55
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
56
56
|
var _useTranslation = reactI18next.useTranslation("date"),
|
|
57
57
|
t = _useTranslation.t;
|
|
58
|
-
var
|
|
59
|
-
currentCalendar =
|
|
58
|
+
var _useApplicationContex = core.useApplicationContext(),
|
|
59
|
+
currentCalendar = _useApplicationContex.currentCalendar;
|
|
60
60
|
var _useState = react.useState(currentCalendar === "hijri"),
|
|
61
61
|
_useState2 = _slicedToArray(_useState, 2),
|
|
62
62
|
isHijri = _useState2[0],
|
|
@@ -168,7 +168,7 @@ var DatePanel = function DatePanel(_ref) {
|
|
|
168
168
|
});
|
|
169
169
|
}, []);
|
|
170
170
|
return /*#__PURE__*/jsxRuntime.jsxs("div", _objectSpread(_objectSpread({
|
|
171
|
-
className: classNames("block overflow-hidden bg-
|
|
171
|
+
className: classNames("block overflow-hidden bg-default rounded-capped", className)
|
|
172
172
|
}, rest), {}, {
|
|
173
173
|
children: [/*#__PURE__*/jsxRuntime.jsx(BasePanel.BasePanel, _objectSpread(_objectSpread({}, state), {}, {
|
|
174
174
|
max: max,
|
|
@@ -25,7 +25,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
25
25
|
* It also supports disabling specific dates and setting minimum and maximum date limits.
|
|
26
26
|
*
|
|
27
27
|
* @param {RangeProps} props - The properties for the RangePanel component.
|
|
28
|
-
* @return {
|
|
28
|
+
* @return {React.ReactElement} The rendered RangePanel component.
|
|
29
29
|
*
|
|
30
30
|
* @example
|
|
31
31
|
* ```jsx
|
|
@@ -53,8 +53,8 @@ var RangePanel = function RangePanel(_ref) {
|
|
|
53
53
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
54
54
|
var _useTranslation = reactI18next.useTranslation("date"),
|
|
55
55
|
t = _useTranslation.t;
|
|
56
|
-
var
|
|
57
|
-
currentCalendar =
|
|
56
|
+
var _useApplicationContex = core.useApplicationContext(),
|
|
57
|
+
currentCalendar = _useApplicationContex.currentCalendar;
|
|
58
58
|
var _useState = react.useState(currentCalendar === "hijri"),
|
|
59
59
|
_useState2 = _slicedToArray(_useState, 2),
|
|
60
60
|
isHijri = _useState2[0],
|
|
@@ -226,7 +226,7 @@ var RangePanel = function RangePanel(_ref) {
|
|
|
226
226
|
});
|
|
227
227
|
}, []);
|
|
228
228
|
return /*#__PURE__*/jsxRuntime.jsxs("div", _objectSpread(_objectSpread({
|
|
229
|
-
className: classNames("block overflow-hidden bg-
|
|
229
|
+
className: classNames("block overflow-hidden bg-default rounded-capped", className)
|
|
230
230
|
}, rest), {}, {
|
|
231
231
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
232
232
|
className: "flex flex-nowrap",
|
|
@@ -53,7 +53,7 @@ var TimeSlider = function TimeSlider(_ref) {
|
|
|
53
53
|
});
|
|
54
54
|
}, [onTimeChange]);
|
|
55
55
|
return /*#__PURE__*/jsxs("div", {
|
|
56
|
-
className: classNames("area-[time] flex flex-col flex-nowrap border-s border-s-tint-50 overflow-hidden bg-
|
|
56
|
+
className: classNames("area-[time] flex flex-col flex-nowrap border-s border-s-tint-50 overflow-hidden bg-default"),
|
|
57
57
|
children: [/*#__PURE__*/jsxs("div", {
|
|
58
58
|
className: "flex",
|
|
59
59
|
children: [/*#__PURE__*/jsx("div", {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
4
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
5
|
-
import {
|
|
5
|
+
import { useApplicationContext, Tooltip, Dropdown } from '@react-fabric/core';
|
|
6
6
|
import { DateUtil } from '../utils/dateUtil.js';
|
|
7
7
|
import classNames from 'classnames';
|
|
8
8
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
@@ -18,7 +18,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
18
18
|
* If `children` are provided, it wraps the date in a dropdown.
|
|
19
19
|
*
|
|
20
20
|
* @param {Object} props - The component props.
|
|
21
|
-
* @returns {
|
|
21
|
+
* @returns {React.ReactElement} - The rendered component.
|
|
22
22
|
*
|
|
23
23
|
* @example
|
|
24
24
|
* ```jsx
|
|
@@ -35,9 +35,9 @@ var DateDisplay = function DateDisplay(_ref) {
|
|
|
35
35
|
children = _ref.children,
|
|
36
36
|
showAlternateDate = _ref.showAlternateDate,
|
|
37
37
|
aria = _objectWithoutProperties(_ref, _excluded);
|
|
38
|
-
var
|
|
39
|
-
currentCalendar =
|
|
40
|
-
currentLocale =
|
|
38
|
+
var _useApplicationContex = useApplicationContext(),
|
|
39
|
+
currentCalendar = _useApplicationContex.currentCalendar,
|
|
40
|
+
currentLocale = _useApplicationContex.currentLocale;
|
|
41
41
|
var dtLabel = /*#__PURE__*/jsx(Tooltip, {
|
|
42
42
|
disabled: !showAlternateDate,
|
|
43
43
|
content: DateUtil.format(date, format, currentLocale, currentCalendar !== "hijri"),
|
|
@@ -22,7 +22,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
22
22
|
* It uses the current locale for translations.
|
|
23
23
|
*
|
|
24
24
|
* @param {Props} props - The properties for the component.
|
|
25
|
-
* @returns {
|
|
25
|
+
* @returns {React.ReactElement} The rendered component.
|
|
26
26
|
*
|
|
27
27
|
* @example
|
|
28
28
|
* ```jsx
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
4
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
5
5
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
6
|
-
import {
|
|
6
|
+
import { useApplicationContext, useDebounce, Button } from '@react-fabric/core';
|
|
7
7
|
import { isEmpty, isArray } from '@react-fabric/utilities';
|
|
8
8
|
import classNames from 'classnames';
|
|
9
9
|
import { isBefore, isAfter, isSameDay } from 'date-fns';
|
|
@@ -25,7 +25,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
25
25
|
* It also supports disabling specific dates and setting minimum and maximum date limits.
|
|
26
26
|
*
|
|
27
27
|
* @param {DateProps} props - The properties for the DatePanel component.
|
|
28
|
-
* @return {
|
|
28
|
+
* @return {React.ReactElement} The rendered DatePanel component.
|
|
29
29
|
*
|
|
30
30
|
* @example
|
|
31
31
|
* ```jsx
|
|
@@ -55,8 +55,8 @@ var DatePanel = function DatePanel(_ref) {
|
|
|
55
55
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
56
56
|
var _useTranslation = useTranslation("date"),
|
|
57
57
|
t = _useTranslation.t;
|
|
58
|
-
var
|
|
59
|
-
currentCalendar =
|
|
58
|
+
var _useApplicationContex = useApplicationContext(),
|
|
59
|
+
currentCalendar = _useApplicationContex.currentCalendar;
|
|
60
60
|
var _useState = useState(currentCalendar === "hijri"),
|
|
61
61
|
_useState2 = _slicedToArray(_useState, 2),
|
|
62
62
|
isHijri = _useState2[0],
|
|
@@ -168,7 +168,7 @@ var DatePanel = function DatePanel(_ref) {
|
|
|
168
168
|
});
|
|
169
169
|
}, []);
|
|
170
170
|
return /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread({
|
|
171
|
-
className: classNames("block overflow-hidden bg-
|
|
171
|
+
className: classNames("block overflow-hidden bg-default rounded-capped", className)
|
|
172
172
|
}, rest), {}, {
|
|
173
173
|
children: [/*#__PURE__*/jsx(BasePanel, _objectSpread(_objectSpread({}, state), {}, {
|
|
174
174
|
max: max,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
4
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
5
5
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
6
|
-
import {
|
|
6
|
+
import { useApplicationContext, useDebounce, Button } from '@react-fabric/core';
|
|
7
7
|
import { isEmpty, isArray } from '@react-fabric/utilities';
|
|
8
8
|
import classNames from 'classnames';
|
|
9
9
|
import { isAfter, addMonths, isBefore, isSameDay } from 'date-fns';
|
|
@@ -25,7 +25,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
25
25
|
* It also supports disabling specific dates and setting minimum and maximum date limits.
|
|
26
26
|
*
|
|
27
27
|
* @param {RangeProps} props - The properties for the RangePanel component.
|
|
28
|
-
* @return {
|
|
28
|
+
* @return {React.ReactElement} The rendered RangePanel component.
|
|
29
29
|
*
|
|
30
30
|
* @example
|
|
31
31
|
* ```jsx
|
|
@@ -53,8 +53,8 @@ var RangePanel = function RangePanel(_ref) {
|
|
|
53
53
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
54
54
|
var _useTranslation = useTranslation("date"),
|
|
55
55
|
t = _useTranslation.t;
|
|
56
|
-
var
|
|
57
|
-
currentCalendar =
|
|
56
|
+
var _useApplicationContex = useApplicationContext(),
|
|
57
|
+
currentCalendar = _useApplicationContex.currentCalendar;
|
|
58
58
|
var _useState = useState(currentCalendar === "hijri"),
|
|
59
59
|
_useState2 = _slicedToArray(_useState, 2),
|
|
60
60
|
isHijri = _useState2[0],
|
|
@@ -226,7 +226,7 @@ var RangePanel = function RangePanel(_ref) {
|
|
|
226
226
|
});
|
|
227
227
|
}, []);
|
|
228
228
|
return /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread({
|
|
229
|
-
className: classNames("block overflow-hidden bg-
|
|
229
|
+
className: classNames("block overflow-hidden bg-default rounded-capped", className)
|
|
230
230
|
}, rest), {}, {
|
|
231
231
|
children: [/*#__PURE__*/jsxs("div", {
|
|
232
232
|
className: "flex flex-nowrap",
|
|
@@ -21,7 +21,7 @@ export interface Props extends CssProp, AriaProps, TestProps, Partial<ChildrenPr
|
|
|
21
21
|
* If `children` are provided, it wraps the date in a dropdown.
|
|
22
22
|
*
|
|
23
23
|
* @param {Object} props - The component props.
|
|
24
|
-
* @returns {
|
|
24
|
+
* @returns {React.ReactElement} - The rendered component.
|
|
25
25
|
*
|
|
26
26
|
* @example
|
|
27
27
|
* ```jsx
|
|
@@ -19,7 +19,7 @@ export interface Props extends CssProp, AriaProps, TestProps, Partial<ChildrenPr
|
|
|
19
19
|
* It uses the current locale for translations.
|
|
20
20
|
*
|
|
21
21
|
* @param {Props} props - The properties for the component.
|
|
22
|
-
* @returns {
|
|
22
|
+
* @returns {React.ReactElement} The rendered component.
|
|
23
23
|
*
|
|
24
24
|
* @example
|
|
25
25
|
* ```jsx
|
|
@@ -7,7 +7,7 @@ import { type DateProps } from "../types";
|
|
|
7
7
|
* It also supports disabling specific dates and setting minimum and maximum date limits.
|
|
8
8
|
*
|
|
9
9
|
* @param {DateProps} props - The properties for the DatePanel component.
|
|
10
|
-
* @return {
|
|
10
|
+
* @return {React.ReactElement} The rendered DatePanel component.
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
13
|
* ```jsx
|
|
@@ -7,7 +7,7 @@ import { type RangeProps } from "../types";
|
|
|
7
7
|
* It also supports disabling specific dates and setting minimum and maximum date limits.
|
|
8
8
|
*
|
|
9
9
|
* @param {RangeProps} props - The properties for the RangePanel component.
|
|
10
|
-
* @return {
|
|
10
|
+
* @return {React.ReactElement} The rendered RangePanel component.
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
13
|
* ```jsx
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-fabric/date",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.63",
|
|
4
4
|
"description": "RUF: Date package",
|
|
5
5
|
"author": "Adarsh Pastakia <adarshpastakia@outlook.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,21 +35,20 @@
|
|
|
35
35
|
"watch": "npm-run-all -p watch:rollup watch:dts"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@react-fabric/core": "^1.0.0-beta.
|
|
39
|
-
"@react-fabric/utilities": "^1.0.0-beta.
|
|
38
|
+
"@react-fabric/core": "^1.0.0-beta.63",
|
|
39
|
+
"@react-fabric/utilities": "^1.0.0-beta.63",
|
|
40
40
|
"classnames": "~2.5.1",
|
|
41
|
-
"date-fns": "~4.1.0"
|
|
42
|
-
"resize-observer-polyfill": "~1.5.1"
|
|
41
|
+
"date-fns": "~4.1.0"
|
|
43
42
|
},
|
|
44
43
|
"peerDependencies": {
|
|
45
|
-
"i18next": "~25.
|
|
46
|
-
"react": "~19.2.
|
|
47
|
-
"react-dom": "~19.2.
|
|
48
|
-
"react-i18next": "~16.
|
|
44
|
+
"i18next": "~25.8.18",
|
|
45
|
+
"react": "~19.2.4",
|
|
46
|
+
"react-dom": "~19.2.4",
|
|
47
|
+
"react-i18next": "~16.5.8"
|
|
49
48
|
},
|
|
50
49
|
"engines": {
|
|
51
|
-
"node": ">=18.
|
|
52
|
-
"npm": ">=8.
|
|
50
|
+
"node": ">=22.18.0",
|
|
51
|
+
"npm": ">=10.8.0"
|
|
53
52
|
},
|
|
54
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "6e0652b15c6384fbc316842862572e21299a5466"
|
|
55
54
|
}
|
|
@@ -73,7 +73,7 @@ export const TimeSlider = ({ hour = 0, minute = 0, onTimeChange }: Props) => {
|
|
|
73
73
|
return (
|
|
74
74
|
<div
|
|
75
75
|
className={classNames(
|
|
76
|
-
"area-[time] flex flex-col flex-nowrap border-s border-s-tint-50 overflow-hidden bg-
|
|
76
|
+
"area-[time] flex flex-col flex-nowrap border-s border-s-tint-50 overflow-hidden bg-default",
|
|
77
77
|
)}
|
|
78
78
|
>
|
|
79
79
|
<div className="flex">
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
|
-
import { Dropdown, Tooltip,
|
|
24
|
+
import { Dropdown, Tooltip, useApplicationContext } from "@react-fabric/core";
|
|
25
25
|
import { type MenuProps } from "@react-fabric/core/dist/types/components/menu/types";
|
|
26
26
|
import {
|
|
27
27
|
type AriaProps,
|
|
@@ -59,7 +59,7 @@ export interface Props
|
|
|
59
59
|
* If `children` are provided, it wraps the date in a dropdown.
|
|
60
60
|
*
|
|
61
61
|
* @param {Object} props - The component props.
|
|
62
|
-
* @returns {
|
|
62
|
+
* @returns {React.ReactElement} - The rendered component.
|
|
63
63
|
*
|
|
64
64
|
* @example
|
|
65
65
|
* ```jsx
|
|
@@ -76,7 +76,7 @@ export const DateDisplay = ({
|
|
|
76
76
|
showAlternateDate,
|
|
77
77
|
...aria
|
|
78
78
|
}: Props) => {
|
|
79
|
-
const { currentCalendar, currentLocale } =
|
|
79
|
+
const { currentCalendar, currentLocale } = useApplicationContext();
|
|
80
80
|
|
|
81
81
|
const dtLabel = (
|
|
82
82
|
<Tooltip
|
|
@@ -59,7 +59,7 @@ export interface Props
|
|
|
59
59
|
* It uses the current locale for translations.
|
|
60
60
|
*
|
|
61
61
|
* @param {Props} props - The properties for the component.
|
|
62
|
-
* @returns {
|
|
62
|
+
* @returns {React.ReactElement} The rendered component.
|
|
63
63
|
*
|
|
64
64
|
* @example
|
|
65
65
|
* ```jsx
|
package/src/panels/DatePanel.tsx
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
|
-
import { Button, useDebounce,
|
|
24
|
+
import { Button, useDebounce, useApplicationContext } from "@react-fabric/core";
|
|
25
25
|
import { isArray, isEmpty } from "@react-fabric/utilities";
|
|
26
26
|
import classNames from "classnames";
|
|
27
27
|
import { isAfter, isBefore, isSameDay } from "date-fns";
|
|
@@ -54,7 +54,7 @@ type PanelActions =
|
|
|
54
54
|
* It also supports disabling specific dates and setting minimum and maximum date limits.
|
|
55
55
|
*
|
|
56
56
|
* @param {DateProps} props - The properties for the DatePanel component.
|
|
57
|
-
* @return {
|
|
57
|
+
* @return {React.ReactElement} The rendered DatePanel component.
|
|
58
58
|
*
|
|
59
59
|
* @example
|
|
60
60
|
* ```jsx
|
|
@@ -84,7 +84,7 @@ export const DatePanel = ({
|
|
|
84
84
|
...rest
|
|
85
85
|
}: DateProps) => {
|
|
86
86
|
const { t } = useTranslation("date");
|
|
87
|
-
const { currentCalendar } =
|
|
87
|
+
const { currentCalendar } = useApplicationContext();
|
|
88
88
|
const [isHijri, setHijri] = useState(currentCalendar === "hijri");
|
|
89
89
|
const [canSelectToday, setCanSelectToday] = useState(true);
|
|
90
90
|
|
|
@@ -198,7 +198,7 @@ export const DatePanel = ({
|
|
|
198
198
|
return (
|
|
199
199
|
<div
|
|
200
200
|
className={classNames(
|
|
201
|
-
"block overflow-hidden bg-
|
|
201
|
+
"block overflow-hidden bg-default rounded-capped",
|
|
202
202
|
className,
|
|
203
203
|
)}
|
|
204
204
|
{...rest}
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
|
-
import { Button, useDebounce,
|
|
24
|
+
import { Button, useDebounce, useApplicationContext } from "@react-fabric/core";
|
|
25
25
|
import { isArray, isEmpty } from "@react-fabric/utilities";
|
|
26
26
|
import classNames from "classnames";
|
|
27
27
|
import { addMonths, isAfter, isBefore, isSameDay } from "date-fns";
|
|
@@ -66,7 +66,7 @@ type PanelActions =
|
|
|
66
66
|
* It also supports disabling specific dates and setting minimum and maximum date limits.
|
|
67
67
|
*
|
|
68
68
|
* @param {RangeProps} props - The properties for the RangePanel component.
|
|
69
|
-
* @return {
|
|
69
|
+
* @return {React.ReactElement} The rendered RangePanel component.
|
|
70
70
|
*
|
|
71
71
|
* @example
|
|
72
72
|
* ```jsx
|
|
@@ -94,7 +94,7 @@ export const RangePanel = ({
|
|
|
94
94
|
...rest
|
|
95
95
|
}: RangeProps) => {
|
|
96
96
|
const { t } = useTranslation("date");
|
|
97
|
-
const { currentCalendar } =
|
|
97
|
+
const { currentCalendar } = useApplicationContext();
|
|
98
98
|
const [isHijri, setHijri] = useState(currentCalendar === "hijri");
|
|
99
99
|
|
|
100
100
|
const fireChange = useDebounce(onChange, [onChange]);
|
|
@@ -286,7 +286,7 @@ export const RangePanel = ({
|
|
|
286
286
|
return (
|
|
287
287
|
<div
|
|
288
288
|
className={classNames(
|
|
289
|
-
"block overflow-hidden bg-
|
|
289
|
+
"block overflow-hidden bg-default rounded-capped",
|
|
290
290
|
className,
|
|
291
291
|
)}
|
|
292
292
|
{...rest}
|