@dinesh-gamage/react-scoped-css 2.0.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.
Files changed (46) hide show
  1. package/README.md +373 -0
  2. package/dist/adapters/next.d.mts +45 -0
  3. package/dist/adapters/next.d.ts +45 -0
  4. package/dist/adapters/next.js +14465 -0
  5. package/dist/adapters/next.js.map +1 -0
  6. package/dist/adapters/next.mjs +14461 -0
  7. package/dist/adapters/next.mjs.map +1 -0
  8. package/dist/adapters/vite.d.mts +15 -0
  9. package/dist/adapters/vite.d.ts +15 -0
  10. package/dist/adapters/vite.js +14465 -0
  11. package/dist/adapters/vite.js.map +1 -0
  12. package/dist/adapters/vite.mjs +14461 -0
  13. package/dist/adapters/vite.mjs.map +1 -0
  14. package/dist/adapters/webpack.d.mts +25 -0
  15. package/dist/adapters/webpack.d.ts +25 -0
  16. package/dist/adapters/webpack.js +14440 -0
  17. package/dist/adapters/webpack.js.map +1 -0
  18. package/dist/adapters/webpack.mjs +14436 -0
  19. package/dist/adapters/webpack.mjs.map +1 -0
  20. package/dist/babel/index.d.mts +14 -0
  21. package/dist/babel/index.d.ts +14 -0
  22. package/dist/babel/index.js +14392 -0
  23. package/dist/babel/index.js.map +1 -0
  24. package/dist/babel/index.mjs +14386 -0
  25. package/dist/babel/index.mjs.map +1 -0
  26. package/dist/cli/init.d.mts +1 -0
  27. package/dist/cli/init.d.ts +1 -0
  28. package/dist/cli/init.js +122 -0
  29. package/dist/cli/init.js.map +1 -0
  30. package/dist/cli/init.mjs +99 -0
  31. package/dist/cli/init.mjs.map +1 -0
  32. package/dist/index.d.mts +16 -0
  33. package/dist/index.d.ts +16 -0
  34. package/dist/index.js +43 -0
  35. package/dist/index.js.map +1 -0
  36. package/dist/index.mjs +17 -0
  37. package/dist/index.mjs.map +1 -0
  38. package/dist/options-DBNexJk6.d.mts +25 -0
  39. package/dist/options-DBNexJk6.d.ts +25 -0
  40. package/dist/postcss/index.d.mts +17 -0
  41. package/dist/postcss/index.d.ts +17 -0
  42. package/dist/postcss/index.js +113 -0
  43. package/dist/postcss/index.js.map +1 -0
  44. package/dist/postcss/index.mjs +83 -0
  45. package/dist/postcss/index.mjs.map +1 -0
  46. package/package.json +102 -0
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node
@@ -0,0 +1,122 @@
1
+ #!/usr/bin/env node
2
+ // react-scoped-css v2 — https://github.com/dinesh-gamage/react-scoped-css
3
+ "use strict";
4
+ var __create = Object.create;
5
+ var __defProp = Object.defineProperty;
6
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
+ var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getProtoOf = Object.getPrototypeOf;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
19
+ // If the importer is in node compatibility mode or this is not an ESM
20
+ // file that has been converted to a CommonJS file using a Babel-
21
+ // compatible transform (i.e. "__esModule" has not been set), then set
22
+ // "default" to the CommonJS "module.exports" for node compatibility.
23
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
24
+ mod
25
+ ));
26
+
27
+ // src/cli/init.ts
28
+ var import_fs = __toESM(require("fs"));
29
+ var import_path = __toESM(require("path"));
30
+ function detectBundler(cwd) {
31
+ const pkgPath = import_path.default.join(cwd, "package.json");
32
+ if (!import_fs.default.existsSync(pkgPath)) return "unknown";
33
+ let pkg = {};
34
+ try {
35
+ pkg = JSON.parse(import_fs.default.readFileSync(pkgPath, "utf8"));
36
+ } catch {
37
+ return "unknown";
38
+ }
39
+ const allDeps = {
40
+ ...pkg.dependencies ?? {},
41
+ ...pkg.devDependencies ?? {}
42
+ };
43
+ if ("next" in allDeps) return "next";
44
+ if ("vite" in allDeps) return "vite";
45
+ if ("webpack" in allDeps) return "webpack";
46
+ return "unknown";
47
+ }
48
+ var snippets = {
49
+ vite: `
50
+ // vite.config.ts
51
+ import { defineConfig } from 'vite';
52
+ import react from '@vitejs/plugin-react';
53
+ import { scopedCss } from 'react-scoped-css/vite';
54
+
55
+ export default defineConfig({
56
+ plugins: [
57
+ react(),
58
+ scopedCss({ exclude: ['global-'] }), // add your lib prefixes here
59
+ ],
60
+ });
61
+ `,
62
+ next: `
63
+ // next.config.js
64
+ const { withScopedCss } = require('react-scoped-css/next');
65
+
66
+ module.exports = withScopedCss({
67
+ exclude: ['global-'], // add your lib prefixes here
68
+ })({
69
+ // ...your existing Next.js config
70
+ });
71
+ `,
72
+ webpack: `
73
+ // webpack.config.js
74
+ const { scopedCssWebpack } = require('react-scoped-css/webpack');
75
+ const { babelPlugin, postcssPlugin } = scopedCssWebpack({
76
+ exclude: ['global-'], // add your lib prefixes here
77
+ });
78
+
79
+ // In your module.rules, find the babel-loader rule and add babelPlugin:
80
+ // use: { loader: 'babel-loader', options: { plugins: [...existing, babelPlugin] } }
81
+ //
82
+ // Find the postcss-loader rule and add postcssPlugin:
83
+ // use: { loader: 'postcss-loader', options: { postcssOptions: { plugins: [...existing, postcssPlugin] } } }
84
+ `,
85
+ unknown: `
86
+ // Bundler not detected \u2014 choose the config that matches your setup:
87
+ //
88
+ // Vite: import { scopedCss } from 'react-scoped-css/vite';
89
+ // Next.js: const { withScopedCss } = require('react-scoped-css/next');
90
+ // webpack: const { scopedCssWebpack } = require('react-scoped-css/webpack');
91
+ //
92
+ // See README for full setup instructions.
93
+ `
94
+ };
95
+ function main() {
96
+ const cwd = process.cwd();
97
+ const bundler = detectBundler(cwd);
98
+ const snippet = snippets[bundler];
99
+ const label = bundler === "unknown" ? "Bundler not detected" : `Detected: ${bundler}`;
100
+ console.log("");
101
+ console.log(`react-scoped-css init \u2014 ${label}`);
102
+ console.log("\u2500".repeat(50));
103
+ console.log("");
104
+ console.log("Step 1 \u2014 Install:");
105
+ console.log("");
106
+ console.log(" npm install react-scoped-css");
107
+ console.log("");
108
+ console.log("Step 2 \u2014 Add to your config:");
109
+ console.log(snippet);
110
+ if (bundler !== "unknown") {
111
+ const configFile = bundler === "vite" ? "vite.config.ts (or vite.config.js)" : bundler === "next" ? "next.config.js" : "webpack.config.js";
112
+ console.log(`Paste the snippet above into ${configFile}.`);
113
+ }
114
+ console.log("");
115
+ console.log("That's it. Start your dev server and class names will be scoped automatically.");
116
+ console.log("");
117
+ console.log("To exclude component-library class names (e.g. uxp-, mantine-):");
118
+ console.log(" scopedCss({ exclude: ['uxp-', 'mantine-'] })");
119
+ console.log("");
120
+ }
121
+ main();
122
+ //# sourceMappingURL=init.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/cli/init.ts"],"sourcesContent":["#!/usr/bin/env node\nimport fs from 'fs';\nimport path from 'path';\n\ntype Bundler = 'vite' | 'next' | 'webpack' | 'unknown';\n\nfunction detectBundler(cwd: string): Bundler {\n const pkgPath = path.join(cwd, 'package.json');\n if (!fs.existsSync(pkgPath)) return 'unknown';\n\n let pkg: Record<string, unknown> = {};\n try {\n pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8')) as Record<string, unknown>;\n } catch {\n return 'unknown';\n }\n\n const allDeps = {\n ...(pkg.dependencies as Record<string, string> ?? {}),\n ...(pkg.devDependencies as Record<string, string> ?? {}),\n };\n\n if ('next' in allDeps) return 'next';\n if ('vite' in allDeps) return 'vite';\n if ('webpack' in allDeps) return 'webpack';\n return 'unknown';\n}\n\nconst snippets: Record<Bundler, string> = {\n vite: `\n// vite.config.ts\nimport { defineConfig } from 'vite';\nimport react from '@vitejs/plugin-react';\nimport { scopedCss } from 'react-scoped-css/vite';\n\nexport default defineConfig({\n plugins: [\n react(),\n scopedCss({ exclude: ['global-'] }), // add your lib prefixes here\n ],\n});\n`,\n\n next: `\n// next.config.js\nconst { withScopedCss } = require('react-scoped-css/next');\n\nmodule.exports = withScopedCss({\n exclude: ['global-'], // add your lib prefixes here\n})({\n // ...your existing Next.js config\n});\n`,\n\n webpack: `\n// webpack.config.js\nconst { scopedCssWebpack } = require('react-scoped-css/webpack');\nconst { babelPlugin, postcssPlugin } = scopedCssWebpack({\n exclude: ['global-'], // add your lib prefixes here\n});\n\n// In your module.rules, find the babel-loader rule and add babelPlugin:\n// use: { loader: 'babel-loader', options: { plugins: [...existing, babelPlugin] } }\n//\n// Find the postcss-loader rule and add postcssPlugin:\n// use: { loader: 'postcss-loader', options: { postcssOptions: { plugins: [...existing, postcssPlugin] } } }\n`,\n\n unknown: `\n// Bundler not detected — choose the config that matches your setup:\n//\n// Vite: import { scopedCss } from 'react-scoped-css/vite';\n// Next.js: const { withScopedCss } = require('react-scoped-css/next');\n// webpack: const { scopedCssWebpack } = require('react-scoped-css/webpack');\n//\n// See README for full setup instructions.\n`,\n};\n\nfunction main() {\n const cwd = process.cwd();\n const bundler = detectBundler(cwd);\n const snippet = snippets[bundler];\n\n const label = bundler === 'unknown' ? 'Bundler not detected' : `Detected: ${bundler}`;\n\n console.log('');\n console.log(`react-scoped-css init — ${label}`);\n console.log('─'.repeat(50));\n console.log('');\n console.log('Step 1 — Install:');\n console.log('');\n console.log(' npm install react-scoped-css');\n console.log('');\n console.log('Step 2 — Add to your config:');\n console.log(snippet);\n\n if (bundler !== 'unknown') {\n const configFile =\n bundler === 'vite' ? 'vite.config.ts (or vite.config.js)' :\n bundler === 'next' ? 'next.config.js' :\n 'webpack.config.js';\n console.log(`Paste the snippet above into ${configFile}.`);\n }\n\n console.log('');\n console.log('That\\'s it. Start your dev server and class names will be scoped automatically.');\n console.log('');\n console.log('To exclude component-library class names (e.g. uxp-, mantine-):');\n console.log(' scoped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;AAC1B,UAAQ,IAAI,EAAE;AACd,UAAQ,IAAI,wBAAmB;AAC/B,UAAQ,IAAI,EAAE;AACd,UAAQ,IAAI,gCAAgC;AAC5C,UAAQ,IAAI,EAAE;AACd,UAAQ,IAAI,mCAA8B;AAC1C,UAAQ,IAAI,OAAO;AAEnB,MAAI,YAAY,WAAW;AACvB,UAAM,aACF,YAAY,SAAS,uCACrB,YAAY,SAAS,mBACrB;AACJ,YAAQ,IAAI,gCAAgC,UAAU,GAAG;AAAA,EAC7D;AAEA,UAAQ,IAAI,EAAE;AACd,UAAQ,IAAI,gFAAiF;AAC7F,UAAQ,IAAI,EAAE;AACd,UAAQ,IAAI,iEAAiE;AAC7E,UAAQ,IAAI,gDAAoD;AAChE,UAAQ,IAAI,EAAE;AAClB;AAEA,KAAK;","names":["path","fs"]}
@@ -0,0 +1,99 @@
1
+ #!/usr/bin/env node
2
+ // react-scoped-css v2 — https://github.com/dinesh-gamage/react-scoped-css
3
+
4
+ // src/cli/init.ts
5
+ import fs from "fs";
6
+ import path from "path";
7
+ function detectBundler(cwd) {
8
+ const pkgPath = path.join(cwd, "package.json");
9
+ if (!fs.existsSync(pkgPath)) return "unknown";
10
+ let pkg = {};
11
+ try {
12
+ pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
13
+ } catch {
14
+ return "unknown";
15
+ }
16
+ const allDeps = {
17
+ ...pkg.dependencies ?? {},
18
+ ...pkg.devDependencies ?? {}
19
+ };
20
+ if ("next" in allDeps) return "next";
21
+ if ("vite" in allDeps) return "vite";
22
+ if ("webpack" in allDeps) return "webpack";
23
+ return "unknown";
24
+ }
25
+ var snippets = {
26
+ vite: `
27
+ // vite.config.ts
28
+ import { defineConfig } from 'vite';
29
+ import react from '@vitejs/plugin-react';
30
+ import { scopedCss } from 'react-scoped-css/vite';
31
+
32
+ export default defineConfig({
33
+ plugins: [
34
+ react(),
35
+ scopedCss({ exclude: ['global-'] }), // add your lib prefixes here
36
+ ],
37
+ });
38
+ `,
39
+ next: `
40
+ // next.config.js
41
+ const { withScopedCss } = require('react-scoped-css/next');
42
+
43
+ module.exports = withScopedCss({
44
+ exclude: ['global-'], // add your lib prefixes here
45
+ })({
46
+ // ...your existing Next.js config
47
+ });
48
+ `,
49
+ webpack: `
50
+ // webpack.config.js
51
+ const { scopedCssWebpack } = require('react-scoped-css/webpack');
52
+ const { babelPlugin, postcssPlugin } = scopedCssWebpack({
53
+ exclude: ['global-'], // add your lib prefixes here
54
+ });
55
+
56
+ // In your module.rules, find the babel-loader rule and add babelPlugin:
57
+ // use: { loader: 'babel-loader', options: { plugins: [...existing, babelPlugin] } }
58
+ //
59
+ // Find the postcss-loader rule and add postcssPlugin:
60
+ // use: { loader: 'postcss-loader', options: { postcssOptions: { plugins: [...existing, postcssPlugin] } } }
61
+ `,
62
+ unknown: `
63
+ // Bundler not detected \u2014 choose the config that matches your setup:
64
+ //
65
+ // Vite: import { scopedCss } from 'react-scoped-css/vite';
66
+ // Next.js: const { withScopedCss } = require('react-scoped-css/next');
67
+ // webpack: const { scopedCssWebpack } = require('react-scoped-css/webpack');
68
+ //
69
+ // See README for full setup instructions.
70
+ `
71
+ };
72
+ function main() {
73
+ const cwd = process.cwd();
74
+ const bundler = detectBundler(cwd);
75
+ const snippet = snippets[bundler];
76
+ const label = bundler === "unknown" ? "Bundler not detected" : `Detected: ${bundler}`;
77
+ console.log("");
78
+ console.log(`react-scoped-css init \u2014 ${label}`);
79
+ console.log("\u2500".repeat(50));
80
+ console.log("");
81
+ console.log("Step 1 \u2014 Install:");
82
+ console.log("");
83
+ console.log(" npm install react-scoped-css");
84
+ console.log("");
85
+ console.log("Step 2 \u2014 Add to your config:");
86
+ console.log(snippet);
87
+ if (bundler !== "unknown") {
88
+ const configFile = bundler === "vite" ? "vite.config.ts (or vite.config.js)" : bundler === "next" ? "next.config.js" : "webpack.config.js";
89
+ console.log(`Paste the snippet above into ${configFile}.`);
90
+ }
91
+ console.log("");
92
+ console.log("That's it. Start your dev server and class names will be scoped automatically.");
93
+ console.log("");
94
+ console.log("To exclude component-library class names (e.g. uxp-, mantine-):");
95
+ console.log(" scopedCss({ exclude: ['uxp-', 'mantine-'] })");
96
+ console.log("");
97
+ }
98
+ main();
99
+ //# sourceMappingURL=init.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/cli/init.ts"],"sourcesContent":["#!/usr/bin/env node\nimport fs from 'fs';\nimport path from 'path';\n\ntype Bundler = 'vite' | 'next' | 'webpack' | 'unknown';\n\nfunction detectBundler(cwd: string): Bundler {\n const pkgPath = path.join(cwd, 'package.json');\n if (!fs.existsSync(pkgPath)) return 'unknown';\n\n let pkg: Record<string, unknown> = {};\n try {\n pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8')) as Record<string, unknown>;\n } catch {\n return 'unknown';\n }\n\n const allDeps = {\n ...(pkg.dependencies as Record<string, string> ?? {}),\n ...(pkg.devDependencies as Record<string, string> ?? {}),\n };\n\n if ('next' in allDeps) return 'next';\n if ('vite' in allDeps) return 'vite';\n if ('webpack' in allDeps) return 'webpack';\n return 'unknown';\n}\n\nconst snippets: Record<Bundler, string> = {\n vite: `\n// vite.config.ts\nimport { defineConfig } from 'vite';\nimport react from '@vitejs/plugin-react';\nimport { scopedCss } from 'react-scoped-css/vite';\n\nexport default defineConfig({\n plugins: [\n react(),\n scopedCss({ exclude: ['global-'] }), // add your lib prefixes here\n ],\n});\n`,\n\n next: `\n// next.config.js\nconst { withScopedCss } = require('react-scoped-css/next');\n\nmodule.exports = withScopedCss({\n exclude: ['global-'], // add your lib prefixes here\n})({\n // ...your existing Next.js config\n});\n`,\n\n webpack: `\n// webpack.config.js\nconst { scopedCssWebpack } = require('react-scoped-css/webpack');\nconst { babelPlugin, postcssPlugin } = scopedCssWebpack({\n exclude: ['global-'], // add your lib prefixes here\n});\n\n// In your module.rules, find the babel-loader rule and add babelPlugin:\n// use: { loader: 'babel-loader', options: { plugins: [...existing, babelPlugin] } }\n//\n// Find the postcss-loader rule and add postcssPlugin:\n// use: { loader: 'postcss-loader', options: { postcssOptions: { plugins: [...existing, postcssPlugin] } } }\n`,\n\n unknown: `\n// Bundler not detected — choose the config that matches your setup:\n//\n// Vite: import { scopedCss } from 'react-scoped-css/vite';\n// Next.js: const { withScopedCss } = require('react-scoped-css/next');\n// webpack: const { scopedCssWebpack } = require('react-scoped-css/webpack');\n//\n// See README for full setup instructions.\n`,\n};\n\nfunction main() {\n const cwd = process.cwd();\n const bundler = detectBundler(cwd);\n const snippet = snippets[bundler];\n\n const label = bundler === 'unknown' ? 'Bundler not detected' : `Detected: ${bundler}`;\n\n console.log('');\n console.log(`react-scoped-css init — ${label}`);\n console.log('─'.repeat(50));\n console.log('');\n console.log('Step 1 — Install:');\n console.log('');\n console.log(' npm install react-scoped-css');\n console.log('');\n console.log('Step 2 — Add to your config:');\n console.log(snippet);\n\n if (bundler !== 'unknown') {\n const configFile =\n bundler === 'vite' ? 'vite.config.ts (or vite.config.js)' :\n bundler === 'next' ? 'next.config.js' :\n 'webpack.config.js';\n console.log(`Paste the snippet above into ${configFile}.`);\n }\n\n console.log('');\n console.log('That\\'s it. Start your dev server and class names will be scoped automatically.');\n console.log('');\n console.log('To exclude component-library class names (e.g. uxp-, mantine-):');\n console.log(' scopedCss({ exclude: [\\'uxp-\\', \\'mantine-\\'] })');\n console.log('');\n}\n\nmain();\n"],"mappings":";;;;AACA,OAAO,QAAQ;AACf,OAAO,UAAU;AAIjB,SAAS,cAAc,KAAsB;AACzC,QAAM,UAAU,KAAK,KAAK,KAAK,cAAc;AAC7C,MAAI,CAAC,GAAG,WAAW,OAAO,EAAG,QAAO;AAEpC,MAAI,MAA+B,CAAC;AACpC,MAAI;AACA,UAAM,KAAK,MAAM,GAAG,aAAa,SAAS,MAAM,CAAC;AAAA,EACrD,QAAQ;AACJ,WAAO;AAAA,EACX;AAEA,QAAM,UAAU;AAAA,IACZ,GAAI,IAAI,gBAA0C,CAAC;AAAA,IACnD,GAAI,IAAI,mBAA6C,CAAC;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;","names":[]}
@@ -0,0 +1,16 @@
1
+ export { S as ScopedCssOptions } from './options-DBNexJk6.mjs';
2
+
3
+ /**
4
+ * Runtime helper injected by the Babel plugin for dynamic className expressions.
5
+ *
6
+ * Appends `-{hash}` to every class name token in `value`. Handles strings,
7
+ * arrays, null, and undefined gracefully. Static string literals never reach
8
+ * this function — the Babel plugin inlines the hash at compile time.
9
+ *
10
+ * @param value The dynamic className value from JSX.
11
+ * @param hash The 8-char file hash generated at compile time.
12
+ * @param exclude Class name prefixes to leave unscoped.
13
+ */
14
+ declare function scopeClass(value: string | string[] | null | undefined, hash: string, exclude?: string[]): string;
15
+
16
+ export { scopeClass };
@@ -0,0 +1,16 @@
1
+ export { S as ScopedCssOptions } from './options-DBNexJk6.js';
2
+
3
+ /**
4
+ * Runtime helper injected by the Babel plugin for dynamic className expressions.
5
+ *
6
+ * Appends `-{hash}` to every class name token in `value`. Handles strings,
7
+ * arrays, null, and undefined gracefully. Static string literals never reach
8
+ * this function — the Babel plugin inlines the hash at compile time.
9
+ *
10
+ * @param value The dynamic className value from JSX.
11
+ * @param hash The 8-char file hash generated at compile time.
12
+ * @param exclude Class name prefixes to leave unscoped.
13
+ */
14
+ declare function scopeClass(value: string | string[] | null | undefined, hash: string, exclude?: string[]): string;
15
+
16
+ export { scopeClass };
package/dist/index.js ADDED
@@ -0,0 +1,43 @@
1
+ // react-scoped-css v2 — https://github.com/dinesh-gamage/react-scoped-css
2
+ "use strict";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/index.ts
22
+ var src_exports = {};
23
+ __export(src_exports, {
24
+ scopeClass: () => scopeClass
25
+ });
26
+ module.exports = __toCommonJS(src_exports);
27
+
28
+ // src/classNames.ts
29
+ function scopeClass(value, hash, exclude = []) {
30
+ if (value == null) return "";
31
+ if (Array.isArray(value)) {
32
+ return value.map((v) => scopeClass(v, hash, exclude)).filter(Boolean).join(" ");
33
+ }
34
+ return value.split(/\s+/).filter(Boolean).map((cls) => {
35
+ if (exclude.some((prefix) => cls.startsWith(prefix))) return cls;
36
+ return `${cls}-${hash}`;
37
+ }).join(" ");
38
+ }
39
+ // Annotate the CommonJS export names for ESM import in node:
40
+ 0 && (module.exports = {
41
+ scopeClass
42
+ });
43
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/classNames.ts"],"sourcesContent":["export { scopeClass } from './classNames';\nexport type { ScopedCssOptions } from './shared/options';\n","/**\n * Runtime helper injected by the Babel plugin for dynamic className expressions.\n *\n * Appends `-{hash}` to every class name token in `value`. Handles strings,\n * arrays, null, and undefined gracefully. Static string literals never reach\n * this function — the Babel plugin inlines the hash at compile time.\n *\n * @param value The dynamic className value from JSX.\n * @param hash The 8-char file hash generated at compile time.\n * @param exclude Class name prefixes to leave unscoped.\n */\nexport function scopeClass(\n value: string | string[] | null | undefined,\n hash: string,\n exclude: string[] = [],\n): string {\n if (value == null) return '';\n if (Array.isArray(value)) {\n return value.map(v => scopeClass(v, hash, exclude)).filter(Boolean).join(' ');\n }\n return value\n .split(/\\s+/)\n .filter(Boolean)\n .map(cls => {\n if (exclude.some(prefix => cls.startsWith(prefix))) return cls;\n return `${cls}-${hash}`;\n })\n .join(' ');\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACWO,SAAS,WACZ,OACA,MACA,UAAoB,CAAC,GACf;AACN,MAAI,SAAS,KAAM,QAAO;AAC1B,MAAI,MAAM,QAAQ,KAAK,GAAG;AACtB,WAAO,MAAM,IAAI,OAAK,WAAW,GAAG,MAAM,OAAO,CAAC,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,EAChF;AACA,SAAO,MACF,MAAM,KAAK,EACX,OAAO,OAAO,EACd,IAAI,SAAO;AACR,QAAI,QAAQ,KAAK,YAAU,IAAI,WAAW,MAAM,CAAC,EAAG,QAAO;AAC3D,WAAO,GAAG,GAAG,IAAI,IAAI;AAAA,EACzB,CAAC,EACA,KAAK,GAAG;AACjB;","names":[]}
package/dist/index.mjs ADDED
@@ -0,0 +1,17 @@
1
+ // react-scoped-css v2 — https://github.com/dinesh-gamage/react-scoped-css
2
+
3
+ // src/classNames.ts
4
+ function scopeClass(value, hash, exclude = []) {
5
+ if (value == null) return "";
6
+ if (Array.isArray(value)) {
7
+ return value.map((v) => scopeClass(v, hash, exclude)).filter(Boolean).join(" ");
8
+ }
9
+ return value.split(/\s+/).filter(Boolean).map((cls) => {
10
+ if (exclude.some((prefix) => cls.startsWith(prefix))) return cls;
11
+ return `${cls}-${hash}`;
12
+ }).join(" ");
13
+ }
14
+ export {
15
+ scopeClass
16
+ };
17
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/classNames.ts"],"sourcesContent":["/**\n * Runtime helper injected by the Babel plugin for dynamic className expressions.\n *\n * Appends `-{hash}` to every class name token in `value`. Handles strings,\n * arrays, null, and undefined gracefully. Static string literals never reach\n * this function — the Babel plugin inlines the hash at compile time.\n *\n * @param value The dynamic className value from JSX.\n * @param hash The 8-char file hash generated at compile time.\n * @param exclude Class name prefixes to leave unscoped.\n */\nexport function scopeClass(\n value: string | string[] | null | undefined,\n hash: string,\n exclude: string[] = [],\n): string {\n if (value == null) return '';\n if (Array.isArray(value)) {\n return value.map(v => scopeClass(v, hash, exclude)).filter(Boolean).join(' ');\n }\n return value\n .split(/\\s+/)\n .filter(Boolean)\n .map(cls => {\n if (exclude.some(prefix => cls.startsWith(prefix))) return cls;\n return `${cls}-${hash}`;\n })\n .join(' ');\n}\n"],"mappings":";;;AAWO,SAAS,WACZ,OACA,MACA,UAAoB,CAAC,GACf;AACN,MAAI,SAAS,KAAM,QAAO;AAC1B,MAAI,MAAM,QAAQ,KAAK,GAAG;AACtB,WAAO,MAAM,IAAI,OAAK,WAAW,GAAG,MAAM,OAAO,CAAC,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,EAChF;AACA,SAAO,MACF,MAAM,KAAK,EACX,OAAO,OAAO,EACd,IAAI,SAAO;AACR,QAAI,QAAQ,KAAK,YAAU,IAAI,WAAW,MAAM,CAAC,EAAG,QAAO;AAC3D,WAAO,GAAG,GAAG,IAAI,IAAI;AAAA,EACzB,CAAC,EACA,KAAK,GAAG;AACjB;","names":[]}
@@ -0,0 +1,25 @@
1
+ interface ScopedCssOptions {
2
+ /**
3
+ * Class name prefixes to leave unscoped.
4
+ * Any class whose string value starts with one of these prefixes is left
5
+ * exactly as written — useful for component-library overrides.
6
+ * Default: []
7
+ *
8
+ * @example exclude: ['uxp-', 'global-']
9
+ */
10
+ exclude?: string[];
11
+ /**
12
+ * Override the auto-detected salt used in hash generation.
13
+ * Defaults to the `name` field from the nearest package.json.
14
+ * Set explicitly in monorepos or multi-app deployments to guarantee
15
+ * globally unique class names across apps.
16
+ */
17
+ salt?: string;
18
+ /**
19
+ * Number of hex characters in the generated hash suffix.
20
+ * Default: 8
21
+ */
22
+ hashLength?: number;
23
+ }
24
+
25
+ export type { ScopedCssOptions as S };
@@ -0,0 +1,25 @@
1
+ interface ScopedCssOptions {
2
+ /**
3
+ * Class name prefixes to leave unscoped.
4
+ * Any class whose string value starts with one of these prefixes is left
5
+ * exactly as written — useful for component-library overrides.
6
+ * Default: []
7
+ *
8
+ * @example exclude: ['uxp-', 'global-']
9
+ */
10
+ exclude?: string[];
11
+ /**
12
+ * Override the auto-detected salt used in hash generation.
13
+ * Defaults to the `name` field from the nearest package.json.
14
+ * Set explicitly in monorepos or multi-app deployments to guarantee
15
+ * globally unique class names across apps.
16
+ */
17
+ salt?: string;
18
+ /**
19
+ * Number of hex characters in the generated hash suffix.
20
+ * Default: 8
21
+ */
22
+ hashLength?: number;
23
+ }
24
+
25
+ export type { ScopedCssOptions as S };
@@ -0,0 +1,17 @@
1
+ import { PluginCreator } from 'postcss';
2
+ import { S as ScopedCssOptions } from '../options-DBNexJk6.mjs';
3
+
4
+ /**
5
+ * PostCSS plugin — appends `-{hash}` to every class selector in the file,
6
+ * unless the class name starts with an excluded prefix.
7
+ *
8
+ * Files whose path contains `.module.` are skipped entirely — they are already
9
+ * handled by CSS Modules and must not be double-processed.
10
+ *
11
+ * Usage (postcss.config.js):
12
+ * const { scopedCssPostcss } = require('react-scoped-css/postcss');
13
+ * module.exports = { plugins: [scopedCssPostcss({ exclude: ['uxp-'] })] };
14
+ */
15
+ declare const plugin: PluginCreator<ScopedCssOptions>;
16
+
17
+ export { plugin as default, plugin as scopedCssPostcss };
@@ -0,0 +1,17 @@
1
+ import { PluginCreator } from 'postcss';
2
+ import { S as ScopedCssOptions } from '../options-DBNexJk6.js';
3
+
4
+ /**
5
+ * PostCSS plugin — appends `-{hash}` to every class selector in the file,
6
+ * unless the class name starts with an excluded prefix.
7
+ *
8
+ * Files whose path contains `.module.` are skipped entirely — they are already
9
+ * handled by CSS Modules and must not be double-processed.
10
+ *
11
+ * Usage (postcss.config.js):
12
+ * const { scopedCssPostcss } = require('react-scoped-css/postcss');
13
+ * module.exports = { plugins: [scopedCssPostcss({ exclude: ['uxp-'] })] };
14
+ */
15
+ declare const plugin: PluginCreator<ScopedCssOptions>;
16
+
17
+ export { plugin as default, plugin as scopedCssPostcss };
@@ -0,0 +1,113 @@
1
+ // react-scoped-css v2 — https://github.com/dinesh-gamage/react-scoped-css
2
+ "use strict";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, { get: all[name], enumerable: true });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+
31
+ // src/postcss/index.ts
32
+ var postcss_exports = {};
33
+ __export(postcss_exports, {
34
+ default: () => postcss_default,
35
+ scopedCssPostcss: () => plugin
36
+ });
37
+ module.exports = __toCommonJS(postcss_exports);
38
+
39
+ // src/shared/hash.ts
40
+ var import_crypto = require("crypto");
41
+ var import_fs = __toESM(require("fs"));
42
+ var import_path = __toESM(require("path"));
43
+ function findUpSync(filename, startDir) {
44
+ let dir = startDir;
45
+ while (true) {
46
+ const candidate = import_path.default.join(dir, filename);
47
+ if (import_fs.default.existsSync(candidate)) return candidate;
48
+ const parent = import_path.default.dirname(dir);
49
+ if (parent === dir) return void 0;
50
+ dir = parent;
51
+ }
52
+ }
53
+ function readPackageNameSync(pkgJsonPath) {
54
+ if (!pkgJsonPath) return "";
55
+ try {
56
+ const raw = import_fs.default.readFileSync(pkgJsonPath, "utf8");
57
+ const pkg = JSON.parse(raw);
58
+ return typeof pkg.name === "string" ? pkg.name : "";
59
+ } catch {
60
+ return "";
61
+ }
62
+ }
63
+ function generateHash(absoluteFilePath, salt, hashLength = 8) {
64
+ const pkgJsonPath = findUpSync("package.json", import_path.default.dirname(absoluteFilePath));
65
+ const projectRoot = pkgJsonPath ? import_path.default.dirname(pkgJsonPath) : process.cwd();
66
+ const relativeFilePath = import_path.default.relative(projectRoot, absoluteFilePath).replace(/\.[^./\\]+$/, "");
67
+ const effectiveSalt = salt ?? readPackageNameSync(pkgJsonPath);
68
+ return (0, import_crypto.createHash)("md5").update(relativeFilePath + effectiveSalt).digest("hex").slice(0, hashLength);
69
+ }
70
+
71
+ // src/shared/exclude.ts
72
+ function isExcluded(className, excludePrefixes) {
73
+ if (excludePrefixes.length === 0) return false;
74
+ return excludePrefixes.some((prefix) => className.startsWith(prefix));
75
+ }
76
+
77
+ // src/postcss/index.ts
78
+ var scssSyntax = require("postcss-scss");
79
+ var CLASS_SELECTOR_RE = /\.(-?[_a-zA-Z][_a-zA-Z0-9-]*)/g;
80
+ var plugin = (opts = {}) => {
81
+ const { exclude = [], salt, hashLength = 8 } = opts;
82
+ return {
83
+ postcssPlugin: "react-scoped-css",
84
+ prepare(result) {
85
+ const filePath = result.opts.from;
86
+ if (!filePath || filePath.includes(".module.")) {
87
+ return {};
88
+ }
89
+ if (/\.s[ac]ss$/i.test(filePath) && !result.opts.syntax) {
90
+ result.opts.syntax = scssSyntax;
91
+ }
92
+ const hash = generateHash(filePath, salt, hashLength);
93
+ return {
94
+ Rule(rule) {
95
+ rule.selector = rule.selector.replace(
96
+ CLASS_SELECTOR_RE,
97
+ (match, className) => {
98
+ if (isExcluded(className, exclude)) return match;
99
+ return `.${className}-${hash}`;
100
+ }
101
+ );
102
+ }
103
+ };
104
+ }
105
+ };
106
+ };
107
+ plugin.postcss = true;
108
+ var postcss_default = plugin;
109
+ // Annotate the CommonJS export names for ESM import in node:
110
+ 0 && (module.exports = {
111
+ scopedCssPostcss
112
+ });
113
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/postcss/index.ts","../../src/shared/hash.ts","../../src/shared/exclude.ts"],"sourcesContent":["import type { PluginCreator, Syntax } from 'postcss';\nimport { generateHash } from '../shared/hash';\nimport { isExcluded } from '../shared/exclude';\nimport type { ScopedCssOptions } from '../shared/options';\n\n// postcss-scss is a bundled dependency — use it automatically for .scss/.sass files\n// eslint-disable-next-line @typescript-eslint/no-require-imports\nconst scssSyntax: Syntax = require('postcss-scss');\n\n// Matches a CSS class selector token: .foo, .foo-bar, ._private, etc.\n// Captures the class name without the leading dot.\nconst CLASS_SELECTOR_RE = /\\.(-?[_a-zA-Z][_a-zA-Z0-9-]*)/g;\n\n/**\n * PostCSS plugin — appends `-{hash}` to every class selector in the file,\n * unless the class name starts with an excluded prefix.\n *\n * Files whose path contains `.module.` are skipped entirely — they are already\n * handled by CSS Modules and must not be double-processed.\n *\n * Usage (postcss.config.js):\n * const { scopedCssPostcss } = require('react-scoped-css/postcss');\n * module.exports = { plugins: [scopedCssPostcss({ exclude: ['uxp-'] })] };\n */\nconst plugin: PluginCreator<ScopedCssOptions> = (opts: ScopedCssOptions = {}) => {\n const { exclude = [], salt, hashLength = 8 } = opts;\n\n return {\n postcssPlugin: 'react-scoped-css',\n\n prepare(result) {\n const filePath = result.opts.from;\n\n // Skip CSS Modules files — they are already scoped.\n if (!filePath || filePath.includes('.module.')) {\n return {};\n }\n\n // Apply SCSS syntax automatically for .scss/.sass files.\n // This allows users to run postcss-loader without a separate syntax config.\n if (/\\.s[ac]ss$/i.test(filePath) && !result.opts.syntax) {\n result.opts.syntax = scssSyntax;\n }\n\n const hash = generateHash(filePath, salt, hashLength);\n\n return {\n Rule(rule) {\n rule.selector = rule.selector.replace(\n CLASS_SELECTOR_RE,\n (match, className: string) => {\n if (isExcluded(className, exclude)) return match;\n return `.${className}-${hash}`;\n },\n );\n },\n };\n },\n };\n};\n\nplugin.postcss = true;\n\nexport { plugin as scopedCssPostcss };\nexport default plugin;\n","import { createHash } from 'crypto';\nimport fs from 'fs';\nimport path from 'path';\n\n/** Walk up from `dir` looking for `filename`. Returns the first match or undefined. */\nfunction findUpSync(filename: string, startDir: string): string | undefined {\n let dir = startDir;\n while (true) {\n const candidate = path.join(dir, filename);\n if (fs.existsSync(candidate)) return candidate;\n const parent = path.dirname(dir);\n if (parent === dir) return undefined; // reached filesystem root\n dir = parent;\n }\n}\n\nfunction readPackageNameSync(pkgJsonPath: string | undefined): string {\n if (!pkgJsonPath) return '';\n try {\n const raw = fs.readFileSync(pkgJsonPath, 'utf8');\n const pkg = JSON.parse(raw) as { name?: string };\n return typeof pkg.name === 'string' ? pkg.name : '';\n } catch {\n return '';\n }\n}\n\n/**\n * Generate a stable 8-char hex hash for a source file.\n *\n * Uses the file's path relative to the nearest package.json root so the hash\n * is identical on every developer machine and in CI, regardless of where the\n * repo is cloned.\n *\n * @param absoluteFilePath Absolute path to the source file being processed.\n * @param salt Override the default salt (package.json \"name\").\n * Pass an explicit value to guarantee global uniqueness\n * across monorepos or multi-app deployments.\n * @param hashLength Number of hex characters to use (default: 8).\n */\nexport function generateHash(\n absoluteFilePath: string,\n salt?: string,\n hashLength = 8,\n): string {\n const pkgJsonPath = findUpSync('package.json', path.dirname(absoluteFilePath));\n const projectRoot = pkgJsonPath ? path.dirname(pkgJsonPath) : process.cwd();\n // Strip extension so Card.tsx and Card.scss produce the same hash.\n // A component's scope identity is its path without extension.\n const relativeFilePath = path.relative(projectRoot, absoluteFilePath).replace(/\\.[^./\\\\]+$/, '');\n\n const effectiveSalt = salt ?? readPackageNameSync(pkgJsonPath);\n\n return createHash('md5')\n .update(relativeFilePath + effectiveSalt)\n .digest('hex')\n .slice(0, hashLength);\n}\n","/**\n * Returns true if className should be left unscoped.\n *\n * A class is excluded when its string value starts with any of the configured\n * prefixes. This is the intended behaviour for component-library overrides:\n * `exclude: ['uxp-', 'global-']` leaves `uxp-button` and `global-header`\n * untouched while scoping everything else.\n */\nexport function isExcluded(className: string, excludePrefixes: string[]): boolean {\n if (excludePrefixes.length === 0) return false;\n return excludePrefixes.some(prefix => className.startsWith(prefix));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,oBAA2B;AAC3B,gBAAe;AACf,kBAAiB;AAGjB,SAAS,WAAW,UAAkB,UAAsC;AACxE,MAAI,MAAM;AACV,SAAO,MAAM;AACT,UAAM,YAAY,YAAAA,QAAK,KAAK,KAAK,QAAQ;AACzC,QAAI,UAAAC,QAAG,WAAW,SAAS,EAAG,QAAO;AACrC,UAAM,SAAS,YAAAD,QAAK,QAAQ,GAAG;AAC/B,QAAI,WAAW,IAAK,QAAO;AAC3B,UAAM;AAAA,EACV;AACJ;AAEA,SAAS,oBAAoB,aAAyC;AAClE,MAAI,CAAC,YAAa,QAAO;AACzB,MAAI;AACA,UAAM,MAAM,UAAAC,QAAG,aAAa,aAAa,MAAM;AAC/C,UAAM,MAAM,KAAK,MAAM,GAAG;AAC1B,WAAO,OAAO,IAAI,SAAS,WAAW,IAAI,OAAO;AAAA,EACrD,QAAQ;AACJ,WAAO;AAAA,EACX;AACJ;AAeO,SAAS,aACZ,kBACA,MACA,aAAa,GACP;AACN,QAAM,cAAc,WAAW,gBAAgB,YAAAD,QAAK,QAAQ,gBAAgB,CAAC;AAC7E,QAAM,cAAc,cAAc,YAAAA,QAAK,QAAQ,WAAW,IAAI,QAAQ,IAAI;AAG1E,QAAM,mBAAmB,YAAAA,QAAK,SAAS,aAAa,gBAAgB,EAAE,QAAQ,eAAe,EAAE;AAE/F,QAAM,gBAAgB,Q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