@tamagui/core 2.0.0-1768427228811 → 2.0.0-1768586279389

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/native.cjs CHANGED
@@ -1953,14 +1953,14 @@ function requireNormalizeColor() {
1953
1953
  return (int % 360 + 360) % 360 / 360;
1954
1954
  }
1955
1955
  function parse1(str) {
1956
- const num = parseFloat(str);
1957
- if (num < 0) {
1956
+ const num2 = parseFloat(str);
1957
+ if (num2 < 0) {
1958
1958
  return 0;
1959
1959
  }
1960
- if (num > 1) {
1960
+ if (num2 > 1) {
1961
1961
  return 255;
1962
1962
  }
1963
- return Math.round(num * 255);
1963
+ return Math.round(num2 * 255);
1964
1964
  }
1965
1965
  function parsePercentage(str) {
1966
1966
  const int = parseFloat(str);
@@ -8438,9 +8438,179 @@ var getTokens = function() {
8438
8438
  };
8439
8439
  function setupDev(conf2) {
8440
8440
  }
8441
- var cache$4 = /* @__PURE__ */ new Map(), cacheSize = 0, simpleHash = function(strIn) {
8441
+ var matchMediaImpl = matchMediaFallback, matchMedia$1 = function() {
8442
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
8443
+ return matchMediaImpl(...args);
8444
+ };
8445
+ function matchMediaFallback(query2) {
8446
+ return !process.env.IS_STATIC && false, {
8447
+ match: function(a, b2) {
8448
+ return false;
8449
+ },
8450
+ addListener: function() {
8451
+ },
8452
+ removeListener: function() {
8453
+ },
8454
+ matches: false
8455
+ };
8456
+ }
8457
+ function setupMatchMedia(_2) {
8458
+ matchMediaImpl = _2, globalThis.matchMedia = _2;
8459
+ }
8460
+ exports.mediaState = // development only safeguard
8461
+ {};
8462
+ var mediaQueryConfig = {}, getMedia = function() {
8463
+ return exports.mediaState;
8464
+ }, mediaKeys = /* @__PURE__ */ new Set(), mediaKeyRegex = /\$(platform|theme|group)-/, getMediaKey = function(key) {
8465
+ if (key[0] !== "$") return false;
8466
+ if (mediaKeys.has(key)) return true;
8467
+ var match = key.match(mediaKeyRegex);
8468
+ return match ? match[1] : false;
8469
+ }, initState, mediaKeysOrdered, getMediaKeyImportance = function(key) {
8470
+ return mediaKeysOrdered.indexOf(key) + 100;
8471
+ }, dispose = /* @__PURE__ */ new Set(), mediaVersion = 0, configureMedia = function(config) {
8472
+ var {
8473
+ media
8474
+ } = config, mediaQueryDefaultActive = getSetting("mediaQueryDefaultActive");
8475
+ if (media) {
8476
+ mediaVersion++;
8477
+ for (var key in media) exports.mediaState[key] = (mediaQueryDefaultActive == null ? void 0 : mediaQueryDefaultActive[key]) || false, mediaKeys.add(`$${key}`);
8478
+ Object.assign(mediaQueryConfig, media), initState = __spreadValues({}, exports.mediaState), mediaKeysOrdered = Object.keys(media), setupMediaListeners();
8479
+ }
8480
+ };
8481
+ function unlisten() {
8482
+ dispose.forEach(function(cb) {
8483
+ return cb();
8484
+ }), dispose.clear();
8485
+ }
8486
+ var setupVersion = -1;
8487
+ function setupMediaListeners() {
8488
+ var _loop2 = function(key2) {
8489
+ var str = mediaObjectToString(mediaQueryConfig[key2]), getMatch = function() {
8490
+ return matchMedia$1(str);
8491
+ }, match = getMatch();
8492
+ if (!match) throw new Error("⚠️ No match");
8493
+ match.addListener(update2), dispose.add(function() {
8494
+ match.removeListener(update2);
8495
+ });
8496
+ function update2() {
8497
+ var next = !!getMatch().matches;
8498
+ next !== exports.mediaState[key2] && (exports.mediaState = __spreadProps(__spreadValues({}, exports.mediaState), {
8499
+ [key2]: next
8500
+ }), updateMediaListeners());
8501
+ }
8502
+ update2();
8503
+ };
8504
+ if (!process.env.IS_STATIC && setupVersion !== mediaVersion) {
8505
+ setupVersion = mediaVersion, unlisten();
8506
+ for (var key in mediaQueryConfig) _loop2(key);
8507
+ }
8508
+ }
8509
+ var listeners = /* @__PURE__ */ new Set();
8510
+ function updateMediaListeners() {
8511
+ listeners.forEach(function(cb) {
8512
+ return cb(exports.mediaState);
8513
+ });
8514
+ }
8515
+ var States = /* @__PURE__ */ new WeakMap();
8516
+ function setMediaShouldUpdate(ref, enabled, keys) {
8517
+ var cur = States.get(ref);
8518
+ (!cur || cur.enabled !== enabled || keys) && States.set(ref, __spreadProps(__spreadValues({}, cur), {
8519
+ enabled,
8520
+ keys
8521
+ }));
8522
+ }
8523
+ function subscribe(subscriber) {
8524
+ return listeners.add(subscriber), function() {
8525
+ listeners.delete(subscriber);
8526
+ };
8527
+ }
8528
+ function useMedia(componentContext, debug) {
8529
+ var componentState = componentContext ? States.get(componentContext) : null, internalRef = React.useRef(null);
8530
+ internalRef.current || (internalRef.current = {
8531
+ keys: /* @__PURE__ */ new Set(),
8532
+ lastState: exports.mediaState
8533
+ }), internalRef.current.pendingState && (internalRef.current.lastState = internalRef.current.pendingState, internalRef.current.pendingState = void 0);
8534
+ var {
8535
+ keys
8536
+ } = internalRef.current;
8537
+ keys.size && keys.clear();
8538
+ var state = React.useSyncExternalStore(subscribe, function() {
8539
+ var curKeys2 = (componentState == null ? void 0 : componentState.keys) || keys, {
8540
+ lastState,
8541
+ pendingState
8542
+ } = internalRef.current;
8543
+ if (!curKeys2.size) return lastState;
8544
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
8545
+ try {
8546
+ for (var _iterator = curKeys2[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
8547
+ var key = _step.value;
8548
+ if (exports.mediaState[key] !== (pendingState || lastState)[key]) return false, (componentContext == null ? void 0 : componentContext.mediaEmit) ? (componentContext.mediaEmit(exports.mediaState), internalRef.current.pendingState = exports.mediaState, lastState) : (internalRef.current.lastState = exports.mediaState, exports.mediaState);
8549
+ }
8550
+ } catch (err) {
8551
+ _didIteratorError = true, _iteratorError = err;
8552
+ } finally {
8553
+ try {
8554
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
8555
+ } finally {
8556
+ if (_didIteratorError) throw _iteratorError;
8557
+ }
8558
+ }
8559
+ return lastState;
8560
+ }, getServerSnapshot);
8561
+ return new Proxy(state, {
8562
+ get(_2, key) {
8563
+ return !disableMediaTouch && typeof key == "string" && keys.add(key), Reflect.get(state, key);
8564
+ }
8565
+ });
8566
+ }
8567
+ var getServerSnapshot = function() {
8568
+ return initState;
8569
+ }, disableMediaTouch = false;
8570
+ function _disableMediaTouch(val) {
8571
+ disableMediaTouch = val;
8572
+ }
8573
+ function getMediaState(mediaGroups, layout) {
8574
+ disableMediaTouch = true;
8575
+ var res;
8576
+ try {
8577
+ res = Object.fromEntries([...mediaGroups].map(function(mediaKey) {
8578
+ return [mediaKey, mediaKeyMatch(mediaKey, layout)];
8579
+ }));
8580
+ } finally {
8581
+ disableMediaTouch = false;
8582
+ }
8583
+ return res;
8584
+ }
8585
+ var getMediaImportanceIfMoreImportant = function(mediaKey, key, styleState, isSizeMedia) {
8586
+ var importance = isSizeMedia ? getMediaKeyImportance(mediaKey) : defaultMediaImportance, usedKeys = styleState.usedKeys;
8587
+ return !usedKeys[key] || importance > usedKeys[key] ? importance : null;
8588
+ };
8589
+ function camelToHyphen(str) {
8590
+ return str.replace(/[A-Z]/g, function(m) {
8591
+ return `-${m.toLowerCase()}`;
8592
+ }).toLowerCase();
8593
+ }
8594
+ var cache$4 = /* @__PURE__ */ new WeakMap();
8595
+ function mediaObjectToString(query2, key) {
8596
+ if (typeof query2 == "string") return query2;
8597
+ if (cache$4.has(query2)) return cache$4.get(query2);
8598
+ var res = Object.entries(query2).map(function(param) {
8599
+ var [feature, value] = param;
8600
+ return feature = camelToHyphen(feature), typeof value == "string" ? `(${feature}: ${value})` : (typeof value == "number" && /[height|width]$/.test(feature) && (value = `${value}px`), `(${feature}: ${value})`);
8601
+ }).join(" and ");
8602
+ return cache$4.set(query2, res), res;
8603
+ }
8604
+ function mediaKeyMatch(key, dimensions2) {
8605
+ var mediaQueries = mediaQueryConfig[key], result = Object.keys(mediaQueries).every(function(query2) {
8606
+ var expectedVal = +mediaQueries[query2], isMax = query2.startsWith("max"), isWidth = query2.endsWith("Width"), givenVal = dimensions2[isWidth ? "width" : "height"];
8607
+ return isMax ? givenVal < expectedVal : givenVal > expectedVal;
8608
+ });
8609
+ return result;
8610
+ }
8611
+ var cache$3 = /* @__PURE__ */ new Map(), cacheSize = 0, simpleHash = function(strIn) {
8442
8612
  var hashMin = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 10;
8443
- if (cache$4.has(strIn)) return cache$4.get(strIn);
8613
+ if (cache$3.has(strIn)) return cache$3.get(strIn);
8444
8614
  var str = strIn;
8445
8615
  str[0] === "v" && str.startsWith("var(") && (str = str.slice(6, str.length - 1));
8446
8616
  for (var hash = 0, valids = "", added = 0, len = str.length, i = 0; i < len; i++) {
@@ -8458,7 +8628,7 @@ var cache$4 = /* @__PURE__ */ new Map(), cacheSize = 0, simpleHash = function(st
8458
8628
  hash = hashChar(hash, str[i]);
8459
8629
  }
8460
8630
  var res = valids + (hash ? Math.abs(hash) : "");
8461
- return cacheSize > 1e4 && (cache$4.clear(), cacheSize = 0), cache$4.set(strIn, res), cacheSize++, res;
8631
+ return cacheSize > 1e4 && (cache$3.clear(), cacheSize = 0), cache$3.set(strIn, res), cacheSize++, res;
8462
8632
  }, hashChar = function(hash, c) {
8463
8633
  return Math.imul(31, hash) + c.charCodeAt(0) | 0;
8464
8634
  };
@@ -8546,13 +8716,14 @@ var webOnlyStylePropsView = {
8546
8716
  borderLeftStyle: true,
8547
8717
  borderRightStyle: true,
8548
8718
  borderTopStyle: true,
8549
- boxSizing: true,
8719
+ // boxSizing: now supported in RN 0.77+ (New Architecture)
8550
8720
  caretColor: true,
8551
8721
  clipPath: true,
8552
8722
  contain: true,
8553
8723
  containerType: true,
8554
8724
  content: true,
8555
8725
  cursor: true,
8726
+ // NOTE: cursor is supported on iOS 17+ for trackpad/stylus
8556
8727
  float: true,
8557
8728
  mask: true,
8558
8729
  maskBorder: true,
@@ -8571,13 +8742,10 @@ var webOnlyStylePropsView = {
8571
8742
  maskRepeat: true,
8572
8743
  maskSize: true,
8573
8744
  maskType: true,
8574
- mixBlendMode: true,
8745
+ // mixBlendMode: now supported in RN 0.77+ (New Architecture)
8575
8746
  objectFit: true,
8576
8747
  objectPosition: true,
8577
- outlineOffset: true,
8578
- outlineStyle: true,
8579
- outlineWidth: true,
8580
- outlineColor: true,
8748
+ // outline*: now supported in RN 0.77+ (New Architecture)
8581
8749
  overflowBlock: true,
8582
8750
  overflowInline: true,
8583
8751
  overflowX: true,
@@ -8633,7 +8801,7 @@ var textColors = {
8633
8801
  zIndex: {
8634
8802
  zIndex: true
8635
8803
  },
8636
- color: __spreadValues({
8804
+ color: __spreadProps(__spreadValues({
8637
8805
  backgroundColor: true,
8638
8806
  borderColor: true,
8639
8807
  borderBlockStartColor: true,
@@ -8649,7 +8817,10 @@ var textColors = {
8649
8817
  borderEndColor: true,
8650
8818
  borderStartColor: true,
8651
8819
  shadowColor: true
8652
- }, textColors)
8820
+ }, textColors), {
8821
+ // outlineColor is supported on RN 0.77+ (New Architecture)
8822
+ outlineColor: true
8823
+ })
8653
8824
  }, stylePropsUnitless = {
8654
8825
  WebkitLineClamp: true,
8655
8826
  animationIterationCount: true,
@@ -8702,7 +8873,7 @@ var textColors = {
8702
8873
  rotateY: true,
8703
8874
  rotateX: true,
8704
8875
  rotateZ: true
8705
- }, stylePropsView = __spreadValues(__spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({
8876
+ }, stylePropsView = __spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({
8706
8877
  backfaceVisibility: true,
8707
8878
  borderBottomEndRadius: true,
8708
8879
  borderBottomStartRadius: true,
@@ -8792,12 +8963,13 @@ var textColors = {
8792
8963
  elevationAndroid: true
8793
8964
  } : {}), {
8794
8965
  boxShadow: true,
8795
- filter: true
8796
- }), !process.env.REACT_NATIVE_PRE_77 && {
8966
+ filter: true,
8967
+ // RN 0.76/0.77+ style props (New Architecture)
8797
8968
  boxSizing: true,
8798
8969
  mixBlendMode: true,
8970
+ isolation: true,
8799
8971
  outlineColor: true,
8800
- outlineSpread: true,
8972
+ outlineOffset: true,
8801
8973
  outlineStyle: true,
8802
8974
  outlineWidth: true
8803
8975
  }), stylePropsFont = {
@@ -8917,6 +9089,26 @@ function px(value) {
8917
9089
  function getOppositeScheme(scheme) {
8918
9090
  return scheme === "dark" ? "light" : "dark";
8919
9091
  }
9092
+ var colorStyleKeys = {
9093
+ backgroundColor: true,
9094
+ borderColor: true,
9095
+ borderTopColor: true,
9096
+ borderRightColor: true,
9097
+ borderBottomColor: true,
9098
+ borderLeftColor: true,
9099
+ borderBlockColor: true,
9100
+ borderBlockEndColor: true,
9101
+ borderBlockStartColor: true,
9102
+ color: true,
9103
+ shadowColor: true,
9104
+ textDecorationColor: true,
9105
+ textShadowColor: true,
9106
+ tintColor: true,
9107
+ outlineColor: true
9108
+ };
9109
+ function isColorStyleKey(key) {
9110
+ return colorStyleKeys[key] === true;
9111
+ }
8920
9112
  function getDynamicVal(param) {
8921
9113
  var {
8922
9114
  scheme,
@@ -9166,11 +9358,11 @@ function doesRootSchemeMatchSystem() {
9166
9358
  var _getRootThemeState;
9167
9359
  return ((_getRootThemeState = getRootThemeState()) === null || _getRootThemeState === void 0 ? void 0 : _getRootThemeState.scheme) === Appearance.getColorScheme();
9168
9360
  }
9169
- var cache$3 = /* @__PURE__ */ new Map(), curKeys, curProps, curState, emptyObject = {};
9361
+ var cache$2 = /* @__PURE__ */ new Map(), curKeys, curProps, curState, emptyObject = {};
9170
9362
  function getThemeProxied(_props, _state, _keys) {
9171
9363
  if (!(_state == null ? void 0 : _state.theme)) return emptyObject;
9172
- if (curKeys = _keys, curProps = _props, curState = _state, cache$3.has(curState.theme)) {
9173
- var proxied = cache$3.get(curState.theme);
9364
+ if (curKeys = _keys, curProps = _props, curState = _state, cache$2.has(curState.theme)) {
9365
+ var proxied = cache$2.get(curState.theme);
9174
9366
  return proxied;
9175
9367
  }
9176
9368
  var config = getConfig();
@@ -9202,7 +9394,7 @@ function getThemeProxied(_props, _state, _keys) {
9202
9394
  });
9203
9395
  return [[key, proxied2], [`$${key}`, proxied2]];
9204
9396
  }));
9205
- return cache$3.set(_state.theme, proxied1), proxied1;
9397
+ return cache$2.set(_state.theme, proxied1), proxied1;
9206
9398
  }
9207
9399
  var EMPTY = {}, useTheme = function() {
9208
9400
  var [theme] = useThemeWithState(EMPTY), res = theme;
@@ -9218,10 +9410,14 @@ var _withStableStyle = function(Component, styleProvider) {
9218
9410
  _expressions = []
9219
9411
  } = _a, rest = __objRest(_a, [
9220
9412
  "_expressions"
9221
- ]), theme = useTheme();
9413
+ ]), theme = useTheme(), hasMediaKeys = _expressions.some(function(expr) {
9414
+ return typeof expr == "string";
9415
+ }), media = hasMediaKeys ? useMedia() : null, resolvedExpressions = media ? _expressions.map(function(expr) {
9416
+ return typeof expr == "string" ? media[expr] : expr;
9417
+ }) : _expressions;
9222
9418
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Component, __spreadValues({
9223
9419
  ref,
9224
- style: styleProvider(theme, _expressions)
9420
+ style: styleProvider(theme, resolvedExpressions)
9225
9421
  }, rest));
9226
9422
  });
9227
9423
  };
@@ -9254,176 +9450,6 @@ var defaultComponentState = {
9254
9450
  }), defaultComponentStateShouldEnter = __spreadProps(__spreadValues({}, defaultComponentState), {
9255
9451
  unmounted: "should-enter"
9256
9452
  });
9257
- var matchMediaImpl = matchMediaFallback, matchMedia$1 = function() {
9258
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
9259
- return matchMediaImpl(...args);
9260
- };
9261
- function matchMediaFallback(query2) {
9262
- return !process.env.IS_STATIC && false, {
9263
- match: function(a, b2) {
9264
- return false;
9265
- },
9266
- addListener: function() {
9267
- },
9268
- removeListener: function() {
9269
- },
9270
- matches: false
9271
- };
9272
- }
9273
- function setupMatchMedia(_2) {
9274
- matchMediaImpl = _2, globalThis.matchMedia = _2;
9275
- }
9276
- exports.mediaState = // development only safeguard
9277
- {};
9278
- var mediaQueryConfig = {}, getMedia = function() {
9279
- return exports.mediaState;
9280
- }, mediaKeys = /* @__PURE__ */ new Set(), mediaKeyRegex = /\$(platform|theme|group)-/, getMediaKey = function(key) {
9281
- if (key[0] !== "$") return false;
9282
- if (mediaKeys.has(key)) return true;
9283
- var match = key.match(mediaKeyRegex);
9284
- return match ? match[1] : false;
9285
- }, initState, mediaKeysOrdered, getMediaKeyImportance = function(key) {
9286
- return mediaKeysOrdered.indexOf(key) + 100;
9287
- }, dispose = /* @__PURE__ */ new Set(), mediaVersion = 0, configureMedia = function(config) {
9288
- var {
9289
- media
9290
- } = config, mediaQueryDefaultActive = getSetting("mediaQueryDefaultActive");
9291
- if (media) {
9292
- mediaVersion++;
9293
- for (var key in media) exports.mediaState[key] = (mediaQueryDefaultActive == null ? void 0 : mediaQueryDefaultActive[key]) || false, mediaKeys.add(`$${key}`);
9294
- Object.assign(mediaQueryConfig, media), initState = __spreadValues({}, exports.mediaState), mediaKeysOrdered = Object.keys(media), setupMediaListeners();
9295
- }
9296
- };
9297
- function unlisten() {
9298
- dispose.forEach(function(cb) {
9299
- return cb();
9300
- }), dispose.clear();
9301
- }
9302
- var setupVersion = -1;
9303
- function setupMediaListeners() {
9304
- var _loop2 = function(key2) {
9305
- var str = mediaObjectToString(mediaQueryConfig[key2]), getMatch = function() {
9306
- return matchMedia$1(str);
9307
- }, match = getMatch();
9308
- if (!match) throw new Error("⚠️ No match");
9309
- match.addListener(update2), dispose.add(function() {
9310
- match.removeListener(update2);
9311
- });
9312
- function update2() {
9313
- var next = !!getMatch().matches;
9314
- next !== exports.mediaState[key2] && (exports.mediaState = __spreadProps(__spreadValues({}, exports.mediaState), {
9315
- [key2]: next
9316
- }), updateMediaListeners());
9317
- }
9318
- update2();
9319
- };
9320
- if (!process.env.IS_STATIC && setupVersion !== mediaVersion) {
9321
- setupVersion = mediaVersion, unlisten();
9322
- for (var key in mediaQueryConfig) _loop2(key);
9323
- }
9324
- }
9325
- var listeners = /* @__PURE__ */ new Set();
9326
- function updateMediaListeners() {
9327
- listeners.forEach(function(cb) {
9328
- return cb(exports.mediaState);
9329
- });
9330
- }
9331
- var States = /* @__PURE__ */ new WeakMap();
9332
- function setMediaShouldUpdate(ref, enabled, keys) {
9333
- var cur = States.get(ref);
9334
- (!cur || cur.enabled !== enabled || keys) && States.set(ref, __spreadProps(__spreadValues({}, cur), {
9335
- enabled,
9336
- keys
9337
- }));
9338
- }
9339
- function subscribe(subscriber) {
9340
- return listeners.add(subscriber), function() {
9341
- listeners.delete(subscriber);
9342
- };
9343
- }
9344
- function useMedia(componentContext, debug) {
9345
- var componentState = componentContext ? States.get(componentContext) : null, internalRef = React.useRef(null);
9346
- internalRef.current || (internalRef.current = {
9347
- keys: /* @__PURE__ */ new Set(),
9348
- lastState: exports.mediaState
9349
- }), internalRef.current.pendingState && (internalRef.current.lastState = internalRef.current.pendingState, internalRef.current.pendingState = void 0);
9350
- var {
9351
- keys
9352
- } = internalRef.current;
9353
- keys.size && keys.clear();
9354
- var state = React.useSyncExternalStore(subscribe, function() {
9355
- var curKeys2 = (componentState == null ? void 0 : componentState.keys) || keys, {
9356
- lastState,
9357
- pendingState
9358
- } = internalRef.current;
9359
- if (!curKeys2.size) return lastState;
9360
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
9361
- try {
9362
- for (var _iterator = curKeys2[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
9363
- var key = _step.value;
9364
- if (exports.mediaState[key] !== (pendingState || lastState)[key]) return false, (componentContext == null ? void 0 : componentContext.mediaEmit) ? (componentContext.mediaEmit(exports.mediaState), internalRef.current.pendingState = exports.mediaState, lastState) : (internalRef.current.lastState = exports.mediaState, exports.mediaState);
9365
- }
9366
- } catch (err) {
9367
- _didIteratorError = true, _iteratorError = err;
9368
- } finally {
9369
- try {
9370
- !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
9371
- } finally {
9372
- if (_didIteratorError) throw _iteratorError;
9373
- }
9374
- }
9375
- return lastState;
9376
- }, getServerSnapshot);
9377
- return new Proxy(state, {
9378
- get(_2, key) {
9379
- return !disableMediaTouch && typeof key == "string" && keys.add(key), Reflect.get(state, key);
9380
- }
9381
- });
9382
- }
9383
- var getServerSnapshot = function() {
9384
- return initState;
9385
- }, disableMediaTouch = false;
9386
- function _disableMediaTouch(val) {
9387
- disableMediaTouch = val;
9388
- }
9389
- function getMediaState(mediaGroups, layout) {
9390
- disableMediaTouch = true;
9391
- var res;
9392
- try {
9393
- res = Object.fromEntries([...mediaGroups].map(function(mediaKey) {
9394
- return [mediaKey, mediaKeyMatch(mediaKey, layout)];
9395
- }));
9396
- } finally {
9397
- disableMediaTouch = false;
9398
- }
9399
- return res;
9400
- }
9401
- var getMediaImportanceIfMoreImportant = function(mediaKey, key, styleState, isSizeMedia) {
9402
- var importance = isSizeMedia ? getMediaKeyImportance(mediaKey) : defaultMediaImportance, usedKeys = styleState.usedKeys;
9403
- return !usedKeys[key] || importance > usedKeys[key] ? importance : null;
9404
- };
9405
- function camelToHyphen(str) {
9406
- return str.replace(/[A-Z]/g, function(m) {
9407
- return `-${m.toLowerCase()}`;
9408
- }).toLowerCase();
9409
- }
9410
- var cache$2 = /* @__PURE__ */ new WeakMap();
9411
- function mediaObjectToString(query2, key) {
9412
- if (typeof query2 == "string") return query2;
9413
- if (cache$2.has(query2)) return cache$2.get(query2);
9414
- var res = Object.entries(query2).map(function(param) {
9415
- var [feature, value] = param;
9416
- return feature = camelToHyphen(feature), typeof value == "string" ? `(${feature}: ${value})` : (typeof value == "number" && /[height|width]$/.test(feature) && (value = `${value}px`), `(${feature}: ${value})`);
9417
- }).join(" and ");
9418
- return cache$2.set(query2, res), res;
9419
- }
9420
- function mediaKeyMatch(key, dimensions2) {
9421
- var mediaQueries = mediaQueryConfig[key], result = Object.keys(mediaQueries).every(function(query2) {
9422
- var expectedVal = +mediaQueries[query2], isMax = query2.startsWith("max"), isWidth = query2.endsWith("Width"), givenVal = dimensions2[isWidth ? "width" : "height"];
9423
- return isMax ? givenVal < expectedVal : givenVal > expectedVal;
9424
- });
9425
- return result;
9426
- }
9427
9453
  function getGroupPropParts(groupProp) {
9428
9454
  var mediaQueries = getMedia(), [_2, name, part3, part4] = groupProp.split("-"), pseudo, media = part3 in mediaQueries ? part3 : void 0;
9429
9455
  return media ? pseudo = part4 : pseudo = part3, {
@@ -9635,9 +9661,58 @@ var _loop = function(parent) {
9635
9661
  EXPANSIONS[parent] = EXPANSIONS[parent].map(function(k) {
9636
9662
  return `${prefix}${k}`;
9637
9663
  });
9664
+ }, num = function(v) {
9665
+ return Number.parseFloat(v) || 0;
9666
+ }, parseBoxShadowStr = function(s2) {
9667
+ return s2.split(/,(?![^(]*\))/).map(function(sh) {
9668
+ var p = sh.trim().split(/\s+/), i = p[0] === "inset" ? 1 : 0, o = {
9669
+ offsetX: num(p[i++]),
9670
+ offsetY: num(p[i++])
9671
+ };
9672
+ return p[0] === "inset" && (o.inset = true), p[i] && /^-?[\d.]/.test(p[i]) && (o.blurRadius = num(p[i++])), p[i] && /^-?[\d.]/.test(p[i]) && (o.spreadDistance = num(p[i++])), p[i] && (o.color = p.slice(i).join(" ")), o;
9673
+ });
9674
+ }, simpleFilters = /* @__PURE__ */ new Set(["brightness", "opacity", "contrast", "grayscale", "invert", "saturate", "sepia", "blur"]), parseFilterStr = function(s2) {
9675
+ var r = [], _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
9676
+ try {
9677
+ for (var _iterator = s2.matchAll(/(\w+)\(([^)]+)\)/g)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
9678
+ var [, fn, val] = _step.value, n = +val || 0;
9679
+ if (simpleFilters.has(fn)) r.push({
9680
+ [fn]: n
9681
+ });
9682
+ else if (fn === "hueRotate" || fn === "hue-rotate") r.push({
9683
+ hueRotate: val
9684
+ });
9685
+ else if (fn === "dropShadow" || fn === "drop-shadow") {
9686
+ var p = val.trim().split(/\s+/), ds = {
9687
+ offsetX: num(p[0]),
9688
+ offsetY: num(p[1])
9689
+ };
9690
+ p[2] && /^-?[\d.]/.test(p[2]) ? (ds.blurRadius = num(p[2]), p[3] && (ds.color = p.slice(3).join(" "))) : p[2] && (ds.color = p.slice(2).join(" ")), r.push({
9691
+ dropShadow: ds
9692
+ });
9693
+ }
9694
+ }
9695
+ } catch (err) {
9696
+ _didIteratorError = true, _iteratorError = err;
9697
+ } finally {
9698
+ try {
9699
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
9700
+ } finally {
9701
+ if (_didIteratorError) throw _iteratorError;
9702
+ }
9703
+ }
9704
+ return r;
9638
9705
  };
9639
9706
  function expandStyle(key, value) {
9640
9707
  if (isAndroid && key === "elevationAndroid") return [["elevation", value]];
9708
+ if (key === "boxShadow") {
9709
+ if (typeof value == "string") return [["boxShadow", parseBoxShadowStr(value)]];
9710
+ if (value && !Array.isArray(value)) return [["boxShadow", [value]]];
9711
+ }
9712
+ if (key === "filter") {
9713
+ if (typeof value == "string") return [["filter", parseFilterStr(value)]];
9714
+ if (value && !Array.isArray(value)) return [["filter", [value]]];
9715
+ }
9641
9716
  if (key in EXPANSIONS) return EXPANSIONS[key].map(function(key2) {
9642
9717
  return [key2, value];
9643
9718
  });
@@ -9646,18 +9721,17 @@ function expandStyle(key, value) {
9646
9721
  });
9647
9722
  if (key in webToNativeDynamicExpansion) return webToNativeDynamicExpansion[key](value);
9648
9723
  }
9649
- var all = ["Top", "Right", "Bottom", "Left"], horiz = ["Right", "Left"], vert = ["Top", "Bottom"], xy = ["X", "Y"], EXPANSIONS = __spreadValues({
9724
+ var all = ["Top", "Right", "Bottom", "Left"], horiz = ["Right", "Left"], vert = ["Top", "Bottom"], EXPANSIONS = {
9650
9725
  borderColor: ["TopColor", "RightColor", "BottomColor", "LeftColor"],
9651
9726
  borderRadius: ["TopLeftRadius", "TopRightRadius", "BottomRightRadius", "BottomLeftRadius"],
9652
9727
  borderWidth: ["TopWidth", "RightWidth", "BottomWidth", "LeftWidth"],
9653
9728
  margin: all,
9654
9729
  marginHorizontal: horiz,
9655
9730
  marginVertical: vert,
9656
- overscrollBehavior: xy,
9657
9731
  padding: all,
9658
9732
  paddingHorizontal: horiz,
9659
9733
  paddingVertical: vert
9660
- }, isWeb);
9734
+ };
9661
9735
  for (var parent in EXPANSIONS) _loop(parent);
9662
9736
  var cache$1 = /* @__PURE__ */ new WeakMap(), getVariantExtras = function(styleState) {
9663
9737
  if (cache$1.has(styleState)) return cache$1.get(styleState);
@@ -9797,14 +9871,47 @@ function _type_of$3(obj) {
9797
9871
  "@swc/helpers - typeof";
9798
9872
  return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
9799
9873
  }
9800
- var shorthandStringProps = {
9801
- boxShadow: 1,
9802
- border: 1,
9803
- borderTop: 1,
9804
- borderRight: 1,
9805
- borderBottom: 1,
9806
- borderLeft: 1,
9807
- background: 1
9874
+ var resolveTok = function(v, cat, sp, ss) {
9875
+ if (typeof v == "string" && v[0] === "$") {
9876
+ var r = getTokenForKey(cat, v, sp, ss);
9877
+ return cat === "size" ? r != null && +r || 0 : r != null ? String(r) : v;
9878
+ }
9879
+ return cat === "size" ? typeof v == "number" ? v : +v || 0 : v;
9880
+ }, boxShadowObjResolve = function(v, sp, ss) {
9881
+ return (Array.isArray(v) ? v : [v]).map(function(o) {
9882
+ return __spreadValues(__spreadValues(__spreadValues(__spreadProps(__spreadValues({}, o.inset && {
9883
+ inset: true
9884
+ }), {
9885
+ offsetX: resolveTok(o.offsetX, "size", sp, ss),
9886
+ offsetY: resolveTok(o.offsetY, "size", sp, ss)
9887
+ }), o.blurRadius != null && {
9888
+ blurRadius: resolveTok(o.blurRadius, "size", sp, ss)
9889
+ }), o.spreadDistance != null && {
9890
+ spreadDistance: resolveTok(o.spreadDistance, "size", sp, ss)
9891
+ }), o.color != null && {
9892
+ color: resolveTok(o.color, "color", sp, ss)
9893
+ });
9894
+ });
9895
+ }, filterObjResolve = function(v, sp, ss) {
9896
+ return (Array.isArray(v) ? v : [v]).map(function(o) {
9897
+ if ("blur" in o) return {
9898
+ blur: resolveTok(o.blur, "size", sp, ss)
9899
+ };
9900
+ if ("dropShadow" in o) {
9901
+ var ds = o.dropShadow;
9902
+ return {
9903
+ dropShadow: __spreadValues(__spreadValues({
9904
+ offsetX: resolveTok(ds.offsetX, "size", sp, ss),
9905
+ offsetY: resolveTok(ds.offsetY, "size", sp, ss)
9906
+ }, ds.blurRadius != null && {
9907
+ blurRadius: resolveTok(ds.blurRadius, "size", sp, ss)
9908
+ }), ds.color != null && {
9909
+ color: resolveTok(ds.color, "color", sp, ss)
9910
+ })
9911
+ };
9912
+ }
9913
+ return o;
9914
+ });
9808
9915
  }, propMapper = function(key, value, styleState, disabled, map) {
9809
9916
  if (disabled) return map(key, value);
9810
9917
  if (lastFontFamilyToken = null, !(!isAndroid && key === "elevationAndroid")) {
@@ -9833,13 +9940,13 @@ var shorthandStringProps = {
9833
9940
  }
9834
9941
  styleProps2.disableExpandShorthands || key in conf2.shorthands && (key = conf2.shorthands[key]);
9835
9942
  var originalValue = value;
9836
- if (value != null && (value[0] === "$" ? value = getTokenForKey(key, value, styleProps2, styleState) : (
9837
- /* Handle CSS shorthand strings with embedded $variables (e.g., boxShadow="0 0 10px $red") */
9838
- key in shorthandStringProps && typeof value == "string" && value.includes("$") ? value = value.replace(/\$[\w.-]+/g, function(token) {
9839
- var resolved = getTokenForKey("color", token, styleProps2, styleState);
9840
- return resolved != null ? String(resolved) : token;
9841
- }) : isVariable(value) ? value = resolveVariableValue(key, value, styleProps2.resolveValues) : isRemValue(value) && (value = resolveRem(value))
9842
- )), value != null) {
9943
+ if (value != null && (key === "boxShadow" && (typeof value > "u" ? "undefined" : _type_of$3(value)) === "object" ? value = boxShadowObjResolve(value, styleProps2, styleState) : key === "filter" && (typeof value > "u" ? "undefined" : _type_of$3(value)) === "object" ? value = filterObjResolve(value, styleProps2, styleState) : typeof value == "string" && value[0] === "$" ? value = getTokenForKey(key, value, styleProps2, styleState) : key === "boxShadow" && typeof value == "string" && value.includes("$") ? value = value.replace(/(\$[\w.-]+)/g, function(t2) {
9944
+ var cat = /^\$-?\d/.test(t2) ? "size" : "color", r = getTokenForKey(cat, t2, styleProps2, styleState);
9945
+ return r != null ? String(r) : t2;
9946
+ }) : key === "filter" && typeof value == "string" && value.includes("$") ? value = value.replace(/(\$[\w.-]+)/g, function(t2) {
9947
+ var cat = /^\$-?\d/.test(t2) ? "size" : "color", r = getTokenForKey(cat, t2, styleProps2, styleState);
9948
+ return r != null ? String(r) : t2;
9949
+ }) : isVariable(value) ? value = resolveVariableValue(key, value, styleProps2.resolveValues) : isRemValue(value) && (value = resolveRem(value))), value != null) {
9843
9950
  key === "fontFamily" && lastFontFamilyToken && (styleState.fontFamily = lastFontFamilyToken);
9844
9951
  var expanded = styleProps2.noExpand ? null : expandStyle(key, value);
9845
9952
  if (expanded) for (var max = expanded.length, i = 0; i < max; i++) {
@@ -10210,12 +10317,16 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
10210
10317
  }
10211
10318
  var mediaStyle1 = getSubStyle(styleState, key4, val2, true), importanceBump = 0;
10212
10319
  if (isThemeMedia) {
10213
- if (dynamicThemeAccess = true, isIos && getSetting("fastSchemeChange")) {
10320
+ if (isIos && getSetting("fastSchemeChange")) {
10214
10321
  var _styleState3;
10215
10322
  (_styleState3 = styleState).style || (_styleState3.style = {});
10216
- var scheme = mediaKeyShort, oppositeScheme = getOppositeScheme(mediaKeyShort), themeOriginalValues = styleOriginalValues.get(mediaStyle1);
10323
+ var scheme = mediaKeyShort, oppositeScheme = getOppositeScheme(mediaKeyShort), themeOriginalValues = styleOriginalValues.get(mediaStyle1), isCurrentScheme = themeName === scheme || themeName.startsWith(scheme);
10217
10324
  for (var subKey1 in mediaStyle1) {
10218
10325
  var _$val1 = extractValueFromDynamic(mediaStyle1[subKey1], scheme), existing = styleState.style[subKey1];
10326
+ if (!isColorStyleKey(subKey1)) {
10327
+ dynamicThemeAccess = true, isCurrentScheme ? mediaStyle1[subKey1] = _$val1 : delete mediaStyle1[subKey1];
10328
+ continue;
10329
+ }
10219
10330
  if (existing == null ? void 0 : existing.dynamic) existing.dynamic[scheme] = _$val1, mediaStyle1[subKey1] = existing;
10220
10331
  else {
10221
10332
  var oppositeVal = extractValueFromDynamic(existing, oppositeScheme);
@@ -10226,7 +10337,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
10226
10337
  }), mergeStyle(styleState, subKey1, mediaStyle1[subKey1], priority, false, themeOriginalValues == null ? void 0 : themeOriginalValues[subKey1]);
10227
10338
  }
10228
10339
  }
10229
- } else if (!(themeName === mediaKeyShort || themeName.startsWith(mediaKeyShort))) return;
10340
+ } else if (dynamicThemeAccess = true, !(themeName === mediaKeyShort || themeName.startsWith(mediaKeyShort))) return;
10230
10341
  } else if (isGroupMedia) {
10231
10342
  var _groupContext_groupName, _componentState_group, groupInfo = getGroupPropParts(mediaKeyShort), groupName = groupInfo.name, groupState = groupContext == null || (_groupContext_groupName = groupContext[groupName]) === null || _groupContext_groupName === void 0 ? void 0 : _groupContext_groupName.state, groupPseudoKey = groupInfo.pseudo, groupMediaKey = groupInfo.media;
10232
10343
  if (!groupState) {
@@ -10285,9 +10396,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
10285
10396
  inlineWhenUnflattened,
10286
10397
  parentStaticConfig,
10287
10398
  acceptsClassName
10288
- } = staticConfig, viewProps = {}, mediaState = styleProps2.mediaState || exports.mediaState, shouldDoClasses = acceptsClassName && isWeb, rulesToInsert = void 0, classNames = {}, pseudos = null;
10289
- props.space;
10290
- var hasMedia = false, dynamicThemeAccess, pseudoGroups, mediaGroups;
10399
+ } = staticConfig, viewProps = {}, mediaState = styleProps2.mediaState || exports.mediaState, shouldDoClasses = acceptsClassName && isWeb, rulesToInsert = void 0, classNames = {}, pseudos = null, hasMedia = false, dynamicThemeAccess, pseudoGroups, mediaGroups;
10291
10400
  props.className || "";
10292
10401
  var mediaStylesSeen = 0, validStyles$1 = staticConfig.validStyles || (staticConfig.isText || staticConfig.isInput ? stylePropsText : validStyles);
10293
10402
  var styleState = {