@kbach/react-native 1.1.1-beta.1 → 1.1.1-beta.2

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
@@ -145,6 +145,16 @@ toggle, `active:(md:p-8)` didn't re-render on a width change, and
145
145
  (`hover:(a b)`, `dark:(a b)`) always worked. Fixed in 1.1.1-beta.1; see the
146
146
  "variant groups" tests in `jsx-runtime.test.ts`.
147
147
 
148
+ **Compose** (`kbach.config.js` top-level `compose`, root AGENTS.md §8.3):
149
+ `config.ts` puts it on the theme as `compose`; both engines expand a name
150
+ into its classes, placed BEFORE the element's own so those win a tie, as on
151
+ the web (Rust `compose.rs` on Android and Expo Web, `jsEngine/compose.ts` on
152
+ Expo Go / iOS; both held to `core-engine/tests/compose.json` by
153
+ `compose.test.ts`). `jsxRuntimeCore.ts`'s `flatClasses` expands groups and
154
+ compose names (cached per string, per theme object) before the reactivity
155
+ checks, or a name standing for `dark:`/`md:`/`hover:` classes would never
156
+ re-render or get its hover handlers.
157
+
148
158
  ## 4. Modifiers on native
149
159
 
150
160
  Native has no selector/cascade engine. Two groups:
package/README.md CHANGED
@@ -169,6 +169,24 @@ Write a variant once for several classes:
169
169
  and need no setup: every engine expands them before resolving. This is Kbach's
170
170
  own syntax, not Tailwind CSS's.
171
171
 
172
+ ## Compose: name a set of classes
173
+
174
+ Name a class list once in `kbach.config.js` and use the name:
175
+
176
+ ```js
177
+ module.exports = {
178
+ compose: {
179
+ btn: 'px-4 py-2 rounded-lg',
180
+ 'btn-primary': 'btn bg-blue-6 active:(bg-blue-7 opacity-90)',
181
+ },
182
+ };
183
+ ```
184
+
185
+ `<Pressable className="btn-primary md:px-8">`. A name works like any class,
186
+ with variants and `!`, and the element's own classes win over a name's
187
+ (`btn-primary px-8` gets `px-8`). Same config as `@kbach/react`, so one
188
+ `compose` serves the web and the app.
189
+
172
190
  ## What differs on native
173
191
 
174
192
  React Native has no CSS cascade, so a fixed subset of modifiers is
@@ -231,10 +249,15 @@ Kbach rules. Follow them in every class you write.
231
249
  steps of 4px (p-4 is 16px), variants such as hover:, md: and dark:,
232
250
  values in square brackets, a slash for opacity (bg-black/50).
233
251
  Gradients: bg-linear-to-r from-* via-* to-*.
252
+ Write a variant once for several classes: hover:(bg-blue-7 shadow-lg)
253
+ is hover:bg-blue-7 hover:shadow-lg. Groups nest: md:(p-8 hover:(p-10)).
234
254
  4. There is no tailwind.config.js, no @tailwind, no @import "tailwindcss",
235
255
  no @theme and no @apply. Settings go in kbach.config.js
236
- (export default { darkMode, theme, extend }). Custom animations go in
237
- extend.keyframes and extend.animation and are used as animate-<name>.
256
+ (export default { darkMode, theme, extend, compose }). Custom animations
257
+ go in extend.keyframes and extend.animation and are used as
258
+ animate-<name>. To reuse a set of classes, name it in compose:
259
+ { btn: 'px-4 py-2 rounded-lg hover:(bg-blue-7)' } and write className="btn"
260
+ (md:btn works too; the element's own classes win over btn's).
238
261
  5. Plain HTML page: put <script>window.kbachConfig = { ... }</script> BEFORE
239
262
  <script src="https://cdn.jsdelivr.net/npm/@kbach/browser"></script>.
240
263
  A theme button calls Kbach.toggle() and needs darkMode: 'class' or
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getTheme
3
- } from "./chunk-R7E5D3D6.mjs";
3
+ } from "./chunk-TCSCNQQ7.mjs";
4
4
 
5
5
  // src/darkModeStore.ts
6
6
  import { Appearance } from "react-native";