playbook_ui 14.11.0.pre.rc.5 → 14.11.0.pre.rc.6
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_icon_circle/_icon_circle.scss +1 -13
- data/app/pb_kits/playbook/pb_section_separator/_section_separator.scss +60 -0
- 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/dist/chunks/{_typeahead-BXXEtXbz.js → _typeahead-CSAeYYPT.js} +1 -1
- data/dist/chunks/{_weekday_stacked-D0yBvHBb.js → _weekday_stacked-CelCROXn.js} +1 -1
- data/dist/chunks/vendor.js +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 +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90f0123e3995ace5639733d29921fbb16fab9b2d33ade22943e730de7354462f
|
4
|
+
data.tar.gz: cc98b9bc9a33a7786acec47a68ff3453630c0394d7dffb9620fc25fd0b9e52c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f417b8df46ee94165dc64e48ea31d5dc36fa4f2c9a87149021cbc7a975c759f5ee0e2895fefcf14c3701bfcbcca88b55d88fcb356b0af1309c6e07eb0f3824f
|
7
|
+
data.tar.gz: e49a36cb29ad2001e8b1155336b88b3c4d82e1a171234e05cf0d03414544fb7796e517ef237d7192223e42a8fcf1aee8b64cc647bc5746e128e3f0ad57ca871d
|
@@ -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,
|
@@ -37,12 +42,40 @@ $section_colors_dark: (
|
|
37
42
|
flex: 1;
|
38
43
|
@include section_separator_horizontal;
|
39
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
|
+
|
40
70
|
&[class*=_horizontal] {
|
41
71
|
justify-content: center;
|
42
72
|
}
|
43
73
|
&[class*=_vertical] {
|
44
74
|
margin-left: $space_xs;
|
45
75
|
margin-right: $space_xs;
|
76
|
+
&::before {
|
77
|
+
display: none;
|
78
|
+
}
|
46
79
|
&::after {
|
47
80
|
@include section_separator_vertical(false);
|
48
81
|
}
|
@@ -57,6 +90,33 @@ $section_colors_dark: (
|
|
57
90
|
// Dark =========================
|
58
91
|
|
59
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
|
+
}
|
60
120
|
&::before {
|
61
121
|
@include section_separator_horizontal(true);
|
62
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
|