playbook_ui 14.9.0.pre.alpha.pbntr700newresettodefaultprop4736 → 14.9.0.pre.alpha.play1703errorstatealignment4991
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/_advanced_table.tsx +61 -17
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination.jsx +50 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination.md +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.jsx +57 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.md +5 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_pagination_mock_data.json +5600 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +2 -0
- 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_date_picker/date_picker.rb +0 -5
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +0 -10
- data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +0 -1
- 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_form/docs/_form_form_with.html.erb +1 -2
- data/app/pb_kits/playbook/pb_form_group/_error_state_mixin.scss +49 -0
- data/app/pb_kits/playbook/pb_form_group/_form_group.scss +48 -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_pagination/_pagination.tsx +2 -2
- 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_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_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-l1kq1p9m.js +22 -0
- data/dist/chunks/_weekday_stacked-B28kYXl9.js +45 -0
- data/dist/chunks/lib-CuCy3_xO.js +29 -0
- data/dist/chunks/{pb_form_validation-kPWA1Z2g.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 +26 -6
- data/dist/chunks/_typeahead-DU1QgR52.js +0 -22
- data/dist/chunks/_weekday_stacked-BLOmRNnB.js +0 -45
- data/dist/chunks/lib-Ce7MLbJk.js +0 -29
@@ -45,12 +45,11 @@
|
|
45
45
|
class: "checkbox-class"
|
46
46
|
%>
|
47
47
|
<%= form.date_picker :example_date_picker_1, props: { label: true } %>
|
48
|
-
<%= form.date_picker :example_date_picker_2, props: { label: true, reset_to_default: true, default_date: "06/09/1994" } %>
|
49
48
|
<%= form.star_rating_field :example_star_rating, props: { variant: "interactive", label: true } %>
|
50
49
|
|
51
50
|
<%= form.actions do |action| %>
|
52
51
|
<%= action.submit %>
|
53
|
-
<%= action.button props: { type: "reset", text: "Cancel", variant: "secondary"
|
52
|
+
<%= action.button props: { type: "reset", text: "Cancel", variant: "secondary" } %>
|
54
53
|
<% end %>
|
55
54
|
<% end %>
|
56
55
|
|
@@ -0,0 +1,49 @@
|
|
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-left-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
|
+
.pb_select_kit_wrapper.error {
|
30
|
+
padding-top: $space_md;
|
31
|
+
margin-top: 2px;
|
32
|
+
|
33
|
+
.pb_select_kit_caret {
|
34
|
+
padding-top: $space_xl;
|
35
|
+
}
|
36
|
+
}
|
37
|
+
}
|
38
|
+
}
|
39
|
+
|
40
|
+
@mixin error-state-right-side-select-kit {
|
41
|
+
&:has(.pb_select_kit_label):has(.pb_select_kit_wrapper):has(.pb_phone_number_input):has(.pb_text_input_kit.error) {
|
42
|
+
align-items: flex-start;
|
43
|
+
|
44
|
+
.pb_text_input_kit.error {
|
45
|
+
padding-top: $space_md;
|
46
|
+
margin-top: 2px;
|
47
|
+
}
|
48
|
+
}
|
49
|
+
}
|
@@ -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,49 @@
|
|
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
|
+
|
24
|
+
// &:has(.pb_text_input_kit.error):has(.pb_text_input_kit),
|
25
|
+
// &:has(.pb_text_input_kit):has(.pb_date_picker_kit.error),
|
26
|
+
// &:has(.pb_text_input_kit):has(.pb_select_kit_wrapper.error),
|
27
|
+
// &:has(.pb_text_input_kit.error):has(.pb_text_input_kit_label):has(.pb_select_kit_wrapper.error) {
|
28
|
+
// align-items: flex-start;
|
29
|
+
// }
|
30
|
+
|
31
|
+
// &:has(.pb_text_input_kit:not(.error)):has(.pb_text_input_kit_label):has(.pb_select_kit_wrapper.error),
|
32
|
+
// &:has(.pb_text_input_kit.error):has(.pb_text_input_kit_label):has(.pb_select_kit_wrapper) {
|
33
|
+
// align-items: flex-start;
|
34
|
+
// .pb_select_kit_wrapper,
|
35
|
+
// .pb_select_kit_wrapper.error {
|
36
|
+
// padding-top: $space_md;
|
37
|
+
// margin-top: 2px;
|
38
|
+
// .pb_select_kit_caret {
|
39
|
+
// padding-top: $space_xl;
|
40
|
+
// }
|
41
|
+
// }
|
42
|
+
// }
|
43
|
+
|
44
|
+
// &:has(.pb_select_kit_label):has(.pb_select_kit_wrapper.error):has(.pb_phone_number_input),
|
45
|
+
// &:has(.pb_text_input_kit.error):has(.pb_text_input_kit_label):has([class^=pb_button_kit]) {
|
46
|
+
// align-items: center;
|
47
|
+
// }
|
48
|
+
|
49
|
+
// &:has(.pb_select_kit_label):has(.pb_select_kit_wrapper.error):has(.pb_phone_number_input):has(.pb_text_input_kit.error) {
|
50
|
+
// align-items: flex-end;
|
51
|
+
// }
|
52
|
+
|
53
|
+
// &:has(.pb_select_kit_label):has(.pb_select_kit_wrapper):has(.pb_phone_number_input):has(.pb_text_input_kit.error) {
|
54
|
+
// align-items: flex-start;
|
55
|
+
// .pb_text_input_kit.error {
|
56
|
+
// padding-top: $space_md;
|
57
|
+
// margin-top: 2px;
|
58
|
+
// }
|
59
|
+
// }
|
60
|
+
|
15
61
|
& [class^=pb_text_input_kit] .text_input_wrapper,
|
16
62
|
& [class^=pb_date_picker_kit] .input_wrapper,
|
17
63
|
& [class^=pb_select] {
|
@@ -27,7 +73,7 @@
|
|
27
73
|
border-bottom-right-radius: 0;
|
28
74
|
border-top-right-radius: 0;
|
29
75
|
border-right-width: 0;
|
30
|
-
|
76
|
+
|
31
77
|
&:focus {
|
32
78
|
outline: $primary solid 1px;
|
33
79
|
outline-offset: -1px;
|
@@ -150,7 +196,7 @@
|
|
150
196
|
& > [class^=pb_selectable_card_kit] input[type="checkbox"]:not(:checked) ~ label, [class^=pb_selectable_card_kit] input[type="radio"]:not(:checked) ~ label {
|
151
197
|
&:hover {
|
152
198
|
border-right-color: $slate;
|
153
|
-
}
|
199
|
+
}
|
154
200
|
}
|
155
201
|
|
156
202
|
& > [class^=pb_selectable_card_kit]:not(:first-child) label {
|
@@ -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
|
}
|
@@ -223,6 +223,7 @@
|
|
223
223
|
}
|
224
224
|
}
|
225
225
|
[class*="pb_collapsible_nav_item"][class*="pb_nav_list_item_link_collapsible"][class*="pb_nav_list_kit_item"] {
|
226
|
+
box-shadow: unset !important;
|
226
227
|
.pb_nav_list_item_text_collapsible {
|
227
228
|
color: $white !important;
|
228
229
|
}
|
@@ -240,11 +241,17 @@
|
|
240
241
|
|
241
242
|
.pb_collapsible_main_kit:hover {
|
242
243
|
background-color: mix($white, $card_dark, 20%);
|
243
|
-
.pb_nav_list_item_text_collapsible
|
244
|
-
svg {
|
244
|
+
.pb_nav_list_item_text_collapsible {
|
245
245
|
color: $white !important;
|
246
246
|
}
|
247
247
|
}
|
248
|
+
|
249
|
+
.pb_collapsible_main_kit {
|
250
|
+
svg {
|
251
|
+
color: $text_dk_default !important;
|
252
|
+
}
|
253
|
+
}
|
254
|
+
|
248
255
|
.icon_wrapper:hover {
|
249
256
|
background-color: mix($white, $card_dark, 40%);
|
250
257
|
}
|
@@ -256,6 +263,13 @@
|
|
256
263
|
}
|
257
264
|
}
|
258
265
|
}
|
266
|
+
|
267
|
+
&[class*="_active"] {
|
268
|
+
> .pb_collapsible_main_kit {
|
269
|
+
background-color: $primary;
|
270
|
+
box-shadow: 0 2px 10px 0 $shadow_dark;
|
271
|
+
}
|
272
|
+
}
|
259
273
|
}
|
260
274
|
}
|
261
275
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import React, { useState } from "react";
|
2
2
|
import classnames from 'classnames'
|
3
|
-
import { globalProps } from '../utilities/globalProps'
|
3
|
+
import { GlobalProps, globalProps } from '../utilities/globalProps'
|
4
4
|
import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
|
5
5
|
import Icon from '../pb_icon/_icon';
|
6
6
|
|
@@ -14,7 +14,7 @@ type PaginationProps = {
|
|
14
14
|
onChange?: (pageNumber: number) => void;
|
15
15
|
range?: number;
|
16
16
|
total?: number;
|
17
|
-
};
|
17
|
+
} & GlobalProps;
|
18
18
|
|
19
19
|
const Pagination = ( props: PaginationProps) => {
|
20
20
|
const {
|
@@ -151,7 +151,7 @@ $pb_selectable_paddings: (
|
|
151
151
|
input[type="radio"] {
|
152
152
|
&:checked ~ label {
|
153
153
|
border-width: $pb_card_border_width;
|
154
|
-
outline: 1px solid $
|
154
|
+
outline: 1px solid $primary_action_dark;
|
155
155
|
}
|
156
156
|
}
|
157
157
|
}
|
@@ -161,11 +161,11 @@ $pb_selectable_paddings: (
|
|
161
161
|
color: $white;
|
162
162
|
> label {
|
163
163
|
@include pb_card_dark;
|
164
|
-
background:
|
164
|
+
background: $bg_dark_card;
|
165
165
|
|
166
166
|
.pb_selectable_card_circle {
|
167
167
|
border-color: $bg_dark;
|
168
|
-
background: $
|
168
|
+
background: $primary_action_dark;
|
169
169
|
}
|
170
170
|
}
|
171
171
|
|
@@ -173,7 +173,7 @@ $pb_selectable_paddings: (
|
|
173
173
|
input[type="radio"] {
|
174
174
|
&:checked ~ label {
|
175
175
|
@include pb_card_selected_dark;
|
176
|
-
background:
|
176
|
+
background: $bg_dark_card;
|
177
177
|
}
|
178
178
|
}
|
179
179
|
|
@@ -1,40 +1,46 @@
|
|
1
|
-
import React from
|
2
|
-
import classnames from
|
1
|
+
import React from "react"
|
2
|
+
import classnames from "classnames"
|
3
3
|
|
4
|
-
import { buildCss, buildHtmlProps } from
|
5
|
-
import { globalProps } from
|
4
|
+
import { buildCss, buildHtmlProps } from "../utilities/props"
|
5
|
+
import { globalProps } from "../utilities/globalProps"
|
6
6
|
|
7
|
-
import Body from
|
8
|
-
import Icon from
|
7
|
+
import Body from "../pb_body/_body"
|
8
|
+
import Icon from "../pb_icon/_icon"
|
9
9
|
|
10
|
-
const statusMap: {
|
11
|
-
|
12
|
-
decrease:
|
13
|
-
|
10
|
+
const statusMap: {
|
11
|
+
neutral: "neutral"
|
12
|
+
decrease: "negative"
|
13
|
+
increase: "positive"
|
14
|
+
} = {
|
15
|
+
increase: "positive",
|
16
|
+
decrease: "negative",
|
17
|
+
neutral: "neutral",
|
14
18
|
}
|
15
19
|
|
16
20
|
const iconMap = {
|
17
|
-
increase:
|
18
|
-
decrease:
|
21
|
+
increase: "arrow-up",
|
22
|
+
decrease: "arrow-down",
|
19
23
|
}
|
20
24
|
|
21
25
|
type StatChangeProps = {
|
22
|
-
change?:
|
23
|
-
className?: string
|
24
|
-
|
25
|
-
|
26
|
-
id?: string
|
27
|
-
|
26
|
+
change?: "increase" | "decrease" | "neutral"
|
27
|
+
className?: string
|
28
|
+
dark?: boolean
|
29
|
+
icon?: string
|
30
|
+
id?: string
|
31
|
+
htmlOptions?: { [key: string]: string | number | boolean | (() => void) }
|
32
|
+
value?: string | number
|
28
33
|
}
|
29
34
|
|
30
35
|
const StatChange = (props: StatChangeProps): React.ReactElement => {
|
31
|
-
const {
|
32
|
-
change =
|
33
|
-
className,
|
36
|
+
const {
|
37
|
+
change = "neutral",
|
38
|
+
className,
|
39
|
+
dark = false,
|
34
40
|
htmlOptions = {},
|
35
|
-
icon,
|
36
|
-
id,
|
37
|
-
value
|
41
|
+
icon,
|
42
|
+
id,
|
43
|
+
value,
|
38
44
|
} = props
|
39
45
|
|
40
46
|
const status = statusMap[change as keyof typeof statusMap]
|
@@ -47,30 +53,32 @@ const StatChange = (props: StatChangeProps): React.ReactElement => {
|
|
47
53
|
|
48
54
|
return (
|
49
55
|
<>
|
50
|
-
{value &&
|
56
|
+
{value && (
|
51
57
|
<div
|
52
58
|
className={classnames(
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
59
|
+
buildCss("pb_stat_change_kit", status),
|
60
|
+
globalProps(props),
|
61
|
+
className
|
62
|
+
)}
|
57
63
|
id={id}
|
58
64
|
{...htmlProps}
|
59
65
|
>
|
60
|
-
<Body
|
61
|
-
|
66
|
+
<Body dark={dark}
|
67
|
+
status={status}
|
68
|
+
>
|
69
|
+
{" "}
|
70
|
+
{returnedIcon && (
|
62
71
|
<>
|
63
|
-
<Icon
|
72
|
+
<Icon dark={dark}
|
64
73
|
fixed_width
|
65
74
|
icon={returnedIcon}
|
66
|
-
/>
|
67
|
-
{' '}
|
75
|
+
/>{" "}
|
68
76
|
</>
|
69
|
-
}
|
77
|
+
)}
|
70
78
|
{`${value}%`}
|
71
79
|
</Body>
|
72
80
|
</div>
|
73
|
-
}
|
81
|
+
)}
|
74
82
|
</>
|
75
83
|
)
|
76
84
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<%= pb_content_tag do %>
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
2
|
+
<%= pb_rails("body", props: { status: object.status, dark: object.dark }) do %>
|
3
|
+
<%= pb_rails("icon", props: { fixed_width: true, icon: object.returned_icon, dark: object.dark }) if object.returned_icon %>
|
4
|
+
<%= "#{object.value}%" if object.value %>
|
5
|
+
<% end %>
|
6
6
|
<% end %>
|
@@ -0,0 +1,95 @@
|
|
1
|
+
<%= pb_rails("table", props: { size: "md", responsive: "scroll", sticky_left_column: ["1", "2", "3"] }) do %>
|
2
|
+
<thead>
|
3
|
+
<tr>
|
4
|
+
<th id="1">Column 1</th>
|
5
|
+
<th id="2">Column 2</th>
|
6
|
+
<th id="3">Column 3</th>
|
7
|
+
<th>Column 4</th>
|
8
|
+
<th>Column 5</th>
|
9
|
+
<th>Column 6</th>
|
10
|
+
<th>Column 7</th>
|
11
|
+
<th>Column 8</th>
|
12
|
+
<th>Column 9</th>
|
13
|
+
<th>Column 10</th>
|
14
|
+
<th>Column 11</th>
|
15
|
+
<th>Column 12</th>
|
16
|
+
<th>Column 13</th>
|
17
|
+
<th>Column 14</th>
|
18
|
+
<th>Column 15</th>
|
19
|
+
</tr>
|
20
|
+
</thead>
|
21
|
+
<tbody>
|
22
|
+
<tr>
|
23
|
+
<td id="1">Value 1</td>
|
24
|
+
<td id="2">Value 2</td>
|
25
|
+
<td id="3">Value 3</td>
|
26
|
+
<td>Value 4</td>
|
27
|
+
<td>Value 5</td>
|
28
|
+
<td>Column 6</td>
|
29
|
+
<td>Column 7</td>
|
30
|
+
<td>Column 8</td>
|
31
|
+
<td>Column 9</td>
|
32
|
+
<td>Column 10</td>
|
33
|
+
<td>Column 11</td>
|
34
|
+
<td>Column 12</td>
|
35
|
+
<td>Column 13</td>
|
36
|
+
<td>Column 14</td>
|
37
|
+
<td>Column 15</td>
|
38
|
+
|
39
|
+
</tr>
|
40
|
+
<tr>
|
41
|
+
<td id="1">Value 1</td>
|
42
|
+
<td id="2">Value 2</td>
|
43
|
+
<td id="3">Value 3</td>
|
44
|
+
<td>Value 4</td>
|
45
|
+
<td>Value 5</td>
|
46
|
+
<td>Column 6</td>
|
47
|
+
<td>Column 7</td>
|
48
|
+
<td>Column 8</td>
|
49
|
+
<td>Column 9</td>
|
50
|
+
<td>Column 10</td>
|
51
|
+
<td>Column 11</td>
|
52
|
+
<td>Column 12</td>
|
53
|
+
<td>Column 13</td>
|
54
|
+
<td>Column 14</td>
|
55
|
+
<td>Column 15</td>
|
56
|
+
|
57
|
+
</tr>
|
58
|
+
<tr>
|
59
|
+
<td id="1">Value 1</td>
|
60
|
+
<td id="2">Value 2</td>
|
61
|
+
<td id="3">Value 3</td>
|
62
|
+
<td>Value 4</td>
|
63
|
+
<td>Value 5</td>
|
64
|
+
<td>Column 6</td>
|
65
|
+
<td>Column 7</td>
|
66
|
+
<td>Column 8</td>
|
67
|
+
<td>Column 9</td>
|
68
|
+
<td>Column 10</td>
|
69
|
+
<td>Column 11</td>
|
70
|
+
<td>Column 12</td>
|
71
|
+
<td>Column 13</td>
|
72
|
+
<td>Column 14</td>
|
73
|
+
<td>Column 15</td>
|
74
|
+
|
75
|
+
</tr>
|
76
|
+
<tr>
|
77
|
+
<td id="1">Value 1</td>
|
78
|
+
<td id="2">Value 2</td>
|
79
|
+
<td id="3">Value 3</td>
|
80
|
+
<td>Value 4</td>
|
81
|
+
<td>Value 5</td>
|
82
|
+
<td>Column 6</td>
|
83
|
+
<td>Column 7</td>
|
84
|
+
<td>Column 8</td>
|
85
|
+
<td>Column 9</td>
|
86
|
+
<td>Column 10</td>
|
87
|
+
<td>Column 11</td>
|
88
|
+
<td>Column 12</td>
|
89
|
+
<td>Column 13</td>
|
90
|
+
<td>Column 14</td>
|
91
|
+
<td>Column 15</td>
|
92
|
+
|
93
|
+
</tr>
|
94
|
+
</tbody>
|
95
|
+
<% end %>
|
@@ -0,0 +1,75 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import { Table, Icon, Body, Card } from 'playbook-ui'
|
3
|
+
|
4
|
+
const TableWithCollapsible = (props) => {
|
5
|
+
|
6
|
+
const Content = () => {
|
7
|
+
return (
|
8
|
+
<Card
|
9
|
+
borderNone
|
10
|
+
borderRadius="none"
|
11
|
+
padding="md"
|
12
|
+
{...props}
|
13
|
+
>
|
14
|
+
<Body {...props}>Nested content inside a Table Row</Body>
|
15
|
+
</Card>
|
16
|
+
);
|
17
|
+
};
|
18
|
+
|
19
|
+
return (
|
20
|
+
<Table
|
21
|
+
size="sm"
|
22
|
+
{...props}
|
23
|
+
>
|
24
|
+
<Table.Head>
|
25
|
+
<Table.Row>
|
26
|
+
<Table.Header>{'Column 1'}</Table.Header>
|
27
|
+
<Table.Header>{'Column 2'}</Table.Header>
|
28
|
+
<Table.Header>{'Column 3'}</Table.Header>
|
29
|
+
<Table.Header>{'Column 4'}</Table.Header>
|
30
|
+
<Table.Header>{'Column 5'}</Table.Header>
|
31
|
+
<Table.Header>{''}</Table.Header>
|
32
|
+
</Table.Row>
|
33
|
+
|
34
|
+
</Table.Head>
|
35
|
+
<Table.Body>
|
36
|
+
<Table.Row collapsible
|
37
|
+
collapsibleContent={<Content/>}
|
38
|
+
{...props}
|
39
|
+
>
|
40
|
+
<Table.Cell>{'Value 1'}</Table.Cell>
|
41
|
+
<Table.Cell>{'Value 2'}</Table.Cell>
|
42
|
+
<Table.Cell>{'Value 3'}</Table.Cell>
|
43
|
+
<Table.Cell>{'Value 4'}</Table.Cell>
|
44
|
+
<Table.Cell>{'Value 5'}</Table.Cell>
|
45
|
+
<Table.Cell textAlign="right">{
|
46
|
+
<Icon
|
47
|
+
color="primary"
|
48
|
+
fixedWidth
|
49
|
+
icon="chevron-down"
|
50
|
+
/>}
|
51
|
+
</Table.Cell>
|
52
|
+
|
53
|
+
</Table.Row>
|
54
|
+
<Table.Row>
|
55
|
+
<Table.Cell>{'Value 1'}</Table.Cell>
|
56
|
+
<Table.Cell>{'Value 2'}</Table.Cell>
|
57
|
+
<Table.Cell>{'Value 3'}</Table.Cell>
|
58
|
+
<Table.Cell>{'Value 4'}</Table.Cell>
|
59
|
+
<Table.Cell>{'Value 5'}</Table.Cell>
|
60
|
+
<Table.Cell>{''}</Table.Cell>
|
61
|
+
</Table.Row>
|
62
|
+
<Table.Row>
|
63
|
+
<Table.Cell>{'Value 1'}</Table.Cell>
|
64
|
+
<Table.Cell>{'Value 2'}</Table.Cell>
|
65
|
+
<Table.Cell>{'Value 3'}</Table.Cell>
|
66
|
+
<Table.Cell>{'Value 4'}</Table.Cell>
|
67
|
+
<Table.Cell>{'Value 5'}</Table.Cell>
|
68
|
+
<Table.Cell>{''}</Table.Cell>
|
69
|
+
</Table.Row>
|
70
|
+
</Table.Body>
|
71
|
+
</Table>
|
72
|
+
)
|
73
|
+
}
|
74
|
+
|
75
|
+
export default TableWithCollapsible
|
@@ -0,0 +1 @@
|
|
1
|
+
The `collapsible` prop can be used on any Table Row to add a collapsible area. Use the additional `collapsibleContent` prop to add any content to the collapsible Row.
|