@cloudscape-design/components 3.0.406 → 3.0.408
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/app-layout/visual-refresh/drawers.d.ts.map +1 -1
- package/app-layout/visual-refresh/drawers.js +0 -2
- package/app-layout/visual-refresh/drawers.js.map +1 -1
- package/app-layout/visual-refresh/styles.css.js +77 -77
- package/app-layout/visual-refresh/styles.scoped.css +165 -210
- package/app-layout/visual-refresh/styles.selectors.js +77 -77
- package/breadcrumb-group/internal.d.ts.map +1 -1
- package/breadcrumb-group/internal.js +2 -1
- package/breadcrumb-group/internal.js.map +1 -1
- package/breadcrumb-group/item/item.d.ts.map +1 -1
- package/breadcrumb-group/item/item.js +8 -8
- package/breadcrumb-group/item/item.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/header/styles.css.js +34 -33
- package/header/styles.scoped.css +53 -49
- package/header/styles.selectors.js +34 -33
- package/icon/icons.js +1 -1
- package/internal/environment.js +1 -1
- package/internal/environment.json +1 -1
- package/internal/manifest.json +1 -1
- package/package.json +1 -1
- package/property-filter/controller.d.ts +3 -4
- package/property-filter/controller.d.ts.map +1 -1
- package/property-filter/controller.js +7 -10
- package/property-filter/controller.js.map +1 -1
- package/property-filter/index.d.ts.map +1 -1
- package/property-filter/index.js +48 -37
- package/property-filter/index.js.map +1 -1
- package/property-filter/interfaces.d.ts +10 -1
- package/property-filter/interfaces.d.ts.map +1 -1
- package/property-filter/interfaces.js.map +1 -1
- package/property-filter/token-editor.d.ts +4 -4
- package/property-filter/token-editor.d.ts.map +1 -1
- package/property-filter/token-editor.js +25 -20
- package/property-filter/token-editor.js.map +1 -1
- package/property-filter/token.d.ts +4 -4
- package/property-filter/token.d.ts.map +1 -1
- package/property-filter/token.js +6 -5
- package/property-filter/token.js.map +1 -1
- package/property-filter/utils.d.ts +4 -5
- package/property-filter/utils.d.ts.map +1 -1
- package/property-filter/utils.js +11 -16
- package/property-filter/utils.js.map +1 -1
|
@@ -2,82 +2,82 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"background": "
|
|
6
|
-
"scrolling-background": "awsui_scrolling-
|
|
7
|
-
"sticky-background": "awsui_sticky-
|
|
8
|
-
"has-sticky-notifications": "awsui_has-sticky-
|
|
9
|
-
"breadcrumbs": "
|
|
10
|
-
"has-sticky-background": "awsui_has-sticky-
|
|
11
|
-
"drawers-container": "awsui_drawers-
|
|
12
|
-
"has-open-drawer": "awsui_has-open-
|
|
13
|
-
"disable-body-scroll": "awsui_disable-body-
|
|
14
|
-
"drawers-desktop-triggers-container": "awsui_drawers-desktop-triggers-
|
|
15
|
-
"has-multiple-triggers": "awsui_has-multiple-
|
|
16
|
-
"drawers-mobile-triggers-container": "awsui_drawers-mobile-triggers-
|
|
17
|
-
"drawers-trigger-content": "awsui_drawers-trigger-
|
|
18
|
-
"drawers-trigger-overflow": "awsui_drawers-trigger-
|
|
19
|
-
"drawers-trigger": "awsui_drawers-
|
|
20
|
-
"drawer": "
|
|
21
|
-
"drawer-content-container": "awsui_drawer-content-
|
|
22
|
-
"drawer-close-button": "awsui_drawer-close-
|
|
23
|
-
"drawer-content": "awsui_drawer-
|
|
24
|
-
"drawer-content-hidden": "awsui_drawer-content-
|
|
25
|
-
"drawer-slider": "awsui_drawer-
|
|
26
|
-
"is-drawer-open": "awsui_is-drawer-
|
|
27
|
-
"content": "
|
|
28
|
-
"layout": "
|
|
29
|
-
"has-max-content-width": "awsui_has-max-content-
|
|
30
|
-
"content-type-dashboard": "awsui_content-type-
|
|
31
|
-
"is-overlap-disabled": "awsui_is-overlap-
|
|
32
|
-
"has-content-gap-left": "awsui_has-content-gap-
|
|
33
|
-
"has-content-gap-right": "awsui_has-content-gap-
|
|
34
|
-
"content-first-child-notifications": "awsui_content-first-child-
|
|
35
|
-
"has-breadcrumbs": "awsui_has-
|
|
36
|
-
"content-first-child-header": "awsui_content-first-child-
|
|
37
|
-
"has-header": "awsui_has-
|
|
38
|
-
"content-first-child-main": "awsui_content-first-child-
|
|
39
|
-
"disable-content-paddings": "awsui_disable-content-
|
|
40
|
-
"has-split-panel": "awsui_has-split-
|
|
41
|
-
"split-panel-position-bottom": "awsui_split-panel-position-
|
|
42
|
-
"block-body-scroll": "awsui_block-body-
|
|
43
|
-
"unfocusable": "
|
|
44
|
-
"container": "
|
|
45
|
-
"is-navigation-open": "awsui_is-navigation-
|
|
46
|
-
"is-tools-open": "awsui_is-tools-
|
|
47
|
-
"is-split-panel-open": "awsui_is-split-panel-
|
|
48
|
-
"split-panel-position-side": "awsui_split-panel-position-
|
|
49
|
-
"has-active-drawer": "awsui_has-active-
|
|
50
|
-
"mobile-toolbar": "awsui_mobile-
|
|
51
|
-
"mobile-toolbar-nav": "awsui_mobile-toolbar-
|
|
52
|
-
"mobile-toolbar-breadcrumbs": "awsui_mobile-toolbar-
|
|
53
|
-
"mobile-toolbar-tools": "awsui_mobile-toolbar-
|
|
54
|
-
"navigation-container": "awsui_navigation-
|
|
55
|
-
"show-navigation": "awsui_show-
|
|
56
|
-
"animating": "
|
|
57
|
-
"showButtons": "
|
|
58
|
-
"navigation": "
|
|
59
|
-
"openNavigation": "
|
|
60
|
-
"animated-content": "awsui_animated-
|
|
61
|
-
"hide-navigation": "awsui_hide-
|
|
62
|
-
"notifications": "
|
|
63
|
-
"sticky-notifications": "awsui_sticky-
|
|
64
|
-
"split-panel-bottom": "awsui_split-panel-
|
|
65
|
-
"position-bottom": "awsui_position-
|
|
66
|
-
"openSplitPanelBottom": "
|
|
67
|
-
"split-panel-side": "awsui_split-panel-
|
|
68
|
-
"position-side": "awsui_position-
|
|
69
|
-
"tools-container": "awsui_tools-
|
|
70
|
-
"tools": "
|
|
71
|
-
"openTools": "
|
|
72
|
-
"has-tools-form-persistence": "awsui_has-tools-form-
|
|
73
|
-
"hide-tools": "awsui_hide-
|
|
74
|
-
"show-tools": "awsui_show-
|
|
75
|
-
"has-tools-form": "awsui_has-tools-
|
|
76
|
-
"trigger-badge-wrapper": "awsui_trigger-badge-
|
|
77
|
-
"trigger": "
|
|
78
|
-
"selected": "
|
|
79
|
-
"badge": "
|
|
80
|
-
"trigger-wrapper": "awsui_trigger-
|
|
81
|
-
"dot": "
|
|
5
|
+
"background": "awsui_background_hyvsj_1dh3h_93",
|
|
6
|
+
"scrolling-background": "awsui_scrolling-background_hyvsj_1dh3h_96",
|
|
7
|
+
"sticky-background": "awsui_sticky-background_hyvsj_1dh3h_102",
|
|
8
|
+
"has-sticky-notifications": "awsui_has-sticky-notifications_hyvsj_1dh3h_110",
|
|
9
|
+
"breadcrumbs": "awsui_breadcrumbs_hyvsj_1dh3h_123",
|
|
10
|
+
"has-sticky-background": "awsui_has-sticky-background_hyvsj_1dh3h_133",
|
|
11
|
+
"drawers-container": "awsui_drawers-container_hyvsj_1dh3h_145",
|
|
12
|
+
"has-open-drawer": "awsui_has-open-drawer_hyvsj_1dh3h_156",
|
|
13
|
+
"disable-body-scroll": "awsui_disable-body-scroll_hyvsj_1dh3h_180",
|
|
14
|
+
"drawers-desktop-triggers-container": "awsui_drawers-desktop-triggers-container_hyvsj_1dh3h_185",
|
|
15
|
+
"has-multiple-triggers": "awsui_has-multiple-triggers_hyvsj_1dh3h_204",
|
|
16
|
+
"drawers-mobile-triggers-container": "awsui_drawers-mobile-triggers-container_hyvsj_1dh3h_214",
|
|
17
|
+
"drawers-trigger-content": "awsui_drawers-trigger-content_hyvsj_1dh3h_218",
|
|
18
|
+
"drawers-trigger-overflow": "awsui_drawers-trigger-overflow_hyvsj_1dh3h_232",
|
|
19
|
+
"drawers-trigger": "awsui_drawers-trigger_hyvsj_1dh3h_218",
|
|
20
|
+
"drawer": "awsui_drawer_hyvsj_1dh3h_145",
|
|
21
|
+
"drawer-content-container": "awsui_drawer-content-container_hyvsj_1dh3h_262",
|
|
22
|
+
"drawer-close-button": "awsui_drawer-close-button_hyvsj_1dh3h_271",
|
|
23
|
+
"drawer-content": "awsui_drawer-content_hyvsj_1dh3h_262",
|
|
24
|
+
"drawer-content-hidden": "awsui_drawer-content-hidden_hyvsj_1dh3h_279",
|
|
25
|
+
"drawer-slider": "awsui_drawer-slider_hyvsj_1dh3h_282",
|
|
26
|
+
"is-drawer-open": "awsui_is-drawer-open_hyvsj_1dh3h_289",
|
|
27
|
+
"content": "awsui_content_hyvsj_1dh3h_314",
|
|
28
|
+
"layout": "awsui_layout_hyvsj_1dh3h_335",
|
|
29
|
+
"has-max-content-width": "awsui_has-max-content-width_hyvsj_1dh3h_418",
|
|
30
|
+
"content-type-dashboard": "awsui_content-type-dashboard_hyvsj_1dh3h_433",
|
|
31
|
+
"is-overlap-disabled": "awsui_is-overlap-disabled_hyvsj_1dh3h_450",
|
|
32
|
+
"has-content-gap-left": "awsui_has-content-gap-left_hyvsj_1dh3h_482",
|
|
33
|
+
"has-content-gap-right": "awsui_has-content-gap-right_hyvsj_1dh3h_485",
|
|
34
|
+
"content-first-child-notifications": "awsui_content-first-child-notifications_hyvsj_1dh3h_495",
|
|
35
|
+
"has-breadcrumbs": "awsui_has-breadcrumbs_hyvsj_1dh3h_498",
|
|
36
|
+
"content-first-child-header": "awsui_content-first-child-header_hyvsj_1dh3h_501",
|
|
37
|
+
"has-header": "awsui_has-header_hyvsj_1dh3h_501",
|
|
38
|
+
"content-first-child-main": "awsui_content-first-child-main_hyvsj_1dh3h_522",
|
|
39
|
+
"disable-content-paddings": "awsui_disable-content-paddings_hyvsj_1dh3h_522",
|
|
40
|
+
"has-split-panel": "awsui_has-split-panel_hyvsj_1dh3h_565",
|
|
41
|
+
"split-panel-position-bottom": "awsui_split-panel-position-bottom_hyvsj_1dh3h_565",
|
|
42
|
+
"block-body-scroll": "awsui_block-body-scroll_hyvsj_1dh3h_581",
|
|
43
|
+
"unfocusable": "awsui_unfocusable_hyvsj_1dh3h_586",
|
|
44
|
+
"container": "awsui_container_hyvsj_1dh3h_596",
|
|
45
|
+
"is-navigation-open": "awsui_is-navigation-open_hyvsj_1dh3h_621",
|
|
46
|
+
"is-tools-open": "awsui_is-tools-open_hyvsj_1dh3h_624",
|
|
47
|
+
"is-split-panel-open": "awsui_is-split-panel-open_hyvsj_1dh3h_624",
|
|
48
|
+
"split-panel-position-side": "awsui_split-panel-position-side_hyvsj_1dh3h_624",
|
|
49
|
+
"has-active-drawer": "awsui_has-active-drawer_hyvsj_1dh3h_624",
|
|
50
|
+
"mobile-toolbar": "awsui_mobile-toolbar_hyvsj_1dh3h_633",
|
|
51
|
+
"mobile-toolbar-nav": "awsui_mobile-toolbar-nav_hyvsj_1dh3h_649",
|
|
52
|
+
"mobile-toolbar-breadcrumbs": "awsui_mobile-toolbar-breadcrumbs_hyvsj_1dh3h_653",
|
|
53
|
+
"mobile-toolbar-tools": "awsui_mobile-toolbar-tools_hyvsj_1dh3h_657",
|
|
54
|
+
"navigation-container": "awsui_navigation-container_hyvsj_1dh3h_666",
|
|
55
|
+
"show-navigation": "awsui_show-navigation_hyvsj_1dh3h_710",
|
|
56
|
+
"animating": "awsui_animating_hyvsj_1dh3h_732",
|
|
57
|
+
"showButtons": "awsui_showButtons_hyvsj_1dh3h_1",
|
|
58
|
+
"navigation": "awsui_navigation_hyvsj_1dh3h_666",
|
|
59
|
+
"openNavigation": "awsui_openNavigation_hyvsj_1dh3h_1",
|
|
60
|
+
"animated-content": "awsui_animated-content_hyvsj_1dh3h_794",
|
|
61
|
+
"hide-navigation": "awsui_hide-navigation_hyvsj_1dh3h_803",
|
|
62
|
+
"notifications": "awsui_notifications_hyvsj_1dh3h_813",
|
|
63
|
+
"sticky-notifications": "awsui_sticky-notifications_hyvsj_1dh3h_819",
|
|
64
|
+
"split-panel-bottom": "awsui_split-panel-bottom_hyvsj_1dh3h_836",
|
|
65
|
+
"position-bottom": "awsui_position-bottom_hyvsj_1dh3h_883",
|
|
66
|
+
"openSplitPanelBottom": "awsui_openSplitPanelBottom_hyvsj_1dh3h_1",
|
|
67
|
+
"split-panel-side": "awsui_split-panel-side_hyvsj_1dh3h_912",
|
|
68
|
+
"position-side": "awsui_position-side_hyvsj_1dh3h_925",
|
|
69
|
+
"tools-container": "awsui_tools-container_hyvsj_1dh3h_944",
|
|
70
|
+
"tools": "awsui_tools_hyvsj_1dh3h_944",
|
|
71
|
+
"openTools": "awsui_openTools_hyvsj_1dh3h_1",
|
|
72
|
+
"has-tools-form-persistence": "awsui_has-tools-form-persistence_hyvsj_1dh3h_1039",
|
|
73
|
+
"hide-tools": "awsui_hide-tools_hyvsj_1dh3h_1049",
|
|
74
|
+
"show-tools": "awsui_show-tools_hyvsj_1dh3h_1061",
|
|
75
|
+
"has-tools-form": "awsui_has-tools-form_hyvsj_1dh3h_1039",
|
|
76
|
+
"trigger-badge-wrapper": "awsui_trigger-badge-wrapper_hyvsj_1dh3h_1121",
|
|
77
|
+
"trigger": "awsui_trigger_hyvsj_1dh3h_1121",
|
|
78
|
+
"selected": "awsui_selected_hyvsj_1dh3h_1185",
|
|
79
|
+
"badge": "awsui_badge_hyvsj_1dh3h_1205",
|
|
80
|
+
"trigger-wrapper": "awsui_trigger-wrapper_hyvsj_1dh3h_1209",
|
|
81
|
+
"dot": "awsui_dot_hyvsj_1dh3h_1215"
|
|
82
82
|
};
|
|
83
83
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"lib/default/","sources":["breadcrumb-group/internal.tsx"],"names":[],"mappings":";AAUA,OAAO,EAAE,oBAAoB,EAAyB,MAAM,cAAc,CAAC;AAI3E,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AA6DlF,eAAO,MAAM,cAAc;;;;CAIzB,CAAC;AAEH,KAAK,4BAA4B,CAAC,CAAC,SAAS,oBAAoB,CAAC,IAAI,GAAG,oBAAoB,CAAC,IAAI,IAC/F,oBAAoB,CAAC,CAAC,CAAC,GAAG,0BAA0B,CAAC;AAEvD,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAC,CAAC,SAAS,oBAAoB,CAAC,IAAI,GAAG,oBAAoB,CAAC,IAAI,EAAE,EAC/G,KAAU,EACV,SAAS,EACT,eAAe,EACf,OAAO,EACP,QAAQ,EACR,iBAAiB,EACjB,GAAG,KAAK,EACT,EAAE,4BAA4B,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"lib/default/","sources":["breadcrumb-group/internal.tsx"],"names":[],"mappings":";AAUA,OAAO,EAAE,oBAAoB,EAAyB,MAAM,cAAc,CAAC;AAI3E,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AA6DlF,eAAO,MAAM,cAAc;;;;CAIzB,CAAC;AAEH,KAAK,4BAA4B,CAAC,CAAC,SAAS,oBAAoB,CAAC,IAAI,GAAG,oBAAoB,CAAC,IAAI,IAC/F,oBAAoB,CAAC,CAAC,CAAC,GAAG,0BAA0B,CAAC;AAEvD,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAC,CAAC,SAAS,oBAAoB,CAAC,IAAI,GAAG,oBAAoB,CAAC,IAAI,EAAE,EAC/G,KAAU,EACV,SAAS,EACT,eAAe,EACf,OAAO,EACP,QAAQ,EACR,iBAAiB,EACjB,GAAG,KAAK,EACT,EAAE,4BAA4B,CAAC,CAAC,CAAC,eAmEjC"}
|
|
@@ -44,8 +44,9 @@ export default function InternalBreadcrumbGroup(_a) {
|
|
|
44
44
|
const baseProps = getBaseProps(props);
|
|
45
45
|
const isMobile = useMobile();
|
|
46
46
|
let breadcrumbItems = items.map((item, index) => {
|
|
47
|
+
const isLast = index === items.length - 1;
|
|
47
48
|
return (React.createElement("li", { className: styles.item, key: index },
|
|
48
|
-
React.createElement(BreadcrumbItem, { item: item, onClick: onClick, onFollow: onFollow, isCompressed: isMobile, isLast:
|
|
49
|
+
React.createElement(BreadcrumbItem, { item: item, onClick: onClick, onFollow: onFollow, isCompressed: isMobile, isLast: isLast, isDisplayed: !isMobile || isLast || index === 0 })));
|
|
49
50
|
});
|
|
50
51
|
const getEventItem = (e) => {
|
|
51
52
|
const { id } = e.detail;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"lib/default/","sources":["breadcrumb-group/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,sBAAsB,MAAM,6BAA6B,CAAC;AAEjE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD;;GAEG;AACH,MAAM,yBAAyB,GAAG,WAAW,CAAC;AAE9C,MAAM,kBAAkB,GAAG,CAAC,EAC1B,SAAS,EACT,UAAU,EACV,QAAQ,EACR,cAAc,EACd,MAAM,EACN,OAAO,GACY,EAAE,EAAE;IACvB,OAAO,CACL,oBAAC,cAAc,IACb,GAAG,EAAE,UAAU,EACf,SAAS,EAAE,cAAc,EACzB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,KAAK,CAAC,EAAE;YACf,KAAK,CAAC,cAAc,EAAE,CAAC;YACvB,OAAO,EAAE,CAAC;QACZ,CAAC,EACD,YAAY,EAAE,MAAM,mBACL,IAAI,EACnB,SAAS,EAAE,SAAS,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EN,eAAe,GAAG;YAChB,eAAe,CAAC,CAAC,CAAC;YAClB,oBAAC,gBAAgB,IACf,GAAG,EAAE,UAAU,EACf,SAAS,EAAE,eAAe,EAC1B,aAAa,EAAE,aAAa,EAC5B,mBAAmB,EAAE,CAAC,CAAC,EAAE,CAAC,mBAAmB,CAAC,OAAO,EAAE,cAAc,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAC1F,oBAAoB,EAAE,CAAC,CAAC,EAAE,CAAC,mBAAmB,CAAC,QAAQ,EAAE,cAAc,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAC5F;YACF,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC;SAC5B,CAAC;KACH;IAED,OAAO,CACL,6CACM,SAAS,IACb,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,kBAAkB,CAAC,EAC1B,QAAQ,IAAI,MAAM,CAAC,MAAM,EACzB,KAAK,CAAC,MAAM,IAAI,CAAC,IAAI,MAAM,CAAC,cAAc,CAAC,EAC3C,SAAS,CAAC,SAAS,CACpB,gBACW,SAAS,IAAI,SAAS,EAClC,GAAG,EAAE,iBAAiB;QAEtB,4BAAI,SAAS,EAAE,MAAM,CAAC,uBAAuB,CAAC,IAAG,eAAe,CAAM,CAClE,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport styles from './styles.css.js';\nimport clsx from 'clsx';\nimport InternalIcon from '../icon/internal';\nimport InternalButtonDropdown from '../button-dropdown/internal';\nimport { CustomTriggerProps, LinkItem } from '../button-dropdown/interfaces';\nimport { InternalButton } from '../button/internal';\nimport { BreadcrumbItem } from './item/item';\nimport { BreadcrumbGroupProps, EllipsisDropdownProps } from './interfaces';\nimport { fireCancelableEvent } from '../internal/events';\nimport { getBaseProps } from '../internal/base-component';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { checkSafeUrl } from '../internal/utils/check-safe-url';\nimport { useInternalI18n } from '../i18n/context';\n\n/**\n * Provided for backwards compatibility\n */\nconst DEFAULT_EXPAND_ARIA_LABEL = 'Show path';\n\nconst getDropdownTrigger = ({\n ariaLabel,\n triggerRef,\n disabled,\n testUtilsClass,\n isOpen,\n onClick,\n}: CustomTriggerProps) => {\n return (\n <InternalButton\n ref={triggerRef}\n className={testUtilsClass}\n disabled={disabled}\n onClick={event => {\n event.preventDefault();\n onClick();\n }}\n ariaExpanded={isOpen}\n aria-haspopup={true}\n ariaLabel={ariaLabel}\n variant=\"breadcrumb-group\"\n formAction=\"none\"\n >\n ...\n </InternalButton>\n );\n};\n\nconst EllipsisDropdown = ({\n ariaLabel,\n dropdownItems,\n onDropdownItemClick,\n onDropdownItemFollow,\n}: EllipsisDropdownProps) => {\n const i18n = useInternalI18n('breadcrumb-group');\n\n return (\n <li className={styles.ellipsis}>\n <InternalButtonDropdown\n ariaLabel={i18n('expandAriaLabel', ariaLabel) ?? DEFAULT_EXPAND_ARIA_LABEL}\n items={dropdownItems}\n onItemClick={onDropdownItemClick}\n onItemFollow={onDropdownItemFollow}\n customTriggerBuilder={getDropdownTrigger}\n />\n <span className={styles.icon}>\n <InternalIcon name=\"angle-right\" />\n </span>\n </li>\n );\n};\n\nexport const getEventDetail = <T extends BreadcrumbGroupProps.Item>(item: T) => ({\n item,\n text: item.text,\n href: item.href,\n});\n\ntype InternalBreadcrumbGroupProps<T extends BreadcrumbGroupProps.Item = BreadcrumbGroupProps.Item> =\n BreadcrumbGroupProps<T> & InternalBaseComponentProps;\n\nexport default function InternalBreadcrumbGroup<T extends BreadcrumbGroupProps.Item = BreadcrumbGroupProps.Item>({\n items = [],\n ariaLabel,\n expandAriaLabel,\n onClick,\n onFollow,\n __internalRootRef,\n ...props\n}: InternalBreadcrumbGroupProps<T>) {\n for (const item of items) {\n checkSafeUrl('BreadcrumbGroup', item.href);\n }\n const baseProps = getBaseProps(props);\n const isMobile = useMobile();\n\n let breadcrumbItems = items.map((item, index) => {\n const isLast = index === items.length - 1;\n\n return (\n <li className={styles.item} key={index}>\n <BreadcrumbItem\n item={item}\n onClick={onClick}\n onFollow={onFollow}\n isCompressed={isMobile}\n isLast={isLast}\n isDisplayed={!isMobile || isLast || index === 0}\n />\n </li>\n );\n });\n\n const getEventItem = (e: CustomEvent<{ id: string }>) => {\n const { id } = e.detail;\n return items[parseInt(id)];\n };\n\n // Add ellipsis\n if (breadcrumbItems.length >= 2) {\n const dropdownItems: Array<LinkItem> = items\n .slice(1, items.length - 1)\n .map((item: BreadcrumbGroupProps.Item, index: number) => ({\n id: (index + 1).toString(), // the first item doesn't get inside dropdown\n text: item.text,\n href: item.href || '#',\n }));\n\n breadcrumbItems = [\n breadcrumbItems[0],\n <EllipsisDropdown\n key={'ellipsis'}\n ariaLabel={expandAriaLabel}\n dropdownItems={dropdownItems}\n onDropdownItemClick={e => fireCancelableEvent(onClick, getEventDetail(getEventItem(e)), e)}\n onDropdownItemFollow={e => fireCancelableEvent(onFollow, getEventDetail(getEventItem(e)), e)}\n />,\n ...breadcrumbItems.slice(1),\n ];\n }\n\n return (\n <nav\n {...baseProps}\n className={clsx(\n styles['breadcrumb-group'],\n isMobile && styles.mobile,\n items.length <= 2 && styles['mobile-short'],\n baseProps.className\n )}\n aria-label={ariaLabel || undefined}\n ref={__internalRootRef}\n >\n <ol className={styles['breadcrumb-group-list']}>{breadcrumbItems}</ol>\n </nav>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item.d.ts","sourceRoot":"lib/default/","sources":["breadcrumb-group/item/item.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"item.d.ts","sourceRoot":"lib/default/","sources":["breadcrumb-group/item/item.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AA6H1E,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,eA8CxB"}
|
|
@@ -15,7 +15,7 @@ import popoverStyles from '../../popover/styles.css.js';
|
|
|
15
15
|
import { DATA_ATTR_FUNNEL_KEY } from '../../internal/analytics/selectors';
|
|
16
16
|
import { FUNNEL_KEY_FUNNEL_NAME } from '../../internal/analytics/selectors';
|
|
17
17
|
const BreadcrumbItemWithPopover = (_a) => {
|
|
18
|
-
var { item, isLast, anchorAttributes } = _a, itemAttributes = __rest(_a, ["item", "isLast", "anchorAttributes"]);
|
|
18
|
+
var { item, isLast, anchorAttributes, funnelAttributes } = _a, itemAttributes = __rest(_a, ["item", "isLast", "anchorAttributes", "funnelAttributes"]);
|
|
19
19
|
const [showPopover, setShowPopover] = useState(false);
|
|
20
20
|
const textRef = useRef(null);
|
|
21
21
|
const virtualTextRef = useRef(null);
|
|
@@ -55,13 +55,13 @@ const BreadcrumbItemWithPopover = (_a) => {
|
|
|
55
55
|
}, onBlur: () => setShowPopover(false), onMouseEnter: () => {
|
|
56
56
|
isTruncated(textRef, virtualTextRef) && setShowPopover(true);
|
|
57
57
|
}, onMouseLeave: () => setShowPopover(false), anchorAttributes: anchorAttributes }),
|
|
58
|
-
React.createElement("span", { className: styles.text, ref: textRef }, item.text),
|
|
58
|
+
React.createElement("span", Object.assign({}, funnelAttributes, { 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
62
|
const Item = (_a) => {
|
|
63
|
-
var { anchorAttributes,
|
|
64
|
-
return isLast ? (React.createElement("span", Object.assign({}, itemAttributes
|
|
63
|
+
var { anchorAttributes, children, isLast } = _a, itemAttributes = __rest(_a, ["anchorAttributes", "children", "isLast"]);
|
|
64
|
+
return isLast ? (React.createElement("span", Object.assign({}, itemAttributes), children)) : (React.createElement("a", Object.assign({}, itemAttributes, anchorAttributes), children));
|
|
65
65
|
};
|
|
66
66
|
export function BreadcrumbItem({ item, onClick, onFollow, isDisplayed, isLast = false, isCompressed = false, }) {
|
|
67
67
|
const preventDefault = (event) => event.preventDefault();
|
|
@@ -78,13 +78,13 @@ export function BreadcrumbItem({ item, onClick, onFollow, isDisplayed, isLast =
|
|
|
78
78
|
href: item.href || '#',
|
|
79
79
|
onClick: isLast ? preventDefault : onClickHandler,
|
|
80
80
|
};
|
|
81
|
-
const
|
|
81
|
+
const funnelAttributes = {};
|
|
82
82
|
if (isLast) {
|
|
83
|
-
|
|
83
|
+
funnelAttributes[DATA_ATTR_FUNNEL_KEY] = FUNNEL_KEY_FUNNEL_NAME;
|
|
84
84
|
}
|
|
85
85
|
return (React.createElement("div", { className: clsx(styles.breadcrumb, isLast && styles.last) },
|
|
86
|
-
isDisplayed && isCompressed ? (React.createElement(BreadcrumbItemWithPopover, Object.assign({ item: item, isLast: isLast, anchorAttributes: anchorAttributes }, itemAttributes))) : (React.createElement(Item, Object.assign({ isLast: isLast, anchorAttributes: anchorAttributes }, itemAttributes
|
|
87
|
-
React.createElement("span", { className: styles.text }, item.text))),
|
|
86
|
+
isDisplayed && isCompressed ? (React.createElement(BreadcrumbItemWithPopover, Object.assign({ item: item, isLast: isLast, anchorAttributes: anchorAttributes, funnelAttributes: funnelAttributes }, itemAttributes))) : (React.createElement(Item, Object.assign({ isLast: isLast, anchorAttributes: anchorAttributes }, itemAttributes),
|
|
87
|
+
React.createElement("span", Object.assign({}, funnelAttributes, { className: styles.text }), item.text))),
|
|
88
88
|
!isLast ? (React.createElement("span", { className: styles.icon },
|
|
89
89
|
React.createElement(InternalIcon, { name: "angle-right" })))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C,CAC7B,oBAAC,yBAAyB,kBACxB,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,gBAAgB,IAC9B,cAAc,EAClB,CACH,CAAC,CAAC,CAAC,CACF,oBAAC,IAAI,kBAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,gBAAgB,IAAM,cAAc,EAAM,aAAa;YAC7F,8BAAM,SAAS,EAAE,MAAM,CAAC,IAAI,IAAG,IAAI,CAAC,IAAI,CAAQ,CAC3C,CACR;QACA,CAAC,MAAM,CAAC,CAAC,CAAC,CACT,8BAAM,SAAS,EAAE,MAAM,CAAC,IAAI;YAC1B,oBAAC,YAAY,IAAC,IAAI,EAAC,aAAa,GAAG,CAC9B,CACR,CAAC,CAAC,CAAC,IAAI,CACJ,CACP,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 { 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';\nimport { DATA_ATTR_FUNNEL_KEY } from '../../internal/analytics/selectors';\nimport { FUNNEL_KEY_FUNNEL_NAME } from '../../internal/analytics/selectors';\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 [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={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 dataAttributes?: React.DataHTMLAttributes<HTMLElement>;\n anchorAttributes: React.AnchorHTMLAttributes<HTMLAnchorElement>;\n isLast: boolean;\n};\nconst Item = ({ anchorAttributes, dataAttributes, children, isLast, ...itemAttributes }: ItemProps) =>\n isLast ? (\n <span {...itemAttributes} {...dataAttributes}>\n {children}\n </span>\n ) : (\n <a {...itemAttributes} {...anchorAttributes} {...dataAttributes}>\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 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 const dataAttibutes: Record<string, string> = {};\n if (isLast) {\n dataAttibutes[DATA_ATTR_FUNNEL_KEY] = FUNNEL_KEY_FUNNEL_NAME;\n }\n\n return (\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} {...itemAttributes} {...dataAttibutes}>\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"]}
|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IAAI,EACV,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,gBAAgB,EAClC,gBAAgB,EAAE,gBAAgB,IAC9B,cAAc,EAClB,CACH,CAAC,CAAC,CAAC,CACF,oBAAC,IAAI,kBAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,gBAAgB,IAAM,cAAc;YAC1E,8CAAU,gBAAgB,IAAE,SAAS,EAAE,MAAM,CAAC,IAAI,KAC/C,IAAI,CAAC,IAAI,CACL,CACF,CACR;QACA,CAAC,MAAM,CAAC,CAAC,CAAC,CACT,8BAAM,SAAS,EAAE,MAAM,CAAC,IAAI;YAC1B,oBAAC,YAAY,IAAC,IAAI,EAAC,aAAa,GAAG,CAC9B,CACR,CAAC,CAAC,CAAC,IAAI,CACJ,CACP,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 { 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';\nimport { DATA_ATTR_FUNNEL_KEY } from '../../internal/analytics/selectors';\nimport { FUNNEL_KEY_FUNNEL_NAME } from '../../internal/analytics/selectors';\n\ntype BreadcrumbItemWithPopoverProps<T extends BreadcrumbGroupProps.Item> = React.HTMLAttributes<HTMLElement> & {\n item: T;\n isLast: boolean;\n anchorAttributes: React.AnchorHTMLAttributes<HTMLAnchorElement>;\n funnelAttributes: Record<string, string>;\n};\n\nconst BreadcrumbItemWithPopover = <T extends BreadcrumbGroupProps.Item>({\n item,\n isLast,\n anchorAttributes,\n funnelAttributes,\n ...itemAttributes\n}: BreadcrumbItemWithPopoverProps<T>) => {\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={anchorAttributes}\n >\n <span {...funnelAttributes} 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 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 const funnelAttributes: Record<string, string> = {};\n if (isLast) {\n funnelAttributes[DATA_ATTR_FUNNEL_KEY] = FUNNEL_KEY_FUNNEL_NAME;\n }\n\n return (\n <div className={clsx(styles.breadcrumb, isLast && styles.last)}>\n {isDisplayed && isCompressed ? (\n <BreadcrumbItemWithPopover\n item={item}\n isLast={isLast}\n anchorAttributes={anchorAttributes}\n funnelAttributes={funnelAttributes}\n {...itemAttributes}\n />\n ) : (\n <Item isLast={isLast} anchorAttributes={anchorAttributes} {...itemAttributes}>\n <span {...funnelAttributes} className={styles.text}>\n {item.text}\n </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"]}
|
package/header/internal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"lib/default/","sources":["header/internal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAG1C,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAOjD,UAAU,mBAAoB,SAAQ,YAAY,CAAC,WAAW,EAAE,SAAS,CAAC,EAAE,0BAA0B;IACpG,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACpC;AAED,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EACrC,OAAO,EACP,kBAAkB,EAClB,QAAQ,EACR,OAAO,EACP,OAAO,EACP,WAAW,EACX,IAAI,EACJ,iBAAwB,EACxB,wBAAwB,EACxB,GAAG,SAAS,EACb,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"lib/default/","sources":["header/internal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAG1C,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAOjD,UAAU,mBAAoB,SAAQ,YAAY,CAAC,WAAW,EAAE,SAAS,CAAC,EAAE,0BAA0B;IACpG,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACpC;AAED,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EACrC,OAAO,EACP,kBAAkB,EAClB,QAAQ,EACR,OAAO,EACP,OAAO,EACP,WAAW,EACX,IAAI,EACJ,iBAAwB,EACxB,wBAAwB,EACxB,GAAG,SAAS,EACb,EAAE,mBAAmB,eAuErB;AAED,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,eAAe,EAAE,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAAC,eAAe,EAAE,MAAM,CAAA;CAAE,sBAgBhH"}
|
package/header/internal.js
CHANGED
|
@@ -38,7 +38,7 @@ export default function InternalHeader(_a) {
|
|
|
38
38
|
info && (React.createElement(InfoLinkLabelContext.Provider, { value: headingId },
|
|
39
39
|
React.createElement("span", { className: styles['virtual-space'] }, " \u00A0"),
|
|
40
40
|
React.createElement("span", { className: styles.info }, info)))),
|
|
41
|
-
actions && (React.createElement("div", { className: clsx(styles.actions, styles[`actions-variant-${variantOverride}`], isRefresh && styles.refresh) }, actions))),
|
|
41
|
+
actions && (React.createElement("div", { className: clsx(styles.actions, styles[`actions-variant-${variantOverride}`], isRefresh && styles.refresh, !__disableActionsWrapping && [styles['actions-centered']]) }, actions))),
|
|
42
42
|
React.createElement(Description, { variantOverride: variantOverride }, description)));
|
|
43
43
|
}
|
|
44
44
|
export function Description({ children, variantOverride }) {
|
package/header/internal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"lib/default/","sources":["header/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAErE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAErE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AACnF,OAAO,EAAE,sBAAsB,EAAE,MAAM,8CAA8C,CAAC;AACtF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AAS,GAAG,gBAAgB,EAAE,CAAC;IACrC,OAAO,CACL,CAAC,QAAQ,IAAI,CACX,2BACE,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,WAAW,EAClB,MAAM,CAAC,uBAAuB,eAAe,EAAE,CAAC,EAChD,SAAS,IAAI,MAAM,CAAC,OAAO,CAC5B,IAEA,QAAQ,CACP,CACL,CAAC;QACF,IAAI,CACL,CAAC;AACJ,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, { useContext } from 'react';\nimport { getBaseProps } from '../internal/base-component';\nimport { StickyHeaderContext } from '../container/use-sticky-header';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { HeaderProps } from './interfaces';\nimport styles from './styles.css.js';\nimport { SomeRequired } from '../internal/types';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport { InfoLinkLabelContext } from '../internal/context/info-link-label-context';\nimport { CollectionLabelContext } from '../internal/context/collection-label-context';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { DATA_ATTR_FUNNEL_KEY, FUNNEL_KEY_SUBSTEP_NAME } from '../internal/analytics/selectors';\n\ninterface InternalHeaderProps extends SomeRequired<HeaderProps, 'variant'>, InternalBaseComponentProps {\n __disableActionsWrapping?: boolean;\n}\n\nexport default function InternalHeader({\n variant,\n headingTagOverride,\n children,\n actions,\n counter,\n description,\n info,\n __internalRootRef = null,\n __disableActionsWrapping,\n ...restProps\n}: InternalHeaderProps) {\n const isMobile = useMobile();\n const HeadingTag = headingTagOverride ?? (variant === 'awsui-h1-sticky' ? 'h1' : variant);\n const { isStuck } = useContext(StickyHeaderContext);\n const baseProps = getBaseProps(restProps);\n const isRefresh = useVisualRefresh();\n const assignHeaderId = useContext(CollectionLabelContext).assignId;\n const headingId = useUniqueId('heading');\n if (assignHeaderId !== undefined) {\n assignHeaderId(headingId);\n }\n // If is mobile there is no need to have the dynamic variant because it's scrolled out of view\n const dynamicVariant = !isMobile && isStuck ? 'h2' : 'h1';\n const variantOverride = variant === 'awsui-h1-sticky' ? (isRefresh ? dynamicVariant : 'h2') : variant;\n\n return (\n <div\n {...baseProps}\n className={clsx(\n styles.root,\n baseProps.className,\n styles[`root-variant-${variantOverride}`],\n isRefresh && styles.refresh,\n !actions && [styles[`root-no-actions`]],\n description && [styles[`root-has-description`]]\n )}\n ref={__internalRootRef}\n >\n <div\n className={clsx(\n styles.main,\n styles[`main-variant-${variantOverride}`],\n isRefresh && styles.refresh,\n __disableActionsWrapping && [styles['no-wrap']]\n )}\n >\n <div className={clsx(styles.title, styles[`title-variant-${variantOverride}`], isRefresh && styles.refresh)}>\n <HeadingTag className={clsx(styles.heading, styles[`heading-variant-${variantOverride}`])}>\n <span\n {...(HeadingTag === 'h2' ? { [DATA_ATTR_FUNNEL_KEY]: FUNNEL_KEY_SUBSTEP_NAME } : {})}\n className={clsx(styles['heading-text'], styles[`heading-text-variant-${variantOverride}`])}\n id={headingId}\n >\n {children}\n </span>\n {counter !== undefined && <span className={styles.counter}> {counter}</span>}\n </HeadingTag>\n {info && (\n <InfoLinkLabelContext.Provider value={headingId}>\n {/* Exists to create a space between heading text and info so that a double-click selection on the last word of the heading doesn't also include info */}\n <span className={styles['virtual-space']}> </span>\n <span className={styles.info}>{info}</span>\n </InfoLinkLabelContext.Provider>\n )}\n </div>\n {actions && (\n <div\n className={clsx(\n styles.actions,\n styles[`actions-variant-${variantOverride}`],\n isRefresh && styles.refresh,\n !__disableActionsWrapping && [styles['actions-centered']]\n )}\n >\n {actions}\n </div>\n )}\n </div>\n <Description variantOverride={variantOverride}>{description}</Description>\n </div>\n );\n}\n\nexport function Description({ children, variantOverride }: { children: React.ReactNode; variantOverride: string }) {\n const isRefresh = useVisualRefresh();\n return (\n (children && (\n <p\n className={clsx(\n styles.description,\n styles[`description-variant-${variantOverride}`],\n isRefresh && styles.refresh\n )}\n >\n {children}\n </p>\n )) ||\n null\n );\n}\n"]}
|
package/header/styles.css.js
CHANGED
|
@@ -1,38 +1,39 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"root": "
|
|
5
|
-
"refresh": "
|
|
6
|
-
"root-no-actions": "awsui_root-no-
|
|
7
|
-
"root-variant-h2": "awsui_root-variant-
|
|
8
|
-
"root-variant-h3": "awsui_root-variant-
|
|
9
|
-
"root-has-description": "awsui_root-has-
|
|
10
|
-
"root-variant-h1": "awsui_root-variant-
|
|
11
|
-
"main": "
|
|
12
|
-
"no-wrap": "awsui_no-
|
|
13
|
-
"main-variant-h1": "awsui_main-variant-
|
|
14
|
-
"actions": "
|
|
15
|
-
"actions-
|
|
16
|
-
"actions-variant-
|
|
17
|
-
"actions-variant-
|
|
18
|
-
"
|
|
19
|
-
"title
|
|
20
|
-
"title-variant-
|
|
21
|
-
"title-variant-
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"description
|
|
26
|
-
"description-variant-
|
|
27
|
-
"description-variant-
|
|
28
|
-
"
|
|
29
|
-
"heading
|
|
30
|
-
"heading-variant-
|
|
31
|
-
"heading-variant-
|
|
32
|
-
"heading-
|
|
33
|
-
"heading-text
|
|
34
|
-
"heading-text-variant-
|
|
35
|
-
"heading-text-variant-
|
|
36
|
-
"
|
|
4
|
+
"root": "awsui_root_2qdw9_1xihu_93",
|
|
5
|
+
"refresh": "awsui_refresh_2qdw9_1xihu_110",
|
|
6
|
+
"root-no-actions": "awsui_root-no-actions_2qdw9_1xihu_110",
|
|
7
|
+
"root-variant-h2": "awsui_root-variant-h2_2qdw9_1xihu_113",
|
|
8
|
+
"root-variant-h3": "awsui_root-variant-h3_2qdw9_1xihu_113",
|
|
9
|
+
"root-has-description": "awsui_root-has-description_2qdw9_1xihu_113",
|
|
10
|
+
"root-variant-h1": "awsui_root-variant-h1_2qdw9_1xihu_122",
|
|
11
|
+
"main": "awsui_main_2qdw9_1xihu_132",
|
|
12
|
+
"no-wrap": "awsui_no-wrap_2qdw9_1xihu_142",
|
|
13
|
+
"main-variant-h1": "awsui_main-variant-h1_2qdw9_1xihu_148",
|
|
14
|
+
"actions": "awsui_actions_2qdw9_1xihu_156",
|
|
15
|
+
"actions-centered": "awsui_actions-centered_2qdw9_1xihu_161",
|
|
16
|
+
"actions-variant-h1": "awsui_actions-variant-h1_2qdw9_1xihu_164",
|
|
17
|
+
"actions-variant-h2": "awsui_actions-variant-h2_2qdw9_1xihu_167",
|
|
18
|
+
"actions-variant-h3": "awsui_actions-variant-h3_2qdw9_1xihu_170",
|
|
19
|
+
"title": "awsui_title_2qdw9_1xihu_183",
|
|
20
|
+
"title-variant-h1": "awsui_title-variant-h1_2qdw9_1xihu_188",
|
|
21
|
+
"title-variant-h2": "awsui_title-variant-h2_2qdw9_1xihu_195",
|
|
22
|
+
"title-variant-h3": "awsui_title-variant-h3_2qdw9_1xihu_201",
|
|
23
|
+
"virtual-space": "awsui_virtual-space_2qdw9_1xihu_222",
|
|
24
|
+
"info": "awsui_info_2qdw9_1xihu_228",
|
|
25
|
+
"description": "awsui_description_2qdw9_1xihu_232",
|
|
26
|
+
"description-variant-h1": "awsui_description-variant-h1_2qdw9_1xihu_237",
|
|
27
|
+
"description-variant-h2": "awsui_description-variant-h2_2qdw9_1xihu_241",
|
|
28
|
+
"description-variant-h3": "awsui_description-variant-h3_2qdw9_1xihu_248",
|
|
29
|
+
"heading": "awsui_heading_2qdw9_1xihu_257",
|
|
30
|
+
"heading-variant-h1": "awsui_heading-variant-h1_2qdw9_1xihu_266",
|
|
31
|
+
"heading-variant-h2": "awsui_heading-variant-h2_2qdw9_1xihu_271",
|
|
32
|
+
"heading-variant-h3": "awsui_heading-variant-h3_2qdw9_1xihu_276",
|
|
33
|
+
"heading-text": "awsui_heading-text_2qdw9_1xihu_282",
|
|
34
|
+
"heading-text-variant-h1": "awsui_heading-text-variant-h1_2qdw9_1xihu_285",
|
|
35
|
+
"heading-text-variant-h2": "awsui_heading-text-variant-h2_2qdw9_1xihu_293",
|
|
36
|
+
"heading-text-variant-h3": "awsui_heading-text-variant-h3_2qdw9_1xihu_301",
|
|
37
|
+
"counter": "awsui_counter_2qdw9_1xihu_310"
|
|
37
38
|
};
|
|
38
39
|
|