@dryanovski/react-native-components 1.0.1 → 1.0.2

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.
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ import { View } from 'react-native';
4
+ import Styles from "./styles.js";
5
+ import { jsx as _jsx } from "react/jsx-runtime";
6
+ /**
7
+ * Card component to display content within a styled container
8
+ * @param {React.ReactNode} children - The content to be displayed inside the card
9
+ * @param {ViewStyle} style - Additional styles for the card container
10
+ * @returns {JSX.Element} The Card component
11
+ * @example
12
+ * <Card style={{ margin: 10 }}>
13
+ * <Text>This is a card</Text>
14
+ * </Card>
15
+ */
16
+ export const Card = ({
17
+ children,
18
+ style,
19
+ ...props
20
+ }) => {
21
+ return /*#__PURE__*/_jsx(View, {
22
+ style: [Styles.container, style],
23
+ ...props,
24
+ children: children
25
+ });
26
+ };
27
+ Card.displayName = 'Card';
28
+ export default Card;
29
+ //# sourceMappingURL=Card.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["View","Styles","jsx","_jsx","Card","children","style","props","container","displayName"],"sourceRoot":"../../../../src","sources":["components/Card/Card.tsx"],"mappings":";;AAAA,SAASA,IAAI,QAAQ,cAAc;AACnC,OAAOC,MAAM,MAAM,aAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAG9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,IAAyB,GAAGA,CAAC;EAAEC,QAAQ;EAAEC,KAAK;EAAE,GAAGC;AAAM,CAAC,KAAK;EAC1E,oBACEJ,IAAA,CAACH,IAAI;IAACM,KAAK,EAAE,CAACL,MAAM,CAACO,SAAS,EAAEF,KAAK,CAAE;IAAA,GAAKC,KAAK;IAAAF,QAAA,EAC9CA;EAAQ,CACL,CAAC;AAEX,CAAC;AAEDD,IAAI,CAACK,WAAW,GAAG,MAAM;AAEzB,eAAeL,IAAI","ignoreList":[]}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ import Style from "../../utils/Style.js";
4
+ const DEFAULT_CARD = {
5
+ card_background_color: '#fff',
6
+ card_border_radius: 8,
7
+ card_padding: 16,
8
+ card_shadow_color: '#000',
9
+ card_shadow_offset: {
10
+ width: 0,
11
+ height: 2
12
+ },
13
+ card_shadow_opacity: 0.1,
14
+ card_shadow_radius: 4,
15
+ card_elevation: 3
16
+ };
17
+ export const Styles = Style.create({
18
+ container: {
19
+ backgroundColor: DEFAULT_CARD.card_background_color,
20
+ borderRadius: DEFAULT_CARD.card_border_radius,
21
+ padding: DEFAULT_CARD.card_padding,
22
+ shadowColor: DEFAULT_CARD.card_shadow_color,
23
+ shadowOffset: DEFAULT_CARD.card_shadow_offset,
24
+ shadowOpacity: DEFAULT_CARD.card_shadow_opacity,
25
+ shadowRadius: DEFAULT_CARD.card_shadow_radius,
26
+ elevation: DEFAULT_CARD.card_elevation
27
+ }
28
+ });
29
+ export default Styles;
30
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Style","DEFAULT_CARD","card_background_color","card_border_radius","card_padding","card_shadow_color","card_shadow_offset","width","height","card_shadow_opacity","card_shadow_radius","card_elevation","Styles","create","container","backgroundColor","borderRadius","padding","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation"],"sourceRoot":"../../../../src","sources":["components/Card/styles.ts"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,sBAAmB;AAErC,MAAMC,YAAY,GAAG;EACnBC,qBAAqB,EAAE,MAAM;EAC7BC,kBAAkB,EAAE,CAAC;EACrBC,YAAY,EAAE,EAAE;EAChBC,iBAAiB,EAAE,MAAM;EACzBC,kBAAkB,EAAE;IAAEC,KAAK,EAAE,CAAC;IAAEC,MAAM,EAAE;EAAE,CAAC;EAC3CC,mBAAmB,EAAE,GAAG;EACxBC,kBAAkB,EAAE,CAAC;EACrBC,cAAc,EAAE;AAClB,CAAC;AAED,OAAO,MAAMC,MAAM,GAAGZ,KAAK,CAACa,MAAM,CAAC;EACjCC,SAAS,EAAE;IACTC,eAAe,EAAEd,YAAY,CAACC,qBAAqB;IACnDc,YAAY,EAAEf,YAAY,CAACE,kBAAkB;IAC7Cc,OAAO,EAAEhB,YAAY,CAACG,YAAY;IAClCc,WAAW,EAAEjB,YAAY,CAACI,iBAAiB;IAC3Cc,YAAY,EAAElB,YAAY,CAACK,kBAAkB;IAC7Cc,aAAa,EAAEnB,YAAY,CAACQ,mBAAmB;IAC/CY,YAAY,EAAEpB,YAAY,CAACS,kBAAkB;IAC7CY,SAAS,EAAErB,YAAY,CAACU;EAC1B;AACF,CAAC,CAAC;AAEF,eAAeC,MAAM","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export {};
4
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../../src","sources":["components/Card/types.ts"],"mappings":"","ignoreList":[]}
@@ -1,5 +1,8 @@
1
1
  "use strict";
2
2
 
3
+ // Export Components
4
+ export * from "./components/Card/Card.js";
5
+
3
6
  // Provider
4
7
  export * from "./providers/ThemeProvider.js";
5
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA;AACA,cAAc,8BAA2B","ignoreList":[]}
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA;AACA,cAAc,2BAAwB;;AAEtC;AACA,cAAc,8BAA2B","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ import { StyleSheet } from 'react-native';
4
+ export const Style = StyleSheet;
5
+ export default Style;
6
+ //# sourceMappingURL=Style.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["StyleSheet","Style"],"sourceRoot":"../../../src","sources":["utils/Style.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,cAAc;AAEzC,OAAO,MAAMC,KAAK,GAAGD,UAAU;AAE/B,eAAeC,KAAK","ignoreList":[]}
@@ -0,0 +1,14 @@
1
+ import type { CardProps } from './types';
2
+ /**
3
+ * Card component to display content within a styled container
4
+ * @param {React.ReactNode} children - The content to be displayed inside the card
5
+ * @param {ViewStyle} style - Additional styles for the card container
6
+ * @returns {JSX.Element} The Card component
7
+ * @example
8
+ * <Card style={{ margin: 10 }}>
9
+ * <Text>This is a card</Text>
10
+ * </Card>
11
+ */
12
+ export declare const Card: React.FC<CardProps>;
13
+ export default Card;
14
+ //# sourceMappingURL=Card.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../../../src/components/Card/Card.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC;;;;;;;;;GASG;AACH,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAMpC,CAAC;AAIF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,17 @@
1
+ export declare const Styles: {
2
+ container: {
3
+ backgroundColor: string;
4
+ borderRadius: number;
5
+ padding: number;
6
+ shadowColor: string;
7
+ shadowOffset: {
8
+ width: number;
9
+ height: number;
10
+ };
11
+ shadowOpacity: number;
12
+ shadowRadius: number;
13
+ elevation: number;
14
+ };
15
+ };
16
+ export default Styles;
17
+ //# sourceMappingURL=styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/Card/styles.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;CAWjB,CAAC;AAEH,eAAe,MAAM,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { View, ViewStyle } from 'react-native';
2
+ /**
3
+ * Props for the Card component
4
+ */
5
+ export type CardProps = {
6
+ children?: React.ReactNode;
7
+ style?: ViewStyle;
8
+ } & View;
9
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/Card/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpD;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,GAAG,IAAI,CAAC"}
@@ -1,2 +1,3 @@
1
+ export * from './components/Card/Card';
1
2
  export * from './providers/ThemeProvider';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AACA,cAAc,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AACA,cAAc,wBAAwB,CAAC;AAGvC,cAAc,2BAA2B,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { StyleSheet } from 'react-native';
2
+ export declare const Style: typeof StyleSheet;
3
+ export default Style;
4
+ //# sourceMappingURL=Style.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Style.d.ts","sourceRoot":"","sources":["../../../../src/utils/Style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,eAAO,MAAM,KAAK,mBAAa,CAAC;AAEhC,eAAe,KAAK,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dryanovski/react-native-components",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Collection of reusable React Native components for building mobile applications.",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -17,6 +17,12 @@
17
17
  "src",
18
18
  "lib"
19
19
  ],
20
+ "scripts": {
21
+ "test": "jest",
22
+ "lint": "eslint \"**/*.{js,ts,tsx}\"",
23
+ "clean": "del-cli lib",
24
+ "prepare": "bob build"
25
+ },
20
26
  "keywords": [
21
27
  "react-native",
22
28
  "ios",
@@ -106,10 +112,5 @@
106
112
  "eslint-plugin-react": "^7.37.5",
107
113
  "eslint-plugin-react-hooks": "^7.0.1",
108
114
  "eslint-plugin-react-native": "^5.0.0"
109
- },
110
- "scripts": {
111
- "test": "jest",
112
- "lint": "eslint \"**/*.{js,ts,tsx}\"",
113
- "clean": "del-cli lib"
114
115
  }
115
- }
116
+ }
@@ -0,0 +1,25 @@
1
+ import { View } from 'react-native';
2
+ import Styles from './styles';
3
+ import type { CardProps } from './types';
4
+
5
+ /**
6
+ * Card component to display content within a styled container
7
+ * @param {React.ReactNode} children - The content to be displayed inside the card
8
+ * @param {ViewStyle} style - Additional styles for the card container
9
+ * @returns {JSX.Element} The Card component
10
+ * @example
11
+ * <Card style={{ margin: 10 }}>
12
+ * <Text>This is a card</Text>
13
+ * </Card>
14
+ */
15
+ export const Card: React.FC<CardProps> = ({ children, style, ...props }) => {
16
+ return (
17
+ <View style={[Styles.container, style]} {...props}>
18
+ {children}
19
+ </View>
20
+ );
21
+ };
22
+
23
+ Card.displayName = 'Card';
24
+
25
+ export default Card;
@@ -0,0 +1,27 @@
1
+ import Style from '../../utils/Style';
2
+
3
+ const DEFAULT_CARD = {
4
+ card_background_color: '#fff',
5
+ card_border_radius: 8,
6
+ card_padding: 16,
7
+ card_shadow_color: '#000',
8
+ card_shadow_offset: { width: 0, height: 2 },
9
+ card_shadow_opacity: 0.1,
10
+ card_shadow_radius: 4,
11
+ card_elevation: 3,
12
+ };
13
+
14
+ export const Styles = Style.create({
15
+ container: {
16
+ backgroundColor: DEFAULT_CARD.card_background_color,
17
+ borderRadius: DEFAULT_CARD.card_border_radius,
18
+ padding: DEFAULT_CARD.card_padding,
19
+ shadowColor: DEFAULT_CARD.card_shadow_color,
20
+ shadowOffset: DEFAULT_CARD.card_shadow_offset,
21
+ shadowOpacity: DEFAULT_CARD.card_shadow_opacity,
22
+ shadowRadius: DEFAULT_CARD.card_shadow_radius,
23
+ elevation: DEFAULT_CARD.card_elevation,
24
+ },
25
+ });
26
+
27
+ export default Styles;
@@ -0,0 +1,9 @@
1
+ import type { View, ViewStyle } from 'react-native';
2
+
3
+ /**
4
+ * Props for the Card component
5
+ */
6
+ export type CardProps = {
7
+ children?: React.ReactNode;
8
+ style?: ViewStyle;
9
+ } & View;
package/src/index.tsx CHANGED
@@ -1,2 +1,5 @@
1
+ // Export Components
2
+ export * from './components/Card/Card';
3
+
1
4
  // Provider
2
5
  export * from './providers/ThemeProvider';
@@ -0,0 +1,5 @@
1
+ import { StyleSheet } from 'react-native';
2
+
3
+ export const Style = StyleSheet;
4
+
5
+ export default Style;