playbook_ui 14.13.0.pre.alpha.play1753updatepbcontenttags6060 → 14.13.0.pre.alpha.play1884progresspill6064

Sign up to get free protection for your applications and to get access to all the features.
Files changed (24) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_default.html.erb +1 -2
  3. data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_sizes.html.erb +27 -0
  4. data/app/pb_kits/playbook/pb_icon_button/docs/example.yml +1 -3
  5. data/app/pb_kits/playbook/pb_icon_button/icon_button.html.erb +1 -1
  6. data/app/pb_kits/playbook/pb_icon_button/icon_button.rb +3 -0
  7. data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.html.erb +6 -1
  8. data/app/pb_kits/playbook/pb_nav/item.html.erb +19 -7
  9. data/app/pb_kits/playbook/pb_nav/nav.html.erb +8 -3
  10. data/app/pb_kits/playbook/pb_online_status/online_status.html.erb +6 -1
  11. data/app/pb_kits/playbook/pb_popover/popover.html.erb +6 -1
  12. data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.scss +2 -1
  13. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_default.html.erb +1 -0
  14. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_default.jsx +7 -0
  15. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_default.md +1 -0
  16. data/app/pb_kits/playbook/pb_table/docs/_table_with_clickable_rows.html.erb +47 -0
  17. data/app/pb_kits/playbook/pb_table/docs/_table_with_clickable_rows.jsx +88 -0
  18. data/app/pb_kits/playbook/pb_table/docs/_table_with_clickable_rows.md +1 -0
  19. data/app/pb_kits/playbook/pb_table/docs/example.yml +2 -0
  20. data/app/pb_kits/playbook/pb_table/docs/index.js +2 -1
  21. data/dist/playbook-doc.js +1 -1
  22. data/dist/playbook.css +1 -1
  23. data/lib/playbook/version.rb +1 -1
  24. metadata +6 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: be948d956effebe6bd723330f238c06683deb12734fb5c6c51fb55a3cdae412c
4
- data.tar.gz: a150187785493cd22293f7930cb57b9c79ac6d79394b98eda99c03f93be4416d
3
+ metadata.gz: 21317a1c7d5325bd88ac09a06b74859e30a5fcf6748c6b4b710c500189733796
4
+ data.tar.gz: 0f6e8ac0625c5ba45989ab65b84603c15e777699e9726e2a7769d6e2aa57dd5e
5
5
  SHA512:
6
- metadata.gz: 731ddadd00c5dbd2ca6924ee913507defa5da15a6ed0b30f9d2d639cd6ea1a3c72b3bab94fb2b40211a1329b7fae4a2259e566f11b24f622e8ab5fad279aaa6a
7
- data.tar.gz: 430c8a15af6fef2bc5c879612fa9ab7a3c5b5ff6aebb71e7c1381619155769a667ef4b67a5f999af8e954f3cad6a60d96c0e9346a9ae0cafe1084ae3576a6f48
6
+ metadata.gz: a7555df6aeccfb138dd8a45ff0a86b1e1843ba3ae6640a29d27899f2a9972b717f26cda50b79da966a5681b5eea56394f0a97823b165e27194add95c3e892158
7
+ data.tar.gz: 275833538e43720396649195b958886d4d4cca24f5b9e8e977fc1b7ec520d6e1151665de6d02086b11e05c45414f2b9c03d941df3fd43ad2fcd78ce403f4472b
@@ -1,3 +1,2 @@
1
1
  <%= pb_rails("icon_button") %>
2
- </br>
3
- <%= pb_rails("icon_button", props: {variant: "link"}) %>
2
+ <%= pb_rails("icon_button", props: {variant: "link", margin_top: "md" }) %>
@@ -0,0 +1,27 @@
1
+ <%= pb_rails("flex", props: { align: "center"}) do %>
2
+ <%= pb_rails("icon_button", props: {size: "lg"}) %> <span>Large</span>
3
+ <% end %>
4
+
5
+ <%= pb_rails("flex", props: { align: "center" }) do %>
6
+ <%= pb_rails("icon_button", props: {size: "sm"}) %> <span>Small</span>
7
+ <% end %>
8
+
9
+ <%= pb_rails("flex", props: { align: "center" }) do %>
10
+ <%= pb_rails("icon_button", props: {size: "xs"}) %> <span>XSmall</span>
11
+ <% end %>
12
+
13
+ <%= pb_rails("flex", props: { align: "center", margin_top: "md" }) do %>
14
+ <%= pb_rails("icon_button", props: {size: "1x"}) %> <span>1x</span>
15
+ <% end %>
16
+
17
+ <%= pb_rails("flex", props: { align: "center" }) do %>
18
+ <%= pb_rails("icon_button", props: {size: "2x"}) %> <span>2x</span>
19
+ <% end %>
20
+
21
+ <%= pb_rails("flex", props: { align: "center" }) do %>
22
+ <%= pb_rails("icon_button", props: {size: "3x"}) %> <span>3x</span>
23
+ <% end %>
24
+
25
+ <%= pb_rails("flex", props: { align: "center" }) do %>
26
+ <%= pb_rails("icon_button", props: {size: "4x"}) %> <span>4x</span>
27
+ <% end %>
@@ -2,6 +2,4 @@ examples:
2
2
 
3
3
  rails:
4
4
  - icon_button_default: Default
5
-
6
-
7
-
5
+ - icon_button_sizes: Sizes
@@ -8,7 +8,7 @@
8
8
  <%= pb_rails("icon", props: { icon: object.icon,
9
9
  fixed_width: true,
10
10
  dark: object.dark,
11
- size: "2x",
11
+ size: object.size,
12
12
  color: "text_lt_default",
13
13
  classname: "icon_button_icon",
14
14
  padding_x: "xxs", padding_y: "xs" }) %>
@@ -14,6 +14,9 @@ module Playbook
14
14
  prop :variant, type: Playbook::Props::Enum,
15
15
  values: %w[default link],
16
16
  default: "default"
17
+ prop :size, type: Playbook::Props::Enum,
18
+ values: %w[1x 2x 3x 4x 5x 6x 7x 8x 9x 10x xs sm lg],
19
+ default: "2x"
17
20
  def classname
18
21
  generate_classname("pb_icon_button_kit", variant)
19
22
  end
@@ -1,3 +1,8 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ aria: object.aria,
3
+ data: object.data,
4
+ id: object.id,
5
+ class: object.classname,
6
+ **combined_html_options) do %>
2
7
  <%= react_component("MultiLevelSelect", object.multi_level_select_options) %>
3
8
  <% end %>
@@ -1,9 +1,15 @@
1
1
  <% if object.collapsible %>
2
2
  <%= pb_rails("collapsible", props: { name: "collapsible-nav-example", classname: object.collapsible_nav_classname }) do %>
3
3
  <%= pb_rails("collapsible/collapsible_main", props: { name: "default-collapsible-nav", icon: object.collapsible_icons, size: "xs", dark: object.dark, classname:object.margin_classes }) do %>
4
- <%= pb_content_tag( object.tag,
5
- href: object.link && object.link,
6
- target: object.link && object.target
4
+ <%= content_tag(object.tag,
5
+ aria: object.aria,
6
+ class: object.classname,
7
+ data: object.data,
8
+ dark: object.dark,
9
+ id: object.id,
10
+ href: object.link && object.link,
11
+ target: object.link && object.target,
12
+ **combined_html_options
7
13
  ) do %>
8
14
  <% if object.image_url %>
9
15
  <%= pb_rails("image", props: { url: object.image_url, classname: "pb_nav_img_wrapper_collapsible" }) %>
@@ -14,16 +20,22 @@
14
20
  <span class="pb_nav_list_item_text_collapsible">
15
21
  <%= object.text %>
16
22
  </span>
17
- <% end %>
23
+ <% end %>
18
24
  <% end %>
19
25
  <%= pb_rails("collapsible/collapsible_content", props: {collapsed: object.collapsed}) do %>
20
26
  <%= content.presence %>
21
27
  <% end %>
22
28
  <% end %>
23
29
  <% else %>
24
- <%= pb_content_tag( object.tag,
25
- href: object.link && object.link,
26
- target: object.link && object.target
30
+ <%= content_tag(object.tag,
31
+ aria: object.aria,
32
+ class: object.classname,
33
+ **combined_html_options,
34
+ data: object.data,
35
+ dark: object.dark,
36
+ id: object.id,
37
+ href: object.link && object.link,
38
+ target: object.link && object.target
27
39
  ) do %>
28
40
  <% if object.image_url %>
29
41
  <%= pb_rails("image", props: { url: object.image_url, classname: "pb_nav_img_wrapper" }) %>
@@ -1,7 +1,12 @@
1
- <%= pb_content_tag(:nav) do %>
1
+ <%= content_tag(:nav,
2
+ aria: object.aria,
3
+ class: object.classname,
4
+ data: object.data,
5
+ id: object.id,
6
+ **combined_html_options) do %>
2
7
  <% if object.title %>
3
- <%= pb_content_tag do %>
4
- <%= pb_content_tag(:a) do %>
8
+ <%= content_tag(:div, class: "pb_nav_list_title") do %>
9
+ <%= content_tag(:a, class: "pb_nav_list_item_link_text", href: object.link) do %>
5
10
  <%= pb_rails("caption", props: { text: object.title, dark: dark }) %>
6
11
  <% end %>
7
12
  <% end %>
@@ -1,2 +1,7 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ aria: object.aria.merge!(label: object.status),
3
+ class: object.classname,
4
+ data: object.data,
5
+ id: object.id,
6
+ **combined_html_options) do %>
2
7
  <% end %>
@@ -1,4 +1,9 @@
1
- <%= pb_content_tag do %>
1
+ <%= content_tag(:div,
2
+ aria: object.aria,
3
+ class: object.classname,
4
+ data: object.data,
5
+ id: object.id,
6
+ **combined_html_options) do %>
2
7
  <div class="pb_popover_tooltip hide" id="<%= object.tooltip_id %>" role="tooltip" style="<%= object.z_index_helper %>">
3
8
  <div class="pb_popover_body <%= object.width_height_class_helper %> <%= object.popover_spacing_helper %>" style="<%= object.width_height_helper %>">
4
9
  <%= content.presence %>
@@ -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;
@@ -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,47 @@
1
+ <%= pb_rails("table", props: { size: "sm" }) do %>
2
+ <%= pb_rails("table/table_head") do %>
3
+ <%= pb_rails("table/table_row") do %>
4
+ <%= pb_rails("table/table_header", props: { text: "Column 1" }) %>
5
+ <%= pb_rails("table/table_header", props: { text: "Column 2" }) %>
6
+ <%= pb_rails("table/table_header", props: { text: "Column 3" }) %>
7
+ <%= pb_rails("table/table_header", props: { text: "Column 4" }) %>
8
+ <%= pb_rails("table/table_header", props: { text: "Column 5" }) %>
9
+ <%= pb_rails("table/table_header", props: { text: "" }) %>
10
+ <% end %>
11
+ <% end %>
12
+ <%= pb_rails("table/table_body") do %>
13
+ <%= pb_rails("table/table_row", props: { cursor: "pointer", html_options: { onclick: "alert('Row 1 clicked')" } }) do %>
14
+ <%= pb_rails("table/table_cell", props: { text: "Value 1" }) %>
15
+ <%= pb_rails("table/table_cell", props: { text: "Value 2" }) %>
16
+ <%= pb_rails("table/table_cell", props: { text: "Value 3" }) %>
17
+ <%= pb_rails("table/table_cell", props: { text: "Value 4" }) %>
18
+ <%= pb_rails("table/table_cell", props: { text: "Value 5" }) %>
19
+ <%= pb_rails("table/table_cell", props: { text_align: "right" }) do %>
20
+ <%= pb_rails("icon", props: { color: "primary_action", fixed_width: true, icon: "chevron-right", size: "xs" }) %>
21
+ <% end %>
22
+ <% end %>
23
+
24
+ <%= pb_rails("table/table_row", props: { cursor: "pointer", html_options: { onclick: "alert('Row 2 clicked')" } }) do %>
25
+ <%= pb_rails("table/table_cell", props: { text: "Value 1" }) %>
26
+ <%= pb_rails("table/table_cell", props: { text: "Value 2" }) %>
27
+ <%= pb_rails("table/table_cell", props: { text: "Value 3" }) %>
28
+ <%= pb_rails("table/table_cell", props: { text: "Value 4" }) %>
29
+ <%= pb_rails("table/table_cell", props: { text: "Value 5" }) %>
30
+ <%= pb_rails("table/table_cell", props: { text_align: "right" }) do %>
31
+ <%= pb_rails("icon", props: { color: "primary_action", fixed_width: true, icon: "chevron-right", size: "xs" }) %>
32
+ <% end %>
33
+ <% end %>
34
+
35
+ <%= pb_rails("table/table_row", props: { cursor: "pointer", html_options: { onclick: "alert('Row 3 clicked')" } }) do %>
36
+ <%= pb_rails("table/table_cell", props: { text: "Value 1" }) %>
37
+ <%= pb_rails("table/table_cell", props: { text: "Value 2" }) %>
38
+ <%= pb_rails("table/table_cell", props: { text: "Value 3" }) %>
39
+ <%= pb_rails("table/table_cell", props: { text: "Value 4" }) %>
40
+ <%= pb_rails("table/table_cell", props: { text: "Value 5" }) %>
41
+ <%= pb_rails("table/table_cell", props: { text_align: "right" }) do %>
42
+ <%= pb_rails("icon", props: { color: "primary_action", fixed_width: true, icon: "chevron-right", size: "xs" }) %>
43
+ <% end %>
44
+ <% end %>
45
+ <% end %>
46
+ <% end %>
47
+
@@ -0,0 +1,88 @@
1
+ import React from 'react'
2
+ import { Table, Icon } from 'playbook-ui'
3
+
4
+ const TableWithClickableRows = (props) => {
5
+
6
+
7
+ return (
8
+ <Table
9
+ size="sm"
10
+ {...props}
11
+ >
12
+ <Table.Head>
13
+ <Table.Row>
14
+ <Table.Header>{"Column 1"}</Table.Header>
15
+ <Table.Header>{"Column 2"}</Table.Header>
16
+ <Table.Header>{"Column 3"}</Table.Header>
17
+ <Table.Header>{"Column 4"}</Table.Header>
18
+ <Table.Header>{"Column 5"}</Table.Header>
19
+ <Table.Header>{""}</Table.Header>
20
+ </Table.Row>
21
+ </Table.Head>
22
+ <Table.Body>
23
+ <Table.Row
24
+ cursor="pointer"
25
+ htmlOptions={{ onClick: () => alert("Row 1 clicked") }}
26
+ {...props}
27
+ >
28
+ <Table.Cell>{"Value 1"}</Table.Cell>
29
+ <Table.Cell>{"Value 2"}</Table.Cell>
30
+ <Table.Cell>{"Value 3"}</Table.Cell>
31
+ <Table.Cell>{"Value 4"}</Table.Cell>
32
+ <Table.Cell>{"Value 5"}</Table.Cell>
33
+ <Table.Cell textAlign="right">
34
+ <Icon
35
+ color="primary_action"
36
+ fixedWidth
37
+ icon="chevron-right"
38
+ size="xs"
39
+ {...props}
40
+ />
41
+ </Table.Cell>
42
+ </Table.Row>
43
+ <Table.Row
44
+ cursor="pointer"
45
+ htmlOptions={{ onClick: () => alert("Row 2 clicked") }}
46
+ {...props}
47
+ >
48
+ <Table.Cell>{"Value 1"}</Table.Cell>
49
+ <Table.Cell>{"Value 2"}</Table.Cell>
50
+ <Table.Cell>{"Value 3"}</Table.Cell>
51
+ <Table.Cell>{"Value 4"}</Table.Cell>
52
+ <Table.Cell>{"Value 5"}</Table.Cell>
53
+ <Table.Cell textAlign="right">
54
+ <Icon
55
+ color="primary_action"
56
+ fixedWidth
57
+ icon="chevron-right"
58
+ size="xs"
59
+ {...props}
60
+ />
61
+ </Table.Cell>
62
+ </Table.Row>
63
+ <Table.Row
64
+ cursor="pointer"
65
+ htmlOptions={{ onClick: () => alert("Row 3 clicked") }}
66
+ {...props}
67
+ >
68
+ <Table.Cell>{"Value 1"}</Table.Cell>
69
+ <Table.Cell>{"Value 2"}</Table.Cell>
70
+ <Table.Cell>{"Value 3"}</Table.Cell>
71
+ <Table.Cell>{"Value 4"}</Table.Cell>
72
+ <Table.Cell>{"Value 5"}</Table.Cell>
73
+ <Table.Cell textAlign="right">
74
+ <Icon
75
+ color="primary_action"
76
+ fixedWidth
77
+ icon="chevron-right"
78
+ size="xs"
79
+ {...props}
80
+ />
81
+ </Table.Cell>
82
+ </Table.Row>
83
+ </Table.Body>
84
+ </Table>
85
+ )
86
+ }
87
+
88
+ export default TableWithClickableRows
@@ -0,0 +1 @@
1
+ Clickable table rows do not require any additional props. This doc example showcases how to set them up using `html_options`/`htmlOptions` and click events. Using the global prop for cursor to set it to "pointer" is also recommended for better UX.
@@ -34,6 +34,7 @@ examples:
34
34
  - table_with_collapsible_with_custom_content_rails: Table with Collapsible with Custom Content
35
35
  - table_with_collapsible_with_nested_rows_rails: Table with Collapsible with Nested Rows
36
36
  - table_with_collapsible_with_nested_table_rails: Table with Collapsible with Nested Table
37
+ - table_with_clickable_rows: Table with Clickable Rows
37
38
 
38
39
  react:
39
40
  - table_sm: Small
@@ -70,3 +71,4 @@ examples:
70
71
  - table_with_collapsible_with_custom_content: Table with Collapsible with Custom Content
71
72
  - table_with_collapsible_with_nested_rows: Table with Collapsible with Nested Rows
72
73
  - table_with_collapsible_with_nested_table: Table with Collapsible with Nested Table
74
+ - table_with_clickable_rows: Table with Clickable Rows
@@ -32,4 +32,5 @@ export { default as TableWithCollapsible } from './_table_with_collapsible.jsx'
32
32
  export { default as TableWithCollapsibleWithCustomContent } from './_table_with_collapsible_with_custom_content.jsx'
33
33
  export { default as TableWithCollapsibleWithNestedTable } from './_table_with_collapsible_with_nested_table.jsx'
34
34
  export { default as TableWithCollapsibleWithNestedRows } from './_table_with_collapsible_with_nested_rows.jsx'
35
- export { default as TableWithCollapsibleWithCustomClick } from './_table_with_collapsible_with_custom_click.jsx'
35
+ export { default as TableWithCollapsibleWithCustomClick } from './_table_with_collapsible_with_custom_click.jsx'
36
+ export { default as TableWithClickableRows } from './_table_with_clickable_rows.jsx'