alicia-design-system 1.7.0 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.storybook/preview.js +1 -2
- package/index.ts +0 -1
- package/package.json +1 -1
- package/src/alicia/common/Buttons/Buttons.stories.tsx +7 -3
- package/src/types/index.ts +0 -1
- package/src/styles/index.ts +0 -36
- package/src/styles/react-toastify.css +0 -25
- package/src/styles/theme.ts +0 -38
- package/src/styles/types.ts +0 -46
- package/src/styles/utils.ts +0 -27
package/.storybook/preview.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { addDecorator } from "@storybook/react";
|
|
2
2
|
import { withThemesProvider } from "storybook-addon-styled-component-theme";
|
|
3
3
|
|
|
4
|
-
import agosTheme from "../src/styles/theme";
|
|
5
4
|
import { chakraTheme as theme } from "../src/styles/chakraTheme";
|
|
6
5
|
|
|
7
|
-
addDecorator(withThemesProvider([
|
|
6
|
+
addDecorator(withThemesProvider([theme]));
|
|
8
7
|
addDecorator((storyFn) => <div id="modal">{storyFn()}</div>);
|
|
9
8
|
|
|
10
9
|
export const parameters = {
|
package/index.ts
CHANGED
package/package.json
CHANGED
|
@@ -5,7 +5,12 @@ import { Button } from "./Buttons";
|
|
|
5
5
|
export default {
|
|
6
6
|
title: "Alicia/Common/Buttons",
|
|
7
7
|
component: Button,
|
|
8
|
-
argTypes: {
|
|
8
|
+
argTypes: {
|
|
9
|
+
variant: {
|
|
10
|
+
options: ['solid','primary', 'secondary',],
|
|
11
|
+
control: { type: 'radio' },
|
|
12
|
+
},
|
|
13
|
+
},
|
|
9
14
|
} as ComponentMeta<typeof Button>;
|
|
10
15
|
|
|
11
16
|
const Template: ComponentStory<typeof Button> = (args) => {
|
|
@@ -15,7 +20,6 @@ const Template: ComponentStory<typeof Button> = (args) => {
|
|
|
15
20
|
export const Primary = Template.bind({});
|
|
16
21
|
|
|
17
22
|
Primary.args = {
|
|
18
|
-
children: "
|
|
19
|
-
variant: "solid",
|
|
23
|
+
children: "Button Text",
|
|
20
24
|
onChange: () => ({ variant: "primary" }),
|
|
21
25
|
};
|
package/src/types/index.ts
CHANGED
package/src/styles/index.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { createGlobalStyle } from "styled-components";
|
|
2
|
-
|
|
3
|
-
const globalStyle = createGlobalStyle`
|
|
4
|
-
html {
|
|
5
|
-
box-sizing: border-box;
|
|
6
|
-
min-height: 100%;
|
|
7
|
-
height: 100%;
|
|
8
|
-
-webkit-font-smoothing: antialiased;
|
|
9
|
-
-moz-osx-font-smoothing: grayscale;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
*,
|
|
13
|
-
*::after,
|
|
14
|
-
*::before {
|
|
15
|
-
box-sizing: inherit;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
body {
|
|
19
|
-
padding: 0;
|
|
20
|
-
margin: 0;
|
|
21
|
-
box-sizing: border-box;
|
|
22
|
-
font-family: ${({ theme }) => theme.fonts.notoSans};
|
|
23
|
-
background-color: ${({ theme }) => theme.colors.white.medium};
|
|
24
|
-
height: 100%;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
#app {
|
|
28
|
-
height: 100%;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
a {
|
|
32
|
-
text-decoration: none;
|
|
33
|
-
}
|
|
34
|
-
`;
|
|
35
|
-
|
|
36
|
-
export default globalStyle;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
@import 'react-toastify/dist/ReactToastify.min.css';
|
|
2
|
-
|
|
3
|
-
.Toastify__toast-container {
|
|
4
|
-
width: 450px;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.Toastify__toast {
|
|
8
|
-
border-radius: 4px;
|
|
9
|
-
font-family: 'noto-sans', sans-serif;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.Toastify__toast-body {
|
|
13
|
-
font-size: 14px;
|
|
14
|
-
margin: auto 10px;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.Toastify__toast--error {
|
|
18
|
-
background-color: #E5193D;
|
|
19
|
-
color: #FFE5EA;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.Toastify__toast--success {
|
|
23
|
-
background-color: #00CCB2;
|
|
24
|
-
color: #E9FBF9;
|
|
25
|
-
}
|
package/src/styles/theme.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
const theme = {
|
|
2
|
-
colors: {
|
|
3
|
-
white: Object.assign("#FFFFFF", {
|
|
4
|
-
medium: "#F9F9F9",
|
|
5
|
-
dark: "#F4F5F2",
|
|
6
|
-
}),
|
|
7
|
-
black: Object.assign("#000000", {
|
|
8
|
-
light: "#4C4C4C",
|
|
9
|
-
}),
|
|
10
|
-
green: "#01a3a6",
|
|
11
|
-
gray: Object.assign("#989898", {
|
|
12
|
-
light: "#F4F4F4",
|
|
13
|
-
}),
|
|
14
|
-
primary: "#006A70",
|
|
15
|
-
primaryHover: "#4DBFC0",
|
|
16
|
-
primaryOff: "#F1FAFB",
|
|
17
|
-
secondary: "#292E5A",
|
|
18
|
-
secondaryHover: "#54587B",
|
|
19
|
-
red: "#DC3545",
|
|
20
|
-
orange: "#FF6000",
|
|
21
|
-
graph: {
|
|
22
|
-
primary: "#1D868A",
|
|
23
|
-
secondary: "#292E5A",
|
|
24
|
-
background: "#F4F9F9",
|
|
25
|
-
line: "#ECE9F1",
|
|
26
|
-
text: "#989898",
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
shadows: {
|
|
30
|
-
interactiveElement: "0px 1px 1px 0px rgba(0,0,0,0.1)",
|
|
31
|
-
overlay: "0px 2px 4px 0px rgba(0,0,0,0.1)",
|
|
32
|
-
},
|
|
33
|
-
fonts: {
|
|
34
|
-
notoSans: "noto-sans, sans-serif",
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export default theme;
|
package/src/styles/types.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import * as i from "../types";
|
|
2
|
-
import { ThemedCssFunction } from "styled-components";
|
|
3
|
-
import theme from "./theme";
|
|
4
|
-
import { sizes } from "./utils";
|
|
5
|
-
|
|
6
|
-
export type Theme = typeof theme;
|
|
7
|
-
|
|
8
|
-
// Add Theme type to styled-components
|
|
9
|
-
declare module "styled-components" {
|
|
10
|
-
export interface DefaultTheme extends i.Theme {}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export type BaseStyled = {
|
|
14
|
-
theme?: i.Theme;
|
|
15
|
-
className?: string;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
// Get color strings from theme
|
|
19
|
-
export type ThemeColors = keyof typeof theme.colors;
|
|
20
|
-
|
|
21
|
-
// Get subcolors from colors if they exist
|
|
22
|
-
export type SubThemeColors = {
|
|
23
|
-
[color in i.ThemeColors]: Exclude<
|
|
24
|
-
keyof typeof theme.colors[color],
|
|
25
|
-
keyof string
|
|
26
|
-
>;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
// Ensures colors exist in theme
|
|
30
|
-
export type ColorsFromTheme<Colors extends i.ThemeColors> = Colors;
|
|
31
|
-
|
|
32
|
-
// Ensures subcolor exists in color object
|
|
33
|
-
export type SubcolorsFromColor<Color extends i.ThemeColors> =
|
|
34
|
-
i.SubThemeColors[Color];
|
|
35
|
-
|
|
36
|
-
// Ensures subcolor exists in theme
|
|
37
|
-
export type SubcolorFromTheme<
|
|
38
|
-
Color extends i.ThemeColors,
|
|
39
|
-
Subcolor extends i.SubThemeColors[Color]
|
|
40
|
-
> = [Color, Subcolor];
|
|
41
|
-
|
|
42
|
-
export type MediaSizes = keyof typeof sizes;
|
|
43
|
-
|
|
44
|
-
export type MediaUtils = {
|
|
45
|
-
[size in i.MediaSizes]: ThemedCssFunction<i.Theme>;
|
|
46
|
-
};
|
package/src/styles/utils.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import * as i from "../types";
|
|
2
|
-
import { css } from "styled-components";
|
|
3
|
-
|
|
4
|
-
export const sizes = {
|
|
5
|
-
large: 1200,
|
|
6
|
-
desktop: 992,
|
|
7
|
-
tablet: 768,
|
|
8
|
-
mobile: 480,
|
|
9
|
-
} as const;
|
|
10
|
-
|
|
11
|
-
export const media = Object.keys(sizes).reduce((accumulator, _label) => {
|
|
12
|
-
// use em in breakpoints to work properly cross-browser and support users
|
|
13
|
-
// changing their browsers font-size: https://zellwk.com/blog/media-query-units/
|
|
14
|
-
const label = _label as i.MediaSizes;
|
|
15
|
-
const emSize = sizes[label] / 16;
|
|
16
|
-
|
|
17
|
-
// @ts-expect-error
|
|
18
|
-
accumulator[label] = (...args: Parameters<typeof css>) =>
|
|
19
|
-
css`
|
|
20
|
-
@media (min-width: ${emSize}em) {
|
|
21
|
-
${css(...args)};
|
|
22
|
-
}
|
|
23
|
-
`;
|
|
24
|
-
|
|
25
|
-
return accumulator;
|
|
26
|
-
// eslint-disable-next-line @typescript-eslint/prefer-reduce-type-parameter
|
|
27
|
-
}, {} as i.MediaUtils);
|