@expo/ui 58.0.18 → 58.0.20

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.
Files changed (50) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/android/build.gradle +2 -2
  3. package/build/community/slider/Slider.android.js +12 -2
  4. package/build/community/slider/Slider.android.js.map +1 -1
  5. package/build/community/slider/Slider.ios.js +10 -3
  6. package/build/community/slider/Slider.ios.js.map +1 -1
  7. package/build/community/slider/Slider.js +3 -1
  8. package/build/community/slider/Slider.js.map +1 -1
  9. package/build/community/slider/types.d.ts +14 -0
  10. package/build/community/slider/types.js.map +1 -1
  11. package/build/swift-ui/Host/index.d.ts +11 -1
  12. package/build/swift-ui/Host/index.js.map +1 -1
  13. package/ios/HostView.swift +20 -1
  14. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.18/expo.modules.ui-58.0.18.module → 58.0.20/expo.modules.ui-58.0.20.module} +7 -7
  15. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.20/expo.modules.ui-58.0.20.module.md5 +1 -0
  16. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.20/expo.modules.ui-58.0.20.module.sha1 +1 -0
  17. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.20/expo.modules.ui-58.0.20.module.sha256 +1 -0
  18. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.20/expo.modules.ui-58.0.20.module.sha512 +1 -0
  19. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.18/expo.modules.ui-58.0.18.pom → 58.0.20/expo.modules.ui-58.0.20.pom} +1 -1
  20. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.20/expo.modules.ui-58.0.20.pom.md5 +1 -0
  21. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.20/expo.modules.ui-58.0.20.pom.sha1 +1 -0
  22. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.20/expo.modules.ui-58.0.20.pom.sha256 +1 -0
  23. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.20/expo.modules.ui-58.0.20.pom.sha512 +1 -0
  24. package/package.json +1 -2
  25. package/spm.config.json +0 -1
  26. package/src/community/slider/Slider.android.tsx +11 -0
  27. package/src/community/slider/Slider.ios.tsx +16 -1
  28. package/src/community/slider/Slider.tsx +4 -0
  29. package/src/community/slider/types.tsx +14 -0
  30. package/src/swift-ui/Host/index.tsx +12 -1
  31. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.18/expo.modules.ui-58.0.18.module.md5 +0 -1
  32. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.18/expo.modules.ui-58.0.18.module.sha1 +0 -1
  33. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.18/expo.modules.ui-58.0.18.module.sha256 +0 -1
  34. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.18/expo.modules.ui-58.0.18.module.sha512 +0 -1
  35. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.18/expo.modules.ui-58.0.18.pom.md5 +0 -1
  36. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.18/expo.modules.ui-58.0.18.pom.sha1 +0 -1
  37. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.18/expo.modules.ui-58.0.18.pom.sha256 +0 -1
  38. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.18/expo.modules.ui-58.0.18.pom.sha512 +0 -1
  39. package/prebuilds/output/debug/xcframeworks/ExpoUI.tar.gz +0 -0
  40. package/prebuilds/output/release/xcframeworks/ExpoUI.tar.gz +0 -0
  41. /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.18/expo.modules.ui-58.0.18-sources.jar → 58.0.20/expo.modules.ui-58.0.20-sources.jar} +0 -0
  42. /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.18/expo.modules.ui-58.0.18-sources.jar.md5 → 58.0.20/expo.modules.ui-58.0.20-sources.jar.md5} +0 -0
  43. /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.18/expo.modules.ui-58.0.18-sources.jar.sha1 → 58.0.20/expo.modules.ui-58.0.20-sources.jar.sha1} +0 -0
  44. /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.18/expo.modules.ui-58.0.18-sources.jar.sha256 → 58.0.20/expo.modules.ui-58.0.20-sources.jar.sha256} +0 -0
  45. /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.18/expo.modules.ui-58.0.18-sources.jar.sha512 → 58.0.20/expo.modules.ui-58.0.20-sources.jar.sha512} +0 -0
  46. /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.18/expo.modules.ui-58.0.18.aar → 58.0.20/expo.modules.ui-58.0.20.aar} +0 -0
  47. /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.18/expo.modules.ui-58.0.18.aar.md5 → 58.0.20/expo.modules.ui-58.0.20.aar.md5} +0 -0
  48. /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.18/expo.modules.ui-58.0.18.aar.sha1 → 58.0.20/expo.modules.ui-58.0.20.aar.sha1} +0 -0
  49. /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.18/expo.modules.ui-58.0.18.aar.sha256 → 58.0.20/expo.modules.ui-58.0.20.aar.sha256} +0 -0
  50. /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.18/expo.modules.ui-58.0.18.aar.sha512 → 58.0.20/expo.modules.ui-58.0.20.aar.sha512} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 58.0.20
4
+
5
+ ### Patch Changes
6
+
7
+ - [iOS] Add an `alignment` prop to the SwiftUI `Host`. It sets where the content sits in the host when their sizes differ. A `matchContents` host anchored to the trailing edge of its row can now keep that edge still while its content animates to a new width. ([#51617](https://github.com/expo/expo/pull/51617) by [@maxlapides](https://github.com/maxlapides))
8
+
9
+ ## 58.0.19
10
+
11
+ ### Patch Changes
12
+
13
+ - Add `accessibilityLabel`, `accessibilityHint` (iOS) and `testID` to the community `Slider`. The drop-in dropped them, so VoiceOver and TalkBack announced a slider by its value alone and end-to-end tools could not find it. iOS applies them as SwiftUI accessibility modifiers, Android as the `semantics` and `testID` modifiers, and web as `aria-label` and `data-testid`. ([#51632](https://github.com/expo/expo/pull/51632) by [@brentvatne](https://github.com/brentvatne))
14
+ - [iOS] Stop shipping a precompiled iOS framework. `ArrangementView` and `onHingeChange` now work on iOS 27.1 without `buildFromSource` when the app is built with Xcode 27.1 or later. ([#51636](https://github.com/expo/expo/pull/51636) by [@brentvatne](https://github.com/brentvatne))
15
+
3
16
  ## 58.0.18
4
17
 
5
18
  ### Patch Changes
@@ -12,13 +12,13 @@ apply plugin: 'expo-module-gradle-plugin'
12
12
  apply plugin: 'org.jetbrains.kotlin.plugin.compose'
13
13
 
14
14
  group = 'expo.modules.ui'
15
- version = '58.0.18'
15
+ version = '58.0.20'
16
16
 
17
17
  android {
18
18
  namespace "expo.modules.ui"
19
19
  defaultConfig {
20
20
  versionCode 1
21
- versionName "58.0.18"
21
+ versionName "58.0.20"
22
22
  testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
23
23
  }
24
24
  buildFeatures {
@@ -1,11 +1,12 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Host } from '../../jetpack-compose/Host';
3
3
  import { Slider as ComposeSlider } from '../../jetpack-compose/Slider';
4
+ import { semantics, testID as testIDModifier } from '../../jetpack-compose/modifiers';
4
5
  /**
5
6
  * A drop-in replacement for `@react-native-community/slider` on Android.
6
7
  * Renders a Material 3 `Slider` wrapped in a Host.
7
8
  */ export function Slider(props) {
8
- const { value, minimumValue, maximumValue, lowerLimit, upperLimit, step, disabled, inverted, minimumTrackTintColor, maximumTrackTintColor, thumbTintColor, onValueChange, style } = props;
9
+ const { value, minimumValue, maximumValue, lowerLimit, upperLimit, step, disabled, inverted, minimumTrackTintColor, maximumTrackTintColor, thumbTintColor, onValueChange, style, accessibilityLabel, testID } = props;
9
10
  const min = minimumValue ?? 0;
10
11
  const max = maximumValue ?? 1;
11
12
  const steps = step && step > 0 ? Math.max(0, Math.round((max - min) / step) - 1) : 0;
@@ -24,6 +25,14 @@ import { Slider as ComposeSlider } from '../../jetpack-compose/Slider';
24
25
  inactiveTrackColor: maximumTrackTintColor,
25
26
  thumbColor: thumbTintColor
26
27
  };
28
+ // `accessibilityHint` has no Compose semantics counterpart, so it is iOS-only.
29
+ const modifiers = [];
30
+ if (accessibilityLabel !== undefined) {
31
+ modifiers.push(semantics({
32
+ contentDescription: accessibilityLabel
33
+ }));
34
+ }
35
+ if (testID !== undefined) modifiers.push(testIDModifier(testID));
27
36
  return /*#__PURE__*/ _jsx(Host, {
28
37
  matchContents: {
29
38
  vertical: true
@@ -38,7 +47,8 @@ import { Slider as ComposeSlider } from '../../jetpack-compose/Slider';
38
47
  steps: steps,
39
48
  enabled: disabled === undefined ? undefined : !disabled,
40
49
  colors: colors,
41
- onValueChange: onValueChange
50
+ onValueChange: onValueChange,
51
+ modifiers: modifiers.length > 0 ? modifiers : undefined
42
52
  })
43
53
  });
44
54
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["community/slider/Slider.android.tsx"],"sourcesContent":[null],"names":["Host","Slider","ComposeSlider","props","value","minimumValue","maximumValue","lowerLimit","upperLimit","step","disabled","inverted","minimumTrackTintColor","maximumTrackTintColor","thumbTintColor","onValueChange","style","min","max","steps","Math","round","hostStyle","transform","scaleX","colors","activeTrackColor","inactiveTrackColor","thumbColor","matchContents","vertical","enabled","undefined"],"mappings":";AAAA,SAASA,IAAI,QAAQ,6BAA6B;AAClD,SAASC,UAAUC,aAAa,QAAQ,+BAA+B;AAGvE;;;CAGC,GACD,OAAO,SAASD,OAAOE,KAAkB;IACvC,MAAM,EACJC,KAAK,EACLC,YAAY,EACZC,YAAY,EACZC,UAAU,EACVC,UAAU,EACVC,IAAI,EACJC,QAAQ,EACRC,QAAQ,EACRC,qBAAqB,EACrBC,qBAAqB,EACrBC,cAAc,EACdC,aAAa,EACbC,KAAK,EACN,GAAGb;IACJ,MAAMc,MAAMZ,gBAAgB;IAC5B,MAAMa,MAAMZ,gBAAgB;IAC5B,MAAMa,QAAQV,QAAQA,OAAO,IAAIW,KAAKF,GAAG,CAAC,GAAGE,KAAKC,KAAK,CAAC,AAACH,CAAAA,MAAMD,GAAE,IAAKR,QAAQ,KAAK;IACnF,MAAMa,YAAYX,WAAW;QAACK;QAAO;YAAEO,WAAW;gBAAC;oBAAEC,QAAQ,CAAC;gBAAE;aAAE;QAAC;KAAE,GAAGR;IACxE,MAAMS,SAAS;QACbC,kBAAkBd;QAClBe,oBAAoBd;QACpBe,YAAYd;IACd;IACA,qBACE,KAACd;QAAK6B,eAAe;YAAEC,UAAU;QAAK;QAAGd,OAAOM;kBAC9C,cAAA,KAACpB;YACCE,OAAOA;YACPa,KAAKZ;YACLa,KAAKZ;YACLC,YAAYA;YACZC,YAAYA;YACZW,OAAOA;YACPY,SAASrB,aAAasB,YAAYA,YAAY,CAACtB;YAC/Ce,QAAQA;YACRV,eAAeA;;;AAIvB"}
1
+ {"version":3,"sources":["community/slider/Slider.android.tsx"],"sourcesContent":[null],"names":["Host","Slider","ComposeSlider","semantics","testID","testIDModifier","props","value","minimumValue","maximumValue","lowerLimit","upperLimit","step","disabled","inverted","minimumTrackTintColor","maximumTrackTintColor","thumbTintColor","onValueChange","style","accessibilityLabel","min","max","steps","Math","round","hostStyle","transform","scaleX","colors","activeTrackColor","inactiveTrackColor","thumbColor","modifiers","undefined","push","contentDescription","matchContents","vertical","enabled","length"],"mappings":";AAAA,SAASA,IAAI,QAAQ,6BAA6B;AAClD,SAASC,UAAUC,aAAa,QAAQ,+BAA+B;AACvE,SAASC,SAAS,EAAEC,UAAUC,cAAc,QAAQ,kCAAkC;AAItF;;;CAGC,GACD,OAAO,SAASJ,OAAOK,KAAkB;IACvC,MAAM,EACJC,KAAK,EACLC,YAAY,EACZC,YAAY,EACZC,UAAU,EACVC,UAAU,EACVC,IAAI,EACJC,QAAQ,EACRC,QAAQ,EACRC,qBAAqB,EACrBC,qBAAqB,EACrBC,cAAc,EACdC,aAAa,EACbC,KAAK,EACLC,kBAAkB,EAClBhB,MAAM,EACP,GAAGE;IACJ,MAAMe,MAAMb,gBAAgB;IAC5B,MAAMc,MAAMb,gBAAgB;IAC5B,MAAMc,QAAQX,QAAQA,OAAO,IAAIY,KAAKF,GAAG,CAAC,GAAGE,KAAKC,KAAK,CAAC,AAACH,CAAAA,MAAMD,GAAE,IAAKT,QAAQ,KAAK;IACnF,MAAMc,YAAYZ,WAAW;QAACK;QAAO;YAAEQ,WAAW;gBAAC;oBAAEC,QAAQ,CAAC;gBAAE;aAAE;QAAC;KAAE,GAAGT;IACxE,MAAMU,SAAS;QACbC,kBAAkBf;QAClBgB,oBAAoBf;QACpBgB,YAAYf;IACd;IACA,+EAA+E;IAC/E,MAAMgB,YAA8B,EAAE;IACtC,IAAIb,uBAAuBc,WAAW;QACpCD,UAAUE,IAAI,CAAChC,UAAU;YAAEiC,oBAAoBhB;QAAmB;IACpE;IACA,IAAIhB,WAAW8B,WAAWD,UAAUE,IAAI,CAAC9B,eAAeD;IACxD,qBACE,KAACJ;QAAKqC,eAAe;YAAEC,UAAU;QAAK;QAAGnB,OAAOO;kBAC9C,cAAA,KAACxB;YACCK,OAAOA;YACPc,KAAKb;YACLc,KAAKb;YACLC,YAAYA;YACZC,YAAYA;YACZY,OAAOA;YACPgB,SAAS1B,aAAaqB,YAAYA,YAAY,CAACrB;YAC/CgB,QAAQA;YACRX,eAAeA;YACfe,WAAWA,UAAUO,MAAM,GAAG,IAAIP,YAAYC;;;AAItD"}
@@ -1,12 +1,12 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Host } from '../../swift-ui/Host';
3
3
  import { Slider as SwiftUISlider } from '../../swift-ui/Slider';
4
- import { disabled as disabledModifier, tint as tintModifier } from '../../swift-ui/modifiers';
4
+ import { accessibilityHint as accessibilityHintModifier, accessibilityLabel as accessibilityLabelModifier, disabled as disabledModifier, tint as tintModifier } from '../../swift-ui/modifiers';
5
5
  /**
6
6
  * A drop-in replacement for `@react-native-community/slider` on iOS.
7
7
  * Renders a SwiftUI `Slider` wrapped in a Host.
8
8
  */ export function Slider(props) {
9
- const { value, minimumValue, maximumValue, lowerLimit, upperLimit, step, disabled, inverted, minimumTrackTintColor, onValueChange, style } = props;
9
+ const { value, minimumValue, maximumValue, lowerLimit, upperLimit, step, disabled, inverted, minimumTrackTintColor, onValueChange, style, accessibilityLabel, accessibilityHint, testID } = props;
10
10
  const hostStyle = inverted ? [
11
11
  style,
12
12
  {
@@ -25,6 +25,12 @@ import { disabled as disabledModifier, tint as tintModifier } from '../../swift-
25
25
  if (minimumTrackTintColor !== undefined) {
26
26
  modifiers.push(tintModifier(minimumTrackTintColor));
27
27
  }
28
+ if (accessibilityLabel !== undefined) {
29
+ modifiers.push(accessibilityLabelModifier(accessibilityLabel));
30
+ }
31
+ if (accessibilityHint !== undefined) {
32
+ modifiers.push(accessibilityHintModifier(accessibilityHint));
33
+ }
28
34
  return /*#__PURE__*/ _jsx(Host, {
29
35
  matchContents: {
30
36
  vertical: true
@@ -39,7 +45,8 @@ import { disabled as disabledModifier, tint as tintModifier } from '../../swift-
39
45
  upperLimit: upperLimit,
40
46
  step: step && step > 0 ? step : undefined,
41
47
  modifiers: modifiers.length > 0 ? modifiers : undefined,
42
- onValueChange: onValueChange
48
+ onValueChange: onValueChange,
49
+ testID: testID
43
50
  })
44
51
  });
45
52
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["community/slider/Slider.ios.tsx"],"sourcesContent":[null],"names":["Host","Slider","SwiftUISlider","disabled","disabledModifier","tint","tintModifier","props","value","minimumValue","maximumValue","lowerLimit","upperLimit","step","inverted","minimumTrackTintColor","onValueChange","style","hostStyle","transform","scaleX","modifiers","push","undefined","matchContents","vertical","ignoreSafeArea","min","max","length"],"mappings":";AAAA,SAASA,IAAI,QAAQ,sBAAsB;AAC3C,SAASC,UAAUC,aAAa,QAAQ,wBAAwB;AAChE,SAASC,YAAYC,gBAAgB,EAAEC,QAAQC,YAAY,QAAQ,2BAA2B;AAI9F;;;CAGC,GACD,OAAO,SAASL,OAAOM,KAAkB;IACvC,MAAM,EACJC,KAAK,EACLC,YAAY,EACZC,YAAY,EACZC,UAAU,EACVC,UAAU,EACVC,IAAI,EACJV,QAAQ,EACRW,QAAQ,EACRC,qBAAqB,EACrBC,aAAa,EACbC,KAAK,EACN,GAAGV;IACJ,MAAMW,YAAYJ,WAAW;QAACG;QAAO;YAAEE,WAAW;gBAAC;oBAAEC,QAAQ,CAAC;gBAAE;aAAE;QAAC;KAAE,GAAGH;IACxE,sEAAsE;IACtE,0EAA0E;IAC1E,6CAA6C;IAC7C,MAAMI,YAA8B,EAAE;IACtC,IAAIlB,UAAUkB,UAAUC,IAAI,CAAClB,iBAAiB;IAC9C,IAAIW,0BAA0BQ,WAAW;QACvCF,UAAUC,IAAI,CAAChB,aAAaS;IAC9B;IACA,qBACE,KAACf;QAAKwB,eAAe;YAAEC,UAAU;QAAK;QAAGR,OAAOC;QAAWQ,gBAAe;kBACxE,cAAA,KAACxB;YACCM,OAAOA;YACPmB,KAAKlB;YACLmB,KAAKlB;YACLC,YAAYA;YACZC,YAAYA;YACZC,MAAMA,QAAQA,OAAO,IAAIA,OAAOU;YAChCF,WAAWA,UAAUQ,MAAM,GAAG,IAAIR,YAAYE;YAC9CP,eAAeA;;;AAIvB"}
1
+ {"version":3,"sources":["community/slider/Slider.ios.tsx"],"sourcesContent":[null],"names":["Host","Slider","SwiftUISlider","accessibilityHint","accessibilityHintModifier","accessibilityLabel","accessibilityLabelModifier","disabled","disabledModifier","tint","tintModifier","props","value","minimumValue","maximumValue","lowerLimit","upperLimit","step","inverted","minimumTrackTintColor","onValueChange","style","testID","hostStyle","transform","scaleX","modifiers","push","undefined","matchContents","vertical","ignoreSafeArea","min","max","length"],"mappings":";AAAA,SAASA,IAAI,QAAQ,sBAAsB;AAC3C,SAASC,UAAUC,aAAa,QAAQ,wBAAwB;AAChE,SACEC,qBAAqBC,yBAAyB,EAC9CC,sBAAsBC,0BAA0B,EAChDC,YAAYC,gBAAgB,EAC5BC,QAAQC,YAAY,QACf,2BAA2B;AAIlC;;;CAGC,GACD,OAAO,SAAST,OAAOU,KAAkB;IACvC,MAAM,EACJC,KAAK,EACLC,YAAY,EACZC,YAAY,EACZC,UAAU,EACVC,UAAU,EACVC,IAAI,EACJV,QAAQ,EACRW,QAAQ,EACRC,qBAAqB,EACrBC,aAAa,EACbC,KAAK,EACLhB,kBAAkB,EAClBF,iBAAiB,EACjBmB,MAAM,EACP,GAAGX;IACJ,MAAMY,YAAYL,WAAW;QAACG;QAAO;YAAEG,WAAW;gBAAC;oBAAEC,QAAQ,CAAC;gBAAE;aAAE;QAAC;KAAE,GAAGJ;IACxE,sEAAsE;IACtE,0EAA0E;IAC1E,6CAA6C;IAC7C,MAAMK,YAA8B,EAAE;IACtC,IAAInB,UAAUmB,UAAUC,IAAI,CAACnB,iBAAiB;IAC9C,IAAIW,0BAA0BS,WAAW;QACvCF,UAAUC,IAAI,CAACjB,aAAaS;IAC9B;IACA,IAAId,uBAAuBuB,WAAW;QACpCF,UAAUC,IAAI,CAACrB,2BAA2BD;IAC5C;IACA,IAAIF,sBAAsByB,WAAW;QACnCF,UAAUC,IAAI,CAACvB,0BAA0BD;IAC3C;IACA,qBACE,KAACH;QAAK6B,eAAe;YAAEC,UAAU;QAAK;QAAGT,OAAOE;QAAWQ,gBAAe;kBACxE,cAAA,KAAC7B;YACCU,OAAOA;YACPoB,KAAKnB;YACLoB,KAAKnB;YACLC,YAAYA;YACZC,YAAYA;YACZC,MAAMA,QAAQA,OAAO,IAAIA,OAAOW;YAChCF,WAAWA,UAAUQ,MAAM,GAAG,IAAIR,YAAYE;YAC9CR,eAAeA;YACfE,QAAQA;;;AAIhB"}
@@ -6,7 +6,7 @@ import { StyleSheet } from 'react-native';
6
6
  * SwiftUI `Slider` on iOS, a Material 3 `Slider` on Android, and a native
7
7
  * HTML `<input type="range">` on web.
8
8
  */ export function Slider(props) {
9
- const { value, minimumValue = 0, maximumValue = 1, lowerLimit, upperLimit, step, disabled, inverted, minimumTrackTintColor, onValueChange, style } = props;
9
+ const { value, minimumValue = 0, maximumValue = 1, lowerLimit, upperLimit, step, disabled, inverted, minimumTrackTintColor, onValueChange, style, accessibilityLabel, testID } = props;
10
10
  const clamp = (v)=>Math.min(upperLimit ?? Infinity, Math.max(lowerLimit ?? -Infinity, v));
11
11
  return /*#__PURE__*/ _jsx("input", {
12
12
  type: "range",
@@ -15,6 +15,8 @@ import { StyleSheet } from 'react-native';
15
15
  step: step && step > 0 ? step : 'any',
16
16
  value: clamp(value ?? 0),
17
17
  disabled: disabled,
18
+ "aria-label": accessibilityLabel,
19
+ "data-testid": testID,
18
20
  onChange: (e)=>onValueChange?.(clamp(e.target.valueAsNumber)),
19
21
  style: {
20
22
  ...StyleSheet.flatten(style),
@@ -1 +1 @@
1
- {"version":3,"sources":["community/slider/Slider.tsx"],"sourcesContent":[null],"names":["React","StyleSheet","Slider","props","value","minimumValue","maximumValue","lowerLimit","upperLimit","step","disabled","inverted","minimumTrackTintColor","onValueChange","style","clamp","v","Math","min","Infinity","max","input","type","onChange","e","target","valueAsNumber","flatten","undefined","accentColor","transform"],"mappings":";AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,UAAU,QAAQ,eAAe;AAI1C;;;;CAIC,GACD,OAAO,SAASC,OAAOC,KAAkB;IACvC,MAAM,EACJC,KAAK,EACLC,eAAe,CAAC,EAChBC,eAAe,CAAC,EAChBC,UAAU,EACVC,UAAU,EACVC,IAAI,EACJC,QAAQ,EACRC,QAAQ,EACRC,qBAAqB,EACrBC,aAAa,EACbC,KAAK,EACN,GAAGX;IACJ,MAAMY,QAAQ,CAACC,IACbC,KAAKC,GAAG,CAACV,cAAcW,UAAUF,KAAKG,GAAG,CAACb,cAAc,CAACY,UAAUH;IACrE,qBACE,KAACK;QACCC,MAAK;QACLJ,KAAKb;QACLe,KAAKd;QACLG,MAAMA,QAAQA,OAAO,IAAIA,OAAO;QAChCL,OAAOW,MAAMX,SAAS;QACtBM,UAAUA;QACVa,UAAU,CAACC,IAAMX,gBAAgBE,MAAMS,EAAEC,MAAM,CAACC,aAAa;QAC7DZ,OAAO;YACL,GAAIb,WAAW0B,OAAO,CAACb,MAAM;YAC7B,GAAIF,0BAA0BgB,aAAa;gBACzCC,aAAajB;YACf,CAAC;YACD,GAAID,YAAY;gBAAEmB,WAAW;YAAa,CAAC;QAC7C;;AAGN"}
1
+ {"version":3,"sources":["community/slider/Slider.tsx"],"sourcesContent":[null],"names":["React","StyleSheet","Slider","props","value","minimumValue","maximumValue","lowerLimit","upperLimit","step","disabled","inverted","minimumTrackTintColor","onValueChange","style","accessibilityLabel","testID","clamp","v","Math","min","Infinity","max","input","type","aria-label","data-testid","onChange","e","target","valueAsNumber","flatten","undefined","accentColor","transform"],"mappings":";AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,UAAU,QAAQ,eAAe;AAI1C;;;;CAIC,GACD,OAAO,SAASC,OAAOC,KAAkB;IACvC,MAAM,EACJC,KAAK,EACLC,eAAe,CAAC,EAChBC,eAAe,CAAC,EAChBC,UAAU,EACVC,UAAU,EACVC,IAAI,EACJC,QAAQ,EACRC,QAAQ,EACRC,qBAAqB,EACrBC,aAAa,EACbC,KAAK,EACLC,kBAAkB,EAClBC,MAAM,EACP,GAAGb;IACJ,MAAMc,QAAQ,CAACC,IACbC,KAAKC,GAAG,CAACZ,cAAca,UAAUF,KAAKG,GAAG,CAACf,cAAc,CAACc,UAAUH;IACrE,qBACE,KAACK;QACCC,MAAK;QACLJ,KAAKf;QACLiB,KAAKhB;QACLG,MAAMA,QAAQA,OAAO,IAAIA,OAAO;QAChCL,OAAOa,MAAMb,SAAS;QACtBM,UAAUA;QACVe,cAAYV;QACZW,eAAaV;QACbW,UAAU,CAACC,IAAMf,gBAAgBI,MAAMW,EAAEC,MAAM,CAACC,aAAa;QAC7DhB,OAAO;YACL,GAAIb,WAAW8B,OAAO,CAACjB,MAAM;YAC7B,GAAIF,0BAA0BoB,aAAa;gBACzCC,aAAarB;YACf,CAAC;YACD,GAAID,YAAY;gBAAEuB,WAAW;YAAa,CAAC;QAC7C;;AAGN"}
@@ -71,4 +71,18 @@ export interface SliderProps {
71
71
  * Used to style and layout the Slider.
72
72
  */
73
73
  style?: StyleProp<ViewStyle>;
74
+ /**
75
+ * What screen readers (VoiceOver, TalkBack) announce for the slider before its value.
76
+ * Without it, the slider is announced by its value alone.
77
+ */
78
+ accessibilityLabel?: string;
79
+ /**
80
+ * Describes what adjusting the slider does. Screen readers read it after the label and value.
81
+ * @platform ios
82
+ */
83
+ accessibilityHint?: string;
84
+ /**
85
+ * Used to locate this view in end-to-end tests.
86
+ */
87
+ testID?: string;
74
88
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["community/slider/types.tsx"],"sourcesContent":[null],"names":[],"mappings":"AAEA;;;CAGC,GACD,WAoEC"}
1
+ {"version":3,"sources":["community/slider/types.tsx"],"sourcesContent":[null],"names":[],"mappings":"AAEA;;;CAGC,GACD,WAkFC"}
@@ -1,6 +1,6 @@
1
1
  import type { Ref } from 'react';
2
2
  import { type ColorValue, type StyleProp, type ViewStyle } from 'react-native';
3
- import { type CommonViewModifierProps } from '../types';
3
+ import { type Alignment, type CommonViewModifierProps } from '../types';
4
4
  export interface HostProps extends CommonViewModifierProps {
5
5
  /**
6
6
  * When true, the host view will update its size in the React Native view tree to match the content's layout from SwiftUI.
@@ -11,6 +11,16 @@ export interface HostProps extends CommonViewModifierProps {
11
11
  vertical?: boolean;
12
12
  horizontal?: boolean;
13
13
  };
14
+ /**
15
+ * The position of the SwiftUI content inside the host when their sizes differ. The sizes differ
16
+ * when the host is larger than its content, and while the content of a `matchContents` host
17
+ * animates to a new size. Setting it to the edge that the host is anchored to in its React
18
+ * Native layout keeps that edge still. For example, a host at the end of a row uses `'trailing'`.
19
+ * It also aligns the host's children with each other. Leading and trailing follow
20
+ * `layoutDirection`.
21
+ * @default 'topLeading'
22
+ */
23
+ alignment?: Alignment;
14
24
  /**
15
25
  * When true and no explicit size is provided, the host will use the viewport size as the proposed size for SwiftUI layout.
16
26
  * This is particularly useful for SwiftUI views that need to fill their available space, such as `Form`.
@@ -1 +1 @@
1
- {"version":3,"sources":["swift-ui/Host/index.tsx"],"sourcesContent":[null],"names":["requireNativeView","I18nManager","NativeTreeContext","useWarnIfNestedHost","TextInputHostProvider","useTextInputHostRef","useMergeRefs","createViewModifierEventListener","HostNativeView","Host","props","matchContents","onLayoutContent","ignoreSafeArea","modifiers","layoutDirection","seedColor","ref","children","restProps","hostRef","mergedRef","undefined","matchContentsVertical","vertical","matchContentsHorizontal","horizontal","getConstants","isRTL","Provider","value"],"mappings":";AAAA,SAASA,iBAAiB,QAAQ,OAAO;AAEzC,SAASC,WAAW,QAAyD,eAAe;AAE5F,SAASC,iBAAiB,EAAEC,mBAAmB,QAAQ,0BAA0B;AACjF,SAASC,qBAAqB,EAAEC,mBAAmB,QAAQ,iBAAiB;AAC5E,SAASC,YAAY,QAAQ,2BAA2B;AACxD,SAASC,+BAA+B,QAAQ,qBAAqB;AAyDrE,MAAMC,iBAMFR,kBAAkB,UAAU;AAEhC;;CAEC,GACD,OAAO,SAASS,KAAKC,KAAgB;IACnC,MAAM,EACJC,aAAa,EACbC,eAAe,EACfC,cAAc,EACdC,SAAS,EACTC,eAAe,EACfC,SAAS,EACTC,GAAG,EACHC,QAAQ,EACR,GAAGC,WACJ,GAAGT;IACJ,MAAMU,UAAUf;IAChB,MAAMgB,YAAYf,aAAaW,KAAKG;IACpCjB,oBAAoB;IAEpB,qBACE,KAACC;QAAsBgB,SAASA;kBAC9B,cAAA,KAACZ;YACCM,WAAWA;YACV,GAAIA,YAAYP,gCAAgCO,aAAaQ,SAAS;YACvEC,uBACE,OAAOZ,kBAAkB,WAAWA,cAAca,QAAQ,GAAGb;YAE/Dc,yBACE,OAAOd,kBAAkB,WAAWA,cAAce,UAAU,GAAGf;YAEjEC,iBAAiBA;YACjBG,iBACEA,mBAAoBd,CAAAA,YAAY0B,YAAY,GAAGC,KAAK,GAAG,gBAAgB,aAAY;YAErFf,gBAAgBA;YAChBG,WAAWA;YACV,GAAGG,SAAS;YACbF,KAAKI;sBACL,cAAA,KAACnB,kBAAkB2B,QAAQ;gBAACC,KAAK;0BAAEZ;;;;AAI3C"}
1
+ {"version":3,"sources":["swift-ui/Host/index.tsx"],"sourcesContent":[null],"names":["requireNativeView","I18nManager","NativeTreeContext","useWarnIfNestedHost","TextInputHostProvider","useTextInputHostRef","useMergeRefs","createViewModifierEventListener","HostNativeView","Host","props","matchContents","onLayoutContent","ignoreSafeArea","modifiers","layoutDirection","seedColor","ref","children","restProps","hostRef","mergedRef","undefined","matchContentsVertical","vertical","matchContentsHorizontal","horizontal","getConstants","isRTL","Provider","value"],"mappings":";AAAA,SAASA,iBAAiB,QAAQ,OAAO;AAEzC,SAASC,WAAW,QAAyD,eAAe;AAE5F,SAASC,iBAAiB,EAAEC,mBAAmB,QAAQ,0BAA0B;AACjF,SAASC,qBAAqB,EAAEC,mBAAmB,QAAQ,iBAAiB;AAC5E,SAASC,YAAY,QAAQ,2BAA2B;AACxD,SAASC,+BAA+B,QAAQ,qBAAqB;AAoErE,MAAMC,iBAMFR,kBAAkB,UAAU;AAEhC;;CAEC,GACD,OAAO,SAASS,KAAKC,KAAgB;IACnC,MAAM,EACJC,aAAa,EACbC,eAAe,EACfC,cAAc,EACdC,SAAS,EACTC,eAAe,EACfC,SAAS,EACTC,GAAG,EACHC,QAAQ,EACR,GAAGC,WACJ,GAAGT;IACJ,MAAMU,UAAUf;IAChB,MAAMgB,YAAYf,aAAaW,KAAKG;IACpCjB,oBAAoB;IAEpB,qBACE,KAACC;QAAsBgB,SAASA;kBAC9B,cAAA,KAACZ;YACCM,WAAWA;YACV,GAAIA,YAAYP,gCAAgCO,aAAaQ,SAAS;YACvEC,uBACE,OAAOZ,kBAAkB,WAAWA,cAAca,QAAQ,GAAGb;YAE/Dc,yBACE,OAAOd,kBAAkB,WAAWA,cAAce,UAAU,GAAGf;YAEjEC,iBAAiBA;YACjBG,iBACEA,mBAAoBd,CAAAA,YAAY0B,YAAY,GAAGC,KAAK,GAAG,gBAAgB,aAAY;YAErFf,gBAAgBA;YAChBG,WAAWA;YACV,GAAGG,SAAS;YACbF,KAAKI;sBACL,cAAA,KAACnB,kBAAkB2B,QAAQ;gBAACC,KAAK;0BAAEZ;;;;AAI3C"}
@@ -60,6 +60,7 @@ internal final class HostViewProps: ExpoSwiftUI.ViewProps, ExpoSwiftUI.SafeAreaC
60
60
  @Field var layoutDirection: ExpoLayoutDirection = .leftToRight
61
61
  @Field var matchContentsHorizontal = false
62
62
  @Field var matchContentsVertical = false
63
+ @Field var alignment: AlignmentOptions?
63
64
  @Field var ignoreSafeArea: ExpoSwiftUI.IgnoreSafeArea?
64
65
  @Field var modifiers: ModifierArray?
65
66
  var onLayoutContent = EventDispatcher()
@@ -75,7 +76,7 @@ struct HostView: ExpoSwiftUI.View, ExpoSwiftUI.WithHostingView {
75
76
 
76
77
  var body: some View {
77
78
  let layoutDirection = props.layoutDirection.toLayoutDirection()
78
- let alignment: Alignment = layoutDirection == .rightToLeft ? .topTrailing : .topLeading
79
+ let alignment = physicalAlignment(props.alignment?.toAlignment() ?? .topLeading, layoutDirection: layoutDirection)
79
80
  let fillHorizontal = !props.useViewportSizeMeasurement && !props.matchContentsHorizontal
80
81
  let fillVertical = !props.useViewportSizeMeasurement && !props.matchContentsVertical
81
82
  let pinHorizontal = !props.useViewportSizeMeasurement && props.matchContentsHorizontal
@@ -137,6 +138,24 @@ struct HostView: ExpoSwiftUI.View, ExpoSwiftUI.WithHostingView {
137
138
 
138
139
  }
139
140
 
141
+ /**
142
+ Mirrors the horizontal edge of `alignment` for a right-to-left `Host`. `FillAlignmentModifier` sits
143
+ outside `LayoutDirectionModifier`, so it reads leading and trailing in the hosting controller's
144
+ own direction.
145
+ */
146
+ private func physicalAlignment(_ alignment: Alignment, layoutDirection: LayoutDirection) -> Alignment {
147
+ guard layoutDirection == .rightToLeft else {
148
+ return alignment
149
+ }
150
+ if alignment.horizontal == .leading {
151
+ return Alignment(horizontal: .trailing, vertical: alignment.vertical)
152
+ }
153
+ if alignment.horizontal == .trailing {
154
+ return Alignment(horizontal: .leading, vertical: alignment.vertical)
155
+ }
156
+ return alignment
157
+ }
158
+
140
159
  /**
141
160
  A Layout designed for the `useViewportSizeMeasurement` behavior.
142
161
  If parent's proposedViewSize is zero or nil, it will try to use the viewport size to expand its children size.
@@ -3,7 +3,7 @@
3
3
  "component": {
4
4
  "group": "expo.modules.ui",
5
5
  "module": "expo.modules.ui",
6
- "version": "58.0.18",
6
+ "version": "58.0.20",
7
7
  "attributes": {
8
8
  "org.gradle.status": "release"
9
9
  }
@@ -24,8 +24,8 @@
24
24
  },
25
25
  "files": [
26
26
  {
27
- "name": "expo.modules.ui-58.0.18.aar",
28
- "url": "expo.modules.ui-58.0.18.aar",
27
+ "name": "expo.modules.ui-58.0.20.aar",
28
+ "url": "expo.modules.ui-58.0.20.aar",
29
29
  "size": 1859361,
30
30
  "sha512": "ba561fa50c9fde30184d2c36051e644fd87db59555b7b38f8e2e5b7096b03bf0d2aec3e53fff1831d2705d85b174ec1a7fc2e9cadc69c41237aac262bbea9365",
31
31
  "sha256": "6cbb10f1e4cd5618c6997d87c2021e97c7bab1b8fc4ecc7be48f563e9c0e284a",
@@ -141,8 +141,8 @@
141
141
  ],
142
142
  "files": [
143
143
  {
144
- "name": "expo.modules.ui-58.0.18.aar",
145
- "url": "expo.modules.ui-58.0.18.aar",
144
+ "name": "expo.modules.ui-58.0.20.aar",
145
+ "url": "expo.modules.ui-58.0.20.aar",
146
146
  "size": 1859361,
147
147
  "sha512": "ba561fa50c9fde30184d2c36051e644fd87db59555b7b38f8e2e5b7096b03bf0d2aec3e53fff1831d2705d85b174ec1a7fc2e9cadc69c41237aac262bbea9365",
148
148
  "sha256": "6cbb10f1e4cd5618c6997d87c2021e97c7bab1b8fc4ecc7be48f563e9c0e284a",
@@ -161,8 +161,8 @@
161
161
  },
162
162
  "files": [
163
163
  {
164
- "name": "expo.modules.ui-58.0.18-sources.jar",
165
- "url": "expo.modules.ui-58.0.18-sources.jar",
164
+ "name": "expo.modules.ui-58.0.20-sources.jar",
165
+ "url": "expo.modules.ui-58.0.20-sources.jar",
166
166
  "size": 113113,
167
167
  "sha512": "10ed672c04082cf5f06e6ca6dca0f28229f11f3d503d46e5b61dbc7d3ad50bfdc1399838dd38dc5b8c1643ec375c4bf1672c95606ce28f7ed36384f66b829b68",
168
168
  "sha256": "f9a24faad34f9f66bebcdde7d05a6cf72a8b4b9030819b80049de5084a694ef0",
@@ -0,0 +1 @@
1
+ b378b5a3097dfa2a27e87822671b5b1867b14d52
@@ -0,0 +1 @@
1
+ 46af13485988415a3ff14c812754b46df0b5cf7d0b7ebb28a80d7b16c3306fe4
@@ -0,0 +1 @@
1
+ c9fcfdbaa4dbae59c5112fffa82e03ce4c36bb3840f98c1f149c9b0d8d0634dff5c5f63e47f32e921933b5a29bdab362830aecf5f37e3fa82cd552c28e774f71
@@ -9,7 +9,7 @@
9
9
  <modelVersion>4.0.0</modelVersion>
10
10
  <groupId>expo.modules.ui</groupId>
11
11
  <artifactId>expo.modules.ui</artifactId>
12
- <version>58.0.18</version>
12
+ <version>58.0.20</version>
13
13
  <packaging>aar</packaging>
14
14
  <name>expo.modules.ui</name>
15
15
  <url>https://github.com/expo/expo</url>
@@ -0,0 +1 @@
1
+ ff65582de003d4ba6fbfb2194fb4bb97bd523798
@@ -0,0 +1 @@
1
+ fde46f8c2665d31cc8c43574f2897aed7e82a9db1e29fdf0a557e4c8d528f005
@@ -0,0 +1 @@
1
+ 1f1f387588df2979f0a9f2eb9db168b05343069b1ffe2f46f30da422e31d554d9133a96afc594e69824183460ab5bfb9f2982a43613d294c31eac7a3d814b23b
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/ui",
3
- "version": "58.0.18",
3
+ "version": "58.0.20",
4
4
  "description": "A collection of UI components",
5
5
  "keywords": [
6
6
  "Jetpack Compose",
@@ -172,7 +172,6 @@
172
172
  }
173
173
  },
174
174
  "scripts": {
175
- "precompile-ios": "et prebuild-package-for-publish",
176
175
  "precompile-android": "et prebuild-android-package-for-publish",
177
176
  "build": "pnpm run build:lib && pnpm run build:plugin",
178
177
  "build:lib": "expo-build src",
package/spm.config.json CHANGED
@@ -1,6 +1,5 @@
1
1
  {
2
2
  "$schema": "../../tools/src/prebuilds/schemas/spm.config.schema.json",
3
- "publishPrebuilds": true,
4
3
  "products": [
5
4
  {
6
5
  "name": "ExpoUI",
@@ -1,5 +1,7 @@
1
1
  import { Host } from '../../jetpack-compose/Host';
2
2
  import { Slider as ComposeSlider } from '../../jetpack-compose/Slider';
3
+ import { semantics, testID as testIDModifier } from '../../jetpack-compose/modifiers';
4
+ import type { ModifierConfig } from '../../types';
3
5
  import { type SliderProps } from './types';
4
6
 
5
7
  /**
@@ -21,6 +23,8 @@ export function Slider(props: SliderProps) {
21
23
  thumbTintColor,
22
24
  onValueChange,
23
25
  style,
26
+ accessibilityLabel,
27
+ testID,
24
28
  } = props;
25
29
  const min = minimumValue ?? 0;
26
30
  const max = maximumValue ?? 1;
@@ -31,6 +35,12 @@ export function Slider(props: SliderProps) {
31
35
  inactiveTrackColor: maximumTrackTintColor,
32
36
  thumbColor: thumbTintColor,
33
37
  };
38
+ // `accessibilityHint` has no Compose semantics counterpart, so it is iOS-only.
39
+ const modifiers: ModifierConfig[] = [];
40
+ if (accessibilityLabel !== undefined) {
41
+ modifiers.push(semantics({ contentDescription: accessibilityLabel }));
42
+ }
43
+ if (testID !== undefined) modifiers.push(testIDModifier(testID));
34
44
  return (
35
45
  <Host matchContents={{ vertical: true }} style={hostStyle}>
36
46
  <ComposeSlider
@@ -43,6 +53,7 @@ export function Slider(props: SliderProps) {
43
53
  enabled={disabled === undefined ? undefined : !disabled}
44
54
  colors={colors}
45
55
  onValueChange={onValueChange}
56
+ modifiers={modifiers.length > 0 ? modifiers : undefined}
46
57
  />
47
58
  </Host>
48
59
  );
@@ -1,6 +1,11 @@
1
1
  import { Host } from '../../swift-ui/Host';
2
2
  import { Slider as SwiftUISlider } from '../../swift-ui/Slider';
3
- import { disabled as disabledModifier, tint as tintModifier } from '../../swift-ui/modifiers';
3
+ import {
4
+ accessibilityHint as accessibilityHintModifier,
5
+ accessibilityLabel as accessibilityLabelModifier,
6
+ disabled as disabledModifier,
7
+ tint as tintModifier,
8
+ } from '../../swift-ui/modifiers';
4
9
  import type { ModifierConfig } from '../../types';
5
10
  import { type SliderProps } from './types';
6
11
 
@@ -21,6 +26,9 @@ export function Slider(props: SliderProps) {
21
26
  minimumTrackTintColor,
22
27
  onValueChange,
23
28
  style,
29
+ accessibilityLabel,
30
+ accessibilityHint,
31
+ testID,
24
32
  } = props;
25
33
  const hostStyle = inverted ? [style, { transform: [{ scaleX: -1 }] }] : style;
26
34
  // SwiftUI's Slider only exposes `.tint(...)` for the minimum (active)
@@ -31,6 +39,12 @@ export function Slider(props: SliderProps) {
31
39
  if (minimumTrackTintColor !== undefined) {
32
40
  modifiers.push(tintModifier(minimumTrackTintColor as string));
33
41
  }
42
+ if (accessibilityLabel !== undefined) {
43
+ modifiers.push(accessibilityLabelModifier(accessibilityLabel));
44
+ }
45
+ if (accessibilityHint !== undefined) {
46
+ modifiers.push(accessibilityHintModifier(accessibilityHint));
47
+ }
34
48
  return (
35
49
  <Host matchContents={{ vertical: true }} style={hostStyle} ignoreSafeArea="all">
36
50
  <SwiftUISlider
@@ -42,6 +56,7 @@ export function Slider(props: SliderProps) {
42
56
  step={step && step > 0 ? step : undefined}
43
57
  modifiers={modifiers.length > 0 ? modifiers : undefined}
44
58
  onValueChange={onValueChange}
59
+ testID={testID}
45
60
  />
46
61
  </Host>
47
62
  );
@@ -21,6 +21,8 @@ export function Slider(props: SliderProps) {
21
21
  minimumTrackTintColor,
22
22
  onValueChange,
23
23
  style,
24
+ accessibilityLabel,
25
+ testID,
24
26
  } = props;
25
27
  const clamp = (v: number) =>
26
28
  Math.min(upperLimit ?? Infinity, Math.max(lowerLimit ?? -Infinity, v));
@@ -32,6 +34,8 @@ export function Slider(props: SliderProps) {
32
34
  step={step && step > 0 ? step : 'any'}
33
35
  value={clamp(value ?? 0)}
34
36
  disabled={disabled}
37
+ aria-label={accessibilityLabel}
38
+ data-testid={testID}
35
39
  onChange={(e) => onValueChange?.(clamp(e.target.valueAsNumber))}
36
40
  style={{
37
41
  ...(StyleSheet.flatten(style) as React.CSSProperties),
@@ -72,4 +72,18 @@ export interface SliderProps {
72
72
  * Used to style and layout the Slider.
73
73
  */
74
74
  style?: StyleProp<ViewStyle>;
75
+ /**
76
+ * What screen readers (VoiceOver, TalkBack) announce for the slider before its value.
77
+ * Without it, the slider is announced by its value alone.
78
+ */
79
+ accessibilityLabel?: string;
80
+ /**
81
+ * Describes what adjusting the slider does. Screen readers read it after the label and value.
82
+ * @platform ios
83
+ */
84
+ accessibilityHint?: string;
85
+ /**
86
+ * Used to locate this view in end-to-end tests.
87
+ */
88
+ testID?: string;
75
89
  }
@@ -6,7 +6,7 @@ import { NativeTreeContext, useWarnIfNestedHost } from '../../NativeTreeContext'
6
6
  import { TextInputHostProvider, useTextInputHostRef } from '../../keyboard';
7
7
  import { useMergeRefs } from '../../utils/useMergeRefs';
8
8
  import { createViewModifierEventListener } from '../modifiers/utils';
9
- import { type CommonViewModifierProps } from '../types';
9
+ import { type Alignment, type CommonViewModifierProps } from '../types';
10
10
 
11
11
  export interface HostProps extends CommonViewModifierProps {
12
12
  /**
@@ -16,6 +16,17 @@ export interface HostProps extends CommonViewModifierProps {
16
16
  */
17
17
  matchContents?: boolean | { vertical?: boolean; horizontal?: boolean };
18
18
 
19
+ /**
20
+ * The position of the SwiftUI content inside the host when their sizes differ. The sizes differ
21
+ * when the host is larger than its content, and while the content of a `matchContents` host
22
+ * animates to a new size. Setting it to the edge that the host is anchored to in its React
23
+ * Native layout keeps that edge still. For example, a host at the end of a row uses `'trailing'`.
24
+ * It also aligns the host's children with each other. Leading and trailing follow
25
+ * `layoutDirection`.
26
+ * @default 'topLeading'
27
+ */
28
+ alignment?: Alignment;
29
+
19
30
  /**
20
31
  * When true and no explicit size is provided, the host will use the viewport size as the proposed size for SwiftUI layout.
21
32
  * This is particularly useful for SwiftUI views that need to fill their available space, such as `Form`.
@@ -1 +0,0 @@
1
- 0280a28f44e2219abbc8ce054003200350f1dcc7
@@ -1 +0,0 @@
1
- ea72887593516448266e9bc6baf03968872b368955a35eb088ea2ff6704a1554
@@ -1 +0,0 @@
1
- a6322f157112637387e22d8a67960dd950773126129ee71be541575898307ddec6c5f16bb581ed0706a2f3694b40ba69bbec78060759038aaddca1f93084bf8b
@@ -1 +0,0 @@
1
- d556d91a38a29be6a7ba659601e3a6b6aa33de81
@@ -1 +0,0 @@
1
- 41cc6e28b0897992415819e13a13dc98d98755c22d717cfb456dfb169d6f620f
@@ -1 +0,0 @@
1
- 5c5379544047a4326c296a599c1120e912f99ff4a427def0cfb7455ee1e9b4c99c51d36294ea4c023019a7ef565e85ffc1a3db6b1c812ae5a071d163d51ce385