atlas-design-system 3.0.0 → 3.1.0

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/CHANGELOG.md CHANGED
@@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [3.1.0] - 2026-11-25
9
+
10
+ ### Added
11
+
12
+ - `TitleBar` takes `backButtonLabel` (default `"Back"`) and `backButtonTestID`. The icon-only back button now has `accessibilityRole="button"` and a VoiceOver label.
13
+
14
+ ### Fixed
15
+
16
+ - `Sheet` no longer closes itself when it is opened again while its fade-out is still running (for example, opened within ~200 ms of mounting or closing). Only a fade-out that runs to its end calls `setOpen(false)`.
17
+ - `BottomSheet` had the same race: reopening during its slide-out hid the sheet while `open` stayed `true`. Only a slide-out that runs to its end hides it now.
18
+
8
19
  ## [3.0.0] - 2026-09-02
9
20
 
10
21
  ### Breaking
@@ -16,8 +16,11 @@ const BottomSheet = ({ open, children, height, setOpen }) => {
16
16
  position.value = withTiming(height, {
17
17
  duration: 200,
18
18
  easing: DEFAULT_EASING,
19
- }, () => {
20
- scheduleOnRN(setVisible, false);
19
+ }, (finished) => {
20
+ // An open that cuts this slide short ends it unfinished: only a slide that ran to its end hides the sheet.
21
+ if (finished) {
22
+ scheduleOnRN(setVisible, false);
23
+ }
21
24
  });
22
25
  return;
23
26
  }
@@ -24,8 +24,11 @@ const Sheet = ({ open, setOpen, children, containerStyle, defaultMargins = true,
24
24
  opacity.value = withTiming(0, {
25
25
  duration: 200,
26
26
  easing: Easing.bezier(0.5, 0, 0, 0.75),
27
- }, () => {
28
- scheduleOnRN(setOpen, false);
27
+ }, (finished) => {
28
+ // An open that cuts this fade short ends it unfinished: only a fade that ran to its end closes.
29
+ if (finished) {
30
+ scheduleOnRN(setOpen, false);
31
+ }
29
32
  });
30
33
  return;
31
34
  }
@@ -8,6 +8,9 @@ export type TitleBarProps = {
8
8
  canGoBack?: boolean;
9
9
  type?: "modal" | "default";
10
10
  containerStyle?: ViewStyle;
11
+ /** VoiceOver label of the back button (it is an icon only). */
12
+ backButtonLabel?: string;
13
+ backButtonTestID?: string;
11
14
  };
12
- declare const TitleBar: ({ title, onBackPressed, canGoBack, rightItem, titleComponent, type, containerStyle, }: TitleBarProps) => React.JSX.Element;
15
+ declare const TitleBar: ({ title, onBackPressed, canGoBack, rightItem, titleComponent, type, containerStyle, backButtonLabel, backButtonTestID, }: TitleBarProps) => React.JSX.Element;
13
16
  export default TitleBar;
@@ -7,7 +7,7 @@ import { useThemedStyle } from "../../hooks";
7
7
  import { Text } from "../Text";
8
8
  import { DragHandle } from "../DragHandle";
9
9
  const TitleBarHeight = 60;
10
- const TitleBar = ({ title, onBackPressed, canGoBack = true, rightItem, titleComponent, type = "default", containerStyle = {}, }) => {
10
+ const TitleBar = ({ title, onBackPressed, canGoBack = true, rightItem, titleComponent, type = "default", containerStyle = {}, backButtonLabel = "Back", backButtonTestID, }) => {
11
11
  const isModal = type === "modal";
12
12
  const styles = useStyles(canGoBack, isModal).styles;
13
13
  const handleOnBackPress = useCallback(() => {
@@ -20,7 +20,7 @@ const TitleBar = ({ title, onBackPressed, canGoBack = true, rightItem, titleComp
20
20
  if (isModal || !canGoBack) {
21
21
  return null;
22
22
  }
23
- return (_jsx(Pressable, { style: styles.backButtonContainer, onPress: handleOnBackPress, children: _jsx(IonIcons, { style: styles.backButton, name: "chevron-back-outline", size: 20 }) }));
23
+ return (_jsx(Pressable, { style: styles.backButtonContainer, onPress: handleOnBackPress, accessibilityRole: "button", accessibilityLabel: backButtonLabel, testID: backButtonTestID, children: _jsx(IonIcons, { style: styles.backButton, name: "chevron-back-outline", size: 20 }) }));
24
24
  };
25
25
  return (_jsxs(SafeAreaView, { edges: ["top"], style: [styles.container, containerStyle], children: [isModal && _jsx(DragHandle, { size: "large" }), _jsxs(View, { style: styles.bar, children: [renderBack(), !!titleComponent && (_jsx(View, { style: styles.titleComponentContainer, children: titleComponent })), !titleComponent && !!title && (_jsx(View, { style: styles.titleContainer, children: _jsx(Text, { category: "h1", style: styles.headerTitle, numberOfLines: 1, children: title ?? "" }) })), !!rightItem && (_jsx(View, { style: styles.rightItemContainer, children: rightItem }))] })] }));
26
26
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "atlas-design-system",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "description": "A react native design system for the Atlas workout app",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",