@cloudscape-design/components 3.0.116 → 3.0.118

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.
Files changed (113) hide show
  1. package/area-chart/model/use-chart-model.d.ts.map +1 -1
  2. package/area-chart/model/use-chart-model.js +2 -1
  3. package/area-chart/model/use-chart-model.js.map +1 -1
  4. package/area-chart/model/utils.d.ts +0 -6
  5. package/area-chart/model/utils.d.ts.map +1 -1
  6. package/area-chart/model/utils.js +0 -52
  7. package/area-chart/model/utils.js.map +1 -1
  8. package/button/index.d.ts.map +1 -1
  9. package/button/index.js +2 -2
  10. package/button/index.js.map +1 -1
  11. package/button/interfaces.d.ts +4 -0
  12. package/button/interfaces.d.ts.map +1 -1
  13. package/button/interfaces.js.map +1 -1
  14. package/button/internal.d.ts.map +1 -1
  15. package/button/internal.js +10 -5
  16. package/button/internal.js.map +1 -1
  17. package/button-dropdown/index.d.ts.map +1 -1
  18. package/button-dropdown/index.js +2 -2
  19. package/button-dropdown/index.js.map +1 -1
  20. package/button-dropdown/interfaces.d.ts +4 -0
  21. package/button-dropdown/interfaces.d.ts.map +1 -1
  22. package/button-dropdown/interfaces.js.map +1 -1
  23. package/button-dropdown/internal.d.ts.map +1 -1
  24. package/button-dropdown/internal.js +2 -2
  25. package/button-dropdown/internal.js.map +1 -1
  26. package/cards/index.d.ts.map +1 -1
  27. package/cards/index.js +3 -1
  28. package/cards/index.js.map +1 -1
  29. package/code-editor/index.d.ts.map +1 -1
  30. package/code-editor/index.js +3 -1
  31. package/code-editor/index.js.map +1 -1
  32. package/expandable-section/expandable-section-header.d.ts +12 -4
  33. package/expandable-section/expandable-section-header.d.ts.map +1 -1
  34. package/expandable-section/expandable-section-header.js +51 -11
  35. package/expandable-section/expandable-section-header.js.map +1 -1
  36. package/expandable-section/interfaces.d.ts +21 -3
  37. package/expandable-section/interfaces.d.ts.map +1 -1
  38. package/expandable-section/interfaces.js.map +1 -1
  39. package/expandable-section/internal.d.ts +1 -1
  40. package/expandable-section/internal.d.ts.map +1 -1
  41. package/expandable-section/internal.js +2 -2
  42. package/expandable-section/internal.js.map +1 -1
  43. package/expandable-section/styles.css.js +21 -20
  44. package/expandable-section/styles.scoped.css +56 -39
  45. package/expandable-section/styles.selectors.js +21 -20
  46. package/flashbar/flash.d.ts +3 -3
  47. package/flashbar/flash.d.ts.map +1 -1
  48. package/flashbar/flash.js +31 -15
  49. package/flashbar/flash.js.map +1 -1
  50. package/flashbar/index.d.ts.map +1 -1
  51. package/flashbar/index.js +61 -14
  52. package/flashbar/index.js.map +1 -1
  53. package/flashbar/interfaces.d.ts +16 -0
  54. package/flashbar/interfaces.d.ts.map +1 -1
  55. package/flashbar/interfaces.js.map +1 -1
  56. package/flashbar/styles.css.js +33 -29
  57. package/flashbar/styles.scoped.css +151 -112
  58. package/flashbar/styles.selectors.js +33 -29
  59. package/help-panel/index.d.ts.map +1 -1
  60. package/help-panel/index.js +3 -1
  61. package/help-panel/index.js.map +1 -1
  62. package/internal/components/chart-status-container/index.d.ts +2 -2
  63. package/internal/components/chart-status-container/index.d.ts.map +1 -1
  64. package/internal/components/chart-status-container/index.js +2 -3
  65. package/internal/components/chart-status-container/index.js.map +1 -1
  66. package/internal/components/live-region/index.d.ts +2 -1
  67. package/internal/components/live-region/index.d.ts.map +1 -1
  68. package/internal/components/live-region/index.js +6 -5
  69. package/internal/components/live-region/index.js.map +1 -1
  70. package/internal/environment.js +1 -1
  71. package/internal/manifest.json +1 -1
  72. package/internal/utils/throttle.d.ts +10 -0
  73. package/internal/utils/throttle.d.ts.map +1 -0
  74. package/internal/utils/throttle.js +57 -0
  75. package/internal/utils/throttle.js.map +1 -0
  76. package/package.json +1 -1
  77. package/s3-resource-selector/s3-in-context/index.d.ts.map +1 -1
  78. package/s3-resource-selector/s3-in-context/index.js +3 -1
  79. package/s3-resource-selector/s3-in-context/index.js.map +1 -1
  80. package/side-navigation/internal.js +2 -2
  81. package/side-navigation/internal.js.map +1 -1
  82. package/table/internal.d.ts.map +1 -1
  83. package/table/internal.js +3 -1
  84. package/table/internal.js.map +1 -1
  85. package/tag-editor/index.d.ts.map +1 -1
  86. package/tag-editor/index.js +3 -1
  87. package/tag-editor/index.js.map +1 -1
  88. package/test-utils/dom/flashbar/flash.js +1 -1
  89. package/test-utils/dom/flashbar/flash.js.map +1 -1
  90. package/test-utils/dom/flashbar/index.js +1 -1
  91. package/test-utils/dom/flashbar/index.js.map +1 -1
  92. package/test-utils/selectors/flashbar/flash.js +1 -1
  93. package/test-utils/selectors/flashbar/flash.js.map +1 -1
  94. package/test-utils/selectors/flashbar/index.js +1 -1
  95. package/test-utils/selectors/flashbar/index.js.map +1 -1
  96. package/test-utils/tsconfig.tsbuildinfo +1 -1
  97. package/tiles/styles.css.js +28 -28
  98. package/tiles/styles.scoped.css +69 -68
  99. package/tiles/styles.selectors.js +28 -28
  100. package/tutorial-panel/components/tutorial-detail-view/task.js +1 -1
  101. package/tutorial-panel/components/tutorial-detail-view/task.js.map +1 -1
  102. package/tutorial-panel/components/tutorial-list/index.d.ts.map +1 -1
  103. package/tutorial-panel/components/tutorial-list/index.js +3 -1
  104. package/tutorial-panel/components/tutorial-list/index.js.map +1 -1
  105. package/wizard/index.d.ts.map +1 -1
  106. package/wizard/index.js +2 -20
  107. package/wizard/index.js.map +1 -1
  108. package/wizard/styles.css.js +32 -31
  109. package/wizard/styles.scoped.css +71 -59
  110. package/wizard/styles.selectors.js +32 -31
  111. package/wizard/wizard-form.d.ts.map +1 -1
  112. package/wizard/wizard-form.js +15 -3
  113. package/wizard/wizard-form.js.map +1 -1
@@ -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,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OA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AC5F,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 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';\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\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 {title}\n {isOptional && <i>{` - ${i18nStrings.optional}`}</i>}\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
+ {"version":3,"file":"wizard-form.js","sourceRoot":"","sources":["../../../src/wizard/wizard-form.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KA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gBAAgB,EAAE,WAAW,CAAC,YAAY,EAC1C,iBAAiB,EAAE,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"]}