@kbach/react 1.0.0-beta.26 → 1.0.0-beta.27

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/AGENTS.md CHANGED
@@ -8,6 +8,16 @@ overview, `kbach.config.js` reference, the color palette, and how the
8
8
  underlying engine is built, see the repo root's
9
9
  [AGENTS.md](https://github.com/semsakadanupol/kbach/blob/main/AGENTS.md).
10
10
 
11
+ > **Before writing a single class, know this — Tailwind familiarity
12
+ > actively misleads here:** color shades are `1`–`12` (lightest→darkest),
13
+ > not Tailwind's `50`–`950`. `bg-blue-500` is not a Kbach class — it
14
+ > silently resolves to nothing (an "Unknown class ... Typo?" dev warning,
15
+ > not a visible color, and ONLY if the string was actually reachable by
16
+ > the static scanner — see §2). The real class is `bg-blue-6`. Full
17
+ > palette: root AGENTS.md §7. Everything else in real Tailwind's utility
18
+ > vocabulary works here essentially as-is — unlike `@kbach/react-native`,
19
+ > web has the full modifier set with no native-platform gaps.
20
+
11
21
  ---
12
22
 
13
23
  ## 1. Install + wire up the build
@@ -84,6 +94,12 @@ write `className="..."` normally.
84
94
  - **`@kbach/react/jsx-runtime`** — a `jsxImportSource` override that
85
95
  intercepts *every* element's `className` at runtime instead of relying on
86
96
  the static scan. Also needs `await initKbach()`.
97
+ - **No-build CDN usage is a SEPARATE package, `@kbach/browser`**
98
+ (packages/browser), which bundles this package's runtime modules (`kb`,
99
+ `theme`, `config`, `colorVariables`, `darkModeStore`, `wasmLoader`)
100
+ straight from `src/`. Renaming or changing those modules' exports (or
101
+ `wasmLoader.ts`'s internal `initKbachFrom`) breaks that package, and its
102
+ own tests catch it. See [packages/browser/AGENTS.md](../browser/AGENTS.md).
87
103
 
88
104
  ## 4. Dark mode
89
105
 
package/README.md CHANGED
@@ -1,7 +1,8 @@
1
1
  # @kbach/react
2
2
 
3
3
  A utility-first styling engine for React, powered by a Rust/WASM core.
4
- Tailwind CSS v4 feature parity, plus Kbach's own color palette.
4
+ Uses Tailwind CSS-compatible utility class names, plus Kbach's own color
5
+ palette.
5
6
 
6
7
  > Beta — API may still change before 1.0.0.
7
8
 
@@ -11,6 +12,12 @@ Tailwind CSS v4 feature parity, plus Kbach's own color palette.
11
12
  npm install @kbach/react
12
13
  ```
13
14
 
15
+ Or skip straight to a working setup: `npx @kbach/cli init` detects Vite
16
+ or Next.js, installs this package, and patches `vite.config.ts` /
17
+ `postcss.config.js` for you — see [`@kbach/cli`](https://www.npmjs.com/package/@kbach/cli).
18
+ The steps below are what it automates, and still the fallback it prints
19
+ if your config file's shape is too unusual for it to edit safely.
20
+
14
21
  ## Quick start
15
22
 
16
23
  ```ts
@@ -72,6 +79,13 @@ runtime: the dynamic [`kb()`](#dynamic-classes) function, and the optional
72
79
  static build). If you use either, `await initKbach()` once before your
73
80
  first render, same as before.
74
81
 
82
+ ## Use from a CDN (no build step)
83
+
84
+ For a plain HTML page with no npm, bundler or React, use
85
+ [`@kbach/browser`](https://www.npmjs.com/package/@kbach/browser) instead:
86
+ one `<script src="https://cdn.jsdelivr.net/npm/@kbach/browser"></script>`
87
+ tag and the same class names just work.
88
+
75
89
  ## React Router
76
90
 
77
91
  React Router is a client-side routing library with no build-tool coupling
@@ -308,3 +322,8 @@ correct across theme changes with zero re-render.
308
322
  ## License
309
323
 
310
324
  MIT
325
+
326
+ Tailwind CSS is a trademark of Tailwind Labs Inc. Kbach is an independent
327
+ project and is not affiliated with, sponsored by, or endorsed by Tailwind Labs.
328
+ See [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md) for the Tailwind CSS
329
+ license notice.
@@ -0,0 +1,41 @@
1
+ <!-- GENERATED from the repo root THIRD_PARTY_NOTICES.md by packages/core-engine/scripts/generate-notices.mjs. Edit the root file, then regenerate. -->
2
+
3
+ # Third-party notices
4
+
5
+ Kbach is MIT-licensed (see `LICENSE`). It also contains material from the
6
+ project below, used under that project's license.
7
+
8
+ ## Tailwind CSS
9
+
10
+ Kbach uses Tailwind CSS-compatible utility class names, and some of its
11
+ default theme values (for example the spacing formula and the shadow, radius,
12
+ blur, and line-height scales) are derived from Tailwind CSS.
13
+
14
+ Tailwind CSS is a trademark of Tailwind Labs Inc. Kbach is an independent
15
+ project and is not affiliated with, sponsored by, or endorsed by Tailwind Labs.
16
+
17
+ Source: https://github.com/tailwindlabs/tailwindcss
18
+
19
+ ```
20
+ MIT License
21
+
22
+ Copyright (c) Tailwind Labs, Inc.
23
+
24
+ Permission is hereby granted, free of charge, to any person obtaining a copy
25
+ of this software and associated documentation files (the "Software"), to deal
26
+ in the Software without restriction, including without limitation the rights
27
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
28
+ copies of the Software, and to permit persons to whom the Software is
29
+ furnished to do so, subject to the following conditions:
30
+
31
+ The above copyright notice and this permission notice shall be included in all
32
+ copies or substantial portions of the Software.
33
+
34
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
35
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
36
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
37
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
38
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
39
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
40
+ SOFTWARE.
41
+ ```
@@ -9,8 +9,11 @@ import init, { generate_css as wasmGenerateCss } from "@kbach/core-engine";
9
9
  var readyPromise = null;
10
10
  var ready = false;
11
11
  function initKbach() {
12
+ return initKbachFrom(void 0);
13
+ }
14
+ function initKbachFrom(wasmSource) {
12
15
  if (!readyPromise) {
13
- readyPromise = init().then(() => {
16
+ readyPromise = (wasmSource === void 0 ? init() : init({ module_or_path: wasmSource })).then(() => {
14
17
  ready = true;
15
18
  });
16
19
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  kb
3
- } from "./chunk-BJEOK2VK.mjs";
3
+ } from "./chunk-DJKDEDPE.mjs";
4
4
 
5
5
  // src/jsx-runtime.tsx
6
6
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
package/dist/index.js CHANGED
@@ -58,8 +58,11 @@ var import_core_engine = __toESM(require("@kbach/core-engine"));
58
58
  var readyPromise = null;
59
59
  var ready = false;
60
60
  function initKbach() {
61
+ return initKbachFrom(void 0);
62
+ }
63
+ function initKbachFrom(wasmSource) {
61
64
  if (!readyPromise) {
62
- readyPromise = (0, import_core_engine.default)().then(() => {
65
+ readyPromise = (wasmSource === void 0 ? (0, import_core_engine.default)() : (0, import_core_engine.default)({ module_or_path: wasmSource })).then(() => {
63
66
  ready = true;
64
67
  });
65
68
  }
package/dist/index.mjs CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  isKbachReady,
5
5
  isRuntimeCSSDisabled,
6
6
  kb
7
- } from "./chunk-BJEOK2VK.mjs";
7
+ } from "./chunk-DJKDEDPE.mjs";
8
8
  import {
9
9
  applyKbachConfig,
10
10
  ensureColorVariablesInjected,
@@ -2,8 +2,8 @@ import {
2
2
  Fragment,
3
3
  jsx,
4
4
  jsxs
5
- } from "./chunk-5EXGGZMA.mjs";
6
- import "./chunk-BJEOK2VK.mjs";
5
+ } from "./chunk-UP7MWEU5.mjs";
6
+ import "./chunk-DJKDEDPE.mjs";
7
7
  import "./chunk-OVKVZA7B.mjs";
8
8
 
9
9
  // src/jsx-dev-runtime.tsx
@@ -2,8 +2,8 @@ import {
2
2
  Fragment,
3
3
  jsx,
4
4
  jsxs
5
- } from "./chunk-5EXGGZMA.mjs";
6
- import "./chunk-BJEOK2VK.mjs";
5
+ } from "./chunk-UP7MWEU5.mjs";
6
+ import "./chunk-DJKDEDPE.mjs";
7
7
  import "./chunk-OVKVZA7B.mjs";
8
8
  export {
9
9
  Fragment,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kbach/react",
3
- "version": "1.0.0-beta.26",
4
- "description": "A utility-first styling engine for React, powered by a real Rust/WASM core — Tailwind CSS v4 feature parity with Kbach's own color palette.",
3
+ "version": "1.0.0-beta.27",
4
+ "description": "A utility-first styling engine for React, powered by a Rust/WASM core: Tailwind CSS-compatible utility class names with Kbach's own color palette.",
5
5
  "keywords": [
6
6
  "css",
7
7
  "react",
@@ -26,7 +26,8 @@
26
26
  },
27
27
  "files": [
28
28
  "dist",
29
- "AGENTS.md"
29
+ "AGENTS.md",
30
+ "THIRD_PARTY_NOTICES.md"
30
31
  ],
31
32
  "source": "./src/index.ts",
32
33
  "main": "./dist/index.js",
@@ -73,7 +74,7 @@
73
74
  "generate:colors": "node ../core-engine/scripts/generate-palette.mjs src/generatedPalette.ts"
74
75
  },
75
76
  "dependencies": {
76
- "@kbach/core-engine": "1.0.0-beta.14"
77
+ "@kbach/core-engine": "1.0.0-beta.16"
77
78
  },
78
79
  "devDependencies": {
79
80
  "@types/react": "^19.2.0",