@ledgerhq/native-ui 0.1.1 → 0.5.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.
Files changed (79) hide show
  1. package/README.md +21 -21
  2. package/assets/icons.d.ts +1 -0
  3. package/assets/icons.js +1 -0
  4. package/assets/logos/LedgerLiveAltRegular.d.ts +0 -1
  5. package/assets/logos/LedgerLiveRegular.d.ts +0 -1
  6. package/components/Carousel/index.d.ts +45 -0
  7. package/components/Carousel/index.js +76 -0
  8. package/components/Form/Checkbox/index.d.ts +2 -2
  9. package/components/Form/Checkbox/index.js +5 -5
  10. package/components/Form/Input/BaseInput/index.d.ts +105 -9
  11. package/components/Form/Input/BaseInput/index.js +25 -17
  12. package/components/Form/Input/LegendInput/index.d.ts +14 -3
  13. package/components/Form/Input/LegendInput/index.js +4 -3
  14. package/components/Form/Input/NumberInput/index.d.ts +16 -4
  15. package/components/Form/Input/NumberInput/index.js +17 -9
  16. package/components/Form/Input/QrCodeInput/index.d.ts +15 -4
  17. package/components/Form/Input/QrCodeInput/index.js +5 -4
  18. package/components/Form/Input/SearchInput/index.d.ts +13 -2
  19. package/components/Form/Input/SearchInput/index.js +4 -3
  20. package/components/Form/SelectableList.d.ts +17 -0
  21. package/components/Form/SelectableList.js +32 -0
  22. package/components/Form/Slider/components.js +6 -6
  23. package/components/Form/Slider/index.d.ts +2 -2
  24. package/components/Form/Slider/index.js +1 -1
  25. package/components/Form/Slider/index.native.d.ts +0 -1
  26. package/components/Form/Slider/index.native.js +2 -2
  27. package/components/Form/Switch/index.d.ts +0 -1
  28. package/components/Form/Switch/index.js +4 -4
  29. package/components/Form/Toggle/index.d.ts +0 -1
  30. package/components/Form/index.d.ts +1 -0
  31. package/components/Form/index.js +1 -0
  32. package/components/Icon/IconBox/index.js +2 -2
  33. package/components/Layout/Box/index.d.ts +11 -0
  34. package/components/Layout/Box/index.js +3 -0
  35. package/components/Layout/Flex/index.d.ts +11 -12
  36. package/components/Layout/Flex/index.js +2 -8
  37. package/components/Layout/Modals/BaseModal/index.d.ts +2 -2
  38. package/components/Layout/Modals/BaseModal/index.js +7 -7
  39. package/components/Layout/ScrollContainerHeader/Header.d.ts +0 -1
  40. package/components/Layout/ScrollContainerHeader/Header.js +1 -1
  41. package/components/Layout/Table/Row.d.ts +1 -1
  42. package/components/Layout/index.d.ts +3 -0
  43. package/components/Layout/index.js +3 -0
  44. package/components/Loader/index.d.ts +4 -1
  45. package/components/Loader/index.js +2 -2
  46. package/components/Navigation/SlideIndicator/index.js +15 -8
  47. package/components/Navigation/Stepper/index.js +13 -13
  48. package/components/Navigation/ToggleGroup/index.d.ts +8 -1
  49. package/components/Navigation/ToggleGroup/index.js +1 -1
  50. package/components/Text/getTextStyle.d.ts +10 -17
  51. package/components/Text/getTextStyle.js +24 -31
  52. package/components/Text/index.d.ts +6 -5
  53. package/components/Text/index.js +9 -3
  54. package/components/chart/index.d.ts +0 -1
  55. package/components/chart/index.js +6 -6
  56. package/components/cta/Button/getButtonStyle.js +12 -12
  57. package/components/cta/Button/index.d.ts +5 -16
  58. package/components/cta/Button/index.js +15 -16
  59. package/components/cta/Link/getLinkStyle.js +8 -8
  60. package/components/cta/Link/index.js +2 -2
  61. package/components/cta/getCtaStyle.d.ts +2 -2
  62. package/components/drawer/Notification/index.js +6 -12
  63. package/components/index.d.ts +1 -0
  64. package/components/index.js +1 -0
  65. package/components/message/Alert/index.d.ts +0 -1
  66. package/components/message/Alert/index.js +6 -6
  67. package/components/styled.d.ts +15 -0
  68. package/components/styled.js +12 -0
  69. package/components/tags/Badge/index.d.ts +2 -2
  70. package/components/tags/Badge/index.js +10 -10
  71. package/icons/Close.js +1 -1
  72. package/package.json +8 -10
  73. package/styles/InvertTheme.d.ts +0 -1
  74. package/styles/StyleProvider.d.ts +0 -9
  75. package/styles/StyleProvider.js +1 -1
  76. package/styles/helpers.d.ts +3 -1
  77. package/styles/helpers.js +4 -7
  78. package/styles/theme.d.ts +10 -34
  79. package/styles/theme.js +19 -37
@@ -16,7 +16,7 @@ import Input from "../BaseInput";
16
16
  import FlexBox from "../../../Layout/Flex";
17
17
  import QrCodeMedium from "@ledgerhq/icons-ui/native/QrCodeMedium";
18
18
  const QrCodeButton = styled(TouchableOpacity) `
19
- background-color: ${(p) => p.theme.colors.palette.neutral.c100};
19
+ background-color: ${(p) => p.theme.colors.neutral.c100};
20
20
  display: flex;
21
21
  align-items: center;
22
22
  justify-content: center;
@@ -26,11 +26,12 @@ const QrCodeButton = styled(TouchableOpacity) `
26
26
  border-width: 0;
27
27
  `;
28
28
  const Icon = styled(QrCodeMedium).attrs((p) => ({
29
- color: p.theme.colors.palette.neutral.c00,
29
+ color: p.theme.colors.neutral.c00,
30
30
  })) ``;
31
- export default function QrCodeInput(_a) {
31
+ function QrCodeInput(_a, ref) {
32
32
  var { onQrCodeClick } = _a, inputProps = __rest(_a, ["onQrCodeClick"]);
33
- return (React.createElement(Input, Object.assign({}, inputProps, { renderRight: React.createElement(FlexBox, { alignItems: "center", justifyContent: "center", pr: "8px" },
33
+ return (React.createElement(Input, Object.assign({ ref: ref }, inputProps, { renderRight: React.createElement(FlexBox, { alignItems: "center", justifyContent: "center", pr: "8px" },
34
34
  React.createElement(QrCodeButton, { onPress: onQrCodeClick },
35
35
  React.createElement(Icon, { size: "20px" }))) })));
36
36
  }
37
+ export default React.forwardRef(QrCodeInput);
@@ -1,3 +1,14 @@
1
- /// <reference types="react" />
1
+ import React from "react";
2
+ import { TextInput } from "react-native";
2
3
  import { InputProps } from "../BaseInput";
3
- export default function SearchInput(props: InputProps): JSX.Element;
4
+ declare const _default: React.ForwardRefExoticComponent<Omit<import("../BaseInput").CommonProps, "onChange" | "value"> & {
5
+ value: string;
6
+ renderLeft?: React.ReactNode | ((props: InputProps<string>) => React.ReactNode);
7
+ renderRight?: React.ReactNode | ((props: InputProps<string>) => React.ReactNode);
8
+ onChange?: ((value: string) => void) | undefined;
9
+ onChangeEvent?: ((e: import("react-native").NativeSyntheticEvent<import("react-native").TextInputChangeEventData>) => void) | undefined;
10
+ serialize?: ((value: string) => string) | undefined;
11
+ deserialize?: ((value: string) => string) | undefined;
12
+ containerStyle?: import("react-native").StyleProp<import("react-native").ViewStyle>;
13
+ } & React.RefAttributes<TextInput>>;
14
+ export default _default;
@@ -3,9 +3,10 @@ import styled from "styled-components/native";
3
3
  import Input, { InputRenderLeftContainer } from "../BaseInput";
4
4
  import SearchMedium from "@ledgerhq/icons-ui/native/SearchMedium";
5
5
  const Icon = styled(SearchMedium).attrs((p) => ({
6
- color: p.theme.colors.palette.neutral.c70,
6
+ color: p.theme.colors.neutral.c70,
7
7
  })) ``;
8
- export default function SearchInput(props) {
9
- return (React.createElement(Input, Object.assign({}, props, { renderLeft: React.createElement(InputRenderLeftContainer, null,
8
+ function SearchInput(props, ref) {
9
+ return (React.createElement(Input, Object.assign({ ref: ref }, props, { renderLeft: React.createElement(InputRenderLeftContainer, null,
10
10
  React.createElement(Icon, null)) })));
11
11
  }
12
+ export default React.forwardRef(SearchInput);
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+ import { GestureResponderEvent } from "react-native";
3
+ export declare type ElementProps<V> = React.PropsWithChildren<{
4
+ first?: boolean;
5
+ selected?: boolean;
6
+ value?: V;
7
+ onPress?: ((event: GestureResponderEvent) => void) | undefined;
8
+ }>;
9
+ export declare type Props<V> = React.PropsWithChildren<{
10
+ currentValue?: V;
11
+ onChange: (newValue: V) => void;
12
+ }>;
13
+ declare function SelectableList<V>({ currentValue, onChange, children }: Props<V>): JSX.Element;
14
+ declare namespace SelectableList {
15
+ var Element: <V>({ first, value, selected, onPress, children, }: ElementProps<V>) => JSX.Element;
16
+ }
17
+ export default SelectableList;
@@ -0,0 +1,32 @@
1
+ import React from "react";
2
+ import { TouchableOpacity } from "react-native";
3
+ import styled from "styled-components/native";
4
+ import { border } from "styled-system";
5
+ import Flex from "../Layout/Flex";
6
+ import { Text } from "../index";
7
+ const ElementContainer = styled(Flex).attrs({
8
+ accessible: true,
9
+ accessibilityRole: "radio",
10
+ }) `
11
+ ${border}
12
+ `;
13
+ function Element({ first, value, selected, onPress, children, }) {
14
+ return (React.createElement(TouchableOpacity, { onPress: onPress },
15
+ React.createElement(ElementContainer, { p: 6, mt: first ? 0 : 4, backgroundColor: selected ? "primary.c20" : "neutral.c00", border: "1px solid", borderColor: selected ? "primary.c100" : "neutral.c40", borderRadius: 1 },
16
+ React.createElement(Text, { variant: "large" }, children || value))));
17
+ }
18
+ function SelectableList({ currentValue, onChange, children }) {
19
+ return (React.createElement(Flex, { accessible: true, accessibilityRole: "radiogroup" }, React.Children.map(children, (child, index) => {
20
+ if (!React.isValidElement(child))
21
+ return null;
22
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
23
+ const casted = child;
24
+ return React.cloneElement(casted, {
25
+ first: index === 0,
26
+ onPress: () => onChange(casted === null || casted === void 0 ? void 0 : casted.props.value),
27
+ selected: (casted === null || casted === void 0 ? void 0 : casted.props.value) === currentValue,
28
+ });
29
+ })));
30
+ }
31
+ SelectableList.Element = Element;
32
+ export default SelectableList;
@@ -17,19 +17,19 @@ export const RailSelected = styled.View `
17
17
  margin-left: -5px;
18
18
  margin-right: -5px;
19
19
  height: 40px;
20
- background-color: ${(p) => p.theme.colors.palette.primary.c40};
20
+ background-color: ${(p) => p.theme.colors.primary.c40};
21
21
  border-radius: 30px;
22
22
  `;
23
23
  export const Rail = styled.View `
24
24
  flex: 1;
25
25
  height: 40px;
26
- background-color: ${(p) => p.theme.colors.palette.neutral.c30};
26
+ background-color: ${(p) => p.theme.colors.neutral.c30};
27
27
  border-radius: 30px;
28
28
  `;
29
29
  const ThumbContainer = styled.View `
30
30
  height: 40px;
31
31
  width: 40px;
32
- background-color: ${(p) => p.theme.colors.palette.primary.c90};
32
+ background-color: ${(p) => p.theme.colors.primary.c90};
33
33
  border-radius: 40px;
34
34
  display: flex;
35
35
  align-items: center;
@@ -38,7 +38,7 @@ const ThumbContainer = styled.View `
38
38
  export const Thumb = () => {
39
39
  const { colors } = useTheme();
40
40
  return (React.createElement(ThumbContainer, null,
41
- React.createElement(ArrowsHMedium, { color: colors.palette.neutral.c00, size: 24 })));
41
+ React.createElement(ArrowsHMedium, { color: colors.neutral.c00, size: 24 })));
42
42
  };
43
43
  const LabelContainer = styled.View `
44
44
  display: flex;
@@ -46,10 +46,10 @@ const LabelContainer = styled.View `
46
46
  justify-content: center;
47
47
  align-items: center;
48
48
  padding: 3.5px 6px;
49
- background-color: ${(p) => p.theme.colors.palette.primary.c20};
49
+ background-color: ${(p) => p.theme.colors.primary.c20};
50
50
  border-radius: 4px;
51
51
  `;
52
52
  export const Label = ({ children }) => {
53
53
  return (React.createElement(LabelContainer, null,
54
- React.createElement(Text, { type: "body", fontWeight: "semibold", color: "palette.primary.c90" }, children)));
54
+ React.createElement(Text, { variant: "body", fontWeight: "semiBold", color: "primary.c90" }, children)));
55
55
  };
@@ -1,3 +1,3 @@
1
- /// <reference types="react" />
2
- declare const SliderScreen: () => JSX.Element;
1
+ import type { SliderProps } from "./index.native";
2
+ declare const SliderScreen: (_props: SliderProps) => JSX.Element;
3
3
  export default SliderScreen;
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- const SliderScreen = () => {
2
+ const SliderScreen = (_props) => {
3
3
  return React.createElement(React.Fragment, null);
4
4
  };
5
5
  export default SliderScreen;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare type SliderProps = {
3
2
  step: number;
4
3
  min: number;
@@ -20,7 +20,7 @@ const Slider = ({ value, min, max, step, onChange, disabled }) => {
20
20
  width: "100%",
21
21
  }, min: min, max: max, low: value, disabled: disabled, step: step, disableRange: true, floatingLabel: true, renderThumb: Thumb, renderRail: renderRail, renderRailSelected: renderRailSelected, renderLabel: renderLabel, renderNotch: renderNotch, onValueChanged: onChange }),
22
22
  React.createElement(MinMaxTextContainer, null,
23
- React.createElement(Text, { type: "small", fontWeight: "medium", color: "palette.neutral.c70" }, min),
24
- React.createElement(Text, { type: "small", fontWeight: "medium", color: "palette.neutral.c70" }, max))));
23
+ React.createElement(Text, { variant: "small", fontWeight: "medium", color: "neutral.c70" }, min),
24
+ React.createElement(Text, { variant: "small", fontWeight: "medium", color: "neutral.c70" }, max))));
25
25
  };
26
26
  export default Slider;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare type SwitchProps = {
3
2
  checked: boolean;
4
3
  onChange?: (value: boolean) => void;
@@ -7,9 +7,9 @@ const Switch = ({ checked, onChange, disabled, label, }) => {
7
7
  const { colors, space } = useTheme();
8
8
  return (React.createElement(Flex, { flexDirection: "row", alignItems: "center" },
9
9
  React.createElement(NativeSwitch, { trackColor: {
10
- false: colors.palette.neutral.c50,
11
- true: colors.palette.primary.c80,
12
- }, thumbColor: colors.palette.neutral.c00, onValueChange: onChange, value: checked, disabled: disabled, ios_backgroundColor: colors.palette.neutral.c50 }),
13
- label ? (React.createElement(Text, { type: "body", color: checked ? colors.palette.primary.c90 : colors.palette.neutral.c100, style: { marginLeft: space[3] } }, label)) : null));
10
+ false: colors.neutral.c50,
11
+ true: colors.primary.c80,
12
+ }, thumbColor: colors.neutral.c00, onValueChange: onChange, value: checked, disabled: disabled, ios_backgroundColor: colors.neutral.c50 }),
13
+ label ? (React.createElement(Text, { variant: "body", color: checked ? colors.primary.c90 : colors.neutral.c100, style: { marginLeft: space[3] } }, label)) : null));
14
14
  };
15
15
  export default Switch;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { ButtonProps } from "../../cta/Button";
3
2
  declare type ToggleProps = {
4
3
  active?: boolean;
@@ -2,3 +2,4 @@ export { default as Checkbox } from "./Checkbox";
2
2
  export * from "./Input";
3
3
  export { default as Slider } from "./Slider";
4
4
  export { default as Switch } from "./Switch";
5
+ export { default as SelectableList } from "./SelectableList";
@@ -2,3 +2,4 @@ export { default as Checkbox } from "./Checkbox";
2
2
  export * from "./Input";
3
3
  export { default as Slider } from "./Slider";
4
4
  export { default as Switch } from "./Switch";
5
+ export { default as SelectableList } from "./SelectableList";
@@ -9,11 +9,11 @@ const IconContainer = styled.View `
9
9
  align-items: center;
10
10
  justify-content: center;
11
11
  border-width: 1px;
12
- border-color: ${(p) => p.theme.colors.palette.neutral.c40};
12
+ border-color: ${(p) => p.theme.colors.neutral.c40};
13
13
  border-radius: ${(p) => `${p.theme.radii[1]}px`};
14
14
  `;
15
15
  export default function IconBox({ Icon, color, boxSize = DEFAULT_BOX_SIZE, iconSize = DEFAULT_ICON_SIZE, }) {
16
16
  const { colors } = useTheme();
17
17
  return (React.createElement(IconContainer, { size: boxSize },
18
- React.createElement(Icon, { size: iconSize, color: color || colors.palette.neutral.c100 })));
18
+ React.createElement(Icon, { size: iconSize, color: color || colors.neutral.c100 })));
19
19
  }
@@ -0,0 +1,11 @@
1
+ import { BaseStyledProps } from "../../styled";
2
+ export declare type BoxProps = BaseStyledProps;
3
+ declare const Box: import("styled-components").StyledComponent<typeof import("react-native").View, import("styled-components").DefaultTheme, import("styled-system").SpaceProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("styled-system").FlexboxProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").PositionProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").ColorProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("styled-system").LayoutProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").OverflowProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").BorderProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.Border<import("styled-system").TLengthStyledSystem>> & import("styled-system").BackgroundProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.Background<import("styled-system").TLengthStyledSystem>> & {
4
+ columnGap?: string | number | undefined;
5
+ rowGap?: string | number | undefined;
6
+ color?: string | undefined;
7
+ display?: string | undefined;
8
+ position?: string | undefined;
9
+ maxHeight?: number | undefined;
10
+ }, never>;
11
+ export default Box;
@@ -0,0 +1,3 @@
1
+ import baseStyled from "../../styled";
2
+ const Box = baseStyled.View ``;
3
+ export default Box;
@@ -1,13 +1,12 @@
1
- /// <reference types="styled-components-react-native" />
2
- import React from "react";
3
- import { BackgroundProps, ColorProps, FlexboxProps, LayoutProps, SpaceProps } from "styled-system";
4
- export interface Props extends ColorProps, BackgroundProps, LayoutProps, FlexboxProps, SpaceProps {
5
- alignItems?: "flex-start" | "flex-end" | "center" | "baseline" | "stretch";
6
- flexBasis?: string;
7
- flexDirection?: "row" | "row-reverse" | "column" | "column-reverse";
8
- justifyContent?: "flex-start" | "flex-end" | "center" | "space-between" | "space-around" | "space-evenly";
9
- children?: React.ReactNode;
10
- style?: Record<string, unknown>;
11
- }
12
- declare const FlexBox: import("styled-components").StyledComponent<typeof import("react-native").View, import("styled-components").DefaultTheme, Props, never>;
1
+ import { BaseStyledProps } from "../../styled";
2
+ export declare type FlexBoxProps = BaseStyledProps;
3
+ export declare type Props = FlexBoxProps;
4
+ declare const FlexBox: import("styled-components").StyledComponent<typeof import("react-native").View, import("styled-components").DefaultTheme, import("styled-system").SpaceProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("styled-system").FlexboxProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").PositionProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").ColorProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("styled-system").LayoutProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").OverflowProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").BorderProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.Border<import("styled-system").TLengthStyledSystem>> & import("styled-system").BackgroundProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.Background<import("styled-system").TLengthStyledSystem>> & {
5
+ columnGap?: string | number | undefined;
6
+ rowGap?: string | number | undefined;
7
+ color?: string | undefined;
8
+ display?: string | undefined;
9
+ position?: string | undefined;
10
+ maxHeight?: number | undefined;
11
+ }, never>;
13
12
  export default FlexBox;
@@ -1,11 +1,5 @@
1
- import styled from "styled-components/native";
2
- import { background, color, flexbox, layout, space, } from "styled-system";
3
- const FlexBox = styled.View `
1
+ import baseStyled from "../../styled";
2
+ const FlexBox = baseStyled.View `
4
3
  display: flex;
5
- ${flexbox};
6
- ${space};
7
- ${background};
8
- ${color};
9
- ${layout};
10
4
  `;
11
5
  export default FlexBox;
@@ -16,5 +16,5 @@ export declare type BaseModalProps = {
16
16
  description?: string;
17
17
  subtitle?: string;
18
18
  children: React.ReactNode;
19
- } & ModalProps;
20
- export default function BaseModal({ isOpen, onClose, containerStyle, modalStyle, preventBackdropClick, Icon, iconColor, title, description, subtitle, children, ...rest }: Partial<BaseModalProps>): React.ReactElement;
19
+ } & Partial<ModalProps>;
20
+ export default function BaseModal({ isOpen, onClose, containerStyle, modalStyle, preventBackdropClick, Icon, iconColor, title, description, subtitle, children, ...rest }: BaseModalProps): React.ReactElement;
@@ -19,7 +19,7 @@ import FlexBox from "../../../Layout/Flex";
19
19
  import Text from "../../../Text";
20
20
  const { width, height } = sizes;
21
21
  const Container = styled.View `
22
- background-color: ${(p) => p.theme.colors.palette.background.main};
22
+ background-color: ${(p) => p.theme.colors.background.main};
23
23
  width: 100%;
24
24
  padding: 16px;
25
25
  min-height: 350px;
@@ -38,19 +38,19 @@ const CloseContainer = styled.View `
38
38
  align-items: flex-end;
39
39
  margin-bottom: ${(p) => p.theme.space[7]}px;
40
40
  `;
41
- const StyledTitle = styled(Text).attrs({ type: "h3" }) `
41
+ const StyledTitle = styled(Text).attrs({ variant: "h3" }) `
42
42
  text-transform: uppercase;
43
43
  `;
44
44
  const StyledDescription = styled(Text).attrs({
45
- type: "body",
46
- color: "palette.neutral.c80",
45
+ variant: "body",
46
+ color: "neutral.c80",
47
47
  }) `
48
48
  text-transform: capitalize;
49
49
  margin-top: ${(p) => p.theme.space[2]}px;
50
50
  `;
51
51
  const StyledSubtitle = styled(Text).attrs({
52
- type: "subTitle",
53
- color: "palette.neutral.c80",
52
+ variant: "subtitle",
53
+ color: "neutral.c80",
54
54
  }) `
55
55
  text-transform: uppercase;
56
56
  margin-bottom: ${(p) => p.theme.space[2]}px;
@@ -77,7 +77,7 @@ export default function BaseModal(_a) {
77
77
  Icon && (React.createElement(FlexBox, { mb: 24 }, typeof Icon === "function"
78
78
  ? Icon({
79
79
  size: 48,
80
- color: iconColor || colors.palette.neutral.c100,
80
+ color: iconColor || colors.neutral.c100,
81
81
  })
82
82
  : Icon)),
83
83
  subtitle && React.createElement(StyledSubtitle, null, subtitle),
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import Animated from "react-native-reanimated";
3
2
  export declare type HeaderProps = {
4
3
  TopLeftSection?: JSX.Element;
@@ -6,7 +6,7 @@ import Flex from "../Flex";
6
6
  const Container = styled(Flex).attrs({
7
7
  paddingHorizontal: 16,
8
8
  }) `
9
- background-color: ${(p) => p.theme.colors.palette.background.main};
9
+ background-color: ${(p) => p.theme.colors.background.main};
10
10
  width: 100%;
11
11
  `;
12
12
  const SCROLL_BREAKPOINT = 80;
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { Props as FlexBoxProps } from "../Flex";
3
3
  interface Props extends FlexBoxProps {
4
- Icon: (props: {
4
+ Icon?: (props: {
5
5
  size?: number;
6
6
  }) => React.ReactElement;
7
7
  iconBorder?: boolean;
@@ -1,4 +1,7 @@
1
+ export { default as Accordion } from "./Collapse/Accordion";
1
2
  export { default as Flex } from "./Flex";
3
+ export { default as Box } from "./Box";
2
4
  export * from "./Modals";
3
5
  export { default as ScrollContainer } from "./ScrollContainer";
6
+ export { default as ScrollContainerHeader } from "./ScrollContainerHeader";
4
7
  export { default as Row } from "./Table/Row";
@@ -1,4 +1,7 @@
1
+ export { default as Accordion } from "./Collapse/Accordion";
1
2
  export { default as Flex } from "./Flex";
3
+ export { default as Box } from "./Box";
2
4
  export * from "./Modals";
3
5
  export { default as ScrollContainer } from "./ScrollContainer";
6
+ export { default as ScrollContainerHeader } from "./ScrollContainerHeader";
4
7
  export { default as Row } from "./Table/Row";
@@ -2,7 +2,10 @@ import React from "react";
2
2
  declare type Props = {
3
3
  progress?: number;
4
4
  onPress?: () => void;
5
- Icon?: typeof React.Component;
5
+ Icon?: React.ComponentType<{
6
+ color: string;
7
+ size: number;
8
+ }>;
6
9
  };
7
10
  declare const ProgressLoader: ({ progress, onPress, Icon, }: Props) => React.ReactElement;
8
11
  export default ProgressLoader;
@@ -10,8 +10,8 @@ const iconSize = radius * 0.88;
10
10
  const iconOffset = radius - iconSize / 2;
11
11
  const ProgressLoader = ({ progress = 0, onPress, Icon, }) => {
12
12
  const { colors } = useTheme();
13
- const backgroundColor = colors.palette.primary.c20;
14
- const progressColor = colors.palette.primary.c90;
13
+ const backgroundColor = colors.primary.c20;
14
+ const progressColor = colors.primary.c90;
15
15
  const strokeDashoffset = circumference - progress * circumference;
16
16
  return (React.createElement(TouchableOpacity, { disabled: !onPress, onPress: onPress },
17
17
  React.createElement(Svg, { width: radius * 2, height: radius * 2 },
@@ -1,6 +1,6 @@
1
1
  import React, { useMemo } from "react";
2
2
  import styled from "styled-components/native";
3
- import Animated, { useAnimatedStyle, Easing, withTiming, } from "react-native-reanimated";
3
+ import Animated, { useDerivedValue, useAnimatedStyle, Easing, withTiming, } from "react-native-reanimated";
4
4
  const Container = styled.View `
5
5
  flex-direction: row;
6
6
  align-items: center;
@@ -8,15 +8,19 @@ const Container = styled.View `
8
8
  height: 6px;
9
9
  position: relative;
10
10
  `;
11
- const Bullet = styled.TouchableOpacity `
11
+ const bulletStyle = `
12
12
  width: 6px;
13
13
  height: 6px;
14
14
  border-radius: 6px;
15
15
  margin: 0 6px;
16
- background-color: ${(p) => p.theme.colors.palette.neutral.c40};
17
16
  `;
18
- const ActiveBullet = styled(Bullet) `
19
- background-color: ${(p) => p.theme.colors.palette.neutral.c100};
17
+ const Bullet = styled.TouchableOpacity `
18
+ ${bulletStyle}
19
+ background-color: ${(p) => p.theme.colors.neutral.c40};
20
+ `;
21
+ const ActiveBullet = styled.View.attrs({ pointerEvents: "none" }) `
22
+ ${bulletStyle}
23
+ background-color: ${(p) => p.theme.colors.neutral.c100};
20
24
  position: absolute;
21
25
  top: 0;
22
26
  left: 0;
@@ -28,10 +32,13 @@ const config = {
28
32
  };
29
33
  function SlideIndicator({ slidesLength, activeIndex = 0, onChange, }) {
30
34
  const slidesArray = useMemo(() => new Array(slidesLength).fill(0), [slidesLength]);
31
- const activeSize = useMemo(() => (Math.max(0, Math.min(slidesLength - 1, activeIndex)) + 1) * (6 + 12) -
32
- 12, [activeIndex, slidesLength]);
35
+ const activeSize = useDerivedValue(() => {
36
+ const size = (Math.max(0, Math.min(slidesLength - 1, activeIndex)) + 1) * (6 + 12) -
37
+ 12;
38
+ return size;
39
+ }, [activeIndex, slidesLength]);
33
40
  const animatedStyles = useAnimatedStyle(() => ({
34
- width: withTiming(activeSize, config),
41
+ width: withTiming(activeSize.value, config),
35
42
  }));
36
43
  return (React.createElement(Container, null,
37
44
  slidesArray.map((_, index) => (React.createElement(Bullet, { key: index, onPress: () => onChange(index) }))),
@@ -19,12 +19,12 @@ import Animated, { useAnimatedStyle, withTiming, withDelay, Easing, } from "reac
19
19
  const Separator = styled.View `
20
20
  flex: 1;
21
21
  height: 1px;
22
- background-color: ${(p) => p.theme.colors.palette.neutral.c40};
22
+ background-color: ${(p) => p.theme.colors.neutral.c40};
23
23
  ${space}
24
24
  `;
25
25
  const SeparatorFilling = Animated.createAnimatedComponent(styled.View `
26
26
  height: 100%;
27
- background-color: ${(p) => p.theme.colors.palette.neutral.c100};
27
+ background-color: ${(p) => p.theme.colors.neutral.c100};
28
28
  `);
29
29
  const AnimatedSeparator = (_a) => {
30
30
  var { filled, delay, duration } = _a, spaceProps = __rest(_a, ["filled", "delay", "duration"]);
@@ -67,13 +67,13 @@ const StepIcon = {
67
67
  width: ${(p) => p.theme.space[2]}px;
68
68
  height: ${(p) => p.theme.space[2]}px;
69
69
  border-radius: ${(p) => p.theme.radii[2]}px;
70
- background-color: ${(p) => p.theme.colors.palette.primary.c90};
70
+ background-color: ${(p) => p.theme.colors.primary.c90};
71
71
  `,
72
72
  Pending: styled.View `
73
73
  width: ${(p) => p.theme.space[1]}px;
74
74
  height: ${(p) => p.theme.space[1]}px;
75
75
  border-radius: ${(p) => p.theme.space[1]}px;
76
- background-color: ${(p) => p.theme.colors.palette.neutral.c70};
76
+ background-color: ${(p) => p.theme.colors.neutral.c70};
77
77
  `,
78
78
  Completed: ({ color }) => (React.createElement(CheckAlone, { size: 16, color: color })),
79
79
  Errored: ({ color }) => (React.createElement(CloseMedium, { size: 16, color: color })),
@@ -85,13 +85,13 @@ const StepView = styled.View `
85
85
  justify-content: center;
86
86
  `;
87
87
  const ActiveText = styled(Text) `
88
- color: ${(p) => p.theme.colors.palette.neutral.c100};
88
+ color: ${(p) => p.theme.colors.neutral.c100};
89
89
  `;
90
90
  const PendingText = styled(Text) `
91
- color: ${(p) => p.theme.colors.palette.neutral.c70};
91
+ color: ${(p) => p.theme.colors.neutral.c70};
92
92
  `;
93
93
  const ErroredText = styled(Text) `
94
- color: ${(p) => p.theme.colors.palette.error.c100};
94
+ color: ${(p) => p.theme.colors.error.c100};
95
95
  `;
96
96
  function Step({ state, label, showLeftSeparator, showRightSeparator, }) {
97
97
  const labelText = useMemo(() => {
@@ -109,19 +109,19 @@ function Step({ state, label, showLeftSeparator, showRightSeparator, }) {
109
109
  const icon = useMemo(() => {
110
110
  switch (state) {
111
111
  case "COMPLETED":
112
- return (React.createElement(StepIcon.Background, { backgroundColor: "palette.primary.c20" },
113
- React.createElement(StepIcon.Completed, { color: colors.palette.primary.c90 })));
112
+ return (React.createElement(StepIcon.Background, { backgroundColor: "primary.c20" },
113
+ React.createElement(StepIcon.Completed, { color: colors.primary.c90 })));
114
114
  case "CURRENT":
115
- return (React.createElement(StepIcon.Background, { backgroundColor: "palette.primary.c20" },
115
+ return (React.createElement(StepIcon.Background, { backgroundColor: "primary.c20" },
116
116
  React.createElement(StepIcon.Current, null)));
117
117
  case "ERRORED":
118
- return (React.createElement(StepIcon.Background, { backgroundColor: "palette.warning.c30" },
119
- React.createElement(StepIcon.Errored, { color: colors.palette.error.c100 })));
118
+ return (React.createElement(StepIcon.Background, { backgroundColor: "warning.c30" },
119
+ React.createElement(StepIcon.Errored, { color: colors.error.c100 })));
120
120
  case "PENDING":
121
121
  return (React.createElement(StepIcon.Background, null,
122
122
  React.createElement(StepIcon.Pending, null)));
123
123
  }
124
- }, [state]);
124
+ }, [state, colors]);
125
125
  return (React.createElement(StepView, null,
126
126
  React.createElement(StepIcon.Container, { mb: 2 },
127
127
  showLeftSeparator && (React.createElement(AnimatedSeparator, { filled: state !== "PENDING", duration: 100, delay: state !== "PENDING" ? 350 : 0 })),
@@ -6,7 +6,14 @@ export declare type ToggleGroupProps = {
6
6
  activeIndex: number;
7
7
  onChange: (newIndex: number) => void;
8
8
  };
9
- export declare const ToggleGroupContainer: import("styled-components").StyledComponent<typeof import("react-native").View, import("styled-components").DefaultTheme, import("../../Layout/Flex").Props & {
9
+ export declare const ToggleGroupContainer: import("styled-components").StyledComponent<typeof import("react-native").View, import("styled-components").DefaultTheme, import("styled-system").SpaceProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("styled-system").FlexboxProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").PositionProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").ColorProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("styled-system").LayoutProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").OverflowProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").BorderProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.Border<import("styled-system").TLengthStyledSystem>> & import("styled-system").BackgroundProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.Background<import("styled-system").TLengthStyledSystem>> & {
10
+ columnGap?: string | number | undefined;
11
+ rowGap?: string | number | undefined;
12
+ color?: string | undefined;
13
+ display?: string | undefined;
14
+ position?: string | undefined;
15
+ maxHeight?: number | undefined;
16
+ } & {
10
17
  flexDirection: string;
11
18
  alignItems: string;
12
19
  }, "alignItems" | "flexDirection">;
@@ -9,7 +9,7 @@ export const ToggleGroupContainer = styled(FlexBox).attrs({
9
9
  alignItems: "stretch",
10
10
  }) `
11
11
  width: 100%;
12
- border: ${(p) => `1px solid ${p.theme.colors.palette.neutral.c40}`};
12
+ border: ${(p) => `1px solid ${p.theme.colors.neutral.c40}`};
13
13
  border-radius: 35px;
14
14
  padding: 4px;
15
15
  `;
@@ -1,22 +1,15 @@
1
- export declare type TextTypes = "h1" | "h2" | "h3" | "emphasis" | "body" | "link" | "subTitle" | "small" | "tag" | "large" | "paragraph";
2
- export declare type FontWeightTypes = "medium" | "semibold" | "bold";
1
+ import { TextVariants } from "../../styles/theme";
2
+ import { BaseTextProps } from "./index";
3
+ export declare type FontWeightTypes = "medium" | "semiBold" | "bold";
3
4
  export declare function getTextTypeStyle({ bracket }: {
4
5
  bracket?: boolean;
5
- }): {
6
- [index: string]: {
7
- fontFamily: string;
8
- fontSize: number;
9
- lineHeight: number;
10
- paddingTop?: number;
11
- };
12
- };
13
- export declare function getTextStyle({ type, bracket, fontWeight, }: {
14
- type?: TextTypes;
15
- bracket?: boolean;
16
- fontWeight?: FontWeightTypes;
17
- }): {
6
+ }): Record<TextVariants, {
7
+ fontFamily: string;
8
+ lineHeight?: number;
9
+ paddingTop?: number;
10
+ }>;
11
+ export declare function getTextStyle({ variant, bracket, fontWeight, }: Partial<BaseTextProps>): {
18
12
  fontFamily: string;
19
- fontSize: number;
20
- lineHeight: number;
13
+ lineHeight?: number;
21
14
  paddingTop?: number;
22
15
  };