oddsgate-ds 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.
- package/. babelrc +3 -0
- package/.cache/storybook/default/dev-server/a5a8bf6e622aef57065c6498611f40c911543d7d-3920d97c51b8ad2521918fb1205babd22b0ed3d7 +1 -0
- package/.cache/storybook/default/dev-server/a5a8bf6e622aef57065c6498611f40c911543d7d-43fdebe5fc35e4e9fabee9a83c7faea931b05ea0 +1 -0
- package/.cache/storybook/default/dev-server/a5a8bf6e622aef57065c6498611f40c911543d7d-f086b87885981c04ce7a583ff90a49313de83de7 +1 -0
- package/.eslintrc.cjs +14 -0
- package/.storybook/main.ts +28 -0
- package/.storybook/preview.ts +22 -0
- package/README.md +30 -0
- package/package.json +63 -0
- package/public/assets/components/quotes.svg +3 -0
- package/public/assets/empty-state.svg +19 -0
- package/public/assets/placeholder.png +0 -0
- package/public/assets/video.mp4 +0 -0
- package/public/fonts/miewfont/miewfont.eot +0 -0
- package/public/fonts/miewfont/miewfont.svg +35 -0
- package/public/fonts/miewfont/miewfont.ttf +0 -0
- package/public/fonts/miewfont/miewfont.woff +0 -0
- package/src/components/atoms/Button/Button.component.tsx +48 -0
- package/src/components/atoms/Button/Button.interface.ts +29 -0
- package/src/components/atoms/Button/Button.stories.tsx +58 -0
- package/src/components/atoms/Button/Button.theme.ts +126 -0
- package/src/components/atoms/Button/index.ts +1 -0
- package/src/components/atoms/Chip/Chip.component.tsx +26 -0
- package/src/components/atoms/Chip/Chip.interface.ts +10 -0
- package/src/components/atoms/Chip/Chip.stories.tsx +34 -0
- package/src/components/atoms/Chip/Chip.theme.ts +47 -0
- package/src/components/atoms/Chip/index.ts +1 -0
- package/src/components/atoms/CloseButton/CloseButton.component.tsx +17 -0
- package/src/components/atoms/CloseButton/CloseButton.interface.ts +9 -0
- package/src/components/atoms/CloseButton/CloseButton.stories.tsx +24 -0
- package/src/components/atoms/CloseButton/CloseButton.theme.ts +66 -0
- package/src/components/atoms/CloseButton/index.ts +1 -0
- package/src/components/atoms/EmptyState/EmptyState.component.tsx +27 -0
- package/src/components/atoms/EmptyState/EmptyState.interface.ts +10 -0
- package/src/components/atoms/EmptyState/EmptyState.stories.tsx +34 -0
- package/src/components/atoms/EmptyState/EmptyState.theme.ts +27 -0
- package/src/components/atoms/EmptyState/index.ts +1 -0
- package/src/components/atoms/Flex/Flex.component.tsx +30 -0
- package/src/components/atoms/Flex/Flex.interface.ts +22 -0
- package/src/components/atoms/Flex/Flex.theme.ts +11 -0
- package/src/components/atoms/Flex/index.ts +1 -0
- package/src/components/atoms/FlexGrid/FlexGrid.component.tsx +61 -0
- package/src/components/atoms/FlexGrid/FlexGrid.interface.ts +55 -0
- package/src/components/atoms/FlexGrid/FlexGrid.stories.tsx +55 -0
- package/src/components/atoms/FlexGrid/FlexGrid.theme.ts +79 -0
- package/src/components/atoms/FlexGrid/index.ts +1 -0
- package/src/components/atoms/FormField/CheckRadioField/CheckRadioField.component.tsx +22 -0
- package/src/components/atoms/FormField/CheckRadioField/CheckRadioField.interface.tsx +6 -0
- package/src/components/atoms/FormField/CheckRadioField/CheckRadioField.theme.ts +126 -0
- package/src/components/atoms/FormField/CheckRadioField/index.ts +1 -0
- package/src/components/atoms/FormField/FormField.component.tsx +37 -0
- package/src/components/atoms/FormField/FormField.interface.ts +9 -0
- package/src/components/atoms/FormField/FormField.stories.tsx +499 -0
- package/src/components/atoms/FormField/FormField.theme.tsx +122 -0
- package/src/components/atoms/FormField/index.ts +1 -0
- package/src/components/atoms/Heading/Heading.component.tsx +17 -0
- package/src/components/atoms/Heading/Heading.interface.tsx +21 -0
- package/src/components/atoms/Heading/Heading.theme.ts +17 -0
- package/src/components/atoms/Heading/index.ts +1 -0
- package/src/components/atoms/Icon/Icon.component.tsx +19 -0
- package/src/components/atoms/Icon/Icon.interface.ts +8 -0
- package/src/components/atoms/Icon/Icon.stories.tsx +26 -0
- package/src/components/atoms/Icon/Icon.theme.ts +102 -0
- package/src/components/atoms/Icon/index.ts +1 -0
- package/src/components/atoms/ImageWrapper/ImageWrapper.component.tsx +42 -0
- package/src/components/atoms/ImageWrapper/ImageWrapper.interface.ts +16 -0
- package/src/components/atoms/ImageWrapper/ImageWrapper.stories.tsx +27 -0
- package/src/components/atoms/ImageWrapper/ImageWrapper.theme.ts +51 -0
- package/src/components/atoms/ImageWrapper/index.ts +1 -0
- package/src/components/atoms/Loader/Loader.component.tsx +26 -0
- package/src/components/atoms/Loader/Loader.interface.ts +10 -0
- package/src/components/atoms/Loader/Loader.stories.tsx +33 -0
- package/src/components/atoms/Loader/Loader.theme.ts +92 -0
- package/src/components/atoms/Loader/index.ts +1 -0
- package/src/components/atoms/Marquee/Marquee.component.tsx +130 -0
- package/src/components/atoms/Marquee/Marquee.interface.ts +8 -0
- package/src/components/atoms/Marquee/Marquee.stories.tsx +20 -0
- package/src/components/atoms/Marquee/Marquee.theme.ts +42 -0
- package/src/components/atoms/Marquee/index.ts +1 -0
- package/src/components/atoms/Quote/Quote.component.tsx +29 -0
- package/src/components/atoms/Quote/Quote.interface.ts +10 -0
- package/src/components/atoms/Quote/Quote.stories.tsx +25 -0
- package/src/components/atoms/Quote/Quote.theme.ts +26 -0
- package/src/components/atoms/Quote/index.ts +1 -0
- package/src/components/atoms/RichText/RichText.component.tsx +31 -0
- package/src/components/atoms/RichText/RichText.interface.ts +11 -0
- package/src/components/atoms/RichText/RichText.stories.tsx +73 -0
- package/src/components/atoms/RichText/RichText.theme.ts +32 -0
- package/src/components/atoms/RichText/index.ts +1 -0
- package/src/components/atoms/ScrollingNav/ScrollingNav.component.tsx +18 -0
- package/src/components/atoms/ScrollingNav/ScrollingNav.interface.ts +8 -0
- package/src/components/atoms/ScrollingNav/ScrollingNav.stories.tsx +44 -0
- package/src/components/atoms/ScrollingNav/ScrollingNav.theme.ts +55 -0
- package/src/components/atoms/ScrollingNav/index.ts +1 -0
- package/src/components/atoms/Separator/Separator.component.tsx +19 -0
- package/src/components/atoms/Separator/Separator.interface.tsx +9 -0
- package/src/components/atoms/Separator/Separator.stories.tsx +28 -0
- package/src/components/atoms/Separator/Separator.theme.ts +12 -0
- package/src/components/atoms/Separator/index.ts +1 -0
- package/src/components/atoms/SocialLinks/SocialLinks.component.tsx +35 -0
- package/src/components/atoms/SocialLinks/SocialLinks.interface.ts +8 -0
- package/src/components/atoms/SocialLinks/SocialLinks.stories.tsx +36 -0
- package/src/components/atoms/SocialLinks/SocialLinks.theme.ts +52 -0
- package/src/components/atoms/SocialLinks/index.ts +1 -0
- package/src/components/atoms/Spacer/Spacer.component.tsx +27 -0
- package/src/components/atoms/Spacer/Spacer.interface.ts +11 -0
- package/src/components/atoms/Spacer/Spacer.stories.tsx +28 -0
- package/src/components/atoms/Spacer/Spacer.theme.ts +8 -0
- package/src/components/atoms/Spacer/index.ts +1 -0
- package/src/components/atoms/Video/Video.component.tsx +116 -0
- package/src/components/atoms/Video/Video.interface.ts +13 -0
- package/src/components/atoms/Video/Video.stories.tsx +37 -0
- package/src/components/atoms/Video/Video.theme.ts +44 -0
- package/src/components/atoms/Video/index.ts +1 -0
- package/src/components/atoms/VideoEmbed/VideoEmbed.component.tsx +109 -0
- package/src/components/atoms/VideoEmbed/VideoEmbed.interface.ts +13 -0
- package/src/components/atoms/VideoEmbed/VideoEmbed.stories.tsx +23 -0
- package/src/components/atoms/VideoEmbed/VideoEmbed.theme.ts +45 -0
- package/src/components/atoms/VideoEmbed/index.ts +1 -0
- package/src/components/common/PortalComponent/PortalComponent.tsx +48 -0
- package/src/components/common/PortalComponent/index.ts +1 -0
- package/src/components/molecules/Accordion/Accordion.component.tsx +58 -0
- package/src/components/molecules/Accordion/Accordion.interface.ts +15 -0
- package/src/components/molecules/Accordion/Accordion.stories.tsx +100 -0
- package/src/components/molecules/Accordion/Accordion.theme.ts +66 -0
- package/src/components/molecules/Accordion/index.ts +1 -0
- package/src/components/molecules/BlogCard/BlogCard.component.tsx +48 -0
- package/src/components/molecules/BlogCard/BlogCard.interface.ts +10 -0
- package/src/components/molecules/BlogCard/BlogCard.stories.tsx +37 -0
- package/src/components/molecules/BlogCard/BlogCard.theme.ts +63 -0
- package/src/components/molecules/BlogCard/index.ts +1 -0
- package/src/components/molecules/Card/Card.component.tsx +15 -0
- package/src/components/molecules/Card/Card.interface.ts +10 -0
- package/src/components/molecules/Card/Card.theme.ts +53 -0
- package/src/components/molecules/Card/index.ts +1 -0
- package/src/components/molecules/Dropdown/Dropdown.component.tsx +67 -0
- package/src/components/molecules/Dropdown/Dropdown.interface.ts +26 -0
- package/src/components/molecules/Dropdown/Dropdown.stories.tsx +54 -0
- package/src/components/molecules/Dropdown/Dropdown.theme.ts +50 -0
- package/src/components/molecules/Dropdown/index.ts +1 -0
- package/src/components/molecules/IconBox/IconBox.component.tsx +29 -0
- package/src/components/molecules/IconBox/IconBox.interface.tsx +10 -0
- package/src/components/molecules/IconBox/IconBox.stories.tsx +23 -0
- package/src/components/molecules/IconBox/IconBox.theme.ts +25 -0
- package/src/components/molecules/IconBox/index.ts +1 -0
- package/src/components/molecules/IconTitle/IconTitle.component.tsx +24 -0
- package/src/components/molecules/IconTitle/IconTitle.interface.tsx +10 -0
- package/src/components/molecules/IconTitle/IconTitle.stories.tsx +49 -0
- package/src/components/molecules/IconTitle/IconTitle.theme.ts +10 -0
- package/src/components/molecules/IconTitle/index.ts +1 -0
- package/src/components/molecules/Modal/Modal.component.tsx +70 -0
- package/src/components/molecules/Modal/Modal.interface.ts +11 -0
- package/src/components/molecules/Modal/Modal.stories.tsx +57 -0
- package/src/components/molecules/Modal/Modal.theme.ts +55 -0
- package/src/components/molecules/Modal/index.ts +1 -0
- package/src/components/molecules/OffCanvas/OffCanvas.component.tsx +55 -0
- package/src/components/molecules/OffCanvas/OffCanvas.interface.ts +12 -0
- package/src/components/molecules/OffCanvas/OffCanvas.stories.tsx +55 -0
- package/src/components/molecules/OffCanvas/OffCanvas.theme.ts +50 -0
- package/src/components/molecules/OffCanvas/index.ts +1 -0
- package/src/components/molecules/ProjectCard/ProjectCard.component.tsx +45 -0
- package/src/components/molecules/ProjectCard/ProjectCard.interface.ts +8 -0
- package/src/components/molecules/ProjectCard/ProjectCard.stories.tsx +72 -0
- package/src/components/molecules/ProjectCard/ProjectCard.theme.ts +61 -0
- package/src/components/molecules/ProjectCard/index.ts +1 -0
- package/src/components/molecules/ShareModal/ShareModal.component.tsx +166 -0
- package/src/components/molecules/ShareModal/ShareModal.interface.ts +9 -0
- package/src/components/molecules/ShareModal/ShareModal.stories.tsx +33 -0
- package/src/components/molecules/ShareModal/ShareModal.theme.ts +101 -0
- package/src/components/molecules/ShareModal/index.ts +1 -0
- package/src/components/molecules/TeamCard/TeamCard.component.tsx +31 -0
- package/src/components/molecules/TeamCard/TeamCard.interface.ts +7 -0
- package/src/components/molecules/TeamCard/TeamCard.stories.tsx +33 -0
- package/src/components/molecules/TeamCard/TeamCard.theme.ts +12 -0
- package/src/components/molecules/TeamCard/index.ts +1 -0
- package/src/components/organisms/Cover/Cover.component.tsx +46 -0
- package/src/components/organisms/Cover/Cover.interface.ts +14 -0
- package/src/components/organisms/Cover/Cover.stories.tsx +97 -0
- package/src/components/organisms/Cover/Cover.theme.ts +49 -0
- package/src/components/organisms/Cover/index.ts +1 -0
- package/src/components/organisms/Slider/Slider.component.tsx +145 -0
- package/src/components/organisms/Slider/Slider.interface.ts +17 -0
- package/src/components/organisms/Slider/Slider.stories.tsx +73 -0
- package/src/components/organisms/Slider/Slider.theme.ts +125 -0
- package/src/components/organisms/Slider/Slider.utils.tsx +19 -0
- package/src/components/organisms/Slider/index.ts +1 -0
- package/src/helpers/clickOutsideToClose.tsx +17 -0
- package/src/helpers/getIcons.ts +5 -0
- package/src/helpers/useMediaQuery.tsx +24 -0
- package/src/helpers/uuid.ts +5 -0
- package/src/iconsList.json +1 -0
- package/src/index.ts +53 -0
- package/src/reportWebVitals.js +13 -0
- package/src/stories/Documentation/Colors.stories.tsx +33 -0
- package/src/stories/Documentation/Headings.stories.tsx +24 -0
- package/src/stories/Documentation/Icons.stories.tsx +73 -0
- package/src/stories/Documentation/JWT.stories.tsx +60 -0
- package/src/stories/Documentation/Utilities.stories.tsx +65 -0
- package/src/styles/Global.ts +296 -0
- package/src/styles/grid.ts +70 -0
- package/src/styles/reset.ts +47 -0
- package/src/styles/utilities.ts +326 -0
- package/src/styles/variables.ts +168 -0
- package/tsconfig.json +29 -0
- package/tsconfig.node.json +11 -0
- package/vite.config.ts +87 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Column, Row } from './../../atoms/FlexGrid'
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
3
|
+
|
|
4
|
+
import { IProjectCard } from './ProjectCard.interface'
|
|
5
|
+
import ProjectCard from './ProjectCard.component'
|
|
6
|
+
import React from 'react'
|
|
7
|
+
|
|
8
|
+
// More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
9
|
+
export default {
|
|
10
|
+
title: 'Components/ProjectCard',
|
|
11
|
+
component: ProjectCard,
|
|
12
|
+
tags: ['autodocs']
|
|
13
|
+
} as Meta
|
|
14
|
+
|
|
15
|
+
const image = (
|
|
16
|
+
<img
|
|
17
|
+
width="100%"
|
|
18
|
+
height="100%"
|
|
19
|
+
sizes="100vw"
|
|
20
|
+
decoding="async"
|
|
21
|
+
src="/assets/placeholder.png"
|
|
22
|
+
alt="Empty state"
|
|
23
|
+
/>
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
export const Simple: StoryObj<IProjectCard> = {
|
|
27
|
+
render: args => (
|
|
28
|
+
<Row>
|
|
29
|
+
<Column md={4}>
|
|
30
|
+
<ProjectCard {...args}></ProjectCard>
|
|
31
|
+
</Column>
|
|
32
|
+
<Column md={4}>
|
|
33
|
+
<ProjectCard {...args}></ProjectCard>
|
|
34
|
+
</Column>
|
|
35
|
+
<Column md={4}>
|
|
36
|
+
<ProjectCard {...args}></ProjectCard>
|
|
37
|
+
</Column>
|
|
38
|
+
|
|
39
|
+
<Column md={6}>
|
|
40
|
+
<ProjectCard variant="featured" {...args}></ProjectCard>
|
|
41
|
+
</Column>
|
|
42
|
+
<Column md={6}>
|
|
43
|
+
<ProjectCard variant="featured" {...args}></ProjectCard>
|
|
44
|
+
</Column>
|
|
45
|
+
|
|
46
|
+
<Column md={4}>
|
|
47
|
+
<ProjectCard {...args}></ProjectCard>
|
|
48
|
+
</Column>
|
|
49
|
+
<Column md={4}>
|
|
50
|
+
<ProjectCard {...args}></ProjectCard>
|
|
51
|
+
</Column>
|
|
52
|
+
<Column md={4}>
|
|
53
|
+
<ProjectCard {...args}></ProjectCard>
|
|
54
|
+
</Column>
|
|
55
|
+
|
|
56
|
+
<Column md={8}>
|
|
57
|
+
<ProjectCard variant="featured" {...args}></ProjectCard>
|
|
58
|
+
</Column>
|
|
59
|
+
|
|
60
|
+
<Column md={4}>
|
|
61
|
+
<ProjectCard {...args}></ProjectCard>
|
|
62
|
+
</Column>
|
|
63
|
+
</Row>
|
|
64
|
+
),
|
|
65
|
+
args: {
|
|
66
|
+
category: 'Document type',
|
|
67
|
+
title: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
|
|
68
|
+
imageElement: image,
|
|
69
|
+
buttonLabel: 'Download',
|
|
70
|
+
linkElement: <a href="#" className="linker"></a>
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
|
|
3
|
+
import Card from '../Card/Card.component';
|
|
4
|
+
import { IProjectCard } from './ProjectCard.interface';
|
|
5
|
+
import { colors } from '@/styles/variables';
|
|
6
|
+
|
|
7
|
+
export const StyledProjectCard = styled(Card) <IProjectCard>`
|
|
8
|
+
& picture{
|
|
9
|
+
&:before{
|
|
10
|
+
content: '';
|
|
11
|
+
position: absolute;
|
|
12
|
+
top: 0;
|
|
13
|
+
left: 0;
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: 100%;
|
|
16
|
+
background: rgba(0,0,0,0.5);
|
|
17
|
+
z-index: 1;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
& figcaption{
|
|
22
|
+
position: absolute;
|
|
23
|
+
top: 0;
|
|
24
|
+
left: 0;
|
|
25
|
+
width: 100%;
|
|
26
|
+
height: 100%;
|
|
27
|
+
display: flex;
|
|
28
|
+
align-items: flex-end;
|
|
29
|
+
padding: 1rem;
|
|
30
|
+
color: ${colors.white};
|
|
31
|
+
z-index: 2;
|
|
32
|
+
|
|
33
|
+
& i{
|
|
34
|
+
min-width: 3rem;
|
|
35
|
+
height: 3rem;
|
|
36
|
+
line-height: 3rem;
|
|
37
|
+
font-size: 2.6rem;
|
|
38
|
+
|
|
39
|
+
border-radius: 50px;
|
|
40
|
+
color: ${colors.primary10};
|
|
41
|
+
background-color: ${colors.primary30};
|
|
42
|
+
|
|
43
|
+
transition: all 0.3s linear;
|
|
44
|
+
transform: rotateZ(-45deg);
|
|
45
|
+
transform-origin: center center;
|
|
46
|
+
text-align: center;
|
|
47
|
+
|
|
48
|
+
&::before{
|
|
49
|
+
line-height: inherit;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&:hover{
|
|
55
|
+
& figcaption{
|
|
56
|
+
& i{
|
|
57
|
+
transform: rotateZ(0);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./ProjectCard.component";
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react'
|
|
2
|
+
import { StyledInput, StyledMessage, StyledModal } from './ShareModal.theme'
|
|
3
|
+
|
|
4
|
+
import Flex from '../../atoms/Flex'
|
|
5
|
+
import Heading from '../../atoms/Heading'
|
|
6
|
+
import { IShareModal } from './ShareModal.interface'
|
|
7
|
+
import Icon from '../../atoms/Icon'
|
|
8
|
+
import Modal from '../Modal'
|
|
9
|
+
|
|
10
|
+
type mapTypes = {
|
|
11
|
+
[key: string]: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const ShareModal = ({
|
|
15
|
+
siteTitle,
|
|
16
|
+
title,
|
|
17
|
+
label,
|
|
18
|
+
url,
|
|
19
|
+
copyText,
|
|
20
|
+
open,
|
|
21
|
+
onClose,
|
|
22
|
+
...props
|
|
23
|
+
}: IShareModal) => {
|
|
24
|
+
const [copied, setCopied] = useState(false)
|
|
25
|
+
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
const timeOut = setTimeout(() => {
|
|
28
|
+
setCopied(false)
|
|
29
|
+
}, 1500)
|
|
30
|
+
|
|
31
|
+
return () => clearTimeout(timeOut)
|
|
32
|
+
}, [copied])
|
|
33
|
+
|
|
34
|
+
const escapeHtml = (text: string) => {
|
|
35
|
+
if (!text) return ''
|
|
36
|
+
|
|
37
|
+
const map: mapTypes = {
|
|
38
|
+
'&': '&',
|
|
39
|
+
'<': '<',
|
|
40
|
+
'>': '>',
|
|
41
|
+
'"': '"',
|
|
42
|
+
"'": '''
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return text?.replace(/[&<>"']/g, function (m: string) {
|
|
46
|
+
return map[m]
|
|
47
|
+
})
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const copyToClipboard = (text?: string) => {
|
|
51
|
+
text && navigator.clipboard.writeText(text)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (!url) return <></>
|
|
55
|
+
|
|
56
|
+
url = url.replace(/([^:]\/)\/+/g, '$1')
|
|
57
|
+
|
|
58
|
+
const shareTitle = title && encodeURIComponent(escapeHtml(title))
|
|
59
|
+
const shareUrl = url && encodeURIComponent(url)
|
|
60
|
+
|
|
61
|
+
const facebookURL = `https://www.facebook.com/sharer/sharer.php?u=${shareUrl}&t=${shareTitle}`
|
|
62
|
+
const twitterURL = `https://twitter.com/intent/tweet?text=${shareTitle}&url=${shareUrl}`
|
|
63
|
+
const linkedInURL = `https://www.linkedin.com/shareArticle?mini=true&url=${shareUrl}&title=${shareTitle}`
|
|
64
|
+
const whatsappURL = `https://api.whatsapp.com/send?text=${shareUrl}`
|
|
65
|
+
const emailURL = `mailto:?subject=${siteTitle} - ${shareTitle}&body=${shareUrl}`
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<Modal title={label} open={open} onClose={onClose}>
|
|
69
|
+
<StyledModal {...props}>
|
|
70
|
+
<Flex align={'center'} justify={'space-between'} wrap={'wrap'}>
|
|
71
|
+
<a
|
|
72
|
+
className="social-link"
|
|
73
|
+
aria-label="Facebook"
|
|
74
|
+
href={facebookURL}
|
|
75
|
+
target="_blank"
|
|
76
|
+
rel="noreferrer"
|
|
77
|
+
>
|
|
78
|
+
<div>
|
|
79
|
+
<Icon icon="icon-facebook" />
|
|
80
|
+
</div>
|
|
81
|
+
<Heading
|
|
82
|
+
size={'captions'}
|
|
83
|
+
tag={'span'}
|
|
84
|
+
style={{ marginTop: 'var(--space-3)' }}
|
|
85
|
+
>
|
|
86
|
+
Facebook
|
|
87
|
+
</Heading>
|
|
88
|
+
</a>
|
|
89
|
+
<a
|
|
90
|
+
className="social-link"
|
|
91
|
+
href={twitterURL}
|
|
92
|
+
target="_blank"
|
|
93
|
+
aria-label="Twitter"
|
|
94
|
+
rel="noreferrer"
|
|
95
|
+
>
|
|
96
|
+
<div>
|
|
97
|
+
<Icon icon="icon-twitter" />
|
|
98
|
+
</div>
|
|
99
|
+
<Heading
|
|
100
|
+
size={'captions'}
|
|
101
|
+
tag={'span'}
|
|
102
|
+
style={{ marginTop: 'var(--space-3)' }}
|
|
103
|
+
>
|
|
104
|
+
Twitter
|
|
105
|
+
</Heading>
|
|
106
|
+
</a>
|
|
107
|
+
<a
|
|
108
|
+
className="social-link"
|
|
109
|
+
href={linkedInURL}
|
|
110
|
+
target="_blank"
|
|
111
|
+
aria-label="Linked In"
|
|
112
|
+
rel="noreferrer"
|
|
113
|
+
>
|
|
114
|
+
<div>
|
|
115
|
+
<Icon icon="icon-linkedin" />
|
|
116
|
+
</div>
|
|
117
|
+
<Heading
|
|
118
|
+
size={'captions'}
|
|
119
|
+
tag={'span'}
|
|
120
|
+
style={{ marginTop: 'var(--space-3)' }}
|
|
121
|
+
>
|
|
122
|
+
LinkedIn
|
|
123
|
+
</Heading>
|
|
124
|
+
</a>
|
|
125
|
+
<a
|
|
126
|
+
className="social-link"
|
|
127
|
+
href={whatsappURL}
|
|
128
|
+
target="_blank"
|
|
129
|
+
aria-label="WhatsApp"
|
|
130
|
+
rel="noreferrer"
|
|
131
|
+
>
|
|
132
|
+
<div>
|
|
133
|
+
<Icon icon="icon-whatsapp" />
|
|
134
|
+
</div>
|
|
135
|
+
<Heading
|
|
136
|
+
size={'captions'}
|
|
137
|
+
tag={'span'}
|
|
138
|
+
style={{ marginTop: 'var(--space-3)' }}
|
|
139
|
+
>
|
|
140
|
+
WhatsApp
|
|
141
|
+
</Heading>
|
|
142
|
+
</a>
|
|
143
|
+
</Flex>
|
|
144
|
+
<div style={{ marginTop: 'var(--space-5)' }}>
|
|
145
|
+
<StyledInput
|
|
146
|
+
onClick={() => {
|
|
147
|
+
copyToClipboard(url)
|
|
148
|
+
setCopied(true)
|
|
149
|
+
}}
|
|
150
|
+
>
|
|
151
|
+
<span>{url}</span>
|
|
152
|
+
<Icon icon="icon-link" />
|
|
153
|
+
</StyledInput>
|
|
154
|
+
<StyledMessage
|
|
155
|
+
className={copied ? 'active' : ''}
|
|
156
|
+
style={{ textAlign: 'center' }}
|
|
157
|
+
>
|
|
158
|
+
{copyText}
|
|
159
|
+
</StyledMessage>
|
|
160
|
+
</div>
|
|
161
|
+
</StyledModal>
|
|
162
|
+
</Modal>
|
|
163
|
+
)
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export default ShareModal
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
import React, { useState } from 'react'
|
|
3
|
+
|
|
4
|
+
import Button from '../../atoms/Button/Button.component'
|
|
5
|
+
import { IShareModal } from './ShareModal.interface'
|
|
6
|
+
import ShareModal from './ShareModal.component'
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
title: 'Components/ShareModal',
|
|
10
|
+
component: ShareModal,
|
|
11
|
+
tags: ['autodocs']
|
|
12
|
+
} as Meta
|
|
13
|
+
|
|
14
|
+
export const Simple: StoryObj<IShareModal> = {
|
|
15
|
+
render: args => {
|
|
16
|
+
const [isOpen, setIsOpen] = useState(false)
|
|
17
|
+
return (
|
|
18
|
+
<>
|
|
19
|
+
<Button variant="primary" onClick={() => setIsOpen(true)}>
|
|
20
|
+
Open
|
|
21
|
+
</Button>
|
|
22
|
+
<ShareModal {...args} open={isOpen} onClose={() => setIsOpen(false)} />
|
|
23
|
+
</>
|
|
24
|
+
)
|
|
25
|
+
},
|
|
26
|
+
args: {
|
|
27
|
+
siteTitle: 'Miewtheme DS',
|
|
28
|
+
title: 'Design system',
|
|
29
|
+
url: 'https://miew.pt/',
|
|
30
|
+
label: 'Share',
|
|
31
|
+
copyText: 'Copied to clipboard!'
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { colors, radius, responsiveMedia, spaces, typography } from '@/styles/variables';
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import { IShareModal } from './ShareModal.interface';
|
|
5
|
+
import { fontSize } from '@/styles/utilities';
|
|
6
|
+
|
|
7
|
+
export const StyledModal = styled.div<IShareModal>`
|
|
8
|
+
& a {
|
|
9
|
+
display: inline-block;
|
|
10
|
+
width: 50%;
|
|
11
|
+
|
|
12
|
+
text-decoration: none;
|
|
13
|
+
text-align: center;
|
|
14
|
+
padding: ${spaces[3]};
|
|
15
|
+
|
|
16
|
+
& > div {
|
|
17
|
+
display: flex;
|
|
18
|
+
width: 3.2rem;
|
|
19
|
+
height: 3.2rem;
|
|
20
|
+
line-height: 3.2rem;
|
|
21
|
+
border-radius: 50%;
|
|
22
|
+
color: ${colors.white};
|
|
23
|
+
background: ${colors.primary70};
|
|
24
|
+
margin: auto;
|
|
25
|
+
transition: all 0.3s ease;
|
|
26
|
+
|
|
27
|
+
& i {
|
|
28
|
+
color: currentColor;
|
|
29
|
+
font-size: 1.6rem;
|
|
30
|
+
margin: auto;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
&:hover {
|
|
35
|
+
& > div {
|
|
36
|
+
background: ${colors.primary10}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
@media only screen and (min-width: ${responsiveMedia}) {
|
|
41
|
+
width: 25%;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
`;
|
|
45
|
+
|
|
46
|
+
export const StyledInput = styled.div<IShareModal>`
|
|
47
|
+
position: relative;
|
|
48
|
+
background: ${colors.white};
|
|
49
|
+
border: 1px solid ${colors.primary20};
|
|
50
|
+
border-radius: 6px;
|
|
51
|
+
padding: ${spaces[2]} ${spaces[3]};
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
|
|
54
|
+
& span {
|
|
55
|
+
color: ${colors.gray90};
|
|
56
|
+
display: block;
|
|
57
|
+
overflow: hidden;
|
|
58
|
+
text-overflow: ellipsis;
|
|
59
|
+
white-space: nowrap;
|
|
60
|
+
max-width: 90%;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
& i {
|
|
64
|
+
position: absolute;
|
|
65
|
+
top: 50%;
|
|
66
|
+
right: ${spaces[2]};
|
|
67
|
+
color: ${colors.black};
|
|
68
|
+
font-size: 18px;
|
|
69
|
+
transform: translateY(-50%)
|
|
70
|
+
}
|
|
71
|
+
`;
|
|
72
|
+
|
|
73
|
+
export const StyledMessage = styled.div<IShareModal>`
|
|
74
|
+
position: absolute;
|
|
75
|
+
bottom: 1.5rem;
|
|
76
|
+
left: 50%;
|
|
77
|
+
|
|
78
|
+
display: inline-block;
|
|
79
|
+
vertical-align: top;
|
|
80
|
+
|
|
81
|
+
color: ${colors.white};
|
|
82
|
+
background-color: ${colors.primary70};
|
|
83
|
+
|
|
84
|
+
cursor: pointer;
|
|
85
|
+
padding: ${spaces[2]} ${spaces[4]};
|
|
86
|
+
${fontSize('texts')};
|
|
87
|
+
|
|
88
|
+
border-radius: ${radius.lg};
|
|
89
|
+
|
|
90
|
+
opacity: 0;
|
|
91
|
+
visibility: hidden;
|
|
92
|
+
transform: translate(-50%, 3rem);
|
|
93
|
+
transition: all 0.3s ease;
|
|
94
|
+
|
|
95
|
+
&.active {
|
|
96
|
+
opacity: 1;
|
|
97
|
+
visibility: visible;
|
|
98
|
+
transform: translate(-50%, 0)
|
|
99
|
+
}
|
|
100
|
+
`;
|
|
101
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ShareModal.component'
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import Heading from '@/components/atoms/Heading'
|
|
2
|
+
import { ITeamCard } from './TeamCard.interface'
|
|
3
|
+
import ImageWrapper from '@/components/atoms/ImageWrapper'
|
|
4
|
+
import React from 'react'
|
|
5
|
+
import SocialLinks from '@/components/atoms/SocialLinks/SocialLinks.component'
|
|
6
|
+
import { StyledTeamCard } from './TeamCard.theme'
|
|
7
|
+
|
|
8
|
+
const TeamCard = ({
|
|
9
|
+
title,
|
|
10
|
+
imageElement,
|
|
11
|
+
role,
|
|
12
|
+
description,
|
|
13
|
+
...props
|
|
14
|
+
}: ITeamCard) => {
|
|
15
|
+
return (
|
|
16
|
+
<StyledTeamCard
|
|
17
|
+
imageElement={
|
|
18
|
+
<ImageWrapper aspectRatioHeight={78}>{imageElement}</ImageWrapper>
|
|
19
|
+
}
|
|
20
|
+
>
|
|
21
|
+
<Heading tag={'span'} size={'captions'} className={'text-uppercase mt-4'}>
|
|
22
|
+
{role}
|
|
23
|
+
</Heading>
|
|
24
|
+
<Heading tag={'span'} size={'h6'} className={'fw-light mt-2'}>
|
|
25
|
+
{title}
|
|
26
|
+
</Heading>
|
|
27
|
+
</StyledTeamCard>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export default TeamCard
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
|
|
3
|
+
import { ITeamCard } from './TeamCard.interface'
|
|
4
|
+
import React from 'react'
|
|
5
|
+
import TeamCard from './TeamCard.component'
|
|
6
|
+
|
|
7
|
+
// More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
8
|
+
export default {
|
|
9
|
+
title: 'Components/TeamCard',
|
|
10
|
+
component: TeamCard,
|
|
11
|
+
tags: ['autodocs']
|
|
12
|
+
} as Meta
|
|
13
|
+
|
|
14
|
+
const image = (
|
|
15
|
+
<img
|
|
16
|
+
width="100%"
|
|
17
|
+
height="100%"
|
|
18
|
+
sizes="100vw"
|
|
19
|
+
decoding="async"
|
|
20
|
+
src="/assets/placeholder.png"
|
|
21
|
+
alt="Empty state"
|
|
22
|
+
/>
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
export const Simple: StoryObj<ITeamCard> = {
|
|
26
|
+
render: args => <TeamCard {...args} style={{ maxWidth: '220px' }}></TeamCard>,
|
|
27
|
+
args: {
|
|
28
|
+
role: 'Lorem ipsum',
|
|
29
|
+
title: 'Lorem ipsum',
|
|
30
|
+
imageElement: image,
|
|
31
|
+
description: 'Cras vel facilisis tellus'
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
|
|
3
|
+
import Card from '../Card/Card.component';
|
|
4
|
+
import { ITeamCard } from './TeamCard.interface';
|
|
5
|
+
import { colors } from '@/styles/variables';
|
|
6
|
+
|
|
7
|
+
export const StyledTeamCard = styled(Card) <ITeamCard>`
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
margin-bottom: 24px;
|
|
10
|
+
pointer-events: none;
|
|
11
|
+
`;
|
|
12
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./TeamCard.component";
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {
|
|
2
|
+
StyledCover,
|
|
3
|
+
StyledCoverContent,
|
|
4
|
+
StyledCoverOverlay
|
|
5
|
+
} from './Cover.theme'
|
|
6
|
+
import { flexAlign, flexJustify } from '@/components/atoms/Flex/Flex.interface'
|
|
7
|
+
|
|
8
|
+
import { ICover } from './Cover.interface'
|
|
9
|
+
import React from 'react'
|
|
10
|
+
import cn from 'classnames'
|
|
11
|
+
|
|
12
|
+
const Cover = ({
|
|
13
|
+
minHeight,
|
|
14
|
+
contentPosition,
|
|
15
|
+
imageElement,
|
|
16
|
+
overlayOpacity,
|
|
17
|
+
overlayColor,
|
|
18
|
+
style,
|
|
19
|
+
className,
|
|
20
|
+
children
|
|
21
|
+
}: ICover) => {
|
|
22
|
+
let alignClass = contentPosition
|
|
23
|
+
? contentPosition.split(' ')
|
|
24
|
+
: ['center', 'center']
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<StyledCover
|
|
28
|
+
className={cn(
|
|
29
|
+
`align-items-${alignClass[0]}`,
|
|
30
|
+
`justify-content-${alignClass[0]}`,
|
|
31
|
+
className
|
|
32
|
+
)}
|
|
33
|
+
style={{ ...style, minHeight: minHeight || undefined }}
|
|
34
|
+
>
|
|
35
|
+
{imageElement}
|
|
36
|
+
{overlayColor && overlayOpacity && (
|
|
37
|
+
<StyledCoverOverlay
|
|
38
|
+
style={{ backgroundColor: overlayColor, opacity: overlayOpacity }}
|
|
39
|
+
></StyledCoverOverlay>
|
|
40
|
+
)}
|
|
41
|
+
<StyledCoverContent>{children}</StyledCoverContent>
|
|
42
|
+
</StyledCover>
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export default Cover
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
|
|
3
|
+
export type ICover = {
|
|
4
|
+
id?: string;
|
|
5
|
+
anchor?: string;
|
|
6
|
+
minHeight?: string;
|
|
7
|
+
contentPosition?: string;
|
|
8
|
+
imageElement?: React.ReactElement
|
|
9
|
+
overlayOpacity?: number;
|
|
10
|
+
overlayColor?: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
style?: CSSProperties;
|
|
13
|
+
children?: React.ReactNode
|
|
14
|
+
}
|