@cloudscape-design/components 3.0.57 → 3.0.59

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.
Files changed (122) hide show
  1. package/autosuggest/internal.d.ts.map +1 -1
  2. package/autosuggest/internal.js +1 -5
  3. package/autosuggest/internal.js.map +1 -1
  4. package/{date-picker/calendar → calendar}/grid/day/index.d.ts +1 -1
  5. package/calendar/grid/day/index.d.ts.map +1 -0
  6. package/{date-picker/calendar → calendar}/grid/day/index.js +1 -1
  7. package/calendar/grid/day/index.js.map +1 -0
  8. package/{date-picker/calendar → calendar}/grid/index.d.ts +2 -2
  9. package/calendar/grid/index.d.ts.map +1 -0
  10. package/{date-picker/calendar → calendar}/grid/index.js +2 -2
  11. package/calendar/grid/index.js.map +1 -0
  12. package/{date-picker/calendar → calendar}/header/button/index.d.ts +0 -0
  13. package/calendar/header/button/index.d.ts.map +1 -0
  14. package/{date-picker/calendar → calendar}/header/button/index.js +2 -2
  15. package/calendar/header/button/index.js.map +1 -0
  16. package/{date-picker/calendar → calendar}/header/index.d.ts +1 -2
  17. package/calendar/header/index.d.ts.map +1 -0
  18. package/{date-picker/calendar → calendar}/header/index.js +3 -3
  19. package/calendar/header/index.js.map +1 -0
  20. package/calendar/index.d.ts +4 -0
  21. package/calendar/index.d.ts.map +1 -0
  22. package/calendar/index.js +14 -0
  23. package/calendar/index.js.map +1 -0
  24. package/calendar/interfaces.d.ts +56 -0
  25. package/calendar/interfaces.d.ts.map +1 -0
  26. package/calendar/interfaces.js +4 -0
  27. package/calendar/interfaces.js.map +1 -0
  28. package/calendar/internal.d.ts +4 -0
  29. package/calendar/internal.d.ts.map +1 -0
  30. package/{date-picker/calendar/index.js → calendar/internal.js} +9 -13
  31. package/calendar/internal.js.map +1 -0
  32. package/calendar/styles.css.js +25 -0
  33. package/calendar/styles.scoped.css +291 -0
  34. package/calendar/styles.selectors.js +26 -0
  35. package/{date-picker/calendar → calendar}/utils/intl.d.ts +2 -2
  36. package/calendar/utils/intl.d.ts.map +1 -0
  37. package/{date-picker/calendar → calendar}/utils/intl.js +2 -0
  38. package/calendar/utils/intl.js.map +1 -0
  39. package/{date-picker/calendar → calendar}/utils/locales.d.ts +1 -1
  40. package/calendar/utils/locales.d.ts.map +1 -0
  41. package/{date-picker/calendar → calendar}/utils/locales.js +1 -1
  42. package/calendar/utils/locales.js.map +1 -0
  43. package/{date-picker/calendar → calendar}/utils/memoized-date.d.ts +0 -0
  44. package/calendar/utils/memoized-date.d.ts.map +1 -0
  45. package/{date-picker/calendar → calendar}/utils/memoized-date.js +1 -1
  46. package/calendar/utils/memoized-date.js.map +1 -0
  47. package/{date-picker/calendar → calendar}/utils/move-focus-handler.d.ts +1 -1
  48. package/calendar/utils/move-focus-handler.d.ts.map +1 -0
  49. package/{date-picker/calendar → calendar}/utils/move-focus-handler.js +0 -0
  50. package/calendar/utils/move-focus-handler.js.map +1 -0
  51. package/calendar/utils/rotate-day-indexes.d.ts +3 -0
  52. package/calendar/utils/rotate-day-indexes.d.ts.map +1 -0
  53. package/{date-picker/calendar → calendar}/utils/rotate-day-indexes.js +2 -0
  54. package/calendar/utils/rotate-day-indexes.js.map +1 -0
  55. package/date-picker/index.d.ts.map +1 -1
  56. package/date-picker/index.js +16 -10
  57. package/date-picker/index.js.map +1 -1
  58. package/date-picker/interfaces.d.ts +2 -44
  59. package/date-picker/interfaces.d.ts.map +1 -1
  60. package/date-picker/interfaces.js.map +1 -1
  61. package/date-picker/styles.css.js +7 -24
  62. package/date-picker/styles.scoped.css +21 -210
  63. package/date-picker/styles.selectors.js +7 -24
  64. package/date-range-picker/calendar/get-base-date.js +1 -1
  65. package/date-range-picker/calendar/get-base-date.js.map +1 -1
  66. package/date-range-picker/calendar/grids/day/index.js +1 -1
  67. package/date-range-picker/calendar/grids/day/index.js.map +1 -1
  68. package/date-range-picker/calendar/grids/grid.js +2 -2
  69. package/date-range-picker/calendar/grids/grid.js.map +1 -1
  70. package/date-range-picker/calendar/grids/index.d.ts +1 -1
  71. package/date-range-picker/calendar/grids/index.d.ts.map +1 -1
  72. package/date-range-picker/calendar/grids/index.js.map +1 -1
  73. package/date-range-picker/calendar/header/index.js +1 -1
  74. package/date-range-picker/calendar/header/index.js.map +1 -1
  75. package/date-range-picker/calendar/index.js +3 -3
  76. package/date-range-picker/calendar/index.js.map +1 -1
  77. package/date-range-picker/index.js +1 -1
  78. package/date-range-picker/index.js.map +1 -1
  79. package/internal/components/autosuggest-input/index.d.ts +1 -1
  80. package/internal/components/autosuggest-input/index.d.ts.map +1 -1
  81. package/internal/components/autosuggest-input/index.js +42 -6
  82. package/internal/components/autosuggest-input/index.js.map +1 -1
  83. package/internal/environment.js +1 -1
  84. package/package.json +1 -1
  85. package/property-filter/property-filter-autosuggest.d.ts.map +1 -1
  86. package/property-filter/property-filter-autosuggest.js +1 -5
  87. package/property-filter/property-filter-autosuggest.js.map +1 -1
  88. package/test-utils/dom/calendar/index.d.ts +16 -0
  89. package/test-utils/dom/calendar/index.js +53 -0
  90. package/test-utils/dom/calendar/index.js.map +1 -0
  91. package/test-utils/dom/date-picker/index.d.ts +2 -14
  92. package/test-utils/dom/date-picker/index.js +4 -33
  93. package/test-utils/dom/date-picker/index.js.map +1 -1
  94. package/test-utils/selectors/calendar/index.d.ts +16 -0
  95. package/test-utils/selectors/calendar/index.js +53 -0
  96. package/test-utils/selectors/calendar/index.js.map +1 -0
  97. package/test-utils/selectors/date-picker/index.d.ts +2 -14
  98. package/test-utils/selectors/date-picker/index.js +2 -31
  99. package/test-utils/selectors/date-picker/index.js.map +1 -1
  100. package/test-utils/tsconfig.tsbuildinfo +1 -1
  101. package/date-picker/calendar/grid/day/index.d.ts.map +0 -1
  102. package/date-picker/calendar/grid/day/index.js.map +0 -1
  103. package/date-picker/calendar/grid/index.d.ts.map +0 -1
  104. package/date-picker/calendar/grid/index.js.map +0 -1
  105. package/date-picker/calendar/header/button/index.d.ts.map +0 -1
  106. package/date-picker/calendar/header/button/index.js.map +0 -1
  107. package/date-picker/calendar/header/index.d.ts.map +0 -1
  108. package/date-picker/calendar/header/index.js.map +0 -1
  109. package/date-picker/calendar/index.d.ts +0 -17
  110. package/date-picker/calendar/index.d.ts.map +0 -1
  111. package/date-picker/calendar/index.js.map +0 -1
  112. package/date-picker/calendar/utils/intl.d.ts.map +0 -1
  113. package/date-picker/calendar/utils/intl.js.map +0 -1
  114. package/date-picker/calendar/utils/locales.d.ts.map +0 -1
  115. package/date-picker/calendar/utils/locales.js.map +0 -1
  116. package/date-picker/calendar/utils/memoized-date.d.ts.map +0 -1
  117. package/date-picker/calendar/utils/memoized-date.js.map +0 -1
  118. package/date-picker/calendar/utils/move-focus-handler.d.ts.map +0 -1
  119. package/date-picker/calendar/utils/move-focus-handler.js.map +0 -1
  120. package/date-picker/calendar/utils/rotate-day-indexes.d.ts +0 -3
  121. package/date-picker/calendar/utils/rotate-day-indexes.d.ts.map +0 -1
  122. package/date-picker/calendar/utils/rotate-day-indexes.js.map +0 -1
@@ -0,0 +1,291 @@
1
+ /*
2
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ /*
6
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
7
+ SPDX-License-Identifier: Apache-2.0
8
+ */
9
+ /*
10
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
11
+ SPDX-License-Identifier: Apache-2.0
12
+ */
13
+ /*
14
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
15
+ SPDX-License-Identifier: Apache-2.0
16
+ */
17
+ /*
18
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
19
+ SPDX-License-Identifier: Apache-2.0
20
+ */
21
+ /*
22
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
23
+ SPDX-License-Identifier: Apache-2.0
24
+ */
25
+ /*
26
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
27
+ SPDX-License-Identifier: Apache-2.0
28
+ */
29
+ /*
30
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
31
+ SPDX-License-Identifier: Apache-2.0
32
+ */
33
+ /*
34
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
35
+ SPDX-License-Identifier: Apache-2.0
36
+ */
37
+ /*
38
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
39
+ SPDX-License-Identifier: Apache-2.0
40
+ */
41
+ /*
42
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
43
+ SPDX-License-Identifier: Apache-2.0
44
+ */
45
+ /*
46
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
47
+ SPDX-License-Identifier: Apache-2.0
48
+ */
49
+ /*
50
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
51
+ SPDX-License-Identifier: Apache-2.0
52
+ */
53
+ /* stylelint-disable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
54
+ /* stylelint-enable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
55
+ /*
56
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
57
+ SPDX-License-Identifier: Apache-2.0
58
+ */
59
+ /*
60
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
61
+ SPDX-License-Identifier: Apache-2.0
62
+ */
63
+ /*
64
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
65
+ SPDX-License-Identifier: Apache-2.0
66
+ */
67
+ /*
68
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
69
+ SPDX-License-Identifier: Apache-2.0
70
+ */
71
+ /*
72
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
73
+ SPDX-License-Identifier: Apache-2.0
74
+ */
75
+ /*
76
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
77
+ SPDX-License-Identifier: Apache-2.0
78
+ */
79
+ /*
80
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
81
+ SPDX-License-Identifier: Apache-2.0
82
+ */
83
+ /* Style used for links in slots/components that are text heavy, to help links stand out among
84
+ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
85
+ /*
86
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
87
+ SPDX-License-Identifier: Apache-2.0
88
+ */
89
+ /*
90
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
91
+ SPDX-License-Identifier: Apache-2.0
92
+ */
93
+ .awsui_calendar_1ykar_3ngtd_93:not(#\9) {
94
+ animation: awsui_awsui-motion-fade-in-0_1ykar_3ngtd_1 var(--motion-duration-show-quick-tyaalm, 135ms) var(--motion-easing-show-quick-1fcgbv, ease-out);
95
+ animation-fill-mode: both;
96
+ }
97
+ @keyframes awsui_awsui-motion-fade-in-0_1ykar_3ngtd_1 {
98
+ from {
99
+ opacity: 0;
100
+ }
101
+ to {
102
+ opacity: 1;
103
+ }
104
+ }
105
+ @media (prefers-reduced-motion: reduce) {
106
+ .awsui_calendar_1ykar_3ngtd_93:not(#\9) {
107
+ animation: none;
108
+ transition: none;
109
+ }
110
+ }
111
+ .awsui-motion-disabled .awsui_calendar_1ykar_3ngtd_93:not(#\9), .awsui-mode-entering .awsui_calendar_1ykar_3ngtd_93:not(#\9) {
112
+ animation: none;
113
+ transition: none;
114
+ }
115
+
116
+ /*
117
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
118
+ SPDX-License-Identifier: Apache-2.0
119
+ */
120
+ .awsui_root_1ykar_3ngtd_120:not(#\9) {
121
+ /* used in test-utils */
122
+ }
123
+
124
+ .awsui_calendar_1ykar_3ngtd_93:not(#\9) {
125
+ display: block;
126
+ width: 234px;
127
+ overflow: auto;
128
+ /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
129
+ border-collapse: separate;
130
+ border-spacing: 0;
131
+ caption-side: top;
132
+ cursor: auto;
133
+ direction: ltr;
134
+ empty-cells: show;
135
+ font-family: serif;
136
+ font-size: medium;
137
+ font-style: normal;
138
+ font-variant: normal;
139
+ font-weight: normal;
140
+ font-stretch: normal;
141
+ line-height: normal;
142
+ -webkit-hyphens: none;
143
+ hyphens: none;
144
+ letter-spacing: normal;
145
+ list-style: disc outside none;
146
+ tab-size: 8;
147
+ text-align: left;
148
+ text-align-last: auto;
149
+ text-indent: 0;
150
+ text-shadow: none;
151
+ text-transform: none;
152
+ visibility: visible;
153
+ white-space: normal;
154
+ widows: 2;
155
+ word-spacing: normal;
156
+ box-sizing: border-box;
157
+ font-size: var(--font-body-m-size-sregvd, 14px);
158
+ line-height: var(--font-body-m-line-height-i7xxvv, 22px);
159
+ color: var(--color-text-body-default-ajf1h5, #000716);
160
+ font-weight: 400;
161
+ font-family: var(--font-family-base-qnistn, "Open Sans", "Helvetica Neue", Roboto, Arial, sans-serif);
162
+ }
163
+ .awsui_calendar-inner_1ykar_3ngtd_137:not(#\9) {
164
+ margin: var(--space-xs-rsr2qu, 8px);
165
+ }
166
+ .awsui_calendar-header_1ykar_3ngtd_140:not(#\9) {
167
+ display: flex;
168
+ justify-content: space-between;
169
+ align-items: center;
170
+ }
171
+ .awsui_calendar-header-month_1ykar_3ngtd_145:not(#\9) {
172
+ font-size: var(--font-body-m-size-sregvd, 14px);
173
+ line-height: var(--font-body-m-line-height-i7xxvv, 22px);
174
+ font-weight: 700;
175
+ color: var(--color-text-dropdown-item-default-7tg9p2, #000716);
176
+ }
177
+ .awsui_calendar-next-month-btn_1ykar_3ngtd_151:not(#\9) {
178
+ /* used for identifying element */
179
+ }
180
+ .awsui_calendar-prev-month-btn_1ykar_3ngtd_154:not(#\9) {
181
+ /* used for identifying element */
182
+ }
183
+ .awsui_calendar-day-names_1ykar_3ngtd_157:not(#\9) {
184
+ display: flex;
185
+ justify-content: stretch;
186
+ }
187
+ .awsui_calendar-day-name_1ykar_3ngtd_157:not(#\9) {
188
+ flex: 1 1 0%;
189
+ width: 0;
190
+ word-break: break-word;
191
+ text-align: center;
192
+ padding: var(--space-s-hv8c1d, 12px) 0 var(--space-xxs-ynfts5, 4px);
193
+ color: var(--color-text-calendar-month-elf7e9, #5f6b7a);
194
+ font-size: var(--font-body-s-size-ukw2p9, 12px);
195
+ line-height: var(--font-body-s-line-height-kdsbrl, 16px);
196
+ letter-spacing: var(--font-body-s-letter-spacing-cy0oxj, 0.005em);
197
+ }
198
+ .awsui_calendar-dates_1ykar_3ngtd_172:not(#\9) {
199
+ border: 1px solid var(--color-border-calendar-grid-sshunw, transparent);
200
+ }
201
+ .awsui_calendar-week_1ykar_3ngtd_175:not(#\9) {
202
+ display: flex;
203
+ justify-content: stretch;
204
+ }
205
+ .awsui_calendar-day_1ykar_3ngtd_157:not(#\9) {
206
+ flex: 1 1 0%;
207
+ width: 0;
208
+ word-break: break-word;
209
+ text-align: center;
210
+ border-bottom: 1px solid var(--color-border-calendar-grid-sshunw, transparent);
211
+ border-right: 1px solid var(--color-border-calendar-grid-sshunw, transparent);
212
+ border-radius: var(--border-radius-item-u2ibpi, 8px);
213
+ padding: var(--space-xxs-ynfts5, 4px) 0;
214
+ color: var(--color-text-dropdown-item-disabled-varol7, #9ba7b6);
215
+ position: relative;
216
+ }
217
+ .awsui_calendar-day_1ykar_3ngtd_157:not(#\9):last-child {
218
+ border-right: none;
219
+ }
220
+ .awsui_calendar-day-in-last-week_1ykar_3ngtd_194:not(#\9) {
221
+ border-bottom: none;
222
+ }
223
+ .awsui_calendar-day-focusable_1ykar_3ngtd_197:not(#\9) {
224
+ /* used for identifying element */
225
+ }
226
+ .awsui_calendar-day-enabled_1ykar_3ngtd_200:not(#\9) {
227
+ cursor: pointer;
228
+ color: var(--color-text-dropdown-item-secondary-0me7js, #5f6b7a);
229
+ }
230
+ .awsui_calendar-day-enabled_1ykar_3ngtd_200.awsui_calendar-day-current-month_1ykar_3ngtd_204:not(#\9) {
231
+ color: var(--color-text-dropdown-item-default-7tg9p2, #000716);
232
+ }
233
+ .awsui_calendar-day-enabled_1ykar_3ngtd_200.awsui_calendar-day-current-month_1ykar_3ngtd_204:not(#\9):hover {
234
+ color: var(--color-text-calendar-day-hover-graajh, #000716);
235
+ background-color: var(--color-background-dropdown-item-hover-mqsxkv, #f4f4f4);
236
+ }
237
+ .awsui_calendar-day-enabled_1ykar_3ngtd_200.awsui_calendar-day-current-month_1ykar_3ngtd_204:not(#\9):hover:not(.awsui_calendar-day-selected_1ykar_3ngtd_211)::after {
238
+ border: var(--border-item-width-qbbbsa, 2px) solid var(--color-border-dropdown-item-hover-tyzq9m, #7d8998);
239
+ border-radius: var(--border-radius-item-u2ibpi, 8px);
240
+ }
241
+ .awsui_calendar-day-today_1ykar_3ngtd_215:not(#\9) {
242
+ background-color: var(--color-background-calendar-today-762czq, #f4f4f4);
243
+ }
244
+ .awsui_calendar-day_1ykar_3ngtd_157:not(#\9)::after {
245
+ content: "";
246
+ position: absolute;
247
+ top: -1px;
248
+ left: -1px;
249
+ bottom: -1px;
250
+ right: -1px;
251
+ background-color: transparent;
252
+ }
253
+ .awsui_calendar-day_1ykar_3ngtd_157 > .awsui_day-inner_1ykar_3ngtd_227:not(#\9) {
254
+ position: relative;
255
+ z-index: 1;
256
+ }
257
+ .awsui_calendar-day_1ykar_3ngtd_157:not(#\9):focus {
258
+ outline: none;
259
+ position: relative;
260
+ }
261
+ .awsui_calendar-day_1ykar_3ngtd_157:not(#\9):focus {
262
+ outline: 2px dotted transparent;
263
+ outline-offset: calc(var(--space-calendar-grid-focus-outline-gutter-v3dwvl, -5px) - 1px);
264
+ }
265
+ .awsui_calendar-day_1ykar_3ngtd_157:not(#\9):focus::before {
266
+ content: " ";
267
+ display: block;
268
+ position: absolute;
269
+ left: calc(-1 * var(--space-calendar-grid-focus-outline-gutter-v3dwvl, -5px));
270
+ top: calc(-1 * var(--space-calendar-grid-focus-outline-gutter-v3dwvl, -5px));
271
+ width: calc(100% + 2 * var(--space-calendar-grid-focus-outline-gutter-v3dwvl, -5px));
272
+ height: calc(100% + 2 * var(--space-calendar-grid-focus-outline-gutter-v3dwvl, -5px));
273
+ border-radius: var(--border-radius-calendar-day-focus-ring-a8mlqd, 3px);
274
+ box-shadow: 0 0 0 2px var(--color-border-item-focused-ap3b6s, #0972d3);
275
+ }
276
+ .awsui_calendar-day_1ykar_3ngtd_157:not(#\9):focus::before {
277
+ z-index: 2;
278
+ }
279
+ .awsui_calendar-day-selected_1ykar_3ngtd_211:not(#\9) {
280
+ border-color: transparent;
281
+ position: relative;
282
+ }
283
+ .awsui_calendar-day-selected_1ykar_3ngtd_211:not(#\9)::after {
284
+ background-color: var(--color-background-dropdown-item-selected-8l4mpk, #f2f8fd);
285
+ border: var(--border-item-width-qbbbsa, 2px) solid var(--color-border-dropdown-item-selected-eahq2j, #0972d3);
286
+ border-radius: var(--border-radius-item-u2ibpi, 8px);
287
+ }
288
+ .awsui_calendar-day-selected_1ykar_3ngtd_211 > .awsui_day-inner_1ykar_3ngtd_227:not(#\9) {
289
+ color: var(--color-text-calendar-day-selected-64o9sq, #0972d3);
290
+ position: relative;
291
+ }
@@ -0,0 +1,26 @@
1
+
2
+ // es-module interop with Babel and Typescript
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ module.exports.default = {
5
+ "calendar": "awsui_calendar_1ykar_3ngtd_93",
6
+ "awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_1ykar_3ngtd_1",
7
+ "root": "awsui_root_1ykar_3ngtd_120",
8
+ "calendar-inner": "awsui_calendar-inner_1ykar_3ngtd_137",
9
+ "calendar-header": "awsui_calendar-header_1ykar_3ngtd_140",
10
+ "calendar-header-month": "awsui_calendar-header-month_1ykar_3ngtd_145",
11
+ "calendar-next-month-btn": "awsui_calendar-next-month-btn_1ykar_3ngtd_151",
12
+ "calendar-prev-month-btn": "awsui_calendar-prev-month-btn_1ykar_3ngtd_154",
13
+ "calendar-day-names": "awsui_calendar-day-names_1ykar_3ngtd_157",
14
+ "calendar-day-name": "awsui_calendar-day-name_1ykar_3ngtd_157",
15
+ "calendar-dates": "awsui_calendar-dates_1ykar_3ngtd_172",
16
+ "calendar-week": "awsui_calendar-week_1ykar_3ngtd_175",
17
+ "calendar-day": "awsui_calendar-day_1ykar_3ngtd_157",
18
+ "calendar-day-in-last-week": "awsui_calendar-day-in-last-week_1ykar_3ngtd_194",
19
+ "calendar-day-focusable": "awsui_calendar-day-focusable_1ykar_3ngtd_197",
20
+ "calendar-day-enabled": "awsui_calendar-day-enabled_1ykar_3ngtd_200",
21
+ "calendar-day-current-month": "awsui_calendar-day-current-month_1ykar_3ngtd_204",
22
+ "calendar-day-selected": "awsui_calendar-day-selected_1ykar_3ngtd_211",
23
+ "calendar-day-today": "awsui_calendar-day-today_1ykar_3ngtd_215",
24
+ "day-inner": "awsui_day-inner_1ykar_3ngtd_227"
25
+ };
26
+
@@ -1,5 +1,5 @@
1
- import { DayIndex } from '../index';
2
- import { TimeInputProps } from '../../../time-input/interfaces';
1
+ import { DayIndex } from '../internal';
2
+ import { TimeInputProps } from '../../time-input/interfaces';
3
3
  export declare function renderDayName(locale: string, dayIndex: DayIndex): string;
4
4
  export declare function renderMonthAndYear(locale: string, baseDate: Date): string;
5
5
  export declare function getDateLabel(locale: string, date: Date): string;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intl.d.ts","sourceRoot":"","sources":["../../../../src/calendar/utils/intl.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAO7D,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAIxE;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,GAAG,MAAM,CAOzE;AAMD,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,MAAM,CAc/D;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE,cAAc,CAAC,MAAM,GAAG,MAAM,CAUlG"}
@@ -1,3 +1,5 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
1
3
  function setDayIndex(date, dayIndex) {
2
4
  var diff = dayIndex - date.getDay();
3
5
  date.setDate(date.getDate() + diff);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intl.js","sourceRoot":"","sources":["../../../../src/calendar/utils/intl.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAKtC,SAAS,WAAW,CAAC,IAAU,EAAE,QAAkB;IACjD,IAAM,IAAI,GAAG,QAAQ,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;IACtC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,MAAc,EAAE,QAAkB;IAC9D,IAAM,QAAQ,GAAG,IAAI,IAAI,EAAE,CAAC;IAC5B,WAAW,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAChC,OAAO,QAAQ,CAAC,kBAAkB,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;AACnE,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,MAAc,EAAE,QAAc;IAC/D,IAAM,MAAM,GAAG,QAAQ,CAAC,kBAAkB,CAAC,MAAM,EAAE;QACjD,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,MAAM;KACd,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;EAEE;AACF,IAAM,aAAa,GAAG,IAAI,GAAG,EAAkB,CAAC;AAChD,MAAM,UAAU,YAAY,CAAC,MAAc,EAAE,IAAU;IACrD,IAAM,QAAQ,GAAG,MAAM,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;IACzC,IAAM,WAAW,GAAG,aAAa,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAChD,IAAI,WAAW,EAAE;QACf,OAAO,WAAW,CAAC;KACpB;IACD,IAAM,KAAK,GAAG,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE;QAC5C,OAAO,EAAE,MAAM;QACf,KAAK,EAAE,MAAM;QACb,GAAG,EAAE,SAAS;QACd,IAAI,EAAE,SAAS;KAChB,CAAC,CAAC;IACH,aAAa,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IACnC,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,MAAc,EAAE,IAAU,EAAE,MAA8B;IACxF,IAAI,OAAO,GAA+B,EAAE,CAAC;IAC7C,IAAI,MAAM,KAAK,IAAI,EAAE;QACnB,OAAO,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;KAC/B;IACD,IAAI,MAAM,KAAK,OAAO,EAAE;QACtB,OAAO,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;KAClD;IACD,IAAM,KAAK,GAAG,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { DayIndex } from '../internal';\nimport { TimeInputProps } from '../../time-input/interfaces';\n\nfunction setDayIndex(date: Date, dayIndex: DayIndex): void {\n const diff = dayIndex - date.getDay();\n date.setDate(date.getDate() + diff);\n}\n\nexport function renderDayName(locale: string, dayIndex: DayIndex): string {\n const tempDate = new Date();\n setDayIndex(tempDate, dayIndex);\n return tempDate.toLocaleDateString(locale, { weekday: 'short' });\n}\n\nexport function renderMonthAndYear(locale: string, baseDate: Date): string {\n const result = baseDate.toLocaleDateString(locale, {\n year: 'numeric',\n month: 'long',\n });\n\n return result;\n}\n\n/*\n `toLocaleDateString` is expensive (10+ ms) to calculate in IE11.\n*/\nconst dayLabelCache = new Map<string, string>();\nexport function getDateLabel(locale: string, date: Date): string {\n const cacheKey = locale + date.getTime();\n const cachedValue = dayLabelCache.get(cacheKey);\n if (cachedValue) {\n return cachedValue;\n }\n const value = date.toLocaleDateString(locale, {\n weekday: 'long',\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n });\n dayLabelCache.set(cacheKey, value);\n return value;\n}\n\nexport function renderTimeLabel(locale: string, date: Date, format?: TimeInputProps.Format): string {\n let options: Intl.DateTimeFormatOptions = {};\n if (format === 'hh') {\n options = { hour: '2-digit' };\n }\n if (format === 'hh:mm') {\n options = { hour: '2-digit', minute: '2-digit' };\n }\n const value = date.toLocaleTimeString(locale, options);\n return value;\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { DayIndex } from '..';
1
+ import { DayIndex } from '../internal';
2
2
  export declare function mergeLocales(locale: string, fullLocale: string): string;
3
3
  export declare function normalizeLocale(component: string, locale: string | null): string;
4
4
  export declare function normalizeStartOfWeek(startOfWeek: number | undefined, locale: string): DayIndex;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../../../../src/calendar/utils/locales.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAwBvC,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,UAM9D;AAED,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAWhF;AAED,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,EAAE,MAAM,EAAE,MAAM,YAEnF"}
@@ -1,6 +1,6 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- import { warnOnce } from '../../../internal/logging';
3
+ import { warnOnce } from '../../internal/logging';
4
4
  import { getWeekStartByLocale } from 'weekstart';
5
5
  var getHtmlElement = function () { return (typeof document !== 'undefined' ? document.querySelector('html') : null); };
6
6
  function getBrowserLocale() {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locales.js","sourceRoot":"","sources":["../../../../src/calendar/utils/locales.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAGjD,IAAM,cAAc,GAAG,cAAM,OAAA,CAAC,OAAO,QAAQ,KAAK,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAzE,CAAyE,CAAC;AAEvG,SAAS,gBAAgB;IACvB,OAAO,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC,eAAe,EAAE,CAAC,MAAM,CAAC;AAC5D,CAAC;AAED,SAAS,WAAW,CAAC,SAAiB,EAAE,MAAiC;IACvE,IAAI,CAAC,MAAM,IAAI,MAAM,KAAK,EAAE,EAAE;QAC5B,OAAO,EAAE,CAAC;KACX;IAED,uCAAuC;IACvC,MAAM,GAAG,MAAM,IAAI,MAAM,CAAC,OAAO,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACzD,6CAA6C;IAC7C,kCAAkC;IAClC,IAAI,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,wBAAwB,CAAC,EAAE;QACrD,QAAQ,CAAC,SAAS,EAAE,mCAA4B,MAAM,8BAA2B,CAAC,CAAC;QACnF,MAAM,GAAG,EAAE,CAAC;KACb;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,MAAc,EAAE,UAAkB;IAC7D,IAAM,OAAO,GAAG,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC;IACpC,IAAI,OAAO,IAAI,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;QAC/C,OAAO,UAAU,CAAC;KACnB;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,SAAiB,EAAE,MAAqB;;IACtE,MAAM,GAAG,WAAW,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IACxC,IAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;IACzC,IAAI,MAAM,EAAE;QACV,OAAO,YAAY,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;KAC5C;IACD,IAAM,UAAU,GAAG,WAAW,CAAC,SAAS,EAAE,MAAA,cAAc,EAAE,0CAAE,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;IAClF,IAAI,UAAU,EAAE;QACd,OAAO,YAAY,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;KAChD;IACD,OAAO,aAAa,CAAC;AACvB,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,WAA+B,EAAE,MAAc;IAClF,OAAO,CAAC,OAAO,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAa,CAAC;AACxG,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { warnOnce } from '../../internal/logging';\nimport { getWeekStartByLocale } from 'weekstart';\nimport { DayIndex } from '../internal';\n\nconst getHtmlElement = () => (typeof document !== 'undefined' ? document.querySelector('html') : null);\n\nfunction getBrowserLocale() {\n return new Intl.DateTimeFormat().resolvedOptions().locale;\n}\n\nfunction checkLocale(component: string, locale: string | null | undefined): string {\n if (!locale || locale === '') {\n return '';\n }\n\n // Support underscore-delimited locales\n locale = locale && locale.replace(/^([a-z]{2})_/, '$1-');\n // Check that the value matches aa-BB pattern\n // TODO: support full BCP 47 spec?\n if (locale && !locale.match(/^[a-z]{2}(-[A-Z]{2})?$/)) {\n warnOnce(component, `Invalid locale provided: ${locale}. Falling back to default`);\n locale = '';\n }\n return locale;\n}\n\nexport function mergeLocales(locale: string, fullLocale: string) {\n const isShort = locale.length === 2;\n if (isShort && fullLocale.indexOf(locale) === 0) {\n return fullLocale;\n }\n return locale;\n}\n\nexport function normalizeLocale(component: string, locale: string | null): string {\n locale = checkLocale(component, locale);\n const browserLocale = getBrowserLocale();\n if (locale) {\n return mergeLocales(locale, browserLocale);\n }\n const htmlLocale = checkLocale(component, getHtmlElement()?.getAttribute('lang'));\n if (htmlLocale) {\n return mergeLocales(htmlLocale, browserLocale);\n }\n return browserLocale;\n}\n\nexport function normalizeStartOfWeek(startOfWeek: number | undefined, locale: string) {\n return (typeof startOfWeek === 'number' ? startOfWeek % 7 : getWeekStartByLocale(locale)) as DayIndex;\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memoized-date.d.ts","sourceRoot":"","sources":["../../../../src/calendar/utils/memoized-date.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,YAAY,QAAS,MAAM,QAAQ,MAAM,GAAG,IAAI,KAAG,IAAI,GAAG,IAMtE,CAAC"}
@@ -1,6 +1,6 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- import { parseDate } from '../../../internal/utils/date-time';
3
+ import { parseDate } from '../../internal/utils/date-time';
4
4
  // reuse date instances, to allow shallow equality checking
5
5
  var memoCache = {};
6
6
  export var memoizedDate = function (key, date) {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memoized-date.js","sourceRoot":"","sources":["../../../../src/calendar/utils/memoized-date.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE3D,2DAA2D;AAC3D,IAAM,SAAS,GAAyB,EAAE,CAAC;AAC3C,MAAM,CAAC,IAAM,YAAY,GAAG,UAAC,GAAW,EAAE,IAAmB;IAC3D,IAAM,MAAM,GAAG,IAAI,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACjE,IAAI,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,MAAM,IAAI,SAAS,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,MAAM,CAAC,OAAO,EAAE,CAAC,EAAE;QAChF,SAAS,CAAC,GAAG,CAAC,GAAG,MAAc,CAAC;KACjC;IACD,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC;AACxB,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { parseDate } from '../../internal/utils/date-time';\n\n// reuse date instances, to allow shallow equality checking\nconst memoCache: Record<string, Date> = {};\nexport const memoizedDate = (key: string, date: string | null): null | Date => {\n const parsed = date && date.length >= 4 ? parseDate(date) : null;\n if (!(memoCache[key] && parsed && memoCache[key].getTime() === parsed.getTime())) {\n memoCache[key] = parsed as Date;\n }\n return memoCache[key];\n};\n"]}
@@ -1,4 +1,4 @@
1
- import { DatePickerProps } from '../../interfaces';
1
+ import { DatePickerProps } from '../../date-picker/interfaces';
2
2
  export interface MoveFocusHandler {
3
3
  (focusedDate: Date, isDateEnabled: DatePickerProps.IsDateEnabledFunction, moveHandler: (date: Date) => Date): Date;
4
4
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"move-focus-handler.d.ts","sourceRoot":"","sources":["../../../../src/calendar/utils/move-focus-handler.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,MAAM,WAAW,gBAAgB;IAC/B,CAAC,WAAW,EAAE,IAAI,EAAE,aAAa,EAAE,eAAe,CAAC,qBAAqB,EAAE,WAAW,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,GAAG,IAAI,CAAC;CACpH;AAMD,QAAA,MAAM,gBAAgB,EAAE,gBAevB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"move-focus-handler.js","sourceRoot":"","sources":["../../../../src/calendar/utils/move-focus-handler.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAO7C,uEAAuE;AACvE,8EAA8E;AAC9E,uEAAuE;AACvE,yCAAyC;AACzC,IAAM,gBAAgB,GAAqB,UAAC,QAAc,EAAE,aAAa,EAAE,YAAkC;IAC3G,IAAI,OAAO,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;IACrC,IAAI,CAAC,aAAa,EAAE;QAClB,OAAO,OAAO,CAAC;KAChB;IAED,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE;QAC9B,sDAAsD;QACtD,wDAAwD;QACxD,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,GAAG,CAAC,EAAE;YACtD,OAAO,QAAQ,CAAC;SACjB;QACD,OAAO,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;KACjC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { differenceInYears } from 'date-fns';\nimport { DatePickerProps } from '../../date-picker/interfaces';\n\nexport interface MoveFocusHandler {\n (focusedDate: Date, isDateEnabled: DatePickerProps.IsDateEnabledFunction, moveHandler: (date: Date) => Date): Date;\n}\n\n// Helper to move the focus to the given moveCallback's date. It checks\n// the availability of that date and moves forward until this date is enabled.\n// If the entire month in the requested direction has no enabled dates,\n// it returns the currently focused date.\nconst moveFocusHandler: MoveFocusHandler = (focussed: Date, isDateEnabled, moveCallback: (date: Date) => Date) => {\n let current = moveCallback(focussed);\n if (!isDateEnabled) {\n return current;\n }\n\n while (!isDateEnabled(current)) {\n // Get the first enabled date within the one year max.\n // Used when using keyboard navigation on calendar days.\n if (Math.abs(differenceInYears(focussed, current)) > 1) {\n return focussed;\n }\n current = moveCallback(current);\n }\n return current;\n};\n\nexport default moveFocusHandler;\n"]}
@@ -0,0 +1,3 @@
1
+ import { DayIndex } from '../internal';
2
+ export default function rotateDayIndexes(startOfWeek: DayIndex): DayIndex[];
3
+ //# sourceMappingURL=rotate-day-indexes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rotate-day-indexes.d.ts","sourceRoot":"","sources":["../../../../src/calendar/utils/rotate-day-indexes.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAKvC,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,WAAW,EAAE,QAAQ,GAAG,QAAQ,EAAE,CAM1E"}
@@ -1,3 +1,5 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
1
3
  var days = [0, 1, 2, 3, 4, 5, 6];
2
4
  // Given a start day of week, return an array of day indexes starting at that given day.
3
5
  export default function rotateDayIndexes(startOfWeek) {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rotate-day-indexes.js","sourceRoot":"","sources":["../../../../src/calendar/utils/rotate-day-indexes.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAItC,IAAM,IAAI,GAAe,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAE/C,wFAAwF;AACxF,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,WAAqB;IAC5D,SAAS,MAAM,CAAC,CAAW,EAAE,CAAS;QACpC,OAAO,IAAI,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;IACrC,CAAC;IAED,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAC1B,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { DayIndex } from '../internal';\n\nconst days: DayIndex[] = [0, 1, 2, 3, 4, 5, 6];\n\n// Given a start day of week, return an array of day indexes starting at that given day.\nexport default function rotateDayIndexes(startOfWeek: DayIndex): DayIndex[] {\n function mapDay(_: DayIndex, i: number): DayIndex {\n return days[(i + startOfWeek) % 7];\n }\n\n return days.map(mapDay);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/date-picker/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAElE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAsB/C,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,QAAA,MAAM,UAAU,6FA8Jf,CAAC;AAGF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/date-picker/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAElE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAuB/C,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,QAAA,MAAM,UAAU,6FA4Kf,CAAC;AAGF,eAAe,UAAU,CAAC"}
@@ -4,10 +4,10 @@ import { __assign, __rest } from "tslib";
4
4
  import clsx from 'clsx';
5
5
  import React, { useCallback, useRef, useState } from 'react';
6
6
  import styles from './styles.css.js';
7
- import Calendar from './calendar';
8
- import { normalizeLocale } from './calendar/utils/locales';
9
- import { getDateLabel } from './calendar/utils/intl';
10
- import { memoizedDate } from './calendar/utils/memoized-date';
7
+ import InternalCalendar from '../calendar/internal';
8
+ import { normalizeLocale } from '../calendar/utils/locales';
9
+ import { getDateLabel, renderMonthAndYear } from '../calendar/utils/intl';
10
+ import { memoizedDate } from '../calendar/utils/memoized-date';
11
11
  import { KeyCode } from '../internal/keycode';
12
12
  import { fireNonCancelableEvent } from '../internal/events';
13
13
  import Dropdown from '../internal/components/dropdown';
@@ -22,6 +22,7 @@ import useBaseComponent from '../internal/hooks/use-base-component';
22
22
  import { useUniqueId } from '../internal/hooks/use-unique-id';
23
23
  import { useMergeRefs } from '../internal/hooks/use-merge-refs';
24
24
  import FocusLock from '../internal/components/focus-lock';
25
+ import useFocusVisible from '../internal/hooks/focus-visible/index.js';
25
26
  var DatePicker = React.forwardRef(function (_a, ref) {
26
27
  var _b = _a.locale, locale = _b === void 0 ? '' : _b, startOfWeek = _a.startOfWeek, isDateEnabled = _a.isDateEnabled, nextMonthAriaLabel = _a.nextMonthAriaLabel, previousMonthAriaLabel = _a.previousMonthAriaLabel, todayAriaLabel = _a.todayAriaLabel, _c = _a.placeholder, placeholder = _c === void 0 ? '' : _c, _d = _a.value, value = _d === void 0 ? '' : _d, _e = _a.readOnly, readOnly = _e === void 0 ? false : _e, _f = _a.disabled, disabled = _f === void 0 ? false : _f, onBlur = _a.onBlur, _g = _a.autoFocus, autoFocus = _g === void 0 ? false : _g, onChange = _a.onChange, onFocus = _a.onFocus, name = _a.name, ariaLabel = _a.ariaLabel, ariaRequired = _a.ariaRequired, ariaLabelledby = _a.ariaLabelledby, ariaDescribedby = _a.ariaDescribedby, controlId = _a.controlId, invalid = _a.invalid, openCalendarAriaLabel = _a.openCalendarAriaLabel, expandToViewport = _a.expandToViewport, rest = __rest(_a, ["locale", "startOfWeek", "isDateEnabled", "nextMonthAriaLabel", "previousMonthAriaLabel", "todayAriaLabel", "placeholder", "value", "readOnly", "disabled", "onBlur", "autoFocus", "onChange", "onFocus", "name", "ariaLabel", "ariaRequired", "ariaLabelledby", "ariaDescribedby", "controlId", "invalid", "openCalendarAriaLabel", "expandToViewport"]);
27
28
  var __internalRootRef = useBaseComponent('DatePicker').__internalRootRef;
@@ -29,11 +30,13 @@ var DatePicker = React.forwardRef(function (_a, ref) {
29
30
  var baseProps = getBaseProps(rest);
30
31
  var _h = useState(false), isDropDownOpen = _h[0], setIsDropDownOpen = _h[1];
31
32
  var normalizedLocale = normalizeLocale('DatePicker', locale);
33
+ var focusVisible = useFocusVisible();
32
34
  var internalInputRef = useRef(null);
33
35
  var buttonRef = useRef(null);
34
36
  useForwardFocus(ref, internalInputRef);
35
37
  var rootRef = useRef(null);
36
38
  var dropdownId = useUniqueId('calender');
39
+ var calendarDescriptionId = useUniqueId('calendar-description-');
37
40
  var mergedRef = useMergeRefs(rootRef, __internalRootRef);
38
41
  useFocusTracker({ rootRef: rootRef, onBlur: onBlur, onFocus: onFocus, viewportId: expandToViewport ? dropdownId : '' });
39
42
  var onDropdownCloseHandler = useCallback(function () { return setIsDropDownOpen(false); }, [setIsDropDownOpen]);
@@ -58,6 +61,7 @@ var DatePicker = React.forwardRef(function (_a, ref) {
58
61
  }
59
62
  };
60
63
  var memoizedValue = memoizedDate('value', value);
64
+ var baseDate = memoizedValue || new Date();
61
65
  var DateInputElement = (React.createElement("div", { className: styles['date-picker-trigger'] },
62
66
  React.createElement("div", { className: styles['date-picker-input'] },
63
67
  React.createElement(InternalDateInput, { name: name, invalid: invalid, controlId: controlId, ariaLabelledby: ariaLabelledby, ariaDescribedby: ariaDescribedby, ariaLabel: ariaLabel, ariaRequired: ariaRequired, value: value, disabled: disabled, readOnly: readOnly, onChange: onInputChangeHandler, onBlur: onInputBlurHandler, placeholder: placeholder, ref: internalInputRef, autoFocus: autoFocus })),
@@ -74,12 +78,14 @@ var DatePicker = React.forwardRef(function (_a, ref) {
74
78
  };
75
79
  return (React.createElement("div", __assign({}, baseProps, { ref: mergedRef, onKeyDown: onWrapperKeyDownHandler }),
76
80
  React.createElement(Dropdown, { stretchWidth: true, stretchHeight: true, open: isDropDownOpen, onDropdownClose: onDropdownCloseHandler, onMouseDown: handleMouseDown, trigger: DateInputElement, expandToViewport: expandToViewport, scrollable: false, dropdownId: dropdownId }, isDropDownOpen && (React.createElement(FocusLock, { autoFocus: true },
77
- React.createElement(Calendar, { value: value, onChange: function (e) {
78
- var _a;
79
- fireNonCancelableEvent(onChange, e.detail);
80
- (_a = buttonRef === null || buttonRef === void 0 ? void 0 : buttonRef.current) === null || _a === void 0 ? void 0 : _a.focus();
81
- setIsDropDownOpen(false);
82
- }, locale: normalizedLocale, startOfWeek: startOfWeek, isDateEnabled: isDateEnabled, todayAriaLabel: todayAriaLabel, nextMonthAriaLabel: nextMonthAriaLabel, previousMonthAriaLabel: previousMonthAriaLabel }))))));
81
+ React.createElement("div", __assign({}, focusVisible, { tabIndex: 0, className: styles.calendar, role: "application", "aria-describedby": calendarDescriptionId }),
82
+ React.createElement(InternalCalendar, { value: value, onChange: function (e) {
83
+ var _a;
84
+ fireNonCancelableEvent(onChange, e.detail);
85
+ (_a = buttonRef === null || buttonRef === void 0 ? void 0 : buttonRef.current) === null || _a === void 0 ? void 0 : _a.focus();
86
+ setIsDropDownOpen(false);
87
+ }, locale: normalizedLocale, startOfWeek: startOfWeek, isDateEnabled: isDateEnabled, todayAriaLabel: todayAriaLabel, nextMonthAriaLabel: nextMonthAriaLabel, previousMonthAriaLabel: previousMonthAriaLabel }),
88
+ React.createElement("div", { id: calendarDescriptionId, className: styles['screenreader-only'], "aria-live": "polite" }, renderMonthAndYear(normalizedLocale, baseDate))))))));
83
89
  });
84
90
  applyDisplayName(DatePicker, 'DatePicker');
85
91
  export default DatePicker;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/date-picker/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAA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AAgB,EAAE,gBAAgB,EAClC,UAAU,EAAE,KAAK,EACjB,UAAU,EAAE,UAAU,IAErB,cAAc,IAAI,CACjB,oBAAC,SAAS,IAAC,SAAS,EAAE,IAAI;YACxB,oBAAC,QAAQ,IACP,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,UAAA,CAAC;;oBACT,sBAAsB,CAAC,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;oBAC3C,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,OAAO,0CAAE,KAAK,EAAE,CAAC;oBAC5B,iBAAiB,CAAC,KAAK,CAAC,CAAC;gBAC3B,CAAC,EACD,MAAM,EAAE,gBAAgB,EACxB,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,cAAc,EAC9B,kBAAkB,EAAE,kBAAkB,EACtC,sBAAsB,EAAE,sBAAsB,GAC9C,CACQ,CACb,CACQ,CACP,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;AAC3C,eAAe,UAAU,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { Ref, useCallback, useRef, useState } from 'react';\nimport styles from './styles.css.js';\nimport { DatePickerProps } from './interfaces';\nimport Calendar from './calendar';\nimport { normalizeLocale } from './calendar/utils/locales';\nimport { getDateLabel } from './calendar/utils/intl';\nimport { memoizedDate } from './calendar/utils/memoized-date';\nimport { InputProps } from '../input/interfaces';\nimport { KeyCode } from '../internal/keycode';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport Dropdown from '../internal/components/dropdown';\nimport InternalDateInput from '../date-input/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name.js';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport { useFocusTracker } from '../internal/hooks/use-focus-tracker.js';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport { ButtonProps } from '../button/interfaces';\nimport { InternalButton } from '../button/internal';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport FocusLock from '../internal/components/focus-lock';\n\nexport { DatePickerProps };\n\nconst DatePicker = React.forwardRef(\n (\n {\n locale = '',\n startOfWeek,\n isDateEnabled,\n nextMonthAriaLabel,\n previousMonthAriaLabel,\n todayAriaLabel,\n placeholder = '',\n value = '',\n readOnly = false,\n disabled = false,\n onBlur,\n autoFocus = false,\n onChange,\n onFocus,\n name,\n ariaLabel,\n ariaRequired,\n ariaLabelledby,\n ariaDescribedby,\n controlId,\n invalid,\n openCalendarAriaLabel,\n expandToViewport,\n ...rest\n }: DatePickerProps,\n ref: Ref<DatePickerProps.Ref>\n ) => {\n const { __internalRootRef } = useBaseComponent('DatePicker');\n checkControlled('DatePicker', 'value', value, 'onChange', onChange);\n\n const baseProps = getBaseProps(rest);\n const [isDropDownOpen, setIsDropDownOpen] = useState<boolean>(false);\n const normalizedLocale = normalizeLocale('DatePicker', locale);\n\n const internalInputRef = useRef<HTMLInputElement>(null);\n const buttonRef = useRef<ButtonProps.Ref>(null);\n useForwardFocus(ref, internalInputRef);\n\n const rootRef = useRef<HTMLDivElement>(null);\n const dropdownId = useUniqueId('calender');\n const mergedRef = useMergeRefs(rootRef, __internalRootRef);\n\n useFocusTracker({ rootRef, onBlur, onFocus, viewportId: expandToViewport ? dropdownId : '' });\n\n const onDropdownCloseHandler = useCallback(() => setIsDropDownOpen(false), [setIsDropDownOpen]);\n\n const onButtonClickHandler = () => {\n if (!isDropDownOpen) {\n setIsDropDownOpen(true);\n }\n };\n\n const onWrapperKeyDownHandler = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.keyCode === KeyCode.escape && isDropDownOpen) {\n buttonRef.current?.focus();\n setIsDropDownOpen(false);\n }\n };\n\n const onInputChangeHandler: InputProps['onChange'] = event => {\n fireNonCancelableEvent(onChange, { value: event.detail.value });\n };\n\n const onInputBlurHandler: InputProps['onBlur'] = () => {\n if (!isDropDownOpen) {\n setIsDropDownOpen(false);\n }\n };\n\n const memoizedValue = memoizedDate('value', value);\n\n const DateInputElement = (\n <div className={styles['date-picker-trigger']}>\n <div className={styles['date-picker-input']}>\n <InternalDateInput\n name={name}\n invalid={invalid}\n controlId={controlId}\n ariaLabelledby={ariaLabelledby}\n ariaDescribedby={ariaDescribedby}\n ariaLabel={ariaLabel}\n ariaRequired={ariaRequired}\n value={value}\n disabled={disabled}\n readOnly={readOnly}\n onChange={onInputChangeHandler}\n onBlur={onInputBlurHandler}\n placeholder={placeholder}\n ref={internalInputRef}\n autoFocus={autoFocus}\n />\n </div>\n <div>\n <InternalButton\n iconName=\"calendar\"\n className={styles['open-calendar-button']}\n onClick={onButtonClickHandler}\n ref={buttonRef}\n ariaLabel={\n openCalendarAriaLabel &&\n openCalendarAriaLabel(value.length === 10 ? getDateLabel(normalizedLocale, memoizedValue!) : null)\n }\n disabled={disabled || readOnly}\n formAction=\"none\"\n />\n </div>\n </div>\n );\n\n baseProps.className = clsx(baseProps.className, styles.root, styles['date-picker-container']);\n\n if (readOnly || disabled) {\n return <div {...baseProps}>{DateInputElement}</div>;\n }\n\n const handleMouseDown = (event: React.MouseEvent) => {\n // prevent currently focused element from losing it\n event.preventDefault();\n };\n\n return (\n <div {...baseProps} ref={mergedRef} onKeyDown={onWrapperKeyDownHandler}>\n <Dropdown\n stretchWidth={true}\n stretchHeight={true}\n open={isDropDownOpen}\n onDropdownClose={onDropdownCloseHandler}\n onMouseDown={handleMouseDown}\n trigger={DateInputElement}\n expandToViewport={expandToViewport}\n scrollable={false}\n dropdownId={dropdownId}\n >\n {isDropDownOpen && (\n <FocusLock autoFocus={true}>\n <Calendar\n value={value}\n onChange={e => {\n fireNonCancelableEvent(onChange, e.detail);\n buttonRef?.current?.focus();\n setIsDropDownOpen(false);\n }}\n locale={normalizedLocale}\n startOfWeek={startOfWeek}\n isDateEnabled={isDateEnabled}\n todayAriaLabel={todayAriaLabel}\n nextMonthAriaLabel={nextMonthAriaLabel}\n previousMonthAriaLabel={previousMonthAriaLabel}\n />\n </FocusLock>\n )}\n </Dropdown>\n </div>\n );\n }\n);\n\napplyDisplayName(DatePicker, 'DatePicker');\nexport default DatePicker;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/date-picker/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAO,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAClE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,OAAO,gBAAgB,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,QAAQ,MAAM,iCAAiC,CAAC;AACvD,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,eAAe,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAE9D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,gBAAgB,MAA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,EAAE,cAAc,EAC9B,kBAAkB,EAAE,kBAAkB,EACtC,sBAAsB,EAAE,sBAAsB,GAC9C;gBACF,6BAAK,EAAE,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,CAAC,mBAAmB,CAAC,eAAY,QAAQ,IACvF,kBAAkB,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAC3C,CACF,CACI,CACb,CACQ,CACP,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;AAC3C,eAAe,UAAU,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { Ref, useCallback, useRef, useState } from 'react';\nimport styles from './styles.css.js';\nimport { DatePickerProps } from './interfaces';\nimport InternalCalendar from '../calendar/internal';\nimport { normalizeLocale } from '../calendar/utils/locales';\nimport { getDateLabel, renderMonthAndYear } from '../calendar/utils/intl';\nimport { memoizedDate } from '../calendar/utils/memoized-date';\nimport { InputProps } from '../input/interfaces';\nimport { KeyCode } from '../internal/keycode';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport Dropdown from '../internal/components/dropdown';\nimport InternalDateInput from '../date-input/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name.js';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport { useFocusTracker } from '../internal/hooks/use-focus-tracker.js';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport { ButtonProps } from '../button/interfaces';\nimport { InternalButton } from '../button/internal';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport FocusLock from '../internal/components/focus-lock';\nimport useFocusVisible from '../internal/hooks/focus-visible/index.js';\n\nexport { DatePickerProps };\n\nconst DatePicker = React.forwardRef(\n (\n {\n locale = '',\n startOfWeek,\n isDateEnabled,\n nextMonthAriaLabel,\n previousMonthAriaLabel,\n todayAriaLabel,\n placeholder = '',\n value = '',\n readOnly = false,\n disabled = false,\n onBlur,\n autoFocus = false,\n onChange,\n onFocus,\n name,\n ariaLabel,\n ariaRequired,\n ariaLabelledby,\n ariaDescribedby,\n controlId,\n invalid,\n openCalendarAriaLabel,\n expandToViewport,\n ...rest\n }: DatePickerProps,\n ref: Ref<DatePickerProps.Ref>\n ) => {\n const { __internalRootRef } = useBaseComponent('DatePicker');\n checkControlled('DatePicker', 'value', value, 'onChange', onChange);\n\n const baseProps = getBaseProps(rest);\n const [isDropDownOpen, setIsDropDownOpen] = useState<boolean>(false);\n const normalizedLocale = normalizeLocale('DatePicker', locale);\n const focusVisible = useFocusVisible();\n\n const internalInputRef = useRef<HTMLInputElement>(null);\n const buttonRef = useRef<ButtonProps.Ref>(null);\n useForwardFocus(ref, internalInputRef);\n\n const rootRef = useRef<HTMLDivElement>(null);\n const dropdownId = useUniqueId('calender');\n const calendarDescriptionId = useUniqueId('calendar-description-');\n const mergedRef = useMergeRefs(rootRef, __internalRootRef);\n\n useFocusTracker({ rootRef, onBlur, onFocus, viewportId: expandToViewport ? dropdownId : '' });\n\n const onDropdownCloseHandler = useCallback(() => setIsDropDownOpen(false), [setIsDropDownOpen]);\n\n const onButtonClickHandler = () => {\n if (!isDropDownOpen) {\n setIsDropDownOpen(true);\n }\n };\n\n const onWrapperKeyDownHandler = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.keyCode === KeyCode.escape && isDropDownOpen) {\n buttonRef.current?.focus();\n setIsDropDownOpen(false);\n }\n };\n\n const onInputChangeHandler: InputProps['onChange'] = event => {\n fireNonCancelableEvent(onChange, { value: event.detail.value });\n };\n\n const onInputBlurHandler: InputProps['onBlur'] = () => {\n if (!isDropDownOpen) {\n setIsDropDownOpen(false);\n }\n };\n\n const memoizedValue = memoizedDate('value', value);\n const baseDate = memoizedValue || new Date();\n\n const DateInputElement = (\n <div className={styles['date-picker-trigger']}>\n <div className={styles['date-picker-input']}>\n <InternalDateInput\n name={name}\n invalid={invalid}\n controlId={controlId}\n ariaLabelledby={ariaLabelledby}\n ariaDescribedby={ariaDescribedby}\n ariaLabel={ariaLabel}\n ariaRequired={ariaRequired}\n value={value}\n disabled={disabled}\n readOnly={readOnly}\n onChange={onInputChangeHandler}\n onBlur={onInputBlurHandler}\n placeholder={placeholder}\n ref={internalInputRef}\n autoFocus={autoFocus}\n />\n </div>\n <div>\n <InternalButton\n iconName=\"calendar\"\n className={styles['open-calendar-button']}\n onClick={onButtonClickHandler}\n ref={buttonRef}\n ariaLabel={\n openCalendarAriaLabel &&\n openCalendarAriaLabel(value.length === 10 ? getDateLabel(normalizedLocale, memoizedValue!) : null)\n }\n disabled={disabled || readOnly}\n formAction=\"none\"\n />\n </div>\n </div>\n );\n\n baseProps.className = clsx(baseProps.className, styles.root, styles['date-picker-container']);\n\n if (readOnly || disabled) {\n return <div {...baseProps}>{DateInputElement}</div>;\n }\n\n const handleMouseDown = (event: React.MouseEvent) => {\n // prevent currently focused element from losing it\n event.preventDefault();\n };\n\n return (\n <div {...baseProps} ref={mergedRef} onKeyDown={onWrapperKeyDownHandler}>\n <Dropdown\n stretchWidth={true}\n stretchHeight={true}\n open={isDropDownOpen}\n onDropdownClose={onDropdownCloseHandler}\n onMouseDown={handleMouseDown}\n trigger={DateInputElement}\n expandToViewport={expandToViewport}\n scrollable={false}\n dropdownId={dropdownId}\n >\n {isDropDownOpen && (\n <FocusLock autoFocus={true}>\n <div\n {...focusVisible}\n tabIndex={0}\n className={styles.calendar}\n role=\"application\"\n aria-describedby={calendarDescriptionId}\n >\n <InternalCalendar\n value={value}\n onChange={e => {\n fireNonCancelableEvent(onChange, e.detail);\n buttonRef?.current?.focus();\n setIsDropDownOpen(false);\n }}\n locale={normalizedLocale}\n startOfWeek={startOfWeek}\n isDateEnabled={isDateEnabled}\n todayAriaLabel={todayAriaLabel}\n nextMonthAriaLabel={nextMonthAriaLabel}\n previousMonthAriaLabel={previousMonthAriaLabel}\n />\n <div id={calendarDescriptionId} className={styles['screenreader-only']} aria-live=\"polite\">\n {renderMonthAndYear(normalizedLocale, baseDate)}\n </div>\n </div>\n </FocusLock>\n )}\n </Dropdown>\n </div>\n );\n }\n);\n\napplyDisplayName(DatePicker, 'DatePicker');\nexport default DatePicker;\n"]}
@@ -2,50 +2,8 @@ import { BaseComponentProps } from '../internal/base-component';
2
2
  import { FormFieldValidationControlProps } from '../internal/context/form-field-context';
3
3
  import { ExpandToViewport } from '../internal/components/dropdown/interfaces';
4
4
  import { NonCancelableEventHandler } from '../internal/events';
5
- export interface DatePickerBaseProps {
6
- /**
7
- * The current input value, in YYYY-MM-DD format.
8
- */
9
- value: string;
10
- /**
11
- * Defines whether a particular date is enabled in the calendar or not.
12
- * If you disable a date in the calendar, users can still enter this date using a keyboard.
13
- * We recommend that you also validate these constraints on the client-side and server-side
14
- * as you would for other form elements.
15
- * @param date
16
- */
17
- isDateEnabled?: DatePickerProps.IsDateEnabledFunction;
18
- /**
19
- * Specifies the locale to use to render month names and determine the starting day of the week.
20
- * If you don't provide this, the locale is determined by the page and browser locales.
21
- * Supported values and formats are listed in the
22
- * [JavaScript Intl API specification](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation).
23
- */
24
- locale?: string;
25
- /**
26
- * Determines the starting day of the week. The values 0-6 map to Sunday-Saturday.
27
- * By default the starting day of the week is defined by the locale, but you can use this property to override it.
28
- */
29
- startOfWeek?: number;
30
- /**
31
- * Used as part of the `aria-label` for today's date in the calendar.
32
- */
33
- todayAriaLabel: string;
34
- /**
35
- * Specifies an `aria-label` for the 'next month' button.
36
- */
37
- nextMonthAriaLabel: string;
38
- /**
39
- * Specifies an `aria-label` for the 'previous month' button.
40
- */
41
- previousMonthAriaLabel: string;
42
- /**
43
- * Called whenever a user changes the input value (by typing, pasting, or selecting a value).
44
- * The event `detail` contains the current value of the field.
45
- */
46
- onChange?: NonCancelableEventHandler<DatePickerProps.ChangeDetail>;
47
- }
48
- export interface DatePickerProps extends BaseComponentProps, FormFieldValidationControlProps, ExpandToViewport, DatePickerBaseProps {
5
+ import { CalendarProps } from '../calendar/interfaces';
6
+ export interface DatePickerProps extends BaseComponentProps, FormFieldValidationControlProps, ExpandToViewport, CalendarProps {
49
7
  /**
50
8
  * Specifies the placeholder text rendered when the value is an empty string.
51
9
  */