atlas-design-system 1.14.0 → 1.16.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.
@@ -7,6 +7,8 @@ export type NavigationListRowProps = {
7
7
  disabled?: boolean;
8
8
  defaultPadding?: boolean;
9
9
  containerStyle?: StyleProp<ViewStyle>;
10
+ iconRight?: React.ReactNode;
11
+ iconRightName?: string;
10
12
  };
11
- export declare const NavigationListRow: ({ label, caption, onPress, disabled, defaultPadding, containerStyle, }: NavigationListRowProps) => React.JSX.Element;
13
+ export declare const NavigationListRow: ({ label, caption, onPress, disabled, defaultPadding, containerStyle, iconRight, iconRightName, }: NavigationListRowProps) => React.JSX.Element;
12
14
  export default NavigationListRow;
@@ -32,14 +32,14 @@ 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, defaultPadding = true, containerStyle = {}, }) => {
35
+ const NavigationListRow = ({ label, caption, onPress, disabled, defaultPadding = true, containerStyle = {}, iconRight, iconRightName = "chevron-forward-outline", }) => {
36
36
  const styles = useStyles(defaultPadding).styles;
37
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>}
41
41
  </react_native_1.View>
42
- <Ionicons_1.default style={styles.chevronRight} size={18} name="chevron-forward-outline"/>
42
+ {iconRight ? (iconRight) : (<Ionicons_1.default style={styles.chevronRight} size={18} name={iconRightName}/>)}
43
43
  </react_native_1.TouchableOpacity>);
44
44
  };
45
45
  exports.NavigationListRow = NavigationListRow;
@@ -44,7 +44,7 @@ function RadioOptionInput({ caption, label, options = [], onChange, renderOption
44
44
  const handleOptionPress = (0, react_1.useCallback)((option) => {
45
45
  onChange(option);
46
46
  setSheetOpen(false);
47
- }, []);
47
+ }, [onChange]);
48
48
  return (<>
49
49
  <react_native_1.View style={[styles.container, containerStyle]}>
50
50
  <Text_1.default>{label}</Text_1.default>
@@ -1,2 +1,2 @@
1
- export { default } from "./RadioOptionInput";
1
+ export { default as RadioOptionInput } from "./RadioOptionInput";
2
2
  export * from "./RadioOptionInput";
@@ -17,7 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
17
17
  return (mod && mod.__esModule) ? mod : { "default": mod };
18
18
  };
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
- exports.default = void 0;
20
+ exports.RadioOptionInput = void 0;
21
21
  var RadioOptionInput_1 = require("./RadioOptionInput");
22
- Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(RadioOptionInput_1).default; } });
22
+ Object.defineProperty(exports, "RadioOptionInput", { enumerable: true, get: function () { return __importDefault(RadioOptionInput_1).default; } });
23
23
  __exportStar(require("./RadioOptionInput"), exports);
@@ -10,6 +10,8 @@ export type TextInputProps = {
10
10
  label: string;
11
11
  containerStyle?: StyleProp<ViewStyle>;
12
12
  error?: string;
13
+ multiline?: boolean;
14
+ numberOfLines?: number;
13
15
  } & Omit<RNTextInputProps, "onBlur">;
14
16
  export declare const TextInput: React.ForwardRefExoticComponent<{
15
17
  disabled?: boolean;
@@ -21,5 +23,7 @@ export declare const TextInput: React.ForwardRefExoticComponent<{
21
23
  label: string;
22
24
  containerStyle?: StyleProp<ViewStyle>;
23
25
  error?: string;
26
+ multiline?: boolean;
27
+ numberOfLines?: number;
24
28
  } & Omit<RNTextInputProps, "onBlur"> & React.RefAttributes<unknown>>;
25
29
  export default TextInput;
@@ -66,8 +66,8 @@ const getTextInputStyle = (disabled, error, style) => {
66
66
  return style.default;
67
67
  };
68
68
  exports.TextInput = (0, react_1.forwardRef)((_a, ref) => {
69
- var { caption, keyboardType, onChangeText, testId, value, label, onBlur, containerStyle, disabled = false, error } = _a, rest = __rest(_a, ["caption", "keyboardType", "onChangeText", "testId", "value", "label", "onBlur", "containerStyle", "disabled", "error"]);
70
- const { styles, theme } = useStyles(disabled, !!error);
69
+ var { caption, keyboardType, onChangeText, testId, value, label, onBlur, containerStyle, disabled = false, error, multiline, numberOfLines } = _a, rest = __rest(_a, ["caption", "keyboardType", "onChangeText", "testId", "value", "label", "onBlur", "containerStyle", "disabled", "error", "multiline", "numberOfLines"]);
70
+ const { styles, theme } = useStyles(disabled, !!error, !!multiline);
71
71
  const inputRef = (0, react_1.useRef)(null);
72
72
  (0, react_1.useImperativeHandle)(ref, () => ({
73
73
  focus: () => {
@@ -152,7 +152,7 @@ exports.TextInput = (0, react_1.forwardRef)((_a, ref) => {
152
152
  </react_native_reanimated_1.default.Text>
153
153
  </react_native_1.View>
154
154
  <react_native_reanimated_1.default.View style={animatedInputStyles}>
155
- {disabled ? (<Text_1.default style={styles.text}>{value}</Text_1.default>) : (<react_native_1.TextInput ref={inputRef} testID={testId} value={value} style={styles.textInput} numberOfLines={1} keyboardType={keyboardType} onChangeText={handleOnChangeText} maxLength={40} returnKeyType="done" onBlur={handleOnBlur} onFocus={onFocus} keyboardAppearance={theme.keyboardAppearance} {...rest}/>)}
155
+ {disabled ? (<Text_1.default style={styles.text}>{value}</Text_1.default>) : (<react_native_1.TextInput ref={inputRef} testID={testId} value={value} style={styles.textInput} numberOfLines={numberOfLines} multiline={multiline} keyboardType={keyboardType} onChangeText={handleOnChangeText} maxLength={40} returnKeyType="done" onBlur={handleOnBlur} onFocus={onFocus} keyboardAppearance={theme.keyboardAppearance} {...rest}/>)}
156
156
  </react_native_reanimated_1.default.View>
157
157
  </react_native_reanimated_1.default.View>
158
158
  </react_native_1.Pressable>
@@ -162,7 +162,7 @@ exports.TextInput = (0, react_1.forwardRef)((_a, ref) => {
162
162
  });
163
163
  exports.default = exports.TextInput;
164
164
  exports.TextInput.displayName = "TextInput";
165
- const useStyles = (disabled, error) => (0, hooks_1.useThemedStyle)((0, react_1.useCallback)((theme) => react_native_1.StyleSheet.create({
165
+ const useStyles = (disabled, error, multiline) => (0, hooks_1.useThemedStyle)((0, react_1.useCallback)((theme) => react_native_1.StyleSheet.create({
166
166
  container: {
167
167
  width: "100%",
168
168
  flexShrink: 0.5,
@@ -171,7 +171,7 @@ const useStyles = (disabled, error) => (0, hooks_1.useThemedStyle)((0, react_1.u
171
171
  flexGrow: 2,
172
172
  flexShrink: 1,
173
173
  },
174
- textInput: Object.assign(Object.assign({ paddingHorizontal: theme.size.baseSize * 2 }, theme.typography.p1), getTextInputStyle(disabled, error, {
174
+ textInput: Object.assign(Object.assign({ paddingHorizontal: theme.size.baseSize * 2, height: multiline ? "95%" : "auto" }, theme.typography.p1), getTextInputStyle(disabled, error, {
175
175
  disabled: {
176
176
  color: theme.colors.foregroundLowContrast,
177
177
  },
@@ -196,7 +196,9 @@ const useStyles = (disabled, error) => (0, hooks_1.useThemedStyle)((0, react_1.u
196
196
  itemContainer: {
197
197
  borderWidth: theme.borderWidth,
198
198
  backgroundColor: theme.colors.backgroundOnPrimary,
199
- height: theme.size.baseSize * 9,
199
+ height: multiline
200
+ ? theme.size.baseSize * 24
201
+ : theme.size.baseSize * 9,
200
202
  borderRadius: theme.borderRadius,
201
203
  minHeight: theme.size.baseSize * 8,
202
204
  flexDirection: "row",
@@ -211,6 +213,7 @@ const useStyles = (disabled, error) => (0, hooks_1.useThemedStyle)((0, react_1.u
211
213
  },
212
214
  labelContainer: {
213
215
  left: theme.size.baseSize * 2,
216
+ top: multiline ? theme.size.baseSize * 1 : theme.size.baseSize * 2,
214
217
  position: "absolute",
215
218
  },
216
219
  label: getLabelStyle(disabled, error, {
@@ -222,4 +225,4 @@ const useStyles = (disabled, error) => (0, hooks_1.useThemedStyle)((0, react_1.u
222
225
  marginHorizontal: theme.size.baseSize * 4,
223
226
  marginBottom: theme.size.baseSize * 2,
224
227
  },
225
- }), [disabled, error]));
228
+ }), [disabled, error, multiline]));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "atlas-design-system",
3
- "version": "1.14.0",
3
+ "version": "1.16.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",