@cloudscape-design/components 3.0.191 → 3.0.193

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.
@@ -2,65 +2,65 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "appbar": "awsui_appbar_hyvsj_geabg_93",
6
- "appbar-nav": "awsui_appbar-nav_hyvsj_geabg_117",
7
- "breadcrumbs": "awsui_breadcrumbs_hyvsj_geabg_121",
8
- "appbar-tools": "awsui_appbar-tools_hyvsj_geabg_125",
9
- "has-breadcrumbs": "awsui_has-breadcrumbs_hyvsj_geabg_166",
10
- "has-notifications-content": "awsui_has-notifications-content_hyvsj_geabg_173",
11
- "has-header": "awsui_has-header_hyvsj_geabg_179",
12
- "has-dynamic-overlap-height": "awsui_has-dynamic-overlap-height_hyvsj_geabg_179",
13
- "content-type-wizard": "awsui_content-type-wizard_hyvsj_geabg_180",
14
- "content-type-cards": "awsui_content-type-cards_hyvsj_geabg_183",
15
- "content-type-table": "awsui_content-type-table_hyvsj_geabg_184",
16
- "has-sticky-background": "awsui_has-sticky-background_hyvsj_geabg_187",
17
- "background": "awsui_background_hyvsj_geabg_221",
18
- "notifications-appbar-header": "awsui_notifications-appbar-header_hyvsj_geabg_224",
19
- "sticky-notifications": "awsui_sticky-notifications_hyvsj_geabg_236",
20
- "overlap": "awsui_overlap_hyvsj_geabg_242",
21
- "content": "awsui_content_hyvsj_geabg_180",
22
- "layout": "awsui_layout_hyvsj_geabg_333",
23
- "has-max-content-width": "awsui_has-max-content-width_hyvsj_geabg_415",
24
- "is-overlap-disabled": "awsui_is-overlap-disabled_hyvsj_geabg_442",
25
- "disable-body-scroll": "awsui_disable-body-scroll_hyvsj_geabg_445",
26
- "has-sticky-notifications": "awsui_has-sticky-notifications_hyvsj_geabg_449",
27
- "has-split-panel": "awsui_has-split-panel_hyvsj_geabg_463",
28
- "split-panel-position-bottom": "awsui_split-panel-position-bottom_hyvsj_geabg_463",
29
- "has-content-gap-left": "awsui_has-content-gap-left_hyvsj_geabg_475",
30
- "has-content-gap-right": "awsui_has-content-gap-right_hyvsj_geabg_478",
31
- "block-body-scroll": "awsui_block-body-scroll_hyvsj_geabg_493",
32
- "container": "awsui_container_hyvsj_geabg_501",
33
- "disable-content-paddings": "awsui_disable-content-paddings_hyvsj_geabg_527",
34
- "is-navigation-open": "awsui_is-navigation-open_hyvsj_geabg_532",
35
- "is-tools-open": "awsui_is-tools-open_hyvsj_geabg_535",
36
- "is-split-panel-open": "awsui_is-split-panel-open_hyvsj_geabg_535",
37
- "split-panel-position-side": "awsui_split-panel-position-side_hyvsj_geabg_535",
38
- "content-type-default": "awsui_content-type-default_hyvsj_geabg_555",
39
- "content-type-form": "awsui_content-type-form_hyvsj_geabg_555",
40
- "unfocusable": "awsui_unfocusable_hyvsj_geabg_596",
41
- "navigation-container": "awsui_navigation-container_hyvsj_geabg_604",
42
- "show-navigation": "awsui_show-navigation_hyvsj_geabg_639",
43
- "animating": "awsui_animating_hyvsj_geabg_661",
44
- "showButtons": "awsui_showButtons_hyvsj_geabg_1",
45
- "navigation": "awsui_navigation_hyvsj_geabg_604",
46
- "openNavigation": "awsui_openNavigation_hyvsj_geabg_1",
47
- "animated-content": "awsui_animated-content_hyvsj_geabg_722",
48
- "hide-navigation": "awsui_hide-navigation_hyvsj_geabg_731",
49
- "notifications": "awsui_notifications_hyvsj_geabg_224",
50
- "split-panel-bottom": "awsui_split-panel-bottom_hyvsj_geabg_796",
51
- "position-bottom": "awsui_position-bottom_hyvsj_geabg_842",
52
- "openSplitPanelBottom": "awsui_openSplitPanelBottom_hyvsj_geabg_1",
53
- "split-panel-side": "awsui_split-panel-side_hyvsj_geabg_871",
54
- "position-side": "awsui_position-side_hyvsj_geabg_899",
55
- "openSplitPanelSide": "awsui_openSplitPanelSide_hyvsj_geabg_1",
56
- "tools-container": "awsui_tools-container_hyvsj_geabg_936",
57
- "tools": "awsui_tools_hyvsj_geabg_936",
58
- "openTools": "awsui_openTools_hyvsj_geabg_1",
59
- "has-tools-form-persistence": "awsui_has-tools-form-persistence_hyvsj_geabg_1021",
60
- "hide-tools": "awsui_hide-tools_hyvsj_geabg_1031",
61
- "show-tools": "awsui_show-tools_hyvsj_geabg_1043",
62
- "has-tools-form": "awsui_has-tools-form_hyvsj_geabg_1021",
63
- "trigger": "awsui_trigger_hyvsj_geabg_1100",
64
- "selected": "awsui_selected_hyvsj_geabg_1139"
5
+ "appbar": "awsui_appbar_hyvsj_j35f2_93",
6
+ "appbar-nav": "awsui_appbar-nav_hyvsj_j35f2_117",
7
+ "breadcrumbs": "awsui_breadcrumbs_hyvsj_j35f2_121",
8
+ "appbar-tools": "awsui_appbar-tools_hyvsj_j35f2_125",
9
+ "has-breadcrumbs": "awsui_has-breadcrumbs_hyvsj_j35f2_166",
10
+ "has-notifications-content": "awsui_has-notifications-content_hyvsj_j35f2_173",
11
+ "has-header": "awsui_has-header_hyvsj_j35f2_179",
12
+ "has-dynamic-overlap-height": "awsui_has-dynamic-overlap-height_hyvsj_j35f2_179",
13
+ "content-type-wizard": "awsui_content-type-wizard_hyvsj_j35f2_180",
14
+ "content-type-cards": "awsui_content-type-cards_hyvsj_j35f2_183",
15
+ "content-type-table": "awsui_content-type-table_hyvsj_j35f2_184",
16
+ "has-sticky-background": "awsui_has-sticky-background_hyvsj_j35f2_187",
17
+ "background": "awsui_background_hyvsj_j35f2_221",
18
+ "notifications-appbar-header": "awsui_notifications-appbar-header_hyvsj_j35f2_224",
19
+ "sticky-notifications": "awsui_sticky-notifications_hyvsj_j35f2_236",
20
+ "overlap": "awsui_overlap_hyvsj_j35f2_242",
21
+ "content": "awsui_content_hyvsj_j35f2_180",
22
+ "layout": "awsui_layout_hyvsj_j35f2_333",
23
+ "has-max-content-width": "awsui_has-max-content-width_hyvsj_j35f2_415",
24
+ "is-overlap-disabled": "awsui_is-overlap-disabled_hyvsj_j35f2_442",
25
+ "disable-body-scroll": "awsui_disable-body-scroll_hyvsj_j35f2_445",
26
+ "has-sticky-notifications": "awsui_has-sticky-notifications_hyvsj_j35f2_449",
27
+ "has-split-panel": "awsui_has-split-panel_hyvsj_j35f2_463",
28
+ "split-panel-position-bottom": "awsui_split-panel-position-bottom_hyvsj_j35f2_463",
29
+ "has-content-gap-left": "awsui_has-content-gap-left_hyvsj_j35f2_475",
30
+ "has-content-gap-right": "awsui_has-content-gap-right_hyvsj_j35f2_478",
31
+ "block-body-scroll": "awsui_block-body-scroll_hyvsj_j35f2_493",
32
+ "container": "awsui_container_hyvsj_j35f2_501",
33
+ "disable-content-paddings": "awsui_disable-content-paddings_hyvsj_j35f2_527",
34
+ "is-navigation-open": "awsui_is-navigation-open_hyvsj_j35f2_532",
35
+ "is-tools-open": "awsui_is-tools-open_hyvsj_j35f2_535",
36
+ "is-split-panel-open": "awsui_is-split-panel-open_hyvsj_j35f2_535",
37
+ "split-panel-position-side": "awsui_split-panel-position-side_hyvsj_j35f2_535",
38
+ "content-type-default": "awsui_content-type-default_hyvsj_j35f2_555",
39
+ "content-type-form": "awsui_content-type-form_hyvsj_j35f2_555",
40
+ "unfocusable": "awsui_unfocusable_hyvsj_j35f2_596",
41
+ "navigation-container": "awsui_navigation-container_hyvsj_j35f2_606",
42
+ "show-navigation": "awsui_show-navigation_hyvsj_j35f2_641",
43
+ "animating": "awsui_animating_hyvsj_j35f2_663",
44
+ "showButtons": "awsui_showButtons_hyvsj_j35f2_1",
45
+ "navigation": "awsui_navigation_hyvsj_j35f2_606",
46
+ "openNavigation": "awsui_openNavigation_hyvsj_j35f2_1",
47
+ "animated-content": "awsui_animated-content_hyvsj_j35f2_724",
48
+ "hide-navigation": "awsui_hide-navigation_hyvsj_j35f2_733",
49
+ "notifications": "awsui_notifications_hyvsj_j35f2_224",
50
+ "split-panel-bottom": "awsui_split-panel-bottom_hyvsj_j35f2_798",
51
+ "position-bottom": "awsui_position-bottom_hyvsj_j35f2_844",
52
+ "openSplitPanelBottom": "awsui_openSplitPanelBottom_hyvsj_j35f2_1",
53
+ "split-panel-side": "awsui_split-panel-side_hyvsj_j35f2_873",
54
+ "position-side": "awsui_position-side_hyvsj_j35f2_901",
55
+ "openSplitPanelSide": "awsui_openSplitPanelSide_hyvsj_j35f2_1",
56
+ "tools-container": "awsui_tools-container_hyvsj_j35f2_938",
57
+ "tools": "awsui_tools_hyvsj_j35f2_938",
58
+ "openTools": "awsui_openTools_hyvsj_j35f2_1",
59
+ "has-tools-form-persistence": "awsui_has-tools-form-persistence_hyvsj_j35f2_1023",
60
+ "hide-tools": "awsui_hide-tools_hyvsj_j35f2_1033",
61
+ "show-tools": "awsui_show-tools_hyvsj_j35f2_1045",
62
+ "has-tools-form": "awsui_has-tools-form_hyvsj_j35f2_1023",
63
+ "trigger": "awsui_trigger_hyvsj_j35f2_1102",
64
+ "selected": "awsui_selected_hyvsj_j35f2_1141"
65
65
  };
66
66
 
@@ -1 +1 @@
1
- {"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../../../../src/breadcrumb-group/item/item.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AA0G1E,wBAAgB,cAAc,CAAC,CAAC,SAAS,oBAAoB,CAAC,IAAI,EAAE,EAClE,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,WAAW,EACX,MAAc,EACd,YAAoB,GACrB,EAAE,mBAAmB,CAAC,CAAC,CAAC,eAqCxB"}
1
+ {"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../../../../src/breadcrumb-group/item/item.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AA2H1E,wBAAgB,cAAc,CAAC,CAAC,SAAS,oBAAoB,CAAC,IAAI,EAAE,EAClE,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,WAAW,EACX,MAAc,EACd,YAAoB,GACrB,EAAE,mBAAmB,CAAC,CAAC,CAAC,eAyCxB"}
@@ -14,7 +14,7 @@ import PopoverBody from '../../popover/body';
14
14
  import Portal from '../../internal/components/portal';
15
15
  import popoverStyles from '../../popover/styles.css.js';
16
16
  var BreadcrumbItemWithPopover = function (_a) {
17
- var item = _a.item, anchorAttributes = __rest(_a, ["item"]);
17
+ var item = _a.item, isLast = _a.isLast, anchorAttributes = _a.anchorAttributes, itemAttributes = __rest(_a, ["item", "isLast", "anchorAttributes"]);
18
18
  var focusVisible = useFocusVisible();
19
19
  var _b = useState(false), showPopover = _b[0], setShowPopover = _b[1];
20
20
  var textRef = useRef(null);
@@ -50,15 +50,19 @@ var BreadcrumbItemWithPopover = function (_a) {
50
50
  };
51
51
  }, [showPopover]);
52
52
  return (React.createElement(React.Fragment, null,
53
- React.createElement("a", __assign({}, focusVisible, anchorAttributes, { onFocus: function () {
53
+ React.createElement(Item, __assign({ isLast: isLast }, itemAttributes, { onFocus: function () {
54
54
  isTruncated(textRef, virtualTextRef) && setShowPopover(true);
55
55
  }, onBlur: function () { return setShowPopover(false); }, onMouseEnter: function () {
56
56
  isTruncated(textRef, virtualTextRef) && setShowPopover(true);
57
- }, onMouseLeave: function () { return setShowPopover(false); } }),
57
+ }, onMouseLeave: function () { return setShowPopover(false); }, anchorAttributes: __assign(__assign({}, focusVisible), anchorAttributes) }),
58
58
  React.createElement("span", { className: styles.text, ref: textRef }, item.text),
59
59
  React.createElement("span", { className: styles['virtual-item'], ref: virtualTextRef }, item.text)),
60
60
  showPopover && popoverContent));
61
61
  };
62
+ var Item = function (_a) {
63
+ var anchorAttributes = _a.anchorAttributes, children = _a.children, isLast = _a.isLast, itemAttributes = __rest(_a, ["anchorAttributes", "children", "isLast"]);
64
+ return isLast ? (React.createElement("span", __assign({}, itemAttributes), children)) : (React.createElement("a", __assign({}, itemAttributes, anchorAttributes), children));
65
+ };
62
66
  export function BreadcrumbItem(_a) {
63
67
  var _b;
64
68
  var item = _a.item, onClick = _a.onClick, onFollow = _a.onFollow, isDisplayed = _a.isDisplayed, _c = _a.isLast, isLast = _c === void 0 ? false : _c, _d = _a.isCompressed, isCompressed = _d === void 0 ? false : _d;
@@ -70,17 +74,16 @@ export function BreadcrumbItem(_a) {
70
74
  }
71
75
  fireCancelableEvent(onClick, getEventDetail(item), event);
72
76
  };
77
+ var itemAttributes = {
78
+ className: clsx(styles.anchor, (_b = {}, _b[styles.compressed] = isCompressed, _b))
79
+ };
73
80
  var anchorAttributes = {
74
- href: isLast ? undefined : item.href || '#',
75
- className: clsx(styles.anchor, (_b = {}, _b[styles.compressed] = isCompressed, _b)),
76
- 'aria-current': isLast ? 'page' : undefined,
77
- 'aria-disabled': isLast && 'true',
78
- onClick: isLast ? preventDefault : onClickHandler,
79
- tabIndex: isLast ? 0 : undefined
81
+ href: item.href || '#',
82
+ onClick: isLast ? preventDefault : onClickHandler
80
83
  };
81
84
  return (React.createElement(React.Fragment, null,
82
85
  React.createElement("div", { className: clsx(styles.breadcrumb, isLast && styles.last) },
83
- isDisplayed && isCompressed ? (React.createElement(BreadcrumbItemWithPopover, __assign({ item: item }, anchorAttributes))) : (React.createElement("a", __assign({}, focusVisible, anchorAttributes),
86
+ isDisplayed && isCompressed ? (React.createElement(BreadcrumbItemWithPopover, __assign({ item: item, isLast: isLast, anchorAttributes: anchorAttributes }, itemAttributes))) : (React.createElement(Item, __assign({ isLast: isLast, anchorAttributes: __assign(__assign({}, anchorAttributes), focusVisible) }, itemAttributes),
84
87
  React.createElement("span", { className: styles.text }, item.text))),
85
88
  !isLast ? (React.createElement("span", { className: styles.icon },
86
89
  React.createElement(InternalIcon, { name: "angle-right" }))) : null)));
@@ -1 +1 @@
1
- {"version":3,"file":"item.js","sourceRoot":"","sources":["../../../../src/breadcrumb-group/item/item.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,YAAY,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;IAEF,IAAM,gBAAgB,GAAkD;QACtE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG;QAC3C,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,YAAI,GAAC,MAAM,CAAC,UAAU,IAAG,YAAY,MAAG;QACrE,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;QAC3C,eAAe,EAAE,MAAM,IAAI,MAAM;QACjC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,cAAc;QACjD,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;KACjC,CAAC;IAEF,OAAO,CACL;QACE,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC;YAC3D,WAAW,IAAI,YAAY,CAAC,CAAC,CAAC,CAC7B,oBAAC,yBAAyB,aAAC,IAAI,EAAE,IAAI,IAAM,gBAAgB,EAAI,CAChE,CAAC,CAAC,CAAC,CACF,sCAAO,YAAY,EAAM,gBAAgB;gBACvC,8BAAM,SAAS,EAAE,MAAM,CAAC,IAAI,IAAG,IAAI,CAAC,IAAI,CAAQ,CAC9C,CACL;YACA,CAAC,MAAM,CAAC,CAAC,CAAC,CACT,8BAAM,SAAS,EAAE,MAAM,CAAC,IAAI;gBAC1B,oBAAC,YAAY,IAAC,IAAI,EAAC,aAAa,GAAG,CAC9B,CACR,CAAC,CAAC,CAAC,IAAI,CACJ,CACL,CACJ,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef, useState } from 'react';\nimport { BreadcrumbGroupProps, BreadcrumbItemProps } from '../interfaces';\nimport InternalIcon from '../../icon/internal';\nimport styles from './styles.css.js';\nimport clsx from 'clsx';\nimport useFocusVisible from '../../internal/hooks/focus-visible';\nimport { fireCancelableEvent, isPlainLeftClick } from '../../internal/events';\nimport { getEventDetail } from '../internal';\nimport { Transition } from '../../internal/components/transition';\nimport PopoverContainer from '../../popover/container';\nimport PopoverBody from '../../popover/body';\nimport Portal from '../../internal/components/portal';\nimport popoverStyles from '../../popover/styles.css.js';\n\ntype BreadcrumbItemWithPopoverProps<T extends BreadcrumbGroupProps.Item> =\n React.AnchorHTMLAttributes<HTMLAnchorElement> & {\n item: T;\n };\n\nconst BreadcrumbItemWithPopover = <T extends BreadcrumbGroupProps.Item>({\n item,\n ...anchorAttributes\n}: BreadcrumbItemWithPopoverProps<T>) => {\n const focusVisible = useFocusVisible();\n const [showPopover, setShowPopover] = useState(false);\n const textRef = useRef<HTMLElement>(null);\n const virtualTextRef = useRef<HTMLElement>(null);\n\n const isTruncated = (textRef: React.RefObject<HTMLElement>, virtualTextRef: React.RefObject<HTMLElement>) => {\n if (!textRef || !virtualTextRef || !textRef.current || !virtualTextRef.current) {\n return false;\n }\n const virtualTextWidth = virtualTextRef.current.getBoundingClientRect().width;\n const textWidth = textRef.current.getBoundingClientRect().width;\n if (virtualTextWidth > textWidth) {\n return true;\n }\n return false;\n };\n\n const popoverContent = (\n <Portal>\n <div className={styles['item-popover']}>\n <Transition in={true}>\n {() => (\n <PopoverContainer\n trackRef={textRef}\n size=\"small\"\n fixedWidth={false}\n position=\"bottom\"\n arrow={position => (\n <div className={clsx(popoverStyles.arrow, popoverStyles[`arrow-position-${position}`])}>\n <div className={popoverStyles['arrow-outer']} />\n <div className={popoverStyles['arrow-inner']} />\n </div>\n )}\n >\n <PopoverBody dismissButton={false} dismissAriaLabel={undefined} onDismiss={() => {}} header={undefined}>\n {item.text}\n </PopoverBody>\n </PopoverContainer>\n )}\n </Transition>\n </div>\n </Portal>\n );\n\n useEffect(() => {\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n setShowPopover(false);\n }\n };\n if (showPopover) {\n document.addEventListener('keydown', onKeyDown);\n }\n return () => {\n document.removeEventListener('keydown', onKeyDown);\n };\n }, [showPopover]);\n\n return (\n <>\n <a\n {...focusVisible}\n {...anchorAttributes}\n onFocus={() => {\n isTruncated(textRef, virtualTextRef) && setShowPopover(true);\n }}\n onBlur={() => setShowPopover(false)}\n onMouseEnter={() => {\n isTruncated(textRef, virtualTextRef) && setShowPopover(true);\n }}\n onMouseLeave={() => setShowPopover(false)}\n >\n <span className={styles.text} ref={textRef}>\n {item.text}\n </span>\n <span className={styles['virtual-item']} ref={virtualTextRef}>\n {item.text}\n </span>\n </a>\n {showPopover && popoverContent}\n </>\n );\n};\n\nexport function BreadcrumbItem<T extends BreadcrumbGroupProps.Item>({\n item,\n onClick,\n onFollow,\n isDisplayed,\n isLast = false,\n isCompressed = false,\n}: BreadcrumbItemProps<T>) {\n const focusVisible = useFocusVisible();\n const preventDefault = (event: React.MouseEvent) => event.preventDefault();\n const onClickHandler = (event: React.MouseEvent) => {\n if (isPlainLeftClick(event)) {\n fireCancelableEvent(onFollow, getEventDetail(item), event);\n }\n fireCancelableEvent(onClick, getEventDetail(item), event);\n };\n\n const anchorAttributes: React.AnchorHTMLAttributes<HTMLAnchorElement> = {\n href: isLast ? undefined : item.href || '#',\n className: clsx(styles.anchor, { [styles.compressed]: isCompressed }),\n 'aria-current': isLast ? 'page' : undefined, // Active breadcrumb item is implemented according to WAI-ARIA 1.1\n 'aria-disabled': isLast && 'true',\n onClick: isLast ? preventDefault : onClickHandler,\n tabIndex: isLast ? 0 : undefined, // tabIndex is added to the last crumb to keep it in the index without an href\n };\n\n return (\n <>\n <div className={clsx(styles.breadcrumb, isLast && styles.last)}>\n {isDisplayed && isCompressed ? (\n <BreadcrumbItemWithPopover item={item} {...anchorAttributes} />\n ) : (\n <a {...focusVisible} {...anchorAttributes}>\n <span className={styles.text}>{item.text}</span>\n </a>\n )}\n {!isLast ? (\n <span className={styles.icon}>\n <InternalIcon name=\"angle-right\" />\n </span>\n ) : null}\n </div>\n </>\n );\n}\n"]}
1
+ {"version":3,"file":"item.js","sourceRoot":"","sources":["../../../../src/breadcrumb-group/item/item.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,YAAY,MAAM,qBAAqB,CAAC;AAC/C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,eAAe,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,gBAAgB,MAAM,yBAAyB,CAAC;AACvD,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAC7C,OAAO,MAAM,MAAM,kCAAkC,CAAC;AACtD,OAAO,aAAa,MAAM,6BAA6B,CAAC;AAQxD,IAAM,yBAAyB,GAAG,UAAsC,EAKpC;IAJlC,IAAA,IAAI,UAAA,EACJ,MAAM,YAAA,EACN,gBAAgB,sBAAA,EACb,cAAc,cAJqD,sCAKvE,CADkB;IAEjB,IAAM,YAAY,GAAG,eAAe,EAAE,CAAC;IACjC,IAAA,KAAgC,QAAQ,CAAC,KAAK,CAAC,EAA9C,WAAW,QAAA,EAAE,cAAc,QAAmB,CAAC;IACtD,IAAM,OAAO,GAAG,MAAM,CAAc,IAAI,CAAC,CAAC;IAC1C,IAAM,cAAc,GAAG,MAAM,CAAc,IAAI,CAAC,CAAC;IAEjD,IAAM,WAAW,GAAG,UAAC,OAAqC,EAAE,cAA4C;QACtG,IAAI,CAAC,OAAO,IAAI,CAAC,cAAc,IAAI,CAAC,OAAO,CAAC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IAC9B,cAAc,EAClB,CACH,CAAC,CAAC,CAAC,CACF,oBAAC,IAAI,aAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,wBAAO,gBAAgB,GAAK,YAAY,KAAQ,cAAc;gBAClG,8BAAM,SAAS,EAAE,MAAM,CAAC,IAAI,IAAG,IAAI,CAAC,IAAI,CAAQ,CAC3C,CACR;YACA,CAAC,MAAM,CAAC,CAAC,CAAC,CACT,8BAAM,SAAS,EAAE,MAAM,CAAC,IAAI;gBAC1B,oBAAC,YAAY,IAAC,IAAI,EAAC,aAAa,GAAG,CAC9B,CACR,CAAC,CAAC,CAAC,IAAI,CACJ,CACL,CACJ,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef, useState } from 'react';\nimport { BreadcrumbGroupProps, BreadcrumbItemProps } from '../interfaces';\nimport InternalIcon from '../../icon/internal';\nimport styles from './styles.css.js';\nimport clsx from 'clsx';\nimport useFocusVisible from '../../internal/hooks/focus-visible';\nimport { fireCancelableEvent, isPlainLeftClick } from '../../internal/events';\nimport { getEventDetail } from '../internal';\nimport { Transition } from '../../internal/components/transition';\nimport PopoverContainer from '../../popover/container';\nimport PopoverBody from '../../popover/body';\nimport Portal from '../../internal/components/portal';\nimport popoverStyles from '../../popover/styles.css.js';\n\ntype BreadcrumbItemWithPopoverProps<T extends BreadcrumbGroupProps.Item> = React.HTMLAttributes<HTMLElement> & {\n item: T;\n isLast: boolean;\n anchorAttributes: React.AnchorHTMLAttributes<HTMLAnchorElement>;\n};\n\nconst BreadcrumbItemWithPopover = <T extends BreadcrumbGroupProps.Item>({\n item,\n isLast,\n anchorAttributes,\n ...itemAttributes\n}: BreadcrumbItemWithPopoverProps<T>) => {\n const focusVisible = useFocusVisible();\n const [showPopover, setShowPopover] = useState(false);\n const textRef = useRef<HTMLElement>(null);\n const virtualTextRef = useRef<HTMLElement>(null);\n\n const isTruncated = (textRef: React.RefObject<HTMLElement>, virtualTextRef: React.RefObject<HTMLElement>) => {\n if (!textRef || !virtualTextRef || !textRef.current || !virtualTextRef.current) {\n return false;\n }\n const virtualTextWidth = virtualTextRef.current.getBoundingClientRect().width;\n const textWidth = textRef.current.getBoundingClientRect().width;\n if (virtualTextWidth > textWidth) {\n return true;\n }\n return false;\n };\n\n const popoverContent = (\n <Portal>\n <div className={styles['item-popover']}>\n <Transition in={true}>\n {() => (\n <PopoverContainer\n trackRef={textRef}\n size=\"small\"\n fixedWidth={false}\n position=\"bottom\"\n arrow={position => (\n <div className={clsx(popoverStyles.arrow, popoverStyles[`arrow-position-${position}`])}>\n <div className={popoverStyles['arrow-outer']} />\n <div className={popoverStyles['arrow-inner']} />\n </div>\n )}\n >\n <PopoverBody dismissButton={false} dismissAriaLabel={undefined} onDismiss={() => {}} header={undefined}>\n {item.text}\n </PopoverBody>\n </PopoverContainer>\n )}\n </Transition>\n </div>\n </Portal>\n );\n\n useEffect(() => {\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n setShowPopover(false);\n }\n };\n if (showPopover) {\n document.addEventListener('keydown', onKeyDown);\n }\n return () => {\n document.removeEventListener('keydown', onKeyDown);\n };\n }, [showPopover]);\n\n return (\n <>\n <Item\n isLast={isLast}\n {...itemAttributes}\n onFocus={() => {\n isTruncated(textRef, virtualTextRef) && setShowPopover(true);\n }}\n onBlur={() => setShowPopover(false)}\n onMouseEnter={() => {\n isTruncated(textRef, virtualTextRef) && setShowPopover(true);\n }}\n onMouseLeave={() => setShowPopover(false)}\n anchorAttributes={{ ...focusVisible, ...anchorAttributes }}\n >\n <span className={styles.text} ref={textRef}>\n {item.text}\n </span>\n <span className={styles['virtual-item']} ref={virtualTextRef}>\n {item.text}\n </span>\n </Item>\n {showPopover && popoverContent}\n </>\n );\n};\n\ntype ItemProps = React.HTMLAttributes<HTMLElement> & {\n anchorAttributes: React.AnchorHTMLAttributes<HTMLAnchorElement>;\n isLast: boolean;\n};\nconst Item = ({ anchorAttributes, children, isLast, ...itemAttributes }: ItemProps) =>\n isLast ? (\n <span {...itemAttributes}>{children}</span>\n ) : (\n <a {...itemAttributes} {...anchorAttributes}>\n {children}\n </a>\n );\n\nexport function BreadcrumbItem<T extends BreadcrumbGroupProps.Item>({\n item,\n onClick,\n onFollow,\n isDisplayed,\n isLast = false,\n isCompressed = false,\n}: BreadcrumbItemProps<T>) {\n const focusVisible = useFocusVisible();\n const preventDefault = (event: React.MouseEvent) => event.preventDefault();\n const onClickHandler = (event: React.MouseEvent) => {\n if (isPlainLeftClick(event)) {\n fireCancelableEvent(onFollow, getEventDetail(item), event);\n }\n fireCancelableEvent(onClick, getEventDetail(item), event);\n };\n\n const itemAttributes: React.HTMLAttributes<HTMLElement> = {\n className: clsx(styles.anchor, { [styles.compressed]: isCompressed }),\n };\n const anchorAttributes: React.AnchorHTMLAttributes<HTMLAnchorElement> = {\n href: item.href || '#',\n onClick: isLast ? preventDefault : onClickHandler,\n };\n\n return (\n <>\n <div className={clsx(styles.breadcrumb, isLast && styles.last)}>\n {isDisplayed && isCompressed ? (\n <BreadcrumbItemWithPopover\n item={item}\n isLast={isLast}\n anchorAttributes={anchorAttributes}\n {...itemAttributes}\n />\n ) : (\n <Item isLast={isLast} anchorAttributes={{ ...anchorAttributes, ...focusVisible }} {...itemAttributes}>\n <span className={styles.text}>{item.text}</span>\n </Item>\n )}\n {!isLast ? (\n <span className={styles.icon}>\n <InternalIcon name=\"angle-right\" />\n </span>\n ) : null}\n </div>\n </>\n );\n}\n"]}
@@ -1,6 +1,6 @@
1
1
 
2
2
  export var PACKAGE_SOURCE = 'components';
3
- export var PACKAGE_VERSION = '3.0.0 (300e529)';
3
+ export var PACKAGE_VERSION = '3.0.0 (112a9cb)';
4
4
  export var THEME = 'open-source-visual-refresh';
5
5
  export var ALWAYS_VISUAL_REFRESH = true;
6
6
 
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "300e529ecf45ff1016071e6ae8987c03bdd8aa65"
2
+ "commit": "112a9cb1382bfe37cea72b72462d5b0140bcb3a3"
3
3
  }
package/package.json CHANGED
@@ -81,7 +81,7 @@
81
81
  "./internal/base-component/index.js",
82
82
  "./internal/base-component/styles.css.js"
83
83
  ],
84
- "version": "3.0.191",
84
+ "version": "3.0.193",
85
85
  "repository": {
86
86
  "type": "git",
87
87
  "url": "https://github.com/cloudscape-design/components.git"
@@ -3,16 +3,18 @@ import ButtonDropdownWrapper from '../button-dropdown';
3
3
  export default class BreadcrumbGroupWrapper extends ComponentWrapper {
4
4
  static rootSelector: string;
5
5
  /**
6
- * Returns all links.
6
+ * Returns all breadcrumb items. Note that this includes the 'current' page item for backwards compatibility,
7
+ * even though it is not technically a link.
7
8
  *
8
- * To find a specific link use the `findBreadcrumbLink(n)` function as chaining `findBreadcrumbLinks().get(n)` can return unexpected results.
9
+ * To find a specific item use the `findBreadcrumbLink(n)` function as chaining `findBreadcrumbLinks().get(n)` can return unexpected results.
9
10
  * @see findBreadcrumbLink
10
11
  */
11
12
  findBreadcrumbLinks(): Array<ElementWrapper>;
12
13
  /**
13
- * Returns a link for a given index.
14
+ * Returns an item for a given index. Note that this may return the 'current' page item for backwards compatibility,
15
+ * even though it is not technically a link.
14
16
  *
15
- * @param index 1-based link index
17
+ * @param index 1-based item index
16
18
  */
17
19
  findBreadcrumbLink(index: number): ElementWrapper | null;
18
20
  findDropdown(): ButtonDropdownWrapper | null;
@@ -28,18 +28,20 @@ var BreadcrumbGroupWrapper = /** @class */ (function (_super) {
28
28
  return _super !== null && _super.apply(this, arguments) || this;
29
29
  }
30
30
  /**
31
- * Returns all links.
31
+ * Returns all breadcrumb items. Note that this includes the 'current' page item for backwards compatibility,
32
+ * even though it is not technically a link.
32
33
  *
33
- * To find a specific link use the `findBreadcrumbLink(n)` function as chaining `findBreadcrumbLinks().get(n)` can return unexpected results.
34
+ * To find a specific item use the `findBreadcrumbLink(n)` function as chaining `findBreadcrumbLinks().get(n)` can return unexpected results.
34
35
  * @see findBreadcrumbLink
35
36
  */
36
37
  BreadcrumbGroupWrapper.prototype.findBreadcrumbLinks = function () {
37
- return this.findAll(".".concat(styles_selectors_js_2.default.breadcrumb, " a"));
38
+ return this.findAll(".".concat(styles_selectors_js_2.default.breadcrumb, " .").concat(styles_selectors_js_2.default.anchor));
38
39
  };
39
40
  /**
40
- * Returns a link for a given index.
41
+ * Returns an item for a given index. Note that this may return the 'current' page item for backwards compatibility,
42
+ * even though it is not technically a link.
41
43
  *
42
- * @param index 1-based link index
44
+ * @param index 1-based item index
43
45
  */
44
46
  BreadcrumbGroupWrapper.prototype.findBreadcrumbLink = function (index) {
45
47
  // We insert the breadcrumb-ellipsis as the second element so we have to filter it out.
@@ -48,7 +50,7 @@ var BreadcrumbGroupWrapper = /** @class */ (function (_super) {
48
50
  if (index > 1) {
49
51
  index++;
50
52
  }
51
- return this.find(".".concat(styles_selectors_js_1.default.item, ":nth-child(").concat(index, ") a"));
53
+ return this.find(".".concat(styles_selectors_js_1.default.item, ":nth-child(").concat(index, ") .").concat(styles_selectors_js_2.default.anchor));
52
54
  };
53
55
  BreadcrumbGroupWrapper.prototype.findDropdown = function () {
54
56
  var buttonDropdown = this.find(".".concat(styles_selectors_js_3.default['button-dropdown']));
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/dom/breadcrumb-group/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,8DAA0F;AAC1F,sDAAuD;AACvD,qFAAmE;AACnE,0FAA4E;AAC5E,oFAAgF;AAEhF;IAAoD,0CAAgB;IAApE;;IA8BA,CAAC;IA5BC;;;;;OAKG;IACH,oDAAmB,GAAnB;QACE,OAAO,IAAI,CAAC,OAAO,CAAC,WAAI,6BAAU,CAAC,UAAU,OAAI,CAAC,CAAC;IACrD,CAAC;IACD;;;;OAIG;IACH,mDAAkB,GAAlB,UAAmB,KAAa;QAC9B,uFAAuF;Q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AC;IAED,6CAAY,GAAZ;QACE,IAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,WAAI,6BAAoB,CAAC,iBAAiB,CAAC,CAAE,CAAC,CAAC;QAChF,OAAO,cAAc,IAAI,IAAI,yBAAqB,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC,CAAC;IAClF,CAAC;IA9BM,mCAAY,GAAW,6BAAM,CAAC,kBAAkB,CAAC,CAAC;IA+B3D,6BAAC;CAAA,AAhCD,CAAoD,sBAAgB,GAgCnE;kBAhCoB,sBAAsB"}
@@ -3,16 +3,18 @@ import ButtonDropdownWrapper from '../button-dropdown';
3
3
  export default class BreadcrumbGroupWrapper extends ComponentWrapper {
4
4
  static rootSelector: string;
5
5
  /**
6
- * Returns all links.
6
+ * Returns all breadcrumb items. Note that this includes the 'current' page item for backwards compatibility,
7
+ * even though it is not technically a link.
7
8
  *
8
- * To find a specific link use the `findBreadcrumbLink(n)` function as chaining `findBreadcrumbLinks().get(n)` can return unexpected results.
9
+ * To find a specific item use the `findBreadcrumbLink(n)` function as chaining `findBreadcrumbLinks().get(n)` can return unexpected results.
9
10
  * @see findBreadcrumbLink
10
11
  */
11
12
  findBreadcrumbLinks(): import("@cloudscape-design/test-utils-core/selectors").MultiElementWrapper<ElementWrapper>;
12
13
  /**
13
- * Returns a link for a given index.
14
+ * Returns an item for a given index. Note that this may return the 'current' page item for backwards compatibility,
15
+ * even though it is not technically a link.
14
16
  *
15
- * @param index 1-based link index
17
+ * @param index 1-based item index
16
18
  */
17
19
  findBreadcrumbLink(index: number): ElementWrapper;
18
20
  findDropdown(): ButtonDropdownWrapper;
@@ -28,18 +28,20 @@ var BreadcrumbGroupWrapper = /** @class */ (function (_super) {
28
28
  return _super !== null && _super.apply(this, arguments) || this;
29
29
  }
30
30
  /**
31
- * Returns all links.
31
+ * Returns all breadcrumb items. Note that this includes the 'current' page item for backwards compatibility,
32
+ * even though it is not technically a link.
32
33
  *
33
- * To find a specific link use the `findBreadcrumbLink(n)` function as chaining `findBreadcrumbLinks().get(n)` can return unexpected results.
34
+ * To find a specific item use the `findBreadcrumbLink(n)` function as chaining `findBreadcrumbLinks().get(n)` can return unexpected results.
34
35
  * @see findBreadcrumbLink
35
36
  */
36
37
  BreadcrumbGroupWrapper.prototype.findBreadcrumbLinks = function () {
37
- return this.findAll(".".concat(styles_selectors_js_2.default.breadcrumb, " a"));
38
+ return this.findAll(".".concat(styles_selectors_js_2.default.breadcrumb, " .").concat(styles_selectors_js_2.default.anchor));
38
39
  };
39
40
  /**
40
- * Returns a link for a given index.
41
+ * Returns an item for a given index. Note that this may return the 'current' page item for backwards compatibility,
42
+ * even though it is not technically a link.
41
43
  *
42
- * @param index 1-based link index
44
+ * @param index 1-based item index
43
45
  */
44
46
  BreadcrumbGroupWrapper.prototype.findBreadcrumbLink = function (index) {
45
47
  // We insert the breadcrumb-ellipsis as the second element so we have to filter it out.
@@ -48,7 +50,7 @@ var BreadcrumbGroupWrapper = /** @class */ (function (_super) {
48
50
  if (index > 1) {
49
51
  index++;
50
52
  }
51
- return this.find(".".concat(styles_selectors_js_1.default.item, ":nth-child(").concat(index, ") a"));
53
+ return this.find(".".concat(styles_selectors_js_1.default.item, ":nth-child(").concat(index, ") .").concat(styles_selectors_js_2.default.anchor));
52
54
  };
53
55
  BreadcrumbGroupWrapper.prototype.findDropdown = function () {
54
56
  var buttonDropdown = this.find(".".concat(styles_selectors_js_3.default['button-dropdown']));
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/selectors/breadcrumb-group/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,0EAAgG;AAChG,sDAAuD;AACvD,qFAAmE;AACnE,0FAA4E;AAC5E,oFAAgF;AAChF;IAAoD,0CAAgB;IAApE;;IA6BA,CAAC;IA3BC;;;;;OAKG;IACH,oDAAmB,GAAnB;QACE,OAAO,IAAI,CAAC,OAAO,CAAC,WAAI,6BAAU,CAAC,UAAU,OAAI,CAAC,CAAC;IACrD,CAAC;IACD;;;;OAIG;IACH,mDAAkB,GAAlB,UAAmB,KAAa;QAC9B,uFAAuF;QACvF,oFAAoF;QACpF,mJAAmJ;QACnJ,IAAI,KAAK,GAAG,CAAC,EAAE;YACb,KAAK,EAAE,CAAC;SACT;QACD,OAAO,IAAI,CAAC,IAAI,CAAC,WAAI,6BAAM,CAAC,IAAI,wBAAc,KAAK,QAAK,CAAC,CAAC;IAC5D,CAAC;IACD,6CAAY,GAAZ;QACE,IAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,WAAI,6BAAoB,CAAC,iBAAiB,CAAC,CAAE,CAAC,CAAC;QAChF,OAAO,cAAc,IAAI,IAAI,yBAAqB,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC,CAAC;IAClF,CAAC;IA3BM,mCAAY,GAAW,6BAAM,CAAC,kBAAkB,CAAC,CAAC;IA4B3D,6BAAC;CAAA,AA7BD,CAAoD,4BAAgB,GA6BnE;kBA7BoB,sBAAsB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/selectors/breadcrumb-group/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,0EAAgG;AAChG,sDAAuD;AACvD,qFAAmE;AACnE,0FAA4E;AAC5E,oFAAgF;AAChF;IAAoD,0CAAgB;IAApE;;IA+BA,CAAC;IA7BC;;;;;;OAMG;IACH,oDAAmB,GAAnB;QACE,OAAO,IAAI,CAAC,OAAO,CAAC,WAAI,6BAAU,CAAC,UAAU,eAAK,6BAAU,CAAC,MAAM,CAAE,CAAC,CAAC;IACzE,CAAC;IACD;;;;;OAKG;IACH,mDAAkB,GAAlB,UAAmB,KAAa;QAC9B,uFAAuF;QACvF,oFAAoF;QACpF,mJAAmJ;QACnJ,IAAI,KAAK,GAAG,CAAC,EAAE;YACb,KAAK,EAAE,CAAC;SACT;QACD,OAAO,IAAI,CAAC,IAAI,CAAC,WAAI,6BAAM,CAAC,IAAI,wBAAc,KAAK,gBAAM,6BAAU,CAAC,MAAM,CAAE,CAAC,CAAC;IAChF,CAAC;IACD,6CAAY,GAAZ;QACE,IAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,WAAI,6BAAoB,CAAC,iBAAiB,CAAC,CAAE,CAAC,CAAC;QAChF,OAAO,cAAc,IAAI,IAAI,yBAAqB,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC,CAAC;IAClF,CAAC;IA7BM,mCAAY,GAAW,6BAAM,CAAC,kBAAkB,CAAC,CAAC;IA8B3D,6BAAC;CAAA,AA/BD,CAAoD,4BAAgB,GA+BnE;kBA/BoB,sBAAsB"}