grommet 2.20.1 → 2.21.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/components/Button/Button.js +2 -3
- package/components/Chart/Chart.js +14 -6
- package/components/DataChart/DataChart.js +84 -21
- package/components/DataChart/Detail.js +8 -0
- package/components/DataChart/XAxis.js +19 -10
- package/components/DataChart/index.d.ts +10 -2
- package/components/DataChart/propTypes.js +2 -1
- package/components/DataChart/stories/Offset.js +82 -0
- package/components/DataChart/stories/StackedAreas.js +77 -0
- package/components/DataChart/stories/StackedLines.js +73 -0
- package/components/DateInput/DateInput.js +21 -9
- package/components/DateInput/index.d.ts +1 -0
- package/components/DateInput/propTypes.js +1 -0
- package/components/List/List.js +11 -2
- package/components/List/index.d.ts +1 -0
- package/components/List/propTypes.js +1 -0
- package/components/Markdown/Markdown.js +4 -2
- package/components/Menu/Menu.js +39 -12
- package/components/Notification/Notification.js +17 -6
- package/components/Notification/index.d.ts +7 -1
- package/components/Notification/propTypes.js +4 -1
- package/components/RangeInput/StyledRangeInput.js +1 -1
- package/components/RangeInput/stories/SimpleRange.js +2 -6
- package/components/Select/Select.js +44 -12
- package/components/Select/SelectContainer.js +22 -6
- package/components/Select/stories/ChildrenRender.js +37 -33
- package/components/Select/stories/Clear.js +7 -3
- package/components/Select/stories/Controlled.js +32 -28
- package/components/Select/stories/{CustomSearch.js → CustomThemed/CustomSearch.js} +2 -2
- package/components/Select/stories/Disabled.js +29 -25
- package/components/Select/stories/InsideFormField.js +29 -27
- package/components/Select/stories/LazyLoadingOptions.js +27 -25
- package/components/Select/stories/ManyOptions.js +47 -43
- package/components/Select/stories/Multiple.js +25 -21
- package/components/Select/stories/ObjectOptions.js +27 -25
- package/components/Select/stories/Search.js +62 -58
- package/components/Select/stories/Simple.js +26 -22
- package/components/Select/stories/Uncontrolled.js +24 -20
- package/components/Select/stories/ValueLabel.js +40 -36
- package/components/Select/stories/typescript/CreateOption.tsx +34 -30
- package/components/Sidebar/stories/Labels.js +25 -19
- package/components/Sidebar/stories/typescript/Simple.tsx +17 -12
- package/components/SkipLinks/stories/{Themed.js → CustomThemed/Themed.js} +1 -1
- package/components/SkipLinks/stories/Simple.js +82 -78
- package/components/Tab/Tab.js +6 -1
- package/components/Table/stories/Default.js +30 -28
- package/components/Table/stories/InfiniteScrollInTable.js +39 -35
- package/components/Table/stories/MeterInTable.js +26 -24
- package/components/Tag/Tag.js +17 -6
- package/components/Tag/index.d.ts +8 -0
- package/components/Tag/propTypes.js +2 -1
- package/components/Tag/stories/Size.js +45 -0
- package/components/TextArea/stories/{Themed.js → CustomThemed/Themed.js} +1 -1
- package/components/TextArea/stories/Fill.js +18 -16
- package/components/TextArea/stories/InsideFormField.js +43 -41
- package/components/TextArea/stories/NonResizable.js +13 -11
- package/components/TextArea/stories/Simple.js +13 -11
- package/components/TextInput/TextInput.js +5 -8
- package/{es6/components/TextInput/stories/typescript → components/TextInput/stories/CustomThemed}/CustomSuggestions.tsx +1 -1
- package/components/TextInput/stories/{Themed.js → CustomThemed/Themed.js} +1 -1
- package/components/TextInput/stories/DefaultSuggestion.js +20 -19
- package/components/TextInput/stories/Icon.js +22 -21
- package/components/TextInput/stories/InsideFormField.js +32 -30
- package/components/TextInput/stories/OnSelect.js +20 -19
- package/components/TextInput/stories/Password.js +30 -29
- package/components/TextInput/stories/Simple.js +17 -16
- package/components/TextInput/stories/StyledPlaceholder.js +10 -9
- package/components/TextInput/stories/Suggestions.js +19 -18
- package/components/TextInput/stories/Uncontrolled.js +18 -17
- package/components/TextInput/stories/WithTags.js +19 -18
- package/components/Tip/stories/Caret.js +37 -31
- package/components/Tip/stories/{ResponsiveTip.js → CustomThemed/ResponsiveTip.js} +1 -1
- package/components/Tip/stories/{SidebarTip.js → CustomThemed/SidebarTip.js} +1 -1
- package/components/Tip/stories/{typescript → CustomThemed}/Themed.tsx +1 -1
- package/components/Tip/stories/HeaderActions.js +66 -60
- package/components/Tip/stories/InfoTip.js +59 -56
- package/components/Tip/stories/typescript/Animated.tsx +26 -21
- package/components/Tip/stories/typescript/Children.tsx +52 -51
- package/components/Tip/stories/typescript/Simple.tsx +12 -7
- package/es6/components/Button/Button.js +2 -3
- package/es6/components/Chart/Chart.js +14 -6
- package/es6/components/DataChart/DataChart.js +84 -21
- package/es6/components/DataChart/Detail.js +7 -0
- package/es6/components/DataChart/XAxis.js +19 -10
- package/es6/components/DataChart/index.d.ts +10 -2
- package/es6/components/DataChart/propTypes.js +2 -1
- package/es6/components/DataChart/stories/Offset.js +70 -0
- package/es6/components/DataChart/stories/StackedAreas.js +65 -0
- package/es6/components/DataChart/stories/StackedLines.js +61 -0
- package/es6/components/DateInput/DateInput.js +21 -9
- package/es6/components/DateInput/index.d.ts +1 -0
- package/es6/components/DateInput/propTypes.js +1 -0
- package/es6/components/List/List.js +11 -2
- package/es6/components/List/index.d.ts +1 -0
- package/es6/components/List/propTypes.js +1 -0
- package/es6/components/Markdown/Markdown.js +4 -2
- package/es6/components/Menu/Menu.js +40 -13
- package/es6/components/Notification/Notification.js +18 -7
- package/es6/components/Notification/index.d.ts +7 -1
- package/es6/components/Notification/propTypes.js +4 -1
- package/es6/components/RangeInput/StyledRangeInput.js +1 -1
- package/es6/components/RangeInput/stories/SimpleRange.js +3 -6
- package/es6/components/Select/Select.js +44 -12
- package/es6/components/Select/SelectContainer.js +22 -6
- package/es6/components/Select/stories/ChildrenRender.js +38 -33
- package/es6/components/Select/stories/Clear.js +8 -4
- package/es6/components/Select/stories/Controlled.js +33 -28
- package/es6/components/Select/stories/{CustomSearch.js → CustomThemed/CustomSearch.js} +2 -2
- package/es6/components/Select/stories/Disabled.js +30 -25
- package/es6/components/Select/stories/InsideFormField.js +30 -27
- package/es6/components/Select/stories/LazyLoadingOptions.js +28 -25
- package/es6/components/Select/stories/ManyOptions.js +48 -43
- package/es6/components/Select/stories/Multiple.js +26 -21
- package/es6/components/Select/stories/ObjectOptions.js +28 -25
- package/es6/components/Select/stories/Search.js +63 -58
- package/es6/components/Select/stories/Simple.js +27 -22
- package/es6/components/Select/stories/Uncontrolled.js +25 -20
- package/es6/components/Select/stories/ValueLabel.js +41 -36
- package/es6/components/Select/stories/typescript/CreateOption.tsx +34 -30
- package/es6/components/Sidebar/stories/Labels.js +26 -20
- package/es6/components/Sidebar/stories/typescript/Simple.tsx +17 -12
- package/es6/components/SkipLinks/stories/{Themed.js → CustomThemed/Themed.js} +1 -1
- package/es6/components/SkipLinks/stories/Simple.js +83 -79
- package/es6/components/Tab/Tab.js +6 -1
- package/es6/components/Table/stories/Default.js +31 -28
- package/es6/components/Table/stories/InfiniteScrollInTable.js +40 -36
- package/es6/components/Table/stories/MeterInTable.js +27 -24
- package/es6/components/Tag/Tag.js +17 -6
- package/es6/components/Tag/index.d.ts +8 -0
- package/es6/components/Tag/propTypes.js +2 -1
- package/es6/components/Tag/stories/Size.js +33 -0
- package/es6/components/TextArea/stories/{Themed.js → CustomThemed/Themed.js} +1 -1
- package/es6/components/TextArea/stories/Fill.js +19 -16
- package/es6/components/TextArea/stories/InsideFormField.js +44 -41
- package/es6/components/TextArea/stories/NonResizable.js +14 -11
- package/es6/components/TextArea/stories/Simple.js +14 -11
- package/es6/components/TextInput/TextInput.js +5 -8
- package/{components/TextInput/stories/typescript → es6/components/TextInput/stories/CustomThemed}/CustomSuggestions.tsx +1 -1
- package/es6/components/TextInput/stories/{Themed.js → CustomThemed/Themed.js} +1 -1
- package/es6/components/TextInput/stories/DefaultSuggestion.js +21 -19
- package/es6/components/TextInput/stories/Icon.js +23 -21
- package/es6/components/TextInput/stories/InsideFormField.js +33 -30
- package/es6/components/TextInput/stories/OnSelect.js +21 -19
- package/es6/components/TextInput/stories/Password.js +31 -29
- package/es6/components/TextInput/stories/Simple.js +18 -16
- package/es6/components/TextInput/stories/StyledPlaceholder.js +11 -9
- package/es6/components/TextInput/stories/Suggestions.js +20 -18
- package/es6/components/TextInput/stories/Uncontrolled.js +19 -17
- package/es6/components/TextInput/stories/WithTags.js +20 -18
- package/es6/components/Tip/stories/Caret.js +38 -32
- package/es6/components/Tip/stories/{ResponsiveTip.js → CustomThemed/ResponsiveTip.js} +1 -1
- package/es6/components/Tip/stories/{SidebarTip.js → CustomThemed/SidebarTip.js} +1 -1
- package/es6/components/Tip/stories/{typescript → CustomThemed}/Themed.tsx +1 -1
- package/es6/components/Tip/stories/HeaderActions.js +67 -61
- package/es6/components/Tip/stories/InfoTip.js +60 -57
- package/es6/components/Tip/stories/typescript/Animated.tsx +26 -21
- package/es6/components/Tip/stories/typescript/Children.tsx +52 -51
- package/es6/components/Tip/stories/typescript/Simple.tsx +12 -7
- package/es6/languages/default.json +2 -1
- package/es6/themes/base.d.ts +34 -1
- package/es6/themes/base.js +39 -0
- package/grommet.min.js +1 -1
- package/grommet.min.js.map +1 -1
- package/languages/default.json +2 -1
- package/package.json +4 -4
- package/themes/base.d.ts +34 -1
- package/themes/base.js +39 -0
|
@@ -7,8 +7,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
7
7
|
|
|
8
8
|
var _grommet = require("grommet");
|
|
9
9
|
|
|
10
|
-
var _themes = require("grommet/themes");
|
|
11
|
-
|
|
12
10
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
11
|
|
|
14
12
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -22,45 +20,49 @@ var InsideFormField = function InsideFormField() {
|
|
|
22
20
|
value = _useState[0],
|
|
23
21
|
setValue = _useState[1];
|
|
24
22
|
|
|
25
|
-
return
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
23
|
+
return (
|
|
24
|
+
/*#__PURE__*/
|
|
25
|
+
// Uncomment <Grommet> lines when using outside of storybook
|
|
26
|
+
// <Grommet theme={...}>
|
|
27
|
+
_react["default"].createElement(_grommet.Box, null, /*#__PURE__*/_react["default"].createElement(_grommet.Box, {
|
|
28
|
+
align: "center",
|
|
29
|
+
pad: "large"
|
|
30
|
+
}, /*#__PURE__*/_react["default"].createElement(_grommet.Text, {
|
|
31
|
+
weight: "bold"
|
|
32
|
+
}, "TextArea as component prop of FormField"), /*#__PURE__*/_react["default"].createElement(_grommet.Form, null, /*#__PURE__*/_react["default"].createElement(_grommet.FormField, {
|
|
33
|
+
label: "FormField label",
|
|
34
|
+
htmlFor: "text-area",
|
|
35
|
+
component: _grommet.TextArea,
|
|
36
|
+
placeholder: "placeholder from FormField"
|
|
37
|
+
}), /*#__PURE__*/_react["default"].createElement(_grommet.Button, {
|
|
38
|
+
type: "submit",
|
|
39
|
+
label: "submit"
|
|
40
|
+
}))), /*#__PURE__*/_react["default"].createElement(_grommet.Box, {
|
|
41
|
+
align: "center",
|
|
42
|
+
pad: "large"
|
|
43
|
+
}, /*#__PURE__*/_react["default"].createElement(_grommet.Text, {
|
|
44
|
+
weight: "bold"
|
|
45
|
+
}, "TextArea inside FormField"), /*#__PURE__*/_react["default"].createElement(_grommet.Form, {
|
|
46
|
+
value: value,
|
|
47
|
+
onChange: function onChange(nextValue) {
|
|
48
|
+
return setValue(nextValue);
|
|
49
|
+
},
|
|
50
|
+
onSubmit: function onSubmit() {
|
|
51
|
+
return console.log(value);
|
|
52
|
+
}
|
|
53
|
+
}, /*#__PURE__*/_react["default"].createElement(_grommet.FormField, {
|
|
54
|
+
name: "value",
|
|
55
|
+
label: "FormField label",
|
|
56
|
+
required: true
|
|
57
|
+
}, /*#__PURE__*/_react["default"].createElement(_grommet.TextArea, {
|
|
58
|
+
name: "value",
|
|
59
|
+
placeholder: "placeholder from TextArea"
|
|
60
|
+
})), /*#__PURE__*/_react["default"].createElement(_grommet.Button, {
|
|
61
|
+
type: "submit",
|
|
62
|
+
label: "submit"
|
|
63
|
+
})))) // </Grommet>
|
|
64
|
+
|
|
65
|
+
);
|
|
64
66
|
};
|
|
65
67
|
|
|
66
68
|
exports.InsideFormField = InsideFormField;
|
|
@@ -7,8 +7,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
7
7
|
|
|
8
8
|
var _grommet = require("grommet");
|
|
9
9
|
|
|
10
|
-
var _themes = require("grommet/themes");
|
|
11
|
-
|
|
12
10
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
11
|
|
|
14
12
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -24,15 +22,19 @@ var Resize = function Resize(props) {
|
|
|
24
22
|
return setValue(event.target.value);
|
|
25
23
|
};
|
|
26
24
|
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
25
|
+
return (
|
|
26
|
+
/*#__PURE__*/
|
|
27
|
+
// Uncomment <Grommet> lines when using outside of storybook
|
|
28
|
+
// <Grommet theme={...}>
|
|
29
|
+
_react["default"].createElement(_grommet.Box, {
|
|
30
|
+
align: "center",
|
|
31
|
+
pad: "large"
|
|
32
|
+
}, /*#__PURE__*/_react["default"].createElement(_grommet.TextArea, _extends({
|
|
33
|
+
value: value,
|
|
34
|
+
onChange: onChange
|
|
35
|
+
}, props))) // </Grommet>
|
|
36
|
+
|
|
37
|
+
);
|
|
36
38
|
};
|
|
37
39
|
|
|
38
40
|
var NonResizable = function NonResizable() {
|
|
@@ -7,8 +7,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
7
7
|
|
|
8
8
|
var _grommet = require("grommet");
|
|
9
9
|
|
|
10
|
-
var _themes = require("grommet/themes");
|
|
11
|
-
|
|
12
10
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
11
|
|
|
14
12
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -24,15 +22,19 @@ var Resize = function Resize(props) {
|
|
|
24
22
|
return setValue(event.target.value);
|
|
25
23
|
};
|
|
26
24
|
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
25
|
+
return (
|
|
26
|
+
/*#__PURE__*/
|
|
27
|
+
// Uncomment <Grommet> lines when using outside of storybook
|
|
28
|
+
// <Grommet theme={...}>
|
|
29
|
+
_react["default"].createElement(_grommet.Box, {
|
|
30
|
+
align: "center",
|
|
31
|
+
pad: "large"
|
|
32
|
+
}, /*#__PURE__*/_react["default"].createElement(_grommet.TextArea, _extends({
|
|
33
|
+
value: value,
|
|
34
|
+
onChange: onChange
|
|
35
|
+
}, props))) // </Grommet>
|
|
36
|
+
|
|
37
|
+
);
|
|
36
38
|
};
|
|
37
39
|
|
|
38
40
|
var Simple = function Simple() {
|
|
@@ -160,7 +160,10 @@ var TextInput = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
160
160
|
|
|
161
161
|
setShowDrop(false);
|
|
162
162
|
if (onSuggestionsClose) onSuggestionsClose();
|
|
163
|
-
}, [onSuggestionsClose, suggestions]);
|
|
163
|
+
}, [onSuggestionsClose, suggestions]);
|
|
164
|
+
var clickOutside = (0, _react.useCallback)(function (event) {
|
|
165
|
+
if (event.target !== inputRef.current) closeDrop();
|
|
166
|
+
}, [inputRef, closeDrop]); // Handle scenarios where we have focus, the drop isn't showing,
|
|
164
167
|
// and the suggestions change. We don't want to open the drop if
|
|
165
168
|
// the drop has been closed by onEsc and the suggestions haven't
|
|
166
169
|
// changed. So, we remember the suggestions we are showing when
|
|
@@ -289,13 +292,7 @@ var TextInput = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
289
292
|
align: dropAlign,
|
|
290
293
|
responsive: false,
|
|
291
294
|
target: dropTarget || inputRef.current,
|
|
292
|
-
onClickOutside:
|
|
293
|
-
var target = _ref2.target;
|
|
294
|
-
|
|
295
|
-
if (target !== inputRef.current) {
|
|
296
|
-
closeDrop();
|
|
297
|
-
}
|
|
298
|
-
},
|
|
295
|
+
onClickOutside: clickOutside,
|
|
299
296
|
onEsc: closeDrop
|
|
300
297
|
}, dropProps), /*#__PURE__*/_react["default"].createElement(ContainerBox, {
|
|
301
298
|
overflow: "auto",
|
|
@@ -7,8 +7,6 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
7
7
|
|
|
8
8
|
var _grommet = require("grommet");
|
|
9
9
|
|
|
10
|
-
var _themes = require("grommet/themes");
|
|
11
|
-
|
|
12
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
11
|
|
|
14
12
|
var suggestions = Array(100).fill().map(function (_, i) {
|
|
@@ -28,23 +26,26 @@ var DefaultSuggestion = function DefaultSuggestion() {
|
|
|
28
26
|
return setValue(event.suggestion);
|
|
29
27
|
};
|
|
30
28
|
|
|
31
|
-
return
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
29
|
+
return (
|
|
30
|
+
/*#__PURE__*/
|
|
31
|
+
// Uncomment <Grommet> lines when using outside of storybook
|
|
32
|
+
// <Grommet theme={...}>
|
|
33
|
+
_react["default"].createElement(_grommet.Box, {
|
|
34
|
+
fill: true,
|
|
35
|
+
align: "center",
|
|
36
|
+
justify: "start",
|
|
37
|
+
pad: "large"
|
|
38
|
+
}, /*#__PURE__*/_react["default"].createElement(_grommet.Box, {
|
|
39
|
+
width: "medium"
|
|
40
|
+
}, /*#__PURE__*/_react["default"].createElement(_grommet.TextInput, {
|
|
41
|
+
value: value,
|
|
42
|
+
onChange: onChange,
|
|
43
|
+
onSelect: onSelect,
|
|
44
|
+
suggestions: suggestions,
|
|
45
|
+
defaultSuggestion: 1
|
|
46
|
+
}))) // </Grommet>
|
|
47
|
+
|
|
48
|
+
);
|
|
48
49
|
};
|
|
49
50
|
|
|
50
51
|
exports.DefaultSuggestion = DefaultSuggestion;
|
|
@@ -9,30 +9,31 @@ var _grommetIcons = require("grommet-icons");
|
|
|
9
9
|
|
|
10
10
|
var _grommet = require("grommet");
|
|
11
11
|
|
|
12
|
-
var _themes = require("grommet/themes");
|
|
13
|
-
|
|
14
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
13
|
|
|
16
14
|
var Icon = function Icon() {
|
|
17
|
-
return
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
15
|
+
return (
|
|
16
|
+
/*#__PURE__*/
|
|
17
|
+
// Uncomment <Grommet> lines when using outside of storybook
|
|
18
|
+
// <Grommet theme={...}>
|
|
19
|
+
_react["default"].createElement(_grommet.Box, {
|
|
20
|
+
fill: true,
|
|
21
|
+
align: "center",
|
|
22
|
+
justify: "start",
|
|
23
|
+
pad: "large"
|
|
24
|
+
}, /*#__PURE__*/_react["default"].createElement(_grommet.Box, {
|
|
25
|
+
width: "medium",
|
|
26
|
+
gap: "medium"
|
|
27
|
+
}, /*#__PURE__*/_react["default"].createElement(_grommet.TextInput, {
|
|
28
|
+
icon: /*#__PURE__*/_react["default"].createElement(_grommetIcons.Search, null),
|
|
29
|
+
placeholder: "search ..."
|
|
30
|
+
}), /*#__PURE__*/_react["default"].createElement(_grommet.TextInput, {
|
|
31
|
+
icon: /*#__PURE__*/_react["default"].createElement(_grommetIcons.Search, null),
|
|
32
|
+
reverse: true,
|
|
33
|
+
placeholder: "search ..."
|
|
34
|
+
}))) // </Grommet>
|
|
35
|
+
|
|
36
|
+
);
|
|
36
37
|
};
|
|
37
38
|
|
|
38
39
|
exports.Icon = Icon;
|
|
@@ -7,8 +7,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
7
7
|
|
|
8
8
|
var _grommet = require("grommet");
|
|
9
9
|
|
|
10
|
-
var _themes = require("grommet/themes");
|
|
11
|
-
|
|
12
10
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
11
|
|
|
14
12
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -51,34 +49,38 @@ var InsideFormField = function InsideFormField(props) {
|
|
|
51
49
|
}));
|
|
52
50
|
};
|
|
53
51
|
|
|
54
|
-
return
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
52
|
+
return (
|
|
53
|
+
/*#__PURE__*/
|
|
54
|
+
// Uncomment <Grommet> lines when using outside of storybook
|
|
55
|
+
// <Grommet theme={...}>
|
|
56
|
+
_react["default"].createElement(_grommet.Box, {
|
|
57
|
+
align: "center",
|
|
58
|
+
pad: "large"
|
|
59
|
+
}, /*#__PURE__*/_react["default"].createElement(_grommet.Form, {
|
|
60
|
+
onSubmit: function onSubmit(_ref) {
|
|
61
|
+
var nextValue = _ref.value;
|
|
62
|
+
console.log(nextValue);
|
|
63
|
+
setState({
|
|
64
|
+
value: '',
|
|
65
|
+
suggestions: allSuggestions
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}, /*#__PURE__*/_react["default"].createElement(_grommet.FormField, _extends({
|
|
69
|
+
label: "Label",
|
|
70
|
+
htmlFor: "text-input"
|
|
71
|
+
}, props), /*#__PURE__*/_react["default"].createElement(_grommet.TextInput, {
|
|
72
|
+
id: "text-input",
|
|
73
|
+
placeholder: "placeholder",
|
|
74
|
+
value: state.value,
|
|
75
|
+
onChange: onChange,
|
|
76
|
+
onSelect: onSelect,
|
|
77
|
+
suggestions: state.suggestions
|
|
78
|
+
})), /*#__PURE__*/_react["default"].createElement(_grommet.Button, {
|
|
79
|
+
type: "submit",
|
|
80
|
+
label: "submit"
|
|
81
|
+
}))) // </Grommet>
|
|
82
|
+
|
|
83
|
+
);
|
|
82
84
|
};
|
|
83
85
|
|
|
84
86
|
exports.InsideFormField = InsideFormField;
|
|
@@ -7,8 +7,6 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
7
7
|
|
|
8
8
|
var _grommet = require("grommet");
|
|
9
9
|
|
|
10
|
-
var _themes = require("grommet/themes");
|
|
11
|
-
|
|
12
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
11
|
|
|
14
12
|
var suggestions = Array(100).fill().map(function (_, i) {
|
|
@@ -34,23 +32,26 @@ var OnSelect = function OnSelect() {
|
|
|
34
32
|
}
|
|
35
33
|
};
|
|
36
34
|
|
|
37
|
-
return
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
35
|
+
return (
|
|
36
|
+
/*#__PURE__*/
|
|
37
|
+
// Uncomment <Grommet> lines when using outside of storybook
|
|
38
|
+
// <Grommet theme={...}>
|
|
39
|
+
_react["default"].createElement(_grommet.Box, {
|
|
40
|
+
fill: true,
|
|
41
|
+
align: "center",
|
|
42
|
+
justify: "start",
|
|
43
|
+
pad: "large"
|
|
44
|
+
}, /*#__PURE__*/_react["default"].createElement(_grommet.Box, {
|
|
45
|
+
width: "medium"
|
|
46
|
+
}, /*#__PURE__*/_react["default"].createElement(_grommet.TextInput, {
|
|
47
|
+
value: value,
|
|
48
|
+
onChange: onChange,
|
|
49
|
+
onSelect: onHighlight,
|
|
50
|
+
onSuggestionSelect: onSelect,
|
|
51
|
+
suggestions: suggestions
|
|
52
|
+
}))) // </Grommet>
|
|
53
|
+
|
|
54
|
+
);
|
|
54
55
|
};
|
|
55
56
|
|
|
56
57
|
exports.OnSelect = OnSelect;
|
|
@@ -9,8 +9,6 @@ var _grommetIcons = require("grommet-icons");
|
|
|
9
9
|
|
|
10
10
|
var _grommet = require("grommet");
|
|
11
11
|
|
|
12
|
-
var _themes = require("grommet/themes");
|
|
13
|
-
|
|
14
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
13
|
|
|
16
14
|
var Password = function Password() {
|
|
@@ -22,33 +20,36 @@ var Password = function Password() {
|
|
|
22
20
|
reveal = _React$useState2[0],
|
|
23
21
|
setReveal = _React$useState2[1];
|
|
24
22
|
|
|
25
|
-
return
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
23
|
+
return (
|
|
24
|
+
/*#__PURE__*/
|
|
25
|
+
// Uncomment <Grommet> lines when using outside of storybook
|
|
26
|
+
// <Grommet theme={...}>
|
|
27
|
+
_react["default"].createElement(_grommet.Box, {
|
|
28
|
+
width: "medium",
|
|
29
|
+
direction: "row",
|
|
30
|
+
margin: "large",
|
|
31
|
+
align: "center",
|
|
32
|
+
round: "small",
|
|
33
|
+
border: true
|
|
34
|
+
}, /*#__PURE__*/_react["default"].createElement(_grommet.TextInput, {
|
|
35
|
+
plain: true,
|
|
36
|
+
type: reveal ? 'text' : 'password',
|
|
37
|
+
value: value,
|
|
38
|
+
onChange: function onChange(event) {
|
|
39
|
+
return setValue(event.target.value);
|
|
40
|
+
}
|
|
41
|
+
}), /*#__PURE__*/_react["default"].createElement(_grommet.Button, {
|
|
42
|
+
icon: reveal ? /*#__PURE__*/_react["default"].createElement(_grommetIcons.View, {
|
|
43
|
+
size: "medium"
|
|
44
|
+
}) : /*#__PURE__*/_react["default"].createElement(_grommetIcons.Hide, {
|
|
45
|
+
size: "medium"
|
|
46
|
+
}),
|
|
47
|
+
onClick: function onClick() {
|
|
48
|
+
return setReveal(!reveal);
|
|
49
|
+
}
|
|
50
|
+
})) // </Grommet>
|
|
51
|
+
|
|
52
|
+
);
|
|
52
53
|
};
|
|
53
54
|
|
|
54
55
|
exports.Password = Password;
|
|
@@ -7,8 +7,6 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
7
7
|
|
|
8
8
|
var _grommet = require("grommet");
|
|
9
9
|
|
|
10
|
-
var _themes = require("grommet/themes");
|
|
11
|
-
|
|
12
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
11
|
|
|
14
12
|
var Simple = function Simple() {
|
|
@@ -20,20 +18,23 @@ var Simple = function Simple() {
|
|
|
20
18
|
return setValue(event.target.value);
|
|
21
19
|
};
|
|
22
20
|
|
|
23
|
-
return
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
21
|
+
return (
|
|
22
|
+
/*#__PURE__*/
|
|
23
|
+
// Uncomment <Grommet> lines when using outside of storybook
|
|
24
|
+
// <Grommet theme={...}>
|
|
25
|
+
_react["default"].createElement(_grommet.Box, {
|
|
26
|
+
fill: true,
|
|
27
|
+
align: "center",
|
|
28
|
+
justify: "start",
|
|
29
|
+
pad: "large"
|
|
30
|
+
}, /*#__PURE__*/_react["default"].createElement(_grommet.Box, {
|
|
31
|
+
width: "medium"
|
|
32
|
+
}, /*#__PURE__*/_react["default"].createElement(_grommet.TextInput, {
|
|
33
|
+
value: value,
|
|
34
|
+
onChange: onChange
|
|
35
|
+
}))) // </Grommet>
|
|
36
|
+
|
|
37
|
+
);
|
|
37
38
|
};
|
|
38
39
|
|
|
39
40
|
exports.Simple = Simple;
|
|
@@ -7,18 +7,19 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
7
7
|
|
|
8
8
|
var _grommet = require("grommet");
|
|
9
9
|
|
|
10
|
-
var _themes = require("grommet/themes");
|
|
11
|
-
|
|
12
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
11
|
|
|
14
12
|
var StyledPlaceholder = function StyledPlaceholder() {
|
|
15
|
-
return
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
return (
|
|
14
|
+
/*#__PURE__*/
|
|
15
|
+
// Uncomment <Grommet> lines when using outside of storybook
|
|
16
|
+
// <Grommet theme={...}>
|
|
17
|
+
_react["default"].createElement(_grommet.Box, null, /*#__PURE__*/_react["default"].createElement(_grommet.Form, null, /*#__PURE__*/_react["default"].createElement(_grommet.TextInput, {
|
|
18
|
+
name: "name",
|
|
19
|
+
placeholder: /*#__PURE__*/_react["default"].createElement(_grommet.Text, null, "placeholder")
|
|
20
|
+
}))) // </Grommet>
|
|
21
|
+
|
|
22
|
+
);
|
|
22
23
|
};
|
|
23
24
|
|
|
24
25
|
exports.StyledPlaceholder = StyledPlaceholder;
|