playbook_ui 14.7.0.pre.rc.19 → 14.8.0.pre.alpha.PBNTR713dropdowncustomtriggerbug4696

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +1 -0
  3. data/app/pb_kits/playbook/pb_card/docs/_card_light.md +1 -1
  4. data/app/pb_kits/playbook/pb_checkbox/checkbox.html.erb +2 -2
  5. data/app/pb_kits/playbook/pb_checkbox/checkbox.rb +0 -4
  6. data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_indeterminate.html.erb +84 -7
  7. data/app/pb_kits/playbook/pb_date/_date.scss +3 -0
  8. data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +1 -1
  9. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_default_date.html.erb +42 -0
  10. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_default_date.jsx +44 -0
  11. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_default_date.md +1 -0
  12. data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +2 -0
  13. data/app/pb_kits/playbook/pb_date_picker/docs/index.js +1 -0
  14. data/app/pb_kits/playbook/pb_date_picker/plugins/quickPick.tsx +17 -1
  15. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_default_rails.html.erb +26 -0
  16. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_default_rails.md +7 -0
  17. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards_rails.html.erb +38 -0
  18. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards_rails.md +0 -0
  19. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_list_rails.html.erb +19 -0
  20. data/app/pb_kits/playbook/pb_draggable/docs/example.yml +6 -0
  21. data/app/pb_kits/playbook/pb_draggable/draggable.html.erb +3 -0
  22. data/app/pb_kits/playbook/pb_draggable/draggable.rb +18 -0
  23. data/app/pb_kits/playbook/pb_draggable/draggable_container.html.erb +3 -0
  24. data/app/pb_kits/playbook/pb_draggable/draggable_container.rb +15 -0
  25. data/app/pb_kits/playbook/pb_draggable/draggable_item.html.erb +7 -0
  26. data/app/pb_kits/playbook/pb_draggable/draggable_item.rb +18 -0
  27. data/app/pb_kits/playbook/pb_draggable/index.js +125 -0
  28. data/app/pb_kits/playbook/pb_drawer/_drawer.scss +88 -175
  29. data/app/pb_kits/playbook/pb_drawer/_drawer.tsx +79 -47
  30. data/app/pb_kits/playbook/pb_drawer/drawer.test.jsx +20 -16
  31. data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +1 -0
  32. data/app/pb_kits/playbook/pb_dropdown/dropdown_container.html.erb +0 -1
  33. data/app/pb_kits/playbook/pb_dropdown/dropdown_container.rb +0 -4
  34. data/app/pb_kits/playbook/pb_dropdown/utilities/subComponentHelper.tsx +13 -2
  35. data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +2 -2
  36. data/app/pb_kits/playbook/pb_form/docs/_form_form_with_loading.html.erb +1 -1
  37. data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +63 -12
  38. data/app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_default.html.erb +2 -1
  39. data/app/pb_kits/playbook/pb_table/_table.tsx +103 -24
  40. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns.jsx +87 -0
  41. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns_react.md +2 -0
  42. data/app/pb_kits/playbook/pb_table/docs/index.js +1 -0
  43. data/app/pb_kits/playbook/pb_table/styles/_all.scss +2 -0
  44. data/app/pb_kits/playbook/pb_table/styles/_scroll.scss +4 -0
  45. data/app/pb_kits/playbook/pb_table/styles/_sticky_columns.scss +18 -0
  46. data/app/pb_kits/playbook/pb_timeline/_timeline.scss +43 -1
  47. data/app/pb_kits/playbook/pb_timeline/_timeline.tsx +6 -2
  48. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_children.html.erb +47 -0
  49. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_children.jsx +59 -0
  50. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_gap.html.erb +94 -0
  51. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_gap.jsx +180 -0
  52. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_gap.md +1 -0
  53. data/app/pb_kits/playbook/pb_timeline/docs/example.yml +5 -3
  54. data/app/pb_kits/playbook/pb_timeline/docs/index.js +2 -0
  55. data/app/pb_kits/playbook/pb_timeline/timeline.rb +11 -1
  56. data/app/pb_kits/playbook/pb_timeline/timeline.test.js +4 -4
  57. data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +3 -0
  58. data/app/pb_kits/playbook/pb_typeahead/index.ts +29 -3
  59. data/app/pb_kits/playbook/pb_typeahead/typeahead.html.erb +5 -2
  60. data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +4 -0
  61. data/app/pb_kits/playbook/tokens/_height.scss +19 -0
  62. data/app/pb_kits/playbook/tokens/exports/_height.module.scss +37 -0
  63. data/app/pb_kits/playbook/utilities/_height.scss +33 -0
  64. data/app/pb_kits/playbook/utilities/_hover.scss +40 -27
  65. data/app/pb_kits/playbook/utilities/_max_width.scss +4 -0
  66. data/app/pb_kits/playbook/utilities/_min_width.scss +1 -1
  67. data/app/pb_kits/playbook/utilities/globalPropNames.mjs +0 -1
  68. data/app/pb_kits/playbook/utilities/globalProps.ts +29 -3
  69. data/app/pb_kits/playbook/utilities/test/globalProps/hover.test.js +79 -0
  70. data/dist/chunks/_typeahead-C8Q_fFYF.js +22 -0
  71. data/dist/chunks/_weekday_stacked-CUJfwh5E.js +45 -0
  72. data/dist/chunks/{lib-D-mTv-kp.js → lib-SyD3buPZ.js} +1 -1
  73. data/dist/chunks/{pb_form_validation-BkWGwJsl.js → pb_form_validation-Dt8UJgrJ.js} +1 -1
  74. data/dist/chunks/vendor.js +1 -1
  75. data/dist/menu.yml +322 -1
  76. data/dist/playbook-doc.js +1 -1
  77. data/dist/playbook-rails-react-bindings.js +1 -1
  78. data/dist/playbook-rails.js +1 -1
  79. data/dist/playbook.css +1 -1
  80. data/lib/playbook/classnames.rb +3 -0
  81. data/lib/playbook/forms/builder/typeahead_field.rb +13 -0
  82. data/lib/playbook/height.rb +29 -0
  83. data/lib/playbook/hover.rb +1 -1
  84. data/lib/playbook/kit_base.rb +16 -1
  85. data/lib/playbook/max_height.rb +29 -0
  86. data/lib/playbook/min_height.rb +29 -0
  87. data/lib/playbook/version.rb +2 -2
  88. metadata +35 -6
  89. data/dist/chunks/_typeahead-DhLic2Fe.js +0 -22
  90. data/dist/chunks/_weekday_stacked-Mx8TYP5I.js +0 -45
@@ -21,34 +21,47 @@
21
21
  }
22
22
 
23
23
  @mixin hover-color-classes($colors-list) {
24
- @each $name, $color in $colors-list {
25
- .hover_background_#{"" + $name}:hover,
26
- .group_hover:hover .group_hover.hover_background_#{"" + $name} {
27
- background-color: $color !important;
28
- transition: background-color $transition-speed ease;
29
- }
30
- .hover_color_#{"" + $name}:hover,
31
- .group_hover:hover .group_hover.hover_color_#{"" + $name} {
32
- color: $color !important;
33
- transition: color $transition-speed ease;
24
+ @each $name, $color in $colors-list {
25
+ .hover_background-#{"" + $name}:hover {
26
+ background-color: $color !important;
27
+ transition: background-color $transition-speed ease;
28
+ }
29
+ .hover_color-#{"" + $name}:hover {
30
+ color: $color !important;
31
+ transition: color $transition-speed ease;
32
+ }
34
33
  }
35
34
  }
35
+
36
+ @include hover-scale-classes($scales);
37
+ @include hover-shadow-classes($box_shadows);
38
+ @include hover-color-classes($product_colors);
39
+ @include hover-color-classes($status_colors);
40
+ @include hover-color-classes($data_colors);
41
+ @include hover-color-classes($shadow_colors);
42
+ @include hover-color-classes($colors);
43
+ @include hover-color-classes($interface_colors);
44
+ @include hover-color-classes($main_colors);
45
+ @include hover-color-classes($background_colors);
46
+ @include hover-color-classes($card_colors);
47
+ @include hover-color-classes($active_colors);
48
+ @include hover-color-classes($action_colors);
49
+ @include hover-color-classes($hover_colors);
50
+ @include hover-color-classes($border_colors);
51
+ @include hover-color-classes($text_colors);
52
+ @include hover-color-classes($category_colors);
53
+
54
+ .hover_visibility {
55
+ opacity: 0;
56
+ transition: opacity $transition-speed ease;
57
+
58
+ &:hover {
59
+ opacity: 1;
60
+ }
36
61
  }
37
62
 
38
- @include hover-scale-classes($scales);
39
- @include hover-shadow-classes($box_shadows);
40
- @include hover-color-classes($product_colors);
41
- @include hover-color-classes($status_colors);
42
- @include hover-color-classes($data_colors);
43
- @include hover-color-classes($shadow_colors);
44
- @include hover-color-classes($colors);
45
- @include hover-color-classes($interface_colors);
46
- @include hover-color-classes($main_colors);
47
- @include hover-color-classes($background_colors);
48
- @include hover-color-classes($card_colors);
49
- @include hover-color-classes($active_colors);
50
- @include hover-color-classes($action_colors);
51
- @include hover-color-classes($hover_colors);
52
- @include hover-color-classes($border_colors);
53
- @include hover-color-classes($text_colors);
54
- @include hover-color-classes($category_colors);
63
+ .group_hover:hover {
64
+ .group_hover.hover_visibility {
65
+ opacity: 1;
66
+ }
67
+ }
@@ -27,3 +27,7 @@
27
27
  .max_width_xxl {
28
28
  max-width: 1320px;
29
29
  }
30
+
31
+ .width-resize {
32
+ resize: horizontal;
33
+ }
@@ -40,6 +40,6 @@
40
40
  min-width: $container_100;
41
41
  }
42
42
 
43
- .minwidth-resize {
43
+ .width-resize {
44
44
  resize: horizontal;
45
45
  }
@@ -7,7 +7,6 @@ export default [
7
7
  "right",
8
8
  "top",
9
9
  "hover",
10
- "groupHover",
11
10
  "zIndex",
12
11
  "verticalAlign",
13
12
  "truncate",
@@ -63,7 +63,8 @@ type FlexWrap = {
63
63
  type Hover = Shadow & {
64
64
  background?: string,
65
65
  color?: string,
66
- scale?: "sm" | "md" | "lg"
66
+ scale?: "sm" | "md" | "lg",
67
+ visibility?: boolean,
67
68
  }
68
69
 
69
70
  type GroupHover = {
@@ -230,9 +231,10 @@ const PROP_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => string} =
230
231
  let css = '';
231
232
  if (!hover) return css;
232
233
  css += hover.shadow ? `hover_shadow_${hover.shadow} ` : '';
233
- css += hover.background ? `hover_background_${hover.background } ` : '';
234
+ css += hover.background ? `hover_background-${hover.background } ` : '';
234
235
  css += hover.scale ? `hover_scale_${hover.scale} ` : '';
235
- css += hover.color ? `hover_color_${hover.color } ` : '';
236
+ css += hover.color ? `hover_color-${hover.color } ` : '';
237
+ css += hover.visibility ? `hover_visibility` : '';
236
238
  return css;
237
239
  },
238
240
 
@@ -359,6 +361,30 @@ const PROP_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => string} =
359
361
  css += maxWidth ? `max_width_${filterClassName(maxWidth)} ` : ''
360
362
  return css.trimEnd()
361
363
  },
364
+ minHeightProps: ({ minHeight }: MinHeight) => {
365
+ const heightValues = ["auto", "xs", "sm", "md", "lg", "xl", "xxl", "xxxl"]
366
+ if (heightValues.includes(minHeight)) {
367
+ let css = ''
368
+ css += minHeight ? `min_height_${filterClassName(minHeight)} ` : ''
369
+ return css.trimEnd()
370
+ }
371
+ },
372
+ maxHeightProps: ({ maxHeight }: MaxHeight) => {
373
+ const heightValues = ["auto", "xs", "sm", "md", "lg", "xl", "xxl", "xxxl"]
374
+ if (heightValues.includes(maxHeight)) {
375
+ let css = ''
376
+ css += maxHeight ? `max_height_${filterClassName(maxHeight)} ` : ''
377
+ return css.trimEnd()
378
+ }
379
+ },
380
+ heightProps: ({ height }: Height) => {
381
+ const heightValues = ["auto", "xs", "sm", "md", "lg", "xl", "xxl", "xxxl"]
382
+ if (heightValues.includes(height)) {
383
+ let css = ''
384
+ css += height ? `height_${filterClassName(height)} ` : ''
385
+ return css.trimEnd()
386
+ }
387
+ },
362
388
  zIndexProps: (zIndex: ZIndex) => {
363
389
  let css = ''
364
390
  Object.entries(zIndex).forEach((zIndexEntry) => {
@@ -0,0 +1,79 @@
1
+ import React from 'react';
2
+ import { render, screen } from '../../test-utils';
3
+ import Body from '../../../pb_body/_body';
4
+
5
+ const testSubject = 'body';
6
+
7
+ test('Hover Props: returns proper class name', () => {
8
+ const testIdColor = `${testSubject}-hover-color-red`;
9
+ render(
10
+ <Body
11
+ data={{ testid: testIdColor }}
12
+ hover={{ color: 'red' }}
13
+ text="Hi"
14
+ />
15
+ );
16
+
17
+ let kit = screen.getByTestId(testIdColor);
18
+ let expectedClassName = `hover_color-red`;
19
+ expect(kit).toHaveClass(expectedClassName);
20
+
21
+ const testIdBackground = `${testSubject}-hover-background-blue`;
22
+ render(
23
+ <Body
24
+ data={{ testid: testIdBackground }}
25
+ hover={{ background: 'blue' }}
26
+ text="Hi"
27
+ />
28
+ );
29
+
30
+ kit = screen.getByTestId(testIdBackground);
31
+ expectedClassName = `hover_background-blue`;
32
+ expect(kit).toHaveClass(expectedClassName);
33
+
34
+ const testIdShadow = `${testSubject}-hover-shadow-deep`;
35
+ render(
36
+ <Body
37
+ data={{ testid: testIdShadow }}
38
+ hover={{ shadow: 'deep' }}
39
+ text="Hi"
40
+ />
41
+ );
42
+
43
+ kit = screen.getByTestId(testIdShadow);
44
+ expectedClassName = `hover_shadow_deep`;
45
+ expect(kit).toHaveClass(expectedClassName);
46
+
47
+ const testIdScale = `${testSubject}-hover-scale`;
48
+ render(
49
+ <Body
50
+ data={{ testid: testIdScale }}
51
+ hover={{ scale: 'xl' }}
52
+ text="Test"
53
+ />
54
+ );
55
+
56
+ kit = screen.getByTestId(testIdScale);
57
+ expectedClassName = `hover_scale_xl`;
58
+ expect(kit).toHaveClass(expectedClassName);
59
+
60
+ const testIdMultiple = `${testSubject}-hover-multiple`;
61
+ render(
62
+ <Body
63
+ data={{ testid: testIdMultiple }}
64
+ hover={{
65
+ color: 'green',
66
+ background: 'error',
67
+ shadow: 'deeper',
68
+ scale: 'xl',
69
+ }}
70
+ text="Hi"
71
+ />
72
+ );
73
+
74
+ kit = screen.getByTestId(testIdMultiple);
75
+ expect(kit).toHaveClass('hover_color-green');
76
+ expect(kit).toHaveClass('hover_background-error');
77
+ expect(kit).toHaveClass('hover_shadow_deeper');
78
+ expect(kit).toHaveClass('hover_scale_xl');
79
+ });