playbook_ui 14.12.0 → 14.13.0.pre.alpha.PBNTR457formtimezoneselect6219
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/_playbook.scss +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/Components/CustomCell.tsx +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +11 -4
- data/app/pb_kits/playbook/pb_advanced_table/Utilities/ActionBarAnimationHelper.ts +26 -0
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +74 -10
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +43 -26
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.html.erb +3 -3
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.rb +11 -2
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_custom_cell.jsx +75 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_loading.html.erb +33 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_loading_rails.md +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_loading.md → _advanced_table_loading_react.md} +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_responsive.html.erb +38 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.jsx +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_rails.md +3 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_react.md +3 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header.html.erb +33 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header.jsx +55 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_rails.md +3 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_react.md +3 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +5 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +3 -1
- data/app/pb_kits/playbook/pb_advanced_table/index.js +9 -6
- data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +17 -3
- data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +15 -11
- data/app/pb_kits/playbook/pb_advanced_table/table_header.rb +14 -3
- data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +10 -7
- data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +9 -1
- data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb +9 -0
- data/app/pb_kits/playbook/pb_avatar/_avatar.scss +14 -0
- data/app/pb_kits/playbook/pb_avatar/_avatar.tsx +11 -7
- data/app/pb_kits/playbook/pb_avatar/avatar.html.erb +6 -7
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_badge_component_overlay.jsx +9 -3
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_circle_icon_component_overlay.jsx +6 -2
- data/app/pb_kits/playbook/pb_bar_graph/BarGraphStyles.scss +58 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_pb_styles.jsx +64 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_pb_styles.md +1 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_button/button.rb +1 -1
- data/app/pb_kits/playbook/pb_card/card.html.erb +21 -2
- data/app/pb_kits/playbook/pb_card/card.rb +7 -0
- data/app/pb_kits/playbook/pb_checkbox/_checkbox.tsx +17 -8
- data/app/pb_kits/playbook/pb_checkbox/checkbox.test.js +16 -0
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_react_hook.jsx +69 -0
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_react_hook.md +1 -0
- data/app/pb_kits/playbook/pb_checkbox/docs/example.yml +2 -1
- data/app/pb_kits/playbook/pb_checkbox/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_copy_button/_copy_button.scss +4 -0
- data/app/pb_kits/playbook/pb_copy_button/_copy_button.tsx +92 -0
- data/app/pb_kits/playbook/pb_copy_button/copy_button.html.erb +15 -0
- data/app/pb_kits/playbook/pb_copy_button/copy_button.rb +28 -0
- data/app/pb_kits/playbook/pb_copy_button/copy_button.test.jsx +64 -0
- data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_default.html.erb +2 -0
- data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_default.jsx +21 -0
- data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.html.erb +5 -0
- data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.jsx +45 -0
- data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.md +1 -0
- data/app/pb_kits/playbook/pb_copy_button/docs/example.yml +8 -0
- data/app/pb_kits/playbook/pb_copy_button/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_copy_button/index.js +47 -0
- data/app/pb_kits/playbook/pb_date/_date.tsx +14 -4
- data/app/pb_kits/playbook/pb_date/docs/_date_default.jsx +2 -1
- data/app/pb_kits/playbook/pb_date/docs/_date_unstyled.jsx +13 -5
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +3 -1
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_rails.html.erb +99 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_rails.md +1 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards_rails.html.erb +1 -3
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards_rails.md +7 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table.html.erb +61 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table.md +4 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table_react.jsx +90 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table_react.md +5 -0
- data/app/pb_kits/playbook/pb_draggable/docs/example.yml +4 -5
- data/app/pb_kits/playbook/pb_draggable/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_draggable/draggable_container.html.erb +2 -2
- data/app/pb_kits/playbook/pb_draggable/draggable_container.rb +5 -0
- data/app/pb_kits/playbook/pb_draggable/draggable_item.html.erb +1 -1
- data/app/pb_kits/playbook/pb_draggable/draggable_item.rb +4 -0
- data/app/pb_kits/playbook/pb_draggable/index.js +151 -15
- data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableContainer.tsx +7 -4
- data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableItem.tsx +6 -3
- data/app/pb_kits/playbook/pb_file_upload/file_upload.html.erb +1 -6
- data/app/pb_kits/playbook/pb_filter/filter.html.erb +1 -5
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close.html.erb +58 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close_rails.md +3 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/index.js +7 -5
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +1 -0
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +1 -0
- data/app/pb_kits/playbook/pb_form_group/form_group.html.erb +1 -6
- data/app/pb_kits/playbook/pb_form_pill/form_pill.html.erb +1 -1
- data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.tsx +11 -7
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_formatting.html.erb +11 -0
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_formatting.jsx +22 -0
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_formatting_rails.md +1 -0
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_formatting_react.md +1 -0
- data/app/pb_kits/playbook/pb_home_address_street/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_home_address_street/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_home_address_street/home_address_street.rb +13 -2
- data/app/pb_kits/playbook/pb_icon/icon.html.erb +2 -6
- data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_default.html.erb +1 -2
- data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_sizes.html.erb +27 -0
- data/app/pb_kits/playbook/pb_icon_button/docs/example.yml +1 -3
- data/app/pb_kits/playbook/pb_icon_button/icon_button.html.erb +1 -1
- data/app/pb_kits/playbook/pb_icon_button/icon_button.rb +3 -0
- data/app/pb_kits/playbook/pb_layout/body.html.erb +1 -5
- data/app/pb_kits/playbook/pb_layout/footer.html.erb +1 -5
- data/app/pb_kits/playbook/pb_layout/header.html.erb +1 -5
- data/app/pb_kits/playbook/pb_layout/item.html.erb +1 -5
- data/app/pb_kits/playbook/pb_layout/layout.html.erb +1 -5
- data/app/pb_kits/playbook/pb_layout/sidebar.html.erb +1 -5
- data/app/pb_kits/playbook/pb_legend/legend.html.erb +1 -6
- data/app/pb_kits/playbook/pb_lightbox/lightbox.scss +7 -6
- data/app/pb_kits/playbook/pb_link/_link.tsx +18 -0
- data/app/pb_kits/playbook/pb_link/docs/_link_target.html.erb +15 -0
- data/app/pb_kits/playbook/pb_link/docs/_link_target.jsx +29 -0
- data/app/pb_kits/playbook/pb_link/docs/example.yml +5 -3
- data/app/pb_kits/playbook/pb_link/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_link/link.html.erb +1 -1
- data/app/pb_kits/playbook/pb_link/link.rb +6 -0
- data/app/pb_kits/playbook/pb_link/link.test.jsx +30 -0
- data/app/pb_kits/playbook/pb_message/message.html.erb +1 -6
- data/app/pb_kits/playbook/pb_message/message_mention.html.erb +1 -6
- data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.html.erb +1 -6
- data/app/pb_kits/playbook/pb_nav/item.html.erb +7 -19
- data/app/pb_kits/playbook/pb_nav/nav.html.erb +3 -8
- data/app/pb_kits/playbook/pb_online_status/online_status.html.erb +1 -6
- data/app/pb_kits/playbook/pb_overlay/_overlay.tsx +4 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional.jsx +37 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional_react.md +1 -0
- data/app/pb_kits/playbook/pb_overlay/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_overlay/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_overlay/subcomponents/_overlay_token.tsx +48 -10
- data/app/pb_kits/playbook/pb_popover/popover.html.erb +1 -6
- data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.scss +6 -1
- data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.tsx +7 -5
- data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_default.html.erb +1 -0
- data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_default.jsx +7 -0
- data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_default.md +1 -0
- data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_full_width.html.erb +1 -0
- data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_full_width.jsx +18 -0
- data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_full_width_rails.md +1 -0
- data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_full_width_react.md +1 -0
- data/app/pb_kits/playbook/pb_progress_pills/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_progress_pills/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_progress_pills/progress_pills.html.erb +2 -7
- data/app/pb_kits/playbook/pb_progress_pills/progress_pills.rb +6 -0
- data/app/pb_kits/playbook/pb_progress_pills/progress_pills.test.js +26 -1
- data/app/pb_kits/playbook/pb_progress_simple/progress_simple.html.erb +1 -5
- data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_tooltip.html.erb +6 -6
- data/app/pb_kits/playbook/pb_progress_step/progress_step.html.erb +1 -5
- data/app/pb_kits/playbook/pb_progress_step/progress_step_item.html.erb +1 -5
- data/app/pb_kits/playbook/pb_radio/radio.html.erb +6 -11
- data/app/pb_kits/playbook/pb_table/docs/_table_with_background_kit.html.erb +6 -9
- data/app/pb_kits/playbook/pb_table/docs/_table_with_background_kit.jsx +6 -9
- data/app/pb_kits/playbook/pb_table/docs/_table_with_clickable_rows.html.erb +47 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_clickable_rows.jsx +88 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_clickable_rows.md +1 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible.jsx +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_click.html.erb +51 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_click_rails.md +2 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_content.jsx +12 -8
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_content_rails.html.erb +52 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_content_rails.md +0 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows_rails.html.erb +52 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows_rails.md +3 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table_rails.html.erb +80 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table_rails.md +1 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_selectable_rows.html.erb +96 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_selectable_rows.jsx +101 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_selectable_rows.md +1 -0
- data/app/pb_kits/playbook/pb_table/docs/example.yml +8 -0
- data/app/pb_kits/playbook/pb_table/docs/index.js +3 -1
- data/app/pb_kits/playbook/pb_table/index.ts +41 -9
- data/app/pb_kits/playbook/pb_table/styles/_collapsible.scss +4 -0
- data/app/pb_kits/playbook/pb_table/styles/_desktop_collapse.scss +26 -0
- data/app/pb_kits/playbook/pb_table/styles/_mobile.scss +0 -1
- data/app/pb_kits/playbook/pb_table/styles/_mobile_collapse.scss +25 -0
- data/app/pb_kits/playbook/pb_table/styles/_tablet_collapse.scss +25 -0
- data/app/pb_kits/playbook/pb_table/subcomponents/_table_body.tsx +29 -2
- data/app/pb_kits/playbook/pb_table/subcomponents/_table_row.tsx +31 -3
- data/app/pb_kits/playbook/pb_table/table_body.html.erb +13 -7
- data/app/pb_kits/playbook/pb_table/table_body.rb +2 -0
- data/app/pb_kits/playbook/pb_table/table_row.html.erb +14 -7
- data/app/pb_kits/playbook/pb_table/table_row.rb +15 -2
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask.html.erb +15 -1
- data/app/pb_kits/playbook/pb_text_input/index.js +60 -82
- data/app/pb_kits/playbook/pb_text_input/text_input.rb +5 -2
- data/app/pb_kits/playbook/pb_tooltip/_tooltip.tsx +3 -1
- data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_default.html.erb +1 -1
- data/app/pb_kits/playbook/pb_tooltip/index.js +45 -27
- data/app/pb_kits/playbook/pb_tooltip/tooltip.rb +5 -1
- data/app/pb_kits/playbook/pb_user/_user.tsx +3 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_light_weight.html.erb +42 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_light_weight.jsx +59 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_light_weight.md +2 -0
- data/app/pb_kits/playbook/pb_user/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_user/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_user/user.html.erb +1 -1
- data/app/pb_kits/playbook/pb_user/user.rb +1 -0
- data/app/pb_kits/playbook/pb_user/user.test.js +14 -0
- data/dist/chunks/_typeahead-PqkcDf1H.js +36 -0
- data/dist/chunks/_weekday_stacked-C7J0S4f7.js +45 -0
- data/dist/chunks/lazysizes-B7xYodB-.js +1 -0
- data/dist/chunks/{lib-kMuhBuU7.js → lib-D3us1bGD.js} +2 -2
- data/dist/chunks/{pb_form_validation-DBJ0wZuS.js → pb_form_validation-BpihMSOQ.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +6 -7
- data/dist/playbook-doc.js +1 -1
- 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/forms/builder/time_zone_select_field.rb +19 -0
- data/lib/playbook/forms/builder.rb +1 -0
- data/lib/playbook/pb_forms_global_props_helper.rb +136 -0
- data/lib/playbook/pb_forms_helper.rb +13 -4
- data/lib/playbook/version.rb +2 -2
- metadata +78 -26
- data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.scss +0 -66
- data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.tsx +0 -98
- data/app/pb_kits/playbook/pb_avatar_action_button/avatar_action_button.html.erb +0 -28
- data/app/pb_kits/playbook/pb_avatar_action_button/avatar_action_button.rb +0 -42
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_actions.html.erb +0 -19
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_actions.jsx +0 -26
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_default.html.erb +0 -10
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_default.jsx +0 -17
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_on_click.jsx +0 -19
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_onclick.html.erb +0 -16
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_placement.html.erb +0 -35
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_placement.jsx +0 -42
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_tooltip.html.erb +0 -13
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/example.yml +0 -15
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/index.js +0 -4
- data/app/pb_kits/playbook/pb_avatar_action_button/pb_avatar_action_button.test.js +0 -31
- data/dist/chunks/_typeahead-BWwaAo_0.js +0 -36
- data/dist/chunks/_weekday_stacked-DE8qVYG2.js +0 -45
- data/dist/chunks/lazysizes-DHz07jlL.js +0 -1
- /data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/{_fixed_confirmation_toast_auto_close.md → _fixed_confirmation_toast_auto_close_react.md} +0 -0
- /data/app/pb_kits/playbook/pb_table/docs/{_table_with_collapsible_with_custom_click.md → _table_with_collapsible_with_custom_click_react.md} +0 -0
@@ -1,5 +1,4 @@
|
|
1
1
|
import PbEnhancedElement from '../pb_enhanced_element'
|
2
|
-
|
3
2
|
import {
|
4
3
|
createPopperLite as createPopper,
|
5
4
|
flip,
|
@@ -17,27 +16,34 @@ export default class PbTooltip extends PbEnhancedElement {
|
|
17
16
|
|
18
17
|
connect() {
|
19
18
|
this.triggerElements.forEach((trigger) => {
|
20
|
-
|
21
|
-
this.mouseenterTimeout = setTimeout(() => {
|
22
|
-
this.showTooltip(trigger)
|
23
|
-
this.checkCloseTooltip(trigger)
|
24
|
-
}, TOOLTIP_TIMEOUT)
|
19
|
+
const method = this.triggerMethod
|
25
20
|
|
26
|
-
|
21
|
+
if (method === 'click') {
|
22
|
+
trigger.addEventListener('click', () => {
|
23
|
+
this.showTooltip(trigger)
|
24
|
+
})
|
25
|
+
} else {
|
26
|
+
trigger.addEventListener('mouseenter', () => {
|
27
|
+
this.mouseenterTimeout = setTimeout(() => {
|
28
|
+
this.showTooltip(trigger)
|
29
|
+
this.checkCloseTooltip(trigger)
|
30
|
+
}, TOOLTIP_TIMEOUT)
|
31
|
+
|
32
|
+
trigger.addEventListener('mouseleave', () => {
|
33
|
+
clearTimeout(this.mouseenterTimeout)
|
34
|
+
setTimeout(() => {
|
35
|
+
this.hideTooltip()
|
36
|
+
}, 0)
|
37
|
+
}, { once: true })
|
38
|
+
})
|
39
|
+
|
40
|
+
this.tooltip.addEventListener('mouseenter', () => {
|
27
41
|
clearTimeout(this.mouseenterTimeout)
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
})
|
34
|
-
})
|
35
|
-
|
36
|
-
this.tooltip.addEventListener('mouseenter', () => {
|
37
|
-
clearTimeout(this.mouseenterTimeout)
|
38
|
-
})
|
39
|
-
this.tooltip.addEventListener('mouseleave', () => {
|
40
|
-
this.hideTooltip()
|
42
|
+
})
|
43
|
+
this.tooltip.addEventListener('mouseleave', () => {
|
44
|
+
this.hideTooltip()
|
45
|
+
})
|
46
|
+
}
|
41
47
|
})
|
42
48
|
}
|
43
49
|
|
@@ -54,7 +60,7 @@ export default class PbTooltip extends PbEnhancedElement {
|
|
54
60
|
}
|
55
61
|
|
56
62
|
showTooltip(trigger) {
|
57
|
-
if (this.shouldShowTooltip ===
|
63
|
+
if (this.shouldShowTooltip === 'false') return
|
58
64
|
|
59
65
|
this.popper = createPopper(trigger, this.tooltip, {
|
60
66
|
placement: this.position,
|
@@ -78,6 +84,13 @@ export default class PbTooltip extends PbEnhancedElement {
|
|
78
84
|
],
|
79
85
|
})
|
80
86
|
this.tooltip.classList.add('show')
|
87
|
+
|
88
|
+
if (this.triggerMethod === 'click') {
|
89
|
+
clearTimeout(this.autoHideTimeout)
|
90
|
+
this.autoHideTimeout = setTimeout(() => {
|
91
|
+
this.hideTooltip()
|
92
|
+
}, 1000)
|
93
|
+
}
|
81
94
|
}
|
82
95
|
|
83
96
|
hideTooltip() {
|
@@ -94,25 +107,26 @@ export default class PbTooltip extends PbEnhancedElement {
|
|
94
107
|
let triggerEl
|
95
108
|
|
96
109
|
if (this.triggerElementId) {
|
97
|
-
triggerEl = document.querySelector(`#${this.triggerElementId}`)
|
110
|
+
triggerEl = document.querySelector(`#${this.triggerElementId}`)
|
98
111
|
} else {
|
99
112
|
const selectorIsId = this.triggerElementSelector.indexOf('#') > -1
|
100
|
-
triggerEl = selectorIsId
|
101
|
-
document.
|
113
|
+
triggerEl = selectorIsId
|
114
|
+
? document.querySelector(`${this.triggerElementSelector}`)
|
115
|
+
: document.querySelectorAll(`${this.triggerElementSelector}`)
|
102
116
|
}
|
103
117
|
|
104
118
|
if (!triggerEl) {
|
105
|
-
/* eslint no-console: ["error", { allow: ["warn", "error"] }] */
|
106
119
|
console.error('Tooltip Kit: an invalid or unavailable DOM reference was provided!')
|
107
120
|
return []
|
108
121
|
}
|
109
122
|
|
110
123
|
if (!triggerEl.length) triggerEl = [triggerEl]
|
111
|
-
return this._triggerElements =
|
124
|
+
return (this._triggerElements = this._triggerElements || triggerEl)
|
112
125
|
}
|
113
126
|
|
114
127
|
get tooltip() {
|
115
|
-
return this._tooltip =
|
128
|
+
return (this._tooltip =
|
129
|
+
this._tooltip || this.element.querySelector(`#${this.tooltipId}`))
|
116
130
|
}
|
117
131
|
|
118
132
|
get position() {
|
@@ -134,4 +148,8 @@ export default class PbTooltip extends PbEnhancedElement {
|
|
134
148
|
get shouldShowTooltip() {
|
135
149
|
return this.element.dataset.pbTooltipShowTooltip
|
136
150
|
}
|
151
|
+
|
152
|
+
get triggerMethod() {
|
153
|
+
return this.element.dataset.pbTooltipTriggerMethod || 'hover'
|
154
|
+
}
|
137
155
|
}
|
@@ -9,6 +9,9 @@ module Playbook
|
|
9
9
|
prop :tooltip_id
|
10
10
|
prop :dark, type: Playbook::Props::Boolean,
|
11
11
|
default: false
|
12
|
+
prop :trigger_method, type: Playbook::Props::Enum,
|
13
|
+
values: %w[hover click],
|
14
|
+
default: "hover"
|
12
15
|
|
13
16
|
def classname
|
14
17
|
generate_classname("pb_tooltip_kit", dark_class)
|
@@ -21,7 +24,8 @@ module Playbook
|
|
21
24
|
pb_tooltip_trigger_element_selector: trigger_element_selector,
|
22
25
|
pb_tooltip_trigger_element_id: trigger_element_id,
|
23
26
|
pb_tooltip_tooltip_id: tooltip_id,
|
24
|
-
pb_tooltip_show_tooltip: true
|
27
|
+
pb_tooltip_show_tooltip: true,
|
28
|
+
pb_tooltip_trigger_method: trigger_method
|
25
29
|
)
|
26
30
|
end
|
27
31
|
|
@@ -13,6 +13,7 @@ type UserProps = {
|
|
13
13
|
aria?: {[key: string]: string},
|
14
14
|
avatar?: boolean,
|
15
15
|
avatarUrl?: string,
|
16
|
+
bold?: boolean,
|
16
17
|
className?: string,
|
17
18
|
dark?: boolean,
|
18
19
|
data?: {[key: string]: string},
|
@@ -32,6 +33,7 @@ const User = (props: UserProps): React.ReactElement => {
|
|
32
33
|
aria = {},
|
33
34
|
avatar = false,
|
34
35
|
avatarUrl,
|
36
|
+
bold = true,
|
35
37
|
className,
|
36
38
|
dark = false,
|
37
39
|
data = {},
|
@@ -75,6 +77,7 @@ const User = (props: UserProps): React.ReactElement => {
|
|
75
77
|
}
|
76
78
|
<div className="content_wrapper">
|
77
79
|
<Title
|
80
|
+
bold={bold}
|
78
81
|
dark={dark}
|
79
82
|
size={size == 'lg' ? 3 : 4}
|
80
83
|
text={name}
|
@@ -0,0 +1,42 @@
|
|
1
|
+
<div class="pb--doc-demo-row">
|
2
|
+
<div>
|
3
|
+
<%= pb_rails("user", props: {
|
4
|
+
name: "Anna Black",
|
5
|
+
title: "Remodeling Consultant",
|
6
|
+
orientation: "vertical",
|
7
|
+
align: "center",
|
8
|
+
size: "lg",
|
9
|
+
avatar_url: "https://randomuser.me/api/portraits/women/44.jpg",
|
10
|
+
bold: false
|
11
|
+
}) %>
|
12
|
+
</div>
|
13
|
+
<div>
|
14
|
+
<%= pb_rails("user", props: {
|
15
|
+
name: "Anna Black",
|
16
|
+
title: "Remodeling Consultant",
|
17
|
+
orientation: "horizontal",
|
18
|
+
align: "left",
|
19
|
+
avatar_url: "https://randomuser.me/api/portraits/women/44.jpg",
|
20
|
+
bold: false
|
21
|
+
}) %>
|
22
|
+
</div>
|
23
|
+
<div>
|
24
|
+
<%= pb_rails("user", props: {
|
25
|
+
name: "Anna Black",
|
26
|
+
orientation: "horizontal",
|
27
|
+
align: "left",
|
28
|
+
avatar_url: "https://randomuser.me/api/portraits/women/44.jpg",
|
29
|
+
bold: false
|
30
|
+
}) %>
|
31
|
+
|
32
|
+
<br>
|
33
|
+
|
34
|
+
<%= pb_rails("user", props: {
|
35
|
+
name: "Anna Black",
|
36
|
+
orientation: "horizontal",
|
37
|
+
align: "left",
|
38
|
+
avatar: true,
|
39
|
+
bold: false
|
40
|
+
}) %>
|
41
|
+
</div>
|
42
|
+
</div>
|
@@ -0,0 +1,59 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import { User } from 'playbook-ui'
|
3
|
+
|
4
|
+
const UserLightWeight = (props) => {
|
5
|
+
return (
|
6
|
+
<div className="pb--doc-demo-row">
|
7
|
+
|
8
|
+
<div>
|
9
|
+
<User
|
10
|
+
align="center"
|
11
|
+
avatarUrl="https://randomuser.me/api/portraits/women/44.jpg"
|
12
|
+
bold={false}
|
13
|
+
name="Anna Black"
|
14
|
+
orientation="vertical"
|
15
|
+
size="lg"
|
16
|
+
title="Remodeling Consultant"
|
17
|
+
{...props}
|
18
|
+
/>
|
19
|
+
</div>
|
20
|
+
|
21
|
+
<div>
|
22
|
+
<User
|
23
|
+
align="left"
|
24
|
+
avatarUrl="https://randomuser.me/api/portraits/women/44.jpg"
|
25
|
+
bold={false}
|
26
|
+
name="Anna Black"
|
27
|
+
orientation="horizontal"
|
28
|
+
title="Remodeling Consultant"
|
29
|
+
{...props}
|
30
|
+
/>
|
31
|
+
</div>
|
32
|
+
|
33
|
+
<div>
|
34
|
+
<User
|
35
|
+
align="left"
|
36
|
+
avatarUrl="https://randomuser.me/api/portraits/women/44.jpg"
|
37
|
+
bold={false}
|
38
|
+
name="Anna Black"
|
39
|
+
orientation="horizontal"
|
40
|
+
{...props}
|
41
|
+
/>
|
42
|
+
|
43
|
+
<br />
|
44
|
+
|
45
|
+
<User
|
46
|
+
align="left"
|
47
|
+
avatar
|
48
|
+
bold={false}
|
49
|
+
name="Anna Black"
|
50
|
+
orientation="horizontal"
|
51
|
+
{...props}
|
52
|
+
/>
|
53
|
+
</div>
|
54
|
+
|
55
|
+
</div>
|
56
|
+
)
|
57
|
+
}
|
58
|
+
|
59
|
+
export default UserLightWeight
|
@@ -2,6 +2,7 @@ examples:
|
|
2
2
|
|
3
3
|
rails:
|
4
4
|
- user_default: Default
|
5
|
+
- user_light_weight: Light Weight
|
5
6
|
- user_with_territory: With Territory
|
6
7
|
- user_text_only: Text Only
|
7
8
|
- user_size: Horizontal Size
|
@@ -11,6 +12,7 @@ examples:
|
|
11
12
|
|
12
13
|
react:
|
13
14
|
- user_default: Default
|
15
|
+
- user_light_weight: Light Weight
|
14
16
|
- user_with_territory: With Territory
|
15
17
|
- user_text_only: Text Only
|
16
18
|
- user_size: Horizontal Size
|
@@ -1,4 +1,5 @@
|
|
1
1
|
export { default as UserDefault } from './_user_default.jsx'
|
2
|
+
export { default as UserLightWeight } from './_user_light_weight.jsx'
|
2
3
|
export { default as UserWithTerritory } from './_user_with_territory.jsx'
|
3
4
|
export { default as UserTextOnly } from './_user_text_only.jsx'
|
4
5
|
export { default as UserSize } from './_user_size.jsx'
|
@@ -12,7 +12,7 @@
|
|
12
12
|
}) %>
|
13
13
|
<% end %>
|
14
14
|
<%= content_tag(:div, class: "content_wrapper") do %>
|
15
|
-
<%= pb_rails("title", props: { text: object.name, size: object.title_size, dark: object.dark }) %>
|
15
|
+
<%= pb_rails("title", props: { text: object.name, size: object.title_size, dark: object.dark, bold: object.bold }) %>
|
16
16
|
<%= pb_rails("body", props: {
|
17
17
|
text: "#{object.details}",
|
18
18
|
dark: object.dark,
|
@@ -26,3 +26,17 @@ test('subtitle prop accepts a node', () => {
|
|
26
26
|
|
27
27
|
expect(screen.getByTestId('test-subtitle-block')).toHaveTextContent('test caption')
|
28
28
|
})
|
29
|
+
|
30
|
+
test('bold prop applies correct styling when false', () => {
|
31
|
+
render(
|
32
|
+
<User
|
33
|
+
bold={false}
|
34
|
+
data={{ testid: 'test-bold-false' }}
|
35
|
+
name="Anna Black"
|
36
|
+
/>
|
37
|
+
)
|
38
|
+
const titleElement = screen.getByText("Anna Black")
|
39
|
+
expect(titleElement).toBeInTheDocument()
|
40
|
+
|
41
|
+
expect(titleElement).toHaveClass('pb_title_kit_size_4_thin')
|
42
|
+
})
|