@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,28 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ import * as React from 'react'
3
+
4
+ import { LexicalPreview } from 'ui'
5
+
6
+ export default {
7
+ title :'a/LexicalPreview',
8
+ component :LexicalPreview,
9
+ subcomponents:{
10
+ // Item:TextareaInput.Item
11
+ },
12
+ decorators:[],
13
+ argTypes :{
14
+ color:{ control: 'text' },
15
+ },
16
+ }
17
+
18
+ // eslint-disable-next-line no-useless-escape
19
+ const nodes = '{\"root\":{\"children\":[{\"children\":[{\"children\":[{\"detail\":0,\"format\":1,\"mode\":\"normal\",\"style\":\"\",\"text\":\"This is bold.\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":1},{\"children\":[{\"detail\":0,\"format\":2,\"mode\":\"normal\",\"style\":\"\",\"text\":\"This is italic.\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":2},{\"children\":[{\"detail\":0,\"format\":8,\"mode\":\"normal\",\"style\":\"\",\"text\":\"This is underlined.\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":3},{\"children\":[{\"children\":[{\"children\":[{\"detail\":0,\"format\":4,\"mode\":\"normal\",\"style\":\"\",\"text\":\"This is struck.\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":1,\"type\":\"listitem\",\"version\":1,\"value\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"list\",\"version\":1,\"listType\":\"bullet\",\"start\":1,\"tag\":\"ul\"}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":4}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"list\",\"version\":1,\"listType\":\"bullet\",\"start\":1,\"tag\":\"ul\"}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"root\",\"version\":1}}'
20
+
21
+ const Template = (args) => (
22
+ <LexicalPreview {...args} />
23
+ )
24
+
25
+ export const Base = Template.bind({})
26
+ Base.args = {
27
+ nodes,
28
+ }
@@ -48,7 +48,7 @@ export const Base = () => {
48
48
  export const Color = Template.bind({})
49
49
  Color.args = {
50
50
  progress:70,
51
- color :'main1',
51
+ color :'main',
52
52
  }
53
53
 
54
54
  export const Height = Template.bind({})
@@ -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 = {}
@@ -0,0 +1,29 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ import * as React from 'react'
3
+
4
+ import { ExpandableLexicalPreview } from 'ui'
5
+
6
+ export default {
7
+ title :'b/ExpandableLexicalPreview',
8
+ component :ExpandableLexicalPreview,
9
+ subcomponents:{
10
+ // Item:TextareaInput.Item
11
+ },
12
+ decorators:[],
13
+ argTypes :{
14
+ color:{ control: 'text' },
15
+ },
16
+ }
17
+
18
+ // eslint-disable-next-line no-useless-escape
19
+ const nodes = '{\"root\":{\"children\":[{\"children\":[{\"children\":[{\"detail\":0,\"format\":1,\"mode\":\"normal\",\"style\":\"\",\"text\":\"This is bold.\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":1},{\"children\":[{\"detail\":0,\"format\":2,\"mode\":\"normal\",\"style\":\"\",\"text\":\"This is italic.\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":2},{\"children\":[{\"detail\":0,\"format\":8,\"mode\":\"normal\",\"style\":\"\",\"text\":\"This is underlined.\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":3},{\"children\":[{\"children\":[{\"children\":[{\"detail\":0,\"format\":4,\"mode\":\"normal\",\"style\":\"\",\"text\":\"This is struck.\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":1,\"type\":\"listitem\",\"version\":1,\"value\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"list\",\"version\":1,\"listType\":\"bullet\",\"start\":1,\"tag\":\"ul\"}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":4}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"list\",\"version\":1,\"listType\":\"bullet\",\"start\":1,\"tag\":\"ul\"}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"root\",\"version\":1}}'
20
+
21
+ const Template = (args) => (
22
+ <ExpandableLexicalPreview {...args} />
23
+ )
24
+
25
+ export const Base = Template.bind({})
26
+ Base.args = {
27
+ nodes,
28
+ title:'Task Instructions',
29
+ }
@@ -12,6 +12,10 @@ const MODALS = [
12
12
  'purple',
13
13
  'yellow',
14
14
  'seagreen',
15
+ 'deepblue',
16
+ 'light-blue',
17
+ 'light-purple',
18
+ 'light-seagreen',
15
19
  ]
16
20
 
17
21
  const UI = [
@@ -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
  },
@@ -0,0 +1,109 @@
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 { LexicalComposer } from '@lexical/react/LexicalComposer'
5
+ import { RichTextPlugin } from '@lexical/react/LexicalRichTextPlugin'
6
+ import { ContentEditable } from '@lexical/react/LexicalContentEditable'
7
+ import { AutoLinkNode, LinkNode } from '@lexical/link'
8
+ import { ListItemNode, ListNode } from '@lexical/list'
9
+
10
+ import PropTypes from 'prop-types'
11
+ import styleNames from '@pareto-engineering/bem/exports'
12
+ import './styles.scss'
13
+
14
+ // Local Definitions
15
+
16
+ const baseClassName = styleNames.base
17
+ const componentClassName = 'lexical-preview'
18
+
19
+ /**
20
+ * This is the component description.
21
+ */
22
+ const LexicalPreview = ({
23
+ id,
24
+ className:userClassName,
25
+ style,
26
+ nodes,
27
+ color,
28
+ // ...otherProps
29
+ }) => {
30
+ const initialConfig = {
31
+ nameSpace :id,
32
+ editable :false,
33
+ editorState:nodes,
34
+ theme :{
35
+ text:{
36
+ italic :'italic',
37
+ strikethrough:'strikethrough',
38
+ underline :'underlined',
39
+ },
40
+ },
41
+ nodes:[
42
+ AutoLinkNode,
43
+ LinkNode,
44
+ ListNode,
45
+ ListItemNode,
46
+ ],
47
+ }
48
+
49
+ return (
50
+ <LexicalComposer
51
+ initialConfig={initialConfig}
52
+ >
53
+ <div
54
+ id={id}
55
+ className={[
56
+ baseClassName,
57
+ componentClassName,
58
+ userClassName,
59
+ `y-${color}`,
60
+ ]
61
+ .filter((e) => e)
62
+ .join(' ')}
63
+ style={style}
64
+ >
65
+ <RichTextPlugin
66
+ contentEditable={(
67
+ <ContentEditable
68
+ id={id}
69
+ className="content-editable"
70
+ />
71
+ )}
72
+ />
73
+ </div>
74
+ </LexicalComposer>
75
+ )
76
+ }
77
+
78
+ LexicalPreview.propTypes = {
79
+ /**
80
+ * The HTML id for this element
81
+ */
82
+ id:PropTypes.string,
83
+
84
+ /**
85
+ * The HTML class names for this element
86
+ */
87
+ className:PropTypes.string,
88
+
89
+ /**
90
+ * The React-written, css properties for this element.
91
+ */
92
+ style:PropTypes.objectOf(PropTypes.string),
93
+
94
+ /**
95
+ * Color of the text
96
+ */
97
+ color:PropTypes.string,
98
+
99
+ /**
100
+ * The nodes to render in the form of a json string
101
+ */
102
+ nodes:PropTypes.string,
103
+ }
104
+
105
+ LexicalPreview.defaultProps = {
106
+ color:'paragraph',
107
+ }
108
+
109
+ export default LexicalPreview
@@ -0,0 +1,2 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ export { default as LexicalPreview } from './LexicalPreview'
@@ -0,0 +1,46 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+
3
+ @use "@pareto-engineering/bem";
4
+ @use "@pareto-engineering/styles/src/mixins";
5
+ @use "@pareto-engineering/styles/src/globals" as *;
6
+
7
+ .#{bem.$base}.lexical-preview {
8
+ > .content-editable {
9
+ color: var(--y);
10
+ overflow: auto;
11
+
12
+ li:has(ol, ul) {
13
+ list-style-type: none;
14
+ }
15
+
16
+ p,
17
+ span,
18
+ strong,
19
+ em,
20
+ li {
21
+ &.underlined {
22
+ text-decoration: underline;
23
+
24
+ &.strikethrough {
25
+ text-decoration: underline line-through;
26
+ }
27
+ }
28
+
29
+ &.strikethrough {
30
+ text-decoration: line-through;
31
+ }
32
+
33
+ &.italic {
34
+ font-style: italic;
35
+ }
36
+ }
37
+
38
+ :first-child {
39
+ margin-top: 0;
40
+ }
41
+
42
+ &::placeholder {
43
+ color: var(--metadata);
44
+ }
45
+ }
46
+ }
@@ -23,28 +23,40 @@ const Person = ({
23
23
  role,
24
24
  color,
25
25
  // ...otherProps
26
- }) => (
27
- <div
28
- id={id}
29
- className={[
26
+ }) => {
27
+ const handleImageSrcError = (e) => {
28
+ e.target.onerror = null
29
+ e.target.src = '/default-avatar.svg'
30
+ }
30
31
 
31
- baseClassName,
32
+ return (
33
+ <div
34
+ id={id}
35
+ className={[
32
36
 
33
- componentClassName,
34
- userClassName,
35
- `y-${color}`,
36
- ]
37
- .filter((e) => e)
38
- .join(' ')}
39
- style={style}
40
- >
41
- <img className="image v50 mr-v" src={image} alt={`${name}, ${role}`} />
42
- <div className="details">
43
- {name && <p className="name">{name}</p>}
44
- { role && <p className="role">{role}</p>}
37
+ baseClassName,
38
+
39
+ componentClassName,
40
+ userClassName,
41
+ `y-${color}`,
42
+ ]
43
+ .filter((e) => e)
44
+ .join(' ')}
45
+ style={style}
46
+ >
47
+ <img
48
+ className="image v50 mr-v"
49
+ src={image || '/default-avatar.svg'}
50
+ alt={`${name}, ${role}`}
51
+ onError={handleImageSrcError}
52
+ />
53
+ <div className="details">
54
+ {name && <p className="name">{name}</p>}
55
+ { role && <p className="role">{role}</p>}
56
+ </div>
45
57
  </div>
46
- </div>
47
- )
58
+ )
59
+ }
48
60
 
49
61
  Person.propTypes = {
50
62
  /**
@@ -24,6 +24,7 @@ const ProgressBar = ({
24
24
  color,
25
25
  progress,
26
26
  height,
27
+ rounded,
27
28
  // ...otherProps
28
29
  }) => (
29
30
  <div
@@ -36,6 +37,7 @@ const ProgressBar = ({
36
37
  attached && styleNames.modifierAttached,
37
38
  color && `x-${color}`,
38
39
  userClassName,
40
+ rounded && 'rounded',
39
41
  ]
40
42
  .filter((e) => e)
41
43
  .join(' ')}
@@ -5,9 +5,11 @@
5
5
  $default-height:var(--height, 1em);
6
6
  $default-border:none;//2px solid var(--grid);
7
7
  $default-transition-duration:.5s;
8
- $default-color:var(--x, var(--main1));
8
+ $default-color:var(--x, var(--main));
9
+ $default-border-radius:var(--theme-border-radius, 1.875rem);
9
10
 
10
11
  .#{bem.$base}.progress-bar {
12
+ background-color: var(--progress-bar-background-color);
11
13
  border: $default-border;
12
14
  height: $default-height;
13
15
  position: relative;
@@ -28,6 +30,14 @@ $default-color:var(--x, var(--main1));
28
30
  z-index: 1;
29
31
  }
30
32
 
33
+ &.rounded {
34
+ border-radius: $default-border-radius;
35
+
36
+ &::after {
37
+ border-radius: $default-border-radius;
38
+ }
39
+ }
40
+
31
41
  &.#{bem.$modifier-attached} {
32
42
  border: unset;
33
43
  border-bottom: $default-border;
@@ -0,0 +1,182 @@
1
+ /* eslint-disable import/no-extraneous-dependencies */
2
+ import * as React from 'react'
3
+
4
+ import { useEffect, useRef } from 'react'
5
+
6
+ import PropTypes from 'prop-types'
7
+
8
+ import { EditorState } from '@codemirror/state'
9
+
10
+ import {
11
+ EditorView,
12
+ keymap,
13
+ lineNumbers,
14
+ drawSelection,
15
+ dropCursor,
16
+ highlightActiveLine,
17
+ highlightActiveLineGutter,
18
+ highlightSpecialChars,
19
+ crosshairCursor,
20
+ rectangularSelection,
21
+ } from '@codemirror/view'
22
+
23
+ import {
24
+ defaultKeymap,
25
+ } from '@codemirror/commands'
26
+
27
+ import {
28
+ indentOnInput,
29
+ bracketMatching,
30
+ foldGutter,
31
+ } from '@codemirror/language'
32
+
33
+ import { xml } from '@codemirror/lang-xml'
34
+
35
+ import styleNames from '@pareto-engineering/bem/exports'
36
+
37
+ import { theme } from './common'
38
+
39
+ import './styles.scss'
40
+
41
+ const baseClassName = styleNames.base
42
+
43
+ const componentClassName = 'code-editor'
44
+
45
+ /**
46
+ * codemirror documentation:
47
+ * https://codemirror.net/
48
+ */
49
+
50
+ const XMLEditor = ({
51
+ id,
52
+ className: userClassName,
53
+ style,
54
+ readOnly,
55
+ height,
56
+ gutterWidth,
57
+ config,
58
+ onChange,
59
+ stopPropagationKeys,
60
+ }) => {
61
+ const editorRef = useRef()
62
+
63
+ useEffect(() => {
64
+ const startState = EditorState.create({
65
+ doc :config,
66
+ extensions:[
67
+ keymap.of(defaultKeymap),
68
+ indentOnInput(),
69
+ lineNumbers(),
70
+ bracketMatching(),
71
+ foldGutter(),
72
+ drawSelection(),
73
+ highlightActiveLine(),
74
+ highlightActiveLineGutter(),
75
+ highlightSpecialChars(),
76
+ dropCursor(),
77
+ rectangularSelection(),
78
+ crosshairCursor(),
79
+ xml(),
80
+ theme,
81
+ EditorState.readOnly.of(readOnly),
82
+ EditorView.updateListener.of((view) => {
83
+ onChange(view)
84
+ // view.state.doc.toString() to receive the current content in the editor.
85
+ }),
86
+ EditorView.domEventHandlers({
87
+ keydown(e) {
88
+ if (stopPropagationKeys?.includes(e.key)) {
89
+ e.stopPropagation()
90
+ }
91
+ },
92
+ }),
93
+ ],
94
+ })
95
+
96
+ const view = new EditorView({
97
+ state :startState,
98
+ parent:editorRef.current,
99
+ })
100
+
101
+ return () => {
102
+ view.destroy()
103
+ }
104
+ }, [editorRef])
105
+
106
+ return (
107
+ <div
108
+ id={id}
109
+ ref={editorRef}
110
+ className={[
111
+ baseClassName,
112
+ componentClassName,
113
+ userClassName,
114
+ ]
115
+ .filter((e) => e)
116
+ .join(' ')}
117
+ style={{
118
+ '--height' :height,
119
+ '--gutter-width':gutterWidth,
120
+ ...style,
121
+ }}
122
+ />
123
+ )
124
+ }
125
+
126
+ XMLEditor.propTypes = {
127
+ /**
128
+ * The HTML id for this element
129
+ */
130
+ id:PropTypes.string,
131
+
132
+ /**
133
+ * The HTML class names for this element
134
+ */
135
+ className:PropTypes.string,
136
+
137
+ /**
138
+ * The React-written, css properties for this element.
139
+ */
140
+ style:PropTypes.objectOf(PropTypes.string),
141
+
142
+ /**
143
+ * Whether or not the content is read only.
144
+ */
145
+ readOnly:PropTypes.bool,
146
+
147
+ /**
148
+ * The initial labeling configuration.
149
+ */
150
+ config:PropTypes.string,
151
+
152
+ /**
153
+ * The height of the editor.
154
+ */
155
+ height:PropTypes.string,
156
+
157
+ /**
158
+ * The callback for when the labeling configuration changes.
159
+ */
160
+ onChange:PropTypes.func,
161
+
162
+ /**
163
+ * The width of the gutter.
164
+ */
165
+ gutterWidth:PropTypes.string,
166
+
167
+ /**
168
+ * The keys to stop propagation on.
169
+ */
170
+ stopPropagationKeys:PropTypes.arrayOf(PropTypes.string),
171
+ }
172
+
173
+ XMLEditor.defaultProps = {
174
+ config:`<View>
175
+ <!--Edit this config to customize the labeling interface.-->
176
+ </View>
177
+ `,
178
+ height :'20em',
179
+ gutterWidth:'3em',
180
+ }
181
+
182
+ export default XMLEditor
@@ -0,0 +1 @@
1
+ export { default as theme } from './theme'