playbook_ui 4.7.1 → 4.8.1
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/pb_bar_graph/_bar_graph.jsx +9 -0
- data/app/pb_kits/playbook/pb_bar_graph/bar_graph.rb +8 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_default.html.erb +7 -6
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_default.jsx +7 -6
- data/app/pb_kits/playbook/pb_currency/_currency.html.erb +2 -1
- data/app/pb_kits/playbook/pb_currency/_currency.jsx +11 -3
- data/app/pb_kits/playbook/pb_currency/_currency.scss +26 -12
- data/app/pb_kits/playbook/pb_currency/currency.rb +22 -6
- data/app/pb_kits/playbook/pb_currency/docs/_currency_dark.html.erb +23 -0
- data/app/pb_kits/playbook/pb_currency/docs/_currency_dark.jsx +33 -0
- data/app/pb_kits/playbook/pb_currency/docs/_currency_large.jsx +2 -2
- data/app/pb_kits/playbook/pb_currency/docs/_currency_medium.html.erb +21 -0
- data/app/pb_kits/playbook/pb_currency/docs/_currency_medium.jsx +30 -0
- data/app/pb_kits/playbook/pb_currency/docs/_currency_small.html.erb +1 -1
- data/app/pb_kits/playbook/pb_currency/docs/{_currency_default.jsx → _currency_small.jsx} +2 -2
- data/app/pb_kits/playbook/pb_currency/docs/example.yml +5 -1
- data/app/pb_kits/playbook/pb_currency/docs/index.js +3 -1
- data/app/pb_kits/playbook/pb_filter/_filter.html.erb +1 -1
- data/app/pb_kits/playbook/pb_filter/docs/_filter_default.html.erb +1 -1
- data/app/pb_kits/playbook/pb_filter/docs/_filter_no_background.html.erb +88 -0
- data/app/pb_kits/playbook/pb_filter/docs/_filter_single.html.erb +1 -1
- data/app/pb_kits/playbook/pb_filter/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_filter/filter.rb +2 -2
- data/app/pb_kits/playbook/pb_filter/templates/_core.html.erb +45 -0
- data/app/pb_kits/playbook/pb_filter/templates/_default.html.erb +13 -37
- data/app/pb_kits/playbook/pb_form/form_builder/form_field_builder.rb +1 -0
- data/app/pb_kits/playbook/pb_line_graph/_line_graph.jsx +9 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_default.html.erb +9 -1
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_default.jsx +3 -2
- data/app/pb_kits/playbook/pb_line_graph/line_graph.rb +8 -2
- data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.jsx +55 -13
- data/app/pb_kits/playbook/pb_progress_simple/docs/_progress_simple_align.jsx +28 -0
- data/app/pb_kits/playbook/pb_progress_simple/docs/_progress_simple_default.jsx +4 -1
- data/app/pb_kits/playbook/pb_progress_simple/docs/_progress_simple_muted.jsx +15 -0
- data/app/pb_kits/playbook/pb_progress_simple/docs/_progress_simple_value.jsx +20 -0
- data/app/pb_kits/playbook/pb_progress_simple/docs/_progress_simple_width.jsx +15 -0
- data/app/pb_kits/playbook/pb_progress_simple/docs/example.yml +6 -0
- data/app/pb_kits/playbook/pb_progress_simple/docs/index.js +4 -0
- data/app/pb_kits/playbook/pb_select/_select.html.erb +1 -1
- data/app/pb_kits/playbook/pb_select/_select.scss +5 -1
- data/app/pb_kits/playbook/pb_table/styles/_reset.scss +1 -1
- data/app/pb_kits/playbook/pb_text_input/_text_input.scss +4 -1
- data/app/pb_kits/playbook/pb_textarea/_textarea.jsx +4 -1
- data/app/pb_kits/playbook/pb_textarea/_textarea.scss +15 -0
- data/app/pb_kits/playbook/pb_textarea/_textarea_mixin.scss +4 -4
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_resize.html.erb +13 -0
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_resize.jsx +33 -0
- data/app/pb_kits/playbook/pb_textarea/docs/example.yml +5 -5
- data/app/pb_kits/playbook/pb_textarea/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_textarea/textarea.rb +9 -1
- data/app/pb_kits/playbook/plugins/pb_chart.js +5 -0
- data/lib/playbook/version.rb +1 -1
- metadata +15 -4
- data/app/pb_kits/playbook/pb_filter/templates/_single.html.erb +0 -42
@@ -1,7 +1,7 @@
|
|
1
1
|
import React from 'react'
|
2
2
|
import { Currency } from '../../'
|
3
3
|
|
4
|
-
const
|
4
|
+
const CurrencySmall = () => {
|
5
5
|
return (
|
6
6
|
<div>
|
7
7
|
<Currency
|
@@ -24,4 +24,4 @@ const CurrencyDefault = () => {
|
|
24
24
|
)
|
25
25
|
}
|
26
26
|
|
27
|
-
export default
|
27
|
+
export default CurrencySmall
|
@@ -2,7 +2,11 @@ examples:
|
|
2
2
|
|
3
3
|
rails:
|
4
4
|
- currency_small: Small
|
5
|
+
- currency_medium: Medium
|
5
6
|
- currency_large: Large
|
7
|
+
- currency_dark: Dark
|
6
8
|
react:
|
7
|
-
-
|
9
|
+
- currency_small: Small
|
10
|
+
- currency_medium: Medium
|
8
11
|
- currency_large: Large
|
12
|
+
- currency_dark: Dark
|
@@ -1,2 +1,4 @@
|
|
1
|
-
export { default as
|
1
|
+
export { default as CurrencySmall } from './_currency_small.jsx'
|
2
2
|
export { default as CurrencyLarge } from './_currency_large.jsx'
|
3
|
+
export { default as CurrencyMedium } from './_currency_medium.jsx'
|
4
|
+
export { default as CurrencyDark } from './_currency_dark.jsx'
|
@@ -8,7 +8,7 @@
|
|
8
8
|
{name: "name", value: "John Wick"}
|
9
9
|
],
|
10
10
|
sort_menu: [
|
11
|
-
{item:"Popularity", link:"#", active: true, direction:"
|
11
|
+
{item:"Popularity", link:"#", active: true, direction:"desc"},
|
12
12
|
{item:"Title", link:"#", active: false},
|
13
13
|
{item:"Name", link:"#", active: false},
|
14
14
|
],
|
@@ -0,0 +1,88 @@
|
|
1
|
+
|
2
|
+
<%= pb_rails("filter", props: {
|
3
|
+
id:"3",
|
4
|
+
background: false,
|
5
|
+
filters: [
|
6
|
+
{name: "name", value: "John Wick"}
|
7
|
+
],
|
8
|
+
sort_menu: [
|
9
|
+
{item:"Popularity", link:"#", active: true, direction:"desc"},
|
10
|
+
{item:"Title", link:"#", active: false},
|
11
|
+
{item:"Name", link:"#", active: false},
|
12
|
+
],
|
13
|
+
results: 546,
|
14
|
+
template: "single"
|
15
|
+
}) do%>
|
16
|
+
<%
|
17
|
+
example_collection = [
|
18
|
+
OpenStruct.new(name: "Alabama", value: 1),
|
19
|
+
OpenStruct.new(name: "Alaska", value: 2),
|
20
|
+
OpenStruct.new(name: "Arizona", value: 3),
|
21
|
+
OpenStruct.new(name: "Arkansas", value: 4),
|
22
|
+
OpenStruct.new(name: "California", value: 5),
|
23
|
+
OpenStruct.new(name: "Colorado", value: 6),
|
24
|
+
OpenStruct.new(name: "Connecticut", value: 7),
|
25
|
+
OpenStruct.new(name: "Delaware", value: 8),
|
26
|
+
OpenStruct.new(name: "Florida", value: 9),
|
27
|
+
OpenStruct.new(name: "Georgia", value: 10),
|
28
|
+
]
|
29
|
+
%>
|
30
|
+
|
31
|
+
<%= pb_rails("form", props: { form_system_options: { scope: :example, method: :get } }) do |form| %>
|
32
|
+
<%= form.text_field :example_text_field, props: { label: true } %>
|
33
|
+
<%= form.collection_select :example_collection_select, example_collection, :value, :name, props: { label: true } %>
|
34
|
+
|
35
|
+
<%= form.actions do |action| %>
|
36
|
+
<%= action.submit props: { text: "Apply", data: { disable_with: "<i class='far fa-spinner fa-spin mr-3'></i>Searching...".html_safe },}%>
|
37
|
+
<%= action.button props: { type: "reset", text: "Clear", variant: "secondary" } %>
|
38
|
+
<% end %>
|
39
|
+
<% end %>
|
40
|
+
|
41
|
+
<% end %>
|
42
|
+
|
43
|
+
<% 2.times do%>
|
44
|
+
<br>
|
45
|
+
<%end%>
|
46
|
+
|
47
|
+
|
48
|
+
<%= pb_rails("filter", props: {
|
49
|
+
id:"4",
|
50
|
+
background: false,
|
51
|
+
filters: [
|
52
|
+
{name: "name", value: "John Wick"}
|
53
|
+
],
|
54
|
+
sort_menu: [
|
55
|
+
{item:"Popularity", link:"#", active: true, direction:"desc"},
|
56
|
+
{item:"Title", link:"#", active: false},
|
57
|
+
{item:"Name", link:"#", active: false},
|
58
|
+
],
|
59
|
+
results: 546,
|
60
|
+
|
61
|
+
}) do%>
|
62
|
+
<%
|
63
|
+
example_collection = [
|
64
|
+
OpenStruct.new(name: "Alabama", value: 1),
|
65
|
+
OpenStruct.new(name: "Alaska", value: 2),
|
66
|
+
OpenStruct.new(name: "Arizona", value: 3),
|
67
|
+
OpenStruct.new(name: "Arkansas", value: 4),
|
68
|
+
OpenStruct.new(name: "California", value: 5),
|
69
|
+
OpenStruct.new(name: "Colorado", value: 6),
|
70
|
+
OpenStruct.new(name: "Connecticut", value: 7),
|
71
|
+
OpenStruct.new(name: "Delaware", value: 8),
|
72
|
+
OpenStruct.new(name: "Florida", value: 9),
|
73
|
+
OpenStruct.new(name: "Georgia", value: 10),
|
74
|
+
]
|
75
|
+
%>
|
76
|
+
|
77
|
+
<%= pb_rails("form", props: { form_system_options: { scope: :example, method: :get } }) do |form| %>
|
78
|
+
<%= form.text_field :example_text_field, props: { label: true } %>
|
79
|
+
<%= form.collection_select :example_collection_select, example_collection, :value, :name, props: { label: true } %>
|
80
|
+
|
81
|
+
<%= form.actions do |action| %>
|
82
|
+
<%= action.submit props: { text: "Apply", data: { disable_with: "<i class='far fa-spinner fa-spin mr-3'></i>Searching...".html_safe },}%>
|
83
|
+
<%= action.button props: { type: "reset", text: "Clear", variant: "secondary" } %>
|
84
|
+
<% end %>
|
85
|
+
<% end %>
|
86
|
+
|
87
|
+
<% end %>
|
88
|
+
|
@@ -8,7 +8,7 @@
|
|
8
8
|
{name: "name", value: "John Wick"}
|
9
9
|
],
|
10
10
|
sort_menu: [
|
11
|
-
{item:"Popularity", link:"#", active: true, direction:"
|
11
|
+
{item:"Popularity", link:"#", active: true, direction:"desc"},
|
12
12
|
{item:"Title", link:"#", active: false},
|
13
13
|
{item:"Name", link:"#", active: false},
|
14
14
|
],
|
@@ -13,7 +13,7 @@ module Playbook
|
|
13
13
|
prop :template, type: Playbook::Props::Enum,
|
14
14
|
values: %w[default single],
|
15
15
|
default: "default"
|
16
|
-
|
16
|
+
prop :background, type: Playbook::Props::Boolean, default: true
|
17
17
|
|
18
18
|
def classname
|
19
19
|
generate_classname("pb_filter_kit")
|
@@ -23,7 +23,7 @@ module Playbook
|
|
23
23
|
case direction
|
24
24
|
when "asc"
|
25
25
|
"sort-amount-up"
|
26
|
-
when "
|
26
|
+
when "desc"
|
27
27
|
"sort-amount-down"
|
28
28
|
else
|
29
29
|
""
|
@@ -0,0 +1,45 @@
|
|
1
|
+
|
2
|
+
<%= pb_rails("flex", props: {orientation: "row", vertical: "center"}) do %>
|
3
|
+
<%= pb_rails("circle_icon_button", props: { variant: "secondary", icon: "filter", id:"filter#{object.id}"}) %>
|
4
|
+
|
5
|
+
<div class="maskContainer">
|
6
|
+
<div class="filters">
|
7
|
+
<div class="left_gradient"></div>
|
8
|
+
<% object.filters.each do |filter| %>
|
9
|
+
<div class="filter">
|
10
|
+
<%= pb_rails("caption", props: { text: filter[:name]}) %>
|
11
|
+
<%= pb_rails("title", props: { size: 4, tag:"h4", text: filter[:value]}) %>
|
12
|
+
</div>
|
13
|
+
<% end %>
|
14
|
+
<div class="right_gradient"></div>
|
15
|
+
</div>
|
16
|
+
</div>
|
17
|
+
<% if object.template == "single" %>
|
18
|
+
<%= pb_rails("caption", props: {text: "#{object.results} Results", size:"xs", classname:"filter-results"}) %>
|
19
|
+
<%= pb_rails("button", props: {variant: "link",id: "sort-button#{object.id}"}) do %>
|
20
|
+
<% object.sort_menu.each do |item| %>
|
21
|
+
<% if item[:active] == true %>
|
22
|
+
<%= item[:item] %>
|
23
|
+
<%= pb_rails("icon", props: { icon: object.sort_icon(item[:direction]), fixed_width: true }) %>
|
24
|
+
<%end%>
|
25
|
+
<% end %>
|
26
|
+
<% end %>
|
27
|
+
<% end %>
|
28
|
+
<% end %>
|
29
|
+
<% if object.template == "default"%>
|
30
|
+
<%= pb_rails("section_separator") %>
|
31
|
+
<%= pb_rails("flex", props: {orientation: "row", vertical: "center", spacing: "between", classname: "filter-bottom"}) do %>
|
32
|
+
<%= pb_rails("title_count", props: {title: "Results:",count: object.results, align:"center"}) %>
|
33
|
+
<%= pb_rails("flex", props: {orientation: "row", vertical: "center"}) do %>
|
34
|
+
<%= pb_rails("caption", props: { text: "sort by:"}) %>
|
35
|
+
<%= pb_rails("button", props: {variant: "link" ,classname: "p-0 ml-3",id: "sort-button#{object.id}"}) do %>
|
36
|
+
<% object.sort_menu.each do |item| %>
|
37
|
+
<% if item[:active] == true %>
|
38
|
+
<%= item[:item] %>
|
39
|
+
<%= pb_rails("icon", props: { icon: object.sort_icon(item[:direction]), fixed_width: true }) %>
|
40
|
+
<%end%>
|
41
|
+
<% end %>
|
42
|
+
<% end %>
|
43
|
+
<% end %>
|
44
|
+
<% end %>
|
45
|
+
<% end %>
|
@@ -1,43 +1,19 @@
|
|
1
|
-
|
2
|
-
<%= pb_rails("
|
3
|
-
<%=
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
<div class="filter">
|
8
|
-
<%= pb_rails("caption", props: { text: filter[:name]}) %>
|
9
|
-
<%= pb_rails("title", props: { size: 4, tag:"h4", text: filter[:value]}) %>
|
10
|
-
</div>
|
11
|
-
<% end %>
|
12
|
-
<div class="right_gradient"></div>
|
13
|
-
</div>
|
14
|
-
</div>
|
15
|
-
<% end %>
|
16
|
-
<%= pb_rails("section_separator") %>
|
17
|
-
<%= pb_rails("flex", props: {orientation: "row", vertical: "center", spacing: "between", classname: "filter-bottom"}) do %>
|
18
|
-
<%= pb_rails("title_count", props: {title: "Results:",count: object.results, align:"center"}) %>
|
19
|
-
<%= pb_rails("flex", props: {orientation: "row", vertical: "center"}) do %>
|
20
|
-
<%= pb_rails("caption", props: { text: "sort by:"}) %>
|
21
|
-
<%= pb_rails("button", props: {variant: "link" ,classname: "p-0 ml-3",id: "sort-button"}) do %>
|
22
|
-
<% object.sort_menu.each do |item| %>
|
23
|
-
<% if item[:active] == true %>
|
24
|
-
<%= item[:item] %>
|
25
|
-
<%= pb_rails("icon", props: { icon: object.sort_icon(item[:direction]), fixed_width: true }) %>
|
26
|
-
<%end%>
|
27
|
-
<% end %>
|
28
|
-
<% end %>
|
29
|
-
<% end %>
|
30
|
-
<% end %>
|
1
|
+
<% if object.background %>
|
2
|
+
<%= pb_rails("card",props: {padding:"none"}) do%>
|
3
|
+
<%= render partial: 'pb_filter/templates/core', locals: {object: object} %>
|
4
|
+
<% end %>
|
5
|
+
<% else %>
|
6
|
+
<%= render partial: 'pb_filter/templates/core', locals: { object: object} %>
|
31
7
|
<% end %>
|
32
8
|
|
33
|
-
<%= pb_rails("popover", props: {trigger_element_id: "filter", tooltip_id: "filter-form", position: 'bottom'}) do %>
|
9
|
+
<%= pb_rails("popover", props: {trigger_element_id: "filter#{object.id}", tooltip_id: "filter-form#{object.id}", position: 'bottom'}) do %>
|
34
10
|
<%= capture(&object.children) %>
|
35
11
|
<% end %>
|
36
12
|
|
37
|
-
<%= pb_rails("popover", props: { trigger_element_id: "sort-button", tooltip_id: "sort-filter-btn-tooltip", position: 'bottom'}) do %>
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
13
|
+
<%= pb_rails("popover", props: { trigger_element_id: "sort-button#{object.id}", tooltip_id: "sort-filter-btn-tooltip#{object.id}", position: 'bottom'}) do %>
|
14
|
+
<%= pb_rails("list") do %>
|
15
|
+
<% object.sort_menu.each do |item| %>
|
16
|
+
<%= pb_rails("list/item") do%> <%= pb_rails("button", props: {variant: "link" ,classname: "p-0", text: item[:item], link: item[:link]}) %><% end %>
|
17
|
+
<% end %>
|
18
|
+
<% end %>
|
43
19
|
<% end %>
|
@@ -11,6 +11,7 @@ module Playbook
|
|
11
11
|
|
12
12
|
options[:skip_default_ids] = false unless options.key?(:skip_default_ids)
|
13
13
|
options[:required] = true if props[:required]
|
14
|
+
options[:placeholder] = props[:placeholder] || ""
|
14
15
|
|
15
16
|
if props.key?(:validation)
|
16
17
|
validation = props[:validation]
|
@@ -6,6 +6,9 @@ import { pbChart } from '../'
|
|
6
6
|
|
7
7
|
type LineGraphProps = {
|
8
8
|
axisTitle?: String,
|
9
|
+
xAxisCategories: Array,
|
10
|
+
yAxisMin: Number,
|
11
|
+
yAxisMax: Number,
|
9
12
|
className?: String,
|
10
13
|
chartData: Array<{
|
11
14
|
name: String,
|
@@ -29,6 +32,9 @@ export default class LineGraph extends React.Component<LineGraphProps> {
|
|
29
32
|
componentDidMount() {
|
30
33
|
const {
|
31
34
|
axisTitle,
|
35
|
+
xAxisCategories,
|
36
|
+
yAxisMin,
|
37
|
+
yAxisMax,
|
32
38
|
className,
|
33
39
|
chartData,
|
34
40
|
id,
|
@@ -46,6 +52,9 @@ export default class LineGraph extends React.Component<LineGraphProps> {
|
|
46
52
|
subtitle: subTitle,
|
47
53
|
type,
|
48
54
|
title: title,
|
55
|
+
xAxisCategories: xAxisCategories,
|
56
|
+
yAxisMin: yAxisMin,
|
57
|
+
yAxisMax: yAxisMax,
|
49
58
|
})
|
50
59
|
}
|
51
60
|
|
@@ -15,4 +15,12 @@
|
|
15
15
|
data: [12908, 5948, 8105, 11248, 8989, 11816, 18274, 18111]
|
16
16
|
}] %>
|
17
17
|
|
18
|
-
<%= pb_rails("line_graph", props: {
|
18
|
+
<%= pb_rails("line_graph", props: {
|
19
|
+
id: "line-test",
|
20
|
+
gradient: false,
|
21
|
+
chart_data: data,
|
22
|
+
x_axis_categories:['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],
|
23
|
+
title: 'Solar Employment Growth by Sector, 2010-2016',
|
24
|
+
subtitle: 'Source: thesolarfoundation.com',
|
25
|
+
axis_title: 'Number of Employees'
|
26
|
+
}) %>
|
@@ -23,10 +23,11 @@ const LineGraphDefault = () => (
|
|
23
23
|
<LineGraph
|
24
24
|
axisTitle="Number of Employees"
|
25
25
|
chartData={data}
|
26
|
-
id="
|
27
|
-
pointStart={1}
|
26
|
+
id="bar-test"
|
28
27
|
subTitle="Source: thesolarfoundation.com"
|
29
28
|
title="Solar Employment Growth by Sector, 2010-2016"
|
29
|
+
xAxisCategories={['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']}
|
30
|
+
yAxisMin={0}
|
30
31
|
/>
|
31
32
|
</div>
|
32
33
|
)
|
@@ -15,7 +15,10 @@ module Playbook
|
|
15
15
|
prop :point_start, type: Playbook::Props::Numeric
|
16
16
|
prop :subtitle
|
17
17
|
prop :title
|
18
|
-
|
18
|
+
prop :x_axis_categories, type: Playbook::Props::Array,
|
19
|
+
default:[]
|
20
|
+
prop :y_axis_min, type: Playbook::Props::Numeric
|
21
|
+
prop :y_axis_max, type: Playbook::Props::Numeric
|
19
22
|
def chart_type
|
20
23
|
gradient ? "area" : "line"
|
21
24
|
end
|
@@ -26,9 +29,12 @@ module Playbook
|
|
26
29
|
chartData: chart_data,
|
27
30
|
type: chart_type,
|
28
31
|
title: title,
|
29
|
-
|
32
|
+
subtitle: subtitle,
|
30
33
|
axisTitle: axis_title,
|
31
34
|
pointStart: point_start,
|
35
|
+
xAxisCategories: x_axis_categories,
|
36
|
+
yAxisMin: y_axis_min,
|
37
|
+
yAxisMax: y_axis_max,
|
32
38
|
}.to_json.html_safe
|
33
39
|
end
|
34
40
|
|
@@ -1,21 +1,63 @@
|
|
1
|
+
/* @flow */
|
1
2
|
import React from 'react'
|
2
|
-
import
|
3
|
+
import classnames from 'classnames'
|
4
|
+
import { buildCss } from '../utilities/props'
|
3
5
|
|
4
|
-
|
5
|
-
|
6
|
-
|
6
|
+
type ProgressSimpleProps = {
|
7
|
+
align?: "left" | "center" | "right",
|
8
|
+
className?: String | Array<String>,
|
9
|
+
dark?: Boolean,
|
10
|
+
data?: String,
|
11
|
+
id?: String,
|
12
|
+
max?: String,
|
13
|
+
muted: Boolean,
|
14
|
+
percent: String,
|
15
|
+
value: Number,
|
16
|
+
width: String
|
7
17
|
}
|
8
18
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
19
|
+
const ProgressSimple = ({
|
20
|
+
align,
|
21
|
+
className,
|
22
|
+
dark = false,
|
23
|
+
max,
|
24
|
+
muted = false,
|
25
|
+
percent = '',
|
26
|
+
value,
|
27
|
+
width = '100%',
|
28
|
+
}: ProgressSimpleProps) => {
|
29
|
+
const styles = {
|
30
|
+
width: width,
|
31
|
+
}
|
32
|
+
|
33
|
+
const valueStyles = {
|
34
|
+
width: percent ? `${percent}%` : `${(value * 100) / max}%`,
|
16
35
|
}
|
17
|
-
}
|
18
36
|
|
19
|
-
|
37
|
+
const wrapperClass = classnames(
|
38
|
+
className,
|
39
|
+
buildCss('pb_progress_simple_wrapper', align, { dark: dark })
|
40
|
+
)
|
41
|
+
|
42
|
+
const kitClass = classnames(
|
43
|
+
className,
|
44
|
+
buildCss('pb_progress_simple_kit', align, { muted: muted })
|
45
|
+
)
|
46
|
+
|
47
|
+
return (
|
48
|
+
<div className={wrapperClass}>
|
49
|
+
<div
|
50
|
+
className={kitClass}
|
51
|
+
data-value={value}
|
52
|
+
style={styles}
|
53
|
+
>
|
54
|
+
<div
|
55
|
+
className="progress_simple_value"
|
56
|
+
style={valueStyles}
|
57
|
+
/>
|
58
|
+
</div>
|
59
|
+
</div>
|
60
|
+
)
|
61
|
+
}
|
20
62
|
|
21
63
|
export default ProgressSimple
|