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.
Files changed (167) hide show
  1. package/components/Button/Button.js +2 -3
  2. package/components/Chart/Chart.js +14 -6
  3. package/components/DataChart/DataChart.js +84 -21
  4. package/components/DataChart/Detail.js +8 -0
  5. package/components/DataChart/XAxis.js +19 -10
  6. package/components/DataChart/index.d.ts +10 -2
  7. package/components/DataChart/propTypes.js +2 -1
  8. package/components/DataChart/stories/Offset.js +82 -0
  9. package/components/DataChart/stories/StackedAreas.js +77 -0
  10. package/components/DataChart/stories/StackedLines.js +73 -0
  11. package/components/DateInput/DateInput.js +21 -9
  12. package/components/DateInput/index.d.ts +1 -0
  13. package/components/DateInput/propTypes.js +1 -0
  14. package/components/List/List.js +11 -2
  15. package/components/List/index.d.ts +1 -0
  16. package/components/List/propTypes.js +1 -0
  17. package/components/Markdown/Markdown.js +4 -2
  18. package/components/Menu/Menu.js +39 -12
  19. package/components/Notification/Notification.js +17 -6
  20. package/components/Notification/index.d.ts +7 -1
  21. package/components/Notification/propTypes.js +4 -1
  22. package/components/RangeInput/StyledRangeInput.js +1 -1
  23. package/components/RangeInput/stories/SimpleRange.js +2 -6
  24. package/components/Select/Select.js +44 -12
  25. package/components/Select/SelectContainer.js +22 -6
  26. package/components/Select/stories/ChildrenRender.js +37 -33
  27. package/components/Select/stories/Clear.js +7 -3
  28. package/components/Select/stories/Controlled.js +32 -28
  29. package/components/Select/stories/{CustomSearch.js → CustomThemed/CustomSearch.js} +2 -2
  30. package/components/Select/stories/Disabled.js +29 -25
  31. package/components/Select/stories/InsideFormField.js +29 -27
  32. package/components/Select/stories/LazyLoadingOptions.js +27 -25
  33. package/components/Select/stories/ManyOptions.js +47 -43
  34. package/components/Select/stories/Multiple.js +25 -21
  35. package/components/Select/stories/ObjectOptions.js +27 -25
  36. package/components/Select/stories/Search.js +62 -58
  37. package/components/Select/stories/Simple.js +26 -22
  38. package/components/Select/stories/Uncontrolled.js +24 -20
  39. package/components/Select/stories/ValueLabel.js +40 -36
  40. package/components/Select/stories/typescript/CreateOption.tsx +34 -30
  41. package/components/Sidebar/stories/Labels.js +25 -19
  42. package/components/Sidebar/stories/typescript/Simple.tsx +17 -12
  43. package/components/SkipLinks/stories/{Themed.js → CustomThemed/Themed.js} +1 -1
  44. package/components/SkipLinks/stories/Simple.js +82 -78
  45. package/components/Tab/Tab.js +6 -1
  46. package/components/Table/stories/Default.js +30 -28
  47. package/components/Table/stories/InfiniteScrollInTable.js +39 -35
  48. package/components/Table/stories/MeterInTable.js +26 -24
  49. package/components/Tag/Tag.js +17 -6
  50. package/components/Tag/index.d.ts +8 -0
  51. package/components/Tag/propTypes.js +2 -1
  52. package/components/Tag/stories/Size.js +45 -0
  53. package/components/TextArea/stories/{Themed.js → CustomThemed/Themed.js} +1 -1
  54. package/components/TextArea/stories/Fill.js +18 -16
  55. package/components/TextArea/stories/InsideFormField.js +43 -41
  56. package/components/TextArea/stories/NonResizable.js +13 -11
  57. package/components/TextArea/stories/Simple.js +13 -11
  58. package/components/TextInput/TextInput.js +5 -8
  59. package/{es6/components/TextInput/stories/typescript → components/TextInput/stories/CustomThemed}/CustomSuggestions.tsx +1 -1
  60. package/components/TextInput/stories/{Themed.js → CustomThemed/Themed.js} +1 -1
  61. package/components/TextInput/stories/DefaultSuggestion.js +20 -19
  62. package/components/TextInput/stories/Icon.js +22 -21
  63. package/components/TextInput/stories/InsideFormField.js +32 -30
  64. package/components/TextInput/stories/OnSelect.js +20 -19
  65. package/components/TextInput/stories/Password.js +30 -29
  66. package/components/TextInput/stories/Simple.js +17 -16
  67. package/components/TextInput/stories/StyledPlaceholder.js +10 -9
  68. package/components/TextInput/stories/Suggestions.js +19 -18
  69. package/components/TextInput/stories/Uncontrolled.js +18 -17
  70. package/components/TextInput/stories/WithTags.js +19 -18
  71. package/components/Tip/stories/Caret.js +37 -31
  72. package/components/Tip/stories/{ResponsiveTip.js → CustomThemed/ResponsiveTip.js} +1 -1
  73. package/components/Tip/stories/{SidebarTip.js → CustomThemed/SidebarTip.js} +1 -1
  74. package/components/Tip/stories/{typescript → CustomThemed}/Themed.tsx +1 -1
  75. package/components/Tip/stories/HeaderActions.js +66 -60
  76. package/components/Tip/stories/InfoTip.js +59 -56
  77. package/components/Tip/stories/typescript/Animated.tsx +26 -21
  78. package/components/Tip/stories/typescript/Children.tsx +52 -51
  79. package/components/Tip/stories/typescript/Simple.tsx +12 -7
  80. package/es6/components/Button/Button.js +2 -3
  81. package/es6/components/Chart/Chart.js +14 -6
  82. package/es6/components/DataChart/DataChart.js +84 -21
  83. package/es6/components/DataChart/Detail.js +7 -0
  84. package/es6/components/DataChart/XAxis.js +19 -10
  85. package/es6/components/DataChart/index.d.ts +10 -2
  86. package/es6/components/DataChart/propTypes.js +2 -1
  87. package/es6/components/DataChart/stories/Offset.js +70 -0
  88. package/es6/components/DataChart/stories/StackedAreas.js +65 -0
  89. package/es6/components/DataChart/stories/StackedLines.js +61 -0
  90. package/es6/components/DateInput/DateInput.js +21 -9
  91. package/es6/components/DateInput/index.d.ts +1 -0
  92. package/es6/components/DateInput/propTypes.js +1 -0
  93. package/es6/components/List/List.js +11 -2
  94. package/es6/components/List/index.d.ts +1 -0
  95. package/es6/components/List/propTypes.js +1 -0
  96. package/es6/components/Markdown/Markdown.js +4 -2
  97. package/es6/components/Menu/Menu.js +40 -13
  98. package/es6/components/Notification/Notification.js +18 -7
  99. package/es6/components/Notification/index.d.ts +7 -1
  100. package/es6/components/Notification/propTypes.js +4 -1
  101. package/es6/components/RangeInput/StyledRangeInput.js +1 -1
  102. package/es6/components/RangeInput/stories/SimpleRange.js +3 -6
  103. package/es6/components/Select/Select.js +44 -12
  104. package/es6/components/Select/SelectContainer.js +22 -6
  105. package/es6/components/Select/stories/ChildrenRender.js +38 -33
  106. package/es6/components/Select/stories/Clear.js +8 -4
  107. package/es6/components/Select/stories/Controlled.js +33 -28
  108. package/es6/components/Select/stories/{CustomSearch.js → CustomThemed/CustomSearch.js} +2 -2
  109. package/es6/components/Select/stories/Disabled.js +30 -25
  110. package/es6/components/Select/stories/InsideFormField.js +30 -27
  111. package/es6/components/Select/stories/LazyLoadingOptions.js +28 -25
  112. package/es6/components/Select/stories/ManyOptions.js +48 -43
  113. package/es6/components/Select/stories/Multiple.js +26 -21
  114. package/es6/components/Select/stories/ObjectOptions.js +28 -25
  115. package/es6/components/Select/stories/Search.js +63 -58
  116. package/es6/components/Select/stories/Simple.js +27 -22
  117. package/es6/components/Select/stories/Uncontrolled.js +25 -20
  118. package/es6/components/Select/stories/ValueLabel.js +41 -36
  119. package/es6/components/Select/stories/typescript/CreateOption.tsx +34 -30
  120. package/es6/components/Sidebar/stories/Labels.js +26 -20
  121. package/es6/components/Sidebar/stories/typescript/Simple.tsx +17 -12
  122. package/es6/components/SkipLinks/stories/{Themed.js → CustomThemed/Themed.js} +1 -1
  123. package/es6/components/SkipLinks/stories/Simple.js +83 -79
  124. package/es6/components/Tab/Tab.js +6 -1
  125. package/es6/components/Table/stories/Default.js +31 -28
  126. package/es6/components/Table/stories/InfiniteScrollInTable.js +40 -36
  127. package/es6/components/Table/stories/MeterInTable.js +27 -24
  128. package/es6/components/Tag/Tag.js +17 -6
  129. package/es6/components/Tag/index.d.ts +8 -0
  130. package/es6/components/Tag/propTypes.js +2 -1
  131. package/es6/components/Tag/stories/Size.js +33 -0
  132. package/es6/components/TextArea/stories/{Themed.js → CustomThemed/Themed.js} +1 -1
  133. package/es6/components/TextArea/stories/Fill.js +19 -16
  134. package/es6/components/TextArea/stories/InsideFormField.js +44 -41
  135. package/es6/components/TextArea/stories/NonResizable.js +14 -11
  136. package/es6/components/TextArea/stories/Simple.js +14 -11
  137. package/es6/components/TextInput/TextInput.js +5 -8
  138. package/{components/TextInput/stories/typescript → es6/components/TextInput/stories/CustomThemed}/CustomSuggestions.tsx +1 -1
  139. package/es6/components/TextInput/stories/{Themed.js → CustomThemed/Themed.js} +1 -1
  140. package/es6/components/TextInput/stories/DefaultSuggestion.js +21 -19
  141. package/es6/components/TextInput/stories/Icon.js +23 -21
  142. package/es6/components/TextInput/stories/InsideFormField.js +33 -30
  143. package/es6/components/TextInput/stories/OnSelect.js +21 -19
  144. package/es6/components/TextInput/stories/Password.js +31 -29
  145. package/es6/components/TextInput/stories/Simple.js +18 -16
  146. package/es6/components/TextInput/stories/StyledPlaceholder.js +11 -9
  147. package/es6/components/TextInput/stories/Suggestions.js +20 -18
  148. package/es6/components/TextInput/stories/Uncontrolled.js +19 -17
  149. package/es6/components/TextInput/stories/WithTags.js +20 -18
  150. package/es6/components/Tip/stories/Caret.js +38 -32
  151. package/es6/components/Tip/stories/{ResponsiveTip.js → CustomThemed/ResponsiveTip.js} +1 -1
  152. package/es6/components/Tip/stories/{SidebarTip.js → CustomThemed/SidebarTip.js} +1 -1
  153. package/es6/components/Tip/stories/{typescript → CustomThemed}/Themed.tsx +1 -1
  154. package/es6/components/Tip/stories/HeaderActions.js +67 -61
  155. package/es6/components/Tip/stories/InfoTip.js +60 -57
  156. package/es6/components/Tip/stories/typescript/Animated.tsx +26 -21
  157. package/es6/components/Tip/stories/typescript/Children.tsx +52 -51
  158. package/es6/components/Tip/stories/typescript/Simple.tsx +12 -7
  159. package/es6/languages/default.json +2 -1
  160. package/es6/themes/base.d.ts +34 -1
  161. package/es6/themes/base.js +39 -0
  162. package/grommet.min.js +1 -1
  163. package/grommet.min.js.map +1 -1
  164. package/languages/default.json +2 -1
  165. package/package.json +4 -4
  166. package/themes/base.d.ts +34 -1
  167. package/themes/base.js +39 -0
@@ -1,7 +1,6 @@
1
1
  import React, { useState } from 'react';
2
2
  import { FormClose } from "grommet-icons/es6/icons/FormClose";
3
- import { Box, Button, Grommet, Select, Text } from 'grommet';
4
- import { grommet } from 'grommet/themes';
3
+ import { Box, Button, Select, Text } from 'grommet';
5
4
  var allSeasons = ['S01', 'S02', 'S03', 'S04', 'S05', 'S06', 'S07', 'S08', 'S09', 'S10'];
6
5
  export var Children = function Children() {
7
6
  var _useState = useState([]),
@@ -61,43 +60,49 @@ export var Children = function Children() {
61
60
  }, option);
62
61
  };
63
62
 
64
- return /*#__PURE__*/React.createElement(Grommet, {
65
- full: true,
66
- theme: grommet
67
- }, /*#__PURE__*/React.createElement(Box, {
68
- fill: true,
69
- align: "center",
70
- justify: "center"
71
- }, /*#__PURE__*/React.createElement(Select, {
72
- closeOnChange: false,
73
- multiple: true,
74
- value: /*#__PURE__*/React.createElement(Box, {
75
- wrap: true,
76
- direction: "row",
77
- width: "small"
78
- }, selected && selected.length ? selected.map(function (index) {
79
- return renderSeason(allSeasons[index]);
80
- }) : /*#__PURE__*/React.createElement(Box, {
81
- pad: {
82
- vertical: 'xsmall',
83
- horizontal: 'small'
84
- },
85
- margin: "xsmall"
86
- }, "Select Season")),
87
- options: allSeasons,
88
- selected: selected,
89
- disabled: [2, 6],
90
- onChange: function onChange(_ref) {
91
- var nextSelected = _ref.selected;
92
- setSelected([].concat(nextSelected).sort());
93
- }
94
- }, renderOption)));
63
+ return (
64
+ /*#__PURE__*/
65
+ // Uncomment <Grommet> lines when using outside of storybook
66
+ // <Grommet theme={...}>
67
+ React.createElement(Box, {
68
+ fill: true,
69
+ align: "center",
70
+ justify: "center"
71
+ }, /*#__PURE__*/React.createElement(Select, {
72
+ closeOnChange: false,
73
+ multiple: true,
74
+ value: /*#__PURE__*/React.createElement(Box, {
75
+ wrap: true,
76
+ direction: "row",
77
+ width: "small"
78
+ }, selected && selected.length ? selected.map(function (index) {
79
+ return renderSeason(allSeasons[index]);
80
+ }) : /*#__PURE__*/React.createElement(Box, {
81
+ pad: {
82
+ vertical: 'xsmall',
83
+ horizontal: 'small'
84
+ },
85
+ margin: "xsmall"
86
+ }, "Select Season")),
87
+ options: allSeasons,
88
+ selected: selected,
89
+ disabled: [2, 6],
90
+ onChange: function onChange(_ref) {
91
+ var nextSelected = _ref.selected;
92
+ setSelected([].concat(nextSelected).sort());
93
+ }
94
+ }, renderOption)) // </Grommet>
95
+
96
+ );
95
97
  };
96
98
  Children.parameters = {
97
99
  chromatic: {
98
100
  disable: true
99
101
  }
100
102
  };
103
+ Children.args = {
104
+ full: true
105
+ };
101
106
  export default {
102
107
  title: 'Input/Select/Children'
103
108
  };
@@ -1,5 +1,5 @@
1
1
  import React, { useState } from 'react';
2
- import { Box, Grommet, Select, grommet } from 'grommet';
2
+ import { Box, Select } from 'grommet';
3
3
  var options = ['one', 'two', 'three'];
4
4
 
5
5
  var ClearTop = function ClearTop() {
@@ -26,9 +26,13 @@ var ClearTop = function ClearTop() {
26
26
  };
27
27
 
28
28
  export var Clear = function Clear() {
29
- return /*#__PURE__*/React.createElement(Grommet, {
30
- theme: grommet
31
- }, /*#__PURE__*/React.createElement(ClearTop, null));
29
+ return (
30
+ /*#__PURE__*/
31
+ // Uncomment <Grommet> lines when using outside of storybook
32
+ // <Grommet theme={...}>
33
+ React.createElement(ClearTop, null) // </Grommet>
34
+
35
+ );
32
36
  };
33
37
  Clear.parameters = {
34
38
  chromatic: {
@@ -1,6 +1,5 @@
1
1
  import React, { useState } from 'react';
2
- import { Box, Button, Grommet, Select } from 'grommet';
3
- import { grommet } from 'grommet/themes';
2
+ import { Box, Button, Select } from 'grommet';
4
3
  export var Controlled = function Controlled() {
5
4
  var options = ['one', 'two'];
6
5
 
@@ -12,32 +11,38 @@ export var Controlled = function Controlled() {
12
11
  open = _useState2[0],
13
12
  setOpen = _useState2[1];
14
13
 
15
- return /*#__PURE__*/React.createElement(Grommet, {
16
- full: true,
17
- theme: grommet
18
- }, /*#__PURE__*/React.createElement(Box, {
19
- fill: true,
20
- align: "center",
21
- justify: "start",
22
- pad: "large",
23
- gap: "small"
24
- }, /*#__PURE__*/React.createElement(Button, {
25
- onClick: function onClick() {
26
- return setOpen(!open);
27
- },
28
- label: "Control the select"
29
- }), /*#__PURE__*/React.createElement(Select, {
30
- id: "select",
31
- name: "select",
32
- placeholder: "Select",
33
- open: open,
34
- value: value,
35
- options: options,
36
- onChange: function onChange(_ref) {
37
- var option = _ref.option;
38
- return setValue(option);
39
- }
40
- })));
14
+ return (
15
+ /*#__PURE__*/
16
+ // Uncomment <Grommet> lines when using outside of storybook
17
+ // <Grommet theme={...}>
18
+ React.createElement(Box, {
19
+ fill: true,
20
+ align: "center",
21
+ justify: "start",
22
+ pad: "large",
23
+ gap: "small"
24
+ }, /*#__PURE__*/React.createElement(Button, {
25
+ onClick: function onClick() {
26
+ return setOpen(!open);
27
+ },
28
+ label: "Control the select"
29
+ }), /*#__PURE__*/React.createElement(Select, {
30
+ id: "select",
31
+ name: "select",
32
+ placeholder: "Select",
33
+ open: open,
34
+ value: value,
35
+ options: options,
36
+ onChange: function onChange(_ref) {
37
+ var option = _ref.option;
38
+ return setValue(option);
39
+ }
40
+ })) // </Grommet>
41
+
42
+ );
43
+ };
44
+ Controlled.args = {
45
+ full: true
41
46
  };
42
47
  export default {
43
48
  title: 'Input/Select/Controlled'
@@ -2,7 +2,7 @@ import React, { useRef, useState, useEffect } from 'react';
2
2
  import { FormClose } from "grommet-icons/es6/icons/FormClose";
3
3
  import { Box, Button, CheckBox, Grommet, Select, Text } from 'grommet'; // https://github.com/grommet/grommet/blob/master/src/js/components/Select/stories/theme.js
4
4
 
5
- import { theme as customSearchTheme } from './theme';
5
+ import { theme as customSearchTheme } from '../theme';
6
6
  var allContentPartners = [{
7
7
  name: 'Test Partner',
8
8
  id: '32131232'
@@ -217,5 +217,5 @@ export var CustomSearch = function CustomSearch() {
217
217
  };
218
218
  CustomSearch.storyName = 'Custom search';
219
219
  export default {
220
- title: 'Input/Select/Custom search'
220
+ title: 'Input/Select/Custom Themed/Custom search'
221
221
  };
@@ -1,6 +1,5 @@
1
1
  import React, { useState } from 'react';
2
- import { Box, Grommet, Select, Text } from 'grommet';
3
- import { grommet } from 'grommet/themes';
2
+ import { Box, Select, Text } from 'grommet';
4
3
  export var Disabled = function Disabled() {
5
4
  var options = ['one', 'two'];
6
5
 
@@ -8,29 +7,35 @@ export var Disabled = function Disabled() {
8
7
  value = _useState[0],
9
8
  setValue = _useState[1];
10
9
 
11
- return /*#__PURE__*/React.createElement(Grommet, {
12
- full: true,
13
- theme: grommet
14
- }, /*#__PURE__*/React.createElement(Box, {
15
- fill: true,
16
- align: "center",
17
- justify: "start",
18
- pad: "large",
19
- gap: "medium"
20
- }, /*#__PURE__*/React.createElement(Text, {
21
- weight: "bold"
22
- }, "Disabled"), /*#__PURE__*/React.createElement(Select, {
23
- id: "select",
24
- name: "select",
25
- placeholder: "Select",
26
- value: value,
27
- options: options,
28
- onChange: function onChange(_ref) {
29
- var option = _ref.option;
30
- return setValue(option);
31
- },
32
- disabled: true
33
- })));
10
+ return (
11
+ /*#__PURE__*/
12
+ // Uncomment <Grommet> lines when using outside of storybook
13
+ // <Grommet theme={...}>
14
+ React.createElement(Box, {
15
+ fill: true,
16
+ align: "center",
17
+ justify: "start",
18
+ pad: "large",
19
+ gap: "medium"
20
+ }, /*#__PURE__*/React.createElement(Text, {
21
+ weight: "bold"
22
+ }, "Disabled"), /*#__PURE__*/React.createElement(Select, {
23
+ id: "select",
24
+ name: "select",
25
+ placeholder: "Select",
26
+ value: value,
27
+ options: options,
28
+ onChange: function onChange(_ref) {
29
+ var option = _ref.option;
30
+ return setValue(option);
31
+ },
32
+ disabled: true
33
+ })) // </Grommet>
34
+
35
+ );
36
+ };
37
+ Disabled.args = {
38
+ full: true
34
39
  };
35
40
  export default {
36
41
  title: 'Input/Select/Disabled'
@@ -1,6 +1,5 @@
1
1
  import React, { useCallback, useState } from 'react';
2
- import { Box, Button, Form, FormField, Grommet, Select } from 'grommet';
3
- import { grommet } from 'grommet/themes';
2
+ import { Box, Button, Form, FormField, Select } from 'grommet';
4
3
  var options = [{
5
4
  label: 'option 1',
6
5
  value: 1
@@ -19,31 +18,35 @@ export var InsideFormField = function InsideFormField() {
19
18
  var onChange = useCallback(function (nextValue) {
20
19
  return setValue(nextValue);
21
20
  }, []);
22
- return /*#__PURE__*/React.createElement(Grommet, {
23
- theme: grommet
24
- }, /*#__PURE__*/React.createElement(Box, {
25
- align: "center",
26
- pad: "large"
27
- }, /*#__PURE__*/React.createElement(Form, {
28
- value: value,
29
- onChange: onChange,
30
- onSubmit: function onSubmit() {
31
- return console.log('Submit', value);
32
- }
33
- }, /*#__PURE__*/React.createElement(FormField, {
34
- label: "Label",
35
- name: "select"
36
- }, /*#__PURE__*/React.createElement(Select, {
37
- name: "select",
38
- placeholder: "placeholder",
39
- options: options,
40
- labelKey: "label",
41
- valueKey: "value"
42
- })), /*#__PURE__*/React.createElement(Button, {
43
- type: "submit",
44
- label: "Update",
45
- primary: true
46
- }))));
21
+ return (
22
+ /*#__PURE__*/
23
+ // Uncomment <Grommet> lines when using outside of storybook
24
+ // <Grommet theme={...}>
25
+ React.createElement(Box, {
26
+ align: "center",
27
+ pad: "large"
28
+ }, /*#__PURE__*/React.createElement(Form, {
29
+ value: value,
30
+ onChange: onChange,
31
+ onSubmit: function onSubmit() {
32
+ return console.log('Submit', value);
33
+ }
34
+ }, /*#__PURE__*/React.createElement(FormField, {
35
+ label: "Label",
36
+ name: "select"
37
+ }, /*#__PURE__*/React.createElement(Select, {
38
+ name: "select",
39
+ placeholder: "placeholder",
40
+ options: options,
41
+ labelKey: "label",
42
+ valueKey: "value"
43
+ })), /*#__PURE__*/React.createElement(Button, {
44
+ type: "submit",
45
+ label: "Update",
46
+ primary: true
47
+ }))) // </Grommet>
48
+
49
+ );
47
50
  };
48
51
  InsideFormField.storyName = 'Inside a FormField';
49
52
  export default {
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
- import { Box, CheckBox, Grommet, Select } from 'grommet';
3
- import { grommet } from 'grommet/themes';
2
+ import { Box, CheckBox, Select } from 'grommet';
4
3
  var dummyOptions = Array(2000).fill().map(function (_, i) {
5
4
  return "option " + i;
6
5
  }).sort(function (a, b) {
@@ -65,29 +64,33 @@ export var LazyLoadingOptions = function LazyLoadingOptions() {
65
64
  return setSelected(nextSelected);
66
65
  };
67
66
 
68
- return /*#__PURE__*/React.createElement(Grommet, {
69
- theme: grommet
70
- }, /*#__PURE__*/React.createElement(Box, {
71
- fill: true,
72
- align: "center",
73
- justify: "start",
74
- pad: "large"
75
- }, /*#__PURE__*/React.createElement(Select, {
76
- multiple: true,
77
- closeOnChange: false,
78
- placeholder: "select an option...",
79
- selected: selected,
80
- options: options,
81
- dropHeight: "medium",
82
- onMore: onMore,
83
- onClose: onClose,
84
- onChange: onChange
85
- }, function (option, index) {
86
- return /*#__PURE__*/React.createElement(Option, {
87
- value: option,
88
- selected: selected.indexOf(index) !== -1
89
- });
90
- })));
67
+ return (
68
+ /*#__PURE__*/
69
+ // Uncomment <Grommet> lines when using outside of storybook
70
+ // <Grommet theme={...}>
71
+ React.createElement(Box, {
72
+ fill: true,
73
+ align: "center",
74
+ justify: "start",
75
+ pad: "large"
76
+ }, /*#__PURE__*/React.createElement(Select, {
77
+ multiple: true,
78
+ closeOnChange: false,
79
+ placeholder: "select an option...",
80
+ selected: selected,
81
+ options: options,
82
+ dropHeight: "medium",
83
+ onMore: onMore,
84
+ onClose: onClose,
85
+ onChange: onChange
86
+ }, function (option, index) {
87
+ return /*#__PURE__*/React.createElement(Option, {
88
+ value: option,
89
+ selected: selected.indexOf(index) !== -1
90
+ });
91
+ })) // </Grommet>
92
+
93
+ );
91
94
  };
92
95
  LazyLoadingOptions.storyName = 'Lazy loading options';
93
96
  LazyLoadingOptions.parameters = {
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
- import { Box, CheckBox, Grommet, Select } from 'grommet';
3
- import { grommet } from 'grommet/themes';
2
+ import { Box, CheckBox, Select } from 'grommet';
4
3
  var Option = /*#__PURE__*/React.memo(function (_ref) {
5
4
  var value = _ref.value,
6
5
  selected = _ref.selected;
@@ -32,50 +31,53 @@ export var ManyOptions = function ManyOptions() {
32
31
  options = _React$useState2[0],
33
32
  setOptions = _React$useState2[1];
34
33
 
35
- return /*#__PURE__*/React.createElement(Grommet, {
36
- full: true,
37
- theme: grommet
38
- }, /*#__PURE__*/React.createElement(Box, {
39
- fill: true,
40
- align: "center",
41
- justify: "start",
42
- pad: "large"
43
- }, /*#__PURE__*/React.createElement(Select, {
44
- multiple: true,
45
- closeOnChange: false,
46
- placeholder: "select an option...",
47
- selected: selected,
48
- options: options,
49
- dropHeight: "medium",
50
- onClose: function onClose() {
51
- return setOptions(options.sort(function (p1, p2) {
52
- var p1Exists = selected.includes(p1);
53
- var p2Exists = selected.includes(p2);
34
+ return (
35
+ /*#__PURE__*/
36
+ // Uncomment <Grommet> lines when using outside of storybook
37
+ // <Grommet theme={...}>
38
+ React.createElement(Box, {
39
+ fill: true,
40
+ align: "center",
41
+ justify: "start",
42
+ pad: "large"
43
+ }, /*#__PURE__*/React.createElement(Select, {
44
+ multiple: true,
45
+ closeOnChange: false,
46
+ placeholder: "select an option...",
47
+ selected: selected,
48
+ options: options,
49
+ dropHeight: "medium",
50
+ onClose: function onClose() {
51
+ return setOptions(options.sort(function (p1, p2) {
52
+ var p1Exists = selected.includes(p1);
53
+ var p2Exists = selected.includes(p2);
54
+
55
+ if (!p1Exists && p2Exists) {
56
+ return 1;
57
+ }
54
58
 
55
- if (!p1Exists && p2Exists) {
56
- return 1;
57
- }
59
+ if (p1Exists && !p2Exists) {
60
+ return -1;
61
+ }
58
62
 
59
- if (p1Exists && !p2Exists) {
60
- return -1;
61
- }
63
+ return p1.localeCompare(p2, undefined, {
64
+ numeric: true,
65
+ sensitivity: 'base'
66
+ });
67
+ }));
68
+ },
69
+ onChange: function onChange(_ref2) {
70
+ var nextSelected = _ref2.selected;
71
+ setSelected(nextSelected);
72
+ }
73
+ }, function (option, index) {
74
+ return /*#__PURE__*/React.createElement(Option, {
75
+ value: option,
76
+ selected: selected.indexOf(index) !== -1
77
+ });
78
+ })) // </Grommet>
62
79
 
63
- return p1.localeCompare(p2, undefined, {
64
- numeric: true,
65
- sensitivity: 'base'
66
- });
67
- }));
68
- },
69
- onChange: function onChange(_ref2) {
70
- var nextSelected = _ref2.selected;
71
- setSelected(nextSelected);
72
- }
73
- }, function (option, index) {
74
- return /*#__PURE__*/React.createElement(Option, {
75
- value: option,
76
- selected: selected.indexOf(index) !== -1
77
- });
78
- })));
80
+ );
79
81
  };
80
82
  ManyOptions.storyName = 'Many options';
81
83
  ManyOptions.parameters = {
@@ -83,6 +85,9 @@ ManyOptions.parameters = {
83
85
  disable: true
84
86
  }
85
87
  };
88
+ ManyOptions.args = {
89
+ full: true
90
+ };
86
91
  export default {
87
92
  title: 'Input/Select/Many options'
88
93
  };
@@ -1,37 +1,42 @@
1
1
  import React, { useState } from 'react';
2
- import { Box, Grommet, Select } from 'grommet';
3
- import { grommet } from 'grommet/themes';
2
+ import { Box, Select } from 'grommet';
4
3
  var options = ['one', 'two'];
5
4
  export var Multiple = function Multiple() {
6
5
  var _useState = useState(['one']),
7
6
  value = _useState[0],
8
7
  setValue = _useState[1];
9
8
 
10
- return /*#__PURE__*/React.createElement(Grommet, {
11
- full: true,
12
- theme: grommet
13
- }, /*#__PURE__*/React.createElement(Box, {
14
- fill: true,
15
- align: "center",
16
- justify: "start",
17
- pad: "large"
18
- }, /*#__PURE__*/React.createElement(Select, {
19
- placeholder: "Select",
20
- multiple: true,
21
- closeOnChange: false,
22
- value: value,
23
- options: options,
24
- onChange: function onChange(_ref) {
25
- var nextValue = _ref.value;
26
- return setValue(nextValue);
27
- }
28
- })));
9
+ return (
10
+ /*#__PURE__*/
11
+ // Uncomment <Grommet> lines when using outside of storybook
12
+ // <Grommet theme={...}>
13
+ React.createElement(Box, {
14
+ fill: true,
15
+ align: "center",
16
+ justify: "start",
17
+ pad: "large"
18
+ }, /*#__PURE__*/React.createElement(Select, {
19
+ placeholder: "Select",
20
+ multiple: true,
21
+ closeOnChange: false,
22
+ value: value,
23
+ options: options,
24
+ onChange: function onChange(_ref) {
25
+ var nextValue = _ref.value;
26
+ return setValue(nextValue);
27
+ }
28
+ })) // </Grommet>
29
+
30
+ );
29
31
  };
30
32
  Multiple.parameters = {
31
33
  chromatic: {
32
34
  disable: true
33
35
  }
34
36
  };
37
+ Multiple.args = {
38
+ full: true
39
+ };
35
40
  export default {
36
41
  title: 'Input/Select/Multiple'
37
42
  };
@@ -1,6 +1,5 @@
1
1
  import React, { useState } from 'react';
2
- import { Box, Grommet, Select } from 'grommet';
3
- import { grommet } from 'grommet/themes';
2
+ import { Box, Select } from 'grommet';
4
3
  var objectOptions = [{
5
4
  label: 'Male',
6
5
  value: 1
@@ -19,29 +18,33 @@ export var ObjectOptions = function ObjectOptions() {
19
18
  value = _useState[0],
20
19
  setValue = _useState[1];
21
20
 
22
- return /*#__PURE__*/React.createElement(Grommet, {
23
- theme: grommet
24
- }, /*#__PURE__*/React.createElement(Box, {
25
- fill: true,
26
- align: "center",
27
- justify: "start",
28
- pad: "large"
29
- }, /*#__PURE__*/React.createElement(Select, {
30
- id: "select",
31
- name: "select",
32
- placeholder: "Select",
33
- labelKey: "label",
34
- valueKey: {
35
- key: 'value',
36
- reduce: true
37
- },
38
- value: value,
39
- options: objectOptions,
40
- onChange: function onChange(_ref) {
41
- var nextValue = _ref.value;
42
- return setValue(nextValue);
43
- }
44
- })));
21
+ return (
22
+ /*#__PURE__*/
23
+ // Uncomment <Grommet> lines when using outside of storybook
24
+ // <Grommet theme={...}>
25
+ React.createElement(Box, {
26
+ fill: true,
27
+ align: "center",
28
+ justify: "start",
29
+ pad: "large"
30
+ }, /*#__PURE__*/React.createElement(Select, {
31
+ id: "select",
32
+ name: "select",
33
+ placeholder: "Select",
34
+ labelKey: "label",
35
+ valueKey: {
36
+ key: 'value',
37
+ reduce: true
38
+ },
39
+ value: value,
40
+ options: objectOptions,
41
+ onChange: function onChange(_ref) {
42
+ var nextValue = _ref.value;
43
+ return setValue(nextValue);
44
+ }
45
+ })) // </Grommet>
46
+
47
+ );
45
48
  };
46
49
  ObjectOptions.storyName = 'Object options';
47
50
  ObjectOptions.parameters = {