@impulse-ui-native/icon 1.0.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.
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ Icon: () => Icon
24
+ });
25
+ module.exports = __toCommonJS(index_exports);
26
+
27
+ // src/components/icon.tsx
28
+ var import_react_native_fontawesome = require("@fortawesome/react-native-fontawesome");
29
+ var import_theme = require("@impulse-ui-native/theme");
30
+ var import_react = require("react");
31
+ var Icon = (0, import_react.memo)(function Icon2({
32
+ size = "medium",
33
+ icon,
34
+ children,
35
+ style,
36
+ ...props
37
+ }) {
38
+ const theme = (0, import_theme.useTheme)();
39
+ const iconSize = (0, import_react.useMemo)(
40
+ () => ({
41
+ small: 14,
42
+ medium: 16,
43
+ large: 16
44
+ })[size],
45
+ [theme, size]
46
+ );
47
+ return /* @__PURE__ */ React.createElement(import_react_native_fontawesome.FontAwesomeIcon, { size: iconSize, icon, style, ...props });
48
+ });
49
+ // Annotate the CommonJS export names for ESM import in node:
50
+ 0 && (module.exports = {
51
+ Icon
52
+ });
53
+ //# sourceMappingURL=index.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/components/icon.tsx"],"sourcesContent":["export * from \"./components\";\r\nexport * from \"./types\";\r\n","import { FontAwesomeIcon } from \"@fortawesome/react-native-fontawesome\";\r\nimport { useTheme } from \"@impulse-ui-native/theme\";\r\nimport { memo, PropsWithChildren, useMemo } from \"react\";\r\nimport { IconProps } from \"../types\";\r\n\r\nexport const Icon = memo(function Icon({\r\n size = \"medium\",\r\n icon,\r\n children,\r\n style,\r\n ...props\r\n}: PropsWithChildren<IconProps>) {\r\n const theme = useTheme();\r\n const iconSize = useMemo(\r\n () =>\r\n ({\r\n small: 14,\r\n medium: 16,\r\n large: 16,\r\n }[size]),\r\n [theme, size]\r\n );\r\n\r\n return (\r\n <FontAwesomeIcon size={iconSize} icon={icon} style={style} {...props} />\r\n );\r\n});\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,sCAAgC;AAChC,mBAAyB;AACzB,mBAAiD;AAG1C,IAAM,WAAO,mBAAK,SAASA,MAAK;AAAA,EACrC,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAiC;AAC/B,QAAM,YAAQ,uBAAS;AACvB,QAAM,eAAW;AAAA,IACf,OACG;AAAA,MACC,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,OAAO;AAAA,IACT,GAAE,IAAI;AAAA,IACR,CAAC,OAAO,IAAI;AAAA,EACd;AAEA,SACE,oCAAC,mDAAgB,MAAM,UAAU,MAAY,OAAe,GAAG,OAAO;AAE1E,CAAC;","names":["Icon"]}
@@ -0,0 +1,16 @@
1
+ import * as react from 'react';
2
+ import { PropsWithChildren } from 'react';
3
+ import { Props } from '@fortawesome/react-native-fontawesome';
4
+ import { ComponentSize } from '@impulse-ui-native/theme';
5
+ import { ViewStyle } from 'react-native';
6
+
7
+ interface IconStyle extends ViewStyle {
8
+ color?: string;
9
+ }
10
+ interface IconProps extends Omit<Props, "size"> {
11
+ size?: ComponentSize | number;
12
+ }
13
+
14
+ declare const Icon: react.NamedExoticComponent<PropsWithChildren<IconProps>>;
15
+
16
+ export { Icon, type IconProps, type IconStyle };
@@ -0,0 +1,16 @@
1
+ import * as react from 'react';
2
+ import { PropsWithChildren } from 'react';
3
+ import { Props } from '@fortawesome/react-native-fontawesome';
4
+ import { ComponentSize } from '@impulse-ui-native/theme';
5
+ import { ViewStyle } from 'react-native';
6
+
7
+ interface IconStyle extends ViewStyle {
8
+ color?: string;
9
+ }
10
+ interface IconProps extends Omit<Props, "size"> {
11
+ size?: ComponentSize | number;
12
+ }
13
+
14
+ declare const Icon: react.NamedExoticComponent<PropsWithChildren<IconProps>>;
15
+
16
+ export { Icon, type IconProps, type IconStyle };
@@ -0,0 +1,26 @@
1
+ // src/components/icon.tsx
2
+ import { FontAwesomeIcon } from "@fortawesome/react-native-fontawesome";
3
+ import { useTheme } from "@impulse-ui-native/theme";
4
+ import { memo, useMemo } from "react";
5
+ var Icon = memo(function Icon2({
6
+ size = "medium",
7
+ icon,
8
+ children,
9
+ style,
10
+ ...props
11
+ }) {
12
+ const theme = useTheme();
13
+ const iconSize = useMemo(
14
+ () => ({
15
+ small: 14,
16
+ medium: 16,
17
+ large: 16
18
+ })[size],
19
+ [theme, size]
20
+ );
21
+ return /* @__PURE__ */ React.createElement(FontAwesomeIcon, { size: iconSize, icon, style, ...props });
22
+ });
23
+ export {
24
+ Icon
25
+ };
26
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/icon.tsx"],"sourcesContent":["import { FontAwesomeIcon } from \"@fortawesome/react-native-fontawesome\";\r\nimport { useTheme } from \"@impulse-ui-native/theme\";\r\nimport { memo, PropsWithChildren, useMemo } from \"react\";\r\nimport { IconProps } from \"../types\";\r\n\r\nexport const Icon = memo(function Icon({\r\n size = \"medium\",\r\n icon,\r\n children,\r\n style,\r\n ...props\r\n}: PropsWithChildren<IconProps>) {\r\n const theme = useTheme();\r\n const iconSize = useMemo(\r\n () =>\r\n ({\r\n small: 14,\r\n medium: 16,\r\n large: 16,\r\n }[size]),\r\n [theme, size]\r\n );\r\n\r\n return (\r\n <FontAwesomeIcon size={iconSize} icon={icon} style={style} {...props} />\r\n );\r\n});\r\n"],"mappings":";AAAA,SAAS,uBAAuB;AAChC,SAAS,gBAAgB;AACzB,SAAS,MAAyB,eAAe;AAG1C,IAAM,OAAO,KAAK,SAASA,MAAK;AAAA,EACrC,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAiC;AAC/B,QAAM,QAAQ,SAAS;AACvB,QAAM,WAAW;AAAA,IACf,OACG;AAAA,MACC,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,OAAO;AAAA,IACT,GAAE,IAAI;AAAA,IACR,CAAC,OAAO,IAAI;AAAA,EACd;AAEA,SACE,oCAAC,mBAAgB,MAAM,UAAU,MAAY,OAAe,GAAG,OAAO;AAE1E,CAAC;","names":["Icon"]}
package/package.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "@impulse-ui-native/icon",
3
+ "version": "1.0.0",
4
+ "source": "src/index.ts",
5
+ "main": "dist/index.cjs.js",
6
+ "module": "dist/index.esm.js",
7
+ "types": "dist/index.d.ts",
8
+ "react-native": "src/index.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "react-native": "./src/index.ts",
13
+ "import": "./dist/index.esm.js",
14
+ "require": "./dist/index.cjs.js"
15
+ }
16
+ },
17
+ "files": [
18
+ "dist",
19
+ "src",
20
+ "README.md",
21
+ "LICENSE"
22
+ ],
23
+ "dependencies": {
24
+ "@fortawesome/fontawesome-svg-core": "^7.1.0",
25
+ "@fortawesome/free-brands-svg-icons": "^7.1.0",
26
+ "@fortawesome/free-regular-svg-icons": "^7.1.0",
27
+ "@fortawesome/free-solid-svg-icons": "^7.1.0",
28
+ "@fortawesome/react-native-fontawesome": "^0.3.2",
29
+ "react-native-svg": "^15.14.0",
30
+ "@impulse-ui-native/core": "1.0.0",
31
+ "@impulse-ui-native/theme": "1.0.0"
32
+ },
33
+ "peerDependencies": {
34
+ "@fortawesome/free-brands-svg-icons": "^7.1.0",
35
+ "@fortawesome/free-regular-svg-icons": "^7.1.0",
36
+ "@fortawesome/free-solid-svg-icons": "^7.1.0",
37
+ "expo": ">=51 || >=52",
38
+ "expo-modules-core": ">=1.0.0",
39
+ "react": ">=18",
40
+ "react-native": ">=0.74",
41
+ "react-native-gesture-handler": ">=2",
42
+ "react-native-reanimated": ">=3",
43
+ "react-native-safe-area-context": "5.6.1",
44
+ "react-native-worklets": ">=0.5.1"
45
+ },
46
+ "publishConfig": {
47
+ "access": "public"
48
+ },
49
+ "scripts": {
50
+ "build": "tsup --config tsup.config.ts",
51
+ "typecheck": "tsc -p tsconfig.json --noEmit"
52
+ }
53
+ }
@@ -0,0 +1,27 @@
1
+ import { FontAwesomeIcon } from "@fortawesome/react-native-fontawesome";
2
+ import { useTheme } from "@impulse-ui-native/theme";
3
+ import { memo, PropsWithChildren, useMemo } from "react";
4
+ import { IconProps } from "../types";
5
+
6
+ export const Icon = memo(function Icon({
7
+ size = "medium",
8
+ icon,
9
+ children,
10
+ style,
11
+ ...props
12
+ }: PropsWithChildren<IconProps>) {
13
+ const theme = useTheme();
14
+ const iconSize = useMemo(
15
+ () =>
16
+ ({
17
+ small: 14,
18
+ medium: 16,
19
+ large: 16,
20
+ }[size]),
21
+ [theme, size]
22
+ );
23
+
24
+ return (
25
+ <FontAwesomeIcon size={iconSize} icon={icon} style={style} {...props} />
26
+ );
27
+ });
@@ -0,0 +1 @@
1
+ export { Icon } from "./icon";
package/src/index.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from "./components";
2
+ export * from "./types";
@@ -0,0 +1,11 @@
1
+ import { Props } from "@fortawesome/react-native-fontawesome";
2
+ import { ComponentSize } from "@impulse-ui-native/theme";
3
+ import { ViewStyle } from "react-native";
4
+
5
+ export interface IconStyle extends ViewStyle {
6
+ color?: string;
7
+ }
8
+
9
+ export interface IconProps extends Omit<Props, "size"> {
10
+ size?: ComponentSize | number;
11
+ }
@@ -0,0 +1 @@
1
+ export * from "./icon.types";