@razorpay/blade 11.18.2 → 11.19.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.
- package/build/lib/native/components/Button/BaseButton/BaseButton.js +1 -1
- package/build/lib/native/components/Button/BaseButton/BaseButton.js.map +1 -1
- package/build/lib/native/components/Button/BaseButton/buttonTokens.js +1 -1
- package/build/lib/native/components/Button/BaseButton/buttonTokens.js.map +1 -1
- package/build/lib/native/components/DatePicker/DatePicker.native.js +7 -0
- package/build/lib/native/components/DatePicker/DatePicker.native.js.map +1 -0
- package/build/lib/native/components/index.js +1 -0
- package/build/lib/native/components/index.js.map +1 -1
- package/build/lib/native/tokens/global/size.js +1 -1
- package/build/lib/native/tokens/global/size.js.map +1 -1
- package/build/lib/native/utils/metaAttribute/metaConstants.js +1 -1
- package/build/lib/native/utils/metaAttribute/metaConstants.js.map +1 -1
- package/build/lib/web/development/components/BottomSheet/BottomSheetBody.web.js +6 -4
- package/build/lib/web/development/components/BottomSheet/BottomSheetBody.web.js.map +1 -1
- package/build/lib/web/development/components/Button/BaseButton/BaseButton.js +1 -1
- package/build/lib/web/development/components/Button/BaseButton/BaseButton.js.map +1 -1
- package/build/lib/web/development/components/Button/BaseButton/buttonTokens.js +2 -2
- package/build/lib/web/development/components/Button/BaseButton/buttonTokens.js.map +1 -1
- package/build/lib/web/development/components/DatePicker/Calendar.web.js +182 -0
- package/build/lib/web/development/components/DatePicker/Calendar.web.js.map +1 -0
- package/build/lib/web/development/components/DatePicker/CalendarFooter.web.js +46 -0
- package/build/lib/web/development/components/DatePicker/CalendarFooter.web.js.map +1 -0
- package/build/lib/web/development/components/DatePicker/CalendarHeader.web.js +162 -0
- package/build/lib/web/development/components/DatePicker/CalendarHeader.web.js.map +1 -0
- package/build/lib/web/development/components/DatePicker/CalendarStyles.web.js +310 -0
- package/build/lib/web/development/components/DatePicker/CalendarStyles.web.js.map +1 -0
- package/build/lib/web/development/components/DatePicker/DateInput.web.js +185 -0
- package/build/lib/web/development/components/DatePicker/DateInput.web.js.map +1 -0
- package/build/lib/web/development/components/DatePicker/DatePicker.web.js +364 -0
- package/build/lib/web/development/components/DatePicker/DatePicker.web.js.map +1 -0
- package/build/lib/web/development/components/DatePicker/QuickSelection/PresetSideBar.web.js +86 -0
- package/build/lib/web/development/components/DatePicker/QuickSelection/PresetSideBar.web.js.map +1 -0
- package/build/lib/web/development/components/DatePicker/QuickSelection/QuickSelectionItem.web.js +43 -0
- package/build/lib/web/development/components/DatePicker/QuickSelection/QuickSelectionItem.web.js.map +1 -0
- package/build/lib/web/development/components/DatePicker/constants.js +22 -0
- package/build/lib/web/development/components/DatePicker/constants.js.map +1 -0
- package/build/lib/web/development/components/DatePicker/index.js +2 -0
- package/build/lib/web/development/components/DatePicker/index.js.map +1 -0
- package/build/lib/web/development/components/DatePicker/useControlledDates.js +75 -0
- package/build/lib/web/development/components/DatePicker/useControlledDates.js.map +1 -0
- package/build/lib/web/development/components/DatePicker/useDatesState.js +149 -0
- package/build/lib/web/development/components/DatePicker/useDatesState.js.map +1 -0
- package/build/lib/web/development/components/DatePicker/usePopup.js +90 -0
- package/build/lib/web/development/components/DatePicker/usePopup.js.map +1 -0
- package/build/lib/web/development/components/DatePicker/utils.js +39 -0
- package/build/lib/web/development/components/DatePicker/utils.js.map +1 -0
- package/build/lib/web/development/components/Input/PhoneNumberInput/PhoneNumberInput.web.js +3 -2
- package/build/lib/web/development/components/Input/PhoneNumberInput/PhoneNumberInput.web.js.map +1 -1
- package/build/lib/web/development/components/index.js +2 -0
- package/build/lib/web/development/components/index.js.map +1 -1
- package/build/lib/web/development/tokens/global/size.js +2 -0
- package/build/lib/web/development/tokens/global/size.js.map +1 -1
- package/build/lib/web/development/utils/getFocusRingStyles/getFocusRingStyles.web.js +6 -3
- package/build/lib/web/development/utils/getFocusRingStyles/getFocusRingStyles.web.js.map +1 -1
- package/build/lib/web/development/utils/metaAttribute/metaConstants.js +2 -0
- package/build/lib/web/development/utils/metaAttribute/metaConstants.js.map +1 -1
- package/build/lib/web/production/components/BottomSheet/BottomSheetBody.web.js +6 -4
- package/build/lib/web/production/components/BottomSheet/BottomSheetBody.web.js.map +1 -1
- package/build/lib/web/production/components/Button/BaseButton/BaseButton.js +1 -1
- package/build/lib/web/production/components/Button/BaseButton/BaseButton.js.map +1 -1
- package/build/lib/web/production/components/Button/BaseButton/buttonTokens.js +2 -2
- package/build/lib/web/production/components/Button/BaseButton/buttonTokens.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/Calendar.web.js +182 -0
- package/build/lib/web/production/components/DatePicker/Calendar.web.js.map +1 -0
- package/build/lib/web/production/components/DatePicker/CalendarFooter.web.js +46 -0
- package/build/lib/web/production/components/DatePicker/CalendarFooter.web.js.map +1 -0
- package/build/lib/web/production/components/DatePicker/CalendarHeader.web.js +162 -0
- package/build/lib/web/production/components/DatePicker/CalendarHeader.web.js.map +1 -0
- package/build/lib/web/production/components/DatePicker/CalendarStyles.web.js +310 -0
- package/build/lib/web/production/components/DatePicker/CalendarStyles.web.js.map +1 -0
- package/build/lib/web/production/components/DatePicker/DateInput.web.js +185 -0
- package/build/lib/web/production/components/DatePicker/DateInput.web.js.map +1 -0
- package/build/lib/web/production/components/DatePicker/DatePicker.web.js +364 -0
- package/build/lib/web/production/components/DatePicker/DatePicker.web.js.map +1 -0
- package/build/lib/web/production/components/DatePicker/QuickSelection/PresetSideBar.web.js +86 -0
- package/build/lib/web/production/components/DatePicker/QuickSelection/PresetSideBar.web.js.map +1 -0
- package/build/lib/web/production/components/DatePicker/QuickSelection/QuickSelectionItem.web.js +43 -0
- package/build/lib/web/production/components/DatePicker/QuickSelection/QuickSelectionItem.web.js.map +1 -0
- package/build/lib/web/production/components/DatePicker/constants.js +22 -0
- package/build/lib/web/production/components/DatePicker/constants.js.map +1 -0
- package/build/lib/web/production/components/DatePicker/index.js +2 -0
- package/build/lib/web/production/components/DatePicker/index.js.map +1 -0
- package/build/lib/web/production/components/DatePicker/useControlledDates.js +75 -0
- package/build/lib/web/production/components/DatePicker/useControlledDates.js.map +1 -0
- package/build/lib/web/production/components/DatePicker/useDatesState.js +149 -0
- package/build/lib/web/production/components/DatePicker/useDatesState.js.map +1 -0
- package/build/lib/web/production/components/DatePicker/usePopup.js +90 -0
- package/build/lib/web/production/components/DatePicker/usePopup.js.map +1 -0
- package/build/lib/web/production/components/DatePicker/utils.js +39 -0
- package/build/lib/web/production/components/DatePicker/utils.js.map +1 -0
- package/build/lib/web/production/components/Input/PhoneNumberInput/PhoneNumberInput.web.js +3 -2
- package/build/lib/web/production/components/Input/PhoneNumberInput/PhoneNumberInput.web.js.map +1 -1
- package/build/lib/web/production/components/index.js +2 -0
- package/build/lib/web/production/components/index.js.map +1 -1
- package/build/lib/web/production/tokens/global/size.js +2 -0
- package/build/lib/web/production/tokens/global/size.js.map +1 -1
- package/build/lib/web/production/utils/getFocusRingStyles/getFocusRingStyles.web.js +6 -3
- package/build/lib/web/production/utils/getFocusRingStyles/getFocusRingStyles.web.js.map +1 -1
- package/build/lib/web/production/utils/metaAttribute/metaConstants.js +2 -0
- package/build/lib/web/production/utils/metaAttribute/metaConstants.js.map +1 -1
- package/build/types/components/index.d.ts +1242 -527
- package/build/types/components/index.native.d.ts +550 -406
- package/build/types/tokens/index.d.ts +2 -0
- package/build/types/tokens/index.native.d.ts +2 -0
- package/package.json +7 -3
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import dayjs from 'dayjs';
|
|
2
|
+
import { useI18nContext } from '../../node_modules/@razorpay/i18nify-react/lib/esm/index.js';
|
|
3
|
+
import { convertIntlToDayjsLocale } from './utils.js';
|
|
4
|
+
import '../Box/index.js';
|
|
5
|
+
import '../Button/index.js';
|
|
6
|
+
import '../Typography/index.js';
|
|
7
|
+
import '../Icons/index.js';
|
|
8
|
+
import '../Link/index.js';
|
|
9
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
10
|
+
import { Box } from '../Box/Box.js';
|
|
11
|
+
import Button from '../Button/Button/Button.js';
|
|
12
|
+
import ChevronLeftIcon from '../Icons/ChevronLeftIcon/ChevronLeftIcon.js';
|
|
13
|
+
import { Text } from '../Typography/Text/Text.js';
|
|
14
|
+
import Link from '../Link/Link/Link.js';
|
|
15
|
+
import ChevronDownIcon from '../Icons/ChevronDownIcon/ChevronDownIcon.js';
|
|
16
|
+
import ChevronRightIcon from '../Icons/ChevronRightIcon/ChevronRightIcon.js';
|
|
17
|
+
|
|
18
|
+
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
19
|
+
|
|
20
|
+
var CalendarHeader = function CalendarHeader(_ref) {
|
|
21
|
+
var _i18nState$locale;
|
|
22
|
+
var isRange = _ref.isRange,
|
|
23
|
+
date = _ref.date,
|
|
24
|
+
pickerType = _ref.pickerType,
|
|
25
|
+
onNextMonth = _ref.onNextMonth,
|
|
26
|
+
onNextYear = _ref.onNextYear,
|
|
27
|
+
onNextDecade = _ref.onNextDecade,
|
|
28
|
+
onPreviousMonth = _ref.onPreviousMonth,
|
|
29
|
+
onPreviousYear = _ref.onPreviousYear,
|
|
30
|
+
onPreviousDecade = _ref.onPreviousDecade,
|
|
31
|
+
onLevelChange = _ref.onLevelChange;
|
|
32
|
+
var _useI18nContext = useI18nContext(),
|
|
33
|
+
i18nState = _useI18nContext.i18nState;
|
|
34
|
+
var locale = convertIntlToDayjsLocale((_i18nState$locale = i18nState === null || i18nState === void 0 ? void 0 : i18nState.locale) !== null && _i18nState$locale !== void 0 ? _i18nState$locale : 'en-IN');
|
|
35
|
+
var month = dayjs(date).locale(locale).format('MMMM');
|
|
36
|
+
var year = dayjs(date).locale(locale).format('YYYY');
|
|
37
|
+
var currentYear = dayjs(date).year();
|
|
38
|
+
var startYearOfDecade = Math.floor(currentYear / 10) * 10;
|
|
39
|
+
var endYearOfDecade = startYearOfDecade + 9;
|
|
40
|
+
var nextMonth = dayjs(date).locale(locale).add(1, 'month').format('MMMM');
|
|
41
|
+
var nextYear = dayjs(date).locale(locale).add(1, 'month').format('YYYY');
|
|
42
|
+
var handleNext = function handleNext() {
|
|
43
|
+
switch (pickerType) {
|
|
44
|
+
case 'day':
|
|
45
|
+
onNextMonth();
|
|
46
|
+
break;
|
|
47
|
+
case 'month':
|
|
48
|
+
onNextYear();
|
|
49
|
+
break;
|
|
50
|
+
case 'year':
|
|
51
|
+
onNextDecade();
|
|
52
|
+
break;
|
|
53
|
+
default:
|
|
54
|
+
throw new Error('Invalid picker type');
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
var handlePrevious = function handlePrevious() {
|
|
58
|
+
switch (pickerType) {
|
|
59
|
+
case 'day':
|
|
60
|
+
onPreviousMonth();
|
|
61
|
+
break;
|
|
62
|
+
case 'month':
|
|
63
|
+
onPreviousYear();
|
|
64
|
+
break;
|
|
65
|
+
case 'year':
|
|
66
|
+
onPreviousDecade();
|
|
67
|
+
break;
|
|
68
|
+
default:
|
|
69
|
+
throw new Error('Invalid picker type');
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
return /*#__PURE__*/jsxs(Box, {
|
|
73
|
+
display: isRange ? 'grid' : 'flex',
|
|
74
|
+
gridTemplateColumns: {
|
|
75
|
+
base: 'auto 1fr auto',
|
|
76
|
+
m: 'auto 1fr 1fr auto'
|
|
77
|
+
},
|
|
78
|
+
justifyContent: "space-between",
|
|
79
|
+
alignItems: "center",
|
|
80
|
+
children: [/*#__PURE__*/jsx(Button, {
|
|
81
|
+
justifySelf: "start",
|
|
82
|
+
size: "small",
|
|
83
|
+
variant: "tertiary",
|
|
84
|
+
onClick: handlePrevious,
|
|
85
|
+
accessibilityLabel: "Previous",
|
|
86
|
+
icon: ChevronLeftIcon
|
|
87
|
+
}), isRange ? /*#__PURE__*/jsxs(Fragment, {
|
|
88
|
+
children: [/*#__PURE__*/jsxs(Text, {
|
|
89
|
+
display: {
|
|
90
|
+
base: 'none',
|
|
91
|
+
m: 'block'
|
|
92
|
+
},
|
|
93
|
+
size: "large",
|
|
94
|
+
weight: "medium",
|
|
95
|
+
marginRight: "spacing.7",
|
|
96
|
+
justifySelf: "center",
|
|
97
|
+
children: [month, " ", year]
|
|
98
|
+
}), /*#__PURE__*/jsxs(Text, {
|
|
99
|
+
display: {
|
|
100
|
+
base: 'none',
|
|
101
|
+
m: 'block'
|
|
102
|
+
},
|
|
103
|
+
size: "large",
|
|
104
|
+
weight: "medium",
|
|
105
|
+
marginLeft: "spacing.7",
|
|
106
|
+
justifySelf: "center",
|
|
107
|
+
children: [nextMonth, " ", nextYear]
|
|
108
|
+
}), /*#__PURE__*/jsxs(Text, {
|
|
109
|
+
display: {
|
|
110
|
+
base: 'block',
|
|
111
|
+
m: 'none'
|
|
112
|
+
},
|
|
113
|
+
size: "large",
|
|
114
|
+
weight: "medium",
|
|
115
|
+
justifySelf: "center",
|
|
116
|
+
children: [month, " ", year]
|
|
117
|
+
})]
|
|
118
|
+
}) : /*#__PURE__*/jsxs(Box, {
|
|
119
|
+
display: "flex",
|
|
120
|
+
gap: "spacing.5",
|
|
121
|
+
alignItems: "center",
|
|
122
|
+
children: [pickerType === 'day' && /*#__PURE__*/jsxs(Link, {
|
|
123
|
+
onClick: function onClick() {
|
|
124
|
+
onLevelChange('year');
|
|
125
|
+
},
|
|
126
|
+
size: "large",
|
|
127
|
+
variant: "button",
|
|
128
|
+
color: "neutral",
|
|
129
|
+
iconPosition: "right",
|
|
130
|
+
icon: ChevronDownIcon,
|
|
131
|
+
accessibilityLabel: "Change month",
|
|
132
|
+
children: [month, " ", year]
|
|
133
|
+
}), pickerType === 'month' && /*#__PURE__*/jsx(Link, {
|
|
134
|
+
onClick: function onClick() {
|
|
135
|
+
onLevelChange('decade');
|
|
136
|
+
},
|
|
137
|
+
size: "large",
|
|
138
|
+
variant: "button",
|
|
139
|
+
color: "neutral",
|
|
140
|
+
iconPosition: "right",
|
|
141
|
+
icon: ChevronDownIcon,
|
|
142
|
+
accessibilityLabel: "Change decade",
|
|
143
|
+
children: year
|
|
144
|
+
}), pickerType === 'year' && /*#__PURE__*/jsxs(Text, {
|
|
145
|
+
size: "large",
|
|
146
|
+
weight: "medium",
|
|
147
|
+
color: "interactive.text.neutral.normal",
|
|
148
|
+
children: [startYearOfDecade, " - ", endYearOfDecade]
|
|
149
|
+
})]
|
|
150
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
151
|
+
justifySelf: "end",
|
|
152
|
+
size: "small",
|
|
153
|
+
variant: "tertiary",
|
|
154
|
+
onClick: handleNext,
|
|
155
|
+
accessibilityLabel: "Next",
|
|
156
|
+
icon: ChevronRightIcon
|
|
157
|
+
})]
|
|
158
|
+
});
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
export { CalendarHeader };
|
|
162
|
+
//# sourceMappingURL=CalendarHeader.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CalendarHeader.web.js","sources":["../../../../../../src/components/DatePicker/CalendarHeader.web.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/explicit-function-return-type */\nimport type { CalendarLevel as MantineCalendarLevel } from '@mantine/dates';\nimport dayjs from 'dayjs';\nimport { useI18nContext } from '@razorpay/i18nify-react';\nimport type { PickerType, DateValue, DatesRangeValue } from './types';\nimport { convertIntlToDayjsLocale } from './utils';\nimport { Box } from '~components/Box';\nimport { Button } from '~components/Button';\nimport { Text } from '~components/Typography';\nimport { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from '~components/Icons';\nimport { Link } from '~components/Link';\n\ntype CalendarHeaderProps = {\n isRange: boolean;\n date: DateValue | DatesRangeValue;\n pickerType: PickerType;\n onNextMonth: () => void;\n onPreviousMonth: () => void;\n onNextYear: () => void;\n onPreviousYear: () => void;\n onNextDecade: () => void;\n onPreviousDecade: () => void;\n onLevelChange: (level: MantineCalendarLevel) => void;\n};\n\nconst CalendarHeader = ({\n isRange,\n date,\n pickerType,\n onNextMonth,\n onNextYear,\n onNextDecade,\n onPreviousMonth,\n onPreviousYear,\n onPreviousDecade,\n onLevelChange,\n}: CalendarHeaderProps): React.ReactElement => {\n const { i18nState } = useI18nContext();\n const locale = convertIntlToDayjsLocale(i18nState?.locale ?? 'en-IN');\n\n const month = dayjs(date as Date)\n .locale(locale)\n .format('MMMM');\n const year = dayjs(date as Date)\n .locale(locale)\n .format('YYYY');\n const currentYear = dayjs(date as Date).year();\n const startYearOfDecade = Math.floor(currentYear / 10) * 10;\n const endYearOfDecade = startYearOfDecade + 9;\n const nextMonth = dayjs(date as Date)\n .locale(locale)\n .add(1, 'month')\n .format('MMMM');\n const nextYear = dayjs(date as Date)\n .locale(locale)\n .add(1, 'month')\n .format('YYYY');\n\n const handleNext = () => {\n switch (pickerType) {\n case 'day':\n onNextMonth();\n break;\n case 'month':\n onNextYear();\n break;\n case 'year':\n onNextDecade();\n break;\n default:\n throw new Error('Invalid picker type');\n }\n };\n\n const handlePrevious = () => {\n switch (pickerType) {\n case 'day':\n onPreviousMonth();\n break;\n case 'month':\n onPreviousYear();\n break;\n case 'year':\n onPreviousDecade();\n break;\n default:\n throw new Error('Invalid picker type');\n }\n };\n\n return (\n <Box\n display={isRange ? 'grid' : 'flex'}\n gridTemplateColumns={{ base: 'auto 1fr auto', m: 'auto 1fr 1fr auto' }}\n justifyContent=\"space-between\"\n alignItems=\"center\"\n >\n <Button\n justifySelf=\"start\"\n size=\"small\"\n variant=\"tertiary\"\n onClick={handlePrevious}\n accessibilityLabel=\"Previous\"\n icon={ChevronLeftIcon}\n />\n {isRange ? (\n <>\n <Text\n display={{ base: 'none', m: 'block' }}\n size=\"large\"\n weight=\"medium\"\n marginRight=\"spacing.7\"\n justifySelf=\"center\"\n >\n {month} {year}\n </Text>\n <Text\n display={{ base: 'none', m: 'block' }}\n size=\"large\"\n weight=\"medium\"\n marginLeft=\"spacing.7\"\n justifySelf=\"center\"\n >\n {nextMonth} {nextYear}\n </Text>\n <Text\n display={{ base: 'block', m: 'none' }}\n size=\"large\"\n weight=\"medium\"\n justifySelf=\"center\"\n >\n {month} {year}\n </Text>\n </>\n ) : (\n <Box display=\"flex\" gap=\"spacing.5\" alignItems=\"center\">\n {pickerType === 'day' && (\n <Link\n onClick={() => {\n onLevelChange('year');\n }}\n size=\"large\"\n variant=\"button\"\n color=\"neutral\"\n iconPosition=\"right\"\n icon={ChevronDownIcon}\n accessibilityLabel=\"Change month\"\n >\n {month} {year}\n </Link>\n )}\n {pickerType === 'month' && (\n <Link\n onClick={() => {\n onLevelChange('decade');\n }}\n size=\"large\"\n variant=\"button\"\n color=\"neutral\"\n iconPosition=\"right\"\n icon={ChevronDownIcon}\n accessibilityLabel=\"Change decade\"\n >\n {year}\n </Link>\n )}\n {pickerType === 'year' && (\n <Text size=\"large\" weight=\"medium\" color=\"interactive.text.neutral.normal\">\n {startYearOfDecade} - {endYearOfDecade}\n </Text>\n )}\n </Box>\n )}\n <Button\n justifySelf=\"end\"\n size=\"small\"\n variant=\"tertiary\"\n onClick={handleNext}\n accessibilityLabel=\"Next\"\n icon={ChevronRightIcon}\n />\n </Box>\n );\n};\n\nexport { CalendarHeader };\n"],"names":["CalendarHeader","_ref","_i18nState$locale","isRange","date","pickerType","onNextMonth","onNextYear","onNextDecade","onPreviousMonth","onPreviousYear","onPreviousDecade","onLevelChange","_useI18nContext","useI18nContext","i18nState","locale","convertIntlToDayjsLocale","month","dayjs","format","year","currentYear","startYearOfDecade","Math","floor","endYearOfDecade","nextMonth","add","nextYear","handleNext","Error","handlePrevious","_jsxs","Box","display","gridTemplateColumns","base","m","justifyContent","alignItems","children","_jsx","Button","justifySelf","size","variant","onClick","accessibilityLabel","icon","ChevronLeftIcon","_Fragment","Text","weight","marginRight","marginLeft","gap","Link","color","iconPosition","ChevronDownIcon","ChevronRightIcon"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;AAyBA,IAAMA,cAAc,GAAG,SAAjBA,cAAcA,CAAAC,IAAA,EAW2B;AAAA,EAAA,IAAAC,iBAAA,CAAA;AAAA,EAAA,IAV7CC,OAAO,GAAAF,IAAA,CAAPE,OAAO;IACPC,IAAI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AAA,MAAM,EAAC,QAAQ;AAACK,QAAAA,KAAK,EAAC,iCAAiC;AAAAjB,QAAAA,QAAA,EACvElB,CAAAA,iBAAiB,EAAC,KAAG,EAACG,eAAe,CAAA;AAAA,OAClC,CACP,CAAA;AAAA,KACE,CACN,eACDgB,GAAA,CAACC,MAAM,EAAA;AACLC,MAAAA,WAAW,EAAC,KAAK;AACjBC,MAAAA,IAAI,EAAC,OAAO;AACZC,MAAAA,OAAO,EAAC,UAAU;AAClBC,MAAAA,OAAO,EAAEjB,UAAW;AACpBkB,MAAAA,kBAAkB,EAAC,MAAM;AACzBC,MAAAA,IAAI,EAAEY,gBAAAA;AAAiB,KACxB,CAAC,CAAA;AAAA,GACC,CAAC,CAAA;AAEV;;;;"}
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import dayjs from 'dayjs';
|
|
4
|
+
import { classes } from './constants.js';
|
|
5
|
+
import '../Box/BaseBox/index.js';
|
|
6
|
+
import getTextStyles from '../Typography/Text/getTextStyles.js';
|
|
7
|
+
import '../../tokens/global/index.js';
|
|
8
|
+
import '../../utils/index.js';
|
|
9
|
+
import getIn from '../../utils/lodashButBetter/get.js';
|
|
10
|
+
import { useIsMobile } from '../../utils/useIsMobile.js';
|
|
11
|
+
import '../../utils/getFocusRingStyles/index.js';
|
|
12
|
+
import { size } from '../../tokens/global/size.js';
|
|
13
|
+
import { BaseBox } from '../Box/BaseBox/BaseBox.web.js';
|
|
14
|
+
import { makeSpace } from '../../utils/makeSpace/makeSpace.js';
|
|
15
|
+
import { makeBorderSize } from '../../utils/makeBorderSize/makeBorderSize.js';
|
|
16
|
+
import { getFocusRingStyles } from '../../utils/getFocusRingStyles/getFocusRingStyles.web.js';
|
|
17
|
+
|
|
18
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
19
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
20
|
+
var cell = {
|
|
21
|
+
gap: {
|
|
22
|
+
x: size[0],
|
|
23
|
+
y: size[2]
|
|
24
|
+
},
|
|
25
|
+
size: {
|
|
26
|
+
desktop: size[40],
|
|
27
|
+
mobile: size[48]
|
|
28
|
+
},
|
|
29
|
+
background: {
|
|
30
|
+
"default": 'transparent',
|
|
31
|
+
hover: 'interactive.background.gray.highlighted',
|
|
32
|
+
disabled: 'transparent'
|
|
33
|
+
},
|
|
34
|
+
text: {
|
|
35
|
+
"default": 'interactive.text.gray.normal',
|
|
36
|
+
disabled: 'interactive.text.gray.disabled'
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
var todayCell = {
|
|
40
|
+
background: {
|
|
41
|
+
"default": 'transparent',
|
|
42
|
+
hover: 'interactive.background.primary.faded'
|
|
43
|
+
},
|
|
44
|
+
border: {
|
|
45
|
+
"default": 'interactive.border.primary.default',
|
|
46
|
+
hover: 'interactive.border.primary.default'
|
|
47
|
+
},
|
|
48
|
+
text: {
|
|
49
|
+
"default": 'interactive.text.primary.normal',
|
|
50
|
+
hover: 'interactive.text.primary.normal'
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
var selectedCell = {
|
|
54
|
+
day: {
|
|
55
|
+
background: {
|
|
56
|
+
"default": 'interactive.background.primary.default',
|
|
57
|
+
hover: 'interactive.background.primary.highlighted'
|
|
58
|
+
},
|
|
59
|
+
border: {
|
|
60
|
+
"default": 'interactive.border.primary.default',
|
|
61
|
+
hover: 'interactive.border.primary.faded'
|
|
62
|
+
},
|
|
63
|
+
text: {
|
|
64
|
+
"default": 'interactive.text.onPrimary.normal',
|
|
65
|
+
hover: 'interactive.text.onPrimary.normal'
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
month: {
|
|
69
|
+
background: {
|
|
70
|
+
"default": 'transparent',
|
|
71
|
+
hover: 'interactive.background.primary.faded'
|
|
72
|
+
},
|
|
73
|
+
border: {
|
|
74
|
+
"default": 'interactive.border.primary.default'
|
|
75
|
+
},
|
|
76
|
+
text: {
|
|
77
|
+
"default": 'interactive.text.primary.normal'
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
var inRangeCell = {
|
|
82
|
+
background: {
|
|
83
|
+
"default": 'surface.background.primary.subtle',
|
|
84
|
+
hover: 'interactive.background.primary.faded'
|
|
85
|
+
},
|
|
86
|
+
border: {
|
|
87
|
+
"default": 'interactive.border.primary.default',
|
|
88
|
+
hover: 'interactive.border.primary.default'
|
|
89
|
+
},
|
|
90
|
+
text: {
|
|
91
|
+
"default": 'interactive.text.primary.normal',
|
|
92
|
+
hover: 'interactive.text.primary.normal'
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
var CalendarGradientStyles = /*#__PURE__*/styled(BaseBox).withConfig({
|
|
96
|
+
displayName: "CalendarStylesweb__CalendarGradientStyles",
|
|
97
|
+
componentId: "xxlq7y-0"
|
|
98
|
+
})(function (_ref) {
|
|
99
|
+
var theme = _ref.theme,
|
|
100
|
+
date = _ref.date,
|
|
101
|
+
isRange = _ref.isRange;
|
|
102
|
+
var isMobile = useIsMobile();
|
|
103
|
+
// Bail out if datepicker is not in range mode or on mobile
|
|
104
|
+
if (isMobile || !isRange) return {};
|
|
105
|
+
|
|
106
|
+
// Calculate the first and last day of the month for both calendars in range mode
|
|
107
|
+
// This is to apply the gradient to the first and last day of the month
|
|
108
|
+
var cal1 = dayjs(date);
|
|
109
|
+
var cal1FirstDay = cal1.startOf('month');
|
|
110
|
+
var cal1LastDay = cal1.endOf('month');
|
|
111
|
+
// Check if the first and last day of the month are at the start or end of the week
|
|
112
|
+
// If so, we don't apply the gradient, as it will overflow to the previous or next month
|
|
113
|
+
// Eg: https://github.com/razorpay/blade/assets/35374649/025b8ed9-90b4-49b6-a307-a746ae5b910f
|
|
114
|
+
var cal1IsFirstDayStartOfTheWeek = cal1FirstDay.day() === 0;
|
|
115
|
+
var cal1IsLastDayEndOfTheWeek = cal1LastDay.day() === 6;
|
|
116
|
+
|
|
117
|
+
// Do the same for the second calendar
|
|
118
|
+
var cal2 = dayjs(date).add(1, 'month');
|
|
119
|
+
var cal2FirstDay = cal2.startOf('month');
|
|
120
|
+
var cal2LastDay = cal2.endOf('month');
|
|
121
|
+
var cal2IsFirstDayStartOfTheWeek = cal2FirstDay.day() === 0;
|
|
122
|
+
var cal2IsLastDayEndOfTheWeek = cal2LastDay.day() === 6;
|
|
123
|
+
var calendar1FirstGradient = "".concat(cal1.month(), "-").concat(cal1FirstDay.date());
|
|
124
|
+
var calendar1LastGradient = "".concat(cal1.month(), "-").concat(cal1LastDay.date());
|
|
125
|
+
var calendar2FirstGradient = "".concat(cal2.month(), "-").concat(cal2FirstDay.date());
|
|
126
|
+
var calendar2LastGradient = "".concat(cal2.month(), "-").concat(cal2LastDay.date());
|
|
127
|
+
var gradientBefore = {
|
|
128
|
+
content: '""',
|
|
129
|
+
position: 'absolute',
|
|
130
|
+
width: '100%',
|
|
131
|
+
top: 0,
|
|
132
|
+
bottom: 0,
|
|
133
|
+
right: 0,
|
|
134
|
+
pointerEvents: 'none'
|
|
135
|
+
};
|
|
136
|
+
var rightGradient = _objectSpread(_objectSpread({}, gradientBefore), {}, {
|
|
137
|
+
left: '-100%',
|
|
138
|
+
background: "linear-gradient(to right, transparent, ".concat(getIn(theme.colors, inRangeCell.background["default"]), ")")
|
|
139
|
+
});
|
|
140
|
+
var leftGradient = _objectSpread(_objectSpread({}, gradientBefore), {}, {
|
|
141
|
+
left: '100%',
|
|
142
|
+
background: "linear-gradient(to left, transparent, ".concat(getIn(theme.colors, inRangeCell.background["default"]), ")")
|
|
143
|
+
});
|
|
144
|
+
return _defineProperty({}, ".".concat(classes.dayCell), _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "&[data-in-range]:not(&[data-first-in-range])[data-date=\"".concat(calendar1FirstGradient, "\"]"), {
|
|
145
|
+
'&:before': cal1IsFirstDayStartOfTheWeek ? {} : rightGradient
|
|
146
|
+
}), "&[data-in-range]:not(&[data-last-in-range])[data-date=\"".concat(calendar1LastGradient, "\"]"), {
|
|
147
|
+
'&:before': cal1IsLastDayEndOfTheWeek ? {} : leftGradient
|
|
148
|
+
}), "&[data-in-range]:not(&[data-first-in-range])[data-date=\"".concat(calendar2FirstGradient, "\"]"), {
|
|
149
|
+
'&:before': cal2IsFirstDayStartOfTheWeek ? {} : rightGradient
|
|
150
|
+
}), "&[data-in-range]:not(&[data-last-in-range])[data-date=\"".concat(calendar2LastGradient, "\"]"), {
|
|
151
|
+
'&:before': cal2IsLastDayEndOfTheWeek ? {} : leftGradient
|
|
152
|
+
}));
|
|
153
|
+
});
|
|
154
|
+
var CalendarStyles = /*#__PURE__*/styled(BaseBox).withConfig({
|
|
155
|
+
displayName: "CalendarStylesweb__CalendarStyles",
|
|
156
|
+
componentId: "xxlq7y-1"
|
|
157
|
+
})(function (_ref3) {
|
|
158
|
+
var theme = _ref3.theme,
|
|
159
|
+
pickerType = _ref3.pickerType;
|
|
160
|
+
var isMobile = useIsMobile();
|
|
161
|
+
var device = isMobile ? 'mobile' : 'desktop';
|
|
162
|
+
var isDayPicker = pickerType === 'day';
|
|
163
|
+
var today = {
|
|
164
|
+
'&[data-today]': {
|
|
165
|
+
position: 'relative',
|
|
166
|
+
':before': {
|
|
167
|
+
content: '""',
|
|
168
|
+
position: 'absolute',
|
|
169
|
+
left: '50%',
|
|
170
|
+
bottom: makeSpace(size[5]),
|
|
171
|
+
transform: 'translate(-50%, -50%)',
|
|
172
|
+
backgroundColor: getIn(theme.colors, todayCell.text["default"]),
|
|
173
|
+
width: makeSpace(theme.spacing[2]),
|
|
174
|
+
height: makeSpace(theme.spacing[2]),
|
|
175
|
+
borderRadius: theme.border.radius.max
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
'&[data-today]:hover': {
|
|
179
|
+
backgroundColor: getIn(theme.colors, todayCell.background.hover),
|
|
180
|
+
outlineColor: getIn(theme.colors, todayCell.border.hover),
|
|
181
|
+
color: getIn(theme.colors, todayCell.text.hover)
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
var selected = {
|
|
185
|
+
'&[data-selected]': {
|
|
186
|
+
'&[data-celltype="day"]': {
|
|
187
|
+
backgroundColor: getIn(theme.colors, selectedCell.day.background["default"]),
|
|
188
|
+
outlineColor: getIn(theme.colors, selectedCell.day.border["default"]),
|
|
189
|
+
color: getIn(theme.colors, selectedCell.day.text["default"]),
|
|
190
|
+
':hover': {
|
|
191
|
+
backgroundColor: getIn(theme.colors, selectedCell.day.background.hover),
|
|
192
|
+
color: getIn(theme.colors, selectedCell.day.text.hover)
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
'&[data-celltype="month"], &[data-celltype="year"]': {
|
|
196
|
+
backgroundColor: 'transparent',
|
|
197
|
+
outlineStyle: 'solid',
|
|
198
|
+
outlineWidth: makeBorderSize(theme.border.width.thin),
|
|
199
|
+
outlineOffset: makeSpace(-theme.border.width.thin),
|
|
200
|
+
outlineColor: getIn(theme.colors, selectedCell.month.border["default"]),
|
|
201
|
+
color: getIn(theme.colors, selectedCell.month.text["default"]),
|
|
202
|
+
':hover': {
|
|
203
|
+
backgroundColor: getIn(theme.colors, selectedCell.month.background.hover)
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
':before': {
|
|
207
|
+
backgroundColor: getIn(theme.colors, selectedCell.day.text["default"])
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
var ranges = {
|
|
212
|
+
'&[data-in-range]': {
|
|
213
|
+
borderRadius: 0,
|
|
214
|
+
backgroundColor: getIn(theme.colors, inRangeCell.background["default"]),
|
|
215
|
+
outlineColor: getIn(theme.colors, inRangeCell.border["default"]),
|
|
216
|
+
color: getIn(theme.colors, inRangeCell.text["default"]),
|
|
217
|
+
position: 'relative'
|
|
218
|
+
},
|
|
219
|
+
'&[data-in-range]:hover': {
|
|
220
|
+
backgroundColor: getIn(theme.colors, inRangeCell.background.hover),
|
|
221
|
+
outlineColor: getIn(theme.colors, inRangeCell.border.hover),
|
|
222
|
+
color: getIn(theme.colors, inRangeCell.text.hover)
|
|
223
|
+
},
|
|
224
|
+
'&[data-first-in-range]': {
|
|
225
|
+
borderRadius: theme.border.radius.medium,
|
|
226
|
+
borderTopRightRadius: 0,
|
|
227
|
+
borderBottomRightRadius: 0
|
|
228
|
+
},
|
|
229
|
+
'&[data-last-in-range]': {
|
|
230
|
+
borderRadius: theme.border.radius.medium,
|
|
231
|
+
borderTopLeftRadius: 0,
|
|
232
|
+
borderBottomLeftRadius: 0
|
|
233
|
+
},
|
|
234
|
+
'&[data-first-in-range][data-last-in-range]': {
|
|
235
|
+
borderRadius: theme.border.radius.medium
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
239
|
+
width: '100%'
|
|
240
|
+
}, ".".concat(classes.levelsGroup), {
|
|
241
|
+
width: '100%',
|
|
242
|
+
display: 'flex',
|
|
243
|
+
justifyContent: 'space-between',
|
|
244
|
+
gap: makeSpace(theme.spacing[8]),
|
|
245
|
+
table: {
|
|
246
|
+
borderCollapse: 'collapse',
|
|
247
|
+
width: '100%'
|
|
248
|
+
},
|
|
249
|
+
'> div': {
|
|
250
|
+
width: isMobile || !isDayPicker ? '100%' : undefined
|
|
251
|
+
},
|
|
252
|
+
th: {
|
|
253
|
+
flex: 1
|
|
254
|
+
},
|
|
255
|
+
td: {
|
|
256
|
+
flex: 1,
|
|
257
|
+
padding: '0px',
|
|
258
|
+
paddingBottom: makeSpace(cell.gap.y)
|
|
259
|
+
}
|
|
260
|
+
}), ".".concat(classes.row), {
|
|
261
|
+
textAlign: 'center',
|
|
262
|
+
display: isDayPicker ? 'flex' : 'grid',
|
|
263
|
+
gridTemplateColumns: 'repeat(3, 1fr)'
|
|
264
|
+
}), ".".concat(classes.calendarHeader), {
|
|
265
|
+
display: 'none'
|
|
266
|
+
}), ".".concat(classes.weekday), _objectSpread(_objectSpread({}, getTextStyles({
|
|
267
|
+
theme: theme,
|
|
268
|
+
variant: 'body',
|
|
269
|
+
size: 'small',
|
|
270
|
+
weight: 'medium',
|
|
271
|
+
color: 'surface.text.gray.muted'
|
|
272
|
+
})), {}, {
|
|
273
|
+
paddingBottom: makeSpace(theme.spacing[4])
|
|
274
|
+
})), ".".concat(classes.dayCell), _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
275
|
+
cursor: 'pointer',
|
|
276
|
+
width: isMobile || !isDayPicker ? '100%' : makeSpace(cell.size[device]),
|
|
277
|
+
height: isDayPicker && isMobile ? undefined : makeSpace(cell.size[device]),
|
|
278
|
+
aspectRatio: isDayPicker && isMobile ? '1 / 1' : undefined,
|
|
279
|
+
borderRadius: theme.border.radius.medium,
|
|
280
|
+
backgroundColor: getIn(theme.colors, cell.background["default"]),
|
|
281
|
+
border: 'none'
|
|
282
|
+
}, getTextStyles({
|
|
283
|
+
theme: theme,
|
|
284
|
+
variant: 'body',
|
|
285
|
+
size: 'medium',
|
|
286
|
+
weight: 'regular'
|
|
287
|
+
})), {}, {
|
|
288
|
+
'&:hover': {
|
|
289
|
+
backgroundColor: getIn(theme.colors, cell.background.hover)
|
|
290
|
+
},
|
|
291
|
+
'&:focus-visible': getFocusRingStyles({
|
|
292
|
+
theme: theme,
|
|
293
|
+
isImportant: true
|
|
294
|
+
}),
|
|
295
|
+
'&[data-disabled]': {
|
|
296
|
+
color: getIn(theme.colors, cell.text.disabled),
|
|
297
|
+
backgroundColor: getIn(theme.colors, cell.background.disabled),
|
|
298
|
+
cursor: 'not-allowed'
|
|
299
|
+
},
|
|
300
|
+
'&[data-outside]': {
|
|
301
|
+
color: theme.colors.interactive.text.gray.muted
|
|
302
|
+
},
|
|
303
|
+
'&[data-outside]:hover': {
|
|
304
|
+
color: getIn(theme.colors, cell.text["default"])
|
|
305
|
+
}
|
|
306
|
+
}, ranges), today), selected));
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
export { CalendarGradientStyles, CalendarStyles };
|
|
310
|
+
//# sourceMappingURL=CalendarStyles.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CalendarStyles.web.js","sources":["../../../../../../src/components/DatePicker/CalendarStyles.web.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/restrict-plus-operands */\nimport styled from 'styled-components';\nimport dayjs from 'dayjs';\nimport type { PickerType } from './types';\nimport { classes } from './constants';\nimport BaseBox from '~components/Box/BaseBox';\nimport getTextStyles from '~components/Typography/Text/getTextStyles';\nimport { size } from '~tokens/global';\nimport { makeBorderSize, makeSpace } from '~utils';\nimport getIn from '~utils/lodashButBetter/get';\nimport { useIsMobile } from '~utils/useIsMobile';\nimport { getFocusRingStyles } from '~utils/getFocusRingStyles';\n\nconst cell = {\n gap: {\n x: size[0],\n y: size[2],\n },\n size: {\n desktop: size[40],\n mobile: size[48],\n },\n background: {\n default: 'transparent',\n hover: 'interactive.background.gray.highlighted',\n disabled: 'transparent',\n },\n text: {\n default: 'interactive.text.gray.normal',\n disabled: 'interactive.text.gray.disabled',\n },\n} as const;\n\nconst todayCell = {\n background: {\n default: 'transparent',\n hover: 'interactive.background.primary.faded',\n },\n border: {\n default: 'interactive.border.primary.default',\n hover: 'interactive.border.primary.default',\n },\n text: {\n default: 'interactive.text.primary.normal',\n hover: 'interactive.text.primary.normal',\n },\n} as const;\n\nconst selectedCell = {\n day: {\n background: {\n default: 'interactive.background.primary.default',\n hover: 'interactive.background.primary.highlighted',\n },\n border: {\n default: 'interactive.border.primary.default',\n hover: 'interactive.border.primary.faded',\n },\n text: {\n default: 'interactive.text.onPrimary.normal',\n hover: 'interactive.text.onPrimary.normal',\n },\n },\n month: {\n background: {\n default: 'transparent',\n hover: 'interactive.background.primary.faded',\n },\n border: {\n default: 'interactive.border.primary.default',\n },\n text: {\n default: 'interactive.text.primary.normal',\n },\n },\n} as const;\n\nconst inRangeCell = {\n background: {\n default: 'surface.background.primary.subtle',\n hover: 'interactive.background.primary.faded',\n },\n border: {\n default: 'interactive.border.primary.default',\n hover: 'interactive.border.primary.default',\n },\n text: {\n default: 'interactive.text.primary.normal',\n hover: 'interactive.text.primary.normal',\n },\n} as const;\n\nconst CalendarGradientStyles = styled(BaseBox)<{ date: Date; isRange: boolean }>(\n ({ theme, date, isRange }) => {\n const isMobile = useIsMobile();\n // Bail out if datepicker is not in range mode or on mobile\n if (isMobile || !isRange) return {};\n\n // Calculate the first and last day of the month for both calendars in range mode\n // This is to apply the gradient to the first and last day of the month\n const cal1 = dayjs(date);\n const cal1FirstDay = cal1.startOf('month');\n const cal1LastDay = cal1.endOf('month');\n // Check if the first and last day of the month are at the start or end of the week\n // If so, we don't apply the gradient, as it will overflow to the previous or next month\n // Eg: https://github.com/razorpay/blade/assets/35374649/025b8ed9-90b4-49b6-a307-a746ae5b910f\n const cal1IsFirstDayStartOfTheWeek = cal1FirstDay.day() === 0;\n const cal1IsLastDayEndOfTheWeek = cal1LastDay.day() === 6;\n\n // Do the same for the second calendar\n const cal2 = dayjs(date).add(1, 'month');\n const cal2FirstDay = cal2.startOf('month');\n const cal2LastDay = cal2.endOf('month');\n const cal2IsFirstDayStartOfTheWeek = cal2FirstDay.day() === 0;\n const cal2IsLastDayEndOfTheWeek = cal2LastDay.day() === 6;\n\n const calendar1FirstGradient = `${cal1.month()}-${cal1FirstDay.date()}`;\n const calendar1LastGradient = `${cal1.month()}-${cal1LastDay.date()}`;\n const calendar2FirstGradient = `${cal2.month()}-${cal2FirstDay.date()}`;\n const calendar2LastGradient = `${cal2.month()}-${cal2LastDay.date()}`;\n\n const gradientBefore = {\n content: '\"\"',\n position: 'absolute',\n width: '100%',\n top: 0,\n bottom: 0,\n right: 0,\n pointerEvents: 'none',\n } as const;\n const rightGradient = {\n ...gradientBefore,\n left: '-100%',\n background: `linear-gradient(to right, transparent, ${getIn(\n theme.colors,\n inRangeCell.background.default,\n )})`,\n };\n const leftGradient = {\n ...gradientBefore,\n left: '100%',\n background: `linear-gradient(to left, transparent, ${getIn(\n theme.colors,\n inRangeCell.background.default,\n )})`,\n };\n\n return {\n [`.${classes.dayCell}`]: {\n // First calendar column\n [`&[data-in-range]:not(&[data-first-in-range])[data-date=\"${calendar1FirstGradient}\"]`]: {\n '&:before': cal1IsFirstDayStartOfTheWeek ? {} : rightGradient,\n },\n [`&[data-in-range]:not(&[data-last-in-range])[data-date=\"${calendar1LastGradient}\"]`]: {\n '&:before': cal1IsLastDayEndOfTheWeek ? {} : leftGradient,\n },\n // Second calendar column\n [`&[data-in-range]:not(&[data-first-in-range])[data-date=\"${calendar2FirstGradient}\"]`]: {\n '&:before': cal2IsFirstDayStartOfTheWeek ? {} : rightGradient,\n },\n [`&[data-in-range]:not(&[data-last-in-range])[data-date=\"${calendar2LastGradient}\"]`]: {\n '&:before': cal2IsLastDayEndOfTheWeek ? {} : leftGradient,\n },\n },\n };\n },\n);\n\nconst CalendarStyles = styled(BaseBox)<{ pickerType?: PickerType }>(({ theme, pickerType }) => {\n const isMobile = useIsMobile();\n const device = isMobile ? 'mobile' : 'desktop';\n const isDayPicker = pickerType === 'day';\n\n const today = {\n '&[data-today]': {\n position: 'relative',\n ':before': {\n content: '\"\"',\n position: 'absolute',\n left: '50%',\n bottom: makeSpace(size[5]),\n transform: 'translate(-50%, -50%)',\n backgroundColor: getIn(theme.colors, todayCell.text.default),\n width: makeSpace(theme.spacing[2]),\n height: makeSpace(theme.spacing[2]),\n borderRadius: theme.border.radius.max,\n },\n },\n '&[data-today]:hover': {\n backgroundColor: getIn(theme.colors, todayCell.background.hover),\n outlineColor: getIn(theme.colors, todayCell.border.hover),\n color: getIn(theme.colors, todayCell.text.hover),\n },\n } as const;\n\n const selected = {\n '&[data-selected]': {\n '&[data-celltype=\"day\"]': {\n backgroundColor: getIn(theme.colors, selectedCell.day.background.default),\n outlineColor: getIn(theme.colors, selectedCell.day.border.default),\n color: getIn(theme.colors, selectedCell.day.text.default),\n ':hover': {\n backgroundColor: getIn(theme.colors, selectedCell.day.background.hover),\n color: getIn(theme.colors, selectedCell.day.text.hover),\n },\n },\n '&[data-celltype=\"month\"], &[data-celltype=\"year\"]': {\n backgroundColor: 'transparent',\n outlineStyle: 'solid',\n outlineWidth: makeBorderSize(theme.border.width.thin),\n outlineOffset: makeSpace(-theme.border.width.thin),\n outlineColor: getIn(theme.colors, selectedCell.month.border.default),\n color: getIn(theme.colors, selectedCell.month.text.default),\n ':hover': {\n backgroundColor: getIn(theme.colors, selectedCell.month.background.hover),\n },\n },\n ':before': {\n backgroundColor: getIn(theme.colors, selectedCell.day.text.default),\n },\n },\n } as const;\n\n const ranges = {\n '&[data-in-range]': {\n borderRadius: 0,\n backgroundColor: getIn(theme.colors, inRangeCell.background.default),\n outlineColor: getIn(theme.colors, inRangeCell.border.default),\n color: getIn(theme.colors, inRangeCell.text.default),\n position: 'relative',\n },\n '&[data-in-range]:hover': {\n backgroundColor: getIn(theme.colors, inRangeCell.background.hover),\n outlineColor: getIn(theme.colors, inRangeCell.border.hover),\n color: getIn(theme.colors, inRangeCell.text.hover),\n },\n '&[data-first-in-range]': {\n borderRadius: theme.border.radius.medium,\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n },\n '&[data-last-in-range]': {\n borderRadius: theme.border.radius.medium,\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n },\n '&[data-first-in-range][data-last-in-range]': {\n borderRadius: theme.border.radius.medium,\n },\n } as const;\n\n return {\n width: '100%',\n [`.${classes.levelsGroup}`]: {\n width: '100%',\n display: 'flex',\n justifyContent: 'space-between',\n gap: makeSpace(theme.spacing[8]),\n table: {\n borderCollapse: 'collapse',\n width: '100%',\n },\n '> div': { width: isMobile || !isDayPicker ? '100%' : undefined },\n th: {\n flex: 1,\n },\n td: {\n flex: 1,\n padding: '0px',\n paddingBottom: makeSpace(cell.gap.y),\n },\n },\n [`.${classes.row}`]: {\n textAlign: 'center',\n display: isDayPicker ? 'flex' : 'grid',\n gridTemplateColumns: 'repeat(3, 1fr)',\n },\n [`.${classes.calendarHeader}`]: {\n display: 'none',\n },\n [`.${classes.weekday}`]: {\n ...getTextStyles({\n theme,\n variant: 'body',\n size: 'small',\n weight: 'medium',\n color: 'surface.text.gray.muted',\n }),\n paddingBottom: makeSpace(theme.spacing[4]),\n },\n [`.${classes.dayCell}`]: {\n cursor: 'pointer',\n width: isMobile || !isDayPicker ? '100%' : makeSpace(cell.size[device]),\n height: isDayPicker && isMobile ? undefined : makeSpace(cell.size[device]),\n aspectRatio: isDayPicker && isMobile ? '1 / 1' : undefined,\n borderRadius: theme.border.radius.medium,\n backgroundColor: getIn(theme.colors, cell.background.default),\n border: 'none',\n ...getTextStyles({ theme, variant: 'body', size: 'medium', weight: 'regular' }),\n\n '&:hover': {\n backgroundColor: getIn(theme.colors, cell.background.hover),\n },\n '&:focus-visible': getFocusRingStyles({ theme, isImportant: true }),\n '&[data-disabled]': {\n color: getIn(theme.colors, cell.text.disabled),\n backgroundColor: getIn(theme.colors, cell.background.disabled),\n cursor: 'not-allowed',\n },\n '&[data-outside]': {\n color: theme.colors.interactive.text.gray.muted,\n },\n '&[data-outside]:hover': {\n color: getIn(theme.colors, cell.text.default),\n },\n ...ranges,\n ...today,\n ...selected,\n },\n };\n});\n\nexport { CalendarStyles, CalendarGradientStyles };\n"],"names":["cell","gap","x","size","y","desktop","mobile","background","hover","disabled","text","todayCell","border","selectedCell","day","month","inRangeCell","CalendarGradientStyles","styled","BaseBox","withConfig","displayName","componentId","_ref","theme","date","isRange","isMobile","useIsMobile","cal1","dayjs","cal1FirstDay","startOf","cal1LastDay","endOf","cal1IsFirstDayStartOfTheWeek","cal1IsLastDayEndOfTheWeek","cal2","add","cal2FirstDay","cal2LastDay","cal2IsFirstDayStartOfTheWeek","cal2IsLastDayEndOfTheWeek","calendar1FirstGradient","concat","calendar1LastGradient","calendar2FirstGradient","calendar2LastGradient","gradientBefore","content","position","width","top","bottom","right","pointerEvents","rightGradient","_objectSpread","left","getIn","colors","leftGradient","_defineProperty","classes","dayCell","CalendarStyles","_ref3","pickerType","device","isDayPicker","today","makeSpace","transform","backgroundColor","spacing","height","borderRadius","radius","max","outlineColor","color","selected","outlineStyle","outlineWidth","makeBorderSize","thin","outlineOffset","ranges","medium","borderTopRightRadius","borderBottomRightRadius","borderTopLeftRadius","borderBottomLeftRadius","levelsGroup","display","justifyContent","table","borderCollapse","undefined","th","flex","td","padding","paddingBottom","row","textAlign","gridTemplateColumns","calendarHeader","weekday","getTextStyles","variant","weight","cursor","aspectRatio","getFocusRingStyles","isImportant","interactive","gray","muted"],"mappings":";;;;;;;;;;;;;;;;;;;AAaA,IAAMA,IAAI,GAAG;AACXC,EAAAA,GAAG,EAAE;AACHC,IAAAA,CAAC,EAAEC,IAAI,CAAC,CAAC,CAAC;IACVC,CAAC,EAAED,IAAI,CAAC,CAAC,CAAA;GACV;AACDA,EAAAA,IAAI,EAAE;AACJE,IAAAA,OAAO,EAAEF,IAAI,CAAC,EAAE,CAAC;IACjBG,MAAM,EAAEH,IAAI,CAAC,EAAE,CAAA;GAChB;AACDI,EAAAA,UAAU,EAAE;AACV,IAAA,SAAA,EAAS,aAAa;AACtBC,IAAAA,KAAK,EAAE,yCAAyC;AAChDC,IAAAA,QAAQ,EAAE,aAAA;GACX;AACDC,EAAAA,IAAI,EAAE;AACJ,IAAA,SAAA,EAAS,8BAA8B;AACvCD,IAAAA,QAAQ,EAAE,gCAAA;AACZ,GAAA;AACF,CAAU,CAA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