playbook_ui 14.16.0.pre.alpha.PLAY1929bracketlayout6930 → 14.16.0.pre.alpha.play1756pbcontenttag6933
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_layout/_layout.scss +0 -58
- data/app/pb_kits/playbook/pb_layout/_layout.tsx +7 -16
- data/app/pb_kits/playbook/pb_layout/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_layout/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_layout/layout.test.js +0 -4
- data/app/pb_kits/playbook/pb_tooltip/tooltip.html.erb +2 -5
- data/app/pb_kits/playbook/pb_typeahead/typeahead.html.erb +2 -5
- data/app/pb_kits/playbook/pb_user/user.html.erb +1 -6
- data/app/pb_kits/playbook/pb_user_badge/user_badge.html.erb +1 -6
- data/dist/chunks/{_weekday_stacked-DEK84Xao.js → _weekday_stacked-DIIHW0OV.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/playbook-doc.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/kit_base.rb +4 -4
- data/lib/playbook/version.rb +1 -1
- metadata +2 -6
- data/app/pb_kits/playbook/pb_layout/docs/_layout_bracket.jsx +0 -190
- data/app/pb_kits/playbook/pb_layout/docs/_layout_bracket.md +0 -5
- data/app/pb_kits/playbook/pb_layout/subcomponents/_game.tsx +0 -90
- data/app/pb_kits/playbook/pb_layout/subcomponents/_round.tsx +0 -57
data/lib/playbook/kit_base.rb
CHANGED
@@ -91,11 +91,11 @@ module Playbook
|
|
91
91
|
# rubocop:disable Layout/CommentIndentation
|
92
92
|
# pb_content_tag information (potentially to be abstracted into its own dev doc in the future)
|
93
93
|
# The pb_content_tag generates HTML content tags for rails kits with flexible options.
|
94
|
-
# Modify a generated kit.html.erb file accordingly (the
|
94
|
+
# Modify a generated kit.html.erb file accordingly (the kit_base_default_options listed below no longer need to be explictly outlined in that file, only modifications).
|
95
95
|
# name - the first argument is for HTML tag. The default is :div.
|
96
96
|
# content_or_options_with_block - additional content or options for the tag (i.e., the customizations a dev adds to kit.html.erb).
|
97
97
|
# options - Within combined_options, the empty options hash allows for customizations to
|
98
|
-
# merge with the
|
98
|
+
# merge with the kit_base_default_options and combined_html_options.
|
99
99
|
# escape - set to true, this allows for HTML-escape.
|
100
100
|
# block - an optional block for content inside the tag.
|
101
101
|
# The return is a HTML tag that includes any provided customizations. If nothing is specified in kit.html.erb, the default shape is:
|
@@ -111,7 +111,7 @@ module Playbook
|
|
111
111
|
def pb_content_tag(name = :div, content_or_options_with_block = {}, options = {}, escape = true, &block)
|
112
112
|
combined_options = options
|
113
113
|
.merge(combined_html_options)
|
114
|
-
.merge(
|
114
|
+
.merge(kit_base_default_options.merge(content_or_options_with_block))
|
115
115
|
content_tag(name, combined_options, options, escape, &block)
|
116
116
|
end
|
117
117
|
# rubocop:enable Style/OptionalBooleanParameter
|
@@ -146,7 +146,7 @@ module Playbook
|
|
146
146
|
|
147
147
|
private
|
148
148
|
|
149
|
-
def
|
149
|
+
def kit_base_default_options
|
150
150
|
options = {
|
151
151
|
id: id,
|
152
152
|
data: data,
|
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: 14.16.0.pre.alpha.
|
4
|
+
version: 14.16.0.pre.alpha.play1756pbcontenttag6933
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Power UX
|
@@ -1795,8 +1795,6 @@ files:
|
|
1795
1795
|
- app/pb_kits/playbook/pb_layout/body.html.erb
|
1796
1796
|
- app/pb_kits/playbook/pb_layout/body.rb
|
1797
1797
|
- app/pb_kits/playbook/pb_layout/docs/_description.md
|
1798
|
-
- app/pb_kits/playbook/pb_layout/docs/_layout_bracket.jsx
|
1799
|
-
- app/pb_kits/playbook/pb_layout/docs/_layout_bracket.md
|
1800
1798
|
- app/pb_kits/playbook/pb_layout/docs/_layout_collection.html.erb
|
1801
1799
|
- app/pb_kits/playbook/pb_layout/docs/_layout_collection.jsx
|
1802
1800
|
- app/pb_kits/playbook/pb_layout/docs/_layout_collection.md
|
@@ -1830,8 +1828,6 @@ files:
|
|
1830
1828
|
- app/pb_kits/playbook/pb_layout/layout.test.js
|
1831
1829
|
- app/pb_kits/playbook/pb_layout/sidebar.html.erb
|
1832
1830
|
- app/pb_kits/playbook/pb_layout/sidebar.rb
|
1833
|
-
- app/pb_kits/playbook/pb_layout/subcomponents/_game.tsx
|
1834
|
-
- app/pb_kits/playbook/pb_layout/subcomponents/_round.tsx
|
1835
1831
|
- app/pb_kits/playbook/pb_legend/_legend.scss
|
1836
1832
|
- app/pb_kits/playbook/pb_legend/_legend.tsx
|
1837
1833
|
- app/pb_kits/playbook/pb_legend/docs/_description.md
|
@@ -3465,7 +3461,7 @@ files:
|
|
3465
3461
|
- app/pb_kits/playbook/utilities/text.ts
|
3466
3462
|
- app/pb_kits/playbook/utilities/validEmojiChecker.ts
|
3467
3463
|
- dist/chunks/_typeahead-Djo6qCne.js
|
3468
|
-
- dist/chunks/_weekday_stacked-
|
3464
|
+
- dist/chunks/_weekday_stacked-DIIHW0OV.js
|
3469
3465
|
- dist/chunks/lazysizes-B7xYodB-.js
|
3470
3466
|
- dist/chunks/lib-BGzBzFZX.js
|
3471
3467
|
- dist/chunks/pb_form_validation-BvNy9Bd6.js
|
@@ -1,190 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
|
3
|
-
import Layout from '../../pb_layout/_layout'
|
4
|
-
import Flex from '../../pb_flex/_flex'
|
5
|
-
import Body from '../../pb_body/_body'
|
6
|
-
import Caption from '../../pb_caption/_caption'
|
7
|
-
import SectionSeparator from '../../pb_section_separator/_section_separator'
|
8
|
-
|
9
|
-
const LayoutBracket = () => {
|
10
|
-
return (
|
11
|
-
<div>
|
12
|
-
<Layout
|
13
|
-
layout="bracket"
|
14
|
-
>
|
15
|
-
<Layout.RoundLabel>
|
16
|
-
<Caption>Wild Card</Caption>
|
17
|
-
<SectionSeparator marginY="sm"/>
|
18
|
-
</Layout.RoundLabel>
|
19
|
-
<Layout.Round marginBottom={{ xs: "md", sm: "md" }}>
|
20
|
-
<Layout.Game>
|
21
|
-
<Flex justify="between">
|
22
|
-
<Body>Packers</Body>
|
23
|
-
<Body>10</Body>
|
24
|
-
</Flex>
|
25
|
-
<Flex justify="between">
|
26
|
-
<Body><strong>Eagles</strong></Body>
|
27
|
-
<Body>22</Body>
|
28
|
-
</Flex>
|
29
|
-
</Layout.Game>
|
30
|
-
<Layout.Game>
|
31
|
-
<Flex justify="between">
|
32
|
-
<Body>Vikings</Body>
|
33
|
-
<Body>9</Body>
|
34
|
-
</Flex>
|
35
|
-
<Flex justify="between">
|
36
|
-
<Body><strong>Rams</strong></Body>
|
37
|
-
<Body>27</Body>
|
38
|
-
</Flex>
|
39
|
-
</Layout.Game>
|
40
|
-
<Layout.Game>
|
41
|
-
<Flex justify="between">
|
42
|
-
<Body><strong>Lions</strong></Body>
|
43
|
-
</Flex>
|
44
|
-
<Flex justify="between">
|
45
|
-
<Body>BYE</Body>
|
46
|
-
</Flex>
|
47
|
-
</Layout.Game>
|
48
|
-
<Layout.Game>
|
49
|
-
<Flex justify="between">
|
50
|
-
<Body><strong>Commanders</strong></Body>
|
51
|
-
<Body>23</Body>
|
52
|
-
</Flex>
|
53
|
-
<Flex justify="between">
|
54
|
-
<Body>Buccaneers</Body>
|
55
|
-
<Body>20</Body>
|
56
|
-
</Flex>
|
57
|
-
</Layout.Game>
|
58
|
-
<Layout.Game>
|
59
|
-
<Flex justify="between">
|
60
|
-
<Body><strong>Chiefs</strong></Body>
|
61
|
-
</Flex>
|
62
|
-
<Flex justify="between">
|
63
|
-
<Body>BYE</Body>
|
64
|
-
</Flex>
|
65
|
-
</Layout.Game>
|
66
|
-
<Layout.Game>
|
67
|
-
<Flex justify="between">
|
68
|
-
<Body>Chargers</Body>
|
69
|
-
<Body>12</Body>
|
70
|
-
</Flex>
|
71
|
-
<Flex justify="between">
|
72
|
-
<Body><strong>Texans</strong></Body>
|
73
|
-
<Body>32</Body>
|
74
|
-
</Flex>
|
75
|
-
</Layout.Game>
|
76
|
-
<Layout.Game>
|
77
|
-
<Flex justify="between">
|
78
|
-
<Body>Broncos</Body>
|
79
|
-
<Body>7</Body>
|
80
|
-
</Flex>
|
81
|
-
<Flex justify="between">
|
82
|
-
<Body><strong>Bills</strong></Body>
|
83
|
-
<Body>31</Body>
|
84
|
-
</Flex>
|
85
|
-
</Layout.Game>
|
86
|
-
<Layout.Game>
|
87
|
-
<Flex justify="between">
|
88
|
-
<Body>Steelers</Body>
|
89
|
-
<Body>14</Body>
|
90
|
-
</Flex>
|
91
|
-
<Flex justify="between">
|
92
|
-
<Body><strong>Ravens</strong></Body>
|
93
|
-
<Body>28</Body>
|
94
|
-
</Flex>
|
95
|
-
</Layout.Game>
|
96
|
-
</Layout.Round>
|
97
|
-
<Layout.RoundLabel>
|
98
|
-
<Caption>Divisional</Caption>
|
99
|
-
<SectionSeparator marginY="sm"/>
|
100
|
-
</Layout.RoundLabel>
|
101
|
-
<Layout.Round marginBottom={{ xs: "md", sm: "md" }}>
|
102
|
-
<Layout.Game>
|
103
|
-
<Flex justify="between">
|
104
|
-
<Body>Rams</Body>
|
105
|
-
<Body>22</Body>
|
106
|
-
</Flex>
|
107
|
-
<Flex justify="between">
|
108
|
-
<Body><strong>Eagles</strong></Body>
|
109
|
-
<Body>28</Body>
|
110
|
-
</Flex>
|
111
|
-
</Layout.Game>
|
112
|
-
<Layout.Game>
|
113
|
-
<Flex justify="between">
|
114
|
-
<Body><strong>Commanders</strong></Body>
|
115
|
-
<Body>45</Body>
|
116
|
-
</Flex>
|
117
|
-
<Flex justify="between">
|
118
|
-
<Body>Lions</Body>
|
119
|
-
<Body>31</Body>
|
120
|
-
</Flex>
|
121
|
-
</Layout.Game>
|
122
|
-
<Layout.Game>
|
123
|
-
<Flex justify="between">
|
124
|
-
<Body>Texans</Body>
|
125
|
-
<Body>14</Body>
|
126
|
-
</Flex>
|
127
|
-
<Flex justify="between">
|
128
|
-
<Body><strong>Chiefs</strong></Body>
|
129
|
-
<Body>23</Body>
|
130
|
-
</Flex>
|
131
|
-
</Layout.Game>
|
132
|
-
<Layout.Game>
|
133
|
-
<Flex justify="between">
|
134
|
-
<Body>Ravens</Body>
|
135
|
-
<Body>25</Body>
|
136
|
-
</Flex>
|
137
|
-
<Flex justify="between">
|
138
|
-
<Body><strong>Bills</strong></Body>
|
139
|
-
<Body>27</Body>
|
140
|
-
</Flex>
|
141
|
-
</Layout.Game>
|
142
|
-
</Layout.Round>
|
143
|
-
<Layout.RoundLabel>
|
144
|
-
<Caption>Conference</Caption>
|
145
|
-
<SectionSeparator marginY="sm"/>
|
146
|
-
</Layout.RoundLabel>
|
147
|
-
<Layout.Round marginBottom={{ xs: "md", sm: "md" }}>
|
148
|
-
<Layout.Game>
|
149
|
-
<Flex justify="between">
|
150
|
-
<Body>Commanders</Body>
|
151
|
-
<Body>23</Body>
|
152
|
-
</Flex>
|
153
|
-
<Flex justify="between">
|
154
|
-
<Body><strong>Eagles</strong></Body>
|
155
|
-
<Body>55</Body>
|
156
|
-
</Flex>
|
157
|
-
</Layout.Game>
|
158
|
-
<Layout.Game>
|
159
|
-
<Flex justify="between">
|
160
|
-
<Body>Bills</Body>
|
161
|
-
<Body>29</Body>
|
162
|
-
</Flex>
|
163
|
-
<Flex justify="between">
|
164
|
-
<Body><strong>Chiefs</strong></Body>
|
165
|
-
<Body>32</Body>
|
166
|
-
</Flex>
|
167
|
-
</Layout.Game>
|
168
|
-
</Layout.Round>
|
169
|
-
<Layout.RoundLabel>
|
170
|
-
<Caption>Super Bowl</Caption>
|
171
|
-
<SectionSeparator marginY="sm"/>
|
172
|
-
</Layout.RoundLabel>
|
173
|
-
<Layout.Round>
|
174
|
-
<Layout.Game>
|
175
|
-
<Flex justify="between">
|
176
|
-
<Body>Chiefs</Body>
|
177
|
-
<Body>22</Body>
|
178
|
-
</Flex>
|
179
|
-
<Flex justify="between">
|
180
|
-
<Body><strong>Eagles</strong></Body>
|
181
|
-
<Body>40</Body>
|
182
|
-
</Flex>
|
183
|
-
</Layout.Game>
|
184
|
-
</Layout.Round>
|
185
|
-
</Layout>
|
186
|
-
</div>
|
187
|
-
)
|
188
|
-
}
|
189
|
-
|
190
|
-
export default LayoutBracket
|
@@ -1,5 +0,0 @@
|
|
1
|
-
Use `<Layout.RoundLabel>`, `<Layout.Round>`, and `<Layout.Game>` to make a bracket layout.
|
2
|
-
|
3
|
-
On mobile devices, `<Layout.RoundLabel>` will display (on desktop these components are hidden) and the bracket will be in one column.
|
4
|
-
|
5
|
-
Ensure that each `<Layout.Game>` maintains a consistent height for the bracket lines to lay out properly.
|
@@ -1,90 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
import classnames from 'classnames'
|
3
|
-
|
4
|
-
import { GlobalProps, globalProps, globalInlineProps } from '../../utilities/globalProps'
|
5
|
-
|
6
|
-
import Card from '../../pb_card/_card'
|
7
|
-
import SectionSeparator from '../../pb_section_separator/_section_separator'
|
8
|
-
|
9
|
-
type LayoutGameProps = {
|
10
|
-
children: React.ReactNode[] | React.ReactNode,
|
11
|
-
className?: string,
|
12
|
-
numberOfRounds: number,
|
13
|
-
numberOfGames: number,
|
14
|
-
isOdd: boolean,
|
15
|
-
} & GlobalProps
|
16
|
-
|
17
|
-
// Game component (modeled after Item)
|
18
|
-
const Game = (props: LayoutGameProps) => {
|
19
|
-
const { children, className, numberOfRounds, numberOfGames, isOdd } = props
|
20
|
-
const dynamicInlineProps = globalInlineProps(props)
|
21
|
-
|
22
|
-
const numberOfChildren = Array.isArray(children) ? children.length : 0
|
23
|
-
|
24
|
-
const isMultiple = Array.isArray(children)
|
25
|
-
|
26
|
-
let ratio = 0
|
27
|
-
let exponent
|
28
|
-
if (numberOfGames > 1) {
|
29
|
-
exponent = (numberOfRounds) - Math.log2(numberOfGames) - 1
|
30
|
-
ratio = 2 ** exponent
|
31
|
-
}
|
32
|
-
|
33
|
-
if (numberOfChildren === 2) {
|
34
|
-
const [firstChild, secondChild] = React.Children.toArray(children)
|
35
|
-
|
36
|
-
if (React.isValidElement(firstChild) && React.isValidElement(secondChild)) {
|
37
|
-
return (
|
38
|
-
<div
|
39
|
-
className={classnames('layout_game', globalProps(props), className)}
|
40
|
-
style={dynamicInlineProps}
|
41
|
-
>
|
42
|
-
<Card
|
43
|
-
marginY="xs"
|
44
|
-
padding="none"
|
45
|
-
shadow="deep"
|
46
|
-
>
|
47
|
-
<Card.Body padding="xs">{firstChild}</Card.Body>
|
48
|
-
<SectionSeparator />
|
49
|
-
<Card.Body padding="xs">{secondChild}</Card.Body>
|
50
|
-
</Card>
|
51
|
-
{isOdd && numberOfGames > 1 &&
|
52
|
-
<div
|
53
|
-
className="half_box"
|
54
|
-
style={{ height: `calc(${ratio} * 100% + 4px)` }}
|
55
|
-
/>
|
56
|
-
}
|
57
|
-
</div>
|
58
|
-
)
|
59
|
-
}
|
60
|
-
}
|
61
|
-
|
62
|
-
return (
|
63
|
-
<div
|
64
|
-
className={classnames('layout_game', globalProps(props), className)}
|
65
|
-
style={dynamicInlineProps}
|
66
|
-
>
|
67
|
-
{((!isMultiple && children) || numberOfChildren >= 1 )? (
|
68
|
-
children
|
69
|
-
) : (
|
70
|
-
<Card
|
71
|
-
marginY="xs"
|
72
|
-
padding="none"
|
73
|
-
shadow="deep"
|
74
|
-
>
|
75
|
-
<Card.Body padding="xs">To be determined...</Card.Body>
|
76
|
-
<SectionSeparator />
|
77
|
-
<Card.Body padding="xs">To be determined...</Card.Body>
|
78
|
-
</Card>
|
79
|
-
)}
|
80
|
-
{isOdd && numberOfGames > 1 &&
|
81
|
-
<div
|
82
|
-
className="half_box"
|
83
|
-
style={{ height: `calc(${ratio} * 100% + 4px)` }}
|
84
|
-
/>
|
85
|
-
}
|
86
|
-
</div>
|
87
|
-
)
|
88
|
-
}
|
89
|
-
|
90
|
-
export default Game
|
@@ -1,57 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
import classnames from 'classnames'
|
3
|
-
|
4
|
-
import { GlobalProps, globalProps, globalInlineProps } from '../../utilities/globalProps'
|
5
|
-
|
6
|
-
type LayoutRoundLabelProps = {
|
7
|
-
children: React.ReactNode[] | React.ReactNode,
|
8
|
-
className?: string,
|
9
|
-
} & GlobalProps
|
10
|
-
|
11
|
-
export const RoundLabel = (props: LayoutRoundLabelProps) => {
|
12
|
-
const { children, className } = props
|
13
|
-
const dynamicInlineProps = globalInlineProps(props)
|
14
|
-
return (
|
15
|
-
<div
|
16
|
-
className={classnames('layout_round_label', className)}
|
17
|
-
style={dynamicInlineProps}
|
18
|
-
>
|
19
|
-
{children}
|
20
|
-
</div>
|
21
|
-
)
|
22
|
-
}
|
23
|
-
|
24
|
-
type LayoutRoundProps = {
|
25
|
-
children: React.ReactNode[] | React.ReactNode,
|
26
|
-
className?: string,
|
27
|
-
numberOfRounds: number,
|
28
|
-
} & GlobalProps
|
29
|
-
|
30
|
-
export const Round = (props: LayoutRoundProps) => {
|
31
|
-
const { children, className, numberOfRounds } = props
|
32
|
-
const dynamicInlineProps = globalInlineProps(props)
|
33
|
-
const numberOfChildren = Array.isArray(children) ? children.length : 0
|
34
|
-
|
35
|
-
const childrenWithProps = Array.isArray(children) ? children.map((child, index) =>
|
36
|
-
React.isValidElement(child) ? React.cloneElement(child, { numberOfRounds, numberOfGames: numberOfChildren, isOdd: index % 2 === 0 }) : child
|
37
|
-
) : children
|
38
|
-
|
39
|
-
const rightConnectors = Array.from({ length: numberOfChildren / 2 }, (_, index) => (
|
40
|
-
<div
|
41
|
-
className="right_connector"
|
42
|
-
key={`right_connector_${index}`}
|
43
|
-
/>
|
44
|
-
))
|
45
|
-
|
46
|
-
return (
|
47
|
-
<>
|
48
|
-
<div
|
49
|
-
className={classnames('layout_round', globalProps(props), className)}
|
50
|
-
style={dynamicInlineProps}
|
51
|
-
>
|
52
|
-
{childrenWithProps}
|
53
|
-
</div>
|
54
|
-
<div className="connector_container">{rightConnectors}</div>
|
55
|
-
</>
|
56
|
-
)
|
57
|
-
}
|