@cloudscape-design/components-themeable 3.0.3 → 3.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/internal/scss/container/styles.scss +4 -1
- package/lib/internal/template/alert/interfaces.d.ts +1 -0
- package/lib/internal/template/alert/interfaces.d.ts.map +1 -1
- package/lib/internal/template/alert/interfaces.js.map +1 -1
- package/lib/internal/template/annotation-context/annotation/styles.css.js +24 -24
- package/lib/internal/template/annotation-context/annotation/styles.scoped.css +31 -31
- package/lib/internal/template/annotation-context/annotation/styles.selectors.js +24 -24
- package/lib/internal/template/app-layout/index.d.ts.map +1 -1
- package/lib/internal/template/app-layout/index.js +14 -11
- package/lib/internal/template/app-layout/index.js.map +1 -1
- package/lib/internal/template/app-layout/toggles/styles.css.js +3 -3
- package/lib/internal/template/app-layout/toggles/styles.scoped.css +13 -13
- package/lib/internal/template/app-layout/toggles/styles.selectors.js +3 -3
- package/lib/internal/template/app-layout/visual-refresh/context.d.ts +4 -2
- package/lib/internal/template/app-layout/visual-refresh/context.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/context.js +31 -21
- package/lib/internal/template/app-layout/visual-refresh/context.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/layout.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/layout.js +2 -13
- package/lib/internal/template/app-layout/visual-refresh/layout.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/split-panel.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/split-panel.js +6 -2
- package/lib/internal/template/app-layout/visual-refresh/split-panel.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/styles.css.js +59 -59
- package/lib/internal/template/app-layout/visual-refresh/styles.scoped.css +153 -153
- package/lib/internal/template/app-layout/visual-refresh/styles.selectors.js +59 -59
- package/lib/internal/template/breadcrumb-group/item/styles.css.js +7 -7
- package/lib/internal/template/breadcrumb-group/item/styles.scoped.css +19 -19
- package/lib/internal/template/breadcrumb-group/item/styles.selectors.js +7 -7
- package/lib/internal/template/button/styles.css.js +18 -18
- package/lib/internal/template/button/styles.scoped.css +190 -190
- package/lib/internal/template/button/styles.selectors.js +18 -18
- package/lib/internal/template/checkbox/styles.css.js +3 -3
- package/lib/internal/template/checkbox/styles.scoped.css +8 -8
- package/lib/internal/template/checkbox/styles.selectors.js +3 -3
- package/lib/internal/template/code-editor/preferences-modal.js +2 -2
- package/lib/internal/template/code-editor/preferences-modal.js.map +1 -1
- package/lib/internal/template/code-editor/styles.css.js +33 -33
- package/lib/internal/template/code-editor/styles.scoped.css +168 -168
- package/lib/internal/template/code-editor/styles.selectors.js +33 -33
- package/lib/internal/template/container/styles.css.js +15 -14
- package/lib/internal/template/container/styles.scoped.css +27 -23
- package/lib/internal/template/container/styles.selectors.js +15 -14
- package/lib/internal/template/date-picker/styles.css.js +24 -24
- package/lib/internal/template/date-picker/styles.scoped.css +45 -45
- package/lib/internal/template/date-picker/styles.selectors.js +24 -24
- package/lib/internal/template/date-range-picker/calendar/grids/day/styles.css.js +21 -21
- package/lib/internal/template/date-range-picker/calendar/grids/day/styles.scoped.css +42 -42
- package/lib/internal/template/date-range-picker/calendar/grids/day/styles.selectors.js +21 -21
- package/lib/internal/template/date-range-picker/styles.css.js +42 -42
- package/lib/internal/template/date-range-picker/styles.scoped.css +53 -53
- package/lib/internal/template/date-range-picker/styles.selectors.js +42 -42
- package/lib/internal/template/expandable-section/styles.css.js +20 -20
- package/lib/internal/template/expandable-section/styles.scoped.css +46 -46
- package/lib/internal/template/expandable-section/styles.selectors.js +20 -20
- package/lib/internal/template/flashbar/interfaces.d.ts +4 -4
- package/lib/internal/template/flashbar/interfaces.js.map +1 -1
- package/lib/internal/template/form-field/internal.js +3 -3
- package/lib/internal/template/form-field/internal.js.map +1 -1
- package/lib/internal/template/help-panel/styles.css.js +4 -4
- package/lib/internal/template/help-panel/styles.scoped.css +62 -62
- package/lib/internal/template/help-panel/styles.selectors.js +4 -4
- package/lib/internal/template/input/styles.css.js +13 -13
- package/lib/internal/template/input/styles.scoped.css +39 -39
- package/lib/internal/template/input/styles.selectors.js +13 -13
- package/lib/internal/template/internal/base-component/styles.scoped.css +28 -18
- package/lib/internal/template/internal/components/button-trigger/styles.css.js +9 -9
- package/lib/internal/template/internal/components/button-trigger/styles.scoped.css +31 -31
- package/lib/internal/template/internal/components/button-trigger/styles.selectors.js +9 -9
- package/lib/internal/template/internal/components/cartesian-chart/styles.css.js +21 -21
- package/lib/internal/template/internal/components/cartesian-chart/styles.scoped.css +26 -26
- package/lib/internal/template/internal/components/cartesian-chart/styles.selectors.js +21 -21
- package/lib/internal/template/internal/components/chart-legend/styles.css.js +7 -7
- package/lib/internal/template/internal/components/chart-legend/styles.scoped.css +17 -17
- package/lib/internal/template/internal/components/chart-legend/styles.selectors.js +7 -7
- package/lib/internal/template/internal/components/chart-plot/styles.css.js +5 -5
- package/lib/internal/template/internal/components/chart-plot/styles.scoped.css +7 -7
- package/lib/internal/template/internal/components/chart-plot/styles.selectors.js +5 -5
- package/lib/internal/template/internal/components/filtering-token/styles.css.js +7 -7
- package/lib/internal/template/internal/components/filtering-token/styles.scoped.css +15 -15
- package/lib/internal/template/internal/components/filtering-token/styles.selectors.js +7 -7
- package/lib/internal/template/internal/components/menu-dropdown/styles.css.js +7 -7
- package/lib/internal/template/internal/components/menu-dropdown/styles.scoped.css +15 -15
- package/lib/internal/template/internal/components/menu-dropdown/styles.selectors.js +7 -7
- package/lib/internal/template/internal/components/selectable-item/styles.css.js +16 -16
- package/lib/internal/template/internal/components/selectable-item/styles.scoped.css +29 -29
- package/lib/internal/template/internal/components/selectable-item/styles.selectors.js +16 -16
- package/lib/internal/template/internal/context/app-layout-context.d.ts +1 -1
- package/lib/internal/template/internal/context/app-layout-context.d.ts.map +1 -1
- package/lib/internal/template/internal/context/app-layout-context.js +3 -4
- package/lib/internal/template/internal/context/app-layout-context.js.map +1 -1
- package/lib/internal/template/internal/context/form-field-context.d.ts +1 -1
- package/lib/internal/template/internal/context/form-field-context.d.ts.map +1 -1
- package/lib/internal/template/internal/context/form-field-context.js +3 -4
- package/lib/internal/template/internal/context/form-field-context.js.map +1 -1
- package/lib/internal/template/internal/environment.js +1 -1
- package/lib/internal/template/internal/generated/theming/index.cjs +14 -3
- package/lib/internal/template/internal/generated/theming/index.js +14 -3
- package/lib/internal/template/link/styles.css.js +18 -18
- package/lib/internal/template/link/styles.scoped.css +73 -73
- package/lib/internal/template/link/styles.selectors.js +18 -18
- package/lib/internal/template/pagination/styles.css.js +9 -9
- package/lib/internal/template/pagination/styles.scoped.css +27 -27
- package/lib/internal/template/pagination/styles.selectors.js +9 -9
- package/lib/internal/template/popover/styles.css.js +48 -48
- package/lib/internal/template/popover/styles.scoped.css +64 -64
- package/lib/internal/template/popover/styles.selectors.js +48 -48
- package/lib/internal/template/radio-group/styles.css.js +9 -9
- package/lib/internal/template/radio-group/styles.scoped.css +18 -18
- package/lib/internal/template/radio-group/styles.selectors.js +9 -9
- package/lib/internal/template/segmented-control/styles.css.js +14 -14
- package/lib/internal/template/segmented-control/styles.scoped.css +35 -35
- package/lib/internal/template/segmented-control/styles.selectors.js +14 -14
- package/lib/internal/template/select/utils/use-select.d.ts.map +1 -1
- package/lib/internal/template/select/utils/use-select.js +1 -0
- package/lib/internal/template/select/utils/use-select.js.map +1 -1
- package/lib/internal/template/side-navigation/styles.css.js +22 -22
- package/lib/internal/template/side-navigation/styles.scoped.css +36 -36
- package/lib/internal/template/side-navigation/styles.selectors.js +22 -22
- package/lib/internal/template/split-panel/index.js +2 -2
- package/lib/internal/template/split-panel/index.js.map +1 -1
- package/lib/internal/template/split-panel/styles.css.js +58 -58
- package/lib/internal/template/split-panel/styles.scoped.css +82 -82
- package/lib/internal/template/split-panel/styles.selectors.js +58 -58
- package/lib/internal/template/split-panel/utils/size-utils.d.ts +11 -0
- package/lib/internal/template/split-panel/utils/size-utils.d.ts.map +1 -1
- package/lib/internal/template/split-panel/utils/size-utils.js +12 -1
- package/lib/internal/template/split-panel/utils/size-utils.js.map +1 -1
- package/lib/internal/template/table/header-cell/styles.css.js +14 -14
- package/lib/internal/template/table/header-cell/styles.scoped.css +28 -28
- package/lib/internal/template/table/header-cell/styles.selectors.js +14 -14
- package/lib/internal/template/table/styles.css.js +32 -32
- package/lib/internal/template/table/styles.scoped.css +39 -39
- package/lib/internal/template/table/styles.selectors.js +32 -32
- package/lib/internal/template/tabs/styles.css.js +21 -21
- package/lib/internal/template/tabs/styles.scoped.css +39 -39
- package/lib/internal/template/tabs/styles.selectors.js +21 -21
- package/lib/internal/template/tag-editor/index.js +1 -1
- package/lib/internal/template/tag-editor/index.js.map +1 -1
- package/lib/internal/template/tag-editor/interfaces.d.ts +1 -1
- package/lib/internal/template/tag-editor/interfaces.d.ts.map +1 -1
- package/lib/internal/template/tag-editor/interfaces.js.map +1 -1
- package/lib/internal/template/tag-editor/styles.css.js +3 -3
- package/lib/internal/template/tag-editor/styles.scoped.css +14 -14
- package/lib/internal/template/tag-editor/styles.selectors.js +3 -3
- package/lib/internal/template/text-content/styles.css.js +1 -1
- package/lib/internal/template/text-content/styles.scoped.css +64 -64
- package/lib/internal/template/text-content/styles.selectors.js +1 -1
- package/lib/internal/template/textarea/styles.css.js +4 -4
- package/lib/internal/template/textarea/styles.scoped.css +20 -20
- package/lib/internal/template/textarea/styles.selectors.js +4 -4
- package/lib/internal/template/toggle/styles.css.js +8 -8
- package/lib/internal/template/toggle/styles.scoped.css +16 -16
- package/lib/internal/template/toggle/styles.selectors.js +8 -8
- package/lib/internal/template/token-group/styles.css.js +7 -7
- package/lib/internal/template/token-group/styles.scoped.css +28 -28
- package/lib/internal/template/token-group/styles.selectors.js +7 -7
- package/lib/internal/template/top-navigation/1.0-beta/styles.css.js +25 -25
- package/lib/internal/template/top-navigation/1.0-beta/styles.scoped.css +46 -46
- package/lib/internal/template/top-navigation/1.0-beta/styles.selectors.js +25 -25
- package/lib/internal/template/top-navigation/styles.css.js +47 -47
- package/lib/internal/template/top-navigation/styles.scoped.css +72 -72
- package/lib/internal/template/top-navigation/styles.selectors.js +47 -47
- package/lib/internal/template/tutorial-panel/components/tutorial-list/index.js +1 -1
- package/lib/internal/template/tutorial-panel/components/tutorial-list/index.js.map +1 -1
- package/lib/internal/template/tutorial-panel/components/tutorial-list/styles.css.js +18 -18
- package/lib/internal/template/tutorial-panel/components/tutorial-list/styles.scoped.css +32 -32
- package/lib/internal/template/tutorial-panel/components/tutorial-list/styles.selectors.js +18 -18
- package/lib/internal/template/wizard/styles.css.js +31 -31
- package/lib/internal/template/wizard/styles.scoped.css +62 -62
- package/lib/internal/template/wizard/styles.selectors.js +31 -31
- package/package.json +1 -1
- package/lib/internal/template/internal/hooks/dom-context/index.d.ts +0 -14
- package/lib/internal/template/internal/hooks/dom-context/index.d.ts.map +0 -1
- package/lib/internal/template/internal/hooks/dom-context/index.js +0 -70
- package/lib/internal/template/internal/hooks/dom-context/index.js.map +0 -1
|
@@ -2,37 +2,37 @@
|
|
|
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
|
-
"tools": "
|
|
7
|
-
"tools-filtering": "awsui_tools-
|
|
8
|
-
"tools-align-right": "awsui_tools-align-
|
|
9
|
-
"tools-pagination": "awsui_tools-
|
|
10
|
-
"tools-preferences": "awsui_tools-
|
|
11
|
-
"tools-small": "awsui_tools-
|
|
12
|
-
"table": "
|
|
13
|
-
"table-layout-fixed": "awsui_table-layout-
|
|
14
|
-
"wrapper": "
|
|
15
|
-
"variant-stacked": "awsui_variant-
|
|
16
|
-
"variant-container": "awsui_variant-
|
|
17
|
-
"variant-embedded": "awsui_variant-
|
|
18
|
-
"has-header": "awsui_has-
|
|
19
|
-
"has-footer": "awsui_has-
|
|
20
|
-
"cell-merged": "awsui_cell-
|
|
21
|
-
"cell-merged-content": "awsui_cell-merged-
|
|
22
|
-
"empty": "
|
|
23
|
-
"loading": "
|
|
24
|
-
"selection-control": "awsui_selection-
|
|
25
|
-
"selection-control-header": "awsui_selection-control-
|
|
26
|
-
"sticky-scrollbar": "awsui_sticky-
|
|
27
|
-
"sticky-scrollbar-content": "awsui_sticky-scrollbar-
|
|
28
|
-
"sticky-scrollbar-visible": "awsui_sticky-scrollbar-
|
|
29
|
-
"header-secondary": "awsui_header-
|
|
30
|
-
"header-controls": "awsui_header-
|
|
31
|
-
"divider": "
|
|
32
|
-
"footer-wrapper": "awsui_footer-
|
|
33
|
-
"footer": "
|
|
34
|
-
"thead-active": "awsui_thead-
|
|
35
|
-
"row": "
|
|
36
|
-
"row-selected": "awsui_row-
|
|
5
|
+
"root": "awsui_root_wih1l_x3kr1_97",
|
|
6
|
+
"tools": "awsui_tools_wih1l_x3kr1_106",
|
|
7
|
+
"tools-filtering": "awsui_tools-filtering_wih1l_x3kr1_112",
|
|
8
|
+
"tools-align-right": "awsui_tools-align-right_wih1l_x3kr1_116",
|
|
9
|
+
"tools-pagination": "awsui_tools-pagination_wih1l_x3kr1_120",
|
|
10
|
+
"tools-preferences": "awsui_tools-preferences_wih1l_x3kr1_120",
|
|
11
|
+
"tools-small": "awsui_tools-small_wih1l_x3kr1_126",
|
|
12
|
+
"table": "awsui_table_wih1l_x3kr1_132",
|
|
13
|
+
"table-layout-fixed": "awsui_table-layout-fixed_wih1l_x3kr1_138",
|
|
14
|
+
"wrapper": "awsui_wrapper_wih1l_x3kr1_142",
|
|
15
|
+
"variant-stacked": "awsui_variant-stacked_wih1l_x3kr1_152",
|
|
16
|
+
"variant-container": "awsui_variant-container_wih1l_x3kr1_152",
|
|
17
|
+
"variant-embedded": "awsui_variant-embedded_wih1l_x3kr1_156",
|
|
18
|
+
"has-header": "awsui_has-header_wih1l_x3kr1_159",
|
|
19
|
+
"has-footer": "awsui_has-footer_wih1l_x3kr1_162",
|
|
20
|
+
"cell-merged": "awsui_cell-merged_wih1l_x3kr1_172",
|
|
21
|
+
"cell-merged-content": "awsui_cell-merged-content_wih1l_x3kr1_176",
|
|
22
|
+
"empty": "awsui_empty_wih1l_x3kr1_191",
|
|
23
|
+
"loading": "awsui_loading_wih1l_x3kr1_195",
|
|
24
|
+
"selection-control": "awsui_selection-control_wih1l_x3kr1_199",
|
|
25
|
+
"selection-control-header": "awsui_selection-control-header_wih1l_x3kr1_206",
|
|
26
|
+
"sticky-scrollbar": "awsui_sticky-scrollbar_wih1l_x3kr1_211",
|
|
27
|
+
"sticky-scrollbar-content": "awsui_sticky-scrollbar-content_wih1l_x3kr1_221",
|
|
28
|
+
"sticky-scrollbar-visible": "awsui_sticky-scrollbar-visible_wih1l_x3kr1_224",
|
|
29
|
+
"header-secondary": "awsui_header-secondary_wih1l_x3kr1_228",
|
|
30
|
+
"header-controls": "awsui_header-controls_wih1l_x3kr1_248",
|
|
31
|
+
"divider": "awsui_divider_wih1l_x3kr1_265",
|
|
32
|
+
"footer-wrapper": "awsui_footer-wrapper_wih1l_x3kr1_272",
|
|
33
|
+
"footer": "awsui_footer_wih1l_x3kr1_272",
|
|
34
|
+
"thead-active": "awsui_thead-active_wih1l_x3kr1_281",
|
|
35
|
+
"row": "awsui_row_wih1l_x3kr1_282",
|
|
36
|
+
"row-selected": "awsui_row-selected_wih1l_x3kr1_283"
|
|
37
37
|
};
|
|
38
38
|
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"tabs-header": "awsui_tabs-
|
|
5
|
-
"tabs-header-list": "awsui_tabs-header-
|
|
6
|
-
"pagination-button": "awsui_pagination-
|
|
7
|
-
"pagination-button-left": "awsui_pagination-button-
|
|
8
|
-
"pagination-button-left-scrollable": "awsui_pagination-button-left-
|
|
9
|
-
"pagination-button-right": "awsui_pagination-button-
|
|
10
|
-
"pagination-button-right-scrollable": "awsui_pagination-button-right-
|
|
11
|
-
"tabs-tab": "awsui_tabs-
|
|
12
|
-
"tabs-tab-label": "awsui_tabs-tab-
|
|
13
|
-
"tabs-tab-link": "awsui_tabs-tab-
|
|
14
|
-
"tabs-tab-disabled": "awsui_tabs-tab-
|
|
15
|
-
"refresh": "
|
|
16
|
-
"tabs-tab-active": "awsui_tabs-tab-
|
|
17
|
-
"tabs-header-with-divider": "awsui_tabs-header-with-
|
|
18
|
-
"root": "
|
|
19
|
-
"tabs": "
|
|
20
|
-
"tabs-content-wrapper": "awsui_tabs-content-
|
|
21
|
-
"with-paddings": "awsui_with-
|
|
22
|
-
"tabs-container-content-wrapper": "awsui_tabs-container-content-
|
|
23
|
-
"tabs-content": "awsui_tabs-
|
|
24
|
-
"tabs-content-active": "awsui_tabs-content-
|
|
4
|
+
"tabs-header": "awsui_tabs-header_14rmt_1sfab_186",
|
|
5
|
+
"tabs-header-list": "awsui_tabs-header-list_14rmt_1sfab_192",
|
|
6
|
+
"pagination-button": "awsui_pagination-button_14rmt_1sfab_209",
|
|
7
|
+
"pagination-button-left": "awsui_pagination-button-left_14rmt_1sfab_214",
|
|
8
|
+
"pagination-button-left-scrollable": "awsui_pagination-button-left-scrollable_14rmt_1sfab_217",
|
|
9
|
+
"pagination-button-right": "awsui_pagination-button-right_14rmt_1sfab_221",
|
|
10
|
+
"pagination-button-right-scrollable": "awsui_pagination-button-right-scrollable_14rmt_1sfab_224",
|
|
11
|
+
"tabs-tab": "awsui_tabs-tab_14rmt_1sfab_229",
|
|
12
|
+
"tabs-tab-label": "awsui_tabs-tab-label_14rmt_1sfab_240",
|
|
13
|
+
"tabs-tab-link": "awsui_tabs-tab-link_14rmt_1sfab_256",
|
|
14
|
+
"tabs-tab-disabled": "awsui_tabs-tab-disabled_14rmt_1sfab_313",
|
|
15
|
+
"refresh": "awsui_refresh_14rmt_1sfab_330",
|
|
16
|
+
"tabs-tab-active": "awsui_tabs-tab-active_14rmt_1sfab_344",
|
|
17
|
+
"tabs-header-with-divider": "awsui_tabs-header-with-divider_14rmt_1sfab_351",
|
|
18
|
+
"root": "awsui_root_14rmt_1sfab_355",
|
|
19
|
+
"tabs": "awsui_tabs_14rmt_1sfab_186",
|
|
20
|
+
"tabs-content-wrapper": "awsui_tabs-content-wrapper_14rmt_1sfab_372",
|
|
21
|
+
"with-paddings": "awsui_with-paddings_14rmt_1sfab_372",
|
|
22
|
+
"tabs-container-content-wrapper": "awsui_tabs-container-content-wrapper_14rmt_1sfab_376",
|
|
23
|
+
"tabs-content": "awsui_tabs-content_14rmt_1sfab_372",
|
|
24
|
+
"tabs-content-active": "awsui_tabs-content-active_14rmt_1sfab_384"
|
|
25
25
|
};
|
|
26
26
|
|
|
@@ -183,13 +183,13 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
183
183
|
SPDX-License-Identifier: Apache-2.0
|
|
184
184
|
*/
|
|
185
185
|
/* stylelint-disable selector-max-type */
|
|
186
|
-
.awsui_tabs-
|
|
186
|
+
.awsui_tabs-header_14rmt_1sfab_186:not(#\9) {
|
|
187
187
|
margin: 0;
|
|
188
188
|
padding: 0;
|
|
189
189
|
display: flex;
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
.awsui_tabs-header-
|
|
192
|
+
.awsui_tabs-header-list_14rmt_1sfab_192:not(#\9) {
|
|
193
193
|
margin: 0;
|
|
194
194
|
padding: 0;
|
|
195
195
|
display: flex;
|
|
@@ -201,38 +201,38 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
201
201
|
scrollbar-width: none;
|
|
202
202
|
/* Firefox */
|
|
203
203
|
}
|
|
204
|
-
.awsui_tabs-header-
|
|
204
|
+
.awsui_tabs-header-list_14rmt_1sfab_192:not(#\9)::-webkit-scrollbar {
|
|
205
205
|
display: none;
|
|
206
206
|
/* Safari and Chrome */
|
|
207
207
|
}
|
|
208
208
|
|
|
209
|
-
.awsui_pagination-
|
|
209
|
+
.awsui_pagination-button_14rmt_1sfab_209:not(#\9) {
|
|
210
210
|
margin: 12px 0;
|
|
211
211
|
margin: var(--space-scaled-s-cu1hzn, 12px) 0;
|
|
212
212
|
padding: 0 4px;
|
|
213
213
|
padding: 0 var(--space-xxs-ynfts5, 4px);
|
|
214
214
|
display: flex;
|
|
215
215
|
}
|
|
216
|
-
.awsui_pagination-button-
|
|
216
|
+
.awsui_pagination-button-left_14rmt_1sfab_214:not(#\9) {
|
|
217
217
|
border-right: 1px solid #d5dbdb;
|
|
218
218
|
border-right: var(--border-divider-section-width-5a4cv1, 1px) solid var(--color-border-control-disabled-zgidl5, #d5dbdb);
|
|
219
219
|
}
|
|
220
|
-
.awsui_pagination-button-left-
|
|
220
|
+
.awsui_pagination-button-left-scrollable_14rmt_1sfab_217:not(#\9) {
|
|
221
221
|
z-index: 1;
|
|
222
222
|
box-shadow: 5px 0px 4px -3px #eaeded, 1px 0px 0px 0px #eaeded;
|
|
223
223
|
box-shadow: 5px 0px 4px -3px var(--color-border-tabs-shadow-22eyu5, #eaeded), 1px 0px 0px 0px var(--color-border-tabs-shadow-22eyu5, #eaeded);
|
|
224
224
|
}
|
|
225
|
-
.awsui_pagination-button-
|
|
225
|
+
.awsui_pagination-button-right_14rmt_1sfab_221:not(#\9) {
|
|
226
226
|
border-left: 1px solid #d5dbdb;
|
|
227
227
|
border-left: var(--border-divider-section-width-5a4cv1, 1px) solid var(--color-border-control-disabled-zgidl5, #d5dbdb);
|
|
228
228
|
}
|
|
229
|
-
.awsui_pagination-button-right-
|
|
229
|
+
.awsui_pagination-button-right-scrollable_14rmt_1sfab_224:not(#\9) {
|
|
230
230
|
z-index: 1;
|
|
231
231
|
box-shadow: -5px 0px 4px -3px #eaeded, -1px 0px 0px 0 #eaeded;
|
|
232
232
|
box-shadow: -5px 0px 4px -3px var(--color-border-tabs-shadow-22eyu5, #eaeded), -1px 0px 0px 0 var(--color-border-tabs-shadow-22eyu5, #eaeded);
|
|
233
233
|
}
|
|
234
234
|
|
|
235
|
-
.awsui_tabs-
|
|
235
|
+
.awsui_tabs-tab_14rmt_1sfab_229:not(#\9) {
|
|
236
236
|
list-style: none;
|
|
237
237
|
padding: 0;
|
|
238
238
|
flex-shrink: 0;
|
|
@@ -240,11 +240,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
240
240
|
max-width: calc(90% - 20px);
|
|
241
241
|
max-width: calc(90% - var(--space-l-4vl6xu, 20px));
|
|
242
242
|
}
|
|
243
|
-
.awsui_tabs-
|
|
243
|
+
.awsui_tabs-tab_14rmt_1sfab_229 > button:not(#\9) {
|
|
244
244
|
background-color: transparent;
|
|
245
245
|
}
|
|
246
246
|
|
|
247
|
-
.awsui_tabs-tab-
|
|
247
|
+
.awsui_tabs-tab-label_14rmt_1sfab_240:not(#\9) {
|
|
248
248
|
display: flex;
|
|
249
249
|
align-items: center;
|
|
250
250
|
padding: 4px 20px;
|
|
@@ -256,14 +256,14 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
256
256
|
word-break: break-word;
|
|
257
257
|
}
|
|
258
258
|
|
|
259
|
-
.awsui_tabs-
|
|
259
|
+
.awsui_tabs-tab_14rmt_1sfab_229:not(#\9):not(:last-child) > a > .awsui_tabs-tab-label_14rmt_1sfab_240, .awsui_tabs-tab_14rmt_1sfab_229:not(#\9):not(:last-child) > button > .awsui_tabs-tab-label_14rmt_1sfab_240 {
|
|
260
260
|
margin-right: calc(-1 * 1px);
|
|
261
261
|
margin-right: calc(-1 * var(--border-divider-section-width-5a4cv1, 1px));
|
|
262
262
|
border-right: 1px solid #aab7b8;
|
|
263
263
|
border-right: var(--border-divider-section-width-5a4cv1, 1px) solid var(--color-border-tabs-divider-lf9ugx, #aab7b8);
|
|
264
264
|
}
|
|
265
265
|
|
|
266
|
-
.awsui_tabs-tab-
|
|
266
|
+
.awsui_tabs-tab-link_14rmt_1sfab_256:not(#\9) {
|
|
267
267
|
position: relative;
|
|
268
268
|
display: flex;
|
|
269
269
|
align-items: stretch;
|
|
@@ -283,23 +283,23 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
283
283
|
color: #545b64;
|
|
284
284
|
color: var(--color-text-interactive-default-9me1cm, #545b64);
|
|
285
285
|
}
|
|
286
|
-
.awsui_tabs-tab-
|
|
286
|
+
.awsui_tabs-tab-link_14rmt_1sfab_256:not(#\9):hover {
|
|
287
287
|
color: #0073bb;
|
|
288
288
|
color: var(--color-text-accent-s0earc, #0073bb);
|
|
289
289
|
}
|
|
290
|
-
.awsui_tabs-tab-
|
|
290
|
+
.awsui_tabs-tab-link_14rmt_1sfab_256:not(#\9):focus {
|
|
291
291
|
outline: none;
|
|
292
292
|
}
|
|
293
|
-
.awsui_tabs-tab-
|
|
293
|
+
.awsui_tabs-tab-link_14rmt_1sfab_256[data-awsui-focus-visible=true]:not(#\9):focus {
|
|
294
294
|
z-index: 1;
|
|
295
295
|
position: relative;
|
|
296
296
|
}
|
|
297
|
-
.awsui_tabs-tab-
|
|
297
|
+
.awsui_tabs-tab-link_14rmt_1sfab_256[data-awsui-focus-visible=true]:not(#\9):focus {
|
|
298
298
|
outline: 2px dotted transparent;
|
|
299
299
|
outline-offset: calc(0px - 1px);
|
|
300
300
|
outline-offset: calc(var(--space-tabs-focus-outline-gutter-th1z8v, 0px) - 1px);
|
|
301
301
|
}
|
|
302
|
-
.awsui_tabs-tab-
|
|
302
|
+
.awsui_tabs-tab-link_14rmt_1sfab_256[data-awsui-focus-visible=true]:not(#\9):focus::before {
|
|
303
303
|
content: " ";
|
|
304
304
|
display: block;
|
|
305
305
|
position: absolute;
|
|
@@ -313,30 +313,30 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
313
313
|
height: calc(100% + 2 * var(--space-tabs-focus-outline-gutter-th1z8v, 0px));
|
|
314
314
|
border-radius: 2px;
|
|
315
315
|
border-radius: var(--border-control-focus-ring-radius-default-9royjh, 2px);
|
|
316
|
-
box-shadow: 0 0 0 2px #
|
|
317
|
-
box-shadow: 0 0 0 2px var(--color-border-item-focused-
|
|
316
|
+
box-shadow: 0 0 0 2px #0073bb;
|
|
317
|
+
box-shadow: 0 0 0 2px var(--color-border-item-focused-n5kd8g, #0073bb);
|
|
318
318
|
}
|
|
319
|
-
.awsui_tabs-tab-
|
|
319
|
+
.awsui_tabs-tab-link_14rmt_1sfab_256[data-awsui-focus-visible=true]:not(#\9):focus > a > .awsui_tabs-tab-label_14rmt_1sfab_240, .awsui_tabs-tab-link_14rmt_1sfab_256[data-awsui-focus-visible=true]:not(#\9):focus > button > .awsui_tabs-tab-label_14rmt_1sfab_240 {
|
|
320
320
|
border-right-color: transparent;
|
|
321
321
|
}
|
|
322
322
|
|
|
323
|
-
.awsui_tabs-
|
|
323
|
+
.awsui_tabs-tab_14rmt_1sfab_229:not(#\9):first-child {
|
|
324
324
|
margin-left: 1px;
|
|
325
325
|
}
|
|
326
|
-
.awsui_tabs-
|
|
326
|
+
.awsui_tabs-tab_14rmt_1sfab_229:not(#\9):first-child > a > .awsui_tabs-tab-label_14rmt_1sfab_240, .awsui_tabs-tab_14rmt_1sfab_229:not(#\9):first-child > button > .awsui_tabs-tab-label_14rmt_1sfab_240 {
|
|
327
327
|
padding-left: calc(20px - 1px);
|
|
328
328
|
padding-left: calc(var(--space-l-4vl6xu, 20px) - 1px);
|
|
329
329
|
}
|
|
330
330
|
|
|
331
|
-
.awsui_tabs-
|
|
331
|
+
.awsui_tabs-tab_14rmt_1sfab_229:not(#\9):last-child {
|
|
332
332
|
margin-right: 1px;
|
|
333
333
|
}
|
|
334
|
-
.awsui_tabs-
|
|
334
|
+
.awsui_tabs-tab_14rmt_1sfab_229:not(#\9):last-child > a > .awsui_tabs-tab-label_14rmt_1sfab_240, .awsui_tabs-tab_14rmt_1sfab_229:not(#\9):last-child > button > .awsui_tabs-tab-label_14rmt_1sfab_240 {
|
|
335
335
|
padding-right: calc(20px - 1px);
|
|
336
336
|
padding-right: calc(var(--space-l-4vl6xu, 20px) - 1px);
|
|
337
337
|
}
|
|
338
338
|
|
|
339
|
-
.awsui_tabs-tab-
|
|
339
|
+
.awsui_tabs-tab-disabled_14rmt_1sfab_313:not(#\9), .awsui_tabs-tab-disabled_14rmt_1sfab_313:not(#\9):hover {
|
|
340
340
|
cursor: default;
|
|
341
341
|
color: #aab7b8;
|
|
342
342
|
color: var(--color-text-interactive-disabled-jcikk2, #aab7b8);
|
|
@@ -344,7 +344,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
344
344
|
font-weight: var(--font-tabs-disabled-weight-0s5m6k, 400);
|
|
345
345
|
}
|
|
346
346
|
|
|
347
|
-
.awsui_tabs-tab-
|
|
347
|
+
.awsui_tabs-tab-link_14rmt_1sfab_256:not(#\9):not(.awsui_tabs-tab-disabled_14rmt_1sfab_313):after {
|
|
348
348
|
content: "";
|
|
349
349
|
position: absolute;
|
|
350
350
|
left: 0;
|
|
@@ -359,39 +359,39 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
359
359
|
background: var(--color-border-tabs-underline-ba6hzi, #16191f);
|
|
360
360
|
opacity: 0;
|
|
361
361
|
}
|
|
362
|
-
.awsui_tabs-tab-
|
|
362
|
+
.awsui_tabs-tab-link_14rmt_1sfab_256:not(#\9):not(.awsui_tabs-tab-disabled_14rmt_1sfab_313).awsui_refresh_14rmt_1sfab_330:after {
|
|
363
363
|
transition: opacity 165ms cubic-bezier(0.84, 0, 0.16, 1);
|
|
364
364
|
transition: opacity var(--motion-duration-refresh-only-medium-5flen2, 165ms) var(--motion-easing-refresh-only-c-ic6jr0, cubic-bezier(0.84, 0, 0.16, 1));
|
|
365
365
|
}
|
|
366
366
|
@media (prefers-reduced-motion: reduce) {
|
|
367
|
-
.awsui_tabs-tab-
|
|
367
|
+
.awsui_tabs-tab-link_14rmt_1sfab_256:not(#\9):not(.awsui_tabs-tab-disabled_14rmt_1sfab_313).awsui_refresh_14rmt_1sfab_330:after {
|
|
368
368
|
animation: none;
|
|
369
369
|
transition: none;
|
|
370
370
|
}
|
|
371
371
|
}
|
|
372
|
-
.awsui-motion-disabled .awsui_tabs-tab-
|
|
372
|
+
.awsui-motion-disabled .awsui_tabs-tab-link_14rmt_1sfab_256:not(#\9):not(.awsui_tabs-tab-disabled_14rmt_1sfab_313).awsui_refresh_14rmt_1sfab_330:after, .awsui-mode-entering .awsui_tabs-tab-link_14rmt_1sfab_256:not(#\9):not(.awsui_tabs-tab-disabled_14rmt_1sfab_313).awsui_refresh_14rmt_1sfab_330:after {
|
|
373
373
|
animation: none;
|
|
374
374
|
transition: none;
|
|
375
375
|
}
|
|
376
376
|
|
|
377
|
-
.awsui_tabs-tab-
|
|
377
|
+
.awsui_tabs-tab-active_14rmt_1sfab_344:not(#\9):not(.awsui_tabs-tab-disabled_14rmt_1sfab_313) {
|
|
378
378
|
color: #0073bb;
|
|
379
379
|
color: var(--color-text-accent-s0earc, #0073bb);
|
|
380
380
|
}
|
|
381
|
-
.awsui_tabs-tab-
|
|
381
|
+
.awsui_tabs-tab-active_14rmt_1sfab_344:not(#\9):not(.awsui_tabs-tab-disabled_14rmt_1sfab_313):after {
|
|
382
382
|
opacity: 1;
|
|
383
383
|
}
|
|
384
384
|
|
|
385
|
-
.awsui_tabs-header-with-
|
|
385
|
+
.awsui_tabs-header-with-divider_14rmt_1sfab_351:not(#\9) {
|
|
386
386
|
border-bottom: 1px solid #aab7b8;
|
|
387
387
|
border-bottom: var(--border-divider-section-width-5a4cv1, 1px) solid var(--color-border-tabs-divider-lf9ugx, #aab7b8);
|
|
388
388
|
}
|
|
389
389
|
|
|
390
|
-
.
|
|
390
|
+
.awsui_root_14rmt_1sfab_355:not(#\9) {
|
|
391
391
|
/* used in test-utils or tests */
|
|
392
392
|
}
|
|
393
393
|
|
|
394
|
-
.
|
|
394
|
+
.awsui_tabs_14rmt_1sfab_186:not(#\9) {
|
|
395
395
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
396
396
|
border-collapse: separate;
|
|
397
397
|
border-spacing: 0;
|
|
@@ -435,20 +435,20 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
435
435
|
width: 100%;
|
|
436
436
|
}
|
|
437
437
|
|
|
438
|
-
.awsui_tabs-content-
|
|
438
|
+
.awsui_tabs-content-wrapper_14rmt_1sfab_372.awsui_with-paddings_14rmt_1sfab_372:not(#\9) {
|
|
439
439
|
padding: 16px 0;
|
|
440
440
|
padding: var(--space-scaled-m-pv0fmt, 16px) 0;
|
|
441
441
|
}
|
|
442
442
|
|
|
443
|
-
.awsui_tabs-container-content-
|
|
443
|
+
.awsui_tabs-container-content-wrapper_14rmt_1sfab_376.awsui_with-paddings_14rmt_1sfab_372:not(#\9) {
|
|
444
444
|
padding-top: 0px;
|
|
445
445
|
padding-top: var(--space-tabs-content-top-5xrhx5, 0px);
|
|
446
446
|
}
|
|
447
447
|
|
|
448
|
-
.awsui_tabs-
|
|
448
|
+
.awsui_tabs-content_14rmt_1sfab_372:not(#\9) {
|
|
449
449
|
display: none;
|
|
450
450
|
}
|
|
451
451
|
|
|
452
|
-
.awsui_tabs-content-
|
|
452
|
+
.awsui_tabs-content-active_14rmt_1sfab_384:not(#\9) {
|
|
453
453
|
display: block;
|
|
454
454
|
}
|
|
@@ -2,26 +2,26 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"tabs-header": "awsui_tabs-
|
|
6
|
-
"tabs-header-list": "awsui_tabs-header-
|
|
7
|
-
"pagination-button": "awsui_pagination-
|
|
8
|
-
"pagination-button-left": "awsui_pagination-button-
|
|
9
|
-
"pagination-button-left-scrollable": "awsui_pagination-button-left-
|
|
10
|
-
"pagination-button-right": "awsui_pagination-button-
|
|
11
|
-
"pagination-button-right-scrollable": "awsui_pagination-button-right-
|
|
12
|
-
"tabs-tab": "awsui_tabs-
|
|
13
|
-
"tabs-tab-label": "awsui_tabs-tab-
|
|
14
|
-
"tabs-tab-link": "awsui_tabs-tab-
|
|
15
|
-
"tabs-tab-disabled": "awsui_tabs-tab-
|
|
16
|
-
"refresh": "
|
|
17
|
-
"tabs-tab-active": "awsui_tabs-tab-
|
|
18
|
-
"tabs-header-with-divider": "awsui_tabs-header-with-
|
|
19
|
-
"root": "
|
|
20
|
-
"tabs": "
|
|
21
|
-
"tabs-content-wrapper": "awsui_tabs-content-
|
|
22
|
-
"with-paddings": "awsui_with-
|
|
23
|
-
"tabs-container-content-wrapper": "awsui_tabs-container-content-
|
|
24
|
-
"tabs-content": "awsui_tabs-
|
|
25
|
-
"tabs-content-active": "awsui_tabs-content-
|
|
5
|
+
"tabs-header": "awsui_tabs-header_14rmt_1sfab_186",
|
|
6
|
+
"tabs-header-list": "awsui_tabs-header-list_14rmt_1sfab_192",
|
|
7
|
+
"pagination-button": "awsui_pagination-button_14rmt_1sfab_209",
|
|
8
|
+
"pagination-button-left": "awsui_pagination-button-left_14rmt_1sfab_214",
|
|
9
|
+
"pagination-button-left-scrollable": "awsui_pagination-button-left-scrollable_14rmt_1sfab_217",
|
|
10
|
+
"pagination-button-right": "awsui_pagination-button-right_14rmt_1sfab_221",
|
|
11
|
+
"pagination-button-right-scrollable": "awsui_pagination-button-right-scrollable_14rmt_1sfab_224",
|
|
12
|
+
"tabs-tab": "awsui_tabs-tab_14rmt_1sfab_229",
|
|
13
|
+
"tabs-tab-label": "awsui_tabs-tab-label_14rmt_1sfab_240",
|
|
14
|
+
"tabs-tab-link": "awsui_tabs-tab-link_14rmt_1sfab_256",
|
|
15
|
+
"tabs-tab-disabled": "awsui_tabs-tab-disabled_14rmt_1sfab_313",
|
|
16
|
+
"refresh": "awsui_refresh_14rmt_1sfab_330",
|
|
17
|
+
"tabs-tab-active": "awsui_tabs-tab-active_14rmt_1sfab_344",
|
|
18
|
+
"tabs-header-with-divider": "awsui_tabs-header-with-divider_14rmt_1sfab_351",
|
|
19
|
+
"root": "awsui_root_14rmt_1sfab_355",
|
|
20
|
+
"tabs": "awsui_tabs_14rmt_1sfab_186",
|
|
21
|
+
"tabs-content-wrapper": "awsui_tabs-content-wrapper_14rmt_1sfab_372",
|
|
22
|
+
"with-paddings": "awsui_with-paddings_14rmt_1sfab_372",
|
|
23
|
+
"tabs-container-content-wrapper": "awsui_tabs-container-content-wrapper_14rmt_1sfab_376",
|
|
24
|
+
"tabs-content": "awsui_tabs-content_14rmt_1sfab_372",
|
|
25
|
+
"tabs-content-active": "awsui_tabs-content-active_14rmt_1sfab_384"
|
|
26
26
|
};
|
|
27
27
|
|
|
@@ -146,7 +146,7 @@ var TagEditor = React.forwardRef(function (_a, ref) {
|
|
|
146
146
|
React.createElement(InternalStatusIndicator, { className: styles.loading, type: "loading" }, i18nStrings.loading)));
|
|
147
147
|
}
|
|
148
148
|
var baseProps = getBaseProps(restProps);
|
|
149
|
-
return (React.createElement(InternalAttributeEditor, __assign({}, baseProps, baseComponentProps, { ref: attributeEditorRef, className: clsx(styles.root, baseProps.className), items: internalTags, isItemRemovable: isItemRemovable, onAddButtonClick: onAddButtonClick, onRemoveButtonClick: onRemoveButtonClick, addButtonText: i18nStrings.addButton, removeButtonText: i18nStrings.removeButton, disableAddButton: remainingTags <= 0, empty: i18nStrings.emptyTags, additionalInfo: React.createElement("div", { "aria-live": "polite" }, remainingTags < 0 ? (React.createElement(FormFieldError, null, (_b = i18nStrings.tagLimitExceeded(tagLimit)) !== null && _b !== void 0 ? _b : '')) : remainingTags === 0 ? ((_c = i18nStrings.tagLimitReached(tagLimit)) !== null && _c !== void 0 ? _c : '') : (i18nStrings.tagLimit(remainingTags))), definition: definition })));
|
|
149
|
+
return (React.createElement(InternalAttributeEditor, __assign({}, baseProps, baseComponentProps, { ref: attributeEditorRef, className: clsx(styles.root, baseProps.className), items: internalTags, isItemRemovable: isItemRemovable, onAddButtonClick: onAddButtonClick, onRemoveButtonClick: onRemoveButtonClick, addButtonText: i18nStrings.addButton, removeButtonText: i18nStrings.removeButton, disableAddButton: remainingTags <= 0, empty: i18nStrings.emptyTags, additionalInfo: React.createElement("div", { "aria-live": "polite" }, remainingTags < 0 ? (React.createElement(FormFieldError, null, (_b = i18nStrings.tagLimitExceeded(tagLimit)) !== null && _b !== void 0 ? _b : '')) : remainingTags === 0 ? ((_c = i18nStrings.tagLimitReached(tagLimit)) !== null && _c !== void 0 ? _c : '') : (i18nStrings.tagLimit(remainingTags, tagLimit))), definition: definition })));
|
|
150
150
|
});
|
|
151
151
|
applyDisplayName(TagEditor, 'TagEditor');
|
|
152
152
|
export default TagEditor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tag-editor/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,mBAAmB,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAClG,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAA4B,MAAM,oBAAoB,CAAC;AACtF,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AAKnF,OAAO,uBAAuB,MAAM,8BAA8B,CAAC;AACnE,OAAO,uBAAuB,MAAM,8BAA8B,CAAC;AACnE,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAEpD,OAAO,EAAE,QAAQ,EAAmB,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEtD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,O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Aa,GAAG,CAAC,CAAC,CAAC,CAAC,CACnB,oBAAC,cAAc,QAAE,MAAA,WAAW,CAAC,gBAAgB,CAAC,QAAQ,CAAC,mCAAI,EAAE,CAAkB,CAChF,CAAC,CAAC,CAAC,aAAa,KAAK,CAAC,CAAC,CAAC,CAAC,CACxB,MAAA,WAAW,CAAC,eAAe,CAAC,QAAQ,CAAC,mCAAI,EAAE,CAC5C,CAAC,CAAC,CAAC,CACF,WAAW,CAAC,QAAQ,CAAC,aAAa,CAAC,CACpC,CACG,EAER,UAAU,EAAE,UAAU,IACtB,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;AACzC,eAAe,SAAS,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback, useImperativeHandle, useLayoutEffect, useMemo, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { getBaseProps } from '../internal/base-component';\nimport { fireNonCancelableEvent, NonCancelableCustomEvent } from '../internal/events';\nimport { useStableEventHandler } from '../internal/hooks/use-stable-event-handler';\n\nimport { InputProps } from '../input/interfaces';\nimport { AutosuggestProps } from '../autosuggest/interfaces';\nimport { AttributeEditorProps } from '../attribute-editor/interfaces';\nimport InternalAttributeEditor from '../attribute-editor/internal';\nimport InternalStatusIndicator from '../status-indicator/internal';\nimport InternalBox from '../box/internal';\nimport { FormFieldError } from '../form-field/internal';\n\nimport { TagControl, UndoButton } from './internal';\nimport { TagEditorProps } from './interfaces';\nimport { validate, ValidationError } from './validation';\nimport { findIndex, useMemoizedArray } from './utils';\n\nimport styles from './styles.css.js';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport useBaseComponent from '../internal/hooks/use-base-component';\n\nexport { TagEditorProps };\n\ninterface InternalTag {\n tag: TagEditorProps.Tag;\n error?: ValidationError;\n}\n\nconst isItemRemovable = ({ tag }: InternalTag) => !tag.markedForRemoval;\n\nconst TagEditor = React.forwardRef(\n (\n {\n tags = [],\n i18nStrings,\n loading = false,\n tagLimit = 50,\n allowedCharacterPattern,\n keysRequest,\n valuesRequest,\n onChange,\n ...restProps\n }: TagEditorProps,\n ref: React.Ref<TagEditorProps.Ref>\n ) => {\n const baseComponentProps = useBaseComponent('TagEditor');\n\n const remainingTags = tagLimit - tags.filter(tag => !tag.markedForRemoval).length;\n\n const attributeEditorRef = useRef<AttributeEditorProps.Ref>(null);\n const keyInputRefs = useRef<(InputProps.Ref | undefined | null)[]>([]);\n const valueInputRefs = useRef<(InputProps.Ref | undefined | null)[]>([]);\n const undoButtonRefs = useRef<(HTMLAnchorElement | undefined | null)[]>([]);\n\n const initialKeyOptionsRef = useRef<AutosuggestProps.Options>([]);\n const keyDirtyStateRef = useRef<boolean[]>([]);\n const focusEventRef = useRef<() => void>();\n\n useLayoutEffect(() => {\n focusEventRef.current?.apply(undefined);\n focusEventRef.current = undefined;\n });\n\n const errors = validate(\n tags,\n keyDirtyStateRef.current,\n i18nStrings,\n allowedCharacterPattern ? new RegExp(allowedCharacterPattern) : undefined\n );\n\n const internalTags = useMemoizedArray(\n tags.map((tag, i) => ({ tag, error: errors[i] })),\n (prev, next) => {\n return prev.tag === next.tag && prev.error?.key === next.error?.key && prev.error?.value === next.error?.value;\n }\n );\n\n useImperativeHandle(\n ref,\n () => ({\n focus() {\n const errorIndex = findIndex(internalTags, ({ error }) => error?.key || error?.value);\n if (errorIndex !== -1) {\n const refArray = internalTags[errorIndex].error?.key ? keyInputRefs : valueInputRefs;\n refArray.current[errorIndex]?.focus();\n }\n },\n }),\n [internalTags]\n );\n\n const validateAndFire = useCallback(\n (newTags: ReadonlyArray<TagEditorProps.Tag>) => {\n fireNonCancelableEvent(onChange, {\n tags: newTags,\n valid: !validate(\n newTags,\n keyDirtyStateRef.current,\n i18nStrings,\n allowedCharacterPattern ? new RegExp(allowedCharacterPattern) : undefined\n ).some(error => error),\n });\n },\n [onChange, i18nStrings, allowedCharacterPattern]\n );\n\n const onAddButtonClick = () => {\n validateAndFire([...tags, { key: '', value: '', existing: false }]);\n focusEventRef.current = () => {\n keyInputRefs.current[tags.length]?.focus();\n };\n };\n\n const onRemoveButtonClick = useStableEventHandler(\n ({ detail }: NonCancelableCustomEvent<AttributeEditorProps.RemoveButtonClickDetail>) => {\n const existing = tags[detail.itemIndex].existing;\n validateAndFire([\n ...tags.slice(0, detail.itemIndex),\n ...(existing ? [{ ...tags[detail.itemIndex], markedForRemoval: true }] : []),\n ...tags.slice(detail.itemIndex + 1),\n ]);\n if (existing) {\n focusEventRef.current = () => {\n undoButtonRefs.current[detail.itemIndex]?.focus();\n };\n } else {\n keyDirtyStateRef.current.splice(detail.itemIndex, 1);\n keyInputRefs.current[detail.itemIndex]?.focus();\n }\n }\n );\n\n const onKeyChange = useStableEventHandler((value: string, row: number) => {\n keyDirtyStateRef.current[row] = true;\n validateAndFire([...tags.slice(0, row), { ...tags[row], key: value }, ...tags.slice(row + 1)]);\n });\n\n const onKeyBlur = useStableEventHandler((row: number) => {\n keyDirtyStateRef.current[row] = true;\n // Force re-render by providing a new array reference\n validateAndFire([...tags]);\n });\n\n const onValueChange = useStableEventHandler((value: string, row: number) => {\n validateAndFire([...tags.slice(0, row), { ...tags[row], value }, ...tags.slice(row + 1)]);\n });\n\n const onUndoRemoval = useStableEventHandler((row: number) => {\n validateAndFire([...tags.slice(0, row), { ...tags[row], markedForRemoval: false }, ...tags.slice(row + 1)]);\n focusEventRef.current = () => {\n attributeEditorRef.current?.focusRemoveButton(row);\n };\n });\n\n const definition = useMemo(\n () => [\n {\n label: i18nStrings.keyHeader,\n control: ({ tag }: InternalTag, row: number) => (\n <TagControl\n row={row}\n value={tag.key}\n readOnly={tag.existing}\n limit={200}\n defaultOptions={[]}\n placeholder={i18nStrings.keyPlaceholder}\n errorText={i18nStrings.keysSuggestionError}\n loadingText={i18nStrings.keysSuggestionLoading}\n suggestionText={i18nStrings.keySuggestion}\n tooManySuggestionText={i18nStrings.tooManyKeysSuggestion}\n enteredTextLabel={i18nStrings.enteredKeyLabel}\n onRequest={keysRequest}\n onChange={onKeyChange}\n onBlur={onKeyBlur}\n initialOptionsRef={initialKeyOptionsRef}\n ref={ref => {\n keyInputRefs.current[row] = ref;\n }}\n />\n ),\n errorText: ({ error }: InternalTag) => error?.key,\n },\n {\n label: (\n <>\n {i18nStrings.valueHeader} - <i>{i18nStrings.optional}</i>\n </>\n ),\n control: ({ tag }: InternalTag, row: number) =>\n tag.markedForRemoval ? (\n <div role=\"alert\">\n <InternalBox margin={{ top: 'xxs' }}>\n {i18nStrings.undoPrompt}{' '}\n <UndoButton\n onClick={() => onUndoRemoval(row)}\n ref={elem => {\n undoButtonRefs.current[row] = elem;\n }}\n >\n {i18nStrings.undoButton}\n </UndoButton>\n </InternalBox>\n </div>\n ) : (\n <TagControl\n row={row}\n value={tag.value}\n readOnly={false}\n limit={200}\n defaultOptions={tag.valueSuggestionOptions ?? []}\n placeholder={i18nStrings.valuePlaceholder}\n errorText={i18nStrings.valuesSuggestionError}\n loadingText={i18nStrings.valuesSuggestionLoading}\n suggestionText={i18nStrings.valueSuggestion}\n tooManySuggestionText={i18nStrings.tooManyValuesSuggestion}\n enteredTextLabel={i18nStrings.enteredValueLabel}\n filteringKey={tag.key}\n onRequest={valuesRequest && (value => valuesRequest(tag.key, value))}\n onChange={onValueChange}\n ref={ref => {\n valueInputRefs.current[row] = ref;\n }}\n />\n ),\n errorText: ({ error }: InternalTag) => error?.value,\n },\n ],\n [i18nStrings, keysRequest, onKeyChange, onKeyBlur, valuesRequest, onValueChange, onUndoRemoval]\n );\n\n if (loading) {\n return (\n <div className={styles.root} ref={baseComponentProps.__internalRootRef}>\n <InternalStatusIndicator className={styles.loading} type=\"loading\">\n {i18nStrings.loading}\n </InternalStatusIndicator>\n </div>\n );\n }\n\n const baseProps = getBaseProps(restProps);\n return (\n <InternalAttributeEditor<InternalTag>\n {...baseProps}\n {...baseComponentProps}\n ref={attributeEditorRef}\n className={clsx(styles.root, baseProps.className)}\n items={internalTags}\n isItemRemovable={isItemRemovable}\n onAddButtonClick={onAddButtonClick}\n onRemoveButtonClick={onRemoveButtonClick}\n addButtonText={i18nStrings.addButton}\n removeButtonText={i18nStrings.removeButton}\n disableAddButton={remainingTags <= 0}\n empty={i18nStrings.emptyTags}\n additionalInfo={\n <div aria-live=\"polite\">\n {remainingTags < 0 ? (\n <FormFieldError>{i18nStrings.tagLimitExceeded(tagLimit) ?? ''}</FormFieldError>\n ) : remainingTags === 0 ? (\n i18nStrings.tagLimitReached(tagLimit) ?? ''\n ) : (\n i18nStrings.tagLimit(remainingTags)\n )}\n </div>\n }\n definition={definition}\n />\n );\n }\n);\n\napplyDisplayName(TagEditor, 'TagEditor');\nexport default TagEditor;\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tag-editor/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,mBAAmB,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAClG,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAA4B,MAAM,oBAAoB,CAAC;AACtF,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AAKnF,OAAO,uBAAuB,MAAM,8BAA8B,CAAC;AACnE,OAAO,uBAAuB,MAAM,8BAA8B,CAAC;AACnE,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAEpD,OAAO,EAAE,QAAQ,EAAmB,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE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EAAE,WAAW,CAAC,SAAS,EAC5B,cAAc,EACZ,0CAAe,QAAQ,IACpB,aAAa,GAAG,CAAC,CAAC,CAAC,CAAC,CACnB,oBAAC,cAAc,QAAE,MAAA,WAAW,CAAC,gBAAgB,CAAC,QAAQ,CAAC,mCAAI,EAAE,CAAkB,CAChF,CAAC,CAAC,CAAC,aAAa,KAAK,CAAC,CAAC,CAAC,CAAC,CACxB,MAAA,WAAW,CAAC,eAAe,CAAC,QAAQ,CAAC,mCAAI,EAAE,CAC5C,CAAC,CAAC,CAAC,CACF,WAAW,CAAC,QAAQ,CAAC,aAAa,EAAE,QAAQ,CAAC,CAC9C,CACG,EAER,UAAU,EAAE,UAAU,IACtB,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;AACzC,eAAe,SAAS,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback, useImperativeHandle, useLayoutEffect, useMemo, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { getBaseProps } from '../internal/base-component';\nimport { fireNonCancelableEvent, NonCancelableCustomEvent } from '../internal/events';\nimport { useStableEventHandler } from '../internal/hooks/use-stable-event-handler';\n\nimport { InputProps } from '../input/interfaces';\nimport { AutosuggestProps } from '../autosuggest/interfaces';\nimport { AttributeEditorProps } from '../attribute-editor/interfaces';\nimport InternalAttributeEditor from '../attribute-editor/internal';\nimport InternalStatusIndicator from '../status-indicator/internal';\nimport InternalBox from '../box/internal';\nimport { FormFieldError } from '../form-field/internal';\n\nimport { TagControl, UndoButton } from './internal';\nimport { TagEditorProps } from './interfaces';\nimport { validate, ValidationError } from './validation';\nimport { findIndex, useMemoizedArray } from './utils';\n\nimport styles from './styles.css.js';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport useBaseComponent from '../internal/hooks/use-base-component';\n\nexport { TagEditorProps };\n\ninterface InternalTag {\n tag: TagEditorProps.Tag;\n error?: ValidationError;\n}\n\nconst isItemRemovable = ({ tag }: InternalTag) => !tag.markedForRemoval;\n\nconst TagEditor = React.forwardRef(\n (\n {\n tags = [],\n i18nStrings,\n loading = false,\n tagLimit = 50,\n allowedCharacterPattern,\n keysRequest,\n valuesRequest,\n onChange,\n ...restProps\n }: TagEditorProps,\n ref: React.Ref<TagEditorProps.Ref>\n ) => {\n const baseComponentProps = useBaseComponent('TagEditor');\n\n const remainingTags = tagLimit - tags.filter(tag => !tag.markedForRemoval).length;\n\n const attributeEditorRef = useRef<AttributeEditorProps.Ref>(null);\n const keyInputRefs = useRef<(InputProps.Ref | undefined | null)[]>([]);\n const valueInputRefs = useRef<(InputProps.Ref | undefined | null)[]>([]);\n const undoButtonRefs = useRef<(HTMLAnchorElement | undefined | null)[]>([]);\n\n const initialKeyOptionsRef = useRef<AutosuggestProps.Options>([]);\n const keyDirtyStateRef = useRef<boolean[]>([]);\n const focusEventRef = useRef<() => void>();\n\n useLayoutEffect(() => {\n focusEventRef.current?.apply(undefined);\n focusEventRef.current = undefined;\n });\n\n const errors = validate(\n tags,\n keyDirtyStateRef.current,\n i18nStrings,\n allowedCharacterPattern ? new RegExp(allowedCharacterPattern) : undefined\n );\n\n const internalTags = useMemoizedArray(\n tags.map((tag, i) => ({ tag, error: errors[i] })),\n (prev, next) => {\n return prev.tag === next.tag && prev.error?.key === next.error?.key && prev.error?.value === next.error?.value;\n }\n );\n\n useImperativeHandle(\n ref,\n () => ({\n focus() {\n const errorIndex = findIndex(internalTags, ({ error }) => error?.key || error?.value);\n if (errorIndex !== -1) {\n const refArray = internalTags[errorIndex].error?.key ? keyInputRefs : valueInputRefs;\n refArray.current[errorIndex]?.focus();\n }\n },\n }),\n [internalTags]\n );\n\n const validateAndFire = useCallback(\n (newTags: ReadonlyArray<TagEditorProps.Tag>) => {\n fireNonCancelableEvent(onChange, {\n tags: newTags,\n valid: !validate(\n newTags,\n keyDirtyStateRef.current,\n i18nStrings,\n allowedCharacterPattern ? new RegExp(allowedCharacterPattern) : undefined\n ).some(error => error),\n });\n },\n [onChange, i18nStrings, allowedCharacterPattern]\n );\n\n const onAddButtonClick = () => {\n validateAndFire([...tags, { key: '', value: '', existing: false }]);\n focusEventRef.current = () => {\n keyInputRefs.current[tags.length]?.focus();\n };\n };\n\n const onRemoveButtonClick = useStableEventHandler(\n ({ detail }: NonCancelableCustomEvent<AttributeEditorProps.RemoveButtonClickDetail>) => {\n const existing = tags[detail.itemIndex].existing;\n validateAndFire([\n ...tags.slice(0, detail.itemIndex),\n ...(existing ? [{ ...tags[detail.itemIndex], markedForRemoval: true }] : []),\n ...tags.slice(detail.itemIndex + 1),\n ]);\n if (existing) {\n focusEventRef.current = () => {\n undoButtonRefs.current[detail.itemIndex]?.focus();\n };\n } else {\n keyDirtyStateRef.current.splice(detail.itemIndex, 1);\n keyInputRefs.current[detail.itemIndex]?.focus();\n }\n }\n );\n\n const onKeyChange = useStableEventHandler((value: string, row: number) => {\n keyDirtyStateRef.current[row] = true;\n validateAndFire([...tags.slice(0, row), { ...tags[row], key: value }, ...tags.slice(row + 1)]);\n });\n\n const onKeyBlur = useStableEventHandler((row: number) => {\n keyDirtyStateRef.current[row] = true;\n // Force re-render by providing a new array reference\n validateAndFire([...tags]);\n });\n\n const onValueChange = useStableEventHandler((value: string, row: number) => {\n validateAndFire([...tags.slice(0, row), { ...tags[row], value }, ...tags.slice(row + 1)]);\n });\n\n const onUndoRemoval = useStableEventHandler((row: number) => {\n validateAndFire([...tags.slice(0, row), { ...tags[row], markedForRemoval: false }, ...tags.slice(row + 1)]);\n focusEventRef.current = () => {\n attributeEditorRef.current?.focusRemoveButton(row);\n };\n });\n\n const definition = useMemo(\n () => [\n {\n label: i18nStrings.keyHeader,\n control: ({ tag }: InternalTag, row: number) => (\n <TagControl\n row={row}\n value={tag.key}\n readOnly={tag.existing}\n limit={200}\n defaultOptions={[]}\n placeholder={i18nStrings.keyPlaceholder}\n errorText={i18nStrings.keysSuggestionError}\n loadingText={i18nStrings.keysSuggestionLoading}\n suggestionText={i18nStrings.keySuggestion}\n tooManySuggestionText={i18nStrings.tooManyKeysSuggestion}\n enteredTextLabel={i18nStrings.enteredKeyLabel}\n onRequest={keysRequest}\n onChange={onKeyChange}\n onBlur={onKeyBlur}\n initialOptionsRef={initialKeyOptionsRef}\n ref={ref => {\n keyInputRefs.current[row] = ref;\n }}\n />\n ),\n errorText: ({ error }: InternalTag) => error?.key,\n },\n {\n label: (\n <>\n {i18nStrings.valueHeader} - <i>{i18nStrings.optional}</i>\n </>\n ),\n control: ({ tag }: InternalTag, row: number) =>\n tag.markedForRemoval ? (\n <div role=\"alert\">\n <InternalBox margin={{ top: 'xxs' }}>\n {i18nStrings.undoPrompt}{' '}\n <UndoButton\n onClick={() => onUndoRemoval(row)}\n ref={elem => {\n undoButtonRefs.current[row] = elem;\n }}\n >\n {i18nStrings.undoButton}\n </UndoButton>\n </InternalBox>\n </div>\n ) : (\n <TagControl\n row={row}\n value={tag.value}\n readOnly={false}\n limit={200}\n defaultOptions={tag.valueSuggestionOptions ?? []}\n placeholder={i18nStrings.valuePlaceholder}\n errorText={i18nStrings.valuesSuggestionError}\n loadingText={i18nStrings.valuesSuggestionLoading}\n suggestionText={i18nStrings.valueSuggestion}\n tooManySuggestionText={i18nStrings.tooManyValuesSuggestion}\n enteredTextLabel={i18nStrings.enteredValueLabel}\n filteringKey={tag.key}\n onRequest={valuesRequest && (value => valuesRequest(tag.key, value))}\n onChange={onValueChange}\n ref={ref => {\n valueInputRefs.current[row] = ref;\n }}\n />\n ),\n errorText: ({ error }: InternalTag) => error?.value,\n },\n ],\n [i18nStrings, keysRequest, onKeyChange, onKeyBlur, valuesRequest, onValueChange, onUndoRemoval]\n );\n\n if (loading) {\n return (\n <div className={styles.root} ref={baseComponentProps.__internalRootRef}>\n <InternalStatusIndicator className={styles.loading} type=\"loading\">\n {i18nStrings.loading}\n </InternalStatusIndicator>\n </div>\n );\n }\n\n const baseProps = getBaseProps(restProps);\n return (\n <InternalAttributeEditor<InternalTag>\n {...baseProps}\n {...baseComponentProps}\n ref={attributeEditorRef}\n className={clsx(styles.root, baseProps.className)}\n items={internalTags}\n isItemRemovable={isItemRemovable}\n onAddButtonClick={onAddButtonClick}\n onRemoveButtonClick={onRemoveButtonClick}\n addButtonText={i18nStrings.addButton}\n removeButtonText={i18nStrings.removeButton}\n disableAddButton={remainingTags <= 0}\n empty={i18nStrings.emptyTags}\n additionalInfo={\n <div aria-live=\"polite\">\n {remainingTags < 0 ? (\n <FormFieldError>{i18nStrings.tagLimitExceeded(tagLimit) ?? ''}</FormFieldError>\n ) : remainingTags === 0 ? (\n i18nStrings.tagLimitReached(tagLimit) ?? ''\n ) : (\n i18nStrings.tagLimit(remainingTags, tagLimit)\n )}\n </div>\n }\n definition={definition}\n />\n );\n }\n);\n\napplyDisplayName(TagEditor, 'TagEditor');\nexport default TagEditor;\n"]}
|
|
@@ -103,7 +103,7 @@ export declare namespace TagEditorProps {
|
|
|
103
103
|
invalidKeyError: string;
|
|
104
104
|
invalidValueError: string;
|
|
105
105
|
awsPrefixError: string;
|
|
106
|
-
tagLimit: (availableTags: number) => string;
|
|
106
|
+
tagLimit: (availableTags: number, tagLimit: number) => string;
|
|
107
107
|
tagLimitReached: (tagLimit: number) => string;
|
|
108
108
|
tagLimitExceeded: (tagLimit: number) => string;
|
|
109
109
|
enteredKeyLabel: (enteredText: string) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/tag-editor/interfaces.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,MAAM,WAAW,cAAe,SAAQ,kBAAkB;IACxD;;;;;;;;;;;OAWG;IACH,I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AC;QAChC,aAAa,EAAE,MAAM,CAAC;QACtB,qBAAqB,EAAE,MAAM,CAAC;QAC9B,uBAAuB,EAAE,MAAM,CAAC;QAChC,iBAAiB,EAAE,MAAM,CAAC;QAC1B,eAAe,EAAE,MAAM,CAAC;QACxB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,cAAc,EAAE,MAAM,CAAC;QACvB,QAAQ,EAAE,CAAC,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC;QAC9D,eAAe,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC;QAC9C,gBAAgB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC;QAC/C,eAAe,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,MAAM,CAAC;QACjD,iBAAiB,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,MAAM,CAAC;KACpD;IAED,UAAiB,YAAY;QAC3B,IAAI,EAAE,aAAa,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;QACxC,KAAK,EAAE,OAAO,CAAC;KAChB;IAED,UAAiB,GAAG;QAClB;;;WAGG;QACH,KAAK,IAAI,IAAI,CAAC;KACf;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/tag-editor/interfaces.tsx"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BaseComponentProps } from '../internal/base-component';\nimport { AutosuggestProps } from '../autosuggest/interfaces';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface TagEditorProps extends BaseComponentProps {\n /**\n * Specifies an array of tags that are displayed to the user. Each tag item has the following properties:\n * - `key` (string) - The key of the tag that's displayed in the corresponding key field.\n * - `value` (string) - The value of the tag that's displayed in the corresponding value field.\n * - `existing` (boolean) - Specifies if this is an existing tag for the resource.\n * When set to `true`, if the tag is deleted its `markedForRemoval` property is to `true`.\n * When set to `false`, deletion of the tag removes the tag from the `tags` list.\n * - `markedForRemoval` (boolean) - Specifies if this tag has been marked for removal.\n * This property is set to `true` by the component when a user removes an existing tag.\n * The item will remain in the `tags` list. When set to `true`, the user is presented with the option to undo the removal operation.\n * - `valueSuggestionOptions` (Array<AutosuggestProps.Option>) - An array of autosuggest suggestion options associated with the specified tag key.\n */\n tags?: ReadonlyArray<TagEditorProps.Tag>;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n */\n i18nStrings: TagEditorProps.I18nStrings;\n\n /**\n * Renders the component in a loading state.\n */\n loading?: boolean;\n\n /**\n * Specifies the maximum number of tags that a customer can add.\n */\n tagLimit?: number;\n\n /**\n * Specifies a regular expression string that overrides the default acceptable\n * character validation. You should use this property only when absolutely necessary.\n */\n allowedCharacterPattern?: string;\n\n /**\n * Specifies a function that returns all the keys for a resource.\n * The expected return type of the function should be a promise that\n * resolves to a list of strings of all the keys (for example, `['key1', 'key2']`).\n */\n keysRequest?: (key: string) => Promise<ReadonlyArray<string>>;\n\n /**\n * Specifies a function that returns all the values for a specified key\n * of a resource. The expected return type of the function should be a promise\n * that resolves to a list of strings of all the values (for example, `['value1', 'value2']`).\n *\n * You should return a rejected promise when the `key` parameter is an empty string.\n */\n valuesRequest?: (key: string, value: string) => Promise<ReadonlyArray<string>>;\n\n /**\n * Called when any tag operation occurs.\n * The event `detail` object contains the full updated state of `tags`,\n * and whether the component is in a `valid` state.\n */\n onChange?: NonCancelableEventHandler<TagEditorProps.ChangeDetail>;\n}\n\nexport namespace TagEditorProps {\n export interface Tag {\n /**\n * The key of the tag that will be displayed in the corresponding key field.\n */\n key: string;\n\n /**\n * The value of the tag that will be displayed in the corresponding value field.\n */\n value: string;\n\n /**\n * Whether this is an existing tag for the resource. If set to `true`, deletion of the tag will set the `markedForRemoval` property to `true`. If set to `false`, deletion of the tag will remove the tag from the `tags` list.\n */\n existing: boolean;\n\n /**\n * Whether this tag has been marked for removal. This property will be set to `true` by the component when a user tries to remove an existing tag. The item will remain in the `tags` list. When set to `true`, the user will be presented with the option to undo the removal operation.\n */\n markedForRemoval?: boolean;\n\n /**\n * An array of suggested values for the specified tag key.\n */\n valueSuggestionOptions?: ReadonlyArray<AutosuggestProps.Option>;\n }\n\n export interface I18nStrings {\n keyPlaceholder: string;\n valuePlaceholder: string;\n addButton: string;\n removeButton: string;\n undoButton: string;\n undoPrompt: string;\n loading: string;\n keyHeader: string;\n valueHeader: string;\n optional: string;\n keySuggestion: string;\n valueSuggestion: string;\n tooManyKeysSuggestion: string;\n tooManyValuesSuggestion: string;\n emptyTags: string;\n keysSuggestionLoading: string;\n keysSuggestionError: string;\n valuesSuggestionError: string;\n valuesSuggestionLoading: string;\n emptyKeyError: string;\n maxKeyCharLengthError: string;\n maxValueCharLengthError: string;\n duplicateKeyError: string;\n invalidKeyError: string;\n invalidValueError: string;\n awsPrefixError: string;\n tagLimit: (availableTags: number) => string;\n tagLimitReached: (tagLimit: number) => string;\n tagLimitExceeded: (tagLimit: number) => string;\n enteredKeyLabel: (enteredText: string) => string;\n enteredValueLabel: (enteredText: string) => string;\n }\n\n export interface ChangeDetail {\n tags: ReadonlyArray<TagEditorProps.Tag>;\n valid: boolean;\n }\n\n export interface Ref {\n /**\n * Focuses the first error within the component.\n * If no error is present, no element is focused.\n */\n focus(): void;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/tag-editor/interfaces.tsx"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BaseComponentProps } from '../internal/base-component';\nimport { AutosuggestProps } from '../autosuggest/interfaces';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface TagEditorProps extends BaseComponentProps {\n /**\n * Specifies an array of tags that are displayed to the user. Each tag item has the following properties:\n * - `key` (string) - The key of the tag that's displayed in the corresponding key field.\n * - `value` (string) - The value of the tag that's displayed in the corresponding value field.\n * - `existing` (boolean) - Specifies if this is an existing tag for the resource.\n * When set to `true`, if the tag is deleted its `markedForRemoval` property is to `true`.\n * When set to `false`, deletion of the tag removes the tag from the `tags` list.\n * - `markedForRemoval` (boolean) - Specifies if this tag has been marked for removal.\n * This property is set to `true` by the component when a user removes an existing tag.\n * The item will remain in the `tags` list. When set to `true`, the user is presented with the option to undo the removal operation.\n * - `valueSuggestionOptions` (Array<AutosuggestProps.Option>) - An array of autosuggest suggestion options associated with the specified tag key.\n */\n tags?: ReadonlyArray<TagEditorProps.Tag>;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n */\n i18nStrings: TagEditorProps.I18nStrings;\n\n /**\n * Renders the component in a loading state.\n */\n loading?: boolean;\n\n /**\n * Specifies the maximum number of tags that a customer can add.\n */\n tagLimit?: number;\n\n /**\n * Specifies a regular expression string that overrides the default acceptable\n * character validation. You should use this property only when absolutely necessary.\n */\n allowedCharacterPattern?: string;\n\n /**\n * Specifies a function that returns all the keys for a resource.\n * The expected return type of the function should be a promise that\n * resolves to a list of strings of all the keys (for example, `['key1', 'key2']`).\n */\n keysRequest?: (key: string) => Promise<ReadonlyArray<string>>;\n\n /**\n * Specifies a function that returns all the values for a specified key\n * of a resource. The expected return type of the function should be a promise\n * that resolves to a list of strings of all the values (for example, `['value1', 'value2']`).\n *\n * You should return a rejected promise when the `key` parameter is an empty string.\n */\n valuesRequest?: (key: string, value: string) => Promise<ReadonlyArray<string>>;\n\n /**\n * Called when any tag operation occurs.\n * The event `detail` object contains the full updated state of `tags`,\n * and whether the component is in a `valid` state.\n */\n onChange?: NonCancelableEventHandler<TagEditorProps.ChangeDetail>;\n}\n\nexport namespace TagEditorProps {\n export interface Tag {\n /**\n * The key of the tag that will be displayed in the corresponding key field.\n */\n key: string;\n\n /**\n * The value of the tag that will be displayed in the corresponding value field.\n */\n value: string;\n\n /**\n * Whether this is an existing tag for the resource. If set to `true`, deletion of the tag will set the `markedForRemoval` property to `true`. If set to `false`, deletion of the tag will remove the tag from the `tags` list.\n */\n existing: boolean;\n\n /**\n * Whether this tag has been marked for removal. This property will be set to `true` by the component when a user tries to remove an existing tag. The item will remain in the `tags` list. When set to `true`, the user will be presented with the option to undo the removal operation.\n */\n markedForRemoval?: boolean;\n\n /**\n * An array of suggested values for the specified tag key.\n */\n valueSuggestionOptions?: ReadonlyArray<AutosuggestProps.Option>;\n }\n\n export interface I18nStrings {\n keyPlaceholder: string;\n valuePlaceholder: string;\n addButton: string;\n removeButton: string;\n undoButton: string;\n undoPrompt: string;\n loading: string;\n keyHeader: string;\n valueHeader: string;\n optional: string;\n keySuggestion: string;\n valueSuggestion: string;\n tooManyKeysSuggestion: string;\n tooManyValuesSuggestion: string;\n emptyTags: string;\n keysSuggestionLoading: string;\n keysSuggestionError: string;\n valuesSuggestionError: string;\n valuesSuggestionLoading: string;\n emptyKeyError: string;\n maxKeyCharLengthError: string;\n maxValueCharLengthError: string;\n duplicateKeyError: string;\n invalidKeyError: string;\n invalidValueError: string;\n awsPrefixError: string;\n tagLimit: (availableTags: number, tagLimit: number) => string;\n tagLimitReached: (tagLimit: number) => string;\n tagLimitExceeded: (tagLimit: number) => string;\n enteredKeyLabel: (enteredText: string) => string;\n enteredValueLabel: (enteredText: string) => string;\n }\n\n export interface ChangeDetail {\n tags: ReadonlyArray<TagEditorProps.Tag>;\n valid: boolean;\n }\n\n export interface Ref {\n /**\n * Focuses the first error within the component.\n * If no error is present, no element is focused.\n */\n focus(): void;\n }\n}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"root": "
|
|
5
|
-
"loading": "
|
|
6
|
-
"undo-button": "awsui_undo-
|
|
4
|
+
"root": "awsui_root_brdst_ziyvk_93",
|
|
5
|
+
"loading": "awsui_loading_brdst_ziyvk_97",
|
|
6
|
+
"undo-button": "awsui_undo-button_brdst_ziyvk_101"
|
|
7
7
|
};
|
|
8
8
|
|