@dryanovski/react-native-components 1.0.6 → 1.0.8
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/lib/module/assets/fonts/CodanBold.ttf +0 -0
- package/lib/module/assets/fonts/CodanBook.ttf +0 -0
- package/lib/module/assets/fonts/CodanLight.ttf +0 -0
- package/lib/module/assets/fonts/CodanMedium.ttf +0 -0
- package/lib/module/assets/fonts/CodanRegular.ttf +0 -0
- package/lib/module/components/Button/Button.js +41 -0
- package/lib/module/components/Button/Button.js.map +1 -0
- package/lib/module/components/Button/DangerButton.js +19 -0
- package/lib/module/components/Button/DangerButton.js.map +1 -0
- package/lib/module/components/Button/GhostButton.js +15 -0
- package/lib/module/components/Button/GhostButton.js.map +1 -0
- package/lib/module/components/Button/PrimaryButton.js +18 -0
- package/lib/module/components/Button/PrimaryButton.js.map +1 -0
- package/lib/module/components/Button/SecondaryButton.js +18 -0
- package/lib/module/components/Button/SecondaryButton.js.map +1 -0
- package/lib/module/components/Button/style.js +66 -0
- package/lib/module/components/Button/style.js.map +1 -0
- package/lib/module/components/Button/types.js +4 -0
- package/lib/module/components/Button/types.js.map +1 -0
- package/lib/module/components/Divider/Divider.js +33 -0
- package/lib/module/components/Divider/Divider.js.map +1 -0
- package/lib/module/components/Divider/styles.js +2 -0
- package/lib/module/components/Divider/styles.js.map +1 -0
- package/lib/module/components/Divider/types.js +4 -0
- package/lib/module/components/Divider/types.js.map +1 -0
- package/lib/module/components/Layout/HStack.js +24 -0
- package/lib/module/components/Layout/HStack.js.map +1 -0
- package/lib/module/components/Layout/VStack.js +24 -0
- package/lib/module/components/Layout/VStack.js.map +1 -0
- package/lib/module/components/Layout/layout.types.js +4 -0
- package/lib/module/components/Layout/layout.types.js.map +1 -0
- package/lib/module/index.js +17 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/providers/ThemeProvider.js +20 -1
- package/lib/module/providers/ThemeProvider.js.map +1 -1
- package/lib/module/utils/fontScale.js +66 -0
- package/lib/module/utils/fontScale.js.map +1 -0
- package/lib/module/utils/getDeviceType.js +20 -0
- package/lib/module/utils/getDeviceType.js.map +1 -0
- package/lib/module/utils/getScreenSizeCategory.js +16 -0
- package/lib/module/utils/getScreenSizeCategory.js.map +1 -0
- package/lib/typescript/src/components/Button/Button.d.ts +8 -0
- package/lib/typescript/src/components/Button/Button.d.ts.map +1 -0
- package/lib/typescript/src/components/Button/DangerButton.d.ts +8 -0
- package/lib/typescript/src/components/Button/DangerButton.d.ts.map +1 -0
- package/lib/typescript/src/components/Button/GhostButton.d.ts +4 -0
- package/lib/typescript/src/components/Button/GhostButton.d.ts.map +1 -0
- package/lib/typescript/src/components/Button/PrimaryButton.d.ts +7 -0
- package/lib/typescript/src/components/Button/PrimaryButton.d.ts.map +1 -0
- package/lib/typescript/src/components/Button/SecondaryButton.d.ts +7 -0
- package/lib/typescript/src/components/Button/SecondaryButton.d.ts.map +1 -0
- package/lib/typescript/src/components/Button/style.d.ts +64 -0
- package/lib/typescript/src/components/Button/style.d.ts.map +1 -0
- package/lib/typescript/src/components/Button/types.d.ts +51 -0
- package/lib/typescript/src/components/Button/types.d.ts.map +1 -0
- package/lib/typescript/src/components/Divider/Divider.d.ts +5 -0
- package/lib/typescript/src/components/Divider/Divider.d.ts.map +1 -0
- package/lib/typescript/src/components/Divider/styles.d.ts +1 -0
- package/lib/typescript/src/components/Divider/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/Divider/types.d.ts +31 -0
- package/lib/typescript/src/components/Divider/types.d.ts.map +1 -0
- package/lib/typescript/src/components/Layout/HStack.d.ts +4 -0
- package/lib/typescript/src/components/Layout/HStack.d.ts.map +1 -0
- package/lib/typescript/src/components/Layout/VStack.d.ts +4 -0
- package/lib/typescript/src/components/Layout/VStack.d.ts.map +1 -0
- package/lib/typescript/src/components/Layout/layout.types.d.ts +8 -0
- package/lib/typescript/src/components/Layout/layout.types.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +15 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/providers/ThemeProvider.d.ts.map +1 -1
- package/lib/typescript/src/utils/fontScale.d.ts +2 -0
- package/lib/typescript/src/utils/fontScale.d.ts.map +1 -0
- package/lib/typescript/src/utils/getDeviceType.d.ts +2 -0
- package/lib/typescript/src/utils/getDeviceType.d.ts.map +1 -0
- package/lib/typescript/src/utils/getScreenSizeCategory.d.ts +2 -0
- package/lib/typescript/src/utils/getScreenSizeCategory.d.ts.map +1 -0
- package/package.json +4 -3
- package/src/assets/fonts/CodanBold.ttf +0 -0
- package/src/assets/fonts/CodanBook.ttf +0 -0
- package/src/assets/fonts/CodanLight.ttf +0 -0
- package/src/assets/fonts/CodanMedium.ttf +0 -0
- package/src/assets/fonts/CodanRegular.ttf +0 -0
- package/src/components/Button/Button.tsx +55 -0
- package/src/components/Button/DangerButton.tsx +17 -0
- package/src/components/Button/GhostButton.tsx +13 -0
- package/src/components/Button/PrimaryButton.tsx +16 -0
- package/src/components/Button/SecondaryButton.tsx +16 -0
- package/src/components/Button/style.ts +76 -0
- package/src/components/Button/types.ts +62 -0
- package/src/components/Divider/Divider.tsx +28 -0
- package/src/components/Divider/styles.ts +0 -0
- package/src/components/Divider/types.ts +36 -0
- package/src/components/Layout/HStack.tsx +19 -0
- package/src/components/Layout/VStack.tsx +19 -0
- package/src/components/Layout/layout.types.ts +9 -0
- package/src/index.tsx +17 -0
- package/src/providers/ThemeProvider.tsx +20 -0
- package/src/utils/fontScale.ts +51 -0
- package/src/utils/getDeviceType.ts +20 -0
- package/src/utils/getScreenSizeCategory.ts +12 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { Text, TouchableOpacity } from 'react-native';
|
|
5
|
+
import Styles from "./style.js";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
/**
|
|
8
|
+
* A customizable button component that supports different variants and sizes.
|
|
9
|
+
* @return A TouchableOpacity button with text.
|
|
10
|
+
*/
|
|
11
|
+
export const Button = /*#__PURE__*/forwardRef((props, ref) => {
|
|
12
|
+
const {
|
|
13
|
+
variant = 'primary',
|
|
14
|
+
title,
|
|
15
|
+
size = 'medium',
|
|
16
|
+
onPress = () => undefined,
|
|
17
|
+
style,
|
|
18
|
+
disabled = false,
|
|
19
|
+
textStyle,
|
|
20
|
+
...rest
|
|
21
|
+
} = props;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Derives the text style variant based on the button variant.
|
|
25
|
+
*/
|
|
26
|
+
const textVariant = 'text_' + variant;
|
|
27
|
+
return /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
28
|
+
ref: ref,
|
|
29
|
+
onPress: onPress,
|
|
30
|
+
disabled: disabled,
|
|
31
|
+
style: [Styles._base, Styles[size], Styles[variant], disabled && Styles._disabled, style],
|
|
32
|
+
...rest,
|
|
33
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
34
|
+
style: [Styles._text, Styles[textVariant], textStyle],
|
|
35
|
+
children: title
|
|
36
|
+
})
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
Button.displayName = 'ButtonBase';
|
|
40
|
+
export default Button;
|
|
41
|
+
//# sourceMappingURL=Button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["forwardRef","Text","TouchableOpacity","Styles","jsx","_jsx","Button","props","ref","variant","title","size","onPress","undefined","style","disabled","textStyle","rest","textVariant","_base","_disabled","children","_text","displayName"],"sourceRoot":"../../../../src","sources":["components/Button/Button.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,IAAI,EAAEC,gBAAgB,QAAQ,cAAc;AACrD,OAAOC,MAAM,MAAM,YAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAQ7B;AACA;AACA;AACA;AACA,OAAO,MAAMC,MAAM,gBAAGN,UAAU,CAA6B,CAACO,KAAK,EAAEC,GAAG,KAAK;EAC3E,MAAM;IACJC,OAAO,GAAG,SAAS;IACnBC,KAAK;IACLC,IAAI,GAAG,QAAQ;IACfC,OAAO,GAAGA,CAAA,KAAMC,SAAS;IACzBC,KAAK;IACLC,QAAQ,GAAG,KAAK;IAChBC,SAAS;IACT,GAAGC;EACL,CAAC,GAAGV,KAAK;;EAET;AACF;AACA;EACE,MAAMW,WAAW,GAAI,OAAO,GAAGT,OAAmC;EAElE,oBACEJ,IAAA,CAACH,gBAAgB;IACfM,GAAG,EAAEA,GAAI;IACTI,OAAO,EAAEA,OAAQ;IACjBG,QAAQ,EAAEA,QAAS;IACnBD,KAAK,EAAE,CACLX,MAAM,CAACgB,KAAK,EACZhB,MAAM,CAACQ,IAAI,CAAe,EAC1BR,MAAM,CAACM,OAAO,CAAkB,EAChCM,QAAQ,IAAIZ,MAAM,CAACiB,SAAS,EAC5BN,KAAK,CACL;IAAA,GACEG,IAAI;IAAAI,QAAA,eAERhB,IAAA,CAACJ,IAAI;MAACa,KAAK,EAAE,CAACX,MAAM,CAACmB,KAAK,EAAEnB,MAAM,CAACe,WAAW,CAAC,EAAEF,SAAS,CAAE;MAAAK,QAAA,EACzDX;IAAK,CACF;EAAC,CACS,CAAC;AAEvB,CAAC,CAAC;AAEFJ,MAAM,CAACiB,WAAW,GAAG,YAAY;AAEjC,eAAejB,MAAM","ignoreList":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { Button } from "./Button.js";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
/**
|
|
7
|
+
* A button component styled for dangerous actions, such as deletions.
|
|
8
|
+
* @returns A ButtonBase component with the "danger" variant.
|
|
9
|
+
*/
|
|
10
|
+
export const DangerButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
11
|
+
return /*#__PURE__*/_jsx(Button, {
|
|
12
|
+
ref: ref,
|
|
13
|
+
variant: "danger",
|
|
14
|
+
...props
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
DangerButton.displayName = 'DangerButton';
|
|
18
|
+
export default DangerButton;
|
|
19
|
+
//# sourceMappingURL=DangerButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["forwardRef","Button","jsx","_jsx","DangerButton","props","ref","variant","displayName"],"sourceRoot":"../../../../src","sources":["components/Button/DangerButton.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,MAAM,QAAQ,aAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGlC;AACA;AACA;AACA;AACA,OAAO,MAAMC,YAAY,gBAAGJ,UAAU,CACpC,CAACK,KAAK,EAAEC,GAAG,KAAK;EACd,oBAAOH,IAAA,CAACF,MAAM;IAACK,GAAG,EAAEA,GAAI;IAACC,OAAO,EAAC,QAAQ;IAAA,GAAKF;EAAK,CAAG,CAAC;AACzD,CACF,CAAC;AAEDD,YAAY,CAACI,WAAW,GAAG,cAAc;AAEzC,eAAeJ,YAAY","ignoreList":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { Button } from "./Button.js";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
export const GhostButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
7
|
+
return /*#__PURE__*/_jsx(Button, {
|
|
8
|
+
ref: ref,
|
|
9
|
+
variant: "ghost",
|
|
10
|
+
...props
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
GhostButton.displayName = 'GhostButton';
|
|
14
|
+
export default GhostButton;
|
|
15
|
+
//# sourceMappingURL=GhostButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["forwardRef","Button","jsx","_jsx","GhostButton","props","ref","variant","displayName"],"sourceRoot":"../../../../src","sources":["components/Button/GhostButton.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,MAAM,QAAQ,aAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGlC,OAAO,MAAMC,WAAW,gBAAGJ,UAAU,CACnC,CAACK,KAAK,EAAEC,GAAG,KAAK;EACd,oBAAOH,IAAA,CAACF,MAAM;IAACK,GAAG,EAAEA,GAAI;IAACC,OAAO,EAAC,OAAO;IAAA,GAAKF;EAAK,CAAG,CAAC;AACxD,CACF,CAAC;AAEDD,WAAW,CAACI,WAAW,GAAG,aAAa;AAEvC,eAAeJ,WAAW","ignoreList":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { Button } from "./Button.js";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
/**
|
|
7
|
+
* A button component styled for primary actions.
|
|
8
|
+
*/
|
|
9
|
+
export const PrimaryButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
10
|
+
return /*#__PURE__*/_jsx(Button, {
|
|
11
|
+
ref: ref,
|
|
12
|
+
variant: "primary",
|
|
13
|
+
...props
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
PrimaryButton.displayName = 'PrimaryButton';
|
|
17
|
+
export default PrimaryButton;
|
|
18
|
+
//# sourceMappingURL=PrimaryButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["forwardRef","Button","jsx","_jsx","PrimaryButton","props","ref","variant","displayName"],"sourceRoot":"../../../../src","sources":["components/Button/PrimaryButton.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,MAAM,QAAQ,aAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGlC;AACA;AACA;AACA,OAAO,MAAMC,aAAa,gBAAGJ,UAAU,CACrC,CAACK,KAAK,EAAEC,GAAG,KAAK;EACd,oBAAOH,IAAA,CAACF,MAAM;IAACK,GAAG,EAAEA,GAAI;IAACC,OAAO,EAAC,SAAS;IAAA,GAAKF;EAAK,CAAG,CAAC;AAC1D,CACF,CAAC;AAEDD,aAAa,CAACI,WAAW,GAAG,eAAe;AAE3C,eAAeJ,aAAa","ignoreList":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { Button } from "./Button.js";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
/**
|
|
7
|
+
* A button component styled for secondary actions.
|
|
8
|
+
*/
|
|
9
|
+
export const SecondaryButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
10
|
+
return /*#__PURE__*/_jsx(Button, {
|
|
11
|
+
ref: ref,
|
|
12
|
+
variant: "secondary",
|
|
13
|
+
...props
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
SecondaryButton.displayName = 'SecondaryButton';
|
|
17
|
+
export default SecondaryButton;
|
|
18
|
+
//# sourceMappingURL=SecondaryButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["forwardRef","Button","jsx","_jsx","SecondaryButton","props","ref","variant","displayName"],"sourceRoot":"../../../../src","sources":["components/Button/SecondaryButton.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,MAAM,QAAQ,aAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGlC;AACA;AACA;AACA,OAAO,MAAMC,eAAe,gBAAGJ,UAAU,CACvC,CAACK,KAAK,EAAEC,GAAG,KAAK;EACd,oBAAOH,IAAA,CAACF,MAAM;IAACK,GAAG,EAAEA,GAAI;IAACC,OAAO,EAAC,WAAW;IAAA,GAAKF;EAAK,CAAG,CAAC;AAC5D,CACF,CAAC;AAEDD,eAAe,CAACI,WAAW,GAAG,iBAAiB;AAE/C,eAAeJ,eAAe","ignoreList":[]}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import Style from "../../utils/Style.js";
|
|
4
|
+
export const DEFAULT_BUTTON = {
|
|
5
|
+
primary_background_color: '#007bff',
|
|
6
|
+
primary_text_color: '#ffffff',
|
|
7
|
+
secondary_background_color: '#6c757d',
|
|
8
|
+
secondary_text_color: '#ffffff',
|
|
9
|
+
danger_background_color: '#dc3545',
|
|
10
|
+
danger_text_color: '#ffffff',
|
|
11
|
+
ghost_background_color: 'transparent',
|
|
12
|
+
ghost_text_color: '#007bff'
|
|
13
|
+
};
|
|
14
|
+
export const Styles = Style.create({
|
|
15
|
+
_base: {
|
|
16
|
+
paddingVertical: 12,
|
|
17
|
+
paddingHorizontal: 24,
|
|
18
|
+
borderRadius: 6,
|
|
19
|
+
alignItems: 'center',
|
|
20
|
+
justifyContent: 'center',
|
|
21
|
+
flexDirection: 'row',
|
|
22
|
+
gap: 10
|
|
23
|
+
},
|
|
24
|
+
_disabled: {
|
|
25
|
+
opacity: 0.6
|
|
26
|
+
},
|
|
27
|
+
small: {
|
|
28
|
+
paddingVertical: 8,
|
|
29
|
+
paddingHorizontal: 16
|
|
30
|
+
},
|
|
31
|
+
medium: {
|
|
32
|
+
paddingVertical: 12,
|
|
33
|
+
paddingHorizontal: 20
|
|
34
|
+
},
|
|
35
|
+
large: {
|
|
36
|
+
paddingVertical: 16,
|
|
37
|
+
paddingHorizontal: 24
|
|
38
|
+
},
|
|
39
|
+
_text: {},
|
|
40
|
+
text_primary: {
|
|
41
|
+
color: DEFAULT_BUTTON.primary_text_color
|
|
42
|
+
},
|
|
43
|
+
text_secondary: {
|
|
44
|
+
color: DEFAULT_BUTTON.secondary_text_color
|
|
45
|
+
},
|
|
46
|
+
text_danger: {
|
|
47
|
+
color: DEFAULT_BUTTON.danger_text_color
|
|
48
|
+
},
|
|
49
|
+
text_ghost: {
|
|
50
|
+
color: DEFAULT_BUTTON.ghost_text_color
|
|
51
|
+
},
|
|
52
|
+
primary: {
|
|
53
|
+
backgroundColor: DEFAULT_BUTTON.primary_background_color
|
|
54
|
+
},
|
|
55
|
+
secondary: {
|
|
56
|
+
backgroundColor: DEFAULT_BUTTON.secondary_background_color
|
|
57
|
+
},
|
|
58
|
+
danger: {
|
|
59
|
+
backgroundColor: DEFAULT_BUTTON.danger_background_color
|
|
60
|
+
},
|
|
61
|
+
ghost: {
|
|
62
|
+
backgroundColor: DEFAULT_BUTTON.ghost_background_color
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
export default Styles;
|
|
66
|
+
//# sourceMappingURL=style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Style","DEFAULT_BUTTON","primary_background_color","primary_text_color","secondary_background_color","secondary_text_color","danger_background_color","danger_text_color","ghost_background_color","ghost_text_color","Styles","create","_base","paddingVertical","paddingHorizontal","borderRadius","alignItems","justifyContent","flexDirection","gap","_disabled","opacity","small","medium","large","_text","text_primary","color","text_secondary","text_danger","text_ghost","primary","backgroundColor","secondary","danger","ghost"],"sourceRoot":"../../../../src","sources":["components/Button/style.ts"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,sBAAmB;AAErC,OAAO,MAAMC,cAAc,GAAG;EAC5BC,wBAAwB,EAAE,SAAS;EACnCC,kBAAkB,EAAE,SAAS;EAE7BC,0BAA0B,EAAE,SAAS;EACrCC,oBAAoB,EAAE,SAAS;EAE/BC,uBAAuB,EAAE,SAAS;EAClCC,iBAAiB,EAAE,SAAS;EAE5BC,sBAAsB,EAAE,aAAa;EACrCC,gBAAgB,EAAE;AACpB,CAAC;AAID,OAAO,MAAMC,MAAM,GAAGV,KAAK,CAACW,MAAM,CAAC;EACjCC,KAAK,EAAE;IACLC,eAAe,EAAE,EAAE;IACnBC,iBAAiB,EAAE,EAAE;IACrBC,YAAY,EAAE,CAAC;IACfC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBC,aAAa,EAAE,KAAK;IACpBC,GAAG,EAAE;EACP,CAAC;EAEDC,SAAS,EAAE;IACTC,OAAO,EAAE;EACX,CAAC;EAEDC,KAAK,EAAE;IACLT,eAAe,EAAE,CAAC;IAClBC,iBAAiB,EAAE;EACrB,CAAC;EACDS,MAAM,EAAE;IACNV,eAAe,EAAE,EAAE;IACnBC,iBAAiB,EAAE;EACrB,CAAC;EACDU,KAAK,EAAE;IACLX,eAAe,EAAE,EAAE;IACnBC,iBAAiB,EAAE;EACrB,CAAC;EAEDW,KAAK,EAAE,CAAC,CAAC;EAETC,YAAY,EAAE;IACZC,KAAK,EAAE1B,cAAc,CAACE;EACxB,CAAC;EACDyB,cAAc,EAAE;IACdD,KAAK,EAAE1B,cAAc,CAACI;EACxB,CAAC;EACDwB,WAAW,EAAE;IACXF,KAAK,EAAE1B,cAAc,CAACM;EACxB,CAAC;EACDuB,UAAU,EAAE;IACVH,KAAK,EAAE1B,cAAc,CAACQ;EACxB,CAAC;EAEDsB,OAAO,EAAE;IACPC,eAAe,EAAE/B,cAAc,CAACC;EAClC,CAAC;EACD+B,SAAS,EAAE;IACTD,eAAe,EAAE/B,cAAc,CAACG;EAClC,CAAC;EACD8B,MAAM,EAAE;IACNF,eAAe,EAAE/B,cAAc,CAACK;EAClC,CAAC;EACD6B,KAAK,EAAE;IACLH,eAAe,EAAE/B,cAAc,CAACO;EAClC;AACF,CAAC,CAAC;AAEF,eAAeE,MAAM","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["components/Button/types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { View } from 'react-native';
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
export const Divider = /*#__PURE__*/forwardRef((props, ref) => {
|
|
7
|
+
const {
|
|
8
|
+
thickness = 1,
|
|
9
|
+
color = '#c4c4c4',
|
|
10
|
+
orientation = 'horizontal',
|
|
11
|
+
length = '100%',
|
|
12
|
+
style,
|
|
13
|
+
...rest
|
|
14
|
+
} = props;
|
|
15
|
+
const dividerStyle = {
|
|
16
|
+
backgroundColor: color,
|
|
17
|
+
...(orientation === 'vertical' ? {
|
|
18
|
+
width: thickness,
|
|
19
|
+
height: length
|
|
20
|
+
} : {
|
|
21
|
+
height: thickness,
|
|
22
|
+
width: length
|
|
23
|
+
})
|
|
24
|
+
};
|
|
25
|
+
return /*#__PURE__*/_jsx(View, {
|
|
26
|
+
ref: ref,
|
|
27
|
+
style: [dividerStyle, style],
|
|
28
|
+
...rest
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
Divider.displayName = 'Divider';
|
|
32
|
+
export default Divider;
|
|
33
|
+
//# sourceMappingURL=Divider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["forwardRef","View","jsx","_jsx","Divider","props","ref","thickness","color","orientation","length","style","rest","dividerStyle","backgroundColor","width","height","displayName"],"sourceRoot":"../../../../src","sources":["components/Divider/Divider.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,IAAI,QAAwB,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAIpD,OAAO,MAAMC,OAAO,gBAAGJ,UAAU,CAAwB,CAACK,KAAK,EAAEC,GAAG,KAAK;EACvE,MAAM;IACJC,SAAS,GAAG,CAAC;IACbC,KAAK,GAAG,SAAS;IACjBC,WAAW,GAAG,YAAY;IAC1BC,MAAM,GAAG,MAAM;IACfC,KAAK;IACL,GAAGC;EACL,CAAC,GAAGP,KAAK;EAET,MAAMQ,YAAY,GAAG;IACnBC,eAAe,EAAEN,KAAK;IACtB,IAAIC,WAAW,KAAK,UAAU,GAC1B;MAAEM,KAAK,EAAER,SAAS;MAAES,MAAM,EAAEN;IAAO,CAAC,GACpC;MAAEM,MAAM,EAAET,SAAS;MAAEQ,KAAK,EAAEL;IAAO,CAAC;EAC1C,CAAc;EAEd,oBAAOP,IAAA,CAACF,IAAI;IAACK,GAAG,EAAEA,GAAI;IAACK,KAAK,EAAE,CAACE,YAAY,EAAEF,KAAK,CAAE;IAAA,GAAKC;EAAI,CAAG,CAAC;AACnE,CAAC,CAAC;AAEFR,OAAO,CAACa,WAAW,GAAG,SAAS;AAE/B,eAAeb,OAAO","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["components/Divider/styles.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["components/Divider/types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { View } from 'react-native';
|
|
5
|
+
import Style from "../../utils/Style.js";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
export const HStack = /*#__PURE__*/forwardRef((props, ref) => {
|
|
8
|
+
const {
|
|
9
|
+
style,
|
|
10
|
+
...rest
|
|
11
|
+
} = props;
|
|
12
|
+
return /*#__PURE__*/_jsx(View, {
|
|
13
|
+
ref: ref,
|
|
14
|
+
style: [elementStyle.base, style],
|
|
15
|
+
...rest
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
HStack.displayName = 'HStack';
|
|
19
|
+
const elementStyle = Style.create({
|
|
20
|
+
base: {
|
|
21
|
+
flexDirection: 'row'
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
//# sourceMappingURL=HStack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["forwardRef","View","Style","jsx","_jsx","HStack","props","ref","style","rest","elementStyle","base","displayName","create","flexDirection"],"sourceRoot":"../../../../src","sources":["components/Layout/HStack.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,IAAI,QAAQ,cAAc;AAEnC,OAAOC,KAAK,MAAM,sBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGtC,OAAO,MAAMC,MAAM,gBAAGL,UAAU,CAAuB,CAACM,KAAK,EAAEC,GAAG,KAAK;EACrE,MAAM;IAAEC,KAAK;IAAE,GAAGC;EAAK,CAAC,GAAGH,KAAK;EAEhC,oBAAOF,IAAA,CAACH,IAAI;IAACM,GAAG,EAAEA,GAAI;IAACC,KAAK,EAAE,CAACE,YAAY,CAACC,IAAI,EAAEH,KAAK,CAAE;IAAA,GAAKC;EAAI,CAAG,CAAC;AACxE,CAAC,CAAC;AAEFJ,MAAM,CAACO,WAAW,GAAG,QAAQ;AAE7B,MAAMF,YAAY,GAAGR,KAAK,CAACW,MAAM,CAAC;EAChCF,IAAI,EAAE;IACJG,aAAa,EAAE;EACjB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { View } from 'react-native';
|
|
5
|
+
import Style from "../../utils/Style.js";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
export const VStack = /*#__PURE__*/forwardRef((props, ref) => {
|
|
8
|
+
const {
|
|
9
|
+
style,
|
|
10
|
+
...rest
|
|
11
|
+
} = props;
|
|
12
|
+
return /*#__PURE__*/_jsx(View, {
|
|
13
|
+
ref: ref,
|
|
14
|
+
style: [elementStyle.base, style],
|
|
15
|
+
...rest
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
VStack.displayName = 'VStack';
|
|
19
|
+
const elementStyle = Style.create({
|
|
20
|
+
base: {
|
|
21
|
+
flexDirection: 'column'
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
//# sourceMappingURL=VStack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["forwardRef","View","Style","jsx","_jsx","VStack","props","ref","style","rest","elementStyle","base","displayName","create","flexDirection"],"sourceRoot":"../../../../src","sources":["components/Layout/VStack.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,IAAI,QAAQ,cAAc;AAEnC,OAAOC,KAAK,MAAM,sBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGtC,OAAO,MAAMC,MAAM,gBAAGL,UAAU,CAAuB,CAACM,KAAK,EAAEC,GAAG,KAAK;EACrE,MAAM;IAAEC,KAAK;IAAE,GAAGC;EAAK,CAAC,GAAGH,KAAK;EAEhC,oBAAOF,IAAA,CAACH,IAAI;IAACM,GAAG,EAAEA,GAAI;IAACC,KAAK,EAAE,CAACE,YAAY,CAACC,IAAI,EAAEH,KAAK,CAAE;IAAA,GAAKC;EAAI,CAAG,CAAC;AACxE,CAAC,CAAC;AAEFJ,MAAM,CAACO,WAAW,GAAG,QAAQ;AAE7B,MAAMF,YAAY,GAAGR,KAAK,CAACW,MAAM,CAAC;EAChCF,IAAI,EAAE;IACJG,aAAa,EAAE;EACjB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["components/Layout/layout.types.ts"],"mappings":"","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -1,7 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
// Export Components
|
|
4
|
+
export * from "./components/Button/Button.js";
|
|
5
|
+
export * from "./components/Button/DangerButton.js";
|
|
6
|
+
export * from "./components/Button/GhostButton.js";
|
|
7
|
+
export * from "./components/Button/PrimaryButton.js";
|
|
8
|
+
export * from "./components/Button/SecondaryButton.js";
|
|
4
9
|
export * from "./components/Card/Card.js";
|
|
10
|
+
export * from "./components/Divider/Divider.js";
|
|
11
|
+
export * from "./components/Layout/HStack.js";
|
|
12
|
+
export * from "./components/Layout/VStack.js";
|
|
13
|
+
export * from "./components/Surface/Surface.js";
|
|
14
|
+
|
|
15
|
+
// types
|
|
16
|
+
export * from "./components/Button/types.js";
|
|
17
|
+
export * from "./components/Card/types.js";
|
|
18
|
+
export * from "./components/Divider/types.js";
|
|
19
|
+
export * from "./components/Layout/layout.types.js";
|
|
20
|
+
export * from "./components/Surface/types.js";
|
|
21
|
+
export * from "./types/general.types.js";
|
|
5
22
|
|
|
6
23
|
// Provider
|
|
7
24
|
export * from "./providers/ThemeProvider.js";
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA;AACA,cAAc,2BAAwB;;
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA;AACA,cAAc,+BAA4B;AAC1C,cAAc,qCAAkC;AAChD,cAAc,oCAAiC;AAC/C,cAAc,sCAAmC;AACjD,cAAc,wCAAqC;AACnD,cAAc,2BAAwB;AACtC,cAAc,iCAA8B;AAC5C,cAAc,+BAA4B;AAC1C,cAAc,+BAA4B;AAC1C,cAAc,iCAA8B;;AAE5C;AACA,cAAc,8BAA2B;AACzC,cAAc,4BAAyB;AACvC,cAAc,+BAA4B;AAC1C,cAAc,qCAAkC;AAChD,cAAc,+BAA4B;AAC1C,cAAc,0BAAuB;;AAErC;AACA,cAAc,8BAA2B","ignoreList":[]}
|
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
import React, { useCallback, useContext, useEffect, useState } from 'react';
|
|
4
4
|
import { useColorScheme as useDeviceColorScheme } from 'react-native';
|
|
5
|
-
import
|
|
5
|
+
import * as Font from 'expo-font';
|
|
6
|
+
|
|
6
7
|
/**
|
|
7
8
|
* Create a ThemeContext with default value null
|
|
8
9
|
* @type {React.Context<ThemeContextType | null>}
|
|
9
10
|
*/
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
12
|
const ThemeContext = /*#__PURE__*/React.createContext(null);
|
|
11
13
|
|
|
12
14
|
/**
|
|
@@ -56,6 +58,23 @@ export const ThemeProvider = ({
|
|
|
56
58
|
}
|
|
57
59
|
setTheme(newTheme);
|
|
58
60
|
}, [deviceColorscheme]);
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
(async function loadAsyncFonts() {
|
|
63
|
+
try {
|
|
64
|
+
await Font.loadAsync({
|
|
65
|
+
CodanRegular: require('../assets/fonts/CodanRegular.ttf'),
|
|
66
|
+
CodanBold: require('../assets/fonts/CodanBold.ttf'),
|
|
67
|
+
CodanBook: require('../assets/fonts/CodanBook.ttf'),
|
|
68
|
+
CodanLight: require('../assets/fonts/CodanLight.ttf'),
|
|
69
|
+
CodanMedium: require('../assets/fonts/CodanMedium.ttf')
|
|
70
|
+
});
|
|
71
|
+
} catch (e) {
|
|
72
|
+
console.warn('Error loading fonts:', e);
|
|
73
|
+
} finally {
|
|
74
|
+
console.log('Theme Fonts loaded');
|
|
75
|
+
}
|
|
76
|
+
})();
|
|
77
|
+
}, []);
|
|
59
78
|
return /*#__PURE__*/_jsx(ThemeContext.Provider, {
|
|
60
79
|
value: {
|
|
61
80
|
theme: currentTheme,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useContext","useEffect","useState","useColorScheme","useDeviceColorScheme","jsx","_jsx","ThemeContext","createContext","useTheme","context","Error","ThemeProvider","children","theme","defaultTheme","onThemeChange","undefined","deviceColorscheme","currentTheme","setTheme","changeTheme","newTheme","Provider","value"],"sourceRoot":"../../../src","sources":["providers/ThemeProvider.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,UAAU,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC3E,SAASC,cAAc,IAAIC,oBAAoB,QAAQ,cAAc;
|
|
1
|
+
{"version":3,"names":["React","useCallback","useContext","useEffect","useState","useColorScheme","useDeviceColorScheme","Font","jsx","_jsx","ThemeContext","createContext","useTheme","context","Error","ThemeProvider","children","theme","defaultTheme","onThemeChange","undefined","deviceColorscheme","currentTheme","setTheme","changeTheme","newTheme","loadAsyncFonts","loadAsync","CodanRegular","require","CodanBold","CodanBook","CodanLight","CodanMedium","e","console","warn","log","Provider","value"],"sourceRoot":"../../../src","sources":["providers/ThemeProvider.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,UAAU,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC3E,SAASC,cAAc,IAAIC,oBAAoB,QAAQ,cAAc;AAOrE,OAAO,KAAKC,IAAI,MAAM,WAAW;;AAEjC;AACA;AACA;AACA;AAHA,SAAAC,GAAA,IAAAC,IAAA;AAIA,MAAMC,YAAY,gBAAGV,KAAK,CAACW,aAAa,CAA0B,IAAI,CAAC;;AAEvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,QAAQ,GAAGA,CAAA,KAAM;EAC5B,MAAMC,OAAO,GAAGX,UAAU,CAACQ,YAAY,CAAC;EACxC,IAAI,CAACG,OAAO,EAAE;IACZ,MAAM,IAAIC,KAAK,CAAC,8CAA8C,CAAC;EACjE;EACA,OAAOD,OAAO;AAChB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAME,aAA2C,GAAGA,CAAC;EAC1DC,QAAQ;EACRC,KAAK;EACLC,YAAY,GAAG,OAAO;EACtBC,aAAa,GAAGA,CAAA,KAAMC;AACxB,CAAC,KAAK;EACJ,MAAMC,iBAAiB,GAAGf,oBAAoB,CAAC,CAAC;EAChD,MAAM,CAACgB,YAAY,EAAEC,QAAQ,CAAC,GAAGnB,QAAQ,CACvCa,KAAK,IAAIC,YACX,CAAC;EAEDf,SAAS,CAAC,MAAM;IACdgB,aAAa,IAAIF,KAAK,IAAIE,aAAa,CAACF,KAAK,CAAC;EAChD,CAAC,EAAE,CAACA,KAAK,EAAEE,aAAa,CAAC,CAAC;EAE1B,MAAMK,WAAW,GAAGvB,WAAW,CAC5BwB,QAAuB,IAAK;IAC3B,IAAIA,QAAQ,KAAK,QAAQ,EAAE;MACzBF,QAAQ,CAACF,iBAAiB,KAAK,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;MACzD;IACF;IACAE,QAAQ,CAACE,QAAQ,CAAC;EACpB,CAAC,EACD,CAACJ,iBAAiB,CACpB,CAAC;EAEDlB,SAAS,CAAC,MAAM;IACd,CAAC,eAAeuB,cAAcA,CAAA,EAAG;MAC/B,IAAI;QACF,MAAMnB,IAAI,CAACoB,SAAS,CAAC;UACnBC,YAAY,EAAEC,OAAO,CAAC,kCAAkC,CAAC;UACzDC,SAAS,EAAED,OAAO,CAAC,+BAA+B,CAAC;UACnDE,SAAS,EAAEF,OAAO,CAAC,+BAA+B,CAAC;UACnDG,UAAU,EAAEH,OAAO,CAAC,gCAAgC,CAAC;UACrDI,WAAW,EAAEJ,OAAO,CAAC,iCAAiC;QACxD,CAAC,CAAC;MACJ,CAAC,CAAC,OAAOK,CAAC,EAAE;QACVC,OAAO,CAACC,IAAI,CAAC,sBAAsB,EAAEF,CAAC,CAAC;MACzC,CAAC,SAAS;QACRC,OAAO,CAACE,GAAG,CAAC,oBAAoB,CAAC;MACnC;IACF,CAAC,EAAE,CAAC;EACN,CAAC,EAAE,EAAE,CAAC;EAEN,oBACE5B,IAAA,CAACC,YAAY,CAAC4B,QAAQ;IAACC,KAAK,EAAE;MAAEtB,KAAK,EAAEK,YAAY;MAAEE;IAAY,CAAE;IAAAR,QAAA,EAChEA;EAAQ,CACY,CAAC;AAE5B,CAAC;AAED,eAAeD,aAAa","ignoreList":[]}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Dimensions, PixelRatio } from 'react-native';
|
|
4
|
+
import { getDeviceType } from "./getDeviceType.js";
|
|
5
|
+
import { getScreenSizeCategory } from "./getScreenSizeCategory.js";
|
|
6
|
+
const {
|
|
7
|
+
width: SCREEN_WIDTH,
|
|
8
|
+
height: SCREEN_HEIGHT
|
|
9
|
+
} = Dimensions.get('window');
|
|
10
|
+
|
|
11
|
+
// Use whichever is smaller, width or height
|
|
12
|
+
const SCALE = SCREEN_WIDTH > SCREEN_HEIGHT ? SCREEN_HEIGHT : SCREEN_WIDTH;
|
|
13
|
+
const BASE_WIDTH = 375;
|
|
14
|
+
const fontConfig = {
|
|
15
|
+
phone: {
|
|
16
|
+
small: {
|
|
17
|
+
min: 0.8,
|
|
18
|
+
max: 1
|
|
19
|
+
},
|
|
20
|
+
medium: {
|
|
21
|
+
min: 0.9,
|
|
22
|
+
max: 1.1
|
|
23
|
+
},
|
|
24
|
+
large: {
|
|
25
|
+
min: 1,
|
|
26
|
+
max: 1.2
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
tablet: {
|
|
30
|
+
small: {
|
|
31
|
+
min: 1.3,
|
|
32
|
+
max: 1.4
|
|
33
|
+
},
|
|
34
|
+
medium: {
|
|
35
|
+
min: 1.4,
|
|
36
|
+
max: 1.5
|
|
37
|
+
},
|
|
38
|
+
large: {
|
|
39
|
+
min: 1.5,
|
|
40
|
+
max: 1.7
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
export function fontScale(size) {
|
|
45
|
+
const deviceType = getDeviceType();
|
|
46
|
+
const screenCategory = getScreenSizeCategory();
|
|
47
|
+
const config = fontConfig[deviceType][screenCategory];
|
|
48
|
+
|
|
49
|
+
// Calculate the scale factor
|
|
50
|
+
const scaleFactor = SCALE / BASE_WIDTH;
|
|
51
|
+
|
|
52
|
+
// Clamp the scale factor between the configured min and max
|
|
53
|
+
const clampedScaleFactor = Math.min(Math.max(scaleFactor, config.min), config.max);
|
|
54
|
+
|
|
55
|
+
// Calculate the new size
|
|
56
|
+
let newSize = size * clampedScaleFactor;
|
|
57
|
+
|
|
58
|
+
// Additional scaling for tablets to ensure text isn't too small
|
|
59
|
+
if (deviceType === 'tablet') {
|
|
60
|
+
newSize *= 1.1; // Increase tablet font sizes by an additional 10%
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Round the size and adjust for the device's font scale
|
|
64
|
+
return Math.round(PixelRatio.roundToNearestPixel(newSize)) / PixelRatio.getFontScale();
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=fontScale.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Dimensions","PixelRatio","getDeviceType","getScreenSizeCategory","width","SCREEN_WIDTH","height","SCREEN_HEIGHT","get","SCALE","BASE_WIDTH","fontConfig","phone","small","min","max","medium","large","tablet","fontScale","size","deviceType","screenCategory","config","scaleFactor","clampedScaleFactor","Math","newSize","round","roundToNearestPixel","getFontScale"],"sourceRoot":"../../../src","sources":["utils/fontScale.ts"],"mappings":";;AAAA,SAASA,UAAU,EAAEC,UAAU,QAAQ,cAAc;AACrD,SAASC,aAAa,QAAQ,oBAAiB;AAC/C,SAASC,qBAAqB,QAAQ,4BAAyB;AAE/D,MAAM;EAAEC,KAAK,EAAEC,YAAY;EAAEC,MAAM,EAAEC;AAAc,CAAC,GAAGP,UAAU,CAACQ,GAAG,CAAC,QAAQ,CAAC;;AAE/E;AACA,MAAMC,KAAK,GAAGJ,YAAY,GAAGE,aAAa,GAAGA,aAAa,GAAGF,YAAY;AACzE,MAAMK,UAAU,GAAG,GAAG;AAEtB,MAAMC,UAAU,GAAG;EACjBC,KAAK,EAAE;IACLC,KAAK,EAAE;MAAEC,GAAG,EAAE,GAAG;MAAEC,GAAG,EAAE;IAAE,CAAC;IAC3BC,MAAM,EAAE;MAAEF,GAAG,EAAE,GAAG;MAAEC,GAAG,EAAE;IAAI,CAAC;IAC9BE,KAAK,EAAE;MAAEH,GAAG,EAAE,CAAC;MAAEC,GAAG,EAAE;IAAI;EAC5B,CAAC;EACDG,MAAM,EAAE;IACNL,KAAK,EAAE;MAAEC,GAAG,EAAE,GAAG;MAAEC,GAAG,EAAE;IAAI,CAAC;IAC7BC,MAAM,EAAE;MAAEF,GAAG,EAAE,GAAG;MAAEC,GAAG,EAAE;IAAI,CAAC;IAC9BE,KAAK,EAAE;MAAEH,GAAG,EAAE,GAAG;MAAEC,GAAG,EAAE;IAAI;EAC9B;AACF,CAAC;AAED,OAAO,SAASI,SAASA,CAACC,IAAY,EAAE;EACtC,MAAMC,UAAU,GAAGnB,aAAa,CAAC,CAAC;EAClC,MAAMoB,cAAc,GAAGnB,qBAAqB,CAAC,CAAC;EAC9C,MAAMoB,MAAM,GAAGZ,UAAU,CAACU,UAAU,CAAC,CAACC,cAAc,CAAC;;EAErD;EACA,MAAME,WAAW,GAAGf,KAAK,GAAGC,UAAU;;EAEtC;EACA,MAAMe,kBAAkB,GAAGC,IAAI,CAACZ,GAAG,CACjCY,IAAI,CAACX,GAAG,CAACS,WAAW,EAAED,MAAM,CAACT,GAAG,CAAC,EACjCS,MAAM,CAACR,GACT,CAAC;;EAED;EACA,IAAIY,OAAO,GAAGP,IAAI,GAAGK,kBAAkB;;EAEvC;EACA,IAAIJ,UAAU,KAAK,QAAQ,EAAE;IAC3BM,OAAO,IAAI,GAAG,CAAC,CAAC;EAClB;;EAEA;EACA,OACED,IAAI,CAACE,KAAK,CAAC3B,UAAU,CAAC4B,mBAAmB,CAACF,OAAO,CAAC,CAAC,GACnD1B,UAAU,CAAC6B,YAAY,CAAC,CAAC;AAE7B","ignoreList":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Dimensions, PixelRatio } from 'react-native';
|
|
4
|
+
const {
|
|
5
|
+
width: SCREEN_WIDTH,
|
|
6
|
+
height: SCREEN_HEIGHT
|
|
7
|
+
} = Dimensions.get('window');
|
|
8
|
+
export const getDeviceType = () => {
|
|
9
|
+
const pixelDensity = PixelRatio.get();
|
|
10
|
+
const adjustedWidth = SCREEN_WIDTH * pixelDensity;
|
|
11
|
+
const adjustedHeight = SCREEN_HEIGHT * pixelDensity;
|
|
12
|
+
if (pixelDensity < 2 && (adjustedWidth >= 1000 || adjustedHeight >= 1000)) {
|
|
13
|
+
return 'tablet';
|
|
14
|
+
} else if (pixelDensity === 2 && (adjustedWidth >= 1920 || adjustedHeight >= 1920)) {
|
|
15
|
+
return 'tablet';
|
|
16
|
+
} else {
|
|
17
|
+
return 'phone';
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=getDeviceType.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Dimensions","PixelRatio","width","SCREEN_WIDTH","height","SCREEN_HEIGHT","get","getDeviceType","pixelDensity","adjustedWidth","adjustedHeight"],"sourceRoot":"../../../src","sources":["utils/getDeviceType.ts"],"mappings":";;AAAA,SAASA,UAAU,EAAEC,UAAU,QAAQ,cAAc;AAErD,MAAM;EAAEC,KAAK,EAAEC,YAAY;EAAEC,MAAM,EAAEC;AAAc,CAAC,GAAGL,UAAU,CAACM,GAAG,CAAC,QAAQ,CAAC;AAE/E,OAAO,MAAMC,aAAa,GAAGA,CAAA,KAA0B;EACrD,MAAMC,YAAY,GAAGP,UAAU,CAACK,GAAG,CAAC,CAAC;EACrC,MAAMG,aAAa,GAAGN,YAAY,GAAGK,YAAY;EACjD,MAAME,cAAc,GAAGL,aAAa,GAAGG,YAAY;EAEnD,IAAIA,YAAY,GAAG,CAAC,KAAKC,aAAa,IAAI,IAAI,IAAIC,cAAc,IAAI,IAAI,CAAC,EAAE;IACzE,OAAO,QAAQ;EACjB,CAAC,MAAM,IACLF,YAAY,KAAK,CAAC,KACjBC,aAAa,IAAI,IAAI,IAAIC,cAAc,IAAI,IAAI,CAAC,EACjD;IACA,OAAO,QAAQ;EACjB,CAAC,MAAM;IACL,OAAO,OAAO;EAChB;AACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Dimensions } from 'react-native';
|
|
4
|
+
const {
|
|
5
|
+
width: SCREEN_WIDTH,
|
|
6
|
+
height: SCREEN_HEIGHT
|
|
7
|
+
} = Dimensions.get('window');
|
|
8
|
+
|
|
9
|
+
// Use whichever is smaller, width or height
|
|
10
|
+
const SCALE = SCREEN_WIDTH > SCREEN_HEIGHT ? SCREEN_HEIGHT : SCREEN_WIDTH;
|
|
11
|
+
export const getScreenSizeCategory = () => {
|
|
12
|
+
if (SCALE < 350) return 'small';
|
|
13
|
+
if (SCALE > 500) return 'large';
|
|
14
|
+
return 'medium';
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=getScreenSizeCategory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Dimensions","width","SCREEN_WIDTH","height","SCREEN_HEIGHT","get","SCALE","getScreenSizeCategory"],"sourceRoot":"../../../src","sources":["utils/getScreenSizeCategory.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,cAAc;AAEzC,MAAM;EAAEC,KAAK,EAAEC,YAAY;EAAEC,MAAM,EAAEC;AAAc,CAAC,GAAGJ,UAAU,CAACK,GAAG,CAAC,QAAQ,CAAC;;AAE/E;AACA,MAAMC,KAAK,GAAGJ,YAAY,GAAGE,aAAa,GAAGA,aAAa,GAAGF,YAAY;AAEzE,OAAO,MAAMK,qBAAqB,GAAGA,CAAA,KAAoC;EACvE,IAAID,KAAK,GAAG,GAAG,EAAE,OAAO,OAAO;EAC/B,IAAIA,KAAK,GAAG,GAAG,EAAE,OAAO,OAAO;EAC/B,OAAO,QAAQ;AACjB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ButtonBaseProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* A customizable button component that supports different variants and sizes.
|
|
4
|
+
* @return A TouchableOpacity button with text.
|
|
5
|
+
*/
|
|
6
|
+
export declare const Button: import("react").ForwardRefExoticComponent<ButtonBaseProps & import("react").RefAttributes<import("react-native").View>>;
|
|
7
|
+
export default Button;
|
|
8
|
+
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,eAAe,EAIhB,MAAM,SAAS,CAAC;AAEjB;;;GAGG;AACH,eAAO,MAAM,MAAM,yHAoCjB,CAAC;AAIH,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ButtonBaseProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* A button component styled for dangerous actions, such as deletions.
|
|
4
|
+
* @returns A ButtonBase component with the "danger" variant.
|
|
5
|
+
*/
|
|
6
|
+
export declare const DangerButton: import("react").ForwardRefExoticComponent<ButtonBaseProps & import("react").RefAttributes<import("react-native").View>>;
|
|
7
|
+
export default DangerButton;
|
|
8
|
+
//# sourceMappingURL=DangerButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DangerButton.d.ts","sourceRoot":"","sources":["../../../../../src/components/Button/DangerButton.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAiB,MAAM,SAAS,CAAC;AAE9D;;;GAGG;AACH,eAAO,MAAM,YAAY,yHAIxB,CAAC;AAIF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ButtonBaseProps } from './types';
|
|
2
|
+
export declare const GhostButton: import("react").ForwardRefExoticComponent<ButtonBaseProps & import("react").RefAttributes<import("react-native").View>>;
|
|
3
|
+
export default GhostButton;
|
|
4
|
+
//# sourceMappingURL=GhostButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GhostButton.d.ts","sourceRoot":"","sources":["../../../../../src/components/Button/GhostButton.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAiB,MAAM,SAAS,CAAC;AAE9D,eAAO,MAAM,WAAW,yHAIvB,CAAC;AAIF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ButtonBaseProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* A button component styled for primary actions.
|
|
4
|
+
*/
|
|
5
|
+
export declare const PrimaryButton: import("react").ForwardRefExoticComponent<ButtonBaseProps & import("react").RefAttributes<import("react-native").View>>;
|
|
6
|
+
export default PrimaryButton;
|
|
7
|
+
//# sourceMappingURL=PrimaryButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrimaryButton.d.ts","sourceRoot":"","sources":["../../../../../src/components/Button/PrimaryButton.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAiB,MAAM,SAAS,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,aAAa,yHAIzB,CAAC;AAIF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ButtonBaseProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* A button component styled for secondary actions.
|
|
4
|
+
*/
|
|
5
|
+
export declare const SecondaryButton: import("react").ForwardRefExoticComponent<ButtonBaseProps & import("react").RefAttributes<import("react-native").View>>;
|
|
6
|
+
export default SecondaryButton;
|
|
7
|
+
//# sourceMappingURL=SecondaryButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SecondaryButton.d.ts","sourceRoot":"","sources":["../../../../../src/components/Button/SecondaryButton.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAiB,MAAM,SAAS,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,eAAe,yHAI3B,CAAC;AAIF,eAAe,eAAe,CAAC"}
|