@integrigo/integrigo-ui 1.1.10 → 1.2.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,7 @@
1
+ import React from 'react';
2
+ declare type IconType = "bars" | "plus" | "minus";
3
+ declare type IconProps = {
4
+ icon: IconType;
5
+ };
6
+ export declare const Icon: React.FC<IconProps>;
7
+ export {};
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { ComponentStory, ComponentMeta } from '@storybook/react';
3
+ declare const _default: ComponentMeta<React.FC<{
4
+ icon: "bars" | "plus" | "minus";
5
+ }>>;
6
+ export default _default;
7
+ export declare const Bars: ComponentStory<React.FC<{
8
+ icon: "bars" | "plus" | "minus";
9
+ }>>;
10
+ export declare const Plus: ComponentStory<React.FC<{
11
+ icon: "bars" | "plus" | "minus";
12
+ }>>;
13
+ export declare const Minus: ComponentStory<React.FC<{
14
+ icon: "bars" | "plus" | "minus";
15
+ }>>;
@@ -0,0 +1 @@
1
+ export { Icon } from './Icon';
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "registry": "https://npm.pkg.github.com/integrigo"
5
5
  },
6
- "version": "1.1.10",
6
+ "version": "1.2.0",
7
7
  "main": "lib/index.js",
8
8
  "module": "lib/index.esm.js",
9
9
  "types": "lib/index.d.ts",
@@ -25,14 +25,18 @@
25
25
  "postcss": "^8.4.7",
26
26
  "react": "^17.0.2",
27
27
  "react-dom": "^17.0.2",
28
- "styled-components": "^5.3.3",
29
28
  "rollup": "^2.69.0",
30
29
  "rollup-plugin-peer-deps-external": "^2.2.4",
31
30
  "rollup-plugin-postcss": "^4.0.2",
32
31
  "rollup-plugin-typescript2": "^0.31.2",
32
+ "styled-components": "^5.3.3",
33
33
  "typescript": "^4.5.5"
34
34
  },
35
- "dependencies": {},
35
+ "dependencies": {
36
+ "@fortawesome/fontawesome-svg-core": "^6.1.1",
37
+ "@fortawesome/free-solid-svg-icons": "^6.1.1",
38
+ "@fortawesome/react-fontawesome": "^0.1.18"
39
+ },
36
40
  "peerDependencies": {
37
41
  "react": "^17.0.2",
38
42
  "react-dom": "^17.0.2",
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import { ComponentStory, ComponentMeta } from '@storybook/react';
3
+
4
+ import { Icon } from './Icon';
5
+
6
+ export default {
7
+ title: 'Atoms/Icon',
8
+ component: Icon,
9
+ } as ComponentMeta<typeof Icon>;
10
+
11
+ const Template: ComponentStory<typeof Icon> = (args) => <Icon {...args} />;
12
+
13
+ export const Bars = Template.bind({});
14
+ Bars.args = { icon: 'bars' };
15
+
16
+ export const Plus = Template.bind({});
17
+ Plus.args = { icon: 'plus' };
18
+
19
+ export const Minus = Template.bind({});
20
+ Minus.args = { icon: 'minus' };
@@ -0,0 +1,18 @@
1
+ import React from 'react'
2
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
3
+ import * as SolidIcons from '@fortawesome/free-solid-svg-icons'
4
+ import { IconProp } from '@fortawesome/fontawesome-svg-core'
5
+
6
+ type IconType = "bars" | "plus" | "minus"
7
+
8
+ type IconProps = {
9
+ icon: IconType
10
+ }
11
+
12
+ export const Icon: React.FC<IconProps> = ({ icon }) => {
13
+ const iconName = `fa${icon.charAt(0).toUpperCase() + icon.slice(1)}` as keyof typeof SolidIcons
14
+
15
+ return (
16
+ <FontAwesomeIcon icon={SolidIcons[iconName] as IconProp} />
17
+ )
18
+ }
@@ -0,0 +1 @@
1
+ export { Icon } from './Icon'