@kbach/react 0.6.30 → 0.6.31
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/dist/{chunk-FF4AZQIQ.mjs → chunk-MOWXWICC.mjs} +10 -8
- package/dist/{chunk-TKBIGAR2.mjs → chunk-OIJ6RP4F.mjs} +1369 -1297
- package/dist/core/index.d.ts +40 -3
- package/dist/core/index.js +1465 -1391
- package/dist/index.d.ts +1 -1
- package/dist/index.js +16 -11
- package/dist/index.mjs +18 -12
- package/dist/jsx-dev-runtime.js +8 -7
- package/dist/jsx-dev-runtime.mjs +2 -2
- package/dist/jsx-runtime.js +8 -7
- package/dist/jsx-runtime.mjs +2 -2
- package/dist/vite-plugin.d.mts +11 -2
- package/dist/vite-plugin.d.ts +11 -2
- package/dist/vite-plugin.js +80 -10
- package/dist/vite-plugin.mjs +80 -10
- package/kbach-react.md +23 -0
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
EMPTY_BREAKPOINTS,
|
|
4
4
|
InteractiveWrapper,
|
|
5
|
+
expandModeAwareColorClasses,
|
|
5
6
|
flatten,
|
|
6
7
|
getActiveBreakpoints,
|
|
7
8
|
getConfig,
|
|
@@ -24,7 +25,7 @@ import {
|
|
|
24
25
|
transformToWebProps,
|
|
25
26
|
useConditionalGlobalDarkMode,
|
|
26
27
|
useConditionalWidth
|
|
27
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-OIJ6RP4F.mjs";
|
|
28
29
|
|
|
29
30
|
// src/jsx-runtime.tsx
|
|
30
31
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -138,11 +139,13 @@ function processElement(type, rawProps, key, isStaticChildren) {
|
|
|
138
139
|
return makeElement(isStaticChildren, effectiveType, workingProps, key);
|
|
139
140
|
}
|
|
140
141
|
const classStr = classStrRaw;
|
|
141
|
-
|
|
142
|
+
const config = getConfig();
|
|
143
|
+
const expandedClassStr = classStr ? expandModeAwareColorClasses(classStr, config.theme.colors) : classStr;
|
|
144
|
+
if (!isNative && isRuntimeCSSDisabled() && expandedClassStr && !__kbachStyles) {
|
|
142
145
|
const { style: userStyle2, ...passProps2 } = omitConsumed(workingProps);
|
|
143
146
|
return makeElement(isStaticChildren, effectiveType, {
|
|
144
147
|
...passProps2,
|
|
145
|
-
className: normalizeClassString(
|
|
148
|
+
className: normalizeClassString(expandedClassStr),
|
|
146
149
|
...userStyle2 !== void 0 ? { style: userStyle2 } : {}
|
|
147
150
|
}, key);
|
|
148
151
|
}
|
|
@@ -162,8 +165,7 @@ function processElement(type, rawProps, key, isStaticChildren) {
|
|
|
162
165
|
const finalStyle2 = userStyle2 ? Array.isArray(userStyle2) ? { fontFamily: defaultFont, ...Object.assign({}, ...userStyle2) } : { fontFamily: defaultFont, ...userStyle2 } : { fontFamily: defaultFont };
|
|
163
166
|
return makeElement(isStaticChildren, effectiveType, { ...passProps2, style: finalStyle2 }, key);
|
|
164
167
|
}
|
|
165
|
-
const
|
|
166
|
-
const resolved = !isWeb && __kbachStyles != null ? __kbachStyles : classStr ? resolve(classStr, config.theme, config.darkMode) : {};
|
|
168
|
+
const resolved = !isWeb && __kbachStyles != null ? __kbachStyles : expandedClassStr ? resolve(expandedClassStr, config.theme, config.darkMode) : {};
|
|
167
169
|
const { style: rawUserStyle, ...passProps } = omitConsumed(workingProps);
|
|
168
170
|
const userStyle = withImpliedFlexIfNeeded(webTag, resolved.base, rawUserStyle);
|
|
169
171
|
const { interactive, modeOrResponsive } = bucketMods(resolved);
|
|
@@ -171,7 +173,7 @@ function processElement(type, rawProps, key, isStaticChildren) {
|
|
|
171
173
|
return _jsx(InteractiveWrapper, {
|
|
172
174
|
Component: effectiveType,
|
|
173
175
|
resolvedStyle: resolved,
|
|
174
|
-
...!isNative &&
|
|
176
|
+
...!isNative && expandedClassStr ? { className: normalizeClassString(expandedClassStr) } : {},
|
|
175
177
|
style: userStyle,
|
|
176
178
|
...passProps
|
|
177
179
|
}, key);
|
|
@@ -180,7 +182,7 @@ function processElement(type, rawProps, key, isStaticChildren) {
|
|
|
180
182
|
return _jsx(DarkWrapper, {
|
|
181
183
|
Component: effectiveType,
|
|
182
184
|
resolvedStyle: resolved,
|
|
183
|
-
...!isNative &&
|
|
185
|
+
...!isNative && expandedClassStr ? { className: normalizeClassString(expandedClassStr) } : {},
|
|
184
186
|
style: userStyle,
|
|
185
187
|
...passProps
|
|
186
188
|
}, key);
|
|
@@ -198,7 +200,7 @@ function processElement(type, rawProps, key, isStaticChildren) {
|
|
|
198
200
|
return makeElement(isStaticChildren, effectiveType, {
|
|
199
201
|
...passProps,
|
|
200
202
|
...finalStyle !== void 0 ? { style: finalStyle } : {},
|
|
201
|
-
...!isNative &&
|
|
203
|
+
...!isNative && expandedClassStr ? { className: normalizeClassString(expandedClassStr) } : {}
|
|
202
204
|
}, key);
|
|
203
205
|
}
|
|
204
206
|
function jsx(type, props, key) {
|