@multiplatform.one/forms 7.88.7 → 7.88.9

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.
@@ -466,7 +466,9 @@ function Button({
466
466
  });
467
467
  const tierPaint = tier ? (0, import_theme3.controlTierPaint)(tier, darkScheme, elevatedGround) : void 0;
468
468
  const tierDisabled = tier && disabledState.style !== "dimWhole" ? (0, import_theme3.controlTierDisabled)(tier) : void 0;
469
- const hostScoped = fragment => Object.fromEntries(Object.entries(fragment).map(([key, value]) => [key, typeof value === "string" && value.startsWith("$") ? parentScopeTheme[value.slice(1)]?.val ?? value : value]));
469
+ const pageTheme = parentScopeTheme;
470
+ const hostTheme = (mediaPlate ? (0, import_tamagui.getConfig)().themes.dark : void 0) ?? pageTheme;
471
+ const hostScoped = fragment => Object.fromEntries(Object.entries(fragment).map(([key, value]) => [key, typeof value === "string" && value.startsWith("$") ? hostTheme[value.slice(1)]?.val ?? value : value]));
470
472
  const hostWashVar = token => `--mp-host-${token}`;
471
473
  const hostWash = fragment => import_tamagui.isWeb ? Object.fromEntries(Object.entries(fragment).map(([key, value]) => [key, typeof value === "string" && value.startsWith("$") ? `var(${hostWashVar(value.slice(1))})` : value])) : hostScoped(fragment);
472
474
  const washOnHost = Boolean(unavailable && activeThemeName && import_theme3.solidPaletteThemes.has(activeThemeName));
@@ -520,6 +522,10 @@ function Button({
520
522
  const isSelected = selected ?? (ariaPressedProp === true || ariaPressedProp === "true" ? true : void 0);
521
523
  const selectedFill = Boolean(isSelected) && !unavailable && !mediaPlate && !fieldGlyph;
522
524
  const barInk = accentInk && chromeless && !selectedFill && (!unavailable || frameless) && !confirmPlate ? labelled ? glyphTint.label : glyphTint.glyph : null;
525
+ const barInkPaint = import_tamagui.isWeb && barInk && !mediaPlate && pageTheme.identityInk?.val === barInk ? hostWash({
526
+ color: "$identityInk"
527
+ }).color : barInk;
528
+ const barGlyphInk = barInk && import_tamagui.isWeb && props.color == null ? "currentColor" : barInk;
523
529
  const inlineGlyph = iconButton && inline === true && !nested;
524
530
  const barGlyph = (iconButton || mediaPlate || confirmPlate) && !nested || labelled && chromeless && accentInk === true && edge === "start";
525
531
  const labelLine = labelLinePx(knobProps.body.fontFamily);
@@ -529,7 +535,7 @@ function Button({
529
535
  const framedCircle = iconOnly && Boolean(circular) && !nested && !mediaPlate && !confirmPlate;
530
536
  const accentFillHex = confirmPlate ? accentSolidFill(hostThemeName) : null;
531
537
  const confirmInk = accentFillHex && (0, import_theme3.contrastRatio)((0, import_theme3.relativeLuminance)("#ffffff"), (0, import_theme3.relativeLuminance)(accentFillHex)) >= import_theme3.GLYPH_CONTRAST_FLOOR ? "#ffffff" : "$color";
532
- const plateInk = unavailable || barInk || outlinedInk ? void 0 : mediaPlate || iconButton && groupGround === "media" ? "$color12" : confirmPlate ? confirmInk : framedCircle && !activeThemeName ? hostScoped({
538
+ const plateInk = unavailable || barInk || outlinedInk ? void 0 : mediaPlate || iconButton && groupGround === "media" ? "$color12" : confirmPlate ? confirmInk : framedCircle && !activeThemeName ? hostWash({
533
539
  color: "$color12"
534
540
  }).color : void 0;
535
541
  const framedCirclePx = touch && typeof sizeProp !== "number" ? Math.max(sizeTokenPx(resolvedSize), import_theme3.MIN_PRESS_TARGET) : sizeTokenPx(resolvedSize);
@@ -543,7 +549,7 @@ function Button({
543
549
  // it up to the same floor.
544
550
  Math.max(recipe.iconSize, Math.min(glyphFloor, recipe.height - 8)) : recipe.iconSize;
545
551
  const barGlyphFloor = barGlyph && !framedCircle && !inlineGlyph && !nested;
546
- const glyph = barGlyph || inlineGlyph || framedCircle ? withGlyphWeight(icon, iconSize, resolvedGlyphWeight, barGlyphFloor, barInk) : icon;
552
+ const glyph = barGlyph || inlineGlyph || framedCircle ? withGlyphWeight(icon, iconSize, resolvedGlyphWeight, barGlyphFloor, barGlyphInk) : icon;
547
553
  const labelBoxPx = nested ? knobProps.nestedControl.px : recipe.height;
548
554
  const labelMaxFontScale = Math.min((0, import_theme3.maxFontScaleToFit)(labelBoxPx, nested ? (0, import_tamagui.getFontSize)(knobProps.label.fontSize) : recipe.fontSize, import_theme3.dynamicTypeFit.controlLabelFill), labelLine === void 0 ? Number.POSITIVE_INFINITY : (0, import_theme3.maxFontScaleToFit)(labelBoxPx, labelLine, 1));
549
555
  const renderLabelText = (label, key) => /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.SizableText, {
@@ -564,8 +570,8 @@ function Button({
564
570
  } : outlinedInk ? {
565
571
  color: outlinedInk
566
572
  } : void 0),
567
- ...(barInk ? {
568
- color: barInk
573
+ ...(barInkPaint ? {
574
+ color: barInkPaint
569
575
  } : void 0),
570
576
  ...(unavailable ? disabledText : void 0),
571
577
  fontWeight: knobProps.body.fontWeight,
@@ -599,7 +605,7 @@ function Button({
599
605
  color: nativeIconColor
600
606
  })
601
607
  }) : null;
602
- const glyphAfter = iconAfter && (barGlyph || inlineGlyph || framedCircle) ? withGlyphWeight(iconAfter, iconSize, resolvedGlyphWeight, barGlyphFloor, barInk) : iconAfter;
608
+ const glyphAfter = iconAfter && (barGlyph || inlineGlyph || framedCircle) ? withGlyphWeight(iconAfter, iconSize, resolvedGlyphWeight, barGlyphFloor, barGlyphInk) : iconAfter;
603
609
  const iconAfterElement = glyphAfter ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
604
610
  flexShrink: 0,
605
611
  children: import_tamagui.isWeb ? normalizeButtonIcon(glyphAfter, iconSize, webGlyphInk) : /* @__PURE__ */(0, import_jsx_runtime.jsx)(NativeButtonIcon, {
@@ -646,14 +652,14 @@ function Button({
646
652
  const restFill = selectedFill ? outlined ? "$background" : "$backgroundPress" : tierPaint?.rest;
647
653
  const plainTier = tier === "plain";
648
654
  const glyphState = iconButton && !selectedFill;
649
- const iconHover = glyphState ? import_tamagui.isWeb ? hostScoped({
655
+ const iconHover = glyphState ? import_tamagui.isWeb ? hostWash({
650
656
  backgroundColor: "$backgroundHover"
651
657
  }) : {
652
658
  backgroundColor: "transparent"
653
659
  } : mediaPlate ? {
654
660
  backgroundColor: "$shadow5"
655
661
  } : void 0;
656
- const iconPress = glyphState ? import_tamagui.isWeb ? hostScoped({
662
+ const iconPress = glyphState ? import_tamagui.isWeb ? hostWash({
657
663
  backgroundColor: "$backgroundPress"
658
664
  }) : GlassView || glassGroup ? {
659
665
  backgroundColor: "transparent"
@@ -729,8 +735,8 @@ function Button({
729
735
  ...(outlinedInk ? {
730
736
  color: outlinedInk
731
737
  } : void 0),
732
- ...(barInk ? {
733
- color: barInk
738
+ ...(barInkPaint ? {
739
+ color: barInkPaint
734
740
  } : void 0),
735
741
  ...(plateInk ? {
736
742
  color: plateInk
@@ -777,9 +783,9 @@ function Button({
777
783
  },
778
784
  focusVisibleStyle: (0, import_theme3.ensureFocusVisibleRing)({
779
785
  ...control.focusVisibleKnobProps,
780
- ...(pageOutlineColor ? {
781
- outlineColor: pageOutlineColor
782
- } : void 0)
786
+ ...(pageOutlineColor ? hostWash({
787
+ outlineColor: "$outlineColor"
788
+ }) : void 0)
783
789
  }),
784
790
  onPress: handlePress,
785
791
  ...(import_tamagui.isWeb ? {
@@ -895,8 +901,18 @@ function Button({
895
901
  color: hostAccentInk
896
902
  }, {
897
903
  color: textColor
904
+ }, {
905
+ outlineColor: "$outlineColor"
906
+ }, {
907
+ backgroundColor: "$backgroundHover"
908
+ }, {
909
+ backgroundColor: "$backgroundPress"
910
+ }, {
911
+ color: "$color12"
912
+ }, {
913
+ color: "$identityInk"
898
914
  }].flatMap(fragment => Object.values(fragment)).filter(value => typeof value === "string" && value.startsWith("$")).map(value => [hostWashVar(value.slice(1)), `var(--${value.slice(1)})`]));
899
- const hostedButton = import_tamagui.isWeb && activeThemeName && import_theme3.solidPaletteThemes.has(activeThemeName) ? /* @__PURE__ */(0, import_jsx_runtime.jsx)("span", {
915
+ const hostedButton = import_tamagui.isWeb ? /* @__PURE__ */(0, import_jsx_runtime.jsx)("span", {
900
916
  style: {
901
917
  display: "contents",
902
918
  ...hostWashScope
@@ -361,8 +361,8 @@ function Button(param) {
361
361
  paddingHorizontal: paddingHorizontalProp,
362
362
  ...props
363
363
  } = param;
364
- var _ref, _ref1, _ref2, _ref3, _ref4, _props_color, _ref5, _ref6, _ref7, _props_color1, _props_id;
365
- var _parentScopeTheme_outlineColor;
364
+ var _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _props_color, _ref6, _ref7, _ref8, _props_color1, _props_id;
365
+ var _parentScopeTheme_outlineColor, _pageTheme_identityInk;
366
366
  var {
367
367
  resolvedForm: formFromHook
368
368
  } = (0, import_utils.useFormField)({
@@ -513,12 +513,14 @@ function Button(param) {
513
513
  });
514
514
  var tierPaint = tier ? (0, import_theme3.controlTierPaint)(tier, darkScheme, elevatedGround) : void 0;
515
515
  var tierDisabled = tier && disabledState.style !== "dimWhole" ? (0, import_theme3.controlTierDisabled)(tier) : void 0;
516
+ var pageTheme = parentScopeTheme;
517
+ var hostTheme = (_ref1 = mediaPlate ? (0, import_tamagui.getConfig)().themes.dark : void 0) !== null && _ref1 !== void 0 ? _ref1 : pageTheme;
516
518
  var hostScoped = function hostScoped2(fragment) {
517
519
  return Object.fromEntries(Object.entries(fragment).map(function (param2) {
518
520
  var [key, value] = param2;
519
- var _ref8;
520
- var _parentScopeTheme_value_slice;
521
- return [key, typeof value === "string" && value.startsWith("$") ? (_ref8 = (_parentScopeTheme_value_slice = parentScopeTheme[value.slice(1)]) === null || _parentScopeTheme_value_slice === void 0 ? void 0 : _parentScopeTheme_value_slice.val) !== null && _ref8 !== void 0 ? _ref8 : value : value];
521
+ var _ref9;
522
+ var _hostTheme_value_slice;
523
+ return [key, typeof value === "string" && value.startsWith("$") ? (_ref9 = (_hostTheme_value_slice = hostTheme[value.slice(1)]) === null || _hostTheme_value_slice === void 0 ? void 0 : _hostTheme_value_slice.val) !== null && _ref9 !== void 0 ? _ref9 : value : value];
522
524
  }));
523
525
  };
524
526
  var hostWashVar = function hostWashVar2(token) {
@@ -585,6 +587,10 @@ function Button(param) {
585
587
  var isSelected = selected !== null && selected !== void 0 ? selected : ariaPressedProp === true || ariaPressedProp === "true" ? true : void 0;
586
588
  var selectedFill = Boolean(isSelected) && !unavailable && !mediaPlate && !fieldGlyph;
587
589
  var barInk = accentInk && chromeless && !selectedFill && (!unavailable || frameless) && !confirmPlate ? labelled ? glyphTint.label : glyphTint.glyph : null;
590
+ var barInkPaint = import_tamagui.isWeb && barInk && !mediaPlate && ((_pageTheme_identityInk = pageTheme.identityInk) === null || _pageTheme_identityInk === void 0 ? void 0 : _pageTheme_identityInk.val) === barInk ? hostWash({
591
+ color: "$identityInk"
592
+ }).color : barInk;
593
+ var barGlyphInk = barInk && import_tamagui.isWeb && props.color == null ? "currentColor" : barInk;
588
594
  var inlineGlyph = iconButton && inline === true && !nested;
589
595
  var barGlyph = (iconButton || mediaPlate || confirmPlate) && !nested || labelled && chromeless && accentInk === true && edge === "start";
590
596
  var labelLine = labelLinePx(knobProps.body.fontFamily);
@@ -594,7 +600,7 @@ function Button(param) {
594
600
  var framedCircle = iconOnly && Boolean(circular) && !nested && !mediaPlate && !confirmPlate;
595
601
  var accentFillHex = confirmPlate ? accentSolidFill(hostThemeName) : null;
596
602
  var confirmInk = accentFillHex && (0, import_theme3.contrastRatio)((0, import_theme3.relativeLuminance)("#ffffff"), (0, import_theme3.relativeLuminance)(accentFillHex)) >= import_theme3.GLYPH_CONTRAST_FLOOR ? "#ffffff" : "$color";
597
- var plateInk = unavailable || barInk || outlinedInk ? void 0 : mediaPlate || iconButton && groupGround === "media" ? "$color12" : confirmPlate ? confirmInk : framedCircle && !activeThemeName ? hostScoped({
603
+ var plateInk = unavailable || barInk || outlinedInk ? void 0 : mediaPlate || iconButton && groupGround === "media" ? "$color12" : confirmPlate ? confirmInk : framedCircle && !activeThemeName ? hostWash({
598
604
  color: "$color12"
599
605
  }).color : void 0;
600
606
  var framedCirclePx = touch && typeof sizeProp !== "number" ? Math.max(sizeTokenPx(resolvedSize), import_theme3.MIN_PRESS_TARGET) : sizeTokenPx(resolvedSize);
@@ -608,7 +614,7 @@ function Button(param) {
608
614
  // it up to the same floor.
609
615
  Math.max(recipe.iconSize, Math.min(glyphFloor, recipe.height - 8)) : recipe.iconSize;
610
616
  var barGlyphFloor = barGlyph && !framedCircle && !inlineGlyph && !nested;
611
- var glyph = barGlyph || inlineGlyph || framedCircle ? withGlyphWeight(icon, iconSize, resolvedGlyphWeight, barGlyphFloor, barInk) : icon;
617
+ var glyph = barGlyph || inlineGlyph || framedCircle ? withGlyphWeight(icon, iconSize, resolvedGlyphWeight, barGlyphFloor, barGlyphInk) : icon;
612
618
  var labelBoxPx = nested ? knobProps.nestedControl.px : recipe.height;
613
619
  var labelMaxFontScale = Math.min((0, import_theme3.maxFontScaleToFit)(labelBoxPx, nested ? (0, import_tamagui.getFontSize)(knobProps.label.fontSize) : recipe.fontSize, import_theme3.dynamicTypeFit.controlLabelFill), labelLine === void 0 ? Number.POSITIVE_INFINITY : (0, import_theme3.maxFontScaleToFit)(labelBoxPx, labelLine, 1));
614
620
  var renderLabelText = function renderLabelText2(label, key) {
@@ -630,8 +636,8 @@ function Button(param) {
630
636
  } : outlinedInk ? {
631
637
  color: outlinedInk
632
638
  } : void 0),
633
- ...(barInk ? {
634
- color: barInk
639
+ ...(barInkPaint ? {
640
+ color: barInkPaint
635
641
  } : void 0),
636
642
  // LC-40: on the washed disabled chrome the label leaves the on-fill
637
643
  // foreground for the wash's AA ink (keepLabel keeps >=4.5:1).
@@ -650,10 +656,10 @@ function Button(param) {
650
656
  var labelContent = isBareTextChild(resolvedChildren) ? renderLabelText(resolvedChildren) : (flattenedChildren === null || flattenedChildren === void 0 ? void 0 : flattenedChildren.some(isBareTextChild)) ? wrapBareTextChildren(flattenedChildren, renderLabelText) : resolvedChildren;
651
657
  var hasIcon = icon || iconAfter || loading;
652
658
  var unavailableInk = unavailable ? disabledText.color : void 0;
653
- var nativeIconColor = (_ref1 = (_ref2 = (_ref3 = (_ref4 = (_props_color = props.color) !== null && _props_color !== void 0 ? _props_color : unavailableInk) !== null && _ref4 !== void 0 ? _ref4 : barInk) !== null && _ref3 !== void 0 ? _ref3 : plateInk) !== null && _ref2 !== void 0 ? _ref2 : textColor ? outlinedOnHost ? hostWash({
659
+ var nativeIconColor = (_ref2 = (_ref3 = (_ref4 = (_ref5 = (_props_color = props.color) !== null && _props_color !== void 0 ? _props_color : unavailableInk) !== null && _ref5 !== void 0 ? _ref5 : barInk) !== null && _ref4 !== void 0 ? _ref4 : plateInk) !== null && _ref3 !== void 0 ? _ref3 : textColor ? outlinedOnHost ? hostWash({
654
660
  color: textColor
655
- }).color : textColor : outlinedInk) !== null && _ref1 !== void 0 ? _ref1 : "$color";
656
- var webInk = (_ref5 = (_ref6 = (_ref7 = (_props_color1 = props.color) !== null && _props_color1 !== void 0 ? _props_color1 : unavailableInk) !== null && _ref7 !== void 0 ? _ref7 : barInk) !== null && _ref6 !== void 0 ? _ref6 : plateInk) !== null && _ref5 !== void 0 ? _ref5 : outlinedInk;
661
+ }).color : textColor : outlinedInk) !== null && _ref2 !== void 0 ? _ref2 : "$color";
662
+ var webInk = (_ref6 = (_ref7 = (_ref8 = (_props_color1 = props.color) !== null && _props_color1 !== void 0 ? _props_color1 : unavailableInk) !== null && _ref8 !== void 0 ? _ref8 : barInk) !== null && _ref7 !== void 0 ? _ref7 : plateInk) !== null && _ref6 !== void 0 ? _ref6 : outlinedInk;
657
663
  var webGlyphInk = import_tamagui.isWeb && webInk != null ? "currentColor" : void 0;
658
664
  var iconElement = loading ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
659
665
  flexShrink: 0,
@@ -672,7 +678,7 @@ function Button(param) {
672
678
  color: nativeIconColor
673
679
  })
674
680
  }) : null;
675
- var glyphAfter = iconAfter && (barGlyph || inlineGlyph || framedCircle) ? withGlyphWeight(iconAfter, iconSize, resolvedGlyphWeight, barGlyphFloor, barInk) : iconAfter;
681
+ var glyphAfter = iconAfter && (barGlyph || inlineGlyph || framedCircle) ? withGlyphWeight(iconAfter, iconSize, resolvedGlyphWeight, barGlyphFloor, barGlyphInk) : iconAfter;
676
682
  var iconAfterElement = glyphAfter ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
677
683
  flexShrink: 0,
678
684
  children: import_tamagui.isWeb ? normalizeButtonIcon(glyphAfter, iconSize, webGlyphInk) : /* @__PURE__ */(0, import_jsx_runtime.jsx)(NativeButtonIcon, {
@@ -719,14 +725,14 @@ function Button(param) {
719
725
  var restFill = selectedFill ? outlined ? "$background" : "$backgroundPress" : tierPaint === null || tierPaint === void 0 ? void 0 : tierPaint.rest;
720
726
  var plainTier = tier === "plain";
721
727
  var glyphState = iconButton && !selectedFill;
722
- var iconHover = glyphState ? import_tamagui.isWeb ? hostScoped({
728
+ var iconHover = glyphState ? import_tamagui.isWeb ? hostWash({
723
729
  backgroundColor: "$backgroundHover"
724
730
  }) : {
725
731
  backgroundColor: "transparent"
726
732
  } : mediaPlate ? {
727
733
  backgroundColor: "$shadow5"
728
734
  } : void 0;
729
- var iconPress = glyphState ? import_tamagui.isWeb ? hostScoped({
735
+ var iconPress = glyphState ? import_tamagui.isWeb ? hostWash({
730
736
  backgroundColor: "$backgroundPress"
731
737
  }) : GlassView || glassGroup ? {
732
738
  backgroundColor: "transparent"
@@ -820,8 +826,8 @@ function Button(param) {
820
826
  ...(outlinedInk ? {
821
827
  color: outlinedInk
822
828
  } : void 0),
823
- ...(barInk ? {
824
- color: barInk
829
+ ...(barInkPaint ? {
830
+ color: barInkPaint
825
831
  } : void 0),
826
832
  ...(plateInk ? {
827
833
  color: plateInk
@@ -877,15 +883,15 @@ function Button(param) {
877
883
  },
878
884
  // DG-A11Y-01 / LC-71: house keyboard ring (≥2px `$outlineColor`) on the
879
885
  // whole painted frame. Rest and mouse-focus paint none. Parent-scope
880
- // `$outlineColor` literal: intent buttons re-theme the frame, and those
886
+ // `$outlineColor`: intent buttons re-theme the frame, and those
881
887
  // sub-themes derive a ring for their own inverted surfaces — invisible
882
888
  // on the page the ring actually draws on (measured 1.17:1 on the accent
883
889
  // pagination button).
884
890
  focusVisibleStyle: (0, import_theme3.ensureFocusVisibleRing)({
885
891
  ...control.focusVisibleKnobProps,
886
- ...(pageOutlineColor ? {
887
- outlineColor: pageOutlineColor
888
- } : void 0)
892
+ ...(pageOutlineColor ? hostWash({
893
+ outlineColor: "$outlineColor"
894
+ }) : void 0)
889
895
  }),
890
896
  onPress: handlePress,
891
897
  ...(import_tamagui.isWeb ? {
@@ -1012,6 +1018,16 @@ function Button(param) {
1012
1018
  color: hostAccentInk
1013
1019
  }, {
1014
1020
  color: textColor
1021
+ }, {
1022
+ outlineColor: "$outlineColor"
1023
+ }, {
1024
+ backgroundColor: "$backgroundHover"
1025
+ }, {
1026
+ backgroundColor: "$backgroundPress"
1027
+ }, {
1028
+ color: "$color12"
1029
+ }, {
1030
+ color: "$identityInk"
1015
1031
  }].flatMap(function (fragment) {
1016
1032
  return Object.values(fragment);
1017
1033
  }).filter(function (value) {
@@ -1019,7 +1035,7 @@ function Button(param) {
1019
1035
  }).map(function (value) {
1020
1036
  return [hostWashVar(value.slice(1)), `var(--${value.slice(1)})`];
1021
1037
  }));
1022
- var hostedButton = import_tamagui.isWeb && activeThemeName && import_theme3.solidPaletteThemes.has(activeThemeName) ? /* @__PURE__ */(0, import_jsx_runtime.jsx)("span", {
1038
+ var hostedButton = import_tamagui.isWeb ? /* @__PURE__ */(0, import_jsx_runtime.jsx)("span", {
1023
1039
  style: {
1024
1040
  display: "contents",
1025
1041
  ...hostWashScope