@pareto-engineering/design-system 4.0.0-alpha.69 → 4.0.0-alpha.70
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/.storybook/preview.js +29 -12
- package/dist/cjs/a/AnimatedGradient/AnimatedGradient.js +0 -1
- package/dist/cjs/a/AnimatedGradient/webGIRenderer.js +0 -1
- package/dist/cjs/a/AppContext/ContextProvider.js +2 -0
- package/dist/cjs/a/ProgressBar/ProgressBar.js +0 -1
- package/dist/cjs/a/XMLEditor/XMLEditor.js +115 -0
- package/dist/cjs/a/XMLEditor/common/index.js +13 -0
- package/dist/cjs/a/XMLEditor/common/theme.js +186 -0
- package/dist/cjs/a/XMLEditor/index.js +13 -0
- package/dist/cjs/a/XMLEditor/styles.scss +17 -0
- package/dist/cjs/a/index.js +8 -1
- package/dist/cjs/b/Logo/Logo.js +0 -1
- package/dist/cjs/b/Title/Title.js +0 -1
- package/dist/cjs/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +2 -0
- package/dist/cjs/c/ContentSlides/common/Sidebar/Sidebar.js +2 -0
- package/dist/cjs/c/SocialMediaShareButton/SocialMediaShareButton.js +0 -2
- package/dist/cjs/f/FormInput/FormInput.js +2 -0
- package/dist/cjs/f/fields/QueryCombobox/QueryCombobox.js +11 -1
- package/dist/cjs/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +32 -3
- package/dist/cjs/r/common/PrivateRoute/PrivateRoute.js +0 -1
- package/dist/cjs/test/QueryLoader/__generated__/QueryLoaderHelloQuery.graphql.js +0 -1
- package/dist/es/a/AnimatedGradient/AnimatedGradient.js +0 -1
- package/dist/es/a/AnimatedGradient/webGIRenderer.js +0 -1
- package/dist/es/a/BlurOverlay/BlurOverlay.js +0 -1
- package/dist/es/a/DotInfo/DotInfo.js +0 -1
- package/dist/es/a/ProgressBar/ProgressBar.js +0 -1
- package/dist/es/a/XMLEditor/XMLEditor.js +106 -0
- package/dist/es/a/XMLEditor/common/index.js +1 -0
- package/dist/es/a/XMLEditor/common/theme.js +180 -0
- package/dist/es/a/XMLEditor/index.js +1 -0
- package/dist/es/a/XMLEditor/styles.scss +17 -0
- package/dist/es/a/index.js +2 -1
- package/dist/es/b/Logo/Logo.js +0 -1
- package/dist/es/b/Title/Title.js +0 -1
- package/dist/es/c/SocialMediaShareButton/SocialMediaShareButton.js +0 -2
- package/dist/es/f/fields/QueryCombobox/QueryCombobox.js +11 -1
- package/dist/es/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +32 -3
- package/dist/es/r/common/PrivateRoute/PrivateRoute.js +0 -1
- package/dist/es/test/QueryLoader/__generated__/QueryLoaderHelloQuery.graphql.js +0 -1
- package/package.json +6 -4
- package/src/stories/StyleGuide/ai-icons.stories.mdx +27 -0
- package/src/stories/StyleGuide/icons.stories.mdx +22 -22
- package/src/stories/a/CodeEditor.stories.jsx +21 -0
- package/src/stories/f/QueryCombobox.stories.jsx +22 -0
- package/src/ui/a/XMLEditor/XMLEditor.jsx +171 -0
- package/src/ui/a/XMLEditor/common/index.js +1 -0
- package/src/ui/a/XMLEditor/common/theme.jsx +184 -0
- package/src/ui/a/XMLEditor/index.js +1 -0
- package/src/ui/a/XMLEditor/styles.scss +17 -0
- package/src/ui/a/index.js +1 -0
- package/src/ui/f/fields/QueryCombobox/QueryCombobox.jsx +12 -0
- package/src/ui/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.jsx +38 -1
- package/tests/__snapshots__/Storyshots.test.js.snap +166 -25
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/* eslint-disable import/no-extraneous-dependencies */
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useEffect, useRef } from 'react';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import { EditorState } from '@codemirror/state';
|
|
6
|
+
import { EditorView, keymap, lineNumbers, drawSelection, dropCursor, highlightActiveLine, highlightActiveLineGutter, highlightSpecialChars, crosshairCursor, rectangularSelection } from '@codemirror/view';
|
|
7
|
+
import { defaultKeymap, indentWithTab } from '@codemirror/commands';
|
|
8
|
+
import {
|
|
9
|
+
// indentOnInput,
|
|
10
|
+
bracketMatching, foldGutter } from '@codemirror/language';
|
|
11
|
+
import { xml } from '@codemirror/lang-xml';
|
|
12
|
+
import styleNames from '@pareto-engineering/bem/exports';
|
|
13
|
+
import { theme } from "./common";
|
|
14
|
+
import "./styles.scss";
|
|
15
|
+
const baseClassName = styleNames.base;
|
|
16
|
+
const componentClassName = 'code-editor';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* codemirror documentation:
|
|
20
|
+
* https://codemirror.net/
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
const XMLEditor = ({
|
|
24
|
+
id,
|
|
25
|
+
className: userClassName,
|
|
26
|
+
style,
|
|
27
|
+
readOnly,
|
|
28
|
+
height,
|
|
29
|
+
gutterWidth,
|
|
30
|
+
config,
|
|
31
|
+
onChange
|
|
32
|
+
}) => {
|
|
33
|
+
const editorRef = useRef();
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
const startState = EditorState.create({
|
|
36
|
+
doc: config,
|
|
37
|
+
extensions: [keymap.of([defaultKeymap, indentWithTab]),
|
|
38
|
+
// TOFIX: Indent with tab prevents indentOnInout from working.
|
|
39
|
+
// indentOnInput(),
|
|
40
|
+
lineNumbers(), bracketMatching(), foldGutter(), drawSelection(), highlightActiveLine(), highlightActiveLineGutter(), highlightSpecialChars(), dropCursor(), rectangularSelection(), crosshairCursor(), xml(), theme, EditorState.readOnly.of(readOnly), EditorView.updateListener.of(view => {
|
|
41
|
+
onChange(view);
|
|
42
|
+
// view.state.doc.toString() to receive the current content in the editor.
|
|
43
|
+
})]
|
|
44
|
+
});
|
|
45
|
+
const view = new EditorView({
|
|
46
|
+
state: startState,
|
|
47
|
+
parent: editorRef.current
|
|
48
|
+
});
|
|
49
|
+
return () => {
|
|
50
|
+
view.destroy();
|
|
51
|
+
};
|
|
52
|
+
}, [editorRef]);
|
|
53
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
54
|
+
id: id,
|
|
55
|
+
ref: editorRef,
|
|
56
|
+
className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
|
|
57
|
+
style: {
|
|
58
|
+
'--height': height,
|
|
59
|
+
'--gutter-width': gutterWidth,
|
|
60
|
+
...style
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
XMLEditor.propTypes = {
|
|
65
|
+
/**
|
|
66
|
+
* The HTML id for this element
|
|
67
|
+
*/
|
|
68
|
+
id: PropTypes.string,
|
|
69
|
+
/**
|
|
70
|
+
* The HTML class names for this element
|
|
71
|
+
*/
|
|
72
|
+
className: PropTypes.string,
|
|
73
|
+
/**
|
|
74
|
+
* The React-written, css properties for this element.
|
|
75
|
+
*/
|
|
76
|
+
style: PropTypes.objectOf(PropTypes.string),
|
|
77
|
+
/**
|
|
78
|
+
* Whether or not the content is read only.
|
|
79
|
+
*/
|
|
80
|
+
readOnly: PropTypes.bool,
|
|
81
|
+
/**
|
|
82
|
+
* The initial labeling configuration.
|
|
83
|
+
*/
|
|
84
|
+
config: PropTypes.string,
|
|
85
|
+
/**
|
|
86
|
+
* The height of the editor.
|
|
87
|
+
*/
|
|
88
|
+
height: PropTypes.string,
|
|
89
|
+
/**
|
|
90
|
+
* The callback for when the labeling configuration changes.
|
|
91
|
+
*/
|
|
92
|
+
onChange: PropTypes.func,
|
|
93
|
+
/**
|
|
94
|
+
* The width of the gutter.
|
|
95
|
+
*/
|
|
96
|
+
gutterWidth: PropTypes.string
|
|
97
|
+
};
|
|
98
|
+
XMLEditor.defaultProps = {
|
|
99
|
+
config: `<View>
|
|
100
|
+
<!--Edit this config to customize the labeling interface.-->
|
|
101
|
+
</View>
|
|
102
|
+
`,
|
|
103
|
+
height: '20em',
|
|
104
|
+
gutterWidth: '3em'
|
|
105
|
+
};
|
|
106
|
+
export default XMLEditor;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as theme } from "./theme";
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/* eslint-disable import/no-extraneous-dependencies */
|
|
2
|
+
import { EditorView } from '@codemirror/view';
|
|
3
|
+
import { HighlightStyle, syntaxHighlighting } from '@codemirror/language';
|
|
4
|
+
import { tags } from '@lezer/highlight';
|
|
5
|
+
|
|
6
|
+
// Using https://github.com/one-dark/vscode-one-dark-theme/ as reference for the colors
|
|
7
|
+
const chalky = '#e5c07b';
|
|
8
|
+
const coral = '#e06c75';
|
|
9
|
+
const cyan = '#56b6c2';
|
|
10
|
+
const invalid = '#ffffff';
|
|
11
|
+
const ivory = '#abb2bf';
|
|
12
|
+
const stone = '#7d8799'; // Brightened compared to original to increase contrast
|
|
13
|
+
const malibu = '#61afef';
|
|
14
|
+
const sage = '#98c379';
|
|
15
|
+
const whiskey = '#d19a66';
|
|
16
|
+
const violet = '#c678dd';
|
|
17
|
+
const darkBackground = '#21252b';
|
|
18
|
+
const highlightBackground = '#2c313a';
|
|
19
|
+
const background = '#282c34';
|
|
20
|
+
const tooltipBackground = '#353a42';
|
|
21
|
+
const selection = '#3E4451';
|
|
22
|
+
const cursor = '#528bff';
|
|
23
|
+
/**
|
|
24
|
+
The colors used in the theme, as CSS color strings.
|
|
25
|
+
*/
|
|
26
|
+
// const color = {
|
|
27
|
+
// chalky,
|
|
28
|
+
// coral,
|
|
29
|
+
// cyan,
|
|
30
|
+
// invalid,
|
|
31
|
+
// ivory,
|
|
32
|
+
// stone,
|
|
33
|
+
// malibu,
|
|
34
|
+
// sage,
|
|
35
|
+
// whiskey,
|
|
36
|
+
// violet,
|
|
37
|
+
// darkBackground,
|
|
38
|
+
// highlightBackground,
|
|
39
|
+
// background,
|
|
40
|
+
// tooltipBackground,
|
|
41
|
+
// selection,
|
|
42
|
+
// cursor
|
|
43
|
+
// };
|
|
44
|
+
/**
|
|
45
|
+
The editor theme styles for One Dark.
|
|
46
|
+
*/
|
|
47
|
+
const oneDarkTheme = /* @__PURE__ */EditorView.theme({
|
|
48
|
+
'&': {
|
|
49
|
+
color: ivory,
|
|
50
|
+
backgroundColor: background
|
|
51
|
+
},
|
|
52
|
+
'.cm-content': {
|
|
53
|
+
caretColor: cursor
|
|
54
|
+
},
|
|
55
|
+
'.cm-cursor, .cm-dropCursor': {
|
|
56
|
+
borderLeftColor: cursor
|
|
57
|
+
},
|
|
58
|
+
'&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection': {
|
|
59
|
+
backgroundColor: selection
|
|
60
|
+
},
|
|
61
|
+
'.cm-panels': {
|
|
62
|
+
backgroundColor: darkBackground,
|
|
63
|
+
color: ivory
|
|
64
|
+
},
|
|
65
|
+
'.cm-panels.cm-panels-top': {
|
|
66
|
+
borderBottom: '2px solid black'
|
|
67
|
+
},
|
|
68
|
+
'.cm-panels.cm-panels-bottom': {
|
|
69
|
+
borderTop: '2px solid black'
|
|
70
|
+
},
|
|
71
|
+
'.cm-searchMatch': {
|
|
72
|
+
backgroundColor: '#72a1ff59',
|
|
73
|
+
outline: '1px solid #457dff'
|
|
74
|
+
},
|
|
75
|
+
'.cm-searchMatch.cm-searchMatch-selected': {
|
|
76
|
+
backgroundColor: '#6199ff2f'
|
|
77
|
+
},
|
|
78
|
+
'.cm-activeLine': {
|
|
79
|
+
backgroundColor: '#6699ff0b'
|
|
80
|
+
},
|
|
81
|
+
'.cm-selectionMatch': {
|
|
82
|
+
backgroundColor: '#aafe661a'
|
|
83
|
+
},
|
|
84
|
+
'&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket': {
|
|
85
|
+
backgroundColor: '#bad0f847'
|
|
86
|
+
},
|
|
87
|
+
'.cm-gutters': {
|
|
88
|
+
backgroundColor: background,
|
|
89
|
+
color: stone,
|
|
90
|
+
border: 'none'
|
|
91
|
+
},
|
|
92
|
+
'.cm-activeLineGutter': {
|
|
93
|
+
backgroundColor: highlightBackground
|
|
94
|
+
},
|
|
95
|
+
'.cm-foldPlaceholder': {
|
|
96
|
+
backgroundColor: 'transparent',
|
|
97
|
+
border: 'none',
|
|
98
|
+
color: '#ddd'
|
|
99
|
+
},
|
|
100
|
+
'.cm-tooltip': {
|
|
101
|
+
border: 'none',
|
|
102
|
+
backgroundColor: tooltipBackground
|
|
103
|
+
},
|
|
104
|
+
'.cm-tooltip .cm-tooltip-arrow:before': {
|
|
105
|
+
borderTopColor: 'transparent',
|
|
106
|
+
borderBottomColor: 'transparent'
|
|
107
|
+
},
|
|
108
|
+
'.cm-tooltip .cm-tooltip-arrow:after': {
|
|
109
|
+
borderTopColor: tooltipBackground,
|
|
110
|
+
borderBottomColor: tooltipBackground
|
|
111
|
+
},
|
|
112
|
+
'.cm-tooltip-autocomplete': {
|
|
113
|
+
'& > ul > li[aria-selected]': {
|
|
114
|
+
backgroundColor: highlightBackground,
|
|
115
|
+
color: ivory
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}, {
|
|
119
|
+
dark: true
|
|
120
|
+
});
|
|
121
|
+
/**
|
|
122
|
+
The highlighting style for code in the One Dark theme.
|
|
123
|
+
*/
|
|
124
|
+
const oneDarkHighlightStyle = /* @__PURE__ */HighlightStyle.define([{
|
|
125
|
+
tag: tags.keyword,
|
|
126
|
+
color: violet
|
|
127
|
+
}, {
|
|
128
|
+
tag: [tags.name, tags.deleted, tags.character, tags.propertyName, tags.macroName],
|
|
129
|
+
color: coral
|
|
130
|
+
}, {
|
|
131
|
+
tag: [/* @__PURE__ */tags.function(tags.variableName), tags.labelName],
|
|
132
|
+
color: malibu
|
|
133
|
+
}, {
|
|
134
|
+
tag: [tags.color, /* @__PURE__ */tags.constant(tags.name), /* @__PURE__ */tags.standard(tags.name)],
|
|
135
|
+
color: whiskey
|
|
136
|
+
}, {
|
|
137
|
+
tag: [/* @__PURE__ */tags.definition(tags.name), tags.separator],
|
|
138
|
+
color: ivory
|
|
139
|
+
}, {
|
|
140
|
+
tag: [tags.typeName, tags.className, tags.number, tags.changed, tags.annotation, tags.modifier, tags.self, tags.namespace],
|
|
141
|
+
color: chalky
|
|
142
|
+
}, {
|
|
143
|
+
tag: [tags.operator, tags.operatorKeyword, tags.url, tags.escape, tags.regexp, tags.link, /* @__PURE__ */tags.special(tags.string)],
|
|
144
|
+
color: cyan
|
|
145
|
+
}, {
|
|
146
|
+
tag: [tags.meta, tags.comment],
|
|
147
|
+
color: stone
|
|
148
|
+
}, {
|
|
149
|
+
tag: tags.strong,
|
|
150
|
+
fontWeight: 'bold'
|
|
151
|
+
}, {
|
|
152
|
+
tag: tags.emphasis,
|
|
153
|
+
fontStyle: 'italic'
|
|
154
|
+
}, {
|
|
155
|
+
tag: tags.strikethrough,
|
|
156
|
+
textDecoration: 'line-through'
|
|
157
|
+
}, {
|
|
158
|
+
tag: tags.link,
|
|
159
|
+
color: stone,
|
|
160
|
+
textDecoration: 'underline'
|
|
161
|
+
}, {
|
|
162
|
+
tag: tags.heading,
|
|
163
|
+
fontWeight: 'bold',
|
|
164
|
+
color: coral
|
|
165
|
+
}, {
|
|
166
|
+
tag: [tags.atom, tags.bool, /* @__PURE__ */tags.special(tags.variableName)],
|
|
167
|
+
color: whiskey
|
|
168
|
+
}, {
|
|
169
|
+
tag: [tags.processingInstruction, tags.string, tags.inserted],
|
|
170
|
+
color: sage
|
|
171
|
+
}, {
|
|
172
|
+
tag: tags.invalid,
|
|
173
|
+
color: invalid
|
|
174
|
+
}]);
|
|
175
|
+
/**
|
|
176
|
+
Extension to enable the One Dark theme (both the editor theme and
|
|
177
|
+
the highlight style).
|
|
178
|
+
*/
|
|
179
|
+
const oneDark = [oneDarkTheme, /* @__PURE__ */syntaxHighlighting(oneDarkHighlightStyle)];
|
|
180
|
+
export default oneDark;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as XMLEditor } from "./XMLEditor";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
@use "@pareto-engineering/bem";
|
|
2
|
+
|
|
3
|
+
.#{bem.$base}.code-editor {
|
|
4
|
+
border-radius: 1em;
|
|
5
|
+
height: var(--height);
|
|
6
|
+
overflow: auto;
|
|
7
|
+
|
|
8
|
+
> .cm-editor {
|
|
9
|
+
height: 100%;
|
|
10
|
+
|
|
11
|
+
.cm-gutters {
|
|
12
|
+
display: flex;
|
|
13
|
+
justify-content: flex-end;
|
|
14
|
+
width: var(--gutter-width);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
package/dist/es/a/index.js
CHANGED
|
@@ -22,4 +22,5 @@ export { Tip } from "./Tip";
|
|
|
22
22
|
export { AnimatedGradient } from "./AnimatedGradient";
|
|
23
23
|
export { TextSteps } from "./TextSteps";
|
|
24
24
|
export { Removable } from "./Removable";
|
|
25
|
-
export { ToggleSwitch } from "./ToggleSwitch";
|
|
25
|
+
export { ToggleSwitch } from "./ToggleSwitch";
|
|
26
|
+
export { XMLEditor } from "./XMLEditor";
|
package/dist/es/b/Logo/Logo.js
CHANGED
package/dist/es/b/Title/Title.js
CHANGED
|
@@ -37,14 +37,12 @@ const SocialMediaShareButton = ({
|
|
|
37
37
|
link: `https://www.facebook.com/sharer/sharer.php?u=${link}`
|
|
38
38
|
// link: `https://www.facebook.com/sharer/sharer.php?u=${link}"e=${title}`,
|
|
39
39
|
},
|
|
40
|
-
|
|
41
40
|
twitter: {
|
|
42
41
|
icon: 't',
|
|
43
42
|
link: `https://twitter.com/intent/tweet?url=${link}`
|
|
44
43
|
// link: `https://twitter.com/intent/tweet?text=${title}&url=${link}`,
|
|
45
44
|
}
|
|
46
45
|
};
|
|
47
|
-
|
|
48
46
|
return /*#__PURE__*/React.createElement("a", {
|
|
49
47
|
href: defaultsMap[type].link,
|
|
50
48
|
target: "_blank",
|
|
@@ -22,6 +22,7 @@ const QueryCombobox = ({
|
|
|
22
22
|
name,
|
|
23
23
|
label,
|
|
24
24
|
labelColor,
|
|
25
|
+
getTagColor,
|
|
25
26
|
color,
|
|
26
27
|
optional,
|
|
27
28
|
description,
|
|
@@ -98,6 +99,7 @@ const QueryCombobox = ({
|
|
|
98
99
|
name,
|
|
99
100
|
label,
|
|
100
101
|
labelColor,
|
|
102
|
+
getTagColor,
|
|
101
103
|
optional,
|
|
102
104
|
description,
|
|
103
105
|
setValue,
|
|
@@ -201,7 +203,15 @@ QueryCombobox.propTypes = {
|
|
|
201
203
|
* Whether to prompt the user to create a new option if the search input
|
|
202
204
|
* does not match any of the options
|
|
203
205
|
*/
|
|
204
|
-
promptCreateNewOption: PropTypes.bool
|
|
206
|
+
promptCreateNewOption: PropTypes.bool,
|
|
207
|
+
/**
|
|
208
|
+
* The placeholder text for the input
|
|
209
|
+
* */
|
|
210
|
+
placeholder: PropTypes.string,
|
|
211
|
+
/**
|
|
212
|
+
* The function to get the color of the tag
|
|
213
|
+
* */
|
|
214
|
+
getTagColor: PropTypes.func
|
|
205
215
|
};
|
|
206
216
|
QueryCombobox.defaultProps = {
|
|
207
217
|
optionsKeyMap: {
|
|
@@ -35,6 +35,7 @@ const MultipleCombobox = ({
|
|
|
35
35
|
labelColor,
|
|
36
36
|
name,
|
|
37
37
|
optional,
|
|
38
|
+
getTagColor,
|
|
38
39
|
options: items,
|
|
39
40
|
getOptions,
|
|
40
41
|
setValue,
|
|
@@ -96,7 +97,6 @@ const MultipleCombobox = ({
|
|
|
96
97
|
...changes,
|
|
97
98
|
isOpen: true // keep the menu open after selection.
|
|
98
99
|
};
|
|
99
|
-
|
|
100
100
|
default:
|
|
101
101
|
break;
|
|
102
102
|
}
|
|
@@ -178,7 +178,7 @@ const MultipleCombobox = ({
|
|
|
178
178
|
removeSelectedItem(selectedItem);
|
|
179
179
|
},
|
|
180
180
|
isCompact: true,
|
|
181
|
-
color: color
|
|
181
|
+
color: getTagColor ? getTagColor(selectedItem) : color
|
|
182
182
|
}, /*#__PURE__*/React.createElement("span", null, selectedItem.label), /*#__PURE__*/React.createElement("span", {
|
|
183
183
|
className: "icon close"
|
|
184
184
|
}, "Y"))))), /*#__PURE__*/React.createElement("div", {
|
|
@@ -287,7 +287,36 @@ MultipleCombobox.propTypes = {
|
|
|
287
287
|
/**
|
|
288
288
|
* The placeholder text for the input
|
|
289
289
|
*/
|
|
290
|
-
placeholder: PropTypes.string
|
|
290
|
+
placeholder: PropTypes.string,
|
|
291
|
+
/**
|
|
292
|
+
* The function to set the options of the custom select input
|
|
293
|
+
*/
|
|
294
|
+
setOptions: PropTypes.func,
|
|
295
|
+
/**
|
|
296
|
+
* Whether to prompt the user to create a new option if the search input
|
|
297
|
+
* does not match any of the options
|
|
298
|
+
*/
|
|
299
|
+
promptCreateNewOption: PropTypes.bool,
|
|
300
|
+
/**
|
|
301
|
+
* The function to get the color of the tag
|
|
302
|
+
*/
|
|
303
|
+
getTagColor: PropTypes.func,
|
|
304
|
+
/**
|
|
305
|
+
* The color of the label
|
|
306
|
+
*/
|
|
307
|
+
labelColor: PropTypes.string,
|
|
308
|
+
/**
|
|
309
|
+
* The function to validate the input
|
|
310
|
+
*/
|
|
311
|
+
validate: PropTypes.func,
|
|
312
|
+
/**
|
|
313
|
+
* Whether to allow multiple items selection
|
|
314
|
+
*/
|
|
315
|
+
multiple: PropTypes.bool,
|
|
316
|
+
/**
|
|
317
|
+
* The variable to be used to search the data
|
|
318
|
+
*/
|
|
319
|
+
searchVariable: PropTypes.string
|
|
291
320
|
};
|
|
292
321
|
MultipleCombobox.defaultProps = {
|
|
293
322
|
// someProp: false
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pareto-engineering/design-system",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.70",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/es/index.js",
|
|
@@ -50,11 +50,13 @@
|
|
|
50
50
|
"style-loader": "^3.3.2"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
+
"@codemirror/lang-xml": "^6.0.2",
|
|
53
54
|
"@lexical/react": "^0.11.3",
|
|
54
|
-
"@pareto-engineering/assets": "^4.0.0-alpha.
|
|
55
|
+
"@pareto-engineering/assets": "^4.0.0-alpha.70",
|
|
55
56
|
"@pareto-engineering/bem": "^4.0.0-alpha.20",
|
|
56
|
-
"@pareto-engineering/styles": "^4.0.0-alpha.
|
|
57
|
+
"@pareto-engineering/styles": "^4.0.0-alpha.70",
|
|
57
58
|
"@pareto-engineering/utils": "^4.0.0-alpha.46",
|
|
59
|
+
"codemirror": "^6.0.1",
|
|
58
60
|
"date-fns": "^2.29.3",
|
|
59
61
|
"downshift": "^6.1.12",
|
|
60
62
|
"formik": "^2.2.9",
|
|
@@ -71,5 +73,5 @@
|
|
|
71
73
|
"relay-test-utils": "^15.0.0"
|
|
72
74
|
},
|
|
73
75
|
"browserslist": "> 2%",
|
|
74
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "dd5504b9e521370b6151a796a429c268ab123be1"
|
|
75
77
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Meta, } from '@storybook/addon-docs/blocks';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
charList
|
|
5
|
+
} from './helpers';
|
|
6
|
+
|
|
7
|
+
<Meta title="StyleGuide/Icons/ai" />
|
|
8
|
+
|
|
9
|
+
# AI Icons
|
|
10
|
+
|
|
11
|
+
The icons are defined in [@pareto-engineering/assets/fonts/ai-icons.woff](https://github.com/HelloPareto/front/tree/development/packages/assets/fonts),
|
|
12
|
+
imported and configured in [@pareto-engineering/styles/src/mixins/_font.scss](https://github.com/HelloPareto/front/blob/development/packages/styles/src/mixins/_font.scss).
|
|
13
|
+
|
|
14
|
+
To add more fonts, connect to [glyphter](https://glyphter.com).
|
|
15
|
+
|
|
16
|
+
<div style={{ display:'grid', 'grid-template-columns':'repeat(auto-fill, minmax(100px, 150px))' }}>
|
|
17
|
+
{ charList.map(letter =>
|
|
18
|
+
<div>
|
|
19
|
+
<div style={{ textAlign:'center', padding:'.5em', fontWeight:'bold', outline:'1px solid #DCDCDC', color:'#ACACAC' }}>
|
|
20
|
+
{ letter }
|
|
21
|
+
</div>
|
|
22
|
+
<div style={{ outline:'1px solid #DCDCDC', padding:'2em', 'text-align':'center', 'font-family':'ai-icons', 'font-size':'2em' }}>
|
|
23
|
+
{ letter }
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
) }
|
|
27
|
+
</div>
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import { Meta, IconGallery, IconItems } from '@storybook/addon-docs/blocks';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
4
|
charList
|
|
5
5
|
} from './helpers';
|
|
6
6
|
|
|
7
|
-
<Meta title="StyleGuide/Icons" />
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
# Icons
|
|
11
|
-
|
|
12
|
-
The icons are defined in [@pareto-engineering/assets/fonts/icons.woff](https://github.com/HelloPareto/assets/tree/master/fonts),
|
|
13
|
-
imported in [@pareto-engineering/styles/src/stylebook.scss](https://github.com/HelloPareto/styles/blob/master/src/stylebook.scss).
|
|
14
|
-
|
|
15
|
-
To add more fonts, connect to [glyphter](https://glyphter.com).
|
|
16
|
-
|
|
17
|
-
<div style={{ display:'grid', 'grid-template-columns':'repeat(auto-fill, minmax(100px, 150px))' }}>
|
|
18
|
-
{ charList.map(letter =>
|
|
19
|
-
<div>
|
|
20
|
-
<div style={{ textAlign:'center', padding:'.5em', fontWeight:'bold', outline:'1px solid #DCDCDC', color:'#ACACAC' }}>
|
|
21
|
-
{ letter }
|
|
22
|
-
</div>
|
|
23
|
-
<div style={{ outline:'1px solid #DCDCDC', padding:'2em', 'text-align':'center', 'font-family':'icons', 'font-size':'2em' }}>
|
|
24
|
-
{ letter }
|
|
25
|
-
</div>
|
|
26
|
-
</div>
|
|
27
|
-
) }
|
|
7
|
+
<Meta title="StyleGuide/Icons/all" />
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# Icons
|
|
11
|
+
|
|
12
|
+
The icons are defined in [@pareto-engineering/assets/fonts/icons.woff](https://github.com/HelloPareto/assets/tree/master/fonts),
|
|
13
|
+
imported in [@pareto-engineering/styles/src/stylebook.scss](https://github.com/HelloPareto/styles/blob/master/src/stylebook.scss).
|
|
14
|
+
|
|
15
|
+
To add more fonts, connect to [glyphter](https://glyphter.com).
|
|
16
|
+
|
|
17
|
+
<div style={{ display:'grid', 'grid-template-columns':'repeat(auto-fill, minmax(100px, 150px))' }}>
|
|
18
|
+
{ charList.map(letter =>
|
|
19
|
+
<div>
|
|
20
|
+
<div style={{ textAlign:'center', padding:'.5em', fontWeight:'bold', outline:'1px solid #DCDCDC', color:'#ACACAC' }}>
|
|
21
|
+
{ letter }
|
|
22
|
+
</div>
|
|
23
|
+
<div style={{ outline:'1px solid #DCDCDC', padding:'2em', 'text-align':'center', 'font-family':'icons', 'font-size':'2em' }}>
|
|
24
|
+
{ letter }
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
) }
|
|
28
28
|
</div>
|
|
29
29
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
|
|
3
|
+
import { XMLEditor } from 'ui'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title :'a/XMLEditor',
|
|
7
|
+
component :XMLEditor,
|
|
8
|
+
decorators:[
|
|
9
|
+
// storyfn => <div className="">{ storyfn() }</div>,
|
|
10
|
+
],
|
|
11
|
+
argTypes:{},
|
|
12
|
+
controls:{
|
|
13
|
+
},
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const Template = (args) => (
|
|
17
|
+
<XMLEditor {...args} />
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
export const Base = Template.bind({})
|
|
21
|
+
Base.args = {}
|
|
@@ -230,10 +230,32 @@ MultipleSelectWithDefaultFormikState.args = {
|
|
|
230
230
|
{
|
|
231
231
|
value:'VGVhbU5vZGU6MDAxZTIyOGEtYzA5My00MGI0LWE1MTUtYTNkMTM1NTE1MDNl',
|
|
232
232
|
label:'Apple',
|
|
233
|
+
color:'red',
|
|
233
234
|
},
|
|
234
235
|
{
|
|
235
236
|
value:'VGVhbU5vZGU6MDA0N2U4MzktODY0Zi00N2U5LTg3ZjgtZGUwMmM2Yzg1YWJm',
|
|
236
237
|
label:'Pear',
|
|
238
|
+
color:'green',
|
|
239
|
+
},
|
|
240
|
+
],
|
|
241
|
+
},
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export const MultipleSelectWithGetTagColorFunction = ResolvedTemplate.bind({})
|
|
245
|
+
MultipleSelectWithGetTagColorFunction.args = {
|
|
246
|
+
multiple :true,
|
|
247
|
+
getTagColor :(tag) => tag.color,
|
|
248
|
+
defaultFormikState:{
|
|
249
|
+
teams:[
|
|
250
|
+
{
|
|
251
|
+
value:'VGVhbU5vZGU6MDAxZTIyOGEtYzA5My00MGI0LWE1MTUtYTNkMTM1NTE1MDNl',
|
|
252
|
+
label:'Apple',
|
|
253
|
+
color:'red',
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
value:'VGVhbU5vZGU6MDA0N2U4MzktODY0Zi00N2U5LTg3ZjgtZGUwMmM2Yzg1YWJm',
|
|
257
|
+
label:'Pear',
|
|
258
|
+
color:'green',
|
|
237
259
|
},
|
|
238
260
|
],
|
|
239
261
|
},
|