buildgrid-ui 1.15.32 → 1.17.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.
@@ -10,3 +10,4 @@ export * from './use-local-storage';
10
10
  export * from './use-media-query';
11
11
  export * from './use-mobile';
12
12
  export * from './use-pwa-install';
13
+ export * from './use-sanitized-html';
@@ -0,0 +1,47 @@
1
+ import DOMPurify from 'dompurify';
2
+ export interface UseSanitizedHtmlOptions {
3
+ /**
4
+ * Custom DOMPurify configuration options
5
+ */
6
+ sanitizeOptions?: DOMPurify.Config;
7
+ /**
8
+ * Whether to allow all HTML tags and attributes (less secure)
9
+ * @default false
10
+ */
11
+ allowAll?: boolean;
12
+ }
13
+ /**
14
+ * Hook to sanitize HTML content using DOMPurify
15
+ *
16
+ * @param htmlContent - The HTML string to sanitize
17
+ * @param options - Sanitization options
18
+ * @returns Sanitized HTML string
19
+ *
20
+ * @example
21
+ * ```tsx
22
+ * const sanitizedHtml = useSanitizedHtml('<p>Hello <script>alert("xss")</script></p>')
23
+ * // Returns: '<p>Hello </p>'
24
+ * ```
25
+ */
26
+ export declare const useSanitizedHtml: (htmlContent: string, options?: UseSanitizedHtmlOptions) => string;
27
+ /**
28
+ * Predefined sanitization presets for common use cases
29
+ */
30
+ export declare const sanitizePresets: {
31
+ /**
32
+ * Basic text formatting only (p, br, strong, em, u)
33
+ */
34
+ basic: DOMPurify.Config;
35
+ /**
36
+ * Rich text with headings and lists
37
+ */
38
+ rich: DOMPurify.Config;
39
+ /**
40
+ * Full content including links and media
41
+ */
42
+ full: DOMPurify.Config;
43
+ /**
44
+ * Comments and user-generated content (very restrictive)
45
+ */
46
+ comments: DOMPurify.Config;
47
+ };
package/package.json CHANGED
@@ -1,145 +1,151 @@
1
1
  {
2
- "name": "buildgrid-ui",
3
- "version": "1.15.32",
4
- "homepage": "http://adrianomaringolo.github.io/buildgrid-ui",
5
- "publishConfig": {
6
- "access": "public"
7
- },
8
- "main": "dist/buildgrid-ui.umd.js",
9
- "module": "dist/buildgrid-ui.es.js",
10
- "types": "dist/index.d.ts",
11
- "files": [
12
- "dist"
13
- ],
14
- "exports": {
15
- "./package.json": {
16
- "default": "./package.json"
17
- },
18
- ".": {
19
- "types": "./dist/index.d.ts",
20
- "import": "./dist/buildgrid-ui.es.js",
21
- "require": "./dist/buildgrid-ui.umd.js"
22
- },
23
- "./theme": "./dist/buildgrid-ui.css",
24
- "./components/*": {
25
- "types": "./dist/components/*/index.d.ts",
26
- "import": "./dist/components/*/index.js",
27
- "require": "./dist/components/*/index.umd.js"
28
- },
29
- "./blocks/*": {
30
- "types": "./dist/blocks/*/index.d.ts",
31
- "import": "./dist/blocks/*/index.js",
32
- "require": "./dist/blocks/*/index.umd.js"
33
- }
34
- },
35
- "scripts": {
36
- "test": "vitest",
37
- "test:watch": "vitest --watch",
38
- "test:ui": "vitest --ui",
39
- "build": "vite build && npm run build:types",
40
- "build:types": "tsc --emitDeclarationOnly",
41
- "build:link": "npm run build && npm link",
42
- "storybook": "storybook dev -p 6006",
43
- "sb": "storybook dev -p 6006",
44
- "build:storybook": "storybook build",
45
- "predeploy": "npm run build:storybook",
46
- "deploy-storybook": "gh-pages -d storybook-static",
47
- "release": "semantic-release",
48
- "prepublishOnly": "npm run build",
49
- "build:publish": "npm run build && npm publish",
50
- "build-storybook": "storybook build"
51
- },
52
- "keywords": [],
53
- "author": "",
54
- "license": "ISC",
55
- "description": "",
56
- "dependencies": {
57
- "@radix-ui/react-accordion": "^1.2.11",
58
- "@radix-ui/react-alert-dialog": "^1.1.7",
59
- "@radix-ui/react-avatar": "^1.1.4",
60
- "@radix-ui/react-checkbox": "^1.1.5",
61
- "@radix-ui/react-collapsible": "^1.1.12",
62
- "@radix-ui/react-dialog": "^1.1.14",
63
- "@radix-ui/react-dropdown-menu": "^2.1.7",
64
- "@radix-ui/react-label": "^2.1.3",
65
- "@radix-ui/react-navigation-menu": "^1.2.13",
66
- "@radix-ui/react-popover": "^1.1.7",
67
- "@radix-ui/react-progress": "^1.1.3",
68
- "@radix-ui/react-radio-group": "^1.2.4",
69
- "@radix-ui/react-select": "^2.1.7",
70
- "@radix-ui/react-separator": "^1.1.3",
71
- "@radix-ui/react-slider": "^1.3.5",
72
- "@radix-ui/react-slot": "^1.2.3",
73
- "@radix-ui/react-switch": "^1.1.4",
74
- "@radix-ui/react-tabs": "^1.1.12",
75
- "@radix-ui/react-toggle": "^1.1.3",
76
- "@radix-ui/react-toggle-group": "^1.1.3",
77
- "@radix-ui/react-tooltip": "^1.2.7",
78
- "@tailwindcss/vite": "^4.1.11",
79
- "class-variance-authority": "^0.7.1",
80
- "clsx": "^2.1.1",
81
- "cmdk": "^1.1.1",
82
- "compressorjs": "^1.2.1",
83
- "cva-extended": "^2.0.0",
84
- "date-fns": "^4.1.0",
85
- "date-fns-tz": "^3.2.0",
86
- "embla-carousel-react": "^8.6.0",
87
- "highlight.js": "^11.11.1",
88
- "lucide-react": "^0.539.0",
89
- "react-day-picker": "^9.8.1",
90
- "react-dropzone": "^14.3.8",
91
- "sonner": "^1.7.1",
92
- "tailwind-merge": "^3.3.1",
93
- "tw-animate-css": "^1.3.6"
94
- },
95
- "peerDependencies": {
96
- "react": "^19.0.0",
97
- "react-dom": "^19.0.0"
98
- },
99
- "devDependencies": {
100
- "@commitlint/cli": "^19.8.1",
101
- "@commitlint/config-conventional": "^19.8.1",
102
- "@semantic-release/changelog": "^6.0.3",
103
- "@semantic-release/commit-analyzer": "^13.0.1",
104
- "@semantic-release/git": "^10.0.1",
105
- "@semantic-release/npm": "^12.0.2",
106
- "@semantic-release/release-notes-generator": "^14.0.3",
107
- "@shadcn/ui": "^0.0.4",
108
- "@storybook/addon-docs": "^9.0.15",
109
- "@storybook/addon-onboarding": "^9.0.15",
110
- "@storybook/react-vite": "^9.0.15",
111
- "@testing-library/jest-dom": "^6.6.4",
112
- "@testing-library/react": "^16.3.0",
113
- "@types/jest": "^30.0.0",
114
- "@types/node": "^24.2.1",
115
- "@types/react": "^19.1.9",
116
- "@types/react-dom": "^19.1.7",
117
- "@vitejs/plugin-react": "^5.0.0",
118
- "@vitest/ui": "^3.2.4",
119
- "autoprefixer": "^10.4.21",
120
- "eslint": "^9.33.0",
121
- "eslint-config-next": "^15.4.6",
122
- "eslint-config-prettier": "^10.1.8",
123
- "eslint-plugin-prettier": "^5.5.4",
124
- "eslint-plugin-storybook": "^9.1.1",
125
- "gh-pages": "^6.3.0",
126
- "husky": "^9.1.7",
127
- "jsdom": "^26.1.0",
128
- "postcss": "^8.5.6",
129
- "prettier": "^3.6.2",
130
- "prettier-plugin-organize-imports": "^4.2.0",
131
- "prettier-plugin-tailwindcss": "^0.6.14",
132
- "pretty-quick": "^4.2.2",
133
- "react": "^19.1.1",
134
- "react-dom": "^19.1.1",
135
- "semantic-release": "^24.2.7",
136
- "storybook": "^9.1.1",
137
- "tailwindcss": "^4.1.11",
138
- "tailwindcss-animate": "^1.0.7",
139
- "tailwindcss-animated": "^2.0.0",
140
- "typescript": "^5.9.2",
141
- "vite": "^7.1.1",
142
- "vite-plugin-dts": "^4.5.4",
143
- "vitest": "^3.2.4"
144
- }
2
+ "name": "buildgrid-ui",
3
+ "version": "1.17.0",
4
+ "homepage": "http://adrianomaringolo.github.io/buildgrid-ui",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "main": "dist/buildgrid-ui.umd.js",
9
+ "module": "dist/buildgrid-ui.es.js",
10
+ "types": "dist/index.d.ts",
11
+ "files": [
12
+ "dist"
13
+ ],
14
+ "exports": {
15
+ "./package.json": {
16
+ "default": "./package.json"
17
+ },
18
+ ".": {
19
+ "types": "./dist/index.d.ts",
20
+ "import": "./dist/buildgrid-ui.es.js",
21
+ "require": "./dist/buildgrid-ui.umd.js"
22
+ },
23
+ "./theme": "./dist/buildgrid-ui.css",
24
+ "./components/*": {
25
+ "types": "./dist/components/*/index.d.ts",
26
+ "import": "./dist/components/*/index.js",
27
+ "require": "./dist/components/*/index.umd.js"
28
+ },
29
+ "./blocks/*": {
30
+ "types": "./dist/blocks/*/index.d.ts",
31
+ "import": "./dist/blocks/*/index.js",
32
+ "require": "./dist/blocks/*/index.umd.js"
33
+ }
34
+ },
35
+ "scripts": {
36
+ "test": "vitest",
37
+ "test:watch": "vitest --watch",
38
+ "test:ui": "vitest --ui",
39
+ "build": "vite build && npm run build:types",
40
+ "build:types": "tsc --emitDeclarationOnly",
41
+ "build:link": "npm run build && npm link",
42
+ "storybook": "storybook dev -p 6006",
43
+ "sb": "storybook dev -p 6006",
44
+ "build:storybook": "storybook build",
45
+ "predeploy": "npm run build:storybook",
46
+ "deploy-storybook": "gh-pages -d storybook-static",
47
+ "release": "semantic-release",
48
+ "prepublishOnly": "npm run build",
49
+ "build:publish": "npm run build && npm publish",
50
+ "build-storybook": "storybook build",
51
+ "serve-storybook": "npm run build-storybook -- -o ./storybook-static && npx http-server ./storybook-static",
52
+ "chromatic": "npx chromatic --project-token=chpt_af05c4ee3fa4b80"
53
+ },
54
+ "keywords": [],
55
+ "author": "",
56
+ "license": "ISC",
57
+ "description": "",
58
+ "dependencies": {
59
+ "@radix-ui/react-accordion": "^1.2.11",
60
+ "@radix-ui/react-alert-dialog": "^1.1.7",
61
+ "@radix-ui/react-avatar": "^1.1.4",
62
+ "@radix-ui/react-checkbox": "^1.1.5",
63
+ "@radix-ui/react-collapsible": "^1.1.12",
64
+ "@radix-ui/react-dialog": "^1.1.14",
65
+ "@radix-ui/react-dropdown-menu": "^2.1.7",
66
+ "@radix-ui/react-label": "^2.1.3",
67
+ "@radix-ui/react-navigation-menu": "^1.2.13",
68
+ "@radix-ui/react-popover": "^1.1.7",
69
+ "@radix-ui/react-progress": "^1.1.3",
70
+ "@radix-ui/react-radio-group": "^1.2.4",
71
+ "@radix-ui/react-select": "^2.1.7",
72
+ "@radix-ui/react-separator": "^1.1.3",
73
+ "@radix-ui/react-slider": "^1.3.5",
74
+ "@radix-ui/react-slot": "^1.2.3",
75
+ "@radix-ui/react-switch": "^1.1.4",
76
+ "@radix-ui/react-tabs": "^1.1.12",
77
+ "@radix-ui/react-toggle": "^1.1.3",
78
+ "@radix-ui/react-toggle-group": "^1.1.3",
79
+ "@radix-ui/react-tooltip": "^1.2.7",
80
+ "@tailwindcss/vite": "^4.1.11",
81
+ "class-variance-authority": "^0.7.1",
82
+ "clsx": "^2.1.1",
83
+ "cmdk": "^1.1.1",
84
+ "compressorjs": "^1.2.1",
85
+ "cva-extended": "^2.0.0",
86
+ "date-fns": "^4.1.0",
87
+ "date-fns-tz": "^3.2.0",
88
+ "dompurify": "^3.3.1",
89
+ "embla-carousel-react": "^8.6.0",
90
+ "highlight.js": "^11.11.1",
91
+ "lucide-react": "^0.539.0",
92
+ "react-day-picker": "^9.8.1",
93
+ "react-dropzone": "^14.3.8",
94
+ "sonner": "^1.7.1",
95
+ "tailwind-merge": "^3.3.1",
96
+ "tw-animate-css": "^1.3.6"
97
+ },
98
+ "peerDependencies": {
99
+ "react": "^19.0.0",
100
+ "react-dom": "^19.0.0"
101
+ },
102
+ "devDependencies": {
103
+ "@commitlint/cli": "^19.8.1",
104
+ "@commitlint/config-conventional": "^19.8.1",
105
+ "@semantic-release/changelog": "^6.0.3",
106
+ "@semantic-release/commit-analyzer": "^13.0.1",
107
+ "@semantic-release/git": "^10.0.1",
108
+ "@semantic-release/npm": "^12.0.2",
109
+ "@semantic-release/release-notes-generator": "^14.0.3",
110
+ "@shadcn/ui": "^0.0.4",
111
+ "@storybook/addon-docs": "^10.1.10",
112
+ "@storybook/addon-onboarding": "^10.1.10",
113
+ "@storybook/react-vite": "^10.1.10",
114
+ "@testing-library/jest-dom": "^6.6.4",
115
+ "@testing-library/react": "^16.3.0",
116
+ "@types/dompurify": "^3.0.5",
117
+ "@types/jest": "^30.0.0",
118
+ "@types/node": "^24.2.1",
119
+ "@types/react": "^19.1.9",
120
+ "@types/react-dom": "^19.1.7",
121
+ "@vitejs/plugin-react": "^5.0.0",
122
+ "@vitest/ui": "^3.2.4",
123
+ "autoprefixer": "^10.4.21",
124
+ "chromatic": "^13.3.4",
125
+ "eslint": "^9.33.0",
126
+ "eslint-config-next": "^15.4.6",
127
+ "eslint-config-prettier": "^10.1.8",
128
+ "eslint-plugin-prettier": "^5.5.4",
129
+ "eslint-plugin-storybook": "^10.1.10",
130
+ "gh-pages": "^6.3.0",
131
+ "http-server": "^14.1.1",
132
+ "husky": "^9.1.7",
133
+ "jsdom": "^26.1.0",
134
+ "postcss": "^8.5.6",
135
+ "prettier": "^3.6.2",
136
+ "prettier-plugin-organize-imports": "^4.2.0",
137
+ "prettier-plugin-tailwindcss": "^0.6.14",
138
+ "pretty-quick": "^4.2.2",
139
+ "react": "^19.1.1",
140
+ "react-dom": "^19.1.1",
141
+ "semantic-release": "^24.2.7",
142
+ "storybook": "^10.1.10",
143
+ "tailwindcss": "^4.1.11",
144
+ "tailwindcss-animate": "^1.0.7",
145
+ "tailwindcss-animated": "^2.0.0",
146
+ "typescript": "^5.9.2",
147
+ "vite": "^7.1.1",
148
+ "vite-plugin-dts": "^4.5.4",
149
+ "vitest": "^3.2.4"
150
+ }
145
151
  }