playbook_ui 5.2.0.pre.alpha3 → 5.3.0.pre.alpha1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +12 -0
  3. data/app/assets/images/clark.jpg +0 -0
  4. data/app/assets/images/giant.jpg +0 -0
  5. data/app/assets/images/pb-caret.svg +1 -0
  6. data/app/assets/images/pb-check.svg +11 -0
  7. data/app/assets/images/pb.logo.svg +28 -0
  8. data/app/controllers/playbook/application_controller.rb +13 -0
  9. data/app/controllers/playbook/guides_controller.rb +11 -0
  10. data/app/controllers/playbook/pages_controller.rb +79 -0
  11. data/app/controllers/playbook/samples_controller.rb +40 -0
  12. data/app/pb_kits/playbook/_playbook.scss +1 -0
  13. data/app/pb_kits/playbook/data/menu.yml +4 -2
  14. data/app/pb_kits/playbook/index.js +1 -4
  15. data/app/pb_kits/playbook/packs/application.js +55 -0
  16. data/app/pb_kits/playbook/packs/examples.js +176 -0
  17. data/app/pb_kits/playbook/packs/main.scss +12 -0
  18. data/app/pb_kits/playbook/packs/samples.js +19 -0
  19. data/app/pb_kits/playbook/packs/site_styles/_samples.scss +72 -0
  20. data/app/pb_kits/playbook/packs/site_styles/_scaffold.scss +43 -0
  21. data/app/pb_kits/playbook/packs/site_styles/_site-style.scss +135 -0
  22. data/app/pb_kits/playbook/packs/site_styles/docs/_all.scss +10 -0
  23. data/app/pb_kits/playbook/packs/site_styles/docs/_bg_light_doc_example.scss +7 -0
  24. data/app/pb_kits/playbook/packs/site_styles/docs/_code_snippet.scss +531 -0
  25. data/app/pb_kits/playbook/packs/site_styles/docs/_color_utilities.scss +92 -0
  26. data/app/pb_kits/playbook/packs/site_styles/docs/_flex_examples.scss +15 -0
  27. data/app/pb_kits/playbook/packs/site_styles/docs/_kit_doc.scss +190 -0
  28. data/app/pb_kits/playbook/packs/site_styles/docs/_kits_examples.scss +18 -0
  29. data/app/pb_kits/playbook/packs/site_styles/docs/_markdown.scss +82 -0
  30. data/app/pb_kits/playbook/packs/site_styles/docs/_spacing_tokens.scss +72 -0
  31. data/app/pb_kits/playbook/pb_badge/_badge.html.erb +1 -0
  32. data/app/pb_kits/playbook/pb_badge/_badge.jsx +17 -4
  33. data/app/pb_kits/playbook/pb_card/_card.jsx +4 -1
  34. data/app/pb_kits/playbook/pb_card/_card.scss +4 -0
  35. data/app/pb_kits/playbook/pb_card/card.rb +8 -1
  36. data/app/pb_kits/playbook/pb_card/docs/_card_border_none.html.erb +7 -0
  37. data/app/pb_kits/playbook/pb_card/docs/_card_border_none.jsx +14 -0
  38. data/app/pb_kits/playbook/pb_card/docs/_card_border_none.md +1 -0
  39. data/app/pb_kits/playbook/pb_card/docs/example.yml +2 -0
  40. data/app/pb_kits/playbook/pb_card/docs/index.js +1 -0
  41. data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.js +26 -0
  42. data/app/pb_kits/playbook/pb_filter/docs/_description.md +3 -0
  43. data/app/pb_kits/playbook/pb_filter/templates/_default.html.erb +1 -1
  44. data/app/pb_kits/playbook/pb_gauge/_gauge.html.erb +12 -0
  45. data/app/pb_kits/playbook/pb_gauge/_gauge.jsx +105 -0
  46. data/app/pb_kits/playbook/pb_gauge/_gauge.scss +11 -0
  47. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_default.html.erb +11 -0
  48. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_default.jsx +17 -0
  49. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_full_circle.html.erb +14 -0
  50. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_full_circle.jsx +20 -0
  51. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_height.html.erb +15 -0
  52. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_height.jsx +23 -0
  53. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_live_data.jsx +25 -0
  54. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_min_max.html.erb +21 -0
  55. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_min_max.jsx +26 -0
  56. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_sizing.html.erb +33 -0
  57. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_sizing.jsx +42 -0
  58. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_title.html.erb +14 -0
  59. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_title.jsx +20 -0
  60. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_units.html.erb +29 -0
  61. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_units.jsx +29 -0
  62. data/app/pb_kits/playbook/pb_gauge/docs/example.yml +22 -0
  63. data/app/pb_kits/playbook/pb_gauge/docs/index.js +8 -0
  64. data/app/pb_kits/playbook/pb_gauge/gauge.rb +55 -0
  65. data/app/pb_kits/playbook/pb_layout/_footer.html.erb +6 -0
  66. data/app/pb_kits/playbook/pb_layout/_header.html.erb +6 -0
  67. data/app/pb_kits/playbook/pb_layout/_layout.jsx +33 -1
  68. data/app/pb_kits/playbook/pb_layout/_layout.scss +48 -3
  69. data/app/pb_kits/playbook/pb_layout/docs/_layout_collection_detail.html.erb +19 -0
  70. data/app/pb_kits/playbook/pb_layout/docs/_layout_collection_detail.jsx +54 -0
  71. data/app/pb_kits/playbook/pb_layout/docs/_layout_collection_detail.md +1 -0
  72. data/app/pb_kits/playbook/pb_layout/docs/_layout_content.html.erb +28 -0
  73. data/app/pb_kits/playbook/pb_layout/docs/_layout_content.jsx +42 -0
  74. data/app/pb_kits/playbook/pb_layout/docs/example.yml +6 -0
  75. data/app/pb_kits/playbook/pb_layout/docs/index.js +3 -0
  76. data/app/pb_kits/playbook/pb_layout/footer.rb +19 -0
  77. data/app/pb_kits/playbook/pb_layout/header.rb +19 -0
  78. data/app/pb_kits/playbook/pb_layout/layout.rb +9 -4
  79. data/app/pb_kits/playbook/pb_popover/_popover.html.erb +2 -2
  80. data/app/pb_kits/playbook/pb_popover/_popover.jsx +3 -3
  81. data/app/pb_kits/playbook/pb_popover/_popover.scss +25 -21
  82. data/app/pb_kits/playbook/pb_popover/index.js +6 -1
  83. data/app/pb_kits/playbook/pb_radio/_radio.scss +4 -0
  84. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default.html.erb +1 -1
  85. data/app/pb_kits/playbook/plugins/pb_chart.js +71 -0
  86. data/app/views/layouts/playbook/_mobile_hamburger.html.erb +2 -0
  87. data/app/views/layouts/playbook/_nav.html.erb +13 -0
  88. data/app/views/layouts/playbook/_sidebar.html.erb +52 -0
  89. data/app/views/layouts/playbook/application.html.slim +22 -0
  90. data/app/views/layouts/playbook/fullscreen.html.slim +10 -0
  91. data/app/views/layouts/playbook/grid.html.slim +10 -0
  92. data/app/views/layouts/playbook/samples.html.erb +18 -0
  93. data/app/views/playbook/guides/create_kit.html.slim +16 -0
  94. data/app/views/playbook/guides/create_kit/_file_naming.html.md +2 -0
  95. data/app/views/playbook/guides/create_kit/_generator.html.md +6 -0
  96. data/app/views/playbook/guides/create_kit/_kit_examples.html.md +2 -0
  97. data/app/views/playbook/guides/create_kit/_kit_rails.html.md +2 -0
  98. data/app/views/playbook/guides/create_kit/_kit_react.html.md +2 -0
  99. data/app/views/playbook/guides/create_kit/_layout.html.md +2 -0
  100. data/app/views/playbook/guides/create_kit/_view_objects.html.md +2 -0
  101. data/app/views/playbook/guides/create_kit/_writing_sass.md +10 -0
  102. data/app/views/playbook/guides/use_nitro.html.slim +6 -0
  103. data/app/views/playbook/guides/use_nitro/_local.html.md +2 -0
  104. data/app/views/playbook/guides/use_nitro/_nitro_components.html.md +2 -0
  105. data/app/views/playbook/guides/use_nitro/_versions.html.md +2 -0
  106. data/app/views/playbook/pages/fullscreen.html.slim +10 -0
  107. data/app/views/playbook/pages/grid.html.slim +2 -0
  108. data/app/views/playbook/pages/home.html.slim +4 -0
  109. data/app/views/playbook/pages/kit_category_show.html.erb +14 -0
  110. data/app/views/playbook/pages/kit_show.html.erb +33 -0
  111. data/app/views/playbook/pages/kits.html.erb +12 -0
  112. data/app/views/playbook/pages/principals/_getting_started.html.md +30 -0
  113. data/app/views/playbook/pages/principles.html.slim +3 -0
  114. data/app/views/playbook/pages/tokens.html.slim +15 -0
  115. data/app/views/playbook/pages/tokens/_pb_doc_spacing.html.slim +17 -0
  116. data/app/views/playbook/pages/utilities.html.slim +116 -0
  117. data/app/views/playbook/pages/utilities/_pb_doc_color.html.slim +15 -0
  118. data/app/views/playbook/samples/dashboards/index.html.erb +81 -0
  119. data/app/views/playbook/samples/dashboards/index.jsx +130 -0
  120. data/app/views/playbook/samples/filter_table/index.html.erb +348 -0
  121. data/app/views/playbook/samples/filter_table/index.jsx +433 -0
  122. data/app/views/playbook/samples/registration/index.html.erb +316 -0
  123. data/app/views/playbook/samples/registration/index.jsx +476 -0
  124. data/app/views/playbook/samples/sample_show.html.erb +36 -0
  125. data/lib/playbook/version.rb +1 -1
  126. data/lib/tasks/pb_release.rake +0 -3
  127. metadata +100 -3
  128. data/app/pb_kits/playbook/tokens/index.scss +0 -12
@@ -0,0 +1,19 @@
1
+ <%= pb_rails("layout", props: {position: "left", size: "sm", collapse: "md", layout: "collection_detail" }) do %>
2
+ <%= pb_rails("layout/sidebar") do %>
3
+ <%= pb_rails("card", props: { margin_right: "md", padding: "none" }) do %>
4
+ <%= pb_rails("nav", props: {title: "Menu", link: "#", padding_top:"md" }) do %>
5
+ <%= pb_rails("nav/item", props: { text: "Photos", link: "#" }) %>
6
+ <%= pb_rails("nav/item", props: { text: "Music", link: "#" }) %>
7
+ <%= pb_rails("nav/item", props: { text: "Video", link: "#", active: true }) %>
8
+ <%= pb_rails("nav/item", props: { text: "Files", link: "#" }) %>
9
+ <% end %>
10
+ <% end %>
11
+ <% end %>
12
+
13
+ <%= pb_rails("layout/body") do %>
14
+ <% 25.times do %>
15
+ <%= pb_rails("card") do %> Card content <% end %>
16
+ <% end %>
17
+
18
+ <% end %>
19
+ <% end %>
@@ -0,0 +1,54 @@
1
+ import React from 'react'
2
+ import { Card, Layout, Nav, NavItem } from '../../'
3
+ const Cards = ({ n }) => {
4
+ const cards = []
5
+ for (let i = 0; i < n; ++i) {
6
+ cards.push(<Card>{'Card content'}</Card>)
7
+ }
8
+ return (cards)
9
+ }
10
+
11
+ const LayoutCollectionDetail = () => {
12
+ return (
13
+ <div>
14
+ <Layout
15
+ layout="collection_detail"
16
+ >
17
+ <Card padding="none">
18
+ {
19
+ <Nav
20
+ link="#"
21
+ marginTop="sm"
22
+ orientation="vertical"
23
+ title="Menu"
24
+ >
25
+ <NavItem
26
+ link="#"
27
+ text="Photos"
28
+ />
29
+ <NavItem
30
+ link="#"
31
+ text="Music"
32
+ />
33
+ <NavItem
34
+ active
35
+ link="#"
36
+ text="Video"
37
+ />
38
+ <NavItem
39
+ link="#"
40
+ text="Files"
41
+ />
42
+ </Nav>
43
+ }
44
+ </Card>
45
+
46
+ <Layout.Body>
47
+ <Cards n={16} />
48
+ </Layout.Body>
49
+ </Layout>
50
+ </div>
51
+ )
52
+ }
53
+
54
+ export default LayoutCollectionDetail
@@ -0,0 +1 @@
1
+ The left element on Collection Detail can be used for things such as navigation or secondary content to the element on the right. The right content can be used the same way that you would use Collection. The element on the right should be the primary focus and can be used for repeating elements such as cards.
@@ -0,0 +1,28 @@
1
+ <%= pb_rails("layout", props: {layout: "content" }) do %>
2
+ <%= pb_rails("layout/header") do %>
3
+ <%= pb_rails("card") do %>
4
+ Header
5
+ <% end %>
6
+ <% end %>
7
+ <%= pb_rails("layout/sidebar") do %>
8
+ <%= pb_rails("card") do %>
9
+ Sidebar
10
+ <br><br>
11
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec iaculis, risus a fringilla luctus, sapien eros sodales ex, quis molestie est nulla non turpis. Vestibulum aliquet at ipsum eget posuere. Morbi sed laoreet erat. Sed commodo posuere lectus, at porta nulla ornare a. Suspendisse quam est, sollicitudin ut enim sit amet, commodo placerat enim. Donec laoreet metus ac mauris pellentesque mattis.
12
+ <% end %>
13
+ <% end %>
14
+ <%= pb_rails("layout/body") do %>
15
+ <%= pb_rails("card") do %>
16
+ Body
17
+ <br><br>
18
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec iaculis, risus a fringilla luctus, sapien eros sodales ex, quis molestie est nulla non turpis. Vestibulum aliquet at ipsum eget posuere. Morbi sed laoreet erat. Sed commodo posuere lectus, at porta nulla ornare a. Suspendisse quam est, sollicitudin ut enim sit amet, commodo placerat enim. Donec laoreet metus ac mauris pellentesque mattis. Pellentesque luctus vel mauris non aliquam. Mauris hendrerit mattis porttitor. Curabitur vehicula justo non ex consectetur commodo. Quisque posuere aliquet quam. Maecenas malesuada magna mauris, ac tempor metus euismod at.
19
+ <br><br>
20
+ Cras ornare fermentum magna mollis efficitur. Sed vitae nulla vel purus ultrices mollis. Maecenas id nulla id libero faucibus feugiat quis sit amet turpis. In commodo pellentesque risus at fringilla. Integer non interdum leo, non commodo ante. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut mi augue, dignissim at orci vel, egestas aliquam mi. Proin finibus aliquet tempor. Integer cursus, ex quis gravida rhoncus, nisi elit viverra ipsum, non efficitur est ex ac tortor. Praesent vitae odio massa.
21
+ <% end %>
22
+ <% end %>
23
+ <%= pb_rails("layout/footer") do %>
24
+ <%= pb_rails("card") do %>
25
+ Footer
26
+ <% end %>
27
+ <% end %>
28
+ <% end %>
@@ -0,0 +1,42 @@
1
+ import React from 'react'
2
+ import { Card, Layout } from '../../'
3
+
4
+ const LayoutContent = () => {
5
+ return (
6
+ <div>
7
+ <Layout layout="content">
8
+ <Layout.Header>
9
+ <Card>
10
+ {'Header'}
11
+ </Card>
12
+ </Layout.Header>
13
+ <Layout.Side>
14
+ <Card>
15
+ {'Sidebar'}
16
+ <br />
17
+ <br />
18
+ {'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec iaculis, risus a fringilla luctus, sapien eros sodales ex, quis molestie est nulla non turpis. Vestibulum aliquet at ipsum eget posuere. Morbi sed laoreet erat. Sed commodo posuere lectus, at porta nulla ornare a. Suspendisse quam est, sollicitudin ut enim sit amet, commodo placerat enim. Donec laoreet metus ac mauris pellentesque mattis.'}
19
+ </Card>
20
+ </Layout.Side>
21
+ <Layout.Body>
22
+ <Card>
23
+ {'Body'}
24
+ <br />
25
+ <br />
26
+ {'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec iaculis, risus a fringilla luctus, sapien eros sodales ex, quis molestie est nulla non turpis. Vestibulum aliquet at ipsum eget posuere. Morbi sed laoreet erat. Sed commodo posuere lectus, at porta nulla ornare a. Suspendisse quam est, sollicitudin ut enim sit amet, commodo placerat enim. Donec laoreet metus ac mauris pellentesque mattis. Pellentesque luctus vel mauris non aliquam. Mauris hendrerit mattis porttitor. Curabitur vehicula justo non ex consectetur commodo. Quisque posuere aliquet quam. Maecenas malesuada magna mauris, ac tempor metus euismod at.'}
27
+ <br />
28
+ <br />
29
+ {'Cras ornare fermentum magna mollis efficitur. Sed vitae nulla vel purus ultrices mollis. Maecenas id nulla id libero faucibus feugiat quis sit amet turpis. In commodo pellentesque risus at fringilla. Integer non interdum leo, non commodo ante. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut mi augue, dignissim at orci vel, egestas aliquam mi. Proin finibus aliquet tempor. Integer cursus, ex quis gravida rhoncus, nisi elit viverra ipsum, non efficitur est ex ac tortor. Praesent vitae odio massa.'}
30
+ </Card>
31
+ </Layout.Body>
32
+ <Layout.Footer>
33
+ <Card>
34
+ {'Footer'}
35
+ </Card>
36
+ </Layout.Footer>
37
+ </Layout>
38
+ </div>
39
+ )
40
+ }
41
+
42
+ export default LayoutContent
@@ -5,7 +5,10 @@ examples:
5
5
  - layout_sizes: Sizes
6
6
  - layout_sizes_dark: Sizes Dark
7
7
  - layout_collection: Collection Layout
8
+ - layout_collection_detail: Collection Detail Layout
8
9
  - layout_kanban: Kanban Layout
10
+ - layout_content: Content Layout
11
+
9
12
 
10
13
  react:
11
14
  - layout_colors: Colors
@@ -13,4 +16,7 @@ examples:
13
16
  - layout_sizes: Sizes
14
17
  - layout_sizes_dark: Sizes Dark
15
18
  - layout_collection: Collection Layout
19
+ - layout_collection_detail: Collection Detail Layout
16
20
  - layout_kanban: Kanban Layout
21
+ - layout_content: Content Layout
22
+
@@ -5,3 +5,6 @@ export { default as LayoutSizesDark } from './_layout_sizes_dark.jsx'
5
5
  export { default as LayoutCollection } from './_layout_collection.jsx'
6
6
  export { default as LayoutKanban } from './_layout_kanban.jsx'
7
7
  export { default as LayoutKanbanResponsive } from './_layout_kanban_responsive.jsx'
8
+ export { default as LayoutCollectionDetail } from './_layout_collection_detail.jsx'
9
+ export { default as LayoutContent } from './_layout_content.jsx'
10
+
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Playbook
4
+ module PbLayout
5
+ class Footer
6
+ include Playbook::Props
7
+
8
+ partial "pb_layout/footer"
9
+
10
+ prop :tag, type: Playbook::Props::Enum,
11
+ values: %w[ul li span div],
12
+ default: "div"
13
+
14
+ def classname
15
+ generate_classname("layout_footer")
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Playbook
4
+ module PbLayout
5
+ class Header
6
+ include Playbook::Props
7
+
8
+ partial "pb_layout/header"
9
+
10
+ prop :tag, type: Playbook::Props::Enum,
11
+ values: %w[ul li span div],
12
+ default: "div"
13
+
14
+ def classname
15
+ generate_classname("layout_header")
16
+ end
17
+ end
18
+ end
19
+ end
@@ -19,12 +19,13 @@ module Playbook
19
19
  default: "md"
20
20
  prop :transparent, type: Playbook::Props::Boolean, default: false
21
21
  prop :variant, type: Playbook::Props::Enum,
22
- values: %w[light dark gradient],
23
- default: "light"
22
+ values: %w[light dark gradient],
23
+ default: "light"
24
24
  prop :layout, type: Playbook::Props::Enum,
25
- values: %w[sidebar collection kanban],
25
+ values: %w[sidebar collection collection_detail kanban content],
26
26
  default: "sidebar"
27
27
 
28
+
28
29
  prop :responsive, type: Playbook::Props::Boolean, default: false
29
30
 
30
31
  def classname
@@ -33,6 +34,10 @@ module Playbook
33
34
  generate_classname("pb_layout_kit", layout)
34
35
  when "kanban"
35
36
  generate_classname("pb_layout_kit", layout, responsive_class)
37
+ when "collection_detail"
38
+ generate_classname("pb_layout_kit", layout )
39
+ when "content"
40
+ generate_classname("pb_layout_kit", layout)
36
41
  else
37
42
  first_class = generate_classname("pb_layout_kit_sidebar","size_#{size}", position, variant, transparent_class)
38
43
  [first_class, full_class, collapse_class].reject(&:empty?).join(" ")
@@ -58,4 +63,4 @@ module Playbook
58
63
  end
59
64
  end
60
65
  end
61
- end
66
+ 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 %>
@@ -3,6 +3,8 @@ import Highcharts from 'highcharts'
3
3
  import { highchartsTheme } from '../pb_dashboard/pbChartsLightTheme.js'
4
4
 
5
5
  require('highcharts/modules/variable-pie')(Highcharts)
6
+ import highchartsMore from 'highcharts/highcharts-more.js'
7
+ import solidGauge from 'highcharts/modules/solid-gauge.js'
6
8
 
7
9
  class pbChart {
8
10
  defaults = {
@@ -31,11 +33,80 @@ class pbChart {
31
33
 
32
34
  if (this.options.type == 'variablepie' || this.options.type == 'pie'){
33
35
  this.setupPieChart()
36
+ } else if (this.options.type == 'gauge') {
37
+ this.setupGauge()
34
38
  } else {
35
39
  this.setupChart()
36
40
  }
37
41
  }
38
42
 
43
+ setupGauge() {
44
+ highchartsMore(Highcharts)
45
+ solidGauge(Highcharts)
46
+ Highcharts.setOptions(highchartsTheme)
47
+
48
+ Highcharts.chart(this.defaults.id, {
49
+ chart: {
50
+ type: this.defaults.style,
51
+ height: this.defaults.height,
52
+ },
53
+ title: {
54
+ text: this.defaults.title,
55
+ },
56
+ yAxis: {
57
+ min: this.defaults.min,
58
+ max: this.defaults.max,
59
+ lineWidth: 0,
60
+ tickWidth: 0,
61
+ minorTickInterval: null,
62
+ tickAmount: 2,
63
+ tickPositions: [this.defaults.min, this.defaults.max],
64
+ labels: {
65
+ y: 26,
66
+ enabled: this.defaults.showLabels,
67
+ },
68
+ },
69
+ credits: false,
70
+ series: [
71
+ {
72
+ data: this.defaults.chartData,
73
+ },
74
+ ],
75
+ pane: {
76
+ center: ['50%', '50%'],
77
+ size: '90%',
78
+ startAngle: this.defaults.circumference[0],
79
+ endAngle: this.defaults.circumference[1],
80
+ background: {
81
+ borderWidth: 20,
82
+ innerRadius: '90%',
83
+ outerRadius: '90%',
84
+ shape: 'arc',
85
+ className: 'gauge-pane',
86
+ },
87
+ },
88
+ tooltip: {
89
+ headerFormat: '',
90
+ pointFormat: this.defaults.tooltipHtml,
91
+ followPointer: true,
92
+ },
93
+ plotOptions: {
94
+ solidgauge: {
95
+ dataLabels: {
96
+ format: `<span class="prefix">${this.defaults.prefix}</span>` +
97
+ '<span class="fix">{y:,f}</span>' +
98
+ `<span class="suffix">${this.defaults.suffix}</span>`,
99
+ },
100
+ },
101
+ },
102
+ })
103
+ document.querySelectorAll('.gauge-pane').forEach((pane) => pane.setAttribute('stroke-linejoin', 'round'))
104
+ if (document.querySelector('.prefix')) {
105
+ document.querySelectorAll('.prefix').forEach((prefix) => prefix.setAttribute('y', '28'))
106
+ document.querySelectorAll('.fix').forEach((fix) => fix.setAttribute('y', '38'))
107
+ }
108
+ }
109
+
39
110
  setupPieChart() {
40
111
  Highcharts.setOptions(highchartsTheme)
41
112