@cloudscape-design/components 3.0.239 → 3.0.240

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.
@@ -1,6 +1,6 @@
1
1
 
2
2
  export var PACKAGE_SOURCE = 'components';
3
- export var PACKAGE_VERSION = '3.0.0 (4d8a6bf)';
3
+ export var PACKAGE_VERSION = '3.0.0 (13ebfd3)';
4
4
  export var THEME = 'open-source-visual-refresh';
5
5
  export var ALWAYS_VISUAL_REFRESH = true;
6
6
 
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "4d8a6bfd2df4554db766e6fd34fd2b8db661a087"
2
+ "commit": "13ebfd3ca2e1e6a9bc75e9a56408d90e374f53db"
3
3
  }
package/package.json CHANGED
@@ -108,7 +108,7 @@
108
108
  "./internal/base-component/index.js",
109
109
  "./internal/base-component/styles.css.js"
110
110
  ],
111
- "version": "3.0.239",
111
+ "version": "3.0.240",
112
112
  "repository": {
113
113
  "type": "git",
114
114
  "url": "https://github.com/cloudscape-design/components.git"
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { TutorialPanelProps } from '../../interfaces';
3
3
  interface CongratulationScreenProps {
4
4
  children: React.ReactNode;
5
- onFeedbackClick: () => void;
5
+ onFeedbackClick?: () => void;
6
6
  i18nStrings: TutorialPanelProps['i18nStrings'];
7
7
  }
8
8
  export declare function CongratulationScreen({ children, onFeedbackClick, i18nStrings }: CongratulationScreenProps): JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"congratulation-screen.d.ts","sourceRoot":"lib/default/","sources":["tutorial-panel/components/tutorial-detail-view/congratulation-screen.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAOtD,UAAU,yBAAyB;IACjC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,WAAW,EAAE,kBAAkB,CAAC,aAAa,CAAC,CAAC;CAChD;AAED,wBAAgB,oBAAoB,CAAC,EAAE,QAAQ,EAAE,eAAe,EAAE,WAAW,EAAE,EAAE,yBAAyB,eA+BzG"}
1
+ {"version":3,"file":"congratulation-screen.d.ts","sourceRoot":"lib/default/","sources":["tutorial-panel/components/tutorial-detail-view/congratulation-screen.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAOtD,UAAU,yBAAyB;IACjC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,WAAW,EAAE,kBAAkB,CAAC,aAAa,CAAC,CAAC;CAChD;AAED,wBAAgB,oBAAoB,CAAC,EAAE,QAAQ,EAAE,eAAe,EAAE,WAAW,EAAE,EAAE,yBAAyB,eAiCzG"}
@@ -19,6 +19,6 @@ export function CongratulationScreen({ children, onFeedbackClick, i18nStrings })
19
19
  [styles['plaintext-congratulation-description']]: typeof children === 'string',
20
20
  }) }, children))),
21
21
  React.createElement("div", { className: styles.divider }),
22
- React.createElement(InternalLink, { onFollow: onFeedbackClick, className: styles['feedback-link'] }, i18nStrings.feedbackLinkText)));
22
+ onFeedbackClick && (React.createElement(InternalLink, { onFollow: onFeedbackClick, className: styles['feedback-link'] }, i18nStrings.feedbackLinkText))));
23
23
  }
24
24
  //# sourceMappingURL=congratulation-screen.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"congratulation-screen.js","sourceRoot":"lib/default/","sources":["tutorial-panel/components/tutorial-detail-view/congratulation-screen.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,OAAO,uBAAuB,MAAM,oCAAoC,CAAC;AACzE,OAAO,oBAAoB,MAAM,iCAAiC,CAAC;AACnE,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAQhD,MAAM,UAAU,oBAAoB,CAAC,EAAE,QAAQ,EAAE,eAAe,EAAE,WAAW,EAA6B;IACxG,OAAO,CACL,oBAAC,oBAAoB,IAAC,IAAI,EAAC,KAAK;QAC9B,oBAAC,oBAAoB,IAAC,IAAI,EAAC,IAAI;YAC7B,6BAAK,SAAS,EAAE,MAAM,CAAC,wBAAwB,CAAC;gBAC9C,oBAAC,uBAAuB,IACtB,MAAM,EAAC,SAAS,EAChB,IAAI,EAAC,SAAS,EACd,SAAS,EAAE,MAAM,CAAC,gCAAgC,CAAC,GACnD;gBACF,6BAAK,SAAS,EAAE,MAAM,CAAC,yBAAyB,CAAC,IAAG,WAAW,CAAC,qBAAqB,CAAO,CACxF;YACN,oBAAC,WAAW,IAAC,KAAK,EAAC,qBAAqB;gBACtC,6BACE,SAAS,EAAE,IAAI,CAAC;wBACd,CAAC,MAAM,CAAC,+BAA+B,CAAC,CAAC,EAAE,IAAI;wBAC/C,CAAC,MAAM,CAAC,sCAAsC,CAAC,CAAC,EAAE,OAAO,QAAQ,KAAK,QAAQ;qBAC/E,CAAC,IAED,QAAQ,CACL,CACM,CACO;QAEvB,6BAAK,SAAS,EAAE,MAAM,CAAC,OAAO,GAAI;QAElC,oBAAC,YAAY,IAAC,QAAQ,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,CAAC,eAAe,CAAC,IACxE,WAAW,CAAC,gBAAgB,CAChB,CACM,CACxB,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 { TutorialPanelProps } from '../../interfaces';\nimport InternalStatusIndicator from '../../../status-indicator/internal';\nimport InternalSpaceBetween from '../../../space-between/internal';\nimport InternalLink from '../../../link/internal';\nimport clsx from 'clsx';\nimport InternalBox from '../../../box/internal';\n\ninterface CongratulationScreenProps {\n children: React.ReactNode;\n onFeedbackClick: () => void;\n i18nStrings: TutorialPanelProps['i18nStrings'];\n}\n\nexport function CongratulationScreen({ children, onFeedbackClick, i18nStrings }: CongratulationScreenProps) {\n return (\n <InternalSpaceBetween size=\"xxl\">\n <InternalSpaceBetween size=\"xl\">\n <div className={styles['congratulation-message']}>\n <InternalStatusIndicator\n __size=\"inherit\"\n type=\"success\"\n className={styles['congratulation-message--status']}\n />\n <div className={styles['completion-screen-title']}>{i18nStrings.completionScreenTitle}</div>\n </div>\n <InternalBox color=\"text-body-secondary\">\n <div\n className={clsx({\n [styles['completion-screen-description']]: true,\n [styles['plaintext-congratulation-description']]: typeof children === 'string',\n })}\n >\n {children}\n </div>\n </InternalBox>\n </InternalSpaceBetween>\n\n <div className={styles.divider} />\n\n <InternalLink onFollow={onFeedbackClick} className={styles['feedback-link']}>\n {i18nStrings.feedbackLinkText}\n </InternalLink>\n </InternalSpaceBetween>\n );\n}\n"]}
1
+ {"version":3,"file":"congratulation-screen.js","sourceRoot":"lib/default/","sources":["tutorial-panel/components/tutorial-detail-view/congratulation-screen.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,OAAO,uBAAuB,MAAM,oCAAoC,CAAC;AACzE,OAAO,oBAAoB,MAAM,iCAAiC,CAAC;AACnE,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAQhD,MAAM,UAAU,oBAAoB,CAAC,EAAE,QAAQ,EAAE,eAAe,EAAE,WAAW,EAA6B;IACxG,OAAO,CACL,oBAAC,oBAAoB,IAAC,IAAI,EAAC,KAAK;QAC9B,oBAAC,oBAAoB,IAAC,IAAI,EAAC,IAAI;YAC7B,6BAAK,SAAS,EAAE,MAAM,CAAC,wBAAwB,CAAC;gBAC9C,oBAAC,uBAAuB,IACtB,MAAM,EAAC,SAAS,EAChB,IAAI,EAAC,SAAS,EACd,SAAS,EAAE,MAAM,CAAC,gCAAgC,CAAC,GACnD;gBACF,6BAAK,SAAS,EAAE,MAAM,CAAC,yBAAyB,CAAC,IAAG,WAAW,CAAC,qBAAqB,CAAO,CACxF;YACN,oBAAC,WAAW,IAAC,KAAK,EAAC,qBAAqB;gBACtC,6BACE,SAAS,EAAE,IAAI,CAAC;wBACd,CAAC,MAAM,CAAC,+BAA+B,CAAC,CAAC,EAAE,IAAI;wBAC/C,CAAC,MAAM,CAAC,sCAAsC,CAAC,CAAC,EAAE,OAAO,QAAQ,KAAK,QAAQ;qBAC/E,CAAC,IAED,QAAQ,CACL,CACM,CACO;QAEvB,6BAAK,SAAS,EAAE,MAAM,CAAC,OAAO,GAAI;QAEjC,eAAe,IAAI,CAClB,oBAAC,YAAY,IAAC,QAAQ,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,CAAC,eAAe,CAAC,IACxE,WAAW,CAAC,gBAAgB,CAChB,CAChB,CACoB,CACxB,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 { TutorialPanelProps } from '../../interfaces';\nimport InternalStatusIndicator from '../../../status-indicator/internal';\nimport InternalSpaceBetween from '../../../space-between/internal';\nimport InternalLink from '../../../link/internal';\nimport clsx from 'clsx';\nimport InternalBox from '../../../box/internal';\n\ninterface CongratulationScreenProps {\n children: React.ReactNode;\n onFeedbackClick?: () => void;\n i18nStrings: TutorialPanelProps['i18nStrings'];\n}\n\nexport function CongratulationScreen({ children, onFeedbackClick, i18nStrings }: CongratulationScreenProps) {\n return (\n <InternalSpaceBetween size=\"xxl\">\n <InternalSpaceBetween size=\"xl\">\n <div className={styles['congratulation-message']}>\n <InternalStatusIndicator\n __size=\"inherit\"\n type=\"success\"\n className={styles['congratulation-message--status']}\n />\n <div className={styles['completion-screen-title']}>{i18nStrings.completionScreenTitle}</div>\n </div>\n <InternalBox color=\"text-body-secondary\">\n <div\n className={clsx({\n [styles['completion-screen-description']]: true,\n [styles['plaintext-congratulation-description']]: typeof children === 'string',\n })}\n >\n {children}\n </div>\n </InternalBox>\n </InternalSpaceBetween>\n\n <div className={styles.divider} />\n\n {onFeedbackClick && (\n <InternalLink onFollow={onFeedbackClick} className={styles['feedback-link']}>\n {i18nStrings.feedbackLinkText}\n </InternalLink>\n )}\n </InternalSpaceBetween>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["tutorial-panel/components/tutorial-detail-view/index.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAMtD,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAKrE,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EACzC,QAAQ,EACR,cAAc,EAAE,qBAAqB,EACrC,gBAAoB,EACpB,eAAe,EAAE,sBAAsB,EACvC,WAAW,GACZ,EAAE;IACD,QAAQ,EAAE,kBAAkB,CAAC,QAAQ,CAAC;IACtC,cAAc,EAAE,cAAc,CAAC,gBAAgB,CAAC,CAAC;IACjD,gBAAgB,EAAE,cAAc,CAAC,kBAAkB,CAAC,CAAC;IACrD,eAAe,EAAE,kBAAkB,CAAC,iBAAiB,CAAC,CAAC;IACvD,WAAW,EAAE,kBAAkB,CAAC,aAAa,CAAC,CAAC;CAChD,eAoDA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["tutorial-panel/components/tutorial-detail-view/index.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAMtD,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAKrE,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EACzC,QAAQ,EACR,cAAc,EAAE,qBAAqB,EACrC,gBAAoB,EACpB,eAAe,EAAE,sBAAsB,EACvC,WAAW,GACZ,EAAE;IACD,QAAQ,EAAE,kBAAkB,CAAC,QAAQ,CAAC;IACtC,cAAc,EAAE,cAAc,CAAC,gBAAgB,CAAC,CAAC;IACjD,gBAAgB,EAAE,cAAc,CAAC,kBAAkB,CAAC,CAAC;IACrD,eAAe,EAAE,kBAAkB,CAAC,iBAAiB,CAAC,CAAC;IACvD,WAAW,EAAE,kBAAkB,CAAC,aAAa,CAAC,CAAC;CAChD,eAqDA"}
@@ -1,6 +1,6 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- import React, { useCallback } from 'react';
3
+ import React, { useCallback, useMemo } from 'react';
4
4
  import InternalBox from '../../../box/internal';
5
5
  import { InternalButton } from '../../../button/internal';
6
6
  import InternalSpaceBetween from '../../../space-between/internal';
@@ -14,9 +14,7 @@ export default function TutorialDetailView({ tutorial, onExitTutorial: onExitTut
14
14
  const onExitTutorial = useCallback(() => {
15
15
  fireNonCancelableEvent(onExitTutorialHandler, { tutorial });
16
16
  }, [onExitTutorialHandler, tutorial]);
17
- const onFeedbackClick = useCallback(() => {
18
- fireNonCancelableEvent(onFeedbackClickHandler, { tutorial });
19
- }, [onFeedbackClickHandler, tutorial]);
17
+ const onFeedbackClick = useMemo(() => onFeedbackClickHandler && (() => fireNonCancelableEvent(onFeedbackClickHandler, { tutorial })), [onFeedbackClickHandler, tutorial]);
20
18
  return (React.createElement(React.Fragment, null,
21
19
  React.createElement(InternalSpaceBetween, { size: "xl" },
22
20
  React.createElement("div", { className: styles['tutorial-title'] },
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["tutorial-panel/components/tutorial-detail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Ac,EACvB,SAAS,EAAE,WAAW,CAAC,iBAAiB,EACxC,UAAU,EAAC,MAAM,EACjB,QAAQ,EAAC,YAAY,GACrB;gBAEF,oBAAC,WAAW,IACV,OAAO,EAAC,IAAI,EACZ,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,EAC/C,OAAO,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,EACvB,MAAM,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,IAEpB,QAAQ,CAAC,KAAK,CACH,CACV;YACN;gBACE,6BAAK,IAAI,EAAC,QAAQ,IACf,QAAQ,CAAC,SAAS,IAAI,CACrB,oBAAC,oBAAoB,IAAC,eAAe,EAAE,eAAe,EAAE,WAAW,EAAE,WAAW,IAC7E,QAAQ,CAAC,0BAA0B,CACf,CACxB,CACG;gBACL,CAAC,QAAQ,CAAC,SAAS,IAAI,CACtB,oBAAC,QAAQ,IACP,KAAK,EAAE,QAAQ,CAAC,KAAK,EACrB,cAAc,EAAE,cAAc,EAC9B,sBAAsB,EAAE,gBAAgB,EACxC,WAAW,EAAE,WAAW,GACxB,CACH,CACG,CACe,CACtB,CACJ,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback } from 'react';\nimport { TutorialPanelProps } from '../../interfaces';\nimport InternalBox from '../../../box/internal';\nimport { InternalButton } from '../../../button/internal';\nimport InternalSpaceBetween from '../../../space-between/internal';\nimport styles from './styles.css.js';\nimport { fireNonCancelableEvent } from '../../../internal/events/index';\nimport { HotspotContext } from '../../../annotation-context/context';\nimport { CongratulationScreen } from './congratulation-screen';\nimport { TaskList } from './task-list';\nimport { useVisualRefresh } from '../../../internal/hooks/use-visual-mode';\n\nexport default function TutorialDetailView({\n tutorial,\n onExitTutorial: onExitTutorialHandler,\n currentStepIndex = 0,\n onFeedbackClick: onFeedbackClickHandler,\n i18nStrings,\n}: {\n tutorial: TutorialPanelProps.Tutorial;\n onExitTutorial: HotspotContext['onExitTutorial'];\n currentStepIndex: HotspotContext['currentStepIndex'];\n onFeedbackClick: TutorialPanelProps['onFeedbackClick'];\n i18nStrings: TutorialPanelProps['i18nStrings'];\n}) {\n const isRefresh = useVisualRefresh();\n\n const onExitTutorial = useCallback(() => {\n fireNonCancelableEvent(onExitTutorialHandler, { tutorial });\n }, [onExitTutorialHandler, tutorial]);\n\n const onFeedbackClick = useCallback(() => {\n fireNonCancelableEvent(onFeedbackClickHandler, { tutorial });\n }, [onFeedbackClickHandler, tutorial]);\n\n return (\n <>\n <InternalSpaceBetween size=\"xl\">\n <div className={styles['tutorial-title']}>\n <InternalButton\n variant=\"icon\"\n onClick={onExitTutorial}\n ariaLabel={i18nStrings.labelExitTutorial}\n formAction=\"none\"\n iconName=\"arrow-left\"\n />\n\n <InternalBox\n variant=\"h2\"\n fontSize={isRefresh ? 'heading-m' : 'heading-l'}\n padding={{ top: 'xxs' }}\n margin={{ left: 's' }}\n >\n {tutorial.title}\n </InternalBox>\n </div>\n <div>\n <div role=\"status\">\n {tutorial.completed && (\n <CongratulationScreen onFeedbackClick={onFeedbackClick} i18nStrings={i18nStrings}>\n {tutorial.completedScreenDescription}\n </CongratulationScreen>\n )}\n </div>\n {!tutorial.completed && (\n <TaskList\n tasks={tutorial.tasks}\n onExitTutorial={onExitTutorial}\n currentGlobalStepIndex={currentStepIndex}\n i18nStrings={i18nStrings}\n />\n )}\n </div>\n </InternalSpaceBetween>\n </>\n );\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["tutorial-panel/components/tutorial-detail-view/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,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,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,EAC/C,OAAO,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,EACvB,MAAM,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,IAEpB,QAAQ,CAAC,KAAK,CACH,CACV;YACN;gBACE,6BAAK,IAAI,EAAC,QAAQ,IACf,QAAQ,CAAC,SAAS,IAAI,CACrB,oBAAC,oBAAoB,IAAC,eAAe,EAAE,eAAe,EAAE,WAAW,EAAE,WAAW,IAC7E,QAAQ,CAAC,0BAA0B,CACf,CACxB,CACG;gBACL,CAAC,QAAQ,CAAC,SAAS,IAAI,CACtB,oBAAC,QAAQ,IACP,KAAK,EAAE,QAAQ,CAAC,KAAK,EACrB,cAAc,EAAE,cAAc,EAC9B,sBAAsB,EAAE,gBAAgB,EACxC,WAAW,EAAE,WAAW,GACxB,CACH,CACG,CACe,CACtB,CACJ,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback, useMemo } from 'react';\nimport { TutorialPanelProps } from '../../interfaces';\nimport InternalBox from '../../../box/internal';\nimport { InternalButton } from '../../../button/internal';\nimport InternalSpaceBetween from '../../../space-between/internal';\nimport styles from './styles.css.js';\nimport { fireNonCancelableEvent } from '../../../internal/events/index';\nimport { HotspotContext } from '../../../annotation-context/context';\nimport { CongratulationScreen } from './congratulation-screen';\nimport { TaskList } from './task-list';\nimport { useVisualRefresh } from '../../../internal/hooks/use-visual-mode';\n\nexport default function TutorialDetailView({\n tutorial,\n onExitTutorial: onExitTutorialHandler,\n currentStepIndex = 0,\n onFeedbackClick: onFeedbackClickHandler,\n i18nStrings,\n}: {\n tutorial: TutorialPanelProps.Tutorial;\n onExitTutorial: HotspotContext['onExitTutorial'];\n currentStepIndex: HotspotContext['currentStepIndex'];\n onFeedbackClick: TutorialPanelProps['onFeedbackClick'];\n i18nStrings: TutorialPanelProps['i18nStrings'];\n}) {\n const isRefresh = useVisualRefresh();\n\n const onExitTutorial = useCallback(() => {\n fireNonCancelableEvent(onExitTutorialHandler, { tutorial });\n }, [onExitTutorialHandler, tutorial]);\n\n const onFeedbackClick = useMemo(\n () => onFeedbackClickHandler && (() => fireNonCancelableEvent(onFeedbackClickHandler, { tutorial })),\n [onFeedbackClickHandler, tutorial]\n );\n\n return (\n <>\n <InternalSpaceBetween size=\"xl\">\n <div className={styles['tutorial-title']}>\n <InternalButton\n variant=\"icon\"\n onClick={onExitTutorial}\n ariaLabel={i18nStrings.labelExitTutorial}\n formAction=\"none\"\n iconName=\"arrow-left\"\n />\n\n <InternalBox\n variant=\"h2\"\n fontSize={isRefresh ? 'heading-m' : 'heading-l'}\n padding={{ top: 'xxs' }}\n margin={{ left: 's' }}\n >\n {tutorial.title}\n </InternalBox>\n </div>\n <div>\n <div role=\"status\">\n {tutorial.completed && (\n <CongratulationScreen onFeedbackClick={onFeedbackClick} i18nStrings={i18nStrings}>\n {tutorial.completedScreenDescription}\n </CongratulationScreen>\n )}\n </div>\n {!tutorial.completed && (\n <TaskList\n tasks={tutorial.tasks}\n onExitTutorial={onExitTutorial}\n currentGlobalStepIndex={currentStepIndex}\n i18nStrings={i18nStrings}\n />\n )}\n </div>\n </InternalSpaceBetween>\n </>\n );\n}\n"]}
@@ -62,7 +62,7 @@ export interface TutorialPanelProps extends BaseComponentProps {
62
62
  /**
63
63
  * Fired when the user clicks on the feedback link at the end of a tutorial.
64
64
  */
65
- onFeedbackClick: NonCancelableEventHandler<TutorialPanelProps.TutorialDetail>;
65
+ onFeedbackClick?: NonCancelableEventHandler<TutorialPanelProps.TutorialDetail>;
66
66
  }
67
67
  export declare namespace TutorialPanelProps {
68
68
  interface TutorialDetail {
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"lib/default/","sources":["tutorial-panel/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B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Content":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface TutorialPanelProps extends BaseComponentProps {\n /**\n * Whether the content of the panel is currently loading. If this property\n * is set to `true`, the panel displays a spinner and the loadingText that is\n * specified in the `i18nStrings` property.\n */\n loading?: boolean;\n\n /**\n * List of all available tutorials. An array of objects with the following properties:\n *\n * * `title` (string) - Name of the tutorial\n *\n * * `description` (ReactNode) - Short description of the tutorial's content.\n *\n * * `tasks` - Array of tasks (in intended order). Each Task has the following properties:\n * * `title` (string) - Name of this task. This is shown in the task list overview of the tutorial's detail view.\n * * `steps` - Array of steps in this task (in intended order). Each step has the following properties:\n * * `title` (string) - Title of this step. This is shown in the step list in the tutorial's detail view.\n * * `content` (ReactNode) - Content to be shown in the popover of this step. Can be JSX or plain text.\n * * `warningAlert` (ReactNode) - (Optional) If this field is present, a warning alert will be displayed\n * inside the step's popover, showing this field's content. Can be JSX or plain text.\n * * `hotspotId` (string) - ID of the hotspot that this tutorial step points to.\n *\n * A hotspot with this ID needs to be added manually to the code of the application and represents a location\n * in the application that a tutorial step can be attached to. It can be re-used by multiple tutorials. Hotspot\n * IDs need to be unique in the scope of the whole application that uses this tutorial.\n *\n * * `completedScreenDescription` (ReactNode) - Description to be shown on the last page of the tutorial, when the\n * user has successfully completed the tutorial.\n *\n * * `prerequisitesAlert` (ReactNode) - (Optional) If the application determines that the user cannot start the tutorial\n * yet (by specifying the property `prerequisitesNeeded` on the tutorial object), the content of `prerequisitesAlert`\n * will be shown in the tutorial list underneath the tutorial title.\n *\n * Example: `<><Link>Create a bucket first</Link> to complete this tutorial.</>`\n *\n * * `prerequisitesNeeded` (boolean) - (Optional) If this property is set to `true`, the tutorial list will disable the\n * `Start tutorial` button for this tutorial, and it will show the contents of the tutorial's `prerequisitesAlert` field\n * in an alert underneath the tutorial title.\n *\n * * `learnMoreUrl` (string | null) - (Optional) If present, the tutorial list will show a \"Learn More\" link pointing to\n * this URL underneath the tutorial's description.\n *\n * * `completed` (boolean) - Whether the user has already completed this tutorial.\n *\n * If this property is set to `true`, the tutorial list will show a status indicator underneath the tutorial title with\n * a message that indicates that this tutorial has already been completed by the user (e.g. \"Tutorial completed\"), and\n * the \"Start tutorial\" button will be replaced by a \"Restart tutorial\" button.\n */\n tutorials: ReadonlyArray<TutorialPanelProps.Tutorial>;\n\n /**\n * The link to a file documenting all tutorials (usually a PDF).\n */\n downloadUrl?: string;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n */\n i18nStrings: TutorialPanelProps.I18nStrings;\n\n /**\n * Fired when the user clicks on the feedback link at the end of a tutorial.\n */\n onFeedbackClick: NonCancelableEventHandler<TutorialPanelProps.TutorialDetail>;\n}\n\nexport namespace TutorialPanelProps {\n export interface TutorialDetail {\n tutorial: Tutorial;\n }\n\n export interface Tutorial {\n /**\n * Title of the tutorial\n * */\n title: string;\n\n /**\n * Short description of the tutorial's content. This is displayed in the tutorial list.\n */\n description: React.ReactNode;\n\n /**\n * List of tasks (in intended order)\n */\n tasks: ReadonlyArray<Task>;\n\n /**\n * Description to be shown on the last page of the tutorial, when the user has\n * successfully completed the tutorial.\n */\n completedScreenDescription: React.ReactNode;\n\n /**\n * If the application determines that the user cannot start\n * the tutorial yet (by specifying the property `prerequisitesNeeded` on the\n * tutorial object), the content of `prerequisitesAlert` will be shown in the\n * tutorial list underneath the tutorial title.\n *\n * @deprecated Use alert component inside description property directly.\n */\n prerequisitesAlert?: React.ReactNode;\n\n /**\n * If this property is set to `true`, the tutorial list\n * will disable the `Start tutorial` button for this\n * tutorial, and it will show the contents of the\n * tutorial's `prerequisitesAlert` field in an alert underneath\n * the tutorial title.\n */\n prerequisitesNeeded?: boolean;\n\n /**\n * If present, the tutorial list will show a \"Learn More\" link pointing to\n * this URL underneath the tutorial's description.\n */\n learnMoreUrl?: string | null;\n\n /**\n * Whether the user has already completed this tutorial.\n *\n * If this property is set to `true`, the tutorial list\n * will show a status indicator underneath the tutorial\n * title with a message that indicates that this tutorial\n * has already been completed by the user (e.g.\n * \"Tutorial completed\"), and the \"Start tutorial\" button\n * will be replaced by a \"Restart tutorial\" button.\n *\n */\n completed: boolean;\n }\n\n export interface Task {\n /**\n * Title of this task. This is shown in the task list overview of the tutorial's\n * detail view.\n */\n title: string;\n\n /**\n * Steps in this task (in intended order)\n */\n steps: ReadonlyArray<Step>;\n }\n\n export interface Step {\n /**\n * Title of this step. This is shown in the step list in the tutorial's\n * detail view.\n */\n title: string;\n\n /**\n * Content to be shown in the popover of this step. Can be JSX or plain text.\n */\n content: React.ReactNode;\n\n /**\n * If this field is present, a warning alert will be displayed inside\n * the step's popover, showing this field's content. Can be JSX or plain text.\n * @deprecated Use alert component inside content property directly.\n */\n warningAlert?: React.ReactNode;\n\n /**\n * ID of the hotspot that this tutorial step points to.\n *\n * A hotspot with this ID needs to be added manually to the code of the application\n * and represents a location in the application that a tutorial step can be\n * attached to. It can be re-used by multiple tutorials. Hotspot IDs need\n * to be unique in the scope of the whole application that uses this tutorial.\n */\n hotspotId: string;\n }\n\n export interface I18nStrings {\n loadingText: string;\n\n tutorialListTitle: string;\n tutorialListDescription: React.ReactNode;\n tutorialListDownloadLinkText: string;\n\n tutorialCompletedText: string;\n learnMoreLinkText: string;\n\n startTutorialButtonText: string;\n restartTutorialButtonText: string;\n\n completionScreenTitle: string;\n\n feedbackLinkText: string;\n dismissTutorialButtonText: string;\n\n taskTitle: (taskIndex: number, taskTitle: string) => string;\n stepTitle: (stepIndex: number, stepTitle: string) => string;\n\n labelExitTutorial: string;\n labelTotalSteps: (totalStepCount: number) => string;\n labelLearnMoreExternalIcon: string;\n\n labelsTaskStatus: {\n pending: string;\n 'in-progress': string;\n success: string;\n };\n\n labelTutorialListDownloadLink?: string;\n labelLearnMoreLink?: string;\n }\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["tutorial-panel/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface TutorialPanelProps extends BaseComponentProps {\n /**\n * Whether the content of the panel is currently loading. If this property\n * is set to `true`, the panel displays a spinner and the loadingText that is\n * specified in the `i18nStrings` property.\n */\n loading?: boolean;\n\n /**\n * List of all available tutorials. An array of objects with the following properties:\n *\n * * `title` (string) - Name of the tutorial\n *\n * * `description` (ReactNode) - Short description of the tutorial's content.\n *\n * * `tasks` - Array of tasks (in intended order). Each Task has the following properties:\n * * `title` (string) - Name of this task. This is shown in the task list overview of the tutorial's detail view.\n * * `steps` - Array of steps in this task (in intended order). Each step has the following properties:\n * * `title` (string) - Title of this step. This is shown in the step list in the tutorial's detail view.\n * * `content` (ReactNode) - Content to be shown in the popover of this step. Can be JSX or plain text.\n * * `warningAlert` (ReactNode) - (Optional) If this field is present, a warning alert will be displayed\n * inside the step's popover, showing this field's content. Can be JSX or plain text.\n * * `hotspotId` (string) - ID of the hotspot that this tutorial step points to.\n *\n * A hotspot with this ID needs to be added manually to the code of the application and represents a location\n * in the application that a tutorial step can be attached to. It can be re-used by multiple tutorials. Hotspot\n * IDs need to be unique in the scope of the whole application that uses this tutorial.\n *\n * * `completedScreenDescription` (ReactNode) - Description to be shown on the last page of the tutorial, when the\n * user has successfully completed the tutorial.\n *\n * * `prerequisitesAlert` (ReactNode) - (Optional) If the application determines that the user cannot start the tutorial\n * yet (by specifying the property `prerequisitesNeeded` on the tutorial object), the content of `prerequisitesAlert`\n * will be shown in the tutorial list underneath the tutorial title.\n *\n * Example: `<><Link>Create a bucket first</Link> to complete this tutorial.</>`\n *\n * * `prerequisitesNeeded` (boolean) - (Optional) If this property is set to `true`, the tutorial list will disable the\n * `Start tutorial` button for this tutorial, and it will show the contents of the tutorial's `prerequisitesAlert` field\n * in an alert underneath the tutorial title.\n *\n * * `learnMoreUrl` (string | null) - (Optional) If present, the tutorial list will show a \"Learn More\" link pointing to\n * this URL underneath the tutorial's description.\n *\n * * `completed` (boolean) - Whether the user has already completed this tutorial.\n *\n * If this property is set to `true`, the tutorial list will show a status indicator underneath the tutorial title with\n * a message that indicates that this tutorial has already been completed by the user (e.g. \"Tutorial completed\"), and\n * the \"Start tutorial\" button will be replaced by a \"Restart tutorial\" button.\n */\n tutorials: ReadonlyArray<TutorialPanelProps.Tutorial>;\n\n /**\n * The link to a file documenting all tutorials (usually a PDF).\n */\n downloadUrl?: string;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n */\n i18nStrings: TutorialPanelProps.I18nStrings;\n\n /**\n * Fired when the user clicks on the feedback link at the end of a tutorial.\n */\n onFeedbackClick?: NonCancelableEventHandler<TutorialPanelProps.TutorialDetail>;\n}\n\nexport namespace TutorialPanelProps {\n export interface TutorialDetail {\n tutorial: Tutorial;\n }\n\n export interface Tutorial {\n /**\n * Title of the tutorial\n * */\n title: string;\n\n /**\n * Short description of the tutorial's content. This is displayed in the tutorial list.\n */\n description: React.ReactNode;\n\n /**\n * List of tasks (in intended order)\n */\n tasks: ReadonlyArray<Task>;\n\n /**\n * Description to be shown on the last page of the tutorial, when the user has\n * successfully completed the tutorial.\n */\n completedScreenDescription: React.ReactNode;\n\n /**\n * If the application determines that the user cannot start\n * the tutorial yet (by specifying the property `prerequisitesNeeded` on the\n * tutorial object), the content of `prerequisitesAlert` will be shown in the\n * tutorial list underneath the tutorial title.\n *\n * @deprecated Use alert component inside description property directly.\n */\n prerequisitesAlert?: React.ReactNode;\n\n /**\n * If this property is set to `true`, the tutorial list\n * will disable the `Start tutorial` button for this\n * tutorial, and it will show the contents of the\n * tutorial's `prerequisitesAlert` field in an alert underneath\n * the tutorial title.\n */\n prerequisitesNeeded?: boolean;\n\n /**\n * If present, the tutorial list will show a \"Learn More\" link pointing to\n * this URL underneath the tutorial's description.\n */\n learnMoreUrl?: string | null;\n\n /**\n * Whether the user has already completed this tutorial.\n *\n * If this property is set to `true`, the tutorial list\n * will show a status indicator underneath the tutorial\n * title with a message that indicates that this tutorial\n * has already been completed by the user (e.g.\n * \"Tutorial completed\"), and the \"Start tutorial\" button\n * will be replaced by a \"Restart tutorial\" button.\n *\n */\n completed: boolean;\n }\n\n export interface Task {\n /**\n * Title of this task. This is shown in the task list overview of the tutorial's\n * detail view.\n */\n title: string;\n\n /**\n * Steps in this task (in intended order)\n */\n steps: ReadonlyArray<Step>;\n }\n\n export interface Step {\n /**\n * Title of this step. This is shown in the step list in the tutorial's\n * detail view.\n */\n title: string;\n\n /**\n * Content to be shown in the popover of this step. Can be JSX or plain text.\n */\n content: React.ReactNode;\n\n /**\n * If this field is present, a warning alert will be displayed inside\n * the step's popover, showing this field's content. Can be JSX or plain text.\n * @deprecated Use alert component inside content property directly.\n */\n warningAlert?: React.ReactNode;\n\n /**\n * ID of the hotspot that this tutorial step points to.\n *\n * A hotspot with this ID needs to be added manually to the code of the application\n * and represents a location in the application that a tutorial step can be\n * attached to. It can be re-used by multiple tutorials. Hotspot IDs need\n * to be unique in the scope of the whole application that uses this tutorial.\n */\n hotspotId: string;\n }\n\n export interface I18nStrings {\n loadingText: string;\n\n tutorialListTitle: string;\n tutorialListDescription: React.ReactNode;\n tutorialListDownloadLinkText: string;\n\n tutorialCompletedText: string;\n learnMoreLinkText: string;\n\n startTutorialButtonText: string;\n restartTutorialButtonText: string;\n\n completionScreenTitle: string;\n\n feedbackLinkText: string;\n dismissTutorialButtonText: string;\n\n taskTitle: (taskIndex: number, taskTitle: string) => string;\n stepTitle: (stepIndex: number, stepTitle: string) => string;\n\n labelExitTutorial: string;\n labelTotalSteps: (totalStepCount: number) => string;\n labelLearnMoreExternalIcon: string;\n\n labelsTaskStatus: {\n pending: string;\n 'in-progress': string;\n success: string;\n };\n\n labelTutorialListDownloadLink?: string;\n labelLearnMoreLink?: string;\n }\n}\n"]}