Skip to content

Commit 0089fc1

Browse files
committed
Refactored component template to adapt to design.
1 parent 880e946 commit 0089fc1

921 files changed

Lines changed: 10318 additions & 17610 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.vscode/launch.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
"request": "launch",
1212
"name": "Launch Chrome against localhost",
1313
"url": "http://localhost:8080",
14-
"webRoot": "${workspaceFolder}"
14+
"webRoot": "${workspaceFolder}",
15+
"serverReadyAction":{
16+
"action": "openExternally"
17+
}
1518
}
1619
]
1720
}

.vscode/settings.json

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,41 @@
11
{
2-
"eslint.enable": false
2+
"eslint.enable": false,
3+
"ACReactComponentGenerator.global.lifecycleType": "reactv16",
4+
"ACReactComponentGenerator.indexFile.extension": "ts",
5+
"ACReactComponentGenerator.mainFile.extension": "tsx",
6+
"zeplin.connectedComponents.ignoredExtensions": [
7+
"html",
8+
"css",
9+
"scss",
10+
"less",
11+
"json",
12+
"md",
13+
"txt",
14+
"yml",
15+
"jpg",
16+
"jpeg",
17+
"png",
18+
"gif",
19+
"webp",
20+
"tiff",
21+
"tif",
22+
"psd",
23+
"svg",
24+
"pdf",
25+
"ico",
26+
"ttf",
27+
"woff",
28+
"woff2",
29+
"otf",
30+
"eof",
31+
"js"
32+
],
33+
"zeplin.connectedComponents.ignoredPathsStartWith": [
34+
"node_modules",
35+
".",
36+
"public",
37+
"dist",
38+
"features",
39+
"src/features"
40+
]
341
}

Theme.ts

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
// theme based on the system-ui specification https://github.com/system-ui/theme-specification
2+
3+
/* breakpoints */
4+
const breakpoints = ["600px", "1200px"] as const;
5+
const mediaQueries = {
6+
medium: `@media screen and (min-width: ${breakpoints[0]})`,
7+
large: `@media screen and (min-width: ${breakpoints[1]})`,
8+
touch: `@media (hover: none)`
9+
} as const;
10+
const fonts = {
11+
app: '"Roboto", sans-serif'
12+
} as const;
13+
/* fonts */
14+
const fontSizes = ["0px", "11px", "13px", "15px", "20px"] as const;
15+
const fontSizesAliases = {
16+
none: fontSizes[0],
17+
small: fontSizes[1],
18+
regular: fontSizes[2],
19+
medium: fontSizes[3],
20+
large: fontSizes[4]
21+
};
22+
const fontWeights = [0, 300, 400, 500, 700, 900] as const;
23+
const fontWeightsAliases = {
24+
none: fontWeights[0],
25+
light: fontWeights[1],
26+
regular: fontWeights[2],
27+
medium: fontWeights[3],
28+
bold: fontWeights[4],
29+
black: fontWeights[5]
30+
};
31+
/* colors */
32+
const colors = {
33+
error: "#B63133",
34+
success: "#62E905",
35+
inactive: "#F5A623",
36+
primary: ["#8E2DE2", "#4A00E0"],
37+
neutral: ["#FFFFFF", "#F8F6FD", "#F1EDFD", "#9B9B9B", "#585858"],
38+
avatars: ["#F7861C", "#35B7DF", "#DE2440", "#1F68EF", "#9F34C3"]
39+
} as const;
40+
const colorAliases = {
41+
onPrimary: colors.neutral[0],
42+
selectedText: "rgba(0, 0, 0, 0.5)",
43+
active: colors.primary[0],
44+
activeText: colors.neutral[0],
45+
messageText: colors.neutral[4],
46+
normalText: colors.neutral[3],
47+
importantText: colors.neutral[4],
48+
avatarText: colors.neutral[0],
49+
borderLight: colors.neutral[2],
50+
borderDark: colors.neutral[3]
51+
} as const;
52+
// backgrounds can be colors or gradients
53+
const backgrounds = {
54+
primary: `linear-gradient(180deg, ${colors.primary[0]} 0%, ${colors.primary[1]} 100%)`,
55+
primaryHover: "rgba(255, 255, 255, 0.1)",
56+
primaryActive: "rgba(0, 0, 0, 0.1)",
57+
panel: colors.neutral[0],
58+
panelHover: colors.neutral[1],
59+
content: colors.neutral[1],
60+
contentHover: colors.neutral[2],
61+
message: colors.neutral[0]
62+
};
63+
/* space and sizes */
64+
const sizes = ["0", "36px", "56px", "85px", "260px", "290px"] as const;
65+
const space = [
66+
"0",
67+
"10px",
68+
"12px",
69+
"14px",
70+
"16px",
71+
"21px",
72+
"24px",
73+
"32px",
74+
"40px"
75+
] as const;
76+
/* borders */
77+
const radii = ["0", "5px", "10px", "100vmax"] as const;
78+
const radiiAliases = {
79+
square: radii[0],
80+
light: radii[1],
81+
messageEditor: radii[1],
82+
medium: radii[2],
83+
strong: radii[2],
84+
round: radii[3]
85+
};
86+
const borderWidths = ["0", "1px", "5px"] as const;
87+
const borderStyles = ["solid"] as const;
88+
const borders = [
89+
"none",
90+
`${borderWidths[1]} ${borderStyles[0]}`,
91+
`${borderWidths[2]} ${borderStyles[0]}`
92+
] as const;
93+
const bordersAliases = {
94+
none: borders[0],
95+
light: borders[1],
96+
strong: borders[2]
97+
};
98+
/* other */
99+
const shadows = [
100+
"0 6px 10px rgba(103, 19, 176, 0.06)",
101+
"0 4px 30px rgba(0, 0, 0, 0.4)"
102+
] as const;
103+
const custom = {
104+
dark: false,
105+
companyName: "PubNub",
106+
tagLine: "World-Class APIs for In-App Chat"
107+
} as const;
108+
109+
export const appTheme = {
110+
breakpoints,
111+
mediaQueries,
112+
fonts,
113+
fontSizes: { ...fontSizes, ...fontSizesAliases },
114+
fontWeights: { ...fontWeights, ...fontWeightsAliases },
115+
colors: { ...colors, ...colorAliases },
116+
backgrounds,
117+
sizes,
118+
space,
119+
radii: { ...radii, ...radiiAliases },
120+
borderWidths,
121+
borderStyles,
122+
borders: { ...borders, ...bordersAliases },
123+
shadows,
124+
custom
125+
};
126+
127+
export type Theme = typeof appTheme;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"h":"69dd8b0ee092c47d3ec2","c":{"main":true}}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"h":"0cec8f6d0eb7706f0336","c":{"main":true}}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"h":"c808371928e09788b270","c":{"main":true}}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"h":"e0a5334f0f3394f0e8e8","c":{"main":true}}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"h":"5f3ee0224fbe53cf5d40","c":{"main":true}}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"h":"29b79d9725e5966d67b1","c":{"main":true}}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"h":"eb8d4a86db40a02c133a","c":{"main":true}}

0 commit comments

Comments
 (0)