@mrshmllw/smores-react 13.2.1 → 13.2.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.
@@ -3,7 +3,6 @@ import React, { forwardRef } from 'react';
3
3
  import styled from 'styled-components';
4
4
  import { Box } from '../Box';
5
5
  import { Icon } from '../Icon';
6
- import { theme } from '../theme';
7
6
  export const RichText = forwardRef(function RichText({ htmlString, ...props }, ref) {
8
7
  const sanitisedHtml = domPurify.sanitize(htmlString);
9
8
  if (!domPurify.isSupported) {
@@ -18,7 +17,7 @@ export const RichText = forwardRef(function RichText({ htmlString, ...props }, r
18
17
  }
19
18
  });
20
19
  const WarningText = styled(Box) `
21
- background-color: ${theme.colors.sherbert};
20
+ background-color: ${({ theme }) => theme.color.feedback.negative[200]};
22
21
  padding: 16px;
23
22
  border-radius: 16px;
24
23
  width: fit-content;
@@ -1 +1 @@
1
- {"version":3,"file":"RichText.js","sourceRoot":"","sources":["../../src/RichText/RichText.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,WAAW,CAAA;AACjC,OAAO,KAAK,EAAE,EAAgB,UAAU,EAAE,MAAM,OAAO,CAAA;AACvD,OAAO,MAAM,MAAM,mBAAmB,CAAA;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAOhC,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAC,SAAS,QAAQ,CAClD,EAAE,UAAU,EAAE,GAAG,KAAK,EAAiB,EACvC,GAAiC;IAEjC,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAA;IAEpD,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC;QAC3B,OAAO,CACL,oBAAC,GAAG,OAAK,KAAK;YACZ,oBAAC,WAAW;gBACV,oBAAC,IAAI,IAAC,MAAM,EAAC,SAAS,GAAG;mFAEb;YACb,UAAU,CACP,CACP,CAAA;IACH,CAAC;SAAM,CAAC;QACN,OAAO,CACL,oBAAC,OAAO,IACN,GAAG,EAAE,GAAG,KACJ,KAAK,EACT,uBAAuB,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,GAClD,CACH,CAAA;IACH,CAAC;AACH,CAAC,CAAC,CAAA;AAEF,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;sBACT,KAAK,CAAC,MAAM,CAAC,QAAQ;;;;;;;;CAQ1C,CAAA;AAED,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;;;;CAI1B,CAAA","sourcesContent":["import domPurify from 'dompurify'\nimport React, { ForwardedRef, forwardRef } from 'react'\nimport styled from 'styled-components'\nimport { Box } from '../Box'\nimport { Icon } from '../Icon'\nimport { theme } from '../theme'\nimport { MarginProps } from '../utils/space'\n\nexport interface RichTextProps extends MarginProps {\n htmlString: string\n}\n\nexport const RichText = forwardRef(function RichText(\n { htmlString, ...props }: RichTextProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const sanitisedHtml = domPurify.sanitize(htmlString)\n\n if (!domPurify.isSupported) {\n return (\n <Box {...props}>\n <WarningText>\n <Icon render=\"warning\" />\n Your browser is not supported, please upgrade to a newer version\n </WarningText>\n {htmlString}\n </Box>\n )\n } else {\n return (\n <HtmlBox\n ref={ref}\n {...props}\n dangerouslySetInnerHTML={{ __html: sanitisedHtml }}\n />\n )\n }\n})\n\nconst WarningText = styled(Box)`\n background-color: ${theme.colors.sherbert};\n padding: 16px;\n border-radius: 16px;\n width: fit-content;\n display: flex;\n align-items: center;\n gap: 16px;\n margin-bottom: 16px;\n`\n\nconst HtmlBox = styled(Box)`\n * {\n all: revert;\n }\n`\n"]}
1
+ {"version":3,"file":"RichText.js","sourceRoot":"","sources":["../../src/RichText/RichText.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,WAAW,CAAA;AACjC,OAAO,KAAK,EAAE,EAAgB,UAAU,EAAE,MAAM,OAAO,CAAA;AACvD,OAAO,MAAM,MAAM,mBAAmB,CAAA;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAO9B,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAC,SAAS,QAAQ,CAClD,EAAE,UAAU,EAAE,GAAG,KAAK,EAAiB,EACvC,GAAiC;IAEjC,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAA;IAEpD,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC;QAC3B,OAAO,CACL,oBAAC,GAAG,OAAK,KAAK;YACZ,oBAAC,WAAW;gBACV,oBAAC,IAAI,IAAC,MAAM,EAAC,SAAS,GAAG;mFAEb;YACb,UAAU,CACP,CACP,CAAA;IACH,CAAC;SAAM,CAAC;QACN,OAAO,CACL,oBAAC,OAAO,IACN,GAAG,EAAE,GAAG,KACJ,KAAK,EACT,uBAAuB,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,GAClD,CACH,CAAA;IACH,CAAC;AACH,CAAC,CAAC,CAAA;AAEF,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;sBACT,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC;;;;;;;;CAQtE,CAAA;AAED,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;;;;CAI1B,CAAA","sourcesContent":["import domPurify from 'dompurify'\nimport React, { ForwardedRef, forwardRef } from 'react'\nimport styled from 'styled-components'\nimport { Box } from '../Box'\nimport { Icon } from '../Icon'\nimport { MarginProps } from '../utils/space'\n\nexport interface RichTextProps extends MarginProps {\n htmlString: string\n}\n\nexport const RichText = forwardRef(function RichText(\n { htmlString, ...props }: RichTextProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const sanitisedHtml = domPurify.sanitize(htmlString)\n\n if (!domPurify.isSupported) {\n return (\n <Box {...props}>\n <WarningText>\n <Icon render=\"warning\" />\n Your browser is not supported, please upgrade to a newer version\n </WarningText>\n {htmlString}\n </Box>\n )\n } else {\n return (\n <HtmlBox\n ref={ref}\n {...props}\n dangerouslySetInnerHTML={{ __html: sanitisedHtml }}\n />\n )\n }\n})\n\nconst WarningText = styled(Box)`\n background-color: ${({ theme }) => theme.color.feedback.negative[200]};\n padding: 16px;\n border-radius: 16px;\n width: fit-content;\n display: flex;\n align-items: center;\n gap: 16px;\n margin-bottom: 16px;\n`\n\nconst HtmlBox = styled(Box)`\n * {\n all: revert;\n }\n`\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrshmllw/smores-react",
3
- "version": "13.2.1",
3
+ "version": "13.2.2",
4
4
  "main": "./dist/index.js",
5
5
  "description": "Collection of React components used by Marshmallow Technology",
6
6
  "type": "module",