@cloudscape-design/components 3.0.1155 → 3.0.1157
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/alert/index.js +1 -1
- package/alert/interfaces.d.ts +1 -2
- package/anchor-navigation/styles.css.js +8 -8
- package/anchor-navigation/styles.scoped.css +21 -21
- package/anchor-navigation/styles.selectors.js +8 -8
- package/app-layout/runtime-drawer/index.d.ts.map +1 -1
- package/app-layout/runtime-drawer/index.js +20 -18
- package/app-layout/runtime-drawer/index.js.map +1 -1
- package/app-layout/visual-refresh/styles.css.js +86 -86
- package/app-layout/visual-refresh/styles.scoped.css +164 -163
- package/app-layout/visual-refresh/styles.selectors.js +86 -86
- package/app-layout/visual-refresh-toolbar/drawer/styles.css.js +30 -30
- package/app-layout/visual-refresh-toolbar/drawer/styles.scoped.css +86 -83
- package/app-layout/visual-refresh-toolbar/drawer/styles.selectors.js +30 -30
- package/app-layout/visual-refresh-toolbar/skeleton/toolbar-container.d.ts.map +1 -1
- package/app-layout/visual-refresh-toolbar/skeleton/toolbar-container.js +1 -1
- package/app-layout/visual-refresh-toolbar/skeleton/toolbar-container.js.map +1 -1
- package/attribute-editor/styles.css.js +15 -15
- package/attribute-editor/styles.scoped.css +28 -28
- package/attribute-editor/styles.selectors.js +15 -15
- package/autosuggest/index.js +28 -11
- package/autosuggest/interfaces.d.ts +2 -1
- package/autosuggest/interfaces.js.map +1 -1
- package/badge/index.d.ts +2 -0
- package/badge/index.js +14 -13
- package/badge/interfaces.d.ts +3 -2
- package/box/index.js +18 -13
- package/box/interfaces.d.ts +2 -1
- package/box/styles.css.js +192 -192
- package/box/styles.scoped.css +241 -241
- package/box/styles.selectors.js +192 -192
- package/breadcrumb-group/item/styles.css.js +7 -7
- package/breadcrumb-group/item/styles.scoped.css +28 -28
- package/breadcrumb-group/item/styles.selectors.js +7 -7
- package/button/index.js +12 -11
- package/button/interfaces.d.ts +4 -2
- package/button/styles.css.js +22 -22
- package/button/styles.scoped.css +78 -78
- package/button/styles.selectors.js +22 -22
- package/button-dropdown/index.js +27 -11
- package/button-dropdown/interfaces.d.ts +6 -2
- package/button-dropdown/item-element/styles.css.js +20 -20
- package/button-dropdown/item-element/styles.scoped.css +35 -35
- package/button-dropdown/item-element/styles.selectors.js +20 -20
- package/button-group/index.js +42 -11
- package/button-group/interfaces.d.ts +10 -0
- package/button-group/interfaces.d.ts.map +1 -1
- package/button-group/interfaces.js.map +1 -1
- package/cards/styles.css.js +39 -39
- package/cards/styles.scoped.css +51 -51
- package/cards/styles.selectors.js +39 -39
- package/checkbox/index.js +9 -11
- package/checkbox/interfaces.d.ts +3 -2
- package/code-editor/styles.css.js +33 -33
- package/code-editor/styles.scoped.css +139 -139
- package/code-editor/styles.selectors.js +33 -33
- package/container/index.js +29 -13
- package/container/interfaces.d.ts +2 -1
- package/date-input/index.js +8 -10
- package/drawer/implementation.d.ts +1 -0
- package/drawer/implementation.d.ts.map +1 -1
- package/drawer/implementation.js +13 -4
- package/drawer/implementation.js.map +1 -1
- package/drawer/interfaces.d.ts +7 -0
- package/drawer/interfaces.d.ts.map +1 -1
- package/drawer/interfaces.js.map +1 -1
- package/drawer/styles.css.js +12 -8
- package/drawer/styles.scoped.css +35 -13
- package/drawer/styles.selectors.js +12 -8
- package/drawer/use-sticky-footer.d.ts +11 -0
- package/drawer/use-sticky-footer.d.ts.map +1 -0
- package/drawer/use-sticky-footer.js +35 -0
- package/drawer/use-sticky-footer.js.map +1 -0
- package/flashbar/index.js +10 -13
- package/flashbar/interfaces.d.ts +1 -0
- package/help-panel/styles.css.js +6 -6
- package/help-panel/styles.scoped.css +75 -75
- package/help-panel/styles.selectors.js +6 -6
- package/icon/index.js +8 -13
- package/icon/interfaces.d.ts +2 -1
- package/icon/styles.css.js +39 -39
- package/icon/styles.scoped.css +87 -87
- package/icon/styles.selectors.js +39 -39
- package/icon-provider/index.js +12 -2
- package/index.d.ts +4 -1
- package/index.js +4 -0
- package/input/index.js +53 -12
- package/input/interfaces.d.ts +3 -1
- package/internal/base-component/styles.scoped.css +62 -50
- package/internal/components/button-trigger/styles.css.js +13 -13
- package/internal/components/button-trigger/styles.scoped.css +29 -29
- package/internal/components/button-trigger/styles.selectors.js +13 -13
- package/internal/components/cartesian-chart/styles.css.js +28 -28
- package/internal/components/cartesian-chart/styles.scoped.css +33 -33
- package/internal/components/cartesian-chart/styles.selectors.js +28 -28
- package/internal/components/radio-button/interfaces.d.ts +3 -3
- package/internal/components/token-list/styles.css.js +10 -10
- package/internal/components/token-list/styles.scoped.css +25 -25
- package/internal/components/token-list/styles.selectors.js +10 -10
- package/internal/environment.js +3 -3
- package/internal/environment.json +3 -3
- package/internal/generated/styles/tokens.js +8 -8
- package/internal/generated/theming/index.cjs +24 -24
- package/internal/generated/theming/index.js +24 -24
- package/internal/hooks/use-portal-mode-classes/index.d.ts +3 -1
- package/internal/hooks/use-portal-mode-classes/index.d.ts.map +1 -1
- package/internal/hooks/use-portal-mode-classes/index.js +2 -2
- package/internal/hooks/use-portal-mode-classes/index.js.map +1 -1
- package/internal/manifest.json +1 -1
- package/internal/plugins/controllers/drawers.d.ts +2 -2
- package/internal/plugins/controllers/drawers.d.ts.map +1 -1
- package/internal/plugins/controllers/drawers.js.map +1 -1
- package/internal/plugins/widget/interfaces.d.ts +2 -2
- package/internal/plugins/widget/interfaces.d.ts.map +1 -1
- package/internal/plugins/widget/interfaces.js.map +1 -1
- package/key-value-pairs/styles.css.js +8 -8
- package/key-value-pairs/styles.scoped.css +10 -10
- package/key-value-pairs/styles.selectors.js +8 -8
- package/link/index.js +25 -11
- package/link/interfaces.d.ts +3 -2
- package/link/styles.css.js +20 -20
- package/link/styles.scoped.css +91 -91
- package/link/styles.selectors.js +20 -20
- package/navigable-group/index.js +19 -4
- package/package.json +4 -1
- package/popover/internal.js +1 -1
- package/popover/internal.js.map +1 -1
- package/popover/styles.css.js +57 -57
- package/popover/styles.scoped.css +87 -87
- package/popover/styles.selectors.js +57 -57
- package/progress-bar/index.d.ts +1 -0
- package/progress-bar/index.js +52 -14
- package/progress-bar/interfaces.d.ts +1 -0
- package/progress-bar/styles.css.js +19 -19
- package/progress-bar/styles.scoped.css +31 -31
- package/progress-bar/styles.selectors.js +19 -19
- package/prompt-input/index.js +19 -11
- package/prompt-input/interfaces.d.ts +4 -3
- package/radio-button/index.js +19 -4
- package/radio-group/index.js +20 -11
- package/radio-group/interfaces.d.ts +1 -1
- package/segmented-control/index.js +14 -13
- package/segmented-control/interfaces.d.ts +1 -0
- package/select/interfaces.d.ts +1 -1
- package/select/interfaces.js.map +1 -1
- package/side-navigation/styles.css.js +30 -30
- package/side-navigation/styles.scoped.css +47 -47
- package/side-navigation/styles.selectors.js +30 -30
- package/space-between/index.js +10 -13
- package/space-between/interfaces.d.ts +2 -1
- package/spinner/index.js +10 -13
- package/spinner/interfaces.d.ts +2 -1
- package/split-panel/icons/styles.css.js +22 -22
- package/split-panel/icons/styles.scoped.css +25 -25
- package/split-panel/icons/styles.selectors.js +22 -22
- package/status-indicator/index.js +10 -13
- package/status-indicator/interfaces.d.ts +2 -1
- package/steps/index.js +11 -11
- package/steps/interfaces.d.ts +6 -2
- package/table/header-cell/index.d.ts +1 -1
- package/table/header-cell/index.d.ts.map +1 -1
- package/table/header-cell/index.js +1 -1
- package/table/header-cell/index.js.map +1 -1
- package/table/header-cell/th-element.d.ts +1 -1
- package/table/header-cell/th-element.d.ts.map +1 -1
- package/table/header-cell/th-element.js.map +1 -1
- package/table/resizer/index.d.ts +3 -1
- package/table/resizer/index.d.ts.map +1 -1
- package/table/resizer/index.js +8 -5
- package/table/resizer/index.js.map +1 -1
- package/table/resizer/styles.css.js +13 -12
- package/table/resizer/styles.scoped.css +22 -22
- package/table/resizer/styles.selectors.js +13 -12
- package/table/thead.d.ts +1 -1
- package/table/thead.d.ts.map +1 -1
- package/table/thead.js.map +1 -1
- package/tag-editor/styles.css.js +3 -3
- package/tag-editor/styles.scoped.css +13 -13
- package/tag-editor/styles.selectors.js +3 -3
- package/test-utils/dom/drawer/index.d.ts +1 -0
- package/test-utils/dom/drawer/index.js +3 -0
- package/test-utils/dom/drawer/index.js.map +1 -1
- package/test-utils/selectors/drawer/index.d.ts +1 -0
- package/test-utils/selectors/drawer/index.js +3 -0
- package/test-utils/selectors/drawer/index.js.map +1 -1
- package/text-content/styles.css.js +1 -1
- package/text-content/styles.scoped.css +66 -66
- package/text-content/styles.selectors.js +1 -1
- package/text-filter/index.js +17 -10
- package/text-filter/interfaces.d.ts +1 -0
- package/textarea/index.js +65 -12
- package/textarea/interfaces.d.ts +3 -2
- package/time-input/index.js +15 -11
- package/toggle/index.js +6 -10
- package/toggle/interfaces.d.ts +3 -2
- package/toggle-button/index.js +14 -11
- package/token/styles.css.js +14 -14
- package/token/styles.scoped.css +29 -29
- package/token/styles.selectors.js +14 -14
- package/tutorial-panel/components/tutorial-list/styles.css.js +18 -18
- package/tutorial-panel/components/tutorial-list/styles.scoped.css +28 -28
- package/tutorial-panel/components/tutorial-list/styles.selectors.js +18 -18
- package/wizard/index.js +35 -13
- package/wizard/interfaces.d.ts +1 -1
- package/autosuggest/internal-do-not-use-core.js +0 -35
- package/badge/internal-do-not-use-core.js +0 -19
- package/box/internal-do-not-use-core.js +0 -23
- package/button/internal-do-not-use-core.js +0 -19
- package/button-dropdown/internal-do-not-use-core.js +0 -34
- package/button-group/internal-do-not-use-core.js +0 -49
- package/checkbox/internal-do-not-use-core.js +0 -16
- package/container/internal-do-not-use-core.js +0 -34
- package/date-input/internal-do-not-use-core.js +0 -16
- package/flashbar/internal-do-not-use-core.js +0 -15
- package/icon/internal-do-not-use-core.js +0 -13
- package/input/internal-do-not-use-core.js +0 -59
- package/link/internal-do-not-use-core.js +0 -32
- package/progress-bar/internal-do-not-use-core.js +0 -56
- package/prompt-input/internal-do-not-use-core.js +0 -26
- package/radio-group/internal-do-not-use-core.js +0 -27
- package/segmented-control/internal-do-not-use-core.js +0 -19
- package/space-between/internal-do-not-use-core.js +0 -15
- package/spinner/internal-do-not-use-core.js +0 -15
- package/status-indicator/internal-do-not-use-core.js +0 -15
- package/steps/internal-do-not-use-core.js +0 -18
- package/text-filter/internal-do-not-use-core.js +0 -25
- package/textarea/internal-do-not-use-core.js +0 -71
- package/time-input/internal-do-not-use-core.js +0 -22
- package/toggle/internal-do-not-use-core.js +0 -14
- package/toggle-button/internal-do-not-use-core.js +0 -21
- package/wizard/internal-do-not-use-core.js +0 -40
- /package/autosuggest/{internal-do-not-use-core.js.map → index.js.map} +0 -0
- /package/badge/{internal-do-not-use-core.js.map → index.js.map} +0 -0
- /package/box/{internal-do-not-use-core.js.map → index.js.map} +0 -0
- /package/button/{internal-do-not-use-core.js.map → index.js.map} +0 -0
- /package/button-dropdown/{internal-do-not-use-core.js.map → index.js.map} +0 -0
- /package/button-group/{internal-do-not-use-core.js.map → index.js.map} +0 -0
- /package/checkbox/{internal-do-not-use-core.js.map → index.js.map} +0 -0
- /package/container/{internal-do-not-use-core.js.map → index.js.map} +0 -0
- /package/date-input/{internal-do-not-use-core.js.map → index.js.map} +0 -0
- /package/flashbar/{internal-do-not-use-core.js.map → index.js.map} +0 -0
- /package/icon/{internal-do-not-use-core.js.map → index.js.map} +0 -0
- /package/input/{internal-do-not-use-core.js.map → index.js.map} +0 -0
- /package/link/{internal-do-not-use-core.js.map → index.js.map} +0 -0
- /package/progress-bar/{internal-do-not-use-core.js.map → index.js.map} +0 -0
- /package/prompt-input/{internal-do-not-use-core.js.map → index.js.map} +0 -0
- /package/radio-group/{internal-do-not-use-core.js.map → index.js.map} +0 -0
- /package/segmented-control/{internal-do-not-use-core.js.map → index.js.map} +0 -0
- /package/space-between/{internal-do-not-use-core.js.map → index.js.map} +0 -0
- /package/spinner/{internal-do-not-use-core.js.map → index.js.map} +0 -0
- /package/status-indicator/{internal-do-not-use-core.js.map → index.js.map} +0 -0
- /package/steps/{internal-do-not-use-core.js.map → index.js.map} +0 -0
- /package/text-filter/{internal-do-not-use-core.js.map → index.js.map} +0 -0
- /package/textarea/{internal-do-not-use-core.js.map → index.js.map} +0 -0
- /package/time-input/{internal-do-not-use-core.js.map → index.js.map} +0 -0
- /package/toggle/{internal-do-not-use-core.js.map → index.js.map} +0 -0
- /package/toggle-button/{internal-do-not-use-core.js.map → index.js.map} +0 -0
- /package/wizard/{internal-do-not-use-core.js.map → index.js.map} +0 -0
package/progress-bar/index.js
CHANGED
|
@@ -1,18 +1,56 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import
|
|
3
|
+
'use client';
|
|
4
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
import { useUniqueId, warnOnce } from '@cloudscape-design/component-toolkit/internal';
|
|
7
|
+
import { getBaseProps } from '../internal/base-component';
|
|
8
|
+
import { fireNonCancelableEvent } from '../internal/events';
|
|
9
|
+
import useBaseComponent from '../internal/hooks/use-base-component';
|
|
6
10
|
import { applyDisplayName } from '../internal/utils/apply-display-name';
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
import { joinStrings } from '../internal/utils/strings';
|
|
12
|
+
import { throttle } from '../internal/utils/throttle';
|
|
13
|
+
import InternalLiveRegion from '../live-region/internal';
|
|
14
|
+
import { Progress, ResultState, SmallText } from './internal';
|
|
15
|
+
import styles from './styles.css.js';
|
|
16
|
+
const ASSERTION_FREQUENCY = 5000; // interval in ms between progress announcements
|
|
17
|
+
export default function ProgressBar({ value = 0, status = 'in-progress', variant = 'standalone', resultButtonText, label, ariaLabel, ariaLabelledby, ariaDescribedby, description, additionalInfo, resultText, onResultButtonClick, style, ...rest }) {
|
|
18
|
+
const { __internalRootRef } = useBaseComponent('ProgressBar', {
|
|
19
|
+
props: { variant },
|
|
20
|
+
});
|
|
21
|
+
const baseProps = getBaseProps(rest);
|
|
22
|
+
const generatedName = useUniqueId('awsui-progress-bar-');
|
|
23
|
+
const labelId = `${generatedName}-label`;
|
|
24
|
+
const isInFlash = variant === 'flash';
|
|
25
|
+
const isInProgressState = status === 'in-progress';
|
|
26
|
+
const descriptionId = useUniqueId('progressbar-description-');
|
|
27
|
+
const additionalInfoId = useUniqueId('progressbar-additional-info-');
|
|
28
|
+
const [announcedValue, setAnnouncedValue] = useState('');
|
|
29
|
+
const throttledAssertion = useMemo(() => {
|
|
30
|
+
return throttle((value) => {
|
|
31
|
+
setAnnouncedValue(`${value}%`);
|
|
32
|
+
}, ASSERTION_FREQUENCY);
|
|
33
|
+
}, []);
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
throttledAssertion(value);
|
|
36
|
+
}, [throttledAssertion, value]);
|
|
37
|
+
if (isInFlash && resultButtonText) {
|
|
38
|
+
warnOnce('ProgressBar', 'The `resultButtonText` is ignored if you set `variant="flash"`, and the result button is not displayed. Use the `buttonText` property and the `onButtonClick` event listener of the flashbar item in which the progress bar component is embedded.');
|
|
39
|
+
}
|
|
40
|
+
return (React.createElement("div", { ...baseProps, className: clsx(baseProps.className, styles.root, variant && styles[variant]), ref: __internalRootRef },
|
|
41
|
+
React.createElement("div", { className: isInFlash ? styles['flash-container'] : undefined },
|
|
42
|
+
React.createElement("div", { className: clsx(styles['word-wrap'], styles[`label-${variant}`]), id: labelId }, label),
|
|
43
|
+
description && (React.createElement(SmallText, { color: isInFlash ? 'inherit' : undefined, id: descriptionId }, description)),
|
|
44
|
+
React.createElement("div", null, isInProgressState ? (React.createElement(React.Fragment, null,
|
|
45
|
+
React.createElement(Progress, { value: value, ariaLabel: ariaLabel, ariaLabelledby: joinStrings(labelId, ariaLabelledby), ariaDescribedby: joinStrings(description ? descriptionId : undefined, additionalInfo ? additionalInfoId : undefined, ariaDescribedby), isInFlash: isInFlash, style: style }),
|
|
46
|
+
React.createElement(InternalLiveRegion, { hidden: true, tagName: "span", delay: 0 },
|
|
47
|
+
label,
|
|
48
|
+
label ? ': ' : null,
|
|
49
|
+
announcedValue))) : (React.createElement(InternalLiveRegion, { hidden: false, tagName: "span", delay: 0 },
|
|
50
|
+
React.createElement(ResultState, { resultText: resultText, isInFlash: isInFlash, resultButtonText: resultButtonText, status: status, onClick: () => {
|
|
51
|
+
fireNonCancelableEvent(onResultButtonClick);
|
|
52
|
+
} }))))),
|
|
53
|
+
additionalInfo && (React.createElement(SmallText, { className: styles['additional-info'], color: isInFlash ? 'inherit' : undefined, id: additionalInfoId }, additionalInfo))));
|
|
54
|
+
}
|
|
17
55
|
applyDisplayName(ProgressBar, 'ProgressBar');
|
|
18
|
-
|
|
56
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"progress": "
|
|
5
|
-
"result-state": "awsui_result-
|
|
6
|
-
"awsui-motion-fade-in": "awsui_awsui-motion-fade-
|
|
7
|
-
"root": "
|
|
8
|
-
"with-result-button": "awsui_with-result-
|
|
9
|
-
"result-text": "awsui_result-
|
|
10
|
-
"result-container-error": "awsui_result-container-
|
|
11
|
-
"result-container-success": "awsui_result-container-
|
|
12
|
-
"result-button": "awsui_result-
|
|
13
|
-
"word-wrap": "awsui_word-
|
|
14
|
-
"label-flash": "awsui_label-
|
|
15
|
-
"label-key-value": "awsui_label-key-
|
|
16
|
-
"flash": "
|
|
17
|
-
"progress-container": "awsui_progress-
|
|
18
|
-
"percentage-container": "awsui_percentage-
|
|
19
|
-
"percentage": "
|
|
20
|
-
"complete": "
|
|
21
|
-
"progress-in-flash": "awsui_progress-in-
|
|
22
|
-
"additional-info": "awsui_additional-
|
|
4
|
+
"progress": "awsui_progress_11huc_134zk_189",
|
|
5
|
+
"result-state": "awsui_result-state_11huc_134zk_203",
|
|
6
|
+
"awsui-motion-fade-in": "awsui_awsui-motion-fade-in_11huc_134zk_1",
|
|
7
|
+
"root": "awsui_root_11huc_134zk_225",
|
|
8
|
+
"with-result-button": "awsui_with-result-button_11huc_134zk_257",
|
|
9
|
+
"result-text": "awsui_result-text_11huc_134zk_261",
|
|
10
|
+
"result-container-error": "awsui_result-container-error_11huc_134zk_265",
|
|
11
|
+
"result-container-success": "awsui_result-container-success_11huc_134zk_265",
|
|
12
|
+
"result-button": "awsui_result-button_11huc_134zk_269",
|
|
13
|
+
"word-wrap": "awsui_word-wrap_11huc_134zk_275",
|
|
14
|
+
"label-flash": "awsui_label-flash_11huc_134zk_280",
|
|
15
|
+
"label-key-value": "awsui_label-key-value_11huc_134zk_284",
|
|
16
|
+
"flash": "awsui_flash_11huc_134zk_292",
|
|
17
|
+
"progress-container": "awsui_progress-container_11huc_134zk_296",
|
|
18
|
+
"percentage-container": "awsui_percentage-container_11huc_134zk_303",
|
|
19
|
+
"percentage": "awsui_percentage_11huc_134zk_303",
|
|
20
|
+
"complete": "awsui_complete_11huc_134zk_349",
|
|
21
|
+
"progress-in-flash": "awsui_progress-in-flash_11huc_134zk_362",
|
|
22
|
+
"additional-info": "awsui_additional-info_11huc_134zk_375"
|
|
23
23
|
};
|
|
24
24
|
|
|
@@ -186,27 +186,27 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
186
186
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
187
187
|
SPDX-License-Identifier: Apache-2.0
|
|
188
188
|
*/
|
|
189
|
-
.
|
|
189
|
+
.awsui_progress_11huc_134zk_189:not(#\9)::-webkit-progress-value {
|
|
190
190
|
-webkit-transition: width var(--motion-duration-moderate-c9utmg, 135ms) linear;
|
|
191
191
|
transition: width var(--motion-duration-moderate-c9utmg, 135ms) linear;
|
|
192
192
|
}
|
|
193
193
|
@media (prefers-reduced-motion: reduce) {
|
|
194
|
-
.
|
|
194
|
+
.awsui_progress_11huc_134zk_189:not(#\9)::-webkit-progress-value {
|
|
195
195
|
animation: none;
|
|
196
196
|
-webkit-transition: none;
|
|
197
197
|
transition: none;
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
|
-
.awsui-motion-disabled .
|
|
200
|
+
.awsui-motion-disabled .awsui_progress_11huc_134zk_189:not(#\9)::-webkit-progress-value, .awsui-mode-entering .awsui_progress_11huc_134zk_189:not(#\9)::-webkit-progress-value {
|
|
201
201
|
animation: none;
|
|
202
202
|
-webkit-transition: none;
|
|
203
203
|
transition: none;
|
|
204
204
|
}
|
|
205
205
|
|
|
206
|
-
.awsui_result-
|
|
207
|
-
animation: awsui_awsui-motion-fade-
|
|
206
|
+
.awsui_result-state_11huc_134zk_203:not(#\9) {
|
|
207
|
+
animation: awsui_awsui-motion-fade-in_11huc_134zk_1 var(--motion-duration-transition-show-paced-t8d1os, 180ms) var(--motion-easing-transition-show-paced-x2k7uh, ease-out);
|
|
208
208
|
}
|
|
209
|
-
@keyframes awsui_awsui-motion-fade-
|
|
209
|
+
@keyframes awsui_awsui-motion-fade-in_11huc_134zk_1 {
|
|
210
210
|
from {
|
|
211
211
|
opacity: 0.2;
|
|
212
212
|
}
|
|
@@ -215,17 +215,17 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
217
|
@media (prefers-reduced-motion: reduce) {
|
|
218
|
-
.awsui_result-
|
|
218
|
+
.awsui_result-state_11huc_134zk_203:not(#\9) {
|
|
219
219
|
animation: none;
|
|
220
220
|
transition: none;
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
|
-
.awsui-motion-disabled .awsui_result-
|
|
223
|
+
.awsui-motion-disabled .awsui_result-state_11huc_134zk_203:not(#\9), .awsui-mode-entering .awsui_result-state_11huc_134zk_203:not(#\9) {
|
|
224
224
|
animation: none;
|
|
225
225
|
transition: none;
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
-
.
|
|
228
|
+
.awsui_root_11huc_134zk_225:not(#\9) {
|
|
229
229
|
border-collapse: separate;
|
|
230
230
|
border-spacing: 0;
|
|
231
231
|
box-sizing: border-box;
|
|
@@ -257,53 +257,53 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
257
257
|
-moz-osx-font-smoothing: auto;
|
|
258
258
|
}
|
|
259
259
|
|
|
260
|
-
.awsui_with-result-
|
|
260
|
+
.awsui_with-result-button_11huc_134zk_257:not(#\9) {
|
|
261
261
|
padding-inline-end: var(--space-m-dsumyt, 16px);
|
|
262
262
|
}
|
|
263
263
|
|
|
264
|
-
.awsui_result-
|
|
264
|
+
.awsui_result-text_11huc_134zk_261:not(#\9) {
|
|
265
265
|
/* used in test-utils */
|
|
266
266
|
}
|
|
267
267
|
|
|
268
|
-
.awsui_result-container-
|
|
268
|
+
.awsui_result-container-error_11huc_134zk_265:not(#\9), .awsui_result-container-success_11huc_134zk_265:not(#\9) {
|
|
269
269
|
/* used in test-utils */
|
|
270
270
|
}
|
|
271
271
|
|
|
272
|
-
.awsui_result-
|
|
272
|
+
.awsui_result-button_11huc_134zk_269:not(#\9) {
|
|
273
273
|
display: inline-block;
|
|
274
274
|
margin-block: var(--space-scaled-xxs-pfm1nx, 4px);
|
|
275
275
|
margin-inline: 0;
|
|
276
276
|
}
|
|
277
277
|
|
|
278
|
-
.awsui_word-
|
|
278
|
+
.awsui_word-wrap_11huc_134zk_275:not(#\9) {
|
|
279
279
|
min-inline-size: 0;
|
|
280
280
|
word-break: break-word;
|
|
281
281
|
}
|
|
282
282
|
|
|
283
|
-
.awsui_label-
|
|
283
|
+
.awsui_label-flash_11huc_134zk_280:not(#\9) {
|
|
284
284
|
color: inherit;
|
|
285
285
|
font-weight: 700;
|
|
286
286
|
}
|
|
287
|
-
.awsui_label-key-
|
|
287
|
+
.awsui_label-key-value_11huc_134zk_284:not(#\9) {
|
|
288
288
|
font-size: var(--font-size-body-m-a7nh2n, 14px);
|
|
289
289
|
line-height: var(--line-height-body-m-2mh3ke, 20px);
|
|
290
290
|
font-weight: var(--font-display-label-weight-zavpeo, 700);
|
|
291
|
-
color: var(--color-text-label-
|
|
291
|
+
color: var(--color-text-label-28gfmc, #0f141a);
|
|
292
292
|
margin-block-end: var(--space-scaled-xxxs-oo06c7, 2px);
|
|
293
293
|
}
|
|
294
294
|
|
|
295
|
-
.
|
|
295
|
+
.awsui_flash_11huc_134zk_292:not(#\9) {
|
|
296
296
|
color: inherit;
|
|
297
297
|
}
|
|
298
298
|
|
|
299
|
-
.awsui_progress-
|
|
299
|
+
.awsui_progress-container_11huc_134zk_296:not(#\9) {
|
|
300
300
|
display: flex;
|
|
301
301
|
align-items: center;
|
|
302
302
|
max-inline-size: 800px;
|
|
303
303
|
block-size: var(--line-height-body-m-2mh3ke, 20px);
|
|
304
304
|
}
|
|
305
305
|
|
|
306
|
-
.awsui_percentage-
|
|
306
|
+
.awsui_percentage-container_11huc_134zk_303:not(#\9) {
|
|
307
307
|
inline-size: 33px;
|
|
308
308
|
flex-shrink: 0;
|
|
309
309
|
white-space: nowrap;
|
|
@@ -313,11 +313,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
313
313
|
letter-spacing: var(--letter-spacing-body-s-gq78ok, 0.005em);
|
|
314
314
|
}
|
|
315
315
|
|
|
316
|
-
.
|
|
316
|
+
.awsui_percentage_11huc_134zk_303:not(#\9) {
|
|
317
317
|
/* used in test-utils */
|
|
318
318
|
}
|
|
319
319
|
|
|
320
|
-
.
|
|
320
|
+
.awsui_progress_11huc_134zk_189:not(#\9) {
|
|
321
321
|
inline-size: 100%;
|
|
322
322
|
margin-inline-end: var(--space-s-tvghoh, 12px);
|
|
323
323
|
min-inline-size: 0;
|
|
@@ -331,7 +331,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
331
331
|
border-end-end-radius: var(--awsui-progress-bar-border-radius-d43v8n, 10px);
|
|
332
332
|
background-color: var(--awsui-progress-bar-background-color-d43v8n, var(--color-background-progress-bar-layout-default-z3ipl1, #ebebf0));
|
|
333
333
|
}
|
|
334
|
-
.
|
|
334
|
+
.awsui_progress_11huc_134zk_189:not(#\9)::-webkit-progress-bar {
|
|
335
335
|
block-size: var(--awsui-progress-bar-height-d43v8n, 4px);
|
|
336
336
|
border-block: 0;
|
|
337
337
|
border-inline: none;
|
|
@@ -342,39 +342,39 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
342
342
|
border-end-end-radius: var(--awsui-progress-bar-border-radius-d43v8n, 10px);
|
|
343
343
|
background-color: var(--awsui-progress-bar-background-color-d43v8n, var(--color-background-progress-bar-layout-default-z3ipl1, #ebebf0));
|
|
344
344
|
}
|
|
345
|
-
.
|
|
345
|
+
.awsui_progress_11huc_134zk_189:not(#\9)::-webkit-progress-value {
|
|
346
346
|
border-start-start-radius: var(--awsui-progress-bar-border-radius-d43v8n, 10px);
|
|
347
347
|
border-start-end-radius: 0;
|
|
348
348
|
border-end-start-radius: var(--awsui-progress-bar-border-radius-d43v8n, 10px);
|
|
349
349
|
border-end-end-radius: 0;
|
|
350
350
|
background-color: var(--awsui-progress-value-background-color-d43v8n, var(--color-background-progress-bar-content-default-il6sg6, #006ce0));
|
|
351
351
|
}
|
|
352
|
-
.
|
|
352
|
+
.awsui_progress_11huc_134zk_189.awsui_complete_11huc_134zk_349:not(#\9)::-webkit-progress-value {
|
|
353
353
|
border-start-start-radius: var(--awsui-progress-bar-border-radius-d43v8n, 10px);
|
|
354
354
|
border-start-end-radius: var(--awsui-progress-bar-border-radius-d43v8n, 10px);
|
|
355
355
|
border-end-start-radius: var(--awsui-progress-bar-border-radius-d43v8n, 10px);
|
|
356
356
|
border-end-end-radius: var(--awsui-progress-bar-border-radius-d43v8n, 10px);
|
|
357
357
|
}
|
|
358
|
-
.
|
|
358
|
+
.awsui_progress_11huc_134zk_189:not(#\9)::-moz-progress-bar {
|
|
359
359
|
border-start-start-radius: var(--awsui-progress-bar-border-radius-d43v8n, 10px);
|
|
360
360
|
border-start-end-radius: 0;
|
|
361
361
|
border-end-start-radius: var(--awsui-progress-bar-border-radius-d43v8n, 10px);
|
|
362
362
|
border-end-end-radius: 0;
|
|
363
363
|
background-color: var(--awsui-progress-value-background-color-d43v8n, var(--color-background-progress-bar-content-default-il6sg6, #006ce0));
|
|
364
364
|
}
|
|
365
|
-
.
|
|
365
|
+
.awsui_progress_11huc_134zk_189.awsui_progress-in-flash_11huc_134zk_362:not(#\9) {
|
|
366
366
|
background-color: var(--awsui-progress-bar-background-color-d43v8n, var(--color-background-progress-bar-layout-in-flash-wssh6k, rgba(255, 255, 255, 0.25)));
|
|
367
367
|
}
|
|
368
|
-
.
|
|
368
|
+
.awsui_progress_11huc_134zk_189.awsui_progress-in-flash_11huc_134zk_362:not(#\9)::-moz-progress-bar {
|
|
369
369
|
background-color: var(--awsui-progress-value-background-color-d43v8n, var(--color-background-progress-bar-content-in-flash-98s7uz, #ffffff));
|
|
370
370
|
}
|
|
371
|
-
.
|
|
371
|
+
.awsui_progress_11huc_134zk_189.awsui_progress-in-flash_11huc_134zk_362:not(#\9)::-webkit-progress-bar {
|
|
372
372
|
background-color: var(--awsui-progress-bar-background-color-d43v8n, var(--color-background-progress-bar-layout-in-flash-wssh6k, rgba(255, 255, 255, 0.25)));
|
|
373
373
|
}
|
|
374
|
-
.
|
|
374
|
+
.awsui_progress_11huc_134zk_189.awsui_progress-in-flash_11huc_134zk_362:not(#\9)::-webkit-progress-value {
|
|
375
375
|
background-color: var(--awsui-progress-value-background-color-d43v8n, var(--color-background-progress-bar-content-in-flash-98s7uz, #ffffff));
|
|
376
376
|
}
|
|
377
377
|
|
|
378
|
-
.awsui_additional-
|
|
378
|
+
.awsui_additional-info_11huc_134zk_375:not(#\9) {
|
|
379
379
|
/* used in test-utils */
|
|
380
380
|
}
|
|
@@ -2,24 +2,24 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"progress": "
|
|
6
|
-
"result-state": "awsui_result-
|
|
7
|
-
"awsui-motion-fade-in": "awsui_awsui-motion-fade-
|
|
8
|
-
"root": "
|
|
9
|
-
"with-result-button": "awsui_with-result-
|
|
10
|
-
"result-text": "awsui_result-
|
|
11
|
-
"result-container-error": "awsui_result-container-
|
|
12
|
-
"result-container-success": "awsui_result-container-
|
|
13
|
-
"result-button": "awsui_result-
|
|
14
|
-
"word-wrap": "awsui_word-
|
|
15
|
-
"label-flash": "awsui_label-
|
|
16
|
-
"label-key-value": "awsui_label-key-
|
|
17
|
-
"flash": "
|
|
18
|
-
"progress-container": "awsui_progress-
|
|
19
|
-
"percentage-container": "awsui_percentage-
|
|
20
|
-
"percentage": "
|
|
21
|
-
"complete": "
|
|
22
|
-
"progress-in-flash": "awsui_progress-in-
|
|
23
|
-
"additional-info": "awsui_additional-
|
|
5
|
+
"progress": "awsui_progress_11huc_134zk_189",
|
|
6
|
+
"result-state": "awsui_result-state_11huc_134zk_203",
|
|
7
|
+
"awsui-motion-fade-in": "awsui_awsui-motion-fade-in_11huc_134zk_1",
|
|
8
|
+
"root": "awsui_root_11huc_134zk_225",
|
|
9
|
+
"with-result-button": "awsui_with-result-button_11huc_134zk_257",
|
|
10
|
+
"result-text": "awsui_result-text_11huc_134zk_261",
|
|
11
|
+
"result-container-error": "awsui_result-container-error_11huc_134zk_265",
|
|
12
|
+
"result-container-success": "awsui_result-container-success_11huc_134zk_265",
|
|
13
|
+
"result-button": "awsui_result-button_11huc_134zk_269",
|
|
14
|
+
"word-wrap": "awsui_word-wrap_11huc_134zk_275",
|
|
15
|
+
"label-flash": "awsui_label-flash_11huc_134zk_280",
|
|
16
|
+
"label-key-value": "awsui_label-key-value_11huc_134zk_284",
|
|
17
|
+
"flash": "awsui_flash_11huc_134zk_292",
|
|
18
|
+
"progress-container": "awsui_progress-container_11huc_134zk_296",
|
|
19
|
+
"percentage-container": "awsui_percentage-container_11huc_134zk_303",
|
|
20
|
+
"percentage": "awsui_percentage_11huc_134zk_303",
|
|
21
|
+
"complete": "awsui_complete_11huc_134zk_349",
|
|
22
|
+
"progress-in-flash": "awsui_progress-in-flash_11huc_134zk_362",
|
|
23
|
+
"additional-info": "awsui_additional-info_11huc_134zk_375"
|
|
24
24
|
};
|
|
25
25
|
|
package/prompt-input/index.js
CHANGED
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
'use client';
|
|
3
4
|
import React from 'react';
|
|
4
|
-
|
|
5
|
-
import CoreComponent from './internal-do-not-use-core';
|
|
5
|
+
import useBaseComponent from '../internal/hooks/use-base-component';
|
|
6
6
|
import { applyDisplayName } from '../internal/utils/apply-display-name';
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
import InternalPromptInput from './internal';
|
|
8
|
+
const PromptInput = React.forwardRef(({ autoComplete, autoFocus, disableBrowserAutocorrect, disableActionButton, spellcheck, readOnly, actionButtonIconName, minRows = 1, maxRows = 3, ...props }, ref) => {
|
|
9
|
+
const baseComponentProps = useBaseComponent('PromptInput', {
|
|
10
|
+
props: {
|
|
11
|
+
readOnly,
|
|
12
|
+
autoComplete,
|
|
13
|
+
autoFocus,
|
|
14
|
+
disableBrowserAutocorrect,
|
|
15
|
+
disableActionButton,
|
|
16
|
+
spellcheck,
|
|
17
|
+
actionButtonIconName,
|
|
18
|
+
minRows,
|
|
19
|
+
maxRows,
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
return (React.createElement(InternalPromptInput, { readOnly: readOnly, autoComplete: autoComplete, autoFocus: autoFocus, disableBrowserAutocorrect: disableBrowserAutocorrect, disableActionButton: disableActionButton, spellcheck: spellcheck, actionButtonIconName: actionButtonIconName, minRows: minRows, maxRows: maxRows, ...props, ...baseComponentProps, ref: ref }));
|
|
14
23
|
});
|
|
15
|
-
|
|
16
|
-
|
|
17
24
|
applyDisplayName(PromptInput, 'PromptInput');
|
|
18
25
|
export default PromptInput;
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -6,7 +6,7 @@ import { BaseKeyDetail, NonCancelableEventHandler } from '../internal/events';
|
|
|
6
6
|
/**
|
|
7
7
|
* @awsuiSystem core
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
import { NativeAttributes } from '../internal/utils/with-native-attributes';
|
|
10
10
|
export interface PromptInputProps extends Omit<BaseInputProps, 'nativeInputAttributes'>, InputKeyEvents, InputAutoCorrect, InputAutoComplete, InputSpellcheck, BaseComponentProps, FormFieldValidationControlProps {
|
|
11
11
|
/**
|
|
12
12
|
* Called whenever a user clicks the action button or presses the "Enter" key.
|
|
@@ -75,7 +75,7 @@ export interface PromptInputProps extends Omit<BaseInputProps, 'nativeInputAttri
|
|
|
75
75
|
*
|
|
76
76
|
* @awsuiSystem core
|
|
77
77
|
*/
|
|
78
|
-
|
|
78
|
+
customPrimaryAction?: React.ReactNode;
|
|
79
79
|
/**
|
|
80
80
|
* Use this slot to add secondary actions to the prompt input.
|
|
81
81
|
*/
|
|
@@ -102,10 +102,11 @@ export interface PromptInputProps extends Omit<BaseInputProps, 'nativeInputAttri
|
|
|
102
102
|
*
|
|
103
103
|
* @awsuiSystem core
|
|
104
104
|
*/
|
|
105
|
-
|
|
105
|
+
nativeTextareaAttributes?: NativeAttributes<React.TextareaHTMLAttributes<HTMLTextAreaElement>>;
|
|
106
106
|
/**
|
|
107
107
|
* @awsuiSystem core
|
|
108
108
|
*/
|
|
109
|
+
style?: PromptInputProps.Style;
|
|
109
110
|
}
|
|
110
111
|
export declare namespace PromptInputProps {
|
|
111
112
|
type KeyDetail = BaseKeyDetail;
|
package/radio-button/index.js
CHANGED
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
'use client';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
import InternalRadioButton from '../internal/components/radio-button';
|
|
7
|
+
import useBaseComponent from '../internal/hooks/use-base-component';
|
|
8
|
+
import { applyDisplayName } from '../internal/utils/apply-display-name';
|
|
9
|
+
import styles from './styles.css.js';
|
|
10
|
+
const RadioButton = React.forwardRef((props, ref) => {
|
|
11
|
+
const baseComponentProps = useBaseComponent('RadioButton', {
|
|
12
|
+
props: { readOnly: Boolean(props.readOnly), disabled: Boolean(props.disabled) },
|
|
13
|
+
});
|
|
14
|
+
return (React.createElement(InternalRadioButton, { ...props, ...baseComponentProps, className: clsx(props.className, styles['radio-button']), ref: ref }));
|
|
15
|
+
});
|
|
16
|
+
applyDisplayName(RadioButton, 'RadioButton');
|
|
17
|
+
/**
|
|
18
|
+
* @awsuiSystem core
|
|
19
|
+
*/
|
|
20
|
+
export default RadioButton;
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
package/radio-group/index.js
CHANGED
|
@@ -1,18 +1,27 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
'use client';
|
|
3
4
|
import React from 'react';
|
|
4
|
-
|
|
5
|
-
import
|
|
5
|
+
import { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';
|
|
6
|
+
import useBaseComponent from '../internal/hooks/use-base-component';
|
|
6
7
|
import { applyDisplayName } from '../internal/utils/apply-display-name';
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return React.createElement(
|
|
8
|
+
import InternalRadioGroup from './internal';
|
|
9
|
+
import analyticsSelectors from './analytics-metadata/styles.css.js';
|
|
10
|
+
const RadioGroup = React.forwardRef(({ direction = 'vertical', ...rest }, ref) => {
|
|
11
|
+
const baseComponentProps = useBaseComponent('RadioGroup', {
|
|
12
|
+
props: { readOnly: rest.readOnly, direction: direction !== null && direction !== void 0 ? direction : 'vertical' },
|
|
13
|
+
});
|
|
14
|
+
return (React.createElement(InternalRadioGroup, { ref: ref, direction: direction, ...rest, ...baseComponentProps, ...getAnalyticsMetadataAttribute({
|
|
15
|
+
component: {
|
|
16
|
+
name: 'awsui.RadioGroup',
|
|
17
|
+
label: { root: 'self' },
|
|
18
|
+
properties: {
|
|
19
|
+
value: `${rest.value}`,
|
|
20
|
+
valueLabel: `.${analyticsSelectors.selected}`,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
}) }));
|
|
14
24
|
});
|
|
15
|
-
|
|
16
|
-
|
|
17
25
|
applyDisplayName(RadioGroup, 'RadioGroup');
|
|
18
26
|
export default RadioGroup;
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
'use client';
|
|
3
4
|
import React from 'react';
|
|
4
|
-
|
|
5
|
-
import CoreComponent from './internal-do-not-use-core';
|
|
5
|
+
import useBaseComponent from '../internal/hooks/use-base-component';
|
|
6
6
|
import { applyDisplayName } from '../internal/utils/apply-display-name';
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
import InternalSegmentedControl from './internal';
|
|
8
|
+
export default function SegmentedControl(props) {
|
|
9
|
+
var _a;
|
|
10
|
+
const baseComponentProps = useBaseComponent('SegmentedControl', {
|
|
11
|
+
props: {},
|
|
12
|
+
metadata: {
|
|
13
|
+
hasDisabledReasons: ((_a = props.options) !== null && _a !== void 0 ? _a : []).some(option => Boolean(option.disabledReason)),
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
return React.createElement(InternalSegmentedControl, { ...props, ...baseComponentProps });
|
|
17
|
+
}
|
|
17
18
|
applyDisplayName(SegmentedControl, 'SegmentedControl');
|
|
18
|
-
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
package/select/interfaces.d.ts
CHANGED
|
@@ -112,7 +112,7 @@ export interface BaseSelectProps extends BaseDropdownHostProps, BaseComponentPro
|
|
|
112
112
|
* Overrides the element that is announced to screen readers
|
|
113
113
|
* when the highlighted option changes. By default, this announces
|
|
114
114
|
* the option's name and properties, and its selected state if
|
|
115
|
-
* the `
|
|
115
|
+
* the `selectedAriaLabel` property is defined.
|
|
116
116
|
* The highlighted option is provided, and its group (if groups
|
|
117
117
|
* are used and it differs from the group of the previously highlighted option).
|
|
118
118
|
*
|
package/select/interfaces.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/select/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 '../internal/base-component';\nimport {\n BaseDropdownHostProps,\n OptionsFilteringType,\n OptionsLoadItemsDetail,\n} from '../internal/components/dropdown/interfaces';\nimport { DropdownStatusProps } from '../internal/components/dropdown-status/interfaces';\nimport { OptionDefinition, OptionGroup as OptionGroupDefinition } from '../internal/components/option/interfaces';\nimport { FormFieldValidationControlProps } from '../internal/context/form-field-context';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface BaseSelectProps\n extends BaseDropdownHostProps,\n BaseComponentProps,\n FormFieldValidationControlProps,\n DropdownStatusProps {\n /**\n * Specifies an array of options that are displayed to the user as a dropdown list.\n * The options can be grouped using `OptionGroup` objects.\n *\n * #### Option\n * - `value` (string) - The returned value of the option when selected.\n *\n * #### OptionGroup\n * - `value` (string) - Used to locate option group in test utils.\n * - `options` (Option[]) - (Optional) The options under this group.\n *\n * #### Shared Option and OptionGroup properties\n * - `label` (string) - (Optional) Option or group text displayed to the user.\n * - `lang` (string) - (Optional) The language of the option or group, provided as a BCP 47 language tag.\n * - `description` (string) - (Optional) Further information about the option or group that appears below the label.\n * - `disabled` (boolean) - (Optional) Determines whether the option or group is disabled.\n * - `disabledReason` (string) - (Optional) Displays tooltip near the item when disabled. Use to provide additional context.\n * - `labelTag` (string) - (Optional) A label tag that provides additional guidance, shown next to the label.\n * - `tags` [string[]] - (Optional) A list of tags giving further guidance about the option or group.\n * - `filteringTags` [string[]] - (Optional) A list of additional tags used for automatic filtering.\n * - `iconName` (string) - (Optional) Specifies the name of an [icon](/components/icon/) to display in the option or group.\n * - `iconAriaLabel` (string) - (Optional) Specifies alternate text for the icon. We recommend that you provide this for accessibility.\n * - `iconAlt` (string) - (Optional) **Deprecated**, replaced by \\`iconAriaLabel\\`. Specifies alternate text for a custom icon, for use with `iconUrl`.\n * - `iconUrl` (string) - (Optional) URL of a custom icon.\n * - `iconSvg` (ReactNode) - (Optional) Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n *\n * Note: Only one level of option nesting is supported.\n *\n * If you want to use the built-in filtering capabilities of this component, provide\n * a list of all valid options here and they will be automatically filtered based on the user's filtering input.\n *\n * Alternatively, you can listen to the `onChange` or `onLoadItems` event and set new options\n * on your own.\n **/\n options?: SelectProps.Options;\n /**\n * Determines how filtering is applied to the list of `options`:\n *\n * * `auto` - The component will automatically filter options based on user input.\n * * `manual` - You will set up `onChange` or `onLoadItems` event listeners and filter options on your side or request\n * them from server.\n *\n * By default the component will filter the provided `options` based on the value of the filtering input field.\n * Only options that have a `value`, `label`, `description` or `labelTag` that contains the input value as a substring\n * are displayed in the list of options.\n *\n * If you set this property to `manual`, this default filtering mechanism is disabled and all provided `options` are\n * displayed in the dropdown list. In that case make sure that you use the `onChange` or `onLoadItems` events in order\n * to set the `options` property to the options that are relevant for the user, given the filtering input value.\n *\n * Note: Manual filtering doesn't disable match highlighting.\n **/\n filteringType?: OptionsFilteringType;\n\n /**\n * Determines whether the whole select component is disabled.\n */\n disabled?: boolean;\n /**\n * Specifies the placeholder to display in the filtering input if filtering is enabled.\n */\n filteringPlaceholder?: string;\n\n /**\n * Specifies the text to display with the number of matches at the bottom of the dropdown menu while filtering.\n */\n filteringResultsText?: (matchesCount: number, totalCount: number) => string;\n /**\n * Adds an `aria-label` on the built-in filtering input if filtering is enabled.\n */\n filteringAriaLabel?: string;\n /**\n * Adds an `aria-label` to the clear button inside the search input.\n * @i18n\n */\n filteringClearAriaLabel?: string;\n /**\n * @deprecated Has no effect.\n */\n name?: string;\n /**\n * Specifies the hint text that's displayed in the field when no option has been selected.\n */\n placeholder?: string;\n /**\n * Specifies the ID for the trigger component. It uses an automatically generated ID by default.\n */\n controlId?: string;\n /**\n * Adds `aria-required` to the native input element.\n */\n ariaRequired?: boolean;\n /**\n * Adds `aria-label` to the select element.\n * Use this if you don't have a visible label for this control.\n */\n ariaLabel?: string;\n /**\n * Specifies the localized string that describes an option as being selected.\n * This is required to provide a good screen reader experience. For more information, see the\n * [accessibility guidelines](/components/select/?tabId=usage#accessibility-guidelines).\n * @i18n\n */\n selectedAriaLabel?: string;\n /**\n * Overrides the element that is announced to screen readers\n * when the highlighted option changes. By default, this announces\n * the option's name and properties, and its selected state if\n * the `
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/select/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 '../internal/base-component';\nimport {\n BaseDropdownHostProps,\n OptionsFilteringType,\n OptionsLoadItemsDetail,\n} from '../internal/components/dropdown/interfaces';\nimport { DropdownStatusProps } from '../internal/components/dropdown-status/interfaces';\nimport { OptionDefinition, OptionGroup as OptionGroupDefinition } from '../internal/components/option/interfaces';\nimport { FormFieldValidationControlProps } from '../internal/context/form-field-context';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface BaseSelectProps\n extends BaseDropdownHostProps,\n BaseComponentProps,\n FormFieldValidationControlProps,\n DropdownStatusProps {\n /**\n * Specifies an array of options that are displayed to the user as a dropdown list.\n * The options can be grouped using `OptionGroup` objects.\n *\n * #### Option\n * - `value` (string) - The returned value of the option when selected.\n *\n * #### OptionGroup\n * - `value` (string) - Used to locate option group in test utils.\n * - `options` (Option[]) - (Optional) The options under this group.\n *\n * #### Shared Option and OptionGroup properties\n * - `label` (string) - (Optional) Option or group text displayed to the user.\n * - `lang` (string) - (Optional) The language of the option or group, provided as a BCP 47 language tag.\n * - `description` (string) - (Optional) Further information about the option or group that appears below the label.\n * - `disabled` (boolean) - (Optional) Determines whether the option or group is disabled.\n * - `disabledReason` (string) - (Optional) Displays tooltip near the item when disabled. Use to provide additional context.\n * - `labelTag` (string) - (Optional) A label tag that provides additional guidance, shown next to the label.\n * - `tags` [string[]] - (Optional) A list of tags giving further guidance about the option or group.\n * - `filteringTags` [string[]] - (Optional) A list of additional tags used for automatic filtering.\n * - `iconName` (string) - (Optional) Specifies the name of an [icon](/components/icon/) to display in the option or group.\n * - `iconAriaLabel` (string) - (Optional) Specifies alternate text for the icon. We recommend that you provide this for accessibility.\n * - `iconAlt` (string) - (Optional) **Deprecated**, replaced by \\`iconAriaLabel\\`. Specifies alternate text for a custom icon, for use with `iconUrl`.\n * - `iconUrl` (string) - (Optional) URL of a custom icon.\n * - `iconSvg` (ReactNode) - (Optional) Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n *\n * Note: Only one level of option nesting is supported.\n *\n * If you want to use the built-in filtering capabilities of this component, provide\n * a list of all valid options here and they will be automatically filtered based on the user's filtering input.\n *\n * Alternatively, you can listen to the `onChange` or `onLoadItems` event and set new options\n * on your own.\n **/\n options?: SelectProps.Options;\n /**\n * Determines how filtering is applied to the list of `options`:\n *\n * * `auto` - The component will automatically filter options based on user input.\n * * `manual` - You will set up `onChange` or `onLoadItems` event listeners and filter options on your side or request\n * them from server.\n *\n * By default the component will filter the provided `options` based on the value of the filtering input field.\n * Only options that have a `value`, `label`, `description` or `labelTag` that contains the input value as a substring\n * are displayed in the list of options.\n *\n * If you set this property to `manual`, this default filtering mechanism is disabled and all provided `options` are\n * displayed in the dropdown list. In that case make sure that you use the `onChange` or `onLoadItems` events in order\n * to set the `options` property to the options that are relevant for the user, given the filtering input value.\n *\n * Note: Manual filtering doesn't disable match highlighting.\n **/\n filteringType?: OptionsFilteringType;\n\n /**\n * Determines whether the whole select component is disabled.\n */\n disabled?: boolean;\n /**\n * Specifies the placeholder to display in the filtering input if filtering is enabled.\n */\n filteringPlaceholder?: string;\n\n /**\n * Specifies the text to display with the number of matches at the bottom of the dropdown menu while filtering.\n */\n filteringResultsText?: (matchesCount: number, totalCount: number) => string;\n /**\n * Adds an `aria-label` on the built-in filtering input if filtering is enabled.\n */\n filteringAriaLabel?: string;\n /**\n * Adds an `aria-label` to the clear button inside the search input.\n * @i18n\n */\n filteringClearAriaLabel?: string;\n /**\n * @deprecated Has no effect.\n */\n name?: string;\n /**\n * Specifies the hint text that's displayed in the field when no option has been selected.\n */\n placeholder?: string;\n /**\n * Specifies the ID for the trigger component. It uses an automatically generated ID by default.\n */\n controlId?: string;\n /**\n * Adds `aria-required` to the native input element.\n */\n ariaRequired?: boolean;\n /**\n * Adds `aria-label` to the select element.\n * Use this if you don't have a visible label for this control.\n */\n ariaLabel?: string;\n /**\n * Specifies the localized string that describes an option as being selected.\n * This is required to provide a good screen reader experience. For more information, see the\n * [accessibility guidelines](/components/select/?tabId=usage#accessibility-guidelines).\n * @i18n\n */\n selectedAriaLabel?: string;\n /**\n * Overrides the element that is announced to screen readers\n * when the highlighted option changes. By default, this announces\n * the option's name and properties, and its selected state if\n * the `selectedAriaLabel` property is defined.\n * The highlighted option is provided, and its group (if groups\n * are used and it differs from the group of the previously highlighted option).\n *\n * For more information, see the\n * [accessibility guidelines](/components/select/?tabId=usage#accessibility-guidelines).\n */\n renderHighlightedAriaLive?: SelectProps.ContainingOptionAndGroupString;\n /**\n * Displayed for `filteringType=\"auto\"` when there are no matches for the filtering.\n */\n noMatch?: React.ReactNode;\n /**\n * Called when input focus is removed from the UI control.\n */\n onBlur?: NonCancelableEventHandler;\n /**\n * Called when input focus is set onto the UI control.\n */\n onFocus?: NonCancelableEventHandler;\n\n /**\n * Specifies if the control is read-only, which prevents the\n * user from both modifying the value and opening the dropdown. A read-only control is still focusable.\n */\n readOnly?: boolean;\n}\n\nexport interface SelectProps extends BaseSelectProps {\n /**\n * Adds a small label inline with the input for saving vertical space in the UI.\n * For use with collection select filters only.\n */\n inlineLabelText?: string;\n /**\n * Adds `aria-labelledby` to the component. If you're using this component within a form field,\n * don't set this property because the form field component automatically sets it.\n *\n * Use this property if the component isn't using `inlineLabelText` and isn't surrounded by a form field, or you want to override the value\n * automatically set by the form field (for example, if you have two components within a single form field).\n *\n * To use it correctly, define an ID for the element you want to use as label and set the property to that ID.\n */\n ariaLabelledby?: string;\n /**\n * Defines the variant of the trigger. You can use a simple label or the entire option (`label | option`)\n */\n triggerVariant?: SelectProps.TriggerVariant;\n /**\n * Specifies the currently selected option.\n * If you want to clear the selection, use `null`.\n */\n selectedOption: SelectProps.Option | null;\n /**\n * Called when the user selects an option.\n * The event `detail` contains the current `selectedOption`.\n */\n onChange?: NonCancelableEventHandler<SelectProps.ChangeDetail>;\n\n /**\n * Automatically focuses the trigger when component is mounted.\n */\n autoFocus?: boolean;\n}\n\nexport namespace SelectProps {\n export type FilteringType = OptionsFilteringType;\n export type TriggerVariant = 'label' | 'option';\n\n export type Option = OptionDefinition;\n export type OptionGroup = OptionGroupDefinition;\n export type Options = ReadonlyArray<Option | OptionGroup>;\n\n export type LoadItemsDetail = OptionsLoadItemsDetail;\n\n export interface ChangeDetail {\n selectedOption: Option;\n }\n\n export interface ContainingOptionAndGroupString {\n (option: Option, group?: OptionGroup): string;\n }\n\n export interface Ref {\n /**\n * Sets focus on the element without opening the dropdown or showing a visual focus indicator.\n */\n focus(): void;\n }\n}\n"]}
|