@cloudscape-design/components 3.0.127 → 3.0.128
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/annotation-context/annotation/annotation-popover.d.ts.map +1 -1
- package/annotation-context/annotation/annotation-popover.js +2 -8
- package/annotation-context/annotation/annotation-popover.js.map +1 -1
- package/annotation-context/annotation/annotation-trigger.d.ts +0 -2
- package/annotation-context/annotation/annotation-trigger.d.ts.map +1 -1
- package/annotation-context/annotation/annotation-trigger.js +2 -2
- package/annotation-context/annotation/annotation-trigger.js.map +1 -1
- package/annotation-context/annotation/closed-annotation.d.ts +1 -3
- package/annotation-context/annotation/closed-annotation.d.ts.map +1 -1
- package/annotation-context/annotation/closed-annotation.js +2 -2
- package/annotation-context/annotation/closed-annotation.js.map +1 -1
- package/annotation-context/annotation/open-annotation.d.ts.map +1 -1
- package/annotation-context/annotation/open-annotation.js +1 -1
- package/annotation-context/annotation/open-annotation.js.map +1 -1
- package/annotation-context/annotation/styles.css.js +24 -24
- package/annotation-context/annotation/styles.scoped.css +30 -30
- package/annotation-context/annotation/styles.selectors.js +24 -24
- package/annotation-context/index.d.ts.map +1 -1
- package/annotation-context/index.js +1 -3
- package/annotation-context/index.js.map +1 -1
- package/annotation-context/interfaces.d.ts +1 -1
- package/annotation-context/interfaces.d.ts.map +1 -1
- package/annotation-context/interfaces.js.map +1 -1
- package/app-layout/visual-refresh/main.d.ts.map +1 -1
- package/app-layout/visual-refresh/main.js +3 -8
- package/app-layout/visual-refresh/main.js.map +1 -1
- package/app-layout/visual-refresh/styles.css.js +60 -60
- package/app-layout/visual-refresh/styles.scoped.css +237 -255
- package/app-layout/visual-refresh/styles.selectors.js +60 -60
- package/area-chart/internal.d.ts.map +1 -1
- package/area-chart/internal.js +0 -5
- package/area-chart/internal.js.map +1 -1
- package/area-chart/model/index.d.ts +0 -1
- package/area-chart/model/index.d.ts.map +1 -1
- package/area-chart/model/index.js.map +1 -1
- package/area-chart/model/use-chart-model.d.ts.map +1 -1
- package/area-chart/model/use-chart-model.js +1 -8
- package/area-chart/model/use-chart-model.js.map +1 -1
- package/attribute-editor/row.d.ts.map +1 -1
- package/attribute-editor/row.js +3 -4
- package/attribute-editor/row.js.map +1 -1
- package/attribute-editor/styles.css.js +12 -13
- package/attribute-editor/styles.scoped.css +23 -27
- package/attribute-editor/styles.selectors.js +12 -13
- package/breadcrumb-group/interfaces.d.ts +0 -1
- package/breadcrumb-group/interfaces.d.ts.map +1 -1
- package/breadcrumb-group/interfaces.js.map +1 -1
- package/breadcrumb-group/internal.d.ts.map +1 -1
- package/breadcrumb-group/internal.js +1 -1
- package/breadcrumb-group/internal.js.map +1 -1
- package/breadcrumb-group/item/item.d.ts +1 -1
- package/breadcrumb-group/item/item.d.ts.map +1 -1
- package/breadcrumb-group/item/item.js +8 -68
- package/breadcrumb-group/item/item.js.map +1 -1
- package/breadcrumb-group/item/styles.css.js +7 -9
- package/breadcrumb-group/item/styles.scoped.css +16 -26
- package/breadcrumb-group/item/styles.selectors.js +7 -9
- package/code-editor/index.d.ts.map +1 -1
- package/code-editor/index.js +16 -11
- package/code-editor/index.js.map +1 -1
- package/code-editor/interfaces.d.ts +1 -12
- package/code-editor/interfaces.d.ts.map +1 -1
- package/code-editor/interfaces.js.map +1 -1
- package/code-editor/status-bar.d.ts.map +1 -1
- package/code-editor/status-bar.js +1 -7
- package/code-editor/status-bar.js.map +1 -1
- package/code-editor/util.js +1 -1
- package/code-editor/util.js.map +1 -1
- package/container/internal.d.ts.map +1 -1
- package/container/internal.js +4 -7
- package/container/internal.js.map +1 -1
- package/date-range-picker/calendar/grids/index.d.ts +1 -0
- package/date-range-picker/calendar/grids/index.d.ts.map +1 -1
- package/date-range-picker/calendar/grids/index.js +14 -2
- package/date-range-picker/calendar/grids/index.js.map +1 -1
- package/date-range-picker/calendar/index.d.ts +4 -6
- package/date-range-picker/calendar/index.d.ts.map +1 -1
- package/date-range-picker/calendar/index.js +123 -111
- package/date-range-picker/calendar/index.js.map +1 -1
- package/date-range-picker/calendar/use-date-time.d.ts +9 -0
- package/date-range-picker/calendar/use-date-time.d.ts.map +1 -0
- package/date-range-picker/calendar/use-date-time.js +16 -0
- package/date-range-picker/calendar/use-date-time.js.map +1 -0
- package/date-range-picker/dropdown.d.ts +1 -2
- package/date-range-picker/dropdown.d.ts.map +1 -1
- package/date-range-picker/dropdown.js +6 -8
- package/date-range-picker/dropdown.js.map +1 -1
- package/date-range-picker/index.d.ts.map +1 -1
- package/date-range-picker/index.js +2 -2
- package/date-range-picker/index.js.map +1 -1
- package/date-range-picker/interfaces.d.ts +4 -14
- package/date-range-picker/interfaces.d.ts.map +1 -1
- package/date-range-picker/interfaces.js.map +1 -1
- package/date-range-picker/styles.css.js +38 -38
- package/date-range-picker/styles.scoped.css +50 -45
- package/date-range-picker/styles.selectors.js +38 -38
- package/date-range-picker/utils.d.ts +8 -2
- package/date-range-picker/utils.d.ts.map +1 -1
- package/date-range-picker/utils.js +12 -17
- package/date-range-picker/utils.js.map +1 -1
- package/flashbar/styles.css.js +33 -33
- package/flashbar/styles.scoped.css +121 -121
- package/flashbar/styles.selectors.js +33 -33
- package/internal/components/dropdown/index.d.ts.map +1 -1
- package/internal/components/dropdown/index.js +9 -2
- package/internal/components/dropdown/index.js.map +1 -1
- package/internal/components/dropdown-status/index.d.ts +4 -1
- package/internal/components/dropdown-status/index.d.ts.map +1 -1
- package/internal/components/dropdown-status/index.js +5 -3
- package/internal/components/dropdown-status/index.js.map +1 -1
- package/internal/components/filtering-token/index.d.ts +1 -2
- package/internal/components/filtering-token/index.d.ts.map +1 -1
- package/internal/components/filtering-token/index.js +2 -2
- package/internal/components/filtering-token/index.js.map +1 -1
- package/internal/components/option/index.js +4 -4
- package/internal/components/option/index.js.map +1 -1
- package/internal/environment.js +1 -1
- package/internal/generated/custom-css-properties/index.d.ts.map +1 -1
- package/internal/generated/custom-css-properties/index.js +26 -27
- package/internal/generated/custom-css-properties/index.js.map +1 -1
- package/internal/manifest.json +1 -1
- package/internal/utils/date-time/index.d.ts +1 -2
- package/internal/utils/date-time/index.d.ts.map +1 -1
- package/internal/utils/date-time/index.js +1 -2
- package/internal/utils/date-time/index.js.map +1 -1
- package/internal/utils/date-time/join-date-time.d.ts +0 -4
- package/internal/utils/date-time/join-date-time.d.ts.map +1 -1
- package/internal/utils/date-time/join-date-time.js +0 -4
- package/internal/utils/date-time/join-date-time.js.map +1 -1
- package/mixed-line-bar-chart/chart-container.d.ts.map +1 -1
- package/mixed-line-bar-chart/chart-container.js +5 -14
- package/mixed-line-bar-chart/chart-container.js.map +1 -1
- package/package.json +1 -1
- package/pie-chart/pie-chart.d.ts.map +1 -1
- package/pie-chart/pie-chart.js +1 -10
- package/pie-chart/pie-chart.js.map +1 -1
- package/popover/body.d.ts +1 -2
- package/popover/body.d.ts.map +1 -1
- package/popover/body.js +2 -2
- package/popover/body.js.map +1 -1
- package/property-filter/interfaces.d.ts +0 -1
- package/property-filter/interfaces.d.ts.map +1 -1
- package/property-filter/interfaces.js.map +1 -1
- package/property-filter/token.d.ts.map +1 -1
- package/property-filter/token.js +1 -1
- package/property-filter/token.js.map +1 -1
- package/select/parts/filter.d.ts +1 -1
- package/select/utils/use-select.d.ts +7 -1
- package/select/utils/use-select.d.ts.map +1 -1
- package/select/utils/use-select.js +1 -1
- package/select/utils/use-select.js.map +1 -1
- package/table/styles.css.js +34 -34
- package/table/styles.scoped.css +40 -42
- package/table/styles.selectors.js +34 -34
- package/tabs/index.d.ts.map +1 -1
- package/tabs/index.js +11 -9
- package/tabs/index.js.map +1 -1
- package/tabs/styles.css.js +21 -21
- package/tabs/styles.scoped.css +41 -48
- package/tabs/styles.selectors.js +21 -21
- package/tabs/tab-header-bar.d.ts +0 -4
- package/tabs/tab-header-bar.d.ts.map +1 -1
- package/tabs/tab-header-bar.js +1 -5
- package/tabs/tab-header-bar.js.map +1 -1
- package/tag-editor/internal.d.ts.map +1 -1
- package/tag-editor/internal.js +7 -6
- package/tag-editor/internal.js.map +1 -1
- package/test-utils/tsconfig.tsbuildinfo +1 -1
- package/tutorial-panel/components/tutorial-detail-view/index.d.ts.map +1 -1
- package/tutorial-panel/components/tutorial-detail-view/index.js +1 -3
- package/tutorial-panel/components/tutorial-detail-view/index.js.map +1 -1
- package/tutorial-panel/components/tutorial-detail-view/task.d.ts.map +1 -1
- package/tutorial-panel/components/tutorial-detail-view/task.js +1 -2
- package/tutorial-panel/components/tutorial-detail-view/task.js.map +1 -1
- package/tutorial-panel/components/tutorial-list/index.d.ts.map +1 -1
- package/tutorial-panel/components/tutorial-list/index.js +2 -2
- package/tutorial-panel/components/tutorial-list/index.js.map +1 -1
- package/tutorial-panel/interfaces.d.ts +0 -2
- package/tutorial-panel/interfaces.d.ts.map +1 -1
- package/tutorial-panel/interfaces.js.map +1 -1
- package/wizard/index.d.ts.map +1 -1
- package/wizard/index.js +5 -9
- package/wizard/index.js.map +1 -1
- package/wizard/wizard-form.d.ts.map +1 -1
- package/wizard/wizard-form.js +2 -7
- package/wizard/wizard-form.js.map +1 -1
- package/date-range-picker/calendar/utils.d.ts +0 -4
- package/date-range-picker/calendar/utils.d.ts.map +0 -1
- package/date-range-picker/calendar/utils.js +0 -31
- package/date-range-picker/calendar/utils.js.map +0 -1
- package/internal/hooks/use-analytics/index.d.ts +0 -2
- package/internal/hooks/use-analytics/index.d.ts.map +0 -1
- package/internal/hooks/use-analytics/index.js +0 -16
- package/internal/hooks/use-analytics/index.js.map +0 -1
- package/internal/utils/date-time/format-date-time.d.ts +0 -2
- package/internal/utils/date-time/format-date-time.d.ts.map +0 -1
- package/internal/utils/date-time/format-date-time.js +0 -8
- package/internal/utils/date-time/format-date-time.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/tutorial-panel/components/tutorial-list/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QA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Aa,IAAC,IAAI,EAAC,MAAM,EAAC,SAAS,EAAE,MAAM,CAAC,qBAAqB,CAAC,IAChE,QAAQ,CAAC,kBAAkB,CACd,CACjB;4BACD,oBAAC,oBAAoB,IAAC,IAAI,EAAC,GAAG;gCAC5B,oBAAC,WAAW,IAAC,KAAK,EAAC,qBAAqB;oCACtC,6BACE,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,sBAAsB,CAAC,EAC9B,OAAO,QAAQ,CAAC,WAAW,KAAK,QAAQ,IAAI,MAAM,CAAC,gCAAgC,CAAC,CACrF,IAEA,QAAQ,CAAC,WAAW,CACjB,CACM;gCACb,QAAQ,CAAC,YAAY,IAAI,CACxB,oBAAC,YAAY,IACX,IAAI,EAAE,QAAQ,CAAC,YAAY,EAC3B,SAAS,EAAE,MAAM,CAAC,iBAAiB,CAAC,EACpC,qBAAqB,EAAE,WAAW,CAAC,0BAA0B,EAC7D,SAAS,EAAE,WAAW,CAAC,kBAAkB,EACzC,QAAQ,EAAE,IAAI,IAEb,WAAW,CAAC,iBAAiB,CACjB,CAChB,CACoB,CACF;wBAEvB,oBAAC,WAAW,IAAC,MAAM,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE;4BACpC,oBAAC,cAAc,IACb,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,MAAA,QAAQ,CAAC,mBAAmB,mCAAI,KAAK,EAC/C,UAAU,EAAC,MAAM,EACjB,SAAS,EAAE,MAAM,CAAC,KAAK,IAEtB,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,yBAAyB,CAAC,CAAC,CAAC,WAAW,CAAC,uBAAuB,CAClF,CACL,CACO,CACnB,CACQ,CACZ,CACH,CACN,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback, useState } from 'react';\nimport styles from './styles.css.js';\nimport { TutorialPanelProps } from '../../interfaces';\nimport InternalBox from '../../../box/internal';\nimport { InternalButton } from '../../../button/internal';\nimport InternalStatusIndicator from '../../../status-indicator/internal';\nimport InternalSpaceBetween from '../../../space-between/internal';\nimport { fireNonCancelableEvent } from '../../../internal/events/index.js';\nimport clsx from 'clsx';\nimport InternalAlert from '../../../alert/internal';\nimport InternalLink from '../../../link/internal';\nimport { useUniqueId } from '../../../internal/hooks/use-unique-id/index.js';\nimport { CSSTransition } from 'react-transition-group';\nimport { HotspotContext } from '../../../annotation-context/context.js';\nimport InternalIcon from '../../../icon/internal';\nimport useFocusVisible from '../../../internal/hooks/focus-visible/index.js';\nimport { useVisualRefresh } from '../../../internal/hooks/use-visual-mode';\nimport { checkSafeUrl } from '../../../internal/utils/check-safe-url';\nimport LiveRegion from '../../../internal/components/live-region/index.js';\n\nexport interface TutorialListProps {\n loading?: boolean;\n tutorials: TutorialPanelProps['tutorials'];\n onStartTutorial: HotspotContext['onStartTutorial'];\n filteringFunction: (tutorial: TutorialPanelProps.Tutorial, searchTerm: string) => boolean;\n i18nStrings: TutorialPanelProps['i18nStrings'];\n downloadUrl: TutorialPanelProps['downloadUrl'];\n}\n\nexport default function TutorialList({\n i18nStrings,\n tutorials,\n loading = false,\n onStartTutorial,\n downloadUrl,\n}: TutorialListProps) {\n checkSafeUrl('TutorialPanel', downloadUrl);\n\n /*\n // Filtering is not available in the Beta release.\n\n const [searchTerm, setSearchTerm] = useState('');\n\n const onSearchChangeCallback: InputProps['onChange'] = useCallback(event => setSearchTerm(event.detail.value), [\n setSearchTerm\n ]);\n\n const filteredTutorials = tutorials.filter(tutorial => filteringFunction(tutorial, searchTerm))\n */\n\n const focusVisible = useFocusVisible();\n const isRefresh = useVisualRefresh();\n\n return (\n <>\n <InternalSpaceBetween size=\"s\">\n <InternalSpaceBetween size=\"m\">\n <InternalBox variant=\"h2\" fontSize={isRefresh ? 'heading-m' : 'heading-l'} padding={{ bottom: 'n' }}>\n {i18nStrings.tutorialListTitle}\n </InternalBox>\n <InternalBox variant=\"p\" color=\"text-body-secondary\" padding=\"n\">\n {i18nStrings.tutorialListDescription}\n </InternalBox>\n </InternalSpaceBetween>\n <InternalSpaceBetween size=\"l\">\n <a\n {...focusVisible}\n href={downloadUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={styles['download-link']}\n aria-label={i18nStrings.labelTutorialListDownloadLink}\n >\n <InternalIcon name=\"download\" />\n <InternalBox padding={{ left: 'xs' }} color=\"inherit\" fontWeight=\"bold\" display=\"inline\">\n {i18nStrings.tutorialListDownloadLinkText}\n </InternalBox>\n </a>\n\n {/*\n <FormField label=\"Filter tutorials\">\n <Input type=\"search\" value={searchTerm} placeholder=\"Filter tutorials\" onChange={onSearchChangeCallback} />\n </FormField>\n */}\n {loading ? (\n <InternalStatusIndicator type=\"loading\">\n <LiveRegion visible={true}>{i18nStrings.loadingText}</LiveRegion>\n </InternalStatusIndicator>\n ) : (\n <>\n <ul className={styles['tutorial-list']} role=\"list\">\n {tutorials.map((tutorial, index) => (\n <Tutorial\n tutorial={tutorial}\n key={index}\n onStartTutorial={onStartTutorial}\n i18nStrings={i18nStrings}\n />\n ))}\n </ul>\n {/* {filteredTutorials.length === 0 && searchTerm && <Box>No tutorials match this search filter.</Box>} */}\n </>\n )}\n </InternalSpaceBetween>\n </InternalSpaceBetween>\n </>\n );\n}\n\nfunction Tutorial({\n tutorial,\n onStartTutorial: onStartTutorialEventHandler,\n i18nStrings,\n}: {\n tutorial: TutorialPanelProps.Tutorial;\n onStartTutorial: HotspotContext['onStartTutorial'];\n i18nStrings: TutorialPanelProps['i18nStrings'];\n}) {\n checkSafeUrl('TutorialPanel', tutorial.learnMoreUrl);\n const controlId = useUniqueId();\n const triggerControldId = useUniqueId();\n const headerId = useUniqueId();\n\n const isRefresh = useVisualRefresh();\n\n const onStartTutorial = useCallback(() => {\n fireNonCancelableEvent(onStartTutorialEventHandler, { tutorial });\n }, [onStartTutorialEventHandler, tutorial]);\n\n const [expanded, setExpanded] = useState(!tutorial.prerequisitesNeeded && !tutorial.completed);\n\n const onClick = useCallback(() => {\n setExpanded(expanded => !expanded);\n }, []);\n\n return (\n <li className={styles['tutorial-box']} role=\"listitem\">\n <InternalSpaceBetween size=\"xs\">\n <div className={styles['tutorial-box-title']}>\n <InternalBox\n variant=\"h3\"\n fontSize={isRefresh ? 'heading-s' : 'heading-m'}\n id={headerId}\n margin={{ right: 'xs' }}\n padding=\"n\"\n className={styles.title}\n >\n {tutorial.title}\n </InternalBox>\n <div className={styles['button-wrapper']}>\n <InternalButton\n id={triggerControldId}\n variant=\"icon\"\n ariaExpanded={expanded}\n __nativeAttributes={{\n 'aria-controls': controlId,\n 'aria-labelledby': headerId,\n }}\n formAction=\"none\"\n onClick={onClick}\n className={expanded ? styles['collapse-button'] : styles['expand-button']}\n iconName={expanded ? 'angle-up' : 'angle-down'}\n />\n </div>\n </div>\n\n {tutorial.completed ? (\n <InternalStatusIndicator __size=\"inherit\" type=\"success\" className={styles.completed} wrapText={true}>\n {i18nStrings.tutorialCompletedText}\n </InternalStatusIndicator>\n ) : null}\n </InternalSpaceBetween>\n\n <div aria-live=\"polite\">\n <CSSTransition in={expanded} timeout={30} classNames={{ enter: styles['content-enter'] }}>\n <div className={clsx(styles['expandable-section'], expanded && styles.expanded)} id={controlId}>\n <InternalSpaceBetween size=\"l\">\n <InternalSpaceBetween size=\"m\">\n {tutorial.prerequisitesNeeded && tutorial.prerequisitesAlert && (\n <InternalAlert type=\"info\" className={styles['prerequisites-alert']}>\n {tutorial.prerequisitesAlert}\n </InternalAlert>\n )}\n <InternalSpaceBetween size=\"s\">\n <InternalBox color=\"text-body-secondary\">\n <div\n className={clsx(\n styles['tutorial-description'],\n typeof tutorial.description === 'string' && styles['tutorial-description-plaintext']\n )}\n >\n {tutorial.description}\n </div>\n </InternalBox>\n {tutorial.learnMoreUrl && (\n <InternalLink\n href={tutorial.learnMoreUrl}\n className={styles['learn-more-link']}\n externalIconAriaLabel={i18nStrings.labelLearnMoreExternalIcon}\n ariaLabel={i18nStrings.labelLearnMoreLink}\n external={true}\n >\n {i18nStrings.learnMoreLinkText}\n </InternalLink>\n )}\n </InternalSpaceBetween>\n </InternalSpaceBetween>\n\n <InternalBox margin={{ bottom: 'xxs' }}>\n <InternalButton\n onClick={onStartTutorial}\n disabled={tutorial.prerequisitesNeeded ?? false}\n formAction=\"none\"\n className={styles.start}\n >\n {tutorial.completed ? i18nStrings.restartTutorialButtonText : i18nStrings.startTutorialButtonText}\n </InternalButton>\n </InternalBox>\n </InternalSpaceBetween>\n </div>\n </CSSTransition>\n </div>\n </li>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/tutorial-panel/components/tutorial-list/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,uBAAuB,MAAM,oCAAoC,CAAC;AACzE,OAAO,oBAAoB,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,aAAa,MAAM,yBAAyB,CAAC;AACpD,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,gDAAgD,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,eAAe,MAAM,gDAAgD,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO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OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,MAAA,QAAQ,CAAC,mBAAmB,mCAAI,KAAK,EAC/C,UAAU,EAAC,MAAM,EACjB,SAAS,EAAE,MAAM,CAAC,KAAK,IAEtB,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,yBAAyB,CAAC,CAAC,CAAC,WAAW,CAAC,uBAAuB,CAClF,CACL,CACO,CACnB,CACQ,CACZ,CACH,CACN,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback, useState } from 'react';\nimport styles from './styles.css.js';\nimport { TutorialPanelProps } from '../../interfaces';\nimport InternalBox from '../../../box/internal';\nimport { InternalButton } from '../../../button/internal';\nimport InternalStatusIndicator from '../../../status-indicator/internal';\nimport InternalSpaceBetween from '../../../space-between/internal';\nimport { fireNonCancelableEvent } from '../../../internal/events/index.js';\nimport clsx from 'clsx';\nimport InternalAlert from '../../../alert/internal';\nimport InternalLink from '../../../link/internal';\nimport { useUniqueId } from '../../../internal/hooks/use-unique-id/index.js';\nimport { CSSTransition } from 'react-transition-group';\nimport { HotspotContext } from '../../../annotation-context/context.js';\nimport InternalIcon from '../../../icon/internal';\nimport useFocusVisible from '../../../internal/hooks/focus-visible/index.js';\nimport { useVisualRefresh } from '../../../internal/hooks/use-visual-mode';\nimport { checkSafeUrl } from '../../../internal/utils/check-safe-url';\nimport LiveRegion from '../../../internal/components/live-region/index.js';\n\nexport interface TutorialListProps {\n loading?: boolean;\n tutorials: TutorialPanelProps['tutorials'];\n onStartTutorial: HotspotContext['onStartTutorial'];\n filteringFunction: (tutorial: TutorialPanelProps.Tutorial, searchTerm: string) => boolean;\n i18nStrings: TutorialPanelProps['i18nStrings'];\n downloadUrl: TutorialPanelProps['downloadUrl'];\n}\n\nexport default function TutorialList({\n i18nStrings,\n tutorials,\n loading = false,\n onStartTutorial,\n downloadUrl,\n}: TutorialListProps) {\n checkSafeUrl('TutorialPanel', downloadUrl);\n\n /*\n // Filtering is not available in the Beta release.\n\n const [searchTerm, setSearchTerm] = useState('');\n\n const onSearchChangeCallback: InputProps['onChange'] = useCallback(event => setSearchTerm(event.detail.value), [\n setSearchTerm\n ]);\n\n const filteredTutorials = tutorials.filter(tutorial => filteringFunction(tutorial, searchTerm))\n */\n\n const focusVisible = useFocusVisible();\n const isRefresh = useVisualRefresh();\n\n return (\n <>\n <InternalSpaceBetween size=\"s\">\n <InternalSpaceBetween size=\"m\">\n <InternalBox variant=\"h2\" fontSize={isRefresh ? 'heading-m' : 'heading-l'} padding={{ bottom: 'n' }}>\n {i18nStrings.tutorialListTitle}\n </InternalBox>\n <InternalBox variant=\"p\" color=\"text-body-secondary\" padding=\"n\">\n {i18nStrings.tutorialListDescription}\n </InternalBox>\n </InternalSpaceBetween>\n <InternalSpaceBetween size=\"l\">\n <a\n {...focusVisible}\n href={downloadUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={styles['download-link']}\n >\n <InternalIcon name=\"download\" />\n <InternalBox padding={{ left: 'xs' }} color=\"inherit\" fontWeight=\"bold\" display=\"inline\">\n {i18nStrings.tutorialListDownloadLinkText}\n </InternalBox>\n </a>\n\n {/*\n <FormField label=\"Filter tutorials\">\n <Input type=\"search\" value={searchTerm} placeholder=\"Filter tutorials\" onChange={onSearchChangeCallback} />\n </FormField>\n */}\n {loading ? (\n <InternalStatusIndicator type=\"loading\">\n <LiveRegion visible={true}>{i18nStrings.loadingText}</LiveRegion>\n </InternalStatusIndicator>\n ) : (\n <>\n <ul className={styles['tutorial-list']} role=\"list\">\n {tutorials.map((tutorial, index) => (\n <Tutorial\n tutorial={tutorial}\n key={index}\n onStartTutorial={onStartTutorial}\n i18nStrings={i18nStrings}\n />\n ))}\n </ul>\n {/* {filteredTutorials.length === 0 && searchTerm && <Box>No tutorials match this search filter.</Box>} */}\n </>\n )}\n </InternalSpaceBetween>\n </InternalSpaceBetween>\n </>\n );\n}\n\nfunction Tutorial({\n tutorial,\n onStartTutorial: onStartTutorialEventHandler,\n i18nStrings,\n}: {\n tutorial: TutorialPanelProps.Tutorial;\n onStartTutorial: HotspotContext['onStartTutorial'];\n i18nStrings: TutorialPanelProps['i18nStrings'];\n}) {\n checkSafeUrl('TutorialPanel', tutorial.learnMoreUrl);\n const controlId = useUniqueId();\n const triggerControldId = useUniqueId();\n const headerId = useUniqueId();\n\n const isRefresh = useVisualRefresh();\n\n const onStartTutorial = useCallback(() => {\n fireNonCancelableEvent(onStartTutorialEventHandler, { tutorial });\n }, [onStartTutorialEventHandler, tutorial]);\n\n const [expanded, setExpanded] = useState(!tutorial.prerequisitesNeeded && !tutorial.completed);\n\n const onClick = useCallback(() => {\n setExpanded(expanded => !expanded);\n }, []);\n\n return (\n <li className={styles['tutorial-box']} role=\"listitem\">\n <InternalSpaceBetween size=\"xs\">\n <div className={styles['tutorial-box-title']}>\n <InternalBox\n variant=\"h3\"\n fontSize={isRefresh ? 'heading-s' : 'heading-m'}\n id={headerId}\n margin={{ right: 'xs' }}\n padding=\"n\"\n className={styles.title}\n >\n {tutorial.title}\n </InternalBox>\n <div className={styles['button-wrapper']}>\n <InternalButton\n id={triggerControldId}\n variant=\"icon\"\n ariaExpanded={expanded}\n __nativeAttributes={{\n 'aria-controls': controlId,\n 'aria-labelledby': headerId,\n }}\n formAction=\"none\"\n onClick={onClick}\n className={expanded ? styles['collapse-button'] : styles['expand-button']}\n iconName={expanded ? 'angle-up' : 'angle-down'}\n />\n </div>\n </div>\n\n {tutorial.completed ? (\n <InternalStatusIndicator __size=\"inherit\" type=\"success\" className={styles.completed} wrapText={true}>\n {i18nStrings.tutorialCompletedText}\n </InternalStatusIndicator>\n ) : null}\n </InternalSpaceBetween>\n\n <div aria-live=\"polite\">\n <CSSTransition in={expanded} timeout={30} classNames={{ enter: styles['content-enter'] }}>\n <div className={clsx(styles['expandable-section'], expanded && styles.expanded)} id={controlId}>\n <InternalSpaceBetween size=\"l\">\n <InternalSpaceBetween size=\"m\">\n {tutorial.prerequisitesNeeded && tutorial.prerequisitesAlert && (\n <InternalAlert type=\"info\" className={styles['prerequisites-alert']}>\n {tutorial.prerequisitesAlert}\n </InternalAlert>\n )}\n <InternalSpaceBetween size=\"s\">\n <InternalBox color=\"text-body-secondary\">\n <div\n className={clsx(\n styles['tutorial-description'],\n typeof tutorial.description === 'string' && styles['tutorial-description-plaintext']\n )}\n >\n {tutorial.description}\n </div>\n </InternalBox>\n {tutorial.learnMoreUrl && (\n <InternalLink\n href={tutorial.learnMoreUrl}\n className={styles['learn-more-link']}\n externalIconAriaLabel={i18nStrings.labelLearnMoreExternalIcon}\n external={true}\n >\n {i18nStrings.learnMoreLinkText}\n </InternalLink>\n )}\n </InternalSpaceBetween>\n </InternalSpaceBetween>\n\n <InternalBox margin={{ bottom: 'xxs' }}>\n <InternalButton\n onClick={onStartTutorial}\n disabled={tutorial.prerequisitesNeeded ?? false}\n formAction=\"none\"\n className={styles.start}\n >\n {tutorial.completed ? i18nStrings.restartTutorialButtonText : i18nStrings.startTutorialButtonText}\n </InternalButton>\n </InternalBox>\n </InternalSpaceBetween>\n </div>\n </CSSTransition>\n </div>\n </li>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/tutorial-panel/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,MAAM,WAAW,kBAAmB,SAAQ,kBAAkB;IAC5D;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyCG;IACH,SAAS,EAAE,aAAa,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;I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C;QAC9B,iBAAiB,EAAE,MAAM,CAAC;QAE1B,uBAAuB,EAAE,MAAM,CAAC;QAChC,yBAAyB,EAAE,MAAM,CAAC;QAElC,qBAAqB,EAAE,MAAM,CAAC;QAE9B,gBAAgB,EAAE,MAAM,CAAC;QACzB,yBAAyB,EAAE,MAAM,CAAC;QAElC,SAAS,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;QAC5D,SAAS,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;QAE5D,iBAAiB,EAAE,MAAM,CAAC;QAC1B,eAAe,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,MAAM,CAAC;QACpD,0BAA0B,EAAE,MAAM,CAAC;QAEnC,gBAAgB,EAAE;YAChB,OAAO,EAAE,MAAM,CAAC;YAChB,aAAa,EAAE,MAAM,CAAC;YACtB,OAAO,EAAE,MAAM,CAAC;SACjB,CAAC;KACH;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/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 /*\n Filtering is not available in the Beta release.\n\n filteringFunction?: (tutorial: TutorialPanelProps.Tutorial, searchTerm: string) => boolean;\n */\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
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/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 /*\n Filtering is not available in the Beta release.\n\n filteringFunction?: (tutorial: TutorialPanelProps.Tutorial, searchTerm: string) => boolean;\n */\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}\n"]}
|
package/wizard/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/wizard/index.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/wizard/index.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAO3C,OAAO,EAAE,WAAW,EAAE,CAAC;AAEvB,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC7B,KAAK,EACL,eAAe,EAAE,yBAAyB,EAC1C,WAAW,EACX,iBAAyB,EACzB,WAAmB,EACnB,gBAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,GAAG,IAAI,EACR,EAAE,WAAW,eA0Fb"}
|
package/wizard/index.js
CHANGED
|
@@ -15,20 +15,18 @@ import { applyDisplayName } from '../internal/utils/apply-display-name';
|
|
|
15
15
|
import useBaseComponent from '../internal/hooks/use-base-component';
|
|
16
16
|
import { useMergeRefs } from '../internal/hooks/use-merge-refs';
|
|
17
17
|
import { useVisualRefresh } from '../internal/hooks/use-visual-mode';
|
|
18
|
-
import { useAnalytics } from '../internal/hooks/use-analytics';
|
|
19
18
|
export default function Wizard(_a) {
|
|
20
|
-
var _b;
|
|
21
|
-
var steps = _a.steps, controlledActiveStepIndex = _a.activeStepIndex, i18nStrings = _a.i18nStrings, _c = _a.isLoadingNextStep, isLoadingNextStep = _c === void 0 ? false : _c, _d = _a.allowSkipTo, allowSkipTo = _d === void 0 ? false : _d, secondaryActions = _a.secondaryActions, onCancel = _a.onCancel, onSubmit = _a.onSubmit, onNavigate = _a.onNavigate, rest = __rest(_a, ["steps", "activeStepIndex", "i18nStrings", "isLoadingNextStep", "allowSkipTo", "secondaryActions", "onCancel", "onSubmit", "onNavigate"]);
|
|
19
|
+
var steps = _a.steps, controlledActiveStepIndex = _a.activeStepIndex, i18nStrings = _a.i18nStrings, _b = _a.isLoadingNextStep, isLoadingNextStep = _b === void 0 ? false : _b, _c = _a.allowSkipTo, allowSkipTo = _c === void 0 ? false : _c, secondaryActions = _a.secondaryActions, onCancel = _a.onCancel, onSubmit = _a.onSubmit, onNavigate = _a.onNavigate, rest = __rest(_a, ["steps", "activeStepIndex", "i18nStrings", "isLoadingNextStep", "allowSkipTo", "secondaryActions", "onCancel", "onSubmit", "onNavigate"]);
|
|
22
20
|
var __internalRootRef = useBaseComponent('Wizard').__internalRootRef;
|
|
23
21
|
var baseProps = getBaseProps(rest);
|
|
24
|
-
var
|
|
22
|
+
var _d = useContainerBreakpoints(['xs']), breakpoint = _d[0], breakpointsRef = _d[1];
|
|
25
23
|
var ref = useMergeRefs(breakpointsRef, __internalRootRef);
|
|
26
24
|
var smallContainer = breakpoint === 'default';
|
|
27
|
-
var
|
|
25
|
+
var _e = useControllable(controlledActiveStepIndex, onNavigate, 0, {
|
|
28
26
|
componentName: 'Wizard',
|
|
29
27
|
controlledProp: 'activeStepIndex',
|
|
30
28
|
changeHandler: 'onNavigate'
|
|
31
|
-
}), activeStepIndex =
|
|
29
|
+
}), activeStepIndex = _e[0], setActiveStepIndex = _e[1];
|
|
32
30
|
var actualActiveStepIndex = activeStepIndex ? Math.min(activeStepIndex, steps.length - 1) : 0;
|
|
33
31
|
var farthestStepIndex = useRef(actualActiveStepIndex);
|
|
34
32
|
farthestStepIndex.current = Math.max(farthestStepIndex.current, actualActiveStepIndex);
|
|
@@ -51,9 +49,7 @@ export default function Wizard(_a) {
|
|
|
51
49
|
if (allowSkipTo && !i18nStrings.skipToButtonLabel) {
|
|
52
50
|
warnOnce('Wizard', "You have set `allowSkipTo` but you have not provided `i18nStrings.skipToButtonLabel`. The skip-to button will not be rendered.");
|
|
53
51
|
}
|
|
54
|
-
|
|
55
|
-
var analyticsProps = analyticsEnabled ? (_b = {}, _b['data-analytics-type'] = 'funnel', _b) : {};
|
|
56
|
-
return (React.createElement("div", __assign({}, analyticsProps, baseProps, { className: clsx(styles.root, baseProps.className), ref: ref }),
|
|
52
|
+
return (React.createElement("div", __assign({}, baseProps, { className: clsx(styles.root, baseProps.className), ref: ref }),
|
|
57
53
|
React.createElement("div", { className: clsx(styles.wizard, isVisualRefresh && styles.refresh, smallContainer && styles['small-container']) },
|
|
58
54
|
React.createElement(WizardNavigation, { activeStepIndex: actualActiveStepIndex, farthestStepIndex: farthestStepIndex.current, allowSkipTo: allowSkipTo, hidden: smallContainer, i18nStrings: i18nStrings, isVisualRefresh: isVisualRefresh, isLoadingNextStep: isLoadingNextStep, onStepClick: onStepClick, onSkipToClick: onSkipToClick, steps: steps }),
|
|
59
55
|
React.createElement("div", { className: clsx(styles.form, isVisualRefresh && styles.refresh, smallContainer && styles['small-container']) },
|
package/wizard/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/wizard/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,gBAAgB,MAAM,qBAAqB,CAAC;AAEnD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/wizard/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAA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oBAAC,UAAU,IACT,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,eAAe,EAChC,kBAAkB,EAAE,cAAc,EAClC,WAAW,EAAE,WAAW,EACxB,eAAe,EAAE,qBAAqB,EACtC,gBAAgB,EAAE,iBAAiB,EACnC,WAAW,EAAE,WAAW,EACxB,gBAAgB,EAAE,gBAAgB,EAClC,aAAa,EAAE,aAAa,EAC5B,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,cAAc,GAC9B,CACE,CACF,CACF,CACP,CAAC;AACJ,CAAC;AAED,gBAAgB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport clsx from 'clsx';\nimport { getBaseProps } from '../internal/base-component';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { warnOnce } from '../internal/logging';\nimport { useContainerBreakpoints } from '../internal/hooks/container-queries';\nimport { useControllable } from '../internal/hooks/use-controllable';\nimport WizardForm from './wizard-form';\nimport WizardNavigation from './wizard-navigation';\nimport { WizardProps } from './interfaces';\nimport styles from './styles.css.js';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\n\nexport { WizardProps };\n\nexport default function Wizard({\n steps,\n activeStepIndex: controlledActiveStepIndex,\n i18nStrings,\n isLoadingNextStep = false,\n allowSkipTo = false,\n secondaryActions,\n onCancel,\n onSubmit,\n onNavigate,\n ...rest\n}: WizardProps) {\n const { __internalRootRef } = useBaseComponent('Wizard');\n const baseProps = getBaseProps(rest);\n\n const [breakpoint, breakpointsRef] = useContainerBreakpoints(['xs']);\n const ref = useMergeRefs(breakpointsRef, __internalRootRef);\n\n const smallContainer = breakpoint === 'default';\n\n const [activeStepIndex, setActiveStepIndex] = useControllable(controlledActiveStepIndex, onNavigate, 0, {\n componentName: 'Wizard',\n controlledProp: 'activeStepIndex',\n changeHandler: 'onNavigate',\n });\n const actualActiveStepIndex = activeStepIndex ? Math.min(activeStepIndex, steps.length - 1) : 0;\n\n const farthestStepIndex = useRef<number>(actualActiveStepIndex);\n farthestStepIndex.current = Math.max(farthestStepIndex.current, actualActiveStepIndex);\n\n const isVisualRefresh = useVisualRefresh();\n const isLastStep = actualActiveStepIndex >= steps.length - 1;\n\n const navigationEvent = (requestedStepIndex: number, reason: WizardProps.NavigationReason) => {\n setActiveStepIndex(requestedStepIndex);\n fireNonCancelableEvent(onNavigate, { requestedStepIndex, reason });\n };\n const onStepClick = (stepIndex: number) => navigationEvent(stepIndex, 'step');\n const onSkipToClick = (stepIndex: number) => navigationEvent(stepIndex, 'skip');\n const onCancelClick = () => fireNonCancelableEvent(onCancel);\n const onPreviousClick = () => navigationEvent(actualActiveStepIndex - 1, 'previous');\n const onPrimaryClick = isLastStep\n ? () => fireNonCancelableEvent(onSubmit)\n : () => navigationEvent(actualActiveStepIndex + 1, 'next');\n\n if (activeStepIndex && activeStepIndex >= steps.length) {\n warnOnce(\n 'Wizard',\n `You have set \\`activeStepIndex\\` to ${activeStepIndex} but you have provided only ${\n steps.length\n } steps. Its value is ignored and the component uses ${steps.length - 1} instead.`\n );\n }\n\n if (allowSkipTo && !i18nStrings.skipToButtonLabel) {\n warnOnce(\n 'Wizard',\n `You have set \\`allowSkipTo\\` but you have not provided \\`i18nStrings.skipToButtonLabel\\`. The skip-to button will not be rendered.`\n );\n }\n\n return (\n <div {...baseProps} className={clsx(styles.root, baseProps.className)} ref={ref}>\n <div\n className={clsx(styles.wizard, isVisualRefresh && styles.refresh, smallContainer && styles['small-container'])}\n >\n <WizardNavigation\n activeStepIndex={actualActiveStepIndex}\n farthestStepIndex={farthestStepIndex.current}\n allowSkipTo={allowSkipTo}\n hidden={smallContainer}\n i18nStrings={i18nStrings}\n isVisualRefresh={isVisualRefresh}\n isLoadingNextStep={isLoadingNextStep}\n onStepClick={onStepClick}\n onSkipToClick={onSkipToClick}\n steps={steps}\n />\n <div\n className={clsx(styles.form, isVisualRefresh && styles.refresh, smallContainer && styles['small-container'])}\n >\n {isVisualRefresh && <div className={clsx(styles.background, 'awsui-context-content-header')} />}\n\n <WizardForm\n steps={steps}\n isVisualRefresh={isVisualRefresh}\n showCollapsedSteps={smallContainer}\n i18nStrings={i18nStrings}\n activeStepIndex={actualActiveStepIndex}\n isPrimaryLoading={isLoadingNextStep}\n allowSkipTo={allowSkipTo}\n secondaryActions={secondaryActions}\n onCancelClick={onCancelClick}\n onPreviousClick={onPreviousClick}\n onSkipToClick={onSkipToClick}\n onPrimaryClick={onPrimaryClick}\n />\n </div>\n </div>\n </div>\n );\n}\n\napplyDisplayName(Wizard, 'Wizard');\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wizard-form.d.ts","sourceRoot":"","sources":["../../../src/wizard/wizard-form.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAMtC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"wizard-form.d.ts","sourceRoot":"","sources":["../../../src/wizard/wizard-form.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAMtC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAM3C,UAAU,eAAe;IACvB,KAAK,EAAE,aAAa,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IACvC,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,OAAO,CAAC;IACzB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,WAAW,EAAE,WAAW,CAAC,WAAW,CAAC;IACrC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,WAAW,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACnC,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,aAAa,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5C;AAED,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,KAAK,EACL,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,cAAc,EACd,aAAa,GACd,EAAE,eAAe,eAiEjB"}
|
package/wizard/wizard-form.js
CHANGED
|
@@ -11,11 +11,9 @@ import WizardFormHeader from './wizard-form-header';
|
|
|
11
11
|
import styles from './styles.css.js';
|
|
12
12
|
import useFocusVisible from '../internal/hooks/focus-visible';
|
|
13
13
|
import { useEffectOnUpdate } from '../internal/hooks/use-effect-on-update';
|
|
14
|
-
import { useAnalytics } from '../internal/hooks/use-analytics';
|
|
15
14
|
export default function WizardForm(_a) {
|
|
16
|
-
var _b;
|
|
17
15
|
var steps = _a.steps, activeStepIndex = _a.activeStepIndex, isVisualRefresh = _a.isVisualRefresh, showCollapsedSteps = _a.showCollapsedSteps, i18nStrings = _a.i18nStrings, isPrimaryLoading = _a.isPrimaryLoading, allowSkipTo = _a.allowSkipTo, secondaryActions = _a.secondaryActions, onCancelClick = _a.onCancelClick, onPreviousClick = _a.onPreviousClick, onPrimaryClick = _a.onPrimaryClick, onSkipToClick = _a.onSkipToClick;
|
|
18
|
-
var
|
|
16
|
+
var _b = steps[activeStepIndex] || {}, title = _b.title, info = _b.info, description = _b.description, content = _b.content, errorText = _b.errorText, isOptional = _b.isOptional;
|
|
19
17
|
var isLastStep = activeStepIndex >= steps.length - 1;
|
|
20
18
|
var skipToTargetIndex = findSkipToTargetIndex(steps, activeStepIndex);
|
|
21
19
|
var isMobile = useMobile();
|
|
@@ -31,8 +29,6 @@ export default function WizardForm(_a) {
|
|
|
31
29
|
var skipToButtonText = skipToTargetIndex !== -1 && i18nStrings.skipToButtonLabel
|
|
32
30
|
? i18nStrings.skipToButtonLabel(steps[skipToTargetIndex], skipToTargetIndex + 1)
|
|
33
31
|
: undefined;
|
|
34
|
-
var analyticsEnabled = useAnalytics();
|
|
35
|
-
var analyticsProps = analyticsEnabled ? (_b = {}, _b['data-analytics'] = title, _b['data-analytics-type'] = 'eventContext', _b) : {};
|
|
36
32
|
return (React.createElement(React.Fragment, null,
|
|
37
33
|
React.createElement(WizardFormHeader, { isMobile: isMobile || showCollapsedSteps, isVisualRefresh: isVisualRefresh },
|
|
38
34
|
React.createElement("div", { className: clsx(styles['collapsed-steps'], !showCollapsedSteps && styles['collapsed-steps-hidden'], isVisualRefresh && isMobile && styles['collapsed-steps-extra-padding']) }, i18nStrings.collapsedStepsLabel(activeStepIndex + 1, steps.length)),
|
|
@@ -40,8 +36,7 @@ export default function WizardForm(_a) {
|
|
|
40
36
|
React.createElement("span", __assign({ className: styles['form-header-component-wrapper'], tabIndex: -1, ref: stepHeaderRef }, focusVisible),
|
|
41
37
|
title,
|
|
42
38
|
isOptional && React.createElement("i", null, " - ".concat(i18nStrings.optional))))),
|
|
43
|
-
React.createElement(InternalForm, { className: clsx(styles['form-component']), actions: React.createElement(WizardActions, { cancelButtonText: i18nStrings.cancelButton, primaryButtonText: isLastStep ? i18nStrings.submitButton : i18nStrings.nextButton, previousButtonText: i18nStrings.previousButton, onCancelClick: onCancelClick, onPreviousClick: onPreviousClick, onPrimaryClick: onPrimaryClick, onSkipToClick: function () { return onSkipToClick(skipToTargetIndex); }, showPrevious: activeStepIndex !== 0, isPrimaryLoading: isPrimaryLoading, showSkipTo: showSkipTo, skipToButtonText: skipToButtonText }), secondaryActions: secondaryActions, errorText: errorText, errorIconAriaLabel: i18nStrings.errorIconAriaLabel },
|
|
44
|
-
React.createElement("div", __assign({}, analyticsProps), content))));
|
|
39
|
+
React.createElement(InternalForm, { className: clsx(styles['form-component']), actions: React.createElement(WizardActions, { cancelButtonText: i18nStrings.cancelButton, primaryButtonText: isLastStep ? i18nStrings.submitButton : i18nStrings.nextButton, previousButtonText: i18nStrings.previousButton, onCancelClick: onCancelClick, onPreviousClick: onPreviousClick, onPrimaryClick: onPrimaryClick, onSkipToClick: function () { return onSkipToClick(skipToTargetIndex); }, showPrevious: activeStepIndex !== 0, isPrimaryLoading: isPrimaryLoading, showSkipTo: showSkipTo, skipToButtonText: skipToButtonText }), secondaryActions: secondaryActions, errorText: errorText, errorIconAriaLabel: i18nStrings.errorIconAriaLabel }, content)));
|
|
45
40
|
}
|
|
46
41
|
function findSkipToTargetIndex(steps, activeStepIndex) {
|
|
47
42
|
var nextRequiredStepIndex = activeStepIndex;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wizard-form.js","sourceRoot":"","sources":["../../../src/wizard/wizard-form.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,cAAc,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAE7C,OAAO,gBAAgB,MAAM,sBAAsB,CAAC;AACpD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"wizard-form.js","sourceRoot":"","sources":["../../../src/wizard/wizard-form.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,O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,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC,WAAW,CAAC,UAAU,EACjF,kBAAkB,EAAE,WAAW,CAAC,cAAc,EAC9C,aAAa,EAAE,aAAa,EAC5B,eAAe,EAAE,eAAe,EAChC,cAAc,EAAE,cAAc,EAC9B,aAAa,EAAE,cAAM,OAAA,aAAa,CAAC,iBAAiB,CAAC,EAAhC,CAAgC,EACrD,YAAY,EAAE,eAAe,KAAK,CAAC,EACnC,gBAAgB,EAAE,gBAAgB,EAClC,UAAU,EAAE,UAAU,EACtB,gBAAgB,EAAE,gBAAgB,GAClC,EAEJ,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,SAAS,EACpB,kBAAkB,EAAE,WAAW,CAAC,kBAAkB,IAEjD,OAAO,CACK,CACd,CACJ,CAAC;AACJ,CAAC;AAED,SAAS,qBAAqB,CAAC,KAAsC,EAAE,eAAuB;IAC5F,IAAI,qBAAqB,GAAG,eAAe,CAAC;IAC5C,GAAG;QACD,qBAAqB,EAAE,CAAC;KACzB,QAAQ,qBAAqB,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC,UAAU,EAAE;IAE9F,OAAO,qBAAqB,GAAG,eAAe,GAAG,CAAC,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClF,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport clsx from 'clsx';\nimport InternalForm from '../form/internal';\nimport InternalHeader from '../header/internal';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport WizardActions from './wizard-actions';\nimport { WizardProps } from './interfaces';\nimport WizardFormHeader from './wizard-form-header';\nimport styles from './styles.css.js';\nimport useFocusVisible from '../internal/hooks/focus-visible';\nimport { useEffectOnUpdate } from '../internal/hooks/use-effect-on-update';\n\ninterface WizardFormProps {\n steps: ReadonlyArray<WizardProps.Step>;\n activeStepIndex: number;\n isVisualRefresh: boolean;\n showCollapsedSteps: boolean;\n i18nStrings: WizardProps.I18nStrings;\n isPrimaryLoading: boolean;\n allowSkipTo: boolean;\n secondaryActions?: React.ReactNode;\n onCancelClick: () => void;\n onPreviousClick: () => void;\n onPrimaryClick: () => void;\n onSkipToClick: (stepIndex: number) => void;\n}\n\nexport default function WizardForm({\n steps,\n activeStepIndex,\n isVisualRefresh,\n showCollapsedSteps,\n i18nStrings,\n isPrimaryLoading,\n allowSkipTo,\n secondaryActions,\n onCancelClick,\n onPreviousClick,\n onPrimaryClick,\n onSkipToClick,\n}: WizardFormProps) {\n const { title, info, description, content, errorText, isOptional } = steps[activeStepIndex] || {};\n const isLastStep = activeStepIndex >= steps.length - 1;\n const skipToTargetIndex = findSkipToTargetIndex(steps, activeStepIndex);\n const isMobile = useMobile();\n const stepHeaderRef = useRef<HTMLDivElement | null>(null);\n\n useEffectOnUpdate(() => {\n if (stepHeaderRef && stepHeaderRef.current) {\n stepHeaderRef.current?.focus();\n }\n }, [activeStepIndex]);\n\n const focusVisible = useFocusVisible();\n\n const showSkipTo = allowSkipTo && skipToTargetIndex !== -1;\n const skipToButtonText =\n skipToTargetIndex !== -1 && i18nStrings.skipToButtonLabel\n ? i18nStrings.skipToButtonLabel(steps[skipToTargetIndex], skipToTargetIndex + 1)\n : undefined;\n\n return (\n <>\n <WizardFormHeader isMobile={isMobile || showCollapsedSteps} isVisualRefresh={isVisualRefresh}>\n <div\n className={clsx(\n styles['collapsed-steps'],\n !showCollapsedSteps && styles['collapsed-steps-hidden'],\n isVisualRefresh && isMobile && styles['collapsed-steps-extra-padding']\n )}\n >\n {i18nStrings.collapsedStepsLabel(activeStepIndex + 1, steps.length)}\n </div>\n <InternalHeader className={styles['form-header-component']} variant=\"h1\" description={description} info={info}>\n <span className={styles['form-header-component-wrapper']} tabIndex={-1} ref={stepHeaderRef} {...focusVisible}>\n {title}\n {isOptional && <i>{` - ${i18nStrings.optional}`}</i>}\n </span>\n </InternalHeader>\n </WizardFormHeader>\n <InternalForm\n className={clsx(styles['form-component'])}\n actions={\n <WizardActions\n cancelButtonText={i18nStrings.cancelButton}\n primaryButtonText={isLastStep ? i18nStrings.submitButton : i18nStrings.nextButton}\n previousButtonText={i18nStrings.previousButton}\n onCancelClick={onCancelClick}\n onPreviousClick={onPreviousClick}\n onPrimaryClick={onPrimaryClick}\n onSkipToClick={() => onSkipToClick(skipToTargetIndex)}\n showPrevious={activeStepIndex !== 0}\n isPrimaryLoading={isPrimaryLoading}\n showSkipTo={showSkipTo}\n skipToButtonText={skipToButtonText}\n />\n }\n secondaryActions={secondaryActions}\n errorText={errorText}\n errorIconAriaLabel={i18nStrings.errorIconAriaLabel}\n >\n {content}\n </InternalForm>\n </>\n );\n}\n\nfunction findSkipToTargetIndex(steps: ReadonlyArray<WizardProps.Step>, activeStepIndex: number): number {\n let nextRequiredStepIndex = activeStepIndex;\n do {\n nextRequiredStepIndex++;\n } while (nextRequiredStepIndex < steps.length - 1 && steps[nextRequiredStepIndex].isOptional);\n\n return nextRequiredStepIndex > activeStepIndex + 1 ? nextRequiredStepIndex : -1;\n}\n"]}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { DateRangePickerProps } from '../interfaces';
|
|
2
|
-
export declare function findDateToFocus(selected: Date | null, baseDate: Date, isDateEnabled: DateRangePickerProps.IsDateEnabledFunction): Date | null;
|
|
3
|
-
export declare function findMonthToDisplay(value: DateRangePickerProps.PendingAbsoluteValue, isSingleGrid: boolean): Date;
|
|
4
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/date-range-picker/calendar/utils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAGrD,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,IAAI,GAAG,IAAI,EACrB,QAAQ,EAAE,IAAI,EACd,aAAa,EAAE,oBAAoB,CAAC,qBAAqB,eAa1D;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,oBAAoB,CAAC,oBAAoB,EAAE,YAAY,EAAE,OAAO,QAYzG"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import { addMonths, isSameMonth, startOfMonth } from 'date-fns';
|
|
4
|
-
import { parseDate } from '../../internal/utils/date-time';
|
|
5
|
-
export function findDateToFocus(selected, baseDate, isDateEnabled) {
|
|
6
|
-
if (selected && isDateEnabled(selected) && isSameMonth(selected, baseDate)) {
|
|
7
|
-
return selected;
|
|
8
|
-
}
|
|
9
|
-
var today = new Date();
|
|
10
|
-
if (isDateEnabled(today) && isSameMonth(today, baseDate)) {
|
|
11
|
-
return today;
|
|
12
|
-
}
|
|
13
|
-
if (isDateEnabled(baseDate)) {
|
|
14
|
-
return baseDate;
|
|
15
|
-
}
|
|
16
|
-
return null;
|
|
17
|
-
}
|
|
18
|
-
export function findMonthToDisplay(value, isSingleGrid) {
|
|
19
|
-
if (value.start.date) {
|
|
20
|
-
var startDate = parseDate(value.start.date);
|
|
21
|
-
if (isSingleGrid) {
|
|
22
|
-
return startOfMonth(startDate);
|
|
23
|
-
}
|
|
24
|
-
return startOfMonth(addMonths(startDate, 1));
|
|
25
|
-
}
|
|
26
|
-
if (value.end.date) {
|
|
27
|
-
return startOfMonth(parseDate(value.end.date));
|
|
28
|
-
}
|
|
29
|
-
return startOfMonth(Date.now());
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/date-range-picker/calendar/utils.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAEhE,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE3D,MAAM,UAAU,eAAe,CAC7B,QAAqB,EACrB,QAAc,EACd,aAAyD;IAEzD,IAAI,QAAQ,IAAI,aAAa,CAAC,QAAQ,CAAC,IAAI,WAAW,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE;QAC1E,OAAO,QAAQ,CAAC;KACjB;IACD,IAAM,KAAK,GAAG,IAAI,IAAI,EAAE,CAAC;IACzB,IAAI,aAAa,CAAC,KAAK,CAAC,IAAI,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,EAAE;QACxD,OAAO,KAAK,CAAC;KACd;IACD,IAAI,aAAa,CAAC,QAAQ,CAAC,EAAE;QAC3B,OAAO,QAAQ,CAAC;KACjB;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,KAAgD,EAAE,YAAqB;IACxG,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE;QACpB,IAAM,SAAS,GAAG,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC9C,IAAI,YAAY,EAAE;YAChB,OAAO,YAAY,CAAC,SAAS,CAAC,CAAC;SAChC;QACD,OAAO,YAAY,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;KAC9C;IACD,IAAI,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE;QAClB,OAAO,YAAY,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;KAChD;IACD,OAAO,YAAY,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;AAClC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { addMonths, isSameMonth, startOfMonth } from 'date-fns';\nimport { DateRangePickerProps } from '../interfaces';\nimport { parseDate } from '../../internal/utils/date-time';\n\nexport function findDateToFocus(\n selected: Date | null,\n baseDate: Date,\n isDateEnabled: DateRangePickerProps.IsDateEnabledFunction\n) {\n if (selected && isDateEnabled(selected) && isSameMonth(selected, baseDate)) {\n return selected;\n }\n const today = new Date();\n if (isDateEnabled(today) && isSameMonth(today, baseDate)) {\n return today;\n }\n if (isDateEnabled(baseDate)) {\n return baseDate;\n }\n return null;\n}\n\nexport function findMonthToDisplay(value: DateRangePickerProps.PendingAbsoluteValue, isSingleGrid: boolean) {\n if (value.start.date) {\n const startDate = parseDate(value.start.date);\n if (isSingleGrid) {\n return startOfMonth(startDate);\n }\n return startOfMonth(addMonths(startDate, 1));\n }\n if (value.end.date) {\n return startOfMonth(parseDate(value.end.date));\n }\n return startOfMonth(Date.now());\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/hooks/use-analytics/index.ts"],"names":[],"mappings":"AAMA,wBAAgB,YAAY,YAU3B"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
// We expect analytics to be set only once and before the application is rendered.
|
|
4
|
-
var analyticsEnabled = undefined;
|
|
5
|
-
export function useAnalytics() {
|
|
6
|
-
if (analyticsEnabled === undefined) {
|
|
7
|
-
if (typeof window === 'undefined' || typeof document === 'undefined') {
|
|
8
|
-
analyticsEnabled = false;
|
|
9
|
-
}
|
|
10
|
-
else {
|
|
11
|
-
analyticsEnabled = !!document.querySelector('.awsui-analytics-enabled');
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
return analyticsEnabled;
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/hooks/use-analytics/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,kFAAkF;AAClF,IAAI,gBAAgB,GAAwB,SAAS,CAAC;AAEtD,MAAM,UAAU,YAAY;IAC1B,IAAI,gBAAgB,KAAK,SAAS,EAAE;QAClC,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE;YACpE,gBAAgB,GAAG,KAAK,CAAC;SAC1B;aAAM;YACL,gBAAgB,GAAG,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,0BAA0B,CAAC,CAAC;SACzE;KACF;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\n// We expect analytics to be set only once and before the application is rendered.\nlet analyticsEnabled: boolean | undefined = undefined;\n\nexport function useAnalytics() {\n if (analyticsEnabled === undefined) {\n if (typeof window === 'undefined' || typeof document === 'undefined') {\n analyticsEnabled = false;\n } else {\n analyticsEnabled = !!document.querySelector('.awsui-analytics-enabled');\n }\n }\n\n return analyticsEnabled;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"format-date-time.d.ts","sourceRoot":"","sources":["../../../../../src/internal/utils/date-time/format-date-time.ts"],"names":[],"mappings":"AAKA,wBAAgB,cAAc,CAAC,IAAI,EAAE,IAAI,UAExC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import { formatDate } from './format-date';
|
|
4
|
-
import { formatTime } from './format-time';
|
|
5
|
-
export function formatDateTime(date) {
|
|
6
|
-
return formatDate(date) + 'T' + formatTime(date);
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=format-date-time.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"format-date-time.js","sourceRoot":"","sources":["../../../../../src/internal/utils/date-time/format-date-time.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,MAAM,UAAU,cAAc,CAAC,IAAU;IACvC,OAAO,UAAU,CAAC,IAAI,CAAC,GAAG,GAAG,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;AACnD,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { formatDate } from './format-date';\nimport { formatTime } from './format-time';\n\nexport function formatDateTime(date: Date) {\n return formatDate(date) + 'T' + formatTime(date);\n}\n"]}
|