@kbach/react 0.5.38 → 0.5.41
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 +173 -98
- package/dist/{chunk-EJFQKJPT.mjs → chunk-AAPA3CRV.mjs} +40 -59
- package/dist/{chunk-W7UBSRE5.mjs → chunk-GOQNOKFN.mjs} +19 -12
- package/dist/{chunk-NWVL4BES.mjs → chunk-VCNP57PR.mjs} +408 -1019
- package/dist/index.d.mts +10 -20
- package/dist/index.d.ts +10 -20
- package/dist/index.js +443 -1051
- package/dist/index.mjs +40 -22
- package/dist/jsx-dev-runtime.d.mts +6 -4
- package/dist/jsx-dev-runtime.d.ts +6 -4
- package/dist/jsx-dev-runtime.js +445 -1078
- package/dist/jsx-dev-runtime.mjs +10 -5
- package/dist/jsx-runtime.d.mts +2 -3
- package/dist/jsx-runtime.d.ts +2 -3
- package/dist/jsx-runtime.js +443 -1076
- package/dist/jsx-runtime.mjs +5 -3
- package/dist/types-D-24rbXu.d.mts +126 -0
- package/dist/types-D-24rbXu.d.ts +126 -0
- package/dist/vite-plugin.d.mts +1 -1
- package/dist/vite-plugin.d.ts +1 -1
- package/dist/vite-plugin.js +303 -842
- package/dist/vite-plugin.mjs +76 -25
- package/package.json +4 -2
- package/types.d.ts +1 -0
- package/dist/types-CV5vXnSH.d.mts +0 -70
- package/dist/types-CV5vXnSH.d.ts +0 -70
|
@@ -2,9 +2,11 @@ import {
|
|
|
2
2
|
flatten,
|
|
3
3
|
getActiveBreakpoints,
|
|
4
4
|
getGlobalWidth,
|
|
5
|
+
getResponsiveModifiers,
|
|
6
|
+
isNative,
|
|
5
7
|
isWeb,
|
|
6
8
|
subscribeGlobalWidth
|
|
7
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-VCNP57PR.mjs";
|
|
8
10
|
|
|
9
11
|
// src/core/darkModeStore.ts
|
|
10
12
|
var KEY = "__kbach_dark_store__";
|
|
@@ -107,23 +109,26 @@ function useConditionalWidth(active) {
|
|
|
107
109
|
);
|
|
108
110
|
}
|
|
109
111
|
|
|
110
|
-
// src/
|
|
111
|
-
function chain(original, extra) {
|
|
112
|
-
return (...args) => {
|
|
113
|
-
original?.(...args);
|
|
114
|
-
extra();
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
var RESPONSIVE_MODS = /* @__PURE__ */ new Set(["sm", "md", "lg", "xl", "2xl"]);
|
|
112
|
+
// src/shared-utils.ts
|
|
118
113
|
function hasResponsiveBuckets(resolved) {
|
|
114
|
+
const responsiveMods = getResponsiveModifiers();
|
|
119
115
|
for (const key of Object.keys(resolved)) {
|
|
120
116
|
if (key === "base") continue;
|
|
121
117
|
for (const mod of key.split(":")) {
|
|
122
|
-
if (
|
|
118
|
+
if (responsiveMods.has(mod)) return true;
|
|
123
119
|
}
|
|
124
120
|
}
|
|
125
121
|
return false;
|
|
126
122
|
}
|
|
123
|
+
var EMPTY_BREAKPOINTS2 = /* @__PURE__ */ new Set();
|
|
124
|
+
|
|
125
|
+
// src/InteractiveWrapper.tsx
|
|
126
|
+
function chain(original, extra) {
|
|
127
|
+
return (...args) => {
|
|
128
|
+
original?.(...args);
|
|
129
|
+
extra();
|
|
130
|
+
};
|
|
131
|
+
}
|
|
127
132
|
var InteractiveWrapper = forwardRef(
|
|
128
133
|
function InteractiveWrapper2({
|
|
129
134
|
Component,
|
|
@@ -199,10 +204,10 @@ var InteractiveWrapper = forwardRef(
|
|
|
199
204
|
ref,
|
|
200
205
|
...restWithoutChildren,
|
|
201
206
|
style: finalStyle,
|
|
202
|
-
|
|
207
|
+
...!isNative && className ? { className } : {},
|
|
203
208
|
// onPressIn / onPressOut are React Native-only.
|
|
204
209
|
// On web, onPointerDown/Up drive the pressed state instead (covers mouse + touch).
|
|
205
|
-
|
|
210
|
+
...!isNative ? { onPointerDown: handlePointerDown, onPointerUp: handlePointerUp, onPointerLeave: handlePointerLeave } : { onPressIn: handlePressIn, onPressOut: handlePressOut },
|
|
206
211
|
onMouseEnter: handleMouseEnter,
|
|
207
212
|
onMouseLeave: handleMouseLeave,
|
|
208
213
|
onFocus: handleFocus,
|
|
@@ -219,6 +224,8 @@ export {
|
|
|
219
224
|
EMPTY_BREAKPOINTS,
|
|
220
225
|
useGlobalWidth,
|
|
221
226
|
useConditionalWidth,
|
|
227
|
+
hasResponsiveBuckets,
|
|
228
|
+
EMPTY_BREAKPOINTS2,
|
|
222
229
|
useGlobalDarkMode,
|
|
223
230
|
InteractiveWrapper
|
|
224
231
|
};
|