playbook_ui 2.8.9 → 2.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4f9e84db4ccb31383e19cb882e7225455d347fda5571daed019d79d8b8daf716
4
- data.tar.gz: 6b34648478a78f753458727976e3dce218f34fcd24aba24eeee38ec312dd2c55
3
+ metadata.gz: 5b6c7dc11c38335138d659f925a534eb976a2c612f3ae5bc19577640e1cfc3ea
4
+ data.tar.gz: 19b251b77226a249bb7da7eb923ee198fa00b53d2e44e14d4f7f84e6102b401a
5
5
  SHA512:
6
- metadata.gz: 3568843cb54b4e11011ce9bd16c07880acb30b8404d0d59b57f137c03f9abee485e6970aef9683a7ed955e8ec09b78dd4f1bf2c38760c21368bb8002056cc10b
7
- data.tar.gz: 651148155a79e850637f7217f714f7e38d3aa5d7164be550ec00a70f210a0ff4efe05b5b7da475482db77a533d5e2e7c44bbd8e0b693f253c4b2696f421b5b5d
6
+ metadata.gz: 89441d84f686920f6ed1d833b8b06e4324ff3af6de03ab9cd4b68c4e2a7b22c30719bb238ed183e65388e662d1b8e3e498e92d7c3f4647bfda3e79b18fda1874
7
+ data.tar.gz: 2720ae93d19c177cec30a544edc3b649ed9b593a52f805eb11263bcf2eef997d4eba36f1e0af7688a816f82c28273ac96ec34f7e6df80ce190750cc77f5d6ca1
@@ -104,6 +104,7 @@
104
104
  position: relative;
105
105
  border-top: 1px solid $border-light;
106
106
  display: none;
107
+ overflow-x: auto;
107
108
  }
108
109
 
109
110
  &.dark_ui {
@@ -14,7 +14,7 @@ type BodyProps = {
14
14
  }
15
15
 
16
16
  const bodyCSS = ({
17
- color='default',
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='p',
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
@@ -0,0 +1,3 @@
1
+ <%= pb_rails("body") do %>
2
+ I am body kit
3
+ <% end %>
@@ -0,0 +1,14 @@
1
+ import React from "react"
2
+ import Body from "../_body.jsx"
3
+
4
+ function BodyBlock() {
5
+ return (
6
+ <div>
7
+ <Body>
8
+ I am a body kit
9
+ </Body>
10
+ </div>
11
+ )
12
+ }
13
+
14
+ export default BodyBlock;
@@ -1,19 +1,28 @@
1
- <%= pb_rails("body", props: { dark: true }) do %>
2
- I am a body kit
3
- <% end %>
4
- <%= pb_rails("body", props: { color: "light", dark: true }) do %>
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
- <br><br>
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: { status: "negative", dark: true }) do %>
14
- I am a body kit (Status: negative)
15
- <% end %>
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: { status: "positive", dark: true }) do %>
18
- I am a body kit (Status: positive)
19
- <% end %>
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") do %>
2
- I am a body kit
3
- <% end %>
1
+ <%= pb_rails("body", props: {
2
+ text: "I am a body kit"
3
+ }) %>
4
4
 
5
- <%= pb_rails("body", props: { color: "light" }) do %>
6
- I am a body kit (Light)
7
- <% end %>
5
+ <%= pb_rails("body", props: {
6
+ text: "I am a body kit (Light)",
7
+ color: "light"
8
+ }) %>
8
9
 
9
- <%= pb_rails("body", props: { color: "lighter" }) do %>
10
- I am a body kit (Lighter)
11
- <% end %>
10
+ <%= pb_rails("body", props: {
11
+ text: "I am a body kit (Lighter)",
12
+ color: "lighter"
13
+ }) %>
12
14
 
13
- <br><br>
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: { status: "negative" }) do %>
16
- I am a body kit (Status: negative)
17
- <% end %>
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>
@@ -2,6 +2,8 @@ examples:
2
2
  rails:
3
3
  - body_light: Light UI
4
4
  - body_dark: Dark UI
5
+ - body_block: Block
5
6
  react:
6
7
  - body_light: Light UI
7
8
  - body_dark: Dark UI
9
+ - body_block: Block
@@ -1,2 +1,3 @@
1
1
  export {default as BodyDark} from './_body_dark.jsx';
2
2
  export {default as BodyLight} from './_body_light.jsx';
3
+ export {default as BodyBlock} from './_body_block.jsx';
@@ -1,13 +1,14 @@
1
1
  /* @flow */
2
2
 
3
3
  import React, { Component } from 'react'
4
- import PropTypes from 'prop-types'
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("layout_#{object.size}#{object.position}#{object.dark}#{object.transparent}#{object.full}#{object.collapse}")) do %>
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={`layout${size_class}${position_class}${dark_class}${transparent_class}${full_class}${collapse_class}`}>
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/screen_sizes";
4
4
  @import "./layout_mixin";
5
5
 
6
- .layout {
6
+ .pb_layout {
7
7
 
8
8
  $layout_sizes: (
9
9
  "xs": 64px,
@@ -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 1", tag: "h4", size: 4, dark: true }) %>
6
- <%= pb_rails("title", props: { text: "Title 2", tag: "h3", size: 3, dark: true }) %>
7
- <%= pb_rails("title", props: { text: "Title 3", tag: "h2", size: 2, dark: true }) %>
8
- <%= pb_rails("title", props: { text: "Title 4", tag: "h1", size: 1, dark: true }) %>
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 1" />
8
- <Title dark size={3} tag="h3" text="Title 2" />
9
- <Title dark size={2} tag="h2" text="Title 3" />
10
- <Title dark size={1} tag="h1" text="Title 4" />
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 1", tag: "h4", size: 4 }) %>
6
- <%= pb_rails("title", props: { text: "Title 2", tag: "h3", size: 3 }) %>
7
- <%= pb_rails("title", props: { text: "Title 3", tag: "h2", size: 2 }) %>
8
- <%= pb_rails("title", props: { text: "Title 4", tag: "h1", size: 1 }) %>
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 1" />
9
- <Title size={3} tag="h3" text="Title 2" />
10
- <Title size={2} tag="h2" text="Title 3" />
11
- <Title size={1} tag="h1" text="Title 4" />
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 "array", "arr" %>'option_1' | 'option_2',<% when "boolean", "bool" %>Boolean,<% else %>String,<% end %>
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 "array", "arr" %>
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 %>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Playbook
4
- VERSION = "2.8.9"
4
+ VERSION = "2.9.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: 2.8.9
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-20 00:00:00.000000000 Z
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