@flodesk/grain 11.0.9 → 11.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/arrange/index.js +5 -2
- package/es/components/box.js +5 -2
- package/es/components/breakpoints-provider.js +11 -0
- package/es/components/flex/index.js +5 -2
- package/es/components/nav/index.js +108 -0
- package/es/components/nav/styles.module.css +42 -0
- package/es/components/provider.js +18 -4
- package/es/components/text/index.js +5 -2
- package/es/components/text-input.js +64 -47
- package/es/styles/index.js +1 -2
- package/es/styles/utilities.js +9 -6
- package/es/utilities/attributes.js +40 -26
- package/es/variables/breakpoints.js +0 -5
- package/package.json +1 -1
- package/es/components/nav.js +0 -88
|
@@ -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);
|
package/es/components/box.js
CHANGED
|
@@ -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
|
+
};
|
|
@@ -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
|
-
|
|
9
|
-
|
|
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));
|
|
@@ -1,20 +1,7 @@
|
|
|
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.assign.js";
|
|
5
|
-
import "core-js/modules/es.symbol.description.js";
|
|
6
|
-
import "core-js/modules/es.object.to-string.js";
|
|
7
|
-
import "core-js/modules/es.symbol.iterator.js";
|
|
8
|
-
import "core-js/modules/es.array.iterator.js";
|
|
9
|
-
import "core-js/modules/es.string.iterator.js";
|
|
10
|
-
import "core-js/modules/web.dom-collections.iterator.js";
|
|
11
|
-
import "core-js/modules/es.array.slice.js";
|
|
12
|
-
import "core-js/modules/es.array.from.js";
|
|
13
|
-
import "core-js/modules/es.regexp.exec.js";
|
|
14
1
|
import _styled from "@emotion/styled/base";
|
|
15
2
|
var _excluded = ["children", "internalType", "setInternalType"],
|
|
16
3
|
_excluded2 = ["children"],
|
|
17
|
-
_excluded3 = ["value", "placeholder", "label", "id", "icon", "hasError", "errorMessage", "isReadOnly", "isDisabled", "type", "hint"];
|
|
4
|
+
_excluded3 = ["value", "placeholder", "label", "id", "icon", "hasError", "errorMessage", "isReadOnly", "isDisabled", "type", "hint", "onClear"];
|
|
18
5
|
|
|
19
6
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
20
7
|
|
|
@@ -30,12 +17,24 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
30
17
|
|
|
31
18
|
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); }
|
|
32
19
|
|
|
33
|
-
import "core-js/modules/es.array.concat.js";
|
|
34
|
-
|
|
35
20
|
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; }
|
|
36
21
|
|
|
37
22
|
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; }
|
|
38
23
|
|
|
24
|
+
import "core-js/modules/es.array.concat.js";
|
|
25
|
+
import "core-js/modules/es.object.keys.js";
|
|
26
|
+
import "core-js/modules/es.array.index-of.js";
|
|
27
|
+
import "core-js/modules/es.symbol.js";
|
|
28
|
+
import "core-js/modules/es.object.assign.js";
|
|
29
|
+
import "core-js/modules/es.symbol.description.js";
|
|
30
|
+
import "core-js/modules/es.object.to-string.js";
|
|
31
|
+
import "core-js/modules/es.symbol.iterator.js";
|
|
32
|
+
import "core-js/modules/es.array.iterator.js";
|
|
33
|
+
import "core-js/modules/es.string.iterator.js";
|
|
34
|
+
import "core-js/modules/web.dom-collections.iterator.js";
|
|
35
|
+
import "core-js/modules/es.array.slice.js";
|
|
36
|
+
import "core-js/modules/es.array.from.js";
|
|
37
|
+
import "core-js/modules/es.regexp.exec.js";
|
|
39
38
|
import PropTypes from 'prop-types';
|
|
40
39
|
import React from 'react';
|
|
41
40
|
import { Box, Text } from '.';
|
|
@@ -43,7 +42,7 @@ import { Icon } from './icon';
|
|
|
43
42
|
import { IconButton } from './icon-button';
|
|
44
43
|
import { componentVars, FieldHint, FieldLabel, InputField } from '../foundational';
|
|
45
44
|
import { types } from '../types';
|
|
46
|
-
import { IconHide, IconShow } from '../icons';
|
|
45
|
+
import { IconCross, IconHide, IconShow } from '../icons';
|
|
47
46
|
import { useWidth } from '../hooks';
|
|
48
47
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
49
48
|
var iconOffsetPx = 12;
|
|
@@ -54,19 +53,11 @@ var IconSection = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "producti
|
|
|
54
53
|
} : {
|
|
55
54
|
target: "e1o9e51y0",
|
|
56
55
|
label: "IconSection"
|
|
57
|
-
})("position:absolute;margin:auto;left:", iconOffsetPx, "px;top:0;bottom:0;height:fit-content;pointer-events:none;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
58
|
-
|
|
59
|
-
var VisibilityButton = function VisibilityButton(_ref) {
|
|
60
|
-
var children = _ref.children,
|
|
61
|
-
internalType = _ref.internalType,
|
|
62
|
-
setInternalType = _ref.setInternalType,
|
|
63
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
56
|
+
})("position:absolute;margin:auto;left:", iconOffsetPx, "px;top:0;bottom:0;height:fit-content;pointer-events:none;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21wb25lbnRzL3RleHQtaW5wdXQuanN4Il0sIm5hbWVzIj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5zdHJpbmcsIFByb3BUeXBlcy5udW1iZXJdKSxcbiAgbGFiZWw6IHR5cGVzLmxhYmVsLFxuICBpY29uOiBQcm9wVHlwZXMubm9kZSxcbiAgaGFzRXJyb3I6IFByb3BUeXBlcy5ib29sLFxuICBlcnJvck1lc3NhZ2U6IFByb3BUeXBlcy5zdHJpbmcsXG4gIGlzUmVhZE9ubHk6IFByb3BUeXBlcy5ib29sLFxuICBpc0Rpc2FibGVkOiBQcm9wVHlwZXMuYm9vbCxcbiAgdHlwZTogdHlwZXMudGV4dElucHV0LFxuICBoaW50OiB0eXBlcy5oaW50LFxufTtcbiJdfQ== */"));
|
|
64
57
|
|
|
58
|
+
var ActionButtonWrapper = function ActionButtonWrapper(_ref) {
|
|
59
|
+
var children = _ref.children;
|
|
65
60
|
var rightOffset = "calc((".concat(componentVars.textBoxHeight, " - ").concat(componentVars.clearButtonHeight, ") / 2)");
|
|
66
|
-
var typeAndIconMap = {
|
|
67
|
-
password: ___EmotionJSX(IconShow, null),
|
|
68
|
-
text: ___EmotionJSX(IconHide, null)
|
|
69
|
-
};
|
|
70
61
|
return ___EmotionJSX(Box, {
|
|
71
62
|
position: "absolute",
|
|
72
63
|
right: rightOffset,
|
|
@@ -74,7 +65,20 @@ var VisibilityButton = function VisibilityButton(_ref) {
|
|
|
74
65
|
bottom: "0",
|
|
75
66
|
margin: "auto",
|
|
76
67
|
height: "fit-content"
|
|
77
|
-
},
|
|
68
|
+
}, children);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
var VisibilityButton = function VisibilityButton(_ref2) {
|
|
72
|
+
var children = _ref2.children,
|
|
73
|
+
internalType = _ref2.internalType,
|
|
74
|
+
setInternalType = _ref2.setInternalType,
|
|
75
|
+
props = _objectWithoutProperties(_ref2, _excluded);
|
|
76
|
+
|
|
77
|
+
var typeAndIconMap = {
|
|
78
|
+
password: ___EmotionJSX(IconShow, null),
|
|
79
|
+
text: ___EmotionJSX(IconHide, null)
|
|
80
|
+
};
|
|
81
|
+
return ___EmotionJSX(ActionButtonWrapper, null, ___EmotionJSX(IconButton, _extends({}, props, {
|
|
78
82
|
icon: typeAndIconMap[internalType],
|
|
79
83
|
onClick: function onClick() {
|
|
80
84
|
return setInternalType(internalType === 'text' ? 'password' : 'text');
|
|
@@ -82,26 +86,35 @@ var VisibilityButton = function VisibilityButton(_ref) {
|
|
|
82
86
|
})));
|
|
83
87
|
};
|
|
84
88
|
|
|
85
|
-
|
|
86
|
-
var
|
|
87
|
-
|
|
89
|
+
var ClearButton = function ClearButton(_ref3) {
|
|
90
|
+
var onClick = _ref3.onClick;
|
|
91
|
+
return ___EmotionJSX(ActionButtonWrapper, null, ___EmotionJSX(IconButton, {
|
|
92
|
+
icon: ___EmotionJSX(IconCross, null),
|
|
93
|
+
onClick: onClick
|
|
94
|
+
}));
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export var TextInputLabel = function TextInputLabel(_ref4) {
|
|
98
|
+
var children = _ref4.children,
|
|
99
|
+
props = _objectWithoutProperties(_ref4, _excluded2);
|
|
88
100
|
|
|
89
101
|
return ___EmotionJSX(FieldLabel, props, children);
|
|
90
102
|
};
|
|
91
|
-
export var TextInput = /*#__PURE__*/React.forwardRef(function (
|
|
92
|
-
var value =
|
|
93
|
-
placeholder =
|
|
94
|
-
label =
|
|
95
|
-
id =
|
|
96
|
-
icon =
|
|
97
|
-
hasError =
|
|
98
|
-
errorMessage =
|
|
99
|
-
isReadOnly =
|
|
100
|
-
isDisabled =
|
|
101
|
-
|
|
102
|
-
type =
|
|
103
|
-
hint =
|
|
104
|
-
|
|
103
|
+
export var TextInput = /*#__PURE__*/React.forwardRef(function (_ref5, ref) {
|
|
104
|
+
var value = _ref5.value,
|
|
105
|
+
placeholder = _ref5.placeholder,
|
|
106
|
+
label = _ref5.label,
|
|
107
|
+
id = _ref5.id,
|
|
108
|
+
icon = _ref5.icon,
|
|
109
|
+
hasError = _ref5.hasError,
|
|
110
|
+
errorMessage = _ref5.errorMessage,
|
|
111
|
+
isReadOnly = _ref5.isReadOnly,
|
|
112
|
+
isDisabled = _ref5.isDisabled,
|
|
113
|
+
_ref5$type = _ref5.type,
|
|
114
|
+
type = _ref5$type === void 0 ? 'text' : _ref5$type,
|
|
115
|
+
hint = _ref5.hint,
|
|
116
|
+
onClear = _ref5.onClear,
|
|
117
|
+
props = _objectWithoutProperties(_ref5, _excluded3);
|
|
105
118
|
|
|
106
119
|
var iconRef = React.useRef(null);
|
|
107
120
|
|
|
@@ -112,8 +125,10 @@ export var TextInput = /*#__PURE__*/React.forwardRef(function (_ref3, ref) {
|
|
|
112
125
|
|
|
113
126
|
var iconWidth = useWidth(iconRef);
|
|
114
127
|
var hasVisibilityButton = type === 'password' && !isReadOnly && !isDisabled;
|
|
128
|
+
var hasClearButton = onClear && !isReadOnly && !isDisabled;
|
|
129
|
+
var hasButton = hasVisibilityButton || hasClearButton;
|
|
115
130
|
var paddingLeft = icon ? "".concat(iconOffsetPx + iconWidth + iconTextGapPx, "px") : undefined;
|
|
116
|
-
var paddingRight =
|
|
131
|
+
var paddingRight = hasButton ? componentVars.textBoxHeight : undefined;
|
|
117
132
|
var fieldMarginTop = label || hint ? 'betweenFormControlAndLabel' : undefined;
|
|
118
133
|
return ___EmotionJSX("div", null, label && ___EmotionJSX(FieldLabel, {
|
|
119
134
|
htmlFor: id
|
|
@@ -137,6 +152,8 @@ export var TextInput = /*#__PURE__*/React.forwardRef(function (_ref3, ref) {
|
|
|
137
152
|
}, props)), hasVisibilityButton && ___EmotionJSX(VisibilityButton, {
|
|
138
153
|
setInternalType: setInternalType,
|
|
139
154
|
internalType: internalType
|
|
155
|
+
}), hasClearButton && value && ___EmotionJSX(ClearButton, {
|
|
156
|
+
onClick: onClear
|
|
140
157
|
})), errorMessage && ___EmotionJSX(Box, {
|
|
141
158
|
marginTop: "betweenFormControlAndLabel"
|
|
142
159
|
}, ___EmotionJSX(Text, {
|
package/es/styles/index.js
CHANGED
|
@@ -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
|
-
|
|
6
|
-
export default [variables, colors, shadows, base, utilities].join('\n');
|
|
5
|
+
export default [variables, colors, shadows, base].join('\n');
|
package/es/styles/utilities.js
CHANGED
|
@@ -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 =
|
|
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 =
|
|
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
|
|
114
|
-
|
|
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.
|
|
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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
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 (
|
|
25
|
-
var propName =
|
|
26
|
-
var value =
|
|
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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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(
|
|
79
|
-
var styleProps =
|
|
80
|
-
classNameProps =
|
|
81
|
-
|
|
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,
|
package/package.json
CHANGED
package/es/components/nav.js
DELETED
|
@@ -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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21wb25lbnRzL25hdi5qc3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBNkIwQiIsImZpbGUiOiIuLi8uLi9zcmMvY29tcG9uZW50cy9uYXYuanN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFJlYWN0LCB7IGZvcndhcmRSZWYgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgUHJvcFR5cGVzIGZyb20gJ3Byb3AtdHlwZXMnO1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuaW1wb3J0IHtcbiAgZ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VmPXtyZWZ9XG4gICAgICAgIHsuLi5wcm9wc31cbiAgICAgID5cbiAgICAgICAge2NoaWxkcmVufVxuICAgICAgPC9OYXZSb290PlxuICAgICk7XG4gIH0sXG4pO1xuXG5OYXZJdGVtLnByb3BUeXBlcyA9IHtcbiAgaXNBY3RpdmU6IFByb3BUeXBlcy5ib29sLFxufTtcblxuTmF2LnByb3BUeXBlcyA9IHtcbiAgZGlyZWN0aW9uOiBQcm9wVHlwZXMub25lT2YoWydyb3cnLCAnY29sdW1uJ10pLFxuICBzaXplOiB0eXBlcy5yZXNwb25zaXZlVGV4dFNpemUsXG4gIGp1c3RpZnlDb250ZW50OiBQcm9wVHlwZXMub25lT2ZUeXBlKFtcbiAgICBQcm9wVHlwZXMub25lT2YoW1xuICAgICAgJ3N0YXJ0JyxcbiAgICAgICdlbmQnLFxuICAgICAgJ2NlbnRlcicsXG4gICAgICAnc3RyZXRjaCcsXG4gICAgICAnc3BhY2UtYXJvdW5kJyxcbiAgICAgICdzcGFjZS1iZXR3ZWVuJyxcbiAgICAgICdzcGFjZS1ldmVubHknLFxuICAgIF0pLFxuICAgIFByb3BUeXBlcy5vYmplY3QsXG4gIF0pLFxufTtcbiJdfQ== */"));
|
|
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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21wb25lbnRzL25hdi5qc3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBc0M4QiIsImZpbGUiOiIuLi8uLi9zcmMvY29tcG9uZW50cy9uYXYuanN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFJlYWN0LCB7IGZvcndhcmRSZWYgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgUHJvcFR5cGVzIGZyb20gJ3Byb3AtdHlwZXMnO1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuaW1wb3J0IHtcbiAgZ2V0Q29sb3IsXG4gIGdldFJlc3BvbnNpdmVPbmVPZixcbiAgZ2V0UmVzcG9uc2l2ZVRleHRTaXplLFxuICBnZXRTcGFjZSxcbiAgZ2V0VHJhbnNpdGlvbixcbiAgZ2V0V2VpZ2h0LFxufSBmcm9tICcuLi91dGlsaXRpZXMnO1xuaW1wb3J0IHsgdHlwZXMgfSBmcm9tICcuLi90eXBlcyc7XG5cbmNvbnN0IGRpcmVjdGlvblN0eWxlcyA9IHtcbiAgcm93OiBgXG4gICAgZmxleC1kaXJlY3Rpb246IHJvdztcbiAgICBhbGlnbi1pdGVtczogYmFzZWxpbmU7XG4gICAgY29sdW1uLWdhcDogJHtnZXRTcGFjZSgnbScpfTtcblxuICAgIC5OYXZJdGVtIHtcbiAgICAgIGZvbnQtd2VpZ2h0OiAke2dldFdlaWdodCgnbWVkaXVtJyl9O1xuICAgIH1cbiAgYCxcbiAgY29sdW1uOiBgXG4gICAgZmxleC1kaXJlY3Rpb246IGNvbHVtbjtcbiAgICBhbGlnbi1pdGVtczogc3RhcnQ7XG4gIGAsXG59O1xuXG5jb25zdCBOYXZSb290ID0gc3R5bGVkLm5hdmBcbiAgZGlzcGxheTogZ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tcbiJdfQ== */"));
|
|
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
|
-
};
|