@startsimpli/ui 0.4.8 → 0.4.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@startsimpli/ui",
3
- "version": "0.4.8",
3
+ "version": "0.4.9",
4
4
  "description": "Shared UI components package for StartSimpli applications",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -50,47 +50,45 @@
50
50
  "@radix-ui/react-accordion": "^1.2.12",
51
51
  "@radix-ui/react-checkbox": "^1.3.3",
52
52
  "@radix-ui/react-collapsible": "^1.1.12",
53
- "@radix-ui/react-dialog": "^1.1.1",
53
+ "@radix-ui/react-dialog": "^1.1.15",
54
54
  "@radix-ui/react-dropdown-menu": "^2.1.16",
55
- "@radix-ui/react-label": "^2.1.0",
55
+ "@radix-ui/react-label": "^2.1.8",
56
56
  "@radix-ui/react-popover": "^1.1.15",
57
- "@radix-ui/react-progress": "^1.1.7",
57
+ "@radix-ui/react-progress": "^1.1.8",
58
58
  "@radix-ui/react-scroll-area": "^1.2.10",
59
59
  "@radix-ui/react-select": "^2.2.6",
60
- "@radix-ui/react-separator": "^1.1.7",
60
+ "@radix-ui/react-separator": "^1.1.8",
61
61
  "@radix-ui/react-slot": "^1.2.4",
62
62
  "@radix-ui/react-tabs": "^1.1.13",
63
63
  "@radix-ui/react-tooltip": "^1.2.8",
64
- "class-variance-authority": "^0.7.0",
64
+ "class-variance-authority": "^0.7.1",
65
65
  "clsx": "^2.1.1",
66
66
  "date-fns": "^3.6.0",
67
- "dompurify": "^3.3.1",
68
- "isomorphic-dompurify": "^2.36.0",
67
+ "dompurify": "^3.4.1",
69
68
  "lucide-react": "^0.408.0",
70
- "react-day-picker": "^9.13.2",
71
- "tailwind-merge": "^2.4.0",
69
+ "react-day-picker": "^9.14.0",
70
+ "tailwind-merge": "^2.6.1",
72
71
  "tailwindcss-animate": "^1.0.7",
73
72
  "xlsx": "^0.18.5"
74
73
  },
75
74
  "devDependencies": {
76
- "@tanstack/react-query": "^5.0.0",
77
- "@swc/core": "^1.15.13",
75
+ "@swc/core": "^1.15.30",
78
76
  "@swc/jest": "^0.2.39",
79
- "@testing-library/jest-dom": "^6.8.0",
80
- "@testing-library/react": "^16.3.0",
77
+ "@tanstack/react-query": "^5.99.2",
78
+ "@testing-library/jest-dom": "^6.9.1",
79
+ "@testing-library/react": "^16.3.2",
81
80
  "@testing-library/user-event": "^14.6.1",
82
- "@types/dompurify": "^3.0.5",
83
81
  "@types/jest": "^30.0.0",
84
- "@types/node": "^20.14.10",
85
- "@types/react": "^19.0.0",
86
- "@types/react-dom": "^19.0.0",
87
- "eslint": "^8.57.0",
82
+ "@types/node": "^20.19.39",
83
+ "@types/react": "^19.2.14",
84
+ "@types/react-dom": "^19.2.3",
85
+ "eslint": "^8.57.1",
88
86
  "identity-obj-proxy": "^3.0.0",
89
- "jest": "^30.1.3",
90
- "jest-environment-jsdom": "^30.1.2",
91
- "tailwindcss": "^3.4.6",
87
+ "jest": "^30.3.0",
88
+ "jest-environment-jsdom": "^30.3.0",
89
+ "tailwindcss": "^3.4.19",
92
90
  "tsup": "^8.5.1",
93
- "typescript": "^5.5.3"
91
+ "typescript": "^6.0.3"
94
92
  },
95
93
  "keywords": [
96
94
  "ui",
@@ -1,18 +1,19 @@
1
- import DOMPurify from 'isomorphic-dompurify';
2
- import { type ElementType, type HTMLAttributes } from 'react';
1
+ 'use client';
2
+
3
+ import DOMPurify from 'dompurify';
4
+ import { useEffect, useState, type ElementType, type HTMLAttributes } from 'react';
3
5
 
4
6
  interface SafeHtmlProps extends HTMLAttributes<HTMLElement> {
5
7
  html: string;
6
8
  as?: ElementType;
7
9
  }
8
10
 
9
- /**
10
- * Renders user-supplied or external HTML safely by running it through DOMPurify.
11
- * Strips script tags, event handlers, javascript: URLs, and other XSS vectors.
12
- * Use this instead of dangerouslySetInnerHTML anywhere app content is rendered.
13
- */
11
+ // Client-only: dompurify needs a browser window, and the isomorphic variant pulls jsdom into SSR bundles.
14
12
  export function SafeHtml({ html, as: Tag = 'div', ...props }: SafeHtmlProps) {
15
- const sanitized = DOMPurify.sanitize(html, { ALLOW_DATA_ATTR: false });
13
+ const [sanitized, setSanitized] = useState('');
14
+ useEffect(() => {
15
+ setSanitized(DOMPurify.sanitize(html, { ALLOW_DATA_ATTR: false }));
16
+ }, [html]);
16
17
  // eslint-disable-next-line react/no-danger
17
18
  return <Tag {...props} dangerouslySetInnerHTML={{ __html: sanitized }} />;
18
19
  }