@sproutsocial/racine 9.1.1-theme-extension.0 → 10.0.0-dar97-beta.1
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/CHANGELOG.md +36 -0
- package/__flow__/Box/index.stories.js +1 -1
- package/__flow__/Breadcrumb/styles.js +0 -5
- package/__flow__/Button/styles.js +1 -1
- package/__flow__/Card/index.stories.js +0 -1
- package/__flow__/Card/styles.js +1 -1
- package/__flow__/Drawer/index.stories.js +3 -3
- package/__flow__/Drawer/styles.js +1 -1
- package/__flow__/KeyboardKey/styles.js +1 -1
- package/__flow__/Listbox/__snapshots__/index.test.js.snap +40 -34
- package/__flow__/Menu/__snapshots__/index.test.js.snap +15 -12
- package/__flow__/Menu/index.js +3 -7
- package/__flow__/Menu/index.stories.js +1 -1
- package/__flow__/Menu/styles.js +1 -18
- package/__flow__/Modal/index.test.js +0 -16
- package/__flow__/Modal/styles.js +1 -1
- package/__flow__/Popout/index.js +1 -1
- package/__flow__/Stack/index.js +1 -1
- package/__flow__/ThemeProvider/index.js +4 -4
- package/__flow__/Token/index.js +4 -1
- package/__flow__/Token/index.stories.js +11 -0
- package/__flow__/Token/styles.js +43 -33
- package/__flow__/Tooltip/index.js +1 -1
- package/__flow__/index.js +1 -2
- package/__flow__/themes/dark/_themes.scss +132 -0
- package/__flow__/themes/dark/theme.js +181 -157
- package/__flow__/themes/light/_themes.scss +132 -0
- package/__flow__/themes/{default → light}/dataviz-palette.js +0 -0
- package/__flow__/themes/{default → light}/decorative-palettes.js +0 -0
- package/__flow__/themes/{default → light}/literal-colors.js +0 -0
- package/__flow__/themes/{default → light}/theme.js +19 -8
- package/__flow__/themes/utils/interact.js +12 -0
- package/__flow__/types/system-props.flow.js +1 -2
- package/__flow__/types/theme.colors.flow.js +1 -1
- package/__flow__/types/theme.flow.js +2 -2
- package/__flow__/utils/mixins.js +1 -1
- package/__flow__/utils/responsiveProps/index.js +1 -1
- package/commonjs/Breadcrumb/styles.js +1 -1
- package/commonjs/Button/styles.js +1 -1
- package/commonjs/Card/styles.js +1 -1
- package/commonjs/Drawer/styles.js +1 -1
- package/commonjs/KeyboardKey/styles.js +1 -1
- package/commonjs/Menu/index.js +3 -1
- package/commonjs/Menu/styles.js +3 -16
- package/commonjs/Modal/styles.js +1 -1
- package/commonjs/Popout/index.js +1 -1
- package/commonjs/ThemeProvider/index.js +1 -1
- package/commonjs/Token/index.js +5 -2
- package/commonjs/Token/styles.js +19 -50
- package/commonjs/Tooltip/index.js +1 -1
- package/commonjs/index.js +2 -6
- package/commonjs/themes/dark/theme.js +180 -155
- package/commonjs/themes/{default → light}/dataviz-palette.js +0 -0
- package/commonjs/themes/{default → light}/decorative-palettes.js +0 -0
- package/commonjs/themes/{default → light}/literal-colors.js +0 -0
- package/commonjs/themes/{default → light}/theme.js +19 -8
- package/commonjs/themes/utils/interact.js +19 -0
- package/commonjs/types/theme.colors.flow.js +1 -1
- package/commonjs/types/theme.flow.js +1 -1
- package/commonjs/utils/mixins.js +1 -1
- package/commonjs/utils/responsiveProps/index.js +1 -1
- package/dist/themes/dark/_themes.scss +132 -0
- package/dist/themes/dark/dark.scss +601 -0
- package/dist/themes/light/_themes.scss +132 -0
- package/dist/themes/light/light.scss +692 -0
- package/lib/Breadcrumb/styles.js +1 -1
- package/lib/Button/styles.js +1 -1
- package/lib/Card/styles.js +1 -1
- package/lib/Drawer/styles.js +1 -1
- package/lib/KeyboardKey/styles.js +1 -1
- package/lib/Menu/index.js +4 -2
- package/lib/Menu/styles.js +2 -13
- package/lib/Modal/styles.js +1 -1
- package/lib/Popout/index.js +1 -1
- package/lib/ThemeProvider/index.js +1 -1
- package/lib/Token/index.js +5 -2
- package/lib/Token/styles.js +19 -50
- package/lib/Tooltip/index.js +1 -1
- package/lib/index.js +1 -2
- package/lib/themes/dark/theme.js +175 -154
- package/lib/themes/{default → light}/dataviz-palette.js +0 -0
- package/lib/themes/{default → light}/decorative-palettes.js +0 -0
- package/lib/themes/{default → light}/literal-colors.js +0 -0
- package/lib/themes/{default → light}/theme.js +18 -8
- package/lib/themes/utils/interact.js +13 -0
- package/lib/types/theme.colors.flow.js +1 -1
- package/lib/types/theme.flow.js +1 -1
- package/lib/utils/mixins.js +1 -1
- package/lib/utils/responsiveProps/index.js +1 -1
- package/package.json +7 -10
- package/__flow__/CustomThemeProvider/index.js +0 -16
- package/__flow__/Modal/__snapshots__/index.test.js.snap +0 -80
- package/__flow__/themes/sprout/theme.js +0 -22
- package/__flow__/utils/extendTheme.js +0 -17
- package/commonjs/CustomThemeProvider/index.js +0 -23
- package/commonjs/themes/sprout/theme.js +0 -29
- package/commonjs/utils/extendTheme.js +0 -22
- package/lib/CustomThemeProvider/index.js +0 -12
- package/lib/themes/sprout/theme.js +0 -19
- package/lib/utils/extendTheme.js +0 -12
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
// Inspired by https://medium.com/@katiemctigue/how-to-create-a-dark-mode-in-sass-609f131a3995
|
|
2
|
+
// This file is excluded from stylelint, because stylelint is only set up to lint styled-components at the moment.
|
|
3
|
+
|
|
4
|
+
// SET-UP
|
|
5
|
+
// These files are auto-generated based on JS theme files, ensuring our SCSS theme variables stay in sync.
|
|
6
|
+
@import "../../../dist/themes/light/light.scss";
|
|
7
|
+
|
|
8
|
+
// In the JS theme files, the theme object is exported as "default" (i.e., using "export default"),
|
|
9
|
+
// so we need to map-get "default" to access it.
|
|
10
|
+
$theme: map-get($light, 'default');
|
|
11
|
+
|
|
12
|
+
// MIXIN
|
|
13
|
+
// CSS properties that are theme-dependent must be wrapped in this mixin
|
|
14
|
+
@mixin themed() {
|
|
15
|
+
& {
|
|
16
|
+
$theme-map: () !global;
|
|
17
|
+
@each $key, $submap in $theme {
|
|
18
|
+
$value: map-get($theme, "#{$key}");
|
|
19
|
+
$theme-map: map-merge($theme-map, ($key: $value)) !global;
|
|
20
|
+
}
|
|
21
|
+
@content;
|
|
22
|
+
$theme-map: null !global;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// FUNCTIONS
|
|
27
|
+
// This function will allow you to get any value from the theme.
|
|
28
|
+
// @param {string} $key - the period-separated path to the value in the theme object. e.g., "colors.text.body"
|
|
29
|
+
@function t($key) {
|
|
30
|
+
$keys: _str-split($key, ".");
|
|
31
|
+
@return _map-deep-get($theme-map, $keys);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// The rest of the functions are convenience methods to get theme values for subsets of the theme.
|
|
35
|
+
// @param {string} $key - the period-separated path to the value in the theme object, with "colors." omitted. e.g., "text.body"
|
|
36
|
+
@function colors($key) {
|
|
37
|
+
$keys: _str-split($key, ".");
|
|
38
|
+
@return _map-deep-get($theme-map, join("colors", $keys));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// @param {string} $key - the period-separated path to the value in the theme object, with "typography." omitted. e.g., "100.fontSize"
|
|
42
|
+
@function typography($key) {
|
|
43
|
+
$keys: _str-split($key, ".");
|
|
44
|
+
@return _map-deep-get($theme-map, join("typography", $keys));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// @param {string} $key - the period-separated path to the value in the theme object, with "fontWeights." omitted. e.g., "normal"
|
|
48
|
+
@function fontWeights($key) {
|
|
49
|
+
$keys: _str-split($key, ".");
|
|
50
|
+
@return _map-deep-get($theme-map, join("fontWeights", $keys));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// @param {string} $key - the period-separated path to the value in the theme object, with "space." omitted. e.g., "100"
|
|
54
|
+
@function space($key) {
|
|
55
|
+
$keys: _str-split($key, ".");
|
|
56
|
+
@return _map-deep-get($theme-map, join("space", $keys));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// @param {string} $key - the period-separated path to the value in the theme object, with "radii." omitted. e.g., "inner"
|
|
60
|
+
@function radii($key) {
|
|
61
|
+
$keys: _str-split($key, ".");
|
|
62
|
+
@return _map-deep-get($theme-map, join("radii", $keys));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// @param {string} $key - the period-separated path to the value in the theme object, with "borders." omitted. e.g., "500"
|
|
66
|
+
@function borders($key) {
|
|
67
|
+
$keys: _str-split($key, ".");
|
|
68
|
+
@return _map-deep-get($theme-map, join("borders", $keys));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// @param {string} $key - the period-separated path to the value in the theme object, with "borderWidths." omitted. e.g., "500"
|
|
72
|
+
@function borderWidths($key) {
|
|
73
|
+
$keys: _str-split($key, ".");
|
|
74
|
+
@return _map-deep-get($theme-map, join("borderWidths", $keys));
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// @param {string} $key - the period-separated path to the value in the theme object, with "shadows." omitted. e.g., "low"
|
|
78
|
+
@function shadows($key) {
|
|
79
|
+
$keys: _str-split($key, ".");
|
|
80
|
+
@return _map-deep-get($theme-map, join("shadows", $keys));
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// @param {string} $key - the period-separated path to the value in the theme object, with "easing." omitted. e.g., "ease_in"
|
|
84
|
+
@function easing($key) {
|
|
85
|
+
$keys: _str-split($key, ".");
|
|
86
|
+
@return _map-deep-get($theme-map, join("easing", $keys));
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// @param {string} $key - the period-separated path to the value in the theme object, with "duration." omitted. e.g., "fast"
|
|
90
|
+
@function duration($key) {
|
|
91
|
+
$keys: _str-split($key, ".");
|
|
92
|
+
@return _map-deep-get($theme-map, join("duration", $keys));
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// UTILITIES
|
|
96
|
+
// Helper functions that power the functions above. Not relevant to the theme.
|
|
97
|
+
// If you import this file with @use, these functions will be excluded because they are private.
|
|
98
|
+
|
|
99
|
+
// Via https://stackoverflow.com/a/42295154
|
|
100
|
+
// Used to split period-separated object keys, e.g. "colors.text.body" => ["colors", "text", "body"]
|
|
101
|
+
// Only works with a single-character separator.
|
|
102
|
+
@function _str-split($string, $separator) {
|
|
103
|
+
// empty array/list
|
|
104
|
+
$split-arr: ();
|
|
105
|
+
// first index of separator in string
|
|
106
|
+
$index : str-index($string, $separator);
|
|
107
|
+
// loop through string
|
|
108
|
+
@while $index != null {
|
|
109
|
+
// get the substring from the first character to the separator
|
|
110
|
+
$item: str-slice($string, 1, $index - 1);
|
|
111
|
+
// push item to array
|
|
112
|
+
$split-arr: append($split-arr, $item);
|
|
113
|
+
// remove item and separator from string
|
|
114
|
+
$string: str-slice($string, $index + 1);
|
|
115
|
+
// find new index of separator
|
|
116
|
+
$index : str-index($string, $separator);
|
|
117
|
+
}
|
|
118
|
+
// add the remaining string to list (the last item)
|
|
119
|
+
$split-arr: append($split-arr, $string);
|
|
120
|
+
|
|
121
|
+
@return $split-arr;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Adapted from https://css-tricks.com/snippets/sass/deep-getset-maps/
|
|
125
|
+
// Iterates over a list of keys to read multi-level maps.
|
|
126
|
+
// e.g., _map-deep-get((colors: (text: (body: "#364141"))), ["colors", "text", "body"]) => "#364141"
|
|
127
|
+
@function _map-deep-get($map, $keys) {
|
|
128
|
+
@each $key in $keys {
|
|
129
|
+
$map: map-get($map, $key);
|
|
130
|
+
}
|
|
131
|
+
@return $map;
|
|
132
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -19,8 +19,12 @@ import DEPTH from "@sproutsocial/seeds-depth";
|
|
|
19
19
|
import MOTION from "@sproutsocial/seeds-motion";
|
|
20
20
|
import BORDER from "@sproutsocial/seeds-border";
|
|
21
21
|
|
|
22
|
+
import interact from "../utils/interact";
|
|
23
|
+
|
|
22
24
|
export const breakpoints = ["900px", "1200px", "1500px", "1800px"];
|
|
23
25
|
|
|
26
|
+
const MODE = "default-light";
|
|
27
|
+
|
|
24
28
|
const colors = {
|
|
25
29
|
app: {
|
|
26
30
|
background: {
|
|
@@ -194,6 +198,9 @@ const colors = {
|
|
|
194
198
|
selected: COLORS.COLOR_NEUTRAL_800,
|
|
195
199
|
},
|
|
196
200
|
},
|
|
201
|
+
elevation: {
|
|
202
|
+
base: `${COLORS.COLOR_NEUTRAL_900}3D`,
|
|
203
|
+
},
|
|
197
204
|
network: {
|
|
198
205
|
twitter: NETWORKCOLORS.NETWORK_COLOR_TWITTER,
|
|
199
206
|
twitter_like: NETWORKCOLORS.NETWORK_COLOR_TWITTER_LIKE,
|
|
@@ -223,6 +230,10 @@ const colors = {
|
|
|
223
230
|
whatsapp: NETWORKCOLORS.NETWORK_COLOR_WHATSAPP,
|
|
224
231
|
tiktok: NETWORKCOLORS.NETWORK_COLOR_TIKTOK,
|
|
225
232
|
},
|
|
233
|
+
dataviz: {
|
|
234
|
+
map: datavizPalette.DATAVIZ_COLORS_MAP,
|
|
235
|
+
list: datavizPalette.DATAVIZ_COLORS_LIST,
|
|
236
|
+
},
|
|
226
237
|
...literalColors,
|
|
227
238
|
...datavizPalette,
|
|
228
239
|
};
|
|
@@ -296,10 +307,9 @@ export const borderWidths = {
|
|
|
296
307
|
};
|
|
297
308
|
|
|
298
309
|
export const shadows = {
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
"400": DEPTH.ELEVATION_LEVEL_400,
|
|
310
|
+
low: `${DEPTH.ELEVATION_LEVEL_100} ${COLORS.COLOR_NEUTRAL_900}3D`,
|
|
311
|
+
medium: `${DEPTH.ELEVATION_LEVEL_300} ${COLORS.COLOR_NEUTRAL_900}3D`,
|
|
312
|
+
high: `${DEPTH.ELEVATION_LEVEL_400} ${COLORS.COLOR_NEUTRAL_900}3D`,
|
|
303
313
|
};
|
|
304
314
|
|
|
305
315
|
export const easing = {
|
|
@@ -315,6 +325,9 @@ export const duration = {
|
|
|
315
325
|
};
|
|
316
326
|
|
|
317
327
|
const theme = {
|
|
328
|
+
utils: {
|
|
329
|
+
interact: interact(MODE),
|
|
330
|
+
},
|
|
318
331
|
breakpoints,
|
|
319
332
|
colors,
|
|
320
333
|
typography: {
|
|
@@ -338,12 +351,10 @@ const theme = {
|
|
|
338
351
|
},
|
|
339
352
|
borders,
|
|
340
353
|
borderWidths,
|
|
341
|
-
shadows
|
|
342
|
-
...shadows,
|
|
343
|
-
shadows,
|
|
344
|
-
},
|
|
354
|
+
shadows,
|
|
345
355
|
easing,
|
|
346
356
|
duration,
|
|
357
|
+
mode: MODE,
|
|
347
358
|
};
|
|
348
359
|
|
|
349
360
|
export default theme;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//@flow strict-local
|
|
2
|
+
import { darken, lighten } from "polished";
|
|
3
|
+
|
|
4
|
+
const interact = (mode: string) => (themeValue: string) => {
|
|
5
|
+
if (mode === "default-dark") {
|
|
6
|
+
return lighten(0.2, themeValue);
|
|
7
|
+
} else {
|
|
8
|
+
return darken(0.2, themeValue);
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default interact;
|
|
@@ -67,7 +67,6 @@ export type TypeSystemCommonProps = $ReadOnly<{|
|
|
|
67
67
|
...TypeSpaceProps,
|
|
68
68
|
cursor?: TypeResponsiveBase<>,
|
|
69
69
|
|}>;
|
|
70
|
-
|
|
71
70
|
export type TypeSystemBorderProps = $ReadOnly<{|
|
|
72
71
|
border?: TypeResponsiveBase<>,
|
|
73
72
|
borderWidth?: TypeResponsiveBase<>,
|
|
@@ -85,7 +84,7 @@ export type TypeSystemBorderProps = $ReadOnly<{|
|
|
|
85
84
|
borderX?: TypeResponsiveBase<>,
|
|
86
85
|
borderY?: TypeResponsiveBase<>,
|
|
87
86
|
boxShadow?: TypeResponsiveBase<>,
|
|
88
|
-
textShadow?: TypeResponsiveBase
|
|
87
|
+
textShadow?: TypeResponsiveBase<>
|
|
89
88
|
|}>;
|
|
90
89
|
|
|
91
90
|
type TypeResponsiveTypeographySize = TypeResponsiveString<TypeTypography>;
|
|
@@ -10,9 +10,9 @@ import {
|
|
|
10
10
|
space,
|
|
11
11
|
easing,
|
|
12
12
|
duration,
|
|
13
|
-
} from "../themes/
|
|
13
|
+
} from "../themes/light/theme";
|
|
14
14
|
import type { TypeColors } from "./theme.colors.flow.js";
|
|
15
|
-
import type { TypeFontFamilyString } from "../themes/
|
|
15
|
+
import type { TypeFontFamilyString } from "../themes/light/theme";
|
|
16
16
|
|
|
17
17
|
export type TypeBreakpoint = typeof breakpoints;
|
|
18
18
|
export type TypeTypography = typeof typography;
|
package/__flow__/utils/mixins.js
CHANGED
|
@@ -10,7 +10,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
10
10
|
var Nav = _styledComponents.default.nav.withConfig({
|
|
11
11
|
displayName: "styles__Nav",
|
|
12
12
|
componentId: "sc-1ub1apc-0"
|
|
13
|
-
})(["ol{", ";margin:0;font-family:", ";padding:0;display:flex;}li{margin-right:", ";display:flex;}a,button{", ";max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;&:not(.overflow--menu){margin:0;padding:0;}}ol > div + li::before{content:\"/\";margin-right:", ";}li:last-child a,li:last-child button{color:", ";font-weight:bold;}li:not(:last-child)
|
|
13
|
+
})(["ol{", ";margin:0;font-family:", ";padding:0;display:flex;}li{margin-right:", ";display:flex;}a,button{", ";max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;&:not(.overflow--menu){margin:0;padding:0;}}ol > div + li::before{content:\"/\";margin-right:", ";}li:last-child a,li:last-child button{color:", ";font-weight:bold;}li:not(:last-child)::after{content:\"/\";color:", ";margin-left:", ";}"], function (props) {
|
|
14
14
|
return props.theme.typography[200];
|
|
15
15
|
}, function (props) {
|
|
16
16
|
return props.theme.fontFamily;
|
|
@@ -47,7 +47,7 @@ var Container = _styledComponents.default.button.withConfig({
|
|
|
47
47
|
}, function (props) {
|
|
48
48
|
return props.theme.colors.button[props.appearance].background.hover;
|
|
49
49
|
}, function (props) {
|
|
50
|
-
return props.appearance === "placeholder" ? props.theme.shadows
|
|
50
|
+
return props.appearance === "placeholder" ? props.theme.shadows.low : "none";
|
|
51
51
|
}, function (props) {
|
|
52
52
|
return props.theme.colors.button[props.appearance].text.hover;
|
|
53
53
|
}, function (props) {
|
package/commonjs/Card/styles.js
CHANGED
|
@@ -19,7 +19,7 @@ var Container = (0, _styledComponents.default)(_Box.default).withConfig({
|
|
|
19
19
|
}, function (props) {
|
|
20
20
|
return props.theme.radii[500];
|
|
21
21
|
}, function (props) {
|
|
22
|
-
return props.theme.shadows
|
|
22
|
+
return props.theme.shadows.low;
|
|
23
23
|
}, function (props) {
|
|
24
24
|
return props.theme.duration.medium;
|
|
25
25
|
}, function (props) {
|
|
@@ -29,7 +29,7 @@ var Container = _styledComponents.default.div.withConfig({
|
|
|
29
29
|
}, function (props) {
|
|
30
30
|
return props.theme.colors.container.background.base;
|
|
31
31
|
}, function (props) {
|
|
32
|
-
return props.theme.shadows
|
|
32
|
+
return props.theme.shadows.high;
|
|
33
33
|
}, function (props) {
|
|
34
34
|
return (0, _styledComponents.css)(["", ":", "px;"], props.direction, props.offset);
|
|
35
35
|
}, _systemProps.COMMON);
|
|
@@ -21,7 +21,7 @@ var Container = _styledComponents.default.div.withConfig({
|
|
|
21
21
|
}, function (props) {
|
|
22
22
|
return props.theme.radii[500];
|
|
23
23
|
}, function (props) {
|
|
24
|
-
return props.theme.shadows
|
|
24
|
+
return props.theme.shadows.low;
|
|
25
25
|
}, function (props) {
|
|
26
26
|
return props.theme.space[200];
|
|
27
27
|
}, _systemProps.COMMON);
|
package/commonjs/Menu/index.js
CHANGED
|
@@ -277,7 +277,9 @@ var MenuGroup = function MenuGroup(_ref2) {
|
|
|
277
277
|
mt: 350,
|
|
278
278
|
color: "text.headline",
|
|
279
279
|
_css: isDisabled && _mixins.disabled
|
|
280
|
-
}, title)), /*#__PURE__*/React.createElement(
|
|
280
|
+
}, title)), /*#__PURE__*/React.createElement(_Box.default, _extends({}, props, {
|
|
281
|
+
m: 300,
|
|
282
|
+
p: 300,
|
|
281
283
|
role: "group"
|
|
282
284
|
}), children));
|
|
283
285
|
};
|
package/commonjs/Menu/styles.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.
|
|
4
|
+
exports.MenuItemsContainer = exports.MenuItemContainer = void 0;
|
|
5
5
|
|
|
6
6
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
7
7
|
|
|
@@ -56,21 +56,8 @@ var MenuItemContainer = (0, _styledComponents.default)(_Box.default).withConfig(
|
|
|
56
56
|
return props.disabled && _mixins.disabled;
|
|
57
57
|
});
|
|
58
58
|
exports.MenuItemContainer = MenuItemContainer;
|
|
59
|
-
var MenuGroupContainer = (0, _styledComponents.default)(_Box.default).withConfig({
|
|
60
|
-
displayName: "styles__MenuGroupContainer",
|
|
61
|
-
componentId: "fjvae4-1"
|
|
62
|
-
})(["", ";"], function (props) {
|
|
63
|
-
return props.appearance === "flush" ? (0, _styledComponents.css)(["margin:0 -", ";"], function (props) {
|
|
64
|
-
return props.theme.space[300];
|
|
65
|
-
}) : (0, _styledComponents.css)(["padding:", ";"], function (props) {
|
|
66
|
-
return props.theme.space[300];
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
exports.MenuGroupContainer = MenuGroupContainer;
|
|
70
59
|
var MenuItemsContainer = (0, _styledComponents.default)(_Box.default).withConfig({
|
|
71
60
|
displayName: "styles__MenuItemsContainer",
|
|
72
|
-
componentId: "fjvae4-
|
|
61
|
+
componentId: "fjvae4-1"
|
|
73
62
|
})(["list-style-type:none;outline:0;"]);
|
|
74
|
-
exports.MenuItemsContainer = MenuItemsContainer;
|
|
75
|
-
var _default = MenuGroupContainer;
|
|
76
|
-
exports.default = _default;
|
|
63
|
+
exports.MenuItemsContainer = MenuItemsContainer;
|
package/commonjs/Modal/styles.js
CHANGED
|
@@ -72,7 +72,7 @@ var Container = (0, _styledComponents.default)(ReactModalAdapter).withConfig({
|
|
|
72
72
|
}, function (props) {
|
|
73
73
|
return props.theme.radii[500];
|
|
74
74
|
}, function (props) {
|
|
75
|
-
return props.theme.shadows
|
|
75
|
+
return props.theme.shadows.medium;
|
|
76
76
|
}, function (props) {
|
|
77
77
|
return props.theme.colors.text.body;
|
|
78
78
|
}, BODY_PADDING, BODY_PADDING, BODY_PADDING, _styledSystem.width, _systemProps.COMMON);
|
package/commonjs/Popout/index.js
CHANGED
|
@@ -7,7 +7,7 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
7
7
|
|
|
8
8
|
var _styledComponents = require("styled-components");
|
|
9
9
|
|
|
10
|
-
var _theme = _interopRequireDefault(require("../themes/
|
|
10
|
+
var _theme = _interopRequireDefault(require("../themes/light/theme"));
|
|
11
11
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
|
package/commonjs/Token/index.js
CHANGED
|
@@ -33,14 +33,17 @@ var Token = function Token(_ref) {
|
|
|
33
33
|
valid = _ref$valid === void 0 ? true : _ref$valid,
|
|
34
34
|
_ref$disabled = _ref.disabled,
|
|
35
35
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
36
|
-
|
|
36
|
+
_ref$palette = _ref.palette,
|
|
37
|
+
palette = _ref$palette === void 0 ? "neutral" : _ref$palette,
|
|
38
|
+
rest = _objectWithoutPropertiesLoose(_ref, ["children", "closeable", "onClick", "qa", "valid", "disabled", "palette"]);
|
|
37
39
|
|
|
38
40
|
var textContainer = (0, _hooks.useTextContent)("");
|
|
39
41
|
return /*#__PURE__*/React.createElement(_styles.default, _extends({
|
|
40
42
|
ref: textContainer,
|
|
41
43
|
valid: valid,
|
|
42
|
-
|
|
44
|
+
palette: palette,
|
|
43
45
|
type: closeable || onClick ? "button" : undefined,
|
|
46
|
+
as: closeable || onClick ? "button" : "div",
|
|
44
47
|
closeable: closeable || onClick,
|
|
45
48
|
disabled: disabled,
|
|
46
49
|
onClick: onClick,
|
package/commonjs/Token/styles.js
CHANGED
|
@@ -16,56 +16,25 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
16
16
|
var Container = _styledComponents.default.button.withConfig({
|
|
17
17
|
displayName: "styles__Container",
|
|
18
18
|
componentId: "nyn5zy-0"
|
|
19
|
-
})(["
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
},
|
|
38
|
-
return props.theme.duration.fast;
|
|
39
|
-
}, function (props) {
|
|
40
|
-
return props.theme.easing.ease_inout;
|
|
41
|
-
}, _mixins.focusRing, function (props) {
|
|
42
|
-
return props.closeable && (0, _styledComponents.css)(["cursor:pointer;&:hover,&:active{color:", ";border:1px solid ", ";background-color:", ";}"], function (props) {
|
|
43
|
-
return props.theme.colors.text.body;
|
|
44
|
-
}, function (props) {
|
|
45
|
-
return props.theme.colors.container.border.decorative.neutral;
|
|
46
|
-
}, function (props) {
|
|
47
|
-
return props.theme.colors.container.background.decorative.neutral;
|
|
48
|
-
});
|
|
49
|
-
}, function (props) {
|
|
50
|
-
return props.disabled && (0, _styledComponents.css)(["opacity:0.4;cursor:not-allowed;&:hover,&:active{background:", ";border:1px solid ", ";}"], function (props) {
|
|
51
|
-
return props.theme.colors.container.background.base;
|
|
52
|
-
}, function (props) {
|
|
53
|
-
return props.theme.colors.container.border.base;
|
|
54
|
-
});
|
|
55
|
-
}, function (props) {
|
|
56
|
-
return !props.valid && (0, _styledComponents.css)(["color:", ";border-color:", ";background:", ";&:hover{color:", ";border:1px solid ", ";background-color:", ";}"], function (props) {
|
|
57
|
-
return props.theme.colors.text.body;
|
|
58
|
-
}, function (props) {
|
|
59
|
-
return props.theme.colors.container.border.error;
|
|
60
|
-
}, function (props) {
|
|
61
|
-
return props.theme.colors.container.background.error;
|
|
62
|
-
}, function (props) {
|
|
63
|
-
return props.theme.colors.text.body;
|
|
64
|
-
}, function (props) {
|
|
65
|
-
return props.theme.colors.container.border.error;
|
|
66
|
-
}, function (props) {
|
|
67
|
-
return props.theme.colors.container.background.error;
|
|
68
|
-
});
|
|
19
|
+
})(["position:relative;display:inline-block;margin:0;line-height:1;vertical-align:middle;outline:none;", " &:focus{", "}", " ", " ", " ", " ", ""], function (_ref) {
|
|
20
|
+
var theme = _ref.theme;
|
|
21
|
+
return (0, _styledComponents.css)(["", " font-family:", ";font-weight:", ";border:1px solid ", ";border-radius:", ";color:", ";background:", ";padding:", " ", ";transition:all ", " ", ";"], theme.typography[200], theme.fontFamily, theme.fontWeights.normal, theme.colors.container.border.base, theme.radii[500], theme.colors.text.body, theme.colors.container.background.base, theme.space[200], theme.space[300], theme.duration.fast, theme.easing.ease_inout);
|
|
22
|
+
}, _mixins.focusRing, function (_ref2) {
|
|
23
|
+
var theme = _ref2.theme,
|
|
24
|
+
palette = _ref2.palette;
|
|
25
|
+
return palette === "blue" && (0, _styledComponents.css)(["color:", ";background:", ";border:1px solid ", ";&:hover,&:active{cursor:pointer;box-shadow:", ";border:1px solid ", ";}"], theme.colors.text.body, theme.colors.container.background.decorative.blue, theme.colors.container.border.decorative.blue, theme.shadows.low, theme.utils.interact(theme.colors.container.border.decorative.blue));
|
|
26
|
+
}, function (_ref3) {
|
|
27
|
+
var closeable = _ref3.closeable,
|
|
28
|
+
theme = _ref3.theme;
|
|
29
|
+
return closeable && (0, _styledComponents.css)(["cursor:pointer;&:hover,&:active{box-shadow:", ";border:1px solid ", ";}"], theme.shadows.low, theme.utils.interact(theme.colors.container.border.base));
|
|
30
|
+
}, function (_ref4) {
|
|
31
|
+
var disabled = _ref4.disabled,
|
|
32
|
+
theme = _ref4.theme;
|
|
33
|
+
return disabled && (0, _styledComponents.css)(["opacity:0.4;cursor:not-allowed;&:hover,&:active{box-shadow:none;border:1px solid ", ";}"], theme.colors.container.border.base);
|
|
34
|
+
}, function (_ref5) {
|
|
35
|
+
var valid = _ref5.valid,
|
|
36
|
+
theme = _ref5.theme;
|
|
37
|
+
return !valid && (0, _styledComponents.css)(["color:", ";background:", ";border:1px solid ", ";&:hover{box-shadow:", ";border:1px solid ", ";}"], theme.colors.text.error, theme.colors.container.background.error, theme.colors.container.border.error, theme.shadows.low, theme.utils.interact(theme.colors.container.border.error));
|
|
69
38
|
}, _systemProps.COMMON);
|
|
70
39
|
|
|
71
40
|
var _default = Container;
|
|
@@ -132,7 +132,7 @@ var Content = function Content(_ref2) {
|
|
|
132
132
|
m: 200,
|
|
133
133
|
color: "text.body",
|
|
134
134
|
bg: "container.background.base",
|
|
135
|
-
boxShadow:
|
|
135
|
+
boxShadow: "medium",
|
|
136
136
|
border: 500,
|
|
137
137
|
borderColor: "container.border.base" // $FlowIssue - upgrade v0.112.0
|
|
138
138
|
|
package/commonjs/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.VisuallyHidden = exports.DateRangePicker = exports.SingleDatePicker = exports.ListboxButton = exports.MenuItemContainer = exports.MenuButtonContext = exports.MenuButton = exports.toast = exports.OverflowList = exports.Listbox = exports.Menu = exports.ToastContainer = exports.Skeleton = exports.Breadcrumb = exports.Avatar = exports.Stack = exports.Message = exports.Fieldset = exports.FormField = exports.EmptyState = exports.SegmentedControl = exports.Collapsible = exports.Numeral = exports.LoaderButton = exports.Drawer = exports.Tooltip = exports.
|
|
4
|
+
exports.VisuallyHidden = exports.DateRangePicker = exports.SingleDatePicker = exports.ListboxButton = exports.MenuItemContainer = exports.MenuButtonContext = exports.MenuButton = exports.toast = exports.OverflowList = exports.Listbox = exports.Menu = exports.ToastContainer = exports.Skeleton = exports.Breadcrumb = exports.Avatar = exports.Stack = exports.Message = exports.Fieldset = exports.FormField = exports.EmptyState = exports.SegmentedControl = exports.Collapsible = exports.Numeral = exports.LoaderButton = exports.Drawer = exports.Tooltip = exports.ThemeProvider = exports.Popout = exports.Modal = exports.Tabs = exports.TokenInput = exports.Token = exports.Switch = exports.Link = exports.Button = exports.Select = exports.Input = exports.Label = exports.Box = exports.TableRowAccordion = exports.TableHeaderCell = exports.TableCell = exports.Table = exports.ChartLegend = exports.KeyboardKey = exports.Image = exports.Text = exports.Loader = exports.ToggleHint = exports.Textarea = exports.Radio = exports.Checkbox = exports.CharacterCounter = exports.Card = exports.Indicator = exports.Badge = exports.Banner = exports.Alert = exports.Icon = exports.darkTheme = exports.theme = exports.useTextContent = exports.useMultiselect = exports.useSelect = exports.disabled = exports.focusRing = exports.visuallyHidden = void 0;
|
|
5
5
|
|
|
6
6
|
var _mixins = require("./utils/mixins");
|
|
7
7
|
|
|
@@ -15,7 +15,7 @@ exports.useSelect = _hooks.useSelect;
|
|
|
15
15
|
exports.useMultiselect = _hooks.useMultiselect;
|
|
16
16
|
exports.useTextContent = _hooks.useTextContent;
|
|
17
17
|
|
|
18
|
-
var _theme = _interopRequireDefault(require("./themes/
|
|
18
|
+
var _theme = _interopRequireDefault(require("./themes/light/theme"));
|
|
19
19
|
|
|
20
20
|
exports.theme = _theme.default;
|
|
21
21
|
|
|
@@ -152,10 +152,6 @@ var _ThemeProvider = _interopRequireDefault(require("./ThemeProvider"));
|
|
|
152
152
|
|
|
153
153
|
exports.ThemeProvider = _ThemeProvider.default;
|
|
154
154
|
|
|
155
|
-
var _CustomThemeProvider = _interopRequireDefault(require("./CustomThemeProvider"));
|
|
156
|
-
|
|
157
|
-
exports.CustomThemeProvider = _CustomThemeProvider.default;
|
|
158
|
-
|
|
159
155
|
var _Tooltip = _interopRequireDefault(require("./Tooltip"));
|
|
160
156
|
|
|
161
157
|
exports.Tooltip = _Tooltip.default;
|