playbook_ui 5.2.0.pre.alpha7 → 5.2.0.pre.alpha12

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: dbcfb4afe737aa52e1bd3d4b93d5de7abcbeadb856fa49c060a10c21f6748e0a
4
- data.tar.gz: 1f3c9898d30fd0786d6d92db410cda5e2c70d6ce541401ac56c32f640560fe98
3
+ metadata.gz: 584fe4acaeb40060675ce04750d7202873edc0cf320c489df052e386228a0af8
4
+ data.tar.gz: c2ad56b5b785919092692e28ede675687a36a3be7d750b9367b5a2b3f396ae08
5
5
  SHA512:
6
- metadata.gz: 4292280880c8290a9d20b8df3f714b79cae8aa18e722bca8b461dc3b2fa67be8f6dc86a3f862b0b52fff54aa83fc1da796dd96888d9cb9955ab4ac09ae2e53a9
7
- data.tar.gz: 06b83d682499577677f36b5431779023ec185ab5b896c57cfe46a67cfa1a83c9421dc0f5b147f9c2ac5c859834367a31c364e93379b2bcc2d0fd87a7b1ec2bda
6
+ metadata.gz: ec4af4fa1be322f7fde3347dca49eae2e15a64da499d1fa46d7c7e469ce762899526002204f09bc43211ddac0a350108ab78175de1075a0cb64a5c4664adce44
7
+ data.tar.gz: 77a07642cc1a8b1fec9a014b95a8ff48a5d302bd790577b6582f33d99c534c32dba3689d6d33d9218a5984952e46dca339f3fdbb34952d3de977e4e8a9e00bb8
@@ -15,6 +15,7 @@ module Playbook
15
15
  self.prefix_partial_path_with_controller_namespace = previous
16
16
  end
17
17
 
18
+ # deprecated
18
19
  def pb_react(kit, props: {}, options: {})
19
20
  ::Webpacker::React::Component.new(kit.camelize).render(props, options)
20
21
  end
@@ -1,3 +1,4 @@
1
+ @import "tokens/fonts";
1
2
  @import "pb_body/body";
2
3
  @import "pb_button/button";
3
4
  @import "pb_caption/caption";
@@ -1,12 +1 @@
1
- <%= content_tag(:div, "",
2
- aria: object.aria,
3
- id: object.id,
4
- data: object.data,
5
- class: object.classname) %>
6
- <% content_for :pb_js do %>
7
- <%= javascript_tag do %>
8
- window.addEventListener('DOMContentLoaded', function() {
9
- new pbChart('.selector', <%= object.chart_options %>)
10
- })
11
- <% end %>
12
- <% end %>
1
+ <%= react_component('BarGraph', object.chart_options) %>
@@ -44,7 +44,7 @@ module Playbook
44
44
  legend: legend,
45
45
  toggleLegendClick: toggle_legend_click,
46
46
  height: height,
47
- }.to_json.html_safe
47
+ }
48
48
  end
49
49
 
50
50
  def classname
@@ -1,8 +1 @@
1
- <%= content_tag(:figure,
2
- id: object.id,
3
- data: object.data,
4
- class: object.classname) do %>
5
- <% object.widths_to_percentages.each do |percentage| %>
6
- <div class="pb_distribution_width" style="width:<%= percentage %>%"></div>
7
- <% end %>
8
- <% end %>
1
+ <%= react_component('DistributionBar', object.chart_options) %>
@@ -13,14 +13,11 @@ module Playbook
13
13
  prop :widths, type: Playbook::Props::NumberArray,
14
14
  default: [1]
15
15
 
16
- def classname
17
- generate_classname("pb_distribution_bar", size)
18
- end
19
-
20
- def widths_to_percentages
21
- widths.map do |width|
22
- (width.to_f * 100 / widths.sum).round(2)
23
- end
16
+ def chart_options
17
+ {
18
+ size: size,
19
+ widths: widths
20
+ }
24
21
  end
25
22
  end
26
23
  end
@@ -0,0 +1,7 @@
1
+ <%= content_tag(:div,
2
+ aria: object.aria,
3
+ class: object.classname,
4
+ data: object.data,
5
+ id: object.id) do %>
6
+ <span>FOO CONTENT</span>
7
+ <% end %>
@@ -0,0 +1,39 @@
1
+ /* @flow */
2
+
3
+ import React from 'react'
4
+ import classnames from 'classnames'
5
+ import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
6
+ import { spacing } from '../utilities/spacing.js'
7
+
8
+ type FooProps = {
9
+ aria?: object,
10
+ className?: String,
11
+ data?: object,
12
+ id?: String,
13
+ }
14
+
15
+ const Foo = (props: FooProps) => {
16
+ const {
17
+ aria = {},
18
+ className = 'test_foo',
19
+ data = {},
20
+ id,
21
+ } = props
22
+
23
+ const ariaProps = buildAriaProps(aria)
24
+ const dataProps = buildDataProps(data)
25
+ const classes = classnames(buildCss('pb_foo'), className, spacing(props))
26
+
27
+ return (
28
+ <div
29
+ {...ariaProps}
30
+ {...dataProps}
31
+ className={classes}
32
+ id={id}
33
+ >
34
+ {className}
35
+ </div>
36
+ )
37
+ }
38
+
39
+ export default Foo
@@ -0,0 +1,3 @@
1
+ .pb_foo {
2
+
3
+ }
@@ -0,0 +1 @@
1
+ <%= pb_rails("foo") %>
@@ -0,0 +1,10 @@
1
+ import React from 'react'
2
+ import { Foo } from '../../'
3
+
4
+ const FooDefault = () => (
5
+ <div>
6
+ <Foo />
7
+ </div>
8
+ )
9
+
10
+ export default FooDefault
@@ -0,0 +1,9 @@
1
+ examples:
2
+
3
+ rails:
4
+ - foo_default: Default
5
+
6
+
7
+ react:
8
+ - foo_default: Default
9
+
@@ -0,0 +1 @@
1
+ export { default as FooDefault } from './_foo_default.jsx'
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Playbook
4
+ module PbFoo
5
+ class Foo
6
+ include Playbook::Props
7
+
8
+ partial "pb_foo/foo"
9
+ end
10
+ end
11
+ end
@@ -1,10 +1 @@
1
- <%= content_tag(:div, object.text,
2
- id: object.id,
3
- data: object.data,
4
- class: object.classname) do %>
5
- <%= pb_rails("body", props: {color: object.body_color}) do %>
6
- <span class="pb_legend_indicator_circle"></span>
7
- <%= pb_rails("title", props: { dark: object.dark, text: object.prefix_text, tag: "span", size: 4 }) %>
8
- <%= object.text %>
9
- <% end %>
10
- <% end %>
1
+ <%= react_component('Legend', object.chart_options) %>
@@ -25,6 +25,13 @@ module Playbook
25
25
  def classname
26
26
  generate_classname("pb_legend_kit", color, dark ? "dark" : "light")
27
27
  end
28
+
29
+ def chart_options
30
+ {
31
+ color: color,
32
+ text: text
33
+ }
34
+ end
28
35
  end
29
36
  end
30
37
  end
@@ -1,13 +1 @@
1
- <%= content_tag(:div, "",
2
- aria: object.aria,
3
- id: object.id,
4
- data: object.data,
5
- class: object.classname
6
- ) %>
7
- <% content_for :pb_js do %>
8
- <%= javascript_tag do %>
9
- window.addEventListener('DOMContentLoaded', function() {
10
- new pbChart('.selector', <%= object.chart_options %>)
11
- })
12
- <% end %>
13
- <% end %>
1
+ <%= react_component('LineGraph', object.chart_options) %>
@@ -44,7 +44,7 @@ module Playbook
44
44
  legend: legend,
45
45
  toggleLegendClick: toggle_legend_click,
46
46
  height: height,
47
- }.to_json.html_safe
47
+ }
48
48
  end
49
49
 
50
50
  def classname
@@ -1,10 +1,10 @@
1
1
  @import "./opacity";
2
2
 
3
- //=====================================
4
- // Base colors should not be documented.
5
- // Only document color use.
3
+ /*=====================================
4
+ Base colors should not be documented.
5
+ Only document color use.
6
6
 
7
- // Colors -----------------------------
7
+ Colors -----------------------------*/
8
8
  $royal: #0056CF;
9
9
  $purple: #9E64E9;
10
10
  $teal: #00C4D7;
@@ -22,11 +22,11 @@ $colors: (
22
22
  orange: $orange
23
23
  );
24
24
 
25
- // Specialty Gradient -----------------
25
+ /* Specialty Gradient -----------------*/
26
26
  $gradient_start: #1C75F2;
27
27
  $gradient_end: $royal;
28
28
 
29
- // Interface colors -------------------
29
+ /* Interface colors -------------------*/
30
30
  $white: #FFFFFF;
31
31
  $silver: #F3F7FB;
32
32
  $slate: #C1CDD6;
@@ -42,7 +42,7 @@ $interface_colors: (
42
42
 
43
43
  );
44
44
 
45
- // Main colors ------------------------
45
+ /* Main colors ------------------------*/
46
46
  $primary: $royal;
47
47
  $secondary: $yellow;
48
48
  $tertiary: $purple;
@@ -51,9 +51,9 @@ $main_colors: (
51
51
  secondary: $secondary,
52
52
  tertiary: $tertiary
53
53
  );
54
- //=====================================
54
+ /*=====================================
55
55
 
56
- // Background colors ------------------
56
+ Background colors ------------------*/
57
57
  $bg_light: $silver;
58
58
  $bg_dark: #172257;
59
59
  $background_colors: (
@@ -61,7 +61,7 @@ $background_colors: (
61
61
  bg_dark: $bg_dark
62
62
  );
63
63
 
64
- // Card colors ------------------
64
+ /* Card colors ------------------*/
65
65
  $card_light: $white;
66
66
  $card_dark: rgba($white, $opacity_1);
67
67
  $card_colors: (
@@ -74,15 +74,15 @@ $action_colors: (
74
74
  primary_action: $primary-action
75
75
  );
76
76
 
77
- // Active colors ----------------------
77
+ /* Active colors ----------------------*/
78
78
  $active_light: lighten(#E5F2FF, 3.5%);
79
- $active_dark: #0082ff;
79
+ $active_dark: #0082ff;
80
80
  $active_colors: (
81
81
  active_light: $active_light,
82
82
  active_dark: $active_dark
83
83
  );
84
84
 
85
- // Hover colors -----------------------
85
+ /* Hover colors -----------------------*/
86
86
  $hover_light: darken($silver, 5%);
87
87
  $hover_dark: rgba($white, $opacity_2);
88
88
  $hover_colors: (
@@ -90,7 +90,7 @@ $hover_colors: (
90
90
  hover_dark: $hover_dark
91
91
  );
92
92
 
93
- // Focus colors -----------------------
93
+ /* Focus colors -----------------------*/
94
94
  $focus_input_light: rgba($active_light, $opacity_5);
95
95
  $focus_input_dark: rgba(#144075, $opacity_5);
96
96
  $focus_input_colors: (
@@ -98,7 +98,7 @@ $focus_input_colors: (
98
98
  focus_input_dark: $focus_input_dark
99
99
  );
100
100
 
101
- // Border colors ----------------------
101
+ /* Border colors ----------------------*/
102
102
  $border_light: #E4E8F0;
103
103
  $border_dark: rgba($white, $opacity_1);
104
104
  $border_colors: (
@@ -106,13 +106,13 @@ $border_colors: (
106
106
  border_dark: $border_dark
107
107
  );
108
108
 
109
- // Shadow colors ----------------------
109
+ /* Shadow colors ----------------------*/
110
110
  $shadow: rgba(#3C6AAC, $opacity_2);
111
111
  $shadow_colors: (
112
112
  shadow: $shadow,
113
113
  );
114
114
 
115
- // Text colors ------------------------
115
+ /* Text colors ------------------------*/
116
116
  $text_lt_default: $charcoal;
117
117
  $text_lt_light: #919EAB;
118
118
  $text_lt_lighter: $slate;
@@ -128,7 +128,7 @@ $text_colors: (
128
128
  text_dk_lighter: $text_dk_lighter
129
129
  );
130
130
 
131
- // Data colors ------------------------
131
+ /* Data colors ------------------------*/
132
132
  $data_1: $royal;
133
133
  $data_2: $yellow;
134
134
  $data_3: $purple;
@@ -148,7 +148,7 @@ $data_colors: (
148
148
  data_8: $data_8
149
149
  );
150
150
 
151
- // Status colors ----------------------
151
+ /* Status colors ----------------------*/
152
152
  $success: $green;
153
153
  $warning: $yellow;
154
154
  $error: $red;
@@ -174,10 +174,10 @@ $status_color_text: (
174
174
  primary: $primary
175
175
  );
176
176
 
177
- // Link colors ------------------------
177
+ /* Link colors ------------------------*/
178
178
  $primary_action: $primary;
179
179
 
180
- // Product colors ---------------------
180
+ /* Product colors ---------------------*/
181
181
  $windows: $royal;
182
182
  $siding: $yellow;
183
183
  $doors: $teal;
@@ -195,7 +195,7 @@ $product_colors: (
195
195
  insulation: $insulation
196
196
  );
197
197
 
198
- // Category colors ---------------------
198
+ /* Category colors ---------------------*/
199
199
  $category_1: $royal;
200
200
  $category_2: #0CD2E5;
201
201
  $category_3: $yellow;
@@ -252,7 +252,6 @@ $transparent: transparent;
252
252
  }
253
253
 
254
254
  :export {
255
-
256
255
  @mixin export-colors($colors-list) {
257
256
  @each $name, $color in $colors-list {
258
257
  #{$name}: $color;
@@ -2,7 +2,7 @@
2
2
  $font_family_base: "Proxima Nova", "Helvetica Neue", Helvetica, Arial, sans_serif;
3
3
 
4
4
 
5
- // CLEAN UP AND REMOVE
5
+ /* CLEAN UP AND REMOVE */
6
6
  $font_jumbo: 36px;
7
7
  $font_largest: 32px;
8
8
  $font_larger: 28px;
@@ -29,7 +29,7 @@ $text_smaller: $font_smaller;
29
29
  $text_smallest: $font_smallest;
30
30
 
31
31
 
32
- // Headings
32
+ /* Headings */
33
33
  $heading_1: 48px;
34
34
  $heading_2: 34px;
35
35
  $heading_3: $font_larger;
@@ -38,7 +38,7 @@ $heading_4: $font_base;
38
38
 
39
39
 
40
40
 
41
- // Letter Spacing
41
+ /* Letter Spacing */
42
42
  $lspace_tightest: _.1em;
43
43
  $lspace_tighter: _.07em;
44
44
  $lspace_tight: _.03em;
@@ -52,11 +52,11 @@ $lspace_super_loosest: .2em;
52
52
 
53
53
 
54
54
 
55
- // Standard Font Weights
55
+ /* Standard Font Weights */
56
56
  $bold: 600;
57
57
  $regular: 400;
58
58
 
59
- // Non_Standard Font Weights
59
+ /* Non_Standard Font Weights */
60
60
  $extrabold: 900;
61
61
  $boldest: 800;
62
62
  $bolder: 700;
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Playbook
4
- VERSION = "5.2.0.pre.alpha7"
4
+ VERSION = "5.2.0.pre.alpha12"
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.pre.alpha7
4
+ version: 5.2.0.pre.alpha12
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-23 00:00:00.000000000 Z
12
+ date: 2020-07-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -785,6 +785,14 @@ files:
785
785
  - app/pb_kits/playbook/pb_flex/docs/index.js
786
786
  - app/pb_kits/playbook/pb_flex/flex.rb
787
787
  - app/pb_kits/playbook/pb_flex/flex_item.rb
788
+ - app/pb_kits/playbook/pb_foo/_foo.html.erb
789
+ - app/pb_kits/playbook/pb_foo/_foo.jsx
790
+ - app/pb_kits/playbook/pb_foo/_foo.scss
791
+ - app/pb_kits/playbook/pb_foo/docs/_foo_default.html.erb
792
+ - app/pb_kits/playbook/pb_foo/docs/_foo_default.jsx
793
+ - app/pb_kits/playbook/pb_foo/docs/example.yml
794
+ - app/pb_kits/playbook/pb_foo/docs/index.js
795
+ - app/pb_kits/playbook/pb_foo/foo.rb
788
796
  - app/pb_kits/playbook/pb_form/_form.scss
789
797
  - app/pb_kits/playbook/pb_form/_form_form_with.html.erb
790
798
  - app/pb_kits/playbook/pb_form/_form_simple_form.html.erb