@cloudscape-design/components 3.0.400 → 3.0.402
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/context.d.ts.map +1 -1
- package/app-layout/visual-refresh/context.js +8 -4
- package/app-layout/visual-refresh/context.js.map +1 -1
- package/app-layout/visual-refresh/drawers.d.ts.map +1 -1
- package/app-layout/visual-refresh/drawers.js +12 -10
- package/app-layout/visual-refresh/drawers.js.map +1 -1
- package/app-layout/visual-refresh/main.d.ts.map +1 -1
- package/app-layout/visual-refresh/main.js +2 -1
- package/app-layout/visual-refresh/main.js.map +1 -1
- package/app-layout/visual-refresh/styles.css.js +76 -74
- package/app-layout/visual-refresh/styles.scoped.css +183 -177
- package/app-layout/visual-refresh/styles.selectors.js +76 -74
- package/container/internal.d.ts.map +1 -1
- package/container/internal.js +7 -3
- package/container/internal.js.map +1 -1
- package/expandable-section/expandable-section-container.d.ts +1 -4
- package/expandable-section/expandable-section-container.d.ts.map +1 -1
- package/expandable-section/expandable-section-container.js +5 -3
- package/expandable-section/expandable-section-container.js.map +1 -1
- package/expandable-section/index.d.ts.map +1 -1
- package/expandable-section/index.js +1 -13
- package/expandable-section/index.js.map +1 -1
- package/expandable-section/internal.d.ts +2 -3
- package/expandable-section/internal.d.ts.map +1 -1
- package/expandable-section/internal.js +2 -2
- package/expandable-section/internal.js.map +1 -1
- package/form/index.d.ts.map +1 -1
- package/form/index.js +6 -4
- package/form/index.js.map +1 -1
- package/i18n/dynamic.js +2 -0
- package/i18n/messages/all.all.js +778 -4
- package/i18n/messages/all.all.json +788 -4
- package/i18n/messages/all.de.js +6 -1
- package/i18n/messages/all.de.json +6 -1
- package/i18n/messages/all.en-GB.js +5 -0
- package/i18n/messages/all.en-GB.json +5 -0
- package/i18n/messages/all.en.js +4 -0
- package/i18n/messages/all.en.json +4 -0
- package/i18n/messages/all.es.js +7 -2
- package/i18n/messages/all.es.json +7 -2
- package/i18n/messages/all.fr.js +5 -0
- package/i18n/messages/all.fr.json +5 -0
- package/i18n/messages/all.id.js +5 -0
- package/i18n/messages/all.id.json +5 -0
- package/i18n/messages/all.it.js +5 -0
- package/i18n/messages/all.it.json +5 -0
- package/i18n/messages/all.ja.js +5 -0
- package/i18n/messages/all.ja.json +5 -0
- package/i18n/messages/all.ko.js +5 -0
- package/i18n/messages/all.ko.json +5 -0
- package/i18n/messages/all.pt-BR.js +6 -1
- package/i18n/messages/all.pt-BR.json +6 -1
- package/i18n/messages/all.tr.d.ts +3 -0
- package/i18n/messages/all.tr.js +719 -0
- package/i18n/messages/all.tr.json +729 -0
- package/i18n/messages/all.zh-CN.js +5 -0
- package/i18n/messages/all.zh-CN.json +5 -0
- package/i18n/messages/all.zh-TW.js +5 -0
- package/i18n/messages/all.zh-TW.json +5 -0
- package/i18n/messages-types.d.ts +48 -44
- package/i18n/messages-types.d.ts.map +1 -1
- package/i18n/messages-types.js.map +1 -1
- package/internal/analytics/components/analytics-funnel.d.ts +2 -2
- package/internal/analytics/components/analytics-funnel.d.ts.map +1 -1
- package/internal/analytics/components/analytics-funnel.js +6 -4
- package/internal/analytics/components/analytics-funnel.js.map +1 -1
- package/internal/analytics/context/analytics-context.d.ts +1 -0
- package/internal/analytics/context/analytics-context.d.ts.map +1 -1
- package/internal/analytics/context/analytics-context.js +1 -0
- package/internal/analytics/context/analytics-context.js.map +1 -1
- package/internal/analytics/hooks/use-funnel.d.ts +1 -0
- package/internal/analytics/hooks/use-funnel.d.ts.map +1 -1
- package/internal/analytics/hooks/use-funnel.js +5 -1
- package/internal/analytics/hooks/use-funnel.js.map +1 -1
- package/internal/analytics/interfaces.d.ts +1 -0
- package/internal/analytics/interfaces.d.ts.map +1 -1
- package/internal/analytics/interfaces.js.map +1 -1
- package/internal/context/modal-context.d.ts +8 -0
- package/internal/context/modal-context.d.ts.map +1 -0
- package/internal/context/modal-context.js +9 -0
- package/internal/context/modal-context.js.map +1 -0
- package/internal/environment.js +1 -1
- package/internal/environment.json +1 -1
- package/internal/manifest.json +1 -1
- package/modal/internal.d.ts.map +1 -1
- package/modal/internal.js +23 -18
- package/modal/internal.js.map +1 -1
- package/package.json +3 -1
- package/pie-chart/styles.css.js +27 -27
- package/pie-chart/styles.scoped.css +60 -42
- package/pie-chart/styles.selectors.js +27 -27
- package/pie-chart/utils.d.ts.map +1 -1
- package/pie-chart/utils.js +2 -1
- package/pie-chart/utils.js.map +1 -1
- package/property-filter/utils.d.ts +1 -1
- package/split-panel/side.d.ts.map +1 -1
- package/split-panel/side.js +0 -1
- package/split-panel/side.js.map +1 -1
- package/split-panel/styles.css.js +55 -56
- package/split-panel/styles.scoped.css +80 -84
- package/split-panel/styles.selectors.js +55 -56
- package/table/internal.d.ts.map +1 -1
- package/table/internal.js +4 -4
- package/table/internal.js.map +1 -1
- package/table/sticky-scrollbar/styles.css.js +6 -6
- package/table/sticky-scrollbar/styles.scoped.css +8 -8
- package/table/sticky-scrollbar/styles.selectors.js +6 -6
|
@@ -2,79 +2,81 @@
|
|
|
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-
|
|
22
|
-
"drawer-
|
|
23
|
-
"drawer-
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"content-
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"has-content-gap-
|
|
32
|
-
"content-
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"split-panel
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"is-
|
|
45
|
-
"is-
|
|
46
|
-
"split-panel-
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"mobile-toolbar
|
|
50
|
-
"mobile-toolbar-
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
5
|
+
"background": "awsui_background_hyvsj_1q0bp_93",
|
|
6
|
+
"scrolling-background": "awsui_scrolling-background_hyvsj_1q0bp_96",
|
|
7
|
+
"sticky-background": "awsui_sticky-background_hyvsj_1q0bp_102",
|
|
8
|
+
"has-sticky-notifications": "awsui_has-sticky-notifications_hyvsj_1q0bp_110",
|
|
9
|
+
"breadcrumbs": "awsui_breadcrumbs_hyvsj_1q0bp_123",
|
|
10
|
+
"has-sticky-background": "awsui_has-sticky-background_hyvsj_1q0bp_133",
|
|
11
|
+
"drawers-container": "awsui_drawers-container_hyvsj_1q0bp_145",
|
|
12
|
+
"has-open-drawer": "awsui_has-open-drawer_hyvsj_1q0bp_156",
|
|
13
|
+
"disable-body-scroll": "awsui_disable-body-scroll_hyvsj_1q0bp_191",
|
|
14
|
+
"drawers-desktop-triggers-container": "awsui_drawers-desktop-triggers-container_hyvsj_1q0bp_196",
|
|
15
|
+
"has-multiple-triggers": "awsui_has-multiple-triggers_hyvsj_1q0bp_215",
|
|
16
|
+
"drawers-mobile-triggers-container": "awsui_drawers-mobile-triggers-container_hyvsj_1q0bp_247",
|
|
17
|
+
"drawers-trigger-content": "awsui_drawers-trigger-content_hyvsj_1q0bp_251",
|
|
18
|
+
"drawers-trigger-overflow": "awsui_drawers-trigger-overflow_hyvsj_1q0bp_277",
|
|
19
|
+
"drawers-trigger": "awsui_drawers-trigger_hyvsj_1q0bp_251",
|
|
20
|
+
"drawer": "awsui_drawer_hyvsj_1q0bp_145",
|
|
21
|
+
"drawer-content-container": "awsui_drawer-content-container_hyvsj_1q0bp_307",
|
|
22
|
+
"drawer-close-button": "awsui_drawer-close-button_hyvsj_1q0bp_316",
|
|
23
|
+
"drawer-content": "awsui_drawer-content_hyvsj_1q0bp_307",
|
|
24
|
+
"drawer-slider": "awsui_drawer-slider_hyvsj_1q0bp_324",
|
|
25
|
+
"is-drawer-open": "awsui_is-drawer-open_hyvsj_1q0bp_331",
|
|
26
|
+
"content": "awsui_content_hyvsj_1q0bp_356",
|
|
27
|
+
"layout": "awsui_layout_hyvsj_1q0bp_377",
|
|
28
|
+
"has-max-content-width": "awsui_has-max-content-width_hyvsj_1q0bp_460",
|
|
29
|
+
"content-type-dashboard": "awsui_content-type-dashboard_hyvsj_1q0bp_475",
|
|
30
|
+
"is-overlap-disabled": "awsui_is-overlap-disabled_hyvsj_1q0bp_492",
|
|
31
|
+
"has-content-gap-left": "awsui_has-content-gap-left_hyvsj_1q0bp_524",
|
|
32
|
+
"has-content-gap-right": "awsui_has-content-gap-right_hyvsj_1q0bp_527",
|
|
33
|
+
"content-first-child-notifications": "awsui_content-first-child-notifications_hyvsj_1q0bp_537",
|
|
34
|
+
"has-breadcrumbs": "awsui_has-breadcrumbs_hyvsj_1q0bp_540",
|
|
35
|
+
"content-first-child-header": "awsui_content-first-child-header_hyvsj_1q0bp_543",
|
|
36
|
+
"has-header": "awsui_has-header_hyvsj_1q0bp_543",
|
|
37
|
+
"content-first-child-main": "awsui_content-first-child-main_hyvsj_1q0bp_564",
|
|
38
|
+
"disable-content-paddings": "awsui_disable-content-paddings_hyvsj_1q0bp_564",
|
|
39
|
+
"has-split-panel": "awsui_has-split-panel_hyvsj_1q0bp_607",
|
|
40
|
+
"split-panel-position-bottom": "awsui_split-panel-position-bottom_hyvsj_1q0bp_607",
|
|
41
|
+
"block-body-scroll": "awsui_block-body-scroll_hyvsj_1q0bp_623",
|
|
42
|
+
"unfocusable": "awsui_unfocusable_hyvsj_1q0bp_628",
|
|
43
|
+
"container": "awsui_container_hyvsj_1q0bp_638",
|
|
44
|
+
"is-navigation-open": "awsui_is-navigation-open_hyvsj_1q0bp_663",
|
|
45
|
+
"is-tools-open": "awsui_is-tools-open_hyvsj_1q0bp_666",
|
|
46
|
+
"is-split-panel-open": "awsui_is-split-panel-open_hyvsj_1q0bp_666",
|
|
47
|
+
"split-panel-position-side": "awsui_split-panel-position-side_hyvsj_1q0bp_666",
|
|
48
|
+
"has-active-drawer": "awsui_has-active-drawer_hyvsj_1q0bp_666",
|
|
49
|
+
"mobile-toolbar": "awsui_mobile-toolbar_hyvsj_1q0bp_675",
|
|
50
|
+
"mobile-toolbar-nav": "awsui_mobile-toolbar-nav_hyvsj_1q0bp_691",
|
|
51
|
+
"mobile-toolbar-breadcrumbs": "awsui_mobile-toolbar-breadcrumbs_hyvsj_1q0bp_695",
|
|
52
|
+
"mobile-toolbar-tools": "awsui_mobile-toolbar-tools_hyvsj_1q0bp_699",
|
|
53
|
+
"navigation-container": "awsui_navigation-container_hyvsj_1q0bp_708",
|
|
54
|
+
"show-navigation": "awsui_show-navigation_hyvsj_1q0bp_752",
|
|
55
|
+
"animating": "awsui_animating_hyvsj_1q0bp_774",
|
|
56
|
+
"showButtons": "awsui_showButtons_hyvsj_1q0bp_1",
|
|
57
|
+
"navigation": "awsui_navigation_hyvsj_1q0bp_708",
|
|
58
|
+
"openNavigation": "awsui_openNavigation_hyvsj_1q0bp_1",
|
|
59
|
+
"animated-content": "awsui_animated-content_hyvsj_1q0bp_836",
|
|
60
|
+
"hide-navigation": "awsui_hide-navigation_hyvsj_1q0bp_845",
|
|
61
|
+
"notifications": "awsui_notifications_hyvsj_1q0bp_855",
|
|
62
|
+
"sticky-notifications": "awsui_sticky-notifications_hyvsj_1q0bp_861",
|
|
63
|
+
"split-panel-bottom": "awsui_split-panel-bottom_hyvsj_1q0bp_878",
|
|
64
|
+
"position-bottom": "awsui_position-bottom_hyvsj_1q0bp_925",
|
|
65
|
+
"openSplitPanelBottom": "awsui_openSplitPanelBottom_hyvsj_1q0bp_1",
|
|
66
|
+
"split-panel-side": "awsui_split-panel-side_hyvsj_1q0bp_954",
|
|
67
|
+
"position-side": "awsui_position-side_hyvsj_1q0bp_967",
|
|
68
|
+
"tools-container": "awsui_tools-container_hyvsj_1q0bp_986",
|
|
69
|
+
"tools": "awsui_tools_hyvsj_1q0bp_986",
|
|
70
|
+
"openTools": "awsui_openTools_hyvsj_1q0bp_1",
|
|
71
|
+
"has-tools-form-persistence": "awsui_has-tools-form-persistence_hyvsj_1q0bp_1081",
|
|
72
|
+
"hide-tools": "awsui_hide-tools_hyvsj_1q0bp_1091",
|
|
73
|
+
"show-tools": "awsui_show-tools_hyvsj_1q0bp_1103",
|
|
74
|
+
"has-tools-form": "awsui_has-tools-form_hyvsj_1q0bp_1081",
|
|
75
|
+
"trigger-badge-wrapper": "awsui_trigger-badge-wrapper_hyvsj_1q0bp_1163",
|
|
76
|
+
"trigger": "awsui_trigger_hyvsj_1q0bp_1163",
|
|
77
|
+
"selected": "awsui_selected_hyvsj_1q0bp_1227",
|
|
78
|
+
"badge": "awsui_badge_hyvsj_1q0bp_1247",
|
|
79
|
+
"trigger-wrapper": "awsui_trigger-wrapper_hyvsj_1q0bp_1251",
|
|
80
|
+
"dot": "awsui_dot_hyvsj_1q0bp_1257"
|
|
79
81
|
};
|
|
80
82
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"lib/default/","sources":["container/internal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA4B,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAG9C,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAOlF,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"lib/default/","sources":["container/internal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA4B,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAG9C,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAOlF,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAI1E,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,EAAE,0BAA0B;IACzG,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC9C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,cAAc,CAAC,SAAS,CAAC,GAAG,UAAU,GAAG,WAAW,GAAG,OAAO,CAAC;IAEzE,oBAAoB,CAAC,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC,oBAAoB,CAAC,CAAC;IACjF,YAAY,CAAC,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC,YAAY,CAAC,CAAC;CAClE;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,sBAAsB,eAWvE;AAED,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EACxC,MAAM,EACN,MAAM,EACN,QAAQ,EACR,OAAmB,EACnB,qBAA6B,EAC7B,sBAA8B,EAC9B,SAAS,EACT,KAAK,EACL,cAAc,EACd,oBAAoB,EACpB,cAAsB,EACtB,iBAAwB,EACxB,sBAA8B,EAC9B,uBAA+B,EAC/B,eAAuB,EACvB,WAAW,EACX,YAAoB,EACpB,qBAA4B,EAC5B,oBAAoB,EACpB,YAAY,EACZ,GAAG,SAAS,EACb,EAAE,sBAAsB,eAsHxB"}
|
package/container/internal.js
CHANGED
|
@@ -12,9 +12,12 @@ import { useMobile } from '../internal/hooks/use-mobile';
|
|
|
12
12
|
import { useVisualRefresh } from '../internal/hooks/use-visual-mode';
|
|
13
13
|
import styles from './styles.css.js';
|
|
14
14
|
import { useFunnelSubStep } from '../internal/analytics/hooks/use-funnel';
|
|
15
|
+
import { useModalContext } from '../internal/context/modal-context';
|
|
16
|
+
import { useUniqueId } from '../internal/hooks/use-unique-id';
|
|
15
17
|
export function InternalContainerAsSubstep(props) {
|
|
16
18
|
const { subStepRef, funnelSubStepProps } = useFunnelSubStep();
|
|
17
|
-
|
|
19
|
+
const modalContext = useModalContext();
|
|
20
|
+
return (React.createElement(InternalContainer, Object.assign({}, props, { __subStepRef: (modalContext === null || modalContext === void 0 ? void 0 : modalContext.isInModal) ? { current: null } : subStepRef, __funnelSubStepProps: (modalContext === null || modalContext === void 0 ? void 0 : modalContext.isInModal) ? {} : funnelSubStepProps })));
|
|
18
21
|
}
|
|
19
22
|
export default function InternalContainer(_a) {
|
|
20
23
|
var _b;
|
|
@@ -24,11 +27,12 @@ export default function InternalContainer(_a) {
|
|
|
24
27
|
const rootRef = useRef(null);
|
|
25
28
|
const headerRef = useRef(null);
|
|
26
29
|
const { isSticky, isStuck, stickyStyles } = useStickyHeader(rootRef, headerRef, __stickyHeader, __stickyOffset, __mobileStickyOffset, __disableStickyMobile);
|
|
30
|
+
const contentId = useUniqueId();
|
|
27
31
|
const { setHasStickyBackground } = useAppLayoutContext();
|
|
28
32
|
const isRefresh = useVisualRefresh();
|
|
29
33
|
const hasDynamicHeight = isRefresh && variant === 'full-page';
|
|
30
34
|
const overlapElement = useDynamicOverlap({ disabled: !hasDynamicHeight || !__darkHeader });
|
|
31
|
-
const mergedRef = useMergeRefs(rootRef,
|
|
35
|
+
const mergedRef = useMergeRefs(rootRef, __internalRootRef);
|
|
32
36
|
const headerMergedRef = useMergeRefs(headerRef, overlapElement, __headerRef);
|
|
33
37
|
/**
|
|
34
38
|
* The visual refresh AppLayout component needs to know if a child component
|
|
@@ -53,7 +57,7 @@ export default function InternalContainer(_a) {
|
|
|
53
57
|
const mediaPosition = (_b = media === null || media === void 0 ? void 0 : media.position) !== null && _b !== void 0 ? _b : 'top';
|
|
54
58
|
return (React.createElement("div", Object.assign({}, baseProps, __funnelSubStepProps, { className: clsx(baseProps.className, styles.root, styles[`variant-${variant}`], fitHeight && styles['fit-height'], hasMedia && (mediaPosition === 'side' ? styles['with-side-media'] : styles['with-top-media']), shouldHaveStickyStyles && [styles['sticky-enabled']]), ref: mergedRef }),
|
|
55
59
|
hasMedia && (React.createElement("div", { className: clsx(styles[`media-${mediaPosition === 'side' ? 'side' : 'top'}`], styles.media), style: mediaPosition === 'top' ? { height: (media === null || media === void 0 ? void 0 : media.height) || '' } : { width: (media === null || media === void 0 ? void 0 : media.width) || '' } }, media.content)),
|
|
56
|
-
React.createElement("div", { className: clsx(styles['content-wrapper'], fitHeight && styles['content-wrapper-fit-height']) },
|
|
60
|
+
React.createElement("div", { id: contentId, ref: __subStepRef, className: clsx(styles['content-wrapper'], fitHeight && styles['content-wrapper-fit-height']) },
|
|
57
61
|
header && (React.createElement(StickyHeaderContext.Provider, { value: { isStuck } },
|
|
58
62
|
React.createElement("div", Object.assign({ className: clsx(styles.header, styles[`header-variant-${variant}`], {
|
|
59
63
|
[styles['header-sticky-disabled']]: __stickyHeader && !isSticky,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"lib/default/","sources":["container/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAE7E,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAwB1E,MAAM,UAAU,0BAA0B,CAAC,KAA6B;IACtE,MAAM,EAAE,UAAU,EAAE,kBAAkB,EAAE,GAAG,gBAAgB,EAAE,CAAC;IAC9D,OAAO,oBAAC,iBA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xC,CAAC,IACE,YAAY,IAChB,GAAG,EAAE,eAAe,KAEnB,YAAY,CAAC,CAAC,CAAC,CACd,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,8BAA8B,CAAC,IAAG,MAAM,CAAO,CAC5F,CAAC,CAAC,CAAC,CACF,MAAM,CACP,CACG,CACuB,CAChC;YACD,6BACE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,SAAS,IAAI,MAAM,CAAC,oBAAoB,CAAC,EAAE;oBACzE,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,sBAAsB;iBACnD,CAAC,IAED,QAAQ,CACL;YACL,MAAM,IAAI,CACT,6BACE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;oBAC7B,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,sBAAsB;oBACjD,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,uBAAuB;iBACpD,CAAC,IAED,MAAM,CACH,CACP,CACG,CACF,CACP,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, { useEffect, useRef } from 'react';\nimport { ContainerProps } from './interfaces';\nimport { getBaseProps } from '../internal/base-component';\nimport { useAppLayoutContext } from '../internal/context/app-layout-context';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { StickyHeaderContext, useStickyHeader } from './use-sticky-header';\nimport { useDynamicOverlap } from '../internal/hooks/use-dynamic-overlap';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport styles from './styles.css.js';\nimport { useFunnelSubStep } from '../internal/analytics/hooks/use-funnel';\n\nexport interface InternalContainerProps extends Omit<ContainerProps, 'variant'>, InternalBaseComponentProps {\n __stickyHeader?: boolean;\n __stickyOffset?: number;\n __mobileStickyOffset?: number;\n __disableFooterDivider?: boolean;\n __disableFooterPaddings?: boolean;\n __hiddenContent?: boolean;\n __headerRef?: React.RefObject<HTMLDivElement>;\n __darkHeader?: boolean;\n __disableStickyMobile?: boolean;\n /**\n * Additional internal variant:\n * * `embedded` - Use this variant within a parent container (such as a modal,\n * expandable section, container or split panel).\n * * `full-page` – Only for internal use in table, cards and other components\n */\n variant?: ContainerProps['variant'] | 'embedded' | 'full-page' | 'cards';\n\n __funnelSubStepProps?: ReturnType<typeof useFunnelSubStep>['funnelSubStepProps'];\n __subStepRef?: ReturnType<typeof useFunnelSubStep>['subStepRef'];\n}\n\nexport function InternalContainerAsSubstep(props: InternalContainerProps) {\n const { subStepRef, funnelSubStepProps } = useFunnelSubStep();\n return <InternalContainer {...props} __subStepRef={subStepRef} __funnelSubStepProps={funnelSubStepProps} />;\n}\n\nexport default function InternalContainer({\n header,\n footer,\n children,\n variant = 'default',\n disableHeaderPaddings = false,\n disableContentPaddings = false,\n fitHeight,\n media,\n __stickyOffset,\n __mobileStickyOffset,\n __stickyHeader = false,\n __internalRootRef = null,\n __disableFooterDivider = false,\n __disableFooterPaddings = false,\n __hiddenContent = false,\n __headerRef,\n __darkHeader = false,\n __disableStickyMobile = true,\n __funnelSubStepProps,\n __subStepRef,\n ...restProps\n}: InternalContainerProps) {\n const isMobile = useMobile();\n const baseProps = getBaseProps(restProps);\n const rootRef = useRef<HTMLDivElement>(null);\n const headerRef = useRef<HTMLDivElement>(null);\n const { isSticky, isStuck, stickyStyles } = useStickyHeader(\n rootRef,\n headerRef,\n __stickyHeader,\n __stickyOffset,\n __mobileStickyOffset,\n __disableStickyMobile\n );\n const { setHasStickyBackground } = useAppLayoutContext();\n const isRefresh = useVisualRefresh();\n\n const hasDynamicHeight = isRefresh && variant === 'full-page';\n const overlapElement = useDynamicOverlap({ disabled: !hasDynamicHeight || !__darkHeader });\n\n const mergedRef = useMergeRefs(rootRef, __subStepRef, __internalRootRef);\n const headerMergedRef = useMergeRefs(headerRef, overlapElement, __headerRef);\n\n /**\n * The visual refresh AppLayout component needs to know if a child component\n * has a high contrast sticky header. This is to make sure the background element\n * stays in the same vertical position as the header content.\n */\n useEffect(() => {\n const shouldUpdateStickyBackground = isSticky && variant === 'full-page' && setHasStickyBackground;\n if (shouldUpdateStickyBackground) {\n setHasStickyBackground(true);\n }\n\n return () => {\n if (shouldUpdateStickyBackground) {\n setHasStickyBackground(false);\n }\n };\n }, [isSticky, setHasStickyBackground, variant]);\n\n // The container is only sticky on mobile if it is the header for the table.\n // In this case we don't want the container to have sticky styles, as only the table header row will show as stuck on scroll.\n const shouldHaveStickyStyles = isSticky && !isMobile;\n\n const hasMedia = !!media?.content;\n const mediaPosition = media?.position ?? 'top';\n\n return (\n <div\n {...baseProps}\n {...__funnelSubStepProps}\n className={clsx(\n baseProps.className,\n styles.root,\n styles[`variant-${variant}`],\n fitHeight && styles['fit-height'],\n hasMedia && (mediaPosition === 'side' ? styles['with-side-media'] : styles['with-top-media']),\n shouldHaveStickyStyles && [styles['sticky-enabled']]\n )}\n ref={mergedRef}\n >\n {hasMedia && (\n <div\n className={clsx(styles[`media-${mediaPosition === 'side' ? 'side' : 'top'}`], styles.media)}\n style={mediaPosition === 'top' ? { height: media?.height || '' } : { width: media?.width || '' }}\n >\n {media.content}\n </div>\n )}\n <div className={clsx(styles['content-wrapper'], fitHeight && styles['content-wrapper-fit-height'])}>\n {header && (\n <StickyHeaderContext.Provider value={{ isStuck }}>\n <div\n className={clsx(styles.header, styles[`header-variant-${variant}`], {\n [styles['header-sticky-disabled']]: __stickyHeader && !isSticky,\n [styles['header-sticky-enabled']]: isSticky,\n [styles['header-dynamic-height']]: hasDynamicHeight,\n [styles['header-stuck']]: isStuck,\n [styles['with-paddings']]: !disableHeaderPaddings,\n [styles['with-hidden-content']]: !children || __hiddenContent,\n [styles['header-with-media']]: hasMedia,\n })}\n {...stickyStyles}\n ref={headerMergedRef}\n >\n {__darkHeader ? (\n <div className={clsx(styles['dark-header'], 'awsui-context-content-header')}>{header}</div>\n ) : (\n header\n )}\n </div>\n </StickyHeaderContext.Provider>\n )}\n <div\n className={clsx(styles.content, fitHeight && styles['content-fit-height'], {\n [styles['with-paddings']]: !disableContentPaddings,\n })}\n >\n {children}\n </div>\n {footer && (\n <div\n className={clsx(styles.footer, {\n [styles['with-divider']]: !__disableFooterDivider,\n [styles['with-paddings']]: !__disableFooterPaddings,\n })}\n >\n {footer}\n </div>\n )}\n </div>\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"lib/default/","sources":["container/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAE7E,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAwB9D,MAAM,UAAU,0BAA0B,CAAC,KAA6B;IACtE,MAAM,EAAE,UAAU,EAAE,kBAA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AAI,CAAC,QAAQ;wBAC/D,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC,EAAE,QAAQ;wBAC3C,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC,EAAE,gBAAgB;wBACnD,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,OAAO;wBACjC,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,qBAAqB;wBACjD,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,EAAE,CAAC,QAAQ,IAAI,eAAe;wBAC7D,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC,EAAE,QAAQ;qBACxC,CAAC,IACE,YAAY,IAChB,GAAG,EAAE,eAAe,KAEnB,YAAY,CAAC,CAAC,CAAC,CACd,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,8BAA8B,CAAC,IAAG,MAAM,CAAO,CAC5F,CAAC,CAAC,CAAC,CACF,MAAM,CACP,CACG,CACuB,CAChC;YACD,6BACE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,SAAS,IAAI,MAAM,CAAC,oBAAoB,CAAC,EAAE;oBACzE,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,sBAAsB;iBACnD,CAAC,IAED,QAAQ,CACL;YACL,MAAM,IAAI,CACT,6BACE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;oBAC7B,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,sBAAsB;oBACjD,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,uBAAuB;iBACpD,CAAC,IAED,MAAM,CACH,CACP,CACG,CACF,CACP,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, { useEffect, useRef } from 'react';\nimport { ContainerProps } from './interfaces';\nimport { getBaseProps } from '../internal/base-component';\nimport { useAppLayoutContext } from '../internal/context/app-layout-context';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { StickyHeaderContext, useStickyHeader } from './use-sticky-header';\nimport { useDynamicOverlap } from '../internal/hooks/use-dynamic-overlap';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport styles from './styles.css.js';\nimport { useFunnelSubStep } from '../internal/analytics/hooks/use-funnel';\nimport { useModalContext } from '../internal/context/modal-context';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\n\nexport interface InternalContainerProps extends Omit<ContainerProps, 'variant'>, InternalBaseComponentProps {\n __stickyHeader?: boolean;\n __stickyOffset?: number;\n __mobileStickyOffset?: number;\n __disableFooterDivider?: boolean;\n __disableFooterPaddings?: boolean;\n __hiddenContent?: boolean;\n __headerRef?: React.RefObject<HTMLDivElement>;\n __darkHeader?: boolean;\n __disableStickyMobile?: boolean;\n /**\n * Additional internal variant:\n * * `embedded` - Use this variant within a parent container (such as a modal,\n * expandable section, container or split panel).\n * * `full-page` – Only for internal use in table, cards and other components\n */\n variant?: ContainerProps['variant'] | 'embedded' | 'full-page' | 'cards';\n\n __funnelSubStepProps?: ReturnType<typeof useFunnelSubStep>['funnelSubStepProps'];\n __subStepRef?: ReturnType<typeof useFunnelSubStep>['subStepRef'];\n}\n\nexport function InternalContainerAsSubstep(props: InternalContainerProps) {\n const { subStepRef, funnelSubStepProps } = useFunnelSubStep();\n const modalContext = useModalContext();\n\n return (\n <InternalContainer\n {...props}\n __subStepRef={modalContext?.isInModal ? { current: null } : subStepRef}\n __funnelSubStepProps={modalContext?.isInModal ? {} : funnelSubStepProps}\n />\n );\n}\n\nexport default function InternalContainer({\n header,\n footer,\n children,\n variant = 'default',\n disableHeaderPaddings = false,\n disableContentPaddings = false,\n fitHeight,\n media,\n __stickyOffset,\n __mobileStickyOffset,\n __stickyHeader = false,\n __internalRootRef = null,\n __disableFooterDivider = false,\n __disableFooterPaddings = false,\n __hiddenContent = false,\n __headerRef,\n __darkHeader = false,\n __disableStickyMobile = true,\n __funnelSubStepProps,\n __subStepRef,\n ...restProps\n}: InternalContainerProps) {\n const isMobile = useMobile();\n const baseProps = getBaseProps(restProps);\n const rootRef = useRef<HTMLDivElement>(null);\n const headerRef = useRef<HTMLDivElement>(null);\n const { isSticky, isStuck, stickyStyles } = useStickyHeader(\n rootRef,\n headerRef,\n __stickyHeader,\n __stickyOffset,\n __mobileStickyOffset,\n __disableStickyMobile\n );\n const contentId = useUniqueId();\n const { setHasStickyBackground } = useAppLayoutContext();\n const isRefresh = useVisualRefresh();\n\n const hasDynamicHeight = isRefresh && variant === 'full-page';\n const overlapElement = useDynamicOverlap({ disabled: !hasDynamicHeight || !__darkHeader });\n\n const mergedRef = useMergeRefs(rootRef, __internalRootRef);\n const headerMergedRef = useMergeRefs(headerRef, overlapElement, __headerRef);\n\n /**\n * The visual refresh AppLayout component needs to know if a child component\n * has a high contrast sticky header. This is to make sure the background element\n * stays in the same vertical position as the header content.\n */\n useEffect(() => {\n const shouldUpdateStickyBackground = isSticky && variant === 'full-page' && setHasStickyBackground;\n if (shouldUpdateStickyBackground) {\n setHasStickyBackground(true);\n }\n\n return () => {\n if (shouldUpdateStickyBackground) {\n setHasStickyBackground(false);\n }\n };\n }, [isSticky, setHasStickyBackground, variant]);\n\n // The container is only sticky on mobile if it is the header for the table.\n // In this case we don't want the container to have sticky styles, as only the table header row will show as stuck on scroll.\n const shouldHaveStickyStyles = isSticky && !isMobile;\n\n const hasMedia = !!media?.content;\n const mediaPosition = media?.position ?? 'top';\n\n return (\n <div\n {...baseProps}\n {...__funnelSubStepProps}\n className={clsx(\n baseProps.className,\n styles.root,\n styles[`variant-${variant}`],\n fitHeight && styles['fit-height'],\n hasMedia && (mediaPosition === 'side' ? styles['with-side-media'] : styles['with-top-media']),\n shouldHaveStickyStyles && [styles['sticky-enabled']]\n )}\n ref={mergedRef}\n >\n {hasMedia && (\n <div\n className={clsx(styles[`media-${mediaPosition === 'side' ? 'side' : 'top'}`], styles.media)}\n style={mediaPosition === 'top' ? { height: media?.height || '' } : { width: media?.width || '' }}\n >\n {media.content}\n </div>\n )}\n <div\n id={contentId}\n ref={__subStepRef}\n className={clsx(styles['content-wrapper'], fitHeight && styles['content-wrapper-fit-height'])}\n >\n {header && (\n <StickyHeaderContext.Provider value={{ isStuck }}>\n <div\n className={clsx(styles.header, styles[`header-variant-${variant}`], {\n [styles['header-sticky-disabled']]: __stickyHeader && !isSticky,\n [styles['header-sticky-enabled']]: isSticky,\n [styles['header-dynamic-height']]: hasDynamicHeight,\n [styles['header-stuck']]: isStuck,\n [styles['with-paddings']]: !disableHeaderPaddings,\n [styles['with-hidden-content']]: !children || __hiddenContent,\n [styles['header-with-media']]: hasMedia,\n })}\n {...stickyStyles}\n ref={headerMergedRef}\n >\n {__darkHeader ? (\n <div className={clsx(styles['dark-header'], 'awsui-context-content-header')}>{header}</div>\n ) : (\n header\n )}\n </div>\n </StickyHeaderContext.Provider>\n )}\n <div\n className={clsx(styles.content, fitHeight && styles['content-fit-height'], {\n [styles['with-paddings']]: !disableContentPaddings,\n })}\n >\n {children}\n </div>\n {footer && (\n <div\n className={clsx(styles.footer, {\n [styles['with-divider']]: !__disableFooterDivider,\n [styles['with-paddings']]: !__disableFooterPaddings,\n })}\n >\n {footer}\n </div>\n )}\n </div>\n </div>\n );\n}\n"]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { InternalContainerProps } from '../container/internal';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { ExpandableSectionProps } from './interfaces';
|
|
4
3
|
import { InternalBaseComponentProps } from '../internal/hooks/use-base-component';
|
|
@@ -9,8 +8,6 @@ export interface ExpandableSectionContainerProps extends InternalBaseComponentPr
|
|
|
9
8
|
variant: ExpandableSectionProps.Variant;
|
|
10
9
|
expanded: boolean | undefined;
|
|
11
10
|
disableContentPaddings: boolean | undefined;
|
|
12
|
-
__funnelSubStepProps?: InternalContainerProps['__funnelSubStepProps'];
|
|
13
|
-
__subStepRef?: InternalContainerProps['__subStepRef'];
|
|
14
11
|
}
|
|
15
|
-
export declare const ExpandableSectionContainer: ({ className, children, header, variant, expanded, disableContentPaddings, __internalRootRef,
|
|
12
|
+
export declare const ExpandableSectionContainer: ({ className, children, header, variant, expanded, disableContentPaddings, __internalRootRef, ...rest }: ExpandableSectionContainerProps) => JSX.Element;
|
|
16
13
|
//# sourceMappingURL=expandable-section-container.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expandable-section-container.d.ts","sourceRoot":"lib/default/","sources":["expandable-section/expandable-section-container.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"expandable-section-container.d.ts","sourceRoot":"lib/default/","sources":["expandable-section/expandable-section-container.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAIlF,MAAM,WAAW,+BAAgC,SAAQ,0BAA0B;IACjF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,EAAE,sBAAsB,CAAC,OAAO,CAAC;IACxC,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,sBAAsB,EAAE,OAAO,GAAG,SAAS,CAAC;CAC7C;AAED,eAAO,MAAM,0BAA0B,2GASpC,+BAA+B,gBA0BjC,CAAC"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
import
|
|
4
|
+
import { InternalContainerAsSubstep } from '../container/internal';
|
|
5
5
|
import React from 'react';
|
|
6
|
+
import { AnalyticsFunnelSubStep } from '../internal/analytics/components/analytics-funnel';
|
|
6
7
|
export const ExpandableSectionContainer = (_a) => {
|
|
7
|
-
var { className, children, header, variant, expanded, disableContentPaddings, __internalRootRef
|
|
8
|
+
var { className, children, header, variant, expanded, disableContentPaddings, __internalRootRef } = _a, rest = __rest(_a, ["className", "children", "header", "variant", "expanded", "disableContentPaddings", "__internalRootRef"]);
|
|
8
9
|
if (variant === 'container' || variant === 'stacked') {
|
|
9
|
-
return (React.createElement(
|
|
10
|
+
return (React.createElement(AnalyticsFunnelSubStep, null,
|
|
11
|
+
React.createElement(InternalContainerAsSubstep, Object.assign({}, rest, { className: className, header: header, variant: variant === 'stacked' ? 'stacked' : 'default', disableContentPaddings: disableContentPaddings || !expanded, disableHeaderPaddings: true, __hiddenContent: !expanded, __internalRootRef: __internalRootRef }), children)));
|
|
10
12
|
}
|
|
11
13
|
return (React.createElement("div", Object.assign({ className: className }, rest, { ref: __internalRootRef }),
|
|
12
14
|
header,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expandable-section-container.js","sourceRoot":"lib/default/","sources":["expandable-section/expandable-section-container.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,
|
|
1
|
+
{"version":3,"file":"expandable-section-container.js","sourceRoot":"lib/default/","sources":["expandable-section/expandable-section-container.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,sBAAsB,EAAE,MAAM,mDAAmD,CAAC;AAW3F,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,EAST,EAAE,EAAE;QATK,EACzC,SAAS,EACT,QAAQ,EACR,MAAM,EACN,OAAO,EACP,QAAQ,EACR,sBAAsB,EACtB,iBAAiB,OAEe,EAD7B,IAAI,cARkC,yGAS1C,CADQ;IAEP,IAAI,OAAO,KAAK,WAAW,IAAI,OAAO,KAAK,SAAS,EAAE;QACpD,OAAO,CACL,oBAAC,sBAAsB;YACrB,oBAAC,0BAA0B,oBACrB,IAAI,IACR,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EACtD,sBAAsB,EAAE,sBAAsB,IAAI,CAAC,QAAQ,EAC3D,qBAAqB,EAAE,IAAI,EAC3B,eAAe,EAAE,CAAC,QAAQ,EAC1B,iBAAiB,EAAE,iBAAiB,KAEnC,QAAQ,CACkB,CACN,CAC1B,CAAC;KACH;IAED,OAAO,CACL,2CAAK,SAAS,EAAE,SAAS,IAAM,IAAI,IAAE,GAAG,EAAE,iBAAiB;QACxD,MAAM;QACN,QAAQ,CACL,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { InternalContainerAsSubstep } from '../container/internal';\nimport React from 'react';\nimport { ExpandableSectionProps } from './interfaces';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\n\nimport { AnalyticsFunnelSubStep } from '../internal/analytics/components/analytics-funnel';\n\nexport interface ExpandableSectionContainerProps extends InternalBaseComponentProps {\n className?: string;\n header: React.ReactNode;\n children?: React.ReactNode;\n variant: ExpandableSectionProps.Variant;\n expanded: boolean | undefined;\n disableContentPaddings: boolean | undefined;\n}\n\nexport const ExpandableSectionContainer = ({\n className,\n children,\n header,\n variant,\n expanded,\n disableContentPaddings,\n __internalRootRef,\n ...rest\n}: ExpandableSectionContainerProps) => {\n if (variant === 'container' || variant === 'stacked') {\n return (\n <AnalyticsFunnelSubStep>\n <InternalContainerAsSubstep\n {...rest}\n className={className}\n header={header}\n variant={variant === 'stacked' ? 'stacked' : 'default'}\n disableContentPaddings={disableContentPaddings || !expanded}\n disableHeaderPaddings={true}\n __hiddenContent={!expanded}\n __internalRootRef={__internalRootRef}\n >\n {children}\n </InternalContainerAsSubstep>\n </AnalyticsFunnelSubStep>\n );\n }\n\n return (\n <div className={className} {...rest} ref={__internalRootRef}>\n {header}\n {children}\n </div>\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["expandable-section/index.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["expandable-section/index.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAKtD,OAAO,EAAE,sBAAsB,EAAE,CAAC;AAElC,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EAAE,OAAmB,EAAE,GAAG,KAAK,EAAE,EAAE,sBAAsB,eAIlG"}
|
|
@@ -5,22 +5,10 @@ import React from 'react';
|
|
|
5
5
|
import { applyDisplayName } from '../internal/utils/apply-display-name';
|
|
6
6
|
import InternalExpandableSection from './internal';
|
|
7
7
|
import useBaseComponent from '../internal/hooks/use-base-component';
|
|
8
|
-
import { AnalyticsFunnelSubStep } from '../internal/analytics/components/analytics-funnel';
|
|
9
|
-
import { useFunnelSubStep } from '../internal/analytics/hooks/use-funnel';
|
|
10
8
|
export default function ExpandableSection(_a) {
|
|
11
9
|
var { variant = 'default' } = _a, props = __rest(_a, ["variant"]);
|
|
12
10
|
const baseComponentProps = useBaseComponent('ExpandableSection');
|
|
13
|
-
|
|
14
|
-
return (React.createElement(AnalyticsFunnelSubStep, null,
|
|
15
|
-
React.createElement(InternalExpandableSectionAsSubstep, Object.assign({ variant: variant }, props, baseComponentProps))));
|
|
16
|
-
}
|
|
17
|
-
else {
|
|
18
|
-
return React.createElement(InternalExpandableSection, Object.assign({ variant: variant }, props, baseComponentProps));
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
function InternalExpandableSectionAsSubstep(props) {
|
|
22
|
-
const { subStepRef, funnelSubStepProps } = useFunnelSubStep();
|
|
23
|
-
return React.createElement(InternalExpandableSection, Object.assign({}, props, { __subStepRef: subStepRef, __funnelSubStepProps: funnelSubStepProps }));
|
|
11
|
+
return React.createElement(InternalExpandableSection, Object.assign({ variant: variant }, props, baseComponentProps));
|
|
24
12
|
}
|
|
25
13
|
applyDisplayName(ExpandableSection, 'ExpandableSection');
|
|
26
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["expandable-section/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["expandable-section/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,yBAAyB,MAAM,YAAY,CAAC;AACnD,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AAIpE,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EAAyD;QAAzD,EAAE,OAAO,GAAG,SAAS,OAAoC,EAA/B,KAAK,cAA/B,WAAiC,CAAF;IACvE,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,mBAAmB,CAAC,CAAC;IAEjE,OAAO,oBAAC,yBAAyB,kBAAC,OAAO,EAAE,OAAO,IAAM,KAAK,EAAM,kBAAkB,EAAI,CAAC;AAC5F,CAAC;AAED,gBAAgB,CAAC,iBAAiB,EAAE,mBAAmB,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { ExpandableSectionProps } from './interfaces';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport InternalExpandableSection from './internal';\nimport useBaseComponent from '../internal/hooks/use-base-component';\n\nexport { ExpandableSectionProps };\n\nexport default function ExpandableSection({ variant = 'default', ...props }: ExpandableSectionProps) {\n const baseComponentProps = useBaseComponent('ExpandableSection');\n\n return <InternalExpandableSection variant={variant} {...props} {...baseComponentProps} />;\n}\n\napplyDisplayName(ExpandableSection, 'ExpandableSection');\n"]}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ExpandableSectionProps } from './interfaces';
|
|
3
|
-
import { ExpandableSectionContainerProps } from './expandable-section-container';
|
|
4
3
|
import { InternalBaseComponentProps } from '../internal/hooks/use-base-component';
|
|
5
|
-
export type InternalExpandableSectionProps = ExpandableSectionProps & InternalBaseComponentProps
|
|
6
|
-
export default function InternalExpandableSection({ expanded: controlledExpanded, defaultExpanded, onChange, variant, children, header, headerText, headerCounter, headerDescription, headerInfo, headerActions, headingTagOverride, disableContentPaddings, headerAriaLabel, __internalRootRef,
|
|
4
|
+
export type InternalExpandableSectionProps = ExpandableSectionProps & InternalBaseComponentProps;
|
|
5
|
+
export default function InternalExpandableSection({ expanded: controlledExpanded, defaultExpanded, onChange, variant, children, header, headerText, headerCounter, headerDescription, headerInfo, headerActions, headingTagOverride, disableContentPaddings, headerAriaLabel, __internalRootRef, ...props }: InternalExpandableSectionProps): JSX.Element;
|
|
7
6
|
//# sourceMappingURL=internal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"lib/default/","sources":["expandable-section/internal.tsx"],"names":[],"mappings":";AAYA,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"lib/default/","sources":["expandable-section/internal.tsx"],"names":[],"mappings":";AAYA,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAKtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAGlF,MAAM,MAAM,8BAA8B,GAAG,sBAAsB,GAAG,0BAA0B,CAAC;AAEjG,MAAM,CAAC,OAAO,UAAU,yBAAyB,CAAC,EAChD,QAAQ,EAAE,kBAAkB,EAC5B,eAAe,EACf,QAAQ,EACR,OAAmB,EACnB,QAAQ,EACR,MAAM,EACN,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,UAAU,EACV,aAAa,EACb,kBAAkB,EAClB,sBAAsB,EACtB,eAAe,EACf,iBAAiB,EACjB,GAAG,KAAK,EACT,EAAE,8BAA8B,eAgGhC"}
|
|
@@ -14,7 +14,7 @@ import { ExpandableSectionContainer } from './expandable-section-container';
|
|
|
14
14
|
import { ExpandableSectionHeader } from './expandable-section-header';
|
|
15
15
|
import { variantSupportsDescription } from './utils';
|
|
16
16
|
export default function InternalExpandableSection(_a) {
|
|
17
|
-
var { expanded: controlledExpanded, defaultExpanded, onChange, variant = 'default', children, header, headerText, headerCounter, headerDescription, headerInfo, headerActions, headingTagOverride, disableContentPaddings, headerAriaLabel, __internalRootRef
|
|
17
|
+
var { expanded: controlledExpanded, defaultExpanded, onChange, variant = 'default', children, header, headerText, headerCounter, headerDescription, headerInfo, headerActions, headingTagOverride, disableContentPaddings, headerAriaLabel, __internalRootRef } = _a, props = __rest(_a, ["expanded", "defaultExpanded", "onChange", "variant", "children", "header", "headerText", "headerCounter", "headerDescription", "headerInfo", "headerActions", "headingTagOverride", "disableContentPaddings", "headerAriaLabel", "__internalRootRef"]);
|
|
18
18
|
const ref = useRef(null);
|
|
19
19
|
const controlId = useUniqueId();
|
|
20
20
|
const triggerControlId = `${controlId}-trigger`;
|
|
@@ -54,7 +54,7 @@ export default function InternalExpandableSection(_a) {
|
|
|
54
54
|
};
|
|
55
55
|
// Map stacked variant to container to avoid code duplication
|
|
56
56
|
const baseVariant = variant === 'stacked' ? 'container' : variant;
|
|
57
|
-
return (React.createElement(ExpandableSectionContainer, Object.assign({}, baseProps, { expanded: expanded, className: clsx(baseProps.className, styles.root), variant: variant,
|
|
57
|
+
return (React.createElement(ExpandableSectionContainer, Object.assign({}, baseProps, { expanded: expanded, className: clsx(baseProps.className, styles.root), variant: variant, disableContentPaddings: disableContentPaddings, header: React.createElement(ExpandableSectionHeader, Object.assign({ id: triggerControlId, descriptionId: descriptionId, className: clsx(styles.header, styles[`header-${baseVariant}`]), variant: baseVariant, expanded: !!expanded, header: header, headerText: headerText, headerDescription: headerDescription, headerCounter: headerCounter, headerInfo: headerInfo, headerActions: headerActions, headingTagOverride: headingTagOverride }, triggerProps)), __internalRootRef: __internalRootRef }),
|
|
58
58
|
React.createElement(CSSTransition, { in: expanded, timeout: 30, classNames: { enter: styles['content-enter'] }, nodeRef: ref },
|
|
59
59
|
React.createElement("div", { id: controlId, ref: ref, className: clsx(styles.content, styles[`content-${baseVariant}`], expanded && styles['content-expanded']), role: "group", "aria-label": triggerProps.ariaLabel, "aria-labelledby": triggerProps.ariaLabelledBy, "aria-describedby": variantSupportsDescription(baseVariant) && headerDescription ? descriptionId : undefined }, children))));
|
|
60
60
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"lib/default/","sources":["expandable-section/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAiB,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4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AEpC,oBAAC,aAAa,IAAC,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,eAAe,CAAC,EAAE,EAAE,OAAO,EAAE,GAAG;YACpG,6BACE,EAAE,EAAE,SAAS,EACb,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,WAAW,WAAW,EAAE,CAAC,EAAE,QAAQ,IAAI,MAAM,CAAC,kBAAkB,CAAC,CAAC,EACzG,IAAI,EAAC,OAAO,gBACA,YAAY,CAAC,SAAS,qBACjB,YAAY,CAAC,cAAc,sBAC1B,0BAA0B,CAAC,WAAW,CAAC,IAAI,iBAAiB,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,IAEzG,QAAQ,CACL,CACQ,CACW,CAC9B,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { KeyboardEvent, useCallback, useRef } from 'react';\nimport { CSSTransition } from 'react-transition-group';\nimport clsx from 'clsx';\n\nimport { getBaseProps } from '../internal/base-component';\nimport { useControllable } from '../internal/hooks/use-controllable';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { KeyCode } from '../internal/keycode';\nimport { fireNonCancelableEvent } from '../internal/events';\n\nimport { ExpandableSectionProps } from './interfaces';\n\nimport styles from './styles.css.js';\nimport { ExpandableSectionContainer } from './expandable-section-container';\nimport { ExpandableSectionHeader } from './expandable-section-header';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { variantSupportsDescription } from './utils';\n\nexport type InternalExpandableSectionProps = ExpandableSectionProps & InternalBaseComponentProps;\n\nexport default function InternalExpandableSection({\n expanded: controlledExpanded,\n defaultExpanded,\n onChange,\n variant = 'default',\n children,\n header,\n headerText,\n headerCounter,\n headerDescription,\n headerInfo,\n headerActions,\n headingTagOverride,\n disableContentPaddings,\n headerAriaLabel,\n __internalRootRef,\n ...props\n}: InternalExpandableSectionProps) {\n const ref = useRef<HTMLDivElement>(null);\n const controlId = useUniqueId();\n const triggerControlId = `${controlId}-trigger`;\n const descriptionId = `${controlId}-description`;\n\n const baseProps = getBaseProps(props);\n const [expanded, setExpanded] = useControllable(controlledExpanded, onChange, defaultExpanded, {\n componentName: 'ExpandableSection',\n controlledProp: 'expanded',\n changeHandler: 'onChange',\n });\n\n const onExpandChange = useCallback(\n (expanded: boolean) => {\n setExpanded(expanded);\n fireNonCancelableEvent(onChange, { expanded });\n },\n [onChange, setExpanded]\n );\n\n const onClick = useCallback(() => {\n onExpandChange(!expanded);\n }, [onExpandChange, expanded]);\n\n const onKeyUp = useCallback(\n (event: KeyboardEvent<Element>) => {\n const interactionKeys = [KeyCode.enter, KeyCode.space];\n\n if (interactionKeys.indexOf(event.keyCode) !== -1) {\n onExpandChange(!expanded);\n }\n },\n [onExpandChange, expanded]\n );\n\n const onKeyDown = useCallback((event: KeyboardEvent<Element>) => {\n if (event.keyCode === KeyCode.space) {\n // Prevent the page from scrolling when toggling the component with the space bar.\n event.preventDefault();\n }\n }, []);\n\n const triggerProps = {\n ariaControls: controlId,\n ariaLabel: headerAriaLabel,\n ariaLabelledBy: headerAriaLabel ? undefined : triggerControlId,\n onKeyUp,\n onKeyDown,\n onClick,\n };\n\n // Map stacked variant to container to avoid code duplication\n const baseVariant: ExpandableSectionProps.Variant = variant === 'stacked' ? 'container' : variant;\n\n return (\n <ExpandableSectionContainer\n {...baseProps}\n expanded={expanded}\n className={clsx(baseProps.className, styles.root)}\n variant={variant}\n disableContentPaddings={disableContentPaddings}\n header={\n <ExpandableSectionHeader\n id={triggerControlId}\n descriptionId={descriptionId}\n className={clsx(styles.header, styles[`header-${baseVariant}`])}\n variant={baseVariant}\n expanded={!!expanded}\n header={header}\n headerText={headerText}\n headerDescription={headerDescription}\n headerCounter={headerCounter}\n headerInfo={headerInfo}\n headerActions={headerActions}\n headingTagOverride={headingTagOverride}\n {...triggerProps}\n />\n }\n __internalRootRef={__internalRootRef}\n >\n <CSSTransition in={expanded} timeout={30} classNames={{ enter: styles['content-enter'] }} nodeRef={ref}>\n <div\n id={controlId}\n ref={ref}\n className={clsx(styles.content, styles[`content-${baseVariant}`], expanded && styles['content-expanded'])}\n role=\"group\"\n aria-label={triggerProps.ariaLabel}\n aria-labelledby={triggerProps.ariaLabelledBy}\n aria-describedby={variantSupportsDescription(baseVariant) && headerDescription ? descriptionId : undefined}\n >\n {children}\n </div>\n </CSSTransition>\n </ExpandableSectionContainer>\n );\n}\n"]}
|
package/form/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["form/index.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["form/index.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAUzC,OAAO,EAAE,SAAS,EAAE,CAAC;AAoBrB,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,EAAE,OAAqB,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,eAiB1E"}
|
package/form/index.js
CHANGED
|
@@ -6,9 +6,9 @@ import { applyDisplayName } from '../internal/utils/apply-display-name';
|
|
|
6
6
|
import InternalForm from './internal';
|
|
7
7
|
import useBaseComponent from '../internal/hooks/use-base-component';
|
|
8
8
|
import { AnalyticsFunnel, AnalyticsFunnelStep } from '../internal/analytics/components/analytics-funnel';
|
|
9
|
-
import { getFunnelNameSelector } from '../internal/analytics/selectors';
|
|
10
9
|
import { ButtonContext } from '../internal/context/button-context';
|
|
11
|
-
import { useFunnel, useFunnelStep } from '../internal/analytics/hooks/use-funnel';
|
|
10
|
+
import { useFunnel, useFunnelNameSelector, useFunnelStep } from '../internal/analytics/hooks/use-funnel';
|
|
11
|
+
import styles from './styles.css.js';
|
|
12
12
|
const FormWithAnalytics = (_a) => {
|
|
13
13
|
var { variant = 'full-page', actions } = _a, props = __rest(_a, ["variant", "actions"]);
|
|
14
14
|
const { funnelProps, funnelSubmit, funnelNextOrSubmitAttempt } = useFunnel();
|
|
@@ -25,8 +25,10 @@ const FormWithAnalytics = (_a) => {
|
|
|
25
25
|
export default function Form(_a) {
|
|
26
26
|
var { variant = 'full-page' } = _a, props = __rest(_a, ["variant"]);
|
|
27
27
|
const baseComponentProps = useBaseComponent('Form');
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
const inheritedFunnelNameSelector = useFunnelNameSelector();
|
|
29
|
+
const funnelNameSelector = inheritedFunnelNameSelector || `.${styles.header}`;
|
|
30
|
+
return (React.createElement(AnalyticsFunnel, { funnelType: "single-page", optionalStepNumbers: [], totalFunnelSteps: 1, funnelNameSelector: funnelNameSelector },
|
|
31
|
+
React.createElement(AnalyticsFunnelStep, { stepNumber: 1, stepNameSelector: funnelNameSelector },
|
|
30
32
|
React.createElement(FormWithAnalytics, Object.assign({ variant: variant }, props, baseComponentProps)))));
|
|
31
33
|
}
|
|
32
34
|
applyDisplayName(Form, 'Form');
|
package/form/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["form/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE,OAAO,YAAY,MAAM,YAAY,CAAC;AACtC,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AAEpE,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,mDAAmD,CAAC;AACzG,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["form/index.tsx"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B,KAAK,cAAjC,WAAmC,CAAF;IAC5D,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACpD,MAAM,2BAA2B,GAAG,qBAAqB,EAAE,CAAC;IAC5D,MAAM,kBAAkB,GAAG,2BAA2B,IAAI,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;IAE9E,OAAO,CACL,oBAAC,eAAe,IACd,UAAU,EAAC,aAAa,EACxB,mBAAmB,EAAE,EAAE,EACvB,gBAAgB,EAAE,CAAC,EACnB,kBAAkB,EAAE,kBAAkB;QAEtC,oBAAC,mBAAmB,IAAC,UAAU,EAAE,CAAC,EAAE,gBAAgB,EAAE,kBAAkB;YACtE,oBAAC,iBAAiB,kBAAC,OAAO,EAAE,OAAO,IAAM,KAAK,EAAM,kBAAkB,EAAI,CACtD,CACN,CACnB,CAAC;AACJ,CAAC;AAED,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { FormProps } from './interfaces';\nimport InternalForm from './internal';\nimport useBaseComponent from '../internal/hooks/use-base-component';\n\nimport { AnalyticsFunnel, AnalyticsFunnelStep } from '../internal/analytics/components/analytics-funnel';\nimport { ButtonContext, ButtonContextProps } from '../internal/context/button-context';\nimport { useFunnel, useFunnelNameSelector, useFunnelStep } from '../internal/analytics/hooks/use-funnel';\n\nimport styles from './styles.css.js';\n\nexport { FormProps };\n\nconst FormWithAnalytics = ({ variant = 'full-page', actions, ...props }: FormProps) => {\n const { funnelProps, funnelSubmit, funnelNextOrSubmitAttempt } = useFunnel();\n const { funnelStepProps } = useFunnelStep();\n\n const handleActionButtonClick: ButtonContextProps['onClick'] = ({ variant }) => {\n if (variant === 'primary') {\n funnelNextOrSubmitAttempt();\n funnelSubmit();\n }\n };\n\n return (\n <ButtonContext.Provider value={{ onClick: handleActionButtonClick }}>\n <InternalForm variant={variant} actions={actions} {...props} {...funnelProps} {...funnelStepProps} />\n </ButtonContext.Provider>\n );\n};\n\nexport default function Form({ variant = 'full-page', ...props }: FormProps) {\n const baseComponentProps = useBaseComponent('Form');\n const inheritedFunnelNameSelector = useFunnelNameSelector();\n const funnelNameSelector = inheritedFunnelNameSelector || `.${styles.header}`;\n\n return (\n <AnalyticsFunnel\n funnelType=\"single-page\"\n optionalStepNumbers={[]}\n totalFunnelSteps={1}\n funnelNameSelector={funnelNameSelector}\n >\n <AnalyticsFunnelStep stepNumber={1} stepNameSelector={funnelNameSelector}>\n <FormWithAnalytics variant={variant} {...props} {...baseComponentProps} />\n </AnalyticsFunnelStep>\n </AnalyticsFunnel>\n );\n}\n\napplyDisplayName(Form, 'Form');\n"]}
|
package/i18n/dynamic.js
CHANGED
|
@@ -25,6 +25,8 @@ export function importMessages(locale) {
|
|
|
25
25
|
return import('./messages/all.ko.js').then(mod => [mod.default]);
|
|
26
26
|
case 'pt-br':
|
|
27
27
|
return import('./messages/all.pt-BR.js').then(mod => [mod.default]);
|
|
28
|
+
case 'tr':
|
|
29
|
+
return import('./messages/all.tr.js').then(mod => [mod.default]);
|
|
28
30
|
case 'zh-cn':
|
|
29
31
|
return import('./messages/all.zh-CN.js').then(mod => [mod.default]);
|
|
30
32
|
case 'zh-tw':
|