playbook_ui 10.18.1 → 10.18.2
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_button/_button.jsx +3 -3
- data/app/pb_kits/playbook/pb_button/_button.scss +0 -17
- data/app/pb_kits/playbook/pb_button/button.rb +3 -6
- data/app/pb_kits/playbook/pb_button/button.test.js +0 -13
- data/app/pb_kits/playbook/pb_button/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_button/docs/index.js +0 -1
- data/lib/playbook/version.rb +2 -2
- metadata +2 -5
- 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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e3cbc0cd92e9520cc384a83a63b0c7929db90e80ee3c14545f4cb59cea7e908
|
4
|
+
data.tar.gz: 3dbd612141159027a9da789d6a371cc8e8f2dccb9eaabff33f4c4ddea0c1e473
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5a15bb11978d3ac1e8bc98c067cfc39ca9012e8e995e758d5debe9073db0dad4b63b2222c6bf687bc739c5dfaca5e249e12b2b89345c711284000d177f00ea7
|
7
|
+
data.tar.gz: f5f8ad98e52dde53cd3c634757aa6ffeb9c9e6d53a4081c3861e839d1ab6b210d26dd63691be86d9c946cc7c6b4760f006b772e5bb3924be97de70d19f320ac1
|
@@ -22,7 +22,7 @@ type ButtonPropTypes = {
|
|
22
22
|
loading?: boolean,
|
23
23
|
newWindow?: boolean,
|
24
24
|
onClick?: EventHandler,
|
25
|
-
size
|
25
|
+
size: 'large' | 'medium' | 'small',
|
26
26
|
text?: string,
|
27
27
|
type: 'inline' | null,
|
28
28
|
htmlType: string | 'button',
|
@@ -36,16 +36,16 @@ const buttonClassName = (props: ButtonPropTypes) => {
|
|
36
36
|
disabled = false,
|
37
37
|
fullWidth = false,
|
38
38
|
loading = false,
|
39
|
+
size = null,
|
39
40
|
type = 'inline',
|
40
41
|
variant = 'primary',
|
41
|
-
size = null,
|
42
42
|
} = props
|
43
43
|
|
44
44
|
let className = 'pb_button_kit'
|
45
45
|
|
46
|
-
className += `${size !== null ? `_${size}` : ''}`
|
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' : ''
|
@@ -1,24 +1,7 @@
|
|
1
1
|
@import "./button_mixins";
|
2
2
|
|
3
|
-
$pb_button_sizes: (
|
4
|
-
"sm": 0.75rem,
|
5
|
-
"md": 0.875rem,
|
6
|
-
"lg": 1.125rem,
|
7
|
-
);
|
8
|
-
|
9
3
|
[class^=pb_button_kit]{
|
10
4
|
@include pb_button;
|
11
|
-
// Size =================
|
12
|
-
@each $name, $size in $pb_button_sizes {
|
13
|
-
&[class*=_#{$name}] {
|
14
|
-
font-size: $size;
|
15
|
-
padding: calc(#{$size} / 2) calc(#{$size} * 2.42) !important;
|
16
|
-
}
|
17
|
-
}
|
18
|
-
&[class*=_sm] {
|
19
|
-
min-height: 0;
|
20
|
-
}
|
21
|
-
|
22
5
|
// Variants =================
|
23
6
|
&[class*=_primary] {
|
24
7
|
@include pb_button_primary;
|
@@ -18,9 +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
21
|
|
25
22
|
def options
|
26
23
|
{
|
@@ -47,12 +44,12 @@ module Playbook
|
|
47
44
|
link ? "a" : "button"
|
48
45
|
end
|
49
46
|
|
47
|
+
private
|
48
|
+
|
50
49
|
def classname
|
51
|
-
generate_classname("pb_button_kit",
|
50
|
+
generate_classname("pb_button_kit", variant, full_width_class, disabled_class, loading_class)
|
52
51
|
end
|
53
52
|
|
54
|
-
private
|
55
|
-
|
56
53
|
def disabled_class
|
57
54
|
disabled ? "disabled" : "enabled"
|
58
55
|
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_sm_primary_inline_enabled')
|
104
|
-
})
|
@@ -7,7 +7,6 @@ examples:
|
|
7
7
|
- button_block_content: Button Block Content
|
8
8
|
- button_accessibility: Button Accessibility Options
|
9
9
|
- button_options: Button Additional Options
|
10
|
-
- button_size: Button Size
|
11
10
|
react:
|
12
11
|
- button_default: Button Variants
|
13
12
|
- button_full_width: Button Full Width
|
@@ -16,4 +15,3 @@ examples:
|
|
16
15
|
- button_block_content: Button Block Content
|
17
16
|
- button_accessibility: Button Accessibility Options
|
18
17
|
- button_options: Button Additional Options (onClick)
|
19
|
-
- button_size: Button Size
|
@@ -5,4 +5,3 @@ export { default as ButtonLoading } from './_button_loading.jsx'
|
|
5
5
|
export { default as ButtonBlockContent } from './_button_block_content.jsx'
|
6
6
|
export { default as ButtonAccessibility } from './_button_accessibility.jsx'
|
7
7
|
export { default as ButtonOptions } from './_button_options.jsx'
|
8
|
-
export { default as ButtonSize } from './_button_size.jsx'
|
data/lib/playbook/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: playbook_ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 10.18.
|
4
|
+
version: 10.18.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Power UX
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-01-
|
12
|
+
date: 2022-01-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|
@@ -424,9 +424,6 @@ files:
|
|
424
424
|
- app/pb_kits/playbook/pb_button/docs/_button_loading.md
|
425
425
|
- app/pb_kits/playbook/pb_button/docs/_button_options.html.erb
|
426
426
|
- app/pb_kits/playbook/pb_button/docs/_button_options.jsx
|
427
|
-
- app/pb_kits/playbook/pb_button/docs/_button_size.html.erb
|
428
|
-
- app/pb_kits/playbook/pb_button/docs/_button_size.jsx
|
429
|
-
- app/pb_kits/playbook/pb_button/docs/_button_size.md
|
430
427
|
- app/pb_kits/playbook/pb_button/docs/_footer.md
|
431
428
|
- app/pb_kits/playbook/pb_button/docs/example.yml
|
432
429
|
- app/pb_kits/playbook/pb_button/docs/index.js
|
@@ -1,26 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
import { Button } from '../../'
|
3
|
-
|
4
|
-
const ButtonSize = (props) => (
|
5
|
-
<div>
|
6
|
-
<Button
|
7
|
-
size="sm"
|
8
|
-
text="Button sm size"
|
9
|
-
{...props}
|
10
|
-
/>
|
11
|
-
{' '}
|
12
|
-
<Button
|
13
|
-
size="md"
|
14
|
-
text="Button md size"
|
15
|
-
{...props}
|
16
|
-
/>
|
17
|
-
{' '}
|
18
|
-
<Button
|
19
|
-
size="lg"
|
20
|
-
text="Button lg size"
|
21
|
-
{...props}
|
22
|
-
/>
|
23
|
-
</div>
|
24
|
-
)
|
25
|
-
|
26
|
-
export default ButtonSize
|
@@ -1 +0,0 @@
|
|
1
|
-
By default button has the `md` size style, even if you don't explicitly pass a size prop.
|