playbook_ui 3.5.0 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/_playbook.scss +2 -1
- data/app/pb_kits/playbook/index.js +2 -1
- data/app/pb_kits/playbook/kits/pb_popover.js +4 -0
- data/app/pb_kits/playbook/packs/examples.js +5 -3
- data/app/pb_kits/playbook/packs/kits.js +2 -0
- data/app/pb_kits/playbook/packs/site_styles/docs/_kit_doc.scss +1 -1
- data/app/pb_kits/playbook/packs/site_styles/docs/_markdown.scss +1 -1
- data/app/pb_kits/playbook/packs/site_styles/docs/_spacing_tokens.scss +1 -1
- data/app/pb_kits/playbook/pb_card/card.rb +1 -6
- data/app/pb_kits/playbook/pb_currency/_currency.html.erb +6 -6
- data/app/pb_kits/playbook/pb_currency/_currency.jsx +38 -29
- data/app/pb_kits/playbook/pb_currency/_currency.scss +29 -29
- data/app/pb_kits/playbook/pb_currency/currency.rb +67 -75
- data/app/pb_kits/playbook/pb_currency/docs/_currency_default.jsx +3 -3
- data/app/pb_kits/playbook/pb_currency/docs/_currency_large.html.erb +7 -12
- data/app/pb_kits/playbook/pb_currency/docs/_currency_large.jsx +4 -4
- data/app/pb_kits/playbook/pb_currency/docs/_currency_small.html.erb +7 -12
- data/app/pb_kits/playbook/pb_form/_form_form_with.html.erb +10 -0
- data/app/pb_kits/playbook/pb_form/_form_simple_form.html.erb +10 -0
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +1 -1
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +35 -0
- data/app/pb_kits/playbook/pb_form/docs/_form_simple_form.html.erb +1 -1
- data/app/pb_kits/playbook/pb_form/docs/_form_simple_form_validate.html.erb +57 -0
- data/app/pb_kits/playbook/pb_form/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_form/form.rb +1 -0
- data/app/pb_kits/playbook/pb_form/form/form_with_form.rb +1 -0
- data/app/pb_kits/playbook/pb_form/form/simple_form_form.rb +1 -0
- data/app/pb_kits/playbook/pb_form/form_builder/collection_select_field.rb +2 -0
- data/app/pb_kits/playbook/pb_form/form_builder/form_field_builder.rb +10 -1
- data/app/pb_kits/playbook/pb_form/form_builder/select_field.rb +2 -0
- data/app/pb_kits/playbook/pb_form/pb_form_validation.js +84 -0
- data/app/pb_kits/playbook/pb_popover/_popover.html.erb +29 -0
- data/app/pb_kits/playbook/pb_popover/_popover.js +54 -0
- data/app/pb_kits/playbook/pb_popover/_popover.jsx +23 -0
- data/app/pb_kits/playbook/pb_popover/_popover.scss +8 -0
- data/app/pb_kits/playbook/pb_popover/docs/_popover_default.html.erb +8 -0
- data/app/pb_kits/playbook/pb_popover/docs/_popover_default.jsx +10 -0
- data/app/pb_kits/playbook/pb_popover/docs/_popover_list.html.erb +12 -0
- data/app/pb_kits/playbook/pb_popover/docs/_popover_with_button.html.erb +4 -0
- data/app/pb_kits/playbook/pb_popover/docs/_popover_with_circle.html.erb +5 -0
- data/app/pb_kits/playbook/pb_popover/docs/example.yml +8 -0
- data/app/pb_kits/playbook/pb_popover/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_popover/popover.rb +23 -0
- data/app/pb_kits/playbook/pb_select/_select.html.erb +1 -1
- data/app/pb_kits/playbook/pb_select/_select.scss +18 -17
- data/app/pb_kits/playbook/pb_select/select.rb +5 -1
- data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +1 -1
- data/app/pb_kits/playbook/pb_text_input/_text_input.html.erb +2 -0
- data/app/pb_kits/playbook/pb_text_input/text_input.rb +16 -0
- data/app/pb_kits/playbook/plugins/{pb_chart_plugin.js → pb_chart.js} +0 -0
- data/app/pb_kits/playbook/tokens/_colors.scss +2 -13
- data/app/pb_kits/playbook/tokens/_shadows.scss +3 -15
- data/app/pb_kits/playbook/vendor.js +8 -1
- data/app/views/playbook/pages/utilities.html.slim +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +19 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78848474811b6e754736b7b5592e469d4121cddf79723c10c78342e0865b06e8
|
4
|
+
data.tar.gz: 90fc301b3b4dd2de5b5c9b65ba942a25b573504cc8134e09b155986519629149
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46f4271397f0d4a1d80cf5e079eca0f738b7f2154198640c74b0e4d7caac81dd413cd919dca53f8d833e9cdb270f53ad85f6b14485764300289ed61480bedb08
|
7
|
+
data.tar.gz: 8db3a7ba3f88a00750f935de3b44ae68ab1ee8c713a8798040914dec7c8837f8b8f493edb354a96dd81c96f2475f5faa72d83b9243aeafd0cd829fdf9daa2b2b
|
@@ -39,6 +39,7 @@
|
|
39
39
|
@import 'pb_person/person';
|
40
40
|
@import 'pb_person_contact/person_contact';
|
41
41
|
@import 'pb_pill/pill';
|
42
|
+
@import 'pb_popover/popover';
|
42
43
|
@import 'pb_progress_pills/progress_pills';
|
43
44
|
@import 'pb_progress_simple/progress_simple';
|
44
45
|
@import 'pb_radio/radio';
|
@@ -57,6 +58,6 @@
|
|
57
58
|
@import 'pb_title_count/title_count';
|
58
59
|
@import 'pb_title_detail/title_detail';
|
59
60
|
@import 'pb_toggle/toggle';
|
61
|
+
@import 'pb_typeahead/typeahead';
|
60
62
|
@import 'pb_user/user';
|
61
63
|
@import 'pb_user_badge/user_badge';
|
62
|
-
@import 'pb_typeahead/typeahead';
|
@@ -40,6 +40,7 @@ export OnlineStatus from './pb_online_status/_online_status.jsx'
|
|
40
40
|
export Person from './pb_person/_person.jsx'
|
41
41
|
export PersonContact from './pb_person_contact/_person_contact.jsx'
|
42
42
|
export Pill from './pb_pill/_pill.jsx'
|
43
|
+
export Popover from './pb_popover/_popover.jsx'
|
43
44
|
export ProgressPills from './pb_progress_pills/_progress_pills.jsx'
|
44
45
|
export ProgressSimple from './pb_progress_simple/_progress_simple.jsx'
|
45
46
|
export Radio from './pb_radio/_radio.jsx'
|
@@ -67,5 +68,5 @@ export barGraphSettings from './pb_bar_graph/barGraphSettings'
|
|
67
68
|
export dashboardValueSettings from './pb_dashboard_value/dashboardValueSettings'
|
68
69
|
|
69
70
|
// Other JS/Plugins
|
70
|
-
export pbChart from './plugins/
|
71
|
+
export pbChart from './plugins/pb_chart.js'
|
71
72
|
export PbTypeahead from './pb_typeahead'
|
@@ -12,6 +12,7 @@ import WebpackerReact from 'webpacker-react'
|
|
12
12
|
// Generated file from kit generator.
|
13
13
|
// KIT EXAMPLES
|
14
14
|
|
15
|
+
import '../pb_form/pb_form_validation'
|
15
16
|
import * as avatar from 'pb_avatar/docs'
|
16
17
|
import * as Badge from 'pb_badge/docs'
|
17
18
|
import * as BarGraph from 'pb_bar_graph/docs'
|
@@ -51,6 +52,7 @@ import * as OnlineStatus from 'pb_online_status/docs'
|
|
51
52
|
import * as Person from 'pb_person/docs'
|
52
53
|
import * as PersonContact from 'pb_person_contact/docs'
|
53
54
|
import * as Pill from 'pb_pill/docs'
|
55
|
+
import * as Popover from 'pb_popover/docs'
|
54
56
|
import * as ProgressPills from 'pb_progress_pills/docs'
|
55
57
|
import * as ProgressSimple from 'pb_progress_simple/docs'
|
56
58
|
import * as Radio from 'pb_radio/docs'
|
@@ -72,7 +74,9 @@ import * as TitleDetail from 'pb_title_detail/docs'
|
|
72
74
|
import * as Toggle from 'pb_toggle/docs'
|
73
75
|
import * as User from 'pb_user/docs'
|
74
76
|
import * as UserBadge from 'pb_user_badge/docs'
|
77
|
+
import PbTypeahead from 'pb_typeahead'
|
75
78
|
|
79
|
+
PbTypeahead.start()
|
76
80
|
WebpackerReact.setup(avatar)
|
77
81
|
WebpackerReact.setup(Badge)
|
78
82
|
WebpackerReact.setup(BarGraph)
|
@@ -112,6 +116,7 @@ WebpackerReact.setup(OnlineStatus)
|
|
112
116
|
WebpackerReact.setup(Person)
|
113
117
|
WebpackerReact.setup(PersonContact)
|
114
118
|
WebpackerReact.setup(Pill)
|
119
|
+
WebpackerReact.setup(Popover)
|
115
120
|
WebpackerReact.setup(ProgressPills)
|
116
121
|
WebpackerReact.setup(ProgressSimple)
|
117
122
|
WebpackerReact.setup(Radio)
|
@@ -133,6 +138,3 @@ WebpackerReact.setup(TitleDetail)
|
|
133
138
|
WebpackerReact.setup(Toggle)
|
134
139
|
WebpackerReact.setup(User)
|
135
140
|
WebpackerReact.setup(UserBadge)
|
136
|
-
|
137
|
-
import PbTypeahead from 'pb_typeahead'
|
138
|
-
PbTypeahead.start()
|
@@ -36,6 +36,7 @@ import '../kits/pb_online_status.js'
|
|
36
36
|
import '../kits/pb_person.js'
|
37
37
|
import '../kits/pb_person_contact.js'
|
38
38
|
import '../kits/pb_pill.js'
|
39
|
+
import '../kits/pb_popover.js'
|
39
40
|
import '../kits/pb_progress_pills.js'
|
40
41
|
import '../kits/pb_progress_simple.js'
|
41
42
|
import '../kits/pb_radio.js'
|
@@ -57,3 +58,4 @@ import '../kits/pb_title_detail.js'
|
|
57
58
|
import '../kits/pb_toggle.js'
|
58
59
|
import '../kits/pb_user.js'
|
59
60
|
import '../kits/pb_user_badge.js'
|
61
|
+
|
@@ -1,10 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# DEPRECATION NOTICE - DO NOT USE Shadow Shallow and Shadow Default!
|
4
|
-
# Shadow Options: Shallow and Default targed to be removed in release v4.0.0.
|
5
|
-
# [https://github.com/powerhome/playbook/issues/550]
|
6
|
-
# END DEPRECATION NOTICE
|
7
|
-
|
8
3
|
module Playbook
|
9
4
|
module PbCard
|
10
5
|
class Card
|
@@ -17,7 +12,7 @@ module Playbook
|
|
17
12
|
values: %w[none xs sm md lg xl],
|
18
13
|
default: "md"
|
19
14
|
prop :shadow, type: Playbook::Props::Enum,
|
20
|
-
values: %w[none
|
15
|
+
values: %w[none deep deeper deepest],
|
21
16
|
default: "none"
|
22
17
|
prop :highlight, type: Playbook::Props::Hash,
|
23
18
|
default: {}
|
@@ -1,13 +1,13 @@
|
|
1
1
|
<%= content_tag(:div,
|
2
2
|
id: object.id,
|
3
3
|
data: object.data,
|
4
|
-
class: object.classname
|
4
|
+
class: object.classname) do %>
|
5
|
+
|
6
|
+
<%= object.label_element %>
|
5
7
|
|
6
|
-
<%= object.label %>
|
7
8
|
<div class="pb_currency_wrapper">
|
8
|
-
<%= object.
|
9
|
-
<%= object.
|
10
|
-
<%= object.
|
9
|
+
<%= object.currency_symbol_element %>
|
10
|
+
<%= object.amount_element %>
|
11
|
+
<%= object.units_element %>
|
11
12
|
</div>
|
12
|
-
|
13
13
|
<% end %>
|
@@ -1,26 +1,18 @@
|
|
1
1
|
/* @flow */
|
2
2
|
|
3
3
|
import React from 'react'
|
4
|
-
import classnames from 'classnames'
|
5
4
|
|
6
5
|
import { Body, Caption, Title } from '../'
|
7
6
|
import { buildCss } from '../utilities/props'
|
8
7
|
|
9
8
|
type CurrencyProps = {
|
10
9
|
align?: 'left' | 'center' | 'right',
|
11
|
-
|
12
|
-
|
13
|
-
label?:
|
10
|
+
amount: string,
|
11
|
+
className?: string,
|
12
|
+
label?: string,
|
14
13
|
separator?: '.' | ',',
|
15
14
|
size?: 'sm' | 'lg',
|
16
|
-
|
17
|
-
units?: String,
|
18
|
-
}
|
19
|
-
|
20
|
-
const symbolCSS = (currencySymbol) => {
|
21
|
-
return classnames({
|
22
|
-
'dollar_sign': currencySymbol === '$',
|
23
|
-
})
|
15
|
+
symbol?: string,
|
24
16
|
}
|
25
17
|
|
26
18
|
const sizes = {
|
@@ -30,26 +22,43 @@ const sizes = {
|
|
30
22
|
|
31
23
|
const Currency = ({
|
32
24
|
align = 'left',
|
33
|
-
|
25
|
+
amount,
|
26
|
+
className,
|
34
27
|
label = '',
|
35
28
|
separator = '.',
|
36
29
|
size = 'sm',
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
<div className=
|
43
|
-
<
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
30
|
+
symbol = '$',
|
31
|
+
}: CurrencyProps) => {
|
32
|
+
const [whole, decimal = '00'] = amount.split(separator)
|
33
|
+
|
34
|
+
return (
|
35
|
+
<div className={buildCss('pb_currency_kit', align, className)}>
|
36
|
+
<Caption>{label}</Caption>
|
37
|
+
|
38
|
+
<div className="pb_currency_wrapper">
|
39
|
+
<Body
|
40
|
+
className="dollar_sign"
|
41
|
+
color="light"
|
42
|
+
>
|
43
|
+
{symbol}
|
44
|
+
</Body>
|
45
|
+
|
46
|
+
<Title
|
47
|
+
className="pb_currency_value"
|
48
|
+
size={sizes[size]}
|
49
|
+
>
|
50
|
+
{`${whole}${separator}`}
|
51
|
+
</Title>
|
52
|
+
|
53
|
+
<Body
|
54
|
+
className="unit"
|
55
|
+
color="light"
|
56
|
+
>
|
57
|
+
{decimal}
|
58
|
+
</Body>
|
59
|
+
</div>
|
51
60
|
</div>
|
52
|
-
|
53
|
-
|
61
|
+
)
|
62
|
+
}
|
54
63
|
|
55
64
|
export default Currency
|
@@ -1,40 +1,40 @@
|
|
1
1
|
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
2
|
+
[class^=pb_currency_kit] {
|
3
|
+
&[class*=_center] {
|
4
|
+
& > [class^=pb_caption],
|
5
|
+
& > [class^=pb_title],
|
6
|
+
& > [class^=pb_body] {
|
7
|
+
text-align: center;
|
8
|
+
}
|
9
|
+
& > [class*=pb_currency_wrapper] {
|
10
|
+
justify-content: center;
|
11
11
|
}
|
12
12
|
}
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
14
|
+
&[class*=_right] {
|
15
|
+
& > [class^=pb_caption],
|
16
|
+
& > [class^=pb_title],
|
17
|
+
& > [class^=pb_body] {
|
18
|
+
text-align: right;
|
19
|
+
}
|
20
|
+
& > [class*=pb_currency_wrapper] {
|
21
21
|
justify-content: flex-end;
|
22
22
|
}
|
23
23
|
}
|
24
24
|
}
|
25
25
|
|
26
|
-
|
27
|
-
|
26
|
+
[class^=pb_currency_wrapper] {
|
27
|
+
display: flex;
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
}
|
37
|
-
& > [class*=pb_currency_value] {
|
38
|
-
line-height: .9;
|
39
|
-
}
|
29
|
+
& > [class*=dollar_sign] {
|
30
|
+
display: flex;
|
31
|
+
align-items: flex-start;
|
32
|
+
}
|
33
|
+
& > [class*=unit] {
|
34
|
+
display: flex;
|
35
|
+
align-items: flex-end;
|
40
36
|
}
|
37
|
+
& > [class*=pb_currency_value] {
|
38
|
+
line-height: .9;
|
39
|
+
}
|
40
|
+
}
|
@@ -2,99 +2,91 @@
|
|
2
2
|
|
3
3
|
module Playbook
|
4
4
|
module PbCurrency
|
5
|
-
class Currency
|
6
|
-
|
7
|
-
|
8
|
-
configured_data
|
9
|
-
configured_id
|
10
|
-
configured_label
|
11
|
-
configured_value
|
12
|
-
configured_unit
|
13
|
-
configured_dollar_sign
|
14
|
-
configured_size].freeze
|
15
|
-
|
16
|
-
def initialize(align: default_configuration,
|
17
|
-
classname: default_configuration,
|
18
|
-
data: default_configuration,
|
19
|
-
id: default_configuration,
|
20
|
-
label: default_configuration,
|
21
|
-
value: default_configuration,
|
22
|
-
unit: default_configuration,
|
23
|
-
dollar_sign: default_configuration,
|
24
|
-
size: default_configuration)
|
25
|
-
self.configured_align = align
|
26
|
-
self.configured_classname = classname
|
27
|
-
self.configured_data = data
|
28
|
-
self.configured_id = id
|
29
|
-
self.configured_label = label
|
30
|
-
self.configured_value = value
|
31
|
-
self.configured_unit = unit
|
32
|
-
self.configured_dollar_sign = dollar_sign
|
33
|
-
self.configured_size = size
|
34
|
-
end
|
5
|
+
class Currency
|
6
|
+
include ActionView::Context
|
7
|
+
include Playbook::Props
|
35
8
|
|
36
|
-
|
37
|
-
align_options = %w[left center right]
|
38
|
-
one_of_value(configured_align, align_options, "left")
|
39
|
-
end
|
9
|
+
partial "pb_currency/currency"
|
40
10
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
end
|
45
|
-
ApplicationController.renderer.render(partial: pb_dollar_sign, as: :object)
|
46
|
-
end
|
11
|
+
prop :align, type: Playbook::Props::Enum,
|
12
|
+
values: %w[left center right],
|
13
|
+
default: "left"
|
47
14
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
ApplicationController.renderer.render(partial: pb_label, as: :object)
|
52
|
-
end
|
53
|
-
end
|
15
|
+
prop :size, type: Playbook::Props::Enum,
|
16
|
+
values: %w[lg sm],
|
17
|
+
default: "sm"
|
54
18
|
|
55
|
-
|
56
|
-
|
57
|
-
one_of_value(configured_size, size_options, "sm")
|
58
|
-
end
|
19
|
+
prop :label, type: Playbook::Props::String,
|
20
|
+
default: ""
|
59
21
|
|
60
|
-
|
61
|
-
|
22
|
+
prop :separator, type: Playbook::Props::String,
|
23
|
+
default: "."
|
24
|
+
|
25
|
+
prop :symbol, type: Playbook::Props::String,
|
26
|
+
default: "$"
|
27
|
+
|
28
|
+
prop :amount, type: Playbook::Props::String,
|
29
|
+
required: true
|
30
|
+
|
31
|
+
def classname
|
32
|
+
generate_classname("pb_currency_kit", align)
|
62
33
|
end
|
63
34
|
|
64
|
-
def
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
35
|
+
def currency_symbol_element
|
36
|
+
pb_dollar_sign = Playbook::PbBody::Body.new(
|
37
|
+
classname: "dollar_sign",
|
38
|
+
color: "light"
|
39
|
+
) { symbol }
|
40
|
+
|
41
|
+
ApplicationController.renderer.render(
|
42
|
+
partial: pb_dollar_sign,
|
43
|
+
as: :object
|
44
|
+
)
|
69
45
|
end
|
70
46
|
|
71
|
-
def
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
47
|
+
def label_element
|
48
|
+
pb_label = Playbook::PbCaption::Caption.new(text: label)
|
49
|
+
|
50
|
+
ApplicationController.renderer.render(
|
51
|
+
partial: pb_label,
|
52
|
+
as: :object
|
53
|
+
)
|
76
54
|
end
|
77
55
|
|
78
|
-
def
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
56
|
+
def amount_element
|
57
|
+
whole_part, _ = amount.split(separator)
|
58
|
+
|
59
|
+
pb_title = Playbook::PbTitle::Title.new(
|
60
|
+
size: size_value,
|
61
|
+
text: "#{whole_part}#{separator}",
|
62
|
+
classname: "pb_currency_value"
|
63
|
+
)
|
64
|
+
|
65
|
+
ApplicationController.renderer.render(
|
66
|
+
partial: pb_title,
|
67
|
+
as: :object
|
68
|
+
)
|
84
69
|
end
|
85
70
|
|
86
|
-
def
|
87
|
-
|
71
|
+
def units_element
|
72
|
+
_, decimal_part = amount.split(separator)
|
73
|
+
|
74
|
+
pb_unit = Playbook::PbBody::Body.new(
|
75
|
+
classname: "unit",
|
76
|
+
color: "light"
|
77
|
+
) { decimal_part || "00" }
|
78
|
+
|
79
|
+
ApplicationController.renderer.render(
|
80
|
+
partial: pb_unit,
|
81
|
+
as: :object
|
82
|
+
)
|
88
83
|
end
|
89
84
|
|
90
85
|
private
|
91
86
|
|
92
|
-
|
93
|
-
|
94
|
-
def default_configuration
|
95
|
-
DEFAULT
|
87
|
+
def size_value
|
88
|
+
size == "lg" ? 1 : 2
|
96
89
|
end
|
97
|
-
attr_accessor(*PROPS)
|
98
90
|
end
|
99
91
|
end
|
100
92
|
end
|