@helpdice/ui 1.4.9 → 1.5.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.
@@ -11,5 +11,5 @@ type CompactButtonProps = {
11
11
  target?: string;
12
12
  onClick?: () => void;
13
13
  };
14
- export default function CompactButton({ to, children, iconRight, icon, scale, type, style, a, target, onClick }: CompactButtonProps): import("react").JSX.Element;
15
- export {};
14
+ declare const _default: import("react").NamedExoticComponent<CompactButtonProps>;
15
+ export default _default;
@@ -1,5 +1,6 @@
1
+ import { memo } from 'react';
1
2
  import Button from './button';
2
- export default function CompactButton(_ref) {
3
+ var CompactButton = function CompactButton(_ref) {
3
4
  var _ref$to = _ref.to,
4
5
  to = _ref$to === void 0 ? '/' : _ref$to,
5
6
  children = _ref.children,
@@ -74,4 +75,5 @@ export default function CompactButton(_ref) {
74
75
  px: 0.6,
75
76
  iconRight: iconRight
76
77
  }, children);
77
- }
78
+ };
79
+ export default /*#__PURE__*/memo(CompactButton);
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ type RendererProps = {
3
+ htmlString: string;
4
+ };
5
+ declare const HtmlRenderer: React.FC<RendererProps>;
6
+ export default HtmlRenderer;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import DOMPurify from 'dompurify';
3
+ var HtmlRenderer = function HtmlRenderer(_ref) {
4
+ var htmlString = _ref.htmlString;
5
+ var sanitizedHTML = DOMPurify.sanitize(htmlString);
6
+ return /*#__PURE__*/React.createElement("div", {
7
+ dangerouslySetInnerHTML: {
8
+ __html: sanitizedHTML
9
+ }
10
+ });
11
+ };
12
+ export default HtmlRenderer;
package/esm/index.d.ts CHANGED
@@ -41,6 +41,7 @@ export type { UiProviderProps } from './ui-provider';
41
41
  export { default as Grid } from './grid';
42
42
  export { default as Container } from './grid/grid-container';
43
43
  export type { GridProps, GridContainerProps } from './grid';
44
+ export { default as HtmlRenderer } from './html-renderer';
44
45
  export { default as Image } from './image';
45
46
  export type { ImageProps, ImageBrowserProps } from './image';
46
47
  export { default as Input } from './input';
package/esm/index.js CHANGED
@@ -27,6 +27,7 @@ export * from './form';
27
27
  export { default as UiProvider } from './ui-provider';
28
28
  export { default as Grid } from './grid';
29
29
  export { default as Container } from './grid/grid-container';
30
+ export { default as HtmlRenderer } from './html-renderer';
30
31
  export { default as Image } from './image';
31
32
  export { default as Input } from './input';
32
33
  export { default as Keyboard } from './keyboard';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@helpdice/ui",
3
- "version": "1.4.9",
3
+ "version": "1.5.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "esm/index.d.ts",
6
6
  "unpkg": "dist/index.min.js",
@@ -22,7 +22,7 @@
22
22
  "build:after": "node scripts/move-built-in.js",
23
23
  "build:types": "tsc -p ./scripts & tsc -p ./scripts --outDir ./esm",
24
24
  "build": "yarn build:rollup && yarn build:babel && yarn build:types && yarn build:after",
25
- "pusher": "yarn build && yarn publish --access public --non-interactive"
25
+ "release": "yarn build && yarn publish --access public --non-interactive"
26
26
  },
27
27
  "license": "MIT",
28
28
  "description": "Modern React UI library.",
@@ -100,6 +100,7 @@
100
100
  "babel-plugin-transform-rename-import": "^2.3.0",
101
101
  "clsx": "^2.1.1",
102
102
  "deepmerge": "^4.3.1",
103
+ "dompurify": "^3.2.4",
103
104
  "hoist-non-react-statics": "^3.3.2",
104
105
  "lodash": "^4.17.21",
105
106
  "lodash-es": "^4.17.21",