baseui 10.7.4 → 10.8.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/es/themes/dark-theme/color-component-tokens.js +15 -10
- package/es/themes/light-theme/color-component-tokens.js +15 -10
- package/es/toast/styled-components.js +18 -7
- package/esm/themes/dark-theme/color-component-tokens.js +15 -10
- package/esm/themes/light-theme/color-component-tokens.js +15 -10
- package/esm/toast/styled-components.js +13 -5
- package/package.json +1 -1
- package/themes/dark-theme/color-component-tokens.js +15 -10
- package/themes/dark-theme/color-component-tokens.js.flow +15 -10
- package/themes/light-theme/color-component-tokens.js +15 -10
- package/themes/light-theme/color-component-tokens.js.flow +15 -10
- package/themes/types.js.flow +5 -0
- package/toast/styled-components.js +13 -5
- package/toast/styled-components.js.flow +17 -7
|
@@ -106,15 +106,15 @@ export default ((themePrimitives = colorTokens) => ({
|
|
|
106
106
|
modalCloseColorFocus: themePrimitives.mono400,
|
|
107
107
|
// Notification
|
|
108
108
|
notificationPrimaryBackground: themePrimitives.primary700,
|
|
109
|
-
notificationPrimaryText: themePrimitives.
|
|
109
|
+
notificationPrimaryText: themePrimitives.primaryA,
|
|
110
110
|
notificationInfoBackground: themePrimitives.accent700,
|
|
111
|
-
notificationInfoText: themePrimitives.
|
|
111
|
+
notificationInfoText: themePrimitives.primaryA,
|
|
112
112
|
notificationPositiveBackground: themePrimitives.positive700,
|
|
113
|
-
notificationPositiveText: themePrimitives.
|
|
113
|
+
notificationPositiveText: themePrimitives.primaryA,
|
|
114
114
|
notificationWarningBackground: themePrimitives.warning700,
|
|
115
|
-
notificationWarningText: themePrimitives.
|
|
115
|
+
notificationWarningText: themePrimitives.primaryA,
|
|
116
116
|
notificationNegativeBackground: themePrimitives.negative700,
|
|
117
|
-
notificationNegativeText: themePrimitives.
|
|
117
|
+
notificationNegativeText: themePrimitives.primaryA,
|
|
118
118
|
// Tag
|
|
119
119
|
// Custom ramps
|
|
120
120
|
tagFontDisabledRampUnit: '600',
|
|
@@ -274,11 +274,16 @@ export default ((themePrimitives = colorTokens) => ({
|
|
|
274
274
|
tableFilterFooterBackground: themePrimitives.mono800,
|
|
275
275
|
// Toast
|
|
276
276
|
toastText: themePrimitives.white,
|
|
277
|
-
toastPrimaryBackground: themePrimitives.
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
277
|
+
toastPrimaryBackground: themePrimitives.primary400,
|
|
278
|
+
toastPrimaryText: themePrimitives.white,
|
|
279
|
+
toastInfoBackground: themePrimitives.accent400,
|
|
280
|
+
toastInfoText: themePrimitives.white,
|
|
281
|
+
toastPositiveBackground: themePrimitives.positive400,
|
|
282
|
+
toastPositiveText: themePrimitives.white,
|
|
283
|
+
toastWarningBackground: themePrimitives.warning400,
|
|
284
|
+
toastWarningText: themePrimitives.black,
|
|
285
|
+
toastNegativeBackground: themePrimitives.negative400,
|
|
286
|
+
toastNegativeText: themePrimitives.white,
|
|
282
287
|
// Toggle
|
|
283
288
|
toggleFill: themePrimitives.mono300,
|
|
284
289
|
toggleFillChecked: themePrimitives.primary,
|
|
@@ -182,15 +182,15 @@ export default ((themePrimitives = colorTokens) => ({
|
|
|
182
182
|
tabColor: themePrimitives.mono800,
|
|
183
183
|
// Notification
|
|
184
184
|
notificationPrimaryBackground: themePrimitives.primary50,
|
|
185
|
-
notificationPrimaryText: themePrimitives.
|
|
185
|
+
notificationPrimaryText: themePrimitives.primaryA,
|
|
186
186
|
notificationInfoBackground: themePrimitives.accent50,
|
|
187
|
-
notificationInfoText: themePrimitives.
|
|
187
|
+
notificationInfoText: themePrimitives.primaryA,
|
|
188
188
|
notificationPositiveBackground: themePrimitives.positive50,
|
|
189
|
-
notificationPositiveText: themePrimitives.
|
|
189
|
+
notificationPositiveText: themePrimitives.primaryA,
|
|
190
190
|
notificationWarningBackground: themePrimitives.warning50,
|
|
191
|
-
notificationWarningText: themePrimitives.
|
|
191
|
+
notificationWarningText: themePrimitives.primaryA,
|
|
192
192
|
notificationNegativeBackground: themePrimitives.negative50,
|
|
193
|
-
notificationNegativeText: themePrimitives.
|
|
193
|
+
notificationNegativeText: themePrimitives.primaryA,
|
|
194
194
|
// Tag
|
|
195
195
|
// Custom ramps
|
|
196
196
|
tagFontDisabledRampUnit: '100',
|
|
@@ -349,11 +349,16 @@ export default ((themePrimitives = colorTokens) => ({
|
|
|
349
349
|
tableFilterFooterBackground: themePrimitives.mono200,
|
|
350
350
|
// Toast
|
|
351
351
|
toastText: themePrimitives.white,
|
|
352
|
-
toastPrimaryBackground: themePrimitives.
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
352
|
+
toastPrimaryBackground: themePrimitives.primary400,
|
|
353
|
+
toastPrimaryText: themePrimitives.white,
|
|
354
|
+
toastInfoBackground: themePrimitives.accent400,
|
|
355
|
+
toastInfoText: themePrimitives.white,
|
|
356
|
+
toastPositiveBackground: themePrimitives.positive400,
|
|
357
|
+
toastPositiveText: themePrimitives.white,
|
|
358
|
+
toastWarningBackground: themePrimitives.warning400,
|
|
359
|
+
toastWarningText: themePrimitives.black,
|
|
360
|
+
toastNegativeBackground: themePrimitives.negative400,
|
|
361
|
+
toastNegativeText: themePrimitives.white,
|
|
357
362
|
// Spinner
|
|
358
363
|
spinnerTrackFill: themePrimitives.mono900,
|
|
359
364
|
// Progress bar
|
|
@@ -18,12 +18,23 @@ function getBackgroundColor(kind, type, theme) {
|
|
|
18
18
|
}[kind];
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
function getFontColor(kind, theme) {
|
|
21
|
+
function getFontColor(kind, type, theme) {
|
|
22
|
+
const isInline = type === TYPE.inline;
|
|
23
|
+
|
|
24
|
+
if (isInline) {
|
|
25
|
+
return {
|
|
26
|
+
[KIND.info]: theme.colors.notificationInfoText,
|
|
27
|
+
[KIND.positive]: theme.colors.notificationPositiveText,
|
|
28
|
+
[KIND.warning]: theme.colors.notificationWarningText,
|
|
29
|
+
[KIND.negative]: theme.colors.notificationNegativeText
|
|
30
|
+
}[kind];
|
|
31
|
+
}
|
|
32
|
+
|
|
22
33
|
return {
|
|
23
|
-
[KIND.info]: theme.colors.
|
|
24
|
-
[KIND.positive]: theme.colors.
|
|
25
|
-
[KIND.warning]: theme.colors.
|
|
26
|
-
[KIND.negative]: theme.colors.
|
|
34
|
+
[KIND.info]: theme.colors.toastInfoText,
|
|
35
|
+
[KIND.positive]: theme.colors.toastPositiveText,
|
|
36
|
+
[KIND.warning]: theme.colors.toastWarningText,
|
|
37
|
+
[KIND.negative]: theme.colors.toastNegativeText
|
|
27
38
|
}[kind];
|
|
28
39
|
}
|
|
29
40
|
|
|
@@ -99,9 +110,9 @@ export const Body = styled('div', props => {
|
|
|
99
110
|
$theme
|
|
100
111
|
} = props;
|
|
101
112
|
const isInline = $type === TYPE.inline;
|
|
102
|
-
return { ...$theme.typography.
|
|
113
|
+
return { ...$theme.typography.font300,
|
|
103
114
|
pointerEvents: 'auto',
|
|
104
|
-
color:
|
|
115
|
+
color: getFontColor($kind, $type, $theme),
|
|
105
116
|
height: 'auto',
|
|
106
117
|
width: '288px',
|
|
107
118
|
paddingTop: $theme.sizing.scale600,
|
|
@@ -108,15 +108,15 @@ export default (function () {
|
|
|
108
108
|
modalCloseColorFocus: themePrimitives.mono400,
|
|
109
109
|
// Notification
|
|
110
110
|
notificationPrimaryBackground: themePrimitives.primary700,
|
|
111
|
-
notificationPrimaryText: themePrimitives.
|
|
111
|
+
notificationPrimaryText: themePrimitives.primaryA,
|
|
112
112
|
notificationInfoBackground: themePrimitives.accent700,
|
|
113
|
-
notificationInfoText: themePrimitives.
|
|
113
|
+
notificationInfoText: themePrimitives.primaryA,
|
|
114
114
|
notificationPositiveBackground: themePrimitives.positive700,
|
|
115
|
-
notificationPositiveText: themePrimitives.
|
|
115
|
+
notificationPositiveText: themePrimitives.primaryA,
|
|
116
116
|
notificationWarningBackground: themePrimitives.warning700,
|
|
117
|
-
notificationWarningText: themePrimitives.
|
|
117
|
+
notificationWarningText: themePrimitives.primaryA,
|
|
118
118
|
notificationNegativeBackground: themePrimitives.negative700,
|
|
119
|
-
notificationNegativeText: themePrimitives.
|
|
119
|
+
notificationNegativeText: themePrimitives.primaryA,
|
|
120
120
|
// Tag
|
|
121
121
|
// Custom ramps
|
|
122
122
|
tagFontDisabledRampUnit: '600',
|
|
@@ -276,11 +276,16 @@ export default (function () {
|
|
|
276
276
|
tableFilterFooterBackground: themePrimitives.mono800,
|
|
277
277
|
// Toast
|
|
278
278
|
toastText: themePrimitives.white,
|
|
279
|
-
toastPrimaryBackground: themePrimitives.
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
279
|
+
toastPrimaryBackground: themePrimitives.primary400,
|
|
280
|
+
toastPrimaryText: themePrimitives.white,
|
|
281
|
+
toastInfoBackground: themePrimitives.accent400,
|
|
282
|
+
toastInfoText: themePrimitives.white,
|
|
283
|
+
toastPositiveBackground: themePrimitives.positive400,
|
|
284
|
+
toastPositiveText: themePrimitives.white,
|
|
285
|
+
toastWarningBackground: themePrimitives.warning400,
|
|
286
|
+
toastWarningText: themePrimitives.black,
|
|
287
|
+
toastNegativeBackground: themePrimitives.negative400,
|
|
288
|
+
toastNegativeText: themePrimitives.white,
|
|
284
289
|
// Toggle
|
|
285
290
|
toggleFill: themePrimitives.mono300,
|
|
286
291
|
toggleFillChecked: themePrimitives.primary,
|
|
@@ -184,15 +184,15 @@ export default (function () {
|
|
|
184
184
|
tabColor: themePrimitives.mono800,
|
|
185
185
|
// Notification
|
|
186
186
|
notificationPrimaryBackground: themePrimitives.primary50,
|
|
187
|
-
notificationPrimaryText: themePrimitives.
|
|
187
|
+
notificationPrimaryText: themePrimitives.primaryA,
|
|
188
188
|
notificationInfoBackground: themePrimitives.accent50,
|
|
189
|
-
notificationInfoText: themePrimitives.
|
|
189
|
+
notificationInfoText: themePrimitives.primaryA,
|
|
190
190
|
notificationPositiveBackground: themePrimitives.positive50,
|
|
191
|
-
notificationPositiveText: themePrimitives.
|
|
191
|
+
notificationPositiveText: themePrimitives.primaryA,
|
|
192
192
|
notificationWarningBackground: themePrimitives.warning50,
|
|
193
|
-
notificationWarningText: themePrimitives.
|
|
193
|
+
notificationWarningText: themePrimitives.primaryA,
|
|
194
194
|
notificationNegativeBackground: themePrimitives.negative50,
|
|
195
|
-
notificationNegativeText: themePrimitives.
|
|
195
|
+
notificationNegativeText: themePrimitives.primaryA,
|
|
196
196
|
// Tag
|
|
197
197
|
// Custom ramps
|
|
198
198
|
tagFontDisabledRampUnit: '100',
|
|
@@ -351,11 +351,16 @@ export default (function () {
|
|
|
351
351
|
tableFilterFooterBackground: themePrimitives.mono200,
|
|
352
352
|
// Toast
|
|
353
353
|
toastText: themePrimitives.white,
|
|
354
|
-
toastPrimaryBackground: themePrimitives.
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
354
|
+
toastPrimaryBackground: themePrimitives.primary400,
|
|
355
|
+
toastPrimaryText: themePrimitives.white,
|
|
356
|
+
toastInfoBackground: themePrimitives.accent400,
|
|
357
|
+
toastInfoText: themePrimitives.white,
|
|
358
|
+
toastPositiveBackground: themePrimitives.positive400,
|
|
359
|
+
toastPositiveText: themePrimitives.white,
|
|
360
|
+
toastWarningBackground: themePrimitives.warning400,
|
|
361
|
+
toastWarningText: themePrimitives.black,
|
|
362
|
+
toastNegativeBackground: themePrimitives.negative400,
|
|
363
|
+
toastNegativeText: themePrimitives.white,
|
|
359
364
|
// Spinner
|
|
360
365
|
spinnerTrackFill: themePrimitives.mono900,
|
|
361
366
|
// Progress bar
|
|
@@ -21,10 +21,18 @@ function getBackgroundColor(kind, type, theme) {
|
|
|
21
21
|
return (_KIND$info$KIND$posit = {}, _defineProperty(_KIND$info$KIND$posit, KIND.info, isInline ? theme.colors.notificationInfoBackground : theme.colors.toastInfoBackground), _defineProperty(_KIND$info$KIND$posit, KIND.positive, isInline ? theme.colors.notificationPositiveBackground : theme.colors.toastPositiveBackground), _defineProperty(_KIND$info$KIND$posit, KIND.warning, isInline ? theme.colors.notificationWarningBackground : theme.colors.toastWarningBackground), _defineProperty(_KIND$info$KIND$posit, KIND.negative, isInline ? theme.colors.notificationNegativeBackground : theme.colors.toastNegativeBackground), _KIND$info$KIND$posit)[kind];
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
function getFontColor(kind, theme) {
|
|
25
|
-
var _KIND$info$KIND$
|
|
24
|
+
function getFontColor(kind, type, theme) {
|
|
25
|
+
var _KIND$info$KIND$posit3;
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
var isInline = type === TYPE.inline;
|
|
28
|
+
|
|
29
|
+
if (isInline) {
|
|
30
|
+
var _KIND$info$KIND$posit2;
|
|
31
|
+
|
|
32
|
+
return (_KIND$info$KIND$posit2 = {}, _defineProperty(_KIND$info$KIND$posit2, KIND.info, theme.colors.notificationInfoText), _defineProperty(_KIND$info$KIND$posit2, KIND.positive, theme.colors.notificationPositiveText), _defineProperty(_KIND$info$KIND$posit2, KIND.warning, theme.colors.notificationWarningText), _defineProperty(_KIND$info$KIND$posit2, KIND.negative, theme.colors.notificationNegativeText), _KIND$info$KIND$posit2)[kind];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return (_KIND$info$KIND$posit3 = {}, _defineProperty(_KIND$info$KIND$posit3, KIND.info, theme.colors.toastInfoText), _defineProperty(_KIND$info$KIND$posit3, KIND.positive, theme.colors.toastPositiveText), _defineProperty(_KIND$info$KIND$posit3, KIND.warning, theme.colors.toastWarningText), _defineProperty(_KIND$info$KIND$posit3, KIND.negative, theme.colors.toastNegativeText), _KIND$info$KIND$posit3)[kind];
|
|
28
36
|
}
|
|
29
37
|
|
|
30
38
|
export function getPlacement(placement) {
|
|
@@ -89,9 +97,9 @@ export var Body = styled('div', function (props) {
|
|
|
89
97
|
$type = props.$type,
|
|
90
98
|
$theme = props.$theme;
|
|
91
99
|
var isInline = $type === TYPE.inline;
|
|
92
|
-
return _objectSpread(_objectSpread({}, $theme.typography.
|
|
100
|
+
return _objectSpread(_objectSpread({}, $theme.typography.font300), {}, {
|
|
93
101
|
pointerEvents: 'auto',
|
|
94
|
-
color:
|
|
102
|
+
color: getFontColor($kind, $type, $theme),
|
|
95
103
|
height: 'auto',
|
|
96
104
|
width: '288px',
|
|
97
105
|
paddingTop: $theme.sizing.scale600,
|
package/package.json
CHANGED
|
@@ -118,15 +118,15 @@ var _default = function _default() {
|
|
|
118
118
|
modalCloseColorFocus: themePrimitives.mono400,
|
|
119
119
|
// Notification
|
|
120
120
|
notificationPrimaryBackground: themePrimitives.primary700,
|
|
121
|
-
notificationPrimaryText: themePrimitives.
|
|
121
|
+
notificationPrimaryText: themePrimitives.primaryA,
|
|
122
122
|
notificationInfoBackground: themePrimitives.accent700,
|
|
123
|
-
notificationInfoText: themePrimitives.
|
|
123
|
+
notificationInfoText: themePrimitives.primaryA,
|
|
124
124
|
notificationPositiveBackground: themePrimitives.positive700,
|
|
125
|
-
notificationPositiveText: themePrimitives.
|
|
125
|
+
notificationPositiveText: themePrimitives.primaryA,
|
|
126
126
|
notificationWarningBackground: themePrimitives.warning700,
|
|
127
|
-
notificationWarningText: themePrimitives.
|
|
127
|
+
notificationWarningText: themePrimitives.primaryA,
|
|
128
128
|
notificationNegativeBackground: themePrimitives.negative700,
|
|
129
|
-
notificationNegativeText: themePrimitives.
|
|
129
|
+
notificationNegativeText: themePrimitives.primaryA,
|
|
130
130
|
// Tag
|
|
131
131
|
// Custom ramps
|
|
132
132
|
tagFontDisabledRampUnit: '600',
|
|
@@ -286,11 +286,16 @@ var _default = function _default() {
|
|
|
286
286
|
tableFilterFooterBackground: themePrimitives.mono800,
|
|
287
287
|
// Toast
|
|
288
288
|
toastText: themePrimitives.white,
|
|
289
|
-
toastPrimaryBackground: themePrimitives.
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
289
|
+
toastPrimaryBackground: themePrimitives.primary400,
|
|
290
|
+
toastPrimaryText: themePrimitives.white,
|
|
291
|
+
toastInfoBackground: themePrimitives.accent400,
|
|
292
|
+
toastInfoText: themePrimitives.white,
|
|
293
|
+
toastPositiveBackground: themePrimitives.positive400,
|
|
294
|
+
toastPositiveText: themePrimitives.white,
|
|
295
|
+
toastWarningBackground: themePrimitives.warning400,
|
|
296
|
+
toastWarningText: themePrimitives.black,
|
|
297
|
+
toastNegativeBackground: themePrimitives.negative400,
|
|
298
|
+
toastNegativeText: themePrimitives.white,
|
|
294
299
|
// Toggle
|
|
295
300
|
toggleFill: themePrimitives.mono300,
|
|
296
301
|
toggleFillChecked: themePrimitives.primary,
|
|
@@ -125,15 +125,15 @@ export default (
|
|
|
125
125
|
|
|
126
126
|
// Notification
|
|
127
127
|
notificationPrimaryBackground: themePrimitives.primary700,
|
|
128
|
-
notificationPrimaryText: themePrimitives.
|
|
128
|
+
notificationPrimaryText: themePrimitives.primaryA,
|
|
129
129
|
notificationInfoBackground: themePrimitives.accent700,
|
|
130
|
-
notificationInfoText: themePrimitives.
|
|
130
|
+
notificationInfoText: themePrimitives.primaryA,
|
|
131
131
|
notificationPositiveBackground: themePrimitives.positive700,
|
|
132
|
-
notificationPositiveText: themePrimitives.
|
|
132
|
+
notificationPositiveText: themePrimitives.primaryA,
|
|
133
133
|
notificationWarningBackground: themePrimitives.warning700,
|
|
134
|
-
notificationWarningText: themePrimitives.
|
|
134
|
+
notificationWarningText: themePrimitives.primaryA,
|
|
135
135
|
notificationNegativeBackground: themePrimitives.negative700,
|
|
136
|
-
notificationNegativeText: themePrimitives.
|
|
136
|
+
notificationNegativeText: themePrimitives.primaryA,
|
|
137
137
|
|
|
138
138
|
// Tag
|
|
139
139
|
|
|
@@ -302,11 +302,16 @@ export default (
|
|
|
302
302
|
|
|
303
303
|
// Toast
|
|
304
304
|
toastText: themePrimitives.white,
|
|
305
|
-
toastPrimaryBackground: themePrimitives.
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
305
|
+
toastPrimaryBackground: themePrimitives.primary400,
|
|
306
|
+
toastPrimaryText: themePrimitives.white,
|
|
307
|
+
toastInfoBackground: themePrimitives.accent400,
|
|
308
|
+
toastInfoText: themePrimitives.white,
|
|
309
|
+
toastPositiveBackground: themePrimitives.positive400,
|
|
310
|
+
toastPositiveText: themePrimitives.white,
|
|
311
|
+
toastWarningBackground: themePrimitives.warning400,
|
|
312
|
+
toastWarningText: themePrimitives.black,
|
|
313
|
+
toastNegativeBackground: themePrimitives.negative400,
|
|
314
|
+
toastNegativeText: themePrimitives.white,
|
|
310
315
|
|
|
311
316
|
// Toggle
|
|
312
317
|
toggleFill: themePrimitives.mono300,
|
|
@@ -194,15 +194,15 @@ var _default = function _default() {
|
|
|
194
194
|
tabColor: themePrimitives.mono800,
|
|
195
195
|
// Notification
|
|
196
196
|
notificationPrimaryBackground: themePrimitives.primary50,
|
|
197
|
-
notificationPrimaryText: themePrimitives.
|
|
197
|
+
notificationPrimaryText: themePrimitives.primaryA,
|
|
198
198
|
notificationInfoBackground: themePrimitives.accent50,
|
|
199
|
-
notificationInfoText: themePrimitives.
|
|
199
|
+
notificationInfoText: themePrimitives.primaryA,
|
|
200
200
|
notificationPositiveBackground: themePrimitives.positive50,
|
|
201
|
-
notificationPositiveText: themePrimitives.
|
|
201
|
+
notificationPositiveText: themePrimitives.primaryA,
|
|
202
202
|
notificationWarningBackground: themePrimitives.warning50,
|
|
203
|
-
notificationWarningText: themePrimitives.
|
|
203
|
+
notificationWarningText: themePrimitives.primaryA,
|
|
204
204
|
notificationNegativeBackground: themePrimitives.negative50,
|
|
205
|
-
notificationNegativeText: themePrimitives.
|
|
205
|
+
notificationNegativeText: themePrimitives.primaryA,
|
|
206
206
|
// Tag
|
|
207
207
|
// Custom ramps
|
|
208
208
|
tagFontDisabledRampUnit: '100',
|
|
@@ -361,11 +361,16 @@ var _default = function _default() {
|
|
|
361
361
|
tableFilterFooterBackground: themePrimitives.mono200,
|
|
362
362
|
// Toast
|
|
363
363
|
toastText: themePrimitives.white,
|
|
364
|
-
toastPrimaryBackground: themePrimitives.
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
364
|
+
toastPrimaryBackground: themePrimitives.primary400,
|
|
365
|
+
toastPrimaryText: themePrimitives.white,
|
|
366
|
+
toastInfoBackground: themePrimitives.accent400,
|
|
367
|
+
toastInfoText: themePrimitives.white,
|
|
368
|
+
toastPositiveBackground: themePrimitives.positive400,
|
|
369
|
+
toastPositiveText: themePrimitives.white,
|
|
370
|
+
toastWarningBackground: themePrimitives.warning400,
|
|
371
|
+
toastWarningText: themePrimitives.black,
|
|
372
|
+
toastNegativeBackground: themePrimitives.negative400,
|
|
373
|
+
toastNegativeText: themePrimitives.white,
|
|
369
374
|
// Spinner
|
|
370
375
|
spinnerTrackFill: themePrimitives.mono900,
|
|
371
376
|
// Progress bar
|
|
@@ -215,15 +215,15 @@ export default (
|
|
|
215
215
|
|
|
216
216
|
// Notification
|
|
217
217
|
notificationPrimaryBackground: themePrimitives.primary50,
|
|
218
|
-
notificationPrimaryText: themePrimitives.
|
|
218
|
+
notificationPrimaryText: themePrimitives.primaryA,
|
|
219
219
|
notificationInfoBackground: themePrimitives.accent50,
|
|
220
|
-
notificationInfoText: themePrimitives.
|
|
220
|
+
notificationInfoText: themePrimitives.primaryA,
|
|
221
221
|
notificationPositiveBackground: themePrimitives.positive50,
|
|
222
|
-
notificationPositiveText: themePrimitives.
|
|
222
|
+
notificationPositiveText: themePrimitives.primaryA,
|
|
223
223
|
notificationWarningBackground: themePrimitives.warning50,
|
|
224
|
-
notificationWarningText: themePrimitives.
|
|
224
|
+
notificationWarningText: themePrimitives.primaryA,
|
|
225
225
|
notificationNegativeBackground: themePrimitives.negative50,
|
|
226
|
-
notificationNegativeText: themePrimitives.
|
|
226
|
+
notificationNegativeText: themePrimitives.primaryA,
|
|
227
227
|
|
|
228
228
|
// Tag
|
|
229
229
|
|
|
@@ -392,11 +392,16 @@ export default (
|
|
|
392
392
|
|
|
393
393
|
// Toast
|
|
394
394
|
toastText: themePrimitives.white,
|
|
395
|
-
toastPrimaryBackground: themePrimitives.
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
395
|
+
toastPrimaryBackground: themePrimitives.primary400,
|
|
396
|
+
toastPrimaryText: themePrimitives.white,
|
|
397
|
+
toastInfoBackground: themePrimitives.accent400,
|
|
398
|
+
toastInfoText: themePrimitives.white,
|
|
399
|
+
toastPositiveBackground: themePrimitives.positive400,
|
|
400
|
+
toastPositiveText: themePrimitives.white,
|
|
401
|
+
toastWarningBackground: themePrimitives.warning400,
|
|
402
|
+
toastWarningText: themePrimitives.black,
|
|
403
|
+
toastNegativeBackground: themePrimitives.negative400,
|
|
404
|
+
toastNegativeText: themePrimitives.white,
|
|
400
405
|
|
|
401
406
|
// Spinner
|
|
402
407
|
spinnerTrackFill: themePrimitives.mono900,
|
package/themes/types.js.flow
CHANGED
|
@@ -524,10 +524,15 @@ export type ComponentColorTokensT = {|
|
|
|
524
524
|
// Toast
|
|
525
525
|
toastText: string,
|
|
526
526
|
toastPrimaryBackground: string,
|
|
527
|
+
toastPrimaryText: string,
|
|
527
528
|
toastInfoBackground: string,
|
|
529
|
+
toastInfoText: string,
|
|
528
530
|
toastPositiveBackground: string,
|
|
531
|
+
toastPositiveText: string,
|
|
529
532
|
toastWarningBackground: string,
|
|
533
|
+
toastWarningText: string,
|
|
530
534
|
toastNegativeBackground: string,
|
|
535
|
+
toastNegativeText: string,
|
|
531
536
|
|
|
532
537
|
// Spinner
|
|
533
538
|
spinnerTrackFill: string,
|
|
@@ -25,10 +25,18 @@ function getBackgroundColor(kind, type, theme) {
|
|
|
25
25
|
return (_KIND$info$KIND$posit = {}, _defineProperty(_KIND$info$KIND$posit, _constants.KIND.info, isInline ? theme.colors.notificationInfoBackground : theme.colors.toastInfoBackground), _defineProperty(_KIND$info$KIND$posit, _constants.KIND.positive, isInline ? theme.colors.notificationPositiveBackground : theme.colors.toastPositiveBackground), _defineProperty(_KIND$info$KIND$posit, _constants.KIND.warning, isInline ? theme.colors.notificationWarningBackground : theme.colors.toastWarningBackground), _defineProperty(_KIND$info$KIND$posit, _constants.KIND.negative, isInline ? theme.colors.notificationNegativeBackground : theme.colors.toastNegativeBackground), _KIND$info$KIND$posit)[kind];
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
function getFontColor(kind, theme) {
|
|
29
|
-
var _KIND$info$KIND$
|
|
28
|
+
function getFontColor(kind, type, theme) {
|
|
29
|
+
var _KIND$info$KIND$posit3;
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
var isInline = type === _constants.TYPE.inline;
|
|
32
|
+
|
|
33
|
+
if (isInline) {
|
|
34
|
+
var _KIND$info$KIND$posit2;
|
|
35
|
+
|
|
36
|
+
return (_KIND$info$KIND$posit2 = {}, _defineProperty(_KIND$info$KIND$posit2, _constants.KIND.info, theme.colors.notificationInfoText), _defineProperty(_KIND$info$KIND$posit2, _constants.KIND.positive, theme.colors.notificationPositiveText), _defineProperty(_KIND$info$KIND$posit2, _constants.KIND.warning, theme.colors.notificationWarningText), _defineProperty(_KIND$info$KIND$posit2, _constants.KIND.negative, theme.colors.notificationNegativeText), _KIND$info$KIND$posit2)[kind];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return (_KIND$info$KIND$posit3 = {}, _defineProperty(_KIND$info$KIND$posit3, _constants.KIND.info, theme.colors.toastInfoText), _defineProperty(_KIND$info$KIND$posit3, _constants.KIND.positive, theme.colors.toastPositiveText), _defineProperty(_KIND$info$KIND$posit3, _constants.KIND.warning, theme.colors.toastWarningText), _defineProperty(_KIND$info$KIND$posit3, _constants.KIND.negative, theme.colors.toastNegativeText), _KIND$info$KIND$posit3)[kind];
|
|
32
40
|
}
|
|
33
41
|
|
|
34
42
|
function getPlacement(placement) {
|
|
@@ -96,9 +104,9 @@ var Body = (0, _index.styled)('div', function (props) {
|
|
|
96
104
|
$type = props.$type,
|
|
97
105
|
$theme = props.$theme;
|
|
98
106
|
var isInline = $type === _constants.TYPE.inline;
|
|
99
|
-
return _objectSpread(_objectSpread({}, $theme.typography.
|
|
107
|
+
return _objectSpread(_objectSpread({}, $theme.typography.font300), {}, {
|
|
100
108
|
pointerEvents: 'auto',
|
|
101
|
-
color:
|
|
109
|
+
color: getFontColor($kind, $type, $theme),
|
|
102
110
|
height: 'auto',
|
|
103
111
|
width: '288px',
|
|
104
112
|
paddingTop: $theme.sizing.scale600,
|
|
@@ -40,12 +40,22 @@ function getBackgroundColor(
|
|
|
40
40
|
}[kind];
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
function getFontColor(kind: KindTypeT, theme: ThemeT) {
|
|
43
|
+
function getFontColor(kind: KindTypeT, type: NotificationTypeT, theme: ThemeT) {
|
|
44
|
+
const isInline = type === TYPE.inline;
|
|
45
|
+
if (isInline) {
|
|
46
|
+
return {
|
|
47
|
+
[KIND.info]: theme.colors.notificationInfoText,
|
|
48
|
+
[KIND.positive]: theme.colors.notificationPositiveText,
|
|
49
|
+
[KIND.warning]: theme.colors.notificationWarningText,
|
|
50
|
+
[KIND.negative]: theme.colors.notificationNegativeText,
|
|
51
|
+
}[kind];
|
|
52
|
+
}
|
|
53
|
+
|
|
44
54
|
return {
|
|
45
|
-
[KIND.info]: theme.colors.
|
|
46
|
-
[KIND.positive]: theme.colors.
|
|
47
|
-
[KIND.warning]: theme.colors.
|
|
48
|
-
[KIND.negative]: theme.colors.
|
|
55
|
+
[KIND.info]: theme.colors.toastInfoText,
|
|
56
|
+
[KIND.positive]: theme.colors.toastPositiveText,
|
|
57
|
+
[KIND.warning]: theme.colors.toastWarningText,
|
|
58
|
+
[KIND.negative]: theme.colors.toastNegativeText,
|
|
49
59
|
}[kind];
|
|
50
60
|
}
|
|
51
61
|
|
|
@@ -115,9 +125,9 @@ export const Body = styled<SharedStylePropsArgT>('div', props => {
|
|
|
115
125
|
const {$isVisible, $kind, $type, $theme} = props;
|
|
116
126
|
const isInline = $type === TYPE.inline;
|
|
117
127
|
return {
|
|
118
|
-
...$theme.typography.
|
|
128
|
+
...$theme.typography.font300,
|
|
119
129
|
pointerEvents: 'auto',
|
|
120
|
-
color:
|
|
130
|
+
color: getFontColor($kind, $type, $theme),
|
|
121
131
|
height: 'auto',
|
|
122
132
|
width: '288px',
|
|
123
133
|
paddingTop: $theme.sizing.scale600,
|