@zendeskgarden/react-theming 9.0.0-next.8 → 9.0.0-next.9
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/dist/esm/elements/palette/index.js +183 -207
- package/dist/esm/elements/theme/index.js +15 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/utils/StyledBaseIcon.js +22 -0
- package/dist/esm/utils/getCheckeredBackground.js +40 -0
- package/dist/esm/utils/getColor.js +8 -3
- package/dist/index.cjs.js +267 -225
- package/dist/typings/elements/palette/index.d.ts +0 -24
- package/dist/typings/index.d.ts +3 -1
- package/dist/typings/types/index.d.ts +8 -0
- package/dist/typings/utils/StyledBaseIcon.d.ts +8 -0
- package/dist/typings/utils/getCheckeredBackground.d.ts +20 -0
- package/dist/typings/utils/getColor.d.ts +2 -2
- package/package.json +2 -2
package/dist/index.cjs.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
9
9
|
var React = require('react');
|
|
10
|
-
var
|
|
10
|
+
var styled = require('styled-components');
|
|
11
11
|
var chromaJs = require('chroma-js');
|
|
12
12
|
var polished = require('polished');
|
|
13
13
|
var get = require('lodash.get');
|
|
@@ -16,6 +16,7 @@ var memoize = require('lodash.memoize');
|
|
|
16
16
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
17
|
|
|
18
18
|
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
19
|
+
var styled__default = /*#__PURE__*/_interopDefault(styled);
|
|
19
20
|
var get__default = /*#__PURE__*/_interopDefault(get);
|
|
20
21
|
var memoize__default = /*#__PURE__*/_interopDefault(memoize);
|
|
21
22
|
|
|
@@ -24,274 +25,250 @@ const PALETTE = {
|
|
|
24
25
|
white: '#fff',
|
|
25
26
|
product: {
|
|
26
27
|
support: '#00a656',
|
|
27
|
-
message: '#37b8af',
|
|
28
28
|
explore: '#30aabc',
|
|
29
29
|
gather: '#f6c8be',
|
|
30
30
|
guide: '#eb4962',
|
|
31
|
-
connect: '#ff6224',
|
|
32
31
|
chat: '#f79a3e',
|
|
33
32
|
talk: '#efc93d',
|
|
34
33
|
sell: '#c38f00'
|
|
35
34
|
},
|
|
36
35
|
grey: {
|
|
37
|
-
100: '#
|
|
38
|
-
200: '#
|
|
39
|
-
300: '#
|
|
40
|
-
400: '#
|
|
41
|
-
500: '#
|
|
42
|
-
600: '#
|
|
43
|
-
700: '#
|
|
44
|
-
800: '#
|
|
45
|
-
900: '#
|
|
46
|
-
1000: '#
|
|
47
|
-
1100: '#
|
|
48
|
-
1200: '#
|
|
36
|
+
100: '#f8f9f9',
|
|
37
|
+
200: '#e8eaec',
|
|
38
|
+
300: '#d8dcde',
|
|
39
|
+
400: '#b0b8be',
|
|
40
|
+
500: '#919ca5',
|
|
41
|
+
600: '#848f99',
|
|
42
|
+
700: '#5c6970',
|
|
43
|
+
800: '#39434b',
|
|
44
|
+
900: '#293239',
|
|
45
|
+
1000: '#1c2227',
|
|
46
|
+
1100: '#151a1e',
|
|
47
|
+
1200: '#0a0d0e'
|
|
49
48
|
},
|
|
50
49
|
blue: {
|
|
51
50
|
100: '#edf7ff',
|
|
52
|
-
200: '#
|
|
53
|
-
300: '#
|
|
54
|
-
400: '#
|
|
55
|
-
500: '#
|
|
56
|
-
600: '#
|
|
51
|
+
200: '#ddecf8',
|
|
52
|
+
300: '#cce0f1',
|
|
53
|
+
400: '#93bcdc',
|
|
54
|
+
500: '#66a0cd',
|
|
55
|
+
600: '#2694d6',
|
|
57
56
|
700: '#1f73b7',
|
|
58
|
-
800: '#
|
|
59
|
-
900: '#
|
|
60
|
-
1000: '#
|
|
61
|
-
1100: '#
|
|
62
|
-
1200: '#
|
|
57
|
+
800: '#13456d',
|
|
58
|
+
900: '#0f3655',
|
|
59
|
+
1000: '#0a2338',
|
|
60
|
+
1100: '#061420',
|
|
61
|
+
1200: '#040d15'
|
|
63
62
|
},
|
|
64
63
|
red: {
|
|
65
64
|
100: '#fff2f3',
|
|
66
|
-
200: '#
|
|
67
|
-
300: '#
|
|
68
|
-
400: '#
|
|
69
|
-
500: '#
|
|
70
|
-
600: '#
|
|
65
|
+
200: '#fee3e5',
|
|
66
|
+
300: '#f5d5d8',
|
|
67
|
+
400: '#f2a1a8',
|
|
68
|
+
500: '#ea7881',
|
|
69
|
+
600: '#eb5c69',
|
|
71
70
|
700: '#cd3642',
|
|
72
|
-
800: '#
|
|
73
|
-
900: '#
|
|
74
|
-
1000: '#
|
|
75
|
-
1100: '#
|
|
76
|
-
1200: '#
|
|
71
|
+
800: '#7e1d25',
|
|
72
|
+
900: '#671219',
|
|
73
|
+
1000: '#3d1418',
|
|
74
|
+
1100: '#1d1011',
|
|
75
|
+
1200: '#100b0c'
|
|
77
76
|
},
|
|
78
77
|
yellow: {
|
|
79
78
|
100: '#fff3e4',
|
|
80
|
-
200: '#
|
|
81
|
-
300: '#
|
|
82
|
-
400: '#
|
|
83
|
-
500: '#
|
|
84
|
-
600: '#
|
|
79
|
+
200: '#ffe6cb',
|
|
80
|
+
300: '#fed6a9',
|
|
81
|
+
400: '#fca347',
|
|
82
|
+
500: '#e38215',
|
|
83
|
+
600: '#d67305',
|
|
85
84
|
700: '#ac5918',
|
|
86
|
-
800: '#
|
|
87
|
-
900: '#
|
|
88
|
-
1000: '#
|
|
89
|
-
1100: '#
|
|
90
|
-
1200: '#
|
|
85
|
+
800: '#673515',
|
|
86
|
+
900: '#4c2c17',
|
|
87
|
+
1000: '#2d1e15',
|
|
88
|
+
1100: '#18120f',
|
|
89
|
+
1200: '#0e0c0b'
|
|
91
90
|
},
|
|
92
91
|
green: {
|
|
93
92
|
100: '#eef8f4',
|
|
94
|
-
200: '#
|
|
95
|
-
300: '#
|
|
96
|
-
400: '#
|
|
97
|
-
500: '#
|
|
98
|
-
600: '#
|
|
93
|
+
200: '#daeee6',
|
|
94
|
+
300: '#cae3d9',
|
|
95
|
+
400: '#94c1b0',
|
|
96
|
+
500: '#4eab89',
|
|
97
|
+
600: '#26a178',
|
|
99
98
|
700: '#037f52',
|
|
100
|
-
800: '#
|
|
101
|
-
900: '#
|
|
102
|
-
1000: '#
|
|
103
|
-
1100: '#
|
|
104
|
-
1200: '#
|
|
99
|
+
800: '#104b35',
|
|
100
|
+
900: '#0b3b29',
|
|
101
|
+
1000: '#0c261c',
|
|
102
|
+
1100: '#0a1511',
|
|
103
|
+
1200: '#080d0c'
|
|
105
104
|
},
|
|
106
105
|
kale: {
|
|
107
106
|
100: '#ecf9f9',
|
|
108
|
-
200: '#
|
|
109
|
-
300: '#
|
|
110
|
-
400: '#
|
|
111
|
-
500: '#
|
|
112
|
-
600: '#
|
|
107
|
+
200: '#daeded',
|
|
108
|
+
300: '#cbe2e1',
|
|
109
|
+
400: '#97bfbf',
|
|
110
|
+
500: '#6ba4a5',
|
|
111
|
+
600: '#4a9999',
|
|
113
112
|
700: '#40787a',
|
|
114
|
-
800: '#
|
|
115
|
-
900: '#
|
|
116
|
-
1000: '#
|
|
117
|
-
1100: '#
|
|
118
|
-
1200: '#
|
|
113
|
+
800: '#16494f',
|
|
114
|
+
900: '#063940',
|
|
115
|
+
1000: '#03252a',
|
|
116
|
+
1100: '#061517',
|
|
117
|
+
1200: '#060e0e'
|
|
119
118
|
},
|
|
120
119
|
fuschia: {
|
|
121
120
|
100: '#fbf3f8',
|
|
122
|
-
200: '#
|
|
123
|
-
300: '#
|
|
124
|
-
400: '#
|
|
125
|
-
500: '#
|
|
126
|
-
600: '#
|
|
121
|
+
200: '#f7e6f1',
|
|
122
|
+
300: '#f2d5e7',
|
|
123
|
+
400: '#e3a4cc',
|
|
124
|
+
500: '#d77db7',
|
|
125
|
+
600: '#d16aac',
|
|
127
126
|
700: '#b34496',
|
|
128
|
-
800: '#
|
|
129
|
-
900: '#
|
|
130
|
-
1000: '#
|
|
131
|
-
1100: '#
|
|
132
|
-
1200: '#
|
|
133
|
-
M400: '#cf62a8',
|
|
134
|
-
M600: '#a8458c'
|
|
127
|
+
800: '#78116c',
|
|
128
|
+
900: '#5a0d51',
|
|
129
|
+
1000: '#3f0939',
|
|
130
|
+
1100: '#31072c',
|
|
131
|
+
1200: '#1b0418'
|
|
135
132
|
},
|
|
136
133
|
pink: {
|
|
137
|
-
100: '#
|
|
138
|
-
200: '#
|
|
139
|
-
300: '#
|
|
140
|
-
400: '#
|
|
141
|
-
500: '#
|
|
142
|
-
600: '#
|
|
134
|
+
100: '#fcf3f4',
|
|
135
|
+
200: '#f7e5e8',
|
|
136
|
+
300: '#f3d6dc',
|
|
137
|
+
400: '#e5a6b4',
|
|
138
|
+
500: '#d98193',
|
|
139
|
+
600: '#d96b81',
|
|
143
140
|
700: '#d62054',
|
|
144
|
-
800: '#
|
|
145
|
-
900: '#
|
|
146
|
-
1000: '#
|
|
147
|
-
1100: '#
|
|
148
|
-
1200: '#
|
|
149
|
-
M400: '#d57287',
|
|
150
|
-
M600: '#b23a5d'
|
|
141
|
+
800: '#75263d',
|
|
142
|
+
900: '#561d2e',
|
|
143
|
+
1000: '#3c141f',
|
|
144
|
+
1100: '#2e0f18',
|
|
145
|
+
1200: '#17080c'
|
|
151
146
|
},
|
|
152
147
|
crimson: {
|
|
153
|
-
100: '#
|
|
154
|
-
200: '#
|
|
155
|
-
300: '#
|
|
156
|
-
400: '#
|
|
157
|
-
500: '#
|
|
158
|
-
600: '#
|
|
148
|
+
100: '#fbf3f2',
|
|
149
|
+
200: '#f7e7e4',
|
|
150
|
+
300: '#f1d7d2',
|
|
151
|
+
400: '#e2aaa0',
|
|
152
|
+
500: '#d58678',
|
|
153
|
+
600: '#cf7464',
|
|
159
154
|
700: '#be4938',
|
|
160
|
-
800: '#
|
|
161
|
-
900: '#
|
|
162
|
-
1000: '#
|
|
163
|
-
1100: '#
|
|
164
|
-
1200: '#
|
|
165
|
-
M400: '#cc6c5b',
|
|
166
|
-
M600: '#b24a3c'
|
|
155
|
+
800: '#811b12',
|
|
156
|
+
900: '#61140d',
|
|
157
|
+
1000: '#440e09',
|
|
158
|
+
1100: '#340b07',
|
|
159
|
+
1200: '#1c0604'
|
|
167
160
|
},
|
|
168
161
|
orange: {
|
|
169
162
|
100: '#fdf3ed',
|
|
170
|
-
200: '#
|
|
171
|
-
300: '#
|
|
172
|
-
400: '#
|
|
173
|
-
500: '#
|
|
174
|
-
600: '#
|
|
163
|
+
200: '#fae7d8',
|
|
164
|
+
300: '#f7d7be',
|
|
165
|
+
400: '#eda875',
|
|
166
|
+
500: '#e58035',
|
|
167
|
+
600: '#d57428',
|
|
175
168
|
700: '#af5626',
|
|
176
|
-
800: '#
|
|
177
|
-
900: '#
|
|
178
|
-
1000: '#
|
|
179
|
-
1100: '#
|
|
180
|
-
1200: '#
|
|
181
|
-
M400: '#d4772c',
|
|
182
|
-
M600: '#b35827'
|
|
169
|
+
800: '#693317',
|
|
170
|
+
900: '#4d2711',
|
|
171
|
+
1000: '#361a0c',
|
|
172
|
+
1100: '#291409',
|
|
173
|
+
1200: '#150a04'
|
|
183
174
|
},
|
|
184
175
|
lemon: {
|
|
185
|
-
100: '#
|
|
186
|
-
200: '#
|
|
187
|
-
300: '#
|
|
188
|
-
400: '#
|
|
189
|
-
500: '#
|
|
190
|
-
600: '#
|
|
176
|
+
100: '#fff7d4',
|
|
177
|
+
200: '#ffea97',
|
|
178
|
+
300: '#ffdc4f',
|
|
179
|
+
400: '#efab00',
|
|
180
|
+
500: '#c79100',
|
|
181
|
+
600: '#b68500',
|
|
191
182
|
700: '#8f6900',
|
|
192
|
-
800: '#
|
|
193
|
-
900: '#
|
|
194
|
-
1000: '#
|
|
195
|
-
1100: '#
|
|
196
|
-
1200: '#
|
|
197
|
-
M400: '#e7a500',
|
|
198
|
-
M600: '#c38f00'
|
|
183
|
+
800: '#563e00',
|
|
184
|
+
900: '#3f2e00',
|
|
185
|
+
1000: '#2b2000',
|
|
186
|
+
1100: '#221800',
|
|
187
|
+
1200: '#110c00'
|
|
199
188
|
},
|
|
200
189
|
lime: {
|
|
201
|
-
100: '#
|
|
202
|
-
200: '#
|
|
203
|
-
300: '#
|
|
204
|
-
400: '#
|
|
205
|
-
500: '#
|
|
206
|
-
600: '#
|
|
190
|
+
100: '#ecfae7',
|
|
191
|
+
200: '#d1f3c7',
|
|
192
|
+
300: '#b3eda3',
|
|
193
|
+
400: '#4fd12b',
|
|
194
|
+
500: '#45b025',
|
|
195
|
+
600: '#509f2d',
|
|
207
196
|
700: '#3d7e19',
|
|
208
|
-
800: '#
|
|
209
|
-
900: '#
|
|
210
|
-
1000: '#
|
|
211
|
-
1100: '#
|
|
212
|
-
1200: '#
|
|
213
|
-
M400: '#519e2d',
|
|
214
|
-
M600: '#47782c'
|
|
197
|
+
800: '#2c491b',
|
|
198
|
+
900: '#203614',
|
|
199
|
+
1000: '#16250e',
|
|
200
|
+
1100: '#111d0a',
|
|
201
|
+
1200: '#090e05'
|
|
215
202
|
},
|
|
216
203
|
mint: {
|
|
217
204
|
100: '#d6ffeb',
|
|
218
|
-
200: '#
|
|
219
|
-
300: '#
|
|
220
|
-
400: '#
|
|
221
|
-
500: '#
|
|
222
|
-
600: '#
|
|
223
|
-
700: '#
|
|
224
|
-
800: '#
|
|
225
|
-
900: '#
|
|
226
|
-
1000: '#
|
|
227
|
-
1100: '#
|
|
228
|
-
1200: '#
|
|
229
|
-
M400: '#299c66',
|
|
230
|
-
M600: '#2e8057'
|
|
205
|
+
200: '#9affce',
|
|
206
|
+
300: '#0afe89',
|
|
207
|
+
400: '#00d26d',
|
|
208
|
+
500: '#01b15c',
|
|
209
|
+
600: '#16a260',
|
|
210
|
+
700: '#2d7e55',
|
|
211
|
+
800: '#1b4b33',
|
|
212
|
+
900: '#143726',
|
|
213
|
+
1000: '#0e261a',
|
|
214
|
+
1100: '#0b1d14',
|
|
215
|
+
1200: '#050e0a'
|
|
231
216
|
},
|
|
232
217
|
teal: {
|
|
233
|
-
100: '#
|
|
234
|
-
200: '#
|
|
235
|
-
300: '#
|
|
236
|
-
400: '#
|
|
237
|
-
500: '#
|
|
238
|
-
600: '#
|
|
218
|
+
100: '#d4fefa',
|
|
219
|
+
200: '#88fdf1',
|
|
220
|
+
300: '#0bf8e1',
|
|
221
|
+
400: '#03cdb8',
|
|
222
|
+
500: '#02ad9c',
|
|
223
|
+
600: '#2a9d8f',
|
|
239
224
|
700: '#367a74',
|
|
240
|
-
800: '#
|
|
241
|
-
900: '#
|
|
242
|
-
1000: '#
|
|
243
|
-
1100: '#
|
|
244
|
-
1200: '#
|
|
245
|
-
M400: '#2d9e8f',
|
|
246
|
-
M600: '#3c7873'
|
|
225
|
+
800: '#254846',
|
|
226
|
+
900: '#1b3534',
|
|
227
|
+
1000: '#122423',
|
|
228
|
+
1100: '#0e1c1a',
|
|
229
|
+
1200: '#070d0d'
|
|
247
230
|
},
|
|
248
231
|
azure: {
|
|
249
|
-
100: '#
|
|
250
|
-
200: '#
|
|
251
|
-
300: '#
|
|
252
|
-
400: '#
|
|
253
|
-
500: '#
|
|
254
|
-
600: '#
|
|
255
|
-
700: '#
|
|
256
|
-
800: '#
|
|
257
|
-
900: '#
|
|
258
|
-
1000: '#
|
|
259
|
-
1100: '#
|
|
260
|
-
1200: '#
|
|
261
|
-
M400: '#5f8dcf',
|
|
262
|
-
M600: '#3a70b2'
|
|
232
|
+
100: '#eff7fe',
|
|
233
|
+
200: '#d9ecfc',
|
|
234
|
+
300: '#c4e0fa',
|
|
235
|
+
400: '#82bcf4',
|
|
236
|
+
500: '#4b9fee',
|
|
237
|
+
600: '#3191ea',
|
|
238
|
+
700: '#2770c3',
|
|
239
|
+
800: '#23446b',
|
|
240
|
+
900: '#1a3250',
|
|
241
|
+
1000: '#122238',
|
|
242
|
+
1100: '#0e1a2a',
|
|
243
|
+
1200: '#070d14'
|
|
263
244
|
},
|
|
264
245
|
royal: {
|
|
265
|
-
100: '#
|
|
266
|
-
200: '#
|
|
267
|
-
300: '#
|
|
268
|
-
400: '#
|
|
269
|
-
500: '#
|
|
270
|
-
600: '#
|
|
271
|
-
700: '#
|
|
272
|
-
800: '#
|
|
273
|
-
900: '#
|
|
274
|
-
1000: '#
|
|
275
|
-
1100: '#
|
|
276
|
-
1200: '#
|
|
277
|
-
M400: '#7986d8',
|
|
278
|
-
M600: '#4b61c3'
|
|
246
|
+
100: '#f4f5fc',
|
|
247
|
+
200: '#e7e9f8',
|
|
248
|
+
300: '#d8dcf4',
|
|
249
|
+
400: '#acb4e7',
|
|
250
|
+
500: '#8a96dd',
|
|
251
|
+
600: '#7a88d9',
|
|
252
|
+
700: '#4c67d3',
|
|
253
|
+
800: '#1833ab',
|
|
254
|
+
900: '#122680',
|
|
255
|
+
1000: '#0d1a5a',
|
|
256
|
+
1100: '#0a1445',
|
|
257
|
+
1200: '#050a25'
|
|
279
258
|
},
|
|
280
259
|
purple: {
|
|
281
|
-
100: '#
|
|
282
|
-
200: '#
|
|
283
|
-
300: '#
|
|
284
|
-
400: '#
|
|
285
|
-
500: '#
|
|
286
|
-
600: '#
|
|
260
|
+
100: '#f9f3fb',
|
|
261
|
+
200: '#f2e7f6',
|
|
262
|
+
300: '#e9d8f1',
|
|
263
|
+
400: '#d0a9e0',
|
|
264
|
+
500: '#bb86d3',
|
|
265
|
+
600: '#b276cd',
|
|
287
266
|
700: '#9256b1',
|
|
288
|
-
800: '#
|
|
289
|
-
900: '#
|
|
290
|
-
1000: '#
|
|
291
|
-
1100: '#
|
|
292
|
-
1200: '#
|
|
293
|
-
M400: '#b072cc',
|
|
294
|
-
M600: '#9358b0'
|
|
267
|
+
800: '#58209a',
|
|
268
|
+
900: '#411973',
|
|
269
|
+
1000: '#2e1150',
|
|
270
|
+
1100: '#230d3f',
|
|
271
|
+
1200: '#120720'
|
|
295
272
|
}
|
|
296
273
|
};
|
|
297
274
|
|
|
@@ -447,6 +424,20 @@ const lineHeights = {
|
|
|
447
424
|
xxl: `${BASE * 8}px`,
|
|
448
425
|
xxxl: `${BASE * 11}px`
|
|
449
426
|
};
|
|
427
|
+
const opacity = {
|
|
428
|
+
100: 0.08,
|
|
429
|
+
200: 0.16,
|
|
430
|
+
300: 0.24,
|
|
431
|
+
400: 0.32,
|
|
432
|
+
500: 0.4,
|
|
433
|
+
600: 0.48,
|
|
434
|
+
700: 0.56,
|
|
435
|
+
800: 0.64,
|
|
436
|
+
900: 0.72,
|
|
437
|
+
1000: 0.8,
|
|
438
|
+
1100: 0.88,
|
|
439
|
+
1200: 0.96
|
|
440
|
+
};
|
|
450
441
|
const palette = {
|
|
451
442
|
...PALETTE
|
|
452
443
|
};
|
|
@@ -488,6 +479,7 @@ const DEFAULT_THEME = {
|
|
|
488
479
|
fontWeights,
|
|
489
480
|
iconSizes,
|
|
490
481
|
lineHeights,
|
|
482
|
+
opacity,
|
|
491
483
|
palette,
|
|
492
484
|
rtl: false,
|
|
493
485
|
shadowWidths,
|
|
@@ -500,7 +492,7 @@ const ThemeProvider = _ref => {
|
|
|
500
492
|
theme,
|
|
501
493
|
...other
|
|
502
494
|
} = _ref;
|
|
503
|
-
return React__default.default.createElement(
|
|
495
|
+
return React__default.default.createElement(styled.ThemeProvider, Object.assign({
|
|
504
496
|
theme: theme
|
|
505
497
|
}, other));
|
|
506
498
|
};
|
|
@@ -721,7 +713,7 @@ const toHex = (hue, shade, offset, scheme) => {
|
|
|
721
713
|
}
|
|
722
714
|
return retVal;
|
|
723
715
|
};
|
|
724
|
-
const toColor = (colors, palette, scheme, hue, shade, offset, transparency) => {
|
|
716
|
+
const toColor = (colors, palette, opacity, scheme, hue, shade, offset, transparency) => {
|
|
725
717
|
let retVal;
|
|
726
718
|
let _hue = colors[hue] || hue;
|
|
727
719
|
if (Object.hasOwn(palette, _hue)) {
|
|
@@ -744,7 +736,11 @@ const toColor = (colors, palette, scheme, hue, shade, offset, transparency) => {
|
|
|
744
736
|
}
|
|
745
737
|
}
|
|
746
738
|
if (retVal && transparency) {
|
|
747
|
-
|
|
739
|
+
const alpha = transparency > 1 ? opacity[transparency] : transparency;
|
|
740
|
+
if (alpha === undefined) {
|
|
741
|
+
throw new Error('Error: invalid `transparency` parameter');
|
|
742
|
+
}
|
|
743
|
+
retVal = polished.rgba(retVal, alpha);
|
|
748
744
|
}
|
|
749
745
|
return retVal;
|
|
750
746
|
};
|
|
@@ -794,7 +790,8 @@ const getColor = memoize__default.default(_ref => {
|
|
|
794
790
|
}
|
|
795
791
|
}
|
|
796
792
|
if (_hue) {
|
|
797
|
-
|
|
793
|
+
const opacity = theme.opacity && Object.keys(theme.opacity).length > 0 ? theme.opacity : DEFAULT_THEME.opacity;
|
|
794
|
+
retVal = toColor(colors, palette, opacity, scheme, _hue, _shade, _offset, _transparency);
|
|
798
795
|
}
|
|
799
796
|
if (retVal === undefined) {
|
|
800
797
|
throw new Error('Error: invalid `getColor` parameters');
|
|
@@ -824,6 +821,37 @@ const getColor = memoize__default.default(_ref => {
|
|
|
824
821
|
});
|
|
825
822
|
});
|
|
826
823
|
|
|
824
|
+
const getCheckeredBackground = _ref => {
|
|
825
|
+
let {
|
|
826
|
+
theme,
|
|
827
|
+
size,
|
|
828
|
+
overlay,
|
|
829
|
+
positionY = 0,
|
|
830
|
+
repeat = 'repeat'
|
|
831
|
+
} = _ref;
|
|
832
|
+
const color = getColor({
|
|
833
|
+
theme,
|
|
834
|
+
variable: 'border.default'
|
|
835
|
+
});
|
|
836
|
+
const dimensions = `${size}px ${size}px`;
|
|
837
|
+
const positionX1 = theme.rtl ? '100%' : '0';
|
|
838
|
+
const positionX2 = theme.rtl ? `calc(100% - ${size / 2}px)` : `${size / 2}px`;
|
|
839
|
+
const position1 = `${positionX1} ${positionY}px`;
|
|
840
|
+
const position2 = `${positionX2} ${size / 2 + positionY}px`;
|
|
841
|
+
const position3 = `${positionX2} ${positionY}px`;
|
|
842
|
+
const position4 = `${positionX1} ${size / -2 + positionY}px`;
|
|
843
|
+
let retVal = `
|
|
844
|
+
linear-gradient(45deg, ${color} 25%, transparent 25%) ${position1} / ${dimensions} ${repeat},
|
|
845
|
+
linear-gradient(45deg, transparent 75%, ${color} 75%) ${position2} / ${dimensions} ${repeat},
|
|
846
|
+
linear-gradient(135deg, ${color} 25%, transparent 25%) ${position3} / ${dimensions} ${repeat},
|
|
847
|
+
linear-gradient(135deg, transparent 75%, ${color} 75%) ${position4} / ${dimensions} ${repeat}
|
|
848
|
+
`;
|
|
849
|
+
if (overlay) {
|
|
850
|
+
retVal = overlay.startsWith('linear-gradient') ? `${overlay}, ${retVal}` : `linear-gradient(${overlay}, ${overlay}), ${retVal}`;
|
|
851
|
+
}
|
|
852
|
+
return retVal;
|
|
853
|
+
};
|
|
854
|
+
|
|
827
855
|
const DEFAULT_SHADE = 600;
|
|
828
856
|
const adjust = (color, expected, actual) => {
|
|
829
857
|
if (expected !== actual) {
|
|
@@ -1050,8 +1078,8 @@ const exponentialSymbols = {
|
|
|
1050
1078
|
};
|
|
1051
1079
|
const animationStyles$1 = (position, modifier) => {
|
|
1052
1080
|
const property = position.split('-')[0];
|
|
1053
|
-
const animationName =
|
|
1054
|
-
return
|
|
1081
|
+
const animationName = styled.keyframes(["0%,66%{", ":2px;border:transparent;}"], property);
|
|
1082
|
+
return styled.css(["&", "::before,&", "::after{animation:0.3s ease-in-out ", ";}"], modifier, modifier, animationName);
|
|
1055
1083
|
};
|
|
1056
1084
|
const positionStyles = (position, size, inset) => {
|
|
1057
1085
|
const margin = polished.math(`${size} / -2`);
|
|
@@ -1062,28 +1090,28 @@ const positionStyles = (position, size, inset) => {
|
|
|
1062
1090
|
if (position.startsWith('top')) {
|
|
1063
1091
|
propertyRadius = 'border-bottom-right-radius';
|
|
1064
1092
|
clipPath = 'polygon(100% 0, 100% 1px, 1px 100%, 0 100%, 0 0)';
|
|
1065
|
-
positionCss =
|
|
1093
|
+
positionCss = styled.css(["top:", ";right:", ";left:", ";margin-left:", ";"], placement, position === 'top-right' && size, position === 'top' ? '50%' : position === 'top-left' && size, position === 'top' && margin);
|
|
1066
1094
|
} else if (position.startsWith('right')) {
|
|
1067
1095
|
propertyRadius = 'border-bottom-left-radius';
|
|
1068
1096
|
clipPath = 'polygon(100% 0, 100% 100%, calc(100% - 1px) 100%, 0 1px, 0 0)';
|
|
1069
|
-
positionCss =
|
|
1097
|
+
positionCss = styled.css(["top:", ";right:", ";bottom:", ";margin-top:", ";"], position === 'right' ? '50%' : position === 'right-top' && size, placement, position === 'right-bottom' && size, position === 'right' && margin);
|
|
1070
1098
|
} else if (position.startsWith('bottom')) {
|
|
1071
1099
|
propertyRadius = 'border-top-left-radius';
|
|
1072
1100
|
clipPath = 'polygon(100% 0, calc(100% - 1px) 0, 0 calc(100% - 1px), 0 100%, 100% 100%)';
|
|
1073
|
-
positionCss =
|
|
1101
|
+
positionCss = styled.css(["right:", ";bottom:", ";left:", ";margin-left:", ";"], position === 'bottom-right' && size, placement, position === 'bottom' ? '50%' : position === 'bottom-left' && size, position === 'bottom' && margin);
|
|
1074
1102
|
} else if (position.startsWith('left')) {
|
|
1075
1103
|
propertyRadius = 'border-top-right-radius';
|
|
1076
1104
|
clipPath = 'polygon(0 100%, 100% 100%, 100% calc(100% - 1px), 1px 0, 0 0)';
|
|
1077
|
-
positionCss =
|
|
1105
|
+
positionCss = styled.css(["top:", ";bottom:", ";left:", ";margin-top:", ";"], position === 'left' ? '50%' : position === 'left-top' && size, size, placement, position === 'left' && margin);
|
|
1078
1106
|
}
|
|
1079
|
-
return
|
|
1107
|
+
return styled.css(["&::before{", ":100%;clip-path:", ";}&::before,&::after{", "}"], propertyRadius, clipPath, positionCss);
|
|
1080
1108
|
};
|
|
1081
1109
|
function arrowStyles(position) {
|
|
1082
1110
|
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1083
1111
|
const size = options.size || '6px';
|
|
1084
1112
|
const inset = options.inset || '0';
|
|
1085
1113
|
const squareSize = polished.math(`${size} * 2 / sqrt(2)`, exponentialSymbols);
|
|
1086
|
-
return
|
|
1114
|
+
return styled.css(["position:relative;&::before{border-width:inherit;border-style:inherit;border-color:transparent;background-clip:content-box;}&::after{z-index:-1;border:inherit;box-shadow:inherit;}&::before,&::after{position:absolute;transform:rotate(45deg);background-color:inherit;box-sizing:inherit;width:", ";height:", ";content:'';}", ";", ";"], squareSize, squareSize, positionStyles(position, squareSize, inset), options.animationModifier && animationStyles$1(position, options.animationModifier));
|
|
1087
1115
|
}
|
|
1088
1116
|
|
|
1089
1117
|
const useDocument = theme => {
|
|
@@ -1145,12 +1173,12 @@ const animationStyles = (position, options) => {
|
|
|
1145
1173
|
} else {
|
|
1146
1174
|
transformFunction = 'translateX';
|
|
1147
1175
|
}
|
|
1148
|
-
const animationName =
|
|
1149
|
-
return
|
|
1176
|
+
const animationName = styled.keyframes(["0%{transform:", "(", ");}"], transformFunction, translateValue);
|
|
1177
|
+
return styled.css(["&", " ", "{animation:0.2s cubic-bezier(0.15,0.85,0.35,1.2) ", ";}"], options.animationModifier, options.childSelector || '> *', animationName);
|
|
1150
1178
|
};
|
|
1151
1179
|
const hiddenStyles = options => {
|
|
1152
1180
|
const transition = 'opacity 0.2s ease-in-out, 0.2s visibility 0s linear';
|
|
1153
|
-
return
|
|
1181
|
+
return styled.css(["transition:", ";visibility:hidden;opacity:0;"], options.animationModifier && transition);
|
|
1154
1182
|
};
|
|
1155
1183
|
function menuStyles(position) {
|
|
1156
1184
|
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
@@ -1165,7 +1193,7 @@ function menuStyles(position) {
|
|
|
1165
1193
|
} else {
|
|
1166
1194
|
marginProperty = 'margin-right';
|
|
1167
1195
|
}
|
|
1168
|
-
return
|
|
1196
|
+
return styled.css(["position:absolute;z-index:", ";", ":", ";line-height:0;font-size:0.01px;& ", "{display:inline-block;position:relative;margin:0;box-sizing:border-box;border:", " ", ";border-radius:", ";box-shadow:", ";background-color:", ";cursor:default;padding:0;text-align:", ";white-space:normal;color:", ";font-size:", ";font-weight:", ";direction:", ";:focus{outline:none;}}", ";", ";"], options.zIndex || 0, marginProperty, options.margin, options.childSelector || '> *', theme.borders.sm, getColor({
|
|
1169
1197
|
theme,
|
|
1170
1198
|
variable: 'border.default'
|
|
1171
1199
|
}), theme.borderRadii.md, theme.shadows.lg(`${theme.space.base * 5}px`, `${theme.space.base * 7.5}px`, getColor({
|
|
@@ -1211,9 +1239,21 @@ const focusStyles = _ref => {
|
|
|
1211
1239
|
outline = `${polished.math(`${theme.shadowWidths[shadowWidth]} - ${theme.shadowWidths[spacerWidth]}`)} solid transparent`;
|
|
1212
1240
|
outlineOffset = theme.shadowWidths[spacerWidth];
|
|
1213
1241
|
}
|
|
1214
|
-
return
|
|
1242
|
+
return styled.css(["&:focus{outline:none;}", "{outline:", ";outline-offset:", ";box-shadow:", ";", "}"], selector, outline, outlineOffset, _boxShadow, styles);
|
|
1215
1243
|
};
|
|
1216
1244
|
|
|
1245
|
+
const StyledBaseIcon = styled__default.default(_ref => {
|
|
1246
|
+
let {
|
|
1247
|
+
children,
|
|
1248
|
+
theme,
|
|
1249
|
+
...props
|
|
1250
|
+
} = _ref;
|
|
1251
|
+
return React__default.default.cloneElement(React.Children.only(children), props);
|
|
1252
|
+
}).withConfig({
|
|
1253
|
+
displayName: "StyledBaseIcon",
|
|
1254
|
+
componentId: "sc-1moykgb-0"
|
|
1255
|
+
})([""]);
|
|
1256
|
+
|
|
1217
1257
|
const ARROW_POSITION = ['top', 'top-left', 'top-right', 'right', 'right-top', 'right-bottom', 'bottom', 'bottom-left', 'bottom-right', 'left', 'left-top', 'left-bottom'];
|
|
1218
1258
|
const MENU_POSITION = ['top', 'right', 'bottom', 'left'];
|
|
1219
1259
|
const PLACEMENT = ['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'end', 'end-top', 'end-bottom', 'start', 'start-top', 'start-bottom'];
|
|
@@ -1225,10 +1265,12 @@ exports.PALETTE = PALETTE;
|
|
|
1225
1265
|
exports.PALETTE_V8 = PALETTE_V8;
|
|
1226
1266
|
exports.PLACEMENT = PLACEMENT;
|
|
1227
1267
|
exports.SELECTOR_FOCUS_VISIBLE = SELECTOR_FOCUS_VISIBLE;
|
|
1268
|
+
exports.StyledBaseIcon = StyledBaseIcon;
|
|
1228
1269
|
exports.ThemeProvider = ThemeProvider;
|
|
1229
1270
|
exports.arrowStyles = arrowStyles;
|
|
1230
1271
|
exports.focusStyles = focusStyles;
|
|
1231
1272
|
exports.getArrowPosition = getArrowPosition;
|
|
1273
|
+
exports.getCheckeredBackground = getCheckeredBackground;
|
|
1232
1274
|
exports.getColor = getColor;
|
|
1233
1275
|
exports.getColorV8 = getColorV8;
|
|
1234
1276
|
exports.getFloatingPlacements = getFloatingPlacements;
|