@pareto-engineering/design-system 2.0.0-alpha.43 → 2.0.0-alpha.46

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 (89) hide show
  1. package/.env.scripts.example +4 -0
  2. package/.eslintrc.js +25 -1
  3. package/babel.config.js +1 -0
  4. package/dist/cjs/f/FormInput/FormInput.js +13 -3
  5. package/dist/cjs/f/FormInput/styles.scss +11 -0
  6. package/dist/cjs/f/fields/QueryCombobox/QueryCombobox.js +214 -0
  7. package/dist/cjs/f/fields/QueryCombobox/common/Combobox/Combobox.js +194 -0
  8. package/dist/cjs/f/fields/QueryCombobox/common/Combobox/index.js +15 -0
  9. package/dist/cjs/f/fields/QueryCombobox/common/Menu/Menu.js +103 -0
  10. package/dist/cjs/f/fields/QueryCombobox/common/Menu/index.js +15 -0
  11. package/dist/cjs/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +281 -0
  12. package/dist/cjs/f/fields/QueryCombobox/common/MultipleCombobox/index.js +15 -0
  13. package/dist/cjs/f/fields/QueryCombobox/common/index.js +21 -0
  14. package/dist/cjs/f/fields/QueryCombobox/index.js +15 -0
  15. package/dist/cjs/f/fields/QueryCombobox/styles.scss +84 -0
  16. package/dist/cjs/f/fields/SelectInput/SelectInput.js +0 -1
  17. package/dist/cjs/f/fields/SelectInput/styles.scss +8 -6
  18. package/dist/cjs/f/fields/index.js +9 -1
  19. package/dist/cjs/index.js +13 -0
  20. package/dist/cjs/test/QueryLoader/QueryLoader.js +41 -0
  21. package/dist/cjs/test/QueryLoader/__generated__/QueryLoaderHelloQuery.graphql.js +71 -0
  22. package/dist/cjs/test/QueryLoader/common/PreloadedTestData/PreloadedTestData.js +49 -0
  23. package/dist/cjs/test/QueryLoader/common/PreloadedTestData/index.js +15 -0
  24. package/dist/cjs/test/QueryLoader/common/index.js +13 -0
  25. package/dist/cjs/test/QueryLoader/index.js +15 -0
  26. package/dist/cjs/test/QueryLoader/styles.scss +9 -0
  27. package/dist/cjs/test/index.js +13 -0
  28. package/dist/es/f/FormInput/FormInput.js +13 -3
  29. package/dist/es/f/FormInput/styles.scss +11 -0
  30. package/dist/es/f/fields/QueryCombobox/QueryCombobox.js +191 -0
  31. package/dist/es/f/fields/QueryCombobox/common/Combobox/Combobox.js +174 -0
  32. package/dist/es/f/fields/QueryCombobox/common/Combobox/index.js +2 -0
  33. package/dist/es/f/fields/QueryCombobox/common/Menu/Menu.js +77 -0
  34. package/dist/es/f/fields/QueryCombobox/common/Menu/index.js +2 -0
  35. package/dist/es/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +253 -0
  36. package/dist/es/f/fields/QueryCombobox/common/MultipleCombobox/index.js +2 -0
  37. package/dist/es/f/fields/QueryCombobox/common/index.js +2 -0
  38. package/dist/es/f/fields/QueryCombobox/index.js +2 -0
  39. package/dist/es/f/fields/QueryCombobox/styles.scss +84 -0
  40. package/dist/es/f/fields/SelectInput/SelectInput.js +0 -1
  41. package/dist/es/f/fields/SelectInput/styles.scss +8 -6
  42. package/dist/es/f/fields/index.js +2 -1
  43. package/dist/es/index.js +2 -1
  44. package/dist/es/test/QueryLoader/QueryLoader.js +29 -0
  45. package/dist/es/test/QueryLoader/__generated__/QueryLoaderHelloQuery.graphql.js +71 -0
  46. package/dist/es/test/QueryLoader/common/PreloadedTestData/PreloadedTestData.js +31 -0
  47. package/dist/es/test/QueryLoader/common/PreloadedTestData/index.js +2 -0
  48. package/dist/es/test/QueryLoader/common/index.js +1 -0
  49. package/dist/es/test/QueryLoader/index.js +2 -0
  50. package/dist/es/test/QueryLoader/styles.scss +9 -0
  51. package/dist/es/test/index.js +1 -0
  52. package/package.json +16 -3
  53. package/relay.config.js +12 -0
  54. package/schema.graphql +4075 -0
  55. package/scripts/fetchSchema.js +74 -0
  56. package/src/__snapshots__/Storyshots.test.js.snap +323 -8
  57. package/src/stories/f/FormInput.stories.jsx +115 -0
  58. package/src/stories/f/QueryCombobox.stories.jsx +220 -0
  59. package/src/stories/f/__generated__/FormInputAllTeamsQuery.graphql.js +139 -0
  60. package/src/stories/f/__generated__/QueryComboboxAllTeamsQuery.graphql.js +139 -0
  61. package/src/stories/test/QueryLoader.stories.jsx +36 -0
  62. package/src/stories/utils/generateNodeId.js +12 -0
  63. package/src/stories/utils/relay/EnvironmentProvider.jsx +14 -0
  64. package/src/stories/utils/relay/environment.js +5 -0
  65. package/src/stories/utils/relay/index.js +4 -0
  66. package/src/stories/utils/relay/mockRelayOperation.js +14 -0
  67. package/src/stories/utils/relay/mockResolvers.js +299 -0
  68. package/src/stories/utils/testData.js +63 -0
  69. package/src/ui/f/FormInput/FormInput.jsx +16 -1
  70. package/src/ui/f/FormInput/styles.scss +11 -0
  71. package/src/ui/f/fields/QueryCombobox/QueryCombobox.jsx +207 -0
  72. package/src/ui/f/fields/QueryCombobox/common/Combobox/Combobox.jsx +214 -0
  73. package/src/ui/f/fields/QueryCombobox/common/Combobox/index.js +2 -0
  74. package/src/ui/f/fields/QueryCombobox/common/Menu/Menu.jsx +103 -0
  75. package/src/ui/f/fields/QueryCombobox/common/Menu/index.js +2 -0
  76. package/src/ui/f/fields/QueryCombobox/common/index.js +2 -0
  77. package/src/ui/f/fields/QueryCombobox/index.js +2 -0
  78. package/src/ui/f/fields/QueryCombobox/styles.scss +84 -0
  79. package/src/ui/f/fields/SelectInput/SelectInput.jsx +1 -1
  80. package/src/ui/f/fields/SelectInput/styles.scss +8 -6
  81. package/src/ui/f/fields/index.js +1 -0
  82. package/src/ui/index.js +1 -0
  83. package/src/ui/test/QueryLoader/QueryLoader.jsx +41 -0
  84. package/src/ui/test/QueryLoader/__generated__/QueryLoaderHelloQuery.graphql.js +68 -0
  85. package/src/ui/test/QueryLoader/common/PreloadedTestData/PreloadedTestData.jsx +51 -0
  86. package/src/ui/test/QueryLoader/common/PreloadedTestData/index.js +2 -0
  87. package/src/ui/test/QueryLoader/common/index.js +1 -0
  88. package/src/ui/test/QueryLoader/index.js +2 -0
  89. package/src/ui/test/index.js +1 -0
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "PreloadedTestData", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _PreloadedTestData.PreloadedTestData;
10
+ }
11
+ });
12
+
13
+ var _PreloadedTestData = require("./PreloadedTestData");
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "QueryLoader", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _QueryLoader.default;
10
+ }
11
+ });
12
+
13
+ var _QueryLoader = _interopRequireDefault(require("./QueryLoader"));
14
+
15
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -0,0 +1,9 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ @use "@pareto-engineering/bem";
3
+
4
+ .#{bem.$base}.query-loader{
5
+
6
+ }
7
+
8
+
9
+
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "QueryLoader", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _QueryLoader.QueryLoader;
10
+ }
11
+ });
12
+
13
+ var _QueryLoader = require("./QueryLoader");
@@ -2,9 +2,9 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
2
2
 
3
3
  /* @pareto-engineering/generator-front 1.0.12 */
4
4
  import * as React from 'react';
5
- import { memo } from 'react';
5
+ import { memo, useLayoutEffect } from 'react';
6
6
  import PropTypes from 'prop-types';
7
- import { TextInput, TextareaInput, ChoicesInput, SelectInput } from "../fields"; // Local Definitions
7
+ import { TextInput, TextareaInput, ChoicesInput, SelectInput, QueryCombobox } from "../fields"; // Local Definitions
8
8
  // const baseClassName = styleNames.base
9
9
 
10
10
  const componentClassName = 'form-input';
@@ -19,6 +19,9 @@ const FormInput = ({
19
19
  disabled,
20
20
  ...otherProps
21
21
  }) => {
22
+ useLayoutEffect(() => {
23
+ import("./styles.scss");
24
+ }, []);
22
25
  const newClassName = [className, componentClassName].filter(Boolean).join(' ');
23
26
 
24
27
  if (type === 'textarea') {
@@ -42,6 +45,13 @@ const FormInput = ({
42
45
  }, otherProps));
43
46
  }
44
47
 
48
+ if (type === 'query-combobox') {
49
+ return /*#__PURE__*/React.createElement(QueryCombobox, _extends({
50
+ className: newClassName,
51
+ disabled: disabled
52
+ }, otherProps));
53
+ }
54
+
45
55
  if (extraTypes !== null && extraTypes !== void 0 && extraTypes[type]) {
46
56
  const Component = extraTypes[type];
47
57
  return /*#__PURE__*/React.createElement(Component, _extends({
@@ -66,7 +76,7 @@ FormInput.propTypes = {
66
76
  /**
67
77
  * The HTML class names for this element
68
78
  */
69
- type: PropTypes.oneOf(['text', 'email', 'password', 'number', 'date', 'datetime', 'month', 'tel', 'hidden', 'select', 'choices', 'textarea', // to be removed
79
+ type: PropTypes.oneOf(['text', 'email', 'password', 'number', 'date', 'datetime', 'month', 'tel', 'hidden', 'select', 'choices', 'textarea', 'query-combobox', // to be removed
70
80
  'extendedTypeInput']),
71
81
 
72
82
  /**
@@ -0,0 +1,11 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+
3
+ @use "@pareto-engineering/bem";
4
+
5
+ $default-margin: 1em;
6
+
7
+ .#{bem.$base}.form-input {
8
+ &+& {
9
+ margin-top: $default-margin;
10
+ }
11
+ }
@@ -0,0 +1,191 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ import * as React from 'react';
3
+ import { useState, useLayoutEffect } from 'react';
4
+ import { useField } from 'formik';
5
+ import { useRelayEnvironment, fetchQuery } from 'react-relay';
6
+ import PropTypes from 'prop-types'; // Local Definitions
7
+
8
+ import { Combobox } from "./common";
9
+ /**
10
+ * This is the component description.
11
+ */
12
+
13
+ const QueryCombobox = ({
14
+ id,
15
+ style,
16
+ className,
17
+ query,
18
+ // multiple,
19
+ name,
20
+ label,
21
+ color,
22
+ description,
23
+ disabled,
24
+ debounceMs,
25
+ graphQlNode,
26
+ searchVariable,
27
+ extraVariables,
28
+ optionsKeyMap // ...otherProps
29
+
30
+ }) => {
31
+ useLayoutEffect(() => {
32
+ import("./styles.scss");
33
+ }, []);
34
+ const [, meta, helpers] = useField(name);
35
+ const {
36
+ setValue,
37
+ setError
38
+ } = helpers;
39
+ const {
40
+ error,
41
+ value
42
+ } = meta;
43
+ const environment = useRelayEnvironment();
44
+ const [isFetching, setIsFetching] = useState(false);
45
+ const [options, setOptions] = useState([]);
46
+
47
+ const getOptions = inputValue => {
48
+ if (isFetching) return;
49
+ let variables = {
50
+ [searchVariable]: inputValue
51
+ };
52
+
53
+ if (extraVariables) {
54
+ variables = { ...variables,
55
+ ...extraVariables
56
+ };
57
+ }
58
+
59
+ fetchQuery(environment, query, variables).subscribe({
60
+ start: () => {
61
+ setIsFetching(true);
62
+ },
63
+ complete: () => {
64
+ setIsFetching(false);
65
+ },
66
+ error: fetchError => {
67
+ setIsFetching(false);
68
+ if (setError) setError(fetchError.message);
69
+ },
70
+ next: data => {
71
+ setOptions(data[graphQlNode].edges.map(({
72
+ node
73
+ }) => ({
74
+ value: node[optionsKeyMap.value],
75
+ label: node[optionsKeyMap.label]
76
+ })));
77
+ }
78
+ });
79
+ };
80
+
81
+ const comboboxProps = {
82
+ id,
83
+ style,
84
+ options,
85
+ getOptions,
86
+ debounceMs,
87
+ disabled,
88
+ name,
89
+ label,
90
+ description,
91
+ setValue,
92
+ error,
93
+ value,
94
+ color,
95
+ isFetching,
96
+ className
97
+ };
98
+ const Input = Combobox;
99
+ return /*#__PURE__*/React.createElement(Input, comboboxProps);
100
+ };
101
+
102
+ QueryCombobox.propTypes = {
103
+ /**
104
+ * The HTML id for this element
105
+ */
106
+ id: PropTypes.string,
107
+
108
+ /**
109
+ * The HTML class names for this element
110
+ */
111
+ className: PropTypes.string,
112
+
113
+ /**
114
+ * The React-written, css properties for this element.
115
+ */
116
+ style: PropTypes.objectOf(PropTypes.string),
117
+
118
+ /**
119
+ * The name of the custom select input
120
+ */
121
+ name: PropTypes.string,
122
+
123
+ /**
124
+ * The label of the custom select input
125
+ */
126
+ label: PropTypes.string,
127
+
128
+ /**
129
+ * The custom select input description
130
+ */
131
+ description: PropTypes.string,
132
+
133
+ /**
134
+ * Whether the input should be disabled
135
+ */
136
+ disabled: PropTypes.bool,
137
+
138
+ /**
139
+ * The base color of the custom select input
140
+ */
141
+ color: PropTypes.string,
142
+
143
+ /**
144
+ * The debounce time in milliseconds
145
+ */
146
+ debounceMs: PropTypes.number,
147
+
148
+ /**
149
+ * The query to fetch the options
150
+ */
151
+ query: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired,
152
+
153
+ /**
154
+ * The extra variables required to be used in the query.
155
+ */
156
+ extraVariables: PropTypes.objectOf(PropTypes.string),
157
+
158
+ /**
159
+ * The select option keys to be used to map the data to the select options.
160
+ * i.e `{ value: 'id', label: 'name' }`
161
+ */
162
+ optionsKeyMap: PropTypes.shape({
163
+ value: PropTypes.string.isRequired,
164
+ label: PropTypes.string.isRequired
165
+ }),
166
+
167
+ /**
168
+ * Whether to allow multiple items selection
169
+ */
170
+ multiple: PropTypes.bool,
171
+
172
+ /**
173
+ * The graphql node to be used to destructure the fetched data
174
+ */
175
+ graphQlNode: PropTypes.string.isRequired,
176
+
177
+ /**
178
+ * The variable to be used to search the data
179
+ */
180
+ searchVariable: PropTypes.string
181
+ };
182
+ QueryCombobox.defaultProps = {
183
+ optionsKeyMap: {
184
+ value: 'id',
185
+ label: 'name'
186
+ },
187
+ multiple: false,
188
+ color: 'background2',
189
+ searchVariable: 'search'
190
+ };
191
+ export default QueryCombobox;
@@ -0,0 +1,174 @@
1
+ function _extends() { _extends = Object.assign || 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); }
2
+
3
+ /* @pareto-engineering/generator-front 1.0.12 */
4
+ import * as React from 'react';
5
+ import { useEffect, useRef } from 'react';
6
+ import PropTypes from 'prop-types';
7
+ import { useCombobox } from 'downshift';
8
+ import styleNames from '@pareto-engineering/bem';
9
+ import { FormLabel, FormDescription } from "../../../..";
10
+ import { Popover, LoadingCircle } from "../../../../../a"; // Local Definitions
11
+
12
+ import { Menu } from "../Menu";
13
+ const baseClassName = styleNames.base;
14
+ const componentClassName = 'combobox';
15
+ /**
16
+ * This is the component description.
17
+ */
18
+
19
+ const Combobox = ({
20
+ id,
21
+ className: userClassName,
22
+ style,
23
+ label,
24
+ name,
25
+ options: items,
26
+ getOptions,
27
+ setValue,
28
+ error,
29
+ description,
30
+ value,
31
+ color,
32
+ loadingCircleColor,
33
+ isFetching // ...otherProps
34
+
35
+ }) => {
36
+ const {
37
+ isOpen,
38
+ selectItem,
39
+ selectedItem,
40
+ getLabelProps,
41
+ getMenuProps,
42
+ getInputProps,
43
+ highlightedIndex,
44
+ getComboboxProps,
45
+ getItemProps
46
+ } = useCombobox({
47
+ items,
48
+ initialSelectedItem: value,
49
+ itemToString: item => item ? item.label : '',
50
+ onInputValueChange: ({
51
+ inputValue
52
+ }) => {
53
+ getOptions(inputValue);
54
+ }
55
+ }); // If the user has selected an item, we'll set the value of the field
56
+ // or if the combobox state has a selected item, we'll set the value to the formik state
57
+
58
+ useEffect(() => {
59
+ if (selectedItem) {
60
+ setValue(selectedItem);
61
+ }
62
+ }, [selectedItem]); // If the formik state has a value, we'll set the selected item to the combobox state
63
+
64
+ useEffect(() => {
65
+ if ((value === null || value === void 0 ? void 0 : value.value) !== (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.value)) {
66
+ selectItem(value);
67
+ }
68
+ }, [value]);
69
+ const parentRef = useRef(null);
70
+ return /*#__PURE__*/React.createElement("div", {
71
+ id: id,
72
+ className: [baseClassName, componentClassName, userClassName, `y-${color}`, `x-${loadingCircleColor}`].filter(e => e).join(' '),
73
+ style: style,
74
+ ref: parentRef
75
+ }, /*#__PURE__*/React.createElement(FormLabel, _extends({}, getLabelProps(), {
76
+ name: name
77
+ }), label), /*#__PURE__*/React.createElement("div", _extends({}, getComboboxProps(), {
78
+ className: "input-wrapper"
79
+ }), /*#__PURE__*/React.createElement("input", _extends({}, getInputProps(), {
80
+ className: "input"
81
+ })), isFetching && /*#__PURE__*/React.createElement(LoadingCircle, null)), /*#__PURE__*/React.createElement(Popover, {
82
+ isOpen: isOpen,
83
+ parentRef: parentRef
84
+ }, /*#__PURE__*/React.createElement(Menu, _extends({
85
+ isOpen: isOpen,
86
+ getItemProps: getItemProps,
87
+ highlightedIndex: highlightedIndex,
88
+ items: items
89
+ }, getMenuProps()))), (description || error) && /*#__PURE__*/React.createElement(FormDescription, {
90
+ isError: !!error
91
+ }, error || description));
92
+ };
93
+
94
+ Combobox.propTypes = {
95
+ /**
96
+ * The HTML id for this element
97
+ */
98
+ id: PropTypes.string,
99
+
100
+ /**
101
+ * The HTML class names for this element
102
+ */
103
+ className: PropTypes.string,
104
+
105
+ /**
106
+ * The React-written, css properties for this element.
107
+ */
108
+ style: PropTypes.objectOf(PropTypes.string),
109
+
110
+ /**
111
+ * The label of the custom select input
112
+ */
113
+ label: PropTypes.string,
114
+
115
+ /**
116
+ * The custom select input options from the backend
117
+ */
118
+ options: PropTypes.arrayOf(PropTypes.shape({
119
+ value: PropTypes.string,
120
+ label: PropTypes.string
121
+ })),
122
+
123
+ /**
124
+ * The name of the custom select input
125
+ */
126
+ name: PropTypes.string,
127
+
128
+ /**
129
+ * The function to fetch the options from the backend
130
+ */
131
+ getOptions: PropTypes.func,
132
+
133
+ /**
134
+ * The function to set the value of the custom select input
135
+ */
136
+ setValue: PropTypes.func.isRequired,
137
+
138
+ /**
139
+ * The custom select input description
140
+ */
141
+ description: PropTypes.string,
142
+
143
+ /**
144
+ * The error object
145
+ */
146
+ error: PropTypes.objectOf(PropTypes.string),
147
+
148
+ /**
149
+ * The value of the custom select input
150
+ */
151
+ value: PropTypes.shape({
152
+ value: PropTypes.string,
153
+ label: PropTypes.string
154
+ }),
155
+
156
+ /**
157
+ * The base color of the combobox custom select input
158
+ */
159
+ color: PropTypes.string,
160
+
161
+ /**
162
+ * Whether the query getting the combobox options is inFlight
163
+ */
164
+ isFetching: PropTypes.bool.isRequired,
165
+
166
+ /**
167
+ * The loading circle color
168
+ */
169
+ loadingCircleColor: PropTypes.string
170
+ };
171
+ Combobox.defaultProps = {
172
+ loadingCircleColor: 'main2'
173
+ };
174
+ export default Combobox;
@@ -0,0 +1,2 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ export { default as Combobox } from "./Combobox";
@@ -0,0 +1,77 @@
1
+ function _extends() { _extends = Object.assign || 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); }
2
+
3
+ /* @pareto-engineering/generator-front 1.0.12 */
4
+ import * as React from 'react';
5
+ import PropTypes from 'prop-types';
6
+ import styleNames from '@pareto-engineering/bem'; // Local Definitions
7
+
8
+ const baseClassName = styleNames.base;
9
+ const componentClassName = 'menu';
10
+ /**
11
+ * This is the component description.
12
+ */
13
+
14
+ const Menu = /*#__PURE__*/React.forwardRef(({
15
+ id,
16
+ className: userClassName,
17
+ style,
18
+ items,
19
+ isOpen,
20
+ highlightedIndex,
21
+ getItemProps,
22
+ ...otherProps
23
+ }, ref) => /*#__PURE__*/React.createElement("ul", _extends({
24
+ id: id,
25
+ className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
26
+ style: style,
27
+ ref: ref
28
+ }, otherProps), isOpen && items.map((item, index) => /*#__PURE__*/React.createElement("li", _extends({
29
+ key: item.label
30
+ }, getItemProps({
31
+ item,
32
+ index
33
+ }), {
34
+ className: ['item', highlightedIndex === index && styleNames.modifierActive].filter(Boolean).join(' ')
35
+ }), /*#__PURE__*/React.createElement("p", null, item.label)))));
36
+ Menu.propTypes = {
37
+ /**
38
+ * The HTML id for this element
39
+ */
40
+ id: PropTypes.string,
41
+
42
+ /**
43
+ * The HTML class names for this element
44
+ */
45
+ className: PropTypes.string,
46
+
47
+ /**
48
+ * The React-written, css properties for this element.
49
+ */
50
+ style: PropTypes.objectOf(PropTypes.string),
51
+
52
+ /**
53
+ * The items to be displayed in the menu
54
+ */
55
+ items: PropTypes.arrayOf(PropTypes.shape({
56
+ value: PropTypes.string,
57
+ label: PropTypes.string
58
+ })),
59
+
60
+ /**
61
+ * Whether or not the menu is open
62
+ */
63
+ isOpen: PropTypes.bool,
64
+
65
+ /**
66
+ * The index of the highlighted item
67
+ */
68
+ highlightedIndex: PropTypes.number,
69
+
70
+ /**
71
+ * The function to get the item props
72
+ */
73
+ getItemProps: PropTypes.func
74
+ };
75
+ Menu.defaultProps = {// someProp:false
76
+ };
77
+ export default Menu;
@@ -0,0 +1,2 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ export { default as Menu } from "./Menu";