playbook_ui 6.8.1 → 6.8.2.pre.alpha1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9da1bcd99d97219437802ff40b916426aaf6323cd68d181b9a46fe25aec0dec0
4
- data.tar.gz: d50d61ffa850d8b123972e6b0d2ff487b52950d633d17d73dc2ddaa6bbcc3239
3
+ metadata.gz: c741c41b034e5f6ee2c76ca8c5d4ae7e6aeed017fc75eafa99c104a67404d40e
4
+ data.tar.gz: bf3bf4865392190b6c9778979231cf4b9bd6d5ffbe1731bbf9106fadbb4cc490
5
5
  SHA512:
6
- metadata.gz: 0142e4cab59c32f367c4717477a373a6c405e0bfd2bb1d41a9fd6e7676d4a7947e6b59e62446e1916b57c0e3cf5b298e76a5871a07cd37d2d32a3142b4dc64d6
7
- data.tar.gz: fd8280a71c9d8467a01a50fd94513b6543019d183d9736fd774a9029c213187e817c25ec5d96dfcf1cbe27c116899b17b3dd744dc04b4a6aebad5c9d125cbe30
6
+ metadata.gz: 7cf3a912b48ced76c46cade9bdb30f383e259c3bf7ab94e08c480051c30a754feca89035dd120ca17819631b71a21d218ed57a031911520c8c852f343fc3f40c
7
+ data.tar.gz: 41c7bc0103ed5670cc9aec9ed3f274581ea6e30ec661019f9b11ce67d9447a3959cdad7bb2a1fd338184d507b15395865038dfa65b0cb1f783fe223a846cad7b
@@ -5,7 +5,7 @@ module Playbook
5
5
  class Body
6
6
  include Playbook::Props
7
7
  include ActionView::Helpers
8
-
8
+
9
9
  partial "pb_body/body"
10
10
 
11
11
  prop :color, type: Playbook::Props::Enum,
@@ -1,5 +1,7 @@
1
- <%= content_tag(object.tag, object.text,
2
- id: object.id,
3
- data: object.data,
4
- class: object.classname,
5
- aria: object.aria) %>
1
+ <%= content_tag(object.tag,
2
+ aria: object.aria,
3
+ id: object.id,
4
+ data: object.data,
5
+ class: object.classname) do %>
6
+ <%= object.children.present? ? capture(&object.children) : object.text %>
7
+ <% end %>
@@ -0,0 +1,11 @@
1
+ <%= pb_rails("caption") do %>
2
+ Block
3
+ <% end %>
4
+
5
+ <%= pb_rails("caption", props: { size: 'lg' }) do %>
6
+ Large Block
7
+ <% end %>
8
+
9
+ <%= pb_rails("caption", props: { size: 'xs' }) do %>
10
+ Subcaption Block
11
+ <% end %>
@@ -0,0 +1,28 @@
1
+ import React from 'react'
2
+ import { Caption } from '../../'
3
+
4
+ const CaptionBlock = (props) => {
5
+ return (
6
+ <div>
7
+ <Caption {...props}>
8
+ {'Block'}
9
+ </Caption>
10
+
11
+ <Caption
12
+ {...props}
13
+ size="lg"
14
+ >
15
+ {'Large Block'}
16
+ </Caption>
17
+
18
+ <Caption
19
+ {...props}
20
+ size="xs"
21
+ >
22
+ {'Subcaption Block'}
23
+ </Caption>
24
+ </div>
25
+ )
26
+ }
27
+
28
+ export default CaptionBlock
@@ -1,5 +1,7 @@
1
1
  examples:
2
2
  rails:
3
3
  - caption_light: Default
4
+ - caption_block: Block
4
5
  react:
5
6
  - caption_light: Default
7
+ - caption_block: Block
@@ -1,2 +1,3 @@
1
1
  export { default as CaptionLight } from './_caption_light.jsx'
2
2
  export { default as CaptionVariants } from './_caption_variants.jsx'
3
+ export { default as CaptionBlock } from './_caption_block.jsx'
@@ -25,14 +25,11 @@
25
25
  <%= form.select :example_select, [ ["Yes", 1], ["No", 2] ], props: { label: true } %>
26
26
  <%= form.collection_select :example_collection_select, example_collection, :value, :name, props: { label: true } %>
27
27
  <%= form.check_box :example_checkbox,
28
- data: { field1: "value1", field2: "value2" },
29
- props: { text: "Example Checkbox", label: true },
30
- checked_value: "yes",
31
- unchecked_value: "no",
32
- id: "checkbox-id",
33
- name: "checkbox-name",
34
- class: "checkbox-class"
35
- %>
28
+ data: { field1: "value1", field2: "value2" },
29
+ props: { text: "Example Checkbox", label: true },
30
+ id: "checkbox-id",
31
+ name: "checkbox-name",
32
+ class: "checkbox-class" %>
36
33
  <%= form.date_picker :example_date_picker1, props: { default_date: "blank" } %>
37
34
 
38
35
  <%= form.actions do |action| %>
@@ -4,18 +4,13 @@ module Playbook
4
4
  module PbForm
5
5
  module FormBuilder
6
6
  module CheckboxField
7
- def check_box(name, props: {}, **options)
7
+ def check_box(name, props: {}, **options, &block)
8
8
  label_text = @template.label(@object_name, name) if props[:label] == true
9
9
  options[:required] = true if props[:required]
10
10
  props[:margin_bottom] = "sm"
11
11
  props[:form_spacing] = true
12
12
 
13
- checked_value = options[:checked_value]
14
- unchecked_value = options[:unchecked_value]
15
- options.delete(:checked_value)
16
- options.delete(:unchecked_value)
17
-
18
- input = super(name, options, checked_value, unchecked_value)
13
+ input = super(name, **options, &block)
19
14
 
20
15
  if props[:label]
21
16
  @template.pb_rails("caption", props: { text: label_text, margin_bottom: "xs" }) +
@@ -2,39 +2,36 @@
2
2
  id: object.id,
3
3
  data: object.data,
4
4
  class: object.classname) do %>
5
- <%
6
- # convert deprecated prop values
7
- size = object.size
8
- size = "sm" if object.size == "xs"
9
- size = "md" if object.size == "lg"
10
- %>
5
+ <%
6
+ # convert deprecated prop values
7
+ size = object.size
8
+ size = "sm" if object.size == "xs"
9
+ size = "md" if object.size == "lg"
10
+ %>
11
11
  <% if size == "md" %>
12
12
  <% if object.show_icon %>
13
13
  <%= pb_rails("body", props: { color: "light", tag: "span"}) do %>
14
- <%= pb_rails("icon", props: { icon: "clock", fixed_width: true, size: "lg" }) %>
14
+ <%= pb_rails("icon", props: { icon: "clock", fixed_width: true }) %>
15
15
  <% end %>
16
16
  <% end %>
17
- <%= pb_rails("caption", props: { tag: "span", text: object.format_time_string, size: "lg" }) %>
17
+ <%= pb_rails("body", props: { tag: "span", text: object.format_time_string, classname: "pb_time" }) %>
18
18
  <% if object.show_timezone %>
19
- <%= content_tag(:span, class: "pb_time_timezone") do %>
20
- <%= object.pb_date_time.to_timezone.upcase %>
21
- <% end %>
19
+ <%= pb_rails("body", props: { color: "light", tag: "span", text: object.pb_date_time.to_timezone.upcase }) %>
22
20
  <% end %>
23
21
  <% else %>
24
22
  <% if object.show_icon %>
25
23
  <%= pb_rails("body", props: { color: "light", tag: "span"}) do %>
26
- <%= pb_rails("icon", props: { icon: "clock", fixed_width: true }) %>
24
+ <%= pb_rails("icon", props: { icon: "clock", fixed_width: true, size: "sm" }) %>
27
25
  <% end %>
28
26
  <% end %>
29
- <%= pb_rails("body", props: { color: "light", tag: "span", text: object.format_time_string }) do %>
27
+
28
+ <%= pb_rails("caption", props: { color: "light", tag: "span", text: object.format_time_string }) do %>
30
29
  <%= content_tag(:time, datetime: object.pb_date_time.to_iso) do %>
31
- <%= content_tag(:span) do %>
32
- <%= object.format_time_string %>
33
- <% if object.show_timezone %>
34
- <%= content_tag(:span, class: "pb_time_timezone") do %>
35
- <%= object.pb_date_time.to_timezone.upcase %>
36
- <% end %>
37
- <% end %>
30
+ <%= object.format_time_string %>
31
+ <% if object.show_timezone %>
32
+ <span class="pb_time_timezone">
33
+ <%= object.pb_date_time.to_timezone.upcase %>
34
+ </span>
38
35
  <% end %>
39
36
  <% end %>
40
37
  <% end %>
@@ -18,11 +18,12 @@ type TimeProps = {
18
18
  id?: string,
19
19
  showIcon?: boolean,
20
20
  size?: 'md' | 'sm',
21
+ showTimezone?: boolean,
21
22
  timeZone?: string,
22
23
  }
23
24
 
24
25
  const Time = (props: TimeProps) => {
25
- const { align, className, date, showIcon, size, timeZone } = props
26
+ const { align, className, date, showIcon, size, timeZone, showTimezone = true } = props
26
27
  const classes = classnames(
27
28
  buildCss('pb_time_kit', align, size),
28
29
  globalProps(props),
@@ -33,41 +34,53 @@ const Time = (props: TimeProps) => {
33
34
 
34
35
  return (
35
36
  <div className={classes}>
36
- <span className="pb_body_kit">
37
- <If condition={showIcon}>
38
- <Body
39
- color="light"
40
- tag="span"
41
- >
42
- <Icon
43
- fixedWidth
44
- icon="clock"
45
- size={size === 'md' ? 'lg' : 'sm'}
37
+ <If condition={showIcon}>
38
+ <Body
39
+ color="light"
40
+ tag="span"
41
+ >
42
+ <Icon
43
+ fixedWidth
44
+ icon="clock"
45
+ size={size === 'md' ? '' : 'sm'}
46
+ />
47
+ </Body>
48
+ {' '}
49
+ </If>
50
+
51
+ <time dateTime={date}>
52
+ <span>
53
+ <If condition={size === 'md'}>
54
+ <Body
55
+ className="pb_time"
56
+ tag="span"
57
+ text={dateTimestamp.toTimeWithMeridian()}
46
58
  />
47
- </Body>
48
- {' '}
49
- </If>
50
- <time dateTime={date}>
51
- <span>
52
- <If condition={size !== 'md'}>
59
+ {' '}
60
+ <If condition={showTimezone}>
53
61
  <Body
54
62
  color="light"
55
63
  tag="span"
56
- text={dateTimestamp.toTimeWithMeridian()}
64
+ text={dateTimestamp.toTimezone()}
57
65
  />
58
- <Else />
66
+ </If>
67
+ <Else />
68
+ <Caption
69
+ color="light"
70
+ tag="span"
71
+ text={dateTimestamp.toTimeWithMeridian()}
72
+ />
73
+ {' '}
74
+ <If condition={showTimezone}>
59
75
  <Caption
60
- size="lg"
76
+ color="light"
61
77
  tag="span"
62
- text={dateTimestamp.toTimeWithMeridian()}
78
+ text={dateTimestamp.toTimezone()}
63
79
  />
64
80
  </If>
65
- <If condition={timeZone !== undefined}>
66
- <span className="pb_time_timezone">{dateTimestamp.toTimezone()}</span>
67
- </If>
68
- </span>
69
- </time>
70
- </span>
81
+ </If>
82
+ </span>
83
+ </time>
71
84
  </div>
72
85
  )
73
86
  }
@@ -5,8 +5,6 @@
5
5
  @import "../pb_caption/caption";
6
6
 
7
7
  [class^=pb_time_kit] {
8
- letter-spacing: $lspace_looser;
9
- text-transform: uppercase;
10
8
  &[class*=_center] {
11
9
  text-align: center;
12
10
  }
@@ -15,10 +13,6 @@
15
13
  text-align: right;
16
14
  }
17
15
 
18
- [class^=pb_body] {
19
- font-weight: $bold !important;
20
- }
21
-
22
16
  [class^=pb_time_timezone] {
23
17
  color: $text_lt_light;
24
18
  font-weight: $bold;
@@ -28,26 +22,12 @@
28
22
  }
29
23
  }
30
24
 
31
- &[class*=_md] {
32
- [class^=pb_caption_kit] {
33
- color: $text_lt_default;
34
- letter-spacing: $lspace_tight;
35
- text-transform: capitalize;
36
- }
37
- [class^=pb_time_timezone] {
38
- color: $text_lt_light;
39
- font-size: $font-large !important;
40
- font-weight: $regular;
41
- letter-spacing: $lspace_tight;
25
+ &[class*=dark] {
26
+ & * {
27
+ @include caption_dark;
42
28
  }
43
- }
44
-
45
- &.dark {
46
- [class^=pb_caption_kit] {
29
+ .pb_time {
47
30
  color: $text_dk_default;
48
31
  }
49
- [class^=pb_body_kit] {
50
- color: $text_dk_light;
51
- }
52
32
  }
53
33
  }
@@ -1,24 +1,27 @@
1
1
  import React from 'react'
2
2
  import Time from '../_time.jsx'
3
3
 
4
- const TimeAlign = () => {
4
+ const TimeAlign = (props) => {
5
5
  return (
6
6
  <div>
7
7
  <Time
8
8
  date={new Date()}
9
9
  size="md"
10
+ {...props}
10
11
  />
11
12
  <br />
12
13
  <Time
13
14
  align="center"
14
15
  date={new Date()}
15
16
  size="md"
17
+ {...props}
16
18
  />
17
19
  <br />
18
20
  <Time
19
21
  align="right"
20
22
  date={new Date()}
21
23
  size="md"
24
+ {...props}
22
25
  />
23
26
  </div>
24
27
  )
@@ -1,38 +1,38 @@
1
1
  <%= pb_rails("time", props: {
2
2
  show_timezone: false,
3
- time: Time.now,
3
+ time: Time.now
4
4
  }) %>
5
5
 
6
6
  <br>
7
7
 
8
8
  <%= pb_rails("time", props: {
9
9
  time: DateTime.now,
10
- timezone: "America/Chicago"
10
+ timezone: "America/New_York"
11
11
  }) %>
12
12
 
13
13
  <br>
14
14
 
15
15
  <%= pb_rails("time", props: {
16
- time: "2012-08-02T15:49:29Z",
17
16
  show_icon: true,
18
17
  show_timezone: false,
18
+ time: "2012-08-02T15:49:29Z",
19
19
  }) %>
20
20
 
21
21
  <br>
22
22
 
23
23
  <%= pb_rails("time", props: {
24
- time: "2012-08-02T15:49:29Z",
25
24
  show_icon: true,
26
- timezone: "America/Chicago"
25
+ time: "2012-08-02T15:49:29Z",
26
+ timezone: "America/New_York"
27
27
  }) %>
28
28
 
29
- <br>
30
- <br>
29
+ <br>
30
+ <br>
31
31
 
32
- <%= pb_rails("time", props: {
33
- time: Time.now,
34
- size: "md",
32
+ <%= pb_rails("time", props: {
35
33
  show_timezone: false,
34
+ size: "md",
35
+ time: Time.now,
36
36
  }) %>
37
37
 
38
38
  <br>
@@ -47,8 +47,8 @@
47
47
 
48
48
  <%= pb_rails("time", props: {
49
49
  show_icon: true,
50
- size: "md",
51
50
  show_timezone: false,
51
+ size: "md",
52
52
  time: "2012-08-02T15:49:29Z",
53
53
  }) %>
54
54
 
@@ -1,45 +1,56 @@
1
1
  import React from 'react'
2
2
  import Time from '../_time.jsx'
3
3
 
4
- const TimeDefault = () => {
4
+ const TimeDefault = (props) => {
5
5
  return (
6
6
  <div>
7
7
  <Time
8
8
  date={new Date().getTime()}
9
+ showTimezone={false}
10
+ {...props}
9
11
  />
10
12
  <br />
11
13
  <Time
12
14
  date={new Date()}
13
15
  timeZone="America/New_York"
16
+ {...props}
14
17
  />
15
18
  <br />
16
19
  <Time
17
20
  date={new Date().getTime()}
18
21
  showIcon
22
+ showTimezone={false}
23
+ {...props}
19
24
  />
20
25
  <br />
21
26
  <Time
22
27
  date={new Date()}
23
28
  showIcon
24
29
  timeZone="America/New_York"
30
+ {...props}
25
31
  />
26
32
  <br />
27
33
  <br />
28
34
  <Time
29
35
  date={new Date()}
36
+ showTimezone={false}
30
37
  size="md"
38
+ {...props}
31
39
  />
32
40
  <br />
33
41
  <Time
34
42
  date={new Date()}
35
43
  size="md"
36
44
  timeZone="America/New_York"
45
+ {...props}
37
46
  />
38
47
  <br />
39
48
  <Time
40
49
  date={new Date()}
41
50
  showIcon
51
+ showTimezone={false}
42
52
  size="md"
53
+ {...props}
43
54
  />
44
55
  <br />
45
56
  <Time
@@ -47,6 +58,7 @@ const TimeDefault = () => {
47
58
  showIcon
48
59
  size="md"
49
60
  timeZone="America/New_York"
61
+ {...props}
50
62
  />
51
63
  </div>
52
64
  )
@@ -1,16 +1,19 @@
1
1
  import React, { Fragment } from 'react'
2
2
  import Time from '../_time.jsx'
3
3
 
4
- const TimeSizes = () => {
4
+ const TimeSizes = (props) => {
5
5
  return (
6
6
  <Fragment>
7
7
  <Time
8
8
  date={new Date()}
9
+ {...props}
9
10
  />
10
11
  <br />
11
12
  <Time
12
13
  date={new Date()}
13
14
  size="md"
15
+ timeZone="America/New_York"
16
+ {...props}
14
17
  />
15
18
  </Fragment>
16
19
  )
@@ -1,12 +1,13 @@
1
1
  import React from 'react'
2
2
  import Time from '../_time.jsx'
3
3
 
4
- const TimeStamp = () => {
4
+ const TimeStamp = (props) => {
5
5
  return (
6
6
  <div>
7
7
  <Time
8
8
  date={new Date()}
9
9
  size="sm"
10
+ {...props}
10
11
  />
11
12
 
12
13
  <br />
@@ -14,6 +15,7 @@ const TimeStamp = () => {
14
15
  <Time
15
16
  date={new Date().getTime()}
16
17
  size="sm"
18
+ {...props}
17
19
  />
18
20
  </div>
19
21
  )
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
2
  import Time from '../_time.jsx'
3
3
 
4
- const TimeTimeZone = () => {
4
+ const TimeTimezone = (props) => {
5
5
  const zones = {
6
6
  east: 'America/New_York',
7
7
  central: 'America/Chicago',
@@ -16,6 +16,7 @@ const TimeTimeZone = () => {
16
16
  date={new Date()}
17
17
  size="md"
18
18
  timeZone={zones.east}
19
+ {...props}
19
20
  />
20
21
 
21
22
  <br />
@@ -24,6 +25,7 @@ const TimeTimeZone = () => {
24
25
  <Time
25
26
  date={new Date()}
26
27
  timeZone={zones.central}
28
+ {...props}
27
29
  />
28
30
 
29
31
  <br />
@@ -32,6 +34,7 @@ const TimeTimeZone = () => {
32
34
  <Time
33
35
  date={new Date()}
34
36
  timeZone={zones.mountain}
37
+ {...props}
35
38
  />
36
39
 
37
40
  <br />
@@ -40,6 +43,7 @@ const TimeTimeZone = () => {
40
43
  <Time
41
44
  date={new Date()}
42
45
  timeZone={zones.west}
46
+ {...props}
43
47
  />
44
48
 
45
49
  <br />
@@ -48,10 +52,11 @@ const TimeTimeZone = () => {
48
52
  <Time
49
53
  date={new Date()}
50
54
  timeZone={zones.asia}
55
+ {...props}
51
56
  />
52
57
 
53
58
  </div>
54
59
  )
55
60
  }
56
61
 
57
- export default TimeTimeZone
62
+ export default TimeTimezone
@@ -34,4 +34,4 @@ module Playbook
34
34
  end
35
35
  end
36
36
  end
37
- end
37
+ end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Playbook
3
- VERSION = "6.8.1"
3
+ VERSION = "6.8.2.pre.alpha1"
4
4
  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: 6.8.1
4
+ version: 6.8.2.pre.alpha1
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-09-29 00:00:00.000000000 Z
12
+ date: 2020-10-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -551,6 +551,8 @@ files:
551
551
  - app/pb_kits/playbook/pb_caption/_caption.scss
552
552
  - app/pb_kits/playbook/pb_caption/_caption_mixin.scss
553
553
  - app/pb_kits/playbook/pb_caption/caption.rb
554
+ - app/pb_kits/playbook/pb_caption/docs/_caption_block.html.erb
555
+ - app/pb_kits/playbook/pb_caption/docs/_caption_block.jsx
554
556
  - app/pb_kits/playbook/pb_caption/docs/_caption_light.html.erb
555
557
  - app/pb_kits/playbook/pb_caption/docs/_caption_light.jsx
556
558
  - app/pb_kits/playbook/pb_caption/docs/_caption_variants.html.erb
@@ -1909,9 +1911,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
1909
1911
  version: '0'
1910
1912
  required_rubygems_version: !ruby/object:Gem::Requirement
1911
1913
  requirements:
1912
- - - ">="
1914
+ - - ">"
1913
1915
  - !ruby/object:Gem::Version
1914
- version: '0'
1916
+ version: 1.3.1
1915
1917
  requirements: []
1916
1918
  rubygems_version: 3.1.4
1917
1919
  signing_key: