@flodesk/grain 10.17.4 → 10.19.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/es/components/arrange.js +74 -34
- package/es/components/autocomplete.js +132 -28
- package/es/components/autocomplete2.js +359 -0
- package/es/components/badge.js +7 -8
- package/es/components/box.js +85 -14
- package/es/components/box2.js +223 -0
- package/es/components/button.js +8 -26
- package/es/components/checkbox.js +12 -18
- package/es/components/dropdown.js +81 -28
- package/es/components/flex.js +72 -36
- package/es/components/index.js +5 -1
- package/es/components/link.js +27 -16
- package/es/components/modal.js +89 -68
- package/es/components/nav.js +9 -19
- package/es/components/pagination.js +4 -4
- package/es/components/popover.js +33 -12
- package/es/components/provider.js +14 -0
- package/es/components/select.js +12 -10
- package/es/components/slider.js +6 -17
- package/es/components/spinner.js +4 -14
- package/es/components/stack.js +5 -4
- package/es/components/switch.js +5 -17
- package/es/components/tab.js +1 -1
- package/es/components/text-button.js +13 -12
- package/es/components/text-input.js +64 -47
- package/es/components/text.js +84 -28
- package/es/components/text2/index.js +100 -0
- package/es/components/text2/styles.module.css +22 -0
- package/es/components/textarea.js +34 -20
- package/es/components/toast.js +16 -53
- package/es/components/tooltip.js +4 -4
- package/es/foundational/field.js +52 -28
- package/es/foundational/menu.js +138 -60
- package/es/foundational/styles.js +11 -11
- package/es/hooks/index.js +2 -1
- package/es/hooks/useOnClickOutside.js +7 -6
- package/es/hooks/usePrev.js +8 -0
- package/es/icons/icon-archive.js +21 -0
- package/es/icons/icon-at.js +21 -0
- package/es/icons/icon-bold.js +28 -0
- package/es/icons/icon-bullet-list.js +21 -0
- package/es/icons/icon-column-and-rows.js +21 -0
- package/es/icons/icon-columns-and-row.js +21 -0
- package/es/icons/icon-columns.js +21 -0
- package/es/icons/icon-folder-move.js +21 -0
- package/es/icons/icon-folder-remove.js +21 -0
- package/es/icons/icon-italic.js +28 -0
- package/es/icons/icon-number-list.js +21 -0
- package/es/icons/icon-row-and-columns.js +21 -0
- package/es/icons/icon-rows-and-column.js +21 -0
- package/es/icons/icon-rows.js +21 -0
- package/es/icons/icon-strike.js +28 -0
- package/es/icons/icon-text-justify.js +21 -0
- package/es/icons/icon-underline.js +28 -0
- package/es/icons/index.js +18 -1
- package/es/index.js +2 -1
- package/es/styles/base.js +2 -0
- package/es/styles/colors/core.js +2 -0
- package/es/styles/colors/experimental.js +2 -0
- package/es/styles/colors/index.js +4 -0
- package/es/styles/colors/theme.js +2 -0
- package/es/styles/index.js +6 -0
- package/es/styles/shadows.js +2 -0
- package/es/styles/utilities.js +108 -0
- package/es/styles/variables.js +2 -0
- package/es/types.js +18 -7
- package/es/utilities/attributes.js +66 -0
- package/es/utilities/helpers.js +13 -1
- package/es/utilities/index.js +3 -1
- package/es/utilities/responsive.js +3 -0
- package/es/utilities/style-config.js +442 -0
- package/es/utilities/styles.js +14 -2
- package/es/variables/breakpoints.js +9 -0
- package/es/variables/colors.js +2 -1
- package/es/variables/index.js +2 -1
- package/es/variables/vars.js +3 -0
- package/package.json +1 -1
- package/es/styles/base.css +0 -53
- package/es/styles/colors/core.css +0 -74
- package/es/styles/colors/experimental.css +0 -3
- package/es/styles/colors/theme.css +0 -92
- package/es/styles/shadows.css +0 -60
- package/es/styles/variables.css +0 -66
|
@@ -0,0 +1,442 @@
|
|
|
1
|
+
import "core-js/modules/es.array.concat.js";
|
|
2
|
+
import "core-js/modules/es.object.keys.js";
|
|
3
|
+
import "core-js/modules/es.array.map.js";
|
|
4
|
+
import "core-js/modules/es.array.includes.js";
|
|
5
|
+
import "core-js/modules/es.string.includes.js";
|
|
6
|
+
import "core-js/modules/es.array.find.js";
|
|
7
|
+
import "core-js/modules/es.object.to-string.js";
|
|
8
|
+
import "core-js/modules/es.object.values.js";
|
|
9
|
+
import "core-js/modules/es.symbol.js";
|
|
10
|
+
import "core-js/modules/es.symbol.description.js";
|
|
11
|
+
import "core-js/modules/es.symbol.iterator.js";
|
|
12
|
+
import "core-js/modules/es.array.iterator.js";
|
|
13
|
+
import "core-js/modules/es.string.iterator.js";
|
|
14
|
+
import "core-js/modules/web.dom-collections.iterator.js";
|
|
15
|
+
import "core-js/modules/es.array.from.js";
|
|
16
|
+
import "core-js/modules/es.array.slice.js";
|
|
17
|
+
import "core-js/modules/es.regexp.exec.js";
|
|
18
|
+
|
|
19
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
20
|
+
|
|
21
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
22
|
+
|
|
23
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
24
|
+
|
|
25
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
26
|
+
|
|
27
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
28
|
+
|
|
29
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
30
|
+
|
|
31
|
+
import { alignSelfs, borderWidths, cursors, overflows, positions, sides, textAlignments, textDisplays, textTransforms } from '../types';
|
|
32
|
+
import { vars } from '../variables';
|
|
33
|
+
import { getDimension, getSpace, getTextSize, isSpaceVar } from './responsive';
|
|
34
|
+
import { getColor, getRadius, getShadow, getTransition, getWeight, isColorVar, isRadiusVar, isShadowVar, isTrasitionVar } from './styles';
|
|
35
|
+
var spaces = [].concat(_toConsumableArray(Object.keys(vars.spaces)), _toConsumableArray(Object.keys(vars.spaceUtils)));
|
|
36
|
+
var colors = [].concat(_toConsumableArray(Object.keys(vars.colors)), _toConsumableArray(Object.keys(vars.colorUtils)));
|
|
37
|
+
var shadows = Object.keys(vars.shadows);
|
|
38
|
+
var radii = Object.keys(vars.radii);
|
|
39
|
+
var transitions = [].concat(_toConsumableArray(Object.keys(vars.transitions)), _toConsumableArray(Object.keys(vars.transitionUtils)));
|
|
40
|
+
var sizes = Object.keys(vars.texts);
|
|
41
|
+
var weights = Object.keys(vars.weights);
|
|
42
|
+
|
|
43
|
+
var borderSideToStyle = function borderSideToStyle(side) {
|
|
44
|
+
if (side === 'all') return 'solid';
|
|
45
|
+
var borderConfig = {
|
|
46
|
+
top: ['top'],
|
|
47
|
+
right: ['right'],
|
|
48
|
+
bottom: ['bottom'],
|
|
49
|
+
left: ['left'],
|
|
50
|
+
y: ['top', 'bottom'],
|
|
51
|
+
x: ['right', 'left']
|
|
52
|
+
};
|
|
53
|
+
var borderStyles = ['top', 'right', 'bottom', 'left'].map(function (s) {
|
|
54
|
+
return borderConfig[side].includes(s) ? 'solid' : 'none';
|
|
55
|
+
});
|
|
56
|
+
return borderStyles.join(' ');
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export var styleConfig = {
|
|
60
|
+
spaceProps: {
|
|
61
|
+
props: [{
|
|
62
|
+
propName: 'padding',
|
|
63
|
+
property: 'padding',
|
|
64
|
+
short: 'p'
|
|
65
|
+
}, {
|
|
66
|
+
propName: 'paddingTop',
|
|
67
|
+
property: 'padding-top',
|
|
68
|
+
short: 'pt'
|
|
69
|
+
}, {
|
|
70
|
+
propName: 'paddingBottom',
|
|
71
|
+
property: 'padding-bottom',
|
|
72
|
+
short: 'pb'
|
|
73
|
+
}, {
|
|
74
|
+
propName: 'paddingLeft',
|
|
75
|
+
property: 'padding-left',
|
|
76
|
+
short: 'pl'
|
|
77
|
+
}, {
|
|
78
|
+
propName: 'paddingRight',
|
|
79
|
+
property: 'padding-right',
|
|
80
|
+
short: 'pr'
|
|
81
|
+
}, {
|
|
82
|
+
propName: 'paddingX',
|
|
83
|
+
property: 'padding-inline',
|
|
84
|
+
short: 'px'
|
|
85
|
+
}, {
|
|
86
|
+
propName: 'paddingY',
|
|
87
|
+
property: 'padding-block',
|
|
88
|
+
short: 'py'
|
|
89
|
+
}, {
|
|
90
|
+
propName: 'margin',
|
|
91
|
+
property: 'margin',
|
|
92
|
+
short: 'm'
|
|
93
|
+
}, {
|
|
94
|
+
propName: 'marginTop',
|
|
95
|
+
property: 'margin-top',
|
|
96
|
+
short: 'mt'
|
|
97
|
+
}, {
|
|
98
|
+
propName: 'marginBottom',
|
|
99
|
+
property: 'margin-bottom',
|
|
100
|
+
short: 'mb'
|
|
101
|
+
}, {
|
|
102
|
+
propName: 'marginLeft',
|
|
103
|
+
property: 'margin-left',
|
|
104
|
+
short: 'ml'
|
|
105
|
+
}, {
|
|
106
|
+
propName: 'marginRight',
|
|
107
|
+
property: 'margin-right',
|
|
108
|
+
short: 'mr'
|
|
109
|
+
}, {
|
|
110
|
+
propName: 'marginX',
|
|
111
|
+
property: 'margin-inline',
|
|
112
|
+
short: 'mx'
|
|
113
|
+
}, {
|
|
114
|
+
propName: 'marginY',
|
|
115
|
+
property: 'margin-block',
|
|
116
|
+
short: 'my'
|
|
117
|
+
}, {
|
|
118
|
+
propName: 'top',
|
|
119
|
+
property: 'top',
|
|
120
|
+
short: 't'
|
|
121
|
+
}, {
|
|
122
|
+
propName: 'bottom',
|
|
123
|
+
property: 'bottom',
|
|
124
|
+
short: 'b'
|
|
125
|
+
}, {
|
|
126
|
+
propName: 'left',
|
|
127
|
+
property: 'left',
|
|
128
|
+
short: 'l'
|
|
129
|
+
}, {
|
|
130
|
+
propName: 'right',
|
|
131
|
+
property: 'right',
|
|
132
|
+
short: 'r'
|
|
133
|
+
}],
|
|
134
|
+
valueTransformer: getSpace,
|
|
135
|
+
variableChecker: isSpaceVar,
|
|
136
|
+
variables: spaces,
|
|
137
|
+
isResponsive: true
|
|
138
|
+
},
|
|
139
|
+
dimensionProps: {
|
|
140
|
+
props: [{
|
|
141
|
+
propName: 'width',
|
|
142
|
+
property: 'width',
|
|
143
|
+
short: 'w'
|
|
144
|
+
}, {
|
|
145
|
+
propName: 'minWidth',
|
|
146
|
+
property: 'min-width',
|
|
147
|
+
short: 'min-w'
|
|
148
|
+
}, {
|
|
149
|
+
propName: 'maxWidth',
|
|
150
|
+
property: 'max-width',
|
|
151
|
+
short: 'max-w'
|
|
152
|
+
}, {
|
|
153
|
+
propName: 'height',
|
|
154
|
+
property: 'height',
|
|
155
|
+
short: 'h'
|
|
156
|
+
}, {
|
|
157
|
+
propName: 'minHeight',
|
|
158
|
+
property: 'min-height',
|
|
159
|
+
short: 'min-h'
|
|
160
|
+
}, {
|
|
161
|
+
propName: 'maxHeight',
|
|
162
|
+
property: 'max-height',
|
|
163
|
+
short: 'max-h'
|
|
164
|
+
}],
|
|
165
|
+
valueTransformer: getDimension,
|
|
166
|
+
isResponsive: true
|
|
167
|
+
},
|
|
168
|
+
colorProps: {
|
|
169
|
+
props: [{
|
|
170
|
+
propName: 'color',
|
|
171
|
+
property: 'color',
|
|
172
|
+
short: 'c'
|
|
173
|
+
}, {
|
|
174
|
+
propName: 'colorHover',
|
|
175
|
+
property: 'color',
|
|
176
|
+
short: 'c-h'
|
|
177
|
+
}, {
|
|
178
|
+
propName: 'backgroundColor',
|
|
179
|
+
property: 'background-color',
|
|
180
|
+
short: 'bgc'
|
|
181
|
+
}, {
|
|
182
|
+
propName: 'backgroundColorHover',
|
|
183
|
+
property: 'background-color',
|
|
184
|
+
short: 'bgc-h'
|
|
185
|
+
}],
|
|
186
|
+
valueTransformer: getColor,
|
|
187
|
+
variableChecker: isColorVar,
|
|
188
|
+
variables: colors
|
|
189
|
+
},
|
|
190
|
+
shadowProps: {
|
|
191
|
+
props: [{
|
|
192
|
+
propName: 'shadow',
|
|
193
|
+
property: 'box-shadow',
|
|
194
|
+
short: 'sh'
|
|
195
|
+
}, {
|
|
196
|
+
propName: 'shadowHover',
|
|
197
|
+
property: 'box-shadow',
|
|
198
|
+
short: 'sh-h'
|
|
199
|
+
}],
|
|
200
|
+
valueTransformer: getShadow,
|
|
201
|
+
variableChecker: isShadowVar,
|
|
202
|
+
variables: shadows
|
|
203
|
+
},
|
|
204
|
+
radiusProps: {
|
|
205
|
+
props: [{
|
|
206
|
+
propName: 'radius',
|
|
207
|
+
property: 'border-radius',
|
|
208
|
+
short: 'rad'
|
|
209
|
+
}],
|
|
210
|
+
valueTransformer: getRadius,
|
|
211
|
+
variableChecker: isRadiusVar,
|
|
212
|
+
variables: radii
|
|
213
|
+
},
|
|
214
|
+
orderProps: {
|
|
215
|
+
props: [{
|
|
216
|
+
propName: 'order',
|
|
217
|
+
property: 'order',
|
|
218
|
+
short: 'ord'
|
|
219
|
+
}]
|
|
220
|
+
},
|
|
221
|
+
flexProps: {
|
|
222
|
+
props: [{
|
|
223
|
+
propName: 'flex',
|
|
224
|
+
property: 'flex',
|
|
225
|
+
short: 'flx'
|
|
226
|
+
}],
|
|
227
|
+
isResponsive: true
|
|
228
|
+
},
|
|
229
|
+
zIndexProps: {
|
|
230
|
+
props: [{
|
|
231
|
+
propName: 'zIndex',
|
|
232
|
+
property: 'z-index',
|
|
233
|
+
short: 'z'
|
|
234
|
+
}]
|
|
235
|
+
},
|
|
236
|
+
positionProps: {
|
|
237
|
+
props: [{
|
|
238
|
+
propName: 'position',
|
|
239
|
+
property: 'position',
|
|
240
|
+
short: 'pos'
|
|
241
|
+
}],
|
|
242
|
+
variableChecker: function variableChecker(value) {
|
|
243
|
+
return positions.includes(value);
|
|
244
|
+
},
|
|
245
|
+
variables: positions
|
|
246
|
+
},
|
|
247
|
+
overflowProps: {
|
|
248
|
+
props: [{
|
|
249
|
+
propName: 'overflow',
|
|
250
|
+
property: 'overflow',
|
|
251
|
+
short: 'of'
|
|
252
|
+
}, {
|
|
253
|
+
propName: 'overflowX',
|
|
254
|
+
property: 'overflow-x',
|
|
255
|
+
short: 'of-x'
|
|
256
|
+
}, {
|
|
257
|
+
propName: 'overflowY',
|
|
258
|
+
property: 'overflow-y',
|
|
259
|
+
short: 'of-y'
|
|
260
|
+
}],
|
|
261
|
+
variableChecker: function variableChecker(value) {
|
|
262
|
+
return overflows.includes(value);
|
|
263
|
+
},
|
|
264
|
+
variables: overflows
|
|
265
|
+
},
|
|
266
|
+
transitionProps: {
|
|
267
|
+
props: [{
|
|
268
|
+
propName: 'transition',
|
|
269
|
+
property: 'transition',
|
|
270
|
+
short: 'tr'
|
|
271
|
+
}, {
|
|
272
|
+
propName: 'transitionHover',
|
|
273
|
+
property: 'transition',
|
|
274
|
+
short: 'tr-h'
|
|
275
|
+
}],
|
|
276
|
+
valueTransformer: getTransition,
|
|
277
|
+
variableChecker: isTrasitionVar,
|
|
278
|
+
variables: transitions
|
|
279
|
+
},
|
|
280
|
+
cursorProps: {
|
|
281
|
+
props: [{
|
|
282
|
+
propName: 'cursor',
|
|
283
|
+
property: 'cursor',
|
|
284
|
+
short: 'cur'
|
|
285
|
+
}],
|
|
286
|
+
variableChecker: function variableChecker(value) {
|
|
287
|
+
return cursors.includes(value);
|
|
288
|
+
},
|
|
289
|
+
variables: cursors
|
|
290
|
+
},
|
|
291
|
+
aspectRatioProps: {
|
|
292
|
+
props: [{
|
|
293
|
+
propName: 'aspectRatio',
|
|
294
|
+
property: 'aspect-ratio',
|
|
295
|
+
short: 'ar'
|
|
296
|
+
}]
|
|
297
|
+
},
|
|
298
|
+
sizeProps: {
|
|
299
|
+
props: [{
|
|
300
|
+
propName: 'size',
|
|
301
|
+
property: 'font-size',
|
|
302
|
+
short: 'txt'
|
|
303
|
+
}],
|
|
304
|
+
isResponsive: true,
|
|
305
|
+
variables: sizes,
|
|
306
|
+
valueTransformer: getTextSize,
|
|
307
|
+
variableChecker: function variableChecker(value) {
|
|
308
|
+
return sizes.includes(value);
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
opacityProps: {
|
|
312
|
+
props: [{
|
|
313
|
+
propName: 'opacity',
|
|
314
|
+
property: 'opacity',
|
|
315
|
+
short: 'op'
|
|
316
|
+
}, {
|
|
317
|
+
propName: 'opacityHover',
|
|
318
|
+
property: 'opacity',
|
|
319
|
+
short: 'op-h'
|
|
320
|
+
}]
|
|
321
|
+
},
|
|
322
|
+
alignSelfProps: {
|
|
323
|
+
props: [{
|
|
324
|
+
propName: 'alignSelf',
|
|
325
|
+
property: 'align-self',
|
|
326
|
+
short: 'als'
|
|
327
|
+
}],
|
|
328
|
+
variables: alignSelfs,
|
|
329
|
+
variableChecker: function variableChecker(value) {
|
|
330
|
+
return alignSelfs.includes(value);
|
|
331
|
+
}
|
|
332
|
+
},
|
|
333
|
+
borderColorProps: {
|
|
334
|
+
props: [{
|
|
335
|
+
propName: 'borderColor',
|
|
336
|
+
property: 'border-color',
|
|
337
|
+
short: 'bdc'
|
|
338
|
+
}, {
|
|
339
|
+
propName: 'borderColorHover',
|
|
340
|
+
property: 'border-color',
|
|
341
|
+
short: 'bdc-h'
|
|
342
|
+
}],
|
|
343
|
+
valueTransformer: getColor,
|
|
344
|
+
variableChecker: isColorVar,
|
|
345
|
+
variables: colors
|
|
346
|
+
},
|
|
347
|
+
borderWidthProps: {
|
|
348
|
+
props: [{
|
|
349
|
+
propName: 'borderWidth',
|
|
350
|
+
property: 'border-width',
|
|
351
|
+
short: 'bdw'
|
|
352
|
+
}],
|
|
353
|
+
valueTransformer: function valueTransformer(borderWidth) {
|
|
354
|
+
return borderWidth;
|
|
355
|
+
},
|
|
356
|
+
variables: borderWidths,
|
|
357
|
+
variableChecker: function variableChecker(value) {
|
|
358
|
+
return borderWidths.includes(value);
|
|
359
|
+
}
|
|
360
|
+
},
|
|
361
|
+
borderSideProps: {
|
|
362
|
+
props: [{
|
|
363
|
+
propName: 'borderSide',
|
|
364
|
+
property: 'border-style',
|
|
365
|
+
short: 'bds'
|
|
366
|
+
}],
|
|
367
|
+
valueTransformer: borderSideToStyle,
|
|
368
|
+
variables: sides,
|
|
369
|
+
variableChecker: function variableChecker(value) {
|
|
370
|
+
return sides.includes(value);
|
|
371
|
+
}
|
|
372
|
+
},
|
|
373
|
+
alignProps: {
|
|
374
|
+
props: [{
|
|
375
|
+
propName: 'align',
|
|
376
|
+
property: 'text-align',
|
|
377
|
+
short: 'al'
|
|
378
|
+
}],
|
|
379
|
+
variables: textAlignments,
|
|
380
|
+
variableChecker: function variableChecker(value) {
|
|
381
|
+
return textAlignments.includes(value);
|
|
382
|
+
},
|
|
383
|
+
isResponsive: true
|
|
384
|
+
},
|
|
385
|
+
weightProps: {
|
|
386
|
+
props: [{
|
|
387
|
+
propName: 'weight',
|
|
388
|
+
property: 'font-weight',
|
|
389
|
+
short: 'w'
|
|
390
|
+
}],
|
|
391
|
+
variables: weights,
|
|
392
|
+
variableChecker: function variableChecker(value) {
|
|
393
|
+
return weights.includes(value);
|
|
394
|
+
},
|
|
395
|
+
valueTransformer: getWeight
|
|
396
|
+
},
|
|
397
|
+
textDisplayProps: {
|
|
398
|
+
props: [{
|
|
399
|
+
propName: 'display',
|
|
400
|
+
property: 'display',
|
|
401
|
+
short: 'ds' // instead of 'd' to avoid conflict with _display.scss in frontend
|
|
402
|
+
|
|
403
|
+
}],
|
|
404
|
+
variables: textDisplays,
|
|
405
|
+
variableChecker: function variableChecker(value) {
|
|
406
|
+
return textDisplays.includes(value);
|
|
407
|
+
}
|
|
408
|
+
},
|
|
409
|
+
letterSpacingProps: {
|
|
410
|
+
props: [{
|
|
411
|
+
propName: 'letterSpacing',
|
|
412
|
+
property: 'letter-spacing',
|
|
413
|
+
short: 'ls'
|
|
414
|
+
}]
|
|
415
|
+
},
|
|
416
|
+
textTransformProps: {
|
|
417
|
+
props: [{
|
|
418
|
+
propName: 'textTransform',
|
|
419
|
+
property: 'text-transform',
|
|
420
|
+
short: 'tt'
|
|
421
|
+
}],
|
|
422
|
+
variables: textTransforms,
|
|
423
|
+
variableChecker: function variableChecker(value) {
|
|
424
|
+
return textTransforms.includes(value);
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
};
|
|
428
|
+
export var propNameToShort = function propNameToShort(propName) {
|
|
429
|
+
var _prop$props$find;
|
|
430
|
+
|
|
431
|
+
var prop = Object.values(styleConfig).find(function (_ref) {
|
|
432
|
+
var props = _ref.props;
|
|
433
|
+
return props.find(function (_ref2) {
|
|
434
|
+
var prop = _ref2.propName;
|
|
435
|
+
return prop === propName;
|
|
436
|
+
});
|
|
437
|
+
});
|
|
438
|
+
return prop === null || prop === void 0 ? void 0 : (_prop$props$find = prop.props.find(function (_ref3) {
|
|
439
|
+
var prop = _ref3.propName;
|
|
440
|
+
return prop === propName;
|
|
441
|
+
})) === null || _prop$props$find === void 0 ? void 0 : _prop$props$find.short;
|
|
442
|
+
};
|
package/es/utilities/styles.js
CHANGED
|
@@ -3,6 +3,9 @@ import "core-js/modules/es.array.map.js";
|
|
|
3
3
|
import { getCssVar, isNumber, isString, u } from '.';
|
|
4
4
|
import { vars, varInfo } from '../variables';
|
|
5
5
|
import { getDimension } from './responsive';
|
|
6
|
+
export var isColorVar = function isColorVar(color) {
|
|
7
|
+
return color in vars.colorUtils || color in vars.colors;
|
|
8
|
+
};
|
|
6
9
|
export var getColor = function getColor(color) {
|
|
7
10
|
if (color in vars.colorUtils) {
|
|
8
11
|
return getCssVar(varInfo.colorUtils.name, color);
|
|
@@ -14,8 +17,11 @@ export var getColor = function getColor(color) {
|
|
|
14
17
|
|
|
15
18
|
return color;
|
|
16
19
|
};
|
|
20
|
+
export var isShadowVar = function isShadowVar(shadow) {
|
|
21
|
+
return shadow in vars.shadows;
|
|
22
|
+
};
|
|
17
23
|
export var getShadow = function getShadow(shadow) {
|
|
18
|
-
if (shadow
|
|
24
|
+
if (isShadowVar(shadow)) {
|
|
19
25
|
return getCssVar(varInfo.shadows.name, shadow);
|
|
20
26
|
}
|
|
21
27
|
|
|
@@ -26,8 +32,11 @@ export var getWeight = function getWeight(weight) {
|
|
|
26
32
|
return getCssVar(varInfo.weights.name, weight);
|
|
27
33
|
}
|
|
28
34
|
};
|
|
35
|
+
export var isRadiusVar = function isRadiusVar(radius) {
|
|
36
|
+
return radius in vars.radii;
|
|
37
|
+
};
|
|
29
38
|
export var getRadius = function getRadius(radius) {
|
|
30
|
-
if (radius
|
|
39
|
+
if (isRadiusVar(radius)) {
|
|
31
40
|
return getCssVar(varInfo.radii.name, radius);
|
|
32
41
|
}
|
|
33
42
|
|
|
@@ -35,6 +44,9 @@ export var getRadius = function getRadius(radius) {
|
|
|
35
44
|
if (isString(radius)) return radius;
|
|
36
45
|
if (isNumber(radius)) return u(radius);
|
|
37
46
|
};
|
|
47
|
+
export var isTrasitionVar = function isTrasitionVar(transition) {
|
|
48
|
+
return transition in vars.transitionUtils || transition in vars.transitions;
|
|
49
|
+
};
|
|
38
50
|
export var getTransition = function getTransition(transition) {
|
|
39
51
|
if (transition in vars.transitionUtils) {
|
|
40
52
|
return getCssVar(varInfo.transitionUtils.name, transition);
|
package/es/variables/colors.js
CHANGED
package/es/variables/index.js
CHANGED
package/es/variables/vars.js
CHANGED
package/package.json
CHANGED
package/es/styles/base.css
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
@import './variables.css';
|
|
2
|
-
@import './colors/core.css';
|
|
3
|
-
@import './colors/theme.css';
|
|
4
|
-
@import './colors/experimental.css';
|
|
5
|
-
@import './shadows.css';
|
|
6
|
-
|
|
7
|
-
:root {
|
|
8
|
-
--grn-lineHeight-fixed: 7px;
|
|
9
|
-
--grn-lineHeight-relative: 0.9em;
|
|
10
|
-
--grn-lineHeight-global: calc(var(--grn-lineHeight-fixed) + var(--grn-lineHeight-relative));
|
|
11
|
-
|
|
12
|
-
--grn-font-global: 'Flodesk Sans', sans-serif;
|
|
13
|
-
--grn-radius-button: var(--grn-radius-s);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.grn-context, .grn-context * {
|
|
17
|
-
line-height: var(--grn-lineHeight-global);
|
|
18
|
-
outline-color: var(--grn-color-selection);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.grn-context {
|
|
22
|
-
font-family: var(--grn-font-global);
|
|
23
|
-
font-size: var(--grn-text-m);
|
|
24
|
-
-webkit-font-smoothing: antialiased;
|
|
25
|
-
-moz-osx-font-smoothing: grayscale;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
[data-theme],
|
|
29
|
-
.grn-context {
|
|
30
|
-
color: var(--grn-color-content);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
*, *:before, *:after {
|
|
34
|
-
box-sizing: border-box;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.grn-link-context a {
|
|
38
|
-
transition: var(--grn-transition-slow);
|
|
39
|
-
text-underline-position: under;
|
|
40
|
-
text-underline-offset: calc(2px - 0.1em);
|
|
41
|
-
color: inherit;
|
|
42
|
-
cursor: pointer;
|
|
43
|
-
text-decoration-color: var(--grn-color-fade3);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.grn-link-context a:hover {
|
|
47
|
-
transition: var(--grn-transition-fast);
|
|
48
|
-
text-decoration-color: currentColor;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.grn-link-context a:active {
|
|
52
|
-
transition: var(--grn-transition-xxFast);
|
|
53
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
--white: hsl(0 0% 100%);
|
|
3
|
-
--H: 13.85;
|
|
4
|
-
--S: 7%;
|
|
5
|
-
--HS: var(--H) var(--S);
|
|
6
|
-
--bfS: 20%;
|
|
7
|
-
--wfS: calc(100% - var(--bfS));
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
:root {
|
|
11
|
-
--redHS: 6 55%;
|
|
12
|
-
--redL: 52%;
|
|
13
|
-
|
|
14
|
-
--grn-color-blue: hsl(218 74% 54%);
|
|
15
|
-
--grn-color-red: hsl(var(--redHS) var(--redL));
|
|
16
|
-
--grn-color-yellow: hsl(44 99% 59%);
|
|
17
|
-
--grn-color-green: hsl(153 22% 57%);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
:root, [data-experimental] {
|
|
21
|
-
--grn-color-shadeTone13: hsl(var(--H) 20% 10%);
|
|
22
|
-
--grn-color-shadeTone12: hsl(var(--H) 22% 11.5%);
|
|
23
|
-
--grn-color-shadeTone11: hsl(var(--H) 15% 15%);
|
|
24
|
-
--grn-color-shadeTone10: hsl(var(--H) 12% 21%);
|
|
25
|
-
--grn-color-shadeTone9: hsl(var(--H) 9% 28%);
|
|
26
|
-
--grn-color-shadeTone8: hsl(var(--H) 7% 38%);
|
|
27
|
-
--grn-color-shadeTone7: hsl(var(--H) 5% 51%);
|
|
28
|
-
--grn-color-shadeTone6: hsl(var(--H) 6% 70%);
|
|
29
|
-
--grn-color-shadeTone5: hsl(var(--H) 7% 82%);
|
|
30
|
-
--grn-color-shadeTone4: hsl(var(--H) 7% 90%);
|
|
31
|
-
--grn-color-shadeTone3: hsl(var(--H) 7% 95%);
|
|
32
|
-
--grn-color-shadeTone2: hsl(var(--H) 6% 97.5%);
|
|
33
|
-
--grn-color-shadeTone1: hsl(var(--H) 6% 100%);
|
|
34
|
-
|
|
35
|
-
--fadeA10: 73%;
|
|
36
|
-
--fadeA9: 66%;
|
|
37
|
-
--fadeA8: 59%;
|
|
38
|
-
--fadeA7: 52%;
|
|
39
|
-
--fadeA6: 45%;
|
|
40
|
-
--fadeA5: 38%;
|
|
41
|
-
--fadeA4: 31%;
|
|
42
|
-
--fadeA3: 24%;
|
|
43
|
-
--fadeA2: 17%;
|
|
44
|
-
--fadeA1: 10%;
|
|
45
|
-
|
|
46
|
-
--grn-color-lightFade10: hsl(var(--H) 7% var(--wfS) / var(--fadeA10));
|
|
47
|
-
--grn-color-lightFade9: hsl(var(--H) 7% var(--wfS) / var(--fadeA9));
|
|
48
|
-
--grn-color-lightFade8: hsl(var(--H) 7% var(--wfS) / var(--fadeA8));
|
|
49
|
-
--grn-color-lightFade7: hsl(var(--H) 7% var(--wfS) / var(--fadeA7));
|
|
50
|
-
--grn-color-lightFade6: hsl(var(--H) 7% var(--wfS) / var(--fadeA6));
|
|
51
|
-
--grn-color-lightFade5: hsl(var(--H) 7% var(--wfS) / var(--fadeA5));
|
|
52
|
-
--grn-color-lightFade4: hsl(var(--H) 7% var(--wfS) / var(--fadeA4));
|
|
53
|
-
--grn-color-lightFade3: hsl(var(--H) 7% var(--wfS) / var(--fadeA3));
|
|
54
|
-
--grn-color-lightFade2: hsl(var(--H) 7% var(--wfS) / var(--fadeA2));
|
|
55
|
-
--grn-color-lightFade1: hsl(var(--H) 7% var(--wfS) / var(--fadeA1));
|
|
56
|
-
|
|
57
|
-
--grn-color-darkFade10: hsl(var(--H) 7% var(--bfS) / var(--fadeA10));
|
|
58
|
-
--grn-color-darkFade9: hsl(var(--H) 7% var(--bfS) / var(--fadeA9));
|
|
59
|
-
--grn-color-darkFade8: hsl(var(--H) 7% var(--bfS) / var(--fadeA8));
|
|
60
|
-
--grn-color-darkFade7: hsl(var(--H) 7% var(--bfS) / var(--fadeA7));
|
|
61
|
-
--grn-color-darkFade6: hsl(var(--H) 7% var(--bfS) / var(--fadeA6));
|
|
62
|
-
--grn-color-darkFade5: hsl(var(--H) 7% var(--bfS) / var(--fadeA5));
|
|
63
|
-
--grn-color-darkFade4: hsl(var(--H) 9% var(--bfS) / var(--fadeA4));
|
|
64
|
-
--grn-color-darkFade3: hsl(var(--H) 11% var(--bfS) / var(--fadeA3));
|
|
65
|
-
--grn-color-darkFade2: hsl(var(--H) 13% var(--bfS) / var(--fadeA2));
|
|
66
|
-
--grn-color-darkFade1: hsl(var(--H) 15% var(--bfS) / var(--fadeA1));
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
:root {
|
|
70
|
-
--grn-color-warning: var(--grn-color-yellow);
|
|
71
|
-
--grn-color-danger: var(--grn-color-red);
|
|
72
|
-
--grn-color-success: var(--grn-color-green);
|
|
73
|
-
--grn-color-selection: var(--grn-color-blue);
|
|
74
|
-
}
|