pcm-shared-components 2.0.180 → 2.0.182
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
// import { orange } from '@mui/material/colors';
|
|
4
4
|
import { Datepicker } from '@datepicker-react/styled';
|
|
@@ -81,7 +81,18 @@ export const DateCalendar = props => {
|
|
|
81
81
|
}, /*#__PURE__*/React.createElement(ThemeProvider, {
|
|
82
82
|
theme: commonCalendarTheme({
|
|
83
83
|
...props
|
|
84
|
-
}
|
|
84
|
+
},
|
|
85
|
+
// Main configuration object
|
|
86
|
+
{
|
|
87
|
+
colors: {
|
|
88
|
+
primaryColor: 'transparent',
|
|
89
|
+
accessibility: 'transparent',
|
|
90
|
+
selectedDay: 'transparent',
|
|
91
|
+
selectedDayHover: 'transparent',
|
|
92
|
+
normalDayHover: 'transparent'
|
|
93
|
+
}
|
|
94
|
+
} // Additional theme configuration
|
|
95
|
+
)
|
|
85
96
|
}, /*#__PURE__*/React.createElement(Datepicker, {
|
|
86
97
|
phrases: {
|
|
87
98
|
datepickerStartDateLabel: i18next.t('common.app.arrival_date'),
|
|
@@ -1,37 +1,51 @@
|
|
|
1
1
|
import { orange } from '@mui/material/colors';
|
|
2
|
+
|
|
3
|
+
// Common settings shared across themes
|
|
4
|
+
const baseThemeSettings = {
|
|
5
|
+
breakpoints: ['32em', '48em', '64em'],
|
|
6
|
+
reactDatepicker: {
|
|
7
|
+
fontFamily: 'system-ui, -apple-system',
|
|
8
|
+
dayLabelFontSize: 12,
|
|
9
|
+
dayLabelColor: "#8F8B9B",
|
|
10
|
+
dayBorderColor: "transparent",
|
|
11
|
+
dayFontSize: 15,
|
|
12
|
+
daySelectedBorderColor: "transparent",
|
|
13
|
+
inputFontSize: 16,
|
|
14
|
+
selectDateDateFontSize: 18,
|
|
15
|
+
datepickerBorderRadius: 5,
|
|
16
|
+
dayAccessibilityBorderColor: "none"
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// Main function to get the common calendar theme with variations
|
|
2
21
|
export const commonCalendarTheme = ({
|
|
3
22
|
variant = 'outlined',
|
|
4
23
|
zIndex = 1000,
|
|
5
24
|
daySize = [36, 40],
|
|
6
25
|
datepickerPadding = 25
|
|
7
|
-
}) => {
|
|
8
|
-
|
|
9
|
-
|
|
26
|
+
}, themeConfig = {}) => {
|
|
27
|
+
const theme = {
|
|
28
|
+
...baseThemeSettings,
|
|
10
29
|
reactDatepicker: {
|
|
30
|
+
...baseThemeSettings.reactDatepicker,
|
|
11
31
|
daySize: daySize,
|
|
12
|
-
fontFamily: 'system-ui, -apple-system',
|
|
13
32
|
colors: {
|
|
14
33
|
primaryColor: orange[900],
|
|
15
34
|
accessibility: orange[400],
|
|
16
35
|
selectedDay: orange[400],
|
|
17
36
|
selectedDayHover: orange[900],
|
|
18
|
-
normalDayHover: 'transparent'
|
|
37
|
+
normalDayHover: 'transparent',
|
|
38
|
+
...themeConfig.colors // Allows overriding color settings
|
|
19
39
|
},
|
|
20
|
-
|
|
21
|
-
dayLabelColor: "#8F8B9B",
|
|
22
|
-
dayBorderColor: "transparent",
|
|
23
|
-
dayFontSize: 15,
|
|
24
|
-
daySelectedBorderColor: "transparent",
|
|
25
|
-
inputFontSize: 16,
|
|
26
|
-
selectDateDateFontSize: 18,
|
|
27
|
-
dateRangeArrowIconColor: orange[700],
|
|
40
|
+
|
|
28
41
|
inputLabelBorder: variant === 'outlined' ? undefined : 'none',
|
|
29
|
-
datepickerBorderRadius: 5,
|
|
30
42
|
datepickerZIndex: zIndex,
|
|
31
43
|
dateRangeZIndex: zIndex,
|
|
32
44
|
dateSingleZIndex: zIndex,
|
|
33
|
-
|
|
34
|
-
|
|
45
|
+
datepickerPadding: datepickerPadding,
|
|
46
|
+
...themeConfig // Spread additional custom configuration
|
|
35
47
|
}
|
|
36
48
|
};
|
|
49
|
+
|
|
50
|
+
return theme;
|
|
37
51
|
};
|