playbook_ui 14.7.0 → 14.8.0.pre.alpha.PLAY1598floatinguiupgrade4617

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +1 -0
  3. data/app/pb_kits/playbook/pb_card/docs/_card_light.md +1 -1
  4. data/app/pb_kits/playbook/pb_checkbox/checkbox.html.erb +2 -2
  5. data/app/pb_kits/playbook/pb_checkbox/checkbox.rb +0 -4
  6. data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_indeterminate.html.erb +84 -7
  7. data/app/pb_kits/playbook/pb_date/_date.scss +3 -0
  8. data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +1 -1
  9. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_default_date.html.erb +42 -0
  10. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_default_date.jsx +44 -0
  11. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_default_date.md +1 -0
  12. data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +2 -0
  13. data/app/pb_kits/playbook/pb_date_picker/docs/index.js +1 -0
  14. data/app/pb_kits/playbook/pb_date_picker/plugins/quickPick.tsx +17 -1
  15. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_default_rails.html.erb +26 -0
  16. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_default_rails.md +7 -0
  17. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards_rails.html.erb +38 -0
  18. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards_rails.md +0 -0
  19. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_list_rails.html.erb +19 -0
  20. data/app/pb_kits/playbook/pb_draggable/docs/example.yml +6 -0
  21. data/app/pb_kits/playbook/pb_draggable/draggable.html.erb +3 -0
  22. data/app/pb_kits/playbook/pb_draggable/draggable.rb +18 -0
  23. data/app/pb_kits/playbook/pb_draggable/draggable_container.html.erb +3 -0
  24. data/app/pb_kits/playbook/pb_draggable/draggable_container.rb +15 -0
  25. data/app/pb_kits/playbook/pb_draggable/draggable_item.html.erb +7 -0
  26. data/app/pb_kits/playbook/pb_draggable/draggable_item.rb +18 -0
  27. data/app/pb_kits/playbook/pb_draggable/index.js +125 -0
  28. data/app/pb_kits/playbook/pb_drawer/_drawer.scss +88 -175
  29. data/app/pb_kits/playbook/pb_drawer/_drawer.tsx +79 -47
  30. data/app/pb_kits/playbook/pb_drawer/drawer.test.jsx +20 -16
  31. data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +1 -0
  32. data/app/pb_kits/playbook/pb_dropdown/dropdown_container.html.erb +0 -1
  33. data/app/pb_kits/playbook/pb_dropdown/dropdown_container.rb +0 -4
  34. data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +2 -2
  35. data/app/pb_kits/playbook/pb_form/docs/_form_form_with_loading.html.erb +1 -1
  36. data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +63 -12
  37. data/app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_default.html.erb +2 -1
  38. data/app/pb_kits/playbook/pb_timeline/_timeline.scss +43 -1
  39. data/app/pb_kits/playbook/pb_timeline/_timeline.tsx +6 -2
  40. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_children.html.erb +47 -0
  41. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_children.jsx +59 -0
  42. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_gap.html.erb +94 -0
  43. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_gap.jsx +180 -0
  44. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_gap.md +1 -0
  45. data/app/pb_kits/playbook/pb_timeline/docs/example.yml +5 -3
  46. data/app/pb_kits/playbook/pb_timeline/docs/index.js +2 -0
  47. data/app/pb_kits/playbook/pb_timeline/timeline.rb +11 -1
  48. data/app/pb_kits/playbook/pb_timeline/timeline.test.js +4 -4
  49. data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +3 -0
  50. data/app/pb_kits/playbook/pb_typeahead/index.ts +29 -3
  51. data/app/pb_kits/playbook/pb_typeahead/typeahead.html.erb +5 -2
  52. data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +4 -0
  53. data/app/pb_kits/playbook/tokens/_height.scss +19 -0
  54. data/app/pb_kits/playbook/tokens/exports/_height.module.scss +37 -0
  55. data/app/pb_kits/playbook/utilities/_height.scss +33 -0
  56. data/app/pb_kits/playbook/utilities/_hover.scss +40 -27
  57. data/app/pb_kits/playbook/utilities/_max_width.scss +4 -0
  58. data/app/pb_kits/playbook/utilities/_min_width.scss +1 -1
  59. data/app/pb_kits/playbook/utilities/globalPropNames.mjs +0 -1
  60. data/app/pb_kits/playbook/utilities/globalProps.ts +29 -3
  61. data/app/pb_kits/playbook/utilities/test/globalProps/hover.test.js +79 -0
  62. data/dist/chunks/_typeahead-q6dSnFmE.js +22 -0
  63. data/dist/chunks/_weekday_stacked-BF7UZO3j.js +45 -0
  64. data/dist/chunks/lazysizes-B7xYodB-.js +1 -0
  65. data/dist/chunks/{lib-D-mTv-kp.js → lib-SyD3buPZ.js} +1 -1
  66. data/dist/chunks/{pb_form_validation-BkWGwJsl.js → pb_form_validation-Dt8UJgrJ.js} +1 -1
  67. data/dist/chunks/vendor.js +1 -1
  68. data/dist/menu.yml +322 -1
  69. data/dist/playbook-doc.js +1 -1
  70. data/dist/playbook-rails-react-bindings.js +1 -1
  71. data/dist/playbook-rails.js +1 -1
  72. data/dist/playbook.css +1 -1
  73. data/lib/playbook/classnames.rb +3 -0
  74. data/lib/playbook/forms/builder/typeahead_field.rb +13 -0
  75. data/lib/playbook/height.rb +29 -0
  76. data/lib/playbook/hover.rb +1 -1
  77. data/lib/playbook/kit_base.rb +16 -1
  78. data/lib/playbook/max_height.rb +29 -0
  79. data/lib/playbook/min_height.rb +29 -0
  80. data/lib/playbook/version.rb +2 -2
  81. metadata +35 -10
  82. data/dist/chunks/_typeahead-DhLic2Fe.js +0 -22
  83. data/dist/chunks/_weekday_stacked-CHPFjl8J.js +0 -45
  84. data/dist/chunks/lazysizes-DHz07jlL.js +0 -1
@@ -3,7 +3,6 @@
3
3
  class: object.classname,
4
4
  data: object.data,
5
5
  id: object.id,
6
- style: object.container_style,
7
6
  **combined_html_options) do %>
8
7
  <%= pb_rails("list", props: {ordered: false, borderless: false}) do %>
9
8
  <% if content.present? %>
@@ -7,10 +7,6 @@ module Playbook
7
7
  generate_classname("pb_dropdown_container", "close", separator: " ")
8
8
  end
9
9
 
10
- def container_style
11
- "position: absolute"
12
- end
13
-
14
10
  def data
15
11
  Hash(prop(:data)).merge(dropdown_container: true)
16
12
  end
@@ -23,7 +23,7 @@
23
23
  %>
24
24
 
25
25
  <%= pb_form_with(scope: :example, url: "", method: :get) do |form| %>
26
- <%= form.typeahead :example_user, props: { data: { typeahead_example1: true, user: {} }, placeholder: "Search for a user" } %>
26
+ <%= form.typeahead :example_typeahead, props: { data: { typeahead_example1: true, user: {} }, label: true, placeholder: "Search for a user" } %>
27
27
  <%= form.text_field :example_text_field, props: { label: true } %>
28
28
  <%= form.phone_number_field :example_phone_number_field, props: { label: "Example phone field" } %>
29
29
  <%= form.email_field :example_email_field, props: { label: true } %>
@@ -92,7 +92,7 @@
92
92
  const selectedUserData = JSON.parse(selectedUserJSON)
93
93
 
94
94
  // set the input field's value
95
- event.target.querySelector('input[name=example_user]').value = selectedUserData.login
95
+ event.target.querySelector('input[name=example_typeahead]').value = selectedUserData.login
96
96
 
97
97
  // log the selected option's dataset
98
98
  console.log('The selected user data:')
@@ -1,5 +1,5 @@
1
1
  <%= pb_form_with(scope: :example, url: "", method: :get, loading: true) do |form| %>
2
- <%= form.text_field :example_text_field, props: { label: true } %>
2
+ <%= form.text_field :example_text_field_loading, props: { label: true } %>
3
3
 
4
4
  <%= form.actions do |action| %>
5
5
  <%= action.submit %>
@@ -22,23 +22,74 @@
22
22
  %>
23
23
 
24
24
  <%= pb_form_with(scope: :example, method: :get, url: "", validate: true) do |form| %>
25
- <%= form.text_field :example_text_field, props: { label: true, required: true } %>
26
- <%= form.phone_number_field :example_phone_number_field, props: { label: "Example phone field" } %>
27
- <%= form.email_field :example_email_field, props: { label: true, required: true } %>
28
- <%= form.number_field :example_number_field, props: { label: true, required: true } %>
29
- <%= form.search_field :example_project_number, props: { label: true, required: true, validation: { pattern: "[0-9]{2}-[0-9]{5}", message: "Please enter a valid project number (example: 33-12345)." } } %>
30
- <%= form.password_field :example_password_field, props: { label: true, required: true } %>
31
- <%= form.url_field :example_url_field, props: { label: true, required: true } %>
32
- <%= form.text_area :example_text_area, props: { label: true, required: true } %>
33
- <%= form.dropdown_field :example_dropdown, props: { label: true, options: example_dropdown_options, required: true } %>
34
- <%= form.select :example_select, [ ["Yes", 1], ["No", 2] ], props: { label: true, blank_selection: "Select One...", required: true } %>
35
- <%= form.collection_select :example_collection_select, example_collection, :value, :name, props: { label: true, blank_selection: "Select One...", required: true } %>
25
+ <%= form.typeahead :example_typeahead_validation, props: { data: { typeahead_example2: true, user: {} }, label: true, placeholder: "Search for a user", required: true, validation: { message: "Please select a user." } } %>
26
+ <%= form.text_field :example_text_field_validation, props: { label: true, required: true } %>
27
+ <%= form.phone_number_field :example_phone_number_field_validation, props: { label: "Example phone field" } %>
28
+ <%= form.email_field :example_email_field_validation, props: { label: true, required: true } %>
29
+ <%= form.number_field :example_number_field_validation, props: { label: true, required: true } %>
30
+ <%= form.search_field :example_project_number_validation, props: { label: true, required: true, validation: { pattern: "[0-9]{2}-[0-9]{5}", message: "Please enter a valid project number (example: 33-12345)." } } %>
31
+ <%= form.password_field :example_password_field_validation, props: { label: true, required: true } %>
32
+ <%= form.url_field :example_url_field_validation, props: { label: true, required: true } %>
33
+ <%= form.text_area :example_text_area_validation, props: { label: true, required: true } %>
34
+ <%= form.dropdown_field :example_dropdown_validation, props: { label: true, options: example_dropdown_options, required: true } %>
35
+ <%= form.select :example_select_validation, [ ["Yes", 1], ["No", 2] ], props: { label: true, blank_selection: "Select One...", required: true } %>
36
+ <%= form.collection_select :example_collection_select_validation, example_collection, :value, :name, props: { label: true, blank_selection: "Select One...", required: true } %>
36
37
  <%= form.check_box :example_checkbox, props: { text: "Example Checkbox", label: true, required: true } %>
37
38
  <%= form.date_picker :example_date_picker_2, props: { label: true, required: true } %>
38
- <%= form.star_rating_field :example_star_rating, props: { variant: "interactive", label: true, required: true } %>
39
+ <%= form.star_rating_field :example_star_rating_validation, props: { variant: "interactive", label: true, required: true } %>
39
40
 
40
41
  <%= form.actions do |action| %>
41
42
  <%= action.submit %>
42
43
  <%= action.button props: { type: "reset", text: "Cancel", variant: "secondary" } %>
43
44
  <% end %>
44
45
  <% end %>
46
+
47
+ <!-- form.typeahead user results example template -->
48
+ <template data-typeahead-example-result-option>
49
+ <%= pb_rails("user", props: {
50
+ name: tag(:slot, name: "name"),
51
+ orientation: "horizontal",
52
+ align: "left",
53
+ avatar_url: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGP6zwAAAgcBApocMXEAAAAASUVORK5CYII=",
54
+ avatar: true
55
+ }) %>
56
+ </template>
57
+
58
+ <!-- form.typeahead JS example implementation -->
59
+ <%= javascript_tag defer: "defer" do %>
60
+ document.addEventListener("pb-typeahead-kit-search", function(event) {
61
+ if (!event.target.dataset || !event.target.dataset.typeaheadExample2) return
62
+
63
+ fetch(`https://api.github.com/search/users?q=${encodeURIComponent(event.detail.searchingFor)}`)
64
+ .then(response => response.json())
65
+ .then((result) => {
66
+ const resultOptionTemplate = document.querySelector("[data-typeahead-example-result-option]")
67
+
68
+ event.detail.setResults((result.items || []).map((user) => {
69
+ const wrapper = resultOptionTemplate.content.cloneNode(true)
70
+ wrapper.children[0].dataset.user = JSON.stringify(user)
71
+ wrapper.querySelector('slot[name="name"]').replaceWith(user.login)
72
+ wrapper.querySelector('img').dataset.src = user.avatar_url
73
+ return wrapper
74
+ }))
75
+ })
76
+ })
77
+
78
+
79
+ document.addEventListener("pb-typeahead-kit-result-option-selected", function(event) {
80
+ if (!event.target.dataset.typeaheadExample2) return
81
+
82
+ const selectedUserJSON = event.detail.selected.firstElementChild.dataset.user
83
+ const selectedUserData = JSON.parse(selectedUserJSON)
84
+
85
+ // set the input field's value
86
+ event.target.querySelector('input[name=example_typeahead_validation]').value = selectedUserData.login
87
+
88
+ // log the selected option's dataset
89
+ console.log('The selected user data:')
90
+ console.dir(selectedUserData)
91
+
92
+ // do even more with the data later - TBD
93
+ event.target.dataset.user = selectedUserJSON
94
+ })
95
+ <% end %>
@@ -6,6 +6,7 @@
6
6
  value: "selected_with_icon",
7
7
  checked: true,
8
8
  icon: true,
9
+
9
10
  }) do %>
10
11
  Selected, with icon
11
12
  <% end %>
@@ -36,4 +37,4 @@
36
37
  Disabled
37
38
  <% end %>
38
39
 
39
- </div>
40
+ </div>
@@ -8,6 +8,12 @@ $icon_margin: $space_xs/2;
8
8
  $icon_height: 28px;
9
9
  $height_from_top: $icon_height/2 - $connector_width/2;
10
10
 
11
+ // Add gap variables
12
+ $gap_xs: $height_from_top + $space_xs;
13
+ $gap_sm: $height_from_top + $space_sm;
14
+ $gap_md: $height_from_top + $space_md;
15
+ $gap_lg: $height_from_top + $space_lg;
16
+
11
17
  @mixin pb_timeline_line_solid($width, $height, $margin) {
12
18
  width: $width;
13
19
  height: $height;
@@ -156,7 +162,7 @@ $height_from_top: $icon_height/2 - $connector_width/2;
156
162
  }
157
163
  }
158
164
  }
159
- }
165
+ }
160
166
  }
161
167
  }
162
168
  &[class*=_vertical] {
@@ -266,5 +272,41 @@ $height_from_top: $icon_height/2 - $connector_width/2;
266
272
  }
267
273
  }
268
274
  }
275
+ &[class*=_gap_xs] {
276
+ [class*=pb_timeline_item_kit] {
277
+ [class=pb_timeline_item_step] {
278
+ [class=pb_timeline_item_connector] {
279
+ height: $gap_xs !important;
280
+ }
281
+ }
282
+ }
283
+ }
284
+ &[class*=_gap_sm] {
285
+ [class*=pb_timeline_item_kit] {
286
+ [class=pb_timeline_item_step] {
287
+ [class=pb_timeline_item_connector] {
288
+ height: $gap_sm !important;
289
+ }
290
+ }
291
+ }
292
+ }
293
+ &[class*=_gap_md] {
294
+ [class*=pb_timeline_item_kit] {
295
+ [class=pb_timeline_item_step] {
296
+ [class=pb_timeline_item_connector] {
297
+ height: $gap_md !important;
298
+ }
299
+ }
300
+ }
301
+ }
302
+ &[class*=_gap_lg] {
303
+ [class*=pb_timeline_item_kit] {
304
+ [class=pb_timeline_item_step] {
305
+ [class=pb_timeline_item_connector] {
306
+ height: $gap_lg !important;
307
+ }
308
+ }
309
+ }
310
+ }
269
311
  }
270
312
  }
@@ -20,6 +20,7 @@ type TimelineProps = {
20
20
  id?: string,
21
21
  orientation?: string,
22
22
  showDate?: boolean,
23
+ gap?: 'xs' | 'sm' | 'md' | 'lg' | 'none',
23
24
  } & GlobalProps
24
25
 
25
26
  const Timeline = ({
@@ -31,13 +32,16 @@ const Timeline = ({
31
32
  id,
32
33
  orientation = 'horizontal',
33
34
  showDate = false,
35
+ gap = 'none',
34
36
  ...props
35
37
  }: TimelineProps): React.ReactElement => {
36
38
  const ariaProps = buildAriaProps(aria)
37
39
  const dataProps = buildDataProps(data)
38
40
  const htmlProps = buildHtmlProps(htmlOptions)
39
41
  const dateStyle = showDate === true ? '_with_date' : ''
40
- const timelineCss = buildCss('pb_timeline_kit', `_${orientation}`, dateStyle)
42
+ const gapStyle = gap === 'none' ? '' : `gap_${gap}`
43
+ const timelineCss = buildCss('pb_timeline_kit', `${orientation}`, dateStyle, gapStyle)
44
+
41
45
  return (
42
46
  <div
43
47
  {...ariaProps}
@@ -56,4 +60,4 @@ Timeline.Step = TimelineStep
56
60
  Timeline.Label = TimelineLabel
57
61
  Timeline.Detail = TimelineDetail
58
62
 
59
- export default Timeline
63
+ export default Timeline
@@ -41,3 +41,50 @@
41
41
  }) %>
42
42
  <% end %>
43
43
  <% end %>
44
+
45
+ <br /><br /><br />
46
+
47
+ <%= pb_rails("timeline", props: {orientation: "vertical", show_date: true}) do %>
48
+ <%= pb_rails("timeline/item") do |item| %>
49
+
50
+ <% item.label do %>
51
+ <%= pb_rails("timeline/label") do %>
52
+ <%= pb_rails("title", props: { text: "Any Kit", size: 4 }) %>
53
+ <% end %>
54
+ <% end %>
55
+
56
+ <% item.step do %>
57
+ <%= pb_rails("timeline/step", props: { icon: 'user', icon_color: 'royal' }) %>
58
+ <% end %>
59
+
60
+ <% item.detail do %>
61
+ <%= pb_rails("title_detail", props: {
62
+ title: "Jackson Heights",
63
+ detail: "37-27 74th Street"
64
+ }) %>
65
+ <% end %>
66
+ <% end %>
67
+
68
+ <%= pb_rails("timeline/item", props: {icon: "map-marker-alt", icon_color: "purple", date: Date.today+1, line_style: "dotted" }) do |item| %>
69
+ <%= pb_rails("title_detail", props: {
70
+ title: "Society Hill",
71
+ detail: "72 E St Astoria"
72
+ }) %>
73
+ <% end %>
74
+
75
+ <%= pb_rails("timeline/item") do |item| %>
76
+
77
+ <% item.step do %>
78
+ <%= pb_rails("timeline/step") do %>
79
+ <%= pb_rails("pill", props: { text: "3" , variant: "success" }) %>
80
+ <% end %>
81
+ <% end %>
82
+
83
+ <% item.detail do %>
84
+ <%= pb_rails("title_detail", props: {
85
+ title: "Greenpoint",
86
+ detail: "81 Gate St Brooklyn"
87
+ }) %>
88
+ <% end %>
89
+ <% end %>
90
+ <% end %>
@@ -62,6 +62,65 @@ const TimelineWithChildren = (props) => (
62
62
  </Timeline.Detail>
63
63
  </Timeline.Item>
64
64
  </Timeline>
65
+
66
+ <br />
67
+ <br />
68
+ <br />
69
+
70
+ <Timeline orientation="vertical"
71
+ showDate
72
+ {...props}
73
+ >
74
+ <Timeline.Item lineStyle="solid"
75
+ {...props}
76
+ >
77
+ <Timeline.Label>
78
+ <Title size={4}
79
+ text='Any Kit'
80
+ />
81
+ </Timeline.Label>
82
+ <Timeline.Step icon="user"
83
+ iconColor="royal"
84
+ />
85
+ <Timeline.Detail>
86
+ <TitleDetail detail="37-27 74th Street"
87
+ title="Jackson Heights"
88
+ {...props}
89
+ />
90
+ </Timeline.Detail>
91
+ </Timeline.Item>
92
+
93
+ <Timeline.Item lineStyle="dotted"
94
+ {...props}
95
+ >
96
+ <Timeline.Label date={new Date(new Date().setDate(new Date().getDate() + 1))} />
97
+ <Timeline.Step icon="map-marker-alt"
98
+ iconColor="purple"
99
+ />
100
+ <Timeline.Detail>
101
+ <TitleDetail detail="72 E St Astoria"
102
+ title="Society Hill"
103
+ {...props}
104
+ />
105
+ </Timeline.Detail>
106
+ </Timeline.Item>
107
+
108
+ <Timeline.Item lineStyle="solid"
109
+ {...props}
110
+ >
111
+ <Timeline.Step>
112
+ <Pill text="3"
113
+ variant="success"
114
+ />
115
+ </Timeline.Step>
116
+ <Timeline.Detail>
117
+ <TitleDetail detail="81 Gate St Brooklyn"
118
+ title="Greenpoint"
119
+ {...props}
120
+ />
121
+ </Timeline.Detail>
122
+ </Timeline.Item>
123
+ </Timeline>
65
124
  </div>
66
125
  )
67
126
 
@@ -0,0 +1,94 @@
1
+ <%= pb_rails("flex", props: { justify: "evenly" }) do %>
2
+ <%= pb_rails("flex/flex_item") do %>
3
+ <%= pb_rails("timeline", props: {orientation: "vertical", gap: "xs"}) do %>
4
+ <%= pb_rails("timeline/item", props: {icon: "user", icon_color: "royal"}) do %>
5
+ <%= pb_rails("body", props: {
6
+ text: "Conversation started",
7
+ color: "light"
8
+ }) %>
9
+ <% end %>
10
+ <%= pb_rails("timeline/item", props: {icon: "check", icon_color: "teal", line_style: "dotted"}) do %>
11
+ <%= pb_rails("body", props: {
12
+ text: "Trip #12422",
13
+ color: "light"
14
+ }) %>
15
+ <% end %>
16
+ <%= pb_rails("timeline/item", props: {icon: "credit-card", icon_color: "red"}) do %>
17
+ <%= pb_rails("body", props: {
18
+ text: "Refund issue #12422",
19
+ color: "light"
20
+ }) %>
21
+ <% end %>
22
+ <% end %>
23
+ <% end %>
24
+
25
+ <%= pb_rails("flex/flex_item") do %>
26
+ <%= pb_rails("timeline", props: {orientation: "vertical", gap: "sm"}) do %>
27
+ <%= pb_rails("timeline/item", props: {icon: "user", icon_color: "royal"}) do %>
28
+ <%= pb_rails("body", props: {
29
+ text: "Conversation started",
30
+ color: "light"
31
+ }) %>
32
+ <% end %>
33
+ <%= pb_rails("timeline/item", props: {icon: "check", icon_color: "teal", line_style: "dotted"}) do %>
34
+ <%= pb_rails("body", props: {
35
+ text: "Trip #12422",
36
+ color: "light"
37
+ }) %>
38
+ <% end %>
39
+ <%= pb_rails("timeline/item", props: {icon: "credit-card", icon_color: "red"}) do %>
40
+ <%= pb_rails("body", props: {
41
+ text: "Refund issue #12422",
42
+ color: "light"
43
+ }) %>
44
+ <% end %>
45
+ <% end %>
46
+ <% end %>
47
+
48
+ <%= pb_rails("flex/flex_item") do %>
49
+ <%= pb_rails("timeline", props: {orientation: "vertical", gap: "md"}) do %>
50
+ <%= pb_rails("timeline/item", props: {icon: "user", icon_color: "royal"}) do %>
51
+ <%= pb_rails("body", props: {
52
+ text: "Conversation started",
53
+ color: "light"
54
+ }) %>
55
+ <% end %>
56
+ <%= pb_rails("timeline/item", props: {icon: "check", icon_color: "teal", line_style: "dotted"}) do %>
57
+ <%= pb_rails("body", props: {
58
+ text: "Trip #12422",
59
+ color: "light"
60
+ }) %>
61
+ <% end %>
62
+ <%= pb_rails("timeline/item", props: {icon: "credit-card", icon_color: "red"}) do %>
63
+ <%= pb_rails("body", props: {
64
+ text: "Refund issue #12422",
65
+ color: "light"
66
+ }) %>
67
+ <% end %>
68
+ <% end %>
69
+ <% end %>
70
+
71
+ <%= pb_rails("flex/flex_item") do %>
72
+ <%= pb_rails("timeline", props: {orientation: "vertical", gap: "lg"}) do %>
73
+ <%= pb_rails("timeline/item", props: {icon: "user", icon_color: "royal"}) do %>
74
+ <%= pb_rails("body", props: {
75
+ text: "Conversation started",
76
+ color: "light"
77
+ }) %>
78
+ <% end %>
79
+ <%= pb_rails("timeline/item", props: {icon: "check", icon_color: "teal", line_style: "dotted"}) do %>
80
+ <%= pb_rails("body", props: {
81
+ text: "Trip #12422",
82
+ color: "light"
83
+ }) %>
84
+ <% end %>
85
+ <%= pb_rails("timeline/item", props: {icon: "credit-card", icon_color: "red"}) do %>
86
+ <%= pb_rails("body", props: {
87
+ text: "Refund issue #12422",
88
+ color: "light"
89
+ }) %>
90
+ <% end %>
91
+ <% end %>
92
+ <% end %>
93
+ <% end %>
94
+
@@ -0,0 +1,180 @@
1
+ import React from 'react'
2
+
3
+ import Timeline from '../_timeline'
4
+ import Flex from "../../pb_flex/_flex"
5
+ import FlexItem from "../../pb_flex/_flex_item"
6
+ import Body from '../../pb_body/_body'
7
+
8
+ const TimelineWithGap = (props) => (
9
+ <div>
10
+ <Flex justify="evenly">
11
+ <FlexItem>
12
+ <Timeline
13
+ gap="xs"
14
+ orientation="vertical"
15
+ >
16
+ <Timeline.Item
17
+ icon="user"
18
+ iconColor="royal"
19
+ {...props}
20
+ >
21
+ <Body
22
+ color="light"
23
+ text="Conversation started"
24
+ {...props}
25
+ />
26
+ </Timeline.Item>
27
+ <Timeline.Item
28
+ icon="check"
29
+ iconColor="teal"
30
+ lineStyle="dotted"
31
+ {...props}
32
+ >
33
+ <Body
34
+ color="light"
35
+ text="Trip #12422"
36
+ {...props}
37
+ />
38
+ </Timeline.Item>
39
+ <Timeline.Item
40
+ icon="credit-card"
41
+ iconColor="red"
42
+ {...props}
43
+ >
44
+ <Body
45
+ color="light"
46
+ text="Refund issue #12422"
47
+ {...props}
48
+ />
49
+ </Timeline.Item>
50
+ </Timeline>
51
+ </FlexItem>
52
+ <FlexItem>
53
+ <Timeline
54
+ gap="sm"
55
+ orientation="vertical"
56
+ >
57
+ <Timeline.Item
58
+ icon="user"
59
+ iconColor="royal"
60
+ {...props}
61
+ >
62
+ <Body
63
+ color="light"
64
+ text="Conversation started"
65
+ {...props}
66
+ />
67
+ </Timeline.Item>
68
+ <Timeline.Item
69
+ icon="check"
70
+ iconColor="teal"
71
+ lineStyle="dotted"
72
+ {...props}
73
+ >
74
+ <Body
75
+ color="light"
76
+ text="Trip #12422"
77
+ {...props}
78
+ />
79
+ </Timeline.Item>
80
+ <Timeline.Item
81
+ icon="credit-card"
82
+ iconColor="red"
83
+ {...props}
84
+ >
85
+ <Body
86
+ color="light"
87
+ text="Refund issue #12422"
88
+ {...props}
89
+ />
90
+ </Timeline.Item>
91
+ </Timeline>
92
+ </FlexItem>
93
+ <FlexItem>
94
+ <Timeline
95
+ gap="md"
96
+ orientation="vertical"
97
+ >
98
+ <Timeline.Item
99
+ icon="user"
100
+ iconColor="royal"
101
+ {...props}
102
+ >
103
+ <Body
104
+ color="light"
105
+ text="Conversation started"
106
+ {...props}
107
+ />
108
+ </Timeline.Item>
109
+ <Timeline.Item
110
+ icon="check"
111
+ iconColor="teal"
112
+ lineStyle="dotted"
113
+ {...props}
114
+ >
115
+ <Body
116
+ color="light"
117
+ text="Trip #12422"
118
+ {...props}
119
+ />
120
+ </Timeline.Item>
121
+ <Timeline.Item
122
+ icon="credit-card"
123
+ iconColor="red"
124
+ lineStyle="dotted"
125
+ {...props}
126
+ >
127
+ <Body
128
+ color="light"
129
+ text="Refund issue #12422"
130
+ {...props}
131
+ />
132
+ </Timeline.Item>
133
+ </Timeline>
134
+ </FlexItem>
135
+ <FlexItem>
136
+ <Timeline
137
+ gap="lg"
138
+ orientation="vertical"
139
+ >
140
+ <Timeline.Item
141
+ icon="user"
142
+ iconColor="royal"
143
+ {...props}
144
+ >
145
+ <Body
146
+ color="light"
147
+ text="Conversation started"
148
+ {...props}
149
+ />
150
+ </Timeline.Item>
151
+ <Timeline.Item
152
+ icon="check"
153
+ iconColor="teal"
154
+ lineStyle="dotted"
155
+ {...props}
156
+ >
157
+ <Body
158
+ color="light"
159
+ text="Trip #12422"
160
+ {...props}
161
+ />
162
+ </Timeline.Item>
163
+ <Timeline.Item
164
+ icon="credit-card"
165
+ iconColor="red"
166
+ {...props}
167
+ >
168
+ <Body
169
+ color="light"
170
+ text="Refund issue #12422"
171
+ {...props}
172
+ />
173
+ </Timeline.Item>
174
+ </Timeline>
175
+ </FlexItem>
176
+ </Flex>
177
+ </div>
178
+ )
179
+
180
+ export default TimelineWithGap
@@ -0,0 +1 @@
1
+ Use the optional `gap` prop to render the timeline kit with adjusted spacing between nodes. The `gap` prop will only work when utilized with a vertical timeline. Horizontal timelines will show no difference in spacing.
@@ -1,14 +1,16 @@
1
1
  examples:
2
-
2
+
3
3
  rails:
4
4
  - timeline_default: Default
5
5
  - timeline_vertical: Vertical
6
6
  - timeline_with_date: With Date
7
7
  - timeline_with_children: With Children
8
-
9
-
8
+ - timeline_with_gap: With Gap
9
+
10
+
10
11
  react:
11
12
  - timeline_default: Default
12
13
  - timeline_vertical: Vertical
13
14
  - timeline_with_date: With Date
14
15
  - timeline_with_children: With Children
16
+ - timeline_with_gap: With Gap
@@ -2,3 +2,5 @@ export { default as TimelineDefault } from './_timeline_default.jsx'
2
2
  export { default as TimelineVertical } from './_timeline_vertical.jsx'
3
3
  export { default as TimelineWithDate } from './_timeline_with_date.jsx'
4
4
  export { default as TimelineWithChildren } from './_timeline_with_children.jsx'
5
+ export { default as TimelineWithGap } from './_timeline_with_gap.jsx'
6
+