@cloudscape-design/components-themeable 3.0.1405 → 3.0.1406
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/action-card/styles.scss +7 -13
- package/lib/internal/scss/autosuggest/styles.scss +1 -1
- package/lib/internal/scss/button/styles.scss +5 -1
- package/lib/internal/scss/button-dropdown/category-elements/styles.scss +1 -0
- package/lib/internal/scss/button-dropdown/styles.scss +1 -1
- package/lib/internal/scss/button-group/styles.scss +1 -1
- package/lib/internal/scss/container/styles.scss +3 -25
- package/lib/internal/scss/dropdown/styles.scss +1 -11
- package/lib/internal/scss/flashbar/collapsible.scss +1 -5
- package/lib/internal/scss/flashbar/styles.scss +2 -10
- package/lib/internal/scss/input/styles.scss +2 -3
- package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
- package/lib/internal/scss/item-card/styles.scss +4 -21
- package/lib/internal/scss/multiselect/styles.scss +2 -5
- package/lib/internal/scss/panel-layout/styles.scss +9 -6
- package/lib/internal/scss/progress-bar/styles.scss +1 -1
- package/lib/internal/scss/prompt-input/styles.scss +3 -21
- package/lib/internal/scss/radio-button/styles.scss +9 -1
- package/lib/internal/scss/radio-group/styles.scss +1 -1
- package/lib/internal/scss/segmented-control/segment.scss +3 -3
- package/lib/internal/scss/segmented-control/styles.scss +7 -7
- package/lib/internal/scss/select/styles.scss +2 -5
- package/lib/internal/scss/slider/styles.scss +1 -1
- package/lib/internal/scss/table/styles.scss +7 -41
- package/lib/internal/scss/tabs/tab-header-bar.scss +3 -30
- package/lib/internal/scss/text-filter/styles.scss +1 -8
- package/lib/internal/scss/textarea/styles.scss +1 -1
- package/lib/internal/scss/toggle/styles.scss +4 -4
- package/lib/internal/template/action-card/index.d.ts.map +1 -1
- package/lib/internal/template/action-card/index.js +3 -2
- package/lib/internal/template/action-card/index.js.map +1 -1
- package/lib/internal/template/action-card/interfaces.d.ts +8 -0
- package/lib/internal/template/action-card/interfaces.d.ts.map +1 -1
- package/lib/internal/template/action-card/interfaces.js.map +1 -1
- package/lib/internal/template/action-card/internal.d.ts.map +1 -1
- package/lib/internal/template/action-card/internal.js +2 -2
- package/lib/internal/template/action-card/internal.js.map +1 -1
- package/lib/internal/template/action-card/styles.css.js +19 -18
- package/lib/internal/template/action-card/styles.scoped.css +116 -116
- package/lib/internal/template/action-card/styles.selectors.js +19 -18
- package/lib/internal/template/annotation-context/annotation/annotation-trigger.d.ts.map +1 -1
- package/lib/internal/template/annotation-context/annotation/annotation-trigger.js +1 -1
- package/lib/internal/template/annotation-context/annotation/annotation-trigger.js.map +1 -1
- package/lib/internal/template/autosuggest/styles.css.js +3 -3
- package/lib/internal/template/autosuggest/styles.scoped.css +4 -4
- package/lib/internal/template/autosuggest/styles.selectors.js +3 -3
- package/lib/internal/template/button/styles.css.js +24 -24
- package/lib/internal/template/button/styles.scoped.css +81 -81
- package/lib/internal/template/button/styles.selectors.js +24 -24
- package/lib/internal/template/button-dropdown/internal.js +1 -1
- package/lib/internal/template/button-dropdown/internal.js.map +1 -1
- package/lib/internal/template/button-dropdown/styles.css.js +23 -23
- package/lib/internal/template/button-dropdown/styles.scoped.css +32 -32
- package/lib/internal/template/button-dropdown/styles.selectors.js +23 -23
- package/lib/internal/template/button-group/internal-interfaces.d.ts +3 -2
- package/lib/internal/template/button-group/internal-interfaces.d.ts.map +1 -1
- package/lib/internal/template/button-group/internal-interfaces.js.map +1 -1
- package/lib/internal/template/button-group/item-element.d.ts.map +1 -1
- package/lib/internal/template/button-group/item-element.js +2 -1
- package/lib/internal/template/button-group/item-element.js.map +1 -1
- package/lib/internal/template/button-group/styles.css.js +4 -4
- package/lib/internal/template/button-group/styles.scoped.css +5 -5
- package/lib/internal/template/button-group/styles.selectors.js +4 -4
- package/lib/internal/template/cards/index.js +1 -1
- package/lib/internal/template/cards/index.js.map +1 -1
- package/lib/internal/template/container/styles.css.js +33 -33
- package/lib/internal/template/container/styles.scoped.css +67 -70
- package/lib/internal/template/container/styles.selectors.js +33 -33
- package/lib/internal/template/dropdown/internal.d.ts +1 -1
- package/lib/internal/template/dropdown/internal.d.ts.map +1 -1
- package/lib/internal/template/dropdown/internal.js +1 -1
- package/lib/internal/template/dropdown/internal.js.map +1 -1
- package/lib/internal/template/dropdown/styles.css.js +20 -20
- package/lib/internal/template/dropdown/styles.scoped.css +38 -40
- package/lib/internal/template/dropdown/styles.selectors.js +20 -20
- package/lib/internal/template/flashbar/collapsible-flashbar.d.ts.map +1 -1
- package/lib/internal/template/flashbar/collapsible-flashbar.js +3 -2
- package/lib/internal/template/flashbar/collapsible-flashbar.js.map +1 -1
- package/lib/internal/template/flashbar/internal-interfaces.d.ts +3 -2
- package/lib/internal/template/flashbar/internal-interfaces.d.ts.map +1 -1
- package/lib/internal/template/flashbar/internal-interfaces.js.map +1 -1
- package/lib/internal/template/flashbar/non-collapsible-flashbar.d.ts.map +1 -1
- package/lib/internal/template/flashbar/non-collapsible-flashbar.js +2 -1
- package/lib/internal/template/flashbar/non-collapsible-flashbar.js.map +1 -1
- package/lib/internal/template/flashbar/styles.css.js +50 -50
- package/lib/internal/template/flashbar/styles.scoped.css +148 -151
- package/lib/internal/template/flashbar/styles.selectors.js +50 -50
- 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.en.js +1 -1
- package/lib/internal/template/i18n/messages/all.en.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/input/styles.css.js +45 -45
- package/lib/internal/template/input/styles.scoped.css +91 -91
- package/lib/internal/template/input/styles.selectors.js +45 -45
- package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
- package/lib/internal/template/internal/components/autosuggest-input/index.js +1 -1
- package/lib/internal/template/internal/components/autosuggest-input/index.js.map +1 -1
- package/lib/internal/template/internal/components/listbox/use-listbox.d.ts +2 -2
- package/lib/internal/template/internal/components/listbox/use-listbox.d.ts.map +1 -1
- package/lib/internal/template/internal/components/listbox/use-listbox.js +10 -1
- package/lib/internal/template/internal/components/listbox/use-listbox.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/utils/style-slot.d.ts +3 -0
- package/lib/internal/template/internal/utils/style-slot.d.ts.map +1 -0
- package/lib/internal/template/internal/utils/style-slot.js +6 -0
- package/lib/internal/template/internal/utils/style-slot.js.map +1 -0
- package/lib/internal/template/item-card/index.d.ts +1 -1
- package/lib/internal/template/item-card/index.d.ts.map +1 -1
- package/lib/internal/template/item-card/index.js +3 -2
- package/lib/internal/template/item-card/index.js.map +1 -1
- package/lib/internal/template/item-card/interfaces.d.ts +8 -0
- package/lib/internal/template/item-card/interfaces.d.ts.map +1 -1
- package/lib/internal/template/item-card/interfaces.js.map +1 -1
- package/lib/internal/template/item-card/internal-interfaces.d.ts +0 -4
- package/lib/internal/template/item-card/internal-interfaces.d.ts.map +1 -1
- package/lib/internal/template/item-card/internal-interfaces.js.map +1 -1
- package/lib/internal/template/item-card/internal.d.ts +1 -1
- package/lib/internal/template/item-card/internal.d.ts.map +1 -1
- package/lib/internal/template/item-card/internal.js +2 -2
- package/lib/internal/template/item-card/internal.js.map +1 -1
- package/lib/internal/template/item-card/styles.css.js +14 -14
- package/lib/internal/template/item-card/styles.scoped.css +61 -66
- package/lib/internal/template/item-card/styles.selectors.js +14 -14
- package/lib/internal/template/multiselect/internal.js +1 -1
- package/lib/internal/template/multiselect/internal.js.map +1 -1
- package/lib/internal/template/multiselect/styles.css.js +5 -5
- package/lib/internal/template/multiselect/styles.scoped.css +7 -9
- package/lib/internal/template/multiselect/styles.selectors.js +5 -5
- package/lib/internal/template/option-list/use-option-list.d.ts +2 -2
- package/lib/internal/template/option-list/use-option-list.d.ts.map +1 -1
- package/lib/internal/template/option-list/use-option-list.js +5 -22
- package/lib/internal/template/option-list/use-option-list.js.map +1 -1
- package/lib/internal/template/panel-layout/index.d.ts.map +1 -1
- package/lib/internal/template/panel-layout/index.js +3 -3
- package/lib/internal/template/panel-layout/index.js.map +1 -1
- package/lib/internal/template/panel-layout/interfaces.d.ts +9 -2
- package/lib/internal/template/panel-layout/interfaces.d.ts.map +1 -1
- package/lib/internal/template/panel-layout/interfaces.js.map +1 -1
- package/lib/internal/template/panel-layout/internal.d.ts.map +1 -1
- package/lib/internal/template/panel-layout/internal.js +3 -3
- package/lib/internal/template/panel-layout/internal.js.map +1 -1
- package/lib/internal/template/panel-layout/styles.css.js +8 -7
- package/lib/internal/template/panel-layout/styles.scoped.css +20 -16
- package/lib/internal/template/panel-layout/styles.selectors.js +8 -7
- package/lib/internal/template/progress-bar/internal.d.ts +1 -1
- package/lib/internal/template/progress-bar/internal.js +1 -1
- package/lib/internal/template/progress-bar/internal.js.map +1 -1
- package/lib/internal/template/progress-bar/styles.css.js +20 -20
- package/lib/internal/template/progress-bar/styles.scoped.css +32 -32
- package/lib/internal/template/progress-bar/styles.selectors.js +20 -20
- package/lib/internal/template/prompt-input/components/token-mode.js +1 -1
- package/lib/internal/template/prompt-input/components/token-mode.js.map +1 -1
- package/lib/internal/template/prompt-input/styles.css.js +26 -26
- package/lib/internal/template/prompt-input/styles.scoped.css +55 -57
- package/lib/internal/template/prompt-input/styles.selectors.js +26 -26
- package/lib/internal/template/radio-button/styles.css.js +1 -1
- package/lib/internal/template/radio-button/styles.scoped.css +2 -1
- package/lib/internal/template/radio-button/styles.selectors.js +1 -1
- package/lib/internal/template/radio-group/internal.d.ts +1 -1
- package/lib/internal/template/radio-group/internal.d.ts.map +1 -1
- package/lib/internal/template/radio-group/internal.js +1 -1
- package/lib/internal/template/radio-group/internal.js.map +1 -1
- package/lib/internal/template/radio-group/styles.css.js +5 -5
- package/lib/internal/template/radio-group/styles.scoped.css +7 -7
- package/lib/internal/template/radio-group/styles.selectors.js +5 -5
- package/lib/internal/template/segmented-control/styles.css.js +31 -31
- package/lib/internal/template/segmented-control/styles.scoped.css +75 -77
- package/lib/internal/template/segmented-control/styles.selectors.js +31 -31
- package/lib/internal/template/select/internal.js +1 -1
- package/lib/internal/template/select/internal.js.map +1 -1
- package/lib/internal/template/select/styles.css.js +3 -3
- package/lib/internal/template/select/styles.scoped.css +5 -7
- package/lib/internal/template/select/styles.selectors.js +3 -3
- package/lib/internal/template/slider/styles.css.js +26 -26
- package/lib/internal/template/slider/styles.scoped.css +78 -78
- package/lib/internal/template/slider/styles.selectors.js +26 -26
- package/lib/internal/template/styling/button.scss +7 -1
- package/lib/internal/template/styling/dropdown.scss +2 -2
- package/lib/internal/template/styling/progress-bar.scss +2 -2
- package/lib/internal/template/styling/segmented-control.scss +4 -4
- package/lib/internal/template/styling/table.scss +1 -3
- package/lib/internal/template/styling/toggle.scss +2 -2
- package/lib/internal/template/table/body-cell/disabled-inline-editor.d.ts.map +1 -1
- package/lib/internal/template/table/body-cell/disabled-inline-editor.js +1 -1
- package/lib/internal/template/table/body-cell/disabled-inline-editor.js.map +1 -1
- package/lib/internal/template/table/body-cell/index.d.ts.map +1 -1
- package/lib/internal/template/table/body-cell/index.js +1 -1
- package/lib/internal/template/table/body-cell/index.js.map +1 -1
- package/lib/internal/template/table/header-cell/group-header-cell.d.ts.map +1 -1
- package/lib/internal/template/table/header-cell/group-header-cell.js +1 -1
- package/lib/internal/template/table/header-cell/group-header-cell.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 +1 -1
- package/lib/internal/template/table/header-cell/index.js.map +1 -1
- package/lib/internal/template/table/internal.d.ts.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/table/selection/selection-cell.d.ts.map +1 -1
- package/lib/internal/template/table/selection/selection-cell.js +1 -1
- package/lib/internal/template/table/selection/selection-cell.js.map +1 -1
- package/lib/internal/template/table/style-api.d.ts +1 -3
- package/lib/internal/template/table/style-api.d.ts.map +1 -1
- package/lib/internal/template/table/style-api.js +1 -3
- package/lib/internal/template/table/style-api.js.map +1 -1
- package/lib/internal/template/table/styles.css.js +37 -37
- package/lib/internal/template/table/styles.scoped.css +49 -59
- package/lib/internal/template/table/styles.selectors.js +37 -37
- package/lib/internal/template/tabs/styles.css.js +30 -30
- package/lib/internal/template/tabs/styles.scoped.css +50 -57
- package/lib/internal/template/tabs/styles.selectors.js +30 -30
- package/lib/internal/template/tabs/tab-header-bar.d.ts +3 -2
- package/lib/internal/template/tabs/tab-header-bar.d.ts.map +1 -1
- package/lib/internal/template/tabs/tab-header-bar.js +2 -1
- package/lib/internal/template/tabs/tab-header-bar.js.map +1 -1
- package/lib/internal/template/text-filter/styles.css.js +3 -3
- package/lib/internal/template/text-filter/styles.scoped.css +3 -4
- package/lib/internal/template/text-filter/styles.selectors.js +3 -3
- package/lib/internal/template/textarea/styles.css.js +9 -9
- package/lib/internal/template/textarea/styles.scoped.css +18 -18
- package/lib/internal/template/textarea/styles.selectors.js +9 -9
- package/lib/internal/template/toggle/internal.d.ts.map +1 -1
- package/lib/internal/template/toggle/internal.js +1 -1
- package/lib/internal/template/toggle/internal.js.map +1 -1
- package/lib/internal/template/toggle/styles.css.js +10 -10
- package/lib/internal/template/toggle/styles.scoped.css +26 -26
- package/lib/internal/template/toggle/styles.selectors.js +10 -10
- package/lib/internal/template/top-navigation/parts/overflow-menu/menu-item.d.ts.map +1 -1
- package/lib/internal/template/top-navigation/parts/overflow-menu/menu-item.js +2 -2
- package/lib/internal/template/top-navigation/parts/overflow-menu/menu-item.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,50 +2,50 @@
|
|
|
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
|
-
"input": "
|
|
7
|
-
"input-readonly": "awsui_input-
|
|
8
|
-
"input-invalid": "awsui_input-
|
|
9
|
-
"input-warning": "awsui_input-
|
|
10
|
-
"input-type-search": "awsui_input-type-
|
|
11
|
-
"input-has-icon-start": "awsui_input-has-icon-
|
|
12
|
-
"input-has-icon-end": "awsui_input-has-icon-
|
|
13
|
-
"input-container": "awsui_input-
|
|
14
|
-
"input-field": "awsui_input-
|
|
15
|
-
"input-field-has-inline-content": "awsui_input-field-has-inline-
|
|
16
|
-
"input-field-readonly": "awsui_input-field-
|
|
17
|
-
"input-field-disabled": "awsui_input-field-
|
|
18
|
-
"input-field-invalid": "awsui_input-field-
|
|
19
|
-
"input-field-warning": "awsui_input-field-
|
|
20
|
-
"input-field-no-border-radius": "awsui_input-field-no-border-
|
|
21
|
-
"grouped": "
|
|
22
|
-
"grouped-horizontal-first": "awsui_grouped-horizontal-
|
|
23
|
-
"grouped-horizontal-middle": "awsui_grouped-horizontal-
|
|
24
|
-
"grouped-horizontal-last": "awsui_grouped-horizontal-
|
|
25
|
-
"grouped-vertical-first": "awsui_grouped-vertical-
|
|
26
|
-
"grouped-vertical-middle": "awsui_grouped-vertical-
|
|
27
|
-
"grouped-vertical-last": "awsui_grouped-vertical-
|
|
28
|
-
"grouped-with-action": "awsui_grouped-with-
|
|
29
|
-
"grouped-with-error": "awsui_grouped-with-
|
|
30
|
-
"grouped-horizontal-only": "awsui_grouped-horizontal-
|
|
31
|
-
"grouped-vertical-only": "awsui_grouped-vertical-
|
|
32
|
-
"grouped-with-warning": "awsui_grouped-with-
|
|
33
|
-
"grouped-vertical": "awsui_grouped-
|
|
34
|
-
"grouped-horizontal": "awsui_grouped-
|
|
35
|
-
"input-prefix": "awsui_input-
|
|
36
|
-
"input-suffix": "awsui_input-
|
|
37
|
-
"input-adornment-content": "awsui_input-adornment-
|
|
38
|
-
"input-adornment-divider": "awsui_input-adornment-
|
|
39
|
-
"input-inline-content": "awsui_input-inline-
|
|
40
|
-
"input-icon-start": "awsui_input-icon-
|
|
41
|
-
"input-icon-start-disabled": "awsui_input-icon-start-
|
|
42
|
-
"input-icon-end": "awsui_input-icon-
|
|
43
|
-
"input-button-right": "awsui_input-button-
|
|
44
|
-
"inline-label-trigger-wrapper": "awsui_inline-label-trigger-
|
|
45
|
-
"inline-label-trigger-wrapper-full-width": "awsui_inline-label-trigger-wrapper-full-
|
|
46
|
-
"inline-label-wrapper": "awsui_inline-label-
|
|
47
|
-
"inline-label-wrapper-full-width": "awsui_inline-label-wrapper-full-
|
|
48
|
-
"inline-label": "awsui_inline-
|
|
49
|
-
"inline-label-disabled": "awsui_inline-label-
|
|
5
|
+
"root": "awsui_root_2rhyz_k0n5s_32",
|
|
6
|
+
"input": "awsui_input_2rhyz_k0n5s_36",
|
|
7
|
+
"input-readonly": "awsui_input-readonly_2rhyz_k0n5s_89",
|
|
8
|
+
"input-invalid": "awsui_input-invalid_2rhyz_k0n5s_122",
|
|
9
|
+
"input-warning": "awsui_input-warning_2rhyz_k0n5s_125",
|
|
10
|
+
"input-type-search": "awsui_input-type-search_2rhyz_k0n5s_128",
|
|
11
|
+
"input-has-icon-start": "awsui_input-has-icon-start_2rhyz_k0n5s_138",
|
|
12
|
+
"input-has-icon-end": "awsui_input-has-icon-end_2rhyz_k0n5s_141",
|
|
13
|
+
"input-container": "awsui_input-container_2rhyz_k0n5s_145",
|
|
14
|
+
"input-field": "awsui_input-field_2rhyz_k0n5s_150",
|
|
15
|
+
"input-field-has-inline-content": "awsui_input-field-has-inline-content_2rhyz_k0n5s_173",
|
|
16
|
+
"input-field-readonly": "awsui_input-field-readonly_2rhyz_k0n5s_176",
|
|
17
|
+
"input-field-disabled": "awsui_input-field-disabled_2rhyz_k0n5s_191",
|
|
18
|
+
"input-field-invalid": "awsui_input-field-invalid_2rhyz_k0n5s_199",
|
|
19
|
+
"input-field-warning": "awsui_input-field-warning_2rhyz_k0n5s_213",
|
|
20
|
+
"input-field-no-border-radius": "awsui_input-field-no-border-radius_2rhyz_k0n5s_227",
|
|
21
|
+
"grouped": "awsui_grouped_2rhyz_k0n5s_233",
|
|
22
|
+
"grouped-horizontal-first": "awsui_grouped-horizontal-first_2rhyz_k0n5s_240",
|
|
23
|
+
"grouped-horizontal-middle": "awsui_grouped-horizontal-middle_2rhyz_k0n5s_244",
|
|
24
|
+
"grouped-horizontal-last": "awsui_grouped-horizontal-last_2rhyz_k0n5s_250",
|
|
25
|
+
"grouped-vertical-first": "awsui_grouped-vertical-first_2rhyz_k0n5s_254",
|
|
26
|
+
"grouped-vertical-middle": "awsui_grouped-vertical-middle_2rhyz_k0n5s_258",
|
|
27
|
+
"grouped-vertical-last": "awsui_grouped-vertical-last_2rhyz_k0n5s_264",
|
|
28
|
+
"grouped-with-action": "awsui_grouped-with-action_2rhyz_k0n5s_268",
|
|
29
|
+
"grouped-with-error": "awsui_grouped-with-error_2rhyz_k0n5s_272",
|
|
30
|
+
"grouped-horizontal-only": "awsui_grouped-horizontal-only_2rhyz_k0n5s_300",
|
|
31
|
+
"grouped-vertical-only": "awsui_grouped-vertical-only_2rhyz_k0n5s_300",
|
|
32
|
+
"grouped-with-warning": "awsui_grouped-with-warning_2rhyz_k0n5s_306",
|
|
33
|
+
"grouped-vertical": "awsui_grouped-vertical_2rhyz_k0n5s_254",
|
|
34
|
+
"grouped-horizontal": "awsui_grouped-horizontal_2rhyz_k0n5s_240",
|
|
35
|
+
"input-prefix": "awsui_input-prefix_2rhyz_k0n5s_367",
|
|
36
|
+
"input-suffix": "awsui_input-suffix_2rhyz_k0n5s_368",
|
|
37
|
+
"input-adornment-content": "awsui_input-adornment-content_2rhyz_k0n5s_382",
|
|
38
|
+
"input-adornment-divider": "awsui_input-adornment-divider_2rhyz_k0n5s_391",
|
|
39
|
+
"input-inline-content": "awsui_input-inline-content_2rhyz_k0n5s_400",
|
|
40
|
+
"input-icon-start": "awsui_input-icon-start_2rhyz_k0n5s_432",
|
|
41
|
+
"input-icon-start-disabled": "awsui_input-icon-start-disabled_2rhyz_k0n5s_439",
|
|
42
|
+
"input-icon-end": "awsui_input-icon-end_2rhyz_k0n5s_443",
|
|
43
|
+
"input-button-right": "awsui_input-button-right_2rhyz_k0n5s_449",
|
|
44
|
+
"inline-label-trigger-wrapper": "awsui_inline-label-trigger-wrapper_2rhyz_k0n5s_453",
|
|
45
|
+
"inline-label-trigger-wrapper-full-width": "awsui_inline-label-trigger-wrapper-full-width_2rhyz_k0n5s_456",
|
|
46
|
+
"inline-label-wrapper": "awsui_inline-label-wrapper_2rhyz_k0n5s_460",
|
|
47
|
+
"inline-label-wrapper-full-width": "awsui_inline-label-wrapper-full-width_2rhyz_k0n5s_463",
|
|
48
|
+
"inline-label": "awsui_inline-label_2rhyz_k0n5s_453",
|
|
49
|
+
"inline-label-disabled": "awsui_inline-label-disabled_2rhyz_k0n5s_488"
|
|
50
50
|
};
|
|
51
51
|
|
|
@@ -283,7 +283,7 @@ const AutosuggestInput = React.forwardRef(({ value, onChange, onBlur, onFocus, o
|
|
|
283
283
|
setTokensOverflowOpen(false);
|
|
284
284
|
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
285
285
|
} }));
|
|
286
|
-
const dropdown = (React.createElement(InternalDropdown, { styleClassNames: {
|
|
286
|
+
const dropdown = (React.createElement(InternalDropdown, { styleClassNames: { root: styleClassNames === null || styleClassNames === void 0 ? void 0 : styleClassNames.dropdown }, minWidth: getDropdownMinWidth({ expandToViewport, triggerWidth, dropdownWidth }), maxWidth: getBreakpointValue('xxs'), contentKey: dropdownContentKey, onFocus: handleFocus, onBlur: handleBlur, trigger: React.createElement(InternalInput, { type: "visualSearch", value: value, onChange: event => handleChange(event.detail.value), __onDelayedInput: event => handleDelayedInput(event.detail.value), onKeyDown: handleKeyDown, onKeyUp: onKeyUp, disabled: disabled, disableBrowserAutocorrect: disableBrowserAutocorrect, readOnly: readOnly, ariaRequired: ariaRequired, clearAriaLabel: clearAriaLabel, ref: inputRef, __internalRootRef: mergedContainerRef, autoComplete: false, nativeInputAttributes: processAttributes(nativeAttributes, 'Autosuggest', nativeInputAttributes), __skipNativeAttributesWarnings: Object.keys(nativeAttributes), style: style, styleClassNames: styleClassNames === null || styleClassNames === void 0 ? void 0 : styleClassNames.input, ...formFieldContext, __inlineContent: inlineTokens }), onMouseDown: handleDropdownMouseDown, open: open && (!!dropdownContent || !!dropdownFooter), footer: dropdownFooterRef && (React.createElement("div", { ref: dropdownFooterRef, className: styles['dropdown-footer'], onKeyDown: handleDropdownKeyDown },
|
|
287
287
|
React.createElement(ResetGroupedControlContext, null, open && dropdownFooter ? dropdownFooter : null))), expandToViewport: expandToViewport, loopFocus: loopFocus, content: open && dropdownContent ? (React.createElement("div", { ref: dropdownContentRef, className: styles['dropdown-content'] },
|
|
288
288
|
React.createElement(ResetGroupedControlContext, null, dropdownContent))) : null }));
|
|
289
289
|
return (React.createElement("div", { ...baseProps, className: clsx(baseProps.className, styles.root), ref: __internalRootRef, ...(isTokenMode && {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/autosuggest-input/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAO,SAAS,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrF,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAIhG,OAAO,gBAAgB,MAAM,4BAA4B,CAAC;AAS1D,OAAO,aAA0D,MAAM,yBAAyB,CAAC;AACjG,OAAO,kBAAkB,MAAM,+BAA+B,CAAC;AAC/D,OAAO,aAAa,MAAM,yBAAyB,CAAC;AAIpD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC3G,OAAO,EAAE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.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { Ref, useEffect, useImperativeHandle, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, useResizeObserver } from '@cloudscape-design/component-toolkit/internal';\n\nimport { AutosuggestProps } from '../../../autosuggest/interfaces';\nimport { ExpandToViewport } from '../../../dropdown/interfaces';\nimport InternalDropdown from '../../../dropdown/internal';\nimport {\n BaseChangeDetail,\n BaseInputProps,\n InputAutoCorrect,\n InputClearLabel,\n InputKeyEvents,\n InputProps,\n} from '../../../input/interfaces';\nimport InternalInput, { StyleClassNames as InputStyleClassNames } from '../../../input/internal';\nimport InternalLiveRegion from '../../../live-region/internal';\nimport InternalToken from '../../../token/internal';\nimport { BaseComponentProps } from '../../../types/base-component';\nimport { BaseKeyDetail, NonCancelableEventHandler } from '../../../types/events';\nimport { FormFieldValidationControlProps } from '../../../types/form-field';\nimport { getBaseProps } from '../../base-component';\nimport { getBreakpointValue } from '../../breakpoints';\nimport { ResetGroupedControlContext, useGroupedControlContext } from '../../context/control-group-context';\nimport { useFormFieldContext } from '../../context/form-field-context';\nimport { fireCancelableEvent, fireNonCancelableEvent } from '../../events';\nimport { InternalBaseComponentProps } from '../../hooks/use-base-component';\nimport { useIMEComposition } from '../../hooks/use-ime-composition';\nimport { useListFocusController } from '../../hooks/use-list-focus-controller';\nimport { KeyCode } from '../../keycode';\nimport { getDropdownMinWidth } from '../../utils/get-dropdown-min-width';\nimport { nodeBelongs } from '../../utils/node-belongs';\nimport { processAttributes } from '../../utils/with-native-attributes';\nimport ButtonTrigger from '../button-trigger';\nimport { InlineTokens, InlineTokensRef } from './inline-tokens';\nimport { useTokenOverflow } from './use-token-overflow';\n\nimport styles from './styles.css.js';\n\ninterface AutosuggestInputProps\n extends BaseComponentProps,\n BaseInputProps,\n InputAutoCorrect,\n InputKeyEvents,\n InputClearLabel,\n FormFieldValidationControlProps,\n ExpandToViewport,\n InternalBaseComponentProps {\n ariaControls?: string;\n ariaActivedescendant?: string;\n dropdownExpanded?: boolean;\n dropdownContentKey?: string;\n dropdownContentFocusable?: boolean;\n dropdownContent?: React.ReactNode;\n dropdownFooter?: React.ReactNode;\n dropdownWidth?: number;\n loopFocus?: boolean;\n onCloseDropdown?: NonCancelableEventHandler<null>;\n onDelayedInput?: NonCancelableEventHandler<BaseChangeDetail>;\n onPressArrowDown?: () => void;\n onPressArrowUp?: () => void;\n onPressEnter?: () => boolean;\n style?: InputProps['style'];\n tokens?: ReadonlyArray<AutosuggestProps.Token>;\n tokenOverflowAriaLabel?: (hiddenCount: number) => string;\n tokenInsertedAnnouncement?: (value: string) => string;\n tokenDismissLabel?: (value: string) => string;\n styleClassNames?: { input?: InputStyleClassNames; dropdown?: string };\n}\n\ninterface AutosuggestInputFocusOptions {\n preventDropdown?: boolean;\n}\n\nexport interface AutosuggestInputRef extends AutosuggestProps.Ref {\n focus(options?: AutosuggestInputFocusOptions): void;\n open(): void;\n close(): void;\n addToken(value: string): void;\n}\n\nconst AutosuggestInput = React.forwardRef(\n (\n {\n value,\n onChange,\n onBlur,\n onFocus,\n onKeyUp,\n onKeyDown,\n name,\n placeholder,\n disabled,\n readOnly,\n autoFocus,\n ariaLabel,\n ariaRequired,\n disableBrowserAutocorrect = false,\n expandToViewport,\n ariaControls,\n ariaActivedescendant,\n clearAriaLabel,\n dropdownExpanded = true,\n dropdownContentKey,\n dropdownContentFocusable = false,\n dropdownContent = null,\n dropdownFooter = null,\n dropdownWidth,\n loopFocus,\n nativeInputAttributes,\n onCloseDropdown,\n onDelayedInput,\n onPressArrowDown,\n onPressArrowUp,\n onPressEnter,\n style,\n tokens,\n tokenOverflowAriaLabel,\n tokenInsertedAnnouncement,\n tokenDismissLabel,\n styleClassNames,\n __internalRootRef,\n ...restProps\n }: AutosuggestInputProps,\n ref: Ref<AutosuggestInputRef>\n ) => {\n const isTokenMode = !!tokens;\n const tokenList = tokens ?? [];\n\n const baseProps = getBaseProps(restProps);\n const formFieldContext = useFormFieldContext(restProps);\n const groupedControlProps = useGroupedControlContext();\n\n const inputRef = useRef<HTMLInputElement>(null);\n // The field box, not the borderless native input, is the visible trigger whose width the dropdown follows.\n const inputContainerRef = useRef<HTMLDivElement>(null);\n const dropdownContentRef = useRef<HTMLDivElement>(null);\n const dropdownFooterRef = useRef<HTMLDivElement>(null);\n const preventOpenOnFocusRef = useRef(false);\n const preventCloseOnBlurRef = useRef(false);\n\n const inlineTokensRootRef = useRef<HTMLDivElement>(null);\n const measureRef = useRef<HTMLDivElement>(null);\n const measureTriggerRef = useRef<HTMLButtonElement>(null);\n const inlineTokensRef = useRef<InlineTokensRef>(null);\n\n const [triggerWidth, setTriggerWidth] = useState<number | null>(null);\n useResizeObserver(\n () => inputContainerRef.current,\n entry => setTriggerWidth(entry.borderBoxWidth)\n );\n\n const [open, setOpen] = useState(false);\n const [tokensOverflowOpen, setTokensOverflowOpen] = useState(false);\n const [announcement, setAnnouncement] = useState('');\n\n const visibleCount = useTokenOverflow({\n enabled: isTokenMode,\n tokenCount: tokenList.length,\n tokenContentKey: tokenList.map(token => `${token.value}::${token.icon ? 'icon' : 'no-icon'}`).join('\\n'),\n measureRef,\n measureTriggerRef,\n tokensRef: inlineTokensRootRef,\n inputRef,\n fieldWidth: triggerWidth,\n layoutKey: [\n formFieldContext.invalid,\n formFieldContext.warning,\n disabled,\n readOnly,\n groupedControlProps.position,\n ].join(),\n });\n const hiddenCount = tokenList.length - visibleCount;\n\n const [nextFocusTokenIndex, setNextFocusTokenIndex] = useState<number | null>(null);\n const focusControllerRef = useListFocusController({\n nextFocusIndex: nextFocusTokenIndex === null ? null : Math.max(0, nextFocusTokenIndex - hiddenCount),\n onFocusMoved: (target, targetType) => {\n if (targetType === 'fallback') {\n preventOpenOnFocusRef.current = true;\n }\n target.focus();\n setNextFocusTokenIndex(null);\n },\n listItemSelector: `.${styles['token-list-item']} button`,\n showMoreSelector: `.${styles['token-overflow-trigger']}`,\n fallbackSelector: 'input',\n });\n const mergedContainerRef = useMergeRefs(inputContainerRef, focusControllerRef);\n\n useEffect(() => {\n if (!tokensOverflowOpen || (hiddenCount > 0 && !disabled)) {\n return;\n }\n setTokensOverflowOpen(false);\n if (!disabled && !nodeBelongs(inputContainerRef.current, document.activeElement)) {\n setNextFocusTokenIndex(0);\n }\n }, [tokensOverflowOpen, hiddenCount, disabled]);\n\n const openDropdown = () => !readOnly && setOpen(true);\n\n const closeDropdown = () => {\n setOpen(false);\n fireNonCancelableEvent(onCloseDropdown, null);\n };\n\n const { isComposing } = useIMEComposition(inputRef);\n\n const addToken = (tokenValue: string) => {\n if (!tokenValue || readOnly || disabled) {\n return;\n }\n fireNonCancelableEvent(onChange, { value: '', tokens: [...tokenList, { value: tokenValue }] });\n setAnnouncement(tokenInsertedAnnouncement?.(tokenValue) ?? tokenValue);\n };\n\n const removeToken = (index: number, source: 'inline' | 'overflow') => {\n fireNonCancelableEvent(onChange, { value, tokens: tokenList.filter((_, i) => i !== index) });\n if (source === 'inline') {\n setNextFocusTokenIndex(index);\n }\n };\n\n useImperativeHandle(ref, () => ({\n focus(options?: AutosuggestInputFocusOptions) {\n if (options?.preventDropdown) {\n preventOpenOnFocusRef.current = true;\n }\n inputRef.current?.focus();\n },\n select() {\n inputRef.current?.select();\n },\n open: openDropdown,\n close: closeDropdown,\n addToken,\n }));\n\n const handleBlur = () => {\n if (!preventCloseOnBlurRef.current) {\n closeDropdown();\n fireNonCancelableEvent(onBlur, null);\n }\n };\n\n const handleFocus = () => {\n if (!preventOpenOnFocusRef.current) {\n openDropdown();\n fireNonCancelableEvent(onFocus, null);\n }\n preventOpenOnFocusRef.current = false;\n };\n\n const fireKeydown = (event: CustomEvent<BaseKeyDetail>) => fireCancelableEvent(onKeyDown, event.detail, event);\n\n const clearValue = () =>\n fireNonCancelableEvent(onChange, isTokenMode ? { value: '', tokens: tokenList } : { value: '' });\n\n // Shared ESC key handler logic for both input and dropdown elements\n // When returnFocus is true (from dropdown elements), focus returns to input after closing\n const handleEscapeKey = (returnFocus: boolean) => {\n if (open) {\n closeDropdown();\n if (returnFocus) {\n // Return focus to input when closing from dropdown elements (e.g., recovery button)\n inputRef.current?.focus();\n }\n } else if (value) {\n clearValue();\n }\n };\n\n const handleKeyDown = (event: CustomEvent<BaseKeyDetail>) => {\n switch (event.detail.keyCode) {\n case KeyCode.down: {\n onPressArrowDown?.();\n openDropdown();\n event.preventDefault();\n break;\n }\n case KeyCode.up: {\n onPressArrowUp?.();\n openDropdown();\n event.preventDefault();\n break;\n }\n case KeyCode.enter: {\n if (isComposing()) {\n event.preventDefault();\n return;\n }\n\n if (open) {\n if (!onPressEnter?.()) {\n closeDropdown();\n }\n event.preventDefault();\n } else if (isTokenMode && value) {\n addToken(value.trim());\n event.preventDefault();\n }\n fireKeydown(event);\n break;\n }\n case KeyCode.backspace: {\n if (isTokenMode && !readOnly && !disabled && value === '' && tokenList.length > 0) {\n inlineTokensRef.current?.focusLast();\n event.preventDefault();\n }\n fireKeydown(event);\n break;\n }\n case KeyCode.escape: {\n // Use shared ESC handler, without focus restoration since ESC came from input\n handleEscapeKey(false);\n if (open || value) {\n event.stopPropagation();\n }\n event.preventDefault();\n fireKeydown(event);\n break;\n }\n default: {\n fireKeydown(event);\n }\n }\n };\n\n const handleChange = (value: string) => {\n openDropdown();\n fireNonCancelableEvent(onChange, isTokenMode ? { value, tokens: tokenList } : { value });\n };\n\n const handleDelayedInput = (value: string) => {\n fireNonCancelableEvent(onDelayedInput, { value });\n };\n\n const handleDropdownMouseDown: React.MouseEventHandler = event => {\n // Prevent currently focused element from losing focus.\n if (!dropdownContentFocusable) {\n event.preventDefault();\n }\n // Prevent closing dropdown on click inside.\n else {\n preventCloseOnBlurRef.current = true;\n requestAnimationFrame(() => {\n preventCloseOnBlurRef.current = false;\n });\n }\n };\n\n const expanded = open && dropdownExpanded;\n const nativeAttributes: BaseInputProps['nativeInputAttributes'] = {\n name,\n placeholder,\n autoFocus,\n onClick: openDropdown,\n role: 'combobox',\n 'aria-autocomplete': 'list',\n 'aria-expanded': expanded,\n 'aria-controls': open ? ariaControls : undefined,\n // 'aria-owns' needed for safari+vo to announce activedescendant content\n 'aria-owns': open ? ariaControls : undefined,\n 'aria-label': ariaLabel,\n 'aria-activedescendant': ariaActivedescendant,\n };\n\n // Closes dropdown when outside click is detected.\n // Similar to the internal dropdown implementation but includes the target as well.\n useEffect(() => {\n if (!open) {\n return;\n }\n\n const clickListener = (event: MouseEvent) => {\n if (\n !nodeBelongs(inputContainerRef.current, event.target) &&\n !nodeBelongs(dropdownContentRef.current, event.target) &&\n !nodeBelongs(dropdownFooterRef.current, event.target)\n ) {\n closeDropdown();\n }\n };\n\n window.addEventListener('mousedown', clickListener);\n\n return () => {\n window.removeEventListener('mousedown', clickListener);\n };\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [open]);\n\n const handleDropdownKeyDown: React.KeyboardEventHandler = event => {\n // Handle ESC key from focusable elements inside the dropdown (e.g., recovery button)\n // but NOT from the input itself (that's handled by handleKeyDown)\n const isFromInput = event.target === inputRef.current || nodeBelongs(inputRef.current, event.target);\n\n if (event.key === 'Escape' && !isFromInput) {\n event.stopPropagation();\n event.preventDefault();\n // Use shared ESC handler with focus restoration since ESC came from dropdown element\n handleEscapeKey(true);\n }\n };\n\n const inlineTokens = tokenList.length > 0 && (\n <InlineTokens\n ref={inlineTokensRef}\n rootRef={inlineTokensRootRef}\n tokens={tokenList}\n visibleCount={visibleCount}\n disabled={disabled}\n readOnly={readOnly}\n expandToViewport={expandToViewport}\n overflowOpen={tokensOverflowOpen}\n tokenDismissLabel={tokenDismissLabel}\n tokenOverflowAriaLabel={tokenOverflowAriaLabel}\n onOverflowOpenChange={isOpen => {\n if (isOpen) {\n closeDropdown();\n }\n setTokensOverflowOpen(isOpen);\n }}\n onDismiss={removeToken}\n onFocusEnter={() => (preventOpenOnFocusRef.current = true)}\n onNavigateToInput={() => {\n setTokensOverflowOpen(false);\n inputRef.current?.focus();\n }}\n />\n );\n\n const dropdown = (\n <InternalDropdown\n styleClassNames={{ container: styleClassNames?.dropdown }}\n minWidth={getDropdownMinWidth({ expandToViewport, triggerWidth, dropdownWidth })}\n maxWidth={getBreakpointValue('xxs')} // AWSUI-19898\n contentKey={dropdownContentKey}\n onFocus={handleFocus}\n onBlur={handleBlur}\n trigger={\n <InternalInput\n type=\"visualSearch\"\n value={value}\n onChange={event => handleChange(event.detail.value)}\n __onDelayedInput={event => handleDelayedInput(event.detail.value)}\n onKeyDown={handleKeyDown}\n onKeyUp={onKeyUp}\n disabled={disabled}\n disableBrowserAutocorrect={disableBrowserAutocorrect}\n readOnly={readOnly}\n ariaRequired={ariaRequired}\n clearAriaLabel={clearAriaLabel}\n ref={inputRef}\n __internalRootRef={mergedContainerRef}\n autoComplete={false}\n nativeInputAttributes={processAttributes(nativeAttributes, 'Autosuggest', nativeInputAttributes)}\n __skipNativeAttributesWarnings={Object.keys(nativeAttributes)}\n style={style}\n styleClassNames={styleClassNames?.input}\n {...formFieldContext}\n __inlineContent={inlineTokens}\n />\n }\n onMouseDown={handleDropdownMouseDown}\n open={open && (!!dropdownContent || !!dropdownFooter)}\n footer={\n dropdownFooterRef && (\n <div ref={dropdownFooterRef} className={styles['dropdown-footer']} onKeyDown={handleDropdownKeyDown}>\n <ResetGroupedControlContext>{open && dropdownFooter ? dropdownFooter : null}</ResetGroupedControlContext>\n </div>\n )\n }\n expandToViewport={expandToViewport}\n loopFocus={loopFocus}\n content={\n open && dropdownContent ? (\n <div ref={dropdownContentRef} className={styles['dropdown-content']}>\n <ResetGroupedControlContext>{dropdownContent}</ResetGroupedControlContext>\n </div>\n ) : null\n }\n />\n );\n\n return (\n <div\n {...baseProps}\n className={clsx(baseProps.className, styles.root)}\n ref={__internalRootRef}\n {...(isTokenMode && {\n role: 'group',\n 'aria-label': formFieldContext.ariaLabelledby ? undefined : ariaLabel,\n 'aria-labelledby': formFieldContext.ariaLabelledby,\n })}\n >\n {isTokenMode ? (\n <>\n <InternalLiveRegion tagName=\"span\" hidden={true} assertive={true} delay={1}>\n {announcement}\n </InternalLiveRegion>\n <div ref={measureRef} className={styles['measurement-container']}>\n {tokenList.map((token, index) => (\n <span key={index} className={styles['measurement-token']}>\n <InternalToken label={token.value} icon={token.icon} variant=\"inline\" onDismiss={() => {}} />\n </span>\n ))}\n <ButtonTrigger ref={measureTriggerRef} compact={true} tabIndex={-1} ariaHasPopup={false}>\n {`+${tokenList.length}`}\n </ButtonTrigger>\n </div>\n {dropdown}\n </>\n ) : (\n dropdown\n )}\n </div>\n );\n }\n);\n\nexport default AutosuggestInput;\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/autosuggest-input/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAO,SAAS,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrF,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAIhG,OAAO,gBAAgB,MAAM,4BAA4B,CAAC;AAS1D,OAAO,aAA0D,MAAM,yBAAyB,CAAC;AACjG,OAAO,kBAAkB,MAAM,+BAA+B,CAAC;AAC/D,OAAO,aAAa,MAAM,yBAAyB,CAAC;AAIpD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC3G,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAE3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAA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EAAE,OAAO;YACb,YAAY,EAAE,gBAAgB,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;YACrE,iBAAiB,EAAE,gBAAgB,CAAC,cAAc;SACnD,CAAC,IAED,WAAW,CAAC,CAAC,CAAC,CACb;QACE,oBAAC,kBAAkB,IAAC,OAAO,EAAC,MAAM,EAAC,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,IACvE,YAAY,CACM;QACrB,6BAAK,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,CAAC,uBAAuB,CAAC;YAC7D,SAAS,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAC/B,8BAAM,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,mBAAmB,CAAC;gBACtD,oBAAC,aAAa,IAAC,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,EAAC,QAAQ,EAAC,SAAS,EAAE,GAAG,EAAE,GAAE,CAAC,GAAI,CACxF,CACR,CAAC;YACF,oBAAC,aAAa,IAAC,GAAG,EAAE,iBAAiB,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,YAAY,EAAE,KAAK,IACpF,IAAI,SAAS,CAAC,MAAM,EAAE,CACT,CACZ;QACL,QAAQ,CACR,CACJ,CAAC,CAAC,CAAC,CACF,QAAQ,CACT,CACG,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { Ref, useEffect, useImperativeHandle, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, useResizeObserver } from '@cloudscape-design/component-toolkit/internal';\n\nimport { AutosuggestProps } from '../../../autosuggest/interfaces';\nimport { ExpandToViewport } from '../../../dropdown/interfaces';\nimport InternalDropdown from '../../../dropdown/internal';\nimport {\n BaseChangeDetail,\n BaseInputProps,\n InputAutoCorrect,\n InputClearLabel,\n InputKeyEvents,\n InputProps,\n} from '../../../input/interfaces';\nimport InternalInput, { StyleClassNames as InputStyleClassNames } from '../../../input/internal';\nimport InternalLiveRegion from '../../../live-region/internal';\nimport InternalToken from '../../../token/internal';\nimport { BaseComponentProps } from '../../../types/base-component';\nimport { BaseKeyDetail, NonCancelableEventHandler } from '../../../types/events';\nimport { FormFieldValidationControlProps } from '../../../types/form-field';\nimport { getBaseProps } from '../../base-component';\nimport { getBreakpointValue } from '../../breakpoints';\nimport { ResetGroupedControlContext, useGroupedControlContext } from '../../context/control-group-context';\nimport { useFormFieldContext } from '../../context/form-field-context';\nimport { fireCancelableEvent, fireNonCancelableEvent } from '../../events';\nimport { InternalBaseComponentProps } from '../../hooks/use-base-component';\nimport { useIMEComposition } from '../../hooks/use-ime-composition';\nimport { useListFocusController } from '../../hooks/use-list-focus-controller';\nimport { KeyCode } from '../../keycode';\nimport { getDropdownMinWidth } from '../../utils/get-dropdown-min-width';\nimport { nodeBelongs } from '../../utils/node-belongs';\nimport { processAttributes } from '../../utils/with-native-attributes';\nimport ButtonTrigger from '../button-trigger';\nimport { InlineTokens, InlineTokensRef } from './inline-tokens';\nimport { useTokenOverflow } from './use-token-overflow';\n\nimport styles from './styles.css.js';\n\ninterface AutosuggestInputProps\n extends BaseComponentProps,\n BaseInputProps,\n InputAutoCorrect,\n InputKeyEvents,\n InputClearLabel,\n FormFieldValidationControlProps,\n ExpandToViewport,\n InternalBaseComponentProps {\n ariaControls?: string;\n ariaActivedescendant?: string;\n dropdownExpanded?: boolean;\n dropdownContentKey?: string;\n dropdownContentFocusable?: boolean;\n dropdownContent?: React.ReactNode;\n dropdownFooter?: React.ReactNode;\n dropdownWidth?: number;\n loopFocus?: boolean;\n onCloseDropdown?: NonCancelableEventHandler<null>;\n onDelayedInput?: NonCancelableEventHandler<BaseChangeDetail>;\n onPressArrowDown?: () => void;\n onPressArrowUp?: () => void;\n onPressEnter?: () => boolean;\n style?: InputProps['style'];\n tokens?: ReadonlyArray<AutosuggestProps.Token>;\n tokenOverflowAriaLabel?: (hiddenCount: number) => string;\n tokenInsertedAnnouncement?: (value: string) => string;\n tokenDismissLabel?: (value: string) => string;\n styleClassNames?: { input?: InputStyleClassNames; dropdown?: string };\n}\n\ninterface AutosuggestInputFocusOptions {\n preventDropdown?: boolean;\n}\n\nexport interface AutosuggestInputRef extends AutosuggestProps.Ref {\n focus(options?: AutosuggestInputFocusOptions): void;\n open(): void;\n close(): void;\n addToken(value: string): void;\n}\n\nconst AutosuggestInput = React.forwardRef(\n (\n {\n value,\n onChange,\n onBlur,\n onFocus,\n onKeyUp,\n onKeyDown,\n name,\n placeholder,\n disabled,\n readOnly,\n autoFocus,\n ariaLabel,\n ariaRequired,\n disableBrowserAutocorrect = false,\n expandToViewport,\n ariaControls,\n ariaActivedescendant,\n clearAriaLabel,\n dropdownExpanded = true,\n dropdownContentKey,\n dropdownContentFocusable = false,\n dropdownContent = null,\n dropdownFooter = null,\n dropdownWidth,\n loopFocus,\n nativeInputAttributes,\n onCloseDropdown,\n onDelayedInput,\n onPressArrowDown,\n onPressArrowUp,\n onPressEnter,\n style,\n tokens,\n tokenOverflowAriaLabel,\n tokenInsertedAnnouncement,\n tokenDismissLabel,\n styleClassNames,\n __internalRootRef,\n ...restProps\n }: AutosuggestInputProps,\n ref: Ref<AutosuggestInputRef>\n ) => {\n const isTokenMode = !!tokens;\n const tokenList = tokens ?? [];\n\n const baseProps = getBaseProps(restProps);\n const formFieldContext = useFormFieldContext(restProps);\n const groupedControlProps = useGroupedControlContext();\n\n const inputRef = useRef<HTMLInputElement>(null);\n // The field box, not the borderless native input, is the visible trigger whose width the dropdown follows.\n const inputContainerRef = useRef<HTMLDivElement>(null);\n const dropdownContentRef = useRef<HTMLDivElement>(null);\n const dropdownFooterRef = useRef<HTMLDivElement>(null);\n const preventOpenOnFocusRef = useRef(false);\n const preventCloseOnBlurRef = useRef(false);\n\n const inlineTokensRootRef = useRef<HTMLDivElement>(null);\n const measureRef = useRef<HTMLDivElement>(null);\n const measureTriggerRef = useRef<HTMLButtonElement>(null);\n const inlineTokensRef = useRef<InlineTokensRef>(null);\n\n const [triggerWidth, setTriggerWidth] = useState<number | null>(null);\n useResizeObserver(\n () => inputContainerRef.current,\n entry => setTriggerWidth(entry.borderBoxWidth)\n );\n\n const [open, setOpen] = useState(false);\n const [tokensOverflowOpen, setTokensOverflowOpen] = useState(false);\n const [announcement, setAnnouncement] = useState('');\n\n const visibleCount = useTokenOverflow({\n enabled: isTokenMode,\n tokenCount: tokenList.length,\n tokenContentKey: tokenList.map(token => `${token.value}::${token.icon ? 'icon' : 'no-icon'}`).join('\\n'),\n measureRef,\n measureTriggerRef,\n tokensRef: inlineTokensRootRef,\n inputRef,\n fieldWidth: triggerWidth,\n layoutKey: [\n formFieldContext.invalid,\n formFieldContext.warning,\n disabled,\n readOnly,\n groupedControlProps.position,\n ].join(),\n });\n const hiddenCount = tokenList.length - visibleCount;\n\n const [nextFocusTokenIndex, setNextFocusTokenIndex] = useState<number | null>(null);\n const focusControllerRef = useListFocusController({\n nextFocusIndex: nextFocusTokenIndex === null ? null : Math.max(0, nextFocusTokenIndex - hiddenCount),\n onFocusMoved: (target, targetType) => {\n if (targetType === 'fallback') {\n preventOpenOnFocusRef.current = true;\n }\n target.focus();\n setNextFocusTokenIndex(null);\n },\n listItemSelector: `.${styles['token-list-item']} button`,\n showMoreSelector: `.${styles['token-overflow-trigger']}`,\n fallbackSelector: 'input',\n });\n const mergedContainerRef = useMergeRefs(inputContainerRef, focusControllerRef);\n\n useEffect(() => {\n if (!tokensOverflowOpen || (hiddenCount > 0 && !disabled)) {\n return;\n }\n setTokensOverflowOpen(false);\n if (!disabled && !nodeBelongs(inputContainerRef.current, document.activeElement)) {\n setNextFocusTokenIndex(0);\n }\n }, [tokensOverflowOpen, hiddenCount, disabled]);\n\n const openDropdown = () => !readOnly && setOpen(true);\n\n const closeDropdown = () => {\n setOpen(false);\n fireNonCancelableEvent(onCloseDropdown, null);\n };\n\n const { isComposing } = useIMEComposition(inputRef);\n\n const addToken = (tokenValue: string) => {\n if (!tokenValue || readOnly || disabled) {\n return;\n }\n fireNonCancelableEvent(onChange, { value: '', tokens: [...tokenList, { value: tokenValue }] });\n setAnnouncement(tokenInsertedAnnouncement?.(tokenValue) ?? tokenValue);\n };\n\n const removeToken = (index: number, source: 'inline' | 'overflow') => {\n fireNonCancelableEvent(onChange, { value, tokens: tokenList.filter((_, i) => i !== index) });\n if (source === 'inline') {\n setNextFocusTokenIndex(index);\n }\n };\n\n useImperativeHandle(ref, () => ({\n focus(options?: AutosuggestInputFocusOptions) {\n if (options?.preventDropdown) {\n preventOpenOnFocusRef.current = true;\n }\n inputRef.current?.focus();\n },\n select() {\n inputRef.current?.select();\n },\n open: openDropdown,\n close: closeDropdown,\n addToken,\n }));\n\n const handleBlur = () => {\n if (!preventCloseOnBlurRef.current) {\n closeDropdown();\n fireNonCancelableEvent(onBlur, null);\n }\n };\n\n const handleFocus = () => {\n if (!preventOpenOnFocusRef.current) {\n openDropdown();\n fireNonCancelableEvent(onFocus, null);\n }\n preventOpenOnFocusRef.current = false;\n };\n\n const fireKeydown = (event: CustomEvent<BaseKeyDetail>) => fireCancelableEvent(onKeyDown, event.detail, event);\n\n const clearValue = () =>\n fireNonCancelableEvent(onChange, isTokenMode ? { value: '', tokens: tokenList } : { value: '' });\n\n // Shared ESC key handler logic for both input and dropdown elements\n // When returnFocus is true (from dropdown elements), focus returns to input after closing\n const handleEscapeKey = (returnFocus: boolean) => {\n if (open) {\n closeDropdown();\n if (returnFocus) {\n // Return focus to input when closing from dropdown elements (e.g., recovery button)\n inputRef.current?.focus();\n }\n } else if (value) {\n clearValue();\n }\n };\n\n const handleKeyDown = (event: CustomEvent<BaseKeyDetail>) => {\n switch (event.detail.keyCode) {\n case KeyCode.down: {\n onPressArrowDown?.();\n openDropdown();\n event.preventDefault();\n break;\n }\n case KeyCode.up: {\n onPressArrowUp?.();\n openDropdown();\n event.preventDefault();\n break;\n }\n case KeyCode.enter: {\n if (isComposing()) {\n event.preventDefault();\n return;\n }\n\n if (open) {\n if (!onPressEnter?.()) {\n closeDropdown();\n }\n event.preventDefault();\n } else if (isTokenMode && value) {\n addToken(value.trim());\n event.preventDefault();\n }\n fireKeydown(event);\n break;\n }\n case KeyCode.backspace: {\n if (isTokenMode && !readOnly && !disabled && value === '' && tokenList.length > 0) {\n inlineTokensRef.current?.focusLast();\n event.preventDefault();\n }\n fireKeydown(event);\n break;\n }\n case KeyCode.escape: {\n // Use shared ESC handler, without focus restoration since ESC came from input\n handleEscapeKey(false);\n if (open || value) {\n event.stopPropagation();\n }\n event.preventDefault();\n fireKeydown(event);\n break;\n }\n default: {\n fireKeydown(event);\n }\n }\n };\n\n const handleChange = (value: string) => {\n openDropdown();\n fireNonCancelableEvent(onChange, isTokenMode ? { value, tokens: tokenList } : { value });\n };\n\n const handleDelayedInput = (value: string) => {\n fireNonCancelableEvent(onDelayedInput, { value });\n };\n\n const handleDropdownMouseDown: React.MouseEventHandler = event => {\n // Prevent currently focused element from losing focus.\n if (!dropdownContentFocusable) {\n event.preventDefault();\n }\n // Prevent closing dropdown on click inside.\n else {\n preventCloseOnBlurRef.current = true;\n requestAnimationFrame(() => {\n preventCloseOnBlurRef.current = false;\n });\n }\n };\n\n const expanded = open && dropdownExpanded;\n const nativeAttributes: BaseInputProps['nativeInputAttributes'] = {\n name,\n placeholder,\n autoFocus,\n onClick: openDropdown,\n role: 'combobox',\n 'aria-autocomplete': 'list',\n 'aria-expanded': expanded,\n 'aria-controls': open ? ariaControls : undefined,\n // 'aria-owns' needed for safari+vo to announce activedescendant content\n 'aria-owns': open ? ariaControls : undefined,\n 'aria-label': ariaLabel,\n 'aria-activedescendant': ariaActivedescendant,\n };\n\n // Closes dropdown when outside click is detected.\n // Similar to the internal dropdown implementation but includes the target as well.\n useEffect(() => {\n if (!open) {\n return;\n }\n\n const clickListener = (event: MouseEvent) => {\n if (\n !nodeBelongs(inputContainerRef.current, event.target) &&\n !nodeBelongs(dropdownContentRef.current, event.target) &&\n !nodeBelongs(dropdownFooterRef.current, event.target)\n ) {\n closeDropdown();\n }\n };\n\n window.addEventListener('mousedown', clickListener);\n\n return () => {\n window.removeEventListener('mousedown', clickListener);\n };\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [open]);\n\n const handleDropdownKeyDown: React.KeyboardEventHandler = event => {\n // Handle ESC key from focusable elements inside the dropdown (e.g., recovery button)\n // but NOT from the input itself (that's handled by handleKeyDown)\n const isFromInput = event.target === inputRef.current || nodeBelongs(inputRef.current, event.target);\n\n if (event.key === 'Escape' && !isFromInput) {\n event.stopPropagation();\n event.preventDefault();\n // Use shared ESC handler with focus restoration since ESC came from dropdown element\n handleEscapeKey(true);\n }\n };\n\n const inlineTokens = tokenList.length > 0 && (\n <InlineTokens\n ref={inlineTokensRef}\n rootRef={inlineTokensRootRef}\n tokens={tokenList}\n visibleCount={visibleCount}\n disabled={disabled}\n readOnly={readOnly}\n expandToViewport={expandToViewport}\n overflowOpen={tokensOverflowOpen}\n tokenDismissLabel={tokenDismissLabel}\n tokenOverflowAriaLabel={tokenOverflowAriaLabel}\n onOverflowOpenChange={isOpen => {\n if (isOpen) {\n closeDropdown();\n }\n setTokensOverflowOpen(isOpen);\n }}\n onDismiss={removeToken}\n onFocusEnter={() => (preventOpenOnFocusRef.current = true)}\n onNavigateToInput={() => {\n setTokensOverflowOpen(false);\n inputRef.current?.focus();\n }}\n />\n );\n\n const dropdown = (\n <InternalDropdown\n styleClassNames={{ root: styleClassNames?.dropdown }}\n minWidth={getDropdownMinWidth({ expandToViewport, triggerWidth, dropdownWidth })}\n maxWidth={getBreakpointValue('xxs')} // AWSUI-19898\n contentKey={dropdownContentKey}\n onFocus={handleFocus}\n onBlur={handleBlur}\n trigger={\n <InternalInput\n type=\"visualSearch\"\n value={value}\n onChange={event => handleChange(event.detail.value)}\n __onDelayedInput={event => handleDelayedInput(event.detail.value)}\n onKeyDown={handleKeyDown}\n onKeyUp={onKeyUp}\n disabled={disabled}\n disableBrowserAutocorrect={disableBrowserAutocorrect}\n readOnly={readOnly}\n ariaRequired={ariaRequired}\n clearAriaLabel={clearAriaLabel}\n ref={inputRef}\n __internalRootRef={mergedContainerRef}\n autoComplete={false}\n nativeInputAttributes={processAttributes(nativeAttributes, 'Autosuggest', nativeInputAttributes)}\n __skipNativeAttributesWarnings={Object.keys(nativeAttributes)}\n style={style}\n styleClassNames={styleClassNames?.input}\n {...formFieldContext}\n __inlineContent={inlineTokens}\n />\n }\n onMouseDown={handleDropdownMouseDown}\n open={open && (!!dropdownContent || !!dropdownFooter)}\n footer={\n dropdownFooterRef && (\n <div ref={dropdownFooterRef} className={styles['dropdown-footer']} onKeyDown={handleDropdownKeyDown}>\n <ResetGroupedControlContext>{open && dropdownFooter ? dropdownFooter : null}</ResetGroupedControlContext>\n </div>\n )\n }\n expandToViewport={expandToViewport}\n loopFocus={loopFocus}\n content={\n open && dropdownContent ? (\n <div ref={dropdownContentRef} className={styles['dropdown-content']}>\n <ResetGroupedControlContext>{dropdownContent}</ResetGroupedControlContext>\n </div>\n ) : null\n }\n />\n );\n\n return (\n <div\n {...baseProps}\n className={clsx(baseProps.className, styles.root)}\n ref={__internalRootRef}\n {...(isTokenMode && {\n role: 'group',\n 'aria-label': formFieldContext.ariaLabelledby ? undefined : ariaLabel,\n 'aria-labelledby': formFieldContext.ariaLabelledby,\n })}\n >\n {isTokenMode ? (\n <>\n <InternalLiveRegion tagName=\"span\" hidden={true} assertive={true} delay={1}>\n {announcement}\n </InternalLiveRegion>\n <div ref={measureRef} className={styles['measurement-container']}>\n {tokenList.map((token, index) => (\n <span key={index} className={styles['measurement-token']}>\n <InternalToken label={token.value} icon={token.icon} variant=\"inline\" onDismiss={() => {}} />\n </span>\n ))}\n <ButtonTrigger ref={measureTriggerRef} compact={true} tabIndex={-1} ariaHasPopup={false}>\n {`+${tokenList.length}`}\n </ButtonTrigger>\n </div>\n {dropdown}\n </>\n ) : (\n dropdown\n )}\n </div>\n );\n }\n);\n\nexport default AutosuggestInput;\n"]}
|
|
@@ -60,8 +60,8 @@ export interface UseListboxApi {
|
|
|
60
60
|
* Base props for the list element: id, ref and mouse handlers. With `withKeyboard`, also `onKeyDown` and
|
|
61
61
|
* `aria-activedescendant`, for a list that has focus itself (not through a filter input). With `embedded`, also
|
|
62
62
|
* `onFocus` and `onBlur`, for an embedded list: an always visible list that is a tab stop. Focus highlights the
|
|
63
|
-
* first option
|
|
64
|
-
*
|
|
63
|
+
* first selected option (in selection order), or the first option when nothing is selected, and blur clears the
|
|
64
|
+
* highlight. A hover highlight is kept on focus, so a click selects the hovered option.
|
|
65
65
|
* Callers that add native attributes spread `nativeAttributes`.
|
|
66
66
|
*/
|
|
67
67
|
getListProps(options: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-listbox.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/listbox/use-listbox.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AAIrD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EACL,yBAAyB,EACzB,aAAa,EAEd,MAAM,4CAA4C,CAAC;AAGpD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAIxD,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EA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ACzD,SAAS,EAAE,yBAAyB,CAAC,cAAc,CAAC,CAAC;IACrD,iGAAiG;IACjG,YAAY,CAAC,MAAM,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IAC5C,6EAA6E;IAC7E,SAAS,EAAE,sBAAsB,CAAC,aAAa,CAAC,CAAC;IACjD,wDAAwD;IACxD,aAAa,EAAE,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC;IACvD,2DAA2D;IAC3D,OAAO,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;IACnC;;;;;;;OAOG;IACH,YAAY,CAAC,OAAO,EAAE;QAAE,YAAY,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,aAAa,CAAC;IACpF,oCAAoC;IACpC,cAAc,CAAC,MAAM,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,GAAG,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC;IAChG,4EAA4E;IAC5E,gBAAgB,EAAE,OAAO,CAAC;IAC1B,mDAAmD;IACnD,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,EACzB,OAAO,EACP,eAAe,EAAE,mBAAmB,EACpC,SAAS,EACT,iBAAiB,EACjB,QAAQ,EACR,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,iBAAiB,EACjB,yBAAyB,GAC1B,EAAE,eAAe,GAAG,aAAa,
|
|
1
|
+
{"version":3,"file":"use-listbox.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/listbox/use-listbox.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AAIrD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACtE,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sele
|
|
|
84
84
|
listProps.nativeAttributes = { 'aria-activedescendant': activeDescendantId };
|
|
85
85
|
}
|
|
86
86
|
if (embedded) {
|
|
87
|
+
// Like opening Select or Multiselect with the keyboard: highlight the first selected option (in selection
|
|
88
|
+
// order) and scroll it into view, or the first option when nothing in the list is selected.
|
|
87
89
|
listProps.onFocus = () => {
|
|
88
|
-
if (
|
|
90
|
+
if (highlightedOption) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
const firstSelected = selectedOptions.find(option => options.includes(option));
|
|
94
|
+
if (firstSelected) {
|
|
95
|
+
highlight.highlightOptionWithKeyboard(firstSelected);
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
89
98
|
highlight.goHomeWithKeyboard();
|
|
90
99
|
}
|
|
91
100
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-listbox.js","sourceRoot":"","sources":["../../../../../src/internal/components/listbox/use-listbox.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAa,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAErD,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAM5E,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACnF,OAAO,EAGL,oBAAoB,GACrB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAGrE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,GAChB,MAAM,sBAAsB,CAAC;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C;QAChF,IAAI,YAAY,EAAE,CAAC;YACjB,SAAS,CAAC,SAAS,GAAG,SAAS,CAAC;YAChC,SAAS,CAAC,gBAAgB,GAAG,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,CAAC;QAC/E,CAAC;QACD,IAAI,QAAQ,EAAE,CAAC;YACb,SAAS,CAAC,OAAO,GAAG,GAAG,EAAE;gBACvB,IAAI,CAAC,iBAAiB,EAAE,CAAC;oBACvB,SAAS,CAAC,kBAAkB,EAAE,CAAC;gBACjC,CAAC;YACH,CAAC,CAAC;YACF,SAAS,CAAC,MAAM,GAAG,GAAG,EAAE;gBACtB,SAAS,CAAC,0BAA0B,EAAE,CAAC;YACzC,CAAC,CAAC;QACJ,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC;IAEF,OAAO;QACL,MAAM;QACN,gBAAgB;QAChB,aAAa;QACb,iBAAiB;QACjB,kBAAkB;QAClB,aAAa;QACb,eAAe;QACf,SAAS;QACT,YAAY;QACZ,SAAS;QACT,aAAa;QACb,OAAO;QACP,YAAY;QACZ,cAAc;QACd,gBAAgB;QAChB,YAAY;KACb,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { RefObject, useEffect, useRef } from 'react';\n\nimport { useUniqueId } from '@cloudscape-design/component-toolkit/internal';\n\nimport { SelectProps } from '../../../select/interfaces';\nimport { BaseKeyDetail, CancelableEventHandler } from '../../../types/events';\nimport { OptionDefinition, OptionGroup } from '../../../types/option';\nimport { DropdownOption } from '../option/interfaces';\nimport { isGroupInteractive, isInteractive } from '../option/utils/filter-options';\nimport {\n HighlightedOptionHandlers,\n HighlightType,\n useHighlightedOption,\n} from '../options-list/utils/use-highlight-option';\nimport { getOptionId } from '../options-list/utils/use-ids';\nimport { useMenuKeyboard } from '../options-list/utils/use-keyboard';\nimport { ListElementProps, ScrollToIndexRef } from './interfaces';\nimport { SelectionModel } from './selection/interfaces';\nimport { useAnnouncement } from './use-announcement';\nimport { connectOptionsByValue } from './utils/connect-options';\nimport { getListboxNavigation } from './utils/navigation';\nimport {\n getListboxOptionProps,\n getListMouseHandlers,\n getSelectableOption,\n isAnnouncedSelected,\n isHighlightable,\n} from './utils/option-props';\n\nexport interface UseListboxProps {\n /** Rendered options in list order (flattened, filtered, including select-all). */\n options: ReadonlyArray<DropdownOption>;\n /** Selected options, matched to the rendered rows by value. */\n selectedOptions: ReadonlyArray<OptionDefinition>;\n /** Group and select-all state. */\n selection: SelectionModel;\n /** Whether group headers (and select-all) can be highlighted and chosen. */\n interactiveGroups: boolean;\n /** Called with the interactive option the user chose (Enter, Space, mouse up, or `selectOption`). */\n onSelect: (option: DropdownOption) => void;\n /**\n * 'always': Space always chooses the highlighted option.\n * 'keyboard-highlight': Space chooses only while an option has a keyboard highlight, so it still types into a\n * filter input.\n */\n spaceSelects: 'always' | 'keyboard-highlight';\n /** Called when Escape is pressed. When omitted, Escape is not handled and keeps propagating. */\n onEscape?: () => void;\n /** Group of the option, announced with the highlighted option. */\n getParent: (option: DropdownOption) => undefined | OptionGroup;\n /** Added to the announcement when the highlighted option is selected. */\n selectedAriaLabel?: string;\n /** Custom announcement for the highlighted option. */\n renderHighlightedAriaLive?: SelectProps.ContainingOptionAndGroupString;\n}\n\nexport type BaseListProps = Pick<\n ListElementProps,\n 'id' | 'ref' | 'onMouseUp' | 'onMouseMove' | 'onKeyDown' | 'onFocus' | 'onBlur' | 'nativeAttributes'\n>;\nexport interface UseListboxApi {\n /** Id of the list element; row ids are `getOptionId(listId, index)`. */\n listId: string;\n highlightedIndex: number;\n highlightType: HighlightType;\n highlightedOption: DropdownOption | undefined;\n /** Id of the highlighted row, for `aria-activedescendant`; undefined when `highlightedIndex` is -1. */\n activeDescendantId: string | undefined;\n /** Pass as `ref` to the list; it is called with `highlightedIndex` whenever the highlighted index changes. */\n scrollToIndex: RefObject<ScrollToIndexRef>;\n /** `selectedOptions` connected to rendered rows, in selection order. */\n selectedOptions: ReadonlyArray<DropdownOption>;\n /** Raw highlight setters from `useHighlightedOption`. */\n highlight: HighlightedOptionHandlers<DropdownOption>;\n /** Chooses `option`, or the highlighted option when omitted. Ignores non-interactive options. */\n selectOption(option?: DropdownOption): void;\n /** Keydown handler for the element that has focus (list or filter input). */\n onKeyDown: CancelableEventHandler<BaseKeyDetail>;\n /** `onMouseUp` / `onMouseMove` for the list element. */\n mouseHandlers: ReturnType<typeof getListMouseHandlers>;\n /** Ref of the list element, also set by `getListProps`. */\n listRef: RefObject<HTMLDivElement>;\n /**\n * Base props for the list element: id, ref and mouse handlers. With `withKeyboard`, also `onKeyDown` and\n * `aria-activedescendant`, for a list that has focus itself (not through a filter input). With `embedded`, also\n * `onFocus` and `onBlur`, for an embedded list: an always visible list that is a tab stop. Focus highlights the\n * first option if nothing is highlighted, and blur clears the highlight. A hover highlight is kept on focus, so a\n * click selects the hovered option. Moving focus to the selected option is a follow-up.\n * Callers that add native attributes spread `nativeAttributes`.\n */\n getListProps(options: { withKeyboard: boolean; embedded?: boolean }): BaseListProps;\n /** Props for the row at `index`. */\n getOptionProps(option: DropdownOption, index: number): ReturnType<typeof getListboxOptionProps>;\n /** Whether the live region announces the highlighted option as selected. */\n announceSelected: boolean;\n /** Live region text for the highlighted option. */\n announcement: string;\n}\n\n/**\n * List state shared by all list components: highlight, keyboard navigation, the choose guard, mouse handlers,\n * row props, scrolling the highlighted row into view, the active descendant and the live region announcement.\n * Focus handling of an embedded list is shared through `getListProps({ embedded })`. Open state, filter,\n * type-ahead and the highlight on open stay with the callers, because they differ per component.\n */\nexport function useListbox({\n options,\n selectedOptions: selectedOptionsProp,\n selection,\n interactiveGroups,\n onSelect,\n spaceSelects,\n onEscape,\n getParent,\n selectedAriaLabel,\n renderHighlightedAriaLive,\n}: UseListboxProps): UseListboxApi {\n const listId = useUniqueId('option-list');\n const selectedOptions = connectOptionsByValue(options, selectedOptionsProp);\n const selectedSet = new Set(selectedOptions);\n const [{ highlightType, highlightedOption, highlightedIndex }, highlight] = useHighlightedOption({\n options,\n isHighlightable: (option?: DropdownOption) => isHighlightable(option, interactiveGroups),\n });\n\n const interactivityCheck = interactiveGroups ? isGroupInteractive : isInteractive;\n const selectOption = (option?: DropdownOption) => {\n const optionToSelect = getSelectableOption(option, highlightedOption, interactivityCheck);\n if (optionToSelect) {\n onSelect(optionToSelect);\n }\n };\n\n const onKeyDown = useMenuKeyboard({\n ...getListboxNavigation({\n options,\n highlightedIndex,\n highlightedOption,\n interactiveGroups,\n moveHighlight: highlight.moveHighlightWithKeyboard,\n goHome: highlight.goHomeWithKeyboard,\n goEnd: highlight.goEndWithKeyboard,\n }),\n selectOption,\n goHome: highlight.goHomeWithKeyboard,\n goEnd: highlight.goEndWithKeyboard,\n onEscape,\n // With 'keyboard-highlight', Space chooses only while an option has a keyboard highlight, and types otherwise.\n preventNativeSpace: spaceSelects === 'always' || (!!highlightedOption && highlightType.type === 'keyboard'),\n });\n\n const mouseHandlers = getListMouseHandlers({\n options,\n selectOption,\n setHighlightedIndexWithMouse: highlight.setHighlightedIndexWithMouse,\n });\n\n const getOptionProps = (option: DropdownOption, index: number) =>\n getListboxOptionProps(option, index, {\n options,\n selectedSet,\n selection,\n highlightedOption,\n interactiveGroups,\n listId,\n });\n\n const announceSelected = isAnnouncedSelected(highlightedOption, selectedSet, selection);\n const announcement = useAnnouncement({\n announceSelected,\n highlightedOption,\n getParent,\n selectedAriaLabel,\n renderHighlightedAriaLive,\n });\n\n const activeDescendantId = getOptionId(listId, highlightedIndex);\n\n // Keeps the highlighted option scrolled into view in the list passed `ref={scrollToIndex}`.\n const scrollToIndex = useRef<ScrollToIndexRef>(null);\n useEffect(() => {\n scrollToIndex.current?.(highlightedIndex);\n }, [highlightedIndex]);\n\n const listRef = useRef<HTMLDivElement>(null);\n const getListProps = ({ withKeyboard, embedded }: { withKeyboard: boolean; embedded?: boolean }) => {\n const listProps: BaseListProps = { id: listId, ref: listRef, ...mouseHandlers };\n if (withKeyboard) {\n listProps.onKeyDown = onKeyDown;\n listProps.nativeAttributes = { 'aria-activedescendant': activeDescendantId };\n }\n if (embedded) {\n listProps.onFocus = () => {\n if (!highlightedOption) {\n highlight.goHomeWithKeyboard();\n }\n };\n listProps.onBlur = () => {\n highlight.resetHighlightWithKeyboard();\n };\n }\n return listProps;\n };\n\n return {\n listId,\n highlightedIndex,\n highlightType,\n highlightedOption,\n activeDescendantId,\n scrollToIndex,\n selectedOptions,\n highlight,\n selectOption,\n onKeyDown,\n mouseHandlers,\n listRef,\n getListProps,\n getOptionProps,\n announceSelected,\n announcement,\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"use-listbox.js","sourceRoot":"","sources":["../../../../../src/internal/components/listbox/use-listbox.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAa,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAErD,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAM5E,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACnF,OAAO,EAGL,oBAAoB,GACrB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAGrE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,GAChB,MAAM,sBAAsB,CAAC;AAwE9B;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,EACzB,OAAO,EACP,eAAe,EAAE,mBAAmB,EACpC,SAAS,EACT,iBAAiB,EACjB,QAAQ,EAC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,kBAAkB,EAAE,CAAC;QAC/E,CAAC;QACD,IAAI,QAAQ,EAAE,CAAC;YACb,0GAA0G;YAC1G,4FAA4F;YAC5F,SAAS,CAAC,OAAO,GAAG,GAAG,EAAE;gBACvB,IAAI,iBAAiB,EAAE,CAAC;oBACtB,OAAO;gBACT,CAAC;gBACD,MAAM,aAAa,GAAG,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;gBAC/E,IAAI,aAAa,EAAE,CAAC;oBAClB,SAAS,CAAC,2BAA2B,CAAC,aAAa,CAAC,CAAC;gBACvD,CAAC;qBAAM,CAAC;oBACN,SAAS,CAAC,kBAAkB,EAAE,CAAC;gBACjC,CAAC;YACH,CAAC,CAAC;YACF,SAAS,CAAC,MAAM,GAAG,GAAG,EAAE;gBACtB,SAAS,CAAC,0BAA0B,EAAE,CAAC;YACzC,CAAC,CAAC;QACJ,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC;IAEF,OAAO;QACL,MAAM;QACN,gBAAgB;QAChB,aAAa;QACb,iBAAiB;QACjB,kBAAkB;QAClB,aAAa;QACb,eAAe;QACf,SAAS;QACT,YAAY;QACZ,SAAS;QACT,aAAa;QACb,OAAO;QACP,YAAY;QACZ,cAAc;QACd,gBAAgB;QAChB,YAAY;KACb,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { RefObject, useEffect, useRef } from 'react';\n\nimport { useUniqueId } from '@cloudscape-design/component-toolkit/internal';\n\nimport { SelectProps } from '../../../select/interfaces';\nimport { BaseKeyDetail, CancelableEventHandler } from '../../../types/events';\nimport { OptionDefinition, OptionGroup } from '../../../types/option';\nimport { DropdownOption } from '../option/interfaces';\nimport { isGroupInteractive, isInteractive } from '../option/utils/filter-options';\nimport {\n HighlightedOptionHandlers,\n HighlightType,\n useHighlightedOption,\n} from '../options-list/utils/use-highlight-option';\nimport { getOptionId } from '../options-list/utils/use-ids';\nimport { useMenuKeyboard } from '../options-list/utils/use-keyboard';\nimport { ListElementProps, ScrollToIndexRef } from './interfaces';\nimport { SelectionModel } from './selection/interfaces';\nimport { useAnnouncement } from './use-announcement';\nimport { connectOptionsByValue } from './utils/connect-options';\nimport { getListboxNavigation } from './utils/navigation';\nimport {\n getListboxOptionProps,\n getListMouseHandlers,\n getSelectableOption,\n isAnnouncedSelected,\n isHighlightable,\n} from './utils/option-props';\n\nexport interface UseListboxProps {\n /** Rendered options in list order (flattened, filtered, including select-all). */\n options: ReadonlyArray<DropdownOption>;\n /** Selected options, matched to the rendered rows by value. */\n selectedOptions: ReadonlyArray<OptionDefinition>;\n /** Group and select-all state. */\n selection: SelectionModel;\n /** Whether group headers (and select-all) can be highlighted and chosen. */\n interactiveGroups: boolean;\n /** Called with the interactive option the user chose (Enter, Space, mouse up, or `selectOption`). */\n onSelect: (option: DropdownOption) => void;\n /**\n * 'always': Space always chooses the highlighted option.\n * 'keyboard-highlight': Space chooses only while an option has a keyboard highlight, so it still types into a\n * filter input.\n */\n spaceSelects: 'always' | 'keyboard-highlight';\n /** Called when Escape is pressed. When omitted, Escape is not handled and keeps propagating. */\n onEscape?: () => void;\n /** Group of the option, announced with the highlighted option. */\n getParent: (option: DropdownOption) => undefined | OptionGroup;\n /** Added to the announcement when the highlighted option is selected. */\n selectedAriaLabel?: string;\n /** Custom announcement for the highlighted option. */\n renderHighlightedAriaLive?: SelectProps.ContainingOptionAndGroupString;\n}\n\nexport type BaseListProps = Pick<\n ListElementProps,\n 'id' | 'ref' | 'onMouseUp' | 'onMouseMove' | 'onKeyDown' | 'onFocus' | 'onBlur' | 'nativeAttributes'\n>;\nexport interface UseListboxApi {\n /** Id of the list element; row ids are `getOptionId(listId, index)`. */\n listId: string;\n highlightedIndex: number;\n highlightType: HighlightType;\n highlightedOption: DropdownOption | undefined;\n /** Id of the highlighted row, for `aria-activedescendant`; undefined when `highlightedIndex` is -1. */\n activeDescendantId: string | undefined;\n /** Pass as `ref` to the list; it is called with `highlightedIndex` whenever the highlighted index changes. */\n scrollToIndex: RefObject<ScrollToIndexRef>;\n /** `selectedOptions` connected to rendered rows, in selection order. */\n selectedOptions: ReadonlyArray<DropdownOption>;\n /** Raw highlight setters from `useHighlightedOption`. */\n highlight: HighlightedOptionHandlers<DropdownOption>;\n /** Chooses `option`, or the highlighted option when omitted. Ignores non-interactive options. */\n selectOption(option?: DropdownOption): void;\n /** Keydown handler for the element that has focus (list or filter input). */\n onKeyDown: CancelableEventHandler<BaseKeyDetail>;\n /** `onMouseUp` / `onMouseMove` for the list element. */\n mouseHandlers: ReturnType<typeof getListMouseHandlers>;\n /** Ref of the list element, also set by `getListProps`. */\n listRef: RefObject<HTMLDivElement>;\n /**\n * Base props for the list element: id, ref and mouse handlers. With `withKeyboard`, also `onKeyDown` and\n * `aria-activedescendant`, for a list that has focus itself (not through a filter input). With `embedded`, also\n * `onFocus` and `onBlur`, for an embedded list: an always visible list that is a tab stop. Focus highlights the\n * first selected option (in selection order), or the first option when nothing is selected, and blur clears the\n * highlight. A hover highlight is kept on focus, so a click selects the hovered option.\n * Callers that add native attributes spread `nativeAttributes`.\n */\n getListProps(options: { withKeyboard: boolean; embedded?: boolean }): BaseListProps;\n /** Props for the row at `index`. */\n getOptionProps(option: DropdownOption, index: number): ReturnType<typeof getListboxOptionProps>;\n /** Whether the live region announces the highlighted option as selected. */\n announceSelected: boolean;\n /** Live region text for the highlighted option. */\n announcement: string;\n}\n\n/**\n * List state shared by all list components: highlight, keyboard navigation, the choose guard, mouse handlers,\n * row props, scrolling the highlighted row into view, the active descendant and the live region announcement.\n * Focus handling of an embedded list is shared through `getListProps({ embedded })`. Open state, filter,\n * type-ahead and the highlight on open stay with the callers, because they differ per component.\n */\nexport function useListbox({\n options,\n selectedOptions: selectedOptionsProp,\n selection,\n interactiveGroups,\n onSelect,\n spaceSelects,\n onEscape,\n getParent,\n selectedAriaLabel,\n renderHighlightedAriaLive,\n}: UseListboxProps): UseListboxApi {\n const listId = useUniqueId('option-list');\n const selectedOptions = connectOptionsByValue(options, selectedOptionsProp);\n const selectedSet = new Set(selectedOptions);\n const [{ highlightType, highlightedOption, highlightedIndex }, highlight] = useHighlightedOption({\n options,\n isHighlightable: (option?: DropdownOption) => isHighlightable(option, interactiveGroups),\n });\n\n const interactivityCheck = interactiveGroups ? isGroupInteractive : isInteractive;\n const selectOption = (option?: DropdownOption) => {\n const optionToSelect = getSelectableOption(option, highlightedOption, interactivityCheck);\n if (optionToSelect) {\n onSelect(optionToSelect);\n }\n };\n\n const onKeyDown = useMenuKeyboard({\n ...getListboxNavigation({\n options,\n highlightedIndex,\n highlightedOption,\n interactiveGroups,\n moveHighlight: highlight.moveHighlightWithKeyboard,\n goHome: highlight.goHomeWithKeyboard,\n goEnd: highlight.goEndWithKeyboard,\n }),\n selectOption,\n goHome: highlight.goHomeWithKeyboard,\n goEnd: highlight.goEndWithKeyboard,\n onEscape,\n // With 'keyboard-highlight', Space chooses only while an option has a keyboard highlight, and types otherwise.\n preventNativeSpace: spaceSelects === 'always' || (!!highlightedOption && highlightType.type === 'keyboard'),\n });\n\n const mouseHandlers = getListMouseHandlers({\n options,\n selectOption,\n setHighlightedIndexWithMouse: highlight.setHighlightedIndexWithMouse,\n });\n\n const getOptionProps = (option: DropdownOption, index: number) =>\n getListboxOptionProps(option, index, {\n options,\n selectedSet,\n selection,\n highlightedOption,\n interactiveGroups,\n listId,\n });\n\n const announceSelected = isAnnouncedSelected(highlightedOption, selectedSet, selection);\n const announcement = useAnnouncement({\n announceSelected,\n highlightedOption,\n getParent,\n selectedAriaLabel,\n renderHighlightedAriaLive,\n });\n\n const activeDescendantId = getOptionId(listId, highlightedIndex);\n\n // Keeps the highlighted option scrolled into view in the list passed `ref={scrollToIndex}`.\n const scrollToIndex = useRef<ScrollToIndexRef>(null);\n useEffect(() => {\n scrollToIndex.current?.(highlightedIndex);\n }, [highlightedIndex]);\n\n const listRef = useRef<HTMLDivElement>(null);\n const getListProps = ({ withKeyboard, embedded }: { withKeyboard: boolean; embedded?: boolean }) => {\n const listProps: BaseListProps = { id: listId, ref: listRef, ...mouseHandlers };\n if (withKeyboard) {\n listProps.onKeyDown = onKeyDown;\n listProps.nativeAttributes = { 'aria-activedescendant': activeDescendantId };\n }\n if (embedded) {\n // Like opening Select or Multiselect with the keyboard: highlight the first selected option (in selection\n // order) and scroll it into view, or the first option when nothing in the list is selected.\n listProps.onFocus = () => {\n if (highlightedOption) {\n return;\n }\n const firstSelected = selectedOptions.find(option => options.includes(option));\n if (firstSelected) {\n highlight.highlightOptionWithKeyboard(firstSelected);\n } else {\n highlight.goHomeWithKeyboard();\n }\n };\n listProps.onBlur = () => {\n highlight.resetHighlightWithKeyboard();\n };\n }\n return listProps;\n };\n\n return {\n listId,\n highlightedIndex,\n highlightType,\n highlightedOption,\n activeDescendantId,\n scrollToIndex,\n selectedOptions,\n highlight,\n selectOption,\n onKeyDown,\n mouseHandlers,\n listRef,\n getListProps,\n getOptionProps,\n announceSelected,\n announcement,\n };\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export var PACKAGE_SOURCE = "components";
|
|
2
|
-
export var PACKAGE_VERSION = "3.0.0 (
|
|
3
|
-
export var GIT_SHA = "
|
|
2
|
+
export var PACKAGE_VERSION = "3.0.0 (6bbfd94e)";
|
|
3
|
+
export var GIT_SHA = "6bbfd94e";
|
|
4
4
|
export var THEME = "open-source-visual-refresh";
|
|
5
5
|
export var SYSTEM = "core";
|
|
6
6
|
export var ALWAYS_VISUAL_REFRESH = true;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style-slot.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/style-slot.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,IAAI,CAAC,IAAI,IAAI,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,MAAM,GAAG,SAAS,CAAC,CAAC;AAEvE,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,SAAS,EAAE,IAAI,EAAE,IAAI,sBAE/E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style-slot.js","sourceRoot":"","sources":["../../../../src/internal/utils/style-slot.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAKtC,MAAM,UAAU,iBAAiB,CAAO,IAA4B,EAAE,IAAU;IAC9E,OAAO,OAAO,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACxD,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\n// A Style API v2 slot that takes a class name, or a function of the slot arguments that returns one.\nexport type Slot<Args> = string | ((args: Args) => string | undefined);\n\nexport function getStyleClassName<Args>(slot: Slot<Args> | undefined, args: Args) {\n return typeof slot === 'function' ? slot(args) : slot;\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ItemCardProps } from './interfaces';
|
|
2
2
|
export { ItemCardProps };
|
|
3
|
-
declare const ItemCard: ({ disableHeaderPaddings, disableContentPaddings, disableFooterPaddings, variant, ...props }: ItemCardProps) => JSX.Element;
|
|
3
|
+
declare const ItemCard: ({ disableHeaderPaddings, disableContentPaddings, disableFooterPaddings, fitHeight, variant, ...props }: ItemCardProps) => JSX.Element;
|
|
4
4
|
export default ItemCard;
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/item-card/index.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7C,OAAO,EAAE,aAAa,EAAE,CAAC;AACzB,QAAA,MAAM,QAAQ,GAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/item-card/index.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7C,OAAO,EAAE,aAAa,EAAE,CAAC;AACzB,QAAA,MAAM,QAAQ,GAAI,wGAOf,aAAa,gBAwBf,CAAC;AAGF,eAAe,QAAQ,CAAC"}
|
|
@@ -6,17 +6,18 @@ import useBaseComponent from '../internal/hooks/use-base-component';
|
|
|
6
6
|
import { applyDisplayName } from '../internal/utils/apply-display-name';
|
|
7
7
|
import { getExternalProps } from '../internal/utils/external-props';
|
|
8
8
|
import InternalItemCard from './internal';
|
|
9
|
-
const ItemCard = ({ disableHeaderPaddings = false, disableContentPaddings = false, disableFooterPaddings = false, variant = 'default', ...props }) => {
|
|
9
|
+
const ItemCard = ({ disableHeaderPaddings = false, disableContentPaddings = false, disableFooterPaddings = false, fitHeight = false, variant = 'default', ...props }) => {
|
|
10
10
|
const baseComponentProps = useBaseComponent('ItemCard', {
|
|
11
11
|
props: {
|
|
12
12
|
disableHeaderPaddings,
|
|
13
13
|
disableContentPaddings,
|
|
14
14
|
disableFooterPaddings,
|
|
15
|
+
fitHeight,
|
|
15
16
|
variant,
|
|
16
17
|
},
|
|
17
18
|
});
|
|
18
19
|
const externalProps = getExternalProps(props);
|
|
19
|
-
return (React.createElement(InternalItemCard, { disableHeaderPaddings: disableHeaderPaddings, disableContentPaddings: disableContentPaddings, disableFooterPaddings: disableFooterPaddings, variant: variant, ...externalProps, ...baseComponentProps }));
|
|
20
|
+
return (React.createElement(InternalItemCard, { disableHeaderPaddings: disableHeaderPaddings, disableContentPaddings: disableContentPaddings, disableFooterPaddings: disableFooterPaddings, fitHeight: fitHeight, variant: variant, ...externalProps, ...baseComponentProps }));
|
|
20
21
|
};
|
|
21
22
|
applyDisplayName(ItemCard, 'ItemCard');
|
|
22
23
|
export default ItemCard;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/item-card/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE,OAAO,gBAAgB,MAAM,YAAY,CAAC;AAG1C,MAAM,QAAQ,GAAG,CAAC,EAChB,qBAAqB,GAAG,KAAK,EAC7B,sBAAsB,GAAG,KAAK,EAC9B,qBAAqB,GAAG,KAAK,EAC7B,OAAO,GAAG,SAAS,EACnB,GAAG,KAAK,EACM,EAAE,EAAE;IAClB,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,UAAU,EAAE;QACtD,KAAK,EAAE;YACL,qBAAqB;YACrB,sBAAsB;YACtB,qBAAqB;YACrB,OAAO;SACR;KACF,CAAC,CAAC;IAEH,MAAM,aAAa,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAE9C,OAAO,CACL,oBAAC,gBAAgB,IACf,qBAAqB,EAAE,qBAAqB,EAC5C,sBAAsB,EAAE,sBAAsB,EAC9C,qBAAqB,EAAE,qBAAqB,EAC5C,OAAO,EAAE,OAAO,KACZ,aAAa,KACb,kBAAkB,GACtB,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,gBAAgB,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;AACvC,eAAe,QAAQ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n'use client';\nimport React from 'react';\n\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { getExternalProps } from '../internal/utils/external-props';\nimport { ItemCardProps } from './interfaces';\nimport InternalItemCard from './internal';\n\nexport { ItemCardProps };\nconst ItemCard = ({\n disableHeaderPaddings = false,\n disableContentPaddings = false,\n disableFooterPaddings = false,\n variant = 'default',\n ...props\n}: ItemCardProps) => {\n const baseComponentProps = useBaseComponent('ItemCard', {\n props: {\n disableHeaderPaddings,\n disableContentPaddings,\n disableFooterPaddings,\n variant,\n },\n });\n\n const externalProps = getExternalProps(props);\n\n return (\n <InternalItemCard\n disableHeaderPaddings={disableHeaderPaddings}\n disableContentPaddings={disableContentPaddings}\n disableFooterPaddings={disableFooterPaddings}\n variant={variant}\n {...externalProps}\n {...baseComponentProps}\n />\n );\n};\n\napplyDisplayName(ItemCard, 'ItemCard');\nexport default ItemCard;\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/item-card/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE,OAAO,gBAAgB,MAAM,YAAY,CAAC;AAG1C,MAAM,QAAQ,GAAG,CAAC,EAChB,qBAAqB,GAAG,KAAK,EAC7B,sBAAsB,GAAG,KAAK,EAC9B,qBAAqB,GAAG,KAAK,EAC7B,SAAS,GAAG,KAAK,EACjB,OAAO,GAAG,SAAS,EACnB,GAAG,KAAK,EACM,EAAE,EAAE;IAClB,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,UAAU,EAAE;QACtD,KAAK,EAAE;YACL,qBAAqB;YACrB,sBAAsB;YACtB,qBAAqB;YACrB,SAAS;YACT,OAAO;SACR;KACF,CAAC,CAAC;IAEH,MAAM,aAAa,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAE9C,OAAO,CACL,oBAAC,gBAAgB,IACf,qBAAqB,EAAE,qBAAqB,EAC5C,sBAAsB,EAAE,sBAAsB,EAC9C,qBAAqB,EAAE,qBAAqB,EAC5C,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,KACZ,aAAa,KACb,kBAAkB,GACtB,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,gBAAgB,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;AACvC,eAAe,QAAQ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n'use client';\nimport React from 'react';\n\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { getExternalProps } from '../internal/utils/external-props';\nimport { ItemCardProps } from './interfaces';\nimport InternalItemCard from './internal';\n\nexport { ItemCardProps };\nconst ItemCard = ({\n disableHeaderPaddings = false,\n disableContentPaddings = false,\n disableFooterPaddings = false,\n fitHeight = false,\n variant = 'default',\n ...props\n}: ItemCardProps) => {\n const baseComponentProps = useBaseComponent('ItemCard', {\n props: {\n disableHeaderPaddings,\n disableContentPaddings,\n disableFooterPaddings,\n fitHeight,\n variant,\n },\n });\n\n const externalProps = getExternalProps(props);\n\n return (\n <InternalItemCard\n disableHeaderPaddings={disableHeaderPaddings}\n disableContentPaddings={disableContentPaddings}\n disableFooterPaddings={disableFooterPaddings}\n fitHeight={fitHeight}\n variant={variant}\n {...externalProps}\n {...baseComponentProps}\n />\n );\n};\n\napplyDisplayName(ItemCard, 'ItemCard');\nexport default ItemCard;\n"]}
|
|
@@ -44,6 +44,14 @@ export interface ItemCardProps extends BaseComponentProps {
|
|
|
44
44
|
* @default false
|
|
45
45
|
*/
|
|
46
46
|
disableFooterPaddings?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Stretches the item card to fill the available height.
|
|
49
|
+
*
|
|
50
|
+
* Use this property to align heights of multiple item cards displayed in a single row.
|
|
51
|
+
*
|
|
52
|
+
* Unlike in the [container](/components/container/) component, setting this property to `true` does not make the body scrollable if the item card overflows its parent.
|
|
53
|
+
*/
|
|
54
|
+
fitHeight?: boolean;
|
|
47
55
|
/**
|
|
48
56
|
* Specifies the visual variant of the item card, which controls the border radius and padding.
|
|
49
57
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/item-card/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D;;GAEG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,MAAM,WAAW,aAAc,SAAQ,kBAAkB;IACvD;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEzB;;OAEG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE9B;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEzB;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE1B;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B;;OAEG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEvB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;;OAGG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAEjC;;;OAGG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC;IAEhC;;;;OAIG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC,KAAK,CAAC;IAE5B;;;;;;;;;;;OAWG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,KAAK,CAAC,cAAc,CAAC,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,CAAC,EAAE;YACP,IAAI,CAAC,EAAE;gBACL,YAAY,CAAC,EAAE,MAAM,CAAC;gBACtB,aAAa,CAAC,EAAE,MAAM,CAAC;aACxB,CAAC;YACF,OAAO,CAAC,EAAE;gBACR,WAAW,CAAC,EAAE,MAAM,CAAC;gBACrB,WAAW,CAAC,EAAE,MAAM,CAAC;aACtB,CAAC;SACH,CAAC;KACH;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/item-card/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 { BaseComponentProps } from '../types/base-component';\n/**\n * @awsuiSystem core\n */\nimport { NativeAttributes } from '../types/native-attributes';\n\nexport interface ItemCardProps extends BaseComponentProps {\n /**\n * Heading element of the item card. Use this to add a title or header text.\n */\n header?: React.ReactNode;\n\n /**\n * A description or subtitle displayed below the header.\n */\n description?: React.ReactNode;\n\n /**\n * Footer content displayed at the bottom of the item card.\n */\n footer?: React.ReactNode;\n\n /**\n * Actions to display in the item card header area, typically buttons or links.\n */\n actions?: React.ReactNode;\n\n /**\n * Main content of the item card.\n */\n children?: React.ReactNode;\n\n /**\n * Icon content displayed next to the header.\n */\n icon?: React.ReactNode;\n\n /**\n * Removes the default padding from the header area.\n * @default false\n */\n disableHeaderPaddings?: boolean;\n\n /**\n * Removes the default padding from the content area.\n * @default false\n */\n disableContentPaddings?: boolean;\n\n /**\n * Removes the default padding from the footer area.\n * @default false\n */\n disableFooterPaddings?: boolean;\n\n /**\n * Specifies the visual variant of the item card, which controls the border radius and padding.\n *\n * - `default` - Uses container-level border radius and padding (larger).\n * - `embedded` - Uses compact border radius and padding (smaller).\n *\n * @default 'default'\n */\n variant?: ItemCardProps.Variant;\n\n /**\n * An object containing CSS properties to customize the item card's visual appearance.\n * Refer to the [style](/components/item-card/?tabId=style) tab for more details.\n * @awsuiSystem core\n */\n style?: ItemCardProps.Style;\n\n /**\n * Attributes to add to the native root 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 * Pass a `ref` to access the native element for measurement, observation, or third-party integration.\n *\n * @awsuiSystem core\n */\n nativeAttributes?: NativeAttributes<React.HTMLAttributes<HTMLDivElement>>;\n}\n\nexport namespace ItemCardProps {\n export type Variant = 'embedded' | 'default';\n\n export interface Style {\n root?: {\n background?: string;\n borderColor?: string;\n borderRadius?: string;\n borderWidth?: string;\n boxShadow?: string;\n };\n content?: {\n paddingBlock?: string;\n paddingInline?: string;\n };\n header?: {\n paddingBlock?: string;\n paddingInline?: string;\n };\n footer?: {\n root?: {\n paddingBlock?: string;\n paddingInline?: string;\n };\n divider?: {\n borderColor?: string;\n borderWidth?: string;\n };\n };\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/item-card/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 { BaseComponentProps } from '../types/base-component';\n/**\n * @awsuiSystem core\n */\nimport { NativeAttributes } from '../types/native-attributes';\n\nexport interface ItemCardProps extends BaseComponentProps {\n /**\n * Heading element of the item card. Use this to add a title or header text.\n */\n header?: React.ReactNode;\n\n /**\n * A description or subtitle displayed below the header.\n */\n description?: React.ReactNode;\n\n /**\n * Footer content displayed at the bottom of the item card.\n */\n footer?: React.ReactNode;\n\n /**\n * Actions to display in the item card header area, typically buttons or links.\n */\n actions?: React.ReactNode;\n\n /**\n * Main content of the item card.\n */\n children?: React.ReactNode;\n\n /**\n * Icon content displayed next to the header.\n */\n icon?: React.ReactNode;\n\n /**\n * Removes the default padding from the header area.\n * @default false\n */\n disableHeaderPaddings?: boolean;\n\n /**\n * Removes the default padding from the content area.\n * @default false\n */\n disableContentPaddings?: boolean;\n\n /**\n * Removes the default padding from the footer area.\n * @default false\n */\n disableFooterPaddings?: boolean;\n\n /**\n * Stretches the item card to fill the available height.\n *\n * Use this property to align heights of multiple item cards displayed in a single row.\n *\n * Unlike in the [container](/components/container/) component, setting this property to `true` does not make the body scrollable if the item card overflows its parent.\n */\n fitHeight?: boolean;\n\n /**\n * Specifies the visual variant of the item card, which controls the border radius and padding.\n *\n * - `default` - Uses container-level border radius and padding (larger).\n * - `embedded` - Uses compact border radius and padding (smaller).\n *\n * @default 'default'\n */\n variant?: ItemCardProps.Variant;\n\n /**\n * An object containing CSS properties to customize the item card's visual appearance.\n * Refer to the [style](/components/item-card/?tabId=style) tab for more details.\n * @awsuiSystem core\n */\n style?: ItemCardProps.Style;\n\n /**\n * Attributes to add to the native root 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 * Pass a `ref` to access the native element for measurement, observation, or third-party integration.\n *\n * @awsuiSystem core\n */\n nativeAttributes?: NativeAttributes<React.HTMLAttributes<HTMLDivElement>>;\n}\n\nexport namespace ItemCardProps {\n export type Variant = 'embedded' | 'default';\n\n export interface Style {\n root?: {\n background?: string;\n borderColor?: string;\n borderRadius?: string;\n borderWidth?: string;\n boxShadow?: string;\n };\n content?: {\n paddingBlock?: string;\n paddingInline?: string;\n };\n header?: {\n paddingBlock?: string;\n paddingInline?: string;\n };\n footer?: {\n root?: {\n paddingBlock?: string;\n paddingInline?: string;\n };\n divider?: {\n borderColor?: string;\n borderWidth?: string;\n };\n };\n }\n}\n"]}
|
|
@@ -10,10 +10,6 @@ export interface InternalItemCardProps extends ItemCardProps, InternalBaseCompon
|
|
|
10
10
|
* Specifies whether the item card is in highlighted state.
|
|
11
11
|
*/
|
|
12
12
|
highlighted?: boolean;
|
|
13
|
-
/**
|
|
14
|
-
* Makes the item card stretch to fill the full height of its container.
|
|
15
|
-
*/
|
|
16
|
-
fullHeight?: boolean;
|
|
17
13
|
/**
|
|
18
14
|
* Specifies metadata for analytics in cards
|
|
19
15
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal-interfaces.d.ts","sourceRoot":"","sources":["../../../src/item-card/internal-interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,MAAM,WAAW,qBAAsB,SAAQ,aAAa,EAAE,0BAA0B;IACtF;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;IAE/C;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;OAEG;IACH,
|
|
1
|
+
{"version":3,"file":"internal-interfaces.d.ts","sourceRoot":"","sources":["../../../src/item-card/internal-interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,MAAM,WAAW,qBAAsB,SAAQ,aAAa,EAAE,0BAA0B;IACtF;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;IAE/C;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;CACzD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal-interfaces.js","sourceRoot":"","sources":["../../../src/item-card/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 { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { ItemCardProps } from './interfaces';\n\nexport interface InternalItemCardProps extends ItemCardProps, InternalBaseComponentProps {\n /**\n * Called when the user clicks on the item card.\n */\n onClick?: React.MouseEventHandler<HTMLElement>;\n\n /**\n * Specifies whether the item card is in highlighted state.\n */\n highlighted?: boolean;\n\n /**\n *
|
|
1
|
+
{"version":3,"file":"internal-interfaces.js","sourceRoot":"","sources":["../../../src/item-card/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 { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { ItemCardProps } from './interfaces';\n\nexport interface InternalItemCardProps extends ItemCardProps, InternalBaseComponentProps {\n /**\n * Called when the user clicks on the item card.\n */\n onClick?: React.MouseEventHandler<HTMLElement>;\n\n /**\n * Specifies whether the item card is in highlighted state.\n */\n highlighted?: boolean;\n\n /**\n * Specifies metadata for analytics in cards\n */\n metadataAttributes?: Record<string, string | undefined>;\n}\n"]}
|
|
@@ -7,6 +7,6 @@ export interface StyleClassNames {
|
|
|
7
7
|
interface InternalItemCardWithStyleProps extends InternalItemCardProps {
|
|
8
8
|
styleClassNames?: StyleClassNames;
|
|
9
9
|
}
|
|
10
|
-
export default function InternalItemCard({ actions, highlighted, children, className, header, description, footer, icon, style, metadataAttributes, nativeAttributes, onClick, disableHeaderPaddings, disableContentPaddings, disableFooterPaddings,
|
|
10
|
+
export default function InternalItemCard({ actions, highlighted, children, className, header, description, footer, icon, style, metadataAttributes, nativeAttributes, onClick, disableHeaderPaddings, disableContentPaddings, disableFooterPaddings, fitHeight, variant, __internalRootRef, styleClassNames, ...restProps }: InternalItemCardWithStyleProps): JSX.Element;
|
|
11
11
|
export {};
|
|
12
12
|
//# sourceMappingURL=internal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/item-card/internal.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAO9D,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,8BAA+B,SAAQ,qBAAqB;IACpE,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC;AAED,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACvC,OAAO,EACP,WAAW,EACX,QAAQ,EACR,SAAS,EACT,MAAM,EACN,WAAW,EACX,MAAM,EACN,IAAI,EACJ,KAAK,EACL,kBAAkB,EAClB,gBAAgB,EAChB,OAAO,EACP,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/item-card/internal.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAO9D,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,8BAA+B,SAAQ,qBAAqB;IACpE,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC;AAED,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACvC,OAAO,EACP,WAAW,EACX,QAAQ,EACR,SAAS,EACT,MAAM,EACN,WAAW,EACX,MAAM,EACN,IAAI,EACJ,KAAK,EACL,kBAAkB,EAClB,gBAAgB,EAChB,OAAO,EACP,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,SAAS,EACT,OAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,GAAG,SAAS,EACb,EAAE,8BAA8B,eA2EhC"}
|