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.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +0 -1
  3. data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.scss +6 -1
  4. data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.tsx +7 -5
  5. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_default.html.erb +1 -0
  6. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_default.jsx +7 -0
  7. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_default.md +1 -0
  8. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_full_width.html.erb +1 -0
  9. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_full_width.jsx +18 -0
  10. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_full_width_rails.md +1 -0
  11. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_full_width_react.md +1 -0
  12. data/app/pb_kits/playbook/pb_progress_pills/docs/example.yml +2 -0
  13. data/app/pb_kits/playbook/pb_progress_pills/docs/index.js +1 -0
  14. data/app/pb_kits/playbook/pb_progress_pills/progress_pills.html.erb +1 -1
  15. data/app/pb_kits/playbook/pb_progress_pills/progress_pills.rb +6 -0
  16. data/app/pb_kits/playbook/pb_progress_pills/progress_pills.test.js +26 -1
  17. data/dist/chunks/{_typeahead-KwZhr9u1.js → _typeahead-CAIQfP7X.js} +1 -1
  18. data/dist/chunks/_weekday_stacked-DstwbGUv.js +45 -0
  19. data/dist/chunks/vendor.js +1 -1
  20. data/dist/menu.yml +0 -7
  21. data/dist/playbook-doc.js +1 -1
  22. data/dist/playbook-rails-react-bindings.js +1 -1
  23. data/dist/playbook-rails.js +1 -1
  24. data/dist/playbook.css +1 -1
  25. data/lib/playbook/version.rb +1 -1
  26. metadata +9 -20
  27. data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.scss +0 -66
  28. data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.tsx +0 -98
  29. data/app/pb_kits/playbook/pb_avatar_action_button/avatar_action_button.html.erb +0 -28
  30. data/app/pb_kits/playbook/pb_avatar_action_button/avatar_action_button.rb +0 -42
  31. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_actions.html.erb +0 -19
  32. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_actions.jsx +0 -26
  33. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_default.html.erb +0 -10
  34. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_default.jsx +0 -17
  35. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_on_click.jsx +0 -19
  36. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_onclick.html.erb +0 -16
  37. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_placement.html.erb +0 -35
  38. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_placement.jsx +0 -42
  39. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_tooltip.html.erb +0 -13
  40. data/app/pb_kits/playbook/pb_avatar_action_button/docs/example.yml +0 -15
  41. data/app/pb_kits/playbook/pb_avatar_action_button/docs/index.js +0 -4
  42. data/app/pb_kits/playbook/pb_avatar_action_button/pb_avatar_action_button.test.js +0 -31
  43. data/dist/chunks/_weekday_stacked-DSJpSZ3B.js +0 -45
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9e26a89c343fcb92a9f78a01c6984bb27982ce2cbdb5816220abc4fef6c25f03
4
- data.tar.gz: 2cdde195ecb34d8245bef7a748e2ed5cd445f76ea49bb053bcb1f5668b292c31
3
+ metadata.gz: 5a78bc366f1f7086a31c4095eb10e5c5ee0be08a56c68327597848a0d7a9236a
4
+ data.tar.gz: 83701efa1b7889f3359c4e73dde11ce3f2a48d5ec39e42d5c550f5c6299aeb38
5
5
  SHA512:
6
- metadata.gz: 9a528f6a6e71344e4819d491570747ca12e586705ee8eee6add394907a4769e5efd88222f5ea626f4ca1327e36ccd5f5b0d6cfd6d8f16082fe5c0b575855d40e
7
- data.tar.gz: a73afe78046b88e1fdd0fb7846fce84ae7a884a4f225e5ffb254526b3b3a0d179d34403ab97a7f5125152ae7772c21bb257c85b5c19ea24a3f4f7fa7bde6642b
6
+ metadata.gz: a51f1c37116779e420d0a30abe9aa0617d611103fdb5bf1e44aa3639be7e4d09ab61d71ea2e29173dc6a144110a262eaf7a27370c110db5926d24b80a20d870f
7
+ data.tar.gz: 4dceab2450821e9c3b12a791d4b919d747341b7b73fca55b83ff18fa6c460a0e39204a0d7bd3757b2bd53b46ad37af9a5624222e897e0ffe1f2f5d12938b9c4d
@@ -1,7 +1,6 @@
1
1
 
2
2
  @import 'pb_advanced_table/advanced_table';
3
3
  @import 'pb_avatar/avatar';
4
- @import 'pb_avatar_action_button/avatar_action_button';
5
4
  @import 'pb_background/background';
6
5
  @import 'pb_badge/badge';
7
6
  @import 'pb_bar_graph/bar_graph';
@@ -3,7 +3,8 @@
3
3
  @import "../tokens/border_radius";
4
4
 
5
5
  @mixin pb_progress_pill {
6
- width: 45px;
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
  }
@@ -1 +1,2 @@
1
1
  <%= pb_rails("progress_pills", props: { aria: { label: "2 out of 3 steps complete" }, steps: 3, active: 2 }) %>
2
+ <%= pb_rails("progress_pills", props: { aria: { label: "9 out of 18 steps complete" }, steps: 18, active: 9, margin_top: "md" }) %>
@@ -10,6 +10,13 @@ const ProgressPillsDefault = (props) => {
10
10
  steps={3}
11
11
  {...props}
12
12
  />
13
+ <ProgressPills
14
+ active={9}
15
+ aria={{ label: '9 out of 18 steps complete' }}
16
+ marginTop="md"
17
+ steps={18}
18
+ {...props}
19
+ />
13
20
  </>
14
21
  )
15
22
  }
@@ -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
@@ -1,2 +1,3 @@
1
1
  export { default as ProgressPillsDefault } from './_progress_pills_default.jsx'
2
2
  export { default as ProgressPillsStatus } from './_progress_pills_status.jsx'
3
+ export { default as ProgressPillsFullWidth } from './_progress_pills_full_width.jsx'
@@ -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
+ })