@zohodesk/svg 1.0.0-beta.46 → 1.0.0-beta.47

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/README.md CHANGED
@@ -2,7 +2,11 @@
2
2
 
3
3
  This Bundle Contains EmptyState Images.
4
4
 
5
- #1.0.0-beta.46
5
+ # 1.0.0-beta.47
6
+
7
+ - PureDark mode implemented via preprocess
8
+
9
+ # 1.0.0-beta.46
6
10
 
7
11
  - CustomModule SVG added
8
12
 
@@ -0,0 +1,37 @@
1
+ [data-mode='pureDark'] {
2
+ /* default palette */
3
+ --zdt_svg_default_primary_fill: var(--zdt_cta_primary_fill);
4
+ --zdt_svg_default_primary_stroke: var(--zdt_cta_primary_stroke);
5
+ --zdt_svg_default_secondary_fill: var(--zdt_cta_secondary_fill);
6
+ --zdt_svg_default_secondary_plainfill: var(--zdt_cta_secondary_plainfill);
7
+ --zdt_svg_default_plus: #479dff;
8
+ --zdt_svg_default_cross: #5cc1a5;
9
+ --zdt_svg_default_medium_circle: #ff6b6b;
10
+ --zdt_svg_default_tiny_circle: #4ac064;
11
+ --zdt_svg_default_small_circle: #ff6b6b;
12
+ --zdt_svg_default_circle_fill: var(--dot_white);
13
+
14
+ /* dark palette */
15
+ --zdt_svg_dark_primary_fill: var(--zdt_cta_primary_dark_fill);
16
+ --zdt_svg_dark_primary_stroke: var(--zdt_cta_primary_dark_stroke);
17
+ --zdt_svg_dark_secondary_fill: var(--zdt_cta_secondary_dark_fill);
18
+ --zdt_svg_dark_secondary_plainfill: var(--zdt_cta_secondary_dark_plainfill);
19
+ --zdt_svg_dark_plus: #479dff;
20
+ --zdt_svg_dark_cross: #5cc1a5;
21
+ --zdt_svg_dark_medium_circle: #ff6b6b;
22
+ --zdt_svg_dark_tiny_circle: #4ac064;
23
+ --zdt_svg_dark_small_circle: #ff6b6b;
24
+ --zdt_svg_dark_circle_fill: var(--dot_white);
25
+
26
+ /* danger palette */
27
+ --zdt_svg_danger_primary_fill: #ff6f00;
28
+ --zdt_svg_danger_primary_stroke: #479dff;
29
+ --zdt_svg_danger_secondary_fill: #334b68;
30
+ --zdt_svg_danger_secondary_plainfill: #334b68;
31
+ --zdt_svg_danger_plus: #479dff;
32
+ --zdt_svg_danger_cross: #5cc1a5;
33
+ --zdt_svg_danger_medium_circle: #ff6b6b;
34
+ --zdt_svg_danger_tiny_circle: #4ac064;
35
+ --zdt_svg_danger_small_circle: #ff6b6b;
36
+ --zdt_svg_danger_circle_fill: var(--dot_white);
37
+ }
@@ -0,0 +1,10 @@
1
+ [data-mode='pureDark'][data-theme='blue'] {
2
+ --zdt_cta_primary_fill: #828994;
3
+ --zdt_cta_primary_stroke: #479dff;
4
+ --zdt_cta_secondary_fill: #334b68;
5
+ --zdt_cta_secondary_plainfill: #334b68;
6
+ --zdt_cta_primary_dark_fill: #828994;
7
+ --zdt_cta_primary_dark_stroke: #479dff;
8
+ --zdt_cta_secondary_dark_fill: #334b68;
9
+ --zdt_cta_secondary_dark_plainfill: #334b68
10
+ }
@@ -0,0 +1,10 @@
1
+ [data-mode='pureDark'][data-theme='green'] {
2
+ --zdt_cta_primary_fill: #45a159;
3
+ --zdt_cta_primary_stroke: #0e7c1c;
4
+ --zdt_cta_secondary_fill: rgba(69, 161, 89, 0.25);
5
+ --zdt_cta_secondary_plainfill: #45a159;
6
+ --zdt_cta_primary_dark_fill: #45a159;
7
+ --zdt_cta_primary_dark_stroke: #0e7526;
8
+ --zdt_cta_secondary_dark_fill: rgba(69, 161, 89, 0.25);
9
+ --zdt_cta_secondary_dark_plainfill: #45a159
10
+ }
@@ -0,0 +1,10 @@
1
+ [data-mode='pureDark'][data-theme='orange'] {
2
+ --zdt_cta_primary_fill: #ff801f;
3
+ --zdt_cta_primary_stroke: #a85100;
4
+ --zdt_cta_secondary_fill: rgba(255, 128, 31, 0.25);
5
+ --zdt_cta_secondary_plainfill: #ff801f;
6
+ --zdt_cta_primary_dark_fill: #ff801f;
7
+ --zdt_cta_primary_dark_stroke: #a85100;
8
+ --zdt_cta_secondary_dark_fill: rgba(255, 128, 31, 0.25);
9
+ --zdt_cta_secondary_dark_plainfill: #ff801f
10
+ }
@@ -0,0 +1,10 @@
1
+ [data-mode='pureDark'][data-theme='red'] {
2
+ --zdt_cta_primary_fill: #a81111;
3
+ --zdt_cta_primary_stroke: #e94f4f;
4
+ --zdt_cta_secondary_fill: rgba(233, 79, 79, 0.25);
5
+ --zdt_cta_secondary_plainfill: #e94f4f;
6
+ --zdt_cta_primary_dark_fill: #e94f4f;
7
+ --zdt_cta_primary_dark_stroke: #a81111;
8
+ --zdt_cta_secondary_dark_fill: rgba(233, 79, 79, 0.25);
9
+ --zdt_cta_secondary_dark_plainfill: #e94f4f
10
+ }
@@ -0,0 +1,10 @@
1
+ [data-mode='pureDark'][data-theme='yellow'] {
2
+ --zdt_cta_primary_fill: #d79835;
3
+ --zdt_cta_primary_stroke: #9b6808;
4
+ --zdt_cta_secondary_fill: rgba(215, 152, 53, 0.25);
5
+ --zdt_cta_secondary_plainfill: #d79835;
6
+ --zdt_cta_primary_dark_fill: #d79835;
7
+ --zdt_cta_primary_dark_stroke: #9b6808;
8
+ --zdt_cta_secondary_dark_fill: rgba(215, 152, 53, 0.25);
9
+ --zdt_cta_secondary_dark_plainfill: #d79835
10
+ }
package/es/Provider.js CHANGED
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  import AppContainer from '@zohodesk/components/lib/AppContainer/AppContainer';
3
3
  import { Container } from '@zohodesk/components/lib/Layout';
4
- import Switch from '@zohodesk/components/lib/Switch/Switch';
5
4
  import '@zohodesk/components/assets/Appearance/default/mode/defaultMode.module.css';
6
5
  import '@zohodesk/components/assets/Appearance/dark/mode/darkMode.module.css';
7
6
  /* default mode & themes */
@@ -20,6 +19,14 @@ import '../assets/Appearance/dark/themes/orange/orangeDarkCTATheme.module.css';
20
19
  import '../assets/Appearance/dark/themes/red/redDarkCTATheme.module.css';
21
20
  import '../assets/Appearance/dark/themes/yellow/yellowDarkCTATheme.module.css';
22
21
  import '../assets/Appearance/dark/mode/darkEmptyStates.module.css';
22
+ /* pure dark mode & themes */
23
+
24
+ import '../assets/Appearance/pureDark/themes/blue/bluePureDarkCTATheme.module.css';
25
+ import '../assets/Appearance/pureDark/themes/green/greenPureDarkCTATheme.module.css';
26
+ import '../assets/Appearance/pureDark/themes/orange/orangePureDarkCTATheme.module.css';
27
+ import '../assets/Appearance/pureDark/themes/red/redPureDarkCTATheme.module.css';
28
+ import '../assets/Appearance/pureDark/themes/yellow/yellowPureDarkCTATheme.module.css';
29
+ import '../assets/Appearance/pureDark/mode/pureDarkEmptyStates.module.css';
23
30
  export default class Provider extends React.Component {
24
31
  constructor(props) {
25
32
  super(props);
@@ -27,22 +34,13 @@ export default class Provider extends React.Component {
27
34
  appearanceName: 'default',
28
35
  themeName: 'blue'
29
36
  };
30
- this.switchMode = this.switchMode.bind(this);
31
37
  this.setTheme = this.setTheme.bind(this);
32
38
  }
33
39
 
34
- switchMode() {
35
- let appearanceName = this.state.appearanceName;
36
-
37
- if (appearanceName == 'default') {
38
- this.setState({
39
- appearanceName: 'dark'
40
- });
41
- } else {
42
- this.setState({
43
- appearanceName: 'default'
44
- });
45
- }
40
+ setAppearance(mode) {
41
+ this.setState({
42
+ appearanceName: mode
43
+ });
46
44
  }
47
45
 
48
46
  setTheme(theme) {
@@ -78,6 +76,29 @@ export default class Provider extends React.Component {
78
76
  let yellow = {
79
77
  backgroundColor: '#e8b923'
80
78
  };
79
+ let light = {
80
+ backgroundColor: '#fff'
81
+ };
82
+ let night = {
83
+ backgroundColor: '#232b38'
84
+ };
85
+ let dark = {
86
+ backgroundColor: '#212121'
87
+ };
88
+ let fixedPosition = {
89
+ position: 'fixed',
90
+ bottom: '0',
91
+ backgroundColor: '#272727',
92
+ padding: '10px',
93
+ borderRadius: '15px 15px 0 0',
94
+ minWidth: '100px',
95
+ textAlign: 'center',
96
+ boxShadow: '0 0 3px #000',
97
+ fontSize: '12px',
98
+ zIndex: '3',
99
+ display: 'flex',
100
+ alignItems: 'center'
101
+ };
81
102
  return /*#__PURE__*/React.createElement(AppContainer, {
82
103
  customProps: {
83
104
  ExtraProps: {
@@ -88,29 +109,40 @@ export default class Provider extends React.Component {
88
109
  }, /*#__PURE__*/React.createElement(Container, {
89
110
  scroll: "vertical"
90
111
  }, this.props.children), /*#__PURE__*/React.createElement("div", {
112
+ style: Object.assign({}, fixedPosition, {
113
+ left: '20%',
114
+ transform: 'translate(-20%)'
115
+ })
116
+ }, /*#__PURE__*/React.createElement("div", {
117
+ style: {
118
+ color: '#fff'
119
+ }
120
+ }, "Appearance:"), /*#__PURE__*/React.createElement("div", {
121
+ style: {
122
+ display: 'flex'
123
+ }
124
+ }, /*#__PURE__*/React.createElement("span", {
125
+ title: "Light Mode",
126
+ style: Object.assign({}, themeClass, light),
127
+ onClick: () => this.setAppearance('default')
128
+ }), /*#__PURE__*/React.createElement("span", {
129
+ title: "Night Mode",
130
+ style: Object.assign({}, themeClass, night),
131
+ onClick: () => this.setAppearance('dark')
132
+ }), /*#__PURE__*/React.createElement("span", {
133
+ title: "Dark Mode",
134
+ style: Object.assign({}, themeClass, dark),
135
+ onClick: () => this.setAppearance('pureDark')
136
+ }))), /*#__PURE__*/React.createElement("div", {
137
+ style: Object.assign({}, fixedPosition, {
138
+ left: '80%',
139
+ transform: 'translate(-80%)'
140
+ })
141
+ }, /*#__PURE__*/React.createElement("div", {
91
142
  style: {
92
- position: 'fixed',
93
- bottom: '0',
94
- backgroundColor: '#272727',
95
- padding: '10px',
96
- borderRadius: '15px 15px 0 0',
97
- minWidth: '100px',
98
- textAlign: 'center',
99
- left: '50%',
100
- transform: 'translate(-50%)',
101
- boxShadow: '0 0 3px #000',
102
- fontSize: '12px',
103
- zIndex: '3',
104
- display: 'flex',
105
- alignItems: 'center'
143
+ color: '#fff'
106
144
  }
107
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Switch, {
108
- id: "switchMode",
109
- text: "Light/Night Mode",
110
- labelSize: "small",
111
- onChange: this.switchMode,
112
- checked: appearanceName == 'dark'
113
- })), /*#__PURE__*/React.createElement("div", {
145
+ }, "Themes:"), /*#__PURE__*/React.createElement("div", {
114
146
  style: {
115
147
  display: 'flex'
116
148
  }
package/lib/Provider.js CHANGED
@@ -13,8 +13,6 @@ var _AppContainer = _interopRequireDefault(require("@zohodesk/components/lib/App
13
13
 
14
14
  var _Layout = require("@zohodesk/components/lib/Layout");
15
15
 
16
- var _Switch = _interopRequireDefault(require("@zohodesk/components/lib/Switch/Switch"));
17
-
18
16
  require("@zohodesk/components/assets/Appearance/default/mode/defaultMode.module.css");
19
17
 
20
18
  require("@zohodesk/components/assets/Appearance/dark/mode/darkMode.module.css");
@@ -43,6 +41,18 @@ require("../assets/Appearance/dark/themes/yellow/yellowDarkCTATheme.module.css")
43
41
 
44
42
  require("../assets/Appearance/dark/mode/darkEmptyStates.module.css");
45
43
 
44
+ require("../assets/Appearance/pureDark/themes/blue/bluePureDarkCTATheme.module.css");
45
+
46
+ require("../assets/Appearance/pureDark/themes/green/greenPureDarkCTATheme.module.css");
47
+
48
+ require("../assets/Appearance/pureDark/themes/orange/orangePureDarkCTATheme.module.css");
49
+
50
+ require("../assets/Appearance/pureDark/themes/red/redPureDarkCTATheme.module.css");
51
+
52
+ require("../assets/Appearance/pureDark/themes/yellow/yellowPureDarkCTATheme.module.css");
53
+
54
+ require("../assets/Appearance/pureDark/mode/pureDarkEmptyStates.module.css");
55
+
46
56
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
47
57
 
48
58
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -80,25 +90,16 @@ var Provider = /*#__PURE__*/function (_React$Component) {
80
90
  appearanceName: 'default',
81
91
  themeName: 'blue'
82
92
  };
83
- _this.switchMode = _this.switchMode.bind(_assertThisInitialized(_this));
84
93
  _this.setTheme = _this.setTheme.bind(_assertThisInitialized(_this));
85
94
  return _this;
86
95
  }
87
96
 
88
97
  _createClass(Provider, [{
89
- key: "switchMode",
90
- value: function switchMode() {
91
- var appearanceName = this.state.appearanceName;
92
-
93
- if (appearanceName == 'default') {
94
- this.setState({
95
- appearanceName: 'dark'
96
- });
97
- } else {
98
- this.setState({
99
- appearanceName: 'default'
100
- });
101
- }
98
+ key: "setAppearance",
99
+ value: function setAppearance(mode) {
100
+ this.setState({
101
+ appearanceName: mode
102
+ });
102
103
  }
103
104
  }, {
104
105
  key: "setTheme",
@@ -137,6 +138,29 @@ var Provider = /*#__PURE__*/function (_React$Component) {
137
138
  var yellow = {
138
139
  backgroundColor: '#e8b923'
139
140
  };
141
+ var light = {
142
+ backgroundColor: '#fff'
143
+ };
144
+ var night = {
145
+ backgroundColor: '#232b38'
146
+ };
147
+ var dark = {
148
+ backgroundColor: '#212121'
149
+ };
150
+ var fixedPosition = {
151
+ position: 'fixed',
152
+ bottom: '0',
153
+ backgroundColor: '#272727',
154
+ padding: '10px',
155
+ borderRadius: '15px 15px 0 0',
156
+ minWidth: '100px',
157
+ textAlign: 'center',
158
+ boxShadow: '0 0 3px #000',
159
+ fontSize: '12px',
160
+ zIndex: '3',
161
+ display: 'flex',
162
+ alignItems: 'center'
163
+ };
140
164
  return /*#__PURE__*/_react["default"].createElement(_AppContainer["default"], {
141
165
  customProps: {
142
166
  ExtraProps: {
@@ -147,29 +171,46 @@ var Provider = /*#__PURE__*/function (_React$Component) {
147
171
  }, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
148
172
  scroll: "vertical"
149
173
  }, this.props.children), /*#__PURE__*/_react["default"].createElement("div", {
174
+ style: Object.assign({}, fixedPosition, {
175
+ left: '20%',
176
+ transform: 'translate(-20%)'
177
+ })
178
+ }, /*#__PURE__*/_react["default"].createElement("div", {
179
+ style: {
180
+ color: '#fff'
181
+ }
182
+ }, "Appearance:"), /*#__PURE__*/_react["default"].createElement("div", {
183
+ style: {
184
+ display: 'flex'
185
+ }
186
+ }, /*#__PURE__*/_react["default"].createElement("span", {
187
+ title: "Light Mode",
188
+ style: Object.assign({}, themeClass, light),
189
+ onClick: function onClick() {
190
+ return _this2.setAppearance('default');
191
+ }
192
+ }), /*#__PURE__*/_react["default"].createElement("span", {
193
+ title: "Night Mode",
194
+ style: Object.assign({}, themeClass, night),
195
+ onClick: function onClick() {
196
+ return _this2.setAppearance('dark');
197
+ }
198
+ }), /*#__PURE__*/_react["default"].createElement("span", {
199
+ title: "Dark Mode",
200
+ style: Object.assign({}, themeClass, dark),
201
+ onClick: function onClick() {
202
+ return _this2.setAppearance('pureDark');
203
+ }
204
+ }))), /*#__PURE__*/_react["default"].createElement("div", {
205
+ style: Object.assign({}, fixedPosition, {
206
+ left: '80%',
207
+ transform: 'translate(-80%)'
208
+ })
209
+ }, /*#__PURE__*/_react["default"].createElement("div", {
150
210
  style: {
151
- position: 'fixed',
152
- bottom: '0',
153
- backgroundColor: '#272727',
154
- padding: '10px',
155
- borderRadius: '15px 15px 0 0',
156
- minWidth: '100px',
157
- textAlign: 'center',
158
- left: '50%',
159
- transform: 'translate(-50%)',
160
- boxShadow: '0 0 3px #000',
161
- fontSize: '12px',
162
- zIndex: '3',
163
- display: 'flex',
164
- alignItems: 'center'
211
+ color: '#fff'
165
212
  }
166
- }, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_Switch["default"], {
167
- id: "switchMode",
168
- text: "Light/Night Mode",
169
- labelSize: "small",
170
- onChange: this.switchMode,
171
- checked: appearanceName == 'dark'
172
- })), /*#__PURE__*/_react["default"].createElement("div", {
213
+ }, "Themes:"), /*#__PURE__*/_react["default"].createElement("div", {
173
214
  style: {
174
215
  display: 'flex'
175
216
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/svg",
3
- "version": "1.0.0-beta.46",
3
+ "version": "1.0.0-beta.47",
4
4
  "main": "lib/index",
5
5
  "module": "es/index.js",
6
6
  "jsnext:main": "es/index.js",