playbook_ui 13.27.0.pre.alpha.PLAY1342DRYcontenttagRailssimplekits2896 → 13.27.0.pre.alpha.PLAY11782916

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.html.erb +5 -1
  3. data/app/pb_kits/playbook/pb_advanced_table/table_body.html.erb +5 -1
  4. data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +5 -1
  5. data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +5 -1
  6. data/app/pb_kits/playbook/pb_avatar_action_button/avatar_action_button.html.erb +6 -1
  7. data/app/pb_kits/playbook/pb_badge/badge.html.erb +6 -1
  8. data/app/pb_kits/playbook/pb_button_toolbar/button_toolbar.html.erb +6 -1
  9. data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.html.erb +6 -1
  10. data/app/pb_kits/playbook/pb_collapsible/collapsible.html.erb +6 -1
  11. data/app/pb_kits/playbook/pb_collapsible/collapsible_content.html.erb +6 -1
  12. data/app/pb_kits/playbook/pb_collapsible/collapsible_main.html.erb +6 -1
  13. data/app/pb_kits/playbook/pb_contact/contact.html.erb +6 -1
  14. data/app/pb_kits/playbook/pb_currency/currency.html.erb +6 -1
  15. data/app/pb_kits/playbook/pb_dashboard_value/dashboard_value.html.erb +6 -1
  16. data/app/pb_kits/playbook/pb_date/date.html.erb +6 -1
  17. data/app/pb_kits/playbook/pb_date_range_inline/date_range_inline.html.erb +5 -1
  18. data/app/pb_kits/playbook/pb_date_range_stacked/date_range_stacked.html.erb +5 -1
  19. data/app/pb_kits/playbook/pb_date_stacked/date_stacked.html.erb +5 -1
  20. data/app/pb_kits/playbook/pb_date_time/date_time.html.erb +6 -1
  21. data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.html.erb +6 -1
  22. data/app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.html.erb +5 -1
  23. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default.md +1 -1
  24. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subcomponent_structure.md +5 -6
  25. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subcomponent_structure_rails.md +6 -0
  26. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display.md +3 -3
  27. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display_rails.md +5 -0
  28. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_options.md +1 -1
  29. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_options_rails.md +1 -0
  30. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_padding.md +1 -1
  31. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_trigger.md +1 -1
  32. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_trigger_rails.md +1 -0
  33. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_label.md +1 -1
  34. data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +6 -6
  35. data/app/pb_kits/playbook/pb_dropdown/dropdown_option.rb +1 -1
  36. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.html.erb +6 -1
  37. data/app/pb_kits/playbook/pb_icon/_icon.tsx +1 -1
  38. data/app/pb_kits/playbook/pb_icon_circle/icon_circle.html.erb +6 -1
  39. data/app/pb_kits/playbook/pb_icon_stat_value/icon_stat_value.html.erb +6 -1
  40. data/app/pb_kits/playbook/pb_icon_value/icon_value.html.erb +6 -1
  41. data/app/pb_kits/playbook/pb_label_pill/label_pill.html.erb +6 -1
  42. data/app/pb_kits/playbook/pb_label_value/label_value.html.erb +6 -1
  43. data/app/pb_kits/playbook/pb_loading_inline/loading_inline.html.erb +5 -1
  44. data/app/pb_kits/playbook/pb_message/message_mention.html.erb +6 -6
  45. data/app/pb_kits/playbook/pb_multiple_users/multiple_users.html.erb +6 -1
  46. data/app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.html.erb +6 -1
  47. data/app/pb_kits/playbook/pb_pagination/pagination.html.erb +6 -1
  48. data/app/pb_kits/playbook/pb_person/person.html.erb +6 -1
  49. data/app/pb_kits/playbook/pb_person_contact/person_contact.html.erb +6 -1
  50. data/app/pb_kits/playbook/pb_pill/pill.html.erb +6 -1
  51. data/app/pb_kits/playbook/pb_section_separator/section_separator.html.erb +6 -1
  52. data/app/pb_kits/playbook/pb_select/_select.tsx +13 -1
  53. data/app/pb_kits/playbook/pb_source/source.html.erb +5 -1
  54. data/app/pb_kits/playbook/pb_stat_change/stat_change.html.erb +5 -1
  55. data/app/pb_kits/playbook/pb_stat_value/stat_value.html.erb +5 -1
  56. data/app/pb_kits/playbook/pb_time_range_inline/time_range_inline.html.erb +5 -1
  57. data/app/pb_kits/playbook/pb_time_stacked/time_stacked.html.erb +5 -1
  58. data/app/pb_kits/playbook/pb_timeline/item.html.erb +5 -1
  59. data/app/pb_kits/playbook/pb_timeline/timeline.html.erb +5 -1
  60. data/app/pb_kits/playbook/pb_timestamp/timestamp.html.erb +6 -1
  61. data/app/pb_kits/playbook/pb_title_count/title_count.html.erb +6 -1
  62. data/app/pb_kits/playbook/pb_title_detail/title_detail.html.erb +5 -1
  63. data/app/pb_kits/playbook/pb_weekday_stacked/weekday_stacked.html.erb +6 -1
  64. data/dist/menu.yml +2 -2
  65. data/lib/playbook/kit_base.rb +1 -1
  66. data/lib/playbook/version.rb +1 -1
  67. metadata +10 -6
  68. /data/app/pb_kits/playbook/pb_dropdown/docs/{_dropdown_subcomponent_structure.html.erb → _dropdown_subcomponent_structure_rails.html.erb} +0 -0
  69. /data/app/pb_kits/playbook/pb_dropdown/docs/{_dropdown_with_custom_display.html.erb → _dropdown_with_custom_display_rails.html.erb} +0 -0
  70. /data/app/pb_kits/playbook/pb_dropdown/docs/{_dropdown_with_custom_options.html.erb → _dropdown_with_custom_options_rails.html.erb} +0 -0
  71. /data/app/pb_kits/playbook/pb_dropdown/docs/{_dropdown_with_custom_trigger.html.erb → _dropdown_with_custom_trigger_rails.html.erb} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 86010ce79177c236d7f8407fa85ab4204e2b1828a406d3be849f8015d83bc473
4
- data.tar.gz: eb445cf16692e00d7969def69849d916bd7fba5a2106aa1f987dc3114f9146eb
3
+ metadata.gz: 2ab90f7ab88ce3c08dab648348d07d1d0d7d3371e0505fba524e33a7b1b0ab63
4
+ data.tar.gz: 6a1e8caa7ed0789d8ea721a2bed9e5607dfd79eef8c69630c685ef92bc871431
5
5
  SHA512:
6
- metadata.gz: 1e8b4eff3ba718fe73cc04f6dcf5f072f47d5d3fab4e408de793bcd4ad62542ddc7de30044be5a31a4b54a21af8b6de366f51384762eaf87c98ba327227811c7
7
- data.tar.gz: 8aee0c92d46a1c6c885beb73a791beeac13449d7b8dbbf70f15dcadbeea8f3e0f384268270769906078606a92ae0411079c55dd694952e48024b35332e752876
6
+ metadata.gz: 0256e512d2e19f5f8dbec2e12b36221df30d57a53b11f4fd6f07c67d7a1dc9c32dd3758f7f8a3f8d871fe7de064148ec0b084c3899bd3720cf68683e539c335f
7
+ data.tar.gz: 60e3ef6787a0a5fe6508845dbac95c077d68421b9b9df186084f739fbfbf7b57e0ea94b6e144750e67f9ddca48031468541a6558fce0c3f5d8c6b912f2d88d9f
@@ -1,4 +1,8 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ aria: object.aria,
3
+ class: object.classname,
4
+ data: object.data,
5
+ id: object.id) do %>
2
6
  <%= pb_rails("table", props: { size: "sm", tag:"div", data_table: true, number_spacing:"tabular", responsive:"none" }) do %>
3
7
  <% if content.present? %>
4
8
  <% content.presence %>
@@ -1,4 +1,8 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ aria: object.aria,
3
+ class: object.classname,
4
+ data: object.data,
5
+ id: object.id) do %>
2
6
  <% object.table_data.each do |row| %>
3
7
  <%= render_row_and_children(row, object.column_definitions) %>
4
8
  <% end %>
@@ -1,4 +1,8 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ aria: object.aria,
3
+ class: object.classname,
4
+ data: object.data,
5
+ id: object.id) do %>
2
6
  <%= pb_rails("table/table_row", props: {tag:"div"}) do %>
3
7
  <% object.column_definitions.each_with_index do |item, index| %>
4
8
  <%= pb_rails("table/table_header", props: { tag:"div", id:item[:accessor], classname:object.th_classname}) do %>
@@ -1,4 +1,8 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ aria: object.aria,
3
+ class: object.classname,
4
+ data: object.data,
5
+ id: object.id) do %>
2
6
  <% object.column_definitions.each_with_index do |column, index| %>
3
7
  <%= pb_rails("table/table_cell", props: { tag:"div", classname:object.td_classname}) do %>
4
8
  <%= pb_rails("flex", props:{ align: "center", justify: index.zero? ? "start" : "end" }) do %>
@@ -1,4 +1,9 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ aria: object.aria,
3
+ id: object.id,
4
+ data: object.data,
5
+ class: object.classname,
6
+ **combined_html_options) do %>
2
7
  <% if object.tooltip_text.present? %>
3
8
  <%= pb_rails("tooltip", props: {
4
9
  trigger_element_id: object.tooltip_id,
@@ -1,3 +1,8 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ aria: object.aria,
3
+ id: object.id,
4
+ data: object.data,
5
+ class: object.classname,
6
+ **combined_html_options) do %>
2
7
  <span><%= object.text %></span>
3
8
  <% end %>
@@ -1,3 +1,8 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ aria: object.aria,
3
+ class: object.classname,
4
+ data: object.data,
5
+ id: object.id,
6
+ **combined_html_options) do %>
2
7
  <%= content.presence || object.text %>
3
8
  <% end %>
@@ -1,4 +1,9 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ aria: object.aria,
3
+ id: object.id,
4
+ data: object.data,
5
+ class: object.classname,
6
+ **combined_html_options) do %>
2
7
  <%= pb_rails("button", props: {type: object.type, link: object.link, new_window:object.new_window, variant: object.variant, disabled: object.disabled, dark: object.dark}) do %>
3
8
  <%= pb_rails("icon", props: {icon: object.icon, fixed_width: true, dark: object.dark}) %>
4
9
  <% end %>
@@ -1,3 +1,8 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ aria: object.aria,
3
+ class: object.classname,
4
+ data: object.data,
5
+ id: object.id,
6
+ **combined_html_options) do %>
2
7
  <%= content.presence %>
3
8
  <% end %>
@@ -1,3 +1,8 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ id: object.id,
3
+ data: object.data,
4
+ class: object.classname,
5
+ aria: object.aria,
6
+ **combined_html_options) do %>
2
7
  <%= content.presence %>
3
8
  <% end %>
@@ -1,4 +1,9 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ id: object.id,
3
+ data: object.data,
4
+ class: object.classname,
5
+ aria: object.aria,
6
+ **combined_html_options) do %>
2
7
 
3
8
  <%= pb_rails("flex", props: {vertical: "center", spacing: "between", cursor: "pointer"}) do %>
4
9
  <%= pb_rails("flex/flex_item") do %>
@@ -1,4 +1,9 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ aria: object.aria,
3
+ id: object.id,
4
+ data: object.data,
5
+ class: object.classname,
6
+ **combined_html_options) do %>
2
7
  <%= pb_rails("body", props: {
3
8
  tag: "span",
4
9
  classname: "pb_contact_kit",
@@ -1,4 +1,9 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ aria: object.aria,
3
+ id: object.id,
4
+ data: object.data,
5
+ class: object.classname,
6
+ **combined_html_options) do %>
2
7
  <%= pb_rails("caption", props: object.caption_props) %>
3
8
 
4
9
  <div class=<%= "pb_currency_wrapper#{object.variant_class || object.emphasized_class}" %>>
@@ -1,4 +1,9 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ aria: object.aria,
3
+ class: object.classname,
4
+ data: object.data,
5
+ id: object.id,
6
+ **combined_html_options) do %>
2
7
  <% if object.stat_label.present? %>
3
8
  <%= pb_rails("body", props: { color: "light", text: object.stat_label } ) %>
4
9
  <% end %>
@@ -1,4 +1,9 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ id: object.id,
3
+ data: object.data,
4
+ class: object.classname,
5
+ aria: object.aria,
6
+ **combined_html_options) do %>
2
7
 
3
8
  <% if object.unstyled %>
4
9
  <!-- icon -->
@@ -1,4 +1,8 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ id: object.id,
3
+ data: object.data,
4
+ class: object.classname,
5
+ **combined_html_options) do %>
2
6
  <div class="pb_date_range_inline_wrapper">
3
7
  <% if object.icon == true %>
4
8
  <%= pb_rails(object.text_kit, props: { tag: "span", dark: object.dark, color: object.icon_color, text: pb_rails("icon", props: { icon: "calendar-alt", fixed_width: true, size: object.size, classname: "pb_date_range_inline_icon" }) }) %>
@@ -1,4 +1,8 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ id: object.id,
3
+ data: object.data,
4
+ class: object.classname,
5
+ **combined_html_options) do %>
2
6
 
3
7
  <%= pb_rails("flex", props: {vertical: "center"}) do %>
4
8
  <%= pb_rails("flex/flex_item") do %>
@@ -1,4 +1,8 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ id: object.id,
3
+ data: object.data,
4
+ class: object.classname,
5
+ **combined_html_options) do %>
2
6
 
3
7
  <% if object.bold == false %>
4
8
 
@@ -1,4 +1,9 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ aria: object.aria,
3
+ id: object.id,
4
+ data: object.data,
5
+ class: object.classname,
6
+ **combined_html_options) do %>
2
7
 
3
8
  <%= pb_rails("flex", props: {
4
9
  orientation: "row",
@@ -1,4 +1,9 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ id: object.id,
3
+ data: object.data,
4
+ class: object.classname,
5
+ aria: object.aria,
6
+ **combined_html_options) do %>
2
7
 
3
8
  <%= pb_rails("flex", props: {classname: "flex-container", vertical: "stretch"}) do %>
4
9
  <%= pb_rails("body", props: {classname: "flex-item"}) do %>
@@ -1,4 +1,8 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ id: object.id,
3
+ data: object.data,
4
+ class: object.classname,
5
+ **combined_html_options) do %>
2
6
  <%= pb_rails("title", props: { text: object.day_month, size: 4, dark: object.dark }) %>
3
7
  <%= pb_rails("body", props: { text: object.year, size: 4, color: "light", dark: object.dark }) %>
4
8
  <% end %>
@@ -1 +1 @@
1
- The Dropdown kit accepts an `options` array and renders each object from that array as a selectable option within a dropdown container. `options` is a required prop and must be an array of objects. Each object can contain as many key/value pairs as needed but MUST contain 'label' and 'value' as the only required items within each object.
1
+ This kit's `options` prop requires an array of objects, each of which will be used as the selectable options within the dropdown. Each option object can support any number of key-value pairs, but each must contain `label` and `value`.
@@ -1,7 +1,6 @@
1
- The dropdown comes with the following subcomponents that can be used to achieve various levels of customization:
1
+ The dropdown is built using all of the following subcomponents:
2
2
 
3
- `Dropdown. Trigger` / `dropdown/dropdown_trigger`
4
- `Dropdown.Container`/ `dropdown/dropdown_container`
5
- `Dropdown.Option` / `dropdown/dropdown_option`
6
-
7
- See the code snippet below for a visual on how to use the kit with subcomponents. Each subcomponent allows for GlobalProps in addition to any subcomponent specfic props.
3
+ `Dropdown.Trigger` is the UI component that users interact with to toggle the dropdown.
4
+ `Dropdown.Container` is the floating container that wraps the list of dropdown options.
5
+ `Dropdown.Option` renders options that are passed to the container.
6
+ Each of these subcomponents can be altered using global props and/or their respective props. See doc examples below for more information on each.
@@ -0,0 +1,6 @@
1
+ The dropdown is built using all of the following required subcomponents:
2
+
3
+ `dropdown/dropdown_trigger` is the UI component that users interact with to toggle the dropdown.
4
+ `dropdown/dropdown_container` is the floating container that wraps the list of dropdown options.
5
+ `dropdown/dropdown_option` renders options that are passed to the container.
6
+ Each of these subcomponents can be altered using global props and/or their respective props. See doc examples below for more information on each.
@@ -1,5 +1,5 @@
1
- The `customDisplay` prop can be used to customize the display of the selected item by allowing devs to pass in a component that will be rendered to the left of the default text-based display. In this example the Avatar kit is being used.
1
+ Optionally utilize `customDisplay` on the `Dropdown.Trigger` subcomponent to customize its content after an option is selected. The component passed to customDisplay will be rendered to the left of the default text-based display. In this example the Avatar kit is being used.
2
2
 
3
- The `placeholder` prop can also be used to customize the placeholder text for the default Trigger.
3
+ The `placeholder` prop can also be used to customize the placeholder text for the default `Dropdown.Trigger`.
4
4
 
5
- The `onSelect` prop is a function that gives the dev one argument: the selected option. In this example we are using the `onSelect` to set a state with the selected option and using it to customize the `customDisplay`.
5
+ The `onSelect` prop returns the selected option as an object to be utilized by the dev. In this example we are using the `onSelect` to set a state with the selected option and using it to customize the `customDisplay`.
@@ -0,0 +1,5 @@
1
+ Optionally utilize `custom_display` on the `dropdown/dropdown_trigger` subcomponent to customize its content after an option is selected. The component passed to custom_display will be rendered to the left of the default text-based display. In this example the Avatar kit is being used.
2
+
3
+ The `placeholder` prop can also be used to customize the placeholder text for the default `dropdown/dropdown_trigger`.
4
+
5
+ The dropdown follows the typical rails pattern of utilizing hidden inputs for form submission. The hidden input value is the selected options' id.
@@ -1 +1 @@
1
- The Dropdown also allows for custom options that can be passed in as children to the `Dropdown.Option` subcomponent. If no children are passed to `Dropdown.Option`, the kit will render each option as text within a Body kit by default.
1
+ `Dropdown.Option` subcomponent accepts any child components to customize the options' contents and display. By default, options are Body kit text that is set by the `label` value from the `option` object.
@@ -0,0 +1 @@
1
+ `dropdown/dropdown_option` subcomponent accepts any child components to customize the options' contents and display. By default, options are Body kit text that is set by the `label` value from the `option` object.
@@ -1 +1 @@
1
- By default, the padding on each option in the dropdown is set to `xs`. The `padding` Global Props however can be used to override this default. In this example, we are setting padding to `sm`.
1
+ By default, dropdown option padding is set to `xs`, but this padding can be overridden using our global prop spacing token. In this example we are increasing the option padding to `sm`.
@@ -1 +1 @@
1
- The Dropdown can also be given a custom Trigger by passing children to the `Dropdown.Trigger` subcomponent as shown in this example. Here we are using the IconCircle kit.
1
+ Optionally replace the default trigger's select element by passing child components directly to the `Dropdown.Trigger`.
@@ -0,0 +1 @@
1
+ Optionally replace the default trigger's select element by passing child components directly to the `dropdown/dropdown_trigger`.
@@ -1 +1 @@
1
- The optional `label` prop takes a string value that if present will render that string as the label for the Dropdown.
1
+ The top-level Dropdown component optionally accepts any string through a `label` prop to produce a label above your trigger element.
@@ -1,12 +1,12 @@
1
1
  examples:
2
2
  rails:
3
3
  - dropdown_default: Default
4
- - dropdown_subcomponent_structure: Subcomponent Structure
4
+ - dropdown_subcomponent_structure_rails: Subcomponent Structure
5
5
  - dropdown_with_label: With Label
6
- - dropdown_with_custom_options: Custom Options
7
- - dropdown_with_custom_display: Custom Display
8
- - dropdown_with_custom_trigger: Custom Trigger
9
- - dropdown_with_custom_padding: Custom Padding for Dropdown Options
6
+ - dropdown_with_custom_options_rails: Custom Options
7
+ - dropdown_with_custom_display_rails: Custom Display
8
+ - dropdown_with_custom_trigger_rails: Custom Trigger
9
+ - dropdown_with_custom_padding: Custom Option Padding
10
10
 
11
11
  react:
12
12
  - dropdown_default: Default
@@ -15,7 +15,7 @@ examples:
15
15
  - dropdown_with_custom_options: Custom Options
16
16
  - dropdown_with_custom_display: Custom Display
17
17
  - dropdown_with_custom_trigger: Custom Trigger
18
- - dropdown_with_custom_padding: Custom Padding for Dropdown Options
18
+ - dropdown_with_custom_padding: Custom Option Padding
19
19
  # - dropdown_with_autocomplete: Autocomplete
20
20
  # - dropdown_with_autocomplete_and_custom_display: Autocomplete with Custom Display
21
21
  # - dropdown_with_external_control: useDropdown Hook
@@ -3,7 +3,7 @@
3
3
  module Playbook
4
4
  module PbDropdown
5
5
  class DropdownOption < Playbook::KitBase
6
- prop :option, type: Playbook::Props::String
6
+ prop :option, type: Playbook::Props::HashProp
7
7
  prop :id, type: Playbook::Props::String
8
8
 
9
9
  def data
@@ -1,4 +1,9 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ aria: object.aria,
3
+ id: object.id,
4
+ data: object.data,
5
+ class: object.classname,
6
+ **combined_html_options) do %>
2
7
  <%= pb_rails("icon", props: { icon: object.icon_value, classname: "pb_icon", fixed_width: true }) %>
3
8
 
4
9
  <% if content %>
@@ -19,7 +19,7 @@ export type IconSizes = "lg"
19
19
  | "10x"
20
20
  | ""
21
21
 
22
- type IconProps = {
22
+ export type IconProps = {
23
23
  aria?: {[key: string]: string},
24
24
  border?: string,
25
25
  className?: string,
@@ -1,3 +1,8 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ aria: object.aria,
3
+ class: object.classname,
4
+ data: object.data,
5
+ id: object.id,
6
+ **combined_html_options) do %>
2
7
  <%= pb_rails("icon", props: { dark: object.dark, icon: object.icon, fixed_width: true }) %>
3
8
  <% end %>
@@ -1,4 +1,9 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ aria: object.aria,
3
+ id: object.id,
4
+ data: object.data,
5
+ class: object.classname,
6
+ **combined_html_options) do %>
2
7
 
3
8
  <%= pb_rails("icon_circle", props: {
4
9
  dark: object.dark,
@@ -1,4 +1,9 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ aria: object.aria,
3
+ class: object.classname,
4
+ data: object.data,
5
+ id: object.id,
6
+ **combined_html_options) do %>
2
7
  <%= pb_rails("body", props: { color: "light", dark: object.dark }) do %>
3
8
  <%= pb_rails("icon", props: { icon: object.icon, fixed_width: true }) %>
4
9
  <%= object.text %>
@@ -1,4 +1,9 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ aria: object.aria,
3
+ id: object.id,
4
+ data: object.data,
5
+ class: object.classname,
6
+ **combined_html_options) do %>
2
7
  <%= pb_rails("caption", props: { text: object.label, classname: "pb_label_pill_label"}) %>
3
8
  <%= pb_rails("pill", props: { text: object.pill_value, variant: object.variant, classname: "pb_label_pill_pill" }) %>
4
9
  <% end %>
@@ -1,4 +1,9 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ aria: object.aria,
3
+ id: object.id,
4
+ data: object.data,
5
+ class: object.classname,
6
+ **combined_html_options) do %>
2
7
  <%= pb_rails("caption", props: { text: object.label, dark: object.dark }) %>
3
8
  <% if object.variant == "details" %>
4
9
  <%= pb_rails("flex", props: {inline: true, vertical: "center"}) do %>
@@ -1,4 +1,8 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ id: object.id,
3
+ data: object.data,
4
+ class: object.classname,
5
+ **combined_html_options) do %>
2
6
 
3
7
  <%= pb_rails("body", props: { color: "light", dark: object.dark }) do %>
4
8
  <%= pb_rails("icon", props: { aria: { label: "loading icon" }, fixed_width: true, icon: "spinner", pulse: true }) %> <%= object.text %>
@@ -1,8 +1,8 @@
1
1
  <%= content_tag(:div,
2
- id: object.id,
3
- data: object.data,
4
- class: object.classname,
5
- aria: object.aria,
6
- **combined_html_options) do %>
7
- <%= content %>
2
+ id: object.id,
3
+ data: object.data,
4
+ class: object.classname,
5
+ aria: object.aria,
6
+ **combined_html_options) do %>
7
+ <%= content %>
8
8
  <% end %>
@@ -1,4 +1,9 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ aria: object.aria,
3
+ class: object.classname,
4
+ data: object.data,
5
+ id: object.id,
6
+ **combined_html_options) do %>
2
7
  <% object.users.take(object.display_count).each do |user| %>
3
8
  <%= pb_rails("avatar", props: user.merge({size: object.size, classname: "pb_multiple_users_item", dark: object.dark}) ) %>
4
9
  <% end %>
@@ -1,4 +1,9 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ aria: object.aria,
3
+ class: object.classname,
4
+ data: object.data,
5
+ id: object.id,
6
+ **combined_html_options) do %>
2
7
  <%= pb_rails("avatar", props: object.users[0].merge({size: "xs", classname: "pb_multiple_users_stacked_item", dark: object.dark}) ) %>
3
8
 
4
9
  <% unless object.only_one %>
@@ -1,3 +1,8 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ aria: object.aria,
3
+ class: object.classname,
4
+ data: object.data,
5
+ id: object.id,
6
+ **combined_html_options) do %>
2
7
  <%= will_paginate object.model, renderer: Playbook::Pagination::Rails %>
3
8
  <% end %>
@@ -1,4 +1,9 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ aria: object.aria,
3
+ id: object.id,
4
+ data: object.data,
5
+ class: object.classname,
6
+ **combined_html_options) do %>
2
7
  <%= pb_rails("body", props: {
3
8
  tag: "span",
4
9
  classname: "pb_person_first" }) { object.first_name } %>
@@ -1,4 +1,9 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ aria: object.aria,
3
+ id: object.id,
4
+ data: object.data,
5
+ class: object.classname,
6
+ **combined_html_options) do %>
2
7
  <%= pb_rails("person", props: {
3
8
  first_name: object.first_name,
4
9
  last_name: object.last_name,
@@ -1,3 +1,8 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ aria: object.aria,
3
+ class: object.classname,
4
+ data: object.data,
5
+ id: object.id,
6
+ **combined_html_options) do %>
2
7
  <%= pb_rails("title", props: { text: object.display_text, tag: "div", size: 4, classname: "pb_pill_text" }) %>
3
8
  <% end %>
@@ -1,4 +1,9 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ aria: object.aria,
3
+ id: object.id,
4
+ data: object.data,
5
+ class: object.classname,
6
+ **combined_html_options) do %>
2
7
  <% if object.orientation === 'horizontal' %>
3
8
  <% if content %>
4
9
  <%= content %>
@@ -7,7 +7,7 @@ import type { InputCallback } from '../types'
7
7
 
8
8
  import Body from '../pb_body/_body'
9
9
  import Caption from '../pb_caption/_caption'
10
- import Icon from '../pb_icon/_icon'
10
+ import Icon, { IconProps } from '../pb_icon/_icon'
11
11
 
12
12
  type SelectOption = {
13
13
  value: string,
@@ -25,6 +25,7 @@ type SelectProps = {
25
25
  disabled?: boolean,
26
26
  error?: string,
27
27
  htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
28
+ iconProps?: IconProps,
28
29
  id?: string,
29
30
  includeBlank?: string,
30
31
  inline?: boolean,
@@ -36,6 +37,7 @@ type SelectProps = {
36
37
  onChange: InputCallback<HTMLSelectElement>,
37
38
  options: SelectOption[],
38
39
  required?: boolean,
40
+ selectProps?: GlobalProps & { [key: string]: any },
39
41
  showArrow?: boolean,
40
42
  value?: string,
41
43
  } & GlobalProps
@@ -59,6 +61,7 @@ const Select = ({
59
61
  data = {},
60
62
  disabled = false,
61
63
  error,
64
+ iconProps,
62
65
  label,
63
66
  htmlOptions = {},
64
67
  inline = false,
@@ -67,6 +70,7 @@ const Select = ({
67
70
  onChange = () => undefined,
68
71
  options = [],
69
72
  required = false,
73
+ selectProps = {},
70
74
  showArrow = false,
71
75
  value,
72
76
  ...props
@@ -90,6 +94,12 @@ const Select = ({
90
94
  compactClass
91
95
  );
92
96
 
97
+ const selectClasses = classnames(
98
+ buildCss('pb_html_select'),
99
+ globalProps(selectProps),
100
+ selectProps.className
101
+ )
102
+
93
103
  const selectWrapperClass = classnames(buildCss('pb_select_kit_wrapper'), { error }, className)
94
104
  const selectBody =(() =>{
95
105
  if (children) return children
@@ -97,6 +107,7 @@ const Select = ({
97
107
  <select
98
108
  {...htmlOptions}
99
109
  {...domSafeProps(props)}
110
+ className={selectClasses}
100
111
  disabled={disabled}
101
112
  id={name}
102
113
  multiple={multiple}
@@ -137,6 +148,7 @@ const Select = ({
137
148
  className="pb_select_kit_caret"
138
149
  fixedWidth
139
150
  icon="angle-down"
151
+ {...iconProps}
140
152
  />
141
153
  :
142
154
  null
@@ -1,4 +1,8 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ id: object.id,
3
+ data: object.data,
4
+ class: object.classname,
5
+ **combined_html_options) do %>
2
6
  <div class="pb__source_layout">
3
7
  <% if !object.hide_icon %>
4
8
  <% if object.show_icon? %>
@@ -1,4 +1,8 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ id: object.id,
3
+ data: object.data,
4
+ class: object.classname,
5
+ **combined_html_options) do %>
2
6
  <%= pb_rails("body", props: { status: object.status }) do %>
3
7
  <%= pb_rails("icon", props: { fixed_width: true, icon: object.returned_icon }) if object.returned_icon %>
4
8
  <%= "#{object.value}%" if object.value %>
@@ -1,4 +1,8 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ id: object.id,
3
+ data: object.data,
4
+ class: object.classname,
5
+ **combined_html_options) do %>
2
6
  <div class="pb_stat_value_wrapper">
3
7
  <%= pb_rails "title", props: {
4
8
  classname: "pb_stat_value_kit",
@@ -1,4 +1,8 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ id: object.id,
3
+ data: object.data,
4
+ class: object.classname,
5
+ **combined_html_options) do %>
2
6
  <div class="pb_time_range_inline_wrapper">
3
7
  <% if object.icon == true %>
4
8
  <%= pb_rails(object.text_kit, props: { tag: "span", dark: object.dark, color: object.icon_color, text: pb_rails("icon", props: { icon: "clock", dark: object.dark, classname:"pb_time_range_inline_icon", fixed_width: true, size: object.size }) }) %>
@@ -1,4 +1,8 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ id: object.id,
3
+ data: object.data,
4
+ class: object.classname,
5
+ **combined_html_options) do %>
2
6
 
3
7
  <%= pb_rails("body", props: { color: "light", dark: object.dark, classname: "pb_time_stacked time-spacing" }) do %>
4
8
  <time>
@@ -1,4 +1,8 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ id: object.id,
3
+ data: object.data,
4
+ class: object.classname,
5
+ **combined_html_options) do %>
2
6
 
3
7
  <div class="pb_timeline_item_left_block">
4
8
  <% if object.date.present? %>
@@ -1,3 +1,7 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ id: object.id,
3
+ data: object.data,
4
+ class: object.classname,
5
+ **combined_html_options) do %>
2
6
  <%= content.presence %>
3
7
  <% end %>
@@ -1,4 +1,9 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ aria: object.aria,
3
+ id: object.id,
4
+ data: object.data,
5
+ class: object.classname,
6
+ **combined_html_options) do %>
2
7
 
3
8
  <% if object.unstyled %>
4
9
  <div><%= object.timestamp_text %></div>
@@ -1,4 +1,9 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ aria: object.aria,
3
+ class: object.classname,
4
+ data: object.data,
5
+ id: object.id,
6
+ **combined_html_options) do %>
2
7
  <%= pb_rails("title", props: {
3
8
  dark: object.dark,
4
9
  size: object.title_size,
@@ -1,4 +1,8 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ id: object.id,
3
+ data: object.data,
4
+ class: object.classname,
5
+ **combined_html_options) do %>
2
6
  <%= pb_rails("title", props: { text: object.title, size: 4 }) %>
3
7
  <%= pb_rails("body", props: { text: object.detail, color: "light" }) %>
4
8
  <% end %>
@@ -1,4 +1,9 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ aria: object.aria,
3
+ class: object.classname,
4
+ data: object.data,
5
+ id: object.id,
6
+ **combined_html_options) do %>
2
7
  <%= pb_rails("caption", props: {dark: object.dark, text: object.day_of_week}) %>
3
8
  <%= pb_rails("title", props: {dark: object.dark, size: 4, tag: "span", text: object.formatted_month_and_day}) %>
4
9
  <% end %>
data/dist/menu.yml CHANGED
@@ -255,9 +255,9 @@ kits:
255
255
  description: Playbook's date picker is built using flatpickr, a vanilla js library. Common date picker use cases and features have been adapted into simple prop based configuration detailed in the docs below.
256
256
  status: "stable"
257
257
  - name: dropdown
258
- platforms: *react_only
258
+ platforms: *web
259
259
  description: ""
260
- status: "beta"
260
+ status: "stable"
261
261
  - name: "multi_level_select"
262
262
  platforms: *web
263
263
  description: The MultiLevelSelect kit renders a multi leveled select dropdown based on data from the user.
@@ -81,7 +81,7 @@ module Playbook
81
81
  end
82
82
 
83
83
  # rubocop:disable Style/OptionalBooleanParameter
84
- def pb_content_tag(name = :div, content_or_options_with_block = {}, options = {}, escape = true, &block)
84
+ def pb_content_tag(name, content_or_options_with_block = nil, options = {}, escape = true, &block)
85
85
  combined_options = options
86
86
  .merge(combined_html_options)
87
87
  .merge(default_options.merge(content_or_options_with_block))
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Playbook
4
4
  PREVIOUS_VERSION = "13.27.0"
5
- VERSION = "13.27.0.pre.alpha.PLAY1342DRYcontenttagRailssimplekits2896"
5
+ VERSION = "13.27.0.pre.alpha.PLAY11782916"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playbook_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 13.27.0.pre.alpha.PLAY1342DRYcontenttagRailssimplekits2896
4
+ version: 13.27.0.pre.alpha.PLAY11782916
5
5
  platform: ruby
6
6
  authors:
7
7
  - Power UX
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-05-13 00:00:00.000000000 Z
12
+ date: 2024-05-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -1049,25 +1049,29 @@ files:
1049
1049
  - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default.html.erb
1050
1050
  - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default.jsx
1051
1051
  - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default.md
1052
- - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subcomponent_structure.html.erb
1053
1052
  - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subcomponent_structure.jsx
1054
1053
  - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subcomponent_structure.md
1054
+ - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subcomponent_structure_rails.html.erb
1055
+ - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subcomponent_structure_rails.md
1055
1056
  - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete.jsx
1056
1057
  - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete.md
1057
1058
  - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_and_custom_display.jsx
1058
1059
  - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_and_custom_display.md
1059
- - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display.html.erb
1060
1060
  - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display.jsx
1061
1061
  - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display.md
1062
- - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_options.html.erb
1062
+ - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display_rails.html.erb
1063
+ - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display_rails.md
1063
1064
  - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_options.jsx
1064
1065
  - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_options.md
1066
+ - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_options_rails.html.erb
1067
+ - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_options_rails.md
1065
1068
  - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_padding.html.erb
1066
1069
  - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_padding.jsx
1067
1070
  - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_padding.md
1068
- - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_trigger.html.erb
1069
1071
  - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_trigger.jsx
1070
1072
  - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_trigger.md
1073
+ - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_trigger_rails.html.erb
1074
+ - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_trigger_rails.md
1071
1075
  - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_external_control.jsx
1072
1076
  - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_hook.jsx
1073
1077
  - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_label.html.erb