playbook_ui 14.10.0.pre.rc.20 → 14.10.0.pre.rc.22

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +3 -3
  3. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +1 -1
  4. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +2 -2
  5. data/app/pb_kits/playbook/pb_gauge/_gauge.scss +31 -1
  6. data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +3 -3
  7. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_complex.jsx +25 -5
  8. data/app/pb_kits/playbook/pb_table/_table.tsx +6 -6
  9. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns.html.erb +30 -48
  10. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns_rails.md +1 -0
  11. data/app/pb_kits/playbook/pb_table/docs/example.yml +2 -0
  12. data/app/pb_kits/playbook/pb_table/index.ts +5 -3
  13. data/app/pb_kits/playbook/pb_table/styles/_scroll.scss +28 -3
  14. data/app/pb_kits/playbook/pb_table/styles/_sticky_columns.scss +0 -1
  15. data/app/pb_kits/playbook/pb_table/table.html.erb +7 -1
  16. data/app/pb_kits/playbook/pb_table/table.rb +4 -0
  17. data/dist/chunks/{_typeahead-l1kq1p9m.js → _typeahead-C63YYbKQ.js} +2 -2
  18. data/dist/chunks/_weekday_stacked-Df46UIol.js +45 -0
  19. data/dist/chunks/{lib-CuCy3_xO.js → lib-sMFo2JZy.js} +1 -1
  20. data/dist/chunks/{pb_form_validation-D37k10a0.js → pb_form_validation-CgvjWbOK.js} +1 -1
  21. data/dist/chunks/vendor.js +1 -1
  22. data/dist/playbook-doc.js +1 -1
  23. data/dist/playbook-rails-react-bindings.js +1 -1
  24. data/dist/playbook-rails.js +1 -1
  25. data/dist/playbook.css +1 -1
  26. data/lib/playbook/version.rb +1 -1
  27. metadata +6 -5
  28. data/dist/chunks/_weekday_stacked-DkCMUF58.js +0 -45
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8004b611a0e7ed5891628daf08be8b7560b22d0faa48631442fc94116f6fba30
4
- data.tar.gz: 5e7b1d10c69dc6148f1778ea2d9c912cc220d199a54db0d9f9179c75ba5bfdd2
3
+ metadata.gz: ad9038fa0ac4d11cbf3a80ddbe6ffc79d05361f05f7c29d53313bb93d1e369d4
4
+ data.tar.gz: cb438e2f888326e3df9dc9fe8bb7f00114284e57b74bf95e7425c1c0f449768a
5
5
  SHA512:
6
- metadata.gz: 79e6cc10512af3e174eb5a6e11b9b638c63af121d7c9a398aaae6086e083bd3569dbcd2ab11dc0f436858a3c4c2aefe2d7677252c8cff64d5f60b75c211e4281
7
- data.tar.gz: 2405a386d65dc6880cc5ffb3dc835a7556caa55ce59eea569cf42205a6f090d1f9ad413fc29b52c210fef9e7d51c0d84e19aaf8eec7215746f1d847086ea08e9
6
+ metadata.gz: 27c3775b16e5b9dbfb037253c8cab3fb2c2b8658454249bba0bee3b19b2010fa4329e2c6c94046ad35655f7c2e2676a7ba0aef5cca6c734cb719b078f4a6e487
7
+ data.tar.gz: 909b33325ea6f7a48a7b4c6037428115d4f451a2bcd8faa814f2310b39cd4a57935aa88cb95ea904cd273c00b441b38f2fee15e3674208f0b892fcd3675a5e94
@@ -120,7 +120,7 @@
120
120
 
121
121
  // Responsive Styles
122
122
  @media only screen and (max-width: $screen-xl-min) {
123
- &[class*="table-responsive-scroll"] {
123
+ &[class*="advanced-table-responsive-scroll"] {
124
124
  border-radius: 4px;
125
125
  box-shadow: 1px 0 0 0px $border_light,
126
126
  -1px 0 0 0px $border_light;
@@ -158,7 +158,7 @@
158
158
  }
159
159
  }
160
160
  @media only screen and (min-width: $screen-xl-min) {
161
- &[class*="table-responsive-scroll"] {
161
+ &[class*="advanced-table-responsive-scroll"] {
162
162
  overflow-x: visible;
163
163
  }
164
164
  }
@@ -208,7 +208,7 @@
208
208
  }
209
209
  // Dark Mode Responsive Styles
210
210
  @media only screen and (max-width: $screen-xl-min) {
211
- &[class*="table-responsive-scroll"] {
211
+ &[class*="advanced-table-responsive-scroll"] {
212
212
  border-radius: 4px;
213
213
  box-shadow: 1px 0 0 0px $border_dark,
214
214
  -1px 0 0 0px $border_dark;
@@ -240,7 +240,7 @@ const AdvancedTable = (props: AdvancedTableProps) => {
240
240
  const htmlProps = buildHtmlProps(htmlOptions)
241
241
  const classes = classnames(
242
242
  buildCss("pb_advanced_table"),
243
- `table-responsive-${responsive}`,
243
+ `advanced-table-responsive-${responsive}`,
244
244
  globalProps(props),
245
245
  className
246
246
  )
@@ -468,7 +468,7 @@ test("responsive prop functions as expected", () => {
468
468
  )
469
469
 
470
470
  const kit = screen.getByTestId(testId)
471
- expect(kit).toHaveClass("pb_advanced_table table-responsive-scroll")
471
+ expect(kit).toHaveClass("pb_advanced_table advanced-table-responsive-scroll")
472
472
  })
473
473
 
474
474
  test("responsive none prop functions as expected", () => {
@@ -483,7 +483,7 @@ test("responsive none prop functions as expected", () => {
483
483
  )
484
484
 
485
485
  const kit = screen.getByTestId(testId)
486
- expect(kit).toHaveClass("pb_advanced_table table-responsive-none")
486
+ expect(kit).toHaveClass("pb_advanced_table advanced-table-responsive-none")
487
487
  })
488
488
 
489
489
  test("customRenderer prop functions as expected", () => {
@@ -1,12 +1,33 @@
1
+ @import "../tokens/colors";
2
+
1
3
  [class^=pb_gauge_kit] {
2
4
 
5
+ .fix {
6
+ fill: $text_lt_default;
7
+ stroke: none;
8
+
9
+ &[class*=dark] {
10
+ fill: $text_dk_default;
11
+ }
12
+ }
13
+
3
14
  .suffix {
4
15
  fill: $text_lt_light;
16
+ stroke: none;
5
17
  font: $regular $font_larger $font_family_base;
18
+
19
+ &[class*=dark] {
20
+ fill: $text_dk_light;
21
+ }
6
22
  }
7
23
  .prefix {
8
24
  fill: $text_lt_light;
25
+ stroke: none;
9
26
  font: $regular $font_base $font_family_base;
27
+
28
+ &[class*=dark] {
29
+ fill: $text_dk_light;
30
+ }
10
31
  }
11
32
 
12
33
  rect.highcharts-background {
@@ -16,4 +37,13 @@
16
37
  .gauge-pane {
17
38
  stroke-linejoin: round;
18
39
  }
19
- }
40
+
41
+ &[class*=dark] {
42
+ color: $text_dk_default;
43
+
44
+ .pb_title_kit_size_1,
45
+ .pb_caption_kit_xs {
46
+ color: $text_dk_light;
47
+ }
48
+ }
49
+ }
@@ -164,9 +164,9 @@ const Gauge = ({
164
164
  color: defaultColors.text_lt_default,
165
165
  enabled: true,
166
166
  format:
167
- `<span class="prefix">${prefix}</span>` +
168
- '<span class="fix">{y:,f}</span>' +
169
- `<span class="suffix">${suffix}</span>`,
167
+ `<span class="prefix${dark ? " dark" : ""}">${prefix}</span>` +
168
+ `<span class="fix${dark ? " dark" : ""}">{y:,f}</span>` +
169
+ `<span class="suffix${dark ? " dark" : ""}">${suffix}</span>`,
170
170
  style: {
171
171
  fontFamily: typography.font_family_base,
172
172
  fontWeight: typography.regular,
@@ -17,47 +17,60 @@ const GaugeComplex = (props) => (
17
17
  gap="sm"
18
18
  padding="xl"
19
19
  wrap
20
+ {...props}
20
21
  >
21
22
  <FlexItem
22
23
  flex={1}
23
24
  grow
25
+ {...props}
24
26
  >
25
27
  <Card
26
28
  maxWidth="xs"
27
29
  padding="md"
30
+ {...props}
28
31
  >
29
32
  <Title
30
33
  paddingBottom="sm"
31
34
  size={4}
32
35
  text="Abandoned Calls"
36
+ {...props}
33
37
  />
34
- <Flex align="stretch">
38
+ <Flex
39
+ align="stretch"
40
+ {...props}
41
+ >
35
42
  <Flex
36
43
  marginRight="sm"
37
44
  orientation="column"
45
+ {...props}
38
46
  >
39
47
  <Body
40
48
  color="light"
41
49
  paddingBottom="sm"
42
50
  text="Total Abandoned"
51
+ {...props}
43
52
  />
44
53
  <Flex
45
54
  align="baseline"
46
55
  paddingBottom="xs"
56
+ {...props}
47
57
  >
48
58
  <Title
49
59
  size={1}
50
60
  text="39"
61
+ {...props}
51
62
  />
52
63
  <Title
53
64
  color="light"
54
65
  size={3}
55
66
  text="calls"
67
+ {...props}
56
68
  />
57
69
  </Flex>
58
70
  <Caption
59
71
  size="xs"
60
72
  text="of 390"
73
+ {...props}
61
74
  />
62
75
  </Flex>
63
76
 
@@ -65,22 +78,29 @@ const GaugeComplex = (props) => (
65
78
  alignSelf="stretch"
66
79
  marginRight="sm"
67
80
  orientation="vertical"
81
+ {...props}
68
82
  />
69
83
 
70
84
  <Flex
71
85
  orientation="column"
72
86
  wrap
87
+ {...props}
73
88
  >
74
89
  <Body
75
90
  color="light"
76
91
  text="% Abandoned"
77
- />
78
- <Flex wrap>
92
+ {...props}
93
+ />
94
+ <Flex
95
+ wrap
96
+ {...props}
97
+ >
79
98
  <FlexItem
80
99
  fixedSize="150px"
81
100
  overflow="hidden"
82
101
  shrink
83
- >
102
+ {...props}
103
+ >
84
104
  <Gauge
85
105
  chartData={data}
86
106
  disableAnimation
@@ -90,7 +110,7 @@ const GaugeComplex = (props) => (
90
110
  {...props}
91
111
  />
92
112
  </FlexItem>
93
- </Flex>
113
+ </Flex>
94
114
  </Flex>
95
115
  </Flex>
96
116
  </Card>
@@ -92,16 +92,16 @@ const Table = (props: TableProps): React.ReactElement => {
92
92
  useEffect(() => {
93
93
  const handleStickyColumns = () => {
94
94
  let accumulatedWidth = 0;
95
-
95
+
96
96
  stickyLeftcolumn.forEach((colId, index) => {
97
97
  const isLastColumn = index === stickyLeftcolumn.length - 1;
98
98
  const header = document.querySelector(`th[id="${colId}"]`);
99
99
  const cells = document.querySelectorAll(`td[id="${colId}"]`);
100
-
100
+
101
101
  if (header) {
102
102
  header.classList.add('sticky');
103
103
  (header as HTMLElement).style.left = `${accumulatedWidth}px`;
104
-
104
+
105
105
  if (!isLastColumn) {
106
106
  header.classList.add('with-border');
107
107
  header.classList.remove('sticky-shadow');
@@ -109,14 +109,14 @@ const Table = (props: TableProps): React.ReactElement => {
109
109
  header.classList.remove('with-border');
110
110
  header.classList.add('sticky-shadow');
111
111
  }
112
-
112
+
113
113
  accumulatedWidth += (header as HTMLElement).offsetWidth;
114
114
  }
115
-
115
+
116
116
  cells.forEach((cell) => {
117
117
  cell.classList.add('sticky');
118
118
  (cell as HTMLElement).style.left = `${accumulatedWidth - (header as HTMLElement).offsetWidth}px`;
119
-
119
+
120
120
  if (!isLastColumn) {
121
121
  cell.classList.add('with-border');
122
122
  cell.classList.remove('sticky-shadow');
@@ -25,16 +25,16 @@
25
25
  <td id="3">Value 3</td>
26
26
  <td>Value 4</td>
27
27
  <td>Value 5</td>
28
- <td>Column 6</td>
29
- <td>Column 7</td>
30
- <td>Column 8</td>
31
- <td>Column 9</td>
32
- <td>Column 10</td>
33
- <td>Column 11</td>
34
- <td>Column 12</td>
35
- <td>Column 13</td>
36
- <td>Column 14</td>
37
- <td>Column 15</td>
28
+ <td>Value 6</td>
29
+ <td>Value 7</td>
30
+ <td>Value 8</td>
31
+ <td>Value 9</td>
32
+ <td>Value 10</td>
33
+ <td>Value 11</td>
34
+ <td>Value 12</td>
35
+ <td>Value 13</td>
36
+ <td>Value 14</td>
37
+ <td>Value 15</td>
38
38
 
39
39
  </tr>
40
40
  <tr>
@@ -43,16 +43,16 @@
43
43
  <td id="3">Value 3</td>
44
44
  <td>Value 4</td>
45
45
  <td>Value 5</td>
46
- <td>Column 6</td>
47
- <td>Column 7</td>
48
- <td>Column 8</td>
49
- <td>Column 9</td>
50
- <td>Column 10</td>
51
- <td>Column 11</td>
52
- <td>Column 12</td>
53
- <td>Column 13</td>
54
- <td>Column 14</td>
55
- <td>Column 15</td>
46
+ <td>Value 6</td>
47
+ <td>Value 7</td>
48
+ <td>Value 8</td>
49
+ <td>Value 9</td>
50
+ <td>Value 10</td>
51
+ <td>Value 11</td>
52
+ <td>Value 12</td>
53
+ <td>Value 13</td>
54
+ <td>Value 14</td>
55
+ <td>Value 15</td>
56
56
 
57
57
  </tr>
58
58
  <tr>
@@ -61,34 +61,16 @@
61
61
  <td id="3">Value 3</td>
62
62
  <td>Value 4</td>
63
63
  <td>Value 5</td>
64
- <td>Column 6</td>
65
- <td>Column 7</td>
66
- <td>Column 8</td>
67
- <td>Column 9</td>
68
- <td>Column 10</td>
69
- <td>Column 11</td>
70
- <td>Column 12</td>
71
- <td>Column 13</td>
72
- <td>Column 14</td>
73
- <td>Column 15</td>
74
-
75
- </tr>
76
- <tr>
77
- <td id="1">Value 1</td>
78
- <td id="2">Value 2</td>
79
- <td id="3">Value 3</td>
80
- <td>Value 4</td>
81
- <td>Value 5</td>
82
- <td>Column 6</td>
83
- <td>Column 7</td>
84
- <td>Column 8</td>
85
- <td>Column 9</td>
86
- <td>Column 10</td>
87
- <td>Column 11</td>
88
- <td>Column 12</td>
89
- <td>Column 13</td>
90
- <td>Column 14</td>
91
- <td>Column 15</td>
64
+ <td>Value 6</td>
65
+ <td>Value 7</td>
66
+ <td>Value 8</td>
67
+ <td>Value 9</td>
68
+ <td>Value 10</td>
69
+ <td>Value 11</td>
70
+ <td>Value 12</td>
71
+ <td>Value 13</td>
72
+ <td>Value 14</td>
73
+ <td>Value 15</td>
92
74
 
93
75
  </tr>
94
76
  </tbody>
@@ -0,0 +1 @@
1
+ The `stickyLeftColumn` prop expects an array of the column ids you want to be sticky. Make sure to add the corresponding id to the `<th>` and `<td>`.
@@ -4,6 +4,7 @@ examples:
4
4
  - table_md: Medium
5
5
  - table_lg: Large
6
6
  - table_sticky: Sticky Header
7
+ - table_sticky_left_columns: Sticky Left Column
7
8
  - table_header: Table Header
8
9
  - table_alignment_row_rails: Row Alignment
9
10
  - table_alignment_column_rails: Cell Alignment
@@ -33,6 +34,7 @@ examples:
33
34
  - table_md: Medium
34
35
  - table_lg: Large
35
36
  - table_sticky: Sticky Header
37
+ - table_sticky_left_columns: Sticky Left Column
36
38
  - table_alignment_row: Row Alignment
37
39
  - table_alignment_column: Cell Alignment
38
40
  - table_alignment_shift_row: Row Shift
@@ -51,9 +51,11 @@ export default class PbTable extends PbEnhancedElement {
51
51
  .split('-');
52
52
 
53
53
  if (this.stickyLeftColumns.length > 0) {
54
- this.handleStickyColumnsRef = this.handleStickyColumns.bind(this);
55
- this.handleStickyColumns();
56
- window.addEventListener('resize', this.handleStickyColumnsRef);
54
+ setTimeout(() => {
55
+ this.handleStickyColumnsRef = this.handleStickyColumns.bind(this);
56
+ this.handleStickyColumns();
57
+ window.addEventListener('resize', this.handleStickyColumnsRef);
58
+ }, 10);
57
59
  }
58
60
  }
59
61
  });
@@ -1,4 +1,29 @@
1
- .table-responsive-scroll {
2
- display: block;
3
- overflow-x: auto;
1
+ @import "../../tokens/screen_sizes";
2
+
3
+ .table-responsive-scroll {
4
+ display: block;
5
+ overflow-x: scroll;
6
+
7
+ // Responsive Styles
8
+ @media (max-width: 1600px) {
9
+ &[class*="table-responsive-scroll"] {
10
+ border-radius: 4px;
11
+ box-shadow: 1px 0 0 0px $border_light
12
+ }
13
+
14
+ &[class^=pb_table].table-sm.table-card thead tr th:last-child,
15
+ &[class^=pb_table].table-sm:not(.no-hover).table-card tbody tr td:last-child {
16
+ border-right-width: 0px;
17
+ }
18
+
19
+ &[class^=pb_table].table-md.table-card thead tr th:last-child,
20
+ &[class^=pb_table].table-md:not(.no-hover).table-card tbody tr td:last-child {
21
+ border-right-width: 0px;
22
+ }
23
+
24
+ &[class^=pb_table].table-lg.table-card thead tr th:last-child,
25
+ &[class^=pb_table].table-lg:not(.no-hover).table-card tbody tr td:last-child {
26
+ border-right-width: 0px;
27
+ }
4
28
  }
29
+ }
@@ -3,7 +3,6 @@
3
3
  [class^="pb_table"] {
4
4
  .sticky {
5
5
  position: sticky !important;
6
- left: 0;
7
6
  z-index: 1;
8
7
  background-color: white;
9
8
  }
@@ -1,4 +1,10 @@
1
- <%= content_tag(:div) do %>
1
+ <% if object.responsive_classname %>
2
+ <% responsive_class = object.responsive_classname %>
3
+ <% else %>
4
+ <% responsive_class = nil %>
5
+ <% end %>
6
+
7
+ <%= content_tag(:div, class: responsive_class) do %>
2
8
  <% if object.tag == "table" %>
3
9
  <%= content_tag(:table,
4
10
  aria: object.aria,
@@ -45,6 +45,10 @@ module Playbook
45
45
  )
46
46
  end
47
47
 
48
+ def responsive_classname
49
+ responsive ? "table-responsive-#{responsive}" : nil
50
+ end
51
+
48
52
  private
49
53
 
50
54
  def dark_class