playbook_ui 6.2.1 → 6.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (190) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/data/menu.yml +4 -3
  3. data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.html.erb +7 -4
  4. data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.jsx +29 -21
  5. data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.scss +3 -0
  6. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_actions_dark.html.erb +17 -0
  7. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_actions_dark.jsx +21 -0
  8. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_dark.html.erb +9 -0
  9. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_dark.jsx +14 -0
  10. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_on_click_dark.html.erb +15 -0
  11. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_on_click_dark.jsx +16 -0
  12. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_placement_dark.html.erb +31 -0
  13. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_placement_dark.jsx +33 -0
  14. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_tooltip_dark.html.erb +12 -0
  15. data/app/pb_kits/playbook/pb_avatar_action_button/docs/example.yml +10 -3
  16. data/app/pb_kits/playbook/pb_avatar_action_button/docs/index.js +4 -0
  17. data/app/pb_kits/playbook/pb_badge/_badge.jsx +2 -6
  18. data/app/pb_kits/playbook/pb_badge/docs/_description.md +1 -0
  19. data/app/pb_kits/playbook/pb_body/_body.jsx +3 -3
  20. data/app/pb_kits/playbook/pb_body/_body.scss +12 -9
  21. data/app/pb_kits/playbook/pb_body/_body_mixins.scss +6 -3
  22. data/app/pb_kits/playbook/pb_body/body.rb +3 -3
  23. data/app/pb_kits/playbook/pb_caption/_caption.scss +3 -0
  24. data/app/pb_kits/playbook/pb_card/_card.jsx +1 -1
  25. data/app/pb_kits/playbook/pb_checkbox/_checkbox.html.erb +1 -1
  26. data/app/pb_kits/playbook/pb_checkbox/checkbox.rb +5 -0
  27. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.html.erb +1 -0
  28. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_dark.html.erb +21 -0
  29. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_dark.jsx +40 -0
  30. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_multi_line_dark.html.erb +5 -0
  31. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_multi_line_dark.jsx +16 -0
  32. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/example.yml +4 -1
  33. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/index.js +2 -0
  34. data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +1 -0
  35. data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +1 -0
  36. data/app/pb_kits/playbook/pb_form/docs/_form_simple_form.html.erb +3 -1
  37. data/app/pb_kits/playbook/pb_form/docs/_form_simple_form_validate.html.erb +3 -1
  38. data/app/pb_kits/playbook/pb_form/form_builder.rb +1 -0
  39. data/app/pb_kits/playbook/pb_form/form_builder/checkbox_field.rb +29 -0
  40. data/app/pb_kits/playbook/pb_hashtag/_hashtag.html.erb +4 -4
  41. data/app/pb_kits/playbook/pb_hashtag/_hashtag.jsx +22 -8
  42. data/app/pb_kits/playbook/pb_hashtag/docs/_hashtag_dark.jsx +3 -0
  43. data/app/pb_kits/playbook/pb_hashtag/docs/_hashtag_default.jsx +3 -0
  44. data/app/pb_kits/playbook/pb_hashtag/hashtag.rb +1 -6
  45. data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.html.erb +4 -3
  46. data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.jsx +21 -6
  47. data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.scss +4 -1
  48. data/app/pb_kits/playbook/pb_icon_circle/docs/_icon_circle_color_dark.html.erb +42 -0
  49. data/app/pb_kits/playbook/pb_icon_circle/docs/_icon_circle_color_dark.jsx +59 -0
  50. data/app/pb_kits/playbook/pb_icon_circle/docs/_icon_circle_dark.html.erb +4 -0
  51. data/app/pb_kits/playbook/pb_icon_circle/docs/_icon_circle_dark.jsx +16 -0
  52. data/app/pb_kits/playbook/pb_icon_circle/docs/_icon_circle_sizes.html.erb +4 -4
  53. data/app/pb_kits/playbook/pb_icon_circle/docs/{_icon_circle_size.jsx → _icon_circle_sizes.jsx} +2 -2
  54. data/app/pb_kits/playbook/pb_icon_circle/docs/_icon_circle_sizes_dark.html.erb +29 -0
  55. data/app/pb_kits/playbook/pb_icon_circle/docs/_icon_circle_sizes_dark.jsx +34 -0
  56. data/app/pb_kits/playbook/pb_icon_circle/docs/example.yml +8 -1
  57. data/app/pb_kits/playbook/pb_icon_circle/docs/index.js +4 -1
  58. data/app/pb_kits/playbook/pb_icon_value/_icon_value.html.erb +4 -3
  59. data/app/pb_kits/playbook/pb_icon_value/_icon_value.jsx +9 -3
  60. data/app/pb_kits/playbook/pb_icon_value/_icon_value.scss +3 -0
  61. data/app/pb_kits/playbook/pb_icon_value/docs/_icon_value_align.jsx +31 -0
  62. data/app/pb_kits/playbook/pb_icon_value/docs/_icon_value_align_dark.html.erb +23 -0
  63. data/app/pb_kits/playbook/pb_icon_value/docs/_icon_value_align_dark.jsx +34 -0
  64. data/app/pb_kits/playbook/pb_icon_value/docs/_icon_value_dark.html.erb +21 -0
  65. data/app/pb_kits/playbook/pb_icon_value/docs/_icon_value_dark.jsx +32 -0
  66. data/app/pb_kits/playbook/pb_icon_value/docs/example.yml +5 -0
  67. data/app/pb_kits/playbook/pb_icon_value/docs/index.js +3 -0
  68. data/app/pb_kits/playbook/pb_label_value/_label_value.html.erb +1 -1
  69. data/app/pb_kits/playbook/pb_label_value/_label_value.jsx +6 -10
  70. data/app/pb_kits/playbook/pb_label_value/_label_value.scss +1 -1
  71. data/app/pb_kits/playbook/pb_label_value/label_value.rb +1 -6
  72. data/app/pb_kits/playbook/pb_legend/_legend.jsx +5 -5
  73. data/app/pb_kits/playbook/pb_legend/legend.rb +1 -6
  74. data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.html.erb +4 -3
  75. data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.jsx +25 -7
  76. data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.scss +6 -0
  77. data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_dark.html.erb +41 -0
  78. data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_dark.jsx +52 -0
  79. data/app/pb_kits/playbook/pb_multiple_users/docs/example.yml +2 -0
  80. data/app/pb_kits/playbook/pb_multiple_users/docs/index.js +1 -0
  81. data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.html.erb +6 -4
  82. data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.jsx +19 -8
  83. data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.scss +12 -7
  84. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_dark.html.erb +53 -0
  85. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_dark.jsx +62 -0
  86. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/example.yml +2 -0
  87. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/index.js +1 -0
  88. data/app/pb_kits/playbook/pb_nav/_item.html.erb +3 -2
  89. data/app/pb_kits/playbook/pb_nav/_item.jsx +36 -14
  90. data/app/pb_kits/playbook/pb_nav/_nav.html.erb +3 -2
  91. data/app/pb_kits/playbook/pb_nav/_nav.jsx +27 -13
  92. data/app/pb_kits/playbook/pb_nav/docs/example.yml +1 -0
  93. data/app/pb_kits/playbook/pb_online_status/_online_status.html.erb +3 -2
  94. data/app/pb_kits/playbook/pb_online_status/_online_status.jsx +14 -4
  95. data/app/pb_kits/playbook/pb_online_status/_online_status_mixins.scss +5 -2
  96. data/app/pb_kits/playbook/pb_online_status/docs/_online_status_dark.html.erb +9 -0
  97. data/app/pb_kits/playbook/pb_online_status/docs/_online_status_dark.jsx +28 -0
  98. data/app/pb_kits/playbook/pb_online_status/docs/example.yml +2 -0
  99. data/app/pb_kits/playbook/pb_online_status/docs/index.js +1 -0
  100. data/app/pb_kits/playbook/pb_pill/_pill.html.erb +3 -2
  101. data/app/pb_kits/playbook/pb_pill/_pill.jsx +21 -3
  102. data/app/pb_kits/playbook/pb_pill/_pill.scss +1 -1
  103. data/app/pb_kits/playbook/pb_pill/docs/_pill_dark.html.erb +52 -0
  104. data/app/pb_kits/playbook/pb_pill/docs/_pill_dark.jsx +69 -0
  105. data/app/pb_kits/playbook/pb_pill/docs/example.yml +3 -1
  106. data/app/pb_kits/playbook/pb_pill/docs/index.js +1 -0
  107. data/app/pb_kits/playbook/pb_popover/_popover.html.erb +3 -2
  108. data/app/pb_kits/playbook/pb_popover/_popover.jsx +16 -4
  109. data/app/pb_kits/playbook/pb_popover/docs/_popover_close_dark.html.erb +43 -0
  110. data/app/pb_kits/playbook/pb_popover/docs/_popover_close_dark.jsx +102 -0
  111. data/app/pb_kits/playbook/pb_popover/docs/_popover_dark.html.erb +25 -0
  112. data/app/pb_kits/playbook/pb_popover/docs/_popover_dark.jsx +48 -0
  113. data/app/pb_kits/playbook/pb_popover/docs/_popover_default.html.erb +1 -0
  114. data/app/pb_kits/playbook/pb_popover/docs/_popover_list_dark.html.erb +13 -0
  115. data/app/pb_kits/playbook/pb_popover/docs/_popover_list_dark.jsx +51 -0
  116. data/app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height_dark.html.erb +25 -0
  117. data/app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height_dark.jsx +54 -0
  118. data/app/pb_kits/playbook/pb_popover/docs/_popover_z_index_dark.html.erb +14 -0
  119. data/app/pb_kits/playbook/pb_popover/docs/_popover_z_index_dark.jsx +52 -0
  120. data/app/pb_kits/playbook/pb_popover/docs/example.yml +10 -0
  121. data/app/pb_kits/playbook/pb_popover/docs/index.js +5 -0
  122. data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.html.erb +1 -1
  123. data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.jsx +2 -3
  124. data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.scss +1 -2
  125. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_status_dark.html.erb +1 -0
  126. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_status_dark.jsx +19 -0
  127. data/app/pb_kits/playbook/pb_progress_pills/docs/example.yml +2 -0
  128. data/app/pb_kits/playbook/pb_progress_pills/docs/index.js +1 -0
  129. data/app/pb_kits/playbook/pb_progress_pills/progress_pills.rb +2 -13
  130. data/app/pb_kits/playbook/pb_progress_step/_progress_step.html.erb +1 -1
  131. data/app/pb_kits/playbook/pb_progress_step/_progress_step.jsx +5 -6
  132. data/app/pb_kits/playbook/pb_progress_step/_progress_step.scss +124 -538
  133. data/app/pb_kits/playbook/pb_progress_step/_progress_step_item.html.erb +4 -16
  134. data/app/pb_kits/playbook/pb_progress_step/_progress_step_item.jsx +10 -20
  135. data/app/pb_kits/playbook/pb_progress_step/docs/_description.md +5 -1
  136. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_dark.html.erb +26 -0
  137. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_default.html.erb +27 -1
  138. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_default.jsx +3 -3
  139. data/app/pb_kits/playbook/pb_progress_step/docs/{_progress_step_child.html.erb → _progress_step_tracker.html.erb} +5 -5
  140. data/app/pb_kits/playbook/pb_progress_step/docs/{_progress_step_child.jsx → _progress_step_tracker.jsx} +7 -7
  141. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_vertical.html.erb +7 -1
  142. data/app/pb_kits/playbook/pb_progress_step/docs/example.yml +2 -3
  143. data/app/pb_kits/playbook/pb_progress_step/docs/index.js +1 -1
  144. data/app/pb_kits/playbook/pb_progress_step/progress_step.rb +10 -7
  145. data/app/pb_kits/playbook/pb_progress_step/progress_step_item.rb +2 -1
  146. data/app/pb_kits/playbook/pb_radio/_radio.html.erb +6 -5
  147. data/app/pb_kits/playbook/pb_radio/_radio.jsx +26 -21
  148. data/app/pb_kits/playbook/pb_radio/_radio.scss +1 -1
  149. data/app/pb_kits/playbook/pb_radio/docs/_radio_dark.jsx +5 -3
  150. data/app/pb_kits/playbook/pb_radio/docs/_radio_default.jsx +3 -1
  151. data/app/pb_kits/playbook/pb_radio/radio.rb +2 -8
  152. data/app/pb_kits/playbook/pb_select/_select.html.erb +3 -3
  153. data/app/pb_kits/playbook/pb_select/_select.jsx +6 -8
  154. data/app/pb_kits/playbook/pb_select/_select.scss +1 -1
  155. data/app/pb_kits/playbook/pb_select/select.rb +1 -6
  156. data/app/pb_kits/playbook/pb_table/_table.html.erb +3 -2
  157. data/app/pb_kits/playbook/pb_table/_table.jsx +15 -2
  158. data/app/pb_kits/playbook/pb_table/_table_row.html.erb +3 -2
  159. data/app/pb_kits/playbook/pb_table/_table_row.jsx +22 -4
  160. data/app/pb_kits/playbook/pb_table/table.rb +3 -5
  161. data/app/pb_kits/playbook/pb_title_count/_title_count.html.erb +5 -3
  162. data/app/pb_kits/playbook/pb_title_count/_title_count.jsx +7 -1
  163. data/app/pb_kits/playbook/pb_title_count/docs/_title_count_align_dark.html.erb +23 -0
  164. data/app/pb_kits/playbook/pb_title_count/docs/_title_count_align_dark.jsx +34 -0
  165. data/app/pb_kits/playbook/pb_title_count/docs/_title_count_dark.html.erb +23 -0
  166. data/app/pb_kits/playbook/pb_title_count/docs/_title_count_dark.jsx +34 -0
  167. data/app/pb_kits/playbook/pb_title_count/docs/example.yml +4 -0
  168. data/app/pb_kits/playbook/pb_title_count/docs/index.js +2 -0
  169. data/app/pb_kits/playbook/pb_tooltip/index.js +1 -1
  170. data/app/pb_kits/playbook/pb_user/_user.html.erb +3 -2
  171. data/app/pb_kits/playbook/pb_user/_user.jsx +51 -17
  172. data/app/pb_kits/playbook/pb_user/docs/_user_dark.jsx +55 -0
  173. data/app/pb_kits/playbook/pb_user/docs/_user_text_only_dark.jsx +26 -0
  174. data/app/pb_kits/playbook/pb_user/docs/example.yml +2 -0
  175. data/app/pb_kits/playbook/pb_user/docs/index.js +2 -0
  176. data/app/pb_kits/playbook/pb_user/user.rb +1 -7
  177. data/app/pb_kits/playbook/pb_user_badge/_user_badge.html.erb +3 -2
  178. data/app/pb_kits/playbook/pb_user_badge/_user_badge.jsx +23 -3
  179. data/app/pb_kits/playbook/pb_user_badge/docs/_user_badge_dark.html.erb +13 -0
  180. data/app/pb_kits/playbook/pb_user_badge/docs/_user_badge_dark.jsx +27 -0
  181. data/app/pb_kits/playbook/pb_user_badge/docs/_user_badge_size_dark.html.erb +21 -0
  182. data/app/pb_kits/playbook/pb_user_badge/docs/_user_badge_size_dark.jsx +36 -0
  183. data/app/pb_kits/playbook/pb_user_badge/docs/example.yml +4 -0
  184. data/app/pb_kits/playbook/pb_user_badge/docs/index.js +2 -0
  185. data/app/pb_kits/playbook/pb_weekday_stacked/_weekday_stacked.html.erb +3 -2
  186. data/app/pb_kits/playbook/pb_weekday_stacked/_weekday_stacked.jsx +20 -6
  187. data/app/pb_kits/playbook/pb_weekday_stacked/weekday_stacked.rb +0 -3
  188. data/app/views/playbook/pages/tokens/_pb_doc_spacing.html.slim +44 -0
  189. data/lib/playbook/version.rb +1 -1
  190. metadata +61 -5
@@ -6,9 +6,12 @@ $pb_body_colors: (
6
6
  default: $text_lt_default,
7
7
  light: $text_lt_light,
8
8
  lighter: $text_lt_lighter,
9
- dark: $text_dk_default,
10
- light_dark: $text_dk_light,
11
- lighter_dark: $text_dk_lighter,
9
+ );
10
+
11
+ $pb_dark_body_colors: (
12
+ default: $text_dk_default,
13
+ light: $text_dk_light,
14
+ lighter: $text_dk_lighter,
12
15
  );
13
16
 
14
17
  // Order is important here!
@@ -9,7 +9,7 @@ module Playbook
9
9
  partial "pb_body/body"
10
10
 
11
11
  prop :color, type: Playbook::Props::Enum,
12
- values: %w[default light lighter dark light_dark lighter_dark],
12
+ values: %w[default light lighter],
13
13
  default: "default"
14
14
  prop :status, type: Playbook::Props::Enum,
15
15
  values: %w[neutral negative positive],
@@ -41,11 +41,11 @@ module Playbook
41
41
  end
42
42
 
43
43
  def color_class
44
- color != "default" ? color : nil
44
+ color
45
45
  end
46
46
 
47
47
  def status_class
48
- status != "neutral" ? status : nil
48
+ status == "neutral" ? nil : status
49
49
  end
50
50
  end
51
51
  end
@@ -10,4 +10,7 @@
10
10
  &[class^=pb_caption_kit_xs] {
11
11
  @include caption_xs;
12
12
  }
13
+ &[class*=dark]{
14
+ @include caption_dark
15
+ }
13
16
  }
@@ -92,7 +92,7 @@ const Card = (props: CardPropTypes) => {
92
92
  const nonHeaderChildren = cardChildren.filter((child) => (get(child, 'type.displayName') !== 'Header'))
93
93
 
94
94
  return (
95
- <div className={classnames(cardCss, globalProps({ padding }), className)}>
95
+ <div className={classnames(cardCss, globalProps(props, { padding }), className)}>
96
96
  {subComponentTags('Header')}
97
97
  {nonHeaderChildren}
98
98
  </div>
@@ -11,6 +11,6 @@
11
11
  <%= pb_rails("icon", props: { icon: "check", id: "check_icon", classname: "check_icon", fixed_width: true}) %>
12
12
  </span>
13
13
  <span class="pb_checkbox_label">
14
- <%= pb_rails("body", props: { status: object.checkbox_label_status, text: object.text, dark: object.dark }) %>
14
+ <%= pb_rails("body", props: { status: object.checkbox_label_status, text: object.text, dark: object.dark, margin_right: object.form_spacing ? "xs" : "" }) %>
15
15
  </span>
16
16
  <% end %>
@@ -15,6 +15,11 @@ module Playbook
15
15
  prop :value
16
16
  prop :name
17
17
 
18
+ prop :required, type: Playbook::Props::Boolean,
19
+ default: false
20
+ prop :form_spacing, type: Playbook::Props::Boolean,
21
+ default: false
22
+
18
23
  def checked_html
19
24
  checked ? "checked='true'" : nil
20
25
  end
@@ -1,4 +1,5 @@
1
1
  <%= content_tag(:div,
2
+ aria: object.aria,
2
3
  id: object.id,
3
4
  data: object.data,
4
5
  class: object.classname) do %>
@@ -0,0 +1,21 @@
1
+ <%= pb_rails("fixed_confirmation_toast", props: {
2
+ dark: true,
3
+ text: "Error Message",
4
+ status: "error"
5
+ })%>
6
+
7
+ <br><br>
8
+
9
+ <%= pb_rails("fixed_confirmation_toast", props: {
10
+ dark: true,
11
+ text: "Items Successfully Moved",
12
+ status: "success"
13
+ })%>
14
+
15
+ <br><br>
16
+
17
+ <%= pb_rails("fixed_confirmation_toast", props: {
18
+ dark: true,
19
+ text: "Scan to Assign Selected Items",
20
+ status: "neutral"
21
+ })%>
@@ -0,0 +1,40 @@
1
+ import React from 'react'
2
+ import { FixedConfirmationToast } from '../..'
3
+
4
+ const FixedConfirmationToastDark = () => {
5
+ return (
6
+ <div>
7
+ <div>
8
+ <FixedConfirmationToast
9
+ dark
10
+ status="error"
11
+ text="Error Message"
12
+ />
13
+ </div>
14
+
15
+ <br />
16
+ <br />
17
+
18
+ <div>
19
+ <FixedConfirmationToast
20
+ dark
21
+ status="success"
22
+ text="Items Successfully Moved"
23
+ />
24
+ </div>
25
+
26
+ <br />
27
+ <br />
28
+
29
+ <div>
30
+ <FixedConfirmationToast
31
+ dark
32
+ status="neutral"
33
+ text="Scan to Assign Selected Items"
34
+ />
35
+ </div>
36
+ </div>
37
+ )
38
+ }
39
+
40
+ export default FixedConfirmationToastDark
@@ -0,0 +1,5 @@
1
+ <%= pb_rails("fixed_confirmation_toast", props: {
2
+ dark: true,
3
+ text: "Scan to Assign Selected Items.\nClick X to close at any time",
4
+ status: "tip",
5
+ }) %>
@@ -0,0 +1,16 @@
1
+ import React from 'react'
2
+ import { FixedConfirmationToast } from '../../'
3
+
4
+ const FixedConfirmationToastMultiLineDark = () => {
5
+ return (
6
+ <div>
7
+ <FixedConfirmationToast
8
+ dark
9
+ status="tip"
10
+ text={'Scan to Assign Selected Items.\n Click X to close at any time'}
11
+ />
12
+ </div>
13
+ )
14
+ }
15
+
16
+ export default FixedConfirmationToastMultiLineDark
@@ -3,9 +3,12 @@ examples:
3
3
  rails:
4
4
  - fixed_confirmation_toast_default: Default
5
5
  - fixed_confirmation_toast_multi_line: Multi Line
6
-
6
+ - fixed_confirmation_toast_dark: Dark
7
+ - fixed_confirmation_toast_multi_line_dark: Multi Line Dark
7
8
 
8
9
  react:
9
10
  - fixed_confirmation_toast_default: Default
10
11
  - fixed_confirmation_toast_multi_line: Multi Line
12
+ - fixed_confirmation_toast_dark: Dark
13
+ - fixed_confirmation_toast_multi_line_dark: Multi Line Dark
11
14
 
@@ -1,2 +1,4 @@
1
1
  export { default as FixedConfirmationToastDefault } from './_fixed_confirmation_toast_default.jsx'
2
2
  export { default as FixedConfirmationToastMultiLine } from './_fixed_confirmation_toast_multi_line.jsx'
3
+ export { default as FixedConfirmationToastDark } from './_fixed_confirmation_toast_dark.jsx'
4
+ export { default as FixedConfirmationToastMultiLineDark } from './_fixed_confirmation_toast_multi_line_dark.jsx'
@@ -24,6 +24,7 @@
24
24
  <%= form.text_area :example_text_area, props: { label: true } %>
25
25
  <%= form.select :example_select, [ ["Yes", 1], ["No", 2] ], props: { label: true } %>
26
26
  <%= form.collection_select :example_collection_select, example_collection, :value, :name, props: { label: true } %>
27
+ <%= form.check_box :example_checkbox, data: { field1: "value1", field2: "value2" }, props: { text: "Example Checkbox", label: true } %>
27
28
 
28
29
  <%= form.actions do |action| %>
29
30
  <%= action.submit %>
@@ -27,6 +27,7 @@
27
27
  <%= form.text_area :example_text_area, props: { label: true, required: true } %>
28
28
  <%= form.select :example_select, [ ["Yes", 1], ["No", 2] ], props: { label: true, blank_selection: "Select One...", required: true } %>
29
29
  <%= form.collection_select :example_collection_select, example_collection, :value, :name, props: { label: true, blank_selection: "Select One...", required: true } %>
30
+ <%= form.check_box :example_checkbox, props: { text: "Example Checkbox", label: true, required: true } %>
30
31
 
31
32
  <%= form.actions do |action| %>
32
33
  <%= action.submit %>
@@ -13,7 +13,8 @@
13
13
  :example_url_field,
14
14
  :example_text_area,
15
15
  :example_select_field,
16
- :example_collection_select_field
16
+ :example_collection_select_field,
17
+ :example_checkbox_field
17
18
 
18
19
 
19
20
  def self.model_name
@@ -49,6 +50,7 @@
49
50
  <%= form.input :example_text_area, as: :text %>
50
51
  <%= form.select :example_select_field, [["Yes", 1], ["No", 2]], props: { label: true } %>
51
52
  <%= form.collection_select :example_collection_select_field, example_collection, :value, :name, props: { label: true } %>
53
+ <%= form.check_box :example_checkbox_field, props: { text: "Example Checkbox", label: true } %>
52
54
 
53
55
  <%= form.actions do |action| %>
54
56
  <%= action.submit %>
@@ -13,7 +13,8 @@
13
13
  :example_url_field,
14
14
  :example_text_area,
15
15
  :example_select_field,
16
- :example_collection_select_field
16
+ :example_collection_select_field,
17
+ :example_checkbox_field
17
18
 
18
19
 
19
20
  def self.model_name
@@ -49,6 +50,7 @@
49
50
  <%= form.input :example_text_area, {as: :text, input_html: {props: {required: true}}} %>
50
51
  <%= form.select :example_select_field, [["Yes", 1], ["No", 2]], props: { required: true, blank_selection: "Select One...", label: true } %>
51
52
  <%= form.collection_select :example_collection_select_field, example_collection, :value, :name, props: { required: true, blank_selection: "Select One...", label: true } %>
53
+ <%= form.check_box :example_checkbox_field, props: { text: "Example Checkbox", label: true, required: true } %>
52
54
 
53
55
  <%= form.actions do |action| %>
54
56
  <%= action.submit %>
@@ -17,6 +17,7 @@ module Playbook
17
17
  prepend(TypeaheadField)
18
18
  prepend(SelectField)
19
19
  prepend(CollectionSelectField)
20
+ prepend(CheckboxField)
20
21
 
21
22
  def actions(&block)
22
23
  ActionArea.new(self).wrapper(&block)
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Playbook
4
+ module PbForm
5
+ module FormBuilder
6
+ module CheckboxField
7
+ def check_box(name, props: {}, **options, &block)
8
+ label_text = @template.label(@object_name, name) if props[:label] == true
9
+ options[:required] = true if props[:required]
10
+ props[:margin_bottom] = "sm"
11
+ props[:form_spacing] = true
12
+
13
+ input = super(name, **options, &block)
14
+
15
+ if props[:label]
16
+ @template.pb_rails("caption", props: { text: label_text, margin_bottom: "xs" }) +
17
+ @template.pb_rails("checkbox", props: props) do
18
+ input
19
+ end
20
+ else
21
+ @template.pb_rails("checkbox", props: props) do
22
+ input
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -1,10 +1,10 @@
1
1
  <%= content_tag(:span,
2
- id: object.id,
2
+ aria: object.aria,
3
+ class: object.classname,
3
4
  data: object.data,
4
- class: object.classname) do %>
5
+ id: object.id) do %>
5
6
 
6
7
  <%= link_to object.url do %>
7
- <%= pb_rails("badge", props: { variant: "primary", text: object.hashtag_text, dark: object.dark }) %>
8
+ <%= pb_rails("badge", props: { dark: object.dark, variant: "primary", text: object.hashtag_text }) %>
8
9
  <% end %>
9
-
10
10
  <% end %>
@@ -5,13 +5,14 @@ import React from 'react'
5
5
  import classnames from 'classnames'
6
6
 
7
7
  import { Badge } from '../'
8
- import { buildCss } from '../utilities/props'
8
+ import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
9
9
  import { globalProps } from '../utilities/globalProps.js'
10
10
 
11
11
  type HashtagProps = {
12
+ aria?: object,
12
13
  className?: string,
13
- data?: string,
14
14
  dark?: boolean,
15
+ data?: string,
15
16
  id?: string,
16
17
  text?: string,
17
18
  type: "default" | "home" | "project" | "appointment",
@@ -26,14 +27,27 @@ const typeMap = {
26
27
  }
27
28
 
28
29
  const Hashtag = (props: HashtagProps) => {
29
- const { className, dark = false, text, type, url } = props
30
+ const {
31
+ aria = {},
32
+ className,
33
+ dark = false,
34
+ data = {},
35
+ id,
36
+ text,
37
+ type = 'default',
38
+ url,
39
+ } = props
40
+
41
+ const ariaProps = buildAriaProps(aria)
42
+ const dataProps = buildDataProps(data)
43
+ const classes = classnames(buildCss('pb_hashtag_kit'), globalProps(props), className)
44
+
30
45
  return (
31
46
  <span
32
- className={classnames(
33
- className,
34
- buildCss('pb_hashtag_kit', { dark: dark }),
35
- globalProps(props)
36
- )}
47
+ {...ariaProps}
48
+ {...dataProps}
49
+ className={classes}
50
+ id={id}
37
51
  >
38
52
  <a href={url}>
39
53
  <Badge
@@ -11,6 +11,7 @@ const HashtagDark = () => {
11
11
  url="https://google.com"
12
12
  />
13
13
  <br />
14
+ <br />
14
15
  <Hashtag
15
16
  dark
16
17
  text="123456"
@@ -18,6 +19,7 @@ const HashtagDark = () => {
18
19
  url="https://google.com"
19
20
  />
20
21
  <br />
22
+ <br />
21
23
  <Hashtag
22
24
  dark
23
25
  text="456789"
@@ -25,6 +27,7 @@ const HashtagDark = () => {
25
27
  url="https://google.com"
26
28
  />
27
29
  <br />
30
+ <br />
28
31
  <Hashtag
29
32
  dark
30
33
  text="654321"
@@ -10,18 +10,21 @@ const HashtagDefault = () => {
10
10
  url="https://google.com"
11
11
  />
12
12
  <br />
13
+ <br />
13
14
  <Hashtag
14
15
  text="123456"
15
16
  type="home"
16
17
  url="https://google.com"
17
18
  />
18
19
  <br />
20
+ <br />
19
21
  <Hashtag
20
22
  text="456789"
21
23
  type="appointment"
22
24
  url="https://google.com"
23
25
  />
24
26
  <br />
27
+ <br />
25
28
  <Hashtag
26
29
  text="654321"
27
30
  type="default"
@@ -8,14 +8,13 @@ module Playbook
8
8
  partial "pb_hashtag/hashtag"
9
9
 
10
10
  prop :text
11
- prop :dark, type: Playbook::Props::Boolean, default: false
12
11
  prop :type, type: Playbook::Props::Enum,
13
12
  values: %w[default project home appointment],
14
13
  default: "default"
15
14
  prop :url
16
15
 
17
16
  def classname
18
- generate_classname("pb_hastag_kit", dark_class)
17
+ generate_classname("pb_hastag_kit")
19
18
  end
20
19
 
21
20
  def hashtag_text
@@ -24,10 +23,6 @@ module Playbook
24
23
 
25
24
  private
26
25
 
27
- def dark_class
28
- dark ? "dark" : nil
29
- end
30
-
31
26
  def type_text
32
27
  if type === "home"
33
28
  "H#"
@@ -1,6 +1,7 @@
1
1
  <%= content_tag(:div,
2
- id: object.id,
2
+ aria: object.aria,
3
+ class: object.classname,
3
4
  data: object.data,
4
- class: object.classname) do %>
5
- <%= pb_rails("icon", props: { icon: object.icon, fixed_width: true }) %>
5
+ id: object.id) do %>
6
+ <%= pb_rails("icon", props: { dark: object.dark, icon: object.icon, fixed_width: true }) %>
6
7
  <% end %>
@@ -5,13 +5,17 @@ import React from 'react'
5
5
  import classnames from 'classnames'
6
6
 
7
7
  import { Icon } from '../'
8
- import { buildCss } from '../utilities/props'
8
+ import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
9
9
  import { globalProps } from '../utilities/globalProps.js'
10
10
 
11
11
  type IconCircleProps = {
12
+ aria?: object,
12
13
  className?: string,
14
+ dark?: boolean,
15
+ data?: object,
13
16
  icon: string,
14
- size?: "xs" | "sm" | "md" | "lg" | "xl",
17
+ id?: string,
18
+ size?: "base" | "xs" | "sm" | "md" | "lg" | "xl",
15
19
  variant?: | "default"
16
20
  | "royal"
17
21
  | "blue"
@@ -23,12 +27,23 @@ type IconCircleProps = {
23
27
  }
24
28
 
25
29
  const IconCircle = (props: IconCircleProps) => {
26
- const { className, icon, size = 'md', variant = 'default' } = props
27
- const css = buildCss('pb_icon_circle_kit', size, variant)
30
+ const { aria = {}, className, dark = false, data = {}, icon, id, size = 'md', variant = 'default' } = props
31
+
32
+ const ariaProps = buildAriaProps(aria)
33
+ const dataProps = buildDataProps(data)
34
+ const classes = classnames(buildCss('pb_icon_circle_kit', size, variant), globalProps(props), className)
28
35
 
29
36
  return (
30
- <div className={classnames(className, css, globalProps(props))}>
31
- <Icon icon={icon} />
37
+ <div
38
+ {...ariaProps}
39
+ {...dataProps}
40
+ className={classes}
41
+ id={id}
42
+ >
43
+ <Icon
44
+ dark={dark}
45
+ icon={icon}
46
+ />
32
47
  </div>
33
48
  )
34
49
  }