playbook_ui 7.0.1.pre.alpha12 → 7.0.1.pre.alpha14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (156) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -6
  3. data/app/pb_kits/playbook/_playbook.scss +1 -0
  4. data/app/pb_kits/playbook/data/menu.yml +1 -1
  5. data/app/pb_kits/playbook/index.js +3 -0
  6. data/app/pb_kits/playbook/packs/examples.js +6 -0
  7. data/app/pb_kits/playbook/packs/site_styles/docs/_kit_doc.scss +22 -6
  8. data/app/pb_kits/playbook/pb_avatar/_avatar.jsx +5 -1
  9. data/app/pb_kits/playbook/pb_background/_background.html.erb +14 -0
  10. data/app/pb_kits/playbook/pb_background/_background.jsx +64 -0
  11. data/app/pb_kits/playbook/pb_background/_background.scss +15 -0
  12. data/app/pb_kits/playbook/pb_background/background.rb +36 -0
  13. data/app/pb_kits/playbook/pb_background/docs/_background_default.html.erb +41 -0
  14. data/app/pb_kits/playbook/pb_background/docs/_background_default.jsx +75 -0
  15. data/app/pb_kits/playbook/pb_background/docs/example.yml +8 -0
  16. data/app/pb_kits/playbook/pb_background/docs/index.js +1 -0
  17. data/app/pb_kits/playbook/pb_badge/_badge.jsx +4 -2
  18. data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx +1 -1
  19. data/app/pb_kits/playbook/pb_button/_button.jsx +5 -1
  20. data/app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx +5 -1
  21. data/app/pb_kits/playbook/pb_caption/_caption.jsx +2 -2
  22. data/app/pb_kits/playbook/pb_checkbox/_checkbox.jsx +5 -2
  23. data/app/pb_kits/playbook/pb_checkbox/checkbox.rb +3 -1
  24. data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_options.html.erb +10 -0
  25. data/app/pb_kits/playbook/pb_checkbox/docs/example.yml +1 -0
  26. data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.html.erb +1 -1
  27. data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.jsx +130 -0
  28. data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.scss +1 -1
  29. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_block.jsx +39 -0
  30. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.jsx +29 -0
  31. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.jsx +28 -0
  32. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_inner_sizes.jsx +117 -0
  33. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_live_data.jsx +53 -0
  34. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_rounded.jsx +30 -0
  35. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_labels.jsx +45 -0
  36. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_legend_kit.jsx +30 -0
  37. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_title.jsx +45 -0
  38. data/app/pb_kits/playbook/pb_circle_chart/docs/example.yml +11 -0
  39. data/app/pb_kits/playbook/pb_circle_chart/docs/index.js +9 -0
  40. data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx +5 -1
  41. data/app/pb_kits/playbook/pb_contact/_contact.jsx +5 -1
  42. data/app/pb_kits/playbook/pb_currency/_currency.jsx +5 -1
  43. data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.jsx +5 -1
  44. data/app/pb_kits/playbook/pb_date/date.rb +2 -1
  45. data/app/pb_kits/playbook/pb_date/docs/_date_default.html.erb +8 -1
  46. data/app/pb_kits/playbook/pb_date/docs/_date_timezone.html.erb +51 -0
  47. data/app/pb_kits/playbook/pb_date/docs/_date_timezone.md +6 -0
  48. data/app/pb_kits/playbook/pb_date/docs/_description.md +2 -0
  49. data/app/pb_kits/playbook/pb_date/docs/example.yml +1 -0
  50. data/app/pb_kits/playbook/pb_date_picker/_date_picker.jsx +7 -4
  51. data/app/pb_kits/playbook/pb_date_picker/_date_picker.scss +0 -4
  52. data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +3 -3
  53. data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.js +8 -10
  54. data/app/pb_kits/playbook/pb_date_picker/docs/{_date_picker_read_only.html.erb → _date_picker_allow_input.html.erb} +1 -1
  55. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_allow_input.jsx +13 -0
  56. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_allow_input.md +1 -0
  57. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_on_change.jsx +34 -0
  58. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_on_change.md +3 -0
  59. data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +3 -2
  60. data/app/pb_kits/playbook/pb_date_picker/docs/index.js +2 -1
  61. data/app/pb_kits/playbook/pb_date_picker/sass_partials/_calendar_input_icon.scss +1 -0
  62. data/app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.jsx +5 -1
  63. data/app/pb_kits/playbook/pb_date_stacked/_date_stacked.jsx +2 -2
  64. data/app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.jsx +5 -1
  65. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.jsx +2 -2
  66. data/app/pb_kits/playbook/pb_flex/_flex.jsx +2 -2
  67. data/app/pb_kits/playbook/pb_flex/_flex_item.jsx +1 -1
  68. data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +6 -1
  69. data/app/pb_kits/playbook/pb_form_pill/_form_pill.jsx +3 -2
  70. data/app/pb_kits/playbook/pb_gauge/_gauge.jsx +1 -1
  71. data/app/pb_kits/playbook/pb_highlight/_highlight.jsx +1 -1
  72. data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.jsx +2 -2
  73. data/app/pb_kits/playbook/pb_icon/_icon.jsx +2 -2
  74. data/app/pb_kits/playbook/pb_icon_value/_icon_value.jsx +5 -1
  75. data/app/pb_kits/playbook/pb_image/_image.jsx +5 -1
  76. data/app/pb_kits/playbook/pb_label_pill/_label_pill.jsx +5 -1
  77. data/app/pb_kits/playbook/pb_layout/_layout.jsx +4 -4
  78. data/app/pb_kits/playbook/pb_line_graph/_line_graph.jsx +1 -1
  79. data/app/pb_kits/playbook/pb_list/_list.jsx +3 -2
  80. data/app/pb_kits/playbook/pb_list/_list_item.jsx +3 -2
  81. data/app/pb_kits/playbook/pb_logistic/_logistic.jsx +5 -1
  82. data/app/pb_kits/playbook/pb_message/_message.jsx +5 -1
  83. data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.jsx +5 -2
  84. data/app/pb_kits/playbook/pb_nav/_nav.jsx +2 -2
  85. data/app/pb_kits/playbook/pb_person/_person.jsx +5 -1
  86. data/app/pb_kits/playbook/pb_person_contact/_person_contact.jsx +5 -1
  87. data/app/pb_kits/playbook/pb_popover/_popover.jsx +5 -1
  88. data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.jsx +4 -4
  89. data/app/pb_kits/playbook/pb_progress_step/_progress_step.jsx +1 -1
  90. data/app/pb_kits/playbook/pb_radio/_radio.html.erb +1 -1
  91. data/app/pb_kits/playbook/pb_radio/docs/_radio_options.html.erb +9 -0
  92. data/app/pb_kits/playbook/pb_radio/docs/example.yml +1 -0
  93. data/app/pb_kits/playbook/pb_radio/radio.rb +2 -4
  94. data/app/pb_kits/playbook/pb_section_separator/_section_separator.jsx +1 -1
  95. data/app/pb_kits/playbook/pb_select/_select.scss +1 -1
  96. data/app/pb_kits/playbook/pb_stat_change/_stat_change.jsx +2 -2
  97. data/app/pb_kits/playbook/pb_stat_value/_stat_value.jsx +3 -3
  98. data/app/pb_kits/playbook/pb_stat_value/docs/_stat_value_default.jsx +6 -1
  99. data/app/pb_kits/playbook/pb_table/_table.jsx +2 -2
  100. data/app/pb_kits/playbook/pb_text_input/_text_input.jsx +1 -1
  101. data/app/pb_kits/playbook/pb_text_input/_text_input.scss +17 -8
  102. data/app/pb_kits/playbook/pb_textarea/_textarea.jsx +1 -1
  103. data/app/pb_kits/playbook/pb_time/_time.html.erb +23 -17
  104. data/app/pb_kits/playbook/pb_time/_time.jsx +22 -13
  105. data/app/pb_kits/playbook/pb_time/_time.scss +16 -8
  106. data/app/pb_kits/playbook/pb_time/docs/_time_align.html.erb +18 -0
  107. data/app/pb_kits/playbook/pb_time/docs/_time_align.jsx +3 -3
  108. data/app/pb_kits/playbook/pb_time/docs/_time_default.html.erb +47 -3
  109. data/app/pb_kits/playbook/pb_time/docs/_time_default.jsx +33 -4
  110. data/app/pb_kits/playbook/pb_time/docs/_time_sizes.html.erb +11 -0
  111. data/app/pb_kits/playbook/pb_time/docs/_time_sizes.jsx +19 -0
  112. data/app/pb_kits/playbook/pb_time/docs/_time_timestamp.html.erb +3 -1
  113. data/app/pb_kits/playbook/pb_time/docs/_time_timestamp.jsx +0 -7
  114. data/app/pb_kits/playbook/pb_time/docs/_time_timezone.html.erb +38 -0
  115. data/app/pb_kits/playbook/pb_time/docs/_time_timezone.jsx +12 -14
  116. data/app/pb_kits/playbook/pb_time/docs/example.yml +6 -2
  117. data/app/pb_kits/playbook/pb_time/docs/index.js +1 -0
  118. data/app/pb_kits/playbook/pb_time/time.rb +14 -2
  119. data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.jsx +1 -1
  120. data/app/pb_kits/playbook/pb_time_stacked/_time_stacked.jsx +3 -3
  121. data/app/pb_kits/playbook/pb_timestamp/_timestamp.jsx +1 -1
  122. data/app/pb_kits/playbook/pb_title/_title.jsx +5 -1
  123. data/app/pb_kits/playbook/pb_title_count/_title_count.jsx +5 -1
  124. data/app/pb_kits/playbook/pb_title_detail/_title_detail.jsx +1 -1
  125. data/app/pb_kits/playbook/pb_toggle/_toggle.jsx +3 -3
  126. data/app/pb_kits/playbook/pb_toggle/_toggle.scss +41 -43
  127. data/app/pb_kits/playbook/pb_toggle/docs/example.yml +0 -2
  128. data/app/pb_kits/playbook/pb_toggle/docs/index.js +0 -1
  129. data/app/pb_kits/playbook/pb_toggle/toggle.rb +2 -2
  130. data/app/pb_kits/playbook/pb_typeahead/_typeahead.jsx +60 -0
  131. data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +20 -3
  132. data/app/pb_kits/playbook/pb_typeahead/components/Control.jsx +30 -0
  133. data/app/pb_kits/playbook/pb_typeahead/components/IndicatorsContainer.jsx +13 -0
  134. data/app/pb_kits/playbook/pb_typeahead/components/MenuList.jsx +12 -0
  135. data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.jsx +51 -0
  136. data/app/pb_kits/playbook/pb_typeahead/components/Option.jsx +34 -0
  137. data/app/pb_kits/playbook/pb_typeahead/components/Placeholder.jsx +13 -0
  138. data/app/pb_kits/playbook/pb_typeahead/components/ValueContainer.jsx +13 -0
  139. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default.jsx +22 -0
  140. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills.jsx +29 -0
  141. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async.jsx +84 -0
  142. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async_summary.jsx +45 -0
  143. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async_users.jsx +101 -0
  144. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_summary.jsx +27 -0
  145. data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +8 -2
  146. data/app/pb_kits/playbook/pb_typeahead/docs/index.js +4 -0
  147. data/app/pb_kits/playbook/pb_user_badge/_user_badge.jsx +5 -2
  148. data/app/pb_kits/playbook/plugins/pb_chart.js +1 -1
  149. data/app/pb_kits/playbook/tokens/_typography.scss +3 -3
  150. data/lib/generators/kit/templates/kit_jsx.erb.tt +1 -1
  151. data/lib/playbook/version.rb +1 -1
  152. metadata +50 -8
  153. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_read_only.jsx +0 -13
  154. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_read_only.md +0 -1
  155. data/app/pb_kits/playbook/pb_toggle/docs/_toggle_size.html.erb +0 -11
  156. data/app/pb_kits/playbook/pb_toggle/docs/_toggle_size.jsx +0 -44
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4fe0f6e73d47c5dc6e885e636aaaa37acc5354f4cffac8ba5ca8cd21fa719cf3
4
- data.tar.gz: 47814061793d8e5bb67bd90747d127033dfb8f99401cb6abc674daa98168742f
3
+ metadata.gz: 16ea9d4af0ed12b03e2eca2770ae969f3fe3a80eac71e32ec2c718dce7347c7c
4
+ data.tar.gz: 0afbc57b75a606da56ce827592fc8bd3ac54f34f0040c2cf0c31d5238422b24c
5
5
  SHA512:
6
- metadata.gz: fa54ac8af29c6fedfe23c06aeab73d1244d27c1935d4b3ef9db6a127b4d71e875ca10cf1f36c3d630a332170d165b8bb4f4cded58e96b553b4eb25e6389d2cb7
7
- data.tar.gz: 94297d8c94a6c8c99590c492cafafc868b095ce18953150f53e965aa8a576155575f5119b51cacd8d58c3fc7ea9fe340ef26dc538d9617caa0f891ff3ce14a0b
6
+ metadata.gz: c19ec8adfcfd42c65d5fc2987e715076dce6f3d9765b9b00e2e860414e8c471ecf38e4856caefb7363906cfaa94bdef22c4d64bef489093d1f601076fbf0d977
7
+ data.tar.gz: 21f2f4a836a8753d1dd9bb836e0867abedb74d098306d577d255fd87561488a896190ab343f8a978e5dfc48fdc6c1f8590799a5f2448e546975a739235eff9df
data/README.md CHANGED
@@ -9,8 +9,7 @@ Playbook is the first design system built for both Rails & React interfaces. Ins
9
9
 
10
10
  ## Getting started
11
11
 
12
- 1. Run `make install`
13
- 1. Run `make start`
12
+ 1. Run `make it`
14
13
  1. Install overcommit hooks `bin/overcommit`
15
14
  1. open [http://localhost:8089](http://localhost:8089)
16
15
 
@@ -35,10 +34,9 @@ To run the tests, do `bin/test`. To launch a shell in the container run `make sh
35
34
 
36
35
  See [docs/upgrade-guide](./docs/upgrade-guide)
37
36
 
38
- ### Nitro & Releases
37
+ ### Releases
39
38
 
40
- * [Integrating Playbook Kits into Nitro Components](https://github.com/powerhome/playbook/wiki/Integrating-Playbook-Kits-into-Nitro-Components)
41
- * [Creating Releases](https://github.com/powerhome/playbook/wiki/Releasing-a-New-Version)
39
+ * [Playbook Releases](https://github.com/powerhome/playbook/wiki/Playbook-Releases)
42
40
 
43
41
  ### Development Environment
44
42
 
@@ -63,4 +61,4 @@ See [docs/upgrade-guide](./docs/upgrade-guide)
63
61
  5. When finished, inside of the directory you want to test with playbook, run `yarn unlink playbook-ui`.
64
62
  6. Inside of your Playbook repository, run `yarn unlink`.
65
63
 
66
- Keep in mind: Styles are brought in from playbook through the rails gem, so you will not be able to test scss updates with yarn linking.
64
+ Keep in mind: Styles are brought in from playbook through the rails gem, so you will not be able to test scss updates with yarn linking.
@@ -82,3 +82,4 @@
82
82
  @import 'pb_time_stacked/time_stacked';
83
83
  @import 'pb_weekday_stacked/weekday_stacked';
84
84
  @import './utilities/spacing';
85
+
@@ -7,6 +7,7 @@ samples:
7
7
  kits:
8
8
  - avatar
9
9
  - avatar_action_button
10
+ - background
10
11
  - buttons:
11
12
  - button
12
13
  - button_toolbar
@@ -20,7 +21,6 @@ kits:
20
21
  - gauge
21
22
  - legend
22
23
  - line_graph
23
-
24
24
  - filter
25
25
  - fixed_confirmation_toast
26
26
  - flex
@@ -1,6 +1,7 @@
1
1
  // React Component JSX Imports from the React Kits
2
2
  export Avatar from './pb_avatar/_avatar.jsx'
3
3
  export AvatarActionButton from './pb_avatar_action_button/_avatar_action_button.jsx'
4
+ export Background from 'pb_background/_background.jsx'
4
5
  export Badge from './pb_badge/_badge.jsx'
5
6
  export BarGraph from './pb_bar_graph/_bar_graph.jsx'
6
7
  export Body from './pb_body/_body.jsx'
@@ -9,6 +10,7 @@ export ButtonToolbar from './pb_button_toolbar/_button_toolbar.jsx'
9
10
  export Caption from './pb_caption/_caption.jsx'
10
11
  export Card from './pb_card/_card.jsx'
11
12
  export Checkbox from './pb_checkbox/_checkbox.jsx'
13
+ export CircleChart from './pb_circle_chart/_circle_chart.jsx'
12
14
  export CircleIconButton from './pb_circle_icon_button/_circle_icon_button.jsx'
13
15
  export Contact from './pb_contact/_contact.jsx'
14
16
  export Currency from './pb_currency/_currency.jsx'
@@ -80,6 +82,7 @@ export Title from './pb_title/_title.jsx'
80
82
  export TitleCount from './pb_title_count/_title_count.jsx'
81
83
  export TitleDetail from './pb_title_detail/_title_detail.jsx'
82
84
  export Toggle from './pb_toggle/_toggle.jsx'
85
+ export Typeahead from './pb_typeahead/_typeahead.jsx'
83
86
  export User from './pb_user/_user.jsx'
84
87
  export UserBadge from './pb_user_badge/_user_badge.jsx'
85
88
  export WeekdayStacked from './pb_weekday_stacked/_weekday_stacked.jsx'
@@ -15,6 +15,7 @@ import WebpackerReact from 'webpacker-react'
15
15
  import '../pb_form/pb_form_validation'
16
16
  import * as Avatar from 'pb_avatar/docs'
17
17
  import * as AvatarActionButton from 'pb_avatar_action_button/docs'
18
+ import * as Background from 'pb_background/docs'
18
19
  import * as Badge from 'pb_badge/docs'
19
20
  import * as BarGraph from 'pb_bar_graph/docs'
20
21
  import * as Body from 'pb_body/docs'
@@ -23,6 +24,7 @@ import * as ButtonToolbar from 'pb_button_toolbar/docs'
23
24
  import * as Caption from 'pb_caption/docs'
24
25
  import * as Card from 'pb_card/docs'
25
26
  import * as Checkbox from 'pb_checkbox/docs'
27
+ import * as CircleChart from 'pb_circle_chart/docs'
26
28
  import * as CircleIconButton from 'pb_circle_icon_button/docs'
27
29
  import * as Contact from 'pb_contact/docs'
28
30
  import * as Currency from 'pb_currency/docs'
@@ -88,6 +90,7 @@ import * as TimeRangeInline from 'pb_time_range_inline/docs'
88
90
  import * as Title from 'pb_title/docs'
89
91
  import * as TitleCount from 'pb_title_count/docs'
90
92
  import * as TitleDetail from 'pb_title_detail/docs'
93
+ import * as Typeahead from 'pb_typeahead/docs'
91
94
  import * as Toggle from 'pb_toggle/docs'
92
95
  import * as User from 'pb_user/docs'
93
96
  import * as UserBadge from 'pb_user_badge/docs'
@@ -96,6 +99,7 @@ import * as WeekdayStacked from 'pb_weekday_stacked/docs'
96
99
  WebpackerReact.setup({
97
100
  ...Avatar,
98
101
  ...AvatarActionButton,
102
+ ...Background,
99
103
  ...Badge,
100
104
  ...BarGraph,
101
105
  ...Body,
@@ -104,6 +108,7 @@ WebpackerReact.setup({
104
108
  ...Caption,
105
109
  ...Card,
106
110
  ...Checkbox,
111
+ ...CircleChart,
107
112
  ...CircleIconButton,
108
113
  ...Contact,
109
114
  ...Currency,
@@ -169,6 +174,7 @@ WebpackerReact.setup({
169
174
  ...Title,
170
175
  ...TitleCount,
171
176
  ...TitleDetail,
177
+ ...Typeahead,
172
178
  ...Toggle,
173
179
  ...User,
174
180
  ...UserBadge,
@@ -47,6 +47,27 @@
47
47
 
48
48
  .pb--kit-example {
49
49
  position: relative;
50
+
51
+ // &::after {
52
+ // content: '';
53
+ // width: 100%;
54
+ // height: 4px;
55
+ // background: $border-light;
56
+ // position: absolute;
57
+ // top: 0;
58
+ // left: 0;
59
+ // }
60
+ // &.dark{
61
+ // &::after {
62
+ // display: none;
63
+ // }
64
+ // }
65
+
66
+ code {
67
+ background-color: rgba($text_lt_lighter, 0.35);
68
+ border-radius: 5px;
69
+ padding: 2px;
70
+ }
50
71
  }
51
72
 
52
73
  .pb--codeControls {
@@ -101,17 +122,12 @@
101
122
  display: none;
102
123
  overflow-x: auto;
103
124
  border-radius: 0 0 6px 6px;
125
+ background:tint($bg_dark,10);
104
126
  }
105
127
 
106
128
  &.dark_ui {
107
129
  background: none;
108
130
 
109
- .pb--kit-example {
110
-
111
- &::after {
112
- background: $border-dark;
113
- }
114
- }
115
131
  .pb--codeCopy {
116
132
  border-color: $border-dark;
117
133
  }
@@ -30,7 +30,11 @@ const Avatar = (props: AvatarProps) => {
30
30
  const { aria = {}, className, data = {}, name = null, id = id, imageUrl, size = 'md', status = null, dark = false } = props
31
31
  const dataProps = buildDataProps(data)
32
32
  const ariaProps = buildAriaProps(aria)
33
- const classes = classnames(buildCss('pb_avatar_kit', size), className, globalProps(props))
33
+ const classes = classnames(
34
+ buildCss('pb_avatar_kit', size),
35
+ globalProps(props),
36
+ className
37
+ )
34
38
 
35
39
  const initials = name && firstTwoInitials(name)
36
40
  dataProps['data-initials'] = initials
@@ -0,0 +1,14 @@
1
+ <%= content_tag(object.tag,
2
+ aria: object.aria,
3
+ data: object.data,
4
+ id: object.id) do %>
5
+ <% if object.image_url.present? %>
6
+ <div class="<%= object.classname %>" style="background-image: url(<%= object.image_url %>); background-size: cover">
7
+ <%= capture(&object.children) %>
8
+ </div>
9
+ <% else %>
10
+ <div class="<%= object.classname %>">
11
+ <%= capture(&object.children) %>
12
+ </div>
13
+ <% end %>
14
+ <% end %>
@@ -0,0 +1,64 @@
1
+ /* @flow */
2
+
3
+ import React from 'react'
4
+ import classnames from 'classnames'
5
+ import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
6
+ import { globalProps } from '../utilities/globalProps.js'
7
+
8
+ type BackgroundProps = {
9
+ aria?: object,
10
+ backgroundColor?: 'gradient' | 'dark' | 'light' | 'white',
11
+ children?: array<React.ReactNode> | React.ReactNode,
12
+ className?: string,
13
+ data?: object,
14
+ id?: string,
15
+ imageUrl?: string,
16
+ padding?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl',
17
+ tag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'div',
18
+ }
19
+
20
+ const Background = (props: BackgroundProps) => {
21
+ const {
22
+ aria = {},
23
+ backgroundColor = 'light',
24
+ children,
25
+ className,
26
+ data = {},
27
+ id,
28
+ imageUrl = '',
29
+ padding = 'md',
30
+ tag = 'div',
31
+ } = props
32
+
33
+ const ariaProps = buildAriaProps(aria)
34
+ const dataProps = buildDataProps(data)
35
+ const classes = classnames(buildCss('pb_background_kit'), className, globalProps(props, { padding }))
36
+ const Tag = `${tag}`
37
+ const backgroundStyle = {
38
+ backgroundImage: `url(${imageUrl})`,
39
+ backgroundSize: 'cover',
40
+ }
41
+
42
+ return (
43
+ <Tag
44
+ {...ariaProps}
45
+ {...dataProps}
46
+ id={id}
47
+ >
48
+ <If condition={imageUrl}>
49
+ <div
50
+ className={classes + 'lazyload blur_up'}
51
+ style={backgroundStyle}
52
+ >
53
+ { children }
54
+ </div>
55
+ <Else />
56
+ <div className={classes + `bg_${backgroundColor}`}>
57
+ { children }
58
+ </div>
59
+ </If>
60
+ </Tag>
61
+ )
62
+ }
63
+
64
+ export default Background
@@ -0,0 +1,15 @@
1
+ [class^=pb_background_kit] {
2
+ max-width: 100%;
3
+ max-height: 100%;
4
+
5
+ .blur_up {
6
+ -webkit-filter: blur(6px);
7
+ filter: blur(6px);
8
+ transition: filter 550ms, -webkit-filter 550ms;
9
+ }
10
+
11
+ .blur_up.lazyloaded {
12
+ -webkit-filter: blur(0);
13
+ filter: blur(0);
14
+ }
15
+ }
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Playbook
4
+ module PbBackground
5
+ class Background
6
+ include Playbook::Props
7
+
8
+ partial "pb_background/background"
9
+
10
+ prop :background_color, type: Playbook::Props::Enum,
11
+ values: %w[gradient dark light white],
12
+ default: "light"
13
+ prop :image_url
14
+ prop :padding, type: Playbook::Props::Enum,
15
+ values: %w[none xs sm md lg xl],
16
+ default: "md"
17
+ prop :tag, type: Playbook::Props::Enum,
18
+ values: %w[h1 h2 h3 h4 h5 h6 p div span],
19
+ default: "div"
20
+
21
+ def classname
22
+ generate_classname("pb_background_kit", image_classname, background_color_classname, padding, separator: " ")
23
+ end
24
+
25
+ private
26
+
27
+ def image_classname
28
+ image_url.present? ? "lazyload blur_up" : ""
29
+ end
30
+
31
+ def background_color_classname
32
+ !image_url.present? ? "bg_#{background_color}" : ""
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,41 @@
1
+ <%= pb_rails("background", props: { background_color: "gradient" }) do %>
2
+ Background Kit Gradient Color
3
+ <% end %>
4
+
5
+ <%= pb_rails("background", props: { background_color: "dark" }) do %>
6
+ <%= pb_rails("flex", props: { horizontal: "center"}) do %>
7
+ <%= pb_rails("flex/flex_item") do %>
8
+ <%= pb_rails("title", props: { dark: true, size: 2, text: "Background Kit Dark" })%>
9
+ <% end %>
10
+ <% end %>
11
+ <% end %>
12
+
13
+ <%= pb_rails("background", props: { background_color: "light", padding: "xl" }) do %>
14
+ <%= pb_rails("flex", props: { horizontal: "right"}) do %>
15
+ <%= pb_rails("flex/flex_item") do %>
16
+ <%= pb_rails("body", props: { text: "Background Kit Light" })%>
17
+ <% end %>
18
+ <% end %>
19
+ <% end %>
20
+
21
+ <%= pb_rails("background", props: { background_color: "white", padding: "lg" }) do %>
22
+ <%= pb_rails("flex") do %>
23
+ <%= pb_rails("flex/flex_item") do %>
24
+ <%= pb_rails("title", props: { size: 3, text: "Background Kit White" })%>
25
+ <% end %>
26
+ <% end %>
27
+ <% end %>
28
+
29
+ <%= pb_rails("background", props: { image_url: "https://images.unsplash.com/photo-1528459801416-a9e53bbf4e17?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1000&q=80", padding: "lg" }) do %>
30
+ <%= pb_rails("flex", props: { horizontal: "center", orientation: "column" }) do %>
31
+ <%= pb_rails("flex/flex_item") do %>
32
+ <%= pb_rails("title", props: { dark: true, size: 1, text: "Background Kit Image" })%>
33
+ <% end %>
34
+ <%= pb_rails("flex/flex_item", props: { padding: "lg" }) do %>
35
+ <%= pb_rails("card", props: { shadow: "deepest" }) do %>
36
+ We cannot seek achievement for ourselves and forget about progress and prosperity for our community... Our ambitions must be broad enough to include the aspirations and needs of others, for their sakes and for our own.
37
+ -Cesar Chavez
38
+ <% end %>
39
+ <% end %>
40
+ <% end %>
41
+ <% end %>
@@ -0,0 +1,75 @@
1
+ import React from 'react'
2
+ import { Background } from '../../'
3
+ import { Body, Card, Flex, FlexItem, Title } from '../../'
4
+
5
+ const BackgroundDefault = () => (
6
+ <div>
7
+ <Background
8
+ backgroundColor="gradient"
9
+ >
10
+ {'Background Kit Gradient Color'}
11
+ </Background>
12
+ <Background
13
+ backgroundColor="dark"
14
+ >
15
+ <Flex
16
+ horizontal="center"
17
+ orientation="row"
18
+ >
19
+ <FlexItem>
20
+ <Title
21
+ dark
22
+ size={2}
23
+ text="Background Kit Dark"
24
+ />
25
+ </FlexItem>
26
+ </Flex>
27
+ </Background>
28
+ <Background
29
+ backgroundColor="light"
30
+ padding="xl"
31
+ >
32
+ <Flex
33
+ horizontal="right"
34
+ orientation="row"
35
+ >
36
+ <FlexItem>
37
+ <Body
38
+ text="Background Kit Light"
39
+ />
40
+ </FlexItem>
41
+ </Flex>
42
+ </Background>
43
+ <Background
44
+ backgroundColor="white"
45
+ padding="lg"
46
+ >
47
+ <Title
48
+ size={3}
49
+ text="Background Kit White"
50
+ />
51
+ </Background>
52
+ <Background imageUrl="https://images.unsplash.com/photo-1528459801416-a9e53bbf4e17?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1000&q=80">
53
+ <Flex
54
+ orientation="column"
55
+ vertical="center"
56
+ >
57
+ <FlexItem>
58
+ <Title
59
+ dark
60
+ padding="lg"
61
+ size={1}
62
+ text="Background Kit Image"
63
+ />
64
+ </FlexItem>
65
+ <FlexItem padding="lg">
66
+ <Card shadow="deepest">
67
+ {'We cannot seek achievement for ourselves and forget about progress and prosperity for our community... Our ambitions must be broad enough to include the aspirations and needs of others, for their sakes and for our own. - Cesar Chavez'}
68
+ </Card>
69
+ </FlexItem>
70
+ </Flex>
71
+ </Background>
72
+ </div>
73
+ )
74
+
75
+ export default BackgroundDefault