@flodesk/grain 2.20.1 → 2.20.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.
- package/es/components/arrange.js +2 -2
- package/es/components/box.js +31 -11
- package/es/components/button.js +5 -5
- package/es/components/icon-button.js +4 -4
- package/es/components/icon-toggle.js +8 -8
- package/es/components/icon.js +4 -4
- package/es/components/index.js +11 -11
- package/es/components/stack.js +4 -4
- package/es/components/text-button.js +3 -3
- package/es/components/text-input.js +5 -5
- package/es/components/text-toggle.js +5 -5
- package/es/components/text.js +4 -4
- package/es/foundational/index.js +4 -4
- package/es/hooks/index.js +1 -1
- package/es/hooks/useMedia.js +1 -1
- package/es/icons/icon-align-center.js +1 -1
- package/es/icons/icon-align-left.js +1 -1
- package/es/icons/icon-align-right.js +1 -1
- package/es/icons/icon-arrow-down.js +1 -1
- package/es/icons/icon-arrow-left.js +1 -1
- package/es/icons/icon-arrow-right.js +1 -1
- package/es/icons/icon-arrow-up.js +1 -1
- package/es/icons/icon-browser.js +1 -1
- package/es/icons/icon-chart.js +1 -1
- package/es/icons/icon-check.js +1 -1
- package/es/icons/icon-chevron-down.js +1 -1
- package/es/icons/icon-chevron-horizontal.js +1 -1
- package/es/icons/icon-chevron-left.js +1 -1
- package/es/icons/icon-chevron-right.js +1 -1
- package/es/icons/icon-chevron-up.js +1 -1
- package/es/icons/icon-chevron-vertical.js +1 -1
- package/es/icons/icon-clip.js +1 -1
- package/es/icons/icon-clock.js +1 -1
- package/es/icons/icon-crop.js +1 -1
- package/es/icons/icon-cross.js +1 -1
- package/es/icons/icon-download.js +1 -1
- package/es/icons/icon-duplicate.js +1 -1
- package/es/icons/icon-ellipsis.js +1 -1
- package/es/icons/icon-file.js +1 -1
- package/es/icons/icon-folder-add.js +1 -1
- package/es/icons/icon-folder.js +1 -1
- package/es/icons/icon-gear.js +1 -1
- package/es/icons/icon-globe.js +1 -1
- package/es/icons/icon-heart.js +1 -1
- package/es/icons/icon-image.js +1 -1
- package/es/icons/icon-link.js +1 -1
- package/es/icons/icon-mail.js +1 -1
- package/es/icons/icon-minus.js +1 -1
- package/es/icons/icon-monitor.js +1 -1
- package/es/icons/icon-pencil.js +1 -1
- package/es/icons/icon-phone.js +1 -1
- package/es/icons/icon-plus.js +1 -1
- package/es/icons/icon-redo.js +1 -1
- package/es/icons/icon-search.js +1 -1
- package/es/icons/icon-send.js +1 -1
- package/es/icons/icon-share.js +1 -1
- package/es/icons/icon-smile.js +1 -1
- package/es/icons/icon-switch.js +1 -1
- package/es/icons/icon-tablet.js +1 -1
- package/es/icons/icon-text-align-center.js +1 -1
- package/es/icons/icon-text-align-left.js +1 -1
- package/es/icons/icon-text-align-right.js +1 -1
- package/es/icons/icon-trash.js +1 -1
- package/es/icons/icon-type.js +1 -1
- package/es/icons/icon-undo.js +1 -1
- package/es/icons/icon-upload.js +1 -1
- package/es/icons/index.js +51 -51
- package/es/index.js +3 -3
- package/es/types.js +11 -11
- package/es/utilities/helpers.js +5 -5
- package/es/utilities/index.js +21 -22
- package/es/utilities/responsive.js +13 -14
- package/es/utilities/styles.js +13 -13
- package/es/variables.js +104 -101
- package/package.json +6 -2
package/es/components/arrange.js
CHANGED
|
@@ -17,8 +17,8 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
17
17
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
18
18
|
|
|
19
19
|
import { getGridColumns, getResponsiveSpace } from '../utilities';
|
|
20
|
-
import React from
|
|
21
|
-
import styled from
|
|
20
|
+
import React from 'react';
|
|
21
|
+
import styled from '@emotion/styled';
|
|
22
22
|
import { types } from '../types';
|
|
23
23
|
var Wrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: grid;\n ", ";\n ", ";\n grid-template-columns: ", ";\n justify-items: ", ";\n align-items: ", ";\n justify-content: ", ";\n align-content: ", ";\n place-items: ", ";\n place-content: ", ";\n"])), function (p) {
|
|
24
24
|
return !p.columns && "grid-auto-flow: ".concat(p.autoFlow);
|
package/es/components/box.js
CHANGED
|
@@ -4,12 +4,9 @@ import "core-js/modules/es.object.define-properties.js";
|
|
|
4
4
|
import "core-js/modules/es.object.keys.js";
|
|
5
5
|
import "core-js/modules/es.array.index-of.js";
|
|
6
6
|
import "core-js/modules/es.symbol.js";
|
|
7
|
-
import "core-js/modules/es.object.define-property.js";
|
|
8
7
|
var _excluded = ["children", "color", "backgroundColor", "borderColor", "borderWidth", "borderSide", "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", "overflow", "aspectRatio"];
|
|
9
8
|
|
|
10
|
-
var _templateObject
|
|
11
|
-
|
|
12
|
-
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; }
|
|
9
|
+
var _templateObject;
|
|
13
10
|
|
|
14
11
|
import "core-js/modules/es.object.assign.js";
|
|
15
12
|
|
|
@@ -20,11 +17,11 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
20
17
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
21
18
|
|
|
22
19
|
import { getBorder, getColor, getRadius, getResponsiveSpace, getShadow, getResponsiveDimension } from '../utilities';
|
|
23
|
-
import React from
|
|
24
|
-
import styled from
|
|
20
|
+
import React from 'react';
|
|
21
|
+
import styled from '@emotion/styled';
|
|
25
22
|
import { types } from '../types';
|
|
26
|
-
import
|
|
27
|
-
var Wrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", ";\n
|
|
23
|
+
import PropTypes from 'prop-types';
|
|
24
|
+
var Wrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", ";\n\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n\n ", ";\n ", ";\n ", ";\n ", ";\n\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n\n color: ", ";\n background-color: ", ";\n\n position: ", ";\n border-radius: ", ";\n box-shadow: ", ";\n overflow: ", ";\n aspect-ratio: ", ";\n"])), function (p) {
|
|
28
25
|
return getBorder(p.borderSide, p.borderWidth, p.borderColor);
|
|
29
26
|
}, function (p) {
|
|
30
27
|
return getResponsiveSpace('padding', p.padding);
|
|
@@ -154,7 +151,7 @@ export var Box = function Box(_ref) {
|
|
|
154
151
|
aspectRatio: aspectRatio
|
|
155
152
|
}, props), children);
|
|
156
153
|
};
|
|
157
|
-
Box.propTypes =
|
|
154
|
+
Box.propTypes = {
|
|
158
155
|
color: types.color,
|
|
159
156
|
backgroundColor: types.color,
|
|
160
157
|
borderSide: types.side,
|
|
@@ -165,5 +162,28 @@ Box.propTypes = (_Box$propTypes = {
|
|
|
165
162
|
maxWidth: types.dimension,
|
|
166
163
|
height: types.dimension,
|
|
167
164
|
minHeight: types.dimension,
|
|
168
|
-
maxHeight: types.dimension
|
|
169
|
-
|
|
165
|
+
maxHeight: types.dimension,
|
|
166
|
+
radius: types.radius,
|
|
167
|
+
shadow: types.shadow,
|
|
168
|
+
padding: types.space,
|
|
169
|
+
paddingTop: types.space,
|
|
170
|
+
paddingBottom: types.space,
|
|
171
|
+
paddingLeft: types.space,
|
|
172
|
+
paddingRight: types.space,
|
|
173
|
+
paddingX: types.space,
|
|
174
|
+
paddingY: types.space,
|
|
175
|
+
margin: types.space,
|
|
176
|
+
marginTop: types.space,
|
|
177
|
+
marginBottom: types.space,
|
|
178
|
+
marginLeft: types.space,
|
|
179
|
+
marginRight: types.space,
|
|
180
|
+
marginX: types.space,
|
|
181
|
+
marginY: types.space,
|
|
182
|
+
position: types.position,
|
|
183
|
+
top: types.space,
|
|
184
|
+
bottom: types.space,
|
|
185
|
+
left: types.space,
|
|
186
|
+
right: types.space,
|
|
187
|
+
overflow: types.overflow,
|
|
188
|
+
aspectRatio: PropTypes.string
|
|
189
|
+
};
|
package/es/components/button.js
CHANGED
|
@@ -17,10 +17,10 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
17
17
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
18
18
|
|
|
19
19
|
import { getColor, getRadius, getWeight } from '../utilities';
|
|
20
|
-
import { Icon } from '
|
|
21
|
-
import React from
|
|
22
|
-
import styled from
|
|
23
|
-
import PropTypes from
|
|
20
|
+
import { Icon } from './icon';
|
|
21
|
+
import React from 'react';
|
|
22
|
+
import styled from '@emotion/styled';
|
|
23
|
+
import PropTypes from 'prop-types';
|
|
24
24
|
import { css } from '@emotion/react';
|
|
25
25
|
import { transitions } from '../foundational';
|
|
26
26
|
var variables = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n --grn-paddingX-m: 16px;\n --grn-borderColor: var(--grn-color-fade4);\n --grn-borderColor-hover: var(--grn-color-fade6);\n --grn-borderColor-active: var(--grn-color-grey8);\n"])));
|
|
@@ -28,7 +28,7 @@ var variants = {
|
|
|
28
28
|
neutral: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n color: inherit;\n background-color: transparent;\n border-color: var(--grn-borderColor);\n\n &:hover {\n border-color: var(--grn-borderColor-hover);\n }\n &:active {\n border-color: var(--grn-borderColor-active);\n }\n "]))),
|
|
29
29
|
primary: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n color: white;\n background-color: ", ";\n border-color: transparent;\n\n &:hover {\n background-color: ", ";\n }\n &:active {\n background-color: ", ";\n }\n "])), getColor('accent'), getColor('grey7'), getColor('grey6'))
|
|
30
30
|
};
|
|
31
|
-
var Wrapper = styled.button(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n ", ";\n ", ";\n appearance: none;\n border: none;\n font-family: inherit;\n font-size: inherit;\n cursor: pointer;\n border-width: 1px;\n border-style: solid;\n font-weight: ", ";\n border-radius: ", ";\n height: var(--grn-textBoxHeight-m);\n padding: 0 var(--grn-paddingX-m);\n background-color: transparent;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 12px;\n\n ", ";\n ", ";\n
|
|
31
|
+
var Wrapper = styled.button(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n ", ";\n ", ";\n appearance: none;\n border: none;\n font-family: inherit;\n font-size: inherit;\n cursor: pointer;\n border-width: 1px;\n border-style: solid;\n font-weight: ", ";\n border-radius: ", ";\n height: var(--grn-textBoxHeight-m);\n padding: 0 var(--grn-paddingX-m);\n background-color: transparent;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 12px;\n\n ", ";\n ", ";\n\n &:disabled {\n color: ", ";\n background-color: ", ";\n border-color: transparent;\n cursor: default;\n }\n"])), variables, transitions, getWeight('medium'), getRadius('s'), function (p) {
|
|
32
32
|
return !p.isDisabled && variants[p.variant];
|
|
33
33
|
}, function (p) {
|
|
34
34
|
return p.hasFullWidth && "width: 100%";
|
|
@@ -16,10 +16,10 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
16
16
|
|
|
17
17
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
18
18
|
|
|
19
|
-
import { Icon } from '
|
|
20
|
-
import React from
|
|
21
|
-
import styled from
|
|
22
|
-
import PropTypes from
|
|
19
|
+
import { Icon } from './icon';
|
|
20
|
+
import React from 'react';
|
|
21
|
+
import styled from '@emotion/styled';
|
|
22
|
+
import PropTypes from 'prop-types';
|
|
23
23
|
import { types } from '../types';
|
|
24
24
|
import { ClearButtonBox } from '../foundational';
|
|
25
25
|
var Wrapper = styled(ClearButtonBox)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: var(--grn-clearButtonHeight-m);\n"])));
|
|
@@ -17,16 +17,16 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
17
17
|
|
|
18
18
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
19
19
|
|
|
20
|
-
import { getTransition, getWeight } from
|
|
21
|
-
import { Icon } from
|
|
22
|
-
import React from
|
|
23
|
-
import styled from
|
|
24
|
-
import PropTypes from
|
|
25
|
-
import { css } from
|
|
26
|
-
import { types } from
|
|
20
|
+
import { getTransition, getWeight } from '../utilities';
|
|
21
|
+
import { Icon } from '.';
|
|
22
|
+
import React from 'react';
|
|
23
|
+
import styled from '@emotion/styled';
|
|
24
|
+
import PropTypes from 'prop-types';
|
|
25
|
+
import { css } from '@emotion/react';
|
|
26
|
+
import { types } from '../types';
|
|
27
27
|
var variables = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n --grn-borderColor-hover: var(--grn-color-fade4);\n --grn-borderColor-active: var(--grn-color-grey8);\n --grn-width: calc(var(--grn-textBoxHeight-m) + 2px);\n"])));
|
|
28
28
|
var Wrapper = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n border: 1px solid var(--grn-color-border);\n border-radius: var(--grn-radius-s);\n width: fit-content;\n"])));
|
|
29
|
-
var ItemWrapper = styled.button(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", ";\n appearance: none;\n border: none;\n border-left: 1px solid transparent;\n padding: 0;\n font-family: inherit;\n font-size: inherit;\n font-weight: ", ";\n cursor: pointer;\n min-width: var(--grn-width);\n height: calc(var(--grn-textBoxHeight-m) - 2px);\n background-color: transparent;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n color: var(--grn-color-bodyDimmed);\n transition: color ", ";\n\n ", ";\n
|
|
29
|
+
var ItemWrapper = styled.button(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", ";\n appearance: none;\n border: none;\n border-left: 1px solid transparent;\n padding: 0;\n font-family: inherit;\n font-size: inherit;\n font-weight: ", ";\n cursor: pointer;\n min-width: var(--grn-width);\n height: calc(var(--grn-textBoxHeight-m) - 2px);\n background-color: transparent;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n color: var(--grn-color-bodyDimmed);\n transition: color ", ";\n\n ", ";\n\n & + .IconToggle {\n border-color: var(--grn-color-border);\n }\n\n &:after {\n content: '';\n pointer-events: none;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n transition: ", ";\n ", ";\n }\n\n &:first-of-type {\n min-width: calc(var(--grn-width) - 1px);\n }\n\n &:first-of-type:after {\n width: calc(100% + 1px);\n left: -1px;\n border-radius: var(--grn-radius-s) 0 0 var(--grn-radius-s);\n }\n\n &:last-child:after {\n border-radius: 0 var(--grn-radius-s) var(--grn-radius-s) 0;\n }\n\n &:hover {\n color: var(--grn-color-body);\n }\n"])), variables, getWeight('medium'), getTransition('fast'), function (p) {
|
|
30
30
|
return p.isActive && "\n color: var(--grn-color-body);\n ";
|
|
31
31
|
}, getTransition('xFast'), function (p) {
|
|
32
32
|
return p.isActive && "box-shadow: 0 0 0 1px var(--grn-color-grey6)";
|
package/es/components/icon.js
CHANGED
|
@@ -17,9 +17,9 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
17
17
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
18
18
|
|
|
19
19
|
import { getColor, getIconSize } from '../utilities';
|
|
20
|
-
import
|
|
21
|
-
import React from
|
|
22
|
-
import styled from
|
|
20
|
+
import PropTypes from 'prop-types';
|
|
21
|
+
import React, { forwardRef } from 'react';
|
|
22
|
+
import styled from '@emotion/styled';
|
|
23
23
|
import { types } from '../types';
|
|
24
24
|
var Wrapper = styled.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: block;\n width: ", ";\n color: ", ";\n \n svg {\n display: block;\n height: ", ";\n ", "\n"])), function (p) {
|
|
25
25
|
return getColor(p.color);
|
|
@@ -30,7 +30,7 @@ var Wrapper = styled.span(_templateObject || (_templateObject = _taggedTemplateL
|
|
|
30
30
|
}, function (p) {
|
|
31
31
|
return p.hasEvenBoundary && "width: ".concat(getIconSize(p.size), "}");
|
|
32
32
|
});
|
|
33
|
-
export var Icon = /*#__PURE__*/
|
|
33
|
+
export var Icon = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
34
34
|
var icon = _ref.icon,
|
|
35
35
|
_ref$size = _ref.size,
|
|
36
36
|
size = _ref$size === void 0 ? 'm' : _ref$size,
|
package/es/components/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { Text } from
|
|
2
|
-
export { Box } from
|
|
3
|
-
export { Button } from
|
|
4
|
-
export { TextInput } from
|
|
5
|
-
export { Arrange } from
|
|
6
|
-
export { Icon } from
|
|
7
|
-
export { IconButton } from
|
|
8
|
-
export { TextButton } from
|
|
9
|
-
export { IconToggleGroup, IconToggle } from
|
|
10
|
-
export { TextToggleGroup, TextToggle } from
|
|
11
|
-
export { Stack } from
|
|
1
|
+
export { Text } from './text';
|
|
2
|
+
export { Box } from './box';
|
|
3
|
+
export { Button } from './button';
|
|
4
|
+
export { TextInput } from './text-input';
|
|
5
|
+
export { Arrange } from './arrange';
|
|
6
|
+
export { Icon } from './icon';
|
|
7
|
+
export { IconButton } from './icon-button';
|
|
8
|
+
export { TextButton } from './text-button';
|
|
9
|
+
export { IconToggleGroup, IconToggle } from './icon-toggle';
|
|
10
|
+
export { TextToggleGroup, TextToggle } from './text-toggle';
|
|
11
|
+
export { Stack } from './stack';
|
package/es/components/stack.js
CHANGED
|
@@ -16,10 +16,10 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
16
16
|
|
|
17
17
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
18
18
|
|
|
19
|
-
import {
|
|
20
|
-
import
|
|
21
|
-
import React from
|
|
22
|
-
import styled from
|
|
19
|
+
import { getResponsiveSpace } from '../utilities';
|
|
20
|
+
import PropTypes from 'prop-types';
|
|
21
|
+
import React from 'react';
|
|
22
|
+
import styled from '@emotion/styled';
|
|
23
23
|
import { types } from '../types';
|
|
24
24
|
var Wrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n & > * + * {\n ", ";\n }\n"])), function (p) {
|
|
25
25
|
return getResponsiveSpace('margin-top', p.gap);
|
|
@@ -17,9 +17,9 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
17
17
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
18
18
|
|
|
19
19
|
import { Icon } from '../components';
|
|
20
|
-
import React from
|
|
21
|
-
import styled from
|
|
22
|
-
import PropTypes from
|
|
20
|
+
import React from 'react';
|
|
21
|
+
import styled from '@emotion/styled';
|
|
22
|
+
import PropTypes from 'prop-types';
|
|
23
23
|
import { ClearButtonBox } from '../foundational';
|
|
24
24
|
var Wrapper = styled(ClearButtonBox)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: 0 8px;\n gap: 8px;\n"])));
|
|
25
25
|
export var TextButton = function TextButton(_ref) {
|
|
@@ -37,9 +37,9 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
37
37
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
38
38
|
|
|
39
39
|
import { getColor, getRadius, getTextSize } from '../utilities';
|
|
40
|
-
import
|
|
41
|
-
import React from
|
|
42
|
-
import styled from
|
|
40
|
+
import PropTypes from 'prop-types';
|
|
41
|
+
import React from 'react';
|
|
42
|
+
import styled from '@emotion/styled';
|
|
43
43
|
import { types } from '../types';
|
|
44
44
|
import { css } from '@emotion/react';
|
|
45
45
|
import { Box } from './box';
|
|
@@ -68,7 +68,7 @@ var Wrapper = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplate
|
|
|
68
68
|
var Label = styled.label(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: block;\n margin-bottom: ", ";\n"])), function (p) {
|
|
69
69
|
return sizesStyles[p.size].labelGap;
|
|
70
70
|
});
|
|
71
|
-
var InputField = styled.input(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n ", ";\n appearance: none;\n border: none;\n font-family: inherit;\n background-color: transparent;\n color: inherit;\n font-size: inherit;\n transition-property: border-color
|
|
71
|
+
var InputField = styled.input(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n ", ";\n appearance: none;\n border: none;\n font-family: inherit;\n background-color: transparent;\n color: inherit;\n font-size: inherit;\n transition-property: border-color;\n border: 1px solid var(--grn-color-fieldBorder);\n width: 100%;\n border-radius: ", ";\n height: ", ";\n padding: ", ";\n ", ";\n outline: none;\n\n &::placeholder {\n color: ", ";\n }\n\n &:hover {\n border-color: var(--grn-color-fieldBorder-hover);\n }\n\n &:focus {\n transition: 0s;\n border-color: var(--grn-color-grey6);\n }\n"])), transitions, function (p) {
|
|
72
72
|
return getRadius('s');
|
|
73
73
|
}, function (p) {
|
|
74
74
|
return sizesStyles[p.size].height;
|
|
@@ -77,7 +77,7 @@ var InputField = styled.input(_templateObject4 || (_templateObject4 = _taggedTem
|
|
|
77
77
|
}, function (p) {
|
|
78
78
|
return p.paddingLeft && "padding-left: ".concat(p.paddingLeft, "px");
|
|
79
79
|
}, getColor('grey5'));
|
|
80
|
-
var IconSection = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n position: absolute;\n margin: auto;\n left: ", "px;\n top: 0
|
|
80
|
+
var IconSection = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n position: absolute;\n margin: auto;\n left: ", "px;\n top: 0;\n bottom: 0;\n height: fit-content;\n pointer-events: none;\n"])), function (p) {
|
|
81
81
|
return sizesStyles[p.size].iconOffsetPx;
|
|
82
82
|
});
|
|
83
83
|
export var TextInput = function TextInput(_ref) {
|
|
@@ -17,12 +17,12 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
17
17
|
|
|
18
18
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
19
19
|
|
|
20
|
-
import { getWeight, getTransition } from
|
|
21
|
-
import React from
|
|
22
|
-
import styled from
|
|
23
|
-
import PropTypes from
|
|
20
|
+
import { getWeight, getTransition } from '../utilities';
|
|
21
|
+
import React from 'react';
|
|
22
|
+
import styled from '@emotion/styled';
|
|
23
|
+
import PropTypes from 'prop-types';
|
|
24
24
|
var Wrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n border: 1px solid var(--grn-color-border);\n border-radius: 1000px;\n width: fit-content;\n"])));
|
|
25
|
-
var ItemWrapper = styled.button(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n appearance: none;\n border: none;\n padding: 0 16px;\n font-family: inherit;\n font-size: inherit;\n font-weight: ", ";\n cursor: pointer;\n height: calc(var(--grn-textBoxHeight-m) - 2px);\n background-color: transparent;\n position: relative;\n color: var(--grn-color-bodyDimmed);\n border-radius: 1000px;\n white-space: nowrap;\n transition: color ", ", box-shadow ", ";\n
|
|
25
|
+
var ItemWrapper = styled.button(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n appearance: none;\n border: none;\n padding: 0 16px;\n font-family: inherit;\n font-size: inherit;\n font-weight: ", ";\n cursor: pointer;\n height: calc(var(--grn-textBoxHeight-m) - 2px);\n background-color: transparent;\n position: relative;\n color: var(--grn-color-bodyDimmed);\n border-radius: 1000px;\n white-space: nowrap;\n transition: color ", ", box-shadow ", ";\n\n &:hover {\n color: var(--grn-color-body);\n }\n\n ", ";\n"])), getWeight('medium'), getTransition('fast'), getTransition('xFast'), function (p) {
|
|
26
26
|
return p.isActive && "\n box-shadow: 0 0 0 1px var(--grn-color-grey6);\n color: var(--grn-color-body);\n ";
|
|
27
27
|
});
|
|
28
28
|
export var TextToggle = function TextToggle(_ref) {
|
package/es/components/text.js
CHANGED
|
@@ -17,11 +17,11 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
17
17
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
18
18
|
|
|
19
19
|
import { getColor, getResponsiveTextSize, getWeight } from '../utilities';
|
|
20
|
-
import
|
|
21
|
-
import React from
|
|
22
|
-
import styled from
|
|
20
|
+
import PropTypes from 'prop-types';
|
|
21
|
+
import React from 'react';
|
|
22
|
+
import styled from '@emotion/styled';
|
|
23
23
|
import { types } from '../types';
|
|
24
|
-
var Wrapper = styled.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: block;\n ", ";\n font-weight: ", ";\n color: ", ";\n text-align: ", ";\n
|
|
24
|
+
var Wrapper = styled.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: block;\n ", ";\n font-weight: ", ";\n color: ", ";\n text-align: ", ";\n\n ", ";\n ", ";\n ", ";\n"])), function (p) {
|
|
25
25
|
return getResponsiveTextSize(p.size);
|
|
26
26
|
}, function (p) {
|
|
27
27
|
return getWeight(p.weight);
|
package/es/foundational/index.js
CHANGED
|
@@ -6,8 +6,8 @@ var _templateObject, _templateObject2;
|
|
|
6
6
|
|
|
7
7
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
8
8
|
|
|
9
|
-
import styled from
|
|
9
|
+
import styled from '@emotion/styled';
|
|
10
10
|
import { css } from '@emotion/react';
|
|
11
|
-
import { getColor, getRadius, getTransition, getWeight } from
|
|
12
|
-
export var transitions = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n transition: ", ";\n
|
|
13
|
-
export var ClearButtonBox = styled.button(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", ";\n --grn-borderColor-active: var(--grn-color-fade5);\n
|
|
11
|
+
import { getColor, getRadius, getTransition, getWeight } from '../utilities';
|
|
12
|
+
export var transitions = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n transition: ", ";\n\n &:hover {\n transition: ", ";\n }\n\n &:active {\n transition: 0s;\n }\n"])), getTransition('slow'), getTransition('fast'));
|
|
13
|
+
export var ClearButtonBox = styled.button(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", ";\n --grn-borderColor-active: var(--grn-color-fade5);\n\n appearance: none;\n border: 1px solid transparent;\n padding: 0;\n font-family: inherit;\n font-size: inherit;\n cursor: pointer;\n font-weight: ", ";\n border-radius: ", ";\n height: var(--grn-clearButtonHeight-m);\n background-color: transparent;\n display: flex;\n align-items: center;\n justify-content: center;\n\n &:hover {\n background-color: var(--grn-color-overlay);\n }\n\n &:active {\n border-color: var(--grn-borderColor-active);\n outline-color: var(--grn-borderColor-active);\n background-color: transparent;\n }\n\n &:disabled {\n color: ", ";\n cursor: default;\n border-color: transparent;\n\n &:hover {\n background-color: transparent;\n }\n }\n"])), transitions, getWeight('medium'), getRadius('s'), getColor('disabledContent'));
|
package/es/hooks/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { useMedia } from
|
|
1
|
+
export { useMedia } from './useMedia';
|
package/es/hooks/useMedia.js
CHANGED
|
@@ -32,7 +32,7 @@ export function useMedia(queries, values, defaultValue) {
|
|
|
32
32
|
var index = mediaQueryLists.findIndex(function (mql) {
|
|
33
33
|
return mql.matches;
|
|
34
34
|
});
|
|
35
|
-
return typeof values[index] !==
|
|
35
|
+
return typeof values[index] !== 'undefined' ? values[index] : defaultValue;
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
var _useState = useState(getValue),
|
package/es/icons/icon-browser.js
CHANGED
package/es/icons/icon-chart.js
CHANGED
package/es/icons/icon-check.js
CHANGED
package/es/icons/icon-clip.js
CHANGED
package/es/icons/icon-clock.js
CHANGED
package/es/icons/icon-crop.js
CHANGED
package/es/icons/icon-cross.js
CHANGED
package/es/icons/icon-file.js
CHANGED
package/es/icons/icon-folder.js
CHANGED
package/es/icons/icon-gear.js
CHANGED
package/es/icons/icon-globe.js
CHANGED
package/es/icons/icon-heart.js
CHANGED
package/es/icons/icon-image.js
CHANGED
package/es/icons/icon-link.js
CHANGED