playbook_ui 15.4.0.pre.alpha.PLAY2556advancedtablefirstcolumnborder12527 → 15.4.0.pre.alpha.PLAY2582rails722112532

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 (83) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +6 -96
  3. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling.jsx +2 -1
  4. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_column_headers.jsx +1 -1
  5. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_fullscreen.jsx +3 -1
  6. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_infinite_scroll.jsx +1 -1
  7. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_inline_editing.jsx +3 -1
  8. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_row_styling.jsx +2 -1
  9. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.html.erb +1 -163
  10. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.jsx +0 -190
  11. data/app/pb_kits/playbook/pb_copy_button/_copy_button.tsx +1 -1
  12. data/app/pb_kits/playbook/pb_copy_button/copy_button.html.erb +6 -2
  13. data/app/pb_kits/playbook/pb_copy_button/copy_button.rb +3 -0
  14. data/app/pb_kits/playbook/pb_copy_button/copy_button.test.jsx +24 -0
  15. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_button_variant.html.erb +9 -0
  16. data/app/pb_kits/playbook/pb_copy_button/docs/{_copy_button_icon_variant.jsx → _copy_button_button_variant.jsx} +4 -4
  17. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_button_variant_rails.md +1 -0
  18. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_button_variant_react.md +1 -0
  19. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_default.html.erb +2 -2
  20. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_default.jsx +1 -2
  21. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.html.erb +2 -2
  22. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.jsx +2 -0
  23. data/app/pb_kits/playbook/pb_copy_button/docs/example.yml +2 -1
  24. data/app/pb_kits/playbook/pb_copy_button/docs/index.js +1 -1
  25. data/app/pb_kits/playbook/pb_dropdown/index.js +31 -13
  26. data/app/pb_kits/playbook/pb_empty_state/docs/_empty_state_alignment.jsx +2 -1
  27. data/app/pb_kits/playbook/pb_empty_state/docs/_empty_state_default.jsx +2 -1
  28. data/app/pb_kits/playbook/pb_empty_state/docs/_empty_state_orientation.jsx +2 -1
  29. data/app/pb_kits/playbook/pb_empty_state/docs/_empty_state_size.jsx +2 -1
  30. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_wrapped.jsx +4 -1
  31. data/app/pb_kits/playbook/pb_loading_inline/docs/_loading_inline_variant.jsx +1 -1
  32. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_colors.jsx +1 -1
  33. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_default.jsx +1 -1
  34. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_height.jsx +1 -1
  35. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_horizontal.jsx +1 -1
  36. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend.jsx +1 -1
  37. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_non_clickable.jsx +1 -2
  38. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_position.jsx +1 -1
  39. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_negative_numbers.jsx +1 -1
  40. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_secondary_y_axis.jsx +1 -1
  41. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_spline.jsx +1 -2
  42. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_stacked.jsx +1 -2
  43. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_block_content.jsx +2 -1
  44. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_color_overrides.jsx +2 -1
  45. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.jsx +1 -1
  46. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_legend_position.jsx +2 -1
  47. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_labels.jsx +1 -1
  48. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_legend.jsx +1 -1
  49. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_default.jsx +1 -1
  50. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_inner_sizes.jsx +1 -1
  51. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_live_data.jsx +2 -1
  52. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_rounded.jsx +1 -1
  53. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_with_title.jsx +1 -1
  54. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_color.jsx +1 -1
  55. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_complex.jsx +2 -1
  56. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_full_circle.jsx +2 -1
  57. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_height.jsx +2 -1
  58. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_min_max.jsx +2 -1
  59. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_units.jsx +2 -1
  60. data/app/pb_kits/playbook/pb_pb_line_graph/docs/_pb_line_graph_colors.jsx +1 -1
  61. data/app/pb_kits/playbook/pb_popover/docs/_popover_append_to.jsx +4 -1
  62. data/app/pb_kits/playbook/pb_radio/docs/_radio_react_hook.jsx +3 -1
  63. data/app/pb_kits/playbook/pb_select/docs/_select_react_hook.jsx +3 -1
  64. data/app/pb_kits/playbook/pb_table/styles/_vertical_border.scss +0 -49
  65. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_sizing.jsx +4 -1
  66. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_react_hook.jsx +2 -1
  67. data/app/pb_kits/playbook/pb_user/docs/_user_font_options.jsx +1 -1
  68. data/dist/chunks/_typeahead-Cd3O38ts.js +6 -0
  69. data/dist/chunks/lib-CgpqUb6l.js +29 -0
  70. data/dist/chunks/vendor.js +37 -1
  71. data/dist/playbook-rails-react-bindings.js +1 -1
  72. data/dist/playbook-rails.js +1 -1
  73. data/dist/playbook.css +1 -1
  74. data/lib/playbook/version.rb +1 -1
  75. metadata +7 -10
  76. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_icon_variant_react.md +0 -1
  77. data/dist/chunks/_line_graph-Co6PvNPL.js +0 -1
  78. data/dist/chunks/_typeahead-D0OX5RuZ.js +0 -6
  79. data/dist/chunks/_weekday_stacked-HzVLtvcd.js +0 -37
  80. data/dist/chunks/componentRegistry-DzmmLR2x.js +0 -1
  81. data/dist/chunks/lib-COXg9aPA.js +0 -29
  82. data/dist/chunks/pb_form_validation-DR765aoq.js +0 -1
  83. data/dist/playbook-doc.js +0 -19
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 511c977ba15b20fba7fa52c1c9bf80ee9c562cf27acc8f2e41e32157b73d7a7d
4
- data.tar.gz: 32a534c6deaede0523539dc0d3ebf2e1e4b0f8100a0b824966d7cc46e3e2b8d0
3
+ metadata.gz: 707a9a3553c2813cb3297123f4a4f44c1c7d766cec8f3af6bc0c3d269a632e21
4
+ data.tar.gz: e7884a7c8be2f43ef9d3a37a25f6a3a6cc72834486c592b0d6d941c9092182a9
5
5
  SHA512:
6
- metadata.gz: caf333d083ca806c032c6d1d3f34a30a7f2d48f896e59fc3e891b0aae1fd68f38ca16aed891d31f68596409d008b932c9eedd5cd0f8d1d8822e83cd4c48a2b18
7
- data.tar.gz: 113ac9c350af9108918cd78e4486e18ae3b452ee60d263553a5c7b24ed065c1bc138e66923b655c4a210a81e20604bc1cb84cba559acf54d7154e0fb8412b51c
6
+ metadata.gz: c96cce1ab96980e86fc78ce13b394860410986add89fd48814f332e2e1459dead8b9fd86146f76b53bfd595ec143241eb539d14cd9f43388a47a9e5b51489d37
7
+ data.tar.gz: eeaff59ae0aa931d6e4358cee1fa7fc5d3b803cfa3fce18d728be8926f97af4105d023813b4a92416bf64315a17acc11970ab723663b7482c0e310bd0e7353b7
@@ -791,28 +791,6 @@
791
791
  box-shadow: 1px 0px 0px 0px var(--column-border-color) !important;
792
792
  }
793
793
 
794
- // Override last-header-cell border color in dark mode
795
- .pb_advanced_table_header {
796
- > tr:not(:first-child) {
797
- .last-header-cell {
798
- border-right: 1px solid $border_dark !important;
799
- }
800
- }
801
-
802
- th[colspan]:not([colspan="1"]) {
803
- border-right: 1px solid $border_dark !important;
804
- }
805
- }
806
-
807
- // Override last-cell border color in dark mode for body cells
808
- .pb_advanced_table_body {
809
- tr {
810
- .last-cell:not(:last-of-type) {
811
- border-right: 1px solid $border_dark !important;
812
- }
813
- }
814
- }
815
-
816
794
  // Apply border colors in dark mode
817
795
  &[class*="column-group-border-"] {
818
796
  // For top-level column groups (ENROLLMENT DATA, PERFORMANCE DATA)
@@ -872,7 +850,7 @@
872
850
  // Restore vertical border styling in dark mode when verticalBorder is true
873
851
  .pb_table[data-vertical-border="true"] {
874
852
  .pb_advanced_table_header {
875
- > tr {
853
+ > tr:not(:first-child) {
876
854
  th:not(:last-child) {
877
855
  border-right: 1px solid $border_dark !important;
878
856
  }
@@ -886,17 +864,11 @@
886
864
  }
887
865
  }
888
866
 
889
- tr.virtualized-table-row {
890
- td:not(:last-child) {
891
- border-right: 1px solid $border_dark !important;
892
- }
893
- }
894
-
895
867
  // When both verticalBorder AND columnGroupBorderColor are set in dark mode,
896
868
  // override the default border-dark with the custom color
897
869
  &.pb_advanced_table[class*="column-group-border-"] {
898
870
  .pb_advanced_table_header {
899
- > tr {
871
+ > tr:not(:first-child) {
900
872
  th:not(:last-child) {
901
873
  border-right: 1px solid var(--column-border-color) !important;
902
874
  }
@@ -909,12 +881,6 @@
909
881
  border-right: 1px solid var(--column-border-color) !important;
910
882
  }
911
883
  }
912
-
913
- tr.virtualized-table-row {
914
- td:not(:last-child) {
915
- border-right: 1px solid var(--column-border-color) !important;
916
- }
917
- }
918
884
  }
919
885
  }
920
886
 
@@ -1019,90 +985,34 @@
1019
985
  // Firefox-specific fix for last-header-cell and last-cell vertical borders
1020
986
  @-moz-document url-prefix() {
1021
987
  .pb_advanced_table_header {
1022
- th[colspan]:not([colspan="1"]):not(:last-child) {
1023
- border-right: none !important;
1024
- box-shadow: 1px 0 0 0 $border_light !important;
1025
- }
1026
-
1027
- .last-header-cell:not(:last-child),
1028
- > tr:last-child .last-header-cell:not(:last-child) {
988
+ .last-header-cell:not(:last-child) {
1029
989
  border-right: none !important;
1030
990
  box-shadow: 1px 0 0 0 $border_light !important;
1031
991
  }
1032
992
  }
1033
993
 
1034
994
  .pb_advanced_table_body {
1035
- tr .last-cell:not(:last-of-type),
1036
- td.last-cell:not(:last-child),
1037
- .pb_table_td.last-cell:not(:last-child) {
995
+ .last-cell:not(:last-child) {
1038
996
  border-right: none !important;
1039
997
  box-shadow: 1px 0 0 0 $border_light !important;
1040
998
  }
1041
999
  }
1042
1000
 
1043
- &[class*="column-group-border-"] {
1044
- .pb_advanced_table_header {
1045
- th[colspan]:not([colspan="1"]):not(:last-child),
1046
- .last-header-cell:not(:last-child),
1047
- > tr:last-child .last-header-cell:not(:last-child) {
1048
- box-shadow: 1px 0 0 0 var(--column-border-color) !important;
1049
- }
1050
- }
1051
-
1052
- .pb_advanced_table_body {
1053
- tr .last-cell:not(:last-of-type),
1054
- td.last-cell:not(:last-child),
1055
- .pb_table_td.last-cell:not(:last-child) {
1056
- box-shadow: 1px 0 0 0 var(--column-border-color) !important;
1057
- }
1058
- }
1059
- }
1060
-
1061
1001
  // Dark mode Firefox fixes
1062
1002
  &.dark {
1063
1003
  .pb_advanced_table_header {
1064
- // Convert all colspan headers to box-shadow with dark color
1065
- th[colspan]:not([colspan="1"]) {
1066
- border-right: none !important;
1067
- box-shadow: 1px 0 0 0 $border_dark !important;
1068
- }
1069
-
1070
- // Convert all last-header-cell borders to box-shadow with dark color
1071
- .last-header-cell:not(:last-child),
1072
- > tr:last-child .last-header-cell:not(:last-child),
1073
- > tr:not(:first-child) .last-header-cell:not(:last-child),
1074
- > tr:not(:first-child) .last-header-cell:last-child {
1004
+ .last-header-cell:not(:last-child) {
1075
1005
  border-right: none !important;
1076
1006
  box-shadow: 1px 0 0 0 $border_dark !important;
1077
1007
  }
1078
1008
  }
1079
1009
 
1080
1010
  .pb_advanced_table_body {
1081
- tr .last-cell:not(:last-of-type),
1082
- td.last-cell:not(:last-child),
1083
- .pb_table_td.last-cell:not(:last-child) {
1011
+ .last-cell:not(:last-child) {
1084
1012
  border-right: none !important;
1085
1013
  box-shadow: 1px 0 0 0 $border_dark !important;
1086
1014
  }
1087
1015
  }
1088
-
1089
- &[class*="column-group-border-"] {
1090
- .pb_advanced_table_header {
1091
- th[colspan]:not([colspan="1"]):not(:last-child),
1092
- .last-header-cell:not(:last-child),
1093
- > tr:last-child .last-header-cell:not(:last-child) {
1094
- box-shadow: 1px 0 0 0 var(--column-border-color) !important;
1095
- }
1096
- }
1097
-
1098
- .pb_advanced_table_body {
1099
- tr .last-cell:not(:last-of-type),
1100
- td.last-cell:not(:last-child),
1101
- .pb_table_td.last-cell:not(:last-child) {
1102
- box-shadow: 1px 0 0 0 var(--column-border-color) !important;
1103
- }
1104
- }
1105
- }
1106
1016
  }
1107
1017
  }
1108
1018
  }
@@ -1,5 +1,6 @@
1
1
  import React from "react"
2
- import { AdvancedTable, colors } from "playbook-ui"
2
+ import AdvancedTable from '../_advanced_table'
3
+ import colors from '../../tokens/exports/_colors.module.scss'
3
4
  import MOCK_DATA from "./advanced_table_mock_data.json"
4
5
 
5
6
 
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { AdvancedTable } from "playbook-ui";
2
+ import AdvancedTable from '../_advanced_table';
3
3
  import MOCK_DATA from "./advanced_table_mock_data.json";
4
4
 
5
5
  const AdvancedTableColumnStylingColumnHeaders = (props) => {
@@ -1,5 +1,7 @@
1
1
  import React, { useState } from "react"
2
- import { AdvancedTable, Button, Flex } from "playbook-ui"
2
+ import AdvancedTable from '../_advanced_table'
3
+ import Flex from '../../pb_flex/_flex'
4
+ import Button from '../../pb_button/_button'
3
5
  import MOCK_DATA from "./advanced_table_mock_data.json"
4
6
  import PAGINATION_MOCK_DATA from "./advanced_table_pagination_mock_data.json"
5
7
 
@@ -1,5 +1,5 @@
1
1
  import React from "react"
2
- import { AdvancedTable } from "playbook-ui"
2
+ import AdvancedTable from '../_advanced_table'
3
3
  import MOCK_DATA from "./advanced_table_mock_data_infinite_scroll.json"
4
4
 
5
5
  const AdvancedTableInfiniteScroll = (props) => {
@@ -1,5 +1,7 @@
1
1
  import React, { useState } from "react";
2
- import { AdvancedTable, TextInput, Body } from "playbook-ui";
2
+ import AdvancedTable from '../../pb_advanced_table/_advanced_table'
3
+ import TextInput from '../../pb_text_input/_text_input'
4
+ import Body from '../../pb_body/_body'
3
5
  import MOCK_DATA from "./advanced_table_mock_data.json";
4
6
 
5
7
  const AdvancedTableInlineEditing = (props) => {
@@ -1,7 +1,8 @@
1
1
  import React from "react"
2
2
  import AdvancedTable from '../_advanced_table'
3
3
  import MOCK_DATA from "./advanced_table_mock_data_with_id.json"
4
- import { colors } from "playbook-ui"
4
+ import colors from '../../tokens/exports/_colors.module.scss'
5
+
5
6
 
6
7
  const AdvancedTableRowStyling = (props) => {
7
8
  const columnDefinitions = [
@@ -29,167 +29,5 @@
29
29
  label: "Graduated Students",
30
30
  }
31
31
  ] %>
32
- <%= pb_rails("caption", props: { text: "Advanced Table Vertical Border Table Props" }) %>
33
- <%= pb_rails("advanced_table", props: { id: "table_props_table", table_data: @table_data, margin_bottom: "md", column_definitions: column_definitions, table_props: { vertical_border: true, container: false }}) %>
34
32
 
35
- <% column_definitions_two = [
36
- {
37
- accessor: "year",
38
- label: "Year",
39
- cellAccessors: ["quarter", "month", "day"],
40
- },
41
- {
42
- label: "Enrollment Data",
43
- columns: [
44
- {
45
- accessor: "newEnrollments",
46
- label: "New Enrollments",
47
- },
48
- {
49
- accessor: "scheduledMeetings",
50
- label: "Scheduled Meetings",
51
- },
52
- ],
53
- },
54
- {
55
- label: "Performance Data",
56
- columns: [
57
- {
58
- accessor: "attendanceRate",
59
- label: "Attendance Rate",
60
- },
61
- {
62
- accessor: "completedClasses",
63
- label: "Completed Classes",
64
- },
65
- {
66
- accessor: "classCompletionRate",
67
- label: "Class Completion Rate",
68
- },
69
- {
70
- accessor: "graduatedStudents",
71
- label: "Graduated Students",
72
- },
73
- ],
74
- },
75
- ] %>
76
- <%= pb_rails("caption", props: { text: "Advanced Table Vertical Border Multi Header" }) %>
77
- <%= pb_rails("advanced_table", props: { id: "table_multi_headers_vertical_borders", margin_bottom: "md", table_data: @table_data, column_definitions: column_definitions_two, table_props: { vertical_border: true } }) %>
78
-
79
- <% column_definitions_three = [
80
- {
81
- accessor: "year",
82
- label: "Year",
83
- cellAccessors: ["quarter", "month", "day"],
84
- },
85
- {
86
- label: "Enrollment Data",
87
- columns: [
88
- {
89
- label: "Enrollment Stats",
90
- columns: [
91
- {
92
- accessor: "newEnrollments",
93
- label: "New Enrollments",
94
- },
95
- {
96
- accessor: "scheduledMeetings",
97
- label: "Scheduled Meetings",
98
- },
99
- ],
100
- },
101
- ],
102
- },
103
- {
104
- label: "Performance Data",
105
- columns: [
106
- {
107
- label: "Completion Metrics",
108
- columns: [
109
- {
110
- accessor: "completedClasses",
111
- label: "Completed Classes",
112
- },
113
- {
114
- accessor: "classCompletionRate",
115
- label: "Class Completion Rate",
116
- },
117
- ],
118
- },
119
- {
120
- label: "Attendance",
121
- columns: [
122
- {
123
- accessor: "attendanceRate",
124
- label: "Attendance Rate",
125
- },
126
- {
127
- accessor: "scheduledMeetings",
128
- label: "Scheduled Meetings",
129
- },
130
- ],
131
- },
132
- ],
133
- },
134
- ] %>
135
- <%= pb_rails("caption", props: { text: "Advanced Table Vertical Border Multi Header with Column Group Border Color" }) %>
136
- <%= pb_rails("advanced_table", props: { id: "beta_table_with_color_headers", margin_bottom: "md", table_data: @table_data, column_definitions: column_definitions_three, column_group_border_color: "text_lt_default", table_props: { vertical_border: true } }) %>
137
-
138
- <% column_definitions_four = [
139
- {
140
- accessor: "year",
141
- label: "Year",
142
- cellAccessors: ["quarter", "month", "day"],
143
- },
144
- {
145
- label: "Enrollment Data",
146
- columns: [
147
- {
148
- label: "Enrollment Stats",
149
- columns: [
150
- {
151
- accessor: "newEnrollments",
152
- label: "New Enrollments",
153
- },
154
- {
155
- accessor: "scheduledMeetings",
156
- label: "Scheduled Meetings",
157
- },
158
- ],
159
- },
160
- ],
161
- },
162
- {
163
- label: "Performance Data",
164
- columns: [
165
- {
166
- label: "Completion Metrics",
167
- columns: [
168
- {
169
- accessor: "completedClasses",
170
- label: "Completed Classes",
171
- },
172
- {
173
- accessor: "classCompletionRate",
174
- label: "Class Completion Rate",
175
- },
176
- ],
177
- },
178
- {
179
- label: "Attendance",
180
- columns: [
181
- {
182
- accessor: "attendanceRate",
183
- label: "Attendance Rate",
184
- },
185
- {
186
- accessor: "scheduledMeetings",
187
- label: "Scheduled Meetings",
188
- },
189
- ],
190
- },
191
- ],
192
- },
193
- ] %>
194
- <%= pb_rails("caption", props: { text: "Advanced Table Vertical Border Multi Header No Vertical Border" }) %>
195
- <%= pb_rails("advanced_table", props: {id: "beta_table_with_muilti_headers", table_data: @table_data, column_definitions: column_definitions_four }) %>
33
+ <%= pb_rails("advanced_table", props: { id: "table_props_table", table_data: @table_data, column_definitions: column_definitions, table_props: { vertical_border: true, container: false }}) %>
@@ -1,7 +1,6 @@
1
1
  import React from "react"
2
2
  import AdvancedTable from '../../pb_advanced_table/_advanced_table'
3
3
  import MOCK_DATA from "./advanced_table_mock_data.json"
4
- import Caption from "../../pb_caption/_caption"
5
4
 
6
5
  const AdvancedTableTableProps = (props) => {
7
6
  const columnDefinitions = [
@@ -41,203 +40,14 @@ const AdvancedTableTableProps = (props) => {
41
40
  verticalBorder: true
42
41
  }
43
42
 
44
- const columnDefinitionsTwo = [
45
- {
46
- accessor: "year",
47
- label: "Year",
48
- cellAccessors: ["quarter", "month", "day"],
49
- },
50
- {
51
- label: "Enrollment Data",
52
- columns: [
53
- {
54
- accessor: "newEnrollments",
55
- label: "New Enrollments",
56
- },
57
- {
58
- accessor: "scheduledMeetings",
59
- label: "Scheduled Meetings",
60
- },
61
- ],
62
- },
63
- {
64
- label: "Performance Data",
65
- columns: [
66
- {
67
- accessor: "attendanceRate",
68
- label: "Attendance Rate",
69
- },
70
- {
71
- accessor: "completedClasses",
72
- label: "Completed Classes",
73
- },
74
- {
75
- accessor: "classCompletionRate",
76
- label: "Class Completion Rate",
77
- },
78
- {
79
- accessor: "graduatedStudents",
80
- label: "Graduated Students",
81
- },
82
- ],
83
- },
84
- ];
85
-
86
- const tablePropsTwo = {
87
- verticalBorder: true,
88
- }
89
-
90
- const columnDefinitionsThree = [
91
- {
92
- accessor: "year",
93
- label: "Year",
94
- cellAccessors: ["quarter", "month", "day"],
95
- },
96
- {
97
- label: "Enrollment Data",
98
- columns: [
99
- {
100
- label: "Enrollment Stats",
101
- columns: [
102
- {
103
- accessor: "newEnrollments",
104
- label: "New Enrollments",
105
- },
106
- {
107
- accessor: "scheduledMeetings",
108
- label: "Scheduled Meetings",
109
- },
110
- ],
111
- },
112
- ],
113
- },
114
- {
115
- label: "Performance Data",
116
- columns: [
117
- {
118
- label: "Completion Metrics",
119
- columns: [
120
- {
121
- accessor: "completedClasses",
122
- label: "Completed Classes",
123
- },
124
- {
125
- accessor: "classCompletionRate",
126
- label: "Class Completion Rate",
127
- },
128
- ],
129
- },
130
- {
131
- label: "Attendance",
132
- columns: [
133
- {
134
- accessor: "attendanceRate",
135
- label: "Attendance Rate",
136
- },
137
- {
138
- accessor: "scheduledMeetings",
139
- label: "Scheduled Meetings",
140
- },
141
- ],
142
- },
143
- ],
144
- },
145
- ];
146
-
147
- const tablePropsThree = {
148
- verticalBorder: true
149
- }
150
-
151
- const columnDefinitionsFour = [
152
- {
153
- accessor: "year",
154
- label: "Year",
155
- cellAccessors: ["quarter", "month", "day"],
156
- },
157
- {
158
- label: "Enrollment Data",
159
- columns: [
160
- {
161
- label: "Enrollment Stats",
162
- columns: [
163
- {
164
- accessor: "newEnrollments",
165
- label: "New Enrollments",
166
- },
167
- {
168
- accessor: "scheduledMeetings",
169
- label: "Scheduled Meetings",
170
- },
171
- ],
172
- },
173
- ],
174
- },
175
- {
176
- label: "Performance Data",
177
- columns: [
178
- {
179
- label: "Completion Metrics",
180
- columns: [
181
- {
182
- accessor: "completedClasses",
183
- label: "Completed Classes",
184
- },
185
- {
186
- accessor: "classCompletionRate",
187
- label: "Class Completion Rate",
188
- },
189
- ],
190
- },
191
- {
192
- label: "Attendance",
193
- columns: [
194
- {
195
- accessor: "attendanceRate",
196
- label: "Attendance Rate",
197
- },
198
- {
199
- accessor: "scheduledMeetings",
200
- label: "Scheduled Meetings",
201
- },
202
- ],
203
- },
204
- ],
205
- },
206
- ];
207
-
208
43
  return (
209
44
  <div>
210
- <Caption text="Advanced Table Vertical Border Table Props" />
211
45
  <AdvancedTable
212
46
  columnDefinitions={columnDefinitions}
213
- marginBottom="md"
214
47
  tableData={MOCK_DATA}
215
48
  tableProps={tableProps}
216
49
  {...props}
217
50
  />
218
- <Caption text="Advanced Table Vertical Border Multi Header" />
219
- <AdvancedTable
220
- columnDefinitions={columnDefinitionsTwo}
221
- marginBottom="md"
222
- tableData={MOCK_DATA}
223
- tableProps={tablePropsTwo}
224
- {...props}
225
- />
226
- <Caption text="Advanced Table Vertical Border Multi Header with Column Group Border Color" />
227
- <AdvancedTable
228
- columnDefinitions={columnDefinitionsThree}
229
- columnGroupBorderColor="text_lt_default"
230
- marginBottom="md"
231
- tableData={MOCK_DATA}
232
- tableProps={tablePropsThree}
233
- {...props}
234
- />
235
- <Caption text="Advanced Table Vertical Border Multi Header No Vertical Border" />
236
- <AdvancedTable
237
- columnDefinitions={columnDefinitionsFour}
238
- tableData={MOCK_DATA}
239
- {...props}
240
- />
241
51
  </div>
242
52
  )
243
53
  }
@@ -35,7 +35,7 @@ const CopyButton = (props: CopyButtonProps) => {
35
35
  tooltipPlacement = 'bottom',
36
36
  tooltipText = 'Copied!',
37
37
  value = '',
38
- variant = 'button',
38
+ variant = 'icon',
39
39
  } = props
40
40
 
41
41
  const [copied, copy] = usePBCopy({ value, from, timeout })
@@ -1,6 +1,10 @@
1
1
  <%= pb_content_tag do %>
2
- <%= pb_rails("button", props: { icon: "copy" }) do %>
3
- <%= object.text %>
2
+ <% if object.variant == "icon" %>
3
+ <%= pb_rails("circle_icon_button", props: { icon: "copy", variant: "link" }) %>
4
+ <% else %>
5
+ <%= pb_rails("button", props: { icon: "copy" }) do %>
6
+ <%= object.text %>
7
+ <% end %>
4
8
  <% end %>
5
9
  <% if object.id %>
6
10
  <%= pb_rails("tooltip", props: {
@@ -12,6 +12,9 @@ module Playbook
12
12
  default: "Copied!"
13
13
  prop :value
14
14
  prop :from
15
+ prop :variant, type: Playbook::Props::Enum,
16
+ values: %w[button icon],
17
+ default: "icon"
15
18
 
16
19
  def classname
17
20
  generate_classname("pb_copy_button_kit")
@@ -37,6 +37,29 @@ it('copies the value to clipboard and pastes it into an input', async () => {
37
37
  expect(navigator.clipboard.writeText).toHaveBeenCalledWith("copy");
38
38
  })
39
39
 
40
+ test('passes text and tooltip props to icon variant', () => {
41
+ render(
42
+ <CopyButton
43
+ data={{ testid: 'text-test' }}
44
+ tooltipPlacement="right"
45
+ tooltipText="Text copied!"
46
+ value="copy"
47
+ />
48
+ )
49
+
50
+ const kit = screen.getByTestId('text-test')
51
+ const button = kit.querySelector('.pb_button_kit.pb_button_link.pb_button_inline.pb_button_enabled')
52
+ expect(button).toBeInTheDocument()
53
+
54
+ fireEvent.click(button)
55
+ const tooltipContent = screen.getByText("Text copied!")
56
+ expect(tooltipContent).toHaveTextContent("Text copied!")
57
+
58
+ const tooltip = kit.querySelector('.pb_tooltip_kit')
59
+ expect(tooltip).toBeInTheDocument()
60
+ })
61
+
62
+
40
63
  test('passes text and tooltip props to button', () => {
41
64
  render(
42
65
  <CopyButton
@@ -45,6 +68,7 @@ test('passes text and tooltip props to button', () => {
45
68
  tooltipPlacement="right"
46
69
  tooltipText="Text copied!"
47
70
  value="copy"
71
+ variant="button"
48
72
  />
49
73
  )
50
74