playbook_ui 13.13.0 → 13.14.0.pre.alpha.play1101betaicons1798
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 -0
- data/app/pb_kits/playbook/index.js +14 -1
- data/app/pb_kits/playbook/pb_avatar/_avatar.tsx +5 -5
- data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.tsx +3 -3
- data/app/pb_kits/playbook/pb_background/_background.tsx +9 -9
- data/app/pb_kits/playbook/pb_badge/_badge.tsx +2 -2
- data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.tsx +3 -3
- data/app/pb_kits/playbook/pb_beta_icon/_icon.scss +12 -0
- data/app/pb_kits/playbook/pb_beta_icon/_icon.tsx +164 -0
- data/app/pb_kits/playbook/pb_beta_icon/docs/_description.md +1 -0
- data/app/pb_kits/playbook/pb_beta_icon/docs/_footer.md +2 -0
- data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_animate.html.erb +3 -0
- data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_animate.jsx +35 -0
- data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_animate.md +1 -0
- data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_border.html.erb +1 -0
- data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_border.jsx +19 -0
- data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_border_swift.md +7 -0
- data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_custom.html.erb +16 -0
- data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_custom.jsx +34 -0
- data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_custom.md +19 -0
- data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_default.html.erb +1 -0
- data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_default.jsx +17 -0
- data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_default_swift.md +7 -0
- data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_fa_kit.html.erb +1 -0
- data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_fa_kit.jsx +21 -0
- data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_fa_kit.md +7 -0
- data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_flip.html.erb +3 -0
- data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_flip.jsx +33 -0
- data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_flip_swift.md +11 -0
- data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_props_swift.md +8 -0
- data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_pull.html.erb +2 -0
- data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_pull.jsx +26 -0
- data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_pull.md +1 -0
- data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_rotate.html.erb +3 -0
- data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_rotate.jsx +33 -0
- data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_rotate_swift.md +11 -0
- data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_sizes.html.erb +16 -0
- data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_sizes.jsx +133 -0
- data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_sizes_swift.md +46 -0
- data/app/pb_kits/playbook/pb_beta_icon/docs/example.yml +30 -0
- data/app/pb_kits/playbook/pb_beta_icon/docs/index.js +9 -0
- data/app/pb_kits/playbook/pb_beta_icon/icon.html.erb +15 -0
- data/app/pb_kits/playbook/pb_beta_icon/icon.rb +153 -0
- data/app/pb_kits/playbook/pb_beta_icon/icon.test.js +155 -0
- data/app/pb_kits/playbook/pb_body/_body.scss +0 -5
- data/app/pb_kits/playbook/pb_body/_body.tsx +5 -9
- data/app/pb_kits/playbook/pb_body/_body_mixins.scss +0 -20
- data/app/pb_kits/playbook/pb_body/body.rb +1 -8
- data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumb_item.tsx +3 -4
- data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumbs.tsx +3 -3
- data/app/pb_kits/playbook/pb_button/_button.tsx +40 -37
- data/app/pb_kits/playbook/pb_button/docs/_button_props_swift.md +11 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_reaction_swift.md +26 -0
- data/app/pb_kits/playbook/pb_button/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.tsx +3 -3
- data/app/pb_kits/playbook/pb_caption/_caption.tsx +1 -1
- data/app/pb_kits/playbook/pb_card/_card.tsx +2 -2
- data/app/pb_kits/playbook/pb_card/_card_mixin.scss +0 -1
- data/app/pb_kits/playbook/pb_card/docs/_card_background.jsx +5 -4
- data/app/pb_kits/playbook/pb_checkbox/_checkbox.tsx +3 -3
- data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +9 -9
- data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.tsx +1 -1
- data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +5 -7
- data/app/pb_kits/playbook/pb_collapsible/_helper_functions.ts +2 -2
- data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleContent.tsx +5 -4
- data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleMain.tsx +16 -12
- data/app/pb_kits/playbook/pb_contact/_contact.tsx +3 -3
- data/app/pb_kits/playbook/pb_contact/docs/_contact_default_swift.md +14 -0
- data/app/pb_kits/playbook/pb_contact/docs/_contact_props_swift.md +6 -0
- data/app/pb_kits/playbook/pb_contact/docs/_contact_with_detail_swift.md +14 -0
- data/app/pb_kits/playbook/pb_contact/docs/example.yml +6 -0
- data/app/pb_kits/playbook/pb_currency/_currency.tsx +2 -2
- data/app/pb_kits/playbook/pb_dashboard/pbChartsColorsHelper.ts +1 -1
- data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.ts +4 -57
- data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.ts +4 -57
- data/app/pb_kits/playbook/pb_dashboard/themeTypes.ts +20 -16
- data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.tsx +1 -1
- data/app/pb_kits/playbook/pb_date/_date.tsx +7 -7
- data/app/pb_kits/playbook/pb_date/docs/_date_alignment_swift.md +11 -0
- data/app/pb_kits/playbook/pb_date/docs/_date_default_swift.md +16 -0
- data/app/pb_kits/playbook/pb_date/docs/_date_props_swift.md +8 -0
- data/app/pb_kits/playbook/pb_date/docs/_date_unstyled_swift.md +11 -0
- data/app/pb_kits/playbook/pb_date/docs/_date_variants_swift.md +14 -0
- data/app/pb_kits/playbook/pb_date/docs/example.yml +7 -0
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +4 -1
- data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +3 -0
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +11 -10
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_custom.html.erb +29 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_custom.jsx +34 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_custom.md +7 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_custom_override.html.erb +28 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_custom_override.jsx +34 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_custom_override.md +1 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_react.jsx +2 -2
- data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +4 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_date_picker/plugins/quickPick.tsx +69 -3
- data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.tsx +2 -2
- data/app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.tsx +2 -2
- data/app/pb_kits/playbook/pb_date_stacked/_date_stacked.tsx +8 -8
- data/app/pb_kits/playbook/pb_date_time/_date_time.tsx +2 -2
- data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx +1 -1
- data/app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.tsx +2 -2
- data/app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.test.js +6 -3
- data/app/pb_kits/playbook/pb_detail/_detail.scss +2 -2
- data/app/pb_kits/playbook/pb_detail/_detail.tsx +5 -5
- data/app/pb_kits/playbook/pb_detail/detail.rb +1 -1
- data/app/pb_kits/playbook/pb_detail/detail.test.jsx +2 -2
- data/app/pb_kits/playbook/pb_dialog/_close_icon.tsx +2 -2
- data/app/pb_kits/playbook/pb_dialog/_dialog.tsx +42 -34
- data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_body.tsx +1 -1
- data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_footer.tsx +4 -5
- data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_header.tsx +4 -4
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_default_swift.md +11 -0
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_full_height.jsx +8 -4
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_full_height_placement.jsx +8 -4
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_props_table.md +13 -0
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_scrollable.jsx +4 -2
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_sizes_swift.md +18 -0
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_status.jsx +1 -1
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_status_swift.md +14 -0
- data/app/pb_kits/playbook/pb_dialog/docs/example.yml +7 -0
- data/app/pb_kits/playbook/pb_distribution_bar/_distribution_bar.tsx +5 -5
- data/app/pb_kits/playbook/pb_enhanced_element/element_observer.ts +1 -1
- data/app/pb_kits/playbook/pb_enhanced_element/index.ts +1 -1
- data/app/pb_kits/playbook/pb_file_upload/_file_upload.tsx +1 -1
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.tsx +1 -1
- data/app/pb_kits/playbook/pb_flex/_flex.tsx +1 -1
- data/app/pb_kits/playbook/pb_flex/_flex_item.tsx +1 -1
- data/app/pb_kits/playbook/pb_form_group/_form_group.tsx +1 -1
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.tsx +1 -1
- data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +1 -1
- data/app/pb_kits/playbook/pb_hashtag/_hashtag.tsx +1 -1
- data/app/pb_kits/playbook/pb_highlight/_highlight.tsx +1 -1
- data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.tsx +1 -1
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_default_swift.md +18 -0
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_emphasis_swift.md +34 -0
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_link_swift.md +18 -0
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_modified_swift.md +13 -0
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_props_swift.md +14 -0
- data/app/pb_kits/playbook/pb_home_address_street/docs/example.yml +6 -0
- data/app/pb_kits/playbook/pb_icon/_icon.tsx +1 -1
- data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.tsx +1 -1
- data/app/pb_kits/playbook/pb_icon_stat_value/_icon_stat_value.tsx +1 -1
- data/app/pb_kits/playbook/pb_icon_value/_icon_value.tsx +1 -1
- data/app/pb_kits/playbook/pb_image/_image.tsx +1 -1
- data/app/pb_kits/playbook/pb_label_pill/_label_pill.tsx +1 -1
- data/app/pb_kits/playbook/pb_label_value/_label_value.tsx +1 -1
- data/app/pb_kits/playbook/pb_layout/_layout.tsx +1 -1
- data/app/pb_kits/playbook/pb_legend/_legend.tsx +1 -1
- data/app/pb_kits/playbook/pb_lightbox/Header/_lightbox_header.tsx +1 -1
- data/app/pb_kits/playbook/pb_lightbox/_lightbox.tsx +1 -1
- data/app/pb_kits/playbook/pb_line_graph/_line_graph.tsx +1 -1
- data/app/pb_kits/playbook/pb_list/_list.tsx +1 -1
- data/app/pb_kits/playbook/pb_list/_list_item.tsx +1 -1
- data/app/pb_kits/playbook/pb_loading_inline/_loading_inline.tsx +1 -1
- data/app/pb_kits/playbook/pb_map/_map.tsx +1 -1
- data/app/pb_kits/playbook/pb_message/_message.tsx +1 -1
- data/app/pb_kits/playbook/pb_message/_message_mention.tsx +1 -1
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +1 -1
- data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.tsx +1 -1
- data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.tsx +1 -1
- data/app/pb_kits/playbook/pb_nav/_item.tsx +1 -1
- data/app/pb_kits/playbook/pb_nav/_nav.tsx +1 -1
- data/app/pb_kits/playbook/pb_online_status/_online_status.tsx +1 -1
- data/app/pb_kits/playbook/pb_passphrase/_passphrase.tsx +1 -1
- data/app/pb_kits/playbook/pb_person/_person.tsx +1 -1
- data/app/pb_kits/playbook/pb_person/docs/_person_default_swift.md +8 -0
- data/app/pb_kits/playbook/pb_person/docs/_person_props_swift.md +5 -0
- data/app/pb_kits/playbook/pb_person/docs/example.yml +4 -0
- data/app/pb_kits/playbook/pb_person_contact/_person_contact.tsx +1 -1
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +1 -1
- data/app/pb_kits/playbook/pb_pill/_pill.tsx +1 -1
- data/app/pb_kits/playbook/pb_popover/_popover.tsx +1 -1
- data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.tsx +1 -1
- data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.tsx +1 -1
- data/app/pb_kits/playbook/pb_progress_step/_progress_step.tsx +1 -1
- data/app/pb_kits/playbook/pb_progress_step/_progress_step_item.tsx +1 -1
- data/app/pb_kits/playbook/pb_radio/_radio.tsx +1 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx +1 -1
- data/app/pb_kits/playbook/pb_section_separator/_section_separator.tsx +1 -1
- data/app/pb_kits/playbook/pb_select/_select.tsx +1 -1
- data/app/pb_kits/playbook/pb_select/docs/_select_default_swift.md +15 -0
- data/app/pb_kits/playbook/pb_select/docs/_select_error_swift.md +18 -0
- data/app/pb_kits/playbook/pb_select/docs/_select_props_table.md +8 -0
- data/app/pb_kits/playbook/pb_select/docs/example.yml +5 -0
- data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.tsx +1 -1
- data/app/pb_kits/playbook/pb_selectable_card_icon/_selectable_card_icon.tsx +1 -1
- data/app/pb_kits/playbook/pb_selectable_icon/_selectable_icon.tsx +1 -1
- data/app/pb_kits/playbook/pb_selectable_list/_item.tsx +1 -1
- data/app/pb_kits/playbook/pb_selectable_list/_selectable_list.tsx +1 -1
- data/app/pb_kits/playbook/pb_source/_source.tsx +1 -1
- data/app/pb_kits/playbook/pb_star_rating/_star_rating.scss +105 -53
- data/app/pb_kits/playbook/pb_star_rating/_star_rating.tsx +185 -63
- data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_background_options.html.erb +2 -0
- data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_background_options.jsx +25 -0
- data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_color_options.html.erb +3 -0
- data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_color_options.jsx +31 -0
- data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_default.html.erb +6 -8
- data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_default.jsx +19 -6
- data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_hide.html.erb +4 -1
- data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_hide.jsx +30 -5
- data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_number_config.html.erb +6 -0
- data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_number_config.jsx +58 -0
- data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_size_options.html.erb +16 -0
- data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_size_options.jsx +60 -0
- data/app/pb_kits/playbook/pb_star_rating/docs/example.yml +12 -5
- data/app/pb_kits/playbook/pb_star_rating/docs/index.js +8 -0
- data/app/pb_kits/playbook/pb_star_rating/star_rating.html.erb +54 -26
- data/app/pb_kits/playbook/pb_star_rating/star_rating.rb +86 -6
- data/app/pb_kits/playbook/pb_star_rating/star_rating.test.js +34 -34
- data/app/pb_kits/playbook/pb_star_rating/stars/primary_star.svg +3 -0
- data/app/pb_kits/playbook/pb_star_rating/stars/star_outline.svg +3 -0
- data/app/pb_kits/playbook/pb_star_rating/stars/subtle_dark_star.svg +3 -0
- data/app/pb_kits/playbook/pb_star_rating/stars/subtle_star.svg +3 -0
- data/app/pb_kits/playbook/pb_star_rating/stars/yellow_star.svg +3 -0
- data/app/pb_kits/playbook/pb_stat_change/_stat_change.tsx +1 -1
- data/app/pb_kits/playbook/pb_stat_value/_stat_value.tsx +1 -1
- data/app/pb_kits/playbook/pb_table/_table.tsx +1 -1
- data/app/pb_kits/playbook/pb_table/_table_row.tsx +1 -1
- data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +1 -1
- data/app/pb_kits/playbook/pb_textarea/_textarea.tsx +1 -1
- data/app/pb_kits/playbook/pb_time/_time.tsx +1 -1
- data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.tsx +1 -1
- data/app/pb_kits/playbook/pb_time_stacked/_time_stacked.tsx +1 -1
- data/app/pb_kits/playbook/pb_timeline/_item.tsx +1 -1
- data/app/pb_kits/playbook/pb_timeline/_timeline.tsx +1 -1
- data/app/pb_kits/playbook/pb_timestamp/_timestamp.tsx +1 -1
- data/app/pb_kits/playbook/pb_title/_title.scss +0 -5
- data/app/pb_kits/playbook/pb_title/_title.tsx +2 -5
- data/app/pb_kits/playbook/pb_title/_title_mixin.scss +0 -19
- data/app/pb_kits/playbook/pb_title/title.rb +2 -9
- data/app/pb_kits/playbook/pb_title_count/_title_count.tsx +1 -1
- data/app/pb_kits/playbook/pb_title_detail/_title_detail.tsx +1 -1
- data/app/pb_kits/playbook/pb_toggle/_toggle.tsx +1 -1
- data/app/pb_kits/playbook/pb_tooltip/_tooltip.tsx +1 -1
- data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.tsx +1 -1
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +1 -1
- data/app/pb_kits/playbook/pb_user/_user.tsx +1 -1
- data/app/pb_kits/playbook/pb_user/docs/_user_horizontal_swift.md +37 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_props_table.md +10 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_size_swift.md +35 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_text_only_swift.md +27 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_vertical_size_swift.md +35 -0
- data/app/pb_kits/playbook/pb_user/docs/example.yml +7 -0
- data/app/pb_kits/playbook/pb_user_badge/_user_badge.tsx +1 -1
- data/app/pb_kits/playbook/pb_walkthrough/_walkthrough.tsx +1 -1
- data/app/pb_kits/playbook/pb_weekday_stacked/_weekday_stacked.tsx +1 -1
- data/app/pb_kits/playbook/tokens/exports/exports.d.ts +1 -0
- data/app/pb_kits/playbook/utilities/_truncate.scss +20 -0
- data/app/pb_kits/playbook/utilities/globalProps.ts +13 -2
- data/app/pb_kits/playbook/utilities/props.ts +2 -2
- data/app/pb_kits/playbook/utilities/test/globalProps/truncate.test.js +21 -0
- data/dist/menu.yml +240 -168
- data/dist/playbook-rails.js +6 -6
- data/lib/playbook/classnames.rb +1 -0
- data/lib/playbook/kit_base.rb +2 -0
- data/lib/playbook/truncate.rb +29 -0
- data/lib/playbook/version.rb +2 -2
- metadata +95 -7
@@ -1,31 +1,59 @@
|
|
1
1
|
<%= content_tag(:div,
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
<%
|
7
|
-
|
2
|
+
id: object.id,
|
3
|
+
data: object.data,
|
4
|
+
class: object.classname) do %>
|
5
|
+
<% if layout_option == "number" %>
|
6
|
+
<% case object.size %>
|
7
|
+
<% when "xs", "sm" %>
|
8
|
+
<%= pb_rails("caption", props: { text: object.one_decimal_rating,
|
9
|
+
size: "xs",
|
10
|
+
classname: "pb_star_rating_number_#{size}",
|
11
|
+
dark: dark,
|
12
|
+
padding_right: "xxs" }) %>
|
13
|
+
<% when "md" %>
|
14
|
+
<%= pb_rails("body", props: { text: object.one_decimal_rating,
|
15
|
+
dark: dark,
|
16
|
+
color: "light",
|
17
|
+
classname: "pb_star_rating_number_#{size}",
|
18
|
+
padding_right: "xxs" }) %>
|
19
|
+
<% when "lg" %>
|
20
|
+
<%= pb_rails("title", props: { text: object.one_decimal_rating,
|
21
|
+
size: 2,
|
22
|
+
dark: dark,
|
23
|
+
color: "light",
|
24
|
+
bold: false,
|
25
|
+
classname: "pb_star_rating_number_#{size}",
|
26
|
+
padding_right: "sm" }) %>
|
8
27
|
<% end %>
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
<%= pb_rails("
|
28
|
+
<% end %>
|
29
|
+
<%= pb_rails("flex", props: { }) do %>
|
30
|
+
<% object.star_count.times do %>
|
31
|
+
<%= pb_rails("icon", props: { classname: "#{star_color} pb_star_#{size}" , custom_icon: Playbook::Engine.root.join(star_svg_path) } ) %>
|
32
|
+
<% end %>
|
33
|
+
<% object.empty_stars.times do %>
|
34
|
+
<%= pb_rails("icon", props: { classname: "#{background_star_color} pb_star_#{size}", custom_icon: Playbook::Engine.root.join(background_star_path) } ) %>
|
35
|
+
<% end %>
|
36
|
+
<% end %>
|
37
|
+
<% if layout_option == "onestar" %>
|
38
|
+
<%= content_tag(:div, class: "pb_star_rating_number_#{size}") do %>
|
39
|
+
<% case object.size %>
|
40
|
+
<% when "xs", "sm" %>
|
41
|
+
<%= pb_rails("caption", props: { text: "#{object.rating} of #{object.denominator}",
|
42
|
+
size: "xs",
|
43
|
+
dark: dark,
|
44
|
+
padding_left: "xxs" }) %>
|
45
|
+
<% when "md" %>
|
46
|
+
<%= pb_rails("body", props: { text: "#{object.rating} of #{object.denominator}",
|
47
|
+
dark: dark,
|
48
|
+
color: "light",
|
49
|
+
padding_left: "xxs" }) %>
|
50
|
+
<% when "lg" %>
|
51
|
+
<%= pb_rails("title", props: { text: "#{object.rating} of #{object.denominator}",
|
52
|
+
size: 2,
|
53
|
+
color: "light",
|
54
|
+
bold: false,
|
55
|
+
dark: dark }) %>
|
28
56
|
<% end %>
|
29
|
-
|
30
57
|
<% end %>
|
58
|
+
<% end %>
|
31
59
|
<% end %>
|
@@ -3,18 +3,98 @@
|
|
3
3
|
module Playbook
|
4
4
|
module PbStarRating
|
5
5
|
class StarRating < Playbook::KitBase
|
6
|
-
prop :hide_rating, type: Playbook::Props::Boolean,
|
7
|
-
default: false
|
8
|
-
|
9
6
|
prop :rating, type: Playbook::Props::Numeric,
|
10
7
|
default: 0
|
11
8
|
|
9
|
+
prop :denominator, type: Playbook::Props::Numeric,
|
10
|
+
default: 5
|
11
|
+
|
12
|
+
prop :layout_option, type: Playbook::Props::Enum,
|
13
|
+
values: %w[default onestar number],
|
14
|
+
default: "default"
|
15
|
+
|
16
|
+
prop :color_option, type: Playbook::Props::Enum,
|
17
|
+
values: %w[yellow primary subtle],
|
18
|
+
default: "yellow"
|
19
|
+
|
20
|
+
prop :size, type: Playbook::Props::Enum,
|
21
|
+
values: %w[xs sm md lg],
|
22
|
+
default: "sm"
|
23
|
+
|
24
|
+
prop :background_type, type: Playbook::Props::Enum,
|
25
|
+
values: %w[fill outline],
|
26
|
+
default: "fill"
|
27
|
+
|
28
|
+
def one_decimal_rating
|
29
|
+
rating.to_f.round(1)
|
30
|
+
end
|
31
|
+
|
12
32
|
def star_count
|
13
|
-
rating.
|
33
|
+
rating.round > denominator_style ? denominator_style : rating.round
|
34
|
+
end
|
35
|
+
|
36
|
+
def denominator_style
|
37
|
+
layout_option == "onestar" ? 1 : denominator
|
38
|
+
end
|
39
|
+
|
40
|
+
def empty_stars
|
41
|
+
(denominator_style - star_count).negative? ? 0 : denominator_style - star_count
|
42
|
+
end
|
43
|
+
|
44
|
+
def star_color
|
45
|
+
case color_option
|
46
|
+
when "yellow"
|
47
|
+
"yellow_star"
|
48
|
+
when "primary"
|
49
|
+
"primary_star"
|
50
|
+
when "subtle"
|
51
|
+
dark ? "suble_star_dark" : "suble_star_light"
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
def background_star_color
|
56
|
+
if background_type === "outline"
|
57
|
+
dark ? "outline_empty_star_dark" : "outline_empty_star_light"
|
58
|
+
else
|
59
|
+
dark ? "empty_star_dark" : "empty_star_light"
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
def svg_size
|
64
|
+
sizes = { "xs": "pb_star_xs",
|
65
|
+
"sm": "pb_star_sm",
|
66
|
+
"md": "pb_star_md",
|
67
|
+
"lg": "pb_star_lg" }
|
68
|
+
sizes[size.to_sym]
|
69
|
+
end
|
70
|
+
|
71
|
+
def svg_class
|
72
|
+
"pb_star_#{size}"
|
73
|
+
end
|
74
|
+
|
75
|
+
def background_star_path
|
76
|
+
if background_type === "outline"
|
77
|
+
"app/pb_kits/playbook/pb_star_rating/stars/star_outline.svg"
|
78
|
+
else
|
79
|
+
"app/pb_kits/playbook/pb_star_rating/stars/yellow_star.svg"
|
80
|
+
end
|
14
81
|
end
|
15
82
|
|
16
|
-
def
|
17
|
-
|
83
|
+
def star_svg_path
|
84
|
+
case color_option
|
85
|
+
when "yellow"
|
86
|
+
"app/pb_kits/playbook/pb_star_rating/stars/yellow_star.svg"
|
87
|
+
when "primary"
|
88
|
+
"app/pb_kits/playbook/pb_star_rating/stars/primary_star.svg"
|
89
|
+
when "subtle"
|
90
|
+
if dark == true
|
91
|
+
"app/pb_kits/playbook/pb_star_rating/stars/subtle_dark_star.svg"
|
92
|
+
else
|
93
|
+
"app/pb_kits/playbook/pb_star_rating/stars/subtle_star.svg"
|
94
|
+
end
|
95
|
+
else
|
96
|
+
"app/pb_kits/playbook/pb_star_rating/stars/primary_star.svg"
|
97
|
+
end
|
18
98
|
end
|
19
99
|
|
20
100
|
def classname
|
@@ -1,24 +1,22 @@
|
|
1
|
-
import React from "react"
|
2
|
-
import { render, screen } from "../utilities/test-utils"
|
1
|
+
import React from "react"
|
2
|
+
import { render, screen } from "../utilities/test-utils"
|
3
3
|
|
4
|
-
import StarRating from "./_star_rating"
|
4
|
+
import StarRating from "./_star_rating"
|
5
5
|
|
6
|
-
const testId = "star-rating-kit"
|
6
|
+
const testId = "star-rating-kit"
|
7
7
|
|
8
8
|
describe("Star Rating Kit", () => {
|
9
9
|
test("Expects to have correct classname", () => {
|
10
10
|
render(
|
11
11
|
<StarRating
|
12
12
|
data={{ testid: testId }}
|
13
|
-
rating={2}
|
14
13
|
/>
|
15
|
-
)
|
16
|
-
|
14
|
+
)
|
17
15
|
|
18
|
-
const kit = screen.getByTestId(testId)
|
19
|
-
expect(kit).
|
16
|
+
const kit = screen.getByTestId(testId)
|
17
|
+
expect(kit.className).toBe("pb_star_rating_kit")
|
20
18
|
|
21
|
-
})
|
19
|
+
})
|
22
20
|
|
23
21
|
test('should render aria-label', () => {
|
24
22
|
render(
|
@@ -27,45 +25,47 @@ describe("Star Rating Kit", () => {
|
|
27
25
|
data={{ testid: testId }}
|
28
26
|
rating={2}
|
29
27
|
/>
|
30
|
-
)
|
28
|
+
)
|
31
29
|
|
32
30
|
const kit = screen.getByTestId(testId)
|
33
31
|
expect(kit).toHaveAttribute('aria-label', testId)
|
34
|
-
})
|
32
|
+
})
|
35
33
|
|
36
|
-
test("Displays
|
34
|
+
test("Displays correct denominator", () => {
|
37
35
|
render(
|
38
36
|
<StarRating
|
39
37
|
data={{ testid: testId }}
|
38
|
+
denominator={4}
|
40
39
|
rating={2}
|
40
|
+
size="xs"
|
41
41
|
/>
|
42
|
-
)
|
43
|
-
|
42
|
+
)
|
44
43
|
|
45
|
-
const kit = screen.getByTestId(testId)
|
46
|
-
const highlight = kit.querySelector(".
|
47
|
-
const stars = highlight.querySelectorAll(".
|
48
|
-
const count = stars.length
|
44
|
+
const kit = screen.getByTestId(testId)
|
45
|
+
const highlight = kit.querySelector(".star_flex_area")
|
46
|
+
const stars = highlight.querySelectorAll(".pb_star_xs")
|
47
|
+
const count = stars.length
|
49
48
|
|
50
|
-
expect(count).toBe(
|
51
|
-
})
|
49
|
+
expect(count).toBe(4)
|
50
|
+
})
|
52
51
|
|
53
|
-
test("
|
52
|
+
test("Uses correct size", () => {
|
54
53
|
render(
|
55
54
|
<StarRating
|
56
55
|
data={{ testid: testId }}
|
57
|
-
|
56
|
+
layoutOption="number"
|
57
|
+
rating={2}
|
58
|
+
size="lg"
|
58
59
|
/>
|
59
|
-
)
|
60
|
+
)
|
60
61
|
|
61
|
-
const kit = screen.getByTestId(testId)
|
62
|
-
const highlight = kit.querySelector(".
|
63
|
-
const
|
64
|
-
const
|
65
|
-
const
|
66
|
-
const halfStarCount = halfStars.length;
|
62
|
+
const kit = screen.getByTestId(testId)
|
63
|
+
const highlight = kit.querySelector(".star_flex_area")
|
64
|
+
const title = kit.querySelector(".pb_star_rating_number_lg")
|
65
|
+
const stars = highlight.querySelectorAll(".pb_star_lg")
|
66
|
+
const count = stars.length
|
67
67
|
|
68
|
-
expect(
|
69
|
-
expect(
|
70
|
-
})
|
71
|
-
})
|
68
|
+
expect(title.className).toBe("pb_title_kit_size_2_light_thin pr_sm pb_star_rating_number_lg")
|
69
|
+
expect(count).toBe(5)
|
70
|
+
})
|
71
|
+
})
|
@@ -0,0 +1,3 @@
|
|
1
|
+
<svg viewBox="0 0 18 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
+
<path fillRule="evenodd" clipRule="evenodd" d="M9.86015 0.4371C9.73527 0.187329 9.4855 0 9.17328 0C8.89229 0 8.64252 0.187329 8.51763 0.4371L6.36335 4.83932L1.58647 5.55742C1.30547 5.58864 1.08692 5.80719 0.99326 6.05696C0.899595 6.33795 0.962038 6.61895 1.18059 6.8375L4.64617 10.2719L3.80319 15.1112C3.77197 15.3922 3.89685 15.7044 4.11541 15.8605C4.36518 16.0166 4.64617 16.0478 4.89594 15.9229L9.17328 13.6126L13.4506 15.9229C13.7004 16.0478 14.0126 16.0166 14.2624 15.8605C14.4809 15.7044 14.6058 15.3922 14.5434 15.1112L13.7316 10.2719L17.1972 6.8375C17.4157 6.61895 17.4782 6.33795 17.3845 6.05696C17.2909 5.80719 17.0723 5.58864 16.7913 5.55742L12.0144 4.83932L9.86015 0.4371Z" fill="#0056CF"/>
|
3
|
+
</svg>
|
@@ -0,0 +1,3 @@
|
|
1
|
+
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
+
<path d="M5.91323 5.33377L6.17269 5.29477L6.28801 5.0591L8.44116 0.659187C8.49971 0.543364 8.59517 0.5 8.64884 0.5C8.74499 0.5 8.83506 0.555009 8.88775 0.659235L11.0409 5.0591L11.1562 5.29477L11.4157 5.33377L16.1925 6.05186L16.2021 6.0533L16.2117 6.05436C16.2359 6.05706 16.2671 6.06847 16.3024 6.09973C16.3374 6.13062 16.3686 6.17476 16.3886 6.22412C16.4186 6.32162 16.401 6.40181 16.3198 6.48332C16.3196 6.48353 16.3194 6.48374 16.3192 6.48395L12.8552 9.91671L12.6712 10.0991L12.7141 10.3546L13.5258 15.1939L13.528 15.2068L13.5308 15.2196C13.5488 15.3004 13.5074 15.402 13.4567 15.4462C13.3391 15.5132 13.2227 15.5096 13.1546 15.4781L8.88646 13.1726L8.64884 13.0443L8.41121 13.1726L4.14274 15.4782C4.07877 15.5083 3.99031 15.5147 3.87267 15.4466C3.82302 15.4033 3.76655 15.2914 3.77463 15.1781L4.61431 10.3577L4.65911 10.1005L4.47368 9.91671L1.0097 6.48394C1.00947 6.48372 1.00925 6.4835 1.00903 6.48327C0.927878 6.40178 0.91031 6.3216 0.94026 6.22412C0.960274 6.17476 0.99154 6.13062 1.02646 6.09973C1.0618 6.06847 1.09296 6.05706 1.11724 6.05436L1.12682 6.0533L1.13635 6.05186L5.91323 5.33377Z" stroke="#C1CDD6"/>
|
3
|
+
</svg>
|
@@ -0,0 +1,3 @@
|
|
1
|
+
<svg viewBox="0 0 18 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
+
<path class="" fillRule="evenodd" clipRule="evenodd" d="M9.86015 0.4371C9.73527 0.187329 9.4855 0 9.17328 0C8.89229 0 8.64252 0.187329 8.51763 0.4371L6.36335 4.83932L1.58647 5.55742C1.30547 5.58864 1.08692 5.80719 0.99326 6.05696C0.899595 6.33795 0.962038 6.61895 1.18059 6.8375L4.64617 10.2719L3.80319 15.1112C3.77197 15.3922 3.89685 15.7044 4.11541 15.8605C4.36518 16.0166 4.64617 16.0478 4.89594 15.9229L9.17328 13.6126L13.4506 15.9229C13.7004 16.0478 14.0126 16.0166 14.2624 15.8605C14.4809 15.7044 14.6058 15.3922 14.5434 15.1112L13.7316 10.2719L17.1972 6.8375C17.4157 6.61895 17.4782 6.33795 17.3845 6.05696C17.2909 5.80719 17.0723 5.58864 16.7913 5.55742L12.0144 4.83932L9.86015 0.4371Z" fill="#F9BB00"/>
|
3
|
+
</svg>
|
@@ -0,0 +1,3 @@
|
|
1
|
+
<svg viewBox="0 0 18 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
+
<path fillRule="evenodd" clipRule="evenodd" d="M9.86015 0.4371C9.73527 0.187329 9.4855 0 9.17328 0C8.89229 0 8.64252 0.187329 8.51763 0.4371L6.36335 4.83932L1.58647 5.55742C1.30547 5.58864 1.08692 5.80719 0.99326 6.05696C0.899595 6.33795 0.962038 6.61895 1.18059 6.8375L4.64617 10.2719L3.80319 15.1112C3.77197 15.3922 3.89685 15.7044 4.11541 15.8605C4.36518 16.0166 4.64617 16.0478 4.89594 15.9229L9.17328 13.6126L13.4506 15.9229C13.7004 16.0478 14.0126 16.0166 14.2624 15.8605C14.4809 15.7044 14.6058 15.3922 14.5434 15.1112L13.7316 10.2719L17.1972 6.8375C17.4157 6.61895 17.4782 6.33795 17.3845 6.05696C17.2909 5.80719 17.0723 5.58864 16.7913 5.55742L12.0144 4.83932L9.86015 0.4371Z" fill="#F9BB00"/>
|
3
|
+
</svg>
|
@@ -0,0 +1,3 @@
|
|
1
|
+
<svg viewBox="0 0 18 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
+
<path fillRule="evenodd" clipRule="evenodd" d="M9.86015 0.4371C9.73527 0.187329 9.4855 0 9.17328 0C8.89229 0 8.64252 0.187329 8.51763 0.4371L6.36335 4.83932L1.58647 5.55742C1.30547 5.58864 1.08692 5.80719 0.99326 6.05696C0.899595 6.33795 0.962038 6.61895 1.18059 6.8375L4.64617 10.2719L3.80319 15.1112C3.77197 15.3922 3.89685 15.7044 4.11541 15.8605C4.36518 16.0166 4.64617 16.0478 4.89594 15.9229L9.17328 13.6126L13.4506 15.9229C13.7004 16.0478 14.0126 16.0166 14.2624 15.8605C14.4809 15.7044 14.6058 15.3922 14.5434 15.1112L13.7316 10.2719L17.1972 6.8375C17.4157 6.61895 17.4782 6.33795 17.3845 6.05696C17.2909 5.80719 17.0723 5.58864 16.7913 5.55742L12.0144 4.83932L9.86015 0.4371Z" />
|
3
|
+
</svg>
|
@@ -22,7 +22,7 @@ type StatChangeProps = {
|
|
22
22
|
change?: 'increase' | 'decrease' | 'neutral',
|
23
23
|
className?: string,
|
24
24
|
icon?: string,
|
25
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
25
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
26
26
|
id?: string,
|
27
27
|
value?: string | number,
|
28
28
|
}
|
@@ -7,7 +7,7 @@ import Title from '../pb_title/_title'
|
|
7
7
|
|
8
8
|
type StatValueProps = {
|
9
9
|
className?: string,
|
10
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
10
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
11
11
|
id?: string,
|
12
12
|
unit?: string,
|
13
13
|
value: string | number,
|
@@ -14,7 +14,7 @@ type TableProps = {
|
|
14
14
|
data?: { [key: string]: string },
|
15
15
|
dataTable: boolean,
|
16
16
|
disableHover: boolean,
|
17
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
17
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
18
18
|
id?: string,
|
19
19
|
responsive: "collapse" | "scroll" | "none",
|
20
20
|
singleLine: boolean,
|
@@ -8,7 +8,7 @@ type TableRowPropTypes = {
|
|
8
8
|
children: React.ReactNode[] | React.ReactNode,
|
9
9
|
className: string,
|
10
10
|
data?: { [key: string]: string },
|
11
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
11
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
12
12
|
id?: string,
|
13
13
|
sideHighlightColor: string,
|
14
14
|
}
|
@@ -17,7 +17,7 @@ type TextInputProps = {
|
|
17
17
|
dark?: boolean,
|
18
18
|
disabled?: boolean,
|
19
19
|
error?: string,
|
20
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
20
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
21
21
|
id?: string,
|
22
22
|
inline?: boolean,
|
23
23
|
name: string,
|
@@ -22,7 +22,7 @@ type TextareaProps = {
|
|
22
22
|
data?: {[key: string]: string},
|
23
23
|
disabled?: boolean,
|
24
24
|
error?: string,
|
25
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
25
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
26
26
|
id?: string,
|
27
27
|
inline?: boolean,
|
28
28
|
object?: string,
|
@@ -16,7 +16,7 @@ type TimeProps = {
|
|
16
16
|
date: Date;
|
17
17
|
dark?: boolean;
|
18
18
|
id?: string;
|
19
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
19
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
20
20
|
showIcon?: boolean;
|
21
21
|
size?: "md" | "sm";
|
22
22
|
showTimezone?: boolean;
|
@@ -12,7 +12,7 @@ import Icon from '../pb_icon/_icon'
|
|
12
12
|
type TimeRangeInlineProps = {
|
13
13
|
aria?: { [key: string]: string },
|
14
14
|
className?: string,
|
15
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
15
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
16
16
|
id?: string,
|
17
17
|
data?: { [key: string]: string },
|
18
18
|
alignment?: "left" | "center" | "vertical",
|
@@ -14,7 +14,7 @@ type TimeStackedProps = {
|
|
14
14
|
dark?: boolean,
|
15
15
|
data?: { [key: string]: string },
|
16
16
|
date?: Date,
|
17
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
17
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
18
18
|
id?: string,
|
19
19
|
time?: number | Date,
|
20
20
|
timeZone?: string,
|
@@ -10,7 +10,7 @@ type ItemProps = {
|
|
10
10
|
className?: string,
|
11
11
|
children?: React.ReactNode[] | React.ReactNode,
|
12
12
|
date?: Date,
|
13
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
13
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
14
14
|
icon?: string,
|
15
15
|
iconColor?: 'default' | 'royal' | 'blue' | 'purple' | 'teal' | 'red' | 'yellow' | 'green',
|
16
16
|
lineStyle?: 'solid' | 'dotted',
|
@@ -10,7 +10,7 @@ type TimelineProps = {
|
|
10
10
|
children?: React.ReactChild[] | React.ReactChild,
|
11
11
|
className?: string,
|
12
12
|
data?: { [key: string]: string },
|
13
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
13
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
14
14
|
id?: string,
|
15
15
|
orientation?: string,
|
16
16
|
showDate?: boolean,
|
@@ -16,7 +16,7 @@ type TimestampProps = {
|
|
16
16
|
text: string,
|
17
17
|
timestamp: Date | string,
|
18
18
|
timezone: string,
|
19
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
19
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
20
20
|
id?: string,
|
21
21
|
showDate?: boolean,
|
22
22
|
showUser?: boolean,
|
@@ -31,10 +31,6 @@
|
|
31
31
|
@include pb_title_thin;
|
32
32
|
}
|
33
33
|
|
34
|
-
&[class*=_truncate] {
|
35
|
-
@include title_truncate;
|
36
|
-
}
|
37
|
-
|
38
34
|
@each $size, $size_value in $breakpoints_grid {
|
39
35
|
@for $title_size_value from 1 through 4 {
|
40
36
|
$min_size: map-get($size_value, "min");
|
@@ -46,7 +42,6 @@
|
|
46
42
|
@else if $title_size_value == 3 { @include pb_title_3; }
|
47
43
|
@else if $title_size_value == 4 { @include pb_title_4; }
|
48
44
|
@include title_colors;
|
49
|
-
@include title_truncate;
|
50
45
|
@if $title_size_value != 4 { @include pb_title_bold; }
|
51
46
|
}
|
52
47
|
}
|
@@ -13,12 +13,11 @@ type TitleProps = {
|
|
13
13
|
className?: string,
|
14
14
|
color?: "default" | "light" | "lighter" | "success" | "error" | "link",
|
15
15
|
data?: {[key: string]: string},
|
16
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
16
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
17
17
|
id?: string,
|
18
18
|
size?: SizeType | SizeResponsiveType,
|
19
19
|
tag?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "div" | "span",
|
20
20
|
text?: string,
|
21
|
-
truncate?: null | "1" | "2" | "3" | "4" | "5",
|
22
21
|
variant?: null | "link",
|
23
22
|
} & GlobalProps
|
24
23
|
|
@@ -36,7 +35,6 @@ const Title = (props: TitleProps): React.ReactElement => {
|
|
36
35
|
bold = true,
|
37
36
|
tag = 'h3',
|
38
37
|
text,
|
39
|
-
truncate = null,
|
40
38
|
variant = null,
|
41
39
|
} = props
|
42
40
|
|
@@ -44,7 +42,6 @@ const Title = (props: TitleProps): React.ReactElement => {
|
|
44
42
|
const dataProps: {[key: string]: string | number} = buildDataProps(data)
|
45
43
|
const htmlProps = buildHtmlProps(htmlOptions)
|
46
44
|
const getBold = bold ? '' : 'thin'
|
47
|
-
const isTruncated = truncate ? `truncate-${truncate}` : null
|
48
45
|
const isSizeNumberOrString = typeof size === "number" || typeof size === "string"
|
49
46
|
|
50
47
|
const buildResponsiveSizeCss = () => {
|
@@ -60,7 +57,7 @@ const Title = (props: TitleProps): React.ReactElement => {
|
|
60
57
|
}
|
61
58
|
|
62
59
|
const classes = classnames(
|
63
|
-
buildCss('pb_title_kit', isSizeNumberOrString ? `size_${size}` : "", variant, color, getBold
|
60
|
+
buildCss('pb_title_kit', isSizeNumberOrString ? `size_${size}` : "", variant, color, getBold),
|
64
61
|
globalProps(props),
|
65
62
|
buildResponsiveSizeCss(),
|
66
63
|
className
|
@@ -16,22 +16,3 @@ $pb_title_colors: (
|
|
16
16
|
}
|
17
17
|
}
|
18
18
|
}
|
19
|
-
|
20
|
-
$pb_title_truncate: (
|
21
|
-
truncate-1: 1,
|
22
|
-
truncate-2: 2,
|
23
|
-
truncate-3: 3,
|
24
|
-
truncate-4: 4,
|
25
|
-
truncate-5: 5
|
26
|
-
);
|
27
|
-
|
28
|
-
@mixin title_truncate {
|
29
|
-
@each $name, $number in $pb_title_truncate {
|
30
|
-
&[class*=_#{$name}] {
|
31
|
-
overflow: hidden;
|
32
|
-
display: -webkit-box;
|
33
|
-
-webkit-line-clamp: $number;
|
34
|
-
-webkit-box-orient: vertical;
|
35
|
-
}
|
36
|
-
}
|
37
|
-
}
|
@@ -16,15 +16,12 @@ module Playbook
|
|
16
16
|
default: nil,
|
17
17
|
deprecated: true
|
18
18
|
prop :bold, type: Playbook::Props::Boolean, default: true
|
19
|
-
prop :truncate, type: Playbook::Props::Enum,
|
20
|
-
values: [nil, "1", "2", "3", "4", "5"],
|
21
|
-
default: nil
|
22
19
|
|
23
20
|
def classname
|
24
21
|
if is_size_responsive
|
25
|
-
generate_classname("pb_title_kit", variant, color, is_bold
|
22
|
+
generate_classname("pb_title_kit", variant, color, is_bold) + generate_responsive_size_classname
|
26
23
|
else
|
27
|
-
generate_classname("pb_title_kit", size, variant, color, is_bold
|
24
|
+
generate_classname("pb_title_kit", size, variant, color, is_bold)
|
28
25
|
end
|
29
26
|
end
|
30
27
|
|
@@ -32,10 +29,6 @@ module Playbook
|
|
32
29
|
bold ? nil : "thin"
|
33
30
|
end
|
34
31
|
|
35
|
-
def is_truncated
|
36
|
-
truncate ? "truncate-#{truncate}" : nil
|
37
|
-
end
|
38
|
-
|
39
32
|
def is_size_responsive
|
40
33
|
try(:size).is_a?(::Hash)
|
41
34
|
end
|
@@ -16,7 +16,7 @@ type TitleCountProps = {
|
|
16
16
|
count?: number,
|
17
17
|
dark?: boolean,
|
18
18
|
data?: { [key: string]: string },
|
19
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
19
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
20
20
|
id?: string,
|
21
21
|
title?: string,
|
22
22
|
size?: "lg" | "sm",
|
@@ -13,7 +13,7 @@ type TitleDetailProps = {
|
|
13
13
|
className?: string,
|
14
14
|
data?: { [key: string]: string },
|
15
15
|
detail: string,
|
16
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
16
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
17
17
|
id?: string,
|
18
18
|
title: string,
|
19
19
|
} & GlobalProps
|
@@ -17,7 +17,7 @@ type Props = {
|
|
17
17
|
children?: React.ReactNode | React.ReactNode[],
|
18
18
|
className?: string,
|
19
19
|
data?: { [key: string]: string },
|
20
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
20
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
21
21
|
id?: string,
|
22
22
|
name?: string,
|
23
23
|
onChange?: InputCallback<HTMLInputElement>,
|
@@ -23,7 +23,7 @@ type TooltipProps = {
|
|
23
23
|
children: JSX.Element,
|
24
24
|
data?: { [key: string]: string },
|
25
25
|
delay?: number | Partial<{open: number; close: number}>,
|
26
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
26
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
27
27
|
icon?: string,
|
28
28
|
interaction?: boolean,
|
29
29
|
placement?: Placement,
|
@@ -25,7 +25,7 @@ type TreemapChartProps = {
|
|
25
25
|
drillable: boolean;
|
26
26
|
grouped: boolean;
|
27
27
|
height?: string;
|
28
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
28
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
29
29
|
id: number | string;
|
30
30
|
title?: string;
|
31
31
|
tooltipHtml: string;
|
@@ -34,7 +34,7 @@ type TypeaheadProps = {
|
|
34
34
|
dark?: boolean,
|
35
35
|
data?: { [key: string]: string },
|
36
36
|
error?: string,
|
37
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
37
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
38
38
|
id?: string,
|
39
39
|
label?: string,
|
40
40
|
loadOptions?: string | Noop,
|
@@ -16,7 +16,7 @@ type UserProps = {
|
|
16
16
|
className?: string,
|
17
17
|
dark?: boolean,
|
18
18
|
data?: {[key: string]: string},
|
19
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
19
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
20
20
|
id?: string,
|
21
21
|
name?: string,
|
22
22
|
orientation?: "horizontal" | "vertical",
|