playbook_ui 9.7.0.pre.alpha.a11y.btn → 9.7.0
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_button/_button.jsx +19 -8
- data/app/pb_kits/playbook/pb_button/button.rb +4 -6
- data/app/pb_kits/playbook/pb_button/docs/_button_accessibility.html.erb +1 -1
- data/app/pb_kits/playbook/pb_button/docs/_button_accessibility.jsx +1 -1
- data/app/pb_kits/playbook/pb_button/docs/_button_link.html.erb +3 -3
- data/app/pb_kits/playbook/pb_button/docs/_button_link.jsx +0 -3
- data/app/pb_kits/playbook/pb_button/docs/_button_loading.html.erb +3 -3
- data/app/pb_kits/playbook/pb_button/docs/_button_loading.jsx +0 -3
- data/app/pb_kits/playbook/pb_date/_date.jsx +3 -3
- data/app/pb_kits/playbook/pb_date/date.html.erb +3 -2
- data/app/pb_kits/playbook/pb_date/docs/_date_variants.html.erb +0 -8
- data/app/pb_kits/playbook/pb_date/docs/_date_variants.jsx +0 -10
- data/app/pb_kits/playbook/pb_flex/_flex_item.jsx +1 -1
- data/app/pb_kits/playbook/pb_nav/_vertical_nav.scss +1 -1
- data/app/pb_kits/playbook/pb_nav/docs/_block_nav.html.erb +5 -41
- data/app/pb_kits/playbook/pb_nav/docs/_block_nav.jsx +6 -44
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default.html.erb +1 -1
- data/app/pb_kits/playbook/pb_typeahead/typeahead.html.erb +1 -5
- data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +13 -5
- data/lib/playbook/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f80298017b48e65f5ec8a3ec7a6782608b90adf0bae7c32596837f3c964f5c85
|
4
|
+
data.tar.gz: 2c8e80673442f37ff2cce022f1324642c80c17b8c6da2912a119502a84c5781e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee6e023775fc1c6d7ec91beaec5d1bed2d4cca9f342ef4e7b8c203f70f577e197b7ae0048e1872f881d12c13113fe9eadd7fd3a369c4d0ff8213541c8ab67b9c
|
7
|
+
data.tar.gz: 75e487fb2251126f2c74d67d4db3173c68e2838e7350279f1c4e5a1e5315be3e0c17233e22b645adb8438695317797b05baf44ce0448764db22139200a1e40d3
|
@@ -2,14 +2,16 @@
|
|
2
2
|
|
3
3
|
import React from 'react'
|
4
4
|
import classnames from 'classnames'
|
5
|
-
import {
|
5
|
+
import { buildDataProps } from '../utilities/props'
|
6
6
|
import { globalProps } from '../utilities/globalProps.js'
|
7
7
|
|
8
8
|
import Icon from '../pb_icon/_icon.jsx'
|
9
9
|
|
10
10
|
type EventHandler = (SyntheticInputEvent<HTMLInputElement>) => void
|
11
11
|
type ButtonPropTypes = {
|
12
|
-
aria?:
|
12
|
+
aria?: {
|
13
|
+
label: string,
|
14
|
+
},
|
13
15
|
children?: array<React.ReactChild>,
|
14
16
|
className?: string | array<string>,
|
15
17
|
data?: object,
|
@@ -53,9 +55,20 @@ const buttonClassName = (props: ButtonPropTypes) => {
|
|
53
55
|
return className
|
54
56
|
}
|
55
57
|
|
58
|
+
const buttonAriaProps = (props: ButtonPropTypes) => {
|
59
|
+
const { aria } = props
|
60
|
+
if (typeof aria !== 'object') return {}
|
61
|
+
const { label } = aria
|
62
|
+
|
63
|
+
const ariaProps = {}
|
64
|
+
|
65
|
+
if (label !== null) ariaProps['aria-label'] = label
|
66
|
+
|
67
|
+
return ariaProps
|
68
|
+
}
|
69
|
+
|
56
70
|
const Button = (props: ButtonPropTypes) => {
|
57
71
|
const {
|
58
|
-
aria = {},
|
59
72
|
children,
|
60
73
|
className,
|
61
74
|
data = {},
|
@@ -71,7 +84,7 @@ const Button = (props: ButtonPropTypes) => {
|
|
71
84
|
value,
|
72
85
|
} = props
|
73
86
|
|
74
|
-
const
|
87
|
+
const buttonAria = buttonAriaProps(props)
|
75
88
|
const dataProps = buildDataProps(data)
|
76
89
|
const css = classnames(
|
77
90
|
buttonClassName(props),
|
@@ -101,12 +114,11 @@ const Button = (props: ButtonPropTypes) => {
|
|
101
114
|
return (
|
102
115
|
<If condition={link !== null}>
|
103
116
|
<a
|
104
|
-
{...
|
117
|
+
{...buttonAria}
|
105
118
|
{...dataProps}
|
106
119
|
className={css}
|
107
120
|
href={link}
|
108
121
|
id={id}
|
109
|
-
role="link"
|
110
122
|
target={newWindow ? '_blank' : null}
|
111
123
|
>
|
112
124
|
<If condition={loading}>{loadingIcon}</If>
|
@@ -114,13 +126,12 @@ const Button = (props: ButtonPropTypes) => {
|
|
114
126
|
</a>
|
115
127
|
<Else />
|
116
128
|
<button
|
117
|
-
{...
|
129
|
+
{...buttonAria}
|
118
130
|
{...dataProps}
|
119
131
|
className={css}
|
120
132
|
disabled={disabled}
|
121
133
|
id={id}
|
122
134
|
onClick={onClick}
|
123
|
-
role="button"
|
124
135
|
type={htmlType}
|
125
136
|
value={value}
|
126
137
|
>
|
@@ -21,12 +21,11 @@ module Playbook
|
|
21
21
|
|
22
22
|
def options
|
23
23
|
{
|
24
|
-
|
25
|
-
class: classname,
|
24
|
+
id: id,
|
26
25
|
data: data,
|
26
|
+
class: classname,
|
27
27
|
disabled: disabled,
|
28
|
-
|
29
|
-
role: "button",
|
28
|
+
aria: aria,
|
30
29
|
type: type,
|
31
30
|
value: value,
|
32
31
|
}.compact
|
@@ -35,8 +34,7 @@ module Playbook
|
|
35
34
|
def link_options
|
36
35
|
options.merge(
|
37
36
|
href: link,
|
38
|
-
|
39
|
-
target: new_window ? "_blank" : "_self",
|
37
|
+
target: new_window ? "_blank" : "_self"
|
40
38
|
)
|
41
39
|
end
|
42
40
|
|
@@ -1 +1 @@
|
|
1
|
-
<%= pb_rails("button", props: { text: "Button with ARIA", aria: {label: "
|
1
|
+
<%= pb_rails("button", props: { text: "Button with ARIA", aria: {label: "button"}, tag: "a", link: "http://google.com" }) %>
|
@@ -1,3 +1,3 @@
|
|
1
|
-
<%= pb_rails("button", props: { text: "A Tag Button",
|
2
|
-
<%= pb_rails("button", props: { text: "Open in new Window",
|
3
|
-
<%= pb_rails("button", props: { text: "A Tag Button Disabled",
|
1
|
+
<%= pb_rails("button", props: { text: "A Tag Button", tag: "a", link: "http://google.com" }) %>
|
2
|
+
<%= pb_rails("button", props: { text: "Open in new Window", new_window: true, link: "http://google.com" }) %>
|
3
|
+
<%= pb_rails("button", props: { text: "A Tag Button Disabled", disabled: true, link: "http://google.com" }) %>
|
@@ -4,14 +4,12 @@ import { Button } from '../../'
|
|
4
4
|
const ButtonLink = (props) => (
|
5
5
|
<div>
|
6
6
|
<Button
|
7
|
-
aria={{ label: 'Link to Google' }}
|
8
7
|
link="https://google.com"
|
9
8
|
text="A Tag Button"
|
10
9
|
{...props}
|
11
10
|
/>
|
12
11
|
{' '}
|
13
12
|
<Button
|
14
|
-
aria={{ label: 'Link to Google in new window' }}
|
15
13
|
link="https://google.com"
|
16
14
|
newWindow
|
17
15
|
text="Open in New Window"
|
@@ -19,7 +17,6 @@ const ButtonLink = (props) => (
|
|
19
17
|
/>
|
20
18
|
{' '}
|
21
19
|
<Button
|
22
|
-
aria={{ label: 'Disabled link to Google' }}
|
23
20
|
disabled
|
24
21
|
link="https://google.com"
|
25
22
|
text="A Tag Button Disabled"
|
@@ -1,3 +1,3 @@
|
|
1
|
-
<%= pb_rails("button", props: {
|
2
|
-
<%= pb_rails("button", props: {
|
3
|
-
<%= pb_rails("button", props: {
|
1
|
+
<%= pb_rails("button", props: { text: "Button Primary", loading: true }) %>
|
2
|
+
<%= pb_rails("button", props: { text: "Button Primary", variant: "secondary", loading: true }) %>
|
3
|
+
<%= pb_rails("button", props: { text: "Button Primary", variant: "link", loading: true }) %>
|
@@ -4,14 +4,12 @@ import { Button } from '../../'
|
|
4
4
|
const ButtonLoading = (props) => (
|
5
5
|
<div>
|
6
6
|
<Button
|
7
|
-
aria={{ label: 'Loading' }}
|
8
7
|
loading
|
9
8
|
text="Button Primary"
|
10
9
|
{...props}
|
11
10
|
/>
|
12
11
|
{' '}
|
13
12
|
<Button
|
14
|
-
aria={{ label: 'Loading' }}
|
15
13
|
loading
|
16
14
|
text="Button Secondary"
|
17
15
|
variant="secondary"
|
@@ -19,7 +17,6 @@ const ButtonLoading = (props) => (
|
|
19
17
|
/>
|
20
18
|
{' '}
|
21
19
|
<Button
|
22
|
-
aria={{ label: 'Loading' }}
|
23
20
|
loading
|
24
21
|
text="A Tag Button Disabled"
|
25
22
|
variant="link"
|
@@ -95,16 +95,16 @@ const PbDate = (props: PbDateProps) => {
|
|
95
95
|
<Else />
|
96
96
|
<>
|
97
97
|
<If condition={showIcon}>
|
98
|
-
<
|
98
|
+
<Body
|
99
99
|
className="pb_icon_kit_container"
|
100
|
+
color="light"
|
100
101
|
tag="span"
|
101
102
|
>
|
102
103
|
<Icon
|
103
104
|
fixedWidth
|
104
105
|
icon="calendar-alt"
|
105
|
-
size="xs"
|
106
106
|
/>
|
107
|
-
</
|
107
|
+
</Body>
|
108
108
|
</If>
|
109
109
|
<If condition={showDayOfWeek}>
|
110
110
|
<Caption tag="div">
|
@@ -39,10 +39,11 @@
|
|
39
39
|
|
40
40
|
<!-- icon -->
|
41
41
|
<% if object.show_icon %>
|
42
|
-
<%= pb_rails("
|
42
|
+
<%= pb_rails("body", props: {
|
43
|
+
color: "light",
|
43
44
|
tag: "div",
|
44
45
|
}) do %>
|
45
|
-
<%= pb_rails("icon", props: { icon: "calendar-alt", fixed_width: true
|
46
|
+
<%= pb_rails("icon", props: { icon: "calendar-alt", fixed_width: true }) %>
|
46
47
|
<% end %>
|
47
48
|
<% end %>
|
48
49
|
|
@@ -4,16 +4,6 @@ import { Date as FormattedDate } from '../..'
|
|
4
4
|
const DateVariants = (props) => {
|
5
5
|
return (
|
6
6
|
<div>
|
7
|
-
<FormattedDate
|
8
|
-
showIcon
|
9
|
-
size="sm"
|
10
|
-
value="1995-12-25"
|
11
|
-
{...props}
|
12
|
-
/>
|
13
|
-
|
14
|
-
<br />
|
15
|
-
<br />
|
16
|
-
|
17
7
|
<FormattedDate
|
18
8
|
value="1995-12-25"
|
19
9
|
{...props}
|
@@ -14,7 +14,7 @@ type FlexItemPropTypes = {
|
|
14
14
|
}
|
15
15
|
|
16
16
|
const FlexItem = (props: FlexItemPropTypes) => {
|
17
|
-
const { children, className, fixedSize, grow, overflow = null, shrink, flex
|
17
|
+
const { children, className, fixedSize, grow, overflow = null, shrink, flex } = props
|
18
18
|
const growClass = grow === true ? 'grow' : ''
|
19
19
|
const flexClass = flex !== 'none' ? `flex_${flex}` : ''
|
20
20
|
const overflowClass = overflow ? `overflow_${overflow}` : ''
|
@@ -1,42 +1,6 @@
|
|
1
|
-
<%= pb_rails("nav", props: {title: "
|
2
|
-
<%= pb_rails("nav/item", props: { link: "#", active: true }) do%>
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
title: "Remodeling Consultant",
|
7
|
-
orientation: "horizontal",
|
8
|
-
align: "left",
|
9
|
-
avatar_url: "https://randomuser.me/api/portraits/women/44.jpg"
|
10
|
-
}) %>
|
11
|
-
<% end %>
|
12
|
-
<%= pb_rails("nav/item", props: { link: "#" }) do%>
|
13
|
-
<%= pb_rails("user", props: {
|
14
|
-
name: "Julie Hamilton",
|
15
|
-
territory: "PHL",
|
16
|
-
title: "Inside Sales Agent",
|
17
|
-
orientation: "horizontal",
|
18
|
-
align: "left",
|
19
|
-
avatar_url: "https://randomuser.me/api/portraits/women/45.jpg"
|
20
|
-
}) %>
|
21
|
-
<% end %>
|
22
|
-
<%= pb_rails("nav/item", props: { link: "#" }) do%>
|
23
|
-
<%= pb_rails("user", props: {
|
24
|
-
name: "Dennis Wilks",
|
25
|
-
territory: "PHL",
|
26
|
-
title: "Senior Remodeling Consultant",
|
27
|
-
orientation: "horizontal",
|
28
|
-
align: "left",
|
29
|
-
avatar_url: "https://randomuser.me/api/portraits/men/44.jpg"
|
30
|
-
}) %>
|
31
|
-
<% end %>
|
32
|
-
<%= pb_rails("nav/item", props: { link: "#" }) do%>
|
33
|
-
<%= pb_rails("user", props: {
|
34
|
-
name: "Ronnie Martin",
|
35
|
-
territory: "PHL",
|
36
|
-
title: "Customer Development Representative",
|
37
|
-
orientation: "horizontal",
|
38
|
-
align: "left",
|
39
|
-
avatar_url: "https://randomuser.me/api/portraits/men/46.jpg"
|
40
|
-
}) %>
|
41
|
-
<% end %>
|
1
|
+
<%= pb_rails("nav", props: {title: "Menu", link: "#"}) do %>
|
2
|
+
<%= pb_rails("nav/item", props: { link: "#", active: true }) do%>Photos<% end %>
|
3
|
+
<%= pb_rails("nav/item", props: { link: "#" }) do%>Music<% end %>
|
4
|
+
<%= pb_rails("nav/item", props: { link: "#" }) do%>Video<% end %>
|
5
|
+
<%= pb_rails("nav/item", props: { link: "#" }) do%>Files<% end %>
|
42
6
|
<% end %>
|
@@ -1,12 +1,12 @@
|
|
1
1
|
import React from 'react'
|
2
|
-
import { Nav
|
2
|
+
import { Nav } from '../../'
|
3
3
|
import NavItem from '../_item.jsx'
|
4
4
|
|
5
5
|
const BlockNav = (props) => {
|
6
6
|
return (
|
7
7
|
<Nav
|
8
8
|
link="#"
|
9
|
-
title="
|
9
|
+
title="Menu"
|
10
10
|
{...props}
|
11
11
|
>
|
12
12
|
<NavItem
|
@@ -14,49 +14,11 @@ const BlockNav = (props) => {
|
|
14
14
|
link="#"
|
15
15
|
{...props}
|
16
16
|
>
|
17
|
-
|
18
|
-
align="left"
|
19
|
-
avatarUrl="https://randomuser.me/api/portraits/women/44.jpg"
|
20
|
-
name="Anna Black"
|
21
|
-
orientation="horizontal"
|
22
|
-
territory="PHL"
|
23
|
-
title="Remodeling Consultant"
|
24
|
-
{...props}
|
25
|
-
/>
|
26
|
-
</NavItem>
|
27
|
-
<NavItem link="#">
|
28
|
-
<User
|
29
|
-
align="left"
|
30
|
-
avatarUrl="https://randomuser.me/api/portraits/women/45.jpg"
|
31
|
-
name="Julie Hamilton"
|
32
|
-
orientation="horizontal"
|
33
|
-
territory="PHL"
|
34
|
-
title="Inside Sales Agent"
|
35
|
-
{...props}
|
36
|
-
/>
|
37
|
-
</NavItem>
|
38
|
-
<NavItem link="#">
|
39
|
-
<User
|
40
|
-
align="left"
|
41
|
-
avatarUrl="https://randomuser.me/api/portraits/men/44.jpg"
|
42
|
-
name="Dennis Wilks"
|
43
|
-
orientation="horizontal"
|
44
|
-
territory="PHL"
|
45
|
-
title="Senior Remodeling Consultant"
|
46
|
-
{...props}
|
47
|
-
/>
|
48
|
-
</NavItem>
|
49
|
-
<NavItem link="#">
|
50
|
-
<User
|
51
|
-
align="left"
|
52
|
-
avatarUrl="https://randomuser.me/api/portraits/men/46.jpg"
|
53
|
-
name="Ronnie Martin"
|
54
|
-
orientation="horizontal"
|
55
|
-
territory="PHL"
|
56
|
-
title="Customer Development Representative"
|
57
|
-
{...props}
|
58
|
-
/>
|
17
|
+
{'Photos'}
|
59
18
|
</NavItem>
|
19
|
+
<NavItem link="#">{'Music'}</NavItem>
|
20
|
+
<NavItem link="#">{'Video'}</NavItem>
|
21
|
+
<NavItem link="#">{'Files'}</NavItem>
|
60
22
|
</Nav>
|
61
23
|
)
|
62
24
|
}
|
@@ -7,11 +7,7 @@
|
|
7
7
|
class: object.classname) do %>
|
8
8
|
<div class="pb_typeahead_wrapper">
|
9
9
|
<div class="pb_typeahead_loading_indicator" data-pb-typeahead-kit-loading-indicator>
|
10
|
-
|
11
|
-
icon: "spinner",
|
12
|
-
pulse: true,
|
13
|
-
fixed_width: true,
|
14
|
-
}) %>
|
10
|
+
<i class="far fa-spinner fa-spin"></i>
|
15
11
|
</div>
|
16
12
|
<%= pb_rails("text_input", props: {
|
17
13
|
type: "search",
|
@@ -3,7 +3,8 @@
|
|
3
3
|
module Playbook
|
4
4
|
module PbTypeahead
|
5
5
|
class Typeahead < Playbook::KitBase
|
6
|
-
prop :async, type: Playbook::Props::Boolean,
|
6
|
+
prop :async, type: Playbook::Props::Boolean,
|
7
|
+
default: false
|
7
8
|
prop :default_options, type: Playbook::Props::HashArray, default: []
|
8
9
|
prop :get_option_label
|
9
10
|
prop :get_option_value
|
@@ -12,7 +13,9 @@ module Playbook
|
|
12
13
|
prop :load_options
|
13
14
|
prop :name
|
14
15
|
prop :options, type: Playbook::Props::HashArray, default: []
|
15
|
-
prop :pills, type: Playbook::Props::Boolean,
|
16
|
+
prop :pills, type: Playbook::Props::Boolean,
|
17
|
+
default: false
|
18
|
+
|
16
19
|
prop :placeholder
|
17
20
|
prop :search_term_minimum_length, default: 3
|
18
21
|
prop :search_debounce_timeout, default: 250
|
@@ -42,9 +45,14 @@ module Playbook
|
|
42
45
|
placeholder: placeholder,
|
43
46
|
}
|
44
47
|
|
45
|
-
base_options.merge!({
|
46
|
-
base_options.merge!({
|
47
|
-
|
48
|
+
base_options.merge!({getOptionLabel: get_option_label}) if get_option_label.present?
|
49
|
+
base_options.merge!({getOptionValue: get_option_value}) if get_option_value.present?
|
50
|
+
|
51
|
+
base_options.merge!({
|
52
|
+
async: true,
|
53
|
+
loadOptions: load_options,
|
54
|
+
}) if async
|
55
|
+
|
48
56
|
base_options
|
49
57
|
end
|
50
58
|
end
|
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: 9.7.0
|
4
|
+
version: 9.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Power UX
|
@@ -2126,9 +2126,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
2126
2126
|
version: '0'
|
2127
2127
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
2128
2128
|
requirements:
|
2129
|
-
- - "
|
2129
|
+
- - ">="
|
2130
2130
|
- !ruby/object:Gem::Version
|
2131
|
-
version:
|
2131
|
+
version: '0'
|
2132
2132
|
requirements: []
|
2133
2133
|
rubyforge_project:
|
2134
2134
|
rubygems_version: 2.7.3
|