playbook_ui 14.14.0.pre.rc.4 → 14.14.0.pre.rc.5
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/_playbook.scss +0 -1
- data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.scss +6 -1
- data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.tsx +7 -5
- data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_default.html.erb +1 -0
- data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_default.jsx +7 -0
- data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_default.md +1 -0
- data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_full_width.html.erb +1 -0
- data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_full_width.jsx +18 -0
- data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_full_width_rails.md +1 -0
- data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_full_width_react.md +1 -0
- data/app/pb_kits/playbook/pb_progress_pills/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_progress_pills/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_progress_pills/progress_pills.html.erb +1 -1
- data/app/pb_kits/playbook/pb_progress_pills/progress_pills.rb +6 -0
- data/app/pb_kits/playbook/pb_progress_pills/progress_pills.test.js +26 -1
- data/dist/chunks/{_typeahead-KwZhr9u1.js → _typeahead-CAIQfP7X.js} +1 -1
- data/dist/chunks/_weekday_stacked-DstwbGUv.js +45 -0
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +0 -7
- data/dist/playbook-doc.js +1 -1
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +9 -20
- data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.scss +0 -66
- data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.tsx +0 -98
- data/app/pb_kits/playbook/pb_avatar_action_button/avatar_action_button.html.erb +0 -28
- data/app/pb_kits/playbook/pb_avatar_action_button/avatar_action_button.rb +0 -42
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_actions.html.erb +0 -19
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_actions.jsx +0 -26
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_default.html.erb +0 -10
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_default.jsx +0 -17
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_on_click.jsx +0 -19
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_onclick.html.erb +0 -16
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_placement.html.erb +0 -35
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_placement.jsx +0 -42
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_tooltip.html.erb +0 -13
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/example.yml +0 -15
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/index.js +0 -4
- data/app/pb_kits/playbook/pb_avatar_action_button/pb_avatar_action_button.test.js +0 -31
- data/dist/chunks/_weekday_stacked-DSJpSZ3B.js +0 -45
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a78bc366f1f7086a31c4095eb10e5c5ee0be08a56c68327597848a0d7a9236a
|
4
|
+
data.tar.gz: 83701efa1b7889f3359c4e73dde11ce3f2a48d5ec39e42d5c550f5c6299aeb38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a51f1c37116779e420d0a30abe9aa0617d611103fdb5bf1e44aa3639be7e4d09ab61d71ea2e29173dc6a144110a262eaf7a27370c110db5926d24b80a20d870f
|
7
|
+
data.tar.gz: 4dceab2450821e9c3b12a791d4b919d747341b7b73fca55b83ff18fa6c460a0e39204a0d7bd3757b2bd53b46ad37af9a5624222e897e0ffe1f2f5d12938b9c4d
|
@@ -3,7 +3,8 @@
|
|
3
3
|
@import "../tokens/border_radius";
|
4
4
|
|
5
5
|
@mixin pb_progress_pill {
|
6
|
-
width:
|
6
|
+
width: 100%;
|
7
|
+
max-width: 45px;
|
7
8
|
height: 4px;
|
8
9
|
border-radius: $border_rad_light;
|
9
10
|
margin-right: $space_xs;
|
@@ -27,6 +28,10 @@
|
|
27
28
|
[class*=pb_progress_pill] {
|
28
29
|
@include pb_progress_pill;
|
29
30
|
|
31
|
+
&.full_width_pill {
|
32
|
+
max-width: none;
|
33
|
+
}
|
34
|
+
|
30
35
|
&[class*=_inactive] {
|
31
36
|
background-color: $border_light;
|
32
37
|
&.dark {
|
@@ -13,6 +13,7 @@ type ProgressPillsProps = {
|
|
13
13
|
className?: string,
|
14
14
|
data?: { [key: string]: string },
|
15
15
|
dark?: boolean,
|
16
|
+
fullWidthPill?: boolean,
|
16
17
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
17
18
|
id?: string,
|
18
19
|
steps?: number,
|
@@ -20,19 +21,19 @@ type ProgressPillsProps = {
|
|
20
21
|
value?: string,
|
21
22
|
}
|
22
23
|
|
23
|
-
const ProgressPill = ({ active, dark, steps: step }: ProgressPillsProps) => (
|
24
|
+
const ProgressPill = ({ active, dark, steps: step, fullWidthPill }: ProgressPillsProps) => (
|
24
25
|
<div
|
25
26
|
className={`pb_progress_pill${step <= active ? '_active' : '_inactive'}${dark ? ' dark' : ''
|
26
|
-
}`}
|
27
|
+
}${fullWidthPill ? ' full_width_pill' : ''}`}
|
27
28
|
key={step}
|
28
29
|
/>
|
29
30
|
)
|
30
31
|
|
31
|
-
const showSteps = (steps: number, active: number, dark: boolean) => {
|
32
|
+
const showSteps = (steps: number, active: number, dark: boolean, fullWidthPill: boolean) => {
|
32
33
|
const items = []
|
33
34
|
|
34
35
|
for (let step = 1; step <= steps; step++) {
|
35
|
-
items.push(ProgressPill({ steps: step, active, dark }))
|
36
|
+
items.push(ProgressPill({ steps: step, active, dark, fullWidthPill }))
|
36
37
|
}
|
37
38
|
|
38
39
|
return items
|
@@ -44,6 +45,7 @@ const ProgressPills = (props: ProgressPillsProps) => {
|
|
44
45
|
aria = { hidden: 'true' },
|
45
46
|
className,
|
46
47
|
data = {},
|
48
|
+
fullWidthPill = false,
|
47
49
|
htmlOptions = {},
|
48
50
|
id,
|
49
51
|
steps = 3,
|
@@ -79,7 +81,7 @@ const ProgressPills = (props: ProgressPillsProps) => {
|
|
79
81
|
text={value}
|
80
82
|
/>
|
81
83
|
</div>}
|
82
|
-
<div className="progress_pills">{showSteps(steps, active, dark)}</div>
|
84
|
+
<div className="progress_pills">{showSteps(steps, active, dark, fullWidthPill)}</div>
|
83
85
|
</div>
|
84
86
|
)
|
85
87
|
}
|
@@ -0,0 +1 @@
|
|
1
|
+
Progress pills start at `45px` wide if the container allows, but will shrink down to `1px` as the container gets smaller. Resize this window to see each pill shrink.
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= pb_rails("progress_pills", props: { aria: { label: "2 out of 5 steps complete" }, steps: 5, active: 2, full_width_pill: true }) %>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import ProgressPills from '../_progress_pills'
|
3
|
+
|
4
|
+
const ProgressPillsFullWidth = (props) => {
|
5
|
+
return (
|
6
|
+
<>
|
7
|
+
<ProgressPills
|
8
|
+
active={2}
|
9
|
+
aria={{ label: '2 out of 5 steps complete' }}
|
10
|
+
fullWidthPill
|
11
|
+
steps={5}
|
12
|
+
{...props}
|
13
|
+
/>
|
14
|
+
</>
|
15
|
+
)
|
16
|
+
}
|
17
|
+
|
18
|
+
export default ProgressPillsFullWidth
|
@@ -0,0 +1 @@
|
|
1
|
+
Pass `full_width_pill: true` to the Progress Pill kit to get true 100% full width pills. The kit will take up the full width of the container that it is in.
|
@@ -0,0 +1 @@
|
|
1
|
+
Pass `fullWidthPill` to the Progress Pill kit to get true 100% full width pills. The kit will take up the full width of the container that it is in.
|
@@ -3,9 +3,11 @@ examples:
|
|
3
3
|
rails:
|
4
4
|
- progress_pills_default: Default
|
5
5
|
- progress_pills_status: Status
|
6
|
+
- progress_pills_full_width: Full Container Width
|
6
7
|
|
7
8
|
|
8
9
|
|
9
10
|
react:
|
10
11
|
- progress_pills_default: Default
|
11
12
|
- progress_pills_status: Status
|
13
|
+
- progress_pills_full_width: Full Container Width
|
@@ -14,7 +14,7 @@
|
|
14
14
|
|
15
15
|
<div class="progress_pills">
|
16
16
|
<% object.each_step do |step| %>
|
17
|
-
<span class="pb_progress_pill<%= object.active_step(step) %><%= object.dark_pill %>"></span>
|
17
|
+
<span class="pb_progress_pill<%= object.active_step(step) %><%= object.make_full_width %><%= object.dark_pill %>"></span>
|
18
18
|
<% end %>
|
19
19
|
</div>
|
20
20
|
|
@@ -9,6 +9,8 @@ module Playbook
|
|
9
9
|
prop :steps, type: Playbook::Props::Number,
|
10
10
|
default: 3
|
11
11
|
prop :title
|
12
|
+
prop :full_width_pill, type: Playbook::Props::Boolean,
|
13
|
+
default: false
|
12
14
|
|
13
15
|
def classname
|
14
16
|
generate_classname("pb_progress_pills_kit")
|
@@ -26,6 +28,10 @@ module Playbook
|
|
26
28
|
step <= active ? "_active" : "_inactive"
|
27
29
|
end
|
28
30
|
|
31
|
+
def make_full_width
|
32
|
+
full_width_pill ? " full_width_pill" : nil
|
33
|
+
end
|
34
|
+
|
29
35
|
def aria_attributes
|
30
36
|
return aria if aria.present?
|
31
37
|
|
@@ -23,6 +23,20 @@ const ProgressPillsDefault = () => {
|
|
23
23
|
)
|
24
24
|
}
|
25
25
|
|
26
|
+
const ProgressPillsFullWidth = () => {
|
27
|
+
return (
|
28
|
+
<ProgressPills
|
29
|
+
active={2}
|
30
|
+
aria={{ label: ariaLabel }}
|
31
|
+
data={{ testid: testId }}
|
32
|
+
fullWidthPill
|
33
|
+
steps={3}
|
34
|
+
title={title}
|
35
|
+
value={value}
|
36
|
+
/>
|
37
|
+
)
|
38
|
+
}
|
39
|
+
|
26
40
|
test('should pass data prop', () => {
|
27
41
|
render(<ProgressPillsDefault />)
|
28
42
|
const kit = screen.getByTestId(testId)
|
@@ -51,4 +65,15 @@ test('should render value', () => {
|
|
51
65
|
render(<ProgressPillsDefault />)
|
52
66
|
const kit = screen.getByText(value)
|
53
67
|
expect(kit).toBeInTheDocument()
|
54
|
-
})
|
68
|
+
})
|
69
|
+
|
70
|
+
test('should apply fullWidthPill styling when fullWidthPill prop is true', () => {
|
71
|
+
render(<ProgressPillsFullWidth />)
|
72
|
+
const container = screen.getByTestId(testId)
|
73
|
+
const pillElements = container.querySelectorAll('.full_width_pill')
|
74
|
+
|
75
|
+
expect(pillElements.length).toBeGreaterThan(0)
|
76
|
+
pillElements.forEach((pill) => {
|
77
|
+
expect(pill).toHaveClass('full_width_pill')
|
78
|
+
})
|
79
|
+
})
|