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.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +3 -2
  3. data/app/pb_kits/playbook/index.js +0 -2
  4. data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.tsx +1 -4
  5. data/app/pb_kits/playbook/pb_bar_graph/bar_graph.rb +0 -16
  6. data/app/pb_kits/playbook/pb_card/_card_mixin.scss +2 -1
  7. data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +2 -5
  8. data/app/pb_kits/playbook/pb_circle_chart/circle_chart.rb +0 -16
  9. data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +8 -14
  10. data/app/pb_kits/playbook/pb_collapsible/collapsible.test.js +0 -24
  11. data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.ts +1 -7
  12. data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.ts +1 -9
  13. data/app/pb_kits/playbook/pb_form_group/_form_group.scss +2 -2
  14. data/app/pb_kits/playbook/pb_line_graph/_line_graph.tsx +1 -4
  15. data/app/pb_kits/playbook/pb_line_graph/line_graph.rb +0 -16
  16. data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +1 -0
  17. data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.tsx +30 -32
  18. data/app/pb_kits/playbook/pb_selectable_card/selectable_card.html.erb +0 -2
  19. data/app/pb_kits/playbook/pb_table/_table.tsx +0 -5
  20. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_column.html.erb +34 -0
  21. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_column.jsx +32 -33
  22. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_column.md +1 -1
  23. data/app/pb_kits/playbook/pb_table/docs/{_table_outer_padding.html.erb → _table_alignment_row.html.erb} +7 -7
  24. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_row.jsx +33 -33
  25. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_row.md +1 -1
  26. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data.html.erb +63 -0
  27. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data.jsx +50 -51
  28. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data.md +1 -1
  29. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row.html.erb +52 -0
  30. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row.jsx +38 -37
  31. data/app/pb_kits/playbook/pb_table/docs/example.yml +9 -9
  32. data/app/pb_kits/playbook/pb_table/docs/index.js +0 -1
  33. data/app/pb_kits/playbook/pb_table/styles/_all.scss +0 -1
  34. data/app/pb_kits/playbook/pb_table/table.rb +1 -14
  35. data/app/pb_kits/playbook/pb_table/table.test.js +1 -5
  36. data/app/pb_kits/playbook/pb_table/table_header.html.erb +2 -0
  37. data/app/pb_kits/playbook/playbook-doc.js +0 -2
  38. data/app/pb_kits/playbook/utilities/globalProps.ts +1 -12
  39. data/dist/menu.yml +2 -5
  40. data/dist/playbook-rails.js +6 -6
  41. data/lib/playbook/classnames.rb +0 -1
  42. data/lib/playbook/kit_base.rb +0 -2
  43. data/lib/playbook/version.rb +1 -1
  44. metadata +6 -35
  45. data/app/pb_kits/playbook/pb_bar_graph/barGraph.test.js +0 -31
  46. data/app/pb_kits/playbook/pb_circle_chart/circleChart.test.js +0 -45
  47. data/app/pb_kits/playbook/pb_collapsible/__snapshots__/collapsible.test.js.snap +0 -53
  48. data/app/pb_kits/playbook/pb_draggable/_draggable.scss +0 -10
  49. data/app/pb_kits/playbook/pb_draggable/_draggable.tsx +0 -53
  50. data/app/pb_kits/playbook/pb_draggable/context/index.tsx +0 -92
  51. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_default.jsx +0 -53
  52. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers.jsx +0 -159
  53. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards.jsx +0 -121
  54. data/app/pb_kits/playbook/pb_draggable/docs/example.yml +0 -9
  55. data/app/pb_kits/playbook/pb_draggable/docs/index.js +0 -3
  56. data/app/pb_kits/playbook/pb_draggable/draggable.test.jsx +0 -65
  57. data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableContainer.tsx +0 -54
  58. data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableItem.tsx +0 -57
  59. data/app/pb_kits/playbook/pb_gauge/gauge.test.js +0 -35
  60. data/app/pb_kits/playbook/pb_line_graph/lineGraph.test.js +0 -52
  61. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_column_rails.html.erb +0 -33
  62. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_column_rails.md +0 -2
  63. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_row_rails.html.erb +0 -34
  64. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_row_rails.md +0 -2
  65. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data_rails.html.erb +0 -54
  66. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data_rails.md +0 -2
  67. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row.md +0 -1
  68. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row_rails.html.erb +0 -53
  69. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row_rails.md +0 -1
  70. data/app/pb_kits/playbook/pb_table/docs/_table_outer_padding.jsx +0 -76
  71. data/app/pb_kits/playbook/pb_table/docs/_table_outer_padding.md +0 -1
  72. data/app/pb_kits/playbook/pb_table/styles/_outer_padding.scss +0 -21
  73. data/app/pb_kits/playbook/pb_treemap_chart/treemapChart.test.js +0 -61
  74. data/app/pb_kits/playbook/tokens/_vertical_align.scss +0 -18
  75. data/app/pb_kits/playbook/utilities/_vertical_align.scss +0 -16
  76. data/lib/playbook/vertical_align.rb +0 -37
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d9c78fc4581891bf1187d4a38fb387d210e9994ccc37993b6f6c2ff10124b895
4
- data.tar.gz: '03539fc54dbbb2809c7899e1d452b5578159f6725cae9a1638365c88b2b6c29c'
3
+ metadata.gz: c2ea0b161920a1666fef468539f56e8185b902f0fe7b31969a8ee2d761a64b59
4
+ data.tar.gz: 2a85f19f34fea779816b46739f34f643fa2def667bce1194e678a32f0eb67e0d
5
5
  SHA512:
6
- metadata.gz: 96950131978879d4e45dbd5e8cd204f7a45a0f57d6d69034ab40732958fa4460bb9464fa99aa54ff8ed51e79d15d988f19653d16f7125a4b477500987969e7dd
7
- data.tar.gz: 7cffbe91d7528dda2964fd5f10625949a96ffcf71cbda60dcf1f632e8842bdedf5f1f602fd3ebe3deea391be4a6e107b597bded8119729aa06893cb6961f0c92
6
+ metadata.gz: f383ffb93e9d97358349b13cc4f3a282b140ecc628fba9c097dd652ba6c0a824efaa1f796b932b165cd38b326899d0c6875d96b6f731858824bbdf42687d956f
7
+ data.tar.gz: ea09734e0f9abbc10a328f6b5e5b0c8248f1df495dc33abf14ea96cfb2f90e97aeb92f6e6ec0512fe2ffa3212fb4c8543cf9a187afd3e84c383a0f0b93a87f41
@@ -1,3 +1,6 @@
1
+
2
+
3
+
1
4
  @import 'pb_advanced_table/advanced_table';
2
5
  @import 'pb_avatar/avatar';
3
6
  @import 'pb_avatar_action_button/avatar_action_button';
@@ -28,7 +31,6 @@
28
31
  @import 'pb_detail/detail';
29
32
  @import 'pb_dialog/dialog';
30
33
  @import 'pb_distribution_bar/distribution_bar';
31
- @import 'pb_draggable/draggable';
32
34
  @import 'pb_dropdown/dropdown';
33
35
  @import 'pb_file_upload/file_upload';
34
36
  @import 'pb_filter/filter';
@@ -119,4 +121,3 @@
119
121
  @import './utilities/text_align';
120
122
  @import './utilities/overflow';
121
123
  @import './utilities/truncate';
122
- @import './utilities/vertical_align';
@@ -35,8 +35,6 @@ export { default as DateYearStacked } from './pb_date_year_stacked/_date_year_st
35
35
  export { default as Detail} from './pb_detail/_detail'
36
36
  export { default as Dialog } from './pb_dialog/_dialog'
37
37
  export { default as DistributionBar } from './pb_distribution_bar/_distribution_bar'
38
- export { default as Draggable} from './pb_draggable/_draggable'
39
- export { DraggableProvider} from './pb_draggable/context'
40
38
  export { default as Dropdown} from './pb_dropdown/_dropdown'
41
39
  export { default as FileUpload } from './pb_file_upload/_file_upload'
42
40
  export { default as Filter } from './pb_filter/_filter'
@@ -163,9 +163,6 @@ if (Array.isArray(axisTitle) && axisTitle.length > 1 && axisTitle[1].name) {
163
163
  staticOptions.plotOptions.series.events = { legendItemClick: () => false };
164
164
  }
165
165
 
166
- const filteredProps: any = {...props};
167
- delete filteredProps.verticalAlign;
168
-
169
166
  const [options, setOptions] = useState({});
170
167
 
171
168
  useEffect(() => {
@@ -175,7 +172,7 @@ if (Array.isArray(axisTitle) && axisTitle.length > 1 && axisTitle[1].name) {
175
172
  return (
176
173
  <HighchartsReact
177
174
  containerProps={{
178
- className: classnames(globalProps(filteredProps), className),
175
+ className: classnames(globalProps(props), className),
179
176
  id: id,
180
177
  ...ariaProps,
181
178
  ...dataProps,
@@ -74,22 +74,6 @@ module Playbook
74
74
  standard_options.deep_merge(custom_options)
75
75
  end
76
76
 
77
- def vertical_align_props
78
- if vertical_align
79
- if object.vertical_align
80
- original_result = super
81
- class_to_remove = "vertical_align_#{object.vertical_align}"
82
-
83
- modified_result = original_result.gsub(class_to_remove, "").strip
84
- modified_result.empty? ? nil : modified_result
85
- else
86
- super
87
- end
88
- else
89
- super
90
- end
91
- end
92
-
93
77
  def classname
94
78
  generate_classname("pb_bar_graph")
95
79
  end
@@ -28,7 +28,8 @@ $pb_card_header_colors: map-merge(map-merge($product_colors, $additional_colors)
28
28
 
29
29
  @mixin pb_card_selected($border_color: $primary) {
30
30
  border-color: $border_color;
31
- border-width: $pb_card_border_width * 2;
31
+ border-width: $pb_card_border_width;
32
+ outline: 1px solid $border_color;
32
33
  }
33
34
 
34
35
  @mixin pb_card_selected_dark {
@@ -115,9 +115,6 @@ const CircleChart = ({
115
115
  innerSizes[size];
116
116
 
117
117
 
118
- const filteredProps: any = {...props};
119
- delete filteredProps.verticalAlign;
120
-
121
118
  const [options, setOptions] = useState({});
122
119
 
123
120
  useEffect(() => {
@@ -184,7 +181,7 @@ const CircleChart = ({
184
181
  <div id={`wrapper-circle-chart-${id}`}>
185
182
  <HighchartsReact
186
183
  containerProps={{
187
- className: classnames("pb_circle_chart", globalProps(filteredProps)),
184
+ className: classnames("pb_circle_chart", globalProps(props)),
188
185
  id: id,
189
186
  ...ariaProps,
190
187
  ...dataProps,
@@ -198,7 +195,7 @@ const CircleChart = ({
198
195
  ) : (
199
196
  <HighchartsReact
200
197
  containerProps={{
201
- className: classnames("pb_circle_chart", globalProps(filteredProps)),
198
+ className: classnames("pb_circle_chart", globalProps(props)),
202
199
  id: id,
203
200
  ...ariaProps,
204
201
  ...dataProps,
@@ -68,22 +68,6 @@ module Playbook
68
68
  }
69
69
  end
70
70
 
71
- def vertical_align_props
72
- if vertical_align
73
- if object.vertical_align
74
- original_result = super
75
- class_to_remove = "vertical_align_#{object.vertical_align}"
76
-
77
- modified_result = original_result.gsub(class_to_remove, "").strip
78
- modified_result.empty? ? nil : modified_result
79
- else
80
- super
81
- end
82
- else
83
- super
84
- end
85
- end
86
-
87
71
  def classname
88
72
  generate_classname("pb_circle_chart")
89
73
  end
@@ -1,4 +1,4 @@
1
- import React, { useEffect, ReactElement } from 'react'
1
+ import React, { useEffect } from 'react'
2
2
  import classnames from 'classnames'
3
3
  import useCollapsible from './useCollapsible'
4
4
 
@@ -11,16 +11,9 @@ import CollapsibleContext from './context'
11
11
  import { IconSizes } from "../pb_icon/_icon"
12
12
  import CollapsibleIcon from './child_kits/CollapsibleIcon'
13
13
 
14
- type CollapsibleMainProps = {
15
- children: React.ReactNode
16
- }
17
-
18
- type CollapsibleContentProps = {
19
- children: React.ReactNode
20
- }
21
14
 
22
15
  type CollapsibleProps = {
23
- children?: [ReactElement<CollapsibleMainProps>, ReactElement<CollapsibleContentProps>],
16
+ children?: React.ReactElement | [] | any,
24
17
  aria?: {[key: string]: string},
25
18
  className?: string,
26
19
  collapsed?: boolean,
@@ -37,7 +30,7 @@ type CollapsibleProps = {
37
30
  const Collapsible = ({
38
31
  aria = {},
39
32
  className,
40
- children,
33
+ children = [],
41
34
  collapsed = true,
42
35
  data = {},
43
36
  htmlOptions = {},
@@ -55,12 +48,13 @@ const Collapsible = ({
55
48
  setIsCollapsed(collapsed)
56
49
  },[collapsed])
57
50
 
58
- if (children.length !== 2) {
51
+ const CollapsibleParent = React.Children.toArray(children) as React.ReactElement[]
52
+
53
+ if (CollapsibleParent.length !== 2) {
59
54
  throw new Error('Collapsible requires <CollapsibleMain> and <CollapsibleContent> to function properly.')
60
55
  }
61
-
62
- const FirstChild = children[0]
63
- const SecondChild = children[1]
56
+ const FirstChild = CollapsibleParent[0]
57
+ const SecondChild = CollapsibleParent[1]
64
58
 
65
59
  const Main = FirstChild.type === CollapsibleMain ? FirstChild : null
66
60
  const Content = SecondChild.type === CollapsibleContent ? SecondChild : null
@@ -48,27 +48,3 @@ test('returns namespaced additional_class class name', () => {
48
48
  const kit = screen.getByTestId(testId)
49
49
  expect(kit).toHaveClass(`${kitClass} additional_class`)
50
50
  })
51
-
52
- test('html structure is correct', () => {
53
- const { container } = render(
54
- <Collapsible
55
- className="additional_class"
56
- data={{ testid: testId }}
57
- iconColor='lighter'
58
- iconSize="lg"
59
- >
60
- <Collapsible.Main>
61
- <div>{'Main Section'}</div>
62
- </Collapsible.Main>
63
- <Collapsible.Content>
64
- <div>
65
- {
66
- 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. In vel erat sed purus hendrerit viverra. Duis et vestibulum metus. Sed consequat ut ante non vehicula. Etiam nunc massa, pharetra vel quam id, posuere rhoncus quam. Quisque imperdiet arcu enim, nec aliquet justo auctor eget. Curabitur in metus nec nunc rhoncus faucibus vitae ac elit. Nulla facilisi. Vestibulum quis pretium nulla. Nulla ut accumsan velit. Duis varius urna sed sem tempor, sit amet fermentum nibh auctor. Praesent lorem arcu, egestas non ante quis, placerat pellentesque lectus.Vestibulum lacinia ipsum quis venenatis tristique. Vivamus suscipit, libero eu fringilla egestas, orci urna commodo arcu, vel gravida turpis ipsum molestie nibh. Donec cursus eu ante sagittis ultrices. Phasellus id sagittis risus. Mauris dapibus neque faucibus, tempor ligula vel, cursus ante. Donec faucibus gravida porta. Nullam egestas est quis aliquam feugiat. Sed eget metus diam. Cras eget placerat libero.'
67
- }
68
- </div>
69
- </Collapsible.Content>
70
- </Collapsible>
71
- )
72
-
73
- expect(container).toMatchSnapshot()
74
- })
@@ -3,12 +3,6 @@ import typography from '../tokens/exports/_typography.scss'
3
3
 
4
4
  import { ThemeProps } from './themeTypes'
5
5
 
6
- interface CustomTreemapOptions extends Highcharts.SeriesTreemapOptions {
7
- traverseUpButton?: {
8
- position: { y: number };
9
- };
10
- }
11
-
12
6
  const highchartsDarkTheme: ThemeProps = {
13
7
  lang: {
14
8
  thousandsSep: ',',
@@ -206,7 +200,7 @@ const highchartsDarkTheme: ThemeProps = {
206
200
  traverseUpButton: {
207
201
  position: { y: -50 },
208
202
  },
209
- } as CustomTreemapOptions,
203
+ },
210
204
  },
211
205
  credits: {
212
206
  enabled: false
@@ -3,13 +3,6 @@ import typography from '../tokens/exports/_typography.scss'
3
3
 
4
4
  import { ThemeProps } from './themeTypes'
5
5
 
6
- interface CustomTreemapOptions extends Highcharts.SeriesTreemapOptions {
7
- traverseUpButton?: {
8
- position: { y: number };
9
- };
10
- }
11
-
12
-
13
6
  const highchartsTheme: ThemeProps = {
14
7
  lang: {
15
8
  thousandsSep: ',',
@@ -157,7 +150,6 @@ const highchartsTheme: ThemeProps = {
157
150
  fontSize: typography.text_smaller,
158
151
  color: colors.text_lt_light,
159
152
  fontWeight: typography.regular,
160
- textOutline: '2px $white',
161
153
  },
162
154
  },
163
155
  },
@@ -206,7 +198,7 @@ const highchartsTheme: ThemeProps = {
206
198
  traverseUpButton: {
207
199
  position: { y: -50 },
208
200
  },
209
- } as CustomTreemapOptions,
201
+ },
210
202
  },
211
203
  credits: {
212
204
  enabled: false
@@ -107,7 +107,7 @@
107
107
  }
108
108
 
109
109
  & > [class^=pb_date_picker_kit]:not(:last-child) {
110
- .input_wrapper input, [class^=pb_text_input_kit] .date_picker_input_wrapper .flatpickr-wrapper {
110
+ .text_input_wrapper input, [class^=pb_text_input_kit] .text_input_wrapper .flatpickr-wrapper {
111
111
  border-bottom-right-radius: 0;
112
112
  border-top-right-radius: 0;
113
113
  border-right-width: 0;
@@ -115,7 +115,7 @@
115
115
  }
116
116
 
117
117
  & > [class^=pb_date_picker_kit]:not(:first-child) {
118
- .input_wrapper input, [class^=pb_text_input_kit] .date_picker_input_wrapper .flatpickr-wrapper {
118
+ .text_input_wrapper input, [class^=pb_text_input_kit] .text_input_wrapper .flatpickr-wrapper {
119
119
  border-bottom-left-radius: 0;
120
120
  border-top-left-radius: 0;
121
121
  }
@@ -130,9 +130,6 @@ const LineGraph = ({
130
130
  staticOptions.plotOptions.series.events = { legendItemClick: () => false };
131
131
  }
132
132
 
133
- const filteredProps: any = {...props};
134
- delete filteredProps.verticalAlign;
135
-
136
133
  const [options, setOptions] = useState({});
137
134
 
138
135
  useEffect(() => {
@@ -142,7 +139,7 @@ const LineGraph = ({
142
139
  return (
143
140
  <HighchartsReact
144
141
  containerProps={{
145
- className: classnames(globalProps(filteredProps), className),
142
+ className: classnames(globalProps(props), className),
146
143
  id: id,
147
144
  ...ariaProps,
148
145
  ...dataProps,
@@ -64,22 +64,6 @@ module Playbook
64
64
  }
65
65
  end
66
66
 
67
- def vertical_align_props
68
- if vertical_align
69
- if object.vertical_align
70
- original_result = super
71
- class_to_remove = "vertical_align_#{object.vertical_align}"
72
-
73
- modified_result = original_result.gsub(class_to_remove, "").strip
74
- modified_result.empty? ? nil : modified_result
75
- else
76
- super
77
- end
78
- else
79
- super
80
- end
81
- end
82
-
83
67
  def classname
84
68
  generate_classname("pb_line_graph")
85
69
  end
@@ -28,6 +28,7 @@ $pb_selectable_card_border: 2px;
28
28
  padding: $space_sm;
29
29
  margin-bottom: $space_sm;
30
30
  cursor: pointer;
31
+ outline: 1px solid transparant;
31
32
 
32
33
  @media (hover:hover) {
33
34
  &:hover {
@@ -131,43 +131,41 @@ const SelectableCard = (props: SelectableCardProps) => {
131
131
  className={globalProps(labelProps)}
132
132
  htmlFor={inputIdPresent}
133
133
  >
134
- <div className="buffer">
135
- {variant === 'displayInput' ?
136
- <Flex vertical="center">
137
- <Flex
138
- orientation="column"
139
- padding="sm"
140
- paddingRight="xs"
141
- vertical="center"
142
- >
143
- <Input
144
- dark={dark}
145
- >
146
- <input
147
- checked={checked}
148
- disabled={disabled}
149
- onClick={handleClick}
150
- readOnly
151
- type={inputType}
152
- />
153
- </Input>
154
- </Flex>
155
- <div className="separator" />
156
- <div className="psuedo_separator"/>
157
- <Card
158
- borderNone
134
+ {variant === 'displayInput' ?
135
+ <Flex vertical="center">
136
+ <Flex
137
+ orientation="column"
138
+ padding="sm"
139
+ paddingRight="xs"
140
+ vertical="center"
141
+ >
142
+ <Input
159
143
  dark={dark}
160
- padding="sm"
161
- status={error ? 'negative' : null}
162
144
  >
163
- {text ||props.children}
164
- </Card>
145
+ <input
146
+ checked={checked}
147
+ disabled={disabled}
148
+ onClick={handleClick}
149
+ readOnly
150
+ type={inputType}
151
+ />
152
+ </Input>
165
153
  </Flex>
166
- :
154
+ <div className="separator" />
155
+ <div className="psuedo_separator"/>
156
+ <Card
157
+ borderNone
158
+ dark={dark}
159
+ padding="sm"
160
+ status={error ? 'negative' : null}
161
+ >
162
+ {text ||props.children}
163
+ </Card>
164
+ </Flex>
165
+ :
167
166
  text || props.children
168
- }
167
+ }
169
168
  {displayIcon()}
170
- </div>
171
169
  </label>
172
170
  </div>
173
171
  )
@@ -11,7 +11,6 @@
11
11
  <% end %>
12
12
 
13
13
  <label class="<%= object.label_class %>" for="<%= object.input_id_present %>">
14
- <div class="buffer">
15
14
  <% if object.variant == "display_input" %>
16
15
  <%= pb_rails("flex", props: { vertical: "center" }) do %>
17
16
  <%= pb_rails("flex", props: {
@@ -46,7 +45,6 @@
46
45
  </div>
47
46
  <% end %>
48
47
  <% end %>
49
- </div>
50
48
  </label>
51
49
 
52
50
  <% if object.variant == "display_input" %>
@@ -23,7 +23,6 @@ type TableProps = {
23
23
  disableHover?: boolean,
24
24
  htmlOptions?: { [key: string]: string | number | boolean | (() => void) },
25
25
  id?: string,
26
- outerPadding?: "none" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl",
27
26
  responsive?: "collapse" | "scroll" | "none",
28
27
  singleLine?: boolean,
29
28
  size?: "sm" | "md" | "lg",
@@ -46,7 +45,6 @@ const Table = (props: TableProps) => {
46
45
  disableHover = false,
47
46
  htmlOptions = {},
48
47
  id,
49
- outerPadding = '',
50
48
  responsive = 'collapse',
51
49
  singleLine = false,
52
50
  size = 'sm',
@@ -61,8 +59,6 @@ const Table = (props: TableProps) => {
61
59
  const htmlProps = buildHtmlProps(htmlOptions)
62
60
  const tableCollapseCss = responsive !== 'none' ? `table-collapse-${collapse}` : ''
63
61
  const verticalBorderCss = verticalBorder ? 'vertical-border' : ''
64
- const spaceCssName = outerPadding !== 'none' ? 'space_' : ''
65
- const outerPaddingCss = outerPadding ? `outer_padding_${spaceCssName}${outerPadding}` : ''
66
62
  const isTableTag = tag === 'table'
67
63
 
68
64
  const classNames = classnames(
@@ -77,7 +73,6 @@ const Table = (props: TableProps) => {
77
73
  'no-hover': disableHover,
78
74
  'sticky-header': sticky,
79
75
  'striped': striped,
80
- [outerPaddingCss]: outerPadding !== '',
81
76
  },
82
77
  globalProps(props),
83
78
  tableCollapseCss,
@@ -0,0 +1,34 @@
1
+ <%= pb_rails("table") do %>
2
+ <thead>
3
+ <tr>
4
+ <th>Column 1</th>
5
+ <th>Column 2</th>
6
+ <th>Column 3</th>
7
+ <th align="center">Rating</th>
8
+ <th align="right">Money</th>
9
+ </tr>
10
+ </thead>
11
+ <tbody>
12
+ <tr>
13
+ <td>Value 1</td>
14
+ <td>Value 2</td>
15
+ <td>Value 3</td>
16
+ <td align="center">3</td>
17
+ <td align="right">$57.32</td>
18
+ </tr>
19
+ <tr>
20
+ <td>Value 1</td>
21
+ <td>Value 2</td>
22
+ <td>Value 3</td>
23
+ <td align="center">2</td>
24
+ <td align="right">$5,657.08</td>
25
+ </tr>
26
+ <tr>
27
+ <td>Value 1</td>
28
+ <td>Value 2</td>
29
+ <td>Value 3</td>
30
+ <td align="center">4</td>
31
+ <td align="right">$358.77</td>
32
+ </tr>
33
+ </tbody>
34
+ <% end %>
@@ -7,40 +7,39 @@ const TableAlignmentColumn = (props) => {
7
7
  <Table
8
8
  {...props}
9
9
  >
10
- <Table.Head>
11
- <Table.Row>
12
- <Table.Header>{'Column 1'}</Table.Header>
13
- <Table.Header>{'Column 2'}</Table.Header>
14
- <Table.Header>{'Column 3'}</Table.Header>
15
- <Table.Header textAlign="center">{'Rating'}</Table.Header>
16
- <Table.Header textAlign="right">{'Money'}</Table.Header>
17
- </Table.Row>
18
- </Table.Head>
19
- <Table.Body>
20
- <Table.Row>
21
- <Table.Cell>{'Value 1'}</Table.Cell>
22
- <Table.Cell>{'Value 2'}</Table.Cell>
23
- <Table.Cell>{'Value 3'}</Table.Cell>
24
- <Table.Cell textAlign="center">{'3'}</Table.Cell>
25
- <Table.Cell textAlign="right">{'$57.32'}</Table.Cell>
26
- </Table.Row>
27
- <Table.Row>
28
- <Table.Cell>{'Value 1'}</Table.Cell>
29
- <Table.Cell>{'Value 2'}</Table.Cell>
30
- <Table.Cell>{'Value 3'}</Table.Cell>
31
- <Table.Cell textAlign="center">{'2'}</Table.Cell>
32
- <Table.Cell textAlign="right">{'$5,657.08'}</Table.Cell>
33
- </Table.Row>
34
- <Table.Row>
35
- <Table.Cell>{'Value 1'}</Table.Cell>
36
- <Table.Cell>{'Value 2'}</Table.Cell>
37
- <Table.Cell>{'Value 3'}</Table.Cell>
38
- <Table.Cell textAlign="center">{'4'}</Table.Cell>
39
- <Table.Cell textAlign="right">{'$358.77'}</Table.Cell>
40
- </Table.Row>
41
- </Table.Body>
10
+ <thead>
11
+ <tr>
12
+ <th>{'Column 1'}</th>
13
+ <th>{'Column 2'}</th>
14
+ <th>{'Column 3'}</th>
15
+ <th align="center">{'Rating'}</th>
16
+ <th align="right">{'Money'}</th>
17
+ </tr>
18
+ </thead>
19
+ <tbody>
20
+ <tr>
21
+ <td>{'Value 1'}</td>
22
+ <td>{'Value 2'}</td>
23
+ <td>{'Value 3'}</td>
24
+ <td align="center">{'3'}</td>
25
+ <td align="right">{'$57.32'}</td>
26
+ </tr>
27
+ <tr>
28
+ <td>{'Value 1'}</td>
29
+ <td>{'Value 2'}</td>
30
+ <td>{'Value 3'}</td>
31
+ <td align="center">{'2'}</td>
32
+ <td align="right">{'$5,657.08'}</td>
33
+ </tr>
34
+ <tr>
35
+ <td>{'Value 1'}</td>
36
+ <td>{'Value 2'}</td>
37
+ <td>{'Value 3'}</td>
38
+ <td align="center">{'4'}</td>
39
+ <td align="right">{'$358.77'}</td>
40
+ </tr>
41
+ </tbody>
42
42
  </Table>
43
-
44
43
  )
45
44
  }
46
45
 
@@ -1,2 +1,2 @@
1
- Pass our `textAlign` global prop to any `table.cell` subcomponent to change the text alignment of individual cells, or apply this prop persistently to align entire columns.
1
+ You can individually align a piece of table data, but a more practical use would be applied to align a column.
2
2
  In the table above the "Rating" column contents is centered and the "Money" column contents is right aligned.
@@ -1,11 +1,11 @@
1
- <%= pb_rails("table", props: { outer_padding: "sm", size: "sm" }) do %>
1
+ <%= pb_rails("table") do %>
2
2
  <thead>
3
3
  <tr>
4
4
  <th>Column 1</th>
5
5
  <th>Column 2</th>
6
6
  <th>Column 3</th>
7
7
  <th>Column 4</th>
8
- <th></th>
8
+ <th>Column 5</th>
9
9
  </tr>
10
10
  </thead>
11
11
  <tbody>
@@ -14,21 +14,21 @@
14
14
  <td>Value 2</td>
15
15
  <td>Value 3</td>
16
16
  <td>Value 4</td>
17
- <td align="right"><%= pb_rails("button", props: { text: "Action", variant: "secondary" }) %></td>
17
+ <td>Value 5</td>
18
18
  </tr>
19
- <tr>
19
+ <tr align="center">
20
20
  <td>Value 1</td>
21
21
  <td>Value 2</td>
22
22
  <td>Value 3</td>
23
23
  <td>Value 4</td>
24
- <td align="right"><%= pb_rails("button", props: { text: "Action", variant: "secondary" }) %></td>
24
+ <td>Value 5</td>
25
25
  </tr>
26
- <tr>
26
+ <tr align="right">
27
27
  <td>Value 1</td>
28
28
  <td>Value 2</td>
29
29
  <td>Value 3</td>
30
30
  <td>Value 4</td>
31
- <td align="right"><%= pb_rails("button", props: { text: "Action", variant: "secondary" }) %></td>
31
+ <td>Value 5</td>
32
32
  </tr>
33
33
  </tbody>
34
34
  <% end %>