@cloudscape-design/components-themeable 3.0.56 → 3.0.58

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 (117) hide show
  1. package/lib/internal/scss/{date-picker → calendar}/motion.scss +0 -0
  2. package/lib/internal/scss/calendar/styles.scss +170 -0
  3. package/lib/internal/scss/date-picker/styles.scss +13 -163
  4. package/lib/internal/template/{date-picker/calendar → calendar}/grid/day/index.d.ts +1 -1
  5. package/lib/internal/template/calendar/grid/day/index.d.ts.map +1 -0
  6. package/lib/internal/template/{date-picker/calendar → calendar}/grid/day/index.js +1 -1
  7. package/lib/internal/template/calendar/grid/day/index.js.map +1 -0
  8. package/lib/internal/template/{date-picker/calendar → calendar}/grid/index.d.ts +2 -2
  9. package/lib/internal/template/calendar/grid/index.d.ts.map +1 -0
  10. package/lib/internal/template/{date-picker/calendar → calendar}/grid/index.js +2 -2
  11. package/lib/internal/template/calendar/grid/index.js.map +1 -0
  12. package/lib/internal/template/{date-picker/calendar → calendar}/header/button/index.d.ts +0 -0
  13. package/lib/internal/template/calendar/header/button/index.d.ts.map +1 -0
  14. package/lib/internal/template/{date-picker/calendar → calendar}/header/button/index.js +2 -2
  15. package/lib/internal/template/calendar/header/button/index.js.map +1 -0
  16. package/lib/internal/template/{date-picker/calendar → calendar}/header/index.d.ts +1 -2
  17. package/lib/internal/template/calendar/header/index.d.ts.map +1 -0
  18. package/lib/internal/template/{date-picker/calendar → calendar}/header/index.js +3 -3
  19. package/lib/internal/template/calendar/header/index.js.map +1 -0
  20. package/lib/internal/template/calendar/index.d.ts +4 -0
  21. package/lib/internal/template/calendar/index.d.ts.map +1 -0
  22. package/lib/internal/template/calendar/index.js +14 -0
  23. package/lib/internal/template/calendar/index.js.map +1 -0
  24. package/lib/internal/template/calendar/interfaces.d.ts +56 -0
  25. package/lib/internal/template/calendar/interfaces.d.ts.map +1 -0
  26. package/lib/internal/template/calendar/interfaces.js +4 -0
  27. package/lib/internal/template/calendar/interfaces.js.map +1 -0
  28. package/lib/internal/template/calendar/internal.d.ts +4 -0
  29. package/lib/internal/template/calendar/internal.d.ts.map +1 -0
  30. package/lib/internal/template/{date-picker/calendar/index.js → calendar/internal.js} +9 -13
  31. package/lib/internal/template/calendar/internal.js.map +1 -0
  32. package/lib/internal/template/calendar/styles.css.js +25 -0
  33. package/lib/internal/template/calendar/styles.scoped.css +291 -0
  34. package/lib/internal/template/calendar/styles.selectors.js +26 -0
  35. package/lib/internal/template/{date-picker/calendar → calendar}/utils/intl.d.ts +2 -2
  36. package/lib/internal/template/calendar/utils/intl.d.ts.map +1 -0
  37. package/lib/internal/template/{date-picker/calendar → calendar}/utils/intl.js +2 -0
  38. package/lib/internal/template/calendar/utils/intl.js.map +1 -0
  39. package/lib/internal/template/{date-picker/calendar → calendar}/utils/locales.d.ts +1 -1
  40. package/lib/internal/template/calendar/utils/locales.d.ts.map +1 -0
  41. package/lib/internal/template/{date-picker/calendar → calendar}/utils/locales.js +1 -1
  42. package/lib/internal/template/calendar/utils/locales.js.map +1 -0
  43. package/lib/internal/template/{date-picker/calendar → calendar}/utils/memoized-date.d.ts +0 -0
  44. package/lib/internal/template/calendar/utils/memoized-date.d.ts.map +1 -0
  45. package/lib/internal/template/{date-picker/calendar → calendar}/utils/memoized-date.js +1 -1
  46. package/lib/internal/template/calendar/utils/memoized-date.js.map +1 -0
  47. package/lib/internal/template/{date-picker/calendar → calendar}/utils/move-focus-handler.d.ts +1 -1
  48. package/lib/internal/template/calendar/utils/move-focus-handler.d.ts.map +1 -0
  49. package/lib/internal/template/{date-picker/calendar → calendar}/utils/move-focus-handler.js +0 -0
  50. package/lib/internal/template/calendar/utils/move-focus-handler.js.map +1 -0
  51. package/lib/internal/template/calendar/utils/rotate-day-indexes.d.ts +3 -0
  52. package/lib/internal/template/calendar/utils/rotate-day-indexes.d.ts.map +1 -0
  53. package/lib/internal/template/{date-picker/calendar → calendar}/utils/rotate-day-indexes.js +2 -0
  54. package/lib/internal/template/calendar/utils/rotate-day-indexes.js.map +1 -0
  55. package/lib/internal/template/date-picker/index.d.ts.map +1 -1
  56. package/lib/internal/template/date-picker/index.js +16 -10
  57. package/lib/internal/template/date-picker/index.js.map +1 -1
  58. package/lib/internal/template/date-picker/interfaces.d.ts +2 -44
  59. package/lib/internal/template/date-picker/interfaces.d.ts.map +1 -1
  60. package/lib/internal/template/date-picker/interfaces.js.map +1 -1
  61. package/lib/internal/template/date-picker/styles.css.js +7 -24
  62. package/lib/internal/template/date-picker/styles.scoped.css +21 -210
  63. package/lib/internal/template/date-picker/styles.selectors.js +7 -24
  64. package/lib/internal/template/date-range-picker/calendar/get-base-date.js +1 -1
  65. package/lib/internal/template/date-range-picker/calendar/get-base-date.js.map +1 -1
  66. package/lib/internal/template/date-range-picker/calendar/grids/day/index.js +1 -1
  67. package/lib/internal/template/date-range-picker/calendar/grids/day/index.js.map +1 -1
  68. package/lib/internal/template/date-range-picker/calendar/grids/grid.js +2 -2
  69. package/lib/internal/template/date-range-picker/calendar/grids/grid.js.map +1 -1
  70. package/lib/internal/template/date-range-picker/calendar/grids/index.d.ts +1 -1
  71. package/lib/internal/template/date-range-picker/calendar/grids/index.d.ts.map +1 -1
  72. package/lib/internal/template/date-range-picker/calendar/grids/index.js.map +1 -1
  73. package/lib/internal/template/date-range-picker/calendar/header/index.js +1 -1
  74. package/lib/internal/template/date-range-picker/calendar/header/index.js.map +1 -1
  75. package/lib/internal/template/date-range-picker/calendar/index.js +3 -3
  76. package/lib/internal/template/date-range-picker/calendar/index.js.map +1 -1
  77. package/lib/internal/template/date-range-picker/index.js +1 -1
  78. package/lib/internal/template/date-range-picker/index.js.map +1 -1
  79. package/lib/internal/template/input/internal.js +1 -1
  80. package/lib/internal/template/input/internal.js.map +1 -1
  81. package/lib/internal/template/internal/environment.js +1 -1
  82. package/lib/internal/template/test-utils/dom/calendar/index.d.ts +16 -0
  83. package/lib/internal/template/test-utils/dom/calendar/index.js +53 -0
  84. package/lib/internal/template/test-utils/dom/calendar/index.js.map +1 -0
  85. package/lib/internal/template/test-utils/dom/date-picker/index.d.ts +2 -14
  86. package/lib/internal/template/test-utils/dom/date-picker/index.js +4 -33
  87. package/lib/internal/template/test-utils/dom/date-picker/index.js.map +1 -1
  88. package/lib/internal/template/test-utils/selectors/calendar/index.d.ts +16 -0
  89. package/lib/internal/template/test-utils/selectors/calendar/index.js +53 -0
  90. package/lib/internal/template/test-utils/selectors/calendar/index.js.map +1 -0
  91. package/lib/internal/template/test-utils/selectors/date-picker/index.d.ts +2 -14
  92. package/lib/internal/template/test-utils/selectors/date-picker/index.js +2 -31
  93. package/lib/internal/template/test-utils/selectors/date-picker/index.js.map +1 -1
  94. package/lib/internal/template/test-utils/tsconfig.tsbuildinfo +1 -1
  95. package/package.json +1 -1
  96. package/lib/internal/template/date-picker/calendar/grid/day/index.d.ts.map +0 -1
  97. package/lib/internal/template/date-picker/calendar/grid/day/index.js.map +0 -1
  98. package/lib/internal/template/date-picker/calendar/grid/index.d.ts.map +0 -1
  99. package/lib/internal/template/date-picker/calendar/grid/index.js.map +0 -1
  100. package/lib/internal/template/date-picker/calendar/header/button/index.d.ts.map +0 -1
  101. package/lib/internal/template/date-picker/calendar/header/button/index.js.map +0 -1
  102. package/lib/internal/template/date-picker/calendar/header/index.d.ts.map +0 -1
  103. package/lib/internal/template/date-picker/calendar/header/index.js.map +0 -1
  104. package/lib/internal/template/date-picker/calendar/index.d.ts +0 -17
  105. package/lib/internal/template/date-picker/calendar/index.d.ts.map +0 -1
  106. package/lib/internal/template/date-picker/calendar/index.js.map +0 -1
  107. package/lib/internal/template/date-picker/calendar/utils/intl.d.ts.map +0 -1
  108. package/lib/internal/template/date-picker/calendar/utils/intl.js.map +0 -1
  109. package/lib/internal/template/date-picker/calendar/utils/locales.d.ts.map +0 -1
  110. package/lib/internal/template/date-picker/calendar/utils/locales.js.map +0 -1
  111. package/lib/internal/template/date-picker/calendar/utils/memoized-date.d.ts.map +0 -1
  112. package/lib/internal/template/date-picker/calendar/utils/memoized-date.js.map +0 -1
  113. package/lib/internal/template/date-picker/calendar/utils/move-focus-handler.d.ts.map +0 -1
  114. package/lib/internal/template/date-picker/calendar/utils/move-focus-handler.js.map +0 -1
  115. package/lib/internal/template/date-picker/calendar/utils/rotate-day-indexes.d.ts +0 -3
  116. package/lib/internal/template/date-picker/calendar/utils/rotate-day-indexes.d.ts.map +0 -1
  117. package/lib/internal/template/date-picker/calendar/utils/rotate-day-indexes.js.map +0 -1
@@ -0,0 +1,170 @@
1
+ /*
2
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ SPDX-License-Identifier: Apache-2.0
4
+ */
5
+
6
+ @use '../internal/styles/index' as styles;
7
+ @use '../internal/styles/tokens' as awsui;
8
+ @use '../internal/hooks/focus-visible' as focus-visible;
9
+ @use '../internal/styles/typography/index' as typographyConstants;
10
+ @use './motion';
11
+
12
+ $calendar-header-color: awsui.$color-text-dropdown-item-default;
13
+ $calendar-grid-border-color: awsui.$color-border-calendar-grid;
14
+ $calendar-grid-day-color: awsui.$color-text-dropdown-item-default;
15
+ $calendar-grid-day-name-color: awsui.$color-text-calendar-month;
16
+ $calendar-grid-disabled-day-color: awsui.$color-text-dropdown-item-disabled;
17
+ $calendar-grid-nonmonth-day-color: awsui.$color-text-dropdown-item-secondary;
18
+ $calendar-grid-hover-background-color: awsui.$color-background-dropdown-item-hover;
19
+ $calendar-grid-hover-border-color: awsui.$color-border-dropdown-item-hover;
20
+ $calendar-grid-today-background-color: awsui.$color-background-calendar-today;
21
+ $calendar-grid-selected-background-color: awsui.$color-background-dropdown-item-selected;
22
+ $calendar-grid-selected-border-color: awsui.$color-border-dropdown-item-selected;
23
+ $calendar-grid-border: 1px solid $calendar-grid-border-color;
24
+
25
+ .root {
26
+ /* used in test-utils */
27
+ }
28
+
29
+ .calendar {
30
+ display: block;
31
+ // IE11 does not calculate the height correctly when in nested flex containers (@see https://github.com/philipwalton/flexbugs#flexbug-3)
32
+ width: 234px;
33
+ overflow: auto;
34
+
35
+ &-inner {
36
+ margin: awsui.$space-xs;
37
+ }
38
+
39
+ &-header {
40
+ display: flex;
41
+ justify-content: space-between;
42
+ align-items: center;
43
+ }
44
+
45
+ &-header-month {
46
+ @include styles.font-body-m;
47
+ font-weight: typographyConstants.$font-weight-bold;
48
+ color: $calendar-header-color;
49
+ }
50
+
51
+ &-next-month-btn {
52
+ /* used for identifying element */
53
+ }
54
+
55
+ &-prev-month-btn {
56
+ /* used for identifying element */
57
+ }
58
+
59
+ &-day-names {
60
+ display: flex;
61
+ justify-content: stretch;
62
+ }
63
+
64
+ &-day-name {
65
+ flex: 1 1 0%;
66
+ width: 0;
67
+ word-break: break-word;
68
+ text-align: center;
69
+ padding: awsui.$space-s 0 awsui.$space-xxs;
70
+ color: $calendar-grid-day-name-color;
71
+ @include styles.font-body-s;
72
+ }
73
+
74
+ &-dates {
75
+ border: $calendar-grid-border;
76
+ }
77
+ &-week {
78
+ display: flex;
79
+ justify-content: stretch;
80
+ }
81
+
82
+ &-day {
83
+ flex: 1 1 0%;
84
+ width: 0;
85
+ word-break: break-word;
86
+ text-align: center;
87
+ border-bottom: $calendar-grid-border;
88
+ border-right: $calendar-grid-border;
89
+ border-radius: awsui.$border-radius-item;
90
+ padding: awsui.$space-xxs 0;
91
+ color: $calendar-grid-disabled-day-color;
92
+ position: relative;
93
+
94
+ &:last-child {
95
+ border-right: none;
96
+ }
97
+
98
+ &-in-last-week {
99
+ border-bottom: none;
100
+ }
101
+
102
+ &-focusable {
103
+ /* used for identifying element */
104
+ }
105
+
106
+ &-enabled {
107
+ cursor: pointer;
108
+ color: $calendar-grid-nonmonth-day-color;
109
+
110
+ &.calendar-day-current-month {
111
+ color: $calendar-grid-day-color;
112
+ &:hover {
113
+ color: awsui.$color-text-calendar-day-hover;
114
+ background-color: $calendar-grid-hover-background-color;
115
+ &:not(.calendar-day-selected) {
116
+ &::after {
117
+ border: awsui.$border-item-width solid $calendar-grid-hover-border-color;
118
+ border-radius: awsui.$border-radius-item;
119
+ }
120
+ }
121
+ }
122
+ }
123
+ }
124
+
125
+ &-today {
126
+ background-color: $calendar-grid-today-background-color;
127
+ }
128
+
129
+ &::after {
130
+ content: '';
131
+ position: absolute;
132
+ top: -1px;
133
+ left: -1px;
134
+ bottom: -1px;
135
+ right: -1px;
136
+ background-color: transparent;
137
+ }
138
+ > .day-inner {
139
+ position: relative;
140
+ z-index: 1;
141
+ }
142
+
143
+ &:focus {
144
+ outline: none;
145
+ @include styles.focus-highlight(
146
+ awsui.$space-calendar-grid-focus-outline-gutter,
147
+ awsui.$border-radius-calendar-day-focus-ring
148
+ );
149
+ &::before {
150
+ z-index: 2;
151
+ }
152
+ }
153
+
154
+ &-selected {
155
+ border-color: transparent;
156
+ position: relative;
157
+ &::after {
158
+ background-color: $calendar-grid-selected-background-color;
159
+ border: awsui.$border-item-width solid $calendar-grid-selected-border-color;
160
+ border-radius: awsui.$border-radius-item;
161
+ }
162
+ > .day-inner {
163
+ color: awsui.$color-text-calendar-day-selected;
164
+ position: relative;
165
+ }
166
+ }
167
+ }
168
+
169
+ @include styles.styles-reset;
170
+ }
@@ -7,25 +7,24 @@
7
7
  @use '../internal/styles/tokens' as awsui;
8
8
  @use '../internal/hooks/focus-visible' as focus-visible;
9
9
  @use '../internal/styles/typography/index' as typographyConstants;
10
- @use './motion';
11
-
12
- $calendar-header-color: awsui.$color-text-dropdown-item-default;
13
- $calendar-grid-border-color: awsui.$color-border-calendar-grid;
14
- $calendar-grid-day-color: awsui.$color-text-dropdown-item-default;
15
- $calendar-grid-day-name-color: awsui.$color-text-calendar-month;
16
- $calendar-grid-disabled-day-color: awsui.$color-text-dropdown-item-disabled;
17
- $calendar-grid-nonmonth-day-color: awsui.$color-text-dropdown-item-secondary;
18
- $calendar-grid-hover-background-color: awsui.$color-background-dropdown-item-hover;
19
- $calendar-grid-hover-border-color: awsui.$color-border-dropdown-item-hover;
20
- $calendar-grid-today-background-color: awsui.$color-background-calendar-today;
21
- $calendar-grid-selected-background-color: awsui.$color-background-dropdown-item-selected;
22
- $calendar-grid-selected-border-color: awsui.$color-border-dropdown-item-selected;
23
- $calendar-grid-border: 1px solid $calendar-grid-border-color;
24
10
 
25
11
  .root {
26
12
  @include styles.styles-reset;
27
13
  }
28
14
 
15
+ .calendar {
16
+ &:focus {
17
+ outline: none;
18
+ }
19
+ @include focus-visible.when-visible {
20
+ @include styles.container-focus(awsui.$border-radius-dropdown);
21
+ }
22
+ }
23
+
24
+ .screenreader-only {
25
+ @include styles.awsui-util-hide;
26
+ }
27
+
29
28
  .date-picker-container {
30
29
  position: relative;
31
30
  max-width: 234px;
@@ -43,152 +42,3 @@ $calendar-grid-border: 1px solid $calendar-grid-border-color;
43
42
  .open-calendar-button {
44
43
  /* used in test-utils */
45
44
  }
46
-
47
- .calendar {
48
- display: block;
49
- // IE11 does not calculate the height correctly when in nested flex containers (@see https://github.com/philipwalton/flexbugs#flexbug-3)
50
- width: 234px;
51
- overflow: auto;
52
- &:focus {
53
- outline: none;
54
- }
55
-
56
- &-inner {
57
- margin: awsui.$space-xs;
58
- }
59
-
60
- &-header {
61
- display: flex;
62
- justify-content: space-between;
63
- align-items: center;
64
- }
65
-
66
- &-header-month {
67
- @include styles.font-body-m;
68
- font-weight: typographyConstants.$font-weight-bold;
69
- color: $calendar-header-color;
70
- }
71
-
72
- &-next-month-btn {
73
- /* used for identifying element */
74
- }
75
-
76
- &-prev-month-btn {
77
- /* used for identifying element */
78
- }
79
-
80
- &-day-names {
81
- display: flex;
82
- justify-content: stretch;
83
- }
84
-
85
- &-day-name {
86
- flex: 1 1 0%;
87
- width: 0;
88
- word-break: break-word;
89
- text-align: center;
90
- padding: awsui.$space-s 0 awsui.$space-xxs;
91
- color: $calendar-grid-day-name-color;
92
- @include styles.font-body-s;
93
- }
94
-
95
- &-dates {
96
- border: $calendar-grid-border;
97
- }
98
- &-week {
99
- display: flex;
100
- justify-content: stretch;
101
- }
102
-
103
- &-day {
104
- flex: 1 1 0%;
105
- width: 0;
106
- word-break: break-word;
107
- text-align: center;
108
- border-bottom: $calendar-grid-border;
109
- border-right: $calendar-grid-border;
110
- border-radius: awsui.$border-radius-item;
111
- padding: awsui.$space-xxs 0;
112
- color: $calendar-grid-disabled-day-color;
113
- position: relative;
114
-
115
- &:last-child {
116
- border-right: none;
117
- }
118
-
119
- &-in-last-week {
120
- border-bottom: none;
121
- }
122
-
123
- &-focusable {
124
- /* used for identifying element */
125
- }
126
-
127
- &-enabled {
128
- cursor: pointer;
129
- color: $calendar-grid-nonmonth-day-color;
130
-
131
- &.calendar-day-current-month {
132
- color: $calendar-grid-day-color;
133
- &:hover {
134
- color: awsui.$color-text-calendar-day-hover;
135
- background-color: $calendar-grid-hover-background-color;
136
- &:not(.calendar-day-selected) {
137
- &::after {
138
- border: awsui.$border-item-width solid $calendar-grid-hover-border-color;
139
- border-radius: awsui.$border-radius-item;
140
- }
141
- }
142
- }
143
- }
144
- }
145
-
146
- &-today {
147
- background-color: $calendar-grid-today-background-color;
148
- }
149
-
150
- &::after {
151
- content: '';
152
- position: absolute;
153
- top: -1px;
154
- left: -1px;
155
- bottom: -1px;
156
- right: -1px;
157
- background-color: transparent;
158
- }
159
- > .day-inner {
160
- position: relative;
161
- z-index: 1;
162
- }
163
-
164
- &:focus {
165
- outline: none;
166
- @include styles.focus-highlight(
167
- awsui.$space-calendar-grid-focus-outline-gutter,
168
- awsui.$border-radius-calendar-day-focus-ring
169
- );
170
- &::before {
171
- z-index: 2;
172
- }
173
- }
174
-
175
- &-selected {
176
- border-color: transparent;
177
- position: relative;
178
- &::after {
179
- background-color: $calendar-grid-selected-background-color;
180
- border: awsui.$border-item-width solid $calendar-grid-selected-border-color;
181
- border-radius: awsui.$border-radius-item;
182
- }
183
- > .day-inner {
184
- color: awsui.$color-text-calendar-day-selected;
185
- position: relative;
186
- }
187
- }
188
- }
189
-
190
- @include styles.styles-reset;
191
- @include focus-visible.when-visible {
192
- @include styles.container-focus(awsui.$border-radius-dropdown);
193
- }
194
- }
@@ -1,4 +1,4 @@
1
- import { DatePickerProps } from '../../../interfaces';
1
+ import { DatePickerProps } from '../../../date-picker/interfaces';
2
2
  interface GridDayProps {
3
3
  locale: string;
4
4
  baseDate: Date;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/calendar/grid/day/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAKlE,UAAU,YAAY;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,IAAI,CAAC;IACf,IAAI,EAAE,IAAI,CAAC;IACX,YAAY,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAC3B,WAAW,EAAE,IAAI,GAAG,IAAI,CAAC;IACzB,aAAa,CAAC,EAAE,eAAe,CAAC,qBAAqB,CAAC;IACtD,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACnC,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED,QAAA,MAAM,OAAO,0HAUV,YAAY,gBAwCd,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -2,7 +2,7 @@ import { __assign } from "tslib";
2
2
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  import React from 'react';
5
- import styles from '../../../styles.css.js';
5
+ import styles from '../../styles.css.js';
6
6
  import { isSameDay, isSameMonth } from 'date-fns';
7
7
  import { getDateLabel } from '../../utils/intl';
8
8
  import clsx from 'clsx';
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/calendar/grid/day/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAE,WA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B,CAAC,cAAc,CAAC,GAAG,MAAM,CAAC;KAC7C;IAED,IAAI,eAAe,EAAE;QACnB,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;KAC7B;IAED,IAAI,SAAS,EAAE;QACb,kBAAkB,CAAC,OAAO,GAAG,cAAM,OAAA,YAAY,CAAC,IAAI,CAAC,EAAlB,CAAkB,CAAC;QACtD,kBAAkB,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC;KAClC;SAAM;QACL,kBAAkB,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC;KAC5C;IAED,IAAI,WAAW,IAAI,SAAS,EAAE;QAC5B,kBAAkB,CAAC,QAAQ,GAAG,CAAC,CAAC;KACjC;IAED,OAAO,CACL,sCAAK,SAAS,EAAE,UAAU,gBAAc,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAC,QAAQ,IAAK,kBAAkB;QAC7F,8BAAM,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,IAAG,IAAI,CAAC,OAAO,EAAE,CAAQ,CACzD,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,OAAO,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport styles from '../../styles.css.js';\nimport { DatePickerProps } from '../../../date-picker/interfaces';\nimport { isSameDay, isSameMonth } from 'date-fns';\nimport { getDateLabel } from '../../utils/intl';\nimport clsx from 'clsx';\n\ninterface GridDayProps {\n locale: string;\n baseDate: Date;\n date: Date;\n selectedDate?: Date | null;\n focusedDate: Date | null;\n isDateEnabled?: DatePickerProps.IsDateEnabledFunction;\n todayAriaLabel: string;\n onSelectDate: (date: Date) => void;\n isDateInLastWeek: boolean;\n}\n\nconst GridDay = ({\n locale,\n baseDate,\n date,\n selectedDate,\n focusedDate,\n isDateEnabled,\n todayAriaLabel,\n onSelectDate,\n isDateInLastWeek,\n}: GridDayProps) => {\n const labels = [getDateLabel(locale, date)];\n const isFocusable = !!focusedDate && isSameDay(date, focusedDate);\n const isSelected = !!selectedDate && isSameDay(date, selectedDate);\n const isEnabled = !isDateEnabled || isDateEnabled(date);\n const isDateOnSameDay = isSameDay(date, new Date());\n const computedAttributes: React.HTMLAttributes<HTMLDivElement> = {};\n const classNames = clsx(styles['calendar-day'], {\n [styles['calendar-day-in-last-week']]: isDateInLastWeek,\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 [styles['calendar-day-focusable']]: isFocusable && isEnabled,\n });\n\n if (isSelected) {\n computedAttributes['aria-current'] = 'date';\n }\n\n if (isDateOnSameDay) {\n labels.push(todayAriaLabel);\n }\n\n if (isEnabled) {\n computedAttributes.onClick = () => onSelectDate(date);\n computedAttributes.tabIndex = -1;\n } else {\n computedAttributes['aria-disabled'] = true;\n }\n\n if (isFocusable && isEnabled) {\n computedAttributes.tabIndex = 0;\n }\n\n return (\n <div className={classNames} aria-label={labels.join('. ')} role=\"button\" {...computedAttributes}>\n <span className={styles['day-inner']}>{date.getDate()}</span>\n </div>\n );\n};\n\nexport default GridDay;\n"]}
@@ -1,6 +1,6 @@
1
- import { DayIndex } from '../index';
1
+ import { DayIndex } from '../internal';
2
2
  import { MoveFocusHandler } from '../utils/move-focus-handler';
3
- import { DatePickerProps } from '../../interfaces';
3
+ import { DatePickerProps } from '../../date-picker/interfaces';
4
4
  export interface GridProps {
5
5
  locale: string;
6
6
  baseDate: Date;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/calendar/grid/index.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAI/D,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,IAAI,CAAC;IACf,aAAa,EAAE,eAAe,CAAC,qBAAqB,CAAC;IACrD,WAAW,EAAE,IAAI,GAAG,IAAI,CAAC;IACzB,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACnC,WAAW,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAC;IACzC,aAAa,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACpC,WAAW,EAAE,QAAQ,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,IAAI,GAAG,IAAI,CAAC;IAC1B,eAAe,EAAE,gBAAgB,CAAC;CACnC;AAED,QAAA,MAAM,IAAI,4JAYP,SAAS,gBAoFX,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -1,9 +1,9 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import React, { useMemo } from 'react';
4
- import styles from '../../styles.css.js';
4
+ import styles from '../styles.css.js';
5
5
  import GridDay from './day';
6
- import { KeyCode } from '../../../internal/keycode';
6
+ import { KeyCode } from '../../internal/keycode';
7
7
  import { addDays, addWeeks, isSameMonth } from 'date-fns';
8
8
  import { getCalendarMonth } from 'mnth';
9
9
  import rotateDayIndexes from '../utils/rotate-day-indexes';
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/calendar/grid/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,OAAO,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,wBA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B,IACtE,KAAK,CAAC,GAAG,CAAC,UAAC,IAAI,EAAE,SAAS;YACzB,IAAM,gBAAgB,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,KAAK,SAAS,CAAC;YAExD,OAAO,CACL,6BAAK,GAAG,EAAE,eAAQ,SAAS,CAAE,EAAE,SAAS,EAAE,MAAM,CAAC,eAAe,CAAC,IAC9D,IAAI,CAAC,GAAG,CAAC,UAAC,IAAI,EAAE,SAAS;gBACxB,OAAO,CACL,oBAAC,OAAO,IACN,GAAG,EAAE,eAAQ,SAAS,cAAI,SAAS,CAAE,EACrC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,WAAW,EACxB,cAAc,EAAE,cAAc,EAC9B,YAAY,EAAE,UAAA,IAAI,IAAI,OAAA,YAAY,CAAC,IAAI,CAAC,EAAlB,CAAkB,EACxC,aAAa,EAAE,aAAa,EAC5B,gBAAgB,EAAE,gBAAgB,GAClC,CACH,CAAC;YACJ,CAAC,CAAC,CACE,CACP,CAAC;QACJ,CAAC,CAAC,CACE,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useMemo } from 'react';\nimport styles from '../styles.css.js';\nimport GridDay from './day';\nimport { KeyCode } from '../../internal/keycode';\nimport { addDays, addWeeks, isSameMonth } from 'date-fns';\nimport { getCalendarMonth } from 'mnth';\nimport { DayIndex } from '../internal';\nimport { MoveFocusHandler } from '../utils/move-focus-handler';\nimport { DatePickerProps } from '../../date-picker/interfaces';\nimport rotateDayIndexes from '../utils/rotate-day-indexes';\nimport { renderDayName } from '../utils/intl';\n\nexport interface GridProps {\n locale: string;\n baseDate: Date;\n isDateEnabled: DatePickerProps.IsDateEnabledFunction;\n focusedDate: 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 handleFocusMove: MoveFocusHandler;\n}\n\nconst Grid = ({\n locale,\n baseDate,\n isDateEnabled,\n focusedDate,\n onSelectDate,\n onFocusDate,\n onChangeMonth,\n startOfWeek,\n todayAriaLabel,\n selectedDate,\n handleFocusMove,\n}: GridProps) => {\n const onGridKeyDownHandler = (event: React.KeyboardEvent) => {\n let updatedFocusDate;\n\n if (focusedDate === null) {\n return;\n }\n\n switch (event.keyCode) {\n case KeyCode.enter:\n event.preventDefault();\n if (focusedDate) {\n onFocusDate(null);\n onSelectDate(focusedDate);\n }\n return;\n case KeyCode.right:\n event.preventDefault();\n updatedFocusDate = handleFocusMove(focusedDate, isDateEnabled, date => addDays(date, 1));\n break;\n case KeyCode.left:\n event.preventDefault();\n updatedFocusDate = handleFocusMove(focusedDate, isDateEnabled, date => addDays(date, -1));\n break;\n case KeyCode.up:\n event.preventDefault();\n updatedFocusDate = handleFocusMove(focusedDate, isDateEnabled, date => addWeeks(date, -1));\n break;\n case KeyCode.down:\n event.preventDefault();\n updatedFocusDate = handleFocusMove(focusedDate, isDateEnabled, date => addWeeks(date, 1));\n break;\n default:\n return;\n }\n\n if (!isSameMonth(updatedFocusDate, baseDate)) {\n onChangeMonth(updatedFocusDate);\n }\n onFocusDate(updatedFocusDate);\n };\n\n const weeks = useMemo<Date[][]>(\n () => getCalendarMonth(baseDate, { firstDayOfWeek: startOfWeek }),\n [baseDate, startOfWeek]\n );\n\n return (\n <div>\n <div className={styles['calendar-day-names']}>\n {rotateDayIndexes(startOfWeek).map(i => (\n <div key={`day-name-${i}`} className={styles['calendar-day-name']}>\n {renderDayName(locale, i)}\n </div>\n ))}\n </div>\n <div className={styles['calendar-dates']} onKeyDown={onGridKeyDownHandler}>\n {weeks.map((week, weekIndex) => {\n const isDateInLastWeek = weeks.length - 1 === weekIndex;\n\n return (\n <div key={`week-${weekIndex}`} className={styles['calendar-week']}>\n {week.map((date, dateIndex) => {\n return (\n <GridDay\n key={`date-${weekIndex}-${dateIndex}`}\n locale={locale}\n baseDate={baseDate}\n selectedDate={selectedDate}\n date={date}\n focusedDate={focusedDate}\n todayAriaLabel={todayAriaLabel}\n onSelectDate={date => onSelectDate(date)}\n isDateEnabled={isDateEnabled}\n isDateInLastWeek={isDateInLastWeek}\n />\n );\n })}\n </div>\n );\n })}\n </div>\n </div>\n );\n};\n\nexport default Grid;\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/calendar/header/button/index.tsx"],"names":[],"mappings":"AAQA,UAAU,iBAAiB;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;CAC9C;AAED,QAAA,MAAM,YAAY,6CAA8C,iBAAiB,gBAoBhF,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -2,8 +2,8 @@ import { __assign } from "tslib";
2
2
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  import React from 'react';
5
- import { InternalButton } from '../../../../button/internal';
6
- import styles from '../../../styles.css.js';
5
+ import { InternalButton } from '../../../button/internal';
6
+ import styles from '../../styles.css.js';
7
7
  var HeaderButton = function (_a) {
8
8
  var ariaLabel = _a.ariaLabel, isPrevious = _a.isPrevious, onChangeMonth = _a.onChangeMonth;
9
9
  var iconName = isPrevious ? 'angle-left' : 'angle-right';
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/calendar/header/button/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAQzC,IAAM,YAAY,GAAG,UAAC,EAA2D;QAAzD,SAAS,eAAA,EAAE,UAAU,gBAAA,EAAE,aAAa,mBAAA;IAC1D,IAAM,QAAQ,GAAG,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,aAAa,CAAC;IAC3D,IAAM,oBAAoB,GAA4C;QACpE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,yBAAyB,CAAC;KAC9F,CAAC;IAEF,IAAM,OAAO,GAAoD,UAAA,CAAC;QAChE,CAAC,CAAC,cAAc,EAAE,CAAC;QACnB,aAAa,CAAC,UAAU,CAAC,CAAC;IAC5B,CAAC,CAAC;IAEF,OAAO,CACL,oBAAC,cAAc,eACT,oBAAoB,IACxB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,OAAO,IAChB,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { CancelableEventHandler } from '../../../internal/events';\nimport { ButtonProps } from '../../../button/interfaces';\nimport { InternalButton } from '../../../button/internal';\nimport styles from '../../styles.css.js';\n\ninterface HeaderButtonProps {\n ariaLabel: string;\n isPrevious: boolean;\n onChangeMonth: (isPrevious: boolean) => void;\n}\n\nconst HeaderButton = ({ ariaLabel, isPrevious, onChangeMonth }: HeaderButtonProps) => {\n const iconName = isPrevious ? 'angle-left' : 'angle-right';\n const additionalAttributes: React.HTMLAttributes<HTMLButtonElement> = {\n className: isPrevious ? styles['calendar-prev-month-btn'] : styles['calendar-next-month-btn'],\n };\n\n const onClick: CancelableEventHandler<ButtonProps.ClickDetail> = e => {\n e.preventDefault();\n onChangeMonth(isPrevious);\n };\n\n return (\n <InternalButton\n {...additionalAttributes}\n iconName={iconName}\n ariaLabel={ariaLabel}\n variant={'icon'}\n onClick={onClick}\n />\n );\n};\n\nexport default HeaderButton;\n"]}
@@ -1,11 +1,10 @@
1
1
  interface CalendarHeaderProps {
2
- headerId: string;
3
2
  baseDate: Date;
4
3
  locale: string;
5
4
  onChangeMonth: (prev?: boolean) => void;
6
5
  previousMonthLabel: string;
7
6
  nextMonthLabel: string;
8
7
  }
9
- declare const CalendarHeader: ({ headerId, baseDate, locale, onChangeMonth, previousMonthLabel, nextMonthLabel, }: CalendarHeaderProps) => JSX.Element;
8
+ declare const CalendarHeader: ({ baseDate, locale, onChangeMonth, previousMonthLabel, nextMonthLabel, }: CalendarHeaderProps) => JSX.Element;
10
9
  export default CalendarHeader;
11
10
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/calendar/header/index.tsx"],"names":[],"mappings":"AAOA,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,IAAI,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,QAAA,MAAM,cAAc,6EAMjB,mBAAmB,gBAQrB,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -1,14 +1,14 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import React from 'react';
4
- import styles from '../../styles.css.js';
4
+ import styles from '../styles.css.js';
5
5
  import { renderMonthAndYear } from '../utils/intl';
6
6
  import HeaderButton from './button';
7
7
  var CalendarHeader = function (_a) {
8
- var headerId = _a.headerId, baseDate = _a.baseDate, locale = _a.locale, onChangeMonth = _a.onChangeMonth, previousMonthLabel = _a.previousMonthLabel, nextMonthLabel = _a.nextMonthLabel;
8
+ var baseDate = _a.baseDate, locale = _a.locale, onChangeMonth = _a.onChangeMonth, previousMonthLabel = _a.previousMonthLabel, nextMonthLabel = _a.nextMonthLabel;
9
9
  return (React.createElement("div", { className: styles['calendar-header'] },
10
10
  React.createElement(HeaderButton, { ariaLabel: previousMonthLabel, isPrevious: true, onChangeMonth: onChangeMonth }),
11
- React.createElement("div", { className: styles['calendar-header-month'], id: headerId, "aria-live": "polite" }, renderMonthAndYear(locale, baseDate)),
11
+ React.createElement("div", { className: styles['calendar-header-month'] }, renderMonthAndYear(locale, baseDate)),
12
12
  React.createElement(HeaderButton, { ariaLabel: nextMonthLabel, isPrevious: false, onChangeMonth: onChangeMonth })));
13
13
  };
14
14
  export default CalendarHeader;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/calendar/header/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,YAAY,MAAM,UAAU,CAAC;AAUpC,IAAM,cAAc,GAAG,UAAC,EAMF;QALpB,QAAQ,cAAA,EACR,MAAM,YAAA,EACN,aAAa,mBAAA,EACb,kBAAkB,wBAAA,EAClB,cAAc,oBAAA;IAEd,OAAO,CACL,6BAAK,SAAS,EAAE,MAAM,CAAC,iBAAiB,CAAC;QACvC,oBAAC,YAAY,IAAC,SAAS,EAAE,kBAAkB,EAAE,UAAU,EAAE,IAAI,EAAE,aAAa,EAAE,aAAa,GAAI;QAC/F,6BAAK,SAAS,EAAE,MAAM,CAAC,uBAAuB,CAAC,IAAG,kBAAkB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAO;QAC7F,oBAAC,YAAY,IAAC,SAAS,EAAE,cAAc,EAAE,UAAU,EAAE,KAAK,EAAE,aAAa,EAAE,aAAa,GAAI,CACxF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport styles from '../styles.css.js';\nimport { renderMonthAndYear } from '../utils/intl';\nimport HeaderButton from './button';\n\ninterface CalendarHeaderProps {\n baseDate: Date;\n locale: string;\n onChangeMonth: (prev?: boolean) => void;\n previousMonthLabel: string;\n nextMonthLabel: string;\n}\n\nconst CalendarHeader = ({\n baseDate,\n locale,\n onChangeMonth,\n previousMonthLabel,\n nextMonthLabel,\n}: CalendarHeaderProps) => {\n return (\n <div className={styles['calendar-header']}>\n <HeaderButton ariaLabel={previousMonthLabel} isPrevious={true} onChangeMonth={onChangeMonth} />\n <div className={styles['calendar-header-month']}>{renderMonthAndYear(locale, baseDate)}</div>\n <HeaderButton ariaLabel={nextMonthLabel} isPrevious={false} onChangeMonth={onChangeMonth} />\n </div>\n );\n};\n\nexport default CalendarHeader;\n"]}
@@ -0,0 +1,4 @@
1
+ import { CalendarProps } from './interfaces';
2
+ export { CalendarProps };
3
+ export default function Calendar({ locale, isDateEnabled, ...props }: CalendarProps): JSX.Element;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/calendar/index.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7C,OAAO,EAAE,aAAa,EAAE,CAAC;AAEzB,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAAE,MAAW,EAAE,aAA0B,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,eAGpG"}
@@ -0,0 +1,14 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { __assign, __rest } from "tslib";
4
+ import React from 'react';
5
+ import useBaseComponent from '../internal/hooks/use-base-component';
6
+ import { applyDisplayName } from '../internal/utils/apply-display-name';
7
+ import InternalCalendar from './internal';
8
+ export default function Calendar(_a) {
9
+ var _b = _a.locale, locale = _b === void 0 ? '' : _b, _c = _a.isDateEnabled, isDateEnabled = _c === void 0 ? function () { return true; } : _c, props = __rest(_a, ["locale", "isDateEnabled"]);
10
+ var baseComponentProps = useBaseComponent('Calendar');
11
+ return React.createElement(InternalCalendar, __assign({}, props, baseComponentProps, { locale: locale, isDateEnabled: isDateEnabled }));
12
+ }
13
+ applyDisplayName(Calendar, 'Calendar');
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/calendar/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;;AAEtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE,OAAO,gBAAgB,MAAM,YAAY,CAAC;AAI1C,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAAoE;IAAlE,IAAA,cAAW,EAAX,MAAM,mBAAG,EAAE,KAAA,EAAE,qBAA0B,EAA1B,aAAa,mBAAG,cAAM,OAAA,IAAI,EAAJ,CAAI,KAAA,EAAK,KAAK,cAAnD,2BAAqD,CAAF;IAClF,IAAM,kBAAkB,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAAC;IACxD,OAAO,oBAAC,gBAAgB,eAAK,KAAK,EAAM,kBAAkB,IAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,aAAa,IAAI,CAAC;AAC/G,CAAC;AAED,gBAAgB,CAAC,QAAQ,EAAE,UAAU,CAAC,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 useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { CalendarProps } from './interfaces';\nimport InternalCalendar from './internal';\n\nexport { CalendarProps };\n\nexport default function Calendar({ locale = '', isDateEnabled = () => true, ...props }: CalendarProps) {\n const baseComponentProps = useBaseComponent('Calendar');\n return <InternalCalendar {...props} {...baseComponentProps} locale={locale} isDateEnabled={isDateEnabled} />;\n}\n\napplyDisplayName(Calendar, 'Calendar');\n"]}
@@ -0,0 +1,56 @@
1
+ import { NonCancelableEventHandler } from '../internal/events';
2
+ export interface CalendarProps {
3
+ /**
4
+ * The current input value, in YYYY-MM-DD format.
5
+ */
6
+ value: string;
7
+ /**
8
+ * Defines whether a particular date is enabled in the calendar or not.
9
+ * If you disable a date in the calendar, users can still enter this date using a keyboard.
10
+ * We recommend that you also validate these constraints on the client-side and server-side
11
+ * as you would for other form elements.
12
+ * @param date
13
+ */
14
+ isDateEnabled?: CalendarProps.IsDateEnabledFunction;
15
+ /**
16
+ * Specifies the locale to use to render month names and determine the starting day of the week.
17
+ * If you don't provide this, the locale is determined by the page and browser locales.
18
+ * Supported values and formats are listed in the
19
+ * [JavaScript Intl API specification](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation).
20
+ */
21
+ locale?: string;
22
+ /**
23
+ * Determines the starting day of the week. The values 0-6 map to Sunday-Saturday.
24
+ * By default the starting day of the week is defined by the locale, but you can use this property to override it.
25
+ */
26
+ startOfWeek?: number;
27
+ /**
28
+ * Used as part of the `aria-label` for today's date in the calendar.
29
+ */
30
+ todayAriaLabel: string;
31
+ /**
32
+ * Specifies an `aria-label` for the 'next month' button.
33
+ */
34
+ nextMonthAriaLabel: string;
35
+ /**
36
+ * Specifies an `aria-label` for the 'previous month' button.
37
+ */
38
+ previousMonthAriaLabel: string;
39
+ /**
40
+ * Called whenever a user changes the input value (by typing, pasting, or selecting a value).
41
+ * The event `detail` contains the current value of the field.
42
+ */
43
+ onChange?: NonCancelableEventHandler<CalendarProps.ChangeDetail>;
44
+ }
45
+ export declare namespace CalendarProps {
46
+ interface ChangeDetail {
47
+ /**
48
+ * The new value of this component.
49
+ */
50
+ value: string;
51
+ }
52
+ interface IsDateEnabledFunction {
53
+ (date: Date): boolean;
54
+ }
55
+ }
56
+ //# sourceMappingURL=interfaces.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/calendar/interfaces.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC,qBAAqB,CAAC;IAEpD;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,sBAAsB,EAAE,MAAM,CAAC;IAE/B;;;OAGG;IACH,QAAQ,CAAC,EAAE,yBAAyB,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;CAClE;AAED,yBAAiB,aAAa,CAAC;IAC7B,UAAiB,YAAY;QAC3B;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;KACf;IAED,UAAiB,qBAAqB;QACpC,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC;KACvB;CACF"}
@@ -0,0 +1,4 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export {};
4
+ //# sourceMappingURL=interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/calendar/interfaces.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface CalendarProps {\n /**\n * The current input value, in YYYY-MM-DD format.\n */\n value: string;\n\n /**\n * Defines whether a particular date is enabled in the calendar or not.\n * If you disable a date in the calendar, users can still enter this date using a keyboard.\n * We recommend that you also validate these constraints on the client-side and server-side\n * as you would for other form elements.\n * @param date\n */\n isDateEnabled?: CalendarProps.IsDateEnabledFunction;\n\n /**\n * Specifies the locale to use to render month names and determine the starting day of the week.\n * If you don't provide this, the locale is determined by the page and browser locales.\n * Supported values and formats are listed in the\n * [JavaScript Intl API specification](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation).\n */\n locale?: string;\n\n /**\n * Determines the starting day of the week. The values 0-6 map to Sunday-Saturday.\n * By default the starting day of the week is defined by the locale, but you can use this property to override it.\n */\n startOfWeek?: number;\n\n /**\n * Used as part of the `aria-label` for today's date in the calendar.\n */\n todayAriaLabel: string;\n\n /**\n * Specifies an `aria-label` for the 'next month' button.\n */\n nextMonthAriaLabel: string;\n\n /**\n * Specifies an `aria-label` for the 'previous month' button.\n */\n previousMonthAriaLabel: string;\n\n /**\n * Called whenever a user changes the input value (by typing, pasting, or selecting a value).\n * The event `detail` contains the current value of the field.\n */\n onChange?: NonCancelableEventHandler<CalendarProps.ChangeDetail>;\n}\n\nexport namespace CalendarProps {\n export interface ChangeDetail {\n /**\n * The new value of this component.\n */\n value: string;\n }\n\n export interface IsDateEnabledFunction {\n (date: Date): boolean;\n }\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import { CalendarProps } from './interfaces.js';
2
+ export declare type DayIndex = 0 | 1 | 2 | 3 | 4 | 5 | 6;
3
+ export default function Calendar({ value, locale, startOfWeek, isDateEnabled, todayAriaLabel, nextMonthAriaLabel, previousMonthAriaLabel, onChange, }: CalendarProps): JSX.Element;
4
+ //# sourceMappingURL=internal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/calendar/internal.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,oBAAY,QAAQ,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAEjD,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAC/B,KAAK,EACL,MAAW,EACX,WAAW,EACX,aAA0B,EAC1B,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EACtB,QAAQ,GACT,EAAE,aAAa,eAkHf"}