@kbach/react-native 1.0.0-beta.20 → 1.0.0-beta.21

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 CHANGED
@@ -58,9 +58,10 @@ way, no extra config.
58
58
  ### Expo Web
59
59
 
60
60
  Works out of the box — resolves through the same real-CSS engine
61
- `@kbach/react` uses on the DOM, with full modifier support (`hover:`,
62
- `focus:`, `group-hover:`, container queries, etc.), not just the
63
- `dark:`/`active:`/responsive subset native supports.
61
+ `@kbach/react` uses on the DOM, with the FULL modifier set (`group-hover:`,
62
+ `peer-hover:`, container queries, `has-[...]:`, etc.) — everything real
63
+ Tailwind supports. Native supports a smaller, explicitly-scoped subset; see
64
+ "Modifiers on native" below for exactly what that covers.
64
65
 
65
66
  **Static rendering (SSR) caveat:** `dark:`/responsive classes on content
66
67
  that's part of the initial pre-rendered HTML resolve against the *server*,
@@ -124,6 +125,38 @@ module.exports = config; // (React Native CLI: mergeConfig(getDefaultConfig(proj
124
125
  A single, non-monorepo `npm install` never hits this — only relevant if your
125
126
  app and `@kbach/react-native` share a workspace root.
126
127
 
128
+ ## Modifiers on native
129
+
130
+ Native has no CSS selector/cascade engine, so only a fixed, explicitly
131
+ supported set of modifiers actually applies — everything else (`group-*:`,
132
+ `peer-*:`, `has-[...]:`, `aria-*:`, `data-*:`, container queries, ...)
133
+ parses without error but never takes effect. Supported today:
134
+
135
+ - **`dark:`** — reacts to the OS/app color scheme, see "Dark mode" below.
136
+ - **`sm:`/`md:`/`lg:`/`xl:`/`2xl:`** — reacts to `useWindowDimensions()`
137
+ crossing the matching `theme.screens` breakpoint (rotation/resize/fold).
138
+ - **`active:`** — `Pressable`'s own press state, via its style-callback API.
139
+ - **`hover:`** — tracked via `onHoverIn`/`onHoverOut`, which RN only ever
140
+ fires on a platform with real pointer input (iOS 13+/Android/macOS/
141
+ Windows via a mouse/trackpad/Apple Pencil hover) — inert (never fires) on
142
+ a touch-only device, the same way real Tailwind's `hover:` already
143
+ degrades on a touch-only *browser*. Composing it onto any host type is
144
+ harmless even where it never fires.
145
+ - **`focus:`** — tracked via `onFocus`/`onBlur` (keyboard/external-keyboard/
146
+ TV-remote/tab navigation, and `TextInput` focus).
147
+ - **`disabled:`** — reads the element's own `disabled` prop directly; no
148
+ event tracking needed, since a prop change already re-renders normally.
149
+ - Any combination of the above chained on one class (`sm:dark:bg-blue-8`,
150
+ `hover:focus:opacity-100`) requires every named condition to hold at once
151
+ — chain order never matters (`dark:sm:` and `sm:dark:` are equivalent).
152
+
153
+ `group-hover:`/`peer-hover:` and friends are NOT implemented on native —
154
+ doing so needs a React Context bridge (propagating an ancestor's hover/
155
+ press/focus state down to descendants, since there's no `.group`/`.peer`
156
+ selector relationship to lean on) that doesn't exist today. If you need
157
+ group/peer-style coordination on native right now, lift the shared state
158
+ into a parent component yourself and pass it down as an explicit prop.
159
+
127
160
  ## Dark mode
128
161
 
129
162
  ```tsx
@@ -264,8 +297,8 @@ On web, `setDynamicToken` writes the real CSS custom property to the DOM —
264
297
  every element using it repaints instantly via the browser's own CSS engine,
265
298
  no React re-render involved. On native, the className is substituted with
266
299
  the token's current value before every resolve, and an element referencing
267
- a token re-renders/repaints on its own when that specific token changes
268
- (same `key`-remount mechanism `dark:` and `sm:`/`md:`/... already use — see
300
+ a token re-renders/repaints on its own when that token changes (same
301
+ subscription mechanism `dark:` and `sm:`/`md:`/... already use — see
269
302
  `jsxRuntimeCore.ts`'s own doc comments). An unregistered token name falls
270
303
  through to the same native invalid-value warning above.
271
304