playbook_ui 5.1.0.pre.alpha4 → 5.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/clark.jpg +0 -0
  3. data/app/assets/images/giant.jpg +0 -0
  4. data/app/assets/images/pb-caret.svg +1 -0
  5. data/app/assets/images/pb-check.svg +11 -0
  6. data/app/assets/images/pb.logo.svg +28 -0
  7. data/app/controllers/playbook/application_controller.rb +13 -0
  8. data/app/controllers/playbook/guides_controller.rb +11 -0
  9. data/app/controllers/playbook/pages_controller.rb +79 -0
  10. data/app/controllers/playbook/samples_controller.rb +40 -0
  11. data/app/pb_kits/playbook/config/_kit_example.html.erb +9 -0
  12. data/app/pb_kits/playbook/config/_kit_samples_list.html.erb +3 -0
  13. data/app/pb_kits/playbook/config/_kit_ui.html.erb +40 -0
  14. data/app/pb_kits/playbook/config/_pb_kit_api.html.erb +18 -0
  15. data/app/pb_kits/playbook/data/menu.yml +93 -0
  16. data/app/pb_kits/playbook/index.js +0 -4
  17. data/app/pb_kits/playbook/packs/application.js +55 -0
  18. data/app/pb_kits/playbook/packs/examples.js +174 -0
  19. data/app/pb_kits/playbook/packs/main.scss +12 -0
  20. data/app/pb_kits/playbook/packs/samples.js +19 -0
  21. data/app/pb_kits/playbook/packs/site_styles/_samples.scss +72 -0
  22. data/app/pb_kits/playbook/packs/site_styles/_scaffold.scss +43 -0
  23. data/app/pb_kits/playbook/packs/site_styles/_site-style.scss +135 -0
  24. data/app/pb_kits/playbook/packs/site_styles/docs/_all.scss +9 -0
  25. data/app/pb_kits/playbook/packs/site_styles/docs/_code_snippet.scss +531 -0
  26. data/app/pb_kits/playbook/packs/site_styles/docs/_color_utilities.scss +92 -0
  27. data/app/pb_kits/playbook/packs/site_styles/docs/_flex_examples.scss +15 -0
  28. data/app/pb_kits/playbook/packs/site_styles/docs/_kit_doc.scss +190 -0
  29. data/app/pb_kits/playbook/packs/site_styles/docs/_kits_examples.scss +18 -0
  30. data/app/pb_kits/playbook/packs/site_styles/docs/_markdown.scss +82 -0
  31. data/app/pb_kits/playbook/packs/site_styles/docs/_spacing_tokens.scss +72 -0
  32. data/app/pb_kits/playbook/pb_filter/docs/_description.md +3 -0
  33. data/app/pb_kits/playbook/pb_filter/templates/_default.html.erb +1 -1
  34. data/app/pb_kits/playbook/pb_popover/_popover.html.erb +2 -2
  35. data/app/pb_kits/playbook/pb_popover/_popover.jsx +3 -3
  36. data/app/pb_kits/playbook/pb_popover/_popover.scss +25 -21
  37. data/app/pb_kits/playbook/pb_popover/index.js +6 -1
  38. data/app/pb_kits/playbook/pb_radio/_radio.scss +4 -0
  39. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default.html.erb +1 -1
  40. data/app/views/layouts/playbook/_mobile_hamburger.html.erb +2 -0
  41. data/app/views/layouts/playbook/_nav.html.erb +13 -0
  42. data/app/views/layouts/playbook/_sidebar.html.erb +52 -0
  43. data/app/views/layouts/playbook/application.html.slim +22 -0
  44. data/app/views/layouts/playbook/fullscreen.html.slim +10 -0
  45. data/app/views/layouts/playbook/grid.html.slim +10 -0
  46. data/app/views/layouts/playbook/samples.html.erb +18 -0
  47. data/app/views/playbook/guides/create_kit.html.slim +16 -0
  48. data/app/views/playbook/guides/create_kit/_file_naming.html.md +2 -0
  49. data/app/views/playbook/guides/create_kit/_generator.html.md +6 -0
  50. data/app/views/playbook/guides/create_kit/_kit_examples.html.md +2 -0
  51. data/app/views/playbook/guides/create_kit/_kit_rails.html.md +2 -0
  52. data/app/views/playbook/guides/create_kit/_kit_react.html.md +2 -0
  53. data/app/views/playbook/guides/create_kit/_layout.html.md +2 -0
  54. data/app/views/playbook/guides/create_kit/_view_objects.html.md +2 -0
  55. data/app/views/playbook/guides/create_kit/_writing_sass.md +10 -0
  56. data/app/views/playbook/guides/use_nitro.html.slim +6 -0
  57. data/app/views/playbook/guides/use_nitro/_local.html.md +2 -0
  58. data/app/views/playbook/guides/use_nitro/_nitro_components.html.md +2 -0
  59. data/app/views/playbook/guides/use_nitro/_versions.html.md +2 -0
  60. data/app/views/playbook/pages/fullscreen.html.slim +10 -0
  61. data/app/views/playbook/pages/grid.html.slim +2 -0
  62. data/app/views/playbook/pages/home.html.slim +4 -0
  63. data/app/views/playbook/pages/kit_category_show.html.erb +14 -0
  64. data/app/views/playbook/pages/kit_show.html.erb +33 -0
  65. data/app/views/playbook/pages/kits.html.erb +12 -0
  66. data/app/views/playbook/pages/principals/_getting_started.html.md +30 -0
  67. data/app/views/playbook/pages/principles.html.slim +3 -0
  68. data/app/views/playbook/pages/tokens.html.slim +15 -0
  69. data/app/views/playbook/pages/tokens/_pb_doc_spacing.html.slim +17 -0
  70. data/app/views/playbook/pages/utilities.html.slim +116 -0
  71. data/app/views/playbook/pages/utilities/_pb_doc_color.html.slim +15 -0
  72. data/app/views/playbook/samples/dashboards/index.html.erb +81 -0
  73. data/app/views/playbook/samples/dashboards/index.jsx +130 -0
  74. data/app/views/playbook/samples/filter_table/index.html.erb +348 -0
  75. data/app/views/playbook/samples/filter_table/index.jsx +433 -0
  76. data/app/views/playbook/samples/registration/index.html.erb +316 -0
  77. data/app/views/playbook/samples/registration/index.jsx +476 -0
  78. data/app/views/playbook/samples/sample_show.html.erb +36 -0
  79. data/lib/playbook/version.rb +1 -1
  80. data/lib/tasks/pb_release.rake +0 -3
  81. metadata +74 -7
  82. data/app/pb_kits/playbook/tokens/index.scss +0 -12
@@ -0,0 +1,3 @@
1
+ **Note**
2
+ This kit can be implemented in a variety of ways.
3
+ To see examples of how to implement this kit in production visit the **/dev_docs/search** page in production.
@@ -7,7 +7,7 @@
7
7
  <% end %>
8
8
 
9
9
  <% if object.template != "sort_only"%>
10
- <%= pb_rails("popover", props: {close_on_click: "outside", trigger_element_id: "filter#{object.id}", tooltip_id: "filter-form#{object.id}", position: 'bottom', padding: 'none'}) do %>
10
+ <%= pb_rails("popover", props: {close_on_click: "outside", trigger_element_id: "filter#{object.id}", tooltip_id: "filter-form#{object.id}", position: 'bottom'}) do %>
11
11
  <%= capture(&object.children) %>
12
12
  <% end %>
13
13
  <%end%>
@@ -2,8 +2,8 @@
2
2
  id: object.id,
3
3
  data: object.data,
4
4
  class: object.classname) do %>
5
- <div class="popover_tooltip" id="<%= object.tooltip_id %>" role="tooltip" style="<%= object.z_index_helper %>">
6
- <div class="popover_body <%= object.popover_spacing_helper %>" style="<%= object.width_height_helper %>">
5
+ <div class="pb_popover_tooltip" id="<%= object.tooltip_id %>" role="tooltip" style="<%= object.z_index_helper %>">
6
+ <div class="pb_popover_body <%= object.popover_spacing_helper %>" style="<%= object.width_height_helper %>">
7
7
  <%= capture(&object.children) %>
8
8
  </div>
9
9
  </div>
@@ -90,12 +90,12 @@ const Popover = (props: PbPopoverProps) => {
90
90
  >
91
91
  <div
92
92
  className={classnames(
93
- `${buildCss('popover_tooltip')} show`
93
+ `${buildCss('pb_popover_tooltip')} show`
94
94
  )}
95
95
  >
96
96
  <div
97
97
  className={classnames(
98
- 'popover_body',
98
+ 'pb_popover_body',
99
99
  popoverSpacing
100
100
  )}
101
101
  style={widthHeightStyles()}
@@ -128,7 +128,7 @@ export default class PbReactPopover extends React.Component {
128
128
 
129
129
  document.body.addEventListener('click', ({ target }) => {
130
130
  const targetIsPopover =
131
- target.closest('[class^=popover_tooltip]') !== null
131
+ target.closest('[class^=pb_popover_tooltip]') !== null
132
132
  const targetIsReference =
133
133
  target.closest('.pb_popover_reference_wrapper') !== null
134
134
 
@@ -19,34 +19,38 @@
19
19
  to {
20
20
  opacity: 0;
21
21
  }
22
+ .pb_popover_body {
23
+ @include pb_card;
24
+ border: 0;
25
+ box-shadow: $shadow_deeper;
26
+ overflow: auto;
27
+ }
22
28
  }
23
29
 
24
- [class^="pb_popover_kit"] {
25
- .popover_tooltip {
26
- opacity: 0;
27
- animation-name: fadeOut;
30
+ .pb_popover_tooltip {
31
+ opacity: 0;
32
+ animation-name: fadeOut;
33
+ animation-duration: 150ms;
34
+ animation-timing-function: linear;
35
+ animation-fill-mode: forwards;
36
+ visibility: hidden;
37
+ pointer-events: none;
38
+ &.show {
39
+ animation-name: fadeIn;
28
40
  animation-duration: 150ms;
29
41
  animation-timing-function: linear;
30
42
  animation-fill-mode: forwards;
31
- visibility: hidden;
32
- pointer-events: none;
33
- &.show {
34
- animation-name: fadeIn;
35
- animation-duration: 150ms;
36
- animation-timing-function: linear;
37
- animation-fill-mode: forwards;
38
- visibility: visible;
39
- pointer-events: initial;
40
- z-index: $z_9;
41
- }
42
- }
43
- .popover_body {
44
- @include pb_card;
45
- border: 0;
46
- box-shadow: $shadow_deeper;
47
- overflow: auto;
43
+ visibility: visible;
44
+ pointer-events: initial;
45
+ z-index: $z_9;
48
46
  }
49
47
  }
48
+ .pb_popover_body {
49
+ @include pb_card;
50
+ border: 0;
51
+ box-shadow: $shadow_deeper;
52
+ overflow: auto;
53
+ }
50
54
 
51
55
 
52
56
  .pb_popover_reference_wrapper {
@@ -8,7 +8,12 @@ export default class PbPopover extends PbEnhancedElement {
8
8
  return '[data-pb-popover-kit]'
9
9
  }
10
10
 
11
+ moveTooltip() {
12
+ document.querySelector('body').appendChild(this.tooltip)
13
+ }
14
+
11
15
  connect() {
16
+ this.moveTooltip()
12
17
  this.popper = createPopper(this.triggerElement, this.tooltip, {
13
18
  placement: this.position,
14
19
  strategy: 'fixed',
@@ -31,7 +36,7 @@ export default class PbPopover extends PbEnhancedElement {
31
36
  }
32
37
 
33
38
  setTimeout(() => {
34
- // this.popper.scheduleUpdate()
39
+ this.popper.update()
35
40
  this.tooltip.classList.toggle('show')
36
41
  }, 0)
37
42
  })
@@ -8,6 +8,7 @@
8
8
 
9
9
  .pb_radio_button {
10
10
  width: 22px;
11
+ min-width: 22px;
11
12
  height: 22px;
12
13
  border-radius: 1000px;
13
14
  border: 2px solid $border_light;
@@ -29,6 +30,9 @@
29
30
  }
30
31
  }
31
32
  &[class*=_dark] {
33
+ .pb_radio_button {
34
+ border-color: $border_dark;
35
+ }
32
36
  input:checked ~ .pb_radio_button {
33
37
  border: 6px solid $primary;
34
38
  }
@@ -46,6 +46,6 @@
46
46
  if (!event.target.dataset.typeaheadExample) return;
47
47
 
48
48
  document.querySelector("[data-typeahead-example-selected-option] [data-selected-option]").innerHTML = ""
49
- document.querySelector("[data-typeahead-example-selected-option] [data-selected-option]").appendChild(event.detail.selected)
49
+ document.querySelector("[data-typeahead-example-selected-option] [data-selected-option]").innerHTML = event.detail.selected.innerHTML
50
50
  })
51
51
  <% end %>
@@ -0,0 +1,2 @@
1
+ <%= pb_rails("icon", props: { icon: "bars", classname: "pb--page--hamburger" }) %>
2
+ <input type="checkbox" class="pb--page--checkbox" />
@@ -0,0 +1,13 @@
1
+ <div class="pb--page--topNav">
2
+ <h1>
3
+ <%= link_to root_url do %>
4
+ <%= image_tag("pb.logo.svg") %>
5
+ <% end %>
6
+ &nbsp;
7
+ <%= pb_rails("caption", props: { tag: "span", text: Playbook::VERSION }) %>
8
+ </h1>
9
+ </div>
10
+ <% flash.each do |name, msg| %>
11
+ <% name = "success" if name == "notice" %>
12
+ <%= pb_rails("fixed_confirmation_toast", props: { text: msg, status: name }) %>
13
+ <% end %>
@@ -0,0 +1,52 @@
1
+ <br>
2
+ <%= pb_rails("nav", props: {
3
+ title: "Kits",
4
+ link: all_link(@type),
5
+ variant: "subtle"
6
+ }) do %>
7
+ <% pb_rails("nav/item", props: {
8
+ text: "All",
9
+ link: all_link(@type),
10
+ active: all_active(controller_name, action_name)
11
+ }) %>
12
+ <% MENU["kits"].each do |link| %>
13
+ <% if link.is_a?(Hash) %>
14
+ <div class="category_section">
15
+ <%= pb_rails("nav/item", props: {
16
+ active: category_active(@category, link),
17
+ classname: "category",
18
+ icon_right: "angle-down",
19
+ link: category_link(@type, link)
20
+ }) do %>
21
+ <%= pb_kit_title(nav_hash_category(link)) %>
22
+ <% end %>
23
+ <%= pb_rails("nav", props: { variant: "subtle", classname: "sub_category"}) do %>
24
+ <% nav_hash_array(link).each do |sub_link| %>
25
+ <%= pb_rails("nav/item", props: {
26
+ text: pb_kit_title(sub_link),
27
+ link: sub_category_link(@type, sub_link),
28
+ active: sub_category_active(@kit, sub_link)
29
+ }) %>
30
+ <% end %>
31
+ <% end %>
32
+ </div>
33
+ <% else %>
34
+ <%= pb_rails("nav/item", props: {
35
+ text: pb_kit_title(link),
36
+ link: kit_link(@type, link),
37
+ active: kit_active(@kit, link)
38
+ }) %>
39
+ <% end %>
40
+ <% end %>
41
+ <% end %>
42
+ <br>
43
+ <%= pb_rails("section_separator") %>
44
+ <br>
45
+ <%= pb_rails("nav", props: {title: "Tokens", link: utilities_path}) do %>
46
+ <% color_active = (controller_name == 'pages' && action_name == 'utilities') ? true : false %>
47
+ <%= pb_rails("nav/item", props: { text: "Colors", link: utilities_path, active: color_active }) %>
48
+ <% spacing_active = (controller_name == 'pages' && action_name == 'tokens') ? true : false %>
49
+ <%= pb_rails("nav/item", props: { text: "Spacing", link: tokens_path, active: spacing_active }) %>
50
+ <% end %>
51
+ <br>
52
+ <br>
@@ -0,0 +1,22 @@
1
+ doctype html
2
+ html
3
+ head
4
+ title Playbook Design System
5
+ = csrf_meta_tags
6
+ = csp_meta_tag
7
+ = stylesheet_packs_with_chunks_tag 'main'
8
+ meta content="user-scalable=0, initial-scale=1.0, minimum-scale=1" name="viewport"
9
+
10
+ body
11
+ = render 'layouts/playbook/nav'
12
+ = pb_rails("layout", props: {classname: "pb--page--content"})
13
+ = render 'layouts/playbook/mobile_hamburger'
14
+ = pb_rails("layout/sidebar", props: { classname: "pb--page--sideNav" })
15
+ = render 'layouts/playbook/sidebar'
16
+ = pb_rails("layout/body")
17
+ .pb--page--content--main
18
+ = yield
19
+
20
+ = javascript_include_tag "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js"
21
+ = javascript_packs_with_chunks_tag 'application', 'examples'
22
+ = yield :pb_js
@@ -0,0 +1,10 @@
1
+ doctype html
2
+ html
3
+ head
4
+ title Playbook Design System
5
+ = csrf_meta_tags
6
+ = csp_meta_tag
7
+ = stylesheet_packs_with_chunks_tag 'main'
8
+ = javascript_packs_with_chunks_tag 'application'
9
+ body
10
+ = yield
@@ -0,0 +1,10 @@
1
+ doctype html
2
+ html
3
+ head
4
+ title Playbook Design System
5
+ = csrf_meta_tags
6
+ = csp_meta_tag
7
+ = stylesheet_packs_with_chunks_tag 'main'
8
+ = javascript_packs_with_chunks_tag 'application'
9
+ body
10
+ = yield
@@ -0,0 +1,18 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Full Screen Examples</title>
5
+ <%= csrf_meta_tags %>
6
+ <%= csp_meta_tag %>
7
+ <%= stylesheet_packs_with_chunks_tag 'main' %>
8
+ </head>
9
+ <body>
10
+ <div class="sample-layout">
11
+ <%= yield %>
12
+ </div>
13
+ </body>
14
+
15
+ <%= javascript_include_tag "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js" %>
16
+ <%= javascript_packs_with_chunks_tag 'application', 'examples', 'samples' %>
17
+ <%= yield :pb_js %>
18
+ </html>
@@ -0,0 +1,16 @@
1
+ .markdown
2
+ = render 'playbook/guides/create_kit/generator'
3
+ br
4
+ = render 'playbook/guides/create_kit/view_objects'
5
+ br
6
+ = render 'playbook/guides/create_kit/kit_rails'
7
+ br
8
+ = render 'playbook/guides/create_kit/kit_react'
9
+ br
10
+ = render 'playbook/guides/create_kit/kit_examples'
11
+ br
12
+ = render 'playbook/guides/create_kit/file_naming'
13
+ br
14
+ = render 'playbook/guides/create_kit/layout'
15
+ br
16
+ = render 'playbook/guides/create_kit/writing_sass'
@@ -0,0 +1,2 @@
1
+ ## File Naming
2
+ How files should be named
@@ -0,0 +1,6 @@
1
+ ## Kit Generator
2
+ Create a basic kit through the generator to speed up kit development.
3
+
4
+ ```
5
+ rails g kit my_new_kit
6
+ ```
@@ -0,0 +1,2 @@
1
+ ## Examples
2
+ Understand how to create examples
@@ -0,0 +1,2 @@
1
+ ## Rails Partial
2
+ How to setup kit partial
@@ -0,0 +1,2 @@
1
+ ## React Component
2
+ How to setup kit component for react
@@ -0,0 +1,2 @@
1
+ ## Layout and structure
2
+ A a kit should be able to function without external utility classes and libraries. A kit should handle layout for it’s children.
@@ -0,0 +1,2 @@
1
+ ## View Objects
2
+ Understanding view objects
@@ -0,0 +1,10 @@
1
+ ## Writing Sass
2
+ ---
3
+ #### Class names, chaining, and SASS
4
+ A kit should be named using prefixed complex classes to try and avoid naming collision and style bleed. Class chaining should be avoided if possible.
5
+
6
+ ---
7
+
8
+ 1. Use extend a class using & when possible and avoid class chaining when possible.
9
+ 2. When you must use a chained class try to avoid setting multiple properties.
10
+ 3. If your using chained classes have simple names make sure they don't collide with our utilities, and try to nest them under a parent class to avoid bleed
@@ -0,0 +1,6 @@
1
+ .markdown
2
+ = render 'playbook/guides/use_nitro/nitro_components'
3
+ br
4
+ = render 'playbook/guides/use_nitro/local'
5
+ br
6
+ = render 'playbook/guides/use_nitro/versions'
@@ -0,0 +1,2 @@
1
+ ## Local Development
2
+ How to use on local development environment
@@ -0,0 +1,2 @@
1
+ ## Nitro Components
2
+ How to add to Nitro Component
@@ -0,0 +1,2 @@
1
+ ## Versions
2
+ How to update version
@@ -0,0 +1,10 @@
1
+ = pb_rails("layout", props: {full: true, size: "md"})
2
+ = pb_rails("layout/sidebar")
3
+ h1 Sidebar
4
+ = pb_rails("layout/body")
5
+
6
+ = pb_rails("layout", props: {position: "right", size: "xl", collapse: "xl", full: true})
7
+ = pb_rails("layout/sidebar")
8
+ h1 Sidebar
9
+ = pb_rails("layout/body")
10
+ h1 Body
@@ -0,0 +1,2 @@
1
+ h1 Grid Test Example
2
+ = pb_react("image", props: {"url": "https://images.unsplash.com/photo-1546554137-f86b9593a222?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=634&q=80"})
@@ -0,0 +1,4 @@
1
+
2
+ / PagesController.action_methods
3
+
4
+ h1 Welcome to Playbook
@@ -0,0 +1,14 @@
1
+ <div class="pb--kits">
2
+ <%= pb_rails("title", props: { text: pb_kit_title(@category), tag: "h1", size: 1 }) %>
3
+ <br>
4
+ <div class="pb--kit-type-nav">
5
+ <%= pb_rails("nav", props: { orientation: "horizontal" }) do %>
6
+ <%= pb_rails("nav/item", props: { text: "Rails", link: kit_category_show_path(@category, type: 'rails'), active: @type == 'rails' }) %>
7
+ <%= pb_rails("nav/item", props: { text: "React", link: kit_category_show_path(@category, type: 'react'), active: @type == 'react' }) %>
8
+ <% end %>
9
+ <%= pb_rails("section_separator") %>
10
+ </div>
11
+ <br>
12
+ <br>
13
+ <%= pb_category_kits(category_kits: @category_kits, type: @type) %>
14
+ </div>
@@ -0,0 +1,33 @@
1
+ <div class="pb--kit-show #{@kit}-kit">
2
+ <%= pb_rails("title", props: { text: pb_kit_title(@kit), tag: "h1", size: 1 }) %>
3
+ <div class="markdown">
4
+ <%= markdown(get_kit_description(@kit)) %>
5
+ </div>
6
+ </div>
7
+ <div>
8
+ <div class="pb--kit-type-nav">
9
+ <%= pb_rails("nav", props: { orientation: "horizontal" }) do %>
10
+ <% if has_kit_type?(@kit, "rails") %>
11
+ <%= pb_rails("nav/item", props: { text: "Rails", link: kit_show_rails_path(@kit), active: action_name == 'kit_show_rails' }) %>
12
+ <% end %>
13
+ <% if has_kit_type?(@kit, "react") %>
14
+ <%= pb_rails("nav/item", props: { text: "React", link: kit_show_reacts_path(@kit), active: action_name == 'kit_show_react' }) %>
15
+ <% end %>
16
+ <% end %>
17
+ <%= pb_rails("section_separator") %>
18
+ </div>
19
+ <% if (action_name == "kit_show_rails") %>
20
+ <%= pb_kit(kit: @kit) %>
21
+ <div class="markdown">
22
+ <br>
23
+ <%= markdown(get_kit_footer(@kit)) %>
24
+ </div>
25
+ <%= pb_kit_api(@kit) %>
26
+ <% else %>
27
+ <%= pb_kit(kit: @kit, type: "react") %>
28
+ <div class="markdown">
29
+ <br>
30
+ <%= markdown(get_kit_footer(@kit)) %>
31
+ </div>
32
+ <% end %>
33
+ </div>