@flodesk/grain 11.1.0 → 11.2.1

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.
@@ -29,10 +29,11 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
29
29
  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; }
30
30
 
31
31
  import { generateAttributes } from '../../utilities';
32
- import React, { forwardRef } from 'react';
32
+ import React, { forwardRef, useContext } from 'react';
33
33
  import { types } from '../../types';
34
34
  import { Box } from '../box';
35
35
  import styles from './styles.module.css';
36
+ import { BreakpointsContext } from '../breakpoints-provider';
36
37
  import { jsx as ___EmotionJSX } from "@emotion/react";
37
38
  export var Arrange = /*#__PURE__*/forwardRef(function (_ref, ref) {
38
39
  var children = _ref.children,
@@ -55,6 +56,7 @@ export var Arrange = /*#__PURE__*/forwardRef(function (_ref, ref) {
55
56
 
56
57
  var propClassName = className ? className : '';
57
58
  var propStyle = style ? style : {};
59
+ var breakpoints = useContext(BreakpointsContext);
58
60
  var sharedProps = {
59
61
  gap: gap,
60
62
  columnGap: columnGap,
@@ -70,7 +72,8 @@ export var Arrange = /*#__PURE__*/forwardRef(function (_ref, ref) {
70
72
  columns: columns,
71
73
  rows: rows
72
74
  }, sharedProps),
73
- classNameProps: _objectSpread({}, sharedProps)
75
+ classNameProps: _objectSpread({}, sharedProps),
76
+ breakpoints: breakpoints
74
77
  });
75
78
 
76
79
  var styleAttributes = _objectSpread(_objectSpread({}, attributes.styles), propStyle);
@@ -26,10 +26,11 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
26
26
 
27
27
  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; }
28
28
 
29
- import React, { forwardRef } from 'react';
29
+ import React, { forwardRef, useContext } from 'react';
30
30
  import { types } from '../types';
31
31
  import PropTypes from 'prop-types';
32
32
  import { generateAttributes } from '../utilities';
33
+ import { BreakpointsContext } from './breakpoints-provider';
33
34
  import { jsx as ___EmotionJSX } from "@emotion/react";
34
35
  export var Box = /*#__PURE__*/forwardRef(function (_ref, ref) {
35
36
  var color = _ref.color,
@@ -91,6 +92,7 @@ export var Box = /*#__PURE__*/forwardRef(function (_ref, ref) {
91
92
  var propClassName = className ? className : '';
92
93
  var propStyle = style ? style : {};
93
94
  var Tag = tag;
95
+ var breakpoints = useContext(BreakpointsContext);
94
96
  var sharedProps = {
95
97
  padding: padding,
96
98
  paddingTop: paddingTop,
@@ -146,7 +148,8 @@ export var Box = /*#__PURE__*/forwardRef(function (_ref, ref) {
146
148
  overflow: overflow,
147
149
  overflowX: overflowX,
148
150
  overflowY: overflowY
149
- }, sharedProps)
151
+ }, sharedProps),
152
+ breakpoints: breakpoints
150
153
  });
151
154
  var classAttributes = "".concat(attributes.classNames, " ").concat(propClassName).trim();
152
155
 
@@ -0,0 +1,11 @@
1
+ import { createContext } from 'react';
2
+ import { breakpoints } from '../variables';
3
+ import { jsx as ___EmotionJSX } from "@emotion/react";
4
+ export var BreakpointsContext = /*#__PURE__*/createContext(breakpoints);
5
+ export var BreakpointsProvider = function BreakpointsProvider(_ref) {
6
+ var children = _ref.children,
7
+ breakpoints = _ref.breakpoints;
8
+ return ___EmotionJSX(BreakpointsContext.Provider, {
9
+ value: breakpoints
10
+ }, children);
11
+ };
@@ -89,9 +89,7 @@ export var Dropdown = function Dropdown(_ref2) {
89
89
  if (option.type === 'node') return ___EmotionJSX(Fragment, {
90
90
  key: index
91
91
  }, option.node({
92
- requestClose: function requestClose() {
93
- return close;
94
- }
92
+ requestClose: close
95
93
  }));
96
94
  return ___EmotionJSX(Menu.Item, {
97
95
  key: index
@@ -28,11 +28,12 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
28
28
 
29
29
  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; }
30
30
 
31
- import React, { forwardRef } from 'react';
31
+ import React, { forwardRef, useContext } from 'react';
32
32
  import { types } from '../../types';
33
33
  import { generateAttributes } from '../../utilities';
34
34
  import { Box } from '../box';
35
35
  import styles from './styles.module.css';
36
+ import { BreakpointsContext } from '../breakpoints-provider';
36
37
  import { jsx as ___EmotionJSX } from "@emotion/react";
37
38
  export var Flex = /*#__PURE__*/forwardRef(function (_ref, ref) {
38
39
  var _ref$direction = _ref.direction,
@@ -55,6 +56,7 @@ export var Flex = /*#__PURE__*/forwardRef(function (_ref, ref) {
55
56
 
56
57
  var propClassName = className ? className : '';
57
58
  var propStyle = style ? style : {};
59
+ var breakpoints = useContext(BreakpointsContext);
58
60
  var sharedProps = {
59
61
  gap: gap,
60
62
  columnGap: columnGap,
@@ -67,7 +69,8 @@ export var Flex = /*#__PURE__*/forwardRef(function (_ref, ref) {
67
69
  };
68
70
  var attributes = generateAttributes({
69
71
  styleProps: _objectSpread({}, sharedProps),
70
- classNameProps: _objectSpread({}, sharedProps)
72
+ classNameProps: _objectSpread({}, sharedProps),
73
+ breakpoints: breakpoints
71
74
  });
72
75
 
73
76
  var styleAttributes = _objectSpread(_objectSpread({}, attributes.styles), propStyle);
@@ -0,0 +1,108 @@
1
+ import "core-js/modules/es.object.keys.js";
2
+ import "core-js/modules/es.array.index-of.js";
3
+ import "core-js/modules/es.symbol.js";
4
+ import "core-js/modules/es.object.define-property.js";
5
+ import "core-js/modules/es.array.filter.js";
6
+ import "core-js/modules/es.object.to-string.js";
7
+ import "core-js/modules/es.object.get-own-property-descriptor.js";
8
+ import "core-js/modules/web.dom-collections.for-each.js";
9
+ import "core-js/modules/es.object.get-own-property-descriptors.js";
10
+ import "core-js/modules/es.object.define-properties.js";
11
+ import "core-js/modules/es.object.assign.js";
12
+ var _excluded = ["children", "direction", "justifyContent", "size", "className", "style"],
13
+ _excluded2 = ["children", "isActive"],
14
+ _excluded3 = ["children", "direction", "justifyContent", "size"];
15
+
16
+ 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); }
17
+
18
+ import "core-js/modules/es.string.trim.js";
19
+ import "core-js/modules/es.regexp.exec.js";
20
+ import "core-js/modules/es.string.replace.js";
21
+ import "core-js/modules/es.array.concat.js";
22
+
23
+ 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; }
24
+
25
+ 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; }
26
+
27
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
28
+
29
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
30
+
31
+ 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; }
32
+
33
+ import React, { forwardRef, useContext } from 'react';
34
+ import PropTypes from 'prop-types';
35
+ import { generateAttributes } from '../../utilities';
36
+ import { types } from '../../types';
37
+ import { BreakpointsContext } from '../breakpoints-provider';
38
+ import styles from './styles.module.css';
39
+ import { jsx as ___EmotionJSX } from "@emotion/react";
40
+
41
+ var NavRoot = function NavRoot(_ref) {
42
+ var children = _ref.children,
43
+ direction = _ref.direction,
44
+ justifyContent = _ref.justifyContent,
45
+ size = _ref.size,
46
+ className = _ref.className,
47
+ style = _ref.style,
48
+ props = _objectWithoutProperties(_ref, _excluded);
49
+
50
+ var propClassName = className ? className : '';
51
+ var propStyle = style ? style : {};
52
+ var breakpoints = useContext(BreakpointsContext);
53
+ var attributes = generateAttributes({
54
+ styleProps: {
55
+ size: size,
56
+ justifyContent: justifyContent
57
+ },
58
+ classNameProps: {
59
+ size: size,
60
+ justifyContent: justifyContent
61
+ },
62
+ breakpoints: breakpoints
63
+ });
64
+
65
+ var styleAttributes = _objectSpread(_objectSpread({}, attributes.styles), propStyle);
66
+
67
+ var classAttributes = [attributes.classNames, propClassName, styles.nav, styles[direction]].join(' ').replace(/\s+/g, ' ').trim();
68
+ return ___EmotionJSX("nav", _extends({
69
+ className: classAttributes,
70
+ style: styleAttributes
71
+ }, props), children);
72
+ };
73
+
74
+ export var NavItem = /*#__PURE__*/forwardRef(function (_ref2, ref) {
75
+ var children = _ref2.children,
76
+ isActive = _ref2.isActive,
77
+ props = _objectWithoutProperties(_ref2, _excluded2);
78
+
79
+ var classAttributes = "".concat(styles.navItem, " ").concat(isActive ? styles.isActive : '').trim();
80
+ return ___EmotionJSX("div", _extends({
81
+ ref: ref,
82
+ isActive: isActive,
83
+ className: classAttributes
84
+ }, props), children);
85
+ });
86
+ export var Nav = /*#__PURE__*/forwardRef(function (_ref3, ref) {
87
+ var children = _ref3.children,
88
+ _ref3$direction = _ref3.direction,
89
+ direction = _ref3$direction === void 0 ? 'row' : _ref3$direction,
90
+ justifyContent = _ref3.justifyContent,
91
+ size = _ref3.size,
92
+ props = _objectWithoutProperties(_ref3, _excluded3);
93
+
94
+ return ___EmotionJSX(NavRoot, _extends({
95
+ direction: direction,
96
+ size: size,
97
+ justifyContent: justifyContent,
98
+ ref: ref
99
+ }, props), children);
100
+ });
101
+ NavItem.propTypes = {
102
+ isActive: PropTypes.bool
103
+ };
104
+ Nav.propTypes = {
105
+ direction: PropTypes.oneOf(['row', 'column']),
106
+ size: types.responsiveTextSize,
107
+ justifyContent: PropTypes.oneOfType([PropTypes.oneOf(['start', 'end', 'center', 'stretch', 'space-around', 'space-between', 'space-evenly']), PropTypes.object])
108
+ };
@@ -0,0 +1,42 @@
1
+ .nav {
2
+ display: flex;
3
+ flex-wrap: wrap;
4
+ row-gap: var(--grn-space-s);
5
+ }
6
+
7
+ .nav.row {
8
+ flex-direction: row;
9
+ align-items: baseline;
10
+ column-gap: var(--grn-space-m);
11
+ }
12
+
13
+ .nav.row .navItem {
14
+ font-weight: var(--grn-weight-medium);
15
+ }
16
+
17
+ .nav.column {
18
+ flex-direction: column;
19
+ align-items: start;
20
+ }
21
+
22
+ .navItem {
23
+ cursor: pointer;
24
+ transition: color var(--grn-transition-leave);
25
+ color: var(--grn-color-content2);
26
+ }
27
+
28
+ .navItem.isActive {
29
+ color: var(--grn-color-content);
30
+ font-weight: var(--grn-weight-medium);
31
+ }
32
+
33
+ .navItem:hover {
34
+ color: var(--grn-color-content);
35
+ transition: color var(--grn-transition-hover);
36
+ }
37
+
38
+ .navItem a {
39
+ color: inherit;
40
+ text-decoration: none;
41
+ display: block;
42
+ }
@@ -2,13 +2,27 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { Global } from '@emotion/react';
4
4
  import styles from '../styles';
5
+ import { generateUtilitiesCss } from '../styles/utilities';
6
+ import { BreakpointsProvider } from './breakpoints-provider';
5
7
  import { jsx as ___EmotionJSX } from "@emotion/react";
8
+ var defaultBreakpoints = {
9
+ tablet: 1169,
10
+ mobile: 767
11
+ };
6
12
  export function GrainProvider(_ref) {
7
- var children = _ref.children;
8
- return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(Global, {
9
- styles: styles
13
+ var children = _ref.children,
14
+ _ref$breakpoints = _ref.breakpoints,
15
+ breakpoints = _ref$breakpoints === void 0 ? defaultBreakpoints : _ref$breakpoints;
16
+ var utilityStyles = generateUtilitiesCss({
17
+ breakpoints: breakpoints
18
+ });
19
+ return ___EmotionJSX(BreakpointsProvider, {
20
+ breakpoints: breakpoints
21
+ }, ___EmotionJSX(Global, {
22
+ styles: [styles, utilityStyles, process.env.NODE_ENV === "production" ? "" : ";label:GrainProvider;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21wb25lbnRzL3Byb3ZpZGVyLmpzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFnQmMiLCJmaWxlIjoiLi4vLi4vc3JjL2NvbXBvbmVudHMvcHJvdmlkZXIuanN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFJlYWN0IGZyb20gJ3JlYWN0JztcbmltcG9ydCBQcm9wVHlwZXMgZnJvbSAncHJvcC10eXBlcyc7XG5pbXBvcnQgeyBHbG9iYWwgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5pbXBvcnQgc3R5bGVzIGZyb20gJy4uL3N0eWxlcyc7XG5pbXBvcnQgeyBnZW5lcmF0ZVV0aWxpdGllc0NzcyB9IGZyb20gJy4uL3N0eWxlcy91dGlsaXRpZXMnO1xuaW1wb3J0IHsgQnJlYWtwb2ludHNQcm92aWRlciB9IGZyb20gJy4vYnJlYWtwb2ludHMtcHJvdmlkZXInO1xuXG5jb25zdCBkZWZhdWx0QnJlYWtwb2ludHMgPSB7XG4gIHRhYmxldDogMTE2OSxcbiAgbW9iaWxlOiA3NjcsXG59O1xuXG5leHBvcnQgZnVuY3Rpb24gR3JhaW5Qcm92aWRlcih7IGNoaWxkcmVuLCBicmVha3BvaW50cyA9IGRlZmF1bHRCcmVha3BvaW50cyB9KSB7XG4gIGNvbnN0IHV0aWxpdHlTdHlsZXMgPSBnZW5lcmF0ZVV0aWxpdGllc0Nzcyh7IGJyZWFrcG9pbnRzIH0pO1xuICByZXR1cm4gKFxuICAgIDxCcmVha3BvaW50c1Byb3ZpZGVyIGJyZWFrcG9pbnRzPXticmVha3BvaW50c30+XG4gICAgICA8R2xvYmFsIHN0eWxlcz17W3N0eWxlcywgdXRpbGl0eVN0eWxlc119IC8+XG4gICAgICB7Y2hpbGRyZW59XG4gICAgPC9CcmVha3BvaW50c1Byb3ZpZGVyPlxuICApO1xufVxuXG5HcmFpblByb3ZpZGVyLnByb3BUeXBlcyA9IHtcbiAgY2hpbGRyZW46IFByb3BUeXBlcy5ub2RlLmlzUmVxdWlyZWQsXG4gIGJyZWFrcG9pbnRzOiBQcm9wVHlwZXMub2JqZWN0LFxufTtcbiJdfQ== */"]
10
23
  }), children);
11
24
  }
12
25
  GrainProvider.propTypes = {
13
- children: PropTypes.node.isRequired
26
+ children: PropTypes.node.isRequired,
27
+ breakpoints: PropTypes.object
14
28
  };
@@ -29,9 +29,10 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
29
29
 
30
30
  import { generateAttributes } from '../../utilities';
31
31
  import PropTypes from 'prop-types';
32
- import React, { forwardRef } from 'react';
32
+ import React, { forwardRef, useContext } from 'react';
33
33
  import { types } from '../../types';
34
34
  import styles from './styles.module.css';
35
+ import { BreakpointsContext } from '../breakpoints-provider';
35
36
  import { jsx as ___EmotionJSX } from "@emotion/react";
36
37
  export var Text = /*#__PURE__*/forwardRef(function (_ref, ref) {
37
38
  var children = _ref.children,
@@ -65,6 +66,7 @@ export var Text = /*#__PURE__*/forwardRef(function (_ref, ref) {
65
66
 
66
67
  var propClassName = className ? className : '';
67
68
  var propStyle = style ? style : {};
69
+ var breakpoints = useContext(BreakpointsContext);
68
70
  var attributes = generateAttributes({
69
71
  styleProps: {
70
72
  size: size,
@@ -79,7 +81,8 @@ export var Text = /*#__PURE__*/forwardRef(function (_ref, ref) {
79
81
  weight: weight,
80
82
  display: !ellipsisLines ? display : undefined,
81
83
  textTransform: textTransform
82
- }
84
+ },
85
+ breakpoints: breakpoints
83
86
  });
84
87
 
85
88
  var styleAttributes = _objectSpread(_objectSpread(_objectSpread({}, attributes.styles), propStyle), ellipsisLines && _defineProperty({}, '--el', ellipsisLines));
@@ -2,5 +2,4 @@ import variables from './variables';
2
2
  import colors from './colors';
3
3
  import shadows from './shadows';
4
4
  import base from './base';
5
- import utilities from './utilities';
6
- export default [variables, colors, shadows, base, utilities].join('\n');
5
+ export default [variables, colors, shadows, base].join('\n');
@@ -27,7 +27,6 @@ import "core-js/modules/es.array.from.js";
27
27
  import "core-js/modules/es.regexp.exec.js";
28
28
  import { styleConfig } from '../utilities';
29
29
  import { propNameToShort } from '../utilities/style-config';
30
- import { breakpoints, deviceShort } from '../variables';
31
30
 
32
31
  var generateUtilityClassDeclarations = function generateUtilityClassDeclarations(propertySets) {
33
32
  var css = '';
@@ -47,7 +46,7 @@ var generateUtilityClassDeclarations = function generateUtilityClassDeclarations
47
46
  return css;
48
47
  };
49
48
 
50
- var generateStyleClassDeclarations = function generateStyleClassDeclarations(propertySets) {
49
+ var generateStyleClassDeclarations = function generateStyleClassDeclarations(breakpoints, propertySets) {
51
50
  var css = '';
52
51
  propertySets.forEach(function (set) {
53
52
  set.props.forEach(function (prop) {
@@ -60,14 +59,14 @@ var generateStyleClassDeclarations = function generateStyleClassDeclarations(pro
60
59
  if (hasHover) css += "[style*=\"".concat(cssVar, ":\"]:hover ").concat(declaration);
61
60
 
62
61
  if (set.isResponsive) {
63
- var device = deviceShort.default;
62
+ var device = 'default';
64
63
  css += "\n [style*=\"".concat(cssVar, "-").concat(device, "\"] {").concat(property, ": var(").concat(cssVar, "-").concat(device, ")}\n ");
65
64
  Object.entries(breakpoints).forEach(function (_ref) {
66
65
  var _ref2 = _slicedToArray(_ref, 2),
67
66
  deviceName = _ref2[0],
68
67
  screenSize = _ref2[1];
69
68
 
70
- var device = deviceShort[deviceName];
69
+ var device = deviceName;
71
70
  css += "\n @media (max-width: ".concat(screenSize, "px) {\n [style*=\"").concat(cssVar, "-").concat(device, "\"] {").concat(property, ": var(").concat(cssVar, "-").concat(device, ")}\n }\n ");
72
71
  });
73
72
  }
@@ -110,5 +109,9 @@ var classAndStyleDeclarationProps = [spaceProps, colorProps, shadowProps, radius
110
109
  var classDeclarationProps = [].concat(classAndStyleDeclarationProps, [positionProps, overflowProps, cursorProps, borderWidthProps, weightProps, textDisplayProps, borderSideProps, textTransformProps]);
111
110
  var styleDeclarationProps = [].concat(classAndStyleDeclarationProps, [dimensionProps, aspectRatioProps, orderProps, flexProps, opacityProps, zIndexProps, letterSpacingProps, gridTemplateProps]);
112
111
  var defaultBorder = "\n [class*=\"bd\"] {\n border-color: var(--grn-color-border);\n border-width: 1px;\n }\n";
113
- var utilities = "\n ".concat(defaultBorder, "\n ").concat(generateUtilityClassDeclarations(classDeclarationProps), ";\n ").concat(generateStyleClassDeclarations(styleDeclarationProps), ";\n");
114
- export default utilities;
112
+ export var generateUtilitiesCss = function generateUtilitiesCss(_ref3) {
113
+ var breakpoints = _ref3.breakpoints;
114
+ var classDeclarations = generateUtilityClassDeclarations(classDeclarationProps);
115
+ var styleDeclarations = generateStyleClassDeclarations(breakpoints, styleDeclarationProps);
116
+ return "\n ".concat(defaultBorder, "\n ").concat(classDeclarations, "\n ").concat(styleDeclarations, "\n ");
117
+ };
@@ -1,29 +1,45 @@
1
- import "core-js/modules/es.object.values.js";
1
+ import "core-js/modules/es.array.reduce.js";
2
2
  import "core-js/modules/es.object.to-string.js";
3
+ import "core-js/modules/es.object.keys.js";
4
+ import "core-js/modules/es.object.values.js";
3
5
  import "core-js/modules/web.dom-collections.for-each.js";
4
6
  import "core-js/modules/es.array.concat.js";
5
7
  import "core-js/modules/es.array.iterator.js";
6
8
  import "core-js/modules/es.map.js";
7
9
  import "core-js/modules/es.string.iterator.js";
8
10
  import "core-js/modules/web.dom-collections.iterator.js";
9
- import "core-js/modules/es.object.keys.js";
10
11
  import "core-js/modules/es.string.trim.js";
11
- import { breakpoints, deviceShort } from '../variables';
12
12
  import { isObject } from './helpers';
13
13
  import { propNameToShort, styleConfig } from './style-config';
14
- var mediaQueries = {
15
- tablet: "@media (max-width: ".concat(breakpoints.tablet, "px)"),
16
- mobile: "@media (max-width: ".concat(breakpoints.mobile, "px)")
14
+
15
+ var getValueWithBackup = function getValueWithBackup(value) {
16
+ var mediaQueries = {
17
+ '@media (max-width: 1169px)': 'tablet',
18
+ '@media (max-width: 767px)': 'mobile'
19
+ };
20
+ var valueWithBackup = Object.keys(value).reduce(function (acc, key) {
21
+ if (mediaQueries[key]) {
22
+ acc[mediaQueries[key]] = value[key];
23
+ } else {
24
+ acc[key] = value[key];
25
+ }
26
+
27
+ return acc;
28
+ }, {});
29
+ return valueWithBackup;
17
30
  };
18
- export var generateStyleAttributes = function generateStyleAttributes(props) {
31
+
32
+ export var generateStyleAttributes = function generateStyleAttributes(_ref) {
33
+ var styleProps = _ref.styleProps,
34
+ breakpoints = _ref.breakpoints;
19
35
  var styles = {};
20
36
  var styleConfigValues = Object.values(styleConfig);
21
37
  styleConfigValues.forEach(function (propsSet) {
22
38
  var variableChecker = propsSet.variableChecker,
23
39
  valueTransformer = propsSet.valueTransformer;
24
- propsSet.props.forEach(function (_ref) {
25
- var propName = _ref.propName;
26
- var value = props[propName];
40
+ propsSet.props.forEach(function (_ref2) {
41
+ var propName = _ref2.propName;
42
+ var value = styleProps[propName];
27
43
  if (value === undefined || value === null) return;
28
44
  var hasVariable = variableChecker && variableChecker(value);
29
45
  if (hasVariable) return;
@@ -37,18 +53,12 @@ export var generateStyleAttributes = function generateStyleAttributes(props) {
37
53
  if (!isObject(value)) {
38
54
  styles["--".concat(propNameShort)] = processValue(value);
39
55
  } else {
40
- var def = value.default,
41
- mobile = value.mobile,
42
- tablet = value.tablet; // accept fixed string media queries to help migration
43
-
44
- var mobileMediaValue = value[mediaQueries.mobile];
45
- var tabletMediaValue = value[mediaQueries.tablet]; // check undefined to allow 0 value
46
-
47
- var mob = mobileMediaValue !== undefined ? mobileMediaValue : mobile;
48
- var tab = tabletMediaValue !== undefined ? tabletMediaValue : tablet;
49
- styles["--".concat(propNameShort, "-").concat(deviceShort.default)] = processValue(def);
50
- styles["--".concat(propNameShort, "-").concat(deviceShort.mobile)] = processValue(mob);
51
- styles["--".concat(propNameShort, "-").concat(deviceShort.tablet)] = processValue(tab);
56
+ // // accept fixed string media queries to help migration
57
+ var valueWithBackup = getValueWithBackup(value);
58
+ styles["--".concat(propNameShort, "-default")] = processValue(value.default);
59
+ Object.keys(breakpoints).forEach(function (deviceName) {
60
+ styles["--".concat(propNameShort, "-").concat(deviceName)] = processValue(valueWithBackup[deviceName]);
61
+ });
52
62
  }
53
63
  });
54
64
  });
@@ -75,10 +85,14 @@ export var generateClassNameAttributes = function generateClassNameAttributes(pr
75
85
  });
76
86
  return classNames.join(' ').trim();
77
87
  };
78
- export var generateAttributes = function generateAttributes(_ref2) {
79
- var styleProps = _ref2.styleProps,
80
- classNameProps = _ref2.classNameProps;
81
- var styleAttributes = generateStyleAttributes(styleProps);
88
+ export var generateAttributes = function generateAttributes(_ref3) {
89
+ var styleProps = _ref3.styleProps,
90
+ classNameProps = _ref3.classNameProps,
91
+ breakpoints = _ref3.breakpoints;
92
+ var styleAttributes = generateStyleAttributes({
93
+ styleProps: styleProps,
94
+ breakpoints: breakpoints
95
+ });
82
96
  var classNameAttributes = generateClassNameAttributes(classNameProps);
83
97
  return {
84
98
  styles: styleAttributes,
@@ -1,9 +1,4 @@
1
1
  export var breakpoints = {
2
2
  tablet: 1169,
3
3
  mobile: 767
4
- };
5
- export var deviceShort = {
6
- default: 'def',
7
- mobile: 'mob',
8
- tablet: 'tab'
9
4
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flodesk/grain",
3
- "version": "11.1.0",
3
+ "version": "11.2.1",
4
4
  "description": "Flodesk design system",
5
5
  "module": "es/index.js",
6
6
  "author": "Flodesk",
@@ -1,88 +0,0 @@
1
- import _styled from "@emotion/styled/base";
2
- var _excluded = ["children", "isActive"],
3
- _excluded2 = ["children", "direction", "justifyContent", "size"];
4
-
5
- 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); }
6
-
7
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
8
-
9
- 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; }
10
-
11
- import "core-js/modules/es.array.concat.js";
12
- import "core-js/modules/es.object.keys.js";
13
- import "core-js/modules/es.array.index-of.js";
14
- import "core-js/modules/es.symbol.js";
15
- import "core-js/modules/es.object.assign.js";
16
- import React, { forwardRef } from 'react';
17
- import PropTypes from 'prop-types';
18
- import { getColor, getResponsiveOneOf, getResponsiveTextSize, getSpace, getTransition, getWeight } from '../utilities';
19
- import { types } from '../types';
20
- import { jsx as ___EmotionJSX } from "@emotion/react";
21
- var directionStyles = {
22
- row: "\n flex-direction: row;\n align-items: baseline;\n column-gap: ".concat(getSpace('m'), ";\n\n .NavItem {\n font-weight: ").concat(getWeight('medium'), ";\n }\n "),
23
- column: "\n flex-direction: column;\n align-items: start;\n "
24
- };
25
-
26
- var NavRoot = /*#__PURE__*/_styled("nav", process.env.NODE_ENV === "production" ? {
27
- target: "esn928h1"
28
- } : {
29
- target: "esn928h1",
30
- label: "NavRoot"
31
- })("display:flex;flex-wrap:wrap;row-gap:", getSpace('s'), ";", function (_ref) {
32
- var direction = _ref.direction;
33
- return directionStyles[direction];
34
- }, ";", function (_ref2) {
35
- var size = _ref2.size;
36
- return getResponsiveTextSize(size);
37
- }, ";", function (_ref3) {
38
- var justifyContent = _ref3.justifyContent;
39
- return getResponsiveOneOf('justify-content', justifyContent);
40
- }, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21wb25lbnRzL25hdi5qc3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBNkIwQiIsImZpbGUiOiIuLi8uLi9zcmMvY29tcG9uZW50cy9uYXYuanN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFJlYWN0LCB7IGZvcndhcmRSZWYgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgUHJvcFR5cGVzIGZyb20gJ3Byb3AtdHlwZXMnO1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuaW1wb3J0IHtcbiAgZ2V0Q29sb3IsXG4gIGdldFJlc3BvbnNpdmVPbmVPZixcbiAgZ2V0UmVzc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2NoaWxkcmVufVxuICAgICAgPC9OYXZSb290PlxuICAgICk7XG4gIH0sXG4pO1xuXG5OYXZJdGVtLnByb3BUeXBlcyA9IHtcbiAgaXNBY3RpdmU6IFByb3BUeXBlcy5ib29sLFxufTtcblxuTmF2LnByb3BUeXBlcyA9IHtcbiAgZGlyZWN0aW9uOiBQcm9wVHlwZXMub25lT2YoWydyb3cnLCAnY29sdW1uJ10pLFxuICBzaXplOiB0eXBlcy5yZXNwb25zaXZlVGV4dFNpemUsXG4gIGp1c3RpZnlDb250ZW50OiBQcm9wVHlwZXMub25lT2ZUeXBlKFtcbiAgICBQcm9wVHlwZXMub25lT2YoW1xuICAgICAgJ3N0YXJ0JyxcbiAgICAgICdlbmQnLFxuICAgICAgJ2NlbnRlcicsXG4gICAgICAnc3RyZXRjaCcsXG4gICAgICAnc3BhY2UtYXJvdW5kJyxcbiAgICAgICdzcGFjZS1iZXR3ZWVuJyxcbiAgICAgICdzcGFjZS1ldmVubHknLFxuICAgIF0pLFxuICAgIFByb3BUeXBlcy5vYmplY3QsXG4gIF0pLFxufTtcbiJdfQ== */"));
41
-
42
- var NavItemRoot = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
43
- target: "esn928h0"
44
- } : {
45
- target: "esn928h0",
46
- label: "NavItemRoot"
47
- })("cursor:pointer;color:", function (_ref4) {
48
- var isActive = _ref4.isActive;
49
- return getColor(isActive ? 'content' : 'content2');
50
- }, ";font-weight:", function (_ref5) {
51
- var isActive = _ref5.isActive;
52
- return getWeight(isActive ? 'medium' : 'normal');
53
- }, ";transition:color ", getTransition('leave'), ";&:hover{color:", getColor('content'), ";transition:color ", getTransition('hover'), ";}a{color:inherit;text-decoration:none;display:block;}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21wb25lbnRzL25hdi5qc3giXSwibmFtZXMiOltdLCJtYX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kUmVmKFxuICAoeyBjaGlsZHJlbiwgZGlyZWN0aW9uID0gJ3JvdycsIGp1c3RpZnlDb250ZW50LCBzaXplLCAuLi5wcm9wcyB9LCByZWYpID0+IHtcbiAgICByZXR1cm4gKFxuICAgICAgPE5hdlJvb3RcbiAgICAgICAgZGlyZWN0aW9uPXtkaXJlY3Rpb259XG4gICAgICAgIHNpemU9e3NpemV9XG4gICAgICAgIGp1c3RpZnlDb250ZW50PXtqdXN0aWZ5Q29udGVudH1cbiAgICAgICAgcmVmPXtyZWZ9XG4gICAgICAgIHsuLi5wcm9wc31cbiAgICAgID5cbiAgICAgICAge2NoaWxkcmVufVxuICAgICAgPC9OYXZSb290PlxuICAgICk7XG4gIH0sXG4pO1xuXG5OYXZJdGVtLnByb3BUeXBlcyA9IHtcbiAgaXNBY3RpdmU6IFByb3BUeXBlcy5ib29sLFxufTtcblxuTmF2LnByb3BUeXBlcyA9IHtcbiAgZGlyZWN0aW9uOiBQcm9wVHlwZXMub25lT2YoWydyb3cnLCAnY29sdW1uJ10pLFxuICBzaXplOiB0eXBlcy5yZXNwb25zaXZlVGV4dFNpemUsXG4gIGp1c3RpZnlDb250ZW50OiBQcm9wVHlwZXMub25lT2ZUeXBlKFtcbiAgICBQcm9wVHlwZXMub25lT2YoW1xuICAgICAgJ3N0YXJ0JyxcbiAgICAgICdlbmQnLFxuICAgICAgJ2NlbnRlcicsXG4gICAgICAnc3RyZXRjaCcsXG4gICAgICAnc3BhY2UtYXJvdW5kJyxcbiAgICAgICdzcGFjZS1iZXR3ZWVuJyxcbiAgICAgICdzcGFjZS1ldmVubHknLFxuICAgIF0pLFxuICAgIFByb3BUeXBlcy5vYmplY3QsXG4gIF0pLFxufTtcbiJdfQ== */"));
54
-
55
- export var NavItem = /*#__PURE__*/forwardRef(function (_ref6, ref) {
56
- var children = _ref6.children,
57
- isActive = _ref6.isActive,
58
- props = _objectWithoutProperties(_ref6, _excluded);
59
-
60
- return ___EmotionJSX(NavItemRoot, _extends({
61
- ref: ref,
62
- isActive: isActive,
63
- className: "NavItem"
64
- }, props), children);
65
- });
66
- export var Nav = /*#__PURE__*/forwardRef(function (_ref7, ref) {
67
- var children = _ref7.children,
68
- _ref7$direction = _ref7.direction,
69
- direction = _ref7$direction === void 0 ? 'row' : _ref7$direction,
70
- justifyContent = _ref7.justifyContent,
71
- size = _ref7.size,
72
- props = _objectWithoutProperties(_ref7, _excluded2);
73
-
74
- return ___EmotionJSX(NavRoot, _extends({
75
- direction: direction,
76
- size: size,
77
- justifyContent: justifyContent,
78
- ref: ref
79
- }, props), children);
80
- });
81
- NavItem.propTypes = {
82
- isActive: PropTypes.bool
83
- };
84
- Nav.propTypes = {
85
- direction: PropTypes.oneOf(['row', 'column']),
86
- size: types.responsiveTextSize,
87
- justifyContent: PropTypes.oneOfType([PropTypes.oneOf(['start', 'end', 'center', 'stretch', 'space-around', 'space-between', 'space-evenly']), PropTypes.object])
88
- };