@cloudscape-design/components-themeable 3.0.959 → 3.0.960

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 (41) hide show
  1. package/lib/internal/manifest.json +1 -1
  2. package/lib/internal/scss/copy-to-clipboard/test-classes/styles.scss +3 -0
  3. package/lib/internal/template/annotation-context/annotation/annotation-popover.d.ts.map +1 -1
  4. package/lib/internal/template/annotation-context/annotation/annotation-popover.js +1 -1
  5. package/lib/internal/template/annotation-context/annotation/annotation-popover.js.map +1 -1
  6. package/lib/internal/template/annotation-context/annotation/open-annotation.d.ts.map +1 -1
  7. package/lib/internal/template/annotation-context/annotation/open-annotation.js +3 -1
  8. package/lib/internal/template/annotation-context/annotation/open-annotation.js.map +1 -1
  9. package/lib/internal/template/copy-to-clipboard/interfaces.d.ts +5 -1
  10. package/lib/internal/template/copy-to-clipboard/interfaces.d.ts.map +1 -1
  11. package/lib/internal/template/copy-to-clipboard/interfaces.js.map +1 -1
  12. package/lib/internal/template/copy-to-clipboard/internal.d.ts +1 -1
  13. package/lib/internal/template/copy-to-clipboard/internal.d.ts.map +1 -1
  14. package/lib/internal/template/copy-to-clipboard/internal.js +2 -2
  15. package/lib/internal/template/copy-to-clipboard/internal.js.map +1 -1
  16. package/lib/internal/template/copy-to-clipboard/test-classes/styles.css.js +3 -2
  17. package/lib/internal/template/copy-to-clipboard/test-classes/styles.scoped.css +6 -2
  18. package/lib/internal/template/copy-to-clipboard/test-classes/styles.selectors.js +3 -2
  19. package/lib/internal/template/internal/components/drag-handle/button.d.ts.map +1 -1
  20. package/lib/internal/template/internal/components/drag-handle/button.js +2 -2
  21. package/lib/internal/template/internal/components/drag-handle/button.js.map +1 -1
  22. package/lib/internal/template/internal/components/drag-handle/index.d.ts.map +1 -1
  23. package/lib/internal/template/internal/components/drag-handle/index.js +2 -2
  24. package/lib/internal/template/internal/components/drag-handle/index.js.map +1 -1
  25. package/lib/internal/template/internal/components/drag-handle/interfaces.d.ts +1 -0
  26. package/lib/internal/template/internal/components/drag-handle/interfaces.d.ts.map +1 -1
  27. package/lib/internal/template/internal/components/drag-handle/interfaces.js.map +1 -1
  28. package/lib/internal/template/internal/environment.js +1 -1
  29. package/lib/internal/template/internal/environment.json +1 -1
  30. package/lib/internal/template/test-utils/dom/copy-to-clipboard/index.d.ts +8 -0
  31. package/lib/internal/template/test-utils/dom/copy-to-clipboard/index.js +10 -0
  32. package/lib/internal/template/test-utils/dom/copy-to-clipboard/index.js.map +1 -1
  33. package/lib/internal/template/test-utils/dom/hotspot/index.js +2 -1
  34. package/lib/internal/template/test-utils/dom/hotspot/index.js.map +1 -1
  35. package/lib/internal/template/test-utils/selectors/copy-to-clipboard/index.d.ts +8 -0
  36. package/lib/internal/template/test-utils/selectors/copy-to-clipboard/index.js +10 -0
  37. package/lib/internal/template/test-utils/selectors/copy-to-clipboard/index.js.map +1 -1
  38. package/lib/internal/template/test-utils/selectors/hotspot/index.js +2 -1
  39. package/lib/internal/template/test-utils/selectors/hotspot/index.js.map +1 -1
  40. package/lib/internal/template/test-utils/tsconfig.tsbuildinfo +1 -1
  41. package/package.json +1 -1
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "4e31a2f58f2a87e74425248e171e852053ff7230"
2
+ "commit": "9ea8f8d69135489a11b906c3ea6e1f690732a027"
3
3
  }
@@ -9,3 +9,6 @@
9
9
  .text-to-copy {
10
10
  /* used in test-utils */
11
11
  }
12
+ .text-to-display {
13
+ /* used in test-utils */
14
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"annotation-popover.d.ts","sourceRoot":"","sources":["../../../../src/annotation-context/annotation/annotation-popover.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAMzC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAQxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAIvD,UAAU,sBAAsB;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IAEvB,SAAS,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;IAErC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAE9B,QAAQ,EAAE,MAAM,IAAI,CAAC;IAErB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,qBAAqB,EAAE,MAAM,IAAI,CAAC;IAElC,kBAAkB,EAAE,MAAM,CAAC;IAE3B,eAAe,EAAE,MAAM,CAAC;IAExB,gBAAgB,EAAE,OAAO,CAAC;IAE1B,SAAS,EAAE,MAAM,IAAI,CAAC;IAEtB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IAEvC,WAAW,EAAE,sBAAsB,CAAC,aAAa,CAAC,CAAC;CACpD;AASD,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,OAAO,EACP,KAAK,EAEL,SAAiB,EAEjB,kBAAkB,EAElB,eAAe,EAEf,kBAAkB,EAClB,gBAAgB,EAEhB,SAAS,EAET,iBAAiB,EACjB,iBAAiB,EAEjB,QAAQ,EAER,QAAQ,EAER,qBAAqB,EACrB,qBAAqB,EACrB,WAAW,GACZ,EAAE,sBAAsB,eAuGxB"}
1
+ {"version":3,"file":"annotation-popover.d.ts","sourceRoot":"","sources":["../../../../src/annotation-context/annotation/annotation-popover.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAMzC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAQxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAIvD,UAAU,sBAAsB;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IAEvB,SAAS,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;IAErC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAE9B,QAAQ,EAAE,MAAM,IAAI,CAAC;IAErB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,qBAAqB,EAAE,MAAM,IAAI,CAAC;IAElC,kBAAkB,EAAE,MAAM,CAAC;IAE3B,eAAe,EAAE,MAAM,CAAC;IAExB,gBAAgB,EAAE,OAAO,CAAC;IAE1B,SAAS,EAAE,MAAM,IAAI,CAAC;IAEtB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IAEvC,WAAW,EAAE,sBAAsB,CAAC,aAAa,CAAC,CAAC;CACpD;AASD,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,OAAO,EACP,KAAK,EAEL,SAAiB,EAEjB,kBAAkB,EAElB,eAAe,EAEf,kBAAkB,EAClB,gBAAgB,EAEhB,SAAS,EAET,iBAAiB,EACjB,iBAAiB,EAEjB,QAAQ,EAER,QAAQ,EAER,qBAAqB,EACrB,qBAAqB,EACrB,WAAW,GACZ,EAAE,sBAAsB,eAwGxB"}
@@ -22,7 +22,7 @@ export function AnnotationPopover({ title, content, alert, direction = 'top', ta
22
22
  }, [trackRef]);
23
23
  const popoverHeaderId = useUniqueId('poppver-header-');
24
24
  const stepCounterId = useUniqueId('step-counter-');
25
- return (React.createElement(PopoverContainer, { size: "medium", fixedWidth: false, position: direction, trackRef: trackRef, trackKey: taskLocalStepIndex, variant: "annotation", arrow: arrow, zIndex: 1000 },
25
+ return (React.createElement(PopoverContainer, { size: "medium", fixedWidth: false, position: direction, trackRef: trackRef, trackKey: taskLocalStepIndex, variant: "annotation", arrow: arrow, zIndex: 7000, renderWithPortal: true },
26
26
  React.createElement(PopoverBody, { dismissButton: true, dismissAriaLabel: i18nStrings.labelDismissAnnotation, header: React.createElement(InternalBox, { id: popoverHeaderId, color: "text-body-secondary", fontSize: "body-s", margin: { top: 'xxxs' }, className: styles.header }, title), onDismiss: onDismiss, className: styles.annotation, variant: "annotation", overflowVisible: "content",
27
27
  // create new dialog to have the native dialog behavior of the screen readers
28
28
  key: taskLocalStepIndex, ariaLabelledby: joinStrings(popoverHeaderId, stepCounterId) },
@@ -1 +1 @@
1
- {"version":3,"file":"annotation-popover.js","sourceRoot":"","sources":["../../../../src/annotation-context/annotation/annotation-popover.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,aAAa,MAAM,sBAAsB,CAAC;AACjD,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAC1E,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,MAAM,8CAA8C,CAAC;AAC3E,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAC7C,OAAO,gBAAgB,MAAM,yBAAyB,CAAC;AAEvD,OAAO,oBAAoB,MAAM,8BAA8B,CAAC;AAGhE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AA+BrC,MAAM,KAAK,GAAG,CAAC,QAAiC,EAAE,EAAE,CAAC,CACnD,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,kBAAkB,QAAQ,EAAE,CAAC,CAAC;IACtE,6BAAK,SAAS,EAAE,MAAM,CAAC,aAAa,CAAC,GAAI;IACzC,6BAAK,SAAS,EAAE,MAAM,CAAC,aAAa,CAAC,GAAI,CACrC,CACP,CAAC;AAEF,MAAM,UAA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AAE,MAAM,CAAC,eAAe,CAAC,IAEjC,WAAW,CAAC,gBAAgB,CACd,CAClB,CAAC,CAAC,CAAC,CACF,oBAAC,cAAc,IACb,OAAO,EAAE,iBAAiB,EAC1B,QAAQ,EAAE,CAAC,iBAAiB,EAC5B,UAAU,EAAC,MAAM,EACjB,SAAS,EAAE,WAAW,CAAC,cAAc,EACrC,SAAS,EAAE,MAAM,CAAC,aAAa,CAAC,IAE/B,WAAW,CAAC,cAAc,CACZ,CAClB,CACoB,CACnB,CACe,CACF,CACX,CACG,CACpB,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect } from 'react';\nimport clsx from 'clsx';\n\nimport InternalAlert from '../../alert/internal';\nimport InternalBox from '../../box/internal';\nimport { InternalButton } from '../../button/internal';\nimport { HotspotProps } from '../../hotspot/interfaces';\nimport { useUniqueId } from '../../internal/hooks/use-unique-id/index.js';\nimport { scrollElementIntoView } from '../../internal/utils/scrollable-containers';\nimport { joinStrings } from '../../internal/utils/strings/join-strings.js';\nimport PopoverBody from '../../popover/body';\nimport PopoverContainer from '../../popover/container';\nimport { InternalPosition } from '../../popover/interfaces';\nimport InternalSpaceBetween from '../../space-between/internal';\nimport { AnnotationContextProps } from '../interfaces';\n\nimport styles from './styles.css.js';\n\ninterface AnnotationPopoverProps {\n title: string;\n content: React.ReactNode;\n alert: React.ReactNode;\n\n direction: HotspotProps['direction'];\n\n nextButtonEnabled: boolean;\n onNextButtonClick: () => void;\n\n onFinish: () => void;\n\n showPreviousButton: boolean;\n previousButtonEnabled: boolean;\n onPreviousButtonClick: () => void;\n\n taskLocalStepIndex: number;\n\n totalLocalSteps: number;\n\n showFinishButton: boolean;\n\n onDismiss: () => void;\n\n trackRef: React.RefObject<HTMLElement>;\n\n i18nStrings: AnnotationContextProps['i18nStrings'];\n}\n\nconst arrow = (position: InternalPosition | null) => (\n <div className={clsx(styles.arrow, styles[`arrow-position-${position}`])}>\n <div className={styles['arrow-outer']} />\n <div className={styles['arrow-inner']} />\n </div>\n);\n\nexport function AnnotationPopover({\n title,\n content,\n alert,\n\n direction = 'top',\n\n taskLocalStepIndex,\n\n totalLocalSteps,\n\n showPreviousButton,\n showFinishButton,\n\n onDismiss,\n\n nextButtonEnabled,\n onNextButtonClick,\n\n onFinish,\n\n trackRef,\n\n previousButtonEnabled,\n onPreviousButtonClick,\n i18nStrings,\n}: AnnotationPopoverProps) {\n useEffect(() => {\n scrollElementIntoView(trackRef.current ?? undefined);\n }, [trackRef]);\n\n const popoverHeaderId = useUniqueId('poppver-header-');\n const stepCounterId = useUniqueId('step-counter-');\n\n return (\n <PopoverContainer\n size=\"medium\"\n fixedWidth={false}\n position={direction}\n trackRef={trackRef}\n trackKey={taskLocalStepIndex}\n variant=\"annotation\"\n arrow={arrow}\n zIndex={1000}\n >\n <PopoverBody\n dismissButton={true}\n dismissAriaLabel={i18nStrings.labelDismissAnnotation}\n header={\n <InternalBox\n id={popoverHeaderId}\n color=\"text-body-secondary\"\n fontSize=\"body-s\"\n margin={{ top: 'xxxs' }}\n className={styles.header}\n >\n {title}\n </InternalBox>\n }\n onDismiss={onDismiss}\n className={styles.annotation}\n variant=\"annotation\"\n overflowVisible=\"content\"\n // create new dialog to have the native dialog behavior of the screen readers\n key={taskLocalStepIndex}\n ariaLabelledby={joinStrings(popoverHeaderId, stepCounterId)}\n >\n <InternalSpaceBetween size=\"s\">\n <div className={styles.description}>\n <InternalBox className={styles.content}>{content}</InternalBox>\n </div>\n\n {alert && <InternalAlert type=\"warning\">{alert}</InternalAlert>}\n\n <InternalSpaceBetween size=\"s\">\n <div className={styles.divider} />\n\n <div className={styles.actionBar}>\n <div className={styles.stepCounter}>\n <InternalBox\n id={stepCounterId}\n className={styles['step-counter-content']}\n color=\"text-body-secondary\"\n fontSize=\"body-s\"\n >\n {i18nStrings.stepCounterText(taskLocalStepIndex ?? 0, totalLocalSteps ?? 0)}\n </InternalBox>\n </div>\n <InternalSpaceBetween size=\"xs\" direction=\"horizontal\">\n {showPreviousButton && (\n <InternalButton\n variant=\"link\"\n onClick={onPreviousButtonClick}\n disabled={!previousButtonEnabled}\n formAction=\"none\"\n ariaLabel={i18nStrings.previousButtonText}\n className={styles['previous-button']}\n >\n {i18nStrings.previousButtonText}\n </InternalButton>\n )}\n\n {showFinishButton ? (\n <InternalButton\n onClick={onFinish}\n formAction=\"none\"\n ariaLabel={i18nStrings.finishButtonText}\n className={styles['finish-button']}\n >\n {i18nStrings.finishButtonText}\n </InternalButton>\n ) : (\n <InternalButton\n onClick={onNextButtonClick}\n disabled={!nextButtonEnabled}\n formAction=\"none\"\n ariaLabel={i18nStrings.nextButtonText}\n className={styles['next-button']}\n >\n {i18nStrings.nextButtonText}\n </InternalButton>\n )}\n </InternalSpaceBetween>\n </div>\n </InternalSpaceBetween>\n </InternalSpaceBetween>\n </PopoverBody>\n </PopoverContainer>\n );\n}\n"]}
1
+ {"version":3,"file":"annotation-popover.js","sourceRoot":"","sources":["../../../../src/annotation-context/annotation/annotation-popover.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,aAAa,MAAM,sBAAsB,CAAC;AACjD,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAC1E,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,MAAM,8CAA8C,CAAC;AAC3E,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAC7C,OAAO,gBAAgB,MAAM,yBAAyB,CAAC;AAEvD,OAAO,oBAAoB,MAAM,8BAA8B,CAAC;AAGh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AC,MAAM,EACd,OAAO,EAAE,qBAAqB,EAC9B,QAAQ,EAAE,CAAC,qBAAqB,EAChC,UAAU,EAAC,MAAM,EACjB,SAAS,EAAE,WAAW,CAAC,kBAAkB,EACzC,SAAS,EAAE,MAAM,CAAC,iBAAiB,CAAC,IAEnC,WAAW,CAAC,kBAAkB,CAChB,CAClB;4BAEA,gBAAgB,CAAC,CAAC,CAAC,CAClB,oBAAC,cAAc,IACb,OAAO,EAAE,QAAQ,EACjB,UAAU,EAAC,MAAM,EACjB,SAAS,EAAE,WAAW,CAAC,gBAAgB,EACvC,SAAS,EAAE,MAAM,CAAC,eAAe,CAAC,IAEjC,WAAW,CAAC,gBAAgB,CACd,CAClB,CAAC,CAAC,CAAC,CACF,oBAAC,cAAc,IACb,OAAO,EAAE,iBAAiB,EAC1B,QAAQ,EAAE,CAAC,iBAAiB,EAC5B,UAAU,EAAC,MAAM,EACjB,SAAS,EAAE,WAAW,CAAC,cAAc,EACrC,SAAS,EAAE,MAAM,CAAC,aAAa,CAAC,IAE/B,WAAW,CAAC,cAAc,CACZ,CAClB,CACoB,CACnB,CACe,CACF,CACX,CACG,CACpB,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect } from 'react';\nimport clsx from 'clsx';\n\nimport InternalAlert from '../../alert/internal';\nimport InternalBox from '../../box/internal';\nimport { InternalButton } from '../../button/internal';\nimport { HotspotProps } from '../../hotspot/interfaces';\nimport { useUniqueId } from '../../internal/hooks/use-unique-id/index.js';\nimport { scrollElementIntoView } from '../../internal/utils/scrollable-containers';\nimport { joinStrings } from '../../internal/utils/strings/join-strings.js';\nimport PopoverBody from '../../popover/body';\nimport PopoverContainer from '../../popover/container';\nimport { InternalPosition } from '../../popover/interfaces';\nimport InternalSpaceBetween from '../../space-between/internal';\nimport { AnnotationContextProps } from '../interfaces';\n\nimport styles from './styles.css.js';\n\ninterface AnnotationPopoverProps {\n title: string;\n content: React.ReactNode;\n alert: React.ReactNode;\n\n direction: HotspotProps['direction'];\n\n nextButtonEnabled: boolean;\n onNextButtonClick: () => void;\n\n onFinish: () => void;\n\n showPreviousButton: boolean;\n previousButtonEnabled: boolean;\n onPreviousButtonClick: () => void;\n\n taskLocalStepIndex: number;\n\n totalLocalSteps: number;\n\n showFinishButton: boolean;\n\n onDismiss: () => void;\n\n trackRef: React.RefObject<HTMLElement>;\n\n i18nStrings: AnnotationContextProps['i18nStrings'];\n}\n\nconst arrow = (position: InternalPosition | null) => (\n <div className={clsx(styles.arrow, styles[`arrow-position-${position}`])}>\n <div className={styles['arrow-outer']} />\n <div className={styles['arrow-inner']} />\n </div>\n);\n\nexport function AnnotationPopover({\n title,\n content,\n alert,\n\n direction = 'top',\n\n taskLocalStepIndex,\n\n totalLocalSteps,\n\n showPreviousButton,\n showFinishButton,\n\n onDismiss,\n\n nextButtonEnabled,\n onNextButtonClick,\n\n onFinish,\n\n trackRef,\n\n previousButtonEnabled,\n onPreviousButtonClick,\n i18nStrings,\n}: AnnotationPopoverProps) {\n useEffect(() => {\n scrollElementIntoView(trackRef.current ?? undefined);\n }, [trackRef]);\n\n const popoverHeaderId = useUniqueId('poppver-header-');\n const stepCounterId = useUniqueId('step-counter-');\n\n return (\n <PopoverContainer\n size=\"medium\"\n fixedWidth={false}\n position={direction}\n trackRef={trackRef}\n trackKey={taskLocalStepIndex}\n variant=\"annotation\"\n arrow={arrow}\n zIndex={7000}\n renderWithPortal={true}\n >\n <PopoverBody\n dismissButton={true}\n dismissAriaLabel={i18nStrings.labelDismissAnnotation}\n header={\n <InternalBox\n id={popoverHeaderId}\n color=\"text-body-secondary\"\n fontSize=\"body-s\"\n margin={{ top: 'xxxs' }}\n className={styles.header}\n >\n {title}\n </InternalBox>\n }\n onDismiss={onDismiss}\n className={styles.annotation}\n variant=\"annotation\"\n overflowVisible=\"content\"\n // create new dialog to have the native dialog behavior of the screen readers\n key={taskLocalStepIndex}\n ariaLabelledby={joinStrings(popoverHeaderId, stepCounterId)}\n >\n <InternalSpaceBetween size=\"s\">\n <div className={styles.description}>\n <InternalBox className={styles.content}>{content}</InternalBox>\n </div>\n\n {alert && <InternalAlert type=\"warning\">{alert}</InternalAlert>}\n\n <InternalSpaceBetween size=\"s\">\n <div className={styles.divider} />\n\n <div className={styles.actionBar}>\n <div className={styles.stepCounter}>\n <InternalBox\n id={stepCounterId}\n className={styles['step-counter-content']}\n color=\"text-body-secondary\"\n fontSize=\"body-s\"\n >\n {i18nStrings.stepCounterText(taskLocalStepIndex ?? 0, totalLocalSteps ?? 0)}\n </InternalBox>\n </div>\n <InternalSpaceBetween size=\"xs\" direction=\"horizontal\">\n {showPreviousButton && (\n <InternalButton\n variant=\"link\"\n onClick={onPreviousButtonClick}\n disabled={!previousButtonEnabled}\n formAction=\"none\"\n ariaLabel={i18nStrings.previousButtonText}\n className={styles['previous-button']}\n >\n {i18nStrings.previousButtonText}\n </InternalButton>\n )}\n\n {showFinishButton ? (\n <InternalButton\n onClick={onFinish}\n formAction=\"none\"\n ariaLabel={i18nStrings.finishButtonText}\n className={styles['finish-button']}\n >\n {i18nStrings.finishButtonText}\n </InternalButton>\n ) : (\n <InternalButton\n onClick={onNextButtonClick}\n disabled={!nextButtonEnabled}\n formAction=\"none\"\n ariaLabel={i18nStrings.nextButtonText}\n className={styles['next-button']}\n >\n {i18nStrings.nextButtonText}\n </InternalButton>\n )}\n </InternalSpaceBetween>\n </div>\n </InternalSpaceBetween>\n </InternalSpaceBetween>\n </PopoverBody>\n </PopoverContainer>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"open-annotation.d.ts","sourceRoot":"","sources":["../../../../src/annotation-context/annotation/open-annotation.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAIvD,UAAU,eAAe;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAExB,SAAS,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;IAErC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAE9B,QAAQ,EAAE,MAAM,IAAI,CAAC;IAErB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,qBAAqB,EAAE,MAAM,IAAI,CAAC;IAElC,kBAAkB,EAAE,OAAO,CAAC;IAC5B,gBAAgB,EAAE,OAAO,CAAC;IAE1B,kBAAkB,EAAE,MAAM,CAAC;IAE3B,eAAe,EAAE,MAAM,CAAC;IAExB,SAAS,EAAE,MAAM,IAAI,CAAC;IAEtB,WAAW,EAAE,sBAAsB,CAAC,aAAa,CAAC,CAAC;CACpD;AAED,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,OAAO,EACP,KAAK,EAEL,SAAS,EAET,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAElB,eAAe,EAEf,SAAS,EAET,iBAAiB,EACjB,iBAAiB,EAEjB,QAAQ,EAER,qBAAqB,EACrB,qBAAqB,EACrB,WAAW,GACZ,EAAE,eAAe,eAkCjB"}
1
+ {"version":3,"file":"open-annotation.d.ts","sourceRoot":"","sources":["../../../../src/annotation-context/annotation/open-annotation.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAIvD,UAAU,eAAe;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAExB,SAAS,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;IAErC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAE9B,QAAQ,EAAE,MAAM,IAAI,CAAC;IAErB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,qBAAqB,EAAE,MAAM,IAAI,CAAC;IAElC,kBAAkB,EAAE,OAAO,CAAC;IAC5B,gBAAgB,EAAE,OAAO,CAAC;IAE1B,kBAAkB,EAAE,MAAM,CAAC;IAE3B,eAAe,EAAE,MAAM,CAAC;IAExB,SAAS,EAAE,MAAM,IAAI,CAAC;IAEtB,WAAW,EAAE,sBAAsB,CAAC,aAAa,CAAC,CAAC;CACpD;AAED,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,OAAO,EACP,KAAK,EAEL,SAAS,EAET,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAElB,eAAe,EAEf,SAAS,EAET,iBAAiB,EACjB,iBAAiB,EAEjB,QAAQ,EAER,qBAAqB,EACrB,qBAAqB,EACrB,WAAW,GACZ,EAAE,eAAe,eAmCjB"}
@@ -1,12 +1,14 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import React, { useRef } from 'react';
4
+ import Portal from '../../internal/components/portal';
4
5
  import { AnnotationPopover } from './annotation-popover';
5
6
  import AnnotationTrigger from './annotation-trigger';
6
7
  export function OpenAnnotation({ title, content, alert, direction, showPreviousButton, showFinishButton, taskLocalStepIndex, totalLocalSteps, onDismiss, nextButtonEnabled, onNextButtonClick, onFinish, previousButtonEnabled, onPreviousButtonClick, i18nStrings, }) {
7
8
  const trackRef = useRef(null);
8
9
  return (React.createElement(React.Fragment, null,
9
10
  React.createElement(AnnotationTrigger, { open: true, onClick: onDismiss, i18nStrings: i18nStrings, ref: trackRef, totalLocalSteps: totalLocalSteps, taskLocalStepIndex: taskLocalStepIndex }),
10
- React.createElement(AnnotationPopover, { trackRef: trackRef, previousButtonEnabled: previousButtonEnabled, showPreviousButton: showPreviousButton, showFinishButton: showFinishButton, totalLocalSteps: totalLocalSteps, i18nStrings: i18nStrings, nextButtonEnabled: nextButtonEnabled, onDismiss: onDismiss, onFinish: onFinish, onNextButtonClick: onNextButtonClick, onPreviousButtonClick: onPreviousButtonClick, taskLocalStepIndex: taskLocalStepIndex, direction: direction, title: title, content: content, alert: alert })));
11
+ React.createElement(Portal, null,
12
+ React.createElement(AnnotationPopover, { trackRef: trackRef, previousButtonEnabled: previousButtonEnabled, showPreviousButton: showPreviousButton, showFinishButton: showFinishButton, totalLocalSteps: totalLocalSteps, i18nStrings: i18nStrings, nextButtonEnabled: nextButtonEnabled, onDismiss: onDismiss, onFinish: onFinish, onNextButtonClick: onNextButtonClick, onPreviousButtonClick: onPreviousButtonClick, taskLocalStepIndex: taskLocalStepIndex, direction: direction, title: title, content: content, alert: alert }))));
11
13
  }
12
14
  //# sourceMappingURL=open-annotation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"open-annotation.js","sourceRoot":"","sources":["../../../../src/annotation-context/annotation/open-annotation.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAItC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,iBAAiB,MAAM,sBAAsB,CAAC;AA6BrD,MAAM,UAAU,cAAc,CAAC,EAC7B,KAAK,EACL,OAAO,EACP,KAAK,EAEL,SAAS,EAET,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAElB,eAAe,EAEf,SAAS,EAET,iBAAiB,EACjB,iBAAiB,EAEjB,QAAQ,EAER,qBAAqB,EACrB,qBAAqB,EACrB,WAAW,GACK;IAChB,MAAM,QAAQ,GAAG,MAAM,CAAoB,IAAI,CAAC,CAAC;IAEjD,OAAO,CACL;QACE,oBAAC,iBAAiB,IAChB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,SAAS,EAClB,WAAW,EAAE,WAAW,EACxB,GAAG,EAAE,QAAQ,EACb,eAAe,EAAE,eAAe,EAChC,kBAAkB,EAAE,kBAAkB,GACtC;QAEF,oBAAC,iBAAiB,IAChB,QAAQ,EAAE,QAAQ,EAClB,qBAAqB,EAAE,qBAAqB,EAC5C,kBAAkB,EAAE,kBAAkB,EACtC,gBAAgB,EAAE,gBAAgB,EAClC,eAAe,EAAE,eAAe,EAChC,WAAW,EAAE,WAAW,EACxB,iBAAiB,EAAE,iBAAiB,EACpC,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,iBAAiB,EAAE,iBAAiB,EACpC,qBAAqB,EAAE,qBAAqB,EAC5C,kBAAkB,EAAE,kBAAkB,EACtC,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,GACZ,CACD,CACJ,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\n\nimport { HotspotProps } from '../../hotspot/interfaces';\nimport { AnnotationContextProps } from '../interfaces';\nimport { AnnotationPopover } from './annotation-popover';\nimport AnnotationTrigger from './annotation-trigger';\n\ninterface AnnotationProps {\n title: string;\n content: React.ReactNode;\n alert?: React.ReactNode;\n\n direction: HotspotProps['direction'];\n\n nextButtonEnabled: boolean;\n onNextButtonClick: () => void;\n\n onFinish: () => void;\n\n previousButtonEnabled: boolean;\n onPreviousButtonClick: () => void;\n\n showPreviousButton: boolean;\n showFinishButton: boolean;\n\n taskLocalStepIndex: number;\n\n totalLocalSteps: number;\n\n onDismiss: () => void;\n\n i18nStrings: AnnotationContextProps['i18nStrings'];\n}\n\nexport function OpenAnnotation({\n title,\n content,\n alert,\n\n direction,\n\n showPreviousButton,\n showFinishButton,\n taskLocalStepIndex,\n\n totalLocalSteps,\n\n onDismiss,\n\n nextButtonEnabled,\n onNextButtonClick,\n\n onFinish,\n\n previousButtonEnabled,\n onPreviousButtonClick,\n i18nStrings,\n}: AnnotationProps) {\n const trackRef = useRef<HTMLButtonElement>(null);\n\n return (\n <>\n <AnnotationTrigger\n open={true}\n onClick={onDismiss}\n i18nStrings={i18nStrings}\n ref={trackRef}\n totalLocalSteps={totalLocalSteps}\n taskLocalStepIndex={taskLocalStepIndex}\n />\n\n <AnnotationPopover\n trackRef={trackRef}\n previousButtonEnabled={previousButtonEnabled}\n showPreviousButton={showPreviousButton}\n showFinishButton={showFinishButton}\n totalLocalSteps={totalLocalSteps}\n i18nStrings={i18nStrings}\n nextButtonEnabled={nextButtonEnabled}\n onDismiss={onDismiss}\n onFinish={onFinish}\n onNextButtonClick={onNextButtonClick}\n onPreviousButtonClick={onPreviousButtonClick}\n taskLocalStepIndex={taskLocalStepIndex}\n direction={direction}\n title={title}\n content={content}\n alert={alert}\n />\n </>\n );\n}\n"]}
1
+ {"version":3,"file":"open-annotation.js","sourceRoot":"","sources":["../../../../src/annotation-context/annotation/open-annotation.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAGtC,OAAO,MAAM,MAAM,kCAAkC,CAAC;AAEtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,iBAAiB,MAAM,sBAAsB,CAAC;AA6BrD,MAAM,UAAU,cAAc,CAAC,EAC7B,KAAK,EACL,OAAO,EACP,KAAK,EAEL,SAAS,EAET,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAElB,eAAe,EAEf,SAAS,EAET,iBAAiB,EACjB,iBAAiB,EAEjB,QAAQ,EAER,qBAAqB,EACrB,qBAAqB,EACrB,WAAW,GACK;IAChB,MAAM,QAAQ,GAAG,MAAM,CAAoB,IAAI,CAAC,CAAC;IAEjD,OAAO,CACL;QACE,oBAAC,iBAAiB,IAChB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,SAAS,EAClB,WAAW,EAAE,WAAW,EACxB,GAAG,EAAE,QAAQ,EACb,eAAe,EAAE,eAAe,EAChC,kBAAkB,EAAE,kBAAkB,GACtC;QACF,oBAAC,MAAM;YACL,oBAAC,iBAAiB,IAChB,QAAQ,EAAE,QAAQ,EAClB,qBAAqB,EAAE,qBAAqB,EAC5C,kBAAkB,EAAE,kBAAkB,EACtC,gBAAgB,EAAE,gBAAgB,EAClC,eAAe,EAAE,eAAe,EAChC,WAAW,EAAE,WAAW,EACxB,iBAAiB,EAAE,iBAAiB,EACpC,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,iBAAiB,EAAE,iBAAiB,EACpC,qBAAqB,EAAE,qBAAqB,EAC5C,kBAAkB,EAAE,kBAAkB,EACtC,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,GACZ,CACK,CACR,CACJ,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\n\nimport { HotspotProps } from '../../hotspot/interfaces';\nimport Portal from '../../internal/components/portal';\nimport { AnnotationContextProps } from '../interfaces';\nimport { AnnotationPopover } from './annotation-popover';\nimport AnnotationTrigger from './annotation-trigger';\n\ninterface AnnotationProps {\n title: string;\n content: React.ReactNode;\n alert?: React.ReactNode;\n\n direction: HotspotProps['direction'];\n\n nextButtonEnabled: boolean;\n onNextButtonClick: () => void;\n\n onFinish: () => void;\n\n previousButtonEnabled: boolean;\n onPreviousButtonClick: () => void;\n\n showPreviousButton: boolean;\n showFinishButton: boolean;\n\n taskLocalStepIndex: number;\n\n totalLocalSteps: number;\n\n onDismiss: () => void;\n\n i18nStrings: AnnotationContextProps['i18nStrings'];\n}\n\nexport function OpenAnnotation({\n title,\n content,\n alert,\n\n direction,\n\n showPreviousButton,\n showFinishButton,\n taskLocalStepIndex,\n\n totalLocalSteps,\n\n onDismiss,\n\n nextButtonEnabled,\n onNextButtonClick,\n\n onFinish,\n\n previousButtonEnabled,\n onPreviousButtonClick,\n i18nStrings,\n}: AnnotationProps) {\n const trackRef = useRef<HTMLButtonElement>(null);\n\n return (\n <>\n <AnnotationTrigger\n open={true}\n onClick={onDismiss}\n i18nStrings={i18nStrings}\n ref={trackRef}\n totalLocalSteps={totalLocalSteps}\n taskLocalStepIndex={taskLocalStepIndex}\n />\n <Portal>\n <AnnotationPopover\n trackRef={trackRef}\n previousButtonEnabled={previousButtonEnabled}\n showPreviousButton={showPreviousButton}\n showFinishButton={showFinishButton}\n totalLocalSteps={totalLocalSteps}\n i18nStrings={i18nStrings}\n nextButtonEnabled={nextButtonEnabled}\n onDismiss={onDismiss}\n onFinish={onFinish}\n onNextButtonClick={onNextButtonClick}\n onPreviousButtonClick={onPreviousButtonClick}\n taskLocalStepIndex={taskLocalStepIndex}\n direction={direction}\n title={title}\n content={content}\n alert={alert}\n />\n </Portal>\n </>\n );\n}\n"]}
@@ -19,9 +19,13 @@ export interface CopyToClipboardProps extends BaseComponentProps {
19
19
  */
20
20
  copyButtonAriaLabel?: string;
21
21
  /**
22
- * The text content to be copied. It is displayed next to the copy button when `variant="inline"`, and is not shown otherwise.
22
+ * The text content to be copied. It is displayed next to the copy button when `variant="inline"` unless when `content` is specified, and is not shown otherwise.
23
23
  */
24
24
  textToCopy: string;
25
+ /**
26
+ * The text content to display next to the copy button when `variant="inline"`. If not provided, `textToCopy` will be displayed instead.
27
+ */
28
+ textToDisplay?: string;
25
29
  /**
26
30
  * The message shown when the text is copied successfully.
27
31
  */
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/copy-to-clipboard/interfaces.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,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version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/copy-to-clipboard/interfaces.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { BaseComponentProps } from '../internal/base-component';\n\nexport interface CopyToClipboardProps extends BaseComponentProps {\n /** Determines the general styling of the copy button as follows:\n *\n * * `button` to display a standalone secondary button with an icon, and `copyButtonText` as text.\n * * `icon` to display a standalone icon-only (no text) button.\n * * `inline` to display an icon-only (no text) button within a text context.\n *\n * Defaults to `button`.\n */\n variant?: CopyToClipboardProps.Variant;\n\n /**\n * The text of the copy button (for variant=\"button\").\n */\n copyButtonText?: string;\n\n /**\n * Adds `aria-label` to the copy button. Use this to provide an accessible name for buttons that don't have visible text,\n * and to distinguish between multiple buttons with identical visible text. The text will also be added to the `title` attribute of the button.\n */\n copyButtonAriaLabel?: string;\n\n /**\n * The text content to be copied. It is displayed next to the copy button when `variant=\"inline\"`, and is not shown otherwise.\n */\n textToCopy: string;\n\n /**\n * The message shown when the text is copied successfully.\n */\n copySuccessText: string;\n\n /**\n * The message shown when the text is not copied due to an error, see [https://w3c.github.io/clipboard-apis/#dom-clipboard-writetext](https://w3c.github.io/clipboard-apis/#dom-clipboard-writetext).\n */\n copyErrorText: string;\n\n /**\n * By default, the popover is constrained to fit inside its parent\n * [stacking context](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context).\n * Enabling this property will allow the popover to be rendered in the root stack context using\n * [React Portals](https://reactjs.org/docs/portals.html).\n * Enable this setting if you need the popover to ignore its parent stacking context.\n */\n popoverRenderWithPortal?: boolean;\n}\n\nexport namespace CopyToClipboardProps {\n export type Variant = 'button' | 'icon' | 'inline';\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/copy-to-clipboard/interfaces.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { BaseComponentProps } from '../internal/base-component';\n\nexport interface CopyToClipboardProps extends BaseComponentProps {\n /** Determines the general styling of the copy button as follows:\n *\n * * `button` to display a standalone secondary button with an icon, and `copyButtonText` as text.\n * * `icon` to display a standalone icon-only (no text) button.\n * * `inline` to display an icon-only (no text) button within a text context.\n *\n * Defaults to `button`.\n */\n variant?: CopyToClipboardProps.Variant;\n\n /**\n * The text of the copy button (for variant=\"button\").\n */\n copyButtonText?: string;\n\n /**\n * Adds `aria-label` to the copy button. Use this to provide an accessible name for buttons that don't have visible text,\n * and to distinguish between multiple buttons with identical visible text. The text will also be added to the `title` attribute of the button.\n */\n copyButtonAriaLabel?: string;\n\n /**\n * The text content to be copied. It is displayed next to the copy button when `variant=\"inline\"` unless when `content` is specified, and is not shown otherwise.\n */\n textToCopy: string;\n\n /**\n * The text content to display next to the copy button when `variant=\"inline\"`. If not provided, `textToCopy` will be displayed instead.\n */\n textToDisplay?: string;\n\n /**\n * The message shown when the text is copied successfully.\n */\n copySuccessText: string;\n\n /**\n * The message shown when the text is not copied due to an error, see [https://w3c.github.io/clipboard-apis/#dom-clipboard-writetext](https://w3c.github.io/clipboard-apis/#dom-clipboard-writetext).\n */\n copyErrorText: string;\n\n /**\n * By default, the popover is constrained to fit inside its parent\n * [stacking context](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context).\n * Enabling this property will allow the popover to be rendered in the root stack context using\n * [React Portals](https://reactjs.org/docs/portals.html).\n * Enable this setting if you need the popover to ignore its parent stacking context.\n */\n popoverRenderWithPortal?: boolean;\n}\n\nexport namespace CopyToClipboardProps {\n export type Variant = 'button' | 'icon' | 'inline';\n}\n"]}
@@ -3,6 +3,6 @@ import { InternalBaseComponentProps } from '../internal/hooks/use-base-component
3
3
  import { CopyToClipboardProps } from './interfaces';
4
4
  interface InternalCopyToClipboardProps extends CopyToClipboardProps, InternalBaseComponentProps {
5
5
  }
6
- export default function InternalCopyToClipboard({ variant, copyButtonAriaLabel, copyButtonText, copySuccessText, copyErrorText, textToCopy, popoverRenderWithPortal, __internalRootRef, ...restProps }: InternalCopyToClipboardProps): JSX.Element;
6
+ export default function InternalCopyToClipboard({ variant, copyButtonAriaLabel, copyButtonText, copySuccessText, copyErrorText, textToCopy, textToDisplay, popoverRenderWithPortal, __internalRootRef, ...restProps }: InternalCopyToClipboardProps): JSX.Element;
7
7
  export {};
8
8
  //# sourceMappingURL=internal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/copy-to-clipboard/internal.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAGlF,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAKpD,UAAU,4BAA6B,SAAQ,oBAAoB,EAAE,0BAA0B;CAAG;AAElG,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAC,EAC9C,OAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,aAAa,EACb,UAAU,EACV,uBAAuB,EACvB,iBAAwB,EACxB,GAAG,SAAS,EACb,EAAE,4BAA4B,eAuE9B"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/copy-to-clipboard/internal.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAGlF,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAKpD,UAAU,4BAA6B,SAAQ,oBAAoB,EAAE,0BAA0B;CAAG;AAElG,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAC,EAC9C,OAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,aAAa,EACb,UAAU,EACV,aAAa,EACb,uBAAuB,EACvB,iBAAwB,EACxB,GAAG,SAAS,EACb,EAAE,4BAA4B,eAyE9B"}
@@ -10,7 +10,7 @@ import InternalStatusIndicator from '../status-indicator/internal';
10
10
  import styles from './styles.css.js';
11
11
  import testStyles from './test-classes/styles.css.js';
12
12
  export default function InternalCopyToClipboard(_a) {
13
- var { variant = 'button', copyButtonAriaLabel, copyButtonText, copySuccessText, copyErrorText, textToCopy, popoverRenderWithPortal, __internalRootRef = null } = _a, restProps = __rest(_a, ["variant", "copyButtonAriaLabel", "copyButtonText", "copySuccessText", "copyErrorText", "textToCopy", "popoverRenderWithPortal", "__internalRootRef"]);
13
+ var { variant = 'button', copyButtonAriaLabel, copyButtonText, copySuccessText, copyErrorText, textToCopy, textToDisplay, popoverRenderWithPortal, __internalRootRef = null } = _a, restProps = __rest(_a, ["variant", "copyButtonAriaLabel", "copyButtonText", "copySuccessText", "copyErrorText", "textToCopy", "textToDisplay", "popoverRenderWithPortal", "__internalRootRef"]);
14
14
  const [status, setStatus] = useState('pending');
15
15
  const [statusText, setStatusText] = useState('');
16
16
  const baseProps = getBaseProps(restProps);
@@ -44,6 +44,6 @@ export default function InternalCopyToClipboard(_a) {
44
44
  React.createElement(InternalButton, { ariaLabel: copyButtonAriaLabel !== null && copyButtonAriaLabel !== void 0 ? copyButtonAriaLabel : copyButtonText, iconName: "copy", variant: triggerVariant, wrapText: false, formAction: "none" }, copyButtonText)));
45
45
  return (React.createElement("span", Object.assign({}, baseProps, { ref: __internalRootRef, className: clsx(baseProps.className, styles.root, testStyles.root) }), isInline ? (React.createElement("span", { className: styles['inline-container'] },
46
46
  React.createElement("span", { className: styles['inline-container-trigger'] }, trigger),
47
- React.createElement("span", { className: testStyles['text-to-copy'] }, textToCopy))) : (trigger)));
47
+ React.createElement("span", { className: clsx(testStyles['text-to-display'], testStyles['text-to-copy']) }, textToDisplay !== null && textToDisplay !== void 0 ? textToDisplay : textToCopy))) : (trigger)));
48
48
  }
49
49
  //# sourceMappingURL=internal.js.map
@@ -1 +1 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CAAQ;QACrE,8BAAM,SAAS,EAAE,UAAU,CAAC,cAAc,CAAC,IAAG,UAAU,CAAQ,CAC3D,CACR,CAAC,CAAC,CAAC,CACF,OAAO,CACR,CACI,CACR,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useState } from 'react';\nimport clsx from 'clsx';\n\nimport InternalButton from '../button/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport InternalPopover from '../popover/internal';\nimport InternalStatusIndicator from '../status-indicator/internal';\nimport { CopyToClipboardProps } from './interfaces';\n\nimport styles from './styles.css.js';\nimport testStyles from './test-classes/styles.css.js';\n\ninterface InternalCopyToClipboardProps extends CopyToClipboardProps, InternalBaseComponentProps {}\n\nexport default function InternalCopyToClipboard({\n variant = 'button',\n copyButtonAriaLabel,\n copyButtonText,\n copySuccessText,\n copyErrorText,\n textToCopy,\n popoverRenderWithPortal,\n __internalRootRef = null,\n ...restProps\n}: InternalCopyToClipboardProps) {\n const [status, setStatus] = useState<'pending' | 'success' | 'error'>('pending');\n const [statusText, setStatusText] = useState('');\n\n const baseProps = getBaseProps(restProps);\n const onClick = () => {\n if (!navigator.clipboard) {\n // The clipboard API is not available in insecure contexts.\n setStatus('error');\n setStatusText(copyErrorText);\n return;\n }\n\n setStatus('pending');\n setStatusText('');\n navigator.clipboard\n .writeText(textToCopy)\n .then(() => {\n setStatus('success');\n setStatusText(copySuccessText);\n })\n .catch(() => {\n setStatus('error');\n setStatusText(copyErrorText);\n });\n };\n\n const triggerVariant = (\n {\n button: 'normal',\n icon: 'icon',\n inline: 'inline-icon',\n } as const\n )[variant];\n\n const isInline = variant === 'inline';\n const trigger = (\n <InternalPopover\n isInline={isInline}\n size=\"medium\"\n position=\"top\"\n triggerType=\"custom\"\n dismissButton={false}\n renderWithPortal={popoverRenderWithPortal}\n content={<InternalStatusIndicator type={status}>{statusText}</InternalStatusIndicator>}\n __onOpen={onClick}\n >\n <InternalButton\n ariaLabel={copyButtonAriaLabel ?? copyButtonText}\n iconName=\"copy\"\n variant={triggerVariant}\n wrapText={false}\n formAction=\"none\"\n >\n {copyButtonText}\n </InternalButton>\n </InternalPopover>\n );\n\n return (\n <span {...baseProps} ref={__internalRootRef} className={clsx(baseProps.className, styles.root, testStyles.root)}>\n {isInline ? (\n <span className={styles['inline-container']}>\n <span className={styles['inline-container-trigger']}>{trigger}</span>\n <span className={testStyles['text-to-copy']}>{textToCopy}</span>\n </span>\n ) : (\n trigger\n )}\n </span>\n );\n}\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/copy-to-clipboard/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,cAAc,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,eAAe,MAAM,qBAAqB,CAAC;AAClD,OAAO,uBAAuB,MAAM,8BAA8B,CAAC;AAGnE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,UAAU,MAAM,8BAA8B,CAAC;AAItD,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAC,EAWjB;QAXiB,EAC9C,OAAO,GAAG,QAAQ,EAClB,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,aAAa,EACb,UAAU,EACV,aAAa,EACb,uBAAuB,EACvB,iBAAiB,GAAG,IAAI,OAEK,EAD1B,SAAS,cAVkC,uKAW/C,CADa;IAEZ,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAkC,SAAS,CAAC,CAAC;IACjF,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,EAAE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OAAO,EAAE,cAAc,EACvB,QAAQ,EAAE,KAAK,EACf,UAAU,EAAC,MAAM,IAEhB,cAAc,CACA,CACD,CACnB,CAAC;IAEF,OAAO,CACL,8CAAU,SAAS,IAAE,GAAG,EAAE,iBAAiB,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC,KAC5G,QAAQ,CAAC,CAAC,CAAC,CACV,8BAAM,SAAS,EAAE,MAAM,CAAC,kBAAkB,CAAC;QACzC,8BAAM,SAAS,EAAE,MAAM,CAAC,0BAA0B,CAAC,IAAG,OAAO,CAAQ;QACrE,8BAAM,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC,cAAc,CAAC,CAAC,IAC7E,aAAa,aAAb,aAAa,cAAb,aAAa,GAAI,UAAU,CACvB,CACF,CACR,CAAC,CAAC,CAAC,CACF,OAAO,CACR,CACI,CACR,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useState } from 'react';\nimport clsx from 'clsx';\n\nimport InternalButton from '../button/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport InternalPopover from '../popover/internal';\nimport InternalStatusIndicator from '../status-indicator/internal';\nimport { CopyToClipboardProps } from './interfaces';\n\nimport styles from './styles.css.js';\nimport testStyles from './test-classes/styles.css.js';\n\ninterface InternalCopyToClipboardProps extends CopyToClipboardProps, InternalBaseComponentProps {}\n\nexport default function InternalCopyToClipboard({\n variant = 'button',\n copyButtonAriaLabel,\n copyButtonText,\n copySuccessText,\n copyErrorText,\n textToCopy,\n textToDisplay,\n popoverRenderWithPortal,\n __internalRootRef = null,\n ...restProps\n}: InternalCopyToClipboardProps) {\n const [status, setStatus] = useState<'pending' | 'success' | 'error'>('pending');\n const [statusText, setStatusText] = useState('');\n\n const baseProps = getBaseProps(restProps);\n const onClick = () => {\n if (!navigator.clipboard) {\n // The clipboard API is not available in insecure contexts.\n setStatus('error');\n setStatusText(copyErrorText);\n return;\n }\n\n setStatus('pending');\n setStatusText('');\n navigator.clipboard\n .writeText(textToCopy)\n .then(() => {\n setStatus('success');\n setStatusText(copySuccessText);\n })\n .catch(() => {\n setStatus('error');\n setStatusText(copyErrorText);\n });\n };\n\n const triggerVariant = (\n {\n button: 'normal',\n icon: 'icon',\n inline: 'inline-icon',\n } as const\n )[variant];\n\n const isInline = variant === 'inline';\n const trigger = (\n <InternalPopover\n isInline={isInline}\n size=\"medium\"\n position=\"top\"\n triggerType=\"custom\"\n dismissButton={false}\n renderWithPortal={popoverRenderWithPortal}\n content={<InternalStatusIndicator type={status}>{statusText}</InternalStatusIndicator>}\n __onOpen={onClick}\n >\n <InternalButton\n ariaLabel={copyButtonAriaLabel ?? copyButtonText}\n iconName=\"copy\"\n variant={triggerVariant}\n wrapText={false}\n formAction=\"none\"\n >\n {copyButtonText}\n </InternalButton>\n </InternalPopover>\n );\n\n return (\n <span {...baseProps} ref={__internalRootRef} className={clsx(baseProps.className, styles.root, testStyles.root)}>\n {isInline ? (\n <span className={styles['inline-container']}>\n <span className={styles['inline-container-trigger']}>{trigger}</span>\n <span className={clsx(testStyles['text-to-display'], testStyles['text-to-copy'])}>\n {textToDisplay ?? textToCopy}\n </span>\n </span>\n ) : (\n trigger\n )}\n </span>\n );\n}\n"]}
@@ -1,7 +1,8 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "root": "awsui_root_ljpwc_1spew_5",
5
- "text-to-copy": "awsui_text-to-copy_ljpwc_1spew_9"
4
+ "root": "awsui_root_ljpwc_30z5b_5",
5
+ "text-to-copy": "awsui_text-to-copy_ljpwc_30z5b_9",
6
+ "text-to-display": "awsui_text-to-display_ljpwc_30z5b_13"
6
7
  };
7
8
 
@@ -2,10 +2,14 @@
2
2
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  SPDX-License-Identifier: Apache-2.0
4
4
  */
5
- .awsui_root_ljpwc_1spew_5:not(#\9) {
5
+ .awsui_root_ljpwc_30z5b_5:not(#\9) {
6
6
  /* used in test-utils */
7
7
  }
8
8
 
9
- .awsui_text-to-copy_ljpwc_1spew_9:not(#\9) {
9
+ .awsui_text-to-copy_ljpwc_30z5b_9:not(#\9) {
10
+ /* used in test-utils */
11
+ }
12
+
13
+ .awsui_text-to-display_ljpwc_30z5b_13:not(#\9) {
10
14
  /* used in test-utils */
11
15
  }
@@ -2,7 +2,8 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "root": "awsui_root_ljpwc_1spew_5",
6
- "text-to-copy": "awsui_text-to-copy_ljpwc_1spew_9"
5
+ "root": "awsui_root_ljpwc_30z5b_5",
6
+ "text-to-copy": "awsui_text-to-copy_ljpwc_30z5b_9",
7
+ "text-to-display": "awsui_text-to-display_ljpwc_30z5b_13"
7
8
  };
8
9
 
@@ -1 +1 @@
1
- {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/drag-handle/button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAMlD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAK/C,QAAA,MAAM,gBAAgB,6FA+DrB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/drag-handle/button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAMlD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAK/C,QAAA,MAAM,gBAAgB,6FAiErB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -6,7 +6,7 @@ import InternalIcon from '../../../icon/internal';
6
6
  import useForwardFocus from '../../hooks/forward-focus';
7
7
  import { ResizeIcon } from './resize-icon';
8
8
  import styles from './styles.css.js';
9
- const DragHandleButton = forwardRef(({ variant = 'drag-indicator', size = 'normal', className, ariaLabel, ariaDescribedby, ariaValue, disabled, onPointerDown, onKeyDown, }, ref) => {
9
+ const DragHandleButton = forwardRef(({ variant = 'drag-indicator', size = 'normal', className, ariaLabel, ariaLabelledBy, ariaDescribedby, ariaValue, disabled, onPointerDown, onKeyDown, }, ref) => {
10
10
  const dragHandleRefObject = useRef(null);
11
11
  useForwardFocus(ref, dragHandleRefObject);
12
12
  const iconProps = (() => {
@@ -28,7 +28,7 @@ const DragHandleButton = forwardRef(({ variant = 'drag-indicator', size = 'norma
28
28
  // (See https://bugs.webkit.org/show_bug.cgi?id=22261)
29
29
  // Otherwise, we can't reliably catch keyboard events coming from the handle
30
30
  // when it is being dragged.
31
- React.createElement("div", { ref: dragHandleRefObject, role: ariaValue ? 'slider' : 'button', tabIndex: 0, className: clsx(className, styles.handle, styles[`handle-${variant}`], styles[`handle-size-${size}`], disabled && styles['handle-disabled']), "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, "aria-disabled": disabled, "aria-valuemax": ariaValue === null || ariaValue === void 0 ? void 0 : ariaValue.valueMax, "aria-valuemin": ariaValue === null || ariaValue === void 0 ? void 0 : ariaValue.valueMin, "aria-valuenow": ariaValue === null || ariaValue === void 0 ? void 0 : ariaValue.valueNow, onPointerDown: onPointerDown, onKeyDown: onKeyDown },
31
+ React.createElement("div", { ref: dragHandleRefObject, role: ariaValue ? 'slider' : 'button', tabIndex: 0, className: clsx(className, styles.handle, styles[`handle-${variant}`], styles[`handle-size-${size}`], disabled && styles['handle-disabled']), "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedby, "aria-disabled": disabled, "aria-valuemax": ariaValue === null || ariaValue === void 0 ? void 0 : ariaValue.valueMax, "aria-valuemin": ariaValue === null || ariaValue === void 0 ? void 0 : ariaValue.valueMin, "aria-valuenow": ariaValue === null || ariaValue === void 0 ? void 0 : ariaValue.valueNow, onPointerDown: onPointerDown, onKeyDown: onKeyDown },
32
32
  React.createElement(InternalIcon, Object.assign({}, iconProps))));
33
33
  });
34
34
  export default DragHandleButton;
@@ -1 +1 @@
1
- {"version":3,"file":"button.js","sourceRoot":"","sources":["../../../../../src/internal/components/drag-handle/button.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,eAAe,MAAM,2BAA2B,CAAC;AAExD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,MAAM,gBAAgB,GAAG,UAAU,CACjC,CACE,EACE,OAAO,GAAG,gBAAgB,EAC1B,IAAI,GAAG,QAAQ,EACf,SAAS,EACT,SAAS,EACT,eAAe,EACf,SAAS,EACT,QAAQ,EACR,aAAa,EACb,SAAS,GACO,EAClB,GAAmC,EACnC,EAAE;IACF,MAAM,mBAAmB,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAEzD,eAAe,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAC;IAE1C,MAAM,SAAS,GAAc,CAAC,GAAG,EAAE;QACjC,MAAM,MAAM,GAAG,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAE,UAAoB,CAAC,CAAC,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC;QAC/E,QAAQ,OAAO,EAAE;YACf,KAAK,gBAAgB;gBACnB,uCAAY,MAAM,KAAE,IAAI,EAAE,gBAAgB,IAAG;YAC/C,KAAK,aAAa;gBAChB,uCAAY,MAAM,KAAE,IAAI,EAAE,aAAa,IAAG;YAC5C,KAAK,mBAAmB;gBACtB,uCAAY,MAAM,KAAE,GAAG,EAAE,oBAAC,UAAU,IAAC,OAAO,EAAC,YAAY,GAAG,IAAG;YACjE,KAAK,iBAAiB;gBACpB,uCAAY,MAAM,KAAE,GAAG,EAAE,oBAAC,UAAU,IAAC,OAAO,EAAC,UAAU,GAAG,IAAG;SAChE;IACH,CAAC,CAAC,EAAE,CAAC;IAEL,OAAO;IACL,4DAA4D;IAC5D,oDAAoD;IACpD,sDAAsD;IACtD,4EAA4E;IAC5E,4BAA4B;IAC5B,6BACE,GAAG,EAAE,mBAAmB,EACxB,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,EACrC,QAAQ,EAAE,CAAC,EACX,SAAS,EAAE,IAAI,CACb,SAAS,EACT,MAAM,CAAC,MAAM,EACb,MAAM,CAAC,UAAU,OAAO,EAAE,CAAC,EAC3B,MAAM,CAAC,eAAe,IAAI,EAAE,CAAC,EAC7B,QAAQ,IAAI,MAAM,CAAC,iBAAiB,CAAC,CACtC,gBACW,SAAS,sBACH,eAAe,mBAClB,QAAQ,mBACR,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,QAAQ,mBACnB,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,QAAQ,mBACnB,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,QAAQ,EAClC,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,SAAS;QAEpB,oBAAC,YAAY,oBAAK,SAAS,EAAI,CAC3B,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { forwardRef, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { IconProps } from '../../../icon/interfaces';\nimport InternalIcon from '../../../icon/internal';\nimport useForwardFocus from '../../hooks/forward-focus';\nimport { DragHandleProps } from './interfaces';\nimport { ResizeIcon } from './resize-icon';\n\nimport styles from './styles.css.js';\n\nconst DragHandleButton = forwardRef(\n (\n {\n variant = 'drag-indicator',\n size = 'normal',\n className,\n ariaLabel,\n ariaDescribedby,\n ariaValue,\n disabled,\n onPointerDown,\n onKeyDown,\n }: DragHandleProps,\n ref: React.Ref<DragHandleProps.Ref>\n ) => {\n const dragHandleRefObject = useRef<HTMLDivElement>(null);\n\n useForwardFocus(ref, dragHandleRefObject);\n\n const iconProps: IconProps = (() => {\n const shared = { variant: disabled ? ('disabled' as const) : undefined, size };\n switch (variant) {\n case 'drag-indicator':\n return { ...shared, name: 'drag-indicator' };\n case 'resize-area':\n return { ...shared, name: 'resize-area' };\n case 'resize-horizontal':\n return { ...shared, svg: <ResizeIcon variant=\"horizontal\" /> };\n case 'resize-vertical':\n return { ...shared, svg: <ResizeIcon variant=\"vertical\" /> };\n }\n })();\n\n return (\n // We need to use a div with button role instead of a button\n // so that Safari will focus on it when clicking it.\n // (See https://bugs.webkit.org/show_bug.cgi?id=22261)\n // Otherwise, we can't reliably catch keyboard events coming from the handle\n // when it is being dragged.\n <div\n ref={dragHandleRefObject}\n role={ariaValue ? 'slider' : 'button'}\n tabIndex={0}\n className={clsx(\n className,\n styles.handle,\n styles[`handle-${variant}`],\n styles[`handle-size-${size}`],\n disabled && styles['handle-disabled']\n )}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedby}\n aria-disabled={disabled}\n aria-valuemax={ariaValue?.valueMax}\n aria-valuemin={ariaValue?.valueMin}\n aria-valuenow={ariaValue?.valueNow}\n onPointerDown={onPointerDown}\n onKeyDown={onKeyDown}\n >\n <InternalIcon {...iconProps} />\n </div>\n );\n }\n);\n\nexport default DragHandleButton;\n"]}
1
+ {"version":3,"file":"button.js","sourceRoot":"","sources":["../../../../../src/internal/components/drag-handle/button.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAClD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AAI,EAAE,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,EACrC,QAAQ,EAAE,CAAC,EACX,SAAS,EAAE,IAAI,CACb,SAAS,EACT,MAAM,CAAC,MAAM,EACb,MAAM,CAAC,UAAU,OAAO,EAAE,CAAC,EAC3B,MAAM,CAAC,eAAe,IAAI,EAAE,CAAC,EAC7B,QAAQ,IAAI,MAAM,CAAC,iBAAiB,CAAC,CACtC,gBACW,SAAS,qBACJ,cAAc,sBACb,eAAe,mBAClB,QAAQ,mBACR,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,QAAQ,mBACnB,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,QAAQ,mBACnB,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,QAAQ,EAClC,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,SAAS;QAEpB,oBAAC,YAAY,oBAAK,SAAS,EAAI,CAC3B,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { forwardRef, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { IconProps } from '../../../icon/interfaces';\nimport InternalIcon from '../../../icon/internal';\nimport useForwardFocus from '../../hooks/forward-focus';\nimport { DragHandleProps } from './interfaces';\nimport { ResizeIcon } from './resize-icon';\n\nimport styles from './styles.css.js';\n\nconst DragHandleButton = forwardRef(\n (\n {\n variant = 'drag-indicator',\n size = 'normal',\n className,\n ariaLabel,\n ariaLabelledBy,\n ariaDescribedby,\n ariaValue,\n disabled,\n onPointerDown,\n onKeyDown,\n }: DragHandleProps,\n ref: React.Ref<DragHandleProps.Ref>\n ) => {\n const dragHandleRefObject = useRef<HTMLDivElement>(null);\n\n useForwardFocus(ref, dragHandleRefObject);\n\n const iconProps: IconProps = (() => {\n const shared = { variant: disabled ? ('disabled' as const) : undefined, size };\n switch (variant) {\n case 'drag-indicator':\n return { ...shared, name: 'drag-indicator' };\n case 'resize-area':\n return { ...shared, name: 'resize-area' };\n case 'resize-horizontal':\n return { ...shared, svg: <ResizeIcon variant=\"horizontal\" /> };\n case 'resize-vertical':\n return { ...shared, svg: <ResizeIcon variant=\"vertical\" /> };\n }\n })();\n\n return (\n // We need to use a div with button role instead of a button\n // so that Safari will focus on it when clicking it.\n // (See https://bugs.webkit.org/show_bug.cgi?id=22261)\n // Otherwise, we can't reliably catch keyboard events coming from the handle\n // when it is being dragged.\n <div\n ref={dragHandleRefObject}\n role={ariaValue ? 'slider' : 'button'}\n tabIndex={0}\n className={clsx(\n className,\n styles.handle,\n styles[`handle-${variant}`],\n styles[`handle-size-${size}`],\n disabled && styles['handle-disabled']\n )}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedby}\n aria-disabled={disabled}\n aria-valuemax={ariaValue?.valueMax}\n aria-valuemin={ariaValue?.valueMin}\n aria-valuenow={ariaValue?.valueNow}\n onPointerDown={onPointerDown}\n onKeyDown={onKeyDown}\n >\n <InternalIcon {...iconProps} />\n </div>\n );\n }\n);\n\nexport default DragHandleButton;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/drag-handle/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAK1C,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,QAAA,MAAM,kBAAkB,6FAyCvB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/drag-handle/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAK1C,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,QAAA,MAAM,kBAAkB,6FA2CvB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -6,10 +6,10 @@ import { getBaseProps } from '../../base-component';
6
6
  import DragHandleWrapper from '../drag-handle-wrapper';
7
7
  import DragHandleButton from './button';
8
8
  const InternalDragHandle = forwardRef((_a, ref) => {
9
- var { variant, size, ariaLabel, ariaDescribedby, tooltipText, ariaValue, disabled, directions = {}, onPointerDown, onKeyDown, onDirectionClick } = _a, rest = __rest(_a, ["variant", "size", "ariaLabel", "ariaDescribedby", "tooltipText", "ariaValue", "disabled", "directions", "onPointerDown", "onKeyDown", "onDirectionClick"]);
9
+ var { variant, size, ariaLabel, ariaLabelledBy, ariaDescribedby, tooltipText, ariaValue, disabled, directions = {}, onPointerDown, onKeyDown, onDirectionClick } = _a, rest = __rest(_a, ["variant", "size", "ariaLabel", "ariaLabelledBy", "ariaDescribedby", "tooltipText", "ariaValue", "disabled", "directions", "onPointerDown", "onKeyDown", "onDirectionClick"]);
10
10
  const baseProps = getBaseProps(rest);
11
11
  return (React.createElement(DragHandleWrapper, { directions: !disabled ? directions : {}, tooltipText: tooltipText, onDirectionClick: onDirectionClick },
12
- React.createElement(DragHandleButton, { ref: ref, className: baseProps.className, variant: variant, size: size, ariaLabel: ariaLabel, ariaDescribedby: ariaDescribedby, ariaValue: ariaValue, disabled: disabled, onPointerDown: onPointerDown, onKeyDown: onKeyDown })));
12
+ React.createElement(DragHandleButton, { ref: ref, className: baseProps.className, variant: variant, size: size, ariaLabel: ariaLabel, ariaLabelledBy: ariaLabelledBy, ariaDescribedby: ariaDescribedby, ariaValue: ariaValue, disabled: disabled, onPointerDown: onPointerDown, onKeyDown: onKeyDown })));
13
13
  });
14
14
  export default InternalDragHandle;
15
15
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/drag-handle/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AACvD,OAAO,gBAAgB,MAAM,UAAU,CAAC;AAKxC,MAAM,kBAAkB,GAAG,UAAU,CACnC,CACE,EAakB,EAClB,GAAmC,EACnC,EAAE;QAfF,EACE,OAAO,EACP,IAAI,EACJ,SAAS,EACT,eAAe,EACf,WAAW,EACX,SAAS,EACT,QAAQ,EACR,UAAU,GAAG,EAAE,EACf,aAAa,EACb,SAAS,EACT,gBAAgB,OAEA,EADb,IAAI,cAZT,2JAaC,CADQ;IAIT,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IAErC,OAAO,CACL,oBAAC,iBAAiB,IAChB,UAAU,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,EACvC,WAAW,EAAE,WAAW,EACxB,gBAAgB,EAAE,gBAAgB;QAElC,oBAAC,gBAAgB,IACf,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,CAAC,SAAS,EAC9B,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,SAAS,GACpB,CACgB,CACrB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,kBAAkB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { forwardRef } from 'react';\n\nimport { getBaseProps } from '../../base-component';\nimport DragHandleWrapper from '../drag-handle-wrapper';\nimport DragHandleButton from './button';\nimport { DragHandleProps } from './interfaces';\n\nexport { DragHandleProps };\n\nconst InternalDragHandle = forwardRef(\n (\n {\n variant,\n size,\n ariaLabel,\n ariaDescribedby,\n tooltipText,\n ariaValue,\n disabled,\n directions = {},\n onPointerDown,\n onKeyDown,\n onDirectionClick,\n ...rest\n }: DragHandleProps,\n ref: React.Ref<DragHandleProps.Ref>\n ) => {\n const baseProps = getBaseProps(rest);\n\n return (\n <DragHandleWrapper\n directions={!disabled ? directions : {}}\n tooltipText={tooltipText}\n onDirectionClick={onDirectionClick}\n >\n <DragHandleButton\n ref={ref}\n className={baseProps.className}\n variant={variant}\n size={size}\n ariaLabel={ariaLabel}\n ariaDescribedby={ariaDescribedby}\n ariaValue={ariaValue}\n disabled={disabled}\n onPointerDown={onPointerDown}\n onKeyDown={onKeyDown}\n />\n </DragHandleWrapper>\n );\n }\n);\n\nexport default InternalDragHandle;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/drag-handle/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AACvD,OAAO,gBAAgB,MAAM,UAAU,CAAC;AAKxC,MAAM,kBAAkB,GAAG,UAAU,CACnC,CACE,EAckB,EAClB,GAAmC,EACnC,EAAE;QAhBF,EACE,OAAO,EACP,IAAI,EACJ,SAAS,EACT,cAAc,EACd,eAAe,EACf,WAAW,EACX,SAAS,EACT,QAAQ,EACR,UAAU,GAAG,EAAE,EACf,aAAa,EACb,SAAS,EACT,gBAAgB,OAEA,EADb,IAAI,cAbT,6KAcC,CADQ;IAIT,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IAErC,OAAO,CACL,oBAAC,iBAAiB,IAChB,UAAU,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,EACvC,WAAW,EAAE,WAAW,EACxB,gBAAgB,EAAE,gBAAgB;QAElC,oBAAC,gBAAgB,IACf,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,CAAC,SAAS,EAC9B,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,SAAS,GACpB,CACgB,CACrB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,kBAAkB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { forwardRef } from 'react';\n\nimport { getBaseProps } from '../../base-component';\nimport DragHandleWrapper from '../drag-handle-wrapper';\nimport DragHandleButton from './button';\nimport { DragHandleProps } from './interfaces';\n\nexport { DragHandleProps };\n\nconst InternalDragHandle = forwardRef(\n (\n {\n variant,\n size,\n ariaLabel,\n ariaLabelledBy,\n ariaDescribedby,\n tooltipText,\n ariaValue,\n disabled,\n directions = {},\n onPointerDown,\n onKeyDown,\n onDirectionClick,\n ...rest\n }: DragHandleProps,\n ref: React.Ref<DragHandleProps.Ref>\n ) => {\n const baseProps = getBaseProps(rest);\n\n return (\n <DragHandleWrapper\n directions={!disabled ? directions : {}}\n tooltipText={tooltipText}\n onDirectionClick={onDirectionClick}\n >\n <DragHandleButton\n ref={ref}\n className={baseProps.className}\n variant={variant}\n size={size}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n ariaDescribedby={ariaDescribedby}\n ariaValue={ariaValue}\n disabled={disabled}\n onPointerDown={onPointerDown}\n onKeyDown={onKeyDown}\n />\n </DragHandleWrapper>\n );\n }\n);\n\nexport default InternalDragHandle;\n"]}
@@ -4,6 +4,7 @@ export interface DragHandleProps {
4
4
  variant?: DragHandleProps.Variant;
5
5
  size?: DragHandleProps.Size;
6
6
  ariaLabel?: string;
7
+ ariaLabelledBy?: string;
7
8
  ariaDescribedby?: string;
8
9
  ariaValue?: DragHandleProps.AriaValue;
9
10
  disabled?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/drag-handle/interfaces.ts"],"names":[],"mappings":";AAGA,OAAO,EACL,SAAS,IAAI,gBAAgB,EAC7B,cAAc,IAAI,qBAAqB,EACxC,MAAM,mCAAmC,CAAC;AAE3C,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,eAAe,CAAC,OAAO,CAAC;IAClC,IAAI,CAAC,EAAE,eAAe,CAAC,IAAI,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,eAAe,CAAC,SAAS,CAAC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,KAAK,CAAC,mBAAmB,CAAC;IAC1C,SAAS,CAAC,EAAE,KAAK,CAAC,oBAAoB,CAAC;IAEvC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,SAAS,EAAE,eAAe,CAAC,cAAc,CAAC,CAAC,CAAC;IACxF,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,eAAe,CAAC,SAAS,KAAK,IAAI,CAAC;CACnE;AAED,yBAAiB,eAAe,CAAC;IAC/B,KAAY,OAAO,GAAG,gBAAgB,GAAG,aAAa,GAAG,mBAAmB,GAAG,iBAAiB,CAAC;IAEjG,KAAY,SAAS,GAAG,gBAAgB,CAAC;IACzC,KAAY,cAAc,GAAG,qBAAqB,CA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iB,CAAC;IAEjG,KAAY,SAAS,GAAG,gBAAgB,CAAC;IACzC,KAAY,cAAc,GAAG,qBAAqB,CAAC;IAEnD,KAAY,IAAI,GAAG,OAAO,GAAG,QAAQ,CAAC;IAEtC,UAAiB,SAAS;QACxB,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;KAClB;IAED,UAAiB,GAAG;QAClB,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;KACrC;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../../src/internal/components/drag-handle/interfaces.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n Direction as WrapperDirection,\n DirectionState as WrapperDirectionState,\n} from '../drag-handle-wrapper/interfaces';\n\nexport interface DragHandleProps {\n variant?: DragHandleProps.Variant;\n size?: DragHandleProps.Size;\n ariaLabel?: string;\n ariaDescribedby?: string;\n ariaValue?: DragHandleProps.AriaValue;\n disabled?: boolean;\n className?: string;\n onPointerDown?: React.PointerEventHandler;\n onKeyDown?: React.KeyboardEventHandler;\n\n tooltipText?: string;\n directions?: Partial<Record<DragHandleProps.Direction, DragHandleProps.DirectionState>>;\n onDirectionClick?: (direction: DragHandleProps.Direction) => void;\n}\n\nexport namespace DragHandleProps {\n export type Variant = 'drag-indicator' | 'resize-area' | 'resize-horizontal' | 'resize-vertical';\n\n export type Direction = WrapperDirection;\n export type DirectionState = WrapperDirectionState;\n\n export type Size = 'small' | 'normal';\n\n export interface AriaValue {\n valueMin: number;\n valueMax: number;\n valueNow: number;\n }\n\n export interface Ref {\n focus(options?: FocusOptions): void;\n }\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../../src/internal/components/drag-handle/interfaces.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n Direction as WrapperDirection,\n DirectionState as WrapperDirectionState,\n} from '../drag-handle-wrapper/interfaces';\n\nexport interface DragHandleProps {\n variant?: DragHandleProps.Variant;\n size?: DragHandleProps.Size;\n ariaLabel?: string;\n ariaLabelledBy?: string;\n ariaDescribedby?: string;\n ariaValue?: DragHandleProps.AriaValue;\n disabled?: boolean;\n className?: string;\n onPointerDown?: React.PointerEventHandler;\n onKeyDown?: React.KeyboardEventHandler;\n\n tooltipText?: string;\n directions?: Partial<Record<DragHandleProps.Direction, DragHandleProps.DirectionState>>;\n onDirectionClick?: (direction: DragHandleProps.Direction) => void;\n}\n\nexport namespace DragHandleProps {\n export type Variant = 'drag-indicator' | 'resize-area' | 'resize-horizontal' | 'resize-vertical';\n\n export type Direction = WrapperDirection;\n export type DirectionState = WrapperDirectionState;\n\n export type Size = 'small' | 'normal';\n\n export interface AriaValue {\n valueMin: number;\n valueMax: number;\n valueNow: number;\n }\n\n export interface Ref {\n focus(options?: FocusOptions): void;\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
1
  export var PACKAGE_SOURCE = "components";
2
- export var PACKAGE_VERSION = "3.0.0 (4e31a2f5)";
2
+ export var PACKAGE_VERSION = "3.0.0 (9ea8f8d6)";
3
3
  export var THEME = "open-source-visual-refresh";
4
4
  export var ALWAYS_VISUAL_REFRESH = true;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "PACKAGE_SOURCE": "components",
3
- "PACKAGE_VERSION": "3.0.0 (4e31a2f5)",
3
+ "PACKAGE_VERSION": "3.0.0 (9ea8f8d6)",
4
4
  "THEME": "default",
5
5
  "ALWAYS_VISUAL_REFRESH": false
6
6
  }
@@ -6,5 +6,13 @@ export default class CopyToClipboardWrapper extends ComponentWrapper {
6
6
  findStatusText(options?: {
7
7
  popoverRenderWithPortal: boolean;
8
8
  }): null | ElementWrapper;
9
+ /**
10
+ * @deprecated Use `findDisplayedText` instead.
11
+ */
9
12
  findTextToCopy(): null | ElementWrapper;
13
+ /**
14
+ * Used to get the text displayed next to the copy icon button when `variant='inline'`.
15
+ * Returns either the `textToCopy` value or the `textToDisplay` value if it has been set.
16
+ */
17
+ findDisplayedText(): null | ElementWrapper;
10
18
  }
@@ -15,9 +15,19 @@ class CopyToClipboardWrapper extends dom_1.ComponentWrapper {
15
15
  renderWithPortal: options.popoverRenderWithPortal,
16
16
  });
17
17
  }
18
+ /**
19
+ * @deprecated Use `findDisplayedText` instead.
20
+ */
18
21
  findTextToCopy() {
19
22
  return this.findByClassName(styles_selectors_js_1.default['text-to-copy']);
20
23
  }
24
+ /**
25
+ * Used to get the text displayed next to the copy icon button when `variant='inline'`.
26
+ * Returns either the `textToCopy` value or the `textToDisplay` value if it has been set.
27
+ */
28
+ findDisplayedText() {
29
+ return this.findByClassName(styles_selectors_js_1.default['text-to-display']);
30
+ }
21
31
  }
22
32
  exports.default = CopyToClipboardWrapper;
23
33
  CopyToClipboardWrapper.rootSelector = styles_selectors_js_1.default.root;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/dom/copy-to-clipboard/index.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,gEAA0F;AAE1F,sCAAsC;AACtC,wCAAwC;AAExC,qGAAqF;AAErF,MAAqB,sBAAuB,SAAQ,sBAAgB;IAGlE,cAAc;QACZ,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,gBAAa,CAAC,YAAY,EAAE,EAAE,gBAAa,CAAE,CAAC;IAC9E,CAAC;IAED,cAAc,CAAC,OAAO,GAAG,EAAE,uBAAuB,EAAE,KAAK,EAAE;QACzD,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,iBAAc,CAAC,YAAY,EAAE,EAAE,iBAAc,CAAE,CAAC,WAAW,CAAC;YACxF,gBAAgB,EAAE,OAAO,CAAC,uBAAuB;SAClD,CAAC,CAAC;IACL,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAU,CAAC,cAAc,CAAC,CAAC,CAAC;IAC1D,CAAC;;AAfH,yCAgBC;AAfQ,mCAAY,GAAW,6BAAU,CAAC,IAAI,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/dom/copy-to-clipboard/index.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,gEAA0F;AAE1F,sCAAsC;AACtC,wCAAwC;AAExC,qGAAqF;AAErF,MAAqB,sBAAuB,SAAQ,sBAAgB;IAGlE,cAAc;QACZ,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,gBAAa,CAAC,YAAY,EAAE,EAAE,gBAAa,CAAE,CAAC;IAC9E,CAAC;IAED,cAAc,CAAC,OAAO,GAAG,EAAE,uBAAuB,EAAE,KAAK,EAAE;QACzD,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,iBAAc,CAAC,YAAY,EAAE,EAAE,iBAAc,CAAE,CAAC,WAAW,CAAC;YACxF,gBAAgB,EAAE,OAAO,CAAC,uBAAuB;SAClD,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,cAAc;QACZ,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAU,CAAC,cAAc,CAAC,CAAC,CAAC;IAC1D,CAAC;IAED;;;OAGG;IACH,iBAAiB;QACf,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAC7D,CAAC;;AA1BH,yCA2BC;AA1BQ,mCAAY,GAAW,6BAAU,CAAC,IAAI,CAAC"}
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
4
  // SPDX-License-Identifier: Apache-2.0
5
5
  const dom_1 = require("@cloudscape-design/test-utils-core/dom");
6
+ const index_1 = require("../index");
6
7
  const index_js_1 = require("../index.js");
7
8
  const styles_selectors_js_1 = require("../../../annotation-context/annotation/styles.selectors.js");
8
9
  const styles_selectors_js_2 = require("../../../hotspot/styles.selectors.js");
@@ -11,7 +12,7 @@ class HotspotWrapper extends dom_1.ComponentWrapper {
11
12
  return this.findByClassName(styles_selectors_js_1.default.hotspot);
12
13
  }
13
14
  findAnnotation() {
14
- return this.findComponent(`.${styles_selectors_js_1.default.annotation}`, index_js_1.AnnotationWrapper);
15
+ return (0, index_1.default)().findComponent(`.${styles_selectors_js_1.default.annotation}`, index_js_1.AnnotationWrapper);
15
16
  }
16
17
  }
17
18
  exports.default = HotspotWrapper;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/dom/hotspot/index.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,gEAA0F;AAE1F,0CAAgD;AAEhD,oGAA0F;AAC1F,8EAAiE;AAEjE,MAAqB,cAAe,SAAQ,sBAAgB;IAG1D,WAAW;QACT,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAgB,CAAC,OAAO,CAAE,CAAC;IACzD,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,6BAAgB,CAAC,UAAU,EAAE,EAAE,4BAAiB,CAAC,CAAC;IAClF,CAAC;;AATH,iCAUC;AATQ,2BAAY,GAAW,6BAAa,CAAC,IAAI,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/dom/hotspot/index.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,gEAA0F;AAE1F,oCAAqC;AACrC,0CAAgD;AAEhD,oGAA0F;AAC1F,8EAAiE;AAEjE,MAAqB,cAAe,SAAQ,sBAAgB;IAG1D,WAAW;QACT,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAgB,CAAC,OAAO,CAAE,CAAC;IACzD,CAAC;IAED,cAAc;QACZ,OAAO,IAAA,eAAa,GAAE,CAAC,aAAa,CAAC,IAAI,6BAAgB,CAAC,UAAU,EAAE,EAAE,4BAAiB,CAAE,CAAC;IAC9F,CAAC;;AATH,iCAUC;AATQ,2BAAY,GAAW,6BAAa,CAAC,IAAI,CAAC"}
@@ -6,5 +6,13 @@ export default class CopyToClipboardWrapper extends ComponentWrapper {
6
6
  findStatusText(options?: {
7
7
  popoverRenderWithPortal: boolean;
8
8
  }): ElementWrapper;
9
+ /**
10
+ * @deprecated Use `findDisplayedText` instead.
11
+ */
9
12
  findTextToCopy(): ElementWrapper;
13
+ /**
14
+ * Used to get the text displayed next to the copy icon button when `variant='inline'`.
15
+ * Returns either the `textToCopy` value or the `textToDisplay` value if it has been set.
16
+ */
17
+ findDisplayedText(): ElementWrapper;
10
18
  }
@@ -17,9 +17,19 @@ class CopyToClipboardWrapper extends selectors_1.ComponentWrapper {
17
17
  renderWithPortal: options.popoverRenderWithPortal
18
18
  });
19
19
  }
20
+ /**
21
+ * @deprecated Use `findDisplayedText` instead.
22
+ */
20
23
  findTextToCopy() {
21
24
  return this.findByClassName(styles_selectors_js_1.default['text-to-copy']);
22
25
  }
26
+ /**
27
+ * Used to get the text displayed next to the copy icon button when `variant='inline'`.
28
+ * Returns either the `textToCopy` value or the `textToDisplay` value if it has been set.
29
+ */
30
+ findDisplayedText() {
31
+ return this.findByClassName(styles_selectors_js_1.default['text-to-display']);
32
+ }
23
33
  }
24
34
  exports.default = CopyToClipboardWrapper;
25
35
  CopyToClipboardWrapper.rootSelector = styles_selectors_js_1.default.root;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/selectors/copy-to-clipboard/index.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,4EAAgG;AAChG,sCAAsC;AACtC,wCAAwC;AACxC,qGAAqF;AACrF,MAAqB,sBAAuB,SAAQ,4BAAgB;IAElE,cAAc;QACZ,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,gBAAa,CAAC,YAAY,EAAE,EAAE,gBAAa,CAAE,CAAC;IAC9E,CAAC;IACD,cAAc,CAAC,OAAO,GAAG;QACvB,uBAAuB,EAAE,KAAK;KAC/B;QACC,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,iBAAc,CAAC,YAAY,EAAE,EAAE,iBAAc,CAAE,CAAC,WAAW,CAAC;YACxF,gBAAgB,EAAE,OAAO,CAAC,uBAAuB;SAClD,CAAC,CAAC;IACL,CAAC;IACD,cAAc;QACZ,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAU,CAAC,cAAc,CAAC,CAAC,CAAC;IAC1D,CAAC;;AAdH,yCAeC;AAdQ,mCAAY,GAAW,6BAAU,CAAC,IAAI,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/selectors/copy-to-clipboard/index.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,4EAAgG;AAChG,sCAAsC;AACtC,wCAAwC;AACxC,qGAAqF;AACrF,MAAqB,sBAAuB,SAAQ,4BAAgB;IAElE,cAAc;QACZ,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,gBAAa,CAAC,YAAY,EAAE,EAAE,gBAAa,CAAE,CAAC;IAC9E,CAAC;IACD,cAAc,CAAC,OAAO,GAAG;QACvB,uBAAuB,EAAE,KAAK;KAC/B;QACC,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,iBAAc,CAAC,YAAY,EAAE,EAAE,iBAAc,CAAE,CAAC,WAAW,CAAC;YACxF,gBAAgB,EAAE,OAAO,CAAC,uBAAuB;SAClD,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,cAAc;QACZ,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAU,CAAC,cAAc,CAAC,CAAC,CAAC;IAC1D,CAAC;IAED;;;OAGG;IACH,iBAAiB;QACf,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAC7D,CAAC;;AA1BH,yCA2BC;AA1BQ,mCAAY,GAAW,6BAAU,CAAC,IAAI,CAAC"}
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
4
  // SPDX-License-Identifier: Apache-2.0
5
5
  const selectors_1 = require("@cloudscape-design/test-utils-core/selectors");
6
+ const index_1 = require("../index");
6
7
  const index_js_1 = require("../index.js");
7
8
  const styles_selectors_js_1 = require("../../../annotation-context/annotation/styles.selectors.js");
8
9
  const styles_selectors_js_2 = require("../../../hotspot/styles.selectors.js");
@@ -11,7 +12,7 @@ class HotspotWrapper extends selectors_1.ComponentWrapper {
11
12
  return this.findByClassName(styles_selectors_js_1.default.hotspot);
12
13
  }
13
14
  findAnnotation() {
14
- return this.findComponent(`.${styles_selectors_js_1.default.annotation}`, index_js_1.AnnotationWrapper);
15
+ return (0, index_1.default)().findComponent(`.${styles_selectors_js_1.default.annotation}`, index_js_1.AnnotationWrapper);
15
16
  }
16
17
  }
17
18
  exports.default = HotspotWrapper;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/selectors/hotspot/index.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,4EAAgG;AAChG,0CAAgD;AAChD,oGAA0F;AAC1F,8EAAiE;AACjE,MAAqB,cAAe,SAAQ,4BAAgB;IAE1D,WAAW;QACT,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAgB,CAAC,OAAO,CAAE,CAAC;IACzD,CAAC;IACD,cAAc;QACZ,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,6BAAgB,CAAC,UAAU,EAAE,EAAE,4BAAiB,CAAC,CAAC;IAClF,CAAC;;AAPH,iCAQC;AAPQ,2BAAY,GAAW,6BAAa,CAAC,IAAI,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/selectors/hotspot/index.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,4EAAgG;AAChG,oCAAqC;AACrC,0CAAgD;AAChD,oGAA0F;AAC1F,8EAAiE;AACjE,MAAqB,cAAe,SAAQ,4BAAgB;IAE1D,WAAW;QACT,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAgB,CAAC,OAAO,CAAE,CAAC;IACzD,CAAC;IACD,cAAc;QACZ,OAAO,IAAA,eAAa,GAAE,CAAC,aAAa,CAAC,IAAI,6BAAgB,CAAC,UAAU,EAAE,EAAE,4BAAiB,CAAE,CAAC;IAC9F,CAAC;;AAPH,iCAQC;AAPQ,2BAAY,GAAW,6BAAa,CAAC,IAAI,CAAC"}