playbook_ui 14.10.0.pre.alpha.PBNTR662stickyrightcolumnreact5160 → 14.10.0.pre.alpha.PLAY1774timelinelabelstepspacing5274
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.scss +11 -16
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.rb +8 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_sort.html.erb +1 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers.html.erb +43 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_multiple.html.erb +58 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +4 -1
- data/app/pb_kits/playbook/pb_advanced_table/index.js +143 -95
- data/app/pb_kits/playbook/pb_advanced_table/table_body.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +50 -8
- data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +17 -14
- data/app/pb_kits/playbook/pb_advanced_table/table_header.rb +78 -0
- data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +4 -3
- data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +7 -2
- data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.html.erb +2 -6
- data/app/pb_kits/playbook/pb_card/_card.scss +21 -3
- data/app/pb_kits/playbook/pb_card/docs/_card_header.html.erb +18 -0
- data/app/pb_kits/playbook/pb_card/docs/_card_header.jsx +40 -0
- data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.scss +1 -13
- data/app/pb_kits/playbook/pb_section_separator/_section_separator.scss +64 -1
- data/app/pb_kits/playbook/pb_section_separator/_section_separator.tsx +3 -1
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_color.html.erb +10 -0
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_color.jsx +42 -0
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_color.md +3 -0
- data/app/pb_kits/playbook/pb_section_separator/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_section_separator/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_section_separator/section_separator.rb +4 -1
- data/app/pb_kits/playbook/pb_skeleton_loading/_skeleton_loading.scss +2 -2
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_description.md +3 -0
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_border_radius.html.erb +9 -0
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_border_radius_rails.md +1 -0
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_color.html.erb +7 -0
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_default.html.erb +1 -1
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_filter.html.erb +119 -0
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_filter.jsx +10 -2
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_height_width.html.erb +15 -0
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_height_width.jsx +6 -2
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_height_width_rails.md +3 -0
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_layout.html.erb +3 -0
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_user.html.erb +63 -0
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_user.jsx +11 -3
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/example.yml +7 -2
- data/app/pb_kits/playbook/pb_skeleton_loading/skeleton_loading.html.erb +8 -12
- data/app/pb_kits/playbook/pb_skeleton_loading/skeleton_loading.rb +48 -1
- data/app/pb_kits/playbook/pb_table/styles/_scroll.scss +20 -0
- data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +8 -1
- data/app/pb_kits/playbook/pb_text_input/inputMask.ts +23 -0
- data/app/pb_kits/playbook/pb_timeline/_timeline.scss +5 -6
- data/dist/chunks/{_typeahead-aym7Ky_O.js → _typeahead-gJLWiR0r.js} +2 -2
- data/dist/chunks/{_weekday_stacked-BZj1pop-.js → _weekday_stacked-BT8jIMPK.js} +1 -1
- data/dist/chunks/lazysizes-DHz07jlL.js +1 -0
- 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 +21 -7
- data/dist/chunks/lazysizes-B7xYodB-.js +0 -1
- /data/app/pb_kits/playbook/pb_skeleton_loading/docs/{_skeleton_loading_border_radius.md → _skeleton_loading_border_radius_react.md} +0 -0
- /data/app/pb_kits/playbook/pb_skeleton_loading/docs/{_skeleton_loading_height_width.md → _skeleton_loading_height_width_react.md} +0 -0
@@ -16,6 +16,84 @@ module Playbook
|
|
16
16
|
def th_classname
|
17
17
|
generate_classname("table-header-cells", separator: " ")
|
18
18
|
end
|
19
|
+
|
20
|
+
def header_rows
|
21
|
+
wrapped_columns = wrap_leaf_columns(column_definitions)
|
22
|
+
|
23
|
+
rows = []
|
24
|
+
max_depth = compute_max_depth(wrapped_columns)
|
25
|
+
max_depth.times { rows << [] }
|
26
|
+
process_columns(wrapped_columns, rows, 0, max_depth)
|
27
|
+
rows
|
28
|
+
end
|
29
|
+
|
30
|
+
private
|
31
|
+
|
32
|
+
def compute_max_depth(columns)
|
33
|
+
columns.map do |col|
|
34
|
+
col[:columns] ? 1 + compute_max_depth(col[:columns]) : 1
|
35
|
+
end.max || 1
|
36
|
+
end
|
37
|
+
|
38
|
+
def process_columns(columns, rows, current_depth, max_depth)
|
39
|
+
total_columns = columns.size
|
40
|
+
columns.each_with_index do |col, index|
|
41
|
+
is_last = index == total_columns - 1
|
42
|
+
if col[:columns]
|
43
|
+
colspan = compute_leaf_columns(col[:columns])
|
44
|
+
rows[current_depth] << {
|
45
|
+
label: col[:label],
|
46
|
+
colspan: colspan,
|
47
|
+
is_last_in_group: is_last && current_depth.positive?,
|
48
|
+
}
|
49
|
+
|
50
|
+
process_columns(col[:columns], rows, current_depth + 1, max_depth)
|
51
|
+
else
|
52
|
+
colspan = 1
|
53
|
+
rows[current_depth] << {
|
54
|
+
label: col[:label],
|
55
|
+
colspan: colspan,
|
56
|
+
accessor: col[:accessor],
|
57
|
+
sort_menu: col[:sort_menu],
|
58
|
+
is_last_in_group: is_last && current_depth.positive?,
|
59
|
+
}
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
def compute_leaf_columns(columns)
|
65
|
+
columns.reduce(0) do |sum, col|
|
66
|
+
col[:columns] ? sum + compute_leaf_columns(col[:columns]) : sum + 1
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
def wrap_leaf_columns(column_definitions)
|
71
|
+
max_depth = compute_max_depth(column_definitions)
|
72
|
+
|
73
|
+
column_definitions.map do |col|
|
74
|
+
if col.key?(:columns)
|
75
|
+
{
|
76
|
+
label: col[:label],
|
77
|
+
columns: wrap_leaf_columns(col[:columns]),
|
78
|
+
}
|
79
|
+
else
|
80
|
+
# For leaf columns, wrap with empty labels up to max depth to get proper structure
|
81
|
+
wrap_leaf_column(col, max_depth)
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
def wrap_leaf_column(col, max_depth)
|
87
|
+
wrapped = {
|
88
|
+
accessor: col[:accessor],
|
89
|
+
label: col[:label] || "",
|
90
|
+
sort_menu: col[:sort_menu] || nil,
|
91
|
+
}
|
92
|
+
(max_depth - 1).times do
|
93
|
+
wrapped = { label: "", columns: [wrapped] }
|
94
|
+
end
|
95
|
+
wrapped
|
96
|
+
end
|
19
97
|
end
|
20
98
|
end
|
21
99
|
end
|
@@ -1,6 +1,7 @@
|
|
1
|
-
<%= pb_content_tag do %>
|
1
|
+
<%= pb_content_tag(:tr) do %>
|
2
2
|
<% object.column_definitions.each_with_index do |column, index| %>
|
3
|
-
|
3
|
+
<% next unless column[:accessor].present? %>
|
4
|
+
<%= pb_rails("table/table_cell", props: { classname:object.td_classname(column)}) do %>
|
4
5
|
<%= pb_rails("flex", props:{ align: "center", justify: index.zero? ? "start" : "end" }) do %>
|
5
6
|
<% if collapsible_trail && index.zero? %>
|
6
7
|
<% (1..depth).each do |i| %>
|
@@ -13,7 +14,7 @@
|
|
13
14
|
<div style="padding-left: <%= depth * 1.25 %>em">
|
14
15
|
<%= pb_rails("flex", props:{align: "center", column_gap: "xs"}) do %>
|
15
16
|
<% if index.zero? && object.row[:children].present? %>
|
16
|
-
<button id="<%= object.row.object_id
|
17
|
+
<button id="<%= "#{object.id}_#{object.row.object_id}" %>" class="gray-icon expand-toggle-icon" data-advanced-table="true" >
|
17
18
|
<%= pb_rails("icon", props: { id: "advanced-table_open_icon", icon: "circle-play", cursor: "pointer" }) %>
|
18
19
|
<%= pb_rails("icon", props: { id: "advanced-table_close_icon", display: "none", icon: "circle-play", cursor: "pointer", rotation: 90 }) %>
|
19
20
|
</button>
|
@@ -16,8 +16,10 @@ module Playbook
|
|
16
16
|
generate_classname("pb_table_tr", "bg-white", subrow_depth_classname, separator: " ")
|
17
17
|
end
|
18
18
|
|
19
|
-
def td_classname
|
20
|
-
|
19
|
+
def td_classname(column)
|
20
|
+
classes = %w[id-cell chrome-styles]
|
21
|
+
classes << "last-cell" if column[:is_last_in_group]
|
22
|
+
classes.join(" ")
|
21
23
|
end
|
22
24
|
|
23
25
|
def depth_accessors
|
@@ -29,6 +31,8 @@ module Playbook
|
|
29
31
|
private
|
30
32
|
|
31
33
|
def custom_renderer_value(column, index)
|
34
|
+
return nil unless column[:accessor].present?
|
35
|
+
|
32
36
|
if index.zero?
|
33
37
|
if depth.zero?
|
34
38
|
row[column[:accessor].to_sym]
|
@@ -37,6 +41,7 @@ module Playbook
|
|
37
41
|
key = item.to_sym
|
38
42
|
return row[key] if depth - 1 == accessor_index
|
39
43
|
end
|
44
|
+
nil
|
40
45
|
end
|
41
46
|
else
|
42
47
|
row[column[:accessor].to_sym]
|
@@ -1,10 +1,6 @@
|
|
1
|
-
<%=
|
2
|
-
aria: object.aria,
|
3
|
-
class: object.classname,
|
4
|
-
data: object.data,
|
5
|
-
id: object.id) do %>
|
1
|
+
<%= pb_content_tag(:div) do %>
|
6
2
|
<% object.column_definitions.each_with_index do |column, index| %>
|
7
|
-
<%= pb_rails("table/table_cell", props: {
|
3
|
+
<%= pb_rails("table/table_cell", props: { classname: object.td_classname}) do %>
|
8
4
|
<%= pb_rails("flex", props:{ align: "center", justify: "start" }) do %>
|
9
5
|
<% if collapsible_trail && index.zero? %>
|
10
6
|
<% (1..depth).each do |i| %>
|
@@ -21,6 +21,14 @@
|
|
21
21
|
border-width: 0px;
|
22
22
|
}
|
23
23
|
|
24
|
+
@function ends-with($string, $suffix) {
|
25
|
+
$suffix-length: str-length($suffix);
|
26
|
+
@if $suffix-length == 0 {
|
27
|
+
@return true;
|
28
|
+
}
|
29
|
+
@return str-slice($string, -$suffix-length) == $suffix;
|
30
|
+
}
|
31
|
+
|
24
32
|
[class^=pb_card_header_kit] {
|
25
33
|
flex-grow: 0;
|
26
34
|
flex-shrink: 0;
|
@@ -30,9 +38,19 @@
|
|
30
38
|
border: 0;
|
31
39
|
border-radius: $pb_card_header_border_radius $pb_card_header_border_radius 0px 0px;
|
32
40
|
@each $color_name, $color_value in $pb_card_header_colors {
|
33
|
-
|
34
|
-
|
35
|
-
|
41
|
+
@if not ends-with($color_name, '_subtle') {
|
42
|
+
&[class*="_#{$color_name}"] {
|
43
|
+
@include pb_card_header_color($color_value);
|
44
|
+
color: lightenText($color_value);
|
45
|
+
}
|
46
|
+
}
|
47
|
+
}
|
48
|
+
@each $color_name, $color_value in $pb_card_header_colors {
|
49
|
+
@if ends-with($color_name, '_subtle') {
|
50
|
+
&[class*="_#{$color_name}"] {
|
51
|
+
@include pb_card_header_color($color_value);
|
52
|
+
color: lightenText($color_value);
|
53
|
+
}
|
36
54
|
}
|
37
55
|
}
|
38
56
|
@each $color_name, $color_value in $pb_card_header_colors {
|
@@ -88,3 +88,21 @@
|
|
88
88
|
Body
|
89
89
|
<% end %>
|
90
90
|
<% end %>
|
91
|
+
|
92
|
+
<%= pb_rails("card", props: { padding: "none", header: true, margin_bottom: "sm"}) do %>
|
93
|
+
<%= pb_rails("card/card_header", props: { padding: "sm", header_color: "success_subtle" }) do %>
|
94
|
+
<%= pb_rails("body", props: { text: "Success Subtle" }) %>
|
95
|
+
<% end %>
|
96
|
+
<%= pb_rails("card/card_body", props: { padding: "md" }) do %>
|
97
|
+
Body
|
98
|
+
<% end %>
|
99
|
+
<% end %>
|
100
|
+
|
101
|
+
<%= pb_rails("card", props: { padding: "none", header: true, margin_bottom: "sm"}) do %>
|
102
|
+
<%= pb_rails("card/card_header", props: { padding: "sm", header_color: "error_subtle" }) do %>
|
103
|
+
<%= pb_rails("body", props: { text: "Error Subtle"}) %>
|
104
|
+
<% end %>
|
105
|
+
<%= pb_rails("card/card_body", props: { padding: "md" }) do %>
|
106
|
+
Body
|
107
|
+
<% end %>
|
108
|
+
<% end %>
|
@@ -231,6 +231,46 @@ const CardHeader = (props) => {
|
|
231
231
|
/>
|
232
232
|
</Card.Body>
|
233
233
|
</Card>
|
234
|
+
|
235
|
+
<Card
|
236
|
+
{...props}
|
237
|
+
marginBottom='sm'
|
238
|
+
padding="none"
|
239
|
+
>
|
240
|
+
<Card.Header
|
241
|
+
headerColor="success_subtle"
|
242
|
+
>
|
243
|
+
<Body
|
244
|
+
text="Success Subtle"
|
245
|
+
/>
|
246
|
+
</Card.Header>
|
247
|
+
<Card.Body>
|
248
|
+
<Body
|
249
|
+
{...props}
|
250
|
+
text="Body"
|
251
|
+
/>
|
252
|
+
</Card.Body>
|
253
|
+
</Card>
|
254
|
+
|
255
|
+
<Card
|
256
|
+
{...props}
|
257
|
+
marginBottom='sm'
|
258
|
+
padding="none"
|
259
|
+
>
|
260
|
+
<Card.Header
|
261
|
+
headerColor="error_subtle"
|
262
|
+
>
|
263
|
+
<Body
|
264
|
+
text="Error Subtle"
|
265
|
+
/>
|
266
|
+
</Card.Header>
|
267
|
+
<Card.Body>
|
268
|
+
<Body
|
269
|
+
{...props}
|
270
|
+
text="Body"
|
271
|
+
/>
|
272
|
+
</Card.Body>
|
273
|
+
</Card>
|
234
274
|
</>
|
235
275
|
)
|
236
276
|
}
|
@@ -14,16 +14,6 @@ $pb_icon_circle_sizes: (
|
|
14
14
|
"xl": 100px,
|
15
15
|
);
|
16
16
|
|
17
|
-
@mixin svg_size($name, $match, $adjust) {
|
18
|
-
@if $name == $match {
|
19
|
-
$svg_xy: $adjust;
|
20
|
-
& > svg {
|
21
|
-
width: #{$svg_xy};
|
22
|
-
height: #{$svg_xy};
|
23
|
-
}
|
24
|
-
}
|
25
|
-
}
|
26
|
-
|
27
17
|
[class^=pb_icon_circle_kit] {
|
28
18
|
display: flex;
|
29
19
|
justify-content: center;
|
@@ -57,13 +47,11 @@ $pb_icon_circle_sizes: (
|
|
57
47
|
border-radius: $size/2;
|
58
48
|
background: $silver;
|
59
49
|
color: $text_lt_light;
|
60
|
-
font-size: $size * 0.38;
|
50
|
+
font-size: if($name == "xxs", $size - 6px, $size * 0.38);
|
61
51
|
line-height: $size;
|
62
52
|
flex-shrink: 0;
|
63
53
|
flex-grow: 0;
|
64
54
|
flex-basis: $size;
|
65
|
-
|
66
|
-
@include svg_size($name, "xxs", $size - 6px);
|
67
55
|
}
|
68
56
|
}
|
69
57
|
|
@@ -3,6 +3,11 @@
|
|
3
3
|
@import "../tokens/opacity";
|
4
4
|
@import "./section_separator_mixin";
|
5
5
|
|
6
|
+
$merge_kits1: map-merge($status_colors, $category_colors);
|
7
|
+
$merge_kits2: map-merge($merge_kits1, $product_colors);
|
8
|
+
$merge_kits3: map-merge($merge_kits2, $text_colors);
|
9
|
+
$section_selector_colors: map-merge($merge_kits3, $data_colors);
|
10
|
+
|
6
11
|
$section_colors_light: (
|
7
12
|
background: $bg_light,
|
8
13
|
card: $card_light,
|
@@ -19,8 +24,11 @@ $section_colors_dark: (
|
|
19
24
|
align-items: center;
|
20
25
|
position: relative;
|
21
26
|
span {
|
22
|
-
padding: 0
|
27
|
+
padding: 0;
|
23
28
|
display: flex;
|
29
|
+
[class*="pb_caption_kit"] {
|
30
|
+
padding: 0 $space_xs;
|
31
|
+
}
|
24
32
|
}
|
25
33
|
&::before {
|
26
34
|
content: "";
|
@@ -34,12 +42,40 @@ $section_colors_dark: (
|
|
34
42
|
flex: 1;
|
35
43
|
@include section_separator_horizontal;
|
36
44
|
}
|
45
|
+
@each $color_name, $color_value in $section_selector_colors {
|
46
|
+
&[class*="color_#{$color_name}"] {
|
47
|
+
&::before, &::after {
|
48
|
+
background: $color_value;
|
49
|
+
}
|
50
|
+
|
51
|
+
&[class*=_vertical] {
|
52
|
+
&::after {
|
53
|
+
background: $color_value;
|
54
|
+
}
|
55
|
+
}
|
56
|
+
&[class*=_dashed] {
|
57
|
+
&::before, &::after {
|
58
|
+
border: 1px dashed $color_value;
|
59
|
+
}
|
60
|
+
&[class*=_vertical] {
|
61
|
+
&::after {
|
62
|
+
border: 1px dashed $color_value;
|
63
|
+
background: none;
|
64
|
+
}
|
65
|
+
}
|
66
|
+
}
|
67
|
+
}
|
68
|
+
}
|
69
|
+
|
37
70
|
&[class*=_horizontal] {
|
38
71
|
justify-content: center;
|
39
72
|
}
|
40
73
|
&[class*=_vertical] {
|
41
74
|
margin-left: $space_xs;
|
42
75
|
margin-right: $space_xs;
|
76
|
+
&::before {
|
77
|
+
display: none;
|
78
|
+
}
|
43
79
|
&::after {
|
44
80
|
@include section_separator_vertical(false);
|
45
81
|
}
|
@@ -54,6 +90,33 @@ $section_colors_dark: (
|
|
54
90
|
// Dark =========================
|
55
91
|
|
56
92
|
&.dark {
|
93
|
+
@each $color_name, $color_value in $section_selector_colors {
|
94
|
+
&[class*="color_#{$color_name}"] {
|
95
|
+
&::before, &::after {
|
96
|
+
background: $color_value;
|
97
|
+
}
|
98
|
+
|
99
|
+
&[class*=_vertical] {
|
100
|
+
&::after {
|
101
|
+
@include section_separator_vertical(false);
|
102
|
+
background: $color_value;
|
103
|
+
}
|
104
|
+
}
|
105
|
+
|
106
|
+
&[class*=_dashed] {
|
107
|
+
&::before, &::after {
|
108
|
+
border: 1px dashed $color_value;
|
109
|
+
background: none;
|
110
|
+
}
|
111
|
+
&[class*=_vertical] {
|
112
|
+
&::after {
|
113
|
+
border: 1px dashed $color_value;
|
114
|
+
background: none;
|
115
|
+
}
|
116
|
+
}
|
117
|
+
}
|
118
|
+
}
|
119
|
+
}
|
57
120
|
&::before {
|
58
121
|
@include section_separator_horizontal(true);
|
59
122
|
}
|
@@ -10,6 +10,7 @@ type SectionSeparatorProps = {
|
|
10
10
|
aria?: { [key: string]: string; },
|
11
11
|
children?: React.ReactChild[] | React.ReactChild,
|
12
12
|
className?: string,
|
13
|
+
color?: "default" | "primary",
|
13
14
|
dark?: boolean,
|
14
15
|
data?: { [key: string]: string; },
|
15
16
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
@@ -25,6 +26,7 @@ const SectionSeparator = (props: SectionSeparatorProps): React.ReactElement => {
|
|
25
26
|
aria = {},
|
26
27
|
children,
|
27
28
|
className,
|
29
|
+
color ="default",
|
28
30
|
data = {},
|
29
31
|
htmlOptions = {},
|
30
32
|
id,
|
@@ -37,7 +39,7 @@ const SectionSeparator = (props: SectionSeparatorProps): React.ReactElement => {
|
|
37
39
|
const ariaProps = buildAriaProps(aria)
|
38
40
|
const dataProps = buildDataProps(data)
|
39
41
|
const htmlProps = buildHtmlProps(htmlOptions)
|
40
|
-
const classes = classnames(buildCss('pb_section_separator_kit', variant, orientation, lineStyle === "dashed" ? lineStyle : ""), globalProps(props), className)
|
42
|
+
const classes = classnames(buildCss('pb_section_separator_kit', variant, orientation, lineStyle === "dashed" ? lineStyle : "", color !== "default" ? `color_${color}` : ''), globalProps(props), className)
|
41
43
|
const dynamicInlineProps = globalInlineProps(props)
|
42
44
|
|
43
45
|
return (
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<%= pb_rails("section_separator", props: { text: "Default Separator" }) %>
|
2
|
+
<%= pb_rails("section_separator", props: { color: "primary", text: "Primary Separator" }) %>
|
3
|
+
<%= pb_rails("section_separator", props: { color: "primary", line_style: "dashed", text: "Primary Dashed Separator" }) %>
|
4
|
+
<%= pb_rails("section_separator", props: { color: "primary" }) do %>
|
5
|
+
<%= pb_rails("flex", props: { padding: "xs" }) do %>
|
6
|
+
<%= pb_rails("icon", props: { color: "primary", icon: "arrow-down" }) %>
|
7
|
+
<%= pb_rails("detail", props: { text: "Children", size: "sm", color: "link" }) %>
|
8
|
+
<% end %>
|
9
|
+
<% end %>
|
10
|
+
|
@@ -0,0 +1,42 @@
|
|
1
|
+
import React from "react"
|
2
|
+
import { SectionSeparator, Flex, Detail, Icon } from "playbook-ui"
|
3
|
+
|
4
|
+
const children = (
|
5
|
+
<Flex padding="xs">
|
6
|
+
<Icon color="primary"
|
7
|
+
icon="arrow-down"
|
8
|
+
/>
|
9
|
+
<Detail
|
10
|
+
color="link"
|
11
|
+
size="sm"
|
12
|
+
text="Children"
|
13
|
+
/>
|
14
|
+
</Flex>
|
15
|
+
)
|
16
|
+
|
17
|
+
const SectionSeparatorColor = (props) => {
|
18
|
+
return (
|
19
|
+
<div>
|
20
|
+
<SectionSeparator text="Default Separator"
|
21
|
+
{...props}
|
22
|
+
/>
|
23
|
+
<SectionSeparator color="primary"
|
24
|
+
text="Primary Separator"
|
25
|
+
{...props}
|
26
|
+
/>
|
27
|
+
<SectionSeparator
|
28
|
+
color="primary"
|
29
|
+
lineStyle="dashed"
|
30
|
+
text="Primary Dashed Separator"
|
31
|
+
{...props}
|
32
|
+
/>
|
33
|
+
<SectionSeparator color="primary"
|
34
|
+
{...props}
|
35
|
+
>
|
36
|
+
{children}
|
37
|
+
</SectionSeparator>
|
38
|
+
</div>
|
39
|
+
)
|
40
|
+
}
|
41
|
+
|
42
|
+
export default SectionSeparatorColor
|
@@ -0,0 +1,3 @@
|
|
1
|
+
Pass "primary" to the `color` prop to change any section separator color.
|
2
|
+
|
3
|
+
**NOTE:** Passing `children` overrides any content provided via the `text` prop. The `color` prop does not affect the `text` prop's color, and the color of `children` is determined by the children's individual props. For greater control over text color customization, consider using a separator with `children`.
|
@@ -6,6 +6,7 @@ examples:
|
|
6
6
|
- section_separator_text: Text Separator
|
7
7
|
- section_separator_vertical: Vertical
|
8
8
|
- section_separator_children: Children
|
9
|
+
- section_separator_color: Color
|
9
10
|
|
10
11
|
react:
|
11
12
|
- section_separator_line: Line Separator
|
@@ -13,6 +14,7 @@ examples:
|
|
13
14
|
- section_separator_text: Text Separator
|
14
15
|
- section_separator_vertical: Vertical
|
15
16
|
- section_separator_children: Children
|
17
|
+
- section_separator_color: Color
|
16
18
|
|
17
19
|
swift:
|
18
20
|
- section_separator_line_swift: Line Separator
|
@@ -3,3 +3,4 @@ export { default as SectionSeparatorText } from './_section_separator_text.jsx'
|
|
3
3
|
export { default as SectionSeparatorVertical } from './_section_separator_vertical.jsx'
|
4
4
|
export { default as SectionSeparatorDashed } from './_section_separator_dashed.jsx'
|
5
5
|
export { default as SectionSeparatorChildren } from './_section_separator_children.jsx'
|
6
|
+
export { default as SectionSeparatorColor } from './_section_separator_color.jsx'
|
@@ -3,6 +3,9 @@
|
|
3
3
|
module Playbook
|
4
4
|
module PbSectionSeparator
|
5
5
|
class SectionSeparator < Playbook::KitBase
|
6
|
+
prop :color, type: Playbook::Props::Enum,
|
7
|
+
values: %w[default primary],
|
8
|
+
default: "default"
|
6
9
|
prop :text
|
7
10
|
prop :variant, type: Playbook::Props::Enum,
|
8
11
|
values: %w[card background],
|
@@ -17,7 +20,7 @@ module Playbook
|
|
17
20
|
default: "solid"
|
18
21
|
|
19
22
|
def classname
|
20
|
-
generate_classname("pb_section_separator_kit", variant, orientation, line_style == "dashed" ? "dashed" : nil)
|
23
|
+
generate_classname("pb_section_separator_kit", variant, orientation, line_style == "dashed" ? "dashed" : nil, color != "default" ? "color_#{color}" : nil)
|
21
24
|
end
|
22
25
|
|
23
26
|
private
|
@@ -0,0 +1,3 @@
|
|
1
|
+
The Skeleton Loading kit can be used an intermediate loading state to give users a visual indication that content is loading.
|
2
|
+
|
3
|
+
**Please Note**: this kit is not meant to be integrated interally within other Playbook kits as a loading prop; rather, it can be used to create a composite of the section/kit/page with loading intermediataries, as demonstrated in the the "example component" doc examples.
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<%= pb_rails("flex", props: { justify: "evenly" }) do %>
|
2
|
+
<%= pb_rails("skeleton_loading", props: { border_radius: "rounded", height: "50px", width: "100px"}) %>
|
3
|
+
<%= pb_rails("skeleton_loading", props: { border_radius: "xl", height: "50px", width: "100px"}) %>
|
4
|
+
<%= pb_rails("skeleton_loading", props: { border_radius: "lg", height: "50px", width: "100px"}) %>
|
5
|
+
<%= pb_rails("skeleton_loading", props: { border_radius: "md", height: "50px", width: "100px"}) %>
|
6
|
+
<%= pb_rails("skeleton_loading", props: { height: "50px", width: "100px"}) %>
|
7
|
+
<%= pb_rails("skeleton_loading", props: { border_radius: "xs", height: "50px", width: "100px"}) %>
|
8
|
+
<%= pb_rails("skeleton_loading", props: { border_radius: "none", height: "50px", width: "100px"}) %>
|
9
|
+
<% end %>
|
@@ -0,0 +1 @@
|
|
1
|
+
The `border_radius` prop accepts all of our [BorderRadius](https://playbook.powerapp.cloud/visual_guidelines/border_radius) tokens, with `sm` as default.
|
@@ -1 +1 @@
|
|
1
|
-
<%= pb_rails("skeleton_loading") %>
|
1
|
+
<%= pb_rails("skeleton_loading") %>
|