@cloudscape-design/components 3.0.293 → 3.0.295
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/internal.d.ts.map +1 -1
- package/alert/internal.js +1 -1
- package/alert/internal.js.map +1 -1
- package/area-chart/elements/use-highlight-details.d.ts.map +1 -1
- package/area-chart/elements/use-highlight-details.js +3 -1
- package/area-chart/elements/use-highlight-details.js.map +1 -1
- package/area-chart/interfaces.d.ts +1 -0
- package/area-chart/interfaces.d.ts.map +1 -1
- package/area-chart/interfaces.js.map +1 -1
- package/breadcrumb-group/item/item.d.ts.map +1 -1
- package/breadcrumb-group/item/item.js +9 -6
- package/breadcrumb-group/item/item.js.map +1 -1
- package/button/internal.d.ts.map +1 -1
- package/button/internal.js +6 -1
- package/button/internal.js.map +1 -1
- package/container/index.d.ts.map +1 -1
- package/container/index.js +3 -1
- package/container/index.js.map +1 -1
- package/container/internal.d.ts.map +1 -1
- package/container/internal.js +4 -2
- package/container/internal.js.map +1 -1
- package/form/index.d.ts.map +1 -1
- package/form/index.js +5 -1
- package/form/index.js.map +1 -1
- package/form/internal.d.ts.map +1 -1
- package/form/internal.js +11 -2
- package/form/internal.js.map +1 -1
- package/form-field/internal.d.ts.map +1 -1
- package/form-field/internal.js +28 -2
- package/form-field/internal.js.map +1 -1
- package/header/internal.d.ts.map +1 -1
- package/header/internal.js +1 -1
- package/header/internal.js.map +1 -1
- package/internal/analytics/hooks/use-funnel.d.ts.map +1 -1
- package/internal/analytics/hooks/use-funnel.js +17 -11
- package/internal/analytics/hooks/use-funnel.js.map +1 -1
- package/internal/components/cartesian-chart/bottom-labels.d.ts.map +1 -1
- package/internal/components/cartesian-chart/bottom-labels.js +3 -1
- package/internal/components/cartesian-chart/bottom-labels.js.map +1 -1
- package/internal/components/cartesian-chart/interfaces.d.ts +4 -0
- package/internal/components/cartesian-chart/interfaces.d.ts.map +1 -1
- package/internal/components/cartesian-chart/interfaces.js.map +1 -1
- package/internal/components/cartesian-chart/left-labels.d.ts.map +1 -1
- package/internal/components/cartesian-chart/left-labels.js +3 -1
- package/internal/components/cartesian-chart/left-labels.js.map +1 -1
- package/internal/components/chart-filter/index.d.ts.map +1 -1
- package/internal/components/chart-filter/index.js +4 -2
- package/internal/components/chart-filter/index.js.map +1 -1
- package/internal/components/chart-legend/index.d.ts.map +1 -1
- package/internal/components/chart-legend/index.js +3 -1
- package/internal/components/chart-legend/index.js.map +1 -1
- package/internal/components/chart-plot/application-controller.d.ts.map +1 -1
- package/internal/components/chart-plot/application-controller.js +1 -2
- package/internal/components/chart-plot/application-controller.js.map +1 -1
- package/internal/components/chart-plot/index.d.ts.map +1 -1
- package/internal/components/chart-plot/index.js +4 -3
- package/internal/components/chart-plot/index.js.map +1 -1
- package/internal/components/chart-status-container/index.d.ts.map +1 -1
- package/internal/components/chart-status-container/index.js +7 -4
- package/internal/components/chart-status-container/index.js.map +1 -1
- package/internal/environment.js +1 -1
- package/internal/i18n/testing.d.ts +8 -0
- package/internal/i18n/testing.d.ts.map +1 -0
- package/internal/i18n/testing.js +8 -0
- package/internal/i18n/testing.js.map +1 -0
- package/internal/manifest.json +1 -1
- package/link/internal.d.ts.map +1 -1
- package/link/internal.js +35 -1
- package/link/internal.js.map +1 -1
- package/package.json +1 -1
- package/pie-chart/interfaces.d.ts +4 -0
- package/pie-chart/interfaces.d.ts.map +1 -1
- package/pie-chart/interfaces.js.map +1 -1
- package/pie-chart/pie-chart.d.ts.map +1 -1
- package/pie-chart/pie-chart.js +3 -1
- package/pie-chart/pie-chart.js.map +1 -1
- package/pie-chart/segments.d.ts.map +1 -1
- package/pie-chart/segments.js +3 -1
- package/pie-chart/segments.js.map +1 -1
- package/pie-chart/utils.d.ts +2 -1
- package/pie-chart/utils.d.ts.map +1 -1
- package/pie-chart/utils.js +3 -3
- package/pie-chart/utils.js.map +1 -1
- package/popover/body.d.ts.map +1 -1
- package/popover/body.js +3 -1
- package/popover/body.js.map +1 -1
- package/popover/interfaces.d.ts +1 -0
- package/popover/interfaces.d.ts.map +1 -1
- package/popover/interfaces.js.map +1 -1
- package/table/styles.css.js +34 -33
- package/table/styles.scoped.css +41 -41
- package/table/styles.selectors.js +34 -33
- package/tiles/interfaces.d.ts +4 -0
- package/tiles/interfaces.d.ts.map +1 -1
- package/tiles/interfaces.js.map +1 -1
- package/tiles/internal.d.ts.map +1 -1
- package/tiles/internal.js +2 -2
- package/tiles/internal.js.map +1 -1
- package/top-navigation/interfaces.d.ts +2 -0
- package/top-navigation/interfaces.d.ts.map +1 -1
- package/top-navigation/interfaces.js.map +1 -1
- package/top-navigation/parts/overflow-menu/menu-item.d.ts +1 -0
- package/top-navigation/parts/overflow-menu/menu-item.d.ts.map +1 -1
- package/top-navigation/parts/overflow-menu/menu-item.js +2 -0
- package/top-navigation/parts/overflow-menu/menu-item.js.map +1 -1
- package/top-navigation/parts/overflow-menu/views/submenu.d.ts.map +1 -1
- package/top-navigation/parts/overflow-menu/views/submenu.js +1 -0
- package/top-navigation/parts/overflow-menu/views/submenu.js.map +1 -1
- package/top-navigation/parts/overflow-menu/views/utilities.d.ts.map +1 -1
- package/top-navigation/parts/overflow-menu/views/utilities.js +1 -1
- package/top-navigation/parts/overflow-menu/views/utilities.js.map +1 -1
- package/internal/utils/focus-svg-element.d.ts +0 -2
- package/internal/utils/focus-svg-element.d.ts.map +0 -1
- package/internal/utils/focus-svg-element.js +0 -15
- package/internal/utils/focus-svg-element.js.map +0 -1
|
@@ -20,6 +20,7 @@ const SubmenuView = ({ onClose, utilityIndex, headerText, headerSecondaryText, d
|
|
|
20
20
|
fireCancelableEvent(definition.onItemFollow, { id: item.id, href: item.href, external: item.external }, event);
|
|
21
21
|
}
|
|
22
22
|
fireCancelableEvent(definition.onItemClick, { id: item.id, href: item.href, external: item.external }, event);
|
|
23
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
23
24
|
} })))))));
|
|
24
25
|
};
|
|
25
26
|
export default SubmenuView;
|
|
@@ -1 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zD,KAAK,CACN,CAAC;gBACF,OAAO,aAAP,OAAO,uBAAP,OAAO,EAAI,CAAC;YACd,CAAC,IACD,CACH,CAAC,CACC,CACK,CACb,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,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';\nimport FocusLock from 'react-focus-lock';\n\nimport { useNavigate } from '../router';\nimport Header from '../header';\nimport { SubmenuItem } from '../menu-item';\nimport { useUniqueId } from '../../../../internal/hooks/use-unique-id';\n\nimport { TopNavigationProps } from '../../../interfaces';\n\nimport { View } from '..';\nimport styles from '../../../styles.css.js';\nimport { fireCancelableEvent, isPlainLeftClick } from '../../../../internal/events';\n\ninterface SubmenuViewProps extends View {\n definition: TopNavigationProps.MenuDropdownUtility;\n utilityIndex?: number;\n}\n\nconst SubmenuView = ({\n onClose,\n utilityIndex,\n headerText,\n headerSecondaryText,\n dismissIconAriaLabel,\n backIconAriaLabel,\n definition,\n}: SubmenuViewProps) => {\n const navigate = useNavigate();\n const headerId = useUniqueId('overflow-menu-header');\n\n return (\n <FocusLock returnFocus={true}>\n <Header\n secondaryText={headerSecondaryText}\n dismissIconAriaLabel={dismissIconAriaLabel}\n backIconAriaLabel={backIconAriaLabel}\n onClose={onClose}\n onBack={() => navigate('utilities', { utilityIndex })}\n >\n <span id={headerId}>{headerText}</span>\n </Header>\n <ul\n className={clsx(styles['overflow-menu-list'], styles['overflow-menu-list-submenu'])}\n aria-labelledby={headerId}\n >\n {(definition as TopNavigationProps.MenuDropdownUtility).items.map((item, index) => (\n <SubmenuItem\n key={index}\n {...item}\n onClick={(event, item) => {\n if (item.href && isPlainLeftClick(event)) {\n fireCancelableEvent(\n definition.onItemFollow,\n { id: item.id, href: item.href, external: item.external },\n event\n );\n }\n\n fireCancelableEvent(\n definition.onItemClick,\n { id: item.id, href: item.href, external: item.external },\n event\n );\n onClose?.();\n }}\n />\n ))}\n </ul>\n </FocusLock>\n );\n};\n\nexport default SubmenuView;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utilities.d.ts","sourceRoot":"lib/default/","sources":["top-navigation/parts/overflow-menu/views/utilities.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAI1B,UAAU,kBAAmB,SAAQ,IAAI;IACvC,KAAK,EAAE,kBAAkB,CAAC,WAAW,CAAC,CAAC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,QAAA,MAAM,aAAa,qEAA2E,kBAAkB,
|
|
1
|
+
{"version":3,"file":"utilities.d.ts","sourceRoot":"lib/default/","sources":["top-navigation/parts/overflow-menu/views/utilities.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAI1B,UAAU,kBAAmB,SAAQ,IAAI;IACvC,KAAK,EAAE,kBAAkB,CAAC,WAAW,CAAC,CAAC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,QAAA,MAAM,aAAa,qEAA2E,kBAAkB,gBA8B/G,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -20,7 +20,7 @@ const UtilitiesView = ({ headerText, dismissIconAriaLabel, onClose, items = [],
|
|
|
20
20
|
return (React.createElement(FocusLock, { returnFocus: true },
|
|
21
21
|
React.createElement(Header, { dismissIconAriaLabel: dismissIconAriaLabel, onClose: onClose },
|
|
22
22
|
React.createElement("span", { id: headerId }, headerText)),
|
|
23
|
-
React.createElement("ul", { className: styles['overflow-menu-list'], "aria-labelledby": headerId }, items.map((utility, index) => (React.createElement(UtilityMenuItem, Object.assign({ key: index, index: index, ref: index === focusIndex ? ref : undefined }, utility)))))));
|
|
23
|
+
React.createElement("ul", { className: styles['overflow-menu-list'], "aria-labelledby": headerId }, items.map((utility, index) => (React.createElement(UtilityMenuItem, Object.assign({ key: index, index: index, ref: index === focusIndex ? ref : undefined, onClose: onClose }, utility)))))));
|
|
24
24
|
};
|
|
25
25
|
export default UtilitiesView;
|
|
26
26
|
//# sourceMappingURL=utilities.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utilities.js","sourceRoot":"lib/default/","sources":["top-navigation/parts/overflow-menu/views/utilities.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,SAAS,MAAM,kBAAkB,CAAC;AAEzC,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAK/C,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAOvE,MAAM,aAAa,GAAG,CAAC,EAAE,UAAU,EAAE,oBAAoB,EAAE,OAAO,EAAE,KAAK,GAAG,EAAE,EAAE,UAAU,EAAsB,EAAE,EAAE;IAClH,MAAM,QAAQ,GAAG,WAAW,CAAC,sBAAsB,CAAC,CAAC;IACrD,MAAM,GAAG,GAAG,MAAM,CAAwC,IAAI,CAAC,CAAC;IAEhE,SAAS,CAAC,GAAG,EAAE;;QACb,qEAAqE;QACrE,4BAA4B;QAC5B,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;YAClC,MAAA,GAAG,CAAC,OAAO,0CAAE,KAAK,EAAE,CAAC;SACtB;IACH,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IAEjB,OAAO,CACL,oBAAC,SAAS,IAAC,WAAW,EAAE,IAAI;QAC1B,oBAAC,MAAM,IAAC,oBAAoB,EAAE,oBAAoB,EAAE,OAAO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,8BAAM,EAAE,EAAE,QAAQ,IAAG,UAAU,CAAQ,CAChC;QACT,4BAAI,SAAS,EAAE,MAAM,CAAC,oBAAoB,CAAC,qBAAmB,QAAQ,IACnE,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,CAC7B,oBAAC,eAAe,kBACd,GAAG,EAAE,KAAK,EACV,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,EAC3C,OAAO,EAAE,OAAO,IACZ,OAAO,EACX,CACH,CAAC,CACC,CACK,CACb,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef } from 'react';\nimport FocusLock from 'react-focus-lock';\n\nimport Header from '../header';\nimport { UtilityMenuItem } from '../menu-item';\n\nimport { TopNavigationProps } from '../../../interfaces';\n\nimport { View } from '..';\nimport styles from '../../../styles.css.js';\nimport { useUniqueId } from '../../../../internal/hooks/use-unique-id';\n\ninterface UtilitiesViewProps extends View {\n items: TopNavigationProps['utilities'];\n focusIndex?: number;\n}\n\nconst UtilitiesView = ({ headerText, dismissIconAriaLabel, onClose, items = [], focusIndex }: UtilitiesViewProps) => {\n const headerId = useUniqueId('overflow-menu-header');\n const ref = useRef<HTMLAnchorElement & HTMLButtonElement>(null);\n\n useEffect(() => {\n // A focus index is used to set the focus back to the submenu trigger\n // returning from a submenu.\n if (typeof focusIndex === 'number') {\n ref.current?.focus();\n }\n }, [focusIndex]);\n\n return (\n <FocusLock returnFocus={true}>\n <Header dismissIconAriaLabel={dismissIconAriaLabel} onClose={onClose}>\n <span id={headerId}>{headerText}</span>\n </Header>\n <ul className={styles['overflow-menu-list']} aria-labelledby={headerId}>\n {items.map((utility, index) => (\n <UtilityMenuItem\n key={index}\n index={index}\n ref={index === focusIndex ? ref : undefined}\n onClose={onClose}\n {...utility}\n />\n ))}\n </ul>\n </FocusLock>\n );\n};\n\nexport default UtilitiesView;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"focus-svg-element.d.ts","sourceRoot":"lib/default/","sources":["internal/utils/focus-svg-element.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,OAAO,EAAE,UAAU,QAU1D"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
export default function focusSvgElement(element) {
|
|
4
|
-
if (element.focus) {
|
|
5
|
-
element.focus();
|
|
6
|
-
}
|
|
7
|
-
else {
|
|
8
|
-
// Deferring in a timeout because IE11 is not updating `tabIndex` and `focusable` attributes on time for some reason.
|
|
9
|
-
setTimeout(() => {
|
|
10
|
-
// IE11 does not implement .focus on SVG elements, but the HTMLElement version works.
|
|
11
|
-
window.HTMLElement.prototype.focus.call(element);
|
|
12
|
-
}, 0);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=focus-svg-element.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"focus-svg-element.js","sourceRoot":"lib/default/","sources":["internal/utils/focus-svg-element.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,OAAmB;IACzD,IAAI,OAAO,CAAC,KAAK,EAAE;QACjB,OAAO,CAAC,KAAK,EAAE,CAAC;KACjB;SAAM;QACL,qHAAqH;QACrH,UAAU,CAAC,GAAG,EAAE;YACd,qFAAqF;YACrF,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACnD,CAAC,EAAE,CAAC,CAAC,CAAC;KACP;AACH,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport default function focusSvgElement(element: SVGElement) {\n if (element.focus) {\n element.focus();\n } else {\n // Deferring in a timeout because IE11 is not updating `tabIndex` and `focusable` attributes on time for some reason.\n setTimeout(() => {\n // IE11 does not implement .focus on SVG elements, but the HTMLElement version works.\n window.HTMLElement.prototype.focus.call(element);\n }, 0);\n }\n}\n"]}
|