playbook_ui 6.0.1 → 6.1.0.pre.alpha1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (205) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +4 -1
  3. data/app/pb_kits/playbook/data/menu.yml +5 -2
  4. data/app/pb_kits/playbook/index.js +4 -0
  5. data/app/pb_kits/playbook/packs/examples.js +7 -0
  6. data/app/pb_kits/playbook/pb_avatar/_avatar.jsx +2 -2
  7. data/app/pb_kits/playbook/pb_badge/_badge.jsx +2 -5
  8. data/app/pb_kits/playbook/pb_badge/_badge.scss +1 -1
  9. data/app/pb_kits/playbook/pb_badge/badge.rb +1 -6
  10. data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx +2 -2
  11. data/app/pb_kits/playbook/pb_body/_body.jsx +3 -6
  12. data/app/pb_kits/playbook/pb_body/_body.scss +6 -0
  13. data/app/pb_kits/playbook/pb_body/body.rb +2 -8
  14. data/app/pb_kits/playbook/pb_button/_button.jsx +2 -5
  15. data/app/pb_kits/playbook/pb_button/_button.scss +1 -1
  16. data/app/pb_kits/playbook/pb_button/button.rb +1 -7
  17. data/app/pb_kits/playbook/pb_button/docs/_button_default.jsx +2 -0
  18. data/app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.html.erb +7 -0
  19. data/app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx +52 -0
  20. data/app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.scss +101 -0
  21. data/app/pb_kits/playbook/pb_button_toolbar/button_toolbar.rb +29 -0
  22. data/app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_default.html.erb +7 -0
  23. data/app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_default.jsx +29 -0
  24. data/app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_secondary.html.erb +7 -0
  25. data/app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_secondary.jsx +34 -0
  26. data/app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_vertical.html.erb +11 -0
  27. data/app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_vertical.jsx +29 -0
  28. data/app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_vertical_secondary.html.erb +11 -0
  29. data/app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_vertical_secondary.jsx +34 -0
  30. data/app/pb_kits/playbook/pb_button_toolbar/docs/_description.md +1 -0
  31. data/app/pb_kits/playbook/pb_button_toolbar/docs/example.yml +15 -0
  32. data/app/pb_kits/playbook/pb_button_toolbar/docs/index.js +4 -0
  33. data/app/pb_kits/playbook/pb_caption/_caption.jsx +3 -7
  34. data/app/pb_kits/playbook/pb_caption/_caption.scss +0 -4
  35. data/app/pb_kits/playbook/pb_caption/caption.rb +1 -8
  36. data/app/pb_kits/playbook/pb_card/_card.jsx +17 -14
  37. data/app/pb_kits/playbook/pb_card/_card.scss +4 -1
  38. data/app/pb_kits/playbook/pb_card/card.rb +2 -9
  39. data/app/pb_kits/playbook/pb_card/docs/_card_dark.html.erb +1 -1
  40. data/app/pb_kits/playbook/pb_checkbox/_checkbox.jsx +2 -2
  41. data/app/pb_kits/playbook/pb_checkbox/checkbox.rb +1 -8
  42. data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx +2 -2
  43. data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.rb +0 -2
  44. data/app/pb_kits/playbook/pb_contact/_contact.jsx +2 -2
  45. data/app/pb_kits/playbook/pb_currency/_currency.jsx +2 -2
  46. data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.js +26 -0
  47. data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.jsx +2 -2
  48. data/app/pb_kits/playbook/pb_date/_date.jsx +4 -4
  49. data/app/pb_kits/playbook/pb_date_picker/_date_picker.html.erb +38 -0
  50. data/app/pb_kits/playbook/pb_date_picker/_date_picker.jsx +101 -0
  51. data/app/pb_kits/playbook/pb_date_picker/_date_picker.scss +846 -0
  52. data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +41 -0
  53. data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.js +91 -0
  54. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default.html.erb +1 -0
  55. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default.jsx +12 -0
  56. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default_date.html.erb +24 -0
  57. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default_date.jsx +30 -0
  58. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_disabled.html.erb +43 -0
  59. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_disabled.jsx +48 -0
  60. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_error.html.erb +4 -0
  61. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_error.jsx +13 -0
  62. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_format.html.erb +19 -0
  63. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_format.jsx +25 -0
  64. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_label.html.erb +4 -0
  65. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_label.jsx +13 -0
  66. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_min_max.html.erb +14 -0
  67. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_min_max.jsx +22 -0
  68. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range.html.erb +4 -0
  69. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range.jsx +13 -0
  70. data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +23 -0
  71. data/app/pb_kits/playbook/pb_date_picker/docs/index.js +8 -0
  72. data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.jsx +2 -2
  73. data/app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.jsx +2 -2
  74. data/app/pb_kits/playbook/pb_date_stacked/_date_stacked.jsx +2 -2
  75. data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.jsx +2 -2
  76. data/app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.jsx +2 -2
  77. data/app/pb_kits/playbook/pb_distribution_bar/_distribution_bar.jsx +2 -2
  78. data/app/pb_kits/playbook/pb_file_upload/_file_upload.jsx +2 -2
  79. data/app/pb_kits/playbook/pb_filter/Filter/FilterBackground.jsx +2 -2
  80. data/app/pb_kits/playbook/pb_filter/docs/_filter_default.html.erb +2 -1
  81. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.jsx +2 -2
  82. data/app/pb_kits/playbook/pb_flex/_flex.jsx +2 -2
  83. data/app/pb_kits/playbook/pb_flex/_flex_item.jsx +2 -2
  84. data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +2 -1
  85. data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +2 -1
  86. data/app/pb_kits/playbook/pb_form/docs/_form_simple_form.html.erb +3 -1
  87. data/app/pb_kits/playbook/pb_form/docs/_form_simple_form_validate.html.erb +3 -1
  88. data/app/pb_kits/playbook/pb_form/form_builder.rb +1 -0
  89. data/app/pb_kits/playbook/pb_form/form_builder/date_picker_field.rb +41 -0
  90. data/app/pb_kits/playbook/pb_form_pill/_form_pill.jsx +2 -2
  91. data/app/pb_kits/playbook/pb_gauge/_gauge.html.erb +12 -0
  92. data/app/pb_kits/playbook/pb_gauge/_gauge.jsx +110 -0
  93. data/app/pb_kits/playbook/pb_gauge/_gauge.scss +11 -0
  94. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_default.html.erb +11 -0
  95. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_default.jsx +17 -0
  96. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_disable_animation.html.erb +12 -0
  97. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_disable_animation.jsx +18 -0
  98. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_full_circle.html.erb +14 -0
  99. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_full_circle.jsx +20 -0
  100. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_height.html.erb +15 -0
  101. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_height.jsx +23 -0
  102. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_live_data.jsx +40 -0
  103. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_min_max.html.erb +15 -0
  104. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_min_max.jsx +21 -0
  105. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_min_max.md +1 -0
  106. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_sizing.html.erb +26 -0
  107. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_sizing.jsx +37 -0
  108. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_sizing.md +1 -0
  109. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_title.html.erb +14 -0
  110. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_title.jsx +20 -0
  111. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_units.html.erb +29 -0
  112. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_units.jsx +29 -0
  113. data/app/pb_kits/playbook/pb_gauge/docs/example.yml +24 -0
  114. data/app/pb_kits/playbook/pb_gauge/docs/index.js +9 -0
  115. data/app/pb_kits/playbook/pb_gauge/gauge.rb +57 -0
  116. data/app/pb_kits/playbook/pb_hashtag/_hashtag.jsx +2 -2
  117. data/app/pb_kits/playbook/pb_highlight/_highlight.jsx +2 -2
  118. data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.jsx +2 -2
  119. data/app/pb_kits/playbook/pb_icon/_icon.jsx +2 -2
  120. data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.jsx +2 -2
  121. data/app/pb_kits/playbook/pb_icon_value/_icon_value.jsx +2 -2
  122. data/app/pb_kits/playbook/pb_image/_image.jsx +2 -2
  123. data/app/pb_kits/playbook/pb_kit/dateTime.js +5 -1
  124. data/app/pb_kits/playbook/pb_label_pill/_label_pill.jsx +2 -2
  125. data/app/pb_kits/playbook/pb_label_value/_label_value.jsx +2 -2
  126. data/app/pb_kits/playbook/pb_layout/_layout.jsx +6 -6
  127. data/app/pb_kits/playbook/pb_legend/_legend.jsx +2 -2
  128. data/app/pb_kits/playbook/pb_line_graph/_line_graph.jsx +2 -2
  129. data/app/pb_kits/playbook/pb_list/_list.jsx +2 -2
  130. data/app/pb_kits/playbook/pb_list/_list_item.jsx +2 -2
  131. data/app/pb_kits/playbook/pb_loading_inline/_loading_inline.jsx +2 -2
  132. data/app/pb_kits/playbook/pb_logistic/_logistic.jsx +111 -0
  133. data/app/pb_kits/playbook/pb_message/_message.jsx +2 -2
  134. data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.jsx +2 -2
  135. data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.jsx +2 -2
  136. data/app/pb_kits/playbook/pb_nav/_nav.jsx +2 -2
  137. data/app/pb_kits/playbook/pb_online_status/_online_status.jsx +2 -2
  138. data/app/pb_kits/playbook/pb_person/_person.jsx +2 -2
  139. data/app/pb_kits/playbook/pb_person_contact/_person_contact.jsx +2 -2
  140. data/app/pb_kits/playbook/pb_pill/_pill.jsx +2 -2
  141. data/app/pb_kits/playbook/pb_popover/_popover.jsx +2 -2
  142. data/app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx +5 -5
  143. data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.jsx +2 -2
  144. data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.jsx +2 -2
  145. data/app/pb_kits/playbook/pb_progress_step/_progress_step.jsx +2 -2
  146. data/app/pb_kits/playbook/pb_radio/_radio.jsx +2 -2
  147. data/app/pb_kits/playbook/pb_section_separator/_section_separator.jsx +2 -2
  148. data/app/pb_kits/playbook/pb_select/_select.jsx +2 -2
  149. data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.jsx +12 -16
  150. data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +1 -1
  151. data/app/pb_kits/playbook/pb_selectable_card/selectable_card.rb +1 -7
  152. data/app/pb_kits/playbook/pb_selectable_card_icon/_selectable_card_icon.jsx +26 -26
  153. data/app/pb_kits/playbook/pb_selectable_card_icon/_selectable_card_icon.scss +1 -1
  154. data/app/pb_kits/playbook/pb_selectable_card_icon/selectable_card_icon.rb +1 -8
  155. data/app/pb_kits/playbook/pb_selectable_icon/_selectable_icon.jsx +8 -10
  156. data/app/pb_kits/playbook/pb_selectable_icon/_selectable_icon.scss +1 -1
  157. data/app/pb_kits/playbook/pb_selectable_icon/selectable_icon.rb +1 -7
  158. data/app/pb_kits/playbook/pb_stat_change/_stat_change.jsx +2 -2
  159. data/app/pb_kits/playbook/pb_stat_value/_stat_value.jsx +2 -2
  160. data/app/pb_kits/playbook/pb_table/_table.jsx +2 -2
  161. data/app/pb_kits/playbook/pb_table/_table_row.jsx +2 -2
  162. data/app/pb_kits/playbook/pb_text_input/_text_input.jsx +2 -2
  163. data/app/pb_kits/playbook/pb_textarea/_textarea.html.erb +1 -1
  164. data/app/pb_kits/playbook/pb_textarea/_textarea.jsx +2 -2
  165. data/app/pb_kits/playbook/pb_textarea/_textarea.scss +2 -1
  166. data/app/pb_kits/playbook/pb_time/_time.jsx +57 -14
  167. data/app/pb_kits/playbook/pb_time/_time.scss +17 -0
  168. data/app/pb_kits/playbook/pb_time/docs/_time_align.jsx +27 -0
  169. data/app/pb_kits/playbook/pb_time/docs/_time_dark.jsx +28 -0
  170. data/app/pb_kits/playbook/pb_time/docs/_time_default.jsx +28 -0
  171. data/app/pb_kits/playbook/pb_time/docs/_time_timestamp.jsx +32 -0
  172. data/app/pb_kits/playbook/pb_time/docs/example.yml +4 -0
  173. data/app/pb_kits/playbook/pb_time/docs/index.js +4 -0
  174. data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.jsx +2 -2
  175. data/app/pb_kits/playbook/pb_time_stacked/_time_stacked.jsx +2 -2
  176. data/app/pb_kits/playbook/pb_timestamp/_timestamp.jsx +2 -2
  177. data/app/pb_kits/playbook/pb_title/_title.jsx +3 -6
  178. data/app/pb_kits/playbook/pb_title/_title.scss +1 -1
  179. data/app/pb_kits/playbook/pb_title/title.rb +1 -9
  180. data/app/pb_kits/playbook/pb_title_count/_title_count.jsx +2 -2
  181. data/app/pb_kits/playbook/pb_title_detail/_title_detail.jsx +2 -2
  182. data/app/pb_kits/playbook/pb_toggle/_toggle.jsx +39 -31
  183. data/app/pb_kits/playbook/pb_toggle/docs/_toggle_custom.jsx +31 -0
  184. data/app/pb_kits/playbook/pb_toggle/docs/_toggle_custom_radio.html.erb +6 -6
  185. data/app/pb_kits/playbook/pb_toggle/docs/_toggle_custom_radio.jsx +72 -0
  186. data/app/pb_kits/playbook/pb_toggle/docs/_toggle_default.html.erb +1 -3
  187. data/app/pb_kits/playbook/pb_toggle/docs/_toggle_default.jsx +6 -19
  188. data/app/pb_kits/playbook/pb_toggle/docs/_toggle_name.jsx +57 -0
  189. data/app/pb_kits/playbook/pb_toggle/docs/{_toggle_checked.html.erb → _toggle_size.html.erb} +2 -2
  190. data/app/pb_kits/playbook/pb_toggle/docs/_toggle_size.jsx +44 -0
  191. data/app/pb_kits/playbook/pb_toggle/docs/example.yml +8 -5
  192. data/app/pb_kits/playbook/pb_toggle/docs/index.js +4 -2
  193. data/app/pb_kits/playbook/pb_user/_user.jsx +2 -2
  194. data/app/pb_kits/playbook/pb_user_badge/_user_badge.jsx +2 -2
  195. data/app/pb_kits/playbook/pb_weekday_stacked/_weekday_stacked.jsx +2 -2
  196. data/app/pb_kits/playbook/plugins/pb_chart.js +74 -0
  197. data/app/pb_kits/playbook/props.rb +6 -0
  198. data/app/pb_kits/playbook/utilities/{spacing.js → globalProps.js} +14 -1
  199. data/app/pb_kits/playbook/utilities/props.js +1 -0
  200. data/app/pb_kits/playbook/vendor.js +6 -0
  201. data/lib/generators/kit/templates/kit_jsx.erb.tt +2 -2
  202. data/lib/playbook/version.rb +1 -1
  203. metadata +81 -9
  204. data/app/pb_kits/playbook/pb_toggle/docs/_toggle_accessibility.jsx +0 -12
  205. data/app/pb_kits/playbook/pb_toggle/docs/_toggle_data.jsx +0 -15
@@ -0,0 +1,101 @@
1
+ @import "../pb_button/button";
2
+ @import "../pb_button/button_mixins";
3
+ @import "../tokens/colors";
4
+
5
+ [class^=pb_button_toolbar]{
6
+ // Orientation =========
7
+ &[class*=_horizontal] {
8
+ display: inline-flex;
9
+ flex-direction: row;
10
+ align-items: center;
11
+ justify-content: flex-start;
12
+
13
+ & > [class^=pb_button] {
14
+ margin-right: $space-xs;
15
+
16
+ &:hover {
17
+ background-color:darken($royal, 20%);
18
+ }
19
+
20
+ &[class*=secondary] {
21
+ &:hover {
22
+ background-color:rgba($primary_action, $opacity_3)
23
+ }
24
+ }
25
+
26
+ &:last-child {
27
+ margin-right: 0;
28
+ }
29
+ }
30
+ }
31
+ &[class*=_vertical] {
32
+ display: inline-flex;
33
+ flex-direction: column;
34
+ align-items: flex-start;
35
+ justify-content: center;
36
+
37
+ & > [class^=pb_button] {
38
+ display: block;
39
+ flex-grow: 1;
40
+ flex-shrink: 1;
41
+ flex-basis: auto;
42
+ width: 100%;
43
+ margin-bottom: $space-xs;
44
+
45
+ &:hover {
46
+ background-color:darken($royal, 20%);
47
+ }
48
+
49
+ &[class*=secondary] {
50
+ &:hover {
51
+ background-color:rgba($primary_action, $opacity_3)
52
+ }
53
+ }
54
+
55
+ &:last-child {
56
+ margin-bottom: 0;
57
+ }
58
+ }
59
+ }
60
+
61
+ // Connect =============
62
+ &[class*=_connected] {
63
+ & > [class^=pb_button] {
64
+ margin: 0;
65
+ }
66
+
67
+ &[class*=_horizontal] {
68
+ & > [class^=pb_button] {
69
+ &:not(:last-child){
70
+ border-bottom-right-radius: 0;
71
+ border-top-right-radius: 0;
72
+ border-right-width: 0;
73
+ border: 1px solid #e1e4e8;
74
+ }
75
+ &:not(:first-child){
76
+ border-bottom-left-radius: 0;
77
+ border-top-left-radius: 0;
78
+ border-left-width: 0;
79
+ border: 1px solid #e1e4e8;
80
+ }
81
+ }
82
+ }
83
+
84
+ &[class*=_vertical] {
85
+ & > [class^=pb_button] {
86
+ &:not(:last-child){
87
+ border-bottom-right-radius: 0;
88
+ border-bottom-left-radius: 0;
89
+ border-bottom-width: 0;
90
+ border: 1px solid #e1e4e8;
91
+ }
92
+ &:not(:first-child){
93
+ border-top-right-radius: 0;
94
+ border-top-left-radius: 0;
95
+ border-top-width: 0;
96
+ border: 1px solid #e1e4e8;
97
+ }
98
+ }
99
+ }
100
+ }
101
+ }
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Playbook
4
+ module PbButtonToolbar
5
+ class ButtonToolbar
6
+ include Playbook::Props
7
+
8
+ partial "pb_button_toolbar/button_toolbar"
9
+
10
+ prop :connected, type: Playbook::Props::Boolean, default: false
11
+
12
+ prop :orientation, type: Playbook::Props::Enum,
13
+ values: %w[horizontal vertical],
14
+ default: "horizontal"
15
+
16
+ prop :text
17
+
18
+ def classname
19
+ generate_classname("pb_button_toolbar_kit", orientation, connected_class)
20
+ end
21
+
22
+ private
23
+
24
+ def connected_class
25
+ connected == true ? "connected" : nil
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,7 @@
1
+ <%= pb_rails("button_toolbar", props: { orientation: "horizontal", connected: true }) do %>
2
+ <%= pb_rails("button", props: { text: "Field" }) %>
3
+ <%= pb_rails("button", props: { text: "Retail"}) %>
4
+ <%= pb_rails("button", props: { text: "Event"}) %>
5
+ <%= pb_rails("button", props: { text: "Training"}) %>
6
+ <%= pb_rails("button", props: { text: "Not Working"}) %>
7
+ <% end %>
@@ -0,0 +1,29 @@
1
+ import React from 'react'
2
+ import { Button, ButtonToolbar } from '../..'
3
+
4
+ const ButtonToolbarDefault = () => (
5
+ <div>
6
+ <ButtonToolbar
7
+ connected
8
+ orientation="horizontal"
9
+ >
10
+ <Button
11
+ text="Field"
12
+ />
13
+ <Button
14
+ text="Retail"
15
+ />
16
+ <Button
17
+ text="Event"
18
+ />
19
+ <Button
20
+ text="Training"
21
+ />
22
+ <Button
23
+ text="Not Working"
24
+ />
25
+ </ButtonToolbar>
26
+ </div>
27
+ )
28
+
29
+ export default ButtonToolbarDefault
@@ -0,0 +1,7 @@
1
+ <%= pb_rails("button_toolbar", props: { orientation: "horizontal", connected: true }) do %>
2
+ <%= pb_rails("button", props: { text: "Field", variant: "secondary" }) %>
3
+ <%= pb_rails("button", props: { text: "Retail", variant: "secondary"}) %>
4
+ <%= pb_rails("button", props: { text: "Event", variant: "secondary"}) %>
5
+ <%= pb_rails("button", props: { text: "Training", variant: "secondary"}) %>
6
+ <%= pb_rails("button", props: { text: "Not Working", variant: "secondary"}) %>
7
+ <% end %>
@@ -0,0 +1,34 @@
1
+ import React from 'react'
2
+ import { Button, ButtonToolbar } from '../..'
3
+
4
+ const ButtonToolbarSecondary = () => (
5
+ <div>
6
+ <ButtonToolbar
7
+ connected
8
+ orientation="horizontal"
9
+ >
10
+ <Button
11
+ text="Field"
12
+ variant="secondary"
13
+ />
14
+ <Button
15
+ text="Retail"
16
+ variant="secondary"
17
+ />
18
+ <Button
19
+ text="Event"
20
+ variant="secondary"
21
+ />
22
+ <Button
23
+ text="Training"
24
+ variant="secondary"
25
+ />
26
+ <Button
27
+ text="Not Working"
28
+ variant="secondary"
29
+ />
30
+ </ButtonToolbar>
31
+ </div>
32
+ )
33
+
34
+ export default ButtonToolbarSecondary
@@ -0,0 +1,11 @@
1
+ <div class="pb--doc-demo-row">
2
+ <div>
3
+ <%= pb_rails("button_toolbar", props: { orientation: "vertical", connected: true }) do %>
4
+ <%= pb_rails("button", props: { text: "Field" }) %>
5
+ <%= pb_rails("button", props: { text: "Retail"}) %>
6
+ <%= pb_rails("button", props: { text: "Event"}) %>
7
+ <%= pb_rails("button", props: { text: "Training"}) %>
8
+ <%= pb_rails("button", props: { text: "Not Working"}) %>
9
+ <% end %>
10
+ </div>
11
+ </div>
@@ -0,0 +1,29 @@
1
+ import React from 'react'
2
+ import { Button, ButtonToolbar } from '../..'
3
+
4
+ const ButtonToolbarVertical = () => (
5
+ <div>
6
+ <ButtonToolbar
7
+ connected
8
+ orientation="vertical"
9
+ >
10
+ <Button
11
+ text="Field"
12
+ />
13
+ <Button
14
+ text="Retail"
15
+ />
16
+ <Button
17
+ text="Event"
18
+ />
19
+ <Button
20
+ text="Training"
21
+ />
22
+ <Button
23
+ text="Not Working"
24
+ />
25
+ </ButtonToolbar>
26
+ </div>
27
+ )
28
+
29
+ export default ButtonToolbarVertical
@@ -0,0 +1,11 @@
1
+ <div class="pb--doc-demo-row">
2
+ <div>
3
+ <%= pb_rails("button_toolbar", props: { orientation: "vertical", connected: true }) do %>
4
+ <%= pb_rails("button", props: { text: "Field", variant: "secondary" }) %>
5
+ <%= pb_rails("button", props: { text: "Retail", variant: "secondary" }) %>
6
+ <%= pb_rails("button", props: { text: "Event", variant: "secondary" }) %>
7
+ <%= pb_rails("button", props: { text: "Training", variant: "secondary" }) %>
8
+ <%= pb_rails("button", props: { text: "Not Working", variant: "secondary" }) %>
9
+ <% end %>
10
+ </div>
11
+ </div>
@@ -0,0 +1,34 @@
1
+ import React from 'react'
2
+ import { Button, ButtonToolbar } from '../..'
3
+
4
+ const ButtonToolbarVerticalSecondary = () => (
5
+ <div>
6
+ <ButtonToolbar
7
+ connected
8
+ orientation="vertical"
9
+ >
10
+ <Button
11
+ text="Field"
12
+ variant="secondary"
13
+ />
14
+ <Button
15
+ text="Retail"
16
+ variant="secondary"
17
+ />
18
+ <Button
19
+ text="Event"
20
+ variant="secondary"
21
+ />
22
+ <Button
23
+ text="Training"
24
+ variant="secondary"
25
+ />
26
+ <Button
27
+ text="Not Working"
28
+ variant="secondary"
29
+ />
30
+ </ButtonToolbar>
31
+ </div>
32
+ )
33
+
34
+ export default ButtonToolbarVerticalSecondary
@@ -0,0 +1 @@
1
+ This kit should primarily hold the most commonly used buttons.
@@ -0,0 +1,15 @@
1
+ examples:
2
+
3
+ rails:
4
+ - button_toolbar_default: Horizontal Button Toolbar
5
+ - button_toolbar_vertical: Vertical Button Toolbar
6
+ - button_toolbar_secondary: Horizontal Secondary Button Toolbar
7
+ - button_toolbar_vertical_secondary: Vertical Secondary Button Toolbar
8
+
9
+
10
+ react:
11
+ - button_toolbar_default: Default
12
+ - button_toolbar_vertical: Vertical Button Toolbar
13
+ - button_toolbar_secondary: Horizontal Secondary Button Toolbar
14
+ - button_toolbar_vertical_secondary: Vertical Secondary Button Toolbar
15
+
@@ -0,0 +1,4 @@
1
+ export { default as ButtonToolbarDefault } from './_button_toolbar_default.jsx'
2
+ export { default as ButtonToolbarVertical } from './_button_toolbar_vertical.jsx'
3
+ export { default as ButtonToolbarSecondary } from './_button_toolbar_secondary.jsx'
4
+ export { default as ButtonToolbarVerticalSecondary } from './_button_toolbar_vertical_secondary.jsx'
@@ -3,13 +3,12 @@
3
3
  import React from 'react'
4
4
  import classnames from 'classnames'
5
5
  import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
6
- import { spacing } from '../utilities/spacing.js'
6
+ import { globalProps } from '../utilities/globalProps.js'
7
7
 
8
8
  type CaptionProps = {
9
9
  aria?: object,
10
10
  className?: String,
11
11
  children: Array<React.ReactNode> | React.ReactNode,
12
- dark?: Boolean,
13
12
  data?: object,
14
13
  id?: String,
15
14
  size?: "xs" | "sm" | "md" | "lg" | "xl",
@@ -22,7 +21,6 @@ const Caption = (props: CaptionProps) => {
22
21
  aria = {},
23
22
  className,
24
23
  children,
25
- dark = false,
26
24
  data = {},
27
25
  id,
28
26
  size = 'md',
@@ -34,11 +32,9 @@ const Caption = (props: CaptionProps) => {
34
32
  const ariaProps = buildAriaProps(aria)
35
33
  const dataProps = buildDataProps(data)
36
34
  const css = classnames(
37
- buildCss('pb_caption_kit', size, {
38
- dark: dark,
39
- }),
35
+ buildCss('pb_caption_kit', size),
40
36
  className,
41
- spacing(props)
37
+ globalProps(props)
42
38
  )
43
39
 
44
40
  return (
@@ -10,8 +10,4 @@
10
10
  &[class^=pb_caption_kit_xs] {
11
11
  @include caption_xs;
12
12
  }
13
-
14
- &[class*=_dark] {
15
- @include caption_dark;
16
- }
17
13
  }
@@ -7,7 +7,6 @@ module Playbook
7
7
 
8
8
  partial "pb_caption/caption"
9
9
 
10
- prop :dark, type: Playbook::Props::Boolean, default: false
11
10
  prop :size, type: Playbook::Props::Enum,
12
11
  values: %w[xs sm md base lg xl],
13
12
  default: "md"
@@ -17,13 +16,7 @@ module Playbook
17
16
  prop :text
18
17
 
19
18
  def classname
20
- generate_classname("pb_caption_kit", size, dark_class)
21
- end
22
-
23
- private
24
-
25
- def dark_class
26
- dark ? "dark" : nil
19
+ generate_classname("pb_caption_kit", size)
27
20
  end
28
21
  end
29
22
  end
@@ -4,38 +4,41 @@ import React from 'react'
4
4
  import { get } from 'lodash'
5
5
  import classnames from 'classnames'
6
6
  import { buildCss } from '../utilities/props'
7
- import { spacing } from '../utilities/spacing.js'
7
+ import { globalProps } from '../utilities/globalProps.js'
8
8
 
9
9
  type CardPropTypes = {
10
+ borderNone?: Boolean,
10
11
  children: Array<React.ReactNode> | React.ReactNode,
11
12
  className?: String,
12
13
  highlight?: {
13
14
  position?: "side" | "top",
14
15
  color?: String,
15
16
  },
17
+ padding?: String,
16
18
  selected?: Boolean,
17
19
  shadow?: "none" | "deep" | "deeper" | "deepest",
18
- dark?: Boolean,
19
- borderNone?: Boolean,
20
20
  }
21
21
 
22
22
  type CardHeaderProps = {
23
+ categoryColor?: Number,
23
24
  children: Array<React.ReactNode> | React.ReactNode,
24
25
  className?: String,
25
- categoryColor?: Number,
26
+ padding?: String,
26
27
  }
27
28
 
28
29
  type CardBodyProps = {
29
30
  children: Array<React.ReactNode> | React.ReactNode | String,
30
31
  className?: String,
32
+ padding?: String,
31
33
  }
32
34
 
33
35
  // Header component
34
36
  const Header = (props: CardHeaderProps) => {
35
- const { children, className, categoryColor = 1 } = props
37
+ const { children, className, categoryColor = 1, padding = 'sm' } = props
36
38
  const headerCSS = buildCss('pb_card_header_kit', `category_${categoryColor}`)
37
39
 
38
- const headerSpacing = spacing(props) ? spacing(props) : 'p_sm'
40
+ const headerSpacing = globalProps(props, { padding })
41
+
39
42
  return (
40
43
  <div className={classnames(headerCSS, className, headerSpacing)}>
41
44
  {children}
@@ -45,9 +48,11 @@ const Header = (props: CardHeaderProps) => {
45
48
 
46
49
  // Body component
47
50
  const Body = (props: CardBodyProps) => {
48
- const { children, className } = props
51
+ const { children, className, padding = 'md' } = props
49
52
  const bodyCSS = buildCss('pb_card_body_kit')
50
- const bodySpacing = spacing(props) ? spacing(props) : 'p_md'
53
+
54
+ const bodySpacing = globalProps(props, { padding })
55
+
51
56
  return (
52
57
  <div className={classnames(bodyCSS, className, bodySpacing)}>
53
58
  {children}
@@ -57,24 +62,22 @@ const Body = (props: CardBodyProps) => {
57
62
 
58
63
  const Card = (props: CardPropTypes) => {
59
64
  const {
65
+ borderNone = false,
60
66
  children,
61
67
  className,
62
- dark = false,
63
68
  highlight = {},
64
69
  selected = false,
65
70
  shadow = 'none',
66
- borderNone = false,
71
+ padding = 'md',
67
72
  } = props
68
73
  const bodyCSS = buildCss('pb_card_body_kit')
69
74
  const borderCSS = borderNone == true ? 'border_none' : ''
70
75
  const cardCss = buildCss('pb_card_kit', `shadow_${shadow}`, `${borderCSS}`, {
71
- dark: dark,
72
76
  selected,
73
77
  deselected: !selected,
74
78
  [`highlight_${highlight.position}`]: highlight.position,
75
79
  [`highlight_${highlight.color}`]: highlight.color,
76
80
  })
77
- const cardSpacing = spacing(props) ? spacing(props) : 'p_md'
78
81
 
79
82
  // coerce to array
80
83
  const cardChildren =
@@ -91,9 +94,9 @@ const Card = (props: CardPropTypes) => {
91
94
  const nonHeaderChildren = cardChildren.filter((child) => (get(child, 'type.displayName') !== 'Header'))
92
95
 
93
96
  return (
94
- <div className={classnames(cardCss, className)}>
97
+ <div className={classnames(cardCss, globalProps(props), className)}>
95
98
  {subComponentTags('Header')}
96
- <div className={classnames(bodyCSS, cardSpacing)}>
99
+ <div className={classnames(bodyCSS, globalProps({ padding }))}>
97
100
  {nonHeaderChildren}
98
101
  </div>
99
102
  </div>