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,47 @@
|
|
|
1
|
+
const resetStyles = `
|
|
2
|
+
html, body, div, span, applet, object, iframe,
|
|
3
|
+
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
|
4
|
+
a, abbr, acronym, address, big, cite, code,
|
|
5
|
+
del, dfn, em, img, ins, kbd, q, s, samp,
|
|
6
|
+
small, strike, strong, sub, sup, tt, var,
|
|
7
|
+
b, u, i, center,
|
|
8
|
+
dl, dt, dd, ol, ul, li,
|
|
9
|
+
fieldset, form, label, legend,
|
|
10
|
+
table, caption, tbody, tfoot, thead, tr, th, td,
|
|
11
|
+
article, aside, canvas, details, embed,
|
|
12
|
+
figure, figcaption, footer, header, hgroup,
|
|
13
|
+
menu, nav, output, ruby, section, summary,
|
|
14
|
+
time, mark, audio, video {
|
|
15
|
+
margin: 0;
|
|
16
|
+
padding: 0;
|
|
17
|
+
border: 0;
|
|
18
|
+
font-size: 100%;
|
|
19
|
+
font: inherit;
|
|
20
|
+
vertical-align: baseline;
|
|
21
|
+
}
|
|
22
|
+
article, aside, details, figcaption, figure,
|
|
23
|
+
footer, header, hgroup, menu, nav, section {
|
|
24
|
+
display: block;
|
|
25
|
+
}
|
|
26
|
+
body {
|
|
27
|
+
line-height: 1;
|
|
28
|
+
}
|
|
29
|
+
ol, ul {
|
|
30
|
+
list-style: none;
|
|
31
|
+
}
|
|
32
|
+
blockquote, q {
|
|
33
|
+
quotes: none;
|
|
34
|
+
}
|
|
35
|
+
blockquote:before, blockquote:after,
|
|
36
|
+
q:before, q:after {
|
|
37
|
+
content: '';
|
|
38
|
+
content: none;
|
|
39
|
+
}
|
|
40
|
+
table {
|
|
41
|
+
border-collapse: collapse;
|
|
42
|
+
border-spacing: 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
`;
|
|
46
|
+
|
|
47
|
+
export default resetStyles;
|
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
import {
|
|
2
|
+
colors,
|
|
3
|
+
grid_conf,
|
|
4
|
+
radius,
|
|
5
|
+
responsiveMedia,
|
|
6
|
+
shadows,
|
|
7
|
+
spaces,
|
|
8
|
+
spacesNegative,
|
|
9
|
+
typography
|
|
10
|
+
} from './variables';
|
|
11
|
+
|
|
12
|
+
export const fontSize = (typo: string) => {
|
|
13
|
+
return `
|
|
14
|
+
${typography[typo]?.sizeMob ? `
|
|
15
|
+
font-size: ${typography[typo].sizeMob};
|
|
16
|
+
|
|
17
|
+
@media only screen and (min-width: ${responsiveMedia}) {
|
|
18
|
+
font-size: ${typography[typo].size};
|
|
19
|
+
}
|
|
20
|
+
` : `
|
|
21
|
+
font-size: ${typography[typo].size};
|
|
22
|
+
`}
|
|
23
|
+
|
|
24
|
+
line-height: ${typography[typo].height};
|
|
25
|
+
`
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const spacers = {
|
|
29
|
+
"auto": "auto",
|
|
30
|
+
...spaces
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
export const utilities: {
|
|
35
|
+
[key: string]: {
|
|
36
|
+
responsive?: boolean;
|
|
37
|
+
property?: string;
|
|
38
|
+
class?: string;
|
|
39
|
+
values?: {
|
|
40
|
+
[key: string]: string | number;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
} = {
|
|
44
|
+
"align": {
|
|
45
|
+
property: "vertical-align",
|
|
46
|
+
class: "align",
|
|
47
|
+
values: {
|
|
48
|
+
top: "top",
|
|
49
|
+
middle: "middle",
|
|
50
|
+
bottom: "bottom"
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
"display": {
|
|
54
|
+
responsive: true,
|
|
55
|
+
property: "display",
|
|
56
|
+
class: "d",
|
|
57
|
+
values: {
|
|
58
|
+
"inline-block": "inline-block",
|
|
59
|
+
"inline-flex": "inline-flex",
|
|
60
|
+
block: "block",
|
|
61
|
+
table: "table",
|
|
62
|
+
flex: "flex",
|
|
63
|
+
none: "none"
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
"position": {
|
|
67
|
+
property: "position",
|
|
68
|
+
values: {
|
|
69
|
+
relative: "relative",
|
|
70
|
+
absolute: "absolute",
|
|
71
|
+
fixed: "fixed"
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
"width": {
|
|
75
|
+
responsive: true,
|
|
76
|
+
property: "width",
|
|
77
|
+
class: "w",
|
|
78
|
+
values: {
|
|
79
|
+
100: "100%",
|
|
80
|
+
auto: "auto"
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"height": {
|
|
84
|
+
property: "height",
|
|
85
|
+
class: "h",
|
|
86
|
+
values: {
|
|
87
|
+
100: "100%",
|
|
88
|
+
auto: "auto"
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"flex-grow": {
|
|
92
|
+
responsive: true,
|
|
93
|
+
property: "flex-grow",
|
|
94
|
+
values: {
|
|
95
|
+
0: "0",
|
|
96
|
+
1: "1",
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"flex-shrink": {
|
|
100
|
+
responsive: true,
|
|
101
|
+
property: "flex-shrink",
|
|
102
|
+
values: {
|
|
103
|
+
0: "0",
|
|
104
|
+
1: "1",
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
"flex-wrap": {
|
|
108
|
+
responsive: true,
|
|
109
|
+
property: "flex-wrap",
|
|
110
|
+
class: 'flex',
|
|
111
|
+
values: {
|
|
112
|
+
wrap: "wrap",
|
|
113
|
+
nowrap: "nowrap"
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
"justify-content": {
|
|
117
|
+
responsive: true,
|
|
118
|
+
property: "justify-content",
|
|
119
|
+
values: {
|
|
120
|
+
start: "flex-start",
|
|
121
|
+
end: "flex-end",
|
|
122
|
+
center: "center",
|
|
123
|
+
between: "space-between",
|
|
124
|
+
around: "space-around",
|
|
125
|
+
evenly: "space-evenly",
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
"align-items": {
|
|
129
|
+
responsive: true,
|
|
130
|
+
property: "align-items",
|
|
131
|
+
values: {
|
|
132
|
+
start: "flex-start",
|
|
133
|
+
end: "flex-end",
|
|
134
|
+
center: "center",
|
|
135
|
+
baseline: "baseline",
|
|
136
|
+
stretch: "stretch",
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
"align-content": {
|
|
140
|
+
responsive: true,
|
|
141
|
+
property: "align-content",
|
|
142
|
+
values: {
|
|
143
|
+
start: "flex-start",
|
|
144
|
+
end: "flex-end",
|
|
145
|
+
center: "center",
|
|
146
|
+
between: "space-between",
|
|
147
|
+
around: "space-around",
|
|
148
|
+
stretch: "stretch",
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
"align-self": {
|
|
152
|
+
responsive: true,
|
|
153
|
+
property: "align-self",
|
|
154
|
+
values: {
|
|
155
|
+
auto: "auto",
|
|
156
|
+
start: "flex-start",
|
|
157
|
+
end: "flex-end",
|
|
158
|
+
center: "center",
|
|
159
|
+
baseline: "baseline",
|
|
160
|
+
stretch: "stretch",
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
"order": {
|
|
164
|
+
responsive: true,
|
|
165
|
+
property: "order",
|
|
166
|
+
values: {
|
|
167
|
+
first: -1,
|
|
168
|
+
0: 0,
|
|
169
|
+
1: 1,
|
|
170
|
+
2: 2,
|
|
171
|
+
3: 3,
|
|
172
|
+
4: 4,
|
|
173
|
+
5: 5,
|
|
174
|
+
last: 6,
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
"margin": {
|
|
178
|
+
responsive: true,
|
|
179
|
+
property: "margin",
|
|
180
|
+
class: "m",
|
|
181
|
+
values: spacers
|
|
182
|
+
},
|
|
183
|
+
"margin-top": {
|
|
184
|
+
responsive: true,
|
|
185
|
+
property: "margin-top",
|
|
186
|
+
class: "mt",
|
|
187
|
+
values: spacers
|
|
188
|
+
},
|
|
189
|
+
"negative-margin-top": {
|
|
190
|
+
responsive: true,
|
|
191
|
+
property: "margin-top",
|
|
192
|
+
class: "mt-neg",
|
|
193
|
+
values: spacesNegative
|
|
194
|
+
},
|
|
195
|
+
"margin-end": {
|
|
196
|
+
responsive: true,
|
|
197
|
+
property: "margin-right",
|
|
198
|
+
class: "me",
|
|
199
|
+
values: spacers
|
|
200
|
+
},
|
|
201
|
+
"margin-bottom": {
|
|
202
|
+
responsive: true,
|
|
203
|
+
property: "margin-bottom",
|
|
204
|
+
class: "mb",
|
|
205
|
+
values: spacers
|
|
206
|
+
},
|
|
207
|
+
"margin-start": {
|
|
208
|
+
responsive: true,
|
|
209
|
+
property: "margin-left",
|
|
210
|
+
class: "ms",
|
|
211
|
+
values: spacers
|
|
212
|
+
},
|
|
213
|
+
"padding": {
|
|
214
|
+
responsive: true,
|
|
215
|
+
property: "padding",
|
|
216
|
+
class: "p",
|
|
217
|
+
values: spaces
|
|
218
|
+
},
|
|
219
|
+
"padding-top": {
|
|
220
|
+
responsive: true,
|
|
221
|
+
property: "padding-top",
|
|
222
|
+
class: "pt",
|
|
223
|
+
values: spaces
|
|
224
|
+
},
|
|
225
|
+
"padding-end": {
|
|
226
|
+
responsive: true,
|
|
227
|
+
property: "padding-right",
|
|
228
|
+
class: "pe",
|
|
229
|
+
values: spaces
|
|
230
|
+
},
|
|
231
|
+
"padding-bottom": {
|
|
232
|
+
responsive: true,
|
|
233
|
+
property: "padding-bottom",
|
|
234
|
+
class: "pb",
|
|
235
|
+
values: spaces
|
|
236
|
+
},
|
|
237
|
+
"padding-start": {
|
|
238
|
+
responsive: true,
|
|
239
|
+
property: "padding-left",
|
|
240
|
+
class: "ps",
|
|
241
|
+
values: spaces
|
|
242
|
+
},
|
|
243
|
+
"font-weight": {
|
|
244
|
+
property: "font-weight",
|
|
245
|
+
class: "fw",
|
|
246
|
+
values: {
|
|
247
|
+
light: 300,
|
|
248
|
+
regular: 400,
|
|
249
|
+
semibold: 600,
|
|
250
|
+
bold: 700,
|
|
251
|
+
black: 800
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
"text-align": {
|
|
255
|
+
responsive: true,
|
|
256
|
+
property: "text-align",
|
|
257
|
+
class: "text",
|
|
258
|
+
values: {
|
|
259
|
+
start: "left",
|
|
260
|
+
end: "right",
|
|
261
|
+
center: "center",
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
"text-transform": {
|
|
265
|
+
property: "text-transform",
|
|
266
|
+
class: "text",
|
|
267
|
+
values: {
|
|
268
|
+
lowercase: "lowercase",
|
|
269
|
+
uppercase: "uppercase",
|
|
270
|
+
capitalize: "capitalize"
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
"color": {
|
|
274
|
+
property: "color",
|
|
275
|
+
class: "color",
|
|
276
|
+
values: colors
|
|
277
|
+
},
|
|
278
|
+
"bg": {
|
|
279
|
+
property: "background-color",
|
|
280
|
+
class: "bg",
|
|
281
|
+
values: colors
|
|
282
|
+
},
|
|
283
|
+
"shadow": {
|
|
284
|
+
property: "box-shadow",
|
|
285
|
+
class: "shadow",
|
|
286
|
+
values: shadows
|
|
287
|
+
},
|
|
288
|
+
"radius": {
|
|
289
|
+
property: "border-radius",
|
|
290
|
+
class: "radius",
|
|
291
|
+
values: radius
|
|
292
|
+
},
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
export function generateUtilities(utility: string, breakpoint: string): string {
|
|
296
|
+
const property: string | undefined = utilities[utility]?.property;
|
|
297
|
+
const className: string | undefined = utilities[utility]?.class || property;
|
|
298
|
+
const values: { [key: string]: string | number } | undefined = utilities[utility]?.values;
|
|
299
|
+
const responsive: boolean | undefined = utilities[utility]?.responsive;
|
|
300
|
+
let cssSelector: string = "";
|
|
301
|
+
|
|
302
|
+
Object.keys(values || {}).map((key: string, i: number) => {
|
|
303
|
+
cssSelector += `.${`${className}-${key}`}{
|
|
304
|
+
${property}: ${values?.[key]};
|
|
305
|
+
}`;
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
Object.keys(values || {}).map((key: string, i: number) => {
|
|
309
|
+
if (responsive) {
|
|
310
|
+
cssSelector += `
|
|
311
|
+
${`.${className}-md-${key}`}{
|
|
312
|
+
@media (min-width: ${grid_conf.breakpoints.$md as string}){
|
|
313
|
+
${property}: ${values?.[key]};
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
${`.${className}-lg-${key}`}{
|
|
317
|
+
@media (min-width: ${grid_conf.breakpoints.$lg}){
|
|
318
|
+
${property}: ${values?.[key]};
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
`;
|
|
322
|
+
}
|
|
323
|
+
});
|
|
324
|
+
|
|
325
|
+
return cssSelector;
|
|
326
|
+
}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
export const pxToRem = (size: number) => {
|
|
2
|
+
return (size / 16) * 1 + 'rem'
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export const fontName = "Noto Sans"
|
|
6
|
+
export const alternativeFont = "";
|
|
7
|
+
|
|
8
|
+
export const gutter = pxToRem(8); //needs to be in this file
|
|
9
|
+
|
|
10
|
+
export const desktop_width = "1360"; //container size of design on desktop
|
|
11
|
+
export const tablet_width = "768"; //container size of design on tablet
|
|
12
|
+
export const mobile_width = "375"; //container size of design on mobile
|
|
13
|
+
export const responsiveMedia = "980px"; //mobile media value for bootstrap
|
|
14
|
+
export const mobileMedia = "360px"; //mobile media value
|
|
15
|
+
|
|
16
|
+
export const easeOutExpo = "cubic-bezier(.32,.94,.6,1);";
|
|
17
|
+
|
|
18
|
+
export type IBreakpoints = {
|
|
19
|
+
$xs?: string,
|
|
20
|
+
$sm?: string,
|
|
21
|
+
$md?: string,
|
|
22
|
+
$lg?: string,
|
|
23
|
+
$xl?: string,
|
|
24
|
+
$xxl?: string,
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const colors = <Record<string, string>>{
|
|
28
|
+
// Defaults
|
|
29
|
+
white: '#fff',
|
|
30
|
+
black: '#000',
|
|
31
|
+
transparent: "transparent",
|
|
32
|
+
|
|
33
|
+
// Gray
|
|
34
|
+
gray10: '#F5F3F1',
|
|
35
|
+
gray20: '#C0BFBE',
|
|
36
|
+
gray50: '#A0A0A0',
|
|
37
|
+
gray70: '#6E6D6C',
|
|
38
|
+
gray90: '#3C3B39',
|
|
39
|
+
|
|
40
|
+
primary10: '#FC3151',
|
|
41
|
+
primary70: '#FF455',
|
|
42
|
+
|
|
43
|
+
// Feedback
|
|
44
|
+
warning: '#ea9a1a',
|
|
45
|
+
success: '#00FFD2',
|
|
46
|
+
error: '#E91101',
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const spaces = <Record<string, string>>{
|
|
50
|
+
0: '0',
|
|
51
|
+
1: pxToRem(4),
|
|
52
|
+
2: pxToRem(8),
|
|
53
|
+
3: pxToRem(12),
|
|
54
|
+
4: pxToRem(16),
|
|
55
|
+
5: pxToRem(20),
|
|
56
|
+
6: pxToRem(28),
|
|
57
|
+
7: pxToRem(36),
|
|
58
|
+
8: pxToRem(48),
|
|
59
|
+
9: pxToRem(64),
|
|
60
|
+
10: pxToRem(88),
|
|
61
|
+
11: pxToRem(120),
|
|
62
|
+
}
|
|
63
|
+
export const spacesNegative = <Record<string, string>>{
|
|
64
|
+
0: '0',
|
|
65
|
+
1: pxToRem(-4),
|
|
66
|
+
2: pxToRem(-8),
|
|
67
|
+
3: pxToRem(-12),
|
|
68
|
+
4: pxToRem(-20),
|
|
69
|
+
5: pxToRem(-28),
|
|
70
|
+
6: pxToRem(-36),
|
|
71
|
+
7: pxToRem(-48),
|
|
72
|
+
8: pxToRem(-64),
|
|
73
|
+
9: pxToRem(-88),
|
|
74
|
+
10: pxToRem(-120),
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
//if responsive is not needed for a size just set the size as px instead of rem
|
|
78
|
+
export const typography = <Record<string, Record<string, unknown>>>{
|
|
79
|
+
display: {
|
|
80
|
+
size: pxToRem(104),
|
|
81
|
+
sizeMob: pxToRem(56),
|
|
82
|
+
height: 1.4,
|
|
83
|
+
},
|
|
84
|
+
h1: {
|
|
85
|
+
size: pxToRem(48),
|
|
86
|
+
sizeMob: pxToRem(40),
|
|
87
|
+
height: 1.4,
|
|
88
|
+
},
|
|
89
|
+
h2: {
|
|
90
|
+
size: pxToRem(40),
|
|
91
|
+
sizeMob: pxToRem(32),
|
|
92
|
+
height: 1.4,
|
|
93
|
+
},
|
|
94
|
+
h3: {
|
|
95
|
+
size: pxToRem(32),
|
|
96
|
+
sizeMob: pxToRem(28),
|
|
97
|
+
height: 1.2,
|
|
98
|
+
},
|
|
99
|
+
h4: {
|
|
100
|
+
size: pxToRem(28),
|
|
101
|
+
sizeMob: pxToRem(24),
|
|
102
|
+
height: 1.4,
|
|
103
|
+
},
|
|
104
|
+
h5: {
|
|
105
|
+
size: pxToRem(24),
|
|
106
|
+
sizeMob: pxToRem(20),
|
|
107
|
+
height: 1.4,
|
|
108
|
+
},
|
|
109
|
+
h6: {
|
|
110
|
+
size: pxToRem(20),
|
|
111
|
+
sizeMob: pxToRem(18),
|
|
112
|
+
height: 1.4,
|
|
113
|
+
},
|
|
114
|
+
texts: {
|
|
115
|
+
size: "16px",
|
|
116
|
+
sizeMob: "14px",
|
|
117
|
+
height: 1.6,
|
|
118
|
+
},
|
|
119
|
+
captions: {
|
|
120
|
+
size: "12px",
|
|
121
|
+
sizeMob: "10px",
|
|
122
|
+
height: 1.2,
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
export const radius = <Record<string, string>>{
|
|
127
|
+
sm: '6px',
|
|
128
|
+
md: '10px',
|
|
129
|
+
lg: '50px',
|
|
130
|
+
rounded: '100px',
|
|
131
|
+
}
|
|
132
|
+
export const shadows = <Record<string, string>>{
|
|
133
|
+
sm: '10px 20px 20px rgba(0, 78, 210, 0.03)',
|
|
134
|
+
md: '10px 30px 30px rgba(0, 78, 210, 0.05)',
|
|
135
|
+
lg: '10px 40px 40px rgba(0, 78, 210, 0.07)',
|
|
136
|
+
}
|
|
137
|
+
export const zIndexes = <Record<string, string>>{
|
|
138
|
+
progress: '200',
|
|
139
|
+
modal: '100',
|
|
140
|
+
content: '99',
|
|
141
|
+
preloader: '96',
|
|
142
|
+
linker: '95'
|
|
143
|
+
}
|
|
144
|
+
export const grid_conf: {
|
|
145
|
+
gridSize: number,
|
|
146
|
+
gutter: number,
|
|
147
|
+
mediaQuery: string,
|
|
148
|
+
container: IBreakpoints,
|
|
149
|
+
breakpoints: IBreakpoints
|
|
150
|
+
} = {
|
|
151
|
+
gridSize: 12,
|
|
152
|
+
gutter: 16,
|
|
153
|
+
mediaQuery: 'only screen',
|
|
154
|
+
container: {
|
|
155
|
+
$sm: "960px",
|
|
156
|
+
$md: "1140px",
|
|
157
|
+
$lg: "1320px",
|
|
158
|
+
$xl: "1560px",
|
|
159
|
+
$xxl: "1720px"
|
|
160
|
+
},
|
|
161
|
+
breakpoints: {
|
|
162
|
+
$xs: "",
|
|
163
|
+
$sm: "576px",
|
|
164
|
+
$md: "768px",
|
|
165
|
+
$lg: "980px",
|
|
166
|
+
$xl: "1280px"
|
|
167
|
+
}
|
|
168
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"useDefineForClassFields": true,
|
|
5
|
+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
|
|
9
|
+
/* Bundler mode */
|
|
10
|
+
"moduleResolution": "bundler",
|
|
11
|
+
"allowImportingTsExtensions": true,
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"isolatedModules": true,
|
|
14
|
+
"noEmit": true,
|
|
15
|
+
"jsx": "react-jsx",
|
|
16
|
+
|
|
17
|
+
/* Linting */
|
|
18
|
+
"strict": true,
|
|
19
|
+
"noUnusedLocals": false,
|
|
20
|
+
"noUnusedParameters": false,
|
|
21
|
+
"noFallthroughCasesInSwitch": true,
|
|
22
|
+
|
|
23
|
+
"paths": {
|
|
24
|
+
"@/*": ["./src/*"]
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"include": ["src"],
|
|
28
|
+
"references": [{ "path": "./tsconfig.node.json" }]
|
|
29
|
+
}
|
package/vite.config.ts
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { Plugin } from 'vite';
|
|
2
|
+
import { defineConfig } from 'vite'
|
|
3
|
+
import {exec} from 'node:child_process';
|
|
4
|
+
import hypothetical from 'rollup-plugin-hypothetical';
|
|
5
|
+
import path from 'path';
|
|
6
|
+
import { peerDependencies } from './package.json';
|
|
7
|
+
import react from '@vitejs/plugin-react'
|
|
8
|
+
import { transform } from 'esbuild';
|
|
9
|
+
import tsConfigPaths from 'vite-tsconfig-paths';
|
|
10
|
+
|
|
11
|
+
const locales: [] = [
|
|
12
|
+
// path to locale files
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
//Custom plugins
|
|
17
|
+
const dts = (): Plugin => ({
|
|
18
|
+
name: 'dts',
|
|
19
|
+
buildEnd: (error) => {
|
|
20
|
+
if (error) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
exec('tsup src/index.ts --format esm --dts-only', (err) => {
|
|
25
|
+
if (err) {
|
|
26
|
+
throw new Error('Failed to generate declaration files');
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
const minify = (): Plugin => ({
|
|
33
|
+
name: 'minify',
|
|
34
|
+
renderChunk: {
|
|
35
|
+
order: 'post',
|
|
36
|
+
async handler(code, _, outputOptions) {
|
|
37
|
+
if (outputOptions.format === 'es') {
|
|
38
|
+
return await transform(code, {
|
|
39
|
+
minify: true,
|
|
40
|
+
sourcemap: true,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return null;
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
// https://vitejs.dev/config/
|
|
51
|
+
export default defineConfig({
|
|
52
|
+
resolve: {
|
|
53
|
+
alias: {
|
|
54
|
+
'@': path.resolve(__dirname, './src'),
|
|
55
|
+
'<package>': 'node_modules/<package>/dist/esm/index.js',
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
build: {
|
|
59
|
+
emptyOutDir: true,
|
|
60
|
+
lib: {
|
|
61
|
+
entry: 'src/index.ts',
|
|
62
|
+
formats: ['cjs', 'es'],
|
|
63
|
+
fileName: (format) => (format === 'cjs' ? 'cjs/index.js' : 'esm/index.js'),
|
|
64
|
+
},
|
|
65
|
+
sourcemap: true,
|
|
66
|
+
rollupOptions: {
|
|
67
|
+
output: {
|
|
68
|
+
inlineDynamicImports: true,
|
|
69
|
+
},
|
|
70
|
+
external: [
|
|
71
|
+
...Object.keys(peerDependencies),
|
|
72
|
+
],
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
plugins: [
|
|
76
|
+
tsConfigPaths(),
|
|
77
|
+
hypothetical({
|
|
78
|
+
allowFallthrough: true,
|
|
79
|
+
files: {
|
|
80
|
+
...locales.reduce((acc, file) => ({ ...acc, [file]: 'export default {}' }), {}),
|
|
81
|
+
},
|
|
82
|
+
}),
|
|
83
|
+
minify(),
|
|
84
|
+
dts(),
|
|
85
|
+
react(),
|
|
86
|
+
],
|
|
87
|
+
})
|