playbook_ui 9.3.1.pre.alpha2 → 9.4.0.alpha.user.kit.bug

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: 76b05713c20d439c9cf190dbe2886c18c91c0d928cacc1f1d144b661bc252c5b
4
- data.tar.gz: f901248e28de4081688cbe230ad247a1e8c50a73b59f92d4e035022205b32898
3
+ metadata.gz: 0d58bd43051948ed88cd448d6a1af339b38f5b53ec707cd6d49b10cb227cc8d5
4
+ data.tar.gz: 33d5becc70eebf7f7ed08f452ff2b3422d1891d93829e529ef59e2425dca64a7
5
5
  SHA512:
6
- metadata.gz: '097d05cd4d878abb596d6a6990152267a26c9ad54d50622209842ff66a13f49cdaf12dedb18b3ee681e36ab8deb943abdc2e29e87f5ee998a7462ff7abb5a581'
7
- data.tar.gz: 7d83fa036724ec01a9e67cb9e06d6cf74b271b3a29fa9637b29682a7646b9115d354dbc00e5afe06dbe1a9dbc7f34c7229e5a6faa4cdee3c6585147af97e1b1d
6
+ metadata.gz: d7731ea2e841c7520aaed03654f9983fff519785df5622292b5a47be9ebfd0de6119c7d47378e3c35a5077ca576b68c26cb4bf5967847f6a89e6dd530a8093bb
7
+ data.tar.gz: 3c118b92821665486442b8eb870d2807f9bf64ed6cbfd62d017c667e8b6df11b76fb173e70fdc0551fd2bb54f82b5572ae33527748d3ad09dff88c96ee9865c1
@@ -53,9 +53,10 @@ const Checkbox = (props: CheckboxProps) => {
53
53
 
54
54
  useEffect(() => {
55
55
  if (checkRef.current) {
56
+ checkRef.current.checked = checked
56
57
  checkRef.current.indeterminate = indeterminate
57
58
  }
58
- }, [indeterminate])
59
+ }, [indeterminate, checked])
59
60
 
60
61
  return (
61
62
  <label
@@ -4,12 +4,13 @@
4
4
  $transition: $transition_cubic;
5
5
 
6
6
  [class^=pb_checkbox_kit] {
7
- display: inline-flex;
8
7
  cursor: pointer;
8
+ display: inline-flex;
9
+ vertical-align: middle;
9
10
  .pb_checkbox_label {
10
- padding-left: $space_xs;
11
11
  cursor: pointer;
12
12
  font-size: $text_lt_default;
13
+ padding-left: $space_xs;
13
14
  user-select: none;
14
15
  }
15
16
 
@@ -1,15 +1,73 @@
1
- import React from 'react'
2
- import { Checkbox } from '../..'
1
+ import React, { useState } from 'react'
2
+ import { Checkbox, Table } from '../..'
3
3
 
4
4
  const CheckboxIndeterminate = (props) => {
5
+ const [checkboxes, setCheckboxes] = useState([
6
+ { name: 'Coffee', checked: false },
7
+ { name: 'Ice Cream', checked: false },
8
+ { name: 'Chocolate', checked: true },
9
+ ])
10
+
11
+ const isAllChecked = !checkboxes.find((checkbox) => !checkbox.checked)
12
+ const isNoneChecked = !checkboxes.find((checkbox) => checkbox.checked)
13
+
14
+ const processCheckboxes = (checked) =>
15
+ checkboxes.slice(0).map((checkbox) => {
16
+ checkbox.checked = checked
17
+ return checkbox
18
+ })
19
+
20
+ const onToggleAll = () => {
21
+ setCheckboxes(
22
+ isNoneChecked ? processCheckboxes(true) : processCheckboxes(false)
23
+ )
24
+ }
25
+
26
+ const updateCheckboxes = (checkbox, index) => {
27
+ const newCheckboxes = checkboxes.slice(0)
28
+ newCheckboxes[index].checked = !checkbox.checked
29
+ setCheckboxes(newCheckboxes)
30
+ }
31
+
5
32
  return (
6
- <Checkbox
7
- indeterminate
8
- name="checkbox-name"
9
- text="Indeterminate State"
10
- value="check-box value"
11
- {...props}
12
- />
33
+ <Table
34
+ container={false}
35
+ size="md"
36
+ >
37
+ <thead>
38
+ <tr>
39
+ <th>
40
+ <Checkbox
41
+ checked={isAllChecked}
42
+ indeterminate={!isAllChecked && !isNoneChecked}
43
+ name="checkbox-name"
44
+ onChange={onToggleAll}
45
+ text={isNoneChecked ? 'Check All' : 'Uncheck All'}
46
+ value="check-box value"
47
+ {...props}
48
+ />
49
+ </th>
50
+ </tr>
51
+ </thead>
52
+ <tbody>
53
+ {checkboxes.map((checkbox, index) => (
54
+ <tr key={index}>
55
+ <td>
56
+ <Checkbox
57
+ checked={checkbox.checked}
58
+ name={checkbox.name}
59
+ onChange={() => {
60
+ updateCheckboxes(checkbox, index)
61
+ }}
62
+ text={checkbox.name}
63
+ value="check-box value"
64
+ {...props}
65
+ />
66
+ </td>
67
+ </tr>
68
+ ))}
69
+ </tbody>
70
+ </Table>
13
71
  )
14
72
  }
15
73
 
@@ -16,7 +16,7 @@ $selector: ".pb_nav_list";
16
16
  list-style: none;
17
17
  }
18
18
 
19
- [class*=_title] {
19
+ [class*=pb_nav_list_title] {
20
20
  padding: 0 $space_md $space_sm;
21
21
  }
22
22
 
@@ -1,6 +1,42 @@
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 %>
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="Menu"
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
- {'Photos'}
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
  }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Playbook
4
- VERSION = "9.3.1.pre.alpha2"
4
+ VERSION = "9.4.0.alpha.user.kit.bug"
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.3.1.pre.alpha2
4
+ version: 9.4.0.alpha.user.kit.bug
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: 2021-04-12 00:00:00.000000000 Z
12
+ date: 2021-04-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -2107,8 +2107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
2107
2107
  - !ruby/object:Gem::Version
2108
2108
  version: 1.3.1
2109
2109
  requirements: []
2110
- rubyforge_project:
2111
- rubygems_version: 2.7.3
2110
+ rubygems_version: 3.1.4
2112
2111
  signing_key:
2113
2112
  specification_version: 4
2114
2113
  summary: Playbook Design System