@kbach/react 1.0.0-beta.1 → 1.0.0-beta.10

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.
@@ -336,14 +336,15 @@ var defaultTheme = {
336
336
  // Real Tailwind's default spacing scale in full — every step is exactly
337
337
  // `n * 4px` (Tailwind's base spacing unit), including the fractional
338
338
  // `.5` steps (`1.5` -> 6px, `2.5` -> 10px, `3.5` -> 14px) and the "px"
339
- // literal (a bare 1px, for `p-px`-style hairline spacing). Previously
340
- // this only had {0,1,2,4,6,8} — a handful of spot-checked values, not
341
- // the real scale — so anything else (`p-3`, `w-5`, `border-2`, `gap-10`,
342
- // ...) silently failed to resolve (an unknown spacing key returns `None`
343
- // the same way an unknown class does, with no error). "0" itself is
344
- // still needed explicitly (not derivable as "any number * 4") for the
345
- // same reason it always was: `sticky top-0` needs an actual "0" key to
346
- // resolve at all, not just fall through as unresolvable.
339
+ // literal (a bare 1px, for `p-px`-style hairline spacing). This table is
340
+ // only the "usual stops", though — the Rust/JS engines' shared
341
+ // `spacing_px`/`spacingPx` helper falls back to Tailwind v4's own live
342
+ // `n * 4px` formula for any bare numeric step NOT listed here (`p-0.25`,
343
+ // `gap-1.75`, `w-13`, ...), so this table exists to name the common
344
+ // values and give a theme customization something to override, not to
345
+ // enumerate every resolvable step. "px" is the one exception that must
346
+ // stay listed explicitly — it isn't a number, so the formula can't
347
+ // derive it.
347
348
  spacing: {
348
349
  "0": 0,
349
350
  "px": 1,
@@ -388,7 +389,33 @@ var defaultTheme = {
388
389
  xl: 1280,
389
390
  "2xl": 1536
390
391
  },
391
- darkMode: "attribute"
392
+ // Byte-for-byte the same three stacks
393
+ // packages/core-engine/src/resolvers/typography.rs's `font_family_value`
394
+ // falls back to — kept here too (rather than leaving this empty and
395
+ // relying purely on the Rust-side fallback) so `defaultTheme.fontFamily.sans`
396
+ // is a real, readable value for anything that wants to extend rather
397
+ // than replace it (see `KbachConfig.extend.fontFamily` in config.ts).
398
+ fontFamily: {
399
+ sans: 'ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',
400
+ serif: 'ui-serif, Georgia, Cambria, "Times New Roman", Times, serif',
401
+ mono: 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'
402
+ },
403
+ // Matches real Tailwind's own default (`darkMode: 'media'`): pure
404
+ // `@media (prefers-color-scheme: dark)`, works with zero JS — a project
405
+ // using only static `className` strings gets working `dark:` classes
406
+ // out of the box, with no runtime import required to write `data-theme`/
407
+ // `.dark` onto `<html>` (see darkModeStore.ts's `applyToDom`). The
408
+ // tradeoff: `'media'` can't be overridden by a manual light/dark toggle —
409
+ // `useTheme()`/`toggleGlobalDarkMode()` still track `isDark` correctly
410
+ // for JS consumers, but flipping it has no visible effect on `dark:`
411
+ // classes, since the browser's media query only ever reflects the real
412
+ // OS setting. Opt into `darkMode: 'class'` or `'attribute'` explicitly
413
+ // (via `kbach.config.js` or the `config`/`theme` plugin option) as soon
414
+ // as an app wants a real in-app toggle.
415
+ darkMode: "media",
416
+ // Empty by default, matching real Tailwind's own defaults (no forced
417
+ // centering/padding) — see `ContainerConfig`'s own doc comment.
418
+ container: {}
392
419
  };
393
420
  var activeThemeJson = JSON.stringify(defaultTheme);
394
421
  function getThemeJson() {
@@ -2,9 +2,9 @@ import {
2
2
  Fragment,
3
3
  jsx,
4
4
  jsxs
5
- } from "./chunk-AD3G6RHY.mjs";
6
- import "./chunk-ROZXCQSM.mjs";
7
- import "./chunk-FOQWQDF4.mjs";
5
+ } from "./chunk-L6B4DTLD.mjs";
6
+ import "./chunk-ROKZPEHA.mjs";
7
+ import "./chunk-EOSN5CYG.mjs";
8
8
  export {
9
9
  Fragment,
10
10
  jsx,
@@ -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 };