playbook_ui 14.7.0.pre.rc.17 → 14.7.0.pre.rc.19
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/_playbook.scss +1 -1
- data/app/pb_kits/playbook/pb_card/_card.tsx +11 -4
- data/app/pb_kits/playbook/pb_dialog/_dialog.tsx +5 -1
- data/app/pb_kits/playbook/pb_flex/_flex.tsx +3 -1
- data/app/pb_kits/playbook/pb_flex/_flex_item.tsx +8 -2
- data/app/pb_kits/playbook/pb_flex/flex_item.html.erb +3 -6
- data/app/pb_kits/playbook/pb_flex/flex_item.rb +7 -2
- data/app/pb_kits/playbook/pb_popover/_popover.tsx +1 -1
- data/app/pb_kits/playbook/pb_skeleton_loading/_skeleton_loading.scss +37 -0
- data/app/pb_kits/playbook/pb_skeleton_loading/_skeleton_loading.tsx +67 -0
- data/app/pb_kits/playbook/pb_skeleton_loading/_skeleton_loading_mixins.scss +40 -0
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_border_radius.jsx +51 -0
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_border_radius.md +1 -0
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_color.jsx +26 -0
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_color.md +1 -0
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_default.html.erb +1 -0
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_default.jsx +11 -0
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_height_width.jsx +59 -0
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_height_width.md +3 -0
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_layout.jsx +20 -0
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_layout.md +3 -0
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/example.yml +13 -0
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/index.js +5 -0
- data/app/pb_kits/playbook/pb_skeleton_loading/skeleton_loading.html.erb +12 -0
- data/app/pb_kits/playbook/pb_skeleton_loading/skeleton_loading.rb +8 -0
- data/app/pb_kits/playbook/pb_skeleton_loading/skeleton_loading.test.jsx +81 -0
- data/app/pb_kits/playbook/utilities/globalPropNames.mjs +3 -0
- data/app/pb_kits/playbook/utilities/globalProps.ts +39 -2
- data/dist/chunks/_typeahead-DhLic2Fe.js +22 -0
- data/dist/chunks/_weekday_stacked-Mx8TYP5I.js +45 -0
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +4 -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/kit_base.rb +43 -5
- data/lib/playbook/version.rb +1 -1
- metadata +22 -4
- data/dist/chunks/_typeahead-5m7Pr_Rh.js +0 -22
- data/dist/chunks/_weekday_stacked-B4YQ6Z-d.js +0 -45
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60f5cff6912e2865399cef73254a7b2dc0c44d6569424298bb634f68f32379cd
|
4
|
+
data.tar.gz: 83369d0166a9aa85827c3df19ed00880ad84d6b258c03dc2ff48f2de41c05c75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d9fc03ccd849622b9f5cc1bc47deb85a9733c42fbc986ebe01c3bdcc7ce7446a70f2c21f9da2da2bb3335ba826da717f76b1ccc8a9f5ef8e7aecd2414cb4bf4
|
7
|
+
data.tar.gz: 3f2825d50037ea12633a8ad29a02769e85796681ed3fbaa63b846384e8c50a99fafdaa78eb7bdaea4c20a88379d165d9b94d3f251458f2ab2c8b48c18ce9a2f2
|
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
@import 'pb_advanced_table/advanced_table';
|
3
2
|
@import 'pb_avatar/avatar';
|
4
3
|
@import 'pb_avatar_action_button/avatar_action_button';
|
@@ -85,6 +84,7 @@
|
|
85
84
|
@import 'pb_selectable_card_icon/selectable_card_icon';
|
86
85
|
@import 'pb_selectable_icon/selectable_icon';
|
87
86
|
@import 'pb_selectable_list/selectable_list';
|
87
|
+
@import 'pb_skeleton_loading/skeleton_loading';
|
88
88
|
@import 'pb_source/source';
|
89
89
|
@import 'pb_star_rating/star_rating';
|
90
90
|
@import 'pb_stat_change/stat_change';
|
@@ -5,7 +5,7 @@ import { get } from 'lodash'
|
|
5
5
|
import classnames from 'classnames'
|
6
6
|
|
7
7
|
import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
|
8
|
-
import { GlobalProps, globalProps } from '../utilities/globalProps'
|
8
|
+
import { GlobalProps, globalProps, globalInlineProps } from '../utilities/globalProps'
|
9
9
|
import type { ProductColors, CategoryColors, BackgroundColors } from '../types/colors'
|
10
10
|
|
11
11
|
import Icon from '../pb_icon/_icon'
|
@@ -49,6 +49,7 @@ type CardBodyProps = {
|
|
49
49
|
padding?: string,
|
50
50
|
} & GlobalProps
|
51
51
|
|
52
|
+
|
52
53
|
// Header component
|
53
54
|
const Header = (props: CardHeaderProps) => {
|
54
55
|
const { children, className, headerColor = 'category_1', headerColorStriped = false } = props
|
@@ -107,6 +108,10 @@ const Card = (props: CardPropTypes): React.ReactElement => {
|
|
107
108
|
|
108
109
|
// coerce to array
|
109
110
|
const cardChildren = React.Children.toArray(children)
|
111
|
+
const dynamicInlineProps = globalInlineProps(props);
|
112
|
+
const { style: htmlStyle = {}, ...restHtmlProps } = htmlProps as { style?: React.CSSProperties };
|
113
|
+
const mergedStyles: React.CSSProperties = { ...htmlStyle, ...dynamicInlineProps };
|
114
|
+
|
110
115
|
|
111
116
|
const subComponentTags = (tagName: string) => {
|
112
117
|
return cardChildren.filter((c: string) => (
|
@@ -122,7 +127,7 @@ const Card = (props: CardPropTypes): React.ReactElement => {
|
|
122
127
|
|
123
128
|
const tagOptions = ['div', 'section', 'footer', 'header', 'article', 'aside', 'main', 'nav']
|
124
129
|
const Tag = tagOptions.includes(tag) ? tag : 'div'
|
125
|
-
|
130
|
+
|
126
131
|
return (
|
127
132
|
<>
|
128
133
|
{
|
@@ -133,8 +138,9 @@ const Card = (props: CardPropTypes): React.ReactElement => {
|
|
133
138
|
<Tag
|
134
139
|
{...ariaProps}
|
135
140
|
{...dataProps}
|
136
|
-
{...htmlProps}
|
137
141
|
className={classnames(cardCss, globalProps(props), className)}
|
142
|
+
{...restHtmlProps}
|
143
|
+
style={mergedStyles}
|
138
144
|
>
|
139
145
|
{subComponentTags('Header')}
|
140
146
|
{
|
@@ -161,8 +167,9 @@ const Card = (props: CardPropTypes): React.ReactElement => {
|
|
161
167
|
<Tag
|
162
168
|
{...ariaProps}
|
163
169
|
{...dataProps}
|
164
|
-
{...htmlProps}
|
165
170
|
className={classnames(cardCss, globalProps(props), className)}
|
171
|
+
{...restHtmlProps}
|
172
|
+
style={mergedStyles}
|
166
173
|
>
|
167
174
|
{subComponentTags('Header')}
|
168
175
|
{nonHeaderChildren}
|
@@ -6,7 +6,7 @@ import classnames from "classnames";
|
|
6
6
|
import Modal from "react-modal";
|
7
7
|
|
8
8
|
import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from "../utilities/props";
|
9
|
-
import { globalProps } from "../utilities/globalProps";
|
9
|
+
import { globalProps, globalInlineProps } from "../utilities/globalProps";
|
10
10
|
|
11
11
|
import Body from "../pb_body/_body";
|
12
12
|
import Button from "../pb_button/_button";
|
@@ -91,6 +91,8 @@ const Dialog = (props: DialogProps): React.ReactElement => {
|
|
91
91
|
beforeClose: "pb_dialog_overlay_before_close",
|
92
92
|
};
|
93
93
|
|
94
|
+
const dynamicInlineProps = globalInlineProps(props);
|
95
|
+
|
94
96
|
const classes = classnames(
|
95
97
|
buildCss("pb_dialog_wrapper"),
|
96
98
|
globalProps(props),
|
@@ -184,6 +186,7 @@ const Dialog = (props: DialogProps): React.ReactElement => {
|
|
184
186
|
overlayClassName={overlayClassNames}
|
185
187
|
portalClassName={portalClassName}
|
186
188
|
shouldCloseOnOverlayClick={shouldCloseOnOverlayClick && !loading}
|
189
|
+
style={{ content: dynamicInlineProps }}
|
187
190
|
>
|
188
191
|
<>
|
189
192
|
{title && !status ? <Dialog.Header>{title}</Dialog.Header> : null}
|
@@ -192,6 +195,7 @@ const Dialog = (props: DialogProps): React.ReactElement => {
|
|
192
195
|
<Dialog.Body
|
193
196
|
className="dialog_status_text_align"
|
194
197
|
padding="md"
|
198
|
+
|
195
199
|
>
|
196
200
|
<Flex align="center"
|
197
201
|
orientation="column"
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React from 'react'
|
2
2
|
import classnames from 'classnames'
|
3
3
|
import { buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
|
4
|
-
import { GlobalProps, globalProps } from '../utilities/globalProps'
|
4
|
+
import { GlobalProps, globalProps, globalInlineProps } from '../utilities/globalProps'
|
5
5
|
import { GenericObject, Sizes } from '../types'
|
6
6
|
|
7
7
|
type FlexProps = {
|
@@ -61,6 +61,7 @@ const Flex = (props: FlexProps): React.ReactElement => {
|
|
61
61
|
const alignSelfClass = alignSelf !== 'none' ? `align_self_${alignSelf}` : ''
|
62
62
|
const dataProps = buildDataProps(data)
|
63
63
|
const htmlProps = buildHtmlProps(htmlOptions)
|
64
|
+
const dynamicInlineProps = globalInlineProps(props)
|
64
65
|
|
65
66
|
|
66
67
|
return (
|
@@ -83,6 +84,7 @@ const Flex = (props: FlexProps): React.ReactElement => {
|
|
83
84
|
globalProps(props),
|
84
85
|
className
|
85
86
|
)}
|
87
|
+
style={dynamicInlineProps}
|
86
88
|
{...dataProps}
|
87
89
|
{...htmlProps}
|
88
90
|
>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React from 'react'
|
2
2
|
import classnames from 'classnames'
|
3
3
|
import { buildCss, buildHtmlProps } from '../utilities/props'
|
4
|
-
import { globalProps, GlobalProps } from '../utilities/globalProps'
|
4
|
+
import { globalProps, GlobalProps, globalInlineProps} from '../utilities/globalProps'
|
5
5
|
type FlexItemPropTypes = {
|
6
6
|
children: React.ReactNode[] | React.ReactNode,
|
7
7
|
fixedSize?: string,
|
@@ -35,14 +35,20 @@ const FlexItem = (props: FlexItemPropTypes): React.ReactElement => {
|
|
35
35
|
const fixedStyle =
|
36
36
|
fixedSize !== undefined ? { flexBasis: `${fixedSize}` } : null
|
37
37
|
const orderClass = order !== 'none' ? `order_${order}` : null
|
38
|
+
const dynamicInlineProps = globalInlineProps(props)
|
39
|
+
const combinedStyles = {
|
40
|
+
...fixedStyle,
|
41
|
+
...dynamicInlineProps
|
42
|
+
}
|
38
43
|
|
39
44
|
const htmlProps = buildHtmlProps(htmlOptions)
|
40
45
|
|
46
|
+
|
41
47
|
return (
|
42
48
|
<div
|
43
49
|
{...htmlProps}
|
44
50
|
className={classnames(buildCss('pb_flex_item_kit', growClass, shrinkClass, flexClass, displayFlexClass), orderClass, alignSelfClass, globalProps(props), className)}
|
45
|
-
style={
|
51
|
+
style={combinedStyles}
|
46
52
|
>
|
47
53
|
{children}
|
48
54
|
</div>
|
@@ -20,8 +20,13 @@ module Playbook
|
|
20
20
|
generate_classname("pb_flex_item_kit", fixed_size_class, grow_class, shrink_class, display_flex_class) + align_self_class
|
21
21
|
end
|
22
22
|
|
23
|
-
def
|
24
|
-
|
23
|
+
def inline_styles
|
24
|
+
styles = []
|
25
|
+
styles << "flex-basis: #{fixed_size};" if fixed_size.present?
|
26
|
+
styles << "height: #{height};" if height.present?
|
27
|
+
styles << "min-height: #{min_height};" if min_height.present?
|
28
|
+
styles << "max-height: #{max_height};" if max_height.present?
|
29
|
+
styles.join(" ")
|
25
30
|
end
|
26
31
|
|
27
32
|
private
|
@@ -21,7 +21,7 @@ import classnames from "classnames";
|
|
21
21
|
import { globalProps, GlobalProps } from "../utilities/globalProps";
|
22
22
|
import { uniqueId } from 'lodash';
|
23
23
|
|
24
|
-
type ModifiedGlobalProps = Omit<GlobalProps, 'minWidth'>
|
24
|
+
type ModifiedGlobalProps = Omit<GlobalProps, 'minWidth' | 'maxHeight' | 'minHeight'>
|
25
25
|
|
26
26
|
type PbPopoverProps = {
|
27
27
|
aria?: { [key: string]: string };
|
@@ -0,0 +1,37 @@
|
|
1
|
+
@import 'skeleton_loading_mixins';
|
2
|
+
|
3
|
+
.pb_skeleton_loading {
|
4
|
+
display: "flex";
|
5
|
+
flex-direction: "column";
|
6
|
+
height: 100%;
|
7
|
+
.color_default {
|
8
|
+
@include skeleton-shimmer($silver);
|
9
|
+
}
|
10
|
+
.color_white {
|
11
|
+
@include skeleton-shimmer-light($white);
|
12
|
+
}
|
13
|
+
.dark {
|
14
|
+
@include skeleton-shimmer($border_dark);
|
15
|
+
}
|
16
|
+
.gap_xxs {
|
17
|
+
margin-top: 4px;
|
18
|
+
}
|
19
|
+
.gap_xs {
|
20
|
+
margin-top: 8px;
|
21
|
+
}
|
22
|
+
.gap_sm {
|
23
|
+
margin-top: 16px;
|
24
|
+
}
|
25
|
+
.gap_md {
|
26
|
+
margin-top: 24px;
|
27
|
+
}
|
28
|
+
.gap_lg {
|
29
|
+
margin-top: 32px;
|
30
|
+
}
|
31
|
+
.gap_xl {
|
32
|
+
margin-top: 40px;
|
33
|
+
}
|
34
|
+
.gap_xxl {
|
35
|
+
margin-top: 48px;
|
36
|
+
}
|
37
|
+
}
|
@@ -0,0 +1,67 @@
|
|
1
|
+
|
2
|
+
import React from 'react'
|
3
|
+
import classnames from 'classnames'
|
4
|
+
import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
|
5
|
+
import { globalProps, GlobalProps } from '../utilities/globalProps'
|
6
|
+
import { Sizes } from '../types'
|
7
|
+
|
8
|
+
|
9
|
+
type SkeletonLoadingProps = {
|
10
|
+
aria?: { [key: string]: string },
|
11
|
+
className?: string,
|
12
|
+
data?: { [key: string]: string },
|
13
|
+
id?: string,
|
14
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
15
|
+
height?: string,
|
16
|
+
width?: string,
|
17
|
+
borderRadius?: string,
|
18
|
+
gap?: Sizes | "none",
|
19
|
+
stack?: number,
|
20
|
+
color?: "default" | "white",
|
21
|
+
dark?: boolean,
|
22
|
+
} & GlobalProps
|
23
|
+
|
24
|
+
const SkeletonLoading = (props: SkeletonLoadingProps): React.ReactElement => {
|
25
|
+
const {
|
26
|
+
aria = {},
|
27
|
+
className,
|
28
|
+
data = {},
|
29
|
+
id,
|
30
|
+
htmlOptions = {},
|
31
|
+
height = "16px",
|
32
|
+
width = "100%",
|
33
|
+
borderRadius = "sm",
|
34
|
+
gap = "xxs",
|
35
|
+
stack = 1,
|
36
|
+
color = "default",
|
37
|
+
dark = false,
|
38
|
+
} = props
|
39
|
+
|
40
|
+
const ariaProps = buildAriaProps(aria)
|
41
|
+
const dataProps = buildDataProps(data)
|
42
|
+
const htmlProps = buildHtmlProps(htmlOptions)
|
43
|
+
const skeletonContainerCss = classnames(buildCss('pb_skeleton_loading'), globalProps(props), className)
|
44
|
+
const gapClass = gap !== 'none' ? `gap_${gap}` : ''
|
45
|
+
const innerSkeletonCss = classnames(`border_radius_${borderRadius}`,`color_${color}`, dark && 'dark', )
|
46
|
+
const innerSizeStyle = { height, width }
|
47
|
+
|
48
|
+
return (
|
49
|
+
<div
|
50
|
+
{...ariaProps}
|
51
|
+
{...dataProps}
|
52
|
+
{...htmlProps}
|
53
|
+
className={skeletonContainerCss}
|
54
|
+
id={id}
|
55
|
+
>
|
56
|
+
{Array.from({ length: Number(stack) }).map((_, index) => (
|
57
|
+
<div
|
58
|
+
className={classnames(buildCss('pb_skeleton_loading_item'), innerSkeletonCss, index > 0 && gapClass)}
|
59
|
+
key={index}
|
60
|
+
style={innerSizeStyle}
|
61
|
+
/>
|
62
|
+
))}
|
63
|
+
</div>
|
64
|
+
)
|
65
|
+
}
|
66
|
+
|
67
|
+
export default SkeletonLoading
|
@@ -0,0 +1,40 @@
|
|
1
|
+
// Animation
|
2
|
+
@keyframes wave {
|
3
|
+
0% {
|
4
|
+
background-position: -468px 0;
|
5
|
+
}
|
6
|
+
100% {
|
7
|
+
background-position: 468px 0;
|
8
|
+
}
|
9
|
+
}
|
10
|
+
|
11
|
+
// Shimmer animation and gradient mixin based on color
|
12
|
+
@mixin skeleton-shimmer($color) {
|
13
|
+
background: $color;
|
14
|
+
background-color: $color;
|
15
|
+
background-image: linear-gradient(
|
16
|
+
to left,
|
17
|
+
$color 0%,
|
18
|
+
lighten($color, 1%) 50%,
|
19
|
+
lighten($color, 1%) 60%,
|
20
|
+
$color 80%,
|
21
|
+
$color 100%
|
22
|
+
);
|
23
|
+
background-repeat: no-repeat;
|
24
|
+
animation: wave 1.5s linear infinite forwards;
|
25
|
+
}
|
26
|
+
|
27
|
+
@mixin skeleton-shimmer-light($color) {
|
28
|
+
background: $color;
|
29
|
+
background-color: $color;
|
30
|
+
background-image: linear-gradient(
|
31
|
+
to left,
|
32
|
+
$color 0%,
|
33
|
+
darken($color, 1%) 50%,
|
34
|
+
darken($color, 1%) 60%,
|
35
|
+
$color 80%,
|
36
|
+
$color 100%
|
37
|
+
);
|
38
|
+
background-repeat: no-repeat;
|
39
|
+
animation: wave 1.5s linear infinite forwards;
|
40
|
+
}
|
@@ -0,0 +1,51 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import { Flex, SkeletonLoading } from "playbook-ui"
|
3
|
+
|
4
|
+
|
5
|
+
const SkeletonLoadingBorderRadius = (props) => (
|
6
|
+
<Flex justify="evenly">
|
7
|
+
<SkeletonLoading
|
8
|
+
borderRadius="rounded"
|
9
|
+
height="50px"
|
10
|
+
width="100px"
|
11
|
+
{...props}
|
12
|
+
/>
|
13
|
+
<SkeletonLoading
|
14
|
+
borderRadius="xl"
|
15
|
+
height="50px"
|
16
|
+
width="100px"
|
17
|
+
{...props}
|
18
|
+
/>
|
19
|
+
<SkeletonLoading
|
20
|
+
borderRadius="lg"
|
21
|
+
height="50px"
|
22
|
+
width="100px"
|
23
|
+
{...props}
|
24
|
+
/>
|
25
|
+
<SkeletonLoading
|
26
|
+
borderRadius="md"
|
27
|
+
height="50px"
|
28
|
+
width="100px"
|
29
|
+
{...props}
|
30
|
+
/>
|
31
|
+
<SkeletonLoading
|
32
|
+
height="50px"
|
33
|
+
width="100px"
|
34
|
+
{...props}
|
35
|
+
/>
|
36
|
+
<SkeletonLoading
|
37
|
+
borderRadius="xs"
|
38
|
+
height="50px"
|
39
|
+
width="100px"
|
40
|
+
{...props}
|
41
|
+
/>
|
42
|
+
<SkeletonLoading
|
43
|
+
borderRadius="none"
|
44
|
+
height="50px"
|
45
|
+
width="100px"
|
46
|
+
{...props}
|
47
|
+
/>
|
48
|
+
</Flex>
|
49
|
+
)
|
50
|
+
|
51
|
+
export default SkeletonLoadingBorderRadius
|
@@ -0,0 +1 @@
|
|
1
|
+
The `borderRadius` prop accepts all of our [BorderRadius](https://playbook.powerapp.cloud/visual_guidelines/border_radius) tokens, with `sm` as default.
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import { Card, SkeletonLoading } from "playbook-ui"
|
3
|
+
|
4
|
+
|
5
|
+
const SkeletonLoadingColor = (props) => (
|
6
|
+
<div>
|
7
|
+
<Card
|
8
|
+
borderNone
|
9
|
+
{...props}
|
10
|
+
>
|
11
|
+
<SkeletonLoading {...props}/>
|
12
|
+
</Card>
|
13
|
+
<Card
|
14
|
+
background="light"
|
15
|
+
borderNone
|
16
|
+
{...props}
|
17
|
+
>
|
18
|
+
<SkeletonLoading
|
19
|
+
color="white"
|
20
|
+
{...props}
|
21
|
+
/>
|
22
|
+
</Card>
|
23
|
+
</div>
|
24
|
+
)
|
25
|
+
|
26
|
+
export default SkeletonLoadingColor
|
@@ -0,0 +1 @@
|
|
1
|
+
The SkeletonLoading component has a default and a white `color` variant.
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= pb_rails("skeleton_loading") %>
|
@@ -0,0 +1,59 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import { Card, SkeletonLoading } from "playbook-ui"
|
3
|
+
|
4
|
+
|
5
|
+
const SkeletonLoadingHeightWidth = (props) => (
|
6
|
+
<div>
|
7
|
+
<SkeletonLoading
|
8
|
+
height="100px"
|
9
|
+
width="50%"
|
10
|
+
{...props}
|
11
|
+
/>
|
12
|
+
<SkeletonLoading
|
13
|
+
gap="md"
|
14
|
+
height="20px"
|
15
|
+
marginY="md"
|
16
|
+
stack="3"
|
17
|
+
width="50px"
|
18
|
+
{...props}
|
19
|
+
/>
|
20
|
+
<Card htmlOptions={{ style: { height: '200px', width: '100%' }}}
|
21
|
+
marginBottom="md"
|
22
|
+
padding="none"
|
23
|
+
>
|
24
|
+
<SkeletonLoading
|
25
|
+
borderRadius="md"
|
26
|
+
gap="xl"
|
27
|
+
height="50%"
|
28
|
+
width="300px"
|
29
|
+
{...props}
|
30
|
+
/>
|
31
|
+
</Card>
|
32
|
+
<Card htmlOptions={{ style: { height: '200px', width: '100%' }}}
|
33
|
+
padding="none"
|
34
|
+
>
|
35
|
+
<SkeletonLoading
|
36
|
+
borderRadius="md"
|
37
|
+
gap="xl"
|
38
|
+
height="30%"
|
39
|
+
stack="2"
|
40
|
+
width="70%"
|
41
|
+
{...props}
|
42
|
+
/>
|
43
|
+
</Card>
|
44
|
+
<SkeletonLoading
|
45
|
+
height="150px"
|
46
|
+
marginY="md"
|
47
|
+
width="150px"
|
48
|
+
{...props}
|
49
|
+
/>
|
50
|
+
<SkeletonLoading
|
51
|
+
borderRadius="rounded"
|
52
|
+
height="150px"
|
53
|
+
width="150px"
|
54
|
+
{...props}
|
55
|
+
/>
|
56
|
+
</div>
|
57
|
+
)
|
58
|
+
|
59
|
+
export default SkeletonLoadingHeightWidth
|
@@ -0,0 +1,3 @@
|
|
1
|
+
The `height` and `width` props accept pixel and percentage values. If using a percentage for `height`, the parent container must have a set height.
|
2
|
+
|
3
|
+
Set the `height` and `width` props to the same value to make a square. A `rounded` borderRadius will make a square a circle. If using percentages to make a square, your parent container must also be a square.
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import { SkeletonLoading } from "playbook-ui"
|
3
|
+
|
4
|
+
|
5
|
+
const SkeletonLoadingLayout = (props) => (
|
6
|
+
<div>
|
7
|
+
<SkeletonLoading
|
8
|
+
stack="5"
|
9
|
+
{...props}
|
10
|
+
/>
|
11
|
+
<SkeletonLoading
|
12
|
+
gap="md"
|
13
|
+
paddingTop="xl"
|
14
|
+
stack="3"
|
15
|
+
{...props}
|
16
|
+
/>
|
17
|
+
</div>
|
18
|
+
)
|
19
|
+
|
20
|
+
export default SkeletonLoadingLayout
|
@@ -0,0 +1,3 @@
|
|
1
|
+
Use the `stack` and `gap` props in conjunction to layer multiple Skeleton loading bars on top of each other.
|
2
|
+
|
3
|
+
`stack` accepts a number that correlates to the number of rows (1 is default), and `gap` accepts a portion of our [spacing props](https://playbook.powerapp.cloud/visual_guidelines/spacing) (`xxs` as default, `xs`, `sm`, `md`, `lg`, `xl`, `xxl`) to set the pixel distance between each row. `gap` will not do anything if there is no corresponding `stack` prop set.
|
@@ -0,0 +1,13 @@
|
|
1
|
+
examples:
|
2
|
+
|
3
|
+
rails:
|
4
|
+
# - skeleton_loading_default: Default
|
5
|
+
|
6
|
+
|
7
|
+
react:
|
8
|
+
- skeleton_loading_default: Default
|
9
|
+
- skeleton_loading_color: Color
|
10
|
+
- skeleton_loading_layout: Layout
|
11
|
+
- skeleton_loading_border_radius: Border Radius
|
12
|
+
- skeleton_loading_height_width: Height & Width
|
13
|
+
|
@@ -0,0 +1,5 @@
|
|
1
|
+
export { default as SkeletonLoadingDefault } from './_skeleton_loading_default.jsx'
|
2
|
+
export { default as SkeletonLoadingColor } from './_skeleton_loading_color.jsx'
|
3
|
+
export { default as SkeletonLoadingLayout } from './_skeleton_loading_layout.jsx'
|
4
|
+
export { default as SkeletonLoadingBorderRadius } from './_skeleton_loading_border_radius.jsx'
|
5
|
+
export { default as SkeletonLoadingHeightWidth } from './_skeleton_loading_height_width.jsx'
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<!-- Go to pb_content_tag definition in kit_base.rb for usage information. Commented out options are default (showing the default shape), and each can be deleted if not customizing that param. -->
|
2
|
+
<!-- If using nonstandard params please un-comment out and replace with your custom params. -->
|
3
|
+
<%= pb_content_tag(
|
4
|
+
# :div,
|
5
|
+
# aria: object.aria,
|
6
|
+
# class: object.classname,
|
7
|
+
# data: object.data,
|
8
|
+
# id: object.id,
|
9
|
+
# **combined_html_options
|
10
|
+
) do %>
|
11
|
+
<span>SKELETON_LOADING CONTENT</span>
|
12
|
+
<% end %>
|