@pega/cosmos-react-cs 3.0.0-dev.22.0 → 3.0.0-dev.23.2
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.
- package/lib/components/CallControlPanel/Call.d.ts.map +1 -1
- package/lib/components/CallControlPanel/Call.js +87 -72
- package/lib/components/CallControlPanel/Call.js.map +1 -1
- package/lib/components/CallControlPanel/CallControlPanel.d.ts.map +1 -1
- package/lib/components/CallControlPanel/CallControlPanel.js +20 -12
- package/lib/components/CallControlPanel/CallControlPanel.js.map +1 -1
- package/lib/components/CallControlPanel/CallControlPanel.styles.d.ts +2 -0
- package/lib/components/CallControlPanel/CallControlPanel.styles.d.ts.map +1 -1
- package/lib/components/CallControlPanel/CallControlPanel.styles.js +8 -1
- package/lib/components/CallControlPanel/CallControlPanel.styles.js.map +1 -1
- package/lib/components/CallControlPanel/CallControlPanel.types.d.ts +15 -29
- package/lib/components/CallControlPanel/CallControlPanel.types.d.ts.map +1 -1
- package/lib/components/CallControlPanel/CallControlPanel.types.js.map +1 -1
- package/lib/components/CallControlPanel/CallHandover/CallHandover.types.d.ts +15 -0
- package/lib/components/CallControlPanel/CallHandover/CallHandover.types.d.ts.map +1 -0
- package/lib/components/CallControlPanel/CallHandover/CallHandover.types.js +2 -0
- package/lib/components/CallControlPanel/CallHandover/CallHandover.types.js.map +1 -0
- package/lib/components/CallControlPanel/CallHandover/CallHandoverDialog.d.ts +13 -0
- package/lib/components/CallControlPanel/CallHandover/CallHandoverDialog.d.ts.map +1 -0
- package/lib/components/CallControlPanel/CallHandover/CallHandoverDialog.js +51 -0
- package/lib/components/CallControlPanel/CallHandover/CallHandoverDialog.js.map +1 -0
- package/lib/components/CallControlPanel/{CallHandoverForm.d.ts → CallHandover/CallHandoverForm.d.ts} +7 -3
- package/lib/components/CallControlPanel/CallHandover/CallHandoverForm.d.ts.map +1 -0
- package/lib/components/CallControlPanel/CallHandover/CallHandoverForm.js +46 -0
- package/lib/components/CallControlPanel/CallHandover/CallHandoverForm.js.map +1 -0
- package/lib/components/CallControlPanel/CallHandover/index.d.ts +4 -0
- package/lib/components/CallControlPanel/CallHandover/index.d.ts.map +1 -0
- package/lib/components/CallControlPanel/CallHandover/index.js +4 -0
- package/lib/components/CallControlPanel/CallHandover/index.js.map +1 -0
- package/lib/components/CallControlPanel/{CalleePicker.d.ts → ContactList/CalleePicker.d.ts} +5 -7
- package/lib/components/CallControlPanel/ContactList/CalleePicker.d.ts.map +1 -0
- package/lib/components/CallControlPanel/ContactList/CalleePicker.js +52 -0
- package/lib/components/CallControlPanel/ContactList/CalleePicker.js.map +1 -0
- package/lib/components/CallControlPanel/ContactList/ContactList.d.ts +10 -0
- package/lib/components/CallControlPanel/ContactList/ContactList.d.ts.map +1 -0
- package/lib/components/CallControlPanel/ContactList/ContactList.js +129 -0
- package/lib/components/CallControlPanel/ContactList/ContactList.js.map +1 -0
- package/lib/components/CallControlPanel/ContactList/ContactList.types.d.ts +30 -0
- package/lib/components/CallControlPanel/ContactList/ContactList.types.d.ts.map +1 -0
- package/lib/components/CallControlPanel/ContactList/ContactList.types.js +2 -0
- package/lib/components/CallControlPanel/ContactList/ContactList.types.js.map +1 -0
- package/lib/components/CallControlPanel/ContactList/index.d.ts +3 -0
- package/lib/components/CallControlPanel/ContactList/index.d.ts.map +1 -0
- package/lib/components/CallControlPanel/ContactList/index.js +2 -0
- package/lib/components/CallControlPanel/ContactList/index.js.map +1 -0
- package/lib/components/CallControlPanel/index.d.ts +2 -1
- package/lib/components/CallControlPanel/index.d.ts.map +1 -1
- package/lib/components/CallControlPanel/index.js.map +1 -1
- package/lib/components/DialPad/DialPad.js +1 -1
- package/lib/components/DialPad/DialPad.js.map +1 -1
- package/lib/components/DialPad/DialPadDialog.d.ts +10 -0
- package/lib/components/DialPad/DialPadDialog.d.ts.map +1 -0
- package/lib/components/DialPad/DialPadDialog.js +28 -0
- package/lib/components/DialPad/DialPadDialog.js.map +1 -0
- package/lib/components/DialPad/DialPadKeyboard.d.ts.map +1 -1
- package/lib/components/DialPad/DialPadKeyboard.js +1 -1
- package/lib/components/DialPad/DialPadKeyboard.js.map +1 -1
- package/lib/components/DialPad/index.d.ts +1 -0
- package/lib/components/DialPad/index.d.ts.map +1 -1
- package/lib/components/DialPad/index.js +1 -0
- package/lib/components/DialPad/index.js.map +1 -1
- package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.d.ts.map +1 -1
- package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js +3 -2
- package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js.map +1 -1
- package/lib/components/InteractionNotification/InteractionNotification.d.ts.map +1 -1
- package/lib/components/InteractionNotification/InteractionNotification.js +1 -1
- package/lib/components/InteractionNotification/InteractionNotification.js.map +1 -1
- package/package.json +3 -3
- package/lib/components/CallControlPanel/CallHandoverForm.d.ts.map +0 -1
- package/lib/components/CallControlPanel/CallHandoverForm.js +0 -78
- package/lib/components/CallControlPanel/CallHandoverForm.js.map +0 -1
- package/lib/components/CallControlPanel/CalleePicker.d.ts.map +0 -1
- package/lib/components/CallControlPanel/CalleePicker.js +0 -61
- package/lib/components/CallControlPanel/CalleePicker.js.map +0 -1
- package/lib/components/CallControlPanel/ContactsList.d.ts +0 -23
- package/lib/components/CallControlPanel/ContactsList.d.ts.map +0 -1
- package/lib/components/CallControlPanel/ContactsList.js +0 -88
- package/lib/components/CallControlPanel/ContactsList.js.map +0 -1
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef, useCallback, useState } from 'react';
|
|
3
|
-
import styled, { css } from 'styled-components';
|
|
4
|
-
import { Button, defaultThemeProp, Icon, registerIcon, Text, StyledGrid, useI18n, ViewAll, StyledSummaryItemActions, StyledPrimary, StyledSecondary, useArrows, useConsolidatedRef, StyledCard } from '@pega/cosmos-react-core';
|
|
5
|
-
import { StyledCardContent } from '@pega/cosmos-react-core/lib/components/Card/CardContent';
|
|
6
|
-
import * as starIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/star.icon';
|
|
7
|
-
import * as starSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/star-solid.icon';
|
|
8
|
-
registerIcon(starIcon, starSolidIcon);
|
|
9
|
-
const StyledContactsList = styled.div(({ theme: { base } }) => {
|
|
10
|
-
return css `
|
|
11
|
-
display: flex;
|
|
12
|
-
flex-flow: column;
|
|
13
|
-
height: 100%;
|
|
14
|
-
overflow-y: auto;
|
|
15
|
-
overflow-x: hidden;
|
|
16
|
-
|
|
17
|
-
${StyledCard} {
|
|
18
|
-
margin: 0 calc(${base.spacing} * -2);
|
|
19
|
-
padding: 0 calc(${base.spacing} * 2);
|
|
20
|
-
|
|
21
|
-
> ${StyledCardContent} {
|
|
22
|
-
padding: 0;
|
|
23
|
-
gap: 0;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
li${StyledGrid} {
|
|
28
|
-
border-bottom: 0.0625rem solid ${base.palette['border-line']};
|
|
29
|
-
padding: 0;
|
|
30
|
-
> ${StyledPrimary}, > ${StyledSecondary} {
|
|
31
|
-
align-self: center;
|
|
32
|
-
font-weight: ${base['font-weight'].normal};
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
${StyledSummaryItemActions} {
|
|
36
|
-
color: ${base.palette.interactive};
|
|
37
|
-
}
|
|
38
|
-
`;
|
|
39
|
-
});
|
|
40
|
-
StyledContactsList.defaultProps = defaultThemeProp;
|
|
41
|
-
const ContactsList = forwardRef(({ contacts: items, action, onFavoriteToggle }, ref) => {
|
|
42
|
-
const t = useI18n();
|
|
43
|
-
const [searchText, setSearchText] = useState('');
|
|
44
|
-
const containerRef = useConsolidatedRef(ref);
|
|
45
|
-
const onSearchChange = useCallback((value) => {
|
|
46
|
-
setSearchText(value.trim());
|
|
47
|
-
}, []);
|
|
48
|
-
const favoriteButton = useCallback((phoneNumber, favorite) => (_jsx(Button, { variant: 'simple', icon: true, onClick: (e) => {
|
|
49
|
-
e.stopPropagation();
|
|
50
|
-
onFavoriteToggle(phoneNumber, favorite);
|
|
51
|
-
}, "aria-label": favorite
|
|
52
|
-
? t('call_panel_contacts_add_to_favorites')
|
|
53
|
-
: t('call_panel_contacts_remove_from_favorites'), children: _jsx(Icon, { name: favorite ? 'star-solid' : 'star' }) })), [onFavoriteToggle]);
|
|
54
|
-
const createList = (list) => {
|
|
55
|
-
return list.map(item => {
|
|
56
|
-
return {
|
|
57
|
-
id: item.phoneNumber,
|
|
58
|
-
primary: item.primary,
|
|
59
|
-
secondary: _jsx(Text, { variant: 'secondary', children: item.secondary }),
|
|
60
|
-
visual: favoriteButton(item.phoneNumber, item.favorite),
|
|
61
|
-
actions: [
|
|
62
|
-
{
|
|
63
|
-
text: action.label,
|
|
64
|
-
id: 'primary',
|
|
65
|
-
icon: action.icon
|
|
66
|
-
}
|
|
67
|
-
],
|
|
68
|
-
onClick: () => {
|
|
69
|
-
action.callback(item.phoneNumber);
|
|
70
|
-
},
|
|
71
|
-
container: {
|
|
72
|
-
areas: '"visual primary secondary actions"',
|
|
73
|
-
cols: 'auto minmax(0, 2fr) minmax(0, 2fr) auto'
|
|
74
|
-
},
|
|
75
|
-
tabIndex: 0
|
|
76
|
-
};
|
|
77
|
-
});
|
|
78
|
-
};
|
|
79
|
-
useArrows(containerRef, { selector: ':scope ul > li' });
|
|
80
|
-
return (_jsx(ViewAll, { as: StyledContactsList, ref: containerRef, items: searchText
|
|
81
|
-
? createList(items.filter(({ primary, secondary }) => {
|
|
82
|
-
return (primary.toLowerCase().includes(searchText.toLowerCase()) ||
|
|
83
|
-
secondary.toLowerCase().includes(searchText.toLowerCase()));
|
|
84
|
-
}))
|
|
85
|
-
: createList(items), searchInputProps: { onSearchChange } }));
|
|
86
|
-
});
|
|
87
|
-
export default ContactsList;
|
|
88
|
-
//# sourceMappingURL=ContactsList.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ContactsList.js","sourceRo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,MAAM,CAAC,KAAK;wBAClB,EAAE,EAAE,SAAS;wBACb,IAAI,EAAE,MAAM,CAAC,IAAI;qBAClB;iBACF;gBACD,OAAO,EAAE,GAAG,EAAE;oBACZ,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;gBACpC,CAAC;gBACD,SAAS,EAAE;oBACT,KAAK,EAAE,oCAAoC;oBAC3C,IAAI,EAAE,yCAAyC;iBAChD;gBACD,QAAQ,EAAE,CAAC;aACZ,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,SAAS,CAAC,YAAY,EAAE,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAC,CAAC;IAExD,OAAO,CACL,KAAC,OAAO,IACN,EAAE,EAAE,kBAAkB,EACtB,GAAG,EAAE,YAAY,EACjB,KAAK,EACH,UAAU;YACR,CAAC,CAAC,UAAU,CACR,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE;gBACtC,OAAO,CACL,OAAO,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC;oBACxD,SAAS,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,CAC3D,CAAC;YACJ,CAAC,CAAC,CACH;YACH,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,EAEvB,gBAAgB,EAAE,EAAE,cAAc,EAAE,GACpC,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import {\n forwardRef,\n FunctionComponent,\n MouseEvent,\n PropsWithoutRef,\n Ref,\n useCallback,\n useState\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Button,\n defaultThemeProp,\n ForwardProps,\n Icon,\n registerIcon,\n Text,\n StyledGrid,\n useI18n,\n ViewAll,\n StyledSummaryItemActions,\n StyledPrimary,\n StyledSecondary,\n useArrows,\n useConsolidatedRef,\n StyledCard\n} from '@pega/cosmos-react-core';\nimport { StyledCardContent } from '@pega/cosmos-react-core/lib/components/Card/CardContent';\nimport * as starIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/star.icon';\nimport * as starSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/star-solid.icon';\n\nimport type { Contact } from './CallControlPanel.types';\n\nregisterIcon(starIcon, starSolidIcon);\n\nexport interface ContactsListProps {\n /** An array of contacts objects. */\n contacts: Contact[];\n /**\n * Primary action the user may select.\n * @param phoneNumber the number chosen.\n */\n action: {\n label: string;\n icon: string;\n callback: (phoneNumber: string) => void;\n };\n /** Callback fired on adding/removing contact to/from favorites */\n onFavoriteToggle: (phoneNumber: string, favorites: boolean) => void;\n /** Reference to the root component. */\n ref?: Ref<HTMLDivElement>;\n}\n\nconst StyledContactsList = styled.div(({ theme: { base } }) => {\n return css`\n display: flex;\n flex-flow: column;\n height: 100%;\n overflow-y: auto;\n overflow-x: hidden;\n\n ${StyledCard} {\n margin: 0 calc(${base.spacing} * -2);\n padding: 0 calc(${base.spacing} * 2);\n\n > ${StyledCardContent} {\n padding: 0;\n gap: 0;\n }\n }\n\n li${StyledGrid} {\n border-bottom: 0.0625rem solid ${base.palette['border-line']};\n padding: 0;\n > ${StyledPrimary}, > ${StyledSecondary} {\n align-self: center;\n font-weight: ${base['font-weight'].normal};\n }\n }\n ${StyledSummaryItemActions} {\n color: ${base.palette.interactive};\n }\n `;\n});\n\nStyledContactsList.defaultProps = defaultThemeProp;\n\nconst ContactsList: FunctionComponent<ContactsListProps & ForwardProps> = forwardRef(\n (\n { contacts: items, action, onFavoriteToggle }: PropsWithoutRef<ContactsListProps>,\n ref: ContactsListProps['ref']\n ) => {\n const t = useI18n();\n const [searchText, setSearchText] = useState('');\n const containerRef = useConsolidatedRef(ref);\n\n const onSearchChange = useCallback((value: string) => {\n setSearchText(value.trim());\n }, []);\n\n const favoriteButton = useCallback(\n (phoneNumber: string, favorite: boolean) => (\n <Button\n variant='simple'\n icon\n onClick={(e: MouseEvent) => {\n e.stopPropagation();\n onFavoriteToggle(phoneNumber, favorite);\n }}\n aria-label={\n favorite\n ? t('call_panel_contacts_add_to_favorites')\n : t('call_panel_contacts_remove_from_favorites')\n }\n >\n <Icon name={favorite ? 'star-solid' : 'star'} />\n </Button>\n ),\n [onFavoriteToggle]\n );\n\n const createList = (list: Contact[]) => {\n return list.map(item => {\n return {\n id: item.phoneNumber,\n primary: item.primary,\n secondary: <Text variant='secondary'>{item.secondary}</Text>,\n visual: favoriteButton(item.phoneNumber, item.favorite),\n actions: [\n {\n text: action.label,\n id: 'primary',\n icon: action.icon\n }\n ],\n onClick: () => {\n action.callback(item.phoneNumber);\n },\n container: {\n areas: '\"visual primary secondary actions\"',\n cols: 'auto minmax(0, 2fr) minmax(0, 2fr) auto'\n },\n tabIndex: 0\n };\n });\n };\n\n useArrows(containerRef, { selector: ':scope ul > li' });\n\n return (\n <ViewAll\n as={StyledContactsList}\n ref={containerRef}\n items={\n searchText\n ? createList(\n items.filter(({ primary, secondary }) => {\n return (\n primary.toLowerCase().includes(searchText.toLowerCase()) ||\n secondary.toLowerCase().includes(searchText.toLowerCase())\n );\n })\n )\n : createList(items)\n }\n searchInputProps={{ onSearchChange }}\n />\n );\n }\n);\n\nexport default ContactsList;\n"]}
|