playbook_ui 15.7.0.pre.alpha.PLAY2704multilevelselectsingledisabledoptions13404 → 15.7.0.pre.alpha.play2607setheightofeditor13370

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 (27) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +0 -7
  3. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_disabled_options.md +1 -1
  4. data/app/pb_kits/playbook/pb_multi_level_select/docs/example.yml +0 -2
  5. data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +0 -1
  6. data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.test.jsx +27 -402
  7. data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select_options.tsx +0 -1
  8. data/app/pb_kits/playbook/pb_radio/_radio.scss +0 -8
  9. data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/Toolbar.tsx +1 -1
  10. data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx +8 -3
  11. data/app/pb_kits/playbook/pb_rich_text_editor/_tiptap_styles.scss +53 -0
  12. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_height.jsx +71 -0
  13. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_height.md +1 -0
  14. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_min_heigh.md +1 -0
  15. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_min_height.jsx +71 -0
  16. data/app/pb_kits/playbook/pb_rich_text_editor/docs/example.yml +2 -0
  17. data/app/pb_kits/playbook/pb_rich_text_editor/docs/index.js +3 -1
  18. data/dist/chunks/{_typeahead-DQWz6v7R.js → _typeahead-D0GNUBXn.js} +1 -1
  19. data/dist/chunks/vendor.js +1 -1
  20. data/dist/playbook-rails-react-bindings.js +1 -1
  21. data/dist/playbook-rails.js +1 -1
  22. data/dist/playbook.css +1 -1
  23. data/lib/playbook/version.rb +1 -1
  24. metadata +7 -6
  25. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_single_disabled.html.erb +0 -135
  26. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_single_disabled.jsx +0 -147
  27. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_single_disabled.md +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 10b9d0d0359b00ce5f07f4b0d3f0e1dc2501722d51210e29c76ade6dfc9eca0e
4
- data.tar.gz: 3b3389d7f5545d88ac712ef7c0ac7526d448089ff6b1e541214f7577ffb689ad
3
+ metadata.gz: f960f22bca9b3635502362441b26a13583eb183fcdebab46ebbca3f5b2b64d33
4
+ data.tar.gz: 37dd6c333df8bc2149be578ef208c32fea70e3ebdec053a8ab180ec5bf56e1d7
5
5
  SHA512:
6
- metadata.gz: c4a79a82d7c87252941b881c6396d5b3f6884021cd54dbde70e44d75797b3be6f20130fd87a23d76d4efbad2fed8f8633d018f6289c8e7b108a53524f3af8161
7
- data.tar.gz: 79b3ce7929fffbafdbc098cacd0763f6b4f7d9c56bd9674598fe5602129cbe9871c7000c5e4178b171c125dd77ee00246412f322da6e063f379da29cfe167b2a
6
+ metadata.gz: 694f79e8ddf8ab1bd308e0d0f85faacbd856f66dfbb52f728074ff1721d673b0d4d32513c0aa5dd4c05f652aeb73d1ae4f5c77258fedbdb26b17f80fdcbf1e3d
7
+ data.tar.gz: b8cb5e6390f7a57b562a29dfa341ec33860bdee17c24df89ead92d06d01ae82bf9283600c0d0f4aedcf9b6dafc1b0cddb2eebd4bebdf5118b4fd10a356e65004
@@ -358,13 +358,6 @@ const MultiLevelSelect = forwardRef<HTMLInputElement, MultiLevelSelectProps>((pr
358
358
  const { id, value: inputText } = e.target;
359
359
  // The radio button needs a unique ID, this grabs the ID before the hyphen
360
360
  const selectedItemID = id.match(/^[^-]*/)[0];
361
-
362
- // Check if the item is disabled - if so, don't allow selection (safety check in addition to native disabled attribute)
363
- const clickedItem = filterFormattedDataById(formattedData, selectedItemID);
364
- if (clickedItem.length > 0 && clickedItem[0].disabled) {
365
- return;
366
- }
367
-
368
361
  // Reset tree checked state, triggering useEffect
369
362
  const treeWithNoSelections = modifyRecursive(formattedData, false);
370
363
  // Update tree with single selection
@@ -1 +1 @@
1
- Individual items can also be disabled by including the `disabled:true` within the object on the treeData for the `returnAllSelected`/`return_all_selected` variant. As noted above, this variant will return data on all checked nodes from the dropdown, irrespective of whether it is a parent or child node.
1
+ individual items can also be disabled by including the `disabled:true` within the object on the treeData for the `returnAllSelected`/`return_all_selected` variant. As noted above, this variant will return data on all checked nodes from the dropdown, irrespective of whether it is a parent or child node.
@@ -15,7 +15,6 @@ examples:
15
15
  - multi_level_select_disabled_options: Disabled Options (Return All Selected)
16
16
  - multi_level_select_disabled_options_parent_default: Disabled Parent Option (Default)
17
17
  - multi_level_select_disabled_options_parent: Disabled Parent Option (Return All Selected)
18
- - multi_level_select_single_disabled: Disabled Options (Single Select)
19
18
 
20
19
  react:
21
20
  - multi_level_select_default: Default
@@ -34,4 +33,3 @@ examples:
34
33
  - multi_level_select_disabled_options: Disabled Options (Return All Selected)
35
34
  - multi_level_select_disabled_options_parent_default: Disabled Parent Option (Default)
36
35
  - multi_level_select_disabled_options_parent: Disabled Parent Option (Return All Selected)
37
- - multi_level_select_single_disabled: Disabled Options (Single Select)
@@ -14,4 +14,3 @@ export { default as MultiLevelSelectDisabledOptionsParent } from './_multi_level
14
14
  export { default as MultiLevelSelectDisabledOptionsParentDefault } from './_multi_level_select_disabled_options_parent_default.jsx'
15
15
  export { default as MultiLevelSelectDisabledOptionsDefault } from './_multi_level_select_disabled_options_default.jsx'
16
16
  export { default as MultiLevelSelectLabel } from './_multi_level_select_label.jsx'
17
- export { default as MultiLevelSelectSingleDisabled } from './_multi_level_select_single_disabled.jsx'
@@ -1,414 +1,39 @@
1
1
  import React from 'react'
2
- import { render, screen, fireEvent } from '../utilities/test-utils'
2
+ import { render, screen } from '../utilities/test-utils'
3
3
 
4
4
  import { MultiLevelSelect } from 'playbook-ui'
5
5
 
6
- const treeData = [
7
- {
8
- label: 'Power Home Remodeling',
9
- value: 'powerHomeRemodeling',
10
- id: 'powerhome1',
11
- expanded: true,
12
- children: [
13
- {
14
- label: 'People',
15
- value: 'people',
16
- id: 'people1',
17
- children: [
18
- {
19
- label: 'Talent Acquisition',
20
- value: 'talentAcquisition',
21
- id: 'talent1',
22
- },
23
- {
24
- label: 'Business Affairs',
25
- value: 'businessAffairs',
26
- id: 'business1',
27
- },
28
- ],
29
- },
30
- {
31
- label: 'Contact Center',
32
- value: 'contactCenter',
33
- id: 'contact1',
34
- },
35
- ],
36
- },
37
- ]
38
-
39
- const treeDataWithDisabledOptions = [
40
- {
41
- label: 'Power Home Remodeling',
42
- value: 'powerHomeRemodeling',
43
- id: 'powerhome1',
44
- expanded: true,
45
- children: [
46
- {
47
- label: 'People',
48
- value: 'people',
49
- id: 'people1',
50
- disabled: true,
51
- },
52
- {
53
- label: 'Contact Center',
54
- value: 'contactCenter',
55
- id: 'contact1',
56
- },
57
- ],
58
- },
59
- ]
60
-
61
- const treeDataWithDisabledParent = [
62
- {
63
- label: 'Power Home Remodeling',
64
- value: 'powerHomeRemodeling',
65
- id: 'powerhome1',
66
- expanded: true,
67
- disabled: true,
68
- children: [
69
- {
70
- label: 'People',
71
- value: 'people',
72
- id: 'people1',
73
- },
74
- {
75
- label: 'Contact Center',
76
- value: 'contactCenter',
77
- id: 'contact1',
78
- },
79
- ],
80
- },
81
- ]
6
+ const treeData = {
7
+ label: 'search me',
8
+ value: 'searchme',
9
+ id:'default1',
10
+ children: [
11
+ {
12
+ label: 'search me too',
13
+ value: 'searchmetoo',
14
+ id:'default2',
15
+ children: [
16
+ {
17
+ label: 'No one can get me',
18
+ value: 'anonymous',
19
+ id:'default3',
20
+ },
21
+ ],
22
+ },
23
+ ],
24
+ }
82
25
 
83
26
  const testId = "multiselect-test"
84
-
85
- describe('MultiLevelSelect', () => {
86
- test('should render custom class', () => {
87
- render(
27
+ test('should render custom class', () => {
28
+ render(
88
29
  <MultiLevelSelect
89
30
  className='custom-class'
90
- data={{ testid: testId }}
91
- treeData={treeData}
92
- />
93
- )
94
- const kit = screen.getByTestId(testId)
95
- expect(kit).toHaveClass('custom-class')
96
- })
97
-
98
- test('should render with default multi variant', () => {
99
- render(
100
- <MultiLevelSelect
101
- data={{ testid: testId }}
102
- treeData={treeData}
103
- />
104
- )
105
- const kit = screen.getByTestId(testId)
106
- expect(kit).toHaveClass('pb_multi_level_select')
107
- })
108
-
109
- test('should render label when provided', () => {
110
- render(
111
- <MultiLevelSelect
112
- data={{ testid: testId }}
113
- label="Select Location"
114
- treeData={treeData}
115
- />
116
- )
117
- const kit = screen.getByTestId(testId)
118
- expect(kit).toHaveTextContent('Select Location')
119
- })
120
-
121
- test('should render error message when provided', () => {
122
- render(
123
- <MultiLevelSelect
124
- data={{ testid: testId }}
125
- error="Please select an option"
126
- treeData={treeData}
127
- />
128
- )
129
- const kit = screen.getByTestId(testId)
130
- expect(kit).toHaveTextContent('Please select an option')
131
- expect(kit).toHaveClass('error')
132
- })
133
-
134
- test('should disable input when disabled prop is true', () => {
135
- render(
136
- <MultiLevelSelect
137
- data={{ testid: testId }}
138
- disabled
31
+ data={{ testid: testId}}
139
32
  treeData={treeData}
140
- />
141
- )
142
- const kit = screen.getByTestId(testId)
143
- const input = kit.querySelector('#multiselect_input')
144
- expect(input).toBeDisabled()
145
- })
146
- })
33
+ />
34
+ )
147
35
 
148
- describe('MultiLevelSelect multi variant', () => {
149
- test('should render checkboxes for multi variant', () => {
150
- render(
151
- <MultiLevelSelect
152
- data={{ testid: testId }}
153
- treeData={treeData}
154
- variant="multi"
155
- />
156
- )
157
- const kit = screen.getByTestId(testId)
158
- const input = kit.querySelector('#multiselect_input')
159
- fireEvent.click(input)
160
-
161
- const checkboxes = kit.querySelectorAll('input[type="checkbox"]')
162
- expect(checkboxes.length).toBeGreaterThan(0)
163
- })
164
-
165
- test('should call onSelect when checkbox is clicked', () => {
166
- const mockOnSelect = jest.fn()
167
- render(
168
- <MultiLevelSelect
169
- data={{ testid: testId }}
170
- onSelect={mockOnSelect}
171
- treeData={treeData}
172
- variant="multi"
173
- />
174
- )
175
- const kit = screen.getByTestId(testId)
176
- const input = kit.querySelector('#multiselect_input')
177
- fireEvent.click(input)
178
-
179
- const checkbox = kit.querySelector('input[type="checkbox"]')
180
- fireEvent.click(checkbox)
181
-
182
- expect(mockOnSelect).toHaveBeenCalled()
183
- })
184
-
185
- test('should render disabled checkbox inputs for disabled options', () => {
186
- render(
187
- <MultiLevelSelect
188
- data={{ testid: testId }}
189
- id="multi-disabled-test"
190
- treeData={treeDataWithDisabledOptions}
191
- variant="multi"
192
- />
193
- )
194
- const kit = screen.getByTestId(testId)
195
- const input = kit.querySelector('#multiselect_input')
196
- fireEvent.click(input)
197
-
198
- const disabledCheckbox = kit.querySelector('input[type="checkbox"][disabled]')
199
- expect(disabledCheckbox).toBeInTheDocument()
200
- })
36
+ const kit = screen.getByTestId(testId)
37
+ expect(kit).toHaveClass('custom-class')
201
38
  })
202
39
 
203
- describe('MultiLevelSelect single variant', () => {
204
- test('should render radio buttons for single variant', () => {
205
- render(
206
- <MultiLevelSelect
207
- data={{ testid: testId }}
208
- treeData={treeData}
209
- variant="single"
210
- />
211
- )
212
- const kit = screen.getByTestId(testId)
213
- const input = kit.querySelector('#multiselect_input')
214
- fireEvent.click(input)
215
-
216
- const radios = kit.querySelectorAll('input[type="radio"]')
217
- expect(radios.length).toBeGreaterThan(0)
218
- })
219
-
220
- test('should render disabled radio inputs for disabled options', () => {
221
- render(
222
- <MultiLevelSelect
223
- data={{ testid: testId }}
224
- id="single-disabled-test"
225
- treeData={treeDataWithDisabledOptions}
226
- variant="single"
227
- />
228
- )
229
- const kit = screen.getByTestId(testId)
230
- const input = kit.querySelector('#multiselect_input')
231
- fireEvent.click(input)
232
-
233
- const disabledRadio = kit.querySelector('input[type="radio"][disabled]')
234
- expect(disabledRadio).toBeInTheDocument()
235
- })
236
-
237
- test('disabled options cannot be selected', () => {
238
- const mockOnSelect = jest.fn()
239
- render(
240
- <MultiLevelSelect
241
- data={{ testid: testId }}
242
- id="single-disabled-click-test"
243
- onSelect={mockOnSelect}
244
- treeData={treeDataWithDisabledOptions}
245
- variant="single"
246
- />
247
- )
248
- const kit = screen.getByTestId(testId)
249
- const input = kit.querySelector('#multiselect_input')
250
- fireEvent.click(input)
251
-
252
- const disabledRadio = kit.querySelector('input[type="radio"][disabled]')
253
- fireEvent.click(disabledRadio)
254
-
255
- expect(mockOnSelect).not.toHaveBeenCalled()
256
- })
257
-
258
- test('enabled options can be selected', () => {
259
- const mockOnSelect = jest.fn()
260
- render(
261
- <MultiLevelSelect
262
- data={{ testid: testId }}
263
- id="single-enabled-click-test"
264
- onSelect={mockOnSelect}
265
- treeData={treeDataWithDisabledOptions}
266
- variant="single"
267
- />
268
- )
269
- const kit = screen.getByTestId(testId)
270
- const input = kit.querySelector('#multiselect_input')
271
- fireEvent.click(input)
272
-
273
- const enabledRadio = kit.querySelector('input[type="radio"]:not([disabled])')
274
- fireEvent.click(enabledRadio)
275
-
276
- expect(mockOnSelect).toHaveBeenCalled()
277
- })
278
-
279
- test('should close dropdown after selection', () => {
280
- render(
281
- <MultiLevelSelect
282
- data={{ testid: testId }}
283
- treeData={treeDataWithDisabledOptions}
284
- variant="single"
285
- />
286
- )
287
- const kit = screen.getByTestId(testId)
288
- const input = kit.querySelector('#multiselect_input')
289
- fireEvent.click(input)
290
-
291
- const enabledRadio = kit.querySelector('input[type="radio"]:not([disabled])')
292
- fireEvent.click(enabledRadio)
293
-
294
- const dropdownClosed = kit.querySelector('.dropdown_menu.close')
295
- expect(dropdownClosed).toBeInTheDocument()
296
- })
297
-
298
- test('should update input value after selection', () => {
299
- render(
300
- <MultiLevelSelect
301
- data={{ testid: testId }}
302
- treeData={treeDataWithDisabledOptions}
303
- variant="single"
304
- />
305
- )
306
- const kit = screen.getByTestId(testId)
307
- const input = kit.querySelector('#multiselect_input')
308
- fireEvent.click(input)
309
-
310
- const enabledRadio = kit.querySelector('input[type="radio"]:not([disabled])')
311
- fireEvent.click(enabledRadio)
312
-
313
- expect(input.value).toBe('Power Home Remodeling')
314
- })
315
- })
316
-
317
- describe('MultiLevelSelect disabled parent behavior', () => {
318
- test('children of disabled parent should also be disabled in single variant', () => {
319
- render(
320
- <MultiLevelSelect
321
- data={{ testid: testId }}
322
- treeData={treeDataWithDisabledParent}
323
- variant="single"
324
- />
325
- )
326
- const kit = screen.getByTestId(testId)
327
- const input = kit.querySelector('#multiselect_input')
328
- fireEvent.click(input)
329
-
330
- const radios = kit.querySelectorAll('input[type="radio"]')
331
- radios.forEach(radio => {
332
- expect(radio).toBeDisabled()
333
- })
334
- })
335
-
336
- test('children of disabled parent should also be disabled in multi variant', () => {
337
- render(
338
- <MultiLevelSelect
339
- data={{ testid: testId }}
340
- treeData={treeDataWithDisabledParent}
341
- variant="multi"
342
- />
343
- )
344
- const kit = screen.getByTestId(testId)
345
- const input = kit.querySelector('#multiselect_input')
346
- fireEvent.click(input)
347
-
348
- const checkboxes = kit.querySelectorAll('input[type="checkbox"]')
349
- checkboxes.forEach(checkbox => {
350
- expect(checkbox).toBeDisabled()
351
- })
352
- })
353
- })
354
-
355
- describe('MultiLevelSelect onChange callback', () => {
356
- test('should call onChange when selection changes in multi variant', () => {
357
- const mockOnChange = jest.fn()
358
- render(
359
- <MultiLevelSelect
360
- data={{ testid: testId }}
361
- onChange={mockOnChange}
362
- treeData={treeData}
363
- variant="multi"
364
- />
365
- )
366
- const kit = screen.getByTestId(testId)
367
- const input = kit.querySelector('#multiselect_input')
368
- fireEvent.click(input)
369
-
370
- const checkbox = kit.querySelector('input[type="checkbox"]')
371
- fireEvent.click(checkbox)
372
-
373
- expect(mockOnChange).toHaveBeenCalled()
374
- })
375
-
376
- test('should call onChange when selection changes in single variant', () => {
377
- const mockOnChange = jest.fn()
378
- render(
379
- <MultiLevelSelect
380
- data={{ testid: testId }}
381
- onChange={mockOnChange}
382
- treeData={treeDataWithDisabledOptions}
383
- variant="single"
384
- />
385
- )
386
- const kit = screen.getByTestId(testId)
387
- const input = kit.querySelector('#multiselect_input')
388
- fireEvent.click(input)
389
-
390
- const enabledRadio = kit.querySelector('input[type="radio"]:not([disabled])')
391
- fireEvent.click(enabledRadio)
392
-
393
- expect(mockOnChange).toHaveBeenCalled()
394
- })
395
- })
396
-
397
- describe('MultiLevelSelect inputName prop', () => {
398
- test('should use inputName for radio button name attribute', () => {
399
- render(
400
- <MultiLevelSelect
401
- data={{ testid: testId }}
402
- inputName="location_select"
403
- treeData={treeData}
404
- variant="single"
405
- />
406
- )
407
- const kit = screen.getByTestId(testId)
408
- const input = kit.querySelector('#multiselect_input')
409
- fireEvent.click(input)
410
-
411
- const radio = kit.querySelector('input[type="radio"]')
412
- expect(radio).toHaveAttribute('name', 'location_select')
413
- })
414
- })
@@ -101,7 +101,6 @@ const classes = classnames(
101
101
  ) : (
102
102
  <Radio
103
103
  checked={item.checked}
104
- disabled={item.disabled}
105
104
  id={`${item.id}-${item.label}`}
106
105
  label={item.label}
107
106
  name={inputName}
@@ -13,10 +13,6 @@
13
13
  display: inline-flex;
14
14
  cursor: pointer;
15
15
 
16
- &:has(input:disabled) {
17
- cursor: not-allowed;
18
- }
19
-
20
16
  .pb_radio_button {
21
17
  width: 22px;
22
18
  min-width: 22px;
@@ -88,10 +84,6 @@
88
84
  .pb_radio_kit.dark.error.vertical,
89
85
  .pb_radio_kit_vertical.dark,
90
86
  .pb_radio_kit_vertical.dark.error {
91
- &:has(input:disabled) {
92
- cursor: not-allowed;
93
- }
94
-
95
87
  .pb_radio_button {
96
88
  border-color: $border_dark;
97
89
  }
@@ -4,7 +4,7 @@ import Flex from "../../pb_flex/_flex";
4
4
  import FlexItem from "../../pb_flex/_flex_item";
5
5
  import SectionSeparator from "../../pb_section_separator/_section_separator";
6
6
 
7
- import EditorButton from "./EditorButton";
7
+ import EditorButton from "./EditorButton";
8
8
  import ToolbarDropdown from "./ToolbarDropdown";
9
9
  import ToolbarNodes from "./ToolbarNodes";
10
10
  import { ToolbarTypes } from "./EditorTypes";
@@ -44,6 +44,8 @@ type RichTextEditorProps = {
44
44
  name?: string,
45
45
  onChange: (html: string, text: string) => void,
46
46
  placeholder?: string,
47
+ inputHeight?: "sm" | "md" | "lg",
48
+ inputMinHeight?: "sm" | "md" | "lg",
47
49
  simple?: boolean,
48
50
  sticky?: boolean,
49
51
  template: string,
@@ -68,6 +70,8 @@ const RichTextEditor = (props: RichTextEditorProps): React.ReactElement => {
68
70
  name,
69
71
  onChange = noop,
70
72
  placeholder,
73
+ inputHeight,
74
+ inputMinHeight,
71
75
  simple = false,
72
76
  sticky = false,
73
77
  template = '',
@@ -214,9 +218,10 @@ const RichTextEditor = (props: RichTextEditorProps): React.ReactElement => {
214
218
  {
215
219
  advancedEditor ? (
216
220
  <div
217
- className={classnames("pb_rich_text_editor_advanced_container", {
218
- ["toolbar-active"]: shouldShowToolbar,
219
- })}
221
+ className={classnames(
222
+ "pb_rich_text_editor_advanced_container",
223
+ { [`input_height_${inputHeight}`]: !!inputHeight,[`input_min_height_${inputMinHeight}`]: !!inputMinHeight ,["toolbar-active"]: shouldShowToolbar }
224
+ )}
220
225
  >
221
226
  {shouldShowToolbar && (
222
227
  <EditorToolbar editor={advancedEditor}
@@ -205,6 +205,59 @@
205
205
  }
206
206
  }
207
207
  }
208
+
209
+ .pb_rich_text_editor_advanced_container.input_height_sm {
210
+ div {
211
+ .tiptap.ProseMirror {
212
+ height: 131px;
213
+ overflow: auto;
214
+ }
215
+ }
216
+ }
217
+
218
+ .pb_rich_text_editor_advanced_container.input_height_md {
219
+ div {
220
+ .tiptap.ProseMirror {
221
+ height: 180px;
222
+ overflow: auto;
223
+ }
224
+ }
225
+ }
226
+
227
+ .pb_rich_text_editor_advanced_container.input_height_lg {
228
+ div {
229
+ .tiptap.ProseMirror {
230
+ height: 230px;
231
+ overflow: auto;
232
+ }
233
+ }
234
+ }
235
+
236
+ .pb_rich_text_editor_advanced_container.input_min_height_sm {
237
+ div {
238
+ .tiptap.ProseMirror {
239
+ min-height: 131px;
240
+ }
241
+ }
242
+ }
243
+
244
+ .pb_rich_text_editor_advanced_container.input_min_height_md {
245
+ div {
246
+ .tiptap.ProseMirror {
247
+ min-height: 180px;
248
+ }
249
+ }
250
+ }
251
+
252
+ .pb_rich_text_editor_advanced_container.input_min_height_lg {
253
+ div {
254
+ .tiptap.ProseMirror {
255
+ min-height: 230px;
256
+ }
257
+ }
258
+ }
259
+
260
+
208
261
  .tiptap-content {
209
262
  @include preview_tiptap_first_child;
210
263
  a {
@@ -0,0 +1,71 @@
1
+ import React from 'react'
2
+ import RichTextEditor from '../_rich_text_editor'
3
+ import { useEditor, EditorContent } from "@tiptap/react"
4
+ import StarterKit from "@tiptap/starter-kit"
5
+ import Link from '@tiptap/extension-link'
6
+ import { Caption } from "playbook-ui"
7
+
8
+
9
+ const RichTextEditorAdvancedHeight = (props) => {
10
+
11
+ const editor = useEditor({
12
+ extensions: [
13
+ StarterKit,
14
+ Link
15
+ ],
16
+ content: "Add your text here. You can format your text, add links, quotes, and bullets."
17
+ })
18
+
19
+ const editor2 = useEditor({
20
+ extensions: [
21
+ StarterKit,
22
+ Link
23
+ ],
24
+ content: "Add your text here. You can format your text, add links, quotes, and bullets."
25
+ })
26
+
27
+ const editor3 = useEditor({
28
+ extensions: [
29
+ StarterKit,
30
+ Link
31
+ ],
32
+ content: "Add your text here. You can format your text, add links, quotes, and bullets."
33
+ })
34
+
35
+ return (
36
+ <div>
37
+ <Caption>sm</Caption>
38
+ <RichTextEditor
39
+ advancedEditor={editor}
40
+ inputHeight="sm"
41
+ {...props}
42
+ >
43
+ <EditorContent editor={editor} />
44
+ </RichTextEditor>
45
+
46
+ <br />
47
+
48
+ <Caption>md</Caption>
49
+ <RichTextEditor
50
+ advancedEditor={editor2}
51
+ inputHeight="md"
52
+ {...props}
53
+ >
54
+ <EditorContent editor={editor2} />
55
+ </RichTextEditor>
56
+
57
+ <br />
58
+
59
+ <Caption>lg</Caption>
60
+ <RichTextEditor
61
+ advancedEditor={editor3}
62
+ inputHeight="lg"
63
+ {...props}
64
+ >
65
+ <EditorContent editor={editor3} />
66
+ </RichTextEditor>
67
+ </div>
68
+ )
69
+ }
70
+
71
+ export default RichTextEditorAdvancedHeight