aboutsummaryrefslogtreecommitdiffstats
path: root/src/themes/default/index.ts
blob: 458d4999dbaa44ee37061880870da4cc73d9f0e2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
import color from 'color';
import { cloneDeep } from 'lodash';

import { DEFAULT_LOADER_COLOR } from '../../config';
import type IStyleTypes from '../IStyleTypes';
import * as legacyStyles from '../legacy';

export default (brandPrimary: string) => {
  if (!brandPrimary) {
    // eslint-disable-next-line no-param-reassign
    brandPrimary = '#7266F0';
  }
  const brandSuccess = '#5cb85c';
  const brandInfo = '#5bc0de';
  const brandWarning = '#FF9F00';
  const brandDanger = '#d9534f';
  const uiFontSize = 14;
  const colorBackground = legacyStyles.themeGrayLighter;
  const colorContentBackground = DEFAULT_LOADER_COLOR;
  const colorText = legacyStyles.themeGrayDark;
  const inputColor = legacyStyles.themeGray;
  const inputBackground = legacyStyles.themeGrayLightest;
  const inputHeight = 40;
  const inputBorder = `1px solid ${legacyStyles.themeGrayLighter}`;
  const inputPrefixColor = legacyStyles.themeGrayLight;
  const inputDisabledOpacity = 0.5;
  const buttonSecondaryTextColor = legacyStyles.themeGray;
  const selectColor = inputColor;
  const drawerBg = color(colorBackground).lighten(0.1).hex();

  const styleTypes: IStyleTypes = {
    primary: {
      accent: brandPrimary,
      contrast: '#FFF',
    },
    secondary: {
      accent: legacyStyles.themeGrayLighter,
      contrast: legacyStyles.themeGray,
    },
    success: {
      accent: brandSuccess,
      contrast: '#FFF',
    },
    warning: {
      accent: brandWarning,
      contrast: '#FFF',
    },
    danger: {
      accent: brandDanger,
      contrast: '#FFF',
    },
    inverted: {
      accent: 'none',
      contrast: brandPrimary,
      border: `1px solid ${brandPrimary}`,
    },
  };

  const services = {
    listItems: {
      padding: 10,
      height: 57,
      borderColor: legacyStyles.themeGrayLightest,
      hoverBgColor: legacyStyles.themeGrayLightest,
      disabled: {
        color: legacyStyles.themeGrayLight,
      },
    },
  };

  return {
    brandPrimary,
    brandSuccess,
    brandInfo,
    brandWarning,
    brandDanger,

    uiFontSize,

    borderRadius: legacyStyles.themeBorderRadius,
    borderRadiusSmall: legacyStyles.themeBorderRadiusSmall,

    colorBackground,

    colorContentBackground,
    colorHeadline: legacyStyles.themeGrayDark,

    colorText,

    defaultContentBorder: color(legacyStyles.themeGrayLighter)
      .darken(0.1)
      .rgb()
      .string(),

    // Subscription Container Component
    colorSubscriptionContainerBackground: 'none',
    colorSubscriptionContainerBorder: `1px solid ${brandPrimary}`,
    colorSubscriptionContainerTitle: brandPrimary,
    colorSubscriptionContainerActionButtonBackground: brandPrimary,
    colorSubscriptionContainerActionButtonColor: '#FFF',

    // Loader
    colorAppLoaderSpinner: '#FFF',
    colorFullscreenLoaderSpinner: legacyStyles.themeGrayDark,
    colorWebviewLoaderBackground: color(legacyStyles.themeGrayLighter)
      .alpha(0.8)
      .rgb()
      .string(),

    // Input
    labelColor: legacyStyles.themeGrayLight,
    inputColor,
    inputHeight,
    inputBackground,
    inputBorder,
    inputModifierColor: legacyStyles.themeGrayLight,
    inputPlaceholderColor: color(legacyStyles.themeGrayLight)
      .lighten(0.3)
      .hex(),
    inputPrefixColor,
    inputPrefixBackground: legacyStyles.themeGrayLighter,
    inputDisabledOpacity,
    inputScorePasswordBackground: legacyStyles.themeGrayLighter,

    // Toggle
    toggleBackground: legacyStyles.themeGrayLighter,
    toggleButton: legacyStyles.themeGrayLight,
    toggleButtonActive: brandPrimary,
    toggleWidth: 40,
    toggleHeight: 14,

    // Style Types
    styleTypes,

    // Button
    buttonPrimaryBackground: brandPrimary,
    buttonPrimaryTextColor: '#FFF',

    buttonSecondaryBackground: legacyStyles.themeGrayLighter,
    buttonSecondaryTextColor,

    buttonSuccessBackground: brandSuccess,
    buttonSuccessTextColor: '#FFF',

    buttonDangerBackground: brandDanger,
    buttonDangerTextColor: '#FFF',

    buttonWarningBackground: brandWarning,
    buttonWarningTextColor: '#FFF',

    buttonInvertedBackground: 'none',
    buttonInvertedTextColor: brandPrimary,
    buttonInvertedBorder: `1px solid ${brandPrimary}`,

    buttonHeight: inputHeight,

    buttonLoaderColor: {
      primary: '#FFF',
      secondary: buttonSecondaryTextColor,
      success: '#FFF',
      warning: '#FFF',
      danger: '#FFF',
      inverted: brandPrimary,
    },

    // Select
    selectBackground: inputBackground,
    selectBorder: inputBorder,
    selectHeight: inputHeight,
    selectColor,
    selectToggleColor: inputPrefixColor,
    selectPopupBackground: '#FFF',
    selectOptionColor: inputColor,
    selectOptionBorder: `1px solid ${legacyStyles.themeGrayLightest}`,
    selectOptionItemHover: legacyStyles.themeGrayLighter,
    selectOptionItemHoverColor: selectColor,
    selectOptionItemActive: brandPrimary,
    selectOptionItemActiveColor: '#FFF',
    selectSearchBackground: legacyStyles.themeGrayLighter,
    selectSearchColor: inputColor,
    selectDisabledOpacity: inputDisabledOpacity,

    // Badge
    badgeFontSize: uiFontSize - 2,
    badgeBorderRadius: 50,

    // Modal
    colorModalOverlayBackground: color('#000').alpha(0.8).rgb().string(),
    colorModalBackground: colorContentBackground,

    // Services
    services,

    // Service Icon
    serviceIcon: {
      width: 35,
      isCustom: {
        border: `1px solid ${legacyStyles.themeGrayLighter}`,
        borderRadius: legacyStyles.themeBorderRadius,
        width: 37,
      },
    },

    // Workspaces
    workspaces: {
      settings: {
        listItems: cloneDeep(services.listItems),
      },
      drawer: {
        width: 300,
        padding: 20,
        background: drawerBg,
        buttons: {
          color: color(legacyStyles.themeGrayLight).lighten(0.1).hex(),
          hoverColor: legacyStyles.themeGrayLight,
        },
        listItem: {
          hoverBackground: color(drawerBg).darken(0.05).hex(),
          activeBackground: legacyStyles.themeGrayLightest,
          border: color(drawerBg).darken(0.05).hex(),
          name: {
            color: colorText,
            activeColor: colorText,
          },
          services: {
            color: color(colorText).lighten(1.5).hex(),
            active: color(colorText).lighten(1.5).hex(),
          },
        },
      },
    },

    // Todos
    todos: {
      todosLayer: {
        borderLeftColor: color(legacyStyles.themeGrayLighter).darken(0.1).hex(),
      },
      toggleButton: {
        background: styleTypes.primary.accent,
        textColor: styleTypes.primary.contrast,
        shadowColor: 'rgba(0, 0, 0, 0.2)',
      },
      dragIndicator: {
        background: legacyStyles.themeGrayLight,
      },
      resizeHandler: {
        backgroundHover: styleTypes.primary.accent,
      },
    },

    legacyStyles,
  };
};