@kbach/react 1.0.0-beta.0 → 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.
@@ -333,21 +333,54 @@ var defaultTheme = {
333
333
  ...PALETTE,
334
334
  surface: { light: "#f9fafb", dark: "#111827" }
335
335
  },
336
+ // Real Tailwind's default spacing scale in full — every step is exactly
337
+ // `n * 4px` (Tailwind's base spacing unit), including the fractional
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). 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.
336
348
  spacing: {
337
- // "0" is always a hardcoded zero in real Tailwind's own scale too,
338
- // regardless of the base spacing unit — needed for `p-0`/`m-0`/
339
- // `top-0`/`inset-0`/etc., and specifically for `sticky top-0` (a
340
- // sticky element needs an explicit offset to have any stick point at
341
- // all; without one it behaves just like `relative`, no different from
342
- // omitting `top-0` outright). Confirmed missing by hand: this
343
- // sandbox's own header used `sticky top-0`, which silently never
344
- // resolved (no "0" spacing key existed) until this was added.
345
349
  "0": 0,
350
+ "px": 1,
351
+ "0.5": 2,
346
352
  "1": 4,
353
+ "1.5": 6,
347
354
  "2": 8,
355
+ "2.5": 10,
356
+ "3": 12,
357
+ "3.5": 14,
348
358
  "4": 16,
359
+ "5": 20,
349
360
  "6": 24,
350
- "8": 32
361
+ "7": 28,
362
+ "8": 32,
363
+ "9": 36,
364
+ "10": 40,
365
+ "11": 44,
366
+ "12": 48,
367
+ "14": 56,
368
+ "16": 64,
369
+ "20": 80,
370
+ "24": 96,
371
+ "28": 112,
372
+ "32": 128,
373
+ "36": 144,
374
+ "40": 160,
375
+ "44": 176,
376
+ "48": 192,
377
+ "52": 208,
378
+ "56": 224,
379
+ "60": 240,
380
+ "64": 256,
381
+ "72": 288,
382
+ "80": 320,
383
+ "96": 384
351
384
  },
352
385
  screens: {
353
386
  sm: 640,
@@ -356,7 +389,33 @@ var defaultTheme = {
356
389
  xl: 1280,
357
390
  "2xl": 1536
358
391
  },
359
- 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: {}
360
419
  };
361
420
  var activeThemeJson = JSON.stringify(defaultTheme);
362
421
  function getThemeJson() {
@@ -2,9 +2,9 @@ import {
2
2
  Fragment,
3
3
  jsx,
4
4
  jsxs
5
- } from "./chunk-VBPQAIZL.mjs";
6
- import "./chunk-G3RJJNSY.mjs";
7
- import "./chunk-AFY36PRX.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 };