@flodesk/grain 11.63.5 → 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
|
@@ -1,21 +1,16 @@
|
|
|
1
|
+
import "core-js/modules/es.symbol.description.js";
|
|
1
2
|
const _excluded = ["children", "gap", "columnGap", "rowGap", "alignItems", "justifyItems", "justifyContent", "alignContent", "columns", "rows", "autoFlow", "className", "style"];
|
|
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
|
-
|
|
3
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
5
4
|
import "core-js/modules/es.regexp.exec.js";
|
|
6
5
|
import "core-js/modules/es.string.replace.js";
|
|
7
6
|
import "core-js/modules/es.string.trim.js";
|
|
8
|
-
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
function
|
|
12
|
-
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
16
|
-
|
|
17
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
18
|
-
|
|
7
|
+
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; }
|
|
8
|
+
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; }
|
|
9
|
+
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; }
|
|
10
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
11
|
+
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); }
|
|
12
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
13
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
19
14
|
import { generateAttributes } from '../../utilities';
|
|
20
15
|
import React, { forwardRef, useContext } from 'react';
|
|
21
16
|
import { types } from '../../types';
|
|
@@ -25,22 +20,21 @@ import { BreakpointsContext } from '../breakpoints-provider';
|
|
|
25
20
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
26
21
|
export const Arrange = /*#__PURE__*/forwardRef(function Arrange(_ref, ref) {
|
|
27
22
|
let {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
23
|
+
children,
|
|
24
|
+
gap,
|
|
25
|
+
columnGap,
|
|
26
|
+
rowGap,
|
|
27
|
+
alignItems = 'center',
|
|
28
|
+
justifyItems,
|
|
29
|
+
justifyContent = 'start',
|
|
30
|
+
alignContent,
|
|
31
|
+
columns,
|
|
32
|
+
rows,
|
|
33
|
+
autoFlow = 'column',
|
|
34
|
+
className,
|
|
35
|
+
style
|
|
36
|
+
} = _ref,
|
|
37
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
44
38
|
const propClassName = className ? className : '';
|
|
45
39
|
const propStyle = style ? style : {};
|
|
46
40
|
const breakpoints = useContext(BreakpointsContext);
|
|
@@ -62,9 +56,7 @@ export const Arrange = /*#__PURE__*/forwardRef(function Arrange(_ref, ref) {
|
|
|
62
56
|
classNameProps: _objectSpread({}, sharedProps),
|
|
63
57
|
breakpoints
|
|
64
58
|
});
|
|
65
|
-
|
|
66
59
|
const styleAttributes = _objectSpread(_objectSpread({}, attributes.styles), propStyle);
|
|
67
|
-
|
|
68
60
|
const classAttributes = "".concat(attributes.classNames, " ").concat(propClassName, " ").concat(styles.arrange).trim().replace(/\s+/g, ' ');
|
|
69
61
|
return ___EmotionJSX(Box, _extends({
|
|
70
62
|
ref: ref,
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
const _excluded = ["options", "value", "onChange", "isCreatable", "onCreate", "menuPlacement", "menuWidth", "menuMaxHeight", "menuZIndex", "placeholder", "label", "hint", "menuItemsHaveEllipsis", "hasPortal", "hasError", "errorMessage", "searchField", "backgroundColor", "onClear"];
|
|
2
2
|
import "core-js/modules/web.dom-collections.iterator.js";
|
|
3
|
-
|
|
4
|
-
function
|
|
5
|
-
|
|
6
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
7
|
-
|
|
8
|
-
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); }
|
|
9
|
-
|
|
3
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
4
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
5
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
10
6
|
import PropTypes from 'prop-types';
|
|
11
7
|
import React, { forwardRef, Fragment, useMemo, useRef, useState } from 'react';
|
|
12
8
|
import { Icon, Box, Text, Arrange } from '.';
|
|
@@ -27,14 +23,12 @@ const Trigger = /*#__PURE__*/forwardRef(function Trigger(_ref, ref) {
|
|
|
27
23
|
position: "relative"
|
|
28
24
|
}));
|
|
29
25
|
});
|
|
30
|
-
|
|
31
26
|
const EmptyState = () => ___EmotionJSX(Box, {
|
|
32
27
|
paddingY: "s",
|
|
33
28
|
paddingX: "12px"
|
|
34
29
|
}, ___EmotionJSX(Text, {
|
|
35
30
|
color: "content2"
|
|
36
31
|
}, "No results"));
|
|
37
|
-
|
|
38
32
|
const ActionsSection = _ref2 => {
|
|
39
33
|
let {
|
|
40
34
|
children
|
|
@@ -49,73 +43,62 @@ const ActionsSection = _ref2 => {
|
|
|
49
43
|
height: "100%"
|
|
50
44
|
}, children);
|
|
51
45
|
};
|
|
52
|
-
|
|
53
46
|
const ClearButton = _ref3 => {
|
|
54
47
|
let {
|
|
55
48
|
onClick
|
|
56
49
|
} = _ref3;
|
|
57
|
-
|
|
58
50
|
const handleClear = e => {
|
|
59
51
|
e.stopPropagation();
|
|
60
52
|
onClick();
|
|
61
53
|
};
|
|
62
|
-
|
|
63
54
|
return ___EmotionJSX(FieldClearButton, {
|
|
64
55
|
onClick: e => handleClear(e)
|
|
65
56
|
});
|
|
66
57
|
};
|
|
67
|
-
|
|
68
58
|
const getFilteredOptions = (query, options, searchField) => {
|
|
69
59
|
if (query === '') return options;
|
|
70
60
|
return options.filter(option => option[searchField].toLowerCase().includes(query.toLowerCase()));
|
|
71
61
|
};
|
|
72
|
-
|
|
73
62
|
const getShowGroupTitle = (index, option, filteredOptions) => {
|
|
74
63
|
const firstOptionHasTitle = index === 0 && option.groupTitle;
|
|
75
64
|
const titleChanged = index > 0 && option.groupTitle !== filteredOptions[index - 1].groupTitle;
|
|
76
65
|
return firstOptionHasTitle || titleChanged;
|
|
77
66
|
};
|
|
78
|
-
|
|
79
67
|
const menuItemStyles = "\n .autocompleteMenuItem {\n display: flex;\n gap: 8px;\n align-items: center;\n list-style: none;\n padding: 4px 12px;\n min-height: var(--grn-textbox-height-m);\n border-radius: ".concat(getRadius('s'), ";\n appearance: none;\n\n &.hasPreContent {\n padding-left: 0;\n }\n }\n\n .autocompleteMenuItemText {\n flex-grow: 1;\n\n &.hasEllipsis {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n }\n");
|
|
80
68
|
export const Autocomplete = _ref4 => {
|
|
81
69
|
let {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
70
|
+
options,
|
|
71
|
+
value,
|
|
72
|
+
onChange,
|
|
73
|
+
isCreatable,
|
|
74
|
+
onCreate,
|
|
75
|
+
menuPlacement = defaultProps.menuPlacement,
|
|
76
|
+
menuWidth,
|
|
77
|
+
menuMaxHeight = defaultProps.menuMaxHeight,
|
|
78
|
+
menuZIndex,
|
|
79
|
+
placeholder,
|
|
80
|
+
label,
|
|
81
|
+
hint,
|
|
82
|
+
menuItemsHaveEllipsis = true,
|
|
83
|
+
hasPortal = true,
|
|
84
|
+
hasError,
|
|
85
|
+
errorMessage,
|
|
86
|
+
searchField = 'content',
|
|
87
|
+
backgroundColor,
|
|
88
|
+
onClear
|
|
89
|
+
} = _ref4,
|
|
90
|
+
props = _objectWithoutProperties(_ref4, _excluded);
|
|
104
91
|
const [query, setQuery] = useState('');
|
|
105
|
-
|
|
106
92
|
const handleCreatableChange = option => {
|
|
107
93
|
if (onCreate) {
|
|
108
94
|
const isCreatableOption = !options.find(item => item.value === option.value);
|
|
109
|
-
|
|
110
95
|
if (isCreatableOption) {
|
|
111
96
|
onCreate(option);
|
|
112
97
|
return;
|
|
113
98
|
}
|
|
114
99
|
}
|
|
115
|
-
|
|
116
100
|
onChange(option);
|
|
117
101
|
};
|
|
118
|
-
|
|
119
102
|
const handleChange = option => {
|
|
120
103
|
if (isCreatable) {
|
|
121
104
|
handleCreatableChange(option);
|
|
@@ -123,7 +106,6 @@ export const Autocomplete = _ref4 => {
|
|
|
123
106
|
onChange(option);
|
|
124
107
|
}
|
|
125
108
|
};
|
|
126
|
-
|
|
127
109
|
const filteredOptions = getFilteredOptions(query, options, searchField);
|
|
128
110
|
const isShowCreateOption = isCreatable && query.length > 0;
|
|
129
111
|
const noResults = !Boolean(filteredOptions.length) && !isShowCreateOption;
|