@cloudscape-design/components 3.0.234 → 3.0.236

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 (134) hide show
  1. package/app-layout/drawer/index.d.ts +2 -5
  2. package/app-layout/drawer/index.d.ts.map +1 -1
  3. package/app-layout/drawer/index.js.map +1 -1
  4. package/app-layout/index.d.ts.map +1 -1
  5. package/app-layout/index.js +20 -15
  6. package/app-layout/index.js.map +1 -1
  7. package/app-layout/utils/use-focus-control.d.ts +8 -6
  8. package/app-layout/utils/use-focus-control.d.ts.map +1 -1
  9. package/app-layout/utils/use-focus-control.js +21 -10
  10. package/app-layout/utils/use-focus-control.js.map +1 -1
  11. package/app-layout/utils/use-split-panel-focus-control.d.ts +21 -0
  12. package/app-layout/utils/use-split-panel-focus-control.d.ts.map +1 -0
  13. package/app-layout/utils/use-split-panel-focus-control.js +32 -0
  14. package/app-layout/utils/use-split-panel-focus-control.js.map +1 -0
  15. package/app-layout/visual-refresh/app-bar.d.ts.map +1 -1
  16. package/app-layout/visual-refresh/app-bar.js +3 -6
  17. package/app-layout/visual-refresh/app-bar.js.map +1 -1
  18. package/app-layout/visual-refresh/context.d.ts +6 -2
  19. package/app-layout/visual-refresh/context.d.ts.map +1 -1
  20. package/app-layout/visual-refresh/context.js +24 -11
  21. package/app-layout/visual-refresh/context.js.map +1 -1
  22. package/app-layout/visual-refresh/navigation.d.ts.map +1 -1
  23. package/app-layout/visual-refresh/navigation.js +3 -5
  24. package/app-layout/visual-refresh/navigation.js.map +1 -1
  25. package/app-layout/visual-refresh/split-panel.d.ts.map +1 -1
  26. package/app-layout/visual-refresh/split-panel.js +4 -8
  27. package/app-layout/visual-refresh/split-panel.js.map +1 -1
  28. package/app-layout/visual-refresh/tools.js +5 -6
  29. package/app-layout/visual-refresh/tools.js.map +1 -1
  30. package/autosuggest/internal.d.ts.map +1 -1
  31. package/autosuggest/internal.js +10 -4
  32. package/autosuggest/internal.js.map +1 -1
  33. package/breadcrumb-group/internal.d.ts.map +1 -1
  34. package/breadcrumb-group/internal.js +2 -2
  35. package/breadcrumb-group/internal.js.map +1 -1
  36. package/breadcrumb-group/styles.css.js +7 -6
  37. package/breadcrumb-group/styles.scoped.css +14 -11
  38. package/breadcrumb-group/styles.selectors.js +7 -6
  39. package/calendar/grid/index.d.ts +1 -1
  40. package/calendar/grid/index.d.ts.map +1 -1
  41. package/calendar/grid/index.js.map +1 -1
  42. package/calendar/header/header-button.d.ts +1 -1
  43. package/calendar/header/header-button.d.ts.map +1 -1
  44. package/calendar/header/header-button.js.map +1 -1
  45. package/calendar/header/index.d.ts +2 -2
  46. package/calendar/header/index.d.ts.map +1 -1
  47. package/calendar/header/index.js.map +1 -1
  48. package/calendar/interfaces.d.ts +3 -3
  49. package/calendar/interfaces.d.ts.map +1 -1
  50. package/calendar/interfaces.js.map +1 -1
  51. package/calendar/internal.d.ts +1 -1
  52. package/calendar/internal.d.ts.map +1 -1
  53. package/calendar/internal.js +6 -1
  54. package/calendar/internal.js.map +1 -1
  55. package/date-picker/index.d.ts.map +1 -1
  56. package/date-picker/index.js +6 -4
  57. package/date-picker/index.js.map +1 -1
  58. package/internal/context/split-panel-context.d.ts +2 -8
  59. package/internal/context/split-panel-context.d.ts.map +1 -1
  60. package/internal/context/split-panel-context.js.map +1 -1
  61. package/internal/environment.js +1 -1
  62. package/internal/i18n/context.d.ts +6 -1
  63. package/internal/i18n/context.d.ts.map +1 -1
  64. package/internal/i18n/context.js +7 -7
  65. package/internal/i18n/context.js.map +1 -1
  66. package/internal/i18n/messages/all.all.js +219 -210
  67. package/internal/i18n/messages/all.all.json +231 -231
  68. package/internal/i18n/messages/all.de.js +20 -20
  69. package/internal/i18n/messages/all.de.json +20 -20
  70. package/internal/i18n/messages/all.en-GB.js +20 -20
  71. package/internal/i18n/messages/all.en-GB.json +20 -20
  72. package/internal/i18n/messages/all.en.js +20 -20
  73. package/internal/i18n/messages/all.en.json +20 -20
  74. package/internal/i18n/messages/all.es.js +20 -20
  75. package/internal/i18n/messages/all.es.json +20 -20
  76. package/internal/i18n/messages/all.fr.js +20 -20
  77. package/internal/i18n/messages/all.fr.json +20 -20
  78. package/internal/i18n/messages/all.id.js +20 -20
  79. package/internal/i18n/messages/all.id.json +20 -20
  80. package/internal/i18n/messages/all.it.js +20 -20
  81. package/internal/i18n/messages/all.it.json +20 -20
  82. package/internal/i18n/messages/all.ja.js +20 -20
  83. package/internal/i18n/messages/all.ja.json +20 -20
  84. package/internal/i18n/messages/all.ko.js +22 -19
  85. package/internal/i18n/messages/all.ko.json +20 -20
  86. package/internal/i18n/messages/all.pt-BR.js +20 -20
  87. package/internal/i18n/messages/all.pt-BR.json +20 -20
  88. package/internal/i18n/messages/all.zh-CN.js +24 -21
  89. package/internal/i18n/messages/all.zh-CN.json +22 -22
  90. package/internal/i18n/messages/all.zh-TW.js +23 -20
  91. package/internal/i18n/messages/all.zh-TW.json +21 -21
  92. package/internal/i18n/provider.d.ts.map +1 -1
  93. package/internal/i18n/provider.js +20 -5
  94. package/internal/i18n/provider.js.map +1 -1
  95. package/internal/manifest.json +1 -1
  96. package/package.json +1 -1
  97. package/property-filter/index.js.map +1 -1
  98. package/select/parts/styles.css.js +9 -9
  99. package/select/parts/styles.scoped.css +9 -27
  100. package/select/parts/styles.selectors.js +9 -9
  101. package/split-panel/index.d.ts.map +1 -1
  102. package/split-panel/index.js +6 -24
  103. package/split-panel/index.js.map +1 -1
  104. package/table/body-cell/use-stable-scroll-position.d.ts.map +1 -1
  105. package/table/body-cell/use-stable-scroll-position.js +10 -4
  106. package/table/body-cell/use-stable-scroll-position.js.map +1 -1
  107. package/table/header-cell/index.js +2 -3
  108. package/table/header-cell/index.js.map +1 -1
  109. package/table/use-table-focus-navigation.d.ts +1 -1
  110. package/table/use-table-focus-navigation.d.ts.map +1 -1
  111. package/table/use-table-focus-navigation.js +4 -4
  112. package/table/use-table-focus-navigation.js.map +1 -1
  113. package/tutorial-panel/components/tutorial-list/index.d.ts +0 -1
  114. package/tutorial-panel/components/tutorial-list/index.d.ts.map +1 -1
  115. package/tutorial-panel/components/tutorial-list/index.js +3 -15
  116. package/tutorial-panel/components/tutorial-list/index.js.map +1 -1
  117. package/tutorial-panel/index.d.ts.map +1 -1
  118. package/tutorial-panel/index.js +2 -14
  119. package/tutorial-panel/index.js.map +1 -1
  120. package/tutorial-panel/interfaces.d.ts +1 -1
  121. package/tutorial-panel/interfaces.d.ts.map +1 -1
  122. package/tutorial-panel/interfaces.js.map +1 -1
  123. package/wizard/index.d.ts +1 -1
  124. package/wizard/index.d.ts.map +1 -1
  125. package/wizard/index.js +4 -1
  126. package/wizard/index.js.map +1 -1
  127. package/wizard/interfaces.d.ts +5 -5
  128. package/wizard/interfaces.d.ts.map +1 -1
  129. package/wizard/interfaces.js.map +1 -1
  130. package/wizard/wizard-actions.d.ts +3 -3
  131. package/wizard/wizard-actions.d.ts.map +1 -1
  132. package/wizard/wizard-actions.js.map +1 -1
  133. package/wizard/wizard-form.js +2 -1
  134. 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,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;AAiB3E,MAAM,CAAC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J,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
+ {"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;AAiB3E,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,GACG;;IAChB,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC;IAClG,MAAM,UAAU,GAAG,eAAe,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;IACvD,MAAM,iBAAiB,GAAG,qBAAqB,CA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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"]}