@flodesk/grain 10.9.2 → 10.9.4

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.
@@ -3,7 +3,9 @@ import "core-js/modules/es.array.index-of.js";
3
3
  import "core-js/modules/es.symbol.js";
4
4
  import "core-js/modules/es.object.define-property.js";
5
5
  import "core-js/modules/es.array.filter.js";
6
+ import "core-js/modules/es.object.to-string.js";
6
7
  import "core-js/modules/es.object.get-own-property-descriptor.js";
8
+ import "core-js/modules/web.dom-collections.for-each.js";
7
9
  import "core-js/modules/es.object.get-own-property-descriptors.js";
8
10
  import "core-js/modules/es.object.define-properties.js";
9
11
  import "core-js/modules/es.object.assign.js";
@@ -11,6 +13,10 @@ var _excluded = ["all", "color", "colorHover", "backgroundColor", "backgroundCol
11
13
 
12
14
  function _extends() { _extends = Object.assign ? Object.assign.bind() : 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
15
 
16
+ import "core-js/modules/es.string.trim.js";
17
+ import "core-js/modules/es.regexp.exec.js";
18
+ import "core-js/modules/es.string.replace.js";
19
+
14
20
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
15
21
 
16
22
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
@@ -21,380 +27,139 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
21
27
 
22
28
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
23
29
 
24
- import "core-js/modules/es.object.to-string.js";
25
- import "core-js/modules/web.dom-collections.for-each.js";
26
- import "core-js/modules/es.array.concat.js";
27
- import "core-js/modules/es.array.includes.js";
28
- import "core-js/modules/es.string.includes.js";
29
- import "core-js/modules/es.string.trim.js";
30
- import "core-js/modules/es.regexp.exec.js";
31
- import "core-js/modules/es.string.replace.js";
32
- import { getColor, getShadow, getSpace, isObject, isSpaceVar, propNameToShorthand, getDimension, isColorVar, getRadius, isNumber } from '../utilities';
33
30
  import React, { forwardRef } from 'react';
34
- import { overflows, types } from '../types';
31
+ import { types } from '../types';
35
32
  import PropTypes from 'prop-types';
36
- import { vars } from '../variables';
33
+ import { styleConfig, generateStyleAttributes, generateClassNameAttributes } from '../utilities';
37
34
  import { jsx as ___EmotionJSX } from "@emotion/react";
38
-
39
- var generateSpaceStyles = function generateSpaceStyles(_ref) {
40
- var spaceProps = _ref.spaceProps;
41
- var styles = {};
42
- var classNames = [];
43
- spaceProps.forEach(function (_ref2) {
44
- var property = _ref2.property,
45
- value = _ref2.value;
46
-
47
- if (isObject(value)) {
48
- var defaultValue = value.default,
49
- mobile = value.mobile,
50
- tablet = value.tablet;
51
- styles["--".concat(propNameToShorthand(property), "-dft")] = getSpace(defaultValue);
52
- styles["--".concat(propNameToShorthand(property), "-mbl")] = getSpace(mobile);
53
- styles["--".concat(propNameToShorthand(property), "-tbl")] = getSpace(tablet);
54
- }
55
-
56
- if (isSpaceVar(value)) {
57
- classNames.push("".concat(propNameToShorthand(property), "-").concat(value));
58
- } else {
59
- styles["--".concat(propNameToShorthand(property))] = getSpace(value);
60
- }
61
- });
62
- return {
63
- className: classNames.join(' '),
64
- style: styles
35
+ var dimensionProps = styleConfig.dimensionProps,
36
+ colorProps = styleConfig.colorProps,
37
+ zIndexProps = styleConfig.zIndexProps,
38
+ aspectRatioProps = styleConfig.aspectRatioProps,
39
+ flexProps = styleConfig.flexProps,
40
+ spaceProps = styleConfig.spaceProps,
41
+ shadowProps = styleConfig.shadowProps,
42
+ radiusProps = styleConfig.radiusProps,
43
+ orderProps = styleConfig.orderProps,
44
+ positionProps = styleConfig.positionProps,
45
+ overflowProps = styleConfig.overflowProps,
46
+ transitionProps = styleConfig.transitionProps,
47
+ cursorProps = styleConfig.cursorProps;
48
+ export var Box2 = /*#__PURE__*/forwardRef(function (_ref, ref) {
49
+ var all = _ref.all,
50
+ color = _ref.color,
51
+ colorHover = _ref.colorHover,
52
+ backgroundColor = _ref.backgroundColor,
53
+ backgroundColorHover = _ref.backgroundColorHover,
54
+ borderColorHover = _ref.borderColorHover,
55
+ borderSide = _ref.borderSide,
56
+ width = _ref.width,
57
+ minWidth = _ref.minWidth,
58
+ maxWidth = _ref.maxWidth,
59
+ height = _ref.height,
60
+ minHeight = _ref.minHeight,
61
+ maxHeight = _ref.maxHeight,
62
+ radius = _ref.radius,
63
+ padding = _ref.padding,
64
+ paddingTop = _ref.paddingTop,
65
+ paddingBottom = _ref.paddingBottom,
66
+ paddingLeft = _ref.paddingLeft,
67
+ paddingRight = _ref.paddingRight,
68
+ paddingX = _ref.paddingX,
69
+ paddingY = _ref.paddingY,
70
+ margin = _ref.margin,
71
+ marginTop = _ref.marginTop,
72
+ marginBottom = _ref.marginBottom,
73
+ marginLeft = _ref.marginLeft,
74
+ marginRight = _ref.marginRight,
75
+ marginX = _ref.marginX,
76
+ marginY = _ref.marginY,
77
+ position = _ref.position,
78
+ top = _ref.top,
79
+ bottom = _ref.bottom,
80
+ left = _ref.left,
81
+ right = _ref.right,
82
+ shadow = _ref.shadow,
83
+ shadowHover = _ref.shadowHover,
84
+ overflow = _ref.overflow,
85
+ overflowX = _ref.overflowX,
86
+ overflowY = _ref.overflowY,
87
+ aspectRatio = _ref.aspectRatio,
88
+ zIndex = _ref.zIndex,
89
+ _ref$tag = _ref.tag,
90
+ tag = _ref$tag === void 0 ? 'div' : _ref$tag,
91
+ opacity = _ref.opacity,
92
+ opacityHover = _ref.opacityHover,
93
+ order = _ref.order,
94
+ alignSelf = _ref.alignSelf,
95
+ flex = _ref.flex,
96
+ transition = _ref.transition,
97
+ transitionHover = _ref.transitionHover,
98
+ cursor = _ref.cursor,
99
+ children = _ref.children,
100
+ className = _ref.className,
101
+ style = _ref.style,
102
+ otherProps = _objectWithoutProperties(_ref, _excluded);
103
+
104
+ var allProps = {
105
+ all: all,
106
+ color: color,
107
+ colorHover: colorHover,
108
+ backgroundColor: backgroundColor,
109
+ backgroundColorHover: backgroundColorHover,
110
+ borderColorHover: borderColorHover,
111
+ borderSide: borderSide,
112
+ width: width,
113
+ minWidth: minWidth,
114
+ maxWidth: maxWidth,
115
+ height: height,
116
+ minHeight: minHeight,
117
+ maxHeight: maxHeight,
118
+ radius: radius,
119
+ padding: padding,
120
+ paddingTop: paddingTop,
121
+ paddingBottom: paddingBottom,
122
+ paddingLeft: paddingLeft,
123
+ paddingRight: paddingRight,
124
+ paddingX: paddingX,
125
+ paddingY: paddingY,
126
+ margin: margin,
127
+ marginTop: marginTop,
128
+ marginBottom: marginBottom,
129
+ marginLeft: marginLeft,
130
+ marginRight: marginRight,
131
+ marginX: marginX,
132
+ marginY: marginY,
133
+ position: position,
134
+ top: top,
135
+ bottom: bottom,
136
+ left: left,
137
+ right: right,
138
+ shadow: shadow,
139
+ shadowHover: shadowHover,
140
+ overflow: overflow,
141
+ overflowX: overflowX,
142
+ overflowY: overflowY,
143
+ aspectRatio: aspectRatio,
144
+ zIndex: zIndex,
145
+ tag: tag,
146
+ opacity: opacity,
147
+ opacityHover: opacityHover,
148
+ order: order,
149
+ alignSelf: alignSelf,
150
+ flex: flex,
151
+ transition: transition,
152
+ transitionHover: transitionHover,
153
+ cursor: cursor
65
154
  };
66
- };
67
-
68
- var generateOrderStyles = function generateOrderStyles(_ref3) {
69
- var order = _ref3.order;
70
- var styles = {};
71
- var property = 'order';
72
-
73
- if (isObject(order)) {
74
- var defaultValue = order.default,
75
- mobile = order.mobile,
76
- tablet = order.tablet;
77
- styles["--".concat(propNameToShorthand(property), "-dft")] = defaultValue;
78
- styles["--".concat(propNameToShorthand(property), "-mbl")] = mobile;
79
- styles["--".concat(propNameToShorthand(property), "-tbl")] = tablet;
80
- }
81
-
82
- if (isNumber(order)) {
83
- styles[property] = order;
84
- }
85
-
86
- return styles;
87
- };
88
-
89
- var generateDimentionStyles = function generateDimentionStyles(_ref4) {
90
- var dimentionsProps = _ref4.dimentionsProps;
91
- var styles = {};
92
- dimentionsProps.forEach(function (_ref5) {
93
- var property = _ref5.property,
94
- value = _ref5.value;
95
-
96
- if (isObject(value)) {
97
- var defaultValue = value.default,
98
- mobile = value.mobile,
99
- tablet = value.tablet;
100
- styles["--".concat(propNameToShorthand(property), "-dft")] = getDimension(defaultValue);
101
- styles["--".concat(propNameToShorthand(property), "-mbl")] = getDimension(mobile);
102
- styles["--".concat(propNameToShorthand(property), "-tbl")] = getDimension(tablet);
103
- return;
104
- }
105
-
106
- styles["--".concat(propNameToShorthand(property))] = getDimension(value);
107
- });
108
- return styles;
109
- };
110
-
111
- var generateColorStyles = function generateColorStyles(_ref6) {
112
- var colorProps = _ref6.colorProps;
113
- var styles = {};
114
- var classNames = [];
115
- colorProps.forEach(function (_ref7) {
116
- var property = _ref7.property,
117
- value = _ref7.value;
118
-
119
- if (isColorVar(value)) {
120
- classNames.push("".concat(propNameToShorthand(property), "-").concat(value));
121
- } else {
122
- styles["--".concat(propNameToShorthand(property))] = getColor(value);
123
- }
124
- });
125
- return {
126
- className: classNames.join(' '),
127
- style: styles
128
- };
129
- };
130
-
131
- var genereateShadowStyles = function genereateShadowStyles(_ref8) {
132
- var shadowProps = _ref8.shadowProps;
133
- var styles = {};
134
- var classNames = [];
135
- shadowProps.forEach(function (_ref9) {
136
- var property = _ref9.property,
137
- value = _ref9.value;
138
-
139
- if (value in vars.shadows) {
140
- classNames.push("".concat(propNameToShorthand(property), "-").concat(value));
141
- } else {
142
- styles["--".concat(propNameToShorthand(property))] = getShadow(value);
143
- }
144
- });
145
- return {
146
- className: classNames.join(' '),
147
- style: styles
148
- };
149
- };
150
-
151
- var generateRadiusStyles = function generateRadiusStyles(_ref10) {
152
- var radiusProps = _ref10.radiusProps;
153
- var styles = {};
154
- var classNames = [];
155
- radiusProps.forEach(function (_ref11) {
156
- var property = _ref11.property,
157
- value = _ref11.value;
158
-
159
- if (value in vars.radii) {
160
- classNames.push("".concat(propNameToShorthand(property), "-").concat(value));
161
- } else {
162
- styles["--".concat(propNameToShorthand(property))] = getRadius(value);
163
- }
164
- });
165
- return {
166
- className: classNames.join(' '),
167
- style: styles
168
- };
169
- };
170
-
171
- var generateZIndexStyles = function generateZIndexStyles(_ref12) {
172
- var zIndex = _ref12.zIndex;
173
- var styles = {};
174
- styles["zIndex"] = zIndex;
175
- return styles;
176
- };
177
-
178
- var generatePositionStyles = function generatePositionStyles(_ref13) {
179
- var position = _ref13.position;
180
-
181
- if (position) {
182
- return "".concat(propNameToShorthand('position'), "-").concat(position);
183
- }
184
- };
185
-
186
- var generateOverflowStyles = function generateOverflowStyles(_ref14) {
187
- var overflowProps = _ref14.overflowProps;
188
- var classNames = [];
189
- overflowProps.forEach(function (_ref15) {
190
- var property = _ref15.property,
191
- value = _ref15.value;
192
-
193
- if (overflows.includes(value)) {
194
- classNames.push("".concat(propNameToShorthand(property), "-").concat(value));
195
- }
196
- });
197
- return classNames.join(' ');
198
- };
199
-
200
- export var Box2 = /*#__PURE__*/forwardRef(function (_ref16, ref) {
201
- var all = _ref16.all,
202
- color = _ref16.color,
203
- colorHover = _ref16.colorHover,
204
- backgroundColor = _ref16.backgroundColor,
205
- backgroundColorHover = _ref16.backgroundColorHover,
206
- borderColorHover = _ref16.borderColorHover,
207
- borderSide = _ref16.borderSide,
208
- width = _ref16.width,
209
- minWidth = _ref16.minWidth,
210
- maxWidth = _ref16.maxWidth,
211
- height = _ref16.height,
212
- minHeight = _ref16.minHeight,
213
- maxHeight = _ref16.maxHeight,
214
- radius = _ref16.radius,
215
- padding = _ref16.padding,
216
- paddingTop = _ref16.paddingTop,
217
- paddingBottom = _ref16.paddingBottom,
218
- paddingLeft = _ref16.paddingLeft,
219
- paddingRight = _ref16.paddingRight,
220
- paddingX = _ref16.paddingX,
221
- paddingY = _ref16.paddingY,
222
- margin = _ref16.margin,
223
- marginTop = _ref16.marginTop,
224
- marginBottom = _ref16.marginBottom,
225
- marginLeft = _ref16.marginLeft,
226
- marginRight = _ref16.marginRight,
227
- marginX = _ref16.marginX,
228
- marginY = _ref16.marginY,
229
- position = _ref16.position,
230
- top = _ref16.top,
231
- bottom = _ref16.bottom,
232
- left = _ref16.left,
233
- right = _ref16.right,
234
- shadow = _ref16.shadow,
235
- shadowHover = _ref16.shadowHover,
236
- overflow = _ref16.overflow,
237
- overflowX = _ref16.overflowX,
238
- overflowY = _ref16.overflowY,
239
- aspectRatio = _ref16.aspectRatio,
240
- zIndex = _ref16.zIndex,
241
- _ref16$tag = _ref16.tag,
242
- tag = _ref16$tag === void 0 ? 'div' : _ref16$tag,
243
- opacity = _ref16.opacity,
244
- opacityHover = _ref16.opacityHover,
245
- order = _ref16.order,
246
- alignSelf = _ref16.alignSelf,
247
- flex = _ref16.flex,
248
- transition = _ref16.transition,
249
- transitionHover = _ref16.transitionHover,
250
- cursor = _ref16.cursor,
251
- children = _ref16.children,
252
- className = _ref16.className,
253
- style = _ref16.style,
254
- otherProps = _objectWithoutProperties(_ref16, _excluded);
255
-
256
- var spaceProps = [{
257
- property: 'padding',
258
- value: padding
259
- }, {
260
- property: 'paddingTop',
261
- value: paddingTop
262
- }, {
263
- property: 'paddingBottom',
264
- value: paddingBottom
265
- }, {
266
- property: 'paddingLeft',
267
- value: paddingLeft
268
- }, {
269
- property: 'paddingRight',
270
- value: paddingRight
271
- }, {
272
- property: 'paddingX',
273
- value: paddingX
274
- }, {
275
- property: 'paddingY',
276
- value: paddingY
277
- }, {
278
- property: 'margin',
279
- value: margin
280
- }, {
281
- property: 'marginTop',
282
- value: marginTop
283
- }, {
284
- property: 'marginBottom',
285
- value: marginBottom
286
- }, {
287
- property: 'marginLeft',
288
- value: marginLeft
289
- }, {
290
- property: 'marginRight',
291
- value: marginRight
292
- }, {
293
- property: 'marginX',
294
- value: marginX
295
- }, {
296
- property: 'marginY',
297
- value: marginY
298
- }, {
299
- property: 'top',
300
- value: top
301
- }, {
302
- property: 'bottom',
303
- value: bottom
304
- }, {
305
- property: 'left',
306
- value: left
307
- }, {
308
- property: 'right',
309
- value: right
310
- }];
311
- var dimentionsProps = [{
312
- property: 'width',
313
- value: width
314
- }, {
315
- property: 'minWidth',
316
- value: minWidth
317
- }, {
318
- property: 'maxWidth',
319
- value: maxWidth
320
- }, {
321
- property: 'height',
322
- value: height
323
- }, {
324
- property: 'minHeight',
325
- value: minHeight
326
- }, {
327
- property: 'maxHeight',
328
- value: maxHeight
329
- }];
330
- var colorProps = [{
331
- property: 'color',
332
- value: color
333
- }, {
334
- property: 'colorHover',
335
- value: colorHover
336
- }, {
337
- property: 'backgroundColor',
338
- value: backgroundColor
339
- }, {
340
- property: 'backgroundColorHover',
341
- value: backgroundColorHover
342
- }];
343
- var shadowProps = [{
344
- property: 'shadow',
345
- value: shadow
346
- }, {
347
- property: 'shadowHover',
348
- value: shadowHover
349
- }];
350
- var radiusProps = [{
351
- property: 'radius',
352
- value: radius
353
- }];
354
- var overflowProps = [{
355
- property: 'overflow',
356
- value: overflow
357
- }, {
358
- property: 'overflowX',
359
- value: overflowX
360
- }, {
361
- property: 'overflowY',
362
- value: overflowY
363
- }];
364
155
 
365
- var styles = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, generateDimentionStyles({
366
- dimentionsProps: dimentionsProps
367
- })), generateSpaceStyles({
368
- spaceProps: spaceProps
369
- }).style), generateColorStyles({
370
- colorProps: colorProps
371
- }).style), genereateShadowStyles({
372
- shadowProps: shadowProps
373
- }).style), generateRadiusStyles({
374
- radiusProps: radiusProps
375
- }).style), generateOrderStyles({
376
- order: order
377
- })), generateZIndexStyles({
378
- zIndex: zIndex
379
- }));
156
+ var styles = _objectSpread({}, generateStyleAttributes([dimensionProps, colorProps, spaceProps, shadowProps, radiusProps, orderProps, zIndexProps, transitionProps, aspectRatioProps, flexProps], allProps));
380
157
 
381
- var propClassname = className ? className : '';
382
- var classNames = [generateSpaceStyles({
383
- spaceProps: spaceProps
384
- }).className, generateColorStyles({
385
- colorProps: colorProps
386
- }).className, genereateShadowStyles({
387
- shadowProps: shadowProps
388
- }).className, generateRadiusStyles({
389
- radiusProps: radiusProps
390
- }).className, generatePositionStyles({
391
- position: position
392
- }), generateOverflowStyles({
393
- overflowProps: overflowProps
394
- }), propClassname].join(' ').replace(/\s+/g, ' ').trim();
395
- return ___EmotionJSX("div", _extends({
158
+ var propClassName = className ? className : '';
159
+ var classNames = [generateClassNameAttributes([spaceProps, colorProps, shadowProps, radiusProps, positionProps, overflowProps, transitionProps, cursorProps], allProps), propClassName].join(' ').replace(/\s+/g, ' ').trim();
160
+ var Tag = tag;
161
+ return ___EmotionJSX(Tag, _extends({
396
162
  ref: ref,
397
- as: tag,
398
163
  style: styles,
399
164
  className: classNames
400
165
  }, otherProps), children);
@@ -1,35 +1,14 @@
1
- import "core-js/modules/es.symbol.js";
2
- import "core-js/modules/es.symbol.description.js";
3
- import "core-js/modules/es.object.to-string.js";
4
- import "core-js/modules/es.symbol.iterator.js";
5
- import "core-js/modules/es.array.iterator.js";
6
- import "core-js/modules/es.string.iterator.js";
7
- import "core-js/modules/web.dom-collections.iterator.js";
8
- import "core-js/modules/es.array.slice.js";
9
- import "core-js/modules/es.array.from.js";
10
- import "core-js/modules/es.regexp.exec.js";
11
1
  import "core-js/modules/es.object.assign.js";
12
2
  import _styled from "@emotion/styled/base";
13
3
 
14
4
  function _extends() { _extends = Object.assign ? Object.assign.bind() : 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
5
 
16
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
17
-
18
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
19
-
20
- 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); }
21
-
22
- 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; }
23
-
24
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
25
-
26
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
27
-
28
- import React, { Fragment, forwardRef, useCallback, useEffect, useRef, useState } from 'react';
6
+ import React, { Fragment, forwardRef, useCallback, useEffect, useRef } from 'react';
29
7
  import PropTypes from 'prop-types';
30
8
  import { getColor, getRadius, getSpace, getTransition } from '../utilities';
31
9
  import { lineHeightAndCapHeightOffset } from '../foundational';
32
10
  import { Transition } from '@headlessui/react';
11
+ import { usePrev } from '../hooks';
33
12
  import { jsx as ___EmotionJSX } from "@emotion/react";
34
13
  var variantStyles = {
35
14
  success: {
@@ -62,7 +41,7 @@ var Root = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
62
41
  })("--pagePadding:max(var(--grn-space-s), 1.5vw);", function (_ref) {
63
42
  var zIndex = _ref.zIndex;
64
43
  return "z-index: ".concat(zIndex);
65
- }, ";position:fixed;bottom:var(--pagePadding);left:50%;transform:translateX(-50%);.leaveTo,.enterFrom{opacity:0;transform:translateY(", getSpace('s'), ");}.enterTo,.leaveTo{transition-duration:", getTransition('slow'), ";}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21wb25lbnRzL3RvYXN0LmpzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUErQnVCIiwiZmlsZSI6Ii4uLy4uL3NyYy9jb21wb25lbnRzL3RvYXN0LmpzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCwgeyBGcmFnbWVudCwgZm9yd2FyZFJlZiwgdXNlQ2FsbGJhY2ssIHVzZUVmZmVjdCwgdXNlUmVmLCB1c2VTdGF0ZSB9IGZyb20gJ3JlYWN0JztcbmltcG9ydCBQcm9wVHlwZXMgZnJvbSAncHJvcC10eXBlcyc7XG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5pbXBvcnQgeyBnZXRDb2xvciwgZ2V0UmFkaXVzLCBnZXRTcGFjZSwgZ2V0VHJhbnNpdGlvbiB9IGZyb20gJy4uL3V0aWxpdGllcyc7XG5pbXBvcnQgeyBsaW5lSGVpZ2h0QW5kQ2FwSGVpZ2h0T2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mFsc2UpO1xuICAgICAgaWYgKGlzT3Blbikge1xuICAgICAgICBzdGFydERpc21pc3NUaW1lcigpO1xuICAgICAgfVxuICAgIH07XG5cbiAgICByZXR1cm4gKFxuICAgICAgPFJvb3RcbiAgICAgICAgcmVmPXtyZWZ9XG4gICAgICAgIHpJbmRleD17ekluZGV4fVxuICAgICAgICBvbk1vdXNlRW50ZXI9e2hhbmRsZU1vdXNlRW50ZXJ9XG4gICAgICAgIG9uTW91c2VMZWF2ZT17aGFuZGxlTW91c2VMZWF2ZX1cbiAgICAgID5cbiAgICAgICAgPFRyYW5zaXRpb24gc2hvdz17aXNJbnRlcm5hbGx5T3Blbn0gYXM9e0ZyYWdtZW50fT5cbiAgICAgICAgICA8VHJhbnNpdGlvbi5DaGlsZCBhcz17RnJhZ21lbnR9IHsuLi50cmFuc2l0aW9uQ2hpbGRQcm9wc30+XG4gICAgICAgICAgICA8Q29udGVudCB2YXJpYW50PXt2YXJpYW50fT57Y2hpbGRyZW59PC9Db250ZW50PlxuICAgICAgICAgIDwvVHJhbnNpdGlvbi5DaGlsZD5cbiAgICAgICAgPC9UcmFuc2l0aW9uPlxuICAgICAgPC9Sb290PlxuICAgICk7XG4gIH0sXG4pO1xuXG5Ub2FzdC5wcm9wVHlwZXMgPSB7XG4gIGNoaWxkcmVuOiBQcm9wVHlwZXMubm9kZSxcbiAgekluZGV4OiBQcm9wVHlwZXMubnVtYmVyLFxuICBpc09wZW46IFByb3BUeXBlcy5ib29sLFxuICB2YXJpYW50OiBQcm9wVHlwZXMub25lT2YoWydzdWNjZXNzJywgJ2RhbmdlcicsICduZXV0cmFsJ10pLFxuICBkaXNtaXNzVGltZW91dDogUHJvcFR5cGVzLm51bWJlcixcbiAgb25EaXNtaXNzOiBQcm9wVHlwZXMuZnVuYyxcbn07XG4iXX0= */"));
44
+ }, ";position:fixed;bottom:var(--pagePadding);left:50%;transform:translateX(-50%);.enterFrom,.leaveTo{opacity:0;transform:translateY(", getSpace('s'), ");transition-duration:", getTransition('slow'), ";}.enterTo,.leaveFrom{opacity:1;transform:translateY(0);transition-duration:", getTransition('slow'), ";}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21wb25lbnRzL3RvYXN0LmpzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFnQ3VCIiwiZmlsZSI6Ii4uLy4uL3NyYy9jb21wb25lbnRzL3RvYXN0LmpzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCwgeyBGcmFnbWVudCwgZm9yd2FyZFJlZiwgdXNlQ2FsbGJhY2ssIHVzZUVmZmVjdCwgdXNlUmVmIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IFByb3BUeXBlcyBmcm9tICdwcm9wLXR5cGVzJztcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbmltcG9ydCB7IGdldENvbG9yLCBnZXRSYWRpdXMsIGdldFNwYWNlLCBnZXRUcmFuc2l0aW9uIH0gZnJvbSAnLi4vdXRpbGl0aWVzJztcbmltcG9ydCB7IGxpbmVIZWlnaHRBbmRDYXBIZWlnaHRPZmZzZXQgfSBmcm9tICcuLi9mb3VuZGF0aW9uYWwnO1xuaW1wb3J0IHsgVHJhbnNpdGlvbiB9IGZyb20gJ0BoZWFkbGVzc3VpL3JlYWN0JztcbmltcG9ydCB7IHVzZVByZXYgfSBmcm9tICcuLi9ob29rcyc7XG5cbmNvbnN0IHZhcmlhbnRTdHlsZXMgPSB7XG4gIHN1Y2Nlc3M6IHtcbiAgICBiYWNrZ3JvdW5kQ29sb3I6IGdldENvbG9yKCdzdWNjZXNzJyksXG4gICAgY29sb3I6ICd3aGl0ZScsXG4gIH0sXG4gIGRhbmdlcjoge1xuICAgIGJhY2tncm91bmRDb2xvcjogZ2V0Q29sb3IoJ2RhbmdlcicpLFxuICA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SB7Li4udHJhbnNpdGlvbkNoaWxkUHJvcHN9PlxuICAgICAgICAgICAgPENvbnRlbnQgdmFyaWFudD17dmFyaWFudH0+e2NoaWxkcmVufTwvQ29udGVudD5cbiAgICAgICAgICA8L1RyYW5zaXRpb24uQ2hpbGQ+XG4gICAgICAgIDwvVHJhbnNpdGlvbj5cbiAgICAgIDwvUm9vdD5cbiAgICApO1xuICB9LFxuKTtcblxuVG9hc3QucHJvcFR5cGVzID0ge1xuICBjaGlsZHJlbjogUHJvcFR5cGVzLm5vZGUuaXNSZXF1aXJlZCxcbiAgekluZGV4OiBQcm9wVHlwZXMubnVtYmVyLFxuICBpc09wZW46IFByb3BUeXBlcy5ib29sLFxuICB2YXJpYW50OiBQcm9wVHlwZXMub25lT2YoWydzdWNjZXNzJywgJ2RhbmdlcicsICduZXV0cmFsJ10pLFxuICBkaXNtaXNzVGltZW91dDogUHJvcFR5cGVzLm51bWJlcixcbiAgb25EaXNtaXNzOiBQcm9wVHlwZXMuZnVuYyxcbn07XG4iXX0= */"));
66
45
 
67
46
  var Content = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
68
47
  target: "ep1f3rd0"
@@ -72,30 +51,20 @@ var Content = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production"
72
51
  })("--padding:", getSpace(2.5), ";padding:calc(var(--padding) - ", lineHeightAndCapHeightOffset, ") var(--padding);width:max-content;max-width:min(", getSpace(70), ", calc(100vw - var(--pagePadding) * 2));border-radius:", getRadius('m'), ";", function (_ref2) {
73
52
  var variant = _ref2.variant;
74
53
  return variantStyles[variant];
75
- }, ";text-align:center;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21wb25lbnRzL3RvYXN0LmpzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFtRDBCIiwiZmlsZSI6Ii4uLy4uL3NyY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Sb290PlxuICAgICk7XG4gIH0sXG4pO1xuXG5Ub2FzdC5wcm9wVHlwZXMgPSB7XG4gIGNoaWxkcmVuOiBQcm9wVHlwZXMubm9kZSxcbiAgekluZGV4OiBQcm9wVHlwZXMubnVtYmVyLFxuICBpc09wZW46IFByb3BUeXBlcy5ib29sLFxuICB2YXJpYW50OiBQcm9wVHlwZXMub25lT2YoWydzdWNjZXNzJywgJ2RhbmdlcicsICduZXV0cmFsJ10pLFxuICBkaXNtaXNzVGltZW91dDogUHJvcFR5cGVzLm51bWJlcixcbiAgb25EaXNtaXNzOiBQcm9wVHlwZXMuZnVuYyxcbn07XG4iXX0= */"));
54
+ }, ";text-align:center;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21wb25lbnRzL3RvYXN0LmpzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF1RDBCIiwiZmlsZSI6Ii4uLy4uL3NyYy9jb21wb25lbnRzL3RvYXN0LmpzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCwgeyBGcmFnbWVudCwgZm9yd2FyZFJlZiwgdXNlQ2FsbGJhY2ssIHVzZUVmZmVjdCwgdXNlUmVmIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IFByb3BUeXBlcyBmcm9tICdwcm9wLXR5cGVzJztcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbmltcG9ydCB7IGdldENvbG9yLCBnZXRSYWRpdXMsIGdldFNwYWNlLCBnZXRUcmFuc2l0aW9uIH0gZnJvbSAnLi4vdXRpbGl0aWVzJztcbmltcG9ydCB7IGxpbmVIZWlnaHRBbmRDYXBIZWlnaHRPZmZzZXQgfSBmcm9tICcuLi9mb3VuZGF0aW9uYWwnO1xuaW1wb3J0IHsgVHJhbnNpdGlvbiB9IGZyb20gJ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4gICAgICA8Um9vdFxuICAgICAgICByZWY9e3JlZn1cbiAgICAgICAgekluZGV4PXt6SW5kZXh9XG4gICAgICAgIG9uTW91c2VFbnRlcj17aGFuZGxlTW91c2VFbnRlcn1cbiAgICAgICAgb25Nb3VzZUxlYXZlPXtoYW5kbGVNb3VzZUxlYXZlfVxuICAgICAgPlxuICAgICAgICA8VHJhbnNpdGlvbiBzaG93PXtpc09wZW59IGFzPXtGcmFnbWVudH0+XG4gICAgICAgICAgPFRyYW5zaXRpb24uQ2hpbGQgYXM9e0ZyYWdtZW50fSB7Li4udHJhbnNpdGlvbkNoaWxkUHJvcHN9PlxuICAgICAgICAgICAgPENvbnRlbnQgdmFyaWFudD17dmFyaWFudH0+e2NoaWxkcmVufTwvQ29udGVudD5cbiAgICAgICAgICA8L1RyYW5zaXRpb24uQ2hpbGQ+XG4gICAgICAgIDwvVHJhbnNpdGlvbj5cbiAgICAgIDwvUm9vdD5cbiAgICApO1xuICB9LFxuKTtcblxuVG9hc3QucHJvcFR5cGVzID0ge1xuICBjaGlsZHJlbjogUHJvcFR5cGVzLm5vZGUuaXNSZXF1aXJlZCxcbiAgekluZGV4OiBQcm9wVHlwZXMubnVtYmVyLFxuICBpc09wZW46IFByb3BUeXBlcy5ib29sLFxuICB2YXJpYW50OiBQcm9wVHlwZXMub25lT2YoWydzdWNjZXNzJywgJ2RhbmdlcicsICduZXV0cmFsJ10pLFxuICBkaXNtaXNzVGltZW91dDogUHJvcFR5cGVzLm51bWJlcixcbiAgb25EaXNtaXNzOiBQcm9wVHlwZXMuZnVuYyxcbn07XG4iXX0= */"));
76
55
 
77
56
  export var Toast = /*#__PURE__*/forwardRef(function (_ref3, ref) {
78
- var _ref3$zIndex = _ref3.zIndex,
57
+ var children = _ref3.children,
58
+ _ref3$zIndex = _ref3.zIndex,
79
59
  zIndex = _ref3$zIndex === void 0 ? 1200 : _ref3$zIndex,
80
- children = _ref3.children,
81
- isOpen = _ref3.isOpen,
60
+ _ref3$isOpen = _ref3.isOpen,
61
+ isOpen = _ref3$isOpen === void 0 ? false : _ref3$isOpen,
82
62
  _ref3$variant = _ref3.variant,
83
63
  variant = _ref3$variant === void 0 ? 'neutral' : _ref3$variant,
84
64
  _ref3$dismissTimeout = _ref3.dismissTimeout,
85
65
  dismissTimeout = _ref3$dismissTimeout === void 0 ? 3000 : _ref3$dismissTimeout,
86
66
  onDismiss = _ref3.onDismiss;
87
-
88
- var _useState = useState(isOpen),
89
- _useState2 = _slicedToArray(_useState, 2),
90
- isInternallyOpen = _useState2[0],
91
- setIsInternallyOpen = _useState2[1];
92
-
93
- var _useState3 = useState(false),
94
- _useState4 = _slicedToArray(_useState3, 2),
95
- isHovered = _useState4[0],
96
- setIsHovered = _useState4[1];
97
-
98
- var dismissTimerRef = useRef();
67
+ var dismissTimerRef = useRef(null);
99
68
  var clearDismissTimer = useCallback(function () {
100
69
  if (dismissTimerRef.current) {
101
70
  clearTimeout(dismissTimerRef.current);
@@ -104,26 +73,21 @@ export var Toast = /*#__PURE__*/forwardRef(function (_ref3, ref) {
104
73
  var startDismissTimer = useCallback(function () {
105
74
  clearDismissTimer();
106
75
  dismissTimerRef.current = setTimeout(function () {
107
- setIsInternallyOpen(false);
108
76
  onDismiss && onDismiss();
109
77
  }, dismissTimeout);
110
78
  }, [clearDismissTimer, dismissTimeout, onDismiss]);
79
+ var isOpenPrev = usePrev(isOpen);
111
80
  useEffect(function () {
112
- setIsInternallyOpen(isOpen);
113
-
114
- if (isOpen && !isHovered) {
81
+ if (!isOpenPrev && isOpen) {
115
82
  startDismissTimer();
116
83
  }
117
- }, [isOpen, isHovered, startDismissTimer]);
84
+ }, [isOpen, isOpenPrev, startDismissTimer]);
118
85
 
119
86
  var handleMouseEnter = function handleMouseEnter() {
120
- setIsHovered(true);
121
87
  clearDismissTimer();
122
88
  };
123
89
 
124
90
  var handleMouseLeave = function handleMouseLeave() {
125
- setIsHovered(false);
126
-
127
91
  if (isOpen) {
128
92
  startDismissTimer();
129
93
  }
@@ -135,7 +99,7 @@ export var Toast = /*#__PURE__*/forwardRef(function (_ref3, ref) {
135
99
  onMouseEnter: handleMouseEnter,
136
100
  onMouseLeave: handleMouseLeave
137
101
  }, ___EmotionJSX(Transition, {
138
- show: isInternallyOpen,
102
+ show: isOpen,
139
103
  as: Fragment
140
104
  }, ___EmotionJSX(Transition.Child, _extends({
141
105
  as: Fragment
@@ -144,7 +108,7 @@ export var Toast = /*#__PURE__*/forwardRef(function (_ref3, ref) {
144
108
  }, children))));
145
109
  });
146
110
  Toast.propTypes = {
147
- children: PropTypes.node,
111
+ children: PropTypes.node.isRequired,
148
112
  zIndex: PropTypes.number,
149
113
  isOpen: PropTypes.bool,
150
114
  variant: PropTypes.oneOf(['success', 'danger', 'neutral']),
package/es/hooks/index.js CHANGED
@@ -2,4 +2,5 @@ export * from './useMedia';
2
2
  export * from './useKeyPress';
3
3
  export * from './useOnClickOutside';
4
4
  export * from './useWindowSize';
5
- export * from './useWidth';
5
+ export * from './useWidth';
6
+ export * from './usePrev';
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ export var usePrev = function usePrev(value) {
3
+ var ref = React.useRef();
4
+ React.useEffect(function () {
5
+ ref.current = value;
6
+ }, [value]);
7
+ return ref.current;
8
+ };
@@ -1,108 +1,65 @@
1
- import "core-js/modules/es.object.keys.js";
2
1
  import "core-js/modules/es.object.to-string.js";
3
2
  import "core-js/modules/web.dom-collections.for-each.js";
4
3
  import "core-js/modules/es.array.concat.js";
5
- import { overflows, positions } from '../types';
6
- import { propertyToShorthand, getSpace, getColor, getShadow, getRadius } from '../utilities';
7
- import { vars } from '../variables';
8
- var spaces = Object.keys(vars.spaces);
9
- var colors = Object.keys(vars.colors);
10
- var shadows = Object.keys(vars.shadows);
11
- var radii = Object.keys(vars.radii);
12
- var spaceProperties = ['padding', 'padding-top', 'padding-bottom', 'padding-left', 'padding-right', 'padding-inline', 'padding-block', 'margin', 'margin-top', 'margin-bottom', 'margin-left', 'margin-right', 'margin-inline', 'margin-block', 'top', 'bottom', 'left', 'right', 'width', 'height', 'min-width', 'max-width', 'min-height', 'max-height'];
13
- var colorProperties = ['color', 'background-color'];
4
+ import { propertyToShorthand, propNameToShorthand, styleConfig } from '../utilities';
14
5
 
15
- function generateCSS() {
6
+ var generateUtilityClasses = function generateUtilityClasses(propertySets) {
16
7
  var css = '';
17
- spaces.forEach(function (space) {
18
- spaceProperties.forEach(function (property) {
19
- css += "\n .".concat(propertyToShorthand(property), "-").concat(space, " {\n ").concat(property, ": ").concat(getSpace(space), "\n }");
20
- });
21
- });
22
- colors.forEach(function (color) {
23
- colorProperties.forEach(function (property) {
24
- css += "\n .".concat(propertyToShorthand(property), "-").concat(color, " {\n ").concat(property, ": ").concat(getColor(color), "\n }");
25
- });
26
- });
27
- [].concat(spaceProperties, colorProperties).forEach(function (property) {
28
- css += "\n [style*=\"--".concat(propertyToShorthand(property), ":\"] {\n ").concat(property, ": var(--").concat(propertyToShorthand(property), ")\n }");
29
- });
30
- return css;
31
- }
8
+ propertySets.forEach(function (set) {
9
+ set.variables.forEach(function (variable) {
10
+ set.props.forEach(function (prop) {
11
+ var property = prop.property;
12
+ var cssValue = set.valueTransformer ? set.valueTransformer(variable) : variable;
13
+ var hasHover = prop.modifier === 'hover';
32
14
 
33
- var generateHoverCSS = function generateHoverCSS() {
34
- var css = '';
35
- colors.forEach(function (color) {
36
- colorProperties.forEach(function (property) {
37
- css += "\n .".concat(propertyToShorthand(property), "-hover-").concat(color, ":hover {\n ").concat(property, ": ").concat(getColor(color), "\n }\n ");
38
- });
39
- });
40
- colorProperties.forEach(function (property) {
41
- css += "\n [style*=\"--".concat(propertyToShorthand(property), "-hover\"]:hover {\n ").concat(property, ": var(--").concat(propertyToShorthand(property), "-hover)\n }\n ");
42
- });
43
- return css;
44
- };
15
+ if (!hasHover) {
16
+ css += "\n .".concat(propNameToShorthand(prop.propName), "-").concat(variable, " {\n ").concat(property, ": ").concat(cssValue, "\n }");
17
+ }
45
18
 
46
- var generateResponsiveCSS = function generateResponsiveCSS() {
47
- var css = '';
48
- spaceProperties.forEach(function (property) {
49
- css += "\n [style*=\"--".concat(propertyToShorthand(property), "-dft\"] {\n ").concat(property, ": var(--").concat(propertyToShorthand(property), "-dft)\n }\n @media (max-width: 1169px) {\n [style*=\"--").concat(propertyToShorthand(property), "-tbl\"] {\n ").concat(property, ": var(--").concat(propertyToShorthand(property), "-tbl);\n }\n }\n @media (max-width: 767px) {\n [style*=\"--").concat(propertyToShorthand(property), "-mbl\"] {\n ").concat(property, ": var(--").concat(propertyToShorthand(property), "-mbl);\n }\n }\n ");
50
- });
51
- return css;
52
- };
53
-
54
- var generateShadowCSS = function generateShadowCSS() {
55
- var css = '';
56
- var property = 'box-shadow';
57
- shadows.forEach(function (shadow) {
58
- css += "\n .".concat(propertyToShorthand(property), "-").concat(shadow, " {\n ").concat(property, ": ").concat(getShadow(shadow), "\n }\n .").concat(propertyToShorthand(property), "-hover-").concat(shadow, ":hover {\n ").concat(property, ": ").concat(getShadow(shadow), "\n }\n ");
59
- css += "\n [style*=\"--".concat(propertyToShorthand(property), "\"] {\n ").concat(property, ": var(--").concat(propertyToShorthand(property), ")\n }\n [style*=\"--").concat(propertyToShorthand(property), "-hover\"]:hover {\n ").concat(property, ": var(--").concat(propertyToShorthand(property), "-hover)\n }\n ");
19
+ if (hasHover) {
20
+ css += "\n .".concat(propNameToShorthand(prop.propName), "-").concat(variable, ":hover {\n ").concat(property, ": ").concat(cssValue, "\n }");
21
+ }
22
+ });
23
+ });
60
24
  });
61
25
  return css;
62
26
  };
63
27
 
64
- var generateRadiiCSS = function generateRadiiCSS() {
28
+ var generateStyleClasses = function generateStyleClasses(propertySets) {
65
29
  var css = '';
66
- var property = 'border-radius';
67
- radii.forEach(function (radius) {
68
- css += "\n .".concat(propertyToShorthand(property), "-").concat(radius, " {\n ").concat(property, ": ").concat(getRadius(radius), "\n }\n ");
69
- css += "\n [style*=\"--".concat(propertyToShorthand(property), "\"] {\n ").concat(property, ": var(--").concat(propertyToShorthand(property), ")\n }\n ");
70
- });
71
- return css;
72
- };
30
+ propertySets.forEach(function (set) {
31
+ set.props.forEach(function (prop) {
32
+ var property = prop.property;
33
+ var cssVar = "--".concat(propertyToShorthand(property));
34
+ var hasHover = prop.modifier === 'hover';
73
35
 
74
- var generateOrderCSS = function generateOrderCSS() {
75
- var css = '';
76
- var property = 'order';
77
- css += "\n [style*=\"--".concat(propertyToShorthand(property), "-dft\"] {\n ").concat(property, ": var(--").concat(propertyToShorthand(property), "-dft)\n }\n @media (max-width: 1169px) {\n [style*=\"--").concat(propertyToShorthand(property), "-tbl\"] {\n ").concat(property, ": var(--").concat(propertyToShorthand(property), "-tbl);\n }\n }\n @media (max-width: 767px) {\n [style*=\"--").concat(propertyToShorthand(property), "-mbl\"] {\n ").concat(property, ": var(--").concat(propertyToShorthand(property), "-mbl);\n }\n }\n ");
78
- return css;
79
- };
36
+ if (!hasHover) {
37
+ css += "\n [style*=\"".concat(cssVar, ":\"] {\n ").concat(property, ": var(").concat(cssVar, ")\n }");
38
+ }
80
39
 
81
- var generatePositionCSS = function generatePositionCSS() {
82
- var css = '';
83
- var property = 'position';
84
- positions.forEach(function (value) {
85
- css += "\n .".concat(propertyToShorthand(property), "-").concat(value, " {\n ").concat(property, ": ").concat(value, "\n }\n ");
86
- });
87
- return css;
88
- };
40
+ if (hasHover) {
41
+ css += "\n [style*=\"".concat(cssVar, "-hover\"]:hover {\n ").concat(property, ": var(").concat(cssVar, "-hover)\n }");
42
+ }
89
43
 
90
- var generateOverflowCSS = function generateOverflowCSS() {
91
- var css = '';
92
- var property = 'overflow';
93
- overflows.forEach(function (value) {
94
- css += "\n .".concat(propertyToShorthand(property), "-").concat(value, " {\n ").concat(property, ": ").concat(value, "\n }\n ");
44
+ if (set.isResponsive) {
45
+ css += "\n [style*=\"".concat(cssVar, "-def\"] {\n ").concat(property, ": var(").concat(cssVar, "-def)\n }\n\n @media (max-width: 1169px) {\n [style*=\"").concat(cssVar, "-tab\"] {\n ").concat(property, ": var(").concat(cssVar, "-tab);\n }\n }\n\n @media (max-width: 767px) {\n [style*=\"").concat(cssVar, "-mob\"] {\n ").concat(property, ": var(").concat(cssVar, "-mob);\n }\n }\n ");
46
+ }
47
+ });
95
48
  });
96
49
  return css;
97
50
  };
98
51
 
99
- var css = generateCSS();
100
- var hoverCSS = generateHoverCSS();
101
- var responsiveCSS = generateResponsiveCSS();
102
- var shadowCSS = generateShadowCSS();
103
- var radiiCSS = generateRadiiCSS();
104
- var orderCSS = generateOrderCSS();
105
- var positionCSS = generatePositionCSS();
106
- var overflowCSS = generateOverflowCSS();
107
- var utilities = "\n ".concat(css, ";\n ").concat(hoverCSS, ";\n ").concat(responsiveCSS, ";\n ").concat(shadowCSS, ";\n ").concat(radiiCSS, ";\n ").concat(orderCSS, ";\n ").concat(positionCSS, ";\n ").concat(overflowCSS, ";\n");
52
+ var spaceProps = styleConfig.spaceProps,
53
+ colorProps = styleConfig.colorProps,
54
+ shadowProps = styleConfig.shadowProps,
55
+ radiusProps = styleConfig.radiusProps,
56
+ positionProps = styleConfig.positionProps,
57
+ overflowProps = styleConfig.overflowProps,
58
+ transitionProps = styleConfig.transitionProps,
59
+ cursorProps = styleConfig.cursorProps,
60
+ dimensionProps = styleConfig.dimensionProps,
61
+ aspectRatioProps = styleConfig.aspectRatioProps,
62
+ orderProps = styleConfig.orderProps,
63
+ flexProps = styleConfig.flexProps;
64
+ var utilities = "\n ".concat(generateUtilityClasses([spaceProps, colorProps, shadowProps, radiusProps, positionProps, overflowProps, transitionProps, cursorProps]), ";\n\n ").concat(generateStyleClasses([dimensionProps, spaceProps, colorProps, shadowProps, radiusProps, transitionProps, aspectRatioProps, orderProps, flexProps]), ";\n");
108
65
  export default utilities;
package/es/types.js CHANGED
@@ -19,6 +19,7 @@ export var alignSelfs = [].concat(axisAlignments, ['baseline']);
19
19
  export var flexWraps = ['nowrap', 'wrap', 'wrap-reverse'];
20
20
  export var overflows = ['visible', 'hidden', 'scroll', 'auto'];
21
21
  export var positions = ['static', 'relative', 'fixed', 'absolute', 'sticky'];
22
+ export var cursors = ['default', 'pointer'];
22
23
  export var types = {
23
24
  color: PropTypes.oneOfType([PropTypes.oneOf(Object.keys(vars.colors)), PropTypes.string]),
24
25
  responsiveSpace: PropTypes.oneOfType([PropTypes.oneOf(Object.keys(vars.spaces)), PropTypes.number, PropTypes.string, PropTypes.object]),
@@ -59,7 +60,7 @@ export var types = {
59
60
  buttonTag: PropTypes.oneOf(['button', 'a', 'span']),
60
61
  hint: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
61
62
  transition: PropTypes.oneOfType([PropTypes.oneOf(Object.keys(vars.transitions)), PropTypes.string]),
62
- cursor: PropTypes.oneOf(['default', 'pointer'])
63
+ cursor: PropTypes.oneOf(cursors)
63
64
  };
64
65
  export var defaultProps = {
65
66
  menuMaxHeight: '468px',
@@ -0,0 +1,51 @@
1
+ import "core-js/modules/es.object.to-string.js";
2
+ import "core-js/modules/web.dom-collections.for-each.js";
3
+ import "core-js/modules/es.array.concat.js";
4
+ import { isObject, propNameToShorthand } from './helpers';
5
+ export var generateStyleAttributes = function generateStyleAttributes(propsSets, allProps) {
6
+ var styles = {};
7
+ propsSets.forEach(function (propsSet) {
8
+ propsSet.props.forEach(function (_ref) {
9
+ var propName = _ref.propName;
10
+ var value = allProps[propName];
11
+ var hasVariable = propsSet.variableChecker ? propsSet.variableChecker(value) : false;
12
+ var hasTransformer = propsSet.valueTransformer ? true : false;
13
+ if (hasVariable) return;
14
+ if (!value) return;
15
+ var cssValue = hasTransformer ? propsSet.valueTransformer(value) : value;
16
+ var propNameShort = propNameToShorthand(propName);
17
+
18
+ if (!isObject(value)) {
19
+ styles["--".concat(propNameShort)] = cssValue;
20
+ }
21
+
22
+ if (isObject(value)) {
23
+ var def = value.default,
24
+ mobile = value.mobile,
25
+ tablet = value.tablet;
26
+ var defaultValueCss = hasTransformer ? propsSet.valueTransformer(def) : def;
27
+ var mobileValueCss = hasTransformer ? propsSet.valueTransformer(mobile) : mobile;
28
+ var tabletValueCss = hasTransformer ? propsSet.valueTransformer(tablet) : tablet;
29
+ styles["--".concat(propNameShort, "-def")] = defaultValueCss;
30
+ styles["--".concat(propNameShort, "-mob")] = mobileValueCss;
31
+ styles["--".concat(propNameShort, "-tab")] = tabletValueCss;
32
+ }
33
+ });
34
+ });
35
+ return styles;
36
+ };
37
+ export var generateClassNameAttributes = function generateClassNameAttributes(propsSets, allProps) {
38
+ var classNames = [];
39
+ propsSets.forEach(function (propsSet) {
40
+ propsSet.props.forEach(function (_ref2) {
41
+ var propName = _ref2.propName;
42
+ var value = allProps[propName];
43
+ var hasVariable = propsSet.variableChecker ? propsSet.variableChecker(value) : false;
44
+ if (!hasVariable) return;
45
+ if (!value) return;
46
+ var className = "".concat(propNameToShorthand(propName), "-").concat(value);
47
+ classNames.push(className);
48
+ });
49
+ });
50
+ return classNames.join(' ');
51
+ };
@@ -173,7 +173,7 @@ var shortHandProps = [{
173
173
  }, {
174
174
  propName: 'order',
175
175
  property: 'order',
176
- value: 'order'
176
+ value: 'ord'
177
177
  }, {
178
178
  propName: 'position',
179
179
  property: 'position',
@@ -190,6 +190,30 @@ var shortHandProps = [{
190
190
  propName: 'overflowY',
191
191
  property: 'overflow-y',
192
192
  value: 'ovf-y'
193
+ }, {
194
+ propName: 'zIndex',
195
+ property: 'z-index',
196
+ value: 'z'
197
+ }, {
198
+ propName: 'transition',
199
+ property: 'transition',
200
+ value: 'tr'
201
+ }, {
202
+ propName: 'transitionHover',
203
+ property: 'transition',
204
+ value: 'tr-hover'
205
+ }, {
206
+ propName: 'cursor',
207
+ property: 'cursor',
208
+ value: 'cur'
209
+ }, {
210
+ propName: 'aspectRatio',
211
+ property: 'aspect-ratio',
212
+ value: 'ar'
213
+ }, {
214
+ propName: 'flex',
215
+ property: 'flex',
216
+ value: 'flex'
193
217
  }];
194
218
  export var propertyToShorthand = function propertyToShorthand(property) {
195
219
  var _shortHandProps$find;
@@ -1,3 +1,5 @@
1
1
  export * from './helpers';
2
2
  export * from './responsive';
3
- export * from './styles';
3
+ export * from './styles';
4
+ export * from './style-config';
5
+ export * from './attributes';
@@ -0,0 +1,238 @@
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.includes.js";
4
+ import "core-js/modules/es.string.includes.js";
5
+ import "core-js/modules/es.symbol.js";
6
+ import "core-js/modules/es.symbol.description.js";
7
+ import "core-js/modules/es.object.to-string.js";
8
+ import "core-js/modules/es.symbol.iterator.js";
9
+ import "core-js/modules/es.array.iterator.js";
10
+ import "core-js/modules/es.string.iterator.js";
11
+ import "core-js/modules/web.dom-collections.iterator.js";
12
+ import "core-js/modules/es.array.from.js";
13
+ import "core-js/modules/es.array.slice.js";
14
+ import "core-js/modules/es.regexp.exec.js";
15
+
16
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
17
+
18
+ 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."); }
19
+
20
+ 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); }
21
+
22
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
23
+
24
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
25
+
26
+ 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; }
27
+
28
+ import { cursors, overflows, positions } from '../types';
29
+ import { vars } from '../variables';
30
+ import { getDimension, getSpace, isSpaceVar } from './responsive';
31
+ import { getColor, getRadius, getShadow, getTransition, isColorVar, isRadiusVar, isShadowVar, isTrasitionVar } from './styles';
32
+ var spaces = [].concat(_toConsumableArray(Object.keys(vars.spaces)), _toConsumableArray(Object.keys(vars.spaceUtils)));
33
+ var colors = [].concat(_toConsumableArray(Object.keys(vars.colors)), _toConsumableArray(Object.keys(vars.colorUtils)));
34
+ var shadows = Object.keys(vars.shadows);
35
+ var radii = Object.keys(vars.radii);
36
+ var transitions = [].concat(_toConsumableArray(Object.keys(vars.transitions)), _toConsumableArray(Object.keys(vars.transitionUtils)));
37
+ export var styleConfig = {
38
+ spaceProps: {
39
+ props: [{
40
+ propName: 'padding',
41
+ property: 'padding'
42
+ }, {
43
+ propName: 'paddingTop',
44
+ property: 'padding-top'
45
+ }, {
46
+ propName: 'paddingBottom',
47
+ property: 'padding-bottom'
48
+ }, {
49
+ propName: 'paddingLeft',
50
+ property: 'padding-left'
51
+ }, {
52
+ propName: 'paddingRight',
53
+ property: 'padding-right'
54
+ }, {
55
+ propName: 'paddingX',
56
+ property: 'padding-inline'
57
+ }, {
58
+ propName: 'paddingY',
59
+ property: 'padding-block'
60
+ }, {
61
+ propName: 'margin',
62
+ property: 'margin'
63
+ }, {
64
+ propName: 'marginTop',
65
+ property: 'margin-top'
66
+ }, {
67
+ propName: 'marginBottom',
68
+ property: 'margin-bottom'
69
+ }, {
70
+ propName: 'marginLeft',
71
+ property: 'margin-left'
72
+ }, {
73
+ propName: 'marginRight',
74
+ property: 'margin-right'
75
+ }, {
76
+ propName: 'marginX',
77
+ property: 'margin-inline'
78
+ }, {
79
+ propName: 'marginY',
80
+ property: 'margin-block'
81
+ }, {
82
+ propName: 'top',
83
+ property: 'top'
84
+ }, {
85
+ propName: 'bottom',
86
+ property: 'bottom'
87
+ }, {
88
+ propName: 'left',
89
+ property: 'left'
90
+ }, {
91
+ propName: 'right',
92
+ property: 'right'
93
+ }],
94
+ valueTransformer: getSpace,
95
+ variableChecker: isSpaceVar,
96
+ variables: spaces,
97
+ isResponsive: true
98
+ },
99
+ dimensionProps: {
100
+ props: [{
101
+ propName: 'width',
102
+ property: 'width'
103
+ }, {
104
+ propName: 'minWidth',
105
+ property: 'height'
106
+ }, {
107
+ propName: 'maxWidth',
108
+ property: 'min-width'
109
+ }, {
110
+ propName: 'height',
111
+ property: 'max-width'
112
+ }, {
113
+ propName: 'minHeight',
114
+ property: 'min-height'
115
+ }, {
116
+ propName: 'maxHeight',
117
+ property: 'max-height'
118
+ }],
119
+ valueTransformer: getDimension,
120
+ isResponsive: true
121
+ },
122
+ colorProps: {
123
+ props: [{
124
+ propName: 'color',
125
+ property: 'color'
126
+ }, {
127
+ propName: 'colorHover',
128
+ property: 'color',
129
+ modifier: 'hover'
130
+ }, {
131
+ propName: 'backgroundColor',
132
+ property: 'background-color'
133
+ }, {
134
+ propName: 'backgroundColorHover',
135
+ property: 'background-color',
136
+ modifier: 'hover'
137
+ }],
138
+ valueTransformer: getColor,
139
+ variableChecker: isColorVar,
140
+ variables: colors
141
+ },
142
+ shadowProps: {
143
+ props: [{
144
+ propName: 'shadow',
145
+ property: 'box-shadow'
146
+ }, {
147
+ propName: 'shadowHover',
148
+ property: 'box-shadow',
149
+ modifier: 'hover'
150
+ }],
151
+ valueTransformer: getShadow,
152
+ variableChecker: isShadowVar,
153
+ variables: shadows
154
+ },
155
+ radiusProps: {
156
+ props: [{
157
+ propName: 'radius',
158
+ property: 'border-radius'
159
+ }],
160
+ valueTransformer: getRadius,
161
+ variableChecker: isRadiusVar,
162
+ variables: radii
163
+ },
164
+ orderProps: {
165
+ props: [{
166
+ propName: 'order',
167
+ property: 'order'
168
+ }]
169
+ },
170
+ flexProps: {
171
+ props: [{
172
+ propName: 'flex',
173
+ property: 'flex'
174
+ }],
175
+ isResponsive: true
176
+ },
177
+ zIndexProps: {
178
+ props: [{
179
+ propName: 'zIndex',
180
+ property: 'z-index'
181
+ }]
182
+ },
183
+ positionProps: {
184
+ props: [{
185
+ propName: 'position',
186
+ property: 'position'
187
+ }],
188
+ variableChecker: function variableChecker(value) {
189
+ return positions.includes(value);
190
+ },
191
+ variables: positions
192
+ },
193
+ overflowProps: {
194
+ props: [{
195
+ propName: 'overflow',
196
+ property: 'overflow'
197
+ }, {
198
+ propName: 'overflowX',
199
+ property: 'overflow-x'
200
+ }, {
201
+ propName: 'overflowY',
202
+ property: 'overflow-y'
203
+ }],
204
+ variableChecker: function variableChecker(value) {
205
+ return overflows.includes(value);
206
+ },
207
+ variables: overflows
208
+ },
209
+ transitionProps: {
210
+ props: [{
211
+ propName: 'transition',
212
+ property: 'transition'
213
+ }, {
214
+ propName: 'transitionHover',
215
+ property: 'transition',
216
+ modifier: 'hover'
217
+ }],
218
+ valueTransformer: getTransition,
219
+ variableChecker: isTrasitionVar,
220
+ variables: transitions
221
+ },
222
+ cursorProps: {
223
+ props: [{
224
+ propName: 'cursor',
225
+ property: 'cursor'
226
+ }],
227
+ variableChecker: function variableChecker(value) {
228
+ return cursors.includes(value);
229
+ },
230
+ variables: cursors
231
+ },
232
+ aspectRatioProps: {
233
+ props: [{
234
+ propName: 'aspectRatio',
235
+ property: 'aspect-ratio'
236
+ }]
237
+ }
238
+ };
@@ -17,8 +17,11 @@ export var getColor = function getColor(color) {
17
17
 
18
18
  return color;
19
19
  };
20
+ export var isShadowVar = function isShadowVar(shadow) {
21
+ return shadow in vars.shadows;
22
+ };
20
23
  export var getShadow = function getShadow(shadow) {
21
- if (shadow in vars.shadows) {
24
+ if (isShadowVar(shadow)) {
22
25
  return getCssVar(varInfo.shadows.name, shadow);
23
26
  }
24
27
 
@@ -29,8 +32,11 @@ export var getWeight = function getWeight(weight) {
29
32
  return getCssVar(varInfo.weights.name, weight);
30
33
  }
31
34
  };
35
+ export var isRadiusVar = function isRadiusVar(radius) {
36
+ return radius in vars.radii;
37
+ };
32
38
  export var getRadius = function getRadius(radius) {
33
- if (radius in vars.radii) {
39
+ if (isRadiusVar(radius)) {
34
40
  return getCssVar(varInfo.radii.name, radius);
35
41
  }
36
42
 
@@ -38,6 +44,9 @@ export var getRadius = function getRadius(radius) {
38
44
  if (isString(radius)) return radius;
39
45
  if (isNumber(radius)) return u(radius);
40
46
  };
47
+ export var isTrasitionVar = function isTrasitionVar(transition) {
48
+ return transition in vars.transitionUtils || transition in vars.transitions;
49
+ };
41
50
  export var getTransition = function getTransition(transition) {
42
51
  if (transition in vars.transitionUtils) {
43
52
  return getCssVar(varInfo.transitionUtils.name, transition);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flodesk/grain",
3
- "version": "10.9.2",
3
+ "version": "10.9.4",
4
4
  "description": "Flodesk design system",
5
5
  "module": "es/index.js",
6
6
  "author": "Flodesk",