@pega/cosmos-react-work 7.0.0-build.24.3 → 7.0.0-build.25.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.
@@ -1,5 +1,5 @@
1
1
  import type { FunctionComponent, MouseEvent } from 'react';
2
- import type { BaseProps, ForwardProps, FileUploadItemProps } from '@pega/cosmos-react-core';
2
+ import type { BaseProps, ForwardProps, FileItemProps } from '@pega/cosmos-react-core';
3
3
  import type { ArticleFeedbackProps } from '../ArticleList/ArticleList.types';
4
4
  export interface ArticleTag {
5
5
  /** Tag name */
@@ -28,7 +28,7 @@ export interface ArticleFooterProps extends BaseProps {
28
28
  onClick: (id: string, e: MouseEvent<HTMLButtonElement>) => void;
29
29
  }[];
30
30
  /** Attachments */
31
- attachments?: FileUploadItemProps[];
31
+ attachments?: FileItemProps[];
32
32
  }
33
33
  declare const ArticleFooter: FunctionComponent<ArticleFooterProps & ForwardProps>;
34
34
  export default ArticleFooter;
@@ -1 +1 @@
1
- {"version":3,"file":"ArticleFooter.d.ts","sourceRoot":"","sources":["../../../src/components/Article/ArticleFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAc3D,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAI5F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAE7E,MAAM,WAAW,UAAU;IACzB,eAAe;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,kDAAkD;IAClD,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,kBAAmB,SAAQ,SAAS;IACnD,gCAAgC;IAChC,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAChC,IAAI,CAAC,EAAE;QACL,mBAAmB;QACnB,IAAI,EAAE,UAAU,EAAE,CAAC;QACnB,6CAA6C;QAC7C,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,EAAE,UAAU,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;KAC7C,CAAC;IACF,8BAA8B;IAC9B,YAAY,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACjD,8BAA8B;IAC9B,eAAe,CAAC,EAAE;QAChB,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;KACjE,EAAE,CAAC;IACJ,kBAAkB;IAClB,WAAW,CAAC,EAAE,aAAa,EAAE,CAAC;CAC/B;AAuCD,QAAA,MAAM,aAAa,EAAE,iBAAiB,CAAC,kBAAkB,GAAG,YAAY,CAiFvE,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -1,7 +1,6 @@
1
- import { createElement as _createElement } from "react";
2
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
2
  import styled, { css } from 'styled-components';
4
- import { Flex, Tag, defaultThemeProp, Button, Text, Link, useI18n, FileUploadItem, Grid } from '@pega/cosmos-react-core';
3
+ import { Flex, Tag, defaultThemeProp, Button, Text, Link, useI18n, FileList } from '@pega/cosmos-react-core';
5
4
  import { StyledTag } from '@pega/cosmos-react-core/lib/components/Badges/Tag';
6
5
  import ArticleFeedback from '../ArticleList/ArticleFeedback';
7
6
  const StyledRelatedItemsContainer = styled.div ``;
@@ -45,10 +44,7 @@ const ArticleFooter = (props) => {
45
44
  return (_jsx(Link, { href: href, target: '_blank', children: title }, title));
46
45
  }) })] })), relatedArticles && (_jsxs(Flex, { as: StyledRelatedItemsContainer, container: { direction: 'column', gap: 1 }, children: [_jsx(Text, { variant: 'h3', children: t('article_more_like_this') }), _jsx(Flex, { as: StyledRelatedItemsList, container: { direction: 'column', alignItems: 'start', gap: 0.5 }, children: relatedArticles?.map(({ id, title, onClick }) => {
47
46
  return (_jsx(Button, { variant: 'link', onClick: (e) => onClick(id, e), children: title }, id));
48
- }) })] })), attachments && (_jsxs(Flex, { as: StyledRelatedItemsContainer, container: { direction: 'column', gap: 1 }, children: [_jsx(Text, { variant: 'h3', children: t('article_attachments') }), _jsx(Grid, { container: {
49
- cols: 'repeat(auto-fill, minmax(10rem, 1fr))',
50
- gap: 1
51
- }, as: 'ul', children: attachments?.map(attachment => (_createElement(FileUploadItem, { ...attachment, key: attachment.name }))) })] }))] }));
47
+ }) })] })), attachments && (_jsxs(Flex, { as: StyledRelatedItemsContainer, container: { direction: 'column', gap: 1 }, children: [_jsx(Text, { variant: 'h3', children: t('article_attachments') }), _jsx(FileList, { type: 'item', items: attachments })] }))] }));
52
48
  };
53
49
  export default ArticleFooter;
54
50
  //# sourceMappingURL=ArticleFooter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ArticleFooter.js","sourceRoot":"","sources":["../../../src/components/Article/ArticleFooter.tsx"],"names":[],"mappings":";;AACA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,IAAI,EACJ,GAAG,EACH,gBAAgB,EAChB,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,cAAc,EACd,IAAI,EACL,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,SAAS,EAAE,MAAM,mDAAmD,CAAC;AAE9E,OAAO,eAAe,MAAM,gCAAgC,CAAC;AA+B7D,MAAM,2BAA2B,GAAG,MAAM,CAAC,GAAG,CAAA,EAAE,CAAC;AACjD,MAAM,sBAAsB,GAAG,MAAM,CAAC,GAAG,CAAA,EAAE,CAAC;AAE5C,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACnD,OAAO,GAAG,CAAA;;;;;oBAKQ,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;;0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AAE;4BAC/C,OAAO,CACL,KAAC,MAAM,IAEL,OAAO,EAAC,MAAM,EACd,OAAO,EAAE,CAAC,CAAgC,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,YAE5D,KAAK,IAJD,EAAE,CAKA,CACV,CAAC;wBACJ,CAAC,CAAC,GACG,IACF,CACR,EAEA,WAAW,IAAI,CACd,MAAC,IAAI,IAAC,EAAE,EAAE,2BAA2B,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,aAC/E,KAAC,IAAI,IAAC,OAAO,EAAC,IAAI,YAAE,CAAC,CAAC,qBAAqB,CAAC,GAAQ,EACpD,KAAC,IAAI,IACH,SAAS,EAAE;4BACT,IAAI,EAAE,uCAAuC;4BAC7C,GAAG,EAAE,CAAC;yBACP,EACD,EAAE,EAAC,IAAI,YAEN,WAAW,EAAE,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,CAC9B,eAAC,cAAc,OAAK,UAAU,EAAE,GAAG,EAAE,UAAU,CAAC,IAAI,GAAI,CACzD,CAAC,GACG,IACF,CACR,IACI,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import type { FunctionComponent, MouseEvent } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Flex,\n Tag,\n defaultThemeProp,\n Button,\n Text,\n Link,\n useI18n,\n FileUploadItem,\n Grid\n} from '@pega/cosmos-react-core';\nimport type { BaseProps, ForwardProps, FileUploadItemProps } from '@pega/cosmos-react-core';\nimport { StyledTag } from '@pega/cosmos-react-core/lib/components/Badges/Tag';\n\nimport ArticleFeedback from '../ArticleList/ArticleFeedback';\nimport type { ArticleFeedbackProps } from '../ArticleList/ArticleList.types';\n\nexport interface ArticleTag {\n /** Tag name */\n tagName: string;\n /** Tag id. If not set tagName is treated as id */\n id: string;\n}\n\nexport interface ArticleFooterProps extends BaseProps {\n /** Feedback for this article */\n feedback?: ArticleFeedbackProps;\n tags?: {\n /** Article tags */\n list: ArticleTag[];\n /** Callback that triggers on click of tag */\n onTagClick?: (id: ArticleTag['id']) => void;\n };\n /** Links to external sites */\n relatedLinks?: { title: string; href: string }[];\n /** Links to other articles */\n relatedArticles?: {\n id: string;\n title: string;\n onClick: (id: string, e: MouseEvent<HTMLButtonElement>) => void;\n }[];\n /** Attachments */\n attachments?: FileUploadItemProps[];\n}\n\nconst StyledRelatedItemsContainer = styled.div``;\nconst StyledRelatedItemsList = styled.div``;\n\nconst StyledArticleFooter = styled.div(({ theme }) => {\n return css`\n flex-shrink: 0;\n &::before {\n content: '';\n display: block;\n background: ${theme.base.palette['border-line']};\n height: 0.0625rem;\n margin-block-end: ${theme.base.spacing};\n }\n\n ${StyledRelatedItemsContainer} {\n margin-block-start: ${theme.base.spacing};\n & > ${StyledRelatedItemsList} * {\n margin-inline-start: 0;\n }\n }\n `;\n});\n\nStyledArticleFooter.defaultProps = defaultThemeProp;\n\nconst StyledTags = styled.div(({ theme }) => {\n return css`\n padding: calc(0.25 * ${theme.base.spacing});\n margin: 0 calc(-0.5 * ${theme.base.spacing});\n & > ${StyledTag} {\n margin: calc(0.25 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledTags.defaultProps = defaultThemeProp;\n\nconst ArticleFooter: FunctionComponent<ArticleFooterProps & ForwardProps> = (\n props: ArticleFooterProps\n) => {\n const { tags, relatedLinks, relatedArticles, feedback, attachments, ...restProps } = props;\n const t = useI18n();\n\n return (\n <Flex\n as={StyledArticleFooter}\n container={{\n direction: 'column'\n }}\n {...restProps}\n >\n {feedback && <ArticleFeedback {...feedback} />}\n {tags && (\n <Flex container={{ wrap: 'wrap' }} as={StyledTags}>\n {tags.list.map(tag => (\n <Tag\n tabIndex={0}\n type='pill'\n variant='light'\n key={tag.id}\n data-tag-id={tag.id}\n onClick={tags.onTagClick ? () => tags.onTagClick?.(tag.id) : undefined}\n rel='tag'\n >\n {tag.tagName}\n </Tag>\n ))}\n </Flex>\n )}\n\n {relatedLinks && (\n <Flex as={StyledRelatedItemsContainer} container={{ direction: 'column', gap: 1 }}>\n <Text variant='h3'>{t('article_related_links')}</Text>\n <Flex\n as={StyledRelatedItemsList}\n container={{ direction: 'column', alignItems: 'start', gap: 0.5 }}\n >\n {relatedLinks?.map(({ title, href }) => {\n return (\n <Link href={href} target='_blank' key={title}>\n {title}\n </Link>\n );\n })}\n </Flex>\n </Flex>\n )}\n\n {relatedArticles && (\n <Flex as={StyledRelatedItemsContainer} container={{ direction: 'column', gap: 1 }}>\n <Text variant='h3'>{t('article_more_like_this')}</Text>\n <Flex\n as={StyledRelatedItemsList}\n container={{ direction: 'column', alignItems: 'start', gap: 0.5 }}\n >\n {relatedArticles?.map(({ id, title, onClick }) => {\n return (\n <Button\n key={id}\n variant='link'\n onClick={(e: MouseEvent<HTMLButtonElement>) => onClick(id, e)}\n >\n {title}\n </Button>\n );\n })}\n </Flex>\n </Flex>\n )}\n\n {attachments && (\n <Flex as={StyledRelatedItemsContainer} container={{ direction: 'column', gap: 1 }}>\n <Text variant='h3'>{t('article_attachments')}</Text>\n <Grid\n container={{\n cols: 'repeat(auto-fill, minmax(10rem, 1fr))',\n gap: 1\n }}\n as='ul'\n >\n {attachments?.map(attachment => (\n <FileUploadItem {...attachment} key={attachment.name} />\n ))}\n </Grid>\n </Flex>\n )}\n </Flex>\n );\n};\n\nexport default ArticleFooter;\n"]}
1
+ {"version":3,"file":"ArticleFooter.js","sourceRoot":"","sources":["../../../src/components/Article/ArticleFooter.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,IAAI,EACJ,GAAG,EACH,gBAAgB,EAChB,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,QAAQ,EACT,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,SAAS,EAAE,MAAM,mDAAmD,CAAC;AAE9E,OAAO,eAAe,M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AAC,EAAE,aAC/E,KAAC,IAAI,IAAC,OAAO,EAAC,IAAI,YAAE,CAAC,CAAC,wBAAwB,CAAC,GAAQ,EACvD,KAAC,IAAI,IACH,EAAE,EAAE,sBAAsB,EAC1B,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,YAEhE,eAAe,EAAE,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE;4BAC/C,OAAO,CACL,KAAC,MAAM,IAEL,OAAO,EAAC,MAAM,EACd,OAAO,EAAE,CAAC,CAAgC,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,YAE5D,KAAK,IAJD,EAAE,CAKA,CACV,CAAC;wBACJ,CAAC,CAAC,GACG,IACF,CACR,EAEA,WAAW,IAAI,CACd,MAAC,IAAI,IAAC,EAAE,EAAE,2BAA2B,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,aAC/E,KAAC,IAAI,IAAC,OAAO,EAAC,IAAI,YAAE,CAAC,CAAC,qBAAqB,CAAC,GAAQ,EACpD,KAAC,QAAQ,IAAC,IAAI,EAAC,MAAM,EAAC,KAAK,EAAE,WAAW,GAAI,IACvC,CACR,IACI,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import type { FunctionComponent, MouseEvent } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Flex,\n Tag,\n defaultThemeProp,\n Button,\n Text,\n Link,\n useI18n,\n FileList\n} from '@pega/cosmos-react-core';\nimport type { BaseProps, ForwardProps, FileItemProps } from '@pega/cosmos-react-core';\nimport { StyledTag } from '@pega/cosmos-react-core/lib/components/Badges/Tag';\n\nimport ArticleFeedback from '../ArticleList/ArticleFeedback';\nimport type { ArticleFeedbackProps } from '../ArticleList/ArticleList.types';\n\nexport interface ArticleTag {\n /** Tag name */\n tagName: string;\n /** Tag id. If not set tagName is treated as id */\n id: string;\n}\n\nexport interface ArticleFooterProps extends BaseProps {\n /** Feedback for this article */\n feedback?: ArticleFeedbackProps;\n tags?: {\n /** Article tags */\n list: ArticleTag[];\n /** Callback that triggers on click of tag */\n onTagClick?: (id: ArticleTag['id']) => void;\n };\n /** Links to external sites */\n relatedLinks?: { title: string; href: string }[];\n /** Links to other articles */\n relatedArticles?: {\n id: string;\n title: string;\n onClick: (id: string, e: MouseEvent<HTMLButtonElement>) => void;\n }[];\n /** Attachments */\n attachments?: FileItemProps[];\n}\n\nconst StyledRelatedItemsContainer = styled.div``;\nconst StyledRelatedItemsList = styled.div``;\n\nconst StyledArticleFooter = styled.div(({ theme }) => {\n return css`\n flex-shrink: 0;\n &::before {\n content: '';\n display: block;\n background: ${theme.base.palette['border-line']};\n height: 0.0625rem;\n margin-block-end: ${theme.base.spacing};\n }\n\n ${StyledRelatedItemsContainer} {\n margin-block-start: ${theme.base.spacing};\n & > ${StyledRelatedItemsList} * {\n margin-inline-start: 0;\n }\n }\n `;\n});\n\nStyledArticleFooter.defaultProps = defaultThemeProp;\n\nconst StyledTags = styled.div(({ theme }) => {\n return css`\n padding: calc(0.25 * ${theme.base.spacing});\n margin: 0 calc(-0.5 * ${theme.base.spacing});\n & > ${StyledTag} {\n margin: calc(0.25 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledTags.defaultProps = defaultThemeProp;\n\nconst ArticleFooter: FunctionComponent<ArticleFooterProps & ForwardProps> = (\n props: ArticleFooterProps\n) => {\n const { tags, relatedLinks, relatedArticles, feedback, attachments, ...restProps } = props;\n const t = useI18n();\n\n return (\n <Flex\n as={StyledArticleFooter}\n container={{\n direction: 'column'\n }}\n {...restProps}\n >\n {feedback && <ArticleFeedback {...feedback} />}\n {tags && (\n <Flex container={{ wrap: 'wrap' }} as={StyledTags}>\n {tags.list.map(tag => (\n <Tag\n tabIndex={0}\n type='pill'\n variant='light'\n key={tag.id}\n data-tag-id={tag.id}\n onClick={tags.onTagClick ? () => tags.onTagClick?.(tag.id) : undefined}\n rel='tag'\n >\n {tag.tagName}\n </Tag>\n ))}\n </Flex>\n )}\n\n {relatedLinks && (\n <Flex as={StyledRelatedItemsContainer} container={{ direction: 'column', gap: 1 }}>\n <Text variant='h3'>{t('article_related_links')}</Text>\n <Flex\n as={StyledRelatedItemsList}\n container={{ direction: 'column', alignItems: 'start', gap: 0.5 }}\n >\n {relatedLinks?.map(({ title, href }) => {\n return (\n <Link href={href} target='_blank' key={title}>\n {title}\n </Link>\n );\n })}\n </Flex>\n </Flex>\n )}\n\n {relatedArticles && (\n <Flex as={StyledRelatedItemsContainer} container={{ direction: 'column', gap: 1 }}>\n <Text variant='h3'>{t('article_more_like_this')}</Text>\n <Flex\n as={StyledRelatedItemsList}\n container={{ direction: 'column', alignItems: 'start', gap: 0.5 }}\n >\n {relatedArticles?.map(({ id, title, onClick }) => {\n return (\n <Button\n key={id}\n variant='link'\n onClick={(e: MouseEvent<HTMLButtonElement>) => onClick(id, e)}\n >\n {title}\n </Button>\n );\n })}\n </Flex>\n </Flex>\n )}\n\n {attachments && (\n <Flex as={StyledRelatedItemsContainer} container={{ direction: 'column', gap: 1 }}>\n <Text variant='h3'>{t('article_attachments')}</Text>\n <FileList type='item' items={attachments} />\n </Flex>\n )}\n </Flex>\n );\n};\n\nexport default ArticleFooter;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/cosmos-react-work",
3
- "version": "7.0.0-build.24.3",
3
+ "version": "7.0.0-build.25.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/pegasystems/cosmos-react.git",
@@ -19,8 +19,8 @@
19
19
  "build": "tsc -b tsconfig.build.json"
20
20
  },
21
21
  "dependencies": {
22
- "@pega/cosmos-react-core": "7.0.0-build.24.3",
23
- "@pega/cosmos-react-rte": "7.0.0-build.24.3",
22
+ "@pega/cosmos-react-core": "7.0.0-build.25.0",
23
+ "@pega/cosmos-react-rte": "7.0.0-build.25.0",
24
24
  "@types/react": "^17.0.62",
25
25
  "@types/react-dom": "^17.0.20",
26
26
  "@types/styled-components": "^5.1.26",