@pareto-engineering/design-system 4.0.0-alpha.76 → 4.0.0-alpha.78
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/dist/cjs/a/AnimatedBlobs/AnimatedBlobs.js +1 -1
- package/dist/cjs/a/AnimatedGradient/AnimatedGradient.js +1 -1
- package/dist/cjs/a/AppContext/Context.js +1 -1
- package/dist/cjs/a/AppContext/ContextProvider.js +1 -1
- package/dist/cjs/a/BlurOverlay/BlurOverlay.js +1 -1
- package/dist/cjs/a/ContentTree/ContentTree.js +1 -1
- package/dist/cjs/a/ContentTree/common/Tree/Tree.js +1 -1
- package/dist/cjs/a/Conversation/Context.js +1 -1
- package/dist/cjs/a/Conversation/Conversation.js +1 -1
- package/dist/cjs/a/Conversation/common/Message/Message.js +1 -1
- package/dist/cjs/a/DatePicker/DatePicker.js +1 -1
- package/dist/cjs/a/DotInfo/DotInfo.js +1 -1
- package/dist/cjs/a/Figure/Figure.js +1 -1
- package/dist/cjs/a/HamburgerButton/HamburgerButton.js +1 -1
- package/dist/cjs/a/IconList/IconList.js +1 -1
- package/dist/cjs/a/IconList/common/Item/Item.js +1 -1
- package/dist/cjs/a/Label/Label.js +1 -1
- package/dist/cjs/a/LexicalPreview/LexicalPreview.js +1 -1
- package/dist/cjs/a/LoadingCircle/LoadingCircle.js +1 -1
- package/dist/cjs/a/MetaCard/MetaCard.js +1 -1
- package/dist/cjs/a/People/People.js +1 -1
- package/dist/cjs/a/People/common/Person/Person.js +1 -1
- package/dist/cjs/a/People/styles.scss +1 -1
- package/dist/cjs/a/Popover/Popover.js +1 -1
- package/dist/cjs/a/ProgressBar/ProgressBar.js +1 -1
- package/dist/cjs/a/Quote/Quote.js +16 -6
- package/dist/cjs/a/Quote/styles.scss +16 -37
- package/dist/cjs/a/Removable/Removable.js +1 -1
- package/dist/cjs/a/SVG/SVG.js +1 -1
- package/dist/cjs/a/SVG/common/UseSVG/UseSVG.js +1 -1
- package/dist/cjs/a/SnapScroller/SnapScroller.js +1 -1
- package/dist/cjs/a/Spinner/Spinner.js +1 -1
- package/dist/cjs/a/TextSteps/TextSteps.js +1 -1
- package/dist/cjs/a/Timestamp/Timestamp.js +1 -1
- package/dist/cjs/a/Tip/Tip.js +1 -1
- package/dist/cjs/a/ToggleSwitch/ToggleSwitch.js +1 -1
- package/dist/cjs/a/Tooltip/Tooltip.js +71 -0
- package/dist/cjs/a/Tooltip/index.js +13 -0
- package/dist/cjs/a/Tooltip/styles.scss +53 -0
- package/dist/cjs/a/XMLEditor/XMLEditor.js +1 -1
- package/dist/cjs/a/index.js +8 -1
- package/dist/cjs/b/Button/Button.js +1 -1
- package/dist/cjs/b/Button/common/Group/Group.js +1 -1
- package/dist/cjs/b/Card/Card.js +1 -1
- package/dist/cjs/b/Card/common/Group/Group.js +1 -1
- package/dist/cjs/b/Card/common/Section/Section.js +1 -1
- package/dist/cjs/b/ExpandableLexicalPreview/ExpandableLexicalPreview.js +3 -3
- package/dist/cjs/b/ExpandableLexicalPreview/common/ExpandButton/ExpandButton.js +3 -3
- package/dist/cjs/b/Logo/Logo.js +1 -1
- package/dist/cjs/b/Page/Context.js +1 -1
- package/dist/cjs/b/Page/Page.js +1 -1
- package/dist/cjs/b/Page/common/PageHelmet/PageHelmet.js +1 -1
- package/dist/cjs/b/Page/common/Section/Section.js +1 -1
- package/dist/cjs/b/SocialMediaButton/SocialMediaButton.js +1 -1
- package/dist/cjs/b/ThemeSelector/ThemeSelector.js +1 -1
- package/dist/cjs/b/Title/Title.js +1 -1
- package/dist/cjs/c/Modal/Modal.js +1 -1
- package/dist/cjs/c/Modal/common/ModalHeader/ModalHeader.js +1 -1
- package/dist/cjs/c/Shortener/Shortener.js +1 -1
- package/dist/cjs/c/SocialMediaShareButton/SocialMediaShareButton.js +1 -1
- package/dist/cjs/f/FormInput/FormInput.js +1 -1
- package/dist/cjs/f/common/Debugger/Debugger.js +1 -1
- package/dist/cjs/f/common/Description/Description.js +1 -1
- package/dist/cjs/f/common/Description/styles.scss +1 -2
- package/dist/cjs/f/common/Label/Label.js +1 -1
- package/dist/cjs/f/fields/Checkbox/Checkbox.js +1 -1
- package/dist/cjs/f/fields/ChoicesInput/ChoicesInput.js +1 -1
- package/dist/cjs/f/fields/ChoicesInput/common/Choice/Choice.js +1 -1
- package/dist/cjs/f/fields/EditorInput/EditorInput.js +20 -9
- package/dist/cjs/f/fields/EditorInput/common/BlockFormatDropDown/BlockFormatDropDown.js +256 -0
- package/dist/cjs/f/fields/EditorInput/common/BlockFormatDropDown/index.js +13 -0
- package/dist/cjs/f/fields/EditorInput/common/BlockFormatDropDown/styles.scss +55 -0
- package/dist/cjs/f/fields/EditorInput/common/ColorPicker/ColorPicker.js +94 -0
- package/dist/cjs/f/fields/EditorInput/common/ColorPicker/index.js +13 -0
- package/dist/cjs/f/fields/EditorInput/common/ColorPicker/styles.scss +36 -0
- package/dist/cjs/f/fields/EditorInput/common/FontSizeDropDown/FontSizeDropDown.js +94 -0
- package/dist/cjs/f/fields/EditorInput/common/FontSizeDropDown/index.js +13 -0
- package/dist/cjs/f/fields/EditorInput/common/FontSizeDropDown/styles.scss +55 -0
- package/dist/cjs/f/fields/EditorInput/common/ToolbarPlugin/ToolbarPlugin.js +295 -0
- package/dist/cjs/f/fields/EditorInput/common/ToolbarPlugin/index.js +13 -0
- package/dist/cjs/f/fields/EditorInput/common/ToolbarPlugin/styles.scss +56 -0
- package/dist/cjs/f/fields/EditorInput/common/index.js +24 -3
- package/dist/cjs/f/fields/EditorInput/styles.scss +109 -25
- package/dist/cjs/f/fields/LinkInput/LinkInput.js +1 -1
- package/dist/cjs/f/fields/QueryChoices/QueryChoices.js +1 -1
- package/dist/cjs/f/fields/QueryCombobox/QueryCombobox.js +1 -1
- package/dist/cjs/f/fields/QueryCombobox/common/Combobox/Combobox.js +1 -1
- package/dist/cjs/f/fields/QueryCombobox/common/Menu/Menu.js +1 -1
- package/dist/cjs/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +1 -1
- package/dist/cjs/f/fields/QuerySelect/QuerySelect.js +1 -1
- package/dist/cjs/f/fields/RatingsInput/RatingsInput.js +1 -1
- package/dist/cjs/f/fields/RatingsInput/common/Rating/Rating.js +1 -1
- package/dist/cjs/f/fields/SelectInput/SelectInput.js +1 -1
- package/dist/cjs/f/fields/SelectInput/common/Menu/Menu.js +1 -1
- package/dist/cjs/f/fields/SelectInput/common/Multiple/Multiple.js +1 -1
- package/dist/cjs/f/fields/SelectInput/common/Single/Single.js +1 -1
- package/dist/cjs/f/fields/TextInput/TextInput.js +1 -1
- package/dist/cjs/f/fields/TextInput/styles.scss +5 -2
- package/dist/cjs/f/fields/TextareaInput/TextareaInput.js +1 -1
- package/dist/cjs/test/QueryLoader/QueryLoader.js +1 -1
- package/dist/cjs/test/QueryLoader/common/PreloadedTestData/PreloadedTestData.js +1 -1
- package/dist/cjs/utils/hooks/index.js +7 -0
- package/dist/cjs/utils/hooks/useOutsideClick.js +25 -0
- package/dist/cjs/utils/index.js +6 -0
- package/dist/es/a/People/styles.scss +1 -1
- package/dist/es/a/Quote/Quote.js +15 -5
- package/dist/es/a/Quote/styles.scss +16 -37
- package/dist/es/a/Tooltip/Tooltip.js +59 -0
- package/dist/es/a/Tooltip/index.js +2 -0
- package/dist/es/a/Tooltip/styles.scss +53 -0
- package/dist/es/a/index.js +2 -1
- package/dist/es/b/ExpandableLexicalPreview/ExpandableLexicalPreview.js +1 -1
- package/dist/es/b/ExpandableLexicalPreview/common/ExpandButton/ExpandButton.js +1 -1
- package/dist/es/f/common/Description/styles.scss +1 -2
- package/dist/es/f/fields/EditorInput/EditorInput.js +20 -9
- package/dist/es/f/fields/EditorInput/common/BlockFormatDropDown/BlockFormatDropDown.js +246 -0
- package/dist/es/f/fields/EditorInput/common/BlockFormatDropDown/index.js +2 -0
- package/dist/es/f/fields/EditorInput/common/BlockFormatDropDown/styles.scss +55 -0
- package/dist/es/f/fields/EditorInput/common/ColorPicker/ColorPicker.js +83 -0
- package/dist/es/f/fields/EditorInput/common/ColorPicker/index.js +2 -0
- package/dist/es/f/fields/EditorInput/common/ColorPicker/styles.scss +36 -0
- package/dist/es/f/fields/EditorInput/common/FontSizeDropDown/FontSizeDropDown.js +81 -0
- package/dist/es/f/fields/EditorInput/common/FontSizeDropDown/index.js +2 -0
- package/dist/es/f/fields/EditorInput/common/FontSizeDropDown/styles.scss +55 -0
- package/dist/es/f/fields/EditorInput/common/ToolbarPlugin/ToolbarPlugin.js +283 -0
- package/dist/es/f/fields/EditorInput/common/ToolbarPlugin/index.js +2 -0
- package/dist/es/f/fields/EditorInput/common/ToolbarPlugin/styles.scss +56 -0
- package/dist/es/f/fields/EditorInput/common/index.js +5 -2
- package/dist/es/f/fields/EditorInput/styles.scss +109 -25
- package/dist/es/f/fields/TextInput/styles.scss +5 -2
- package/dist/es/utils/hooks/index.js +2 -1
- package/dist/es/utils/hooks/useOutsideClick.js +19 -0
- package/dist/es/utils/index.js +1 -1
- package/package.json +13 -5
- package/src/stories/a/Quote.stories.jsx +30 -10
- package/src/stories/a/Tooltip.stories.jsx +80 -0
- package/src/stories/a/XMLEditor.stories.jsx +6 -1
- package/src/ui/a/People/styles.scss +1 -1
- package/src/ui/a/Quote/Quote.jsx +16 -9
- package/src/ui/a/Quote/styles.scss +16 -37
- package/src/ui/a/Tooltip/Tooltip.jsx +83 -0
- package/src/ui/a/Tooltip/index.js +2 -0
- package/src/ui/a/Tooltip/styles.scss +53 -0
- package/src/ui/a/index.js +1 -0
- package/src/ui/b/ExpandableLexicalPreview/ExpandableLexicalPreview.jsx +1 -1
- package/src/ui/b/ExpandableLexicalPreview/common/ExpandButton/ExpandButton.jsx +1 -1
- package/src/ui/f/common/Description/styles.scss +1 -2
- package/src/ui/f/fields/EditorInput/EditorInput.jsx +21 -4
- package/src/ui/f/fields/EditorInput/common/BlockFormatDropDown/BlockFormatDropDown.jsx +292 -0
- package/src/ui/f/fields/EditorInput/common/BlockFormatDropDown/index.js +2 -0
- package/src/ui/f/fields/EditorInput/common/BlockFormatDropDown/styles.scss +55 -0
- package/src/ui/f/fields/EditorInput/common/ColorPicker/ColorPicker.jsx +110 -0
- package/src/ui/f/fields/EditorInput/common/ColorPicker/index.js +2 -0
- package/src/ui/f/fields/EditorInput/common/ColorPicker/styles.scss +36 -0
- package/src/ui/f/fields/EditorInput/common/FontSizeDropDown/FontSizeDropDown.jsx +134 -0
- package/src/ui/f/fields/EditorInput/common/FontSizeDropDown/index.js +2 -0
- package/src/ui/f/fields/EditorInput/common/FontSizeDropDown/styles.scss +55 -0
- package/src/ui/f/fields/EditorInput/common/ToolbarPlugin/ToolbarPlugin.jsx +431 -0
- package/src/ui/f/fields/EditorInput/common/ToolbarPlugin/index.js +2 -0
- package/src/ui/f/fields/EditorInput/common/ToolbarPlugin/styles.scss +56 -0
- package/src/ui/f/fields/EditorInput/common/index.js +6 -0
- package/src/ui/f/fields/EditorInput/styles.scss +109 -25
- package/src/ui/f/fields/TextInput/styles.scss +5 -2
- package/src/ui/utils/hooks/index.js +1 -0
- package/src/ui/utils/hooks/useOutsideClick.js +23 -0
- package/src/ui/utils/index.js +1 -1
- package/tests/__snapshots__/Storyshots.test.js.snap +777 -409
- package/tests/mockResizeObserver.js +9 -0
- package/tests/test-setup.js +3 -0
- package/dist/cjs/f/fields/EditorInput/common/Toolbar.js +0 -257
- package/dist/es/f/fields/EditorInput/common/Toolbar.js +0 -246
- package/src/ui/f/fields/EditorInput/common/Toolbar.jsx +0 -356
- package/src/ui/f/fields/EditorInput/common/index.jsx +0 -3
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
import { Tooltip, Button } from 'ui'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title :'a/Tooltip',
|
|
7
|
+
component :Tooltip,
|
|
8
|
+
subcomponents:{
|
|
9
|
+
// Item:Tooltip.Item
|
|
10
|
+
},
|
|
11
|
+
decorators:[
|
|
12
|
+
// storyfn => <div className="">{ storyfn() }</div>,
|
|
13
|
+
],
|
|
14
|
+
argTypes:{
|
|
15
|
+
backgroundColor:{ control: 'color' },
|
|
16
|
+
},
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const ariaDescribedby = 'test-tooltip'
|
|
20
|
+
|
|
21
|
+
export const Base = {
|
|
22
|
+
args:{
|
|
23
|
+
children:(
|
|
24
|
+
<div>
|
|
25
|
+
<ul>
|
|
26
|
+
<li>This is the tooltips content</li>
|
|
27
|
+
<li>Style it the way you want!</li>
|
|
28
|
+
<li>It's a tooltip, no interactive elements please</li>
|
|
29
|
+
</ul>
|
|
30
|
+
</div>
|
|
31
|
+
),
|
|
32
|
+
id:ariaDescribedby,
|
|
33
|
+
},
|
|
34
|
+
render:(args) => (
|
|
35
|
+
<div
|
|
36
|
+
style={{
|
|
37
|
+
paddingTop :'10rem',
|
|
38
|
+
width :'50%',
|
|
39
|
+
margin :'auto',
|
|
40
|
+
display :'flex',
|
|
41
|
+
flexDirection:'column',
|
|
42
|
+
alignItems :'center',
|
|
43
|
+
}}
|
|
44
|
+
>
|
|
45
|
+
<div aria-describedby={ariaDescribedby}>
|
|
46
|
+
<Button>
|
|
47
|
+
Hover on me!
|
|
48
|
+
</Button>
|
|
49
|
+
<Tooltip {...args} />
|
|
50
|
+
</div>
|
|
51
|
+
<p>
|
|
52
|
+
With some more content around
|
|
53
|
+
</p>
|
|
54
|
+
</div>
|
|
55
|
+
),
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export const Left = {
|
|
59
|
+
...Base,
|
|
60
|
+
args:{
|
|
61
|
+
...Base.args,
|
|
62
|
+
position:'left',
|
|
63
|
+
},
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export const Right = {
|
|
67
|
+
...Base,
|
|
68
|
+
args:{
|
|
69
|
+
...Base.args,
|
|
70
|
+
position:'right',
|
|
71
|
+
},
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export const Top = {
|
|
75
|
+
...Base,
|
|
76
|
+
args:{
|
|
77
|
+
...Base.args,
|
|
78
|
+
position:'top',
|
|
79
|
+
},
|
|
80
|
+
}
|
|
@@ -14,7 +14,12 @@ export default {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
const Template = (args) => (
|
|
17
|
-
<
|
|
17
|
+
<div>
|
|
18
|
+
{/* Args as JSON */}
|
|
19
|
+
<pre>{ JSON.stringify(args, null, 2) }</pre>
|
|
20
|
+
</div>
|
|
21
|
+
// TOFIX: Commented out due to issues.
|
|
22
|
+
// <XMLEditor {...args} />
|
|
18
23
|
)
|
|
19
24
|
|
|
20
25
|
export const Base = Template.bind({})
|
|
@@ -13,7 +13,7 @@ $default-horizontal-margin: .5em;
|
|
|
13
13
|
$default-grid-gap: 1em;
|
|
14
14
|
$default-margin: 1.5rem;
|
|
15
15
|
$default-image-margin: var(--default-image-margin, #{$default-margin});
|
|
16
|
-
$default-color: var(--default-color, var(--
|
|
16
|
+
$default-color: var(--default-color, var(--paragraph));
|
|
17
17
|
|
|
18
18
|
.#{bem.$base}.people {
|
|
19
19
|
display: grid;
|
package/src/ui/a/Quote/Quote.jsx
CHANGED
|
@@ -39,13 +39,16 @@ const Quote = ({
|
|
|
39
39
|
style={style}
|
|
40
40
|
// {...otherProps}
|
|
41
41
|
>
|
|
42
|
-
<blockquote cite={source} className="blockquote
|
|
43
|
-
<p className="quotation
|
|
44
|
-
|
|
42
|
+
<blockquote cite={source} className="blockquote">
|
|
43
|
+
<p className="quotation h2">
|
|
44
|
+
<span className="c-x">“</span>
|
|
45
|
+
<span className="c-x">{children}</span>
|
|
46
|
+
<span className="c-x">”</span>
|
|
45
47
|
</p>
|
|
46
48
|
</blockquote>
|
|
47
49
|
<figcaption className="figcaption">
|
|
48
|
-
<
|
|
50
|
+
<span className="x-metadata c-x">-</span>
|
|
51
|
+
<cite className="x-metadata c-x">{author}</cite>
|
|
49
52
|
</figcaption>
|
|
50
53
|
</figure>
|
|
51
54
|
)
|
|
@@ -64,27 +67,31 @@ Quote.propTypes = {
|
|
|
64
67
|
/**
|
|
65
68
|
* The React-written, css properties for this element.
|
|
66
69
|
*/
|
|
67
|
-
style
|
|
70
|
+
style:PropTypes.objectOf(PropTypes.string),
|
|
71
|
+
|
|
68
72
|
/**
|
|
69
73
|
* The children jsx
|
|
70
74
|
*/
|
|
71
75
|
children:PropTypes.node.isRequired,
|
|
76
|
+
|
|
72
77
|
/**
|
|
73
78
|
* A URL for the source of the quotation
|
|
74
79
|
*/
|
|
75
|
-
source
|
|
80
|
+
source:PropTypes.string,
|
|
81
|
+
|
|
76
82
|
/**
|
|
77
83
|
* text representation of the source
|
|
78
84
|
*/
|
|
79
|
-
author
|
|
85
|
+
author:PropTypes.string,
|
|
86
|
+
|
|
80
87
|
/**
|
|
81
88
|
* The color of the quotation text
|
|
82
89
|
*/
|
|
83
|
-
color
|
|
90
|
+
color:PropTypes.string,
|
|
84
91
|
}
|
|
85
92
|
|
|
86
93
|
Quote.defaultProps = {
|
|
87
|
-
color:'
|
|
94
|
+
color:'highlighted',
|
|
88
95
|
}
|
|
89
96
|
|
|
90
97
|
export default Quote
|
|
@@ -4,53 +4,32 @@
|
|
|
4
4
|
@use "@pareto-engineering/styles/src/mixins";
|
|
5
5
|
@use "@pareto-engineering/styles/src/globals" as *;
|
|
6
6
|
|
|
7
|
+
$default-gap: 1.5rem;
|
|
7
8
|
|
|
8
9
|
.#{bem.$base}.quote {
|
|
9
|
-
|
|
10
|
+
border-left: 3px solid var(--x);
|
|
10
11
|
display: flex;
|
|
11
12
|
flex-direction: column;
|
|
12
13
|
|
|
13
|
-
.blockquote {
|
|
14
|
+
> .blockquote {
|
|
14
15
|
margin: 0;
|
|
15
|
-
padding: 0;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.figcaption {
|
|
19
|
-
padding: 0;
|
|
20
|
-
}
|
|
21
16
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
display: inline;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
&::before {
|
|
29
|
-
color: transparent;
|
|
30
|
-
content: "\201C";
|
|
31
|
-
font-size: 4em;
|
|
32
|
-
line-height: 0;
|
|
33
|
-
opacity: inherit;
|
|
34
|
-
position: static;
|
|
35
|
-
-webkit-text-stroke: 1px var(--x);
|
|
36
|
-
vertical-align: -.4em;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
&::after {
|
|
40
|
-
color: transparent;
|
|
41
|
-
content: "\201D";
|
|
42
|
-
font-size: 4em;
|
|
43
|
-
line-height: 0;
|
|
44
|
-
margin-left: -.1em;
|
|
45
|
-
-webkit-text-stroke: 1px var(--x);
|
|
46
|
-
vertical-align: -.6em;
|
|
47
|
-
}
|
|
17
|
+
> .h2 {
|
|
18
|
+
margin-left: 0;
|
|
19
|
+
margin-top: 0;
|
|
48
20
|
}
|
|
49
21
|
|
|
50
|
-
.
|
|
51
|
-
margin:
|
|
22
|
+
> .quotation {
|
|
23
|
+
margin-left: $default-gap;
|
|
52
24
|
}
|
|
53
25
|
}
|
|
54
|
-
}
|
|
55
26
|
|
|
27
|
+
> .figcaption {
|
|
28
|
+
margin-left: $default-gap;
|
|
29
|
+
padding: 0;
|
|
56
30
|
|
|
31
|
+
> cite {
|
|
32
|
+
font-style: normal;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
|
|
4
|
+
import PropTypes from 'prop-types'
|
|
5
|
+
|
|
6
|
+
import styleNames from '@pareto-engineering/bem/exports'
|
|
7
|
+
|
|
8
|
+
import './styles.scss'
|
|
9
|
+
|
|
10
|
+
// Local Definitions
|
|
11
|
+
|
|
12
|
+
const baseClassName = styleNames.base
|
|
13
|
+
|
|
14
|
+
const componentClassName = 'tooltip'
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* This is the component description.
|
|
18
|
+
*/
|
|
19
|
+
const Tooltip = ({
|
|
20
|
+
id,
|
|
21
|
+
className:userClassName,
|
|
22
|
+
style,
|
|
23
|
+
position,
|
|
24
|
+
color,
|
|
25
|
+
children,
|
|
26
|
+
// ...otherProps
|
|
27
|
+
}) => (
|
|
28
|
+
<div
|
|
29
|
+
id={id}
|
|
30
|
+
className={[
|
|
31
|
+
baseClassName,
|
|
32
|
+
componentClassName,
|
|
33
|
+
userClassName,
|
|
34
|
+
position,
|
|
35
|
+
`x-${color}`,
|
|
36
|
+
]
|
|
37
|
+
.filter((e) => e)
|
|
38
|
+
.join(' ')}
|
|
39
|
+
style={style}
|
|
40
|
+
role="tooltip"
|
|
41
|
+
>
|
|
42
|
+
{children}
|
|
43
|
+
</div>
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
Tooltip.propTypes = {
|
|
47
|
+
/**
|
|
48
|
+
* The HTML id for this element
|
|
49
|
+
*/
|
|
50
|
+
id:PropTypes.string.isRequired,
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The HTML class names for this element
|
|
54
|
+
*/
|
|
55
|
+
className:PropTypes.string,
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The React-written, css properties for this element.
|
|
59
|
+
*/
|
|
60
|
+
style:PropTypes.objectOf(PropTypes.string),
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* The children JSX
|
|
64
|
+
*/
|
|
65
|
+
children:PropTypes.node.isRequired,
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* The position of the tooltip with respect to the trigger element
|
|
69
|
+
*/
|
|
70
|
+
position:PropTypes.oneOf(['top', 'bottom', 'left', 'right']),
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* The base color of the tooltip
|
|
74
|
+
*/
|
|
75
|
+
color:PropTypes.string,
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
Tooltip.defaultProps = {
|
|
79
|
+
position:'bottom',
|
|
80
|
+
color :'background-cards',
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export default Tooltip
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
|
|
3
|
+
@use "@pareto-engineering/bem";
|
|
4
|
+
|
|
5
|
+
$default-block-padding: calc(var(--theme-default-padding) / 2);
|
|
6
|
+
$default-inline-padding: var(--theme-default-padding);
|
|
7
|
+
$default-width: var(--tooltip-width, 20rem);
|
|
8
|
+
|
|
9
|
+
.#{bem.$base}.tooltip {
|
|
10
|
+
background: var(--x);
|
|
11
|
+
border: var(--theme-default-border-style) var(--ui-lines);
|
|
12
|
+
border-radius: calc(var(--theme-default-border-radius) / 2);
|
|
13
|
+
opacity: 0;
|
|
14
|
+
padding: $default-block-padding $default-inline-padding;
|
|
15
|
+
position: absolute;
|
|
16
|
+
transform: translateX(var(--horizontal, 0)) translateY(var(--vertical, 0));
|
|
17
|
+
transition: opacity .2s ease, transform .2s ease;
|
|
18
|
+
width: $default-width;
|
|
19
|
+
z-index: 10;
|
|
20
|
+
|
|
21
|
+
:has(> &) {
|
|
22
|
+
position: relative;
|
|
23
|
+
|
|
24
|
+
&:is(:hover, :focus-visible, :active) > .#{bem.$base}.tooltip {
|
|
25
|
+
opacity: 1;
|
|
26
|
+
transition-delay: 200ms;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&.top {
|
|
31
|
+
--horizontal: -50%;
|
|
32
|
+
bottom: calc(100% + $default-block-padding);
|
|
33
|
+
left: 50%;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&.right {
|
|
37
|
+
--vertical: 50%;
|
|
38
|
+
bottom: 50%;
|
|
39
|
+
left: calc(100% + $default-inline-padding);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&.bottom {
|
|
43
|
+
--horizontal: -50%;
|
|
44
|
+
left: 50%;
|
|
45
|
+
top: calc(100% + $default-block-padding);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&.left {
|
|
49
|
+
--vertical: 50%;
|
|
50
|
+
bottom: 50%;
|
|
51
|
+
right: calc(100% + $default-inline-padding);
|
|
52
|
+
}
|
|
53
|
+
}
|
package/src/ui/a/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import { ListItemNode, ListNode } from '@lexical/list'
|
|
|
10
10
|
|
|
11
11
|
import PropTypes from 'prop-types'
|
|
12
12
|
import styleNames from '@pareto-engineering/bem/exports'
|
|
13
|
-
import { Button } from '
|
|
13
|
+
import { Button } from '../Button'
|
|
14
14
|
import './styles.scss'
|
|
15
15
|
import { ExpandButton } from './common'
|
|
16
16
|
|
|
@@ -6,7 +6,7 @@ import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext
|
|
|
6
6
|
|
|
7
7
|
import PropTypes from 'prop-types'
|
|
8
8
|
import styleNames from '@pareto-engineering/bem/exports'
|
|
9
|
-
import { Button } from '
|
|
9
|
+
import { Button } from '../../../Button'
|
|
10
10
|
|
|
11
11
|
// Local Definitions
|
|
12
12
|
|
|
@@ -9,10 +9,15 @@ import { ContentEditable } from '@lexical/react/LexicalContentEditable'
|
|
|
9
9
|
import { OnChangePlugin } from '@lexical/react/LexicalOnChangePlugin'
|
|
10
10
|
import { HistoryPlugin } from '@lexical/react/LexicalHistoryPlugin'
|
|
11
11
|
import { LinkPlugin } from '@lexical/react/LexicalLinkPlugin'
|
|
12
|
+
import LexicalClickableLinkPlugin from '@lexical/react/LexicalClickableLinkPlugin'
|
|
12
13
|
import { ListPlugin } from '@lexical/react/LexicalListPlugin'
|
|
14
|
+
import LexicalErrorBoundary from '@lexical/react/LexicalErrorBoundary'
|
|
13
15
|
import { TabIndentationPlugin } from '@lexical/react/LexicalTabIndentationPlugin'
|
|
14
16
|
import { AutoLinkNode, LinkNode } from '@lexical/link'
|
|
15
17
|
import { ListItemNode, ListNode } from '@lexical/list'
|
|
18
|
+
import { CheckListPlugin } from '@lexical/react/LexicalCheckListPlugin'
|
|
19
|
+
import { HeadingNode, QuoteNode } from '@lexical/rich-text'
|
|
20
|
+
import { CodeHighlightNode, CodeNode } from '@lexical/code'
|
|
16
21
|
|
|
17
22
|
import PropTypes from 'prop-types'
|
|
18
23
|
import styleNames from '@pareto-engineering/bem/exports'
|
|
@@ -20,7 +25,7 @@ import styleNames from '@pareto-engineering/bem/exports'
|
|
|
20
25
|
// Local Definitions
|
|
21
26
|
|
|
22
27
|
import { FormLabel, FormDescription } from '../../common'
|
|
23
|
-
import {
|
|
28
|
+
import { ToolbarPlugin, TreeViewPlugin, StopPropagationPlugin } from './common'
|
|
24
29
|
|
|
25
30
|
import './styles.scss'
|
|
26
31
|
|
|
@@ -107,8 +112,17 @@ const EditorInput = ({
|
|
|
107
112
|
strikethrough:'strikethrough',
|
|
108
113
|
underline :'underlined',
|
|
109
114
|
},
|
|
115
|
+
list:{
|
|
116
|
+
listitemChecked :'lexical-list-item-checked',
|
|
117
|
+
listitemUnchecked:'lexical-list-item-unchecked',
|
|
118
|
+
},
|
|
119
|
+
code:'lexical-code',
|
|
110
120
|
},
|
|
111
121
|
nodes:[
|
|
122
|
+
HeadingNode,
|
|
123
|
+
QuoteNode,
|
|
124
|
+
CodeNode,
|
|
125
|
+
CodeHighlightNode,
|
|
112
126
|
AutoLinkNode,
|
|
113
127
|
LinkNode,
|
|
114
128
|
ListNode,
|
|
@@ -145,18 +159,21 @@ const EditorInput = ({
|
|
|
145
159
|
{label}
|
|
146
160
|
</FormLabel>
|
|
147
161
|
|
|
148
|
-
{ !disabled && <
|
|
162
|
+
{ !disabled && <ToolbarPlugin /> }
|
|
149
163
|
<RichTextPlugin
|
|
150
164
|
contentEditable={(
|
|
151
165
|
<ContentEditable
|
|
152
|
-
id={name}
|
|
153
166
|
className="content-editable"
|
|
167
|
+
id={name}
|
|
154
168
|
/>
|
|
155
169
|
)}
|
|
170
|
+
ErrorBoundary={LexicalErrorBoundary}
|
|
156
171
|
/>
|
|
172
|
+
<ListPlugin />
|
|
173
|
+
<CheckListPlugin />
|
|
157
174
|
<OnChangePlugin onChange={onChange} />
|
|
158
175
|
<LinkPlugin />
|
|
159
|
-
<
|
|
176
|
+
<LexicalClickableLinkPlugin />
|
|
160
177
|
<TabIndentationPlugin />
|
|
161
178
|
<HistoryPlugin />
|
|
162
179
|
{ stopPropagationKeys && (
|