playbook_ui 13.16.0.pre.alpha.powercentrainplaybookpt22125 → 13.17.0.pre.alpha.nodealphaupgrade2157

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_reset.scss +2 -2
  3. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +292 -3
  4. data/app/pb_kits/playbook/pb_button/_button.scss +3 -3
  5. data/app/pb_kits/playbook/pb_button/_button_mixins.scss +2 -3
  6. data/app/pb_kits/playbook/pb_caption/_caption_mixin.scss +1 -1
  7. data/app/pb_kits/playbook/pb_collapsible/_collapsible.scss +2 -2
  8. data/app/pb_kits/playbook/pb_dashboard/commonSettings.js +1 -1
  9. data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.ts +1 -1
  10. data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.ts +1 -1
  11. data/app/pb_kits/playbook/pb_date_picker/sass_partials/_flatpickr_styles.scss +1 -1
  12. data/app/pb_kits/playbook/pb_form_pill/_form_pill.scss +1 -1
  13. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_validation.html.erb +5 -7
  14. data/app/pb_kits/playbook/pb_popover/_popover.tsx +12 -14
  15. data/app/pb_kits/playbook/pb_popover/docs/_popover_actionable_content.html.erb +30 -0
  16. data/app/pb_kits/playbook/pb_popover/docs/_popover_actionable_content.jsx +57 -0
  17. data/app/pb_kits/playbook/pb_popover/docs/example.yml +2 -1
  18. data/app/pb_kits/playbook/pb_popover/docs/index.js +1 -0
  19. data/app/pb_kits/playbook/pb_popover/popover.test.js +29 -31
  20. data/app/pb_kits/playbook/pb_table/_table.tsx +3 -0
  21. data/app/pb_kits/playbook/pb_table/docs/_table_striped.html.erb +48 -0
  22. data/app/pb_kits/playbook/pb_table/docs/_table_striped.jsx +58 -0
  23. data/app/pb_kits/playbook/pb_table/docs/_table_striped.md +1 -0
  24. data/app/pb_kits/playbook/pb_table/docs/example.yml +2 -0
  25. data/app/pb_kits/playbook/pb_table/docs/index.js +1 -0
  26. data/app/pb_kits/playbook/pb_table/styles/_all.scss +1 -0
  27. data/app/pb_kits/playbook/pb_table/styles/_striped.scss +19 -0
  28. data/app/pb_kits/playbook/pb_table/table.rb +7 -1
  29. data/app/pb_kits/playbook/pb_table/table.test.js +5 -0
  30. data/app/pb_kits/playbook/tokens/_typography.scss +10 -10
  31. data/dist/menu.yml +102 -3
  32. data/dist/playbook-rails.js +7 -7
  33. data/dist/reset.css +1 -2
  34. data/lib/playbook/version.rb +2 -2
  35. metadata +8 -2
@@ -12,9 +12,9 @@ const PopoverTest = () => {
12
12
  }
13
13
 
14
14
  const popoverReference = (
15
- <Button onClick={togglePopover}
15
+ <Button onClick={togglePopover}
16
16
  text="Click Me"
17
- />
17
+ />
18
18
  );
19
19
  return (
20
20
  <PbReactPopover
@@ -34,9 +34,9 @@ const PopoverTestZIndex = () => {
34
34
  }
35
35
 
36
36
  const popoverReference = (
37
- <Button onClick={togglePopover}
37
+ <Button onClick={togglePopover}
38
38
  text="Click Me"
39
- />
39
+ />
40
40
  );
41
41
  return (
42
42
  <PbReactPopover
@@ -58,9 +58,9 @@ const PopoverTestHeight = () => {
58
58
  }
59
59
 
60
60
  const popoverReference = (
61
- <Button onClick={togglePopover}
61
+ <Button onClick={togglePopover}
62
62
  text="Click Me"
63
- />
63
+ />
64
64
  );
65
65
  return (
66
66
  <PbReactPopover
@@ -75,7 +75,7 @@ const PopoverTestHeight = () => {
75
75
  )
76
76
  };
77
77
 
78
- //Test Popover with click to close 'anywhere'
78
+ //Test Popover with click to close 'anywhere'
79
79
  const PopoverTestClicktoClose = () => {
80
80
  const [mockState, setMockState] = React.useState(false)
81
81
  const togglePopover = () => {
@@ -86,9 +86,9 @@ const PopoverTestClicktoClose = () => {
86
86
  }
87
87
 
88
88
  const popoverReference = (
89
- <Button onClick={togglePopover}
89
+ <Button onClick={togglePopover}
90
90
  text="Click Me"
91
- />
91
+ />
92
92
  );
93
93
  return (
94
94
  <PbReactPopover
@@ -103,7 +103,7 @@ const PopoverTestClicktoClose = () => {
103
103
  )
104
104
  };
105
105
 
106
- //Test Popover with click to close 'inside'
106
+ //Test Popover with click to close 'inside'
107
107
  const PopoverTestClicktoClose2 = () => {
108
108
  const [mockState, setMockState] = React.useState(false)
109
109
  const togglePopover = () => {
@@ -114,9 +114,9 @@ const PopoverTestClicktoClose2 = () => {
114
114
  }
115
115
 
116
116
  const popoverReference = (
117
- <Button onClick={togglePopover}
117
+ <Button onClick={togglePopover}
118
118
  text="Click Me"
119
- />
119
+ />
120
120
  );
121
121
  return (
122
122
  <PbReactPopover
@@ -131,7 +131,7 @@ const PopoverTestClicktoClose2 = () => {
131
131
  )
132
132
  };
133
133
 
134
- //Test Popover with click to close 'outside'
134
+ //Test Popover with click to close 'outside'
135
135
  const PopoverTestClicktoClose3 = () => {
136
136
  const [mockState, setMockState] = React.useState(false)
137
137
  const togglePopover = () => {
@@ -142,9 +142,9 @@ const PopoverTestClicktoClose3 = () => {
142
142
  }
143
143
 
144
144
  const popoverReference = (
145
- <Button onClick={togglePopover}
145
+ <Button onClick={togglePopover}
146
146
  text="Click Me"
147
- />
147
+ />
148
148
  );
149
149
  return (
150
150
  <PbReactPopover
@@ -165,7 +165,7 @@ const PopoverTestClicktoClose3 = () => {
165
165
  const btn = screen.getByText(/click me/i)
166
166
  fireEvent.click(btn);
167
167
  const kit = screen.getByText("Click Anywhere");
168
- expect(kit).toBeInTheDocument();
168
+ expect(kit).toBeInTheDocument();
169
169
  });
170
170
 
171
171
  test("renders Popover with z index", () => {
@@ -173,7 +173,7 @@ const PopoverTestClicktoClose3 = () => {
173
173
  const btn = screen.getByText(/click me/i)
174
174
  fireEvent.click(btn);
175
175
  const kit = screen.getByText("Click Anywhere");
176
- expect(kit).toHaveClass("pb_popover_body z_index_3");
176
+ expect(kit).toHaveClass("pb_popover_body z_index_3");
177
177
  });
178
178
 
179
179
  test("renders Popover with max height and max width", () => {
@@ -181,42 +181,40 @@ const PopoverTestClicktoClose3 = () => {
181
181
  const btn = screen.getByText(/click me/i)
182
182
  fireEvent.click(btn);
183
183
  const kit = screen.getByText("Click Anywhere");
184
- expect(kit).toHaveClass("pb_popover_body max_width_240px overflow_handling");
184
+ expect(kit).toHaveClass("pb_popover_body max_width_240px overflow_handling");
185
185
  });
186
186
 
187
- test("closes Popover on click anywhere", () => {
187
+ test("closes Popover on click anywhere", async () => {
188
188
  render(<PopoverTestClicktoClose data={{ testid: testId}}/>)
189
189
  const btn = screen.getByText(/click me/i)
190
190
  fireEvent.click(btn);
191
191
  const kit = screen.getByText("Click Anywhere");
192
- expect(kit).toBeInTheDocument();
193
- fireEvent.click(kit);
194
-
195
- expect(kit).not.toBeInTheDocument();
192
+ expect(kit).toBeInTheDocument();
193
+ fireEvent.click(document.body);
196
194
 
195
+ expect(kit).not.toBeInTheDocument;
197
196
  });
198
197
 
199
- test("closes Popover on click inside", () => {
198
+ test("closes Popover on click inside", async () => {
200
199
  render(<PopoverTestClicktoClose2 data={{ testid: testId}}/>)
201
200
  const btn = screen.getByText(/click me/i)
202
201
  fireEvent.click(btn);
203
202
  const kit = screen.getByText("Click Inside");
204
- expect(kit).toBeInTheDocument();
203
+ expect(kit).toBeInTheDocument();
205
204
  fireEvent.click(kit);
206
-
207
- expect(kit).not.toBeInTheDocument();
208
205
 
206
+ expect(kit).not.toBeInTheDocument;
209
207
  });
210
208
 
211
- test("closes Popover on click outside", () => {
209
+ test("closes Popover on click outside", async () => {
212
210
  render(<PopoverTestClicktoClose3 data={{ testid: testId}}/>)
213
211
  const btn = screen.getByText(/click me/i)
214
212
  fireEvent.click(btn);
215
213
  const kit = screen.getByText("Click Outside");
216
- expect(kit).toBeInTheDocument();
214
+ expect(kit).toBeInTheDocument();
217
215
  fireEvent.click(kit);
218
- expect(kit).toBeInTheDocument();
216
+ expect(kit).toBeInTheDocument();
219
217
  fireEvent.click(btn);
220
- expect(kit).not.toBeInTheDocument();
221
218
 
219
+ expect(kit).not.toBeInTheDocument;
222
220
  });
@@ -20,6 +20,7 @@ type TableProps = {
20
20
  singleLine?: boolean,
21
21
  size?: "sm" | "md" | "lg",
22
22
  sticky?: boolean,
23
+ striped?: boolean,
23
24
  verticalBorder?: boolean,
24
25
  } & GlobalProps
25
26
 
@@ -40,6 +41,7 @@ const Table = (props: TableProps) => {
40
41
  singleLine = false,
41
42
  size = 'sm',
42
43
  sticky = false,
44
+ striped = false,
43
45
  verticalBorder = false,
44
46
  } = props
45
47
 
@@ -70,6 +72,7 @@ const Table = (props: TableProps) => {
70
72
  'single-line': singleLine,
71
73
  'no-hover': disableHover,
72
74
  'sticky-header': sticky,
75
+ 'striped': striped,
73
76
  },
74
77
  globalProps(props),
75
78
  tableCollapseCss,
@@ -0,0 +1,48 @@
1
+ <%= pb_rails("table", props: { size: "sm", striped: true }) do %>
2
+ <thead>
3
+ <tr>
4
+ <th>Column 1</th>
5
+ <th>Column 2</th>
6
+ <th>Column 3</th>
7
+ <th>Column 4</th>
8
+ <th>Column 5</th>
9
+ </tr>
10
+ </thead>
11
+ <tbody>
12
+ <tr>
13
+ <td>Value 1</td>
14
+ <td>Value 2</td>
15
+ <td>Value 3</td>
16
+ <td>Value 4</td>
17
+ <td>Value 5</td>
18
+ </tr>
19
+ <tr>
20
+ <td>Value 1</td>
21
+ <td>Value 2</td>
22
+ <td>Value 3</td>
23
+ <td>Value 4</td>
24
+ <td>Value 5</td>
25
+ </tr>
26
+ <tr>
27
+ <td>Value 1</td>
28
+ <td>Value 2</td>
29
+ <td>Value 3</td>
30
+ <td>Value 4</td>
31
+ <td>Value 5</td>
32
+ </tr>
33
+ <tr>
34
+ <td>Value 1</td>
35
+ <td>Value 2</td>
36
+ <td>Value 3</td>
37
+ <td>Value 4</td>
38
+ <td>Value 5</td>
39
+ </tr>
40
+ <tr>
41
+ <td>Value 1</td>
42
+ <td>Value 2</td>
43
+ <td>Value 3</td>
44
+ <td>Value 4</td>
45
+ <td>Value 5</td>
46
+ </tr>
47
+ </tbody>
48
+ <% end %>
@@ -0,0 +1,58 @@
1
+ import React from "react"
2
+ import Table from "../_table"
3
+
4
+ const TableStriped = (props) => (
5
+ <Table
6
+ striped
7
+ {...props}
8
+ >
9
+ <thead>
10
+ <tr>
11
+ <th>{'Column 1'}</th>
12
+ <th>{'Column 2'}</th>
13
+ <th>{'Column 3'}</th>
14
+ <th>{'Column 4'}</th>
15
+ <th>{'Column 5'}</th>
16
+ </tr>
17
+ </thead>
18
+ <tbody>
19
+ <tr>
20
+ <td>{'Value 1'}</td>
21
+ <td>{'Value 2'}</td>
22
+ <td>{'Value 3'}</td>
23
+ <td>{'Value 4'}</td>
24
+ <td>{'Value 5'}</td>
25
+ </tr>
26
+ <tr>
27
+ <td>{'Value 1'}</td>
28
+ <td>{'Value 2'}</td>
29
+ <td>{'Value 3'}</td>
30
+ <td>{'Value 4'}</td>
31
+ <td>{'Value 5'}</td>
32
+ </tr>
33
+ <tr>
34
+ <td>{'Value 1'}</td>
35
+ <td>{'Value 2'}</td>
36
+ <td>{'Value 3'}</td>
37
+ <td>{'Value 4'}</td>
38
+ <td>{'Value 5'}</td>
39
+ </tr>
40
+ <tr>
41
+ <td>{'Value 1'}</td>
42
+ <td>{'Value 2'}</td>
43
+ <td>{'Value 3'}</td>
44
+ <td>{'Value 4'}</td>
45
+ <td>{'Value 5'}</td>
46
+ </tr>
47
+ <tr>
48
+ <td>{'Value 1'}</td>
49
+ <td>{'Value 2'}</td>
50
+ <td>{'Value 3'}</td>
51
+ <td>{'Value 4'}</td>
52
+ <td>{'Value 5'}</td>
53
+ </tr>
54
+ </tbody>
55
+ </Table>
56
+ )
57
+
58
+ export default TableStriped
@@ -0,0 +1 @@
1
+ Optionally pass the `striped` (boolean, defaults to false) prop to set odd rows to a contrasting background color. This helps with readability on larger tables with lots of data.
@@ -23,6 +23,7 @@ examples:
23
23
  - table_icon_buttons: Table with Icon Buttons
24
24
  - table_with_background_kit: Table With Background Kit
25
25
  - table_vertical_border: Vertical Borders
26
+ - table_striped: Striped Table
26
27
 
27
28
  react:
28
29
  - table_sm: Small
@@ -47,3 +48,4 @@ examples:
47
48
  - table_icon_buttons: Table with Icon Buttons
48
49
  - table_with_background_kit: Table With Background Kit
49
50
  - table_vertical_border: Vertical Borders
51
+ - table_striped: Striped Table
@@ -20,3 +20,4 @@ export { default as TableAlignmentShiftRow } from './_table_alignment_shift_row.
20
20
  export { default as TableAlignmentShiftData } from './_table_alignment_shift_data.jsx'
21
21
  export { default as TableWithBackgroundKit } from './_table_with_background_kit.jsx'
22
22
  export { default as TableVerticalBorder } from './_table_vertical_border.jsx'
23
+ export { default as TableStriped } from './_table_striped.jsx'
@@ -18,3 +18,4 @@
18
18
  @import "sticky_header";
19
19
  @import "vertical_border";
20
20
  @import "table_header";
21
+ @import "striped";
@@ -0,0 +1,19 @@
1
+ [class^=pb_table] {
2
+ &.striped {
3
+ tbody {
4
+ tr:nth-child(odd) {
5
+ background-color: $bg_light;
6
+ }
7
+ }
8
+ }
9
+
10
+ &.dark {
11
+ &.striped {
12
+ tbody {
13
+ tr:nth-child(odd) {
14
+ background-color: $bg_dark;
15
+ }
16
+ }
17
+ }
18
+ }
19
+ }
@@ -25,12 +25,14 @@ module Playbook
25
25
  default: false
26
26
  prop :vertical_border, type: Playbook::Props::Boolean,
27
27
  default: false
28
+ prop :striped, type: Playbook::Props::Boolean,
29
+ default: false
28
30
 
29
31
  def classname
30
32
  generate_classname(
31
33
  "pb_table", "table-#{size}", single_line_class, dark_class,
32
34
  disable_hover_class, container_class, data_table_class, sticky_class, collapse_class,
33
- vertical_border_class, "table-responsive-#{responsive}", separator: " "
35
+ vertical_border_class, striped_class, "table-responsive-#{responsive}", separator: " "
34
36
  )
35
37
  end
36
38
 
@@ -64,6 +66,10 @@ module Playbook
64
66
  sticky ? "sticky-header" : nil
65
67
  end
66
68
 
69
+ def striped_class
70
+ striped ? "striped" : nil
71
+ end
72
+
67
73
  def vertical_border_class
68
74
  vertical_border ? "vertical-border" : nil
69
75
  end
@@ -15,3 +15,8 @@ test("when sticky is true", () => {
15
15
  const kit = renderKit(Table, props, { sticky: true })
16
16
  expect(kit).toHaveClass("pb_table table-sm table-responsive-collapse table-card sticky-header table-collapse-sm")
17
17
  })
18
+
19
+ test("when striped is true", () => {
20
+ const kit = renderKit(Table, props, { striped: true })
21
+ expect(kit).toHaveClass("pb_table table-sm table-responsive-collapse table-card striped table-collapse-sm")
22
+ })
@@ -1,11 +1,11 @@
1
- $font_family_base: "Power Centra", "Helvetica Neue", Helvetica, Arial, sans_serif !default;
1
+ $font_family_base: "Proxima Nova", "Helvetica Neue", Helvetica, Arial, sans_serif !default;
2
2
 
3
3
  /* CLEAN UP AND REMOVE */
4
4
  $font_jumbo: 36px !default;
5
5
  $font_largest: 32px !default;
6
- $font_larger: 27px !default;
6
+ $font_larger: 28px !default;
7
7
  $font_large: 20px !default;
8
- $font_base: 15.5px !default;
8
+ $font_base: 16px !default;
9
9
  $font_default: $font_base !default;
10
10
  $font_normal: $font_base !default;
11
11
  $font_medium: $font_base !default;
@@ -26,8 +26,8 @@ $text_smaller: $font_smaller !default;
26
26
  $text_smallest: $font_smallest !default;
27
27
 
28
28
  /* Headings */
29
- $heading_1: 44px !default;
30
- $heading_2: 32px !default;
29
+ $heading_1: 46px !default;
30
+ $heading_2: 34px !default;
31
31
  $heading_3: $font_larger !default;
32
32
  $heading_4: $font_base !default;
33
33
 
@@ -35,19 +35,19 @@ $heading_4: $font_base !default;
35
35
  $lspace_tightest: -.1em !default;
36
36
  $lspace_tighter: -.07em !default;
37
37
  $lspace_tight: -.01em !default;
38
- $lspace_normal: .003em !default;
38
+ $lspace_normal: 0 !default;
39
39
  $lspace_loose: .03em !default;
40
40
  $lspace_looser: .07em !default;
41
41
  $lspace_loosest: .1em !default;
42
42
  $lspace_super_loosest: .2em !default;
43
43
 
44
44
  /* Standard Font Weights */
45
- $bold: 700 !default;
45
+ $bold: 600 !default;
46
46
  $regular: 400 !default;
47
47
 
48
48
  /* Non_Standard Font Weights */
49
- $extrabold: 700 !default;
50
- $boldest: 700 !default;
49
+ $extrabold: 900 !default;
50
+ $boldest: 800 !default;
51
51
  $bolder: 700 !default;
52
52
  $light: 300 !default;
53
- $lighter: 300 !default;
53
+ $lighter: 100 !default;