playbook_ui 13.27.0.pre.alpha.PLAY1122fixMultipleUserspaddingoverflow2844 → 13.27.0.pre.alpha.PLAY1342DRYcontenttagRailssimplekits2896

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.html.erb +1 -5
  3. data/app/pb_kits/playbook/pb_advanced_table/table_body.html.erb +1 -5
  4. data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +1 -5
  5. data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +1 -5
  6. data/app/pb_kits/playbook/pb_avatar/Utilities/GetPlacementPropsHelper.tsx +16 -0
  7. data/app/pb_kits/playbook/pb_avatar/_avatar.scss +16 -0
  8. data/app/pb_kits/playbook/pb_avatar/avatar.html.erb +1 -1
  9. data/app/pb_kits/playbook/pb_avatar/avatar.rb +4 -0
  10. data/app/pb_kits/playbook/pb_avatar/avatar.test.js +47 -0
  11. data/app/pb_kits/playbook/pb_avatar/docs/_avatar_badge_component_overlay.html.erb +46 -66
  12. data/app/pb_kits/playbook/pb_avatar/docs/_avatar_badge_component_overlay.jsx +8 -29
  13. data/app/pb_kits/playbook/pb_avatar/docs/_avatar_badge_component_overlay.md +3 -0
  14. data/app/pb_kits/playbook/pb_avatar/docs/_avatar_circle_icon_component_overlay.html.erb +13 -33
  15. data/app/pb_kits/playbook/pb_avatar/docs/_avatar_circle_icon_component_overlay.jsx +48 -67
  16. data/app/pb_kits/playbook/pb_avatar/docs/_avatar_circle_icon_component_overlay.md +3 -0
  17. data/app/pb_kits/playbook/pb_avatar/docs/_avatar_default.jsx +0 -20
  18. data/app/pb_kits/playbook/pb_avatar/docs/example.yml +2 -2
  19. data/app/pb_kits/playbook/pb_avatar_action_button/avatar_action_button.html.erb +1 -6
  20. data/app/pb_kits/playbook/pb_badge/badge.html.erb +1 -6
  21. data/app/pb_kits/playbook/pb_body/_body.scss +3 -0
  22. data/app/pb_kits/playbook/pb_body/_body_mixins.scss +1 -1
  23. data/app/pb_kits/playbook/pb_button/_button_mixins.scss +3 -3
  24. data/app/pb_kits/playbook/pb_button_toolbar/button_toolbar.html.erb +1 -6
  25. data/app/pb_kits/playbook/pb_caption/_caption_mixin.scss +1 -1
  26. data/app/pb_kits/playbook/pb_card/_card_mixin.scss +5 -0
  27. data/app/pb_kits/playbook/pb_card/card.rb +1 -1
  28. data/app/pb_kits/playbook/pb_card/docs/_card_background.html.erb +20 -0
  29. data/app/pb_kits/playbook/pb_card/docs/_card_background.jsx +41 -1
  30. data/app/pb_kits/playbook/pb_card/docs/_card_background.md +1 -1
  31. data/app/pb_kits/playbook/pb_card/docs/_card_header.html.erb +1 -1
  32. data/app/pb_kits/playbook/pb_card/docs/_card_header.md +1 -1
  33. data/app/pb_kits/playbook/pb_card/docs/_card_highlight.md +1 -1
  34. data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.html.erb +1 -6
  35. data/app/pb_kits/playbook/pb_collapsible/collapsible.html.erb +1 -6
  36. data/app/pb_kits/playbook/pb_collapsible/collapsible_content.html.erb +1 -6
  37. data/app/pb_kits/playbook/pb_collapsible/collapsible_main.html.erb +1 -6
  38. data/app/pb_kits/playbook/pb_contact/contact.html.erb +1 -6
  39. data/app/pb_kits/playbook/pb_currency/currency.html.erb +1 -6
  40. data/app/pb_kits/playbook/pb_dashboard_value/dashboard_value.html.erb +1 -6
  41. data/app/pb_kits/playbook/pb_date/date.html.erb +1 -6
  42. data/app/pb_kits/playbook/pb_date_range_inline/date_range_inline.html.erb +1 -5
  43. data/app/pb_kits/playbook/pb_date_range_stacked/date_range_stacked.html.erb +1 -5
  44. data/app/pb_kits/playbook/pb_date_stacked/date_stacked.html.erb +1 -5
  45. data/app/pb_kits/playbook/pb_date_time/date_time.html.erb +1 -6
  46. data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.html.erb +1 -6
  47. data/app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.html.erb +1 -5
  48. data/app/pb_kits/playbook/pb_detail/_detail_mixins.scss +1 -1
  49. data/app/pb_kits/playbook/pb_docs/kit_example.html.erb +3 -3
  50. data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +2 -1
  51. data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +4 -2
  52. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default.html.erb +3 -3
  53. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subcomponent_structure.html.erb +3 -3
  54. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_options.html.erb +3 -3
  55. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_padding.html.erb +3 -3
  56. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_trigger.html.erb +3 -3
  57. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_label.html.erb +3 -3
  58. data/app/pb_kits/playbook/pb_dropdown/dropdown.html.erb +1 -0
  59. data/app/pb_kits/playbook/pb_dropdown/dropdown.rb +1 -0
  60. data/app/pb_kits/playbook/pb_dropdown/dropdown_option.html.erb +1 -1
  61. data/app/pb_kits/playbook/pb_dropdown/index.js +2 -1
  62. data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownOption.tsx +4 -2
  63. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.html.erb +1 -6
  64. data/app/pb_kits/playbook/pb_form_group/_form_group.scss +15 -0
  65. data/app/pb_kits/playbook/pb_icon_circle/icon_circle.html.erb +1 -6
  66. data/app/pb_kits/playbook/pb_icon_stat_value/icon_stat_value.html.erb +1 -6
  67. data/app/pb_kits/playbook/pb_icon_value/icon_value.html.erb +1 -6
  68. data/app/pb_kits/playbook/pb_label_pill/label_pill.html.erb +1 -6
  69. data/app/pb_kits/playbook/pb_label_value/label_value.html.erb +1 -6
  70. data/app/pb_kits/playbook/pb_loading_inline/loading_inline.html.erb +1 -5
  71. data/app/pb_kits/playbook/pb_message/message_mention.html.erb +6 -6
  72. data/app/pb_kits/playbook/pb_multiple_users/multiple_users.html.erb +1 -6
  73. data/app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.html.erb +1 -6
  74. data/app/pb_kits/playbook/pb_pagination/pagination.html.erb +1 -6
  75. data/app/pb_kits/playbook/pb_person/person.html.erb +1 -6
  76. data/app/pb_kits/playbook/pb_person_contact/person_contact.html.erb +1 -6
  77. data/app/pb_kits/playbook/pb_pill/pill.html.erb +1 -6
  78. data/app/pb_kits/playbook/pb_section_separator/section_separator.html.erb +1 -6
  79. data/app/pb_kits/playbook/pb_source/source.html.erb +1 -5
  80. data/app/pb_kits/playbook/pb_stat_change/stat_change.html.erb +1 -5
  81. data/app/pb_kits/playbook/pb_stat_value/stat_value.html.erb +1 -5
  82. data/app/pb_kits/playbook/pb_time_range_inline/time_range_inline.html.erb +1 -5
  83. data/app/pb_kits/playbook/pb_time_stacked/time_stacked.html.erb +1 -5
  84. data/app/pb_kits/playbook/pb_timeline/item.html.erb +1 -5
  85. data/app/pb_kits/playbook/pb_timeline/timeline.html.erb +1 -5
  86. data/app/pb_kits/playbook/pb_timestamp/timestamp.html.erb +1 -6
  87. data/app/pb_kits/playbook/pb_title/_title.scss +5 -1
  88. data/app/pb_kits/playbook/pb_title_count/title_count.html.erb +1 -6
  89. data/app/pb_kits/playbook/pb_title_detail/title_detail.html.erb +1 -5
  90. data/app/pb_kits/playbook/pb_weekday_stacked/weekday_stacked.html.erb +1 -6
  91. data/app/pb_kits/playbook/tokens/_titles.scss +5 -1
  92. data/dist/playbook-rails.js +2 -2
  93. data/lib/playbook/kit_base.rb +1 -1
  94. data/lib/playbook/version.rb +1 -1
  95. metadata +4 -2
@@ -1,8 +1,3 @@
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 %>
1
+ <%= pb_content_tag do %>
7
2
  <span><%= object.text %></span>
8
3
  <% end %>
@@ -45,6 +45,9 @@
45
45
  }
46
46
 
47
47
  &[class*=dark] {
48
+ a {
49
+ color: $active_dark;
50
+ }
48
51
  @include pb_body_dark();
49
52
  @each $dark_color_name, $dark_color_value in $pb_dark_body_colors{
50
53
  &[class*=_#{$dark_color_name}][class*=dark]{
@@ -15,7 +15,7 @@ $pb_dark_body_colors: (
15
15
  default: $text_dk_default,
16
16
  light: $text_dk_light,
17
17
  lighter: $text_dk_lighter,
18
- link: $primary_action_dark,
18
+ link: $active_dark,
19
19
  error: $error,
20
20
  success: $text_dk_success_sm,
21
21
  );
@@ -197,16 +197,16 @@ $pb_button_border_width: 0px;
197
197
 
198
198
  // Dark Link =============
199
199
  @mixin pb_button_link_dark {
200
- @include pb_button_variant($transparent, $white);
200
+ @include pb_button_variant($transparent, $active_dark);
201
201
 
202
202
  @media (hover:hover) {
203
203
  &:hover {
204
204
  @include pb_button_hover($transparent);
205
- color: rgba($white, $opacity_6)
205
+ color: rgba($active_dark, $opacity_6)
206
206
  }
207
207
  &:active {
208
208
  transition: none;
209
- @include pb_button_variant($transparent, $white);
209
+ @include pb_button_variant($transparent, $active_dark);
210
210
  }
211
211
  }
212
212
  }
@@ -1,8 +1,3 @@
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 %>
1
+ <%= pb_content_tag do %>
7
2
  <%= content.presence || object.text %>
8
3
  <% end %>
@@ -13,7 +13,7 @@ $pb_caption_colors: (
13
13
  $pb_dark_caption_colors: (
14
14
  default: $text_dk_default,
15
15
  light: $text_dk_light,
16
- link: $primary,
16
+ link: $active_dark,
17
17
  success: $text_dk_success_sm,
18
18
  error: $error,
19
19
  );
@@ -17,6 +17,11 @@ $additional_colors: (
17
17
  "light": $bg_light,
18
18
  "white": $white,
19
19
  "none": none,
20
+ "success_subtle": $success_subtle,
21
+ "warning_subtle": $warning_subtle,
22
+ "error_subtle": $error_subtle,
23
+ "info_subtle": $info_subtle,
24
+ "neutral_subtle": $neutral_subtle,
20
25
  );
21
26
  $background_colors: map-merge($product_colors, $additional_colors);
22
27
  $pb_card_header_colors: map-merge(map-merge($product_colors, $additional_colors), $category_colors);
@@ -15,7 +15,7 @@ module Playbook
15
15
  values: %w[xs sm md lg xl none rounded],
16
16
  default: "md"
17
17
  prop :background, type: Playbook::Props::Enum,
18
- values: %w[white light dark product_1_background product_1_highlight product_2_background product_2_highlight product_3_background product_3_highlight product_4_background product_4_highlight product_5_background product_5_highlight product_6_background product_6_highlight product_7_background product_7_highlight product_8_background product_8_highlight product_9_background product_9_highlight product_10_background product_10_highlight windows siding doors solar roofing gutters insulation none],
18
+ values: %w[white light dark product_1_background product_1_highlight product_2_background product_2_highlight product_3_background product_3_highlight product_4_background product_4_highlight product_5_background product_5_highlight product_6_background product_6_highlight product_7_background product_7_highlight product_8_background product_8_highlight product_9_background product_9_highlight product_10_background product_10_highlight windows siding doors solar roofing gutters insulation none success_subtle warning_subtle error_subtle info_subtle neutral_subtle],
19
19
  default: "none"
20
20
 
21
21
  def classname
@@ -42,3 +42,23 @@
42
42
  dark: true
43
43
  }) %>
44
44
  <% end %>
45
+
46
+ <%= pb_rails("title", props: { text: "Subtle Status Colors", tag: "h4", size: 4, margin_bottom: "sm" }) %>
47
+
48
+ <%= pb_rails("card", props: { background: "success_subtle", margin_bottom: "sm" }) do %>
49
+ <%= pb_rails("body", props: {
50
+ text: "Success Subtle"
51
+ }) %>
52
+ <% end %>
53
+
54
+ <%= pb_rails("card", props: { background: "warning_subtle", margin_bottom: "sm" }) do %>
55
+ <%= pb_rails("body", props: {
56
+ text: "Warning Subtle"
57
+ }) %>
58
+ <% end %>
59
+
60
+ <%= pb_rails("card", props: { background: "info_subtle", margin_bottom: "sm" }) do %>
61
+ <%= pb_rails("body", props: {
62
+ text: "Info Subtle"
63
+ }) %>
64
+ <% end %>
@@ -90,7 +90,47 @@ const CardBackground = (props) => {
90
90
  />
91
91
  </Card>
92
92
 
93
-
93
+
94
+ <Title
95
+ {...props}
96
+ marginBottom="sm"
97
+ size={4}
98
+ tag="h4"
99
+ text="Subtle Status Colors"
100
+ />
101
+
102
+ <Card
103
+ background="success_subtle"
104
+ marginBottom="sm"
105
+ {...props}
106
+ >
107
+ <Body
108
+ text="Success Subtle"
109
+ {...props}
110
+ />
111
+ </Card>
112
+
113
+ <Card
114
+ background="warning_subtle"
115
+ marginBottom="sm"
116
+ {...props}
117
+ >
118
+ <Body
119
+ text="Warning Subtle"
120
+ {...props}
121
+ />
122
+ </Card>
123
+
124
+ <Card
125
+ background="info_subtle"
126
+ marginBottom="sm"
127
+ {...props}
128
+ >
129
+ <Body
130
+ text="Info Subtle"
131
+ {...props}
132
+ />
133
+ </Card>
94
134
  </div>
95
135
  )
96
136
  }
@@ -1 +1 @@
1
- Add a background color by passing the color name to background. List of all colors can be viewed <a href="https://playbook.powerapp.cloud/visual_guidelines" target="_blank">here</a> under Product Colors.
1
+ Add a background color by passing the color name to background. List of all colors can be viewed <a href="https://playbook.powerapp.cloud/visual_guidelines" target="_blank">here</a> under Product Colors and Status: Subtle Variations.
@@ -67,4 +67,4 @@
67
67
  <%= pb_rails("card/card_body", props: { padding: "md", }) do %>
68
68
  Body
69
69
  <% end %>
70
- <% end %>
70
+ <% end %>
@@ -1 +1 @@
1
- Card headers pass category, product, and background colors only. List of all category, product, and background colors can be viewed <a href="https://playbook.powerapp.cloud/utilities" target="_blank">here</a>.
1
+ Card headers pass category, product, and background colors only. List of all category, product, and background colors can be viewed <a href="https://playbook.powerapp.cloud/visual_guidelines/colors" target="_blank">here</a>.
@@ -1 +1 @@
1
- Card highlight can pass status, product, and category colors. List of all colors can be viewed <a href="https://playbook.powerapp.cloud/utilities" target="_blank">here</a>.
1
+ Card highlight can pass status, product, and category colors. List of all colors can be viewed <a href="https://playbook.powerapp.cloud/visual_guidelines/colors" target="_blank">here</a>.
@@ -1,9 +1,4 @@
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 %>
1
+ <%= pb_content_tag do %>
7
2
  <%= 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 %>
8
3
  <%= pb_rails("icon", props: {icon: object.icon, fixed_width: true, dark: object.dark}) %>
9
4
  <% end %>
@@ -1,8 +1,3 @@
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 %>
1
+ <%= pb_content_tag do %>
7
2
  <%= content.presence %>
8
3
  <% end %>
@@ -1,8 +1,3 @@
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 %>
1
+ <%= pb_content_tag do %>
7
2
  <%= content.presence %>
8
3
  <% end %>
@@ -1,9 +1,4 @@
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 %>
1
+ <%= pb_content_tag do %>
7
2
 
8
3
  <%= pb_rails("flex", props: {vertical: "center", spacing: "between", cursor: "pointer"}) do %>
9
4
  <%= pb_rails("flex/flex_item") do %>
@@ -1,9 +1,4 @@
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 %>
1
+ <%= pb_content_tag do %>
7
2
  <%= pb_rails("body", props: {
8
3
  tag: "span",
9
4
  classname: "pb_contact_kit",
@@ -1,9 +1,4 @@
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 %>
1
+ <%= pb_content_tag do %>
7
2
  <%= pb_rails("caption", props: object.caption_props) %>
8
3
 
9
4
  <div class=<%= "pb_currency_wrapper#{object.variant_class || object.emphasized_class}" %>>
@@ -1,9 +1,4 @@
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 %>
1
+ <%= pb_content_tag do %>
7
2
  <% if object.stat_label.present? %>
8
3
  <%= pb_rails("body", props: { color: "light", text: object.stat_label } ) %>
9
4
  <% end %>
@@ -1,9 +1,4 @@
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 %>
1
+ <%= pb_content_tag do %>
7
2
 
8
3
  <% if object.unstyled %>
9
4
  <!-- icon -->
@@ -1,8 +1,4 @@
1
- <%= content_tag(:div,
2
- id: object.id,
3
- data: object.data,
4
- class: object.classname,
5
- **combined_html_options) do %>
1
+ <%= pb_content_tag do %>
6
2
  <div class="pb_date_range_inline_wrapper">
7
3
  <% if object.icon == true %>
8
4
  <%= 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,8 +1,4 @@
1
- <%= content_tag(:div,
2
- id: object.id,
3
- data: object.data,
4
- class: object.classname,
5
- **combined_html_options) do %>
1
+ <%= pb_content_tag do %>
6
2
 
7
3
  <%= pb_rails("flex", props: {vertical: "center"}) do %>
8
4
  <%= pb_rails("flex/flex_item") do %>
@@ -1,8 +1,4 @@
1
- <%= content_tag(:div,
2
- id: object.id,
3
- data: object.data,
4
- class: object.classname,
5
- **combined_html_options) do %>
1
+ <%= pb_content_tag do %>
6
2
 
7
3
  <% if object.bold == false %>
8
4
 
@@ -1,9 +1,4 @@
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 %>
1
+ <%= pb_content_tag do %>
7
2
 
8
3
  <%= pb_rails("flex", props: {
9
4
  orientation: "row",
@@ -1,9 +1,4 @@
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 %>
1
+ <%= pb_content_tag do %>
7
2
 
8
3
  <%= pb_rails("flex", props: {classname: "flex-container", vertical: "stretch"}) do %>
9
4
  <%= pb_rails("body", props: {classname: "flex-item"}) do %>
@@ -1,8 +1,4 @@
1
- <%= content_tag(:div,
2
- id: object.id,
3
- data: object.data,
4
- class: object.classname,
5
- **combined_html_options) do %>
1
+ <%= pb_content_tag do %>
6
2
  <%= pb_rails("title", props: { text: object.day_month, size: 4, dark: object.dark }) %>
7
3
  <%= pb_rails("body", props: { text: object.year, size: 4, color: "light", dark: object.dark }) %>
8
4
  <% end %>
@@ -15,7 +15,7 @@ $pb_dark_detail_colors: (
15
15
  light: $text_dk_light,
16
16
  default: $text_dk_default,
17
17
  lighter: $text_dk_lighter,
18
- link: $primary,
18
+ link: $active_dark,
19
19
  error: $error_dark,
20
20
  success: $text_dk_success_sm,
21
21
  );
@@ -23,11 +23,11 @@
23
23
  <ul>
24
24
  <% hide_button = type == "rails" ? 'flex' : 'none' %>
25
25
  <li>
26
- <%= pb_rails("button", props: { id:"copy-html-#{example_key}", icon: "copy", text: "Copy HTML", variant: "link", size: "sm", display: hide_button }) %>
26
+ <%= pb_rails("button", props: { id:"copy-html-#{example_key}", icon: "copy", text: "Copy HTML", classname: dark ? "dark" : "", variant: "link", size: "sm", display: hide_button }) %>
27
27
  </li>
28
28
  <li>
29
- <%= pb_rails("button", props: { icon: "code", id:"toggle-open-opened", text: "Close Code", variant: "link", size: "sm", display: "none" }) %>
30
- <%= pb_rails("button", props: { icon: "code", id:"toggle-open-closed", text: "Show Code", variant: "link", size: "sm" }) %>
29
+ <%= pb_rails("button", props: { icon: "code", classname: dark ? "dark" : "", id:"toggle-open-opened", text: "Close Code", variant: "link", size: "sm", display: "none" }) %>
30
+ <%= pb_rails("button", props: { icon: "code", classname: dark ? "dark" : "", id:"toggle-open-closed", text: "Show Code", variant: "link", size: "sm" }) %>
31
31
  </li>
32
32
  </ul>
33
33
  </div>
@@ -77,8 +77,9 @@
77
77
  }
78
78
  &[class*="selected"] {
79
79
  background-color: $primary;
80
+ color: $white;
80
81
  [class^="pb_body"],
81
- [class^="pb_title_kit"] {
82
+ [class^="pb_title_kit"], a {
82
83
  color: $white !important;
83
84
  }
84
85
  &:hover {
@@ -114,8 +114,10 @@ const Dropdown = (props: DropdownProps) => {
114
114
  setIsDropDownClosed(isClosed)
115
115
  },[isClosed])
116
116
 
117
- const filteredOptions = options?.filter((option: GenericObject) =>
118
- option.label.toLowerCase().includes(filterItem.toLowerCase())
117
+ const filteredOptions = options?.filter((option: GenericObject) => {
118
+ const label = typeof option.label === 'string' ? option.label.toLowerCase() : option.label;
119
+ return String(label).toLowerCase().includes(filterItem.toLowerCase());
120
+ }
119
121
  );
120
122
 
121
123
  // For keyboard accessibility: Set focus within dropdown to selected item if it exists
@@ -1,8 +1,8 @@
1
1
  <%
2
2
  options = [
3
- { label: 'United States', value: 'United States' },
4
- { label: 'Canada', value: 'Canada' },
5
- { label: 'Pakistan', value: 'Pakistan' },
3
+ { label: 'United States', value: 'United States', id: 'us' },
4
+ { label: 'Canada', value: 'Canada', id: 'ca' },
5
+ { label: 'Pakistan', value: 'Pakistan', id: 'pk' },
6
6
  ]
7
7
 
8
8
  %>
@@ -1,8 +1,8 @@
1
1
  <%
2
2
  options = [
3
- { label: 'United States', value: 'United States' },
4
- { label: 'Canada', value: 'Canada' },
5
- { label: 'Pakistan', value: 'Pakistan' },
3
+ { label: 'United States', value: 'United States', id: 'us' },
4
+ { label: 'Canada', value: 'Canada', id: 'ca' },
5
+ { label: 'Pakistan', value: 'Pakistan', id: 'pk' },
6
6
  ]
7
7
 
8
8
  %>
@@ -5,21 +5,21 @@
5
5
  value: "United States",
6
6
  areaCode: "+1",
7
7
  icon: "🇺🇸",
8
- id: "United-states"
8
+ id: "us"
9
9
  },
10
10
  {
11
11
  label: "Canada",
12
12
  value: "Canada",
13
13
  areaCode: "+1",
14
14
  icon: "🇨🇦",
15
- id: "canada"
15
+ id: "ca"
16
16
  },
17
17
  {
18
18
  label: "Pakistan",
19
19
  value: "Pakistan",
20
20
  areaCode: "+92",
21
21
  icon: "🇵🇰",
22
- id: "pakistan"
22
+ id: "pk"
23
23
  }
24
24
  ]
25
25
 
@@ -1,8 +1,8 @@
1
1
  <%
2
2
  options = [
3
- { label: 'United States', value: 'United States' },
4
- { label: 'Canada', value: 'Canada' },
5
- { label: 'Pakistan', value: 'Pakistan' },
3
+ { label: 'United States', value: 'United States', id: 'us' },
4
+ { label: 'Canada', value: 'Canada', id: 'ca' },
5
+ { label: 'Pakistan', value: 'Pakistan', id: 'pk' },
6
6
  ]
7
7
 
8
8
  %>
@@ -5,21 +5,21 @@
5
5
  value: "United States",
6
6
  areaCode: "+1",
7
7
  icon: "🇺🇸",
8
- id: "United-states"
8
+ id: "us"
9
9
  },
10
10
  {
11
11
  label: "Canada",
12
12
  value: "Canada",
13
13
  areaCode: "+1",
14
14
  icon: "🇨🇦",
15
- id: "canada"
15
+ id: "ca"
16
16
  },
17
17
  {
18
18
  label: "Pakistan",
19
19
  value: "Pakistan",
20
20
  areaCode: "+92",
21
21
  icon: "🇵🇰",
22
- id: "pakistan"
22
+ id: "pk"
23
23
  }
24
24
  ]
25
25
 
@@ -1,8 +1,8 @@
1
1
  <%
2
2
  options = [
3
- { label: 'United States', value: 'United States' },
4
- { label: 'Canada', value: 'Canada' },
5
- { label: 'Pakistan', value: 'Pakistan' },
3
+ { label: 'United States', value: 'United States', id: 'us' },
4
+ { label: 'Canada', value: 'Canada', id: 'ca' },
5
+ { label: 'Pakistan', value: 'Pakistan', id: 'pk' },
6
6
  ]
7
7
 
8
8
  %>
@@ -8,6 +8,7 @@
8
8
  <%= pb_rails("caption", props: {text: object.label, margin_bottom:"xs"}) %>
9
9
  <% end %>
10
10
  <div class="dropdown_wrapper" style="position: relative">
11
+ <input type="hidden" name="<%= object.name %>" id="dropdown-selected-option" value=""/>
11
12
  <% if content.present? %>
12
13
  <%= content.presence %>
13
14
  <% else %>
@@ -6,6 +6,7 @@ module Playbook
6
6
  prop :options, type: Playbook::Props::Array,
7
7
  default: []
8
8
  prop :label, type: Playbook::Props::String
9
+ prop :name, type: Playbook::Props::String
9
10
 
10
11
  def data
11
12
  Hash(prop(:data)).merge(pb_dropdown: true)
@@ -2,7 +2,7 @@
2
2
  aria: object.aria,
3
3
  class: object.classname,
4
4
  data: object.data,
5
- id: object.id,
5
+ id: object.option[:id],
6
6
  **combined_html_options) do %>
7
7
  <%= pb_rails("list/item", props: {
8
8
  display: "flex",
@@ -37,8 +37,10 @@ export default class PbDropdown extends PbEnhancedElement {
37
37
 
38
38
  handleOptionClick(event) {
39
39
  const option = event.target.closest(OPTION_SELECTOR);
40
+ const hiddenInput = this.element.querySelector("#dropdown-selected-option");
40
41
  if (option) {
41
42
  const value = option.dataset.dropdownOptionLabel;
43
+ hiddenInput.value = JSON.parse(value).id;
42
44
  this.onOptionSelected(value, option);
43
45
  }
44
46
  }
@@ -99,7 +101,6 @@ export default class PbDropdown extends PbEnhancedElement {
99
101
  option.classList.remove("pb_dropdown_option_selected");
100
102
  });
101
103
  selectedOption.classList.add("pb_dropdown_option_selected");
102
- console.log(`Selected value: ${value}`);
103
104
  }
104
105
 
105
106
  get target() {
@@ -50,8 +50,10 @@ const DropdownOption = (props: DropdownOptionProps) => {
50
50
  selected,
51
51
  } = useContext(DropdownContext);
52
52
 
53
- const isItemMatchingFilter = (option: GenericObject) =>
54
- option?.label.toLowerCase().includes(filterItem.toLowerCase());
53
+ const isItemMatchingFilter = (option: GenericObject) => {
54
+ const label = typeof option.label === 'string' ? option.label.toLowerCase() : option.label;
55
+ return String(label).toLowerCase().includes(filterItem.toLowerCase());
56
+ }
55
57
 
56
58
  if (!isItemMatchingFilter(option)) {
57
59
  return null;
@@ -1,9 +1,4 @@
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 %>
1
+ <%= pb_content_tag do %>
7
2
  <%= pb_rails("icon", props: { icon: object.icon_value, classname: "pb_icon", fixed_width: true }) %>
8
3
 
9
4
  <% if content %>
@@ -33,6 +33,17 @@
33
33
  outline-offset: -1px;
34
34
  }
35
35
  }
36
+ .text_input_wrapper_add_on .add-on-right [class^=pb_card_kit] {
37
+ border-bottom-right-radius: 0;
38
+ border-top-right-radius: 0;
39
+ border-right-width: 0;
40
+ }
41
+ .text_input_wrapper_add_on .add-on-right.border_left_on .card-right-aligned {
42
+ border-left: 1px $border_light solid;
43
+ &.dark {
44
+ border-left: 1px rgba($white, 0.15) solid;
45
+ }
46
+ }
36
47
  }
37
48
 
38
49
  & > [class^=pb_text_input_kit]:not(:first-child) {
@@ -40,6 +51,10 @@
40
51
  border-bottom-left-radius: 0;
41
52
  border-top-left-radius: 0;
42
53
  }
54
+ .text_input_wrapper_add_on .add-on-left [class^=pb_card_kit] {
55
+ border-bottom-left-radius: 0;
56
+ border-top-left-radius: 0;
57
+ }
43
58
  }
44
59
 
45
60
  & > [class^=pb_button_kit]:not(:last-child) {
@@ -1,8 +1,3 @@
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 %>
1
+ <%= pb_content_tag do %>
7
2
  <%= pb_rails("icon", props: { dark: object.dark, icon: object.icon, fixed_width: true }) %>
8
3
  <% end %>
@@ -1,9 +1,4 @@
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 %>
1
+ <%= pb_content_tag do %>
7
2
 
8
3
  <%= pb_rails("icon_circle", props: {
9
4
  dark: object.dark,