@cloudscape-design/components 3.0.618 → 3.0.620
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/annotation-context/annotation/styles.css.js +24 -24
- package/annotation-context/annotation/styles.scoped.css +31 -31
- package/annotation-context/annotation/styles.selectors.js +24 -24
- package/app-layout/classic.d.ts.map +1 -1
- package/app-layout/classic.js +5 -16
- package/app-layout/classic.js.map +1 -1
- package/app-layout/content-wrapper/index.d.ts +1 -0
- package/app-layout/content-wrapper/index.d.ts.map +1 -1
- package/app-layout/content-wrapper/index.js +3 -3
- package/app-layout/content-wrapper/index.js.map +1 -1
- package/app-layout/notifications/styles.css.js +3 -3
- package/app-layout/notifications/styles.scoped.css +7 -7
- package/app-layout/notifications/styles.selectors.js +3 -3
- package/app-layout/utils/sticky-offsets.d.ts +4 -0
- package/app-layout/utils/sticky-offsets.d.ts.map +1 -0
- package/app-layout/utils/sticky-offsets.js +10 -0
- package/app-layout/utils/sticky-offsets.js.map +1 -0
- package/app-layout/visual-refresh/context.d.ts.map +1 -1
- package/app-layout/visual-refresh/context.js +1 -5
- package/app-layout/visual-refresh/context.js.map +1 -1
- package/app-layout/visual-refresh/main.d.ts.map +1 -1
- package/app-layout/visual-refresh/main.js +6 -4
- package/app-layout/visual-refresh/main.js.map +1 -1
- package/app-layout/visual-refresh/styles.css.js +81 -81
- package/app-layout/visual-refresh/styles.scoped.css +258 -294
- package/app-layout/visual-refresh/styles.selectors.js +81 -81
- package/container/use-sticky-header.d.ts +1 -5
- package/container/use-sticky-header.d.ts.map +1 -1
- package/container/use-sticky-header.js +7 -34
- package/container/use-sticky-header.js.map +1 -1
- package/flashbar/styles.css.js +47 -47
- package/flashbar/styles.scoped.css +171 -171
- package/flashbar/styles.selectors.js +47 -47
- package/header/internal.d.ts.map +1 -1
- package/header/internal.js +3 -1
- package/header/internal.js.map +1 -1
- package/header/styles.css.js +35 -34
- package/header/styles.scoped.css +55 -52
- package/header/styles.selectors.js +35 -34
- package/internal/components/dropdown/styles.css.js +20 -20
- package/internal/components/dropdown/styles.scoped.css +41 -41
- package/internal/components/dropdown/styles.selectors.js +20 -20
- package/internal/context/app-layout-context.d.ts +0 -3
- package/internal/context/app-layout-context.d.ts.map +1 -1
- package/internal/context/app-layout-context.js +1 -5
- package/internal/context/app-layout-context.js.map +1 -1
- package/internal/environment.js +1 -1
- package/internal/environment.json +1 -1
- package/internal/generated/custom-css-properties/index.d.ts.map +1 -1
- package/internal/generated/custom-css-properties/index.js +43 -44
- package/internal/generated/custom-css-properties/index.js.map +1 -1
- package/internal/manifest.json +1 -1
- package/internal/styles/global-vars.d.ts +6 -0
- package/internal/styles/global-vars.d.ts.map +1 -0
- package/internal/styles/global-vars.js +8 -0
- package/internal/styles/global-vars.js.map +1 -0
- package/mixed-line-bar-chart/bar-series.d.ts +3 -3
- package/mixed-line-bar-chart/bar-series.d.ts.map +1 -1
- package/mixed-line-bar-chart/bar-series.js +61 -17
- package/mixed-line-bar-chart/bar-series.js.map +1 -1
- package/mixed-line-bar-chart/create-one-side-rounded-rect-path.d.ts +7 -0
- package/mixed-line-bar-chart/create-one-side-rounded-rect-path.d.ts.map +1 -0
- package/mixed-line-bar-chart/create-one-side-rounded-rect-path.js +33 -0
- package/mixed-line-bar-chart/create-one-side-rounded-rect-path.js.map +1 -0
- package/mixed-line-bar-chart/data-series.d.ts.map +1 -1
- package/mixed-line-bar-chart/data-series.js +5 -5
- package/mixed-line-bar-chart/data-series.js.map +1 -1
- package/mixed-line-bar-chart/utils.d.ts +2 -9
- package/mixed-line-bar-chart/utils.d.ts.map +1 -1
- package/mixed-line-bar-chart/utils.js +19 -26
- package/mixed-line-bar-chart/utils.js.map +1 -1
- package/package.json +1 -1
- package/spinner/styles.css.js +13 -13
- package/spinner/styles.scoped.css +39 -39
- package/spinner/styles.selectors.js +13 -13
- package/split-panel/implementation.d.ts.map +1 -1
- package/split-panel/implementation.js +7 -7
- package/split-panel/implementation.js.map +1 -1
- package/split-panel/interfaces.d.ts +1 -0
- package/split-panel/interfaces.d.ts.map +1 -1
- package/split-panel/interfaces.js.map +1 -1
- package/split-panel/side.d.ts +1 -1
- package/split-panel/side.d.ts.map +1 -1
- package/split-panel/side.js +2 -5
- package/split-panel/side.js.map +1 -1
- package/table/internal.d.ts.map +1 -1
- package/table/internal.js +6 -7
- package/table/internal.js.map +1 -1
- package/table/sticky-scrollbar/sticky-scrollbar.d.ts.map +1 -1
- package/table/sticky-scrollbar/sticky-scrollbar.js +1 -7
- package/table/sticky-scrollbar/sticky-scrollbar.js.map +1 -1
- package/table/sticky-scrollbar/use-sticky-scrollbar.d.ts +2 -2
- package/table/sticky-scrollbar/use-sticky-scrollbar.d.ts.map +1 -1
- package/table/sticky-scrollbar/use-sticky-scrollbar.js +12 -30
- package/table/sticky-scrollbar/use-sticky-scrollbar.js.map +1 -1
- package/theming/index.d.ts +5 -0
- package/theming/index.d.ts.map +1 -1
- package/theming/index.js +8 -1
- package/theming/index.js.map +1 -1
|
@@ -2,86 +2,86 @@
|
|
|
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
|
-
"content-type-table": "awsui_content-type-
|
|
32
|
-
"content-type-cards": "awsui_content-type-
|
|
33
|
-
"is-overlap-disabled": "awsui_is-overlap-
|
|
34
|
-
"is-hide-mobile-toolbar": "awsui_is-hide-mobile-
|
|
35
|
-
"has-content-gap-left": "awsui_has-content-gap-
|
|
36
|
-
"has-content-gap-right": "awsui_has-content-gap-
|
|
37
|
-
"content-first-child-notifications": "awsui_content-first-child-
|
|
38
|
-
"has-breadcrumbs": "awsui_has-
|
|
39
|
-
"content-first-child-header": "awsui_content-first-child-
|
|
40
|
-
"has-header": "awsui_has-
|
|
41
|
-
"content-first-child-main": "awsui_content-first-child-
|
|
42
|
-
"disable-content-paddings": "awsui_disable-content-
|
|
43
|
-
"has-split-panel": "awsui_has-split-
|
|
44
|
-
"split-panel-position-bottom": "awsui_split-panel-position-
|
|
45
|
-
"block-body-scroll": "awsui_block-body-
|
|
46
|
-
"unfocusable": "
|
|
47
|
-
"container": "
|
|
48
|
-
"is-navigation-open": "awsui_is-navigation-
|
|
49
|
-
"is-tools-open": "awsui_is-tools-
|
|
50
|
-
"is-split-panel-open": "awsui_is-split-panel-
|
|
51
|
-
"split-panel-position-side": "awsui_split-panel-position-
|
|
52
|
-
"has-active-drawer": "awsui_has-active-
|
|
53
|
-
"mobile-toolbar": "awsui_mobile-
|
|
54
|
-
"remove-high-contrast-header": "awsui_remove-high-contrast-
|
|
55
|
-
"mobile-toolbar-nav": "awsui_mobile-toolbar-
|
|
56
|
-
"mobile-toolbar-breadcrumbs": "awsui_mobile-toolbar-
|
|
57
|
-
"mobile-toolbar-tools": "awsui_mobile-toolbar-
|
|
58
|
-
"navigation-container": "awsui_navigation-
|
|
59
|
-
"show-navigation": "awsui_show-
|
|
60
|
-
"animating": "
|
|
61
|
-
"showButtons": "
|
|
62
|
-
"navigation": "
|
|
63
|
-
"openNavigation": "
|
|
64
|
-
"animated-content": "awsui_animated-
|
|
65
|
-
"hide-navigation": "awsui_hide-
|
|
66
|
-
"notifications": "
|
|
67
|
-
"sticky-notifications": "awsui_sticky-
|
|
68
|
-
"split-panel-bottom": "awsui_split-panel-
|
|
69
|
-
"position-bottom": "awsui_position-
|
|
70
|
-
"openSplitPanelBottom": "
|
|
71
|
-
"split-panel-side": "awsui_split-panel-
|
|
72
|
-
"position-side": "awsui_position-
|
|
73
|
-
"tools-container": "awsui_tools-
|
|
74
|
-
"tools": "
|
|
75
|
-
"openTools": "
|
|
76
|
-
"has-tools-form-persistence": "awsui_has-tools-form-
|
|
77
|
-
"hide-tools": "awsui_hide-
|
|
78
|
-
"show-tools": "awsui_show-
|
|
79
|
-
"has-tools-form": "awsui_has-tools-
|
|
80
|
-
"trigger-badge-wrapper": "awsui_trigger-badge-
|
|
81
|
-
"trigger": "
|
|
82
|
-
"selected": "
|
|
83
|
-
"badge": "
|
|
84
|
-
"trigger-wrapper": "awsui_trigger-
|
|
85
|
-
"dot": "
|
|
5
|
+
"background": "awsui_background_hyvsj_nbcko_99",
|
|
6
|
+
"scrolling-background": "awsui_scrolling-background_hyvsj_nbcko_102",
|
|
7
|
+
"sticky-background": "awsui_sticky-background_hyvsj_nbcko_108",
|
|
8
|
+
"has-sticky-notifications": "awsui_has-sticky-notifications_hyvsj_nbcko_116",
|
|
9
|
+
"breadcrumbs": "awsui_breadcrumbs_hyvsj_nbcko_129",
|
|
10
|
+
"has-sticky-background": "awsui_has-sticky-background_hyvsj_nbcko_139",
|
|
11
|
+
"drawers-container": "awsui_drawers-container_hyvsj_nbcko_151",
|
|
12
|
+
"has-open-drawer": "awsui_has-open-drawer_hyvsj_nbcko_162",
|
|
13
|
+
"disable-body-scroll": "awsui_disable-body-scroll_hyvsj_nbcko_185",
|
|
14
|
+
"drawers-desktop-triggers-container": "awsui_drawers-desktop-triggers-container_hyvsj_nbcko_190",
|
|
15
|
+
"has-multiple-triggers": "awsui_has-multiple-triggers_hyvsj_nbcko_231",
|
|
16
|
+
"drawers-mobile-triggers-container": "awsui_drawers-mobile-triggers-container_hyvsj_nbcko_241",
|
|
17
|
+
"drawers-trigger-content": "awsui_drawers-trigger-content_hyvsj_nbcko_245",
|
|
18
|
+
"drawers-trigger-overflow": "awsui_drawers-trigger-overflow_hyvsj_nbcko_259",
|
|
19
|
+
"drawers-trigger": "awsui_drawers-trigger_hyvsj_nbcko_245",
|
|
20
|
+
"drawer": "awsui_drawer_hyvsj_nbcko_151",
|
|
21
|
+
"drawer-content-container": "awsui_drawer-content-container_hyvsj_nbcko_290",
|
|
22
|
+
"drawer-close-button": "awsui_drawer-close-button_hyvsj_nbcko_299",
|
|
23
|
+
"drawer-content": "awsui_drawer-content_hyvsj_nbcko_290",
|
|
24
|
+
"drawer-content-hidden": "awsui_drawer-content-hidden_hyvsj_nbcko_307",
|
|
25
|
+
"drawer-slider": "awsui_drawer-slider_hyvsj_nbcko_310",
|
|
26
|
+
"is-drawer-open": "awsui_is-drawer-open_hyvsj_nbcko_317",
|
|
27
|
+
"content": "awsui_content_hyvsj_nbcko_343",
|
|
28
|
+
"layout": "awsui_layout_hyvsj_nbcko_364",
|
|
29
|
+
"has-max-content-width": "awsui_has-max-content-width_hyvsj_nbcko_435",
|
|
30
|
+
"content-type-dashboard": "awsui_content-type-dashboard_hyvsj_nbcko_450",
|
|
31
|
+
"content-type-table": "awsui_content-type-table_hyvsj_nbcko_464",
|
|
32
|
+
"content-type-cards": "awsui_content-type-cards_hyvsj_nbcko_464",
|
|
33
|
+
"is-overlap-disabled": "awsui_is-overlap-disabled_hyvsj_nbcko_470",
|
|
34
|
+
"is-hide-mobile-toolbar": "awsui_is-hide-mobile-toolbar_hyvsj_nbcko_473",
|
|
35
|
+
"has-content-gap-left": "awsui_has-content-gap-left_hyvsj_nbcko_487",
|
|
36
|
+
"has-content-gap-right": "awsui_has-content-gap-right_hyvsj_nbcko_490",
|
|
37
|
+
"content-first-child-notifications": "awsui_content-first-child-notifications_hyvsj_nbcko_500",
|
|
38
|
+
"has-breadcrumbs": "awsui_has-breadcrumbs_hyvsj_nbcko_503",
|
|
39
|
+
"content-first-child-header": "awsui_content-first-child-header_hyvsj_nbcko_506",
|
|
40
|
+
"has-header": "awsui_has-header_hyvsj_nbcko_506",
|
|
41
|
+
"content-first-child-main": "awsui_content-first-child-main_hyvsj_nbcko_524",
|
|
42
|
+
"disable-content-paddings": "awsui_disable-content-paddings_hyvsj_nbcko_524",
|
|
43
|
+
"has-split-panel": "awsui_has-split-panel_hyvsj_nbcko_561",
|
|
44
|
+
"split-panel-position-bottom": "awsui_split-panel-position-bottom_hyvsj_nbcko_561",
|
|
45
|
+
"block-body-scroll": "awsui_block-body-scroll_hyvsj_nbcko_569",
|
|
46
|
+
"unfocusable": "awsui_unfocusable_hyvsj_nbcko_574",
|
|
47
|
+
"container": "awsui_container_hyvsj_nbcko_584",
|
|
48
|
+
"is-navigation-open": "awsui_is-navigation-open_hyvsj_nbcko_610",
|
|
49
|
+
"is-tools-open": "awsui_is-tools-open_hyvsj_nbcko_613",
|
|
50
|
+
"is-split-panel-open": "awsui_is-split-panel-open_hyvsj_nbcko_613",
|
|
51
|
+
"split-panel-position-side": "awsui_split-panel-position-side_hyvsj_nbcko_613",
|
|
52
|
+
"has-active-drawer": "awsui_has-active-drawer_hyvsj_nbcko_613",
|
|
53
|
+
"mobile-toolbar": "awsui_mobile-toolbar_hyvsj_nbcko_622",
|
|
54
|
+
"remove-high-contrast-header": "awsui_remove-high-contrast-header_hyvsj_nbcko_639",
|
|
55
|
+
"mobile-toolbar-nav": "awsui_mobile-toolbar-nav_hyvsj_nbcko_643",
|
|
56
|
+
"mobile-toolbar-breadcrumbs": "awsui_mobile-toolbar-breadcrumbs_hyvsj_nbcko_647",
|
|
57
|
+
"mobile-toolbar-tools": "awsui_mobile-toolbar-tools_hyvsj_nbcko_651",
|
|
58
|
+
"navigation-container": "awsui_navigation-container_hyvsj_nbcko_660",
|
|
59
|
+
"show-navigation": "awsui_show-navigation_hyvsj_nbcko_698",
|
|
60
|
+
"animating": "awsui_animating_hyvsj_nbcko_721",
|
|
61
|
+
"showButtons": "awsui_showButtons_hyvsj_nbcko_1",
|
|
62
|
+
"navigation": "awsui_navigation_hyvsj_nbcko_660",
|
|
63
|
+
"openNavigation": "awsui_openNavigation_hyvsj_nbcko_1",
|
|
64
|
+
"animated-content": "awsui_animated-content_hyvsj_nbcko_783",
|
|
65
|
+
"hide-navigation": "awsui_hide-navigation_hyvsj_nbcko_792",
|
|
66
|
+
"notifications": "awsui_notifications_hyvsj_nbcko_802",
|
|
67
|
+
"sticky-notifications": "awsui_sticky-notifications_hyvsj_nbcko_808",
|
|
68
|
+
"split-panel-bottom": "awsui_split-panel-bottom_hyvsj_nbcko_825",
|
|
69
|
+
"position-bottom": "awsui_position-bottom_hyvsj_nbcko_872",
|
|
70
|
+
"openSplitPanelBottom": "awsui_openSplitPanelBottom_hyvsj_nbcko_1",
|
|
71
|
+
"split-panel-side": "awsui_split-panel-side_hyvsj_nbcko_901",
|
|
72
|
+
"position-side": "awsui_position-side_hyvsj_nbcko_914",
|
|
73
|
+
"tools-container": "awsui_tools-container_hyvsj_nbcko_936",
|
|
74
|
+
"tools": "awsui_tools_hyvsj_nbcko_936",
|
|
75
|
+
"openTools": "awsui_openTools_hyvsj_nbcko_1",
|
|
76
|
+
"has-tools-form-persistence": "awsui_has-tools-form-persistence_hyvsj_nbcko_1027",
|
|
77
|
+
"hide-tools": "awsui_hide-tools_hyvsj_nbcko_1037",
|
|
78
|
+
"show-tools": "awsui_show-tools_hyvsj_nbcko_1049",
|
|
79
|
+
"has-tools-form": "awsui_has-tools-form_hyvsj_nbcko_1027",
|
|
80
|
+
"trigger-badge-wrapper": "awsui_trigger-badge-wrapper_hyvsj_nbcko_1132",
|
|
81
|
+
"trigger": "awsui_trigger_hyvsj_nbcko_1132",
|
|
82
|
+
"selected": "awsui_selected_hyvsj_nbcko_1209",
|
|
83
|
+
"badge": "awsui_badge_hyvsj_nbcko_1229",
|
|
84
|
+
"trigger-wrapper": "awsui_trigger-wrapper_hyvsj_nbcko_1233",
|
|
85
|
+
"dot": "awsui_dot_hyvsj_nbcko_1244"
|
|
86
86
|
};
|
|
87
87
|
|
|
@@ -4,15 +4,11 @@ interface StickyHeaderContextProps {
|
|
|
4
4
|
}
|
|
5
5
|
interface ComputeOffsetProps {
|
|
6
6
|
isMobile: boolean;
|
|
7
|
-
isVisualRefresh: boolean;
|
|
8
|
-
customCssProps: Record<string, string>;
|
|
9
7
|
__stickyOffset?: number;
|
|
10
8
|
__mobileStickyOffset?: number;
|
|
11
|
-
mobileBarHeight?: number;
|
|
12
|
-
stickyOffsetTop: number;
|
|
13
9
|
hasInnerOverflowParents: boolean;
|
|
14
10
|
}
|
|
15
|
-
export declare function computeOffset({ isMobile,
|
|
11
|
+
export declare function computeOffset({ isMobile, __stickyOffset, __mobileStickyOffset, hasInnerOverflowParents, }: ComputeOffsetProps): string;
|
|
16
12
|
export declare const StickyHeaderContext: import("react").Context<StickyHeaderContextProps>;
|
|
17
13
|
export declare const useStickyHeader: (rootRef: RefObject<HTMLDivElement>, headerRef: RefObject<HTMLDivElement>, __stickyHeader?: boolean, __stickyOffset?: number, __mobileStickyOffset?: number, __disableMobile?: boolean) => {
|
|
18
14
|
isSticky: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-sticky-header.d.ts","sourceRoot":"","sources":["../../../src/container/use-sticky-header.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAoE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"use-sticky-header.d.ts","sourceRoot":"","sources":["../../../src/container/use-sticky-header.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAoE,MAAM,OAAO,CAAC;AAMpG,UAAU,wBAAwB;IAChC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,uBAAuB,EAAE,OAAO,CAAC;CAClC;AAED,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,cAAc,EACd,oBAAoB,EACpB,uBAAuB,GACxB,EAAE,kBAAkB,GAAG,MAAM,CAQ7B;AAED,eAAO,MAAM,mBAAmB,mDAE9B,CAAC;AAEH,eAAO,MAAM,eAAe,YACjB,UAAU,cAAc,CAAC,aACvB,UAAU,cAAc,CAAC,mBACnB,OAAO,mBACP,MAAM,yBACA,MAAM;;;;;;;;;;CAmE9B,CAAC"}
|
|
@@ -1,48 +1,25 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import { useState, useLayoutEffect, useCallback, useEffect, createContext } from 'react';
|
|
4
|
-
import { useAppLayoutContext } from '../internal/context/app-layout-context';
|
|
5
4
|
import { findUpUntil, supportsStickyPosition } from '../internal/utils/dom';
|
|
6
5
|
import { getOverflowParents } from '../internal/utils/scrollable-containers';
|
|
7
|
-
import { useVisualRefresh } from '../internal/hooks/use-visual-mode';
|
|
8
|
-
import customCssProps from '../internal/generated/custom-css-properties';
|
|
9
6
|
import { useMobile } from '../internal/hooks/use-mobile';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
* on the Layout subcomponent. Thus, if the Container header is sticky, we are in Visual Refresh and use
|
|
16
|
-
* body scroll then we will use that property. When a component is used outside AppLayout, we fall back
|
|
17
|
-
* to the default offset calculated in AppLayoutDomContext.
|
|
18
|
-
*/
|
|
19
|
-
let computedOffset = `${effectiveStickyOffset}px`;
|
|
20
|
-
if (isMobile) {
|
|
21
|
-
// This mobile offset is only relevant for full page tables in the mobile viewport.
|
|
22
|
-
// It is obtained by the sum of stickyOffsetTop (AppLayout header height), mobileBarHeight (AppLayout mobile bar height) and
|
|
23
|
-
// __stickyOffset (value of the stickyHeaderVerticalOffset, set by users), from which we subtract __mobileStickyOffset (which is the table tools header height).
|
|
24
|
-
// Classic offset is calculated using the AppLayout context
|
|
25
|
-
const classicOffset = `${stickyOffsetTop + mobileBarHeight + (__stickyOffset !== null && __stickyOffset !== void 0 ? __stickyOffset : 0) - (__mobileStickyOffset !== null && __mobileStickyOffset !== void 0 ? __mobileStickyOffset : 0)}px`;
|
|
26
|
-
// VR offset is calculated using CSS custom properties
|
|
27
|
-
const visualRefreshOffset = `calc(var(${customCssProps.offsetTop}, 0px) + var(${customCssProps.mobileBarHeight}, 0px) + ${(__stickyOffset !== null && __stickyOffset !== void 0 ? __stickyOffset : 0) - (__mobileStickyOffset !== null && __mobileStickyOffset !== void 0 ? __mobileStickyOffset : 0)}px)`;
|
|
28
|
-
computedOffset = isVisualRefresh ? visualRefreshOffset : classicOffset;
|
|
7
|
+
import globalVars from '../internal/styles/global-vars';
|
|
8
|
+
export function computeOffset({ isMobile, __stickyOffset, __mobileStickyOffset, hasInnerOverflowParents, }) {
|
|
9
|
+
const localOffset = isMobile ? (__stickyOffset !== null && __stickyOffset !== void 0 ? __stickyOffset : 0) - (__mobileStickyOffset !== null && __mobileStickyOffset !== void 0 ? __mobileStickyOffset : 0) : __stickyOffset !== null && __stickyOffset !== void 0 ? __stickyOffset : 0;
|
|
10
|
+
if (hasInnerOverflowParents) {
|
|
11
|
+
return `${localOffset}px`;
|
|
29
12
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
return computedOffset;
|
|
13
|
+
const globalOffset = `var(${globalVars.stickyVerticalTopOffset}, 0px)`;
|
|
14
|
+
return `calc(${globalOffset} + ${localOffset}px)`;
|
|
34
15
|
}
|
|
35
16
|
export const StickyHeaderContext = createContext({
|
|
36
17
|
isStuck: false,
|
|
37
18
|
});
|
|
38
19
|
export const useStickyHeader = (rootRef, headerRef, __stickyHeader, __stickyOffset, __mobileStickyOffset, __disableMobile = true) => {
|
|
39
20
|
const isMobile = useMobile();
|
|
40
|
-
// We reach into AppLayoutContext in case sticky header needs to be offset down by the height
|
|
41
|
-
// of other sticky elements positioned on top of the view.
|
|
42
|
-
const { stickyOffsetTop, mobileBarHeight } = useAppLayoutContext();
|
|
43
21
|
const disableSticky = isMobile && __disableMobile;
|
|
44
22
|
const isSticky = supportsStickyPosition() && !disableSticky && !!__stickyHeader;
|
|
45
|
-
const isVisualRefresh = useVisualRefresh();
|
|
46
23
|
// If it has overflow parents inside the app layout, we shouldn't apply a sticky offset.
|
|
47
24
|
const [hasInnerOverflowParents, setHasInnerOverflowParents] = useState(false);
|
|
48
25
|
const [isStuck, setIsStuck] = useState(false);
|
|
@@ -59,12 +36,8 @@ export const useStickyHeader = (rootRef, headerRef, __stickyHeader, __stickyOffs
|
|
|
59
36
|
}, [rootRef]);
|
|
60
37
|
const computedOffset = computeOffset({
|
|
61
38
|
isMobile,
|
|
62
|
-
isVisualRefresh,
|
|
63
|
-
customCssProps,
|
|
64
39
|
__stickyOffset,
|
|
65
40
|
__mobileStickyOffset,
|
|
66
|
-
mobileBarHeight,
|
|
67
|
-
stickyOffsetTop,
|
|
68
41
|
hasInnerOverflowParents,
|
|
69
42
|
});
|
|
70
43
|
const stickyStyles = isSticky
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-sticky-header.js","sourceRoot":"","sources":["../../../src/container/use-sticky-header.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAa,QAAQ,EAAE,eAAe,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACpG,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"use-sticky-header.js","sourceRoot":"","sources":["../../../src/container/use-sticky-header.ts"],"names":[],"mappings":"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","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { RefObject, useState, useLayoutEffect, useCallback, useEffect, createContext } from 'react';\nimport { findUpUntil, supportsStickyPosition } from '../internal/utils/dom';\nimport { getOverflowParents } from '../internal/utils/scrollable-containers';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport globalVars from '../internal/styles/global-vars';\n\ninterface StickyHeaderContextProps {\n isStuck: boolean;\n}\n\ninterface ComputeOffsetProps {\n isMobile: boolean;\n __stickyOffset?: number;\n __mobileStickyOffset?: number;\n hasInnerOverflowParents: boolean;\n}\n\nexport function computeOffset({\n isMobile,\n __stickyOffset,\n __mobileStickyOffset,\n hasInnerOverflowParents,\n}: ComputeOffsetProps): string {\n const localOffset = isMobile ? (__stickyOffset ?? 0) - (__mobileStickyOffset ?? 0) : __stickyOffset ?? 0;\n if (hasInnerOverflowParents) {\n return `${localOffset}px`;\n }\n const globalOffset = `var(${globalVars.stickyVerticalTopOffset}, 0px)`;\n\n return `calc(${globalOffset} + ${localOffset}px)`;\n}\n\nexport const StickyHeaderContext = createContext<StickyHeaderContextProps>({\n isStuck: false,\n});\n\nexport const useStickyHeader = (\n rootRef: RefObject<HTMLDivElement>,\n headerRef: RefObject<HTMLDivElement>,\n __stickyHeader?: boolean,\n __stickyOffset?: number,\n __mobileStickyOffset?: number,\n __disableMobile = true\n) => {\n const isMobile = useMobile();\n const disableSticky = isMobile && __disableMobile;\n const isSticky = supportsStickyPosition() && !disableSticky && !!__stickyHeader;\n\n // If it has overflow parents inside the app layout, we shouldn't apply a sticky offset.\n const [hasInnerOverflowParents, setHasInnerOverflowParents] = useState(false);\n const [isStuck, setIsStuck] = useState(false);\n useLayoutEffect(() => {\n if (rootRef.current) {\n const overflowParents = getOverflowParents(rootRef.current);\n const mainElement = findUpUntil(rootRef.current, elem => elem.tagName === 'MAIN');\n // In both versions of the app layout, the scrolling element for disableBodyScroll\n // is the <main>. If the closest overflow parent is also the closest <main> and we have\n // offset values, it's safe to assume that it's the app layout scroll root and we\n // should stop there.\n setHasInnerOverflowParents(overflowParents.length > 0 && overflowParents[0] !== mainElement);\n }\n }, [rootRef]);\n\n const computedOffset = computeOffset({\n isMobile,\n __stickyOffset,\n __mobileStickyOffset,\n hasInnerOverflowParents,\n });\n\n const stickyStyles = isSticky\n ? {\n style: {\n top: computedOffset,\n },\n }\n : {};\n\n // \"stuck\" state, when the header has moved from its original posititon has a\n // box-shadow, applied here by a \"header-stuck\" className\n const checkIfStuck = useCallback(() => {\n if (rootRef.current && headerRef.current) {\n const rootTopBorderWidth = parseFloat(getComputedStyle(rootRef.current).borderTopWidth) || 0;\n const rootTop = rootRef.current.getBoundingClientRect().top + rootTopBorderWidth;\n const headerTop = headerRef.current.getBoundingClientRect().top;\n\n if (rootTop < headerTop) {\n setIsStuck(true);\n } else {\n setIsStuck(false);\n }\n }\n }, [rootRef, headerRef]);\n useEffect(() => {\n if (isSticky) {\n window.addEventListener('scroll', checkIfStuck, true);\n window.addEventListener('resize', checkIfStuck);\n return () => {\n window.removeEventListener('scroll', checkIfStuck, true);\n window.removeEventListener('resize', checkIfStuck);\n };\n }\n }, [isSticky, checkIfStuck]);\n return {\n isSticky,\n isStuck,\n stickyStyles,\n };\n};\n"]}
|
package/flashbar/styles.css.js
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"flash-with-motion": "awsui_flash-with-
|
|
5
|
-
"enter": "
|
|
6
|
-
"flash-body": "awsui_flash-
|
|
7
|
-
"flash-message": "awsui_flash-
|
|
8
|
-
"flash-header": "awsui_flash-
|
|
9
|
-
"flash-content": "awsui_flash-
|
|
10
|
-
"action-button-wrapper": "awsui_action-button-
|
|
11
|
-
"dismiss-button-wrapper": "awsui_dismiss-button-
|
|
12
|
-
"flash-icon": "awsui_flash-
|
|
13
|
-
"entering": "
|
|
14
|
-
"entered": "
|
|
15
|
-
"exiting": "
|
|
16
|
-
"stack": "
|
|
17
|
-
"animation-running": "awsui_animation-
|
|
18
|
-
"item": "
|
|
19
|
-
"flash-list-item": "awsui_flash-list-
|
|
20
|
-
"notification-bar": "awsui_notification-
|
|
21
|
-
"collapsed": "
|
|
22
|
-
"animation-ready": "awsui_animation-
|
|
23
|
-
"expanded-only": "awsui_expanded-
|
|
24
|
-
"expanded": "
|
|
25
|
-
"flash": "
|
|
26
|
-
"collapsible": "
|
|
27
|
-
"short-list": "awsui_short-
|
|
28
|
-
"visual-refresh": "awsui_visual-
|
|
29
|
-
"status": "
|
|
30
|
-
"header": "
|
|
31
|
-
"item-count": "awsui_item-
|
|
32
|
-
"button": "
|
|
33
|
-
"type-count": "awsui_type-
|
|
34
|
-
"count-number": "awsui_count-
|
|
35
|
-
"icon": "
|
|
36
|
-
"floating": "
|
|
37
|
-
"flashbar": "
|
|
38
|
-
"flash-refresh": "awsui_flash-
|
|
39
|
-
"flash-list": "awsui_flash-
|
|
40
|
-
"flash-focus-container": "awsui_flash-focus-
|
|
41
|
-
"flash-text": "awsui_flash-
|
|
42
|
-
"dismiss-button": "awsui_dismiss-
|
|
43
|
-
"breakpoint-default": "awsui_breakpoint-
|
|
44
|
-
"action-button": "awsui_action-
|
|
45
|
-
"action-slot": "awsui_action-
|
|
46
|
-
"flash-type-success": "awsui_flash-type-
|
|
47
|
-
"flash-type-error": "awsui_flash-type-
|
|
48
|
-
"flash-type-info": "awsui_flash-type-
|
|
49
|
-
"flash-type-in-progress": "awsui_flash-type-in-
|
|
50
|
-
"flash-type-warning": "awsui_flash-type-
|
|
4
|
+
"flash-with-motion": "awsui_flash-with-motion_1q84n_sj5ey_99",
|
|
5
|
+
"enter": "awsui_enter_1q84n_sj5ey_99",
|
|
6
|
+
"flash-body": "awsui_flash-body_1q84n_sj5ey_113",
|
|
7
|
+
"flash-message": "awsui_flash-message_1q84n_sj5ey_113",
|
|
8
|
+
"flash-header": "awsui_flash-header_1q84n_sj5ey_113",
|
|
9
|
+
"flash-content": "awsui_flash-content_1q84n_sj5ey_114",
|
|
10
|
+
"action-button-wrapper": "awsui_action-button-wrapper_1q84n_sj5ey_115",
|
|
11
|
+
"dismiss-button-wrapper": "awsui_dismiss-button-wrapper_1q84n_sj5ey_116",
|
|
12
|
+
"flash-icon": "awsui_flash-icon_1q84n_sj5ey_139",
|
|
13
|
+
"entering": "awsui_entering_1q84n_sj5ey_152",
|
|
14
|
+
"entered": "awsui_entered_1q84n_sj5ey_173",
|
|
15
|
+
"exiting": "awsui_exiting_1q84n_sj5ey_278",
|
|
16
|
+
"stack": "awsui_stack_1q84n_sj5ey_300",
|
|
17
|
+
"animation-running": "awsui_animation-running_1q84n_sj5ey_300",
|
|
18
|
+
"item": "awsui_item_1q84n_sj5ey_300",
|
|
19
|
+
"flash-list-item": "awsui_flash-list-item_1q84n_sj5ey_301",
|
|
20
|
+
"notification-bar": "awsui_notification-bar_1q84n_sj5ey_302",
|
|
21
|
+
"collapsed": "awsui_collapsed_1q84n_sj5ey_322",
|
|
22
|
+
"animation-ready": "awsui_animation-ready_1q84n_sj5ey_322",
|
|
23
|
+
"expanded-only": "awsui_expanded-only_1q84n_sj5ey_322",
|
|
24
|
+
"expanded": "awsui_expanded_1q84n_sj5ey_322",
|
|
25
|
+
"flash": "awsui_flash_1q84n_sj5ey_99",
|
|
26
|
+
"collapsible": "awsui_collapsible_1q84n_sj5ey_386",
|
|
27
|
+
"short-list": "awsui_short-list_1q84n_sj5ey_392",
|
|
28
|
+
"visual-refresh": "awsui_visual-refresh_1q84n_sj5ey_392",
|
|
29
|
+
"status": "awsui_status_1q84n_sj5ey_605",
|
|
30
|
+
"header": "awsui_header_1q84n_sj5ey_605",
|
|
31
|
+
"item-count": "awsui_item-count_1q84n_sj5ey_606",
|
|
32
|
+
"button": "awsui_button_1q84n_sj5ey_607",
|
|
33
|
+
"type-count": "awsui_type-count_1q84n_sj5ey_640",
|
|
34
|
+
"count-number": "awsui_count-number_1q84n_sj5ey_640",
|
|
35
|
+
"icon": "awsui_icon_1q84n_sj5ey_674",
|
|
36
|
+
"floating": "awsui_floating_1q84n_sj5ey_715",
|
|
37
|
+
"flashbar": "awsui_flashbar_1q84n_sj5ey_723",
|
|
38
|
+
"flash-refresh": "awsui_flash-refresh_1q84n_sj5ey_798",
|
|
39
|
+
"flash-list": "awsui_flash-list_1q84n_sj5ey_301",
|
|
40
|
+
"flash-focus-container": "awsui_flash-focus-container_1q84n_sj5ey_819",
|
|
41
|
+
"flash-text": "awsui_flash-text_1q84n_sj5ey_849",
|
|
42
|
+
"dismiss-button": "awsui_dismiss-button_1q84n_sj5ey_116",
|
|
43
|
+
"breakpoint-default": "awsui_breakpoint-default_1q84n_sj5ey_891",
|
|
44
|
+
"action-button": "awsui_action-button_1q84n_sj5ey_115",
|
|
45
|
+
"action-slot": "awsui_action-slot_1q84n_sj5ey_901",
|
|
46
|
+
"flash-type-success": "awsui_flash-type-success_1q84n_sj5ey_905",
|
|
47
|
+
"flash-type-error": "awsui_flash-type-error_1q84n_sj5ey_909",
|
|
48
|
+
"flash-type-info": "awsui_flash-type-info_1q84n_sj5ey_913",
|
|
49
|
+
"flash-type-in-progress": "awsui_flash-type-in-progress_1q84n_sj5ey_914",
|
|
50
|
+
"flash-type-warning": "awsui_flash-type-warning_1q84n_sj5ey_918"
|
|
51
51
|
};
|
|
52
52
|
|