playbook_ui 15.3.0.pre.rc.7 → 15.4.0.pre.alpha.PLAY1541responsivefloorPOC12370
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.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_advanced_table/Components/RegularTableView.tsx +2 -1
- data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +3 -1
- data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableActions.ts +18 -3
- data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableState.ts +71 -14
- data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableHeader.tsx +3 -0
- data/app/pb_kits/playbook/pb_advanced_table/Utilities/RowUtils.ts +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +4 -4
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +12 -3
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +127 -5
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_control_rails.html.erb +4 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_control_rails.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_border_color.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_border_color_rails.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling.jsx +3 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling.md +2 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_column_headers.jsx +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_rails.html.erb +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_rails.md +2 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_inline_row_loading.jsx +28 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_inline_row_loading.md +11 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control.jsx +9 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.jsx +4 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.md +3 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns_and_header.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_rails.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_react.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header_multi_header.jsx +16 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header_multi_header_rails.html.erb +104 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header_multi_header_rails.md +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header_rails.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_mock_data_inline_loading_empty_children.js +42 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/flat_advanced_table.js +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/index.js +7 -7
- data/app/pb_kits/playbook/pb_advanced_table/scss_partials/advanced_table_sticky_mixin.scss +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/table_header.rb +90 -20
- data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +32 -3
- data/app/pb_kits/playbook/pb_background/background.html.erb +10 -2
- data/app/pb_kits/playbook/pb_background/docs/_background_category.md +1 -1
- data/app/pb_kits/playbook/pb_badge/_badge.tsx +4 -1
- data/app/pb_kits/playbook/pb_badge/badge.test.js +13 -0
- data/app/pb_kits/playbook/pb_bread_crumbs/docs/_bread_crumbs_default.html.erb +4 -4
- data/app/pb_kits/playbook/pb_bread_crumbs/docs/_bread_crumbs_default.jsx +4 -0
- data/app/pb_kits/playbook/pb_card/docs/_card_background.md +1 -1
- data/app/pb_kits/playbook/pb_card/docs/_card_header.md +1 -1
- data/app/pb_kits/playbook/pb_card/docs/_card_highlight.md +1 -1
- data/app/pb_kits/playbook/pb_card/docs/_card_light.md +1 -1
- data/app/pb_kits/playbook/pb_currency/_currency.tsx +20 -7
- data/app/pb_kits/playbook/pb_currency/currency.rb +35 -8
- data/app/pb_kits/playbook/pb_currency/currency.test.js +47 -0
- data/app/pb_kits/playbook/pb_currency/docs/_currency_variants.html.erb +1 -1
- data/app/pb_kits/playbook/pb_currency/docs/_currency_variants.jsx +1 -1
- data/app/pb_kits/playbook/pb_currency/docs/_currency_variants.md +1 -0
- data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +25 -11
- data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +2 -0
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +60 -7
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_and_dropdown_range.jsx +38 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_and_dropdown_range.md +14 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +2 -1
- data/app/pb_kits/playbook/pb_date_picker/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_quick_pick_styles.scss +11 -30
- data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.tsx +20 -13
- data/app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb +6 -4
- data/app/pb_kits/playbook/pb_date_range_inline/date_range_inline.test.js +17 -0
- data/app/pb_kits/playbook/pb_date_range_inline/docs/_date_range_inline_show_current_year.html.erb +4 -0
- data/app/pb_kits/playbook/pb_date_range_inline/docs/_date_range_inline_show_current_year.jsx +43 -0
- data/app/pb_kits/playbook/pb_date_range_inline/docs/_date_range_inline_show_current_year.md +1 -0
- data/app/pb_kits/playbook/pb_date_range_inline/docs/_description.md +1 -1
- data/app/pb_kits/playbook/pb_date_range_inline/docs/example.yml +3 -2
- data/app/pb_kits/playbook/pb_date_range_inline/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_date_stacked/_date_stacked.tsx +6 -4
- data/app/pb_kits/playbook/pb_date_stacked/date_stacked.html.erb +2 -3
- data/app/pb_kits/playbook/pb_date_stacked/date_stacked.rb +11 -5
- data/app/pb_kits/playbook/pb_date_stacked/date_stacked.test.js +26 -9
- data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_current_year.html.erb +12 -0
- data/app/pb_kits/playbook/pb_date_stacked/docs/{_date_stacked_not_current_year.jsx → _date_stacked_current_year.jsx} +6 -5
- data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_current_year.md +1 -0
- data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_default.html.erb +1 -1
- data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_default.jsx +1 -1
- data/app/pb_kits/playbook/pb_date_stacked/docs/_description.md +1 -1
- data/app/pb_kits/playbook/pb_date_stacked/docs/example.yml +2 -2
- data/app/pb_kits/playbook/pb_date_stacked/docs/index.js +1 -1
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_compound_components.html.erb +2 -2
- data/app/pb_kits/playbook/pb_distribution_bar/docs/_distribution_bar_custom_colors.md +1 -1
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +1 -0
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +111 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick.jsx +18 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick.md +4 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_default_dates.jsx +18 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_default_dates.md +1 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_range_end.jsx +19 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_range_end.md +1 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_with_date_pickers.jsx +38 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_with_date_pickers.md +14 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_active_style_options_react.md +1 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +5 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/index.js +5 -1
- data/app/pb_kits/playbook/pb_dropdown/dropdown.test.jsx +148 -2
- data/app/pb_kits/playbook/pb_dropdown/index.js +1 -1
- data/app/pb_kits/playbook/pb_dropdown/quickpick/index.ts +60 -0
- data/app/pb_kits/playbook/pb_filter/docs/_filter_max_width.md +1 -1
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.tsx +31 -9
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close.html.erb +15 -1
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_multi_line.html.erb +9 -8
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_positions.html.erb +11 -10
- data/app/pb_kits/playbook/pb_flex/_flex_item.tsx +12 -5
- data/app/pb_kits/playbook/pb_flex/docs/_flex_item_example.jsx +1 -0
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with_loading.html.erb +1 -1
- data/app/pb_kits/playbook/pb_form/formHelper.js +1 -1
- data/app/pb_kits/playbook/pb_form/pb_form_validation.js +44 -11
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.tsx +1 -1
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text_rails.md +1 -1
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text_react.md +1 -1
- data/app/pb_kits/playbook/pb_icon/docs/_icon_color.md +1 -1
- data/app/pb_kits/playbook/pb_icon_circle/docs/_icon_circle_color.md +1 -1
- data/app/pb_kits/playbook/pb_icon_stat_value/docs/_icon_stat_value_color.html.erb +7 -14
- data/app/pb_kits/playbook/pb_icon_stat_value/docs/_icon_stat_value_color.jsx +6 -15
- data/app/pb_kits/playbook/pb_layout/docs/_layout_collection.md +1 -1
- data/app/pb_kits/playbook/pb_nav/_item.tsx +18 -4
- data/app/pb_kits/playbook/pb_nav/_nav.scss +30 -5
- data/app/pb_kits/playbook/pb_nav/_nav_item.test.js +192 -0
- data/app/pb_kits/playbook/pb_nav/_vertical_nav.scss +1 -1
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_item_spacing.md +1 -1
- data/app/pb_kits/playbook/pb_nav/docs/_horizontal_nav_disabled.html.erb +21 -0
- data/app/pb_kits/playbook/pb_nav/docs/_horizontal_nav_disabled.jsx +113 -0
- data/app/pb_kits/playbook/pb_nav/docs/_horizontal_nav_disabled.md +1 -0
- data/app/pb_kits/playbook/pb_nav/docs/_nav_with_spacing_control.md +1 -1
- data/app/pb_kits/playbook/pb_nav/docs/_vertical_nav_disabled.html.erb +30 -0
- data/app/pb_kits/playbook/pb_nav/docs/_vertical_nav_disabled.jsx +117 -0
- data/app/pb_kits/playbook/pb_nav/docs/_vertical_nav_disabled.md +1 -0
- data/app/pb_kits/playbook/pb_nav/docs/example.yml +4 -0
- data/app/pb_kits/playbook/pb_nav/docs/index.js +3 -1
- data/app/pb_kits/playbook/pb_nav/item.html.erb +6 -4
- data/app/pb_kits/playbook/pb_nav/item.rb +11 -2
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_layout.md +1 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_description.md +3 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_default.md +1 -0
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_position.html.erb +1 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_position.md +11 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_description.md +3 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.md +2 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_default.md +1 -0
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_description.md +3 -1
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_color.md +2 -2
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_default.md +1 -0
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_description.md +3 -1
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_pb_line_graph_default.md +1 -0
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_pb_line_graph_legend_position.html.erb +1 -1
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +110 -17
- data/app/pb_kits/playbook/pb_pill/docs/_description.md +1 -1
- data/app/pb_kits/playbook/pb_popover/_popover.tsx +69 -34
- data/app/pb_kits/playbook/pb_popover/docs/_popover_append_to.jsx +68 -0
- data/app/pb_kits/playbook/pb_popover/docs/_popover_append_to_react.md +1 -0
- data/app/pb_kits/playbook/pb_popover/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_popover/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_popover/popover.test.js +80 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/Toolbar.tsx +1 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx +61 -8
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_description.md +1 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_default_rails.md +7 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_focus.html.erb +10 -2
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_inline_rails.md +1 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_preview.html.erb +19 -11
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_simple.html.erb +5 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_sticky.html.erb +1 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_sticky_rails.md +1 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/example.yml +2 -2
- data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb +16 -7
- data/app/pb_kits/playbook/pb_section_separator/docs/_description.md +1 -1
- data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +29 -0
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_border_radius_rails.md +1 -1
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_border_radius_react.md +1 -1
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_layout.md +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_side_highlight.md +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_sm.md +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_with_dynamic_collapsible.html.erb +63 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_dynamic_collapsible.jsx +89 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_dynamic_collapsible_rails.md +4 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_dynamic_collapsible_react.md +3 -0
- data/app/pb_kits/playbook/pb_table/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_table/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_text_input/text_input.rb +2 -2
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +7 -0
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.test.jsx +105 -1
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +23 -9
- data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.tsx +33 -1
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_custom_options.html.erb +64 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_custom_options.jsx +70 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_custom_options.md +1 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default_options.html.erb +67 -1
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default_value.jsx +68 -6
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.md +1 -1
- data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/index.js +2 -1
- data/app/pb_kits/playbook/tokens/_screen_sizes.scss +24 -0
- data/app/pb_kits/playbook/utilities/_mixins.scss +19 -4
- data/dist/chunks/{_line_graph-D5MBnrO9.js → _line_graph-8BUASxIP.js} +1 -1
- data/dist/chunks/_typeahead-DESMSfUO.js +24 -0
- data/dist/chunks/_weekday_stacked-EQMaMJvC.js +37 -0
- data/dist/chunks/{lib-QZuu1ltS.js → lib-CzQFzKzw.js} +1 -1
- data/dist/chunks/pb_form_validation-Bf9TK15t.js +1 -0
- data/dist/chunks/vendor.js +1 -1
- data/dist/playbook-doc.js +1 -19
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/version.rb +2 -2
- metadata +52 -10
- data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_not_current_year.html.erb +0 -5
- data/dist/chunks/_typeahead-BjYBazGq.js +0 -6
- data/dist/chunks/_weekday_stacked-DtBUku82.js +0 -37
- data/dist/chunks/pb_form_validation-CleM960_.js +0 -1
- /data/app/pb_kits/playbook/pb_popover/docs/{_popover_append_to.md → _popover_append_to_rails.md} +0 -0
|
@@ -159,6 +159,62 @@ const PopoverTestClicktoClose3 = () => {
|
|
|
159
159
|
)
|
|
160
160
|
};
|
|
161
161
|
|
|
162
|
+
//Test Popover with appendTo="parent"
|
|
163
|
+
const PopoverTestAppendToParent = () => {
|
|
164
|
+
const [mockState, setMockState] = React.useState(false)
|
|
165
|
+
const togglePopover = () => {
|
|
166
|
+
setMockState(!mockState)
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
const popoverReference = (
|
|
170
|
+
<Button onClick={togglePopover}
|
|
171
|
+
text="Click Me"
|
|
172
|
+
/>
|
|
173
|
+
);
|
|
174
|
+
return (
|
|
175
|
+
<div data-testid="parent-container"
|
|
176
|
+
id="parent-container"
|
|
177
|
+
>
|
|
178
|
+
<PbReactPopover
|
|
179
|
+
appendTo="parent"
|
|
180
|
+
offset
|
|
181
|
+
reference={popoverReference}
|
|
182
|
+
show={mockState}
|
|
183
|
+
>
|
|
184
|
+
{"Appended to parent"}
|
|
185
|
+
</PbReactPopover>
|
|
186
|
+
</div>
|
|
187
|
+
)
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
//Test Popover with appendTo CSS selector
|
|
191
|
+
const PopoverTestAppendToSelector = () => {
|
|
192
|
+
const [mockState, setMockState] = React.useState(false)
|
|
193
|
+
const togglePopover = () => {
|
|
194
|
+
setMockState(!mockState)
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
const popoverReference = (
|
|
198
|
+
<Button onClick={togglePopover}
|
|
199
|
+
text="Click Me"
|
|
200
|
+
/>
|
|
201
|
+
);
|
|
202
|
+
return (
|
|
203
|
+
<div data-testid="custom-container"
|
|
204
|
+
id="custom-container"
|
|
205
|
+
>
|
|
206
|
+
<PbReactPopover
|
|
207
|
+
appendTo="#custom-container"
|
|
208
|
+
offset
|
|
209
|
+
reference={popoverReference}
|
|
210
|
+
show={mockState}
|
|
211
|
+
>
|
|
212
|
+
{"Appended to custom container"}
|
|
213
|
+
</PbReactPopover>
|
|
214
|
+
</div>
|
|
215
|
+
)
|
|
216
|
+
};
|
|
217
|
+
|
|
162
218
|
|
|
163
219
|
test("renders Popover", () => {
|
|
164
220
|
render(<PopoverTest data={{ testid: testId}}/>)
|
|
@@ -217,4 +273,28 @@ const PopoverTestClicktoClose3 = () => {
|
|
|
217
273
|
fireEvent.click(btn);
|
|
218
274
|
|
|
219
275
|
expect(kit).not.toBeInTheDocument;
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
test("renders Popover with appendTo parent", () => {
|
|
279
|
+
render(<PopoverTestAppendToParent data={{ testid: testId}}/>)
|
|
280
|
+
const btn = screen.getByText(/click me/i)
|
|
281
|
+
fireEvent.click(btn);
|
|
282
|
+
const kit = screen.getByText("Appended to parent");
|
|
283
|
+
expect(kit).toBeInTheDocument();
|
|
284
|
+
|
|
285
|
+
// Check that the popover is rendered inside the parent container
|
|
286
|
+
const parentContainer = screen.getByTestId("parent-container");
|
|
287
|
+
expect(parentContainer).toContainElement(kit);
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
test("renders Popover with appendTo CSS selector", () => {
|
|
291
|
+
render(<PopoverTestAppendToSelector data={{ testid: testId}}/>)
|
|
292
|
+
const btn = screen.getByText(/click me/i)
|
|
293
|
+
fireEvent.click(btn);
|
|
294
|
+
const kit = screen.getByText("Appended to custom container");
|
|
295
|
+
expect(kit).toBeInTheDocument();
|
|
296
|
+
|
|
297
|
+
// Check that the popover is rendered inside the custom container
|
|
298
|
+
const customContainer = screen.getByTestId("custom-container");
|
|
299
|
+
expect(customContainer).toContainElement(kit);
|
|
220
300
|
});
|
|
@@ -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
|
-
|
|
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 =
|
|
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 &&
|
|
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={
|
|
264
|
+
<EditorToolbar editor={tipTapEditor}
|
|
223
265
|
extensions={extensions}
|
|
224
266
|
simple={simple}
|
|
225
267
|
sticky={sticky}
|
|
226
268
|
/>
|
|
227
269
|
)}
|
|
228
|
-
|
|
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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
NOTE: All editors have a default max-width of "md". Use our [Max Width global prop](https://playbook.powerapp.cloud/
|
|
1
|
+
NOTE: All editors have a default max-width of "md". Use our [Max Width global prop](https://playbook.powerapp.cloud/global_props/max_width) to override this default, as necessary.
|
|
@@ -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: {
|
|
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: {
|
|
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="
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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 @@
|
|
|
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
|
-
|
|
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,3 +1,3 @@
|
|
|
1
1
|
Section separator is a divider line that compartmentalizes content, typically used on cards or white backgrounds.
|
|
2
2
|
|
|
3
|
-
To ensure that the section separator is properly rendered, please be sure to use our global `width` prop to set width to 100%. [See here](https://playbook.powerapp.cloud/
|
|
3
|
+
To ensure that the section separator is properly rendered, please be sure to use our global `width` prop to set width to 100%. [See here](https://playbook.powerapp.cloud/global_props/width) for more information on the global width prop.
|
|
@@ -216,4 +216,33 @@ $pb_selectable_paddings: (
|
|
|
216
216
|
background: $error;
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.pb_selectable_card_kit_disabled,
|
|
222
|
+
.pb_selectable_card_kit_checked_disabled {
|
|
223
|
+
>label {
|
|
224
|
+
cursor: not-allowed;
|
|
225
|
+
|
|
226
|
+
@media (hover:hover) {
|
|
227
|
+
&:hover {
|
|
228
|
+
box-shadow: none !important;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.pb_selectable_card_kit_disabled>label {
|
|
235
|
+
border-color: $border_light !important;
|
|
236
|
+
|
|
237
|
+
.dark & {
|
|
238
|
+
border-color: $border_dark !important;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.pb_selectable_card_kit_checked_disabled>label {
|
|
243
|
+
border-color: $primary !important;
|
|
244
|
+
|
|
245
|
+
.dark & {
|
|
246
|
+
border-color: $primary_action_dark !important;
|
|
247
|
+
}
|
|
219
248
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
The `border_radius` prop accepts all of our [BorderRadius](https://playbook.powerapp.cloud/
|
|
1
|
+
The `border_radius` prop accepts all of our [BorderRadius](https://playbook.powerapp.cloud/global_props/border_radius) tokens, with `sm` as default.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
The `borderRadius` prop accepts all of our [BorderRadius](https://playbook.powerapp.cloud/
|
|
1
|
+
The `borderRadius` prop accepts all of our [BorderRadius](https://playbook.powerapp.cloud/global_props/border_radius) tokens, with `sm` as default.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
Use the `stack` and `gap` props in conjunction to layer multiple Skeleton loading bars on top of each other.
|
|
2
2
|
|
|
3
|
-
`stack` accepts a number that correlates to the number of rows (1 is default), and `gap` accepts a portion of our [spacing props](https://playbook.powerapp.cloud/
|
|
3
|
+
`stack` accepts a number that correlates to the number of rows (1 is default), and `gap` accepts a portion of our [spacing props](https://playbook.powerapp.cloud/global_props/spacing) (`xxs` as default, `xs`, `sm`, `md`, `lg`, `xl`, `xxl`) to set the pixel distance between each row. `gap` will not do anything if there is no corresponding `stack` prop set.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
Side highlight can take product, status, and category colors. To view full list of colors, visit <a href="https://playbook.powerapp.cloud/
|
|
1
|
+
Side highlight can take product, status, and category colors. To view full list of colors, visit <a href="https://playbook.powerapp.cloud/tokens/colors" target="_blank">token colors</a>.
|
|
2
2
|
|
|
3
3
|
Note: Only use category colors for categories. Do not mix it with product or status colors.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
Use table size `"sm"` when data density is a priority. Smaller row height enables the user to view more data without the need for scrolling.
|
|
2
2
|
|
|
3
|
-
Table can leverage the max-width property. Learn more
|
|
3
|
+
Table can leverage the max-width property. Learn more on our <a href="https://playbook.powerapp.cloud/global_props/max_width" target="_blank">Max Width Global Props page.</a>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<% content = capture do %>
|
|
2
|
+
<%= pb_rails("card", props: { border_none: true, border_radius: "none", padding: "md" }) do %>
|
|
3
|
+
<%= pb_rails("body", props: { text: "Nested content inside a Table Row" }) %>
|
|
4
|
+
<% end %>
|
|
5
|
+
<% end %>
|
|
6
|
+
|
|
7
|
+
<%= pb_rails("table", props: { size: "sm" }) do %>
|
|
8
|
+
<%= pb_rails("table/table_head") do %>
|
|
9
|
+
<%= pb_rails("table/table_row") do %>
|
|
10
|
+
<%= pb_rails("table/table_header", props: { text: "Column 1"}) %>
|
|
11
|
+
<%= pb_rails("table/table_header", props: { text: "Column 2"}) %>
|
|
12
|
+
<%= pb_rails("table/table_header", props: { text: "Column 3"}) %>
|
|
13
|
+
<%= pb_rails("table/table_header", props: { text: "Column 4"}) %>
|
|
14
|
+
<%= pb_rails("table/table_header", props: { text: "Column 5"}) %>
|
|
15
|
+
<%= pb_rails("table/table_header", props: { text: ""}) %>
|
|
16
|
+
<% end %>
|
|
17
|
+
<% end %>
|
|
18
|
+
<%= pb_rails("table/table_body") do %>
|
|
19
|
+
<%= pb_rails("table/table_row", props: { collapsible: true, collapsible_content: content, collapsible_side_highlight: true, id: "11" }) do %>
|
|
20
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 1", html_options: { onclick: "toggleArrows()" }}) %>
|
|
21
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 2", html_options: { onclick: "toggleArrows()" }}) %>
|
|
22
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 3", html_options: { onclick: "toggleArrows()" }}) %>
|
|
23
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 4", html_options: { onclick: "toggleArrows()" }}) %>
|
|
24
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 5", html_options: { onclick: "toggleArrows()" }}) %>
|
|
25
|
+
<%= pb_rails("table/table_cell", props: { text_align: "right", html_options: { onclick: "toggleArrows()" }}) do %>
|
|
26
|
+
<%= pb_rails("icon", props: {id: "chevron-icon-down", icon: "chevron-down", fixed_width: true, color: "primary" }) %>
|
|
27
|
+
<%= pb_rails("icon", props: {id: "chevron-icon-up", icon: "chevron-up", fixed_width: true, color: "primary" }) %>
|
|
28
|
+
<% end %>
|
|
29
|
+
<% end %>
|
|
30
|
+
<%= pb_rails("table/table_row") do %>
|
|
31
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 1"}) %>
|
|
32
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 2"}) %>
|
|
33
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 3"}) %>
|
|
34
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 4"}) %>
|
|
35
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 5"}) %>
|
|
36
|
+
<%= pb_rails("table/table_cell", props: { text: ""}) %>
|
|
37
|
+
<% end %>
|
|
38
|
+
<%= pb_rails("table/table_row") do %>
|
|
39
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 1"}) %>
|
|
40
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 2"}) %>
|
|
41
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 3"}) %>
|
|
42
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 4"}) %>
|
|
43
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 5"}) %>
|
|
44
|
+
<%= pb_rails("table/table_cell", props: { text: ""}) %>
|
|
45
|
+
<% end %>
|
|
46
|
+
<% end %>
|
|
47
|
+
<% end %>
|
|
48
|
+
|
|
49
|
+
<script>
|
|
50
|
+
const downArrow = document.getElementById("chevron-icon-down");
|
|
51
|
+
const upArrow = document.getElementById("chevron-icon-up");
|
|
52
|
+
|
|
53
|
+
upArrow.style.display = upArrow.style.display === 'none' ? 'inline-block' : 'none';
|
|
54
|
+
|
|
55
|
+
function toggleArrows() {
|
|
56
|
+
if (downArrow) {
|
|
57
|
+
downArrow.style.display = downArrow.style.display === 'none' ? 'inline-block' : 'none';
|
|
58
|
+
}
|
|
59
|
+
if (upArrow) {
|
|
60
|
+
upArrow.style.display = upArrow.style.display === 'none' ? 'inline-block' : 'none';
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
</script>
|