@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.
Files changed (100) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/__flow__/Box/index.stories.js +1 -1
  3. package/__flow__/Breadcrumb/styles.js +0 -5
  4. package/__flow__/Button/styles.js +1 -1
  5. package/__flow__/Card/index.stories.js +0 -1
  6. package/__flow__/Card/styles.js +1 -1
  7. package/__flow__/Drawer/index.stories.js +3 -3
  8. package/__flow__/Drawer/styles.js +1 -1
  9. package/__flow__/KeyboardKey/styles.js +1 -1
  10. package/__flow__/Listbox/__snapshots__/index.test.js.snap +40 -34
  11. package/__flow__/Menu/__snapshots__/index.test.js.snap +15 -12
  12. package/__flow__/Menu/index.js +3 -7
  13. package/__flow__/Menu/index.stories.js +1 -1
  14. package/__flow__/Menu/styles.js +1 -18
  15. package/__flow__/Modal/index.test.js +0 -16
  16. package/__flow__/Modal/styles.js +1 -1
  17. package/__flow__/Popout/index.js +1 -1
  18. package/__flow__/Stack/index.js +1 -1
  19. package/__flow__/ThemeProvider/index.js +4 -4
  20. package/__flow__/Token/index.js +4 -1
  21. package/__flow__/Token/index.stories.js +11 -0
  22. package/__flow__/Token/styles.js +43 -33
  23. package/__flow__/Tooltip/index.js +1 -1
  24. package/__flow__/index.js +1 -2
  25. package/__flow__/themes/dark/_themes.scss +132 -0
  26. package/__flow__/themes/dark/theme.js +181 -157
  27. package/__flow__/themes/light/_themes.scss +132 -0
  28. package/__flow__/themes/{default → light}/dataviz-palette.js +0 -0
  29. package/__flow__/themes/{default → light}/decorative-palettes.js +0 -0
  30. package/__flow__/themes/{default → light}/literal-colors.js +0 -0
  31. package/__flow__/themes/{default → light}/theme.js +19 -8
  32. package/__flow__/themes/utils/interact.js +12 -0
  33. package/__flow__/types/system-props.flow.js +1 -2
  34. package/__flow__/types/theme.colors.flow.js +1 -1
  35. package/__flow__/types/theme.flow.js +2 -2
  36. package/__flow__/utils/mixins.js +1 -1
  37. package/__flow__/utils/responsiveProps/index.js +1 -1
  38. package/commonjs/Breadcrumb/styles.js +1 -1
  39. package/commonjs/Button/styles.js +1 -1
  40. package/commonjs/Card/styles.js +1 -1
  41. package/commonjs/Drawer/styles.js +1 -1
  42. package/commonjs/KeyboardKey/styles.js +1 -1
  43. package/commonjs/Menu/index.js +3 -1
  44. package/commonjs/Menu/styles.js +3 -16
  45. package/commonjs/Modal/styles.js +1 -1
  46. package/commonjs/Popout/index.js +1 -1
  47. package/commonjs/ThemeProvider/index.js +1 -1
  48. package/commonjs/Token/index.js +5 -2
  49. package/commonjs/Token/styles.js +19 -50
  50. package/commonjs/Tooltip/index.js +1 -1
  51. package/commonjs/index.js +2 -6
  52. package/commonjs/themes/dark/theme.js +180 -155
  53. package/commonjs/themes/{default → light}/dataviz-palette.js +0 -0
  54. package/commonjs/themes/{default → light}/decorative-palettes.js +0 -0
  55. package/commonjs/themes/{default → light}/literal-colors.js +0 -0
  56. package/commonjs/themes/{default → light}/theme.js +19 -8
  57. package/commonjs/themes/utils/interact.js +19 -0
  58. package/commonjs/types/theme.colors.flow.js +1 -1
  59. package/commonjs/types/theme.flow.js +1 -1
  60. package/commonjs/utils/mixins.js +1 -1
  61. package/commonjs/utils/responsiveProps/index.js +1 -1
  62. package/dist/themes/dark/_themes.scss +132 -0
  63. package/dist/themes/dark/dark.scss +601 -0
  64. package/dist/themes/light/_themes.scss +132 -0
  65. package/dist/themes/light/light.scss +692 -0
  66. package/lib/Breadcrumb/styles.js +1 -1
  67. package/lib/Button/styles.js +1 -1
  68. package/lib/Card/styles.js +1 -1
  69. package/lib/Drawer/styles.js +1 -1
  70. package/lib/KeyboardKey/styles.js +1 -1
  71. package/lib/Menu/index.js +4 -2
  72. package/lib/Menu/styles.js +2 -13
  73. package/lib/Modal/styles.js +1 -1
  74. package/lib/Popout/index.js +1 -1
  75. package/lib/ThemeProvider/index.js +1 -1
  76. package/lib/Token/index.js +5 -2
  77. package/lib/Token/styles.js +19 -50
  78. package/lib/Tooltip/index.js +1 -1
  79. package/lib/index.js +1 -2
  80. package/lib/themes/dark/theme.js +175 -154
  81. package/lib/themes/{default → light}/dataviz-palette.js +0 -0
  82. package/lib/themes/{default → light}/decorative-palettes.js +0 -0
  83. package/lib/themes/{default → light}/literal-colors.js +0 -0
  84. package/lib/themes/{default → light}/theme.js +18 -8
  85. package/lib/themes/utils/interact.js +13 -0
  86. package/lib/types/theme.colors.flow.js +1 -1
  87. package/lib/types/theme.flow.js +1 -1
  88. package/lib/utils/mixins.js +1 -1
  89. package/lib/utils/responsiveProps/index.js +1 -1
  90. package/package.json +7 -10
  91. package/__flow__/CustomThemeProvider/index.js +0 -16
  92. package/__flow__/Modal/__snapshots__/index.test.js.snap +0 -80
  93. package/__flow__/themes/sprout/theme.js +0 -22
  94. package/__flow__/utils/extendTheme.js +0 -17
  95. package/commonjs/CustomThemeProvider/index.js +0 -23
  96. package/commonjs/themes/sprout/theme.js +0 -29
  97. package/commonjs/utils/extendTheme.js +0 -22
  98. package/lib/CustomThemeProvider/index.js +0 -12
  99. package/lib/themes/sprout/theme.js +0 -19
  100. package/lib/utils/extendTheme.js +0 -12
@@ -1,5 +1,5 @@
1
1
  import { css } from "styled-components";
2
- import theme from "../themes/default/theme";
2
+ import theme from "../themes/light/theme";
3
3
  import { transparentize } from "polished";
4
4
  export var svgToDataURL = function svgToDataURL(svgStr) {
5
5
  var encoded = encodeURIComponent(svgStr).replace(/'/g, "%27").replace(/"/g, "%22");
@@ -1,4 +1,4 @@
1
- import theme from "../../themes/default/theme";
1
+ import theme from "../../themes/light/theme";
2
2
  var breakpoints = theme.breakpoints;
3
3
  var LENGTH = breakpoints.length + 1;
4
4
  export var normalizeResponsiveProp = function normalizeResponsiveProp(value) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sproutsocial/racine",
3
- "version": "9.1.1-theme-extension.0",
3
+ "version": "10.0.0-dar97-beta.1",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "__flow__",
@@ -52,22 +52,18 @@
52
52
  },
53
53
  "lint-staged": {
54
54
  "**/*.js": [
55
- "eslint --fix",
56
- "git add"
55
+ "eslint --fix"
57
56
  ],
58
57
  "*.scss": [
59
- "stylelint --fix",
60
- "git add"
58
+ "stylelint --fix"
61
59
  ],
62
60
  "icons/*.svg": [
63
- "yarn icon-lint write",
64
- "git add"
61
+ "yarn icon-lint write"
65
62
  ]
66
63
  },
67
64
  "dependencies": {
68
65
  "@styled-system/theme-get": "^5.1.2",
69
66
  "classnames": "^2.2.6",
70
- "deepmerge": "^4.2.2",
71
67
  "lodash.curry": "^4.1.1",
72
68
  "lodash.uniqueid": "^4.0.1",
73
69
  "lru-memoize": "^1.1.0",
@@ -96,7 +92,7 @@
96
92
  "@reach/component-component": "^0.1.3",
97
93
  "@sproutsocial/seeds-border": "^1.1.0",
98
94
  "@sproutsocial/seeds-color": "^1.5.3",
99
- "@sproutsocial/seeds-depth": "^1.1.1",
95
+ "@sproutsocial/seeds-depth": "^3.0.0",
100
96
  "@sproutsocial/seeds-motion": "^1.2.0",
101
97
  "@sproutsocial/seeds-networkcolor": "^2.9.0",
102
98
  "@sproutsocial/seeds-space": "^0.4.7",
@@ -107,7 +103,7 @@
107
103
  "@storybook/addon-storysource": "^6.1.11",
108
104
  "@storybook/addon-viewport": "^6.1.11",
109
105
  "@storybook/addons": "^6.1.11",
110
- "@storybook/react": "^6.1.11",
106
+ "@storybook/react": "^6.4.19",
111
107
  "@storybook/theming": "^6.1.11",
112
108
  "@testing-library/react": "^11.2.2",
113
109
  "@testing-library/user-event": "^13.0.0",
@@ -144,6 +140,7 @@
144
140
  "jest-dom": "^3.5.0",
145
141
  "jest-styled-components": "7.0.0-beta.1",
146
142
  "jscodeshift": "^0.6.4",
143
+ "json-to-scss": "^1.6.2",
147
144
  "lint-staged": "^10.2.11",
148
145
  "moment": "^2.29.1",
149
146
  "npm-run-all": "^4.1.2",
@@ -1,16 +0,0 @@
1
- // @flow strict-local
2
- import * as React from "react";
3
- import { ThemeProvider } from "styled-components";
4
-
5
- import typeof { default as TypeTheme } from "../themes/default/theme";
6
-
7
- type TypeProps = {|
8
- theme?: TypeTheme,
9
- children: React.Node,
10
- |};
11
-
12
- const CustomThemeProvider = (props: TypeProps) => (
13
- <ThemeProvider theme={props.theme} {...props} />
14
- );
15
-
16
- export default CustomThemeProvider;
@@ -1,80 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`Modal should render properly 1`] = `
4
- .c0__Overlay {
5
- position: fixed;
6
- top: 0px;
7
- left: 0px;
8
- right: 0px;
9
- bottom: 0px;
10
- display: -webkit-box;
11
- display: -webkit-flex;
12
- display: -ms-flexbox;
13
- display: flex;
14
- -webkit-align-items: center;
15
- -webkit-box-align: center;
16
- -ms-flex-align: center;
17
- align-items: center;
18
- -webkit-box-pack: center;
19
- -webkit-justify-content: center;
20
- -ms-flex-pack: center;
21
- justify-content: center;
22
- background-color: rgba(22,32,32,0.68);
23
- opacity: 0;
24
- will-change: opacity;
25
- -webkit-transition: opacity .3s cubic-bezier(.4,0,.2,1);
26
- transition: opacity .3s cubic-bezier(.4,0,.2,1);
27
- z-index: 6;
28
- }
29
-
30
- .c0__Overlay.ReactModal__Overlay--after-open {
31
- opacity: 1;
32
- }
33
-
34
- .c0__Overlay.ReactModal__Overlay--before-close {
35
- opacity: 0;
36
- }
37
-
38
- .c0__Content {
39
- display: -webkit-box;
40
- display: -webkit-flex;
41
- display: -ms-flexbox;
42
- display: flex;
43
- -webkit-flex-direction: column;
44
- -ms-flex-direction: column;
45
- flex-direction: column;
46
- background: #FFFFFF;
47
- border-radius: 6px;
48
- box-shadow: 0px 8px 16px rgba(39,51,51,.24);
49
- -webkit-filter: blur(0);
50
- filter: blur(0);
51
- color: #364141;
52
- outline: none;
53
- max-width: calc(100vw - 64px);
54
- max-height: calc(100vh - 64px);
55
- width: 800px;
56
- background-color: #c1c1f7;
57
- }
58
-
59
- @media screen and (-ms-high-contrast:active),(-ms-high-contrast:none) {
60
- .c0__Content {
61
- height: calc(100vh - 64px);
62
- }
63
- }
64
-
65
- <div
66
- class="ReactModal__Overlay ReactModal__Overlay--after-open styles__Container-sc-9lom4g-0__Overlay c0 c0__Overlay"
67
- >
68
- <div
69
- aria-label="Label"
70
- aria-modal="true"
71
- class="ReactModal__Content ReactModal__Content--after-open styles__Container-sc-9lom4g-0__Content c0 c0__Content"
72
- data-qa-modal=""
73
- data-qa-modal-isopen="true"
74
- role="dialog"
75
- tabindex="-1"
76
- >
77
- ajdsfljasdlfjlasdjf
78
- </div>
79
- </div>
80
- `;
@@ -1,22 +0,0 @@
1
- // @flow strict-local
2
- import theme from "../default/theme";
3
- import { COLOR_RED_800 } from "@sproutsocial/seeds-color";
4
-
5
- const sproutTheme = {
6
- container: {
7
- background: {
8
- error: {
9
- hover: COLOR_RED_800,
10
- },
11
- },
12
- },
13
- button: {
14
- primary: {
15
- background: {
16
- base: "purple",
17
- },
18
- },
19
- },
20
- };
21
-
22
- export default sproutTheme;
@@ -1,17 +0,0 @@
1
- //@flow strict-local
2
- import * as merge from "deepmerge";
3
-
4
- export function extendColorTheme(
5
- baseTheme: { colors: {} },
6
- extension: { [key: string]: string | {} }
7
- ) {
8
- const newColorTheme = merge(baseTheme.colors, extension);
9
- const newTheme = {
10
- ...baseTheme,
11
- colors: {
12
- ...newColorTheme,
13
- },
14
- };
15
-
16
- return newTheme;
17
- }
@@ -1,23 +0,0 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- exports.default = void 0;
5
-
6
- var React = _interopRequireWildcard(require("react"));
7
-
8
- var _styledComponents = require("styled-components");
9
-
10
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
-
12
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
13
-
14
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
15
-
16
- var CustomThemeProvider = function CustomThemeProvider(props) {
17
- return /*#__PURE__*/React.createElement(_styledComponents.ThemeProvider, _extends({
18
- theme: props.theme
19
- }, props));
20
- };
21
-
22
- var _default = CustomThemeProvider;
23
- exports.default = _default;
@@ -1,29 +0,0 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- exports.default = void 0;
5
-
6
- var _theme = _interopRequireDefault(require("../default/theme"));
7
-
8
- var _seedsColor = require("@sproutsocial/seeds-color");
9
-
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
-
12
- var sproutTheme = {
13
- container: {
14
- background: {
15
- error: {
16
- hover: _seedsColor.COLOR_RED_800
17
- }
18
- }
19
- },
20
- button: {
21
- primary: {
22
- background: {
23
- base: "purple"
24
- }
25
- }
26
- }
27
- };
28
- var _default = sproutTheme;
29
- exports.default = _default;
@@ -1,22 +0,0 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- exports.extendColorTheme = extendColorTheme;
5
-
6
- var merge = _interopRequireWildcard(require("deepmerge"));
7
-
8
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
9
-
10
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
11
-
12
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
13
-
14
- function extendColorTheme(baseTheme, extension) {
15
- var newColorTheme = merge(baseTheme.colors, extension);
16
-
17
- var newTheme = _extends({}, baseTheme, {
18
- colors: _extends({}, newColorTheme)
19
- });
20
-
21
- return newTheme;
22
- }
@@ -1,12 +0,0 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
- import * as React from "react";
4
- import { ThemeProvider } from "styled-components";
5
-
6
- var CustomThemeProvider = function CustomThemeProvider(props) {
7
- return /*#__PURE__*/React.createElement(ThemeProvider, _extends({
8
- theme: props.theme
9
- }, props));
10
- };
11
-
12
- export default CustomThemeProvider;
@@ -1,19 +0,0 @@
1
- import theme from "../default/theme";
2
- import { COLOR_RED_800 } from "@sproutsocial/seeds-color";
3
- var sproutTheme = {
4
- container: {
5
- background: {
6
- error: {
7
- hover: COLOR_RED_800
8
- }
9
- }
10
- },
11
- button: {
12
- primary: {
13
- background: {
14
- base: "purple"
15
- }
16
- }
17
- }
18
- };
19
- export default sproutTheme;
@@ -1,12 +0,0 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
- import * as merge from "deepmerge";
4
- export function extendColorTheme(baseTheme, extension) {
5
- var newColorTheme = merge(baseTheme.colors, extension);
6
-
7
- var newTheme = _extends({}, baseTheme, {
8
- colors: _extends({}, newColorTheme)
9
- });
10
-
11
- return newTheme;
12
- }