playbook_ui 14.9.0.pre.alpha.PBNTR746datepickerdefaultbug4903 → 14.9.0.pre.alpha.PBNTR767advancedtablemultiheadercolumns5136
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/Components/CollapsibleTrail.tsx +1 -6
- data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +32 -19
- data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableBody.tsx +3 -1
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +48 -3
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +33 -19
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_collapsible_trail_rails.html.erb +36 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_collapsible_trail_rails.md +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers.jsx +60 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers.md +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_multiple.jsx +74 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_multiple.md +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +3 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +4 -2
- data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +8 -0
- data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +2 -0
- data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.html.erb +8 -0
- data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb +2 -0
- 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_card/_card.tsx +7 -7
- data/app/pb_kits/playbook/pb_card/_card_mixin.scss +1 -1
- data/app/pb_kits/playbook/pb_card/docs/_card_header.html.erb +21 -1
- data/app/pb_kits/playbook/pb_card/docs/_card_header.jsx +50 -0
- data/app/pb_kits/playbook/pb_card/docs/_card_header.md +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_date_picker/date_picker_helper.ts +2 -4
- data/app/pb_kits/playbook/pb_drawer/_drawer.tsx +2 -2
- data/app/pb_kits/playbook/pb_form_group/_error_state_mixin.scss +57 -0
- data/app/pb_kits/playbook/pb_form_group/_form_group.scss +11 -2
- data/app/pb_kits/playbook/pb_gauge/_gauge.scss +31 -1
- data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +3 -3
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_complex.jsx +25 -5
- data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.tsx +17 -1
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_emphasis.html.erb +17 -1
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_emphasis.jsx +15 -0
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_emphasis.md +2 -1
- data/app/pb_kits/playbook/pb_home_address_street/home_address_street.rb +15 -1
- data/app/pb_kits/playbook/pb_home_address_street/none_emphasis.html.erb +32 -0
- data/app/pb_kits/playbook/pb_home_address_street/none_emphasis.rb +29 -0
- data/app/pb_kits/playbook/pb_layout/_layout.tsx +30 -11
- data/app/pb_kits/playbook/pb_link/_link.scss +3 -3
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_filter.jsx +166 -0
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_height_width.jsx +2 -0
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_user.jsx +89 -0
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/example.yml +2 -1
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_table/_table.tsx +6 -6
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns.html.erb +30 -48
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns_rails.md +1 -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 +7 -0
- data/app/pb_kits/playbook/pb_table/docs/index.js +5 -0
- data/app/pb_kits/playbook/pb_table/index.ts +5 -3
- 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/styles/_scroll.scss +28 -3
- data/app/pb_kits/playbook/pb_table/styles/_sticky_columns.scss +0 -1
- data/app/pb_kits/playbook/pb_table/subcomponents/_table_row.tsx +106 -1
- data/app/pb_kits/playbook/pb_table/table.html.erb +7 -1
- data/app/pb_kits/playbook/pb_table/table.rb +4 -0
- data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +35 -3
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask.jsx +88 -0
- data/app/pb_kits/playbook/pb_text_input/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_text_input/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_text_input/inputMask.ts +64 -0
- data/app/pb_kits/playbook/pb_text_input/text_input.test.js +139 -2
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +115 -46
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_highlight.jsx +9 -2
- data/app/pb_kits/playbook/pb_typeahead/typeahead.html.erb +3 -2
- data/dist/chunks/_typeahead-C63YYbKQ.js +22 -0
- data/dist/chunks/_weekday_stacked-CPOjyT4z.js +45 -0
- data/dist/chunks/lib-sMFo2JZy.js +29 -0
- data/dist/chunks/{pb_form_validation-DXJs12Hd.js → pb_form_validation-CgvjWbOK.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/version.rb +1 -1
- metadata +31 -6
- data/dist/chunks/_typeahead-8iXlv4ii.js +0 -22
- data/dist/chunks/_weekday_stacked-QiMNKnzf.js +0 -45
- data/dist/chunks/lib-orI4wF5u.js +0 -29
@@ -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
|
+
}) %>
|
@@ -6,7 +6,7 @@ import classnames from 'classnames'
|
|
6
6
|
|
7
7
|
import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
|
8
8
|
import { GlobalProps, globalProps, globalInlineProps } from '../utilities/globalProps'
|
9
|
-
import type { ProductColors, CategoryColors, BackgroundColors } from '../types/colors'
|
9
|
+
import type { ProductColors, CategoryColors, BackgroundColors, StatusColors } from '../types/colors'
|
10
10
|
|
11
11
|
import Icon from '../pb_icon/_icon'
|
12
12
|
import Flex from '../pb_flex/_flex'
|
@@ -36,7 +36,7 @@ type CardPropTypes = {
|
|
36
36
|
} & GlobalProps
|
37
37
|
|
38
38
|
type CardHeaderProps = {
|
39
|
-
headerColor?: BackgroundColors | ProductColors | CategoryColors | "none",
|
39
|
+
headerColor?: BackgroundColors | ProductColors | CategoryColors | StatusColors | "none",
|
40
40
|
headerColorStriped?: boolean,
|
41
41
|
children: React.ReactChild[] | React.ReactChild,
|
42
42
|
className?: string,
|
@@ -127,12 +127,12 @@ const Card = (props: CardPropTypes): React.ReactElement => {
|
|
127
127
|
|
128
128
|
const tagOptions = ['div', 'section', 'footer', 'header', 'article', 'aside', 'main', 'nav']
|
129
129
|
const Tag = tagOptions.includes(tag) ? tag : 'div'
|
130
|
-
|
130
|
+
|
131
131
|
return (
|
132
132
|
<>
|
133
133
|
{
|
134
134
|
draggableItem ? (
|
135
|
-
<Draggable.Item dragId={dragId}
|
135
|
+
<Draggable.Item dragId={dragId}
|
136
136
|
key={dragId}
|
137
137
|
>
|
138
138
|
<Tag
|
@@ -140,14 +140,14 @@ const Card = (props: CardPropTypes): React.ReactElement => {
|
|
140
140
|
{...dataProps}
|
141
141
|
className={classnames(cardCss, globalProps(props), className)}
|
142
142
|
{...restHtmlProps}
|
143
|
-
style={mergedStyles}
|
143
|
+
style={mergedStyles}
|
144
144
|
>
|
145
145
|
{subComponentTags('Header')}
|
146
146
|
{
|
147
147
|
dragHandle ? (
|
148
148
|
<Flex>
|
149
149
|
<span className="card_draggable_handle">
|
150
|
-
<Icon
|
150
|
+
<Icon
|
151
151
|
icon="grip-dots-vertical"
|
152
152
|
paddingRight="xs"
|
153
153
|
verticalAlign="middle"
|
@@ -169,7 +169,7 @@ const Card = (props: CardPropTypes): React.ReactElement => {
|
|
169
169
|
{...dataProps}
|
170
170
|
className={classnames(cardCss, globalProps(props), className)}
|
171
171
|
{...restHtmlProps}
|
172
|
-
style={mergedStyles}
|
172
|
+
style={mergedStyles}
|
173
173
|
>
|
174
174
|
{subComponentTags('Header')}
|
175
175
|
{nonHeaderChildren}
|
@@ -24,7 +24,7 @@ $additional_colors: (
|
|
24
24
|
"neutral_subtle": $neutral_subtle,
|
25
25
|
);
|
26
26
|
$background_colors: map-merge($product_colors, $additional_colors);
|
27
|
-
$pb_card_header_colors: map-merge(map-merge($product_colors, $additional_colors), $category_colors);
|
27
|
+
$pb_card_header_colors: map-merge(map-merge(map-merge($product_colors, $additional_colors), $category_colors), $status_colors);
|
28
28
|
|
29
29
|
@mixin pb_card_selected($border_color: $primary) {
|
30
30
|
border-color: $border_color;
|
@@ -67,4 +67,24 @@
|
|
67
67
|
<%= pb_rails("card/card_body", props: { padding: "md", }) do %>
|
68
68
|
Body
|
69
69
|
<% end %>
|
70
|
-
<% end %>
|
70
|
+
<% end %>
|
71
|
+
|
72
|
+
<%= pb_rails("title", props: { text: "Status Colors", tag: "h4", size: 4, margin_bottom: "sm" }) %>
|
73
|
+
|
74
|
+
<%= pb_rails("card", props: { padding: "none", header: true, margin_bottom: "sm"}) do %>
|
75
|
+
<%= pb_rails("card/card_header", props: { padding: "sm", header_color: "success" }) do %>
|
76
|
+
<%= pb_rails("body", props: { text: "Success", dark: true }) %>
|
77
|
+
<% end %>
|
78
|
+
<%= pb_rails("card/card_body", props: { padding: "md" }) do %>
|
79
|
+
Body
|
80
|
+
<% end %>
|
81
|
+
<% end %>
|
82
|
+
|
83
|
+
<%= pb_rails("card", props: { padding: "none", header: true, margin_bottom: "sm"}) do %>
|
84
|
+
<%= pb_rails("card/card_header", props: { padding: "sm", header_color: "error" }) do %>
|
85
|
+
<%= pb_rails("body", props: { text: "Error", dark: true }) %>
|
86
|
+
<% end %>
|
87
|
+
<%= pb_rails("card/card_body", props: { padding: "md" }) do %>
|
88
|
+
Body
|
89
|
+
<% end %>
|
90
|
+
<% end %>
|
@@ -181,6 +181,56 @@ const CardHeader = (props) => {
|
|
181
181
|
/>
|
182
182
|
</Card.Body>
|
183
183
|
</Card>
|
184
|
+
|
185
|
+
<Title
|
186
|
+
{...props}
|
187
|
+
marginBottom='sm'
|
188
|
+
size={4}
|
189
|
+
tag="h4"
|
190
|
+
text="Status Colors"
|
191
|
+
/>
|
192
|
+
|
193
|
+
<Card
|
194
|
+
{...props}
|
195
|
+
marginBottom='sm'
|
196
|
+
padding="none"
|
197
|
+
>
|
198
|
+
<Card.Header
|
199
|
+
headerColor="success"
|
200
|
+
>
|
201
|
+
<Body
|
202
|
+
dark
|
203
|
+
text="Success"
|
204
|
+
/>
|
205
|
+
</Card.Header>
|
206
|
+
<Card.Body>
|
207
|
+
<Body
|
208
|
+
{...props}
|
209
|
+
text="Body"
|
210
|
+
/>
|
211
|
+
</Card.Body>
|
212
|
+
</Card>
|
213
|
+
|
214
|
+
<Card
|
215
|
+
{...props}
|
216
|
+
marginBottom='sm'
|
217
|
+
padding="none"
|
218
|
+
>
|
219
|
+
<Card.Header
|
220
|
+
headerColor="error"
|
221
|
+
>
|
222
|
+
<Body
|
223
|
+
dark
|
224
|
+
text="Error"
|
225
|
+
/>
|
226
|
+
</Card.Header>
|
227
|
+
<Card.Body>
|
228
|
+
<Body
|
229
|
+
{...props}
|
230
|
+
text="Body"
|
231
|
+
/>
|
232
|
+
</Card.Body>
|
233
|
+
</Card>
|
184
234
|
</>
|
185
235
|
)
|
186
236
|
}
|
@@ -1 +1 @@
|
|
1
|
-
Card headers pass category, product, and background colors only. List of all category, product, and background colors can be viewed <a href="https://playbook.powerapp.cloud/visual_guidelines/colors" target="_blank">here</a>.
|
1
|
+
Card headers pass category, product, status and background colors only. List of all category, product, status and background colors can be viewed <a href="https://playbook.powerapp.cloud/visual_guidelines/colors" target="_blank">here</a>.
|
@@ -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 })
|
@@ -68,7 +68,7 @@ const datePickerHelper = (config: DatePickerConfig, scrollContainer: string | HT
|
|
68
68
|
timeFormat = 'at h:i K',
|
69
69
|
yearRange,
|
70
70
|
} = config
|
71
|
-
|
71
|
+
|
72
72
|
// ===========================================================
|
73
73
|
// | Hook Definitions |
|
74
74
|
// ===========================================================
|
@@ -148,8 +148,7 @@ const datePickerHelper = (config: DatePickerConfig, scrollContainer: string | HT
|
|
148
148
|
|
149
149
|
// time selection
|
150
150
|
if (enableTime) pluginList.push(timeSelectPlugin({ caption: timeCaption, showTimezone: showTimezone}))
|
151
|
-
|
152
|
-
console.log("4 " + pluginList);
|
151
|
+
|
153
152
|
return pluginList
|
154
153
|
}
|
155
154
|
|
@@ -245,7 +244,6 @@ const datePickerHelper = (config: DatePickerConfig, scrollContainer: string | HT
|
|
245
244
|
|
246
245
|
// Reverse month and year dropdown reset on form.reset()
|
247
246
|
if (picker.input.form) {
|
248
|
-
console.log("5 " + picker.input.form);
|
249
247
|
picker.input.form.addEventListener('reset', () => {
|
250
248
|
// Code block triggers after form.reset() is called and executed
|
251
249
|
setTimeout(() => {
|
@@ -287,7 +287,6 @@ const Drawer = (props: DrawerProps): React.ReactElement => {
|
|
287
287
|
{...ariaProps}
|
288
288
|
{...dataProps}
|
289
289
|
{...htmlProps}
|
290
|
-
style={dynamicInlineProps}
|
291
290
|
className={classnames(drawerClassNames.base, {
|
292
291
|
[drawerClassNames.afterOpen]:
|
293
292
|
animationState === "afterOpen",
|
@@ -296,6 +295,7 @@ const Drawer = (props: DrawerProps): React.ReactElement => {
|
|
296
295
|
})}
|
297
296
|
id={id}
|
298
297
|
onClick={(e) => e.stopPropagation()}
|
298
|
+
style={dynamicInlineProps}
|
299
299
|
>
|
300
300
|
{children}
|
301
301
|
</div>
|
@@ -306,7 +306,6 @@ const Drawer = (props: DrawerProps): React.ReactElement => {
|
|
306
306
|
{...dataProps}
|
307
307
|
{...htmlProps}
|
308
308
|
className={classes}
|
309
|
-
style={dynamicInlineProps}
|
310
309
|
>
|
311
310
|
{isModalVisible && (
|
312
311
|
<div
|
@@ -327,6 +326,7 @@ const Drawer = (props: DrawerProps): React.ReactElement => {
|
|
327
326
|
animationState === "beforeClose",
|
328
327
|
})}
|
329
328
|
onClick={(e) => e.stopPropagation()}
|
329
|
+
style={dynamicInlineProps}
|
330
330
|
>
|
331
331
|
{children}
|
332
332
|
</div>
|
@@ -0,0 +1,57 @@
|
|
1
|
+
@mixin error-state-flex-start-selectors {
|
2
|
+
&:has(.pb_text_input_kit.error):has(.pb_text_input_kit),
|
3
|
+
&:has(.pb_text_input_kit):has(.pb_date_picker_kit.error),
|
4
|
+
&:has(.pb_text_input_kit):has(.pb_select_kit_wrapper.error),
|
5
|
+
&:has(.pb_text_input_kit.error):has(.pb_text_input_kit_label):has(.pb_select_kit_wrapper.error) {
|
6
|
+
align-items: flex-start;
|
7
|
+
}
|
8
|
+
}
|
9
|
+
|
10
|
+
@mixin error-state-center-selectors {
|
11
|
+
&:has(.pb_select_kit_label):has(.pb_select_kit_wrapper.error):has(.pb_phone_number_input),
|
12
|
+
&:has(.pb_text_input_kit.error):has(.pb_text_input_kit_label):has([class^=pb_button_kit]) {
|
13
|
+
align-items: center;
|
14
|
+
}
|
15
|
+
}
|
16
|
+
|
17
|
+
@mixin error-state-flex-end-selectors {
|
18
|
+
&:has(.pb_select_kit_label):has(.pb_select_kit_wrapper.error):has(.pb_phone_number_input):has(.pb_text_input_kit.error) {
|
19
|
+
align-items: flex-end;
|
20
|
+
}
|
21
|
+
}
|
22
|
+
|
23
|
+
@mixin error-state-right-side-select-kit {
|
24
|
+
&:has(.pb_text_input_kit:not(.error)):has(.pb_text_input_kit_label):has(.pb_select_kit_wrapper.error),
|
25
|
+
&:has(.pb_text_input_kit.error):has(.pb_text_input_kit_label):has(.pb_select_kit_wrapper) {
|
26
|
+
align-items: flex-start;
|
27
|
+
|
28
|
+
.pb_select_kit_wrapper {
|
29
|
+
padding-top: $space_md;
|
30
|
+
margin-top: 2px;
|
31
|
+
|
32
|
+
.pb_select_kit_caret {
|
33
|
+
padding-top: $space_md;
|
34
|
+
}
|
35
|
+
}
|
36
|
+
|
37
|
+
.pb_select_kit_wrapper.error {
|
38
|
+
padding-top: $space_md;
|
39
|
+
margin-top: 2px;
|
40
|
+
|
41
|
+
.pb_select_kit_caret {
|
42
|
+
padding-top: $space_xl;
|
43
|
+
}
|
44
|
+
}
|
45
|
+
}
|
46
|
+
}
|
47
|
+
|
48
|
+
@mixin error-state-left-side-select-kit {
|
49
|
+
&:has(.pb_select_kit_label):has(.pb_select_kit_wrapper):has(.pb_phone_number_input):has(.pb_text_input_kit.error) {
|
50
|
+
align-items: flex-start;
|
51
|
+
|
52
|
+
.pb_text_input_kit.error {
|
53
|
+
padding-top: $space_md;
|
54
|
+
margin-top: 2px;
|
55
|
+
}
|
56
|
+
}
|
57
|
+
}
|
@@ -1,3 +1,6 @@
|
|
1
|
+
@import "../tokens/spacing";
|
2
|
+
@import "./error_state_mixin";
|
3
|
+
|
1
4
|
[class^=pb_form_group_kit] {
|
2
5
|
display: inline-flex;
|
3
6
|
flex-direction: row;
|
@@ -12,6 +15,12 @@
|
|
12
15
|
}
|
13
16
|
}
|
14
17
|
|
18
|
+
@include error-state-flex-start-selectors;
|
19
|
+
@include error-state-center-selectors;
|
20
|
+
@include error-state-flex-end-selectors;
|
21
|
+
@include error-state-left-side-select-kit;
|
22
|
+
@include error-state-right-side-select-kit;
|
23
|
+
|
15
24
|
& [class^=pb_text_input_kit] .text_input_wrapper,
|
16
25
|
& [class^=pb_date_picker_kit] .input_wrapper,
|
17
26
|
& [class^=pb_select] {
|
@@ -27,7 +36,7 @@
|
|
27
36
|
border-bottom-right-radius: 0;
|
28
37
|
border-top-right-radius: 0;
|
29
38
|
border-right-width: 0;
|
30
|
-
|
39
|
+
|
31
40
|
&:focus {
|
32
41
|
outline: $primary solid 1px;
|
33
42
|
outline-offset: -1px;
|
@@ -150,7 +159,7 @@
|
|
150
159
|
& > [class^=pb_selectable_card_kit] input[type="checkbox"]:not(:checked) ~ label, [class^=pb_selectable_card_kit] input[type="radio"]:not(:checked) ~ label {
|
151
160
|
&:hover {
|
152
161
|
border-right-color: $slate;
|
153
|
-
}
|
162
|
+
}
|
154
163
|
}
|
155
164
|
|
156
165
|
& > [class^=pb_selectable_card_kit]:not(:first-child) label {
|
@@ -1,12 +1,33 @@
|
|
1
|
+
@import "../tokens/colors";
|
2
|
+
|
1
3
|
[class^=pb_gauge_kit] {
|
2
4
|
|
5
|
+
.fix {
|
6
|
+
fill: $text_lt_default;
|
7
|
+
stroke: none;
|
8
|
+
|
9
|
+
&[class*=dark] {
|
10
|
+
fill: $text_dk_default;
|
11
|
+
}
|
12
|
+
}
|
13
|
+
|
3
14
|
.suffix {
|
4
15
|
fill: $text_lt_light;
|
16
|
+
stroke: none;
|
5
17
|
font: $regular $font_larger $font_family_base;
|
18
|
+
|
19
|
+
&[class*=dark] {
|
20
|
+
fill: $text_dk_light;
|
21
|
+
}
|
6
22
|
}
|
7
23
|
.prefix {
|
8
24
|
fill: $text_lt_light;
|
25
|
+
stroke: none;
|
9
26
|
font: $regular $font_base $font_family_base;
|
27
|
+
|
28
|
+
&[class*=dark] {
|
29
|
+
fill: $text_dk_light;
|
30
|
+
}
|
10
31
|
}
|
11
32
|
|
12
33
|
rect.highcharts-background {
|
@@ -16,4 +37,13 @@
|
|
16
37
|
.gauge-pane {
|
17
38
|
stroke-linejoin: round;
|
18
39
|
}
|
19
|
-
|
40
|
+
|
41
|
+
&[class*=dark] {
|
42
|
+
color: $text_dk_default;
|
43
|
+
|
44
|
+
.pb_title_kit_size_1,
|
45
|
+
.pb_caption_kit_xs {
|
46
|
+
color: $text_dk_light;
|
47
|
+
}
|
48
|
+
}
|
49
|
+
}
|
@@ -164,9 +164,9 @@ const Gauge = ({
|
|
164
164
|
color: defaultColors.text_lt_default,
|
165
165
|
enabled: true,
|
166
166
|
format:
|
167
|
-
`<span class="prefix">${prefix}</span>` +
|
168
|
-
|
169
|
-
`<span class="suffix">${suffix}</span>`,
|
167
|
+
`<span class="prefix${dark ? " dark" : ""}">${prefix}</span>` +
|
168
|
+
`<span class="fix${dark ? " dark" : ""}">{y:,f}</span>` +
|
169
|
+
`<span class="suffix${dark ? " dark" : ""}">${suffix}</span>`,
|
170
170
|
style: {
|
171
171
|
fontFamily: typography.font_family_base,
|
172
172
|
fontWeight: typography.regular,
|