@cloudscape-design/board-components 3.0.110 → 3.0.112

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 (51) hide show
  1. package/board/styles.css.js +5 -5
  2. package/board/styles.scoped.css +8 -8
  3. package/board/styles.selectors.js +5 -5
  4. package/board-item/interfaces.d.ts +4 -0
  5. package/board-item/interfaces.js.map +1 -1
  6. package/board-item/internal.d.ts +1 -1
  7. package/board-item/internal.js +18 -2
  8. package/board-item/internal.js.map +1 -1
  9. package/board-item/styles.css.js +11 -11
  10. package/board-item/styles.scoped.css +13 -15
  11. package/board-item/styles.selectors.js +11 -11
  12. package/internal/api-docs/components/board-item.js +11 -1
  13. package/internal/drag-handle/index.d.ts +7 -2
  14. package/internal/drag-handle/index.js +10 -4
  15. package/internal/drag-handle/index.js.map +1 -1
  16. package/internal/drag-handle/styles.css.js +2 -2
  17. package/internal/drag-handle/styles.scoped.css +13 -22
  18. package/internal/drag-handle/styles.selectors.js +2 -2
  19. package/internal/{handle → drag-handle/test-classes}/styles.css.js +1 -1
  20. package/internal/drag-handle/test-classes/styles.scoped.css +7 -0
  21. package/internal/{handle → drag-handle/test-classes}/styles.selectors.js +1 -1
  22. package/internal/environment.js +1 -1
  23. package/internal/environment.json +1 -1
  24. package/internal/generated/styles/tokens.js +222 -222
  25. package/internal/generated/theming/index.cjs +232 -232
  26. package/internal/generated/theming/index.cjs.d.ts +2 -2
  27. package/internal/generated/theming/index.d.ts +2 -2
  28. package/internal/generated/theming/index.js +232 -232
  29. package/internal/global-drag-state-styles/index.js +8 -3
  30. package/internal/global-drag-state-styles/index.js.map +1 -1
  31. package/internal/item-container/index.d.ts +67 -5
  32. package/internal/item-container/index.js +147 -118
  33. package/internal/item-container/index.js.map +1 -1
  34. package/internal/item-container/utils.d.ts +37 -0
  35. package/internal/item-container/utils.js +63 -0
  36. package/internal/item-container/utils.js.map +1 -0
  37. package/internal/manifest.json +1 -1
  38. package/internal/resize-handle/index.d.ts +6 -2
  39. package/internal/resize-handle/index.js +10 -4
  40. package/internal/resize-handle/index.js.map +1 -1
  41. package/internal/resize-handle/styles.css.js +2 -2
  42. package/internal/resize-handle/styles.scoped.css +13 -22
  43. package/internal/resize-handle/styles.selectors.js +2 -2
  44. package/internal/resize-handle/test-classes/styles.css.js +6 -0
  45. package/internal/resize-handle/test-classes/styles.scoped.css +7 -0
  46. package/internal/resize-handle/test-classes/styles.selectors.js +7 -0
  47. package/package.json +1 -1
  48. package/internal/handle/index.d.ts +0 -3
  49. package/internal/handle/index.js +0 -18
  50. package/internal/handle/index.js.map +0 -1
  51. package/internal/handle/styles.scoped.css +0 -15
@@ -1,10 +1,10 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "placeholder": "awsui_placeholder_1h7dk_13ms3_5",
5
- "placeholder--active": "awsui_placeholder--active_1h7dk_13ms3_9",
6
- "placeholder--hover": "awsui_placeholder--hover_1h7dk_13ms3_12",
7
- "root": "awsui_root_1h7dk_13ms3_16",
8
- "empty": "awsui_empty_1h7dk_13ms3_20"
4
+ "placeholder": "awsui_placeholder_1h7dk_1qq5q_5",
5
+ "placeholder--active": "awsui_placeholder--active_1h7dk_1qq5q_9",
6
+ "placeholder--hover": "awsui_placeholder--hover_1h7dk_1qq5q_12",
7
+ "root": "awsui_root_1h7dk_1qq5q_16",
8
+ "empty": "awsui_empty_1h7dk_1qq5q_20"
9
9
  };
10
10
 
@@ -2,28 +2,28 @@
2
2
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  SPDX-License-Identifier: Apache-2.0
4
4
  */
5
- .awsui_placeholder_1h7dk_13ms3_5:not(#\9) {
5
+ .awsui_placeholder_1h7dk_1qq5q_5:not(#\9) {
6
6
  border-radius: var(--border-radius-container-nsfwmm, 16px);
7
7
  block-size: 100%;
8
8
  }
9
- .awsui_placeholder--active_1h7dk_13ms3_9:not(#\9) {
10
- background-color: var(--color-board-placeholder-active-3nv7j5, #ebebf0);
9
+ .awsui_placeholder--active_1h7dk_1qq5q_9:not(#\9) {
10
+ background-color: var(--color-board-placeholder-active-x6yfem, #ebebf0);
11
11
  }
12
- .awsui_placeholder--hover_1h7dk_13ms3_12:not(#\9) {
13
- background-color: var(--color-board-placeholder-hover-1hv3br, #d1f1ff);
12
+ .awsui_placeholder--hover_1h7dk_1qq5q_12:not(#\9) {
13
+ background-color: var(--color-board-placeholder-hover-5nov9c, #d1f1ff);
14
14
  }
15
15
 
16
- .awsui_root_1h7dk_13ms3_16:not(#\9) {
16
+ .awsui_root_1h7dk_1qq5q_16:not(#\9) {
17
17
  /* used in test-utils */
18
18
  }
19
19
 
20
- .awsui_empty_1h7dk_13ms3_20:not(#\9) {
20
+ .awsui_empty_1h7dk_1qq5q_20:not(#\9) {
21
21
  box-sizing: border-box;
22
22
  inline-size: 100%;
23
23
  padding-block-start: var(--space-scaled-m-m892r9, 16px);
24
24
  padding-block-end: var(--space-scaled-l-sej05l, 20px);
25
25
  padding-inline: var(--space-scaled-l-sej05l, 20px);
26
- color: var(--color-text-empty-68xc4n, #656871);
26
+ color: var(--color-text-empty-tlohug, #656871);
27
27
  display: flex;
28
28
  justify-content: center;
29
29
  }
@@ -2,10 +2,10 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "placeholder": "awsui_placeholder_1h7dk_13ms3_5",
6
- "placeholder--active": "awsui_placeholder--active_1h7dk_13ms3_9",
7
- "placeholder--hover": "awsui_placeholder--hover_1h7dk_13ms3_12",
8
- "root": "awsui_root_1h7dk_13ms3_16",
9
- "empty": "awsui_empty_1h7dk_13ms3_20"
5
+ "placeholder": "awsui_placeholder_1h7dk_1qq5q_5",
6
+ "placeholder--active": "awsui_placeholder--active_1h7dk_1qq5q_9",
7
+ "placeholder--hover": "awsui_placeholder--hover_1h7dk_1qq5q_12",
8
+ "root": "awsui_root_1h7dk_1qq5q_16",
9
+ "empty": "awsui_empty_1h7dk_1qq5q_20"
10
10
  };
11
11
 
@@ -29,6 +29,8 @@ export interface BoardItemProps {
29
29
  * * `dragHandleAriaDescription` (string, optional) - the ARIA description for the drag handle.
30
30
  * * `resizeHandleAriaLabel` (string) - the ARIA label for the resize handle.
31
31
  * * `resizeHandleAriaDescription` (string, optional) - the ARIA description for the resize handle.
32
+ * * `dragHandleTooltipText` (string, optional) - the ARIA description for the resize handle.
33
+ * * `resizeHandleTooltipText` (string, optional) - the Text for the resize handle Tooltip.
32
34
  */
33
35
  i18nStrings: BoardItemProps.I18nStrings;
34
36
  }
@@ -38,5 +40,7 @@ export declare namespace BoardItemProps {
38
40
  dragHandleAriaDescription?: string;
39
41
  resizeHandleAriaLabel: string;
40
42
  resizeHandleAriaDescription?: string;
43
+ dragHandleTooltipText?: string;
44
+ resizeHandleTooltipText?: string;
41
45
  }
42
46
  }
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/board-item/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ReactNode } from \"react\";\n\nexport interface BoardItemProps {\n /**\n * Heading element of the item. Use the [header component](/components/header/).\n */\n header?: ReactNode;\n\n /**\n * Main content of the item.\n */\n children?: ReactNode;\n\n /**\n * Determines whether the main content of the item has padding. If `true`, removes the default padding\n * from the content area.\n */\n disableContentPaddings?: boolean;\n\n /**\n * Footer of the item.\n */\n footer?: ReactNode;\n\n /**\n * Additional slot next to the heading. Use it to render an overflow actions menu in the form of a button dropdown.\n */\n settings?: ReactNode;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n *\n * ARIA labels:\n * * `dragHandleAriaLabel` (string) - the ARIA label for the drag handle.\n * * `dragHandleAriaDescription` (string, optional) - the ARIA description for the drag handle.\n * * `resizeHandleAriaLabel` (string) - the ARIA label for the resize handle.\n * * `resizeHandleAriaDescription` (string, optional) - the ARIA description for the resize handle.\n */\n i18nStrings: BoardItemProps.I18nStrings;\n}\n\nexport namespace BoardItemProps {\n export interface I18nStrings {\n dragHandleAriaLabel: string;\n dragHandleAriaDescription?: string;\n resizeHandleAriaLabel: string;\n resizeHandleAriaDescription?: string;\n }\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/board-item/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ReactNode } from \"react\";\n\nexport interface BoardItemProps {\n /**\n * Heading element of the item. Use the [header component](/components/header/).\n */\n header?: ReactNode;\n\n /**\n * Main content of the item.\n */\n children?: ReactNode;\n\n /**\n * Determines whether the main content of the item has padding. If `true`, removes the default padding\n * from the content area.\n */\n disableContentPaddings?: boolean;\n\n /**\n * Footer of the item.\n */\n footer?: ReactNode;\n\n /**\n * Additional slot next to the heading. Use it to render an overflow actions menu in the form of a button dropdown.\n */\n settings?: ReactNode;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n *\n * ARIA labels:\n * * `dragHandleAriaLabel` (string) - the ARIA label for the drag handle.\n * * `dragHandleAriaDescription` (string, optional) - the ARIA description for the drag handle.\n * * `resizeHandleAriaLabel` (string) - the ARIA label for the resize handle.\n * * `resizeHandleAriaDescription` (string, optional) - the ARIA description for the resize handle.\n * * `dragHandleTooltipText` (string, optional) - the ARIA description for the resize handle.\n * * `resizeHandleTooltipText` (string, optional) - the Text for the resize handle Tooltip.\n */\n i18nStrings: BoardItemProps.I18nStrings;\n}\n\nexport namespace BoardItemProps {\n export interface I18nStrings {\n dragHandleAriaLabel: string;\n dragHandleAriaDescription?: string;\n resizeHandleAriaLabel: string;\n resizeHandleAriaDescription?: string;\n dragHandleTooltipText?: string;\n resizeHandleTooltipText?: string;\n }\n}\n"]}
@@ -1,3 +1,3 @@
1
1
  import { InternalBaseComponentProps } from "../internal/base-component/use-base-component";
2
2
  import type { BoardItemProps } from "./interfaces";
3
- export declare function InternalBoardItem({ children, header, settings, disableContentPaddings, footer, i18nStrings, __internalRootRef, ...rest }: BoardItemProps & InternalBaseComponentProps): import("react/jsx-runtime").JSX.Element;
3
+ export declare function InternalBoardItem({ children, header, settings, disableContentPaddings, footer, i18nStrings, __internalRootRef, ...rest }: BoardItemProps & InternalBaseComponentProps): import("react/jsx-runtime").JSX.Element | null;
@@ -11,12 +11,28 @@ import ResizeHandle from "../internal/resize-handle";
11
11
  import ScreenreaderOnly from "../internal/screenreader-only";
12
12
  import WidgetContainerHeader from "./header";
13
13
  import styles from "./styles.css.js";
14
+ const mapToKeyboardDirection = (direction) => {
15
+ const directionMap = {
16
+ "inline-start": "left",
17
+ "inline-end": "right",
18
+ "block-start": "up",
19
+ "block-end": "down",
20
+ };
21
+ return directionMap[direction];
22
+ };
14
23
  export function InternalBoardItem({ children, header, settings, disableContentPaddings, footer, i18nStrings, __internalRootRef, ...rest }) {
15
- const { dragHandle, resizeHandle, isActive } = useItemContext();
24
+ const { dragHandle, resizeHandle, isActive, isHidden } = useItemContext();
16
25
  const dragHandleAriaLabelledBy = useId();
17
26
  const dragHandleAriaDescribedBy = useId();
18
27
  const resizeHandleAriaLabelledBy = useId();
19
28
  const resizeHandleAriaDescribedBy = useId();
20
- return (_jsxs("div", { ref: __internalRootRef, className: styles.root, ...getDataAttributes(rest), children: [_jsx(Container, { fitHeight: true, disableHeaderPaddings: true, header: _jsx(WidgetContainerHeader, { handle: _jsx(DragHandle, { ref: dragHandle.ref, ariaLabelledBy: dragHandleAriaLabelledBy, ariaDescribedBy: dragHandleAriaDescribedBy, onPointerDown: dragHandle.onPointerDown, onKeyDown: dragHandle.onKeyDown, isActive: dragHandle.isActive }), settings: settings, children: header }), footer: footer, disableContentPaddings: disableContentPaddings, className: clsx(styles["container-override"], isActive && styles.active), children: children }), resizeHandle && (_jsx("div", { className: styles.resizer, children: _jsx(ResizeHandle, { ariaLabelledBy: resizeHandleAriaLabelledBy, ariaDescribedBy: resizeHandleAriaDescribedBy, onPointerDown: resizeHandle.onPointerDown, onKeyDown: resizeHandle.onKeyDown, isActive: resizeHandle.isActive }) })), _jsx(ScreenreaderOnly, { id: dragHandleAriaLabelledBy, children: i18nStrings.dragHandleAriaLabel }), _jsx(ScreenreaderOnly, { id: dragHandleAriaDescribedBy, children: i18nStrings.dragHandleAriaDescription }), _jsx(ScreenreaderOnly, { id: resizeHandleAriaLabelledBy, children: i18nStrings.resizeHandleAriaLabel }), _jsx(ScreenreaderOnly, { id: resizeHandleAriaDescribedBy, children: i18nStrings.resizeHandleAriaDescription })] }));
29
+ // A board item is hidden while moving a board item from the palette to the board via keyboard or UAP.
30
+ // The wrapping container is set to invisible, so we don't need to render anything.
31
+ if (isHidden) {
32
+ return null;
33
+ }
34
+ return (_jsxs("div", { ref: __internalRootRef, className: styles.root, ...getDataAttributes(rest), children: [_jsx(Container, { fitHeight: true, disableHeaderPaddings: true, header: _jsx(WidgetContainerHeader, { handle: _jsx(DragHandle, { ref: dragHandle.ref, ariaLabelledBy: dragHandleAriaLabelledBy, ariaDescribedBy: dragHandleAriaDescribedBy, onPointerDown: dragHandle.onPointerDown, onKeyDown: dragHandle.onKeyDown, activeState: dragHandle.activeState, initialShowButtons: dragHandle.initialShowButtons, onDirectionClick: (direction) => dragHandle.onDirectionClick(mapToKeyboardDirection(direction), "drag"), dragHandleTooltipText: i18nStrings.dragHandleTooltipText }), settings: settings, children: header }), footer: footer, disableContentPaddings: disableContentPaddings, className: clsx(styles["container-override"], isActive && styles.active), children: children }), resizeHandle && (_jsx("div", { className: styles.resizer, children: _jsx(ResizeHandle, { ariaLabelledBy: resizeHandleAriaLabelledBy, ariaDescribedBy: resizeHandleAriaDescribedBy, onPointerDown: resizeHandle.onPointerDown, onKeyDown: resizeHandle.onKeyDown, activeState: resizeHandle.activeState, onDirectionClick: (direction) => {
35
+ resizeHandle.onDirectionClick(mapToKeyboardDirection(direction), "resize");
36
+ }, resizeHandleTooltipText: i18nStrings.resizeHandleTooltipText }) })), _jsx(ScreenreaderOnly, { id: dragHandleAriaLabelledBy, children: i18nStrings.dragHandleAriaLabel }), _jsx(ScreenreaderOnly, { id: dragHandleAriaDescribedBy, children: i18nStrings.dragHandleAriaDescription }), _jsx(ScreenreaderOnly, { id: resizeHandleAriaLabelledBy, children: i18nStrings.resizeHandleAriaLabel }), _jsx(ScreenreaderOnly, { id: resizeHandleAriaDescribedBy, children: i18nStrings.resizeHandleAriaDescription })] }));
21
37
  }
22
38
  //# sourceMappingURL=internal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/board-item/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,SAAS,MAAM,yCAAyC,CAAC;AAEhE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AAEnF,OAAO,UAAU,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,YAAY,MAAM,2BAA2B,CAAC;AACrD,OAAO,gBAAgB,MAAM,+BAA+B,CAAC;AAC7D,OAAO,qBAAqB,MAAM,UAAU,CAAC;AAG7C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,MAAM,UAAU,iBAAiB,CAAC,EAChC,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,sBAAsB,EACtB,MAAM,EACN,WAAW,EACX,iBAAiB,EACjB,GAAG,IAAI,EACqC;IAC5C,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,cAAc,EAAE,CAAC;IAEhE,MAAM,wBAAwB,GAAG,KAAK,EAAE,CAAC;IACzC,MAAM,yBAAyB,GAAG,KAAK,EAAE,CAAC;IAE1C,MAAM,0BAA0B,GAAG,KAAK,EAAE,CAAC;IAC3C,MAAM,2BAA2B,GAAG,KAAK,EAAE,CAAC;IAE5C,OAAO,CACL,eAAK,GAAG,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,CAAC,IAAI,KAAM,iBAAiB,CAAC,IAAI,CAAC,aAC9E,KAAC,SAAS,IACR,SAAS,EAAE,IAAI,EACf,qBAAqB,EAAE,IAAI,EAC3B,MAAM,EACJ,KAAC,qBAAqB,IACpB,MAAM,EACJ,KAAC,UAAU,IACT,GAAG,EAAE,UAAU,CAAC,GAAG,EACnB,cAAc,EAAE,wBAAwB,EACxC,eAAe,EAAE,yBAAyB,EAC1C,aAAa,EAAE,UAAU,CAAC,aAAa,EACvC,SAAS,EAAE,UAAU,CAAC,SAAS,EAC/B,QAAQ,EAAE,UAAU,CAAC,QAAQ,GAC7B,EAEJ,QAAQ,EAAE,QAAQ,YAEjB,MAAM,GACe,EAE1B,MAAM,EAAE,MAAM,EACd,sBAAsB,EAAE,sBAAsB,EAC9C,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC,EAAE,QAAQ,IAAI,MAAM,CAAC,MAAM,CAAC,YAEvE,QAAQ,GACC,EACX,YAAY,IAAI,CACf,cAAK,SAAS,EAAE,MAAM,CAAC,OAAO,YAC5B,KAAC,YAAY,IACX,cAAc,EAAE,0BAA0B,EAC1C,eAAe,EAAE,2BAA2B,EAC5C,aAAa,EAAE,YAAY,CAAC,aAAa,EACzC,SAAS,EAAE,YAAY,CAAC,SAAS,EACjC,QAAQ,EAAE,YAAY,CAAC,QAAQ,GAC/B,GACE,CACP,EAED,KAAC,gBAAgB,IAAC,EAAE,EAAE,wBAAwB,YAAG,WAAW,CAAC,mBAAmB,GAAoB,EACpG,KAAC,gBAAgB,IAAC,EAAE,EAAE,yBAAyB,YAAG,WAAW,CAAC,yBAAyB,GAAoB,EAE3G,KAAC,gBAAgB,IAAC,EAAE,EAAE,0BAA0B,YAAG,WAAW,CAAC,qBAAqB,GAAoB,EACxG,KAAC,gBAAgB,IAAC,EAAE,EAAE,2BAA2B,YAAG,WAAW,CAAC,2BAA2B,GAAoB,IAC3G,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useId } from \"react\";\nimport clsx from \"clsx\";\n\nimport Container from \"@cloudscape-design/components/container\";\n\nimport { getDataAttributes } from \"../internal/base-component/get-data-attributes\";\nimport { InternalBaseComponentProps } from \"../internal/base-component/use-base-component\";\nimport DragHandle from \"../internal/drag-handle\";\nimport { useItemContext } from \"../internal/item-container\";\nimport ResizeHandle from \"../internal/resize-handle\";\nimport ScreenreaderOnly from \"../internal/screenreader-only\";\nimport WidgetContainerHeader from \"./header\";\nimport type { BoardItemProps } from \"./interfaces\";\n\nimport styles from \"./styles.css.js\";\n\nexport function InternalBoardItem({\n children,\n header,\n settings,\n disableContentPaddings,\n footer,\n i18nStrings,\n __internalRootRef,\n ...rest\n}: BoardItemProps & InternalBaseComponentProps) {\n const { dragHandle, resizeHandle, isActive } = useItemContext();\n\n const dragHandleAriaLabelledBy = useId();\n const dragHandleAriaDescribedBy = useId();\n\n const resizeHandleAriaLabelledBy = useId();\n const resizeHandleAriaDescribedBy = useId();\n\n return (\n <div ref={__internalRootRef} className={styles.root} {...getDataAttributes(rest)}>\n <Container\n fitHeight={true}\n disableHeaderPaddings={true}\n header={\n <WidgetContainerHeader\n handle={\n <DragHandle\n ref={dragHandle.ref}\n ariaLabelledBy={dragHandleAriaLabelledBy}\n ariaDescribedBy={dragHandleAriaDescribedBy}\n onPointerDown={dragHandle.onPointerDown}\n onKeyDown={dragHandle.onKeyDown}\n isActive={dragHandle.isActive}\n />\n }\n settings={settings}\n >\n {header}\n </WidgetContainerHeader>\n }\n footer={footer}\n disableContentPaddings={disableContentPaddings}\n className={clsx(styles[\"container-override\"], isActive && styles.active)}\n >\n {children}\n </Container>\n {resizeHandle && (\n <div className={styles.resizer}>\n <ResizeHandle\n ariaLabelledBy={resizeHandleAriaLabelledBy}\n ariaDescribedBy={resizeHandleAriaDescribedBy}\n onPointerDown={resizeHandle.onPointerDown}\n onKeyDown={resizeHandle.onKeyDown}\n isActive={resizeHandle.isActive}\n />\n </div>\n )}\n\n <ScreenreaderOnly id={dragHandleAriaLabelledBy}>{i18nStrings.dragHandleAriaLabel}</ScreenreaderOnly>\n <ScreenreaderOnly id={dragHandleAriaDescribedBy}>{i18nStrings.dragHandleAriaDescription}</ScreenreaderOnly>\n\n <ScreenreaderOnly id={resizeHandleAriaLabelledBy}>{i18nStrings.resizeHandleAriaLabel}</ScreenreaderOnly>\n <ScreenreaderOnly id={resizeHandleAriaDescribedBy}>{i18nStrings.resizeHandleAriaDescription}</ScreenreaderOnly>\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/board-item/internal.tsx"],"names":[],"mappings":"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","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useId } from \"react\";\nimport clsx from \"clsx\";\n\nimport Container from \"@cloudscape-design/components/container\";\nimport { InternalDragHandleProps } from \"@cloudscape-design/components/internal/do-not-use/drag-handle\";\n\nimport { getDataAttributes } from \"../internal/base-component/get-data-attributes\";\nimport { InternalBaseComponentProps } from \"../internal/base-component/use-base-component\";\nimport DragHandle from \"../internal/drag-handle\";\nimport { Direction } from \"../internal/interfaces\";\nimport { useItemContext } from \"../internal/item-container\";\nimport ResizeHandle from \"../internal/resize-handle\";\nimport ScreenreaderOnly from \"../internal/screenreader-only\";\nimport WidgetContainerHeader from \"./header\";\nimport type { BoardItemProps } from \"./interfaces\";\n\nimport styles from \"./styles.css.js\";\n\nconst mapToKeyboardDirection = (direction: InternalDragHandleProps.Direction) => {\n const directionMap: Record<InternalDragHandleProps.Direction, Direction> = {\n \"inline-start\": \"left\",\n \"inline-end\": \"right\",\n \"block-start\": \"up\",\n \"block-end\": \"down\",\n };\n return directionMap[direction];\n};\n\nexport function InternalBoardItem({\n children,\n header,\n settings,\n disableContentPaddings,\n footer,\n i18nStrings,\n __internalRootRef,\n ...rest\n}: BoardItemProps & InternalBaseComponentProps) {\n const { dragHandle, resizeHandle, isActive, isHidden } = useItemContext();\n\n const dragHandleAriaLabelledBy = useId();\n const dragHandleAriaDescribedBy = useId();\n\n const resizeHandleAriaLabelledBy = useId();\n const resizeHandleAriaDescribedBy = useId();\n\n // A board item is hidden while moving a board item from the palette to the board via keyboard or UAP.\n // The wrapping container is set to invisible, so we don't need to render anything.\n if (isHidden) {\n return null;\n }\n\n return (\n <div ref={__internalRootRef} className={styles.root} {...getDataAttributes(rest)}>\n <Container\n fitHeight={true}\n disableHeaderPaddings={true}\n header={\n <WidgetContainerHeader\n handle={\n <DragHandle\n ref={dragHandle.ref}\n ariaLabelledBy={dragHandleAriaLabelledBy}\n ariaDescribedBy={dragHandleAriaDescribedBy}\n onPointerDown={dragHandle.onPointerDown}\n onKeyDown={dragHandle.onKeyDown}\n activeState={dragHandle.activeState}\n initialShowButtons={dragHandle.initialShowButtons}\n onDirectionClick={(direction) => dragHandle.onDirectionClick(mapToKeyboardDirection(direction), \"drag\")}\n dragHandleTooltipText={i18nStrings.dragHandleTooltipText}\n />\n }\n settings={settings}\n >\n {header}\n </WidgetContainerHeader>\n }\n footer={footer}\n disableContentPaddings={disableContentPaddings}\n className={clsx(styles[\"container-override\"], isActive && styles.active)}\n >\n {children}\n </Container>\n {resizeHandle && (\n <div className={styles.resizer}>\n <ResizeHandle\n ariaLabelledBy={resizeHandleAriaLabelledBy}\n ariaDescribedBy={resizeHandleAriaDescribedBy}\n onPointerDown={resizeHandle.onPointerDown}\n onKeyDown={resizeHandle.onKeyDown}\n activeState={resizeHandle.activeState}\n onDirectionClick={(direction) => {\n resizeHandle.onDirectionClick(mapToKeyboardDirection(direction), \"resize\");\n }}\n resizeHandleTooltipText={i18nStrings.resizeHandleTooltipText}\n />\n </div>\n )}\n\n <ScreenreaderOnly id={dragHandleAriaLabelledBy}>{i18nStrings.dragHandleAriaLabel}</ScreenreaderOnly>\n <ScreenreaderOnly id={dragHandleAriaDescribedBy}>{i18nStrings.dragHandleAriaDescription}</ScreenreaderOnly>\n\n <ScreenreaderOnly id={resizeHandleAriaLabelledBy}>{i18nStrings.resizeHandleAriaLabel}</ScreenreaderOnly>\n <ScreenreaderOnly id={resizeHandleAriaDescribedBy}>{i18nStrings.resizeHandleAriaDescription}</ScreenreaderOnly>\n </div>\n );\n}\n"]}
@@ -1,16 +1,16 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "root": "awsui_root_9ckv7_1kyj0_9",
5
- "container-override": "awsui_container-override_9ckv7_1kyj0_14",
6
- "active": "awsui_active_9ckv7_1kyj0_14",
7
- "header": "awsui_header_9ckv7_1kyj0_36",
8
- "flexible": "awsui_flexible_9ckv7_1kyj0_43",
9
- "handle": "awsui_handle_9ckv7_1kyj0_47",
10
- "refresh": "awsui_refresh_9ckv7_1kyj0_50",
11
- "header-content": "awsui_header-content_9ckv7_1kyj0_54",
12
- "settings": "awsui_settings_9ckv7_1kyj0_58",
13
- "fixed": "awsui_fixed_9ckv7_1kyj0_66",
14
- "resizer": "awsui_resizer_9ckv7_1kyj0_70"
4
+ "root": "awsui_root_9ckv7_m9g0k_9",
5
+ "container-override": "awsui_container-override_9ckv7_m9g0k_14",
6
+ "active": "awsui_active_9ckv7_m9g0k_14",
7
+ "header": "awsui_header_9ckv7_m9g0k_34",
8
+ "flexible": "awsui_flexible_9ckv7_m9g0k_41",
9
+ "handle": "awsui_handle_9ckv7_m9g0k_45",
10
+ "refresh": "awsui_refresh_9ckv7_m9g0k_48",
11
+ "header-content": "awsui_header-content_9ckv7_m9g0k_52",
12
+ "settings": "awsui_settings_9ckv7_m9g0k_56",
13
+ "fixed": "awsui_fixed_9ckv7_m9g0k_64",
14
+ "resizer": "awsui_resizer_9ckv7_m9g0k_68"
15
15
  };
16
16
 
@@ -6,21 +6,19 @@
6
6
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
7
7
  SPDX-License-Identifier: Apache-2.0
8
8
  */
9
- .awsui_root_9ckv7_1kyj0_9:not(#\9) {
9
+ .awsui_root_9ckv7_m9g0k_9:not(#\9) {
10
10
  display: contents;
11
11
  }
12
12
 
13
13
  /* TODO: use container API instead of styles override */
14
- .awsui_container-override_9ckv7_1kyj0_14.awsui_active_9ckv7_1kyj0_14:not(#\9) {
14
+ .awsui_container-override_9ckv7_m9g0k_14.awsui_active_9ckv7_m9g0k_14:not(#\9) {
15
15
  box-shadow: var(--shadow-container-active-ypjjoc, 0px 1px 1px 1px #e9ebed, 0px 6px 36px rgba(0, 7, 22, 0.1019607843));
16
- }
17
- [data-awsui-focus-visible] .awsui_container-override_9ckv7_1kyj0_14.awsui_active_9ckv7_1kyj0_14:not(#\9) {
18
16
  position: relative;
19
17
  box-sizing: border-box;
20
18
  outline: 2px dotted transparent;
21
19
  outline-offset: -1px;
22
20
  }
23
- [data-awsui-focus-visible] .awsui_container-override_9ckv7_1kyj0_14.awsui_active_9ckv7_1kyj0_14:not(#\9)::before {
21
+ .awsui_container-override_9ckv7_m9g0k_14.awsui_active_9ckv7_m9g0k_14:not(#\9)::before {
24
22
  content: " ";
25
23
  display: block;
26
24
  position: absolute;
@@ -30,44 +28,44 @@
30
28
  inline-size: calc(100% + 2 * 0px);
31
29
  block-size: calc(100% + 2 * 0px);
32
30
  border-radius: var(--border-radius-container-nsfwmm, 16px);
33
- border: 2px solid var(--color-border-item-focused-8bi903, #006ce0);
31
+ border: 2px solid var(--color-border-item-focused-uk47pl, #006ce0);
34
32
  }
35
33
 
36
- .awsui_header_9ckv7_1kyj0_36:not(#\9) {
34
+ .awsui_header_9ckv7_m9g0k_34:not(#\9) {
37
35
  display: flex;
38
36
  justify-items: center;
39
37
  padding-block: var(--space-scaled-s-8ozaad, 12px);
40
38
  padding-inline: calc(var(--space-container-horizontal-nqrzyh, 20px) - var(--space-scaled-xs-xwoogq, 8px));
41
39
  }
42
40
 
43
- .awsui_flexible_9ckv7_1kyj0_43:not(#\9) {
41
+ .awsui_flexible_9ckv7_m9g0k_41:not(#\9) {
44
42
  flex: 1 1 min-content;
45
43
  }
46
44
 
47
- .awsui_handle_9ckv7_1kyj0_47:not(#\9) {
45
+ .awsui_handle_9ckv7_m9g0k_45:not(#\9) {
48
46
  margin-block-start: calc(var(--space-scaled-xxs-pfm1nx, 4px) + 1px);
49
47
  }
50
- .awsui_refresh_9ckv7_1kyj0_50 > .awsui_handle_9ckv7_1kyj0_47:not(#\9) {
48
+ .awsui_refresh_9ckv7_m9g0k_48 > .awsui_handle_9ckv7_m9g0k_45:not(#\9) {
51
49
  margin-block-start: calc(var(--space-static-xxxs-yidks1, 2px) + 1px);
52
50
  }
53
51
 
54
- .awsui_header-content_9ckv7_1kyj0_54:not(#\9) {
52
+ .awsui_header-content_9ckv7_m9g0k_52:not(#\9) {
55
53
  margin-inline-start: var(--space-scaled-xxs-pfm1nx, 4px);
56
54
  }
57
55
 
58
- .awsui_settings_9ckv7_1kyj0_58:not(#\9) {
56
+ .awsui_settings_9ckv7_m9g0k_56:not(#\9) {
59
57
  margin-block-start: calc(var(--space-scaled-xxxs-oo06c7, 2px) + 1px);
60
58
  margin-inline-start: var(--space-static-xs-gnm0mz, 8px);
61
59
  }
62
- .awsui_refresh_9ckv7_1kyj0_50 > .awsui_settings_9ckv7_1kyj0_58:not(#\9) {
60
+ .awsui_refresh_9ckv7_m9g0k_48 > .awsui_settings_9ckv7_m9g0k_56:not(#\9) {
63
61
  margin-block-start: 0px;
64
62
  }
65
63
 
66
- .awsui_fixed_9ckv7_1kyj0_66:not(#\9) {
64
+ .awsui_fixed_9ckv7_m9g0k_64:not(#\9) {
67
65
  flex: 0 0 auto;
68
66
  }
69
67
 
70
- .awsui_resizer_9ckv7_1kyj0_70:not(#\9) {
68
+ .awsui_resizer_9ckv7_m9g0k_68:not(#\9) {
71
69
  position: absolute;
72
70
  inset-block-end: calc(var(--space-static-xs-gnm0mz, 8px) - var(--space-static-xxxs-yidks1, 2px));
73
71
  inset-inline-end: calc(var(--space-static-xs-gnm0mz, 8px) - var(--space-static-xxxs-yidks1, 2px));
@@ -2,16 +2,16 @@
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_9ckv7_1kyj0_9",
6
- "container-override": "awsui_container-override_9ckv7_1kyj0_14",
7
- "active": "awsui_active_9ckv7_1kyj0_14",
8
- "header": "awsui_header_9ckv7_1kyj0_36",
9
- "flexible": "awsui_flexible_9ckv7_1kyj0_43",
10
- "handle": "awsui_handle_9ckv7_1kyj0_47",
11
- "refresh": "awsui_refresh_9ckv7_1kyj0_50",
12
- "header-content": "awsui_header-content_9ckv7_1kyj0_54",
13
- "settings": "awsui_settings_9ckv7_1kyj0_58",
14
- "fixed": "awsui_fixed_9ckv7_1kyj0_66",
15
- "resizer": "awsui_resizer_9ckv7_1kyj0_70"
5
+ "root": "awsui_root_9ckv7_m9g0k_9",
6
+ "container-override": "awsui_container-override_9ckv7_m9g0k_14",
7
+ "active": "awsui_active_9ckv7_m9g0k_14",
8
+ "header": "awsui_header_9ckv7_m9g0k_34",
9
+ "flexible": "awsui_flexible_9ckv7_m9g0k_41",
10
+ "handle": "awsui_handle_9ckv7_m9g0k_45",
11
+ "refresh": "awsui_refresh_9ckv7_m9g0k_48",
12
+ "header-content": "awsui_header-content_9ckv7_m9g0k_52",
13
+ "settings": "awsui_settings_9ckv7_m9g0k_56",
14
+ "fixed": "awsui_fixed_9ckv7_m9g0k_64",
15
+ "resizer": "awsui_resizer_9ckv7_m9g0k_68"
16
16
  };
17
17
 
@@ -49,6 +49,11 @@ module.exports = {
49
49
  "type": "string",
50
50
  "optional": false
51
51
  },
52
+ {
53
+ "name": "dragHandleTooltipText",
54
+ "type": "string",
55
+ "optional": true
56
+ },
52
57
  {
53
58
  "name": "resizeHandleAriaDescription",
54
59
  "type": "string",
@@ -58,11 +63,16 @@ module.exports = {
58
63
  "name": "resizeHandleAriaLabel",
59
64
  "type": "string",
60
65
  "optional": false
66
+ },
67
+ {
68
+ "name": "resizeHandleTooltipText",
69
+ "type": "string",
70
+ "optional": true
61
71
  }
62
72
  ]
63
73
  },
64
74
  "optional": false,
65
- "description": "An object containing all the necessary localized strings required by the component.\n\nARIA labels:\n* `dragHandleAriaLabel` (string) - the ARIA label for the drag handle.\n* `dragHandleAriaDescription` (string, optional) - the ARIA description for the drag handle.\n* `resizeHandleAriaLabel` (string) - the ARIA label for the resize handle.\n* `resizeHandleAriaDescription` (string, optional) - the ARIA description for the resize handle."
75
+ "description": "An object containing all the necessary localized strings required by the component.\n\nARIA labels:\n* `dragHandleAriaLabel` (string) - the ARIA label for the drag handle.\n* `dragHandleAriaDescription` (string, optional) - the ARIA description for the drag handle.\n* `resizeHandleAriaLabel` (string) - the ARIA label for the resize handle.\n* `resizeHandleAriaDescription` (string, optional) - the ARIA description for the resize handle.\n* `dragHandleTooltipText` (string, optional) - the ARIA description for the resize handle.\n* `resizeHandleTooltipText` (string, optional) - the Text for the resize handle Tooltip."
66
76
  }
67
77
  ],
68
78
  "events": []
@@ -1,10 +1,15 @@
1
1
  import { KeyboardEvent, PointerEvent } from "react";
2
+ import { InternalDragHandleProps } from "@cloudscape-design/components/internal/do-not-use/drag-handle";
3
+ import { HandleActiveState } from "../item-container";
2
4
  export interface DragHandleProps {
3
5
  ariaLabelledBy: string;
4
6
  ariaDescribedBy: string;
5
7
  onPointerDown: (event: PointerEvent) => void;
6
8
  onKeyDown: (event: KeyboardEvent) => void;
7
- isActive: boolean;
9
+ activeState: HandleActiveState;
10
+ initialShowButtons?: boolean;
11
+ onDirectionClick: InternalDragHandleProps["onDirectionClick"];
12
+ dragHandleTooltipText?: string;
8
13
  }
9
- declare const _default: import("react").ForwardRefExoticComponent<DragHandleProps & import("react").RefAttributes<HTMLButtonElement>>;
14
+ declare const _default: import("react").ForwardRefExoticComponent<DragHandleProps & import("react").RefAttributes<HTMLDivElement>>;
10
15
  export default _default;
@@ -3,11 +3,17 @@ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  import { forwardRef } from "react";
5
5
  import clsx from "clsx";
6
- import Icon from "@cloudscape-design/components/icon";
7
- import Handle from "../handle";
6
+ import { InternalDragHandle, } from "@cloudscape-design/components/internal/do-not-use/drag-handle";
7
+ import { CLICK_DRAG_THRESHOLD } from "../item-container";
8
8
  import styles from "./styles.css.js";
9
- function DragHandle({ ariaLabelledBy, ariaDescribedBy, onPointerDown, onKeyDown, isActive }, ref) {
10
- return (_jsx(Handle, { ref: ref, className: clsx(styles.handle, isActive && styles.active), "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, onPointerDown: onPointerDown, onKeyDown: onKeyDown, children: _jsx(Icon, { name: "drag-indicator" }) }));
9
+ import testUtilsStyles from "./test-classes/styles.css.js";
10
+ function DragHandle({ ariaLabelledBy, ariaDescribedBy, onPointerDown, onKeyDown, activeState, initialShowButtons, onDirectionClick, dragHandleTooltipText, }, ref) {
11
+ return (_jsx(InternalDragHandle, { ref: ref, className: clsx(styles.handle, activeState === "pointer" && styles.active, activeState === "uap" && testUtilsStyles["active-uap"]), ariaLabelledBy: ariaLabelledBy, ariaDescribedby: ariaDescribedBy, variant: "drag-indicator", tooltipText: dragHandleTooltipText, onKeyDown: onKeyDown, onPointerDown: onPointerDown, directions: {
12
+ "block-start": "active",
13
+ "block-end": "active",
14
+ "inline-start": "active",
15
+ "inline-end": "active",
16
+ }, triggerMode: "keyboard-activate", onDirectionClick: onDirectionClick, initialShowButtons: initialShowButtons, hideButtonsOnDrag: true, clickDragThreshold: CLICK_DRAG_THRESHOLD }));
11
17
  }
12
18
  export default forwardRef(DragHandle);
13
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/internal/drag-handle/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAgB,UAAU,EAA+B,MAAM,OAAO,CAAC;AAC9E,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,IAAI,MAAM,oCAAoC,CAAC;AAEtD,OAAO,MAAM,MAAM,WAAW,CAAC;AAE/B,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAUrC,SAAS,UAAU,CACjB,EAAE,cAAc,EAAE,eAAe,EAAE,aAAa,EAAE,SAAS,EAAE,QAAQ,EAAmB,EACxF,GAAoC;IAEpC,OAAO,CACL,KAAC,MAAM,IACL,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,IAAI,MAAM,CAAC,MAAM,CAAC,qBACxC,cAAc,sBACb,eAAe,EACjC,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,SAAS,YAEpB,KAAC,IAAI,IAAC,IAAI,EAAC,gBAAgB,GAAG,GACvB,CACV,CAAC;AACJ,CAAC;AAED,eAAe,UAAU,CAAC,UAAU,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ForwardedRef, forwardRef, KeyboardEvent, PointerEvent } from \"react\";\nimport clsx from \"clsx\";\n\nimport Icon from \"@cloudscape-design/components/icon\";\n\nimport Handle from \"../handle\";\n\nimport styles from \"./styles.css.js\";\n\nexport interface DragHandleProps {\n ariaLabelledBy: string;\n ariaDescribedBy: string;\n onPointerDown: (event: PointerEvent) => void;\n onKeyDown: (event: KeyboardEvent) => void;\n isActive: boolean;\n}\n\nfunction DragHandle(\n { ariaLabelledBy, ariaDescribedBy, onPointerDown, onKeyDown, isActive }: DragHandleProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) {\n return (\n <Handle\n ref={ref}\n className={clsx(styles.handle, isActive && styles.active)}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n onPointerDown={onPointerDown}\n onKeyDown={onKeyDown}\n >\n <Icon name=\"drag-indicator\" />\n </Handle>\n );\n}\n\nexport default forwardRef(DragHandle);\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/internal/drag-handle/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAgB,UAAU,EAA+B,MAAM,OAAO,CAAC;AAC9E,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EACL,kBAAkB,GAEnB,MAAM,+DAA+D,CAAC;AAEvE,OAAO,EAAE,oBAAoB,EAAqB,MAAM,mBAAmB,CAAC;AAE5E,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAa3D,SAAS,UAAU,CACjB,EACE,cAAc,EACd,eAAe,EACf,aAAa,EACb,SAAS,EACT,WAAW,EACX,kBAAkB,EAClB,gBAAgB,EAChB,qBAAqB,GACL,EAClB,GAAiC;IAEjC,OAAO,CACL,KAAC,kBAAkB,IACjB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,MAAM,EACb,WAAW,KAAK,SAAS,IAAI,MAAM,CAAC,MAAM,EAC1C,WAAW,KAAK,KAAK,IAAI,eAAe,CAAC,YAAY,CAAC,CACvD,EACD,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,eAAe,EAChC,OAAO,EAAC,gBAAgB,EACxB,WAAW,EAAE,qBAAqB,EAClC,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,aAAa,EAC5B,UAAU,EAAE;YACV,aAAa,EAAE,QAAQ;YACvB,WAAW,EAAE,QAAQ;YACrB,cAAc,EAAE,QAAQ;YACxB,YAAY,EAAE,QAAQ;SACvB,EACD,WAAW,EAAC,mBAAmB,EAC/B,gBAAgB,EAAE,gBAAgB,EAClC,kBAAkB,EAAE,kBAAkB,EACtC,iBAAiB,EAAE,IAAI,EACvB,kBAAkB,EAAE,oBAAoB,GACxC,CACH,CAAC;AACJ,CAAC;AAED,eAAe,UAAU,CAAC,UAAU,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ForwardedRef, forwardRef, KeyboardEvent, PointerEvent } from \"react\";\nimport clsx from \"clsx\";\n\nimport {\n InternalDragHandle,\n InternalDragHandleProps,\n} from \"@cloudscape-design/components/internal/do-not-use/drag-handle\";\n\nimport { CLICK_DRAG_THRESHOLD, HandleActiveState } from \"../item-container\";\n\nimport styles from \"./styles.css.js\";\nimport testUtilsStyles from \"./test-classes/styles.css.js\";\n\nexport interface DragHandleProps {\n ariaLabelledBy: string;\n ariaDescribedBy: string;\n onPointerDown: (event: PointerEvent) => void;\n onKeyDown: (event: KeyboardEvent) => void;\n activeState: HandleActiveState;\n initialShowButtons?: boolean;\n onDirectionClick: InternalDragHandleProps[\"onDirectionClick\"];\n dragHandleTooltipText?: string;\n}\n\nfunction DragHandle(\n {\n ariaLabelledBy,\n ariaDescribedBy,\n onPointerDown,\n onKeyDown,\n activeState,\n initialShowButtons,\n onDirectionClick,\n dragHandleTooltipText,\n }: DragHandleProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n return (\n <InternalDragHandle\n ref={ref}\n className={clsx(\n styles.handle,\n activeState === \"pointer\" && styles.active,\n activeState === \"uap\" && testUtilsStyles[\"active-uap\"],\n )}\n ariaLabelledBy={ariaLabelledBy}\n ariaDescribedby={ariaDescribedBy}\n variant=\"drag-indicator\"\n tooltipText={dragHandleTooltipText}\n onKeyDown={onKeyDown}\n onPointerDown={onPointerDown}\n directions={{\n \"block-start\": \"active\",\n \"block-end\": \"active\",\n \"inline-start\": \"active\",\n \"inline-end\": \"active\",\n }}\n triggerMode=\"keyboard-activate\"\n onDirectionClick={onDirectionClick}\n initialShowButtons={initialShowButtons}\n hideButtonsOnDrag={true}\n clickDragThreshold={CLICK_DRAG_THRESHOLD}\n />\n );\n}\n\nexport default forwardRef(DragHandle);\n"]}
@@ -1,7 +1,7 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "handle": "awsui_handle_umbhe_10muf_9",
5
- "active": "awsui_active_umbhe_10muf_17"
4
+ "handle": "awsui_handle_umbhe_1bpr9_9",
5
+ "active": "awsui_active_umbhe_1bpr9_27"
6
6
  };
7
7
 
@@ -6,33 +6,24 @@
6
6
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
7
7
  SPDX-License-Identifier: Apache-2.0
8
8
  */
9
- .awsui_handle_umbhe_10muf_9:not(#\9) {
9
+ .awsui_handle_umbhe_1bpr9_9:not(#\9) {
10
10
  cursor: grab;
11
+ appearance: none;
12
+ background: transparent;
13
+ border: none;
14
+ padding-block: var(--space-scaled-xxs-pfm1nx, 4px);
15
+ padding-inline: var(--space-scaled-xxs-pfm1nx, 4px);
16
+ block-size: auto;
17
+ color: var(--color-text-interactive-default-ugh9wp, #424650);
11
18
  }
12
-
13
- .awsui_handle_umbhe_10muf_9:not(#\9):active {
14
- cursor: grabbing;
19
+ .awsui_handle_umbhe_1bpr9_9:not(#\9):hover {
20
+ color: var(--color-text-interactive-hover-6naf7i, #0f141a);
15
21
  }
16
22
 
17
- .awsui_handle_umbhe_10muf_9:not(#\9):not(.awsui_active_umbhe_10muf_17):focus-visible {
18
- position: relative;
19
- box-sizing: border-box;
20
- outline: 2px dotted transparent;
21
- outline-offset: 3px;
22
- }
23
- .awsui_handle_umbhe_10muf_9:not(#\9):not(.awsui_active_umbhe_10muf_17):focus-visible::before {
24
- content: " ";
25
- display: block;
26
- position: absolute;
27
- box-sizing: border-box;
28
- inset-inline-start: calc(-1 * 4px);
29
- inset-block-start: calc(-1 * 4px);
30
- inline-size: calc(100% + 2 * 4px);
31
- block-size: calc(100% + 2 * 4px);
32
- border-radius: var(--border-radius-control-default-focus-ring-1uabki, 4px);
33
- border: 2px solid var(--color-border-item-focused-8bi903, #006ce0);
23
+ .awsui_handle_umbhe_1bpr9_9:not(#\9):active {
24
+ cursor: grabbing;
34
25
  }
35
26
 
36
- .awsui_active_umbhe_10muf_17:not(#\9) {
27
+ .awsui_active_umbhe_1bpr9_27:not(#\9) {
37
28
  outline: none;
38
29
  }
@@ -2,7 +2,7 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "handle": "awsui_handle_umbhe_10muf_9",
6
- "active": "awsui_active_umbhe_10muf_17"
5
+ "handle": "awsui_handle_umbhe_1bpr9_9",
6
+ "active": "awsui_active_umbhe_1bpr9_27"
7
7
  };
8
8
 
@@ -1,6 +1,6 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "handle": "awsui_handle_cc1pu_kbnrd_5"
4
+ "active-uap": "awsui_active-uap_1k7af_1lr5y_5"
5
5
  };
6
6
 
@@ -0,0 +1,7 @@
1
+ /*
2
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ .awsui_active-uap_1k7af_1lr5y_5:not(#\9) {
6
+ /* used in test-utils */
7
+ }
@@ -2,6 +2,6 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "handle": "awsui_handle_cc1pu_kbnrd_5"
5
+ "active-uap": "awsui_active-uap_1k7af_1lr5y_5"
6
6
  };
7
7
 
@@ -1,4 +1,4 @@
1
1
  export var PACKAGE_SOURCE = "board-components";
2
- export var PACKAGE_VERSION = "3.0.0 (af44212e)";
2
+ export var PACKAGE_VERSION = "3.0.0 (af05dce2)";
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": "board-components",
3
- "PACKAGE_VERSION": "3.0.0 (af44212e)",
3
+ "PACKAGE_VERSION": "3.0.0 (af05dce2)",
4
4
  "THEME": "open-source-visual-refresh",
5
5
  "ALWAYS_VISUAL_REFRESH": true
6
6
  }