playbook_ui 14.24.0.pre.rc.6 → 14.25.0.pre.alpha.testingcss9700

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 (67) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/Components/RegularTableView.tsx +8 -2
  3. data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +1 -2
  4. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +34 -0
  5. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +56 -0
  6. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_vertical_border.html.erb +43 -0
  7. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_vertical_border.jsx +64 -0
  8. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control.jsx +60 -0
  9. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control.md +3 -0
  10. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control_per_row.jsx +57 -0
  11. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control_per_row.md +1 -0
  12. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +4 -0
  13. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +4 -1
  14. data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +1 -1
  15. data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb +1 -1
  16. data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.html.erb +10 -1
  17. data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.rb +2 -0
  18. data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_input_options.html.erb +24 -0
  19. data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_input_options.md +3 -0
  20. data/app/pb_kits/playbook/pb_circle_icon_button/docs/example.yml +1 -0
  21. data/app/pb_kits/playbook/pb_date/_date.tsx +5 -3
  22. data/app/pb_kits/playbook/pb_date/date.html.erb +6 -6
  23. data/app/pb_kits/playbook/pb_date/date.rb +2 -0
  24. data/app/pb_kits/playbook/pb_date/docs/_date_with_show_current_year.html.erb +4 -0
  25. data/app/pb_kits/playbook/pb_date/docs/_date_with_show_current_year.jsx +17 -0
  26. data/app/pb_kits/playbook/pb_date/docs/_date_with_show_current_year.md +1 -0
  27. data/app/pb_kits/playbook/pb_date/docs/example.yml +2 -0
  28. data/app/pb_kits/playbook/pb_date/docs/index.js +1 -0
  29. data/app/pb_kits/playbook/pb_dropdown/index.js +3 -0
  30. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.tsx +2 -2
  31. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_no_icon.html.erb +22 -0
  32. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_no_icon.jsx +43 -0
  33. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_no_icon.md +1 -0
  34. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/example.yml +2 -0
  35. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/index.js +1 -0
  36. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.html.erb +2 -1
  37. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb +1 -1
  38. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.test.js +6 -0
  39. data/app/pb_kits/playbook/pb_pagination/_pagination.test.jsx +212 -0
  40. data/app/pb_kits/playbook/pb_pagination/_pagination.tsx +8 -1
  41. data/app/pb_kits/playbook/pb_pagination/docs/_pagination_external_control.jsx +112 -0
  42. data/app/pb_kits/playbook/pb_pagination/docs/_pagination_external_control_react.md +3 -0
  43. data/app/pb_kits/playbook/pb_pagination/docs/example.yml +1 -0
  44. data/app/pb_kits/playbook/pb_pagination/docs/index.js +1 -0
  45. data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +11 -1
  46. data/app/pb_kits/playbook/pb_table/styles/_vertical_border.scss +49 -1
  47. data/dist/chunks/_line_graph-DPTwfQR-.js +544 -0
  48. data/dist/chunks/_typeahead-CEqlHw0H.js +30978 -0
  49. data/dist/chunks/_weekday_stacked-D3dG14OB.js +20894 -0
  50. data/dist/chunks/lazysizes-BUUj27EF.js +611 -0
  51. data/dist/chunks/lib-CIetbXpr.js +9609 -0
  52. data/dist/chunks/pb_form_validation-D_g9rOE9.js +60 -0
  53. data/dist/chunks/vendor.js +11 -1
  54. data/dist/menu.yml +2 -2
  55. data/dist/playbook-doc.js +67243 -3
  56. data/dist/playbook-rails-react-bindings.js +112 -1
  57. data/dist/playbook-rails.js +2464 -1
  58. data/dist/playbook.css +92354 -2
  59. data/dist/reset.css +89 -1
  60. data/lib/playbook/version.rb +2 -2
  61. metadata +25 -8
  62. data/dist/chunks/_line_graph-D7DgMqnT.js +0 -1
  63. data/dist/chunks/_typeahead-BzYZCpJO.js +0 -6
  64. data/dist/chunks/_weekday_stacked-CCn-qLh_.js +0 -37
  65. data/dist/chunks/lazysizes-B7xYodB-.js +0 -1
  66. data/dist/chunks/lib-CY5ZPzic.js +0 -29
  67. data/dist/chunks/pb_form_validation-D3b0JKHH.js +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b2fc8bc4c28ba98e8b419b039faa4ba89ad98109b642e173d06bca803e72309c
4
- data.tar.gz: cb961caa0145db83c0c4a7ab1362e87988f3a2dcc03a3378f621d7a1225d9d53
3
+ metadata.gz: 5a1eeaf2f62d7b4fd094d05bede8f832f9021bf561d33cd0ac02fcd03e8e700f
4
+ data.tar.gz: 251d98bd7c327124c0e179dbcfc37f10d65728418a0b6c6a5bee775cdce5b3ab
5
5
  SHA512:
6
- metadata.gz: fc3cb75f59e0c721cf4f8be86efe8032e5dfa5b7d3ac5d8a6604a14cd1caf95fd607d6c726d9c8595d5861001710bdb09e2ebb5cbbf946d545fd31d27f81846b
7
- data.tar.gz: 7608b048945f5a4fd328e986e563f9d0914a3301ff84cefcd26d5db9c52b489f1d25b583b5dfa34584d46a7438f37e350401dd5a952032c9993a24fe2455b6e7
6
+ metadata.gz: e7d20ec1e7dccd4947ed03b7f50e74809c4e8c18a30fc9fb075c4ede04c6053d86cbc7397fa443fdfb6abdfa62b8ad5a77d65a607fe8b4f9d5bb97dcde98bac3
7
+ data.tar.gz: d2ad121581858362b9250eb43eafb4d30e38b066bb46de721a6a1a6be3746279a2fb5d7f05fa2025cd764c30c938e00700841d74e602a4ea8981bee79e2df297
@@ -58,7 +58,9 @@ const TableCellRenderer = ({
58
58
  // Find the “owning” colDefinition by accessor. Needed for multi column logic
59
59
  const colDef = findColumnDefByAccessor(columnDefinitions ?? [], column.id)
60
60
  const cellAlignment = colDef?.columnStyling?.cellAlignment ?? "right"
61
-
61
+ const paddingValue = colDef?.columnStyling?.cellPadding ?? customRowStyle?.cellPadding
62
+ const paddingClass = paddingValue ? `p_${paddingValue}` : undefined
63
+
62
64
  return (
63
65
  <td
64
66
  align={cellAlignment}
@@ -68,6 +70,7 @@ const TableCellRenderer = ({
68
70
  isPinnedLeft && 'pinned-left',
69
71
  stickyLeftColumn && stickyLeftColumn.length > 0 && isPinnedLeft && 'sticky-left',
70
72
  isLastCell && 'last-cell',
73
+ paddingClass
71
74
  )}
72
75
  key={`${cell.id}-data`}
73
76
  style={{
@@ -131,13 +134,15 @@ export const RegularTableView = ({
131
134
  const columnDefinitions = table.options.meta?.columnDefinitions || [];
132
135
  // Row pinning
133
136
  function PinnedRow({ row }: { row: Row<any> }) {
137
+ const customRowStyle = rowStyling?.length > 0 && rowStyling?.find((s: GenericObject) => s?.rowId === row.id);
134
138
  return (
135
139
  <tr
136
140
  className={classnames(
137
141
  `pinned-row`,
138
142
  )}
139
143
  style={{
140
- backgroundColor: 'white',
144
+ backgroundColor: customRowStyle?.backgroundColor ? customRowStyle?.backgroundColor : 'white',
145
+ color: customRowStyle?.fontColor,
141
146
  position: 'sticky',
142
147
  top:
143
148
  row.getIsPinned() === 'top'
@@ -150,6 +155,7 @@ export const RegularTableView = ({
150
155
  collapsibleTrail={collapsibleTrail}
151
156
  columnDefinitions={columnDefinitions}
152
157
  columnPinning={columnPinning}
158
+ customRowStyle={customRowStyle}
153
159
  loading={loading}
154
160
  row={row}
155
161
  stickyLeftColumn={stickyLeftColumn}
@@ -113,7 +113,6 @@ export const TableHeaderCell = ({
113
113
  return visibleSiblings.at(-1) === header.column;
114
114
  })();
115
115
 
116
-
117
116
  const cellClassName = classnames(
118
117
  "table-header-cells",
119
118
  `${showActionsBar && isActionBarVisible && "header-cells-with-actions"}`,
@@ -122,7 +121,7 @@ const cellClassName = classnames(
122
121
  { "pinned-left": responsive === "scroll" && isPinnedLeft },
123
122
  isLastHeaderCell ? "last-header-cell" : "",
124
123
  stickyLeftColumn && stickyLeftColumn.length > 0 && isPinnedLeft ? 'sticky-left' : "",
125
-
124
+ colDef?.columnStyling?.headerPadding && `p_${colDef?.columnStyling?.headerPadding}`
126
125
  );
127
126
 
128
127
  const cellId = `${loading ?
@@ -971,6 +971,40 @@
971
971
  }
972
972
  }
973
973
  }
974
+
975
+ // Firefox-specific fix for last-header-cell and last-cell vertical borders
976
+ @-moz-document url-prefix() {
977
+ .pb_advanced_table_header {
978
+ .last-header-cell {
979
+ border-right: none !important;
980
+ box-shadow: 1px 0 0 0 $border_light !important;
981
+ }
982
+ }
983
+
984
+ .pb_advanced_table_body {
985
+ .last-cell {
986
+ border-right: none !important;
987
+ box-shadow: 1px 0 0 0 $border_light !important;
988
+ }
989
+ }
990
+
991
+ // Dark mode Firefox fixes
992
+ &.dark {
993
+ .pb_advanced_table_header {
994
+ .last-header-cell {
995
+ border-right: none !important;
996
+ box-shadow: 1px 0 0 0 $border_dark !important;
997
+ }
998
+ }
999
+
1000
+ .pb_advanced_table_body {
1001
+ .last-cell {
1002
+ border-right: none !important;
1003
+ box-shadow: 1px 0 0 0 $border_dark !important;
1004
+ }
1005
+ }
1006
+ }
1007
+ }
974
1008
  }
975
1009
 
976
1010
  // Outside of the pb_advanced_table class for popover
@@ -651,6 +651,36 @@ test("columnStyling.cellAlignment sets each <td> align attribute as expected", (
651
651
  expect(firstEnrollmentCell).toHaveAttribute("align", "left");
652
652
  });
653
653
 
654
+ test("columnStyling.cellPadding sets cell padding", () => {
655
+ const styledColumnDefs = [
656
+ {
657
+ accessor: "year",
658
+ label: "Year",
659
+ cellAccessors: ["quarter", "month", "day"],
660
+ },
661
+ {
662
+ accessor: "newEnrollments",
663
+ label: "New Enrollments",
664
+ columnStyling: { cellPadding: "none" },
665
+ },
666
+ {
667
+ accessor: "scheduledMeetings",
668
+ label: "Scheduled Meetings",
669
+ },
670
+ ];
671
+
672
+ render(
673
+ <AdvancedTable
674
+ columnDefinitions={styledColumnDefs}
675
+ data={{ testid: testId }}
676
+ tableData={MOCK_DATA}
677
+ />
678
+ );
679
+
680
+ const firstEnrollmentCell = screen.getAllByText("20")[0].closest("td");
681
+ expect(firstEnrollmentCell).toHaveClass('p_none')
682
+ });
683
+
654
684
  test("renders virtualized table rows and header", () => {
655
685
  render(
656
686
  <AdvancedTable
@@ -694,6 +724,32 @@ test("rowStyling prop works as expected", () => {
694
724
  expect(row1).toHaveStyle({backgroundColor: colors.white, color: colors.black})
695
725
  })
696
726
 
727
+ test("rowStyling prop to allow padding control", () => {
728
+ const rowStyling = [
729
+ {
730
+ rowId: "1",
731
+ cellPadding: "lg"
732
+ },
733
+ ];
734
+
735
+ render(
736
+ <AdvancedTable
737
+ columnDefinitions={columnDefinitions}
738
+ data={{ testid: testId }}
739
+ rowStyling={rowStyling}
740
+ tableData={MOCK_DATA_WITH_ID}
741
+ />
742
+ )
743
+
744
+ const kit = screen.getByTestId(testId)
745
+ const tableBody = kit.querySelector('tbody')
746
+ const row1 = tableBody.querySelector('tr:nth-child(1)')
747
+ const cells = row1.querySelectorAll("td");
748
+ cells.forEach((cell) => {
749
+ expect(cell.classList.contains("p_lg")).toBe(true);
750
+ });
751
+ })
752
+
697
753
  test("Sort icon renders with enableSort on individual columns", () => {
698
754
  render(
699
755
  <AdvancedTable
@@ -0,0 +1,43 @@
1
+ <% column_definitions = [
2
+ {
3
+ accessor: "year",
4
+ label: "Year",
5
+ cellAccessors: ["quarter", "month", "day"],
6
+ },
7
+ {
8
+ label: "Enrollment Data",
9
+ columns: [
10
+ {
11
+ accessor: "newEnrollments",
12
+ label: "New Enrollments",
13
+ },
14
+ {
15
+ accessor: "scheduledMeetings",
16
+ label: "Scheduled Meetings",
17
+ },
18
+ ],
19
+ },
20
+ {
21
+ label: "Performance Data",
22
+ columns: [
23
+ {
24
+ accessor: "attendanceRate",
25
+ label: "Attendance Rate",
26
+ },
27
+ {
28
+ accessor: "completedClasses",
29
+ label: "Completed Classes",
30
+ },
31
+ {
32
+ accessor: "classCompletionRate",
33
+ label: "Class Completion Rate",
34
+ },
35
+ {
36
+ accessor: "graduatedStudents",
37
+ label: "Graduated Students",
38
+ },
39
+ ],
40
+ },
41
+ ] %>
42
+
43
+ <%= pb_rails("advanced_table", props: { id: "table_multi_headers_vertical_borders", table_data: @table_data, column_definitions: column_definitions, table_props: { vertical_border: true } }) %>
@@ -0,0 +1,64 @@
1
+ import React from "react"
2
+ import AdvancedTable from '../../pb_advanced_table/_advanced_table'
3
+ import MOCK_DATA from "./advanced_table_mock_data.json"
4
+
5
+ const AdvancedTableColumnHeadersVerticalBorder = (props) => {
6
+ const columnDefinitions = [
7
+ {
8
+ accessor: "year",
9
+ label: "Year",
10
+ cellAccessors: ["quarter", "month", "day"],
11
+ },
12
+ {
13
+ label: "Enrollment Data",
14
+ columns: [
15
+ {
16
+ accessor: "newEnrollments",
17
+ label: "New Enrollments",
18
+ },
19
+ {
20
+ accessor: "scheduledMeetings",
21
+ label: "Scheduled Meetings",
22
+ },
23
+ ],
24
+ },
25
+ {
26
+ label: "Performance Data",
27
+ columns: [
28
+ {
29
+ accessor: "attendanceRate",
30
+ label: "Attendance Rate",
31
+ },
32
+ {
33
+ accessor: "completedClasses",
34
+ label: "Completed Classes",
35
+ },
36
+ {
37
+ accessor: "classCompletionRate",
38
+ label: "Class Completion Rate",
39
+ },
40
+ {
41
+ accessor: "graduatedStudents",
42
+ label: "Graduated Students",
43
+ },
44
+ ],
45
+ },
46
+ ];
47
+
48
+ const tableProps = {
49
+ verticalBorder: true
50
+ }
51
+
52
+ return (
53
+ <>
54
+ <AdvancedTable
55
+ columnDefinitions={columnDefinitions}
56
+ tableData={MOCK_DATA}
57
+ tableProps={tableProps}
58
+ {...props}
59
+ />
60
+ </>
61
+ )
62
+ }
63
+
64
+ export default AdvancedTableColumnHeadersVerticalBorder
@@ -0,0 +1,60 @@
1
+ import React from "react"
2
+ import AdvancedTable from '../_advanced_table'
3
+ import Background from '../../pb_background/_background'
4
+ import MOCK_DATA from "./advanced_table_mock_data_with_id.json"
5
+
6
+ const AdvancedTablePaddingControl = (props) => {
7
+ const columnDefinitions = [
8
+ {
9
+ accessor: "year",
10
+ label: "Year",
11
+ cellAccessors: ["quarter", "month", "day"],
12
+ },
13
+ {
14
+ accessor: "newEnrollments",
15
+ label: "New Enrollments",
16
+ columnStyling:{cellPadding: "none"},
17
+ customRenderer: (row, value) => (
18
+ <Background
19
+ backgroundColor={row.original.newEnrollments > 20 ? "success_secondary" : "warning_secondary"}
20
+ padding="xs"
21
+ >
22
+ {value}
23
+ </Background>
24
+ ),
25
+
26
+ },
27
+ {
28
+ accessor: "scheduledMeetings",
29
+ label: "Scheduled Meetings",
30
+ },
31
+ {
32
+ accessor: "attendanceRate",
33
+ label: "Attendance Rate",
34
+ },
35
+ {
36
+ accessor: "completedClasses",
37
+ label: "Completed Classes",
38
+ },
39
+ {
40
+ accessor: "classCompletionRate",
41
+ label: "Class Completion Rate",
42
+ },
43
+ {
44
+ accessor: "graduatedStudents",
45
+ label: "Graduated Students",
46
+ },
47
+ ]
48
+
49
+ return (
50
+ <div>
51
+ <AdvancedTable
52
+ columnDefinitions={columnDefinitions}
53
+ tableData={MOCK_DATA}
54
+ {...props}
55
+ />
56
+ </div>
57
+ )
58
+ }
59
+
60
+ export default AdvancedTablePaddingControl
@@ -0,0 +1,3 @@
1
+ `columnStyling` can also be used to control padding on all cells in a given column via the use of the `cellPadding` key/value pair. `cellPadding` lets you use 'xxs', 'xs', 'sm', 'md', 'lg', 'xl' and 'none'.
2
+
3
+ This control can be used in conjunction with the `customRenderer` item within each columnDefinition to achieve custom background colors for individual cells as seen here.
@@ -0,0 +1,57 @@
1
+ import React from "react"
2
+ import AdvancedTable from '../_advanced_table'
3
+ import MOCK_DATA from "./advanced_table_mock_data_with_id.json"
4
+
5
+ const AdvancedTablePaddingControlPerRow = (props) => {
6
+ const columnDefinitions = [
7
+ {
8
+ accessor: "year",
9
+ label: "Year",
10
+ cellAccessors: ["quarter", "month", "day"],
11
+ },
12
+ {
13
+ accessor: "newEnrollments",
14
+ label: "New Enrollments",
15
+ },
16
+ {
17
+ accessor: "scheduledMeetings",
18
+ label: "Scheduled Meetings",
19
+ },
20
+ {
21
+ accessor: "attendanceRate",
22
+ label: "Attendance Rate",
23
+ },
24
+ {
25
+ accessor: "completedClasses",
26
+ label: "Completed Classes",
27
+ },
28
+ {
29
+ accessor: "classCompletionRate",
30
+ label: "Class Completion Rate",
31
+ },
32
+ {
33
+ accessor: "graduatedStudents",
34
+ label: "Graduated Students",
35
+ },
36
+ ]
37
+
38
+ const rowStyling = [
39
+ {
40
+ rowId: "1",
41
+ cellPadding:"md"
42
+ },
43
+ ];
44
+
45
+ return (
46
+ <div>
47
+ <AdvancedTable
48
+ columnDefinitions={columnDefinitions}
49
+ rowStyling={rowStyling}
50
+ tableData={MOCK_DATA}
51
+ {...props}
52
+ />
53
+ </div>
54
+ )
55
+ }
56
+
57
+ export default AdvancedTablePaddingControlPerRow
@@ -0,0 +1 @@
1
+ `rowStyling` can also be used to control padding on all cells in a given row via the use of the `cellPadding` key/value pair as shown here. `cellPadding` lets you use 'xxs', 'xs', 'sm', 'md', 'lg', 'xl' and 'none'.
@@ -13,6 +13,7 @@ examples:
13
13
  - advanced_table_with_custom_header_rails: Custom Header Cell
14
14
  - advanced_table_column_headers: Multi-Header Columns
15
15
  - advanced_table_column_headers_multiple: Multi-Header Columns (Multiple Levels)
16
+ - advanced_table_column_headers_vertical_border: Multi-Header Columns with Vertical Borders
16
17
  - advanced_table_no_subrows: Table with No Subrows or Expansion
17
18
  - advanced_table_selectable_rows_rails: Selectable Rows
18
19
  - advanced_table_selectable_rows_no_subrows_rails: Selectable Rows (No Subrows)
@@ -53,6 +54,7 @@ examples:
53
54
  - advanced_table_column_headers: Multi-Header Columns
54
55
  - advanced_table_column_headers_multiple: Multi-Header Columns (Multiple Levels)
55
56
  - advanced_table_column_headers_custom_cell: Multi-Header Columns with Custom Cells
57
+ - advanced_table_column_headers_vertical_border: Multi-Header Columns with Vertical Borders
56
58
  - advanced_table_no_subrows: Table with No Subrows or Expansion
57
59
  - advanced_table_pinned_rows: Pinned Rows
58
60
  - advanced_table_selectable_rows: Selectable Rows
@@ -66,8 +68,10 @@ examples:
66
68
  - advanced_table_column_visibility_multi: Column Visibility Control with Multi-Header Columns
67
69
  - advanced_table_scrollbar_none: Advanced Table Scrollbar None
68
70
  - advanced_table_row_styling: Row Styling
71
+ - advanced_table_padding_control_per_row: Padding Control using Row Styling
69
72
  - advanced_table_column_styling: Column Styling
70
73
  - advanced_table_column_styling_column_headers: Column Styling with Multiple Headers
74
+ - advanced_table_padding_control: Padding Control using Column Styling
71
75
  - advanced_table_column_border_color: Column Group Border Color
72
76
  - advanced_table_fullscreen: Fullscreen
73
77
  - advanced_table_infinite_scroll: Infinite Scroll
@@ -21,6 +21,7 @@ export { default as AdvancedTableSelectableRowsHeader } from './_advanced_table_
21
21
  export { default as AdvancedTableSelectableRowsActions } from './_advanced_table_selectable_rows_actions.jsx'
22
22
  export { default as AdvancedTableTablePropsStickyHeader } from './_advanced_table_table_props_sticky_header.jsx'
23
23
  export { default as AdvancedTableColumnHeadersCustomCell } from './_advanced_table_column_headers_custom_cell.jsx'
24
+ export { default as AdvancedTableColumnHeadersVerticalBorder } from './_advanced_table_column_headers_vertical_border.jsx'
24
25
  export { default as AdvancedTableInlineEditing } from './_advanced_table_inline_editing.jsx'
25
26
  export { default as AdvancedTableFullscreen } from './_advanced_table_fullscreen.jsx'
26
27
  export { default as AdvancedTableStickyColumns } from './_advanced_table_sticky_columns.jsx'
@@ -42,4 +43,6 @@ export {default as AdvancedTableWithCustomHeader} from './_advanced_table_with_c
42
43
  export { default as AdvancedTableCustomSort } from './_advanced_table_custom_sort.jsx'
43
44
  export { default as AdvancedTableWithCustomHeaderMultiHeader } from './_advanced_table_with_custom_header_multi_header.jsx'
44
45
  export { default as AdvancedTableSortPerColumn } from './_advanced_table_sort_per_column.jsx'
45
- export { default as AdvancedTableSortPerColumnForMultiColumn } from './_advanced_table_sort_per_column_for_multi_column.jsx'
46
+ export { default as AdvancedTableSortPerColumnForMultiColumn } from './_advanced_table_sort_per_column_for_multi_column.jsx'
47
+ export { default as AdvancedTablePaddingControl } from './_advanced_table_padding_control.jsx'
48
+ export { default as AdvancedTablePaddingControlPerRow } from './_advanced_table_padding_control_per_row.jsx'
@@ -43,7 +43,7 @@ module Playbook
43
43
  end
44
44
 
45
45
  def td_classname(column, index)
46
- classes = %w[id-cell chrome-styles]
46
+ classes = %w[id-cell]
47
47
  classes << "last-cell" if column[:is_last_in_group]
48
48
  classes << "pinned-left" if index.zero? && is_pinned_left && responsive == "scroll"
49
49
  classes.join(" ")
@@ -29,7 +29,7 @@ module Playbook
29
29
  end
30
30
 
31
31
  def td_classname(index)
32
- classes = %w[id-cell chrome-styles]
32
+ classes = %w[id-cell]
33
33
  classes << "pinned-left" if index.zero? && responsive == "scroll"
34
34
  classes.join(" ")
35
35
  end
@@ -1,5 +1,14 @@
1
1
  <%= pb_content_tag do %>
2
- <%= pb_rails("button", props: {type: object.type, loading: object.loading, link: object.link, new_window:object.new_window, variant: object.variant, target: object.target, disabled: object.disabled, dark: object.dark}) do %>
2
+ <%= pb_rails("button", props: {
3
+ type: object.type,
4
+ loading: object.loading,
5
+ link: object.link,
6
+ new_window: object.new_window,
7
+ variant: object.variant,
8
+ target: object.target,
9
+ disabled: object.disabled,
10
+ dark: object.dark
11
+ }.merge(object.input_options)) do %>
3
12
  <%= pb_rails("icon", props: {icon: object.icon, fixed_width: true, dark: object.dark}) %>
4
13
  <% end %>
5
14
  <% end %>
@@ -21,6 +21,8 @@ module Playbook
21
21
  prop :size, type: Playbook::Props::Enum,
22
22
  values: %w[default sm],
23
23
  default: "default"
24
+ prop :input_options, type: Playbook::Props::HashProp,
25
+ default: {}
24
26
 
25
27
  def classname
26
28
  generate_classname("pb_circle_icon_button_kit") + size_class
@@ -0,0 +1,24 @@
1
+ <%= pb_rails("circle_icon_button", props: {
2
+ icon: "plus",
3
+ input_options: {
4
+ data: { "test-id": "add-button", remote: true },
5
+ }
6
+ }) %>
7
+ <br/>
8
+ <%= pb_rails("circle_icon_button", props: {
9
+ icon: "pen",
10
+ variant: "secondary",
11
+ input_options: {
12
+ data: { "test-id": "edit-button" },
13
+ classname: "custom-secondary-button-class"
14
+ }
15
+ }) %>
16
+ <br/>
17
+ <%= pb_rails("circle_icon_button", props: {
18
+ icon: "user",
19
+ variant: "link",
20
+ input_options: {
21
+ data: { "test-id": "user-button" },
22
+ id: "user-button-id"
23
+ }
24
+ }) %>
@@ -0,0 +1,3 @@
1
+ Use the `input_options` prop to pass additional attributes directly to the internal Playbook Button component. While the wrapper div has access to the standard `data` prop from KitBase, `input_options` allows you to attach attributes specifically to the internal button element.
2
+
3
+ This is particularly useful when you need data attributes or other HTML attributes to apply to the button itself.
@@ -5,6 +5,7 @@ examples:
5
5
  - circle_icon_button_link: Link
6
6
  - circle_icon_button_loading: Loading
7
7
  - circle_icon_button_size: Size
8
+ - circle_icon_button_input_options: Input Options
8
9
 
9
10
  react:
10
11
  - circle_icon_button_default: Default
@@ -19,6 +19,7 @@ type PbDateProps = {
19
19
  htmlOptions?: { [key: string]: string | number | boolean | (() => void) };
20
20
  id?: string;
21
21
  showDayOfWeek?: boolean;
22
+ showCurrentYear?: boolean;
22
23
  showIcon?: boolean;
23
24
  size?: "sm" | "md" | "lg";
24
25
  unstyled?: boolean;
@@ -35,6 +36,7 @@ const PbDate = (props: PbDateProps): React.ReactElement => {
35
36
  htmlOptions = {},
36
37
  id,
37
38
  showDayOfWeek = false,
39
+ showCurrentYear = false,
38
40
  showIcon = false,
39
41
  size = "md",
40
42
  unstyled = false,
@@ -90,7 +92,7 @@ const PbDate = (props: PbDateProps): React.ReactElement => {
90
92
  {month} {day}
91
93
  </span>
92
94
 
93
- {currentYear != year && <span>{`, ${year}`}</span>}
95
+ {(currentYear !== year || showCurrentYear) && <span>{`, ${year}`}</span>}
94
96
  </span>
95
97
  </>
96
98
  : size == "md" || size == "lg"
@@ -124,7 +126,7 @@ const PbDate = (props: PbDateProps): React.ReactElement => {
124
126
  <span>
125
127
  {month} {day}
126
128
  </span>
127
- {currentYear != year && <span>{`, ${year}`}</span>}
129
+ {(currentYear !== year || showCurrentYear) && <span>{`, ${year}`}</span>}
128
130
  </Title>
129
131
  )
130
132
  : (
@@ -158,7 +160,7 @@ const PbDate = (props: PbDateProps): React.ReactElement => {
158
160
  <Caption dark={dark}
159
161
  tag="span">
160
162
  {month} {day}
161
- {currentYear != year && <>{`, ${year}`}</>}
163
+ {(currentYear !== year || showCurrentYear) && <>{`, ${year}`}</>}
162
164
  </Caption>
163
165
  </>
164
166
  )}
@@ -13,8 +13,8 @@
13
13
  <% end %>
14
14
 
15
15
  <!-- month day, year -->
16
- <%# if not current year %>
17
- <% if object.year.to_s == DateTime.now.year.to_s %>
16
+ <%# if not current year or show_current_year is false %>
17
+ <% if object.year.to_s == DateTime.now.year.to_s && !object.show_current_year %>
18
18
  <span><%= "#{object.month} #{object.day}" %></span>
19
19
  <%# if is current year %>
20
20
  <% else %>
@@ -44,8 +44,8 @@
44
44
 
45
45
  <!-- month day, year -->
46
46
 
47
- <%# if not current year %>
48
- <% if object.year.to_s == DateTime.now.year.to_s %>
47
+ <%# if not current year or show_current_year is false %>
48
+ <% if object.year.to_s == DateTime.now.year.to_s && !object.show_current_year %>
49
49
  <%= pb_rails("title", props: { tag: "div", text: "#{object.month} #{object.day}", size: 4 }) %>
50
50
  <%# if is current year %>
51
51
  <% else %>
@@ -74,8 +74,8 @@
74
74
 
75
75
  <!-- month day, year -->
76
76
 
77
- <%# if not current year %>
78
- <% if object.year.to_s == DateTime.now.year.to_s %>
77
+ <%# if not current year or show_current_year is false %>
78
+ <% if object.year.to_s == DateTime.now.year.to_s && !object.show_current_year %>
79
79
  <%= pb_rails("caption", props: { tag: "span", text: "#{object.month} #{object.day}" }) %>
80
80
  <%# if is current year %>
81
81
  <% else %>
@@ -11,6 +11,8 @@ module Playbook
11
11
  default: false
12
12
  prop :show_day_of_week, type: Playbook::Props::Boolean,
13
13
  default: false
14
+ prop :show_current_year, type: Playbook::Props::Boolean,
15
+ default: false
14
16
  prop :size, type: Playbook::Props::Enum,
15
17
  values: %w[lg md sm xs],
16
18
  default: "md"
@@ -0,0 +1,4 @@
1
+ <%= pb_rails("date", props: {
2
+ date: Date.today,
3
+ show_current_year: true
4
+ }) %>
@@ -0,0 +1,17 @@
1
+ import React from 'react'
2
+
3
+ import FormattedDate from '../../pb_date/_date'
4
+
5
+ const DateWithShowCurrentYear = (props) => {
6
+ return (
7
+ <>
8
+ <FormattedDate
9
+ showCurrentYear
10
+ value={new Date()}
11
+ {...props}
12
+ />
13
+ </>
14
+ )
15
+ }
16
+
17
+ export default DateWithShowCurrentYear
@@ -0,0 +1 @@
1
+ By default, the Date kit does NOT display the year if it is the current year. If you want to display the current year you can do so by setting `showCurrentYear`/`show_current_year` to true as shown here.