@flodesk/grain 10.17.2 → 10.17.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 +34 -74
- package/es/components/autocomplete.js +28 -132
- package/es/components/badge.js +8 -7
- package/es/components/box.js +14 -85
- package/es/components/button.js +26 -8
- package/es/components/checkbox.js +18 -12
- package/es/components/dropdown.js +28 -81
- package/es/components/flex.js +36 -72
- package/es/components/index.js +1 -5
- package/es/components/link.js +16 -27
- package/es/components/modal.js +68 -89
- package/es/components/nav.js +19 -9
- package/es/components/pagination.js +4 -4
- package/es/components/popover.js +11 -29
- package/es/components/select.js +10 -12
- package/es/components/slider.js +17 -6
- package/es/components/spinner.js +14 -4
- package/es/components/stack.js +4 -5
- package/es/components/switch.js +17 -5
- package/es/components/tab.js +1 -1
- package/es/components/text-button.js +12 -13
- package/es/components/text.js +28 -84
- package/es/components/textarea.js +20 -34
- package/es/components/toast.js +52 -16
- package/es/components/tooltip.js +4 -4
- package/es/foundational/field.js +28 -52
- package/es/foundational/menu.js +60 -138
- package/es/foundational/styles.js +11 -11
- package/es/hooks/index.js +1 -2
- package/es/hooks/useOnClickOutside.js +6 -7
- package/es/icons/index.js +1 -18
- package/es/index.js +1 -2
- package/es/styles/base.css +53 -0
- package/es/styles/colors/core.css +74 -0
- package/es/styles/colors/experimental.css +3 -0
- package/es/styles/colors/theme.css +92 -0
- package/es/styles/shadows.css +60 -0
- package/es/styles/variables.css +66 -0
- package/es/types.js +7 -18
- package/es/utilities/helpers.js +1 -13
- package/es/utilities/index.js +1 -3
- package/es/utilities/responsive.js +0 -3
- package/es/utilities/styles.js +2 -14
- package/es/variables/colors.js +1 -2
- package/es/variables/index.js +1 -2
- package/es/variables/vars.js +0 -3
- package/package.json +1 -1
- package/es/components/autocomplete2.js +0 -359
- package/es/components/box2.js +0 -223
- package/es/components/provider.js +0 -14
- package/es/components/text2/index.js +0 -100
- package/es/components/text2/styles.module.css +0 -22
- package/es/hooks/usePrev.js +0 -8
- package/es/icons/icon-archive.js +0 -21
- package/es/icons/icon-at.js +0 -21
- package/es/icons/icon-bold.js +0 -28
- package/es/icons/icon-bullet-list.js +0 -21
- package/es/icons/icon-column-and-rows.js +0 -21
- package/es/icons/icon-columns-and-row.js +0 -21
- package/es/icons/icon-columns.js +0 -21
- package/es/icons/icon-folder-move.js +0 -21
- package/es/icons/icon-folder-remove.js +0 -21
- package/es/icons/icon-italic.js +0 -28
- package/es/icons/icon-number-list.js +0 -21
- package/es/icons/icon-row-and-columns.js +0 -21
- package/es/icons/icon-rows-and-column.js +0 -21
- package/es/icons/icon-rows.js +0 -21
- package/es/icons/icon-strike.js +0 -28
- package/es/icons/icon-text-justify.js +0 -21
- package/es/icons/icon-underline.js +0 -28
- package/es/styles/base.js +0 -2
- package/es/styles/colors/core.js +0 -2
- package/es/styles/colors/experimental.js +0 -2
- package/es/styles/colors/index.js +0 -4
- package/es/styles/colors/theme.js +0 -2
- package/es/styles/index.js +0 -6
- package/es/styles/shadows.js +0 -2
- package/es/styles/utilities.js +0 -108
- package/es/styles/variables.js +0 -2
- package/es/utilities/attributes.js +0 -66
- package/es/utilities/style-config.js +0 -442
- package/es/variables/breakpoints.js +0 -9
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import "core-js/modules/es.object.assign.js";
|
|
2
|
-
|
|
3
|
-
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); }
|
|
4
|
-
|
|
5
|
-
import * as React from 'react';
|
|
6
|
-
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
7
|
-
|
|
8
|
-
var LayoutRowsAndColumn = function LayoutRowsAndColumn(props) {
|
|
9
|
-
return ___EmotionJSX("svg", _extends({
|
|
10
|
-
viewBox: "0 0 24 24",
|
|
11
|
-
fill: "none",
|
|
12
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
13
|
-
}, props), ___EmotionJSX("path", {
|
|
14
|
-
fillRule: "evenodd",
|
|
15
|
-
clipRule: "evenodd",
|
|
16
|
-
d: "M0 2a2 2 0 012-2h20a2 2 0 012 2v20a2 2 0 01-2 2H2a2 2 0 01-2-2V2zm22 0h-9v20h9V2zM2 2h9v9H2V2zm0 11v9h9v-9H2z",
|
|
17
|
-
fill: "currentColor"
|
|
18
|
-
}));
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export default LayoutRowsAndColumn;
|
package/es/icons/icon-rows.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import "core-js/modules/es.object.assign.js";
|
|
2
|
-
|
|
3
|
-
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); }
|
|
4
|
-
|
|
5
|
-
import * as React from 'react';
|
|
6
|
-
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
7
|
-
|
|
8
|
-
var LayoutRows = function LayoutRows(props) {
|
|
9
|
-
return ___EmotionJSX("svg", _extends({
|
|
10
|
-
viewBox: "0 0 24 24",
|
|
11
|
-
fill: "none",
|
|
12
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
13
|
-
}, props), ___EmotionJSX("path", {
|
|
14
|
-
fillRule: "evenodd",
|
|
15
|
-
clipRule: "evenodd",
|
|
16
|
-
d: "M2 0a2 2 0 00-2 2v20a2 2 0 002 2h20a2 2 0 002-2V2a2 2 0 00-2-2H2zm0 2h20v9H2V2zm0 11v9h20v-9H2z",
|
|
17
|
-
fill: "currentColor"
|
|
18
|
-
}));
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export default LayoutRows;
|
package/es/icons/icon-strike.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import "core-js/modules/es.object.assign.js";
|
|
2
|
-
|
|
3
|
-
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); }
|
|
4
|
-
|
|
5
|
-
import * as React from 'react';
|
|
6
|
-
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
7
|
-
|
|
8
|
-
var IconStrike = function IconStrike(props) {
|
|
9
|
-
return ___EmotionJSX("svg", _extends({
|
|
10
|
-
viewBox: "0 0 24 24",
|
|
11
|
-
fill: "none",
|
|
12
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
13
|
-
}, props), ___EmotionJSX("g", {
|
|
14
|
-
clipPath: "url(#prefix__clip0_1288_730)"
|
|
15
|
-
}, ___EmotionJSX("path", {
|
|
16
|
-
fillRule: "evenodd",
|
|
17
|
-
clipRule: "evenodd",
|
|
18
|
-
d: "M11.727.004c5.499-.149 7.8 3.742 8.25 5.804l-1.954.426c-.304-1.394-1.956-4.347-6.241-4.23C9.86 2.056 7.978 2.52 6.759 4c-.474.577-.772 1.446-.766 2.352.005.9.308 1.73.895 2.295.753.724 1.979 1.77 5.2 2.352H24v2H0v-2h6.583a9.682 9.682 0 01-1.081-.91c-1.056-1.017-1.5-2.407-1.51-3.724-.008-1.31.412-2.65 1.223-3.636C6.985.58 9.597.062 11.727.004zm.538 23.992c-5.498.15-7.8-3.742-8.25-5.803l1.955-.427c.304 1.394 1.956 4.347 6.241 4.23 1.921-.051 3.804-.516 5.022-1.997.475-.576.773-1.446.767-2.352-.006-.9-.308-1.73-.896-2.295A9.348 9.348 0 0016.72 15h2.61c.46.82.664 1.744.67 2.634.008 1.31-.412 2.651-1.223 3.636-1.77 2.15-4.382 2.668-6.512 2.726z",
|
|
19
|
-
fill: "currentColor"
|
|
20
|
-
})), ___EmotionJSX("defs", null, ___EmotionJSX("clipPath", {
|
|
21
|
-
id: "prefix__clip0_1288_730"
|
|
22
|
-
}, ___EmotionJSX("path", {
|
|
23
|
-
fill: "#fff",
|
|
24
|
-
d: "M0 0h24v24H0z"
|
|
25
|
-
}))));
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export default IconStrike;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import "core-js/modules/es.object.assign.js";
|
|
2
|
-
|
|
3
|
-
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); }
|
|
4
|
-
|
|
5
|
-
import * as React from 'react';
|
|
6
|
-
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
7
|
-
|
|
8
|
-
var IconTextJustify = function IconTextJustify(props) {
|
|
9
|
-
return ___EmotionJSX("svg", _extends({
|
|
10
|
-
viewBox: "0 0 24 24",
|
|
11
|
-
fill: "none",
|
|
12
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
13
|
-
}, props), ___EmotionJSX("path", {
|
|
14
|
-
fillRule: "evenodd",
|
|
15
|
-
clipRule: "evenodd",
|
|
16
|
-
d: "M0 5h24v2H0V5zm0 6h24v2H0v-2zm24 6H0v2h24v-2z",
|
|
17
|
-
fill: "currentColor"
|
|
18
|
-
}));
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export default IconTextJustify;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import "core-js/modules/es.object.assign.js";
|
|
2
|
-
|
|
3
|
-
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); }
|
|
4
|
-
|
|
5
|
-
import * as React from 'react';
|
|
6
|
-
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
7
|
-
|
|
8
|
-
var IconUnderline = function IconUnderline(props) {
|
|
9
|
-
return ___EmotionJSX("svg", _extends({
|
|
10
|
-
viewBox: "0 0 20 24",
|
|
11
|
-
fill: "none",
|
|
12
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
13
|
-
}, props), ___EmotionJSX("g", {
|
|
14
|
-
clipPath: "url(#prefix__clip0_1288_698)"
|
|
15
|
-
}, ___EmotionJSX("path", {
|
|
16
|
-
fillRule: "evenodd",
|
|
17
|
-
clipRule: "evenodd",
|
|
18
|
-
d: "M16 8.066V0h2v8.066c0 2.31-.405 4.764-1.623 6.671-1.262 1.976-3.334 3.266-6.377 3.266-3.043 0-5.115-1.29-6.377-3.266C2.405 12.83 2 10.376 2 8.066V0h2v8.066c0 2.13.383 4.145 1.31 5.595.882 1.383 2.31 2.342 4.69 2.342 2.38 0 3.808-.959 4.69-2.342.927-1.45 1.31-3.465 1.31-5.595zM20 22v2H0v-2h20z",
|
|
19
|
-
fill: "currentColor"
|
|
20
|
-
})), ___EmotionJSX("defs", null, ___EmotionJSX("clipPath", {
|
|
21
|
-
id: "prefix__clip0_1288_698"
|
|
22
|
-
}, ___EmotionJSX("path", {
|
|
23
|
-
fill: "#fff",
|
|
24
|
-
d: "M0 0h20v24H0z"
|
|
25
|
-
}))));
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export default IconUnderline;
|
package/es/styles/base.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var base = "\n :root {\n --grn-lineHeight-fixed: 7px;\n --grn-lineHeight-relative: 0.9em;\n --grn-lineHeight-global: calc(var(--grn-lineHeight-fixed) + var(--grn-lineHeight-relative));\n\n --grn-font-global: 'Flodesk Sans', sans-serif;\n --grn-radius-button: var(--grn-radius-s);\n }\n\n .grn-context,\n .grn-context * {\n line-height: var(--grn-lineHeight-global);\n outline-color: var(--grn-color-selection);\n }\n\n .grn-context {\n font-family: var(--grn-font-global);\n font-size: var(--grn-text-m);\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n\n [data-theme],\n .grn-context {\n color: var(--grn-color-content);\n }\n\n *,\n *:before,\n *:after {\n box-sizing: border-box;\n }\n\n .grn-link-context a {\n transition: var(--grn-transition-slow);\n text-underline-position: under;\n text-underline-offset: calc(2px - 0.1em);\n color: inherit;\n cursor: pointer;\n text-decoration-color: var(--grn-color-fade3);\n }\n\n .grn-link-context a:hover {\n transition: var(--grn-transition-fast);\n text-decoration-color: currentColor;\n }\n\n .grn-link-context a:active {\n transition: var(--grn-transition-xxFast);\n }\n";
|
|
2
|
-
export default base;
|
package/es/styles/colors/core.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var core = "\n :root {\n --white: hsl(0 0% 100%);\n --H: 13.85;\n --S: 7%;\n --HS: var(--H) var(--S);\n --bfS: 20%;\n --wfS: calc(100% - var(--bfS));\n }\n\n :root {\n --redHS: 6 55%;\n --redL: 52%;\n\n --grn-color-blue: hsl(218 74% 54%);\n --grn-color-red: hsl(var(--redHS) var(--redL));\n --grn-color-yellow: hsl(44 99% 59%);\n --grn-color-green: hsl(153 22% 57%);\n }\n\n :root {\n --shadeS-13: 20%;\n --shadeS-12: 22%;\n --shadeS-11: 15%;\n --shadeS-10: 12%;\n --shadeS-9: 9%;\n --shadeS-8: 7%;\n --shadeS-7: 5%;\n --shadeS-6: 6%;\n --shadeS-5: 7%;\n --shadeS-4: 7%;\n --shadeS-3: 7%;\n --shadeS-2: 6%;\n --shadeS-1: 6%;\n }\n\n :root {\n --shade13-s: var(--shadeS-13);\n --shade12-s: var(--shadeS-12);\n --shade11-s: var(--shadeS-11);\n --shade10-s: var(--shadeS-10);\n --shade9-s: var(--shadeS-9);\n --shade8-s: var(--shadeS-8);\n --shade7-s: var(--shadeS-7);\n --shade6-s: var(--shadeS-6);\n --shade5-s: var(--shadeS-5);\n --shade4-s: var(--shadeS-4);\n --shade3-s: var(--shadeS-3);\n --shade2-s: var(--shadeS-2);\n --shade1-s: var(--shadeS-1);\n }\n\n [data-theme='dark'], [data-theme='invert'] {\n --shade13-s: var(--shadeS-1);\n --shade12-s: var(--shadeS-2);\n --shade11-s: var(--shadeS-3);\n --shade10-s: var(--shadeS-4);\n --shade9-s: var(--shadeS-5);\n --shade8-s: var(--shadeS-6);\n --shade7-s: var(--shadeS-7);\n --shade6-s: var(--shadeS-8);\n --shade5-s: var(--shadeS-9);\n --shade4-s: var(--shadeS-10);\n --shade3-s: var(--shadeS-11);\n --shade2-s: var(--shadeS-12);\n --shade1-s: var(--shadeS-13);\n }\n\n :root,\n [data-experimental] {\n --grn-color-shadeTone13: hsl(var(--H) var(--shade13-s) 10%);\n --grn-color-shadeTone12: hsl(var(--H) var(--shade12-s) 11.5%);\n --grn-color-shadeTone11: hsl(var(--H) var(--shade11-s) 15%);\n --grn-color-shadeTone10: hsl(var(--H) var(--shade10-s) 21%);\n --grn-color-shadeTone9: hsl(var(--H) var(--shade9-s) 28%);\n --grn-color-shadeTone8: hsl(var(--H) var(--shade8-s) 38%);\n --grn-color-shadeTone7: hsl(var(--H) var(--shade7-s) 51%);\n --grn-color-shadeTone6: hsl(var(--H) var(--shade6-s) 70%);\n --grn-color-shadeTone5: hsl(var(--H) var(--shade5-s) 82%);\n --grn-color-shadeTone4: hsl(var(--H) var(--shade4-s) 90%);\n --grn-color-shadeTone3: hsl(var(--H) var(--shade3-s) 95%);\n --grn-color-shadeTone2: hsl(var(--H) var(--shade2-s) 97.5%);\n --grn-color-shadeTone1: hsl(var(--H) var(--shade1-s) 100%);\n\n --fade10-a: 73%;\n --fade9-a: 66%;\n --fade8-a: 59%;\n --fade7-a: 52%;\n --fade6-a: 45%;\n --fade5-a: 38%;\n --fade4-a: 31%;\n --fade3-a: 24%;\n --fade2-a: 17%;\n --fade1-a: 10%;\n\n --fade-s: 20%;\n\n --grn-color-lightFade10: hsl(var(--H) var(--fade-s) var(--wfS) / var(--fade10-a));\n --grn-color-lightFade9: hsl(var(--H) var(--fade-s) var(--wfS) / var(--fade9-a));\n --grn-color-lightFade8: hsl(var(--H) var(--fade-s) var(--wfS) / var(--fade8-a));\n --grn-color-lightFade7: hsl(var(--H) var(--fade-s) var(--wfS) / var(--fade7-a));\n --grn-color-lightFade6: hsl(var(--H) var(--fade-s) var(--wfS) / var(--fade6-a));\n --grn-color-lightFade5: hsl(var(--H) var(--fade-s) var(--wfS) / var(--fade5-a));\n --grn-color-lightFade4: hsl(var(--H) var(--fade-s) var(--wfS) / var(--fade4-a));\n --grn-color-lightFade3: hsl(var(--H) var(--fade-s) var(--wfS) / var(--fade3-a));\n --grn-color-lightFade2: hsl(var(--H) var(--fade-s) var(--wfS) / var(--fade2-a));\n --grn-color-lightFade1: hsl(var(--H) var(--fade-s) var(--wfS) / var(--fade1-a));\n\n --grn-color-darkFade10: hsl(var(--H) var(--fade-s) var(--bfS) / var(--fade10-a));\n --grn-color-darkFade9: hsl(var(--H) var(--fade-s) var(--bfS) / var(--fade9-a));\n --grn-color-darkFade8: hsl(var(--H) var(--fade-s) var(--bfS) / var(--fade8-a));\n --grn-color-darkFade7: hsl(var(--H) var(--fade-s) var(--bfS) / var(--fade7-a));\n --grn-color-darkFade6: hsl(var(--H) var(--fade-s) var(--bfS) / var(--fade6-a));\n --grn-color-darkFade5: hsl(var(--H) var(--fade-s) var(--bfS) / var(--fade5-a));\n --grn-color-darkFade4: hsl(var(--H) var(--fade-s) var(--bfS) / var(--fade4-a));\n --grn-color-darkFade3: hsl(var(--H) var(--fade-s) var(--bfS) / var(--fade3-a));\n --grn-color-darkFade2: hsl(var(--H) var(--fade-s) var(--bfS) / var(--fade2-a));\n --grn-color-darkFade1: hsl(var(--H) var(--fade-s) var(--bfS) / var(--fade1-a));\n }\n\n :root {\n --grn-color-warning: var(--grn-color-yellow);\n --grn-color-danger: var(--grn-color-red);\n --grn-color-success: var(--grn-color-green);\n --grn-color-selection: var(--grn-color-blue);\n }\n";
|
|
2
|
-
export default core;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var theme = "\n /* light */\n\n :root,\n [data-theme='light'],\n [data-theme='dark'] [data-theme='invert'] {\n --grn-color-fade10: var(--grn-color-darkFade10);\n --grn-color-fade9: var(--grn-color-darkFade9);\n --grn-color-fade8: var(--grn-color-darkFade8);\n --grn-color-fade7: var(--grn-color-darkFade7);\n --grn-color-fade6: var(--grn-color-darkFade6);\n --grn-color-fade5: var(--grn-color-darkFade5);\n --grn-color-fade4: var(--grn-color-darkFade4);\n --grn-color-fade3: var(--grn-color-darkFade3);\n --grn-color-fade2: var(--grn-color-darkFade2);\n --grn-color-fade1: var(--grn-color-darkFade1);\n\n --grn-color-shade1: var(--grn-color-shadeTone1);\n --grn-color-shade2: var(--grn-color-shadeTone2);\n --grn-color-shade3: var(--grn-color-shadeTone3);\n --grn-color-shade4: var(--grn-color-shadeTone4);\n --grn-color-shade5: var(--grn-color-shadeTone5);\n --grn-color-shade6: var(--grn-color-shadeTone6);\n --grn-color-shade7: var(--grn-color-shadeTone7);\n --grn-color-shade8: var(--grn-color-shadeTone8);\n --grn-color-shade9: var(--grn-color-shadeTone9);\n --grn-color-shade10: var(--grn-color-shadeTone10);\n --grn-color-shade11: var(--grn-color-shadeTone11);\n --grn-color-shade12: var(--grn-color-shadeTone12);\n --grn-color-shade13: var(--grn-color-shadeTone13);\n }\n\n /* dark */\n\n [data-theme='dark'],\n [data-theme='light'] [data-theme='invert'] {\n --grn-color-fade10: var(--grn-color-lightFade10);\n --grn-color-fade9: var(--grn-color-lightFade9);\n --grn-color-fade8: var(--grn-color-lightFade8);\n --grn-color-fade7: var(--grn-color-lightFade7);\n --grn-color-fade6: var(--grn-color-lightFade6);\n --grn-color-fade5: var(--grn-color-lightFade5);\n --grn-color-fade4: var(--grn-color-lightFade4);\n --grn-color-fade3: var(--grn-color-lightFade3);\n --grn-color-fade2: var(--grn-color-lightFade2);\n --grn-color-fade1: var(--grn-color-lightFade1);\n\n --grn-color-shade1: var(--grn-color-shadeTone13);\n --grn-color-shade2: var(--grn-color-shadeTone12);\n --grn-color-shade3: var(--grn-color-shadeTone11);\n --grn-color-shade4: var(--grn-color-shadeTone10);\n --grn-color-shade5: var(--grn-color-shadeTone9);\n --grn-color-shade6: var(--grn-color-shadeTone8);\n --grn-color-shade7: var(--grn-color-shadeTone7);\n --grn-color-shade8: var(--grn-color-shadeTone6);\n --grn-color-shade9: var(--grn-color-shadeTone5);\n --grn-color-shade10: var(--grn-color-shadeTone4);\n --grn-color-shade11: var(--grn-color-shadeTone3);\n --grn-color-shade12: var(--grn-color-shadeTone2);\n --grn-color-shade13: var(--grn-color-shadeTone1);\n }\n\n /* light */\n\n :root,\n [data-theme='light'],\n [data-theme='dark'] [data-theme='invert'] {\n --contentL: 20%;\n --backgroundL: 80%;\n --grn-color-floatingBackground: var(--grn-color-shade1);\n --grn-color-floatingBackground: var(--grn-color-shade1);\n }\n\n /* dark */\n\n [data-theme='dark'],\n [data-theme='light'] [data-theme='invert'] {\n --contentL: 80%;\n --backgroundL: 20%;\n --grn-color-floatingBackground: var(--grn-color-shade2);\n --grn-color-floatingBackground: var(--grn-color-shade2);\n }\n\n /* light + dark */\n\n :root,\n [data-theme] {\n --grn-color-content: var(--grn-color-shade12);\n --grn-color-content2: var(--grn-color-fade7);\n --grn-color-content3: var(--grn-color-fade5);\n --grn-color-disabledContent: var(--grn-color-shade7);\n --grn-color-icon: var(--grn-color-fade7);\n --grn-color-disabledIcon: var(--grn-color-fade4);\n\n --grn-color-background: var(--grn-color-shade1);\n --grn-color-background2: var(--grn-color-shade2);\n --grn-color-background3: var(--grn-color-shade3);\n --grn-color-disabledBackground: var(--grn-color-shade4);\n\n --grn-color-border: hsl(var(--HS) var(--contentL) / 12%);\n --grn-color-border2: hsl(var(--HS) var(--contentL) / 20%);\n }\n";
|
|
2
|
-
export default theme;
|
package/es/styles/index.js
DELETED
package/es/styles/shadows.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var shadows = "\n :root,\n [data-theme='light'],\n [data-theme='dark'] [data-theme='invert'] {\n --alphaRatio: 0.6;\n }\n\n [data-theme='dark'],\n [data-theme='light'] [data-theme='invert'] {\n --alphaRatio: 0.8;\n }\n\n :root,\n [data-theme] {\n --c: 0 0% 0%;\n --blurRatio: 1.7;\n --yRatio: 1.1;\n --spreadRatio: 2;\n --ratioCurve: 0.9;\n\n --rc1: var(--ratioCurve) * 1;\n --rc2: var(--ratioCurve) * 2;\n --rc3: var(--ratioCurve) * 3;\n --rc4: var(--ratioCurve) * 4;\n\n --b1: 1px;\n --b2: calc(var(--b1) * var(--rc2) * var(--blurRatio));\n --b3: calc(var(--b2) * var(--rc3) * var(--blurRatio));\n --b4: calc(var(--b3) * var(--rc4) * var(--blurRatio));\n\n --y1: 1px;\n --y2: calc(var(--y1) * var(--rc2) * var(--yRatio));\n --y3: calc(var(--y2) * var(--rc3) * var(--yRatio));\n --y4: calc(var(--y3) * var(--rc4) * var(--yRatio));\n\n --a1: 5%;\n --a2: calc(var(--a1) * var(--rc2) * var(--alphaRatio));\n --a3: calc(var(--a2) * var(--rc3) * var(--alphaRatio));\n --a4: calc(var(--a3) * var(--rc4) * var(--alphaRatio));\n\n --s1: -0.1px;\n --s2: calc(var(--s1) * var(--rc2) * var(--spreadRatio));\n --s3: calc(var(--s2) * var(--rc3) * var(--spreadRatio));\n --s4: calc(var(--s3) * var(--rc4) * var(--spreadRatio));\n\n --shadow1: 0 var(--y1) var(--b1) var(--s1) hsl(var(--c) / var(--a1));\n --shadow2: 0 var(--y2) var(--b2) var(--s2) hsl(var(--c) / var(--a2));\n --shadow3: 0 var(--y3) var(--b3) var(--s3) hsl(var(--c) / var(--a3));\n --shadow4: 0 var(--y4) var(--b4) var(--s4) hsl(var(--c) / var(--a4));\n\n --grn-shadow-s: var(--shadow1), var(--shadow2);\n\n --grn-shadow-m: var(--grn-shadow-s), var(--shadow3);\n\n --grn-shadow-l: var(--grn-shadow-m), var(--shadow4);\n }\n";
|
|
2
|
-
export default shadows;
|
package/es/styles/utilities.js
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
|
|
3
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
-
|
|
5
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
-
|
|
7
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
8
|
-
|
|
9
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
10
|
-
|
|
11
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
-
|
|
13
|
-
import "core-js/modules/es.object.to-string.js";
|
|
14
|
-
import "core-js/modules/web.dom-collections.for-each.js";
|
|
15
|
-
import "core-js/modules/es.array.includes.js";
|
|
16
|
-
import "core-js/modules/es.string.includes.js";
|
|
17
|
-
import "core-js/modules/es.array.concat.js";
|
|
18
|
-
import "core-js/modules/es.object.entries.js";
|
|
19
|
-
import "core-js/modules/es.symbol.js";
|
|
20
|
-
import "core-js/modules/es.symbol.description.js";
|
|
21
|
-
import "core-js/modules/es.symbol.iterator.js";
|
|
22
|
-
import "core-js/modules/es.array.iterator.js";
|
|
23
|
-
import "core-js/modules/es.string.iterator.js";
|
|
24
|
-
import "core-js/modules/web.dom-collections.iterator.js";
|
|
25
|
-
import "core-js/modules/es.array.slice.js";
|
|
26
|
-
import "core-js/modules/es.array.from.js";
|
|
27
|
-
import "core-js/modules/es.regexp.exec.js";
|
|
28
|
-
import { styleConfig } from '../utilities';
|
|
29
|
-
import { propNameToShort } from '../utilities/style-config';
|
|
30
|
-
import { breakpoints, deviceShort } from '../variables';
|
|
31
|
-
|
|
32
|
-
var generateUtilityClassDeclarations = function generateUtilityClassDeclarations(propertySets) {
|
|
33
|
-
var css = '';
|
|
34
|
-
propertySets.forEach(function (set) {
|
|
35
|
-
set.variables.forEach(function (variable) {
|
|
36
|
-
set.props.forEach(function (prop) {
|
|
37
|
-
var property = prop.property;
|
|
38
|
-
var cssValue = set.valueTransformer ? set.valueTransformer(variable) : variable;
|
|
39
|
-
var hasHover = prop.propName.includes('Hover');
|
|
40
|
-
var selector = ".".concat(propNameToShort(prop.propName), "-").concat(variable);
|
|
41
|
-
var declaration = "{".concat(property, ": ").concat(cssValue, "}");
|
|
42
|
-
if (!hasHover) css += "".concat(selector, " ").concat(declaration);
|
|
43
|
-
if (hasHover) css += "".concat(selector, ":hover ").concat(declaration);
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
return css;
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
var generateStyleClassDeclarations = function generateStyleClassDeclarations(propertySets) {
|
|
51
|
-
var css = '';
|
|
52
|
-
propertySets.forEach(function (set) {
|
|
53
|
-
set.props.forEach(function (prop) {
|
|
54
|
-
var property = prop.property;
|
|
55
|
-
var propName = prop.propName;
|
|
56
|
-
var cssVar = "--".concat(propNameToShort(propName));
|
|
57
|
-
var hasHover = prop.propName.includes('Hover');
|
|
58
|
-
var declaration = "{".concat(property, ": var(").concat(cssVar, ")}");
|
|
59
|
-
if (!hasHover) css += "[style*=\"".concat(cssVar, ":\"] ").concat(declaration);
|
|
60
|
-
if (hasHover) css += "[style*=\"".concat(cssVar, ":\"]:hover ").concat(declaration);
|
|
61
|
-
|
|
62
|
-
if (set.isResponsive) {
|
|
63
|
-
var device = deviceShort.default;
|
|
64
|
-
css += "\n [style*=\"".concat(cssVar, "-").concat(device, "\"] {").concat(property, ": var(").concat(cssVar, "-").concat(device, ")}\n ");
|
|
65
|
-
Object.entries(breakpoints).forEach(function (_ref) {
|
|
66
|
-
var _ref2 = _slicedToArray(_ref, 2),
|
|
67
|
-
deviceName = _ref2[0],
|
|
68
|
-
screenSize = _ref2[1];
|
|
69
|
-
|
|
70
|
-
var device = deviceShort[deviceName];
|
|
71
|
-
css += "\n @media (max-width: ".concat(screenSize, "px) {\n [style*=\"").concat(cssVar, "-").concat(device, "\"] {").concat(property, ": var(").concat(cssVar, "-").concat(device, ")}\n }\n ");
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
return css;
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
var spaceProps = styleConfig.spaceProps,
|
|
80
|
-
colorProps = styleConfig.colorProps,
|
|
81
|
-
shadowProps = styleConfig.shadowProps,
|
|
82
|
-
radiusProps = styleConfig.radiusProps,
|
|
83
|
-
positionProps = styleConfig.positionProps,
|
|
84
|
-
overflowProps = styleConfig.overflowProps,
|
|
85
|
-
transitionProps = styleConfig.transitionProps,
|
|
86
|
-
cursorProps = styleConfig.cursorProps,
|
|
87
|
-
dimensionProps = styleConfig.dimensionProps,
|
|
88
|
-
aspectRatioProps = styleConfig.aspectRatioProps,
|
|
89
|
-
orderProps = styleConfig.orderProps,
|
|
90
|
-
flexProps = styleConfig.flexProps,
|
|
91
|
-
sizeProps = styleConfig.sizeProps,
|
|
92
|
-
opacityProps = styleConfig.opacityProps,
|
|
93
|
-
alignSelfProps = styleConfig.alignSelfProps,
|
|
94
|
-
borderColorProps = styleConfig.borderColorProps,
|
|
95
|
-
borderWidthProps = styleConfig.borderWidthProps,
|
|
96
|
-
borderSideProps = styleConfig.borderSideProps,
|
|
97
|
-
alignProps = styleConfig.alignProps,
|
|
98
|
-
weightProps = styleConfig.weightProps,
|
|
99
|
-
textDisplayProps = styleConfig.textDisplayProps,
|
|
100
|
-
zIndexProps = styleConfig.zIndexProps,
|
|
101
|
-
letterSpacingProps = styleConfig.letterSpacingProps,
|
|
102
|
-
textTransformProps = styleConfig.textTransformProps;
|
|
103
|
-
var classAndStyleDeclarationProps = [spaceProps, colorProps, shadowProps, radiusProps, transitionProps, sizeProps, borderColorProps, alignProps];
|
|
104
|
-
var classDeclarationProps = [].concat(classAndStyleDeclarationProps, [positionProps, overflowProps, cursorProps, sizeProps, alignSelfProps, borderWidthProps, weightProps, textDisplayProps, borderSideProps, textTransformProps]);
|
|
105
|
-
var styleDeclarationProps = [].concat(classAndStyleDeclarationProps, [dimensionProps, aspectRatioProps, orderProps, flexProps, opacityProps, zIndexProps, letterSpacingProps]);
|
|
106
|
-
var defaultBorder = "\n [class*=\"bd\"] {\n border-color: var(--grn-color-border);\n border-width: 1px;\n }\n";
|
|
107
|
-
var utilities = "\n ".concat(defaultBorder, "\n ").concat(generateUtilityClassDeclarations(classDeclarationProps), ";\n ").concat(generateStyleClassDeclarations(styleDeclarationProps), ";\n");
|
|
108
|
-
export default utilities;
|
package/es/styles/variables.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var variables = "\n :root {\n --grn-unit: 8px;\n }\n\n :root {\n --grn-text-s: 12px;\n --grn-text-m: 14px;\n --grn-text-l: 18px;\n --grn-text-xl: 24px;\n --grn-text-xxl: 30px;\n }\n\n /* text size \u2715 ~1.2 */\n :root {\n --grn-icon-s: 14px;\n --grn-icon-m: 18px;\n --grn-icon-l: 22px;\n --grn-icon-xl: 28px;\n --grn-icon-xxl: 36px;\n }\n\n :root {\n --grn-weight-normal: 400;\n --grn-weight-medium: 500;\n }\n\n :root {\n --grn-space-xs: calc(var(--grn-unit) / 2);\n --grn-space-s: calc(var(--grn-unit) * 1);\n --grn-space-s2: calc(var(--grn-unit) * 1.5);\n --grn-space-m: calc(var(--grn-unit) * 2);\n --grn-space-l: calc(var(--grn-unit) * 3);\n --grn-space-l2: calc(var(--grn-unit) * 4);\n --grn-space-xl: calc(var(--grn-unit) * 5);\n --grn-space-xl2: calc(var(--grn-unit) * 6);\n --grn-space-xxl: calc(var(--grn-unit) * 7);\n }\n\n :root {\n --grn-radius-s: 3px;\n --grn-radius-m: 6px;\n --grn-radius-l: 10px;\n }\n\n :root {\n --grn-transition-slow: 400ms;\n --grn-transition-fast: 200ms;\n --grn-transition-xFast: 160ms;\n --grn-transition-xxFast: 80ms;\n }\n\n :root,\n [data-theme] {\n --grn-space-betweenFormTitleAndContent: var(--grn-space-l);\n --grn-space-betweenFormContents: var(--grn-space-m);\n --grn-space-betweenFormContentAndActions: var(--grn-space-xl);\n --grn-space-betweenFormControlAndLabel: var(--grn-space-s);\n --grn-space-fieldPaddingX: 12px;\n\n --grn-color-fieldBorder: var(--grn-color-fade3);\n --grn-color-fieldBorderHover: var(--grn-color-fade6);\n --grn-color-fieldBorderFocus: var(--grn-color-shade9);\n --grn-color-fieldBorderDisabled: var(--grn-color-shade5);\n --grn-color-fieldBackgroundDisabled: var(--grn-color-shade2);\n --grn-color-backdrop: hsl(var(--H) 15% 10% / 0.6);\n\n --grn-transition-leave: var(--grn-transition-slow);\n --grn-transition-hover: var(--grn-transition-fast);\n --grn-transition-active: var(--grn-transition-xxFast);\n }\n";
|
|
2
|
-
export default variables;
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import "core-js/modules/es.object.values.js";
|
|
2
|
-
import "core-js/modules/es.object.to-string.js";
|
|
3
|
-
import "core-js/modules/web.dom-collections.for-each.js";
|
|
4
|
-
import "core-js/modules/es.array.concat.js";
|
|
5
|
-
import "core-js/modules/es.object.keys.js";
|
|
6
|
-
import { breakpoints, deviceShort } from '../variables';
|
|
7
|
-
import { isObject } from './helpers';
|
|
8
|
-
import { propNameToShort, styleConfig } from './style-config';
|
|
9
|
-
var mediaQueries = {
|
|
10
|
-
tablet: "@media (max-width: ".concat(breakpoints.tablet, "px)"),
|
|
11
|
-
mobile: "@media (max-width: ".concat(breakpoints.mobile, "px)")
|
|
12
|
-
};
|
|
13
|
-
export var generateStyleAttributes = function generateStyleAttributes(props) {
|
|
14
|
-
var styles = {};
|
|
15
|
-
var styleConfigValues = Object.values(styleConfig);
|
|
16
|
-
styleConfigValues.forEach(function (propsSet) {
|
|
17
|
-
propsSet.props.forEach(function (_ref) {
|
|
18
|
-
var propName = _ref.propName;
|
|
19
|
-
var value = props[propName];
|
|
20
|
-
var hasVariable = propsSet.variableChecker ? propsSet.variableChecker(value) : false;
|
|
21
|
-
var hasTransformer = propsSet.valueTransformer ? true : false;
|
|
22
|
-
if (hasVariable) return;
|
|
23
|
-
if (value === null || value === undefined || value === '') return;
|
|
24
|
-
var cssValue = hasTransformer ? propsSet.valueTransformer(value) : value;
|
|
25
|
-
var propNameShort = propNameToShort(propName);
|
|
26
|
-
|
|
27
|
-
if (!isObject(value)) {
|
|
28
|
-
styles["--".concat(propNameShort)] = cssValue;
|
|
29
|
-
} else {
|
|
30
|
-
var def = value.default,
|
|
31
|
-
mobile = value.mobile,
|
|
32
|
-
tablet = value.tablet; // accept fixed string media queries to help migration
|
|
33
|
-
|
|
34
|
-
var mobileMediaValue = value[mediaQueries.mobile];
|
|
35
|
-
var tabletMediaValue = value[mediaQueries.tablet];
|
|
36
|
-
var mob = mobileMediaValue || mobile;
|
|
37
|
-
var tab = tabletMediaValue || tablet;
|
|
38
|
-
styles["--".concat(propNameShort, "-").concat(deviceShort.default)] = hasTransformer ? propsSet.valueTransformer(def) : def;
|
|
39
|
-
styles["--".concat(propNameShort, "-").concat(deviceShort.mobile)] = hasTransformer ? propsSet.valueTransformer(mob) : mob;
|
|
40
|
-
styles["--".concat(propNameShort, "-").concat(deviceShort.tablet)] = hasTransformer ? propsSet.valueTransformer(tab) : tab;
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
return styles;
|
|
45
|
-
};
|
|
46
|
-
export var generateClassNameAttributes = function generateClassNameAttributes(props) {
|
|
47
|
-
var classNames = [];
|
|
48
|
-
var propKeys = Object.keys(props);
|
|
49
|
-
var styleConfigValues = Object.values(styleConfig);
|
|
50
|
-
propKeys.forEach(function (prop) {
|
|
51
|
-
styleConfigValues.forEach(function (styleConfigItem) {
|
|
52
|
-
styleConfigItem.props.forEach(function (propItem) {
|
|
53
|
-
if (propItem.propName === prop) {
|
|
54
|
-
var propName = propItem.propName;
|
|
55
|
-
var value = props[propName];
|
|
56
|
-
var hasVariable = styleConfigItem.variableChecker ? styleConfigItem.variableChecker(value) : false;
|
|
57
|
-
if (!hasVariable) return;
|
|
58
|
-
if (value === null || value === undefined || value === '') return;
|
|
59
|
-
var className = "".concat(propNameToShort(propName), "-").concat(value);
|
|
60
|
-
classNames.push(className);
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
return classNames.join(' ');
|
|
66
|
-
};
|