playbook_ui 14.17.0.pre.alpha.play1906overlaykitaddopacityandgradient7201 → 14.17.0.pre.alpha.play1906overlaykitaddopacityandgradient7232
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_background/_background.scss +26 -0
- data/app/pb_kits/playbook/pb_background/_background.tsx +5 -3
- data/app/pb_kits/playbook/pb_background/background.test.js +5 -0
- data/app/pb_kits/playbook/pb_background/docs/_background_overlay.jsx +35 -0
- data/app/pb_kits/playbook/pb_background/docs/_background_overlay.md +1 -0
- data/app/pb_kits/playbook/pb_background/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_background/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_color.jsx +63 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_color.md +3 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_default.md +1 -9
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_gradient_opacity.jsx +39 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_gradient_opacity.md +1 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_layout.jsx +40 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_layout.md +5 -0
- data/app/pb_kits/playbook/pb_overlay/docs/example.yml +3 -0
- data/app/pb_kits/playbook/pb_overlay/docs/index.js +3 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_borderless.html.erb +34 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_borderless_rails.md +1 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_floating.html.erb +36 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_floating_rails.md +1 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_floating_react.md +1 -1
- data/app/pb_kits/playbook/pb_table/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_table/table.rb +13 -1
- data/app/pb_kits/playbook/pb_table/table_header.rb +13 -1
- data/dist/chunks/{_typeahead-HqfDnjRe.js → _typeahead-C2GOKWtm.js} +1 -1
- data/dist/chunks/{_weekday_stacked--YupDiur.js → _weekday_stacked-Cw9LuHnt.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 +16 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4eed786792f1c5eea97b75faecd6189cb039c81d91a3f999cb9caab3048b63e
|
4
|
+
data.tar.gz: a88401324ebf090e25add4d906ac29e974536fc0800bedf80a3c74fb7e346524
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a86ebc9438ea0abc1ad6dc17ccad0881ea85af8116da7dcc098f34555ecdbe4191ef2983fb458c1011ac8cc0a4941c0fafbc2a345babe4d9b286ad916f5e6bd3
|
7
|
+
data.tar.gz: 2161ae14909692c4433b10399f95862a64685350fb43e03c1329574251291aaaf6bb0212d58f8b753c4c84b9570767293c6533554f0bad23663a9130b325fc18
|
@@ -55,4 +55,30 @@ $background_colors: map-merge($additional_colors, $merge_kits7);
|
|
55
55
|
transition: 700ms ease-in;
|
56
56
|
}
|
57
57
|
}
|
58
|
+
|
59
|
+
&[class*=imageoverlay] {
|
60
|
+
position: relative;
|
61
|
+
|
62
|
+
&:before {
|
63
|
+
content: "";
|
64
|
+
position: absolute;
|
65
|
+
top: 0;
|
66
|
+
left: 0;
|
67
|
+
right: 0;
|
68
|
+
bottom: 0;
|
69
|
+
z-index: 1;
|
70
|
+
background-color: inherit;
|
71
|
+
}
|
72
|
+
|
73
|
+
* {
|
74
|
+
position: relative;
|
75
|
+
z-index: 2;
|
76
|
+
}
|
77
|
+
}
|
78
|
+
|
79
|
+
@each $key, $value in $opacity {
|
80
|
+
&.imageoverlay_#{$key}::before {
|
81
|
+
opacity: $value;
|
82
|
+
}
|
83
|
+
}
|
58
84
|
}
|
@@ -25,6 +25,7 @@ type BackgroundProps = {
|
|
25
25
|
backgroundPosition?: ResponsiveProp<string> | string,
|
26
26
|
backgroundRepeat?: ResponsiveProp<BackgroundRepeat> | BackgroundRepeat,
|
27
27
|
imageUrl?: ResponsiveProp<string> | string,
|
28
|
+
imageOverlay?: 'opacity_1' | 'opacity_2' | 'opacity_3' | 'opacity_4' | 'opacity_5' | 'opacity_6' | 'opacity_7' | 'opacity_8' | 'opacity_9' | 'opacity_10',
|
28
29
|
children?: React.ReactChild[] | React.ReactNode,
|
29
30
|
className?: string,
|
30
31
|
customColor?: string,
|
@@ -83,11 +84,12 @@ const Background = (props: BackgroundProps): React.ReactElement => {
|
|
83
84
|
data = {},
|
84
85
|
htmlOptions = {},
|
85
86
|
id,
|
87
|
+
imageOverlay,
|
86
88
|
imageUrl = '',
|
87
89
|
tag = 'div',
|
88
90
|
transition = '',
|
89
91
|
} = props
|
90
|
-
|
92
|
+
|
91
93
|
const [responsiveProps, setResponsiveProps] = useState({
|
92
94
|
backgroundSize: getResponsiveValue(backgroundSize),
|
93
95
|
backgroundPosition: getResponsiveValue(backgroundPosition),
|
@@ -132,6 +134,7 @@ const Background = (props: BackgroundProps): React.ReactElement => {
|
|
132
134
|
[`pb_background_color_${resBackgroundColor}`]: resBackgroundColor && !customColor,
|
133
135
|
[`pb_background_custom_color`]: !!customColor,
|
134
136
|
},
|
137
|
+
imageOverlay ? `imageoverlay_${imageOverlay}` : "",
|
135
138
|
className
|
136
139
|
);
|
137
140
|
|
@@ -155,7 +158,7 @@ const Background = (props: BackgroundProps): React.ReactElement => {
|
|
155
158
|
const ariaProps = buildAriaProps(aria);
|
156
159
|
const dataProps = buildDataProps(data);
|
157
160
|
const htmlProps = buildHtmlProps(htmlOptions);
|
158
|
-
|
161
|
+
|
159
162
|
return (
|
160
163
|
<Tag
|
161
164
|
{...ariaProps}
|
@@ -168,7 +171,6 @@ const Background = (props: BackgroundProps): React.ReactElement => {
|
|
168
171
|
>
|
169
172
|
{children}
|
170
173
|
</Tag>
|
171
|
-
|
172
174
|
)
|
173
175
|
}
|
174
176
|
|
@@ -37,3 +37,8 @@ test('backgroundSize = auto', () => {
|
|
37
37
|
const kit = renderKit(Background, props, { classname: "background-image", imageUrl: "https://images.unsplash.com/photo-1528459801416-a9e53bbf4e17?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1000&q=80", backgroundSize: 'auto' })
|
38
38
|
expect(kit).toHaveStyle('background-size: auto')
|
39
39
|
})
|
40
|
+
|
41
|
+
test('applies correct overlay class when imageOverlay prop is provided', () => {
|
42
|
+
const kit = renderKit(Background, props, { imageOverlay: 'opacity_6' });
|
43
|
+
expect(kit).toHaveClass('imageoverlay_opacity_6');
|
44
|
+
});
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import Background from "../../pb_background/_background"
|
3
|
+
import Flex from "../../pb_flex/_flex"
|
4
|
+
import FlexItem from "../../pb_flex/_flex_item"
|
5
|
+
import Title from "../../pb_title/_title"
|
6
|
+
|
7
|
+
const BackgroundOverlay = (props) => {
|
8
|
+
return (
|
9
|
+
<Background
|
10
|
+
alt="colorful background"
|
11
|
+
backgroundColor="category_21"
|
12
|
+
className="background lazyload"
|
13
|
+
imageOverlay="opacity_2"
|
14
|
+
imageUrl="https://unsplash.it/500/400/?image=633"
|
15
|
+
{...props}
|
16
|
+
>
|
17
|
+
<Flex
|
18
|
+
orientation="column"
|
19
|
+
vertical="center"
|
20
|
+
{...props}
|
21
|
+
>
|
22
|
+
<FlexItem>
|
23
|
+
<Title
|
24
|
+
dark
|
25
|
+
padding="lg"
|
26
|
+
size={1}
|
27
|
+
text="Background Kit Image"
|
28
|
+
/>
|
29
|
+
</FlexItem>
|
30
|
+
</Flex>
|
31
|
+
</Background>
|
32
|
+
)
|
33
|
+
}
|
34
|
+
|
35
|
+
export default BackgroundOverlay
|
@@ -0,0 +1 @@
|
|
1
|
+
An overlay can be added to the background image by setting the `imageOverlay` prop and adding a `backgroundColor`. The `imageOverlay` prop can be set to any opacity ranging from `opacity_1` to `opacity_10`.
|
@@ -6,3 +6,4 @@ export { default as BackgroundStatus } from './_background_status.jsx'
|
|
6
6
|
export { default as BackgroundStatusSubtle } from './_background_status_subtle.jsx'
|
7
7
|
export { default as BackgroundCategory } from './_background_category.jsx'
|
8
8
|
export { default as BackgroundSize } from './_background_size.jsx'
|
9
|
+
export { default as BackgroundOverlay } from './_background_overlay.jsx'
|
@@ -0,0 +1,63 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
|
3
|
+
import Overlay from '../../pb_overlay/_overlay'
|
4
|
+
import Image from '../../pb_image/_image'
|
5
|
+
import Flex from '../../pb_flex/_flex'
|
6
|
+
|
7
|
+
const OverlayColor = () => (
|
8
|
+
<Flex
|
9
|
+
justify="around"
|
10
|
+
wrap
|
11
|
+
>
|
12
|
+
<Overlay
|
13
|
+
color="black"
|
14
|
+
marginBottom="xxs"
|
15
|
+
>
|
16
|
+
<Image
|
17
|
+
alt="picture of a misty forest"
|
18
|
+
display="block"
|
19
|
+
size="xl"
|
20
|
+
url="https://unsplash.it/500/400/?image=634"
|
21
|
+
/>
|
22
|
+
</Overlay>
|
23
|
+
<Overlay
|
24
|
+
color="black"
|
25
|
+
gradient={false}
|
26
|
+
marginBottom="xxs"
|
27
|
+
opacity="opacity_4"
|
28
|
+
>
|
29
|
+
<Image
|
30
|
+
alt="picture of a misty forest"
|
31
|
+
display="block"
|
32
|
+
size="xl"
|
33
|
+
url="https://unsplash.it/500/400/?image=634"
|
34
|
+
/>
|
35
|
+
</Overlay>
|
36
|
+
<Overlay
|
37
|
+
color="error"
|
38
|
+
marginBottom="xxs"
|
39
|
+
>
|
40
|
+
<Image
|
41
|
+
alt="picture of a misty forest"
|
42
|
+
display="block"
|
43
|
+
size="xl"
|
44
|
+
url="https://unsplash.it/500/400/?image=634"
|
45
|
+
/>
|
46
|
+
</Overlay>
|
47
|
+
<Overlay
|
48
|
+
color="error"
|
49
|
+
gradient={false}
|
50
|
+
marginBottom="xxs"
|
51
|
+
opacity="opacity_4"
|
52
|
+
>
|
53
|
+
<Image
|
54
|
+
alt="picture of a misty forest"
|
55
|
+
display="block"
|
56
|
+
size="xl"
|
57
|
+
url="https://unsplash.it/500/400/?image=634"
|
58
|
+
/>
|
59
|
+
</Overlay>
|
60
|
+
</Flex>
|
61
|
+
)
|
62
|
+
|
63
|
+
export default OverlayColor
|
@@ -0,0 +1,3 @@
|
|
1
|
+
The `color` prop is used to change the color of the solid or gradient mask. Gradient overlays always start opaque and fade to transparent.
|
2
|
+
|
3
|
+
NOTE: Images are set to `display: block` to remove the default inline spacing caused by line height. This ensures the image fully fills the container without unexpected gaps.
|
@@ -1,9 +1 @@
|
|
1
|
-
Overlays
|
2
|
-
|
3
|
-
The optional `layout` prop accepts the `position` and `size` of the overlay as a key:value pair.
|
4
|
-
|
5
|
-
The `position` key accepts `bottom` (default), `top`, `y` (for both top and bottom) `right`, `left`, or `x` (for both left and right), which sets the side(s) where the `color` overlay starts. The direction of the overlay is always toward the opposite side of the position. For example, the default position of `bottom` starts the overlay on the bottom edge of your container and extends it toward the opposite side: the top.
|
6
|
-
|
7
|
-
The `size` value is `full` (100%) by default, but accepts our [spacing tokens](https://playbook.powerapp.cloud/visual_guidelines/spacing) or a percentage value as a string, and literally translates to how much of the container is covered by the overlay(s).
|
8
|
-
|
9
|
-
By default, the overlay is rendered as a gradient. Setting the `gradient` prop to `false` renders the overlay as a solid color using the value provided by the `color` prop. You can adjust the transparency of the solid overlay by using the `opacity` prop.
|
1
|
+
Overlays help shift focus by dimming or masking background content. This kit supports gradient and solid color modes, with adjustable opacity to suit the context.
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
|
3
|
+
import Overlay from '../../pb_overlay/_overlay'
|
4
|
+
import Image from '../../pb_image/_image'
|
5
|
+
import Flex from '../../pb_flex/_flex'
|
6
|
+
|
7
|
+
const OverlayGradientOpacity = () => (
|
8
|
+
<Flex
|
9
|
+
justify="around"
|
10
|
+
wrap
|
11
|
+
>
|
12
|
+
<Overlay
|
13
|
+
gradient={false}
|
14
|
+
marginBottom="xxs"
|
15
|
+
opacity="opacity_2"
|
16
|
+
>
|
17
|
+
<Image
|
18
|
+
alt="picture of a misty forest"
|
19
|
+
display="block"
|
20
|
+
maxWidth="100%"
|
21
|
+
url="https://unsplash.it/500/400/?image=634"
|
22
|
+
/>
|
23
|
+
</Overlay>
|
24
|
+
<Overlay
|
25
|
+
gradient={false}
|
26
|
+
marginBottom="xxs"
|
27
|
+
opacity="opacity_8"
|
28
|
+
>
|
29
|
+
<Image
|
30
|
+
alt="picture of a misty forest"
|
31
|
+
display="block"
|
32
|
+
maxWidth="100%"
|
33
|
+
url="https://unsplash.it/500/400/?image=634"
|
34
|
+
/>
|
35
|
+
</Overlay>
|
36
|
+
</Flex>
|
37
|
+
)
|
38
|
+
|
39
|
+
export default OverlayGradientOpacity
|
@@ -0,0 +1 @@
|
|
1
|
+
By default, the overlay is rendered as a gradient. Setting the `gradient` prop to `false` renders the overlay as a solid color. You can adjust the transparency of the solid overlay by using the `opacity` prop.
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
|
3
|
+
import Overlay from '../../pb_overlay/_overlay'
|
4
|
+
import Table from '../../pb_table/_table'
|
5
|
+
|
6
|
+
|
7
|
+
const TableExample = () => {
|
8
|
+
return (
|
9
|
+
<Table size="sm">
|
10
|
+
<thead>
|
11
|
+
<tr>
|
12
|
+
<th>{'Column 1'}</th>
|
13
|
+
<th>{'Column 2'}</th>
|
14
|
+
<th>{'Column 3'}</th>
|
15
|
+
<th>{'Column 4'}</th>
|
16
|
+
<th>{'Column 5'}</th>
|
17
|
+
</tr>
|
18
|
+
</thead>
|
19
|
+
<tbody>
|
20
|
+
{Array.from({ length: 7 }, (_, index) => (
|
21
|
+
<tr key={index}>
|
22
|
+
{Array.from({ length: 5 }, (_, columnIndex) => (
|
23
|
+
<td key={columnIndex}>{`Value ${columnIndex + 1}`}</td>
|
24
|
+
))}
|
25
|
+
</tr>
|
26
|
+
))}
|
27
|
+
</tbody>
|
28
|
+
</Table>
|
29
|
+
)
|
30
|
+
}
|
31
|
+
|
32
|
+
const OverlayLayout = () => (
|
33
|
+
<>
|
34
|
+
<Overlay layout={{ y: "xl" }}>
|
35
|
+
<TableExample />
|
36
|
+
</Overlay>
|
37
|
+
</>
|
38
|
+
)
|
39
|
+
|
40
|
+
export default OverlayLayout
|
@@ -0,0 +1,5 @@
|
|
1
|
+
The optional `layout` prop accepts the `position` and `size` of the overlay as a key:value pair.
|
2
|
+
|
3
|
+
The `position` key accepts `bottom` (default), `top`, `y` (for both top and bottom) `right`, `left`, or `x` (for both left and right), which sets the side(s) where the `color` overlay starts. The direction of the overlay is always toward the opposite side of the position. For example, the default position of `bottom` starts the overlay on the bottom edge of your container and extends it toward the opposite side: the top.
|
4
|
+
|
5
|
+
The `size` value is `full` (100%) by default, but accepts our [spacing tokens](https://playbook.powerapp.cloud/visual_guidelines/spacing) or a percentage value as a string, and literally translates to how much of the container is covered by the overlay(s).
|
@@ -1,6 +1,9 @@
|
|
1
1
|
examples:
|
2
2
|
react:
|
3
3
|
- overlay_default: Default
|
4
|
+
- overlay_gradient_opacity: Gradient & Opacity
|
5
|
+
- overlay_color: Color
|
6
|
+
- overlay_layout: Layout
|
4
7
|
- overlay_multi_directional: Multi-directional
|
5
8
|
- overlay_vertical_dynamic_multi_directional: Vertical Dynamic Multi-directional
|
6
9
|
- overlay_toggle: Toggle
|
@@ -1,4 +1,7 @@
|
|
1
1
|
export { default as OverlayDefault } from './_overlay_default.jsx'
|
2
|
+
export { default as OverlayGradientOpacity } from './_overlay_gradient_opacity.jsx'
|
3
|
+
export { default as OverlayColor } from './_overlay_color.jsx'
|
4
|
+
export { default as OverlayLayout } from './_overlay_layout.jsx'
|
2
5
|
export { default as OverlayMultiDirectional } from './_overlay_multi_directional.jsx'
|
3
6
|
export { default as OverlayToggle } from './_overlay_toggle.jsx'
|
4
7
|
export { default as OverlayVerticalDynamicMultiDirectional } from './_overlay_vertical_dynamic_multi_directional.jsx'
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<%= pb_rails("table", props: { size: "sm", header_style: "borderless" }) do %>
|
2
|
+
<thead>
|
3
|
+
<tr>
|
4
|
+
<th>Column 1</th>
|
5
|
+
<th>Column 2</th>
|
6
|
+
<th>Column 3</th>
|
7
|
+
<th>Column 4</th>
|
8
|
+
<th>Column 5</th>
|
9
|
+
</tr>
|
10
|
+
</thead>
|
11
|
+
<tbody>
|
12
|
+
<tr>
|
13
|
+
<td>Value 1</td>
|
14
|
+
<td>Value 2</td>
|
15
|
+
<td>Value 3</td>
|
16
|
+
<td>Value 4</td>
|
17
|
+
<td>Value 5</td>
|
18
|
+
</tr>
|
19
|
+
<tr>
|
20
|
+
<td>Value 1</td>
|
21
|
+
<td>Value 2</td>
|
22
|
+
<td>Value 3</td>
|
23
|
+
<td>Value 4</td>
|
24
|
+
<td>Value 5</td>
|
25
|
+
</tr>
|
26
|
+
<tr>
|
27
|
+
<td>Value 1</td>
|
28
|
+
<td>Value 2</td>
|
29
|
+
<td>Value 3</td>
|
30
|
+
<td>Value 4</td>
|
31
|
+
<td>Value 5</td>
|
32
|
+
</tr>
|
33
|
+
</tbody>
|
34
|
+
<% end %>
|
@@ -0,0 +1 @@
|
|
1
|
+
Customize your header by removing the header borders with the `header_style: "borderless"` prop.
|
@@ -0,0 +1,36 @@
|
|
1
|
+
<%= pb_rails("card", props: { background: "light" }) do %>
|
2
|
+
<%= pb_rails("table", props: { size: "sm", header_style: "floating" }) do %>
|
3
|
+
<%= pb_rails("table/table_head") do %>
|
4
|
+
<%= pb_rails("background", props: { background_color: "light", tag: "tr" }) do %>
|
5
|
+
<%= pb_rails("table/table_header", props: { text: "Column 1"}) %>
|
6
|
+
<%= pb_rails("table/table_header", props: { text: "Column 2"}) %>
|
7
|
+
<%= pb_rails("table/table_header", props: { text: "Column 3"}) %>
|
8
|
+
<%= pb_rails("table/table_header", props: { text: "Column 4"}) %>
|
9
|
+
<%= pb_rails("table/table_header", props: { text: "Column 5"}) %>
|
10
|
+
<% end %>
|
11
|
+
<% end %>
|
12
|
+
<%= pb_rails("table/table_body") do %>
|
13
|
+
<%= pb_rails("table/table_row") do %>
|
14
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 1"}) %>
|
15
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 2"}) %>
|
16
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 3"}) %>
|
17
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 4"}) %>
|
18
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 5"}) %>
|
19
|
+
<% end %>
|
20
|
+
<%= pb_rails("table/table_row") do %>
|
21
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 1"}) %>
|
22
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 2"}) %>
|
23
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 3"}) %>
|
24
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 4"}) %>
|
25
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 5"}) %>
|
26
|
+
<% end %>
|
27
|
+
<%= pb_rails("table/table_row") do %>
|
28
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 1"}) %>
|
29
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 2"}) %>
|
30
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 3"}) %>
|
31
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 4"}) %>
|
32
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 5"}) %>
|
33
|
+
<% end %>
|
34
|
+
<% end %>
|
35
|
+
<% end %>
|
36
|
+
<% end %>
|
@@ -0,0 +1 @@
|
|
1
|
+
Further customize your header by using the [table with background kit](https://playbook.powerapp.cloud/kits/table/rails#table-with-background-kit) logic to give your table header a custom background color. Use the `header_style: "floating"` prop to visually nest the borderless table within a card or collapsible with a matching background color (the `background_color` passed to Background kit should match the `background` or `background_color` for the element in which it is nested).
|
@@ -1 +1 @@
|
|
1
|
-
Further customize your header by using the [table with background kit](https://playbook.powerapp.cloud/kits/table/react#table-with-background-kit) logic to give your table header a custom background color. Use the `headerStyle="floating"` prop to visually nest the borderless table within a card or collapsible with a matching background color (the `backgroundColor` passed to Background kit should match the `backgroundColor` for the element in which it is nested).
|
1
|
+
Further customize your header by using the [table with background kit](https://playbook.powerapp.cloud/kits/table/react#table-with-background-kit) logic to give your table header a custom background color. Use the `headerStyle="floating"` prop to visually nest the borderless table within a card or collapsible with a matching background color (the `backgroundColor` passed to Background kit should match the `background` or `backgroundColor` for the element in which it is nested).
|
@@ -37,6 +37,8 @@ examples:
|
|
37
37
|
- table_with_collapsible_with_nested_table_rails: Table with Collapsible with Nested Table
|
38
38
|
- table_with_clickable_rows: Table with Clickable Rows
|
39
39
|
- table_with_selectable_rows: Table with Selectable Rows
|
40
|
+
- table_with_header_style_borderless: Header Style Borderless
|
41
|
+
- table_with_header_style_floating: Header Style Floating
|
40
42
|
|
41
43
|
react:
|
42
44
|
- table_sm: Small
|
@@ -37,13 +37,16 @@ module Playbook
|
|
37
37
|
prop :outer_padding, type: Playbook::Props::Enum,
|
38
38
|
values: ["none", "xxs", "xs", "sm", "md", "lg", "xl", nil],
|
39
39
|
default: nil
|
40
|
+
prop :header_style, type: Playbook::Props::Enum,
|
41
|
+
values: %w[default borderless floating],
|
42
|
+
default: "default"
|
40
43
|
|
41
44
|
def classname
|
42
45
|
generate_classname(
|
43
46
|
"pb_table", "table-#{size}", single_line_class, dark_class,
|
44
47
|
disable_hover_class, container_class, data_table_class, sticky_class, sticky_left_column_class,
|
45
48
|
sticky_right_column_class, collapse_class, vertical_border_class, striped_class, outer_padding_class,
|
46
|
-
"table-responsive-#{responsive}", separator: " "
|
49
|
+
"table-responsive-#{responsive}", header_style_class, separator: " "
|
47
50
|
)
|
48
51
|
end
|
49
52
|
|
@@ -123,6 +126,15 @@ module Playbook
|
|
123
126
|
outer_padding.present? ? "outer_padding_#{space_css_name}#{outer_padding}" : nil
|
124
127
|
end
|
125
128
|
end
|
129
|
+
|
130
|
+
def header_style_class
|
131
|
+
case header_style
|
132
|
+
when "borderless"
|
133
|
+
"header-borderless"
|
134
|
+
when "floating"
|
135
|
+
"header-floating"
|
136
|
+
end
|
137
|
+
end
|
126
138
|
end
|
127
139
|
end
|
128
140
|
end
|
@@ -26,9 +26,12 @@ module Playbook
|
|
26
26
|
prop :tag, type: Playbook::Props::Enum,
|
27
27
|
values: %w[table div],
|
28
28
|
default: "table"
|
29
|
+
prop :header_style, type: Playbook::Props::Enum,
|
30
|
+
values: %w[default borderless floating],
|
31
|
+
default: "default"
|
29
32
|
|
30
33
|
def classname
|
31
|
-
generate_classname("pb_table_header_kit", align_class) + tag_class
|
34
|
+
generate_classname("pb_table_header_kit", align_class, header_style_class) + tag_class
|
32
35
|
end
|
33
36
|
|
34
37
|
def tag_class
|
@@ -106,6 +109,15 @@ module Playbook
|
|
106
109
|
end
|
107
110
|
active_item
|
108
111
|
end
|
112
|
+
|
113
|
+
def header_style_class
|
114
|
+
case header_style
|
115
|
+
when "borderless"
|
116
|
+
"header-borderless"
|
117
|
+
when "floating"
|
118
|
+
"header-floating"
|
119
|
+
end
|
120
|
+
end
|
109
121
|
end
|
110
122
|
end
|
111
123
|
end
|