@cloudscape-design/components 3.0.523 → 3.0.525
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/app-layout/defaults.d.ts +2 -2
- package/app-layout/defaults.d.ts.map +1 -1
- package/app-layout/defaults.js.map +1 -1
- package/app-layout/drawer/interfaces.d.ts +2 -3
- package/app-layout/drawer/interfaces.d.ts.map +1 -1
- package/app-layout/drawer/interfaces.js.map +1 -1
- package/app-layout/drawer/resizable-drawer.d.ts +1 -1
- package/app-layout/drawer/resizable-drawer.d.ts.map +1 -1
- package/app-layout/drawer/resizable-drawer.js +9 -18
- package/app-layout/drawer/resizable-drawer.js.map +1 -1
- package/app-layout/index.d.ts.map +1 -1
- package/app-layout/index.js +26 -78
- package/app-layout/index.js.map +1 -1
- package/app-layout/split-panel/constants.d.ts +3 -0
- package/app-layout/split-panel/constants.d.ts.map +1 -0
- package/app-layout/split-panel/constants.js +5 -0
- package/app-layout/split-panel/constants.js.map +1 -0
- package/app-layout/split-panel/index.d.ts +1 -0
- package/app-layout/split-panel/index.d.ts.map +1 -1
- package/app-layout/split-panel/index.js +1 -0
- package/app-layout/split-panel/index.js.map +1 -1
- package/app-layout/split-panel/provider.d.ts +2 -2
- package/app-layout/split-panel/provider.d.ts.map +1 -1
- package/app-layout/split-panel/provider.js +18 -16
- package/app-layout/split-panel/provider.js.map +1 -1
- package/app-layout/utils/use-app-layout-rect.d.ts +8 -0
- package/app-layout/utils/use-app-layout-rect.d.ts.map +1 -0
- package/app-layout/utils/{use-content-width.js → use-app-layout-rect.js} +6 -5
- package/app-layout/utils/use-app-layout-rect.js.map +1 -0
- package/app-layout/visual-refresh/split-panel.js +1 -1
- package/app-layout/visual-refresh/split-panel.js.map +1 -1
- package/button-dropdown/styles.css.js +15 -15
- package/button-dropdown/styles.scoped.css +23 -23
- package/button-dropdown/styles.selectors.js +15 -15
- package/calendar/grid/index.d.ts +3 -3
- package/calendar/grid/index.js +10 -10
- package/calendar/grid/index.js.map +1 -1
- package/calendar/header/header-button.js +2 -2
- package/calendar/header/header-button.js.map +1 -1
- package/calendar/styles.css.js +18 -18
- package/calendar/styles.scoped.css +40 -40
- package/calendar/styles.selectors.js +18 -18
- package/date-range-picker/calendar/grids/styles.css.js +25 -25
- package/date-range-picker/calendar/grids/styles.scoped.css +44 -44
- package/date-range-picker/calendar/grids/styles.selectors.js +25 -25
- package/internal/base-component/styles.scoped.css +10 -15
- package/internal/environment.js +1 -1
- package/internal/environment.json +1 -1
- package/internal/generated/theming/index.cjs +30 -61
- package/internal/generated/theming/index.js +30 -61
- package/internal/manifest.json +1 -1
- package/package.json +1 -1
- package/test-utils/dom/calendar/index.js +4 -4
- package/test-utils/dom/calendar/index.js.map +1 -1
- package/test-utils/selectors/calendar/index.js +4 -4
- package/test-utils/selectors/calendar/index.js.map +1 -1
- package/test-utils/tsconfig.tsbuildinfo +1 -1
- package/app-layout/utils/use-content-width.d.ts +0 -5
- package/app-layout/utils/use-content-width.d.ts.map +0 -1
- package/app-layout/utils/use-content-width.js.map +0 -1
- package/app-layout/utils/use-window-width.d.ts +0 -2
- package/app-layout/utils/use-window-width.d.ts.map +0 -1
- package/app-layout/utils/use-window-width.js +0 -13
- package/app-layout/utils/use-window-width.js.map +0 -1
|
@@ -90,60 +90,60 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
90
90
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
91
91
|
SPDX-License-Identifier: Apache-2.0
|
|
92
92
|
*/
|
|
93
|
-
.awsui_button-
|
|
93
|
+
.awsui_button-dropdown_sne0l_nfcqc_93:not(#\9) {
|
|
94
94
|
display: inline-block;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
.awsui_items-list-
|
|
97
|
+
.awsui_items-list-container_sne0l_nfcqc_97:not(#\9) {
|
|
98
98
|
padding-block: 0;
|
|
99
99
|
padding-inline: 0;
|
|
100
100
|
margin-block: 0;
|
|
101
101
|
margin-inline: 0;
|
|
102
|
-
animation: awsui_awsui-motion-fade-in-
|
|
102
|
+
animation: awsui_awsui-motion-fade-in-0_sne0l_nfcqc_1 500ms var(--motion-easing-show-quick-vc5zgd, ease-out);
|
|
103
103
|
animation-fill-mode: none;
|
|
104
104
|
}
|
|
105
105
|
@media (prefers-reduced-motion: reduce) {
|
|
106
|
-
.awsui_items-list-
|
|
106
|
+
.awsui_items-list-container_sne0l_nfcqc_97:not(#\9) {
|
|
107
107
|
animation: none;
|
|
108
108
|
transition: none;
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
|
-
.awsui-motion-disabled .awsui_items-list-
|
|
111
|
+
.awsui-motion-disabled .awsui_items-list-container_sne0l_nfcqc_97:not(#\9), .awsui-mode-entering .awsui_items-list-container_sne0l_nfcqc_97:not(#\9) {
|
|
112
112
|
animation: none;
|
|
113
113
|
transition: none;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
.awsui_rotate-
|
|
116
|
+
.awsui_rotate-up_sne0l_nfcqc_116:not(#\9) {
|
|
117
117
|
transform: rotate(-180deg);
|
|
118
118
|
transition: transform var(--motion-duration-rotate-180-dpvl4m, 135ms) var(--motion-easing-rotate-180-e270ko, cubic-bezier(0.165, 0.84, 0.44, 1));
|
|
119
119
|
}
|
|
120
120
|
@media (prefers-reduced-motion: reduce) {
|
|
121
|
-
.awsui_rotate-
|
|
121
|
+
.awsui_rotate-up_sne0l_nfcqc_116:not(#\9) {
|
|
122
122
|
animation: none;
|
|
123
123
|
transition: none;
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
|
-
.awsui-motion-disabled .awsui_rotate-
|
|
126
|
+
.awsui-motion-disabled .awsui_rotate-up_sne0l_nfcqc_116:not(#\9), .awsui-mode-entering .awsui_rotate-up_sne0l_nfcqc_116:not(#\9) {
|
|
127
127
|
animation: none;
|
|
128
128
|
transition: none;
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
-
.awsui_rotate-
|
|
131
|
+
.awsui_rotate-down_sne0l_nfcqc_131:not(#\9) {
|
|
132
132
|
transform: rotate(0deg);
|
|
133
133
|
transition: transform var(--motion-duration-rotate-180-dpvl4m, 135ms) var(--motion-easing-rotate-180-e270ko, cubic-bezier(0.165, 0.84, 0.44, 1));
|
|
134
134
|
}
|
|
135
135
|
@media (prefers-reduced-motion: reduce) {
|
|
136
|
-
.awsui_rotate-
|
|
136
|
+
.awsui_rotate-down_sne0l_nfcqc_131:not(#\9) {
|
|
137
137
|
animation: none;
|
|
138
138
|
transition: none;
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
|
-
.awsui-motion-disabled .awsui_rotate-
|
|
141
|
+
.awsui-motion-disabled .awsui_rotate-down_sne0l_nfcqc_131:not(#\9), .awsui-mode-entering .awsui_rotate-down_sne0l_nfcqc_131:not(#\9) {
|
|
142
142
|
animation: none;
|
|
143
143
|
transition: none;
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
-
.
|
|
146
|
+
.awsui_header_sne0l_nfcqc_146:not(#\9) {
|
|
147
147
|
display: flex;
|
|
148
148
|
flex-direction: column;
|
|
149
149
|
list-style: none;
|
|
@@ -154,40 +154,40 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
154
154
|
border-inline: var(--border-field-width-09w7vk, 2px) solid transparent;
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
-
.
|
|
158
|
-
.
|
|
159
|
-
color: var(--color-text-
|
|
157
|
+
.awsui_title_sne0l_nfcqc_157:not(#\9),
|
|
158
|
+
.awsui_description_sne0l_nfcqc_158:not(#\9) {
|
|
159
|
+
color: var(--color-text-top-navigation-title-v7rgbf, #000716);
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
-
.awsui_split-trigger-
|
|
162
|
+
.awsui_split-trigger-wrapper_sne0l_nfcqc_162:not(#\9) {
|
|
163
163
|
display: flex;
|
|
164
164
|
}
|
|
165
|
-
.awsui_split-trigger-
|
|
165
|
+
.awsui_split-trigger-wrapper_sne0l_nfcqc_162 > .awsui_trigger-item_sne0l_nfcqc_165 > button:not(#\9):focus {
|
|
166
166
|
z-index: 1;
|
|
167
167
|
}
|
|
168
|
-
.awsui_split-trigger-
|
|
168
|
+
.awsui_split-trigger-wrapper_sne0l_nfcqc_162 > .awsui_trigger-item_sne0l_nfcqc_165:not(#\9):not(:last-child) > .awsui_trigger-button_sne0l_nfcqc_168 {
|
|
169
169
|
border-start-end-radius: 0;
|
|
170
170
|
border-end-end-radius: 0;
|
|
171
171
|
padding-inline-end: var(--space-m-udix3p, 16px);
|
|
172
172
|
margin-inline-end: var(--space-xxxs-zbmxqb, 2px);
|
|
173
173
|
}
|
|
174
|
-
.awsui_split-trigger-
|
|
174
|
+
.awsui_split-trigger-wrapper_sne0l_nfcqc_162 > .awsui_trigger-item_sne0l_nfcqc_165:not(#\9):not(:first-child) > .awsui_trigger-button_sne0l_nfcqc_168 {
|
|
175
175
|
border-start-start-radius: 0;
|
|
176
176
|
border-end-start-radius: 0;
|
|
177
177
|
padding-inline: calc(var(--space-xs-zb16t3, 8px) - 2px);
|
|
178
178
|
}
|
|
179
|
-
.awsui_split-trigger-
|
|
179
|
+
.awsui_split-trigger-wrapper_sne0l_nfcqc_162 > .awsui_trigger-item_sne0l_nfcqc_165:not(#\9):not(:first-child).awsui_visual-refresh_sne0l_nfcqc_179 > .awsui_trigger-button_sne0l_nfcqc_168 {
|
|
180
180
|
padding-inline-end: calc(var(--space-s-34lx8l, 12px) - 2px);
|
|
181
181
|
}
|
|
182
182
|
|
|
183
|
-
.awsui_split-
|
|
183
|
+
.awsui_split-trigger_sne0l_nfcqc_162:not(#\9) {
|
|
184
184
|
display: contents;
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
-
.awsui_dropdown-
|
|
187
|
+
.awsui_dropdown-trigger_sne0l_nfcqc_187:not(#\9) {
|
|
188
188
|
display: contents;
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
-
.awsui_test-utils-button-
|
|
191
|
+
.awsui_test-utils-button-trigger_sne0l_nfcqc_191:not(#\9) {
|
|
192
192
|
/* used in test-utils */
|
|
193
193
|
}
|
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"button-dropdown": "awsui_button-
|
|
6
|
-
"items-list-container": "awsui_items-list-
|
|
7
|
-
"awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-
|
|
8
|
-
"rotate-up": "awsui_rotate-
|
|
9
|
-
"rotate-down": "awsui_rotate-
|
|
10
|
-
"header": "
|
|
11
|
-
"title": "
|
|
12
|
-
"description": "
|
|
13
|
-
"split-trigger-wrapper": "awsui_split-trigger-
|
|
14
|
-
"trigger-item": "awsui_trigger-
|
|
15
|
-
"trigger-button": "awsui_trigger-
|
|
16
|
-
"visual-refresh": "awsui_visual-
|
|
17
|
-
"split-trigger": "awsui_split-
|
|
18
|
-
"dropdown-trigger": "awsui_dropdown-
|
|
19
|
-
"test-utils-button-trigger": "awsui_test-utils-button-
|
|
5
|
+
"button-dropdown": "awsui_button-dropdown_sne0l_nfcqc_93",
|
|
6
|
+
"items-list-container": "awsui_items-list-container_sne0l_nfcqc_97",
|
|
7
|
+
"awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_sne0l_nfcqc_1",
|
|
8
|
+
"rotate-up": "awsui_rotate-up_sne0l_nfcqc_116",
|
|
9
|
+
"rotate-down": "awsui_rotate-down_sne0l_nfcqc_131",
|
|
10
|
+
"header": "awsui_header_sne0l_nfcqc_146",
|
|
11
|
+
"title": "awsui_title_sne0l_nfcqc_157",
|
|
12
|
+
"description": "awsui_description_sne0l_nfcqc_158",
|
|
13
|
+
"split-trigger-wrapper": "awsui_split-trigger-wrapper_sne0l_nfcqc_162",
|
|
14
|
+
"trigger-item": "awsui_trigger-item_sne0l_nfcqc_165",
|
|
15
|
+
"trigger-button": "awsui_trigger-button_sne0l_nfcqc_168",
|
|
16
|
+
"visual-refresh": "awsui_visual-refresh_sne0l_nfcqc_179",
|
|
17
|
+
"split-trigger": "awsui_split-trigger_sne0l_nfcqc_162",
|
|
18
|
+
"dropdown-trigger": "awsui_dropdown-trigger_sne0l_nfcqc_187",
|
|
19
|
+
"test-utils-button-trigger": "awsui_test-utils-button-trigger_sne0l_nfcqc_191"
|
|
20
20
|
};
|
|
21
21
|
|
package/calendar/grid/index.d.ts
CHANGED
|
@@ -10,10 +10,10 @@ import { DatePickerProps } from '../../date-picker/interfaces';
|
|
|
10
10
|
* - (table navigation) Chrome+VO - weekday is announced twice when navigating to the calendar's header;
|
|
11
11
|
* - (table navigation) Safari+VO - "dimmed" state is announced twice;
|
|
12
12
|
* - (table navigation) Firefox/Chrome+NVDA - cannot use table navigation if any cell has a focus;
|
|
13
|
-
* - (keyboard navigation) Firefox+NVDA - every
|
|
13
|
+
* - (keyboard navigation) Firefox+NVDA - every date is announced as "not selected";
|
|
14
14
|
* - (keyboard navigation) Safari/Chrome+VO - weekdays are not announced;
|
|
15
|
-
* - (keyboard navigation) Safari/Chrome+VO -
|
|
16
|
-
* - (keyboard navigation) Safari/Chrome+VO -
|
|
15
|
+
* - (keyboard navigation) Safari/Chrome+VO - dates are not announced as interactive (clickable or selectable);
|
|
16
|
+
* - (keyboard navigation) Safari/Chrome+VO - date announcements are not interruptive and can be missed if navigating fast.
|
|
17
17
|
*/
|
|
18
18
|
export interface GridProps {
|
|
19
19
|
locale: string;
|
package/calendar/grid/index.js
CHANGED
|
@@ -51,7 +51,7 @@ export default function Grid({ locale, baseDate, isDateEnabled, focusedDate, foc
|
|
|
51
51
|
onFocusDate(updatedFocusDate);
|
|
52
52
|
};
|
|
53
53
|
// The focused date changes as a feedback to keyboard navigation in the grid.
|
|
54
|
-
// Once changed, the corresponding
|
|
54
|
+
// Once changed, the corresponding date button needs to receive the actual focus.
|
|
55
55
|
useEffectOnUpdate(() => {
|
|
56
56
|
if (focusedDate && focusedDateRef.current) {
|
|
57
57
|
focusedDateRef.current.focus();
|
|
@@ -61,10 +61,10 @@ export default function Grid({ locale, baseDate, isDateEnabled, focusedDate, foc
|
|
|
61
61
|
const weekdays = weeks[0].map(date => date.getDay());
|
|
62
62
|
return (React.createElement("table", { role: "grid", className: styles['calendar-grid'], "aria-labelledby": ariaLabelledby },
|
|
63
63
|
React.createElement("thead", null,
|
|
64
|
-
React.createElement("tr", null, weekdays.map(dayIndex => (React.createElement("th", { key: dayIndex, scope: "col", className: clsx(styles['calendar-grid-cell'], styles['calendar-
|
|
64
|
+
React.createElement("tr", null, weekdays.map(dayIndex => (React.createElement("th", { key: dayIndex, scope: "col", className: clsx(styles['calendar-grid-cell'], styles['calendar-date-header']) },
|
|
65
65
|
React.createElement("span", { "aria-hidden": "true" }, renderDayName(locale, dayIndex, 'short')),
|
|
66
66
|
React.createElement(ScreenreaderOnly, null, renderDayName(locale, dayIndex, 'long'))))))),
|
|
67
|
-
React.createElement("tbody", { onKeyDown: onGridKeyDownHandler }, weeks.map((week, weekIndex) => (React.createElement("tr", { key: weekIndex, className: styles['calendar-
|
|
67
|
+
React.createElement("tbody", { onKeyDown: onGridKeyDownHandler }, weeks.map((week, weekIndex) => (React.createElement("tr", { key: weekIndex, className: styles['calendar-row'] }, week.map((date, dateIndex) => {
|
|
68
68
|
const isFocusable = !!focusableDate && isSameDay(date, focusableDate);
|
|
69
69
|
const isSelected = !!selectedDate && isSameDay(date, selectedDate);
|
|
70
70
|
const isEnabled = !isDateEnabled || isDateEnabled(date);
|
|
@@ -79,20 +79,20 @@ export default function Grid({ locale, baseDate, isDateEnabled, focusedDate, foc
|
|
|
79
79
|
// Can be focused programmatically.
|
|
80
80
|
tabIndex = -1;
|
|
81
81
|
}
|
|
82
|
-
// Screen-reader announcement for the focused
|
|
82
|
+
// Screen-reader announcement for the focused date.
|
|
83
83
|
let dayAnnouncement = getDateLabel(locale, date, 'short');
|
|
84
84
|
if (isDateOnSameDay && todayAriaLabel) {
|
|
85
85
|
dayAnnouncement += '. ' + todayAriaLabel;
|
|
86
86
|
}
|
|
87
87
|
return (React.createElement("td", { key: `${weekIndex}:${dateIndex}`, ref: tabIndex === 0 ? focusedDateRef : undefined, tabIndex: tabIndex, "aria-current": isDateOnSameDay ? 'date' : undefined, "aria-selected": isEnabled ? isSelected : undefined, "aria-disabled": !isEnabled,
|
|
88
88
|
// Do not attach click event when the date is disabled, otherwise VO+safari announces clickable
|
|
89
|
-
onClick: isEnabled ? () => onSelectDate(date) : undefined, className: clsx(styles['calendar-grid-cell'], styles['calendar-
|
|
90
|
-
[styles['calendar-
|
|
91
|
-
[styles['calendar-
|
|
92
|
-
[styles['calendar-
|
|
93
|
-
[styles['calendar-
|
|
89
|
+
onClick: isEnabled ? () => onSelectDate(date) : undefined, className: clsx(styles['calendar-grid-cell'], styles['calendar-date'], {
|
|
90
|
+
[styles['calendar-date-current-page']]: isSameMonth(date, baseDate),
|
|
91
|
+
[styles['calendar-date-enabled']]: isEnabled,
|
|
92
|
+
[styles['calendar-date-selected']]: isSelected,
|
|
93
|
+
[styles['calendar-date-current']]: isDateOnSameDay,
|
|
94
94
|
}) },
|
|
95
|
-
React.createElement("span", { className: styles['
|
|
95
|
+
React.createElement("span", { className: styles['date-inner'], "aria-hidden": "true" }, date.getDate()),
|
|
96
96
|
React.createElement(ScreenreaderOnly, null, dayAnnouncement)));
|
|
97
97
|
})))))));
|
|
98
98
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["calendar/grid/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,M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BACrC,eAAe,IAAI,IAAI,GAAG,cAAc,CAAC;aAC1C;YAED,OAAO,CACL,4BACE,GAAG,EAAE,GAAG,SAAS,IAAI,SAAS,EAAE,EAChC,GAAG,EAAE,QAAQ,KAAK,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,EAChD,QAAQ,EAAE,QAAQ,kBACJ,eAAe,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,mBACnC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,mBAClC,CAAC,SAAS;gBACzB,+FAA+F;gBAC/F,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,EACzD,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAC,cAAc,CAAC,EAAE;oBACpE,CAAC,MAAM,CAAC,4BAA4B,CAAC,CAAC,EAAE,WAAW,CAAC,IAAI,EAAE,QAAQ,CAAC;oBACnE,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC,EAAE,SAAS;oBAC3C,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC,EAAE,UAAU;oBAC7C,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC,EAAE,eAAe;iBAChD,CAAC;gBAEF,8BAAM,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,iBAAc,MAAM,IACrD,IAAI,CAAC,OAAO,EAAE,CACV;gBACP,oBAAC,gBAAgB,QAAE,eAAe,CAAoB,CACnD,CACN,CAAC;QACJ,CAAC,CAAC,CACC,CACN,CAAC,CACI,CACF,CACT,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useMemo, useRef } from 'react';\nimport styles from '../styles.css.js';\nimport { KeyCode } from '../../internal/keycode';\nimport { isSameDay, isSameMonth } from 'date-fns';\nimport { getCalendarMonth } from 'mnth';\nimport { DayIndex } from '../internal';\nimport { DatePickerProps } from '../../date-picker/interfaces';\nimport { getDateLabel, renderDayName } from '../utils/intl';\nimport clsx from 'clsx';\nimport { useEffectOnUpdate } from '../../internal/hooks/use-effect-on-update.js';\nimport ScreenreaderOnly from '../../internal/components/screenreader-only/index.js';\nimport { moveNextDay, movePrevDay, moveNextWeek, movePrevWeek } from '../utils/navigation';\n\n/**\n * Calendar grid supports two mechanisms of keyboard navigation:\n * - Native screen-reader table navigation (semantic table markup);\n * - Keyboard arrow-keys navigation (a custom key-down handler).\n *\n * The implementation largely follows the w3 example (https://www.w3.org/WAI/ARIA/apg/example-index/dialog-modal/datepicker-dialog) and shares the following issues:\n * - (table navigation) Chrome+VO - weekday is announced twice when navigating to the calendar's header;\n * - (table navigation) Safari+VO - \"dimmed\" state is announced twice;\n * - (table navigation) Firefox/Chrome+NVDA - cannot use table navigation if any cell has a focus;\n * - (keyboard navigation) Firefox+NVDA - every day is announced as \"not selected\";\n * - (keyboard navigation) Safari/Chrome+VO - weekdays are not announced;\n * - (keyboard navigation) Safari/Chrome+VO - days are not announced as interactive (clickable or selectable);\n * - (keyboard navigation) Safari/Chrome+VO - day announcements are not interruptive and can be missed if navigating fast.\n */\n\nexport interface GridProps {\n locale: string;\n baseDate: Date;\n isDateEnabled: DatePickerProps.IsDateEnabledFunction;\n focusedDate: Date | null;\n focusableDate: Date | null;\n onSelectDate: (date: Date) => void;\n onFocusDate: (date: null | Date) => void;\n onChangeMonth: (date: Date) => void;\n startOfWeek: DayIndex;\n todayAriaLabel?: string;\n selectedDate: Date | null;\n ariaLabelledby: string;\n}\n\nexport default function Grid({\n locale,\n baseDate,\n isDateEnabled,\n focusedDate,\n focusableDate,\n onSelectDate,\n onFocusDate,\n onChangeMonth,\n startOfWeek,\n todayAriaLabel,\n selectedDate,\n ariaLabelledby,\n}: GridProps) {\n const focusedDateRef = useRef<HTMLTableCellElement>(null);\n\n const onGridKeyDownHandler = (event: React.KeyboardEvent) => {\n let updatedFocusDate;\n\n if (focusableDate === null) {\n return;\n }\n\n switch (event.keyCode) {\n case KeyCode.space:\n case KeyCode.enter:\n event.preventDefault();\n if (focusableDate) {\n onFocusDate(null);\n onSelectDate(focusableDate);\n }\n return;\n case KeyCode.right:\n event.preventDefault();\n updatedFocusDate = moveNextDay(focusableDate, isDateEnabled);\n break;\n case KeyCode.left:\n event.preventDefault();\n updatedFocusDate = movePrevDay(focusableDate, isDateEnabled);\n break;\n case KeyCode.up:\n event.preventDefault();\n updatedFocusDate = movePrevWeek(focusableDate, isDateEnabled);\n break;\n case KeyCode.down:\n event.preventDefault();\n updatedFocusDate = moveNextWeek(focusableDate, isDateEnabled);\n break;\n default:\n return;\n }\n\n if (!isSameMonth(updatedFocusDate, baseDate)) {\n onChangeMonth(updatedFocusDate);\n }\n onFocusDate(updatedFocusDate);\n };\n\n // The focused date changes as a feedback to keyboard navigation in the grid.\n // Once changed, the corresponding day button needs to receive the actual focus.\n useEffectOnUpdate(() => {\n if (focusedDate && focusedDateRef.current) {\n (focusedDateRef.current as HTMLDivElement).focus();\n }\n }, [focusedDate]);\n\n const weeks = useMemo<Date[][]>(\n () => getCalendarMonth(baseDate, { firstDayOfWeek: startOfWeek }),\n [baseDate, startOfWeek]\n );\n const weekdays = weeks[0].map(date => date.getDay());\n\n return (\n <table role=\"grid\" className={styles['calendar-grid']} aria-labelledby={ariaLabelledby}>\n <thead>\n <tr>\n {weekdays.map(dayIndex => (\n <th\n key={dayIndex}\n scope=\"col\"\n className={clsx(styles['calendar-grid-cell'], styles['calendar-day-header'])}\n >\n <span aria-hidden=\"true\">{renderDayName(locale, dayIndex, 'short')}</span>\n <ScreenreaderOnly>{renderDayName(locale, dayIndex, 'long')}</ScreenreaderOnly>\n </th>\n ))}\n </tr>\n </thead>\n <tbody onKeyDown={onGridKeyDownHandler}>\n {weeks.map((week, weekIndex) => (\n <tr key={weekIndex} className={styles['calendar-week']}>\n {week.map((date, dateIndex) => {\n const isFocusable = !!focusableDate && isSameDay(date, focusableDate);\n const isSelected = !!selectedDate && isSameDay(date, selectedDate);\n const isEnabled = !isDateEnabled || isDateEnabled(date);\n const isDateOnSameDay = isSameDay(date, new Date());\n\n // Can't be focused.\n let tabIndex = undefined;\n if (isFocusable && isEnabled) {\n // Next focus target.\n tabIndex = 0;\n } else if (isEnabled) {\n // Can be focused programmatically.\n tabIndex = -1;\n }\n\n // Screen-reader announcement for the focused day.\n let dayAnnouncement = getDateLabel(locale, date, 'short');\n if (isDateOnSameDay && todayAriaLabel) {\n dayAnnouncement += '. ' + todayAriaLabel;\n }\n\n return (\n <td\n key={`${weekIndex}:${dateIndex}`}\n ref={tabIndex === 0 ? focusedDateRef : undefined}\n tabIndex={tabIndex}\n aria-current={isDateOnSameDay ? 'date' : undefined}\n aria-selected={isEnabled ? isSelected : undefined}\n aria-disabled={!isEnabled}\n // Do not attach click event when the date is disabled, otherwise VO+safari announces clickable\n onClick={isEnabled ? () => onSelectDate(date) : undefined}\n className={clsx(styles['calendar-grid-cell'], styles['calendar-day'], {\n [styles['calendar-day-current-month']]: isSameMonth(date, baseDate),\n [styles['calendar-day-enabled']]: isEnabled,\n [styles['calendar-day-selected']]: isSelected,\n [styles['calendar-day-today']]: isDateOnSameDay,\n })}\n >\n <span className={styles['day-inner']} aria-hidden=\"true\">\n {date.getDate()}\n </span>\n <ScreenreaderOnly>{dayAnnouncement}</ScreenreaderOnly>\n </td>\n );\n })}\n </tr>\n ))}\n </tbody>\n </table>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["calendar/grid/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,M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useMemo, useRef } from 'react';\nimport styles from '../styles.css.js';\nimport { KeyCode } from '../../internal/keycode';\nimport { isSameDay, isSameMonth } from 'date-fns';\nimport { getCalendarMonth } from 'mnth';\nimport { DayIndex } from '../internal';\nimport { DatePickerProps } from '../../date-picker/interfaces';\nimport { getDateLabel, renderDayName } from '../utils/intl';\nimport clsx from 'clsx';\nimport { useEffectOnUpdate } from '../../internal/hooks/use-effect-on-update.js';\nimport ScreenreaderOnly from '../../internal/components/screenreader-only/index.js';\nimport { moveNextDay, movePrevDay, moveNextWeek, movePrevWeek } from '../utils/navigation';\n\n/**\n * Calendar grid supports two mechanisms of keyboard navigation:\n * - Native screen-reader table navigation (semantic table markup);\n * - Keyboard arrow-keys navigation (a custom key-down handler).\n *\n * The implementation largely follows the w3 example (https://www.w3.org/WAI/ARIA/apg/example-index/dialog-modal/datepicker-dialog) and shares the following issues:\n * - (table navigation) Chrome+VO - weekday is announced twice when navigating to the calendar's header;\n * - (table navigation) Safari+VO - \"dimmed\" state is announced twice;\n * - (table navigation) Firefox/Chrome+NVDA - cannot use table navigation if any cell has a focus;\n * - (keyboard navigation) Firefox+NVDA - every date is announced as \"not selected\";\n * - (keyboard navigation) Safari/Chrome+VO - weekdays are not announced;\n * - (keyboard navigation) Safari/Chrome+VO - dates are not announced as interactive (clickable or selectable);\n * - (keyboard navigation) Safari/Chrome+VO - date announcements are not interruptive and can be missed if navigating fast.\n */\n\nexport interface GridProps {\n locale: string;\n baseDate: Date;\n isDateEnabled: DatePickerProps.IsDateEnabledFunction;\n focusedDate: Date | null;\n focusableDate: Date | null;\n onSelectDate: (date: Date) => void;\n onFocusDate: (date: null | Date) => void;\n onChangeMonth: (date: Date) => void;\n startOfWeek: DayIndex;\n todayAriaLabel?: string;\n selectedDate: Date | null;\n ariaLabelledby: string;\n}\n\nexport default function Grid({\n locale,\n baseDate,\n isDateEnabled,\n focusedDate,\n focusableDate,\n onSelectDate,\n onFocusDate,\n onChangeMonth,\n startOfWeek,\n todayAriaLabel,\n selectedDate,\n ariaLabelledby,\n}: GridProps) {\n const focusedDateRef = useRef<HTMLTableCellElement>(null);\n\n const onGridKeyDownHandler = (event: React.KeyboardEvent) => {\n let updatedFocusDate;\n\n if (focusableDate === null) {\n return;\n }\n\n switch (event.keyCode) {\n case KeyCode.space:\n case KeyCode.enter:\n event.preventDefault();\n if (focusableDate) {\n onFocusDate(null);\n onSelectDate(focusableDate);\n }\n return;\n case KeyCode.right:\n event.preventDefault();\n updatedFocusDate = moveNextDay(focusableDate, isDateEnabled);\n break;\n case KeyCode.left:\n event.preventDefault();\n updatedFocusDate = movePrevDay(focusableDate, isDateEnabled);\n break;\n case KeyCode.up:\n event.preventDefault();\n updatedFocusDate = movePrevWeek(focusableDate, isDateEnabled);\n break;\n case KeyCode.down:\n event.preventDefault();\n updatedFocusDate = moveNextWeek(focusableDate, isDateEnabled);\n break;\n default:\n return;\n }\n\n if (!isSameMonth(updatedFocusDate, baseDate)) {\n onChangeMonth(updatedFocusDate);\n }\n onFocusDate(updatedFocusDate);\n };\n\n // The focused date changes as a feedback to keyboard navigation in the grid.\n // Once changed, the corresponding date button needs to receive the actual focus.\n useEffectOnUpdate(() => {\n if (focusedDate && focusedDateRef.current) {\n (focusedDateRef.current as HTMLDivElement).focus();\n }\n }, [focusedDate]);\n\n const weeks = useMemo<Date[][]>(\n () => getCalendarMonth(baseDate, { firstDayOfWeek: startOfWeek }),\n [baseDate, startOfWeek]\n );\n const weekdays = weeks[0].map(date => date.getDay());\n\n return (\n <table role=\"grid\" className={styles['calendar-grid']} aria-labelledby={ariaLabelledby}>\n <thead>\n <tr>\n {weekdays.map(dayIndex => (\n <th\n key={dayIndex}\n scope=\"col\"\n className={clsx(styles['calendar-grid-cell'], styles['calendar-date-header'])}\n >\n <span aria-hidden=\"true\">{renderDayName(locale, dayIndex, 'short')}</span>\n <ScreenreaderOnly>{renderDayName(locale, dayIndex, 'long')}</ScreenreaderOnly>\n </th>\n ))}\n </tr>\n </thead>\n <tbody onKeyDown={onGridKeyDownHandler}>\n {weeks.map((week, weekIndex) => (\n <tr key={weekIndex} className={styles['calendar-row']}>\n {week.map((date, dateIndex) => {\n const isFocusable = !!focusableDate && isSameDay(date, focusableDate);\n const isSelected = !!selectedDate && isSameDay(date, selectedDate);\n const isEnabled = !isDateEnabled || isDateEnabled(date);\n const isDateOnSameDay = isSameDay(date, new Date());\n\n // Can't be focused.\n let tabIndex = undefined;\n if (isFocusable && isEnabled) {\n // Next focus target.\n tabIndex = 0;\n } else if (isEnabled) {\n // Can be focused programmatically.\n tabIndex = -1;\n }\n\n // Screen-reader announcement for the focused date.\n let dayAnnouncement = getDateLabel(locale, date, 'short');\n if (isDateOnSameDay && todayAriaLabel) {\n dayAnnouncement += '. ' + todayAriaLabel;\n }\n\n return (\n <td\n key={`${weekIndex}:${dateIndex}`}\n ref={tabIndex === 0 ? focusedDateRef : undefined}\n tabIndex={tabIndex}\n aria-current={isDateOnSameDay ? 'date' : undefined}\n aria-selected={isEnabled ? isSelected : undefined}\n aria-disabled={!isEnabled}\n // Do not attach click event when the date is disabled, otherwise VO+safari announces clickable\n onClick={isEnabled ? () => onSelectDate(date) : undefined}\n className={clsx(styles['calendar-grid-cell'], styles['calendar-date'], {\n [styles['calendar-date-current-page']]: isSameMonth(date, baseDate),\n [styles['calendar-date-enabled']]: isEnabled,\n [styles['calendar-date-selected']]: isSelected,\n [styles['calendar-date-current']]: isDateOnSameDay,\n })}\n >\n <span className={styles['date-inner']} aria-hidden=\"true\">\n {date.getDate()}\n </span>\n <ScreenreaderOnly>{dayAnnouncement}</ScreenreaderOnly>\n </td>\n );\n })}\n </tr>\n ))}\n </tbody>\n </table>\n );\n}\n"]}
|
|
@@ -5,9 +5,9 @@ import { InternalButton } from '../../button/internal';
|
|
|
5
5
|
import styles from '../styles.css.js';
|
|
6
6
|
import { addMonths } from 'date-fns';
|
|
7
7
|
export function PrevMonthButton({ ariaLabel, baseDate, onChangeMonth }) {
|
|
8
|
-
return (React.createElement(InternalButton, { iconName: "angle-left", ariaLabel: ariaLabel, variant: "icon", onClick: () => onChangeMonth(addMonths(baseDate, -1)), formAction: "none", className: styles['calendar-prev-
|
|
8
|
+
return (React.createElement(InternalButton, { iconName: "angle-left", ariaLabel: ariaLabel, variant: "icon", onClick: () => onChangeMonth(addMonths(baseDate, -1)), formAction: "none", className: styles['calendar-prev-btn'] }));
|
|
9
9
|
}
|
|
10
10
|
export function NextMonthButton({ ariaLabel, baseDate, onChangeMonth }) {
|
|
11
|
-
return (React.createElement(InternalButton, { iconName: "angle-right", ariaLabel: ariaLabel, variant: "icon", onClick: () => onChangeMonth(addMonths(baseDate, 1)), formAction: "none", className: styles['calendar-next-
|
|
11
|
+
return (React.createElement(InternalButton, { iconName: "angle-right", ariaLabel: ariaLabel, variant: "icon", onClick: () => onChangeMonth(addMonths(baseDate, 1)), formAction: "none", className: styles['calendar-next-btn'] }));
|
|
12
12
|
}
|
|
13
13
|
//# sourceMappingURL=header-button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header-button.js","sourceRoot":"lib/default/","sources":["calendar/header/header-button.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAQrC,MAAM,UAAU,eAAe,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,EAAqB;IACvF,OAAO,CACL,oBAAC,cAAc,IACb,QAAQ,EAAC,YAAY,EACrB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAC,MAAM,EACd,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,EACrD,UAAU,EAAC,MAAM,EACjB,SAAS,EAAE,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"header-button.js","sourceRoot":"lib/default/","sources":["calendar/header/header-button.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAQrC,MAAM,UAAU,eAAe,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,EAAqB;IACvF,OAAO,CACL,oBAAC,cAAc,IACb,QAAQ,EAAC,YAAY,EACrB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAC,MAAM,EACd,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,EACrD,UAAU,EAAC,MAAM,EACjB,SAAS,EAAE,MAAM,CAAC,mBAAmB,CAAC,GACtC,CACH,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,EAAqB;IACvF,OAAO,CACL,oBAAC,cAAc,IACb,QAAQ,EAAC,aAAa,EACtB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAC,MAAM,EACd,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EACpD,UAAU,EAAC,MAAM,EACjB,SAAS,EAAE,MAAM,CAAC,mBAAmB,CAAC,GACtC,CACH,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React from 'react';\nimport { InternalButton } from '../../button/internal';\nimport styles from '../styles.css.js';\nimport { addMonths } from 'date-fns';\n\ninterface HeaderButtonProps {\n ariaLabel?: string;\n baseDate: Date;\n onChangeMonth: (date: Date) => void;\n}\n\nexport function PrevMonthButton({ ariaLabel, baseDate, onChangeMonth }: HeaderButtonProps) {\n return (\n <InternalButton\n iconName=\"angle-left\"\n ariaLabel={ariaLabel}\n variant=\"icon\"\n onClick={() => onChangeMonth(addMonths(baseDate, -1))}\n formAction=\"none\"\n className={styles['calendar-prev-btn']}\n />\n );\n}\n\nexport function NextMonthButton({ ariaLabel, baseDate, onChangeMonth }: HeaderButtonProps) {\n return (\n <InternalButton\n iconName=\"angle-right\"\n ariaLabel={ariaLabel}\n variant=\"icon\"\n onClick={() => onChangeMonth(addMonths(baseDate, 1))}\n formAction=\"none\"\n className={styles['calendar-next-btn']}\n />\n );\n}\n"]}
|
package/calendar/styles.css.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"calendar": "
|
|
5
|
-
"awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-
|
|
6
|
-
"root": "
|
|
7
|
-
"calendar-inner": "awsui_calendar-
|
|
8
|
-
"calendar-header": "awsui_calendar-
|
|
9
|
-
"calendar-header-month": "awsui_calendar-header-
|
|
10
|
-
"calendar-next-
|
|
11
|
-
"calendar-prev-
|
|
12
|
-
"calendar-grid": "awsui_calendar-
|
|
13
|
-
"calendar-grid-cell": "awsui_calendar-grid-
|
|
14
|
-
"calendar-
|
|
15
|
-
"calendar-
|
|
16
|
-
"calendar-
|
|
17
|
-
"calendar-
|
|
18
|
-
"calendar-
|
|
19
|
-
"calendar-
|
|
20
|
-
"
|
|
21
|
-
"calendar-
|
|
4
|
+
"calendar": "awsui_calendar_1ykar_2xzng_93",
|
|
5
|
+
"awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_1ykar_2xzng_1",
|
|
6
|
+
"root": "awsui_root_1ykar_2xzng_124",
|
|
7
|
+
"calendar-inner": "awsui_calendar-inner_1ykar_2xzng_165",
|
|
8
|
+
"calendar-header": "awsui_calendar-header_1ykar_2xzng_169",
|
|
9
|
+
"calendar-header-month": "awsui_calendar-header-month_1ykar_2xzng_174",
|
|
10
|
+
"calendar-next-btn": "awsui_calendar-next-btn_1ykar_2xzng_182",
|
|
11
|
+
"calendar-prev-btn": "awsui_calendar-prev-btn_1ykar_2xzng_185",
|
|
12
|
+
"calendar-grid": "awsui_calendar-grid_1ykar_2xzng_188",
|
|
13
|
+
"calendar-grid-cell": "awsui_calendar-grid-cell_1ykar_2xzng_192",
|
|
14
|
+
"calendar-date-header": "awsui_calendar-date-header_1ykar_2xzng_198",
|
|
15
|
+
"calendar-date": "awsui_calendar-date_1ykar_2xzng_198",
|
|
16
|
+
"calendar-date-enabled": "awsui_calendar-date-enabled_1ykar_2xzng_218",
|
|
17
|
+
"calendar-date-current-page": "awsui_calendar-date-current-page_1ykar_2xzng_228",
|
|
18
|
+
"calendar-date-selected": "awsui_calendar-date-selected_1ykar_2xzng_235",
|
|
19
|
+
"calendar-date-current": "awsui_calendar-date-current_1ykar_2xzng_228",
|
|
20
|
+
"date-inner": "awsui_date-inner_1ykar_2xzng_257",
|
|
21
|
+
"calendar-row": "awsui_calendar-row_1ykar_2xzng_332"
|
|
22
22
|
};
|
|
23
23
|
|
|
@@ -90,11 +90,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
90
90
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
91
91
|
SPDX-License-Identifier: Apache-2.0
|
|
92
92
|
*/
|
|
93
|
-
.
|
|
94
|
-
animation: awsui_awsui-motion-fade-in-
|
|
93
|
+
.awsui_calendar_1ykar_2xzng_93:not(#\9) {
|
|
94
|
+
animation: awsui_awsui-motion-fade-in-0_1ykar_2xzng_1 var(--motion-duration-show-quick-aq3ump, 135ms) var(--motion-easing-show-quick-vc5zgd, ease-out);
|
|
95
95
|
animation-fill-mode: both;
|
|
96
96
|
}
|
|
97
|
-
@keyframes awsui_awsui-motion-fade-in-
|
|
97
|
+
@keyframes awsui_awsui-motion-fade-in-0_1ykar_2xzng_1 {
|
|
98
98
|
from {
|
|
99
99
|
opacity: 0;
|
|
100
100
|
}
|
|
@@ -103,12 +103,12 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
@media (prefers-reduced-motion: reduce) {
|
|
106
|
-
.
|
|
106
|
+
.awsui_calendar_1ykar_2xzng_93:not(#\9) {
|
|
107
107
|
animation: none;
|
|
108
108
|
transition: none;
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
|
-
.awsui-motion-disabled .
|
|
111
|
+
.awsui-motion-disabled .awsui_calendar_1ykar_2xzng_93:not(#\9), .awsui-mode-entering .awsui_calendar_1ykar_2xzng_93:not(#\9) {
|
|
112
112
|
animation: none;
|
|
113
113
|
transition: none;
|
|
114
114
|
}
|
|
@@ -121,11 +121,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
121
121
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
122
122
|
SPDX-License-Identifier: Apache-2.0
|
|
123
123
|
*/
|
|
124
|
-
.
|
|
124
|
+
.awsui_root_1ykar_2xzng_124:not(#\9) {
|
|
125
125
|
/* used in test-utils */
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
.
|
|
128
|
+
.awsui_calendar_1ykar_2xzng_93:not(#\9) {
|
|
129
129
|
display: block;
|
|
130
130
|
inline-size: var(--size-calendar-grid-width-lrunz7, 238px);
|
|
131
131
|
overflow: auto;
|
|
@@ -163,16 +163,16 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
163
163
|
-webkit-font-smoothing: auto;
|
|
164
164
|
-moz-osx-font-smoothing: auto;
|
|
165
165
|
}
|
|
166
|
-
.awsui_calendar-
|
|
166
|
+
.awsui_calendar-inner_1ykar_2xzng_165:not(#\9) {
|
|
167
167
|
margin-block: var(--space-xs-zb16t3, 8px);
|
|
168
168
|
margin-inline: var(--space-xs-zb16t3, 8px);
|
|
169
169
|
}
|
|
170
|
-
.awsui_calendar-
|
|
170
|
+
.awsui_calendar-header_1ykar_2xzng_169:not(#\9) {
|
|
171
171
|
display: flex;
|
|
172
172
|
justify-content: space-between;
|
|
173
173
|
align-items: center;
|
|
174
174
|
}
|
|
175
|
-
.awsui_calendar-header-
|
|
175
|
+
.awsui_calendar-header-month_1ykar_2xzng_174:not(#\9) {
|
|
176
176
|
font-size: var(--font-size-body-m-x4okxb, 14px);
|
|
177
177
|
line-height: var(--line-height-body-m-30ar75, 20px);
|
|
178
178
|
font-weight: 700;
|
|
@@ -180,23 +180,23 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
180
180
|
margin-block: 0;
|
|
181
181
|
margin-inline: 0;
|
|
182
182
|
}
|
|
183
|
-
.awsui_calendar-next-
|
|
183
|
+
.awsui_calendar-next-btn_1ykar_2xzng_182:not(#\9) {
|
|
184
184
|
/* used for identifying element */
|
|
185
185
|
}
|
|
186
|
-
.awsui_calendar-prev-
|
|
186
|
+
.awsui_calendar-prev-btn_1ykar_2xzng_185:not(#\9) {
|
|
187
187
|
/* used for identifying element */
|
|
188
188
|
}
|
|
189
|
-
.awsui_calendar-
|
|
189
|
+
.awsui_calendar-grid_1ykar_2xzng_188:not(#\9) {
|
|
190
190
|
inline-size: 100%;
|
|
191
191
|
border-spacing: 0;
|
|
192
192
|
}
|
|
193
|
-
.awsui_calendar-grid-
|
|
193
|
+
.awsui_calendar-grid-cell_1ykar_2xzng_192:not(#\9) {
|
|
194
194
|
inline-size: 14.2857142857%;
|
|
195
195
|
word-break: break-word;
|
|
196
196
|
text-align: center;
|
|
197
197
|
font-weight: unset;
|
|
198
198
|
}
|
|
199
|
-
.awsui_calendar-
|
|
199
|
+
.awsui_calendar-date-header_1ykar_2xzng_198:not(#\9) {
|
|
200
200
|
padding-block-start: var(--space-s-34lx8l, 12px);
|
|
201
201
|
padding-block-end: var(--space-xxs-p8yyaw, 4px);
|
|
202
202
|
padding-inline: 0;
|
|
@@ -205,7 +205,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
205
205
|
line-height: var(--line-height-body-s-7zv1j5, 16px);
|
|
206
206
|
letter-spacing: var(--letter-spacing-body-s-z9jkwp, 0.005em);
|
|
207
207
|
}
|
|
208
|
-
.awsui_calendar-
|
|
208
|
+
.awsui_calendar-date_1ykar_2xzng_198:not(#\9) {
|
|
209
209
|
border-block-end: 1px solid var(--color-border-calendar-grid-u86q1u, transparent);
|
|
210
210
|
border-inline-end: 1px solid var(--color-border-calendar-grid-u86q1u, transparent);
|
|
211
211
|
padding-block: var(--space-xxs-p8yyaw, 4px);
|
|
@@ -213,39 +213,39 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
213
213
|
color: var(--color-text-dropdown-item-disabled-6oq3n6, #9ba7b6);
|
|
214
214
|
position: relative;
|
|
215
215
|
}
|
|
216
|
-
.awsui_calendar-
|
|
216
|
+
.awsui_calendar-date_1ykar_2xzng_198:not(#\9):first-child {
|
|
217
217
|
border-inline-start: 1px solid var(--color-border-calendar-grid-u86q1u, transparent);
|
|
218
218
|
}
|
|
219
|
-
.awsui_calendar-
|
|
219
|
+
.awsui_calendar-date-enabled_1ykar_2xzng_218:not(#\9) {
|
|
220
220
|
cursor: pointer;
|
|
221
221
|
color: var(--color-text-dropdown-item-secondary-jho0ju, #5f6b7a);
|
|
222
222
|
}
|
|
223
|
-
.awsui_calendar-
|
|
223
|
+
.awsui_calendar-date-enabled_1ykar_2xzng_218:not(#\9)::after {
|
|
224
224
|
border-start-start-radius: var(--border-radius-item-05df9h, 8px);
|
|
225
225
|
border-start-end-radius: var(--border-radius-item-05df9h, 8px);
|
|
226
226
|
border-end-start-radius: var(--border-radius-item-05df9h, 8px);
|
|
227
227
|
border-end-end-radius: var(--border-radius-item-05df9h, 8px);
|
|
228
228
|
}
|
|
229
|
-
.awsui_calendar-
|
|
229
|
+
.awsui_calendar-date-enabled_1ykar_2xzng_218.awsui_calendar-date-current-page_1ykar_2xzng_228:not(#\9) {
|
|
230
230
|
color: var(--color-text-dropdown-item-default-4o4hes, #000716);
|
|
231
231
|
}
|
|
232
|
-
.awsui_calendar-
|
|
233
|
-
color: var(--color-text-calendar-
|
|
232
|
+
.awsui_calendar-date-enabled_1ykar_2xzng_218.awsui_calendar-date-current-page_1ykar_2xzng_228:not(#\9):hover {
|
|
233
|
+
color: var(--color-text-calendar-date-hover-llr4as, #000716);
|
|
234
234
|
background-color: var(--color-background-dropdown-item-hover-swsulg, #f4f4f4);
|
|
235
235
|
}
|
|
236
|
-
.awsui_calendar-
|
|
236
|
+
.awsui_calendar-date-enabled_1ykar_2xzng_218.awsui_calendar-date-current-page_1ykar_2xzng_228:not(#\9):hover:not(.awsui_calendar-date-selected_1ykar_2xzng_235)::after {
|
|
237
237
|
border-block: var(--border-item-width-yel47s, 2px) solid var(--color-border-dropdown-item-hover-461g78, #7d8998);
|
|
238
238
|
border-inline: var(--border-item-width-yel47s, 2px) solid var(--color-border-dropdown-item-hover-461g78, #7d8998);
|
|
239
239
|
}
|
|
240
|
-
.awsui_calendar-
|
|
241
|
-
background-color: var(--color-background-calendar-
|
|
240
|
+
.awsui_calendar-date-current_1ykar_2xzng_228:not(#\9) {
|
|
241
|
+
background-color: var(--color-background-calendar-current-date-kmb0ji, #f4f4f4);
|
|
242
242
|
border-start-start-radius: var(--border-radius-item-05df9h, 8px);
|
|
243
243
|
border-start-end-radius: var(--border-radius-item-05df9h, 8px);
|
|
244
244
|
border-end-start-radius: var(--border-radius-item-05df9h, 8px);
|
|
245
245
|
border-end-end-radius: var(--border-radius-item-05df9h, 8px);
|
|
246
246
|
font-weight: 700;
|
|
247
247
|
}
|
|
248
|
-
.awsui_calendar-
|
|
248
|
+
.awsui_calendar-date_1ykar_2xzng_198:not(#\9)::after {
|
|
249
249
|
content: "";
|
|
250
250
|
position: absolute;
|
|
251
251
|
z-index: 1;
|
|
@@ -255,21 +255,21 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
255
255
|
inset-inline-end: calc(-1 * var(--border-item-width-yel47s, 2px));
|
|
256
256
|
background-color: transparent;
|
|
257
257
|
}
|
|
258
|
-
.awsui_calendar-
|
|
258
|
+
.awsui_calendar-date_1ykar_2xzng_198 > .awsui_date-inner_1ykar_2xzng_257:not(#\9) {
|
|
259
259
|
position: relative;
|
|
260
260
|
z-index: 1;
|
|
261
261
|
}
|
|
262
|
-
.awsui_calendar-
|
|
262
|
+
.awsui_calendar-date_1ykar_2xzng_198:not(#\9):focus {
|
|
263
263
|
outline: none;
|
|
264
264
|
}
|
|
265
|
-
body[data-awsui-focus-visible=true] .awsui_calendar-
|
|
265
|
+
body[data-awsui-focus-visible=true] .awsui_calendar-date_1ykar_2xzng_198:not(#\9):focus:focus {
|
|
266
266
|
position: relative;
|
|
267
267
|
}
|
|
268
|
-
body[data-awsui-focus-visible=true] .awsui_calendar-
|
|
268
|
+
body[data-awsui-focus-visible=true] .awsui_calendar-date_1ykar_2xzng_198:not(#\9):focus:focus {
|
|
269
269
|
outline: 2px dotted transparent;
|
|
270
270
|
outline-offset: calc(var(--space-calendar-grid-focus-outline-gutter-g00bgj, -5px) - 1px);
|
|
271
271
|
}
|
|
272
|
-
body[data-awsui-focus-visible=true] .awsui_calendar-
|
|
272
|
+
body[data-awsui-focus-visible=true] .awsui_calendar-date_1ykar_2xzng_198:not(#\9):focus:focus::before {
|
|
273
273
|
content: " ";
|
|
274
274
|
display: block;
|
|
275
275
|
position: absolute;
|
|
@@ -283,23 +283,23 @@ body[data-awsui-focus-visible=true] .awsui_calendar-day_1ykar_1818s_198:not(#\9)
|
|
|
283
283
|
border-end-end-radius: var(--border-radius-calendar-day-focus-ring-545h0w, 3px);
|
|
284
284
|
box-shadow: 0 0 0 2px var(--color-border-item-focused-b2ntyl, #0972d3);
|
|
285
285
|
}
|
|
286
|
-
body[data-awsui-focus-visible=true] .awsui_calendar-
|
|
286
|
+
body[data-awsui-focus-visible=true] .awsui_calendar-date_1ykar_2xzng_198:not(#\9):focus:focus::before {
|
|
287
287
|
z-index: 2;
|
|
288
288
|
}
|
|
289
|
-
.awsui_calendar-
|
|
289
|
+
.awsui_calendar-date-selected_1ykar_2xzng_235:not(#\9) {
|
|
290
290
|
border-color: transparent;
|
|
291
291
|
position: relative;
|
|
292
292
|
z-index: 2;
|
|
293
293
|
font-weight: 700;
|
|
294
294
|
}
|
|
295
|
-
body[data-awsui-focus-visible=true] .awsui_calendar-
|
|
295
|
+
body[data-awsui-focus-visible=true] .awsui_calendar-date-selected_1ykar_2xzng_235:not(#\9):focus:focus {
|
|
296
296
|
position: relative;
|
|
297
297
|
}
|
|
298
|
-
body[data-awsui-focus-visible=true] .awsui_calendar-
|
|
298
|
+
body[data-awsui-focus-visible=true] .awsui_calendar-date-selected_1ykar_2xzng_235:not(#\9):focus:focus {
|
|
299
299
|
outline: 2px dotted transparent;
|
|
300
300
|
outline-offset: calc(var(--space-calendar-grid-focus-outline-gutter-g00bgj, -5px) - 1px);
|
|
301
301
|
}
|
|
302
|
-
body[data-awsui-focus-visible=true] .awsui_calendar-
|
|
302
|
+
body[data-awsui-focus-visible=true] .awsui_calendar-date-selected_1ykar_2xzng_235:not(#\9):focus:focus::before {
|
|
303
303
|
content: " ";
|
|
304
304
|
display: block;
|
|
305
305
|
position: absolute;
|
|
@@ -313,10 +313,10 @@ body[data-awsui-focus-visible=true] .awsui_calendar-day-selected_1ykar_1818s_235
|
|
|
313
313
|
border-end-end-radius: var(--border-radius-calendar-day-focus-ring-545h0w, 3px);
|
|
314
314
|
box-shadow: 0 0 0 2px var(--color-border-calendar-grid-selected-focus-ring-thqa8y, #fbfbfb);
|
|
315
315
|
}
|
|
316
|
-
body[data-awsui-focus-visible=true] .awsui_calendar-
|
|
316
|
+
body[data-awsui-focus-visible=true] .awsui_calendar-date-selected_1ykar_2xzng_235:not(#\9):focus:focus::before {
|
|
317
317
|
z-index: 2;
|
|
318
318
|
}
|
|
319
|
-
.awsui_calendar-
|
|
319
|
+
.awsui_calendar-date-selected_1ykar_2xzng_235:not(#\9)::after {
|
|
320
320
|
background-color: var(--color-background-control-checked-w517i0, #0972d3);
|
|
321
321
|
border-block: var(--border-item-width-yel47s, 2px) solid var(--color-background-control-checked-w517i0, #0972d3);
|
|
322
322
|
border-inline: var(--border-item-width-yel47s, 2px) solid var(--color-background-control-checked-w517i0, #0972d3);
|
|
@@ -325,11 +325,11 @@ body[data-awsui-focus-visible=true] .awsui_calendar-day-selected_1ykar_1818s_235
|
|
|
325
325
|
border-end-start-radius: var(--border-radius-item-05df9h, 8px);
|
|
326
326
|
border-end-end-radius: var(--border-radius-item-05df9h, 8px);
|
|
327
327
|
}
|
|
328
|
-
.awsui_calendar-
|
|
328
|
+
.awsui_calendar-date-selected_1ykar_2xzng_235 > .awsui_date-inner_1ykar_2xzng_257:not(#\9) {
|
|
329
329
|
z-index: 2;
|
|
330
330
|
color: var(--color-background-control-default-qzruqy, #ffffff);
|
|
331
331
|
position: relative;
|
|
332
332
|
}
|
|
333
|
-
.awsui_calendar-
|
|
333
|
+
.awsui_calendar-row_1ykar_2xzng_332:not(#\9):first-child > .awsui_calendar-date_1ykar_2xzng_198 {
|
|
334
334
|
border-block-start: 1px solid var(--color-border-calendar-grid-u86q1u, transparent);
|
|
335
335
|
}
|