@cloudscape-design/components 3.0.246 → 3.0.248

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 (136) hide show
  1. package/annotation-context/annotation/styles.css.js +24 -24
  2. package/annotation-context/annotation/styles.scoped.css +30 -30
  3. package/annotation-context/annotation/styles.selectors.js +24 -24
  4. package/app-layout/drawer/index.d.ts +3 -21
  5. package/app-layout/drawer/index.d.ts.map +1 -1
  6. package/app-layout/drawer/index.js +25 -5
  7. package/app-layout/drawer/index.js.map +1 -1
  8. package/app-layout/drawer/interfaces.d.ts +84 -0
  9. package/app-layout/drawer/interfaces.d.ts.map +1 -0
  10. package/app-layout/drawer/interfaces.js +2 -0
  11. package/app-layout/drawer/interfaces.js.map +1 -0
  12. package/app-layout/drawer/resizable-drawer.d.ts +4 -0
  13. package/app-layout/drawer/resizable-drawer.d.ts.map +1 -0
  14. package/app-layout/drawer/resizable-drawer.js +51 -0
  15. package/app-layout/drawer/resizable-drawer.js.map +1 -0
  16. package/app-layout/drawer/styles.css.js +10 -5
  17. package/app-layout/drawer/styles.scoped.css +46 -10
  18. package/app-layout/drawer/styles.selectors.js +10 -5
  19. package/app-layout/index.d.ts.map +1 -1
  20. package/app-layout/index.js +142 -17
  21. package/app-layout/index.js.map +1 -1
  22. package/app-layout/mobile-toolbar/index.d.ts +10 -1
  23. package/app-layout/mobile-toolbar/index.d.ts.map +1 -1
  24. package/app-layout/mobile-toolbar/index.js +3 -2
  25. package/app-layout/mobile-toolbar/index.js.map +1 -1
  26. package/app-layout/mobile-toolbar/styles.css.js +5 -4
  27. package/app-layout/mobile-toolbar/styles.scoped.css +11 -7
  28. package/app-layout/mobile-toolbar/styles.selectors.js +5 -4
  29. package/app-layout/notifications/styles.css.js +3 -3
  30. package/app-layout/notifications/styles.scoped.css +7 -7
  31. package/app-layout/notifications/styles.selectors.js +3 -3
  32. package/app-layout/test-classes/styles.css.js +18 -13
  33. package/app-layout/test-classes/styles.scoped.css +33 -13
  34. package/app-layout/test-classes/styles.selectors.js +18 -13
  35. package/app-layout/toggles/index.d.ts.map +1 -1
  36. package/app-layout/toggles/index.js +2 -2
  37. package/app-layout/toggles/index.js.map +1 -1
  38. package/app-layout/toggles/interfaces.d.ts +3 -1
  39. package/app-layout/toggles/interfaces.d.ts.map +1 -1
  40. package/app-layout/toggles/interfaces.js.map +1 -1
  41. package/app-layout/utils/use-drawer-focus-control.d.ts +21 -0
  42. package/app-layout/utils/use-drawer-focus-control.d.ts.map +1 -0
  43. package/app-layout/utils/use-drawer-focus-control.js +65 -0
  44. package/app-layout/utils/use-drawer-focus-control.js.map +1 -0
  45. package/app-layout/visual-refresh/app-bar.d.ts.map +1 -1
  46. package/app-layout/visual-refresh/app-bar.js +8 -6
  47. package/app-layout/visual-refresh/app-bar.js.map +1 -1
  48. package/app-layout/visual-refresh/context.d.ts +13 -6
  49. package/app-layout/visual-refresh/context.d.ts.map +1 -1
  50. package/app-layout/visual-refresh/context.js +107 -52
  51. package/app-layout/visual-refresh/context.js.map +1 -1
  52. package/app-layout/visual-refresh/drawers.d.ts +47 -0
  53. package/app-layout/visual-refresh/drawers.d.ts.map +1 -0
  54. package/app-layout/visual-refresh/drawers.js +127 -0
  55. package/app-layout/visual-refresh/drawers.js.map +1 -0
  56. package/app-layout/visual-refresh/header.js +2 -2
  57. package/app-layout/visual-refresh/header.js.map +1 -1
  58. package/app-layout/visual-refresh/index.d.ts.map +1 -1
  59. package/app-layout/visual-refresh/index.js +3 -1
  60. package/app-layout/visual-refresh/index.js.map +1 -1
  61. package/app-layout/visual-refresh/layout.d.ts.map +1 -1
  62. package/app-layout/visual-refresh/layout.js +5 -42
  63. package/app-layout/visual-refresh/layout.js.map +1 -1
  64. package/app-layout/visual-refresh/main.d.ts.map +1 -1
  65. package/app-layout/visual-refresh/main.js +2 -3
  66. package/app-layout/visual-refresh/main.js.map +1 -1
  67. package/app-layout/visual-refresh/navigation.js +2 -2
  68. package/app-layout/visual-refresh/navigation.js.map +1 -1
  69. package/app-layout/visual-refresh/notifications.d.ts.map +1 -1
  70. package/app-layout/visual-refresh/notifications.js +2 -2
  71. package/app-layout/visual-refresh/notifications.js.map +1 -1
  72. package/app-layout/visual-refresh/split-panel.js +2 -2
  73. package/app-layout/visual-refresh/split-panel.js.map +1 -1
  74. package/app-layout/visual-refresh/styles.css.js +71 -61
  75. package/app-layout/visual-refresh/styles.scoped.css +437 -229
  76. package/app-layout/visual-refresh/styles.selectors.js +71 -61
  77. package/app-layout/visual-refresh/tools.d.ts.map +1 -1
  78. package/app-layout/visual-refresh/tools.js +7 -3
  79. package/app-layout/visual-refresh/tools.js.map +1 -1
  80. package/app-layout/visual-refresh/trigger-button.d.ts +4 -3
  81. package/app-layout/visual-refresh/trigger-button.d.ts.map +1 -1
  82. package/app-layout/visual-refresh/trigger-button.js +5 -4
  83. package/app-layout/visual-refresh/trigger-button.js.map +1 -1
  84. package/area-chart/internal.js +1 -1
  85. package/area-chart/internal.js.map +1 -1
  86. package/flashbar/styles.css.js +45 -45
  87. package/flashbar/styles.scoped.css +169 -169
  88. package/flashbar/styles.selectors.js +45 -45
  89. package/internal/base-component/styles.scoped.css +24 -0
  90. package/internal/context/app-layout-context.d.ts +0 -1
  91. package/internal/context/app-layout-context.d.ts.map +1 -1
  92. package/internal/context/app-layout-context.js.map +1 -1
  93. package/internal/context/dynamic-overlap-context.d.ts +3 -0
  94. package/internal/context/dynamic-overlap-context.d.ts.map +1 -0
  95. package/internal/context/dynamic-overlap-context.js +5 -0
  96. package/internal/context/dynamic-overlap-context.js.map +1 -0
  97. package/internal/environment.js +1 -1
  98. package/internal/generated/custom-css-properties/index.d.ts.map +1 -1
  99. package/internal/generated/custom-css-properties/index.js +31 -30
  100. package/internal/generated/custom-css-properties/index.js.map +1 -1
  101. package/internal/generated/styles/tokens.d.ts +2 -0
  102. package/internal/generated/styles/tokens.js +2 -0
  103. package/internal/generated/theming/index.cjs +140 -0
  104. package/internal/generated/theming/index.js +140 -0
  105. package/internal/hooks/use-dynamic-overlap/index.js +7 -7
  106. package/internal/hooks/use-dynamic-overlap/index.js.map +1 -1
  107. package/internal/manifest.json +1 -1
  108. package/mixed-line-bar-chart/internal.js +1 -1
  109. package/mixed-line-bar-chart/internal.js.map +1 -1
  110. package/package.json +1 -1
  111. package/pie-chart/index.js +1 -1
  112. package/pie-chart/index.js.map +1 -1
  113. package/space-between/internal.js +1 -1
  114. package/space-between/internal.js.map +1 -1
  115. package/space-between/styles.css.js +20 -28
  116. package/space-between/styles.scoped.css +37 -101
  117. package/space-between/styles.selectors.js +20 -28
  118. package/test-utils/dom/button/index.js +1 -6
  119. package/test-utils/dom/button/index.js.map +1 -1
  120. package/test-utils/dom/flashbar/index.d.ts +5 -1
  121. package/test-utils/dom/flashbar/index.js +7 -0
  122. package/test-utils/dom/flashbar/index.js.map +1 -1
  123. package/test-utils/selectors/flashbar/index.d.ts +5 -1
  124. package/test-utils/selectors/flashbar/index.js +7 -0
  125. package/test-utils/selectors/flashbar/index.js.map +1 -1
  126. package/test-utils/tsconfig.tsbuildinfo +1 -1
  127. package/wizard/interfaces.d.ts +4 -0
  128. package/wizard/interfaces.d.ts.map +1 -1
  129. package/wizard/interfaces.js.map +1 -1
  130. package/wizard/wizard-actions.d.ts +2 -1
  131. package/wizard/wizard-actions.d.ts.map +1 -1
  132. package/wizard/wizard-actions.js +2 -2
  133. package/wizard/wizard-actions.js.map +1 -1
  134. package/wizard/wizard-form.d.ts.map +1 -1
  135. package/wizard/wizard-form.js +1 -1
  136. package/wizard/wizard-form.js.map +1 -1
@@ -1,29 +1,29 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "arrow": "awsui_arrow_1hpp3_2844v_93",
5
- "arrow-outer": "awsui_arrow-outer_1hpp3_2844v_97",
6
- "arrow-inner": "awsui_arrow-inner_1hpp3_2844v_97",
7
- "arrow-position-right-top": "awsui_arrow-position-right-top_1hpp3_2844v_128",
8
- "arrow-position-right-bottom": "awsui_arrow-position-right-bottom_1hpp3_2844v_128",
9
- "arrow-position-left-top": "awsui_arrow-position-left-top_1hpp3_2844v_131",
10
- "arrow-position-left-bottom": "awsui_arrow-position-left-bottom_1hpp3_2844v_131",
11
- "arrow-position-top-center": "awsui_arrow-position-top-center_1hpp3_2844v_134",
12
- "arrow-position-top-responsive": "awsui_arrow-position-top-responsive_1hpp3_2844v_134",
13
- "arrow-position-bottom-center": "awsui_arrow-position-bottom-center_1hpp3_2844v_137",
14
- "arrow-position-bottom-responsive": "awsui_arrow-position-bottom-responsive_1hpp3_2844v_137",
15
- "annotation": "awsui_annotation_1hpp3_2844v_145",
16
- "next-button": "awsui_next-button_1hpp3_2844v_146",
17
- "previous-button": "awsui_previous-button_1hpp3_2844v_147",
18
- "finish-button": "awsui_finish-button_1hpp3_2844v_148",
19
- "header": "awsui_header_1hpp3_2844v_149",
20
- "step-counter-content": "awsui_step-counter-content_1hpp3_2844v_150",
21
- "content": "awsui_content_1hpp3_2844v_151",
22
- "description": "awsui_description_1hpp3_2844v_155",
23
- "actionBar": "awsui_actionBar_1hpp3_2844v_160",
24
- "stepCounter": "awsui_stepCounter_1hpp3_2844v_167",
25
- "divider": "awsui_divider_1hpp3_2844v_171",
26
- "hotspot": "awsui_hotspot_1hpp3_2844v_175",
27
- "icon": "awsui_icon_1hpp3_2844v_215"
4
+ "arrow": "awsui_arrow_1hpp3_1fwnq_93",
5
+ "arrow-outer": "awsui_arrow-outer_1hpp3_1fwnq_97",
6
+ "arrow-inner": "awsui_arrow-inner_1hpp3_1fwnq_97",
7
+ "arrow-position-right-top": "awsui_arrow-position-right-top_1hpp3_1fwnq_128",
8
+ "arrow-position-right-bottom": "awsui_arrow-position-right-bottom_1hpp3_1fwnq_128",
9
+ "arrow-position-left-top": "awsui_arrow-position-left-top_1hpp3_1fwnq_131",
10
+ "arrow-position-left-bottom": "awsui_arrow-position-left-bottom_1hpp3_1fwnq_131",
11
+ "arrow-position-top-center": "awsui_arrow-position-top-center_1hpp3_1fwnq_134",
12
+ "arrow-position-top-responsive": "awsui_arrow-position-top-responsive_1hpp3_1fwnq_134",
13
+ "arrow-position-bottom-center": "awsui_arrow-position-bottom-center_1hpp3_1fwnq_137",
14
+ "arrow-position-bottom-responsive": "awsui_arrow-position-bottom-responsive_1hpp3_1fwnq_137",
15
+ "annotation": "awsui_annotation_1hpp3_1fwnq_145",
16
+ "next-button": "awsui_next-button_1hpp3_1fwnq_146",
17
+ "previous-button": "awsui_previous-button_1hpp3_1fwnq_147",
18
+ "finish-button": "awsui_finish-button_1hpp3_1fwnq_148",
19
+ "header": "awsui_header_1hpp3_1fwnq_149",
20
+ "step-counter-content": "awsui_step-counter-content_1hpp3_1fwnq_150",
21
+ "content": "awsui_content_1hpp3_1fwnq_151",
22
+ "description": "awsui_description_1hpp3_1fwnq_155",
23
+ "actionBar": "awsui_actionBar_1hpp3_1fwnq_160",
24
+ "stepCounter": "awsui_stepCounter_1hpp3_1fwnq_167",
25
+ "divider": "awsui_divider_1hpp3_1fwnq_171",
26
+ "hotspot": "awsui_hotspot_1hpp3_1fwnq_175",
27
+ "icon": "awsui_icon_1hpp3_1fwnq_215"
28
28
  };
29
29
 
@@ -90,11 +90,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
90
90
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
91
91
  SPDX-License-Identifier: Apache-2.0
92
92
  */
93
- .awsui_arrow_1hpp3_2844v_93:not(#\9) {
93
+ .awsui_arrow_1hpp3_1fwnq_93:not(#\9) {
94
94
  width: 20px;
95
95
  height: 10px;
96
96
  }
97
- .awsui_arrow-outer_1hpp3_2844v_97:not(#\9), .awsui_arrow-inner_1hpp3_2844v_97:not(#\9) {
97
+ .awsui_arrow-outer_1hpp3_1fwnq_97:not(#\9), .awsui_arrow-inner_1hpp3_1fwnq_97:not(#\9) {
98
98
  position: absolute;
99
99
  overflow: hidden;
100
100
  width: 20px;
@@ -102,7 +102,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
102
102
  top: 0;
103
103
  left: 0;
104
104
  }
105
- .awsui_arrow-outer_1hpp3_2844v_97:not(#\9)::after, .awsui_arrow-inner_1hpp3_2844v_97:not(#\9)::after {
105
+ .awsui_arrow-outer_1hpp3_1fwnq_97:not(#\9)::after, .awsui_arrow-inner_1hpp3_1fwnq_97:not(#\9)::after {
106
106
  content: "";
107
107
  box-sizing: border-box;
108
108
  display: inline-block;
@@ -115,26 +115,26 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
115
115
  transform: rotate(45deg);
116
116
  transform-origin: 0 100%;
117
117
  }
118
- .awsui_arrow-outer_1hpp3_2844v_97:not(#\9)::after {
118
+ .awsui_arrow-outer_1hpp3_1fwnq_97:not(#\9)::after {
119
119
  background-color: var(--color-border-status-info-546i7i, #0972d3);
120
120
  }
121
- .awsui_arrow-inner_1hpp3_2844v_97:not(#\9) {
121
+ .awsui_arrow-inner_1hpp3_1fwnq_97:not(#\9) {
122
122
  top: 2px;
123
123
  }
124
- .awsui_arrow-inner_1hpp3_2844v_97:not(#\9)::after {
124
+ .awsui_arrow-inner_1hpp3_1fwnq_97:not(#\9)::after {
125
125
  border-radius: 1px 0 0 0;
126
126
  background-color: var(--color-background-status-info-usb30e, #f2f8fd);
127
127
  }
128
- .awsui_arrow-position-right-top_1hpp3_2844v_128 > .awsui_arrow-outer_1hpp3_2844v_97:not(#\9)::after, .awsui_arrow-position-right-bottom_1hpp3_2844v_128 > .awsui_arrow-outer_1hpp3_2844v_97:not(#\9)::after {
128
+ .awsui_arrow-position-right-top_1hpp3_1fwnq_128 > .awsui_arrow-outer_1hpp3_1fwnq_97:not(#\9)::after, .awsui_arrow-position-right-bottom_1hpp3_1fwnq_128 > .awsui_arrow-outer_1hpp3_1fwnq_97:not(#\9)::after {
129
129
  box-shadow: -0.71px 0.71px 4px -2px var(--color-shadow-default-3se70f, rgba(0, 7, 22, 0.12));
130
130
  }
131
- .awsui_arrow-position-left-top_1hpp3_2844v_131 > .awsui_arrow-outer_1hpp3_2844v_97:not(#\9)::after, .awsui_arrow-position-left-bottom_1hpp3_2844v_131 > .awsui_arrow-outer_1hpp3_2844v_97:not(#\9)::after {
131
+ .awsui_arrow-position-left-top_1hpp3_1fwnq_131 > .awsui_arrow-outer_1hpp3_1fwnq_97:not(#\9)::after, .awsui_arrow-position-left-bottom_1hpp3_1fwnq_131 > .awsui_arrow-outer_1hpp3_1fwnq_97:not(#\9)::after {
132
132
  box-shadow: 0.71px -0.71px 4px -2px var(--color-shadow-default-3se70f, rgba(0, 7, 22, 0.12));
133
133
  }
134
- .awsui_arrow-position-top-center_1hpp3_2844v_134 > .awsui_arrow-outer_1hpp3_2844v_97:not(#\9)::after, .awsui_arrow-position-top-responsive_1hpp3_2844v_134 > .awsui_arrow-outer_1hpp3_2844v_97:not(#\9)::after {
134
+ .awsui_arrow-position-top-center_1hpp3_1fwnq_134 > .awsui_arrow-outer_1hpp3_1fwnq_97:not(#\9)::after, .awsui_arrow-position-top-responsive_1hpp3_1fwnq_134 > .awsui_arrow-outer_1hpp3_1fwnq_97:not(#\9)::after {
135
135
  box-shadow: -0.71px -0.71px 4px -2px var(--color-shadow-default-3se70f, rgba(0, 7, 22, 0.12));
136
136
  }
137
- .awsui_arrow-position-bottom-center_1hpp3_2844v_137 > .awsui_arrow-outer_1hpp3_2844v_97:not(#\9)::after, .awsui_arrow-position-bottom-responsive_1hpp3_2844v_137 > .awsui_arrow-outer_1hpp3_2844v_97:not(#\9)::after {
137
+ .awsui_arrow-position-bottom-center_1hpp3_1fwnq_137 > .awsui_arrow-outer_1hpp3_1fwnq_97:not(#\9)::after, .awsui_arrow-position-bottom-responsive_1hpp3_1fwnq_137 > .awsui_arrow-outer_1hpp3_1fwnq_97:not(#\9)::after {
138
138
  box-shadow: 0.71px 0.71px 4px -2px var(--color-shadow-default-3se70f, rgba(0, 7, 22, 0.12));
139
139
  }
140
140
 
@@ -142,37 +142,37 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
142
142
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
143
143
  SPDX-License-Identifier: Apache-2.0
144
144
  */
145
- .awsui_annotation_1hpp3_2844v_145:not(#\9),
146
- .awsui_next-button_1hpp3_2844v_146:not(#\9),
147
- .awsui_previous-button_1hpp3_2844v_147:not(#\9),
148
- .awsui_finish-button_1hpp3_2844v_148:not(#\9),
149
- .awsui_header_1hpp3_2844v_149:not(#\9),
150
- .awsui_step-counter-content_1hpp3_2844v_150:not(#\9),
151
- .awsui_content_1hpp3_2844v_151:not(#\9) {
145
+ .awsui_annotation_1hpp3_1fwnq_145:not(#\9),
146
+ .awsui_next-button_1hpp3_1fwnq_146:not(#\9),
147
+ .awsui_previous-button_1hpp3_1fwnq_147:not(#\9),
148
+ .awsui_finish-button_1hpp3_1fwnq_148:not(#\9),
149
+ .awsui_header_1hpp3_1fwnq_149:not(#\9),
150
+ .awsui_step-counter-content_1hpp3_1fwnq_150:not(#\9),
151
+ .awsui_content_1hpp3_1fwnq_151:not(#\9) {
152
152
  /* used in test-utils */
153
153
  }
154
154
 
155
- .awsui_description_1hpp3_2844v_155:not(#\9) {
155
+ .awsui_description_1hpp3_1fwnq_155:not(#\9) {
156
156
  overflow: hidden;
157
157
  margin-top: var(--space-xxs-ynfts5, 4px);
158
158
  }
159
159
 
160
- .awsui_actionBar_1hpp3_2844v_160:not(#\9) {
160
+ .awsui_actionBar_1hpp3_1fwnq_160:not(#\9) {
161
161
  display: flex;
162
162
  justify-content: space-between;
163
163
  align-items: center;
164
164
  position: relative;
165
165
  }
166
166
 
167
- .awsui_stepCounter_1hpp3_2844v_167:not(#\9) {
167
+ .awsui_stepCounter_1hpp3_1fwnq_167:not(#\9) {
168
168
  margin-right: 20px;
169
169
  }
170
170
 
171
- .awsui_divider_1hpp3_2844v_171:not(#\9) {
171
+ .awsui_divider_1hpp3_1fwnq_171:not(#\9) {
172
172
  border-bottom: var(--border-divider-section-width-4wm2it, 2px) solid var(--color-border-divider-default-7s2wjw, #e9ebed);
173
173
  }
174
174
 
175
- .awsui_hotspot_1hpp3_2844v_175:not(#\9) {
175
+ .awsui_hotspot_1hpp3_1fwnq_175:not(#\9) {
176
176
  /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
177
177
  border-collapse: separate;
178
178
  border-spacing: 0;
@@ -213,21 +213,21 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
213
213
  border: none;
214
214
  padding: 0;
215
215
  cursor: pointer;
216
- scroll-margin: var(--awsui-content-scroll-margin-lgrg0d, 40px 0 0 0);
216
+ scroll-margin: var(--awsui-content-scroll-margin-3j0evk, 40px 0 0 0);
217
217
  width: 16px;
218
218
  height: 16px;
219
219
  }
220
- .awsui_hotspot_1hpp3_2844v_175:not(#\9):focus {
220
+ .awsui_hotspot_1hpp3_1fwnq_175:not(#\9):focus {
221
221
  outline: none;
222
222
  }
223
- body[data-awsui-focus-visible=true] .awsui_hotspot_1hpp3_2844v_175:not(#\9):focus {
223
+ body[data-awsui-focus-visible=true] .awsui_hotspot_1hpp3_1fwnq_175:not(#\9):focus {
224
224
  position: relative;
225
225
  }
226
- body[data-awsui-focus-visible=true] .awsui_hotspot_1hpp3_2844v_175:not(#\9):focus {
226
+ body[data-awsui-focus-visible=true] .awsui_hotspot_1hpp3_1fwnq_175:not(#\9):focus {
227
227
  outline: 2px dotted transparent;
228
228
  outline-offset: calc(2px - 1px);
229
229
  }
230
- body[data-awsui-focus-visible=true] .awsui_hotspot_1hpp3_2844v_175:not(#\9):focus::before {
230
+ body[data-awsui-focus-visible=true] .awsui_hotspot_1hpp3_1fwnq_175:not(#\9):focus::before {
231
231
  content: " ";
232
232
  display: block;
233
233
  position: absolute;
@@ -238,13 +238,13 @@ body[data-awsui-focus-visible=true] .awsui_hotspot_1hpp3_2844v_175:not(#\9):focu
238
238
  border-radius: var(--border-radius-control-circular-focus-ring-qawzn7, 4px);
239
239
  box-shadow: 0 0 0 2px var(--color-border-item-focused-ap3b6s, #0972d3);
240
240
  }
241
- .awsui_hotspot_1hpp3_2844v_175 > .awsui_icon_1hpp3_2844v_215:not(#\9) {
241
+ .awsui_hotspot_1hpp3_1fwnq_175 > .awsui_icon_1hpp3_1fwnq_215:not(#\9) {
242
242
  position: relative;
243
243
  stroke: var(--color-text-link-default-5f186r, #0972d3);
244
244
  }
245
- .awsui_hotspot_1hpp3_2844v_175:not(#\9):hover > .awsui_icon_1hpp3_2844v_215 {
245
+ .awsui_hotspot_1hpp3_1fwnq_175:not(#\9):hover > .awsui_icon_1hpp3_1fwnq_215 {
246
246
  stroke: var(--color-text-link-hover-kololx, #033160);
247
247
  }
248
- .awsui_hotspot_1hpp3_2844v_175:not(#\9):active > .awsui_icon_1hpp3_2844v_215 {
248
+ .awsui_hotspot_1hpp3_1fwnq_175:not(#\9):active > .awsui_icon_1hpp3_1fwnq_215 {
249
249
  stroke: var(--color-text-link-default-5f186r, #0972d3);
250
250
  }
@@ -2,29 +2,29 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "arrow": "awsui_arrow_1hpp3_2844v_93",
6
- "arrow-outer": "awsui_arrow-outer_1hpp3_2844v_97",
7
- "arrow-inner": "awsui_arrow-inner_1hpp3_2844v_97",
8
- "arrow-position-right-top": "awsui_arrow-position-right-top_1hpp3_2844v_128",
9
- "arrow-position-right-bottom": "awsui_arrow-position-right-bottom_1hpp3_2844v_128",
10
- "arrow-position-left-top": "awsui_arrow-position-left-top_1hpp3_2844v_131",
11
- "arrow-position-left-bottom": "awsui_arrow-position-left-bottom_1hpp3_2844v_131",
12
- "arrow-position-top-center": "awsui_arrow-position-top-center_1hpp3_2844v_134",
13
- "arrow-position-top-responsive": "awsui_arrow-position-top-responsive_1hpp3_2844v_134",
14
- "arrow-position-bottom-center": "awsui_arrow-position-bottom-center_1hpp3_2844v_137",
15
- "arrow-position-bottom-responsive": "awsui_arrow-position-bottom-responsive_1hpp3_2844v_137",
16
- "annotation": "awsui_annotation_1hpp3_2844v_145",
17
- "next-button": "awsui_next-button_1hpp3_2844v_146",
18
- "previous-button": "awsui_previous-button_1hpp3_2844v_147",
19
- "finish-button": "awsui_finish-button_1hpp3_2844v_148",
20
- "header": "awsui_header_1hpp3_2844v_149",
21
- "step-counter-content": "awsui_step-counter-content_1hpp3_2844v_150",
22
- "content": "awsui_content_1hpp3_2844v_151",
23
- "description": "awsui_description_1hpp3_2844v_155",
24
- "actionBar": "awsui_actionBar_1hpp3_2844v_160",
25
- "stepCounter": "awsui_stepCounter_1hpp3_2844v_167",
26
- "divider": "awsui_divider_1hpp3_2844v_171",
27
- "hotspot": "awsui_hotspot_1hpp3_2844v_175",
28
- "icon": "awsui_icon_1hpp3_2844v_215"
5
+ "arrow": "awsui_arrow_1hpp3_1fwnq_93",
6
+ "arrow-outer": "awsui_arrow-outer_1hpp3_1fwnq_97",
7
+ "arrow-inner": "awsui_arrow-inner_1hpp3_1fwnq_97",
8
+ "arrow-position-right-top": "awsui_arrow-position-right-top_1hpp3_1fwnq_128",
9
+ "arrow-position-right-bottom": "awsui_arrow-position-right-bottom_1hpp3_1fwnq_128",
10
+ "arrow-position-left-top": "awsui_arrow-position-left-top_1hpp3_1fwnq_131",
11
+ "arrow-position-left-bottom": "awsui_arrow-position-left-bottom_1hpp3_1fwnq_131",
12
+ "arrow-position-top-center": "awsui_arrow-position-top-center_1hpp3_1fwnq_134",
13
+ "arrow-position-top-responsive": "awsui_arrow-position-top-responsive_1hpp3_1fwnq_134",
14
+ "arrow-position-bottom-center": "awsui_arrow-position-bottom-center_1hpp3_1fwnq_137",
15
+ "arrow-position-bottom-responsive": "awsui_arrow-position-bottom-responsive_1hpp3_1fwnq_137",
16
+ "annotation": "awsui_annotation_1hpp3_1fwnq_145",
17
+ "next-button": "awsui_next-button_1hpp3_1fwnq_146",
18
+ "previous-button": "awsui_previous-button_1hpp3_1fwnq_147",
19
+ "finish-button": "awsui_finish-button_1hpp3_1fwnq_148",
20
+ "header": "awsui_header_1hpp3_1fwnq_149",
21
+ "step-counter-content": "awsui_step-counter-content_1hpp3_1fwnq_150",
22
+ "content": "awsui_content_1hpp3_1fwnq_151",
23
+ "description": "awsui_description_1hpp3_1fwnq_155",
24
+ "actionBar": "awsui_actionBar_1hpp3_1fwnq_160",
25
+ "stepCounter": "awsui_stepCounter_1hpp3_1fwnq_167",
26
+ "divider": "awsui_divider_1hpp3_1fwnq_171",
27
+ "hotspot": "awsui_hotspot_1hpp3_1fwnq_175",
28
+ "icon": "awsui_icon_1hpp3_1fwnq_215"
29
29
  };
30
30
 
@@ -1,23 +1,5 @@
1
1
  import React from 'react';
2
- import { togglesConfig } from '../toggles';
3
- import { AppLayoutProps } from '../interfaces';
4
- import { FocusControlRefs } from '../utils/use-focus-control';
5
- export interface DesktopDrawerProps {
6
- contentClassName: string;
7
- toggleClassName: string;
8
- closeClassName: string;
9
- toggleRefs: FocusControlRefs;
10
- width: number;
11
- topOffset: number | undefined;
12
- bottomOffset: number | undefined;
13
- ariaLabels: AppLayoutProps.Labels | undefined;
14
- children: React.ReactNode;
15
- type: keyof typeof togglesConfig;
16
- isMobile: boolean;
17
- isOpen: boolean;
18
- onToggle: (isOpen: boolean) => void;
19
- onClick?: (event: React.MouseEvent) => void;
20
- onLoseFocus?: (event: React.FocusEvent) => void;
21
- }
22
- export declare function Drawer({ contentClassName, toggleClassName, closeClassName, width, type, toggleRefs, topOffset, bottomOffset, ariaLabels, children, isOpen, isMobile, onToggle, onClick, onLoseFocus, }: DesktopDrawerProps): JSX.Element;
2
+ import { DesktopDrawerProps, DrawerTriggersBarProps } from './interfaces';
3
+ export declare const Drawer: React.ForwardRefExoticComponent<DesktopDrawerProps & React.RefAttributes<HTMLDivElement>>;
4
+ export declare function DrawerTriggersBar({ isMobile, topOffset, bottomOffset, drawers, contentClassName, }: DrawerTriggersBarProps): JSX.Element;
23
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pB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["app-layout/drawer/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAKtC,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAoC,MAAM,cAAc,CAAC;AAkB5G,eAAO,MAAM,MAAM,2FAyGlB,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,OAAO,EACP,gBAAgB,GACjB,EAAE,sBAAsB,eAiCxB"}
@@ -21,15 +21,21 @@ import styles from './styles.css.js';
21
21
  // * https://github.com/nvaccess/nvda/issues/5825
22
22
  // * https://github.com/nvaccess/nvda/issues/5247
23
23
  // * https://github.com/nvaccess/nvda/pull/8869 (reverted PR that was going to fix it)
24
- export function Drawer({ contentClassName, toggleClassName, closeClassName, width, type, toggleRefs, topOffset, bottomOffset, ariaLabels, children, isOpen, isMobile, onToggle, onClick, onLoseFocus, }) {
24
+ export const Drawer = React.forwardRef(({ contentClassName, toggleClassName, closeClassName, width, type, toggleRefs, topOffset, bottomOffset, ariaLabels, drawersAriaLabels, children, isOpen, isMobile, onToggle, onClick, onLoseFocus, drawers, resizeHandle, }, ref) => {
25
+ const openButtonWrapperRef = useRef(null);
25
26
  const { TagName, iconName, getLabels } = togglesConfig[type];
26
27
  const { mainLabel, closeLabel, openLabel } = getLabels(ariaLabels);
27
28
  const drawerContentWidthOpen = isMobile ? undefined : width;
28
29
  const drawerContentWidth = isOpen ? drawerContentWidthOpen : undefined;
29
- const openButtonWrapperRef = useRef(null);
30
+ const getDrawersLabels = (labels = {}) => ({
31
+ drawerMainLabel: labels === null || labels === void 0 ? void 0 : labels.content,
32
+ drawerOpenLabel: labels === null || labels === void 0 ? void 0 : labels.triggerButton,
33
+ drawerCloseLabel: labels === null || labels === void 0 ? void 0 : labels.closeButton,
34
+ });
35
+ const { drawerMainLabel, drawerCloseLabel } = getDrawersLabels(drawersAriaLabels);
30
36
  const regularOpenButton = (React.createElement(TagName, { ref: openButtonWrapperRef, "aria-label": mainLabel, className: styles.toggle, "aria-hidden": isOpen },
31
37
  React.createElement(AppLayoutButton, { ref: toggleRefs.toggle, className: toggleClassName, iconName: iconName, ariaLabel: openLabel, onClick: () => onToggle(true), ariaExpanded: false })));
32
- return (React.createElement("div", { className: clsx(styles.drawer, {
38
+ return (React.createElement("div", { ref: ref, className: clsx(styles.drawer, {
33
39
  [styles['drawer-closed']]: !isOpen,
34
40
  [testutilStyles['drawer-closed']]: !isOpen,
35
41
  [styles['drawer-mobile']]: isMobile,
@@ -54,8 +60,22 @@ export function Drawer({ contentClassName, toggleClassName, closeClassName, widt
54
60
  } },
55
61
  React.createElement("div", { style: { width: drawerContentWidth, top: topOffset, bottom: bottomOffset }, className: clsx(styles['drawer-content'], contentClassName) },
56
62
  !isMobile && regularOpenButton,
57
- React.createElement(TagName, { "aria-label": mainLabel, "aria-hidden": !isOpen },
58
- React.createElement(CloseButton, { ref: toggleRefs.close, className: closeClassName, ariaLabel: closeLabel, onClick: () => onToggle(false) }),
63
+ resizeHandle,
64
+ React.createElement(TagName, { "aria-label": drawers ? drawerMainLabel : mainLabel, "aria-hidden": !isOpen },
65
+ React.createElement(CloseButton, { ref: toggleRefs.close, className: closeClassName, ariaLabel: drawers ? drawerCloseLabel : closeLabel, onClick: () => {
66
+ onToggle(false);
67
+ drawers === null || drawers === void 0 ? void 0 : drawers.onChange({ activeDrawerId: undefined });
68
+ } }),
59
69
  children))));
70
+ });
71
+ export function DrawerTriggersBar({ isMobile, topOffset, bottomOffset, drawers, contentClassName, }) {
72
+ var _a;
73
+ return (React.createElement("div", { className: clsx(styles.drawer, styles['drawer-closed'], testutilStyles['drawer-closed'], {
74
+ [styles['drawer-mobile']]: isMobile,
75
+ }) },
76
+ React.createElement("div", { style: { top: topOffset, bottom: bottomOffset }, className: clsx(styles['drawer-content'], styles['non-interactive'], contentClassName) }, !isMobile && (React.createElement("aside", { "aria-label": drawers === null || drawers === void 0 ? void 0 : drawers.ariaLabel, className: styles['drawer-triggers'] }, (_a = drawers === null || drawers === void 0 ? void 0 : drawers.items) === null || _a === void 0 ? void 0 : _a.map((item, index) => {
77
+ var _a;
78
+ return (React.createElement(AppLayoutButton, { className: clsx(styles.trigger, styles['trigger-drawer'], drawers.activeDrawerId === item.id && styles.selected), key: `drawer-trigger-${index}`, iconName: item.trigger.iconName, iconSvg: item.trigger.iconSvg, ariaLabel: (_a = item.ariaLabels) === null || _a === void 0 ? void 0 : _a.triggerButton, onClick: () => drawers.onChange({ activeDrawerId: item.id }), ariaExpanded: drawers.activeDrawerId !== undefined }));
79
+ }))))));
60
80
  }
61
81
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["app-layout/drawer/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEzE,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAC3D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAqBrC,0FAA0F;AAC1F,qFAAqF;AACrF,uFAAuF;AACvF,4EAA4E;AAC5E,wFAAwF;AACxF,0FAA0F;AAC1F,0FAA0F;AAC1F,wBAAwB;AACxB,0FAA0F;AAC1F,4FAA4F;AAC5F,WAAW;AACX,oBAAoB;AACpB,iDAAiD;AACjD,iDAAiD;AACjD,iDAAiD;AACjD,sFAAsF;AAEtF,MAAM,UAAU,MAAM,CAAC,EACrB,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,KAAK,EACL,IAAI,EACJ,UAAU,EACV,SAAS,EACT,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,QAAQ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I,CAAC,CAAC,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,EAAE;oBAClE,WAAW,CAAC,CAAC,CAAC,CAAC;iBAChB;YACH,CAAC;YACH,CAAC,CAAC,SAAS,EAEf,OAAO,EAAE,KAAK,CAAC,EAAE;;YACf,IAAI,OAAO,EAAE;gBACX,OAAO,CAAC,KAAK,CAAC,CAAC;aAChB;YAED,IAAI,CAAC,MAAM,EAAE;gBACX,sFAAsF;gBACtF,IACE,oBAAoB,CAAC,OAAO,KAAK,KAAK,CAAC,MAAM;oBAC7C,CAAC,CAAA,MAAA,oBAAoB,CAAC,OAAO,0CAAE,QAAQ,CAAC,KAAK,CAAC,MAAc,CAAC,CAAA,EAC7D;oBACA,QAAQ,CAAC,IAAI,CAAC,CAAC;iBAChB;aACF;QACH,CAAC;QAED,6BACE,KAAK,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,EAC1E,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;YAE1D,CAAC,QAAQ,IAAI,iBAAiB;YAC/B,oBAAC,OAAO,kBAAa,SAAS,iBAAe,CAAC,MAAM;gBAClD,oBAAC,WAAW,IACV,GAAG,EAAE,UAAU,CAAC,KAAK,EACrB,SAAS,EAAE,cAAc,EACzB,SAAS,EAAE,UAAU,EACrB,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,GAC9B;gBACD,QAAQ,CACD,CACN,CACF,CACP,CAAC;AACJ,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, { useRef } from 'react';\nimport { AppLayoutButton, CloseButton, togglesConfig } from '../toggles';\nimport { AppLayoutProps } from '../interfaces';\nimport testutilStyles from '../test-classes/styles.css.js';\nimport styles from './styles.css.js';\nimport { FocusControlRefs } from '../utils/use-focus-control';\n\nexport interface DesktopDrawerProps {\n contentClassName: string;\n toggleClassName: string;\n closeClassName: string;\n toggleRefs: FocusControlRefs;\n width: number;\n topOffset: number | undefined;\n bottomOffset: number | undefined;\n ariaLabels: AppLayoutProps.Labels | undefined;\n children: React.ReactNode;\n type: keyof typeof togglesConfig;\n isMobile: boolean;\n isOpen: boolean;\n onToggle: (isOpen: boolean) => void;\n onClick?: (event: React.MouseEvent) => void;\n onLoseFocus?: (event: React.FocusEvent) => void;\n}\n\n// We are using two landmarks per drawer, i.e. two NAVs and two ASIDEs, because of several\n// known bugs in NVDA that cause focus changes within a container to sometimes not be\n// announced. As a result, we use one region for the open button and one region for the\n// actual drawer content, always hiding the other one when it's not visible.\n// An alternative solution to follow a more classic implementation here to only have one\n// button that triggers the opening/closing of the drawer also did not work due to another\n// series of bugs in NVDA (together with Firefox) which prevent the changed expanded state\n// from being announced.\n// Even with this workaround in place, the announcement of the close button when opening a\n// panel in NVDA is not working correctly. The suspected root cause is one of the bugs below\n// as well.\n// Relevant tickets:\n// * https://github.com/nvaccess/nvda/issues/6606\n// * https://github.com/nvaccess/nvda/issues/5825\n// * https://github.com/nvaccess/nvda/issues/5247\n// * https://github.com/nvaccess/nvda/pull/8869 (reverted PR that was going to fix it)\n\nexport function Drawer({\n contentClassName,\n toggleClassName,\n closeClassName,\n width,\n type,\n toggleRefs,\n topOffset,\n bottomOffset,\n ariaLabels,\n children,\n isOpen,\n isMobile,\n onToggle,\n onClick,\n onLoseFocus,\n}: DesktopDrawerProps) {\n const { TagName, iconName, getLabels } = togglesConfig[type];\n const { mainLabel, closeLabel, openLabel } = getLabels(ariaLabels);\n const drawerContentWidthOpen = isMobile ? undefined : width;\n const drawerContentWidth = isOpen ? drawerContentWidthOpen : undefined;\n const openButtonWrapperRef = useRef<HTMLElement | null>(null);\n\n const regularOpenButton = (\n <TagName ref={openButtonWrapperRef} aria-label={mainLabel} className={styles.toggle} aria-hidden={isOpen}>\n <AppLayoutButton\n ref={toggleRefs.toggle}\n className={toggleClassName}\n iconName={iconName}\n ariaLabel={openLabel}\n onClick={() => onToggle(true)}\n ariaExpanded={false}\n />\n </TagName>\n );\n\n return (\n <div\n className={clsx(styles.drawer, {\n [styles['drawer-closed']]: !isOpen,\n [testutilStyles['drawer-closed']]: !isOpen,\n [styles['drawer-mobile']]: isMobile,\n })}\n style={{ width: drawerContentWidth }}\n onBlur={\n onLoseFocus\n ? e => {\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n onLoseFocus(e);\n }\n }\n : undefined\n }\n onClick={event => {\n if (onClick) {\n onClick(event);\n }\n\n if (!isOpen) {\n // to prevent calling onToggle from the drawer when it's called from the toggle button\n if (\n openButtonWrapperRef.current === event.target ||\n !openButtonWrapperRef.current?.contains(event.target as Node)\n ) {\n onToggle(true);\n }\n }\n }}\n >\n <div\n style={{ width: drawerContentWidth, top: topOffset, bottom: bottomOffset }}\n className={clsx(styles['drawer-content'], contentClassName)}\n >\n {!isMobile && regularOpenButton}\n <TagName aria-label={mainLabel} aria-hidden={!isOpen}>\n <CloseButton\n ref={toggleRefs.close}\n className={closeClassName}\n ariaLabel={closeLabel}\n onClick={() => onToggle(false)}\n />\n {children}\n </TagName>\n </div>\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["app-layout/drawer/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEzE,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAC3D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAGrC,0FAA0F;AAC1F,qFAAqF;AACrF,uFAAuF;AACvF,4EAA4E;AAC5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AAS,EAAE,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC,iBAAiB,CAAC,EAAE,gBAAgB,CAAC,IAErF,CAAC,QAAQ,IAAI,CACZ,6CAAmB,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,iBAAiB,CAAC,IACxE,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,0CAAE,GAAG,CAAC,CAAC,IAAgB,EAAE,KAAa,EAAE,EAAE;;YAAC,OAAA,CACxD,oBAAC,eAAe,IACd,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,OAAO,EACd,MAAM,CAAC,gBAAgB,CAAC,EACxB,OAAO,CAAC,cAAc,KAAK,IAAI,CAAC,EAAE,IAAI,MAAM,CAAC,QAAQ,CACtD,EACD,GAAG,EAAE,kBAAkB,KAAK,EAAE,EAC9B,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,EAC/B,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,EAC7B,SAAS,EAAE,MAAA,IAAI,CAAC,UAAU,0CAAE,aAAa,EACzC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,cAAc,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,EAC5D,YAAY,EAAE,OAAO,CAAC,cAAc,KAAK,SAAS,GAClD,CACH,CAAA;SAAA,CAAC,CACI,CACT,CACG,CACF,CACP,CAAC;AACJ,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, { useRef } from 'react';\nimport { AppLayoutButton, CloseButton, togglesConfig } from '../toggles';\n\nimport testutilStyles from '../test-classes/styles.css.js';\nimport styles from './styles.css.js';\nimport { DesktopDrawerProps, DrawerTriggersBarProps, DrawerItem, DrawerItemAriaLabels } from './interfaces';\n\n// We are using two landmarks per drawer, i.e. two NAVs and two ASIDEs, because of several\n// known bugs in NVDA that cause focus changes within a container to sometimes not be\n// announced. As a result, we use one region for the open button and one region for the\n// actual drawer content, always hiding the other one when it's not visible.\n// An alternative solution to follow a more classic implementation here to only have one\n// button that triggers the opening/closing of the drawer also did not work due to another\n// series of bugs in NVDA (together with Firefox) which prevent the changed expanded state\n// from being announced.\n// Even with this workaround in place, the announcement of the close button when opening a\n// panel in NVDA is not working correctly. The suspected root cause is one of the bugs below\n// as well.\n// Relevant tickets:\n// * https://github.com/nvaccess/nvda/issues/6606\n// * https://github.com/nvaccess/nvda/issues/5825\n// * https://github.com/nvaccess/nvda/issues/5247\n// * https://github.com/nvaccess/nvda/pull/8869 (reverted PR that was going to fix it)\nexport const Drawer = React.forwardRef(\n (\n {\n contentClassName,\n toggleClassName,\n closeClassName,\n width,\n type,\n toggleRefs,\n topOffset,\n bottomOffset,\n ariaLabels,\n drawersAriaLabels,\n children,\n isOpen,\n isMobile,\n onToggle,\n onClick,\n onLoseFocus,\n drawers,\n resizeHandle,\n }: DesktopDrawerProps,\n ref: React.Ref<HTMLDivElement>\n ) => {\n const openButtonWrapperRef = useRef<HTMLElement | null>(null);\n const { TagName, iconName, getLabels } = togglesConfig[type];\n const { mainLabel, closeLabel, openLabel } = getLabels(ariaLabels);\n const drawerContentWidthOpen = isMobile ? undefined : width;\n const drawerContentWidth = isOpen ? drawerContentWidthOpen : undefined;\n\n const getDrawersLabels = (labels: DrawerItemAriaLabels = {}) => ({\n drawerMainLabel: labels?.content,\n drawerOpenLabel: labels?.triggerButton,\n drawerCloseLabel: labels?.closeButton,\n });\n const { drawerMainLabel, drawerCloseLabel } = getDrawersLabels(drawersAriaLabels);\n\n const regularOpenButton = (\n <TagName ref={openButtonWrapperRef} aria-label={mainLabel} className={styles.toggle} aria-hidden={isOpen}>\n <AppLayoutButton\n ref={toggleRefs.toggle}\n className={toggleClassName}\n iconName={iconName}\n ariaLabel={openLabel}\n onClick={() => onToggle(true)}\n ariaExpanded={false}\n />\n </TagName>\n );\n\n return (\n <div\n ref={ref}\n className={clsx(styles.drawer, {\n [styles['drawer-closed']]: !isOpen,\n [testutilStyles['drawer-closed']]: !isOpen,\n [styles['drawer-mobile']]: isMobile,\n })}\n style={{ width: drawerContentWidth }}\n onBlur={\n onLoseFocus\n ? e => {\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n onLoseFocus(e);\n }\n }\n : undefined\n }\n onClick={event => {\n if (onClick) {\n onClick(event);\n }\n if (!isOpen) {\n // to prevent calling onToggle from the drawer when it's called from the toggle button\n if (\n openButtonWrapperRef.current === event.target ||\n !openButtonWrapperRef.current?.contains(event.target as Node)\n ) {\n onToggle(true);\n }\n }\n }}\n >\n <div\n style={{ width: drawerContentWidth, top: topOffset, bottom: bottomOffset }}\n className={clsx(styles['drawer-content'], contentClassName)}\n >\n {!isMobile && regularOpenButton}\n {resizeHandle}\n <TagName aria-label={drawers ? drawerMainLabel : mainLabel} aria-hidden={!isOpen}>\n <CloseButton\n ref={toggleRefs.close}\n className={closeClassName}\n ariaLabel={drawers ? drawerCloseLabel : closeLabel}\n onClick={() => {\n onToggle(false);\n drawers?.onChange({ activeDrawerId: undefined });\n }}\n />\n {children}\n </TagName>\n </div>\n </div>\n );\n }\n);\n\nexport function DrawerTriggersBar({\n isMobile,\n topOffset,\n bottomOffset,\n drawers,\n contentClassName,\n}: DrawerTriggersBarProps) {\n return (\n <div\n className={clsx(styles.drawer, styles['drawer-closed'], testutilStyles['drawer-closed'], {\n [styles['drawer-mobile']]: isMobile,\n })}\n >\n <div\n style={{ top: topOffset, bottom: bottomOffset }}\n className={clsx(styles['drawer-content'], styles['non-interactive'], contentClassName)}\n >\n {!isMobile && (\n <aside aria-label={drawers?.ariaLabel} className={styles['drawer-triggers']}>\n {drawers?.items?.map((item: DrawerItem, index: number) => (\n <AppLayoutButton\n className={clsx(\n styles.trigger,\n styles['trigger-drawer'],\n drawers.activeDrawerId === item.id && styles.selected\n )}\n key={`drawer-trigger-${index}`}\n iconName={item.trigger.iconName}\n iconSvg={item.trigger.iconSvg}\n ariaLabel={item.ariaLabels?.triggerButton}\n onClick={() => drawers.onChange({ activeDrawerId: item.id })}\n ariaExpanded={drawers.activeDrawerId !== undefined}\n />\n ))}\n </aside>\n )}\n </div>\n </div>\n );\n}\n"]}
@@ -0,0 +1,84 @@
1
+ import React from 'react';
2
+ import { ButtonProps } from '../../button/interfaces';
3
+ import { togglesConfig } from '../toggles';
4
+ import { AppLayoutProps } from '../interfaces';
5
+ import { IconProps } from '../../icon/interfaces';
6
+ import { DrawerFocusControlRefs } from '../utils/use-drawer-focus-control';
7
+ export interface DesktopDrawerProps {
8
+ contentClassName: string;
9
+ toggleClassName: string;
10
+ closeClassName: string;
11
+ toggleRefs: {
12
+ toggle: React.Ref<ButtonProps.Ref>;
13
+ close: React.Ref<ButtonProps.Ref>;
14
+ };
15
+ width: number;
16
+ topOffset: number | undefined;
17
+ bottomOffset: number | undefined;
18
+ ariaLabels: AppLayoutProps.Labels | undefined;
19
+ drawersAriaLabels?: DrawerItemAriaLabels | undefined;
20
+ children: React.ReactNode;
21
+ type: keyof typeof togglesConfig;
22
+ isMobile: boolean;
23
+ isOpen: boolean;
24
+ onToggle: (isOpen: boolean) => void;
25
+ onClick?: (event: React.MouseEvent) => void;
26
+ onLoseFocus?: (event: React.FocusEvent) => void;
27
+ drawers?: {
28
+ items: Array<DrawerItem>;
29
+ activeDrawerId: string | undefined;
30
+ onChange: (changeDetail: {
31
+ activeDrawerId: string | undefined;
32
+ }) => void;
33
+ };
34
+ resizeHandle?: React.ReactNode;
35
+ }
36
+ export interface ResizableDrawerProps extends DesktopDrawerProps {
37
+ activeDrawer: DrawerItem;
38
+ onResize: (resizeDetail: {
39
+ size: number;
40
+ id: string;
41
+ }) => void;
42
+ size: number;
43
+ getMaxWidth: () => number;
44
+ refs: DrawerFocusControlRefs;
45
+ }
46
+ export interface DrawerTriggersBarProps {
47
+ contentClassName: string;
48
+ topOffset: number | undefined;
49
+ bottomOffset: number | undefined;
50
+ isMobile: boolean;
51
+ drawers?: {
52
+ items: Array<DrawerItem>;
53
+ activeDrawerId: string | undefined;
54
+ onChange: (changeDetail: {
55
+ activeDrawerId: string | undefined;
56
+ }) => void;
57
+ ariaLabel: string;
58
+ };
59
+ }
60
+ export interface DrawerItemAriaLabels {
61
+ content?: string;
62
+ closeButton?: string;
63
+ triggerButton?: string;
64
+ resizeHandle?: string;
65
+ }
66
+ export interface DrawerItem {
67
+ id: string;
68
+ content: React.ReactNode;
69
+ trigger: {
70
+ iconName?: IconProps.Name;
71
+ iconSvg?: React.ReactNode;
72
+ };
73
+ ariaLabels: DrawerItemAriaLabels;
74
+ resizable?: boolean;
75
+ size?: number;
76
+ }
77
+ export interface SizeControlProps {
78
+ position: 'side';
79
+ splitPanelRef?: React.RefObject<HTMLDivElement>;
80
+ handleRef?: React.RefObject<HTMLDivElement>;
81
+ setSidePanelWidth: (width: number) => void;
82
+ setBottomPanelHeight: (height: number) => void;
83
+ }
84
+ //# sourceMappingURL=interfaces.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.d.ts","sourceRoot":"lib/default/","sources":["app-layout/drawer/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAE3E,MAAM,WAAW,kBAAkB;IACjC,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE;QACV,MAAM,EAAE,KAAK,CA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KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,oBAAoB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CAChD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["app-layout/drawer/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { ButtonProps } from '../../button/interfaces';\nimport { togglesConfig } from '../toggles';\nimport { AppLayoutProps } from '../interfaces';\nimport { IconProps } from '../../icon/interfaces';\n\nimport { DrawerFocusControlRefs } from '../utils/use-drawer-focus-control';\n\nexport interface DesktopDrawerProps {\n contentClassName: string;\n toggleClassName: string;\n closeClassName: string;\n toggleRefs: {\n toggle: React.Ref<ButtonProps.Ref>;\n close: React.Ref<ButtonProps.Ref>;\n };\n width: number;\n topOffset: number | undefined;\n bottomOffset: number | undefined;\n ariaLabels: AppLayoutProps.Labels | undefined;\n drawersAriaLabels?: DrawerItemAriaLabels | undefined;\n children: React.ReactNode;\n type: keyof typeof togglesConfig;\n isMobile: boolean;\n isOpen: boolean;\n onToggle: (isOpen: boolean) => void;\n onClick?: (event: React.MouseEvent) => void;\n onLoseFocus?: (event: React.FocusEvent) => void;\n drawers?: {\n items: Array<DrawerItem>;\n activeDrawerId: string | undefined;\n onChange: (changeDetail: { activeDrawerId: string | undefined }) => void;\n };\n resizeHandle?: React.ReactNode;\n}\n\nexport interface ResizableDrawerProps extends DesktopDrawerProps {\n activeDrawer: DrawerItem;\n onResize: (resizeDetail: { size: number; id: string }) => void;\n size: number;\n getMaxWidth: () => number;\n refs: DrawerFocusControlRefs;\n}\n\nexport interface DrawerTriggersBarProps {\n contentClassName: string;\n topOffset: number | undefined;\n bottomOffset: number | undefined;\n isMobile: boolean;\n drawers?: {\n items: Array<DrawerItem>;\n activeDrawerId: string | undefined;\n onChange: (changeDetail: { activeDrawerId: string | undefined }) => void;\n ariaLabel: string;\n };\n}\n\nexport interface DrawerItemAriaLabels {\n content?: string;\n closeButton?: string;\n triggerButton?: string;\n resizeHandle?: string;\n}\n\nexport interface DrawerItem {\n id: string;\n content: React.ReactNode;\n trigger: {\n iconName?: IconProps.Name;\n iconSvg?: React.ReactNode;\n };\n ariaLabels: DrawerItemAriaLabels;\n resizable?: boolean;\n size?: number;\n}\n\nexport interface SizeControlProps {\n position: 'side';\n splitPanelRef?: React.RefObject<HTMLDivElement>;\n handleRef?: React.RefObject<HTMLDivElement>;\n setSidePanelWidth: (width: number) => void;\n setBottomPanelHeight: (height: number) => void;\n}\n"]}
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { ResizableDrawerProps } from './interfaces';
3
+ export declare const ResizableDrawer: ({ onResize, size, getMaxWidth, refs, activeDrawer, ...props }: ResizableDrawerProps) => JSX.Element;
4
+ //# sourceMappingURL=resizable-drawer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resizable-drawer.d.ts","sourceRoot":"lib/default/","sources":["app-layout/drawer/resizable-drawer.tsx"],"names":[],"mappings":";AAYA,OAAO,EAAoB,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEtE,eAAO,MAAM,eAAe,kEAOzB,oBAAoB,gBAsEtB,CAAC"}
@@ -0,0 +1,51 @@
1
+ import { __rest } from "tslib";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ import clsx from 'clsx';
5
+ import React, { useEffect, useState, useRef } from 'react';
6
+ import { getLimitedValue } from '../../split-panel/utils/size-utils';
7
+ import { usePointerEvents } from '../../split-panel/utils/use-pointer-events';
8
+ import { useKeyboardEvents } from '../../split-panel/utils/use-keyboard-events';
9
+ import { Drawer } from './index';
10
+ import ResizeHandler from '../../split-panel/icons/resize-handler';
11
+ import splitPanelStyles from '../../split-panel/styles.css.js';
12
+ export const ResizableDrawer = (_a) => {
13
+ var { onResize, size, getMaxWidth, refs, activeDrawer } = _a, props = __rest(_a, ["onResize", "size", "getMaxWidth", "refs", "activeDrawer"]);
14
+ const { isOpen, children, isMobile } = props;
15
+ const MIN_WIDTH = (activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.size) && activeDrawer.size < 280 ? activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.size : 280;
16
+ const [relativeSize, setRelativeSize] = useState(0);
17
+ useEffect(() => {
18
+ // effects are called inside out in the components tree
19
+ // wait one frame to allow app-layout to complete its calculations
20
+ const handle = requestAnimationFrame(() => {
21
+ const maxSize = getMaxWidth();
22
+ setRelativeSize((size / maxSize) * 100);
23
+ });
24
+ return () => cancelAnimationFrame(handle);
25
+ }, [size, getMaxWidth]);
26
+ const setSidePanelWidth = (width) => {
27
+ const maxWidth = getMaxWidth();
28
+ const size = getLimitedValue(MIN_WIDTH, width, maxWidth);
29
+ const id = activeDrawer.id;
30
+ if (isOpen && maxWidth >= MIN_WIDTH) {
31
+ onResize({ size, id });
32
+ }
33
+ };
34
+ const position = 'side';
35
+ const setBottomPanelHeight = () => { };
36
+ const drawerRefObject = useRef(null);
37
+ const sizeControlProps = {
38
+ position,
39
+ splitPanelRef: drawerRefObject,
40
+ handleRef: refs.slider,
41
+ setSidePanelWidth,
42
+ setBottomPanelHeight,
43
+ };
44
+ const onSliderPointerDown = usePointerEvents(sizeControlProps);
45
+ const onKeyDown = useKeyboardEvents(sizeControlProps);
46
+ const resizeHandle = (React.createElement("div", { ref: refs.slider, role: "slider", tabIndex: 0, "aria-label": activeDrawer.ariaLabels.resizeHandle, "aria-valuemax": 100, "aria-valuemin": 0, "aria-valuenow": relativeSize, className: clsx(splitPanelStyles.slider, splitPanelStyles[`slider-side`]), onKeyDown: onKeyDown, onPointerDown: onSliderPointerDown },
47
+ React.createElement(ResizeHandler, { className: clsx(splitPanelStyles['slider-icon'], splitPanelStyles[`slider-icon-side`]) })));
48
+ return (React.createElement(Drawer, Object.assign({}, props, { ref: drawerRefObject, resizeHandle: !isMobile &&
49
+ activeDrawer.resizable && React.createElement("div", { className: splitPanelStyles['slider-wrapper-side'] }, resizeHandle) }), children));
50
+ };
51
+ //# sourceMappingURL=resizable-drawer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resizable-drawer.js","sourceRoot":"lib/default/","sources":["app-layout/drawer/resizable-drawer.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAC;AAChF,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,OAAO,aAAa,MAAM,wCAAwC,CAAC;AACnE,OAAO,gBAAgB,MAAM,iCAAiC,CAAC;AAG/D,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAOT,EAAE,EAAE;QAPK,EAC9B,QAAQ,EACR,IAAI,EACJ,WAAW,EACX,IAAI,EACJ,YAAY,OAES,EADlB,KAAK,cANsB,2DAO/B,CADS;IAER,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAE7C,MAAM,SAAS,GAAG,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,IAAI,KAAI,YAAY,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;IAC3F,MAAM,CAAC,YAAY,EAAE,eAAe,C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AE,IAAI,CAAC,MAAM,EAChB,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,CAAC,gBACC,YAAY,CAAC,UAAU,CAAC,YAAY,mBACjC,GAAG,mBACH,CAAC,mBACD,YAAY,EAC3B,SAAS,EAAE,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,CAAC,aAAa,CAAC,CAAC,EACzE,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,mBAAmB;QAElC,oBAAC,aAAa,IAAC,SAAS,EAAE,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC,EAAE,gBAAgB,CAAC,kBAAkB,CAAC,CAAC,GAAI,CACrG,CACP,CAAC;IAEF,OAAO,CACL,oBAAC,MAAM,oBACD,KAAK,IACT,GAAG,EAAE,eAAe,EACpB,YAAY,EACV,CAAC,QAAQ;YACT,YAAY,CAAC,SAAS,IAAI,6BAAK,SAAS,EAAE,gBAAgB,CAAC,qBAAqB,CAAC,IAAG,YAAY,CAAO,KAGxG,QAAQ,CACF,CACV,CAAC;AACJ,CAAC,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, { useEffect, useState, useRef } from 'react';\n\nimport { getLimitedValue } from '../../split-panel/utils/size-utils';\nimport { usePointerEvents } from '../../split-panel/utils/use-pointer-events';\nimport { useKeyboardEvents } from '../../split-panel/utils/use-keyboard-events';\nimport { Drawer } from './index';\n\nimport ResizeHandler from '../../split-panel/icons/resize-handler';\nimport splitPanelStyles from '../../split-panel/styles.css.js';\nimport { SizeControlProps, ResizableDrawerProps } from './interfaces';\n\nexport const ResizableDrawer = ({\n onResize,\n size,\n getMaxWidth,\n refs,\n activeDrawer,\n ...props\n}: ResizableDrawerProps) => {\n const { isOpen, children, isMobile } = props;\n\n const MIN_WIDTH = activeDrawer?.size && activeDrawer.size < 280 ? activeDrawer?.size : 280;\n const [relativeSize, setRelativeSize] = useState(0);\n\n useEffect(() => {\n // effects are called inside out in the components tree\n // wait one frame to allow app-layout to complete its calculations\n const handle = requestAnimationFrame(() => {\n const maxSize = getMaxWidth();\n setRelativeSize((size / maxSize) * 100);\n });\n return () => cancelAnimationFrame(handle);\n }, [size, getMaxWidth]);\n\n const setSidePanelWidth = (width: number) => {\n const maxWidth = getMaxWidth();\n const size = getLimitedValue(MIN_WIDTH, width, maxWidth);\n const id = activeDrawer.id;\n\n if (isOpen && maxWidth >= MIN_WIDTH) {\n onResize({ size, id });\n }\n };\n\n const position = 'side';\n const setBottomPanelHeight = () => {};\n const drawerRefObject = useRef<HTMLDivElement>(null);\n\n const sizeControlProps: SizeControlProps = {\n position,\n splitPanelRef: drawerRefObject,\n handleRef: refs.slider,\n setSidePanelWidth,\n setBottomPanelHeight,\n };\n\n const onSliderPointerDown = usePointerEvents(sizeControlProps);\n const onKeyDown = useKeyboardEvents(sizeControlProps);\n\n const resizeHandle = (\n <div\n ref={refs.slider}\n role=\"slider\"\n tabIndex={0}\n aria-label={activeDrawer.ariaLabels.resizeHandle}\n aria-valuemax={100}\n aria-valuemin={0}\n aria-valuenow={relativeSize}\n className={clsx(splitPanelStyles.slider, splitPanelStyles[`slider-side`])}\n onKeyDown={onKeyDown}\n onPointerDown={onSliderPointerDown}\n >\n <ResizeHandler className={clsx(splitPanelStyles['slider-icon'], splitPanelStyles[`slider-icon-side`])} />\n </div>\n );\n\n return (\n <Drawer\n {...props}\n ref={drawerRefObject}\n resizeHandle={\n !isMobile &&\n activeDrawer.resizable && <div className={splitPanelStyles['slider-wrapper-side']}>{resizeHandle}</div>\n }\n >\n {children}\n </Drawer>\n );\n};\n"]}
@@ -1,10 +1,15 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "toggle": "awsui_toggle_1uo6m_1edrs_97",
5
- "drawer": "awsui_drawer_1uo6m_1edrs_102",
6
- "drawer-mobile": "awsui_drawer-mobile_1uo6m_1edrs_108",
7
- "drawer-closed": "awsui_drawer-closed_1uo6m_1edrs_111",
8
- "drawer-content": "awsui_drawer-content_1uo6m_1edrs_119"
4
+ "toggle": "awsui_toggle_1uo6m_y69q2_97",
5
+ "drawer-triggers": "awsui_drawer-triggers_1uo6m_y69q2_102",
6
+ "drawer": "awsui_drawer_1uo6m_y69q2_102",
7
+ "drawer-mobile": "awsui_drawer-mobile_1uo6m_y69q2_112",
8
+ "drawer-closed": "awsui_drawer-closed_1uo6m_y69q2_115",
9
+ "drawer-content": "awsui_drawer-content_1uo6m_y69q2_123",
10
+ "non-interactive": "awsui_non-interactive_1uo6m_y69q2_141",
11
+ "trigger": "awsui_trigger_1uo6m_y69q2_149",
12
+ "trigger-drawer": "awsui_trigger-drawer_1uo6m_y69q2_158",
13
+ "selected": "awsui_selected_1uo6m_y69q2_158"
9
14
  };
10
15