@flodesk/grain 2.20.3 → 2.22.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.
Files changed (75) hide show
  1. package/es/components/arrange.js +22 -22
  2. package/es/components/box.js +31 -11
  3. package/es/components/button.js +5 -5
  4. package/es/components/icon-button.js +4 -4
  5. package/es/components/icon-toggle.js +8 -8
  6. package/es/components/icon.js +4 -4
  7. package/es/components/index.js +11 -11
  8. package/es/components/stack.js +4 -4
  9. package/es/components/text-button.js +3 -3
  10. package/es/components/text-input.js +5 -5
  11. package/es/components/text-toggle.js +5 -5
  12. package/es/components/text.js +4 -4
  13. package/es/foundational/index.js +4 -4
  14. package/es/hooks/index.js +1 -1
  15. package/es/hooks/useMedia.js +1 -1
  16. package/es/icons/icon-align-center.js +1 -1
  17. package/es/icons/icon-align-left.js +1 -1
  18. package/es/icons/icon-align-right.js +1 -1
  19. package/es/icons/icon-arrow-down.js +1 -1
  20. package/es/icons/icon-arrow-left.js +1 -1
  21. package/es/icons/icon-arrow-right.js +1 -1
  22. package/es/icons/icon-arrow-up.js +1 -1
  23. package/es/icons/icon-browser.js +1 -1
  24. package/es/icons/icon-chart.js +1 -1
  25. package/es/icons/icon-check.js +1 -1
  26. package/es/icons/icon-chevron-down.js +1 -1
  27. package/es/icons/icon-chevron-horizontal.js +1 -1
  28. package/es/icons/icon-chevron-left.js +1 -1
  29. package/es/icons/icon-chevron-right.js +1 -1
  30. package/es/icons/icon-chevron-up.js +1 -1
  31. package/es/icons/icon-chevron-vertical.js +1 -1
  32. package/es/icons/icon-clip.js +1 -1
  33. package/es/icons/icon-clock.js +1 -1
  34. package/es/icons/icon-crop.js +1 -1
  35. package/es/icons/icon-cross.js +1 -1
  36. package/es/icons/icon-download.js +1 -1
  37. package/es/icons/icon-duplicate.js +1 -1
  38. package/es/icons/icon-ellipsis.js +1 -1
  39. package/es/icons/icon-file.js +1 -1
  40. package/es/icons/icon-folder-add.js +1 -1
  41. package/es/icons/icon-folder.js +1 -1
  42. package/es/icons/icon-gear.js +1 -1
  43. package/es/icons/icon-globe.js +1 -1
  44. package/es/icons/icon-heart.js +1 -1
  45. package/es/icons/icon-image.js +1 -1
  46. package/es/icons/icon-link.js +1 -1
  47. package/es/icons/icon-mail.js +1 -1
  48. package/es/icons/icon-minus.js +1 -1
  49. package/es/icons/icon-monitor.js +1 -1
  50. package/es/icons/icon-pencil.js +1 -1
  51. package/es/icons/icon-phone.js +1 -1
  52. package/es/icons/icon-plus.js +1 -1
  53. package/es/icons/icon-redo.js +1 -1
  54. package/es/icons/icon-search.js +1 -1
  55. package/es/icons/icon-send.js +1 -1
  56. package/es/icons/icon-share.js +1 -1
  57. package/es/icons/icon-smile.js +1 -1
  58. package/es/icons/icon-switch.js +1 -1
  59. package/es/icons/icon-tablet.js +1 -1
  60. package/es/icons/icon-text-align-center.js +1 -1
  61. package/es/icons/icon-text-align-left.js +1 -1
  62. package/es/icons/icon-text-align-right.js +1 -1
  63. package/es/icons/icon-trash.js +1 -1
  64. package/es/icons/icon-type.js +1 -1
  65. package/es/icons/icon-undo.js +1 -1
  66. package/es/icons/icon-upload.js +1 -1
  67. package/es/icons/index.js +51 -51
  68. package/es/index.js +3 -3
  69. package/es/types.js +13 -10
  70. package/es/utilities/helpers.js +5 -5
  71. package/es/utilities/index.js +21 -21
  72. package/es/utilities/responsive.js +10 -10
  73. package/es/utilities/styles.js +5 -5
  74. package/es/variables.js +65 -65
  75. package/package.json +6 -2
@@ -4,7 +4,7 @@ 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
- var _excluded = ["children", "gap", "columns", "autoFlow", "justifyItems", "alignItems", "justifyContent", "alignContent", "placeItems", "placeContent"];
7
+ var _excluded = ["children", "gap", "alignItems", "justifyItems", "justifyContent", "alignContent", "columns", "autoFlow", "width", "height"];
8
8
 
9
9
  var _templateObject;
10
10
 
@@ -16,11 +16,11 @@ 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 { getGridColumns, getResponsiveSpace } from '../utilities';
20
- import React from "react";
21
- import styled from "@emotion/styled";
19
+ import { getGridColumns, getResponsiveDimension, getResponsiveSpace } from '../utilities';
20
+ import React from 'react';
21
+ import styled from '@emotion/styled';
22
22
  import { types } from '../types';
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) {
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 ", ";\n ", ";\n"])), function (p) {
24
24
  return !p.columns && "grid-auto-flow: ".concat(p.autoFlow);
25
25
  }, function (p) {
26
26
  return getResponsiveSpace('gap', p.gap);
@@ -35,46 +35,46 @@ var Wrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLi
35
35
  }, function (p) {
36
36
  return p.alignContent;
37
37
  }, function (p) {
38
- return p.placeItems;
38
+ return getResponsiveDimension('width', p.width);
39
39
  }, function (p) {
40
- return p.placeContent;
40
+ return getResponsiveDimension('height', p.height);
41
41
  });
42
42
  export var Arrange = function Arrange(_ref) {
43
43
  var children = _ref.children,
44
44
  gap = _ref.gap,
45
- columns = _ref.columns,
46
- _ref$autoFlow = _ref.autoFlow,
47
- autoFlow = _ref$autoFlow === void 0 ? 'column' : _ref$autoFlow,
48
- justifyItems = _ref.justifyItems,
49
45
  _ref$alignItems = _ref.alignItems,
50
46
  alignItems = _ref$alignItems === void 0 ? 'center' : _ref$alignItems,
47
+ justifyItems = _ref.justifyItems,
51
48
  _ref$justifyContent = _ref.justifyContent,
52
49
  justifyContent = _ref$justifyContent === void 0 ? 'start' : _ref$justifyContent,
53
50
  alignContent = _ref.alignContent,
54
- placeItems = _ref.placeItems,
55
- placeContent = _ref.placeContent,
51
+ columns = _ref.columns,
52
+ _ref$autoFlow = _ref.autoFlow,
53
+ autoFlow = _ref$autoFlow === void 0 ? 'column' : _ref$autoFlow,
54
+ width = _ref.width,
55
+ height = _ref.height,
56
56
  props = _objectWithoutProperties(_ref, _excluded);
57
57
 
58
58
  return /*#__PURE__*/React.createElement(Wrapper, Object.assign({
59
59
  gap: gap,
60
60
  columns: columns,
61
61
  autoFlow: autoFlow,
62
- justifyItems: justifyItems,
63
62
  alignItems: alignItems,
63
+ justifyItems: justifyItems,
64
64
  justifyContent: justifyContent,
65
65
  alignContent: alignContent,
66
- placeItems: placeItems,
67
- placeContent: placeContent
66
+ width: width,
67
+ height: height
68
68
  }, props), children);
69
69
  };
70
70
  Arrange.propTypes = {
71
71
  gap: types.space,
72
72
  columns: types.columns,
73
73
  autoFlow: types.autoFlow,
74
- justifyItems: types.gridItemsAlignments,
75
- alignItems: types.gridItemsAlignments,
76
- justifyContent: types.gridContentPositions,
77
- alignContent: types.gridContentPositions,
78
- placeItems: types.gridItemsAlignments,
79
- placeContent: types.gridContentPositions
74
+ alignItems: types.gridItemsAlignment,
75
+ justifyItems: types.gridItemsAlignment,
76
+ justifyContent: types.gridContentPosition,
77
+ alignContent: types.gridContentPosition,
78
+ width: types.dimension,
79
+ height: types.dimension
80
80
  };
@@ -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, _Box$propTypes;
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 "react";
24
- import styled from "@emotion/styled";
20
+ import React from 'react';
21
+ import styled from '@emotion/styled';
25
22
  import { types } from '../types';
26
- import { PropTypes } from 'prop-types';
27
- 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) {
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 = (_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
- }, _defineProperty(_Box$propTypes, "height", types.dimension), _defineProperty(_Box$propTypes, "radius", types.radius), _defineProperty(_Box$propTypes, "shadow", types.shadow), _defineProperty(_Box$propTypes, "padding", types.space), _defineProperty(_Box$propTypes, "paddingTop", types.space), _defineProperty(_Box$propTypes, "paddingBottom", types.space), _defineProperty(_Box$propTypes, "paddingLeft", types.space), _defineProperty(_Box$propTypes, "paddingRight", types.space), _defineProperty(_Box$propTypes, "paddingX", types.space), _defineProperty(_Box$propTypes, "paddingY", types.space), _defineProperty(_Box$propTypes, "margin", types.space), _defineProperty(_Box$propTypes, "marginTop", types.space), _defineProperty(_Box$propTypes, "marginBottom", types.space), _defineProperty(_Box$propTypes, "marginLeft", types.space), _defineProperty(_Box$propTypes, "marginRight", types.space), _defineProperty(_Box$propTypes, "marginX", types.space), _defineProperty(_Box$propTypes, "marginY", types.space), _defineProperty(_Box$propTypes, "position", types.position), _defineProperty(_Box$propTypes, "top", types.space), _defineProperty(_Box$propTypes, "bottom", types.space), _defineProperty(_Box$propTypes, "left", types.space), _defineProperty(_Box$propTypes, "right", types.space), _defineProperty(_Box$propTypes, "overflow", types.overflow), _defineProperty(_Box$propTypes, "aspectRatio", PropTypes.string), _Box$propTypes);
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
+ };
@@ -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 '../components';
21
- import React from "react";
22
- import styled from "@emotion/styled";
23
- import PropTypes from "prop-types";
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 \n &:disabled {\n color: ", ";\n background-color: ", ";\n border-color: transparent;\n cursor: default;\n }\n"])), variables, transitions, getWeight('medium'), getRadius('s'), function (p) {
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 '../components';
20
- import React from "react";
21
- import styled from "@emotion/styled";
22
- import PropTypes from "prop-types";
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 "../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";
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 \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) {
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)";
@@ -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 { PropTypes } from 'prop-types';
21
- import React from "react";
22
- import styled from "@emotion/styled";
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__*/React.forwardRef(function (_ref, ref) {
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,
@@ -1,11 +1,11 @@
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";
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';
@@ -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 { getColor, getIconSize, getResponsiveSpace } from '../utilities';
20
- import { PropTypes } from 'prop-types';
21
- import React from "react";
22
- import styled from "@emotion/styled";
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 "react";
21
- import styled from "@emotion/styled";
22
- import PropTypes from "prop-types";
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 { PropTypes } from 'prop-types';
41
- import React from "react";
42
- import styled from "@emotion/styled";
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; \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) {
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; \n bottom: 0;\n height: fit-content;\n pointer-events: none;\n"])), function (p) {
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 "../utilities";
21
- import React from "react";
22
- import styled from "@emotion/styled";
23
- import PropTypes from "prop-types";
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 \n &:hover {\n color: var(--grn-color-body);\n }\n \n ", ";\n"])), getWeight("medium"), getTransition('fast'), getTransition('xFast'), function (p) {
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) {
@@ -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 { PropTypes } from 'prop-types';
21
- import React from "react";
22
- import styled from "@emotion/styled";
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 \n ", ";\n ", ";\n ", ";\n"])), function (p) {
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);
@@ -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 "@emotion/styled";
9
+ import styled from '@emotion/styled';
10
10
  import { css } from '@emotion/react';
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'));
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 "./useMedia";
1
+ export { useMedia } from './useMedia';
@@ -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] !== "undefined" ? values[index] : defaultValue;
35
+ return typeof values[index] !== 'undefined' ? values[index] : defaultValue;
36
36
  };
37
37
 
38
38
  var _useState = useState(getValue),
@@ -1,5 +1,5 @@
1
1
  import "core-js/modules/es.object.assign.js";
2
- import * as React from "react";
2
+ import * as React from 'react';
3
3
 
4
4
  var IconAlignCenter = function IconAlignCenter(props) {
5
5
  return /*#__PURE__*/React.createElement("svg", Object.assign({
@@ -1,5 +1,5 @@
1
1
  import "core-js/modules/es.object.assign.js";
2
- import * as React from "react";
2
+ import * as React from 'react';
3
3
 
4
4
  var IconAlignLeft = function IconAlignLeft(props) {
5
5
  return /*#__PURE__*/React.createElement("svg", Object.assign({
@@ -1,5 +1,5 @@
1
1
  import "core-js/modules/es.object.assign.js";
2
- import * as React from "react";
2
+ import * as React from 'react';
3
3
 
4
4
  var IconAlignRight = function IconAlignRight(props) {
5
5
  return /*#__PURE__*/React.createElement("svg", Object.assign({
@@ -1,5 +1,5 @@
1
1
  import "core-js/modules/es.object.assign.js";
2
- import * as React from "react";
2
+ import * as React from 'react';
3
3
 
4
4
  var IconArrowDown = function IconArrowDown(props) {
5
5
  return /*#__PURE__*/React.createElement("svg", Object.assign({
@@ -1,5 +1,5 @@
1
1
  import "core-js/modules/es.object.assign.js";
2
- import * as React from "react";
2
+ import * as React from 'react';
3
3
 
4
4
  var IconArrowLeft = function IconArrowLeft(props) {
5
5
  return /*#__PURE__*/React.createElement("svg", Object.assign({
@@ -1,5 +1,5 @@
1
1
  import "core-js/modules/es.object.assign.js";
2
- import * as React from "react";
2
+ import * as React from 'react';
3
3
 
4
4
  var IconArrowRight = function IconArrowRight(props) {
5
5
  return /*#__PURE__*/React.createElement("svg", Object.assign({
@@ -1,5 +1,5 @@
1
1
  import "core-js/modules/es.object.assign.js";
2
- import * as React from "react";
2
+ import * as React from 'react';
3
3
 
4
4
  var IconArrowUp = function IconArrowUp(props) {
5
5
  return /*#__PURE__*/React.createElement("svg", Object.assign({
@@ -1,5 +1,5 @@
1
1
  import "core-js/modules/es.object.assign.js";
2
- import * as React from "react";
2
+ import * as React from 'react';
3
3
 
4
4
  var IconBrowser = function IconBrowser(props) {
5
5
  return /*#__PURE__*/React.createElement("svg", Object.assign({
@@ -1,5 +1,5 @@
1
1
  import "core-js/modules/es.object.assign.js";
2
- import * as React from "react";
2
+ import * as React from 'react';
3
3
 
4
4
  var IconChart = function IconChart(props) {
5
5
  return /*#__PURE__*/React.createElement("svg", Object.assign({
@@ -1,5 +1,5 @@
1
1
  import "core-js/modules/es.object.assign.js";
2
- import * as React from "react";
2
+ import * as React from 'react';
3
3
 
4
4
  var IconCheck = function IconCheck(props) {
5
5
  return /*#__PURE__*/React.createElement("svg", Object.assign({
@@ -1,5 +1,5 @@
1
1
  import "core-js/modules/es.object.assign.js";
2
- import * as React from "react";
2
+ import * as React from 'react';
3
3
 
4
4
  var IconChevronDown = function IconChevronDown(props) {
5
5
  return /*#__PURE__*/React.createElement("svg", Object.assign({
@@ -1,5 +1,5 @@
1
1
  import "core-js/modules/es.object.assign.js";
2
- import * as React from "react";
2
+ import * as React from 'react';
3
3
 
4
4
  var IconChevronHorizontal = function IconChevronHorizontal(props) {
5
5
  return /*#__PURE__*/React.createElement("svg", Object.assign({
@@ -1,5 +1,5 @@
1
1
  import "core-js/modules/es.object.assign.js";
2
- import * as React from "react";
2
+ import * as React from 'react';
3
3
 
4
4
  var IconChevronLeft = function IconChevronLeft(props) {
5
5
  return /*#__PURE__*/React.createElement("svg", Object.assign({
@@ -1,5 +1,5 @@
1
1
  import "core-js/modules/es.object.assign.js";
2
- import * as React from "react";
2
+ import * as React from 'react';
3
3
 
4
4
  var IconChevronRight = function IconChevronRight(props) {
5
5
  return /*#__PURE__*/React.createElement("svg", Object.assign({
@@ -1,5 +1,5 @@
1
1
  import "core-js/modules/es.object.assign.js";
2
- import * as React from "react";
2
+ import * as React from 'react';
3
3
 
4
4
  var IconChevronUp = function IconChevronUp(props) {
5
5
  return /*#__PURE__*/React.createElement("svg", Object.assign({
@@ -1,5 +1,5 @@
1
1
  import "core-js/modules/es.object.assign.js";
2
- import * as React from "react";
2
+ import * as React from 'react';
3
3
 
4
4
  var IconChevronVertical = function IconChevronVertical(props) {
5
5
  return /*#__PURE__*/React.createElement("svg", Object.assign({
@@ -1,5 +1,5 @@
1
1
  import "core-js/modules/es.object.assign.js";
2
- import * as React from "react";
2
+ import * as React from 'react';
3
3
 
4
4
  var IconClip = function IconClip(props) {
5
5
  return /*#__PURE__*/React.createElement("svg", Object.assign({
@@ -1,5 +1,5 @@
1
1
  import "core-js/modules/es.object.assign.js";
2
- import * as React from "react";
2
+ import * as React from 'react';
3
3
 
4
4
  var IconClock = function IconClock(props) {
5
5
  return /*#__PURE__*/React.createElement("svg", Object.assign({
@@ -1,5 +1,5 @@
1
1
  import "core-js/modules/es.object.assign.js";
2
- import * as React from "react";
2
+ import * as React from 'react';
3
3
 
4
4
  var IconCrop = function IconCrop(props) {
5
5
  return /*#__PURE__*/React.createElement("svg", Object.assign({
@@ -1,5 +1,5 @@
1
1
  import "core-js/modules/es.object.assign.js";
2
- import * as React from "react";
2
+ import * as React from 'react';
3
3
 
4
4
  var IconCross = function IconCross(props) {
5
5
  return /*#__PURE__*/React.createElement("svg", Object.assign({
@@ -1,5 +1,5 @@
1
1
  import "core-js/modules/es.object.assign.js";
2
- import * as React from "react";
2
+ import * as React from 'react';
3
3
 
4
4
  var IconDownload = function IconDownload(props) {
5
5
  return /*#__PURE__*/React.createElement("svg", Object.assign({
@@ -1,5 +1,5 @@
1
1
  import "core-js/modules/es.object.assign.js";
2
- import * as React from "react";
2
+ import * as React from 'react';
3
3
 
4
4
  var IconDuplicate = function IconDuplicate(props) {
5
5
  return /*#__PURE__*/React.createElement("svg", Object.assign({