playbook_ui 12.37.0.pre.alpha.PLAY951collapsiblenav31062 → 12.37.0.pre.alpha.PLAYaddingdatapropselectkit1071

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_collapsible/_collapsible.scss +0 -6
  3. data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +3 -3
  4. data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleMain.tsx +9 -10
  5. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_color.jsx +2 -2
  6. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_default.jsx +2 -2
  7. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_icons.jsx +8 -4
  8. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_icons.md +1 -1
  9. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_size.jsx +5 -5
  10. data/app/pb_kits/playbook/pb_collapsible/docs/example.yml +6 -7
  11. data/app/pb_kits/playbook/pb_collapsible/docs/index.js +1 -2
  12. data/app/pb_kits/playbook/pb_date/_date.tsx +7 -8
  13. data/app/pb_kits/playbook/pb_date/docs/_date_alignment.jsx +2 -2
  14. data/app/pb_kits/playbook/pb_date/docs/_date_default.jsx +29 -5
  15. data/app/pb_kits/playbook/pb_date/docs/_date_unstyled.jsx +2 -2
  16. data/app/pb_kits/playbook/pb_date/docs/_date_variants.jsx +5 -5
  17. data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.tsx +45 -31
  18. data/app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.tsx +5 -3
  19. data/app/pb_kits/playbook/pb_date_stacked/_date_stacked.tsx +24 -21
  20. data/app/pb_kits/playbook/pb_date_time/_date_time.tsx +1 -1
  21. data/app/pb_kits/playbook/pb_date_time/dateTime.test.js +1 -1
  22. data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx +2 -2
  23. data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js +1 -1
  24. data/app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.tsx +6 -8
  25. data/app/pb_kits/playbook/pb_kit/dateTime.ts +146 -63
  26. data/app/pb_kits/playbook/pb_label_value/_label_value.tsx +52 -31
  27. data/app/pb_kits/playbook/pb_message/_message.tsx +24 -24
  28. data/app/pb_kits/playbook/pb_nav/_collapsible_nav.scss +16 -141
  29. data/app/pb_kits/playbook/pb_nav/_item.tsx +22 -33
  30. data/app/pb_kits/playbook/pb_nav/_subtle_mixin.scss +6 -6
  31. data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav.jsx +58 -79
  32. data/app/pb_kits/playbook/pb_nav/docs/{_collapsible_nav_emphasize.jsx → _collapsible_nav_custom_icons.jsx} +3 -5
  33. data/app/pb_kits/playbook/pb_nav/docs/example.yml +3 -5
  34. data/app/pb_kits/playbook/pb_nav/docs/index.js +1 -2
  35. data/app/pb_kits/playbook/pb_nav/item.html.erb +4 -5
  36. data/app/pb_kits/playbook/pb_nav/item.rb +2 -17
  37. data/app/pb_kits/playbook/pb_select/docs/_select_data_attributes.html.erb +24 -0
  38. data/app/pb_kits/playbook/pb_select/docs/_select_data_attributes.md +1 -0
  39. data/app/pb_kits/playbook/pb_select/docs/example.yml +1 -0
  40. data/app/pb_kits/playbook/pb_select/select.html.erb +1 -1
  41. data/app/pb_kits/playbook/pb_time/_time.tsx +9 -11
  42. data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.tsx +46 -49
  43. data/app/pb_kits/playbook/pb_time_stacked/_time_stacked.tsx +4 -6
  44. data/app/pb_kits/playbook/pb_timestamp/_timestamp.tsx +11 -11
  45. data/app/pb_kits/playbook/pb_weekday_stacked/_weekday_stacked.tsx +8 -11
  46. data/dist/playbook-rails.js +7 -7
  47. data/lib/playbook/version.rb +1 -1
  48. metadata +5 -11
  49. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_state.jsx +0 -75
  50. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_state.md +0 -3
  51. data/app/pb_kits/playbook/pb_logistic/_logistic.jsx +0 -120
  52. data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav.md +0 -1
  53. data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_custom.jsx +0 -57
  54. data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_custom.md +0 -1
  55. data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_emphasize.html.erb +0 -23
  56. data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_emphasize.md +0 -1
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Playbook
4
4
  PREVIOUS_VERSION = "12.37.0"
5
- VERSION = "12.37.0.pre.alpha.PLAY951collapsiblenav31062"
5
+ VERSION = "12.37.0.pre.alpha.PLAYaddingdatapropselectkit1071"
6
6
  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: 12.37.0.pre.alpha.PLAY951collapsiblenav31062
4
+ version: 12.37.0.pre.alpha.PLAYaddingdatapropselectkit1071
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: 2023-08-10 00:00:00.000000000 Z
12
+ date: 2023-08-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -616,8 +616,6 @@ files:
616
616
  - app/pb_kits/playbook/pb_collapsible/docs/_collapsible_size.html.erb
617
617
  - app/pb_kits/playbook/pb_collapsible/docs/_collapsible_size.jsx
618
618
  - app/pb_kits/playbook/pb_collapsible/docs/_collapsible_size.md
619
- - app/pb_kits/playbook/pb_collapsible/docs/_collapsible_state.jsx
620
- - app/pb_kits/playbook/pb_collapsible/docs/_collapsible_state.md
621
619
  - app/pb_kits/playbook/pb_collapsible/docs/example.yml
622
620
  - app/pb_kits/playbook/pb_collapsible/docs/index.js
623
621
  - app/pb_kits/playbook/pb_collapsible/index.js
@@ -1436,7 +1434,6 @@ files:
1436
1434
  - app/pb_kits/playbook/pb_loading_inline/loading_inline.html.erb
1437
1435
  - app/pb_kits/playbook/pb_loading_inline/loading_inline.rb
1438
1436
  - app/pb_kits/playbook/pb_loading_inline/loading_inline.test.js
1439
- - app/pb_kits/playbook/pb_logistic/_logistic.jsx
1440
1437
  - app/pb_kits/playbook/pb_map/_map.scss
1441
1438
  - app/pb_kits/playbook/pb_map/_map.tsx
1442
1439
  - app/pb_kits/playbook/pb_map/_map_controls.tsx
@@ -1540,12 +1537,7 @@ files:
1540
1537
  - app/pb_kits/playbook/pb_nav/docs/_borderless_nav.jsx
1541
1538
  - app/pb_kits/playbook/pb_nav/docs/_collapsible_nav.html.erb
1542
1539
  - app/pb_kits/playbook/pb_nav/docs/_collapsible_nav.jsx
1543
- - app/pb_kits/playbook/pb_nav/docs/_collapsible_nav.md
1544
- - app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_custom.jsx
1545
- - app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_custom.md
1546
- - app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_emphasize.html.erb
1547
- - app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_emphasize.jsx
1548
- - app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_emphasize.md
1540
+ - app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_custom_icons.jsx
1549
1541
  - app/pb_kits/playbook/pb_nav/docs/_default_nav.html.erb
1550
1542
  - app/pb_kits/playbook/pb_nav/docs/_default_nav.jsx
1551
1543
  - app/pb_kits/playbook/pb_nav/docs/_description.md
@@ -1863,6 +1855,8 @@ files:
1863
1855
  - app/pb_kits/playbook/pb_select/docs/_select_blank.jsx
1864
1856
  - app/pb_kits/playbook/pb_select/docs/_select_custom_select.html.erb
1865
1857
  - app/pb_kits/playbook/pb_select/docs/_select_custom_select.jsx
1858
+ - app/pb_kits/playbook/pb_select/docs/_select_data_attributes.html.erb
1859
+ - app/pb_kits/playbook/pb_select/docs/_select_data_attributes.md
1866
1860
  - app/pb_kits/playbook/pb_select/docs/_select_default.html.erb
1867
1861
  - app/pb_kits/playbook/pb_select/docs/_select_default.jsx
1868
1862
  - app/pb_kits/playbook/pb_select/docs/_select_disabled.html.erb
@@ -1,75 +0,0 @@
1
- import React from 'react'
2
- import { Collapsible, useCollapsible, Button } from '../..'
3
-
4
- const CollapsibleState = (props) => {
5
- const [isCollapsed, setIsCollapsed] = useCollapsible(true)
6
-
7
- return (
8
- <>
9
- <Button
10
- onClick={() => setIsCollapsed(!isCollapsed)}
11
- padding="none"
12
- variant="link"
13
- >
14
- {isCollapsed ? "Expand All" : "Collapse All"}
15
- </Button>
16
-
17
- <Collapsible
18
- collapsed={isCollapsed}
19
- icon={["plus", "minus"]}
20
- padding="none"
21
- >
22
- <Collapsible.Main padding="sm"
23
- {...props}
24
- >
25
- <div>{"Main Section"}</div>
26
- </Collapsible.Main>
27
- <Collapsible.Content>
28
- <div>
29
- {
30
- "Lorem ipsum dolor sit amet, consectetur adipiscing elit. In vel erat sed purus hendrerit viverra. Duis et vestibulum metus. Sed consequat ut ante non vehicula. Etiam nunc massa, pharetra vel quam id, posuere rhoncus quam. Quisque imperdiet arcu enim, nec aliquet justo auctor eget. Curabitur in metus nec nunc rhoncus faucibus vitae ac elit."
31
- }
32
- </div>
33
- </Collapsible.Content>
34
- </Collapsible>
35
- <Collapsible
36
- collapsed={isCollapsed}
37
- icon={["plus", "minus"]}
38
- padding="none"
39
- >
40
- <Collapsible.Main padding="sm"
41
- {...props}
42
- >
43
- <div>{"Main Section"}</div>
44
- </Collapsible.Main>
45
- <Collapsible.Content>
46
- <div>
47
- {
48
- "Lorem ipsum dolor sit amet, consectetur adipiscing elit. In vel erat sed purus hendrerit viverra. Duis et vestibulum metus. Sed consequat ut ante non vehicula. Etiam nunc massa, pharetra vel quam id, posuere rhoncus quam. Quisque imperdiet arcu enim, nec aliquet justo auctor eget. Curabitur in metus nec nunc rhoncus faucibus vitae ac elit."
49
- }
50
- </div>
51
- </Collapsible.Content>
52
- </Collapsible>
53
- <Collapsible
54
- collapsed={isCollapsed}
55
- icon={["plus", "minus"]}
56
- padding="none"
57
- >
58
- <Collapsible.Main padding="sm"
59
- {...props}
60
- >
61
- <div>{"Main Section"}</div>
62
- </Collapsible.Main>
63
- <Collapsible.Content>
64
- <div>
65
- {
66
- "Lorem ipsum dolor sit amet, consectetur adipiscing elit. In vel erat sed purus hendrerit viverra. Duis et vestibulum metus. Sed consequat ut ante non vehicula. Etiam nunc massa, pharetra vel quam id, posuere rhoncus quam. Quisque imperdiet arcu enim, nec aliquet justo auctor eget. Curabitur in metus nec nunc rhoncus faucibus vitae ac elit."
67
- }
68
- </div>
69
- </Collapsible.Content>
70
- </Collapsible>
71
- </>
72
- )
73
- }
74
-
75
- export default CollapsibleState
@@ -1,3 +0,0 @@
1
- The `collapsed` prop allows you to toggle the collapsible with external controls (like buttons) when used in conjunction with our `useCollapsible` hook.
2
-
3
- NOTE: you must import and declare the `useCollapsible` hook then pass its state to the collapsed prop of any Collapsible you wish to manage with the external control. See our code example for details.
@@ -1,120 +0,0 @@
1
- /* @flow */
2
-
3
- import React from 'react'
4
- import classnames from 'classnames'
5
-
6
- import DateTime from '../pb_kit/dateTime'
7
- import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
8
- import { globalProps } from '../utilities/globalProps'
9
-
10
- import Body from '../pb_body/_body'
11
- import Caption from '../pb_caption/_caption'
12
- import Icon from '../pb_icon/_icon'
13
- import Title from '../pb_title/_title'
14
-
15
- const dateString = (value: DateTime) => {
16
- const month = value.toMonthNum()
17
- const day = value.toDay()
18
-
19
- return ` · ${month}/${day}`
20
- }
21
-
22
- type LogisticProps = {
23
- aria?: object,
24
- className?: string,
25
- dark?: boolean,
26
- data?: object,
27
- date: string,
28
- id?: string,
29
- link?: string,
30
- projectName?: string,
31
- projectNumber?: number,
32
- }
33
-
34
- const Logistic = (props: LogisticProps) => {
35
- const { aria = {},
36
- className,
37
- dark = false,
38
- data = {},
39
- date,
40
- id,
41
- link,
42
- projectName,
43
- projectNumber } = props
44
-
45
- const ariaProps = buildAriaProps(aria)
46
- const dataProps = buildDataProps(data)
47
- const formattedDate = new DateTime({ value: date })
48
- const classes = classnames(
49
- buildCss('pb_logistic_kit', { dark }),
50
- globalProps(props),
51
- className
52
- )
53
-
54
- return (
55
- <div
56
- {...ariaProps}
57
- {...dataProps}
58
- className={classes}
59
- id={id}
60
- >
61
- <Body color="light">
62
- <Caption text="Project" />
63
- <Icon
64
- fixedWidth
65
- icon="home"
66
- />
67
-
68
- {` ${projectNumber}`}
69
-
70
- <Choose>
71
- <When condition={link}>
72
- <a
73
- className="pb_logistic_kit_links"
74
- href={link}
75
- >
76
- <Choose>
77
- <When condition={date}>
78
- <Title
79
- size={4}
80
- tag="span"
81
- text={' ' + projectName + dateString(formattedDate)}
82
- />
83
- </When>
84
- <Otherwise>
85
- <Title
86
- size={4}
87
- tag="span"
88
- text={' ' + projectName}
89
- />
90
- </Otherwise>
91
- </Choose>
92
- </a>
93
- </When>
94
- <Otherwise>
95
- <Choose>
96
- <When condition={date}>
97
- <Title
98
- dark={dark}
99
- size={4}
100
- tag="span"
101
- text={' ' + projectName + dateString(formattedDate)}
102
- />
103
- </When>
104
- <Otherwise>
105
- <Title
106
- dark={dark}
107
- size={4}
108
- tag="span"
109
- text={' ' + projectName}
110
- />
111
- </Otherwise>
112
- </Choose>
113
- </Otherwise>
114
- </Choose>
115
- </Body>
116
- </div>
117
- )
118
- }
119
-
120
- export default Logistic
@@ -1 +0,0 @@
1
- The `collapsible` prop allows users to create a nested, collapsible nav. Pass `collapsible` to NavItem and nest as many more NavItems as needed as children for that NavItem to see this in action.
@@ -1,57 +0,0 @@
1
- import React from "react"
2
- import { Nav, NavItem, useCollapsible } from "../.."
3
-
4
- const CollapsibleNavCustom = (props) => {
5
- const navItems = ["Overview", "Albums", "Similar Artists"]
6
- // eslint-disable-next-line react-hooks/rules-of-hooks
7
- const collapsibles = navItems.map(() => useCollapsible(true))
8
-
9
- const handleMainClick = (index) => {
10
- collapsibles.forEach(([, , setCollapsed], idx) => {
11
- if (idx === index) {
12
- setCollapsed(false)
13
- } else {
14
- setCollapsed(true)
15
- }
16
- })
17
- }
18
-
19
- return (
20
- <>
21
- <Nav variant='subtle'>
22
- {navItems.map((text, index) => {
23
- const [collapsed] = collapsibles[index]
24
- return (
25
- <NavItem
26
- collapsed={collapsed}
27
- collapsible
28
- emphasized
29
- iconLeft="chevron-down"
30
- id={`collapsible-nav-item-${index + 1}`}
31
- key={index}
32
- link="#"
33
- onClick={() => handleMainClick(index)}
34
- text={text}
35
- {...props}
36
- >
37
- <NavItem link="#"
38
- text="City"
39
- {...props}
40
- />
41
- <NavItem link="#"
42
- text="People"
43
- {...props}
44
- />
45
- <NavItem link="#"
46
- text="Business"
47
- {...props}
48
- />
49
- </NavItem>
50
- );
51
- })}
52
- </Nav>
53
- </>
54
- )
55
- }
56
-
57
- export default CollapsibleNavCustom
@@ -1 +0,0 @@
1
- The collapsible nav kit uses our Collapsible kit under the hood and as such the `useCollapsible` hook can be used to achieve custom toggling of the collapsible nav. To do this, you must import and declare the `useCollapsible` hook and pass it's state to the `collapsed` prop. See our code example below to see how this can be done.
@@ -1,23 +0,0 @@
1
- <%= pb_rails("nav", props: { variant: "subtle" }) do %>
2
- <%= pb_rails("nav/item", props: { text: "Overview", link: "#", emphasized: true, collapsible: true, icon_left:"city" }) do %>
3
- <%= pb_rails("nav", props: { variant: "subtle" }) do %>
4
- <%= pb_rails("nav/item", props: { text: "City", link: "#" }) %>
5
- <%= pb_rails("nav/item", props: { text: "People", link: "#" }) %>
6
- <%= pb_rails("nav/item", props: { text: "Business", link: "#" }) %>
7
- <% end %>
8
- <% end %>
9
- <%= pb_rails("nav/item", props: { text: "Albums", link: "#", emphasized: true, collapsible: true, icon_left: "theater-masks" }) do %>
10
- <%= pb_rails("nav", props: { variant: "subtle" }) do %>
11
- <%= pb_rails("nav/item", props: { text: "Entertainment", link: "#" }) %>
12
- <%= pb_rails("nav/item", props: { text: "Food", link: "#" }) %>
13
- <%= pb_rails("nav/item", props: { text: "Style", link: "#" }) %>
14
- <% end %>
15
- <% end %>
16
- <%= pb_rails("nav/item", props: { text: "Similar Artists", link: "#", emphasized: true, collapsible: true, icon_left: "city" }) do %>
17
- <%= pb_rails("nav", props: { variant: "subtle" }) do %>
18
- <%= pb_rails("nav/item", props: { text: "City", link: "#" }) %>
19
- <%= pb_rails("nav/item", props: { text: "People", link: "#" }) %>
20
- <%= pb_rails("nav/item", props: { text: "Business", link: "#" }) %>
21
- <% end %>
22
- <% end %>
23
- <% end %>
@@ -1 +0,0 @@
1
- The `emphasized` prop can be passed to NavItem for a more emphasized look for the collapsible Nav.