playbook_ui 13.30.0.pre.alpha.PBNTR353draggablev53136 → 13.30.0.pre.alpha.PLAY1328fixtimelinekitglobalpropsreact3096
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_card/_card.tsx +3 -4
- data/app/pb_kits/playbook/pb_draggable/_draggable.scss +4 -2
- data/app/pb_kits/playbook/pb_draggable/context/index.tsx +50 -70
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_default.jsx +1 -2
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_default.md +1 -1
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers.jsx +1 -5
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards.jsx +4 -11
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards.md +2 -4
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_list.jsx +2 -2
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_list.md +1 -7
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_selectable_list.jsx +4 -6
- data/app/pb_kits/playbook/pb_draggable/draggable.test.jsx +15 -142
- data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableItem.tsx +5 -6
- data/app/pb_kits/playbook/pb_list/_list.tsx +4 -4
- data/app/pb_kits/playbook/pb_list/_list_item.tsx +3 -7
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_default.md +4 -4
- data/app/pb_kits/playbook/pb_overlay/docs/example.yml +0 -4
- data/app/pb_kits/playbook/pb_selectable_list/_item.tsx +3 -7
- data/app/pb_kits/playbook/pb_selectable_list/_selectable_list.tsx +3 -3
- data/app/pb_kits/playbook/utilities/globalProps.ts +0 -1
- data/dist/menu.yml +2 -2
- data/dist/playbook-rails.js +2 -2
- data/lib/playbook/version.rb +1 -1
- metadata +2 -8
- data/app/pb_kits/playbook/pb_draggable/context/types.ts +0 -26
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_selectable_list.md +0 -7
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_default.html.erb +0 -24
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_multi_directional.html.erb +0 -11
- data/app/pb_kits/playbook/pb_overlay/overlay.html.erb +0 -27
- data/app/pb_kits/playbook/pb_overlay/overlay.rb +0 -110
data/lib/playbook/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: playbook_ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 13.30.0.pre.alpha.
|
4
|
+
version: 13.30.0.pre.alpha.PLAY1328fixtimelinekitglobalpropsreact3096
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Power UX
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-06-
|
12
|
+
date: 2024-06-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|
@@ -1078,7 +1078,6 @@ files:
|
|
1078
1078
|
- app/pb_kits/playbook/pb_draggable/_draggable.scss
|
1079
1079
|
- app/pb_kits/playbook/pb_draggable/_draggable.tsx
|
1080
1080
|
- app/pb_kits/playbook/pb_draggable/context/index.tsx
|
1081
|
-
- app/pb_kits/playbook/pb_draggable/context/types.ts
|
1082
1081
|
- app/pb_kits/playbook/pb_draggable/docs/_draggable_default.jsx
|
1083
1082
|
- app/pb_kits/playbook/pb_draggable/docs/_draggable_default.md
|
1084
1083
|
- app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers.jsx
|
@@ -1088,7 +1087,6 @@ files:
|
|
1088
1087
|
- app/pb_kits/playbook/pb_draggable/docs/_draggable_with_list.jsx
|
1089
1088
|
- app/pb_kits/playbook/pb_draggable/docs/_draggable_with_list.md
|
1090
1089
|
- app/pb_kits/playbook/pb_draggable/docs/_draggable_with_selectable_list.jsx
|
1091
|
-
- app/pb_kits/playbook/pb_draggable/docs/_draggable_with_selectable_list.md
|
1092
1090
|
- app/pb_kits/playbook/pb_draggable/docs/example.yml
|
1093
1091
|
- app/pb_kits/playbook/pb_draggable/docs/index.js
|
1094
1092
|
- app/pb_kits/playbook/pb_draggable/draggable.test.jsx
|
@@ -1884,16 +1882,12 @@ files:
|
|
1884
1882
|
- app/pb_kits/playbook/pb_online_status/online_status.rb
|
1885
1883
|
- app/pb_kits/playbook/pb_overlay/_overlay.scss
|
1886
1884
|
- app/pb_kits/playbook/pb_overlay/_overlay.tsx
|
1887
|
-
- app/pb_kits/playbook/pb_overlay/docs/_overlay_default.html.erb
|
1888
1885
|
- app/pb_kits/playbook/pb_overlay/docs/_overlay_default.jsx
|
1889
1886
|
- app/pb_kits/playbook/pb_overlay/docs/_overlay_default.md
|
1890
|
-
- app/pb_kits/playbook/pb_overlay/docs/_overlay_multi_directional.html.erb
|
1891
1887
|
- app/pb_kits/playbook/pb_overlay/docs/_overlay_multi_directional.jsx
|
1892
1888
|
- app/pb_kits/playbook/pb_overlay/docs/_overlay_multi_directional.md
|
1893
1889
|
- app/pb_kits/playbook/pb_overlay/docs/example.yml
|
1894
1890
|
- app/pb_kits/playbook/pb_overlay/docs/index.js
|
1895
|
-
- app/pb_kits/playbook/pb_overlay/overlay.html.erb
|
1896
|
-
- app/pb_kits/playbook/pb_overlay/overlay.rb
|
1897
1891
|
- app/pb_kits/playbook/pb_overlay/overlay.test.jsx
|
1898
1892
|
- app/pb_kits/playbook/pb_overlay/subcomponents/_overlay_percentage.tsx
|
1899
1893
|
- app/pb_kits/playbook/pb_overlay/subcomponents/_overlay_token.tsx
|
@@ -1,26 +0,0 @@
|
|
1
|
-
export interface ItemType {
|
2
|
-
id: string;
|
3
|
-
container: string;
|
4
|
-
[key: string]: any;
|
5
|
-
}
|
6
|
-
|
7
|
-
export interface InitialStateType {
|
8
|
-
items: ItemType[];
|
9
|
-
dragData: { id: string; initialGroup: string };
|
10
|
-
isDragging: string;
|
11
|
-
activeContainer: string;
|
12
|
-
}
|
13
|
-
|
14
|
-
export type ActionType =
|
15
|
-
| { type: 'SET_ITEMS'; payload: ItemType[] }
|
16
|
-
| { type: 'SET_DRAG_DATA'; payload: { id: string; initialGroup: string } }
|
17
|
-
| { type: 'SET_IS_DRAGGING'; payload: string }
|
18
|
-
| { type: 'SET_ACTIVE_CONTAINER'; payload: string }
|
19
|
-
| { type: 'CHANGE_CATEGORY'; payload: { itemId: string; container: string } }
|
20
|
-
| { type: 'REORDER_ITEMS'; payload: { dragId: string; targetId: string } };
|
21
|
-
|
22
|
-
export interface DraggableProviderType {
|
23
|
-
children: React.ReactNode;
|
24
|
-
initialItems: ItemType[];
|
25
|
-
onReorder: (items: ItemType[]) => void;
|
26
|
-
}
|
@@ -1,7 +0,0 @@
|
|
1
|
-
For a simplified version of the Draggable API for the SelectableList kit, use the DraggableProvider to wrap the SelectableList kit and use the `enableDrag` prop.
|
2
|
-
|
3
|
-
In addition to the above, `dragId` is a REQUIRED prop to be passed to the SelectableList kit when implementing dragging.
|
4
|
-
|
5
|
-
The dev must manage state as shown.
|
6
|
-
|
7
|
-
The dragHandle is added by default but this can be opted out of by setting `dragHandle` to false on the SelectableList kit.
|
@@ -1,24 +0,0 @@
|
|
1
|
-
<%= pb_rails("overlay") do %>
|
2
|
-
<%= pb_rails("table", props: { size: "sm" }) do %>
|
3
|
-
<thead>
|
4
|
-
<tr>
|
5
|
-
<th>Column 1</th>
|
6
|
-
<th>Column 2</th>
|
7
|
-
<th>Column 3</th>
|
8
|
-
<th>Column 4</th>
|
9
|
-
<th>Column 5</th>
|
10
|
-
</tr>
|
11
|
-
</thead>
|
12
|
-
<tbody>
|
13
|
-
<% 7.times do %>
|
14
|
-
<tr>
|
15
|
-
<td>Value 1</td>
|
16
|
-
<td>Value 2</td>
|
17
|
-
<td>Value 3</td>
|
18
|
-
<td>Value 4</td>
|
19
|
-
<td>Value 5</td>
|
20
|
-
</tr>
|
21
|
-
<% end %>
|
22
|
-
</tbody>
|
23
|
-
<% end %>
|
24
|
-
<% end %>
|
@@ -1,11 +0,0 @@
|
|
1
|
-
<%= pb_rails("overlay", props: { layout: { "x": "xl" }, color: "card_light" }) do %>
|
2
|
-
<%= pb_rails("flex", props: { column_gap: "lg", orientation: "row", overflow_x: "auto" }) do %>
|
3
|
-
<% 15.times do %>
|
4
|
-
<%= pb_rails("flex/flex_item") do %>
|
5
|
-
<%= pb_rails("card") do %>
|
6
|
-
Card content
|
7
|
-
<% end %>
|
8
|
-
<% end %>
|
9
|
-
<% end %>
|
10
|
-
<% end %>
|
11
|
-
<% end %>
|
@@ -1,27 +0,0 @@
|
|
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 %>
|
@@ -1,110 +0,0 @@
|
|
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
|