@flodesk/grain 10.10.4 → 10.10.5

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.
@@ -9,7 +9,7 @@ import "core-js/modules/web.dom-collections.for-each.js";
9
9
  import "core-js/modules/es.object.get-own-property-descriptors.js";
10
10
  import "core-js/modules/es.object.define-properties.js";
11
11
  import "core-js/modules/es.object.assign.js";
12
- var _excluded = ["color", "colorHover", "backgroundColor", "backgroundColorHover", "width", "minWidth", "maxWidth", "height", "minHeight", "maxHeight", "radius", "padding", "paddingTop", "paddingBottom", "paddingLeft", "paddingRight", "paddingX", "paddingY", "margin", "marginTop", "marginBottom", "marginLeft", "marginRight", "marginX", "marginY", "position", "top", "bottom", "left", "right", "shadow", "shadowHover", "overflow", "overflowX", "overflowY", "aspectRatio", "zIndex", "tag", "opacity", "opacityHover", "order", "alignSelf", "flex", "transition", "transitionHover", "cursor", "children", "className", "style", "borderColor", "borderColorHover", "borderWidth", "borderLeftWidth", "borderRightWidth", "borderTopWidth", "borderBottomWidth", "borderXWidth", "borderYWidth"];
12
+ var _excluded = ["color", "colorHover", "backgroundColor", "backgroundColorHover", "width", "minWidth", "maxWidth", "height", "minHeight", "maxHeight", "radius", "padding", "paddingTop", "paddingBottom", "paddingLeft", "paddingRight", "paddingX", "paddingY", "margin", "marginTop", "marginBottom", "marginLeft", "marginRight", "marginX", "marginY", "position", "top", "bottom", "left", "right", "shadow", "shadowHover", "overflow", "overflowX", "overflowY", "aspectRatio", "zIndex", "tag", "opacity", "opacityHover", "order", "alignSelf", "flex", "transition", "transitionHover", "cursor", "children", "className", "style", "borderColor", "borderColorHover", "borderWidth", "borderWidthLeft", "borderWidthRight", "borderWidthTop", "borderWidthBottom", "borderWidthX", "borderWidthY"];
13
13
 
14
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); }
15
15
 
@@ -88,12 +88,12 @@ export var Box2 = /*#__PURE__*/forwardRef(function (_ref, ref) {
88
88
  borderColor = _ref.borderColor,
89
89
  borderColorHover = _ref.borderColorHover,
90
90
  borderWidth = _ref.borderWidth,
91
- borderLeftWidth = _ref.borderLeftWidth,
92
- borderRightWidth = _ref.borderRightWidth,
93
- borderTopWidth = _ref.borderTopWidth,
94
- borderBottomWidth = _ref.borderBottomWidth,
95
- borderXWidth = _ref.borderXWidth,
96
- borderYWidth = _ref.borderYWidth,
91
+ borderWidthLeft = _ref.borderWidthLeft,
92
+ borderWidthRight = _ref.borderWidthRight,
93
+ borderWidthTop = _ref.borderWidthTop,
94
+ borderWidthBottom = _ref.borderWidthBottom,
95
+ borderWidthX = _ref.borderWidthX,
96
+ borderWidthY = _ref.borderWidthY,
97
97
  otherProps = _objectWithoutProperties(_ref, _excluded);
98
98
 
99
99
  var styles = _objectSpread({}, generateStyleAttributes({
@@ -164,7 +164,7 @@ export var Box2 = /*#__PURE__*/forwardRef(function (_ref, ref) {
164
164
  shadow: shadow,
165
165
  shadowHover: shadowHover,
166
166
  radius: radius
167
- }, _defineProperty(_generateClassNameAtt, "position", position), _defineProperty(_generateClassNameAtt, "overflow", overflow), _defineProperty(_generateClassNameAtt, "transition", transition), _defineProperty(_generateClassNameAtt, "transitionHover", transitionHover), _defineProperty(_generateClassNameAtt, "cursor", cursor), _defineProperty(_generateClassNameAtt, "alignSelf", alignSelf), _defineProperty(_generateClassNameAtt, "borderColor", borderColor), _defineProperty(_generateClassNameAtt, "borderColorHover", borderColorHover), _defineProperty(_generateClassNameAtt, "borderWidth", borderWidth), _defineProperty(_generateClassNameAtt, "borderLeftWidth", borderLeftWidth), _defineProperty(_generateClassNameAtt, "borderRightWidth", borderRightWidth), _defineProperty(_generateClassNameAtt, "borderTopWidth", borderTopWidth), _defineProperty(_generateClassNameAtt, "borderBottomWidth", borderBottomWidth), _defineProperty(_generateClassNameAtt, "borderXWidth", borderXWidth), _defineProperty(_generateClassNameAtt, "borderYWidth", borderYWidth), _generateClassNameAtt)), propClassName].join(' ').replace(/\s+/g, ' ').trim();
167
+ }, _defineProperty(_generateClassNameAtt, "position", position), _defineProperty(_generateClassNameAtt, "overflow", overflow), _defineProperty(_generateClassNameAtt, "transition", transition), _defineProperty(_generateClassNameAtt, "transitionHover", transitionHover), _defineProperty(_generateClassNameAtt, "cursor", cursor), _defineProperty(_generateClassNameAtt, "alignSelf", alignSelf), _defineProperty(_generateClassNameAtt, "borderColor", borderColor), _defineProperty(_generateClassNameAtt, "borderColorHover", borderColorHover), _defineProperty(_generateClassNameAtt, "borderWidth", borderWidth), _defineProperty(_generateClassNameAtt, "borderWidthLeft", borderWidthLeft), _defineProperty(_generateClassNameAtt, "borderWidthRight", borderWidthRight), _defineProperty(_generateClassNameAtt, "borderWidthTop", borderWidthTop), _defineProperty(_generateClassNameAtt, "borderWidthBottom", borderWidthBottom), _defineProperty(_generateClassNameAtt, "borderWidthX", borderWidthX), _defineProperty(_generateClassNameAtt, "borderWidthY", borderWidthY), _generateClassNameAtt)), propClassName].join(' ').replace(/\s+/g, ' ').trim();
168
168
  var Tag = tag;
169
169
  return ___EmotionJSX(Tag, _extends({
170
170
  ref: ref,
@@ -181,12 +181,12 @@ Box2.propTypes = {
181
181
  borderColor: types.color,
182
182
  borderColorHover: types.color,
183
183
  borderWidth: types.borderWidth,
184
- borderLeftWidth: types.borderWidth,
185
- borderRightWidth: types.borderWidth,
186
- borderTopWidth: types.borderWidth,
187
- borderBottomWidth: types.borderWidth,
188
- borderXWidth: types.borderWidth,
189
- borderYWidth: types.borderWidth,
184
+ borderWidthLeft: types.borderWidth,
185
+ borderWidthRight: types.borderWidth,
186
+ borderWidthTop: types.borderWidth,
187
+ borderWidthBottom: types.borderWidth,
188
+ borderWidthX: types.borderWidth,
189
+ borderWidthY: types.borderWidth,
190
190
  width: types.responsiveDimension,
191
191
  minWidth: types.responsiveDimension,
192
192
  maxWidth: types.responsiveDimension,
@@ -26,6 +26,7 @@ import "core-js/modules/web.dom-collections.iterator.js";
26
26
  import "core-js/modules/es.array.slice.js";
27
27
  import "core-js/modules/es.array.from.js";
28
28
  import "core-js/modules/es.regexp.exec.js";
29
+ import { borderWidths } from '../types';
29
30
  import { styleConfig } from '../utilities';
30
31
  import { propNameToShort } from '../utilities/style-config';
31
32
 
@@ -37,14 +38,10 @@ var generateUtilityClassDeclarations = function generateUtilityClassDeclarations
37
38
  var property = prop.property;
38
39
  var cssValue = set.valueTransformer ? set.valueTransformer(variable) : variable;
39
40
  var hasHover = prop.propName.includes('Hover');
40
-
41
- if (!hasHover) {
42
- css += "\n .".concat(propNameToShort(prop.propName), "-").concat(variable, " {\n ").concat(property, ": ").concat(cssValue, "\n }");
43
- }
44
-
45
- if (hasHover) {
46
- css += "\n .".concat(propNameToShort(prop.propName), "-").concat(variable, ":hover {\n ").concat(property, ": ").concat(cssValue, "\n }");
47
- }
41
+ var selector = ".".concat(propNameToShort(prop.propName), "-").concat(variable);
42
+ var declaration = "{".concat(property, ": ").concat(cssValue, "}");
43
+ if (!hasHover) css += "".concat(selector, " ").concat(declaration);
44
+ if (hasHover) css += "".concat(selector, ":hover ").concat(declaration);
48
45
  });
49
46
  });
50
47
  });
@@ -64,14 +61,9 @@ var generateStyleClassDeclarations = function generateStyleClassDeclarations(pro
64
61
  var propName = prop.propName;
65
62
  var cssVar = "--".concat(propNameToShort(propName));
66
63
  var hasHover = prop.propName.includes('Hover');
67
-
68
- if (!hasHover) {
69
- css += "[style*=\"".concat(cssVar, ":\"] {").concat(property, ": var(").concat(cssVar, ")}");
70
- }
71
-
72
- if (hasHover) {
73
- css += "[style*=\"".concat(cssVar, "\"]:hover {").concat(property, ": var(").concat(cssVar, ")}");
74
- }
64
+ var declaration = "{".concat(property, ": var(").concat(cssVar, ")}");
65
+ if (!hasHover) css += "[style*=\"".concat(cssVar, ":\"] ").concat(declaration);
66
+ if (hasHover) css += "[style*=\"".concat(cssVar, ":\"]:hover ").concat(declaration);
75
67
 
76
68
  if (set.isResponsive) {
77
69
  css += "\n [style*=\"".concat(cssVar, "-def\"] {").concat(property, ": var(").concat(cssVar, "-def)}\n ");
@@ -124,12 +116,14 @@ var generateBorderStyle = function generateBorderStyle() {
124
116
  shortSide = _ref4[0],
125
117
  side = _ref4[1];
126
118
 
127
- css += "\n [class*=\"bd".concat(shortSide, "w-\"] { border-").concat(side, "-style: solid }\n ");
119
+ css += "\n [class*=\"bdw-".concat(shortSide, "\"] { border-").concat(side, "-style: solid }\n ");
128
120
  }).join('');
129
- css += "\n [class*=\"bdw-\"] { border-style: solid }\n ";
121
+ css += "\n ".concat(borderWidths.map(function (w) {
122
+ return ".bdw-".concat(w);
123
+ }), " { border-style: solid }\n ");
130
124
  return css;
131
125
  };
132
126
 
133
- var defaultBorderColor = "\n [class*=\"bdw-\"]:not([class*=\"bdc-\"]),\n [class*=\"bdw-\"][class*=\"bdc-h\"]:not(:hover) {\n border-color: var(--grn-color-border);\n }\n";
134
- var utilities = "\n ".concat(generateUtilityClassDeclarations(classDeclarationProps), ";\n ").concat(generateStyleClassDeclarations(styleDeclarationProps), ";\n ").concat(generateBorderStyle(), "\n ").concat(defaultBorderColor, "\n");
127
+ var defaultBorderColor = "\n [class*=\"bd\"] {\n border-color: var(--grn-color-border);\n }\n";
128
+ var utilities = "\n ".concat(defaultBorderColor, "\n ").concat(generateUtilityClassDeclarations(classDeclarationProps), ";\n ").concat(generateStyleClassDeclarations(styleDeclarationProps), ";\n ").concat(generateBorderStyle(), "\n");
135
129
  export default utilities;
@@ -331,29 +331,29 @@ export var styleConfig = {
331
331
  property: 'border-width',
332
332
  short: 'bdw'
333
333
  }, {
334
- propName: 'borderTopWidth',
334
+ propName: 'borderWidthTop',
335
335
  property: 'border-top-width',
336
- short: 'bdtw'
336
+ short: 'bdw-t'
337
337
  }, {
338
- propName: 'borderRightWidth',
338
+ propName: 'borderWidthRight',
339
339
  property: 'border-right-width',
340
- short: 'bdrw'
340
+ short: 'bdw-r'
341
341
  }, {
342
- propName: 'borderBottomWidth',
342
+ propName: 'borderWidthBottom',
343
343
  property: 'border-bottom-width',
344
- short: 'bdbw'
344
+ short: 'bdw-b'
345
345
  }, {
346
- propName: 'borderLeftWidth',
346
+ propName: 'borderWidthLeft',
347
347
  property: 'border-left-width',
348
- short: 'bdlw'
348
+ short: 'bdw-l'
349
349
  }, {
350
- propName: 'borderXWidth',
350
+ propName: 'borderWidthX',
351
351
  property: 'border-inline-width',
352
- short: 'bdxw'
352
+ short: 'bdw-x'
353
353
  }, {
354
- propName: 'borderYWidth',
354
+ propName: 'borderWidthY',
355
355
  property: 'border-block-width',
356
- short: 'bdyw'
356
+ short: 'bdw-y'
357
357
  }],
358
358
  valueTransformer: function valueTransformer(borderWidth) {
359
359
  return "".concat(borderWidth, "px");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flodesk/grain",
3
- "version": "10.10.4",
3
+ "version": "10.10.5",
4
4
  "description": "Flodesk design system",
5
5
  "module": "es/index.js",
6
6
  "author": "Flodesk",