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

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
@@ -124,6 +124,27 @@ engines does the work, chosen automatically:
124
124
  Resolution is memoized per `(classString, pressed, colorScheme, width,
125
125
  theme)`.
126
126
 
127
+ **Variant groups (1.1.1-beta.0):** `className="flex active:(bg-blue-6 opacity-50)"`
128
+ resolves as `active:bg-blue-6 active:opacity-50`, with no build step: every
129
+ engine expands groups before resolving (Rust's `groups.rs` on Android and Expo
130
+ Web; `src/jsEngine/groups.ts` on Expo Go / iOS, a port held to the same cases
131
+ as the Rust one by `groups.test.ts`, which reads
132
+ `core-engine/tests/variant-groups.json`; `jsEngine/parity.test.ts` compares the
133
+ two engines on grouped strings, light and dark, pressed or not). Root
134
+ AGENTS.md §8.2 has the syntax.
135
+
136
+ The JSX runtime (`jsxRuntimeCore.ts`'s `processElement`) also expands a group
137
+ before it reads the class string, since its reactivity checks
138
+ (`DARK_MODIFIER_RE`, `BREAKPOINT_MODIFIER_RE`, `HOVER_`/`FOCUS_MODIFIER_RE`,
139
+ `usesModeAwareColor`) only look for a variant after a space or a `:`. The
140
+ `className` prop passed on to a custom component stays as written. In
141
+ 1.1.1-beta.0, where only the engines expanded groups, a variant written first
142
+ inside a group was missed: `active:(dark:bg-x)` didn't re-render on a theme
143
+ toggle, `active:(md:p-8)` didn't re-render on a width change, and
144
+ `active:(hover:x)` got no hover handlers. A group with its variant outside
145
+ (`hover:(a b)`, `dark:(a b)`) always worked. Fixed in 1.1.1-beta.1; see the
146
+ "variant groups" tests in `jsx-runtime.test.ts`.
147
+
127
148
  ## 4. Modifiers on native
128
149
 
129
150
  Native has no selector/cascade engine. Two groups:
package/README.md CHANGED
@@ -161,6 +161,14 @@ import { Button, H1, Paragraph } from '@kbach/react-native';
161
161
  <Button className="px-4 py-2 rounded bg-blue-6" onPress={...}>Save</Button>
162
162
  ```
163
163
 
164
+ ## Variant groups
165
+
166
+ Write a variant once for several classes:
167
+ `className="flex active:(bg-blue-6 opacity-50)"` is
168
+ `active:bg-blue-6 active:opacity-50`. Groups nest (`dark:(p-4 active:p-2)`)
169
+ and need no setup: every engine expands them before resolving. This is Kbach's
170
+ own syntax, not Tailwind CSS's.
171
+
164
172
  ## What differs on native
165
173
 
166
174
  React Native has no CSS cascade, so a fixed subset of modifiers is
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveClassName
3
- } from "./chunk-MUPEQJRT.mjs";
3
+ } from "./chunk-R7E5D3D6.mjs";
4
4
 
5
5
  // src/jsxRuntimeCoreWeb.ts
6
6
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getTheme
3
- } from "./chunk-MUPEQJRT.mjs";
3
+ } from "./chunk-R7E5D3D6.mjs";
4
4
 
5
5
  // src/darkModeStore.ts
6
6
  import { Appearance } from "react-native";