@cloudscape-design/components 3.0.640 → 3.0.641
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app-layout/drawer/index.js +1 -1
- package/app-layout/drawer/index.js.map +1 -1
- package/app-layout/drawer/resizable-drawer.d.ts.map +1 -1
- package/app-layout/drawer/resizable-drawer.js +2 -5
- package/app-layout/drawer/resizable-drawer.js.map +1 -1
- package/app-layout/drawer/styles.css.js +13 -12
- package/app-layout/drawer/styles.scoped.css +30 -20
- package/app-layout/drawer/styles.selectors.js +13 -12
- package/app-layout/utils/use-resize.d.ts.map +1 -1
- package/app-layout/utils/use-resize.js +3 -7
- package/app-layout/utils/use-resize.js.map +1 -1
- package/app-layout/visual-refresh/drawers.js +1 -1
- package/app-layout/visual-refresh/drawers.js.map +1 -1
- package/app-layout/visual-refresh/split-panel.d.ts.map +1 -1
- package/app-layout/visual-refresh/split-panel.js +1 -3
- package/app-layout/visual-refresh/split-panel.js.map +1 -1
- package/autosuggest/plain-list.d.ts.map +1 -1
- package/autosuggest/plain-list.js +1 -3
- package/autosuggest/plain-list.js.map +1 -1
- package/autosuggest/virtual-list.d.ts.map +1 -1
- package/autosuggest/virtual-list.js +1 -3
- package/autosuggest/virtual-list.js.map +1 -1
- package/calendar/utils/intl.d.ts.map +1 -1
- package/calendar/utils/intl.js +0 -3
- package/calendar/utils/intl.js.map +1 -1
- package/container/internal.d.ts.map +1 -1
- package/container/internal.js +3 -0
- package/container/internal.js.map +1 -1
- package/container/styles.css.js +29 -28
- package/container/styles.scoped.css +55 -52
- package/container/styles.selectors.js +29 -28
- package/date-range-picker/calendar/grids/index.d.ts.map +1 -1
- package/date-range-picker/calendar/grids/index.js +0 -8
- package/date-range-picker/calendar/grids/index.js.map +1 -1
- package/form/interfaces.d.ts +3 -8
- package/form/interfaces.d.ts.map +1 -1
- package/form/interfaces.js.map +1 -1
- package/form/internal.d.ts +1 -1
- package/form/internal.d.ts.map +1 -1
- package/form/internal.js +14 -20
- package/form/internal.js.map +1 -1
- package/form/styles.css.js +8 -9
- package/form/styles.scoped.css +8 -8
- package/form/styles.selectors.js +8 -9
- package/header/internal.d.ts.map +1 -1
- package/header/internal.js +1 -3
- package/header/internal.js.map +1 -1
- package/header/styles.css.js +34 -35
- package/header/styles.scoped.css +50 -53
- package/header/styles.selectors.js +34 -35
- package/input/styles.css.js +13 -13
- package/input/styles.scoped.css +32 -35
- package/input/styles.selectors.js +13 -13
- package/internal/components/chart-plot/application-controller.js +3 -13
- package/internal/components/chart-plot/application-controller.js.map +1 -1
- package/internal/components/dropdown/index.d.ts.map +1 -1
- package/internal/components/dropdown/index.js +0 -2
- package/internal/components/dropdown/index.js.map +1 -1
- package/internal/components/dropdown/styles.css.js +20 -20
- package/internal/components/dropdown/styles.scoped.css +39 -45
- package/internal/components/dropdown/styles.selectors.js +20 -20
- package/internal/components/panel-resize-handle/icon.d.ts +5 -0
- package/internal/components/panel-resize-handle/icon.d.ts.map +1 -0
- package/internal/components/panel-resize-handle/icon.js +9 -0
- package/internal/components/panel-resize-handle/icon.js.map +1 -0
- package/internal/components/panel-resize-handle/index.d.ts +12 -0
- package/internal/components/panel-resize-handle/index.d.ts.map +1 -0
- package/internal/components/panel-resize-handle/index.js +11 -0
- package/internal/components/panel-resize-handle/index.js.map +1 -0
- package/internal/components/panel-resize-handle/styles.css.js +10 -0
- package/internal/components/panel-resize-handle/styles.scoped.css +153 -0
- package/internal/components/panel-resize-handle/styles.selectors.js +11 -0
- package/internal/context/single-tab-stop-navigation-context.js +2 -2
- package/internal/context/single-tab-stop-navigation-context.js.map +1 -1
- package/internal/environment.js +1 -1
- package/internal/environment.json +1 -1
- package/internal/manifest.json +1 -1
- package/internal/utils/content-header-utils.d.ts +0 -2
- package/internal/utils/content-header-utils.d.ts.map +1 -1
- package/internal/utils/content-header-utils.js +0 -3
- package/internal/utils/content-header-utils.js.map +1 -1
- package/internal/utils/dom.d.ts.map +1 -1
- package/internal/utils/dom.js +7 -27
- package/internal/utils/dom.js.map +1 -1
- package/internal/utils/global-flags.d.ts +0 -1
- package/internal/utils/global-flags.d.ts.map +1 -1
- package/internal/utils/global-flags.js.map +1 -1
- package/package.json +1 -1
- package/pie-chart/labels.d.ts.map +1 -1
- package/pie-chart/labels.js +1 -4
- package/pie-chart/labels.js.map +1 -1
- package/pie-chart/pie-chart.d.ts.map +1 -1
- package/pie-chart/pie-chart.js +0 -3
- package/pie-chart/pie-chart.js.map +1 -1
- package/pie-chart/utils.d.ts.map +1 -1
- package/pie-chart/utils.js +0 -4
- package/pie-chart/utils.js.map +1 -1
- package/popover/internal.js +3 -6
- package/popover/internal.js.map +1 -1
- package/popover/styles.css.js +49 -50
- package/popover/styles.scoped.css +66 -69
- package/popover/styles.selectors.js +49 -50
- package/segmented-control/styles.css.js +14 -14
- package/segmented-control/styles.scoped.css +33 -33
- package/segmented-control/styles.selectors.js +14 -14
- package/split-panel/implementation.d.ts.map +1 -1
- package/split-panel/implementation.js +6 -3
- package/split-panel/implementation.js.map +1 -1
- package/split-panel/styles.css.js +26 -31
- package/split-panel/styles.scoped.css +41 -97
- package/split-panel/styles.selectors.js +26 -31
- package/table/selection/selection-control.d.ts.map +1 -1
- package/table/selection/selection-control.js.map +1 -1
- package/table/table-role/utils.d.ts.map +1 -1
- package/table/table-role/utils.js +6 -1
- package/table/table-role/utils.js.map +1 -1
- package/tiles/styles.css.js +29 -29
- package/tiles/styles.scoped.css +82 -95
- package/tiles/styles.selectors.js +29 -29
- package/split-panel/icons/resize-handler.d.ts +0 -6
- package/split-panel/icons/resize-handler.d.ts.map +0 -1
- package/split-panel/icons/resize-handler.js +0 -8
- package/split-panel/icons/resize-handler.js.map +0 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"segment": "
|
|
5
|
-
"disabled": "
|
|
6
|
-
"selected": "
|
|
7
|
-
"icon": "
|
|
8
|
-
"with-text": "awsui_with-
|
|
9
|
-
"with-no-text": "awsui_with-no-
|
|
10
|
-
"root": "
|
|
11
|
-
"segment-part": "awsui_segment-
|
|
12
|
-
"select": "
|
|
13
|
-
"segment-count-2": "awsui_segment-count-
|
|
14
|
-
"segment-count-3": "awsui_segment-count-
|
|
15
|
-
"segment-count-4": "awsui_segment-count-
|
|
16
|
-
"segment-count-5": "awsui_segment-count-
|
|
17
|
-
"segment-count-6": "awsui_segment-count-
|
|
4
|
+
"segment": "awsui_segment_8cbea_xqccj_103",
|
|
5
|
+
"disabled": "awsui_disabled_8cbea_xqccj_183",
|
|
6
|
+
"selected": "awsui_selected_8cbea_xqccj_191",
|
|
7
|
+
"icon": "awsui_icon_8cbea_xqccj_212",
|
|
8
|
+
"with-text": "awsui_with-text_8cbea_xqccj_216",
|
|
9
|
+
"with-no-text": "awsui_with-no-text_8cbea_xqccj_222",
|
|
10
|
+
"root": "awsui_root_8cbea_xqccj_231",
|
|
11
|
+
"segment-part": "awsui_segment-part_8cbea_xqccj_266",
|
|
12
|
+
"select": "awsui_select_8cbea_xqccj_191",
|
|
13
|
+
"segment-count-2": "awsui_segment-count-2_8cbea_xqccj_285",
|
|
14
|
+
"segment-count-3": "awsui_segment-count-3_8cbea_xqccj_289",
|
|
15
|
+
"segment-count-4": "awsui_segment-count-4_8cbea_xqccj_293",
|
|
16
|
+
"segment-count-5": "awsui_segment-count-5_8cbea_xqccj_297",
|
|
17
|
+
"segment-count-6": "awsui_segment-count-6_8cbea_xqccj_301"
|
|
18
18
|
};
|
|
19
19
|
|
|
@@ -100,7 +100,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
100
100
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
101
101
|
SPDX-License-Identifier: Apache-2.0
|
|
102
102
|
*/
|
|
103
|
-
.
|
|
103
|
+
.awsui_segment_8cbea_xqccj_103:not(#\9) {
|
|
104
104
|
font-size: var(--font-size-body-m-x4okxb, 14px);
|
|
105
105
|
line-height: var(--line-height-body-m-30ar75, 20px);
|
|
106
106
|
word-wrap: break-word;
|
|
@@ -119,41 +119,41 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
119
119
|
color: var(--color-text-segment-default-nncpby, #414d5c);
|
|
120
120
|
overflow: visible;
|
|
121
121
|
}
|
|
122
|
-
.
|
|
122
|
+
.awsui_segment_8cbea_xqccj_103:not(#\9):focus {
|
|
123
123
|
outline: none;
|
|
124
124
|
}
|
|
125
|
-
.
|
|
125
|
+
.awsui_segment_8cbea_xqccj_103:not(#\9):nth-child(1) {
|
|
126
126
|
grid-column: 1;
|
|
127
127
|
-ms-grid-column: 1;
|
|
128
128
|
}
|
|
129
|
-
.
|
|
129
|
+
.awsui_segment_8cbea_xqccj_103:not(#\9):nth-child(2) {
|
|
130
130
|
grid-column: 2;
|
|
131
131
|
-ms-grid-column: 2;
|
|
132
132
|
}
|
|
133
|
-
.
|
|
133
|
+
.awsui_segment_8cbea_xqccj_103:not(#\9):nth-child(3) {
|
|
134
134
|
grid-column: 3;
|
|
135
135
|
-ms-grid-column: 3;
|
|
136
136
|
}
|
|
137
|
-
.
|
|
137
|
+
.awsui_segment_8cbea_xqccj_103:not(#\9):nth-child(4) {
|
|
138
138
|
grid-column: 4;
|
|
139
139
|
-ms-grid-column: 4;
|
|
140
140
|
}
|
|
141
|
-
.
|
|
141
|
+
.awsui_segment_8cbea_xqccj_103:not(#\9):nth-child(5) {
|
|
142
142
|
grid-column: 5;
|
|
143
143
|
-ms-grid-column: 5;
|
|
144
144
|
}
|
|
145
|
-
.
|
|
145
|
+
.awsui_segment_8cbea_xqccj_103:not(#\9):nth-child(6) {
|
|
146
146
|
grid-column: 6;
|
|
147
147
|
-ms-grid-column: 6;
|
|
148
148
|
}
|
|
149
|
-
body[data-awsui-focus-visible=true] .
|
|
149
|
+
body[data-awsui-focus-visible=true] .awsui_segment_8cbea_xqccj_103:not(#\9):focus {
|
|
150
150
|
position: relative;
|
|
151
151
|
}
|
|
152
|
-
body[data-awsui-focus-visible=true] .
|
|
152
|
+
body[data-awsui-focus-visible=true] .awsui_segment_8cbea_xqccj_103:not(#\9):focus {
|
|
153
153
|
outline: 2px dotted transparent;
|
|
154
154
|
outline-offset: calc(var(--space-segmented-control-focus-outline-gutter-gbye20, 4px) - 1px);
|
|
155
155
|
}
|
|
156
|
-
body[data-awsui-focus-visible=true] .
|
|
156
|
+
body[data-awsui-focus-visible=true] .awsui_segment_8cbea_xqccj_103:not(#\9):focus::before {
|
|
157
157
|
content: " ";
|
|
158
158
|
display: block;
|
|
159
159
|
position: absolute;
|
|
@@ -167,59 +167,59 @@ body[data-awsui-focus-visible=true] .awsui_segment_8cbea_97spt_103:not(#\9):focu
|
|
|
167
167
|
border-end-end-radius: var(--border-radius-control-default-focus-ring-u8zbsz, 4px);
|
|
168
168
|
box-shadow: 0 0 0 2px var(--color-border-item-focused-b2ntyl, #0972d3);
|
|
169
169
|
}
|
|
170
|
-
.
|
|
170
|
+
.awsui_segment_8cbea_xqccj_103:not(#\9):last-child {
|
|
171
171
|
border-inline-end-width: var(--border-field-width-09w7vk, 2px);
|
|
172
172
|
border-start-start-radius: 0;
|
|
173
173
|
border-start-end-radius: var(--border-radius-button-ypmfry, 20px);
|
|
174
174
|
border-end-start-radius: 0;
|
|
175
175
|
border-end-end-radius: var(--border-radius-button-ypmfry, 20px);
|
|
176
176
|
}
|
|
177
|
-
.
|
|
177
|
+
.awsui_segment_8cbea_xqccj_103:not(#\9):first-child {
|
|
178
178
|
border-start-start-radius: var(--border-radius-button-ypmfry, 20px);
|
|
179
179
|
border-start-end-radius: 0;
|
|
180
180
|
border-end-start-radius: var(--border-radius-button-ypmfry, 20px);
|
|
181
181
|
border-end-end-radius: 0;
|
|
182
182
|
}
|
|
183
|
-
.
|
|
183
|
+
.awsui_segment_8cbea_xqccj_103.awsui_disabled_8cbea_xqccj_183:not(#\9) {
|
|
184
184
|
background: var(--color-background-segment-disabled-o4y9v5, #ffffff);
|
|
185
185
|
border-color: var(--color-border-segment-disabled-ylnixy, #414d5c);
|
|
186
186
|
color: var(--color-text-interactive-disabled-z7a3t4, #9ba7b6);
|
|
187
187
|
}
|
|
188
|
-
.
|
|
188
|
+
.awsui_segment_8cbea_xqccj_103:not(#\9):not(.awsui_disabled_8cbea_xqccj_183) + .awsui_segment_8cbea_xqccj_103.awsui_disabled_8cbea_xqccj_183 {
|
|
189
189
|
border-inline-start-color: var(--color-border-segment-default-a5zrkd, #414d5c);
|
|
190
190
|
}
|
|
191
|
-
.
|
|
191
|
+
.awsui_segment_8cbea_xqccj_103.awsui_selected_8cbea_xqccj_191:not(#\9) {
|
|
192
192
|
background: var(--color-background-segment-active-366806, #0972d3);
|
|
193
193
|
border-color: var(--color-border-segment-active-9ah16u, #414d5c);
|
|
194
194
|
color: var(--color-text-segment-active-6s77n9, #ffffff);
|
|
195
195
|
}
|
|
196
|
-
.
|
|
196
|
+
.awsui_segment_8cbea_xqccj_103.awsui_selected_8cbea_xqccj_191 + .awsui_segment_8cbea_xqccj_103:not(#\9), .awsui_segment_8cbea_xqccj_103.awsui_selected_8cbea_xqccj_191 + .awsui_segment_8cbea_xqccj_103.awsui_disabled_8cbea_xqccj_183:not(#\9) {
|
|
197
197
|
border-inline-start-color: var(--color-border-segment-active-9ah16u, #414d5c);
|
|
198
198
|
}
|
|
199
|
-
.
|
|
199
|
+
.awsui_segment_8cbea_xqccj_103:not(#\9):hover:not(.awsui_selected_8cbea_xqccj_191):not(.awsui_disabled_8cbea_xqccj_183):not(:focus) {
|
|
200
200
|
background: var(--color-background-segment-hover-jysoxv, #ffffff);
|
|
201
201
|
color: var(--color-text-segment-hover-k5ujfk, #0972d3);
|
|
202
202
|
border-color: var(--color-border-segment-hover-ggg2rz, #414d5c);
|
|
203
203
|
cursor: pointer;
|
|
204
204
|
}
|
|
205
|
-
.
|
|
205
|
+
.awsui_segment_8cbea_xqccj_103:not(#\9):hover:not(.awsui_selected_8cbea_xqccj_191):not(.awsui_disabled_8cbea_xqccj_183):not(:focus) + .awsui_segment_8cbea_xqccj_103:not(.awsui_selected_8cbea_xqccj_191) {
|
|
206
206
|
border-inline-start-color: var(--color-border-segment-hover-ggg2rz, #414d5c);
|
|
207
207
|
}
|
|
208
|
-
.
|
|
208
|
+
.awsui_segment_8cbea_xqccj_103.awsui_selected_8cbea_xqccj_191 + .awsui_segment_8cbea_xqccj_103:not(#\9):hover:not(.awsui_selected_8cbea_xqccj_191):not(.awsui_disabled_8cbea_xqccj_183):not(:focus) {
|
|
209
209
|
border-inline-start-color: var(--color-border-segment-active-9ah16u, #414d5c);
|
|
210
210
|
}
|
|
211
211
|
|
|
212
|
-
.
|
|
212
|
+
.awsui_icon_8cbea_xqccj_212:not(#\9) {
|
|
213
213
|
/* used in test-utils */
|
|
214
214
|
}
|
|
215
215
|
|
|
216
|
-
.awsui_with-
|
|
216
|
+
.awsui_with-text_8cbea_xqccj_216:not(#\9) {
|
|
217
217
|
position: relative;
|
|
218
218
|
inset-inline-start: calc(-1 * var(--space-xxs-p8yyaw, 4px));
|
|
219
219
|
margin-inline-end: var(--space-xxs-p8yyaw, 4px);
|
|
220
220
|
}
|
|
221
221
|
|
|
222
|
-
.awsui_with-no-
|
|
222
|
+
.awsui_with-no-text_8cbea_xqccj_222:not(#\9) {
|
|
223
223
|
margin-inline: auto;
|
|
224
224
|
inset-inline: 0;
|
|
225
225
|
}
|
|
@@ -228,7 +228,7 @@ body[data-awsui-focus-visible=true] .awsui_segment_8cbea_97spt_103:not(#\9):focu
|
|
|
228
228
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
229
229
|
SPDX-License-Identifier: Apache-2.0
|
|
230
230
|
*/
|
|
231
|
-
.
|
|
231
|
+
.awsui_root_8cbea_xqccj_231:not(#\9) {
|
|
232
232
|
border-collapse: separate;
|
|
233
233
|
border-spacing: 0;
|
|
234
234
|
box-sizing: border-box;
|
|
@@ -264,40 +264,40 @@ body[data-awsui-focus-visible=true] .awsui_segment_8cbea_97spt_103:not(#\9):focu
|
|
|
264
264
|
-moz-osx-font-smoothing: auto;
|
|
265
265
|
}
|
|
266
266
|
|
|
267
|
-
.awsui_segment-
|
|
267
|
+
.awsui_segment-part_8cbea_xqccj_266:not(#\9) {
|
|
268
268
|
display: inline-grid;
|
|
269
269
|
}
|
|
270
270
|
@media (max-width: 688px) {
|
|
271
|
-
.awsui_segment-
|
|
271
|
+
.awsui_segment-part_8cbea_xqccj_266:not(#\9) {
|
|
272
272
|
display: none;
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
275
|
|
|
276
|
-
.
|
|
276
|
+
.awsui_select_8cbea_xqccj_191:not(#\9) {
|
|
277
277
|
display: none;
|
|
278
278
|
}
|
|
279
279
|
@media (max-width: 688px) {
|
|
280
|
-
.
|
|
280
|
+
.awsui_select_8cbea_xqccj_191:not(#\9) {
|
|
281
281
|
display: block;
|
|
282
282
|
}
|
|
283
283
|
}
|
|
284
284
|
|
|
285
|
-
.awsui_segment-count-
|
|
285
|
+
.awsui_segment-count-2_8cbea_xqccj_285:not(#\9) {
|
|
286
286
|
grid-template-columns: 1fr 1fr;
|
|
287
287
|
}
|
|
288
288
|
|
|
289
|
-
.awsui_segment-count-
|
|
289
|
+
.awsui_segment-count-3_8cbea_xqccj_289:not(#\9) {
|
|
290
290
|
grid-template-columns: 1fr 1fr 1fr;
|
|
291
291
|
}
|
|
292
292
|
|
|
293
|
-
.awsui_segment-count-
|
|
293
|
+
.awsui_segment-count-4_8cbea_xqccj_293:not(#\9) {
|
|
294
294
|
grid-template-columns: 1fr 1fr 1fr 1fr;
|
|
295
295
|
}
|
|
296
296
|
|
|
297
|
-
.awsui_segment-count-
|
|
297
|
+
.awsui_segment-count-5_8cbea_xqccj_297:not(#\9) {
|
|
298
298
|
grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
|
|
299
299
|
}
|
|
300
300
|
|
|
301
|
-
.awsui_segment-count-
|
|
301
|
+
.awsui_segment-count-6_8cbea_xqccj_301:not(#\9) {
|
|
302
302
|
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
|
|
303
303
|
}
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"segment": "
|
|
6
|
-
"disabled": "
|
|
7
|
-
"selected": "
|
|
8
|
-
"icon": "
|
|
9
|
-
"with-text": "awsui_with-
|
|
10
|
-
"with-no-text": "awsui_with-no-
|
|
11
|
-
"root": "
|
|
12
|
-
"segment-part": "awsui_segment-
|
|
13
|
-
"select": "
|
|
14
|
-
"segment-count-2": "awsui_segment-count-
|
|
15
|
-
"segment-count-3": "awsui_segment-count-
|
|
16
|
-
"segment-count-4": "awsui_segment-count-
|
|
17
|
-
"segment-count-5": "awsui_segment-count-
|
|
18
|
-
"segment-count-6": "awsui_segment-count-
|
|
5
|
+
"segment": "awsui_segment_8cbea_xqccj_103",
|
|
6
|
+
"disabled": "awsui_disabled_8cbea_xqccj_183",
|
|
7
|
+
"selected": "awsui_selected_8cbea_xqccj_191",
|
|
8
|
+
"icon": "awsui_icon_8cbea_xqccj_212",
|
|
9
|
+
"with-text": "awsui_with-text_8cbea_xqccj_216",
|
|
10
|
+
"with-no-text": "awsui_with-no-text_8cbea_xqccj_222",
|
|
11
|
+
"root": "awsui_root_8cbea_xqccj_231",
|
|
12
|
+
"segment-part": "awsui_segment-part_8cbea_xqccj_266",
|
|
13
|
+
"select": "awsui_select_8cbea_xqccj_191",
|
|
14
|
+
"segment-count-2": "awsui_segment-count-2_8cbea_xqccj_285",
|
|
15
|
+
"segment-count-3": "awsui_segment-count-3_8cbea_xqccj_289",
|
|
16
|
+
"segment-count-4": "awsui_segment-count-4_8cbea_xqccj_293",
|
|
17
|
+
"segment-count-5": "awsui_segment-count-5_8cbea_xqccj_297",
|
|
18
|
+
"segment-count-6": "awsui_segment-count-6_8cbea_xqccj_301"
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"implementation.d.ts","sourceRoot":"","sources":["../../../src/split-panel/implementation.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAuD,MAAM,OAAO,CAAC;AAO5E,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAmB/C,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,eAAO,MAAM,wBAAwB,
|
|
1
|
+
{"version":3,"file":"implementation.d.ts","sourceRoot":"","sources":["../../../src/split-panel/implementation.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAuD,MAAM,OAAO,CAAC;AAO5E,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAmB/C,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,eAAO,MAAM,wBAAwB,qFAwOpC,CAAC;AAEF,eAAO,MAAM,0BAA0B,mMAIZ,CAAC"}
|
|
@@ -6,7 +6,7 @@ import clsx from 'clsx';
|
|
|
6
6
|
import { InternalButton } from '../button/internal';
|
|
7
7
|
import { getBaseProps } from '../internal/base-component';
|
|
8
8
|
import { useSplitPanelContext } from '../internal/context/split-panel-context';
|
|
9
|
-
import
|
|
9
|
+
import PanelResizeHandle from '../internal/components/panel-resize-handle';
|
|
10
10
|
import PreferencesModal from './preferences-modal';
|
|
11
11
|
import { usePointerEvents } from '../app-layout/utils/use-pointer-events';
|
|
12
12
|
import { useKeyboardEvents } from '../app-layout/utils/use-keyboard-events';
|
|
@@ -58,8 +58,11 @@ export const SplitPanelImplementation = React.forwardRef((_a, __internalRootRef)
|
|
|
58
58
|
? 'angle-right'
|
|
59
59
|
: 'angle-down'
|
|
60
60
|
: 'close', variant: "icon", onClick: onToggle, formAction: "none", ariaLabel: i18n('i18nStrings.closeButtonAriaLabel', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.closeButtonAriaLabel), ariaExpanded: isOpen })) : position === 'side' ? null : (React.createElement(InternalButton, { className: testUtilStyles['open-button'], iconName: "angle-up", variant: "icon", formAction: "none", ariaLabel: i18n('i18nStrings.openButtonAriaLabel', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.openButtonAriaLabel), ref: refs.toggle, ariaExpanded: isOpen })))));
|
|
61
|
-
const resizeHandle = (React.createElement(
|
|
62
|
-
|
|
61
|
+
const resizeHandle = (React.createElement(PanelResizeHandle, { ref: refs.slider, className: testUtilStyles.slider, ariaLabel: i18n('i18nStrings.resizeHandleAriaLabel', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.resizeHandleAriaLabel),
|
|
62
|
+
// Allows us to use the logical left/right keys to move the slider left/right,
|
|
63
|
+
// but match aria keyboard behavior of using left/right to decrease/increase
|
|
64
|
+
// the slider value.
|
|
65
|
+
ariaValuenow: position === 'bottom' ? relativeSize : 100 - relativeSize, position: position, onKeyDown: onKeyDown, onPointerDown: onSliderPointerDown }));
|
|
63
66
|
/*
|
|
64
67
|
This effect forces the browser to recalculate the layout
|
|
65
68
|
whenever the split panel might have moved.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"implementation.js","sourceRoot":"","sources":["../../../src/split-panel/implementation.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC5E,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAG/E,OAAO,aAAa,MAAM,wBAAwB,CAAC;AACnD,OAAO,gBAAgB,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AA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wB,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useState, useEffect, useLayoutEffect, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { InternalButton } from '../button/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport { useSplitPanelContext } from '../internal/context/split-panel-context';\n\nimport { SplitPanelProps } from './interfaces';\nimport ResizeHandler from './icons/resize-handler';\nimport PreferencesModal from './preferences-modal';\nimport { usePointerEvents } from '../app-layout/utils/use-pointer-events';\nimport { useKeyboardEvents } from '../app-layout/utils/use-keyboard-events';\nimport { SizeControlProps } from '../app-layout/utils/interfaces';\n\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { Transition } from '../internal/components/transition';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { SplitPanelContentSide } from './side';\nimport { SplitPanelContentBottom } from './bottom';\nimport { useInternalI18n } from '../i18n/context';\nimport globalVars from '../internal/styles/global-vars';\nimport { createWidgetizedForwardRef } from '../internal/widgets';\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\nexport { SplitPanelProps };\n\nexport const SplitPanelImplementation = React.forwardRef<HTMLElement, SplitPanelProps>(\n (\n { header, children, hidePreferencesButton = false, closeBehavior = 'collapse', i18nStrings, ...restProps },\n __internalRootRef\n ) => {\n const isRefresh = useVisualRefresh();\n\n const {\n position,\n topOffset,\n bottomOffset,\n rightOffset,\n contentWidthStyles,\n isOpen,\n isForcedPosition,\n onPreferencesChange,\n onResize,\n onToggle,\n size,\n relativeSize,\n setSplitPanelToggle,\n refs,\n } = useSplitPanelContext();\n const baseProps = getBaseProps(restProps);\n const i18n = useInternalI18n('split-panel');\n const [isPreferencesOpen, setPreferencesOpen] = useState<boolean>(false);\n\n const appLayoutMaxWidth = isRefresh && position === 'bottom' ? contentWidthStyles : undefined;\n\n const openButtonAriaLabel = i18n('i18nStrings.openButtonAriaLabel', i18nStrings?.openButtonAriaLabel);\n useEffect(() => {\n setSplitPanelToggle({ displayed: closeBehavior === 'collapse', ariaLabel: openButtonAriaLabel });\n }, [setSplitPanelToggle, openButtonAriaLabel, closeBehavior]);\n\n const splitPanelRefObject = useRef<HTMLDivElement>(null);\n\n const sizeControlProps: SizeControlProps = {\n position,\n panelRef: splitPanelRefObject,\n handleRef: refs.slider,\n onResize,\n };\n const onSliderPointerDown = usePointerEvents(sizeControlProps);\n const onKeyDown = useKeyboardEvents(sizeControlProps);\n\n const contentStyle = {\n [globalVars.stickyVerticalTopOffset]: topOffset,\n [globalVars.stickyVerticalBottomOffset]: bottomOffset,\n };\n\n const panelHeaderId = useUniqueId('split-panel-header');\n\n const wrappedHeader = (\n <div className={styles.header} style={appLayoutMaxWidth}>\n <h2 className={clsx(styles['header-text'], testUtilStyles['header-text'])} id={panelHeaderId}>\n {header}\n </h2>\n <div className={styles['header-actions']}>\n {!hidePreferencesButton && isOpen && (\n <>\n <InternalButton\n className={testUtilStyles['preferences-button']}\n iconName=\"settings\"\n variant=\"icon\"\n onClick={() => setPreferencesOpen(true)}\n formAction=\"none\"\n ariaLabel={i18n('i18nStrings.preferencesTitle', i18nStrings?.preferencesTitle)}\n ref={refs.preferences}\n />\n <span className={styles.divider} />\n </>\n )}\n\n {isOpen ? (\n <InternalButton\n className={testUtilStyles['close-button']}\n iconName={\n isRefresh && closeBehavior === 'collapse'\n ? position === 'side'\n ? 'angle-right'\n : 'angle-down'\n : 'close'\n }\n variant=\"icon\"\n onClick={onToggle}\n formAction=\"none\"\n ariaLabel={i18n('i18nStrings.closeButtonAriaLabel', i18nStrings?.closeButtonAriaLabel)}\n ariaExpanded={isOpen}\n />\n ) : position === 'side' ? null : (\n <InternalButton\n className={testUtilStyles['open-button']}\n iconName=\"angle-up\"\n variant=\"icon\"\n formAction=\"none\"\n ariaLabel={i18n('i18nStrings.openButtonAriaLabel', i18nStrings?.openButtonAriaLabel)}\n ref={refs.toggle}\n ariaExpanded={isOpen}\n />\n )}\n </div>\n </div>\n );\n\n const resizeHandle = (\n <div\n ref={refs.slider}\n role=\"slider\"\n tabIndex={0}\n aria-label={i18n('i18nStrings.resizeHandleAriaLabel', i18nStrings?.resizeHandleAriaLabel)}\n aria-valuemax={100}\n aria-valuemin={0}\n // Allows us to use the logical left/right keys to move the slider left/right,\n // but match aria keyboard behavior of using left/right to decrease/increase\n // the slider value.\n aria-valuenow={position === 'bottom' ? relativeSize : 100 - relativeSize}\n className={clsx(styles.slider, styles[`slider-${position}`], testUtilStyles.slider)}\n onKeyDown={onKeyDown}\n onPointerDown={onSliderPointerDown}\n >\n <ResizeHandler className={clsx(styles['slider-icon'], styles[`slider-icon-${position}`])} />\n </div>\n );\n\n /*\n This effect forces the browser to recalculate the layout\n whenever the split panel might have moved.\n\n This is needed as a workaround for a bug in Safari, which does\n not automatically calculate the new position of the split panel\n _content_ when the split panel moves.\n */\n useLayoutEffect(() => {\n const root = splitPanelRefObject.current;\n\n if (root) {\n const property = 'transform';\n const temporaryValue = 'translateZ(0)';\n\n const valueBefore = root.style[property];\n root.style[property] = temporaryValue;\n\n // This line forces the browser to recalculate the layout\n void root.offsetHeight;\n\n root.style[property] = valueBefore;\n }\n }, [rightOffset, __internalRootRef]);\n\n const mergedRef = useMergeRefs(splitPanelRefObject, __internalRootRef);\n\n if (closeBehavior === 'hide' && !isOpen) {\n return <></>;\n }\n\n /**\n * The AppLayout factor moved the circular buttons out of the\n * SplitPanel and into the Tools component. This conditional\n * is still needed for the early return to prevent execution\n * of the following code.\n */\n if (isRefresh && !isOpen && position === 'side') {\n return <></>;\n }\n\n return (\n <Transition in={isOpen ?? false}>\n {(state, transitioningElementRef) => (\n <>\n {position === 'side' && (\n <SplitPanelContentSide\n style={contentStyle}\n resizeHandle={resizeHandle}\n baseProps={baseProps}\n isOpen={isOpen}\n splitPanelRef={mergedRef}\n cappedSize={size}\n onToggle={onToggle}\n openButtonAriaLabel={i18n('i18nStrings.openButtonAriaLabel', i18nStrings?.openButtonAriaLabel)}\n toggleRef={refs.toggle}\n header={wrappedHeader}\n panelHeaderId={panelHeaderId}\n >\n {children}\n </SplitPanelContentSide>\n )}\n\n {position === 'bottom' && (\n <SplitPanelContentBottom\n style={contentStyle}\n resizeHandle={resizeHandle}\n baseProps={baseProps}\n isOpen={isOpen}\n splitPanelRef={mergedRef}\n cappedSize={size}\n onToggle={onToggle}\n header={wrappedHeader}\n panelHeaderId={panelHeaderId}\n state={state}\n transitioningElementRef={transitioningElementRef}\n appLayoutMaxWidth={appLayoutMaxWidth}\n >\n {children}\n </SplitPanelContentBottom>\n )}\n {isPreferencesOpen && (\n <PreferencesModal\n visible={true}\n preferences={{ position }}\n disabledSidePosition={position === 'bottom' && isForcedPosition}\n isRefresh={isRefresh}\n i18nStrings={{\n header: i18n('i18nStrings.preferencesTitle', i18nStrings?.preferencesTitle),\n confirm: i18n('i18nStrings.preferencesConfirm', i18nStrings?.preferencesConfirm),\n cancel: i18n('i18nStrings.preferencesCancel', i18nStrings?.preferencesCancel),\n positionLabel: i18n('i18nStrings.preferencesPositionLabel', i18nStrings?.preferencesPositionLabel),\n positionDescription: i18n(\n 'i18nStrings.preferencesPositionDescription',\n i18nStrings?.preferencesPositionDescription\n ),\n positionBottom: i18n('i18nStrings.preferencesPositionBottom', i18nStrings?.preferencesPositionBottom),\n positionSide: i18n('i18nStrings.preferencesPositionSide', i18nStrings?.preferencesPositionSide),\n }}\n onConfirm={preferences => {\n onPreferencesChange({ ...preferences });\n setPreferencesOpen(false);\n }}\n onDismiss={() => {\n setPreferencesOpen(false);\n }}\n />\n )}\n </>\n )}\n </Transition>\n );\n }\n);\n\nexport const createWidgetizedSplitPanel = createWidgetizedForwardRef<\n SplitPanelProps,\n HTMLElement,\n typeof SplitPanelImplementation\n>(SplitPanelImplementation);\n"]}
|
|
1
|
+
{"version":3,"file":"implementation.js","sourceRoot":"","sources":["../../../src/split-panel/implementation.tsx"],"names":[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vB,mBAAmB,mBAAM,WAAW,EAAG,CAAC;gBACxC,kBAAkB,CAAC,KAAK,CAAC,CAAC;YAC5B,CAAC,EACD,SAAS,EAAE,GAAG,EAAE;gBACd,kBAAkB,CAAC,KAAK,CAAC,CAAC;YAC5B,CAAC,GACD,CACH,CACA,CACJ,CACU,CACd,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,0BAA0B,CAIlE,wBAAwB,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useState, useEffect, useLayoutEffect, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { InternalButton } from '../button/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport { useSplitPanelContext } from '../internal/context/split-panel-context';\n\nimport { SplitPanelProps } from './interfaces';\nimport PanelResizeHandle from '../internal/components/panel-resize-handle';\nimport PreferencesModal from './preferences-modal';\nimport { usePointerEvents } from '../app-layout/utils/use-pointer-events';\nimport { useKeyboardEvents } from '../app-layout/utils/use-keyboard-events';\nimport { SizeControlProps } from '../app-layout/utils/interfaces';\n\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { Transition } from '../internal/components/transition';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { SplitPanelContentSide } from './side';\nimport { SplitPanelContentBottom } from './bottom';\nimport { useInternalI18n } from '../i18n/context';\nimport globalVars from '../internal/styles/global-vars';\nimport { createWidgetizedForwardRef } from '../internal/widgets';\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\nexport { SplitPanelProps };\n\nexport const SplitPanelImplementation = React.forwardRef<HTMLElement, SplitPanelProps>(\n (\n { header, children, hidePreferencesButton = false, closeBehavior = 'collapse', i18nStrings, ...restProps },\n __internalRootRef\n ) => {\n const isRefresh = useVisualRefresh();\n\n const {\n position,\n topOffset,\n bottomOffset,\n rightOffset,\n contentWidthStyles,\n isOpen,\n isForcedPosition,\n onPreferencesChange,\n onResize,\n onToggle,\n size,\n relativeSize,\n setSplitPanelToggle,\n refs,\n } = useSplitPanelContext();\n const baseProps = getBaseProps(restProps);\n const i18n = useInternalI18n('split-panel');\n const [isPreferencesOpen, setPreferencesOpen] = useState<boolean>(false);\n\n const appLayoutMaxWidth = isRefresh && position === 'bottom' ? contentWidthStyles : undefined;\n\n const openButtonAriaLabel = i18n('i18nStrings.openButtonAriaLabel', i18nStrings?.openButtonAriaLabel);\n useEffect(() => {\n setSplitPanelToggle({ displayed: closeBehavior === 'collapse', ariaLabel: openButtonAriaLabel });\n }, [setSplitPanelToggle, openButtonAriaLabel, closeBehavior]);\n\n const splitPanelRefObject = useRef<HTMLDivElement>(null);\n\n const sizeControlProps: SizeControlProps = {\n position,\n panelRef: splitPanelRefObject,\n handleRef: refs.slider,\n onResize,\n };\n const onSliderPointerDown = usePointerEvents(sizeControlProps);\n const onKeyDown = useKeyboardEvents(sizeControlProps);\n\n const contentStyle = {\n [globalVars.stickyVerticalTopOffset]: topOffset,\n [globalVars.stickyVerticalBottomOffset]: bottomOffset,\n };\n\n const panelHeaderId = useUniqueId('split-panel-header');\n\n const wrappedHeader = (\n <div className={styles.header} style={appLayoutMaxWidth}>\n <h2 className={clsx(styles['header-text'], testUtilStyles['header-text'])} id={panelHeaderId}>\n {header}\n </h2>\n <div className={styles['header-actions']}>\n {!hidePreferencesButton && isOpen && (\n <>\n <InternalButton\n className={testUtilStyles['preferences-button']}\n iconName=\"settings\"\n variant=\"icon\"\n onClick={() => setPreferencesOpen(true)}\n formAction=\"none\"\n ariaLabel={i18n('i18nStrings.preferencesTitle', i18nStrings?.preferencesTitle)}\n ref={refs.preferences}\n />\n <span className={styles.divider} />\n </>\n )}\n\n {isOpen ? (\n <InternalButton\n className={testUtilStyles['close-button']}\n iconName={\n isRefresh && closeBehavior === 'collapse'\n ? position === 'side'\n ? 'angle-right'\n : 'angle-down'\n : 'close'\n }\n variant=\"icon\"\n onClick={onToggle}\n formAction=\"none\"\n ariaLabel={i18n('i18nStrings.closeButtonAriaLabel', i18nStrings?.closeButtonAriaLabel)}\n ariaExpanded={isOpen}\n />\n ) : position === 'side' ? null : (\n <InternalButton\n className={testUtilStyles['open-button']}\n iconName=\"angle-up\"\n variant=\"icon\"\n formAction=\"none\"\n ariaLabel={i18n('i18nStrings.openButtonAriaLabel', i18nStrings?.openButtonAriaLabel)}\n ref={refs.toggle}\n ariaExpanded={isOpen}\n />\n )}\n </div>\n </div>\n );\n\n const resizeHandle = (\n <PanelResizeHandle\n ref={refs.slider}\n className={testUtilStyles.slider}\n ariaLabel={i18n('i18nStrings.resizeHandleAriaLabel', i18nStrings?.resizeHandleAriaLabel)}\n // Allows us to use the logical left/right keys to move the slider left/right,\n // but match aria keyboard behavior of using left/right to decrease/increase\n // the slider value.\n ariaValuenow={position === 'bottom' ? relativeSize : 100 - relativeSize}\n position={position}\n onKeyDown={onKeyDown}\n onPointerDown={onSliderPointerDown}\n />\n );\n\n /*\n This effect forces the browser to recalculate the layout\n whenever the split panel might have moved.\n\n This is needed as a workaround for a bug in Safari, which does\n not automatically calculate the new position of the split panel\n _content_ when the split panel moves.\n */\n useLayoutEffect(() => {\n const root = splitPanelRefObject.current;\n\n if (root) {\n const property = 'transform';\n const temporaryValue = 'translateZ(0)';\n\n const valueBefore = root.style[property];\n root.style[property] = temporaryValue;\n\n // This line forces the browser to recalculate the layout\n void root.offsetHeight;\n\n root.style[property] = valueBefore;\n }\n }, [rightOffset, __internalRootRef]);\n\n const mergedRef = useMergeRefs(splitPanelRefObject, __internalRootRef);\n\n if (closeBehavior === 'hide' && !isOpen) {\n return <></>;\n }\n\n /**\n * The AppLayout factor moved the circular buttons out of the\n * SplitPanel and into the Tools component. This conditional\n * is still needed for the early return to prevent execution\n * of the following code.\n */\n if (isRefresh && !isOpen && position === 'side') {\n return <></>;\n }\n\n return (\n <Transition in={isOpen ?? false}>\n {(state, transitioningElementRef) => (\n <>\n {position === 'side' && (\n <SplitPanelContentSide\n style={contentStyle}\n resizeHandle={resizeHandle}\n baseProps={baseProps}\n isOpen={isOpen}\n splitPanelRef={mergedRef}\n cappedSize={size}\n onToggle={onToggle}\n openButtonAriaLabel={i18n('i18nStrings.openButtonAriaLabel', i18nStrings?.openButtonAriaLabel)}\n toggleRef={refs.toggle}\n header={wrappedHeader}\n panelHeaderId={panelHeaderId}\n >\n {children}\n </SplitPanelContentSide>\n )}\n\n {position === 'bottom' && (\n <SplitPanelContentBottom\n style={contentStyle}\n resizeHandle={resizeHandle}\n baseProps={baseProps}\n isOpen={isOpen}\n splitPanelRef={mergedRef}\n cappedSize={size}\n onToggle={onToggle}\n header={wrappedHeader}\n panelHeaderId={panelHeaderId}\n state={state}\n transitioningElementRef={transitioningElementRef}\n appLayoutMaxWidth={appLayoutMaxWidth}\n >\n {children}\n </SplitPanelContentBottom>\n )}\n {isPreferencesOpen && (\n <PreferencesModal\n visible={true}\n preferences={{ position }}\n disabledSidePosition={position === 'bottom' && isForcedPosition}\n isRefresh={isRefresh}\n i18nStrings={{\n header: i18n('i18nStrings.preferencesTitle', i18nStrings?.preferencesTitle),\n confirm: i18n('i18nStrings.preferencesConfirm', i18nStrings?.preferencesConfirm),\n cancel: i18n('i18nStrings.preferencesCancel', i18nStrings?.preferencesCancel),\n positionLabel: i18n('i18nStrings.preferencesPositionLabel', i18nStrings?.preferencesPositionLabel),\n positionDescription: i18n(\n 'i18nStrings.preferencesPositionDescription',\n i18nStrings?.preferencesPositionDescription\n ),\n positionBottom: i18n('i18nStrings.preferencesPositionBottom', i18nStrings?.preferencesPositionBottom),\n positionSide: i18n('i18nStrings.preferencesPositionSide', i18nStrings?.preferencesPositionSide),\n }}\n onConfirm={preferences => {\n onPreferencesChange({ ...preferences });\n setPreferencesOpen(false);\n }}\n onDismiss={() => {\n setPreferencesOpen(false);\n }}\n />\n )}\n </>\n )}\n </Transition>\n );\n }\n);\n\nexport const createWidgetizedSplitPanel = createWidgetizedForwardRef<\n SplitPanelProps,\n HTMLElement,\n typeof SplitPanelImplementation\n>(SplitPanelImplementation);\n"]}
|
|
@@ -1,36 +1,31 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"drawer": "
|
|
5
|
-
"refresh": "
|
|
6
|
-
"animating": "
|
|
7
|
-
"drawer-closed": "awsui_drawer-
|
|
8
|
-
"drawer-content-side": "awsui_drawer-content-
|
|
9
|
-
"drawer-content-bottom": "awsui_drawer-content-
|
|
10
|
-
"position-bottom": "awsui_position-
|
|
11
|
-
"position-side": "awsui_position-
|
|
12
|
-
"slider": "
|
|
13
|
-
"slider-side": "awsui_slider-
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"pane-
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"content-
|
|
24
|
-
"pane-
|
|
25
|
-
"pane-
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"pane-content-wrapper-side": "awsui_pane-content-wrapper-side_1r9lg_jkoke_492",
|
|
31
|
-
"header": "awsui_header_1r9lg_jkoke_500",
|
|
32
|
-
"header-text": "awsui_header-text_1r9lg_jkoke_510",
|
|
33
|
-
"header-actions": "awsui_header-actions_1r9lg_jkoke_523",
|
|
34
|
-
"divider": "awsui_divider_1r9lg_jkoke_531"
|
|
4
|
+
"drawer": "awsui_drawer_1r9lg_lic0n_201",
|
|
5
|
+
"refresh": "awsui_refresh_1r9lg_lic0n_201",
|
|
6
|
+
"animating": "awsui_animating_1r9lg_lic0n_215",
|
|
7
|
+
"drawer-closed": "awsui_drawer-closed_1r9lg_lic0n_270",
|
|
8
|
+
"drawer-content-side": "awsui_drawer-content-side_1r9lg_lic0n_275",
|
|
9
|
+
"drawer-content-bottom": "awsui_drawer-content-bottom_1r9lg_lic0n_291",
|
|
10
|
+
"position-bottom": "awsui_position-bottom_1r9lg_lic0n_298",
|
|
11
|
+
"position-side": "awsui_position-side_1r9lg_lic0n_325",
|
|
12
|
+
"slider-wrapper-bottom": "awsui_slider-wrapper-bottom_1r9lg_lic0n_331",
|
|
13
|
+
"slider-wrapper-side": "awsui_slider-wrapper-side_1r9lg_lic0n_342",
|
|
14
|
+
"open-button-side": "awsui_open-button-side_1r9lg_lic0n_353",
|
|
15
|
+
"pane-header-wrapper-bottom": "awsui_pane-header-wrapper-bottom_1r9lg_lic0n_362",
|
|
16
|
+
"drawer-mobile": "awsui_drawer-mobile_1r9lg_lic0n_373",
|
|
17
|
+
"drawer-disable-content-paddings": "awsui_drawer-disable-content-paddings_1r9lg_lic0n_377",
|
|
18
|
+
"content-bottom": "awsui_content-bottom_1r9lg_lic0n_386",
|
|
19
|
+
"pane-bottom-center-align": "awsui_pane-bottom-center-align_1r9lg_lic0n_402",
|
|
20
|
+
"pane-bottom-content-nav-padding": "awsui_pane-bottom-content-nav-padding_1r9lg_lic0n_407",
|
|
21
|
+
"pane-bottom-content-tools-padding": "awsui_pane-bottom-content-tools-padding_1r9lg_lic0n_411",
|
|
22
|
+
"content-bottom-max-width": "awsui_content-bottom-max-width_1r9lg_lic0n_415",
|
|
23
|
+
"content-side": "awsui_content-side_1r9lg_lic0n_420",
|
|
24
|
+
"pane-header-wrapper-side": "awsui_pane-header-wrapper-side_1r9lg_lic0n_430",
|
|
25
|
+
"pane-content-wrapper-side": "awsui_pane-content-wrapper-side_1r9lg_lic0n_436",
|
|
26
|
+
"header": "awsui_header_1r9lg_lic0n_444",
|
|
27
|
+
"header-text": "awsui_header-text_1r9lg_lic0n_454",
|
|
28
|
+
"header-actions": "awsui_header-actions_1r9lg_lic0n_467",
|
|
29
|
+
"divider": "awsui_divider_1r9lg_lic0n_475"
|
|
35
30
|
};
|
|
36
31
|
|