@pega/cosmos-react-dnd 9.0.0-build.9.9 → 9.0.0

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 (20) hide show
  1. package/lib/components/DragHandle/DragHandle.d.ts +5 -3
  2. package/lib/components/DragHandle/DragHandle.d.ts.map +1 -1
  3. package/lib/components/DragHandle/DragHandle.js +8 -6
  4. package/lib/components/DragHandle/DragHandle.js.map +1 -1
  5. package/lib/components/StandardDragDropList/StandardDragDropList.d.ts +2 -0
  6. package/lib/components/StandardDragDropList/StandardDragDropList.d.ts.map +1 -1
  7. package/lib/components/StandardDragDropList/StandardDragDropList.js +35 -15
  8. package/lib/components/StandardDragDropList/StandardDragDropList.js.map +1 -1
  9. package/lib/components/StandardDragDropList/StandardDragDropList.styles.d.ts +21 -14
  10. package/lib/components/StandardDragDropList/StandardDragDropList.styles.d.ts.map +1 -1
  11. package/lib/components/StandardDragDropList/StandardDragDropList.styles.js +5 -4
  12. package/lib/components/StandardDragDropList/StandardDragDropList.styles.js.map +1 -1
  13. package/lib/components/StandardDragDropList/StandardDragDropList.test-ids.d.ts +1 -1
  14. package/lib/components/StandardDragDropList/StandardDragDropList.test-ids.d.ts.map +1 -1
  15. package/lib/components/StandardDragDropList/StandardDragDropList.test-ids.js +3 -1
  16. package/lib/components/StandardDragDropList/StandardDragDropList.test-ids.js.map +1 -1
  17. package/lib/components/StandardDragDropList/StandardDragDropList.types.d.ts +5 -2
  18. package/lib/components/StandardDragDropList/StandardDragDropList.types.d.ts.map +1 -1
  19. package/lib/components/StandardDragDropList/StandardDragDropList.types.js.map +1 -1
  20. package/package.json +4 -5
@@ -1,4 +1,4 @@
1
- import { type WithAttributes } from '@pega/cosmos-react-core';
1
+ import type { WithAttributes } from '@pega/cosmos-react-core';
2
2
  import type { DraggableItem } from '../Draggable';
3
3
  export interface DragHandleProps extends WithAttributes<'div', {
4
4
  /** The id of the item, used to keep track of the row when reordering */
@@ -7,9 +7,11 @@ export interface DragHandleProps extends WithAttributes<'div', {
7
7
  contextualLabel?: string;
8
8
  }> {
9
9
  }
10
- export declare const StyledDragHandle: import("styled-components").StyledComponent<import("@pega/cosmos-react-core").ForwardRefForwardPropsComponent<import("@pega/cosmos-react-core").ButtonProps>, import("styled-components").DefaultTheme, {
10
+ export declare const StyledDragHandle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<Omit<Omit<import("@pega/cosmos-react-core").ButtonProps, "ref"> & import("react").RefAttributes<HTMLAnchorElement | HTMLButtonElement> & import("@pega/cosmos-react-core").ForwardProps, "ref"> & {
11
+ ref?: ((instance: HTMLAnchorElement | HTMLButtonElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLAnchorElement | HTMLButtonElement> | null | undefined;
12
+ }, {
11
13
  rotateIcon?: boolean;
12
- }, never>;
14
+ }>> & string & Omit<import("@pega/cosmos-react-core").ForwardRefForwardPropsComponent<import("@pega/cosmos-react-core").ButtonProps>, keyof import("react").Component<any, {}, any>>;
13
15
  declare const DragHandle: import("react").ForwardRefExoticComponent<Omit<DragHandleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
14
16
  export default DragHandle;
15
17
  //# sourceMappingURL=DragHandle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DragHandle.d.ts","sourceRoot":"","sources":["../../../src/components/DragHandle/DragHandle.tsx"],"names":[],"mappings":"AAUA,OAAO,EAQL,KAAK,cAAc,EAGpB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,MAAM,WAAW,eACf,SAAQ,cAAc,CACpB,KAAK,EACL;IACE,wEAAwE;IACxE,MAAM,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;IAC5B,iFAAiF;IACjF,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CACF;CAAG;AAEN,eAAO,MAAM,gBAAgB;iBACd,OAAO;SAgBpB,CAAC;AAEH,QAAA,MAAM,UAAU,yHAsHf,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"DragHandle.d.ts","sourceRoot":"","sources":["../../../src/components/DragHandle/DragHandle.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAc,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAG1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,MAAM,WAAW,eACf,SAAQ,cAAc,CACpB,KAAK,EACL;IACE,wEAAwE;IACxE,MAAM,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;IAC5B,iFAAiF;IACjF,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CACF;CAAG;AAEN,eAAO,MAAM,gBAAgB;;;iBACd,OAAO;oLAiBpB,CAAC;AAIH,QAAA,MAAM,UAAU,yHAsHf,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -1,13 +1,14 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { forwardRef, useContext, useEffect, useState } from 'react';
3
3
  import styled, { css } from 'styled-components';
4
- import { Icon, Button, useI18n, useUID, useConsolidatedRef, HiddenText, StyledIcon, useEscape } from '@pega/cosmos-react-core';
4
+ import { Icon, Button, useI18n, useUID, useConsolidatedRef, HiddenText, StyledIcon, useEscape, defaultThemeProp } from '@pega/cosmos-react-core';
5
5
  import DragDropListContext from '../DragDropList/DragDropListContext';
6
- export const StyledDragHandle = styled(Button)(({ rotateIcon }) => {
6
+ export const StyledDragHandle = styled(Button)(({ rotateIcon, theme }) => {
7
7
  return css `
8
8
  cursor: grab;
9
+ border-radius: min(${theme.base['border-radius']}, 0.125rem);
9
10
 
10
- &[aria-grabbed='true'] {
11
+ &[aria-pressed='true'] {
11
12
  cursor: grabbing;
12
13
  }
13
14
 
@@ -19,6 +20,7 @@ export const StyledDragHandle = styled(Button)(({ rotateIcon }) => {
19
20
  `}
20
21
  `;
21
22
  });
23
+ StyledDragHandle.defaultProps = defaultThemeProp;
22
24
  const DragHandle = forwardRef(function DragHandle({ itemId, contextualLabel, ...restProps }, ref) {
23
25
  const [grabbed, setGrabbed] = useState(false);
24
26
  const [keyboardGrabbed, setKeyboardGrabbed] = useState(false);
@@ -81,15 +83,15 @@ const DragHandle = forwardRef(function DragHandle({ itemId, contextualLabel, ...
81
83
  };
82
84
  }, [grabbed]);
83
85
  const dragText = t('drag');
84
- return (_jsxs(StyledDragHandle, { ...restProps, "data-drag-handle-for": itemId, forwardedAs: 'div', role: 'button', tabIndex: 0, label: grabbed ? undefined : dragText, "aria-label": contextualLabel ? `${dragText} - ${contextualLabel}` : dragText, "aria-describedby": descriptionId, ref: dragHandleRef, icon: true, variant: 'simple', compact: true, "aria-grabbed": grabbed, rotateIcon: orientation === 'horizontal' && keyboardGrabbed, onKeyDown: handleKeyDown, onMouseDown: () => {
86
+ return (_jsxs(StyledDragHandle, { ...restProps, "data-drag-handle-for": itemId, forwardedAs: 'div', role: 'button', tabIndex: 0, label: grabbed ? undefined : dragText, "aria-label": contextualLabel ? `${dragText} - ${contextualLabel}` : dragText, "aria-describedby": descriptionId, ref: dragHandleRef, icon: true, variant: 'simple', compact: true, "aria-pressed": grabbed, rotateIcon: orientation === 'horizontal' && keyboardGrabbed, onKeyDown: handleKeyDown, onMouseDown: () => {
85
87
  setGrabbed(true);
86
88
  }, onMouseUp: () => {
87
89
  setGrabbed(false);
88
90
  }, onBlur: () => {
89
91
  setGrabbed(false);
90
- }, children: [_jsx(Icon, { name: keyboardGrabbed ? 'arrow-micro-up-down' : 'drag' }), _jsx(HiddenText, { id: descriptionId, children: `${t('drag_handle_activate_description')} ${t(orientation === 'horizontal'
92
+ }, children: [_jsx(Icon, { name: keyboardGrabbed ? 'arrow-micro-up-down' : 'drag' }), _jsx(HiddenText, { id: descriptionId, children: `${grabbed ? `${t('drag_handle_drop_description')} ${t('drag_handle_cancel_description')}` : t('drag_handle_activate_description')} ${t(orientation === 'horizontal'
91
93
  ? 'drag_handle_horizontal_description'
92
- : 'drag_handle_vertical_description')}${keyboardMoveLists ? ` ${t('drag_handle_tab_description')}` : ''} ${t('drag_handle_drop_description')} ${t('drag_handle_cancel_description')}` })] }));
94
+ : 'drag_handle_vertical_description')}${keyboardMoveLists ? ` ${t('drag_handle_tab_description')}` : ''}` })] }));
93
95
  });
94
96
  export default DragHandle;
95
97
  //# sourceMappingURL=DragHandle.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DragHandle.js","sourceRoot":"","sources":["../../../src/components/DragHandle/DragHandle.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EACV,UAAU,EACV,SAAS,EACT,QAAQ,EAGT,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,IAAI,EACJ,MAAM,EACN,OAAO,EACP,MAAM,EACN,kBAAkB,EAClB,UAAU,EAGV,UAAU,EACV,SAAS,EACV,MAAM,yBAAyB,CAAC;AAEjC,OAAO,mBAAmB,MAAM,qCAAqC,CAAC;AActE,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,CAE3C,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE;IACpB,OAAO,GAAG,CAAA;;;;;;;MAON,UAAU;QACZ,GAAG,CAAA;QACC,UAAU;;;KAGb;GACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,UAAU,GAAG,UAAU,CAC3B,SAAS,UAAU,CAAC,EAAE,MAAM,EAAE,eAAe,EAAE,GAAG,SAAS,EAAE,EAAE,GAAG;IAChE,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9C,MAAM,CAAC,eA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AAC,CAAC,CAAC,IAAI,CAAC,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,8BAA8B,CAAC,IAAI,CAAC,CAAC,gCAAgC,CAAC,EAAE,GACtI,IACI,CACpB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import {\n forwardRef,\n useContext,\n useEffect,\n useState,\n type KeyboardEvent,\n type PropsWithoutRef\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Icon,\n Button,\n useI18n,\n useUID,\n useConsolidatedRef,\n HiddenText,\n type RefElement,\n type WithAttributes,\n StyledIcon,\n useEscape\n} from '@pega/cosmos-react-core';\n\nimport DragDropListContext from '../DragDropList/DragDropListContext';\nimport type { DraggableItem } from '../Draggable';\n\nexport interface DragHandleProps\n extends WithAttributes<\n 'div',\n {\n /** The id of the item, used to keep track of the row when reordering */\n itemId: DraggableItem['id'];\n /** The label or name of the actual item being dragged, used for accessibility */\n contextualLabel?: string;\n }\n > {}\n\nexport const StyledDragHandle = styled(Button)<{\n rotateIcon?: boolean;\n}>(({ rotateIcon }) => {\n return css`\n cursor: grab;\n\n &[aria-grabbed='true'] {\n cursor: grabbing;\n }\n\n ${rotateIcon &&\n css`\n ${StyledIcon} {\n transform: rotate(90deg);\n }\n `}\n `;\n});\n\nconst DragHandle = forwardRef<RefElement<DragHandleProps>, PropsWithoutRef<DragHandleProps>>(\n function DragHandle({ itemId, contextualLabel, ...restProps }, ref) {\n const [grabbed, setGrabbed] = useState(false);\n const [keyboardGrabbed, setKeyboardGrabbed] = useState(false);\n const {\n keyboardReorderItem,\n keyboardMoveLists,\n keyboardDragStart,\n keyboardDragEnd,\n keyboardDragCancel,\n orientation = 'vertical'\n } = useContext(DragDropListContext);\n const descriptionId = useUID();\n const t = useI18n();\n const dragHandleRef = useConsolidatedRef(ref);\n\n useEscape(() => {\n if (grabbed) {\n keyboardDragCancel?.(itemId);\n setGrabbed(false);\n setKeyboardGrabbed(false);\n }\n });\n\n const handleKeyDown = (e: KeyboardEvent<HTMLButtonElement>) => {\n // Limit preventDefault and stopPropagation to these codes to not interfere with tab key behavior\n const arrows =\n orientation === 'horizontal' ? ['ArrowLeft', 'ArrowRight'] : ['ArrowUp', 'ArrowDown'];\n if (['Space', ...arrows].includes(e.code) || (grabbed && e.code === 'Tab')) {\n e.preventDefault();\n e.stopPropagation();\n }\n\n if (e.code === 'Space') {\n if (keyboardGrabbed) {\n keyboardDragEnd?.(itemId);\n } else {\n keyboardDragStart?.(itemId);\n }\n\n setGrabbed(prev => !prev);\n setKeyboardGrabbed(prev => !prev);\n } else if (grabbed)\n if (\n (orientation === 'horizontal' && e.code === 'ArrowLeft') ||\n (orientation === 'vertical' && e.code === 'ArrowUp')\n ) {\n keyboardReorderItem(itemId, 'prev');\n } else if (\n (orientation === 'horizontal' && e.code === 'ArrowRight') ||\n (orientation === 'vertical' && e.code === 'ArrowDown')\n ) {\n keyboardReorderItem(itemId, 'next');\n } else if (e.code === 'Tab' && e.shiftKey) {\n keyboardMoveLists?.(itemId, 'prev');\n } else if (e.code === 'Tab' && !e.shiftKey) {\n keyboardMoveLists?.(itemId, 'next');\n }\n };\n\n useEffect(() => {\n if (!grabbed) {\n setKeyboardGrabbed(false);\n return;\n }\n\n const removeGrabbed = () => {\n setGrabbed(false);\n setKeyboardGrabbed(false);\n };\n\n document.addEventListener('dragend', removeGrabbed);\n\n return () => {\n document.removeEventListener('dragend', removeGrabbed);\n };\n }, [grabbed]);\n\n const dragText = t('drag');\n\n return (\n <StyledDragHandle\n {...restProps}\n data-drag-handle-for={itemId}\n forwardedAs='div'\n role='button'\n tabIndex={0}\n label={grabbed ? undefined : dragText}\n aria-label={contextualLabel ? `${dragText} - ${contextualLabel}` : dragText}\n aria-describedby={descriptionId}\n ref={dragHandleRef}\n icon\n variant='simple'\n compact\n aria-grabbed={grabbed}\n rotateIcon={orientation === 'horizontal' && keyboardGrabbed}\n onKeyDown={handleKeyDown}\n onMouseDown={() => {\n setGrabbed(true);\n }}\n onMouseUp={() => {\n setGrabbed(false);\n }}\n onBlur={() => {\n setGrabbed(false);\n }}\n >\n <Icon name={keyboardGrabbed ? 'arrow-micro-up-down' : 'drag'} />\n <HiddenText id={descriptionId}>\n {`${t('drag_handle_activate_description')} ${t(\n orientation === 'horizontal'\n ? 'drag_handle_horizontal_description'\n : 'drag_handle_vertical_description'\n )}${keyboardMoveLists ? ` ${t('drag_handle_tab_description')}` : ''} ${t('drag_handle_drop_description')} ${t('drag_handle_cancel_description')}`}\n </HiddenText>\n </StyledDragHandle>\n );\n }\n);\n\nexport default DragHandle;\n"]}
1
+ {"version":3,"file":"DragHandle.js","sourceRoot":"","sources":["../../../src/components/DragHandle/DragHandle.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EACV,UAAU,EACV,SAAS,EACT,QAAQ,EAGT,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,IAAI,EACJ,MAAM,EACN,OAAO,EACP,MAAM,EACN,kBAAkB,EAClB,UAAU,EACV,UAAU,EACV,SAAS,EACT,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,mBAAmB,MAAM,qCAAqC,CAAC;AActE,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,CAE3C,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,EAAE;IAC3B,OAAO,GAAG,CAAA;;yBAEa,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC;;;;;;MAM9C,UAAU;QACZ,GAAG,CAAA;QACC,UAAU;;;KAGb;GACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,gBAAgB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEjD,MAAM,UAAU,GAAG,UAAU,CAC3B,SAAS,UAAU,CAAC,EAAE,MAAM,EAAE,eAAe,EAA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AC,CAAC,CAAC,GAAG,CAAC,CAAC,8BAA8B,CAAC,IAAI,CAAC,CAAC,gCAAgC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,kCAAkC,CAAC,IAAI,CAAC,CACtI,WAAW,KAAK,YAAY;oBAC1B,CAAC,CAAC,oCAAoC;oBACtC,CAAC,CAAC,kCAAkC,CACvC,GAAG,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,GAC1D,IACI,CACpB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import {\n forwardRef,\n useContext,\n useEffect,\n useState,\n type KeyboardEvent,\n type PropsWithoutRef\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Icon,\n Button,\n useI18n,\n useUID,\n useConsolidatedRef,\n HiddenText,\n StyledIcon,\n useEscape,\n defaultThemeProp\n} from '@pega/cosmos-react-core';\nimport type { RefElement, WithAttributes } from '@pega/cosmos-react-core';\n\nimport DragDropListContext from '../DragDropList/DragDropListContext';\nimport type { DraggableItem } from '../Draggable';\n\nexport interface DragHandleProps\n extends WithAttributes<\n 'div',\n {\n /** The id of the item, used to keep track of the row when reordering */\n itemId: DraggableItem['id'];\n /** The label or name of the actual item being dragged, used for accessibility */\n contextualLabel?: string;\n }\n > {}\n\nexport const StyledDragHandle = styled(Button)<{\n rotateIcon?: boolean;\n}>(({ rotateIcon, theme }) => {\n return css`\n cursor: grab;\n border-radius: min(${theme.base['border-radius']}, 0.125rem);\n\n &[aria-pressed='true'] {\n cursor: grabbing;\n }\n\n ${rotateIcon &&\n css`\n ${StyledIcon} {\n transform: rotate(90deg);\n }\n `}\n `;\n});\n\nStyledDragHandle.defaultProps = defaultThemeProp;\n\nconst DragHandle = forwardRef<RefElement<DragHandleProps>, PropsWithoutRef<DragHandleProps>>(\n function DragHandle({ itemId, contextualLabel, ...restProps }, ref) {\n const [grabbed, setGrabbed] = useState(false);\n const [keyboardGrabbed, setKeyboardGrabbed] = useState(false);\n const {\n keyboardReorderItem,\n keyboardMoveLists,\n keyboardDragStart,\n keyboardDragEnd,\n keyboardDragCancel,\n orientation = 'vertical'\n } = useContext(DragDropListContext);\n const descriptionId = useUID();\n const t = useI18n();\n const dragHandleRef = useConsolidatedRef(ref);\n\n useEscape(() => {\n if (grabbed) {\n keyboardDragCancel?.(itemId);\n setGrabbed(false);\n setKeyboardGrabbed(false);\n }\n });\n\n const handleKeyDown = (e: KeyboardEvent<HTMLButtonElement>) => {\n // Limit preventDefault and stopPropagation to these codes to not interfere with tab key behavior\n const arrows =\n orientation === 'horizontal' ? ['ArrowLeft', 'ArrowRight'] : ['ArrowUp', 'ArrowDown'];\n if (['Space', ...arrows].includes(e.code) || (grabbed && e.code === 'Tab')) {\n e.preventDefault();\n e.stopPropagation();\n }\n\n if (e.code === 'Space') {\n if (keyboardGrabbed) {\n keyboardDragEnd?.(itemId);\n } else {\n keyboardDragStart?.(itemId);\n }\n\n setGrabbed(prev => !prev);\n setKeyboardGrabbed(prev => !prev);\n } else if (grabbed)\n if (\n (orientation === 'horizontal' && e.code === 'ArrowLeft') ||\n (orientation === 'vertical' && e.code === 'ArrowUp')\n ) {\n keyboardReorderItem(itemId, 'prev');\n } else if (\n (orientation === 'horizontal' && e.code === 'ArrowRight') ||\n (orientation === 'vertical' && e.code === 'ArrowDown')\n ) {\n keyboardReorderItem(itemId, 'next');\n } else if (e.code === 'Tab' && e.shiftKey) {\n keyboardMoveLists?.(itemId, 'prev');\n } else if (e.code === 'Tab' && !e.shiftKey) {\n keyboardMoveLists?.(itemId, 'next');\n }\n };\n\n useEffect(() => {\n if (!grabbed) {\n setKeyboardGrabbed(false);\n return;\n }\n\n const removeGrabbed = () => {\n setGrabbed(false);\n setKeyboardGrabbed(false);\n };\n\n document.addEventListener('dragend', removeGrabbed);\n\n return () => {\n document.removeEventListener('dragend', removeGrabbed);\n };\n }, [grabbed]);\n\n const dragText = t('drag');\n\n return (\n <StyledDragHandle\n {...restProps}\n data-drag-handle-for={itemId}\n forwardedAs='div'\n role='button'\n tabIndex={0}\n label={grabbed ? undefined : dragText}\n aria-label={contextualLabel ? `${dragText} - ${contextualLabel}` : dragText}\n aria-describedby={descriptionId}\n ref={dragHandleRef}\n icon\n variant='simple'\n compact\n aria-pressed={grabbed}\n rotateIcon={orientation === 'horizontal' && keyboardGrabbed}\n onKeyDown={handleKeyDown}\n onMouseDown={() => {\n setGrabbed(true);\n }}\n onMouseUp={() => {\n setGrabbed(false);\n }}\n onBlur={() => {\n setGrabbed(false);\n }}\n >\n <Icon name={keyboardGrabbed ? 'arrow-micro-up-down' : 'drag'} />\n <HiddenText id={descriptionId}>\n {`${grabbed ? `${t('drag_handle_drop_description')} ${t('drag_handle_cancel_description')}` : t('drag_handle_activate_description')} ${t(\n orientation === 'horizontal'\n ? 'drag_handle_horizontal_description'\n : 'drag_handle_vertical_description'\n )}${keyboardMoveLists ? ` ${t('drag_handle_tab_description')}` : ''}`}\n </HiddenText>\n </StyledDragHandle>\n );\n }\n);\n\nexport default DragHandle;\n"]}
@@ -8,6 +8,7 @@ declare const _default: import("react").ForwardRefExoticComponent<Omit<StandardD
8
8
  text: string;
9
9
  onClick: import("react").MouseEventHandler;
10
10
  href?: string;
11
+ onPreview?: import("@pega/cosmos-react-core").LinkProps["onPreview"];
11
12
  } & import("@pega/cosmos-react-core").ForwardProps);
12
13
  secondary?: string;
13
14
  status?: {
@@ -26,6 +27,7 @@ declare const _default: import("react").ForwardRefExoticComponent<Omit<StandardD
26
27
  } & {
27
28
  items: StandardDragDropListItemProps[];
28
29
  onItemSelection?: StandardDragDropListProps["onItemSelection"];
30
+ itemSelectionMode?: StandardDragDropListProps["itemSelectionMode"];
29
31
  accept: StandardDragDropListProps["accept"];
30
32
  onChange: StandardDragDropListProps["onChange"];
31
33
  }, "ref"> & import("react").RefAttributes<HTMLDivElement>> & {
@@ -1 +1 @@
1
- {"version":3,"file":"StandardDragDropList.d.ts","sourceRoot":"","sources":["../../../src/components/StandardDragDropList/StandardDragDropList.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAGV,UAAU,EAIX,MAAM,OAAO,CAAC;AA0Bf,OAAO,KAAK,EAAmC,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAwB3F,OAAO,KAAK,EACV,yBAAyB,EACzB,6BAA6B,EAC9B,MAAM,8BAA8B,CAAC;;;;;;;YAa9B,CAAJ;;;;;;;;;;;;;;;;;WAFW,6BAA6B,EAAE;sBACpB,yBAAyB,CAAC,iBAAiB,CAAC;YACtD,yBAAyB,CAAC,QAAQ,CAAC;cACjC,yBAAyB,CAAC,UAAU,CAAC;;;;AAqoBvD,wBAAiF"}
1
+ {"version":3,"file":"StandardDragDropList.d.ts","sourceRoot":"","sources":["../../../src/components/StandardDragDropList/StandardDragDropList.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAGV,UAAU,EAIX,MAAM,OAAO,CAAC;AA4Bf,OAAO,KAAK,EAAmC,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAwB3F,OAAO,KAAK,EACV,yBAAyB,EACzB,6BAA6B,EAC9B,MAAM,8BAA8B,CAAC;;;;;;;YAeC,CAAC;iBAEpC,CAAD;;;;;;;;;;;;;;;;;WANY,6BAA6B,EAAE;sBACpB,yBAAyB,CAAC,iBAAiB,CAAC;wBAC1C,yBAAyB,CAAC,mBAAmB,CAAC;YAC1D,yBAAyB,CAAC,QAAQ,CAAC;cACjC,yBAAyB,CAAC,UAAU,CAAC;;;;AAgrBvD,wBAAiF"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { createContext, forwardRef, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
3
- import { Flex, registerIcon, Icon, Text, Button, useI18n, EmptyState, ExpandCollapse, useUID, Tooltip, useElement, useTestIds, withTestIds, AdditionalInfo, Checkbox, HiddenText, useLiveLog, useFocusWithin, useConsolidatedRef, useArrows, getFocusables, useEvent } from '@pega/cosmos-react-core';
3
+ import { Flex, registerIcon, Icon, Text, Button, Link, useI18n, EmptyState, ExpandCollapse, useUID, Tooltip, useElement, useTestIds, withTestIds, AdditionalInfo, Checkbox, RadioButton, HiddenText, useLiveLog, useFocusWithin, useConsolidatedRef, useArrows, getFocusables, useEvent } from '@pega/cosmos-react-core';
4
4
  import * as DragIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/drag.icon';
5
5
  import * as PlusIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/plus.icon';
6
6
  import * as CaretDownIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-down.icon';
@@ -28,12 +28,11 @@ const getFlattenedIds = (items) => {
28
28
  };
29
29
  const ItemRenderer = ({ testId, dragRef, previewRef, isDragging, data: { id,
30
30
  // Remove type for DOM restProps
31
- type, accept, primary, secondary, draggable = true, status, items, icon, onConfigure, onRemove, onAddTo, onChange, onItemSelection, selected, ...restProps }, data }) => {
31
+ type, accept, primary, secondary, draggable = true, status, items, icon, onConfigure, onRemove, onAddTo, onChange, onItemSelection, itemSelectionMode = 'multi', selected, ...restProps }, data }) => {
32
32
  const t = useI18n();
33
33
  const [collapsed, setCollapsed] = useState(false);
34
34
  const expandCollpaseId = useUID();
35
35
  const testIds = useTestIds(testId, getItemRendererTestIds);
36
- const descriptionId = useUID();
37
36
  const { tabKeyNavigation, setTabKeyNavigation } = useContext(tabKeyNavigationContext);
38
37
  const listItemRef = useRef(null);
39
38
  const containerRef = useConsolidatedRef(listItemRef, previewRef);
@@ -63,18 +62,29 @@ type, accept, primary, secondary, draggable = true, status, items, icon, onConfi
63
62
  if (typeof primary === 'string') {
64
63
  return (_jsxs("span", { ref: setPrimaryTextEl, children: [primaryText, tooltip] }));
65
64
  }
66
- return (_jsx(Button, { variant: 'link', onClick: primary.onClick, href: primary.href, ref: setPrimaryTextEl, children: _jsxs(StyledPrimary, { children: [primaryText, tooltip] }) }));
65
+ if (primary.onPreview && primary.href) {
66
+ return (_jsx(Link, { "data-testid": testIds.primary, href: primary.href, onClick: primary.onClick, onPreview: primary.onPreview, ref: setPrimaryTextEl, previewable: true, children: _jsxs(StyledPrimary, { children: [primaryText, tooltip] }) }));
67
+ }
68
+ return (_jsx(Button, { "data-testid": testIds.primary, variant: 'link', onClick: primary.onClick, href: primary.href, ref: setPrimaryTextEl, children: _jsxs(StyledPrimary, { children: [primaryText, tooltip] }) }));
67
69
  }, [t, items, primary, collapsed, expandCollpaseId, primaryTextEl]);
68
- return (_jsxs(_Fragment, { children: [_jsxs(Flex, { "data-testid": testIds.root, ...restProps, container: { direction: 'column' }, as: StyledStandardDragDropListItem, ref: containerRef, isDragging: isDragging, hasActions: hasActions, role: 'listitem', "aria-label": primary, tabIndex: tabKeyNavigation ? -1 : 0, children: [_jsxs(Flex, { container: { alignItems: 'center' }, as: StyledListItemInner, isDraggable: draggable, isSelectable: !!onItemSelection, hasActions: hasActions, hasVisual: !!status || !!icon, children: [draggable && (_jsx(DragHandle, { itemId: id, ref: dragRef, "data-testid": testIds.dragHandle, "aria-label": typeof primary === 'string' ? primary : primary.text })), _jsx(Flex, { container: { alignItems: 'center', gap: 0.5 }, item: { shrink: 1 }, children: _jsxs(Flex, { container: { alignItems: 'center', gap: status || icon ? 1 : undefined, pad: 0.5 }, as: StyledItemContent, children: [onItemSelection && !data.items && (_jsx(Checkbox, { "data-testid": testIds.checkbox, "aria-label": typeof primary === 'string' ? primary : primary.text, checked: selected, onChange: e => onItemSelection({ ...data, selected: e.target.checked }) })), status && _jsx(ItemStatus, { type: status?.type, message: status?.message }), icon && !items && _jsx(Icon, { "data-testid": testIds.icon, ...icon, size: 's' }), primaryEl] }) }), (secondary || hasActions) && (_jsxs(Flex, { container: { alignItems: 'center', justify: 'end', gap: 0.5 }, item: { grow: 1 }, numberOfActions: numberOfActions, as: StyledItemSecondaryContainer, children: [secondary && (_jsxs(StyledSecondary, { variant: 'secondary', ref: setSecondaryTextEl, children: [secondary, _jsx(Tooltip, { smart: true, target: secondaryTextEl, showDelay: 'none', hideDelay: 'none', children: secondary })] })), hasActions && (_jsxs(Flex, { container: { alignItems: 'center', gap: 0.5 }, as: StyledItemActions, children: [onAddTo && (_jsxs("span", { children: [_jsx(Button, { "data-testid": testIds.addButton, icon: true, variant: 'simple', label: t('add'), "aria-describedby": descriptionId, onClick: (e) => {
69
- onAddTo?.(id, e);
70
- }, children: _jsx(Icon, { name: 'plus' }) }), _jsx(HiddenText, { id: descriptionId, children: t('add_button_description') })] })), onConfigure && (_jsxs("span", { children: [_jsx(Button, { "data-testid": testIds.configureButton, icon: true, variant: 'simple', label: t('configure'), "aria-describedby": descriptionId, onClick: (e) => {
71
- onConfigure?.(id, e);
72
- }, children: _jsx(Icon, { name: 'gear' }) }), _jsx(HiddenText, { id: descriptionId, children: `${typeof primary === 'string' ? primary : primary.text} ${t('configure_button_description')}` })] })), onRemove && (_jsxs("span", { children: [_jsx(Button, { "data-testid": testIds.removeButton, icon: true, variant: 'simple', label: t('remove'), "aria-describedby": descriptionId, onClick: (e) => {
73
- onRemove?.(id, e);
74
- }, children: _jsx(Icon, { name: 'trash' }) }), _jsx(HiddenText, { id: descriptionId, children: `${typeof primary === 'string' ? primary : primary.text} ${t('remove_button_description')}` })] }))] }))] }))] }), data.items && data.items.length > 0 && (_jsx(ExpandCollapse, { collapsed: collapsed, id: expandCollpaseId, children: _jsx(BaseStandardDragDropList, { accept: data.accept, items: data.items, onChange: data.onChange, onItemSelection: data.onItemSelection }) }))] }), _jsx(HiddenText, { id: descriptionId, children: t('list_item_control_instructions') })] }));
70
+ return (_jsxs(Flex, { "data-testid": testIds.root, ...restProps, container: { direction: 'column' }, as: StyledStandardDragDropListItem, ref: containerRef, isDragging: isDragging, hasActions: hasActions, role: 'listitem', "aria-label": primary, tabIndex: tabKeyNavigation ? -1 : 0, children: [_jsxs(Flex, { container: { alignItems: 'center' }, as: StyledListItemInner, isDraggable: draggable, isSelectable: !!onItemSelection, hasActions: hasActions, hasVisual: !!status || !!icon, children: [draggable && (_jsx(DragHandle, { itemId: id, ref: dragRef, "data-testid": testIds.dragHandle, "aria-label": typeof primary === 'string' ? primary : primary.text })), _jsx(Flex, { container: { alignItems: 'center', gap: 0.5 }, item: { grow: 1, shrink: 1 }, children: _jsxs(Flex, { container: { alignItems: 'center', gap: status || icon ? 1 : undefined, pad: 0.5 }, as: StyledItemContent, children: [onItemSelection &&
71
+ !data.items &&
72
+ (itemSelectionMode === 'single' ? (_jsx(RadioButton, { "data-testid": testIds.radio, "aria-label": typeof primary === 'string' ? primary : primary.text, checked: selected, onChange: e => onItemSelection({ ...data, selected: e.target.checked }) })) : (_jsx(Checkbox, { "data-testid": testIds.checkbox, "aria-label": typeof primary === 'string' ? primary : primary.text, checked: selected, onChange: e => onItemSelection({ ...data, selected: e.target.checked }) }))), status && _jsx(ItemStatus, { type: status?.type, message: status?.message }), icon && !items && _jsx(Icon, { "data-testid": testIds.icon, ...icon, size: 's' }), primaryEl] }) }), secondary && (_jsx(Flex, { container: { alignItems: 'center', justify: 'end', gap: 0.5 },
73
+ // flex-shrink: 100000 to crush secondary text before primary
74
+ item: { grow: 0, shrink: 100000 }, numberOfActions: numberOfActions, as: StyledItemSecondaryContainer, children: secondary && (_jsxs(StyledSecondary, { variant: 'secondary', ref: setSecondaryTextEl, children: [secondary, _jsx(Tooltip, { smart: true, target: secondaryTextEl, showDelay: 'none', hideDelay: 'none', children: secondary })] })) })), hasActions && (_jsxs(Flex, { container: { alignItems: 'center', gap: 0.5 }, as: StyledItemActions, children: [onAddTo && (_jsx("span", { children: _jsx(Button, { "data-testid": testIds.addButton, icon: true, variant: 'simple', label: t('add'), "aria-label": t('add_noun', [typeof primary === 'string' ? primary : primary.text]), onClick: (e) => {
75
+ onAddTo?.(id, e);
76
+ }, children: _jsx(Icon, { name: 'plus' }) }) })), onConfigure && (_jsx("span", { children: _jsx(Button, { "data-testid": testIds.configureButton, icon: true, variant: 'simple', label: t('configure'), "aria-label": t('configure_noun', [
77
+ typeof primary === 'string' ? primary : primary.text
78
+ ]), onClick: (e) => {
79
+ onConfigure?.(id, e);
80
+ }, children: _jsx(Icon, { name: 'gear' }) }) })), onRemove && (_jsx("span", { children: _jsx(Button, { "data-testid": testIds.removeButton, icon: true, variant: 'simple', label: t('remove'), "aria-label": t('remove_noun', [
81
+ typeof primary === 'string' ? primary : primary.text
82
+ ]), onClick: (e) => {
83
+ onRemove?.(id, e);
84
+ }, children: _jsx(Icon, { name: 'trash' }) }) }))] }))] }), data.items && data.items.length > 0 && (_jsx(ExpandCollapse, { collapsed: collapsed, id: expandCollpaseId, children: _jsx(BaseStandardDragDropList, { accept: data.accept, items: data.items, onChange: data.onChange, onItemSelection: data.onItemSelection, itemSelectionMode: data.itemSelectionMode }) }))] }));
75
85
  };
76
86
  const ItemRendererWithTestIds = withTestIds(ItemRenderer, getItemRendererTestIds);
77
- BaseStandardDragDropList = forwardRef(function BaseStandardDragDropListFunction({ testId, accept, items: itemsProp, onChange: onChangeProp, onEnter, onItemSelection, pushMode, pullMode, ...restProps }, ref) {
87
+ BaseStandardDragDropList = forwardRef(function BaseStandardDragDropListFunction({ testId, accept, items: itemsProp, onChange: onChangeProp, onEnter, onItemSelection, itemSelectionMode = 'multi', pushMode, pullMode, ...restProps }, ref) {
78
88
  const flatIds = useMemo(() => getFlattenedIds(itemsProp), [itemsProp]);
79
89
  const { tabKeyNavigation } = useContext(tabKeyNavigationContext);
80
90
  const timerRef = useRef();
@@ -136,6 +146,7 @@ BaseStandardDragDropList = forwardRef(function BaseStandardDragDropListFunction(
136
146
  data: {
137
147
  ...item,
138
148
  onItemSelection,
149
+ itemSelectionMode,
139
150
  draggable: item.draggable && !!onChangeProp
140
151
  }
141
152
  };
@@ -146,6 +157,7 @@ BaseStandardDragDropList = forwardRef(function BaseStandardDragDropListFunction(
146
157
  data: {
147
158
  ...item,
148
159
  onItemSelection,
160
+ itemSelectionMode,
149
161
  accept: item.accept ?? accept,
150
162
  draggable: item.draggable && !!onChangeProp,
151
163
  onChange: onChangeProp
@@ -166,7 +178,15 @@ BaseStandardDragDropList = forwardRef(function BaseStandardDragDropListFunction(
166
178
  : undefined
167
179
  }
168
180
  };
169
- }), [accept, itemsProp, onChangeProp, tabKeyNavigation, flatIds, mergeChangeHandler]);
181
+ }), [
182
+ accept,
183
+ itemsProp,
184
+ onChangeProp,
185
+ itemSelectionMode,
186
+ tabKeyNavigation,
187
+ flatIds,
188
+ mergeChangeHandler
189
+ ]);
170
190
  const onChange = useCallback((newItems) => {
171
191
  const newContentItems = newItems.map(({ data: { onChange: _, ...data } }) => {
172
192
  return data;
@@ -182,7 +202,7 @@ BaseStandardDragDropList = forwardRef(function BaseStandardDragDropListFunction(
182
202
  }, [onChangeProp, flatIds, mergeChangeHandler]);
183
203
  return (_jsx(DragDropList, { testId: testId, ...restProps, ref: ref, accept: accept, items: itemsToRender, pushMode: pushMode, pullMode: pullMode, itemRenderer: ItemRendererWithTestIds, emptyRenderer: EmptyState, onChange: onChange, onEnter: onEnter }));
184
204
  });
185
- const StandardDragDropList = forwardRef(({ testId, accept, pushMode, pullMode, items: itemsProp, heading: title, info, footer, headingTag = 'h2', additionalInfo, onChange, onEnter, onItemSelection, ...restProps }, ref) => {
205
+ const StandardDragDropList = forwardRef(({ testId, accept, pushMode, pullMode, items: itemsProp, heading: title, info, footer, headingTag = 'h2', additionalInfo, onChange, onEnter, onItemSelection, itemSelectionMode = 'multi', ...restProps }, ref) => {
186
206
  const [tabKeyNavigation, setTabKeyNavigation] = useState(false);
187
207
  const contextValue = useMemo(() => ({ tabKeyNavigation, setTabKeyNavigation }), [tabKeyNavigation]);
188
208
  const containerRef = useConsolidatedRef(ref);
@@ -227,7 +247,7 @@ const StandardDragDropList = forwardRef(({ testId, accept, pushMode, pullMode, i
227
247
  justify: 'between',
228
248
  alignItems: 'center',
229
249
  gap: 1
230
- }, as: 'header', children: additionalInfo ? (_jsxs(Flex, { container: true, children: [heading, _jsx(AdditionalInfo, { heading: additionalInfo.heading ?? title, children: additionalInfo.content })] })) : (heading) }), infoText] })), _jsx(BaseStandardDragDropList, { testId: testId, accept: accept, pushMode: pushMode, pullMode: pullMode, items: itemsProp, onChange: onChange, onEnter: onEnter, onItemSelection: onItemSelection, "aria-describedby": descriptionId, ref: listRef }), footer && (_jsx(Flex, { container: {
250
+ }, as: 'header', children: additionalInfo ? (_jsxs(Flex, { container: true, children: [heading, _jsx(AdditionalInfo, { heading: additionalInfo.heading ?? title, children: additionalInfo.content })] })) : (heading) }), infoText] })), _jsx(BaseStandardDragDropList, { testId: testId, accept: accept, pushMode: pushMode, pullMode: pullMode, items: itemsProp, onChange: onChange, onEnter: onEnter, onItemSelection: onItemSelection, itemSelectionMode: itemSelectionMode, "aria-describedby": descriptionId, ref: listRef }), footer && (_jsx(Flex, { container: {
231
251
  alignItems: 'center',
232
252
  itemGap: 1,
233
253
  pad: [1, undefined]
@@ -1 +1 @@
1
- {"version":3,"file":"StandardDragDropList.js","sourceRoot":"","sources":["../../../src/components/StandardDragDropList/StandardDragDropList.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,aAAa,EACb,UAAU,EACV,WAAW,EACX,UAAU,EACV,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,EACT,MAAM,OAAO,CAAC;AAUf,OAAO,EACL,IAAI,EACJ,YAAY,EACZ,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,OAAO,EACP,UAAU,EACV,cAAc,EACd,MAAM,EACN,OAAO,EACP,UAAU,EACV,UAAU,EACV,WAAW,EACX,cAAc,EACd,QAAQ,EACR,UAAU,EACV,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,SAAS,EACT,aAAa,EACb,QAAQ,EACT,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,QAAQ,MAAM,6DAA6D,CAAC;AACxF,OAAO,KAAK,QAAQ,MAAM,6DAA6D,CAAC;AACxF,OAAO,KAAK,aAAa,MAAM,mEAAmE,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GAAG,CAAC,CAAC;4BAC9B,gBAAgB,EAAE,KAAK,EAAE,CAAC;wBAC5B,CAAC;oBACH,CAAC,YAEA,MAAM,GACF,CACR,EACD,KAAC,UAAU,IAAC,EAAE,EAAE,aAAa,YAAG,CAAC,CAAC,4BAA4B,CAAC,GAAc,IAClD,GACI,CACpC,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC,oBAAoB,EAAE,8BAA8B,CAAC,CAAC","sourcesContent":["import {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState\n} from 'react';\nimport type {\n Dispatch,\n KeyboardEvent,\n MouseEvent,\n PropsWithoutRef,\n Ref,\n SetStateAction\n} from 'react';\n\nimport {\n Flex,\n registerIcon,\n Icon,\n Text,\n Button,\n useI18n,\n EmptyState,\n ExpandCollapse,\n useUID,\n Tooltip,\n useElement,\n useTestIds,\n withTestIds,\n AdditionalInfo,\n Checkbox,\n HiddenText,\n useLiveLog,\n useFocusWithin,\n useConsolidatedRef,\n useArrows,\n getFocusables,\n useEvent\n} from '@pega/cosmos-react-core';\nimport type { ForwardRefForwardPropsComponent, OmitStrict } from '@pega/cosmos-react-core';\nimport * as DragIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/drag.icon';\nimport * as PlusIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/plus.icon';\nimport * as CaretDownIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-down.icon';\nimport * as DiamondMinusIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/diamond-minus.icon';\nimport * as WarnSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/warn-solid.icon';\n\nimport DragDropList from '../DragDropList';\nimport type { ItemRendererProps } from '../DragDropList';\nimport type { DraggableItem } from '../Draggable';\nimport DragHandle from '../DragHandle';\n\nimport {\n StyledStandardDragDropList,\n StyledStandardDragDropListItem,\n StyledExpandCollapseToggle,\n StyledItemActions,\n StyledItemContent,\n StyledItemStatus,\n StyledPrimary,\n StyledSecondary,\n StyledListItemInner,\n StyledItemSecondaryContainer\n} from './StandardDragDropList.styles';\nimport type {\n StandardDragDropListProps,\n StandardDragDropListItemProps\n} from './StandardDragDropList.types';\nimport {\n getItemRendererTestIds,\n getStandardDragDropListTestIds\n} from './StandardDragDropList.test-ids';\n\nregisterIcon(DragIcon, PlusIcon, CaretDownIcon, DiamondMinusIcon, WarnSolidIcon);\n\ntype InternalStandardDragDropListItemProps = StandardDragDropListItemProps &\n (\n | {\n items: StandardDragDropListItemProps[];\n onItemSelection?: StandardDragDropListProps['onItemSelection'];\n accept: StandardDragDropListProps['accept'];\n onChange: StandardDragDropListProps['onChange'];\n }\n | {\n items?: undefined;\n onItemSelection?: StandardDragDropListProps['onItemSelection'];\n accept?: never;\n onChange?: never;\n }\n );\n\nlet BaseStandardDragDropList: ForwardRefForwardPropsComponent<\n OmitStrict<StandardDragDropListProps, 'ref'> & { ref: Ref<HTMLUListElement> }\n>;\n\ninterface TabKeyNavigationContextValue {\n tabKeyNavigation: boolean;\n setTabKeyNavigation: Dispatch<SetStateAction<boolean>>;\n}\n\nconst tabKeyNavigationContext = createContext<TabKeyNavigationContextValue>({\n tabKeyNavigation: false,\n setTabKeyNavigation: () => {}\n});\n\nconst ItemStatus = ({\n message,\n type\n}: Partial<NonNullable<StandardDragDropListItemProps['status']>>) => {\n const [ttt, setTTT] = useElement(null);\n const iconName = type === 'warning' ? 'diamond-minus' : 'warn-solid';\n\n return (\n <StyledItemStatus aria-live='polite' role='status'>\n {message && (\n <Text variant='secondary' status={type}>\n <Flex container={{ gap: 0.5 }}>\n <Icon ref={setTTT} name={iconName} role='status' tabIndex={0} aria-label={type} />\n <Tooltip target={ttt} aria-hidden showDelay='none' hideDelay='none'>\n {message}\n </Tooltip>\n </Flex>\n </Text>\n )}\n </StyledItemStatus>\n );\n};\n\nconst getFlattenedIds = (\n items: StandardDragDropListItemProps[]\n): StandardDragDropListItemProps['id'][] => {\n return items.flatMap(item => {\n return item.items ? [item.id, ...item.items.map(({ id }) => id)] : [item.id];\n });\n};\n\nconst ItemRenderer = ({\n testId,\n dragRef,\n previewRef,\n isDragging,\n data: {\n id,\n // Remove type for DOM restProps\n type,\n accept,\n primary,\n secondary,\n draggable = true,\n status,\n items,\n icon,\n onConfigure,\n onRemove,\n onAddTo,\n onChange,\n onItemSelection,\n selected,\n ...restProps\n },\n data\n}: ItemRendererProps<InternalStandardDragDropListItemProps>) => {\n const t = useI18n();\n const [collapsed, setCollapsed] = useState(false);\n const expandCollpaseId = useUID();\n const testIds = useTestIds(testId, getItemRendererTestIds);\n const descriptionId = useUID();\n const { tabKeyNavigation, setTabKeyNavigation } = useContext(tabKeyNavigationContext);\n const listItemRef = useRef<HTMLLIElement>(null);\n const containerRef = useConsolidatedRef<HTMLLIElement>(listItemRef, previewRef);\n\n const hasActions = !!(onConfigure ?? onRemove ?? onAddTo);\n const numberOfActions = [onConfigure, onRemove, onAddTo].filter(Boolean).length;\n\n const [primaryTextEl, setPrimaryTextEl] = useElement<\n HTMLSpanElement | HTMLAnchorElement | HTMLButtonElement\n >(null);\n const [secondaryTextEl, setSecondaryTextEl] = useElement<HTMLSpanElement>(null);\n\n useEvent(\n 'keydown',\n e => {\n if (e.key === 'Enter' && !tabKeyNavigation) {\n e.preventDefault();\n setTabKeyNavigation(true);\n getFocusables(listItemRef)[0]?.focus();\n }\n if (e.key === 'Escape' && tabKeyNavigation) {\n e.preventDefault();\n setTabKeyNavigation(false);\n listItemRef.current?.focus();\n }\n },\n { target: listItemRef, dependencies: [tabKeyNavigation] }\n );\n\n const primaryEl = useMemo(() => {\n const primaryText = typeof primary === 'string' ? primary : primary.text;\n\n const tooltip = (\n <Tooltip smart target={primaryTextEl} showDelay='none' hideDelay='none'>\n {primaryText}\n </Tooltip>\n );\n\n const labelText = collapsed ? t('expand') : t('collapse');\n\n if (items) {\n return (\n <>\n <StyledExpandCollapseToggle\n data-testid={testIds.expandCollapseButton}\n variant='simple'\n icon\n label={labelText}\n aria-label={`${labelText} - ${primaryText}`}\n onClick={() => setCollapsed(cur => !cur)}\n aria-owns={expandCollpaseId}\n aria-expanded={!collapsed}\n tabIndex={tabKeyNavigation ? 0 : -1}\n >\n <Icon name='caret-down' />\n </StyledExpandCollapseToggle>\n <span ref={setPrimaryTextEl}>\n {primaryText}\n {tooltip}\n </span>\n </>\n );\n }\n\n if (typeof primary === 'string') {\n return (\n <span ref={setPrimaryTextEl}>\n {primaryText}\n {tooltip}\n </span>\n );\n }\n\n return (\n <Button variant='link' onClick={primary.onClick} href={primary.href} ref={setPrimaryTextEl}>\n <StyledPrimary>\n {primaryText}\n {tooltip}\n </StyledPrimary>\n </Button>\n );\n }, [t, items, primary, collapsed, expandCollpaseId, primaryTextEl]);\n\n return (\n <>\n <Flex\n data-testid={testIds.root}\n {...restProps}\n container={{ direction: 'column' }}\n as={StyledStandardDragDropListItem}\n ref={containerRef}\n isDragging={isDragging}\n hasActions={hasActions}\n role='listitem'\n aria-label={primary}\n tabIndex={tabKeyNavigation ? -1 : 0}\n >\n <Flex\n container={{ alignItems: 'center' }}\n as={StyledListItemInner}\n isDraggable={draggable}\n isSelectable={!!onItemSelection}\n hasActions={hasActions}\n hasVisual={!!status || !!icon}\n >\n {draggable && (\n <DragHandle\n itemId={id}\n ref={dragRef}\n data-testid={testIds.dragHandle}\n aria-label={typeof primary === 'string' ? primary : primary.text}\n />\n )}\n <Flex container={{ alignItems: 'center', gap: 0.5 }} item={{ shrink: 1 }}>\n <Flex\n container={{ alignItems: 'center', gap: status || icon ? 1 : undefined, pad: 0.5 }}\n as={StyledItemContent}\n >\n {onItemSelection && !data.items && (\n <Checkbox\n data-testid={testIds.checkbox}\n aria-label={typeof primary === 'string' ? primary : primary.text}\n checked={selected}\n onChange={e => onItemSelection({ ...data, selected: e.target.checked })}\n />\n )}\n {status && <ItemStatus type={status?.type} message={status?.message} />}\n {icon && !items && <Icon data-testid={testIds.icon} {...icon} size='s' />}\n\n {primaryEl}\n </Flex>\n </Flex>\n\n {(secondary || hasActions) && (\n <Flex\n container={{ alignItems: 'center', justify: 'end', gap: 0.5 }}\n item={{ grow: 1 }}\n numberOfActions={numberOfActions}\n as={StyledItemSecondaryContainer}\n >\n {secondary && (\n <StyledSecondary variant='secondary' ref={setSecondaryTextEl}>\n {secondary}\n <Tooltip smart target={secondaryTextEl} showDelay='none' hideDelay='none'>\n {secondary}\n </Tooltip>\n </StyledSecondary>\n )}\n\n {hasActions && (\n <Flex container={{ alignItems: 'center', gap: 0.5 }} as={StyledItemActions}>\n {onAddTo && (\n <span>\n <Button\n data-testid={testIds.addButton}\n icon\n variant='simple'\n label={t('add')}\n aria-describedby={descriptionId}\n onClick={(e: MouseEvent<HTMLButtonElement>) => {\n onAddTo?.(id, e);\n }}\n >\n <Icon name='plus' />\n </Button>\n <HiddenText id={descriptionId}>{t('add_button_description')}</HiddenText>\n </span>\n )}\n\n {onConfigure && (\n <span>\n <Button\n data-testid={testIds.configureButton}\n icon\n variant='simple'\n label={t('configure')}\n aria-describedby={descriptionId}\n onClick={(e: MouseEvent<HTMLButtonElement>) => {\n onConfigure?.(id, e);\n }}\n >\n <Icon name='gear' />\n </Button>\n <HiddenText id={descriptionId}>\n {`${typeof primary === 'string' ? primary : primary.text} ${t('configure_button_description')}`}\n </HiddenText>\n </span>\n )}\n\n {onRemove && (\n <span>\n <Button\n data-testid={testIds.removeButton}\n icon\n variant='simple'\n label={t('remove')}\n aria-describedby={descriptionId}\n onClick={(e: MouseEvent<HTMLButtonElement>) => {\n onRemove?.(id, e);\n }}\n >\n <Icon name='trash' />\n </Button>\n <HiddenText\n id={descriptionId}\n >{`${typeof primary === 'string' ? primary : primary.text} ${t('remove_button_description')}`}</HiddenText>\n </span>\n )}\n </Flex>\n )}\n </Flex>\n )}\n </Flex>\n\n {/* Using data here so TS can track conditional type. */}\n {data.items && data.items.length > 0 && (\n <ExpandCollapse collapsed={collapsed} id={expandCollpaseId}>\n <BaseStandardDragDropList\n accept={data.accept}\n items={data.items}\n onChange={data.onChange}\n onItemSelection={data.onItemSelection}\n />\n </ExpandCollapse>\n )}\n </Flex>\n <HiddenText id={descriptionId}>{t('list_item_control_instructions')}</HiddenText>\n </>\n );\n};\n\nconst ItemRendererWithTestIds = withTestIds(ItemRenderer, getItemRendererTestIds);\n\nBaseStandardDragDropList = forwardRef(function BaseStandardDragDropListFunction(\n {\n testId,\n accept,\n items: itemsProp,\n onChange: onChangeProp,\n onEnter,\n onItemSelection,\n pushMode,\n pullMode,\n ...restProps\n }: PropsWithoutRef<StandardDragDropListProps>,\n ref: Ref<HTMLUListElement>\n) {\n const flatIds = useMemo(() => getFlattenedIds(itemsProp), [itemsProp]);\n const { tabKeyNavigation } = useContext(tabKeyNavigationContext);\n\n const timerRef = useRef<number>();\n const newItemsRef = useRef<StandardDragDropListItemProps[]>();\n\n const mergeChangeHandler = useCallback(\n (newItems: StandardDragDropListItemProps[]) => {\n if (typeof timerRef.current === 'number' && newItemsRef.current) {\n clearTimeout(timerRef.current);\n timerRef.current = undefined;\n const refedItems = newItemsRef.current;\n newItemsRef.current = undefined;\n\n const reffedItemsCount = getFlattenedIds(refedItems).length;\n const newItemsCount = getFlattenedIds(newItems).length;\n\n // Item moved between the top level list and nested list.\n if (Math.abs(reffedItemsCount - newItemsCount) === 2) {\n const itemsWithDuplicate = reffedItemsCount > newItemsCount ? refedItems : newItems;\n\n const flatItemsWithDuplicate = getFlattenedIds(itemsWithDuplicate);\n\n const duplicateItemId = flatItemsWithDuplicate.find(\n (id, idx) => flatItemsWithDuplicate.indexOf(id) !== idx\n );\n\n // Should never happen.\n if (!duplicateItemId) return;\n\n // The duplicate was top level before.\n if (itemsProp.some(({ id }) => id === duplicateItemId)) {\n onChangeProp?.(itemsWithDuplicate.filter(({ id }) => id !== duplicateItemId));\n }\n\n // The duplicate was nested before.\n else {\n onChangeProp?.(\n itemsWithDuplicate.map(innerItem => {\n if (!innerItem.items) return innerItem;\n\n if (\n itemsProp\n .find(({ id }) => id === innerItem.id)\n ?.items?.some(({ id: subItemId }) => subItemId === duplicateItemId)\n ) {\n return {\n ...innerItem,\n items: innerItem.items.filter(({ id }) => id !== duplicateItemId)\n };\n }\n\n return innerItem;\n })\n );\n }\n } else {\n // Failsafe for two unrelated change events within 100ms.\n onChangeProp?.(refedItems);\n onChangeProp?.(newItems);\n }\n } else {\n newItemsRef.current = newItems;\n timerRef.current = window.setTimeout(() => {\n onChangeProp?.(newItems);\n }, 100);\n }\n },\n [onChangeProp, itemsProp]\n );\n\n const itemsToRender: DraggableItem<InternalStandardDragDropListItemProps>[] = useMemo(\n () =>\n itemsProp.map(item => {\n const newItem = {\n id: item.id,\n type: item.type,\n data: {\n ...item,\n onItemSelection,\n draggable: item.draggable && !!onChangeProp\n } as InternalStandardDragDropListItemProps\n };\n if (!item.items) return newItem;\n\n return {\n ...newItem,\n data: {\n ...item,\n onItemSelection,\n accept: item.accept ?? accept,\n draggable: item.draggable && !!onChangeProp,\n onChange: onChangeProp\n ? (newItems: InternalStandardDragDropListItemProps[]) => {\n const newContentItems = itemsProp.map(topLevelItem =>\n topLevelItem.id === item.id && topLevelItem.items\n ? { ...topLevelItem, items: newItems }\n : topLevelItem\n );\n\n const flatNewItems = getFlattenedIds(newContentItems);\n\n if (\n itemsProp.some(propItem => !!propItem.items) &&\n flatIds.length !== flatNewItems.length\n ) {\n // An item may be \"removed\" or \"duplicated\".\n mergeChangeHandler(newContentItems);\n } else {\n onChangeProp(newContentItems);\n }\n }\n : undefined\n } as InternalStandardDragDropListItemProps\n };\n }),\n [accept, itemsProp, onChangeProp, tabKeyNavigation, flatIds, mergeChangeHandler]\n );\n\n const onChange = useCallback(\n (newItems: DraggableItem<InternalStandardDragDropListItemProps>[]) => {\n const newContentItems = newItems.map(({ data: { onChange: _, ...data } }) => {\n return data;\n });\n const flatNewItems = getFlattenedIds(newContentItems);\n\n if (itemsProp.some(propItem => !!propItem.items) && flatIds.length !== flatNewItems.length) {\n // An item may be \"removed\" or \"duplicated\".\n mergeChangeHandler(newContentItems);\n } else {\n onChangeProp?.(newContentItems);\n }\n },\n [onChangeProp, flatIds, mergeChangeHandler]\n );\n\n return (\n <DragDropList\n testId={testId}\n {...restProps}\n ref={ref}\n accept={accept}\n items={itemsToRender}\n pushMode={pushMode}\n pullMode={pullMode}\n itemRenderer={ItemRendererWithTestIds}\n emptyRenderer={EmptyState}\n onChange={onChange}\n onEnter={\n onEnter as (\n item: DraggableItem<InternalStandardDragDropListItemProps>\n ) => DraggableItem<InternalStandardDragDropListItemProps>\n }\n />\n );\n});\n\ntype CombinedProps = StandardDragDropListProps & InternalStandardDragDropListItemProps;\n\nconst StandardDragDropList = forwardRef<HTMLDivElement, CombinedProps>(\n (\n {\n testId,\n accept,\n pushMode,\n pullMode,\n items: itemsProp,\n heading: title,\n info,\n footer,\n headingTag = 'h2',\n additionalInfo,\n onChange,\n onEnter,\n onItemSelection,\n ...restProps\n }: PropsWithoutRef<StandardDragDropListProps>,\n ref: StandardDragDropListProps['ref']\n ) => {\n const [tabKeyNavigation, setTabKeyNavigation] = useState(false);\n const contextValue = useMemo(\n () => ({ tabKeyNavigation, setTabKeyNavigation }),\n [tabKeyNavigation]\n );\n const containerRef = useConsolidatedRef(ref);\n const listRef = useRef<HTMLUListElement>(null);\n const t = useI18n();\n const testIds = useTestIds(testId, getStandardDragDropListTestIds);\n const { announceAssertive } = useLiveLog();\n const [firstListElement, setFirstListElement] = useElement<HTMLLIElement>(null);\n\n useEffect(() => {\n setFirstListElement(\n listRef.current?.querySelector<HTMLLIElement>('[role=\"listitem\"]') ?? null\n );\n }, [itemsProp]);\n\n const arrowNavigationRef = tabKeyNavigation ? { current: null } : listRef;\n\n const heading = title ? (\n <Text variant={headingTag} role='heading'>\n {title}\n </Text>\n ) : null;\n\n const infoText = info ? <Text variant='primary'>{info}</Text> : undefined;\n\n useFocusWithin([containerRef], isFocused => {\n if (isFocused) {\n announceAssertive({ message: (title ?? '') + info });\n }\n });\n\n useFocusWithin([listRef], isFocused => {\n if (!isFocused) {\n setTabKeyNavigation(false);\n }\n });\n\n useEvent(\n 'keydown',\n e => {\n if (e.key === 'Tab' && !tabKeyNavigation && listRef.current) {\n listRef.current.inert = true; // Prevents focus from moving to the list items\n setTimeout(() => {\n if (listRef.current) listRef.current.inert = false;\n }, 0);\n }\n },\n { target: listRef }\n );\n\n useArrows(\n arrowNavigationRef,\n {\n cycle: false,\n selector: '[role=\"listitem\"]',\n dir: 'up-down',\n initialFocusElement: firstListElement\n },\n [tabKeyNavigation, firstListElement]\n );\n\n const descriptionId = useUID();\n\n return (\n <tabKeyNavigationContext.Provider value={contextValue}>\n <StyledStandardDragDropList ref={containerRef} data-testid={testIds.root} {...restProps}>\n {heading && (\n <Flex container={{ direction: 'column', gap: 1, pad: [1, undefined] }}>\n <Flex\n data-testid={testIds.header}\n container={{\n justify: 'between',\n alignItems: 'center',\n gap: 1\n }}\n as='header'\n >\n {additionalInfo ? (\n <Flex container>\n {heading}\n {/* Can assert title when heading is defined */}\n <AdditionalInfo heading={additionalInfo.heading ?? title!}>\n {additionalInfo.content}\n </AdditionalInfo>\n </Flex>\n ) : (\n heading\n )}\n </Flex>\n {infoText}\n </Flex>\n )}\n <BaseStandardDragDropList\n testId={testId}\n accept={accept}\n pushMode={pushMode}\n pullMode={pullMode}\n items={itemsProp}\n onChange={onChange}\n onEnter={onEnter}\n onItemSelection={onItemSelection}\n aria-describedby={descriptionId}\n ref={listRef}\n />\n {footer && (\n <Flex\n container={{\n alignItems: 'center',\n itemGap: 1,\n pad: [1, undefined]\n }}\n as='footer'\n onKeyDown={(e: KeyboardEvent) => {\n if (e.key === 'Tab' && e.shiftKey && firstListElement) {\n e.preventDefault();\n firstListElement.tabIndex = 0;\n firstListElement?.focus();\n }\n }}\n >\n {footer}\n </Flex>\n )}\n <HiddenText id={descriptionId}>{t('list_item_nav_instructions')}</HiddenText>\n </StyledStandardDragDropList>\n </tabKeyNavigationContext.Provider>\n );\n }\n);\n\nexport default withTestIds(StandardDragDropList, getStandardDragDropListTestIds);\n"]}
1
+ {"version":3,"file":"StandardDragDropList.js","sourceRoot":"","sources":["../../../src/components/StandardDragDropList/StandardDragDropList.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,aAAa,EACb,UAAU,EACV,WAAW,EACX,UAAU,EACV,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,EACT,MAAM,OAAO,CAAC;AAUf,OAAO,EACL,IAAI,EACJ,YAAY,EACZ,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,OAAO,EACP,UAAU,EACV,cAAc,EACd,MAAM,EACN,OAAO,EACP,UAAU,EACV,UAAU,EACV,WAAW,EACX,cAAc,EACd,QAAQ,EACR,WAAW,EACX,UAAU,EACV,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,SAAS,EACT,aAAa,EACb,QAAQ,EACT,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,QAAQ,MAAM,6DAA6D,CAAC;AACxF,OAAO,KAAK,QAAQ,MAAM,6DAA6D,CAAC;AACxF,OAAO,KAAK,aAAa,MAAM,mEAAmE,CAAC;AACnG,OAAO,KAAK,gBAAgB,MAAM,sEAAsE,CAAC;AACzG,OAAO,KAAK,aAAa,MAAM,mEAAmE,CAAC;AAEnG,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAG3C,OAAO,UAAU,MAAM,eAAe,CAAC;AAEvC,OAAO,EACL,0BAA0B,EAC1B,8BAA8B,EAC9B,0BAA0B,EAC1B,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,4BAA4B,EAC7B,MAAM,+BAA+B,CAAC;AAKvC,OAAO,EACL,sBAAsB,EACtB,8BAA8B,EAC/B,MAAM,iCAAiC,CAAC;AAEzC,YAAY,CAAC,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,CAAC,CAAC;AAoBjF,IAAI,wBAEH,CAAC;AAOF,MAAM,u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Q,EACX,SAAS,EAAE,CAAC,CAAgB,EAAE,EAAE;wBAC9B,IAAI,CAAC,CAAC,GAAG,KAAK,KAAK,IAAI,CAAC,CAAC,QAAQ,IAAI,gBAAgB,EAAE,CAAC;4BACtD,CAAC,CAAC,cAAc,EAAE,CAAC;4BACnB,gBAAgB,CAAC,QAAQ,GAAG,CAAC,CAAC;4BAC9B,gBAAgB,EAAE,KAAK,EAAE,CAAC;wBAC5B,CAAC;oBACH,CAAC,YAEA,MAAM,GACF,CACR,EACD,KAAC,UAAU,IAAC,EAAE,EAAE,aAAa,YAAG,CAAC,CAAC,4BAA4B,CAAC,GAAc,IAClD,GACI,CACpC,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC,oBAAoB,EAAE,8BAA8B,CAAC,CAAC","sourcesContent":["import {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState\n} from 'react';\nimport type {\n Dispatch,\n KeyboardEvent,\n MouseEvent,\n PropsWithoutRef,\n Ref,\n SetStateAction\n} from 'react';\n\nimport {\n Flex,\n registerIcon,\n Icon,\n Text,\n Button,\n Link,\n useI18n,\n EmptyState,\n ExpandCollapse,\n useUID,\n Tooltip,\n useElement,\n useTestIds,\n withTestIds,\n AdditionalInfo,\n Checkbox,\n RadioButton,\n HiddenText,\n useLiveLog,\n useFocusWithin,\n useConsolidatedRef,\n useArrows,\n getFocusables,\n useEvent\n} from '@pega/cosmos-react-core';\nimport type { ForwardRefForwardPropsComponent, OmitStrict } from '@pega/cosmos-react-core';\nimport * as DragIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/drag.icon';\nimport * as PlusIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/plus.icon';\nimport * as CaretDownIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-down.icon';\nimport * as DiamondMinusIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/diamond-minus.icon';\nimport * as WarnSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/warn-solid.icon';\n\nimport DragDropList from '../DragDropList';\nimport type { ItemRendererProps } from '../DragDropList';\nimport type { DraggableItem } from '../Draggable';\nimport DragHandle from '../DragHandle';\n\nimport {\n StyledStandardDragDropList,\n StyledStandardDragDropListItem,\n StyledExpandCollapseToggle,\n StyledItemActions,\n StyledItemContent,\n StyledItemStatus,\n StyledPrimary,\n StyledSecondary,\n StyledListItemInner,\n StyledItemSecondaryContainer\n} from './StandardDragDropList.styles';\nimport type {\n StandardDragDropListProps,\n StandardDragDropListItemProps\n} from './StandardDragDropList.types';\nimport {\n getItemRendererTestIds,\n getStandardDragDropListTestIds\n} from './StandardDragDropList.test-ids';\n\nregisterIcon(DragIcon, PlusIcon, CaretDownIcon, DiamondMinusIcon, WarnSolidIcon);\n\ntype InternalStandardDragDropListItemProps = StandardDragDropListItemProps &\n (\n | {\n items: StandardDragDropListItemProps[];\n onItemSelection?: StandardDragDropListProps['onItemSelection'];\n itemSelectionMode?: StandardDragDropListProps['itemSelectionMode'];\n accept: StandardDragDropListProps['accept'];\n onChange: StandardDragDropListProps['onChange'];\n }\n | {\n items?: undefined;\n onItemSelection?: StandardDragDropListProps['onItemSelection'];\n itemSelectionMode?: StandardDragDropListProps['itemSelectionMode'];\n accept?: never;\n onChange?: never;\n }\n );\n\nlet BaseStandardDragDropList: ForwardRefForwardPropsComponent<\n OmitStrict<StandardDragDropListProps, 'ref'> & { ref: Ref<HTMLUListElement> }\n>;\n\ninterface TabKeyNavigationContextValue {\n tabKeyNavigation: boolean;\n setTabKeyNavigation: Dispatch<SetStateAction<boolean>>;\n}\n\nconst tabKeyNavigationContext = createContext<TabKeyNavigationContextValue>({\n tabKeyNavigation: false,\n setTabKeyNavigation: () => {}\n});\n\nconst ItemStatus = ({\n message,\n type\n}: Partial<NonNullable<StandardDragDropListItemProps['status']>>) => {\n const [ttt, setTTT] = useElement(null);\n const iconName = type === 'warning' ? 'diamond-minus' : 'warn-solid';\n\n return (\n <StyledItemStatus aria-live='polite' role='status'>\n {message && (\n <Text variant='secondary' status={type}>\n <Flex container={{ gap: 0.5 }}>\n <Icon ref={setTTT} name={iconName} role='status' tabIndex={0} aria-label={type} />\n <Tooltip target={ttt} aria-hidden showDelay='none' hideDelay='none'>\n {message}\n </Tooltip>\n </Flex>\n </Text>\n )}\n </StyledItemStatus>\n );\n};\n\nconst getFlattenedIds = (\n items: StandardDragDropListItemProps[]\n): StandardDragDropListItemProps['id'][] => {\n return items.flatMap(item => {\n return item.items ? [item.id, ...item.items.map(({ id }) => id)] : [item.id];\n });\n};\n\nconst ItemRenderer = ({\n testId,\n dragRef,\n previewRef,\n isDragging,\n data: {\n id,\n // Remove type for DOM restProps\n type,\n accept,\n primary,\n secondary,\n draggable = true,\n status,\n items,\n icon,\n onConfigure,\n onRemove,\n onAddTo,\n onChange,\n onItemSelection,\n itemSelectionMode = 'multi',\n selected,\n ...restProps\n },\n data\n}: ItemRendererProps<InternalStandardDragDropListItemProps>) => {\n const t = useI18n();\n const [collapsed, setCollapsed] = useState(false);\n const expandCollpaseId = useUID();\n const testIds = useTestIds(testId, getItemRendererTestIds);\n const { tabKeyNavigation, setTabKeyNavigation } = useContext(tabKeyNavigationContext);\n const listItemRef = useRef<HTMLLIElement>(null);\n const containerRef = useConsolidatedRef<HTMLLIElement>(listItemRef, previewRef);\n\n const hasActions = !!(onConfigure ?? onRemove ?? onAddTo);\n const numberOfActions = [onConfigure, onRemove, onAddTo].filter(Boolean).length;\n\n const [primaryTextEl, setPrimaryTextEl] = useElement<\n HTMLSpanElement | HTMLAnchorElement | HTMLButtonElement\n >(null);\n const [secondaryTextEl, setSecondaryTextEl] = useElement<HTMLSpanElement>(null);\n\n useEvent(\n 'keydown',\n e => {\n if (e.key === 'Enter' && !tabKeyNavigation) {\n e.preventDefault();\n setTabKeyNavigation(true);\n getFocusables(listItemRef)[0]?.focus();\n }\n if (e.key === 'Escape' && tabKeyNavigation) {\n e.preventDefault();\n setTabKeyNavigation(false);\n listItemRef.current?.focus();\n }\n },\n { target: listItemRef, dependencies: [tabKeyNavigation] }\n );\n\n const primaryEl = useMemo(() => {\n const primaryText = typeof primary === 'string' ? primary : primary.text;\n\n const tooltip = (\n <Tooltip smart target={primaryTextEl} showDelay='none' hideDelay='none'>\n {primaryText}\n </Tooltip>\n );\n\n const labelText = collapsed ? t('expand') : t('collapse');\n\n if (items) {\n return (\n <>\n <StyledExpandCollapseToggle\n data-testid={testIds.expandCollapseButton}\n variant='simple'\n icon\n label={labelText}\n aria-label={`${labelText} - ${primaryText}`}\n onClick={() => setCollapsed(cur => !cur)}\n aria-owns={expandCollpaseId}\n aria-expanded={!collapsed}\n tabIndex={tabKeyNavigation ? 0 : -1}\n >\n <Icon name='caret-down' />\n </StyledExpandCollapseToggle>\n <span ref={setPrimaryTextEl}>\n {primaryText}\n {tooltip}\n </span>\n </>\n );\n }\n\n if (typeof primary === 'string') {\n return (\n <span ref={setPrimaryTextEl}>\n {primaryText}\n {tooltip}\n </span>\n );\n }\n\n if (primary.onPreview && primary.href) {\n return (\n <Link\n data-testid={testIds.primary}\n href={primary.href}\n onClick={primary.onClick}\n onPreview={primary.onPreview}\n ref={setPrimaryTextEl}\n previewable\n >\n <StyledPrimary>\n {primaryText}\n {tooltip}\n </StyledPrimary>\n </Link>\n );\n }\n\n return (\n <Button\n data-testid={testIds.primary}\n variant='link'\n onClick={primary.onClick}\n href={primary.href}\n ref={setPrimaryTextEl}\n >\n <StyledPrimary>\n {primaryText}\n {tooltip}\n </StyledPrimary>\n </Button>\n );\n }, [t, items, primary, collapsed, expandCollpaseId, primaryTextEl]);\n\n return (\n <Flex\n data-testid={testIds.root}\n {...restProps}\n container={{ direction: 'column' }}\n as={StyledStandardDragDropListItem}\n ref={containerRef}\n isDragging={isDragging}\n hasActions={hasActions}\n role='listitem'\n aria-label={primary}\n tabIndex={tabKeyNavigation ? -1 : 0}\n >\n <Flex\n container={{ alignItems: 'center' }}\n as={StyledListItemInner}\n isDraggable={draggable}\n isSelectable={!!onItemSelection}\n hasActions={hasActions}\n hasVisual={!!status || !!icon}\n >\n {draggable && (\n <DragHandle\n itemId={id}\n ref={dragRef}\n data-testid={testIds.dragHandle}\n aria-label={typeof primary === 'string' ? primary : primary.text}\n />\n )}\n <Flex container={{ alignItems: 'center', gap: 0.5 }} item={{ grow: 1, shrink: 1 }}>\n <Flex\n container={{ alignItems: 'center', gap: status || icon ? 1 : undefined, pad: 0.5 }}\n as={StyledItemContent}\n >\n {onItemSelection &&\n !data.items &&\n (itemSelectionMode === 'single' ? (\n <RadioButton\n data-testid={testIds.radio}\n aria-label={typeof primary === 'string' ? primary : primary.text}\n checked={selected}\n onChange={e => onItemSelection({ ...data, selected: e.target.checked })}\n />\n ) : (\n <Checkbox\n data-testid={testIds.checkbox}\n aria-label={typeof primary === 'string' ? primary : primary.text}\n checked={selected}\n onChange={e => onItemSelection({ ...data, selected: e.target.checked })}\n />\n ))}\n {status && <ItemStatus type={status?.type} message={status?.message} />}\n {icon && !items && <Icon data-testid={testIds.icon} {...icon} size='s' />}\n\n {primaryEl}\n </Flex>\n </Flex>\n\n {secondary && (\n <Flex\n container={{ alignItems: 'center', justify: 'end', gap: 0.5 }}\n // flex-shrink: 100000 to crush secondary text before primary\n item={{ grow: 0, shrink: 100000 }}\n numberOfActions={numberOfActions}\n as={StyledItemSecondaryContainer}\n >\n {secondary && (\n <StyledSecondary variant='secondary' ref={setSecondaryTextEl}>\n {secondary}\n <Tooltip smart target={secondaryTextEl} showDelay='none' hideDelay='none'>\n {secondary}\n </Tooltip>\n </StyledSecondary>\n )}\n </Flex>\n )}\n\n {hasActions && (\n <Flex container={{ alignItems: 'center', gap: 0.5 }} as={StyledItemActions}>\n {onAddTo && (\n <span>\n <Button\n data-testid={testIds.addButton}\n icon\n variant='simple'\n label={t('add')}\n aria-label={t('add_noun', [typeof primary === 'string' ? primary : primary.text])}\n onClick={(e: MouseEvent<HTMLButtonElement>) => {\n onAddTo?.(id, e);\n }}\n >\n <Icon name='plus' />\n </Button>\n </span>\n )}\n\n {onConfigure && (\n <span>\n <Button\n data-testid={testIds.configureButton}\n icon\n variant='simple'\n label={t('configure')}\n aria-label={t('configure_noun', [\n typeof primary === 'string' ? primary : primary.text\n ])}\n onClick={(e: MouseEvent<HTMLButtonElement>) => {\n onConfigure?.(id, e);\n }}\n >\n <Icon name='gear' />\n </Button>\n </span>\n )}\n\n {onRemove && (\n <span>\n <Button\n data-testid={testIds.removeButton}\n icon\n variant='simple'\n label={t('remove')}\n aria-label={t('remove_noun', [\n typeof primary === 'string' ? primary : primary.text\n ])}\n onClick={(e: MouseEvent<HTMLButtonElement>) => {\n onRemove?.(id, e);\n }}\n >\n <Icon name='trash' />\n </Button>\n </span>\n )}\n </Flex>\n )}\n </Flex>\n\n {/* Using data here so TS can track conditional type. */}\n {data.items && data.items.length > 0 && (\n <ExpandCollapse collapsed={collapsed} id={expandCollpaseId}>\n <BaseStandardDragDropList\n accept={data.accept}\n items={data.items}\n onChange={data.onChange}\n onItemSelection={data.onItemSelection}\n itemSelectionMode={data.itemSelectionMode}\n />\n </ExpandCollapse>\n )}\n </Flex>\n );\n};\n\nconst ItemRendererWithTestIds = withTestIds(ItemRenderer, getItemRendererTestIds);\n\nBaseStandardDragDropList = forwardRef(function BaseStandardDragDropListFunction(\n {\n testId,\n accept,\n items: itemsProp,\n onChange: onChangeProp,\n onEnter,\n onItemSelection,\n itemSelectionMode = 'multi',\n pushMode,\n pullMode,\n ...restProps\n }: PropsWithoutRef<StandardDragDropListProps>,\n ref: Ref<HTMLUListElement>\n) {\n const flatIds = useMemo(() => getFlattenedIds(itemsProp), [itemsProp]);\n const { tabKeyNavigation } = useContext(tabKeyNavigationContext);\n\n const timerRef = useRef<number>();\n const newItemsRef = useRef<StandardDragDropListItemProps[]>();\n\n const mergeChangeHandler = useCallback(\n (newItems: StandardDragDropListItemProps[]) => {\n if (typeof timerRef.current === 'number' && newItemsRef.current) {\n clearTimeout(timerRef.current);\n timerRef.current = undefined;\n const refedItems = newItemsRef.current;\n newItemsRef.current = undefined;\n\n const reffedItemsCount = getFlattenedIds(refedItems).length;\n const newItemsCount = getFlattenedIds(newItems).length;\n\n // Item moved between the top level list and nested list.\n if (Math.abs(reffedItemsCount - newItemsCount) === 2) {\n const itemsWithDuplicate = reffedItemsCount > newItemsCount ? refedItems : newItems;\n\n const flatItemsWithDuplicate = getFlattenedIds(itemsWithDuplicate);\n\n const duplicateItemId = flatItemsWithDuplicate.find(\n (id, idx) => flatItemsWithDuplicate.indexOf(id) !== idx\n );\n\n // Should never happen.\n if (!duplicateItemId) return;\n\n // The duplicate was top level before.\n if (itemsProp.some(({ id }) => id === duplicateItemId)) {\n onChangeProp?.(itemsWithDuplicate.filter(({ id }) => id !== duplicateItemId));\n }\n\n // The duplicate was nested before.\n else {\n onChangeProp?.(\n itemsWithDuplicate.map(innerItem => {\n if (!innerItem.items) return innerItem;\n\n if (\n itemsProp\n .find(({ id }) => id === innerItem.id)\n ?.items?.some(({ id: subItemId }) => subItemId === duplicateItemId)\n ) {\n return {\n ...innerItem,\n items: innerItem.items.filter(({ id }) => id !== duplicateItemId)\n };\n }\n\n return innerItem;\n })\n );\n }\n } else {\n // Failsafe for two unrelated change events within 100ms.\n onChangeProp?.(refedItems);\n onChangeProp?.(newItems);\n }\n } else {\n newItemsRef.current = newItems;\n timerRef.current = window.setTimeout(() => {\n onChangeProp?.(newItems);\n }, 100);\n }\n },\n [onChangeProp, itemsProp]\n );\n\n const itemsToRender: DraggableItem<InternalStandardDragDropListItemProps>[] = useMemo(\n () =>\n itemsProp.map(item => {\n const newItem = {\n id: item.id,\n type: item.type,\n data: {\n ...item,\n onItemSelection,\n itemSelectionMode,\n draggable: item.draggable && !!onChangeProp\n } as InternalStandardDragDropListItemProps\n };\n if (!item.items) return newItem;\n\n return {\n ...newItem,\n data: {\n ...item,\n onItemSelection,\n itemSelectionMode,\n accept: item.accept ?? accept,\n draggable: item.draggable && !!onChangeProp,\n onChange: onChangeProp\n ? (newItems: InternalStandardDragDropListItemProps[]) => {\n const newContentItems = itemsProp.map(topLevelItem =>\n topLevelItem.id === item.id && topLevelItem.items\n ? { ...topLevelItem, items: newItems }\n : topLevelItem\n );\n\n const flatNewItems = getFlattenedIds(newContentItems);\n\n if (\n itemsProp.some(propItem => !!propItem.items) &&\n flatIds.length !== flatNewItems.length\n ) {\n // An item may be \"removed\" or \"duplicated\".\n mergeChangeHandler(newContentItems);\n } else {\n onChangeProp(newContentItems);\n }\n }\n : undefined\n } as InternalStandardDragDropListItemProps\n };\n }),\n [\n accept,\n itemsProp,\n onChangeProp,\n itemSelectionMode,\n tabKeyNavigation,\n flatIds,\n mergeChangeHandler\n ]\n );\n\n const onChange = useCallback(\n (newItems: DraggableItem<InternalStandardDragDropListItemProps>[]) => {\n const newContentItems = newItems.map(({ data: { onChange: _, ...data } }) => {\n return data;\n });\n const flatNewItems = getFlattenedIds(newContentItems);\n\n if (itemsProp.some(propItem => !!propItem.items) && flatIds.length !== flatNewItems.length) {\n // An item may be \"removed\" or \"duplicated\".\n mergeChangeHandler(newContentItems);\n } else {\n onChangeProp?.(newContentItems);\n }\n },\n [onChangeProp, flatIds, mergeChangeHandler]\n );\n\n return (\n <DragDropList\n testId={testId}\n {...restProps}\n ref={ref}\n accept={accept}\n items={itemsToRender}\n pushMode={pushMode}\n pullMode={pullMode}\n itemRenderer={ItemRendererWithTestIds}\n emptyRenderer={EmptyState}\n onChange={onChange}\n onEnter={\n onEnter as (\n item: DraggableItem<InternalStandardDragDropListItemProps>\n ) => DraggableItem<InternalStandardDragDropListItemProps>\n }\n />\n );\n});\n\ntype CombinedProps = StandardDragDropListProps & InternalStandardDragDropListItemProps;\n\nconst StandardDragDropList = forwardRef<HTMLDivElement, CombinedProps>(\n (\n {\n testId,\n accept,\n pushMode,\n pullMode,\n items: itemsProp,\n heading: title,\n info,\n footer,\n headingTag = 'h2',\n additionalInfo,\n onChange,\n onEnter,\n onItemSelection,\n itemSelectionMode = 'multi',\n ...restProps\n }: PropsWithoutRef<StandardDragDropListProps>,\n ref: StandardDragDropListProps['ref']\n ) => {\n const [tabKeyNavigation, setTabKeyNavigation] = useState(false);\n const contextValue = useMemo(\n () => ({ tabKeyNavigation, setTabKeyNavigation }),\n [tabKeyNavigation]\n );\n const containerRef = useConsolidatedRef(ref);\n const listRef = useRef<HTMLUListElement>(null);\n const t = useI18n();\n const testIds = useTestIds(testId, getStandardDragDropListTestIds);\n const { announceAssertive } = useLiveLog();\n const [firstListElement, setFirstListElement] = useElement<HTMLLIElement>(null);\n\n useEffect(() => {\n setFirstListElement(\n listRef.current?.querySelector<HTMLLIElement>('[role=\"listitem\"]') ?? null\n );\n }, [itemsProp]);\n\n const arrowNavigationRef = tabKeyNavigation ? { current: null } : listRef;\n\n const heading = title ? (\n <Text variant={headingTag} role='heading'>\n {title}\n </Text>\n ) : null;\n\n const infoText = info ? <Text variant='primary'>{info}</Text> : undefined;\n\n useFocusWithin([containerRef], isFocused => {\n if (isFocused) {\n announceAssertive({ message: (title ?? '') + info });\n }\n });\n\n useFocusWithin([listRef], isFocused => {\n if (!isFocused) {\n setTabKeyNavigation(false);\n }\n });\n\n useEvent(\n 'keydown',\n e => {\n if (e.key === 'Tab' && !tabKeyNavigation && listRef.current) {\n listRef.current.inert = true; // Prevents focus from moving to the list items\n setTimeout(() => {\n if (listRef.current) listRef.current.inert = false;\n }, 0);\n }\n },\n { target: listRef }\n );\n\n useArrows(\n arrowNavigationRef,\n {\n cycle: false,\n selector: '[role=\"listitem\"]',\n dir: 'up-down',\n initialFocusElement: firstListElement\n },\n [tabKeyNavigation, firstListElement]\n );\n\n const descriptionId = useUID();\n\n return (\n <tabKeyNavigationContext.Provider value={contextValue}>\n <StyledStandardDragDropList ref={containerRef} data-testid={testIds.root} {...restProps}>\n {heading && (\n <Flex container={{ direction: 'column', gap: 1, pad: [1, undefined] }}>\n <Flex\n data-testid={testIds.header}\n container={{\n justify: 'between',\n alignItems: 'center',\n gap: 1\n }}\n as='header'\n >\n {additionalInfo ? (\n <Flex container>\n {heading}\n {/* Can assert title when heading is defined */}\n <AdditionalInfo heading={additionalInfo.heading ?? title!}>\n {additionalInfo.content}\n </AdditionalInfo>\n </Flex>\n ) : (\n heading\n )}\n </Flex>\n {infoText}\n </Flex>\n )}\n <BaseStandardDragDropList\n testId={testId}\n accept={accept}\n pushMode={pushMode}\n pullMode={pullMode}\n items={itemsProp}\n onChange={onChange}\n onEnter={onEnter}\n onItemSelection={onItemSelection}\n itemSelectionMode={itemSelectionMode}\n aria-describedby={descriptionId}\n ref={listRef}\n />\n {footer && (\n <Flex\n container={{\n alignItems: 'center',\n itemGap: 1,\n pad: [1, undefined]\n }}\n as='footer'\n onKeyDown={(e: KeyboardEvent) => {\n if (e.key === 'Tab' && e.shiftKey && firstListElement) {\n e.preventDefault();\n firstListElement.tabIndex = 0;\n firstListElement?.focus();\n }\n }}\n >\n {footer}\n </Flex>\n )}\n <HiddenText id={descriptionId}>{t('list_item_nav_instructions')}</HiddenText>\n </StyledStandardDragDropList>\n </tabKeyNavigationContext.Provider>\n );\n }\n);\n\nexport default withTestIds(StandardDragDropList, getStandardDragDropListTestIds);\n"]}
@@ -1,22 +1,29 @@
1
- import { type DefaultTheme, type StyledComponent } from 'styled-components';
2
- export declare const StyledExpandCollapseToggle: StyledComponent<import("@pega/cosmos-react-core").ForwardRefForwardPropsComponent<import("@pega/cosmos-react-core").ButtonProps>, DefaultTheme, {}, never>;
3
- export declare const StyledItemStatus: StyledComponent<"div", DefaultTheme, {}, never>;
4
- export declare const StyledItemContent: StyledComponent<"div", DefaultTheme, {}, never>;
5
- export declare const StyledItemActions: StyledComponent<"div", DefaultTheme, {}, never>;
6
- export declare const StyledItemSecondaryContainer: StyledComponent<"div", DefaultTheme, {
1
+ import { type IStyledComponent } from 'styled-components';
2
+ import type { StandardDragDropListProps } from './StandardDragDropList.types';
3
+ export declare const StyledExpandCollapseToggle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<Omit<import("@pega/cosmos-react-core").ButtonProps, "ref"> & import("react").RefAttributes<HTMLAnchorElement | HTMLButtonElement> & import("@pega/cosmos-react-core").ForwardProps, "ref"> & {
4
+ ref?: ((instance: HTMLAnchorElement | HTMLButtonElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLAnchorElement | HTMLButtonElement> | null | undefined;
5
+ }, never>> & string & Omit<import("@pega/cosmos-react-core").ForwardRefForwardPropsComponent<import("@pega/cosmos-react-core").ButtonProps>, keyof import("react").Component<any, {}, any>>;
6
+ export declare const StyledItemStatus: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
7
+ export declare const StyledItemContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
8
+ export declare const StyledItemSecondaryContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
9
+ export declare const StyledItemActions: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
7
10
  numberOfActions: number;
8
- }, never>;
9
- export declare const StyledPrimary: StyledComponent<import("@pega/cosmos-react-core").ForwardRefForwardPropsComponent<import("@pega/cosmos-react-core").TextProps>, DefaultTheme, {}, never>;
10
- export declare const StyledSecondary: StyledComponent<import("@pega/cosmos-react-core").ForwardRefForwardPropsComponent<import("@pega/cosmos-react-core").TextProps>, DefaultTheme, {}, never>;
11
- export declare const StyledListItemInner: StyledComponent<"div", DefaultTheme, {
11
+ }>> & string;
12
+ export declare const StyledPrimary: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<Omit<import("@pega/cosmos-react-core").TextProps, "ref"> & import("react").RefAttributes<HTMLHeadingElement | HTMLSpanElement> & import("@pega/cosmos-react-core").ForwardProps, "ref"> & {
13
+ ref?: ((instance: HTMLHeadingElement | HTMLSpanElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLHeadingElement | HTMLSpanElement> | null | undefined;
14
+ }, never>> & string & Omit<import("@pega/cosmos-react-core").ForwardRefForwardPropsComponent<import("@pega/cosmos-react-core").TextProps>, keyof import("react").Component<any, {}, any>>;
15
+ export declare const StyledSecondary: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<Omit<import("@pega/cosmos-react-core").TextProps, "ref"> & import("react").RefAttributes<HTMLHeadingElement | HTMLSpanElement> & import("@pega/cosmos-react-core").ForwardProps, "ref"> & {
16
+ ref?: ((instance: HTMLHeadingElement | HTMLSpanElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLHeadingElement | HTMLSpanElement> | null | undefined;
17
+ }, never>> & string & Omit<import("@pega/cosmos-react-core").ForwardRefForwardPropsComponent<import("@pega/cosmos-react-core").TextProps>, keyof import("react").Component<any, {}, any>>;
18
+ export declare const StyledListItemInner: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
12
19
  isDraggable?: boolean;
13
20
  hasActions?: boolean;
14
21
  hasVisual?: boolean;
15
22
  isSelectable?: boolean;
16
- }, never>;
17
- export declare const StyledStandardDragDropListItem: StyledComponent<"li", DefaultTheme, {
23
+ }>> & string;
24
+ export declare const StyledStandardDragDropListItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, {
18
25
  isDragging?: boolean;
19
26
  empty?: boolean;
20
- }, never>;
21
- export declare const StyledStandardDragDropList: StyledComponent<'div', DefaultTheme, object, never>;
27
+ }>> & string;
28
+ export declare const StyledStandardDragDropList: IStyledComponent<'web', StandardDragDropListProps>;
22
29
  //# sourceMappingURL=StandardDragDropList.styles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"StandardDragDropList.styles.d.ts","sourceRoot":"","sources":["../../../src/components/StandardDragDropList/StandardDragDropList.styles.ts"],"names":[],"mappings":"AAAA,OAAe,EAAO,KAAK,YAAY,EAAE,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAQzF,eAAO,MAAM,0BAA0B,4JAerC,CAAC;AAIH,eAAO,MAAM,gBAAgB,iDAU3B,CAAC;AAIH,eAAO,MAAM,iBAAiB,iDAe5B,CAAC;AAIH,eAAO,MAAM,iBAAiB,iDAAe,CAAC;AAE9C,eAAO,MAAM,4BAA4B;qBAAiC,MAAM;SAa/E,CAAC;AAEF,eAAO,MAAM,aAAa,0JAGzB,CAAC;AAEF,eAAO,MAAM,eAAe,0JAG3B,CAAC;AAEF,eAAO,MAAM,mBAAmB;kBAChB,OAAO;iBACR,OAAO;gBACR,OAAO;mBACJ,OAAO;SAiCtB,CAAC;AAIH,eAAO,MAAM,8BAA8B;iBAC5B,OAAO;YACZ,OAAO;SAiEf,CAAC;AAIH,eAAO,MAAM,0BAA0B,EAAE,eAAe,CAAC,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,CA8EvF,CAAC"}
1
+ {"version":3,"file":"StandardDragDropList.styles.d.ts","sourceRoot":"","sources":["../../../src/components/StandardDragDropList/StandardDragDropList.styles.ts"],"names":[],"mappings":"AAAA,OAAe,EAAO,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAQvE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAE9E,eAAO,MAAM,0BAA0B;;2LAerC,CAAC;AAIH,eAAO,MAAM,gBAAgB,6NAU3B,CAAC;AAIH,eAAO,MAAM,iBAAiB,6NAe5B,CAAC;AAIH,eAAO,MAAM,4BAA4B,6NAExC,CAAC;AAEF,eAAO,MAAM,iBAAiB;qBAAiC,MAAM;YAapE,CAAC;AAIF,eAAO,MAAM,aAAa;;yLAGzB,CAAC;AAEF,eAAO,MAAM,eAAe;;yLAE3B,CAAC;AAEF,eAAO,MAAM,mBAAmB;kBAChB,OAAO;iBACR,OAAO;gBACR,OAAO;mBACJ,OAAO;YAiCtB,CAAC;AAIH,eAAO,MAAM,8BAA8B;iBAC5B,OAAO;YACZ,OAAO;YAiEf,CAAC;AAIH,eAAO,MAAM,0BAA0B,EAAE,gBAAgB,CAAC,KAAK,EAAE,yBAAyB,CA6EtF,CAAC"}
@@ -49,8 +49,10 @@ export const StyledItemContent = styled.div(({ theme }) => {
49
49
  `;
50
50
  });
51
51
  StyledItemContent.defaultProps = defaultThemeProp;
52
- export const StyledItemActions = styled.div ``;
53
- export const StyledItemSecondaryContainer = styled.div(({ theme, numberOfActions }) => {
52
+ export const StyledItemSecondaryContainer = styled.div `
53
+ min-width: 2rem;
54
+ `;
55
+ export const StyledItemActions = styled.div(({ theme, numberOfActions }) => {
54
56
  const minContainerWidth = `calc(${numberOfActions} * ${theme.base['hit-area']['mouse-min']} + ${numberOfActions - 1} * ${theme.base.spacing} / 2)`;
55
57
  const minCoarseContainerWidth = `calc(${numberOfActions} * ${theme.base['hit-area']['finger-min']} + ${numberOfActions - 1} * ${theme.base.spacing} / 2)`;
56
58
  return css `
@@ -61,12 +63,12 @@ export const StyledItemSecondaryContainer = styled.div(({ theme, numberOfActions
61
63
  }
62
64
  `;
63
65
  });
66
+ StyledItemActions.defaultProps = defaultThemeProp;
64
67
  export const StyledPrimary = styled(Text) `
65
68
  display: inline;
66
69
  ${ellipsisOverflow};
67
70
  `;
68
71
  export const StyledSecondary = styled(Text) `
69
- max-width: 14ch;
70
72
  ${ellipsisOverflow}
71
73
  `;
72
74
  export const StyledListItemInner = styled.div(({ theme, isDraggable, hasActions, hasVisual, isSelectable }) => {
@@ -175,7 +177,6 @@ export const StyledStandardDragDropList = styled.div(({ theme }) => {
175
177
  `;
176
178
  return css `
177
179
  flex-grow: 1;
178
- background-color: ${theme.base.palette['primary-background']};
179
180
 
180
181
  ul {
181
182
  list-style: none;
@@ -1 +1 @@
1
- {"version":3,"file":"StandardDragDropList.styles.js","sourceRoot":"","sources":["../../../src/components/StandardDragDropList/StandardDragDropList.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAA2C,MAAM,mBAAmB,CAAC;AAEzF,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACnG,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,8DAA8D,CAAC;AAEtG,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACrE,MAAM,EAAE,GAAG,EAAE,GAAG,YAAY,EAAE,CAAC;IAC/B,OAAO,GAAG,CAAA;;;;;QAKJ,UAAU;8BACY,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI;;;+BAG7D,UA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cAAc,EAAE,EAAE,eAAe,EAAE,sBAAsB,EAAE,cAAc,EAAE,WAAW,EAAE,EACzF,EACF,GAAG,KAAK,CAAC;IAEV,MAAM,uBAAuB,GAAG,GAAG,CAAA;sCACD,gBAAgB,MAAM,sBAAsB;oCAC9C,gBAAgB,MAAM,sBAAsB;KAC3E,CAAC;IAEF,OAAO,GAAG,CAAA;;0BAEY,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC;;;;kBAIhD,WAAW,UAAU,WAAW;8BACpB,gBAAgB,MAAM,sBAAsB;;YAE9D,8BAA8B;;8CAEI,gBAAgB,MAAM,sBAAsB;4CAC9C,gBAAgB,MAAM,sBAAsB;;;;;;;;yBAQ/D,8BAA8B;cACzC,uBAAuB;;;;;;;yBAOZ,0BAA0B;cACrC,uBAAuB;;;;;;uCAME,KAAK,CAAC,IAAI,CAAC,OAAO;;cAE3C,8BAA8B;;;;;;;;;;;;;;;;;cAiB9B,mBAAmB;2CACU,KAAK,CAAC,IAAI,CAAC,OAAO;;;;;KAKxD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEL,0BAA0B,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css, type DefaultTheme, type StyledComponent } from 'styled-components';\n\nimport { Button, defaultThemeProp, StyledIcon, Text, useDirection } from '@pega/cosmos-react-core';\nimport { ellipsisOverflow } from '@pega/cosmos-react-core/lib/styles/mixins';\nimport { StyledPseudoRadioCheck } from '@pega/cosmos-react-core/lib/components/RadioCheck/RadioCheck';\n\nimport { StyledDragHandle } from '../DragHandle';\n\nexport const StyledExpandCollapseToggle = styled(Button)(({ theme }) => {\n const { ltr } = useDirection();\n return css`\n & > div {\n vertical-align: middle;\n }\n\n & ${StyledIcon} {\n transition: transform ${theme.base.animation.speed} ${theme.base.animation.timing.ease};\n }\n\n &[aria-expanded='false'] ${StyledIcon}:first-of-type {\n transform: rotateZ(${ltr ? '-' : ''}90deg);\n }\n `;\n});\n\nStyledExpandCollapseToggle.defaultProps = defaultThemeProp;\n\nexport const StyledItemStatus = styled.div(({ theme }) => {\n return css`\n ${StyledIcon} {\n outline: none;\n\n &:focus {\n box-shadow: ${theme.base.shadow['focus-inset']};\n }\n }\n `;\n});\n\nStyledItemStatus.defaultProps = defaultThemeProp;\n\nexport const StyledItemContent = styled.div(({ theme }) => {\n return css`\n &,\n & > :nth-child(2) {\n ${ellipsisOverflow}\n }\n\n & > ${StyledIcon} {\n margin-inline: ${theme.base.spacing};\n }\n\n & ${StyledPseudoRadioCheck} {\n margin-inline-end: 0;\n }\n `;\n});\n\nStyledItemContent.defaultProps = defaultThemeProp;\n\nexport const StyledItemActions = styled.div``;\n\nexport const StyledItemSecondaryContainer = styled.div<{ numberOfActions: number }>(\n ({ theme, numberOfActions }) => {\n const minContainerWidth = `calc(${numberOfActions} * ${theme.base['hit-area']['mouse-min']} + ${numberOfActions - 1} * ${theme.base.spacing} / 2)`;\n const minCoarseContainerWidth = `calc(${numberOfActions} * ${theme.base['hit-area']['finger-min']} + ${numberOfActions - 1} * ${theme.base.spacing} / 2)`;\n\n return css`\n min-width: ${minContainerWidth};\n\n @media (pointer: coarse) {\n min-width: ${minCoarseContainerWidth};\n }\n `;\n }\n);\n\nexport const StyledPrimary = styled(Text)`\n display: inline;\n ${ellipsisOverflow};\n`;\n\nexport const StyledSecondary = styled(Text)`\n max-width: 14ch;\n ${ellipsisOverflow}\n`;\n\nexport const StyledListItemInner = styled.div<{\n isDraggable?: boolean;\n hasActions?: boolean;\n hasVisual?: boolean;\n isSelectable?: boolean;\n}>(({ theme, isDraggable, hasActions, hasVisual, isSelectable }) => {\n return css`\n white-space: nowrap;\n padding-inline-start: calc(${theme.base.spacing} / 2);\n padding-inline-end: ${hasActions\n ? `calc(${theme.base.spacing} / 2)`\n : `calc(${theme.base.spacing} * 1.5)`};\n\n ${!isDraggable &&\n (!hasVisual || isSelectable) &&\n css`\n padding-inline-start: ${theme.base.spacing};\n `}\n ${hasVisual &&\n !isDraggable &&\n !isSelectable &&\n css`\n padding-inline-start: 0;\n `}\n\n &:has(${StyledExpandCollapseToggle}) {\n padding-inline-start: calc(${theme.base.spacing} * 0.5);\n\n &:not(:has(${StyledDragHandle})) {\n padding-inline-start: 0;\n }\n\n & > ${StyledDragHandle} {\n padding-inline-end: 0;\n }\n }\n `;\n});\n\nStyledListItemInner.defaultProps = defaultThemeProp;\n\nexport const StyledStandardDragDropListItem = styled.li<{\n isDragging?: boolean;\n empty?: boolean;\n}>(({ theme, isDragging, empty }) => {\n const bdrColor = theme.base.palette['border-line'];\n const bdr = `0.0625rem dashed ${isDragging || empty ? bdrColor : 'transparent'}`;\n\n if (empty) {\n return css`\n text-align: center;\n padding: ${theme.base.spacing};\n border: ${bdr};\n font-style: italic;\n `;\n }\n\n return css`\n position: relative;\n background: ${theme.base.palette['primary-background']};\n\n ${isDragging &&\n css`\n z-index: 1;\n\n & > div,\n span {\n opacity: 0.5;\n }\n `}\n\n &::before,\n &::after {\n content: '';\n display: block;\n position: absolute;\n height: 0.0625rem;\n left: 0;\n right: 0;\n background: ${isDragging ? theme.base.palette['primary-background'] : bdrColor};\n }\n\n &::before {\n top: 0;\n border-top: ${bdr};\n ${isDragging &&\n css`\n box-shadow: 0 0.0625rem 0 ${theme.base.palette.interactive};\n `}\n }\n\n &::after {\n bottom: -0.0625rem;\n border-bottom: ${bdr};\n ${isDragging &&\n css`\n box-shadow: 0 -0.0625rem 0 ${theme.base.palette.interactive};\n `}\n }\n\n & > ${StyledListItemInner} {\n min-height: calc(${theme.base['hit-area'].mouse} + ${theme.base.spacing});\n\n @media (pointer: coarse) {\n min-height: calc(${theme.base['hit-area']['finger-min']} + ${theme.base.spacing});\n }\n }\n `;\n});\n\nStyledStandardDragDropListItem.defaultProps = defaultThemeProp;\n\nexport const StyledStandardDragDropList: StyledComponent<'div', DefaultTheme, object, never> =\n styled.div(({ theme }) => {\n const {\n base: {\n palette: { 'border-line': borderColor },\n 'border-radius': baseBorderRadius\n },\n components: {\n 'form-control': { 'border-radius': borderRadiusMultiplier, 'border-width': borderWidth }\n }\n } = theme;\n\n const matchBottomBorderRadius = css`\n border-end-start-radius: calc(${baseBorderRadius} * ${borderRadiusMultiplier});\n border-end-end-radius: calc(${baseBorderRadius} * ${borderRadiusMultiplier});\n `;\n\n return css`\n flex-grow: 1;\n background-color: ${theme.base.palette['primary-background']};\n\n ul {\n list-style: none;\n border: ${borderWidth} solid ${borderColor};\n border-radius: calc(${baseBorderRadius} * ${borderRadiusMultiplier});\n\n > ${StyledStandardDragDropListItem} {\n &:first-child {\n border-start-start-radius: calc(${baseBorderRadius} * ${borderRadiusMultiplier});\n border-start-end-radius: calc(${baseBorderRadius} * ${borderRadiusMultiplier});\n\n &::before {\n display: none;\n }\n }\n\n &:last-child,\n &:last-child ${StyledStandardDragDropListItem}:last-child {\n ${matchBottomBorderRadius}\n\n &::after {\n display: none;\n }\n }\n\n &:last-child ${StyledStandardDragDropList} {\n ${matchBottomBorderRadius}\n }\n }\n\n ul {\n border: none;\n padding-inline: calc(3.5 * ${theme.base.spacing}) 0;\n\n > ${StyledStandardDragDropListItem} {\n &:first-child {\n border-radius: 0;\n }\n\n &:first-child::before {\n display: block;\n }\n\n &:last-child {\n border-radius: 0;\n }\n\n &:last-child::after {\n display: block;\n }\n\n ${StyledListItemInner} {\n padding-inline-start: calc(${theme.base.spacing} * 1);\n }\n }\n }\n }\n `;\n });\n\nStyledStandardDragDropList.defaultProps = defaultThemeProp;\n"]}
1
+ {"version":3,"file":"StandardDragDropList.styles.js","sourceRoot":"","sources":["../../../src/components/StandardDragDropList/StandardDragDropList.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAyB,MAAM,mBAAmB,CAAC;AAEvE,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACnG,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAA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AU,CAAC,CAAC,KAAK,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO;;;2BAGlD,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO;;;GAGpF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,8BAA8B,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE/D,MAAM,CAAC,MAAM,0BAA0B,GACrC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACvB,MAAM,EACJ,IAAI,EAAE,EACJ,OAAO,EAAE,EAAE,aAAa,EAAE,WAAW,EAAE,EACvC,eAAe,EAAE,gBAAgB,EAClC,EACD,UAAU,EAAE,EACV,cAAc,EAAE,EAAE,eAAe,EAAE,sBAAsB,EAAE,cAAc,EAAE,WAAW,EAAE,EACzF,EACF,GAAG,KAAK,CAAC;IAEV,MAAM,uBAAuB,GAAG,GAAG,CAAA;sCACD,gBAAgB,MAAM,sBAAsB;oCAC9C,gBAAgB,MAAM,sBAAsB;KAC3E,CAAC;IAEF,OAAO,GAAG,CAAA;;;;;kBAKI,WAAW,UAAU,WAAW;8BACpB,gBAAgB,MAAM,sBAAsB;;YAE9D,8BAA8B;;8CAEI,gBAAgB,MAAM,sBAAsB;4CAC9C,gBAAgB,MAAM,sBAAsB;;;;;;;;yBAQ/D,8BAA8B;cACzC,uBAAuB;;;;;;;yBAOZ,0BAA0B;cACrC,uBAAuB;;;;;;uCAME,KAAK,CAAC,IAAI,CAAC,OAAO;;cAE3C,8BAA8B;;;;;;;;;;;;;;;;;cAiB9B,mBAAmB;2CACU,KAAK,CAAC,IAAI,CAAC,OAAO;;;;;KAKxD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEL,0BAA0B,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css, type IStyledComponent } from 'styled-components';\n\nimport { Button, defaultThemeProp, StyledIcon, Text, useDirection } from '@pega/cosmos-react-core';\nimport { ellipsisOverflow } from '@pega/cosmos-react-core/lib/styles/mixins';\nimport { StyledPseudoRadioCheck } from '@pega/cosmos-react-core/lib/components/RadioCheck/RadioCheck';\n\nimport { StyledDragHandle } from '../DragHandle';\n\nimport type { StandardDragDropListProps } from './StandardDragDropList.types';\n\nexport const StyledExpandCollapseToggle = styled(Button)(({ theme }) => {\n const { ltr } = useDirection();\n return css`\n & > div {\n vertical-align: middle;\n }\n\n & ${StyledIcon} {\n transition: transform ${theme.base.animation.speed} ${theme.base.animation.timing.ease};\n }\n\n &[aria-expanded='false'] ${StyledIcon}:first-of-type {\n transform: rotateZ(${ltr ? '-' : ''}90deg);\n }\n `;\n});\n\nStyledExpandCollapseToggle.defaultProps = defaultThemeProp;\n\nexport const StyledItemStatus = styled.div(({ theme }) => {\n return css`\n ${StyledIcon} {\n outline: none;\n\n &:focus {\n box-shadow: ${theme.base.shadow['focus-inset']};\n }\n }\n `;\n});\n\nStyledItemStatus.defaultProps = defaultThemeProp;\n\nexport const StyledItemContent = styled.div(({ theme }) => {\n return css`\n &,\n & > :nth-child(2) {\n ${ellipsisOverflow}\n }\n\n & > ${StyledIcon} {\n margin-inline: ${theme.base.spacing};\n }\n\n & ${StyledPseudoRadioCheck} {\n margin-inline-end: 0;\n }\n `;\n});\n\nStyledItemContent.defaultProps = defaultThemeProp;\n\nexport const StyledItemSecondaryContainer = styled.div`\n min-width: 2rem;\n`;\n\nexport const StyledItemActions = styled.div<{ numberOfActions: number }>(\n ({ theme, numberOfActions }) => {\n const minContainerWidth = `calc(${numberOfActions} * ${theme.base['hit-area']['mouse-min']} + ${numberOfActions - 1} * ${theme.base.spacing} / 2)`;\n const minCoarseContainerWidth = `calc(${numberOfActions} * ${theme.base['hit-area']['finger-min']} + ${numberOfActions - 1} * ${theme.base.spacing} / 2)`;\n\n return css`\n min-width: ${minContainerWidth};\n\n @media (pointer: coarse) {\n min-width: ${minCoarseContainerWidth};\n }\n `;\n }\n);\n\nStyledItemActions.defaultProps = defaultThemeProp;\n\nexport const StyledPrimary = styled(Text)`\n display: inline;\n ${ellipsisOverflow};\n`;\n\nexport const StyledSecondary = styled(Text)`\n ${ellipsisOverflow}\n`;\n\nexport const StyledListItemInner = styled.div<{\n isDraggable?: boolean;\n hasActions?: boolean;\n hasVisual?: boolean;\n isSelectable?: boolean;\n}>(({ theme, isDraggable, hasActions, hasVisual, isSelectable }) => {\n return css`\n white-space: nowrap;\n padding-inline-start: calc(${theme.base.spacing} / 2);\n padding-inline-end: ${hasActions\n ? `calc(${theme.base.spacing} / 2)`\n : `calc(${theme.base.spacing} * 1.5)`};\n\n ${!isDraggable &&\n (!hasVisual || isSelectable) &&\n css`\n padding-inline-start: ${theme.base.spacing};\n `}\n ${hasVisual &&\n !isDraggable &&\n !isSelectable &&\n css`\n padding-inline-start: 0;\n `}\n\n &:has(${StyledExpandCollapseToggle}) {\n padding-inline-start: calc(${theme.base.spacing} * 0.5);\n\n &:not(:has(${StyledDragHandle})) {\n padding-inline-start: 0;\n }\n\n & > ${StyledDragHandle} {\n padding-inline-end: 0;\n }\n }\n `;\n});\n\nStyledListItemInner.defaultProps = defaultThemeProp;\n\nexport const StyledStandardDragDropListItem = styled.li<{\n isDragging?: boolean;\n empty?: boolean;\n}>(({ theme, isDragging, empty }) => {\n const bdrColor = theme.base.palette['border-line'];\n const bdr = `0.0625rem dashed ${isDragging || empty ? bdrColor : 'transparent'}`;\n\n if (empty) {\n return css`\n text-align: center;\n padding: ${theme.base.spacing};\n border: ${bdr};\n font-style: italic;\n `;\n }\n\n return css`\n position: relative;\n background: ${theme.base.palette['primary-background']};\n\n ${isDragging &&\n css`\n z-index: 1;\n\n & > div,\n span {\n opacity: 0.5;\n }\n `}\n\n &::before,\n &::after {\n content: '';\n display: block;\n position: absolute;\n height: 0.0625rem;\n left: 0;\n right: 0;\n background: ${isDragging ? theme.base.palette['primary-background'] : bdrColor};\n }\n\n &::before {\n top: 0;\n border-top: ${bdr};\n ${isDragging &&\n css`\n box-shadow: 0 0.0625rem 0 ${theme.base.palette.interactive};\n `}\n }\n\n &::after {\n bottom: -0.0625rem;\n border-bottom: ${bdr};\n ${isDragging &&\n css`\n box-shadow: 0 -0.0625rem 0 ${theme.base.palette.interactive};\n `}\n }\n\n & > ${StyledListItemInner} {\n min-height: calc(${theme.base['hit-area'].mouse} + ${theme.base.spacing});\n\n @media (pointer: coarse) {\n min-height: calc(${theme.base['hit-area']['finger-min']} + ${theme.base.spacing});\n }\n }\n `;\n});\n\nStyledStandardDragDropListItem.defaultProps = defaultThemeProp;\n\nexport const StyledStandardDragDropList: IStyledComponent<'web', StandardDragDropListProps> =\n styled.div(({ theme }) => {\n const {\n base: {\n palette: { 'border-line': borderColor },\n 'border-radius': baseBorderRadius\n },\n components: {\n 'form-control': { 'border-radius': borderRadiusMultiplier, 'border-width': borderWidth }\n }\n } = theme;\n\n const matchBottomBorderRadius = css`\n border-end-start-radius: calc(${baseBorderRadius} * ${borderRadiusMultiplier});\n border-end-end-radius: calc(${baseBorderRadius} * ${borderRadiusMultiplier});\n `;\n\n return css`\n flex-grow: 1;\n\n ul {\n list-style: none;\n border: ${borderWidth} solid ${borderColor};\n border-radius: calc(${baseBorderRadius} * ${borderRadiusMultiplier});\n\n > ${StyledStandardDragDropListItem} {\n &:first-child {\n border-start-start-radius: calc(${baseBorderRadius} * ${borderRadiusMultiplier});\n border-start-end-radius: calc(${baseBorderRadius} * ${borderRadiusMultiplier});\n\n &::before {\n display: none;\n }\n }\n\n &:last-child,\n &:last-child ${StyledStandardDragDropListItem}:last-child {\n ${matchBottomBorderRadius}\n\n &::after {\n display: none;\n }\n }\n\n &:last-child ${StyledStandardDragDropList} {\n ${matchBottomBorderRadius}\n }\n }\n\n ul {\n border: none;\n padding-inline: calc(3.5 * ${theme.base.spacing}) 0;\n\n > ${StyledStandardDragDropListItem} {\n &:first-child {\n border-radius: 0;\n }\n\n &:first-child::before {\n display: block;\n }\n\n &:last-child {\n border-radius: 0;\n }\n\n &:last-child::after {\n display: block;\n }\n\n ${StyledListItemInner} {\n padding-inline-start: calc(${theme.base.spacing} * 1);\n }\n }\n }\n }\n `;\n });\n\nStyledStandardDragDropList.defaultProps = defaultThemeProp;\n"]}
@@ -1,3 +1,3 @@
1
- export declare const getItemRendererTestIds: (testIdProp?: import("@pega/cosmos-react-core").TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["expand-collapse-button", "add-button", "configure-button", "remove-button", "drag-handle", "icon", "checkbox"]>;
1
+ export declare const getItemRendererTestIds: (testIdProp?: import("@pega/cosmos-react-core").TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["expand-collapse-button", "add-button", "configure-button", "remove-button", "drag-handle", "icon", "checkbox", "radio", "primary"]>;
2
2
  export declare const getStandardDragDropListTestIds: (testIdProp?: import("@pega/cosmos-react-core").TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["header"]>;
3
3
  //# sourceMappingURL=StandardDragDropList.test-ids.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"StandardDragDropList.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/StandardDragDropList/StandardDragDropList.test-ids.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,sBAAsB,qPAQxB,CAAC;AAEZ,eAAO,MAAM,8BAA8B,+IAEhC,CAAC"}
1
+ {"version":3,"file":"StandardDragDropList.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/StandardDragDropList/StandardDragDropList.test-ids.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,sBAAsB,yQAUxB,CAAC;AAEZ,eAAO,MAAM,8BAA8B,+IAEhC,CAAC"}
@@ -6,7 +6,9 @@ export const getItemRendererTestIds = createTestIds('standard-drag-drop-item', [
6
6
  'remove-button',
7
7
  'drag-handle',
8
8
  'icon',
9
- 'checkbox'
9
+ 'checkbox',
10
+ 'radio',
11
+ 'primary'
10
12
  ]);
11
13
  export const getStandardDragDropListTestIds = createTestIds('standard-drag-drop-list', [
12
14
  'header'
@@ -1 +1 @@
1
- {"version":3,"file":"StandardDragDropList.test-ids.js","sourceRoot":"","sources":["../../../src/components/StandardDragDropList/StandardDragDropList.test-ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,MAAM,CAAC,MAAM,sBAAsB,GAAG,aAAa,CAAC,yBAAyB,EAAE;IAC7E,wBAAwB;IACxB,YAAY;IACZ,kBAAkB;IAClB,eAAe;IACf,aAAa;IACb,MAAM;IACN,UAAU;CACF,CAAC,CAAC;AAEZ,MAAM,CAAC,MAAM,8BAA8B,GAAG,aAAa,CAAC,yBAAyB,EAAE;IACrF,QAAQ;CACA,CAAC,CAAC","sourcesContent":["import { createTestIds } from '@pega/cosmos-react-core';\n\nexport const getItemRendererTestIds = createTestIds('standard-drag-drop-item', [\n 'expand-collapse-button',\n 'add-button',\n 'configure-button',\n 'remove-button',\n 'drag-handle',\n 'icon',\n 'checkbox'\n] as const);\n\nexport const getStandardDragDropListTestIds = createTestIds('standard-drag-drop-list', [\n 'header'\n] as const);\n"]}
1
+ {"version":3,"file":"StandardDragDropList.test-ids.js","sourceRoot":"","sources":["../../../src/components/StandardDragDropList/StandardDragDropList.test-ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,MAAM,CAAC,MAAM,sBAAsB,GAAG,aAAa,CAAC,yBAAyB,EAAE;IAC7E,wBAAwB;IACxB,YAAY;IACZ,kBAAkB;IAClB,eAAe;IACf,aAAa;IACb,MAAM;IACN,UAAU;IACV,OAAO;IACP,SAAS;CACD,CAAC,CAAC;AAEZ,MAAM,CAAC,MAAM,8BAA8B,GAAG,aAAa,CAAC,yBAAyB,EAAE;IACrF,QAAQ;CACA,CAAC,CAAC","sourcesContent":["import { createTestIds } from '@pega/cosmos-react-core';\n\nexport const getItemRendererTestIds = createTestIds('standard-drag-drop-item', [\n 'expand-collapse-button',\n 'add-button',\n 'configure-button',\n 'remove-button',\n 'drag-handle',\n 'icon',\n 'checkbox',\n 'radio',\n 'primary'\n] as const);\n\nexport const getStandardDragDropListTestIds = createTestIds('standard-drag-drop-list', [\n 'header'\n] as const);\n"]}
@@ -1,5 +1,5 @@
1
1
  import type { MouseEvent, MouseEventHandler, ReactNode, Ref } from 'react';
2
- import type { TestIdProp, OmitStrict, BaseProps, NoChildrenProp, ForwardProps, HeadingTag, AdditionalInfoProps, IconProps, FormControlProps } from '@pega/cosmos-react-core';
2
+ import type { LinkProps, TestIdProp, OmitStrict, BaseProps, NoChildrenProp, ForwardProps, HeadingTag, AdditionalInfoProps, IconProps, FormControlProps } from '@pega/cosmos-react-core';
3
3
  import type { DragDropListProps } from '../DragDropList';
4
4
  export interface StandardDragDropListProps extends OmitStrict<DragDropListProps<StandardDragDropListItemProps>, 'dragHandles' | 'itemRenderer' | 'emptyRenderer' | 'items' | 'onChange'>, BaseProps, NoChildrenProp, TestIdProp {
5
5
  /** The contents of the list. */
@@ -18,8 +18,10 @@ export interface StandardDragDropListProps extends OmitStrict<DragDropListProps<
18
18
  * @default h2
19
19
  */
20
20
  headingTag?: HeadingTag;
21
- /** Enables list item selection rendering checkboxes for each. */
21
+ /** Enables list item selection, rendering radio buttons in single mode or checkboxes in multi mode. */
22
22
  onItemSelection?: (item: StandardDragDropListItemProps) => void;
23
+ /** Controls list item selection control visualization. */
24
+ itemSelectionMode?: 'single' | 'multi';
23
25
  /** A region for various list level actions */
24
26
  footer?: ReactNode;
25
27
  /**
@@ -41,6 +43,7 @@ export type StandardDragDropListItemProps = ForwardProps & {
41
43
  text: string;
42
44
  onClick: MouseEventHandler;
43
45
  href?: string;
46
+ onPreview?: LinkProps['onPreview'];
44
47
  } & ForwardProps);
45
48
  /** An additional textual representation for the item e.g. metadata. */
46
49
  secondary?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"StandardDragDropList.types.d.ts","sourceRoot":"","sources":["../../../src/components/StandardDrag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types.d.ts","sourceRoot":"","sources":["../../../src/components/StandardDragDropList/StandardDragDropList.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE3E,OAAO,KAAK,EACV,SAAS,EACT,UAAU,EACV,UAAU,EACV,SAAS,EACT,cAAc,EACd,YAAY,EACZ,UAAU,EACV,mBAAmB,EACnB,SAAS,EACT,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,MAAM,WAAW,yBACf,SAAQ,UAAU,CACd,iBAAiB,CAAC,6BAA6B,CAAC,EAChD,aAAa,GAAG,cAAc,GAAG,eAAe,GAAG,OAAO,GAAG,UAAU,CACxE,EACD,SAAS,EACT,cAAc,EACd,UAAU;IACZ,gCAAgC;IAChC,KAAK,EAAE,6BAA6B,EAAE,CAAC;IACvC,4BAA4B;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uFAAuF;IACvF,cAAc,CAAC,EAAE;QACf,OAAO,CAAC,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;QACzC,OAAO,EAAE,mBAAmB,CAAC,UAAU,CAAC,CAAC;KAC1C,CAAC;IACF,qEAAqE;IACrE,IAAI,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAChC;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,uGAAuG;IACvG,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,6BAA6B,KAAK,IAAI,CAAC;IAChE,0DAA0D;IAC1D,iBAAiB,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IACvC,8CAA8C;IAC9C,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,yBAAyB,CAAC,OAAO,CAAC,KAAK,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CACtB,GACD;IACE,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,OAAO,CAAC,EAAE,KAAK,CAAC;CACjB,CACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"StandardDragDropList.types.js","sourceRoot":"","sources":["../../../src/components/StandardDragDropList/StandardDragDropList.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { MouseEvent, MouseEventHandler, ReactNode, Ref } from 'react';\n\nimport type {\n TestIdProp,\n OmitStrict,\n BaseProps,\n NoChildrenProp,\n ForwardProps,\n HeadingTag,\n AdditionalInfoProps,\n IconProps,\n FormControlProps\n} from '@pega/cosmos-react-core';\n\nimport type { DragDropListProps } from '../DragDropList';\n\nexport interface StandardDragDropListProps\n extends OmitStrict<\n DragDropListProps<StandardDragDropListItemProps>,\n 'dragHandles' | 'itemRenderer' | 'emptyRenderer' | 'items' | 'onChange'\n >,\n BaseProps,\n NoChildrenProp,\n TestIdProp {\n /** The contents of the list. */\n items: StandardDragDropListItemProps[];\n /** A title for the list. */\n heading?: string;\n /** Renders a button that when clicked presents additional information for the list. */\n additionalInfo?: {\n heading?: AdditionalInfoProps['heading'];\n content: AdditionalInfoProps['children'];\n };\n /** For use in providing instructional information about the list. */\n info?: FormControlProps['info'];\n /**\n * Select the heading tag for header\n * @default h2\n */\n headingTag?: HeadingTag;\n /** Enables list item selection rendering checkboxes for each. */\n onItemSelection?: (item: StandardDragDropListItemProps) => void;\n /** A region for various list level actions */\n footer?: ReactNode;\n /**\n * Called when the list's content changes by way of drag for reorder, add or remove.\n * The handler is provided an array of items representing the new state.\n */\n onChange?: (items: StandardDragDropListProps['items']) => void;\n /** A ref to the root HTMLElement for the component. */\n ref?: Ref<HTMLDivElement>;\n}\n\ntype ItemAction = (\n id: StandardDragDropListItemProps['id'],\n e: MouseEvent<HTMLButtonElement>\n) => void;\n\nexport type StandardDragDropListItemProps = ForwardProps & {\n /** An identifier unique within the entire list hierarchy. */\n id: string;\n /** Indicates the type of item for determining drop acceptance by a target list. */\n type: string;\n /** The primary textual representation for the item or props for a linkable resource. */\n primary: string | ({ text: string; onClick: MouseEventHandler; href?: string } & ForwardProps);\n /** An additional textual representation for the item e.g. metadata. */\n secondary?: string;\n /** Presents the item as being in an invalidate state. */\n status?: {\n type: 'error' | 'warning';\n message: string;\n };\n /** Whether or not the item can be reordered with drag. */\n draggable?: boolean;\n /** Selected state of the item. */\n selected?: boolean;\n /** Defines the props of the icon passed to the list item */\n icon?: OmitStrict<IconProps, 'size'>;\n /**\n * If the item is configurable pass a callback to render a button.\n * The item's id and an event argument provides access to the underlying HTMLButtonElement.\n */\n onConfigure?: ItemAction;\n /**\n * If the item can be removed form the list pass a callback to render a button.\n * The handler's event argument provides access to the underlying HTMLButtonElement.\n */\n onRemove?: ItemAction;\n} & (\n | {\n /** If the item can possess a nested list of items. */\n items: StandardDragDropListItemProps[];\n /** Type of items allowed to be dropped on the list. If not passed it will inherit accept from the parent list. */\n accept?: StandardDragDropListProps['accept'];\n /** Optionally render an add button for parent item types. */\n onAddTo?: ItemAction;\n }\n | {\n items?: undefined;\n accept?: never;\n onAddTo?: never;\n }\n );\n"]}
1
+ {"version":3,"file":"StandardDragDropList.types.js","sourceRoot":"","sources":["../../../src/components/StandardDragDropList/StandardDragDropList.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { MouseEvent, MouseEventHandler, ReactNode, Ref } from 'react';\n\nimport type {\n LinkProps,\n TestIdProp,\n OmitStrict,\n BaseProps,\n NoChildrenProp,\n ForwardProps,\n HeadingTag,\n AdditionalInfoProps,\n IconProps,\n FormControlProps\n} from '@pega/cosmos-react-core';\n\nimport type { DragDropListProps } from '../DragDropList';\n\nexport interface StandardDragDropListProps\n extends OmitStrict<\n DragDropListProps<StandardDragDropListItemProps>,\n 'dragHandles' | 'itemRenderer' | 'emptyRenderer' | 'items' | 'onChange'\n >,\n BaseProps,\n NoChildrenProp,\n TestIdProp {\n /** The contents of the list. */\n items: StandardDragDropListItemProps[];\n /** A title for the list. */\n heading?: string;\n /** Renders a button that when clicked presents additional information for the list. */\n additionalInfo?: {\n heading?: AdditionalInfoProps['heading'];\n content: AdditionalInfoProps['children'];\n };\n /** For use in providing instructional information about the list. */\n info?: FormControlProps['info'];\n /**\n * Select the heading tag for header\n * @default h2\n */\n headingTag?: HeadingTag;\n /** Enables list item selection, rendering radio buttons in single mode or checkboxes in multi mode. */\n onItemSelection?: (item: StandardDragDropListItemProps) => void;\n /** Controls list item selection control visualization. */\n itemSelectionMode?: 'single' | 'multi';\n /** A region for various list level actions */\n footer?: ReactNode;\n /**\n * Called when the list's content changes by way of drag for reorder, add or remove.\n * The handler is provided an array of items representing the new state.\n */\n onChange?: (items: StandardDragDropListProps['items']) => void;\n /** A ref to the root HTMLElement for the component. */\n ref?: Ref<HTMLDivElement>;\n}\n\ntype ItemAction = (\n id: StandardDragDropListItemProps['id'],\n e: MouseEvent<HTMLButtonElement>\n) => void;\n\nexport type StandardDragDropListItemProps = ForwardProps & {\n /** An identifier unique within the entire list hierarchy. */\n id: string;\n /** Indicates the type of item for determining drop acceptance by a target list. */\n type: string;\n /** The primary textual representation for the item or props for a linkable resource. */\n primary:\n | string\n | ({\n text: string;\n onClick: MouseEventHandler;\n href?: string;\n onPreview?: LinkProps['onPreview'];\n } & ForwardProps);\n /** An additional textual representation for the item e.g. metadata. */\n secondary?: string;\n /** Presents the item as being in an invalidate state. */\n status?: {\n type: 'error' | 'warning';\n message: string;\n };\n /** Whether or not the item can be reordered with drag. */\n draggable?: boolean;\n /** Selected state of the item. */\n selected?: boolean;\n /** Defines the props of the icon passed to the list item */\n icon?: OmitStrict<IconProps, 'size'>;\n /**\n * If the item is configurable pass a callback to render a button.\n * The item's id and an event argument provides access to the underlying HTMLButtonElement.\n */\n onConfigure?: ItemAction;\n /**\n * If the item can be removed form the list pass a callback to render a button.\n * The handler's event argument provides access to the underlying HTMLButtonElement.\n */\n onRemove?: ItemAction;\n} & (\n | {\n /** If the item can possess a nested list of items. */\n items: StandardDragDropListItemProps[];\n /** Type of items allowed to be dropped on the list. If not passed it will inherit accept from the parent list. */\n accept?: StandardDragDropListProps['accept'];\n /** Optionally render an add button for parent item types. */\n onAddTo?: ItemAction;\n }\n | {\n items?: undefined;\n accept?: never;\n onAddTo?: never;\n }\n );\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/cosmos-react-dnd",
3
- "version": "9.0.0-build.9.9",
3
+ "version": "9.0.0",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "author": "Pegasystems",
6
6
  "sideEffects": false,
@@ -14,10 +14,9 @@
14
14
  "build": "tsc -b tsconfig.build.json"
15
15
  },
16
16
  "dependencies": {
17
- "@pega/cosmos-react-core": "9.0.0-build.9.9",
17
+ "@pega/cosmos-react-core": "9.0.0",
18
18
  "@types/react": "^17.0.62 || ^18.3.3",
19
19
  "@types/react-dom": "^17.0.20 || ^18.3.0",
20
- "@types/styled-components": "^5.1.26",
21
20
  "dnd-core": "14.0.1",
22
21
  "polished": "^4.1.0",
23
22
  "rdndmb-html5-to-touch": "^7.1.3",
@@ -25,7 +24,7 @@
25
24
  "react-dnd": "^14.0.5",
26
25
  "react-dnd-multi-backend": "^7.1.3",
27
26
  "react-dom": "^17.0.0 || ^18.0.0",
28
- "styled-components": "^5.2.0"
27
+ "styled-components": "~6.3.11"
29
28
  },
30
29
  "devDependencies": {
31
30
  "@storybook/addon-actions": "~8.2.9",
@@ -34,6 +33,6 @@
34
33
  "@testing-library/dom": "^10.3.0",
35
34
  "@testing-library/react": "^16.0.0",
36
35
  "@testing-library/user-event": "^14.6.1",
37
- "typescript": "~5.8.3"
36
+ "typescript": "~5.9.3"
38
37
  }
39
38
  }