@sproutsocial/seeds-react-theme 1.0.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/__flow__/dark/dataviz-palette.flow.js +3 -0
- package/__flow__/dark/decorative-palettes.flow.js +13 -0
- package/__flow__/dark/theme.flow.js +5 -0
- package/__flow__/extendedThemes/sproutTheme/dark/theme.flow.js +10 -0
- package/__flow__/extendedThemes/sproutTheme/index.flow.js +3 -0
- package/__flow__/extendedThemes/sproutTheme/light/theme.flow.js +10 -0
- package/__flow__/index.js +3 -0
- package/__flow__/light/dataviz-palette.flow.js +29 -0
- package/__flow__/light/decorative-palettes.flow.js +17 -0
- package/__flow__/light/literal-colors.flow.js +31 -0
- package/__flow__/light/theme.flow.js +16 -0
- package/__flow__/types/theme.colors.flow.js +358 -0
- package/__flow__/types/theme.flow.js +372 -0
- package/commonjs/dark/dataviz-palette.flow.js +1 -0
- package/commonjs/dark/dataviz-palette.js +33 -0
- package/commonjs/dark/decorative-palettes.flow.js +1 -0
- package/commonjs/dark/decorative-palettes.js +63 -0
- package/commonjs/dark/theme.flow.js +1 -0
- package/commonjs/dark/theme.js +268 -0
- package/commonjs/extendedThemes/sproutTheme/dark/theme.flow.js +7 -0
- package/commonjs/extendedThemes/sproutTheme/dark/theme.js +240 -0
- package/commonjs/extendedThemes/sproutTheme/index.flow.js +20 -0
- package/commonjs/extendedThemes/sproutTheme/index.js +20 -0
- package/commonjs/extendedThemes/sproutTheme/light/theme.flow.js +1 -0
- package/commonjs/extendedThemes/sproutTheme/light/theme.js +237 -0
- package/commonjs/index.js +51 -0
- package/commonjs/index.js.flow +3 -0
- package/commonjs/light/dataviz-palette.flow.js +1 -0
- package/commonjs/light/dataviz-palette.js +33 -0
- package/commonjs/light/decorative-palettes.flow.js +1 -0
- package/commonjs/light/decorative-palettes.js +63 -0
- package/commonjs/light/literal-colors.flow.js +1 -0
- package/commonjs/light/literal-colors.js +167 -0
- package/commonjs/light/theme.flow.js +1 -0
- package/commonjs/light/theme.js +416 -0
- package/commonjs/types/theme.colors.flow.js +1 -0
- package/commonjs/types/theme.colors.js +5 -0
- package/commonjs/types/theme.flow.js +1 -0
- package/commonjs/types/theme.js +5 -0
- package/dist/themes/dark/_themed.scss +119 -0
- package/dist/themes/dark/theme.scss +678 -0
- package/dist/themes/extendedThemes/sproutTheme/dark/_themed.scss +119 -0
- package/dist/themes/extendedThemes/sproutTheme/dark/theme.scss +1091 -0
- package/dist/themes/extendedThemes/sproutTheme/light/_themed.scss +119 -0
- package/dist/themes/extendedThemes/sproutTheme/light/theme.scss +1091 -0
- package/dist/themes/light/_themed.scss +119 -0
- package/dist/themes/light/theme.scss +800 -0
- package/dist/themes/types/_themed.scss +119 -0
- package/dist/types/dark/dataviz-palette.d.ts +26 -0
- package/dist/types/dark/dataviz-palette.d.ts.map +1 -0
- package/dist/types/dark/decorative-palettes.d.ts +56 -0
- package/dist/types/dark/decorative-palettes.d.ts.map +1 -0
- package/dist/types/dark/theme.d.ts +671 -0
- package/dist/types/dark/theme.d.ts.map +1 -0
- package/dist/types/extendedThemes/sproutTheme/dark/theme.d.ts +213 -0
- package/dist/types/extendedThemes/sproutTheme/dark/theme.d.ts.map +1 -0
- package/dist/types/extendedThemes/sproutTheme/index.d.ts +3 -0
- package/dist/types/extendedThemes/sproutTheme/index.d.ts.map +1 -0
- package/dist/types/extendedThemes/sproutTheme/light/theme.d.ts +213 -0
- package/dist/types/extendedThemes/sproutTheme/light/theme.d.ts.map +1 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/light/dataviz-palette.d.ts +26 -0
- package/dist/types/light/dataviz-palette.d.ts.map +1 -0
- package/dist/types/light/decorative-palettes.d.ts +56 -0
- package/dist/types/light/decorative-palettes.d.ts.map +1 -0
- package/dist/types/light/literal-colors.d.ts +160 -0
- package/dist/types/light/literal-colors.d.ts.map +1 -0
- package/dist/types/light/theme.d.ts +794 -0
- package/dist/types/light/theme.d.ts.map +1 -0
- package/dist/types/types/theme.colors.d.ts +292 -0
- package/dist/types/types/theme.colors.d.ts.map +1 -0
- package/dist/types/types/theme.d.ts +43 -0
- package/dist/types/types/theme.d.ts.map +1 -0
- package/lib/dark/dataviz-palette.flow.js +0 -0
- package/lib/dark/dataviz-palette.js +26 -0
- package/lib/dark/decorative-palettes.flow.js +0 -0
- package/lib/dark/decorative-palettes.js +56 -0
- package/lib/dark/theme.flow.js +0 -0
- package/lib/dark/theme.js +263 -0
- package/lib/extendedThemes/sproutTheme/dark/theme.flow.js +1 -0
- package/lib/extendedThemes/sproutTheme/dark/theme.js +235 -0
- package/lib/extendedThemes/sproutTheme/index.flow.js +2 -0
- package/lib/extendedThemes/sproutTheme/index.js +2 -0
- package/lib/extendedThemes/sproutTheme/light/theme.flow.js +0 -0
- package/lib/extendedThemes/sproutTheme/light/theme.js +232 -0
- package/lib/index.js +4 -0
- package/lib/index.js.flow +3 -0
- package/lib/light/dataviz-palette.flow.js +0 -0
- package/lib/light/dataviz-palette.js +26 -0
- package/lib/light/decorative-palettes.flow.js +0 -0
- package/lib/light/decorative-palettes.js +56 -0
- package/lib/light/literal-colors.flow.js +0 -0
- package/lib/light/literal-colors.js +160 -0
- package/lib/light/theme.flow.js +0 -0
- package/lib/light/theme.js +410 -0
- package/lib/types/theme.colors.flow.js +0 -0
- package/lib/types/theme.colors.js +1 -0
- package/lib/types/theme.flow.js +0 -0
- package/lib/types/theme.js +1 -0
- package/package.json +40 -0
|
@@ -0,0 +1,119 @@
|
|
|
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
|
+
// theme.scss is auto-generated based on the JS theme file, ensuring our SCSS theme variables stay in sync.
|
|
6
|
+
// _themed.scss will be copied to each theme folder in /dist, where the theme.scss file for that theme will be.
|
|
7
|
+
@import "./theme.scss";
|
|
8
|
+
|
|
9
|
+
// In the JS theme file, the theme object is exported as "default" (i.e., using "export default"),
|
|
10
|
+
// so we need to map-get "default" to access it.
|
|
11
|
+
$theme: map-get($theme, "default");
|
|
12
|
+
|
|
13
|
+
// FUNCTIONS
|
|
14
|
+
// This function will allow you to get any value from the theme.
|
|
15
|
+
// @param {string} $key - the period-separated path to the value in the theme object. e.g., "colors.text.body"
|
|
16
|
+
@function t($key) {
|
|
17
|
+
$keys: _str-split($key, ".");
|
|
18
|
+
@return _map-deep-get($theme, $keys);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// The rest of the functions are convenience methods to get theme values for subsets of the theme.
|
|
22
|
+
// @param {string} $key - the period-separated path to the value in the theme object, with "colors." omitted. e.g., "text.body"
|
|
23
|
+
@function colors($key) {
|
|
24
|
+
$keys: _str-split($key, ".");
|
|
25
|
+
@return _map-deep-get($theme, join("colors", $keys));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// @param {string} $key - the period-separated path to the value in the theme object, with "typography." omitted. e.g., "100.fontSize"
|
|
29
|
+
@function typography($key) {
|
|
30
|
+
$keys: _str-split($key, ".");
|
|
31
|
+
@return _map-deep-get($theme, join("typography", $keys));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// @param {string} $key - the period-separated path to the value in the theme object, with "fontWeights." omitted. e.g., "normal"
|
|
35
|
+
@function fontWeights($key) {
|
|
36
|
+
$keys: _str-split($key, ".");
|
|
37
|
+
@return _map-deep-get($theme, join("fontWeights", $keys));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// @param {string} $key - the period-separated path to the value in the theme object, with "space." omitted. e.g., "100"
|
|
41
|
+
@function space($key) {
|
|
42
|
+
$keys: _str-split($key, ".");
|
|
43
|
+
@return _map-deep-get($theme, join("space", $keys));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// @param {string} $key - the period-separated path to the value in the theme object, with "radii." omitted. e.g., "inner"
|
|
47
|
+
@function radii($key) {
|
|
48
|
+
$keys: _str-split($key, ".");
|
|
49
|
+
@return _map-deep-get($theme, join("radii", $keys));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// @param {string} $key - the period-separated path to the value in the theme object, with "borders." omitted. e.g., "500"
|
|
53
|
+
@function borders($key) {
|
|
54
|
+
$keys: _str-split($key, ".");
|
|
55
|
+
@return _map-deep-get($theme, join("borders", $keys));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// @param {string} $key - the period-separated path to the value in the theme object, with "borderWidths." omitted. e.g., "500"
|
|
59
|
+
@function borderWidths($key) {
|
|
60
|
+
$keys: _str-split($key, ".");
|
|
61
|
+
@return _map-deep-get($theme, join("borderWidths", $keys));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// @param {string} $key - the period-separated path to the value in the theme object, with "shadows." omitted. e.g., "low"
|
|
65
|
+
@function shadows($key) {
|
|
66
|
+
$keys: _str-split($key, ".");
|
|
67
|
+
@return _map-deep-get($theme, join("shadows", $keys));
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// @param {string} $key - the period-separated path to the value in the theme object, with "easing." omitted. e.g., "ease_in"
|
|
71
|
+
@function easing($key) {
|
|
72
|
+
$keys: _str-split($key, ".");
|
|
73
|
+
@return _map-deep-get($theme, join("easing", $keys));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// @param {string} $key - the period-separated path to the value in the theme object, with "duration." omitted. e.g., "fast"
|
|
77
|
+
@function duration($key) {
|
|
78
|
+
$keys: _str-split($key, ".");
|
|
79
|
+
@return _map-deep-get($theme, join("duration", $keys));
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// UTILITIES
|
|
83
|
+
// Helper functions that power the functions above. Not relevant to the theme.
|
|
84
|
+
// If you import this file with @use, these functions will be excluded because they are private.
|
|
85
|
+
|
|
86
|
+
// Via https://stackoverflow.com/a/42295154
|
|
87
|
+
// Used to split period-separated object keys, e.g. "colors.text.body" => ["colors", "text", "body"]
|
|
88
|
+
// Only works with a single-character separator.
|
|
89
|
+
@function _str-split($string, $separator) {
|
|
90
|
+
// empty array/list
|
|
91
|
+
$split-arr: ();
|
|
92
|
+
// first index of separator in string
|
|
93
|
+
$index: str-index($string, $separator);
|
|
94
|
+
// loop through string
|
|
95
|
+
@while $index != null {
|
|
96
|
+
// get the substring from the first character to the separator
|
|
97
|
+
$item: str-slice($string, 1, $index - 1);
|
|
98
|
+
// push item to array
|
|
99
|
+
$split-arr: append($split-arr, $item);
|
|
100
|
+
// remove item and separator from string
|
|
101
|
+
$string: str-slice($string, $index + 1);
|
|
102
|
+
// find new index of separator
|
|
103
|
+
$index: str-index($string, $separator);
|
|
104
|
+
}
|
|
105
|
+
// add the remaining string to list (the last item)
|
|
106
|
+
$split-arr: append($split-arr, $string);
|
|
107
|
+
|
|
108
|
+
@return $split-arr;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// Adapted from https://css-tricks.com/snippets/sass/deep-getset-maps/
|
|
112
|
+
// Iterates over a list of keys to read multi-level maps.
|
|
113
|
+
// e.g., _map-deep-get((colors: (text: (body: "#364141"))), ["colors", "text", "body"]) => "#364141"
|
|
114
|
+
@function _map-deep-get($map, $keys) {
|
|
115
|
+
@each $key in $keys {
|
|
116
|
+
$map: map-get($map, $key);
|
|
117
|
+
}
|
|
118
|
+
@return $map;
|
|
119
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare const datavizPalette: {
|
|
2
|
+
DATAVIZ_COLORS_LIST: string[];
|
|
3
|
+
DATAVIZ_COLORS_MAP: {
|
|
4
|
+
"1": string;
|
|
5
|
+
"2": string;
|
|
6
|
+
"3": string;
|
|
7
|
+
"4": string;
|
|
8
|
+
"5": string;
|
|
9
|
+
"6": string;
|
|
10
|
+
"7": string;
|
|
11
|
+
"8": string;
|
|
12
|
+
"9": string;
|
|
13
|
+
"10": string;
|
|
14
|
+
"11": string;
|
|
15
|
+
"12": string;
|
|
16
|
+
"13": string;
|
|
17
|
+
"14": string;
|
|
18
|
+
"15": string;
|
|
19
|
+
"16": string;
|
|
20
|
+
"17": string;
|
|
21
|
+
"18": string;
|
|
22
|
+
"19": string;
|
|
23
|
+
"20": string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=dataviz-palette.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataviz-palette.d.ts","sourceRoot":"","sources":["../../../src/dark/dataviz-palette.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;CA6C1B,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export declare const green: {
|
|
2
|
+
background: string;
|
|
3
|
+
highlight: string;
|
|
4
|
+
foreground: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const blue: {
|
|
7
|
+
background: string;
|
|
8
|
+
highlight: string;
|
|
9
|
+
foreground: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const purple: {
|
|
12
|
+
background: string;
|
|
13
|
+
highlight: string;
|
|
14
|
+
foreground: string;
|
|
15
|
+
};
|
|
16
|
+
export declare const yellow: {
|
|
17
|
+
background: string;
|
|
18
|
+
highlight: string;
|
|
19
|
+
foreground: string;
|
|
20
|
+
};
|
|
21
|
+
export declare const orange: {
|
|
22
|
+
background: string;
|
|
23
|
+
highlight: string;
|
|
24
|
+
foreground: string;
|
|
25
|
+
};
|
|
26
|
+
export declare const red: {
|
|
27
|
+
background: string;
|
|
28
|
+
highlight: string;
|
|
29
|
+
foreground: string;
|
|
30
|
+
};
|
|
31
|
+
export declare const neutral: {
|
|
32
|
+
background: string;
|
|
33
|
+
highlight: string;
|
|
34
|
+
foreground: string;
|
|
35
|
+
};
|
|
36
|
+
export declare const magenta: {
|
|
37
|
+
background: string;
|
|
38
|
+
highlight: string;
|
|
39
|
+
foreground: string;
|
|
40
|
+
};
|
|
41
|
+
export declare const pink: {
|
|
42
|
+
background: string;
|
|
43
|
+
highlight: string;
|
|
44
|
+
foreground: string;
|
|
45
|
+
};
|
|
46
|
+
export declare const aqua: {
|
|
47
|
+
background: string;
|
|
48
|
+
highlight: string;
|
|
49
|
+
foreground: string;
|
|
50
|
+
};
|
|
51
|
+
export declare const teal: {
|
|
52
|
+
background: string;
|
|
53
|
+
highlight: string;
|
|
54
|
+
foreground: string;
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=decorative-palettes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decorative-palettes.d.ts","sourceRoot":"","sources":["../../../src/dark/decorative-palettes.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK;;;;CAIjB,CAAC;AAEF,eAAO,MAAM,IAAI;;;;CAIhB,CAAC;AAEF,eAAO,MAAM,MAAM;;;;CAIlB,CAAC;AAEF,eAAO,MAAM,MAAM;;;;CAIlB,CAAC;AAEF,eAAO,MAAM,MAAM;;;;CAIlB,CAAC;AAEF,eAAO,MAAM,GAAG;;;;CAIf,CAAC;AAEF,eAAO,MAAM,OAAO;;;;CAInB,CAAC;AAEF,eAAO,MAAM,OAAO;;;;CAInB,CAAC;AAEF,eAAO,MAAM,IAAI;;;;CAIhB,CAAC;AAEF,eAAO,MAAM,IAAI;;;;CAIhB,CAAC;AAEF,eAAO,MAAM,IAAI;;;;CAIhB,CAAC"}
|