playbook_ui 2.8.9 → 2.9.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.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/packs/site_styles/docs/_kit_doc.scss +1 -0
- data/app/pb_kits/playbook/pb_body/_body.jsx +2 -2
- data/app/pb_kits/playbook/pb_body/body.rb +4 -1
- data/app/pb_kits/playbook/pb_body/docs/_body_block.html.erb +3 -0
- data/app/pb_kits/playbook/pb_body/docs/_body_block.jsx +14 -0
- data/app/pb_kits/playbook/pb_body/docs/_body_dark.html.erb +25 -16
- data/app/pb_kits/playbook/pb_body/docs/_body_dark.jsx +2 -1
- data/app/pb_kits/playbook/pb_body/docs/_body_light.html.erb +19 -17
- data/app/pb_kits/playbook/pb_body/docs/_body_light.jsx +2 -1
- data/app/pb_kits/playbook/pb_body/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_body/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_button/_button.jsx +4 -2
- data/app/pb_kits/playbook/pb_layout/_layout.html.erb +1 -1
- data/app/pb_kits/playbook/pb_layout/_layout.jsx +1 -1
- data/app/pb_kits/playbook/pb_layout/_layout.scss +1 -1
- data/app/pb_kits/playbook/pb_title/_title_mixin.scss +2 -1
- data/app/pb_kits/playbook/pb_title/docs/_title_dark.html.erb +4 -4
- data/app/pb_kits/playbook/pb_title/docs/_title_dark.jsx +4 -4
- data/app/pb_kits/playbook/pb_title/docs/_title_light.html.erb +4 -4
- data/app/pb_kits/playbook/pb_title/docs/_title_light.jsx +4 -4
- data/lib/generators/kit/templates/kit_jsx.erb.tt +1 -1
- data/lib/generators/kit/templates/kit_ruby.erb.tt +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5b6c7dc11c38335138d659f925a534eb976a2c612f3ae5bc19577640e1cfc3ea
|
|
4
|
+
data.tar.gz: 19b251b77226a249bb7da7eb923ee198fa00b53d2e44e14d4f7f84e6102b401a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 89441d84f686920f6ed1d833b8b06e4324ff3af6de03ab9cd4b68c4e2a7b22c30719bb238ed183e65388e662d1b8e3e498e92d7c3f4647bfda3e79b18fda1874
|
|
7
|
+
data.tar.gz: 2720ae93d19c177cec30a544edc3b649ed9b593a52f805eb11263bcf2eef997d4eba36f1e0af7688a816f82c28273ac96ec34f7e6df80ce190750cc77f5d6ca1
|
|
@@ -14,7 +14,7 @@ type BodyProps = {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
const bodyCSS = ({
|
|
17
|
-
color='
|
|
17
|
+
color='',
|
|
18
18
|
dark=false,
|
|
19
19
|
status='',
|
|
20
20
|
|
|
@@ -34,7 +34,7 @@ const Body = (props: BodyProps) => {
|
|
|
34
34
|
className,
|
|
35
35
|
children,
|
|
36
36
|
text,
|
|
37
|
-
tag='
|
|
37
|
+
tag='div',
|
|
38
38
|
} = props
|
|
39
39
|
|
|
40
40
|
const Tag = `${tag}`
|
|
@@ -10,6 +10,7 @@ module Playbook
|
|
|
10
10
|
configured_data
|
|
11
11
|
configured_id
|
|
12
12
|
configured_tag
|
|
13
|
+
configured_text
|
|
13
14
|
configured_status
|
|
14
15
|
block].freeze
|
|
15
16
|
|
|
@@ -21,6 +22,7 @@ module Playbook
|
|
|
21
22
|
id: default_configuration,
|
|
22
23
|
status: default_configuration,
|
|
23
24
|
tag: default_configuration,
|
|
25
|
+
text: default_configuration,
|
|
24
26
|
&block)
|
|
25
27
|
|
|
26
28
|
self.configured_aria = aria
|
|
@@ -31,6 +33,7 @@ module Playbook
|
|
|
31
33
|
self.configured_id = id
|
|
32
34
|
self.configured_status = status
|
|
33
35
|
self.configured_tag = tag
|
|
36
|
+
self.configured_text = text
|
|
34
37
|
self.block = block_given? ? block : nil
|
|
35
38
|
end
|
|
36
39
|
|
|
@@ -69,7 +72,7 @@ module Playbook
|
|
|
69
72
|
end
|
|
70
73
|
|
|
71
74
|
def yield(context:)
|
|
72
|
-
context.capture(&block)
|
|
75
|
+
!block.nil? ? context.capture(&block) : text
|
|
73
76
|
end
|
|
74
77
|
|
|
75
78
|
def kit_class
|
|
@@ -1,19 +1,28 @@
|
|
|
1
|
-
<%= pb_rails("body", props: {
|
|
2
|
-
I am a body kit
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
I am a body kit (Light)
|
|
6
|
-
<% end %>
|
|
7
|
-
<%= pb_rails("body", props: { color: "lighter", dark: true }) do %>
|
|
8
|
-
I am a body kit (Lighter)
|
|
9
|
-
<% end %>
|
|
1
|
+
<%= pb_rails("body", props: {
|
|
2
|
+
text: "I am a body kit",
|
|
3
|
+
dark: true
|
|
4
|
+
}) %>
|
|
10
5
|
|
|
11
|
-
|
|
6
|
+
<%= pb_rails("body", props: {
|
|
7
|
+
text: "I am a body kit (Light)",
|
|
8
|
+
color: "light",
|
|
9
|
+
dark: true
|
|
10
|
+
}) %>
|
|
12
11
|
|
|
13
|
-
<%= pb_rails("body", props: {
|
|
14
|
-
I am a body kit (
|
|
15
|
-
|
|
12
|
+
<%= pb_rails("body", props: {
|
|
13
|
+
text: "I am a body kit (Lighter)",
|
|
14
|
+
color: "lighter",
|
|
15
|
+
dark: true
|
|
16
|
+
}) %>
|
|
16
17
|
|
|
17
|
-
<%= pb_rails("body", props: {
|
|
18
|
-
I am a body kit (Status:
|
|
19
|
-
|
|
18
|
+
<%= pb_rails("body", props: {
|
|
19
|
+
text: "I am a body kit (Status: negative)",
|
|
20
|
+
status: "negative",
|
|
21
|
+
dark: true
|
|
22
|
+
}) %>
|
|
23
|
+
|
|
24
|
+
<%= pb_rails("body", props: {
|
|
25
|
+
text: "I am a body kit (Status: positive)",
|
|
26
|
+
status: "positive",
|
|
27
|
+
dark: true
|
|
28
|
+
}) %>
|
|
@@ -7,7 +7,8 @@ function BodyDark() {
|
|
|
7
7
|
<Body dark text="I am a body kit (Default)" />
|
|
8
8
|
<Body dark color="light" text="I am a body kit (Light)" />
|
|
9
9
|
<Body dark color="lighter" text="I am a body kit (Lighter)" />
|
|
10
|
-
|
|
10
|
+
<br/>
|
|
11
|
+
<br/>
|
|
11
12
|
<Body dark status="negative" text="I am a body kit (Status: negative)" />
|
|
12
13
|
<Body dark status="positive" text="I am a body kit (Status: positive)" />
|
|
13
14
|
</div>
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
<%= pb_rails("body"
|
|
2
|
-
I am a body kit
|
|
3
|
-
|
|
1
|
+
<%= pb_rails("body", props: {
|
|
2
|
+
text: "I am a body kit"
|
|
3
|
+
}) %>
|
|
4
4
|
|
|
5
|
-
<%= pb_rails("body", props: {
|
|
6
|
-
I am a body kit (Light)
|
|
7
|
-
|
|
5
|
+
<%= pb_rails("body", props: {
|
|
6
|
+
text: "I am a body kit (Light)",
|
|
7
|
+
color: "light"
|
|
8
|
+
}) %>
|
|
8
9
|
|
|
9
|
-
<%= pb_rails("body", props: {
|
|
10
|
-
I am a body kit (Lighter)
|
|
11
|
-
|
|
10
|
+
<%= pb_rails("body", props: {
|
|
11
|
+
text: "I am a body kit (Lighter)",
|
|
12
|
+
color: "lighter"
|
|
13
|
+
}) %>
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
<%= pb_rails("body", props: {
|
|
16
|
+
text: "I am a body kit (Status: negative)",
|
|
17
|
+
status: "negative"
|
|
18
|
+
}) %>
|
|
14
19
|
|
|
15
|
-
<%= pb_rails("body", props: {
|
|
16
|
-
I am a body kit (Status:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
<%= pb_rails("body", props: { status: "positive" }) do %>
|
|
20
|
-
I am a body kit (Status: positive)
|
|
21
|
-
<% end %>
|
|
20
|
+
<%= pb_rails("body", props: {
|
|
21
|
+
text: "I am a body kit (Status: positive)",
|
|
22
|
+
status: "positive"
|
|
23
|
+
}) %>
|
|
@@ -7,7 +7,8 @@ function BodyLight() {
|
|
|
7
7
|
<Body text="I am a body kit (Default)" />
|
|
8
8
|
<Body color="light" text="I am a body kit (Light)" />
|
|
9
9
|
<Body color="lighter" text="I am a body kit (Lighter)" />
|
|
10
|
-
|
|
10
|
+
<br/>
|
|
11
|
+
<br/>
|
|
11
12
|
<Body status="negative" text="I am a body kit (Status: negative)" />
|
|
12
13
|
<Body status="positive" text="I am a body kit (Status: positive)" />
|
|
13
14
|
</div>
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/* @flow */
|
|
2
2
|
|
|
3
3
|
import React, { Component } from 'react'
|
|
4
|
-
import
|
|
4
|
+
import classnames from 'classnames'
|
|
5
5
|
|
|
6
6
|
type ButtonPropTypes = {
|
|
7
7
|
aria?: {
|
|
8
8
|
label: String,
|
|
9
9
|
},
|
|
10
10
|
children?: Array<React.ReactChild>,
|
|
11
|
+
className?: String | Array<String>,
|
|
11
12
|
dark: Boolean,
|
|
12
13
|
disabled?: Boolean,
|
|
13
14
|
fixedWidth?: Boolean,
|
|
@@ -62,6 +63,7 @@ const Button = (props : ButtonPropTypes) => {
|
|
|
62
63
|
const {
|
|
63
64
|
aria={},
|
|
64
65
|
children,
|
|
66
|
+
className,
|
|
65
67
|
icon=null,
|
|
66
68
|
loading=false,
|
|
67
69
|
link=null,
|
|
@@ -70,7 +72,7 @@ const Button = (props : ButtonPropTypes) => {
|
|
|
70
72
|
} = props
|
|
71
73
|
|
|
72
74
|
const buttonAria = buttonAriaProps(props)
|
|
73
|
-
const css = buttonClassName(props)
|
|
75
|
+
const css = classnames(buttonClassName(props), className)
|
|
74
76
|
const loadingIcon = <i className="pb_icon_kit far fa-spinner fa-fw fa-pulse loading-icon"/>
|
|
75
77
|
|
|
76
78
|
const content = (
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<%= content_tag(:div,
|
|
2
2
|
id: object.id,
|
|
3
3
|
data: object.data,
|
|
4
|
-
class: object.classname("
|
|
4
|
+
class: object.classname("pb_layout_#{object.size}#{object.position}#{object.dark}#{object.transparent}#{object.full}#{object.collapse}")) do %>
|
|
5
5
|
<%= object.yield(context: self) %>
|
|
6
6
|
<% end %>
|
|
@@ -41,7 +41,7 @@ class Layout extends Component {
|
|
|
41
41
|
const position_class = "_"+position
|
|
42
42
|
const collapse_class = " layout"+position_class+"_collapse_"+collapse
|
|
43
43
|
return (
|
|
44
|
-
<div className={`
|
|
44
|
+
<div className={`pb_layout${size_class}${position_class}${dark_class}${transparent_class}${full_class}${collapse_class}`}>
|
|
45
45
|
{children}
|
|
46
46
|
</div>
|
|
47
47
|
);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
@import "../tokens/line_height";
|
|
4
4
|
|
|
5
5
|
@mixin pb_title(
|
|
6
|
-
$fontSize: $heading_1,
|
|
6
|
+
$fontSize: $heading_1,
|
|
7
7
|
$fontWeight: $lighter,
|
|
8
8
|
$lineHeight: $lh_tighter){
|
|
9
9
|
font-size: $fontSize;
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
@mixin pb_title_1 {
|
|
18
18
|
@include pb_title($heading_1);
|
|
19
|
+
letter-spacing: -0.03em;
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
@mixin pb_title_2 {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
<br/>
|
|
4
4
|
|
|
5
|
-
<%= pb_rails("title", props: { text: "Title
|
|
6
|
-
<%= pb_rails("title", props: { text: "Title
|
|
7
|
-
<%= pb_rails("title", props: { text: "Title
|
|
8
|
-
<%= pb_rails("title", props: { text: "Title
|
|
5
|
+
<%= pb_rails("title", props: { text: "Title 4", tag: "h4", size: 4, dark: true }) %>
|
|
6
|
+
<%= pb_rails("title", props: { text: "Title 3", tag: "h3", size: 3, dark: true }) %>
|
|
7
|
+
<%= pb_rails("title", props: { text: "Title 2", tag: "h2", size: 2, dark: true }) %>
|
|
8
|
+
<%= pb_rails("title", props: { text: "Title 1", tag: "h1", size: 1, dark: true }) %>
|
|
@@ -4,10 +4,10 @@ import Title from "../_title.jsx"
|
|
|
4
4
|
function TitleDark() {
|
|
5
5
|
return (
|
|
6
6
|
<div>
|
|
7
|
-
<Title dark size={4} tag="h4" text="Title
|
|
8
|
-
<Title dark size={3} tag="h3" text="Title
|
|
9
|
-
<Title dark size={2} tag="h2" text="Title
|
|
10
|
-
<Title dark size={1} tag="h1" text="Title
|
|
7
|
+
<Title dark size={4} tag="h4" text="Title 4" />
|
|
8
|
+
<Title dark size={3} tag="h3" text="Title 3" />
|
|
9
|
+
<Title dark size={2} tag="h2" text="Title 2" />
|
|
10
|
+
<Title dark size={1} tag="h1" text="Title 1" />
|
|
11
11
|
</div>
|
|
12
12
|
)
|
|
13
13
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
<br/>
|
|
4
4
|
|
|
5
|
-
<%= pb_rails("title", props: { text: "Title
|
|
6
|
-
<%= pb_rails("title", props: { text: "Title
|
|
7
|
-
<%= pb_rails("title", props: { text: "Title
|
|
8
|
-
<%= pb_rails("title", props: { text: "Title
|
|
5
|
+
<%= pb_rails("title", props: { text: "Title 4", tag: "h4", size: 4 }) %>
|
|
6
|
+
<%= pb_rails("title", props: { text: "Title 3", tag: "h3", size: 3 }) %>
|
|
7
|
+
<%= pb_rails("title", props: { text: "Title 2", tag: "h2", size: 2 }) %>
|
|
8
|
+
<%= pb_rails("title", props: { text: "Title 1", tag: "h1", size: 1 }) %>
|
|
@@ -5,10 +5,10 @@ function TitleLight() {
|
|
|
5
5
|
return (
|
|
6
6
|
<div>
|
|
7
7
|
<Title text="Default Title"/><br/>
|
|
8
|
-
<Title size={4} tag="h4" text="Title
|
|
9
|
-
<Title size={3} tag="h3" text="Title
|
|
10
|
-
<Title size={2} tag="h2" text="Title
|
|
11
|
-
<Title size={1} tag="h1" text="Title
|
|
8
|
+
<Title size={4} tag="h4" text="Title 4" />
|
|
9
|
+
<Title size={3} tag="h3" text="Title 3" />
|
|
10
|
+
<Title size={2} tag="h2" text="Title 2" />
|
|
11
|
+
<Title size={1} tag="h1" text="Title 1" />
|
|
12
12
|
</div>
|
|
13
13
|
)
|
|
14
14
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import React from 'react'
|
|
5
5
|
|
|
6
6
|
type <%= @kit_name_pascal %>Props = {
|
|
7
|
-
<% @kit_props.each do |key,val| %><%= key == "classname" ? "className?: " : "#{key.camelize(:lower)}?: " %><% case val %><% when "
|
|
7
|
+
<% @kit_props.each do |key,val| %><%= key == "classname" ? "className?: " : "#{key.camelize(:lower)}?: " %><% case val %><% when "enum", "one_of" %>'option_1' | 'option_2',<% when "boolean", "bool" %>Boolean,<% else %>String,<% end %>
|
|
8
8
|
<% end %>
|
|
9
9
|
}
|
|
10
10
|
|
|
@@ -9,7 +9,7 @@ module Playbook
|
|
|
9
9
|
<%= @kit_class_val.join("\n\t\t\t\t") %>
|
|
10
10
|
end
|
|
11
11
|
<% @unique_props.each do |key, val| %>
|
|
12
|
-
def <%= key.to_s.underscore %><% case val %><% when "
|
|
12
|
+
def <%= key.to_s.underscore %><% case val %><% when "enum", "one_of" %>
|
|
13
13
|
<%= key.to_s.underscore %>_options = %w(option1 option2)
|
|
14
14
|
one_of_value(configured_<%= key.to_s.underscore %>, <%= key.to_s.underscore %>_options, "")<% when "boolean", "bool" %>
|
|
15
15
|
true_value(configured_<%= key.to_s.underscore %>, "true value", "false value")<% else %>
|
data/lib/playbook/version.rb
CHANGED
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: 2.
|
|
4
|
+
version: 2.9.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: 2019-09-
|
|
12
|
+
date: 2019-09-24 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: method_source
|
|
@@ -417,6 +417,8 @@ files:
|
|
|
417
417
|
- app/pb_kits/playbook/pb_body/_body.scss
|
|
418
418
|
- app/pb_kits/playbook/pb_body/_body_mixins.scss
|
|
419
419
|
- app/pb_kits/playbook/pb_body/body.rb
|
|
420
|
+
- app/pb_kits/playbook/pb_body/docs/_body_block.html.erb
|
|
421
|
+
- app/pb_kits/playbook/pb_body/docs/_body_block.jsx
|
|
420
422
|
- app/pb_kits/playbook/pb_body/docs/_body_dark.html.erb
|
|
421
423
|
- app/pb_kits/playbook/pb_body/docs/_body_dark.jsx
|
|
422
424
|
- app/pb_kits/playbook/pb_body/docs/_body_light.html.erb
|