@kbach/react-native 1.0.0-beta.52 → 1.0.0-beta.54

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
@@ -14,7 +14,7 @@ and how the underlying engine is built, see the repo root's
14
14
  >
15
15
  > 1. Color shades are `1`–`12` (lightest→darkest), not Tailwind's
16
16
  > `50`–`950` — `bg-blue-500` resolves to nothing; the real class is
17
- > `bg-blue-6`. Full palette: root AGENTS.md §6.
17
+ > `bg-blue-6`. Full palette: root AGENTS.md §7.
18
18
  > 2. `group-*`, `peer-*`, `has-[…]`, container queries, grid, and pseudo-
19
19
  > elements (`before:`/`after:`) are real Tailwind syntax that PARSES
20
20
  > here but applies **zero style, with no warning** — native has no
@@ -189,6 +189,24 @@ also unavailable in Expo Go (no full-vocabulary resolver to check against).
189
189
  This is also exactly what iOS gets in every build type (§3) — the coverage
190
190
  gap isn't Expo-Go-specific, it's "whatever the JS-fallback engine covers."
191
191
 
192
+ Within that scope it must match the Rust native engine exactly.
193
+ `src/jsEngine/parity.test.ts` runs class strings through both (Rust via
194
+ `packages/core-engine/dist-node`, so core-engine must be built first) and
195
+ fails on any difference. Extend its `CASES` whenever a native-reaching
196
+ resolver changes in either engine; the 2026-11 Tailwind v4 pass (exact-px
197
+ border widths, `px`, two-axis `translate-*`/`skew-*`, `rotate-none`/
198
+ `scale-none`, `flex-N`, formula `leading-N`, `rounded-xs`/`rounded-4xl`)
199
+ and the Tailwind v4.3 values (`rounded-sm`, the `shadow-*` scale, outlines)
200
+ are covered there. See root AGENTS.md §8.1 for what's web-only by design.
201
+
202
+ **Rings (`ring-*`, `ring-offset-*`) apply no style on native**, on purpose:
203
+ they're a `var()`-built CSS `box-shadow`. Both engines also drop every CSS
204
+ custom property and `var()`-containing value before building the RN style
205
+ (it used to leak through as keys like `KbRingWidth`). Use `border-*` or
206
+ `shadow-*` for a native focus/selection outline. Text sizes on native set
207
+ `fontSize` only (no Tailwind default line-height); add `leading-*` for an
208
+ explicit native line height.
209
+
192
210
  ## 6. Dark mode
193
211
 
194
212
  Zero setup on all targets. On native `dark:` is resolved from a live
@@ -309,7 +327,7 @@ colors.get('brand'); // a custom color, typed as plain `string`
309
327
 
310
328
  `colors.blue[6]` returns the same value in both light and dark mode
311
329
  unless `blue-6` itself is defined in the theme as a `{ light, dark }` pair
312
- (§5.1 of the root AGENTS.md) — define a color as mode-aware in
330
+ (§6.1 of the root AGENTS.md) — define a color as mode-aware in
313
331
  `kbach.config.js` if you want it to differ by mode.
314
332
 
315
333
  `colors.brand` (a custom flat color) is typed `string | ColorScale`
@@ -346,10 +364,11 @@ and `react` at `projectRoot/node_modules/...`. A plain non-monorepo
346
364
  `setDynamicToken`, `getDynamicToken`, `deleteDynamicToken`,
347
365
  `subscribeDynamicTokens`, `useDynamicToken`, `clsx`, `getGlobalDarkMode`,
348
366
  `getGlobalThemeMode`, `setGlobalThemeMode`, `toggleGlobalDarkMode`,
349
- `subscribeGlobalDarkMode`. Types: `ThemeConfig`, `ColorEntry`,
350
- `ContainerConfig`, `StyleObject`, `KbachConfig`, `ThemeState`,
351
- `ThemeProviderProps`, `ThemeStorageAdapter`, `ThemeMode`, `ColorsAPI`,
352
- `ColorScale`, `ClassValue`.
367
+ `subscribeGlobalDarkMode`, `Button`, `Paragraph`, `H1`, `H2`, `H3`, `H4`,
368
+ `H5`, `H6` (§14). Types: `ThemeConfig`, `ColorEntry`, `ContainerConfig`,
369
+ `StyleObject`, `KbachConfig`, `ThemeState`, `ThemeProviderProps`,
370
+ `ThemeStorageAdapter`, `ThemeMode`, `ColorsAPI`, `ColorScale`,
371
+ `ClassValue`, `ButtonProps`, `ParagraphProps`, `HeadingProps`.
353
372
 
354
373
  Subpath exports: `@kbach/react-native/babel-plugin`,
355
374
  `@kbach/react-native/jsx-runtime`, `@kbach/react-native/jsx-dev-runtime`.
@@ -379,6 +398,19 @@ Subpath exports: `@kbach/react-native/babel-plugin`,
379
398
  missing. It's required on every target, not just Android/dev-client
380
399
  builds; without it nothing routes `className` through this package's
381
400
  jsx-runtime at all, so RN just silently ignores the unrecognized prop.
401
+ - **`useColors().get('yourCustomColor')` returns the literal name, not
402
+ the color, on Expo Web — icons/fills using it render invisible** —
403
+ stale `@kbach/react-native` (`< 1.0.0-beta.53`). Root cause: on web,
404
+ this package loads as two separate module instances in the same
405
+ bundle — a bare `import` resolves through package.json's `import`
406
+ condition, but the babel plugin's injected
407
+ `require('@kbach/react-native').applyKbachConfig(...)` always resolves
408
+ through `require` — so `kbach.config.js`'s custom colors landed in one
409
+ instance's theme state while every component's own `useColors()` read
410
+ the other, untouched one. Fixed by routing `theme.ts`'s active-theme
411
+ state through a `globalThis`-backed slot instead of a plain
412
+ module-scope variable, so both instances share it regardless of which
413
+ one set it. Update.
382
414
  - **`ERROR [Error: Unable to find node on an unmounted component.]` on
383
415
  Expo Fast Refresh, especially right after editing `kbach.config.js`** —
384
416
  stale `@kbach/react-native` (`< 1.0.0-beta.51`). Root cause: the babel
@@ -403,3 +435,43 @@ Subpath exports: `@kbach/react-native/babel-plugin`,
403
435
  Fixed identically in both the Rust native dispatcher and its Expo Go JS-
404
436
  fallback mirror (`jsEngine/resolveUtilityNative.ts`) in beta.52; update.
405
437
  Web (including Expo Web) was never affected.
438
+
439
+ ## 14. Semantic HTML on Expo Web
440
+
441
+ On Expo Web, `react-native-web` renders a bare `<View>`/`<Text>` as a
442
+ plain `<div>`/`<span>` by default — confirmed directly in its own source.
443
+ That's **not** a Kbach limitation: this package's jsx-runtime never reads
444
+ or substitutes the JSX element type at all, so whatever tag shows up is
445
+ exactly whatever component the app wrote.
446
+
447
+ `react-native-web` already has a real fix for this that this package
448
+ never gets in the way of: an `accessibilityRole`/`role` prop on ANY host
449
+ component makes it render the matching real HTML element instead —
450
+ `accessibilityRole="button"` → `<button>`, `accessibilityRole="header"` +
451
+ `aria-level` (web-only; real native has no heading-LEVEL concept, only
452
+ `header` itself) → `<h1>`-`<h6>`, `role="paragraph"` → `<p>`, and so on
453
+ (`react-native-web`'s own `propsToAccessibilityComponent`). `role` covers
454
+ every value in React Native's own typed `Role` union (`button`,
455
+ `heading`, `list`, `listitem`, `navigation`, `main`, `form`, `article`,
456
+ `banner`, `contentinfo`, `complementary`, `region`, ...); `"paragraph"`
457
+ is the one react-native-web additionally supports that isn't in that
458
+ union at all.
459
+
460
+ This package exports a handful of convenience components that are just
461
+ that prop, pre-set on the right underlying component — nothing beyond
462
+ that, and writing `<Pressable accessibilityRole="button">` directly
463
+ instead of `<Button>` behaves identically:
464
+
465
+ ```tsx
466
+ import { Button, Paragraph, H1, H2, H3, H4, H5, H6 } from '@kbach/react-native';
467
+
468
+ <Button className="px-4 py-2 rounded bg-blue-6" onPress={...}>Save</Button>
469
+ <H1 className="text-2xl font-bold">Page title</H1>
470
+ <Paragraph className="text-sm text-gray-7">Body copy.</Paragraph>
471
+ ```
472
+
473
+ `className` keeps working on every one of these exactly like it does on
474
+ a bare `Pressable`/`Text`. No `Div` or `Input` here on purpose: a plain
475
+ `<View>` already is the right generic container, and `<TextInput>`
476
+ already renders a real `<input>` (or `<textarea>` when `multiline`) by
477
+ default, with no role needed at all.
package/README.md CHANGED
@@ -145,6 +145,22 @@ colors.blue['6/50']; // same at 50% opacity
145
145
  colors.get('brand'); // a custom color, typed as plain `string`
146
146
  ```
147
147
 
148
+ ## Semantic HTML on web
149
+
150
+ On Expo Web, `<View>`/`<Text>` render as a plain `<div>`/`<span>` by
151
+ default (`react-native-web`'s own choice, not this package's). For a real
152
+ `<button>`/`<h1>`-`<h6>`/`<p>` instead, use these — each is just the
153
+ right underlying component with its semantic role pre-set, so `className`
154
+ keeps working exactly like it does on a bare `Pressable`/`Text`:
155
+
156
+ ```tsx
157
+ import { Button, H1, Paragraph } from '@kbach/react-native';
158
+
159
+ <H1 className="text-2xl font-bold">Page title</H1>
160
+ <Paragraph className="text-sm text-gray-7">Body copy.</Paragraph>
161
+ <Button className="px-4 py-2 rounded bg-blue-6" onPress={...}>Save</Button>
162
+ ```
163
+
148
164
  ## What differs on native
149
165
 
150
166
  React Native has no CSS cascade, so a fixed subset of modifiers is
@@ -191,3 +207,8 @@ for `kbach.config.js` and how the underlying engine is built.
191
207
  ## License
192
208
 
193
209
  MIT
210
+
211
+ Tailwind CSS is a trademark of Tailwind Labs Inc. Kbach is an independent
212
+ project and is not affiliated with, sponsored by, or endorsed by Tailwind Labs.
213
+ See [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md) for the Tailwind CSS
214
+ 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
+ ```