@integrigo/integrigo-ui 1.3.1 → 1.3.4

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/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "registry": "https://npm.pkg.github.com/integrigo"
5
5
  },
6
- "version": "1.3.1",
6
+ "version": "1.3.4",
7
7
  "main": "lib/index.js",
8
8
  "module": "lib/index.esm.js",
9
9
  "types": "lib/index.d.ts",
@@ -49,8 +49,8 @@
49
49
  "build": "rollup -c"
50
50
  },
51
51
  "exports": {
52
- ".": "./index.ts",
53
- "./lib/*": "./components/*/index.ts",
54
- "./style/": "./style/"
52
+ ".": "./lib/index.js",
53
+ "./lib/*": "./lib/components/*/index.js",
54
+ "./style/": "./lib/style/"
55
55
  }
56
56
  }
@@ -1,64 +0,0 @@
1
- import React from "react";
2
- import styled from "styled-components";
3
-
4
- export interface ButtonProps
5
- extends React.DetailedHTMLProps<
6
- React.ButtonHTMLAttributes<HTMLButtonElement>,
7
- HTMLButtonElement
8
- > {
9
- primary?: boolean;
10
- ghost?: boolean;
11
- size?: "small" | "medium" | "large";
12
- }
13
-
14
- export const Button = styled.button<Omit<ButtonProps, "label">>`
15
- background-color: transparent;
16
- border: none;
17
- border-radius: var(--padding-xl);
18
- padding: var(--padding-m) var(--padding-l);
19
- font-weight: var(--font-bold);
20
- font-size: var(--font-size-l);
21
- cursor: pointer;
22
- overflow: hidden;
23
- position: relative;
24
-
25
- &:before {
26
- content: "";
27
- position: absolute;
28
- left: 0;
29
- top: 0;
30
- width: calc(100% - 4px);
31
- height: calc(100% - 4px);
32
- background-color: ${(p) =>
33
- p.primary && !p.ghost ? "var(--color-orange)" : "transparent"};
34
- border: ${(p) => (p.ghost ? "none" : "2px solid var(--color-orange)")};
35
- border-radius: var(--padding-xl);
36
- z-index: -1;
37
- transition: opacity var(--transition-speed);
38
- }
39
-
40
- &:focus,
41
- &:active {
42
- color: ${(p) =>
43
- p.primary && !p.ghost ? "var(--color-white)" : "var(--color-navy)"};
44
- outline: none;
45
- }
46
-
47
- &:focus:before,
48
- &:active:before {
49
- background-color: ${(p) =>
50
- p.primary && !p.ghost ? "var(--color-green)" : "transparent"};
51
- border: ${(p) => (p.ghost ? "none" : "2px solid var(--color-green)")};
52
- }
53
-
54
- &:hover:before {
55
- opacity: 0.5;
56
- }
57
-
58
- &:hover:focus:before,
59
- &:hover:active:before {
60
- opacity: 1;
61
- }
62
- `;
63
-
64
- Button.displayName = "Button";
@@ -1 +0,0 @@
1
- export { Button } from './Button'
@@ -1,11 +0,0 @@
1
- import styled from 'styled-components'
2
-
3
- export const Card = styled.div<{inverse?: boolean}>`
4
- background-color: ${p => p.inverse ? 'var(--color-navy)' : 'var(--color-white)'};
5
- box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
6
- color: ${p => p.inverse ? 'var(--color-white)' : 'var(--color-navy)'};
7
- padding: var(--padding-xl);
8
- border-radius: 24px;
9
- `
10
-
11
- Card.displayName = 'Card'
@@ -1 +0,0 @@
1
- export { Card } from './Card'
@@ -1,43 +0,0 @@
1
- import React from "react";
2
- import {
3
- FontAwesomeIcon,
4
- FontAwesomeIconProps,
5
- } from "@fortawesome/react-fontawesome";
6
- import { IconProp } from "@fortawesome/fontawesome-svg-core";
7
-
8
- import * as SolidIcons from "@fortawesome/free-solid-svg-icons";
9
- import * as BrandIcons from "@fortawesome/free-brands-svg-icons";
10
-
11
- const ICONS = ["bars", "plus", "minus", "phone", "envelope"];
12
- const SOCIAL_ICONS = ["facebook", "instagram", "linkedin"];
13
-
14
- type IconType = typeof ICONS[number];
15
- type IconSocialType = typeof SOCIAL_ICONS[number];
16
-
17
- type IconProps = Omit<FontAwesomeIconProps, "icon"> & {
18
- icon: IconType | IconSocialType;
19
- };
20
-
21
- const toFaIcon = <T extends typeof BrandIcons | typeof SolidIcons>(
22
- icon: IconType | IconSocialType
23
- ): keyof T => `fa${icon.charAt(0).toUpperCase() + icon.slice(1)}` as keyof T;
24
-
25
- const getIcon = (icon: IconType | IconSocialType): IconProp => {
26
- if (SOCIAL_ICONS.includes(icon)) {
27
- if (icon === "facebook") {
28
- return BrandIcons.faFacebookSquare;
29
- }
30
-
31
- const iconName = toFaIcon(icon);
32
- return BrandIcons[iconName] as IconProp;
33
- }
34
-
35
- const iconName = toFaIcon(icon) as keyof typeof SolidIcons;
36
- return SolidIcons[iconName] as IconProp;
37
- };
38
-
39
- export const Icon: React.FC<IconProps> = ({ icon, ...props }) => {
40
- const iconType = getIcon(icon);
41
-
42
- return <FontAwesomeIcon icon={iconType} {...props} />;
43
- };
@@ -1 +0,0 @@
1
- export { Icon } from './Icon'
@@ -1,19 +0,0 @@
1
- import styled from 'styled-components'
2
-
3
- export const Input = styled.input`
4
- background-color: var(--color-orange-transparent);
5
- border: 2px solid transparent;
6
- border-radius: var(--padding-xl);
7
- padding: var(--padding-l);
8
- position: relative;
9
- overflow: hidden;
10
- color: var(--color-navy);
11
- font-weight: var(--font-bold);
12
-
13
- &:focus, &:active {
14
- outline: none;
15
- border: 2px solid var(--color-green);
16
- }
17
- `
18
-
19
- Input.displayName = 'Input'
@@ -1 +0,0 @@
1
- export { Input } from './Input'
@@ -1,21 +0,0 @@
1
- import styled from "styled-components";
2
-
3
- export interface NavProps {
4
- active?: boolean;
5
- }
6
-
7
- export const Nav = styled.nav<NavProps>`
8
- font-size: var(--font-size-l);
9
- font-weight: ${p => p.active ? 'var(--font-bold)' : 'var(--font-medium)'};
10
- cursor: pointer;
11
- white-space: nowrap;
12
- width: min-content;
13
- transition: color var(--transition-speed);
14
- padding: var(--padding-s) var(--padding-l);
15
-
16
- &:hover {
17
- color: ${p => p.active ? 'auto' : 'var(--color-green)' };
18
- }
19
- `
20
-
21
- Nav.displayName = 'Nav'
@@ -1 +0,0 @@
1
- export { Nav } from './Nav'
@@ -1,17 +0,0 @@
1
- import styled from 'styled-components'
2
-
3
- interface PillProps {
4
- variant: 'orange' | 'green' | 'red'
5
- }
6
-
7
- export const Pill = styled.div<PillProps>`
8
- background-color: ${p => `var(--color-${p.variant})`};
9
- border-radius: var(--padding-l);
10
- color: var(--color-white);
11
- font-weight: var(--font-bold);
12
- font-size: var(--font-size-m);
13
- padding: var(--padding-s) var(--padding-xxl);
14
- width: min-content;
15
- `
16
-
17
- Pill.displayName = 'Pill'
@@ -1 +0,0 @@
1
- export { Pill } from './Pill'
@@ -1,12 +0,0 @@
1
- import styled from "styled-components";
2
-
3
- export interface BodyProps {
4
- size?: 's' | 'm' | 'l' | 'xl' | 'xxl'
5
- }
6
-
7
- export const Body = styled.p<BodyProps>`
8
- font-size: ${p => `var(--font-size-${p.size || 'm'})`};
9
- line-height: ${p => `calc(1.5*var(--font-size-${p.size || 'm'}))`};
10
- `
11
-
12
- Body.displayName = 'Body'
@@ -1,21 +0,0 @@
1
- import React from 'react'
2
- import styled from "styled-components";
3
-
4
- export interface HeroProps {
5
- size?: 's' | 'm' | 'l' | 'xl' | 'xxl'
6
- }
7
-
8
- const SIZE_MAP: Record<string, 'h1' | 'h2' | 'h3' | 'h4' | 'h5'> = {
9
- 's': 'h5',
10
- 'm': 'h4',
11
- 'l': 'h3',
12
- 'xl': 'h2',
13
- 'xxl': 'h1',
14
- }
15
-
16
- export const Hero: React.FC<HeroProps> = ({ size = 'l', children }) => (
17
- <Header as={SIZE_MAP[size]}>{children}</Header>
18
- )
19
-
20
- const Header = styled.h1``
21
- Header.displayName = 'Header'
@@ -1,12 +0,0 @@
1
- import styled from "styled-components";
2
-
3
- export interface LabelProps {
4
- size?: 's' | 'm' | 'l' | 'xl' | 'xxl'
5
- }
6
-
7
- export const Label = styled.span<LabelProps>`
8
- font-size: ${p => `var(--font-size-${p.size || 'm'})`};
9
- font-weight: var(--font-medium);
10
- `
11
-
12
- Label.displayName = 'Label'
@@ -1,5 +0,0 @@
1
- import { Body } from './Body'
2
- import { Hero } from './Hero'
3
- import { Label } from './Label'
4
-
5
- export const Typography = { Body, Hero, Label }
@@ -1,7 +0,0 @@
1
- export { Button } from './Button'
2
- export { Card } from './Card'
3
- export { Icon } from './Icon'
4
- export { Input } from './Input'
5
- export { Pill } from './Pill'
6
- export { Typography } from './Typography'
7
- export { Nav } from './Nav'
@@ -1,69 +0,0 @@
1
- import React from "react";
2
- import styled from "styled-components";
3
- import { Card } from "../../atoms/Card";
4
- import { Hero } from "../../atoms/Typography/Hero";
5
- import { Body } from "../../atoms/Typography/Body";
6
-
7
- export interface InfoCardProps {
8
- title: string;
9
- body: React.ReactNode;
10
- background?: React.ReactNode;
11
- inverse?: boolean;
12
- size?: 's' | 'm' | 'l' | 'xl' | 'xxl'
13
- }
14
-
15
- export const InfoCard: React.FC<InfoCardProps> = ({
16
- title,
17
- body,
18
- background,
19
- inverse = false,
20
- size = 'l'
21
- }) => {
22
- return (
23
- <Root>
24
- {background && <Background>{background}</Background>}
25
- <CardBody inverse={inverse}>
26
- <Hero size={size}>{title}</Hero>
27
- <Body size={size}>{body}</Body>
28
- </CardBody>
29
- </Root>
30
- );
31
- };
32
-
33
- const Root = styled.div`
34
- padding: 0;
35
- position: relative;
36
-
37
- & > ${Card} > p {
38
- margin: 0;
39
- }
40
- `;
41
-
42
- Root.displayName = "Root";
43
-
44
- const CardBody = styled(Card)<{ inverse: boolean }>`
45
- position: relative;
46
-
47
- & > * {
48
- margin: 0;
49
- margin-bottom: var(--padding-m);
50
- color: ${p => p.inverse ? 'var(--color-white)' : 'var(--color-navy)'};
51
- }
52
-
53
- & > p {
54
- margin: 0;
55
- }
56
- `;
57
-
58
- CardBody.displayName = "CardBody";
59
-
60
- const Background = styled(Card)`
61
- border-radius: 24px 24px 0px 0px;
62
- position: relative;
63
- height: 100%;
64
- margin-bottom: -24px;
65
- padding: 0;
66
- overflow: hidden;
67
- `;
68
-
69
- Background.displayName = "Background";
@@ -1 +0,0 @@
1
- export { InfoCard } from './InfoCard'
@@ -1 +0,0 @@
1
- export { InfoCard } from './InfoCard'
package/src/index.ts DELETED
@@ -1,15 +0,0 @@
1
- export {
2
- Button,
3
- Card,
4
- Icon,
5
- Input,
6
- Nav,
7
- Pill,
8
- Typography
9
- } from './components/atoms'
10
-
11
- export {
12
- InfoCard
13
- } from './components/molecules'
14
-
15
- export { GlobalStyles as IntegrigoUI, Color } from './styles'
@@ -1,8 +0,0 @@
1
- export enum Color {
2
- White = '#FFF',
3
- Ecru = '#F9F1E5',
4
- Navy = '#172142',
5
- Orange = '#E09A33',
6
- Red = '#CF544B',
7
- Green = '#6B8B4A'
8
- }
@@ -1,79 +0,0 @@
1
- import { createGlobalStyle } from 'styled-components'
2
- import { Color } from './colors'
3
-
4
- export const GlobalStyles = createGlobalStyle`
5
- @import url('https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,200;0,300;0,600;0,800;1,200;1,300;1,600;1,800&display=swap');
6
-
7
- html {
8
- --color-white: ${Color.White};
9
- --color-ecru: ${Color.Ecru};
10
- --color-navy: ${Color.Navy};
11
- --color-orange: ${Color.Orange};
12
- --color-red: ${Color.Red};
13
- --color-green: ${Color.Green};
14
-
15
- --color-orange-translucent: ${Color.Orange}80;
16
- --color-orange-transparent: ${Color.Orange}33;
17
-
18
- --padding-s: 8px;
19
- --padding-m: 16px;
20
- --padding-l: 24px;
21
- --padding-xl: 32px;
22
- --padding-xxl: 48px;
23
-
24
- --font-bold: 800;
25
- --font-medium: 600;
26
- --font-thin: 300;
27
-
28
- --font-size-s: 10px;
29
- --font-size-m: 16px;
30
- --font-size-l: 20px;
31
- --font-size-xl: 32px;
32
- --font-size-xxl: 40px;
33
-
34
- --header-size-s: 16px;
35
- --header-size-m: 24px;
36
- --header-size-l: 32px;
37
- --header-size-xl: 48px;
38
- --header-size-xxl: 72px;
39
-
40
- --transition-speed: .3s;
41
- }
42
-
43
- body {
44
- background-color: var(--color-ecru);
45
- }
46
-
47
- * {
48
- box-sizing: border-box;
49
- color: var(--color-navy);
50
- font-family: Raleway, Arial, Helvetica, Sans-Serif;
51
- font-size: var(--font-size-m);
52
- font-weight: var(--font-thin);
53
- }
54
-
55
- h1 {
56
- font-size: var(--header-size-xxl);
57
- font-weight: var(--font-bold);
58
- }
59
-
60
- h2 {
61
- font-size: var(--header-size-xl);
62
- font-weight: var(--font-bold);
63
- }
64
-
65
- h3 {
66
- font-size: var(--header-size-l);
67
- font-weight: var(--font-bold);
68
- }
69
-
70
- h4 {
71
- font-size: var(--header-size-m);
72
- font-weight: var(--font-bold);
73
- }
74
-
75
- h5 {
76
- font-size: var(--header-size-s);
77
- font-weight: var(--font-bold);
78
- }
79
- `
@@ -1,2 +0,0 @@
1
- export { GlobalStyles } from './global'
2
- export { Color } from './colors'
package/tsconfig.json DELETED
@@ -1,32 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "es5",
4
- "outDir": "lib",
5
- "lib": [
6
- "dom",
7
- "dom.iterable",
8
- "esnext"
9
- ],
10
- "declaration": true,
11
- "declarationDir": "lib",
12
- "allowJs": true,
13
- "skipLibCheck": true,
14
- "esModuleInterop": true,
15
- "allowSyntheticDefaultImports": true,
16
- "strict": true,
17
- "forceConsistentCasingInFileNames": true,
18
- "module": "esnext",
19
- "moduleResolution": "node",
20
- "resolveJsonModule": true,
21
- "isolatedModules": true,
22
- "noEmit": true,
23
- "jsx": "react"
24
- },
25
- "include": [
26
- "src"
27
- ],
28
- "exclude": [
29
- "node_modules",
30
- "lib"
31
- ]
32
- }