@pareto-engineering/design-system 4.0.0-alpha.78 → 4.0.0-alpha.81

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 (98) hide show
  1. package/dist/cjs/a/Label/styles.scss +1 -1
  2. package/dist/cjs/a/Quote/styles.scss +1 -1
  3. package/dist/cjs/a/Tooltip/Tooltip.js +21 -5
  4. package/dist/cjs/a/Tooltip/styles.scss +44 -36
  5. package/dist/cjs/a/index.js +0 -7
  6. package/dist/cjs/b/Page/common/PageHelmet/PageHelmet.js +4 -1
  7. package/dist/cjs/b/index.js +1 -8
  8. package/dist/cjs/f/fields/EditorInput/EditorInput.js +18 -4
  9. package/dist/cjs/f/fields/EditorInput/common/ColorPicker/ColorPicker.js +8 -4
  10. package/dist/cjs/f/fields/EditorInput/common/ToolbarPlugin/ToolbarPlugin.js +0 -6
  11. package/dist/cjs/f/fields/EditorInput/styles.scss +9 -2
  12. package/dist/cjs/f/fields/SelectInput/SelectInput.js +9 -2
  13. package/dist/cjs/f/fields/SelectInput/common/Single/Single.js +13 -2
  14. package/dist/cjs/f/fields/SelectInput/styles.scss +1 -1
  15. package/dist/cjs/{b → g}/ExpandableLexicalPreview/ExpandableLexicalPreview.js +59 -47
  16. package/dist/cjs/g/ExpandableLexicalPreview/common/NewWindowPortal/NewWindowPortal.js +79 -0
  17. package/dist/cjs/g/ExpandableLexicalPreview/common/NewWindowPortal/index.js +13 -0
  18. package/dist/cjs/g/ExpandableLexicalPreview/common/NewWindowPortal/styles.scss +9 -0
  19. package/dist/cjs/g/ExpandableLexicalPreview/common/index.js +12 -0
  20. package/dist/cjs/g/ExpandableLexicalPreview/styles.scss +34 -0
  21. package/dist/cjs/g/index.js +12 -0
  22. package/dist/cjs/index.js +11 -0
  23. package/dist/es/a/Label/styles.scss +1 -1
  24. package/dist/es/a/Quote/styles.scss +1 -1
  25. package/dist/es/a/Tooltip/Tooltip.js +21 -5
  26. package/dist/es/a/Tooltip/styles.scss +44 -36
  27. package/dist/es/a/index.js +0 -1
  28. package/dist/es/b/Page/common/PageHelmet/PageHelmet.js +4 -1
  29. package/dist/es/b/index.js +1 -2
  30. package/dist/es/f/fields/EditorInput/EditorInput.js +16 -3
  31. package/dist/es/f/fields/EditorInput/common/ColorPicker/ColorPicker.js +8 -4
  32. package/dist/es/f/fields/EditorInput/common/ToolbarPlugin/ToolbarPlugin.js +0 -6
  33. package/dist/es/f/fields/EditorInput/styles.scss +9 -2
  34. package/dist/es/f/fields/SelectInput/SelectInput.js +9 -2
  35. package/dist/es/f/fields/SelectInput/common/Single/Single.js +12 -1
  36. package/dist/es/f/fields/SelectInput/styles.scss +1 -1
  37. package/dist/es/g/ExpandableLexicalPreview/ExpandableLexicalPreview.js +126 -0
  38. package/dist/es/g/ExpandableLexicalPreview/common/NewWindowPortal/NewWindowPortal.js +70 -0
  39. package/dist/es/g/ExpandableLexicalPreview/common/NewWindowPortal/index.js +2 -0
  40. package/dist/es/g/ExpandableLexicalPreview/common/NewWindowPortal/styles.scss +9 -0
  41. package/dist/es/g/ExpandableLexicalPreview/common/index.js +1 -0
  42. package/dist/es/g/ExpandableLexicalPreview/styles.scss +34 -0
  43. package/dist/es/g/index.js +1 -0
  44. package/dist/es/index.js +1 -0
  45. package/package.json +4 -4
  46. package/src/stories/a/Tooltip.stories.jsx +7 -12
  47. package/src/stories/f/SelectInput.stories.jsx +18 -2
  48. package/src/stories/{b → g}/ExpandableLexicalPreview.stories.jsx +13 -5
  49. package/src/ui/a/Label/styles.scss +1 -1
  50. package/src/ui/a/Quote/styles.scss +1 -1
  51. package/src/ui/a/Tooltip/Tooltip.jsx +27 -4
  52. package/src/ui/a/Tooltip/styles.scss +44 -36
  53. package/src/ui/a/index.js +0 -1
  54. package/src/ui/b/Page/common/PageHelmet/PageHelmet.jsx +6 -0
  55. package/src/ui/b/index.js +0 -1
  56. package/src/ui/f/fields/EditorInput/EditorInput.jsx +14 -1
  57. package/src/ui/f/fields/EditorInput/common/ColorPicker/ColorPicker.jsx +8 -3
  58. package/src/ui/f/fields/EditorInput/common/ToolbarPlugin/ToolbarPlugin.jsx +0 -14
  59. package/src/ui/f/fields/EditorInput/styles.scss +9 -2
  60. package/src/ui/f/fields/SelectInput/SelectInput.jsx +10 -2
  61. package/src/ui/f/fields/SelectInput/common/Single/Single.jsx +13 -1
  62. package/src/ui/f/fields/SelectInput/styles.scss +1 -1
  63. package/src/ui/g/ExpandableLexicalPreview/ExpandableLexicalPreview.jsx +180 -0
  64. package/src/ui/g/ExpandableLexicalPreview/common/NewWindowPortal/NewWindowPortal.jsx +80 -0
  65. package/src/ui/g/ExpandableLexicalPreview/common/NewWindowPortal/index.js +2 -0
  66. package/src/ui/g/ExpandableLexicalPreview/common/NewWindowPortal/styles.scss +9 -0
  67. package/src/ui/g/ExpandableLexicalPreview/common/index.js +1 -0
  68. package/src/ui/g/ExpandableLexicalPreview/styles.scss +34 -0
  69. package/src/ui/g/index.js +1 -0
  70. package/src/ui/index.js +1 -0
  71. package/tests/__snapshots__/Storyshots.test.js.snap +221 -99
  72. package/dist/cjs/a/LexicalPreview/LexicalPreview.js +0 -90
  73. package/dist/cjs/a/LexicalPreview/index.js +0 -13
  74. package/dist/cjs/a/LexicalPreview/styles.scss +0 -46
  75. package/dist/cjs/b/ExpandableLexicalPreview/common/ExpandButton/ExpandButton.js +0 -112
  76. package/dist/cjs/b/ExpandableLexicalPreview/common/ExpandButton/index.js +0 -13
  77. package/dist/cjs/b/ExpandableLexicalPreview/common/index.js +0 -12
  78. package/dist/cjs/b/ExpandableLexicalPreview/styles.scss +0 -84
  79. package/dist/es/a/LexicalPreview/LexicalPreview.js +0 -80
  80. package/dist/es/a/LexicalPreview/index.js +0 -2
  81. package/dist/es/a/LexicalPreview/styles.scss +0 -46
  82. package/dist/es/b/ExpandableLexicalPreview/ExpandableLexicalPreview.js +0 -115
  83. package/dist/es/b/ExpandableLexicalPreview/common/ExpandButton/ExpandButton.js +0 -102
  84. package/dist/es/b/ExpandableLexicalPreview/common/ExpandButton/index.js +0 -1
  85. package/dist/es/b/ExpandableLexicalPreview/common/index.js +0 -1
  86. package/dist/es/b/ExpandableLexicalPreview/styles.scss +0 -84
  87. package/src/stories/a/LexicalPreview.stories.jsx +0 -28
  88. package/src/ui/a/LexicalPreview/LexicalPreview.jsx +0 -109
  89. package/src/ui/a/LexicalPreview/index.js +0 -2
  90. package/src/ui/a/LexicalPreview/styles.scss +0 -46
  91. package/src/ui/b/ExpandableLexicalPreview/ExpandableLexicalPreview.jsx +0 -157
  92. package/src/ui/b/ExpandableLexicalPreview/common/ExpandButton/ExpandButton.jsx +0 -123
  93. package/src/ui/b/ExpandableLexicalPreview/common/ExpandButton/index.js +0 -1
  94. package/src/ui/b/ExpandableLexicalPreview/common/index.js +0 -1
  95. package/src/ui/b/ExpandableLexicalPreview/styles.scss +0 -84
  96. /package/dist/cjs/{b → g}/ExpandableLexicalPreview/index.js +0 -0
  97. /package/dist/es/{b → g}/ExpandableLexicalPreview/index.js +0 -0
  98. /package/src/ui/{b → g}/ExpandableLexicalPreview/index.js +0 -0
@@ -1,109 +0,0 @@
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
@@ -1,2 +0,0 @@
1
- /* @pareto-engineering/generator-front 1.0.12 */
2
- export { default as LexicalPreview } from './LexicalPreview'
@@ -1,46 +0,0 @@
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
- }
@@ -1,157 +0,0 @@
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
-
11
- import PropTypes from 'prop-types'
12
- import styleNames from '@pareto-engineering/bem/exports'
13
- import { Button } from '../Button'
14
- import './styles.scss'
15
- import { ExpandButton } from './common'
16
-
17
- // Local Definitions
18
-
19
- const baseClassName = styleNames.base
20
- const componentClassName = 'expandable-lexical-preview'
21
-
22
- /**
23
- * This is the component description.
24
- */
25
- const ExpandableLexicalPreview = ({
26
- id,
27
- className:userClassName,
28
- style,
29
- nodes,
30
- color,
31
- resize,
32
- title,
33
- // ...otherProps
34
- }) => {
35
- const initialConfig = {
36
- nameSpace :id,
37
- editable :false,
38
- editorState:nodes,
39
- theme :{
40
- text:{
41
- italic :'italic',
42
- strikethrough:'strikethrough',
43
- underline :'underlined',
44
- },
45
- },
46
- nodes:[
47
- AutoLinkNode,
48
- LinkNode,
49
- ListNode,
50
- ListItemNode,
51
- ],
52
- }
53
-
54
- const [isExpanded, setIsExpanded] = useState(false)
55
-
56
- const handleButtonClick = () => {
57
- setIsExpanded(!isExpanded)
58
- }
59
-
60
- const Content = useMemo(() => (
61
- <div className="lexical-content">
62
- <RichTextPlugin
63
- contentEditable={(
64
- <ContentEditable
65
- id={id}
66
- className="content-editable"
67
- />
68
- )}
69
- />
70
- <ExpandButton
71
- title={title}
72
- onResolve={handleButtonClick}
73
- />
74
- </div>
75
- ), [id])
76
-
77
- return (
78
- <LexicalComposer
79
- initialConfig={initialConfig}
80
- >
81
- <div
82
- id={id}
83
- className={[
84
- baseClassName,
85
- componentClassName,
86
- userClassName,
87
- `y-${color}`,
88
- isExpanded && 'collapsed',
89
- ]
90
- .filter((e) => e)
91
- .join(' ')}
92
- style={{
93
- '--resize':resize,
94
- ...style,
95
- }}
96
- >
97
- {typeof title === 'string' ? <p className="title h2">{title}</p> : title}
98
- {isExpanded && (
99
- <Button
100
- onClick={handleButtonClick}
101
- color="background-far"
102
- isCompact
103
- >
104
- <span className="ai-icon c-x x-paragraph">
105
- C
106
- </span>
107
- </Button>
108
- )}
109
- {!isExpanded && Content}
110
- </div>
111
- </LexicalComposer>
112
- )
113
- }
114
-
115
- ExpandableLexicalPreview.propTypes = {
116
- /**
117
- * The HTML id for this element
118
- */
119
- id:PropTypes.string,
120
-
121
- /**
122
- * The HTML class names for this element
123
- */
124
- className:PropTypes.string,
125
-
126
- /**
127
- * The React-written, css properties for this element.
128
- */
129
- style:PropTypes.objectOf(PropTypes.string),
130
-
131
- /**
132
- * Color of the text
133
- */
134
- color:PropTypes.string,
135
-
136
- /**
137
- * The nodes to render in the form of a json string
138
- */
139
- nodes:PropTypes.string,
140
-
141
- /**
142
- * The resize property of the textarea
143
- */
144
- resize:PropTypes.string,
145
-
146
- /**
147
- * The title for the preview.
148
- */
149
- title:PropTypes.string,
150
- }
151
-
152
- ExpandableLexicalPreview.defaultProps = {
153
- color :'paragraph',
154
- resize:'vertical',
155
- }
156
-
157
- export default ExpandableLexicalPreview
@@ -1,123 +0,0 @@
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
-
7
- import PropTypes from 'prop-types'
8
- import styleNames from '@pareto-engineering/bem/exports'
9
- import { Button } from '../../../Button'
10
-
11
- // Local Definitions
12
-
13
- const baseClassName = styleNames.base
14
- const componentClassName = 'expand-button'
15
-
16
- /**
17
- * This is the component description.
18
- */
19
- const ExpandButton = ({
20
- id,
21
- className: userClassName,
22
- style,
23
- onResolve,
24
- title,
25
- // ...otherProps
26
- }) => {
27
- const [editor] = useLexicalComposerContext()
28
-
29
- return (
30
- <Button
31
- id={id}
32
- className={[
33
- baseClassName,
34
- componentClassName,
35
- userClassName,
36
- 'ai-icon',
37
- ]
38
- .filter((e) => e)
39
- .join(' ')}
40
- style={style}
41
- color="background-far"
42
- isCompact
43
- onClick={() => {
44
- editor.getEditorState().read(() => {
45
- const rawHtml = $generateHtmlFromNodes(editor)
46
- const preview = window.open('', '_blank', 'width=600,height=600')
47
- preview.document.write(
48
- `<html>
49
- <title>${title || 'Preview'}</title>
50
- <style>
51
- li:has(ol, ul) {
52
- list-style-type: none;
53
- }
54
-
55
- p,
56
- span,
57
- strong,
58
- em,
59
- li {
60
- &.underlined {
61
- text-decoration: underline;
62
-
63
- &.strikethrough {
64
- text-decoration: underline line-through;
65
- }
66
- }
67
-
68
- &.strikethrough {
69
- text-decoration: line-through;
70
- }
71
-
72
- &.italic {
73
- font-style: italic;
74
- }
75
- }
76
-
77
- :first-child {
78
- margin-top: 0;
79
- }
80
-
81
- &::placeholder {
82
- color: #abadb3;
83
- }
84
- </style>
85
- <body>
86
- <style></style>
87
- ${rawHtml}
88
- <button onclick="window.close()">Close Preview</button>
89
- </body></html>`,
90
- )
91
- })
92
- onResolve()
93
- }}
94
- >
95
- D
96
- </Button>
97
-
98
- )
99
- }
100
-
101
- ExpandButton.propTypes = {
102
- /**
103
- * The HTML id for this element
104
- */
105
- id:PropTypes.string,
106
-
107
- /**
108
- * The HTML class names for this element
109
- */
110
- className:PropTypes.string,
111
-
112
- /**
113
- * The React-written, css properties for this element.
114
- */
115
- style:PropTypes.objectOf(PropTypes.string),
116
- }
117
-
118
- ExpandButton.defaultProps = {
119
- // color: 'paragraph',
120
- // resize: 'vertical',
121
- }
122
-
123
- export default ExpandButton
@@ -1 +0,0 @@
1
- export { default as ExpandButton } from './ExpandButton'
@@ -1 +0,0 @@
1
- export { ExpandButton } from './ExpandButton'
@@ -1,84 +0,0 @@
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
- }