playbook_ui 10.23.0.pre.alpha2 → 10.23.0.pre.cachetest
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 +0 -1
- data/app/pb_kits/playbook/index.js +3 -0
- data/app/pb_kits/playbook/pb_avatar/{_avatar.tsx → _avatar.jsx} +14 -13
- data/app/pb_kits/playbook/pb_avatar/_avatar.scss +2 -2
- data/app/pb_kits/playbook/pb_avatar/avatar.rb +1 -1
- data/app/pb_kits/playbook/pb_avatar/avatar.test.js +1 -1
- data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.jsx +1 -1
- data/app/pb_kits/playbook/pb_background/_background.jsx +3 -8
- data/app/pb_kits/playbook/pb_background/_background.scss +8 -24
- data/app/pb_kits/playbook/pb_background/background.rb +6 -6
- data/app/pb_kits/playbook/pb_background/docs/_background_image.html.erb +2 -50
- data/app/pb_kits/playbook/pb_background/docs/_background_image.jsx +28 -71
- data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx +1 -5
- data/app/pb_kits/playbook/pb_bar_graph/bar_graph.rb +0 -1
- data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumb_item.jsx +1 -1
- data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumbs.jsx +1 -1
- data/app/pb_kits/playbook/pb_button/_button.jsx +4 -8
- data/app/pb_kits/playbook/pb_button/_button.scss +1 -18
- data/app/pb_kits/playbook/pb_button/button.rb +3 -13
- data/app/pb_kits/playbook/pb_button/button.test.js +0 -13
- data/app/pb_kits/playbook/pb_button/docs/_button_accessibility.html.erb +1 -1
- data/app/pb_kits/playbook/pb_button/docs/example.yml +0 -4
- data/app/pb_kits/playbook/pb_button/docs/index.js +0 -2
- data/app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx +1 -1
- data/app/pb_kits/playbook/pb_caption/_caption.jsx +1 -1
- data/app/pb_kits/playbook/pb_card/_card.jsx +1 -1
- data/app/pb_kits/playbook/pb_card/card.html.erb +1 -1
- data/app/pb_kits/playbook/pb_card/card.rb +0 -88
- data/app/pb_kits/playbook/pb_card/card_body.rb +1 -1
- data/app/pb_kits/playbook/pb_checkbox/_checkbox.jsx +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.jsx +0 -3
- data/app/pb_kits/playbook/pb_circle_chart/circle_chart.rb +0 -1
- data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx +1 -1
- data/app/pb_kits/playbook/pb_collapsible/_collapsible.jsx +1 -1
- data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleContent.jsx +1 -1
- data/app/pb_kits/playbook/pb_currency/_currency.jsx +3 -24
- data/app/pb_kits/playbook/pb_currency/currency.rb +3 -12
- data/app/pb_kits/playbook/pb_currency/docs/_currency_variants.html.erb +1 -1
- data/app/pb_kits/playbook/pb_currency/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_currency/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.jsx +1 -1
- data/app/pb_kits/playbook/pb_dialog/_dialog.jsx +1 -1
- data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_body.jsx +1 -1
- data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_footer.jsx +1 -1
- data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_header.jsx +1 -1
- data/app/pb_kits/playbook/pb_distribution_bar/_distribution_bar.jsx +1 -1
- data/app/pb_kits/playbook/pb_file_upload/_file_upload.jsx +10 -17
- data/app/pb_kits/playbook/pb_filter/Filter/FilterBackground.jsx +1 -1
- data/app/pb_kits/playbook/pb_flex/_flex.jsx +1 -1
- data/app/pb_kits/playbook/pb_flex/_flex_item.jsx +1 -1
- data/app/pb_kits/playbook/pb_flex/docs/_flex_align.jsx +1 -1
- data/app/pb_kits/playbook/pb_flex/flex_item.rb +24 -2
- data/app/pb_kits/playbook/pb_form_group/_form_group.jsx +1 -1
- data/app/pb_kits/playbook/pb_form_group/_form_group.scss +0 -2
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.jsx +2 -2
- data/app/pb_kits/playbook/pb_gauge/_gauge.jsx +0 -3
- data/app/pb_kits/playbook/pb_gauge/gauge.rb +0 -1
- data/app/pb_kits/playbook/pb_highlight/_highlight.jsx +1 -1
- data/app/pb_kits/playbook/pb_icon/_icon.jsx +1 -1
- data/app/pb_kits/playbook/pb_icon/icon.rb +1 -1
- data/app/pb_kits/playbook/pb_icon_stat_value/_icon_stat_value.jsx +1 -1
- data/app/pb_kits/playbook/pb_image/{_image.tsx → _image.jsx} +15 -11
- data/app/pb_kits/playbook/pb_image/_image.scss +3 -3
- data/app/pb_kits/playbook/pb_image/docs/{_default_image.tsx → _default_image.jsx} +1 -1
- data/app/pb_kits/playbook/pb_image/docs/index.js +4 -4
- data/app/pb_kits/playbook/pb_image/image.rb +1 -1
- data/app/pb_kits/playbook/pb_image/image.test.js +1 -1
- data/app/pb_kits/playbook/pb_label_pill/_label_pill.jsx +1 -1
- data/app/pb_kits/playbook/pb_layout/_layout.jsx +1 -1
- data/app/pb_kits/playbook/pb_line_graph/_line_graph.jsx +1 -5
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_height.jsx +0 -1
- data/app/pb_kits/playbook/pb_line_graph/line_graph.rb +0 -1
- data/app/pb_kits/playbook/pb_list/_list.jsx +1 -1
- data/app/pb_kits/playbook/pb_list/_list_item.jsx +1 -1
- data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.jsx +1 -1
- data/app/pb_kits/playbook/pb_online_status/{_online_status.tsx → _online_status.jsx} +6 -4
- data/app/pb_kits/playbook/pb_passphrase/_passphrase.jsx +1 -2
- data/app/pb_kits/playbook/pb_pill/_pill.jsx +1 -1
- data/app/pb_kits/playbook/pb_popover/_popover.jsx +5 -3
- data/app/pb_kits/playbook/pb_popover/docs/_popover_close.html.erb +7 -7
- data/app/pb_kits/playbook/pb_popover/index.js +9 -4
- data/app/pb_kits/playbook/pb_popover/popover.html.erb +1 -1
- data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.jsx +1 -1
- data/app/pb_kits/playbook/pb_progress_step/_progress_step.jsx +1 -1
- data/app/pb_kits/playbook/pb_radio/_radio.jsx +1 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.jsx +93 -83
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_default.html.erb +1 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_default.jsx +8 -15
- data/app/pb_kits/playbook/pb_table/_table.jsx +1 -1
- data/app/pb_kits/playbook/pb_table/_table_row.jsx +1 -1
- data/app/pb_kits/playbook/pb_text_input/_text_input.jsx +1 -1
- data/app/pb_kits/playbook/pb_text_input/_text_input.scss +1 -1
- data/app/pb_kits/playbook/pb_text_input/text_input.test.js +0 -14
- data/app/pb_kits/playbook/pb_textarea/_textarea.jsx +0 -1
- data/app/pb_kits/playbook/pb_time/_time.jsx +1 -1
- data/app/pb_kits/playbook/pb_title/_title.jsx +1 -1
- data/app/pb_kits/playbook/pb_toggle/_toggle.jsx +1 -1
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.jsx +1 -1
- data/app/pb_kits/playbook/pb_user_badge/_user_badge.jsx +1 -1
- data/app/pb_kits/playbook/pb_walkthrough/_walkthrough.jsx +1 -1
- data/app/pb_kits/playbook/pb_weekday_stacked/_weekday_stacked.jsx +1 -1
- data/app/pb_kits/playbook/plugins/pb_chart.js +4 -8
- data/app/pb_kits/playbook/types.js +4 -0
- data/app/pb_kits/playbook/utilities/globalProps.js +97 -0
- data/app/pb_kits/playbook/utilities/{props.ts → props.js} +7 -9
- data/lib/playbook/classnames.rb +0 -11
- data/lib/playbook/kit_base.rb +0 -22
- data/lib/playbook/version.rb +2 -2
- metadata +9 -42
- data/app/pb_kits/playbook/pb_background/docs/_background_image.md +0 -1
- data/app/pb_kits/playbook/pb_button/docs/_button_form.html.erb +0 -1
- data/app/pb_kits/playbook/pb_button/docs/_button_form.jsx +0 -14
- data/app/pb_kits/playbook/pb_button/docs/_button_size.html.erb +0 -3
- data/app/pb_kits/playbook/pb_button/docs/_button_size.jsx +0 -26
- data/app/pb_kits/playbook/pb_button/docs/_button_size.md +0 -1
- data/app/pb_kits/playbook/pb_currency/currency.test.js +0 -35
- data/app/pb_kits/playbook/pb_currency/docs/_currency_abbreviated.html.erb +0 -27
- data/app/pb_kits/playbook/pb_currency/docs/_currency_abbreviated.jsx +0 -44
- data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.js +0 -215
- data/app/pb_kits/playbook/pb_file_upload/fileupload.test.js +0 -40
- data/app/pb_kits/playbook/utilities/_align_content.scss +0 -29
- data/app/pb_kits/playbook/utilities/_align_items.scss +0 -35
- data/app/pb_kits/playbook/utilities/_align_self.scss +0 -29
- data/app/pb_kits/playbook/utilities/_flex.scss +0 -15
- data/app/pb_kits/playbook/utilities/_flex_direction.scss +0 -19
- data/app/pb_kits/playbook/utilities/_flex_grow.scss +0 -9
- data/app/pb_kits/playbook/utilities/_flex_shrink.scss +0 -9
- data/app/pb_kits/playbook/utilities/_flex_wrap.scss +0 -14
- data/app/pb_kits/playbook/utilities/_flexbox.scss +0 -11
- data/app/pb_kits/playbook/utilities/_justify_content.scss +0 -23
- data/app/pb_kits/playbook/utilities/_justify_self.scss +0 -19
- data/app/pb_kits/playbook/utilities/_order.scss +0 -55
- data/app/pb_kits/playbook/utilities/globalProps.ts +0 -274
- data/lib/playbook/align_content.rb +0 -29
- data/lib/playbook/align_items.rb +0 -29
- data/lib/playbook/align_self.rb +0 -29
- data/lib/playbook/flex.rb +0 -29
- data/lib/playbook/flex_direction.rb +0 -29
- data/lib/playbook/flex_grow.rb +0 -29
- data/lib/playbook/flex_shrink.rb +0 -29
- data/lib/playbook/flex_wrap.rb +0 -29
- data/lib/playbook/justify_content.rb +0 -29
- data/lib/playbook/justify_self.rb +0 -29
- data/lib/playbook/order.rb +0 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d85218c29eb499b6f71d42d3b99307a6f5563671d4af53e4e3ac380779049bd
|
4
|
+
data.tar.gz: a8e220e1252b1b21fa92adbf601532c483164950169f7d6ce79e8d6e1f0e8b1e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 986b7423cafa276bb7931cec9e32fcb57867f7a303b810babcc9524c0591314da7fcdc52f73c89726115c1543e553eec856b3c2ed73b0af9c53b3cc88ffa0c77
|
7
|
+
data.tar.gz: 0f245ee82c1ba4b42c6daa7a9444d7106f022a1510f6f2b7473430a2cddf6c6981d9a48f17bebc902990dca4829e84ebb5c1389d0436229ca1c7332418d1a370
|
@@ -118,3 +118,6 @@ export { default as PbTable } from './pb_table'
|
|
118
118
|
export { default as PbTextarea } from './pb_textarea'
|
119
119
|
export { default as PbTooltip } from './pb_tooltip'
|
120
120
|
export { default as PbTypeahead } from './pb_typeahead'
|
121
|
+
|
122
|
+
// eslint-disable-next-line no-console
|
123
|
+
console.log('CACHE BUSTED')
|
@@ -1,5 +1,8 @@
|
|
1
|
+
/* @flow */
|
2
|
+
|
1
3
|
import React, { useState } from 'react'
|
2
4
|
import classnames from 'classnames'
|
5
|
+
import { map } from 'lodash'
|
3
6
|
|
4
7
|
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
5
8
|
import { globalProps } from '../utilities/globalProps'
|
@@ -8,9 +11,9 @@ import Image from '../pb_image/_image'
|
|
8
11
|
import OnlineStatus from '../pb_online_status/_online_status'
|
9
12
|
|
10
13
|
type AvatarProps = {
|
11
|
-
aria?:
|
14
|
+
aria?: object,
|
12
15
|
className?: string,
|
13
|
-
data?:
|
16
|
+
data?: object,
|
14
17
|
dark?: boolean,
|
15
18
|
id?: string,
|
16
19
|
imageAlt?: string,
|
@@ -20,8 +23,8 @@ type AvatarProps = {
|
|
20
23
|
status: "away" | "offline" | "online",
|
21
24
|
}
|
22
25
|
|
23
|
-
const firstTwoInitials = (name
|
24
|
-
name.split(/\s/)
|
26
|
+
const firstTwoInitials = (name) =>
|
27
|
+
map(name.split(/\s/), (name) => name[0])
|
25
28
|
.join('')
|
26
29
|
.substring(0, 2)
|
27
30
|
|
@@ -38,10 +41,10 @@ const Avatar = (props: AvatarProps) => {
|
|
38
41
|
status = null,
|
39
42
|
dark = false,
|
40
43
|
} = props
|
41
|
-
const dataProps
|
42
|
-
const ariaProps
|
44
|
+
const dataProps = buildDataProps(data)
|
45
|
+
const ariaProps = buildAriaProps(aria)
|
43
46
|
const classes = classnames(
|
44
|
-
buildCss('pb_avatar_kit',
|
47
|
+
buildCss('pb_avatar_kit', size),
|
45
48
|
globalProps(props),
|
46
49
|
className
|
47
50
|
)
|
@@ -52,8 +55,6 @@ const Avatar = (props: AvatarProps) => {
|
|
52
55
|
const [error, setError] = useState(false)
|
53
56
|
const handleError = () => setError(true)
|
54
57
|
|
55
|
-
const canShowImage = imageUrl && !error
|
56
|
-
|
57
58
|
return (
|
58
59
|
<div
|
59
60
|
{...ariaProps}
|
@@ -65,21 +66,21 @@ const Avatar = (props: AvatarProps) => {
|
|
65
66
|
className="avatar_wrapper"
|
66
67
|
data-initials={initials}
|
67
68
|
>
|
68
|
-
{
|
69
|
+
<If condition={imageUrl && !error}>
|
69
70
|
<Image
|
70
71
|
alt={imageAlt}
|
71
72
|
onError={handleError}
|
72
73
|
url={imageUrl}
|
73
74
|
/>
|
74
|
-
|
75
|
+
</If>
|
75
76
|
</div>
|
76
|
-
{status
|
77
|
+
<If condition={status}>
|
77
78
|
<OnlineStatus
|
78
79
|
className={`size_${size}`}
|
79
80
|
dark={dark}
|
80
81
|
status={status}
|
81
82
|
/>
|
82
|
-
|
83
|
+
</If>
|
83
84
|
</div>
|
84
85
|
)
|
85
86
|
}
|
@@ -16,8 +16,8 @@ $avatar-sizes: (
|
|
16
16
|
position: relative;
|
17
17
|
|
18
18
|
@each $name, $size in $avatar-sizes {
|
19
|
-
&[class*=
|
20
|
-
&[class*=
|
19
|
+
&[class*=_#{$name}],
|
20
|
+
&[class*=_#{$name}_thumb] {
|
21
21
|
width: $size;
|
22
22
|
height: $size;
|
23
23
|
object-fit: cover;
|
@@ -22,7 +22,7 @@ test('loads the given image url and name', () => {
|
|
22
22
|
const image = screen.getByAltText(imageAlt)
|
23
23
|
const initials = name.split(/\s/)[0].substr(0, 1) + name.split(/\s/)[1].substr(0, 1)
|
24
24
|
|
25
|
-
expect(kit).toHaveClass('
|
25
|
+
expect(kit).toHaveClass('pb_avatar_kit_md')
|
26
26
|
expect(kit).toHaveAttribute('data-initials', initials)
|
27
27
|
expect(image).toHaveAttribute('data-src', imageUrl)
|
28
28
|
expect(image).toHaveAttribute('src', imageUrl)
|
@@ -8,7 +8,7 @@ import {
|
|
8
8
|
buildCss,
|
9
9
|
buildDataProps,
|
10
10
|
} from '../utilities/props'
|
11
|
-
import { globalProps } from '../utilities/globalProps'
|
11
|
+
import { globalProps } from '../utilities/globalProps.js'
|
12
12
|
|
13
13
|
import Avatar from '../pb_avatar/_avatar'
|
14
14
|
import Icon from '../pb_icon/_icon'
|
@@ -3,10 +3,9 @@
|
|
3
3
|
import React from 'react'
|
4
4
|
import classnames from 'classnames'
|
5
5
|
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
6
|
-
import { globalProps } from '../utilities/globalProps'
|
6
|
+
import { globalProps } from '../utilities/globalProps.js'
|
7
7
|
|
8
8
|
type BackgroundProps = {
|
9
|
-
alt?: string,
|
10
9
|
aria?: object,
|
11
10
|
backgroundColor?: 'gradient' | 'dark' | 'light' | 'white' | 'success' | 'warning' | 'error' | 'info' | 'neutral' | 'primary' | 'category_1' | 'category_2' | 'category_3' | 'category_4' | 'category_5' | 'category_6' | 'category_7' | 'category_8' | 'category_9' | 'category_10' | 'category_11' | 'category_12' | 'category_13' | 'category_14' | 'category_15' | 'category_16' | 'category_17' | 'category_18' | 'category_19' | 'category_20' | 'category_21',
|
12
11
|
children?: array<React.ReactNode> | React.ReactNode,
|
@@ -16,12 +15,10 @@ type BackgroundProps = {
|
|
16
15
|
imageUrl?: string,
|
17
16
|
padding?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl',
|
18
17
|
tag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'div',
|
19
|
-
transition?: 'fade' | 'blur' | 'scale',
|
20
18
|
}
|
21
19
|
|
22
20
|
const Background = (props: BackgroundProps) => {
|
23
21
|
const {
|
24
|
-
alt = '',
|
25
22
|
aria = {},
|
26
23
|
backgroundColor = 'light',
|
27
24
|
children,
|
@@ -30,24 +27,22 @@ const Background = (props: BackgroundProps) => {
|
|
30
27
|
id,
|
31
28
|
imageUrl = '',
|
32
29
|
tag = 'div',
|
33
|
-
transition = '',
|
34
30
|
} = props
|
35
31
|
|
36
32
|
const ariaProps = buildAriaProps(aria)
|
37
33
|
const dataProps = buildDataProps(data)
|
38
34
|
|
35
|
+
const classes = classnames(buildCss('pb_background_kit'), globalProps(props), `pb_background_color_${backgroundColor}`, className)
|
36
|
+
const Tag = `${tag}`
|
39
37
|
const backgroundStyle = {
|
40
38
|
backgroundImage: `url(${imageUrl})`,
|
41
39
|
backgroundSize: 'cover',
|
42
40
|
}
|
43
|
-
const classes = classnames(buildCss('pb_background_kit'), 'lazyload', backgroundStyle, transition, globalProps(props), `pb_background_color_${backgroundColor}`, className)
|
44
|
-
const Tag = `${tag}`
|
45
41
|
|
46
42
|
return (
|
47
43
|
<>
|
48
44
|
<If condition={imageUrl}>
|
49
45
|
<Tag
|
50
|
-
alt={alt}
|
51
46
|
style={backgroundStyle}
|
52
47
|
{...ariaProps}
|
53
48
|
{...dataProps}
|
@@ -22,30 +22,14 @@ $background_colors: map-merge($additional_colors, $merge_kits2);
|
|
22
22
|
}
|
23
23
|
};
|
24
24
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
transition: opacity 400ms ease-in;
|
30
|
-
}
|
31
|
-
}
|
32
|
-
|
33
|
-
&.blur {
|
34
|
-
filter: blur(5px);
|
35
|
-
&.lazyloaded {
|
36
|
-
-webkit-filter: blur(0);
|
37
|
-
filter: blur(0);
|
38
|
-
transition: filter 400ms ease-in;
|
39
|
-
}
|
25
|
+
.blur_up {
|
26
|
+
-webkit-filter: blur(6px);
|
27
|
+
filter: blur(6px);
|
28
|
+
transition: filter 550ms, -webkit-filter 550ms;
|
40
29
|
}
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
&.lazyloaded {
|
46
|
-
opacity: 1;
|
47
|
-
transform: scale(1);
|
48
|
-
transition: 700ms ease-in;
|
49
|
-
}
|
30
|
+
|
31
|
+
.blur_up.lazyloaded {
|
32
|
+
-webkit-filter: blur(0);
|
33
|
+
filter: blur(0);
|
50
34
|
}
|
51
35
|
}
|
@@ -12,18 +12,18 @@ module Playbook
|
|
12
12
|
values: %w[h1 h2 h3 h4 h5 h6 p div span],
|
13
13
|
default: "div"
|
14
14
|
|
15
|
-
prop :transition, type: Playbook::Props::Enum,
|
16
|
-
values: ["blur", "fade", "scale", nil],
|
17
|
-
default: nil
|
18
|
-
|
19
15
|
def classname
|
20
|
-
generate_classname("pb_background_kit", image_classname, separator: " ")
|
16
|
+
generate_classname("pb_background_kit", image_classname, background_color_classname, separator: " ")
|
21
17
|
end
|
22
18
|
|
23
19
|
private
|
24
20
|
|
25
21
|
def image_classname
|
26
|
-
image_url.present? ? "lazyload
|
22
|
+
image_url.present? ? "lazyload blur_up" : ""
|
23
|
+
end
|
24
|
+
|
25
|
+
def background_color_classname
|
26
|
+
!image_url.present? ? "pb_background_color_#{background_color}" : ""
|
27
27
|
end
|
28
28
|
end
|
29
29
|
end
|
@@ -1,5 +1,5 @@
|
|
1
|
-
<%= pb_rails("background", props: {
|
2
|
-
<%= pb_rails("flex", props: { horizontal: "center", orientation: "column"
|
1
|
+
<%= pb_rails("background", props: { image_url: "https://images.unsplash.com/photo-1528459801416-a9e53bbf4e17?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1000&q=80", padding: "lg" }) do %>
|
2
|
+
<%= pb_rails("flex", props: { horizontal: "center", orientation: "column" }) do %>
|
3
3
|
<%= pb_rails("flex/flex_item") do %>
|
4
4
|
<%= pb_rails("title", props: { dark: true, size: 1, text: "Background Kit Image" })%>
|
5
5
|
<% end %>
|
@@ -11,51 +11,3 @@
|
|
11
11
|
<% end %>
|
12
12
|
<% end %>
|
13
13
|
<% end %>
|
14
|
-
|
15
|
-
|
16
|
-
<%= pb_rails("flex", props: { margin_top: "lg" }) do %>
|
17
|
-
<%= pb_rails("flex/flex_item", props: {fixed_size: "250px"}) do %>
|
18
|
-
<%= pb_rails("select", props: {
|
19
|
-
id: "transition-dropdown",
|
20
|
-
label: "",
|
21
|
-
blank_selection: "Select a Transition...",
|
22
|
-
options: [
|
23
|
-
{
|
24
|
-
value: 'fade',
|
25
|
-
},
|
26
|
-
{
|
27
|
-
value: 'blur',
|
28
|
-
},
|
29
|
-
{
|
30
|
-
value: 'scale',
|
31
|
-
},
|
32
|
-
]
|
33
|
-
}) %>
|
34
|
-
<% end %>
|
35
|
-
<% end %>
|
36
|
-
|
37
|
-
<script>
|
38
|
-
window.addEventListener('DOMContentLoaded', () => {
|
39
|
-
const transitionDropdown = document.querySelector("#transition-dropdown")
|
40
|
-
var option = ''
|
41
|
-
|
42
|
-
transitionDropdown.addEventListener('change', function() {
|
43
|
-
if (this.value === '') {
|
44
|
-
(transitionDropdown).className = (transitionDropdown).className + ' _disabled'
|
45
|
-
} else {
|
46
|
-
(transitionDropdown).removeAttribute("disabled");
|
47
|
-
(transitionDropdown).className = (transitionDropdown)
|
48
|
-
option = this.value
|
49
|
-
}
|
50
|
-
});
|
51
|
-
|
52
|
-
const updateTransition = (transition) => {
|
53
|
-
const imageTransition = document.querySelector('.background-image')
|
54
|
-
imageTransition.classList.remove("fade", "blur", "scale", "lazyloaded")
|
55
|
-
imageTransition.classList.add(transition, "lazyload")
|
56
|
-
}
|
57
|
-
(transitionDropdown).addEventListener('change', function() {
|
58
|
-
updateTransition(option)
|
59
|
-
})
|
60
|
-
});
|
61
|
-
</script>
|
@@ -1,79 +1,36 @@
|
|
1
|
-
import React
|
1
|
+
import React from 'react'
|
2
2
|
import { Background } from '../..'
|
3
|
-
import { Card, Flex, FlexItem,
|
3
|
+
import { Card, Flex, FlexItem, Title } from '../..'
|
4
4
|
|
5
|
-
const BackgroundImage = (props) =>
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
return (
|
25
|
-
<>
|
26
|
-
<Background
|
27
|
-
alt="colorful background"
|
28
|
-
className="background lazyload"
|
29
|
-
imageUrl="https://images.unsplash.com/photo-1528459801416-a9e53bbf4e17?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1000&q=80"
|
30
|
-
transition={transition}
|
5
|
+
const BackgroundImage = (props) => (
|
6
|
+
<Background imageUrl="https://images.unsplash.com/photo-1528459801416-a9e53bbf4e17?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1000&q=80">
|
7
|
+
<Flex
|
8
|
+
orientation="column"
|
9
|
+
vertical="center"
|
10
|
+
{...props}
|
11
|
+
>
|
12
|
+
<FlexItem>
|
13
|
+
<Title
|
14
|
+
dark
|
15
|
+
padding="lg"
|
16
|
+
size={1}
|
17
|
+
text="Background Kit Image"
|
18
|
+
{...props}
|
19
|
+
/>
|
20
|
+
</FlexItem>
|
21
|
+
<FlexItem
|
22
|
+
padding="lg"
|
31
23
|
{...props}
|
32
24
|
>
|
33
|
-
<
|
34
|
-
|
35
|
-
vertical="center"
|
25
|
+
<Card
|
26
|
+
shadow="deepest"
|
36
27
|
{...props}
|
37
28
|
>
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
{...props}
|
45
|
-
/>
|
46
|
-
</FlexItem>
|
47
|
-
<FlexItem
|
48
|
-
padding="lg"
|
49
|
-
{...props}
|
50
|
-
>
|
51
|
-
<Card
|
52
|
-
shadow="deepest"
|
53
|
-
{...props}
|
54
|
-
>
|
55
|
-
{
|
56
|
-
'We cannot seek achievement for ourselves and forget about progress and prosperity for our community... Our ambitions must be broad enough to include the aspirations and needs of others, for their sakes and for our own. - Cesar Chavez'
|
57
|
-
}
|
58
|
-
</Card>
|
59
|
-
</FlexItem>
|
60
|
-
</Flex>
|
61
|
-
</Background>
|
62
|
-
<Flex marginTop="xl">
|
63
|
-
<FlexItem fixedSize="250px">
|
64
|
-
<Select
|
65
|
-
blankSelection="Select a Transition..."
|
66
|
-
label=""
|
67
|
-
name="dropdown"
|
68
|
-
onChange={handleTransition}
|
69
|
-
options={options}
|
70
|
-
transition={transition}
|
71
|
-
{...props}
|
72
|
-
/>
|
73
|
-
</FlexItem>
|
74
|
-
</Flex>
|
75
|
-
</>
|
76
|
-
)
|
77
|
-
}
|
29
|
+
{'We cannot seek achievement for ourselves and forget about progress and prosperity for our community... Our ambitions must be broad enough to include the aspirations and needs of others, for their sakes and for our own. - Cesar Chavez'}
|
30
|
+
</Card>
|
31
|
+
</FlexItem>
|
32
|
+
</Flex>
|
33
|
+
</Background>
|
34
|
+
)
|
78
35
|
|
79
36
|
export default BackgroundImage
|
@@ -3,12 +3,11 @@
|
|
3
3
|
import React from 'react'
|
4
4
|
import classnames from 'classnames'
|
5
5
|
|
6
|
-
import { globalProps } from '../utilities/globalProps'
|
6
|
+
import { globalProps } from '../utilities/globalProps.js'
|
7
7
|
import pbChart from '../plugins/pb_chart'
|
8
8
|
|
9
9
|
type BarGraphProps = {
|
10
10
|
axisTitle: string,
|
11
|
-
dark?: Boolean,
|
12
11
|
xAxisCategories: array,
|
13
12
|
yAxisMin: number,
|
14
13
|
yAxisMax: number,
|
@@ -31,7 +30,6 @@ type BarGraphProps = {
|
|
31
30
|
export default class BarGraph extends React.Component<BarGraphProps> {
|
32
31
|
static defaultProps = {
|
33
32
|
className: 'pb_bar_graph',
|
34
|
-
dark: false,
|
35
33
|
type: 'column',
|
36
34
|
legend: false,
|
37
35
|
toggleLegendClick: true,
|
@@ -40,7 +38,6 @@ export default class BarGraph extends React.Component<BarGraphProps> {
|
|
40
38
|
componentDidMount() {
|
41
39
|
const {
|
42
40
|
axisTitle,
|
43
|
-
dark,
|
44
41
|
xAxisCategories,
|
45
42
|
yAxisMin,
|
46
43
|
yAxisMax,
|
@@ -59,7 +56,6 @@ export default class BarGraph extends React.Component<BarGraphProps> {
|
|
59
56
|
|
60
57
|
new pbChart(`.${className}`, {
|
61
58
|
axisTitle: axisTitle,
|
62
|
-
dark,
|
63
59
|
chartData: chartData,
|
64
60
|
colors: colors,
|
65
61
|
id: id,
|
@@ -3,7 +3,7 @@
|
|
3
3
|
import React from 'react'
|
4
4
|
import classnames from 'classnames'
|
5
5
|
import { buildAriaProps, buildDataProps } from '../utilities/props'
|
6
|
-
import { globalProps } from '../utilities/globalProps'
|
6
|
+
import { globalProps } from '../utilities/globalProps.js'
|
7
7
|
|
8
8
|
import Icon from '../pb_icon/_icon.jsx'
|
9
9
|
|
@@ -15,7 +15,6 @@ type ButtonPropTypes = {
|
|
15
15
|
data?: object,
|
16
16
|
disabled?: boolean,
|
17
17
|
fixedWidth?: boolean,
|
18
|
-
form?: string,
|
19
18
|
fullWidth?: boolean,
|
20
19
|
icon?: string,
|
21
20
|
id?: string,
|
@@ -23,7 +22,7 @@ type ButtonPropTypes = {
|
|
23
22
|
loading?: boolean,
|
24
23
|
newWindow?: boolean,
|
25
24
|
onClick?: EventHandler,
|
26
|
-
size
|
25
|
+
size: 'large' | 'medium' | 'small',
|
27
26
|
text?: string,
|
28
27
|
type: 'inline' | null,
|
29
28
|
htmlType: string | 'button',
|
@@ -37,19 +36,19 @@ const buttonClassName = (props: ButtonPropTypes) => {
|
|
37
36
|
disabled = false,
|
38
37
|
fullWidth = false,
|
39
38
|
loading = false,
|
39
|
+
size = null,
|
40
40
|
type = 'inline',
|
41
41
|
variant = 'primary',
|
42
|
-
size = null,
|
43
42
|
} = props
|
44
43
|
|
45
44
|
let className = 'pb_button_kit'
|
46
45
|
|
47
46
|
className += `${variant !== null ? `_${variant}` : ''}`
|
48
47
|
className += `${type !== null ? `_${type}` : ''}`
|
48
|
+
className += `${size !== null ? `_${size}` : ''}`
|
49
49
|
className += `${fullWidth ? '_block' : ''}`
|
50
50
|
className += disabled ? '_disabled' : '_enabled'
|
51
51
|
className += loading ? '_loading' : ''
|
52
|
-
className += `${size !== null ? ` size_${size}` : ''}`
|
53
52
|
|
54
53
|
return className
|
55
54
|
}
|
@@ -70,7 +69,6 @@ const Button = (props: ButtonPropTypes) => {
|
|
70
69
|
text,
|
71
70
|
htmlType = 'button',
|
72
71
|
value,
|
73
|
-
form = null
|
74
72
|
} = props
|
75
73
|
|
76
74
|
const ariaProps = buildAriaProps(aria)
|
@@ -108,7 +106,6 @@ const Button = (props: ButtonPropTypes) => {
|
|
108
106
|
className={css}
|
109
107
|
href={link}
|
110
108
|
id={id}
|
111
|
-
rel="noreferrer"
|
112
109
|
role="link"
|
113
110
|
target={newWindow ? '_blank' : null}
|
114
111
|
>
|
@@ -121,7 +118,6 @@ const Button = (props: ButtonPropTypes) => {
|
|
121
118
|
{...dataProps}
|
122
119
|
className={css}
|
123
120
|
disabled={disabled}
|
124
|
-
form={form}
|
125
121
|
id={id}
|
126
122
|
onClick={onClick}
|
127
123
|
role="button"
|
@@ -1,24 +1,7 @@
|
|
1
1
|
@import "./button_mixins";
|
2
2
|
|
3
|
-
|
4
|
-
"sm": 0.75rem,
|
5
|
-
"md": 0.875rem,
|
6
|
-
"lg": 1.125rem,
|
7
|
-
);
|
8
|
-
|
9
|
-
[class*=pb_button_kit]{
|
3
|
+
[class^=pb_button_kit]{
|
10
4
|
@include pb_button;
|
11
|
-
// Size =================
|
12
|
-
@each $name, $size in $pb_button_sizes {
|
13
|
-
&[class*=size_#{$name}] {
|
14
|
-
font-size: $size;
|
15
|
-
padding: calc(#{$size} / 2) calc(#{$size} * 2.42) !important;
|
16
|
-
@if $name == "sm" {
|
17
|
-
min-height: 0;
|
18
|
-
}
|
19
|
-
}
|
20
|
-
}
|
21
|
-
|
22
5
|
// Variants =================
|
23
6
|
&[class*=_primary] {
|
24
7
|
@include pb_button_primary;
|
@@ -18,10 +18,6 @@ module Playbook
|
|
18
18
|
prop :text
|
19
19
|
prop :type
|
20
20
|
prop :value
|
21
|
-
prop :size, type: Playbook::Props::Enum,
|
22
|
-
values: ["sm", "md", "lg", nil],
|
23
|
-
default: nil
|
24
|
-
prop :form, default: nil
|
25
21
|
|
26
22
|
def options
|
27
23
|
{
|
@@ -33,7 +29,6 @@ module Playbook
|
|
33
29
|
role: "button",
|
34
30
|
type: type,
|
35
31
|
value: value,
|
36
|
-
form: form,
|
37
32
|
}.compact
|
38
33
|
end
|
39
34
|
|
@@ -49,13 +44,12 @@ module Playbook
|
|
49
44
|
link ? "a" : "button"
|
50
45
|
end
|
51
46
|
|
47
|
+
private
|
48
|
+
|
52
49
|
def classname
|
53
|
-
|
54
|
-
button_class + size_class
|
50
|
+
generate_classname("pb_button_kit", variant, full_width_class, disabled_class, loading_class)
|
55
51
|
end
|
56
52
|
|
57
|
-
private
|
58
|
-
|
59
53
|
def disabled_class
|
60
54
|
disabled ? "disabled" : "enabled"
|
61
55
|
end
|
@@ -67,10 +61,6 @@ module Playbook
|
|
67
61
|
def loading_class
|
68
62
|
loading ? "loading" : nil
|
69
63
|
end
|
70
|
-
|
71
|
-
def size_class
|
72
|
-
size ? " size_#{size}" : ""
|
73
|
-
end
|
74
64
|
end
|
75
65
|
end
|
76
66
|
end
|
@@ -89,16 +89,3 @@ test('click event', async () => {
|
|
89
89
|
|
90
90
|
expect(screen.getByText('clicked button!')).toBeInTheDocument()
|
91
91
|
})
|
92
|
-
|
93
|
-
test('size prop', () => {
|
94
|
-
render(
|
95
|
-
<Button
|
96
|
-
data={{ testid: 'size-test' }}
|
97
|
-
size="sm"
|
98
|
-
/>
|
99
|
-
)
|
100
|
-
|
101
|
-
const kit = screen.getByTestId('size-test')
|
102
|
-
|
103
|
-
expect(kit).toHaveClass('pb_button_kit_primary_inline_enabled size_sm')
|
104
|
-
})
|
@@ -1 +1 @@
|
|
1
|
-
<%= pb_rails("button", props: { text: "Button with ARIA", aria: {label: "Go to Google"}, tag: "a", link: "http://google.com"}) %>
|
1
|
+
<%= pb_rails("button", props: { text: "Button with ARIA", aria: {label: "Go to Google"}, tag: "a", link: "http://google.com" }) %>
|