playbook_ui 9.6.1 → 9.7.0.pre.alpha.a11y.btn
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 +8 -19
- data/app/pb_kits/playbook/pb_button/button.rb +6 -4
- 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 +3 -0
- 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 +3 -0
- data/app/pb_kits/playbook/pb_date/_date.jsx +3 -3
- data/app/pb_kits/playbook/pb_date/date.html.erb +2 -3
- data/app/pb_kits/playbook/pb_date/docs/_date_variants.html.erb +8 -0
- data/app/pb_kits/playbook/pb_date/docs/_date_variants.jsx +10 -0
- data/app/pb_kits/playbook/pb_dialog/dialog_header.rb +23 -24
- 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 +41 -5
- data/app/pb_kits/playbook/pb_nav/docs/_block_nav.jsx +44 -6
- data/app/pb_kits/playbook/pb_select/_select.jsx +10 -1
- data/app/pb_kits/playbook/pb_select/_select.scss +27 -30
- data/app/pb_kits/playbook/pb_select/select.rb +5 -1
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default.html.erb +1 -1
- data/app/pb_kits/playbook/pb_typeahead/typeahead.html.erb +5 -1
- data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +5 -13
- data/lib/playbook/version.rb +1 -1
- metadata +15 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d02c19ea477725a33c15757d8254c21348c16e9d8e5b82b85ec08ffb7e3ac4e
|
4
|
+
data.tar.gz: 75fd3538c8760afa2dcf2818bef4e91451ca0f985044223bdd118f33c740b568
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70a500505fe763ab166a92613bb5d3fbf6c6c7b88d53e1727003346c8f5d0e312e629167c840ec17272a63a2cf7f0b15b7657b3b89cd0065c68eb0683a08368e
|
7
|
+
data.tar.gz: 4a1e51d54b520cb7c40f32df8fca6e2f20760b9eb09cf40092b66b50a90a14b6744e50bcaccf5cbc604708861128db5fee6e4efd777eeecfc4ed9f56ac5cb900
|
@@ -2,16 +2,14 @@
|
|
2
2
|
|
3
3
|
import React from 'react'
|
4
4
|
import classnames from 'classnames'
|
5
|
-
import { buildDataProps } from '../utilities/props'
|
5
|
+
import { buildAriaProps, 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?:
|
13
|
-
label: string,
|
14
|
-
},
|
12
|
+
aria?: object,
|
15
13
|
children?: array<React.ReactChild>,
|
16
14
|
className?: string | array<string>,
|
17
15
|
data?: object,
|
@@ -55,20 +53,9 @@ const buttonClassName = (props: ButtonPropTypes) => {
|
|
55
53
|
return className
|
56
54
|
}
|
57
55
|
|
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
|
-
|
70
56
|
const Button = (props: ButtonPropTypes) => {
|
71
57
|
const {
|
58
|
+
aria = {},
|
72
59
|
children,
|
73
60
|
className,
|
74
61
|
data = {},
|
@@ -84,7 +71,7 @@ const Button = (props: ButtonPropTypes) => {
|
|
84
71
|
value,
|
85
72
|
} = props
|
86
73
|
|
87
|
-
const
|
74
|
+
const ariaProps = buildAriaProps(aria)
|
88
75
|
const dataProps = buildDataProps(data)
|
89
76
|
const css = classnames(
|
90
77
|
buttonClassName(props),
|
@@ -114,11 +101,12 @@ const Button = (props: ButtonPropTypes) => {
|
|
114
101
|
return (
|
115
102
|
<If condition={link !== null}>
|
116
103
|
<a
|
117
|
-
{...
|
104
|
+
{...ariaProps}
|
118
105
|
{...dataProps}
|
119
106
|
className={css}
|
120
107
|
href={link}
|
121
108
|
id={id}
|
109
|
+
role="link"
|
122
110
|
target={newWindow ? '_blank' : null}
|
123
111
|
>
|
124
112
|
<If condition={loading}>{loadingIcon}</If>
|
@@ -126,12 +114,13 @@ const Button = (props: ButtonPropTypes) => {
|
|
126
114
|
</a>
|
127
115
|
<Else />
|
128
116
|
<button
|
129
|
-
{...
|
117
|
+
{...ariaProps}
|
130
118
|
{...dataProps}
|
131
119
|
className={css}
|
132
120
|
disabled={disabled}
|
133
121
|
id={id}
|
134
122
|
onClick={onClick}
|
123
|
+
role="button"
|
135
124
|
type={htmlType}
|
136
125
|
value={value}
|
137
126
|
>
|
@@ -21,11 +21,12 @@ module Playbook
|
|
21
21
|
|
22
22
|
def options
|
23
23
|
{
|
24
|
-
|
25
|
-
data: data,
|
24
|
+
aria: aria,
|
26
25
|
class: classname,
|
26
|
+
data: data,
|
27
27
|
disabled: disabled,
|
28
|
-
|
28
|
+
id: id,
|
29
|
+
role: "button",
|
29
30
|
type: type,
|
30
31
|
value: value,
|
31
32
|
}.compact
|
@@ -34,7 +35,8 @@ module Playbook
|
|
34
35
|
def link_options
|
35
36
|
options.merge(
|
36
37
|
href: link,
|
37
|
-
|
38
|
+
role: "link",
|
39
|
+
target: new_window ? "_blank" : "_self",
|
38
40
|
)
|
39
41
|
end
|
40
42
|
|
@@ -1 +1 @@
|
|
1
|
-
<%= pb_rails("button", props: { text: "Button with ARIA", aria: {label: "
|
1
|
+
<%= pb_rails("button", props: { text: "Button with ARIA", aria: {label: "Go to Google"}, tag: "a", link: "http://google.com" }) %>
|
@@ -1,3 +1,3 @@
|
|
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" }) %>
|
1
|
+
<%= pb_rails("button", props: { text: "A Tag Button", aria: { label: "Link to Google" }, tag: "a", link: "http://google.com" }) %>
|
2
|
+
<%= pb_rails("button", props: { text: "Open in new Window", aria: { label: "Link to Google in new window" }, new_window: true, link: "http://google.com" }) %>
|
3
|
+
<%= pb_rails("button", props: { text: "A Tag Button Disabled", aria: { label: "Disabled link to Google" }, disabled: true, link: "http://google.com" }) %>
|
@@ -4,12 +4,14 @@ import { Button } from '../../'
|
|
4
4
|
const ButtonLink = (props) => (
|
5
5
|
<div>
|
6
6
|
<Button
|
7
|
+
aria={{ label: 'Link to Google' }}
|
7
8
|
link="https://google.com"
|
8
9
|
text="A Tag Button"
|
9
10
|
{...props}
|
10
11
|
/>
|
11
12
|
{' '}
|
12
13
|
<Button
|
14
|
+
aria={{ label: 'Link to Google in new window' }}
|
13
15
|
link="https://google.com"
|
14
16
|
newWindow
|
15
17
|
text="Open in New Window"
|
@@ -17,6 +19,7 @@ const ButtonLink = (props) => (
|
|
17
19
|
/>
|
18
20
|
{' '}
|
19
21
|
<Button
|
22
|
+
aria={{ label: 'Disabled link to Google' }}
|
20
23
|
disabled
|
21
24
|
link="https://google.com"
|
22
25
|
text="A Tag Button Disabled"
|
@@ -1,3 +1,3 @@
|
|
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 }) %>
|
1
|
+
<%= pb_rails("button", props: { aria: { label: "Loading" }, text: "Button Primary", loading: true }) %>
|
2
|
+
<%= pb_rails("button", props: { aria: { label: "Loading" }, text: "Button Primary", variant: "secondary", loading: true }) %>
|
3
|
+
<%= pb_rails("button", props: { aria: { label: "Loading" }, text: "Button Primary", variant: "link", loading: true }) %>
|
@@ -4,12 +4,14 @@ import { Button } from '../../'
|
|
4
4
|
const ButtonLoading = (props) => (
|
5
5
|
<div>
|
6
6
|
<Button
|
7
|
+
aria={{ label: 'Loading' }}
|
7
8
|
loading
|
8
9
|
text="Button Primary"
|
9
10
|
{...props}
|
10
11
|
/>
|
11
12
|
{' '}
|
12
13
|
<Button
|
14
|
+
aria={{ label: 'Loading' }}
|
13
15
|
loading
|
14
16
|
text="Button Secondary"
|
15
17
|
variant="secondary"
|
@@ -17,6 +19,7 @@ const ButtonLoading = (props) => (
|
|
17
19
|
/>
|
18
20
|
{' '}
|
19
21
|
<Button
|
22
|
+
aria={{ label: 'Loading' }}
|
20
23
|
loading
|
21
24
|
text="A Tag Button Disabled"
|
22
25
|
variant="link"
|
@@ -95,16 +95,16 @@ const PbDate = (props: PbDateProps) => {
|
|
95
95
|
<Else />
|
96
96
|
<>
|
97
97
|
<If condition={showIcon}>
|
98
|
-
<
|
98
|
+
<Caption
|
99
99
|
className="pb_icon_kit_container"
|
100
|
-
color="light"
|
101
100
|
tag="span"
|
102
101
|
>
|
103
102
|
<Icon
|
104
103
|
fixedWidth
|
105
104
|
icon="calendar-alt"
|
105
|
+
size="xs"
|
106
106
|
/>
|
107
|
-
</
|
107
|
+
</Caption>
|
108
108
|
</If>
|
109
109
|
<If condition={showDayOfWeek}>
|
110
110
|
<Caption tag="div">
|
@@ -39,11 +39,10 @@
|
|
39
39
|
|
40
40
|
<!-- icon -->
|
41
41
|
<% if object.show_icon %>
|
42
|
-
<%= pb_rails("
|
43
|
-
color: "light",
|
42
|
+
<%= pb_rails("caption", props: {
|
44
43
|
tag: "div",
|
45
44
|
}) do %>
|
46
|
-
<%= pb_rails("icon", props: { icon: "calendar-alt", fixed_width: true }) %>
|
45
|
+
<%= pb_rails("icon", props: { icon: "calendar-alt", fixed_width: true, size: 'xs' }) %>
|
47
46
|
<% end %>
|
48
47
|
<% end %>
|
49
48
|
|
@@ -4,6 +4,16 @@ 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
|
+
|
7
17
|
<FormattedDate
|
8
18
|
value="1995-12-25"
|
9
19
|
{...props}
|
@@ -1,31 +1,30 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Playbook
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
partial "pb_dialog/child_kits/dialog_header"
|
4
|
+
module PbDialog
|
5
|
+
class DialogHeader
|
6
|
+
include Playbook::Props
|
9
7
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
8
|
+
partial "pb_dialog/child_kits/dialog_header"
|
9
|
+
|
10
|
+
prop :closeable, type: Playbook::Props::Boolean, default: true
|
11
|
+
prop :padding
|
12
|
+
prop :separator, type: Playbook::Props::Boolean, default: true
|
13
|
+
prop :spacing
|
14
|
+
prop :text
|
15
|
+
prop :title
|
16
|
+
|
17
|
+
def dialog_header_options
|
18
|
+
{
|
19
|
+
id: id,
|
20
|
+
closeable: closeable,
|
21
|
+
padding: padding,
|
22
|
+
separator: separator,
|
23
|
+
spacing: spacing,
|
24
|
+
text: text,
|
25
|
+
title: title,
|
26
|
+
}
|
28
27
|
end
|
29
28
|
end
|
30
29
|
end
|
31
|
-
|
30
|
+
end
|
@@ -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 } = props
|
17
|
+
const { children, className, fixedSize, grow, overflow = null, shrink, flex = 'none' } = props
|
18
18
|
const growClass = grow === true ? 'grow' : ''
|
19
19
|
const flexClass = flex !== 'none' ? `flex_${flex}` : ''
|
20
20
|
const overflowClass = overflow ? `overflow_${overflow}` : ''
|
@@ -1,6 +1,42 @@
|
|
1
|
-
<%= pb_rails("nav", props: {title: "
|
2
|
-
<%= pb_rails("nav/item", props: { link: "#", active: true }) do%>
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
<%= pb_rails("nav", props: {title: "Users", link: "#"}) do %>
|
2
|
+
<%= pb_rails("nav/item", props: { link: "#", active: true }) do%>
|
3
|
+
<%= pb_rails("user", props: {
|
4
|
+
name: "Anna Black",
|
5
|
+
territory: "PHL",
|
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 %>
|
6
42
|
<% end %>
|
@@ -1,12 +1,12 @@
|
|
1
1
|
import React from 'react'
|
2
|
-
import { Nav } from '../../'
|
2
|
+
import { Nav, User } 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="Users"
|
10
10
|
{...props}
|
11
11
|
>
|
12
12
|
<NavItem
|
@@ -14,11 +14,49 @@ const BlockNav = (props) => {
|
|
14
14
|
link="#"
|
15
15
|
{...props}
|
16
16
|
>
|
17
|
-
|
17
|
+
<User
|
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
|
+
/>
|
18
59
|
</NavItem>
|
19
|
-
<NavItem link="#">{'Music'}</NavItem>
|
20
|
-
<NavItem link="#">{'Video'}</NavItem>
|
21
|
-
<NavItem link="#">{'Files'}</NavItem>
|
22
60
|
</Nav>
|
23
61
|
)
|
24
62
|
}
|
@@ -37,6 +37,8 @@ type SelectProps = {
|
|
37
37
|
id?: string,
|
38
38
|
includeBlank?: string,
|
39
39
|
label?: string,
|
40
|
+
margin: string,
|
41
|
+
marginBottom: string,
|
40
42
|
multiple?: boolean,
|
41
43
|
name?: string,
|
42
44
|
required?: boolean,
|
@@ -74,7 +76,14 @@ const Select = ({
|
|
74
76
|
const dataProps = buildDataProps(data)
|
75
77
|
const optionsList = createOptions(options)
|
76
78
|
|
77
|
-
const classes = classnames(
|
79
|
+
const classes = classnames(
|
80
|
+
buildCss('pb_select'),
|
81
|
+
globalProps({
|
82
|
+
...props,
|
83
|
+
marginBottom: props.marginBottom || props.margin || 'sm',
|
84
|
+
}),
|
85
|
+
className)
|
86
|
+
|
78
87
|
const selectWrapperClass = classnames(buildCss('pb_select_kit_wrapper'), { error }, className)
|
79
88
|
|
80
89
|
return (
|
@@ -4,7 +4,6 @@
|
|
4
4
|
@import "../tokens/colors";
|
5
5
|
|
6
6
|
[class^=pb_select] {
|
7
|
-
margin-bottom: $space_sm;
|
8
7
|
select {
|
9
8
|
@include pb_textarea_light;
|
10
9
|
@include pb_body_light;
|
@@ -65,38 +64,36 @@
|
|
65
64
|
transform: translateY(-50%);
|
66
65
|
pointer-events: none;
|
67
66
|
}
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
&:focus{
|
86
|
-
border-color: $active_dark;
|
67
|
+
}
|
68
|
+
|
69
|
+
[class^=pb_select].dark {
|
70
|
+
select {
|
71
|
+
@include pb_textarea_dark;
|
72
|
+
@include pb_body_light_dark;
|
73
|
+
background: none;
|
74
|
+
background-color: rgba($white,.10);
|
75
|
+
box-shadow: inset 0 -11px 20px rgba($white, 0.05);
|
76
|
+
text-shadow: 0 0 0 $text_dk_default;
|
77
|
+
padding-right: $space_xl;
|
78
|
+
white-space: nowrap;
|
79
|
+
overflow: hidden;
|
80
|
+
text-overflow: ellipsis;
|
81
|
+
@media (hover:hover) {
|
82
|
+
&:hover, &:active, &:focus {
|
83
|
+
background-color: rgba($white,.05);
|
87
84
|
}
|
88
85
|
}
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
86
|
+
}
|
87
|
+
.pb_select_kit_caret {
|
88
|
+
color: $white;
|
89
|
+
}
|
90
|
+
.pb_select_kit_wrapper {
|
91
|
+
&.error {
|
92
|
+
.pb_select_kit_wrapper {
|
93
|
+
> select:first-child {
|
94
|
+
border-color: $error_dark;
|
98
95
|
}
|
99
96
|
}
|
100
97
|
}
|
101
98
|
}
|
102
|
-
}
|
99
|
+
}
|
@@ -17,13 +17,17 @@ module Playbook
|
|
17
17
|
prop :required, type: Playbook::Props::Boolean, default: false
|
18
18
|
|
19
19
|
def classname
|
20
|
-
generate_classname("pb_select")
|
20
|
+
generate_classname("pb_select", select_margin_bottom, separator: " ")
|
21
21
|
end
|
22
22
|
|
23
23
|
def select_wrapper_class
|
24
24
|
"pb_select_kit_wrapper" + error_class
|
25
25
|
end
|
26
26
|
|
27
|
+
def select_margin_bottom
|
28
|
+
margin.present? || margin_bottom.present? ? nil : "mb_sm"
|
29
|
+
end
|
30
|
+
|
27
31
|
def options_to_array
|
28
32
|
options.map { |option| [option[:value_text] || option[:value], option[:value]] }
|
29
33
|
end
|
@@ -7,7 +7,11 @@
|
|
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
|
-
|
10
|
+
<%= pb_rails("icon", props: {
|
11
|
+
icon: "spinner",
|
12
|
+
pulse: true,
|
13
|
+
fixed_width: true,
|
14
|
+
}) %>
|
11
15
|
</div>
|
12
16
|
<%= pb_rails("text_input", props: {
|
13
17
|
type: "search",
|
@@ -3,8 +3,7 @@
|
|
3
3
|
module Playbook
|
4
4
|
module PbTypeahead
|
5
5
|
class Typeahead < Playbook::KitBase
|
6
|
-
prop :async, type: Playbook::Props::Boolean,
|
7
|
-
default: false
|
6
|
+
prop :async, type: Playbook::Props::Boolean, default: false
|
8
7
|
prop :default_options, type: Playbook::Props::HashArray, default: []
|
9
8
|
prop :get_option_label
|
10
9
|
prop :get_option_value
|
@@ -13,9 +12,7 @@ module Playbook
|
|
13
12
|
prop :load_options
|
14
13
|
prop :name
|
15
14
|
prop :options, type: Playbook::Props::HashArray, default: []
|
16
|
-
prop :pills, type: Playbook::Props::Boolean,
|
17
|
-
default: false
|
18
|
-
|
15
|
+
prop :pills, type: Playbook::Props::Boolean, default: false
|
19
16
|
prop :placeholder
|
20
17
|
prop :search_term_minimum_length, default: 3
|
21
18
|
prop :search_debounce_timeout, default: 250
|
@@ -45,14 +42,9 @@ module Playbook
|
|
45
42
|
placeholder: placeholder,
|
46
43
|
}
|
47
44
|
|
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
|
-
|
45
|
+
base_options.merge!({ getOptionLabel: get_option_label }) if get_option_label.present?
|
46
|
+
base_options.merge!({ getOptionValue: get_option_value }) if get_option_value.present?
|
47
|
+
base_options.merge!({ async: true, loadOptions: load_options }) if async
|
56
48
|
base_options
|
57
49
|
end
|
58
50
|
end
|
data/lib/playbook/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: playbook_ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 9.
|
4
|
+
version: 9.7.0.pre.alpha.a11y.btn
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Power UX
|
8
8
|
- Power Devs
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-04-
|
12
|
+
date: 2021-04-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|
@@ -285,22 +285,22 @@ dependencies:
|
|
285
285
|
name: rspec-rails
|
286
286
|
requirement: !ruby/object:Gem::Requirement
|
287
287
|
requirements:
|
288
|
-
- - ">="
|
289
|
-
- !ruby/object:Gem::Version
|
290
|
-
version: 3.8.0
|
291
288
|
- - "~>"
|
292
289
|
- !ruby/object:Gem::Version
|
293
290
|
version: '3.8'
|
291
|
+
- - ">="
|
292
|
+
- !ruby/object:Gem::Version
|
293
|
+
version: 3.8.0
|
294
294
|
type: :development
|
295
295
|
prerelease: false
|
296
296
|
version_requirements: !ruby/object:Gem::Requirement
|
297
297
|
requirements:
|
298
|
-
- - ">="
|
299
|
-
- !ruby/object:Gem::Version
|
300
|
-
version: 3.8.0
|
301
298
|
- - "~>"
|
302
299
|
- !ruby/object:Gem::Version
|
303
300
|
version: '3.8'
|
301
|
+
- - ">="
|
302
|
+
- !ruby/object:Gem::Version
|
303
|
+
version: 3.8.0
|
304
304
|
- !ruby/object:Gem::Dependency
|
305
305
|
name: rspec-html-matchers
|
306
306
|
requirement: !ruby/object:Gem::Requirement
|
@@ -2115,7 +2115,7 @@ homepage: http://playbook.powerapp.cloud
|
|
2115
2115
|
licenses:
|
2116
2116
|
- MIT
|
2117
2117
|
metadata: {}
|
2118
|
-
post_install_message:
|
2118
|
+
post_install_message:
|
2119
2119
|
rdoc_options: []
|
2120
2120
|
require_paths:
|
2121
2121
|
- lib
|
@@ -2126,12 +2126,13 @@ 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: 1.3.1
|
2132
2132
|
requirements: []
|
2133
|
-
|
2134
|
-
|
2133
|
+
rubyforge_project:
|
2134
|
+
rubygems_version: 2.7.3
|
2135
|
+
signing_key:
|
2135
2136
|
specification_version: 4
|
2136
2137
|
summary: Playbook Design System
|
2137
2138
|
test_files: []
|