@kbach/react 0.6.10 → 0.6.11

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.
@@ -3694,19 +3694,24 @@ var InteractiveWrapper = forwardRef(
3694
3694
  ...checked !== void 0 ? { checked } : {},
3695
3695
  style: finalStyle,
3696
3696
  ...!isNative && className ? { className } : {},
3697
- // On web, onPointerDown/Up drive the wrapper's own pressed state (covers mouse + touch),
3698
- // and onPressIn/onPressOut are ALSO forwarded — but only when Component is an actual
3699
- // component (react-native-web components accept both prop names), never when it's a
3700
- // literal HTML tag string ('div', 'a', …). React DOM warns "Unknown event handler
3701
- // property" for onPressIn/onPressOut on a host element even when the value is
3702
- // undefined — the check is on the prop KEY being present at all, not its value — so
3703
- // the key must be omitted entirely for string components, not just set to undefined.
3697
+ // On web, onPointerDown/Up drive the wrapper's own pressed state (covers mouse + touch) —
3698
+ // onPressIn/onPressOut are RN-only prop names and are never forwarded here, even when
3699
+ // Component isn't a literal HTML tag string. A non-string Component on web is just as
3700
+ // likely to be an ordinary web component (React Router's <Link>, Next.js's <Link>, any
3701
+ // custom wrapper) as an actual react-native-web primitive — "not a string" alone was never
3702
+ // a reliable signal that onPressIn/onPressOut are wanted, and forwarding them
3703
+ // unconditionally made React DOM warn "Unknown event handler property" the moment any web
3704
+ // component got an interactive modifier (hover:, active:, …), which is the common case,
3705
+ // not the exception. (A real react-native-web primitive would additionally have this pair
3706
+ // of props silently vanish after hydration anyway, once the browser-only web-substitution
3707
+ // in jsx-runtime.tsx swaps it for a plain host tag — so keeping them pre-hydration would
3708
+ // only have traded one prop-mismatch warning for another.) Genuinely native code paths
3709
+ // still get them via the isNative branch below.
3704
3710
  ...!isNative ? {
3705
3711
  onPointerDown: handlePointerDown,
3706
3712
  onPointerUp: handlePointerUp,
3707
3713
  onPointerLeave: handlePointerLeave,
3708
- onPointerCancel: handlePointerCancel,
3709
- ...typeof Component !== "string" ? { onPressIn, onPressOut } : {}
3714
+ onPointerCancel: handlePointerCancel
3710
3715
  } : { onPressIn: handlePressIn, onPressOut: handlePressOut },
3711
3716
  onMouseEnter: handleMouseEnter,
3712
3717
  onMouseLeave: handleMouseLeave,
@@ -23,7 +23,7 @@ import {
23
23
  transformToWebProps,
24
24
  useConditionalWidth,
25
25
  useGlobalDarkMode
26
- } from "./chunk-CJRRPENF.mjs";
26
+ } from "./chunk-OWJUMH2V.mjs";
27
27
 
28
28
  // src/jsx-runtime.tsx
29
29
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
package/dist/index.js CHANGED
@@ -3988,25 +3988,28 @@ function styled(Component, baseClasses = "") {
3988
3988
  ...isWeb && combined ? { className: normalizeClassString(combined) } : {},
3989
3989
  // Only attach state-tracking handlers when interactive modifiers are present.
3990
3990
  // Always forward user-provided handlers to avoid silently swallowing them.
3991
- // onPressIn/onPressOut are forwarded on web too (not just native) since
3992
- // react-native-web components rely on receiving them directly — but only
3993
- // when effectiveComponent is an actual component, never a literal HTML tag
3994
- // string ('div', 'a', …). React DOM warns "Unknown event handler property"
3995
- // for onPressIn/onPressOut on a host element even when the value is
3996
- // undefined — the check is on the prop KEY being present at all, not its
3997
- // value — so the key must be omitted entirely for string components.
3998
- ...isWeb ? hasInteractive ? {
3991
+ // Gated on isNative, not isWeb: isWeb is false during SSR too (no `window` there),
3992
+ // and onPressIn/onPressOut must stay excluded there as well — SSR is exactly where
3993
+ // getWebTag() above is skipped (it's isWeb-gated), so effectiveComponent may still be
3994
+ // a non-string RN-style reference server-side, and this used to forward onPressIn/
3995
+ // onPressOut to it unconditionally in that case (isWeb ? ... : ...'s false branch
3996
+ // covered both native AND SSR). onPressIn/onPressOut are RN-only prop names — a
3997
+ // non-string effectiveComponent on the web/SSR side is just as likely to be an
3998
+ // ordinary web component (React Router's <Link>, Next.js's <Link>, any custom
3999
+ // wrapper) as an actual react-native-web primitive, and "not a string" alone isn't a
4000
+ // reliable signal either way. Forwarding them made React DOM warn "Unknown event
4001
+ // handler property" the moment any such component got an interactive modifier
4002
+ // (hover:, active:, …), which is the common case, not the exception.
4003
+ ...!isNative ? hasInteractive ? {
3999
4004
  onPointerDown: handlePointerDown,
4000
4005
  onPointerUp: handlePointerUp,
4001
4006
  onPointerLeave: handlePointerLeave,
4002
- onPointerCancel: handlePointerCancel,
4003
- ...typeof effectiveComponent !== "string" ? { onPressIn, onPressOut } : {}
4007
+ onPointerCancel: handlePointerCancel
4004
4008
  } : {
4005
4009
  onPointerDown,
4006
4010
  onPointerUp,
4007
4011
  onPointerLeave,
4008
- onPointerCancel,
4009
- ...typeof effectiveComponent !== "string" ? { onPressIn, onPressOut } : {}
4012
+ onPointerCancel
4010
4013
  } : hasInteractive ? { onPressIn: handlePressIn, onPressOut: handlePressOut } : { onPressIn, onPressOut },
4011
4014
  onMouseEnter: hasInteractive ? handleMouseEnter : onMouseEnter,
4012
4015
  onMouseLeave: hasInteractive ? handleMouseLeave : onMouseLeave,
@@ -4127,19 +4130,24 @@ var InteractiveWrapper = (0, import_react8.forwardRef)(
4127
4130
  ...checked !== void 0 ? { checked } : {},
4128
4131
  style: finalStyle,
4129
4132
  ...!isNative && className ? { className } : {},
4130
- // On web, onPointerDown/Up drive the wrapper's own pressed state (covers mouse + touch),
4131
- // and onPressIn/onPressOut are ALSO forwarded — but only when Component is an actual
4132
- // component (react-native-web components accept both prop names), never when it's a
4133
- // literal HTML tag string ('div', 'a', …). React DOM warns "Unknown event handler
4134
- // property" for onPressIn/onPressOut on a host element even when the value is
4135
- // undefined — the check is on the prop KEY being present at all, not its value — so
4136
- // the key must be omitted entirely for string components, not just set to undefined.
4133
+ // On web, onPointerDown/Up drive the wrapper's own pressed state (covers mouse + touch) —
4134
+ // onPressIn/onPressOut are RN-only prop names and are never forwarded here, even when
4135
+ // Component isn't a literal HTML tag string. A non-string Component on web is just as
4136
+ // likely to be an ordinary web component (React Router's <Link>, Next.js's <Link>, any
4137
+ // custom wrapper) as an actual react-native-web primitive — "not a string" alone was never
4138
+ // a reliable signal that onPressIn/onPressOut are wanted, and forwarding them
4139
+ // unconditionally made React DOM warn "Unknown event handler property" the moment any web
4140
+ // component got an interactive modifier (hover:, active:, …), which is the common case,
4141
+ // not the exception. (A real react-native-web primitive would additionally have this pair
4142
+ // of props silently vanish after hydration anyway, once the browser-only web-substitution
4143
+ // in jsx-runtime.tsx swaps it for a plain host tag — so keeping them pre-hydration would
4144
+ // only have traded one prop-mismatch warning for another.) Genuinely native code paths
4145
+ // still get them via the isNative branch below.
4137
4146
  ...!isNative ? {
4138
4147
  onPointerDown: handlePointerDown,
4139
4148
  onPointerUp: handlePointerUp,
4140
4149
  onPointerLeave: handlePointerLeave,
4141
- onPointerCancel: handlePointerCancel,
4142
- ...typeof Component !== "string" ? { onPressIn, onPressOut } : {}
4150
+ onPointerCancel: handlePointerCancel
4143
4151
  } : { onPressIn: handlePressIn, onPressOut: handlePressOut },
4144
4152
  onMouseEnter: handleMouseEnter,
4145
4153
  onMouseLeave: handleMouseLeave,
package/dist/index.mjs CHANGED
@@ -39,7 +39,7 @@ import {
39
39
  useGlobalDarkMode,
40
40
  useGlobalWidth,
41
41
  useSyncExternalStore
42
- } from "./chunk-CJRRPENF.mjs";
42
+ } from "./chunk-OWJUMH2V.mjs";
43
43
 
44
44
  // src/context.tsx
45
45
  import { createContext, useContext } from "react";
@@ -339,25 +339,28 @@ function styled(Component, baseClasses = "") {
339
339
  ...isWeb && combined ? { className: normalizeClassString(combined) } : {},
340
340
  // Only attach state-tracking handlers when interactive modifiers are present.
341
341
  // Always forward user-provided handlers to avoid silently swallowing them.
342
- // onPressIn/onPressOut are forwarded on web too (not just native) since
343
- // react-native-web components rely on receiving them directly — but only
344
- // when effectiveComponent is an actual component, never a literal HTML tag
345
- // string ('div', 'a', …). React DOM warns "Unknown event handler property"
346
- // for onPressIn/onPressOut on a host element even when the value is
347
- // undefined — the check is on the prop KEY being present at all, not its
348
- // value — so the key must be omitted entirely for string components.
349
- ...isWeb ? hasInteractive ? {
342
+ // Gated on isNative, not isWeb: isWeb is false during SSR too (no `window` there),
343
+ // and onPressIn/onPressOut must stay excluded there as well — SSR is exactly where
344
+ // getWebTag() above is skipped (it's isWeb-gated), so effectiveComponent may still be
345
+ // a non-string RN-style reference server-side, and this used to forward onPressIn/
346
+ // onPressOut to it unconditionally in that case (isWeb ? ... : ...'s false branch
347
+ // covered both native AND SSR). onPressIn/onPressOut are RN-only prop names — a
348
+ // non-string effectiveComponent on the web/SSR side is just as likely to be an
349
+ // ordinary web component (React Router's <Link>, Next.js's <Link>, any custom
350
+ // wrapper) as an actual react-native-web primitive, and "not a string" alone isn't a
351
+ // reliable signal either way. Forwarding them made React DOM warn "Unknown event
352
+ // handler property" the moment any such component got an interactive modifier
353
+ // (hover:, active:, …), which is the common case, not the exception.
354
+ ...!isNative ? hasInteractive ? {
350
355
  onPointerDown: handlePointerDown,
351
356
  onPointerUp: handlePointerUp,
352
357
  onPointerLeave: handlePointerLeave,
353
- onPointerCancel: handlePointerCancel,
354
- ...typeof effectiveComponent !== "string" ? { onPressIn, onPressOut } : {}
358
+ onPointerCancel: handlePointerCancel
355
359
  } : {
356
360
  onPointerDown,
357
361
  onPointerUp,
358
362
  onPointerLeave,
359
- onPointerCancel,
360
- ...typeof effectiveComponent !== "string" ? { onPressIn, onPressOut } : {}
363
+ onPointerCancel
361
364
  } : hasInteractive ? { onPressIn: handlePressIn, onPressOut: handlePressOut } : { onPressIn, onPressOut },
362
365
  onMouseEnter: hasInteractive ? handleMouseEnter : onMouseEnter,
363
366
  onMouseLeave: hasInteractive ? handleMouseLeave : onMouseLeave,
@@ -3391,19 +3391,24 @@ var InteractiveWrapper = (0, import_react2.forwardRef)(
3391
3391
  ...checked !== void 0 ? { checked } : {},
3392
3392
  style: finalStyle,
3393
3393
  ...!isNative && className ? { className } : {},
3394
- // On web, onPointerDown/Up drive the wrapper's own pressed state (covers mouse + touch),
3395
- // and onPressIn/onPressOut are ALSO forwarded — but only when Component is an actual
3396
- // component (react-native-web components accept both prop names), never when it's a
3397
- // literal HTML tag string ('div', 'a', …). React DOM warns "Unknown event handler
3398
- // property" for onPressIn/onPressOut on a host element even when the value is
3399
- // undefined — the check is on the prop KEY being present at all, not its value — so
3400
- // the key must be omitted entirely for string components, not just set to undefined.
3394
+ // On web, onPointerDown/Up drive the wrapper's own pressed state (covers mouse + touch) —
3395
+ // onPressIn/onPressOut are RN-only prop names and are never forwarded here, even when
3396
+ // Component isn't a literal HTML tag string. A non-string Component on web is just as
3397
+ // likely to be an ordinary web component (React Router's <Link>, Next.js's <Link>, any
3398
+ // custom wrapper) as an actual react-native-web primitive — "not a string" alone was never
3399
+ // a reliable signal that onPressIn/onPressOut are wanted, and forwarding them
3400
+ // unconditionally made React DOM warn "Unknown event handler property" the moment any web
3401
+ // component got an interactive modifier (hover:, active:, …), which is the common case,
3402
+ // not the exception. (A real react-native-web primitive would additionally have this pair
3403
+ // of props silently vanish after hydration anyway, once the browser-only web-substitution
3404
+ // in jsx-runtime.tsx swaps it for a plain host tag — so keeping them pre-hydration would
3405
+ // only have traded one prop-mismatch warning for another.) Genuinely native code paths
3406
+ // still get them via the isNative branch below.
3401
3407
  ...!isNative ? {
3402
3408
  onPointerDown: handlePointerDown,
3403
3409
  onPointerUp: handlePointerUp,
3404
3410
  onPointerLeave: handlePointerLeave,
3405
- onPointerCancel: handlePointerCancel,
3406
- ...typeof Component !== "string" ? { onPressIn, onPressOut } : {}
3411
+ onPointerCancel: handlePointerCancel
3407
3412
  } : { onPressIn: handlePressIn, onPressOut: handlePressOut },
3408
3413
  onMouseEnter: handleMouseEnter,
3409
3414
  onMouseLeave: handleMouseLeave,
@@ -3,8 +3,8 @@ import {
3
3
  Fragment,
4
4
  jsx,
5
5
  jsxs
6
- } from "./chunk-RWQKYQWN.mjs";
7
- import "./chunk-CJRRPENF.mjs";
6
+ } from "./chunk-Z5SUFJ53.mjs";
7
+ import "./chunk-OWJUMH2V.mjs";
8
8
 
9
9
  // src/jsx-dev-runtime.tsx
10
10
  function jsxDEV(type, props, key, isStaticChildren, source, self) {
@@ -3392,19 +3392,24 @@ var InteractiveWrapper = (0, import_react2.forwardRef)(
3392
3392
  ...checked !== void 0 ? { checked } : {},
3393
3393
  style: finalStyle,
3394
3394
  ...!isNative && className ? { className } : {},
3395
- // On web, onPointerDown/Up drive the wrapper's own pressed state (covers mouse + touch),
3396
- // and onPressIn/onPressOut are ALSO forwarded — but only when Component is an actual
3397
- // component (react-native-web components accept both prop names), never when it's a
3398
- // literal HTML tag string ('div', 'a', …). React DOM warns "Unknown event handler
3399
- // property" for onPressIn/onPressOut on a host element even when the value is
3400
- // undefined — the check is on the prop KEY being present at all, not its value — so
3401
- // the key must be omitted entirely for string components, not just set to undefined.
3395
+ // On web, onPointerDown/Up drive the wrapper's own pressed state (covers mouse + touch) —
3396
+ // onPressIn/onPressOut are RN-only prop names and are never forwarded here, even when
3397
+ // Component isn't a literal HTML tag string. A non-string Component on web is just as
3398
+ // likely to be an ordinary web component (React Router's <Link>, Next.js's <Link>, any
3399
+ // custom wrapper) as an actual react-native-web primitive — "not a string" alone was never
3400
+ // a reliable signal that onPressIn/onPressOut are wanted, and forwarding them
3401
+ // unconditionally made React DOM warn "Unknown event handler property" the moment any web
3402
+ // component got an interactive modifier (hover:, active:, …), which is the common case,
3403
+ // not the exception. (A real react-native-web primitive would additionally have this pair
3404
+ // of props silently vanish after hydration anyway, once the browser-only web-substitution
3405
+ // in jsx-runtime.tsx swaps it for a plain host tag — so keeping them pre-hydration would
3406
+ // only have traded one prop-mismatch warning for another.) Genuinely native code paths
3407
+ // still get them via the isNative branch below.
3402
3408
  ...!isNative ? {
3403
3409
  onPointerDown: handlePointerDown,
3404
3410
  onPointerUp: handlePointerUp,
3405
3411
  onPointerLeave: handlePointerLeave,
3406
- onPointerCancel: handlePointerCancel,
3407
- ...typeof Component !== "string" ? { onPressIn, onPressOut } : {}
3412
+ onPointerCancel: handlePointerCancel
3408
3413
  } : { onPressIn: handlePressIn, onPressOut: handlePressOut },
3409
3414
  onMouseEnter: handleMouseEnter,
3410
3415
  onMouseLeave: handleMouseLeave,
@@ -4,10 +4,10 @@ import {
4
4
  _invalidateDefaultFontCache,
5
5
  jsx,
6
6
  jsxs
7
- } from "./chunk-RWQKYQWN.mjs";
7
+ } from "./chunk-Z5SUFJ53.mjs";
8
8
  import {
9
9
  registerWebElement
10
- } from "./chunk-CJRRPENF.mjs";
10
+ } from "./chunk-OWJUMH2V.mjs";
11
11
  export {
12
12
  Fragment,
13
13
  _invalidateDefaultFontCache,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kbach/react",
3
- "version": "0.6.10",
3
+ "version": "0.6.11",
4
4
  "description": "React / React Native components and hooks for the Kbach framework",
5
5
  "source": "./src/index.ts",
6
6
  "main": "./dist/index.js",