@cloudscape-design/components-themeable 3.0.1223 → 3.0.1225
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/internal/generated/custom-css-properties/index.scss +1 -1
- package/lib/internal/scss/internal/styles/typography/mixins.scss +1 -0
- package/lib/internal/scss/prompt-input/styles.scss +1 -0
- package/lib/internal/template/app-layout/interfaces.d.ts +1 -1
- package/lib/internal/template/app-layout/interfaces.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/index.js +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/index.js.map +1 -1
- package/lib/internal/template/box/styles.css.js +192 -192
- package/lib/internal/template/box/styles.scoped.css +239 -237
- package/lib/internal/template/box/styles.selectors.js +192 -192
- package/lib/internal/template/button/internal.js +1 -1
- package/lib/internal/template/button/internal.js.map +1 -1
- package/lib/internal/template/file-input/internal.d.ts.map +1 -1
- package/lib/internal/template/file-input/internal.js +6 -1
- package/lib/internal/template/file-input/internal.js.map +1 -1
- package/lib/internal/template/help-panel/styles.css.js +6 -6
- package/lib/internal/template/help-panel/styles.scoped.css +68 -67
- package/lib/internal/template/help-panel/styles.selectors.js +6 -6
- package/lib/internal/template/internal/base-component/styles.scoped.css +2 -1
- package/lib/internal/template/internal/environment.js +2 -2
- package/lib/internal/template/internal/environment.json +2 -2
- package/lib/internal/template/internal/generated/styles/tokens.d.ts +1 -0
- package/lib/internal/template/internal/generated/styles/tokens.js +1 -0
- package/lib/internal/template/internal/generated/theming/index.cjs +13 -0
- package/lib/internal/template/internal/generated/theming/index.cjs.d.ts +45 -0
- package/lib/internal/template/internal/generated/theming/index.d.ts +45 -0
- package/lib/internal/template/internal/generated/theming/index.js +13 -0
- package/lib/internal/template/link/interfaces.d.ts +6 -6
- package/lib/internal/template/link/interfaces.js.map +1 -1
- package/lib/internal/template/link/styles.css.js +20 -20
- package/lib/internal/template/link/styles.scoped.css +72 -71
- package/lib/internal/template/link/styles.selectors.js +20 -20
- package/lib/internal/template/popover/styles.css.js +57 -57
- package/lib/internal/template/popover/styles.scoped.css +91 -89
- package/lib/internal/template/popover/styles.selectors.js +57 -57
- package/lib/internal/template/prompt-input/styles.css.js +17 -17
- package/lib/internal/template/prompt-input/styles.scoped.css +40 -39
- package/lib/internal/template/prompt-input/styles.selectors.js +17 -17
- package/lib/internal/template/property-filter/controller.d.ts.map +1 -1
- package/lib/internal/template/property-filter/controller.js +2 -2
- package/lib/internal/template/property-filter/controller.js.map +1 -1
- package/lib/internal/template/property-filter/filter-options.js +2 -1
- package/lib/internal/template/property-filter/filter-options.js.map +1 -1
- package/lib/internal/template/property-filter/internal.d.ts.map +1 -1
- package/lib/internal/template/property-filter/internal.js +5 -1
- package/lib/internal/template/property-filter/internal.js.map +1 -1
- package/lib/internal/template/property-filter/token.d.ts.map +1 -1
- package/lib/internal/template/property-filter/token.js +8 -4
- package/lib/internal/template/property-filter/token.js.map +1 -1
- package/lib/internal/template/property-filter/utils.d.ts +3 -1
- package/lib/internal/template/property-filter/utils.d.ts.map +1 -1
- package/lib/internal/template/property-filter/utils.js +14 -2
- package/lib/internal/template/property-filter/utils.js.map +1 -1
- package/lib/internal/template/text-content/styles.css.js +1 -1
- package/lib/internal/template/text-content/styles.scoped.css +61 -60
- package/lib/internal/template/text-content/styles.selectors.js +1 -1
- package/package.json +1 -1
|
@@ -2,197 +2,197 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"box": "
|
|
6
|
-
"p-variant": "awsui_p-
|
|
7
|
-
"color-default": "awsui_color-
|
|
8
|
-
"b-variant": "awsui_b-
|
|
9
|
-
"strong-variant": "awsui_strong-
|
|
10
|
-
"code-variant": "awsui_code-
|
|
11
|
-
"pre-variant": "awsui_pre-
|
|
12
|
-
"samp-variant": "awsui_samp-
|
|
13
|
-
"h1-variant": "awsui_h1-
|
|
14
|
-
"h2-variant": "awsui_h2-
|
|
15
|
-
"h3-variant": "awsui_h3-
|
|
16
|
-
"h4-variant": "awsui_h4-
|
|
17
|
-
"h5-variant": "awsui_h5-
|
|
18
|
-
"small-variant": "awsui_small-
|
|
19
|
-
"a-variant": "awsui_a-
|
|
20
|
-
"font-size-default": "awsui_font-size-
|
|
21
|
-
"font-weight-default": "awsui_font-weight-
|
|
22
|
-
"key-label-variant": "awsui_key-label-
|
|
23
|
-
"gen-ai-label-variant": "awsui_gen-ai-label-
|
|
24
|
-
"value-large-variant": "awsui_value-large-
|
|
25
|
-
"inline-code-variant": "awsui_inline-code-
|
|
26
|
-
"font-weight-heavy": "awsui_font-weight-
|
|
27
|
-
"color-inverted": "awsui_color-
|
|
28
|
-
"color-text-label": "awsui_color-text-
|
|
29
|
-
"color-text-body-secondary": "awsui_color-text-body-
|
|
30
|
-
"color-text-status-error": "awsui_color-text-status-
|
|
31
|
-
"color-text-status-success": "awsui_color-text-status-
|
|
32
|
-
"color-text-status-info": "awsui_color-text-status-
|
|
33
|
-
"color-text-status-inactive": "awsui_color-text-status-
|
|
34
|
-
"color-text-status-warning": "awsui_color-text-status-
|
|
35
|
-
"color-inherit": "awsui_color-
|
|
36
|
-
"font-size-body-s": "awsui_font-size-body-
|
|
37
|
-
"font-size-body-m": "awsui_font-size-body-
|
|
38
|
-
"font-size-heading-xs": "awsui_font-size-heading-
|
|
39
|
-
"font-size-heading-s": "awsui_font-size-heading-
|
|
40
|
-
"font-size-heading-m": "awsui_font-size-heading-
|
|
41
|
-
"font-size-heading-l": "awsui_font-size-heading-
|
|
42
|
-
"font-size-heading-xl": "awsui_font-size-heading-
|
|
43
|
-
"font-size-display-l": "awsui_font-size-display-
|
|
44
|
-
"font-weight-light": "awsui_font-weight-
|
|
45
|
-
"font-weight-normal": "awsui_font-weight-
|
|
46
|
-
"font-weight-bold": "awsui_font-weight-
|
|
47
|
-
"t-left": "awsui_t-
|
|
48
|
-
"t-right": "awsui_t-
|
|
49
|
-
"t-center": "awsui_t-
|
|
50
|
-
"p-n": "awsui_p-
|
|
51
|
-
"p-top-n": "awsui_p-top-
|
|
52
|
-
"p-vertical-n": "awsui_p-vertical-
|
|
53
|
-
"p-right-n": "awsui_p-right-
|
|
54
|
-
"p-horizontal-n": "awsui_p-horizontal-
|
|
55
|
-
"p-bottom-n": "awsui_p-bottom-
|
|
56
|
-
"p-left-n": "awsui_p-left-
|
|
57
|
-
"p-xxxs": "awsui_p-
|
|
58
|
-
"p-top-xxxs": "awsui_p-top-
|
|
59
|
-
"p-vertical-xxxs": "awsui_p-vertical-
|
|
60
|
-
"p-right-xxxs": "awsui_p-right-
|
|
61
|
-
"p-horizontal-xxxs": "awsui_p-horizontal-
|
|
62
|
-
"p-bottom-xxxs": "awsui_p-bottom-
|
|
63
|
-
"p-left-xxxs": "awsui_p-left-
|
|
64
|
-
"p-xxs": "awsui_p-
|
|
65
|
-
"p-top-xxs": "awsui_p-top-
|
|
66
|
-
"p-vertical-xxs": "awsui_p-vertical-
|
|
67
|
-
"p-right-xxs": "awsui_p-right-
|
|
68
|
-
"p-horizontal-xxs": "awsui_p-horizontal-
|
|
69
|
-
"p-bottom-xxs": "awsui_p-bottom-
|
|
70
|
-
"p-left-xxs": "awsui_p-left-
|
|
71
|
-
"p-xs": "awsui_p-
|
|
72
|
-
"p-top-xs": "awsui_p-top-
|
|
73
|
-
"p-vertical-xs": "awsui_p-vertical-
|
|
74
|
-
"p-right-xs": "awsui_p-right-
|
|
75
|
-
"p-horizontal-xs": "awsui_p-horizontal-
|
|
76
|
-
"p-bottom-xs": "awsui_p-bottom-
|
|
77
|
-
"p-left-xs": "awsui_p-left-
|
|
78
|
-
"p-s": "awsui_p-
|
|
79
|
-
"p-top-s": "awsui_p-top-
|
|
80
|
-
"p-vertical-s": "awsui_p-vertical-
|
|
81
|
-
"p-right-s": "awsui_p-right-
|
|
82
|
-
"p-horizontal-s": "awsui_p-horizontal-
|
|
83
|
-
"p-bottom-s": "awsui_p-bottom-
|
|
84
|
-
"p-left-s": "awsui_p-left-
|
|
85
|
-
"p-m": "awsui_p-
|
|
86
|
-
"p-top-m": "awsui_p-top-
|
|
87
|
-
"p-vertical-m": "awsui_p-vertical-
|
|
88
|
-
"p-right-m": "awsui_p-right-
|
|
89
|
-
"p-horizontal-m": "awsui_p-horizontal-
|
|
90
|
-
"p-bottom-m": "awsui_p-bottom-
|
|
91
|
-
"p-left-m": "awsui_p-left-
|
|
92
|
-
"p-l": "awsui_p-
|
|
93
|
-
"p-top-l": "awsui_p-top-
|
|
94
|
-
"p-vertical-l": "awsui_p-vertical-
|
|
95
|
-
"p-right-l": "awsui_p-right-
|
|
96
|
-
"p-horizontal-l": "awsui_p-horizontal-
|
|
97
|
-
"p-bottom-l": "awsui_p-bottom-
|
|
98
|
-
"p-left-l": "awsui_p-left-
|
|
99
|
-
"p-xl": "awsui_p-
|
|
100
|
-
"p-top-xl": "awsui_p-top-
|
|
101
|
-
"p-vertical-xl": "awsui_p-vertical-
|
|
102
|
-
"p-right-xl": "awsui_p-right-
|
|
103
|
-
"p-horizontal-xl": "awsui_p-horizontal-
|
|
104
|
-
"p-bottom-xl": "awsui_p-bottom-
|
|
105
|
-
"p-left-xl": "awsui_p-left-
|
|
106
|
-
"p-xxl": "awsui_p-
|
|
107
|
-
"p-top-xxl": "awsui_p-top-
|
|
108
|
-
"p-vertical-xxl": "awsui_p-vertical-
|
|
109
|
-
"p-right-xxl": "awsui_p-right-
|
|
110
|
-
"p-horizontal-xxl": "awsui_p-horizontal-
|
|
111
|
-
"p-bottom-xxl": "awsui_p-bottom-
|
|
112
|
-
"p-left-xxl": "awsui_p-left-
|
|
113
|
-
"p-xxxl": "awsui_p-
|
|
114
|
-
"p-top-xxxl": "awsui_p-top-
|
|
115
|
-
"p-vertical-xxxl": "awsui_p-vertical-
|
|
116
|
-
"p-right-xxxl": "awsui_p-right-
|
|
117
|
-
"p-horizontal-xxxl": "awsui_p-horizontal-
|
|
118
|
-
"p-bottom-xxxl": "awsui_p-bottom-
|
|
119
|
-
"p-left-xxxl": "awsui_p-left-
|
|
120
|
-
"m-n": "awsui_m-
|
|
121
|
-
"m-top-n": "awsui_m-top-
|
|
122
|
-
"m-vertical-n": "awsui_m-vertical-
|
|
123
|
-
"m-right-n": "awsui_m-right-
|
|
124
|
-
"m-horizontal-n": "awsui_m-horizontal-
|
|
125
|
-
"m-bottom-n": "awsui_m-bottom-
|
|
126
|
-
"m-left-n": "awsui_m-left-
|
|
127
|
-
"m-xxxs": "awsui_m-
|
|
128
|
-
"m-top-xxxs": "awsui_m-top-
|
|
129
|
-
"m-vertical-xxxs": "awsui_m-vertical-
|
|
130
|
-
"m-right-xxxs": "awsui_m-right-
|
|
131
|
-
"m-horizontal-xxxs": "awsui_m-horizontal-
|
|
132
|
-
"m-bottom-xxxs": "awsui_m-bottom-
|
|
133
|
-
"m-left-xxxs": "awsui_m-left-
|
|
134
|
-
"m-xxs": "awsui_m-
|
|
135
|
-
"m-top-xxs": "awsui_m-top-
|
|
136
|
-
"m-vertical-xxs": "awsui_m-vertical-
|
|
137
|
-
"m-right-xxs": "awsui_m-right-
|
|
138
|
-
"m-horizontal-xxs": "awsui_m-horizontal-
|
|
139
|
-
"m-bottom-xxs": "awsui_m-bottom-
|
|
140
|
-
"m-left-xxs": "awsui_m-left-
|
|
141
|
-
"m-xs": "awsui_m-
|
|
142
|
-
"m-top-xs": "awsui_m-top-
|
|
143
|
-
"m-vertical-xs": "awsui_m-vertical-
|
|
144
|
-
"m-right-xs": "awsui_m-right-
|
|
145
|
-
"m-horizontal-xs": "awsui_m-horizontal-
|
|
146
|
-
"m-bottom-xs": "awsui_m-bottom-
|
|
147
|
-
"m-left-xs": "awsui_m-left-
|
|
148
|
-
"m-s": "awsui_m-
|
|
149
|
-
"m-top-s": "awsui_m-top-
|
|
150
|
-
"m-vertical-s": "awsui_m-vertical-
|
|
151
|
-
"m-right-s": "awsui_m-right-
|
|
152
|
-
"m-horizontal-s": "awsui_m-horizontal-
|
|
153
|
-
"m-bottom-s": "awsui_m-bottom-
|
|
154
|
-
"m-left-s": "awsui_m-left-
|
|
155
|
-
"m-m": "awsui_m-
|
|
156
|
-
"m-top-m": "awsui_m-top-
|
|
157
|
-
"m-vertical-m": "awsui_m-vertical-
|
|
158
|
-
"m-right-m": "awsui_m-right-
|
|
159
|
-
"m-horizontal-m": "awsui_m-horizontal-
|
|
160
|
-
"m-bottom-m": "awsui_m-bottom-
|
|
161
|
-
"m-left-m": "awsui_m-left-
|
|
162
|
-
"m-l": "awsui_m-
|
|
163
|
-
"m-top-l": "awsui_m-top-
|
|
164
|
-
"m-vertical-l": "awsui_m-vertical-
|
|
165
|
-
"m-right-l": "awsui_m-right-
|
|
166
|
-
"m-horizontal-l": "awsui_m-horizontal-
|
|
167
|
-
"m-bottom-l": "awsui_m-bottom-
|
|
168
|
-
"m-left-l": "awsui_m-left-
|
|
169
|
-
"m-xl": "awsui_m-
|
|
170
|
-
"m-top-xl": "awsui_m-top-
|
|
171
|
-
"m-vertical-xl": "awsui_m-vertical-
|
|
172
|
-
"m-right-xl": "awsui_m-right-
|
|
173
|
-
"m-horizontal-xl": "awsui_m-horizontal-
|
|
174
|
-
"m-bottom-xl": "awsui_m-bottom-
|
|
175
|
-
"m-left-xl": "awsui_m-left-
|
|
176
|
-
"m-xxl": "awsui_m-
|
|
177
|
-
"m-top-xxl": "awsui_m-top-
|
|
178
|
-
"m-vertical-xxl": "awsui_m-vertical-
|
|
179
|
-
"m-right-xxl": "awsui_m-right-
|
|
180
|
-
"m-horizontal-xxl": "awsui_m-horizontal-
|
|
181
|
-
"m-bottom-xxl": "awsui_m-bottom-
|
|
182
|
-
"m-left-xxl": "awsui_m-left-
|
|
183
|
-
"m-xxxl": "awsui_m-
|
|
184
|
-
"m-top-xxxl": "awsui_m-top-
|
|
185
|
-
"m-vertical-xxxl": "awsui_m-vertical-
|
|
186
|
-
"m-right-xxxl": "awsui_m-right-
|
|
187
|
-
"m-horizontal-xxxl": "awsui_m-horizontal-
|
|
188
|
-
"m-bottom-xxxl": "awsui_m-bottom-
|
|
189
|
-
"m-left-xxxl": "awsui_m-left-
|
|
190
|
-
"d-block": "awsui_d-
|
|
191
|
-
"d-inline": "awsui_d-
|
|
192
|
-
"d-inline-block": "awsui_d-inline-
|
|
193
|
-
"d-none": "awsui_d-
|
|
194
|
-
"f-left": "awsui_f-
|
|
195
|
-
"f-right": "awsui_f-
|
|
196
|
-
"root": "
|
|
5
|
+
"box": "awsui_box_18wu0_1q0fz_172",
|
|
6
|
+
"p-variant": "awsui_p-variant_18wu0_1q0fz_172",
|
|
7
|
+
"color-default": "awsui_color-default_18wu0_1q0fz_172",
|
|
8
|
+
"b-variant": "awsui_b-variant_18wu0_1q0fz_172",
|
|
9
|
+
"strong-variant": "awsui_strong-variant_18wu0_1q0fz_172",
|
|
10
|
+
"code-variant": "awsui_code-variant_18wu0_1q0fz_172",
|
|
11
|
+
"pre-variant": "awsui_pre-variant_18wu0_1q0fz_172",
|
|
12
|
+
"samp-variant": "awsui_samp-variant_18wu0_1q0fz_172",
|
|
13
|
+
"h1-variant": "awsui_h1-variant_18wu0_1q0fz_176",
|
|
14
|
+
"h2-variant": "awsui_h2-variant_18wu0_1q0fz_176",
|
|
15
|
+
"h3-variant": "awsui_h3-variant_18wu0_1q0fz_176",
|
|
16
|
+
"h4-variant": "awsui_h4-variant_18wu0_1q0fz_176",
|
|
17
|
+
"h5-variant": "awsui_h5-variant_18wu0_1q0fz_176",
|
|
18
|
+
"small-variant": "awsui_small-variant_18wu0_1q0fz_180",
|
|
19
|
+
"a-variant": "awsui_a-variant_18wu0_1q0fz_184",
|
|
20
|
+
"font-size-default": "awsui_font-size-default_18wu0_1q0fz_188",
|
|
21
|
+
"font-weight-default": "awsui_font-weight-default_18wu0_1q0fz_229",
|
|
22
|
+
"key-label-variant": "awsui_key-label-variant_18wu0_1q0fz_271",
|
|
23
|
+
"gen-ai-label-variant": "awsui_gen-ai-label-variant_18wu0_1q0fz_278",
|
|
24
|
+
"value-large-variant": "awsui_value-large-variant_18wu0_1q0fz_285",
|
|
25
|
+
"inline-code-variant": "awsui_inline-code-variant_18wu0_1q0fz_292",
|
|
26
|
+
"font-weight-heavy": "awsui_font-weight-heavy_18wu0_1q0fz_306",
|
|
27
|
+
"color-inverted": "awsui_color-inverted_18wu0_1q0fz_311",
|
|
28
|
+
"color-text-label": "awsui_color-text-label_18wu0_1q0fz_314",
|
|
29
|
+
"color-text-body-secondary": "awsui_color-text-body-secondary_18wu0_1q0fz_317",
|
|
30
|
+
"color-text-status-error": "awsui_color-text-status-error_18wu0_1q0fz_320",
|
|
31
|
+
"color-text-status-success": "awsui_color-text-status-success_18wu0_1q0fz_323",
|
|
32
|
+
"color-text-status-info": "awsui_color-text-status-info_18wu0_1q0fz_326",
|
|
33
|
+
"color-text-status-inactive": "awsui_color-text-status-inactive_18wu0_1q0fz_329",
|
|
34
|
+
"color-text-status-warning": "awsui_color-text-status-warning_18wu0_1q0fz_332",
|
|
35
|
+
"color-inherit": "awsui_color-inherit_18wu0_1q0fz_335",
|
|
36
|
+
"font-size-body-s": "awsui_font-size-body-s_18wu0_1q0fz_338",
|
|
37
|
+
"font-size-body-m": "awsui_font-size-body-m_18wu0_1q0fz_343",
|
|
38
|
+
"font-size-heading-xs": "awsui_font-size-heading-xs_18wu0_1q0fz_347",
|
|
39
|
+
"font-size-heading-s": "awsui_font-size-heading-s_18wu0_1q0fz_352",
|
|
40
|
+
"font-size-heading-m": "awsui_font-size-heading-m_18wu0_1q0fz_357",
|
|
41
|
+
"font-size-heading-l": "awsui_font-size-heading-l_18wu0_1q0fz_362",
|
|
42
|
+
"font-size-heading-xl": "awsui_font-size-heading-xl_18wu0_1q0fz_367",
|
|
43
|
+
"font-size-display-l": "awsui_font-size-display-l_18wu0_1q0fz_372",
|
|
44
|
+
"font-weight-light": "awsui_font-weight-light_18wu0_1q0fz_377",
|
|
45
|
+
"font-weight-normal": "awsui_font-weight-normal_18wu0_1q0fz_380",
|
|
46
|
+
"font-weight-bold": "awsui_font-weight-bold_18wu0_1q0fz_383",
|
|
47
|
+
"t-left": "awsui_t-left_18wu0_1q0fz_390",
|
|
48
|
+
"t-right": "awsui_t-right_18wu0_1q0fz_394",
|
|
49
|
+
"t-center": "awsui_t-center_18wu0_1q0fz_398",
|
|
50
|
+
"p-n": "awsui_p-n_18wu0_1q0fz_415",
|
|
51
|
+
"p-top-n": "awsui_p-top-n_18wu0_1q0fz_420",
|
|
52
|
+
"p-vertical-n": "awsui_p-vertical-n_18wu0_1q0fz_421",
|
|
53
|
+
"p-right-n": "awsui_p-right-n_18wu0_1q0fz_425",
|
|
54
|
+
"p-horizontal-n": "awsui_p-horizontal-n_18wu0_1q0fz_426",
|
|
55
|
+
"p-bottom-n": "awsui_p-bottom-n_18wu0_1q0fz_430",
|
|
56
|
+
"p-left-n": "awsui_p-left-n_18wu0_1q0fz_435",
|
|
57
|
+
"p-xxxs": "awsui_p-xxxs_18wu0_1q0fz_440",
|
|
58
|
+
"p-top-xxxs": "awsui_p-top-xxxs_18wu0_1q0fz_445",
|
|
59
|
+
"p-vertical-xxxs": "awsui_p-vertical-xxxs_18wu0_1q0fz_446",
|
|
60
|
+
"p-right-xxxs": "awsui_p-right-xxxs_18wu0_1q0fz_450",
|
|
61
|
+
"p-horizontal-xxxs": "awsui_p-horizontal-xxxs_18wu0_1q0fz_451",
|
|
62
|
+
"p-bottom-xxxs": "awsui_p-bottom-xxxs_18wu0_1q0fz_455",
|
|
63
|
+
"p-left-xxxs": "awsui_p-left-xxxs_18wu0_1q0fz_460",
|
|
64
|
+
"p-xxs": "awsui_p-xxs_18wu0_1q0fz_465",
|
|
65
|
+
"p-top-xxs": "awsui_p-top-xxs_18wu0_1q0fz_470",
|
|
66
|
+
"p-vertical-xxs": "awsui_p-vertical-xxs_18wu0_1q0fz_471",
|
|
67
|
+
"p-right-xxs": "awsui_p-right-xxs_18wu0_1q0fz_475",
|
|
68
|
+
"p-horizontal-xxs": "awsui_p-horizontal-xxs_18wu0_1q0fz_476",
|
|
69
|
+
"p-bottom-xxs": "awsui_p-bottom-xxs_18wu0_1q0fz_480",
|
|
70
|
+
"p-left-xxs": "awsui_p-left-xxs_18wu0_1q0fz_485",
|
|
71
|
+
"p-xs": "awsui_p-xs_18wu0_1q0fz_490",
|
|
72
|
+
"p-top-xs": "awsui_p-top-xs_18wu0_1q0fz_495",
|
|
73
|
+
"p-vertical-xs": "awsui_p-vertical-xs_18wu0_1q0fz_496",
|
|
74
|
+
"p-right-xs": "awsui_p-right-xs_18wu0_1q0fz_500",
|
|
75
|
+
"p-horizontal-xs": "awsui_p-horizontal-xs_18wu0_1q0fz_501",
|
|
76
|
+
"p-bottom-xs": "awsui_p-bottom-xs_18wu0_1q0fz_505",
|
|
77
|
+
"p-left-xs": "awsui_p-left-xs_18wu0_1q0fz_510",
|
|
78
|
+
"p-s": "awsui_p-s_18wu0_1q0fz_515",
|
|
79
|
+
"p-top-s": "awsui_p-top-s_18wu0_1q0fz_520",
|
|
80
|
+
"p-vertical-s": "awsui_p-vertical-s_18wu0_1q0fz_521",
|
|
81
|
+
"p-right-s": "awsui_p-right-s_18wu0_1q0fz_525",
|
|
82
|
+
"p-horizontal-s": "awsui_p-horizontal-s_18wu0_1q0fz_526",
|
|
83
|
+
"p-bottom-s": "awsui_p-bottom-s_18wu0_1q0fz_530",
|
|
84
|
+
"p-left-s": "awsui_p-left-s_18wu0_1q0fz_535",
|
|
85
|
+
"p-m": "awsui_p-m_18wu0_1q0fz_540",
|
|
86
|
+
"p-top-m": "awsui_p-top-m_18wu0_1q0fz_545",
|
|
87
|
+
"p-vertical-m": "awsui_p-vertical-m_18wu0_1q0fz_546",
|
|
88
|
+
"p-right-m": "awsui_p-right-m_18wu0_1q0fz_550",
|
|
89
|
+
"p-horizontal-m": "awsui_p-horizontal-m_18wu0_1q0fz_551",
|
|
90
|
+
"p-bottom-m": "awsui_p-bottom-m_18wu0_1q0fz_555",
|
|
91
|
+
"p-left-m": "awsui_p-left-m_18wu0_1q0fz_560",
|
|
92
|
+
"p-l": "awsui_p-l_18wu0_1q0fz_435",
|
|
93
|
+
"p-top-l": "awsui_p-top-l_18wu0_1q0fz_570",
|
|
94
|
+
"p-vertical-l": "awsui_p-vertical-l_18wu0_1q0fz_571",
|
|
95
|
+
"p-right-l": "awsui_p-right-l_18wu0_1q0fz_575",
|
|
96
|
+
"p-horizontal-l": "awsui_p-horizontal-l_18wu0_1q0fz_576",
|
|
97
|
+
"p-bottom-l": "awsui_p-bottom-l_18wu0_1q0fz_580",
|
|
98
|
+
"p-left-l": "awsui_p-left-l_18wu0_1q0fz_585",
|
|
99
|
+
"p-xl": "awsui_p-xl_18wu0_1q0fz_590",
|
|
100
|
+
"p-top-xl": "awsui_p-top-xl_18wu0_1q0fz_595",
|
|
101
|
+
"p-vertical-xl": "awsui_p-vertical-xl_18wu0_1q0fz_596",
|
|
102
|
+
"p-right-xl": "awsui_p-right-xl_18wu0_1q0fz_600",
|
|
103
|
+
"p-horizontal-xl": "awsui_p-horizontal-xl_18wu0_1q0fz_601",
|
|
104
|
+
"p-bottom-xl": "awsui_p-bottom-xl_18wu0_1q0fz_605",
|
|
105
|
+
"p-left-xl": "awsui_p-left-xl_18wu0_1q0fz_610",
|
|
106
|
+
"p-xxl": "awsui_p-xxl_18wu0_1q0fz_615",
|
|
107
|
+
"p-top-xxl": "awsui_p-top-xxl_18wu0_1q0fz_620",
|
|
108
|
+
"p-vertical-xxl": "awsui_p-vertical-xxl_18wu0_1q0fz_621",
|
|
109
|
+
"p-right-xxl": "awsui_p-right-xxl_18wu0_1q0fz_625",
|
|
110
|
+
"p-horizontal-xxl": "awsui_p-horizontal-xxl_18wu0_1q0fz_626",
|
|
111
|
+
"p-bottom-xxl": "awsui_p-bottom-xxl_18wu0_1q0fz_630",
|
|
112
|
+
"p-left-xxl": "awsui_p-left-xxl_18wu0_1q0fz_635",
|
|
113
|
+
"p-xxxl": "awsui_p-xxxl_18wu0_1q0fz_640",
|
|
114
|
+
"p-top-xxxl": "awsui_p-top-xxxl_18wu0_1q0fz_645",
|
|
115
|
+
"p-vertical-xxxl": "awsui_p-vertical-xxxl_18wu0_1q0fz_646",
|
|
116
|
+
"p-right-xxxl": "awsui_p-right-xxxl_18wu0_1q0fz_650",
|
|
117
|
+
"p-horizontal-xxxl": "awsui_p-horizontal-xxxl_18wu0_1q0fz_651",
|
|
118
|
+
"p-bottom-xxxl": "awsui_p-bottom-xxxl_18wu0_1q0fz_655",
|
|
119
|
+
"p-left-xxxl": "awsui_p-left-xxxl_18wu0_1q0fz_660",
|
|
120
|
+
"m-n": "awsui_m-n_18wu0_1q0fz_665",
|
|
121
|
+
"m-top-n": "awsui_m-top-n_18wu0_1q0fz_670",
|
|
122
|
+
"m-vertical-n": "awsui_m-vertical-n_18wu0_1q0fz_671",
|
|
123
|
+
"m-right-n": "awsui_m-right-n_18wu0_1q0fz_675",
|
|
124
|
+
"m-horizontal-n": "awsui_m-horizontal-n_18wu0_1q0fz_676",
|
|
125
|
+
"m-bottom-n": "awsui_m-bottom-n_18wu0_1q0fz_680",
|
|
126
|
+
"m-left-n": "awsui_m-left-n_18wu0_1q0fz_685",
|
|
127
|
+
"m-xxxs": "awsui_m-xxxs_18wu0_1q0fz_690",
|
|
128
|
+
"m-top-xxxs": "awsui_m-top-xxxs_18wu0_1q0fz_695",
|
|
129
|
+
"m-vertical-xxxs": "awsui_m-vertical-xxxs_18wu0_1q0fz_696",
|
|
130
|
+
"m-right-xxxs": "awsui_m-right-xxxs_18wu0_1q0fz_700",
|
|
131
|
+
"m-horizontal-xxxs": "awsui_m-horizontal-xxxs_18wu0_1q0fz_701",
|
|
132
|
+
"m-bottom-xxxs": "awsui_m-bottom-xxxs_18wu0_1q0fz_705",
|
|
133
|
+
"m-left-xxxs": "awsui_m-left-xxxs_18wu0_1q0fz_710",
|
|
134
|
+
"m-xxs": "awsui_m-xxs_18wu0_1q0fz_715",
|
|
135
|
+
"m-top-xxs": "awsui_m-top-xxs_18wu0_1q0fz_720",
|
|
136
|
+
"m-vertical-xxs": "awsui_m-vertical-xxs_18wu0_1q0fz_721",
|
|
137
|
+
"m-right-xxs": "awsui_m-right-xxs_18wu0_1q0fz_725",
|
|
138
|
+
"m-horizontal-xxs": "awsui_m-horizontal-xxs_18wu0_1q0fz_726",
|
|
139
|
+
"m-bottom-xxs": "awsui_m-bottom-xxs_18wu0_1q0fz_730",
|
|
140
|
+
"m-left-xxs": "awsui_m-left-xxs_18wu0_1q0fz_735",
|
|
141
|
+
"m-xs": "awsui_m-xs_18wu0_1q0fz_740",
|
|
142
|
+
"m-top-xs": "awsui_m-top-xs_18wu0_1q0fz_745",
|
|
143
|
+
"m-vertical-xs": "awsui_m-vertical-xs_18wu0_1q0fz_746",
|
|
144
|
+
"m-right-xs": "awsui_m-right-xs_18wu0_1q0fz_750",
|
|
145
|
+
"m-horizontal-xs": "awsui_m-horizontal-xs_18wu0_1q0fz_751",
|
|
146
|
+
"m-bottom-xs": "awsui_m-bottom-xs_18wu0_1q0fz_755",
|
|
147
|
+
"m-left-xs": "awsui_m-left-xs_18wu0_1q0fz_760",
|
|
148
|
+
"m-s": "awsui_m-s_18wu0_1q0fz_765",
|
|
149
|
+
"m-top-s": "awsui_m-top-s_18wu0_1q0fz_770",
|
|
150
|
+
"m-vertical-s": "awsui_m-vertical-s_18wu0_1q0fz_771",
|
|
151
|
+
"m-right-s": "awsui_m-right-s_18wu0_1q0fz_775",
|
|
152
|
+
"m-horizontal-s": "awsui_m-horizontal-s_18wu0_1q0fz_776",
|
|
153
|
+
"m-bottom-s": "awsui_m-bottom-s_18wu0_1q0fz_780",
|
|
154
|
+
"m-left-s": "awsui_m-left-s_18wu0_1q0fz_785",
|
|
155
|
+
"m-m": "awsui_m-m_18wu0_1q0fz_790",
|
|
156
|
+
"m-top-m": "awsui_m-top-m_18wu0_1q0fz_795",
|
|
157
|
+
"m-vertical-m": "awsui_m-vertical-m_18wu0_1q0fz_796",
|
|
158
|
+
"m-right-m": "awsui_m-right-m_18wu0_1q0fz_800",
|
|
159
|
+
"m-horizontal-m": "awsui_m-horizontal-m_18wu0_1q0fz_801",
|
|
160
|
+
"m-bottom-m": "awsui_m-bottom-m_18wu0_1q0fz_805",
|
|
161
|
+
"m-left-m": "awsui_m-left-m_18wu0_1q0fz_810",
|
|
162
|
+
"m-l": "awsui_m-l_18wu0_1q0fz_685",
|
|
163
|
+
"m-top-l": "awsui_m-top-l_18wu0_1q0fz_820",
|
|
164
|
+
"m-vertical-l": "awsui_m-vertical-l_18wu0_1q0fz_821",
|
|
165
|
+
"m-right-l": "awsui_m-right-l_18wu0_1q0fz_825",
|
|
166
|
+
"m-horizontal-l": "awsui_m-horizontal-l_18wu0_1q0fz_826",
|
|
167
|
+
"m-bottom-l": "awsui_m-bottom-l_18wu0_1q0fz_830",
|
|
168
|
+
"m-left-l": "awsui_m-left-l_18wu0_1q0fz_835",
|
|
169
|
+
"m-xl": "awsui_m-xl_18wu0_1q0fz_840",
|
|
170
|
+
"m-top-xl": "awsui_m-top-xl_18wu0_1q0fz_845",
|
|
171
|
+
"m-vertical-xl": "awsui_m-vertical-xl_18wu0_1q0fz_846",
|
|
172
|
+
"m-right-xl": "awsui_m-right-xl_18wu0_1q0fz_850",
|
|
173
|
+
"m-horizontal-xl": "awsui_m-horizontal-xl_18wu0_1q0fz_851",
|
|
174
|
+
"m-bottom-xl": "awsui_m-bottom-xl_18wu0_1q0fz_855",
|
|
175
|
+
"m-left-xl": "awsui_m-left-xl_18wu0_1q0fz_860",
|
|
176
|
+
"m-xxl": "awsui_m-xxl_18wu0_1q0fz_865",
|
|
177
|
+
"m-top-xxl": "awsui_m-top-xxl_18wu0_1q0fz_870",
|
|
178
|
+
"m-vertical-xxl": "awsui_m-vertical-xxl_18wu0_1q0fz_871",
|
|
179
|
+
"m-right-xxl": "awsui_m-right-xxl_18wu0_1q0fz_875",
|
|
180
|
+
"m-horizontal-xxl": "awsui_m-horizontal-xxl_18wu0_1q0fz_876",
|
|
181
|
+
"m-bottom-xxl": "awsui_m-bottom-xxl_18wu0_1q0fz_880",
|
|
182
|
+
"m-left-xxl": "awsui_m-left-xxl_18wu0_1q0fz_885",
|
|
183
|
+
"m-xxxl": "awsui_m-xxxl_18wu0_1q0fz_890",
|
|
184
|
+
"m-top-xxxl": "awsui_m-top-xxxl_18wu0_1q0fz_895",
|
|
185
|
+
"m-vertical-xxxl": "awsui_m-vertical-xxxl_18wu0_1q0fz_896",
|
|
186
|
+
"m-right-xxxl": "awsui_m-right-xxxl_18wu0_1q0fz_900",
|
|
187
|
+
"m-horizontal-xxxl": "awsui_m-horizontal-xxxl_18wu0_1q0fz_901",
|
|
188
|
+
"m-bottom-xxxl": "awsui_m-bottom-xxxl_18wu0_1q0fz_905",
|
|
189
|
+
"m-left-xxxl": "awsui_m-left-xxxl_18wu0_1q0fz_910",
|
|
190
|
+
"d-block": "awsui_d-block_18wu0_1q0fz_915",
|
|
191
|
+
"d-inline": "awsui_d-inline_18wu0_1q0fz_918",
|
|
192
|
+
"d-inline-block": "awsui_d-inline-block_18wu0_1q0fz_921",
|
|
193
|
+
"d-none": "awsui_d-none_18wu0_1q0fz_924",
|
|
194
|
+
"f-left": "awsui_f-left_18wu0_1q0fz_928",
|
|
195
|
+
"f-right": "awsui_f-right_18wu0_1q0fz_932",
|
|
196
|
+
"root": "awsui_root_18wu0_1q0fz_936"
|
|
197
197
|
};
|
|
198
198
|
|
|
@@ -172,7 +172,7 @@ export const InternalButton = React.forwardRef(({ children, iconName, __iconClas
|
|
|
172
172
|
if (isNotInteractive) {
|
|
173
173
|
// If disabled with a reason, make it focusable so users can access the tooltip
|
|
174
174
|
// Otherwise, resolve to the default button props tabIndex.
|
|
175
|
-
return
|
|
175
|
+
return isDisabledWithReason ? 0 : buttonProps.tabIndex;
|
|
176
176
|
}
|
|
177
177
|
return buttonProps.tabIndex;
|
|
178
178
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3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QAAQ,EAClB,KAAK,EAAE,2BAA2B;gBAEjC,aAAa;gBACb,oBAAoB,IAAI,qBAAqB,CACzB;YACtB,OAAO,IAAI,WAAW,IAAI,CACzB,oBAAC,kBAAkB,IAAC,OAAO,EAAC,MAAM,EAAC,MAAM,EAAE,IAAI,IAC5C,WAAW,CACO,CACtB,CACA,CACJ,CAAC;IACJ,CAAC;IAED,OAAO,CACL;QACE,oBAAC,oBAAoB,OACf,WAAW,KACX,mBAAmB,EACvB,GAAG,EAAC,QAAQ,EACZ,aAAa,EAAC,QAAQ,EACtB,gBAAgB,EAAE,sBAAsB,EACxC,YAAY,EAAE,8BAA8B,EAC5C,IAAI,EAAE,UAAU,KAAK,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,EACjD,QAAQ,EAAE,QAAQ,IAAI,CAAC,WAAW,IAAI,CAAC,oBAAoB,mBAC5C,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,EACjD,KAAK,EAAE,2BAA2B;YAEjC,aAAa;YACb,oBAAoB,IAAI,qBAAqB,CACzB;QACtB,OAAO,IAAI,WAAW,IAAI,CACzB,oBAAC,kBAAkB,IAAC,OAAO,EAAC,MAAM,EAAC,MAAM,EAAE,IAAI,IAC5C,WAAW,CACO,CACtB,CACA,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, useUniqueId, warnOnce } from '@cloudscape-design/component-toolkit/internal';\nimport { useSingleTabStopNavigation } from '@cloudscape-design/component-toolkit/internal';\nimport {\n getAnalyticsLabelAttribute,\n getAnalyticsMetadataAttribute,\n} from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { useInternalI18n } from '../i18n/context';\nimport Icon from '../icon/internal';\nimport { FunnelMetrics } from '../internal/analytics';\nimport { useFunnel, useFunnelStep, useFunnelSubStep } from '../internal/analytics/hooks/use-funnel';\nimport {\n DATA_ATTR_FUNNEL_VALUE,\n getFunnelValueSelector,\n getSubStepAllSelector,\n getTextFromSelector,\n} from '../internal/analytics/selectors';\nimport { useButtonContext } from '../internal/context/button-context';\nimport { fireCancelableEvent, isPlainLeftClick } from '../internal/events';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport useHiddenDescription from '../internal/hooks/use-hidden-description';\nimport { useModalContextLoadingButtonComponent } from '../internal/hooks/use-modal-component-analytics';\nimport { usePerformanceMarks } from '../internal/hooks/use-performance-marks';\nimport { checkSafeUrl } from '../internal/utils/check-safe-url';\nimport WithNativeAttributes from '../internal/utils/with-native-attributes';\nimport InternalLiveRegion from '../live-region/internal';\nimport Tooltip from '../tooltip/internal.js';\nimport { GeneratedAnalyticsMetadataButtonFragment } from './analytics-metadata/interfaces';\nimport { ButtonIconProps, LeftIcon, RightIcon } from './icon-helper';\nimport { ButtonProps } from './interfaces';\nimport { getButtonStyles } from './style';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\nexport type InternalButtonProps = Omit<ButtonProps, 'variant'> & {\n variant?:\n | ButtonProps['variant']\n | 'flashbar-icon'\n | 'breadcrumb-group'\n | 'menu-trigger'\n | 'modal-dismiss'\n | 'inline-icon-pointer-target';\n badge?: boolean;\n analyticsAction?: string;\n __iconClass?: string;\n __focusable?: boolean;\n __injectAnalyticsComponentMetadata?: boolean;\n __title?: string;\n __emitPerformanceMarks?: boolean;\n __skipNativeAttributesWarnings?: boolean;\n} & InternalBaseComponentProps;\n\nexport const InternalButton = React.forwardRef(\n (\n {\n children,\n iconName,\n __iconClass,\n onClick,\n onFollow,\n iconAlign = 'left',\n iconUrl,\n iconSvg,\n iconAlt,\n variant = 'normal',\n loading = false,\n loadingText,\n disabled = false,\n disabledReason,\n wrapText = true,\n href,\n external,\n target: targetOverride,\n rel,\n download,\n formAction = 'submit',\n ariaLabel,\n ariaDescribedby,\n ariaExpanded,\n ariaControls,\n fullWidth,\n badge,\n i18nStrings,\n style,\n nativeButtonAttributes,\n nativeAnchorAttributes,\n __internalRootRef,\n __focusable = false,\n __injectAnalyticsComponentMetadata = false,\n __title,\n __emitPerformanceMarks = true,\n __skipNativeAttributesWarnings,\n analyticsAction = 'click',\n ...props\n }: InternalButtonProps,\n ref: React.Ref<ButtonProps.Ref>\n ) => {\n const [showTooltip, setShowTooltip] = useState(false);\n\n checkSafeUrl('Button', href);\n const isAnchor = Boolean(href);\n const target = targetOverride ?? (external ? '_blank' : undefined);\n const isNotInteractive = loading || disabled;\n const isDisabledWithReason =\n (variant === 'normal' || variant === 'primary' || variant === 'icon') && !!disabledReason && disabled;\n\n const hasAriaDisabled = (loading && !disabled) || (disabled && __focusable) || isDisabledWithReason;\n const shouldHaveContent =\n children &&\n ['icon', 'inline-icon', 'flashbar-icon', 'modal-dismiss', 'inline-icon-pointer-target'].indexOf(variant) === -1;\n\n if ((iconName || iconUrl || iconSvg) && iconAlign === 'right' && external) {\n warnOnce('Button', 'A right-aligned icon should not be combined with an external icon.');\n }\n\n const buttonRef = useRef<HTMLElement>(null);\n useForwardFocus(ref, buttonRef);\n\n const buttonContext = useButtonContext();\n const i18n = useInternalI18n('button');\n\n const uniqueId = useUniqueId('button');\n const { funnelInteractionId } = useFunnel();\n const { stepNumber, stepNameSelector } = useFunnelStep();\n const { subStepSelector, subStepNameSelector } = useFunnelSubStep();\n\n const performanceMarkAttributes = usePerformanceMarks(\n 'primaryButton',\n () => variant === 'primary' && __emitPerformanceMarks && !loading && !disabled,\n buttonRef,\n () => ({\n loading,\n disabled,\n text: buttonRef.current?.innerText,\n }),\n [loading, disabled]\n );\n useModalContextLoadingButtonComponent(variant === 'primary', loading);\n\n const { targetProps, descriptionEl } = useHiddenDescription(disabledReason);\n\n const handleClick = (event: React.MouseEvent) => {\n if (isNotInteractive) {\n return event.preventDefault();\n }\n\n if (isAnchor && isPlainLeftClick(event)) {\n fireCancelableEvent(onFollow, { href, target }, event);\n\n if ((iconName === 'external' || target === '_blank') && funnelInteractionId) {\n const stepName = getTextFromSelector(stepNameSelector);\n const subStepName = getTextFromSelector(subStepNameSelector);\n\n FunnelMetrics.externalLinkInteracted({\n funnelInteractionId,\n stepNumber,\n stepName,\n stepNameSelector,\n subStepSelector,\n subStepName,\n subStepNameSelector,\n elementSelector: getFunnelValueSelector(uniqueId),\n subStepAllSelector: getSubStepAllSelector(),\n });\n }\n }\n\n const { altKey, button, ctrlKey, metaKey, shiftKey } = event;\n fireCancelableEvent(onClick, { altKey, button, ctrlKey, metaKey, shiftKey }, event);\n buttonContext.onClick({ variant });\n };\n\n const buttonClass = clsx(props.className, styles.button, styles[`variant-${variant}`], {\n [styles.disabled]: isNotInteractive,\n [styles['disabled-with-reason']]: isDisabledWithReason,\n [styles['button-no-wrap']]: !wrapText,\n [styles['button-no-text']]: !shouldHaveContent,\n [styles['full-width']]: shouldHaveContent && fullWidth,\n [styles.link]: isAnchor,\n });\n\n const explicitTabIndex = nativeButtonAttributes?.tabIndex ?? nativeAnchorAttributes?.tabIndex;\n const { tabIndex } = useSingleTabStopNavigation(buttonRef, {\n tabIndex: isAnchor && isNotInteractive && !isDisabledWithReason ? -1 : explicitTabIndex,\n });\n\n const analyticsMetadata: GeneratedAnalyticsMetadataButtonFragment = disabled\n ? {}\n : {\n action: analyticsAction,\n detail: { label: { root: 'self' } },\n };\n if (__injectAnalyticsComponentMetadata) {\n analyticsMetadata.component = {\n name: 'awsui.Button',\n label: { root: 'self' },\n properties: { variant, disabled: `${disabled}` },\n };\n }\n\n const buttonProps = {\n ...props,\n ...performanceMarkAttributes,\n tabIndex,\n // https://github.com/microsoft/TypeScript/issues/36659\n ref: useMergeRefs(buttonRef, __internalRootRef),\n 'aria-label': ariaLabel,\n 'aria-describedby': ariaDescribedby,\n 'aria-expanded': ariaExpanded,\n 'aria-controls': ariaControls,\n // add ariaLabel as `title` as visible hint text\n title: __title ?? ariaLabel,\n className: buttonClass,\n onClick: handleClick,\n [DATA_ATTR_FUNNEL_VALUE]: uniqueId,\n ...getAnalyticsMetadataAttribute(analyticsMetadata),\n ...getAnalyticsLabelAttribute(shouldHaveContent ? `.${analyticsSelectors.label}` : ''),\n } as const;\n\n const iconProps: ButtonIconProps = {\n loading,\n iconName,\n iconAlign,\n iconUrl,\n iconSvg,\n iconAlt,\n variant,\n badge,\n iconClass: __iconClass,\n iconSize: variant === 'modal-dismiss' ? 'medium' : 'normal',\n };\n const buttonContent = (\n <>\n <LeftIcon {...iconProps} />\n {shouldHaveContent && (\n <>\n <span className={clsx(styles.content, analyticsSelectors.label)}>{children}</span>\n {external && (\n <>\n \n <Icon\n name=\"external\"\n className={testUtilStyles['external-icon']}\n ariaLabel={i18n('i18nStrings.externalIconAriaLabel', i18nStrings?.externalIconAriaLabel)}\n />\n </>\n )}\n </>\n )}\n <RightIcon {...iconProps} />\n </>\n );\n\n const { loadingButtonCount } = useFunnel();\n useEffect(() => {\n if (loading) {\n loadingButtonCount.current++;\n return () => {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n loadingButtonCount.current--;\n };\n }\n }, [loading, loadingButtonCount]);\n\n const disabledReasonProps = {\n onFocus: isDisabledWithReason ? () => setShowTooltip(true) : undefined,\n onBlur: isDisabledWithReason ? () => setShowTooltip(false) : undefined,\n onMouseEnter: isDisabledWithReason ? () => setShowTooltip(true) : undefined,\n onMouseLeave: isDisabledWithReason ? () => setShowTooltip(false) : undefined,\n ...(isDisabledWithReason ? targetProps : {}),\n };\n const disabledReasonContent = (\n <>\n {descriptionEl}\n {showTooltip && (\n <Tooltip\n className={testUtilStyles['disabled-reason-tooltip']}\n getTrack={() => buttonRef.current}\n content={disabledReason!}\n onEscape={() => setShowTooltip(false)}\n />\n )}\n </>\n );\n\n const stylePropertiesAndVariables = getButtonStyles(style);\n\n if (isAnchor) {\n const getAnchorTabIndex = () => {\n if (isNotInteractive) {\n // If disabled with a reason, make it focusable so users can access the tooltip\n // Otherwise, resolve to the default button props tabIndex.\n return disabledReason ? 0 : buttonProps.tabIndex;\n }\n return buttonProps.tabIndex;\n };\n\n return (\n <>\n <WithNativeAttributes<HTMLAnchorElement, React.AnchorHTMLAttributes<HTMLAnchorElement>>\n {...buttonProps}\n {...disabledReasonProps}\n tag=\"a\"\n componentName=\"Button\"\n nativeAttributes={nativeAnchorAttributes}\n skipWarnings={__skipNativeAttributesWarnings}\n href={isNotInteractive ? undefined : href}\n role={isNotInteractive ? 'link' : undefined}\n tabIndex={getAnchorTabIndex()}\n target={target}\n // security recommendation: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target\n rel={rel ?? (target === '_blank' ? 'noopener noreferrer' : undefined)}\n aria-disabled={isNotInteractive ? true : undefined}\n download={download}\n style={stylePropertiesAndVariables}\n >\n {buttonContent}\n {isDisabledWithReason && disabledReasonContent}\n </WithNativeAttributes>\n {loading && loadingText && (\n <InternalLiveRegion tagName=\"span\" hidden={true}>\n {loadingText}\n </InternalLiveRegion>\n )}\n </>\n );\n }\n\n return (\n <>\n <WithNativeAttributes<HTMLButtonElement, React.ButtonHTMLAttributes<HTMLButtonElement>>\n {...buttonProps}\n {...disabledReasonProps}\n tag=\"button\"\n componentName=\"Button\"\n nativeAttributes={nativeButtonAttributes}\n skipWarnings={__skipNativeAttributesWarnings}\n type={formAction === 'none' ? 'button' : 'submit'}\n disabled={disabled && !__focusable && !isDisabledWithReason}\n aria-disabled={hasAriaDisabled ? true : undefined}\n style={stylePropertiesAndVariables}\n >\n {buttonContent}\n {isDisabledWithReason && disabledReasonContent}\n </WithNativeAttributes>\n {loading && loadingText && (\n <InternalLiveRegion tagName=\"span\" hidden={true}>\n {loadingText}\n </InternalLiveRegion>\n )}\n </>\n );\n }\n);\n\nexport default InternalButton;\n"]}
|
|
1
|
+
{"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EAAE,QAAQ,EAClB,KAAK,EAAE,2BAA2B;gBAEjC,aAAa;gBACb,oBAAoB,IAAI,qBAAqB,CACzB;YACtB,OAAO,IAAI,WAAW,IAAI,CACzB,oBAAC,kBAAkB,IAAC,OAAO,EAAC,MAAM,EAAC,MAAM,EAAE,IAAI,IAC5C,WAAW,CACO,CACtB,CACA,CACJ,CAAC;IACJ,CAAC;IAED,OAAO,CACL;QACE,oBAAC,oBAAoB,OACf,WAAW,KACX,mBAAmB,EACvB,GAAG,EAAC,QAAQ,EACZ,aAAa,EAAC,QAAQ,EACtB,gBAAgB,EAAE,sBAAsB,EACxC,YAAY,EAAE,8BAA8B,EAC5C,IAAI,EAAE,UAAU,KAAK,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,EACjD,QAAQ,EAAE,QAAQ,IAAI,CAAC,WAAW,IAAI,CAAC,oBAAoB,mBAC5C,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,EACjD,KAAK,EAAE,2BAA2B;YAEjC,aAAa;YACb,oBAAoB,IAAI,qBAAqB,CACzB;QACtB,OAAO,IAAI,WAAW,IAAI,CACzB,oBAAC,kBAAkB,IAAC,OAAO,EAAC,MAAM,EAAC,MAAM,EAAE,IAAI,IAC5C,WAAW,CACO,CACtB,CACA,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, useUniqueId, warnOnce } from '@cloudscape-design/component-toolkit/internal';\nimport { useSingleTabStopNavigation } from '@cloudscape-design/component-toolkit/internal';\nimport {\n getAnalyticsLabelAttribute,\n getAnalyticsMetadataAttribute,\n} from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { useInternalI18n } from '../i18n/context';\nimport Icon from '../icon/internal';\nimport { FunnelMetrics } from '../internal/analytics';\nimport { useFunnel, useFunnelStep, useFunnelSubStep } from '../internal/analytics/hooks/use-funnel';\nimport {\n DATA_ATTR_FUNNEL_VALUE,\n getFunnelValueSelector,\n getSubStepAllSelector,\n getTextFromSelector,\n} from '../internal/analytics/selectors';\nimport { useButtonContext } from '../internal/context/button-context';\nimport { fireCancelableEvent, isPlainLeftClick } from '../internal/events';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport useHiddenDescription from '../internal/hooks/use-hidden-description';\nimport { useModalContextLoadingButtonComponent } from '../internal/hooks/use-modal-component-analytics';\nimport { usePerformanceMarks } from '../internal/hooks/use-performance-marks';\nimport { checkSafeUrl } from '../internal/utils/check-safe-url';\nimport WithNativeAttributes from '../internal/utils/with-native-attributes';\nimport InternalLiveRegion from '../live-region/internal';\nimport Tooltip from '../tooltip/internal.js';\nimport { GeneratedAnalyticsMetadataButtonFragment } from './analytics-metadata/interfaces';\nimport { ButtonIconProps, LeftIcon, RightIcon } from './icon-helper';\nimport { ButtonProps } from './interfaces';\nimport { getButtonStyles } from './style';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\nexport type InternalButtonProps = Omit<ButtonProps, 'variant'> & {\n variant?:\n | ButtonProps['variant']\n | 'flashbar-icon'\n | 'breadcrumb-group'\n | 'menu-trigger'\n | 'modal-dismiss'\n | 'inline-icon-pointer-target';\n badge?: boolean;\n analyticsAction?: string;\n __iconClass?: string;\n __focusable?: boolean;\n __injectAnalyticsComponentMetadata?: boolean;\n __title?: string;\n __emitPerformanceMarks?: boolean;\n __skipNativeAttributesWarnings?: boolean;\n} & InternalBaseComponentProps;\n\nexport const InternalButton = React.forwardRef(\n (\n {\n children,\n iconName,\n __iconClass,\n onClick,\n onFollow,\n iconAlign = 'left',\n iconUrl,\n iconSvg,\n iconAlt,\n variant = 'normal',\n loading = false,\n loadingText,\n disabled = false,\n disabledReason,\n wrapText = true,\n href,\n external,\n target: targetOverride,\n rel,\n download,\n formAction = 'submit',\n ariaLabel,\n ariaDescribedby,\n ariaExpanded,\n ariaControls,\n fullWidth,\n badge,\n i18nStrings,\n style,\n nativeButtonAttributes,\n nativeAnchorAttributes,\n __internalRootRef,\n __focusable = false,\n __injectAnalyticsComponentMetadata = false,\n __title,\n __emitPerformanceMarks = true,\n __skipNativeAttributesWarnings,\n analyticsAction = 'click',\n ...props\n }: InternalButtonProps,\n ref: React.Ref<ButtonProps.Ref>\n ) => {\n const [showTooltip, setShowTooltip] = useState(false);\n\n checkSafeUrl('Button', href);\n const isAnchor = Boolean(href);\n const target = targetOverride ?? (external ? '_blank' : undefined);\n const isNotInteractive = loading || disabled;\n const isDisabledWithReason =\n (variant === 'normal' || variant === 'primary' || variant === 'icon') && !!disabledReason && disabled;\n\n const hasAriaDisabled = (loading && !disabled) || (disabled && __focusable) || isDisabledWithReason;\n const shouldHaveContent =\n children &&\n ['icon', 'inline-icon', 'flashbar-icon', 'modal-dismiss', 'inline-icon-pointer-target'].indexOf(variant) === -1;\n\n if ((iconName || iconUrl || iconSvg) && iconAlign === 'right' && external) {\n warnOnce('Button', 'A right-aligned icon should not be combined with an external icon.');\n }\n\n const buttonRef = useRef<HTMLElement>(null);\n useForwardFocus(ref, buttonRef);\n\n const buttonContext = useButtonContext();\n const i18n = useInternalI18n('button');\n\n const uniqueId = useUniqueId('button');\n const { funnelInteractionId } = useFunnel();\n const { stepNumber, stepNameSelector } = useFunnelStep();\n const { subStepSelector, subStepNameSelector } = useFunnelSubStep();\n\n const performanceMarkAttributes = usePerformanceMarks(\n 'primaryButton',\n () => variant === 'primary' && __emitPerformanceMarks && !loading && !disabled,\n buttonRef,\n () => ({\n loading,\n disabled,\n text: buttonRef.current?.innerText,\n }),\n [loading, disabled]\n );\n useModalContextLoadingButtonComponent(variant === 'primary', loading);\n\n const { targetProps, descriptionEl } = useHiddenDescription(disabledReason);\n\n const handleClick = (event: React.MouseEvent) => {\n if (isNotInteractive) {\n return event.preventDefault();\n }\n\n if (isAnchor && isPlainLeftClick(event)) {\n fireCancelableEvent(onFollow, { href, target }, event);\n\n if ((iconName === 'external' || target === '_blank') && funnelInteractionId) {\n const stepName = getTextFromSelector(stepNameSelector);\n const subStepName = getTextFromSelector(subStepNameSelector);\n\n FunnelMetrics.externalLinkInteracted({\n funnelInteractionId,\n stepNumber,\n stepName,\n stepNameSelector,\n subStepSelector,\n subStepName,\n subStepNameSelector,\n elementSelector: getFunnelValueSelector(uniqueId),\n subStepAllSelector: getSubStepAllSelector(),\n });\n }\n }\n\n const { altKey, button, ctrlKey, metaKey, shiftKey } = event;\n fireCancelableEvent(onClick, { altKey, button, ctrlKey, metaKey, shiftKey }, event);\n buttonContext.onClick({ variant });\n };\n\n const buttonClass = clsx(props.className, styles.button, styles[`variant-${variant}`], {\n [styles.disabled]: isNotInteractive,\n [styles['disabled-with-reason']]: isDisabledWithReason,\n [styles['button-no-wrap']]: !wrapText,\n [styles['button-no-text']]: !shouldHaveContent,\n [styles['full-width']]: shouldHaveContent && fullWidth,\n [styles.link]: isAnchor,\n });\n\n const explicitTabIndex = nativeButtonAttributes?.tabIndex ?? nativeAnchorAttributes?.tabIndex;\n const { tabIndex } = useSingleTabStopNavigation(buttonRef, {\n tabIndex: isAnchor && isNotInteractive && !isDisabledWithReason ? -1 : explicitTabIndex,\n });\n\n const analyticsMetadata: GeneratedAnalyticsMetadataButtonFragment = disabled\n ? {}\n : {\n action: analyticsAction,\n detail: { label: { root: 'self' } },\n };\n if (__injectAnalyticsComponentMetadata) {\n analyticsMetadata.component = {\n name: 'awsui.Button',\n label: { root: 'self' },\n properties: { variant, disabled: `${disabled}` },\n };\n }\n\n const buttonProps = {\n ...props,\n ...performanceMarkAttributes,\n tabIndex,\n // https://github.com/microsoft/TypeScript/issues/36659\n ref: useMergeRefs(buttonRef, __internalRootRef),\n 'aria-label': ariaLabel,\n 'aria-describedby': ariaDescribedby,\n 'aria-expanded': ariaExpanded,\n 'aria-controls': ariaControls,\n // add ariaLabel as `title` as visible hint text\n title: __title ?? ariaLabel,\n className: buttonClass,\n onClick: handleClick,\n [DATA_ATTR_FUNNEL_VALUE]: uniqueId,\n ...getAnalyticsMetadataAttribute(analyticsMetadata),\n ...getAnalyticsLabelAttribute(shouldHaveContent ? `.${analyticsSelectors.label}` : ''),\n } as const;\n\n const iconProps: ButtonIconProps = {\n loading,\n iconName,\n iconAlign,\n iconUrl,\n iconSvg,\n iconAlt,\n variant,\n badge,\n iconClass: __iconClass,\n iconSize: variant === 'modal-dismiss' ? 'medium' : 'normal',\n };\n const buttonContent = (\n <>\n <LeftIcon {...iconProps} />\n {shouldHaveContent && (\n <>\n <span className={clsx(styles.content, analyticsSelectors.label)}>{children}</span>\n {external && (\n <>\n \n <Icon\n name=\"external\"\n className={testUtilStyles['external-icon']}\n ariaLabel={i18n('i18nStrings.externalIconAriaLabel', i18nStrings?.externalIconAriaLabel)}\n />\n </>\n )}\n </>\n )}\n <RightIcon {...iconProps} />\n </>\n );\n\n const { loadingButtonCount } = useFunnel();\n useEffect(() => {\n if (loading) {\n loadingButtonCount.current++;\n return () => {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n loadingButtonCount.current--;\n };\n }\n }, [loading, loadingButtonCount]);\n\n const disabledReasonProps = {\n onFocus: isDisabledWithReason ? () => setShowTooltip(true) : undefined,\n onBlur: isDisabledWithReason ? () => setShowTooltip(false) : undefined,\n onMouseEnter: isDisabledWithReason ? () => setShowTooltip(true) : undefined,\n onMouseLeave: isDisabledWithReason ? () => setShowTooltip(false) : undefined,\n ...(isDisabledWithReason ? targetProps : {}),\n };\n const disabledReasonContent = (\n <>\n {descriptionEl}\n {showTooltip && (\n <Tooltip\n className={testUtilStyles['disabled-reason-tooltip']}\n getTrack={() => buttonRef.current}\n content={disabledReason!}\n onEscape={() => setShowTooltip(false)}\n />\n )}\n </>\n );\n\n const stylePropertiesAndVariables = getButtonStyles(style);\n\n if (isAnchor) {\n const getAnchorTabIndex = () => {\n if (isNotInteractive) {\n // If disabled with a reason, make it focusable so users can access the tooltip\n // Otherwise, resolve to the default button props tabIndex.\n return isDisabledWithReason ? 0 : buttonProps.tabIndex;\n }\n return buttonProps.tabIndex;\n };\n\n return (\n <>\n <WithNativeAttributes<HTMLAnchorElement, React.AnchorHTMLAttributes<HTMLAnchorElement>>\n {...buttonProps}\n {...disabledReasonProps}\n tag=\"a\"\n componentName=\"Button\"\n nativeAttributes={nativeAnchorAttributes}\n skipWarnings={__skipNativeAttributesWarnings}\n href={isNotInteractive ? undefined : href}\n role={isNotInteractive ? 'link' : undefined}\n tabIndex={getAnchorTabIndex()}\n target={target}\n // security recommendation: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target\n rel={rel ?? (target === '_blank' ? 'noopener noreferrer' : undefined)}\n aria-disabled={isNotInteractive ? true : undefined}\n download={download}\n style={stylePropertiesAndVariables}\n >\n {buttonContent}\n {isDisabledWithReason && disabledReasonContent}\n </WithNativeAttributes>\n {loading && loadingText && (\n <InternalLiveRegion tagName=\"span\" hidden={true}>\n {loadingText}\n </InternalLiveRegion>\n )}\n </>\n );\n }\n\n return (\n <>\n <WithNativeAttributes<HTMLButtonElement, React.ButtonHTMLAttributes<HTMLButtonElement>>\n {...buttonProps}\n {...disabledReasonProps}\n tag=\"button\"\n componentName=\"Button\"\n nativeAttributes={nativeButtonAttributes}\n skipWarnings={__skipNativeAttributesWarnings}\n type={formAction === 'none' ? 'button' : 'submit'}\n disabled={disabled && !__focusable && !isDisabledWithReason}\n aria-disabled={hasAriaDisabled ? true : undefined}\n style={stylePropertiesAndVariables}\n >\n {buttonContent}\n {isDisabledWithReason && disabledReasonContent}\n </WithNativeAttributes>\n {loading && loadingText && (\n <InternalLiveRegion tagName=\"span\" hidden={true}>\n {loadingText}\n </InternalLiveRegion>\n )}\n </>\n );\n }\n);\n\nexport default InternalButton;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/file-input/internal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAwD,MAAM,OAAO,CAAC;AAiB7E,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAG3F,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAI9C,UAAU,sBAAsB;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,uBAAuB,CAAC,EAAE,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,GAAG,MAAM,CAAC,QAAQ,MAAM,EAAE,EAAE,MAAM,CAAC,CAAC;IACzG,kCAAkC,CAAC,EAAE,OAAO,CAAC;CAC9C;AAED,QAAA,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/file-input/internal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAwD,MAAM,OAAO,CAAC;AAiB7E,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAG3F,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAI9C,UAAU,sBAAsB;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,uBAAuB,CAAC,EAAE,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,GAAG,MAAM,CAAC,QAAQ,MAAM,EAAE,EAAE,MAAM,CAAC,CAAC;IACzG,kCAAkC,CAAC,EAAE,OAAO,CAAC;CAC9C;AAED,QAAA,MAAM,iBAAiB,iJA4ItB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -79,7 +79,12 @@ const InternalFileInput = React.forwardRef(({ accept, ariaRequired, ariaLabel, m
|
|
|
79
79
|
React.createElement(InternalButton, { iconName: "upload", variant: variant === 'icon' ? 'icon' : undefined, formAction: "none", onClick: onUploadButtonClick, className: clsx(styles['file-input-button'], {
|
|
80
80
|
[styles['force-focus-outline-button']]: isFocused && variant === 'button',
|
|
81
81
|
[styles['force-focus-outline-icon']]: isFocused && variant === 'icon',
|
|
82
|
-
}), nativeButtonAttributes: {
|
|
82
|
+
}), nativeButtonAttributes: {
|
|
83
|
+
tabIndex: -1,
|
|
84
|
+
'aria-hidden': true,
|
|
85
|
+
// AWSUI-61771 Prevent focus on the decorative button to avoid aria-hidden focus warning
|
|
86
|
+
onMouseDown: (event) => event.preventDefault(),
|
|
87
|
+
}, __skipNativeAttributesWarnings: true }, variant === 'button' && children),
|
|
83
88
|
React.createElement(ScreenreaderOnly, { id: uploadButtonLabelId }, ariaLabel || children)));
|
|
84
89
|
});
|
|
85
90
|
export default InternalFileInput;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/file-input/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAoB,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC7E,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AACpG,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAC3F,OAAO,EAEL,6BAA6B,GAC9B,MAAM,kEAAkE,CAAC;AAE1E,OAAO,cAAc,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,gBAAgB,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,eAAe,MAAM,oCAAoC,CAAC;AACjE,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAE9D,OAAO,EAAE,WAAW,EAAE,MA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,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAChD,UAAU,EAAC,MAAM,EACjB,OAAO,EAAE,mBAAmB,EAC5B,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,EAAE;gBAC3C,CAAC,MAAM,CAAC,4BAA4B,CAAC,CAAC,EAAE,SAAS,IAAI,OAAO,KAAK,QAAQ;gBACzE,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC,EAAE,SAAS,IAAI,OAAO,KAAK,MAAM;aACtE,CAAC,EACF,sBAAsB,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,EAC7D,8BAA8B,EAAE,IAAI,IAEnC,OAAO,KAAK,QAAQ,IAAI,QAAQ,CAClB;QAGjB,oBAAC,gBAAgB,IAAC,EAAE,EAAE,mBAAmB,IAAG,SAAS,IAAI,QAAQ,CAAoB,CACjF,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { ChangeEvent, Ref, useEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, useUniqueId, warnOnce } from '@cloudscape-design/component-toolkit/internal';\nimport { useSingleTabStopNavigation } from '@cloudscape-design/component-toolkit/internal';\nimport {\n GeneratedAnalyticsMetadataFragment,\n getAnalyticsMetadataAttribute,\n} from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport InternalButton from '../button/internal';\nimport { useFormFieldContext } from '../contexts/form-field';\nimport { getBaseProps } from '../internal/base-component/index.js';\nimport ScreenreaderOnly from '../internal/components/screenreader-only';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component/index.js';\nimport { joinStrings } from '../internal/utils/strings';\nimport { GeneratedAnalyticsMetadataFileInputComponent } from './analytics-metadata/interfaces';\nimport { FileInputProps } from './interfaces';\n\nimport styles from './styles.css.js';\n\ninterface InternalFileInputProps {\n __inputClassName?: string;\n __inputNativeAttributes?: React.InputHTMLAttributes<HTMLInputElement> | Record<`data-${string}`, string>;\n __injectAnalyticsComponentMetadata?: boolean;\n}\n\nconst InternalFileInput = React.forwardRef(\n (\n {\n accept,\n ariaRequired,\n ariaLabel,\n multiple = false,\n value,\n onChange,\n variant = 'button',\n children,\n __internalRootRef,\n __inputClassName,\n __inputNativeAttributes,\n __injectAnalyticsComponentMetadata,\n ...restProps\n }: FileInputProps & InternalBaseComponentProps & InternalFileInputProps,\n ref: Ref<FileInputProps.Ref>\n ) => {\n const baseProps = getBaseProps(restProps);\n const uploadInputRef = useRef<HTMLInputElement>(null);\n const containerRef = useRef<HTMLButtonElement>(null);\n const mergedRef = useMergeRefs(__internalRootRef, containerRef);\n\n const uploadButtonLabelId = useUniqueId('upload-button-label');\n const formFieldContext = useFormFieldContext(restProps);\n const selfControlId = useUniqueId('upload-input');\n const controlId = formFieldContext.controlId ?? selfControlId;\n\n useForwardFocus(ref, uploadInputRef);\n\n const [isFocused, setIsFocused] = useState(false);\n const onUploadButtonClick = () => uploadInputRef.current?.click();\n const onUploadInputFocus = () => {\n setIsFocused(true);\n };\n const onUploadInputBlur = () => setIsFocused(false);\n\n const onUploadInputChange = ({ target }: ChangeEvent<HTMLInputElement>) => {\n fireNonCancelableEvent(onChange, { value: target.files ? Array.from(target.files) : [] });\n };\n\n checkControlled('FileInput', 'value', value, 'onChange', onChange);\n\n const nativeAttributes: React.HTMLAttributes<HTMLInputElement> = {\n 'aria-label': ariaLabel || children,\n 'aria-labelledby': joinStrings(formFieldContext.ariaLabelledby, uploadButtonLabelId),\n 'aria-describedby': formFieldContext.ariaDescribedby,\n ...__inputNativeAttributes,\n };\n if (formFieldContext.invalid) {\n nativeAttributes['aria-invalid'] = true;\n }\n if (ariaRequired) {\n nativeAttributes['aria-required'] = true;\n }\n\n if (variant === 'icon' && !ariaLabel) {\n warnOnce('FileInput', 'Aria label is required with icon variant.');\n }\n\n // Synchronizing component's value with the native file input state.\n useEffect(() => {\n /* istanbul ignore next: The DataTransfer is not available in jsdom. */\n if (window.DataTransfer) {\n const dataTransfer = new DataTransfer();\n for (const file of value) {\n dataTransfer.items.add(file);\n }\n uploadInputRef.current!.files = dataTransfer.files;\n }\n if (uploadInputRef.current) {\n uploadInputRef.current.value = ''; // reset value to allow calling onChange when the same file is uploaded again\n }\n }, [value]);\n\n const { tabIndex } = useSingleTabStopNavigation(uploadInputRef);\n\n const analyticsLabel = variant === 'button' && children ? 'button' : 'input';\n const componentAnalyticsMetadata: GeneratedAnalyticsMetadataFileInputComponent = {\n name: 'awsui.FileInput',\n label: analyticsLabel,\n };\n\n const analyticsMetadata: GeneratedAnalyticsMetadataFragment = { detail: { label: analyticsLabel } };\n if (__injectAnalyticsComponentMetadata) {\n analyticsMetadata.component = componentAnalyticsMetadata;\n }\n\n return (\n <div\n {...baseProps}\n ref={mergedRef}\n className={clsx(baseProps.className, styles.root)}\n {...getAnalyticsMetadataAttribute(analyticsMetadata)}\n >\n {/* This is the actual interactive and accessible file-upload element. */}\n {/* It is visually hidden to achieve the desired UX design. */}\n <input\n id={controlId}\n ref={uploadInputRef}\n type=\"file\"\n hidden={false}\n multiple={multiple}\n accept={accept}\n onChange={onUploadInputChange}\n onFocus={onUploadInputFocus}\n onBlur={onUploadInputBlur}\n className={clsx(styles['file-input'], styles.hidden, __inputClassName)}\n tabIndex={tabIndex}\n {...nativeAttributes}\n />\n\n {/* The button is decorative. It dispatches clicks to the file input and is ARIA-hidden. */}\n {/* When the input is focused the focus outline is forced on the button. */}\n <InternalButton\n iconName=\"upload\"\n variant={variant === 'icon' ? 'icon' : undefined}\n formAction=\"none\"\n onClick={onUploadButtonClick}\n className={clsx(styles['file-input-button'], {\n [styles['force-focus-outline-button']]: isFocused && variant === 'button',\n [styles['force-focus-outline-icon']]: isFocused && variant === 'icon',\n })}\n nativeButtonAttributes={{ tabIndex: -1, 'aria-hidden': true }}\n __skipNativeAttributesWarnings={true}\n >\n {variant === 'button' && children}\n </InternalButton>\n\n {/* The file input needs to be labelled with provided content. Can't use the button because it is ARIA-hidden. */}\n <ScreenreaderOnly id={uploadButtonLabelId}>{ariaLabel || children}</ScreenreaderOnly>\n </div>\n );\n }\n);\n\nexport default InternalFileInput;\n"]}
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/file-input/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAoB,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC7E,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AACpG,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAC3F,OAAO,EAEL,6BAA6B,GAC9B,MAAM,kEAAkE,CAAC;AAE1E,OAAO,cAAc,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,gBAAgB,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,eAAe,MAAM,oCAAoC,CAAC;AACjE,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAE9D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAIxD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAQrC,MAAM,iBAAiB,GAAG,KAAK,CAAC,UAAU,CACxC,CACE,EACE,MAAM,EACN,YAAY,EACZ,S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MAAM,CAAC,mBAAmB,CAAC,EAAE;gBAC3C,CAAC,MAAM,CAAC,4BAA4B,CAAC,CAAC,EAAE,SAAS,IAAI,OAAO,KAAK,QAAQ;gBACzE,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC,EAAE,SAAS,IAAI,OAAO,KAAK,MAAM;aACtE,CAAC,EACF,sBAAsB,EAAE;gBACtB,QAAQ,EAAE,CAAC,CAAC;gBACZ,aAAa,EAAE,IAAI;gBACnB,wFAAwF;gBACxF,WAAW,EAAE,CAAC,KAAuB,EAAE,EAAE,CAAC,KAAK,CAAC,cAAc,EAAE;aACjE,EACD,8BAA8B,EAAE,IAAI,IAEnC,OAAO,KAAK,QAAQ,IAAI,QAAQ,CAClB;QAGjB,oBAAC,gBAAgB,IAAC,EAAE,EAAE,mBAAmB,IAAG,SAAS,IAAI,QAAQ,CAAoB,CACjF,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { ChangeEvent, Ref, useEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, useUniqueId, warnOnce } from '@cloudscape-design/component-toolkit/internal';\nimport { useSingleTabStopNavigation } from '@cloudscape-design/component-toolkit/internal';\nimport {\n GeneratedAnalyticsMetadataFragment,\n getAnalyticsMetadataAttribute,\n} from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport InternalButton from '../button/internal';\nimport { useFormFieldContext } from '../contexts/form-field';\nimport { getBaseProps } from '../internal/base-component/index.js';\nimport ScreenreaderOnly from '../internal/components/screenreader-only';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component/index.js';\nimport { joinStrings } from '../internal/utils/strings';\nimport { GeneratedAnalyticsMetadataFileInputComponent } from './analytics-metadata/interfaces';\nimport { FileInputProps } from './interfaces';\n\nimport styles from './styles.css.js';\n\ninterface InternalFileInputProps {\n __inputClassName?: string;\n __inputNativeAttributes?: React.InputHTMLAttributes<HTMLInputElement> | Record<`data-${string}`, string>;\n __injectAnalyticsComponentMetadata?: boolean;\n}\n\nconst InternalFileInput = React.forwardRef(\n (\n {\n accept,\n ariaRequired,\n ariaLabel,\n multiple = false,\n value,\n onChange,\n variant = 'button',\n children,\n __internalRootRef,\n __inputClassName,\n __inputNativeAttributes,\n __injectAnalyticsComponentMetadata,\n ...restProps\n }: FileInputProps & InternalBaseComponentProps & InternalFileInputProps,\n ref: Ref<FileInputProps.Ref>\n ) => {\n const baseProps = getBaseProps(restProps);\n const uploadInputRef = useRef<HTMLInputElement>(null);\n const containerRef = useRef<HTMLButtonElement>(null);\n const mergedRef = useMergeRefs(__internalRootRef, containerRef);\n\n const uploadButtonLabelId = useUniqueId('upload-button-label');\n const formFieldContext = useFormFieldContext(restProps);\n const selfControlId = useUniqueId('upload-input');\n const controlId = formFieldContext.controlId ?? selfControlId;\n\n useForwardFocus(ref, uploadInputRef);\n\n const [isFocused, setIsFocused] = useState(false);\n const onUploadButtonClick = () => uploadInputRef.current?.click();\n const onUploadInputFocus = () => {\n setIsFocused(true);\n };\n const onUploadInputBlur = () => setIsFocused(false);\n\n const onUploadInputChange = ({ target }: ChangeEvent<HTMLInputElement>) => {\n fireNonCancelableEvent(onChange, { value: target.files ? Array.from(target.files) : [] });\n };\n\n checkControlled('FileInput', 'value', value, 'onChange', onChange);\n\n const nativeAttributes: React.HTMLAttributes<HTMLInputElement> = {\n 'aria-label': ariaLabel || children,\n 'aria-labelledby': joinStrings(formFieldContext.ariaLabelledby, uploadButtonLabelId),\n 'aria-describedby': formFieldContext.ariaDescribedby,\n ...__inputNativeAttributes,\n };\n if (formFieldContext.invalid) {\n nativeAttributes['aria-invalid'] = true;\n }\n if (ariaRequired) {\n nativeAttributes['aria-required'] = true;\n }\n\n if (variant === 'icon' && !ariaLabel) {\n warnOnce('FileInput', 'Aria label is required with icon variant.');\n }\n\n // Synchronizing component's value with the native file input state.\n useEffect(() => {\n /* istanbul ignore next: The DataTransfer is not available in jsdom. */\n if (window.DataTransfer) {\n const dataTransfer = new DataTransfer();\n for (const file of value) {\n dataTransfer.items.add(file);\n }\n uploadInputRef.current!.files = dataTransfer.files;\n }\n if (uploadInputRef.current) {\n uploadInputRef.current.value = ''; // reset value to allow calling onChange when the same file is uploaded again\n }\n }, [value]);\n\n const { tabIndex } = useSingleTabStopNavigation(uploadInputRef);\n\n const analyticsLabel = variant === 'button' && children ? 'button' : 'input';\n const componentAnalyticsMetadata: GeneratedAnalyticsMetadataFileInputComponent = {\n name: 'awsui.FileInput',\n label: analyticsLabel,\n };\n\n const analyticsMetadata: GeneratedAnalyticsMetadataFragment = { detail: { label: analyticsLabel } };\n if (__injectAnalyticsComponentMetadata) {\n analyticsMetadata.component = componentAnalyticsMetadata;\n }\n\n return (\n <div\n {...baseProps}\n ref={mergedRef}\n className={clsx(baseProps.className, styles.root)}\n {...getAnalyticsMetadataAttribute(analyticsMetadata)}\n >\n {/* This is the actual interactive and accessible file-upload element. */}\n {/* It is visually hidden to achieve the desired UX design. */}\n <input\n id={controlId}\n ref={uploadInputRef}\n type=\"file\"\n hidden={false}\n multiple={multiple}\n accept={accept}\n onChange={onUploadInputChange}\n onFocus={onUploadInputFocus}\n onBlur={onUploadInputBlur}\n className={clsx(styles['file-input'], styles.hidden, __inputClassName)}\n tabIndex={tabIndex}\n {...nativeAttributes}\n />\n\n {/* The button is decorative. It dispatches clicks to the file input and is ARIA-hidden. */}\n {/* When the input is focused the focus outline is forced on the button. */}\n <InternalButton\n iconName=\"upload\"\n variant={variant === 'icon' ? 'icon' : undefined}\n formAction=\"none\"\n onClick={onUploadButtonClick}\n className={clsx(styles['file-input-button'], {\n [styles['force-focus-outline-button']]: isFocused && variant === 'button',\n [styles['force-focus-outline-icon']]: isFocused && variant === 'icon',\n })}\n nativeButtonAttributes={{\n tabIndex: -1,\n 'aria-hidden': true,\n // AWSUI-61771 Prevent focus on the decorative button to avoid aria-hidden focus warning\n onMouseDown: (event: React.MouseEvent) => event.preventDefault(),\n }}\n __skipNativeAttributesWarnings={true}\n >\n {variant === 'button' && children}\n </InternalButton>\n\n {/* The file input needs to be labelled with provided content. Can't use the button because it is ARIA-hidden. */}\n <ScreenreaderOnly id={uploadButtonLabelId}>{ariaLabel || children}</ScreenreaderOnly>\n </div>\n );\n }\n);\n\nexport default InternalFileInput;\n"]}
|