@cloudscape-design/components-themeable 3.0.3 → 3.0.6
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/scss/container/styles.scss +4 -1
- package/lib/internal/template/alert/interfaces.d.ts +1 -0
- package/lib/internal/template/alert/interfaces.d.ts.map +1 -1
- package/lib/internal/template/alert/interfaces.js.map +1 -1
- package/lib/internal/template/annotation-context/annotation/styles.css.js +24 -24
- package/lib/internal/template/annotation-context/annotation/styles.scoped.css +31 -31
- package/lib/internal/template/annotation-context/annotation/styles.selectors.js +24 -24
- package/lib/internal/template/app-layout/index.d.ts.map +1 -1
- package/lib/internal/template/app-layout/index.js +14 -11
- package/lib/internal/template/app-layout/index.js.map +1 -1
- package/lib/internal/template/app-layout/toggles/styles.css.js +3 -3
- package/lib/internal/template/app-layout/toggles/styles.scoped.css +13 -13
- package/lib/internal/template/app-layout/toggles/styles.selectors.js +3 -3
- package/lib/internal/template/app-layout/visual-refresh/context.d.ts +4 -2
- package/lib/internal/template/app-layout/visual-refresh/context.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/context.js +31 -21
- package/lib/internal/template/app-layout/visual-refresh/context.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/layout.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/layout.js +2 -13
- package/lib/internal/template/app-layout/visual-refresh/layout.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/split-panel.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/split-panel.js +6 -2
- package/lib/internal/template/app-layout/visual-refresh/split-panel.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/styles.css.js +59 -59
- package/lib/internal/template/app-layout/visual-refresh/styles.scoped.css +153 -153
- package/lib/internal/template/app-layout/visual-refresh/styles.selectors.js +59 -59
- package/lib/internal/template/breadcrumb-group/item/styles.css.js +7 -7
- package/lib/internal/template/breadcrumb-group/item/styles.scoped.css +19 -19
- package/lib/internal/template/breadcrumb-group/item/styles.selectors.js +7 -7
- package/lib/internal/template/button/styles.css.js +18 -18
- package/lib/internal/template/button/styles.scoped.css +190 -190
- package/lib/internal/template/button/styles.selectors.js +18 -18
- package/lib/internal/template/checkbox/styles.css.js +3 -3
- package/lib/internal/template/checkbox/styles.scoped.css +8 -8
- package/lib/internal/template/checkbox/styles.selectors.js +3 -3
- package/lib/internal/template/code-editor/preferences-modal.js +2 -2
- package/lib/internal/template/code-editor/preferences-modal.js.map +1 -1
- package/lib/internal/template/code-editor/styles.css.js +33 -33
- package/lib/internal/template/code-editor/styles.scoped.css +168 -168
- package/lib/internal/template/code-editor/styles.selectors.js +33 -33
- package/lib/internal/template/container/styles.css.js +15 -14
- package/lib/internal/template/container/styles.scoped.css +27 -23
- package/lib/internal/template/container/styles.selectors.js +15 -14
- package/lib/internal/template/date-picker/styles.css.js +24 -24
- package/lib/internal/template/date-picker/styles.scoped.css +45 -45
- package/lib/internal/template/date-picker/styles.selectors.js +24 -24
- package/lib/internal/template/date-range-picker/calendar/grids/day/styles.css.js +21 -21
- package/lib/internal/template/date-range-picker/calendar/grids/day/styles.scoped.css +42 -42
- package/lib/internal/template/date-range-picker/calendar/grids/day/styles.selectors.js +21 -21
- package/lib/internal/template/date-range-picker/styles.css.js +42 -42
- package/lib/internal/template/date-range-picker/styles.scoped.css +53 -53
- package/lib/internal/template/date-range-picker/styles.selectors.js +42 -42
- package/lib/internal/template/expandable-section/styles.css.js +20 -20
- package/lib/internal/template/expandable-section/styles.scoped.css +46 -46
- package/lib/internal/template/expandable-section/styles.selectors.js +20 -20
- package/lib/internal/template/flashbar/interfaces.d.ts +4 -4
- package/lib/internal/template/flashbar/interfaces.js.map +1 -1
- package/lib/internal/template/form-field/internal.js +3 -3
- package/lib/internal/template/form-field/internal.js.map +1 -1
- package/lib/internal/template/help-panel/styles.css.js +4 -4
- package/lib/internal/template/help-panel/styles.scoped.css +62 -62
- package/lib/internal/template/help-panel/styles.selectors.js +4 -4
- package/lib/internal/template/input/styles.css.js +13 -13
- package/lib/internal/template/input/styles.scoped.css +39 -39
- package/lib/internal/template/input/styles.selectors.js +13 -13
- package/lib/internal/template/internal/base-component/styles.scoped.css +28 -18
- package/lib/internal/template/internal/components/button-trigger/styles.css.js +9 -9
- package/lib/internal/template/internal/components/button-trigger/styles.scoped.css +31 -31
- package/lib/internal/template/internal/components/button-trigger/styles.selectors.js +9 -9
- package/lib/internal/template/internal/components/cartesian-chart/styles.css.js +21 -21
- package/lib/internal/template/internal/components/cartesian-chart/styles.scoped.css +26 -26
- package/lib/internal/template/internal/components/cartesian-chart/styles.selectors.js +21 -21
- package/lib/internal/template/internal/components/chart-legend/styles.css.js +7 -7
- package/lib/internal/template/internal/components/chart-legend/styles.scoped.css +17 -17
- package/lib/internal/template/internal/components/chart-legend/styles.selectors.js +7 -7
- package/lib/internal/template/internal/components/chart-plot/styles.css.js +5 -5
- package/lib/internal/template/internal/components/chart-plot/styles.scoped.css +7 -7
- package/lib/internal/template/internal/components/chart-plot/styles.selectors.js +5 -5
- package/lib/internal/template/internal/components/filtering-token/styles.css.js +7 -7
- package/lib/internal/template/internal/components/filtering-token/styles.scoped.css +15 -15
- package/lib/internal/template/internal/components/filtering-token/styles.selectors.js +7 -7
- package/lib/internal/template/internal/components/menu-dropdown/styles.css.js +7 -7
- package/lib/internal/template/internal/components/menu-dropdown/styles.scoped.css +15 -15
- package/lib/internal/template/internal/components/menu-dropdown/styles.selectors.js +7 -7
- package/lib/internal/template/internal/components/selectable-item/styles.css.js +16 -16
- package/lib/internal/template/internal/components/selectable-item/styles.scoped.css +29 -29
- package/lib/internal/template/internal/components/selectable-item/styles.selectors.js +16 -16
- package/lib/internal/template/internal/context/app-layout-context.d.ts +1 -1
- package/lib/internal/template/internal/context/app-layout-context.d.ts.map +1 -1
- package/lib/internal/template/internal/context/app-layout-context.js +3 -4
- package/lib/internal/template/internal/context/app-layout-context.js.map +1 -1
- package/lib/internal/template/internal/context/form-field-context.d.ts +1 -1
- package/lib/internal/template/internal/context/form-field-context.d.ts.map +1 -1
- package/lib/internal/template/internal/context/form-field-context.js +3 -4
- package/lib/internal/template/internal/context/form-field-context.js.map +1 -1
- package/lib/internal/template/internal/environment.js +1 -1
- package/lib/internal/template/internal/generated/theming/index.cjs +14 -3
- package/lib/internal/template/internal/generated/theming/index.js +14 -3
- package/lib/internal/template/link/styles.css.js +18 -18
- package/lib/internal/template/link/styles.scoped.css +73 -73
- package/lib/internal/template/link/styles.selectors.js +18 -18
- package/lib/internal/template/pagination/styles.css.js +9 -9
- package/lib/internal/template/pagination/styles.scoped.css +27 -27
- package/lib/internal/template/pagination/styles.selectors.js +9 -9
- package/lib/internal/template/popover/styles.css.js +48 -48
- package/lib/internal/template/popover/styles.scoped.css +64 -64
- package/lib/internal/template/popover/styles.selectors.js +48 -48
- package/lib/internal/template/radio-group/styles.css.js +9 -9
- package/lib/internal/template/radio-group/styles.scoped.css +18 -18
- package/lib/internal/template/radio-group/styles.selectors.js +9 -9
- package/lib/internal/template/segmented-control/styles.css.js +14 -14
- package/lib/internal/template/segmented-control/styles.scoped.css +35 -35
- package/lib/internal/template/segmented-control/styles.selectors.js +14 -14
- package/lib/internal/template/select/utils/use-select.d.ts.map +1 -1
- package/lib/internal/template/select/utils/use-select.js +1 -0
- package/lib/internal/template/select/utils/use-select.js.map +1 -1
- package/lib/internal/template/side-navigation/styles.css.js +22 -22
- package/lib/internal/template/side-navigation/styles.scoped.css +36 -36
- package/lib/internal/template/side-navigation/styles.selectors.js +22 -22
- package/lib/internal/template/split-panel/index.js +2 -2
- package/lib/internal/template/split-panel/index.js.map +1 -1
- package/lib/internal/template/split-panel/styles.css.js +58 -58
- package/lib/internal/template/split-panel/styles.scoped.css +82 -82
- package/lib/internal/template/split-panel/styles.selectors.js +58 -58
- package/lib/internal/template/split-panel/utils/size-utils.d.ts +11 -0
- package/lib/internal/template/split-panel/utils/size-utils.d.ts.map +1 -1
- package/lib/internal/template/split-panel/utils/size-utils.js +12 -1
- package/lib/internal/template/split-panel/utils/size-utils.js.map +1 -1
- package/lib/internal/template/table/header-cell/styles.css.js +14 -14
- package/lib/internal/template/table/header-cell/styles.scoped.css +28 -28
- package/lib/internal/template/table/header-cell/styles.selectors.js +14 -14
- package/lib/internal/template/table/styles.css.js +32 -32
- package/lib/internal/template/table/styles.scoped.css +39 -39
- package/lib/internal/template/table/styles.selectors.js +32 -32
- package/lib/internal/template/tabs/styles.css.js +21 -21
- package/lib/internal/template/tabs/styles.scoped.css +39 -39
- package/lib/internal/template/tabs/styles.selectors.js +21 -21
- package/lib/internal/template/tag-editor/index.js +1 -1
- package/lib/internal/template/tag-editor/index.js.map +1 -1
- package/lib/internal/template/tag-editor/interfaces.d.ts +1 -1
- package/lib/internal/template/tag-editor/interfaces.d.ts.map +1 -1
- package/lib/internal/template/tag-editor/interfaces.js.map +1 -1
- package/lib/internal/template/tag-editor/styles.css.js +3 -3
- package/lib/internal/template/tag-editor/styles.scoped.css +14 -14
- package/lib/internal/template/tag-editor/styles.selectors.js +3 -3
- package/lib/internal/template/text-content/styles.css.js +1 -1
- package/lib/internal/template/text-content/styles.scoped.css +64 -64
- package/lib/internal/template/text-content/styles.selectors.js +1 -1
- package/lib/internal/template/textarea/styles.css.js +4 -4
- package/lib/internal/template/textarea/styles.scoped.css +20 -20
- package/lib/internal/template/textarea/styles.selectors.js +4 -4
- package/lib/internal/template/toggle/styles.css.js +8 -8
- package/lib/internal/template/toggle/styles.scoped.css +16 -16
- package/lib/internal/template/toggle/styles.selectors.js +8 -8
- package/lib/internal/template/token-group/styles.css.js +7 -7
- package/lib/internal/template/token-group/styles.scoped.css +28 -28
- package/lib/internal/template/token-group/styles.selectors.js +7 -7
- package/lib/internal/template/top-navigation/1.0-beta/styles.css.js +25 -25
- package/lib/internal/template/top-navigation/1.0-beta/styles.scoped.css +46 -46
- package/lib/internal/template/top-navigation/1.0-beta/styles.selectors.js +25 -25
- package/lib/internal/template/top-navigation/styles.css.js +47 -47
- package/lib/internal/template/top-navigation/styles.scoped.css +72 -72
- package/lib/internal/template/top-navigation/styles.selectors.js +47 -47
- package/lib/internal/template/tutorial-panel/components/tutorial-list/index.js +1 -1
- package/lib/internal/template/tutorial-panel/components/tutorial-list/index.js.map +1 -1
- package/lib/internal/template/tutorial-panel/components/tutorial-list/styles.css.js +18 -18
- package/lib/internal/template/tutorial-panel/components/tutorial-list/styles.scoped.css +32 -32
- package/lib/internal/template/tutorial-panel/components/tutorial-list/styles.selectors.js +18 -18
- package/lib/internal/template/wizard/styles.css.js +31 -31
- package/lib/internal/template/wizard/styles.scoped.css +62 -62
- package/lib/internal/template/wizard/styles.selectors.js +31 -31
- package/package.json +1 -1
- package/lib/internal/template/internal/hooks/dom-context/index.d.ts +0 -14
- package/lib/internal/template/internal/hooks/dom-context/index.d.ts.map +0 -1
- package/lib/internal/template/internal/hooks/dom-context/index.js +0 -70
- package/lib/internal/template/internal/hooks/dom-context/index.js.map +0 -1
|
@@ -91,7 +91,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
91
91
|
SPDX-License-Identifier: Apache-2.0
|
|
92
92
|
*/
|
|
93
93
|
/* stylelint-disable selector-max-universal, selector-max-type */
|
|
94
|
-
.
|
|
94
|
+
.awsui_root_1xupv_ly7ly_94:not(#\9) {
|
|
95
95
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
96
96
|
border-collapse: separate;
|
|
97
97
|
border-spacing: 0;
|
|
@@ -133,7 +133,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
133
133
|
font-family: var(--font-family-base-mylvzb, "Noto Sans", "Helvetica Neue", Roboto, Arial, sans-serif);
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
.
|
|
136
|
+
.awsui_wizard_1xupv_ly7ly_105.awsui_refresh_1xupv_ly7ly_105:not(#\9) {
|
|
137
137
|
column-gap: 24px;
|
|
138
138
|
column-gap: var(--space-xl-a39hup, 24px);
|
|
139
139
|
display: grid;
|
|
@@ -142,23 +142,23 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
142
142
|
row-gap: 24px;
|
|
143
143
|
row-gap: var(--space-scaled-xl-w2t504, 24px);
|
|
144
144
|
}
|
|
145
|
-
.
|
|
145
|
+
.awsui_wizard_1xupv_ly7ly_105.awsui_refresh_1xupv_ly7ly_105.awsui_small-container_1xupv_ly7ly_112:not(#\9) {
|
|
146
146
|
row-gap: 20px;
|
|
147
147
|
row-gap: var(--space-scaled-l-t03y3z, 20px);
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
.
|
|
150
|
+
.awsui_wizard_1xupv_ly7ly_105:not(#\9):not(.awsui_refresh_1xupv_ly7ly_105) {
|
|
151
151
|
display: flex;
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
.
|
|
154
|
+
.awsui_navigation_1xupv_ly7ly_120.awsui_refresh_1xupv_ly7ly_105:not(#\9) {
|
|
155
155
|
grid-column: 1;
|
|
156
156
|
grid-row: 1/span 2;
|
|
157
157
|
padding-top: 4px;
|
|
158
158
|
padding-top: var(--space-scaled-xxs-95dhkm, 4px);
|
|
159
159
|
z-index: 1;
|
|
160
160
|
}
|
|
161
|
-
.
|
|
161
|
+
.awsui_navigation_1xupv_ly7ly_120.awsui_refresh_1xupv_ly7ly_105 > ul:not(#\9) {
|
|
162
162
|
background: #ffffff;
|
|
163
163
|
background: var(--color-background-container-content-o88wxm, #ffffff);
|
|
164
164
|
border-radius: 0px;
|
|
@@ -171,7 +171,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
171
171
|
width: 280px;
|
|
172
172
|
box-sizing: border-box;
|
|
173
173
|
}
|
|
174
|
-
.
|
|
174
|
+
.awsui_navigation_1xupv_ly7ly_120.awsui_refresh_1xupv_ly7ly_105 > ul > li:not(#\9) {
|
|
175
175
|
display: grid;
|
|
176
176
|
column-gap: 12px;
|
|
177
177
|
column-gap: var(--space-s-hv8c1d, 12px);
|
|
@@ -179,7 +179,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
179
179
|
grid-template-columns: var(--space-l-4vl6xu, 20px) 1fr;
|
|
180
180
|
grid-template-rows: repeat(2, auto);
|
|
181
181
|
}
|
|
182
|
-
.
|
|
182
|
+
.awsui_navigation_1xupv_ly7ly_120.awsui_refresh_1xupv_ly7ly_105 > ul > li > hr:not(#\9) {
|
|
183
183
|
background-color: #eaeded;
|
|
184
184
|
background-color: var(--color-border-divider-default-k96bks, #eaeded);
|
|
185
185
|
border: 0;
|
|
@@ -188,7 +188,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
188
188
|
width: 2px;
|
|
189
189
|
width: var(--space-xxxs-k2w98v, 2px);
|
|
190
190
|
}
|
|
191
|
-
.
|
|
191
|
+
.awsui_navigation_1xupv_ly7ly_120.awsui_refresh_1xupv_ly7ly_105 > ul > li > .awsui_number_1xupv_ly7ly_148:not(#\9) {
|
|
192
192
|
color: #687078;
|
|
193
193
|
color: var(--color-text-small-5a9rs1, #687078);
|
|
194
194
|
font-size: 12px;
|
|
@@ -196,7 +196,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
196
196
|
grid-column: 2;
|
|
197
197
|
grid-row: 1;
|
|
198
198
|
}
|
|
199
|
-
.
|
|
199
|
+
.awsui_navigation_1xupv_ly7ly_120.awsui_refresh_1xupv_ly7ly_105 > ul > li > a:not(#\9) {
|
|
200
200
|
align-items: start;
|
|
201
201
|
column-gap: 12px;
|
|
202
202
|
column-gap: var(--space-s-hv8c1d, 12px);
|
|
@@ -209,7 +209,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
209
209
|
grid-template-columns: 20px 1fr;
|
|
210
210
|
grid-template-columns: var(--space-l-4vl6xu, 20px) 1fr;
|
|
211
211
|
}
|
|
212
|
-
.
|
|
212
|
+
.awsui_navigation_1xupv_ly7ly_120.awsui_refresh_1xupv_ly7ly_105 > ul > li > a > .awsui_circle_1xupv_ly7ly_164:not(#\9) {
|
|
213
213
|
border-radius: 100%;
|
|
214
214
|
grid-column: 1;
|
|
215
215
|
height: 10px;
|
|
@@ -217,89 +217,89 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
217
217
|
margin-top: 6px;
|
|
218
218
|
width: 10px;
|
|
219
219
|
}
|
|
220
|
-
.
|
|
220
|
+
.awsui_navigation_1xupv_ly7ly_120.awsui_refresh_1xupv_ly7ly_105 > ul > li > a > .awsui_title_1xupv_ly7ly_172:not(#\9) {
|
|
221
221
|
min-width: 0;
|
|
222
222
|
-ms-word-break: break-all;
|
|
223
223
|
word-break: break-word;
|
|
224
224
|
grid-column: 2;
|
|
225
225
|
}
|
|
226
|
-
.
|
|
226
|
+
.awsui_navigation_1xupv_ly7ly_120.awsui_refresh_1xupv_ly7ly_105 > ul > li > a[data-awsui-focus-visible=true]:not(#\9):focus {
|
|
227
227
|
outline: thin dotted;
|
|
228
228
|
outline: 5px auto Highlight;
|
|
229
229
|
outline: var(--border-link-focus-ring-outline-67z0xv, 5px auto Highlight);
|
|
230
230
|
outline-offset: 2px;
|
|
231
|
-
outline-color: #
|
|
232
|
-
outline-color: var(--color-border-item-focused-
|
|
231
|
+
outline-color: #0073bb;
|
|
232
|
+
outline-color: var(--color-border-item-focused-n5kd8g, #0073bb);
|
|
233
233
|
border-radius: 2px;
|
|
234
234
|
border-radius: var(--border-control-focus-ring-radius-default-9royjh, 2px);
|
|
235
|
-
box-shadow: 0 0 0 0px #
|
|
236
|
-
box-shadow: 0 0 0 var(--border-link-focus-ring-shadow-spread-e3dct9, 0px) var(--color-border-item-focused-
|
|
235
|
+
box-shadow: 0 0 0 0px #0073bb;
|
|
236
|
+
box-shadow: 0 0 0 var(--border-link-focus-ring-shadow-spread-e3dct9, 0px) var(--color-border-item-focused-n5kd8g, #0073bb);
|
|
237
237
|
}
|
|
238
|
-
.
|
|
238
|
+
.awsui_navigation_1xupv_ly7ly_120.awsui_refresh_1xupv_ly7ly_105 > ul > li:not(#\9):first-child > hr {
|
|
239
239
|
grid-row: 2/span 2;
|
|
240
240
|
}
|
|
241
|
-
.
|
|
241
|
+
.awsui_navigation_1xupv_ly7ly_120.awsui_refresh_1xupv_ly7ly_105 > ul > li:not(#\9):not(:first-child) > .awsui_number_1xupv_ly7ly_148 {
|
|
242
242
|
margin-top: 24px;
|
|
243
243
|
margin-top: var(--space-scaled-xl-w2t504, 24px);
|
|
244
244
|
}
|
|
245
|
-
.
|
|
245
|
+
.awsui_navigation_1xupv_ly7ly_120.awsui_refresh_1xupv_ly7ly_105 > ul > li:not(#\9):last-child > hr {
|
|
246
246
|
grid-row: 1;
|
|
247
247
|
}
|
|
248
|
-
.
|
|
248
|
+
.awsui_navigation_1xupv_ly7ly_120.awsui_refresh_1xupv_ly7ly_105 > ul > li:not(#\9):only-of-type > hr {
|
|
249
249
|
display: none;
|
|
250
250
|
}
|
|
251
|
-
.
|
|
251
|
+
.awsui_navigation_1xupv_ly7ly_120.awsui_refresh_1xupv_ly7ly_105 > ul > li:not(#\9):not(:first-child):not(:last-child) > hr {
|
|
252
252
|
grid-row: 1/span 3;
|
|
253
253
|
}
|
|
254
|
-
.
|
|
254
|
+
.awsui_navigation_1xupv_ly7ly_120.awsui_refresh_1xupv_ly7ly_105 > ul > li.awsui_active_1xupv_ly7ly_201 > a:not(#\9) {
|
|
255
255
|
cursor: text;
|
|
256
256
|
}
|
|
257
|
-
.
|
|
257
|
+
.awsui_navigation_1xupv_ly7ly_120.awsui_refresh_1xupv_ly7ly_105 > ul > li.awsui_active_1xupv_ly7ly_201 > a > .awsui_circle_1xupv_ly7ly_164:not(#\9) {
|
|
258
258
|
background-color: #0073bb;
|
|
259
259
|
background-color: var(--color-background-control-checked-dyuc53, #0073bb);
|
|
260
260
|
box-shadow: 0 0 0 3px #ffffff, 0 0 0 5px #0073bb, 0 0 0 7px #ffffff;
|
|
261
261
|
box-shadow: 0 0 0 3px var(--color-background-container-content-o88wxm, #ffffff), 0 0 0 5px var(--color-background-control-checked-dyuc53, #0073bb), 0 0 0 7px var(--color-background-container-content-o88wxm, #ffffff);
|
|
262
262
|
}
|
|
263
|
-
.
|
|
263
|
+
.awsui_navigation_1xupv_ly7ly_120.awsui_refresh_1xupv_ly7ly_105 > ul > li.awsui_active_1xupv_ly7ly_201 > a > .awsui_title_1xupv_ly7ly_172:not(#\9) {
|
|
264
264
|
color: #0073bb;
|
|
265
265
|
color: var(--color-background-control-checked-dyuc53, #0073bb);
|
|
266
266
|
font-weight: 700;
|
|
267
267
|
}
|
|
268
|
-
.
|
|
268
|
+
.awsui_navigation_1xupv_ly7ly_120.awsui_refresh_1xupv_ly7ly_105 > ul > li.awsui_disabled_1xupv_ly7ly_212 > a:not(#\9) {
|
|
269
269
|
cursor: text;
|
|
270
270
|
}
|
|
271
|
-
.
|
|
271
|
+
.awsui_navigation_1xupv_ly7ly_120.awsui_refresh_1xupv_ly7ly_105 > ul > li.awsui_disabled_1xupv_ly7ly_212 > a > .awsui_circle_1xupv_ly7ly_164:not(#\9) {
|
|
272
272
|
background-color: #ffffff;
|
|
273
273
|
background-color: var(--color-background-container-content-o88wxm, #ffffff);
|
|
274
274
|
box-shadow: 0 0 0 2px #aab7b8, 0 0 0 4px #ffffff;
|
|
275
275
|
box-shadow: 0 0 0 2px var(--color-text-interactive-disabled-jcikk2, #aab7b8), 0 0 0 4px var(--color-background-container-content-o88wxm, #ffffff);
|
|
276
276
|
}
|
|
277
|
-
.
|
|
277
|
+
.awsui_navigation_1xupv_ly7ly_120.awsui_refresh_1xupv_ly7ly_105 > ul > li.awsui_disabled_1xupv_ly7ly_212 > a > .awsui_title_1xupv_ly7ly_172:not(#\9) {
|
|
278
278
|
color: #aab7b8;
|
|
279
279
|
color: var(--color-text-interactive-disabled-jcikk2, #aab7b8);
|
|
280
280
|
}
|
|
281
|
-
.
|
|
281
|
+
.awsui_navigation_1xupv_ly7ly_120.awsui_refresh_1xupv_ly7ly_105 > ul > li.awsui_enabled_1xupv_ly7ly_222 > a > .awsui_circle_1xupv_ly7ly_164:not(#\9) {
|
|
282
282
|
background-color: #545b64;
|
|
283
283
|
background-color: var(--color-text-interactive-default-9me1cm, #545b64);
|
|
284
284
|
box-shadow: 0 0 0 2px #545b64, 0 0 0 4px #ffffff;
|
|
285
285
|
box-shadow: 0 0 0 2px var(--color-text-interactive-default-9me1cm, #545b64), 0 0 0 4px var(--color-background-container-content-o88wxm, #ffffff);
|
|
286
286
|
}
|
|
287
|
-
.
|
|
287
|
+
.awsui_navigation_1xupv_ly7ly_120.awsui_refresh_1xupv_ly7ly_105 > ul > li.awsui_enabled_1xupv_ly7ly_222 > a > .awsui_title_1xupv_ly7ly_172:not(#\9) {
|
|
288
288
|
color: #545b64;
|
|
289
289
|
color: var(--color-text-interactive-default-9me1cm, #545b64);
|
|
290
290
|
}
|
|
291
|
-
.
|
|
291
|
+
.awsui_navigation_1xupv_ly7ly_120.awsui_refresh_1xupv_ly7ly_105 > ul > li.awsui_enabled_1xupv_ly7ly_222 > a:not(#\9):hover > .awsui_circle_1xupv_ly7ly_164 {
|
|
292
292
|
background-color: #0073bb;
|
|
293
293
|
background-color: var(--color-background-control-checked-dyuc53, #0073bb);
|
|
294
294
|
box-shadow: 0 0 0 2px #0073bb, 0 0 0 4px #ffffff;
|
|
295
295
|
box-shadow: 0 0 0 2px var(--color-background-control-checked-dyuc53, #0073bb), 0 0 0 4px var(--color-background-container-content-o88wxm, #ffffff);
|
|
296
296
|
}
|
|
297
|
-
.
|
|
297
|
+
.awsui_navigation_1xupv_ly7ly_120.awsui_refresh_1xupv_ly7ly_105 > ul > li.awsui_enabled_1xupv_ly7ly_222 > a:not(#\9):hover > .awsui_title_1xupv_ly7ly_172 {
|
|
298
298
|
color: #0073bb;
|
|
299
299
|
color: var(--color-background-control-checked-dyuc53, #0073bb);
|
|
300
300
|
}
|
|
301
301
|
|
|
302
|
-
.
|
|
302
|
+
.awsui_navigation_1xupv_ly7ly_120:not(#\9):not(.awsui_refresh_1xupv_ly7ly_105) {
|
|
303
303
|
color: #aab7b8;
|
|
304
304
|
color: var(--color-text-disabled-pjiy51, #aab7b8);
|
|
305
305
|
display: inline-block;
|
|
@@ -310,120 +310,120 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
310
310
|
padding-top: var(--space-xxs-ynfts5, 4px);
|
|
311
311
|
width: 200px;
|
|
312
312
|
}
|
|
313
|
-
.
|
|
313
|
+
.awsui_navigation_1xupv_ly7ly_120:not(#\9):not(.awsui_refresh_1xupv_ly7ly_105) > ul {
|
|
314
314
|
list-style: none;
|
|
315
315
|
padding: 0;
|
|
316
316
|
margin: 0;
|
|
317
317
|
}
|
|
318
|
-
.
|
|
318
|
+
.awsui_navigation_1xupv_ly7ly_120:not(#\9):not(.awsui_refresh_1xupv_ly7ly_105) > ul > li {
|
|
319
319
|
padding-bottom: 16px;
|
|
320
320
|
padding-bottom: var(--space-scaled-m-pv0fmt, 16px);
|
|
321
321
|
padding-top: 0;
|
|
322
322
|
}
|
|
323
|
-
.
|
|
323
|
+
.awsui_navigation_1xupv_ly7ly_120:not(#\9):not(.awsui_refresh_1xupv_ly7ly_105) > ul > li:not(:first-child) {
|
|
324
324
|
margin-top: 16px;
|
|
325
325
|
margin-top: var(--space-scaled-m-pv0fmt, 16px);
|
|
326
326
|
}
|
|
327
|
-
.
|
|
327
|
+
.awsui_navigation_1xupv_ly7ly_120:not(#\9):not(.awsui_refresh_1xupv_ly7ly_105) > ul > li:not(:last-child) {
|
|
328
328
|
border-bottom: 1px solid #d5dbdb;
|
|
329
329
|
border-bottom: var(--border-divider-list-width-hacikr, 1px) solid var(--color-border-layout-ifju5o, #d5dbdb);
|
|
330
330
|
}
|
|
331
331
|
|
|
332
|
-
.
|
|
332
|
+
.awsui_form_1xupv_ly7ly_261:not(#\9):not(.awsui_refresh_1xupv_ly7ly_105) {
|
|
333
333
|
min-width: 0;
|
|
334
334
|
-ms-word-break: break-all;
|
|
335
335
|
word-break: break-word;
|
|
336
336
|
width: 100%;
|
|
337
337
|
}
|
|
338
|
-
.
|
|
338
|
+
.awsui_form_1xupv_ly7ly_261:not(#\9):not(.awsui_refresh_1xupv_ly7ly_105) > .awsui_form-header_1xupv_ly7ly_267 {
|
|
339
339
|
position: relative;
|
|
340
340
|
margin-bottom: 16px;
|
|
341
341
|
margin-bottom: var(--space-scaled-m-pv0fmt, 16px);
|
|
342
342
|
}
|
|
343
343
|
|
|
344
|
-
.
|
|
344
|
+
.awsui_form_1xupv_ly7ly_261.awsui_refresh_1xupv_ly7ly_105:not(#\9) {
|
|
345
345
|
min-width: 0;
|
|
346
346
|
-ms-word-break: break-all;
|
|
347
347
|
word-break: break-word;
|
|
348
348
|
display: contents;
|
|
349
349
|
}
|
|
350
|
-
.
|
|
350
|
+
.awsui_form_1xupv_ly7ly_261.awsui_refresh_1xupv_ly7ly_105 > .awsui_background_1xupv_ly7ly_278:not(#\9) {
|
|
351
351
|
background-color: #f2f3f3;
|
|
352
352
|
background-color: var(--color-background-layout-main-q0tbxx, #f2f3f3);
|
|
353
353
|
grid-column: 1/span 2;
|
|
354
354
|
grid-row: 1;
|
|
355
355
|
}
|
|
356
|
-
.
|
|
356
|
+
.awsui_form_1xupv_ly7ly_261.awsui_refresh_1xupv_ly7ly_105 > .awsui_form-header_1xupv_ly7ly_267:not(#\9) {
|
|
357
357
|
background-color: #f2f3f3;
|
|
358
358
|
background-color: var(--color-background-layout-main-q0tbxx, #f2f3f3);
|
|
359
359
|
grid-column: 2;
|
|
360
360
|
grid-row: 1;
|
|
361
361
|
}
|
|
362
|
-
.
|
|
362
|
+
.awsui_form_1xupv_ly7ly_261.awsui_refresh_1xupv_ly7ly_105 > .awsui_form-header_1xupv_ly7ly_267 > .awsui_form-header-content_1xupv_ly7ly_288:not(#\9) {
|
|
363
363
|
padding-top: 24px;
|
|
364
364
|
padding-top: var(--space-scaled-xl-w2t504, 24px);
|
|
365
365
|
padding-bottom: 24px;
|
|
366
366
|
padding-bottom: var(--space-scaled-xl-w2t504, 24px);
|
|
367
367
|
}
|
|
368
|
-
.
|
|
368
|
+
.awsui_form_1xupv_ly7ly_261.awsui_refresh_1xupv_ly7ly_105 > .awsui_form-component_1xupv_ly7ly_292:not(#\9) {
|
|
369
369
|
grid-column: 2;
|
|
370
370
|
grid-row: 2;
|
|
371
371
|
}
|
|
372
|
-
.
|
|
372
|
+
.awsui_form_1xupv_ly7ly_261.awsui_refresh_1xupv_ly7ly_105.awsui_small-container_1xupv_ly7ly_112 > .awsui_form-header_1xupv_ly7ly_267:not(#\9) {
|
|
373
373
|
grid-column: 1/span 2;
|
|
374
374
|
}
|
|
375
|
-
.
|
|
375
|
+
.awsui_form_1xupv_ly7ly_261.awsui_refresh_1xupv_ly7ly_105.awsui_small-container_1xupv_ly7ly_112 > .awsui_form-header_1xupv_ly7ly_267 > .awsui_form-header-content_1xupv_ly7ly_288:not(#\9) {
|
|
376
376
|
padding-top: 0;
|
|
377
377
|
}
|
|
378
|
-
.
|
|
378
|
+
.awsui_form_1xupv_ly7ly_261.awsui_refresh_1xupv_ly7ly_105.awsui_small-container_1xupv_ly7ly_112 > .awsui_form-component_1xupv_ly7ly_292:not(#\9) {
|
|
379
379
|
grid-column: 1/span 2;
|
|
380
380
|
}
|
|
381
381
|
|
|
382
|
-
.
|
|
382
|
+
.awsui_navigation_1xupv_ly7ly_120.awsui_hidden_1xupv_ly7ly_306:not(#\9) {
|
|
383
383
|
display: none;
|
|
384
384
|
}
|
|
385
385
|
|
|
386
|
-
.awsui_collapsed-
|
|
386
|
+
.awsui_collapsed-steps_1xupv_ly7ly_310:not(#\9) {
|
|
387
387
|
color: #545b64;
|
|
388
388
|
color: var(--color-text-heading-secondary-mvxtuw, #545b64);
|
|
389
389
|
font-weight: 700;
|
|
390
390
|
padding-top: 4px;
|
|
391
391
|
padding-top: var(--space-scaled-xxs-95dhkm, 4px);
|
|
392
392
|
}
|
|
393
|
-
.awsui_collapsed-steps-extra-
|
|
393
|
+
.awsui_collapsed-steps-extra-padding_1xupv_ly7ly_315:not(#\9) {
|
|
394
394
|
padding-top: 20px;
|
|
395
395
|
padding-top: var(--space-scaled-l-t03y3z, 20px);
|
|
396
396
|
}
|
|
397
|
-
.awsui_collapsed-steps-
|
|
397
|
+
.awsui_collapsed-steps-hidden_1xupv_ly7ly_318:not(#\9) {
|
|
398
398
|
display: none;
|
|
399
399
|
}
|
|
400
400
|
|
|
401
|
-
.awsui_form-header-
|
|
402
|
-
.awsui_navigation-
|
|
403
|
-
.awsui_navigation-link-
|
|
404
|
-
.awsui_navigation-link-
|
|
401
|
+
.awsui_form-header-component_1xupv_ly7ly_322:not(#\9),
|
|
402
|
+
.awsui_navigation-link_1xupv_ly7ly_323:not(#\9),
|
|
403
|
+
.awsui_navigation-link-item_1xupv_ly7ly_324:not(#\9),
|
|
404
|
+
.awsui_navigation-link-label_1xupv_ly7ly_325:not(#\9) {
|
|
405
405
|
/* used in test-utils */
|
|
406
406
|
}
|
|
407
407
|
|
|
408
|
-
.awsui_navigation-link-
|
|
408
|
+
.awsui_navigation-link-active_1xupv_ly7ly_329:not(#\9) {
|
|
409
409
|
font-weight: 700;
|
|
410
410
|
color: #16191f;
|
|
411
411
|
color: var(--color-text-body-default-7m2b3r, #16191f);
|
|
412
412
|
}
|
|
413
413
|
|
|
414
|
-
.awsui_navigation-link-
|
|
414
|
+
.awsui_navigation-link-disabled_1xupv_ly7ly_334:not(#\9) {
|
|
415
415
|
color: #aab7b8;
|
|
416
416
|
color: var(--color-text-control-disabled-l34dfo, #aab7b8);
|
|
417
417
|
}
|
|
418
418
|
|
|
419
|
-
.awsui_cancel-
|
|
420
|
-
.awsui_previous-
|
|
421
|
-
.awsui_primary-
|
|
422
|
-
.awsui_skip-to-
|
|
419
|
+
.awsui_cancel-button_1xupv_ly7ly_338:not(#\9),
|
|
420
|
+
.awsui_previous-button_1xupv_ly7ly_339:not(#\9),
|
|
421
|
+
.awsui_primary-button_1xupv_ly7ly_340:not(#\9),
|
|
422
|
+
.awsui_skip-to-button_1xupv_ly7ly_341:not(#\9) {
|
|
423
423
|
/* used in test-utils */
|
|
424
424
|
}
|
|
425
425
|
|
|
426
|
-
.awsui_action-
|
|
426
|
+
.awsui_action-buttons_1xupv_ly7ly_345:not(#\9) {
|
|
427
427
|
display: flex;
|
|
428
428
|
justify-content: flex-end;
|
|
429
429
|
}
|
|
@@ -2,36 +2,36 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"root": "
|
|
6
|
-
"wizard": "
|
|
7
|
-
"refresh": "
|
|
8
|
-
"small-container": "awsui_small-
|
|
9
|
-
"navigation": "
|
|
10
|
-
"number": "
|
|
11
|
-
"circle": "
|
|
12
|
-
"title": "
|
|
13
|
-
"active": "
|
|
14
|
-
"disabled": "
|
|
15
|
-
"enabled": "
|
|
16
|
-
"form": "
|
|
17
|
-
"form-header": "awsui_form-
|
|
18
|
-
"background": "
|
|
19
|
-
"form-header-content": "awsui_form-header-
|
|
20
|
-
"form-component": "awsui_form-
|
|
21
|
-
"hidden": "
|
|
22
|
-
"collapsed-steps": "awsui_collapsed-
|
|
23
|
-
"collapsed-steps-extra-padding": "awsui_collapsed-steps-extra-
|
|
24
|
-
"collapsed-steps-hidden": "awsui_collapsed-steps-
|
|
25
|
-
"form-header-component": "awsui_form-header-
|
|
26
|
-
"navigation-link": "awsui_navigation-
|
|
27
|
-
"navigation-link-item": "awsui_navigation-link-
|
|
28
|
-
"navigation-link-label": "awsui_navigation-link-
|
|
29
|
-
"navigation-link-active": "awsui_navigation-link-
|
|
30
|
-
"navigation-link-disabled": "awsui_navigation-link-
|
|
31
|
-
"cancel-button": "awsui_cancel-
|
|
32
|
-
"previous-button": "awsui_previous-
|
|
33
|
-
"primary-button": "awsui_primary-
|
|
34
|
-
"skip-to-button": "awsui_skip-to-
|
|
35
|
-
"action-buttons": "awsui_action-
|
|
5
|
+
"root": "awsui_root_1xupv_ly7ly_94",
|
|
6
|
+
"wizard": "awsui_wizard_1xupv_ly7ly_105",
|
|
7
|
+
"refresh": "awsui_refresh_1xupv_ly7ly_105",
|
|
8
|
+
"small-container": "awsui_small-container_1xupv_ly7ly_112",
|
|
9
|
+
"navigation": "awsui_navigation_1xupv_ly7ly_120",
|
|
10
|
+
"number": "awsui_number_1xupv_ly7ly_148",
|
|
11
|
+
"circle": "awsui_circle_1xupv_ly7ly_164",
|
|
12
|
+
"title": "awsui_title_1xupv_ly7ly_172",
|
|
13
|
+
"active": "awsui_active_1xupv_ly7ly_201",
|
|
14
|
+
"disabled": "awsui_disabled_1xupv_ly7ly_212",
|
|
15
|
+
"enabled": "awsui_enabled_1xupv_ly7ly_222",
|
|
16
|
+
"form": "awsui_form_1xupv_ly7ly_261",
|
|
17
|
+
"form-header": "awsui_form-header_1xupv_ly7ly_267",
|
|
18
|
+
"background": "awsui_background_1xupv_ly7ly_278",
|
|
19
|
+
"form-header-content": "awsui_form-header-content_1xupv_ly7ly_288",
|
|
20
|
+
"form-component": "awsui_form-component_1xupv_ly7ly_292",
|
|
21
|
+
"hidden": "awsui_hidden_1xupv_ly7ly_306",
|
|
22
|
+
"collapsed-steps": "awsui_collapsed-steps_1xupv_ly7ly_310",
|
|
23
|
+
"collapsed-steps-extra-padding": "awsui_collapsed-steps-extra-padding_1xupv_ly7ly_315",
|
|
24
|
+
"collapsed-steps-hidden": "awsui_collapsed-steps-hidden_1xupv_ly7ly_318",
|
|
25
|
+
"form-header-component": "awsui_form-header-component_1xupv_ly7ly_322",
|
|
26
|
+
"navigation-link": "awsui_navigation-link_1xupv_ly7ly_323",
|
|
27
|
+
"navigation-link-item": "awsui_navigation-link-item_1xupv_ly7ly_324",
|
|
28
|
+
"navigation-link-label": "awsui_navigation-link-label_1xupv_ly7ly_325",
|
|
29
|
+
"navigation-link-active": "awsui_navigation-link-active_1xupv_ly7ly_329",
|
|
30
|
+
"navigation-link-disabled": "awsui_navigation-link-disabled_1xupv_ly7ly_334",
|
|
31
|
+
"cancel-button": "awsui_cancel-button_1xupv_ly7ly_338",
|
|
32
|
+
"previous-button": "awsui_previous-button_1xupv_ly7ly_339",
|
|
33
|
+
"primary-button": "awsui_primary-button_1xupv_ly7ly_340",
|
|
34
|
+
"skip-to-button": "awsui_skip-to-button_1xupv_ly7ly_341",
|
|
35
|
+
"action-buttons": "awsui_action-buttons_1xupv_ly7ly_345"
|
|
36
36
|
};
|
|
37
37
|
|
package/package.json
CHANGED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React, { ProviderProps } from 'react';
|
|
2
|
-
export interface RootProviderProps<T> extends React.HTMLAttributes<HTMLDivElement>, ProviderProps<T> {
|
|
3
|
-
}
|
|
4
|
-
export interface IntermediateProviderProps {
|
|
5
|
-
parentElement: HTMLElement;
|
|
6
|
-
children?: React.ReactNode;
|
|
7
|
-
}
|
|
8
|
-
export interface DomContextDeclaration<T> {
|
|
9
|
-
context: React.Context<T>;
|
|
10
|
-
RootProvider: React.FC<RootProviderProps<T>>;
|
|
11
|
-
IntermediateProvider: React.FC<IntermediateProviderProps>;
|
|
12
|
-
}
|
|
13
|
-
export declare function createDomContext<T>(name: string, defaultValue: T): DomContextDeclaration<T>;
|
|
14
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/hooks/dom-context/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAiB,aAAa,EAAqC,MAAM,OAAO,CAAC;AAwB/F,MAAM,WAAW,iBAAiB,CAAC,CAAC,CAAE,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC;CAAG;AAEvG,MAAM,WAAW,yBAAyB;IACxC,aAAa,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,MAAM,WAAW,qBAAqB,CAAC,CAAC;IACtC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC1B,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7C,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CAAC,CAAC;CAC3D;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAiD3F"}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { __assign, __rest } from "tslib";
|
|
2
|
-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
import React, { createContext, useLayoutEffect, useRef, useState } from 'react';
|
|
5
|
-
function getContextFromElement(element, contextKey) {
|
|
6
|
-
return element[contextKey];
|
|
7
|
-
}
|
|
8
|
-
function setContextToElement(element, contextKey, contextValue) {
|
|
9
|
-
element[contextKey] = contextValue;
|
|
10
|
-
var event = document.createEvent('CustomEvent');
|
|
11
|
-
event.initCustomEvent(contextKey, false, false, null);
|
|
12
|
-
element.dispatchEvent(event);
|
|
13
|
-
}
|
|
14
|
-
function findupContext(contextKey, element) {
|
|
15
|
-
var currentElement = element;
|
|
16
|
-
while (currentElement) {
|
|
17
|
-
if (getContextFromElement(currentElement, contextKey) !== undefined) {
|
|
18
|
-
return currentElement;
|
|
19
|
-
}
|
|
20
|
-
currentElement = currentElement.parentElement;
|
|
21
|
-
}
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
export function createDomContext(name, defaultValue) {
|
|
25
|
-
var context = createContext(defaultValue);
|
|
26
|
-
var contextKey = "__awsui_context_".concat(name);
|
|
27
|
-
var ReactProvider = context.Provider;
|
|
28
|
-
function RootProvider(_a) {
|
|
29
|
-
var value = _a.value, rest = __rest(_a, ["value"]);
|
|
30
|
-
var ref = useRef(null);
|
|
31
|
-
useLayoutEffect(function () {
|
|
32
|
-
if (ref.current) {
|
|
33
|
-
setContextToElement(ref.current, contextKey, value);
|
|
34
|
-
}
|
|
35
|
-
}, [value]);
|
|
36
|
-
return (React.createElement(ReactProvider, { value: value },
|
|
37
|
-
React.createElement("div", __assign({ ref: ref }, rest))));
|
|
38
|
-
}
|
|
39
|
-
function IntermediateProvider(_a) {
|
|
40
|
-
var children = _a.children, parentElement = _a.parentElement;
|
|
41
|
-
var _b = useState(undefined), discoveredValue = _b[0], setDiscoveredValue = _b[1];
|
|
42
|
-
useLayoutEffect(function () {
|
|
43
|
-
var providerElement = findupContext(contextKey, parentElement);
|
|
44
|
-
if (!providerElement) {
|
|
45
|
-
setDiscoveredValue(null);
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
setDiscoveredValue(getContextFromElement(providerElement, contextKey));
|
|
49
|
-
var changeListener_1 = function () {
|
|
50
|
-
var newValue = getContextFromElement(providerElement, contextKey);
|
|
51
|
-
setDiscoveredValue(newValue);
|
|
52
|
-
};
|
|
53
|
-
providerElement.addEventListener(contextKey, changeListener_1);
|
|
54
|
-
return function () { return providerElement.removeEventListener(contextKey, changeListener_1); };
|
|
55
|
-
}
|
|
56
|
-
}, [parentElement]);
|
|
57
|
-
// it is undefined at the first render
|
|
58
|
-
if (discoveredValue === undefined) {
|
|
59
|
-
return null;
|
|
60
|
-
}
|
|
61
|
-
// we looked for context value but found nothing, continue rendering children
|
|
62
|
-
if (discoveredValue === null) {
|
|
63
|
-
return React.createElement(React.Fragment, null, children);
|
|
64
|
-
}
|
|
65
|
-
// there is a context value, wrap into provider
|
|
66
|
-
return React.createElement(ReactProvider, { value: discoveredValue }, children);
|
|
67
|
-
}
|
|
68
|
-
return { context: context, RootProvider: RootProvider, IntermediateProvider: IntermediateProvider };
|
|
69
|
-
}
|
|
70
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/hooks/dom-context/index.tsx"],"names":[],"mappings":"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","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { createContext, ProviderProps, useLayoutEffect, useRef, useState } from 'react';\n\nfunction getContextFromElement(element: HTMLElement, contextKey: string) {\n return (element as any)[contextKey];\n}\n\nfunction setContextToElement(element: HTMLElement, contextKey: string, contextValue: any) {\n (element as any)[contextKey] = contextValue;\n const event = document.createEvent('CustomEvent');\n event.initCustomEvent(contextKey, false, false, null);\n element.dispatchEvent(event);\n}\n\nfunction findupContext(contextKey: string, element: HTMLElement) {\n let currentElement: HTMLElement | null = element;\n while (currentElement) {\n if (getContextFromElement(currentElement, contextKey) !== undefined) {\n return currentElement;\n }\n currentElement = currentElement.parentElement;\n }\n return null;\n}\n\nexport interface RootProviderProps<T> extends React.HTMLAttributes<HTMLDivElement>, ProviderProps<T> {}\n\nexport interface IntermediateProviderProps {\n parentElement: HTMLElement;\n children?: React.ReactNode;\n}\n\nexport interface DomContextDeclaration<T> {\n context: React.Context<T>;\n RootProvider: React.FC<RootProviderProps<T>>;\n IntermediateProvider: React.FC<IntermediateProviderProps>;\n}\n\nexport function createDomContext<T>(name: string, defaultValue: T): DomContextDeclaration<T> {\n const context = createContext<T>(defaultValue);\n const contextKey = `__awsui_context_${name}`;\n const ReactProvider = context.Provider;\n\n function RootProvider({ value, ...rest }: RootProviderProps<T>) {\n const ref = useRef<HTMLDivElement>(null);\n\n useLayoutEffect(() => {\n if (ref.current) {\n setContextToElement(ref.current, contextKey, value);\n }\n }, [value]);\n return (\n <ReactProvider value={value}>\n <div ref={ref} {...rest} />\n </ReactProvider>\n );\n }\n\n function IntermediateProvider({ children, parentElement }: IntermediateProviderProps) {\n const [discoveredValue, setDiscoveredValue] = useState<T | null | undefined>(undefined);\n useLayoutEffect(() => {\n const providerElement = findupContext(contextKey, parentElement);\n if (!providerElement) {\n setDiscoveredValue(null);\n } else {\n setDiscoveredValue(getContextFromElement(providerElement, contextKey));\n const changeListener = () => {\n const newValue = getContextFromElement(providerElement, contextKey);\n setDiscoveredValue(newValue);\n };\n providerElement.addEventListener(contextKey, changeListener);\n return () => providerElement.removeEventListener(contextKey, changeListener);\n }\n }, [parentElement]);\n // it is undefined at the first render\n if (discoveredValue === undefined) {\n return null;\n }\n // we looked for context value but found nothing, continue rendering children\n if (discoveredValue === null) {\n return <>{children}</>;\n }\n // there is a context value, wrap into provider\n return <ReactProvider value={discoveredValue}>{children}</ReactProvider>;\n }\n\n return { context, RootProvider, IntermediateProvider };\n}\n"]}
|