playbook_ui 15.4.0.pre.alpha.testingseparation12413 → 15.4.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.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_advanced_table/Components/RegularTableView.tsx +1 -2
- data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableState.ts +0 -15
- 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.test.jsx +5 -68
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_control_rails.html.erb +0 -4
- 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 +1 -4
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling.md +0 -2
- 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 +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_rails.md +0 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_fullscreen.jsx +1 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_infinite_scroll.jsx +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_inline_editing.jsx +1 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control.jsx +1 -9
- 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 +1 -4
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.md +2 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_row_styling.jsx +1 -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 +0 -16
- 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/example.yml +0 -1
- 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 +20 -90
- data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +3 -32
- data/app/pb_kits/playbook/pb_background/background.html.erb +2 -10
- data/app/pb_kits/playbook/pb_background/docs/_background_category.md +1 -1
- data/app/pb_kits/playbook/pb_badge/_badge.tsx +1 -4
- data/app/pb_kits/playbook/pb_badge/badge.test.js +0 -13
- 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 +7 -20
- data/app/pb_kits/playbook/pb_currency/currency.rb +8 -35
- data/app/pb_kits/playbook/pb_currency/currency.test.js +0 -47
- data/app/pb_kits/playbook/pb_currency/docs/_currency_negative.html.erb +0 -10
- data/app/pb_kits/playbook/pb_currency/docs/_currency_negative.jsx +0 -10
- data/app/pb_kits/playbook/pb_currency/docs/_currency_variants.html.erb +1 -8
- data/app/pb_kits/playbook/pb_currency/docs/_currency_variants.jsx +1 -8
- data/app/pb_kits/playbook/pb_currency/docs/_description.md +2 -2
- data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +11 -25
- data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +0 -2
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +7 -60
- data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +1 -2
- data/app/pb_kits/playbook/pb_date_picker/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.tsx +13 -20
- data/app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb +4 -6
- data/app/pb_kits/playbook/pb_date_range_inline/date_range_inline.test.js +0 -17
- 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 +2 -3
- data/app/pb_kits/playbook/pb_date_range_inline/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_date_stacked/_date_stacked.tsx +4 -6
- data/app/pb_kits/playbook/pb_date_stacked/date_stacked.html.erb +3 -2
- data/app/pb_kits/playbook/pb_date_stacked/date_stacked.rb +5 -11
- data/app/pb_kits/playbook/pb_date_stacked/date_stacked.test.js +9 -26
- 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/_date_stacked_not_current_year.html.erb +5 -0
- data/app/pb_kits/playbook/pb_date_stacked/docs/{_date_stacked_current_year.jsx → _date_stacked_not_current_year.jsx} +5 -6
- 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 +0 -1
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +6 -111
- 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 +0 -5
- data/app/pb_kits/playbook/pb_dropdown/docs/index.js +1 -5
- data/app/pb_kits/playbook/pb_dropdown/dropdown.test.jsx +2 -148
- data/app/pb_kits/playbook/pb_dropdown/index.js +1 -1
- data/app/pb_kits/playbook/pb_empty_state/docs/_empty_state_alignment.jsx +1 -2
- data/app/pb_kits/playbook/pb_empty_state/docs/_empty_state_default.jsx +1 -2
- data/app/pb_kits/playbook/pb_empty_state/docs/_empty_state_orientation.jsx +1 -2
- data/app/pb_kits/playbook/pb_empty_state/docs/_empty_state_size.jsx +1 -2
- 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 +9 -31
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close.html.erb +1 -15
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_multi_line.html.erb +8 -9
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_positions.html.erb +10 -11
- data/app/pb_kits/playbook/pb_flex/_flex_item.tsx +5 -12
- data/app/pb_kits/playbook/pb_flex/docs/_flex_item_example.jsx +0 -1
- data/app/pb_kits/playbook/pb_form/pb_form_validation.js +11 -44
- 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_form_pill/docs/_form_pill_wrapped.jsx +1 -4
- 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 +14 -7
- data/app/pb_kits/playbook/pb_icon_stat_value/docs/_icon_stat_value_color.jsx +15 -6
- data/app/pb_kits/playbook/pb_layout/docs/_layout_collection.md +1 -1
- data/app/pb_kits/playbook/pb_loading_inline/docs/_loading_inline_variant.jsx +1 -1
- data/app/pb_kits/playbook/pb_nav/_item.tsx +4 -18
- data/app/pb_kits/playbook/pb_nav/_nav.scss +5 -30
- data/app/pb_kits/playbook/pb_nav/_nav_item.test.js +0 -192
- 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/_nav_with_spacing_control.md +1 -1
- data/app/pb_kits/playbook/pb_nav/docs/example.yml +0 -4
- data/app/pb_kits/playbook/pb_nav/docs/index.js +1 -3
- data/app/pb_kits/playbook/pb_nav/item.html.erb +4 -6
- data/app/pb_kits/playbook/pb_nav/item.rb +2 -11
- 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 +1 -3
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_colors.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_default.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_height.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_horizontal.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_non_clickable.jsx +2 -1
- 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.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_negative_numbers.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_secondary_y_axis.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_spline.jsx +2 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_stacked.jsx +2 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_description.md +1 -3
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_block_content.jsx +1 -2
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_color_overrides.jsx +1 -2
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.md +1 -2
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_legend_position.jsx +1 -2
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_labels.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_legend.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_default.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_inner_sizes.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_live_data.jsx +1 -2
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_rounded.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_with_title.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_description.md +1 -3
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_color.jsx +1 -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_complex.jsx +1 -2
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_full_circle.jsx +1 -2
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_height.jsx +1 -2
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_min_max.jsx +1 -2
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_units.jsx +1 -2
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_description.md +1 -3
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_pb_line_graph_colors.jsx +1 -1
- 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 +17 -110
- data/app/pb_kits/playbook/pb_pill/docs/_description.md +1 -1
- data/app/pb_kits/playbook/pb_popover/_popover.tsx +34 -69
- data/app/pb_kits/playbook/pb_popover/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_popover/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_popover/popover.test.js +0 -80
- data/app/pb_kits/playbook/pb_radio/docs/_radio_react_hook.jsx +1 -3
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_description.md +1 -1
- data/app/pb_kits/playbook/pb_section_separator/docs/_description.md +1 -1
- data/app/pb_kits/playbook/pb_select/docs/_select_react_hook.jsx +1 -3
- data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +0 -29
- 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/example.yml +0 -2
- data/app/pb_kits/playbook/pb_table/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_text_input/text_input.rb +2 -2
- data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_sizing.jsx +1 -4
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +0 -7
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.test.jsx +1 -105
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +9 -23
- data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.tsx +1 -33
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default_options.html.erb +1 -67
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default_value.jsx +6 -68
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_react_hook.jsx +1 -2
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.md +1 -1
- data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_typeahead/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_user/docs/_user_font_options.jsx +1 -1
- data/dist/chunks/_line_graph-h5H-imfn.js +1 -0
- data/dist/chunks/_typeahead-U8AjZIIW.js +6 -0
- data/dist/chunks/_weekday_stacked-c6_R08J-.js +37 -0
- data/dist/chunks/componentRegistry-DzmmLR2x.js +1 -0
- data/dist/chunks/lib-CGxXTQ75.js +29 -0
- data/dist/chunks/pb_form_validation-DebqlUKZ.js +1 -0
- data/dist/chunks/vendor.js +1 -37
- data/dist/playbook-doc.js +19 -0
- 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 +12 -51
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header_multi_header_rails.html.erb +0 -104
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header_multi_header_rails.md +0 -1
- data/app/pb_kits/playbook/pb_currency/docs/_currency_abbreviated.md +0 -1
- data/app/pb_kits/playbook/pb_currency/docs/_currency_matching_decimals_rails.md +0 -1
- data/app/pb_kits/playbook/pb_currency/docs/_currency_matching_decimals_react.md +0 -1
- data/app/pb_kits/playbook/pb_currency/docs/_currency_negative.md +0 -1
- data/app/pb_kits/playbook/pb_currency/docs/_currency_no_symbol_rails.md +0 -1
- data/app/pb_kits/playbook/pb_currency/docs/_currency_no_symbol_react.md +0 -1
- data/app/pb_kits/playbook/pb_currency/docs/_currency_variants.md +0 -1
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_and_dropdown_range.jsx +0 -38
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_and_dropdown_range.md +0 -14
- data/app/pb_kits/playbook/pb_date_range_inline/docs/_date_range_inline_show_current_year.html.erb +0 -4
- data/app/pb_kits/playbook/pb_date_range_inline/docs/_date_range_inline_show_current_year.jsx +0 -43
- data/app/pb_kits/playbook/pb_date_range_inline/docs/_date_range_inline_show_current_year.md +0 -1
- data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_current_year.html.erb +0 -12
- data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_current_year.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick.jsx +0 -18
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick.md +0 -4
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_default_dates.jsx +0 -18
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_default_dates.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_range_end.jsx +0 -19
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_range_end.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_with_date_pickers.jsx +0 -38
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_with_date_pickers.md +0 -14
- data/app/pb_kits/playbook/pb_dropdown/quickpick/index.ts +0 -60
- data/app/pb_kits/playbook/pb_nav/docs/_horizontal_nav_disabled.html.erb +0 -21
- data/app/pb_kits/playbook/pb_nav/docs/_horizontal_nav_disabled.jsx +0 -113
- data/app/pb_kits/playbook/pb_nav/docs/_horizontal_nav_disabled.md +0 -1
- data/app/pb_kits/playbook/pb_nav/docs/_vertical_nav_disabled.html.erb +0 -30
- data/app/pb_kits/playbook/pb_nav/docs/_vertical_nav_disabled.jsx +0 -117
- data/app/pb_kits/playbook/pb_nav/docs/_vertical_nav_disabled.md +0 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_default.md +0 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_position.md +0 -11
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_default.md +0 -1
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_default.md +0 -1
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_pb_line_graph_default.md +0 -1
- data/app/pb_kits/playbook/pb_popover/docs/_popover_append_to.jsx +0 -71
- data/app/pb_kits/playbook/pb_popover/docs/_popover_append_to_react.md +0 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_with_dynamic_collapsible.html.erb +0 -63
- data/app/pb_kits/playbook/pb_table/docs/_table_with_dynamic_collapsible.jsx +0 -89
- data/app/pb_kits/playbook/pb_table/docs/_table_with_dynamic_collapsible_rails.md +0 -4
- data/app/pb_kits/playbook/pb_table/docs/_table_with_dynamic_collapsible_react.md +0 -3
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_custom_options.html.erb +0 -64
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_custom_options.jsx +0 -70
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_custom_options.md +0 -1
- data/dist/chunks/_typeahead-BUTLC28y.js +0 -6
- data/dist/chunks/lib-CgpqUb6l.js +0 -29
- /data/app/pb_kits/playbook/pb_popover/docs/{_popover_append_to_rails.md → _popover_append_to.md} +0 -0
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
} %>
|
|
39
39
|
|
|
40
|
-
<%= pb_rails("title", props: {size: 4, text: "align |
|
|
40
|
+
<%= pb_rails("title", props: {size: 4, text: "align | vertical_align", padding_top: "sm", padding_bottom: "sm"})%>
|
|
41
41
|
<%= pb_rails("pb_line_graph", props: {options: chartOptionsFirst}) %>
|
|
42
42
|
|
|
43
43
|
<% chartOptionsSecond = {
|
|
@@ -55,6 +55,7 @@ const formatToGlobalCountryName = (countryName: string) => {
|
|
|
55
55
|
|
|
56
56
|
const formatAllCountries = () => {
|
|
57
57
|
const countryData = intlTelInput.getCountryData()
|
|
58
|
+
|
|
58
59
|
for (let i = 0; i < countryData.length; i++) {
|
|
59
60
|
const country = countryData[i]
|
|
60
61
|
country.name = formatToGlobalCountryName(country.name)
|
|
@@ -109,54 +110,18 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.Ref<unknown>
|
|
|
109
110
|
|
|
110
111
|
const inputRef = useRef<HTMLInputElement | null>(null)
|
|
111
112
|
const itiRef = useRef<any>(null);
|
|
112
|
-
const wrapperRef = useRef<HTMLDivElement | null>(null);
|
|
113
113
|
const [inputValue, setInputValue] = useState(value)
|
|
114
114
|
const [error, setError] = useState(props.error || "")
|
|
115
115
|
const [dropDownIsOpen, setDropDownIsOpen] = useState(false)
|
|
116
116
|
const [selectedData, setSelectedData] = useState()
|
|
117
117
|
const [hasTyped, setHasTyped] = useState(false)
|
|
118
|
-
const [formSubmitted, setFormSubmitted] = useState(false)
|
|
119
|
-
const [hasStartedValidating, setHasStartedValidating] = useState(false)
|
|
120
|
-
|
|
121
|
-
// Only sync initial error from props, not continuous updates
|
|
122
|
-
// Once validation starts, internal validation takes over
|
|
123
|
-
useEffect(() => {
|
|
124
|
-
if (props.error && !hasStartedValidating) {
|
|
125
|
-
setError(props.error)
|
|
126
|
-
// If there's an initial error from props, mark as submitted so it shows
|
|
127
|
-
if (props.error) {
|
|
128
|
-
setFormSubmitted(true)
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}, [props.error, hasStartedValidating])
|
|
132
|
-
|
|
133
|
-
// Function to update validation state on the wrapper element
|
|
134
|
-
// Only applies when input is required
|
|
135
|
-
const updateValidationState = (hasError: boolean) => {
|
|
136
|
-
if (wrapperRef.current && required) {
|
|
137
|
-
if (hasError) {
|
|
138
|
-
wrapperRef.current.setAttribute('data-pb-phone-validation-error', 'true')
|
|
139
|
-
} else {
|
|
140
|
-
wrapperRef.current.removeAttribute('data-pb-phone-validation-error')
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
// Determine which error to display
|
|
146
|
-
// Show internal errors on blur (hasTyped) or on form submission (formSubmitted)
|
|
147
|
-
const shouldShowInternalError = (hasTyped || formSubmitted) && required && error
|
|
148
|
-
const displayError = shouldShowInternalError ? error : ""
|
|
149
118
|
|
|
150
119
|
useEffect(() => {
|
|
151
|
-
|
|
152
|
-
if (hasError) {
|
|
120
|
+
if ((error ?? '').length > 0) {
|
|
153
121
|
onValidate(false)
|
|
154
122
|
} else {
|
|
155
123
|
onValidate(true)
|
|
156
124
|
}
|
|
157
|
-
|
|
158
|
-
// Update validation state whenever error changes
|
|
159
|
-
updateValidationState(hasError)
|
|
160
125
|
}, [error, onValidate])
|
|
161
126
|
|
|
162
127
|
const unformatNumber = (formattedNumber: any) => {
|
|
@@ -172,7 +137,6 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.Ref<unknown>
|
|
|
172
137
|
|
|
173
138
|
const validateTooLongNumber = (itiInit: any) => {
|
|
174
139
|
if (!itiInit) return
|
|
175
|
-
|
|
176
140
|
if (itiInit.getValidationError() === ValidationError.TooLong) {
|
|
177
141
|
return showFormattedError('too long')
|
|
178
142
|
} else {
|
|
@@ -182,11 +146,13 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.Ref<unknown>
|
|
|
182
146
|
|
|
183
147
|
const validateTooShortNumber = (itiInit: any) => {
|
|
184
148
|
if (!itiInit) return
|
|
149
|
+
|
|
185
150
|
// If field is empty, don't show "too short" error
|
|
186
151
|
if (!inputValue || inputValue.trim() === '') {
|
|
187
152
|
setError('')
|
|
188
153
|
return false
|
|
189
154
|
}
|
|
155
|
+
|
|
190
156
|
if (itiInit.getValidationError() === ValidationError.TooShort) {
|
|
191
157
|
return showFormattedError('too short')
|
|
192
158
|
} else {
|
|
@@ -206,7 +172,7 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.Ref<unknown>
|
|
|
206
172
|
}
|
|
207
173
|
|
|
208
174
|
const validateUnhandledError = (itiInit: any) => {
|
|
209
|
-
if (!
|
|
175
|
+
if (!itiInit) return
|
|
210
176
|
if (itiInit.getValidationError() === ValidationError.SomethingWentWrong) {
|
|
211
177
|
if (inputValue.length === 1) {
|
|
212
178
|
return showFormattedError('too short')
|
|
@@ -218,6 +184,7 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.Ref<unknown>
|
|
|
218
184
|
}
|
|
219
185
|
}
|
|
220
186
|
}
|
|
187
|
+
|
|
221
188
|
const validateMissingAreaCode = (itiInit: any) => {
|
|
222
189
|
if (!itiInit) return
|
|
223
190
|
if (itiInit.getValidationError() === ValidationError.MissingAreaCode) {
|
|
@@ -234,9 +201,8 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.Ref<unknown>
|
|
|
234
201
|
}
|
|
235
202
|
}
|
|
236
203
|
|
|
237
|
-
// Validation for required empty fields
|
|
238
204
|
const validateRequiredField = () => {
|
|
239
|
-
if (
|
|
205
|
+
if (!inputValue || inputValue.trim() === '') {
|
|
240
206
|
setError('Missing phone number')
|
|
241
207
|
return true
|
|
242
208
|
}
|
|
@@ -244,24 +210,14 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.Ref<unknown>
|
|
|
244
210
|
}
|
|
245
211
|
|
|
246
212
|
const validateErrors = () => {
|
|
247
|
-
//
|
|
248
|
-
if (!hasStartedValidating) {
|
|
249
|
-
setHasStartedValidating(true)
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
// If field is empty, only show required field error if applicable
|
|
213
|
+
// If field is empty, show error message
|
|
253
214
|
if (!inputValue || inputValue.trim() === '') {
|
|
254
215
|
if (validateRequiredField()) return
|
|
255
|
-
// Clear any existing errors if field is empty and not required
|
|
256
|
-
if (!required) {
|
|
257
|
-
setError('')
|
|
258
|
-
}
|
|
259
216
|
return
|
|
260
217
|
}
|
|
261
218
|
|
|
262
|
-
|
|
219
|
+
if (!hasTyped && !error) return
|
|
263
220
|
|
|
264
|
-
// Run validation checks
|
|
265
221
|
if (itiRef.current) isValid(itiRef.current.isValidNumber())
|
|
266
222
|
if (validateOnlyNumbers(itiRef.current)) return
|
|
267
223
|
if (validateTooLongNumber(itiRef.current)) return
|
|
@@ -271,29 +227,6 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.Ref<unknown>
|
|
|
271
227
|
if (validateRepeatCountryCode(itiRef.current)) return
|
|
272
228
|
}
|
|
273
229
|
|
|
274
|
-
// Add listener for form validation to track when validation should be shown
|
|
275
|
-
useEffect(() => {
|
|
276
|
-
const handleInvalid = (event: Event) => {
|
|
277
|
-
const target = event.target as HTMLInputElement
|
|
278
|
-
const phoneNumberContainer = target.closest('.pb_phone_number_input')
|
|
279
|
-
|
|
280
|
-
if (phoneNumberContainer && phoneNumberContainer === wrapperRef.current) {
|
|
281
|
-
const invalidInputName = target.name || target.getAttribute('name')
|
|
282
|
-
if (invalidInputName === name) {
|
|
283
|
-
setFormSubmitted(true)
|
|
284
|
-
// Trigger validation when form is submitted
|
|
285
|
-
validateErrors()
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
document.addEventListener('invalid', handleInvalid, true)
|
|
291
|
-
|
|
292
|
-
return () => {
|
|
293
|
-
document.removeEventListener('invalid', handleInvalid, true)
|
|
294
|
-
}
|
|
295
|
-
}, [name, inputValue])
|
|
296
|
-
|
|
297
230
|
/*
|
|
298
231
|
useImperativeHandle exposes the kit's input element to a parent component via a ref.
|
|
299
232
|
See the Playbook docs for use cases.
|
|
@@ -305,12 +238,6 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.Ref<unknown>
|
|
|
305
238
|
setInputValue("")
|
|
306
239
|
setError("")
|
|
307
240
|
setHasTyped(false)
|
|
308
|
-
setFormSubmitted(false)
|
|
309
|
-
setHasStartedValidating(false)
|
|
310
|
-
// Only clear validation state if field was required
|
|
311
|
-
if (required) {
|
|
312
|
-
updateValidationState(false)
|
|
313
|
-
}
|
|
314
241
|
},
|
|
315
242
|
inputNode() {
|
|
316
243
|
return inputRef.current
|
|
@@ -320,12 +247,6 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.Ref<unknown>
|
|
|
320
247
|
// Run validation and return error message or true
|
|
321
248
|
const isEmpty = !inputValue || inputValue.trim() === ''
|
|
322
249
|
|
|
323
|
-
if (required && isEmpty) {
|
|
324
|
-
setError('Missing phone number')
|
|
325
|
-
setFormSubmitted(true)
|
|
326
|
-
return 'Missing phone number'
|
|
327
|
-
}
|
|
328
|
-
|
|
329
250
|
if (isEmpty) {
|
|
330
251
|
// Show missing phone number error
|
|
331
252
|
const errorMessage = 'Missing phone number'
|
|
@@ -345,7 +266,6 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.Ref<unknown>
|
|
|
345
266
|
const countryName = itiRef.current.getSelectedCountryData().name
|
|
346
267
|
const errorMessage = `Invalid ${countryName} phone number (repeat country code)`
|
|
347
268
|
setError(errorMessage)
|
|
348
|
-
setFormSubmitted(true)
|
|
349
269
|
setHasTyped(true)
|
|
350
270
|
return errorMessage
|
|
351
271
|
}
|
|
@@ -355,7 +275,6 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.Ref<unknown>
|
|
|
355
275
|
const countryName = itiRef.current.getSelectedCountryData().name
|
|
356
276
|
const errorMessage = `Invalid ${countryName} phone number (enter numbers only)`
|
|
357
277
|
setError(errorMessage)
|
|
358
|
-
setFormSubmitted(true)
|
|
359
278
|
setHasTyped(true)
|
|
360
279
|
return errorMessage
|
|
361
280
|
}
|
|
@@ -376,9 +295,7 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.Ref<unknown>
|
|
|
376
295
|
errorMessage = `Invalid ${countryName} phone number`
|
|
377
296
|
}
|
|
378
297
|
|
|
379
|
-
// Set the error state so the validation attribute gets added
|
|
380
298
|
setError(errorMessage)
|
|
381
|
-
setFormSubmitted(true)
|
|
382
299
|
setHasTyped(true)
|
|
383
300
|
|
|
384
301
|
return errorMessage
|
|
@@ -397,16 +314,11 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.Ref<unknown>
|
|
|
397
314
|
|
|
398
315
|
const handleOnChange = (evt: React.ChangeEvent<HTMLInputElement>) => {
|
|
399
316
|
if (!hasTyped) setHasTyped(true)
|
|
400
|
-
setInputValue(evt.target.value)
|
|
401
317
|
|
|
402
|
-
|
|
403
|
-
if (formSubmitted) {
|
|
404
|
-
setFormSubmitted(false)
|
|
405
|
-
}
|
|
318
|
+
setInputValue(evt.target.value)
|
|
406
319
|
|
|
407
320
|
let phoneNumberData
|
|
408
321
|
|
|
409
|
-
// Handle formatAsYouType with input event
|
|
410
322
|
if (formatAsYouType) {
|
|
411
323
|
const formattedPhoneNumberData = getCurrentSelectedData(itiRef.current, evt.target.value)
|
|
412
324
|
phoneNumberData = {...formattedPhoneNumberData, number: unformatNumber(formattedPhoneNumberData.number)}
|
|
@@ -417,15 +329,12 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.Ref<unknown>
|
|
|
417
329
|
setSelectedData(phoneNumberData)
|
|
418
330
|
onChange(phoneNumberData)
|
|
419
331
|
isValid(itiRef.current.isValidNumber())
|
|
420
|
-
|
|
421
|
-
// Trigger validation after onChange for React Hook Form
|
|
422
|
-
// This ensures validation state is up-to-date
|
|
423
|
-
setTimeout(() => validateErrors(), 0)
|
|
424
332
|
}
|
|
425
333
|
|
|
426
334
|
// Separating Concerns as React Docs Recommend
|
|
427
335
|
// This also Fixes things for our react_component rendering on the Rails Side
|
|
428
336
|
useEffect(formatAllCountries, [])
|
|
337
|
+
|
|
429
338
|
// If an initial country is not specified, the "globe" icon will show
|
|
430
339
|
// Always set a country
|
|
431
340
|
const fallbackCountry =
|
|
@@ -466,9 +375,9 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.Ref<unknown>
|
|
|
466
375
|
inputRef.current.addEventListener("open:countrydropdown", () => setDropDownIsOpen(true))
|
|
467
376
|
inputRef.current.addEventListener("close:countrydropdown", () => setDropDownIsOpen(false))
|
|
468
377
|
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
378
|
+
// Handle formatAsYouType with input event
|
|
379
|
+
if (formatAsYouType) {
|
|
380
|
+
inputRef.current.addEventListener("input", (evt: Event) => {
|
|
472
381
|
const target = evt.target as HTMLInputElement
|
|
473
382
|
const formattedValue = target.value
|
|
474
383
|
|
|
@@ -487,12 +396,13 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.Ref<unknown>
|
|
|
487
396
|
}
|
|
488
397
|
}
|
|
489
398
|
}, [])
|
|
399
|
+
|
|
490
400
|
let textInputProps: {[key: string]: any} = {
|
|
491
401
|
className: dropDownIsOpen ? 'dropdown_open' : '',
|
|
492
402
|
dark,
|
|
493
403
|
"data-phone-number": JSON.stringify(selectedData),
|
|
494
404
|
disabled,
|
|
495
|
-
error: hasTyped ? error : props.error
|
|
405
|
+
error: hasTyped ? error : props.error,
|
|
496
406
|
type: 'tel',
|
|
497
407
|
id,
|
|
498
408
|
label,
|
|
@@ -502,10 +412,7 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.Ref<unknown>
|
|
|
502
412
|
value: inputValue
|
|
503
413
|
}
|
|
504
414
|
|
|
505
|
-
let wrapperProps: Record<string, unknown> = {
|
|
506
|
-
className: classes,
|
|
507
|
-
ref: wrapperRef
|
|
508
|
-
}
|
|
415
|
+
let wrapperProps: Record<string, unknown> = { className: classes }
|
|
509
416
|
|
|
510
417
|
if (!isEmpty(aria)) textInputProps = {...textInputProps, ...ariaProps}
|
|
511
418
|
if (!isEmpty(data)) wrapperProps = {...wrapperProps, ...dataProps}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
A pill uses both a keyword and a specific color to categorize an item. Each pill directly corresponds to a data color <a href="https://playbook.powerapp.cloud/
|
|
1
|
+
A pill uses both a keyword and a specific color to categorize an item. Each pill directly corresponds to a data color <a href="https://playbook.powerapp.cloud/visual_guidelines/colors" target="_blank">here</a>.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable react/no-multi-comp */
|
|
2
|
-
import React, { useEffect,
|
|
2
|
+
import React, { useEffect, useState } from "react";
|
|
3
3
|
import ReactDOM from "react-dom";
|
|
4
4
|
import {
|
|
5
5
|
Popper,
|
|
@@ -24,7 +24,6 @@ import { uniqueId } from '../utilities/object';
|
|
|
24
24
|
type ModifiedGlobalProps = Omit<GlobalProps, 'minWidth' | 'maxHeight' | 'minHeight'>
|
|
25
25
|
|
|
26
26
|
type PbPopoverProps = {
|
|
27
|
-
appendTo?: string;
|
|
28
27
|
aria?: { [key: string]: string };
|
|
29
28
|
className?: string;
|
|
30
29
|
closeOnClick?: "outside" | "inside" | "any";
|
|
@@ -63,25 +62,6 @@ const popoverModifiers = ({
|
|
|
63
62
|
return offset ? modifiers.concat([POPOVER_MODIFIERS.offset]) : modifiers;
|
|
64
63
|
};
|
|
65
64
|
|
|
66
|
-
const getAppendTarget = (
|
|
67
|
-
appendTo: string | undefined,
|
|
68
|
-
targetId: string
|
|
69
|
-
): HTMLElement => {
|
|
70
|
-
if (!appendTo || appendTo === "body") return document.body;
|
|
71
|
-
|
|
72
|
-
if (appendTo === "parent") {
|
|
73
|
-
const referenceWrapper = document.querySelector(`#reference-${targetId}`);
|
|
74
|
-
if (referenceWrapper?.parentElement) {
|
|
75
|
-
return referenceWrapper.parentElement;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
const selectorMatch = document.querySelector(appendTo);
|
|
80
|
-
if (selectorMatch instanceof HTMLElement) return selectorMatch;
|
|
81
|
-
|
|
82
|
-
return document.body;
|
|
83
|
-
};
|
|
84
|
-
|
|
85
65
|
const Popover = (props: PbPopoverProps) => {
|
|
86
66
|
const {
|
|
87
67
|
aria = {},
|
|
@@ -109,7 +89,7 @@ const Popover = (props: PbPopoverProps) => {
|
|
|
109
89
|
const popoverSpacing =
|
|
110
90
|
filteredGlobalProps.includes("dark") || !filteredGlobalProps
|
|
111
91
|
? "p_sm"
|
|
112
|
-
: filteredGlobalProps
|
|
92
|
+
: filteredGlobalProps
|
|
113
93
|
const overflowHandling = maxHeight || maxWidth ? "overflow_handling" : "";
|
|
114
94
|
const zIndexStyle = zIndex ? { zIndex: zIndex } : {};
|
|
115
95
|
const widthHeightStyles = () => {
|
|
@@ -133,7 +113,7 @@ const Popover = (props: PbPopoverProps) => {
|
|
|
133
113
|
|
|
134
114
|
return (
|
|
135
115
|
<Popper
|
|
136
|
-
modifiers={popoverModifiers({ modifiers, offset
|
|
116
|
+
modifiers={popoverModifiers({ modifiers, offset })}
|
|
137
117
|
placement={placement}
|
|
138
118
|
referenceElement={referenceElement}
|
|
139
119
|
>
|
|
@@ -174,7 +154,6 @@ const Popover = (props: PbPopoverProps) => {
|
|
|
174
154
|
const PbReactPopover = (props: PbPopoverProps): React.ReactElement => {
|
|
175
155
|
const [targetId] = useState(uniqueId('id-'))
|
|
176
156
|
const {
|
|
177
|
-
appendTo,
|
|
178
157
|
className,
|
|
179
158
|
children,
|
|
180
159
|
modifiers = [],
|
|
@@ -191,56 +170,42 @@ const PbReactPopover = (props: PbPopoverProps): React.ReactElement => {
|
|
|
191
170
|
minHeight,
|
|
192
171
|
minWidth,
|
|
193
172
|
width,
|
|
194
|
-
closeOnClick,
|
|
195
|
-
shouldClosePopover = noop,
|
|
196
173
|
} = props;
|
|
197
174
|
|
|
198
|
-
// Store latest callback in a ref to avoid re-runs
|
|
199
|
-
const shouldClosePopoverRef = useRef(shouldClosePopover);
|
|
200
|
-
|
|
201
|
-
// Update ref on change
|
|
202
175
|
useEffect(() => {
|
|
203
|
-
|
|
204
|
-
}, [shouldClosePopover]);
|
|
176
|
+
const { closeOnClick, shouldClosePopover = noop } = props;
|
|
205
177
|
|
|
206
|
-
useEffect(() => {
|
|
207
178
|
if (!closeOnClick) return;
|
|
208
179
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
const handleClick = (e: MouseEvent) => {
|
|
214
|
-
const target = e.target as HTMLElement
|
|
215
|
-
|
|
216
|
-
const targetIsPopover =
|
|
217
|
-
target.closest("#" + targetId) !== null;
|
|
218
|
-
const targetIsReference =
|
|
219
|
-
target.closest("#reference-" + targetId) !== null;
|
|
180
|
+
document.body.addEventListener(
|
|
181
|
+
"click",
|
|
182
|
+
(e: MouseEvent) => {
|
|
183
|
+
const target = e.target as HTMLElement
|
|
220
184
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
185
|
+
const targetIsPopover =
|
|
186
|
+
target.closest("#" + targetId) !== null;
|
|
187
|
+
const targetIsReference =
|
|
188
|
+
target.closest("#reference-" + targetId) !== null;
|
|
224
189
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
break;
|
|
229
|
-
case "inside":
|
|
230
|
-
if (targetIsPopover) shouldClose();
|
|
231
|
-
break;
|
|
232
|
-
case "any":
|
|
233
|
-
if (targetIsPopover || !targetIsPopover && !targetIsReference) shouldClose();
|
|
234
|
-
break;
|
|
235
|
-
}
|
|
236
|
-
};
|
|
190
|
+
const shouldClose = () => {
|
|
191
|
+
setTimeout(() => shouldClosePopover(true), 0);
|
|
192
|
+
}
|
|
237
193
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
194
|
+
switch (closeOnClick) {
|
|
195
|
+
case "outside":
|
|
196
|
+
if (!targetIsPopover && !targetIsReference) shouldClose();
|
|
197
|
+
break;
|
|
198
|
+
case "inside":
|
|
199
|
+
if (targetIsPopover) shouldClose();
|
|
200
|
+
break;
|
|
201
|
+
case "any":
|
|
202
|
+
if (targetIsPopover || !targetIsPopover && !targetIsReference) shouldClose();
|
|
203
|
+
break;
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
{ capture: true }
|
|
207
|
+
);
|
|
208
|
+
}, []);
|
|
244
209
|
|
|
245
210
|
const popoverComponent = (
|
|
246
211
|
<Popover
|
|
@@ -281,10 +246,10 @@ const PbReactPopover = (props: PbPopoverProps): React.ReactElement => {
|
|
|
281
246
|
{show &&
|
|
282
247
|
(usePortal ? (
|
|
283
248
|
<>
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
249
|
+
{ReactDOM.createPortal(
|
|
250
|
+
popoverComponent,
|
|
251
|
+
document.querySelector(portal)
|
|
252
|
+
)}
|
|
288
253
|
</>
|
|
289
254
|
) : (
|
|
290
255
|
{ popoverComponent }
|
|
@@ -4,4 +4,3 @@ export { default as PopoverClose } from './_popover_close.jsx'
|
|
|
4
4
|
export { default as PopoverZIndex } from './_popover_z_index.jsx'
|
|
5
5
|
export { default as PopoverScrollHeight } from './_popover_scroll_height.jsx'
|
|
6
6
|
export { default as PopoverActionableContent } from './_popover_actionable_content.jsx'
|
|
7
|
-
export { default as PopoverAppendTo } from './_popover_append_to.jsx'
|
|
@@ -159,62 +159,6 @@ 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
|
-
|
|
218
162
|
|
|
219
163
|
test("renders Popover", () => {
|
|
220
164
|
render(<PopoverTest data={{ testid: testId}}/>)
|
|
@@ -273,28 +217,4 @@ const PopoverTestAppendToSelector = () => {
|
|
|
273
217
|
fireEvent.click(btn);
|
|
274
218
|
|
|
275
219
|
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);
|
|
300
220
|
});
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import React from "react"
|
|
2
2
|
import { useForm } from "react-hook-form"
|
|
3
|
-
import Radio from "
|
|
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({
|
|
@@ -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/visual_guidelines/max_width) to override this default, as necessary.
|
|
@@ -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/visual_guidelines/width) for more information on the global width prop.
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import React, { useState } from "react"
|
|
2
2
|
import { useForm } from "react-hook-form"
|
|
3
|
-
import Select from "
|
|
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({
|
|
@@ -216,33 +216,4 @@ $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
|
-
}
|
|
248
219
|
}
|
|
@@ -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/visual_guidelines/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/visual_guidelines/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/visual_guidelines/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/visual_guidelines" 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.
|