playbook_ui 13.28.0.pre.alpha.pbntr312tableheaderflexremoval3019 → 13.28.0.pre.alpha.play829selectablecardalignment2978
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 +3 -2
- data/app/pb_kits/playbook/index.js +0 -2
- data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.tsx +1 -4
- data/app/pb_kits/playbook/pb_bar_graph/bar_graph.rb +0 -16
- data/app/pb_kits/playbook/pb_card/_card_mixin.scss +2 -1
- data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +2 -5
- data/app/pb_kits/playbook/pb_circle_chart/circle_chart.rb +0 -16
- data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +8 -14
- data/app/pb_kits/playbook/pb_collapsible/collapsible.test.js +0 -24
- data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.ts +1 -7
- data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.ts +1 -9
- data/app/pb_kits/playbook/pb_form_group/_form_group.scss +2 -2
- data/app/pb_kits/playbook/pb_line_graph/_line_graph.tsx +1 -4
- data/app/pb_kits/playbook/pb_line_graph/line_graph.rb +0 -16
- data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +1 -0
- data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.tsx +30 -32
- data/app/pb_kits/playbook/pb_selectable_card/selectable_card.html.erb +0 -2
- data/app/pb_kits/playbook/pb_table/_table.tsx +0 -5
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_column.html.erb +34 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_column.jsx +32 -33
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_column.md +1 -1
- data/app/pb_kits/playbook/pb_table/docs/{_table_outer_padding.html.erb → _table_alignment_row.html.erb} +7 -7
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_row.jsx +33 -33
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_row.md +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data.html.erb +63 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data.jsx +50 -51
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data.md +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row.html.erb +52 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row.jsx +38 -37
- data/app/pb_kits/playbook/pb_table/docs/example.yml +9 -9
- data/app/pb_kits/playbook/pb_table/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_table/styles/_all.scss +0 -1
- data/app/pb_kits/playbook/pb_table/table.rb +1 -14
- data/app/pb_kits/playbook/pb_table/table.test.js +1 -5
- data/app/pb_kits/playbook/pb_table/table_header.html.erb +2 -0
- data/app/pb_kits/playbook/playbook-doc.js +0 -2
- data/app/pb_kits/playbook/utilities/globalProps.ts +1 -12
- data/dist/menu.yml +2 -5
- data/dist/playbook-rails.js +6 -6
- data/lib/playbook/classnames.rb +0 -1
- data/lib/playbook/kit_base.rb +0 -2
- data/lib/playbook/version.rb +1 -1
- metadata +6 -35
- data/app/pb_kits/playbook/pb_bar_graph/barGraph.test.js +0 -31
- data/app/pb_kits/playbook/pb_circle_chart/circleChart.test.js +0 -45
- data/app/pb_kits/playbook/pb_collapsible/__snapshots__/collapsible.test.js.snap +0 -53
- data/app/pb_kits/playbook/pb_draggable/_draggable.scss +0 -10
- data/app/pb_kits/playbook/pb_draggable/_draggable.tsx +0 -53
- data/app/pb_kits/playbook/pb_draggable/context/index.tsx +0 -92
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_default.jsx +0 -53
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers.jsx +0 -159
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards.jsx +0 -121
- data/app/pb_kits/playbook/pb_draggable/docs/example.yml +0 -9
- data/app/pb_kits/playbook/pb_draggable/docs/index.js +0 -3
- data/app/pb_kits/playbook/pb_draggable/draggable.test.jsx +0 -65
- data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableContainer.tsx +0 -54
- data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableItem.tsx +0 -57
- data/app/pb_kits/playbook/pb_gauge/gauge.test.js +0 -35
- data/app/pb_kits/playbook/pb_line_graph/lineGraph.test.js +0 -52
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_column_rails.html.erb +0 -33
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_column_rails.md +0 -2
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_row_rails.html.erb +0 -34
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_row_rails.md +0 -2
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data_rails.html.erb +0 -54
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data_rails.md +0 -2
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row.md +0 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row_rails.html.erb +0 -53
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row_rails.md +0 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_outer_padding.jsx +0 -76
- data/app/pb_kits/playbook/pb_table/docs/_table_outer_padding.md +0 -1
- data/app/pb_kits/playbook/pb_table/styles/_outer_padding.scss +0 -21
- data/app/pb_kits/playbook/pb_treemap_chart/treemapChart.test.js +0 -61
- data/app/pb_kits/playbook/tokens/_vertical_align.scss +0 -18
- data/app/pb_kits/playbook/utilities/_vertical_align.scss +0 -16
- data/lib/playbook/vertical_align.rb +0 -37
@@ -1,121 +0,0 @@
|
|
1
|
-
import React, { useState } from "react";
|
2
|
-
import {
|
3
|
-
Flex,
|
4
|
-
Badge,
|
5
|
-
Title,
|
6
|
-
Icon,
|
7
|
-
Draggable,
|
8
|
-
DraggableProvider,
|
9
|
-
Card,
|
10
|
-
Caption,
|
11
|
-
} from "../../";
|
12
|
-
|
13
|
-
// Initial items to be dragged
|
14
|
-
const data = [
|
15
|
-
{
|
16
|
-
id: "1",
|
17
|
-
text: "Joe Black",
|
18
|
-
},
|
19
|
-
{
|
20
|
-
id: "2",
|
21
|
-
text: "Nancy White",
|
22
|
-
},
|
23
|
-
{
|
24
|
-
id: "3",
|
25
|
-
text: "Bill Green",
|
26
|
-
},
|
27
|
-
];
|
28
|
-
|
29
|
-
const DraggableWithCards = (props) => {
|
30
|
-
const [initialState, setInitialState] = useState(data);
|
31
|
-
|
32
|
-
return (
|
33
|
-
<DraggableProvider
|
34
|
-
initialItems={data}
|
35
|
-
onChange={(items) => setInitialState(items)}
|
36
|
-
>
|
37
|
-
<Draggable {...props}>
|
38
|
-
<Draggable.Container>
|
39
|
-
{initialState.map(({ id, text }) => (
|
40
|
-
<Draggable.Item id={id}
|
41
|
-
key={id}
|
42
|
-
>
|
43
|
-
<Card
|
44
|
-
highlight={{ position: "side", color: "primary" }}
|
45
|
-
marginBottom="xs"
|
46
|
-
>
|
47
|
-
<Flex alignItems="stretch"
|
48
|
-
flexDirection="column"
|
49
|
-
>
|
50
|
-
<Flex gap="xs">
|
51
|
-
<Title size={4}
|
52
|
-
text={text}
|
53
|
-
/>
|
54
|
-
<Badge
|
55
|
-
text="35-12345"
|
56
|
-
variant="primary"
|
57
|
-
/>
|
58
|
-
</Flex>
|
59
|
-
|
60
|
-
<Flex
|
61
|
-
gap="sm"
|
62
|
-
spacing="between"
|
63
|
-
>
|
64
|
-
<Caption
|
65
|
-
size="xs"
|
66
|
-
text="8:00A"
|
67
|
-
/>
|
68
|
-
<Flex gap="xxs">
|
69
|
-
<Caption
|
70
|
-
size="xs"
|
71
|
-
text="Township Name"
|
72
|
-
/>
|
73
|
-
<Caption size="xs"
|
74
|
-
text="•"
|
75
|
-
/>
|
76
|
-
<Caption size="xs"
|
77
|
-
text="90210"
|
78
|
-
/>
|
79
|
-
</Flex>
|
80
|
-
</Flex>
|
81
|
-
|
82
|
-
<Flex gap="xxs"
|
83
|
-
spacing="between"
|
84
|
-
>
|
85
|
-
<Flex gap="xxs">
|
86
|
-
<Caption color="error"
|
87
|
-
size="xs"
|
88
|
-
>
|
89
|
-
<Icon icon="house-circle-exclamation" />
|
90
|
-
</Caption>
|
91
|
-
<Caption color="success"
|
92
|
-
size="xs">
|
93
|
-
<Icon icon="file-circle-check" />
|
94
|
-
</Caption>
|
95
|
-
</Flex>
|
96
|
-
<Flex>
|
97
|
-
<Badge rounded
|
98
|
-
text="Schedule QA"
|
99
|
-
variant="warning"
|
100
|
-
/>
|
101
|
-
<Badge rounded
|
102
|
-
text="Flex"
|
103
|
-
variant="primary"
|
104
|
-
/>
|
105
|
-
<Badge rounded
|
106
|
-
text="R99"
|
107
|
-
variant="primary"
|
108
|
-
/>
|
109
|
-
</Flex>
|
110
|
-
</Flex>
|
111
|
-
</Flex>
|
112
|
-
</Card>
|
113
|
-
</Draggable.Item>
|
114
|
-
))}
|
115
|
-
</Draggable.Container>
|
116
|
-
</Draggable>
|
117
|
-
</DraggableProvider>
|
118
|
-
);
|
119
|
-
};
|
120
|
-
|
121
|
-
export default DraggableWithCards;
|
@@ -1,65 +0,0 @@
|
|
1
|
-
import React, {useState} from "react"
|
2
|
-
import { render, screen } from "../utilities/test-utils"
|
3
|
-
|
4
|
-
import { Draggable, DraggableProvider, SelectableList } from '../'
|
5
|
-
|
6
|
-
const testId = 'draggable'
|
7
|
-
|
8
|
-
const data = [
|
9
|
-
{
|
10
|
-
id: "1",
|
11
|
-
text: "Task 1",
|
12
|
-
},
|
13
|
-
{
|
14
|
-
id: "2",
|
15
|
-
text: "Task 2",
|
16
|
-
},
|
17
|
-
{
|
18
|
-
id: "3",
|
19
|
-
text: "Task 3",
|
20
|
-
},
|
21
|
-
{
|
22
|
-
id: "4",
|
23
|
-
text: "Task 4",
|
24
|
-
},
|
25
|
-
];
|
26
|
-
|
27
|
-
|
28
|
-
const DefaultDraggableKit = () => {
|
29
|
-
const [initialState, setInitialState] = useState(data);
|
30
|
-
|
31
|
-
return (
|
32
|
-
<DraggableProvider
|
33
|
-
initialItems={data}
|
34
|
-
onChange={(items) => setInitialState(items)}
|
35
|
-
>
|
36
|
-
<Draggable
|
37
|
-
data={{ testid: testId }}
|
38
|
-
draggableItems={data}
|
39
|
-
onDragChange={(items) => setInitialItems(items)}
|
40
|
-
>
|
41
|
-
<Draggable.Container>
|
42
|
-
<SelectableList variant="checkbox">
|
43
|
-
{initialState.map(({ id, text }) => (
|
44
|
-
<Draggable.Item id={id}
|
45
|
-
key={id}
|
46
|
-
>
|
47
|
-
<SelectableList.Item label={text}
|
48
|
-
name={id}
|
49
|
-
value={id}
|
50
|
-
/>
|
51
|
-
</Draggable.Item>
|
52
|
-
))}
|
53
|
-
</SelectableList>
|
54
|
-
</Draggable.Container>
|
55
|
-
</Draggable>
|
56
|
-
</DraggableProvider>
|
57
|
-
);
|
58
|
-
};
|
59
|
-
|
60
|
-
test('generated default kit and classname', () => {
|
61
|
-
render(<DefaultDraggableKit/>)
|
62
|
-
const kit = screen.getByTestId(testId)
|
63
|
-
expect(kit).toBeInTheDocument()
|
64
|
-
expect(kit).toHaveClass('pb_draggable')
|
65
|
-
})
|
@@ -1,54 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import classnames from "classnames";
|
3
|
-
import {
|
4
|
-
buildAriaProps,
|
5
|
-
buildCss,
|
6
|
-
buildDataProps,
|
7
|
-
buildHtmlProps
|
8
|
-
} from "../../utilities/props";
|
9
|
-
import { globalProps } from "../../utilities/globalProps";
|
10
|
-
import { DraggableContext } from "../context";
|
11
|
-
|
12
|
-
type DraggableContainerProps = {
|
13
|
-
aria?: { [key: string]: string };
|
14
|
-
children?: React.ReactNode;
|
15
|
-
className?: string;
|
16
|
-
container?: any;
|
17
|
-
data?: { [key: string]: string };
|
18
|
-
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
19
|
-
id?: string;
|
20
|
-
};
|
21
|
-
|
22
|
-
const DraggableContainer = (props: DraggableContainerProps) => {
|
23
|
-
const { aria = {}, children, className, container, data = {}, htmlOptions = {}, id } = props;
|
24
|
-
|
25
|
-
const { handleDragOver, handleDrop, activeContainer } = DraggableContext();
|
26
|
-
|
27
|
-
const ariaProps = buildAriaProps(aria);
|
28
|
-
const dataProps = buildDataProps(data);
|
29
|
-
const htmlProps = buildHtmlProps(htmlOptions);
|
30
|
-
|
31
|
-
const classes = classnames(
|
32
|
-
buildCss("pb_draggable_container"),
|
33
|
-
`${activeContainer === container ? "active" : ""}`,
|
34
|
-
globalProps(props),
|
35
|
-
className
|
36
|
-
);
|
37
|
-
|
38
|
-
return (
|
39
|
-
<div
|
40
|
-
{...ariaProps}
|
41
|
-
{...dataProps}
|
42
|
-
{...htmlProps}
|
43
|
-
className={classes}
|
44
|
-
id={id}
|
45
|
-
key={container}
|
46
|
-
onDragOver={(e) => handleDragOver(e, container)}
|
47
|
-
onDrop={() => handleDrop(container)}
|
48
|
-
>
|
49
|
-
{children}
|
50
|
-
</div>
|
51
|
-
);
|
52
|
-
};
|
53
|
-
|
54
|
-
export default DraggableContainer;
|
@@ -1,57 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import classnames from "classnames";
|
3
|
-
import {
|
4
|
-
buildAriaProps,
|
5
|
-
buildCss,
|
6
|
-
buildDataProps,
|
7
|
-
buildHtmlProps
|
8
|
-
} from "../../utilities/props";
|
9
|
-
import { globalProps } from "../../utilities/globalProps";
|
10
|
-
import { DraggableContext } from "../context";
|
11
|
-
|
12
|
-
type DraggableItemProps = {
|
13
|
-
aria?: { [key: string]: string };
|
14
|
-
children?: React.ReactNode;
|
15
|
-
className?: string;
|
16
|
-
container?: any;
|
17
|
-
data?: { [key: string]: string };
|
18
|
-
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
19
|
-
id?: string;
|
20
|
-
};
|
21
|
-
|
22
|
-
const DraggableItem = (props: DraggableItemProps) => {
|
23
|
-
const { aria = {}, children, className, container, data = {}, htmlOptions = {}, id } = props;
|
24
|
-
|
25
|
-
const { isDragging, handleDragStart, handleDragEnter, handleDragEnd } =
|
26
|
-
DraggableContext();
|
27
|
-
|
28
|
-
const ariaProps = buildAriaProps(aria);
|
29
|
-
const dataProps = buildDataProps(data);
|
30
|
-
const htmlProps = buildHtmlProps(htmlOptions);
|
31
|
-
|
32
|
-
const classes = classnames(
|
33
|
-
buildCss("pb_draggable_item"),
|
34
|
-
`${isDragging === id ? "is_dragging" : ""}`,
|
35
|
-
globalProps(props),
|
36
|
-
className
|
37
|
-
);
|
38
|
-
|
39
|
-
return (
|
40
|
-
<div
|
41
|
-
{...ariaProps}
|
42
|
-
{...dataProps}
|
43
|
-
{...htmlProps}
|
44
|
-
className={classes}
|
45
|
-
draggable
|
46
|
-
id={id}
|
47
|
-
key={id}
|
48
|
-
onDragEnd={() => handleDragEnd()}
|
49
|
-
onDragEnter={() => handleDragEnter(id, container)}
|
50
|
-
onDragStart={() => handleDragStart(id, container)}
|
51
|
-
>
|
52
|
-
{children}
|
53
|
-
</div>
|
54
|
-
);
|
55
|
-
};
|
56
|
-
|
57
|
-
export default DraggableItem;
|
@@ -1,35 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { render, screen } from '../utilities/test-utils';
|
3
|
-
import Gauge from './_gauge';
|
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 = 'gauge1';
|
19
|
-
|
20
|
-
test('uses exact classname', () => {
|
21
|
-
const data = [
|
22
|
-
{ name: 'Name', value: 45 },
|
23
|
-
]
|
24
|
-
render(
|
25
|
-
<Gauge
|
26
|
-
chartData={data}
|
27
|
-
data={{ testid: testId }}
|
28
|
-
id='gaugeid'
|
29
|
-
/>
|
30
|
-
);
|
31
|
-
|
32
|
-
const kit = screen.getByTestId(testId);
|
33
|
-
expect(kit).toHaveClass('pb_gauge_kit');
|
34
|
-
});
|
35
|
-
|
@@ -1,52 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { render, screen } from '../utilities/test-utils';
|
3
|
-
import LineGraph from './_line_graph';
|
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 = 'linechart1';
|
19
|
-
|
20
|
-
test('uses exact classname', () => {
|
21
|
-
const data = [{
|
22
|
-
name: 'Installation',
|
23
|
-
data: [43934, 52503, 57177, 69658, 97031, 119931, 137133, 154175],
|
24
|
-
}, {
|
25
|
-
name: 'Manufacturing',
|
26
|
-
data: [24916, 24064, 29742, 29851, 32490, 30282, 38121, 40434],
|
27
|
-
}, {
|
28
|
-
name: 'Sales & Distribution',
|
29
|
-
data: [11744, 17722, 16005, 19771, 20185, 24377, 32147, 39387],
|
30
|
-
}, {
|
31
|
-
name: 'Project Development',
|
32
|
-
data: [null, null, 7988, 12169, 15112, 22452, 34400, 34227],
|
33
|
-
}, {
|
34
|
-
name: 'Other',
|
35
|
-
data: [12908, 5948, 8105, 11248, 8989, 11816, 18274, 18111],
|
36
|
-
}]
|
37
|
-
render(
|
38
|
-
<LineGraph
|
39
|
-
axisTitle="Number of Employees"
|
40
|
-
chartData={data}
|
41
|
-
data={{ testid: testId }}
|
42
|
-
id="line-default"
|
43
|
-
subTitle="Source: thesolarfoundation.com"
|
44
|
-
title="Solar Employment Growth by Sector, 2010-2016"
|
45
|
-
xAxisCategories={['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']}
|
46
|
-
yAxisMin={0}
|
47
|
-
/>
|
48
|
-
);
|
49
|
-
|
50
|
-
const kit = screen.getByTestId(testId);
|
51
|
-
expect(kit).toHaveClass('pb_bar_graph');
|
52
|
-
});
|
@@ -1,33 +0,0 @@
|
|
1
|
-
<%= pb_rails("table") do %> <%= pb_rails("table/table_head") do %>
|
2
|
-
<%= pb_rails("table/table_row") do %>
|
3
|
-
<%= pb_rails("table/table_header", props: { text: "Column 1"}) %>
|
4
|
-
<%= pb_rails("table/table_header", props: { text: "Column 2"}) %>
|
5
|
-
<%= pb_rails("table/table_header", props: { text: "Column 3"}) %>
|
6
|
-
<%= pb_rails("table/table_header", props: { text: "Rating", text_align: "center" }) %>
|
7
|
-
<%= pb_rails("table/table_header", props: { text: "Money", text_align: "right" }) %>
|
8
|
-
<% end %>
|
9
|
-
<% end %>
|
10
|
-
<%= pb_rails("table/table_body") do %>
|
11
|
-
<%= pb_rails("table/table_row") do %>
|
12
|
-
<%= pb_rails("table/table_cell", props: { text: "Value 1"}) %>
|
13
|
-
<%= pb_rails("table/table_cell", props: { text: "Value 2"}) %>
|
14
|
-
<%= pb_rails("table/table_cell", props: { text: "Value 3"}) %>
|
15
|
-
<%= pb_rails("table/table_cell", props: { text: "3", text_align: "center" }) %>
|
16
|
-
<%= pb_rails("table/table_cell", props: { text: "$57.32", text_align: "right" }) %>
|
17
|
-
<% end %>
|
18
|
-
<%= pb_rails("table/table_row") do %>
|
19
|
-
<%= pb_rails("table/table_cell", props: { text: "Value 1"}) %>
|
20
|
-
<%= pb_rails("table/table_cell", props: { text: "Value 2"}) %>
|
21
|
-
<%= pb_rails("table/table_cell", props: { text: "Value 3"}) %>
|
22
|
-
<%= pb_rails("table/table_cell", props: { text: "2", text_align: "center" }) %>
|
23
|
-
<%= pb_rails("table/table_cell", props: { text: "$5,657.08", text_align: "right" }) %>
|
24
|
-
<% end %>
|
25
|
-
<%= pb_rails("table/table_row") do %>
|
26
|
-
<%= pb_rails("table/table_cell", props: { text: "Value 1"}) %>
|
27
|
-
<%= pb_rails("table/table_cell", props: { text: "Value 2"}) %>
|
28
|
-
<%= pb_rails("table/table_cell", props: { text: "Value 3"}) %>
|
29
|
-
<%= pb_rails("table/table_cell", props: { text: "4", text_align: "center" }) %>
|
30
|
-
<%= pb_rails("table/table_cell", props: { text: "$358.77", text_align: "right" }) %>
|
31
|
-
<% end %>
|
32
|
-
<% end %>
|
33
|
-
<% end %>
|
@@ -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,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: " " }) %>
|
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
|