@cloudscape-design/components-themeable 3.0.1167 → 3.0.1168
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/lib/internal/manifest.json +1 -1
- package/lib/internal/scss/app-layout/styles.scss +1 -0
- package/lib/internal/scss/error-boundary/styles.scss +11 -0
- package/lib/internal/scss/error-boundary/test-classes/styles.scss +13 -0
- package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
- package/lib/internal/scss/panel-layout/styles.scss +63 -0
- package/lib/internal/scss/panel-layout/test-classes/styles.scss +11 -0
- package/lib/internal/template/app-layout/utils/use-pointer-events.d.ts.map +1 -1
- package/lib/internal/template/app-layout/utils/use-pointer-events.js +1 -1
- package/lib/internal/template/app-layout/utils/use-pointer-events.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/drawers.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/drawers.js +2 -2
- package/lib/internal/template/app-layout/visual-refresh/drawers.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/main.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/main.js +3 -1
- package/lib/internal/template/app-layout/visual-refresh/main.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/local-drawer.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/local-drawer.js +2 -2
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/local-drawer.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/index.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/index.js +2 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/index.js.map +1 -1
- package/lib/internal/template/container/internal.d.ts +6 -1
- package/lib/internal/template/container/internal.d.ts.map +1 -1
- package/lib/internal/template/container/internal.js +32 -28
- package/lib/internal/template/container/internal.js.map +1 -1
- package/lib/internal/template/drawer/implementation.d.ts.map +1 -1
- package/lib/internal/template/drawer/implementation.js +5 -3
- package/lib/internal/template/drawer/implementation.js.map +1 -1
- package/lib/internal/template/error-boundary/fallback.d.ts +3 -0
- package/lib/internal/template/error-boundary/fallback.d.ts.map +1 -0
- package/lib/internal/template/error-boundary/fallback.js +61 -0
- package/lib/internal/template/error-boundary/fallback.js.map +1 -0
- package/lib/internal/template/error-boundary/index.d.ts +5 -0
- package/lib/internal/template/error-boundary/index.d.ts.map +1 -0
- package/lib/internal/template/error-boundary/index.js +22 -0
- package/lib/internal/template/error-boundary/index.js.map +1 -0
- package/lib/internal/template/error-boundary/interfaces.d.ts +85 -0
- package/lib/internal/template/error-boundary/interfaces.d.ts.map +1 -0
- package/lib/internal/template/error-boundary/interfaces.js +4 -0
- package/lib/internal/template/error-boundary/interfaces.js.map +1 -0
- package/lib/internal/template/error-boundary/internal.d.ts +23 -0
- package/lib/internal/template/error-boundary/internal.d.ts.map +1 -0
- package/lib/internal/template/error-boundary/internal.js +58 -0
- package/lib/internal/template/error-boundary/internal.js.map +1 -0
- package/lib/internal/template/error-boundary/styles.css.js +9 -0
- package/lib/internal/template/error-boundary/styles.scoped.css +10 -0
- package/lib/internal/template/error-boundary/styles.selectors.js +10 -0
- package/lib/internal/template/error-boundary/test-classes/styles.css.js +11 -0
- package/lib/internal/template/error-boundary/test-classes/styles.scoped.css +12 -0
- package/lib/internal/template/error-boundary/test-classes/styles.selectors.js +12 -0
- package/lib/internal/template/error-boundary/utils.d.ts +2 -0
- package/lib/internal/template/error-boundary/utils.d.ts.map +1 -0
- package/lib/internal/template/error-boundary/utils.js +7 -0
- package/lib/internal/template/error-boundary/utils.js.map +1 -0
- package/lib/internal/template/form/internal.d.ts.map +1 -1
- package/lib/internal/template/form/internal.js +20 -14
- package/lib/internal/template/form/internal.js.map +1 -1
- package/lib/internal/template/i18n/messages/all.all.js +1 -1
- package/lib/internal/template/i18n/messages/all.all.json +1 -1
- package/lib/internal/template/i18n/messages/all.ar.js +1 -1
- package/lib/internal/template/i18n/messages/all.ar.json +1 -1
- package/lib/internal/template/i18n/messages/all.de.js +1 -1
- package/lib/internal/template/i18n/messages/all.de.json +1 -1
- package/lib/internal/template/i18n/messages/all.en-GB.js +1 -1
- package/lib/internal/template/i18n/messages/all.en-GB.json +1 -1
- package/lib/internal/template/i18n/messages/all.en.js +1 -1
- package/lib/internal/template/i18n/messages/all.en.json +1 -1
- package/lib/internal/template/i18n/messages/all.es.js +1 -1
- package/lib/internal/template/i18n/messages/all.es.json +1 -1
- package/lib/internal/template/i18n/messages/all.fr.js +1 -1
- package/lib/internal/template/i18n/messages/all.fr.json +1 -1
- package/lib/internal/template/i18n/messages/all.id.js +1 -1
- package/lib/internal/template/i18n/messages/all.id.json +1 -1
- package/lib/internal/template/i18n/messages/all.it.js +1 -1
- package/lib/internal/template/i18n/messages/all.it.json +1 -1
- package/lib/internal/template/i18n/messages/all.ja.js +1 -1
- package/lib/internal/template/i18n/messages/all.ja.json +1 -1
- package/lib/internal/template/i18n/messages/all.ko.js +1 -1
- package/lib/internal/template/i18n/messages/all.ko.json +1 -1
- package/lib/internal/template/i18n/messages/all.pt-BR.js +1 -1
- package/lib/internal/template/i18n/messages/all.pt-BR.json +1 -1
- package/lib/internal/template/i18n/messages/all.tr.js +1 -1
- package/lib/internal/template/i18n/messages/all.tr.json +1 -1
- package/lib/internal/template/i18n/messages/all.zh-CN.js +1 -1
- package/lib/internal/template/i18n/messages/all.zh-CN.json +1 -1
- package/lib/internal/template/i18n/messages/all.zh-TW.js +1 -1
- package/lib/internal/template/i18n/messages/all.zh-TW.json +1 -1
- package/lib/internal/template/i18n/messages-types.d.ts +9 -4
- package/lib/internal/template/i18n/messages-types.d.ts.map +1 -1
- package/lib/internal/template/i18n/messages-types.js.map +1 -1
- package/lib/internal/template/icon/generated/icons.d.ts +3 -0
- package/lib/internal/template/icon/generated/icons.d.ts.map +1 -1
- package/lib/internal/template/icon/generated/icons.js +9 -0
- package/lib/internal/template/icon/generated/icons.js.map +1 -1
- package/lib/internal/template/icon-provider/interfaces.d.ts +3 -0
- package/lib/internal/template/icon-provider/interfaces.d.ts.map +1 -1
- package/lib/internal/template/icon-provider/interfaces.js.map +1 -1
- package/lib/internal/template/index.d.ts +2 -0
- package/lib/internal/template/index.d.ts.map +1 -1
- package/lib/internal/template/index.js +2 -0
- package/lib/internal/template/index.js.map +1 -1
- package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
- package/lib/internal/template/internal/components/panel-resize-handle/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/panel-resize-handle/index.js +3 -1
- package/lib/internal/template/internal/components/panel-resize-handle/index.js.map +1 -1
- package/lib/internal/template/internal/environment.js +2 -2
- package/lib/internal/template/internal/environment.json +2 -2
- package/lib/internal/template/modal/internal.d.ts.map +1 -1
- package/lib/internal/template/modal/internal.js +8 -5
- package/lib/internal/template/modal/internal.js.map +1 -1
- package/lib/internal/template/package.json +2 -0
- package/lib/internal/template/panel-layout/index.d.ts +6 -0
- package/lib/internal/template/panel-layout/index.d.ts.map +1 -0
- package/lib/internal/template/panel-layout/index.js +25 -0
- package/lib/internal/template/panel-layout/index.js.map +1 -0
- package/lib/internal/template/panel-layout/interfaces.d.ts +100 -0
- package/lib/internal/template/panel-layout/interfaces.d.ts.map +1 -0
- package/lib/internal/template/panel-layout/interfaces.js +2 -0
- package/lib/internal/template/panel-layout/interfaces.js.map +1 -0
- package/lib/internal/template/panel-layout/internal.d.ts +10 -0
- package/lib/internal/template/panel-layout/internal.d.ts.map +1 -0
- package/lib/internal/template/panel-layout/internal.js +65 -0
- package/lib/internal/template/panel-layout/internal.js.map +1 -0
- package/lib/internal/template/panel-layout/styles.css.js +12 -0
- package/lib/internal/template/panel-layout/styles.scoped.css +263 -0
- package/lib/internal/template/panel-layout/styles.selectors.js +13 -0
- package/lib/internal/template/panel-layout/test-classes/styles.css.js +9 -0
- package/lib/internal/template/panel-layout/test-classes/styles.scoped.css +10 -0
- package/lib/internal/template/panel-layout/test-classes/styles.selectors.js +10 -0
- package/lib/internal/template/popover/body.d.ts.map +1 -1
- package/lib/internal/template/popover/body.js +10 -8
- package/lib/internal/template/popover/body.js.map +1 -1
- package/lib/internal/template/split-panel/implementation.d.ts.map +1 -1
- package/lib/internal/template/split-panel/implementation.js +5 -2
- package/lib/internal/template/split-panel/implementation.js.map +1 -1
- package/lib/internal/template/tabs/index.d.ts.map +1 -1
- package/lib/internal/template/tabs/index.js +1 -1
- package/lib/internal/template/tabs/index.js.map +1 -1
- package/lib/internal/template/test-utils/dom/error-boundary/index.d.ts +9 -0
- package/lib/internal/template/test-utils/dom/error-boundary/index.js +26 -0
- package/lib/internal/template/test-utils/dom/error-boundary/index.js.map +1 -0
- package/lib/internal/template/test-utils/dom/index.d.ts +40 -0
- package/lib/internal/template/test-utils/dom/index.js +30 -2
- package/lib/internal/template/test-utils/dom/index.js.map +1 -1
- package/lib/internal/template/test-utils/dom/panel-layout/index.d.ts +17 -0
- package/lib/internal/template/test-utils/dom/panel-layout/index.js +30 -0
- package/lib/internal/template/test-utils/dom/panel-layout/index.js.map +1 -0
- package/lib/internal/template/test-utils/selectors/error-boundary/index.d.ts +9 -0
- package/lib/internal/template/test-utils/selectors/error-boundary/index.js +26 -0
- package/lib/internal/template/test-utils/selectors/error-boundary/index.js.map +1 -0
- package/lib/internal/template/test-utils/selectors/index.d.ts +36 -0
- package/lib/internal/template/test-utils/selectors/index.js +30 -2
- package/lib/internal/template/test-utils/selectors/index.js.map +1 -1
- package/lib/internal/template/test-utils/selectors/panel-layout/index.d.ts +17 -0
- package/lib/internal/template/test-utils/selectors/panel-layout/index.js +30 -0
- package/lib/internal/template/test-utils/selectors/panel-layout/index.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
/*
|
|
6
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
7
|
+
SPDX-License-Identifier: Apache-2.0
|
|
8
|
+
*/
|
|
9
|
+
/*
|
|
10
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
11
|
+
SPDX-License-Identifier: Apache-2.0
|
|
12
|
+
*/
|
|
13
|
+
/*
|
|
14
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
15
|
+
SPDX-License-Identifier: Apache-2.0
|
|
16
|
+
*/
|
|
17
|
+
/*
|
|
18
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
19
|
+
SPDX-License-Identifier: Apache-2.0
|
|
20
|
+
*/
|
|
21
|
+
/*
|
|
22
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
23
|
+
SPDX-License-Identifier: Apache-2.0
|
|
24
|
+
*/
|
|
25
|
+
/*
|
|
26
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
27
|
+
SPDX-License-Identifier: Apache-2.0
|
|
28
|
+
*/
|
|
29
|
+
/*
|
|
30
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
31
|
+
SPDX-License-Identifier: Apache-2.0
|
|
32
|
+
*/
|
|
33
|
+
/*
|
|
34
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
35
|
+
SPDX-License-Identifier: Apache-2.0
|
|
36
|
+
*/
|
|
37
|
+
/*
|
|
38
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
39
|
+
SPDX-License-Identifier: Apache-2.0
|
|
40
|
+
*/
|
|
41
|
+
/*
|
|
42
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
43
|
+
SPDX-License-Identifier: Apache-2.0
|
|
44
|
+
*/
|
|
45
|
+
/*
|
|
46
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
47
|
+
SPDX-License-Identifier: Apache-2.0
|
|
48
|
+
*/
|
|
49
|
+
/*
|
|
50
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
51
|
+
SPDX-License-Identifier: Apache-2.0
|
|
52
|
+
*/
|
|
53
|
+
/*
|
|
54
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
55
|
+
SPDX-License-Identifier: Apache-2.0
|
|
56
|
+
*/
|
|
57
|
+
/*
|
|
58
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
59
|
+
SPDX-License-Identifier: Apache-2.0
|
|
60
|
+
*/
|
|
61
|
+
/*
|
|
62
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
63
|
+
SPDX-License-Identifier: Apache-2.0
|
|
64
|
+
*/
|
|
65
|
+
/*
|
|
66
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
67
|
+
SPDX-License-Identifier: Apache-2.0
|
|
68
|
+
*/
|
|
69
|
+
/*
|
|
70
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
71
|
+
SPDX-License-Identifier: Apache-2.0
|
|
72
|
+
*/
|
|
73
|
+
/*
|
|
74
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
75
|
+
SPDX-License-Identifier: Apache-2.0
|
|
76
|
+
*/
|
|
77
|
+
/*
|
|
78
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
79
|
+
SPDX-License-Identifier: Apache-2.0
|
|
80
|
+
*/
|
|
81
|
+
/*
|
|
82
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
83
|
+
SPDX-License-Identifier: Apache-2.0
|
|
84
|
+
*/
|
|
85
|
+
/*
|
|
86
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
87
|
+
SPDX-License-Identifier: Apache-2.0
|
|
88
|
+
*/
|
|
89
|
+
/*
|
|
90
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
91
|
+
SPDX-License-Identifier: Apache-2.0
|
|
92
|
+
*/
|
|
93
|
+
/*
|
|
94
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
95
|
+
SPDX-License-Identifier: Apache-2.0
|
|
96
|
+
*/
|
|
97
|
+
/*
|
|
98
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
99
|
+
SPDX-License-Identifier: Apache-2.0
|
|
100
|
+
*/
|
|
101
|
+
/*
|
|
102
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
103
|
+
SPDX-License-Identifier: Apache-2.0
|
|
104
|
+
*/
|
|
105
|
+
/*
|
|
106
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
107
|
+
SPDX-License-Identifier: Apache-2.0
|
|
108
|
+
*/
|
|
109
|
+
/*
|
|
110
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
111
|
+
SPDX-License-Identifier: Apache-2.0
|
|
112
|
+
*/
|
|
113
|
+
/*
|
|
114
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
115
|
+
SPDX-License-Identifier: Apache-2.0
|
|
116
|
+
*/
|
|
117
|
+
/*
|
|
118
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
119
|
+
SPDX-License-Identifier: Apache-2.0
|
|
120
|
+
*/
|
|
121
|
+
/*
|
|
122
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
123
|
+
SPDX-License-Identifier: Apache-2.0
|
|
124
|
+
*/
|
|
125
|
+
/*
|
|
126
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
127
|
+
SPDX-License-Identifier: Apache-2.0
|
|
128
|
+
*/
|
|
129
|
+
/*
|
|
130
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
131
|
+
SPDX-License-Identifier: Apache-2.0
|
|
132
|
+
*/
|
|
133
|
+
/*
|
|
134
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
135
|
+
SPDX-License-Identifier: Apache-2.0
|
|
136
|
+
*/
|
|
137
|
+
/* stylelint-disable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
|
|
138
|
+
/* stylelint-enable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
|
|
139
|
+
/*
|
|
140
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
141
|
+
SPDX-License-Identifier: Apache-2.0
|
|
142
|
+
*/
|
|
143
|
+
/*
|
|
144
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
145
|
+
SPDX-License-Identifier: Apache-2.0
|
|
146
|
+
*/
|
|
147
|
+
/*
|
|
148
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
149
|
+
SPDX-License-Identifier: Apache-2.0
|
|
150
|
+
*/
|
|
151
|
+
/*
|
|
152
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
153
|
+
SPDX-License-Identifier: Apache-2.0
|
|
154
|
+
*/
|
|
155
|
+
/*
|
|
156
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
157
|
+
SPDX-License-Identifier: Apache-2.0
|
|
158
|
+
*/
|
|
159
|
+
/*
|
|
160
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
161
|
+
SPDX-License-Identifier: Apache-2.0
|
|
162
|
+
*/
|
|
163
|
+
/*
|
|
164
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
165
|
+
SPDX-License-Identifier: Apache-2.0
|
|
166
|
+
*/
|
|
167
|
+
/*
|
|
168
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
169
|
+
SPDX-License-Identifier: Apache-2.0
|
|
170
|
+
*/
|
|
171
|
+
/*
|
|
172
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
173
|
+
SPDX-License-Identifier: Apache-2.0
|
|
174
|
+
*/
|
|
175
|
+
/*
|
|
176
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
177
|
+
SPDX-License-Identifier: Apache-2.0
|
|
178
|
+
*/
|
|
179
|
+
/* Style used for links in slots/components that are text heavy, to help links stand out among
|
|
180
|
+
surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
|
|
181
|
+
/*
|
|
182
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
183
|
+
SPDX-License-Identifier: Apache-2.0
|
|
184
|
+
*/
|
|
185
|
+
.awsui_root_1ksu1_1yvik_185:not(#\9) {
|
|
186
|
+
border-collapse: separate;
|
|
187
|
+
border-spacing: 0;
|
|
188
|
+
box-sizing: border-box;
|
|
189
|
+
caption-side: top;
|
|
190
|
+
cursor: auto;
|
|
191
|
+
direction: inherit;
|
|
192
|
+
empty-cells: show;
|
|
193
|
+
font-family: serif;
|
|
194
|
+
font-style: normal;
|
|
195
|
+
font-variant: normal;
|
|
196
|
+
font-stretch: normal;
|
|
197
|
+
hyphens: none;
|
|
198
|
+
letter-spacing: normal;
|
|
199
|
+
list-style: disc outside none;
|
|
200
|
+
tab-size: 8;
|
|
201
|
+
text-align: start;
|
|
202
|
+
text-indent: 0;
|
|
203
|
+
text-shadow: none;
|
|
204
|
+
text-transform: none;
|
|
205
|
+
visibility: visible;
|
|
206
|
+
white-space: normal;
|
|
207
|
+
word-spacing: normal;
|
|
208
|
+
font-size: var(--font-size-body-m-vv54cm, 14px);
|
|
209
|
+
line-height: var(--line-height-body-m-bedeoh, 22px);
|
|
210
|
+
color: var(--color-text-body-default-5qid0u, #16191f);
|
|
211
|
+
font-weight: 400;
|
|
212
|
+
font-family: var(--font-family-base-8x5ngf, "Noto Sans", "Helvetica Neue", Roboto, Arial, sans-serif);
|
|
213
|
+
-webkit-font-smoothing: auto;
|
|
214
|
+
-moz-osx-font-smoothing: auto;
|
|
215
|
+
block-size: 100%;
|
|
216
|
+
overflow: hidden;
|
|
217
|
+
display: flex;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.awsui_panel_1ksu1_1yvik_220:not(#\9) {
|
|
221
|
+
display: flex;
|
|
222
|
+
flex-shrink: 0;
|
|
223
|
+
}
|
|
224
|
+
.awsui_panel_1ksu1_1yvik_220 > .awsui_handle_1ksu1_1yvik_224:not(#\9) {
|
|
225
|
+
display: flex;
|
|
226
|
+
align-items: center;
|
|
227
|
+
}
|
|
228
|
+
.awsui_panel_1ksu1_1yvik_220 > .awsui_panel-content_1ksu1_1yvik_228:not(#\9) {
|
|
229
|
+
overflow-y: auto;
|
|
230
|
+
overflow-x: visible;
|
|
231
|
+
flex-grow: 1;
|
|
232
|
+
}
|
|
233
|
+
body[data-awsui-focus-visible=true] .awsui_panel_1ksu1_1yvik_220 > .awsui_panel-content_1ksu1_1yvik_228:not(#\9):focus {
|
|
234
|
+
border-start-start-radius: calc(var(--border-radius-control-default-focus-ring-9xsko1, 2px) + 2px);
|
|
235
|
+
border-start-end-radius: calc(var(--border-radius-control-default-focus-ring-9xsko1, 2px) + 2px);
|
|
236
|
+
border-end-start-radius: calc(var(--border-radius-control-default-focus-ring-9xsko1, 2px) + 2px);
|
|
237
|
+
border-end-end-radius: calc(var(--border-radius-control-default-focus-ring-9xsko1, 2px) + 2px);
|
|
238
|
+
outline: 2px solid var(--color-border-item-focused-r5f6xl, #0073bb);
|
|
239
|
+
outline-offset: calc(-1 * 2px);
|
|
240
|
+
}
|
|
241
|
+
.awsui_display-main-only_1ksu1_1yvik_241 > .awsui_panel_1ksu1_1yvik_220:not(#\9) {
|
|
242
|
+
display: none;
|
|
243
|
+
}
|
|
244
|
+
.awsui_display-panel-only_1ksu1_1yvik_244 > .awsui_panel_1ksu1_1yvik_220:not(#\9) {
|
|
245
|
+
flex: 1;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.awsui_content_1ksu1_1yvik_248:not(#\9) {
|
|
249
|
+
overflow-y: auto;
|
|
250
|
+
flex-grow: 1;
|
|
251
|
+
flex-shrink: 1;
|
|
252
|
+
}
|
|
253
|
+
.awsui_display-panel-only_1ksu1_1yvik_244 > .awsui_content_1ksu1_1yvik_248:not(#\9) {
|
|
254
|
+
display: none;
|
|
255
|
+
}
|
|
256
|
+
body[data-awsui-focus-visible=true] .awsui_content_1ksu1_1yvik_248:not(#\9):focus {
|
|
257
|
+
border-start-start-radius: calc(var(--border-radius-control-default-focus-ring-9xsko1, 2px) + 2px);
|
|
258
|
+
border-start-end-radius: calc(var(--border-radius-control-default-focus-ring-9xsko1, 2px) + 2px);
|
|
259
|
+
border-end-start-radius: calc(var(--border-radius-control-default-focus-ring-9xsko1, 2px) + 2px);
|
|
260
|
+
border-end-end-radius: calc(var(--border-radius-control-default-focus-ring-9xsko1, 2px) + 2px);
|
|
261
|
+
outline: 2px solid var(--color-border-item-focused-r5f6xl, #0073bb);
|
|
262
|
+
outline-offset: calc(-1 * 2px);
|
|
263
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
|
|
2
|
+
// es-module interop with Babel and Typescript
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
module.exports.default = {
|
|
5
|
+
"root": "awsui_root_1ksu1_1yvik_185",
|
|
6
|
+
"panel": "awsui_panel_1ksu1_1yvik_220",
|
|
7
|
+
"handle": "awsui_handle_1ksu1_1yvik_224",
|
|
8
|
+
"panel-content": "awsui_panel-content_1ksu1_1yvik_228",
|
|
9
|
+
"display-main-only": "awsui_display-main-only_1ksu1_1yvik_241",
|
|
10
|
+
"display-panel-only": "awsui_display-panel-only_1ksu1_1yvik_244",
|
|
11
|
+
"content": "awsui_content_1ksu1_1yvik_248"
|
|
12
|
+
};
|
|
13
|
+
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
.awsui_root_119z0_1u7uv_5:not(#\9),
|
|
6
|
+
.awsui_panel_119z0_1u7uv_6:not(#\9),
|
|
7
|
+
.awsui_content_119z0_1u7uv_7:not(#\9),
|
|
8
|
+
.awsui_resize-handle_119z0_1u7uv_8:not(#\9) {
|
|
9
|
+
/* used in test-utils */
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
|
|
2
|
+
// es-module interop with Babel and Typescript
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
module.exports.default = {
|
|
5
|
+
"root": "awsui_root_119z0_1u7uv_5",
|
|
6
|
+
"panel": "awsui_panel_119z0_1u7uv_6",
|
|
7
|
+
"content": "awsui_content_119z0_1u7uv_7",
|
|
8
|
+
"resize-handle": "awsui_resize-handle_119z0_1u7uv_8"
|
|
9
|
+
};
|
|
10
|
+
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"body.d.ts","sourceRoot":"","sources":["../../../src/popover/body.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAyC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"body.d.ts","sourceRoot":"","sources":["../../../src/popover/body.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAe9D,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,OAAO,CAAC;IACvB,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,SAAS,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IAEpC,MAAM,EAAE,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;IACpC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC;IACjC,eAAe,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAErC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,aAAa,EAAE,iBAAiB,EAChC,gBAAgB,EAChB,MAAM,EACN,QAAQ,EACR,SAAS,EACT,OAAO,EACP,eAAe,EACf,SAAS,EACT,cAAc,EACd,oBAAoB,GACrB,EAAE,gBAAgB,eAiFlB"}
|
|
@@ -5,6 +5,7 @@ import clsx from 'clsx';
|
|
|
5
5
|
import { useUniqueId } from '@cloudscape-design/component-toolkit/internal';
|
|
6
6
|
import { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';
|
|
7
7
|
import { InternalButton } from '../button/internal';
|
|
8
|
+
import { BuiltInErrorBoundary } from '../error-boundary/internal';
|
|
8
9
|
import { useInternalI18n } from '../i18n/context';
|
|
9
10
|
import FocusLock from '../internal/components/focus-lock';
|
|
10
11
|
import { KeyCode } from '../internal/keycode';
|
|
@@ -43,13 +44,14 @@ export default function PopoverBody({ dismissButton: showDismissButton, dismissA
|
|
|
43
44
|
return (React.createElement("div", { className: clsx(styles.body, styles[`body-variant-${variant}`], className, {
|
|
44
45
|
[styles['body-overflow-visible']]: overflowVisible === 'both',
|
|
45
46
|
}), onKeyDown: onKeyDown, ...dialogProps },
|
|
46
|
-
React.createElement(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
React.createElement("
|
|
51
|
-
|
|
52
|
-
!header &&
|
|
53
|
-
|
|
47
|
+
React.createElement(BuiltInErrorBoundary, null,
|
|
48
|
+
React.createElement(FocusLock, { disabled: !shouldTrapFocus, autoFocus: false },
|
|
49
|
+
header && (React.createElement("div", { className: clsx(styles['header-row'], showDismissButton && styles['has-dismiss']) },
|
|
50
|
+
dismissButton,
|
|
51
|
+
React.createElement("div", { className: styles.header, id: labelledById },
|
|
52
|
+
React.createElement("h2", null, header)))),
|
|
53
|
+
React.createElement("div", { className: !header && showDismissButton ? styles['has-dismiss'] : undefined },
|
|
54
|
+
!header && dismissButton,
|
|
55
|
+
React.createElement("div", { className: clsx(styles.content, { [styles['content-overflow-visible']]: !!overflowVisible }) }, children))))));
|
|
54
56
|
}
|
|
55
57
|
//# sourceMappingURL=body.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"body.js","sourceRoot":"","sources":["../../../src/popover/body.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAC5E,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAGjH,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,SAAS,MAAM,mCAAmC,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAkBrC,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,aAAa,EAAE,iBAAiB,EAChC,gBAAgB,EAChB,MAAM,EACN,QAAQ,EACR,SAAS,EACT,OAAO,EACP,eAAe,EACf,SAAS,EACT,cAAc,EACd,oBAAoB,GACH;IACjB,MAAM,IAAI,GAAG,eAAe,CAAC,SAAS,CAAC,CAAC;IACxC,MAAM,YAAY,GAAG,WAAW,CAAC,gBAAgB,CAAC,CAAC;IACnD,M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EAAE,iBAAiB,IAAI,MAAM,CAAC,aAAa,CAAC,CAAC;oBACnF,aAAa;oBACd,6BAAK,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE,EAAE,YAAY;wBAC7C,gCAAK,MAAM,CAAM,CACb,CACF,CACP;gBACD,6BAAK,SAAS,EAAE,CAAC,MAAM,IAAI,iBAAiB,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS;oBAC7E,CAAC,MAAM,IAAI,aAAa;oBACzB,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC,EAAE,CAAC,CAAC,eAAe,EAAE,CAAC,IAC9F,QAAQ,CACL,CACF,CACI,CACS,CACnB,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback, useEffect, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useUniqueId } from '@cloudscape-design/component-toolkit/internal';\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { ButtonProps } from '../button/interfaces';\nimport { InternalButton } from '../button/internal';\nimport { BuiltInErrorBoundary } from '../error-boundary/internal';\nimport { useInternalI18n } from '../i18n/context';\nimport FocusLock from '../internal/components/focus-lock';\nimport { KeyCode } from '../internal/keycode';\n\nimport styles from './styles.css.js';\n\nexport interface PopoverBodyProps {\n dismissButton: boolean;\n dismissAriaLabel: string | undefined;\n onDismiss: (() => void) | undefined;\n\n header: React.ReactNode | undefined;\n children: React.ReactNode;\n variant?: 'annotation' | 'chart';\n overflowVisible?: 'content' | 'both';\n\n className?: string;\n ariaLabelledby?: string;\n\n closeAnalyticsAction?: string;\n}\n\nexport default function PopoverBody({\n dismissButton: showDismissButton,\n dismissAriaLabel,\n header,\n children,\n onDismiss,\n variant,\n overflowVisible,\n className,\n ariaLabelledby,\n closeAnalyticsAction,\n}: PopoverBodyProps) {\n const i18n = useInternalI18n('popover');\n const labelledById = useUniqueId('awsui-popover-');\n const dismissButtonFocused = useRef(false);\n const dismissButtonRef = useRef<ButtonProps.Ref>(null);\n\n const onKeyDown = useCallback(\n (event: React.KeyboardEvent) => {\n if (event.keyCode === KeyCode.escape) {\n event.stopPropagation();\n onDismiss?.();\n }\n },\n [onDismiss]\n );\n\n // Implement our own auto-focus rather than using FocusLock's,\n // because we also want to focus the dismiss button when it\n // is added dynamically (e.g. in chart popovers)\n useEffect(() => {\n if (showDismissButton && !dismissButtonFocused.current) {\n dismissButtonRef.current?.focus({ preventScroll: true });\n }\n dismissButtonFocused.current = showDismissButton;\n }, [showDismissButton]);\n\n const dismissButton = (showDismissButton ?? null) && (\n <div\n className={styles.dismiss}\n {...(closeAnalyticsAction ? getAnalyticsMetadataAttribute({ action: closeAnalyticsAction }) : {})}\n >\n <InternalButton\n variant=\"icon\"\n formAction=\"none\"\n iconName=\"close\"\n className={styles['dismiss-control']}\n ariaLabel={i18n('dismissAriaLabel', dismissAriaLabel)}\n onClick={() => onDismiss?.()}\n ref={dismissButtonRef}\n />\n </div>\n );\n\n const isDialog = showDismissButton;\n const shouldTrapFocus = showDismissButton && variant !== 'annotation';\n\n const dialogProps = isDialog\n ? {\n role: 'dialog',\n 'aria-labelledby': ariaLabelledby ?? (header ? labelledById : undefined),\n }\n : {};\n\n return (\n <div\n className={clsx(styles.body, styles[`body-variant-${variant}`], className, {\n [styles['body-overflow-visible']]: overflowVisible === 'both',\n })}\n onKeyDown={onKeyDown}\n {...dialogProps}\n >\n <BuiltInErrorBoundary>\n <FocusLock disabled={!shouldTrapFocus} autoFocus={false}>\n {header && (\n <div className={clsx(styles['header-row'], showDismissButton && styles['has-dismiss'])}>\n {dismissButton}\n <div className={styles.header} id={labelledById}>\n <h2>{header}</h2>\n </div>\n </div>\n )}\n <div className={!header && showDismissButton ? styles['has-dismiss'] : undefined}>\n {!header && dismissButton}\n <div className={clsx(styles.content, { [styles['content-overflow-visible']]: !!overflowVisible })}>\n {children}\n </div>\n </div>\n </FocusLock>\n </BuiltInErrorBoundary>\n </div>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"implementation.d.ts","sourceRoot":"","sources":["../../../src/split-panel/implementation.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"implementation.d.ts","sourceRoot":"","sources":["../../../src/split-panel/implementation.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAGlF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAO/C,MAAM,MAAM,6BAA6B,GAAG,YAAY,CAAC,eAAe,EAAE,uBAAuB,GAAG,eAAe,CAAC,GAClH,0BAA0B,CAAC;AAE7B,wBAAgB,wBAAwB,CAAC,EACvC,iBAAiB,EACjB,MAAM,EACN,QAAQ,EACR,qBAAqB,EACrB,aAAa,EACb,WAAgB,EAChB,SAAS,EACT,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,UAAU,EACV,GAAG,SAAS,EACb,EAAE,6BAA6B,eA4Q/B;AAED,eAAO,MAAM,0BAA0B,2FAAsD,CAAC"}
|
|
@@ -7,6 +7,7 @@ import { useAppLayoutToolbarDesignEnabled } from '../app-layout/utils/feature-fl
|
|
|
7
7
|
import { useKeyboardEvents } from '../app-layout/utils/use-keyboard-events';
|
|
8
8
|
import { usePointerEvents } from '../app-layout/utils/use-pointer-events';
|
|
9
9
|
import { InternalButton } from '../button/internal';
|
|
10
|
+
import { BuiltInErrorBoundary } from '../error-boundary/internal';
|
|
10
11
|
import { getBaseProps } from '../internal/base-component';
|
|
11
12
|
import PanelResizeHandle from '../internal/components/panel-resize-handle';
|
|
12
13
|
import { useSplitPanelContext } from '../internal/context/split-panel-context';
|
|
@@ -111,8 +112,10 @@ export function SplitPanelImplementation({ __internalRootRef, header, children,
|
|
|
111
112
|
return React.createElement(React.Fragment, null);
|
|
112
113
|
}
|
|
113
114
|
return (React.createElement(React.Fragment, null,
|
|
114
|
-
position === 'side' && (React.createElement(SplitPanelContentSide, { style: contentStyle, resizeHandle: resizeHandle, baseProps: baseProps, isOpen: isOpen, splitPanelRef: mergedRef, cappedSize: size, onToggle: onToggle, openButtonAriaLabel: openButtonAriaLabel, toggleRef: refs.toggle, header: wrappedHeader, panelHeaderId: panelHeaderId, ariaLabel: ariaLabel, closeBehavior: closeBehavior },
|
|
115
|
-
|
|
115
|
+
position === 'side' && (React.createElement(SplitPanelContentSide, { style: contentStyle, resizeHandle: resizeHandle, baseProps: baseProps, isOpen: isOpen, splitPanelRef: mergedRef, cappedSize: size, onToggle: onToggle, openButtonAriaLabel: openButtonAriaLabel, toggleRef: refs.toggle, header: wrappedHeader, panelHeaderId: panelHeaderId, ariaLabel: ariaLabel, closeBehavior: closeBehavior },
|
|
116
|
+
React.createElement(BuiltInErrorBoundary, null, children))),
|
|
117
|
+
position === 'bottom' && (React.createElement(SplitPanelContentBottom, { style: contentStyle, resizeHandle: resizeHandle, baseProps: baseProps, isOpen: isOpen, splitPanelRef: mergedRef, cappedSize: size, onToggle: onToggle, header: wrappedHeader, panelHeaderId: panelHeaderId, appLayoutMaxWidth: appLayoutMaxWidth, ariaLabel: ariaLabel, closeBehavior: closeBehavior, hasCustomElements: hasCustomElements },
|
|
118
|
+
React.createElement(BuiltInErrorBoundary, null, children))),
|
|
116
119
|
isPreferencesOpen && (React.createElement(PreferencesModal, { visible: true, preferences: { position }, disabledSidePosition: position === 'bottom' && isForcedPosition, isRefresh: isRefresh, i18nStrings: {
|
|
117
120
|
header: i18nStrings.preferencesTitle,
|
|
118
121
|
confirm: i18nStrings.preferencesConfirm,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"implementation.js","sourceRoot":"","sources":["../../../src/split-panel/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,GACD,CACH,CACA,CACJ,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,0BAA0B,GAAG,yBAAyB,CAAC,wBAAwB,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, useUniqueId, warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport { useAppLayoutToolbarDesignEnabled } from '../app-layout/utils/feature-flags';\nimport { SizeControlProps } from '../app-layout/utils/interfaces';\nimport { useKeyboardEvents } from '../app-layout/utils/use-keyboard-events';\nimport { usePointerEvents } from '../app-layout/utils/use-pointer-events';\nimport { InternalButton } from '../button/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport PanelResizeHandle from '../internal/components/panel-resize-handle';\nimport { useSplitPanelContext } from '../internal/context/split-panel-context';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport globalVars from '../internal/styles/global-vars';\nimport { SomeRequired } from '../internal/types';\nimport { createWidgetizedComponent } from '../internal/widgets';\nimport { SplitPanelContentBottom } from './bottom';\nimport { SplitPanelProps } from './interfaces';\nimport PreferencesModal from './preferences-modal';\nimport { SplitPanelContentSide } from './side';\n\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\nexport type SplitPanelImplementationProps = SomeRequired<SplitPanelProps, 'hidePreferencesButton' | 'closeBehavior'> &\n InternalBaseComponentProps;\n\nexport function SplitPanelImplementation({\n __internalRootRef,\n header,\n children,\n hidePreferencesButton,\n closeBehavior,\n i18nStrings = {},\n ariaLabel,\n headerActions,\n headerBefore,\n headerDescription,\n headerInfo,\n ...restProps\n}: SplitPanelImplementationProps) {\n const isRefresh = useVisualRefresh();\n const isToolbar = useAppLayoutToolbarDesignEnabled();\n\n if (!header && !headerBefore) {\n warnOnce('SplitPanel', 'You must provide either `header` or `headerBefore`.');\n }\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 animationDisabled,\n } = useSplitPanelContext();\n const baseProps = getBaseProps(restProps);\n const [isPreferencesOpen, setPreferencesOpen] = useState<boolean>(false);\n\n const appLayoutMaxWidth = isRefresh && position === 'bottom' ? contentWidthStyles : undefined;\n\n const openButtonAriaLabel = i18nStrings.openButtonAriaLabel;\n useEffect(() => {\n setSplitPanelToggle({ displayed: closeBehavior === 'collapse', ariaLabel: openButtonAriaLabel });\n\n return () => {\n setSplitPanelToggle({ displayed: false, ariaLabel: undefined });\n };\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, onDirectionClick } = useKeyboardEvents(sizeControlProps);\n\n const contentStyle = {\n [globalVars.stickyVerticalTopOffset]: topOffset,\n [globalVars.stickyVerticalBottomOffset]: bottomOffset,\n };\n\n const panelHeaderUniqueId = useUniqueId('split-panel-header');\n const panelHeaderId = ariaLabel ? undefined : panelHeaderUniqueId;\n\n const showActions = headerActions && isOpen;\n const showDescription = headerDescription && isOpen;\n const hasCustomElements = !!headerActions || !!headerBefore || !!headerInfo;\n\n const wrappedHeader = (\n <div className={clsx(styles.header, isToolbar && styles['with-toolbar'])} style={appLayoutMaxWidth}>\n <div className={styles['header-main-row']}>\n <div className={styles['header-main-content']}>\n <div className={clsx(styles['header-tag-and-info'], showDescription && styles['with-description'])}>\n <h2 className={clsx(styles['header-tag'], !!headerInfo && styles['with-info'])} id={panelHeaderId}>\n {headerBefore && (\n <div\n className={clsx(\n styles['header-before-slot'],\n testUtilStyles['header-before'],\n !!header && styles['with-header-text']\n )}\n >\n {headerBefore}\n </div>\n )}\n {!!header && <div className={clsx(styles['header-text'], testUtilStyles['header-text'])}>{header}</div>}\n </h2>\n {headerInfo && (\n <span className={clsx(styles['header-info-slot'], testUtilStyles['header-info'])}>{headerInfo}</span>\n )}\n </div>\n {showActions && (\n <div className={clsx(styles['header-actions-slot'], testUtilStyles['header-actions'])}>{headerActions}</div>\n )}\n </div>\n <div className={styles['header-buttons']}>\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={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={i18nStrings.closeButtonAriaLabel}\n ariaExpanded={isOpen}\n />\n ) : position === 'side' || closeBehavior === 'hide' ? null : (\n <InternalButton\n className={testUtilStyles['open-button']}\n iconName=\"angle-up\"\n variant=\"icon\"\n formAction=\"none\"\n ariaLabel={i18nStrings.openButtonAriaLabel}\n ref={refs.toggle}\n ariaExpanded={isOpen}\n onClick={hasCustomElements ? onToggle : undefined}\n />\n )}\n </div>\n </div>\n\n {showDescription && (\n <p className={clsx(styles['header-description'], testUtilStyles['header-description'])}>{headerDescription}</p>\n )}\n </div>\n );\n\n const resizeHandle = (\n <PanelResizeHandle\n ref={refs.slider}\n className={testUtilStyles.slider}\n tooltipText={i18nStrings.resizeHandleTooltipText}\n ariaLabel={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 onDirectionClick={onDirectionClick}\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 && (animationDisabled || !isRefresh)) {\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 && !isToolbar && !isOpen && position === 'side') {\n return <></>;\n }\n\n return (\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={openButtonAriaLabel}\n toggleRef={refs.toggle}\n header={wrappedHeader}\n panelHeaderId={panelHeaderId}\n ariaLabel={ariaLabel}\n closeBehavior={closeBehavior}\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 appLayoutMaxWidth={appLayoutMaxWidth}\n ariaLabel={ariaLabel}\n closeBehavior={closeBehavior}\n hasCustomElements={hasCustomElements}\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: i18nStrings.preferencesTitle,\n confirm: i18nStrings.preferencesConfirm,\n cancel: i18nStrings.preferencesCancel,\n close: i18nStrings.preferencesCloseAriaLabel,\n positionLabel: i18nStrings.preferencesPositionLabel,\n positionDescription: i18nStrings.preferencesPositionDescription,\n positionBottom: i18nStrings.preferencesPositionBottom,\n positionSide: i18nStrings.preferencesPositionSide,\n }}\n onConfirm={preferences => {\n onPreferencesChange({ ...preferences });\n setPreferencesOpen(false);\n }}\n onDismiss={() => {\n setPreferencesOpen(false);\n }}\n />\n )}\n </>\n );\n}\n\nexport const createWidgetizedSplitPanel = createWidgetizedComponent(SplitPanelImplementation);\n"]}
|
|
1
|
+
{"version":3,"file":"implementation.js","sourceRoot":"","sources":["../../../src/split-panel/implementation.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5E,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAEpG,OAAO,EAAE,gCAAgC,EAAE,MAAM,mCAAmC,CAAC;AAErF,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC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C/B,CAC3B;QACA,iBAAiB,IAAI,CACpB,oBAAC,gBAAgB,IACf,OAAO,EAAE,IAAI,EACb,WAAW,EAAE,EAAE,QAAQ,EAAE,EACzB,oBAAoB,EAAE,QAAQ,KAAK,QAAQ,IAAI,gBAAgB,EAC/D,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE;gBACX,MAAM,EAAE,WAAW,CAAC,gBAAgB;gBACpC,OAAO,EAAE,WAAW,CAAC,kBAAkB;gBACvC,MAAM,EAAE,WAAW,CAAC,iBAAiB;gBACrC,KAAK,EAAE,WAAW,CAAC,yBAAyB;gBAC5C,aAAa,EAAE,WAAW,CAAC,wBAAwB;gBACnD,mBAAmB,EAAE,WAAW,CAAC,8BAA8B;gBAC/D,cAAc,EAAE,WAAW,CAAC,yBAAyB;gBACrD,YAAY,EAAE,WAAW,CAAC,uBAAuB;aAClD,EACD,SAAS,EAAE,WAAW,CAAC,EAAE;gBACvB,mBAAmB,CAAC,EAAE,GAAG,WAAW,EAAE,CAAC,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,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,0BAA0B,GAAG,yBAAyB,CAAC,wBAAwB,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, useUniqueId, warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport { useAppLayoutToolbarDesignEnabled } from '../app-layout/utils/feature-flags';\nimport { SizeControlProps } from '../app-layout/utils/interfaces';\nimport { useKeyboardEvents } from '../app-layout/utils/use-keyboard-events';\nimport { usePointerEvents } from '../app-layout/utils/use-pointer-events';\nimport { InternalButton } from '../button/internal';\nimport { BuiltInErrorBoundary } from '../error-boundary/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport PanelResizeHandle from '../internal/components/panel-resize-handle';\nimport { useSplitPanelContext } from '../internal/context/split-panel-context';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport globalVars from '../internal/styles/global-vars';\nimport { SomeRequired } from '../internal/types';\nimport { createWidgetizedComponent } from '../internal/widgets';\nimport { SplitPanelContentBottom } from './bottom';\nimport { SplitPanelProps } from './interfaces';\nimport PreferencesModal from './preferences-modal';\nimport { SplitPanelContentSide } from './side';\n\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\nexport type SplitPanelImplementationProps = SomeRequired<SplitPanelProps, 'hidePreferencesButton' | 'closeBehavior'> &\n InternalBaseComponentProps;\n\nexport function SplitPanelImplementation({\n __internalRootRef,\n header,\n children,\n hidePreferencesButton,\n closeBehavior,\n i18nStrings = {},\n ariaLabel,\n headerActions,\n headerBefore,\n headerDescription,\n headerInfo,\n ...restProps\n}: SplitPanelImplementationProps) {\n const isRefresh = useVisualRefresh();\n const isToolbar = useAppLayoutToolbarDesignEnabled();\n\n if (!header && !headerBefore) {\n warnOnce('SplitPanel', 'You must provide either `header` or `headerBefore`.');\n }\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 animationDisabled,\n } = useSplitPanelContext();\n const baseProps = getBaseProps(restProps);\n const [isPreferencesOpen, setPreferencesOpen] = useState<boolean>(false);\n\n const appLayoutMaxWidth = isRefresh && position === 'bottom' ? contentWidthStyles : undefined;\n\n const openButtonAriaLabel = i18nStrings.openButtonAriaLabel;\n useEffect(() => {\n setSplitPanelToggle({ displayed: closeBehavior === 'collapse', ariaLabel: openButtonAriaLabel });\n\n return () => {\n setSplitPanelToggle({ displayed: false, ariaLabel: undefined });\n };\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, onDirectionClick } = useKeyboardEvents(sizeControlProps);\n\n const contentStyle = {\n [globalVars.stickyVerticalTopOffset]: topOffset,\n [globalVars.stickyVerticalBottomOffset]: bottomOffset,\n };\n\n const panelHeaderUniqueId = useUniqueId('split-panel-header');\n const panelHeaderId = ariaLabel ? undefined : panelHeaderUniqueId;\n\n const showActions = headerActions && isOpen;\n const showDescription = headerDescription && isOpen;\n const hasCustomElements = !!headerActions || !!headerBefore || !!headerInfo;\n\n const wrappedHeader = (\n <div className={clsx(styles.header, isToolbar && styles['with-toolbar'])} style={appLayoutMaxWidth}>\n <div className={styles['header-main-row']}>\n <div className={styles['header-main-content']}>\n <div className={clsx(styles['header-tag-and-info'], showDescription && styles['with-description'])}>\n <h2 className={clsx(styles['header-tag'], !!headerInfo && styles['with-info'])} id={panelHeaderId}>\n {headerBefore && (\n <div\n className={clsx(\n styles['header-before-slot'],\n testUtilStyles['header-before'],\n !!header && styles['with-header-text']\n )}\n >\n {headerBefore}\n </div>\n )}\n {!!header && <div className={clsx(styles['header-text'], testUtilStyles['header-text'])}>{header}</div>}\n </h2>\n {headerInfo && (\n <span className={clsx(styles['header-info-slot'], testUtilStyles['header-info'])}>{headerInfo}</span>\n )}\n </div>\n {showActions && (\n <div className={clsx(styles['header-actions-slot'], testUtilStyles['header-actions'])}>{headerActions}</div>\n )}\n </div>\n <div className={styles['header-buttons']}>\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={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={i18nStrings.closeButtonAriaLabel}\n ariaExpanded={isOpen}\n />\n ) : position === 'side' || closeBehavior === 'hide' ? null : (\n <InternalButton\n className={testUtilStyles['open-button']}\n iconName=\"angle-up\"\n variant=\"icon\"\n formAction=\"none\"\n ariaLabel={i18nStrings.openButtonAriaLabel}\n ref={refs.toggle}\n ariaExpanded={isOpen}\n onClick={hasCustomElements ? onToggle : undefined}\n />\n )}\n </div>\n </div>\n\n {showDescription && (\n <p className={clsx(styles['header-description'], testUtilStyles['header-description'])}>{headerDescription}</p>\n )}\n </div>\n );\n\n const resizeHandle = (\n <PanelResizeHandle\n ref={refs.slider}\n className={testUtilStyles.slider}\n tooltipText={i18nStrings.resizeHandleTooltipText}\n ariaLabel={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 onDirectionClick={onDirectionClick}\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 && (animationDisabled || !isRefresh)) {\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 && !isToolbar && !isOpen && position === 'side') {\n return <></>;\n }\n\n return (\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={openButtonAriaLabel}\n toggleRef={refs.toggle}\n header={wrappedHeader}\n panelHeaderId={panelHeaderId}\n ariaLabel={ariaLabel}\n closeBehavior={closeBehavior}\n >\n <BuiltInErrorBoundary>{children}</BuiltInErrorBoundary>\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 appLayoutMaxWidth={appLayoutMaxWidth}\n ariaLabel={ariaLabel}\n closeBehavior={closeBehavior}\n hasCustomElements={hasCustomElements}\n >\n <BuiltInErrorBoundary>{children}</BuiltInErrorBoundary>\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: i18nStrings.preferencesTitle,\n confirm: i18nStrings.preferencesConfirm,\n cancel: i18nStrings.preferencesCancel,\n close: i18nStrings.preferencesCloseAriaLabel,\n positionLabel: i18nStrings.preferencesPositionLabel,\n positionDescription: i18nStrings.preferencesPositionDescription,\n positionBottom: i18nStrings.preferencesPositionBottom,\n positionSide: i18nStrings.preferencesPositionSide,\n }}\n onConfirm={preferences => {\n onPreferencesChange({ ...preferences });\n setPreferencesOpen(false);\n }}\n onDismiss={() => {\n setPreferencesOpen(false);\n }}\n />\n )}\n </>\n );\n}\n\nexport const createWidgetizedSplitPanel = createWidgetizedComponent(SplitPanelImplementation);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tabs/index.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAMzC,OAAO,EAAE,SAAS,EAAE,CAAC;AAsBrB,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,EAC3B,IAAI,EACJ,OAAmB,EACnB,QAAQ,EACR,WAAW,EAAE,eAAe,EAC5B,SAAS,EACT,cAAc,EACd,sBAA8B,EAC9B,WAAW,EACX,SAAS,EACT,sBAAoC,EACpC,OAAO,EACP,KAAK,EACL,GAAG,IAAI,EACR,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tabs/index.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAMzC,OAAO,EAAE,SAAS,EAAE,CAAC;AAsBrB,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,EAC3B,IAAI,EACJ,OAAmB,EACnB,QAAQ,EACR,WAAW,EAAE,eAAe,EAC5B,SAAS,EACT,cAAc,EACd,sBAA8B,EAC9B,WAAW,EACX,SAAS,EACT,sBAAoC,EACpC,OAAO,EACP,KAAK,EACL,GAAG,IAAI,EACR,EAAE,SAAS,eAqIX"}
|
|
@@ -101,7 +101,7 @@ export default function Tabs({ tabs, variant = 'default', onChange, activeTabId:
|
|
|
101
101
|
fireNonCancelableEvent(onChange, changeDetail);
|
|
102
102
|
}, i18nStrings: i18nStrings, keyboardActivationMode: keyboardActivationMode, style: style }));
|
|
103
103
|
if (variant === 'container' || variant === 'stacked') {
|
|
104
|
-
return (React.createElement(InternalContainer, { header: header, disableHeaderPaddings: true, ...baseProps, className: clsx(baseProps.className, styles.root), __internalRootRef: __internalRootRef, disableContentPaddings: true, variant: variant === 'stacked' ? 'stacked' : 'default', fitHeight: fitHeight, ...getAnalyticsMetadataAttribute({ component: analyticsComponentMetadata }), style: style === null || style === void 0 ? void 0 : style.container }, content()));
|
|
104
|
+
return (React.createElement(InternalContainer, { header: header, disableHeaderPaddings: true, ...baseProps, className: clsx(baseProps.className, styles.root), __internalRootRef: __internalRootRef, __contentKey: activeTabId, disableContentPaddings: true, variant: variant === 'stacked' ? 'stacked' : 'default', fitHeight: fitHeight, ...getAnalyticsMetadataAttribute({ component: analyticsComponentMetadata }), style: style === null || style === void 0 ? void 0 : style.container }, content()));
|
|
105
105
|
}
|
|
106
106
|
return (React.createElement("div", { ...baseProps, className: clsx(baseProps.className, styles.root, styles.tabs, { [styles['fit-height']]: fitHeight }), ref: __internalRootRef, ...getAnalyticsMetadataAttribute({ component: analyticsComponentMetadata }) },
|
|
107
107
|
header,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tabs/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;AACb,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAC5E,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,iBAAiB,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE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AAE,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,EACjD,iBAAiB,EAAE,iBAAiB,EACpC,sBAAsB,EAAE,IAAI,EAC5B,OAAO,EAAE,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EACtD,SAAS,EAAE,SAAS,KAChB,6BAA6B,CAAC,EAAE,SAAS,EAAE,0BAA0B,EAAE,CAAC,EAC5E,KAAK,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,SAAS,IAEtB,OAAO,EAAE,CACQ,CACrB,CAAC;IACJ,CAAC;IAED,OAAO,CACL,gCACM,SAAS,EACb,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EACrG,GAAG,EAAE,iBAAiB,KAClB,6BAA6B,CAAC,EAAE,SAAS,EAAE,0BAA0B,EAAE,CAAC;QAE3E,MAAM;QACN,OAAO,EAAE,CACN,CACP,CAAC;AACJ,CAAC;AAED,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n'use client';\nimport React, { useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useUniqueId } from '@cloudscape-design/component-toolkit/internal';\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport InternalContainer from '../container/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useControllable } from '../internal/hooks/use-controllable';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { checkSafeUrl } from '../internal/utils/check-safe-url';\nimport { GeneratedAnalyticsMetadataTabsComponent } from './analytics-metadata/interfaces';\nimport { TabsProps } from './interfaces';\nimport { getTabElementId, TabHeaderBar } from './tab-header-bar';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\n\nexport { TabsProps };\n\nfunction firstEnabledTab(tabs: ReadonlyArray<TabsProps.Tab>) {\n const enabledTabs = tabs.filter(tab => !tab.disabled);\n if (enabledTabs.length > 0) {\n return enabledTabs[0];\n }\n return null;\n}\n\nfunction shouldRenderTabContent(tab: TabsProps.Tab, viewedTabs: Set<string>) {\n switch (tab.contentRenderStrategy) {\n case 'active':\n return false; // rendering active tab is handled directly in component\n case 'eager':\n return true;\n case 'lazy':\n return viewedTabs.has(tab.id);\n }\n return false;\n}\n\nexport default function Tabs({\n tabs,\n variant = 'default',\n onChange,\n activeTabId: controlledTabId,\n ariaLabel,\n ariaLabelledby,\n disableContentPaddings = false,\n i18nStrings,\n fitHeight,\n keyboardActivationMode = 'automatic',\n actions,\n style,\n ...rest\n}: TabsProps) {\n for (const tab of tabs) {\n checkSafeUrl('Tabs', tab.href);\n }\n const { __internalRootRef } = useBaseComponent('Tabs', {\n props: { disableContentPaddings, variant, fitHeight, keyboardActivationMode },\n metadata: {\n hasActions: tabs.some(tab => !!tab.action),\n hasHeaderActions: !!actions,\n hasDisabledReasons: tabs.some(tab => !!tab.disabledReason),\n hasEagerLoadedTabs: tabs.some(tab => tab.contentRenderStrategy === 'eager'),\n hasLazyLoadedTabs: tabs.some(tab => tab.contentRenderStrategy === 'lazy'),\n },\n });\n const idNamespace = useUniqueId('awsui-tabs-');\n\n const [activeTabId, setActiveTabId] = useControllable(controlledTabId, onChange, firstEnabledTab(tabs)?.id ?? '', {\n componentName: 'Tabs',\n controlledProp: 'activeTabId',\n changeHandler: 'onChange',\n });\n\n const viewedTabs = useRef(new Set<string>());\n if (activeTabId !== undefined) {\n viewedTabs.current.add(activeTabId);\n }\n\n const baseProps = getBaseProps(rest);\n\n const analyticsComponentMetadata: GeneratedAnalyticsMetadataTabsComponent = {\n name: 'awsui.Tabs',\n label: `.${analyticsSelectors['tabs-header-list']}`,\n };\n\n if (activeTabId) {\n analyticsComponentMetadata.properties = {\n activeTabId,\n activeTabLabel: `.${analyticsSelectors['active-tab-header']} .${analyticsSelectors['tab-label']}`,\n activeTabPosition: `${tabs.findIndex(tab => tab.id === activeTabId) + 1}`,\n tabsCount: `${tabs.length}`,\n };\n }\n\n const content = () => {\n const selectedTab = tabs.filter(tab => tab.id === activeTabId)[0];\n const renderContent = (tab: TabsProps.Tab) => {\n const isTabSelected = tab === selectedTab;\n\n const classes = clsx({\n [styles['tabs-content']]: true,\n [styles['tabs-content-active']]: isTabSelected,\n });\n\n const contentAttributes: JSX.IntrinsicElements['div'] = {\n className: classes,\n role: 'tabpanel',\n id: `${idNamespace}-${tab.id}-panel`,\n key: `${idNamespace}-${tab.id}-panel`,\n tabIndex: 0,\n 'aria-labelledby': getTabElementId({ namespace: idNamespace, tabId: tab.id }),\n };\n\n const isContentShown = !tab.disabled && (isTabSelected || shouldRenderTabContent(tab, viewedTabs.current));\n\n return <div {...contentAttributes}>{isContentShown && tab.content}</div>;\n };\n\n return (\n <div\n className={clsx(\n variant === 'container' || variant === 'stacked'\n ? styles['tabs-container-content-wrapper']\n : styles['tabs-content-wrapper'],\n {\n [styles['with-paddings']]: !disableContentPaddings,\n }\n )}\n >\n {tabs.map(renderContent)}\n </div>\n );\n };\n\n const header = (\n <TabHeaderBar\n activeTabId={activeTabId}\n variant={variant}\n idNamespace={idNamespace}\n ariaLabel={ariaLabel}\n ariaLabelledby={ariaLabelledby}\n tabs={tabs}\n actions={actions}\n onChange={changeDetail => {\n setActiveTabId(changeDetail.activeTabId);\n fireNonCancelableEvent(onChange, changeDetail);\n }}\n i18nStrings={i18nStrings}\n keyboardActivationMode={keyboardActivationMode}\n style={style}\n />\n );\n\n if (variant === 'container' || variant === 'stacked') {\n return (\n <InternalContainer\n header={header}\n disableHeaderPaddings={true}\n {...baseProps}\n className={clsx(baseProps.className, styles.root)}\n __internalRootRef={__internalRootRef}\n disableContentPaddings={true}\n variant={variant === 'stacked' ? 'stacked' : 'default'}\n fitHeight={fitHeight}\n {...getAnalyticsMetadataAttribute({ component: analyticsComponentMetadata })}\n style={style?.container}\n >\n {content()}\n </InternalContainer>\n );\n }\n\n return (\n <div\n {...baseProps}\n className={clsx(baseProps.className, styles.root, styles.tabs, { [styles['fit-height']]: fitHeight })}\n ref={__internalRootRef}\n {...getAnalyticsMetadataAttribute({ component: analyticsComponentMetadata })}\n >\n {header}\n {content()}\n </div>\n );\n}\n\napplyDisplayName(Tabs, 'Tabs');\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tabs/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;AACb,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAC5E,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,iBAAiB,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAGhE,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEjE,OAAO,kBAAkB,MAAM,oCAAoC,CAAC;AACpE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAIrC,SAA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E,CAAC,EAC5E,KAAK,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,SAAS,IAEtB,OAAO,EAAE,CACQ,CACrB,CAAC;IACJ,CAAC;IAED,OAAO,CACL,gCACM,SAAS,EACb,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EACrG,GAAG,EAAE,iBAAiB,KAClB,6BAA6B,CAAC,EAAE,SAAS,EAAE,0BAA0B,EAAE,CAAC;QAE3E,MAAM;QACN,OAAO,EAAE,CACN,CACP,CAAC;AACJ,CAAC;AAED,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n'use client';\nimport React, { useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useUniqueId } from '@cloudscape-design/component-toolkit/internal';\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport InternalContainer from '../container/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useControllable } from '../internal/hooks/use-controllable';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { checkSafeUrl } from '../internal/utils/check-safe-url';\nimport { GeneratedAnalyticsMetadataTabsComponent } from './analytics-metadata/interfaces';\nimport { TabsProps } from './interfaces';\nimport { getTabElementId, TabHeaderBar } from './tab-header-bar';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\n\nexport { TabsProps };\n\nfunction firstEnabledTab(tabs: ReadonlyArray<TabsProps.Tab>) {\n const enabledTabs = tabs.filter(tab => !tab.disabled);\n if (enabledTabs.length > 0) {\n return enabledTabs[0];\n }\n return null;\n}\n\nfunction shouldRenderTabContent(tab: TabsProps.Tab, viewedTabs: Set<string>) {\n switch (tab.contentRenderStrategy) {\n case 'active':\n return false; // rendering active tab is handled directly in component\n case 'eager':\n return true;\n case 'lazy':\n return viewedTabs.has(tab.id);\n }\n return false;\n}\n\nexport default function Tabs({\n tabs,\n variant = 'default',\n onChange,\n activeTabId: controlledTabId,\n ariaLabel,\n ariaLabelledby,\n disableContentPaddings = false,\n i18nStrings,\n fitHeight,\n keyboardActivationMode = 'automatic',\n actions,\n style,\n ...rest\n}: TabsProps) {\n for (const tab of tabs) {\n checkSafeUrl('Tabs', tab.href);\n }\n const { __internalRootRef } = useBaseComponent('Tabs', {\n props: { disableContentPaddings, variant, fitHeight, keyboardActivationMode },\n metadata: {\n hasActions: tabs.some(tab => !!tab.action),\n hasHeaderActions: !!actions,\n hasDisabledReasons: tabs.some(tab => !!tab.disabledReason),\n hasEagerLoadedTabs: tabs.some(tab => tab.contentRenderStrategy === 'eager'),\n hasLazyLoadedTabs: tabs.some(tab => tab.contentRenderStrategy === 'lazy'),\n },\n });\n const idNamespace = useUniqueId('awsui-tabs-');\n\n const [activeTabId, setActiveTabId] = useControllable(controlledTabId, onChange, firstEnabledTab(tabs)?.id ?? '', {\n componentName: 'Tabs',\n controlledProp: 'activeTabId',\n changeHandler: 'onChange',\n });\n\n const viewedTabs = useRef(new Set<string>());\n if (activeTabId !== undefined) {\n viewedTabs.current.add(activeTabId);\n }\n\n const baseProps = getBaseProps(rest);\n\n const analyticsComponentMetadata: GeneratedAnalyticsMetadataTabsComponent = {\n name: 'awsui.Tabs',\n label: `.${analyticsSelectors['tabs-header-list']}`,\n };\n\n if (activeTabId) {\n analyticsComponentMetadata.properties = {\n activeTabId,\n activeTabLabel: `.${analyticsSelectors['active-tab-header']} .${analyticsSelectors['tab-label']}`,\n activeTabPosition: `${tabs.findIndex(tab => tab.id === activeTabId) + 1}`,\n tabsCount: `${tabs.length}`,\n };\n }\n\n const content = () => {\n const selectedTab = tabs.filter(tab => tab.id === activeTabId)[0];\n const renderContent = (tab: TabsProps.Tab) => {\n const isTabSelected = tab === selectedTab;\n\n const classes = clsx({\n [styles['tabs-content']]: true,\n [styles['tabs-content-active']]: isTabSelected,\n });\n\n const contentAttributes: JSX.IntrinsicElements['div'] = {\n className: classes,\n role: 'tabpanel',\n id: `${idNamespace}-${tab.id}-panel`,\n key: `${idNamespace}-${tab.id}-panel`,\n tabIndex: 0,\n 'aria-labelledby': getTabElementId({ namespace: idNamespace, tabId: tab.id }),\n };\n\n const isContentShown = !tab.disabled && (isTabSelected || shouldRenderTabContent(tab, viewedTabs.current));\n\n return <div {...contentAttributes}>{isContentShown && tab.content}</div>;\n };\n\n return (\n <div\n className={clsx(\n variant === 'container' || variant === 'stacked'\n ? styles['tabs-container-content-wrapper']\n : styles['tabs-content-wrapper'],\n {\n [styles['with-paddings']]: !disableContentPaddings,\n }\n )}\n >\n {tabs.map(renderContent)}\n </div>\n );\n };\n\n const header = (\n <TabHeaderBar\n activeTabId={activeTabId}\n variant={variant}\n idNamespace={idNamespace}\n ariaLabel={ariaLabel}\n ariaLabelledby={ariaLabelledby}\n tabs={tabs}\n actions={actions}\n onChange={changeDetail => {\n setActiveTabId(changeDetail.activeTabId);\n fireNonCancelableEvent(onChange, changeDetail);\n }}\n i18nStrings={i18nStrings}\n keyboardActivationMode={keyboardActivationMode}\n style={style}\n />\n );\n\n if (variant === 'container' || variant === 'stacked') {\n return (\n <InternalContainer\n header={header}\n disableHeaderPaddings={true}\n {...baseProps}\n className={clsx(baseProps.className, styles.root)}\n __internalRootRef={__internalRootRef}\n __contentKey={activeTabId}\n disableContentPaddings={true}\n variant={variant === 'stacked' ? 'stacked' : 'default'}\n fitHeight={fitHeight}\n {...getAnalyticsMetadataAttribute({ component: analyticsComponentMetadata })}\n style={style?.container}\n >\n {content()}\n </InternalContainer>\n );\n }\n\n return (\n <div\n {...baseProps}\n className={clsx(baseProps.className, styles.root, styles.tabs, { [styles['fit-height']]: fitHeight })}\n ref={__internalRootRef}\n {...getAnalyticsMetadataAttribute({ component: analyticsComponentMetadata })}\n >\n {header}\n {content()}\n </div>\n );\n}\n\napplyDisplayName(Tabs, 'Tabs');\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ComponentWrapper, ElementWrapper } from '@cloudscape-design/test-utils-core/dom';
|
|
2
|
+
export default class ErrorBoundaryWrapper extends ComponentWrapper<HTMLButtonElement> {
|
|
3
|
+
static rootSelector: string;
|
|
4
|
+
findHeader(): ElementWrapper;
|
|
5
|
+
findDescription(): ElementWrapper;
|
|
6
|
+
findAction(): null | ElementWrapper;
|
|
7
|
+
findFeedbackAction(): null | ElementWrapper;
|
|
8
|
+
findRefreshAction(): null | ElementWrapper;
|
|
9
|
+
}
|