@kbach/react 1.0.0-beta.4 → 1.0.0-beta.6

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/dist/index.js CHANGED
@@ -806,7 +806,7 @@ var warnedMultipleProviders = false;
806
806
  function ThemeProvider({ children, defaultMode = "system" }) {
807
807
  (0, import_react2.useEffect)(() => {
808
808
  mountedProviderCount++;
809
- if (mountedProviderCount > 1 && !warnedMultipleProviders) {
809
+ if (mountedProviderCount > 1 && !warnedMultipleProviders && process.env.NODE_ENV !== "production") {
810
810
  warnedMultipleProviders = true;
811
811
  console.warn(
812
812
  "[kbach] Multiple <ThemeProvider> instances are mounted at once. Dark-mode state is one global store useTheme() reads everywhere, not scoped per-provider, so their defaultMode seeds will fight over the same state."
package/dist/index.mjs CHANGED
@@ -134,7 +134,7 @@ var warnedMultipleProviders = false;
134
134
  function ThemeProvider({ children, defaultMode = "system" }) {
135
135
  useEffect(() => {
136
136
  mountedProviderCount++;
137
- if (mountedProviderCount > 1 && !warnedMultipleProviders) {
137
+ if (mountedProviderCount > 1 && !warnedMultipleProviders && process.env.NODE_ENV !== "production") {
138
138
  warnedMultipleProviders = true;
139
139
  console.warn(
140
140
  "[kbach] Multiple <ThemeProvider> instances are mounted at once. Dark-mode state is one global store useTheme() reads everywhere, not scoped per-provider, so their defaultMode seeds will fight over the same state."
@@ -0,0 +1,36 @@
1
+ import { Plugin } from 'postcss';
2
+ import { T as ThemeConfig, K as KbachConfig } from './config-BQ_b-qxF.mjs';
3
+
4
+ interface KbachPostcssPluginOptions {
5
+ /**
6
+ * Project root to scan from. Defaults to `process.cwd()` — correct for
7
+ * the common case (PostCSS/Next.js run from the project root), but pass
8
+ * this explicitly if your `postcss.config.js` lives somewhere else, or
9
+ * from a monorepo app whose cwd differs from where `src`/`app` actually
10
+ * live.
11
+ */
12
+ root?: string;
13
+ /** Same as `KbachPluginOptions.theme` (vite-plugin/index.ts) — see its own doc comment. */
14
+ theme?: ThemeConfig;
15
+ /** Same as `KbachPluginOptions.config`. */
16
+ config?: KbachConfig;
17
+ /** Directories to scan for class strings, relative to `root`. Defaults to the same set the Vite plugin uses. */
18
+ include?: string[];
19
+ /** Same as `KbachPluginOptions.safelist`. */
20
+ safelist?: string[];
21
+ }
22
+ /**
23
+ * `postcss.config.js`:
24
+ * ```js
25
+ * module.exports = { plugins: { '@kbach/react/postcss': {} } };
26
+ * ```
27
+ * Processes whichever CSS file carries the `kbach:start`/`kbach:end`
28
+ * markers (conventionally `app/globals.css`/`src/kbach.css` — the same
29
+ * file you'd `@import`/reference like any other global stylesheet).
30
+ */
31
+ declare function kbachPostcss(options?: KbachPostcssPluginOptions): Plugin;
32
+ declare namespace kbachPostcss {
33
+ var postcss: boolean;
34
+ }
35
+
36
+ export { type KbachPostcssPluginOptions, kbachPostcss as default };
@@ -0,0 +1,36 @@
1
+ import { Plugin } from 'postcss';
2
+ import { T as ThemeConfig, K as KbachConfig } from './config-BQ_b-qxF.js';
3
+
4
+ interface KbachPostcssPluginOptions {
5
+ /**
6
+ * Project root to scan from. Defaults to `process.cwd()` — correct for
7
+ * the common case (PostCSS/Next.js run from the project root), but pass
8
+ * this explicitly if your `postcss.config.js` lives somewhere else, or
9
+ * from a monorepo app whose cwd differs from where `src`/`app` actually
10
+ * live.
11
+ */
12
+ root?: string;
13
+ /** Same as `KbachPluginOptions.theme` (vite-plugin/index.ts) — see its own doc comment. */
14
+ theme?: ThemeConfig;
15
+ /** Same as `KbachPluginOptions.config`. */
16
+ config?: KbachConfig;
17
+ /** Directories to scan for class strings, relative to `root`. Defaults to the same set the Vite plugin uses. */
18
+ include?: string[];
19
+ /** Same as `KbachPluginOptions.safelist`. */
20
+ safelist?: string[];
21
+ }
22
+ /**
23
+ * `postcss.config.js`:
24
+ * ```js
25
+ * module.exports = { plugins: { '@kbach/react/postcss': {} } };
26
+ * ```
27
+ * Processes whichever CSS file carries the `kbach:start`/`kbach:end`
28
+ * markers (conventionally `app/globals.css`/`src/kbach.css` — the same
29
+ * file you'd `@import`/reference like any other global stylesheet).
30
+ */
31
+ declare function kbachPostcss(options?: KbachPostcssPluginOptions): Plugin;
32
+ declare namespace kbachPostcss {
33
+ var postcss: boolean;
34
+ }
35
+
36
+ export { type KbachPostcssPluginOptions, kbachPostcss as default };