@pareto-engineering/design-system 4.0.0-alpha.77 → 4.0.0-alpha.79
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/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/{LexicalPreview → Tooltip}/index.js +3 -3
- package/dist/cjs/a/Tooltip/styles.scss +56 -0
- package/dist/cjs/a/XMLEditor/XMLEditor.js +1 -1
- package/dist/cjs/a/index.js +8 -8
- 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/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 +5 -2
- 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/b/index.js +1 -8
- 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/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 +37 -12
- 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 +116 -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 +10 -3
- 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 +14 -3
- package/dist/cjs/f/fields/SelectInput/styles.scss +1 -1
- package/dist/cjs/f/fields/TextInput/TextInput.js +1 -1
- package/dist/cjs/f/fields/TextareaInput/TextareaInput.js +1 -1
- package/dist/cjs/{b → g}/ExpandableLexicalPreview/ExpandableLexicalPreview.js +28 -43
- package/dist/cjs/{b → g}/ExpandableLexicalPreview/common/ExpandButton/ExpandButton.js +7 -8
- package/dist/cjs/g/ExpandableLexicalPreview/styles.scss +34 -0
- package/dist/cjs/g/index.js +12 -0
- package/dist/cjs/index.js +11 -0
- 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 +56 -0
- package/dist/es/a/index.js +2 -2
- package/dist/es/b/Page/common/PageHelmet/PageHelmet.js +4 -1
- package/dist/es/b/index.js +1 -2
- package/dist/es/f/fields/EditorInput/EditorInput.js +35 -11
- 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 +116 -25
- package/dist/es/f/fields/SelectInput/SelectInput.js +9 -2
- package/dist/es/f/fields/SelectInput/common/Single/Single.js +12 -1
- package/dist/es/f/fields/SelectInput/styles.scss +1 -1
- package/dist/es/{b → g}/ExpandableLexicalPreview/ExpandableLexicalPreview.js +29 -45
- package/dist/es/{b → g}/ExpandableLexicalPreview/common/ExpandButton/ExpandButton.js +18 -21
- package/dist/es/g/ExpandableLexicalPreview/styles.scss +34 -0
- package/dist/es/g/index.js +1 -0
- package/dist/es/index.js +1 -0
- 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 +14 -6
- 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/stories/f/SelectInput.stories.jsx +18 -2
- package/src/stories/{b → g}/ExpandableLexicalPreview.stories.jsx +2 -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 +56 -0
- package/src/ui/a/index.js +1 -1
- package/src/ui/b/Page/common/PageHelmet/PageHelmet.jsx +6 -0
- package/src/ui/b/index.js +0 -1
- package/src/ui/f/fields/EditorInput/EditorInput.jsx +35 -5
- 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 +116 -25
- package/src/ui/f/fields/SelectInput/SelectInput.jsx +10 -2
- package/src/ui/f/fields/SelectInput/common/Single/Single.jsx +13 -1
- package/src/ui/f/fields/SelectInput/styles.scss +1 -1
- package/src/ui/{b → g}/ExpandableLexicalPreview/ExpandableLexicalPreview.jsx +43 -56
- package/src/ui/{b → g}/ExpandableLexicalPreview/common/ExpandButton/ExpandButton.jsx +32 -36
- package/src/ui/g/ExpandableLexicalPreview/styles.scss +34 -0
- package/src/ui/g/index.js +1 -0
- package/src/ui/index.js +1 -0
- 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 +914 -433
- package/tests/mockResizeObserver.js +9 -0
- package/tests/test-setup.js +3 -0
- package/dist/cjs/a/LexicalPreview/LexicalPreview.js +0 -90
- package/dist/cjs/a/LexicalPreview/styles.scss +0 -46
- package/dist/cjs/b/ExpandableLexicalPreview/styles.scss +0 -84
- package/dist/cjs/f/fields/EditorInput/common/Toolbar.js +0 -257
- package/dist/es/a/LexicalPreview/LexicalPreview.js +0 -80
- package/dist/es/a/LexicalPreview/index.js +0 -2
- package/dist/es/a/LexicalPreview/styles.scss +0 -46
- package/dist/es/b/ExpandableLexicalPreview/styles.scss +0 -84
- package/dist/es/f/fields/EditorInput/common/Toolbar.js +0 -246
- package/src/stories/a/LexicalPreview.stories.jsx +0 -28
- package/src/ui/a/LexicalPreview/LexicalPreview.jsx +0 -109
- package/src/ui/a/LexicalPreview/index.js +0 -2
- package/src/ui/a/LexicalPreview/styles.scss +0 -46
- package/src/ui/b/ExpandableLexicalPreview/styles.scss +0 -84
- package/src/ui/f/fields/EditorInput/common/Toolbar.jsx +0 -356
- package/src/ui/f/fields/EditorInput/common/index.jsx +0 -3
- /package/dist/cjs/{b → g}/ExpandableLexicalPreview/common/ExpandButton/index.js +0 -0
- /package/dist/cjs/{b → g}/ExpandableLexicalPreview/common/index.js +0 -0
- /package/dist/cjs/{b → g}/ExpandableLexicalPreview/index.js +0 -0
- /package/dist/es/{b → g}/ExpandableLexicalPreview/common/ExpandButton/index.js +0 -0
- /package/dist/es/{b → g}/ExpandableLexicalPreview/common/index.js +0 -0
- /package/dist/es/{b → g}/ExpandableLexicalPreview/index.js +0 -0
- /package/src/ui/{b → g}/ExpandableLexicalPreview/common/ExpandButton/index.js +0 -0
- /package/src/ui/{b → g}/ExpandableLexicalPreview/common/index.js +0 -0
- /package/src/ui/{b → g}/ExpandableLexicalPreview/index.js +0 -0
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
|
|
7
7
|
$default-gap: calc(var(--gap) / 2);
|
|
8
8
|
$default-padding: .55em .75em;
|
|
9
|
-
$default-border: 1px solid var(--outline-inputs);
|
|
10
9
|
$default-input-border-radius: var(--theme-default-input-border-radius);
|
|
11
10
|
$default-border: var(--theme-default-input-border);
|
|
12
11
|
$focus-border: var(--theme-focus-input-border);
|
|
@@ -15,6 +14,7 @@ $default-background: var(--background-inputs);
|
|
|
15
14
|
$default-icon-color: var(--on-background-inputs);
|
|
16
15
|
$disabled-background: var(--background-inputs-30);
|
|
17
16
|
$default-color-menu-padding: .5em .25em;
|
|
17
|
+
$default-check-mark-dimensions: 1rem;
|
|
18
18
|
|
|
19
19
|
.#{bem.$base}.editor-input {
|
|
20
20
|
display: flex;
|
|
@@ -24,29 +24,6 @@ $default-color-menu-padding: .5em .25em;
|
|
|
24
24
|
margin-bottom: var(--gap);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
> .#{bem.$base}.toolbar {
|
|
28
|
-
display: flex;
|
|
29
|
-
gap: $default-gap;
|
|
30
|
-
margin-bottom: .25em;
|
|
31
|
-
|
|
32
|
-
> .group {
|
|
33
|
-
> button {
|
|
34
|
-
background: $default-background;
|
|
35
|
-
border: $default-border;
|
|
36
|
-
color: $default-icon-color;
|
|
37
|
-
padding: $default-padding;
|
|
38
|
-
|
|
39
|
-
&.active {
|
|
40
|
-
background-color: $active-background;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.flip {
|
|
46
|
-
transform: scaleX(-1);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
27
|
&:not(.disabled) {
|
|
51
28
|
&:hover,
|
|
52
29
|
&:focus,
|
|
@@ -55,6 +32,11 @@ $default-color-menu-padding: .5em .25em;
|
|
|
55
32
|
border: $focus-border;
|
|
56
33
|
}
|
|
57
34
|
}
|
|
35
|
+
|
|
36
|
+
> .content-editable {
|
|
37
|
+
border-bottom-left-radius: $default-input-border-radius;
|
|
38
|
+
border-bottom-right-radius: $default-input-border-radius;
|
|
39
|
+
}
|
|
58
40
|
}
|
|
59
41
|
|
|
60
42
|
&.disabled {
|
|
@@ -63,6 +45,10 @@ $default-color-menu-padding: .5em .25em;
|
|
|
63
45
|
color: var(--metadata);
|
|
64
46
|
cursor: not-allowed;
|
|
65
47
|
}
|
|
48
|
+
|
|
49
|
+
> .content-editable {
|
|
50
|
+
border-radius: $default-input-border-radius;
|
|
51
|
+
}
|
|
66
52
|
}
|
|
67
53
|
|
|
68
54
|
.color-menu-button {
|
|
@@ -93,7 +79,6 @@ $default-color-menu-padding: .5em .25em;
|
|
|
93
79
|
> .content-editable {
|
|
94
80
|
background: $default-background;
|
|
95
81
|
border: $default-border;
|
|
96
|
-
border-radius: $default-input-border-radius;
|
|
97
82
|
color: var(--y);
|
|
98
83
|
height: var(--rows);
|
|
99
84
|
outline: none;
|
|
@@ -102,10 +87,116 @@ $default-color-menu-padding: .5em .25em;
|
|
|
102
87
|
resize: var(--resize);
|
|
103
88
|
width: 100%;
|
|
104
89
|
|
|
90
|
+
.lexical-list-item-checked,
|
|
91
|
+
.lexical-list-item-unchecked {
|
|
92
|
+
list-style-type: none;
|
|
93
|
+
margin-inline: calc(var(--gap) / 2);
|
|
94
|
+
outline: none;
|
|
95
|
+
padding-inline: calc(var(--theme-default-padding) * 1.5);
|
|
96
|
+
position: relative;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.lexical-list-item-checked {
|
|
100
|
+
text-decoration: line-through;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.lexical-list-item-unchecked::before,
|
|
104
|
+
.lexical-list-item-checked::before {
|
|
105
|
+
background-size: cover;
|
|
106
|
+
content: "";
|
|
107
|
+
cursor: pointer;
|
|
108
|
+
display: block;
|
|
109
|
+
height: $default-check-mark-dimensions;
|
|
110
|
+
left: 0;
|
|
111
|
+
position: absolute;
|
|
112
|
+
top: 2px;
|
|
113
|
+
width: $default-check-mark-dimensions;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.lexical-list-item-unchecked[dir="rtl"]::before,
|
|
117
|
+
.lexical-list-item-checked[dir="rtl"]::before {
|
|
118
|
+
left: auto;
|
|
119
|
+
right: 0;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.lexical-list-item-unchecked:focus::before,
|
|
123
|
+
.lexical-list-item-checked:focus::before {
|
|
124
|
+
border-radius: 2px;
|
|
125
|
+
box-shadow: 0 0 0 2px var(--light-blue);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.lexical-list-item-unchecked::before {
|
|
129
|
+
border: var(--theme-default-border-style) var(--ui-icons);
|
|
130
|
+
border-radius: 2px;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.lexical-list-item-checked::before {
|
|
134
|
+
background-color: var(--blue);
|
|
135
|
+
background-repeat: no-repeat;
|
|
136
|
+
border: var(--theme-default-border-style) var(--soft-blue);
|
|
137
|
+
border-radius: 2px;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.lexical-list-item-checked::after {
|
|
141
|
+
border-color: var(--background-far);
|
|
142
|
+
border-style: solid;
|
|
143
|
+
border-width: 0 2px 2px 0;
|
|
144
|
+
content: "";
|
|
145
|
+
cursor: pointer;
|
|
146
|
+
display: block;
|
|
147
|
+
height: 6px;
|
|
148
|
+
left: 7px;
|
|
149
|
+
position: absolute;
|
|
150
|
+
right: 7px;
|
|
151
|
+
top: 6px;
|
|
152
|
+
transform: rotate(45deg);
|
|
153
|
+
width: 3px;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.lexical-code {
|
|
157
|
+
background-color: var(--hard-background-cards);
|
|
158
|
+
display: block;
|
|
159
|
+
font-size: calc(var(--s-1) * 1rem);
|
|
160
|
+
margin: 0;
|
|
161
|
+
margin-bottom: calc(var(--gap) / 2);
|
|
162
|
+
margin-top: calc(var(--gap) / 2);
|
|
163
|
+
overflow-x: auto;
|
|
164
|
+
padding-block: calc(var(--theme-default-padding) / 2);
|
|
165
|
+
padding-bottom: calc(var(--theme-default-padding) / 2);
|
|
166
|
+
padding-left: calc(var(--theme-default-padding) * 2);
|
|
167
|
+
position: relative;
|
|
168
|
+
tab-size: 2;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.lexical-code::before {
|
|
172
|
+
background-color: var(--hard-background-cards);
|
|
173
|
+
border-right: var(--theme-default-border-style) var(--ui-icons);
|
|
174
|
+
color: var(--pagraph);
|
|
175
|
+
content: attr(data-gutter);
|
|
176
|
+
left: 0;
|
|
177
|
+
padding: calc(var(--theme-default-padding) / 2);
|
|
178
|
+
position: absolute;
|
|
179
|
+
text-align: right;
|
|
180
|
+
top: 0;
|
|
181
|
+
white-space: pre-wrap;
|
|
182
|
+
}
|
|
183
|
+
|
|
105
184
|
li:has(ol, ul) {
|
|
106
185
|
list-style-type: none;
|
|
107
186
|
}
|
|
108
187
|
|
|
188
|
+
a {
|
|
189
|
+
cursor: pointer;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
blockquote {
|
|
193
|
+
border-left: 4px solid var(--ui-icons);
|
|
194
|
+
font-size: calc(var(--s0) * 1rem);
|
|
195
|
+
margin: 0;
|
|
196
|
+
margin-left: var(--gap);
|
|
197
|
+
padding-left: calc(var(--theme-default-padding) / 2);
|
|
198
|
+
}
|
|
199
|
+
|
|
109
200
|
p,
|
|
110
201
|
span,
|
|
111
202
|
strong,
|
|
@@ -23,6 +23,7 @@ const SelectInput = ({
|
|
|
23
23
|
labelColor,
|
|
24
24
|
color,
|
|
25
25
|
options,
|
|
26
|
+
hasDefault,
|
|
26
27
|
validate,
|
|
27
28
|
optional,
|
|
28
29
|
description,
|
|
@@ -40,6 +41,7 @@ const SelectInput = ({
|
|
|
40
41
|
labelColor,
|
|
41
42
|
color,
|
|
42
43
|
options,
|
|
44
|
+
hasDefault,
|
|
43
45
|
validate,
|
|
44
46
|
optional,
|
|
45
47
|
description,
|
|
@@ -124,10 +126,15 @@ SelectInput.propTypes = {
|
|
|
124
126
|
/**
|
|
125
127
|
* The placeholder of the select input
|
|
126
128
|
*/
|
|
127
|
-
placeholder: PropTypes.string
|
|
129
|
+
placeholder: PropTypes.string,
|
|
130
|
+
/**
|
|
131
|
+
* Whether this select input has a default value(s)
|
|
132
|
+
*/
|
|
133
|
+
hasDefault: PropTypes.bool
|
|
128
134
|
};
|
|
129
135
|
SelectInput.defaultProps = {
|
|
130
136
|
disabled: false,
|
|
131
|
-
multiple: false
|
|
137
|
+
multiple: false,
|
|
138
|
+
hasDefault: false
|
|
132
139
|
};
|
|
133
140
|
export default /*#__PURE__*/memo(SelectInput);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
/* @pareto-engineering/generator-front 1.0.12 */
|
|
3
3
|
import * as React from 'react';
|
|
4
|
+
import { useEffect } from 'react';
|
|
4
5
|
import { useField } from 'formik';
|
|
5
6
|
import PropTypes from 'prop-types';
|
|
6
7
|
import styleNames from '@pareto-engineering/bem/exports';
|
|
@@ -24,6 +25,7 @@ const Single = ({
|
|
|
24
25
|
labelColor,
|
|
25
26
|
color,
|
|
26
27
|
options,
|
|
28
|
+
hasDefault,
|
|
27
29
|
validate,
|
|
28
30
|
optional,
|
|
29
31
|
description,
|
|
@@ -32,10 +34,19 @@ const Single = ({
|
|
|
32
34
|
autoComplete
|
|
33
35
|
// ...otherProps
|
|
34
36
|
}) => {
|
|
35
|
-
const [field] = useField({
|
|
37
|
+
const [field,, helpers] = useField({
|
|
36
38
|
name,
|
|
37
39
|
validate
|
|
38
40
|
});
|
|
41
|
+
const {
|
|
42
|
+
setValue
|
|
43
|
+
} = helpers;
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
if (hasDefault && !field.value) {
|
|
46
|
+
const defaultOption = options.find(option => option.isDefault);
|
|
47
|
+
setValue(defaultOption?.value);
|
|
48
|
+
}
|
|
49
|
+
}, [hasDefault]);
|
|
39
50
|
return /*#__PURE__*/React.createElement("div", {
|
|
40
51
|
id: id,
|
|
41
52
|
className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
|
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
-
/* eslint-disable import/no-extraneous-dependencies -- required here */
|
|
3
2
|
import * as React from 'react';
|
|
4
|
-
import { useState
|
|
5
|
-
import {
|
|
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';
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { Formik } from 'formik';
|
|
10
5
|
import PropTypes from 'prop-types';
|
|
11
6
|
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
7
|
|
|
16
8
|
// Local Definitions
|
|
17
|
-
|
|
9
|
+
import { EditorInput } from "../../f";
|
|
10
|
+
import { Button } from "../../b";
|
|
11
|
+
import { ExpandButton } from "./common";
|
|
12
|
+
import "./styles.scss";
|
|
18
13
|
const baseClassName = styleNames.base;
|
|
19
14
|
const componentClassName = 'expandable-lexical-preview';
|
|
20
|
-
|
|
21
15
|
/**
|
|
22
16
|
* This is the component description.
|
|
23
17
|
*/
|
|
@@ -26,57 +20,43 @@ const ExpandableLexicalPreview = ({
|
|
|
26
20
|
className: userClassName,
|
|
27
21
|
style,
|
|
28
22
|
nodes,
|
|
23
|
+
name,
|
|
29
24
|
color,
|
|
30
25
|
resize,
|
|
31
26
|
title
|
|
32
27
|
// ...otherProps
|
|
33
28
|
}) => {
|
|
34
|
-
const
|
|
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
|
-
};
|
|
29
|
+
const [editorState, setEditorState] = useState();
|
|
47
30
|
const [isExpanded, setIsExpanded] = useState(false);
|
|
48
31
|
const handleButtonClick = () => {
|
|
49
32
|
setIsExpanded(!isExpanded);
|
|
50
33
|
};
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
|
34
|
+
return /*#__PURE__*/React.createElement(Formik, {
|
|
35
|
+
initialValues: {
|
|
36
|
+
[name]: nodes
|
|
37
|
+
}
|
|
64
38
|
}, /*#__PURE__*/React.createElement("div", {
|
|
65
39
|
id: id,
|
|
66
40
|
className: [baseClassName, componentClassName, userClassName, `y-${color}`, isExpanded && 'collapsed'].filter(e => e).join(' '),
|
|
67
|
-
style:
|
|
68
|
-
'--resize': resize,
|
|
69
|
-
...style
|
|
70
|
-
}
|
|
41
|
+
style: style
|
|
71
42
|
}, typeof title === 'string' ? /*#__PURE__*/React.createElement("p", {
|
|
72
43
|
className: "title h2"
|
|
73
|
-
}, title) : title, isExpanded
|
|
44
|
+
}, title) : title, isExpanded ? /*#__PURE__*/React.createElement(Button, {
|
|
74
45
|
onClick: handleButtonClick,
|
|
75
46
|
color: "background-far",
|
|
76
47
|
isCompact: true
|
|
77
48
|
}, /*#__PURE__*/React.createElement("span", {
|
|
78
49
|
className: "ai-icon c-x x-paragraph"
|
|
79
|
-
}, "C")),
|
|
50
|
+
}, "C")) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(EditorInput, {
|
|
51
|
+
name: name,
|
|
52
|
+
setEditorState: setEditorState,
|
|
53
|
+
resize: resize,
|
|
54
|
+
disabled: true
|
|
55
|
+
}), /*#__PURE__*/React.createElement(ExpandButton, {
|
|
56
|
+
title: title,
|
|
57
|
+
onResolve: handleButtonClick,
|
|
58
|
+
editorState: editorState
|
|
59
|
+
}))));
|
|
80
60
|
};
|
|
81
61
|
ExpandableLexicalPreview.propTypes = {
|
|
82
62
|
/**
|
|
@@ -106,7 +86,11 @@ ExpandableLexicalPreview.propTypes = {
|
|
|
106
86
|
/**
|
|
107
87
|
* The title for the preview.
|
|
108
88
|
*/
|
|
109
|
-
title: PropTypes.string
|
|
89
|
+
title: PropTypes.string,
|
|
90
|
+
/**
|
|
91
|
+
* The name used to acces the nodes
|
|
92
|
+
*/
|
|
93
|
+
name: PropTypes.string.isRequired
|
|
110
94
|
};
|
|
111
95
|
ExpandableLexicalPreview.defaultProps = {
|
|
112
96
|
color: 'paragraph',
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
/* eslint-disable import/no-extraneous-dependencies -- required here */
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { $generateHtmlFromNodes } from '@lexical/html';
|
|
5
|
-
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
6
5
|
import PropTypes from 'prop-types';
|
|
7
6
|
import styleNames from '@pareto-engineering/bem/exports';
|
|
8
|
-
import { Button } from
|
|
7
|
+
import { Button } from "../../../../b";
|
|
9
8
|
|
|
10
9
|
// Local Definitions
|
|
11
10
|
|
|
@@ -20,21 +19,20 @@ const ExpandButton = ({
|
|
|
20
19
|
className: userClassName,
|
|
21
20
|
style,
|
|
22
21
|
onResolve,
|
|
23
|
-
title
|
|
22
|
+
title,
|
|
23
|
+
editorState
|
|
24
24
|
// ...otherProps
|
|
25
|
-
}) => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const preview = window.open('', '_blank', 'width=600,height=600');
|
|
37
|
-
preview.document.write(`<html>
|
|
25
|
+
}) => /*#__PURE__*/React.createElement(Button, {
|
|
26
|
+
id: id,
|
|
27
|
+
className: [baseClassName, componentClassName, userClassName, 'ai-icon'].filter(e => e).join(' '),
|
|
28
|
+
style: style,
|
|
29
|
+
color: "background-far",
|
|
30
|
+
isCompact: true,
|
|
31
|
+
onClick: () => {
|
|
32
|
+
editorState.getEditorState().read(() => {
|
|
33
|
+
const rawHtml = $generateHtmlFromNodes(editorState);
|
|
34
|
+
const preview = window.open('', '_blank', 'width=600,height=600');
|
|
35
|
+
preview.document.write(`<html>
|
|
38
36
|
<title>${title || 'Preview'}</title>
|
|
39
37
|
<style>
|
|
40
38
|
li:has(ol, ul) {
|
|
@@ -76,11 +74,10 @@ const ExpandButton = ({
|
|
|
76
74
|
${rawHtml}
|
|
77
75
|
<button onclick="window.close()">Close Preview</button>
|
|
78
76
|
</body></html>`);
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
};
|
|
77
|
+
});
|
|
78
|
+
onResolve();
|
|
79
|
+
}
|
|
80
|
+
}, "D");
|
|
84
81
|
ExpandButton.propTypes = {
|
|
85
82
|
/**
|
|
86
83
|
* The HTML id for this element
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
|
|
3
|
+
@use "@pareto-engineering/bem";
|
|
4
|
+
|
|
5
|
+
.#{bem.$base}.expandable-lexical-preview {
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
flex-wrap: wrap;
|
|
9
|
+
gap: var(--gap);
|
|
10
|
+
position: relative;
|
|
11
|
+
width: 100%;
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
&.collapsed {
|
|
15
|
+
flex-direction: row;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
> .title {
|
|
19
|
+
margin: 0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
> .#{bem.$base}.button {
|
|
23
|
+
align-items: center;
|
|
24
|
+
border: 1px solid var(--outline-inputs);
|
|
25
|
+
display: flex;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
> .#{bem.$base}.expand-button {
|
|
29
|
+
border: 1px solid var(--outline-inputs);
|
|
30
|
+
position: absolute;
|
|
31
|
+
right: 1em;
|
|
32
|
+
top: 5.5rem;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ExpandableLexicalPreview } from "./ExpandableLexicalPreview";
|
package/dist/es/index.js
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
const useOutsideClick = (ref, callback) => {
|
|
3
|
+
// const ref = useRef(null)
|
|
4
|
+
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
const handleClickOutside = event => {
|
|
7
|
+
if (ref.current && !ref.current.contains(event.target)) {
|
|
8
|
+
callback();
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
12
|
+
document.addEventListener('touchstart', handleClickOutside);
|
|
13
|
+
return () => {
|
|
14
|
+
document.removeEventListener('mousedown', handleClickOutside);
|
|
15
|
+
document.removeEventListener('touchstart', handleClickOutside);
|
|
16
|
+
};
|
|
17
|
+
}, [callback]);
|
|
18
|
+
};
|
|
19
|
+
export default useOutsideClick;
|
package/dist/es/utils/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { useWindowSize, useDynamicPosition } from "./hooks";
|
|
1
|
+
export { useWindowSize, useDynamicPosition, useOutsideClick } from "./hooks";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pareto-engineering/design-system",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.79",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/es/index.js",
|
|
@@ -51,21 +51,29 @@
|
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@codemirror/lang-xml": "^6.0.2",
|
|
54
|
-
"@lexical/
|
|
55
|
-
"@
|
|
54
|
+
"@lexical/code": "0.12.2",
|
|
55
|
+
"@lexical/link": "0.12.2",
|
|
56
|
+
"@lexical/list": "0.12.2",
|
|
57
|
+
"@lexical/react": "0.12.2",
|
|
58
|
+
"@lexical/rich-text": "0.12.2",
|
|
59
|
+
"@lexical/selection": "0.12.2",
|
|
60
|
+
"@lexical/table": "0.12.2",
|
|
61
|
+
"@lexical/utils": "0.12.2",
|
|
62
|
+
"@pareto-engineering/assets": "^4.0.0-alpha.78",
|
|
56
63
|
"@pareto-engineering/bem": "^4.0.0-alpha.20",
|
|
57
64
|
"@pareto-engineering/styles": "^4.0.0-alpha.73",
|
|
58
|
-
"@pareto-engineering/utils": "^4.0.0-alpha.
|
|
65
|
+
"@pareto-engineering/utils": "^4.0.0-alpha.79",
|
|
59
66
|
"codemirror": "^6.0.1",
|
|
60
67
|
"date-fns": "^2.29.3",
|
|
61
68
|
"downshift": "^6.1.12",
|
|
62
69
|
"formik": "^2.2.9",
|
|
63
70
|
"fuse.js": "^7.0.0",
|
|
64
71
|
"hamburgers": "^1.2.1",
|
|
65
|
-
"lexical": "
|
|
72
|
+
"lexical": "0.12.2",
|
|
66
73
|
"lodash": "^4.17.21",
|
|
67
74
|
"prop-types": "^15.8.1",
|
|
68
75
|
"react": "^18.2.0",
|
|
76
|
+
"react-color-palette": "^7.1.0",
|
|
69
77
|
"react-day-picker": "^8.10.0",
|
|
70
78
|
"react-dom": "^18.2.0",
|
|
71
79
|
"react-helmet-async": "^1.3.0",
|
|
@@ -74,5 +82,5 @@
|
|
|
74
82
|
"relay-test-utils": "^15.0.0"
|
|
75
83
|
},
|
|
76
84
|
"browserslist": "> 2%",
|
|
77
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "593a12393a1966a555d50ede309f2acfee44f48d"
|
|
78
86
|
}
|
|
@@ -13,17 +13,37 @@ export default {
|
|
|
13
13
|
// storyfn => <div className="">{ storyfn() }</div>,
|
|
14
14
|
],
|
|
15
15
|
argTypes:{
|
|
16
|
-
|
|
16
|
+
children:{
|
|
17
|
+
control:{
|
|
18
|
+
type:'text',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
source:{
|
|
22
|
+
control:{
|
|
23
|
+
type:'text',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
author:{
|
|
27
|
+
control:{
|
|
28
|
+
type:'text',
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
color:{
|
|
32
|
+
control:{
|
|
33
|
+
type:'text',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
17
36
|
},
|
|
18
37
|
}
|
|
19
38
|
|
|
20
|
-
|
|
21
|
-
<
|
|
22
|
-
<Quote
|
|
23
|
-
author="Austen Spoonts"
|
|
24
|
-
>
|
|
25
|
-
Pareto was like having a full-time employee without having to hire somebody.
|
|
26
|
-
That’s how I would explain it. An on-call, on-demand full-time employee.
|
|
27
|
-
</Quote>
|
|
28
|
-
</div>
|
|
39
|
+
const Template = (args) => (
|
|
40
|
+
<Quote {...args} />
|
|
29
41
|
)
|
|
42
|
+
|
|
43
|
+
export const Base = Template.bind({})
|
|
44
|
+
Base.args = {
|
|
45
|
+
children:'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.',
|
|
46
|
+
source :'https://example.com',
|
|
47
|
+
author :'John Doe',
|
|
48
|
+
color :'highlighted',
|
|
49
|
+
}
|