playbook_ui 15.5.0.pre.alpha.draggablefix12589 → 15.5.0.pre.rc.0

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 (177) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +6 -96
  3. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling.jsx +1 -2
  4. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_column_headers.jsx +1 -1
  5. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_fullscreen.jsx +1 -3
  6. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_infinite_scroll.jsx +1 -1
  7. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_inline_editing.jsx +1 -3
  8. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_row_styling.jsx +1 -2
  9. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.html.erb +1 -1
  10. data/app/pb_kits/playbook/pb_bar_graph/BarGraphStyles.scss +58 -0
  11. data/app/pb_kits/playbook/pb_copy_button/_copy_button.tsx +8 -21
  12. data/app/pb_kits/playbook/pb_copy_button/copy_button.html.erb +2 -6
  13. data/app/pb_kits/playbook/pb_copy_button/copy_button.rb +0 -3
  14. data/app/pb_kits/playbook/pb_copy_button/copy_button.test.jsx +0 -24
  15. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_default.html.erb +2 -2
  16. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_default.jsx +2 -1
  17. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.html.erb +2 -2
  18. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.jsx +0 -2
  19. data/app/pb_kits/playbook/pb_copy_button/docs/example.yml +0 -2
  20. data/app/pb_kits/playbook/pb_copy_button/docs/index.js +0 -1
  21. data/app/pb_kits/playbook/pb_currency/docs/_currency_negative.html.erb +0 -10
  22. data/app/pb_kits/playbook/pb_currency/docs/_currency_negative.jsx +0 -10
  23. data/app/pb_kits/playbook/pb_currency/docs/_currency_variants.html.erb +0 -7
  24. data/app/pb_kits/playbook/pb_currency/docs/_currency_variants.jsx +0 -7
  25. data/app/pb_kits/playbook/pb_currency/docs/_description.md +2 -2
  26. data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +3 -44
  27. data/app/pb_kits/playbook/pb_date_time/_date_time.tsx +0 -3
  28. data/app/pb_kits/playbook/pb_date_time/date_time.html.erb +0 -1
  29. data/app/pb_kits/playbook/pb_date_time/date_time.rb +0 -1
  30. data/app/pb_kits/playbook/pb_date_time/docs/example.yml +1 -3
  31. data/app/pb_kits/playbook/pb_date_time/docs/index.js +0 -1
  32. data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx +0 -3
  33. data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.html.erb +2 -2
  34. data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.rb +0 -2
  35. data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js +0 -33
  36. data/app/pb_kits/playbook/pb_date_time_stacked/docs/example.yml +1 -3
  37. data/app/pb_kits/playbook/pb_date_time_stacked/docs/index.js +0 -1
  38. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_compound_components.html.erb +2 -2
  39. data/app/pb_kits/playbook/pb_draggable/context/index.tsx +6 -156
  40. data/app/pb_kits/playbook/pb_draggable/context/types.ts +3 -8
  41. data/app/pb_kits/playbook/pb_draggable/docs/example.yml +2 -3
  42. data/app/pb_kits/playbook/pb_draggable/docs/index.js +1 -2
  43. data/app/pb_kits/playbook/pb_draggable/draggable.test.jsx +1 -77
  44. data/app/pb_kits/playbook/pb_dropdown/index.js +13 -31
  45. data/app/pb_kits/playbook/pb_empty_state/docs/_empty_state_alignment.jsx +1 -2
  46. data/app/pb_kits/playbook/pb_empty_state/docs/_empty_state_default.jsx +1 -2
  47. data/app/pb_kits/playbook/pb_empty_state/docs/_empty_state_orientation.jsx +1 -2
  48. data/app/pb_kits/playbook/pb_empty_state/docs/_empty_state_size.jsx +1 -2
  49. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_wrapped.jsx +1 -4
  50. data/app/pb_kits/playbook/pb_loading_inline/docs/_loading_inline_variant.jsx +1 -1
  51. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_description.md +1 -3
  52. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_colors.jsx +1 -1
  53. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_default.jsx +1 -1
  54. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_height.jsx +1 -1
  55. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_horizontal.jsx +1 -1
  56. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend.jsx +1 -1
  57. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_non_clickable.jsx +2 -1
  58. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_position.html.erb +1 -1
  59. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_position.jsx +1 -1
  60. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_negative_numbers.jsx +1 -1
  61. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_secondary_y_axis.jsx +1 -1
  62. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_spline.jsx +2 -1
  63. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_stacked.jsx +2 -1
  64. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_description.md +1 -3
  65. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_block_content.jsx +1 -2
  66. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_color_overrides.jsx +1 -2
  67. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.jsx +1 -1
  68. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.md +1 -2
  69. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_legend_position.jsx +1 -2
  70. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_labels.jsx +1 -1
  71. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_legend.jsx +1 -1
  72. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_default.jsx +1 -1
  73. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_inner_sizes.jsx +1 -1
  74. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_live_data.jsx +1 -2
  75. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_rounded.jsx +1 -1
  76. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_with_title.jsx +1 -1
  77. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_description.md +1 -3
  78. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_color.jsx +1 -1
  79. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_color.md +2 -2
  80. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_complex.jsx +1 -2
  81. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_full_circle.jsx +1 -2
  82. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_height.jsx +1 -2
  83. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_min_max.jsx +1 -2
  84. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_units.jsx +1 -2
  85. data/app/pb_kits/playbook/pb_pb_line_graph/docs/_description.md +1 -3
  86. data/app/pb_kits/playbook/pb_pb_line_graph/docs/_pb_line_graph_colors.jsx +1 -1
  87. data/app/pb_kits/playbook/pb_pb_line_graph/docs/_pb_line_graph_legend_position.html.erb +1 -1
  88. data/app/pb_kits/playbook/pb_popover/docs/_popover_append_to.jsx +1 -4
  89. data/app/pb_kits/playbook/pb_progress_step/_progress_step.scss +262 -384
  90. data/app/pb_kits/playbook/pb_progress_step/docs/_description.md +5 -1
  91. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_default.html.erb +1 -4
  92. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_default.jsx +3 -14
  93. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_vertical.html.erb +7 -1
  94. data/app/pb_kits/playbook/pb_progress_step/docs/example.yml +0 -3
  95. data/app/pb_kits/playbook/pb_progress_step/docs/index.js +0 -2
  96. data/app/pb_kits/playbook/pb_progress_step/progress_step.test.js +0 -41
  97. data/app/pb_kits/playbook/pb_radio/docs/_radio_react_hook.jsx +1 -3
  98. data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/Toolbar.tsx +1 -1
  99. data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx +61 -8
  100. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_default_rails.md +7 -0
  101. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_focus.html.erb +10 -2
  102. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_inline_rails.md +1 -0
  103. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_preview.html.erb +19 -11
  104. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_simple.html.erb +5 -1
  105. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_sticky.html.erb +1 -1
  106. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_sticky_rails.md +1 -0
  107. data/app/pb_kits/playbook/pb_rich_text_editor/docs/example.yml +2 -2
  108. data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb +16 -7
  109. data/app/pb_kits/playbook/pb_select/docs/_select_react_hook.jsx +1 -3
  110. data/app/pb_kits/playbook/pb_table/_table.tsx +26 -28
  111. data/app/pb_kits/playbook/pb_table/styles/_vertical_border.scss +0 -49
  112. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_sizing.jsx +1 -4
  113. data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +0 -4
  114. data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.tsx +0 -1
  115. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_react_hook.jsx +1 -2
  116. data/app/pb_kits/playbook/pb_user/docs/_user_font_options.jsx +1 -1
  117. data/app/pb_kits/playbook/utilities/_truncate.scss +0 -2
  118. data/app/pb_kits/playbook/utilities/globalProps.ts +8 -26
  119. data/app/pb_kits/playbook/utilities/test/globalProps/alignContent.test.js +0 -18
  120. data/app/pb_kits/playbook/utilities/test/globalProps/alignItems.test.js +0 -18
  121. data/app/pb_kits/playbook/utilities/test/globalProps/alignSelf.test.js +0 -18
  122. data/app/pb_kits/playbook/utilities/test/globalProps/display.test.js +0 -18
  123. data/app/pb_kits/playbook/utilities/test/globalProps/flex.test.js +0 -18
  124. data/app/pb_kits/playbook/utilities/test/globalProps/flexDirection.test.js +0 -18
  125. data/app/pb_kits/playbook/utilities/test/globalProps/flexGrow.test.js +0 -18
  126. data/app/pb_kits/playbook/utilities/test/globalProps/flexShrink.test.js +0 -18
  127. data/app/pb_kits/playbook/utilities/test/globalProps/flexWrap.test.js +0 -18
  128. data/app/pb_kits/playbook/utilities/test/globalProps/justifyContent.test.js +0 -18
  129. data/app/pb_kits/playbook/utilities/test/globalProps/justifySelf.test.js +0 -18
  130. data/app/pb_kits/playbook/utilities/test/globalProps/order.test.js +0 -18
  131. data/dist/chunks/_line_graph-eQNOB_GQ.js +1 -0
  132. data/dist/chunks/_typeahead-vbfetkuE.js +24 -0
  133. data/dist/chunks/_weekday_stacked-CvJHyUq6.js +37 -0
  134. data/dist/chunks/componentRegistry-DzmmLR2x.js +1 -0
  135. data/dist/chunks/lib-BCrK6CFU.js +29 -0
  136. data/dist/chunks/pb_form_validation-Cj4vdjWI.js +1 -0
  137. data/dist/chunks/vendor.js +1 -37
  138. data/dist/playbook-doc.js +1 -0
  139. data/dist/playbook-rails-react-bindings.js +1 -1
  140. data/dist/playbook-rails.js +1 -1
  141. data/dist/playbook.css +1 -1
  142. data/lib/playbook/version.rb +2 -2
  143. metadata +13 -36
  144. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_button_variant.html.erb +0 -9
  145. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_button_variant.jsx +0 -24
  146. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_button_variant_rails.md +0 -1
  147. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_button_variant_react.md +0 -1
  148. data/app/pb_kits/playbook/pb_currency/docs/_currency_abbreviated.md +0 -1
  149. data/app/pb_kits/playbook/pb_currency/docs/_currency_matching_decimals_rails.md +0 -1
  150. data/app/pb_kits/playbook/pb_currency/docs/_currency_matching_decimals_react.md +0 -1
  151. data/app/pb_kits/playbook/pb_currency/docs/_currency_negative.md +0 -1
  152. data/app/pb_kits/playbook/pb_currency/docs/_currency_no_symbol_rails.md +0 -1
  153. data/app/pb_kits/playbook/pb_currency/docs/_currency_no_symbol_react.md +0 -1
  154. data/app/pb_kits/playbook/pb_date_time/docs/_date_time_show_current_year.html.erb +0 -4
  155. data/app/pb_kits/playbook/pb_date_time/docs/_date_time_show_current_year.jsx +0 -14
  156. data/app/pb_kits/playbook/pb_date_time/docs/_date_time_show_current_year_rails.md +0 -1
  157. data/app/pb_kits/playbook/pb_date_time/docs/_date_time_show_current_year_react.md +0 -1
  158. data/app/pb_kits/playbook/pb_date_time_stacked/docs/_date_time_stacked_show_current_year.html.erb +0 -4
  159. data/app/pb_kits/playbook/pb_date_time_stacked/docs/_date_time_stacked_show_current_year.jsx +0 -22
  160. data/app/pb_kits/playbook/pb_date_time_stacked/docs/_date_time_stacked_show_current_year.md +0 -1
  161. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_dropzone.jsx +0 -180
  162. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_dropzone.md +0 -20
  163. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_default.md +0 -1
  164. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_position.md +0 -11
  165. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_default.md +0 -1
  166. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_default.md +0 -1
  167. data/app/pb_kits/playbook/pb_pb_line_graph/docs/_pb_line_graph_default.md +0 -1
  168. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_color.html.erb +0 -14
  169. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_color.jsx +0 -29
  170. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_color.md +0 -3
  171. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_custom_icon.jsx +0 -31
  172. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_custom_icon.md +0 -1
  173. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_default.md +0 -3
  174. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_tracker.md +0 -3
  175. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_vertical.md +0 -1
  176. data/dist/chunks/_typeahead-DUmTKJUc.js +0 -6
  177. data/dist/chunks/lib-CgpqUb6l.js +0 -29
@@ -6,6 +6,7 @@ import ProgressStepItem from '../_progress_step_item.tsx'
6
6
  const ProgressStepDefault = (props) => (
7
7
  <div>
8
8
  <ProgressStep
9
+ icon
9
10
  {...props}
10
11
  >
11
12
  <ProgressStepItem status="complete" />
@@ -18,24 +19,12 @@ const ProgressStepDefault = (props) => (
18
19
 
19
20
  <ProgressStep {...props}>
20
21
  <ProgressStepItem status="complete">{'Step 1'}</ProgressStepItem>
21
- <ProgressStepItem status="complete">{'Step 2'}</ProgressStepItem>
22
- <ProgressStepItem status="active">{'Step 3'}</ProgressStepItem>
23
- <ProgressStepItem status="inactive">{'Step 4'}</ProgressStepItem>
24
- <ProgressStepItem status="inactive">{'Step 5'}</ProgressStepItem>
22
+ <ProgressStepItem status="active">{'Step 2'}</ProgressStepItem>
23
+ <ProgressStepItem status="inactive">{'Step 3'}</ProgressStepItem>
25
24
  </ProgressStep>
26
25
 
27
26
  <br />
28
27
  <br />
29
-
30
- <ProgressStep
31
- icon
32
- {...props}
33
- >
34
- <ProgressStepItem status="complete">{'Step 1'}</ProgressStepItem>
35
- <ProgressStepItem status="complete">{'Step 2'}</ProgressStepItem>
36
- <ProgressStepItem status="active">{'Step 3'}</ProgressStepItem>
37
- <ProgressStepItem status="inactive">{'Step 4'}</ProgressStepItem>
38
- </ProgressStep>
39
28
  </div>
40
29
  )
41
30
 
@@ -25,7 +25,13 @@
25
25
  Child
26
26
  <% end %>
27
27
  <%= pb_rails("progress_step/progress_step_item", props: {status: "active"}) do %>
28
- Child
28
+ <%= pb_rails("card", props: {highlight: {position: "side", color:"windows"}}) do %>
29
+ Card content
30
+ <% end %>
31
+ <br>
32
+ <%= pb_rails("card", props: {highlight: {position: "side", color:"windows"}}) do %>
33
+ Card content
34
+ <% end %>
29
35
  <% end %>
30
36
  <%= pb_rails("progress_step/progress_step_item", props: {status: "inactive"}) do %>
31
37
  Child
@@ -3,7 +3,6 @@ examples:
3
3
  - progress_step_default: Default
4
4
  - progress_step_vertical: Vertical
5
5
  - progress_step_tracker: Tracker
6
- - progress_step_color: Color
7
6
  - progress_step_custom_icon: Custom Icon
8
7
  - progress_step_tooltip: Tooltip
9
8
 
@@ -11,6 +10,4 @@ examples:
11
10
  - progress_step_default: Default
12
11
  - progress_step_vertical: Vertical
13
12
  - progress_step_tracker: Tracker
14
- - progress_step_color: Color
15
- - progress_step_custom_icon: Custom Icon
16
13
  - progress_step_tracker_click_events: Using State
@@ -2,5 +2,3 @@ export { default as ProgressStepDefault } from './_progress_step_default.jsx'
2
2
  export { default as ProgressStepVertical } from './_progress_step_vertical.jsx'
3
3
  export { default as ProgressStepTracker } from './_progress_step_tracker.jsx'
4
4
  export { default as ProgressStepTrackerClickEvents } from './_progress_step_tracker_click_events.jsx'
5
- export { default as ProgressStepColor } from './_progress_step_color.jsx'
6
- export { default as ProgressStepCustomIcon } from './_progress_step_custom_icon.jsx'
@@ -107,44 +107,3 @@ test('should render the children elements', () => {
107
107
  expect(step2Kit).toHaveClass('pb_progress_step_item_active')
108
108
  expect(step3Kit).toHaveClass('pb_progress_step_item_inactive')
109
109
  })
110
-
111
- test('should render info color', () => {
112
- render(
113
- <ProgressStep
114
- aria={{ label: testId }}
115
- color="info"
116
- data={{ testid: testId }}
117
- variant="tracker"
118
- >
119
- <ProgressStepItem status="complete">{'Step 1'}</ProgressStepItem>
120
- <ProgressStepItem status="active">{'Step 2'}</ProgressStepItem>
121
- <ProgressStepItem status="inactive">{'Step 3'}</ProgressStepItem>
122
- </ProgressStep>
123
- )
124
-
125
- const kit = screen.getByTestId(testId)
126
- expect(kit).toHaveClass('pb_progress_step_kit_horizontal_tracker_info')
127
- })
128
-
129
- test('should render custom icon', () => {
130
- render(
131
- <ProgressStep
132
- aria={{ label: testId }}
133
- data={{ testid: testId }}
134
- variant="tracker"
135
- >
136
- <ProgressStepItem icon="exclamation-triangle"
137
- status="complete"
138
- >
139
- {'Step 1'}
140
- </ProgressStepItem>
141
- <ProgressStepItem status="active">{'Step 2'}</ProgressStepItem>
142
- <ProgressStepItem status="inactive">{'Step 3'}</ProgressStepItem>
143
- </ProgressStep>
144
- )
145
-
146
- const kit = screen.getByTestId(testId)
147
- expect(kit).toHaveClass('pb_progress_step_kit_horizontal_tracker')
148
- const icon = kit.getAttribute('aria-label', "exclamation-triangle-icon")
149
- expect(icon).toBeDefined()
150
- })
@@ -1,8 +1,6 @@
1
1
  import React from "react"
2
2
  import { useForm } from "react-hook-form"
3
- import Radio from "../_radio"
4
- import Body from "../../pb_body/_body"
5
- import Flex from "../../pb_flex/_flex"
3
+ import { Radio, Flex, Body } from "playbook-ui"
6
4
 
7
5
  const RadioReactHook = () => {
8
6
  const { register, watch } = useForm({
@@ -96,7 +96,7 @@ const EditorToolbar = ({ editor, extensions, simple, sticky }: any): React.React
96
96
  <SectionSeparator orientation="vertical" />
97
97
  <ToolbarNodes editor={editor} />
98
98
  {
99
- extensions && (
99
+ extensions && extensions.length > 0 && (
100
100
  <>
101
101
  <MoreExtensionsDropdown extensions={extensions}/>
102
102
  </>
@@ -2,6 +2,10 @@ import React, { useEffect, useState, useRef } from 'react'
2
2
  import classnames from 'classnames'
3
3
  import { TrixEditor } from 'react-trix'
4
4
 
5
+ import { useEditor, EditorContent } from '@tiptap/react'
6
+ import StarterKit from '@tiptap/starter-kit'
7
+ import Link from '@tiptap/extension-link'
8
+
5
9
  import inlineFocus from './inlineFocus'
6
10
  import useFocus from './useFocus'
7
11
  import { globalProps, GlobalProps } from '../utilities/globalProps'
@@ -48,7 +52,8 @@ type RichTextEditorProps = {
48
52
  sticky?: boolean,
49
53
  template: string,
50
54
  value?: string,
51
- maxWidth?: string
55
+ maxWidth?: string,
56
+ railsEditor?: boolean
52
57
  } & GlobalProps
53
58
 
54
59
  const RichTextEditor = (props: RichTextEditorProps): React.ReactElement => {
@@ -81,6 +86,27 @@ const RichTextEditor = (props: RichTextEditorProps): React.ReactElement => {
81
86
  [showToolbarOnFocus, setShowToolbarOnFocus] = useState(false),
82
87
  containerRef = useRef<HTMLDivElement>(null)
83
88
 
89
+ const isRails = !advancedEditor && props.railsEditor === true
90
+
91
+ // TipTap editor for Rails (hook always runs per React rules, but only used when isRails is true)
92
+ const railsTipTapEditor = useEditor({
93
+ extensions: [StarterKit, Link],
94
+ content: value || '',
95
+ onUpdate: ({ editor }) => {
96
+ if (!isRails) return
97
+
98
+ const html = editor.getHTML()
99
+ const text = editor.getText()
100
+ onChange(html, text)
101
+
102
+ // Update hidden input for TipTap Rails form submission
103
+ const hiddenInput = document.getElementById(`hidden-input-${props.id || 'rich-text-editor'}`)
104
+ if (hiddenInput) {
105
+ (hiddenInput as HTMLInputElement).value = html ?? ''
106
+ }
107
+ },
108
+ }, [isRails, value])
109
+
84
110
  const htmlProps = buildHtmlProps(htmlOptions)
85
111
 
86
112
  const handleOnEditorReady = (editorInstance: Editor) => {
@@ -140,7 +166,8 @@ const RichTextEditor = (props: RichTextEditorProps): React.ReactElement => {
140
166
  }
141
167
 
142
168
  useEffect(() => {
143
- if (!advancedEditor || !focus) return
169
+ const tiptapEditor = advancedEditor || railsTipTapEditor
170
+ if (!tiptapEditor || !focus) return
144
171
 
145
172
  const handleFocus = () => setShowToolbarOnFocus(true)
146
173
 
@@ -149,7 +176,7 @@ const RichTextEditor = (props: RichTextEditorProps): React.ReactElement => {
149
176
  setShowToolbarOnFocus(false)
150
177
  }
151
178
 
152
- const editorElement = advancedEditor?.view?.dom
179
+ const editorElement = tiptapEditor?.view?.dom
153
180
  if (editorElement) {
154
181
  editorElement.addEventListener('focus', handleFocus)
155
182
  }
@@ -162,7 +189,7 @@ const RichTextEditor = (props: RichTextEditorProps): React.ReactElement => {
162
189
  }
163
190
  document.removeEventListener('mousedown', handleClickOutside)
164
191
  }
165
- }, [advancedEditor, focus])
192
+ }, [advancedEditor, railsTipTapEditor, focus])
166
193
 
167
194
  //============= end focus prop with advanced editor=================
168
195
 
@@ -173,6 +200,17 @@ const RichTextEditor = (props: RichTextEditorProps): React.ReactElement => {
173
200
  editor.insertHTML(template)
174
201
  }, [editor, template])
175
202
 
203
+ // Handle value prop changes for Rails TipTap editor
204
+ useEffect(() => {
205
+ if (!railsTipTapEditor) return
206
+ const currentContent = railsTipTapEditor.getHTML()
207
+ const newValue = value || ''
208
+
209
+ if (currentContent !== newValue) {
210
+ railsTipTapEditor.commands.setContent(newValue)
211
+ }
212
+ }, [railsTipTapEditor, value])
213
+
176
214
  useEffect(() => {
177
215
  if (!editor?.element) return
178
216
  editor.element.addEventListener('click', ({ target }: Event) => {
@@ -200,8 +238,11 @@ const RichTextEditor = (props: RichTextEditorProps): React.ReactElement => {
200
238
  className
201
239
  )
202
240
 
241
+ // Get the TipTap editor instance (either passed from React or auto-initialized for Rails)
242
+ const tipTapEditor = advancedEditor || (isRails ? railsTipTapEditor : null)
243
+
203
244
  // Determine if toolbar should be shown
204
- const shouldShowToolbar = focus && advancedEditor ? showToolbarOnFocus : advancedEditorToolbar
245
+ const shouldShowToolbar = focus && tipTapEditor ? showToolbarOnFocus : advancedEditorToolbar
205
246
 
206
247
  return (
207
248
  <div
@@ -212,20 +253,32 @@ const RichTextEditor = (props: RichTextEditorProps): React.ReactElement => {
212
253
  ref={focus ? containerRef : undefined}
213
254
  >
214
255
  {
215
- advancedEditor ? (
256
+ // Render TipTap editor if indicated (React with advancedEditor or Rails by default (railsEditor is true), otherwise Trix
257
+ tipTapEditor ? (
216
258
  <div
217
259
  className={classnames("pb_rich_text_editor_advanced_container", {
218
260
  ["toolbar-active"]: shouldShowToolbar,
219
261
  })}
220
262
  >
221
263
  {shouldShowToolbar && (
222
- <EditorToolbar editor={advancedEditor}
264
+ <EditorToolbar editor={tipTapEditor}
223
265
  extensions={extensions}
224
266
  simple={simple}
225
267
  sticky={sticky}
226
268
  />
227
269
  )}
228
- { children }
270
+ {/* EditorContent for Rails railsTipTapEditor, children for React TipTap advancedEditor */}
271
+ {railsTipTapEditor ? <EditorContent editor={tipTapEditor} /> : <>{children}</>}
272
+
273
+ {/* Set up hidden input for TipTap Rails form submission */}
274
+ {railsTipTapEditor && (
275
+ <input
276
+ id={`hidden-input-${props.id || 'rich-text-editor'}`}
277
+ name={name || 'content'}
278
+ type="hidden"
279
+ value={tipTapEditor?.getHTML() ?? ''}
280
+ />
281
+ )}
229
282
  </div>
230
283
  ) : (
231
284
  <TrixEditor
@@ -0,0 +1,7 @@
1
+ The Rails RichTextEditor is a React-Rendered-Rails component that uses [Tiptap](https://tiptap.dev/) and requires the following packages to be installed in your project:
2
+
3
+ - `@tiptap/react`
4
+ - `@tiptap/starter-kit`
5
+ - `@tiptap/extension-link`
6
+
7
+ Once installed, the editor is initialized automatically when you use the component. Unlike the [React Advanced RichTextEditor](https://playbook.powerapp.cloud/kits/rich_text_editor/react#advanced-default) variant, [custom extensions](https://playbook.powerapp.cloud/kits/rich_text_editor/react#advanced-extra-extensions) are not currently supported. The doc examples below showcase some preset prop-enabled Rails RichTextEditor customizations.
@@ -1,3 +1,11 @@
1
- <%= pb_rails("rich_text_editor", props: {focus: true}) %>
1
+ <%= pb_rails("rich_text_editor", props: {
2
+ id: "focus-editor-1",
3
+ focus: true,
4
+ value: "Click inside to see the toolbar. Click outside to hide it."
5
+ }) %>
2
6
  <br>
3
- <%= pb_rails("rich_text_editor", props: {focus: true}) %>
7
+ <%= pb_rails("rich_text_editor", props: {
8
+ id: "focus-editor-2",
9
+ focus: true,
10
+ value: "When the optional focus prop is set to true, the toolbar will only show once you click in to the RichTextEditor."
11
+ }) %>
@@ -0,0 +1 @@
1
+ When the optional `inline` prop is set to true, the editor borders and the toolbar will only be visible when hovered or focused on.
@@ -1,30 +1,38 @@
1
+ <%= pb_rails("rich_text_editor", props: {
2
+ id: "content-preview-editor",
3
+ margin_bottom: "md",
4
+ value: "Add text here, format it, and press \"Preview Output\" to see what your stylized output will look like on the page."
5
+ }) %>
6
+
7
+ <%= pb_rails("button", props: { id: "preview-button", text: "Preview Output", variant: "secondary" }) %>
1
8
 
2
- <%= pb_rails("rich_text_editor", props: { id: "content-preview-editor" }) %>
3
9
  <div id="card-obfuscation" style="display:none">
4
10
  <%= pb_rails("card", props: { margin_top: "md", max_width: "md", padding: "sm" }) do %>
5
- <div id="content-preview" class="trix-content">
11
+ <div id="content-preview" class="tiptap-content">
6
12
  </div>
7
13
  <% end %>
8
14
  </div>
9
- <%= pb_rails("button", props: { id: "preview-button", variant: "secondary", margin_top: "md" }) do %>
10
- <span>Preview Output</span>
11
- <% end %>
12
15
 
13
16
  <script>
14
17
  document.addEventListener('DOMContentLoaded', () => {
15
18
  function handleButtonClick() {
19
+ // Find the specific TipTap editor container by ID
16
20
  const editorContainer = [...document.querySelectorAll('[data-pb-react-props]')]
17
21
  .find(element => element.getAttribute('data-pb-react-props')?.includes('"id":"content-preview-editor"'))
18
22
 
19
- const editorElement = editorContainer?.querySelector('trix-editor')
20
- const inputId = editorElement?.getAttribute('input')
21
- const inputElement = inputId && document.getElementById(inputId)
22
-
23
- const editorContent = inputElement?.value || ''
23
+ if (!editorContainer) {
24
+ console.log('Editor container not found')
25
+ return
26
+ }
27
+
28
+ // Find the TipTap editor content
29
+ const tiptapEditor = editorContainer.querySelector('.ProseMirror')
24
30
  const previewArea = document.getElementById('content-preview')
25
31
  const cardDiv = document.getElementById('card-obfuscation')
26
32
 
27
- if (previewArea && cardDiv) {
33
+ if (tiptapEditor && previewArea && cardDiv) {
34
+ // Get the HTML content from the TipTap editor
35
+ const editorContent = tiptapEditor.innerHTML || ''
28
36
  previewArea.innerHTML = editorContent
29
37
  cardDiv.style.display = 'block'
30
38
  }
@@ -1 +1,5 @@
1
- <%= pb_rails("rich_text_editor", props: {simple: true, id: "simple"}) %>
1
+ <%= pb_rails("rich_text_editor", props: {
2
+ id: "simple-editor",
3
+ simple: true,
4
+ value: "Add your text here. Use the simple toolbar above to format your text."
5
+ }) %>
@@ -1 +1 @@
1
- <%= pb_rails("rich_text_editor", props: {id: "sticky", sticky: true, value: "In this example, when you scroll down, the rich text editor's toolbar will scroll along with the page and it will no longer be visible at the top of the page. Dummy text to enable scroll.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ornare lorem ut pellentesque tempor. Vivamus ut ex vestibulum velit rich text editor eleifend fringilla. Sed non metus dictum, elementum mauris wysiwyg html editor non, sagittis odio. Nullam pellentesque leo sit amet ante suscipit wysiwyg html editor sagittis. Donec tempus vulputate suscipit. Ut non felis rich text editor ac dolor pulvinar lacinia eu eget urna. Sed tincidunt sapien vulputate tellus fringilla sodales. Morbi accumsan dui wysiwyg html editor sed massa pellentesque, quis vestibulum lectus scelerisque. Nulla ultrices mi id felis luctus aliquet. Donec nec ligula wysiwyg html editor pretium sapien semper dictum eu id quam. Etiam ut sollicitudin nibh. Quisque eu ultrices dui. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus rich text editor mi eu consequat. Nullam tincidunt erat et placerat mattis. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus mi eu consequat. Nullam tincidunt erat et placerat mattis.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ornare lorem ut pellentesque tempor. Vivamus ut ex vestibulum velit rich text editor eleifend fringilla. Sed non metus dictum, elementum mauris wysiwyg html editor non, sagittis odio. Nullam pellentesque leo sit amet ante suscipit wysiwyg html editor sagittis. Donec tempus vulputate suscipit. Ut non felis rich text editor ac dolor pulvinar lacinia eu eget urna. Sed tincidunt sapien vulputate tellus fringilla sodales. Morbi accumsan dui wysiwyg html editor sed massa pellentesque, quis vestibulum lectus scelerisque. Nulla ultrices mi id felis luctus aliquet. Donec nec ligula wysiwyg html editor pretium sapien semper dictum eu id quam. Etiam ut sollicitudin nibh. Quisque eu ultrices dui. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor vulputate suscipit. Ut non felis rich text editor ac dolor pulvinar lacinia eu eget urna. Sed tincidunt sapien vulputate tellus fringilla sodales. Morbi accumsan dui wysiwyg html editor sed massa pellentesque, quis vestibulum lectus scelerisque. Nulla ultrices mi id felis luctus aliquet. Donec nec ligula wysiwyg html editor pretium sapien semper dictum eu id quam. Etiam ut sollicitudin nibh. Quisque eu ultrices dui. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus rich text editor mi eu consequat. Nullam tincidunt erat et placerat mattis. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus mi eu consequat. Nullam tincidunt erat et placerat mattis.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ornare lorem ut pellentesque tempor. Vivamus ut ex vestibulum velit rich text editor eleifend fringilla. Sed non metus dictum, elementum mauris wysiwyg html editor non, sagittis odio. Nullam pellentesque leo sit amet ante suscipit wysiwyg html editor sagittis. Donec tempus vulputate suscipit. Ut non felis rich text editor ac dolor pulvinar lacinia eu eget urna. Sed tincidunt sapien vulputate tellus fringilla sodales. Morbi accumsan dui wysiwyg html editor sed massa pellentesque, quis vestibulum lectus scelerisque. Nulla ultrices mi id felis luctus aliquet. Donec nec ligula wysiwyg html editor pretium sapien semper dictum eu id quam. Etiam ut sollicitudin nibh. Quisque eu ultrices dui. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus rich text editor mi eu consequat. Nullam tincidunt erat et placerat mattis. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus mi eu consequat. Nullam tincidunt erat et placerat mattis.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ornare lorem ut pellentesque tempor. Vivamus ut ex vestibulum velit rich text editor eleifend fringilla. Sed non metus dictum, elementum mauris wysiwyg html editor non, sagittis odio. Nullam pellentesque leo sit amet ante suscipit wysiwyg html editor sagittis. Donec tempus vulputate suscipit. Ut non felis rich text editor ac dolor pulvinar lacinia eu eget urna. Sed tincidunt sapien vulputate tellus fringilla sodales. Morbi accumsan dui wysiwyg html editor sed massa pellentesque, quis vestibulum lectus scelerisque. Nulla ultrices mi id felis luctus aliquet. Donec nec ligula wysiwyg html editor pretium sapien semper dictum eu id quam. Etiam ut sollicitudin nibh. Quisque eu ultrices dui. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus rich text editor mi eu consequat. Nullam tincidunt erat et placerat mattis. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus mi eu consequat. Nullam tincidunt erat et placerat mattis.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ornare lorem ut pellentesque tempor. Vivamus ut ex vestibulum velit rich text editor eleifend fringilla. Sed non metus dictum, elementum mauris wysiwyg html editor non, sagittis odio. Nullam pellentesque leo sit amet ante suscipit wysiwyg html editor sagittis. Donec tempus vulputate suscipit. Ut non felis rich text editor ac dolor pulvinar lacinia eu eget urna. Sed tincidunt sapien vulputate tellus fringilla sodales. Morbi accumsan dui wysiwyg html editor sed massa pellentesque, quis vestibulum lectus scelerisque. Nulla ultrices mi id felis luctus aliquet. Donec nec ligula wysiwyg html editor pretium sapien semper dictum eu id quam. Etiam ut sollicitudin nibh. Quisque eu ultrices dui. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus rich text editor mi eu consequat. Nullam tincidunt erat et placerat mattis. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus mi eu consequat. Nullam tincidunt erat et placerat mattis.sit amet ex. Aliquam cursus maximus rich text editor mi eu consequat. Nullam tincidunt erat et placerat mattis. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus mi eu consequat. Nullam tincidunt erat et placerat mattis.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ornare lorem ut pellentesque tempor. Vivamus ut ex vestibulum velit rich text editor eleifend fringilla. Sed non metus dictum, elementum mauris wysiwyg html editor non, sagittis odio. Nullam pellentesque leo sit amet ante suscipit wysiwyg html editor sagittis. Donec tempus vulputate suscipit. Ut non felis rich text editor ac dolor pulvinar lacinia eu eget urna. Sed tincidunt sapien vulputate tellus fringilla sodales. Morbi accumsan dui wysiwyg html editor sed massa pellentesque, quis vestibulum lectus scelerisque. Nulla ultrices mi id felis luctus aliquet. Donec nec ligula wysiwyg html editor pretium sapien semper dictum eu id quam. Etiam ut sollicitudin nibh. Quisque eu ultrices dui. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus rich text editor mi eu consequat. Nullam tincidunt erat et placerat mattis. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus mi eu consequat. Nullam tincidunt erat et placerat mattis.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ornare lorem ut pellentesque tempor. Vivamus ut ex vestibulum velit rich text editor eleifend fringilla. Sed non metus dictum, elementum mauris wysiwyg html editor non, sagittis odio. Nullam pellentesque leo sit amet ante suscipit wysiwyg html editor sagittis. Donec tempus vulputate suscipit. Ut non felis rich text editor ac dolor pulvinar lacinia eu eget urna. Sed tincidunt sapien vulputate tellus fringilla sodales. Morbi accumsan dui wysiwyg html editor sed massa pellentesque, quis vestibulum lectus scelerisque. Nulla ultrices mi id felis luctus aliquet. Donec nec ligula wysiwyg html editor pretium sapien semper dictum eu id quam. Etiam ut sollicitudin nibh. Quisque eu ultrices dui. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus rich text editor mi eu consequat. Nullam tincidunt erat et placerat mattis. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus mi eu consequat. Nullam tincidunt erat et placerat mattis."}) %>
1
+ <%= pb_rails("rich_text_editor", props: {id: "sticky-editor", sticky: true, value: "In this example, when you scroll down, the rich text editor's toolbar will scroll along with the page and it will no longer be visible at the top of the page. Dummy text to enable scroll.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ornare lorem ut pellentesque tempor. Vivamus ut ex vestibulum velit rich text editor eleifend fringilla. Sed non metus dictum, elementum mauris wysiwyg html editor non, sagittis odio. Nullam pellentesque leo sit amet ante suscipit wysiwyg html editor sagittis. Donec tempus vulputate suscipit. Ut non felis rich text editor ac dolor pulvinar lacinia eu eget urna. Sed tincidunt sapien vulputate tellus fringilla sodales. Morbi accumsan dui wysiwyg html editor sed massa pellentesque, quis vestibulum lectus scelerisque. Nulla ultrices mi id felis luctus aliquet. Donec nec ligula wysiwyg html editor pretium sapien semper dictum eu id quam. Etiam ut sollicitudin nibh. Quisque eu ultrices dui. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus rich text editor mi eu consequat. Nullam tincidunt erat et placerat mattis. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus mi eu consequat. Nullam tincidunt erat et placerat mattis.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ornare lorem ut pellentesque tempor. Vivamus ut ex vestibulum velit rich text editor eleifend fringilla. Sed non metus dictum, elementum mauris wysiwyg html editor non, sagittis odio. Nullam pellentesque leo sit amet ante suscipit wysiwyg html editor sagittis. Donec tempus vulputate suscipit. Ut non felis rich text editor ac dolor pulvinar lacinia eu eget urna. Sed tincidunt sapien vulputate tellus fringilla sodales. Morbi accumsan dui wysiwyg html editor sed massa pellentesque, quis vestibulum lectus scelerisque. Nulla ultrices mi id felis luctus aliquet. Donec nec ligula wysiwyg html editor pretium sapien semper dictum eu id quam. Etiam ut sollicitudin nibh. Quisque eu ultrices dui. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor vulputate suscipit. Ut non felis rich text editor ac dolor pulvinar lacinia eu eget urna. Sed tincidunt sapien vulputate tellus fringilla sodales. Morbi accumsan dui wysiwyg html editor sed massa pellentesque, quis vestibulum lectus scelerisque. Nulla ultrices mi id felis luctus aliquet. Donec nec ligula wysiwyg html editor pretium sapien semper dictum eu id quam. Etiam ut sollicitudin nibh. Quisque eu ultrices dui. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus rich text editor mi eu consequat. Nullam tincidunt erat et placerat mattis. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus mi eu consequat. Nullam tincidunt erat et placerat mattis.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ornare lorem ut pellentesque tempor. Vivamus ut ex vestibulum velit rich text editor eleifend fringilla. Sed non metus dictum, elementum mauris wysiwyg html editor non, sagittis odio. Nullam pellentesque leo sit amet ante suscipit wysiwyg html editor sagittis. Donec tempus vulputate suscipit. Ut non felis rich text editor ac dolor pulvinar lacinia eu eget urna. Sed tincidunt sapien vulputate tellus fringilla sodales. Morbi accumsan dui wysiwyg html editor sed massa pellentesque, quis vestibulum lectus scelerisque. Nulla ultrices mi id felis luctus aliquet. Donec nec ligula wysiwyg html editor pretium sapien semper dictum eu id quam. Etiam ut sollicitudin nibh. Quisque eu ultrices dui. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus rich text editor mi eu consequat. Nullam tincidunt erat et placerat mattis. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus mi eu consequat. Nullam tincidunt erat et placerat mattis.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ornare lorem ut pellentesque tempor. Vivamus ut ex vestibulum velit rich text editor eleifend fringilla. Sed non metus dictum, elementum mauris wysiwyg html editor non, sagittis odio. Nullam pellentesque leo sit amet ante suscipit wysiwyg html editor sagittis. Donec tempus vulputate suscipit. Ut non felis rich text editor ac dolor pulvinar lacinia eu eget urna. Sed tincidunt sapien vulputate tellus fringilla sodales. Morbi accumsan dui wysiwyg html editor sed massa pellentesque, quis vestibulum lectus scelerisque. Nulla ultrices mi id felis luctus aliquet. Donec nec ligula wysiwyg html editor pretium sapien semper dictum eu id quam. Etiam ut sollicitudin nibh. Quisque eu ultrices dui. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus rich text editor mi eu consequat. Nullam tincidunt erat et placerat mattis. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus mi eu consequat. Nullam tincidunt erat et placerat mattis.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ornare lorem ut pellentesque tempor. Vivamus ut ex vestibulum velit rich text editor eleifend fringilla. Sed non metus dictum, elementum mauris wysiwyg html editor non, sagittis odio. Nullam pellentesque leo sit amet ante suscipit wysiwyg html editor sagittis. Donec tempus vulputate suscipit. Ut non felis rich text editor ac dolor pulvinar lacinia eu eget urna. Sed tincidunt sapien vulputate tellus fringilla sodales. Morbi accumsan dui wysiwyg html editor sed massa pellentesque, quis vestibulum lectus scelerisque. Nulla ultrices mi id felis luctus aliquet. Donec nec ligula wysiwyg html editor pretium sapien semper dictum eu id quam. Etiam ut sollicitudin nibh. Quisque eu ultrices dui. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus rich text editor mi eu consequat. Nullam tincidunt erat et placerat mattis. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus mi eu consequat. Nullam tincidunt erat et placerat mattis.sit amet ex. Aliquam cursus maximus rich text editor mi eu consequat. Nullam tincidunt erat et placerat mattis. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus mi eu consequat. Nullam tincidunt erat et placerat mattis.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ornare lorem ut pellentesque tempor. Vivamus ut ex vestibulum velit rich text editor eleifend fringilla. Sed non metus dictum, elementum mauris wysiwyg html editor non, sagittis odio. Nullam pellentesque leo sit amet ante suscipit wysiwyg html editor sagittis. Donec tempus vulputate suscipit. Ut non felis rich text editor ac dolor pulvinar lacinia eu eget urna. Sed tincidunt sapien vulputate tellus fringilla sodales. Morbi accumsan dui wysiwyg html editor sed massa pellentesque, quis vestibulum lectus scelerisque. Nulla ultrices mi id felis luctus aliquet. Donec nec ligula wysiwyg html editor pretium sapien semper dictum eu id quam. Etiam ut sollicitudin nibh. Quisque eu ultrices dui. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus rich text editor mi eu consequat. Nullam tincidunt erat et placerat mattis. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus mi eu consequat. Nullam tincidunt erat et placerat mattis.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ornare lorem ut pellentesque tempor. Vivamus ut ex vestibulum velit rich text editor eleifend fringilla. Sed non metus dictum, elementum mauris wysiwyg html editor non, sagittis odio. Nullam pellentesque leo sit amet ante suscipit wysiwyg html editor sagittis. Donec tempus vulputate suscipit. Ut non felis rich text editor ac dolor pulvinar lacinia eu eget urna. Sed tincidunt sapien vulputate tellus fringilla sodales. Morbi accumsan dui wysiwyg html editor sed massa pellentesque, quis vestibulum lectus scelerisque. Nulla ultrices mi id felis luctus aliquet. Donec nec ligula wysiwyg html editor pretium sapien semper dictum eu id quam. Etiam ut sollicitudin nibh. Quisque eu ultrices dui. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus rich text editor mi eu consequat. Nullam tincidunt erat et placerat mattis. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus mi eu consequat. Nullam tincidunt erat et placerat mattis."}) %>
@@ -0,0 +1 @@
1
+ Use the optional `sticky` prop to make the toolbar sticky on scroll.
@@ -3,10 +3,10 @@ examples:
3
3
  rails:
4
4
  - rich_text_editor_default: Default
5
5
  - rich_text_editor_simple: Simple
6
- - rich_text_editor_attributes: Attributes
6
+ # - rich_text_editor_attributes: Attributes
7
7
  - rich_text_editor_focus: Focus
8
8
  - rich_text_editor_sticky: Sticky
9
- - rich_text_editor_templates: Templates
9
+ # - rich_text_editor_templates: Templates
10
10
  # - rich_text_editor_toolbar_bottom: Toolbar Bottom
11
11
  - rich_text_editor_inline: Inline
12
12
  - rich_text_editor_preview: Preview
@@ -18,9 +18,15 @@ module Playbook
18
18
  default: false
19
19
 
20
20
  prop :value
21
- prop :template
22
21
  prop :placeholder
23
22
  prop :input_options
23
+ prop :advanced_editor_toolbar, type: Playbook::Props::Boolean,
24
+ default: true
25
+ prop :extensions, type: Playbook::Props::HashArray,
26
+ default: []
27
+ prop :max_width, type: Playbook::Props::Enum,
28
+ values: %w[xs sm md lg xl],
29
+ default: "md"
24
30
 
25
31
  def classname
26
32
  generate_classname("pb_rich_text_editor_kit", simple_class, focus_class, sticky_class, separator: " ")
@@ -40,17 +46,20 @@ module Playbook
40
46
 
41
47
  def rich_text_options
42
48
  {
43
- id: id,
44
- inline: inline,
49
+ advancedEditorToolbar: advanced_editor_toolbar,
45
50
  className: classname,
51
+ extensions: extensions,
46
52
  focus: focus,
53
+ id: id,
54
+ inline: inline,
55
+ inputOptions: input_options,
56
+ maxWidth: max_width,
57
+ placeholder: placeholder,
58
+ railsEditor: true,
47
59
  simple: simple,
48
60
  sticky: sticky,
49
61
  toolbarBottom: toolbar_bottom,
50
- value: value,
51
- template: template,
52
- placeholder: placeholder,
53
- inputOptions: input_options,
62
+ value: value || "",
54
63
  }
55
64
  end
56
65
  end
@@ -1,8 +1,6 @@
1
1
  import React, { useState } from "react"
2
2
  import { useForm } from "react-hook-form"
3
- import Select from "../_select"
4
- import Body from "../../pb_body/_body"
5
- import Button from "../../pb_button/_button"
3
+ import { Button, Body, Select } from "playbook-ui"
6
4
 
7
5
  const SelectReactHook = (props) => {
8
6
  const { register, handleSubmit, formState: { errors } } = useForm({
@@ -119,22 +119,21 @@ const Table = (props: TableProps): React.ReactElement => {
119
119
  header.classList.add('sticky-left-shadow');
120
120
  }
121
121
 
122
- const headerWidth = (header as HTMLElement).offsetWidth;
123
- accumulatedWidth += headerWidth;
122
+ accumulatedWidth += (header as HTMLElement).offsetWidth;
123
+ }
124
124
 
125
- cells.forEach((cell) => {
126
- cell.classList.add('sticky');
127
- (cell as HTMLElement).style.left = `${accumulatedWidth - headerWidth}px`;
125
+ cells.forEach((cell) => {
126
+ cell.classList.add('sticky');
127
+ (cell as HTMLElement).style.left = `${accumulatedWidth - (header as HTMLElement).offsetWidth}px`;
128
128
 
129
- if (!isLastColumn) {
130
- cell.classList.add('with-border-right');
131
- cell.classList.remove('sticky-left-shadow');
132
- } else {
133
- cell.classList.remove('with-border-right');
134
- cell.classList.add('sticky-left-shadow');
135
- }
136
- });
137
- }
129
+ if (!isLastColumn) {
130
+ cell.classList.add('with-border-right');
131
+ cell.classList.remove('sticky-left-shadow');
132
+ } else {
133
+ cell.classList.remove('with-border-right');
134
+ cell.classList.add('sticky-left-shadow');
135
+ }
136
+ });
138
137
  });
139
138
  };
140
139
 
@@ -171,22 +170,21 @@ const Table = (props: TableProps): React.ReactElement => {
171
170
  header.classList.add('sticky-right-shadow');
172
171
  }
173
172
 
174
- const headerWidth = (header as HTMLElement).offsetWidth;
175
- accumulatedWidth += headerWidth;
173
+ accumulatedWidth += (header as HTMLElement).offsetWidth;
174
+ }
176
175
 
177
- cells.forEach((cell) => {
178
- cell.classList.add('sticky');
179
- (cell as HTMLElement).style.right = `${accumulatedWidth - headerWidth}px`;
176
+ cells.forEach((cell) => {
177
+ cell.classList.add('sticky');
178
+ (cell as HTMLElement).style.right = `${accumulatedWidth - (header as HTMLElement).offsetWidth}px`;
180
179
 
181
- if (!isLastColumn) {
182
- cell.classList.add('with-border-left');
183
- cell.classList.remove('sticky-right-shadow');
184
- } else {
185
- cell.classList.remove('with-border-left');
186
- cell.classList.add('sticky-right-shadow');
187
- }
188
- });
189
- }
180
+ if (!isLastColumn) {
181
+ cell.classList.add('with-border-left');
182
+ cell.classList.remove('sticky-right-shadow');
183
+ } else {
184
+ cell.classList.remove('with-border-left');
185
+ cell.classList.add('sticky-right-shadow');
186
+ }
187
+ });
190
188
  });
191
189
  };
192
190
 
@@ -8,25 +8,6 @@
8
8
  border-right: 1px solid $border_light !important;
9
9
  }
10
10
 
11
- // **Advanced Table** specific rules to eliminate double borders when vertical-border is active
12
- .pb_advanced_table &,
13
- &[data-vertical-border="true"] {
14
- // Remove first column box-shadow (preserve border-right in Chrome and use CSS var to respect column group border colors)
15
- .table-header-cells:first-child,
16
- .table-header-cells-custom:first-child,
17
- td:first-child,
18
- .pb_table_td:first-child,
19
- .checkbox-cell.checkbox-cell-header:first-child {
20
- box-shadow: none !important;
21
- border-right: 1px solid var(--column-border-color, #{$border_light}) !important;
22
- }
23
-
24
- .pb_table_td:nth-child(2) {
25
- box-shadow: none !important;
26
- }
27
- }
28
- // --- End Advanced Table First Column Code Section ---
29
-
30
11
  @media screen and (min-width: $screen-xs-min) {
31
12
  tr:hover, .pb_table_tr:hover {
32
13
  td:last-child, .pb_table_td:last-child {
@@ -82,35 +63,5 @@
82
63
  }
83
64
  }
84
65
  }
85
-
86
- // Dark mode support for advanced tables
87
- .pb_advanced_table.dark & {
88
- td, th, .pb_table_td, .pb_table_th {
89
- border-right: 1px solid $border_dark !important;
90
- }
91
-
92
- thead tr th {
93
- border-right: 1px solid $border_dark !important;
94
- }
95
-
96
- &[data-vertical-border="true"] {
97
- .table-header-cells:first-child,
98
- .table-header-cells-custom:first-child,
99
- td:first-child,
100
- .pb_table_td:first-child,
101
- .checkbox-cell.checkbox-cell-header:first-child {
102
- border-right: 1px solid var(--column-border-color, #{$border_dark}) !important;
103
- }
104
- }
105
-
106
- @media screen and (min-width: $screen-xs-min) {
107
- tr:hover, .pb_table_tr:hover {
108
- td:last-child, .pb_table_td:last-child {
109
- border-right-color: darken($border_dark, 10%) !important;
110
- }
111
- }
112
- }
113
- }
114
- // --- End Advanced Table Dark Mode Code Section ---
115
66
  }
116
67
  }
@@ -1,8 +1,5 @@
1
1
  import React from 'react'
2
- import Tooltip from '../_tooltip'
3
- import Button from '../../pb_button/_button'
4
- import Flex from '../../pb_flex/_flex'
5
- import FlexItem from '../../pb_flex/_flex_item'
2
+ import { Button, Tooltip, Flex, FlexItem } from 'playbook-ui';
6
3
 
7
4
  const TooltipSizing = (props) => {
8
5
 
@@ -161,10 +161,6 @@
161
161
  .typeahead-plus-icon {
162
162
  color: $text_lt_lighter;
163
163
  }
164
- .pb_badge_kit_primary {
165
- margin-bottom: 2px;
166
- margin-top: 2px;
167
- }
168
164
  .pb_badge_kit_primary span {
169
165
  line-height: 16.5px;
170
166
  letter-spacing: normal;
@@ -62,7 +62,6 @@ const MultiValue = (props: Props) => {
62
62
  className={pillClassName}
63
63
  closeProps={removeProps}
64
64
  htmlOptions={{onKeyDown:handleKeyDown}}
65
- marginRight="xs"
66
65
  removeIcon
67
66
  tabIndex={0}
68
67
  text={label}