playbook_ui 13.28.0.pre.alpha.PBNTR297gradientoverlay3029 → 13.28.0.pre.alpha.PLAY888Cardkithighlightoverflowtooltiperror2937

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +3 -3
  3. data/app/pb_kits/playbook/index.js +0 -3
  4. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.html.erb +2 -2
  5. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_subrow_headers.md +1 -1
  6. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +1 -1
  7. data/app/pb_kits/playbook/pb_advanced_table/table_body.html.erb +1 -1
  8. data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +4 -14
  9. data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +2 -10
  10. data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +1 -1
  11. data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +0 -2
  12. data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.tsx +1 -4
  13. data/app/pb_kits/playbook/pb_bar_graph/bar_graph.rb +0 -16
  14. data/app/pb_kits/playbook/pb_bar_graph/docs/{_bar_graph_custom_rails.html.erb → _bar_graph_custom.html.erb} +3 -3
  15. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom.md +1 -2
  16. data/app/pb_kits/playbook/pb_bar_graph/docs/example.yml +1 -1
  17. data/app/pb_kits/playbook/pb_card/_card.scss +1 -1
  18. data/app/pb_kits/playbook/pb_card/_card_mixin.scss +1 -2
  19. data/app/pb_kits/playbook/pb_checkbox/_checkbox.scss +2 -1
  20. data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +3 -9
  21. data/app/pb_kits/playbook/pb_circle_chart/circle_chart.rb +1 -22
  22. data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +8 -14
  23. data/app/pb_kits/playbook/pb_collapsible/collapsible.test.js +0 -24
  24. data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.ts +1 -7
  25. data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.ts +1 -9
  26. data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +0 -10
  27. data/app/pb_kits/playbook/pb_form_group/_form_group.scss +2 -2
  28. data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +1 -4
  29. data/app/pb_kits/playbook/pb_gauge/gauge.rb +1 -6
  30. data/app/pb_kits/playbook/pb_line_graph/_line_graph.tsx +2 -8
  31. data/app/pb_kits/playbook/pb_line_graph/line_graph.rb +1 -22
  32. data/app/pb_kits/playbook/pb_pill/docs/_description.md +1 -1
  33. data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +0 -1
  34. data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.tsx +32 -30
  35. data/app/pb_kits/playbook/pb_selectable_card/selectable_card.html.erb +2 -0
  36. data/app/pb_kits/playbook/pb_table/_table.tsx +0 -5
  37. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_column.jsx +32 -33
  38. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_column.md +1 -1
  39. data/app/pb_kits/playbook/pb_table/docs/{_table_outer_padding.html.erb → _table_alignment_row.html.erb} +7 -7
  40. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_row.jsx +33 -33
  41. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_row.md +1 -1
  42. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data.html.erb +63 -0
  43. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data.jsx +50 -51
  44. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data.md +1 -1
  45. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row.html.erb +52 -0
  46. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row.jsx +38 -37
  47. data/app/pb_kits/playbook/pb_table/docs/example.yml +9 -9
  48. data/app/pb_kits/playbook/pb_table/docs/index.js +0 -1
  49. data/app/pb_kits/playbook/pb_table/styles/_all.scss +0 -1
  50. data/app/pb_kits/playbook/pb_table/table.rb +1 -14
  51. data/app/pb_kits/playbook/pb_table/table.test.js +1 -5
  52. data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.tsx +9 -12
  53. data/app/pb_kits/playbook/pb_treemap_chart/treemap_chart.rb +1 -6
  54. data/app/pb_kits/playbook/playbook-doc.js +0 -4
  55. data/app/pb_kits/playbook/utilities/globalProps.ts +1 -12
  56. data/dist/menu.yml +2 -7
  57. data/dist/playbook-rails.js +6 -6
  58. data/lib/playbook/classnames.rb +0 -1
  59. data/lib/playbook/forms/builder.rb +0 -1
  60. data/lib/playbook/kit_base.rb +0 -2
  61. data/lib/playbook/version.rb +1 -1
  62. metadata +7 -51
  63. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_subrow_headers.html.erb +0 -40
  64. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_subrow_headers.md +0 -3
  65. data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.html.erb +0 -34
  66. data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb +0 -31
  67. data/app/pb_kits/playbook/pb_bar_graph/barGraph.test.js +0 -31
  68. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom_rails.md +0 -2
  69. data/app/pb_kits/playbook/pb_circle_chart/circleChart.test.js +0 -45
  70. data/app/pb_kits/playbook/pb_collapsible/__snapshots__/collapsible.test.js.snap +0 -53
  71. data/app/pb_kits/playbook/pb_draggable/_draggable.scss +0 -10
  72. data/app/pb_kits/playbook/pb_draggable/_draggable.tsx +0 -53
  73. data/app/pb_kits/playbook/pb_draggable/context/index.tsx +0 -92
  74. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_default.jsx +0 -53
  75. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers.jsx +0 -159
  76. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards.jsx +0 -121
  77. data/app/pb_kits/playbook/pb_draggable/docs/example.yml +0 -9
  78. data/app/pb_kits/playbook/pb_draggable/docs/index.js +0 -3
  79. data/app/pb_kits/playbook/pb_draggable/draggable.test.jsx +0 -65
  80. data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableContainer.tsx +0 -54
  81. data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableItem.tsx +0 -57
  82. data/app/pb_kits/playbook/pb_gauge/gauge.test.js +0 -35
  83. data/app/pb_kits/playbook/pb_line_graph/lineGraph.test.js +0 -52
  84. data/app/pb_kits/playbook/pb_overlay/_overlay.scss +0 -12
  85. data/app/pb_kits/playbook/pb_overlay/_overlay.tsx +0 -93
  86. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_default.jsx +0 -40
  87. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_default.md +0 -7
  88. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_multi_directional.jsx +0 -36
  89. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_multi_directional.md +0 -5
  90. data/app/pb_kits/playbook/pb_overlay/docs/example.yml +0 -4
  91. data/app/pb_kits/playbook/pb_overlay/docs/index.js +0 -2
  92. data/app/pb_kits/playbook/pb_overlay/overlay.test.jsx +0 -66
  93. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_column_rails.md +0 -2
  94. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_row_rails.html.erb +0 -34
  95. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_row_rails.md +0 -2
  96. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data_rails.html.erb +0 -54
  97. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data_rails.md +0 -2
  98. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row.md +0 -1
  99. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row_rails.html.erb +0 -53
  100. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row_rails.md +0 -1
  101. data/app/pb_kits/playbook/pb_table/docs/_table_outer_padding.jsx +0 -76
  102. data/app/pb_kits/playbook/pb_table/docs/_table_outer_padding.md +0 -1
  103. data/app/pb_kits/playbook/pb_table/styles/_outer_padding.scss +0 -21
  104. data/app/pb_kits/playbook/pb_treemap_chart/treemapChart.test.js +0 -61
  105. data/app/pb_kits/playbook/tokens/_vertical_align.scss +0 -18
  106. data/app/pb_kits/playbook/utilities/_vertical_align.scss +0 -16
  107. data/lib/playbook/forms/builder/dropdown_field.rb +0 -14
  108. data/lib/playbook/vertical_align.rb +0 -37
  109. /data/app/pb_kits/playbook/pb_table/docs/{_table_alignment_column_rails.html.erb → _table_alignment_column.html.erb} +0 -0
@@ -1,93 +0,0 @@
1
- import React from 'react'
2
- import classnames from 'classnames'
3
- import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
4
- import { globalProps } from '../utilities/globalProps'
5
- import defaultColors from "../tokens/exports/_colors.scss";
6
-
7
- type OverlayProps = {
8
- aria?: { [key: string]: string },
9
- className?: string,
10
- children: React.ReactNode[] | React.ReactNode,
11
- color: "white" | "bg_light" | "card_dark" | "bg_dark",
12
- data?: { [key: string]: string },
13
- htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
14
- id?: string,
15
- layout: { [key: string]: string },
16
- }
17
-
18
- const previousOverlayDirectionMap: { [key: string]: string } = {
19
- "bottom": "to top",
20
- "top": "to bottom",
21
- "left-right": "to right",
22
- "top-bottom": "to top",
23
- }
24
-
25
- const subsequentOverlayDirectionMap: { [key: string]: string } = {
26
- "bottom": "to top",
27
- "top": "to bottom",
28
- "left-right": "to left",
29
- "top-bottom": "to bottom",
30
- }
31
-
32
- const Overlay = (props: OverlayProps) => {
33
- const {
34
- aria = {},
35
- className,
36
- children,
37
- color = "white",
38
- data = {},
39
- htmlOptions = {},
40
- id,
41
- layout = { "bottom": "100%" },
42
- } = props
43
-
44
- const ariaProps = buildAriaProps(aria)
45
- const dataProps = buildDataProps(data)
46
- const classes = classnames(buildCss('pb_overlay'), globalProps(props), className)
47
- const htmlProps = buildHtmlProps(htmlOptions)
48
-
49
- const getPosition = () => {
50
- return Object.keys(layout)[0]
51
- }
52
-
53
- const getSize = () => {
54
- return Object.values(layout)[0]
55
- }
56
-
57
- const getPreviousOverlayDirection = () => {
58
- return previousOverlayDirectionMap[getPosition()]
59
- }
60
-
61
- const getSubsequentOverlayDirection = () => {
62
- return subsequentOverlayDirectionMap[getPosition()]
63
- }
64
-
65
- const hasSubsequentOverlay = getPosition() === "left-right" || getPosition() === "top-bottom"
66
-
67
- const previousOverlay = `linear-gradient(${getPreviousOverlayDirection()}, ${defaultColors[color]} 0%, transparent ${getSize()})`
68
- const subsequentOverlay = `linear-gradient(${getSubsequentOverlayDirection()}, ${defaultColors[color]} 0%, transparent ${getSize()})`
69
-
70
- return (
71
- <div
72
- {...ariaProps}
73
- {...dataProps}
74
- {...htmlProps}
75
- className={classes}
76
- id={id}
77
- >
78
- <div className="overlay-container">
79
- <div className="overlay"
80
- style={{ background: previousOverlay }} />
81
-
82
- {children}
83
-
84
- { hasSubsequentOverlay &&
85
- <div className="overlay"
86
- style={{ background: subsequentOverlay }} />
87
- }
88
- </div>
89
- </div>
90
- )
91
- }
92
-
93
- export default Overlay
@@ -1,40 +0,0 @@
1
- import React from 'react'
2
- import {
3
- Overlay,
4
- Table,
5
- } from '../..'
6
-
7
- const TableExample = () => {
8
- return (
9
- <Table size="sm">
10
- <thead>
11
- <tr>
12
- <th>{'Column 1'}</th>
13
- <th>{'Column 2'}</th>
14
- <th>{'Column 3'}</th>
15
- <th>{'Column 4'}</th>
16
- <th>{'Column 5'}</th>
17
- </tr>
18
- </thead>
19
- <tbody>
20
- {Array.from({ length: 7 }, (_, index) => (
21
- <tr key={index}>
22
- {Array.from({ length: 5 }, (_, columnIndex) => (
23
- <td key={columnIndex}>{`Value ${columnIndex + 1}`}</td>
24
- ))}
25
- </tr>
26
- ))}
27
- </tbody>
28
- </Table>
29
- )
30
- }
31
-
32
- const OverlayDefault = () => (
33
- <>
34
- <Overlay>
35
- <TableExample />
36
- </Overlay>
37
- </>
38
- )
39
-
40
- export default OverlayDefault
@@ -1,7 +0,0 @@
1
- Overlays require a `color`, which sets the "start" (opaque) color of a gradient mask. Because this overlay is intended to reveal underlying content, the "end" color is fixed to transparent.
2
-
3
- The optional `layout` prop accepts a `position` and a `size` as a key:value pair object.
4
-
5
- The `position` prop sets the side where the `color` overlay starts. The direction of the overlay is always toward the opposite side of the position. For example, the default position of `bottom` starts the overlay on the bottom edge of your container and extends it toward the opposite side: the top.
6
-
7
- The `size` prop accepts a percentage value as a string and literally translates to how much of the container is covered by the overlay. By default, `size` is set to `100%` so that your overlay covers the entire container with a smooth fade from `color` at its starting edge, fading to transparent and ending at the containers opposite edge.
@@ -1,36 +0,0 @@
1
- import React from 'react'
2
- import {
3
- Overlay,
4
- Card,
5
- Flex,
6
- FlexItem,
7
- } from '../..'
8
-
9
- const InlineCardsExample = () => {
10
- return (
11
- <Flex
12
- columnGap="lg"
13
- orientation="row"
14
- overflowX="auto"
15
- >
16
- {Array.from({ length: 15 }, (_, index) => (
17
- <FlexItem key={index}>
18
- <Card>{"Card Content"}</Card>
19
- </FlexItem>
20
- ))}
21
- </Flex>
22
- )
23
- }
24
-
25
- const OverlayMultiDirectional = () => (
26
- <>
27
- <Overlay
28
- color="white"
29
- layout={{"left-right": "10%"}}
30
- >
31
- <InlineCardsExample />
32
- </Overlay>
33
- </>
34
- )
35
-
36
- export default OverlayMultiDirectional
@@ -1,5 +0,0 @@
1
- Optionally, you can pass multi-directional options (`left-right` or `top-bottom`) to the `position` prop, which create multiple overlays.
2
-
3
- Your `color` is still applied as the starting edge to both overlays, and each mask will fade to transparent moving toward its opposite edge, ending at the `size` percentage you set.
4
-
5
- NOTE: Multi-directional overlays share the available container space, so passing a size greater than "50%" to a multi-directional overlay will cause your masks to overlap at the midline of your container. As a best practice, we do not recommend exceeding a size of 25% when using multi-directional overlays.
@@ -1,4 +0,0 @@
1
- examples:
2
- react:
3
- - overlay_default: Default
4
- - overlay_multi_directional: Multi-directional
@@ -1,2 +0,0 @@
1
- export { default as OverlayDefault } from './_overlay_default.jsx'
2
- export { default as OverlayMultiDirectional } from './_overlay_multi_directional.jsx'
@@ -1,66 +0,0 @@
1
- import React from 'react'
2
-
3
- import { render, screen } from '../utilities/test-utils'
4
- import { Overlay } from '..'
5
-
6
- const testId = "overlay"
7
- const children = "This is the Overlay children"
8
-
9
- test('should pass data prop', () => {
10
- const props = {
11
- children,
12
- data: { testid: testId }
13
- }
14
-
15
- render(<Overlay {...props} />)
16
- const kit = screen.getByTestId(testId)
17
- expect(kit).toBeInTheDocument()
18
- })
19
-
20
- test("should pass className prop", () => {
21
- const className = "custom-class-name"
22
- const props = {
23
- className,
24
- children,
25
- data: { testid: testId },
26
- }
27
-
28
- render(<Overlay {...props} />)
29
- const kit = screen.getByTestId(testId)
30
- expect(kit).toHaveClass(className)
31
- })
32
-
33
- test('should pass aria prop', () => {
34
- const props = {
35
- aria: { label: testId },
36
- children,
37
- data: { testid: testId },
38
- }
39
-
40
- render(<Overlay {...props} />)
41
- const kit = screen.getByTestId(testId)
42
- expect(kit).toHaveAttribute('aria-label', testId)
43
- })
44
-
45
- test('should pass id prop', () => {
46
- const props = {
47
- children,
48
- data: { testid: testId },
49
- id: testId
50
- }
51
-
52
- render(<Overlay {...props} />)
53
- const kit = screen.getByTestId(testId)
54
- expect(kit).toHaveAttribute('id', testId)
55
- })
56
-
57
- test('should render children', () => {
58
- const props = {
59
- children,
60
- data: { testid: testId }
61
- }
62
-
63
- render(<Overlay {...props} />)
64
- const kit = screen.getByTestId(testId)
65
- expect(kit).toHaveTextContent(props.children)
66
- })
@@ -1,2 +0,0 @@
1
- Pass our `text_align` global prop to any `table/table_cell` subcomponent to change the text alignment of individual cells, or apply this prop persistently to align entire columns.
2
- In the table above the "Rating" column contents is centered and the "Money" column contents is right aligned.
@@ -1,34 +0,0 @@
1
- <%= pb_rails("table") 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
- <% end %>
10
- <% end %>
11
- <%= pb_rails("table/table_body") do %>
12
- <%= pb_rails("table/table_row") do %>
13
- <%= pb_rails("table/table_cell", props: { text: "Value 1"}) %>
14
- <%= pb_rails("table/table_cell", props: { text: "Value 2"}) %>
15
- <%= pb_rails("table/table_cell", props: { text: "Value 3"}) %>
16
- <%= pb_rails("table/table_cell", props: { text: "Value 4"}) %>
17
- <%= pb_rails("table/table_cell", props: { text: "Value 5"}) %>
18
- <% end %>
19
- <%= pb_rails("table/table_row", props: { text_align: "center" }) do %>
20
- <%= pb_rails("table/table_cell", props: { text: "Value 1"}) %>
21
- <%= pb_rails("table/table_cell", props: { text: "Value 2"}) %>
22
- <%= pb_rails("table/table_cell", props: { text: "Value 3"}) %>
23
- <%= pb_rails("table/table_cell", props: { text: "Value 4"}) %>
24
- <%= pb_rails("table/table_cell", props: { text: "Value 5"}) %>
25
- <% end %>
26
- <%= pb_rails("table/table_row", props: { text_align: "right" }) do %>
27
- <%= pb_rails("table/table_cell", props: { text: "Value 1"}) %>
28
- <%= pb_rails("table/table_cell", props: { text: "Value 2"}) %>
29
- <%= pb_rails("table/table_cell", props: { text: "Value 3"}) %>
30
- <%= pb_rails("table/table_cell", props: { text: "Value 4"}) %>
31
- <%= pb_rails("table/table_cell", props: { text: "Value 5"}) %>
32
- <% end %>
33
- <% end %>
34
- <% end %>
@@ -1,2 +0,0 @@
1
- Pass our `text_align` global prop to any `table/table_row` subcomponent to change the text alignment of all cells within that row.
2
- The header/ first row is the default, followed by the second row being centered, and then the last row shifted to the right.
@@ -1,54 +0,0 @@
1
- <%= pb_rails("table") do %>
2
- <%= pb_rails("table/table_head") do %>
3
- <%= pb_rails("table/table_row") do %>
4
- <%= pb_rails("table/table_header", props: { text: "&nbsp;" }) %>
5
- <%= pb_rails("table/table_header", props: { text: "Price" }) %>
6
- <% end %>
7
- <% end %>
8
- <%= pb_rails("table/table_body") do %>
9
- <%= pb_rails("table/table_row") do %>
10
- <%= pb_rails("table/table_cell", props: { text: "Total", vertical_align: "bottom" }) %>
11
- <%= pb_rails("table/table_cell") do %>
12
- $12<br/>
13
- $46<br/>
14
- $25<br/>
15
- -------<br/>
16
- $83
17
- <% end %>
18
- <% end %>
19
- <% end %>
20
- <% end %>
21
- <br/>
22
- <%= pb_rails("table", props: { size: "sm" }) do %>
23
- <%= pb_rails("table/table_head") do %>
24
- <%= pb_rails("table/table_row") do %>
25
- <%= pb_rails("table/table_header", props: { text: "Espresso Drinks" }) %>
26
- <%= pb_rails("table/table_header", props: { text: "Ingredients" }) %>
27
- <% end %>
28
- <% end %>
29
- <%= pb_rails("table/table_body") do %>
30
- <%= pb_rails("table/table_row") do %>
31
- <%= pb_rails("table/table_cell", props: { text: "Cappuccino", vertical_align: "top" }) %>
32
- <%= pb_rails("table/table_cell") do %>
33
- Espresso<br/>
34
- Steamed Milk<br/>
35
- Milk Foam
36
- <% end %>
37
- <% end %>
38
- <%= pb_rails("table/table_row") do %>
39
- <%= pb_rails("table/table_cell", props: { text: "Macchiato", vertical_align: "top" }) %>
40
- <%= pb_rails("table/table_cell") do %>
41
- Espresso<br/>
42
- Steamed Milk
43
- <% end %>
44
- <% end %>
45
- <%= pb_rails("table/table_row") do %>
46
- <%= pb_rails("table/table_cell", props: { text: "Mocha", vertical_align: "top" }) %>
47
- <%= pb_rails("table/table_cell") do %>
48
- Espresso<br/>
49
- Hot Chocolate<br/>
50
- Steamed Milk
51
- <% end %>
52
- <% end %>
53
- <% end %>
54
- <% end %>
@@ -1,2 +0,0 @@
1
- Pass our `vertical_align` global prop to any `table/table_cell` subcomponent to change the text alignment of individual cells, or apply this prop persistently to align entire columns.
2
- The first table shifts "Total" down, whereas the second table shifts the "Espresso Drinks" column contents up.
@@ -1 +0,0 @@
1
- Pass our `verticalAlign` global prop to any `table.row` subcomponent to change the vertical alignment of all cells within that row.
@@ -1,53 +0,0 @@
1
- <%= pb_rails("table") 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
- <% end %>
10
- <% end %>
11
- <%= pb_rails("table/table_body") do %>
12
- <%= pb_rails("table/table_row") do %>
13
- <%= pb_rails("table/table_cell") do %>
14
- Value 1a
15
- <br />
16
- Value 1a
17
- <br />
18
- Value 1a
19
- <% end %>
20
- <%= pb_rails("table/table_cell", props: { text: "Value 2a" }) %>
21
- <%= pb_rails("table/table_cell", props: { text: "Value 3a" }) %>
22
- <%= pb_rails("table/table_cell", props: { text: "Value 4a" }) %>
23
- <%= pb_rails("table/table_cell", props: { text: "Value 5a" }) %>
24
- <% end %>
25
- <%= pb_rails("table/table_row", props: { vertical_align: "middle" }) do %>
26
- <%= pb_rails("table/table_cell") do %>
27
- Value 1b
28
- <br />
29
- Value 1b
30
- <br />
31
- Value 1b
32
- <% end %>
33
- <%= pb_rails("table/table_cell", props: { text: "Value 2b" }) %>
34
- <%= pb_rails("table/table_cell", props: { text: "Value 3b" }) %>
35
- <%= pb_rails("table/table_cell", props: { text: "Value 4b" }) %>
36
- <%= pb_rails("table/table_cell", props: { text: "Value 5b" }) %>
37
- <% end %>
38
- <%= pb_rails("table/table_row", props: { vertical_align: "bottom" }) do %>
39
- <%= pb_rails("table/table_cell") do %>
40
- Value 1c
41
- <br />
42
- Value 1c
43
- <br />
44
- Value 1c
45
- <% end %>
46
- <%= pb_rails("table/table_cell", props: { text: "Value 2c" }) %>
47
- <%= pb_rails("table/table_cell", props: { text: "Value 3c" }) %>
48
- <%= pb_rails("table/table_cell", props: { text: "Value 4c" }) %>
49
- <%= pb_rails("table/table_cell", props: { text: "Value 5c" }) %>
50
- <% end %>
51
- <% end %>
52
- <% end %>
53
-
@@ -1 +0,0 @@
1
- Pass our `vertical_align` global prop to any `table/table_row` subcomponent to change the vertical alignment of all cells within that row.
@@ -1,76 +0,0 @@
1
- import React from 'react'
2
-
3
- import Table from '../_table'
4
- import Button from '../../pb_button/_button'
5
-
6
- const TableOuterPadding = (props) => {
7
- return (
8
- <Table
9
- outerPadding="sm"
10
- size="sm"
11
- {...props}
12
- >
13
- <thead>
14
- <tr>
15
- <th>{'Column 1'}</th>
16
- <th>{'Column 2'}</th>
17
- <th>{'Column 3'}</th>
18
- <th>{'Column 4'}</th>
19
- <th>{''}</th>
20
- </tr>
21
- </thead>
22
- <tbody>
23
- <tr>
24
- <td>{'Value 1'}</td>
25
- <td>{'Value 2'}</td>
26
- <td>{'Value 3'}</td>
27
- <td>{'Value 4'}</td>
28
- <td align="right">
29
- {' '}
30
- <Button
31
- onClick={() => alert('button clicked!')}
32
- text="Action"
33
- variant="secondary"
34
- {...props}
35
- />
36
- {' '}
37
- </td>
38
- </tr>
39
- <tr>
40
- <td>{'Value 1'}</td>
41
- <td>{'Value 2'}</td>
42
- <td>{'Value 3'}</td>
43
- <td>{'Value 4'}</td>
44
- <td align="right">
45
- {' '}
46
- <Button
47
- onClick={() => alert('button clicked!')}
48
- text="Action"
49
- variant="secondary"
50
- {...props}
51
- />
52
- {' '}
53
- </td>
54
- </tr>
55
- <tr>
56
- <td>{'Value 1'}</td>
57
- <td>{'Value 2'}</td>
58
- <td>{'Value 3'}</td>
59
- <td>{'Value 4'}</td>
60
- <td align="right">
61
- {' '}
62
- <Button
63
- onClick={() => alert('button clicked!')}
64
- text="Action"
65
- variant="secondary"
66
- {...props}
67
- />
68
- {' '}
69
- </td>
70
- </tr>
71
- </tbody>
72
- </Table>
73
- )
74
- }
75
-
76
- export default TableOuterPadding
@@ -1 +0,0 @@
1
- Pass any of our spacing tokens to the `outerPadding` / `outer_padding` prop to customize a table's outer padding (both the left padding of the first column and the right padding of the last column).
@@ -1,21 +0,0 @@
1
- @import "../../tokens/spacing";
2
-
3
- [class^=pb_table] {
4
- @each $name, $value in $spaces {
5
- &.outer_padding_#{$name} {
6
- td:first-child,
7
- th:first-child,
8
- .pb_table_td:first-child,
9
- .pb_table_th:first-child {
10
- padding-left: #{$value} !important;
11
- }
12
-
13
- td:last-child,
14
- th:last-child,
15
- .pb_table_td:last-child,
16
- .pb_table_th:last-child {
17
- padding-right: #{$value} !important;
18
- }
19
- }
20
- }
21
- }
@@ -1,61 +0,0 @@
1
- import React from 'react';
2
- import { render, screen } from '../utilities/test-utils';
3
- import TreemapChart from './_treemap_chart';
4
-
5
- beforeEach(() => {
6
- // Silences error logs within the test suite.
7
- jest.spyOn(console, 'error');
8
- jest.spyOn(console, 'warn');
9
- console.error.mockImplementation(() => {});
10
- console.warn.mockImplementation(() => {});
11
- });
12
-
13
- afterEach(() => {
14
- console.error.mockRestore();
15
- console.warn.mockRestore();
16
- });
17
-
18
- const testId = 'treemapchart1';
19
-
20
- test('uses exact classname', () => {
21
- const data = [
22
- {
23
- name: "Pepperoni",
24
- parent: "Toppings",
25
- value: 600,
26
- }, {
27
- name: "Cheese",
28
- parent: "Toppings",
29
- value: 510,
30
- }, {
31
- name: "Mushroom",
32
- parent: "Toppings",
33
- value: 330,
34
- },{
35
- name: "Onions",
36
- parent: "Toppings",
37
- value: 250,
38
- }, {
39
- name: "Olives",
40
- parent: "Toppings",
41
- value: 204,
42
- }, {
43
- name: "Pineapple",
44
- parent: "Toppings",
45
- value: 90,
46
- }, {
47
- name: "Pizza Toppings",
48
- id: "Toppings",
49
- },
50
- ]
51
- render(
52
- <TreemapChart
53
- chartData={data}
54
- data={{ testid: testId }}
55
- id="tree-map-id"
56
- />
57
- );
58
-
59
- const kit = screen.getByTestId(testId);
60
- expect(kit).toHaveClass('pb_treemap_chart');
61
- });
@@ -1,18 +0,0 @@
1
- $vertical_align_baseline: baseline !default;
2
- $vertical_align_sub: sub !default;
3
- $vertical_align_super: super !default;
4
- $vertical_align_text_top: text-top !default;
5
- $vertical_align_text_bottom: text-bottom !default;
6
- $vertical_align_middle: middle !default;
7
- $vertical_align_top: top !default;
8
- $vertical_align_bottom: bottom !default;
9
- $vertical_align: (
10
- baseline: $vertical_align_baseline,
11
- sub: $vertical_align_sub,
12
- super: $vertical_align_super,
13
- text_top: $vertical_align_text_top,
14
- text_bottom: $vertical_align_text_bottom,
15
- middle: $vertical_align_middle,
16
- top: $vertical_align_top,
17
- bottom: $vertical_align_bottom
18
- );
@@ -1,16 +0,0 @@
1
- @import "../tokens/vertical_align";
2
-
3
-
4
- $vertical_align_classes: (
5
- vertical_align_baseline: $vertical_align_baseline,
6
- vertical_align_sub: $vertical_align_sub,
7
- vertical_align_super: $vertical_align_super,
8
- vertical_align_text_top: $vertical_align_text_top,
9
- vertical_align_text_bottom: $vertical_align_text_bottom,
10
- vertical_align_middle: $vertical_align_middle,
11
- vertical_align_top: $vertical_align_top,
12
- vertical_align_bottom: $vertical_align_bottom,
13
- );
14
-
15
-
16
- @include global_props_responsive_css($vertical_align, 'vertical_align', 'vertical-align');
@@ -1,14 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Playbook
4
- module Forms
5
- class Builder
6
- def dropdown_field(name, props: {})
7
- props[:name] = name
8
- props[:margin_bottom] = "sm"
9
- props[:label] = @template.label(@object_name, name) if props[:label] == true
10
- @template.pb_rails("dropdown", props: props)
11
- end
12
- end
13
- end
14
- end