@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.
- package/README.md +216 -73
- package/dist/chunk-4Y2QXNJY.mjs +115 -0
- package/dist/{chunk-FOQWQDF4.mjs → chunk-EOSN5CYG.mjs} +36 -9
- package/dist/chunk-J2M6QWJW.mjs +1385 -0
- package/dist/{chunk-AD3G6RHY.mjs → chunk-L6B4DTLD.mjs} +1 -1
- package/dist/{chunk-ROZXCQSM.mjs → chunk-ROKZPEHA.mjs} +1 -1
- package/dist/config-BQ_b-qxF.d.mts +105 -0
- package/dist/config-BQ_b-qxF.d.ts +105 -0
- package/dist/index.d.mts +65 -34
- package/dist/index.d.ts +65 -34
- package/dist/index.js +227 -43
- package/dist/index.mjs +90 -33
- package/dist/jsx-dev-runtime.js +36 -9
- package/dist/jsx-dev-runtime.mjs +3 -3
- package/dist/jsx-runtime.js +36 -9
- package/dist/jsx-runtime.mjs +3 -3
- package/dist/postcss-plugin.d.mts +36 -0
- package/dist/postcss-plugin.d.ts +36 -0
- package/dist/postcss-plugin.js +1152 -0
- package/dist/postcss-plugin.mjs +79 -0
- package/dist/vite-plugin.d.mts +108 -6
- package/dist/vite-plugin.d.ts +108 -6
- package/dist/vite-plugin.js +512 -225
- package/dist/vite-plugin.mjs +15 -1181
- package/package.json +13 -2
- package/dist/theme-BKAb78KP.d.mts +0 -20
- package/dist/theme-BKAb78KP.d.ts +0 -20
package/dist/jsx-runtime.js
CHANGED
|
@@ -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).
|
|
340
|
-
//
|
|
341
|
-
//
|
|
342
|
-
//
|
|
343
|
-
//
|
|
344
|
-
//
|
|
345
|
-
//
|
|
346
|
-
//
|
|
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
|
-
|
|
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() {
|
package/dist/jsx-runtime.mjs
CHANGED
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
Fragment,
|
|
3
3
|
jsx,
|
|
4
4
|
jsxs
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
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 };
|