@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.
Files changed (210) hide show
  1. package/dist/cjs/a/AnimatedBlobs/AnimatedBlobs.js +1 -1
  2. package/dist/cjs/a/AnimatedGradient/AnimatedGradient.js +1 -1
  3. package/dist/cjs/a/AppContext/Context.js +1 -1
  4. package/dist/cjs/a/AppContext/ContextProvider.js +1 -1
  5. package/dist/cjs/a/BlurOverlay/BlurOverlay.js +1 -1
  6. package/dist/cjs/a/ContentTree/ContentTree.js +1 -1
  7. package/dist/cjs/a/ContentTree/common/Tree/Tree.js +1 -1
  8. package/dist/cjs/a/Conversation/Context.js +1 -1
  9. package/dist/cjs/a/Conversation/Conversation.js +1 -1
  10. package/dist/cjs/a/Conversation/common/Message/Message.js +1 -1
  11. package/dist/cjs/a/DatePicker/DatePicker.js +1 -1
  12. package/dist/cjs/a/DotInfo/DotInfo.js +1 -1
  13. package/dist/cjs/a/Figure/Figure.js +1 -1
  14. package/dist/cjs/a/HamburgerButton/HamburgerButton.js +1 -1
  15. package/dist/cjs/a/IconList/IconList.js +1 -1
  16. package/dist/cjs/a/IconList/common/Item/Item.js +1 -1
  17. package/dist/cjs/a/Label/Label.js +1 -1
  18. package/dist/cjs/a/LoadingCircle/LoadingCircle.js +1 -1
  19. package/dist/cjs/a/MetaCard/MetaCard.js +1 -1
  20. package/dist/cjs/a/People/People.js +1 -1
  21. package/dist/cjs/a/People/common/Person/Person.js +1 -1
  22. package/dist/cjs/a/People/styles.scss +1 -1
  23. package/dist/cjs/a/Popover/Popover.js +1 -1
  24. package/dist/cjs/a/ProgressBar/ProgressBar.js +1 -1
  25. package/dist/cjs/a/Quote/Quote.js +16 -6
  26. package/dist/cjs/a/Quote/styles.scss +16 -37
  27. package/dist/cjs/a/Removable/Removable.js +1 -1
  28. package/dist/cjs/a/SVG/SVG.js +1 -1
  29. package/dist/cjs/a/SVG/common/UseSVG/UseSVG.js +1 -1
  30. package/dist/cjs/a/SnapScroller/SnapScroller.js +1 -1
  31. package/dist/cjs/a/Spinner/Spinner.js +1 -1
  32. package/dist/cjs/a/TextSteps/TextSteps.js +1 -1
  33. package/dist/cjs/a/Timestamp/Timestamp.js +1 -1
  34. package/dist/cjs/a/Tip/Tip.js +1 -1
  35. package/dist/cjs/a/ToggleSwitch/ToggleSwitch.js +1 -1
  36. package/dist/cjs/a/Tooltip/Tooltip.js +71 -0
  37. package/dist/cjs/a/{LexicalPreview → Tooltip}/index.js +3 -3
  38. package/dist/cjs/a/Tooltip/styles.scss +56 -0
  39. package/dist/cjs/a/XMLEditor/XMLEditor.js +1 -1
  40. package/dist/cjs/a/index.js +8 -8
  41. package/dist/cjs/b/Button/Button.js +1 -1
  42. package/dist/cjs/b/Button/common/Group/Group.js +1 -1
  43. package/dist/cjs/b/Card/Card.js +1 -1
  44. package/dist/cjs/b/Card/common/Group/Group.js +1 -1
  45. package/dist/cjs/b/Card/common/Section/Section.js +1 -1
  46. package/dist/cjs/b/Logo/Logo.js +1 -1
  47. package/dist/cjs/b/Page/Context.js +1 -1
  48. package/dist/cjs/b/Page/Page.js +1 -1
  49. package/dist/cjs/b/Page/common/PageHelmet/PageHelmet.js +5 -2
  50. package/dist/cjs/b/Page/common/Section/Section.js +1 -1
  51. package/dist/cjs/b/SocialMediaButton/SocialMediaButton.js +1 -1
  52. package/dist/cjs/b/ThemeSelector/ThemeSelector.js +1 -1
  53. package/dist/cjs/b/Title/Title.js +1 -1
  54. package/dist/cjs/b/index.js +1 -8
  55. package/dist/cjs/c/Modal/Modal.js +1 -1
  56. package/dist/cjs/c/Modal/common/ModalHeader/ModalHeader.js +1 -1
  57. package/dist/cjs/c/Shortener/Shortener.js +1 -1
  58. package/dist/cjs/c/SocialMediaShareButton/SocialMediaShareButton.js +1 -1
  59. package/dist/cjs/f/FormInput/FormInput.js +1 -1
  60. package/dist/cjs/f/common/Debugger/Debugger.js +1 -1
  61. package/dist/cjs/f/common/Description/Description.js +1 -1
  62. package/dist/cjs/f/common/Label/Label.js +1 -1
  63. package/dist/cjs/f/fields/Checkbox/Checkbox.js +1 -1
  64. package/dist/cjs/f/fields/ChoicesInput/ChoicesInput.js +1 -1
  65. package/dist/cjs/f/fields/ChoicesInput/common/Choice/Choice.js +1 -1
  66. package/dist/cjs/f/fields/EditorInput/EditorInput.js +37 -12
  67. package/dist/cjs/f/fields/EditorInput/common/BlockFormatDropDown/BlockFormatDropDown.js +256 -0
  68. package/dist/cjs/f/fields/EditorInput/common/BlockFormatDropDown/index.js +13 -0
  69. package/dist/cjs/f/fields/EditorInput/common/BlockFormatDropDown/styles.scss +55 -0
  70. package/dist/cjs/f/fields/EditorInput/common/ColorPicker/ColorPicker.js +94 -0
  71. package/dist/cjs/f/fields/EditorInput/common/ColorPicker/index.js +13 -0
  72. package/dist/cjs/f/fields/EditorInput/common/ColorPicker/styles.scss +36 -0
  73. package/dist/cjs/f/fields/EditorInput/common/FontSizeDropDown/FontSizeDropDown.js +94 -0
  74. package/dist/cjs/f/fields/EditorInput/common/FontSizeDropDown/index.js +13 -0
  75. package/dist/cjs/f/fields/EditorInput/common/FontSizeDropDown/styles.scss +55 -0
  76. package/dist/cjs/f/fields/EditorInput/common/ToolbarPlugin/ToolbarPlugin.js +295 -0
  77. package/dist/cjs/f/fields/EditorInput/common/ToolbarPlugin/index.js +13 -0
  78. package/dist/cjs/f/fields/EditorInput/common/ToolbarPlugin/styles.scss +56 -0
  79. package/dist/cjs/f/fields/EditorInput/common/index.js +24 -3
  80. package/dist/cjs/f/fields/EditorInput/styles.scss +116 -25
  81. package/dist/cjs/f/fields/LinkInput/LinkInput.js +1 -1
  82. package/dist/cjs/f/fields/QueryChoices/QueryChoices.js +1 -1
  83. package/dist/cjs/f/fields/QueryCombobox/QueryCombobox.js +1 -1
  84. package/dist/cjs/f/fields/QueryCombobox/common/Combobox/Combobox.js +1 -1
  85. package/dist/cjs/f/fields/QueryCombobox/common/Menu/Menu.js +1 -1
  86. package/dist/cjs/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +1 -1
  87. package/dist/cjs/f/fields/QuerySelect/QuerySelect.js +1 -1
  88. package/dist/cjs/f/fields/RatingsInput/RatingsInput.js +1 -1
  89. package/dist/cjs/f/fields/RatingsInput/common/Rating/Rating.js +1 -1
  90. package/dist/cjs/f/fields/SelectInput/SelectInput.js +10 -3
  91. package/dist/cjs/f/fields/SelectInput/common/Menu/Menu.js +1 -1
  92. package/dist/cjs/f/fields/SelectInput/common/Multiple/Multiple.js +1 -1
  93. package/dist/cjs/f/fields/SelectInput/common/Single/Single.js +14 -3
  94. package/dist/cjs/f/fields/SelectInput/styles.scss +1 -1
  95. package/dist/cjs/f/fields/TextInput/TextInput.js +1 -1
  96. package/dist/cjs/f/fields/TextareaInput/TextareaInput.js +1 -1
  97. package/dist/cjs/{b → g}/ExpandableLexicalPreview/ExpandableLexicalPreview.js +28 -43
  98. package/dist/cjs/{b → g}/ExpandableLexicalPreview/common/ExpandButton/ExpandButton.js +7 -8
  99. package/dist/cjs/g/ExpandableLexicalPreview/styles.scss +34 -0
  100. package/dist/cjs/g/index.js +12 -0
  101. package/dist/cjs/index.js +11 -0
  102. package/dist/cjs/test/QueryLoader/QueryLoader.js +1 -1
  103. package/dist/cjs/test/QueryLoader/common/PreloadedTestData/PreloadedTestData.js +1 -1
  104. package/dist/cjs/utils/hooks/index.js +7 -0
  105. package/dist/cjs/utils/hooks/useOutsideClick.js +25 -0
  106. package/dist/cjs/utils/index.js +6 -0
  107. package/dist/es/a/People/styles.scss +1 -1
  108. package/dist/es/a/Quote/Quote.js +15 -5
  109. package/dist/es/a/Quote/styles.scss +16 -37
  110. package/dist/es/a/Tooltip/Tooltip.js +59 -0
  111. package/dist/es/a/Tooltip/index.js +2 -0
  112. package/dist/es/a/Tooltip/styles.scss +56 -0
  113. package/dist/es/a/index.js +2 -2
  114. package/dist/es/b/Page/common/PageHelmet/PageHelmet.js +4 -1
  115. package/dist/es/b/index.js +1 -2
  116. package/dist/es/f/fields/EditorInput/EditorInput.js +35 -11
  117. package/dist/es/f/fields/EditorInput/common/BlockFormatDropDown/BlockFormatDropDown.js +246 -0
  118. package/dist/es/f/fields/EditorInput/common/BlockFormatDropDown/index.js +2 -0
  119. package/dist/es/f/fields/EditorInput/common/BlockFormatDropDown/styles.scss +55 -0
  120. package/dist/es/f/fields/EditorInput/common/ColorPicker/ColorPicker.js +83 -0
  121. package/dist/es/f/fields/EditorInput/common/ColorPicker/index.js +2 -0
  122. package/dist/es/f/fields/EditorInput/common/ColorPicker/styles.scss +36 -0
  123. package/dist/es/f/fields/EditorInput/common/FontSizeDropDown/FontSizeDropDown.js +81 -0
  124. package/dist/es/f/fields/EditorInput/common/FontSizeDropDown/index.js +2 -0
  125. package/dist/es/f/fields/EditorInput/common/FontSizeDropDown/styles.scss +55 -0
  126. package/dist/es/f/fields/EditorInput/common/ToolbarPlugin/ToolbarPlugin.js +283 -0
  127. package/dist/es/f/fields/EditorInput/common/ToolbarPlugin/index.js +2 -0
  128. package/dist/es/f/fields/EditorInput/common/ToolbarPlugin/styles.scss +56 -0
  129. package/dist/es/f/fields/EditorInput/common/index.js +5 -2
  130. package/dist/es/f/fields/EditorInput/styles.scss +116 -25
  131. package/dist/es/f/fields/SelectInput/SelectInput.js +9 -2
  132. package/dist/es/f/fields/SelectInput/common/Single/Single.js +12 -1
  133. package/dist/es/f/fields/SelectInput/styles.scss +1 -1
  134. package/dist/es/{b → g}/ExpandableLexicalPreview/ExpandableLexicalPreview.js +29 -45
  135. package/dist/es/{b → g}/ExpandableLexicalPreview/common/ExpandButton/ExpandButton.js +18 -21
  136. package/dist/es/g/ExpandableLexicalPreview/styles.scss +34 -0
  137. package/dist/es/g/index.js +1 -0
  138. package/dist/es/index.js +1 -0
  139. package/dist/es/utils/hooks/index.js +2 -1
  140. package/dist/es/utils/hooks/useOutsideClick.js +19 -0
  141. package/dist/es/utils/index.js +1 -1
  142. package/package.json +14 -6
  143. package/src/stories/a/Quote.stories.jsx +30 -10
  144. package/src/stories/a/Tooltip.stories.jsx +80 -0
  145. package/src/stories/a/XMLEditor.stories.jsx +6 -1
  146. package/src/stories/f/SelectInput.stories.jsx +18 -2
  147. package/src/stories/{b → g}/ExpandableLexicalPreview.stories.jsx +2 -1
  148. package/src/ui/a/People/styles.scss +1 -1
  149. package/src/ui/a/Quote/Quote.jsx +16 -9
  150. package/src/ui/a/Quote/styles.scss +16 -37
  151. package/src/ui/a/Tooltip/Tooltip.jsx +83 -0
  152. package/src/ui/a/Tooltip/index.js +2 -0
  153. package/src/ui/a/Tooltip/styles.scss +56 -0
  154. package/src/ui/a/index.js +1 -1
  155. package/src/ui/b/Page/common/PageHelmet/PageHelmet.jsx +6 -0
  156. package/src/ui/b/index.js +0 -1
  157. package/src/ui/f/fields/EditorInput/EditorInput.jsx +35 -5
  158. package/src/ui/f/fields/EditorInput/common/BlockFormatDropDown/BlockFormatDropDown.jsx +292 -0
  159. package/src/ui/f/fields/EditorInput/common/BlockFormatDropDown/index.js +2 -0
  160. package/src/ui/f/fields/EditorInput/common/BlockFormatDropDown/styles.scss +55 -0
  161. package/src/ui/f/fields/EditorInput/common/ColorPicker/ColorPicker.jsx +110 -0
  162. package/src/ui/f/fields/EditorInput/common/ColorPicker/index.js +2 -0
  163. package/src/ui/f/fields/EditorInput/common/ColorPicker/styles.scss +36 -0
  164. package/src/ui/f/fields/EditorInput/common/FontSizeDropDown/FontSizeDropDown.jsx +134 -0
  165. package/src/ui/f/fields/EditorInput/common/FontSizeDropDown/index.js +2 -0
  166. package/src/ui/f/fields/EditorInput/common/FontSizeDropDown/styles.scss +55 -0
  167. package/src/ui/f/fields/EditorInput/common/ToolbarPlugin/ToolbarPlugin.jsx +431 -0
  168. package/src/ui/f/fields/EditorInput/common/ToolbarPlugin/index.js +2 -0
  169. package/src/ui/f/fields/EditorInput/common/ToolbarPlugin/styles.scss +56 -0
  170. package/src/ui/f/fields/EditorInput/common/index.js +6 -0
  171. package/src/ui/f/fields/EditorInput/styles.scss +116 -25
  172. package/src/ui/f/fields/SelectInput/SelectInput.jsx +10 -2
  173. package/src/ui/f/fields/SelectInput/common/Single/Single.jsx +13 -1
  174. package/src/ui/f/fields/SelectInput/styles.scss +1 -1
  175. package/src/ui/{b → g}/ExpandableLexicalPreview/ExpandableLexicalPreview.jsx +43 -56
  176. package/src/ui/{b → g}/ExpandableLexicalPreview/common/ExpandButton/ExpandButton.jsx +32 -36
  177. package/src/ui/g/ExpandableLexicalPreview/styles.scss +34 -0
  178. package/src/ui/g/index.js +1 -0
  179. package/src/ui/index.js +1 -0
  180. package/src/ui/utils/hooks/index.js +1 -0
  181. package/src/ui/utils/hooks/useOutsideClick.js +23 -0
  182. package/src/ui/utils/index.js +1 -1
  183. package/tests/__snapshots__/Storyshots.test.js.snap +914 -433
  184. package/tests/mockResizeObserver.js +9 -0
  185. package/tests/test-setup.js +3 -0
  186. package/dist/cjs/a/LexicalPreview/LexicalPreview.js +0 -90
  187. package/dist/cjs/a/LexicalPreview/styles.scss +0 -46
  188. package/dist/cjs/b/ExpandableLexicalPreview/styles.scss +0 -84
  189. package/dist/cjs/f/fields/EditorInput/common/Toolbar.js +0 -257
  190. package/dist/es/a/LexicalPreview/LexicalPreview.js +0 -80
  191. package/dist/es/a/LexicalPreview/index.js +0 -2
  192. package/dist/es/a/LexicalPreview/styles.scss +0 -46
  193. package/dist/es/b/ExpandableLexicalPreview/styles.scss +0 -84
  194. package/dist/es/f/fields/EditorInput/common/Toolbar.js +0 -246
  195. package/src/stories/a/LexicalPreview.stories.jsx +0 -28
  196. package/src/ui/a/LexicalPreview/LexicalPreview.jsx +0 -109
  197. package/src/ui/a/LexicalPreview/index.js +0 -2
  198. package/src/ui/a/LexicalPreview/styles.scss +0 -46
  199. package/src/ui/b/ExpandableLexicalPreview/styles.scss +0 -84
  200. package/src/ui/f/fields/EditorInput/common/Toolbar.jsx +0 -356
  201. package/src/ui/f/fields/EditorInput/common/index.jsx +0 -3
  202. /package/dist/cjs/{b → g}/ExpandableLexicalPreview/common/ExpandButton/index.js +0 -0
  203. /package/dist/cjs/{b → g}/ExpandableLexicalPreview/common/index.js +0 -0
  204. /package/dist/cjs/{b → g}/ExpandableLexicalPreview/index.js +0 -0
  205. /package/dist/es/{b → g}/ExpandableLexicalPreview/common/ExpandButton/index.js +0 -0
  206. /package/dist/es/{b → g}/ExpandableLexicalPreview/common/index.js +0 -0
  207. /package/dist/es/{b → g}/ExpandableLexicalPreview/index.js +0 -0
  208. /package/src/ui/{b → g}/ExpandableLexicalPreview/common/ExpandButton/index.js +0 -0
  209. /package/src/ui/{b → g}/ExpandableLexicalPreview/common/index.js +0 -0
  210. /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(' '),
@@ -83,7 +83,7 @@ $default-gap: var(--gap);
83
83
 
84
84
  /* stylelint-disable-next-line max-nesting-depth -- required */
85
85
  &:disabled {
86
- opacity: 0%;
86
+ background: transparent;
87
87
  }
88
88
  }
89
89
  }
@@ -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, 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';
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 initialConfig = {
35
- nameSpace: id,
36
- editable: false,
37
- editorState: nodes,
38
- theme: {
39
- text: {
40
- italic: 'italic',
41
- strikethrough: 'strikethrough',
42
- underline: 'underlined'
43
- }
44
- },
45
- nodes: [AutoLinkNode, LinkNode, ListNode, ListItemNode]
46
- };
29
+ const [editorState, setEditorState] = useState();
47
30
  const [isExpanded, setIsExpanded] = useState(false);
48
31
  const handleButtonClick = () => {
49
32
  setIsExpanded(!isExpanded);
50
33
  };
51
- const Content = useMemo(() => /*#__PURE__*/React.createElement("div", {
52
- className: "lexical-content"
53
- }, /*#__PURE__*/React.createElement(RichTextPlugin, {
54
- contentEditable: /*#__PURE__*/React.createElement(ContentEditable, {
55
- id: id,
56
- className: "content-editable"
57
- })
58
- }), /*#__PURE__*/React.createElement(ExpandButton, {
59
- title: title,
60
- onResolve: handleButtonClick
61
- })), [id]);
62
- return /*#__PURE__*/React.createElement(LexicalComposer, {
63
- initialConfig: initialConfig
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 && /*#__PURE__*/React.createElement(Button, {
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")), !isExpanded && Content));
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 '@pareto-engineering/design-system';
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
- const [editor] = useLexicalComposerContext();
27
- return /*#__PURE__*/React.createElement(Button, {
28
- id: id,
29
- className: [baseClassName, componentClassName, userClassName, 'ai-icon'].filter(e => e).join(' '),
30
- style: style,
31
- color: "background-far",
32
- isCompact: true,
33
- onClick: () => {
34
- editor.getEditorState().read(() => {
35
- const rawHtml = $generateHtmlFromNodes(editor);
36
- const preview = window.open('', '_blank', 'width=600,height=600');
37
- preview.document.write(`<html>
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
- onResolve();
81
- }
82
- }, "D");
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
@@ -3,5 +3,6 @@ export * from "./b";
3
3
  export * from "./c";
4
4
  export * from "./d";
5
5
  export * from "./f";
6
+ export * from "./g";
6
7
  export * from "./utils";
7
8
  export * from "./test";
@@ -1,2 +1,3 @@
1
1
  export { default as useWindowSize } from "./useWindowSize";
2
- export { default as useDynamicPosition } from "./useDynamicPosition";
2
+ export { default as useDynamicPosition } from "./useDynamicPosition";
3
+ export { default as useOutsideClick } from "./useOutsideClick";
@@ -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;
@@ -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.77",
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/react": "^0.11.3",
55
- "@pareto-engineering/assets": "^4.0.0-alpha.73",
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.73",
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": "^0.11.3",
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": "7bd6859a8caf8862adf262f19b720e2f3774c5c0"
85
+ "gitHead": "593a12393a1966a555d50ede309f2acfee44f48d"
78
86
  }
@@ -13,17 +13,37 @@ export default {
13
13
  // storyfn => <div className="">{ storyfn() }</div>,
14
14
  ],
15
15
  argTypes:{
16
- backgroundColor:{ control: 'color' },
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
- export const Base = () => (
21
- <div className="y-background-far b-y u1 p-u">
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
+ }