@pareto-engineering/design-system 4.0.0-alpha.69 → 4.0.0-alpha.72

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 (161) hide show
  1. package/.storybook/preview.js +29 -12
  2. package/dist/cjs/a/AnimatedGradient/AnimatedGradient.js +0 -1
  3. package/dist/cjs/a/AnimatedGradient/webGIRenderer.js +0 -1
  4. package/dist/cjs/a/AppContext/ContextProvider.js +2 -0
  5. package/dist/cjs/{c/ContentSlides/common/Slide/Slide.js → a/LexicalPreview/LexicalPreview.js} +43 -28
  6. package/dist/cjs/{c/ContentSlides/common/HorizontalMenu → a/LexicalPreview}/index.js +3 -3
  7. package/dist/cjs/a/LexicalPreview/styles.scss +46 -0
  8. package/dist/cjs/a/People/common/Person/Person.js +7 -2
  9. package/dist/cjs/a/ProgressBar/ProgressBar.js +3 -3
  10. package/dist/cjs/a/ProgressBar/styles.scss +11 -1
  11. package/dist/cjs/a/XMLEditor/XMLEditor.js +123 -0
  12. package/dist/cjs/{c/ContentSlides/common/Slide → a/XMLEditor/common}/index.js +3 -3
  13. package/dist/cjs/a/XMLEditor/common/theme.js +186 -0
  14. package/dist/cjs/{c/ContentSlides/common/Navigator → a/XMLEditor}/index.js +3 -3
  15. package/dist/cjs/a/XMLEditor/styles.scss +17 -0
  16. package/dist/cjs/a/index.js +15 -1
  17. package/dist/cjs/b/ExpandableLexicalPreview/ExpandableLexicalPreview.js +125 -0
  18. package/dist/cjs/b/ExpandableLexicalPreview/common/ExpandButton/ExpandButton.js +112 -0
  19. package/dist/cjs/{c/ContentSlides/common/Sidebar → b/ExpandableLexicalPreview/common/ExpandButton}/index.js +3 -3
  20. package/dist/cjs/b/ExpandableLexicalPreview/common/index.js +12 -0
  21. package/dist/cjs/b/ExpandableLexicalPreview/index.js +13 -0
  22. package/dist/cjs/b/ExpandableLexicalPreview/styles.scss +84 -0
  23. package/dist/cjs/b/Logo/Logo.js +0 -1
  24. package/dist/cjs/b/Title/Title.js +0 -1
  25. package/dist/cjs/b/index.js +8 -1
  26. package/dist/cjs/c/SocialMediaShareButton/SocialMediaShareButton.js +0 -2
  27. package/dist/cjs/c/index.js +0 -13
  28. package/dist/cjs/f/FormInput/FormInput.js +2 -0
  29. package/dist/cjs/f/fields/EditorInput/EditorInput.js +14 -3
  30. package/dist/cjs/f/fields/EditorInput/common/StopPropagationPlugin.js +30 -0
  31. package/dist/cjs/f/fields/EditorInput/common/index.js +7 -0
  32. package/dist/cjs/f/fields/QueryCombobox/QueryCombobox.js +11 -1
  33. package/dist/cjs/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +32 -3
  34. package/dist/cjs/index.js +0 -11
  35. package/dist/cjs/test/QueryLoader/__generated__/QueryLoaderHelloQuery.graphql.js +0 -1
  36. package/dist/es/a/AnimatedGradient/AnimatedGradient.js +0 -1
  37. package/dist/es/a/AnimatedGradient/webGIRenderer.js +0 -1
  38. package/dist/es/a/BlurOverlay/BlurOverlay.js +0 -1
  39. package/dist/es/a/DotInfo/DotInfo.js +0 -1
  40. package/dist/es/a/LexicalPreview/LexicalPreview.js +80 -0
  41. package/dist/es/a/LexicalPreview/index.js +2 -0
  42. package/dist/es/a/LexicalPreview/styles.scss +46 -0
  43. package/dist/es/a/People/common/Person/Person.js +22 -15
  44. package/dist/es/a/ProgressBar/ProgressBar.js +3 -3
  45. package/dist/es/a/ProgressBar/styles.scss +11 -1
  46. package/dist/es/a/XMLEditor/XMLEditor.js +112 -0
  47. package/dist/es/a/XMLEditor/common/index.js +1 -0
  48. package/dist/es/a/XMLEditor/common/theme.js +180 -0
  49. package/dist/es/a/XMLEditor/index.js +1 -0
  50. package/dist/es/a/XMLEditor/styles.scss +17 -0
  51. package/dist/es/a/index.js +3 -1
  52. package/dist/es/b/ExpandableLexicalPreview/ExpandableLexicalPreview.js +115 -0
  53. package/dist/es/b/ExpandableLexicalPreview/common/ExpandButton/ExpandButton.js +102 -0
  54. package/dist/es/b/ExpandableLexicalPreview/common/ExpandButton/index.js +1 -0
  55. package/dist/es/b/ExpandableLexicalPreview/common/index.js +1 -0
  56. package/dist/es/b/ExpandableLexicalPreview/index.js +2 -0
  57. package/dist/es/b/ExpandableLexicalPreview/styles.scss +84 -0
  58. package/dist/es/b/Logo/Logo.js +0 -1
  59. package/dist/es/b/Title/Title.js +0 -1
  60. package/dist/es/b/index.js +2 -1
  61. package/dist/es/c/SocialMediaShareButton/SocialMediaShareButton.js +0 -2
  62. package/dist/es/c/index.js +0 -1
  63. package/dist/es/f/fields/EditorInput/EditorInput.js +15 -4
  64. package/dist/es/f/fields/EditorInput/common/StopPropagationPlugin.js +23 -0
  65. package/dist/es/f/fields/EditorInput/common/index.js +2 -1
  66. package/dist/es/f/fields/QueryCombobox/QueryCombobox.js +11 -1
  67. package/dist/es/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +32 -3
  68. package/dist/es/index.js +0 -1
  69. package/dist/es/test/QueryLoader/__generated__/QueryLoaderHelloQuery.graphql.js +0 -1
  70. package/package.json +7 -5
  71. package/src/stories/StyleGuide/ai-icons.stories.mdx +27 -0
  72. package/src/stories/StyleGuide/icons.stories.mdx +22 -22
  73. package/src/stories/a/LexicalPreview.stories.jsx +28 -0
  74. package/src/stories/a/ProgressBar.stories.jsx +1 -1
  75. package/src/stories/a/XMLEditor.stories.jsx +21 -0
  76. package/src/stories/b/ExpandableLexicalPreview.stories.jsx +29 -0
  77. package/src/stories/colors.js +4 -0
  78. package/src/stories/f/QueryCombobox.stories.jsx +22 -0
  79. package/src/ui/a/LexicalPreview/LexicalPreview.jsx +109 -0
  80. package/src/ui/a/LexicalPreview/index.js +2 -0
  81. package/src/ui/a/LexicalPreview/styles.scss +46 -0
  82. package/src/ui/a/People/common/Person/Person.jsx +31 -19
  83. package/src/ui/a/ProgressBar/ProgressBar.jsx +2 -0
  84. package/src/ui/a/ProgressBar/styles.scss +11 -1
  85. package/src/ui/a/XMLEditor/XMLEditor.jsx +182 -0
  86. package/src/ui/a/XMLEditor/common/index.js +1 -0
  87. package/src/ui/a/XMLEditor/common/theme.jsx +184 -0
  88. package/src/ui/a/XMLEditor/index.js +1 -0
  89. package/src/ui/a/XMLEditor/styles.scss +17 -0
  90. package/src/ui/a/index.js +2 -0
  91. package/src/ui/b/ExpandableLexicalPreview/ExpandableLexicalPreview.jsx +157 -0
  92. package/src/ui/b/ExpandableLexicalPreview/common/ExpandButton/ExpandButton.jsx +123 -0
  93. package/src/ui/b/ExpandableLexicalPreview/common/ExpandButton/index.js +1 -0
  94. package/src/ui/b/ExpandableLexicalPreview/common/index.js +1 -0
  95. package/src/ui/b/ExpandableLexicalPreview/index.js +2 -0
  96. package/src/ui/b/ExpandableLexicalPreview/styles.scss +84 -0
  97. package/src/ui/b/index.js +1 -0
  98. package/src/ui/c/index.js +0 -1
  99. package/src/ui/f/fields/EditorInput/EditorInput.jsx +16 -2
  100. package/src/ui/f/fields/EditorInput/common/StopPropagationPlugin.jsx +29 -0
  101. package/src/ui/f/fields/EditorInput/common/index.jsx +1 -0
  102. package/src/ui/f/fields/QueryCombobox/QueryCombobox.jsx +12 -0
  103. package/src/ui/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.jsx +38 -1
  104. package/src/ui/index.js +0 -1
  105. package/tests/__snapshots__/Storyshots.test.js.snap +1531 -782
  106. package/dist/cjs/c/ContentSlides/ContentSlides.js +0 -172
  107. package/dist/cjs/c/ContentSlides/Context.js +0 -10
  108. package/dist/cjs/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +0 -124
  109. package/dist/cjs/c/ContentSlides/common/Navigator/Navigator.js +0 -128
  110. package/dist/cjs/c/ContentSlides/common/Sidebar/Sidebar.js +0 -92
  111. package/dist/cjs/c/ContentSlides/common/index.js +0 -33
  112. package/dist/cjs/c/ContentSlides/index.js +0 -27
  113. package/dist/cjs/c/ContentSlides/styles.scss +0 -312
  114. package/dist/cjs/c/ContentSlides/useContentSlides.js +0 -11
  115. package/dist/cjs/r/SwitchRouteMap/SwitchRouteMap.js +0 -58
  116. package/dist/cjs/r/SwitchRouteMap/index.js +0 -13
  117. package/dist/cjs/r/common/PrivateRoute/PrivateRoute.js +0 -75
  118. package/dist/cjs/r/common/PrivateRoute/index.js +0 -13
  119. package/dist/cjs/r/common/index.js +0 -12
  120. package/dist/cjs/r/index.js +0 -27
  121. package/dist/es/c/ContentSlides/ContentSlides.js +0 -160
  122. package/dist/es/c/ContentSlides/Context.js +0 -2
  123. package/dist/es/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +0 -116
  124. package/dist/es/c/ContentSlides/common/HorizontalMenu/index.js +0 -2
  125. package/dist/es/c/ContentSlides/common/Navigator/Navigator.js +0 -118
  126. package/dist/es/c/ContentSlides/common/Navigator/index.js +0 -2
  127. package/dist/es/c/ContentSlides/common/Sidebar/Sidebar.js +0 -84
  128. package/dist/es/c/ContentSlides/common/Sidebar/index.js +0 -2
  129. package/dist/es/c/ContentSlides/common/Slide/Slide.js +0 -65
  130. package/dist/es/c/ContentSlides/common/Slide/index.js +0 -2
  131. package/dist/es/c/ContentSlides/common/index.js +0 -4
  132. package/dist/es/c/ContentSlides/index.js +0 -4
  133. package/dist/es/c/ContentSlides/styles.scss +0 -312
  134. package/dist/es/c/ContentSlides/useContentSlides.js +0 -3
  135. package/dist/es/r/SwitchRouteMap/SwitchRouteMap.js +0 -45
  136. package/dist/es/r/SwitchRouteMap/index.js +0 -2
  137. package/dist/es/r/common/PrivateRoute/PrivateRoute.js +0 -67
  138. package/dist/es/r/common/PrivateRoute/index.js +0 -2
  139. package/dist/es/r/common/index.js +0 -1
  140. package/dist/es/r/index.js +0 -2
  141. package/src/stories/c/ContentSlides.stories.jsx +0 -214
  142. package/src/ui/c/ContentSlides/ContentSlides.jsx +0 -214
  143. package/src/ui/c/ContentSlides/Context.js +0 -3
  144. package/src/ui/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.jsx +0 -145
  145. package/src/ui/c/ContentSlides/common/HorizontalMenu/index.js +0 -2
  146. package/src/ui/c/ContentSlides/common/Navigator/Navigator.jsx +0 -150
  147. package/src/ui/c/ContentSlides/common/Navigator/index.js +0 -2
  148. package/src/ui/c/ContentSlides/common/Sidebar/Sidebar.jsx +0 -135
  149. package/src/ui/c/ContentSlides/common/Sidebar/index.js +0 -2
  150. package/src/ui/c/ContentSlides/common/Slide/Slide.jsx +0 -87
  151. package/src/ui/c/ContentSlides/common/Slide/index.js +0 -2
  152. package/src/ui/c/ContentSlides/common/index.js +0 -4
  153. package/src/ui/c/ContentSlides/index.js +0 -4
  154. package/src/ui/c/ContentSlides/styles.scss +0 -312
  155. package/src/ui/c/ContentSlides/useContentSlides.js +0 -4
  156. package/src/ui/r/SwitchRouteMap/SwitchRouteMap.jsx +0 -64
  157. package/src/ui/r/SwitchRouteMap/index.js +0 -2
  158. package/src/ui/r/common/PrivateRoute/PrivateRoute.jsx +0 -73
  159. package/src/ui/r/common/PrivateRoute/index.js +0 -2
  160. package/src/ui/r/common/index.js +0 -1
  161. package/src/ui/r/index.js +0 -2
@@ -0,0 +1,115 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ /* eslint-disable import/no-extraneous-dependencies -- required here */
3
+ import * as React from 'react';
4
+ import { useState, useMemo } from 'react';
5
+ import { LexicalComposer } from '@lexical/react/LexicalComposer';
6
+ import { RichTextPlugin } from '@lexical/react/LexicalRichTextPlugin';
7
+ import { ContentEditable } from '@lexical/react/LexicalContentEditable';
8
+ import { AutoLinkNode, LinkNode } from '@lexical/link';
9
+ import { ListItemNode, ListNode } from '@lexical/list';
10
+ import PropTypes from 'prop-types';
11
+ import styleNames from '@pareto-engineering/bem/exports';
12
+ import { Button } from '@pareto-engineering/design-system';
13
+ import "./styles.scss";
14
+ import { ExpandButton } from "./common";
15
+
16
+ // Local Definitions
17
+
18
+ const baseClassName = styleNames.base;
19
+ const componentClassName = 'expandable-lexical-preview';
20
+
21
+ /**
22
+ * This is the component description.
23
+ */
24
+ const ExpandableLexicalPreview = ({
25
+ id,
26
+ className: userClassName,
27
+ style,
28
+ nodes,
29
+ color,
30
+ resize,
31
+ title
32
+ // ...otherProps
33
+ }) => {
34
+ const initialConfig = {
35
+ nameSpace: id,
36
+ editable: false,
37
+ editorState: nodes,
38
+ theme: {
39
+ text: {
40
+ italic: 'italic',
41
+ strikethrough: 'strikethrough',
42
+ underline: 'underlined'
43
+ }
44
+ },
45
+ nodes: [AutoLinkNode, LinkNode, ListNode, ListItemNode]
46
+ };
47
+ const [isExpanded, setIsExpanded] = useState(false);
48
+ const handleButtonClick = () => {
49
+ setIsExpanded(!isExpanded);
50
+ };
51
+ const Content = useMemo(() => /*#__PURE__*/React.createElement("div", {
52
+ className: "lexical-content"
53
+ }, /*#__PURE__*/React.createElement(RichTextPlugin, {
54
+ contentEditable: /*#__PURE__*/React.createElement(ContentEditable, {
55
+ id: id,
56
+ className: "content-editable"
57
+ })
58
+ }), /*#__PURE__*/React.createElement(ExpandButton, {
59
+ title: title,
60
+ onResolve: handleButtonClick
61
+ })), [id]);
62
+ return /*#__PURE__*/React.createElement(LexicalComposer, {
63
+ initialConfig: initialConfig
64
+ }, /*#__PURE__*/React.createElement("div", {
65
+ id: id,
66
+ className: [baseClassName, componentClassName, userClassName, `y-${color}`, isExpanded && 'collapsed'].filter(e => e).join(' '),
67
+ style: {
68
+ '--resize': resize,
69
+ ...style
70
+ }
71
+ }, typeof title === 'string' ? /*#__PURE__*/React.createElement("p", {
72
+ className: "title h2"
73
+ }, title) : title, isExpanded && /*#__PURE__*/React.createElement(Button, {
74
+ onClick: handleButtonClick,
75
+ color: "background-far",
76
+ isCompact: true
77
+ }, /*#__PURE__*/React.createElement("span", {
78
+ className: "ai-icon c-x x-paragraph"
79
+ }, "C")), !isExpanded && Content));
80
+ };
81
+ ExpandableLexicalPreview.propTypes = {
82
+ /**
83
+ * The HTML id for this element
84
+ */
85
+ id: PropTypes.string,
86
+ /**
87
+ * The HTML class names for this element
88
+ */
89
+ className: PropTypes.string,
90
+ /**
91
+ * The React-written, css properties for this element.
92
+ */
93
+ style: PropTypes.objectOf(PropTypes.string),
94
+ /**
95
+ * Color of the text
96
+ */
97
+ color: PropTypes.string,
98
+ /**
99
+ * The nodes to render in the form of a json string
100
+ */
101
+ nodes: PropTypes.string,
102
+ /**
103
+ * The resize property of the textarea
104
+ */
105
+ resize: PropTypes.string,
106
+ /**
107
+ * The title for the preview.
108
+ */
109
+ title: PropTypes.string
110
+ };
111
+ ExpandableLexicalPreview.defaultProps = {
112
+ color: 'paragraph',
113
+ resize: 'vertical'
114
+ };
115
+ export default ExpandableLexicalPreview;
@@ -0,0 +1,102 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ /* eslint-disable import/no-extraneous-dependencies -- required here */
3
+ import * as React from 'react';
4
+ import { $generateHtmlFromNodes } from '@lexical/html';
5
+ import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
6
+ import PropTypes from 'prop-types';
7
+ import styleNames from '@pareto-engineering/bem/exports';
8
+ import { Button } from '@pareto-engineering/design-system';
9
+
10
+ // Local Definitions
11
+
12
+ const baseClassName = styleNames.base;
13
+ const componentClassName = 'expand-button';
14
+
15
+ /**
16
+ * This is the component description.
17
+ */
18
+ const ExpandButton = ({
19
+ id,
20
+ className: userClassName,
21
+ style,
22
+ onResolve,
23
+ title
24
+ // ...otherProps
25
+ }) => {
26
+ const [editor] = useLexicalComposerContext();
27
+ return /*#__PURE__*/React.createElement(Button, {
28
+ id: id,
29
+ className: [baseClassName, componentClassName, userClassName, 'ai-icon'].filter(e => e).join(' '),
30
+ style: style,
31
+ color: "background-far",
32
+ isCompact: true,
33
+ onClick: () => {
34
+ editor.getEditorState().read(() => {
35
+ const rawHtml = $generateHtmlFromNodes(editor);
36
+ const preview = window.open('', '_blank', 'width=600,height=600');
37
+ preview.document.write(`<html>
38
+ <title>${title || 'Preview'}</title>
39
+ <style>
40
+ li:has(ol, ul) {
41
+ list-style-type: none;
42
+ }
43
+
44
+ p,
45
+ span,
46
+ strong,
47
+ em,
48
+ li {
49
+ &.underlined {
50
+ text-decoration: underline;
51
+
52
+ &.strikethrough {
53
+ text-decoration: underline line-through;
54
+ }
55
+ }
56
+
57
+ &.strikethrough {
58
+ text-decoration: line-through;
59
+ }
60
+
61
+ &.italic {
62
+ font-style: italic;
63
+ }
64
+ }
65
+
66
+ :first-child {
67
+ margin-top: 0;
68
+ }
69
+
70
+ &::placeholder {
71
+ color: #abadb3;
72
+ }
73
+ </style>
74
+ <body>
75
+ <style></style>
76
+ ${rawHtml}
77
+ <button onclick="window.close()">Close Preview</button>
78
+ </body></html>`);
79
+ });
80
+ onResolve();
81
+ }
82
+ }, "D");
83
+ };
84
+ ExpandButton.propTypes = {
85
+ /**
86
+ * The HTML id for this element
87
+ */
88
+ id: PropTypes.string,
89
+ /**
90
+ * The HTML class names for this element
91
+ */
92
+ className: PropTypes.string,
93
+ /**
94
+ * The React-written, css properties for this element.
95
+ */
96
+ style: PropTypes.objectOf(PropTypes.string)
97
+ };
98
+ ExpandButton.defaultProps = {
99
+ // color: 'paragraph',
100
+ // resize: 'vertical',
101
+ };
102
+ export default ExpandButton;
@@ -0,0 +1 @@
1
+ export { default as ExpandButton } from "./ExpandButton";
@@ -0,0 +1 @@
1
+ export { ExpandButton } from "./ExpandButton";
@@ -0,0 +1,2 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ export { default as ExpandableLexicalPreview } from "./ExpandableLexicalPreview";
@@ -0,0 +1,84 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ /* stylelint-disable max-nesting-depth -- required */
3
+
4
+ @use "@pareto-engineering/bem";
5
+ @use "@pareto-engineering/styles/src/mixins";
6
+ @use "@pareto-engineering/styles/src/globals" as *;
7
+
8
+ .#{bem.$base}.expandable-lexical-preview {
9
+ display: flex;
10
+ flex-direction: column;
11
+ flex-wrap: wrap;
12
+ gap: var(--gap);
13
+ width: 100%;
14
+
15
+ &.collapsed {
16
+ flex-direction: row;
17
+ }
18
+
19
+ > .title {
20
+ margin: 0;
21
+ }
22
+
23
+
24
+ > .#{bem.$base}.button {
25
+ align-items: center;
26
+ border: 1px solid var(--outline-inputs);
27
+ display: flex;
28
+ }
29
+
30
+ > .lexical-content {
31
+ position: relative;
32
+
33
+ > .content-editable {
34
+ background: var(--background-inputs);
35
+ border: 1px solid var(--outline-inputs);
36
+ border-radius: var(--theme-default-border-radius);
37
+ color: var(--y);
38
+ overflow: auto;
39
+ padding: var(--gap);
40
+ resize: var(--resize);
41
+
42
+ li:has(ol, ul) {
43
+ list-style-type: none;
44
+ }
45
+
46
+ p,
47
+ span,
48
+ strong,
49
+ em,
50
+ li {
51
+ &.underlined {
52
+ text-decoration: underline;
53
+
54
+ &.strikethrough {
55
+ text-decoration: underline line-through;
56
+ }
57
+ }
58
+
59
+ &.strikethrough {
60
+ text-decoration: line-through;
61
+ }
62
+
63
+ &.italic {
64
+ font-style: italic;
65
+ }
66
+ }
67
+
68
+ :first-child {
69
+ margin-top: 0;
70
+ }
71
+
72
+ &::placeholder {
73
+ color: var(--metadata);
74
+ }
75
+ }
76
+
77
+ > .#{bem.$base}.expand-button {
78
+ border: 1px solid var(--outline-inputs);
79
+ position: absolute;
80
+ right: 1em;
81
+ top: 1em;
82
+ }
83
+ }
84
+ }
@@ -65,7 +65,6 @@ const Logo = ({
65
65
  // {...otherProps}
66
66
  });
67
67
  };
68
-
69
68
  Logo.propTypes = {
70
69
  /**
71
70
  * The HTML id for this element
@@ -95,7 +95,6 @@ Title.propTypes = {
95
95
  subtitleProps: PropTypes.object
96
96
  /* eslint-enable react/forbid-prop-types */
97
97
  };
98
-
99
98
  Title.defaultProps = {
100
99
  headingAs: 'h1',
101
100
  subtitleAs: 'p'
@@ -4,4 +4,5 @@ export { Page } from "./Page";
4
4
  export { SocialMediaButton } from "./SocialMediaButton";
5
5
  export { ThemeSelector } from "./ThemeSelector";
6
6
  export { Title } from "./Title";
7
- export { Card } from "./Card";
7
+ export { Card } from "./Card";
8
+ export { ExpandableLexicalPreview } from "./ExpandableLexicalPreview";
@@ -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}&quote=${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",
@@ -1,4 +1,3 @@
1
- export { ContentSlides, useContentSlides } from "./ContentSlides";
2
1
  export { Shortener } from "./Shortener";
3
2
  export { SocialMediaShareButton } from "./SocialMediaShareButton";
4
3
  export { Modal } from "./Modal";
@@ -19,7 +19,7 @@ import styleNames from '@pareto-engineering/bem/exports';
19
19
  // Local Definitions
20
20
 
21
21
  import { FormLabel, FormDescription } from "../../common";
22
- import { Toolbar, TreeViewPlugin } from "./common";
22
+ import { Toolbar, TreeViewPlugin, StopPropagationPlugin } from "./common";
23
23
  import "./styles.scss";
24
24
  const baseClassName = styleNames.base;
25
25
  const componentClassName = 'editor-input';
@@ -41,7 +41,8 @@ const EditorInput = ({
41
41
  labelColor,
42
42
  description,
43
43
  disabled,
44
- showDebugger
44
+ showDebugger,
45
+ stopPropagationKeys
45
46
  // ...otherProps
46
47
  }) => {
47
48
  const formik = useFormikContext();
@@ -120,7 +121,9 @@ const EditorInput = ({
120
121
  })
121
122
  }), /*#__PURE__*/React.createElement(OnChangePlugin, {
122
123
  onChange: onChange
123
- }), /*#__PURE__*/React.createElement(LinkPlugin, null), /*#__PURE__*/React.createElement(ListPlugin, null), /*#__PURE__*/React.createElement(TabIndentationPlugin, null), /*#__PURE__*/React.createElement(HistoryPlugin, null), /*#__PURE__*/React.createElement(FormDescription, {
124
+ }), /*#__PURE__*/React.createElement(LinkPlugin, null), /*#__PURE__*/React.createElement(ListPlugin, null), /*#__PURE__*/React.createElement(TabIndentationPlugin, null), /*#__PURE__*/React.createElement(HistoryPlugin, null), stopPropagationKeys && /*#__PURE__*/React.createElement(StopPropagationPlugin, {
125
+ stopPropagationKeys: stopPropagationKeys
126
+ }), /*#__PURE__*/React.createElement(FormDescription, {
124
127
  className: "s-1",
125
128
  description: description,
126
129
  name: name
@@ -179,7 +182,15 @@ EditorInput.propTypes = {
179
182
  /**
180
183
  * The resize property of the text area
181
184
  */
182
- resize: PropTypes.oneOf(['none', 'both', 'horizontal', 'vertical'])
185
+ resize: PropTypes.oneOf(['none', 'both', 'horizontal', 'vertical']),
186
+ /**
187
+ * Whether to show the debugger or not
188
+ */
189
+ showDebugger: PropTypes.bool,
190
+ /**
191
+ * Map to stop propagation of the given keys
192
+ */
193
+ stopPropagationKeys: PropTypes.arrayOf(PropTypes.string)
183
194
  };
184
195
  EditorInput.defaultProps = {
185
196
  rows: 10,
@@ -0,0 +1,23 @@
1
+ import { useInsertionEffect } from 'react';
2
+ import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
3
+ const StopPropagationPlugin = ({
4
+ stopPropagationKeys
5
+ }) => {
6
+ const [editor] = useLexicalComposerContext();
7
+ useInsertionEffect(() => {
8
+ const onKeyDown = e => {
9
+ if (stopPropagationKeys?.includes(e.key)) {
10
+ e.stopPropagation();
11
+ }
12
+ };
13
+ return editor.registerRootListener((rootElement, prevRootElement) => {
14
+ if (prevRootElement !== null) {
15
+ prevRootElement.removeEventListener('keydown', onKeyDown);
16
+ }
17
+ if (rootElement !== null) {
18
+ rootElement.addEventListener('keydown', onKeyDown);
19
+ }
20
+ });
21
+ }, [editor]);
22
+ };
23
+ export default StopPropagationPlugin;
@@ -1,2 +1,3 @@
1
1
  export { default as Toolbar } from "./Toolbar";
2
- export { default as TreeViewPlugin } from "./TreeViewPlugin";
2
+ export { default as TreeViewPlugin } from "./TreeViewPlugin";
3
+ export { default as StopPropagationPlugin } from "./StopPropagationPlugin";
@@ -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/dist/es/index.js CHANGED
@@ -1,4 +1,3 @@
1
- export * from "./r"; // Router Extensions
2
1
  export * from "./a";
3
2
  export * from "./b";
4
3
  export * from "./c";
@@ -48,7 +48,6 @@ const node /*: ConcreteRequest*/ = function () {
48
48
  "name": "QueryLoaderHelloQuery",
49
49
  "selections": v0 /*: any*/
50
50
  },
51
-
52
51
  "params": {
53
52
  "cacheID": "463f9ee8a82dd6ec8dedeb28649cce74",
54
53
  "id": null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pareto-engineering/design-system",
3
- "version": "4.0.0-alpha.69",
3
+ "version": "4.0.0-alpha.72",
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.69",
55
+ "@pareto-engineering/assets": "^4.0.0-alpha.72",
55
56
  "@pareto-engineering/bem": "^4.0.0-alpha.20",
56
- "@pareto-engineering/styles": "^4.0.0-alpha.68",
57
- "@pareto-engineering/utils": "^4.0.0-alpha.46",
57
+ "@pareto-engineering/styles": "^4.0.0-alpha.72",
58
+ "@pareto-engineering/utils": "^4.0.0-alpha.72",
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": "2aca4c35daf21d2fe589d9406ca43952c6519bc0"
76
+ "gitHead": "68d099be75ce95a8ff22f53015d1a722af04e8b5"
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