@veeqo/ui 0.0.1
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/.nvmrc +1 -0
- package/.prettierrc +6 -0
- package/.storybook/main.ts +21 -0
- package/.storybook/preview.ts +9 -0
- package/.vscode/settings.json +11 -0
- package/lib/components/Loader/Grid.d.ts +10 -0
- package/lib/components/Loader/Loader.d.ts +3 -0
- package/lib/components/Loader/TailSpin.d.ts +10 -0
- package/lib/components/Loader/ThreeDots.d.ts +10 -0
- package/lib/components/Loader/index.d.ts +1 -0
- package/lib/components/Loader/loaderTypes.d.ts +8 -0
- package/lib/components/Stack/Alignments.d.ts +9 -0
- package/lib/components/Stack/Stack.d.ts +6 -0
- package/lib/components/Stack/index.d.ts +1 -0
- package/lib/components/Stack/types.d.ts +38 -0
- package/lib/components/index.d.ts +2 -0
- package/lib/index.d.ts +520 -0
- package/lib/index.esm.js +2 -0
- package/lib/index.esm.js.map +1 -0
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -0
- package/lib/theme/index.d.ts +454 -0
- package/lib/theme/modules/breakpoints.d.ts +7 -0
- package/lib/theme/modules/colors.d.ts +116 -0
- package/lib/theme/modules/layers.d.ts +6 -0
- package/lib/theme/modules/radius.d.ts +7 -0
- package/lib/theme/modules/shadows.d.ts +6 -0
- package/lib/theme/modules/sizes.d.ts +20 -0
- package/lib/theme/modules/text.d.ts +315 -0
- package/lib/theme/storybook/components.d.ts +2 -0
- package/package.json +52 -0
- package/rollup.config.mjs +49 -0
- package/src/components/Loader/Docs.mdx +26 -0
- package/src/components/Loader/Grid.tsx +113 -0
- package/src/components/Loader/Loader.stories.tsx +62 -0
- package/src/components/Loader/Loader.tsx +28 -0
- package/src/components/Loader/TailSpin.tsx +54 -0
- package/src/components/Loader/ThreeDots.tsx +90 -0
- package/src/components/Loader/__snapshots__/Loader.test.tsx.snap +73 -0
- package/src/components/Loader/index.ts +1 -0
- package/src/components/Loader/loaderTypes.ts +9 -0
- package/src/components/Stack/Alignments.ts +10 -0
- package/src/components/Stack/Docs.mdx +28 -0
- package/src/components/Stack/Stack.stories.tsx +112 -0
- package/src/components/Stack/Stack.tsx +61 -0
- package/src/components/Stack/__snapshots__/Stack.test.tsx.snap +45 -0
- package/src/components/Stack/index.ts +1 -0
- package/src/components/Stack/types.ts +73 -0
- package/src/components/index.ts +2 -0
- package/src/index.ts +2 -0
- package/src/theme/index.ts +18 -0
- package/src/theme/modules/breakpoints.ts +7 -0
- package/src/theme/modules/colors.ts +116 -0
- package/src/theme/modules/layers.ts +6 -0
- package/src/theme/modules/radius.ts +7 -0
- package/src/theme/modules/shadows.ts +6 -0
- package/src/theme/modules/sizes.ts +52 -0
- package/src/theme/modules/text.ts +319 -0
- package/src/theme/storybook/ColorDocs.mdx +130 -0
- package/src/theme/storybook/RadiusDocs.mdx +39 -0
- package/src/theme/storybook/ShadowDocs.mdx +37 -0
- package/src/theme/storybook/SizesDocs.mdx +104 -0
- package/src/theme/storybook/components.tsx +19 -0
- package/tsconfig.json +23 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
export interface ThreeDotsProps {
|
|
4
|
+
width?: number;
|
|
5
|
+
height?: number;
|
|
6
|
+
className?: string;
|
|
7
|
+
color?: string;
|
|
8
|
+
label?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const ThreeDots = ({ width, height, className, color, label }: ThreeDotsProps) => (
|
|
12
|
+
<svg
|
|
13
|
+
width={width}
|
|
14
|
+
height={height}
|
|
15
|
+
className={className}
|
|
16
|
+
viewBox="0 0 120 30"
|
|
17
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
18
|
+
fill={color}
|
|
19
|
+
aria-label={label}
|
|
20
|
+
>
|
|
21
|
+
<circle cx="15" cy="15" r="15">
|
|
22
|
+
<animate
|
|
23
|
+
attributeName="r"
|
|
24
|
+
from="15"
|
|
25
|
+
to="15"
|
|
26
|
+
begin="0s"
|
|
27
|
+
dur="0.8s"
|
|
28
|
+
values="15;9;15"
|
|
29
|
+
calcMode="linear"
|
|
30
|
+
repeatCount="indefinite"
|
|
31
|
+
/>
|
|
32
|
+
<animate
|
|
33
|
+
attributeName="fillOpacity"
|
|
34
|
+
from="1"
|
|
35
|
+
to="1"
|
|
36
|
+
begin="0s"
|
|
37
|
+
dur="0.8s"
|
|
38
|
+
values="1;.5;1"
|
|
39
|
+
calcMode="linear"
|
|
40
|
+
repeatCount="indefinite"
|
|
41
|
+
/>
|
|
42
|
+
</circle>
|
|
43
|
+
<circle cx="60" cy="15" r="9" attributeName="fillOpacity" from="1" to="0.3">
|
|
44
|
+
<animate
|
|
45
|
+
attributeName="r"
|
|
46
|
+
from="9"
|
|
47
|
+
to="9"
|
|
48
|
+
begin="0s"
|
|
49
|
+
dur="0.8s"
|
|
50
|
+
values="9;15;9"
|
|
51
|
+
calcMode="linear"
|
|
52
|
+
repeatCount="indefinite"
|
|
53
|
+
/>
|
|
54
|
+
<animate
|
|
55
|
+
attributeName="fillOpacity"
|
|
56
|
+
from="0.5"
|
|
57
|
+
to="0.5"
|
|
58
|
+
begin="0s"
|
|
59
|
+
dur="0.8s"
|
|
60
|
+
values=".5;1;.5"
|
|
61
|
+
calcMode="linear"
|
|
62
|
+
repeatCount="indefinite"
|
|
63
|
+
/>
|
|
64
|
+
</circle>
|
|
65
|
+
<circle cx="105" cy="15" r="15">
|
|
66
|
+
<animate
|
|
67
|
+
attributeName="r"
|
|
68
|
+
from="15"
|
|
69
|
+
to="15"
|
|
70
|
+
begin="0s"
|
|
71
|
+
dur="0.8s"
|
|
72
|
+
values="15;9;15"
|
|
73
|
+
calcMode="linear"
|
|
74
|
+
repeatCount="indefinite"
|
|
75
|
+
/>
|
|
76
|
+
<animate
|
|
77
|
+
attributeName="fillOpacity"
|
|
78
|
+
from="1"
|
|
79
|
+
to="1"
|
|
80
|
+
begin="0s"
|
|
81
|
+
dur="0.8s"
|
|
82
|
+
values="1;.5;1"
|
|
83
|
+
calcMode="linear"
|
|
84
|
+
repeatCount="indefinite"
|
|
85
|
+
/>
|
|
86
|
+
</circle>
|
|
87
|
+
</svg>
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
export default ThreeDots;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`Loader it renders correctly 1`] = `
|
|
4
|
+
<svg
|
|
5
|
+
height={24}
|
|
6
|
+
viewBox="0 0 38 38"
|
|
7
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
8
|
+
>
|
|
9
|
+
<defs>
|
|
10
|
+
<linearGradient
|
|
11
|
+
id="a"
|
|
12
|
+
x1="8.042%"
|
|
13
|
+
x2="65.682%"
|
|
14
|
+
y1="0%"
|
|
15
|
+
y2="23.865%"
|
|
16
|
+
>
|
|
17
|
+
<stop
|
|
18
|
+
offset="0%"
|
|
19
|
+
stopColor="#588CB0"
|
|
20
|
+
stopOpacity="0"
|
|
21
|
+
/>
|
|
22
|
+
<stop
|
|
23
|
+
offset="63.146%"
|
|
24
|
+
stopColor="#588CB0"
|
|
25
|
+
stopOpacity=".631"
|
|
26
|
+
/>
|
|
27
|
+
<stop
|
|
28
|
+
offset="100%"
|
|
29
|
+
stopColor="#588CB0"
|
|
30
|
+
/>
|
|
31
|
+
</linearGradient>
|
|
32
|
+
</defs>
|
|
33
|
+
<g
|
|
34
|
+
fill="none"
|
|
35
|
+
fillRule="evenodd"
|
|
36
|
+
>
|
|
37
|
+
<g
|
|
38
|
+
transform="translate(1 1)"
|
|
39
|
+
>
|
|
40
|
+
<path
|
|
41
|
+
d="M36 18c0-9.94-8.06-18-18-18"
|
|
42
|
+
id="Oval-2"
|
|
43
|
+
stroke="#588CB0"
|
|
44
|
+
strokeWidth="2"
|
|
45
|
+
>
|
|
46
|
+
<animateTransform
|
|
47
|
+
attributeName="transform"
|
|
48
|
+
dur="0.9s"
|
|
49
|
+
from="0 18 18"
|
|
50
|
+
repeatCount="indefinite"
|
|
51
|
+
to="360 18 18"
|
|
52
|
+
type="rotate"
|
|
53
|
+
/>
|
|
54
|
+
</path>
|
|
55
|
+
<circle
|
|
56
|
+
cx="36"
|
|
57
|
+
cy="18"
|
|
58
|
+
fill="#fff"
|
|
59
|
+
r="1"
|
|
60
|
+
>
|
|
61
|
+
<animateTransform
|
|
62
|
+
attributeName="transform"
|
|
63
|
+
dur="0.9s"
|
|
64
|
+
from="0 18 18"
|
|
65
|
+
repeatCount="indefinite"
|
|
66
|
+
to="360 18 18"
|
|
67
|
+
type="rotate"
|
|
68
|
+
/>
|
|
69
|
+
</circle>
|
|
70
|
+
</g>
|
|
71
|
+
</g>
|
|
72
|
+
</svg>
|
|
73
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Loader } from './Loader';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Meta, Primary, Controls, Story } from '@storybook/blocks';
|
|
2
|
+
import * as StackStories from './Stack.stories';
|
|
3
|
+
|
|
4
|
+
<Meta of={StackStories} />
|
|
5
|
+
|
|
6
|
+
# Loader
|
|
7
|
+
|
|
8
|
+
The Stack component is the main layout component used in Veeqo currently.
|
|
9
|
+
|
|
10
|
+
It is an easy to use flexbox for aligning items.
|
|
11
|
+
|
|
12
|
+
<Primary />
|
|
13
|
+
|
|
14
|
+
## Props
|
|
15
|
+
|
|
16
|
+
Type will default to TailSpin.
|
|
17
|
+
|
|
18
|
+
<Controls />
|
|
19
|
+
|
|
20
|
+
## Stories
|
|
21
|
+
|
|
22
|
+
### Horizontal
|
|
23
|
+
|
|
24
|
+
<Story of={StackStories.Horizontal} />
|
|
25
|
+
|
|
26
|
+
### Vertical
|
|
27
|
+
|
|
28
|
+
<Story of={StackStories.Vertical} />
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
import { Stack } from './Stack';
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'Components/Layout/Stack',
|
|
7
|
+
component: Stack,
|
|
8
|
+
} satisfies Meta<typeof Stack>;
|
|
9
|
+
|
|
10
|
+
export default meta;
|
|
11
|
+
|
|
12
|
+
type Story = StoryObj<typeof meta>;
|
|
13
|
+
|
|
14
|
+
const alignOptions = ['start', 'center', 'end', 'stretch', 'between', 'around'];
|
|
15
|
+
|
|
16
|
+
export const Horizontal: Story = {
|
|
17
|
+
argTypes: {
|
|
18
|
+
alignX: {
|
|
19
|
+
options: alignOptions,
|
|
20
|
+
control: {
|
|
21
|
+
type: 'select',
|
|
22
|
+
},
|
|
23
|
+
defaultValue: 'center',
|
|
24
|
+
},
|
|
25
|
+
alignY: {
|
|
26
|
+
options: alignOptions,
|
|
27
|
+
control: {
|
|
28
|
+
type: 'select',
|
|
29
|
+
},
|
|
30
|
+
defaultValue: 'center',
|
|
31
|
+
},
|
|
32
|
+
direction: {
|
|
33
|
+
options: ['horizontal', 'vertical'],
|
|
34
|
+
control: {
|
|
35
|
+
type: 'radio',
|
|
36
|
+
},
|
|
37
|
+
defaultValue: 'horizontal',
|
|
38
|
+
},
|
|
39
|
+
spacing: {
|
|
40
|
+
options: ['xs', 'sm', 'base', 'md', 'lg', 'xl'],
|
|
41
|
+
control: {
|
|
42
|
+
type: 'select',
|
|
43
|
+
},
|
|
44
|
+
defaultValue: 'base',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
args: {
|
|
48
|
+
className: 'test-classname',
|
|
49
|
+
alignX: 'center',
|
|
50
|
+
alignY: 'center',
|
|
51
|
+
direction: 'horizontal',
|
|
52
|
+
spacing: 'base',
|
|
53
|
+
children: (
|
|
54
|
+
<>
|
|
55
|
+
<button>Button 1</button>
|
|
56
|
+
<button>Button 2</button>
|
|
57
|
+
<button>Button 3</button>
|
|
58
|
+
<button>Button 4</button>
|
|
59
|
+
<button>Button 5</button>
|
|
60
|
+
</>
|
|
61
|
+
) as ReactNode,
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export const Vertical: Story = {
|
|
66
|
+
argTypes: {
|
|
67
|
+
alignX: {
|
|
68
|
+
options: alignOptions,
|
|
69
|
+
control: {
|
|
70
|
+
type: 'select',
|
|
71
|
+
},
|
|
72
|
+
defaultValue: 'center',
|
|
73
|
+
},
|
|
74
|
+
alignY: {
|
|
75
|
+
options: alignOptions,
|
|
76
|
+
control: {
|
|
77
|
+
type: 'select',
|
|
78
|
+
},
|
|
79
|
+
defaultValue: 'center',
|
|
80
|
+
},
|
|
81
|
+
direction: {
|
|
82
|
+
options: ['horizontal', 'vertical'],
|
|
83
|
+
control: {
|
|
84
|
+
type: 'radio',
|
|
85
|
+
},
|
|
86
|
+
defaultValue: 'horizontal',
|
|
87
|
+
},
|
|
88
|
+
spacing: {
|
|
89
|
+
options: ['xs', 'sm', 'base', 'md', 'lg', 'xl'],
|
|
90
|
+
control: {
|
|
91
|
+
type: 'select',
|
|
92
|
+
},
|
|
93
|
+
defaultValue: 'base',
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
args: {
|
|
97
|
+
className: 'test-classname',
|
|
98
|
+
alignX: 'center',
|
|
99
|
+
alignY: 'center',
|
|
100
|
+
direction: 'vertical',
|
|
101
|
+
spacing: 'base',
|
|
102
|
+
children: (
|
|
103
|
+
<>
|
|
104
|
+
<button>Button 1</button>
|
|
105
|
+
<button>Button 2</button>
|
|
106
|
+
<button>Button 3</button>
|
|
107
|
+
<button>Button 4</button>
|
|
108
|
+
<button>Button 5</button>
|
|
109
|
+
</>
|
|
110
|
+
) as ReactNode,
|
|
111
|
+
},
|
|
112
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
|
|
3
|
+
import { StackProps } from './types';
|
|
4
|
+
import Alignments from './Alignments';
|
|
5
|
+
|
|
6
|
+
import { theme } from '../../theme';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Layout component.
|
|
10
|
+
*/
|
|
11
|
+
export const Stack = styled.div<StackProps>`
|
|
12
|
+
display: flex;
|
|
13
|
+
|
|
14
|
+
${(props) => {
|
|
15
|
+
console.log('props', props.alignX, props.alignY);
|
|
16
|
+
const { direction = 'vertical', alignX = 'start', alignY = 'start', spacing = 'base' } = props;
|
|
17
|
+
|
|
18
|
+
let alignItems;
|
|
19
|
+
let justifyContent;
|
|
20
|
+
let flexDirection;
|
|
21
|
+
let itemFlex;
|
|
22
|
+
let marginTop = '';
|
|
23
|
+
let marginLeft = '';
|
|
24
|
+
|
|
25
|
+
if (direction === 'vertical') {
|
|
26
|
+
alignItems = alignX && Alignments[alignX];
|
|
27
|
+
justifyContent = alignY && Alignments[alignY];
|
|
28
|
+
marginTop = theme.sizes[spacing];
|
|
29
|
+
flexDirection = 'column';
|
|
30
|
+
} else {
|
|
31
|
+
alignItems = alignY && Alignments[alignY];
|
|
32
|
+
justifyContent = alignX && Alignments[alignX];
|
|
33
|
+
marginLeft = theme.sizes[spacing];
|
|
34
|
+
flexDirection = 'row';
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// These options result in 'justify-content: stretch' which doesn't exist,
|
|
38
|
+
// so instead we set the flex of child elements
|
|
39
|
+
if (
|
|
40
|
+
(direction === 'vertical' && alignY === 'stretch') ||
|
|
41
|
+
(direction === 'horizontal' && alignX === 'stretch')
|
|
42
|
+
) {
|
|
43
|
+
itemFlex = 1;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return `
|
|
47
|
+
align-items: ${alignItems};
|
|
48
|
+
justify-content: ${justifyContent};
|
|
49
|
+
flex-direction: ${flexDirection};
|
|
50
|
+
|
|
51
|
+
& > * {
|
|
52
|
+
flex: ${itemFlex};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
& > * + * {
|
|
56
|
+
margin-top: ${marginTop};
|
|
57
|
+
margin-left: ${marginLeft};
|
|
58
|
+
}
|
|
59
|
+
`;
|
|
60
|
+
}}
|
|
61
|
+
`;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`Renders correctly 1`] = `
|
|
4
|
+
.c0 {
|
|
5
|
+
display: -webkit-box;
|
|
6
|
+
display: -webkit-flex;
|
|
7
|
+
display: -ms-flexbox;
|
|
8
|
+
display: flex;
|
|
9
|
+
-webkit-align-items: flex-start;
|
|
10
|
+
-webkit-box-align: flex-start;
|
|
11
|
+
-ms-flex-align: flex-start;
|
|
12
|
+
align-items: flex-start;
|
|
13
|
+
-webkit-box-pack: start;
|
|
14
|
+
-webkit-justify-content: flex-start;
|
|
15
|
+
-ms-flex-pack: start;
|
|
16
|
+
justify-content: flex-start;
|
|
17
|
+
-webkit-flex-direction: column;
|
|
18
|
+
-ms-flex-direction: column;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.c0 > * {
|
|
23
|
+
-webkit-flex: undefined;
|
|
24
|
+
-ms-flex: undefined;
|
|
25
|
+
flex: undefined;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.c0 > * + * {
|
|
29
|
+
margin-top: 1rem;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
<div
|
|
33
|
+
className="c0"
|
|
34
|
+
>
|
|
35
|
+
<div>
|
|
36
|
+
One
|
|
37
|
+
</div>
|
|
38
|
+
<div>
|
|
39
|
+
Two
|
|
40
|
+
</div>
|
|
41
|
+
<div>
|
|
42
|
+
Three
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Stack } from './Stack';
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import Alignments from './Alignments';
|
|
3
|
+
|
|
4
|
+
type Alignment = keyof typeof Alignments;
|
|
5
|
+
|
|
6
|
+
enum SizeAlias {
|
|
7
|
+
none = 'none',
|
|
8
|
+
line = 'line',
|
|
9
|
+
xs = 'xs',
|
|
10
|
+
sm = 'sm',
|
|
11
|
+
base = 'base',
|
|
12
|
+
md = 'md',
|
|
13
|
+
lg = 'lg',
|
|
14
|
+
xl = 'xl',
|
|
15
|
+
xxl = 'xxl',
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type SizeScaleIndex = number | keyof typeof SizeAlias;
|
|
19
|
+
export type SizeScale = {
|
|
20
|
+
[index: number]: string;
|
|
21
|
+
[index: string]: string;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
type SizeScaleBuilderConfig = {
|
|
25
|
+
increment: number;
|
|
26
|
+
unit: string;
|
|
27
|
+
count: number;
|
|
28
|
+
};
|
|
29
|
+
function buildSizeScale({ increment, unit, count }: SizeScaleBuilderConfig): SizeScale {
|
|
30
|
+
const sizes: SizeScale = {};
|
|
31
|
+
/* eslint-disable-next-line no-plusplus */
|
|
32
|
+
for (let i = 0; i <= count; i++) {
|
|
33
|
+
const value = i * increment;
|
|
34
|
+
sizes[i] = `${value}${unit}`;
|
|
35
|
+
}
|
|
36
|
+
return sizes;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const sizeScale = buildSizeScale({ increment: 0.25, unit: 'rem', count: 20 });
|
|
40
|
+
|
|
41
|
+
export const sizeAliases: SizeScale = {
|
|
42
|
+
[SizeAlias.none]: '0',
|
|
43
|
+
[SizeAlias.line]: '1px',
|
|
44
|
+
[SizeAlias.xs]: sizeScale[1],
|
|
45
|
+
[SizeAlias.sm]: sizeScale[2],
|
|
46
|
+
[SizeAlias.base]: sizeScale[4],
|
|
47
|
+
[SizeAlias.md]: sizeScale[6],
|
|
48
|
+
[SizeAlias.lg]: sizeScale[8],
|
|
49
|
+
[SizeAlias.xl]: sizeScale[12],
|
|
50
|
+
[SizeAlias.xxl]: sizeScale[16],
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const sizes: SizeScale = {
|
|
54
|
+
...sizeAliases,
|
|
55
|
+
...sizeScale,
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export type Size = keyof typeof sizes;
|
|
59
|
+
|
|
60
|
+
export type StackProps = {
|
|
61
|
+
children: ReactNode;
|
|
62
|
+
/**
|
|
63
|
+
* Classname for description
|
|
64
|
+
*/
|
|
65
|
+
className?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Direction of component
|
|
68
|
+
*/
|
|
69
|
+
direction?: 'vertical' | 'horizontal';
|
|
70
|
+
alignX?: Alignment;
|
|
71
|
+
alignY?: Alignment;
|
|
72
|
+
spacing?: Size;
|
|
73
|
+
};
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { colors } from './modules/colors';
|
|
2
|
+
import { breakpoints } from './modules/breakpoints';
|
|
3
|
+
import { layers } from './modules/layers';
|
|
4
|
+
import { radius } from './modules/radius';
|
|
5
|
+
import { shadows } from './modules/shadows';
|
|
6
|
+
import { sizes } from './modules/sizes';
|
|
7
|
+
import { text, common } from './modules/text';
|
|
8
|
+
|
|
9
|
+
export const theme = {
|
|
10
|
+
...common,
|
|
11
|
+
breakpoints,
|
|
12
|
+
colors,
|
|
13
|
+
layers,
|
|
14
|
+
radius,
|
|
15
|
+
shadows,
|
|
16
|
+
sizes,
|
|
17
|
+
text,
|
|
18
|
+
};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
export const colors = {
|
|
2
|
+
brand: {
|
|
3
|
+
blue: {
|
|
4
|
+
lightest: '#E4F0F9',
|
|
5
|
+
light: '#93C6E8',
|
|
6
|
+
base: '#4CA1D9',
|
|
7
|
+
dark: '#3878A2',
|
|
8
|
+
darkest: '#1A384B',
|
|
9
|
+
},
|
|
10
|
+
peach: {
|
|
11
|
+
lightest: '#FDECE9',
|
|
12
|
+
light: '#F8B2A9',
|
|
13
|
+
base: '#F48070',
|
|
14
|
+
dark: '#B65F53',
|
|
15
|
+
darkest: '#562D27',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
neutral: {
|
|
19
|
+
ink: {
|
|
20
|
+
lightest: '#959FA8',
|
|
21
|
+
light: '#637381',
|
|
22
|
+
base: '#37424D',
|
|
23
|
+
dark: '#1B2126',
|
|
24
|
+
},
|
|
25
|
+
grey: {
|
|
26
|
+
lightest: '#FAFAFB',
|
|
27
|
+
light: '#F2F3F5',
|
|
28
|
+
base: '#DFE3E8',
|
|
29
|
+
dark: '#CDD1D5',
|
|
30
|
+
},
|
|
31
|
+
greyBlue: {
|
|
32
|
+
lightest: '#AAC5D8',
|
|
33
|
+
light: '#558BB1',
|
|
34
|
+
base: '#406885',
|
|
35
|
+
dark: '#1E313E',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
secondary: {
|
|
39
|
+
red: {
|
|
40
|
+
lightest: '#FDEEEE',
|
|
41
|
+
light: '#F7BCBC',
|
|
42
|
+
base: '#EB5757',
|
|
43
|
+
dark: '#A53D3D',
|
|
44
|
+
darkest: '#5E2323',
|
|
45
|
+
},
|
|
46
|
+
yellow: {
|
|
47
|
+
lightest: '#FFF6D9',
|
|
48
|
+
light: '#FFE999',
|
|
49
|
+
base: '#FFC900',
|
|
50
|
+
dark: '#BF9600',
|
|
51
|
+
darkest: '#594600',
|
|
52
|
+
},
|
|
53
|
+
green: {
|
|
54
|
+
lightest: '#E9F7EF',
|
|
55
|
+
light: '#BEE7CF',
|
|
56
|
+
base: '#27AE60',
|
|
57
|
+
dark: '#1B7A43',
|
|
58
|
+
darkest: '#104626',
|
|
59
|
+
},
|
|
60
|
+
lime: {
|
|
61
|
+
lightest: '#F6FAEB',
|
|
62
|
+
light: '#DBEBAE',
|
|
63
|
+
base: '#A5CD35',
|
|
64
|
+
dark: '#7B9927',
|
|
65
|
+
darkest: '#394712',
|
|
66
|
+
},
|
|
67
|
+
teal: {
|
|
68
|
+
lightest: '#E5F8F5',
|
|
69
|
+
light: '#99E5D7',
|
|
70
|
+
base: '#00BD9A',
|
|
71
|
+
dark: '#00715C',
|
|
72
|
+
darkest: '#00392E',
|
|
73
|
+
},
|
|
74
|
+
aqua: {
|
|
75
|
+
lightest: '#EEFAFE',
|
|
76
|
+
light: '#BBEBFA',
|
|
77
|
+
base: '#56CCF2',
|
|
78
|
+
dark: '#3C8FA9',
|
|
79
|
+
darkest: '#225261',
|
|
80
|
+
},
|
|
81
|
+
purple: {
|
|
82
|
+
lightest: '#F6EFFC',
|
|
83
|
+
light: '#D9C0F1',
|
|
84
|
+
base: '#A162DD',
|
|
85
|
+
dark: '#694090',
|
|
86
|
+
darkest: '#38224D',
|
|
87
|
+
},
|
|
88
|
+
blue: {
|
|
89
|
+
lightest: '#D9EBF8',
|
|
90
|
+
light: '#80BCE8',
|
|
91
|
+
base: '#0079D1',
|
|
92
|
+
dark: '#005A9C',
|
|
93
|
+
darkest: '#003053',
|
|
94
|
+
},
|
|
95
|
+
pink: {
|
|
96
|
+
lightest: '#FFF1FC',
|
|
97
|
+
light: '#FFC7F3',
|
|
98
|
+
base: '#FFA3EB',
|
|
99
|
+
dark: '#BF7AB0',
|
|
100
|
+
darkest: '#593852',
|
|
101
|
+
},
|
|
102
|
+
orange: {
|
|
103
|
+
lightest: '#FEF5ED',
|
|
104
|
+
light: '#FAD6B7',
|
|
105
|
+
base: '#F2994A',
|
|
106
|
+
dark: '#9D6330',
|
|
107
|
+
darkest: '#613D1E',
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
system: {
|
|
111
|
+
scrollbar: {
|
|
112
|
+
thumb: 'rgba(99, 115, 129, .5)',
|
|
113
|
+
background: 'transparent',
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
};
|