playbook_ui 15.6.0.pre.alpha.play266913088 → 15.6.0.pre.rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/Components/RegularTableView.tsx +2 -3
  3. data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +0 -4
  4. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +0 -95
  5. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_control_rails.html.erb +5 -11
  6. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_control_rails.md +1 -7
  7. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.html.erb +163 -1
  8. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.jsx +190 -0
  9. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +1 -4
  10. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +1 -3
  11. data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +2 -2
  12. data/app/pb_kits/playbook/pb_advanced_table/table_header.rb +0 -57
  13. data/app/pb_kits/playbook/pb_background/_background.tsx +6 -6
  14. data/app/pb_kits/playbook/pb_background/background.test.js +1 -5
  15. data/app/pb_kits/playbook/pb_background/docs/_background_light.html.erb +1 -1
  16. data/app/pb_kits/playbook/pb_background/docs/_background_light.jsx +1 -0
  17. data/app/pb_kits/playbook/pb_background/docs/example.yml +2 -2
  18. data/app/pb_kits/playbook/pb_card/docs/_card_header.md +1 -1
  19. data/app/pb_kits/playbook/pb_card/docs/_card_highlight.md +1 -1
  20. data/app/pb_kits/playbook/pb_collapsible/__snapshots__/collapsible.test.js.snap +2 -2
  21. data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleIcon.tsx +8 -10
  22. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_icons.jsx +1 -0
  23. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_state.jsx +3 -0
  24. data/app/pb_kits/playbook/pb_contact/_contact.tsx +24 -51
  25. data/app/pb_kits/playbook/pb_contact/contact.html.erb +19 -53
  26. data/app/pb_kits/playbook/pb_contact/contact.rb +1 -11
  27. data/app/pb_kits/playbook/pb_contact/contact.test.js +0 -76
  28. data/app/pb_kits/playbook/pb_contact/docs/example.yml +0 -2
  29. data/app/pb_kits/playbook/pb_contact/docs/index.js +0 -1
  30. data/app/pb_kits/playbook/pb_date_picker/date_picker.test.js +0 -24
  31. data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +7 -197
  32. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern_rails.html.erb +14 -23
  33. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern_rails.md +1 -1
  34. data/app/pb_kits/playbook/pb_dialog/_dialog.tsx +1 -2
  35. data/app/pb_kits/playbook/pb_dialog/dialog.html.erb +1 -1
  36. data/app/pb_kits/playbook/pb_dialog/dialog.rb +0 -1
  37. data/app/pb_kits/playbook/pb_dialog/dialog.test.jsx +0 -14
  38. data/app/pb_kits/playbook/pb_dialog/dialog_header.html.erb +4 -5
  39. data/app/pb_kits/playbook/pb_dialog/dialog_header.rb +0 -2
  40. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_compound_components.html.erb +0 -31
  41. data/app/pb_kits/playbook/pb_dialog/docs/example.yml +0 -4
  42. data/app/pb_kits/playbook/pb_dialog/docs/index.js +1 -3
  43. data/app/pb_kits/playbook/pb_distribution_bar/docs/_distribution_bar_custom_colors.md +1 -1
  44. data/app/pb_kits/playbook/pb_draggable/context/index.tsx +7 -458
  45. data/app/pb_kits/playbook/pb_draggable/context/types.ts +3 -8
  46. data/app/pb_kits/playbook/pb_draggable/docs/example.yml +2 -3
  47. data/app/pb_kits/playbook/pb_draggable/docs/index.js +1 -2
  48. data/app/pb_kits/playbook/pb_draggable/draggable.test.jsx +1 -77
  49. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default_rails.html.erb +5 -7
  50. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display_rails.html.erb +1 -3
  51. data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +0 -5
  52. data/app/pb_kits/playbook/pb_dropdown/dropdown.html.erb +0 -4
  53. data/app/pb_kits/playbook/pb_dropdown/dropdown.rb +5 -39
  54. data/app/pb_kits/playbook/pb_dropdown/index.js +3 -171
  55. data/app/pb_kits/playbook/pb_file_upload/_file_upload.scss +4 -4
  56. data/app/pb_kits/playbook/pb_filter/Filter/FilterBackground.tsx +3 -3
  57. data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.tsx +22 -34
  58. data/app/pb_kits/playbook/pb_home_address_street/city_emphasis.html.erb +12 -16
  59. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_default.html.erb +1 -1
  60. data/app/pb_kits/playbook/pb_home_address_street/none_emphasis.html.erb +12 -16
  61. data/app/pb_kits/playbook/pb_home_address_street/street_emphasis.html.erb +12 -16
  62. data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.scss +0 -10
  63. data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.tsx +15 -66
  64. data/app/pb_kits/playbook/pb_multiple_users/docs/example.yml +0 -1
  65. data/app/pb_kits/playbook/pb_multiple_users/docs/index.js +0 -1
  66. data/app/pb_kits/playbook/pb_multiple_users/multiple_users.test.js +0 -25
  67. data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +10 -44
  68. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_validation.html.erb +4 -34
  69. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_validation.jsx +7 -16
  70. data/app/pb_kits/playbook/pb_radio/docs/_radio_error.md +1 -1
  71. data/app/pb_kits/playbook/pb_select/_select.tsx +3 -8
  72. data/app/pb_kits/playbook/pb_select/docs/_select_error.md +1 -1
  73. data/app/pb_kits/playbook/pb_select/docs/example.yml +0 -2
  74. data/app/pb_kits/playbook/pb_select/docs/index.js +0 -1
  75. data/app/pb_kits/playbook/pb_select/select.html.erb +2 -2
  76. data/app/pb_kits/playbook/pb_select/select.rb +1 -3
  77. data/app/pb_kits/playbook/pb_select/select.test.js +0 -23
  78. data/app/pb_kits/playbook/pb_table/_table.tsx +33 -187
  79. data/app/pb_kits/playbook/pb_table/docs/example.yml +0 -4
  80. data/app/pb_kits/playbook/pb_table/docs/index.js +0 -2
  81. data/app/pb_kits/playbook/pb_table/table.html.erb +12 -68
  82. data/app/pb_kits/playbook/pb_table/table.rb +3 -22
  83. data/app/pb_kits/playbook/pb_table/table.test.js +0 -143
  84. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_error.md +1 -1
  85. data/app/pb_kits/playbook/pb_textarea/docs/_textarea_error.md +1 -1
  86. data/app/pb_kits/playbook/pb_timeline/_item.tsx +0 -3
  87. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_date.md +1 -1
  88. data/app/pb_kits/playbook/pb_timeline/docs/example.yml +0 -2
  89. data/app/pb_kits/playbook/pb_timeline/docs/index.js +0 -1
  90. data/app/pb_kits/playbook/pb_timeline/item.html.erb +1 -1
  91. data/app/pb_kits/playbook/pb_timeline/item.rb +0 -2
  92. data/app/pb_kits/playbook/pb_timeline/label.html.erb +1 -2
  93. data/app/pb_kits/playbook/pb_timeline/label.rb +0 -2
  94. data/app/pb_kits/playbook/pb_timeline/subcomponents/Label.tsx +0 -3
  95. data/app/pb_kits/playbook/pb_timeline/timeline.test.js +0 -51
  96. data/app/pb_kits/playbook/pb_typeahead/_typeahead.test.jsx +0 -15
  97. data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +0 -3
  98. data/app/pb_kits/playbook/pb_typeahead/components/ClearIndicator.tsx +2 -13
  99. data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.tsx +1 -6
  100. data/app/pb_kits/playbook/pb_typeahead/components/ValueContainer.tsx +7 -34
  101. data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +0 -2
  102. data/app/pb_kits/playbook/pb_typeahead/docs/index.js +1 -2
  103. data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +1 -6
  104. data/app/pb_kits/playbook/tokens/_colors.scss +1 -2
  105. data/dist/chunks/_typeahead-kRdz5zPn.js +6 -0
  106. data/dist/chunks/lib-CgpqUb6l.js +29 -0
  107. data/dist/chunks/vendor.js +3 -3
  108. data/dist/menu.yml +1 -1
  109. data/dist/playbook-rails-react-bindings.js +1 -1
  110. data/dist/playbook-rails.js +1 -1
  111. data/dist/playbook.css +1 -1
  112. data/lib/playbook/forms/builder/collection_select_field.rb +1 -9
  113. data/lib/playbook/forms/builder/select_field.rb +1 -9
  114. data/lib/playbook/forms/builder/time_zone_select_field.rb +1 -9
  115. data/lib/playbook/pb_kit_helper.rb +0 -35
  116. data/lib/playbook/version.rb +2 -2
  117. metadata +4 -54
  118. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_colors_rails.html.erb +0 -43
  119. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_colors_rails.md +0 -1
  120. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background.jsx +0 -54
  121. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background.md +0 -9
  122. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background_multi.jsx +0 -80
  123. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background_multi.md +0 -3
  124. data/app/pb_kits/playbook/pb_background/docs/_background_light.md +0 -1
  125. data/app/pb_kits/playbook/pb_contact/docs/_contact_unstyled.html.erb +0 -33
  126. data/app/pb_kits/playbook/pb_contact/docs/_contact_unstyled.jsx +0 -46
  127. data/app/pb_kits/playbook/pb_contact/docs/_contact_unstyled_rails.md +0 -2
  128. data/app/pb_kits/playbook/pb_contact/docs/_contact_unstyled_react.md +0 -2
  129. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_closeable.html.erb +0 -24
  130. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_closeable.jsx +0 -60
  131. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_closeable.md +0 -3
  132. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_overflow_visible.html.erb +0 -71
  133. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_overflow_visible.jsx +0 -57
  134. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_overflow_visible_rails.md +0 -1
  135. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_overflow_visible_react.md +0 -1
  136. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_dropzone.jsx +0 -180
  137. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_dropzone.md +0 -22
  138. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_default_dates.html.erb +0 -19
  139. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_rails.html.erb +0 -12
  140. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_rails.md +0 -26
  141. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_range_end_rails.html.erb +0 -19
  142. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_range_end_rails.md +0 -1
  143. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_with_date_pickers_default_rails.html.erb +0 -30
  144. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_with_date_pickers_default_rails.md +0 -3
  145. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_with_date_pickers_rails.html.erb +0 -29
  146. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_with_date_pickers_rails.md +0 -13
  147. data/app/pb_kits/playbook/pb_dropdown/quickpick_helper.rb +0 -75
  148. data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_with_tooltip.jsx +0 -42
  149. data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_with_tooltip.md +0 -1
  150. data/app/pb_kits/playbook/pb_select/docs/_select_input_options.html.erb +0 -16
  151. data/app/pb_kits/playbook/pb_select/docs/_select_input_options.jsx +0 -30
  152. data/app/pb_kits/playbook/pb_select/docs/_select_input_options.md +0 -1
  153. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant.jsx +0 -134
  154. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant.md +0 -34
  155. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_rails.html.erb +0 -101
  156. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_rails.md +0 -33
  157. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_with_pagination.jsx +0 -180
  158. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_with_pagination.md +0 -3
  159. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_with_pagination_rails.html.erb +0 -122
  160. data/app/pb_kits/playbook/pb_table/docs/_table_with_filter_variant_with_pagination_rails.md +0 -3
  161. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_show_current_year.html.erb +0 -60
  162. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_show_current_year.jsx +0 -118
  163. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_show_current_year.md +0 -1
  164. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_input_display.html.erb +0 -30
  165. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_input_display.jsx +0 -37
  166. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_input_display.md +0 -3
  167. data/app/pb_kits/playbook/utilities/deprecated.ts +0 -73
  168. data/dist/chunks/_typeahead-CbjBmIDu.js +0 -6
  169. data/dist/chunks/lib-DxDBrGZX.js +0 -29
@@ -10,11 +10,6 @@ import {
10
10
  TableCell,
11
11
  } from "./subcomponents";
12
12
  import { addDataTitle } from './utilities/addDataTitle'
13
- import Card from '../pb_card/_card'
14
- import Flex from '../pb_flex/_flex'
15
- import Title from '../pb_title/_title'
16
- import SectionSeparator from '../pb_section_separator/_section_separator'
17
- import Filter from '../pb_filter/_filter'
18
13
 
19
14
  type TableProps = {
20
15
  aria?: { [key: string]: string },
@@ -26,13 +21,10 @@ type TableProps = {
26
21
  data?: { [key: string]: string },
27
22
  dataTable: boolean,
28
23
  disableHover?: boolean,
29
- filterProps?: { [key: string]: any },
30
- filterContent?: any,
31
24
  headerStyle?: "default" | "borderless" | "floating"
32
25
  htmlOptions?: { [key: string]: string | number | boolean | (() => void) },
33
26
  id?: string,
34
27
  outerPadding?: "none" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl",
35
- pagination?: React.ReactElement,
36
28
  responsive?: "collapse" | "scroll" | "none",
37
29
  singleLine?: boolean,
38
30
  size?: "sm" | "md" | "lg",
@@ -41,32 +33,24 @@ type TableProps = {
41
33
  stickyRightColumn?: string[],
42
34
  striped?: boolean,
43
35
  tag?: "table" | "div",
44
- title?: string,
45
- variant?: "default" | "withFilter",
46
36
  verticalBorder?: boolean,
47
37
  } & GlobalProps
48
38
 
49
- type AllSizes = "none" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "auto" | "initial" | "inherit"
50
-
51
39
  const Table = (props: TableProps): React.ReactElement => {
52
40
  const {
53
41
  aria = {},
54
- variant = 'default',
55
42
  children,
56
43
  className,
57
- collapse = variant === 'withFilter' ? 'md' : 'sm',
44
+ collapse = 'sm',
58
45
  container = true,
59
46
  dark,
60
47
  data = {},
61
48
  dataTable = false,
62
49
  disableHover = false,
63
- filterProps = {},
64
- filterContent,
65
50
  headerStyle = "default",
66
51
  htmlOptions = {},
67
52
  id,
68
53
  outerPadding = '',
69
- pagination,
70
54
  responsive = 'collapse',
71
55
  singleLine = false,
72
56
  size = 'sm',
@@ -75,7 +59,6 @@ const Table = (props: TableProps): React.ReactElement => {
75
59
  stickyRightColumn= [],
76
60
  striped = false,
77
61
  tag = 'table',
78
- title,
79
62
  verticalBorder = false,
80
63
  } = props
81
64
 
@@ -90,15 +73,12 @@ const Table = (props: TableProps): React.ReactElement => {
90
73
  const dynamicInlineProps = globalInlineProps(props)
91
74
  const stickyRightColumnReversed = stickyRightColumn.reverse()
92
75
 
93
- const isFilterVariant = variant === 'withFilter'
94
- const effectiveContainer = isFilterVariant ? false : container
95
-
96
76
  const classNames = classnames(
97
77
  'pb_table',
98
78
  `table-${size}`,
99
79
  `table-responsive-${responsive}`,
100
80
  {
101
- 'table-card': effectiveContainer,
81
+ 'table-card': container,
102
82
  'table-dark': dark,
103
83
  'data_table': dataTable,
104
84
  'single-line': singleLine,
@@ -225,70 +205,36 @@ const Table = (props: TableProps): React.ReactElement => {
225
205
  addDataTitle()
226
206
  }, [])
227
207
 
228
- // ------------ Default Table (non-filter variant rendering) ------------
229
- const renderTable = () => {
230
- const tableElement = responsive === 'scroll' ? (
231
- <div className='table-responsive-scroll'>
232
- {isTableTag ? (
233
- <table
234
- {...ariaProps}
235
- {...dataProps}
236
- {...htmlProps}
237
- className={classNames}
238
- id={id}
239
- style={dynamicInlineProps}
240
- >
241
- {children}
242
- </table>
243
- ) : (
244
- <div
245
- {...ariaProps}
246
- {...dataProps}
247
- {...htmlProps}
248
- className={classNames}
249
- id={id}
250
- style={dynamicInlineProps}
251
- >
252
- {children}
253
- </div>
254
- )}
255
- </div>
256
- ) : (
257
- isTableTag ? (
258
- <table
259
- {...ariaProps}
260
- {...dataProps}
261
- {...htmlProps}
262
- className={classNames}
263
- id={id}
264
- style={dynamicInlineProps}
265
- >
266
- {children}
267
- </table>
268
- ) : (
269
- <div
270
- {...ariaProps}
271
- {...dataProps}
272
- {...htmlProps}
273
- className={classNames}
274
- id={id}
275
- style={dynamicInlineProps}
276
- >
277
- {children}
208
+ return (
209
+ <>
210
+ {responsive === 'scroll' ? (
211
+ <div className='table-responsive-scroll'>
212
+ {isTableTag ? (
213
+ <table
214
+ {...ariaProps}
215
+ {...dataProps}
216
+ {...htmlProps}
217
+ className={classNames}
218
+ id={id}
219
+ style={dynamicInlineProps}
220
+ >
221
+ {children}
222
+ </table>
223
+ ) : (
224
+ <div
225
+ {...ariaProps}
226
+ {...dataProps}
227
+ {...htmlProps}
228
+ className={classNames}
229
+ id={id}
230
+ style={dynamicInlineProps}
231
+ >
232
+ {children}
233
+ </div>
234
+ )}
278
235
  </div>
279
- )
280
- )
281
-
282
- return tableElement
283
- }
284
- // ------------ End Default Table (non-filter variant rendering) ------------
285
-
286
- // ------------ variant = 'withFilter' rendering ------------
287
- const renderCardVariant = () => {
288
- // Render table element
289
- const tableElement = responsive === 'scroll' ? (
290
- <div className='table-responsive-scroll'>
291
- {isTableTag ? (
236
+ ) : (
237
+ isTableTag ? (
292
238
  <table
293
239
  {...ariaProps}
294
240
  {...dataProps}
@@ -310,108 +256,8 @@ const Table = (props: TableProps): React.ReactElement => {
310
256
  >
311
257
  {children}
312
258
  </div>
313
- )}
314
- </div>
315
- ) : (
316
- isTableTag ? (
317
- <table
318
- {...ariaProps}
319
- {...dataProps}
320
- {...htmlProps}
321
- className={classNames}
322
- id={id}
323
- style={dynamicInlineProps}
324
- >
325
- {children}
326
- </table>
327
- ) : (
328
- <div
329
- {...ariaProps}
330
- {...dataProps}
331
- {...htmlProps}
332
- className={classNames}
333
- id={id}
334
- style={dynamicInlineProps}
335
- >
336
- {children}
337
- </div>
338
- )
339
- )
340
-
341
- // Default filter props that CAN be overridden (All props from Filter kit CAN be used, but these are the ones we set as defaults)
342
- const defaultFilterProps = {
343
- background: false,
344
- maxHeight: "50vh",
345
- minWidth: "xs",
346
- popoverProps: { width: "350px" },
347
- }
348
-
349
- // Merge default props with user-provided props (user props override defaults)
350
- const mergedFilterProps = { ...defaultFilterProps, ...filterProps }
351
-
352
- return (
353
- <>
354
- {title && (
355
- <Title
356
- paddingLeft={{
357
- xs: "sm",
358
- sm: "sm",
359
- md: "xl",
360
- lg: "xl",
361
- xl: "xl",
362
- default: "xl",
363
- } as any}
364
- paddingY="md"
365
- size={3}
366
- text={title}
367
- />
368
- )}
369
- <Card
370
- marginX={{
371
- xs: "sm",
372
- sm: "sm",
373
- md: "xl",
374
- lg: "xl",
375
- xl: "xl",
376
- default: "xl",
377
- } as any}
378
- padding="none"
379
- >
380
- <Flex
381
- align="stretch"
382
- flexDirection="column"
383
- gap="none"
384
- >
385
- {filterContent && (
386
- <Filter {...mergedFilterProps}>
387
- {filterContent}
388
- </Filter>
389
- )}
390
- {filterContent && <SectionSeparator />}
391
- {pagination && (
392
- <>
393
- {pagination}
394
- <SectionSeparator />
395
- </>
396
- )}
397
- {tableElement}
398
- {pagination && (
399
- <>
400
- {pagination}
401
- </>
402
- )}
403
- </Flex>
404
- </Card>
405
- </>
406
- )
407
- }
408
- // ------------ End variant = 'withFilter' rendering ------------
409
-
410
-
411
-
412
- return (
413
- <>
414
- {isFilterVariant ? renderCardVariant() : renderTable()}
259
+ )
260
+ )}
415
261
  </>
416
262
  )
417
263
  }
@@ -40,8 +40,6 @@ examples:
40
40
  - table_with_selectable_rows: Table with Selectable Rows
41
41
  - table_with_header_style_borderless: Header Style Borderless
42
42
  - table_with_header_style_floating: Header Style Floating
43
- - table_with_filter_variant_rails: Variant with Filter
44
- - table_with_filter_variant_with_pagination_rails: Variant with Filter and Pagination
45
43
 
46
44
  react:
47
45
  - table_sm: Small
@@ -83,5 +81,3 @@ examples:
83
81
  - table_with_selectable_rows: Table with Selectable Rows
84
82
  - table_with_header_style_borderless: Header Style Borderless
85
83
  - table_with_header_style_floating: Header Style Floating
86
- - table_with_filter_variant: Variant with Filter
87
- - table_with_filter_variant_with_pagination: Variant with Filter and Pagination
@@ -38,5 +38,3 @@ export { default as TableWithSelectableRows } from './_table_with_selectable_row
38
38
  export { default as TableWithClickableRows } from './_table_with_clickable_rows.jsx'
39
39
  export { default as TableWithHeaderStyleBorderless } from './_table_with_header_style_borderless.jsx'
40
40
  export { default as TableWithHeaderStyleFloating } from './_table_with_header_style_floating.jsx'
41
- export { default as TableWithFilterVariant } from './_table_with_filter_variant.jsx'
42
- export { default as TableWithFilterVariantWithPagination } from './_table_with_filter_variant_with_pagination.jsx'
@@ -1,73 +1,17 @@
1
- <%# ------------ variant = 'withFilter' rendering ------------ %>
2
- <% if object.with_filter_variant? %>
3
- <%= pb_rails("title", props: {
4
- padding_left: { xs: "sm", sm: "sm", md: "xl", lg: "xl", xl: "xl", default: "xl" },
5
- padding_y: "md",
6
- size: 3,
7
- text: object.title
8
- }) if object.title.present? %>
9
- <%= pb_rails("card", props: {
10
- margin_x: { xs: "sm", sm: "sm", md: "xl", lg: "xl", xl: "xl", default: "xl" },
11
- padding: "none"
12
- }) do %>
13
- <%= pb_rails("flex", props: {
14
- align: "stretch",
15
- flex_direction: "column",
16
- gap: "none"
17
- }) do %>
18
- <% if object.filter_content.present? %>
19
- <%
20
- default_filter_props = {
21
- background: false,
22
- max_height: "50vh",
23
- min_width: "xs",
24
- popover_props: { width: "350px" },
25
- template: 'single'
26
- }
27
- merged_filter_props = default_filter_props.merge(object.filter_props)
28
- %>
29
- <%= pb_rails("filter", props: merged_filter_props) do %>
30
- <%= object.filter_content %>
31
- <% end %>
32
- <% end %>
33
- <%= pb_rails("section_separator") if object.filter_content.present? %>
34
- <% if object.pagination.present? %>
35
- <%= object.pagination %>
36
- <%= pb_rails("section_separator") %>
37
- <% end %>
38
- <% if object.tag == "table" %>
39
- <%= pb_content_tag(:table) do %>
40
- <%= content.presence %>
41
- <% end %>
42
- <% else %>
43
- <%= pb_content_tag do %>
44
- <%= content.presence %>
45
- <% end %>
46
- <% end %>
47
- <% if object.pagination.present? %>
48
- <%= object.pagination %>
49
- <% end %>
50
- <% end %>
51
- <% end %>
52
- <%# ------------ End variant = 'withFilter' rendering ------------ %>
1
+ <% if object.responsive_classname %>
2
+ <% responsive_class = object.responsive_classname %>
53
3
  <% else %>
54
- <%# ------------ Default Table (non-filter variant rendering) ------------ %>
55
- <% if object.responsive_classname %>
56
- <% responsive_class = object.responsive_classname %>
57
- <% else %>
58
- <% responsive_class = nil %>
59
- <% end %>
4
+ <% responsive_class = nil %>
5
+ <% end %>
60
6
 
61
- <%= content_tag(:div, class: responsive_class, 'data-pb-table-wrapper' => true) do %>
62
- <% if object.tag == "table" %>
63
- <%= pb_content_tag(:table) do %>
64
- <%= content.presence %>
65
- <% end %>
66
- <% else %>
67
- <%= pb_content_tag do %>
68
- <%= content.presence %>
69
- <% end %>
7
+ <%= content_tag(:div, class: responsive_class, 'data-pb-table-wrapper' => true) do %>
8
+ <% if object.tag == "table" %>
9
+ <%= pb_content_tag(:table) do %>
10
+ <%= content.presence %>
11
+ <% end %>
12
+ <% else %>
13
+ <%= pb_content_tag do %>
14
+ <%= content.presence %>
70
15
  <% end %>
71
16
  <% end %>
72
- <%# ------------ End Default Table (non-filter variant rendering) ------------ %>
73
17
  <% end %>
@@ -40,23 +40,10 @@ module Playbook
40
40
  prop :header_style, type: Playbook::Props::Enum,
41
41
  values: %w[default borderless floating],
42
42
  default: "default"
43
- prop :variant, type: Playbook::Props::Enum,
44
- values: %w[default with_filter],
45
- default: "default"
46
- prop :filter_props, type: Playbook::Props::HashProp,
47
- default: {}
48
- prop :filter_content
49
- prop :pagination
50
- prop :title, type: Playbook::Props::String,
51
- default: nil
52
-
53
- def size_class
54
- variant === "with_filter" && size == "md" ? "sm" : size
55
- end
56
43
 
57
44
  def classname
58
45
  generate_classname(
59
- "pb_table", "table-#{size_class}", single_line_class, dark_class,
46
+ "pb_table", "table-#{size}", single_line_class, dark_class,
60
47
  disable_hover_class, container_class, data_table_class, sticky_class, sticky_left_column_class,
61
48
  sticky_right_column_class, collapse_class, vertical_border_class, striped_class, outer_padding_class,
62
49
  "table-responsive-#{responsive}", header_style_class, separator: " "
@@ -67,10 +54,6 @@ module Playbook
67
54
  responsive ? "table-responsive-#{responsive}" : nil
68
55
  end
69
56
 
70
- def with_filter_variant?
71
- variant == "with_filter"
72
- end
73
-
74
57
  private
75
58
 
76
59
  def dark_class
@@ -90,13 +73,11 @@ module Playbook
90
73
  end
91
74
 
92
75
  def container_class
93
- effective_container = variant == "with_filter" ? false : container
94
- effective_container ? "table-card" : nil
76
+ container ? "table-card" : nil
95
77
  end
96
78
 
97
79
  def collapse_class
98
- effective_collapse = variant == "with_filter" && collapse == "sm" ? "md" : collapse
99
- responsive != "none" ? "table-collapse-#{effective_collapse}" : ""
80
+ responsive != "none" ? "table-collapse-#{collapse}" : ""
100
81
  end
101
82
 
102
83
  def sticky_class
@@ -184,146 +184,3 @@ test("when headerStyle is floating", () => {
184
184
  const kit = renderKit(Table, props, { headerStyle: "floating" })
185
185
  expect(kit).toHaveClass("pb_table table-sm table-responsive-collapse table-card header-floating table-collapse-sm")
186
186
  })
187
-
188
- test("renders withFilter variant with Card wrapper", () => {
189
- const { container } = render(
190
- <Table
191
- data={{testid: "table-with-filter"}}
192
- filterContent={<div>{"Mock Filter"}</div>}
193
- title="Test Table"
194
- variant="withFilter"
195
- >
196
- <Table.Head>
197
- <Table.Row>
198
- <Table.Header>{"Column 1"}</Table.Header>
199
- </Table.Row>
200
- </Table.Head>
201
- <Table.Body>
202
- <Table.Row>
203
- <Table.Cell>{"Value 1"}</Table.Cell>
204
- </Table.Row>
205
- </Table.Body>
206
- </Table>
207
- )
208
-
209
- const card = container.querySelector('.pb_card_kit')
210
- expect(card).toBeInTheDocument()
211
- const filter = container.querySelector('.pb_filter_kit')
212
- expect(filter).toBeInTheDocument()
213
- })
214
-
215
- test("renders title when provided with withFilter variant", () => {
216
- render(
217
- <Table
218
- filterContent={<div>{"Mock Filter"}</div>}
219
- title="Test Title"
220
- variant="withFilter"
221
- >
222
- <Table.Head>
223
- <Table.Row>
224
- <Table.Header>{"Column 1"}</Table.Header>
225
- </Table.Row>
226
- </Table.Head>
227
- <Table.Body>
228
- <Table.Row>
229
- <Table.Cell>{"Value 1"}</Table.Cell>
230
- </Table.Row>
231
- </Table.Body>
232
- </Table>
233
- )
234
-
235
- expect(screen.getByText("Test Title")).toBeInTheDocument()
236
- })
237
-
238
- test("renders filter component in withFilter variant", () => {
239
- const { container } = render(
240
- <Table
241
- filterContent={<div data-testid="test-filter">{"Filter inputs"}</div>}
242
- variant="withFilter"
243
- >
244
- <Table.Head>
245
- <Table.Row>
246
- <Table.Header>{"Column 1"}</Table.Header>
247
- </Table.Row>
248
- </Table.Head>
249
- <Table.Body>
250
- <Table.Row>
251
- <Table.Cell>{"Value 1"}</Table.Cell>
252
- </Table.Row>
253
- </Table.Body>
254
- </Table>
255
- )
256
-
257
- const filter = container.querySelector('.pb_filter_kit')
258
- expect(filter).toBeInTheDocument()
259
- })
260
-
261
- test("renders SectionSeparator between filter and table in withFilter variant", () => {
262
- const { container } = render(
263
- <Table
264
- filterContent={<div>{"Filter content"}</div>}
265
- variant="withFilter"
266
- >
267
- <Table.Head>
268
- <Table.Row>
269
- <Table.Header>{"Column 1"}</Table.Header>
270
- </Table.Row>
271
- </Table.Head>
272
- <Table.Body>
273
- <Table.Row>
274
- <Table.Cell>{"Value 1"}</Table.Cell>
275
- </Table.Row>
276
- </Table.Body>
277
- </Table>
278
- )
279
-
280
- const separator = container.querySelector('.pb_section_separator_kit')
281
- expect(separator).toBeInTheDocument()
282
- })
283
-
284
- test("does not render title when not provided with withFilter variant", () => {
285
- const { container } = render(
286
- <Table
287
- filterContent={<div>{"Filter content"}</div>}
288
- variant="withFilter"
289
- >
290
- <Table.Head>
291
- <Table.Row>
292
- <Table.Header>{"Column 1"}</Table.Header>
293
- </Table.Row>
294
- </Table.Head>
295
- <Table.Body>
296
- <Table.Row>
297
- <Table.Cell>{"Value 1"}</Table.Cell>
298
- </Table.Row>
299
- </Table.Body>
300
- </Table>
301
- )
302
-
303
- const title = container.querySelector('.pb_title_kit')
304
- expect(title).not.toBeInTheDocument()
305
- })
306
-
307
- test("renders default variant without Card wrapper", () => {
308
- render(
309
- <Table
310
- data={{testid: "default-table"}}
311
- variant="default"
312
- >
313
- <Table.Head>
314
- <Table.Row>
315
- <Table.Header>{"Column 1"}</Table.Header>
316
- </Table.Row>
317
- </Table.Head>
318
- <Table.Body>
319
- <Table.Row>
320
- <Table.Cell>{"Value 1"}</Table.Cell>
321
- </Table.Row>
322
- </Table.Body>
323
- </Table>
324
- )
325
-
326
- const table = screen.getByTestId("default-table")
327
- expect(table).toBeInTheDocument()
328
- expect(table.closest('.pb_card_kit')).not.toBeInTheDocument()
329
- })
@@ -1 +1 @@
1
- Text Input w/ Error shows that the input must be filled out (i.e. when used in a form it signals a user to fix an error).
1
+ Text Input w/ Error shows that the radio option must be selected or is invalid (ie when used in a form it signals a user to fix an error).
@@ -1 +1 @@
1
- Textarea w/ Error shows that the input must be filled out (i.e. when used in a form it signals a user to fix an error).
1
+ Textarea w/ Error shows that the radio option must be selected or is invalid (ie when used in a form it signals a user to fix an error).
@@ -18,7 +18,6 @@ type ItemProps = {
18
18
  icon?: string,
19
19
  iconColor?: 'default' | 'royal' | 'blue' | 'purple' | 'teal' | 'red' | 'yellow' | 'green',
20
20
  lineStyle?: 'solid' | 'dotted',
21
- showCurrentYear?: boolean,
22
21
  } & GlobalProps
23
22
 
24
23
  function isElementOfType<P>(
@@ -36,7 +35,6 @@ const TimelineItem = ({
36
35
  icon = 'user',
37
36
  iconColor = 'default',
38
37
  lineStyle = 'solid',
39
- showCurrentYear = false,
40
38
  ...props
41
39
  }: ItemProps): React.ReactElement => {
42
40
  const timelineItemCss = buildCss('pb_timeline_item_kit', lineStyle)
@@ -75,7 +73,6 @@ const TimelineItem = ({
75
73
  <DateStacked
76
74
  align="center"
77
75
  date={date}
78
- showCurrentYear={showCurrentYear}
79
76
  size="sm"
80
77
  />
81
78
  )}
@@ -1 +1 @@
1
- Use the optional `showDate` prop to render the timeline kit with a visible date. By default, if the date is from the current year, the year will not be displayed; however, if the date is NOT from the current year, the kit will display the year as well.
1
+ Use the optional `showDate` prop to render the timeline kit with a visible date. If the date is from the current year, the year will not be displayed, however if date is NOT from the current year, the kit will display the year as well.
@@ -5,7 +5,6 @@ examples:
5
5
  - timeline_vertical: Vertical
6
6
  - timeline_with_date: With Date
7
7
  - timeline_with_children: With Children
8
- - timeline_show_current_year: Show Current Year
9
8
  - timeline_with_gap: With Gap
10
9
 
11
10
 
@@ -14,5 +13,4 @@ examples:
14
13
  - timeline_vertical: Vertical
15
14
  - timeline_with_date: With Date
16
15
  - timeline_with_children: With Children
17
- - timeline_show_current_year: Show Current Year
18
16
  - timeline_with_gap: With Gap
@@ -3,5 +3,4 @@ export { default as TimelineVertical } from './_timeline_vertical.jsx'
3
3
  export { default as TimelineWithDate } from './_timeline_with_date.jsx'
4
4
  export { default as TimelineWithChildren } from './_timeline_with_children.jsx'
5
5
  export { default as TimelineWithGap } from './_timeline_with_gap.jsx'
6
- export { default as TimelineShowCurrentYear } from './_timeline_show_current_year.jsx'
7
6
 
@@ -2,7 +2,7 @@
2
2
  <% if label %>
3
3
  <%= label %>
4
4
  <% else %>
5
- <%= pb_rails("timeline/label", props: { date: date, show_current_year: show_current_year }) %>
5
+ <%= pb_rails("timeline/label", props: { date: date }) %>
6
6
  <% end %>
7
7
 
8
8
  <% if step %>
@@ -12,8 +12,6 @@ module Playbook
12
12
  prop :line_style, type: Playbook::Props::Enum,
13
13
  values: %w[solid dotted],
14
14
  default: "solid"
15
- prop :show_current_year, type: Playbook::Props::Boolean,
16
- default: false
17
15
 
18
16
  renders_one :label
19
17
  renders_one :step