playbook_ui 13.30.0.pre.alpha.PLAY1328fixtimelinekitglobalpropsreact3096 → 13.30.0.pre.alpha.20240515remotebuildkitconversion3150

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_sort.html.erb +59 -0
  3. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_sort.md +6 -0
  4. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +3 -2
  5. data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +4 -4
  6. data/app/pb_kits/playbook/pb_card/_card.tsx +4 -3
  7. data/app/pb_kits/playbook/pb_collapsible/index.js +6 -1
  8. data/app/pb_kits/playbook/pb_date_time_stacked/docs/_date_time_stacked_default_swift.md +33 -0
  9. data/app/pb_kits/playbook/pb_date_time_stacked/docs/_date_time_stacked_props_swift.md +18 -0
  10. data/app/pb_kits/playbook/pb_date_time_stacked/docs/example.yml +6 -1
  11. data/app/pb_kits/playbook/pb_draggable/_draggable.scss +2 -4
  12. data/app/pb_kits/playbook/pb_draggable/context/index.tsx +70 -50
  13. data/app/pb_kits/playbook/pb_draggable/context/types.ts +26 -0
  14. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_default.jsx +2 -1
  15. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_default.md +1 -1
  16. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers.jsx +5 -1
  17. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards.jsx +11 -4
  18. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards.md +4 -2
  19. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_list.jsx +2 -2
  20. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_list.md +7 -1
  21. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_selectable_list.jsx +6 -4
  22. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_selectable_list.md +7 -0
  23. data/app/pb_kits/playbook/pb_draggable/draggable.test.jsx +142 -15
  24. data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableItem.tsx +6 -5
  25. data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +18 -0
  26. data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +228 -218
  27. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.html.erb +9 -0
  28. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx +34 -0
  29. data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +2 -0
  30. data/app/pb_kits/playbook/pb_dropdown/docs/index.js +2 -1
  31. data/app/pb_kits/playbook/pb_dropdown/dropdown.html.erb +14 -12
  32. data/app/pb_kits/playbook/pb_dropdown/dropdown.rb +7 -0
  33. data/app/pb_kits/playbook/pb_dropdown/dropdown.test.jsx +17 -2
  34. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.tsx +9 -3
  35. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_custom_icon.html.erb +32 -0
  36. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_custom_icon.jsx +48 -0
  37. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/example.yml +2 -0
  38. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/index.js +1 -0
  39. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb +16 -11
  40. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.test.js +72 -0
  41. data/app/pb_kits/playbook/pb_icon/_icon.tsx +37 -6
  42. data/app/pb_kits/playbook/pb_icon/docs/_icon_default.html.erb +6 -1
  43. data/app/pb_kits/playbook/pb_icon/docs/_icon_default.jsx +21 -5
  44. data/app/pb_kits/playbook/pb_icon/icon.rb +21 -1
  45. data/app/pb_kits/playbook/pb_icon/icon_aliases.json +39 -0
  46. data/app/pb_kits/playbook/pb_icon/types.d.ts +1 -0
  47. data/app/pb_kits/playbook/pb_list/_list.tsx +4 -4
  48. data/app/pb_kits/playbook/pb_list/_list_item.tsx +7 -3
  49. data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav.html.erb +1 -1
  50. data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav.jsx +1 -0
  51. data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav.md +3 -1
  52. data/app/pb_kits/playbook/pb_nav/item.html.erb +1 -1
  53. data/app/pb_kits/playbook/pb_nav/item.rb +1 -0
  54. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_default.html.erb +24 -0
  55. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_default.md +4 -4
  56. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_multi_directional.html.erb +11 -0
  57. data/app/pb_kits/playbook/pb_overlay/docs/example.yml +4 -0
  58. data/app/pb_kits/playbook/pb_overlay/overlay.html.erb +27 -0
  59. data/app/pb_kits/playbook/pb_overlay/overlay.rb +110 -0
  60. data/app/pb_kits/playbook/pb_selectable_list/_item.tsx +7 -3
  61. data/app/pb_kits/playbook/pb_selectable_list/_selectable_list.tsx +3 -3
  62. data/app/pb_kits/playbook/pb_table/table_header.html.erb +16 -2
  63. data/app/pb_kits/playbook/utilities/globalProps.ts +1 -0
  64. data/dist/menu.yml +2 -2
  65. data/dist/playbook-rails.js +7 -7
  66. data/lib/playbook/version.rb +1 -1
  67. metadata +19 -2
@@ -2,3 +2,7 @@ examples:
2
2
  react:
3
3
  - overlay_default: Default
4
4
  - overlay_multi_directional: Multi-directional
5
+
6
+ rails:
7
+ - overlay_default: Default
8
+ - overlay_multi_directional: Multi-directional
@@ -0,0 +1,27 @@
1
+ <%= pb_content_tag(:div,
2
+ aria: object.aria,
3
+ class: object.classname,
4
+ data: object.data,
5
+ id: object.id,
6
+ **combined_html_options) do %>
7
+ <% if is_size_percentage %>
8
+ <div class="overlay_linear_gradient"
9
+ style="background: <%= previous_overlay %>"></div>
10
+
11
+ <%= content.presence %>
12
+
13
+ <% if has_subsequent_overlay %>
14
+ <div class="overlay_linear_gradient"
15
+ style="background: <%= subsequent_overlay %>"></div>
16
+ <% end %>
17
+
18
+ <% else %>
19
+ <div class="<%= previous_overlay_class_name %>"></div>
20
+
21
+ <%= content.presence %>
22
+
23
+ <% if has_subsequent_overlay %>
24
+ <div class="<%= subsequent_overlay_class_name %>"></div>
25
+ <% end %>
26
+ <% end %>
27
+ <% end %>
@@ -0,0 +1,110 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Playbook
4
+ module PbOverlay
5
+ class Overlay < Playbook::KitBase
6
+ prop :color, type: Playbook::Props::Enum,
7
+ values: %w[card_light bg_light card_dark bg_dark],
8
+ default: "card_light"
9
+ prop :layout, type: Playbook::Props::HashProp,
10
+ default: { "bottom": "full" }
11
+
12
+ def classname
13
+ generate_classname("pb_overlay")
14
+ end
15
+
16
+ def position
17
+ layout.keys[0]
18
+ end
19
+
20
+ def size
21
+ layout.values[0]
22
+ end
23
+
24
+ def is_size_percentage
25
+ size.include?("%")
26
+ end
27
+
28
+ def previous_overlay
29
+ "linear-gradient(#{previous_overlay_direction}, #{color_map[color.to_sym]} 0%, transparent #{size})"
30
+ end
31
+
32
+ def subsequent_overlay
33
+ "linear-gradient(#{subsequent_overlay_direction}, #{color_map[color.to_sym]} 0%, transparent #{size})"
34
+ end
35
+
36
+ def previous_overlay_class_name
37
+ "overlay_#{color}_#{previous_overlay_direction_token}_#{size}"
38
+ end
39
+
40
+ def subsequent_overlay_class_name
41
+ "overlay_#{color}_#{subsequent_overlay_direction_token}_#{size}"
42
+ end
43
+
44
+ def previous_overlay_direction
45
+ previous_overlay_direction_map[position.to_sym]
46
+ end
47
+
48
+ def subsequent_overlay_direction
49
+ subsequent_overlay_direction_map[position.to_sym]
50
+ end
51
+
52
+ def previous_overlay_direction_token
53
+ has_subsequent_overlay ? previous_overlay_direction_map_token[position.to_sym] : position
54
+ end
55
+
56
+ def subsequent_overlay_direction_token
57
+ has_subsequent_overlay ? subsequent_overlay_direction_map_token[position.to_sym] : position
58
+ end
59
+
60
+ def previous_overlay_direction_map
61
+ {
62
+ "bottom": "to top",
63
+ "top": "to bottom",
64
+ "left": "to right",
65
+ "right": "to left",
66
+ "x": "to right",
67
+ "y": "to top",
68
+ }
69
+ end
70
+
71
+ def subsequent_overlay_direction_map
72
+ {
73
+ "bottom": "to top",
74
+ "top": "to bottom",
75
+ "left": "to right",
76
+ "right": "to left",
77
+ "x": "to left",
78
+ "y": "to bottom",
79
+ }
80
+ end
81
+
82
+ def previous_overlay_direction_map_token
83
+ {
84
+ "x": "left",
85
+ "y": "top",
86
+ }
87
+ end
88
+
89
+ def subsequent_overlay_direction_map_token
90
+ {
91
+ "x": "right",
92
+ "y": "bottom",
93
+ }
94
+ end
95
+
96
+ def has_subsequent_overlay
97
+ position == "x".to_sym || position == "y".to_sym
98
+ end
99
+
100
+ def color_map
101
+ {
102
+ "card_light": "#fff",
103
+ "bg_light": "#F3F7FB",
104
+ "card_dark": "#231E3D",
105
+ "bg_dark": "#0a0527",
106
+ }
107
+ end
108
+ end
109
+ end
110
+ end
@@ -2,7 +2,7 @@ import React, { useState } from "react";
2
2
  import classnames from "classnames";
3
3
 
4
4
  import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from "../utilities/props";
5
- import { globalProps } from "../utilities/globalProps";
5
+ import { globalProps, domSafeProps } from "../utilities/globalProps";
6
6
 
7
7
  import Checkbox from "../pb_checkbox/_checkbox";
8
8
  import ListItem from "../pb_list/_list_item";
@@ -16,6 +16,7 @@ export type SelectableListItemProps = {
16
16
  className?: string;
17
17
  data?: GenericObject;
18
18
  defaultChecked?: boolean;
19
+ dragId?: string;
19
20
  dragHandle?: boolean;
20
21
  htmlOptions?: { [key: string]: string | number | boolean | (() => void) };
21
22
  id?: string;
@@ -33,6 +34,7 @@ const SelectableListItem = ({
33
34
  children,
34
35
  className,
35
36
  data = {},
37
+ dragId,
36
38
  dragHandle = true,
37
39
  defaultChecked,
38
40
  htmlOptions = {},
@@ -67,7 +69,7 @@ const SelectableListItem = ({
67
69
  {...props}
68
70
  className={classnames(checkedState ? "checked_item" : "", className)}
69
71
  dragHandle={dragHandle}
70
- id={id}
72
+ dragId={dragId}
71
73
  >
72
74
  <div
73
75
  {...ariaProps}
@@ -106,7 +108,9 @@ const SelectableListItem = ({
106
108
  text={label}
107
109
  type="radio"
108
110
  value={value}
109
- {...props}
111
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
112
+ //@ts-ignore
113
+ {...domSafeProps(props)}
110
114
  />
111
115
  {children}
112
116
  </>
@@ -14,7 +14,7 @@ type SelectableListProps = {
14
14
  children?: React.ReactElement[],
15
15
  className?: string,
16
16
  data?: GenericObject,
17
- draggable?: boolean,
17
+ enableDrag?: boolean,
18
18
  htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
19
19
  id?: string,
20
20
  variant?: 'checkbox' | 'radio',
@@ -26,7 +26,7 @@ const SelectableList = (props: SelectableListProps) => {
26
26
  children,
27
27
  className,
28
28
  data = {},
29
- draggable = false,
29
+ enableDrag = false,
30
30
  htmlOptions = {},
31
31
  id,
32
32
  } = props
@@ -68,7 +68,7 @@ const SelectableList = (props: SelectableListProps) => {
68
68
  className={classes}
69
69
  id={id}
70
70
  >
71
- <List draggable={draggable}
71
+ <List enableDrag={enableDrag}
72
72
  variant={props.variant}
73
73
  >
74
74
  {selectableListItems}
@@ -52,6 +52,20 @@
52
52
  data: object.data,
53
53
  id: object.id,
54
54
  **combined_html_options) do %>
55
- <%= content.presence || object.text %>
55
+ <% unless sorting_style? %>
56
+ <%= content.presence || object.text %>
57
+ <% else %>
58
+ <%= link_to next_link, style: link_style do %>
59
+ <%= pb_rails("flex", props:{ align: object.align_content, justify: object.justify_sort_icon, classname: "pb_th_link" }) do %>
60
+ <%= content.presence || object.text %>
61
+ <% if sorting_style? %>
62
+ <%= pb_rails("icon", props: { icon: object.sort_icon(active_item[:direction], active_item[:active]),
63
+ fixed_width: true,
64
+ classname: active_item.any? ? "pb_th_active" : "",
65
+ padding_left: "xs" }) %>
66
+ <% end %>
67
+ <% end %>
68
+ <% end %>
69
+ <% end %>
70
+ <% end %>
56
71
  <% end %>
57
- <% end %>
@@ -520,6 +520,7 @@ export const domSafeProps = (props: {[key: string]: string}): {[key: string]: st
520
520
  'paddingY',
521
521
  'padding',
522
522
  'dark',
523
+ 'enableDrag',
523
524
  ]
524
525
  return omit(props, notSafeProps)
525
526
  }
data/dist/menu.yml CHANGED
@@ -353,8 +353,8 @@ kits:
353
353
  description:
354
354
  status: "stable"
355
355
  - name: "overlay"
356
- platforms: *react_only
357
- status: "beta"
356
+ platforms: *web
357
+ status: "stable"
358
358
  - name: "draggable"
359
359
  platforms: *react_only
360
360
  description: