@flodesk/grain 11.64.0 → 11.65.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/arrange/index.js +24 -32
- package/es/components/autocomplete.js +24 -42
- package/es/components/autocomplete2.js +59 -85
- package/es/components/badge.js +10 -17
- package/es/components/box.js +64 -72
- package/es/components/button.js +16 -25
- package/es/components/card.js +16 -21
- package/es/components/checkbox.js +16 -26
- package/es/components/dropdown.js +1 -9
- package/es/components/flex/index.js +22 -30
- package/es/components/ghost-input.js +12 -24
- package/es/components/icon-button.js +14 -22
- package/es/components/icon-toggle.js +13 -23
- package/es/components/icon.js +9 -16
- package/es/components/link.js +8 -15
- package/es/components/modal.js +50 -68
- package/es/components/nav/index.js +29 -41
- package/es/components/pagination.js +15 -34
- package/es/components/popover.js +18 -25
- package/es/components/progress.js +9 -19
- package/es/components/radio.js +16 -26
- package/es/components/select.js +30 -59
- package/es/components/slider.js +13 -24
- package/es/components/spinner.js +8 -17
- package/es/components/stack.js +7 -14
- package/es/components/switch.js +11 -19
- package/es/components/tab.js +14 -23
- package/es/components/text/index.js +28 -38
- package/es/components/text-button.js +14 -23
- package/es/components/text-input.js +30 -43
- package/es/components/text-toggle.js +14 -23
- package/es/components/textarea.js +18 -30
- package/es/components/toast.js +1 -9
- package/es/components/tooltip.js +22 -37
- package/es/foundational/field.js +27 -38
- package/es/foundational/menu.js +33 -47
- package/es/hooks/useKeyPress.js +0 -5
- package/es/hooks/useMedia.js +0 -2
- package/es/hooks/useOnClickOutside.js +0 -1
- package/es/hooks/useWindowSize.js +0 -1
- package/es/icons/icon-align-center.js +1 -4
- package/es/icons/icon-align-left.js +1 -4
- package/es/icons/icon-align-right.js +1 -4
- package/es/icons/icon-apple.js +1 -4
- package/es/icons/icon-archive.js +1 -4
- package/es/icons/icon-arrow-down.js +1 -4
- package/es/icons/icon-arrow-left.js +1 -4
- package/es/icons/icon-arrow-right.js +1 -4
- package/es/icons/icon-arrow-up.js +1 -4
- package/es/icons/icon-at.js +1 -4
- package/es/icons/icon-bag.js +1 -4
- package/es/icons/icon-ball.js +1 -4
- package/es/icons/icon-bold.js +1 -4
- package/es/icons/icon-bolt-filled.js +1 -4
- package/es/icons/icon-bolt.js +1 -4
- package/es/icons/icon-branching.js +1 -4
- package/es/icons/icon-browser.js +1 -4
- package/es/icons/icon-bullet-list.js +1 -4
- package/es/icons/icon-car.js +1 -4
- package/es/icons/icon-chart.js +1 -4
- package/es/icons/icon-check.js +1 -4
- package/es/icons/icon-chevron-down.js +1 -4
- package/es/icons/icon-chevron-horizontal.js +1 -4
- package/es/icons/icon-chevron-left.js +1 -4
- package/es/icons/icon-chevron-right.js +1 -4
- package/es/icons/icon-chevron-up.js +1 -4
- package/es/icons/icon-chevron-vertical.js +1 -4
- package/es/icons/icon-clip.js +1 -4
- package/es/icons/icon-clock.js +1 -4
- package/es/icons/icon-column-and-rows.js +1 -4
- package/es/icons/icon-column-one.js +1 -4
- package/es/icons/icon-column-two.js +1 -4
- package/es/icons/icon-columns-and-row.js +1 -4
- package/es/icons/icon-columns.js +1 -4
- package/es/icons/icon-content-align-bottom.js +1 -4
- package/es/icons/icon-content-align-center.js +1 -4
- package/es/icons/icon-content-align-top.js +1 -4
- package/es/icons/icon-crop.js +1 -4
- package/es/icons/icon-cross.js +1 -4
- package/es/icons/icon-dog.js +1 -4
- package/es/icons/icon-download.js +1 -4
- package/es/icons/icon-drag.js +1 -4
- package/es/icons/icon-duplicate.js +1 -4
- package/es/icons/icon-ellipsis.js +1 -4
- package/es/icons/icon-exit.js +1 -4
- package/es/icons/icon-file.js +1 -4
- package/es/icons/icon-flag.js +1 -4
- package/es/icons/icon-folder-add.js +1 -4
- package/es/icons/icon-folder-move.js +1 -4
- package/es/icons/icon-folder-remove.js +1 -4
- package/es/icons/icon-folder.js +1 -4
- package/es/icons/icon-footer.js +1 -4
- package/es/icons/icon-gallery.js +1 -4
- package/es/icons/icon-gear.js +1 -4
- package/es/icons/icon-globe.js +1 -4
- package/es/icons/icon-grid.js +1 -4
- package/es/icons/icon-heart.js +1 -4
- package/es/icons/icon-hide.js +1 -4
- package/es/icons/icon-image.js +1 -4
- package/es/icons/icon-info.js +1 -4
- package/es/icons/icon-italic.js +1 -4
- package/es/icons/icon-layout-text-bottom.js +1 -4
- package/es/icons/icon-layout-text-left.js +1 -4
- package/es/icons/icon-layout-text-right.js +1 -4
- package/es/icons/icon-layout-text-top.js +1 -4
- package/es/icons/icon-letter-list.js +1 -4
- package/es/icons/icon-line-dashed.js +1 -4
- package/es/icons/icon-line.js +1 -4
- package/es/icons/icon-link.js +1 -4
- package/es/icons/icon-list.js +1 -4
- package/es/icons/icon-location.js +1 -4
- package/es/icons/icon-logo-instagram.js +1 -4
- package/es/icons/icon-mail.js +1 -4
- package/es/icons/icon-minus.js +1 -4
- package/es/icons/icon-monitor.js +1 -4
- package/es/icons/icon-network.js +1 -4
- package/es/icons/icon-number-list.js +1 -4
- package/es/icons/icon-pencil-ai.js +1 -4
- package/es/icons/icon-pencil.js +1 -4
- package/es/icons/icon-phone.js +1 -4
- package/es/icons/icon-play.js +1 -4
- package/es/icons/icon-plus.js +1 -4
- package/es/icons/icon-push-button.js +1 -4
- package/es/icons/icon-qr.js +1 -4
- package/es/icons/icon-question.js +1 -4
- package/es/icons/icon-redo.js +1 -4
- package/es/icons/icon-reset.js +1 -4
- package/es/icons/icon-row-and-columns.js +1 -4
- package/es/icons/icon-rows-and-column.js +1 -4
- package/es/icons/icon-rows.js +1 -4
- package/es/icons/icon-search.js +1 -4
- package/es/icons/icon-send.js +1 -4
- package/es/icons/icon-share.js +1 -4
- package/es/icons/icon-show.js +1 -4
- package/es/icons/icon-smile.js +1 -4
- package/es/icons/icon-spacer.js +1 -4
- package/es/icons/icon-square.js +1 -4
- package/es/icons/icon-stopwatch.js +1 -4
- package/es/icons/icon-strike.js +1 -4
- package/es/icons/icon-switch.js +1 -4
- package/es/icons/icon-symbols.js +1 -4
- package/es/icons/icon-tablet.js +1 -4
- package/es/icons/icon-text-align-center.js +1 -4
- package/es/icons/icon-text-align-left.js +1 -4
- package/es/icons/icon-text-align-right.js +1 -4
- package/es/icons/icon-text-justify.js +1 -4
- package/es/icons/icon-text.js +1 -4
- package/es/icons/icon-three-branches.js +1 -4
- package/es/icons/icon-trash.js +1 -4
- package/es/icons/icon-two-branches.js +1 -4
- package/es/icons/icon-type.js +1 -4
- package/es/icons/icon-underline.js +1 -4
- package/es/icons/icon-undo.js +1 -4
- package/es/icons/icon-upload.js +1 -4
- package/es/styles/card.js +2 -1
- package/es/styles/utilities.js +0 -4
- package/es/styles/variables.js +1 -1
- package/es/utilities/attributes.js +2 -7
- package/es/utilities/responsive.js +0 -14
- package/es/utilities/style-config.js +0 -3
- package/es/utilities/styles.js +0 -7
- package/es/variables/vars.js +6 -6
- package/package.json +1 -1
|
@@ -11,11 +11,9 @@ export const getMediaCss = (mediaQuery, property, value) => {
|
|
|
11
11
|
if (isNumber(val)) return u(val);
|
|
12
12
|
if (isString(val)) return val;
|
|
13
13
|
};
|
|
14
|
-
|
|
15
14
|
if (mediaQuery === 'default') {
|
|
16
15
|
return "".concat(property, ": ").concat(getValue(value), ";");
|
|
17
16
|
}
|
|
18
|
-
|
|
19
17
|
if (mediaQuery in mediaQueries) {
|
|
20
18
|
return "\n ".concat(mediaQueries[mediaQuery], " {\n ").concat(property, ": ").concat(getValue(value), ";\n }\n ");
|
|
21
19
|
} else {
|
|
@@ -27,10 +25,8 @@ export const mapObjToMedia = (property, obj, type) => {
|
|
|
27
25
|
if (type && value in vars[type]) {
|
|
28
26
|
return getCssVar(varInfo[type].name, value);
|
|
29
27
|
}
|
|
30
|
-
|
|
31
28
|
return value;
|
|
32
29
|
};
|
|
33
|
-
|
|
34
30
|
const declarations = Object.entries(obj).map(_ref => {
|
|
35
31
|
let [mediaQuery, value] = _ref;
|
|
36
32
|
return getMediaCss(mediaQuery, property, checkValueInVars(value));
|
|
@@ -49,52 +45,42 @@ export const getSpace = space => {
|
|
|
49
45
|
if (space in vars.spaces) {
|
|
50
46
|
return getCssVar(varInfo.spaces.name, space);
|
|
51
47
|
}
|
|
52
|
-
|
|
53
48
|
if (space === 0) return '0';
|
|
54
49
|
if (isString(space)) return space;
|
|
55
50
|
if (isNumber(space)) return u(space);
|
|
56
51
|
};
|
|
57
52
|
export const getResponsiveDimension = (property, dimension) => {
|
|
58
53
|
if (!dimension) return;
|
|
59
|
-
|
|
60
54
|
if (isObject(dimension)) {
|
|
61
55
|
return mapObjToMedia(property, dimension, varInfo.spaces.name);
|
|
62
56
|
}
|
|
63
|
-
|
|
64
57
|
return "".concat(property, ": ").concat(getDimension(dimension));
|
|
65
58
|
};
|
|
66
59
|
export const getResponsiveSpace = (property, space) => {
|
|
67
60
|
if (!space) return;
|
|
68
|
-
|
|
69
61
|
if (isObject(space)) {
|
|
70
62
|
return mapObjToMedia(property, space, varInfo.spaces.name);
|
|
71
63
|
}
|
|
72
|
-
|
|
73
64
|
return "".concat(property, ": ").concat(getSpace(space));
|
|
74
65
|
};
|
|
75
66
|
export const getTextSize = size => {
|
|
76
67
|
if (size in vars.texts) {
|
|
77
68
|
return getCssVar(varInfo.texts.name, size);
|
|
78
69
|
}
|
|
79
|
-
|
|
80
70
|
if (isString(size)) return size;
|
|
81
71
|
};
|
|
82
72
|
export const getResponsiveOneOf = (property, value) => {
|
|
83
73
|
if (!value) return;
|
|
84
|
-
|
|
85
74
|
if (isObject(value)) {
|
|
86
75
|
return mapObjToMedia(property, value);
|
|
87
76
|
}
|
|
88
|
-
|
|
89
77
|
return "".concat(property, ": ").concat(value);
|
|
90
78
|
};
|
|
91
79
|
export const getResponsiveTextSize = size => {
|
|
92
80
|
if (!size) return;
|
|
93
81
|
const property = 'font-size';
|
|
94
|
-
|
|
95
82
|
if (isObject(size)) {
|
|
96
83
|
return mapObjToMedia(property, size, varInfo.texts.name);
|
|
97
84
|
}
|
|
98
|
-
|
|
99
85
|
return "".concat(property, ": ").concat(getTextSize(size));
|
|
100
86
|
};
|
|
@@ -9,7 +9,6 @@ const radii = Object.keys(vars.radii);
|
|
|
9
9
|
const transitions = Object.keys(vars.transitions);
|
|
10
10
|
const sizes = Object.keys(vars.texts);
|
|
11
11
|
const weights = Object.keys(vars.weights);
|
|
12
|
-
|
|
13
12
|
const borderSideToStyle = side => {
|
|
14
13
|
if (side === 'all') return 'solid';
|
|
15
14
|
const borderConfig = {
|
|
@@ -23,7 +22,6 @@ const borderSideToStyle = side => {
|
|
|
23
22
|
const borderStyles = ['top', 'right', 'bottom', 'left'].map(s => borderConfig[side].includes(s) ? 'solid' : 'none');
|
|
24
23
|
return borderStyles.join(' ');
|
|
25
24
|
};
|
|
26
|
-
|
|
27
25
|
export const styleConfig = {
|
|
28
26
|
spaceProps: {
|
|
29
27
|
props: [{
|
|
@@ -370,7 +368,6 @@ export const styleConfig = {
|
|
|
370
368
|
propName: 'display',
|
|
371
369
|
property: 'display',
|
|
372
370
|
short: 'ds' // instead of 'd' to avoid conflict with _display.scss in frontend
|
|
373
|
-
|
|
374
371
|
}],
|
|
375
372
|
variables: textDisplays,
|
|
376
373
|
variableChecker: value => textDisplays.includes(value)
|
package/es/utilities/styles.js
CHANGED
|
@@ -6,7 +6,6 @@ export const getColor = color => {
|
|
|
6
6
|
if (color in vars.colors) {
|
|
7
7
|
return getCssVar(varInfo.colors.name, color);
|
|
8
8
|
}
|
|
9
|
-
|
|
10
9
|
return color;
|
|
11
10
|
};
|
|
12
11
|
export const isShadowVar = shadow => shadow in vars.shadows;
|
|
@@ -14,7 +13,6 @@ export const getShadow = shadow => {
|
|
|
14
13
|
if (isShadowVar(shadow)) {
|
|
15
14
|
return getCssVar(varInfo.shadows.name, shadow);
|
|
16
15
|
}
|
|
17
|
-
|
|
18
16
|
return shadow;
|
|
19
17
|
};
|
|
20
18
|
export const getWeight = weight => {
|
|
@@ -27,7 +25,6 @@ export const getRadius = radius => {
|
|
|
27
25
|
if (isRadiusVar(radius)) {
|
|
28
26
|
return getCssVar(varInfo.radii.name, radius);
|
|
29
27
|
}
|
|
30
|
-
|
|
31
28
|
if (radius === 0) return radius;
|
|
32
29
|
if (isString(radius)) return radius;
|
|
33
30
|
if (isNumber(radius)) return u(radius);
|
|
@@ -37,14 +34,12 @@ export const getTransition = transition => {
|
|
|
37
34
|
if (transition in vars.transitions) {
|
|
38
35
|
return getCssVar(varInfo.transitions.name, transition);
|
|
39
36
|
}
|
|
40
|
-
|
|
41
37
|
return transition;
|
|
42
38
|
};
|
|
43
39
|
export const getIconSize = size => {
|
|
44
40
|
if (size in vars.icons) {
|
|
45
41
|
return getCssVar(varInfo.icons.name, size);
|
|
46
42
|
}
|
|
47
|
-
|
|
48
43
|
return getDimension(size);
|
|
49
44
|
};
|
|
50
45
|
export const getBorder = function (borderSide) {
|
|
@@ -60,11 +55,9 @@ export const getBorder = function (borderSide) {
|
|
|
60
55
|
right: ["right"]
|
|
61
56
|
};
|
|
62
57
|
const value = "".concat(getDimension(borderWidth), " solid ").concat(getColor(borderColor));
|
|
63
|
-
|
|
64
58
|
const getSide = side => {
|
|
65
59
|
return side ? "border-".concat(side) : "border";
|
|
66
60
|
};
|
|
67
|
-
|
|
68
61
|
if (borderSide in sidesObj) {
|
|
69
62
|
return sidesObj[borderSide].map(side => "".concat(getSide(side), ": ").concat(value)).join(';');
|
|
70
63
|
}
|
package/es/variables/vars.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
function _objectSpread(
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
-
|
|
1
|
+
import "core-js/modules/es.symbol.description.js";
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
7
|
import { colors } from './colors';
|
|
8
8
|
export const grnPrefix = '--grn-';
|
|
9
9
|
export const vars = {
|