@cloudscape-design/components 3.0.289 → 3.0.291
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/bar-chart/index.d.ts.map +1 -1
- package/bar-chart/index.js +1 -1
- package/bar-chart/index.js.map +1 -1
- package/bar-chart/interfaces.d.ts +6 -1
- package/bar-chart/interfaces.d.ts.map +1 -1
- package/bar-chart/interfaces.js.map +1 -1
- package/button/index.d.ts.map +1 -1
- package/button/index.js +2 -2
- package/button/index.js.map +1 -1
- package/button/interfaces.d.ts +5 -1
- package/button/interfaces.d.ts.map +1 -1
- package/button/interfaces.js.map +1 -1
- package/button/internal.d.ts.map +1 -1
- package/button/internal.js +2 -1
- package/button/internal.js.map +1 -1
- package/button/styles.css.js +19 -18
- package/button/styles.scoped.css +140 -136
- package/button/styles.selectors.js +19 -18
- package/collection-preferences/interfaces.d.ts +6 -2
- package/collection-preferences/interfaces.d.ts.map +1 -1
- package/collection-preferences/interfaces.js.map +1 -1
- package/flashbar/flash.d.ts.map +1 -1
- package/flashbar/flash.js +1 -1
- package/flashbar/flash.js.map +1 -1
- package/internal/environment.js +1 -1
- package/internal/manifest.json +1 -1
- package/mixed-line-bar-chart/interfaces.d.ts +5 -0
- package/mixed-line-bar-chart/interfaces.d.ts.map +1 -1
- package/mixed-line-bar-chart/interfaces.js.map +1 -1
- package/package.json +1 -1
- package/wizard/index.d.ts +2 -1
- package/wizard/index.d.ts.map +1 -1
- package/wizard/index.js +11 -77
- package/wizard/index.js.map +1 -1
- package/wizard/internal.d.ts +7 -0
- package/wizard/internal.d.ts.map +1 -0
- package/wizard/internal.js +82 -0
- package/wizard/internal.js.map +1 -0
- package/wizard/wizard-form.d.ts.map +1 -1
- package/wizard/wizard-form.js +3 -1
- package/wizard/wizard-form.js.map +1 -1
- package/wizard/internal/analytics.d.ts +0 -8
- package/wizard/internal/analytics.d.ts.map +0 -1
- package/wizard/internal/analytics.js +0 -68
- package/wizard/internal/analytics.js.map +0 -1
package/bar-chart/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["bar-chart/index.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAO7C,OAAO,EAAE,aAAa,EAAE,CAAC;AAEzB,iBAAS,QAAQ,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,IAAI,EAAE,EAClD,MAAW,EACX,MAAY,EACZ,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["bar-chart/index.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAO7C,OAAO,EAAE,aAAa,EAAE,CAAC;AAEzB,iBAAS,QAAQ,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,IAAI,EAAE,EAClD,MAAW,EACX,MAAY,EACZ,UAA0B,EAC1B,UAAqB,EACrB,WAAmB,EACnB,cAAsB,EACtB,iBAA4B,EAC5B,UAAuB,EACvB,qBAA4B,EAC5B,GAAG,KAAK,EACT,EAAE,aAAa,CAAC,CAAC,CAAC,eAqBlB;AAID,eAAe,QAAQ,CAAC"}
|
package/bar-chart/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import styles from './styles.css.js';
|
|
|
9
9
|
import InternalMixedLineBarChart from '../mixed-line-bar-chart/internal';
|
|
10
10
|
import useBaseComponent from '../internal/hooks/use-base-component';
|
|
11
11
|
function BarChart(_a) {
|
|
12
|
-
var { series = [], height = 500, xScaleType = '
|
|
12
|
+
var { series = [], height = 500, xScaleType = 'categorical', yScaleType = 'linear', stackedBars = false, horizontalBars = false, detailPopoverSize = 'medium', statusType = 'finished', emphasizeBaselineAxis = true } = _a, props = __rest(_a, ["series", "height", "xScaleType", "yScaleType", "stackedBars", "horizontalBars", "detailPopoverSize", "statusType", "emphasizeBaselineAxis"]);
|
|
13
13
|
const baseComponentProps = useBaseComponent('BarChart');
|
|
14
14
|
const baseProps = getBaseProps(props);
|
|
15
15
|
const className = clsx(baseProps.className, styles.root);
|
package/bar-chart/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["bar-chart/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,yBAAyB,MAAM,kCAAkC,CAAC;AACzE,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AAIpE,SAAS,QAAQ,CAAmC,EAWjC;QAXiC,EAClD,MAAM,GAAG,EAAE,EACX,MAAM,GAAG,GAAG,EACZ,UAAU,GAAG,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["bar-chart/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,yBAAyB,MAAM,kCAAkC,CAAC;AACzE,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AAIpE,SAAS,QAAQ,CAAmC,EAWjC;QAXiC,EAClD,MAAM,GAAG,EAAE,EACX,MAAM,GAAG,GAAG,EACZ,UAAU,GAAG,aAAa,EAC1B,UAAU,GAAG,QAAQ,EACrB,WAAW,GAAG,KAAK,EACnB,cAAc,GAAG,KAAK,EACtB,iBAAiB,GAAG,QAAQ,EAC5B,UAAU,GAAG,UAAU,EACvB,qBAAqB,GAAG,IAAI,OAEX,EADd,KAAK,cAV0C,6IAWnD,CADS;IAER,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAAC;IACxD,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IACtC,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAEzD,OAAO,CACL,oBAAC,yBAAyB,oBACpB,KAAK,EACL,kBAAkB,IACtB,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,cAAc,EAAE,cAAc,EAC9B,MAAM,EAAE,MAAM,EACd,iBAAiB,EAAE,iBAAiB,EACpC,UAAU,EAAE,UAAU,EACtB,qBAAqB,EAAE,qBAAqB,IAC5C,CACH,CAAC;AACJ,CAAC;AAED,gBAAgB,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;AAEvC,eAAe,QAAQ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { BarChartProps } from './interfaces';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { getBaseProps } from '../internal/base-component';\nimport styles from './styles.css.js';\nimport InternalMixedLineBarChart from '../mixed-line-bar-chart/internal';\nimport useBaseComponent from '../internal/hooks/use-base-component';\n\nexport { BarChartProps };\n\nfunction BarChart<T extends number | string | Date>({\n series = [],\n height = 500,\n xScaleType = 'categorical',\n yScaleType = 'linear',\n stackedBars = false,\n horizontalBars = false,\n detailPopoverSize = 'medium',\n statusType = 'finished',\n emphasizeBaselineAxis = true,\n ...props\n}: BarChartProps<T>) {\n const baseComponentProps = useBaseComponent('BarChart');\n const baseProps = getBaseProps(props);\n const className = clsx(baseProps.className, styles.root);\n\n return (\n <InternalMixedLineBarChart\n {...props}\n {...baseComponentProps}\n className={className}\n height={height}\n xScaleType={xScaleType}\n yScaleType={yScaleType}\n stackedBars={stackedBars}\n horizontalBars={horizontalBars}\n series={series}\n detailPopoverSize={detailPopoverSize}\n statusType={statusType}\n emphasizeBaselineAxis={emphasizeBaselineAxis}\n />\n );\n}\n\napplyDisplayName(BarChart, 'BarChart');\n\nexport default BarChart;\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CartesianChartProps } from '../internal/components/cartesian-chart/interfaces';
|
|
1
|
+
import { CartesianChartProps, ScaleType } from '../internal/components/cartesian-chart/interfaces';
|
|
2
2
|
import { ChartDataTypes, MixedLineBarChartProps } from '../mixed-line-bar-chart/interfaces';
|
|
3
3
|
type BarSeries<T> = MixedLineBarChartProps.BarDataSeries<T> | MixedLineBarChartProps.ThresholdSeries<T>;
|
|
4
4
|
export interface BarChartProps<T extends ChartDataTypes> extends CartesianChartProps<T, MixedLineBarChartProps.ChartSeries<T>> {
|
|
@@ -27,6 +27,11 @@ export interface BarChartProps<T extends ChartDataTypes> extends CartesianChartP
|
|
|
27
27
|
* See the usage guidelines for more details.
|
|
28
28
|
*/
|
|
29
29
|
emphasizeBaselineAxis?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Determines the type of scale for values on the x axis.
|
|
32
|
+
* Use `categorical` for bar charts.
|
|
33
|
+
*/
|
|
34
|
+
xScaleType?: ScaleType;
|
|
30
35
|
}
|
|
31
36
|
export declare namespace BarChartProps { }
|
|
32
37
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"lib/default/","sources":["bar-chart/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mDAAmD,CAAC;
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"lib/default/","sources":["bar-chart/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,mDAAmD,CAAC;AACnG,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAE5F,KAAK,SAAS,CAAC,CAAC,IAAI,sBAAsB,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,sBAAsB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;AAExG,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,cAAc,CACrD,SAAQ,mBAAmB,CAAC,CAAC,EAAE,sBAAsB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IACrE;;;;;;;;;OASG;IACH,MAAM,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IAEpC;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB;AAGD,yBAAiB,aAAa,CAAC,GAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["bar-chart/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { CartesianChartProps } from '../internal/components/cartesian-chart/interfaces';\nimport { ChartDataTypes, MixedLineBarChartProps } from '../mixed-line-bar-chart/interfaces';\n\ntype BarSeries<T> = MixedLineBarChartProps.BarDataSeries<T> | MixedLineBarChartProps.ThresholdSeries<T>;\n\nexport interface BarChartProps<T extends ChartDataTypes>\n extends CartesianChartProps<T, MixedLineBarChartProps.ChartSeries<T>> {\n /**\n * Array that represents the source of data for the displayed chart.\n * Each element can represent a bar series or a threshold, and can have the following properties:\n *\n * * `title` (string): A human-readable title for this series\n * * `type` (string): Series type (`\"bar\"`, or `\"threshold\"`)\n * * `data` (Array): An array of data points, represented as objects with `x` and `y` properties\n * * `color` (string): (Optional) A color hex value for this series. When assigned, it takes priority over the automatically assigned color\n * * `valueFormatter` (Function): (Optional) A function that formats data values before rendering in the UI, For example, in the details popover.\n */\n series: ReadonlyArray<BarSeries<T>>;\n\n /**\n * When set to `true`, bars in the same data point are stacked instead of grouped next to each other.\n */\n stackedBars?: boolean;\n\n /**\n * When set to `true`, the x and y axes are flipped, which causes any bars to be rendered horizontally instead of vertically.\n * This can only be used when the chart consists exclusively of bar series.\n */\n horizontalBars?: boolean;\n\n /**\n * When set to `true`, adds a visual emphasis on the zero baseline axis.\n * See the usage guidelines for more details.\n */\n emphasizeBaselineAxis?: boolean;\n}\n\n// W/o this documenter injects CartesianChartProps namespace properties into BarChartProps definition.\nexport namespace BarChartProps {}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["bar-chart/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { CartesianChartProps, ScaleType } from '../internal/components/cartesian-chart/interfaces';\nimport { ChartDataTypes, MixedLineBarChartProps } from '../mixed-line-bar-chart/interfaces';\n\ntype BarSeries<T> = MixedLineBarChartProps.BarDataSeries<T> | MixedLineBarChartProps.ThresholdSeries<T>;\n\nexport interface BarChartProps<T extends ChartDataTypes>\n extends CartesianChartProps<T, MixedLineBarChartProps.ChartSeries<T>> {\n /**\n * Array that represents the source of data for the displayed chart.\n * Each element can represent a bar series or a threshold, and can have the following properties:\n *\n * * `title` (string): A human-readable title for this series\n * * `type` (string): Series type (`\"bar\"`, or `\"threshold\"`)\n * * `data` (Array): An array of data points, represented as objects with `x` and `y` properties\n * * `color` (string): (Optional) A color hex value for this series. When assigned, it takes priority over the automatically assigned color\n * * `valueFormatter` (Function): (Optional) A function that formats data values before rendering in the UI, For example, in the details popover.\n */\n series: ReadonlyArray<BarSeries<T>>;\n\n /**\n * When set to `true`, bars in the same data point are stacked instead of grouped next to each other.\n */\n stackedBars?: boolean;\n\n /**\n * When set to `true`, the x and y axes are flipped, which causes any bars to be rendered horizontally instead of vertically.\n * This can only be used when the chart consists exclusively of bar series.\n */\n horizontalBars?: boolean;\n\n /**\n * When set to `true`, adds a visual emphasis on the zero baseline axis.\n * See the usage guidelines for more details.\n */\n emphasizeBaselineAxis?: boolean;\n\n /**\n * Determines the type of scale for values on the x axis.\n * Use `categorical` for bar charts.\n */\n xScaleType?: ScaleType;\n}\n\n// W/o this documenter injects CartesianChartProps namespace properties into BarChartProps definition.\nexport namespace BarChartProps {}\n"]}
|
package/button/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["button/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAK3C,OAAO,EAAE,WAAW,EAAE,CAAC;AAEvB,QAAA,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["button/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAK3C,OAAO,EAAE,WAAW,EAAE,CAAC;AAEvB,QAAA,MAAM,MAAM,qFAgEX,CAAC;AAGF,eAAe,MAAM,CAAC"}
|
package/button/index.js
CHANGED
|
@@ -7,10 +7,10 @@ import { InternalButton } from './internal';
|
|
|
7
7
|
import { applyDisplayName } from '../internal/utils/apply-display-name';
|
|
8
8
|
import useBaseComponent from '../internal/hooks/use-base-component';
|
|
9
9
|
const Button = React.forwardRef((_a, ref) => {
|
|
10
|
-
var { children, iconName, iconAlign = 'left', iconUrl, iconSvg, iconAlt, variant = 'normal', loading = false, loadingText, disabled = false, wrapText = true, href, target, rel, download, formAction = 'submit', ariaLabel, ariaDescribedby, onClick, onFollow, ariaExpanded, form } = _a, props = __rest(_a, ["children", "iconName", "iconAlign", "iconUrl", "iconSvg", "iconAlt", "variant", "loading", "loadingText", "disabled", "wrapText", "href", "target", "rel", "download", "formAction", "ariaLabel", "ariaDescribedby", "onClick", "onFollow", "ariaExpanded", "form"]);
|
|
10
|
+
var { children, iconName, iconAlign = 'left', iconUrl, iconSvg, iconAlt, variant = 'normal', loading = false, loadingText, disabled = false, wrapText = true, href, target, rel, download, formAction = 'submit', ariaLabel, ariaDescribedby, onClick, onFollow, ariaExpanded, fullWidth, form } = _a, props = __rest(_a, ["children", "iconName", "iconAlign", "iconUrl", "iconSvg", "iconAlt", "variant", "loading", "loadingText", "disabled", "wrapText", "href", "target", "rel", "download", "formAction", "ariaLabel", "ariaDescribedby", "onClick", "onFollow", "ariaExpanded", "fullWidth", "form"]);
|
|
11
11
|
const baseComponentProps = useBaseComponent('Button');
|
|
12
12
|
const baseProps = getBaseProps(props);
|
|
13
|
-
return (React.createElement(InternalButton, Object.assign({}, baseProps, baseComponentProps, { ref: ref, iconName: iconName, iconAlign: iconAlign, iconUrl: iconUrl, iconSvg: iconSvg, iconAlt: iconAlt, variant: variant, loading: loading, loadingText: loadingText, disabled: disabled, wrapText: wrapText, href: href, target: target, rel: rel, download: download, formAction: formAction, ariaLabel: ariaLabel, ariaDescribedby: ariaDescribedby, onClick: onClick, onFollow: onFollow, ariaExpanded: ariaExpanded, form: form }), children));
|
|
13
|
+
return (React.createElement(InternalButton, Object.assign({}, baseProps, baseComponentProps, { ref: ref, iconName: iconName, iconAlign: iconAlign, iconUrl: iconUrl, iconSvg: iconSvg, iconAlt: iconAlt, variant: variant, loading: loading, loadingText: loadingText, disabled: disabled, wrapText: wrapText, href: href, target: target, rel: rel, download: download, formAction: formAction, ariaLabel: ariaLabel, ariaDescribedby: ariaDescribedby, onClick: onClick, onFollow: onFollow, ariaExpanded: ariaExpanded, fullWidth: fullWidth, form: form }), children));
|
|
14
14
|
});
|
|
15
15
|
applyDisplayName(Button, 'Button');
|
|
16
16
|
export default Button;
|
package/button/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["button/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AAIpE,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAC7B,CACE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["button/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AAIpE,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAC7B,CACE,EAyBc,EACd,GAA+B,EAC/B,EAAE;QA3BF,EACE,QAAQ,EACR,QAAQ,EACR,SAAS,GAAG,MAAM,EAClB,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,GAAG,QAAQ,EAClB,OAAO,GAAG,KAAK,EACf,WAAW,EACX,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,IAAI,EACf,IAAI,EACJ,MAAM,EACN,GAAG,EACH,QAAQ,EACR,UAAU,GAAG,QAAQ,EACrB,SAAS,EACT,eAAe,EACf,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,IAAI,OAEQ,EADT,KAAK,cAxBV,kRAyBC,CADS;IAIV,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACtD,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IACtC,OAAO,CACL,oBAAC,cAAc,oBACT,SAAS,EACT,kBAAkB,IACtB,GAAG,EAAE,GAAG,EACR,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,GAAG,EACR,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,eAAe,EAChC,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,IAAI,KAET,QAAQ,CACM,CAClB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AACnC,eAAe,MAAM,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { getBaseProps } from '../internal/base-component';\nimport { ButtonProps } from './interfaces';\nimport { InternalButton } from './internal';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport useBaseComponent from '../internal/hooks/use-base-component';\n\nexport { ButtonProps };\n\nconst Button = React.forwardRef(\n (\n {\n children,\n iconName,\n iconAlign = 'left',\n iconUrl,\n iconSvg,\n iconAlt,\n variant = 'normal',\n loading = false,\n loadingText,\n disabled = false,\n wrapText = true,\n href,\n target,\n rel,\n download,\n formAction = 'submit',\n ariaLabel,\n ariaDescribedby,\n onClick,\n onFollow,\n ariaExpanded,\n fullWidth,\n form,\n ...props\n }: ButtonProps,\n ref: React.Ref<ButtonProps.Ref>\n ) => {\n const baseComponentProps = useBaseComponent('Button');\n const baseProps = getBaseProps(props);\n return (\n <InternalButton\n {...baseProps}\n {...baseComponentProps}\n ref={ref}\n iconName={iconName}\n iconAlign={iconAlign}\n iconUrl={iconUrl}\n iconSvg={iconSvg}\n iconAlt={iconAlt}\n variant={variant}\n loading={loading}\n loadingText={loadingText}\n disabled={disabled}\n wrapText={wrapText}\n href={href}\n target={target}\n rel={rel}\n download={download}\n formAction={formAction}\n ariaLabel={ariaLabel}\n ariaDescribedby={ariaDescribedby}\n onClick={onClick}\n onFollow={onFollow}\n ariaExpanded={ariaExpanded}\n fullWidth={fullWidth}\n form={form}\n >\n {children}\n </InternalButton>\n );\n }\n);\n\napplyDisplayName(Button, 'Button');\nexport default Button;\n"]}
|
package/button/interfaces.d.ts
CHANGED
|
@@ -122,9 +122,13 @@ export interface ButtonProps extends BaseComponentProps {
|
|
|
122
122
|
*/
|
|
123
123
|
onFollow?: CancelableEventHandler<ButtonProps.FollowDetail>;
|
|
124
124
|
/**
|
|
125
|
-
*
|
|
125
|
+
* Adds aria-expanded to the button element. Use when the button controls an expandable element.
|
|
126
126
|
*/
|
|
127
127
|
ariaExpanded?: boolean;
|
|
128
|
+
/**
|
|
129
|
+
* Sets the button width to be 100% of the parent container width. Button content is centered.
|
|
130
|
+
*/
|
|
131
|
+
fullWidth?: boolean;
|
|
128
132
|
}
|
|
129
133
|
export declare namespace ButtonProps {
|
|
130
134
|
type Variant = 'normal' | 'primary' | 'link' | 'icon' | 'inline-icon';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"lib/default/","sources":["button/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,WAAW,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAE/G,MAAM,WAAW,WAAY,SAAQ,kBAAkB;IACrD;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC;IAC1B;;OAEG;IACH,SAAS,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC;IAClC;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC;IAEpC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;;;QAII;IACJ,QAAQ,CAAC,EAAE,OAAO,GAAG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,YAAY,GAAG,IAAI,CAAC;KACrC;CACF"}
|
package/button/interfaces.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["button/interfaces.ts"],"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 { IconProps } from '../icon/interfaces';\nimport React from 'react';\nimport { BaseNavigationDetail, CancelableEventHandler, ClickDetail as _ClickDetail } from '../internal/events';\n\nexport interface ButtonProps extends BaseComponentProps {\n /**\n * Renders the button as disabled and prevents clicks.\n */\n disabled?: boolean;\n /**\n * Renders the button as being in a loading state. It takes precedence over the `disabled` if both are set to `true`.\n * It prevents users from clicking the button, but it can still be focused.\n */\n loading?: boolean;\n /**\n * Specifies the text that screen reader announces when the button is in a loading state.\n */\n loadingText?: string;\n /**\n * Displays an icon next to the text. You can use the `iconAlign` property to position the icon.\n */\n iconName?: IconProps.Name;\n /**\n * Specifies the alignment of the icon.\n */\n iconAlign?: ButtonProps.IconAlign;\n /**\n * Specifies the URL of a custom icon. Use this property if the icon you want isn't available.\n *\n * If you set both `iconUrl` and `iconSvg`, `iconSvg` will take precedence.\n */\n iconUrl?: string;\n /**\n * Specifies the SVG of a custom icon.\n *\n * Use this property if you want your custom icon to inherit colors dictated by variant or hover states.\n * When this property is set, the component will be decorated with `aria-hidden=\"true\"`. Ensure that the `svg` element:\n * - has attribute `focusable=\"false\"`.\n * - has `viewBox=\"0 0 16 16\"`.\n *\n * If you set the `svg` element as the root node of the slot, the component will automatically\n * - set `stroke=\"currentColor\"`, `fill=\"none\"`, and `vertical-align=\"top\"`.\n * - set the stroke width based on the size of the icon.\n * - set the width and height of the SVG element based on the size of the icon.\n *\n * If you don't want these styles to be automatically set, wrap the `svg` element into a `span`.\n * You can still set the stroke to `currentColor` to inherit the color of the surrounding elements.\n *\n * If you set both `iconUrl` and `iconSvg`, `iconSvg` will take precedence.\n *\n * *Note:* Remember to remove any additional elements (for example: `defs`) and related CSS classes from SVG files exported from design software.\n * In most cases, they aren't needed, as the `svg` element inherits styles from the icon component.\n */\n iconSvg?: React.ReactNode;\n /**\n * Specifies alternate text for a custom icon. We recommend that you provide this for accessibility.\n * This property is ignored if you use a predefined icon or if you set your custom icon using the `iconSvg` slot.\n */\n iconAlt?: string;\n /**\n * The form action that is performed by a button click.\n */\n formAction?: ButtonProps.FormAction;\n\n /**\n * Adds `aria-label` to the button element. It should be used in buttons that don't have text in order to make\n * them accessible.\n */\n ariaLabel?: string;\n\n /**\n * Adds `aria-describedby` to the button.\n */\n ariaDescribedby?: string;\n\n /**\n * Applies button styling to a link. Use this property if you need a link styled as a button (`variant=link`).\n * For example, if you have a 'help' button that links to a documentation page.\n */\n href?: string;\n\n /**\n * Specifies where to open the linked URL (for example, to open in a new browser window or tab use `_blank`).\n * This property only applies when an `href` is provided.\n */\n target?: string;\n\n /**\n * Adds a `rel` attribute to the link. By default, the component sets the `rel` attribute to \"noopener noreferrer\" when `target` is `\"_blank\"`.\n * If the `rel` property is provided, it overrides the default behavior.\n */\n rel?: string;\n\n /**\n * Specifies whether the linked URL, when selected, will prompt the user to download instead of navigate.\n * You can specify a string value that will be suggested as the name of the downloaded file.\n * This property only applies when an `href` is provided.\n **/\n download?: boolean | string;\n\n /**\n * Specifies if the `text` content wraps. If you set it to `false`, it prevents the text from wrapping.\n */\n wrapText?: boolean;\n\n /** Determines the general styling of the button as follows:\n * * `primary` for primary buttons.\n * * `normal` for secondary buttons.\n * * `link` for tertiary buttons.\n * * `icon` to display an icon only (no text).\n * * `inline-icon` to display an icon-only (no text) button within a text context.\n */\n variant?: ButtonProps.Variant;\n\n /** The id of the <form> element to associate with the button. The value of this attribute must be the id of a <form> in the same document.\n * Use when a button is not the ancestor of a form element, such as when used in a modal.\n */\n form?: string;\n\n /**\n * Text displayed in the button element.\n * @displayname text\n */\n children?: React.ReactNode;\n\n /**\n * Called when the user clicks on the button and the button is not disabled or in loading state.\n */\n onClick?: CancelableEventHandler<ButtonProps.ClickDetail>;\n\n /**\n * Called when the user clicks on the button with the left mouse button without pressing\n * modifier keys (that is, CTRL, ALT, SHIFT, META), and the button has an `href` set.\n */\n onFollow?: CancelableEventHandler<ButtonProps.FollowDetail>;\n\n /**\n *
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["button/interfaces.ts"],"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 { IconProps } from '../icon/interfaces';\nimport React from 'react';\nimport { BaseNavigationDetail, CancelableEventHandler, ClickDetail as _ClickDetail } from '../internal/events';\n\nexport interface ButtonProps extends BaseComponentProps {\n /**\n * Renders the button as disabled and prevents clicks.\n */\n disabled?: boolean;\n /**\n * Renders the button as being in a loading state. It takes precedence over the `disabled` if both are set to `true`.\n * It prevents users from clicking the button, but it can still be focused.\n */\n loading?: boolean;\n /**\n * Specifies the text that screen reader announces when the button is in a loading state.\n */\n loadingText?: string;\n /**\n * Displays an icon next to the text. You can use the `iconAlign` property to position the icon.\n */\n iconName?: IconProps.Name;\n /**\n * Specifies the alignment of the icon.\n */\n iconAlign?: ButtonProps.IconAlign;\n /**\n * Specifies the URL of a custom icon. Use this property if the icon you want isn't available.\n *\n * If you set both `iconUrl` and `iconSvg`, `iconSvg` will take precedence.\n */\n iconUrl?: string;\n /**\n * Specifies the SVG of a custom icon.\n *\n * Use this property if you want your custom icon to inherit colors dictated by variant or hover states.\n * When this property is set, the component will be decorated with `aria-hidden=\"true\"`. Ensure that the `svg` element:\n * - has attribute `focusable=\"false\"`.\n * - has `viewBox=\"0 0 16 16\"`.\n *\n * If you set the `svg` element as the root node of the slot, the component will automatically\n * - set `stroke=\"currentColor\"`, `fill=\"none\"`, and `vertical-align=\"top\"`.\n * - set the stroke width based on the size of the icon.\n * - set the width and height of the SVG element based on the size of the icon.\n *\n * If you don't want these styles to be automatically set, wrap the `svg` element into a `span`.\n * You can still set the stroke to `currentColor` to inherit the color of the surrounding elements.\n *\n * If you set both `iconUrl` and `iconSvg`, `iconSvg` will take precedence.\n *\n * *Note:* Remember to remove any additional elements (for example: `defs`) and related CSS classes from SVG files exported from design software.\n * In most cases, they aren't needed, as the `svg` element inherits styles from the icon component.\n */\n iconSvg?: React.ReactNode;\n /**\n * Specifies alternate text for a custom icon. We recommend that you provide this for accessibility.\n * This property is ignored if you use a predefined icon or if you set your custom icon using the `iconSvg` slot.\n */\n iconAlt?: string;\n /**\n * The form action that is performed by a button click.\n */\n formAction?: ButtonProps.FormAction;\n\n /**\n * Adds `aria-label` to the button element. It should be used in buttons that don't have text in order to make\n * them accessible.\n */\n ariaLabel?: string;\n\n /**\n * Adds `aria-describedby` to the button.\n */\n ariaDescribedby?: string;\n\n /**\n * Applies button styling to a link. Use this property if you need a link styled as a button (`variant=link`).\n * For example, if you have a 'help' button that links to a documentation page.\n */\n href?: string;\n\n /**\n * Specifies where to open the linked URL (for example, to open in a new browser window or tab use `_blank`).\n * This property only applies when an `href` is provided.\n */\n target?: string;\n\n /**\n * Adds a `rel` attribute to the link. By default, the component sets the `rel` attribute to \"noopener noreferrer\" when `target` is `\"_blank\"`.\n * If the `rel` property is provided, it overrides the default behavior.\n */\n rel?: string;\n\n /**\n * Specifies whether the linked URL, when selected, will prompt the user to download instead of navigate.\n * You can specify a string value that will be suggested as the name of the downloaded file.\n * This property only applies when an `href` is provided.\n **/\n download?: boolean | string;\n\n /**\n * Specifies if the `text` content wraps. If you set it to `false`, it prevents the text from wrapping.\n */\n wrapText?: boolean;\n\n /** Determines the general styling of the button as follows:\n * * `primary` for primary buttons.\n * * `normal` for secondary buttons.\n * * `link` for tertiary buttons.\n * * `icon` to display an icon only (no text).\n * * `inline-icon` to display an icon-only (no text) button within a text context.\n */\n variant?: ButtonProps.Variant;\n\n /** The id of the <form> element to associate with the button. The value of this attribute must be the id of a <form> in the same document.\n * Use when a button is not the ancestor of a form element, such as when used in a modal.\n */\n form?: string;\n\n /**\n * Text displayed in the button element.\n * @displayname text\n */\n children?: React.ReactNode;\n\n /**\n * Called when the user clicks on the button and the button is not disabled or in loading state.\n */\n onClick?: CancelableEventHandler<ButtonProps.ClickDetail>;\n\n /**\n * Called when the user clicks on the button with the left mouse button without pressing\n * modifier keys (that is, CTRL, ALT, SHIFT, META), and the button has an `href` set.\n */\n onFollow?: CancelableEventHandler<ButtonProps.FollowDetail>;\n\n /**\n * Adds aria-expanded to the button element. Use when the button controls an expandable element.\n */\n ariaExpanded?: boolean;\n\n /**\n * Sets the button width to be 100% of the parent container width. Button content is centered.\n */\n fullWidth?: boolean;\n}\n\nexport namespace ButtonProps {\n export type Variant = 'normal' | 'primary' | 'link' | 'icon' | 'inline-icon';\n export type ClickDetail = _ClickDetail;\n export type FollowDetail = BaseNavigationDetail;\n\n export type FormAction = 'submit' | 'none';\n\n export type IconAlign = 'left' | 'right';\n\n export interface Ref {\n /**\n * Focuses the underlying native button.\n */\n focus(options?: FocusOptions): void;\n }\n}\n"]}
|
package/button/internal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"lib/default/","sources":["button/internal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAKnD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAYlF,eAAO,MAAM,cAAc;cANf,WAAW,CAAC,SAAS,CAAC,GAAG,eAAe,GAAG,kBAAkB,GAAG,cAAc,GAAG,eAAe;;;;
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"lib/default/","sources":["button/internal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAKnD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAYlF,eAAO,MAAM,cAAc;cANf,WAAW,CAAC,SAAS,CAAC,GAAG,eAAe,GAAG,kBAAkB,GAAG,cAAc,GAAG,eAAe;;;;sEAyI3G,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
package/button/internal.js
CHANGED
|
@@ -11,7 +11,7 @@ import { checkSafeUrl } from '../internal/utils/check-safe-url';
|
|
|
11
11
|
import { useMergeRefs } from '../internal/hooks/use-merge-refs';
|
|
12
12
|
import LiveRegion from '../internal/components/live-region';
|
|
13
13
|
export const InternalButton = React.forwardRef((_a, ref) => {
|
|
14
|
-
var { children, iconName, __iconClass, onClick, onFollow, iconAlign = 'left', iconUrl, iconSvg, iconAlt, variant = 'normal', loading = false, loadingText, disabled = false, wrapText = true, href, target, rel, download, formAction = 'submit', ariaLabel, ariaDescribedby, ariaExpanded, __nativeAttributes, __internalRootRef = null, __activated = false } = _a, props = __rest(_a, ["children", "iconName", "__iconClass", "onClick", "onFollow", "iconAlign", "iconUrl", "iconSvg", "iconAlt", "variant", "loading", "loadingText", "disabled", "wrapText", "href", "target", "rel", "download", "formAction", "ariaLabel", "ariaDescribedby", "ariaExpanded", "__nativeAttributes", "__internalRootRef", "__activated"]);
|
|
14
|
+
var { children, iconName, __iconClass, onClick, onFollow, iconAlign = 'left', iconUrl, iconSvg, iconAlt, variant = 'normal', loading = false, loadingText, disabled = false, wrapText = true, href, target, rel, download, formAction = 'submit', ariaLabel, ariaDescribedby, ariaExpanded, fullWidth, __nativeAttributes, __internalRootRef = null, __activated = false } = _a, props = __rest(_a, ["children", "iconName", "__iconClass", "onClick", "onFollow", "iconAlign", "iconUrl", "iconSvg", "iconAlt", "variant", "loading", "loadingText", "disabled", "wrapText", "href", "target", "rel", "download", "formAction", "ariaLabel", "ariaDescribedby", "ariaExpanded", "fullWidth", "__nativeAttributes", "__internalRootRef", "__activated"]);
|
|
15
15
|
checkSafeUrl('Button', href);
|
|
16
16
|
const isAnchor = Boolean(href);
|
|
17
17
|
const isNotInteractive = loading || disabled;
|
|
@@ -33,6 +33,7 @@ export const InternalButton = React.forwardRef((_a, ref) => {
|
|
|
33
33
|
[styles['button-no-wrap']]: !wrapText,
|
|
34
34
|
[styles['button-no-text']]: !shouldHaveContent,
|
|
35
35
|
[styles['is-activated']]: __activated,
|
|
36
|
+
[styles['full-width']]: shouldHaveContent && fullWidth,
|
|
36
37
|
});
|
|
37
38
|
const buttonProps = Object.assign(Object.assign(Object.assign({}, props), __nativeAttributes), {
|
|
38
39
|
// https://github.com/microsoft/TypeScript/issues/36659
|
package/button/internal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"lib/default/","sources":["button/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAmB,QAAQ,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAGrE,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,UAAU,MAAM,oCAAoC,CAAC;AAS5D,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,CAAC,UAAU,CAC5C,CACE,
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"lib/default/","sources":["button/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AAC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,CAAC;KACH;IACD,OAAO,CACL;QACE,gDACM,WAAW,IACf,IAAI,EAAE,UAAU,KAAK,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,EACjD,QAAQ,EAAE,QAAQ,mBACH,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,KAErD,aAAa,CACP;QACR,OAAO,IAAI,WAAW,IAAI,oBAAC,UAAU,QAAE,WAAW,CAAc,CAChE,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useCallback, useRef } from 'react';\nimport { fireCancelableEvent, isPlainLeftClick } from '../internal/events';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport styles from './styles.css.js';\nimport { ButtonIconProps, LeftIcon, RightIcon } from './icon-helper';\nimport { ButtonProps } from './interfaces';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { checkSafeUrl } from '../internal/utils/check-safe-url';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport LiveRegion from '../internal/components/live-region';\n\ntype InternalButtonProps = Omit<ButtonProps, 'variant'> & {\n variant?: ButtonProps['variant'] | 'flashbar-icon' | 'breadcrumb-group' | 'menu-trigger' | 'modal-dismiss';\n __nativeAttributes?: Record<string, any>;\n __iconClass?: string;\n __activated?: boolean;\n} & InternalBaseComponentProps;\n\nexport const InternalButton = React.forwardRef(\n (\n {\n children,\n iconName,\n __iconClass,\n onClick,\n onFollow,\n iconAlign = 'left',\n iconUrl,\n iconSvg,\n iconAlt,\n variant = 'normal',\n loading = false,\n loadingText,\n disabled = false,\n wrapText = true,\n href,\n target,\n rel,\n download,\n formAction = 'submit',\n ariaLabel,\n ariaDescribedby,\n ariaExpanded,\n fullWidth,\n __nativeAttributes,\n __internalRootRef = null,\n __activated = false,\n ...props\n }: InternalButtonProps,\n ref: React.Ref<ButtonProps.Ref>\n ) => {\n checkSafeUrl('Button', href);\n const isAnchor = Boolean(href);\n const isNotInteractive = loading || disabled;\n const shouldHaveContent =\n children && ['icon', 'inline-icon', 'flashbar-icon', 'modal-dismiss'].indexOf(variant) === -1;\n\n const buttonRef = useRef<HTMLElement>(null);\n useForwardFocus(ref, buttonRef);\n\n const handleClick = useCallback(\n (event: React.MouseEvent) => {\n if (isNotInteractive) {\n return event.preventDefault();\n }\n\n if (isAnchor && isPlainLeftClick(event)) {\n fireCancelableEvent(onFollow, { href, target }, event);\n }\n\n const { altKey, button, ctrlKey, metaKey, shiftKey } = event;\n fireCancelableEvent(onClick, { altKey, button, ctrlKey, metaKey, shiftKey }, event);\n },\n [isAnchor, isNotInteractive, onClick, onFollow, href, target]\n );\n\n const buttonClass = clsx(props.className, styles.button, styles[`variant-${variant}`], {\n [styles.disabled]: isNotInteractive,\n [styles['button-no-wrap']]: !wrapText,\n [styles['button-no-text']]: !shouldHaveContent,\n [styles['is-activated']]: __activated,\n [styles['full-width']]: shouldHaveContent && fullWidth,\n });\n\n const buttonProps = {\n ...props,\n ...__nativeAttributes,\n // https://github.com/microsoft/TypeScript/issues/36659\n ref: useMergeRefs(buttonRef as any, __internalRootRef),\n 'aria-label': ariaLabel,\n 'aria-describedby': ariaDescribedby,\n 'aria-expanded': ariaExpanded,\n className: buttonClass,\n onClick: handleClick,\n } as const;\n const iconProps: ButtonIconProps = {\n loading,\n iconName,\n iconAlign,\n iconUrl,\n iconSvg,\n iconAlt,\n variant,\n iconClass: __iconClass,\n iconSize: variant === 'modal-dismiss' ? 'medium' : 'normal',\n };\n const buttonContent = (\n <>\n <LeftIcon {...iconProps} />\n {shouldHaveContent && <span className={styles.content}>{children}</span>}\n <RightIcon {...iconProps} />\n </>\n );\n\n if (isAnchor) {\n return (\n // https://github.com/yannickcr/eslint-plugin-react/issues/2962\n // eslint-disable-next-line react/jsx-no-target-blank\n <>\n <a\n {...buttonProps}\n href={href}\n target={target}\n // security recommendation: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target\n rel={rel ?? (target === '_blank' ? 'noopener noreferrer' : undefined)}\n tabIndex={isNotInteractive ? -1 : undefined}\n aria-disabled={isNotInteractive ? true : undefined}\n download={download}\n >\n {buttonContent}\n </a>\n {loading && loadingText && <LiveRegion>{loadingText}</LiveRegion>}\n </>\n );\n }\n return (\n <>\n <button\n {...buttonProps}\n type={formAction === 'none' ? 'button' : 'submit'}\n disabled={disabled}\n aria-disabled={loading && !disabled ? true : undefined}\n >\n {buttonContent}\n </button>\n {loading && loadingText && <LiveRegion>{loadingText}</LiveRegion>}\n </>\n );\n }\n);\n\nexport default InternalButton;\n"]}
|
package/button/styles.css.js
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"content": "
|
|
5
|
-
"button": "
|
|
6
|
-
"variant-normal": "awsui_variant-
|
|
7
|
-
"is-activated": "awsui_is-
|
|
8
|
-
"variant-icon": "awsui_variant-
|
|
9
|
-
"variant-modal-dismiss": "awsui_variant-modal-
|
|
10
|
-
"variant-flashbar-icon": "awsui_variant-flashbar-
|
|
11
|
-
"variant-inline-icon": "awsui_variant-inline-
|
|
12
|
-
"disabled": "
|
|
13
|
-
"variant-primary": "awsui_variant-
|
|
14
|
-
"variant-link": "awsui_variant-
|
|
15
|
-
"variant-breadcrumb-group": "awsui_variant-breadcrumb-
|
|
16
|
-
"variant-menu-trigger": "awsui_variant-menu-
|
|
17
|
-
"button-no-text": "awsui_button-no-
|
|
18
|
-
"button-no-wrap": "awsui_button-no-
|
|
19
|
-
"
|
|
20
|
-
"icon-
|
|
21
|
-
"icon": "
|
|
4
|
+
"content": "awsui_content_vjswe_jz1q6_97",
|
|
5
|
+
"button": "awsui_button_vjswe_jz1q6_101",
|
|
6
|
+
"variant-normal": "awsui_variant-normal_vjswe_jz1q6_126",
|
|
7
|
+
"is-activated": "awsui_is-activated_vjswe_jz1q6_139",
|
|
8
|
+
"variant-icon": "awsui_variant-icon_vjswe_jz1q6_166",
|
|
9
|
+
"variant-modal-dismiss": "awsui_variant-modal-dismiss_vjswe_jz1q6_166",
|
|
10
|
+
"variant-flashbar-icon": "awsui_variant-flashbar-icon_vjswe_jz1q6_166",
|
|
11
|
+
"variant-inline-icon": "awsui_variant-inline-icon_vjswe_jz1q6_184",
|
|
12
|
+
"disabled": "awsui_disabled_vjswe_jz1q6_202",
|
|
13
|
+
"variant-primary": "awsui_variant-primary_vjswe_jz1q6_210",
|
|
14
|
+
"variant-link": "awsui_variant-link_vjswe_jz1q6_294",
|
|
15
|
+
"variant-breadcrumb-group": "awsui_variant-breadcrumb-group_vjswe_jz1q6_714",
|
|
16
|
+
"variant-menu-trigger": "awsui_variant-menu-trigger_vjswe_jz1q6_801",
|
|
17
|
+
"button-no-text": "awsui_button-no-text_vjswe_jz1q6_885",
|
|
18
|
+
"button-no-wrap": "awsui_button-no-wrap_vjswe_jz1q6_889",
|
|
19
|
+
"full-width": "awsui_full-width_vjswe_jz1q6_892",
|
|
20
|
+
"icon-left": "awsui_icon-left_vjswe_jz1q6_909",
|
|
21
|
+
"icon-right": "awsui_icon-right_vjswe_jz1q6_914",
|
|
22
|
+
"icon": "awsui_icon_vjswe_jz1q6_909"
|
|
22
23
|
};
|
|
23
24
|
|