@popsure/dirty-swan 0.63.2 → 0.64.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/dist/cjs/index.js +7762 -1991
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/lib/components/dateSelector/components/Calendar.d.ts +0 -2
- package/dist/esm/Calendar-C7I0F5Gv.js +8032 -0
- package/dist/esm/Calendar-C7I0F5Gv.js.map +1 -0
- package/dist/esm/components/dateSelector/components/Calendar.js +2 -3
- package/dist/esm/components/dateSelector/components/Calendar.js.map +1 -1
- package/dist/esm/components/dateSelector/index.js +1 -2
- package/dist/esm/components/dateSelector/index.js.map +1 -1
- package/dist/esm/components/dateSelector/index.stories.js +1 -2
- package/dist/esm/components/dateSelector/index.stories.js.map +1 -1
- package/dist/esm/components/dateSelector/index.test.js +4 -5
- package/dist/esm/components/dateSelector/index.test.js.map +1 -1
- package/dist/esm/index.js +2 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/components/dateSelector/components/Calendar.d.ts +0 -2
- package/dist/esm/util/images/index.stories.js +1 -2
- package/dist/esm/util/images/index.stories.js.map +1 -1
- package/package.json +2 -3
- package/src/lib/components/dateSelector/components/Calendar.tsx +22 -42
- package/src/lib/components/dateSelector/components/datepicker.module.scss +167 -325
- package/src/lib/components/dateSelector/index.test.tsx +2 -2
- package/dist/cjs/lib/components/dateSelector/components/CalendarCaption.d.ts +0 -13
- package/dist/esm/Calendar-OjEwgyw8.js +0 -2191
- package/dist/esm/Calendar-OjEwgyw8.js.map +0 -1
- package/dist/esm/CalendarCaption-Bs7RbqJC.js +0 -77
- package/dist/esm/CalendarCaption-Bs7RbqJC.js.map +0 -1
- package/dist/esm/components/dateSelector/components/CalendarCaption.js +0 -7
- package/dist/esm/components/dateSelector/components/CalendarCaption.js.map +0 -1
- package/dist/esm/lib/components/dateSelector/components/CalendarCaption.d.ts +0 -13
- package/src/lib/components/dateSelector/components/CalendarCaption.tsx +0 -175
- package/src/lib/components/dateSelector/components/calendarCaption.module.scss +0 -168
- package/src/lib/components/dateSelector/components/datepicker.scss +0 -356
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import { useRef, useState } from 'react';
|
|
2
2
|
import dayjs from 'dayjs';
|
|
3
|
-
import DayPicker from 'react-day-picker';
|
|
3
|
+
import { DayPicker } from 'react-day-picker';
|
|
4
|
+
import rdpStyles from 'react-day-picker/style.module.css';
|
|
4
5
|
|
|
5
6
|
import { useOnClickOutside } from '../../../hooks/useOnClickOutside';
|
|
6
7
|
import { CalendarIcon } from '../../icon/icons';
|
|
7
|
-
import { CalendarCaption } from './CalendarCaption';
|
|
8
8
|
|
|
9
9
|
import styles from './style.module.scss';
|
|
10
|
-
|
|
11
|
-
// (most styles are imported by the vendor), while datepicker.scss is needed for Storybook.
|
|
12
|
-
import './datepicker.module.scss';
|
|
13
|
-
import './datepicker.scss';
|
|
10
|
+
import datepickerStyles from './datepicker.module.scss';
|
|
14
11
|
import { Button } from '../../button';
|
|
15
12
|
|
|
16
13
|
export interface CalendarProps {
|
|
@@ -42,9 +39,8 @@ export const Calendar = ({
|
|
|
42
39
|
? dayjs().locale(dayjsLocale).localeData()
|
|
43
40
|
: dayjs().locale('en').localeData();
|
|
44
41
|
|
|
45
|
-
const localizedWeekdays = localeDate.weekdays();
|
|
46
|
-
const localizedWeekdaysShort = localeDate.weekdaysMin();
|
|
47
42
|
const localizedMonths = localeDate.months();
|
|
43
|
+
const localizedWeekdaysShort = localeDate.weekdaysMin();
|
|
48
44
|
|
|
49
45
|
const calendarContainerRef = useRef<HTMLDivElement | null>(null);
|
|
50
46
|
const [displayedMonth, setDisplayedMonth] = useState<Date | undefined>(undefined);
|
|
@@ -65,20 +61,6 @@ export const Calendar = ({
|
|
|
65
61
|
.endOf('year')
|
|
66
62
|
.toDate();
|
|
67
63
|
|
|
68
|
-
const currentMonth = displayedMonth ?? selectedDateInDateType ?? calendarDefaultDate;
|
|
69
|
-
|
|
70
|
-
const handlePrevMonth = () => {
|
|
71
|
-
const prev = new Date(currentMonth);
|
|
72
|
-
prev.setMonth(prev.getMonth() - 1);
|
|
73
|
-
setDisplayedMonth(prev);
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
const handleNextMonth = () => {
|
|
77
|
-
const next = new Date(currentMonth);
|
|
78
|
-
next.setMonth(next.getMonth() + 1);
|
|
79
|
-
setDisplayedMonth(next);
|
|
80
|
-
};
|
|
81
|
-
|
|
82
64
|
useOnClickOutside(calendarContainerRef, () => setCalendarOpen(false));
|
|
83
65
|
|
|
84
66
|
if (!displayCalendar) {
|
|
@@ -103,10 +85,13 @@ export const Calendar = ({
|
|
|
103
85
|
{isOpen && (
|
|
104
86
|
<DayPicker
|
|
105
87
|
month={displayedMonth ?? selectedDateInDateType ?? calendarDefaultDate}
|
|
88
|
+
mode="single"
|
|
106
89
|
showOutsideDays={true}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
90
|
+
captionLayout="dropdown"
|
|
91
|
+
navLayout="around"
|
|
92
|
+
startMonth={dateCalendarFromMonth}
|
|
93
|
+
endMonth={dateCalendarToMonth}
|
|
94
|
+
selected={selectedDateInDateType}
|
|
110
95
|
onDayClick={(date: Date) => {
|
|
111
96
|
if (!dayjs(date).isValid()) {
|
|
112
97
|
return;
|
|
@@ -121,28 +106,23 @@ export const Calendar = ({
|
|
|
121
106
|
setCalendarOpen(false);
|
|
122
107
|
}
|
|
123
108
|
}}
|
|
124
|
-
navbarElement={() => null}
|
|
125
109
|
onMonthChange={(month: Date) => setDisplayedMonth(month)}
|
|
126
|
-
captionElement={({ date }: { date: Date }) => (
|
|
127
|
-
<CalendarCaption
|
|
128
|
-
date={date}
|
|
129
|
-
months={localizedMonths}
|
|
130
|
-
yearBoundaries={yearBoundaries}
|
|
131
|
-
onMonthChange={(newDate) => setDisplayedMonth(newDate)}
|
|
132
|
-
onPrevClick={handlePrevMonth}
|
|
133
|
-
onNextClick={handleNextMonth}
|
|
134
|
-
/>
|
|
135
|
-
)}
|
|
136
110
|
pagedNavigation={true}
|
|
137
|
-
|
|
111
|
+
disabled={{
|
|
138
112
|
before: dateCalendarFromMonth,
|
|
139
113
|
after: dateCalendarToMonth,
|
|
140
114
|
}}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
115
|
+
weekStartsOn={firstDayOfWeek as 0 | 1 | 2 | 3 | 4 | 5 | 6}
|
|
116
|
+
formatters={{
|
|
117
|
+
formatWeekdayName: (_date) => {
|
|
118
|
+
const dayIndex = _date.getDay();
|
|
119
|
+
return localizedWeekdaysShort[dayIndex]?.charAt(0) ?? '';
|
|
120
|
+
},
|
|
121
|
+
formatMonthDropdown: (date) => {
|
|
122
|
+
return localizedMonths[date.getMonth()];
|
|
123
|
+
},
|
|
124
|
+
}}
|
|
125
|
+
classNames={{ ...rdpStyles, ...datepickerStyles }}
|
|
146
126
|
/>
|
|
147
127
|
)}
|
|
148
128
|
</div>
|
|
@@ -1,357 +1,199 @@
|
|
|
1
1
|
@use '../../../scss/public/grid' as *;
|
|
2
2
|
@use '../../../scss/public/colors' as *;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
3
|
+
@use '../../../scss/public/font-weight' as *;
|
|
4
|
+
@use '../../../scss/public/shadows' as *;
|
|
5
|
+
|
|
6
|
+
.root {
|
|
7
|
+
--rdp-accent-color: #{$ds-neutral-600};
|
|
8
|
+
--rdp-accent-background-color: #{$ds-orange-500};
|
|
9
|
+
--rdp-day-height: 44px;
|
|
10
|
+
--rdp-day-width: 44px;
|
|
11
|
+
--rdp-day_button-height: 42px;
|
|
12
|
+
--rdp-day_button-width: 42px;
|
|
13
|
+
--rdp-day_button-border-radius: 50%;
|
|
14
|
+
--rdp-day_button-border: 2px solid transparent;
|
|
15
|
+
--rdp-selected-border: 2px solid #{$ds-orange-500};
|
|
16
|
+
--rdp-selected-background: #{$ds-orange-500};
|
|
17
|
+
--rdp-outside-opacity: 1;
|
|
18
|
+
--rdp-today-color: #{$ds-neutral-900};
|
|
19
|
+
--rdp-dropdown-gap: 8px;
|
|
20
|
+
--rdp-nav_button-disabled-opacity: 0.5;
|
|
21
|
+
--rdp-nav_button-height: 2.75rem;
|
|
22
|
+
--rdp-nav_button-width: 2.75rem;
|
|
23
|
+
|
|
24
|
+
position: absolute;
|
|
25
|
+
left: 40px;
|
|
26
|
+
top: -112px;
|
|
27
|
+
z-index: 100;
|
|
28
|
+
background-color: $ds-white;
|
|
29
|
+
box-shadow: $bs-md;
|
|
30
|
+
border-radius: 16px;
|
|
31
|
+
color: $ds-neutral-900;
|
|
32
|
+
font-size: 16px;
|
|
33
|
+
padding: 16px 24px 24px 24px;
|
|
34
|
+
|
|
35
|
+
@include p-size-mobile {
|
|
36
|
+
position: fixed;
|
|
34
37
|
top: 50%;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
border-right: 9px solid transparent;
|
|
38
|
-
border-top: 12px solid $ds-neutral-600;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.DayPickerInput:hover::before {
|
|
42
|
-
border-top: 12px solid $ds-neutral-800;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.DayPickerInput:hover {
|
|
46
|
-
border-color: $ds-neutral-800;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.DayPicker {
|
|
50
|
-
position: absolute;
|
|
51
|
-
left: -9px;
|
|
52
|
-
top: 8px;
|
|
53
|
-
z-index: 100;
|
|
54
|
-
border-radius: 4px;
|
|
55
|
-
box-shadow: 0 1px 4px 1px rgba(0, 0, 0, 0.08);
|
|
56
|
-
background-color: white;
|
|
57
|
-
display: inline-block;
|
|
58
|
-
font-size: 1rem;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.DayPicker-wrapper {
|
|
62
|
-
position: relative;
|
|
63
|
-
|
|
64
|
-
flex-direction: row;
|
|
65
|
-
padding-bottom: 1em;
|
|
66
|
-
|
|
67
|
-
user-select: none;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.DayPicker-Months {
|
|
71
|
-
display: flex;
|
|
72
|
-
flex-wrap: wrap;
|
|
73
|
-
justify-content: center;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.DayPicker-Month {
|
|
77
|
-
display: table;
|
|
78
|
-
margin: 0 1em;
|
|
79
|
-
margin-top: 1em;
|
|
80
|
-
border-spacing: 0;
|
|
81
|
-
border-collapse: collapse;
|
|
82
|
-
|
|
83
|
-
user-select: none;
|
|
84
|
-
|
|
85
|
-
font: 16px;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.DayPicker-NavButton {
|
|
89
|
-
position: absolute;
|
|
90
|
-
top: 1em;
|
|
91
|
-
right: 1.5em;
|
|
92
|
-
left: auto;
|
|
93
|
-
display: inline-block;
|
|
94
|
-
margin-top: 2px;
|
|
95
|
-
width: 1.25em;
|
|
96
|
-
height: 1.25em;
|
|
97
|
-
background-position: center;
|
|
98
|
-
background-size: 50%;
|
|
99
|
-
background-repeat: no-repeat;
|
|
100
|
-
color: #8b9898;
|
|
101
|
-
cursor: pointer;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.DayPicker-NavButton:hover {
|
|
105
|
-
opacity: 0.8;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.DayPicker-NavButton--prev {
|
|
109
|
-
margin-right: 1.5em;
|
|
110
|
-
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAwCAYAAAB5R9gVAAAABGdBTUEAALGPC/xhBQAAAVVJREFUWAnN2G0KgjAYwPHpGfRkaZeqvgQaK+hY3SUHrk1YzNLay/OiEFp92I+/Mp2F2Mh2lLISWnflFjzH263RQjzMZ19wgs73ez0o1WmtW+dgA01VxrE3p6l2GLsnBy1VYQOtVSEH/atCCgqpQgKKqYIOiq2CBkqtggLKqQIKgqgCBjpJ2Y5CdJ+zrT9A7HHSTA1dxUdHgzCqJIEwq0SDsKsEg6iqBIEoq/wEcVRZBXFV+QJxV5mBtlDFB5VjYTaGZ2sf4R9PM7U9ZU+lLuaetPP/5Die3ToO1+u+MKtHs06qODB2zBnI/jBd4MPQm1VkY79Tb18gB+C62FdBFsZR6yeIo1YQiLJWMIiqVjQIu1YSCLNWFgijVjYIuhYYCKoWKAiiFgoopxYaKLUWOii2FgkophYp6F3r42W5A9s9OcgNvva8xQaysKXlFytoqdYmQH6tF3toSUo0INq9AAAAAElFTkSuQmCC');
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.DayPicker-NavButton--next {
|
|
114
|
-
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAwCAYAAAB5R9gVAAAABGdBTUEAALGPC/xhBQAAAXRJREFUWAnN119ugjAcwPHWzJ1gnmxzB/BBE0n24m4xfNkTaOL7wOtsl3AXMMb+Vjaa1BG00N8fSEibPpAP3xAKKs2yjzTPH9RAjhEo9WzPr/Vm8zgE0+gXATAxxuxtqeJ9t5tIwv5AtQAApsfT6TPdbp+kUBcgVwvO51KqVhMkXKsVJFXrOkigVhCIs1Y4iKlWZxB1rX4gwlpRIIpa8SDkWmggrFq4IIRaJKCYWnSgnrXIQV1r8YD+1Vrn+bReagysIFfLABRt31v8oBu1xEBttfRbltmfjgEcWh9snUS2kNdBK6WN1vrOWxObWsz+fjxevsxmB1GQDfINWiev83nhaoiB/CoOU438oPrhXS0WpQ9xc1ZQWxWHqUYe0I0qrKCQKjygDlXIQV2r0IF6ViEBxVTBBSFUQQNhVYkHIVeJAtkNsbQ7c1LtzP6FsObhb2rCKv7NBIGoq4SDmKoEgTirXAcJVGkFSVVpgoSrXICGUMUH/QBZNSUy5XWUhwAAAABJRU5ErkJggg==');
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.DayPicker-NavButton--interactionDisabled {
|
|
118
|
-
visibility: hidden;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.DayPicker-Caption {
|
|
122
|
-
display: table-caption;
|
|
123
|
-
margin-bottom: 0.5em;
|
|
124
|
-
padding: 0 0.5em;
|
|
125
|
-
text-align: left;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
.DayPicker-Caption > div {
|
|
129
|
-
font-weight: 500;
|
|
130
|
-
font-size: 1.15em;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.DayPicker-Weekdays {
|
|
134
|
-
display: table-header-group;
|
|
135
|
-
margin-top: 1em;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
.DayPicker-WeekdaysRow {
|
|
139
|
-
display: table-row;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
.DayPicker-Weekday {
|
|
143
|
-
display: table-cell;
|
|
144
|
-
padding: 0.5em;
|
|
145
|
-
color: #8b9898;
|
|
146
|
-
text-align: center;
|
|
147
|
-
font-size: 0.875em;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
.DayPicker-Weekday abbr[title] {
|
|
151
|
-
border-bottom: none;
|
|
152
|
-
text-decoration: none;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
.DayPicker-Body {
|
|
156
|
-
display: table-row-group;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
.DayPicker-Week {
|
|
160
|
-
display: table-row;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
.DayPicker-Day {
|
|
164
|
-
min-width: 40px;
|
|
165
|
-
height: 40px;
|
|
38
|
+
left: 50%;
|
|
39
|
+
transform: translate(-50%, -50%);
|
|
166
40
|
}
|
|
41
|
+
}
|
|
167
42
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
min-width: 1em;
|
|
172
|
-
border-right: 1px solid #eaecec;
|
|
173
|
-
color: #8b9898;
|
|
174
|
-
vertical-align: middle;
|
|
175
|
-
text-align: right;
|
|
176
|
-
font-size: 0.75em;
|
|
177
|
-
cursor: pointer;
|
|
178
|
-
}
|
|
43
|
+
.month {
|
|
44
|
+
position: relative;
|
|
45
|
+
}
|
|
179
46
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
47
|
+
.month_caption {
|
|
48
|
+
display: flex;
|
|
49
|
+
align-content: center;
|
|
50
|
+
justify-content: center;
|
|
51
|
+
height: var(--rdp-nav-height);
|
|
52
|
+
margin-top: 6px;
|
|
53
|
+
margin-bottom: 24px;
|
|
54
|
+
margin-inline-start: var(--rdp-nav_button-width);
|
|
55
|
+
margin-inline-end: var(--rdp-nav_button-width);
|
|
56
|
+
position: relative;
|
|
57
|
+
}
|
|
183
58
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
59
|
+
.weekday {
|
|
60
|
+
padding: 8px 0;
|
|
61
|
+
font-weight: $p-font-weight-normal;
|
|
62
|
+
text-align: center;
|
|
63
|
+
color: $ds-neutral-600;
|
|
64
|
+
font-size: 16px;
|
|
65
|
+
}
|
|
187
66
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
font-size: 0.875em;
|
|
195
|
-
cursor: pointer;
|
|
196
|
-
}
|
|
67
|
+
.dropdowns {
|
|
68
|
+
position: relative;
|
|
69
|
+
display: inline-flex;
|
|
70
|
+
align-items: center;
|
|
71
|
+
gap: var(--rdp-dropdown-gap);
|
|
72
|
+
}
|
|
197
73
|
|
|
198
|
-
|
|
199
|
-
|
|
74
|
+
.day_button {
|
|
75
|
+
background: none;
|
|
76
|
+
padding: 0;
|
|
77
|
+
margin: 0;
|
|
78
|
+
cursor: pointer;
|
|
79
|
+
font-weight: $p-font-weight-normal;
|
|
80
|
+
font-size: 16px;
|
|
81
|
+
color: inherit;
|
|
82
|
+
display: flex;
|
|
83
|
+
justify-content: center;
|
|
84
|
+
align-items: center;
|
|
85
|
+
width: var(--rdp-day_button-width);
|
|
86
|
+
height: var(--rdp-day_button-height);
|
|
87
|
+
border: var(--rdp-day_button-border);
|
|
88
|
+
border-radius: var(--rdp-day_button-border-radius);
|
|
89
|
+
|
|
90
|
+
&:hover {
|
|
91
|
+
background-color: $ds-transparent;
|
|
92
|
+
border-color: $ds-orange-600;
|
|
200
93
|
}
|
|
94
|
+
}
|
|
201
95
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
96
|
+
.outside {
|
|
97
|
+
color: $ds-neutral-400;
|
|
98
|
+
}
|
|
205
99
|
|
|
206
|
-
|
|
207
|
-
|
|
100
|
+
.disabled {
|
|
101
|
+
color: $ds-neutral-400;
|
|
102
|
+
pointer-events: none;
|
|
103
|
+
}
|
|
208
104
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
105
|
+
.selected {
|
|
106
|
+
font-size: unset;
|
|
107
|
+
font-weight: unset;
|
|
212
108
|
|
|
213
|
-
.
|
|
109
|
+
.day_button {
|
|
110
|
+
border: var(--rdp-selected-border);
|
|
214
111
|
background-color: $ds-orange-500;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
.DayPicker:not(.DayPicker--interactionDisabled)
|
|
218
|
-
.DayPicker-Day:not(.DayPicker-Day--disabled):not(.DayPicker-Day--selected):not(.DayPicker-Day--outside):hover {
|
|
219
|
-
background-color: white;
|
|
220
|
-
outline: 2px solid $ds-orange-600;
|
|
221
|
-
outline-offset: -2px;
|
|
222
|
-
border-radius: 50%;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
.DayPickerInput {
|
|
226
|
-
display: inline-block;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
.DayPickerInput-OverlayWrapper {
|
|
230
|
-
position: relative;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
.DayPickerInput-Overlay {
|
|
234
|
-
position: absolute;
|
|
235
|
-
left: 0;
|
|
236
|
-
z-index: 1;
|
|
237
|
-
|
|
238
|
-
background: white;
|
|
239
|
-
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
.DayPicker {
|
|
243
|
-
position: absolute;
|
|
244
|
-
left: 40px;
|
|
245
|
-
top: -112px;
|
|
246
|
-
z-index: 100;
|
|
247
|
-
background-color: white;
|
|
248
|
-
box-shadow: 0px 0px 32px rgba(210, 210, 216, 0.25);
|
|
249
|
-
border-radius: 16px;
|
|
250
|
-
display: inline-block;
|
|
251
112
|
color: $ds-neutral-900;
|
|
252
|
-
|
|
253
|
-
@include p-size-mobile {
|
|
254
|
-
position: fixed;
|
|
255
|
-
top: 0;
|
|
256
|
-
left: 0;
|
|
257
|
-
right: 0;
|
|
258
|
-
bottom: 0;
|
|
259
|
-
margin: auto;
|
|
260
|
-
width: fit-content;
|
|
261
|
-
height: fit-content;
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
.DayPicker-wrapper {
|
|
266
|
-
padding: 0 16px 24px 16px;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
.DayPicker-NavBar {
|
|
270
|
-
display: none;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
.DayPicker-Months {
|
|
274
|
-
display: flex;
|
|
275
|
-
flex-wrap: wrap;
|
|
276
|
-
justify-content: center;
|
|
277
|
-
margin-top: 14px;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
.DayPicker-Month {
|
|
281
|
-
display: block;
|
|
282
|
-
margin: 0;
|
|
283
|
-
user-select: none;
|
|
284
|
-
font: 16px;
|
|
285
|
-
width: 308px;
|
|
286
113
|
}
|
|
114
|
+
}
|
|
287
115
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
116
|
+
.button_previous,
|
|
117
|
+
.button_next {
|
|
118
|
+
position: absolute;
|
|
119
|
+
top: 4px;
|
|
120
|
+
}
|
|
293
121
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
width: 100%;
|
|
298
|
-
border-spacing: 0;
|
|
299
|
-
border-collapse: collapse;
|
|
300
|
-
}
|
|
122
|
+
.button_previous {
|
|
123
|
+
inset-inline-start: 0;
|
|
124
|
+
}
|
|
301
125
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
126
|
+
.button_next {
|
|
127
|
+
inset-inline-end: 0;
|
|
128
|
+
}
|
|
305
129
|
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
130
|
+
.button_previous,
|
|
131
|
+
.button_next {
|
|
132
|
+
border: none;
|
|
133
|
+
background: none;
|
|
134
|
+
padding: 0;
|
|
135
|
+
margin: 0;
|
|
136
|
+
cursor: pointer;
|
|
137
|
+
display: inline-flex;
|
|
138
|
+
justify-content: center;
|
|
139
|
+
align-items: center;
|
|
140
|
+
width: 40px;
|
|
141
|
+
height: 40px;
|
|
142
|
+
border-radius: 50%;
|
|
313
143
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
text-decoration: none;
|
|
144
|
+
&:hover {
|
|
145
|
+
background-color: $ds-neutral-100;
|
|
317
146
|
}
|
|
318
147
|
|
|
319
|
-
|
|
320
|
-
|
|
148
|
+
&:disabled,
|
|
149
|
+
&[aria-disabled='true'] {
|
|
150
|
+
cursor: revert;
|
|
151
|
+
opacity: var(--rdp-nav_button-disabled-opacity);
|
|
321
152
|
}
|
|
322
153
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
padding: 0;
|
|
328
|
-
border-radius: 50%;
|
|
329
|
-
vertical-align: middle;
|
|
330
|
-
text-align: center;
|
|
331
|
-
cursor: pointer;
|
|
332
|
-
|
|
333
|
-
font: normal 16px Lato;
|
|
154
|
+
svg {
|
|
155
|
+
width: 20px;
|
|
156
|
+
height: 20px;
|
|
157
|
+
fill: $ds-neutral-800;
|
|
334
158
|
}
|
|
159
|
+
}
|
|
335
160
|
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
161
|
+
.chevron {
|
|
162
|
+
display: inline-block;
|
|
163
|
+
fill: $ds-neutral-500;
|
|
164
|
+
}
|
|
339
165
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
166
|
+
.dropdown_root {
|
|
167
|
+
position: relative;
|
|
168
|
+
display: inline-flex;
|
|
169
|
+
align-items: center;
|
|
170
|
+
border: 1px solid $ds-neutral-300;
|
|
171
|
+
border-radius: 8px;
|
|
172
|
+
padding: 8px 12px;
|
|
173
|
+
}
|
|
343
174
|
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
175
|
+
.dropdown {
|
|
176
|
+
z-index: 2;
|
|
177
|
+
opacity: 0;
|
|
178
|
+
appearance: none;
|
|
179
|
+
position: absolute;
|
|
180
|
+
inset-inline-start: 0;
|
|
181
|
+
inset-block-start: 0;
|
|
182
|
+
width: 100%;
|
|
183
|
+
height: 100%;
|
|
184
|
+
cursor: pointer;
|
|
185
|
+
line-height: inherit;
|
|
186
|
+
font-weight: 500;
|
|
187
|
+
font-size: inherit;
|
|
188
|
+
color: $ds-neutral-900;
|
|
189
|
+
}
|
|
351
190
|
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
191
|
+
.caption_label {
|
|
192
|
+
z-index: 1;
|
|
193
|
+
position: relative;
|
|
194
|
+
display: inline-flex;
|
|
195
|
+
align-items: center;
|
|
196
|
+
white-space: nowrap;
|
|
197
|
+
border: 0;
|
|
198
|
+
font-weight: $p-font-weight-bold;
|
|
357
199
|
}
|
|
@@ -150,7 +150,7 @@ describe('DateSelector component', () => {
|
|
|
150
150
|
|
|
151
151
|
await user.click(button);
|
|
152
152
|
|
|
153
|
-
const calendarCell = getByLabelText(/17
|
|
153
|
+
const calendarCell = getByLabelText(/January 17/);
|
|
154
154
|
|
|
155
155
|
await user.click(calendarCell);
|
|
156
156
|
|
|
@@ -167,7 +167,7 @@ describe('DateSelector component', () => {
|
|
|
167
167
|
|
|
168
168
|
await user.click(button);
|
|
169
169
|
|
|
170
|
-
const calendarCell = getByLabelText(/17
|
|
170
|
+
const calendarCell = getByLabelText(/January 17/);
|
|
171
171
|
expect(calendarCell).toBeVisible();
|
|
172
172
|
|
|
173
173
|
// click outside the calendar
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
interface CalendarCaptionProps {
|
|
2
|
-
date: Date;
|
|
3
|
-
months: string[];
|
|
4
|
-
yearBoundaries: {
|
|
5
|
-
min: number;
|
|
6
|
-
max: number;
|
|
7
|
-
};
|
|
8
|
-
onMonthChange: (date: Date) => void;
|
|
9
|
-
onPrevClick: () => void;
|
|
10
|
-
onNextClick: () => void;
|
|
11
|
-
}
|
|
12
|
-
export declare const CalendarCaption: ({ date, months, yearBoundaries, onMonthChange, onPrevClick, onNextClick, }: CalendarCaptionProps) => JSX.Element;
|
|
13
|
-
export {};
|