@cloudscape-design/components 3.0.671 → 3.0.672
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/checkbox/base-checkbox.d.ts +7 -0
- package/checkbox/base-checkbox.d.ts.map +1 -1
- package/checkbox/base-checkbox.js.map +1 -1
- package/checkbox/internal.d.ts.map +1 -1
- package/checkbox/internal.js +3 -3
- package/checkbox/internal.js.map +1 -1
- package/date-picker/interfaces.d.ts +1 -1
- package/date-picker/interfaces.js.map +1 -1
- package/date-range-picker/index.d.ts.map +1 -1
- package/date-range-picker/index.js +1 -3
- package/date-range-picker/index.js.map +1 -1
- package/input/interfaces.d.ts +1 -1
- package/input/interfaces.js.map +1 -1
- package/internal/base-component/styles.scoped.css +5 -0
- package/internal/components/abstract-switch/index.d.ts +2 -1
- package/internal/components/abstract-switch/index.d.ts.map +1 -1
- package/internal/components/abstract-switch/index.js +2 -2
- package/internal/components/abstract-switch/index.js.map +1 -1
- package/internal/components/button-trigger/index.d.ts.map +1 -1
- package/internal/components/button-trigger/index.js +5 -2
- package/internal/components/button-trigger/index.js.map +1 -1
- package/internal/components/button-trigger/styles.css.js +11 -11
- package/internal/components/button-trigger/styles.scoped.css +26 -26
- package/internal/components/button-trigger/styles.selectors.js +11 -11
- package/internal/components/checkbox-icon/index.d.ts +2 -1
- package/internal/components/checkbox-icon/index.d.ts.map +1 -1
- package/internal/components/checkbox-icon/index.js +6 -2
- package/internal/components/checkbox-icon/index.js.map +1 -1
- package/internal/components/checkbox-icon/styles.css.js +9 -7
- package/internal/components/checkbox-icon/styles.scoped.css +11 -8
- package/internal/components/checkbox-icon/styles.selectors.js +9 -7
- package/internal/environment.js +1 -1
- package/internal/environment.json +1 -1
- package/internal/generated/styles/tokens.d.ts +1 -0
- package/internal/generated/styles/tokens.js +1 -0
- package/internal/generated/theming/index.cjs +33 -0
- package/internal/generated/theming/index.cjs.d.ts +8 -0
- package/internal/generated/theming/index.d.ts +8 -0
- package/internal/generated/theming/index.js +33 -0
- package/internal/manifest.json +1 -1
- package/multiselect/internal.d.ts.map +1 -1
- package/multiselect/internal.js +3 -3
- package/multiselect/internal.js.map +1 -1
- package/package.json +1 -1
- package/radio-group/interfaces.d.ts +6 -0
- package/radio-group/interfaces.d.ts.map +1 -1
- package/radio-group/interfaces.js.map +1 -1
- package/radio-group/internal.d.ts.map +1 -1
- package/radio-group/internal.js +3 -3
- package/radio-group/internal.js.map +1 -1
- package/radio-group/radio-button.d.ts +1 -0
- package/radio-group/radio-button.d.ts.map +1 -1
- package/radio-group/radio-button.js +7 -3
- package/radio-group/radio-button.js.map +1 -1
- package/radio-group/styles.css.js +10 -9
- package/radio-group/styles.scoped.css +19 -15
- package/radio-group/styles.selectors.js +10 -9
- package/select/interfaces.d.ts +5 -0
- package/select/interfaces.d.ts.map +1 -1
- package/select/interfaces.js.map +1 -1
- package/select/internal.d.ts.map +1 -1
- package/select/internal.js +2 -2
- package/select/internal.js.map +1 -1
- package/select/parts/trigger.d.ts +1 -0
- package/select/parts/trigger.d.ts.map +1 -1
- package/select/parts/trigger.js +2 -2
- package/select/parts/trigger.js.map +1 -1
- package/slider/interfaces.d.ts +6 -0
- package/slider/interfaces.d.ts.map +1 -1
- package/slider/interfaces.js.map +1 -1
- package/slider/internal.d.ts +1 -1
- package/slider/internal.d.ts.map +1 -1
- package/slider/internal.js +15 -6
- package/slider/internal.js.map +1 -1
- package/slider/styles.css.js +27 -25
- package/slider/styles.scoped.css +129 -62
- package/slider/styles.selectors.js +27 -25
- package/slider/tick-marks.d.ts +1 -0
- package/slider/tick-marks.d.ts.map +1 -1
- package/slider/tick-marks.js +2 -1
- package/slider/tick-marks.js.map +1 -1
- package/slider/utils.d.ts +1 -0
- package/slider/utils.d.ts.map +1 -1
- package/slider/utils.js +1 -0
- package/slider/utils.js.map +1 -1
- package/tiles/interfaces.d.ts +6 -0
- package/tiles/interfaces.d.ts.map +1 -1
- package/tiles/interfaces.js.map +1 -1
- package/tiles/internal.d.ts.map +1 -1
- package/tiles/internal.js +3 -3
- package/tiles/internal.js.map +1 -1
- package/tiles/styles.css.js +30 -29
- package/tiles/styles.scoped.css +75 -70
- package/tiles/styles.selectors.js +30 -29
- package/tiles/tile.d.ts +1 -0
- package/tiles/tile.d.ts.map +1 -1
- package/tiles/tile.js +4 -4
- package/tiles/tile.js.map +1 -1
- package/toggle/internal.d.ts.map +1 -1
- package/toggle/internal.js +4 -2
- package/toggle/internal.js.map +1 -1
- package/toggle/styles.css.js +10 -8
- package/toggle/styles.scoped.css +23 -14
- package/toggle/styles.selectors.js +10 -8
- package/token-group/dismiss-button.d.ts +1 -0
- package/token-group/dismiss-button.d.ts.map +1 -1
- package/token-group/dismiss-button.js +7 -2
- package/token-group/dismiss-button.js.map +1 -1
- package/token-group/interfaces.d.ts +5 -0
- package/token-group/interfaces.d.ts.map +1 -1
- package/token-group/interfaces.js.map +1 -1
- package/token-group/internal.d.ts +1 -1
- package/token-group/internal.d.ts.map +1 -1
- package/token-group/internal.js +2 -2
- package/token-group/internal.js.map +1 -1
- package/token-group/styles.css.js +10 -9
- package/token-group/styles.scoped.css +33 -19
- package/token-group/styles.selectors.js +10 -9
- package/token-group/token.d.ts +2 -1
- package/token-group/token.d.ts.map +1 -1
- package/token-group/token.js +3 -3
- package/token-group/token.js.map +1 -1
- package/top-navigation/1.0-beta/interfaces.d.ts +1 -1
- package/top-navigation/1.0-beta/interfaces.js.map +1 -1
- package/top-navigation/interfaces.d.ts +1 -1
- package/top-navigation/interfaces.js.map +1 -1
|
@@ -98,7 +98,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
98
98
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
99
99
|
SPDX-License-Identifier: Apache-2.0
|
|
100
100
|
*/
|
|
101
|
-
.
|
|
101
|
+
.awsui_root_dm8gx_r6wxu_101:not(#\9) {
|
|
102
102
|
border-collapse: separate;
|
|
103
103
|
border-spacing: 0;
|
|
104
104
|
box-sizing: border-box;
|
|
@@ -133,11 +133,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
133
133
|
-webkit-font-smoothing: auto;
|
|
134
134
|
-moz-osx-font-smoothing: auto;
|
|
135
135
|
}
|
|
136
|
-
.
|
|
136
|
+
.awsui_root_dm8gx_r6wxu_101.awsui_has-items_dm8gx_r6wxu_135:not(#\9):not(.awsui_no-padding_dm8gx_r6wxu_135) {
|
|
137
137
|
padding-block-start: var(--space-xs-zb16t3, 8px);
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
.awsui_dismiss-
|
|
140
|
+
.awsui_dismiss-button_dm8gx_r6wxu_139:not(#\9) {
|
|
141
141
|
margin-block-start: -1px;
|
|
142
142
|
margin-block-end: 0;
|
|
143
143
|
margin-inline-start: var(--space-xxs-p8yyaw, 4px);
|
|
@@ -149,14 +149,14 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
149
149
|
color: var(--color-text-button-inline-icon-default-s3yux9, #0972d3);
|
|
150
150
|
background-color: transparent;
|
|
151
151
|
}
|
|
152
|
-
body[data-awsui-focus-visible=true] .awsui_dismiss-
|
|
152
|
+
body[data-awsui-focus-visible=true] .awsui_dismiss-button_dm8gx_r6wxu_139:not(#\9):focus {
|
|
153
153
|
position: relative;
|
|
154
154
|
}
|
|
155
|
-
body[data-awsui-focus-visible=true] .awsui_dismiss-
|
|
155
|
+
body[data-awsui-focus-visible=true] .awsui_dismiss-button_dm8gx_r6wxu_139:not(#\9):focus {
|
|
156
156
|
outline: 2px dotted transparent;
|
|
157
157
|
outline-offset: calc(0px - 1px);
|
|
158
158
|
}
|
|
159
|
-
body[data-awsui-focus-visible=true] .awsui_dismiss-
|
|
159
|
+
body[data-awsui-focus-visible=true] .awsui_dismiss-button_dm8gx_r6wxu_139:not(#\9):focus::before {
|
|
160
160
|
content: " ";
|
|
161
161
|
display: block;
|
|
162
162
|
position: absolute;
|
|
@@ -170,23 +170,23 @@ body[data-awsui-focus-visible=true] .awsui_dismiss-button_dm8gx_1tp36_139:not(#\
|
|
|
170
170
|
border-end-end-radius: var(--border-radius-control-default-focus-ring-u8zbsz, 4px);
|
|
171
171
|
box-shadow: 0 0 0 2px var(--color-border-item-focused-b2ntyl, #0972d3);
|
|
172
172
|
}
|
|
173
|
-
.awsui_dismiss-
|
|
173
|
+
.awsui_dismiss-button_dm8gx_r6wxu_139:not(#\9):focus {
|
|
174
174
|
outline: none;
|
|
175
175
|
text-decoration: none;
|
|
176
176
|
}
|
|
177
|
-
.awsui_dismiss-
|
|
177
|
+
.awsui_dismiss-button_dm8gx_r6wxu_139:not(#\9):hover {
|
|
178
178
|
cursor: pointer;
|
|
179
179
|
color: var(--color-text-button-inline-icon-hover-my2daf, #033160);
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
-
.
|
|
182
|
+
.awsui_token_dm8gx_r6wxu_181:not(#\9) {
|
|
183
183
|
block-size: 100%;
|
|
184
184
|
display: flex;
|
|
185
185
|
flex-direction: column;
|
|
186
186
|
gap: var(--space-xxs-p8yyaw, 4px);
|
|
187
187
|
}
|
|
188
188
|
|
|
189
|
-
.awsui_token-
|
|
189
|
+
.awsui_token-box_dm8gx_r6wxu_188:not(#\9) {
|
|
190
190
|
block-size: 100%;
|
|
191
191
|
border-block: var(--border-field-width-09w7vk, 2px) solid var(--color-border-item-selected-k00wlz, #0972d3);
|
|
192
192
|
border-inline: var(--border-field-width-09w7vk, 2px) solid var(--color-border-item-selected-k00wlz, #0972d3);
|
|
@@ -205,38 +205,52 @@ body[data-awsui-focus-visible=true] .awsui_dismiss-button_dm8gx_1tp36_139:not(#\
|
|
|
205
205
|
box-sizing: border-box;
|
|
206
206
|
}
|
|
207
207
|
|
|
208
|
-
.awsui_token-box-
|
|
208
|
+
.awsui_token-box-error_dm8gx_r6wxu_207:not(#\9) {
|
|
209
209
|
border-color: var(--color-border-status-error-dj6icm, #d91515);
|
|
210
210
|
border-inline-start-width: var(--border-invalid-width-5ktjp2, 8px);
|
|
211
211
|
}
|
|
212
|
-
.awsui_token-box-
|
|
212
|
+
.awsui_token-box-error_dm8gx_r6wxu_207 > .awsui_dismiss-button_dm8gx_r6wxu_139:not(#\9) {
|
|
213
213
|
color: var(--color-text-interactive-default-lnx6lk, #414d5c);
|
|
214
214
|
}
|
|
215
|
-
.awsui_token-box-
|
|
215
|
+
.awsui_token-box-error_dm8gx_r6wxu_207 > .awsui_dismiss-button_dm8gx_r6wxu_139:not(#\9):hover {
|
|
216
216
|
color: var(--color-text-interactive-hover-mj8add, #000716);
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
-
.awsui_token-box-
|
|
219
|
+
.awsui_token-box-warning_dm8gx_r6wxu_218:not(#\9) {
|
|
220
220
|
border-color: var(--color-border-status-warning-52glov, #8d6605);
|
|
221
221
|
border-inline-start-width: var(--border-invalid-width-5ktjp2, 8px);
|
|
222
222
|
}
|
|
223
|
-
.awsui_token-box-
|
|
223
|
+
.awsui_token-box-warning_dm8gx_r6wxu_218 > .awsui_dismiss-button_dm8gx_r6wxu_139:not(#\9) {
|
|
224
224
|
color: var(--color-text-interactive-default-lnx6lk, #414d5c);
|
|
225
225
|
}
|
|
226
|
-
.awsui_token-box-
|
|
226
|
+
.awsui_token-box-warning_dm8gx_r6wxu_218 > .awsui_dismiss-button_dm8gx_r6wxu_139:not(#\9):hover {
|
|
227
227
|
color: var(--color-text-interactive-hover-mj8add, #000716);
|
|
228
228
|
}
|
|
229
229
|
|
|
230
|
-
.awsui_token-box-
|
|
230
|
+
.awsui_token-box-readonly_dm8gx_r6wxu_229:not(#\9) {
|
|
231
|
+
border-color: var(--color-border-input-disabled-rx2aau, #e9ebed);
|
|
232
|
+
background-color: var(--color-background-container-content-4un1ap, #ffffff);
|
|
233
|
+
pointer-events: none;
|
|
234
|
+
}
|
|
235
|
+
.awsui_token-box-readonly_dm8gx_r6wxu_229 > .awsui_dismiss-button_dm8gx_r6wxu_139:not(#\9) {
|
|
236
|
+
color: var(--color-text-button-inline-icon-disabled-mz5gmn, #9ba7b6);
|
|
237
|
+
}
|
|
238
|
+
.awsui_token-box-readonly_dm8gx_r6wxu_229 > .awsui_dismiss-button_dm8gx_r6wxu_139:not(#\9):hover {
|
|
239
|
+
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
240
|
+
cursor: initial;
|
|
241
|
+
color: var(--color-text-button-inline-icon-disabled-mz5gmn, #9ba7b6);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.awsui_token-box-disabled_dm8gx_r6wxu_243.awsui_token-box-disabled_dm8gx_r6wxu_243:not(#\9) {
|
|
231
245
|
border-color: var(--color-border-control-disabled-bv2kkn, #d1d5db);
|
|
232
246
|
background-color: var(--color-background-container-content-4un1ap, #ffffff);
|
|
233
247
|
color: var(--color-text-disabled-f4c52h, #9ba7b6);
|
|
234
248
|
pointer-events: none;
|
|
235
249
|
}
|
|
236
|
-
.awsui_token-box-
|
|
250
|
+
.awsui_token-box-disabled_dm8gx_r6wxu_243.awsui_token-box-disabled_dm8gx_r6wxu_243 > .awsui_dismiss-button_dm8gx_r6wxu_139:not(#\9) {
|
|
237
251
|
color: var(--color-text-button-inline-icon-disabled-mz5gmn, #9ba7b6);
|
|
238
252
|
}
|
|
239
|
-
.awsui_token-box-
|
|
253
|
+
.awsui_token-box-disabled_dm8gx_r6wxu_243.awsui_token-box-disabled_dm8gx_r6wxu_243 > .awsui_dismiss-button_dm8gx_r6wxu_139:not(#\9):hover {
|
|
240
254
|
cursor: initial;
|
|
241
255
|
color: var(--color-text-button-inline-icon-disabled-mz5gmn, #9ba7b6);
|
|
242
256
|
}
|
|
@@ -2,14 +2,15 @@
|
|
|
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
|
-
"has-items": "awsui_has-
|
|
7
|
-
"no-padding": "awsui_no-
|
|
8
|
-
"dismiss-button": "awsui_dismiss-
|
|
9
|
-
"token": "
|
|
10
|
-
"token-box": "awsui_token-
|
|
11
|
-
"token-box-error": "awsui_token-box-
|
|
12
|
-
"token-box-warning": "awsui_token-box-
|
|
13
|
-
"token-box-
|
|
5
|
+
"root": "awsui_root_dm8gx_r6wxu_101",
|
|
6
|
+
"has-items": "awsui_has-items_dm8gx_r6wxu_135",
|
|
7
|
+
"no-padding": "awsui_no-padding_dm8gx_r6wxu_135",
|
|
8
|
+
"dismiss-button": "awsui_dismiss-button_dm8gx_r6wxu_139",
|
|
9
|
+
"token": "awsui_token_dm8gx_r6wxu_181",
|
|
10
|
+
"token-box": "awsui_token-box_dm8gx_r6wxu_188",
|
|
11
|
+
"token-box-error": "awsui_token-box-error_dm8gx_r6wxu_207",
|
|
12
|
+
"token-box-warning": "awsui_token-box-warning_dm8gx_r6wxu_218",
|
|
13
|
+
"token-box-readonly": "awsui_token-box-readonly_dm8gx_r6wxu_229",
|
|
14
|
+
"token-box-disabled": "awsui_token-box-disabled_dm8gx_r6wxu_243"
|
|
14
15
|
};
|
|
15
16
|
|
package/token-group/token.d.ts
CHANGED
|
@@ -5,12 +5,13 @@ interface TokenProps {
|
|
|
5
5
|
dismissLabel?: string;
|
|
6
6
|
onDismiss?: () => void;
|
|
7
7
|
disabled?: boolean;
|
|
8
|
+
readOnly?: boolean;
|
|
8
9
|
errorText?: React.ReactNode;
|
|
9
10
|
errorIconAriaLabel?: string;
|
|
10
11
|
warningText?: React.ReactNode;
|
|
11
12
|
warningIconAriaLabel?: string;
|
|
12
13
|
className?: string;
|
|
13
14
|
}
|
|
14
|
-
export declare function Token({ ariaLabel, disabled, dismissLabel, onDismiss, children, errorText, warningText, errorIconAriaLabel, warningIconAriaLabel, ...restProps }: TokenProps): JSX.Element;
|
|
15
|
+
export declare function Token({ ariaLabel, disabled, readOnly, dismissLabel, onDismiss, children, errorText, warningText, errorIconAriaLabel, warningIconAriaLabel, ...restProps }: TokenProps): JSX.Element;
|
|
15
16
|
export {};
|
|
16
17
|
//# sourceMappingURL=token.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../../../src/token-group/token.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,UAAU,UAAU;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,KAAK,CAAC,EACpB,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,SAAS,EACT,WAAW,EACX,kBAAkB,EAClB,oBAAoB,EACpB,GAAG,SAAS,EACb,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../../../src/token-group/token.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,UAAU,UAAU;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,KAAK,CAAC,EACpB,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,SAAS,EACT,WAAW,EACX,kBAAkB,EAClB,oBAAoB,EACpB,GAAG,SAAS,EACb,EAAE,UAAU,eA0CZ"}
|
package/token-group/token.js
CHANGED
|
@@ -9,15 +9,15 @@ import { FormFieldError, FormFieldWarning } from '../form-field/internal';
|
|
|
9
9
|
import { useUniqueId } from '../internal/hooks/use-unique-id';
|
|
10
10
|
import { getBaseProps } from '../internal/base-component';
|
|
11
11
|
export function Token(_a) {
|
|
12
|
-
var { ariaLabel, disabled, dismissLabel, onDismiss, children, errorText, warningText, errorIconAriaLabel, warningIconAriaLabel } = _a, restProps = __rest(_a, ["ariaLabel", "disabled", "dismissLabel", "onDismiss", "children", "errorText", "warningText", "errorIconAriaLabel", "warningIconAriaLabel"]);
|
|
12
|
+
var { ariaLabel, disabled, readOnly, dismissLabel, onDismiss, children, errorText, warningText, errorIconAriaLabel, warningIconAriaLabel } = _a, restProps = __rest(_a, ["ariaLabel", "disabled", "readOnly", "dismissLabel", "onDismiss", "children", "errorText", "warningText", "errorIconAriaLabel", "warningIconAriaLabel"]);
|
|
13
13
|
const errorId = useUniqueId('error');
|
|
14
14
|
const warningId = useUniqueId('warning');
|
|
15
15
|
const baseProps = getBaseProps(restProps);
|
|
16
16
|
const showWarning = warningText && !errorText;
|
|
17
17
|
return (React.createElement("div", Object.assign({}, baseProps, { className: clsx(styles.token, baseProps.className), role: "group", "aria-label": ariaLabel, "aria-describedby": errorText ? errorId : warningText ? warningId : undefined, "aria-disabled": disabled }),
|
|
18
|
-
React.createElement("div", { className: clsx(styles['token-box'], disabled && styles['token-box-disabled'], errorText && styles['token-box-error'], showWarning && styles['token-box-warning']) },
|
|
18
|
+
React.createElement("div", { className: clsx(styles['token-box'], disabled && styles['token-box-disabled'], readOnly && styles['token-box-readonly'], errorText && styles['token-box-error'], showWarning && styles['token-box-warning']) },
|
|
19
19
|
children,
|
|
20
|
-
onDismiss && React.createElement(DismissButton, { disabled: disabled, dismissLabel: dismissLabel, onDismiss: onDismiss })),
|
|
20
|
+
onDismiss && (React.createElement(DismissButton, { disabled: disabled, dismissLabel: dismissLabel, onDismiss: onDismiss, readOnly: readOnly }))),
|
|
21
21
|
errorText && (React.createElement(FormFieldError, { id: errorId, errorIconAriaLabel: errorIconAriaLabel }, errorText)),
|
|
22
22
|
showWarning && (React.createElement(FormFieldWarning, { id: warningId, warningIconAriaLabel: warningIconAriaLabel }, warningText))));
|
|
23
23
|
}
|
package/token-group/token.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token.js","sourceRoot":"","sources":["../../../src/token-group/token.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;;AAEtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"token.js","sourceRoot":"","sources":["../../../src/token-group/token.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;;AAEtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAgB1D,MAAM,UAAU,KAAK,CAAC,EAYT;QAZS,EACpB,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,SAAS,EACT,WAAW,EACX,kBAAkB,EAClB,oBAAoB,OAET,EADR,SAAS,cAXQ,wJAYrB,CADa;IAEZ,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;IACrC,MAAM,SAAS,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;IACzC,MAAM,SAAS,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;IAE1C,MAAM,WAAW,GAAG,WAAW,IAAI,CAAC,SAAS,CAAC;IAE9C,OAAO,CACL,6CACM,SAAS,IACb,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,SAAS,CAAC,EAClD,IAAI,EAAC,OAAO,gBACA,SAAS,sBACH,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,mBAC5D,QAAQ;QAEvB,6BACE,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,WAAW,CAAC,EACnB,QAAQ,IAAI,MAAM,CAAC,oBAAoB,CAAC,EACxC,QAAQ,IAAI,MAAM,CAAC,oBAAoB,CAAC,EACxC,SAAS,IAAI,MAAM,CAAC,iBAAiB,CAAC,EACtC,WAAW,IAAI,MAAM,CAAC,mBAAmB,CAAC,CAC3C;YAEA,QAAQ;YACR,SAAS,IAAI,CACZ,oBAAC,aAAa,IAAC,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAC5G,CACG;QACL,SAAS,IAAI,CACZ,oBAAC,cAAc,IAAC,EAAE,EAAE,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,IAChE,SAAS,CACK,CAClB;QACA,WAAW,IAAI,CACd,oBAAC,gBAAgB,IAAC,EAAE,EAAE,SAAS,EAAE,oBAAoB,EAAE,oBAAoB,IACxE,WAAW,CACK,CACpB,CACG,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport DismissButton from './dismiss-button';\nimport styles from './styles.css.js';\nimport { FormFieldError, FormFieldWarning } from '../form-field/internal';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { getBaseProps } from '../internal/base-component';\n\ninterface TokenProps {\n children: React.ReactNode;\n ariaLabel?: string;\n dismissLabel?: string;\n onDismiss?: () => void;\n disabled?: boolean;\n readOnly?: boolean;\n errorText?: React.ReactNode;\n errorIconAriaLabel?: string;\n warningText?: React.ReactNode;\n warningIconAriaLabel?: string;\n className?: string;\n}\n\nexport function Token({\n ariaLabel,\n disabled,\n readOnly,\n dismissLabel,\n onDismiss,\n children,\n errorText,\n warningText,\n errorIconAriaLabel,\n warningIconAriaLabel,\n ...restProps\n}: TokenProps) {\n const errorId = useUniqueId('error');\n const warningId = useUniqueId('warning');\n const baseProps = getBaseProps(restProps);\n\n const showWarning = warningText && !errorText;\n\n return (\n <div\n {...baseProps}\n className={clsx(styles.token, baseProps.className)}\n role=\"group\"\n aria-label={ariaLabel}\n aria-describedby={errorText ? errorId : warningText ? warningId : undefined}\n aria-disabled={disabled}\n >\n <div\n className={clsx(\n styles['token-box'],\n disabled && styles['token-box-disabled'],\n readOnly && styles['token-box-readonly'],\n errorText && styles['token-box-error'],\n showWarning && styles['token-box-warning']\n )}\n >\n {children}\n {onDismiss && (\n <DismissButton disabled={disabled} dismissLabel={dismissLabel} onDismiss={onDismiss} readOnly={readOnly} />\n )}\n </div>\n {errorText && (\n <FormFieldError id={errorId} errorIconAriaLabel={errorIconAriaLabel}>\n {errorText}\n </FormFieldError>\n )}\n {showWarning && (\n <FormFieldWarning id={warningId} warningIconAriaLabel={warningIconAriaLabel}>\n {warningText}\n </FormFieldWarning>\n )}\n </div>\n );\n}\n"]}
|
|
@@ -46,7 +46,7 @@ export interface TopNavigationProps extends BaseComponentProps {
|
|
|
46
46
|
* ### menu-dropdown
|
|
47
47
|
*
|
|
48
48
|
* * `description` (string) - The description displayed inside the dropdown.
|
|
49
|
-
* * `items` (ButtonDropdownProps.Items) - An array of dropdown items. This follows the same structure as the `items` property of the [button dropdown component](/components/button-dropdown).
|
|
49
|
+
* * `items` (ButtonDropdownProps.Items) - An array of dropdown items. This follows the same structure as the `items` property of the [button dropdown component](/components/button-dropdown), with the exception of the checkbox item type.
|
|
50
50
|
* * `onItemClick` (NonCancelableEventHandler<ButtonDropdownProps.ItemClickDetails>) - Specifies the event handler called when a dropdown item is selected.
|
|
51
51
|
*/
|
|
52
52
|
utilities?: ReadonlyArray<TopNavigationProps.Utility>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/top-navigation/1.0-beta/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { CancelableEventHandler } from '../../internal/events';\nimport { BaseComponentProps } from '../../internal/base-component';\nimport { IconProps } from '../../icon/interfaces';\nimport { ButtonDropdownProps } from '../../button-dropdown/interfaces';\n\nexport interface TopNavigationProps extends BaseComponentProps {\n /**\n * Properties describing the product identity. They are as follows:\n *\n * * `title` (string) - Specifies the title text.\n * * `logo` ({ src: string, alt: string }) - Specifies the logo for the product.\n * * `href` (string) - Specifies the `href` that the header links to.\n * * `onFollow` (() => void) - Specifies the event handler called when the identity is clicked without any modifier keys.\n */\n identity: TopNavigationProps.Identity;\n\n /**\n * Use with an input or autosuggest control for a global search query.\n */\n search?: React.ReactNode;\n\n /**\n * A list of utility navigation elements.\n * The supported utility types are: `button` and `menu-dropdown`.\n *\n * The following properties are supported across all utility types:\n *\n * * `type` (string) - The type of the utility. Can be `button` or `menu-dropdown`.\n * * `text` (string) - Specifies the text shown in the top navigation or the title inside the dropdown if no explicit `title` property is set.\n * * `title` (string) - The title displayed inside the dropdown.\n * * `iconName` (string) - The name of an existing icon to display next to the utility.\n * * `iconUrl` (string) - Specifies the URL of a custom icon. Use this property if the icon you want isn't available.\n * * `iconAlt` (string) - Specifies alternate text for a custom icon provided using `iconUrl`. We recommend that you provide this for accessibility.\n * * `iconSvg` (string) - Specifies the SVG of a custom icon.\n * * `ariaLabel` (string) - Adds `aria-label` to the button or dropdown trigger. This is recommended for accessibility if a text is not provided.\n * * `badge` (boolean) - Adds a badge to the corner of the icon to indicate a state change. For example: Unread notifications.\n * * `disableTextCollapse` (boolean) - Prevents the utility text from being hidden on smaller screens.\n * * `disableUtilityCollapse` (boolean) - Prevents the utility from being moved to an overflow menu on smaller screens.\n *\n * ### button\n *\n * * `variant` ('primary-button' | 'link') - The visual appearance of the button. The default value is 'link'.\n * * `href` (string) - Specifies the `href` for a link styled as a button.\n * * `external` (boolean) - Marks the link as external by adding an icon after the text. When clicked, the link opens in a new tab.\n * * `externalIconAriaLabel` (string) - Adds an `aria-label` for the external icon.\n * * `onClick` (() => void) - Specifies the event handler called when the utility is clicked.\n *\n * ### menu-dropdown\n *\n * * `description` (string) - The description displayed inside the dropdown.\n * * `items` (ButtonDropdownProps.Items) - An array of dropdown items. This follows the same structure as the `items` property of the [button dropdown component](/components/button-dropdown).\n * * `onItemClick` (NonCancelableEventHandler<ButtonDropdownProps.ItemClickDetails>) - Specifies the event handler called when a dropdown item is selected.\n */\n utilities?: ReadonlyArray<TopNavigationProps.Utility>;\n\n /**\n * An object containing all the localized strings required by the component.\n */\n i18nStrings: TopNavigationProps.I18nStrings;\n}\n\nexport namespace TopNavigationProps {\n export interface Identity {\n title?: string;\n logo?: Logo;\n href: string;\n onFollow?: CancelableEventHandler;\n }\n\n export interface Logo {\n src: string;\n alt?: string;\n }\n\n interface BaseUtility {\n text?: string;\n title?: string;\n iconName?: IconProps.Name;\n iconUrl?: string;\n iconAlt?: string;\n iconSvg?: React.ReactNode;\n ariaLabel?: string;\n\n badge?: boolean;\n disableUtilityCollapse?: boolean;\n disableTextCollapse?: boolean;\n }\n\n export interface MenuDropdownUtility extends BaseUtility {\n type: 'menu-dropdown';\n description?: string;\n items: ButtonDropdownProps.Items;\n onItemClick?: CancelableEventHandler<ButtonDropdownProps.ItemClickDetails>;\n }\n\n export interface ButtonUtility extends BaseUtility {\n type: 'button';\n variant?: 'primary-button' | 'link';\n onClick?: CancelableEventHandler;\n href?: string;\n external?: boolean;\n externalIconAriaLabel?: string;\n }\n\n export type Utility = MenuDropdownUtility | ButtonUtility;\n\n export interface I18nStrings {\n searchIconAriaLabel?: string;\n searchDismissIconAriaLabel?: string;\n overflowMenuTriggerText: string;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/top-navigation/1.0-beta/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { CancelableEventHandler } from '../../internal/events';\nimport { BaseComponentProps } from '../../internal/base-component';\nimport { IconProps } from '../../icon/interfaces';\nimport { ButtonDropdownProps } from '../../button-dropdown/interfaces';\n\nexport interface TopNavigationProps extends BaseComponentProps {\n /**\n * Properties describing the product identity. They are as follows:\n *\n * * `title` (string) - Specifies the title text.\n * * `logo` ({ src: string, alt: string }) - Specifies the logo for the product.\n * * `href` (string) - Specifies the `href` that the header links to.\n * * `onFollow` (() => void) - Specifies the event handler called when the identity is clicked without any modifier keys.\n */\n identity: TopNavigationProps.Identity;\n\n /**\n * Use with an input or autosuggest control for a global search query.\n */\n search?: React.ReactNode;\n\n /**\n * A list of utility navigation elements.\n * The supported utility types are: `button` and `menu-dropdown`.\n *\n * The following properties are supported across all utility types:\n *\n * * `type` (string) - The type of the utility. Can be `button` or `menu-dropdown`.\n * * `text` (string) - Specifies the text shown in the top navigation or the title inside the dropdown if no explicit `title` property is set.\n * * `title` (string) - The title displayed inside the dropdown.\n * * `iconName` (string) - The name of an existing icon to display next to the utility.\n * * `iconUrl` (string) - Specifies the URL of a custom icon. Use this property if the icon you want isn't available.\n * * `iconAlt` (string) - Specifies alternate text for a custom icon provided using `iconUrl`. We recommend that you provide this for accessibility.\n * * `iconSvg` (string) - Specifies the SVG of a custom icon.\n * * `ariaLabel` (string) - Adds `aria-label` to the button or dropdown trigger. This is recommended for accessibility if a text is not provided.\n * * `badge` (boolean) - Adds a badge to the corner of the icon to indicate a state change. For example: Unread notifications.\n * * `disableTextCollapse` (boolean) - Prevents the utility text from being hidden on smaller screens.\n * * `disableUtilityCollapse` (boolean) - Prevents the utility from being moved to an overflow menu on smaller screens.\n *\n * ### button\n *\n * * `variant` ('primary-button' | 'link') - The visual appearance of the button. The default value is 'link'.\n * * `href` (string) - Specifies the `href` for a link styled as a button.\n * * `external` (boolean) - Marks the link as external by adding an icon after the text. When clicked, the link opens in a new tab.\n * * `externalIconAriaLabel` (string) - Adds an `aria-label` for the external icon.\n * * `onClick` (() => void) - Specifies the event handler called when the utility is clicked.\n *\n * ### menu-dropdown\n *\n * * `description` (string) - The description displayed inside the dropdown.\n * * `items` (ButtonDropdownProps.Items) - An array of dropdown items. This follows the same structure as the `items` property of the [button dropdown component](/components/button-dropdown), with the exception of the checkbox item type.\n * * `onItemClick` (NonCancelableEventHandler<ButtonDropdownProps.ItemClickDetails>) - Specifies the event handler called when a dropdown item is selected.\n */\n utilities?: ReadonlyArray<TopNavigationProps.Utility>;\n\n /**\n * An object containing all the localized strings required by the component.\n */\n i18nStrings: TopNavigationProps.I18nStrings;\n}\n\nexport namespace TopNavigationProps {\n export interface Identity {\n title?: string;\n logo?: Logo;\n href: string;\n onFollow?: CancelableEventHandler;\n }\n\n export interface Logo {\n src: string;\n alt?: string;\n }\n\n interface BaseUtility {\n text?: string;\n title?: string;\n iconName?: IconProps.Name;\n iconUrl?: string;\n iconAlt?: string;\n iconSvg?: React.ReactNode;\n ariaLabel?: string;\n\n badge?: boolean;\n disableUtilityCollapse?: boolean;\n disableTextCollapse?: boolean;\n }\n\n export interface MenuDropdownUtility extends BaseUtility {\n type: 'menu-dropdown';\n description?: string;\n items: ButtonDropdownProps.Items;\n onItemClick?: CancelableEventHandler<ButtonDropdownProps.ItemClickDetails>;\n }\n\n export interface ButtonUtility extends BaseUtility {\n type: 'button';\n variant?: 'primary-button' | 'link';\n onClick?: CancelableEventHandler;\n href?: string;\n external?: boolean;\n externalIconAriaLabel?: string;\n }\n\n export type Utility = MenuDropdownUtility | ButtonUtility;\n\n export interface I18nStrings {\n searchIconAriaLabel?: string;\n searchDismissIconAriaLabel?: string;\n overflowMenuTriggerText: string;\n }\n}\n"]}
|
|
@@ -50,7 +50,7 @@ export interface TopNavigationProps extends BaseComponentProps {
|
|
|
50
50
|
* ### menu-dropdown
|
|
51
51
|
*
|
|
52
52
|
* * `description` (string) - The description displayed inside the dropdown.
|
|
53
|
-
* * `items` (ButtonDropdownProps.Items) - An array of dropdown items. This follows the same structure as the `items` property of the [button dropdown component](/components/button-dropdown).
|
|
53
|
+
* * `items` (ButtonDropdownProps.Items) - An array of dropdown items. This follows the same structure as the `items` property of the [button dropdown component](/components/button-dropdown), with the exception of the checkbox item type.
|
|
54
54
|
* * `onItemClick` (NonCancelableEventHandler<ButtonDropdownProps.ItemClickDetails>) - Specifies the event handler called when a dropdown item is selected.
|
|
55
55
|
* * `onItemFollow` (NonCancelableEventHandler<ButtonDropdownProps.ItemClickDetails>) - Specifies the event handler called when a dropdown item is selected without pressing modifier keys, and the item has an `href` set.
|
|
56
56
|
* * `expandableGroups` (boolean) - Controls expandability of the item groups.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/top-navigation/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { CancelableEventHandler } from '../internal/events';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { IconProps } from '../icon/interfaces';\nimport { ButtonDropdownProps } from '../button-dropdown/interfaces';\nimport { ButtonProps } from '../button/interfaces';\n\nexport interface TopNavigationProps extends BaseComponentProps {\n /**\n * Properties describing the product identity. They are as follows:\n *\n * * `title` (string) - Specifies the title text.\n * * `logo` ({ src: string, alt: string }) - Specifies the logo for the product. Use fixed width and height for SVG images to ensure proper rendering.\n * * `href` (string) - Specifies the `href` that the header links to.\n * * `onFollow` (() => void) - Specifies the event handler called when the identity is clicked without any modifier keys.\n */\n identity: TopNavigationProps.Identity;\n\n /**\n * Use with an input or autosuggest control for a global search query.\n */\n search?: React.ReactNode;\n\n /**\n * A list of utility navigation elements.\n * The supported utility types are: `button` and `menu-dropdown`.\n *\n * The following properties are supported across all utility types:\n *\n * * `type` (string) - The type of the utility. Can be `button` or `menu-dropdown`.\n * * `text` (string) - Specifies the text shown in the top navigation or the title inside the dropdown if no explicit `title` property is set.\n * * `title` (string) - The title displayed inside the dropdown.\n * * `iconName` (string) - The name of an existing icon to display next to the utility.\n * * `iconUrl` (string) - Specifies the URL of a custom icon. Use this property if the icon you want isn't available.\n * * `iconAlt` (string) - Specifies alternate text for a custom icon provided using `iconUrl`. We recommend that you provide this for accessibility.\n * * `iconSvg` (string) - Specifies the SVG of a custom icon.\n * * `ariaLabel` (string) - Adds `aria-label` to the button or dropdown trigger. This is recommended for accessibility if a text is not provided.\n * * `badge` (boolean) - Adds a badge to the corner of the icon to indicate a state change. For example: Unread notifications.\n * * `disableTextCollapse` (boolean) - Prevents the utility text from being hidden on smaller screens.\n * * `disableUtilityCollapse` (boolean) - Prevents the utility from being moved to an overflow menu on smaller screens.\n *\n * ### button\n *\n * * `variant` ('primary-button' | 'link') - The visual appearance of the button. The default value is 'link'.\n * * `href` (string) - Specifies the `href` for a link styled as a button.\n * * `target` (string) - Specifies where to open the linked URL (for example, to open in a new browser window or tab use `_blank`). This property only applies when an `href` is provided.\n * * `rel` (string) - Adds a `rel` attribute to the link. By default, the component sets the `rel` attribute to \"noopener noreferrer\" when `target` is `\"_blank\"`. If the `rel` property is provided, it overrides the default behavior.\n * * `external` (boolean) - Marks the link as external by adding an icon after the text. When clicked, the link opens in a new tab.\n * * `externalIconAriaLabel` (string) - Adds an `aria-label` for the external icon.\n * * `onClick` (() => void) - Specifies the event handler called when the utility is clicked.\n * * `onFollow` (() => void) - Specifies the event handler called when the utility is clicked without pressing modifier keys, and the utility has an `href` set.\n *\n * ### menu-dropdown\n *\n * * `description` (string) - The description displayed inside the dropdown.\n * * `items` (ButtonDropdownProps.Items) - An array of dropdown items. This follows the same structure as the `items` property of the [button dropdown component](/components/button-dropdown).\n * * `onItemClick` (NonCancelableEventHandler<ButtonDropdownProps.ItemClickDetails>) - Specifies the event handler called when a dropdown item is selected.\n * * `onItemFollow` (NonCancelableEventHandler<ButtonDropdownProps.ItemClickDetails>) - Specifies the event handler called when a dropdown item is selected without pressing modifier keys, and the item has an `href` set.\n * * `expandableGroups` (boolean) - Controls expandability of the item groups.\n */\n utilities?: ReadonlyArray<TopNavigationProps.Utility>;\n\n /**\n * An object containing all the localized strings required by the component.\n * @i18n\n */\n i18nStrings?: TopNavigationProps.I18nStrings;\n}\n\nexport namespace TopNavigationProps {\n export interface Identity {\n title?: string;\n logo?: Logo;\n href: string;\n onFollow?: CancelableEventHandler;\n }\n\n export interface Logo {\n src: string;\n alt?: string;\n }\n\n interface BaseUtility {\n text?: string;\n title?: string;\n iconName?: IconProps.Name;\n iconUrl?: string;\n iconAlt?: string;\n iconSvg?: React.ReactNode;\n ariaLabel?: string;\n\n badge?: boolean;\n disableUtilityCollapse?: boolean;\n disableTextCollapse?: boolean;\n }\n\n export interface MenuDropdownUtility extends BaseUtility {\n type: 'menu-dropdown';\n description?: string;\n items: ButtonDropdownProps.Items;\n expandableGroups?: boolean;\n onItemClick?: CancelableEventHandler<ButtonDropdownProps.ItemClickDetails>;\n onItemFollow?: CancelableEventHandler<ButtonDropdownProps.ItemClickDetails>;\n }\n\n export interface ButtonUtility extends BaseUtility {\n type: 'button';\n variant?: 'primary-button' | 'link';\n onClick?: CancelableEventHandler;\n onFollow?: CancelableEventHandler<ButtonProps.FollowDetail>;\n href?: string;\n target?: string;\n rel?: string;\n external?: boolean;\n externalIconAriaLabel?: string;\n }\n\n export type Utility = MenuDropdownUtility | ButtonUtility;\n\n export interface I18nStrings {\n searchIconAriaLabel?: string;\n searchDismissIconAriaLabel?: string;\n overflowMenuDismissIconAriaLabel?: string;\n overflowMenuBackIconAriaLabel?: string;\n overflowMenuTriggerText?: string;\n overflowMenuTitleText?: string;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/top-navigation/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { CancelableEventHandler } from '../internal/events';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { IconProps } from '../icon/interfaces';\nimport { ButtonDropdownProps } from '../button-dropdown/interfaces';\nimport { ButtonProps } from '../button/interfaces';\n\nexport interface TopNavigationProps extends BaseComponentProps {\n /**\n * Properties describing the product identity. They are as follows:\n *\n * * `title` (string) - Specifies the title text.\n * * `logo` ({ src: string, alt: string }) - Specifies the logo for the product. Use fixed width and height for SVG images to ensure proper rendering.\n * * `href` (string) - Specifies the `href` that the header links to.\n * * `onFollow` (() => void) - Specifies the event handler called when the identity is clicked without any modifier keys.\n */\n identity: TopNavigationProps.Identity;\n\n /**\n * Use with an input or autosuggest control for a global search query.\n */\n search?: React.ReactNode;\n\n /**\n * A list of utility navigation elements.\n * The supported utility types are: `button` and `menu-dropdown`.\n *\n * The following properties are supported across all utility types:\n *\n * * `type` (string) - The type of the utility. Can be `button` or `menu-dropdown`.\n * * `text` (string) - Specifies the text shown in the top navigation or the title inside the dropdown if no explicit `title` property is set.\n * * `title` (string) - The title displayed inside the dropdown.\n * * `iconName` (string) - The name of an existing icon to display next to the utility.\n * * `iconUrl` (string) - Specifies the URL of a custom icon. Use this property if the icon you want isn't available.\n * * `iconAlt` (string) - Specifies alternate text for a custom icon provided using `iconUrl`. We recommend that you provide this for accessibility.\n * * `iconSvg` (string) - Specifies the SVG of a custom icon.\n * * `ariaLabel` (string) - Adds `aria-label` to the button or dropdown trigger. This is recommended for accessibility if a text is not provided.\n * * `badge` (boolean) - Adds a badge to the corner of the icon to indicate a state change. For example: Unread notifications.\n * * `disableTextCollapse` (boolean) - Prevents the utility text from being hidden on smaller screens.\n * * `disableUtilityCollapse` (boolean) - Prevents the utility from being moved to an overflow menu on smaller screens.\n *\n * ### button\n *\n * * `variant` ('primary-button' | 'link') - The visual appearance of the button. The default value is 'link'.\n * * `href` (string) - Specifies the `href` for a link styled as a button.\n * * `target` (string) - Specifies where to open the linked URL (for example, to open in a new browser window or tab use `_blank`). This property only applies when an `href` is provided.\n * * `rel` (string) - Adds a `rel` attribute to the link. By default, the component sets the `rel` attribute to \"noopener noreferrer\" when `target` is `\"_blank\"`. If the `rel` property is provided, it overrides the default behavior.\n * * `external` (boolean) - Marks the link as external by adding an icon after the text. When clicked, the link opens in a new tab.\n * * `externalIconAriaLabel` (string) - Adds an `aria-label` for the external icon.\n * * `onClick` (() => void) - Specifies the event handler called when the utility is clicked.\n * * `onFollow` (() => void) - Specifies the event handler called when the utility is clicked without pressing modifier keys, and the utility has an `href` set.\n *\n * ### menu-dropdown\n *\n * * `description` (string) - The description displayed inside the dropdown.\n * * `items` (ButtonDropdownProps.Items) - An array of dropdown items. This follows the same structure as the `items` property of the [button dropdown component](/components/button-dropdown), with the exception of the checkbox item type.\n * * `onItemClick` (NonCancelableEventHandler<ButtonDropdownProps.ItemClickDetails>) - Specifies the event handler called when a dropdown item is selected.\n * * `onItemFollow` (NonCancelableEventHandler<ButtonDropdownProps.ItemClickDetails>) - Specifies the event handler called when a dropdown item is selected without pressing modifier keys, and the item has an `href` set.\n * * `expandableGroups` (boolean) - Controls expandability of the item groups.\n */\n utilities?: ReadonlyArray<TopNavigationProps.Utility>;\n\n /**\n * An object containing all the localized strings required by the component.\n * @i18n\n */\n i18nStrings?: TopNavigationProps.I18nStrings;\n}\n\nexport namespace TopNavigationProps {\n export interface Identity {\n title?: string;\n logo?: Logo;\n href: string;\n onFollow?: CancelableEventHandler;\n }\n\n export interface Logo {\n src: string;\n alt?: string;\n }\n\n interface BaseUtility {\n text?: string;\n title?: string;\n iconName?: IconProps.Name;\n iconUrl?: string;\n iconAlt?: string;\n iconSvg?: React.ReactNode;\n ariaLabel?: string;\n\n badge?: boolean;\n disableUtilityCollapse?: boolean;\n disableTextCollapse?: boolean;\n }\n\n export interface MenuDropdownUtility extends BaseUtility {\n type: 'menu-dropdown';\n description?: string;\n items: ButtonDropdownProps.Items;\n expandableGroups?: boolean;\n onItemClick?: CancelableEventHandler<ButtonDropdownProps.ItemClickDetails>;\n onItemFollow?: CancelableEventHandler<ButtonDropdownProps.ItemClickDetails>;\n }\n\n export interface ButtonUtility extends BaseUtility {\n type: 'button';\n variant?: 'primary-button' | 'link';\n onClick?: CancelableEventHandler;\n onFollow?: CancelableEventHandler<ButtonProps.FollowDetail>;\n href?: string;\n target?: string;\n rel?: string;\n external?: boolean;\n externalIconAriaLabel?: string;\n }\n\n export type Utility = MenuDropdownUtility | ButtonUtility;\n\n export interface I18nStrings {\n searchIconAriaLabel?: string;\n searchDismissIconAriaLabel?: string;\n overflowMenuDismissIconAriaLabel?: string;\n overflowMenuBackIconAriaLabel?: string;\n overflowMenuTriggerText?: string;\n overflowMenuTitleText?: string;\n }\n}\n"]}
|