atlas-design-system 1.7.0 → 1.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,12 @@
1
1
  import React from "react";
2
+ import { StyleProp, ViewStyle } from "react-native";
2
3
  export type NavigationListRowProps = {
3
4
  label: string;
4
5
  caption?: string;
5
6
  onPress?: () => void;
6
7
  disabled?: boolean;
8
+ defaultPadding?: boolean;
9
+ containerStyle?: StyleProp<ViewStyle>;
7
10
  };
8
- export declare const NavigationListRow: ({ label, caption, onPress, disabled, }: NavigationListRowProps) => React.JSX.Element;
11
+ export declare const NavigationListRow: ({ label, caption, onPress, disabled, defaultPadding, containerStyle, }: NavigationListRowProps) => React.JSX.Element;
9
12
  export default NavigationListRow;
@@ -32,9 +32,9 @@ const react_native_1 = require("react-native");
32
32
  const Ionicons_1 = __importDefault(require("react-native-vector-icons/Ionicons"));
33
33
  const Text_1 = __importDefault(require("../Text"));
34
34
  const useThemedStyle_1 = require("../../hooks/useThemedStyle");
35
- const NavigationListRow = ({ label, caption, onPress, disabled, }) => {
36
- const styles = useStyles().styles;
37
- return (<react_native_1.TouchableOpacity disabled={disabled} style={styles.container} onPress={onPress}>
35
+ const NavigationListRow = ({ label, caption, onPress, disabled, defaultPadding = true, containerStyle = {}, }) => {
36
+ const styles = useStyles(defaultPadding).styles;
37
+ return (<react_native_1.TouchableOpacity disabled={disabled} style={[styles.container, containerStyle]} onPress={onPress}>
38
38
  <react_native_1.View style={styles.content}>
39
39
  <Text_1.default category="h3">{label}</Text_1.default>
40
40
  {caption && <Text_1.default contrast="low">{caption}</Text_1.default>}
@@ -44,7 +44,7 @@ const NavigationListRow = ({ label, caption, onPress, disabled, }) => {
44
44
  };
45
45
  exports.NavigationListRow = NavigationListRow;
46
46
  exports.default = exports.NavigationListRow;
47
- const useStyles = () => (0, useThemedStyle_1.useThemedStyle)((0, react_1.useCallback)((t) => react_native_1.StyleSheet.create({
47
+ const useStyles = (defaultPadding) => (0, useThemedStyle_1.useThemedStyle)((0, react_1.useCallback)((t) => react_native_1.StyleSheet.create({
48
48
  content: {
49
49
  flexGrow: 1,
50
50
  },
@@ -52,7 +52,7 @@ const useStyles = () => (0, useThemedStyle_1.useThemedStyle)((0, react_1.useCall
52
52
  width: "100%",
53
53
  flexDirection: "row",
54
54
  paddingVertical: t.size.baseSize * 2,
55
- paddingHorizontal: t.size.baseSize * 4,
55
+ paddingHorizontal: defaultPadding ? t.size.baseSize * 4 : 0,
56
56
  },
57
57
  chevronRight: {
58
58
  height: "100%",
@@ -61,4 +61,4 @@ const useStyles = () => (0, useThemedStyle_1.useThemedStyle)((0, react_1.useCall
61
61
  chevronRightTint: {
62
62
  color: t.colors.foregroundLowContrast,
63
63
  },
64
- }), []));
64
+ }), [defaultPadding]));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "atlas-design-system",
3
- "version": "1.7.0",
3
+ "version": "1.8.1",
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",