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
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Box,
|
|
3
|
-
import { grommet } from 'grommet/themes';
|
|
2
|
+
import { Box, TextInput } from 'grommet';
|
|
4
3
|
var allSuggestions = Array(100).fill().map(function (_, i) {
|
|
5
4
|
return i + 1 + " suggestion";
|
|
6
5
|
});
|
|
@@ -28,22 +27,25 @@ export var Suggestions = function Suggestions() {
|
|
|
28
27
|
setValue(event.suggestion);
|
|
29
28
|
};
|
|
30
29
|
|
|
31
|
-
return
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
30
|
+
return (
|
|
31
|
+
/*#__PURE__*/
|
|
32
|
+
// Uncomment <Grommet> lines when using outside of storybook
|
|
33
|
+
// <Grommet theme={...}>
|
|
34
|
+
React.createElement(Box, {
|
|
35
|
+
fill: true,
|
|
36
|
+
align: "center",
|
|
37
|
+
justify: "start",
|
|
38
|
+
pad: "large"
|
|
39
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
40
|
+
width: "medium"
|
|
41
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
42
|
+
value: value,
|
|
43
|
+
onChange: onChange,
|
|
44
|
+
onSuggestionSelect: onSuggestionSelect,
|
|
45
|
+
suggestions: suggestions
|
|
46
|
+
}))) // </Grommet>
|
|
47
|
+
|
|
48
|
+
);
|
|
47
49
|
};
|
|
48
50
|
Suggestions.parameters = {
|
|
49
51
|
chromatic: {
|
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Box,
|
|
3
|
-
import { grommet } from 'grommet/themes';
|
|
2
|
+
import { Box, TextInput } from 'grommet';
|
|
4
3
|
export var Uncontrolled = function Uncontrolled() {
|
|
5
|
-
return
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
4
|
+
return (
|
|
5
|
+
/*#__PURE__*/
|
|
6
|
+
// Uncomment <Grommet> lines when using outside of storybook
|
|
7
|
+
// <Grommet theme={...}>
|
|
8
|
+
React.createElement(Box, {
|
|
9
|
+
fill: true,
|
|
10
|
+
align: "center",
|
|
11
|
+
justify: "start",
|
|
12
|
+
pad: "large"
|
|
13
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
14
|
+
width: "medium"
|
|
15
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
16
|
+
onChange: function onChange(event) {
|
|
17
|
+
return console.log('Change', event.target.value);
|
|
18
|
+
}
|
|
19
|
+
}))) // </Grommet>
|
|
20
|
+
|
|
21
|
+
);
|
|
20
22
|
};
|
|
21
23
|
Uncontrolled.parameters = {
|
|
22
24
|
chromatic: {
|
|
@@ -7,8 +7,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import { FormClose } from "grommet-icons/es6/icons/FormClose";
|
|
10
|
-
import { Box, Button,
|
|
11
|
-
import { grommet } from 'grommet/themes';
|
|
10
|
+
import { Box, Button, Keyboard, Text, TextInput } from 'grommet';
|
|
12
11
|
var allSuggestions = ['sony', 'sonar', 'foo', 'bar'];
|
|
13
12
|
|
|
14
13
|
var Tag = function Tag(_ref) {
|
|
@@ -153,22 +152,25 @@ export var WithTags = function WithTags() {
|
|
|
153
152
|
}));
|
|
154
153
|
};
|
|
155
154
|
|
|
156
|
-
return
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
155
|
+
return (
|
|
156
|
+
/*#__PURE__*/
|
|
157
|
+
// Uncomment <Grommet> lines when using outside of storybook
|
|
158
|
+
// <Grommet theme={...}>
|
|
159
|
+
React.createElement(Box, {
|
|
160
|
+
pad: "small"
|
|
161
|
+
}, /*#__PURE__*/React.createElement(TagInput, {
|
|
162
|
+
placeholder: "Search for aliases...",
|
|
163
|
+
suggestions: suggestions,
|
|
164
|
+
value: selectedTags,
|
|
165
|
+
onRemove: onRemoveTag,
|
|
166
|
+
onAdd: onAddTag,
|
|
167
|
+
onChange: function onChange(_ref3) {
|
|
168
|
+
var value = _ref3.target.value;
|
|
169
|
+
return onFilterSuggestion(value);
|
|
170
|
+
}
|
|
171
|
+
})) // </Grommet>
|
|
172
|
+
|
|
173
|
+
);
|
|
172
174
|
};
|
|
173
175
|
WithTags.storyName = 'With tags';
|
|
174
176
|
export default {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Box, Button, Heading, Text, Tip } from 'grommet';
|
|
3
3
|
import { Trash } from "grommet-icons/es6/icons/Trash";
|
|
4
4
|
|
|
5
5
|
var TipContent = function TipContent(_ref) {
|
|
@@ -27,37 +27,43 @@ var TipContent = function TipContent(_ref) {
|
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
export var Caret = function Caret() {
|
|
30
|
-
return
|
|
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
|
-
|
|
30
|
+
return (
|
|
31
|
+
/*#__PURE__*/
|
|
32
|
+
// Uncomment <Grommet> lines when using outside of storybook
|
|
33
|
+
// <Grommet theme={...}>
|
|
34
|
+
React.createElement(Box, {
|
|
35
|
+
align: "center",
|
|
36
|
+
justify: "center",
|
|
37
|
+
background: "dark-1",
|
|
38
|
+
fill: true,
|
|
39
|
+
gap: "large"
|
|
40
|
+
}, /*#__PURE__*/React.createElement(Heading, {
|
|
41
|
+
textAlign: "center",
|
|
42
|
+
level: "1",
|
|
43
|
+
size: "xsmall"
|
|
44
|
+
}, "Tooltip is styled with a Caret"), /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(Box, {
|
|
45
|
+
fill: true,
|
|
46
|
+
direction: "row",
|
|
47
|
+
justify: "between"
|
|
48
|
+
}, /*#__PURE__*/React.createElement(Tip, {
|
|
49
|
+
dropProps: {
|
|
50
|
+
align: {
|
|
51
|
+
left: 'right'
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
content: /*#__PURE__*/React.createElement(TipContent, {
|
|
55
|
+
message: "Designed with an SVG of Caret"
|
|
56
|
+
}),
|
|
57
|
+
plain: true
|
|
58
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
59
|
+
icon: /*#__PURE__*/React.createElement(Trash, null),
|
|
60
|
+
plain: false
|
|
61
|
+
}))))) // </Grommet>
|
|
62
|
+
|
|
63
|
+
);
|
|
64
|
+
};
|
|
65
|
+
Caret.args = {
|
|
66
|
+
full: true
|
|
61
67
|
};
|
|
62
68
|
Caret.parameters = {
|
|
63
69
|
chromatic: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Anchor, Box, DataTable, Heading, Paragraph, Text, Tip } from 'grommet';
|
|
3
3
|
import { Trash } from "grommet-icons/es6/icons/Trash";
|
|
4
4
|
import { Refresh } from "grommet-icons/es6/icons/Refresh";
|
|
5
5
|
import { Info } from "grommet-icons/es6/icons/Info"; // Source code for the data can be found here
|
|
@@ -37,68 +37,74 @@ export var HeaderActions = function HeaderActions() {
|
|
|
37
37
|
setSelected(undefined);
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
-
return
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}, /*#__PURE__*/React.createElement(Paragraph, {
|
|
51
|
-
textAlign: "center"
|
|
52
|
-
}, /*#__PURE__*/React.createElement("b", null, "Follow"), " the Tips of the Trash & Reload icons for directions. Those Tooltips ", /*#__PURE__*/React.createElement("b", null, "change"), " according to the actions the user perform on the table. The Table meters are also using the Tip component."), /*#__PURE__*/React.createElement(Box, {
|
|
53
|
-
gap: "small"
|
|
54
|
-
}, /*#__PURE__*/React.createElement(Box, {
|
|
55
|
-
fill: true,
|
|
56
|
-
direction: "row",
|
|
57
|
-
justify: "between",
|
|
58
|
-
align: "center"
|
|
59
|
-
}, /*#__PURE__*/React.createElement(Heading, {
|
|
60
|
-
level: 2
|
|
61
|
-
}, " Storage Pools with tooltips"), /*#__PURE__*/React.createElement(Box, {
|
|
62
|
-
gap: "small",
|
|
63
|
-
direction: "row"
|
|
64
|
-
}, /*#__PURE__*/React.createElement(Tip, {
|
|
65
|
-
dropProps: {
|
|
66
|
-
align: {
|
|
67
|
-
bottom: 'top'
|
|
40
|
+
return (
|
|
41
|
+
/*#__PURE__*/
|
|
42
|
+
// Uncomment <Grommet> lines when using outside of storybook
|
|
43
|
+
// <Grommet theme={...}>
|
|
44
|
+
React.createElement(Box, {
|
|
45
|
+
align: "center",
|
|
46
|
+
background: "dark-1",
|
|
47
|
+
gap: "large",
|
|
48
|
+
height: {
|
|
49
|
+
min: '100%'
|
|
68
50
|
}
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
51
|
+
}, /*#__PURE__*/React.createElement(Paragraph, {
|
|
52
|
+
textAlign: "center"
|
|
53
|
+
}, /*#__PURE__*/React.createElement("b", null, "Follow"), " the Tips of the Trash & Reload icons for directions. Those Tooltips ", /*#__PURE__*/React.createElement("b", null, "change"), " according to the actions the user perform on the table. The Table meters are also using the Tip component."), /*#__PURE__*/React.createElement(Box, {
|
|
54
|
+
gap: "small"
|
|
55
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
56
|
+
fill: true,
|
|
57
|
+
direction: "row",
|
|
58
|
+
justify: "between",
|
|
59
|
+
align: "center"
|
|
60
|
+
}, /*#__PURE__*/React.createElement(Heading, {
|
|
61
|
+
level: 2
|
|
62
|
+
}, " Storage Pools with tooltips"), /*#__PURE__*/React.createElement(Box, {
|
|
63
|
+
gap: "small",
|
|
64
|
+
direction: "row"
|
|
65
|
+
}, /*#__PURE__*/React.createElement(Tip, {
|
|
66
|
+
dropProps: {
|
|
67
|
+
align: {
|
|
68
|
+
bottom: 'top'
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
content: /*#__PURE__*/React.createElement(TipContent, {
|
|
72
|
+
message: !selected ? 'Select a table row to enable' : 'Delete table Row',
|
|
73
|
+
icon: !selected
|
|
74
|
+
})
|
|
75
|
+
}, /*#__PURE__*/React.createElement(Anchor, {
|
|
76
|
+
disabled: !selected,
|
|
77
|
+
icon: /*#__PURE__*/React.createElement(Trash, null),
|
|
78
|
+
onClick: removeRow
|
|
79
|
+
})), /*#__PURE__*/React.createElement(Tip, {
|
|
80
|
+
dropProps: {
|
|
81
|
+
align: {
|
|
82
|
+
bottom: 'top'
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
content: /*#__PURE__*/React.createElement(TipContent, {
|
|
86
|
+
message: data.length < storageData.length ? 'Reload Data' : 'Delete items before reload action is enabled',
|
|
87
|
+
icon: !selected
|
|
88
|
+
})
|
|
89
|
+
}, /*#__PURE__*/React.createElement(Anchor, {
|
|
90
|
+
icon: /*#__PURE__*/React.createElement(Refresh, null),
|
|
91
|
+
onClick: function onClick() {
|
|
92
|
+
return setData(storageData);
|
|
93
|
+
},
|
|
94
|
+
disabled: data.length === storageData.length
|
|
95
|
+
})))), /*#__PURE__*/React.createElement(DataTable, {
|
|
96
|
+
columns: storageColumns,
|
|
97
|
+
data: data,
|
|
98
|
+
step: 10,
|
|
99
|
+
onClickRow: function onClickRow(event) {
|
|
100
|
+
return setSelected(event.datum);
|
|
82
101
|
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
icon: /*#__PURE__*/React.createElement(Refresh, null),
|
|
90
|
-
onClick: function onClick() {
|
|
91
|
-
return setData(storageData);
|
|
92
|
-
},
|
|
93
|
-
disabled: data.length === storageData.length
|
|
94
|
-
})))), /*#__PURE__*/React.createElement(DataTable, {
|
|
95
|
-
columns: storageColumns,
|
|
96
|
-
data: data,
|
|
97
|
-
step: 10,
|
|
98
|
-
onClickRow: function onClickRow(event) {
|
|
99
|
-
return setSelected(event.datum);
|
|
100
|
-
}
|
|
101
|
-
}))));
|
|
102
|
+
}))) // </Grommet>
|
|
103
|
+
|
|
104
|
+
);
|
|
105
|
+
};
|
|
106
|
+
HeaderActions.args = {
|
|
107
|
+
full: true
|
|
102
108
|
};
|
|
103
109
|
HeaderActions.parameters = {
|
|
104
110
|
chromatic: {
|
|
@@ -1,66 +1,69 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Box, Button, Text, Tip } from 'grommet';
|
|
3
3
|
import { HelpOption } from "grommet-icons/es6/icons/HelpOption";
|
|
4
4
|
import { CircleInformation } from "grommet-icons/es6/icons/CircleInformation";
|
|
5
5
|
export var Info = function Info() {
|
|
6
|
-
return
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
6
|
+
return (
|
|
7
|
+
/*#__PURE__*/
|
|
8
|
+
// Uncomment <Grommet> lines when using outside of storybook
|
|
9
|
+
// <Grommet theme={...}>
|
|
10
|
+
React.createElement(Box, {
|
|
11
|
+
fill: true,
|
|
12
|
+
background: "background-back",
|
|
13
|
+
gap: "large",
|
|
14
|
+
pad: "large",
|
|
15
|
+
align: "start"
|
|
16
|
+
}, /*#__PURE__*/React.createElement(Tip, {
|
|
17
|
+
content: /*#__PURE__*/React.createElement(Box, {
|
|
18
|
+
pad: "small",
|
|
19
|
+
gap: "small",
|
|
20
|
+
width: {
|
|
21
|
+
max: 'small'
|
|
22
|
+
}
|
|
23
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
24
|
+
weight: "bold"
|
|
25
|
+
}, "Information"), /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, {
|
|
26
|
+
size: "small"
|
|
27
|
+
}, "A battle is won by him who is firmly resolved to win it."), /*#__PURE__*/React.createElement(Text, {
|
|
28
|
+
size: "small"
|
|
29
|
+
}, "-Leo Tolstoy"))),
|
|
30
|
+
dropProps: {
|
|
31
|
+
align: {
|
|
32
|
+
left: 'right'
|
|
33
|
+
}
|
|
21
34
|
}
|
|
22
|
-
}, /*#__PURE__*/React.createElement(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
35
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
36
|
+
icon: /*#__PURE__*/React.createElement(CircleInformation, {
|
|
37
|
+
size: "large"
|
|
38
|
+
})
|
|
39
|
+
})), /*#__PURE__*/React.createElement(Tip, {
|
|
40
|
+
plain: true,
|
|
41
|
+
content: /*#__PURE__*/React.createElement(Box, {
|
|
42
|
+
pad: "small",
|
|
43
|
+
gap: "small",
|
|
44
|
+
width: {
|
|
45
|
+
max: 'small'
|
|
46
|
+
},
|
|
47
|
+
round: "small",
|
|
48
|
+
background: "background-front",
|
|
49
|
+
responsive: false
|
|
50
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
51
|
+
weight: "bold"
|
|
52
|
+
}, "Help"), /*#__PURE__*/React.createElement(Text, {
|
|
53
|
+
size: "small"
|
|
54
|
+
}, "Help is on the way! Who are you going to call?")),
|
|
55
|
+
dropProps: {
|
|
56
|
+
align: {
|
|
57
|
+
left: 'right'
|
|
58
|
+
}
|
|
32
59
|
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
content: /*#__PURE__*/React.createElement(Box, {
|
|
41
|
-
pad: "small",
|
|
42
|
-
gap: "small",
|
|
43
|
-
width: {
|
|
44
|
-
max: 'small'
|
|
45
|
-
},
|
|
46
|
-
round: "small",
|
|
47
|
-
background: "background-front",
|
|
48
|
-
responsive: false
|
|
49
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
50
|
-
weight: "bold"
|
|
51
|
-
}, "Help"), /*#__PURE__*/React.createElement(Text, {
|
|
52
|
-
size: "small"
|
|
53
|
-
}, "Help is on the way! Who are you going to call?")),
|
|
54
|
-
dropProps: {
|
|
55
|
-
align: {
|
|
56
|
-
left: 'right'
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
60
|
-
icon: /*#__PURE__*/React.createElement(HelpOption, {
|
|
61
|
-
size: "large"
|
|
62
|
-
})
|
|
63
|
-
}))));
|
|
60
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
61
|
+
icon: /*#__PURE__*/React.createElement(HelpOption, {
|
|
62
|
+
size: "large"
|
|
63
|
+
})
|
|
64
|
+
}))) // </Grommet>
|
|
65
|
+
|
|
66
|
+
);
|
|
64
67
|
};
|
|
65
68
|
Info.parameters = {
|
|
66
69
|
chromatic: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { Box, Button, Tip } from 'grommet';
|
|
4
4
|
import { UserFemale, Info } from 'grommet-icons';
|
|
5
5
|
|
|
6
6
|
const Circle = ({ ...rest }) => (
|
|
@@ -13,32 +13,37 @@ const Circle = ({ ...rest }) => (
|
|
|
13
13
|
);
|
|
14
14
|
|
|
15
15
|
export const Animated = () => (
|
|
16
|
-
<Grommet
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
</
|
|
16
|
+
// Uncomment <Grommet> lines when using outside of storybook
|
|
17
|
+
// <Grommet theme={...}>
|
|
18
|
+
<Box align="center" justify="center" fill background="dark-1" gap="medium">
|
|
19
|
+
<Tip
|
|
20
|
+
plain
|
|
21
|
+
dropProps={{ align: { left: 'right' } }}
|
|
22
|
+
content={
|
|
23
|
+
<Box align="start" margin={{ bottom: 'xlarge' }} pad="xsmall">
|
|
24
|
+
<Circle margin={{ left: 'large' }} pad="small">
|
|
25
|
+
<Info color="accent-1" />
|
|
26
|
+
</Circle>
|
|
27
|
+
<Circle margin={{ left: 'medium' }} pad="small" />
|
|
28
|
+
<Circle pad="xsmall" />
|
|
29
|
+
</Box>
|
|
30
|
+
}
|
|
31
|
+
>
|
|
32
|
+
<Button icon={<UserFemale color="accent-1" size="large" />} />
|
|
33
|
+
</Tip>
|
|
34
|
+
Double animation of 'fadeIn' and 'pulse'
|
|
35
|
+
</Box>
|
|
36
|
+
// </Grommet>
|
|
36
37
|
);
|
|
37
38
|
|
|
38
39
|
Animated.parameters = {
|
|
39
40
|
chromatic: { disable: true },
|
|
40
41
|
};
|
|
41
42
|
|
|
43
|
+
Animated.args = {
|
|
44
|
+
full: true,
|
|
45
|
+
};
|
|
46
|
+
|
|
42
47
|
export default {
|
|
43
48
|
title: 'Controls/Tip/Animated',
|
|
44
49
|
};
|