Skip to content

Commit e0d9944

Browse files
authored
Merge pull request #39 from outshift-open/fix-tags
fix: tags and select in dark theme
2 parents 6b65e95 + 7be74db commit e0d9944

File tree

7 files changed

+78
-1
lines changed

7 files changed

+78
-1
lines changed

packages/open-ui-kit/src/components/tags/tag/types/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
export interface TagStatusStyle {
88
backgroundColor: string;
9+
border: string;
910
iconColor: string;
1011
icon: React.ElementType;
1112
}

packages/open-ui-kit/src/components/tags/tag/utils/index.ts

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,56 +25,100 @@ import {
2525
export const selectTagStyle = (theme: Theme) => ({
2626
[TagStatus.Excellent]: {
2727
backgroundColor: theme.palette.vars?.excellentBackgroundWeak,
28+
border:
29+
theme.palette.mode === "dark"
30+
? `1px solid ${theme.palette.vars?.excellentBorderWeak}`
31+
: `none`,
2832
icon: StarIcon,
2933
iconColor: theme.palette.vars?.excellentIconDefault,
3034
},
3135
[TagStatus.Positive]: {
3236
backgroundColor: theme.palette.vars?.successBackgroundWeak,
37+
border:
38+
theme.palette.mode === "dark"
39+
? `1px solid ${theme.palette.vars?.successBorderWeak}`
40+
: `none`,
3341
icon: CheckCircleIcon,
3442
iconColor: theme.palette.vars?.successIconDefault,
3543
},
3644
[TagStatus.Warning]: {
3745
backgroundColor: theme.palette.vars?.warningBackgroundWeak,
46+
border:
47+
theme.palette.mode === "dark"
48+
? `1px solid ${theme.palette.vars?.warningBorderWeak}`
49+
: `none`,
3850
icon: WarningIcon,
3951
iconColor: theme.palette.vars?.warningIconDefault,
4052
},
4153
[TagStatus.SevereWarning]: {
4254
backgroundColor: theme.palette.vars?.severeWarningBackgroundWeak,
55+
border:
56+
theme.palette.mode === "dark"
57+
? `1px solid ${theme.palette.vars?.severeWarningBorderWeak}`
58+
: `none`,
4359
icon: WarningIcon,
4460
iconColor: theme.palette.vars?.severeWarningIconDefault,
4561
},
4662
[TagStatus.Negative]: {
4763
backgroundColor: theme.palette.vars?.negativeBackgroundWeak,
64+
border:
65+
theme.palette.mode === "dark"
66+
? `1px solid ${theme.palette.vars?.negativeBorderWeak}`
67+
: `none`,
4868
iconColor: theme.palette.vars?.negativeIconDefault,
4969
icon: CancelIcon,
5070
},
5171
[TagStatus.Inactive]: {
5272
backgroundColor: theme.palette.vars?.inactiveBackgroundWeak,
73+
border:
74+
theme.palette.mode === "dark"
75+
? `1px solid ${theme.palette.vars?.inactiveBorderWeak}`
76+
: `none`,
5377
iconColor: theme.palette.vars?.inactiveIconDefault,
5478
icon: RemoveCircleIcon,
5579
},
5680
[TagStatus.Disabled]: {
5781
backgroundColor: theme.palette.vars?.inactiveBackgroundWeak,
82+
border:
83+
theme.palette.mode === "dark"
84+
? `1px solid ${theme.palette.vars?.inactiveBorderWeak}`
85+
: `none`,
5886
iconColor: theme.palette.vars?.inactiveIconDefault,
5987
icon: BlockFlippedIcon,
6088
},
6189
[TagStatus.InProgress]: {
6290
backgroundColor: theme.palette.vars?.infoBackgroundWeak,
91+
border:
92+
theme.palette.mode === "dark"
93+
? `1px solid ${theme.palette.vars?.infoBorderWeak}`
94+
: `none`,
6395
icon: ScheduleIcon,
6496
iconColor: theme.palette.vars?.infoIconDefault,
6597
},
6698
[TagStatus.Info]: {
6799
backgroundColor: theme.palette.vars?.infoBackgroundWeak,
100+
border:
101+
theme.palette.mode === "dark"
102+
? `1px solid ${theme.palette.vars?.infoBorderWeak}`
103+
: `none`,
68104
icon: InfoIcon,
69105
iconColor: theme.palette.vars?.infoIconDefault,
70106
},
71107
[TagStatus.Allow]: {
72108
backgroundColor: theme.palette.vars?.neutralBackgroundWeak,
109+
border:
110+
theme.palette.mode === "dark"
111+
? `1px solid ${theme.palette.vars?.neutralBorderWeak}`
112+
: `none`,
73113
icon: CheckCircleOutlineIcon,
74114
iconColor: theme.palette.vars?.neutralIconDefault,
75115
},
76116
[TagStatus.Deny]: {
77117
backgroundColor: theme.palette.vars?.negativeBackgroundWeak,
118+
border:
119+
theme.palette.mode === "dark"
120+
? `1px solid ${theme.palette.vars?.negativeBorderWeak}`
121+
: `none`,
78122
iconColor: theme.palette.vars?.negativeIconDefault,
79123
icon: BlockFlippedIcon,
80124
},
@@ -104,6 +148,7 @@ export const getTagStyle = ({
104148
}),
105149
...(statusStyle && {
106150
backgroundColor: statusStyle?.backgroundColor,
151+
border: statusStyle?.border,
107152
}),
108153
"&.MuiChip-outlinedDefault": {
109154
border: `2px dashed ${theme.palette.vars?.controlBorderDefault}`,

packages/open-ui-kit/src/theme/dark/dark-vars.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ export const darkVars: VarsType = {
137137
successBorderActive: greenPalette[600],
138138
successBorderHover: greenPalette[300],
139139
successBorderDefault: greenPalette[500],
140+
successBorderWeak: greenPalette[500],
140141
successIconInDisabled: greenPalette[10],
141142
successIconInActive: greenPalette[200],
142143
successIconInHover: greenPalette[100],
@@ -153,6 +154,7 @@ export const darkVars: VarsType = {
153154
negativeBorderHover: redPalette[300],
154155
negativeBorderDisabled: redPalette["alpha40"],
155156
negativeBorderDefault: redPalette[500],
157+
negativeBorderWeak: redPalette[500],
156158
negativeIconDisabled: redPalette["alpha40"],
157159
negativeIconActive: redPalette[600],
158160
negativeIconHover: redPalette[300],
@@ -177,6 +179,7 @@ export const darkVars: VarsType = {
177179
excellentBorderHover: lightBluePalette[400],
178180
excellentBorderActive: lightBluePalette[900],
179181
excellentBorderDisabled: lightBluePalette["alpha40"],
182+
excellentBorderWeak: lightBluePalette[700],
180183
excellentIconDefault: lightBluePalette[700],
181184
excellentIconHover: lightBluePalette[400],
182185
excellentIconActive: lightBluePalette[900],
@@ -199,6 +202,7 @@ export const darkVars: VarsType = {
199202
neutralBorderHover: bluePalette[200],
200203
neutralBorderActive: bluePalette[500],
201204
neutralBorderDisabled: bluePalette["alpha40"],
205+
neutralBorderWeak: bluePalette[300],
202206
neutralIconDefault: bluePalette[300],
203207
neutralIconHover: bluePalette[200],
204208
neutralIconActive: bluePalette[500],
@@ -221,6 +225,7 @@ export const darkVars: VarsType = {
221225
infoBorderHover: purplePalette[300],
222226
infoBorderActive: purplePalette[600],
223227
infoBorderDisabled: purplePalette["alpha40"],
228+
infoBorderWeak: purplePalette[500],
224229
infoIconDefault: purplePalette[400],
225230
infoIconHover: purplePalette[300],
226231
infoIconActive: purplePalette[600],
@@ -243,6 +248,7 @@ export const darkVars: VarsType = {
243248
inactiveBorderHover: greyPalette[500],
244249
inactiveBorderActive: greyPalette[800],
245250
inactiveBorderDisabled: greyPalette["alpha40"],
251+
inactiveBorderWeak: greyPalette[400],
246252
inactiveIconDefault: greyPalette[400],
247253
inactiveIconHover: greyPalette[500],
248254
inactiveIconActive: greyPalette[800],
@@ -265,6 +271,7 @@ export const darkVars: VarsType = {
265271
warningBorderHover: lightOrangePalette[300],
266272
warningBorderActive: lightOrangePalette[600],
267273
warningBorderDisabled: lightOrangePalette["alpha40"],
274+
warningBorderWeak: lightOrangePalette[500],
268275
warningIconDefault: lightOrangePalette[400],
269276
warningIconHover: lightOrangePalette[300],
270277
warningIconActive: lightOrangePalette[600],
@@ -287,6 +294,7 @@ export const darkVars: VarsType = {
287294
severeWarningBorderHover: orangePalette[300],
288295
severeWarningBorderActive: orangePalette[600],
289296
severeWarningBorderDisabled: orangePalette["alpha40"],
297+
severeWarningBorderWeak: orangePalette[500],
290298
severeWarningIconDefault: orangePalette[400],
291299
severeWarningIconHover: orangePalette[300],
292300
severeWarningIconActive: orangePalette[600],
@@ -309,6 +317,7 @@ export const darkVars: VarsType = {
309317
moderateBorderHover: yellowPalette[300],
310318
moderateBorderActive: yellowPalette[600],
311319
moderateBorderDisabled: yellowPalette["alpha40"],
320+
moderateBorderWeak: yellowPalette[500],
312321
moderateIconDefault: yellowPalette[50],
313322
moderateIconHover: yellowPalette[100],
314323
moderateIconActive: yellowPalette[200],

packages/open-ui-kit/src/theme/light/light-vars.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ export const lightVars: VarsType = {
133133
successBorderActive: greenPalette[700],
134134
successBorderHover: greenPalette[400],
135135
successBorderDefault: greenPalette[600],
136+
successBorderWeak: greenPalette[50],
136137
successIconInDisabled: greenPalette[10],
137138
successIconInActive: greenPalette[200],
138139
successIconInHover: greenPalette[100],
@@ -149,6 +150,7 @@ export const lightVars: VarsType = {
149150
negativeBorderHover: redPalette[400],
150151
negativeBorderDisabled: redPalette["alpha40"],
151152
negativeBorderDefault: redPalette[600],
153+
negativeBorderWeak: redPalette[50],
152154
negativeIconDisabled: redPalette["alpha40"],
153155
negativeIconActive: redPalette[700],
154156
negativeIconHover: redPalette[400],
@@ -173,6 +175,7 @@ export const lightVars: VarsType = {
173175
excellentBorderHover: lightBluePalette[400],
174176
excellentBorderActive: lightBluePalette[900],
175177
excellentBorderDisabled: lightBluePalette["alpha40"],
178+
excellentBorderWeak: lightBluePalette[700],
176179
excellentIconDefault: lightBluePalette[700],
177180
excellentIconHover: lightBluePalette[400],
178181
excellentIconActive: lightBluePalette[900],
@@ -195,6 +198,7 @@ export const lightVars: VarsType = {
195198
neutralBorderHover: bluePalette[500],
196199
neutralBorderActive: bluePalette[800],
197200
neutralBorderDisabled: bluePalette["alpha40"],
201+
neutralBorderWeak: bluePalette[50],
198202
neutralIconDefault: bluePalette[600],
199203
neutralIconHover: bluePalette[500],
200204
neutralIconActive: bluePalette[800],
@@ -217,6 +221,7 @@ export const lightVars: VarsType = {
217221
infoBorderHover: purplePalette[500],
218222
infoBorderActive: purplePalette[800],
219223
infoBorderDisabled: purplePalette["alpha40"],
224+
infoBorderWeak: purplePalette[50],
220225
infoIconDefault: purplePalette[600],
221226
infoIconHover: purplePalette[500],
222227
infoIconActive: purplePalette[800],
@@ -239,6 +244,7 @@ export const lightVars: VarsType = {
239244
inactiveBorderHover: greyPalette[500],
240245
inactiveBorderActive: greyPalette[800],
241246
inactiveBorderDisabled: greyPalette["alpha40"],
247+
inactiveBorderWeak: greyPalette[50],
242248
inactiveIconDefault: greyPalette[400],
243249
inactiveIconHover: greyPalette[500],
244250
inactiveIconActive: greyPalette[800],
@@ -261,6 +267,7 @@ export const lightVars: VarsType = {
261267
warningBorderHover: lightOrangePalette[400],
262268
warningBorderActive: lightOrangePalette[700],
263269
warningBorderDisabled: lightOrangePalette["alpha40"],
270+
warningBorderWeak: lightOrangePalette[50],
264271
warningIconDefault: lightOrangePalette[600],
265272
warningIconHover: lightOrangePalette[400],
266273
warningIconActive: lightOrangePalette[700],
@@ -283,6 +290,7 @@ export const lightVars: VarsType = {
283290
severeWarningBorderHover: orangePalette[400],
284291
severeWarningBorderActive: orangePalette[700],
285292
severeWarningBorderDisabled: orangePalette["alpha40"],
293+
severeWarningBorderWeak: orangePalette[50],
286294
severeWarningIconDefault: orangePalette[600],
287295
severeWarningIconHover: orangePalette[400],
288296
severeWarningIconActive: orangePalette[700],
@@ -305,6 +313,7 @@ export const lightVars: VarsType = {
305313
moderateBorderHover: yellowPalette[400],
306314
moderateBorderActive: yellowPalette[700],
307315
moderateBorderDisabled: yellowPalette["alpha40"],
316+
moderateBorderWeak: yellowPalette[50],
308317
moderateIconDefault: yellowPalette[600],
309318
moderateIconHover: yellowPalette[400],
310319
moderateIconActive: yellowPalette[700],

packages/open-ui-kit/src/theme/mui/input.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export const inputComponents = (theme: Theme): Components => {
135135
styleOverrides: {
136136
root: {
137137
"& .MuiSelect-select": {
138-
backgroundColor: theme.palette.vars.controlBackgroundWeak,
138+
backgroundColor: theme.palette.vars.controlBackgroundDefault,
139139
},
140140
},
141141
icon: {

packages/open-ui-kit/src/theme/mui/tooltip.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ export const tooltipComponent = (theme: Theme): Components => {
1313
tooltip: {
1414
...theme.typography.captionMedium,
1515
backgroundColor: theme.palette.vars.inactiveBackgroundActive,
16+
color: theme.palette.vars.baseTextInverse,
17+
},
18+
arrow: {
19+
color: theme.palette.vars.inactiveBackgroundActive,
1620
},
1721
},
1822
},

packages/open-ui-kit/src/types/vars.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ export interface VarsType {
112112
successBorderActive: string;
113113
successBorderHover: string;
114114
successBorderDefault: string;
115+
successBorderWeak: string;
115116
successIconInDisabled: string;
116117
successIconInActive: string;
117118
successIconInHover: string;
@@ -128,6 +129,7 @@ export interface VarsType {
128129
negativeBorderHover: string;
129130
negativeBorderDisabled: string;
130131
negativeBorderDefault: string;
132+
negativeBorderWeak: string;
131133
negativeIconDisabled: string;
132134
negativeIconActive: string;
133135
negativeIconHover: string;
@@ -152,6 +154,7 @@ export interface VarsType {
152154
excellentBorderHover: string;
153155
excellentBorderActive: string;
154156
excellentBorderDisabled: string;
157+
excellentBorderWeak: string;
155158
excellentIconDefault: string;
156159
excellentIconHover: string;
157160
excellentIconActive: string;
@@ -174,6 +177,7 @@ export interface VarsType {
174177
neutralBorderHover: string;
175178
neutralBorderActive: string;
176179
neutralBorderDisabled: string;
180+
neutralBorderWeak: string;
177181
neutralIconDefault: string;
178182
neutralIconHover: string;
179183
neutralIconActive: string;
@@ -196,6 +200,7 @@ export interface VarsType {
196200
infoBorderHover: string;
197201
infoBorderActive: string;
198202
infoBorderDisabled: string;
203+
infoBorderWeak: string;
199204
infoIconDefault: string;
200205
infoIconHover: string;
201206
infoIconActive: string;
@@ -218,6 +223,7 @@ export interface VarsType {
218223
inactiveBorderHover: string;
219224
inactiveBorderActive: string;
220225
inactiveBorderDisabled: string;
226+
inactiveBorderWeak: string;
221227
inactiveIconDefault: string;
222228
inactiveIconHover: string;
223229
inactiveIconActive: string;
@@ -240,6 +246,7 @@ export interface VarsType {
240246
warningBorderHover: string;
241247
warningBorderActive: string;
242248
warningBorderDisabled: string;
249+
warningBorderWeak: string;
243250
warningIconDefault: string;
244251
warningIconHover: string;
245252
warningIconActive: string;
@@ -262,6 +269,7 @@ export interface VarsType {
262269
severeWarningBorderHover: string;
263270
severeWarningBorderActive: string;
264271
severeWarningBorderDisabled: string;
272+
severeWarningBorderWeak: string;
265273
severeWarningIconDefault: string;
266274
severeWarningIconHover: string;
267275
severeWarningIconActive: string;
@@ -284,6 +292,7 @@ export interface VarsType {
284292
moderateBorderHover: string;
285293
moderateBorderActive: string;
286294
moderateBorderDisabled: string;
295+
moderateBorderWeak: string;
287296
moderateIconDefault: string;
288297
moderateIconHover: string;
289298
moderateIconActive: string;

0 commit comments

Comments
 (0)