playbook_ui 14.9.0.pre.alpha.play1742globalheightfixes4766 → 14.9.0.pre.alpha.play1742globalheightfixes4926
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_advanced_table/table_header.html.erb +5 -3
- data/app/pb_kits/playbook/pb_avatar/_avatar.scss +0 -2
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom.jsx +53 -49
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom_rails.html.erb +29 -36
- data/app/pb_kits/playbook/pb_body/_body.scss +14 -13
- data/app/pb_kits/playbook/pb_body/_body_mixins.scss +22 -16
- data/app/pb_kits/playbook/pb_bread_crumbs/docs/_bread_crumbs_default.jsx +6 -0
- data/app/pb_kits/playbook/pb_caption/_caption_mixin.scss +2 -1
- data/app/pb_kits/playbook/pb_card/_card_mixin.scss +1 -1
- data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +9 -4
- data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleContent.tsx +2 -2
- data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleMain.tsx +2 -2
- data/app/pb_kits/playbook/pb_file_upload/_file_upload.scss +5 -0
- data/app/pb_kits/playbook/pb_file_upload/_file_upload.tsx +7 -2
- data/app/pb_kits/playbook/pb_file_upload/file_upload.html.erb +8 -2
- data/app/pb_kits/playbook/pb_link/_link.scss +3 -3
- data/app/pb_kits/playbook/pb_nav/_bold_mixin.scss +11 -1
- data/app/pb_kits/playbook/pb_nav/_collapsible_nav.scss +16 -2
- data/app/pb_kits/playbook/pb_nav/_vertical_nav.scss +1 -1
- data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +4 -4
- data/app/pb_kits/playbook/pb_selectable_card/selectable_card.html.erb +1 -1
- data/app/pb_kits/playbook/pb_stat_change/_stat_change.tsx +44 -36
- data/app/pb_kits/playbook/pb_stat_change/stat_change.html.erb +4 -4
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns.html.erb +95 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible.jsx +75 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible.md +1 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_click.jsx +108 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_click.md +2 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_content.jsx +94 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_content.md +0 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows.jsx +83 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows.md +3 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table.jsx +120 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table.md +1 -0
- data/app/pb_kits/playbook/pb_table/docs/example.yml +5 -0
- data/app/pb_kits/playbook/pb_table/docs/index.js +5 -0
- data/app/pb_kits/playbook/pb_table/index.ts +100 -26
- data/app/pb_kits/playbook/pb_table/styles/_all.scss +2 -1
- data/app/pb_kits/playbook/pb_table/styles/_collapsible.scss +35 -0
- data/app/pb_kits/playbook/pb_table/subcomponents/_table_row.tsx +106 -1
- data/app/pb_kits/playbook/pb_table/table.html.erb +1 -1
- data/app/pb_kits/playbook/pb_table/table.rb +17 -2
- data/app/pb_kits/playbook/pb_title/_title.scss +6 -5
- data/app/pb_kits/playbook/pb_title/_title_mixin.scss +13 -0
- data/app/pb_kits/playbook/tokens/_titles.scss +0 -8
- data/app/pb_kits/playbook/utilities/_hover.scss +11 -2
- data/app/pb_kits/playbook/utilities/globalProps.ts +2 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/hover.test.js +15 -0
- data/dist/chunks/{_typeahead-B8fkIeXA.js → _typeahead-D-DFD48D.js} +3 -3
- data/dist/chunks/_weekday_stacked-CCO9Egzl.js +45 -0
- data/dist/chunks/{lib-SyD3buPZ.js → lib-CuCy3_xO.js} +3 -3
- data/dist/chunks/{pb_form_validation-Dt8UJgrJ.js → pb_form_validation-D37k10a0.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +1 -1
- data/dist/playbook-doc.js +1 -1
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/hover.rb +7 -1
- data/lib/playbook/version.rb +1 -1
- metadata +18 -6
- data/dist/chunks/_weekday_stacked-DjRTXEi-.js +0 -45
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16002f39de274c538b2a89f988472a70d8f1b13906760721071518a862fd5386
|
4
|
+
data.tar.gz: d6232d80a13d9f076b5f70f5254309f670e2c6d28153cd6067e9a22cc251a745
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59dc2ddf5f8a609633d8a06c1a591fd3ec2e091037e41356b8e523c5d928b9e358292815b74a78180e92a3c9ec080050dcebd07baa8c4ee999f0130bdaf6a26e
|
7
|
+
data.tar.gz: a95b1b1fac702381450e0752e5d4fc7d64f0532bc2c79d8e6788eea3b0ec520211724b5378393281b3b433e1a4153ae2f33969b13201ddb249f70e84ba96a4f4
|
@@ -4,8 +4,10 @@
|
|
4
4
|
<%= pb_rails("table/table_header", props: { tag: "div", id: item[:accessor], classname: object.th_classname, sort_menu: item[:sort_menu] }) do %>
|
5
5
|
<%= pb_rails("flex", props:{ align: "center", justify: index.zero? ? "start" : "end", text_align: "end" }) do %>
|
6
6
|
<% if index.zero? && (object.enable_toggle_expansion == "header" || object.enable_toggle_expansion == "all") %>
|
7
|
-
<button
|
8
|
-
|
7
|
+
<button
|
8
|
+
class="gray-icon toggle-all-icon"
|
9
|
+
onclick="expandAllRows(this); event.preventDefault();">
|
10
|
+
<%= pb_rails("icon", props: { icon: "arrows-from-line", cursor: "pointer", fixed_width: true, padding_right: "xs" }) %>
|
9
11
|
</button>
|
10
12
|
<% end %>
|
11
13
|
<%= item[:label] %>
|
@@ -13,4 +15,4 @@
|
|
13
15
|
<% end %>
|
14
16
|
<% end %>
|
15
17
|
<% end %>
|
16
|
-
<% end %>
|
18
|
+
<% end %>
|
@@ -31,14 +31,12 @@ $avatar-sizes: (
|
|
31
31
|
[class^=pb_card_kit].overlay_top_center {
|
32
32
|
left: 50%;
|
33
33
|
transform: translateX(-50%);
|
34
|
-
padding: 2px !important;
|
35
34
|
}
|
36
35
|
|
37
36
|
[class^=pb_card_kit].overlay_left_center,
|
38
37
|
[class^=pb_card_kit].overlay_right_center {
|
39
38
|
top: 50%;
|
40
39
|
transform: translateY(-50%);
|
41
|
-
padding: 2px !important;
|
42
40
|
}
|
43
41
|
}
|
44
42
|
|
@@ -1,66 +1,70 @@
|
|
1
1
|
import React from 'react'
|
2
|
-
|
2
|
+
import ReactDOMServer from 'react-dom/server'
|
3
3
|
import BarGraph from '../_bar_graph'
|
4
|
+
import Icon from '../../pb_icon/_icon'
|
5
|
+
|
6
|
+
const chartData = [
|
7
|
+
{
|
8
|
+
name: 'Role',
|
9
|
+
data: [0, 200, 300, 654, 656],
|
10
|
+
},
|
11
|
+
{
|
12
|
+
name: 'Company',
|
13
|
+
data: [150, 524, 320, 440, 500],
|
14
|
+
},
|
15
|
+
]
|
4
16
|
|
5
|
-
const
|
6
|
-
|
7
|
-
|
8
|
-
}
|
9
|
-
|
10
|
-
|
11
|
-
}
|
12
|
-
name: 'Sales & Distribution',
|
13
|
-
data: [3387, 743, 1344, 434, 440],
|
14
|
-
}, {
|
15
|
-
name: 'Project Development',
|
16
|
-
data: [3227, 878, 999, 780, 1000],
|
17
|
-
}, {
|
18
|
-
name: 'Other',
|
19
|
-
data: [1111, 677, 3245, 500, 200],
|
20
|
-
}]
|
17
|
+
const renderIcon = (iconName, color) => {
|
18
|
+
return ReactDOMServer.renderToStaticMarkup(
|
19
|
+
<Icon
|
20
|
+
color={color}
|
21
|
+
icon={iconName}
|
22
|
+
/>)
|
23
|
+
};
|
21
24
|
|
22
25
|
const barGraphOptions = {
|
23
|
-
|
24
|
-
|
25
|
-
style: {
|
26
|
-
color: "red"
|
27
|
-
}
|
26
|
+
yAxis: {
|
27
|
+
tickInterval: 5,
|
28
28
|
},
|
29
29
|
xAxis: {
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
}
|
49
|
-
|
30
|
+
categories: ['1', '2', '3', '4', '5'],
|
31
|
+
labels: {
|
32
|
+
useHTML: true,
|
33
|
+
formatter: function () {
|
34
|
+
switch (this.value) {
|
35
|
+
case '1':
|
36
|
+
return `${renderIcon('frown', 'error')}`;
|
37
|
+
case '2':
|
38
|
+
return `${renderIcon('frown', 'warning')}`;
|
39
|
+
case '3':
|
40
|
+
return `${renderIcon('frown-open', 'neutral')}`;
|
41
|
+
case '4':
|
42
|
+
return `${renderIcon('smile', 'category_7')}`;
|
43
|
+
case '5':
|
44
|
+
return `${renderIcon('smile-beam', 'success')}`;
|
45
|
+
default:
|
46
|
+
return ''
|
47
|
+
}
|
48
|
+
},
|
49
|
+
style: {
|
50
|
+
fontSize: '1.4em',
|
51
|
+
},
|
52
|
+
y: 42,
|
53
|
+
},
|
54
|
+
},
|
55
|
+
legend: {
|
56
|
+
itemMarginTop: 62,
|
57
|
+
},
|
50
58
|
}
|
51
59
|
|
52
|
-
const BarGraphCustom = (
|
60
|
+
const BarGraphCustom = () => (
|
53
61
|
<div>
|
54
62
|
<BarGraph
|
55
|
-
axisTitle="Number of Employees"
|
56
63
|
chartData={chartData}
|
57
64
|
customOptions={barGraphOptions}
|
58
|
-
id="
|
59
|
-
|
65
|
+
id="happiness-dashboard"
|
66
|
+
legend
|
60
67
|
title="Bar Graph with Custom Overrides"
|
61
|
-
xAxisCategories={['Jan', 'Feb', 'Mar', 'Apr', 'May']}
|
62
|
-
yAxisMin={0}
|
63
|
-
{...props}
|
64
68
|
/>
|
65
69
|
</div>
|
66
70
|
)
|
@@ -1,49 +1,42 @@
|
|
1
1
|
<% data = [{
|
2
|
-
|
3
|
-
|
2
|
+
name: 'Role',
|
3
|
+
data: [0, 200, 300, 654, 656],
|
4
4
|
}, {
|
5
|
-
|
6
|
-
|
7
|
-
}, {
|
8
|
-
name: 'Sales & Distribution',
|
9
|
-
data: [3387,743,1344,434,440,]
|
10
|
-
}, {
|
11
|
-
name: 'Project Development',
|
12
|
-
data: [3227,878,999,780,1000]
|
13
|
-
}, {
|
14
|
-
name: 'Other',
|
15
|
-
data: [1111,677,3245,500,200]
|
5
|
+
name: 'Company',
|
6
|
+
data: [150, 524, 320, 440, 500],
|
16
7
|
}] %>
|
17
8
|
|
18
9
|
<% bar_graph_options = {
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
10
|
+
customOptions: {
|
11
|
+
yAxis: {
|
12
|
+
tickInterval: 5,
|
13
|
+
},
|
14
|
+
xAxis: {
|
15
|
+
categories: [
|
16
|
+
raw(pb_rails("icon", props: { icon: "frown", color: "error", size: "2x" })),
|
17
|
+
raw(pb_rails("icon", props: { icon: "frown", color: "warning", size: "2x" })),
|
18
|
+
raw(pb_rails("icon", props: { icon: "frown-open", color: "neutral", size: "2x" })),
|
19
|
+
raw(pb_rails("icon", props: { icon: "smile", color: "category_7", size: "2x" })),
|
20
|
+
raw(pb_rails("icon", props: { icon: "smile-beam", color: "success", size: "2x" }))
|
21
|
+
],
|
22
|
+
labels: {
|
23
|
+
useHTML: true,
|
24
|
+
sytle: {
|
25
|
+
fontSize: '1.4em',
|
25
26
|
},
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
],
|
34
|
-
labels: {
|
35
|
-
useHTML: true,
|
36
|
-
}
|
37
|
-
}
|
38
|
-
}
|
27
|
+
y: 42,
|
28
|
+
},
|
29
|
+
},
|
30
|
+
legend: {
|
31
|
+
itemMarginTop: 62,
|
32
|
+
},
|
33
|
+
}
|
39
34
|
} %>
|
40
35
|
|
41
36
|
<%= pb_rails("bar_graph", props: {
|
42
|
-
axis_title: 'Number of Employees',
|
43
37
|
chart_data: data,
|
44
38
|
id: "bar-default",
|
45
|
-
|
46
|
-
subtitle: 'Subtitle to replace',
|
39
|
+
legend: true,
|
47
40
|
title: 'Bar Graph with Custom Overrides',
|
48
41
|
custom_options: bar_graph_options
|
49
|
-
}) %>
|
42
|
+
}) %>
|
@@ -1,24 +1,25 @@
|
|
1
1
|
@import "./body_mixins";
|
2
2
|
@import "../tokens/titles";
|
3
3
|
|
4
|
-
[class^=pb_body_kit]{
|
4
|
+
[class^="pb_body_kit"] {
|
5
5
|
@include pb_body($text_lt_default);
|
6
6
|
@each $color_name, $color_value in $pb_body_colors {
|
7
7
|
&[class*=_#{"" + $color_name}] {
|
8
8
|
@include pb_body($color_value);
|
9
9
|
}
|
10
10
|
@each $status_name, $status_value in $pb_body_status {
|
11
|
-
&[class*=_default_#{$status_name}] {
|
11
|
+
&[class*="_default_#{$status_name}"] {
|
12
12
|
@include pb_body($status_value);
|
13
13
|
}
|
14
14
|
}
|
15
15
|
}
|
16
|
-
@each $dark_color_name, $dark_color_value in $pb_dark_body_colors{
|
17
|
-
&[class*=_#{$dark_color_name}][class*=dark]{
|
16
|
+
@each $dark_color_name, $dark_color_value in $pb_dark_body_colors {
|
17
|
+
&[class*="_#{$dark_color_name}"][class*="dark"] {
|
18
18
|
@include pb_body($dark_color_value);
|
19
19
|
}
|
20
20
|
}
|
21
|
-
b,
|
21
|
+
b,
|
22
|
+
strong {
|
22
23
|
font-weight: $bold;
|
23
24
|
}
|
24
25
|
|
@@ -29,7 +30,8 @@
|
|
29
30
|
}
|
30
31
|
}
|
31
32
|
|
32
|
-
em,
|
33
|
+
em,
|
34
|
+
i {
|
33
35
|
font-style: italic;
|
34
36
|
}
|
35
37
|
|
@@ -39,26 +41,25 @@
|
|
39
41
|
}
|
40
42
|
|
41
43
|
@each $status_name, $status_value in $pb_body_status {
|
42
|
-
&[class
|
44
|
+
&[class*="#{$status_name}"] {
|
43
45
|
@include pb_body($status_value);
|
44
46
|
}
|
45
47
|
}
|
46
48
|
|
47
|
-
&[class*=dark] {
|
49
|
+
&[class*="dark"] {
|
48
50
|
a {
|
49
51
|
color: $active_dark;
|
50
52
|
}
|
51
53
|
@include pb_body_dark();
|
52
|
-
@each $dark_color_name, $dark_color_value in $pb_dark_body_colors{
|
53
|
-
&[class*=_#{$dark_color_name}][class*=dark]{
|
54
|
+
@each $dark_color_name, $dark_color_value in $pb_dark_body_colors {
|
55
|
+
&[class*="_#{$dark_color_name}"][class*="dark"] {
|
54
56
|
@include pb_body($dark_color_value);
|
55
57
|
}
|
56
58
|
}
|
57
|
-
@each $status_name, $status_value in $
|
58
|
-
&[class*=_#{$status_name}] {
|
59
|
+
@each $status_name, $status_value in $pb_dark_body_status {
|
60
|
+
&[class*="_#{$status_name}"] {
|
59
61
|
@include pb_body($status_value);
|
60
62
|
}
|
61
63
|
}
|
62
64
|
}
|
63
|
-
|
64
65
|
}
|
@@ -3,29 +3,35 @@
|
|
3
3
|
@import "../tokens/typography";
|
4
4
|
|
5
5
|
$pb_body_colors: (
|
6
|
-
default:
|
7
|
-
light:
|
8
|
-
lighter:
|
9
|
-
link:
|
10
|
-
error:
|
11
|
-
success:
|
6
|
+
default: $text_lt_default,
|
7
|
+
light: $text_lt_light,
|
8
|
+
lighter: $text_lt_lighter,
|
9
|
+
link: $primary,
|
10
|
+
error: $error,
|
11
|
+
success: $text_lt_success_sm,
|
12
12
|
);
|
13
13
|
|
14
14
|
$pb_dark_body_colors: (
|
15
|
-
default:
|
16
|
-
light:
|
17
|
-
lighter:
|
18
|
-
link:
|
19
|
-
error:
|
20
|
-
success:
|
15
|
+
default: $text_dk_default,
|
16
|
+
light: $text_dk_light,
|
17
|
+
lighter: $text_dk_lighter,
|
18
|
+
link: $active_dark,
|
19
|
+
error: $error,
|
20
|
+
success: $text_dk_success_sm,
|
21
21
|
);
|
22
22
|
|
23
23
|
// Order is important here!
|
24
24
|
$pb_body_status: (
|
25
|
-
default:
|
26
|
-
negative:
|
27
|
-
dark_error:
|
28
|
-
positive:
|
25
|
+
default: $text_lt_default,
|
26
|
+
negative: $error,
|
27
|
+
dark_error: $error_dark_body,
|
28
|
+
positive: $text_lt_success_sm,
|
29
|
+
);
|
30
|
+
|
31
|
+
$pb_dark_body_status: (
|
32
|
+
default: $text_dk_default,
|
33
|
+
negative: $error_dark,
|
34
|
+
positive: $text_dk_success_sm,
|
29
35
|
);
|
30
36
|
|
31
37
|
@mixin pb_body($color: $text_lt_default) {
|
@@ -13,6 +13,7 @@ const BreadCrumbsDefault = (props) => {
|
|
13
13
|
<Icon
|
14
14
|
icon="home"
|
15
15
|
size="1x"
|
16
|
+
{...props}
|
16
17
|
/>
|
17
18
|
<BreadCrumbItem
|
18
19
|
{...props}
|
@@ -22,11 +23,13 @@ const BreadCrumbsDefault = (props) => {
|
|
22
23
|
size="4"
|
23
24
|
tag="span"
|
24
25
|
text="Home"
|
26
|
+
{...props}
|
25
27
|
/>
|
26
28
|
</BreadCrumbItem>
|
27
29
|
<Icon
|
28
30
|
icon="users"
|
29
31
|
size="1x"
|
32
|
+
{...props}
|
30
33
|
/>
|
31
34
|
<Link
|
32
35
|
{...props}
|
@@ -36,17 +39,20 @@ const BreadCrumbsDefault = (props) => {
|
|
36
39
|
size="4"
|
37
40
|
tag="span"
|
38
41
|
text="Users"
|
42
|
+
{...props}
|
39
43
|
/>
|
40
44
|
</Link>
|
41
45
|
<Icon
|
42
46
|
icon="user"
|
43
47
|
size="1x"
|
48
|
+
{...props}
|
44
49
|
/>
|
45
50
|
<Link {...props}>
|
46
51
|
<Title
|
47
52
|
size="4"
|
48
53
|
tag="span"
|
49
54
|
text="User"
|
55
|
+
{...props}
|
50
56
|
/>
|
51
57
|
</Link>
|
52
58
|
</BreadCrumbs>
|
@@ -32,7 +32,7 @@ $pb_card_header_colors: map-merge(map-merge($product_colors, $additional_colors)
|
|
32
32
|
}
|
33
33
|
|
34
34
|
@mixin pb_card_selected_dark {
|
35
|
-
@include pb_card_selected($
|
35
|
+
@include pb_card_selected($primary_action_dark);
|
36
36
|
}
|
37
37
|
|
38
38
|
@mixin pb_card($background: $card_light, $border_color: $border_light) {
|
@@ -2,7 +2,7 @@ import React, { useEffect, ReactElement } from 'react'
|
|
2
2
|
import classnames from 'classnames'
|
3
3
|
import useCollapsible from './useCollapsible'
|
4
4
|
|
5
|
-
import { globalProps, globalInlineProps } from '../utilities/globalProps'
|
5
|
+
import { globalProps, globalInlineProps, GlobalProps } from '../utilities/globalProps'
|
6
6
|
import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
|
7
7
|
|
8
8
|
import CollapsibleContent from './child_kits/CollapsibleContent'
|
@@ -32,6 +32,7 @@ type CollapsibleProps = {
|
|
32
32
|
onClick?: ()=> void,
|
33
33
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
34
34
|
id?: string,
|
35
|
+
tag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'div' | 'tr' | 'th' | 'td' | 'thead' | 'col',
|
35
36
|
}
|
36
37
|
|
37
38
|
const Collapsible = ({
|
@@ -47,8 +48,9 @@ const Collapsible = ({
|
|
47
48
|
onIconClick,
|
48
49
|
onClick,
|
49
50
|
id,
|
51
|
+
tag = 'div',
|
50
52
|
...props
|
51
|
-
}: CollapsibleProps): React.ReactElement => {
|
53
|
+
}: CollapsibleProps & GlobalProps): React.ReactElement => {
|
52
54
|
const [isCollapsed, toggle, setIsCollapsed] = useCollapsible(collapsed)
|
53
55
|
|
54
56
|
useEffect(()=> {
|
@@ -76,9 +78,12 @@ const Collapsible = ({
|
|
76
78
|
className
|
77
79
|
)
|
78
80
|
const dynamicInlineProps = globalInlineProps(props)
|
81
|
+
|
82
|
+
const Tag: React.ReactElement | any = `${tag}`;
|
83
|
+
|
79
84
|
return (
|
80
85
|
<CollapsibleContext.Provider value={{ collapsed: isCollapsed, toggle, icon, iconSize, iconColor, onIconClick, onClick }}>
|
81
|
-
<
|
86
|
+
<Tag
|
82
87
|
{...ariaProps}
|
83
88
|
{...dataProps}
|
84
89
|
{...htmlProps}
|
@@ -96,7 +101,7 @@ const Collapsible = ({
|
|
96
101
|
<CollapsibleContent {...contentProps}>
|
97
102
|
{contentChildren}
|
98
103
|
</CollapsibleContent>
|
99
|
-
</
|
104
|
+
</Tag>
|
100
105
|
</CollapsibleContext.Provider>
|
101
106
|
)
|
102
107
|
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import classnames from 'classnames'
|
2
2
|
import React, { useContext, useRef, useEffect } from 'react'
|
3
3
|
import { buildCss } from '../../utilities/props'
|
4
|
-
import { globalProps } from '../../utilities/globalProps'
|
4
|
+
import { globalProps, GlobalProps } from '../../utilities/globalProps'
|
5
5
|
import { hideElement, showElement } from '../_helper_functions'
|
6
6
|
|
7
7
|
import CollapsibleContext from '../context'
|
@@ -15,7 +15,7 @@ const CollapsibleContent = ({
|
|
15
15
|
children,
|
16
16
|
className,
|
17
17
|
...props
|
18
|
-
}: CollapsibleContentProps): React.ReactElement => {
|
18
|
+
}: CollapsibleContentProps & GlobalProps): React.ReactElement => {
|
19
19
|
const context: {[key: string]: boolean | string} = useContext(CollapsibleContext)
|
20
20
|
const contentCSS = buildCss('pb_collapsible_content_kit')
|
21
21
|
const contentSpacing = globalProps(props)
|
@@ -3,7 +3,7 @@
|
|
3
3
|
import classnames from 'classnames'
|
4
4
|
import React, { useContext } from 'react'
|
5
5
|
import { buildCss } from '../../utilities/props'
|
6
|
-
import { globalProps } from '../../utilities/globalProps'
|
6
|
+
import { globalProps, GlobalProps } from '../../utilities/globalProps'
|
7
7
|
|
8
8
|
import Flex from '../../pb_flex/_flex'
|
9
9
|
import FlexItem from '../../pb_flex/_flex_item'
|
@@ -25,7 +25,7 @@ const CollapsibleMain = ({
|
|
25
25
|
className,
|
26
26
|
cursor = 'pointer',
|
27
27
|
...props
|
28
|
-
}: CollapsibleMainProps): React.ReactElement=> {
|
28
|
+
}: CollapsibleMainProps & GlobalProps): React.ReactElement=> {
|
29
29
|
const {collapsed, toggle, icon, iconSize, iconColor, onIconClick, onClick}: any = useContext(CollapsibleContext)
|
30
30
|
const mainCSS = buildCss('pb_collapsible_main_kit')
|
31
31
|
const mainSpacing = globalProps(props, { cursor })
|
@@ -13,6 +13,7 @@ type FileUploadProps = {
|
|
13
13
|
accept?: string[],
|
14
14
|
className?: string,
|
15
15
|
customMessage?: string,
|
16
|
+
dark?: boolean,
|
16
17
|
data?: {[key: string]: string | number},
|
17
18
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
18
19
|
acceptedFilesDescription?: string,
|
@@ -31,6 +32,7 @@ const FileUpload = (props: FileUploadProps): React.ReactElement => {
|
|
31
32
|
acceptedFilesDescription = '',
|
32
33
|
className,
|
33
34
|
customMessage,
|
35
|
+
dark = false,
|
34
36
|
data = {},
|
35
37
|
htmlOptions = {},
|
36
38
|
maxSize,
|
@@ -94,9 +96,12 @@ const FileUpload = (props: FileUploadProps): React.ReactElement => {
|
|
94
96
|
{...htmlProps}
|
95
97
|
{...getRootProps()}
|
96
98
|
>
|
97
|
-
<Card>
|
99
|
+
<Card dark={dark}>
|
98
100
|
<input {...getInputProps()} />
|
99
|
-
<Body
|
101
|
+
<Body
|
102
|
+
color="light"
|
103
|
+
dark={dark}
|
104
|
+
>
|
100
105
|
{isDragActive ?
|
101
106
|
<p>{'Drop the files here ...'}</p>
|
102
107
|
:
|
@@ -5,11 +5,17 @@
|
|
5
5
|
id: object.id,
|
6
6
|
**combined_html_options) do %>
|
7
7
|
<%= pb_rails("form_group", props: {cursor: "pointer", full_width: object.full_width}) do %>
|
8
|
-
<label
|
8
|
+
<label
|
9
|
+
for="upload-<%= object.id %>"
|
10
|
+
class="pb_button_kit_secondary_inline_enabled <%= 'dark' if object.dark %>"
|
11
|
+
>
|
12
|
+
<%= "#{object.label}" %>
|
13
|
+
</label>
|
9
14
|
<%= pb_rails("text_input", props: {
|
10
15
|
type: "file",
|
16
|
+
dark: object.dark,
|
11
17
|
input_options: {
|
12
|
-
id: "upload-#{object.id}",
|
18
|
+
id: "upload-#{object.id}",
|
13
19
|
classname: "cursor_pointer",
|
14
20
|
}.merge(object.input_options)
|
15
21
|
}) %>
|
@@ -17,7 +17,7 @@
|
|
17
17
|
outline-offset: 2px;
|
18
18
|
}
|
19
19
|
&:visited {
|
20
|
-
color: $
|
20
|
+
color: darken($primary_action, 10%);
|
21
21
|
}
|
22
22
|
&.dark {
|
23
23
|
@include pb_link($active_dark);
|
@@ -34,7 +34,7 @@
|
|
34
34
|
}
|
35
35
|
|
36
36
|
&:visited {
|
37
|
-
color: $
|
37
|
+
color: darken($primary_action, 10%);
|
38
38
|
}
|
39
39
|
}
|
40
40
|
}
|
@@ -48,7 +48,7 @@
|
|
48
48
|
}
|
49
49
|
|
50
50
|
&:visited {
|
51
|
-
color: $
|
51
|
+
color: darken($primary_action, 10%);
|
52
52
|
}
|
53
53
|
}
|
54
54
|
}
|