@kbach/react 0.5.62 → 0.6.1
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 +51 -9
- package/dist/{chunk-5MX3E4OL.mjs → chunk-36QRQNPL.mjs} +77 -73
- package/dist/{chunk-MZKQ7H67.mjs → chunk-6ZORO3BP.mjs} +6 -64
- package/dist/{chunk-BRCQK5DA.mjs → chunk-MPHPB357.mjs} +143 -170
- package/dist/index.d.mts +12 -29
- package/dist/index.d.ts +12 -29
- package/dist/index.js +344 -536
- package/dist/index.mjs +62 -231
- package/dist/jsx-dev-runtime.js +204 -289
- package/dist/jsx-dev-runtime.mjs +4 -4
- package/dist/jsx-runtime.js +203 -288
- package/dist/jsx-runtime.mjs +3 -3
- package/dist/vite-plugin.js +139 -163
- package/dist/vite-plugin.mjs +3 -2
- package/kbach-react.md +14 -8
- package/package.json +1 -1
package/dist/jsx-dev-runtime.js
CHANGED
|
@@ -30,14 +30,14 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/jsx-dev-runtime.tsx
|
|
31
31
|
var jsx_dev_runtime_exports = {};
|
|
32
32
|
__export(jsx_dev_runtime_exports, {
|
|
33
|
-
Fragment: () =>
|
|
33
|
+
Fragment: () => import_react4.Fragment,
|
|
34
34
|
jsxDEV: () => jsxDEV
|
|
35
35
|
});
|
|
36
36
|
module.exports = __toCommonJS(jsx_dev_runtime_exports);
|
|
37
37
|
|
|
38
38
|
// src/jsx-runtime.tsx
|
|
39
39
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
40
|
-
var
|
|
40
|
+
var import_react4 = require("react");
|
|
41
41
|
|
|
42
42
|
// src/core/theme.ts
|
|
43
43
|
var defaultColors = {
|
|
@@ -581,10 +581,11 @@ var defaultTheme = {
|
|
|
581
581
|
|
|
582
582
|
// src/core/cache.ts
|
|
583
583
|
var LRUCache = class {
|
|
584
|
-
constructor(capacity = 1e4) {
|
|
584
|
+
constructor(capacity = 1e4, onEvict) {
|
|
585
585
|
this.capacity = capacity;
|
|
586
586
|
if (capacity <= 0) throw new Error("LRUCache: capacity must be a positive integer");
|
|
587
587
|
this.cache = /* @__PURE__ */ new Map();
|
|
588
|
+
this.onEvict = onEvict;
|
|
588
589
|
}
|
|
589
590
|
get(key) {
|
|
590
591
|
if (!this.cache.has(key)) return void 0;
|
|
@@ -597,7 +598,10 @@ var LRUCache = class {
|
|
|
597
598
|
if (this.cache.has(key)) {
|
|
598
599
|
this.cache.delete(key);
|
|
599
600
|
} else if (this.cache.size >= this.capacity) {
|
|
600
|
-
this.cache.
|
|
601
|
+
const oldestKey = this.cache.keys().next().value;
|
|
602
|
+
const oldestValue = this.cache.get(oldestKey);
|
|
603
|
+
this.cache.delete(oldestKey);
|
|
604
|
+
this.onEvict?.(oldestKey, oldestValue);
|
|
601
605
|
}
|
|
602
606
|
this.cache.set(key, value);
|
|
603
607
|
return this;
|
|
@@ -619,9 +623,10 @@ var LRUCache = class {
|
|
|
619
623
|
// src/core/platform.ts
|
|
620
624
|
var isWeb = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
|
|
621
625
|
var isNative = !isWeb && (typeof globalThis.HermesInternal !== "undefined" || typeof globalThis.__fbBatchedBridge !== "undefined" || typeof navigator !== "undefined" && navigator.product === "ReactNative" || typeof globalThis.__REACT_NATIVE__ !== "undefined");
|
|
622
|
-
var
|
|
626
|
+
var _resolveTargetOverride = null;
|
|
623
627
|
function getEffectiveIsWeb() {
|
|
624
|
-
|
|
628
|
+
if (_resolveTargetOverride) return _resolveTargetOverride === "web";
|
|
629
|
+
return isWeb || !isNative;
|
|
625
630
|
}
|
|
626
631
|
function toNativeValue(raw) {
|
|
627
632
|
if (/^-?\d+(\.\d+)?px$/.test(raw)) return parseFloat(raw);
|
|
@@ -808,18 +813,28 @@ function resolveColor(value, colors, isArbitrary) {
|
|
|
808
813
|
if (isNaN(alpha)) return hex;
|
|
809
814
|
return hexToRgba(hex, alpha);
|
|
810
815
|
}
|
|
811
|
-
function
|
|
816
|
+
function parseHexRgb(hex) {
|
|
812
817
|
const h = hex.replace("#", "");
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
r = parseInt(h.slice(0, 2), 16);
|
|
820
|
-
g = parseInt(h.slice(2, 4), 16);
|
|
821
|
-
b = parseInt(h.slice(4, 6), 16);
|
|
818
|
+
if (h.length === 3 || h.length === 4) {
|
|
819
|
+
return [
|
|
820
|
+
parseInt(h[0] + h[0], 16),
|
|
821
|
+
parseInt(h[1] + h[1], 16),
|
|
822
|
+
parseInt(h[2] + h[2], 16)
|
|
823
|
+
];
|
|
822
824
|
}
|
|
825
|
+
if (h.length === 6 || h.length === 8) {
|
|
826
|
+
return [
|
|
827
|
+
parseInt(h.slice(0, 2), 16),
|
|
828
|
+
parseInt(h.slice(2, 4), 16),
|
|
829
|
+
parseInt(h.slice(4, 6), 16)
|
|
830
|
+
];
|
|
831
|
+
}
|
|
832
|
+
return null;
|
|
833
|
+
}
|
|
834
|
+
function hexToRgba(hex, alpha) {
|
|
835
|
+
const rgb = parseHexRgb(hex);
|
|
836
|
+
if (!rgb) return hex;
|
|
837
|
+
const [r, g, b] = rgb;
|
|
823
838
|
return `rgba(${r},${g},${b},${alpha})`;
|
|
824
839
|
}
|
|
825
840
|
function resolveSpacing(value, negative, spacing, isArbitrary) {
|
|
@@ -863,8 +878,8 @@ function resolveFontSize(value, fontSizes, isArbitrary) {
|
|
|
863
878
|
if (isArbitrary) return getEffectiveIsWeb() ? value : toNativeValue(value);
|
|
864
879
|
return fontSizes[value] ?? null;
|
|
865
880
|
}
|
|
866
|
-
var FILTER_COMPOSE = "var(--
|
|
867
|
-
var BACKDROP_FILTER_COMPOSE = "var(--
|
|
881
|
+
var FILTER_COMPOSE = "var(--kb-blur,) var(--kb-brightness,) var(--kb-contrast,) var(--kb-grayscale,) var(--kb-hue-rotate,) var(--kb-invert,) var(--kb-saturate,) var(--kb-sepia,) var(--kb-drop-shadow,)";
|
|
882
|
+
var BACKDROP_FILTER_COMPOSE = "var(--kb-backdrop-blur,) var(--kb-backdrop-brightness,) var(--kb-backdrop-contrast,) var(--kb-backdrop-grayscale,) var(--kb-backdrop-hue-rotate,) var(--kb-backdrop-invert,) var(--kb-backdrop-opacity,) var(--kb-backdrop-saturate,) var(--kb-backdrop-sepia,)";
|
|
868
883
|
var _standalone = null;
|
|
869
884
|
function buildStandalone() {
|
|
870
885
|
const web = getEffectiveIsWeb();
|
|
@@ -1126,9 +1141,9 @@ function buildStandalone() {
|
|
|
1126
1141
|
"backface-visible": { backfaceVisibility: "visible" },
|
|
1127
1142
|
"backface-hidden": { backfaceVisibility: "hidden" },
|
|
1128
1143
|
// CSS filters — standalone = default/full effect (web-only)
|
|
1129
|
-
grayscale: web ? { "--
|
|
1130
|
-
invert: web ? { "--
|
|
1131
|
-
sepia: web ? { "--
|
|
1144
|
+
grayscale: web ? { "--kb-grayscale": "grayscale(100%)", filter: FILTER_COMPOSE } : null,
|
|
1145
|
+
invert: web ? { "--kb-invert": "invert(100%)", filter: FILTER_COMPOSE } : null,
|
|
1146
|
+
sepia: web ? { "--kb-sepia": "sepia(100%)", filter: FILTER_COMPOSE } : null,
|
|
1132
1147
|
// Divide none
|
|
1133
1148
|
"divide-none": web ? { __divideX: 0, __divideY: 0 } : null,
|
|
1134
1149
|
// Group / peer markers (no-op: no style emitted; just ensures isKnownUtility returns true)
|
|
@@ -1213,6 +1228,48 @@ function getStandalone() {
|
|
|
1213
1228
|
if (!_standalone) _standalone = buildStandalone();
|
|
1214
1229
|
return _standalone;
|
|
1215
1230
|
}
|
|
1231
|
+
function makeSpacingResolver(prop) {
|
|
1232
|
+
return ({ value, negative, isArbitrary }, { spacing }) => {
|
|
1233
|
+
const v = resolveSpacing(value, negative, spacing, isArbitrary);
|
|
1234
|
+
return v !== null ? { [prop]: v } : null;
|
|
1235
|
+
};
|
|
1236
|
+
}
|
|
1237
|
+
var PADDING_MARGIN_PROPS = {
|
|
1238
|
+
p: "padding",
|
|
1239
|
+
px: "paddingHorizontal",
|
|
1240
|
+
py: "paddingVertical",
|
|
1241
|
+
pt: "paddingTop",
|
|
1242
|
+
pr: "paddingRight",
|
|
1243
|
+
pb: "paddingBottom",
|
|
1244
|
+
pl: "paddingLeft",
|
|
1245
|
+
m: "margin",
|
|
1246
|
+
mx: "marginHorizontal",
|
|
1247
|
+
my: "marginVertical",
|
|
1248
|
+
mt: "marginTop",
|
|
1249
|
+
mr: "marginRight",
|
|
1250
|
+
mb: "marginBottom",
|
|
1251
|
+
ml: "marginLeft"
|
|
1252
|
+
};
|
|
1253
|
+
function makeBorderSideResolver(widthProp, colorProp) {
|
|
1254
|
+
return ({ value, isArbitrary }, { colors, borderWidth }) => {
|
|
1255
|
+
if (!value) return { [widthProp]: 1 };
|
|
1256
|
+
if (isArbitrary) {
|
|
1257
|
+
const w2 = toNativeValue(value);
|
|
1258
|
+
if (typeof w2 === "number") return { [widthProp]: w2 };
|
|
1259
|
+
return { [colorProp]: value };
|
|
1260
|
+
}
|
|
1261
|
+
const color = resolveColor(value, colors, false);
|
|
1262
|
+
if (color) return { [colorProp]: color };
|
|
1263
|
+
const w = borderWidth[value];
|
|
1264
|
+
return w !== void 0 ? { [widthProp]: w } : null;
|
|
1265
|
+
};
|
|
1266
|
+
}
|
|
1267
|
+
var BORDER_SIDE_PROPS = {
|
|
1268
|
+
"border-t": ["borderTopWidth", "borderTopColor"],
|
|
1269
|
+
"border-r": ["borderRightWidth", "borderRightColor"],
|
|
1270
|
+
"border-b": ["borderBottomWidth", "borderBottomColor"],
|
|
1271
|
+
"border-l": ["borderLeftWidth", "borderLeftColor"]
|
|
1272
|
+
};
|
|
1216
1273
|
var RESOLVERS = {
|
|
1217
1274
|
// ── Background ─────────────────────────────────────────────────────────────
|
|
1218
1275
|
bg: ({ value, isArbitrary }, { colors }) => {
|
|
@@ -1246,64 +1303,8 @@ var RESOLVERS = {
|
|
|
1246
1303
|
const v = isArbitrary ? n > 1 ? n / 100 : n : n / 100;
|
|
1247
1304
|
return { "--text-opacity": v };
|
|
1248
1305
|
},
|
|
1249
|
-
// ── Padding
|
|
1250
|
-
|
|
1251
|
-
const v = resolveSpacing(value, negative, spacing, isArbitrary);
|
|
1252
|
-
return v !== null ? { padding: v } : null;
|
|
1253
|
-
},
|
|
1254
|
-
px: ({ value, negative, isArbitrary }, { spacing }) => {
|
|
1255
|
-
const v = resolveSpacing(value, negative, spacing, isArbitrary);
|
|
1256
|
-
return v !== null ? { paddingHorizontal: v } : null;
|
|
1257
|
-
},
|
|
1258
|
-
py: ({ value, negative, isArbitrary }, { spacing }) => {
|
|
1259
|
-
const v = resolveSpacing(value, negative, spacing, isArbitrary);
|
|
1260
|
-
return v !== null ? { paddingVertical: v } : null;
|
|
1261
|
-
},
|
|
1262
|
-
pt: ({ value, negative, isArbitrary }, { spacing }) => {
|
|
1263
|
-
const v = resolveSpacing(value, negative, spacing, isArbitrary);
|
|
1264
|
-
return v !== null ? { paddingTop: v } : null;
|
|
1265
|
-
},
|
|
1266
|
-
pr: ({ value, negative, isArbitrary }, { spacing }) => {
|
|
1267
|
-
const v = resolveSpacing(value, negative, spacing, isArbitrary);
|
|
1268
|
-
return v !== null ? { paddingRight: v } : null;
|
|
1269
|
-
},
|
|
1270
|
-
pb: ({ value, negative, isArbitrary }, { spacing }) => {
|
|
1271
|
-
const v = resolveSpacing(value, negative, spacing, isArbitrary);
|
|
1272
|
-
return v !== null ? { paddingBottom: v } : null;
|
|
1273
|
-
},
|
|
1274
|
-
pl: ({ value, negative, isArbitrary }, { spacing }) => {
|
|
1275
|
-
const v = resolveSpacing(value, negative, spacing, isArbitrary);
|
|
1276
|
-
return v !== null ? { paddingLeft: v } : null;
|
|
1277
|
-
},
|
|
1278
|
-
// ── Margin ─────────────────────────────────────────────────────────────────
|
|
1279
|
-
m: ({ value, negative, isArbitrary }, { spacing }) => {
|
|
1280
|
-
const v = resolveSpacing(value, negative, spacing, isArbitrary);
|
|
1281
|
-
return v !== null ? { margin: v } : null;
|
|
1282
|
-
},
|
|
1283
|
-
mx: ({ value, negative, isArbitrary }, { spacing }) => {
|
|
1284
|
-
const v = resolveSpacing(value, negative, spacing, isArbitrary);
|
|
1285
|
-
return v !== null ? { marginHorizontal: v } : null;
|
|
1286
|
-
},
|
|
1287
|
-
my: ({ value, negative, isArbitrary }, { spacing }) => {
|
|
1288
|
-
const v = resolveSpacing(value, negative, spacing, isArbitrary);
|
|
1289
|
-
return v !== null ? { marginVertical: v } : null;
|
|
1290
|
-
},
|
|
1291
|
-
mt: ({ value, negative, isArbitrary }, { spacing }) => {
|
|
1292
|
-
const v = resolveSpacing(value, negative, spacing, isArbitrary);
|
|
1293
|
-
return v !== null ? { marginTop: v } : null;
|
|
1294
|
-
},
|
|
1295
|
-
mr: ({ value, negative, isArbitrary }, { spacing }) => {
|
|
1296
|
-
const v = resolveSpacing(value, negative, spacing, isArbitrary);
|
|
1297
|
-
return v !== null ? { marginRight: v } : null;
|
|
1298
|
-
},
|
|
1299
|
-
mb: ({ value, negative, isArbitrary }, { spacing }) => {
|
|
1300
|
-
const v = resolveSpacing(value, negative, spacing, isArbitrary);
|
|
1301
|
-
return v !== null ? { marginBottom: v } : null;
|
|
1302
|
-
},
|
|
1303
|
-
ml: ({ value, negative, isArbitrary }, { spacing }) => {
|
|
1304
|
-
const v = resolveSpacing(value, negative, spacing, isArbitrary);
|
|
1305
|
-
return v !== null ? { marginLeft: v } : null;
|
|
1306
|
-
},
|
|
1306
|
+
// ── Padding & margin ───────────────────────────────────────────────────────
|
|
1307
|
+
// Generated below via makeSpacingResolver() — see PADDING_MARGIN_PROPS.
|
|
1307
1308
|
// ── Sizing ─────────────────────────────────────────────────────────────────
|
|
1308
1309
|
w: ({ value, isArbitrary }, { spacing }) => {
|
|
1309
1310
|
const v = resolveSizing(value, spacing, isArbitrary);
|
|
@@ -1347,54 +1348,7 @@ var RESOLVERS = {
|
|
|
1347
1348
|
}
|
|
1348
1349
|
return null;
|
|
1349
1350
|
},
|
|
1350
|
-
|
|
1351
|
-
if (!value) return { borderTopWidth: 1 };
|
|
1352
|
-
if (isArbitrary) {
|
|
1353
|
-
const w2 = toNativeValue(value);
|
|
1354
|
-
if (typeof w2 === "number") return { borderTopWidth: w2 };
|
|
1355
|
-
return { borderTopColor: value };
|
|
1356
|
-
}
|
|
1357
|
-
const color = resolveColor(value, colors, false);
|
|
1358
|
-
if (color) return { borderTopColor: color };
|
|
1359
|
-
const w = borderWidth[value];
|
|
1360
|
-
return w !== void 0 ? { borderTopWidth: w } : null;
|
|
1361
|
-
},
|
|
1362
|
-
"border-r": ({ value, isArbitrary }, { colors, borderWidth }) => {
|
|
1363
|
-
if (!value) return { borderRightWidth: 1 };
|
|
1364
|
-
if (isArbitrary) {
|
|
1365
|
-
const w2 = toNativeValue(value);
|
|
1366
|
-
if (typeof w2 === "number") return { borderRightWidth: w2 };
|
|
1367
|
-
return { borderRightColor: value };
|
|
1368
|
-
}
|
|
1369
|
-
const color = resolveColor(value, colors, false);
|
|
1370
|
-
if (color) return { borderRightColor: color };
|
|
1371
|
-
const w = borderWidth[value];
|
|
1372
|
-
return w !== void 0 ? { borderRightWidth: w } : null;
|
|
1373
|
-
},
|
|
1374
|
-
"border-b": ({ value, isArbitrary }, { colors, borderWidth }) => {
|
|
1375
|
-
if (!value) return { borderBottomWidth: 1 };
|
|
1376
|
-
if (isArbitrary) {
|
|
1377
|
-
const w2 = toNativeValue(value);
|
|
1378
|
-
if (typeof w2 === "number") return { borderBottomWidth: w2 };
|
|
1379
|
-
return { borderBottomColor: value };
|
|
1380
|
-
}
|
|
1381
|
-
const color = resolveColor(value, colors, false);
|
|
1382
|
-
if (color) return { borderBottomColor: color };
|
|
1383
|
-
const w = borderWidth[value];
|
|
1384
|
-
return w !== void 0 ? { borderBottomWidth: w } : null;
|
|
1385
|
-
},
|
|
1386
|
-
"border-l": ({ value, isArbitrary }, { colors, borderWidth }) => {
|
|
1387
|
-
if (!value) return { borderLeftWidth: 1 };
|
|
1388
|
-
if (isArbitrary) {
|
|
1389
|
-
const w2 = toNativeValue(value);
|
|
1390
|
-
if (typeof w2 === "number") return { borderLeftWidth: w2 };
|
|
1391
|
-
return { borderLeftColor: value };
|
|
1392
|
-
}
|
|
1393
|
-
const color = resolveColor(value, colors, false);
|
|
1394
|
-
if (color) return { borderLeftColor: color };
|
|
1395
|
-
const w = borderWidth[value];
|
|
1396
|
-
return w !== void 0 ? { borderLeftWidth: w } : null;
|
|
1397
|
-
},
|
|
1351
|
+
// border-t/-r/-b/-l generated below via makeBorderSideResolver() — see BORDER_SIDE_PROPS.
|
|
1398
1352
|
// ── Border radius ──────────────────────────────────────────────────────────
|
|
1399
1353
|
rounded: ({ value, isArbitrary }, { borderRadius }) => {
|
|
1400
1354
|
const r = resolveRadius(value, borderRadius, isArbitrary);
|
|
@@ -1626,49 +1580,49 @@ var RESOLVERS = {
|
|
|
1626
1580
|
"2xl": "blur(40px)",
|
|
1627
1581
|
"3xl": "blur(64px)"
|
|
1628
1582
|
};
|
|
1629
|
-
if (value === "none") return { "--
|
|
1583
|
+
if (value === "none") return { "--kb-blur": "", filter: FILTER_COMPOSE };
|
|
1630
1584
|
const v = isArbitrary ? `blur(${value})` : sizes[value];
|
|
1631
|
-
return v !== void 0 ? { "--
|
|
1585
|
+
return v !== void 0 ? { "--kb-blur": v, filter: FILTER_COMPOSE } : null;
|
|
1632
1586
|
},
|
|
1633
1587
|
brightness: ({ value, isArbitrary }) => {
|
|
1634
1588
|
if (!getEffectiveIsWeb()) return null;
|
|
1635
1589
|
const v = isArbitrary ? `brightness(${value})` : `brightness(${parseFloat(value) / 100})`;
|
|
1636
|
-
return isNaN(parseFloat(value)) && !isArbitrary ? null : { "--
|
|
1590
|
+
return isNaN(parseFloat(value)) && !isArbitrary ? null : { "--kb-brightness": v, filter: FILTER_COMPOSE };
|
|
1637
1591
|
},
|
|
1638
1592
|
contrast: ({ value, isArbitrary }) => {
|
|
1639
1593
|
if (!getEffectiveIsWeb()) return null;
|
|
1640
1594
|
const v = isArbitrary ? `contrast(${value})` : `contrast(${parseFloat(value) / 100})`;
|
|
1641
|
-
return isNaN(parseFloat(value)) && !isArbitrary ? null : { "--
|
|
1595
|
+
return isNaN(parseFloat(value)) && !isArbitrary ? null : { "--kb-contrast": v, filter: FILTER_COMPOSE };
|
|
1642
1596
|
},
|
|
1643
1597
|
grayscale: ({ value }) => {
|
|
1644
1598
|
if (!getEffectiveIsWeb()) return null;
|
|
1645
1599
|
const v = value === "0" ? "grayscale(0)" : "grayscale(100%)";
|
|
1646
|
-
return { "--
|
|
1600
|
+
return { "--kb-grayscale": v, filter: FILTER_COMPOSE };
|
|
1647
1601
|
},
|
|
1648
1602
|
"hue-rotate": ({ value, negative, isArbitrary }) => {
|
|
1649
1603
|
if (!getEffectiveIsWeb()) return null;
|
|
1650
1604
|
const deg = isArbitrary ? value : `${(negative ? -1 : 1) * parseFloat(value)}deg`;
|
|
1651
1605
|
if (isNaN(parseFloat(deg)) && !isArbitrary) return null;
|
|
1652
|
-
return { "--
|
|
1606
|
+
return { "--kb-hue-rotate": `hue-rotate(${deg})`, filter: FILTER_COMPOSE };
|
|
1653
1607
|
},
|
|
1654
1608
|
invert: ({ value }) => {
|
|
1655
1609
|
if (!getEffectiveIsWeb()) return null;
|
|
1656
1610
|
const v = value === "0" ? "invert(0)" : "invert(100%)";
|
|
1657
|
-
return { "--
|
|
1611
|
+
return { "--kb-invert": v, filter: FILTER_COMPOSE };
|
|
1658
1612
|
},
|
|
1659
1613
|
saturate: ({ value, isArbitrary }) => {
|
|
1660
1614
|
if (!getEffectiveIsWeb()) return null;
|
|
1661
1615
|
const v = isArbitrary ? `saturate(${value})` : `saturate(${parseFloat(value) / 100})`;
|
|
1662
|
-
return isNaN(parseFloat(value)) && !isArbitrary ? null : { "--
|
|
1616
|
+
return isNaN(parseFloat(value)) && !isArbitrary ? null : { "--kb-saturate": v, filter: FILTER_COMPOSE };
|
|
1663
1617
|
},
|
|
1664
1618
|
sepia: ({ value }) => {
|
|
1665
1619
|
if (!getEffectiveIsWeb()) return null;
|
|
1666
1620
|
const v = value === "0" ? "sepia(0)" : "sepia(100%)";
|
|
1667
|
-
return { "--
|
|
1621
|
+
return { "--kb-sepia": v, filter: FILTER_COMPOSE };
|
|
1668
1622
|
},
|
|
1669
1623
|
"drop-shadow": ({ value, isArbitrary }) => {
|
|
1670
1624
|
if (!getEffectiveIsWeb()) return null;
|
|
1671
|
-
if (isArbitrary) return { "--
|
|
1625
|
+
if (isArbitrary) return { "--kb-drop-shadow": `drop-shadow(${value.replace(/_/g, " ")})`, filter: FILTER_COMPOSE };
|
|
1672
1626
|
const presets = {
|
|
1673
1627
|
"": "drop-shadow(0 1px 2px rgb(0 0 0/0.1)) drop-shadow(0 1px 1px rgb(0 0 0/0.06))",
|
|
1674
1628
|
sm: "drop-shadow(0 1px 1px rgb(0 0 0/0.05))",
|
|
@@ -1679,7 +1633,7 @@ var RESOLVERS = {
|
|
|
1679
1633
|
none: "drop-shadow(0 0 #0000)"
|
|
1680
1634
|
};
|
|
1681
1635
|
const v = presets[value];
|
|
1682
|
-
return v !== void 0 ? { "--
|
|
1636
|
+
return v !== void 0 ? { "--kb-drop-shadow": v, filter: FILTER_COMPOSE } : null;
|
|
1683
1637
|
},
|
|
1684
1638
|
// Arbitrary full filter string: filter-[blur(4px)_grayscale(1)]
|
|
1685
1639
|
filter: ({ value, isArbitrary }) => {
|
|
@@ -1700,47 +1654,47 @@ var RESOLVERS = {
|
|
|
1700
1654
|
"2xl": "blur(40px)",
|
|
1701
1655
|
"3xl": "blur(64px)"
|
|
1702
1656
|
};
|
|
1703
|
-
if (value === "none") return { "--
|
|
1657
|
+
if (value === "none") return { "--kb-backdrop-blur": "", backdropFilter: BACKDROP_FILTER_COMPOSE };
|
|
1704
1658
|
const v = isArbitrary ? `blur(${value})` : sizes[value];
|
|
1705
|
-
return v !== void 0 ? { "--
|
|
1659
|
+
return v !== void 0 ? { "--kb-backdrop-blur": v, backdropFilter: BACKDROP_FILTER_COMPOSE } : null;
|
|
1706
1660
|
},
|
|
1707
1661
|
"backdrop-brightness": ({ value, isArbitrary }) => {
|
|
1708
1662
|
if (!getEffectiveIsWeb()) return null;
|
|
1709
1663
|
const v = isArbitrary ? `brightness(${value})` : `brightness(${parseFloat(value) / 100})`;
|
|
1710
|
-
return isNaN(parseFloat(value)) && !isArbitrary ? null : { "--
|
|
1664
|
+
return isNaN(parseFloat(value)) && !isArbitrary ? null : { "--kb-backdrop-brightness": v, backdropFilter: BACKDROP_FILTER_COMPOSE };
|
|
1711
1665
|
},
|
|
1712
1666
|
"backdrop-contrast": ({ value, isArbitrary }) => {
|
|
1713
1667
|
if (!getEffectiveIsWeb()) return null;
|
|
1714
1668
|
const v = isArbitrary ? `contrast(${value})` : `contrast(${parseFloat(value) / 100})`;
|
|
1715
|
-
return isNaN(parseFloat(value)) && !isArbitrary ? null : { "--
|
|
1669
|
+
return isNaN(parseFloat(value)) && !isArbitrary ? null : { "--kb-backdrop-contrast": v, backdropFilter: BACKDROP_FILTER_COMPOSE };
|
|
1716
1670
|
},
|
|
1717
1671
|
"backdrop-grayscale": ({ value }) => {
|
|
1718
1672
|
if (!getEffectiveIsWeb()) return null;
|
|
1719
|
-
return { "--
|
|
1673
|
+
return { "--kb-backdrop-grayscale": value === "0" ? "grayscale(0)" : "grayscale(100%)", backdropFilter: BACKDROP_FILTER_COMPOSE };
|
|
1720
1674
|
},
|
|
1721
1675
|
"backdrop-hue-rotate": ({ value, negative, isArbitrary }) => {
|
|
1722
1676
|
if (!getEffectiveIsWeb()) return null;
|
|
1723
1677
|
const deg = isArbitrary ? value : `${(negative ? -1 : 1) * parseFloat(value)}deg`;
|
|
1724
1678
|
if (isNaN(parseFloat(deg)) && !isArbitrary) return null;
|
|
1725
|
-
return { "--
|
|
1679
|
+
return { "--kb-backdrop-hue-rotate": `hue-rotate(${deg})`, backdropFilter: BACKDROP_FILTER_COMPOSE };
|
|
1726
1680
|
},
|
|
1727
1681
|
"backdrop-invert": ({ value }) => {
|
|
1728
1682
|
if (!getEffectiveIsWeb()) return null;
|
|
1729
|
-
return { "--
|
|
1683
|
+
return { "--kb-backdrop-invert": value === "0" ? "invert(0)" : "invert(100%)", backdropFilter: BACKDROP_FILTER_COMPOSE };
|
|
1730
1684
|
},
|
|
1731
1685
|
"backdrop-opacity": ({ value, isArbitrary }) => {
|
|
1732
1686
|
if (!getEffectiveIsWeb()) return null;
|
|
1733
1687
|
const v = isArbitrary ? `opacity(${value})` : `opacity(${parseFloat(value) / 100})`;
|
|
1734
|
-
return isNaN(parseFloat(value)) && !isArbitrary ? null : { "--
|
|
1688
|
+
return isNaN(parseFloat(value)) && !isArbitrary ? null : { "--kb-backdrop-opacity": v, backdropFilter: BACKDROP_FILTER_COMPOSE };
|
|
1735
1689
|
},
|
|
1736
1690
|
"backdrop-saturate": ({ value, isArbitrary }) => {
|
|
1737
1691
|
if (!getEffectiveIsWeb()) return null;
|
|
1738
1692
|
const v = isArbitrary ? `saturate(${value})` : `saturate(${parseFloat(value) / 100})`;
|
|
1739
|
-
return isNaN(parseFloat(value)) && !isArbitrary ? null : { "--
|
|
1693
|
+
return isNaN(parseFloat(value)) && !isArbitrary ? null : { "--kb-backdrop-saturate": v, backdropFilter: BACKDROP_FILTER_COMPOSE };
|
|
1740
1694
|
},
|
|
1741
1695
|
"backdrop-sepia": ({ value }) => {
|
|
1742
1696
|
if (!getEffectiveIsWeb()) return null;
|
|
1743
|
-
return { "--
|
|
1697
|
+
return { "--kb-backdrop-sepia": value === "0" ? "sepia(0)" : "sepia(100%)", backdropFilter: BACKDROP_FILTER_COMPOSE };
|
|
1744
1698
|
},
|
|
1745
1699
|
"backdrop-filter": ({ value, isArbitrary }) => {
|
|
1746
1700
|
if (!getEffectiveIsWeb()) return null;
|
|
@@ -1764,7 +1718,7 @@ var RESOLVERS = {
|
|
|
1764
1718
|
const dir = directions[value];
|
|
1765
1719
|
if (!dir) return null;
|
|
1766
1720
|
return {
|
|
1767
|
-
backgroundImage: `linear-gradient(${dir}, var(--
|
|
1721
|
+
backgroundImage: `linear-gradient(${dir}, var(--kb-gradient-from, transparent), var(--kb-gradient-stops, transparent))`
|
|
1768
1722
|
};
|
|
1769
1723
|
},
|
|
1770
1724
|
from: ({ value, isArbitrary }, { colors }) => {
|
|
@@ -1772,8 +1726,8 @@ var RESOLVERS = {
|
|
|
1772
1726
|
const color = resolveColor(value, colors, isArbitrary);
|
|
1773
1727
|
if (!color) return null;
|
|
1774
1728
|
return {
|
|
1775
|
-
"--
|
|
1776
|
-
"--
|
|
1729
|
+
"--kb-gradient-from": color,
|
|
1730
|
+
"--kb-gradient-stops": `var(--kb-gradient-from), var(--kb-gradient-to, transparent)`
|
|
1777
1731
|
};
|
|
1778
1732
|
},
|
|
1779
1733
|
via: ({ value, isArbitrary }, { colors }) => {
|
|
@@ -1781,15 +1735,15 @@ var RESOLVERS = {
|
|
|
1781
1735
|
const color = resolveColor(value, colors, isArbitrary);
|
|
1782
1736
|
if (!color) return null;
|
|
1783
1737
|
return {
|
|
1784
|
-
"--
|
|
1785
|
-
"--
|
|
1738
|
+
"--kb-gradient-via": color,
|
|
1739
|
+
"--kb-gradient-stops": `var(--kb-gradient-from), var(--kb-gradient-via), var(--kb-gradient-to, transparent)`
|
|
1786
1740
|
};
|
|
1787
1741
|
},
|
|
1788
1742
|
to: ({ value, isArbitrary }, { colors }) => {
|
|
1789
1743
|
if (!getEffectiveIsWeb()) return null;
|
|
1790
1744
|
const color = resolveColor(value, colors, isArbitrary);
|
|
1791
1745
|
if (!color) return null;
|
|
1792
|
-
return { "--
|
|
1746
|
+
return { "--kb-gradient-to": color };
|
|
1793
1747
|
},
|
|
1794
1748
|
// ── Transform extras (web-only) ───────────────────────────────────────────
|
|
1795
1749
|
"skew-x": ({ value, negative, isArbitrary }) => {
|
|
@@ -2393,6 +2347,12 @@ var RESOLVERS = {
|
|
|
2393
2347
|
return { rowGap: v };
|
|
2394
2348
|
}
|
|
2395
2349
|
};
|
|
2350
|
+
for (const [utility, prop] of Object.entries(PADDING_MARGIN_PROPS)) {
|
|
2351
|
+
RESOLVERS[utility] = makeSpacingResolver(prop);
|
|
2352
|
+
}
|
|
2353
|
+
for (const [utility, [widthProp, colorProp]] of Object.entries(BORDER_SIDE_PROPS)) {
|
|
2354
|
+
RESOLVERS[utility] = makeBorderSideResolver(widthProp, colorProp);
|
|
2355
|
+
}
|
|
2396
2356
|
function resolveUtility(parsed, theme) {
|
|
2397
2357
|
if (!parsed.value) {
|
|
2398
2358
|
if (parsed.utility in PLUGIN_STANDALONE) return PLUGIN_STANDALONE[parsed.utility] ?? null;
|
|
@@ -2651,7 +2611,20 @@ function getDefaultFontFamily() {
|
|
|
2651
2611
|
return globalThis[FONT_KEY];
|
|
2652
2612
|
}
|
|
2653
2613
|
var _styleEl = null;
|
|
2654
|
-
|
|
2614
|
+
function evictInjectedRule(rule) {
|
|
2615
|
+
const sheet = _styleEl?.sheet;
|
|
2616
|
+
if (!sheet) return;
|
|
2617
|
+
for (let i = 0; i < sheet.cssRules.length; i++) {
|
|
2618
|
+
if (sheet.cssRules[i].cssText === rule) {
|
|
2619
|
+
try {
|
|
2620
|
+
sheet.deleteRule(i);
|
|
2621
|
+
} catch {
|
|
2622
|
+
}
|
|
2623
|
+
return;
|
|
2624
|
+
}
|
|
2625
|
+
}
|
|
2626
|
+
}
|
|
2627
|
+
var _injectedRules = new LRUCache(5e4, evictInjectedRule);
|
|
2655
2628
|
var _CSS_DISABLED_KEY = "__kbach_runtime_css_disabled__";
|
|
2656
2629
|
function isRuntimeCSSDisabled() {
|
|
2657
2630
|
return !!globalThis[_CSS_DISABLED_KEY];
|
|
@@ -2685,8 +2658,7 @@ function injectGlobalStyles(theme) {
|
|
|
2685
2658
|
if (typeof document === "undefined" || isRuntimeCSSDisabled()) return;
|
|
2686
2659
|
const rules = [BASE_RESET];
|
|
2687
2660
|
const ff = theme.fontFamily;
|
|
2688
|
-
if (
|
|
2689
|
-
if (ff.sans && ff.sans !== "System") {
|
|
2661
|
+
if (ff?.sans && ff.sans !== "System") {
|
|
2690
2662
|
const family = Array.isArray(ff.sans) ? ff.sans.join(", ") : ff.sans;
|
|
2691
2663
|
rules.push(`body { font-family: ${family}; }`);
|
|
2692
2664
|
}
|
|
@@ -2849,7 +2821,7 @@ function buildClassCSSRules(cls, bucketKey, styles, darkMode, important, screens
|
|
|
2849
2821
|
else rule = `[data-theme="dark"] ${selector} { ${decls} }`;
|
|
2850
2822
|
} else if (darkScheme === "light") {
|
|
2851
2823
|
if (darkMode === "media") rule = `@media (prefers-color-scheme: light) { ${selector} { ${decls} } }`;
|
|
2852
|
-
else if (darkMode === "class") rule =
|
|
2824
|
+
else if (darkMode === "class") rule = `.light ${selector} { ${decls} }`;
|
|
2853
2825
|
else rule = `[data-theme="light"] ${selector} { ${decls} }`;
|
|
2854
2826
|
} else {
|
|
2855
2827
|
rule = `${selector} { ${decls} }`;
|
|
@@ -2969,11 +2941,14 @@ function getConfig() {
|
|
|
2969
2941
|
return store.resolved;
|
|
2970
2942
|
}
|
|
2971
2943
|
function resolveOneRef(ref, colors) {
|
|
2972
|
-
const
|
|
2973
|
-
if (
|
|
2974
|
-
const
|
|
2944
|
+
const lastDash = ref.lastIndexOf("-");
|
|
2945
|
+
if (lastDash <= 0) return null;
|
|
2946
|
+
const name = ref.slice(0, lastDash);
|
|
2947
|
+
const shade = ref.slice(lastDash + 1);
|
|
2948
|
+
if (!/^\d+$/.test(shade)) return null;
|
|
2949
|
+
const entry = colors[name];
|
|
2975
2950
|
if (!entry || typeof entry !== "object") return null;
|
|
2976
|
-
return entry[
|
|
2951
|
+
return entry[shade] ?? null;
|
|
2977
2952
|
}
|
|
2978
2953
|
function resolveColorRefs(colors) {
|
|
2979
2954
|
const MAX_DEPTH = 5;
|
|
@@ -3003,7 +2978,7 @@ function resolveColorRefs(colors) {
|
|
|
3003
2978
|
function buildConfig(userConfig) {
|
|
3004
2979
|
let theme = { ...defaultTheme };
|
|
3005
2980
|
if (userConfig.theme) {
|
|
3006
|
-
theme =
|
|
2981
|
+
theme = { ...theme, ...userConfig.theme };
|
|
3007
2982
|
}
|
|
3008
2983
|
if (userConfig.extend) {
|
|
3009
2984
|
const extendConfig = userConfig.extend;
|
|
@@ -3131,15 +3106,17 @@ function subscribeGlobalDarkMode(callback) {
|
|
|
3131
3106
|
}
|
|
3132
3107
|
|
|
3133
3108
|
// src/InteractiveWrapper.tsx
|
|
3134
|
-
var
|
|
3109
|
+
var import_react2 = __toESM(require("react"));
|
|
3135
3110
|
|
|
3136
|
-
// src/
|
|
3111
|
+
// src/useSyncExternalStoreShim.ts
|
|
3137
3112
|
var import_react = __toESM(require("react"));
|
|
3138
3113
|
var useSyncExternalStore = import_react.default.useSyncExternalStore ?? function useSyncExternalStoreFallback(subscribe, getSnapshot, _getServerSnapshot) {
|
|
3139
3114
|
const [, forceUpdate] = import_react.default.useReducer((n) => n + 1, 0);
|
|
3140
3115
|
import_react.default.useEffect(() => subscribe(forceUpdate), [subscribe]);
|
|
3141
3116
|
return getSnapshot();
|
|
3142
3117
|
};
|
|
3118
|
+
|
|
3119
|
+
// src/useGlobalDarkMode.ts
|
|
3143
3120
|
function useGlobalDarkMode() {
|
|
3144
3121
|
return useSyncExternalStore(
|
|
3145
3122
|
subscribeGlobalDarkMode,
|
|
@@ -3150,12 +3127,6 @@ function useGlobalDarkMode() {
|
|
|
3150
3127
|
}
|
|
3151
3128
|
|
|
3152
3129
|
// src/useGlobalWidth.ts
|
|
3153
|
-
var import_react2 = __toESM(require("react"));
|
|
3154
|
-
var useSyncExternalStore2 = import_react2.default.useSyncExternalStore ?? function useSyncExternalStoreFallback2(subscribe, getSnapshot, _getServerSnapshot) {
|
|
3155
|
-
const [, forceUpdate] = import_react2.default.useReducer((n) => n + 1, 0);
|
|
3156
|
-
import_react2.default.useEffect(() => subscribe(forceUpdate), [subscribe]);
|
|
3157
|
-
return getSnapshot();
|
|
3158
|
-
};
|
|
3159
3130
|
var NOOP_SUB = (_) => () => {
|
|
3160
3131
|
};
|
|
3161
3132
|
var ZERO_SNAP = () => 0;
|
|
@@ -3189,7 +3160,7 @@ function getWebWidth() {
|
|
|
3189
3160
|
return typeof window !== "undefined" ? window.innerWidth : 0;
|
|
3190
3161
|
}
|
|
3191
3162
|
function useConditionalWidth(active) {
|
|
3192
|
-
return
|
|
3163
|
+
return useSyncExternalStore(
|
|
3193
3164
|
active ? isWeb ? subscribeWebWidth : subscribeGlobalWidth : NOOP_SUB,
|
|
3194
3165
|
active ? isWeb ? getWebWidth : getGlobalWidth : ZERO_SNAP,
|
|
3195
3166
|
ZERO_SNAP
|
|
@@ -3207,15 +3178,45 @@ function hasResponsiveBuckets(resolved) {
|
|
|
3207
3178
|
}
|
|
3208
3179
|
return false;
|
|
3209
3180
|
}
|
|
3210
|
-
|
|
3211
|
-
// src/InteractiveWrapper.tsx
|
|
3212
3181
|
function chain(original, extra) {
|
|
3213
3182
|
return (...args) => {
|
|
3214
3183
|
original?.(...args);
|
|
3215
3184
|
extra();
|
|
3216
3185
|
};
|
|
3217
3186
|
}
|
|
3218
|
-
|
|
3187
|
+
function stripInternalMarkers(s) {
|
|
3188
|
+
delete s.__divideX;
|
|
3189
|
+
delete s.__divideY;
|
|
3190
|
+
delete s.__divideColor;
|
|
3191
|
+
delete s.__divideStyle;
|
|
3192
|
+
delete s.__keyframe;
|
|
3193
|
+
}
|
|
3194
|
+
function stripWebOnlyProps(s) {
|
|
3195
|
+
if (s.display === "grid" || s.display === "inline-grid") delete s.display;
|
|
3196
|
+
delete s.gridTemplateColumns;
|
|
3197
|
+
delete s.gridTemplateRows;
|
|
3198
|
+
delete s.gridColumn;
|
|
3199
|
+
delete s.gridRow;
|
|
3200
|
+
delete s.gridArea;
|
|
3201
|
+
delete s.gridColumnStart;
|
|
3202
|
+
delete s.gridColumnEnd;
|
|
3203
|
+
delete s.gridRowStart;
|
|
3204
|
+
delete s.gridRowEnd;
|
|
3205
|
+
delete s.gridAutoFlow;
|
|
3206
|
+
delete s.gridAutoColumns;
|
|
3207
|
+
delete s.gridAutoRows;
|
|
3208
|
+
delete s.placeItems;
|
|
3209
|
+
delete s.placeContent;
|
|
3210
|
+
delete s.justifyItems;
|
|
3211
|
+
delete s.placeSelf;
|
|
3212
|
+
delete s.justifySelf;
|
|
3213
|
+
if (s.position === "sticky" || s.position === "fixed" || s.position === "static") {
|
|
3214
|
+
delete s.position;
|
|
3215
|
+
}
|
|
3216
|
+
}
|
|
3217
|
+
|
|
3218
|
+
// src/InteractiveWrapper.tsx
|
|
3219
|
+
var InteractiveWrapper = (0, import_react2.forwardRef)(
|
|
3219
3220
|
function InteractiveWrapper2({
|
|
3220
3221
|
Component,
|
|
3221
3222
|
resolvedStyle,
|
|
@@ -3226,6 +3227,7 @@ var InteractiveWrapper = (0, import_react3.forwardRef)(
|
|
|
3226
3227
|
onPointerDown,
|
|
3227
3228
|
onPointerUp,
|
|
3228
3229
|
onPointerLeave,
|
|
3230
|
+
onPointerCancel,
|
|
3229
3231
|
onMouseEnter,
|
|
3230
3232
|
onMouseLeave,
|
|
3231
3233
|
onFocus,
|
|
@@ -3236,51 +3238,26 @@ var InteractiveWrapper = (0, import_react3.forwardRef)(
|
|
|
3236
3238
|
const needsWidth = hasResponsiveBuckets(resolvedStyle);
|
|
3237
3239
|
const width = useConditionalWidth(needsWidth);
|
|
3238
3240
|
const breakpoints = needsWidth ? getActiveBreakpoints(width) : EMPTY_BREAKPOINTS;
|
|
3239
|
-
const [pressed, setPressed] = (0,
|
|
3240
|
-
const [hovered, setHovered] = (0,
|
|
3241
|
-
const [focused, setFocused] = (0,
|
|
3242
|
-
const handlePressIn = (0,
|
|
3243
|
-
const handlePressOut = (0,
|
|
3244
|
-
const handlePointerDown = (0,
|
|
3245
|
-
const handlePointerUp = (0,
|
|
3246
|
-
const handlePointerLeave = (0,
|
|
3247
|
-
const
|
|
3248
|
-
const
|
|
3249
|
-
const
|
|
3250
|
-
const
|
|
3241
|
+
const [pressed, setPressed] = (0, import_react2.useState)(false);
|
|
3242
|
+
const [hovered, setHovered] = (0, import_react2.useState)(false);
|
|
3243
|
+
const [focused, setFocused] = (0, import_react2.useState)(false);
|
|
3244
|
+
const handlePressIn = (0, import_react2.useCallback)(chain(onPressIn, () => setPressed(true)), [onPressIn]);
|
|
3245
|
+
const handlePressOut = (0, import_react2.useCallback)(chain(onPressOut, () => setPressed(false)), [onPressOut]);
|
|
3246
|
+
const handlePointerDown = (0, import_react2.useCallback)(chain(onPointerDown, () => setPressed(true)), [onPointerDown]);
|
|
3247
|
+
const handlePointerUp = (0, import_react2.useCallback)(chain(onPointerUp, () => setPressed(false)), [onPointerUp]);
|
|
3248
|
+
const handlePointerLeave = (0, import_react2.useCallback)(chain(onPointerLeave, () => setPressed(false)), [onPointerLeave]);
|
|
3249
|
+
const handlePointerCancel = (0, import_react2.useCallback)(chain(onPointerCancel, () => setPressed(false)), [onPointerCancel]);
|
|
3250
|
+
const handleMouseEnter = (0, import_react2.useCallback)(chain(onMouseEnter, () => setHovered(true)), [onMouseEnter]);
|
|
3251
|
+
const handleMouseLeave = (0, import_react2.useCallback)(chain(onMouseLeave, () => setHovered(false)), [onMouseLeave]);
|
|
3252
|
+
const handleFocus = (0, import_react2.useCallback)(chain(onFocus, () => setFocused(true)), [onFocus]);
|
|
3253
|
+
const handleBlur = (0, import_react2.useCallback)(chain(onBlur, () => setFocused(false)), [onBlur]);
|
|
3251
3254
|
const { children, disabled, checked, ...restForComponent } = rest;
|
|
3252
|
-
const computedStyle = (0,
|
|
3255
|
+
const computedStyle = (0, import_react2.useMemo)(
|
|
3253
3256
|
() => {
|
|
3254
3257
|
if (isWeb) return {};
|
|
3255
3258
|
const s = flatten(resolvedStyle, isDark, { pressed, hover: hovered, focus: focused, disabled: !!disabled, checked: !!checked }, breakpoints);
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
delete s.__divideColor;
|
|
3259
|
-
delete s.__divideStyle;
|
|
3260
|
-
delete s.__keyframe;
|
|
3261
|
-
if (typeof Component !== "string") {
|
|
3262
|
-
if (s.display === "grid" || s.display === "inline-grid") delete s.display;
|
|
3263
|
-
delete s.gridTemplateColumns;
|
|
3264
|
-
delete s.gridTemplateRows;
|
|
3265
|
-
delete s.gridColumn;
|
|
3266
|
-
delete s.gridRow;
|
|
3267
|
-
delete s.gridArea;
|
|
3268
|
-
delete s.gridColumnStart;
|
|
3269
|
-
delete s.gridColumnEnd;
|
|
3270
|
-
delete s.gridRowStart;
|
|
3271
|
-
delete s.gridRowEnd;
|
|
3272
|
-
delete s.gridAutoFlow;
|
|
3273
|
-
delete s.gridAutoColumns;
|
|
3274
|
-
delete s.gridAutoRows;
|
|
3275
|
-
delete s.placeItems;
|
|
3276
|
-
delete s.placeContent;
|
|
3277
|
-
delete s.justifyItems;
|
|
3278
|
-
delete s.placeSelf;
|
|
3279
|
-
delete s.justifySelf;
|
|
3280
|
-
if (s.position === "sticky" || s.position === "fixed" || s.position === "static") {
|
|
3281
|
-
delete s.position;
|
|
3282
|
-
}
|
|
3283
|
-
}
|
|
3259
|
+
stripInternalMarkers(s);
|
|
3260
|
+
if (typeof Component !== "string") stripWebOnlyProps(s);
|
|
3284
3261
|
return s;
|
|
3285
3262
|
},
|
|
3286
3263
|
[resolvedStyle, isDark, pressed, hovered, focused, width, disabled, checked]
|
|
@@ -3297,20 +3274,20 @@ var InteractiveWrapper = (0, import_react3.forwardRef)(
|
|
|
3297
3274
|
// On web, onPointerDown/Up drive the wrapper's own pressed state (covers mouse + touch),
|
|
3298
3275
|
// but onPressIn/onPressOut are still forwarded unchanged — react-native-web components
|
|
3299
3276
|
// (and any component that accepts both prop names) depend on receiving them directly.
|
|
3300
|
-
...!isNative ? { onPointerDown: handlePointerDown, onPointerUp: handlePointerUp, onPointerLeave: handlePointerLeave, onPointerCancel:
|
|
3277
|
+
...!isNative ? { onPointerDown: handlePointerDown, onPointerUp: handlePointerUp, onPointerLeave: handlePointerLeave, onPointerCancel: handlePointerCancel, onPressIn, onPressOut } : { onPressIn: handlePressIn, onPressOut: handlePressOut },
|
|
3301
3278
|
onMouseEnter: handleMouseEnter,
|
|
3302
3279
|
onMouseLeave: handleMouseLeave,
|
|
3303
3280
|
onFocus: handleFocus,
|
|
3304
3281
|
onBlur: handleBlur
|
|
3305
3282
|
};
|
|
3306
|
-
return Array.isArray(children) ?
|
|
3283
|
+
return Array.isArray(children) ? import_react2.default.createElement(Component, componentProps, ...children) : import_react2.default.createElement(Component, componentProps, children);
|
|
3307
3284
|
}
|
|
3308
3285
|
);
|
|
3309
3286
|
InteractiveWrapper.displayName = "Kbach.InteractiveWrapper";
|
|
3310
3287
|
|
|
3311
3288
|
// src/DarkWrapper.tsx
|
|
3312
|
-
var
|
|
3313
|
-
var DarkWrapper =
|
|
3289
|
+
var import_react3 = __toESM(require("react"));
|
|
3290
|
+
var DarkWrapper = import_react3.default.forwardRef(
|
|
3314
3291
|
function DarkWrapper2({ Component, resolvedStyle, style: styleProp, children, ...rest }, ref) {
|
|
3315
3292
|
const isDark = useGlobalDarkMode();
|
|
3316
3293
|
const needsWidth = hasResponsiveBuckets(resolvedStyle);
|
|
@@ -3318,7 +3295,7 @@ var DarkWrapper = import_react4.default.forwardRef(
|
|
|
3318
3295
|
const breakpoints = needsWidth ? getActiveBreakpoints(width) : EMPTY_BREAKPOINTS;
|
|
3319
3296
|
const screens = getGlobalScreens();
|
|
3320
3297
|
const isNonStringComponent = typeof Component !== "string";
|
|
3321
|
-
const computedStyle = (0,
|
|
3298
|
+
const computedStyle = (0, import_react3.useMemo)(() => {
|
|
3322
3299
|
if (isWeb) return {};
|
|
3323
3300
|
const s = flatten(resolvedStyle, isDark, {}, breakpoints);
|
|
3324
3301
|
stripInternalMarkers(s);
|
|
@@ -3328,40 +3305,10 @@ var DarkWrapper = import_react4.default.forwardRef(
|
|
|
3328
3305
|
const skipComputedInline = isWeb || !isNative && typeof Component === "string";
|
|
3329
3306
|
const finalStyle = skipComputedInline ? styleProp ?? void 0 : styleProp ? Array.isArray(styleProp) ? Object.assign({}, computedStyle, ...styleProp) : { ...computedStyle, ...styleProp } : computedStyle;
|
|
3330
3307
|
const props = { ref, ...rest, style: finalStyle };
|
|
3331
|
-
return Array.isArray(children) ?
|
|
3308
|
+
return Array.isArray(children) ? import_react3.default.createElement(Component, props, ...children) : import_react3.default.createElement(Component, props, children);
|
|
3332
3309
|
}
|
|
3333
3310
|
);
|
|
3334
3311
|
DarkWrapper.displayName = "Kbach.DarkWrapper";
|
|
3335
|
-
function stripInternalMarkers(s) {
|
|
3336
|
-
delete s.__divideX;
|
|
3337
|
-
delete s.__divideY;
|
|
3338
|
-
delete s.__divideColor;
|
|
3339
|
-
delete s.__divideStyle;
|
|
3340
|
-
delete s.__keyframe;
|
|
3341
|
-
}
|
|
3342
|
-
function stripWebOnlyProps(s) {
|
|
3343
|
-
if (s.display === "grid" || s.display === "inline-grid") delete s.display;
|
|
3344
|
-
delete s.gridTemplateColumns;
|
|
3345
|
-
delete s.gridTemplateRows;
|
|
3346
|
-
delete s.gridColumn;
|
|
3347
|
-
delete s.gridRow;
|
|
3348
|
-
delete s.gridArea;
|
|
3349
|
-
delete s.gridColumnStart;
|
|
3350
|
-
delete s.gridColumnEnd;
|
|
3351
|
-
delete s.gridRowStart;
|
|
3352
|
-
delete s.gridRowEnd;
|
|
3353
|
-
delete s.gridAutoFlow;
|
|
3354
|
-
delete s.gridAutoColumns;
|
|
3355
|
-
delete s.gridAutoRows;
|
|
3356
|
-
delete s.placeItems;
|
|
3357
|
-
delete s.placeContent;
|
|
3358
|
-
delete s.justifyItems;
|
|
3359
|
-
delete s.placeSelf;
|
|
3360
|
-
delete s.justifySelf;
|
|
3361
|
-
if (s.position === "sticky" || s.position === "fixed" || s.position === "static") {
|
|
3362
|
-
delete s.position;
|
|
3363
|
-
}
|
|
3364
|
-
}
|
|
3365
3312
|
|
|
3366
3313
|
// src/web-substitute.ts
|
|
3367
3314
|
var _rnToHtml = {
|
|
@@ -3606,13 +3553,11 @@ function transformToWebProps(originalName, tag, props) {
|
|
|
3606
3553
|
continue;
|
|
3607
3554
|
}
|
|
3608
3555
|
if (k === "resizeMode") {
|
|
3609
|
-
|
|
3610
|
-
out.style = { ...existing, objectFit: _resizeModeMap[v] ?? "cover" };
|
|
3556
|
+
pendingStyle = { ...pendingStyle ?? {}, objectFit: _resizeModeMap[v] ?? "cover" };
|
|
3611
3557
|
continue;
|
|
3612
3558
|
}
|
|
3613
3559
|
if (k === "contentFit") {
|
|
3614
|
-
|
|
3615
|
-
out.style = { ...existing, objectFit: v };
|
|
3560
|
+
pendingStyle = { ...pendingStyle ?? {}, objectFit: v };
|
|
3616
3561
|
continue;
|
|
3617
3562
|
}
|
|
3618
3563
|
if (k === "defaultSource") continue;
|
|
@@ -3692,36 +3637,6 @@ function mergeStyle(computed, userStyle) {
|
|
|
3692
3637
|
function makeElement(isStaticChildren, type, props, key) {
|
|
3693
3638
|
return (isStaticChildren ? import_jsx_runtime.jsxs : import_jsx_runtime.jsx)(type, props, key);
|
|
3694
3639
|
}
|
|
3695
|
-
function stripInternalMarkers2(s) {
|
|
3696
|
-
delete s.__divideX;
|
|
3697
|
-
delete s.__divideY;
|
|
3698
|
-
delete s.__divideColor;
|
|
3699
|
-
delete s.__divideStyle;
|
|
3700
|
-
delete s.__keyframe;
|
|
3701
|
-
}
|
|
3702
|
-
function stripWebOnlyInlineProps(s) {
|
|
3703
|
-
if (s.display === "grid" || s.display === "inline-grid") delete s.display;
|
|
3704
|
-
delete s.gridTemplateColumns;
|
|
3705
|
-
delete s.gridTemplateRows;
|
|
3706
|
-
delete s.gridColumn;
|
|
3707
|
-
delete s.gridRow;
|
|
3708
|
-
delete s.gridArea;
|
|
3709
|
-
delete s.gridColumnStart;
|
|
3710
|
-
delete s.gridColumnEnd;
|
|
3711
|
-
delete s.gridRowStart;
|
|
3712
|
-
delete s.gridRowEnd;
|
|
3713
|
-
delete s.gridAutoFlow;
|
|
3714
|
-
delete s.gridAutoColumns;
|
|
3715
|
-
delete s.gridAutoRows;
|
|
3716
|
-
delete s.placeItems;
|
|
3717
|
-
delete s.placeContent;
|
|
3718
|
-
delete s.justifyItems;
|
|
3719
|
-
delete s.placeSelf;
|
|
3720
|
-
delete s.justifySelf;
|
|
3721
|
-
if (s.position === "sticky" || s.position === "fixed" || s.position === "static") {
|
|
3722
|
-
delete s.position;
|
|
3723
|
-
}
|
|
3724
|
-
}
|
|
3725
3640
|
function processElement(type, rawProps, key, isStaticChildren) {
|
|
3726
3641
|
if (type === null || typeof type === "symbol") return makeElement(isStaticChildren, type, rawProps ?? {}, key);
|
|
3727
3642
|
const webTag = isWeb ? getWebTag(type, rawProps ?? void 0) : null;
|
|
@@ -3781,8 +3696,8 @@ function processElement(type, rawProps, key, isStaticChildren) {
|
|
|
3781
3696
|
let finalStyle;
|
|
3782
3697
|
if (!skipComputedInline) {
|
|
3783
3698
|
const computedStyle = flatten(resolved, false);
|
|
3784
|
-
|
|
3785
|
-
if (typeof effectiveType !== "string")
|
|
3699
|
+
stripInternalMarkers(computedStyle);
|
|
3700
|
+
if (typeof effectiveType !== "string") stripWebOnlyProps(computedStyle);
|
|
3786
3701
|
finalStyle = mergeStyle(computedStyle, userStyle);
|
|
3787
3702
|
} else {
|
|
3788
3703
|
finalStyle = userStyle ?? void 0;
|
|
@@ -3803,7 +3718,7 @@ function jsxs(type, props, key) {
|
|
|
3803
3718
|
// src/jsx-dev-runtime.tsx
|
|
3804
3719
|
function jsxDEV(type, props, key, isStaticChildren, source, self) {
|
|
3805
3720
|
const element = (isStaticChildren ? jsxs : jsx)(type, props, key);
|
|
3806
|
-
if (source && element && typeof element === "object") {
|
|
3721
|
+
if (source && element && typeof element === "object" && Object.isExtensible(element)) {
|
|
3807
3722
|
element._source = source;
|
|
3808
3723
|
element._self = self;
|
|
3809
3724
|
}
|