@cloudscape-design/components-themeable 3.0.1372 → 3.0.1374
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/checkbox/styles.scss +34 -9
- package/lib/internal/scss/dialog/styles.scss +101 -0
- package/lib/internal/scss/dialog/test-classes/styles.scss +13 -0
- package/lib/internal/scss/expandable-section/styles.scss +8 -3
- package/lib/internal/scss/icon/mixins.scss +18 -0
- package/lib/internal/scss/icon/styles.scss +9 -0
- package/lib/internal/scss/internal/components/checkbox-icon/motion.scss +35 -0
- package/lib/internal/scss/internal/components/checkbox-icon/styles.scss +14 -9
- package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
- package/lib/internal/scss/internal/styles/links.scss +15 -10
- package/lib/internal/scss/internal/styles/style-api.scss +3 -2
- package/lib/internal/template/button-dropdown/interfaces.d.ts +5 -0
- package/lib/internal/template/button-dropdown/interfaces.d.ts.map +1 -1
- package/lib/internal/template/button-dropdown/interfaces.js.map +1 -1
- package/lib/internal/template/button-dropdown/internal-interfaces.d.ts +1 -1
- package/lib/internal/template/button-dropdown/internal-interfaces.d.ts.map +1 -1
- package/lib/internal/template/button-dropdown/internal-interfaces.js.map +1 -1
- package/lib/internal/template/button-dropdown/internal.js +2 -2
- package/lib/internal/template/button-dropdown/internal.js.map +1 -1
- package/lib/internal/template/button-dropdown/items-list.d.ts +1 -1
- package/lib/internal/template/button-dropdown/items-list.d.ts.map +1 -1
- package/lib/internal/template/button-dropdown/items-list.js +2 -2
- package/lib/internal/template/button-dropdown/items-list.js.map +1 -1
- package/lib/internal/template/button-dropdown/utils/move-highlight.d.ts +3 -2
- package/lib/internal/template/button-dropdown/utils/move-highlight.d.ts.map +1 -1
- package/lib/internal/template/button-dropdown/utils/move-highlight.js +13 -21
- package/lib/internal/template/button-dropdown/utils/move-highlight.js.map +1 -1
- package/lib/internal/template/button-dropdown/utils/use-button-dropdown.d.ts +1 -1
- package/lib/internal/template/button-dropdown/utils/use-button-dropdown.d.ts.map +1 -1
- package/lib/internal/template/button-dropdown/utils/use-button-dropdown.js +8 -6
- package/lib/internal/template/button-dropdown/utils/use-button-dropdown.js.map +1 -1
- package/lib/internal/template/button-dropdown/utils/use-highlighted-menu.d.ts +2 -2
- package/lib/internal/template/button-dropdown/utils/use-highlighted-menu.d.ts.map +1 -1
- package/lib/internal/template/button-dropdown/utils/use-highlighted-menu.js +14 -4
- package/lib/internal/template/button-dropdown/utils/use-highlighted-menu.js.map +1 -1
- package/lib/internal/template/button-dropdown/utils/utils.d.ts +1 -0
- package/lib/internal/template/button-dropdown/utils/utils.d.ts.map +1 -1
- package/lib/internal/template/button-dropdown/utils/utils.js +1 -0
- package/lib/internal/template/button-dropdown/utils/utils.js.map +1 -1
- package/lib/internal/template/calendar/interfaces.d.ts +2 -1
- package/lib/internal/template/calendar/interfaces.d.ts.map +1 -1
- package/lib/internal/template/calendar/interfaces.js.map +1 -1
- package/lib/internal/template/calendar/internal.d.ts.map +1 -1
- package/lib/internal/template/calendar/internal.js +3 -1
- package/lib/internal/template/calendar/internal.js.map +1 -1
- package/lib/internal/template/checkbox/internal.d.ts +6 -0
- package/lib/internal/template/checkbox/internal.d.ts.map +1 -1
- package/lib/internal/template/checkbox/internal.js +2 -2
- package/lib/internal/template/checkbox/internal.js.map +1 -1
- package/lib/internal/template/checkbox/styles.css.js +7 -3
- package/lib/internal/template/checkbox/styles.scoped.css +72 -16
- package/lib/internal/template/checkbox/styles.selectors.js +7 -3
- package/lib/internal/template/date-range-picker/index.d.ts.map +1 -1
- package/lib/internal/template/date-range-picker/index.js +3 -2
- package/lib/internal/template/date-range-picker/index.js.map +1 -1
- package/lib/internal/template/date-range-picker/interfaces.d.ts +2 -1
- package/lib/internal/template/date-range-picker/interfaces.d.ts.map +1 -1
- package/lib/internal/template/date-range-picker/interfaces.js.map +1 -1
- package/lib/internal/template/dialog/index.d.ts +4 -0
- package/lib/internal/template/dialog/index.d.ts.map +1 -0
- package/lib/internal/template/dialog/index.js +21 -0
- package/lib/internal/template/dialog/index.js.map +1 -0
- package/lib/internal/template/dialog/interfaces.d.ts +41 -0
- package/lib/internal/template/dialog/interfaces.d.ts.map +1 -0
- package/lib/internal/template/dialog/interfaces.js +2 -0
- package/lib/internal/template/dialog/interfaces.js.map +1 -0
- package/lib/internal/template/dialog/internal.d.ts +6 -0
- package/lib/internal/template/dialog/internal.d.ts.map +1 -0
- package/lib/internal/template/dialog/internal.js +39 -0
- package/lib/internal/template/dialog/internal.js.map +1 -0
- package/lib/internal/template/dialog/styles.css.js +13 -0
- package/lib/internal/template/dialog/styles.scoped.css +126 -0
- package/lib/internal/template/dialog/styles.selectors.js +14 -0
- package/lib/internal/template/dialog/test-classes/styles.css.js +11 -0
- package/lib/internal/template/dialog/test-classes/styles.scoped.css +12 -0
- package/lib/internal/template/dialog/test-classes/styles.selectors.js +12 -0
- package/lib/internal/template/dialog/use-focus-restore.d.ts +6 -0
- package/lib/internal/template/dialog/use-focus-restore.d.ts.map +1 -0
- package/lib/internal/template/dialog/use-focus-restore.js +34 -0
- package/lib/internal/template/dialog/use-focus-restore.js.map +1 -0
- package/lib/internal/template/expandable-section/expandable-section-header.d.ts.map +1 -1
- package/lib/internal/template/expandable-section/expandable-section-header.js +9 -2
- package/lib/internal/template/expandable-section/expandable-section-header.js.map +1 -1
- package/lib/internal/template/expandable-section/styles.css.js +44 -43
- package/lib/internal/template/expandable-section/styles.scoped.css +92 -88
- package/lib/internal/template/expandable-section/styles.selectors.js +44 -43
- package/lib/internal/template/i18n/messages/all.all.js +1 -1
- package/lib/internal/template/i18n/messages/all.all.json +1 -1
- package/lib/internal/template/i18n/messages/all.de.js +1 -1
- package/lib/internal/template/i18n/messages/all.de.json +1 -1
- package/lib/internal/template/i18n/messages/all.en-GB.js +1 -1
- package/lib/internal/template/i18n/messages/all.en-GB.json +1 -1
- package/lib/internal/template/i18n/messages/all.en.js +1 -1
- package/lib/internal/template/i18n/messages/all.en.json +1 -1
- package/lib/internal/template/i18n/messages/all.es.js +1 -1
- package/lib/internal/template/i18n/messages/all.es.json +1 -1
- package/lib/internal/template/i18n/messages/all.fr.js +1 -1
- package/lib/internal/template/i18n/messages/all.fr.json +1 -1
- package/lib/internal/template/i18n/messages/all.id.js +1 -1
- package/lib/internal/template/i18n/messages/all.id.json +1 -1
- package/lib/internal/template/i18n/messages/all.it.js +1 -1
- package/lib/internal/template/i18n/messages/all.it.json +1 -1
- package/lib/internal/template/i18n/messages/all.ja.js +1 -1
- package/lib/internal/template/i18n/messages/all.ja.json +1 -1
- package/lib/internal/template/i18n/messages/all.ko.js +1 -1
- package/lib/internal/template/i18n/messages/all.ko.json +1 -1
- package/lib/internal/template/i18n/messages/all.pt-BR.js +1 -1
- package/lib/internal/template/i18n/messages/all.pt-BR.json +1 -1
- package/lib/internal/template/i18n/messages/all.tr.js +1 -1
- package/lib/internal/template/i18n/messages/all.tr.json +1 -1
- package/lib/internal/template/i18n/messages/all.zh-CN.js +1 -1
- package/lib/internal/template/i18n/messages/all.zh-CN.json +1 -1
- package/lib/internal/template/i18n/messages/all.zh-TW.js +1 -1
- package/lib/internal/template/i18n/messages/all.zh-TW.json +1 -1
- package/lib/internal/template/i18n/messages-types.d.ts +3 -0
- package/lib/internal/template/i18n/messages-types.d.ts.map +1 -1
- package/lib/internal/template/i18n/messages-types.js.map +1 -1
- package/lib/internal/template/icon/internal.d.ts +3 -1
- package/lib/internal/template/icon/internal.d.ts.map +1 -1
- package/lib/internal/template/icon/internal.js +10 -2
- package/lib/internal/template/icon/internal.js.map +1 -1
- package/lib/internal/template/icon/styles.css.js +43 -42
- package/lib/internal/template/icon/styles.scoped.css +126 -98
- package/lib/internal/template/icon/styles.selectors.js +43 -42
- package/lib/internal/template/icon-provider/context.d.ts +2 -0
- package/lib/internal/template/icon-provider/context.d.ts.map +1 -1
- package/lib/internal/template/icon-provider/context.js +2 -0
- package/lib/internal/template/icon-provider/context.js.map +1 -1
- package/lib/internal/template/icon-provider/interfaces.d.ts +39 -1
- package/lib/internal/template/icon-provider/interfaces.d.ts.map +1 -1
- package/lib/internal/template/icon-provider/interfaces.js.map +1 -1
- package/lib/internal/template/icon-provider/internal.d.ts +1 -1
- package/lib/internal/template/icon-provider/internal.d.ts.map +1 -1
- package/lib/internal/template/icon-provider/internal.js +17 -3
- package/lib/internal/template/icon-provider/internal.js.map +1 -1
- package/lib/internal/template/icon-provider/use-component-icons.d.ts +4 -0
- package/lib/internal/template/icon-provider/use-component-icons.d.ts.map +1 -0
- package/lib/internal/template/icon-provider/use-component-icons.js +9 -0
- package/lib/internal/template/icon-provider/use-component-icons.js.map +1 -0
- package/lib/internal/template/index.d.ts +1 -0
- package/lib/internal/template/index.d.ts.map +1 -1
- package/lib/internal/template/index.js +1 -0
- package/lib/internal/template/index.js.map +1 -1
- package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
- package/lib/internal/template/internal/base-theme/styles.scoped.css +36 -0
- package/lib/internal/template/internal/components/abstract-switch/index.d.ts +3 -1
- package/lib/internal/template/internal/components/abstract-switch/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/abstract-switch/index.js +5 -3
- package/lib/internal/template/internal/components/abstract-switch/index.js.map +1 -1
- package/lib/internal/template/internal/components/checkbox-icon/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/checkbox-icon/index.js +8 -2
- package/lib/internal/template/internal/components/checkbox-icon/index.js.map +1 -1
- package/lib/internal/template/internal/components/checkbox-icon/styles.css.js +9 -9
- package/lib/internal/template/internal/components/checkbox-icon/styles.scoped.css +18 -18
- package/lib/internal/template/internal/components/checkbox-icon/styles.selectors.js +9 -9
- package/lib/internal/template/internal/components/customizable-icon/index.d.ts +19 -0
- package/lib/internal/template/internal/components/customizable-icon/index.d.ts.map +1 -0
- package/lib/internal/template/internal/components/customizable-icon/index.js +12 -0
- package/lib/internal/template/internal/components/customizable-icon/index.js.map +1 -0
- package/lib/internal/template/internal/components/expand-toggle-button/index.d.ts +4 -1
- package/lib/internal/template/internal/components/expand-toggle-button/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/expand-toggle-button/index.js +6 -3
- package/lib/internal/template/internal/components/expand-toggle-button/index.js.map +1 -1
- package/lib/internal/template/internal/environment.js +2 -2
- package/lib/internal/template/internal/environment.json +2 -2
- package/lib/internal/template/internal/generated/styles/tokens.d.ts +11 -0
- package/lib/internal/template/internal/generated/styles/tokens.js +11 -0
- package/lib/internal/template/internal/generated/theming/index.cjs +157 -1
- package/lib/internal/template/internal/generated/theming/index.cjs.d.ts +582 -5
- package/lib/internal/template/internal/generated/theming/index.d.cts +4308 -0
- package/lib/internal/template/internal/generated/theming/index.d.ts +99 -0
- package/lib/internal/template/internal/generated/theming/index.js +157 -1
- package/lib/internal/template/internal/utils/locale/normalize-locale.js +8 -5
- package/lib/internal/template/internal/utils/locale/normalize-locale.js.map +1 -1
- package/lib/internal/template/package.json +3 -0
- package/lib/internal/template/split-panel/bottom.d.ts +2 -1
- package/lib/internal/template/split-panel/bottom.d.ts.map +1 -1
- package/lib/internal/template/split-panel/bottom.js.map +1 -1
- package/lib/internal/template/split-panel/content-props.d.ts +17 -0
- package/lib/internal/template/split-panel/content-props.d.ts.map +1 -0
- package/lib/internal/template/split-panel/content-props.js +2 -0
- package/lib/internal/template/split-panel/content-props.js.map +1 -0
- package/lib/internal/template/split-panel/interfaces.d.ts +0 -13
- package/lib/internal/template/split-panel/interfaces.d.ts.map +1 -1
- package/lib/internal/template/split-panel/interfaces.js.map +1 -1
- package/lib/internal/template/split-panel/side.d.ts +2 -1
- package/lib/internal/template/split-panel/side.d.ts.map +1 -1
- package/lib/internal/template/split-panel/side.js.map +1 -1
- package/lib/internal/template/table/body-cell/td-element.d.ts.map +1 -1
- package/lib/internal/template/table/body-cell/td-element.js +3 -1
- package/lib/internal/template/table/body-cell/td-element.js.map +1 -1
- package/lib/internal/template/table/header-cell/index.d.ts.map +1 -1
- package/lib/internal/template/table/header-cell/index.js +8 -2
- package/lib/internal/template/table/header-cell/index.js.map +1 -1
- package/lib/internal/template/table/internal.js +1 -1
- package/lib/internal/template/table/internal.js.map +1 -1
- package/lib/internal/template/test-utils/dom/dialog/index.d.ts +25 -0
- package/lib/internal/template/test-utils/dom/dialog/index.js +43 -0
- package/lib/internal/template/test-utils/dom/dialog/index.js.map +1 -0
- package/lib/internal/template/test-utils/dom/index.d.ts +28 -0
- package/lib/internal/template/test-utils/dom/index.js +21 -2
- package/lib/internal/template/test-utils/dom/index.js.map +1 -1
- package/lib/internal/template/test-utils/selectors/dialog/index.d.ts +25 -0
- package/lib/internal/template/test-utils/selectors/dialog/index.js +43 -0
- package/lib/internal/template/test-utils/selectors/dialog/index.js.map +1 -0
- package/lib/internal/template/test-utils/selectors/index.d.ts +18 -0
- package/lib/internal/template/test-utils/selectors/index.js +16 -2
- package/lib/internal/template/test-utils/selectors/index.js.map +1 -1
- package/lib/internal/template/tree-view/interfaces.d.ts +3 -0
- package/lib/internal/template/tree-view/interfaces.d.ts.map +1 -1
- package/lib/internal/template/tree-view/interfaces.js.map +1 -1
- package/lib/internal/template/tree-view/tree-item/index.d.ts.map +1 -1
- package/lib/internal/template/tree-view/tree-item/index.js +3 -1
- package/lib/internal/template/tree-view/tree-item/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -7,10 +7,19 @@
|
|
|
7
7
|
@use '../internal/styles/tokens' as awsui;
|
|
8
8
|
@use '../internal/styles/foundation' as foundation;
|
|
9
9
|
@use '../internal/generated/custom-css-properties/index.scss' as custom-props;
|
|
10
|
-
@use '
|
|
10
|
+
@use '../internal/styles/style-api' as style-api;
|
|
11
11
|
|
|
12
12
|
$checkbox-size: awsui.$size-control;
|
|
13
13
|
|
|
14
|
+
$control-props: style-api.combine((color, background-color, border-color), style-api.$focus-ring);
|
|
15
|
+
$control-tokens: style-api.resolve($control-props, carrier);
|
|
16
|
+
$label-tokens: style-api.resolve((color), public);
|
|
17
|
+
$description-tokens: style-api.resolve((color), public);
|
|
18
|
+
@include style-api.register($control-tokens, $label-tokens, $description-tokens);
|
|
19
|
+
@include style-api.docs('control', $control-tokens);
|
|
20
|
+
@include style-api.docs('label', $label-tokens);
|
|
21
|
+
@include style-api.docs('description', $description-tokens);
|
|
22
|
+
|
|
14
23
|
// double selector bumps specificity of this rule above the rule in the abstract switch styles applied to the same element
|
|
15
24
|
.root.root {
|
|
16
25
|
@include styles.styles-reset;
|
|
@@ -18,17 +27,33 @@ $checkbox-size: awsui.$size-control;
|
|
|
18
27
|
}
|
|
19
28
|
|
|
20
29
|
.checkbox-control {
|
|
30
|
+
@include style-api.carriers($control-tokens);
|
|
21
31
|
@include styles.make-control-size($checkbox-size);
|
|
22
32
|
}
|
|
23
33
|
|
|
24
34
|
.outline {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
$
|
|
31
|
-
$border-radius: var(#{custom-props.$styleFocusRingBorderRadius}, awsui.$border-radius-control-default-focus-ring),
|
|
32
|
-
$box-shadow: var(#{custom-props.$styleFocusRingBoxShadow})
|
|
35
|
+
@include style-api.focus-highlight(
|
|
36
|
+
$gutter-block: 2px,
|
|
37
|
+
$gutter-inline: 2px,
|
|
38
|
+
$radius: var(#{custom-props.$styleFocusRingBorderRadius}, awsui.$border-radius-control-default-focus-ring),
|
|
39
|
+
$width: var(#{custom-props.$styleFocusRingBorderWidth}, foundation.$box-shadow-focused-width),
|
|
40
|
+
$color: var(#{custom-props.$styleFocusRingBorderColor}, awsui.$color-border-item-focused)
|
|
33
41
|
);
|
|
34
42
|
}
|
|
43
|
+
|
|
44
|
+
// double selectors bump specificity above the abstract switch rules applied to the same elements
|
|
45
|
+
@if style-api.enabled() {
|
|
46
|
+
.label.label {
|
|
47
|
+
color: style-api.value($label-tokens, color, awsui.$color-text-form-default);
|
|
48
|
+
&.label-disabled {
|
|
49
|
+
color: style-api.value($label-tokens, color, awsui.$color-text-control-disabled);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.description.description {
|
|
54
|
+
color: style-api.value($description-tokens, color, awsui.$color-text-form-secondary);
|
|
55
|
+
&.description-disabled {
|
|
56
|
+
color: style-api.value($description-tokens, color, awsui.$color-text-control-disabled);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
@use '../internal/styles' as styles;
|
|
7
|
+
@use '../internal/styles/tokens' as awsui;
|
|
8
|
+
|
|
9
|
+
$border-radius: awsui.$border-radius-dialog;
|
|
10
|
+
$section-padding-block: awsui.$space-dialog-vertical;
|
|
11
|
+
$section-padding-inline: awsui.$space-dialog-horizontal;
|
|
12
|
+
$action-padding-block: awsui.$space-dialog-action-block;
|
|
13
|
+
$action-padding-inline: awsui.$space-dialog-action-inline;
|
|
14
|
+
$header-gap: awsui.$space-dialog-header-gap;
|
|
15
|
+
$section-gap: awsui.$space-dialog-section-gap;
|
|
16
|
+
|
|
17
|
+
@mixin apply-border-radius {
|
|
18
|
+
border-start-start-radius: $border-radius;
|
|
19
|
+
border-start-end-radius: $border-radius;
|
|
20
|
+
border-end-start-radius: $border-radius;
|
|
21
|
+
border-end-end-radius: $border-radius;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.root {
|
|
25
|
+
@include styles.styles-reset;
|
|
26
|
+
@include styles.text-wrapping;
|
|
27
|
+
@include apply-border-radius;
|
|
28
|
+
|
|
29
|
+
box-sizing: border-box;
|
|
30
|
+
position: relative;
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
min-inline-size: 0;
|
|
34
|
+
max-inline-size: 100%;
|
|
35
|
+
background: awsui.$color-background-dialog-default;
|
|
36
|
+
box-shadow: awsui.$shadow-dialog;
|
|
37
|
+
|
|
38
|
+
&::before {
|
|
39
|
+
@include styles.base-pseudo-element;
|
|
40
|
+
@include apply-border-radius;
|
|
41
|
+
|
|
42
|
+
border-block: solid awsui.$border-width-dialog awsui.$color-border-dialog-default;
|
|
43
|
+
border-inline: solid awsui.$border-width-dialog awsui.$color-border-dialog-default;
|
|
44
|
+
box-shadow: none;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.header {
|
|
49
|
+
display: grid;
|
|
50
|
+
grid-template-areas: 'heading dismiss';
|
|
51
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
52
|
+
align-items: baseline;
|
|
53
|
+
column-gap: $header-gap;
|
|
54
|
+
|
|
55
|
+
// Compensate for the action controls' internal padding so the heading and
|
|
56
|
+
// close button align with the other sections.
|
|
57
|
+
padding-block: calc($section-padding-block - $action-padding-block);
|
|
58
|
+
padding-inline-start: $section-padding-inline;
|
|
59
|
+
padding-inline-end: calc($section-padding-inline - $action-padding-inline);
|
|
60
|
+
|
|
61
|
+
&.header-with-actions {
|
|
62
|
+
grid-template-areas: 'heading actions dismiss';
|
|
63
|
+
grid-template-columns: minmax(0, 1fr) auto auto;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.header-content {
|
|
68
|
+
@include styles.font-heading-s;
|
|
69
|
+
|
|
70
|
+
grid-area: heading;
|
|
71
|
+
min-inline-size: 0;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.header-actions {
|
|
75
|
+
grid-area: actions;
|
|
76
|
+
display: flex;
|
|
77
|
+
align-items: center;
|
|
78
|
+
justify-self: end;
|
|
79
|
+
column-gap: $header-gap;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.dismiss-button {
|
|
83
|
+
grid-area: dismiss;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.content,
|
|
87
|
+
.footer {
|
|
88
|
+
padding-block: $section-padding-block;
|
|
89
|
+
padding-inline: $section-padding-inline;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.header:has(+ .content, + .footer),
|
|
93
|
+
.content:has(+ .footer) {
|
|
94
|
+
padding-block-end: $section-gap;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.header + .content,
|
|
98
|
+
.header + .footer,
|
|
99
|
+
.content + .footer {
|
|
100
|
+
padding-block-start: $section-gap;
|
|
101
|
+
}
|
|
@@ -65,6 +65,14 @@ $nav-caret-pad-one-theme: 12px; // 24px minus the one-theme x-small (12px) icon
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
+
// Applied to both the default and custom toggle icons.
|
|
69
|
+
.icon-position {
|
|
70
|
+
position: relative;
|
|
71
|
+
@include theming.one-theme-only {
|
|
72
|
+
inset-block-start: $icon-offset-block;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
68
76
|
.icon-container {
|
|
69
77
|
position: relative;
|
|
70
78
|
margin-inline: calc(#{$icon-margin-left}) calc(#{$icon-margin-right-normal});
|
|
@@ -80,9 +88,6 @@ $nav-caret-pad-one-theme: 12px; // 24px minus the one-theme x-small (12px) icon
|
|
|
80
88
|
display: inline-flex;
|
|
81
89
|
align-items: flex-start;
|
|
82
90
|
margin-inline: 0 $icon-margin-right-small;
|
|
83
|
-
> .icon {
|
|
84
|
-
inset-block-start: $icon-offset-block;
|
|
85
|
-
}
|
|
86
91
|
}
|
|
87
92
|
}
|
|
88
93
|
|
|
@@ -20,6 +20,7 @@ $_variant-colors: (
|
|
|
20
20
|
$_icon-sizes: (
|
|
21
21
|
(
|
|
22
22
|
name: 'x-small',
|
|
23
|
+
supportedFontSize: awsui.$font-size-body-s,
|
|
23
24
|
size: 12px,
|
|
24
25
|
supportedLineHeight: awsui.$line-height-body-s,
|
|
25
26
|
stroke: awsui.$border-width-icon-x-small,
|
|
@@ -27,6 +28,7 @@ $_icon-sizes: (
|
|
|
27
28
|
),
|
|
28
29
|
(
|
|
29
30
|
name: 'small',
|
|
31
|
+
supportedFontSize: awsui.$font-size-body-m,
|
|
30
32
|
size: awsui.$size-icon-normal,
|
|
31
33
|
supportedLineHeight: awsui.$line-height-body-s,
|
|
32
34
|
stroke: awsui.$border-width-icon-small,
|
|
@@ -34,6 +36,7 @@ $_icon-sizes: (
|
|
|
34
36
|
),
|
|
35
37
|
(
|
|
36
38
|
name: 'normal',
|
|
39
|
+
supportedFontSize: awsui.$font-size-body-m,
|
|
37
40
|
size: awsui.$size-icon-normal,
|
|
38
41
|
supportedLineHeight: awsui.$line-height-body-m,
|
|
39
42
|
stroke: awsui.$border-width-icon-normal,
|
|
@@ -41,6 +44,7 @@ $_icon-sizes: (
|
|
|
41
44
|
),
|
|
42
45
|
(
|
|
43
46
|
name: 'medium',
|
|
47
|
+
supportedFontSize: awsui.$font-size-heading-l,
|
|
44
48
|
size: awsui.$size-icon-medium,
|
|
45
49
|
supportedLineHeight: awsui.$line-height-heading-l,
|
|
46
50
|
stroke: awsui.$border-width-icon-medium,
|
|
@@ -48,6 +52,7 @@ $_icon-sizes: (
|
|
|
48
52
|
),
|
|
49
53
|
(
|
|
50
54
|
name: 'big',
|
|
55
|
+
supportedFontSize: awsui.$font-size-heading-xl,
|
|
51
56
|
size: awsui.$size-icon-big,
|
|
52
57
|
supportedLineHeight: awsui.$line-height-heading-xl,
|
|
53
58
|
stroke: awsui.$border-width-icon-big,
|
|
@@ -55,6 +60,7 @@ $_icon-sizes: (
|
|
|
55
60
|
),
|
|
56
61
|
(
|
|
57
62
|
name: 'large',
|
|
63
|
+
supportedFontSize: awsui.$font-size-display-l,
|
|
58
64
|
size: awsui.$size-icon-large,
|
|
59
65
|
supportedLineHeight: awsui.$line-height-display-l,
|
|
60
66
|
stroke: awsui.$border-width-icon-large,
|
|
@@ -62,6 +68,18 @@ $_icon-sizes: (
|
|
|
62
68
|
)
|
|
63
69
|
);
|
|
64
70
|
|
|
71
|
+
// Emits per-size text metrics so a nested `size="inherit"` icon resolves to the wrapper's size.
|
|
72
|
+
// The line height equals the icon size (not the supported line height), so that the nested icon's
|
|
73
|
+
// measured box exactly fits the wrapper's content area.
|
|
74
|
+
@mixin make-icon-size-text-metrics {
|
|
75
|
+
@each $type in $_icon-sizes {
|
|
76
|
+
&.size-#{map.get($type, 'name')} {
|
|
77
|
+
font-size: map.get($type, 'supportedFontSize');
|
|
78
|
+
line-height: map.get($type, 'size');
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
65
83
|
@mixin make-icon-sizes {
|
|
66
84
|
@each $type in $_icon-sizes {
|
|
67
85
|
$name: map.get($type, 'name');
|
|
@@ -70,3 +70,12 @@
|
|
|
70
70
|
inset-block-start: 0px;
|
|
71
71
|
inset-inline-end: -3px;
|
|
72
72
|
}
|
|
73
|
+
|
|
74
|
+
// Wraps custom icons supplied through IconProvider or the internal override. Generates no box of
|
|
75
|
+
// its own, and provides text metrics so a nested `size="inherit"` icon resolves to the wrapper's
|
|
76
|
+
// size. It carries the same icon and size classes as the wrapper, so custom raw svg nodes receive
|
|
77
|
+
// the regular sizing and stroke styles.
|
|
78
|
+
.icon.custom-icon {
|
|
79
|
+
display: contents;
|
|
80
|
+
@include mixins.make-icon-size-text-metrics;
|
|
81
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
@use '../../styles/utils/theming' as theming;
|
|
5
|
+
|
|
6
|
+
// Scopes @content to themes that opted in to $expressive-motion-themes in theming.scss.
|
|
7
|
+
@mixin checkbox-expressive-with-motion {
|
|
8
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
9
|
+
@include theming.expressive-motion-only(':not(.awsui-motion-disabled):not(.awsui-mode-entering)') {
|
|
10
|
+
@content;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// Include inside the checkmark line rule. Draws the checkmark in by sliding the dash offset to zero.
|
|
16
|
+
@mixin draw-in {
|
|
17
|
+
&[data-awsui-motion-ready] {
|
|
18
|
+
@include checkbox-expressive-with-motion {
|
|
19
|
+
animation: awsui-checkbox-draw 250ms linear;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@if theming.has-expressive-motion() {
|
|
23
|
+
@keyframes awsui-checkbox-draw {
|
|
24
|
+
from {
|
|
25
|
+
stroke-dasharray: 20;
|
|
26
|
+
stroke-dashoffset: 20px;
|
|
27
|
+
}
|
|
28
|
+
to {
|
|
29
|
+
stroke-dasharray: 20;
|
|
30
|
+
stroke-dashoffset: 0;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
|
|
6
6
|
@use '../../styles' as styles;
|
|
7
7
|
@use '../../styles/tokens' as awsui;
|
|
8
|
+
@use '../../styles/style-api' as style-api;
|
|
9
|
+
@use './motion' as motion;
|
|
10
|
+
|
|
11
|
+
$_control-tokens: style-api.resolve((color, background-color, border-color), carrier);
|
|
8
12
|
|
|
9
13
|
.root {
|
|
10
14
|
position: absolute;
|
|
@@ -14,8 +18,8 @@
|
|
|
14
18
|
inset-inline-start: 0;
|
|
15
19
|
|
|
16
20
|
> .styled-box {
|
|
17
|
-
fill: awsui.$color-background-control-default;
|
|
18
|
-
stroke: awsui.$color-border-control-default;
|
|
21
|
+
fill: style-api.value($_control-tokens, background-color, awsui.$color-background-control-default);
|
|
22
|
+
stroke: style-api.value($_control-tokens, border-color, awsui.$color-border-control-default);
|
|
19
23
|
stroke-width: awsui.$border-width-field;
|
|
20
24
|
@include styles.with-motion {
|
|
21
25
|
transition:
|
|
@@ -24,25 +28,26 @@
|
|
|
24
28
|
}
|
|
25
29
|
&-checked,
|
|
26
30
|
&-indeterminate {
|
|
27
|
-
fill: awsui.$color-background-control-checked;
|
|
28
|
-
stroke: awsui.$color-border-control-checked;
|
|
31
|
+
fill: style-api.value($_control-tokens, background-color, awsui.$color-background-control-checked);
|
|
32
|
+
stroke: style-api.value($_control-tokens, border-color, awsui.$color-border-control-checked);
|
|
29
33
|
}
|
|
30
34
|
&-disabled,
|
|
31
35
|
&-readonly {
|
|
32
|
-
fill: awsui.$color-background-control-disabled;
|
|
33
|
-
stroke: awsui.$color-border-control-disabled;
|
|
36
|
+
fill: style-api.value($_control-tokens, background-color, awsui.$color-background-control-disabled);
|
|
37
|
+
stroke: style-api.value($_control-tokens, border-color, awsui.$color-border-control-disabled);
|
|
34
38
|
}
|
|
35
39
|
}
|
|
36
40
|
|
|
37
41
|
> .styled-line {
|
|
38
|
-
stroke: awsui.$color-foreground-control-default;
|
|
42
|
+
stroke: style-api.value($_control-tokens, color, awsui.$color-foreground-control-default);
|
|
39
43
|
stroke-width: 2;
|
|
40
44
|
fill: none;
|
|
41
45
|
&-disabled {
|
|
42
|
-
stroke: awsui.$color-foreground-control-disabled;
|
|
46
|
+
stroke: style-api.value($_control-tokens, color, awsui.$color-foreground-control-disabled);
|
|
43
47
|
}
|
|
44
48
|
&-readonly {
|
|
45
|
-
stroke: awsui.$color-foreground-control-read-only;
|
|
49
|
+
stroke: style-api.value($_control-tokens, color, awsui.$color-foreground-control-read-only);
|
|
46
50
|
}
|
|
51
|
+
@include motion.draw-in;
|
|
47
52
|
}
|
|
48
53
|
}
|
|
@@ -11,16 +11,13 @@
|
|
|
11
11
|
@use '../generated/custom-css-properties/index.scss' as custom-props;
|
|
12
12
|
@use './style-api' as style-api;
|
|
13
13
|
|
|
14
|
-
@function _link-color($tokens, $value) {
|
|
15
|
-
@if not $tokens {
|
|
16
|
-
@return $value;
|
|
17
|
-
}
|
|
18
|
-
@return style-api.value($tokens, color, $value);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
14
|
// $tokens: optional Style API v2 token map from style-api.resolve.
|
|
22
15
|
@mixin link-variant-style($variant, $tokens: null) {
|
|
23
|
-
color:
|
|
16
|
+
color: style-api.value(
|
|
17
|
+
$tokens,
|
|
18
|
+
color,
|
|
19
|
+
var(#{custom-props.$styleColorDefault}, map.get($variant, 'text-color-default'))
|
|
20
|
+
);
|
|
24
21
|
font-weight: map.get($variant, 'font-weight');
|
|
25
22
|
letter-spacing: map.get($variant, 'letter-spacing');
|
|
26
23
|
text-decoration-line: map.get($variant, 'decoration-line');
|
|
@@ -33,7 +30,11 @@
|
|
|
33
30
|
|
|
34
31
|
&:hover {
|
|
35
32
|
cursor: pointer;
|
|
36
|
-
color:
|
|
33
|
+
color: style-api.value(
|
|
34
|
+
$tokens,
|
|
35
|
+
color,
|
|
36
|
+
var(#{custom-props.$styleColorHover}, map.get($variant, 'text-color-hover'))
|
|
37
|
+
);
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
&:focus {
|
|
@@ -41,7 +42,11 @@
|
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
&:active {
|
|
44
|
-
color:
|
|
45
|
+
color: style-api.value(
|
|
46
|
+
$tokens,
|
|
47
|
+
color,
|
|
48
|
+
var(#{custom-props.$styleColorActive}, map.get($variant, 'text-color-active'))
|
|
49
|
+
);
|
|
45
50
|
}
|
|
46
51
|
|
|
47
52
|
&:active,
|
|
@@ -29,9 +29,10 @@ $_focus-ring-carriers: toolkit.resolve($focus-ring, carrier);
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
// Emits `var(<carrier>, <fallback>)` when enabled, or just `<fallback>` when disabled — so a read
|
|
32
|
-
// leaves no trace in the compiled CSS for gated-off systems.
|
|
32
|
+
// leaves no trace in the compiled CSS for gated-off systems. A null `$tokens` map also yields the
|
|
33
|
+
// fallback: the caller is not in a Style API context.
|
|
33
34
|
@function value($tokens, $token, $fallback) {
|
|
34
|
-
@if not enabled() {
|
|
35
|
+
@if not enabled() or not $tokens {
|
|
35
36
|
@return $fallback;
|
|
36
37
|
}
|
|
37
38
|
@return var(#{toolkit.read($tokens, $token)}, #{$fallback});
|
|
@@ -342,6 +342,11 @@ export declare namespace ButtonDropdownProps {
|
|
|
342
342
|
id?: string;
|
|
343
343
|
text?: string;
|
|
344
344
|
items: Items;
|
|
345
|
+
/**
|
|
346
|
+
* Controls whether this group renders as an expandable submenu, overriding `expandableGroups`
|
|
347
|
+
* for this group. Defaults to the `expandableGroups` value when unset.
|
|
348
|
+
*/
|
|
349
|
+
expandable?: boolean;
|
|
345
350
|
}
|
|
346
351
|
type ItemOrGroup = Item | CheckboxItem | ItemGroup;
|
|
347
352
|
type Items = ReadonlyArray<ItemOrGroup>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/button-dropdown/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAC/E;;GAEG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,MAAM,WAAW,mBAAoB,SAAQ,kBAAkB,EAAE,gBAAgB;IAC/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6CG;IACH,KAAK,EAAE,aAAa,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC;IAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA0CG;IACH,UAAU,CAAC,EAAE,mBAAmB,CAAC,YAAY,CAAC;IAE9C;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,cAAc,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AAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;CACvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/button-dropdown/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { ReactNode } from 'react';\n\nimport { ButtonProps } from '../button/interfaces';\nimport { ExpandToViewport } from '../dropdown/interfaces';\nimport { IconProps } from '../icon/interfaces';\nimport { BaseComponentProps } from '../types/base-component';\nimport { BaseNavigationDetail, CancelableEventHandler } from '../types/events';\n/**\n * @awsuiSystem core\n */\nimport { NativeAttributes } from '../types/native-attributes';\n\nexport interface ButtonDropdownProps extends BaseComponentProps, ExpandToViewport {\n /**\n * Array of objects with a number of supported types.\n *\n * The following properties are supported across all types:\n *\n * - `type` (string) - The type of the item. Can be `action`, `group`, `checkbox`. Defaults to `action` if `items` undefined and `group` otherwise.\n * - `id` (string) - allows to identify the item that the user clicked on. Mandatory for individual items, optional for categories.\n * - `text` (string) - description shown in the menu for this item. Mandatory for individual items, optional for categories.\n * - `lang` (string) - (Optional) The language of the item, provided as a BCP 47 language tag.\n * - `disabled` (boolean) - whether the item is disabled. Disabled items are not clickable, but they can be highlighted with the keyboard to make them accessible.\n * - `disabledReason` (string) - (Optional) Displays text near the `text` property when item is disabled. Use to provide additional context.\n * - `description` (string) - additional data that will be passed to a `data-description` attribute. **Deprecated**, has no effect.\n * - `ariaLabel` (string) - (Optional) - ARIA label of the item element.\n * - `dataAttributes` (Record<string, string>) - (Optional) Custom data attributes for the item element. Attribute names are automatically prefixed with \"data-\". The \"testid\" key is reserved.\n *\n * ### action\n *\n * - `href` (string) - (Optional) Defines the target URL of the menu item, turning it into a link.\n * - `download` (boolean | string) - (Optional) Indicates that the link should be downloaded when clicked. Only works when `href` is also provided. If set to `true`, the browser will use the filename from the URL. If set to a string, that string will be used as the suggested filename.\n * - `external` (boolean) - Marks a menu item as external by adding an icon after the menu item text. The link will open in a new tab when clicked. Note that this only works when `href` is also provided.\n * - `externalIconAriaLabel` (string) - Adds an `aria-label` to the external icon.\n * - `iconName` (string) - (Optional) Specifies the name of the icon, used with the [icon component](/components/icon/).\n * - `iconAlt` (string) - (Optional) Specifies alternate text for the icon when using `iconUrl`.\n * - `iconUrl` (string) - (Optional) Specifies the URL of a custom icon.\n * - `iconSvg` (ReactNode) - (Optional) Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n * - `secondaryText` (string) - (Optional) Further information about the action that appears below the label.\n * - `labelTag` (string) - (Optional) - A label tag that provides additional guidance, shown next to the label.\n *\n * ### checkbox\n *\n * When `type` is set to \"checkbox\", the values set to `href`, `external` and `externalIconAriaLabel` will be ignored.\n *\n * - `checked` (boolean) - Controls the state of the checkbox item.\n * - `iconName` (string) - (Optional) Specifies the name of the icon, used with the [icon component](/components/icon/).\n * - `iconAlt` (string) - (Optional) Specifies alternate text for the icon when using `iconUrl`.\n * - `iconUrl` (string) - (Optional) Specifies the URL of a custom icon.\n * - `iconSvg` (ReactNode) - (Optional) Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n * - `secondaryText` (string) - (Optional) Further information about the action that appears below the label.\n * - `labelTag` (string) - (Optional) - A label tag that provides additional guidance, shown next to the label.\n *\n * ### group\n *\n * - `items` (ReadonlyArray<Item>) - an array of item objects. Items will be rendered as nested menu items but only for the first nesting level, multi-nesting is not supported.\n * An item which belongs to nested group has the following properties: `id`, `text`, `disabled`, and `description`.\n *\n */\n items: ReadonlyArray<ButtonDropdownProps.ItemOrGroup>;\n\n /**\n * Specifies a render function to render custom options in the dropdown menu.\n *\n * The item inside the props has a different shape depending on its type:\n *\n *\n * ### action\n *\n * - `type` ('action') - The item type.\n * - `index` (number) - The item's position relative to its parent.\n * - `option` (Item) - The original item configuration.\n * - `highlighted` (boolean) - Whether the item is currently highlighted.\n * - `disabled` (boolean) - Whether the item is disabled.\n * - `parent` (GroupRenderItem | null) - The parent group item, if any.\n * - `filterText` (string) - The current value of the filtering input, when filtering is enabled.\n *\n * ### checkbox\n *\n * - `type` ('checkbox') - The item type.\n * - `index` (number) - The item's position relative to its parent.\n * - `option` (CheckboxItem) - The original item configuration.\n * - `disabled` (boolean) - Whether the item is disabled.\n * - `highlighted` (boolean) - Whether the item is currently highlighted.\n * - `checked` (boolean) - Controls the state of the checkbox item.\n * - `parent` (GroupRenderItem | null) - The parent group item, if any.\n * - `filterText` (string) - The current value of the filtering input, when filtering is enabled.\n *\n * ### group\n *\n * - `type` ('group') - The item type.\n * - `index` (number) - The item's position in the list.\n * - `option` (ItemGroup) - The original item configuration.\n * - `disabled` (boolean) - Whether the item is disabled.\n * - `highlighted` (boolean) - Whether the item is currently highlighted.\n * - `expanded` (boolean) - Whether the group is expanded.\n * - `expandDirection` ('vertical' | 'horizontal') - The direction in which the group expands.\n * - `filterText` (string) - The current value of the filtering input, when filtering is enabled.\n *\n * When providing a custom `renderItem` implementation, it fully replaces the default visual rendering and content for that item.\n * The component still manages focus, keyboard interactions, and selection state, but it no longer applies its default item layout or typography.\n *\n * When returning `null`, the default styling will be applied.\n */\n renderItem?: ButtonDropdownProps.ItemRenderer;\n\n /**\n * Determines whether the button dropdown is disabled. Users cannot interact with the control if it's disabled.\n */\n disabled?: boolean;\n /**\n * Provides a reason why the button dropdown is disabled (only when `disabled` is `true`).\n * If provided, the disabled button becomes focusable.\n */\n disabledReason?: string;\n /**\n * Renders the button as being in a loading state. It takes precedence over the `disabled` if both are set to `true`.\n * It prevents clicks.\n */\n loading?: boolean;\n /**\n * Specifies the text that screen reader announces when the button dropdown is in a loading state.\n */\n loadingText?: string;\n /** Determines the general styling of the button dropdown.\n * * `primary` for primary buttons\n * * `normal` for secondary buttons\n * * `icon` for icon buttons\n * * `inline-icon` for icon buttons with no outer padding\n */\n variant?: ButtonDropdownProps.Variant;\n /**\n * Specifies the name of the icon used in the button dropdown trigger, used with the [icon component](/components/icon/).\n * Defaults to `ellipsis`. Applies to the `icon` and `inline-icon` variants only.\n */\n iconName?: IconProps.Name;\n /**\n * Specifies alternate text for a custom icon, for use with `iconUrl`. Applies to the `icon` and `inline-icon` variants only.\n */\n iconAlt?: string;\n /**\n * Specifies the URL of a custom icon. Applies to the `icon` and `inline-icon` variants only.\n *\n * If you set both `iconUrl` and `iconSvg`, `iconSvg` will take precedence.\n */\n iconUrl?: string;\n /**\n * Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n * Applies to the `icon` and `inline-icon` variants only.\n *\n * If you set both `iconUrl` and `iconSvg`, `iconSvg` will take precedence.\n */\n iconSvg?: React.ReactNode;\n /**\n * Controls expandability of the item groups.\n */\n expandableGroups?: boolean;\n /**\n * Adds `aria-label` to the button dropdown trigger.\n * Use this to provide an accessible name for buttons that don't have visible text.\n */\n ariaLabel?: string;\n /**\n * Text displayed in the button dropdown trigger.\n * @displayname text\n */\n children?: React.ReactNode;\n /**\n * Called when the user clicks on an item, and the item is not disabled. The event detail object contains the id of the clicked item.\n */\n onItemClick?: CancelableEventHandler<ButtonDropdownProps.ItemClickDetails>;\n /**\n * Called when the user clicks on an item with the left mouse button without pressing\n * modifier keys (that is, CTRL, ALT, SHIFT, META), and the item has an `href` set.\n */\n onItemFollow?: CancelableEventHandler<ButtonDropdownProps.ItemClickDetails>;\n /**\n * A standalone action that is shown prior to the dropdown trigger.\n * Use it with \"primary\" and \"normal\" variant only.\n *\n * Main action properties:\n * * `text` (string) - Specifies the text shown in the main action.\n * * `external` (boolean) - Marks the main action as external by adding an icon after the text. The link will open in a new tab when clicked. Note that this only works when `href` is also provided.\n * * `externalIconAriaLabel` (string) - Adds an ARIA label to the external icon.\n *\n * The main action also supports the following properties of the [button](/components/button/?tabId=api) component:\n * `ariaLabel`, `disabled`, `loading`, `loadingText`, `href`, `target`, `rel`, `download`, `iconAlt`, `iconName`, `iconUrl`, `iconSvg`, `onClick`, `onFollow`.\n */\n mainAction?: ButtonDropdownProps.MainAction;\n\n /**\n * Sets the button width to be 100% of the parent container width. Button content is centered.\n */\n fullWidth?: boolean;\n\n /**\n * Enables filtering of the dropdown items.\n *\n * When set to `auto`, a search input is rendered inside the dropdown and the items are filtered as the user\n * types. Items are matched client-side using a case-insensitive substring match against their `text`,\n * `secondaryText`, and `labelTag`.\n */\n filteringType?: ButtonDropdownProps.FilteringType;\n\n /**\n * Specifies the placeholder to display in the filtering input. Only relevant when filtering is enabled.\n */\n filteringPlaceholder?: string;\n\n /**\n * Adds an `aria-label` to the filtering input. Only relevant when filtering is enabled.\n */\n filteringAriaLabel?: string;\n\n /**\n * Adds an `aria-label` to the clear button inside the filtering input. Only relevant when filtering is enabled.\n * @i18n\n */\n filteringClearAriaLabel?: string;\n\n /**\n * Specifies the text to display with the number of matches at the bottom of the dropdown menu while filtering.\n * @i18n\n */\n filteringResultsText?: (matchesCount: number, totalCount: number) => string;\n\n /**\n * Displayed when filtering is enabled and there are no matches for the filtering input.\n */\n noMatch?: React.ReactNode;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n * @i18n\n */\n i18nStrings?: ButtonDropdownProps.I18nStrings;\n\n /**\n * Attributes to add to the native `button` element.\n * Some attributes will be automatically combined with internal attribute values:\n * - `className` will be appended.\n * - Event handlers will be chained, unless the default is prevented.\n *\n * We do not support using this attribute to apply custom styling.\n *\n * @awsuiSystem core\n */\n nativeTriggerAttributes?: NativeAttributes<React.ButtonHTMLAttributes<HTMLButtonElement>>;\n\n /**\n * Attributes to add to the native element of the `mainAction`.\n *\n * Specify either `button` for a standard main action, or `anchor` if `html` is set.\n *\n * Some attributes will be automatically combined with internal attribute values:\n * - `className` will be appended.\n * - Event handlers will be chained, unless the default is prevented.\n *\n * We do not support using this attribute to apply custom styling.\n *\n * @awsuiSystem core\n */\n nativeMainActionAttributes?: {\n button?: NativeAttributes<React.ButtonHTMLAttributes<HTMLButtonElement>>;\n anchor?: NativeAttributes<React.AnchorHTMLAttributes<HTMLAnchorElement>>;\n };\n}\n\nexport namespace ButtonDropdownProps {\n export type Variant = 'normal' | 'primary' | 'icon' | 'inline-icon';\n export type ItemType = 'action' | 'group';\n export type FilteringType = 'auto' | 'none';\n\n export interface I18nStrings {\n filteringItemAriaDescription?: string;\n }\n\n export interface ActionRenderItem {\n type: 'action';\n index: number;\n option: Item;\n highlighted: boolean;\n disabled: boolean;\n parent: GroupRenderItem | null;\n }\n export interface CheckboxRenderItem {\n type: 'checkbox';\n index: number;\n option: CheckboxItem;\n disabled: boolean;\n highlighted: boolean;\n checked: boolean;\n parent: GroupRenderItem | null;\n }\n export interface GroupRenderItem {\n type: 'group';\n index: number;\n option: ItemGroup;\n disabled: boolean;\n highlighted: boolean;\n expanded: boolean;\n expandDirection: 'vertical' | 'horizontal';\n }\n\n export type RenderItem = ActionRenderItem | CheckboxRenderItem | GroupRenderItem;\n export type ItemRenderer = (props: { item: ButtonDropdownProps.RenderItem; filterText?: string }) => ReactNode | null;\n\n export interface MainAction {\n text?: string;\n ariaLabel?: string;\n onClick?: CancelableEventHandler<ButtonProps.ClickDetail>;\n onFollow?: CancelableEventHandler<ButtonProps.FollowDetail>;\n disabled?: boolean;\n disabledReason?: string;\n loading?: boolean;\n loadingText?: string;\n href?: string;\n target?: string;\n rel?: string;\n download?: boolean | string;\n external?: boolean;\n externalIconAriaLabel?: string;\n iconAlt?: string;\n iconName?: IconProps.Name;\n iconUrl?: string;\n iconSvg?: React.ReactNode;\n }\n\n export interface Item {\n itemType?: ItemType;\n id: string;\n text: string;\n secondaryText?: string;\n ariaLabel?: string;\n lang?: string;\n disabled?: boolean;\n disabledReason?: string;\n /**\n * @deprecated Has no effect.\n */\n description?: string;\n href?: string;\n download?: boolean | string;\n external?: boolean;\n externalIconAriaLabel?: string;\n iconAlt?: string;\n iconName?: IconProps.Name;\n iconUrl?: string;\n iconSvg?: React.ReactNode;\n labelTag?: string;\n dataAttributes?: Record<string, string>;\n }\n\n export interface CheckboxItem\n extends Omit<ButtonDropdownProps.Item, 'href' | 'download' | 'external' | 'externalIconAriaLabel' | 'itemType'> {\n itemType: 'checkbox';\n checked: boolean;\n }\n\n export interface ItemGroup extends Omit<Item, 'id' | 'text' | 'itemType' | 'secondaryText' | 'labelTag'> {\n itemType?: 'group';\n id?: string;\n text?: string;\n items: Items;\n }\n\n export type ItemOrGroup = Item | CheckboxItem | ItemGroup;\n\n export type Items = ReadonlyArray<ItemOrGroup>;\n\n export interface ItemClickDetails extends BaseNavigationDetail {\n id: string;\n checked?: boolean;\n }\n\n export interface Ref {\n /**\n * Focuses the underlying native button. If a main action is defined this will focus that button.\n */\n focus(options?: FocusOptions): void;\n /**\n * Focuses the underlying native button for the dropdown.\n */\n focusDropdownTrigger(options?: FocusOptions): void;\n }\n}\n\nexport interface ButtonDropdownSettings {\n // this means whether action is required to make group expand\n hasExpandableGroups: boolean;\n // on smaller screens expandable groups are integrated into parent dropdown\n // this changes keyboard navigation, highlight and activation behavior for parent dropdown\n isInRestrictedView?: boolean;\n}\n\nexport interface HighlightProps {\n targetItem: ButtonDropdownProps.ItemOrGroup | null;\n isHighlighted: (item: ButtonDropdownProps.ItemOrGroup) => boolean;\n isKeyboardHighlight: (item: ButtonDropdownProps.ItemOrGroup) => boolean;\n isExpanded: (group: ButtonDropdownProps.ItemGroup) => boolean;\n highlightItem: (item: ButtonDropdownProps.ItemOrGroup) => void;\n}\n\nexport type GroupToggle = (item: ButtonDropdownProps.ItemGroup, event: React.SyntheticEvent) => void;\nexport type ItemActivate = (\n item: ButtonDropdownProps.Item | ButtonDropdownProps.CheckboxItem,\n event: React.MouseEvent | React.KeyboardEvent\n) => void;\n\nexport interface LinkItem extends ButtonDropdownProps.Item {\n href: string;\n}\n\nexport interface CustomTriggerProps {\n triggerRef: React.Ref<HTMLElement>;\n testUtilsClass: string;\n ariaLabel: string | undefined;\n disabled: boolean;\n disabledReason?: string;\n isOpen: boolean;\n onClick: () => void;\n ariaExpanded: boolean;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/button-dropdown/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { ReactNode } from 'react';\n\nimport { ButtonProps } from '../button/interfaces';\nimport { ExpandToViewport } from '../dropdown/interfaces';\nimport { IconProps } from '../icon/interfaces';\nimport { BaseComponentProps } from '../types/base-component';\nimport { BaseNavigationDetail, CancelableEventHandler } from '../types/events';\n/**\n * @awsuiSystem core\n */\nimport { NativeAttributes } from '../types/native-attributes';\n\nexport interface ButtonDropdownProps extends BaseComponentProps, ExpandToViewport {\n /**\n * Array of objects with a number of supported types.\n *\n * The following properties are supported across all types:\n *\n * - `type` (string) - The type of the item. Can be `action`, `group`, `checkbox`. Defaults to `action` if `items` undefined and `group` otherwise.\n * - `id` (string) - allows to identify the item that the user clicked on. Mandatory for individual items, optional for categories.\n * - `text` (string) - description shown in the menu for this item. Mandatory for individual items, optional for categories.\n * - `lang` (string) - (Optional) The language of the item, provided as a BCP 47 language tag.\n * - `disabled` (boolean) - whether the item is disabled. Disabled items are not clickable, but they can be highlighted with the keyboard to make them accessible.\n * - `disabledReason` (string) - (Optional) Displays text near the `text` property when item is disabled. Use to provide additional context.\n * - `description` (string) - additional data that will be passed to a `data-description` attribute. **Deprecated**, has no effect.\n * - `ariaLabel` (string) - (Optional) - ARIA label of the item element.\n * - `dataAttributes` (Record<string, string>) - (Optional) Custom data attributes for the item element. Attribute names are automatically prefixed with \"data-\". The \"testid\" key is reserved.\n *\n * ### action\n *\n * - `href` (string) - (Optional) Defines the target URL of the menu item, turning it into a link.\n * - `download` (boolean | string) - (Optional) Indicates that the link should be downloaded when clicked. Only works when `href` is also provided. If set to `true`, the browser will use the filename from the URL. If set to a string, that string will be used as the suggested filename.\n * - `external` (boolean) - Marks a menu item as external by adding an icon after the menu item text. The link will open in a new tab when clicked. Note that this only works when `href` is also provided.\n * - `externalIconAriaLabel` (string) - Adds an `aria-label` to the external icon.\n * - `iconName` (string) - (Optional) Specifies the name of the icon, used with the [icon component](/components/icon/).\n * - `iconAlt` (string) - (Optional) Specifies alternate text for the icon when using `iconUrl`.\n * - `iconUrl` (string) - (Optional) Specifies the URL of a custom icon.\n * - `iconSvg` (ReactNode) - (Optional) Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n * - `secondaryText` (string) - (Optional) Further information about the action that appears below the label.\n * - `labelTag` (string) - (Optional) - A label tag that provides additional guidance, shown next to the label.\n *\n * ### checkbox\n *\n * When `type` is set to \"checkbox\", the values set to `href`, `external` and `externalIconAriaLabel` will be ignored.\n *\n * - `checked` (boolean) - Controls the state of the checkbox item.\n * - `iconName` (string) - (Optional) Specifies the name of the icon, used with the [icon component](/components/icon/).\n * - `iconAlt` (string) - (Optional) Specifies alternate text for the icon when using `iconUrl`.\n * - `iconUrl` (string) - (Optional) Specifies the URL of a custom icon.\n * - `iconSvg` (ReactNode) - (Optional) Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n * - `secondaryText` (string) - (Optional) Further information about the action that appears below the label.\n * - `labelTag` (string) - (Optional) - A label tag that provides additional guidance, shown next to the label.\n *\n * ### group\n *\n * - `items` (ReadonlyArray<Item>) - an array of item objects. Items will be rendered as nested menu items but only for the first nesting level, multi-nesting is not supported.\n * An item which belongs to nested group has the following properties: `id`, `text`, `disabled`, and `description`.\n *\n */\n items: ReadonlyArray<ButtonDropdownProps.ItemOrGroup>;\n\n /**\n * Specifies a render function to render custom options in the dropdown menu.\n *\n * The item inside the props has a different shape depending on its type:\n *\n *\n * ### action\n *\n * - `type` ('action') - The item type.\n * - `index` (number) - The item's position relative to its parent.\n * - `option` (Item) - The original item configuration.\n * - `highlighted` (boolean) - Whether the item is currently highlighted.\n * - `disabled` (boolean) - Whether the item is disabled.\n * - `parent` (GroupRenderItem | null) - The parent group item, if any.\n * - `filterText` (string) - The current value of the filtering input, when filtering is enabled.\n *\n * ### checkbox\n *\n * - `type` ('checkbox') - The item type.\n * - `index` (number) - The item's position relative to its parent.\n * - `option` (CheckboxItem) - The original item configuration.\n * - `disabled` (boolean) - Whether the item is disabled.\n * - `highlighted` (boolean) - Whether the item is currently highlighted.\n * - `checked` (boolean) - Controls the state of the checkbox item.\n * - `parent` (GroupRenderItem | null) - The parent group item, if any.\n * - `filterText` (string) - The current value of the filtering input, when filtering is enabled.\n *\n * ### group\n *\n * - `type` ('group') - The item type.\n * - `index` (number) - The item's position in the list.\n * - `option` (ItemGroup) - The original item configuration.\n * - `disabled` (boolean) - Whether the item is disabled.\n * - `highlighted` (boolean) - Whether the item is currently highlighted.\n * - `expanded` (boolean) - Whether the group is expanded.\n * - `expandDirection` ('vertical' | 'horizontal') - The direction in which the group expands.\n * - `filterText` (string) - The current value of the filtering input, when filtering is enabled.\n *\n * When providing a custom `renderItem` implementation, it fully replaces the default visual rendering and content for that item.\n * The component still manages focus, keyboard interactions, and selection state, but it no longer applies its default item layout or typography.\n *\n * When returning `null`, the default styling will be applied.\n */\n renderItem?: ButtonDropdownProps.ItemRenderer;\n\n /**\n * Determines whether the button dropdown is disabled. Users cannot interact with the control if it's disabled.\n */\n disabled?: boolean;\n /**\n * Provides a reason why the button dropdown is disabled (only when `disabled` is `true`).\n * If provided, the disabled button becomes focusable.\n */\n disabledReason?: string;\n /**\n * Renders the button as being in a loading state. It takes precedence over the `disabled` if both are set to `true`.\n * It prevents clicks.\n */\n loading?: boolean;\n /**\n * Specifies the text that screen reader announces when the button dropdown is in a loading state.\n */\n loadingText?: string;\n /** Determines the general styling of the button dropdown.\n * * `primary` for primary buttons\n * * `normal` for secondary buttons\n * * `icon` for icon buttons\n * * `inline-icon` for icon buttons with no outer padding\n */\n variant?: ButtonDropdownProps.Variant;\n /**\n * Specifies the name of the icon used in the button dropdown trigger, used with the [icon component](/components/icon/).\n * Defaults to `ellipsis`. Applies to the `icon` and `inline-icon` variants only.\n */\n iconName?: IconProps.Name;\n /**\n * Specifies alternate text for a custom icon, for use with `iconUrl`. Applies to the `icon` and `inline-icon` variants only.\n */\n iconAlt?: string;\n /**\n * Specifies the URL of a custom icon. Applies to the `icon` and `inline-icon` variants only.\n *\n * If you set both `iconUrl` and `iconSvg`, `iconSvg` will take precedence.\n */\n iconUrl?: string;\n /**\n * Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n * Applies to the `icon` and `inline-icon` variants only.\n *\n * If you set both `iconUrl` and `iconSvg`, `iconSvg` will take precedence.\n */\n iconSvg?: React.ReactNode;\n /**\n * Controls expandability of the item groups.\n */\n expandableGroups?: boolean;\n /**\n * Adds `aria-label` to the button dropdown trigger.\n * Use this to provide an accessible name for buttons that don't have visible text.\n */\n ariaLabel?: string;\n /**\n * Text displayed in the button dropdown trigger.\n * @displayname text\n */\n children?: React.ReactNode;\n /**\n * Called when the user clicks on an item, and the item is not disabled. The event detail object contains the id of the clicked item.\n */\n onItemClick?: CancelableEventHandler<ButtonDropdownProps.ItemClickDetails>;\n /**\n * Called when the user clicks on an item with the left mouse button without pressing\n * modifier keys (that is, CTRL, ALT, SHIFT, META), and the item has an `href` set.\n */\n onItemFollow?: CancelableEventHandler<ButtonDropdownProps.ItemClickDetails>;\n /**\n * A standalone action that is shown prior to the dropdown trigger.\n * Use it with \"primary\" and \"normal\" variant only.\n *\n * Main action properties:\n * * `text` (string) - Specifies the text shown in the main action.\n * * `external` (boolean) - Marks the main action as external by adding an icon after the text. The link will open in a new tab when clicked. Note that this only works when `href` is also provided.\n * * `externalIconAriaLabel` (string) - Adds an ARIA label to the external icon.\n *\n * The main action also supports the following properties of the [button](/components/button/?tabId=api) component:\n * `ariaLabel`, `disabled`, `loading`, `loadingText`, `href`, `target`, `rel`, `download`, `iconAlt`, `iconName`, `iconUrl`, `iconSvg`, `onClick`, `onFollow`.\n */\n mainAction?: ButtonDropdownProps.MainAction;\n\n /**\n * Sets the button width to be 100% of the parent container width. Button content is centered.\n */\n fullWidth?: boolean;\n\n /**\n * Enables filtering of the dropdown items.\n *\n * When set to `auto`, a search input is rendered inside the dropdown and the items are filtered as the user\n * types. Items are matched client-side using a case-insensitive substring match against their `text`,\n * `secondaryText`, and `labelTag`.\n */\n filteringType?: ButtonDropdownProps.FilteringType;\n\n /**\n * Specifies the placeholder to display in the filtering input. Only relevant when filtering is enabled.\n */\n filteringPlaceholder?: string;\n\n /**\n * Adds an `aria-label` to the filtering input. Only relevant when filtering is enabled.\n */\n filteringAriaLabel?: string;\n\n /**\n * Adds an `aria-label` to the clear button inside the filtering input. Only relevant when filtering is enabled.\n * @i18n\n */\n filteringClearAriaLabel?: string;\n\n /**\n * Specifies the text to display with the number of matches at the bottom of the dropdown menu while filtering.\n * @i18n\n */\n filteringResultsText?: (matchesCount: number, totalCount: number) => string;\n\n /**\n * Displayed when filtering is enabled and there are no matches for the filtering input.\n */\n noMatch?: React.ReactNode;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n * @i18n\n */\n i18nStrings?: ButtonDropdownProps.I18nStrings;\n\n /**\n * Attributes to add to the native `button` element.\n * Some attributes will be automatically combined with internal attribute values:\n * - `className` will be appended.\n * - Event handlers will be chained, unless the default is prevented.\n *\n * We do not support using this attribute to apply custom styling.\n *\n * @awsuiSystem core\n */\n nativeTriggerAttributes?: NativeAttributes<React.ButtonHTMLAttributes<HTMLButtonElement>>;\n\n /**\n * Attributes to add to the native element of the `mainAction`.\n *\n * Specify either `button` for a standard main action, or `anchor` if `html` is set.\n *\n * Some attributes will be automatically combined with internal attribute values:\n * - `className` will be appended.\n * - Event handlers will be chained, unless the default is prevented.\n *\n * We do not support using this attribute to apply custom styling.\n *\n * @awsuiSystem core\n */\n nativeMainActionAttributes?: {\n button?: NativeAttributes<React.ButtonHTMLAttributes<HTMLButtonElement>>;\n anchor?: NativeAttributes<React.AnchorHTMLAttributes<HTMLAnchorElement>>;\n };\n}\n\nexport namespace ButtonDropdownProps {\n export type Variant = 'normal' | 'primary' | 'icon' | 'inline-icon';\n export type ItemType = 'action' | 'group';\n export type FilteringType = 'auto' | 'none';\n\n export interface I18nStrings {\n filteringItemAriaDescription?: string;\n }\n\n export interface ActionRenderItem {\n type: 'action';\n index: number;\n option: Item;\n highlighted: boolean;\n disabled: boolean;\n parent: GroupRenderItem | null;\n }\n export interface CheckboxRenderItem {\n type: 'checkbox';\n index: number;\n option: CheckboxItem;\n disabled: boolean;\n highlighted: boolean;\n checked: boolean;\n parent: GroupRenderItem | null;\n }\n export interface GroupRenderItem {\n type: 'group';\n index: number;\n option: ItemGroup;\n disabled: boolean;\n highlighted: boolean;\n expanded: boolean;\n expandDirection: 'vertical' | 'horizontal';\n }\n\n export type RenderItem = ActionRenderItem | CheckboxRenderItem | GroupRenderItem;\n export type ItemRenderer = (props: { item: ButtonDropdownProps.RenderItem; filterText?: string }) => ReactNode | null;\n\n export interface MainAction {\n text?: string;\n ariaLabel?: string;\n onClick?: CancelableEventHandler<ButtonProps.ClickDetail>;\n onFollow?: CancelableEventHandler<ButtonProps.FollowDetail>;\n disabled?: boolean;\n disabledReason?: string;\n loading?: boolean;\n loadingText?: string;\n href?: string;\n target?: string;\n rel?: string;\n download?: boolean | string;\n external?: boolean;\n externalIconAriaLabel?: string;\n iconAlt?: string;\n iconName?: IconProps.Name;\n iconUrl?: string;\n iconSvg?: React.ReactNode;\n }\n\n export interface Item {\n itemType?: ItemType;\n id: string;\n text: string;\n secondaryText?: string;\n ariaLabel?: string;\n lang?: string;\n disabled?: boolean;\n disabledReason?: string;\n /**\n * @deprecated Has no effect.\n */\n description?: string;\n href?: string;\n download?: boolean | string;\n external?: boolean;\n externalIconAriaLabel?: string;\n iconAlt?: string;\n iconName?: IconProps.Name;\n iconUrl?: string;\n iconSvg?: React.ReactNode;\n labelTag?: string;\n dataAttributes?: Record<string, string>;\n }\n\n export interface CheckboxItem\n extends Omit<ButtonDropdownProps.Item, 'href' | 'download' | 'external' | 'externalIconAriaLabel' | 'itemType'> {\n itemType: 'checkbox';\n checked: boolean;\n }\n\n export interface ItemGroup extends Omit<Item, 'id' | 'text' | 'itemType' | 'secondaryText' | 'labelTag'> {\n itemType?: 'group';\n id?: string;\n text?: string;\n items: Items;\n /**\n * Controls whether this group renders as an expandable submenu, overriding `expandableGroups`\n * for this group. Defaults to the `expandableGroups` value when unset.\n */\n expandable?: boolean;\n }\n\n export type ItemOrGroup = Item | CheckboxItem | ItemGroup;\n\n export type Items = ReadonlyArray<ItemOrGroup>;\n\n export interface ItemClickDetails extends BaseNavigationDetail {\n id: string;\n checked?: boolean;\n }\n\n export interface Ref {\n /**\n * Focuses the underlying native button. If a main action is defined this will focus that button.\n */\n focus(options?: FocusOptions): void;\n /**\n * Focuses the underlying native button for the dropdown.\n */\n focusDropdownTrigger(options?: FocusOptions): void;\n }\n}\n\nexport interface ButtonDropdownSettings {\n // this means whether action is required to make group expand\n hasExpandableGroups: boolean;\n // on smaller screens expandable groups are integrated into parent dropdown\n // this changes keyboard navigation, highlight and activation behavior for parent dropdown\n isInRestrictedView?: boolean;\n}\n\nexport interface HighlightProps {\n targetItem: ButtonDropdownProps.ItemOrGroup | null;\n isHighlighted: (item: ButtonDropdownProps.ItemOrGroup) => boolean;\n isKeyboardHighlight: (item: ButtonDropdownProps.ItemOrGroup) => boolean;\n isExpanded: (group: ButtonDropdownProps.ItemGroup) => boolean;\n highlightItem: (item: ButtonDropdownProps.ItemOrGroup) => void;\n}\n\nexport type GroupToggle = (item: ButtonDropdownProps.ItemGroup, event: React.SyntheticEvent) => void;\nexport type ItemActivate = (\n item: ButtonDropdownProps.Item | ButtonDropdownProps.CheckboxItem,\n event: React.MouseEvent | React.KeyboardEvent\n) => void;\n\nexport interface LinkItem extends ButtonDropdownProps.Item {\n href: string;\n}\n\nexport interface CustomTriggerProps {\n triggerRef: React.Ref<HTMLElement>;\n testUtilsClass: string;\n ariaLabel: string | undefined;\n disabled: boolean;\n disabledReason?: string;\n isOpen: boolean;\n onClick: () => void;\n ariaExpanded: boolean;\n}\n"]}
|
|
@@ -23,7 +23,7 @@ export interface ItemListProps extends HighlightProps {
|
|
|
23
23
|
onGroupToggle: GroupToggle;
|
|
24
24
|
onItemActivate: ItemActivate;
|
|
25
25
|
categoryDisabled?: boolean;
|
|
26
|
-
|
|
26
|
+
isExpandable?: (item: ButtonDropdownProps.ItemOrGroup) => boolean;
|
|
27
27
|
hasCategoryHeader?: boolean;
|
|
28
28
|
lastInDropdown: boolean;
|
|
29
29
|
expandToViewport?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal-interfaces.d.ts","sourceRoot":"","sources":["../../../src/button-dropdown/internal-interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kCAAkC,EAAE,MAAM,kEAAkE,CAAC;AAEtH,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,YAAY,EACZ,QAAQ,EACT,MAAM,cAAc,CAAC;AAEtB,MAAM,WAAW,aAAc,SAAQ,cAAc;IACnD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,mBAAmB,CAAC,SAAS,CAAC;IACpC,aAAa,EAAE,WAAW,CAAC;IAC3B,cAAc,EAAE,YAAY,CAAC;IAC7B,QAAQ,EAAE,OAAO,CAAC;IAClB,cAAc,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,OAAO,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,mBAAmB,CAAC,YAAY,CAAC;IAC9C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;A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;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,4BAA4B,CAAC,EAAE,CAAC,KAAK,EAAE,kCAAkC,KAAK,kCAAkC,CAAC;IAEjH;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal-interfaces.js","sourceRoot":"","sources":["../../../src/button-dropdown/internal-interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { GeneratedAnalyticsMetadataFragment } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport {\n ButtonDropdownProps,\n CustomTriggerProps,\n GroupToggle,\n HighlightProps,\n ItemActivate,\n LinkItem,\n} from './interfaces';\n\nexport interface CategoryProps extends HighlightProps {\n index?: number;\n item: ButtonDropdownProps.ItemGroup;\n onGroupToggle: GroupToggle;\n onItemActivate: ItemActivate;\n disabled: boolean;\n lastInDropdown: boolean;\n expandToViewport?: boolean;\n variant?: ItemListProps['variant'];\n position?: string;\n renderItem?: ButtonDropdownProps.ItemRenderer;\n filteringText?: string;\n filteringEnabled?: boolean;\n menuId?: string;\n filteringDescriptionId?: string;\n}\n\nexport interface ItemListProps extends HighlightProps {\n items: ButtonDropdownProps.Items;\n onGroupToggle: GroupToggle;\n onItemActivate: ItemActivate;\n categoryDisabled?: boolean;\n
|
|
1
|
+
{"version":3,"file":"internal-interfaces.js","sourceRoot":"","sources":["../../../src/button-dropdown/internal-interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { GeneratedAnalyticsMetadataFragment } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport {\n ButtonDropdownProps,\n CustomTriggerProps,\n GroupToggle,\n HighlightProps,\n ItemActivate,\n LinkItem,\n} from './interfaces';\n\nexport interface CategoryProps extends HighlightProps {\n index?: number;\n item: ButtonDropdownProps.ItemGroup;\n onGroupToggle: GroupToggle;\n onItemActivate: ItemActivate;\n disabled: boolean;\n lastInDropdown: boolean;\n expandToViewport?: boolean;\n variant?: ItemListProps['variant'];\n position?: string;\n renderItem?: ButtonDropdownProps.ItemRenderer;\n filteringText?: string;\n filteringEnabled?: boolean;\n menuId?: string;\n filteringDescriptionId?: string;\n}\n\nexport interface ItemListProps extends HighlightProps {\n items: ButtonDropdownProps.Items;\n onGroupToggle: GroupToggle;\n onItemActivate: ItemActivate;\n categoryDisabled?: boolean;\n isExpandable?: (item: ButtonDropdownProps.ItemOrGroup) => boolean;\n hasCategoryHeader?: boolean;\n lastInDropdown: boolean;\n expandToViewport?: boolean;\n variant?: InternalButtonDropdownProps['variant'];\n position?: string;\n analyticsMetadataTransformer?: InternalButtonDropdownProps['analyticsMetadataTransformer'];\n linkStyle?: boolean;\n renderItem?: ButtonDropdownProps.ItemRenderer;\n parentProps?: ButtonDropdownProps.GroupRenderItem;\n filteringText?: string;\n filteringEnabled?: boolean;\n menuId?: string;\n filteringDescriptionId?: string;\n}\n\nexport interface ItemProps {\n index?: number;\n item: ButtonDropdownProps.Item | ButtonDropdownProps.CheckboxItem | LinkItem;\n disabled: boolean;\n highlighted: boolean;\n onItemActivate: ItemActivate;\n highlightItem: (item: ButtonDropdownProps.ItemOrGroup) => void;\n showDivider: boolean;\n hasCategoryHeader: boolean;\n isKeyboardHighlighted?: boolean;\n variant?: ItemListProps['variant'];\n position?: string;\n analyticsMetadataTransformer?: InternalButtonDropdownProps['analyticsMetadataTransformer'];\n linkStyle?: boolean;\n renderItem?: ButtonDropdownProps.ItemRenderer;\n parentProps?: ButtonDropdownProps.GroupRenderItem;\n filteringText?: string;\n filteringEnabled?: boolean;\n menuId?: string;\n filteringDescriptionId?: string;\n}\n\nexport interface InternalItem extends ButtonDropdownProps.Item {\n badge?: boolean;\n /**\n * Used in breadcrumb-group: indicates that this breadcrumb item is the current page\n */\n isCurrentBreadcrumb?: boolean;\n}\n\nexport interface InternalCheckboxItem extends ButtonDropdownProps.CheckboxItem {\n badge?: boolean;\n}\n\ninterface InternalItemGroup extends Omit<ButtonDropdownProps.ItemGroup, 'items'> {\n items: InternalItems;\n}\n\ntype InternalItems = ReadonlyArray<InternalItemOrGroup>;\n\nexport type InternalItemOrGroup = InternalItem | InternalCheckboxItem | InternalItemGroup;\n\nexport interface InternalButtonDropdownProps\n extends Omit<ButtonDropdownProps, 'variant' | 'items'>,\n InternalBaseComponentProps {\n customTriggerBuilder?: (props: CustomTriggerProps) => React.ReactNode;\n variant?: ButtonDropdownProps['variant'] | 'navigation';\n items: ReadonlyArray<InternalItemOrGroup>;\n\n /**\n * Optional text that is displayed as the title at the top of the dropdown.\n */\n title?: string;\n\n /**\n * Optional text that is displayed underneath the title at the top of the dropdown.\n */\n description?: string;\n\n /**\n * Only show main action button as a regular, non-split button.\n * That is needed so that button dropdown test utils wrapper can still be used.\n */\n showMainActionOnly?: boolean;\n\n /**\n * Determines that the dropdown should preferably be aligned to the center of the trigger\n * instead of dropping left or right.\n */\n preferCenter?: boolean;\n\n /**\n * Determines whether simple items should be displayed with the link styles.\n * Used in Breadcrumb group component for collapsed breadcrumbs\n */\n linkStyle?: boolean;\n\n /**\n * Determines whether the dropdown should take up the full available width.\n * Used in Breadcrumb group component for collapsed breadcrumbs\n */\n fullWidth?: boolean;\n\n analyticsMetadataTransformer?: (input: GeneratedAnalyticsMetadataFragment) => GeneratedAnalyticsMetadataFragment;\n\n /**\n * Position of the button dropdown inside a list of elements, for example a button group\n */\n position?: string;\n\n /**\n * Renders the trigger button without vertical padding or borders, matching the compact\n * `inline-icon` footprint. Use with `variant=\"icon\"` to get the icon variant's neutral colour\n * while keeping an inline footprint (used by the table multi-column sort menu).\n */\n compactTrigger?: boolean;\n\n /**\n * Adds `aria-describedby` to the trigger button, associating it with descriptive text elsewhere\n * on the page (for example a table header cell that disambiguates otherwise-identical triggers).\n */\n ariaDescribedby?: string;\n}\n"]}
|