playbook_ui 5.2.0 → 5.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +1 -1
  3. data/app/pb_kits/playbook/data/menu.yml +1 -0
  4. data/app/pb_kits/playbook/packs/samples.js +2 -0
  5. data/app/pb_kits/playbook/packs/site_styles/docs/_all.scss +1 -0
  6. data/app/pb_kits/playbook/packs/site_styles/docs/_bg_light_doc_example.scss +7 -0
  7. data/app/pb_kits/playbook/pb_badge/_badge.html.erb +1 -0
  8. data/app/pb_kits/playbook/pb_badge/_badge.jsx +17 -4
  9. data/app/pb_kits/playbook/pb_body/_body.html.erb +1 -0
  10. data/app/pb_kits/playbook/pb_body/_body.jsx +33 -24
  11. data/app/pb_kits/playbook/pb_body/docs/_body_dark.html.erb +1 -1
  12. data/app/pb_kits/playbook/pb_body/docs/_body_dark.jsx +0 -2
  13. data/app/pb_kits/playbook/pb_body/docs/_body_light.html.erb +1 -0
  14. data/app/pb_kits/playbook/pb_body/docs/_body_light.jsx +3 -7
  15. data/app/pb_kits/playbook/pb_caption/_caption.scss +2 -2
  16. data/app/pb_kits/playbook/pb_card/_card.jsx +4 -1
  17. data/app/pb_kits/playbook/pb_card/_card.scss +4 -0
  18. data/app/pb_kits/playbook/pb_card/card.rb +8 -1
  19. data/app/pb_kits/playbook/pb_card/docs/_card_border_none.html.erb +7 -0
  20. data/app/pb_kits/playbook/pb_card/docs/_card_border_none.jsx +14 -0
  21. data/app/pb_kits/playbook/pb_card/docs/_card_border_none.md +1 -0
  22. data/app/pb_kits/playbook/pb_card/docs/example.yml +2 -0
  23. data/app/pb_kits/playbook/pb_card/docs/index.js +1 -0
  24. data/app/pb_kits/playbook/pb_checkbox/_checkbox.html.erb +2 -1
  25. data/app/pb_kits/playbook/pb_checkbox/_checkbox.jsx +18 -5
  26. data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_checked.jsx +17 -0
  27. data/app/pb_kits/playbook/pb_checkbox/docs/example.yml +1 -0
  28. data/app/pb_kits/playbook/pb_checkbox/docs/index.js +1 -0
  29. data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.html.erb +1 -0
  30. data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx +17 -1
  31. data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.html.erb +3 -2
  32. data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.jsx +15 -12
  33. data/app/pb_kits/playbook/pb_highlight/docs/_highlight_default.html.erb +1 -1
  34. data/app/pb_kits/playbook/pb_image/_image.jsx +1 -1
  35. data/app/pb_kits/playbook/pb_layout/_layout.scss +16 -0
  36. data/app/pb_kits/playbook/pb_legend/_legend.html.erb +1 -0
  37. data/app/pb_kits/playbook/pb_legend/_legend.jsx +25 -4
  38. data/app/pb_kits/playbook/pb_nav/_item.jsx +20 -10
  39. data/app/pb_kits/playbook/pb_nav/_vertical_nav.scss +3 -0
  40. data/app/pb_kits/playbook/pb_popover/_popover.html.erb +1 -1
  41. data/app/pb_kits/playbook/pb_popover/_popover.jsx +3 -1
  42. data/app/pb_kits/playbook/pb_popover/_popover.scss +4 -0
  43. data/app/pb_kits/playbook/pb_popover/popover.rb +4 -0
  44. data/app/pb_kits/playbook/pb_title/_title.jsx +7 -4
  45. data/app/pb_kits/playbook/pb_title/_title.scss +7 -0
  46. data/app/pb_kits/playbook/pb_title/_title_mixin.scss +2 -0
  47. data/app/pb_kits/playbook/pb_title/title.rb +4 -1
  48. data/app/views/layouts/playbook/samples.html.erb +1 -0
  49. data/app/views/playbook/samples/collection_detail/index.html.erb +169 -0
  50. data/app/views/playbook/samples/collection_detail/index.jsx +372 -0
  51. data/lib/generators/kit/kit_generator.rb +6 -3
  52. data/lib/generators/kit/templates/kit_html.erb.tt +3 -2
  53. data/lib/generators/kit/templates/kit_jsx.erb.tt +38 -10
  54. data/lib/playbook/version.rb +1 -1
  55. metadata +11 -3
@@ -13,10 +13,10 @@ class KitGenerator < Rails::Generators::NamedBase
13
13
  @kit_name_underscore = kit_name.parameterize.underscore
14
14
  @kit_name_pascal = kit_name.titleize.gsub(/\s+/, "")
15
15
 
16
- kit_props = options[:props].concat(%w[id:string classname:string data:object])
16
+ kit_props = options[:props].concat(%w[id:string classname:string data:object aria:object])
17
17
  @kit_props = kit_props.map { |hash| [hash.partition(":").first, hash.partition(":").last] }.to_h
18
18
  @kit_props = @kit_props.sort.to_h
19
- @unique_props = @kit_props.symbolize_keys.without(:id, :classname, :data)
19
+ @unique_props = @kit_props.symbolize_keys.without(:id, :classname, :data, :aria)
20
20
 
21
21
  @kit_class_init = []
22
22
  @kit_props.each do |key, _val|
@@ -48,7 +48,7 @@ class KitGenerator < Rails::Generators::NamedBase
48
48
  # Generate SCSS files ==============================
49
49
  template "kit_scss.erb", "#{full_kit_directory}/_#{@kit_name_underscore}.scss"
50
50
  open("app/pb_kits/playbook/_playbook.scss", "a") do |f|
51
- f.puts "@" + "import " + "\'" + "pb_#{@kit_name_underscore}/#{@kit_name_underscore}" + "\';"
51
+ f.puts "\n@" + "import " + "\'" + "pb_#{@kit_name_underscore}/#{@kit_name_underscore}" + "\';"
52
52
  end
53
53
  say_status "complete",
54
54
  "#{@kit_name_capitalize} kit stylesheet successfully created and imported.",
@@ -77,6 +77,9 @@ class KitGenerator < Rails::Generators::NamedBase
77
77
  append_to_file("app/pb_kits/playbook/packs/examples.js") do
78
78
  "import * as #{@kit_name_pascal} from 'pb_#{@kit_name_underscore}/docs'\nWebpackerReact.setup(#{@kit_name_pascal})\n"
79
79
  end
80
+ append_to_file("app/pb_kits/playbook/index.js") do
81
+ "\nexport #{@kit_name_pascal} from 'pb_#{@kit_name_underscore}/_#{@kit_name_underscore}.jsx'"
82
+ end
80
83
 
81
84
  say_status "complete",
82
85
  "#{@kit_name_capitalize} react kit successfully created.",
@@ -1,6 +1,7 @@
1
1
  <%%= content_tag(:div,
2
- id: object.id,
2
+ aria: object.aria,
3
+ class: object.classname,
3
4
  data: object.data,
4
- class: object.classname) do %>
5
+ id: object.id) do %>
5
6
  <span><%= @kit_name_uppercase %> CONTENT</span>
6
7
  <%% end %>
@@ -10,6 +10,7 @@ props_types = @kit_props.map do |key, val|
10
10
  prop_type = case val
11
11
  when "enum", "one_of" then "'option_1' | 'option_2'"
12
12
  when "boolean", "bool" then "Boolean"
13
+ when "object", "obj" then "object"
13
14
  else "String"
14
15
  end
15
16
 
@@ -17,24 +18,51 @@ props_types = @kit_props.map do |key, val|
17
18
  end
18
19
  puts props_types.inspect
19
20
 
20
- props_names = @kit_props.map { |key,| key == "classname" ? "className" : key.camelize(:lower) }
21
+ props_names = @kit_props.keys.map do |key|
22
+ case key
23
+ when "classname" || "className"
24
+ "className"
25
+ when "aria"
26
+ "aria = {}"
27
+ when "data"
28
+ "data = {}"
29
+ else
30
+ key
31
+ end
32
+ end
33
+
34
+ %>
21
35
 
22
- props_and_values = props_names.map { |prop| "<p>{`#{prop}: ${#{prop}}`}</p>" }
23
- -%>
24
36
  /* @flow */
25
37
 
26
38
  import React from 'react'
39
+ import classnames from 'classnames'
40
+ import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
41
+ import { spacing } from '../utilities/spacing.js'
27
42
 
28
43
  type <%= type_name %> = {
29
44
  <%= break_lines.call(props_types) %>
30
45
  }
31
46
 
32
- const <%= @kit_name_pascal %> = ({
33
- <%= break_lines.call(props_names) %>
34
- }: <%= type_name %>) => (
35
- <div>
36
- <%= break_lines.call(props_and_values, 4, "") %>
37
- </div>
38
- )
47
+ const <%= @kit_name_pascal %> = (props: <%= type_name %>) => {
48
+ const {
49
+ <%= break_lines.call(props_names) %>
50
+ } = props
51
+
52
+ const ariaProps = buildAriaProps(aria)
53
+ const dataProps = buildDataProps(data)
54
+ const classes = classnames(buildCss('pb_<%= @kit_name_underscore %>'), className, spacing(props))
55
+
56
+ return (
57
+ <div
58
+ {...ariaProps}
59
+ {...dataProps}
60
+ className={classes}
61
+ id={id}
62
+ >
63
+ {className}
64
+ </div>
65
+ )
66
+ }
39
67
 
40
68
  export default <%= @kit_name_pascal %>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Playbook
4
- VERSION = "5.2.0"
4
+ VERSION = "5.5.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playbook_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.0
4
+ version: 5.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Power UX
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-07-02 00:00:00.000000000 Z
12
+ date: 2020-07-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -411,6 +411,7 @@ files:
411
411
  - app/pb_kits/playbook/packs/site_styles/_scaffold.scss
412
412
  - app/pb_kits/playbook/packs/site_styles/_site-style.scss
413
413
  - app/pb_kits/playbook/packs/site_styles/docs/_all.scss
414
+ - app/pb_kits/playbook/packs/site_styles/docs/_bg_light_doc_example.scss
414
415
  - app/pb_kits/playbook/packs/site_styles/docs/_code_snippet.scss
415
416
  - app/pb_kits/playbook/packs/site_styles/docs/_color_utilities.scss
416
417
  - app/pb_kits/playbook/packs/site_styles/docs/_flex_examples.scss
@@ -543,6 +544,9 @@ files:
543
544
  - app/pb_kits/playbook/pb_card/card_header.rb
544
545
  - app/pb_kits/playbook/pb_card/child_kits/_card_body.html.erb
545
546
  - app/pb_kits/playbook/pb_card/child_kits/_card_header.html.erb
547
+ - app/pb_kits/playbook/pb_card/docs/_card_border_none.html.erb
548
+ - app/pb_kits/playbook/pb_card/docs/_card_border_none.jsx
549
+ - app/pb_kits/playbook/pb_card/docs/_card_border_none.md
546
550
  - app/pb_kits/playbook/pb_card/docs/_card_content.html.erb
547
551
  - app/pb_kits/playbook/pb_card/docs/_card_content.jsx
548
552
  - app/pb_kits/playbook/pb_card/docs/_card_dark.html.erb
@@ -570,6 +574,7 @@ files:
570
574
  - app/pb_kits/playbook/pb_checkbox/_checkbox.scss
571
575
  - app/pb_kits/playbook/pb_checkbox/checkbox.rb
572
576
  - app/pb_kits/playbook/pb_checkbox/docs/_checkbox_checked.html.erb
577
+ - app/pb_kits/playbook/pb_checkbox/docs/_checkbox_checked.jsx
573
578
  - app/pb_kits/playbook/pb_checkbox/docs/_checkbox_custom.html.erb
574
579
  - app/pb_kits/playbook/pb_checkbox/docs/_checkbox_custom.jsx
575
580
  - app/pb_kits/playbook/pb_checkbox/docs/_checkbox_dark.html.erb
@@ -1768,6 +1773,8 @@ files:
1768
1773
  - app/views/playbook/pages/tokens/_pb_doc_spacing.html.slim
1769
1774
  - app/views/playbook/pages/utilities.html.slim
1770
1775
  - app/views/playbook/pages/utilities/_pb_doc_color.html.slim
1776
+ - app/views/playbook/samples/collection_detail/index.html.erb
1777
+ - app/views/playbook/samples/collection_detail/index.jsx
1771
1778
  - app/views/playbook/samples/dashboards/index.html.erb
1772
1779
  - app/views/playbook/samples/dashboards/index.jsx
1773
1780
  - app/views/playbook/samples/filter_table/index.html.erb
@@ -1813,7 +1820,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1813
1820
  - !ruby/object:Gem::Version
1814
1821
  version: '0'
1815
1822
  requirements: []
1816
- rubygems_version: 3.1.2
1823
+ rubyforge_project:
1824
+ rubygems_version: 2.7.3
1817
1825
  signing_key:
1818
1826
  specification_version: 4
1819
1827
  summary: Playbook Design System