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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5d02c19ea477725a33c15757d8254c21348c16e9d8e5b82b85ec08ffb7e3ac4e
4
- data.tar.gz: 75fd3538c8760afa2dcf2818bef4e91451ca0f985044223bdd118f33c740b568
3
+ metadata.gz: f80298017b48e65f5ec8a3ec7a6782608b90adf0bae7c32596837f3c964f5c85
4
+ data.tar.gz: 2c8e80673442f37ff2cce022f1324642c80c17b8c6da2912a119502a84c5781e
5
5
  SHA512:
6
- metadata.gz: 70a500505fe763ab166a92613bb5d3fbf6c6c7b88d53e1727003346c8f5d0e312e629167c840ec17272a63a2cf7f0b15b7657b3b89cd0065c68eb0683a08368e
7
- data.tar.gz: 4a1e51d54b520cb7c40f32df8fca6e2f20760b9eb09cf40092b66b50a90a14b6744e50bcaccf5cbc604708861128db5fee6e4efd777eeecfc4ed9f56ac5cb900
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 { buildAriaProps, buildDataProps } from '../utilities/props'
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?: object,
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 ariaProps = buildAriaProps(aria)
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
- {...ariaProps}
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
- {...ariaProps}
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
- aria: aria,
25
- class: classname,
24
+ id: id,
26
25
  data: data,
26
+ class: classname,
27
27
  disabled: disabled,
28
- id: id,
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
- role: "link",
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: "Go to Google"}, tag: "a", link: "http://google.com" }) %>
1
+ <%= pb_rails("button", props: { text: "Button with ARIA", aria: {label: "button"}, tag: "a", link: "http://google.com" }) %>
@@ -4,7 +4,7 @@ import { Button } from '../../'
4
4
  const ButtonAccessibility = (props) => (
5
5
  <div>
6
6
  <Button
7
- aria={{ label: 'Go to Google' }}
7
+ aria={{ label: 'button' }}
8
8
  link="https://google.com"
9
9
  tag="a"
10
10
  text="Button with ARIA"
@@ -1,3 +1,3 @@
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" }) %>
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: { 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 }) %>
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
- <Caption
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
- </Caption>
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("caption", props: {
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, size: 'xs' }) %>
46
+ <%= pb_rails("icon", props: { icon: "calendar-alt", fixed_width: true }) %>
46
47
  <% end %>
47
48
  <% end %>
48
49
 
@@ -1,12 +1,4 @@
1
1
  <div>
2
- <%= pb_rails("date", props: {
3
- date: DateTime.now,
4
- show_icon: true,
5
- size: "sm"
6
- }) %>
7
-
8
- <br>
9
-
10
2
  <%= pb_rails("date", props: {
11
3
  date: DateTime.now,
12
4
  }) %>
@@ -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 = 'none' } = props
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}` : ''
@@ -16,7 +16,7 @@ $selector: ".pb_nav_list";
16
16
  list-style: none;
17
17
  }
18
18
 
19
- [class*=pb_nav_list_title] {
19
+ [class*=_title] {
20
20
  padding: 0 $space_md $space_sm;
21
21
  }
22
22
 
@@ -1,42 +1,6 @@
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 %>
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, User } from '../../'
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="Users"
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
- <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
- />
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
  }
@@ -8,7 +8,7 @@
8
8
  <% end %>
9
9
 
10
10
  <%= pb_rails("body") do %>
11
- When you make a selection, you will see it appear in the list below
11
+ When you make a selection, you will see it apear in the list below
12
12
  <% end %>
13
13
 
14
14
  <div data-selected-option></div>
@@ -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
- <%= pb_rails("icon", props: {
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, default: false
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, default: false
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!({ 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
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Playbook
4
- VERSION = "9.7.0.pre.alpha.a11y.btn"
4
+ VERSION = "9.7.0"
5
5
  end
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.pre.alpha.a11y.btn
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: 1.3.1
2131
+ version: '0'
2132
2132
  requirements: []
2133
2133
  rubyforge_project:
2134
2134
  rubygems_version: 2.7.3