playbook_ui 14.17.0.pre.alpha.play1499backgroundkitoverlay7110 → 14.17.0.pre.rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_advanced_table/Utilities/types.ts +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +0 -70
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +2 -83
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +7 -20
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +1 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_background/_background.scss +0 -26
- data/app/pb_kits/playbook/pb_background/_background.tsx +3 -6
- data/app/pb_kits/playbook/pb_background/background.test.js +0 -5
- data/app/pb_kits/playbook/pb_background/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_background/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_collapsible/__snapshots__/collapsible.test.js.snap +7 -14
- data/app/pb_kits/playbook/pb_contact/contact.test.js +7 -7
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +34 -34
- data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +2 -2
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +0 -16
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_inline.html.erb +11 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_inline.jsx +7 -0
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_inline_styles.scss +24 -28
- data/app/pb_kits/playbook/pb_date_range_inline/date_range_inline.test.js +2 -2
- data/app/pb_kits/playbook/pb_date_range_stacked/date_range_stacked.test.js +1 -1
- data/app/pb_kits/playbook/pb_draggable/context/index.tsx +17 -58
- data/app/pb_kits/playbook/pb_draggable/draggable.test.jsx +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete.jsx +6 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_and_custom_display.jsx +6 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display.jsx +6 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display_rails.html.erb +8 -8
- data/app/pb_kits/playbook/pb_dropdown/dropdown.test.jsx +3 -3
- data/app/pb_kits/playbook/pb_filter/Filter/CurrentFilters.tsx +4 -3
- data/app/pb_kits/playbook/pb_filter/Filter/SortMenu.tsx +3 -2
- data/app/pb_kits/playbook/pb_form/pb_form_validation.js +1 -1
- data/app/pb_kits/playbook/pb_form_group/_form_group.scss +0 -22
- data/app/pb_kits/playbook/pb_icon/icon.test.js +9 -9
- data/app/pb_kits/playbook/pb_icon_circle/icon_circle.test.js +1 -1
- data/app/pb_kits/playbook/pb_icon_stat_value/icon_stat_value.test.js +1 -1
- data/app/pb_kits/playbook/pb_icon_value/icon_value.test.js +1 -1
- data/app/pb_kits/playbook/pb_label_value/label_value.test.js +1 -1
- data/app/pb_kits/playbook/pb_layout/_layout.scss +0 -58
- data/app/pb_kits/playbook/pb_layout/_layout.tsx +7 -20
- data/app/pb_kits/playbook/pb_layout/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_layout/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_layout/layout.test.js +0 -4
- data/app/pb_kits/playbook/pb_lightbox/hooks/useVisibility.js +1 -1
- data/app/pb_kits/playbook/pb_link/link.test.jsx +2 -2
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +1 -2
- data/app/pb_kits/playbook/pb_nav/_nav_item.test.js +3 -5
- data/app/pb_kits/playbook/pb_stat_change/stat_change.test.js +4 -8
- data/app/pb_kits/playbook/pb_table/styles/_striped.scss +3 -3
- data/app/pb_kits/playbook/pb_tooltip/floating_ui.js +282 -0
- data/app/pb_kits/playbook/pb_tooltip/index.js +56 -183
- data/app/pb_kits/playbook/pb_tooltip/tooltip.html.erb +5 -2
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_highlight.jsx +4 -4
- data/app/pb_kits/playbook/pb_typeahead/index.ts +2 -2
- data/app/pb_kits/playbook/pb_typeahead/typeahead.html.erb +5 -2
- data/app/pb_kits/playbook/pb_user/user.html.erb +6 -1
- data/app/pb_kits/playbook/pb_user_badge/user_badge.html.erb +6 -1
- data/app/pb_kits/playbook/utilities/globalProps.ts +1 -1
- data/app/pb_kits/playbook/utilities/object.test.js +1 -149
- data/app/pb_kits/playbook/utilities/object.ts +42 -124
- data/dist/chunks/{_typeahead-1gVtCLYL.js → _typeahead-N-EFroAX.js} +3 -3
- data/dist/chunks/_weekday_stacked-Db780bKR.js +45 -0
- data/dist/chunks/lib-Co5y3V4K.js +29 -0
- data/dist/chunks/{pb_form_validation-BvNy9Bd6.js → pb_form_validation-DMajaRt3.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/playbook-doc.js +1 -1
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/kit_base.rb +4 -4
- data/lib/playbook/version.rb +2 -2
- metadata +7 -15
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_fullscreen.jsx +0 -90
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_fullscreen.md +0 -3
- data/app/pb_kits/playbook/pb_background/docs/_background_overlay.jsx +0 -36
- data/app/pb_kits/playbook/pb_background/docs/_background_overlay.md +0 -1
- data/app/pb_kits/playbook/pb_layout/docs/_layout_bracket.jsx +0 -190
- data/app/pb_kits/playbook/pb_layout/docs/_layout_bracket.md +0 -5
- data/app/pb_kits/playbook/pb_layout/subcomponents/_game.tsx +0 -90
- data/app/pb_kits/playbook/pb_layout/subcomponents/_round.tsx +0 -57
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_vertical.md +0 -1
- data/dist/chunks/_weekday_stacked-Cl62R0Ef.js +0 -45
- data/dist/chunks/lib-BGzBzFZX.js +0 -29
@@ -14,12 +14,12 @@
|
|
14
14
|
opacity: 1;
|
15
15
|
}
|
16
16
|
&:not(:hover) {
|
17
|
-
|
17
|
+
#date-picker-inline-angle-down {
|
18
18
|
svg {
|
19
19
|
display: none;
|
20
20
|
}
|
21
21
|
}
|
22
|
-
|
22
|
+
#date-picker-inline-icon-plus {
|
23
23
|
svg {
|
24
24
|
color: $slate;
|
25
25
|
display: inline-block;
|
@@ -33,12 +33,12 @@
|
|
33
33
|
[class^="pb_text_input_kit"] .text_input_wrapper .flatpickr-wrapper .text_input .placeholder {
|
34
34
|
color: $primary;
|
35
35
|
}
|
36
|
-
|
36
|
+
#date-picker-inline-angle-down {
|
37
37
|
svg {
|
38
38
|
display: none;
|
39
39
|
}
|
40
40
|
}
|
41
|
-
|
41
|
+
#date-picker-inline-icon-plus {
|
42
42
|
svg {
|
43
43
|
display: inline-block;
|
44
44
|
color: $primary;
|
@@ -47,34 +47,32 @@
|
|
47
47
|
}
|
48
48
|
&.show-angle-down-icon {
|
49
49
|
&:not(:hover) {
|
50
|
-
|
50
|
+
#date-picker-inline-angle-down {
|
51
51
|
svg {
|
52
52
|
display: inline-block;
|
53
53
|
color: $text_lt_light;
|
54
54
|
}
|
55
55
|
}
|
56
|
-
|
56
|
+
#date-picker-inline-icon-plus {
|
57
57
|
svg {
|
58
58
|
display: none;
|
59
59
|
}
|
60
60
|
}
|
61
61
|
}
|
62
|
-
|
62
|
+
#date-picker-inline-icon-plus {
|
63
63
|
svg {
|
64
64
|
display: none;
|
65
65
|
}
|
66
66
|
}
|
67
|
-
|
67
|
+
#date-picker-inline-angle-down {
|
68
68
|
svg {
|
69
69
|
display: inline-block;
|
70
70
|
color: $primary;
|
71
71
|
}
|
72
72
|
}
|
73
73
|
}
|
74
|
-
|
75
|
-
|
76
|
-
.text_input.flatpickr-input,
|
77
|
-
.text_input.flatpickr-input .active {
|
74
|
+
#date-picker-inline,
|
75
|
+
#date-picker-inline .active {
|
78
76
|
border: none;
|
79
77
|
padding: 5px 5px 5px 10px;
|
80
78
|
background-color: #FFF;
|
@@ -84,8 +82,8 @@
|
|
84
82
|
box-shadow: none;
|
85
83
|
}
|
86
84
|
}
|
87
|
-
|
88
|
-
|
85
|
+
#date-picker-inline-angle-down,
|
86
|
+
#date-picker-inline-icon-plus {
|
89
87
|
height: 33px;
|
90
88
|
border: none;
|
91
89
|
}
|
@@ -98,12 +96,12 @@
|
|
98
96
|
[class^=pb_date_picker_kit].dark {
|
99
97
|
&.inline-date-picker {
|
100
98
|
&:not(:hover) {
|
101
|
-
|
99
|
+
#date-picker-inline-angle-down {
|
102
100
|
svg {
|
103
101
|
display: none;
|
104
102
|
}
|
105
103
|
}
|
106
|
-
|
104
|
+
#date-picker-inline-icon-plus {
|
107
105
|
svg {
|
108
106
|
display: inline-block;
|
109
107
|
color: $white;
|
@@ -117,12 +115,12 @@
|
|
117
115
|
[class^="pb_text_input_kit"] .text_input_wrapper .flatpickr-wrapper .text_input .placeholder {
|
118
116
|
color: $white;
|
119
117
|
}
|
120
|
-
|
118
|
+
#date-picker-inline-angle-down {
|
121
119
|
svg {
|
122
120
|
display: none;
|
123
121
|
}
|
124
122
|
}
|
125
|
-
|
123
|
+
#date-picker-inline-icon-plus {
|
126
124
|
svg {
|
127
125
|
display: inline-block;
|
128
126
|
color: $white;
|
@@ -131,34 +129,32 @@
|
|
131
129
|
}
|
132
130
|
&.show-angle-down-icon {
|
133
131
|
&:not(:hover) {
|
134
|
-
|
132
|
+
#date-picker-inline-angle-down {
|
135
133
|
svg {
|
136
134
|
display: inline-block;
|
137
135
|
color: $white;
|
138
136
|
}
|
139
137
|
}
|
140
|
-
|
138
|
+
#date-picker-inline-icon-plus {
|
141
139
|
svg {
|
142
140
|
display: none;
|
143
141
|
}
|
144
142
|
}
|
145
143
|
}
|
146
|
-
|
144
|
+
#date-picker-inline-icon-plus {
|
147
145
|
svg {
|
148
146
|
display: none;
|
149
147
|
}
|
150
148
|
}
|
151
|
-
|
149
|
+
#date-picker-inline-angle-down {
|
152
150
|
svg {
|
153
151
|
display: inline-block;
|
154
152
|
color: $white;
|
155
153
|
}
|
156
154
|
}
|
157
155
|
}
|
158
|
-
|
159
|
-
|
160
|
-
.text_input.flatpickr-input,
|
161
|
-
.text_input.flatpickr-input .active {
|
156
|
+
#date-picker-inline,
|
157
|
+
#date-picker-inline .active {
|
162
158
|
background-color: rgba($white,.10);
|
163
159
|
border: none;
|
164
160
|
padding: 5px 5px 5px 10px;
|
@@ -168,8 +164,8 @@
|
|
168
164
|
box-shadow: none;
|
169
165
|
}
|
170
166
|
}
|
171
|
-
|
172
|
-
|
167
|
+
#date-picker-inline-angle-down,
|
168
|
+
#date-picker-inline-icon-plus {
|
173
169
|
height: 33px;
|
174
170
|
border: none;
|
175
171
|
}
|
@@ -62,7 +62,7 @@ describe("DateRangeInline Kit", () => {
|
|
62
62
|
)
|
63
63
|
|
64
64
|
const kit = screen.getByTestId(testId)
|
65
|
-
const arrow = kit.querySelector('.
|
65
|
+
const arrow = kit.querySelector('.pb_icon_kit.fa-fw.fa-long-arrow-right')
|
66
66
|
expect(arrow).toBeInTheDocument()
|
67
67
|
})
|
68
68
|
|
@@ -93,7 +93,7 @@ describe("DateRangeInline Kit", () => {
|
|
93
93
|
)
|
94
94
|
|
95
95
|
const kit = screen.getByTestId(testId)
|
96
|
-
const calendar = kit.querySelector('.
|
96
|
+
const calendar = kit.querySelector('.pb_icon_kit.fa-fw.fa-calendar-alt')
|
97
97
|
expect(calendar).toBeInTheDocument()
|
98
98
|
})
|
99
99
|
|
@@ -58,7 +58,7 @@ describe("DateRangeStacked Kit", () => {
|
|
58
58
|
)
|
59
59
|
|
60
60
|
const kit = screen.getByTestId(testId)
|
61
|
-
const arrowicon = kit.querySelector('.
|
61
|
+
const arrowicon = kit.querySelector('.pb_icon_kit.fa-fw.pb_date_range_stacked_arrow')
|
62
62
|
expect(arrowicon).toBeInTheDocument()
|
63
63
|
})
|
64
64
|
|
@@ -1,11 +1,11 @@
|
|
1
|
-
import React, { createContext, useReducer, useContext, useEffect, useMemo
|
1
|
+
import React, { createContext, useReducer, useContext, useEffect, useMemo } from "react";
|
2
2
|
import { InitialStateType, ActionType, DraggableProviderType } from "./types";
|
3
3
|
|
4
4
|
const initialState: InitialStateType = {
|
5
5
|
items: [],
|
6
6
|
dragData: { id: "", initialGroup: "" },
|
7
7
|
isDragging: "",
|
8
|
-
activeContainer: ""
|
8
|
+
activeContainer: ""
|
9
9
|
};
|
10
10
|
|
11
11
|
const reducer = (state: InitialStateType, action: ActionType) => {
|
@@ -31,23 +31,9 @@ const reducer = (state: InitialStateType, action: ActionType) => {
|
|
31
31
|
const { dragId, targetId } = action.payload;
|
32
32
|
const newItems = [...state.items];
|
33
33
|
const draggedItem = newItems.find(item => item.id === dragId);
|
34
|
-
const
|
35
|
-
|
36
|
-
if (!draggedItem || !targetItem || draggedItem.container !== targetItem.container) {
|
37
|
-
return state;
|
38
|
-
}
|
39
|
-
|
40
|
-
if (dragId === targetId) {
|
41
|
-
return state;
|
42
|
-
}
|
43
|
-
|
44
|
-
const draggedIndex = newItems.findIndex(item => item.id === dragId);
|
34
|
+
const draggedIndex = newItems.indexOf(draggedItem);
|
45
35
|
const targetIndex = newItems.findIndex(item => item.id === targetId);
|
46
36
|
|
47
|
-
if (draggedIndex === -1 || targetIndex === -1) {
|
48
|
-
return state;
|
49
|
-
}
|
50
|
-
|
51
37
|
newItems.splice(draggedIndex, 1);
|
52
38
|
newItems.splice(targetIndex, 0, draggedItem);
|
53
39
|
|
@@ -62,11 +48,7 @@ const reducer = (state: InitialStateType, action: ActionType) => {
|
|
62
48
|
const DragContext = createContext<any>({});
|
63
49
|
|
64
50
|
export const DraggableContext = () => {
|
65
|
-
|
66
|
-
if (context === undefined) {
|
67
|
-
throw new Error('DraggableContext must be used within a DraggableProvider');
|
68
|
-
}
|
69
|
-
return context;
|
51
|
+
return useContext(DragContext);
|
70
52
|
};
|
71
53
|
|
72
54
|
export const DraggableProvider = ({
|
@@ -81,11 +63,7 @@ export const DraggableProvider = ({
|
|
81
63
|
dropZone = { type: 'ghost', color: 'neutral', direction: 'vertical' }
|
82
64
|
}: DraggableProviderType) => {
|
83
65
|
const [state, dispatch] = useReducer(reducer, initialState);
|
84
|
-
|
85
|
-
// Store initial items in a ref to use if needed (for consistency when needed in future updates)
|
86
|
-
const initialItemsRef = useRef(initialItems);
|
87
|
-
const [isDragging, setIsDragging] = useState(false);
|
88
|
-
|
66
|
+
|
89
67
|
// Parse dropZone prop - handle both string format (backward compatibility) and object format
|
90
68
|
let dropZoneType = 'ghost';
|
91
69
|
let dropZoneColor = 'neutral';
|
@@ -108,64 +86,45 @@ export const DraggableProvider = ({
|
|
108
86
|
|
109
87
|
useEffect(() => {
|
110
88
|
dispatch({ type: 'SET_ITEMS', payload: initialItems });
|
111
|
-
initialItemsRef.current = initialItems;
|
112
89
|
}, [initialItems]);
|
113
90
|
|
114
91
|
useEffect(() => {
|
115
|
-
|
116
|
-
|
117
|
-
}
|
118
|
-
}, [state.items, onReorder]);
|
92
|
+
onReorder(state.items);
|
93
|
+
}, [state.items]);
|
119
94
|
|
120
95
|
const handleDragStart = (id: string, container: string) => {
|
121
|
-
|
122
|
-
dispatch({ type: 'SET_DRAG_DATA', payload: { id, initialGroup: container } });
|
96
|
+
dispatch({ type: 'SET_DRAG_DATA', payload: { id: id, initialGroup: container } });
|
123
97
|
dispatch({ type: 'SET_IS_DRAGGING', payload: id });
|
124
|
-
dispatch({ type: 'SET_ACTIVE_CONTAINER', payload: container });
|
125
98
|
if (onDragStart) onDragStart(id, container);
|
126
99
|
};
|
127
100
|
|
128
101
|
const handleDragEnter = (id: string, container: string) => {
|
129
|
-
if (
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
const draggedItem = state.items.find(item => item.id === state.dragData.id);
|
134
|
-
const targetItem = state.items.find(item => item.id === id);
|
135
|
-
|
136
|
-
if (!draggedItem || !targetItem || draggedItem.container !== targetItem.container) {
|
137
|
-
return;
|
102
|
+
if (state.dragData.id !== id) {
|
103
|
+
dispatch({ type: 'REORDER_ITEMS', payload: { dragId: state.dragData.id, targetId: id } });
|
104
|
+
dispatch({ type: 'SET_DRAG_DATA', payload: { id: state.dragData.id, initialGroup: container } });
|
138
105
|
}
|
139
|
-
|
140
|
-
dispatch({ type: 'REORDER_ITEMS', payload: { dragId: state.dragData.id, targetId: id } });
|
141
|
-
|
142
106
|
if (onDragEnter) onDragEnter(id, container);
|
143
107
|
};
|
144
108
|
|
145
109
|
const handleDragEnd = () => {
|
146
|
-
setIsDragging(false);
|
147
110
|
dispatch({ type: 'SET_IS_DRAGGING', payload: "" });
|
148
111
|
dispatch({ type: 'SET_ACTIVE_CONTAINER', payload: "" });
|
149
112
|
if (onDragEnd) onDragEnd();
|
150
113
|
};
|
151
114
|
|
152
|
-
const
|
153
|
-
|
154
|
-
|
155
|
-
if (draggedItem && draggedItem.container !== container) {
|
156
|
-
dispatch({ type: 'CHANGE_CATEGORY', payload: { itemId: state.dragData.id, container } });
|
157
|
-
}
|
115
|
+
const changeCategory = (itemId: string, container: string) => {
|
116
|
+
dispatch({ type: 'CHANGE_CATEGORY', payload: { itemId, container } });
|
117
|
+
};
|
158
118
|
|
119
|
+
const handleDrop = (container: string) => {
|
159
120
|
dispatch({ type: 'SET_IS_DRAGGING', payload: "" });
|
160
121
|
dispatch({ type: 'SET_ACTIVE_CONTAINER', payload: "" });
|
161
|
-
|
162
|
-
setIsDragging(false);
|
122
|
+
changeCategory(state.dragData.id, container);
|
163
123
|
if (onDrop) onDrop(container);
|
164
124
|
};
|
165
125
|
|
166
126
|
const handleDragOver = (e: Event, container: string) => {
|
167
127
|
e.preventDefault();
|
168
|
-
e.stopPropagation();
|
169
128
|
dispatch({ type: 'SET_ACTIVE_CONTAINER', payload: container });
|
170
129
|
if (onDragOver) onDragOver(e, container);
|
171
130
|
};
|
@@ -185,7 +144,7 @@ export const DraggableProvider = ({
|
|
185
144
|
handleDragEnd,
|
186
145
|
handleDrop,
|
187
146
|
handleDragOver
|
188
|
-
}), [state, dropZoneType, dropZoneColor, dropZoneDirection
|
147
|
+
}), [state, dropZoneType, dropZoneColor, dropZoneDirection]);
|
189
148
|
|
190
149
|
return (
|
191
150
|
<DragContext.Provider value={contextValue}>{children}</DragContext.Provider>
|
@@ -165,7 +165,7 @@ test("generated dragHandle with List", () => {
|
|
165
165
|
|
166
166
|
const list = kit.querySelector(".pb_list_kit");
|
167
167
|
expect(list).toBeInTheDocument();
|
168
|
-
const dragHandle = list.querySelector(".
|
168
|
+
const dragHandle = list.querySelector(".fa-grip-dots-vertical");
|
169
169
|
expect(dragHandle).toBeInTheDocument();
|
170
170
|
});
|
171
171
|
|
@@ -175,7 +175,7 @@ test("generated dragHandle with SelectableList", () => {
|
|
175
175
|
|
176
176
|
const selectabellist = kit.querySelector(".pb_selectable_list_kit");
|
177
177
|
expect(selectabellist).toBeInTheDocument();
|
178
|
-
const dragHandle = selectabellist.querySelector(".
|
178
|
+
const dragHandle = selectabellist.querySelector(".fa-grip-dots-vertical");
|
179
179
|
expect(dragHandle).toBeInTheDocument();
|
180
180
|
});
|
181
181
|
|
@@ -185,6 +185,6 @@ test("generated dragHandle with Card", () => {
|
|
185
185
|
|
186
186
|
const card = kit.querySelector(".pb_card_kit_deselected_border_radius_md");
|
187
187
|
expect(card).toBeInTheDocument();
|
188
|
-
const dragHandle = card.querySelector(".
|
188
|
+
const dragHandle = card.querySelector(".fa-grip-dots-vertical");
|
189
189
|
expect(dragHandle).toBeInTheDocument();
|
190
190
|
});
|
@@ -12,7 +12,7 @@ const DropdownWithAutocomplete = (props) => {
|
|
12
12
|
label: "Jasper Furniss",
|
13
13
|
value: "Jasper Furniss",
|
14
14
|
territory: "PHL",
|
15
|
-
title: "
|
15
|
+
title: "Senior UX Engineer",
|
16
16
|
id: "jasper-furniss",
|
17
17
|
status: "Offline"
|
18
18
|
},
|
@@ -25,18 +25,18 @@ const DropdownWithAutocomplete = (props) => {
|
|
25
25
|
status: "Away"
|
26
26
|
},
|
27
27
|
{
|
28
|
-
label: "
|
29
|
-
value: "
|
28
|
+
label: "Jason Cypret",
|
29
|
+
value: "Jason Cypret",
|
30
30
|
territory: "PHL",
|
31
|
-
title: "
|
32
|
-
id: "
|
31
|
+
title: "VP of User Experience",
|
32
|
+
id: "jason-cypret",
|
33
33
|
status: "Online"
|
34
34
|
},
|
35
35
|
{
|
36
36
|
label: "Courtney Long",
|
37
37
|
value: "Courtney Long",
|
38
38
|
territory: "PHL",
|
39
|
-
title: "
|
39
|
+
title: "UX Design Mentor",
|
40
40
|
id: "courtney-long",
|
41
41
|
status: "Online"
|
42
42
|
}
|
data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_and_custom_display.jsx
CHANGED
@@ -15,7 +15,7 @@ const DropdownWithAutocompleteAndCustomDisplay = (props) => {
|
|
15
15
|
label: "Jasper Furniss",
|
16
16
|
value: "Jasper Furniss",
|
17
17
|
territory: "PHL",
|
18
|
-
title: "
|
18
|
+
title: "Senior UX Engineer",
|
19
19
|
id: "jasper-furniss",
|
20
20
|
status: "Offline"
|
21
21
|
},
|
@@ -28,18 +28,18 @@ const DropdownWithAutocompleteAndCustomDisplay = (props) => {
|
|
28
28
|
status: "Away"
|
29
29
|
},
|
30
30
|
{
|
31
|
-
label: "
|
32
|
-
value: "
|
31
|
+
label: "Jason Cypret",
|
32
|
+
value: "Jason Cypret",
|
33
33
|
territory: "PHL",
|
34
|
-
title: "
|
35
|
-
id: "
|
34
|
+
title: "VP of User Experience",
|
35
|
+
id: "jason-cypret",
|
36
36
|
status: "Online"
|
37
37
|
},
|
38
38
|
{
|
39
39
|
label: "Courtney Long",
|
40
40
|
value: "Courtney Long",
|
41
41
|
territory: "PHL",
|
42
|
-
title: "
|
42
|
+
title: "UX Design Mentor",
|
43
43
|
id: "courtney-long",
|
44
44
|
status: "Online"
|
45
45
|
}
|
@@ -15,7 +15,7 @@ const DropdownWithCustomDisplay = (props) => {
|
|
15
15
|
label: "Jasper Furniss",
|
16
16
|
value: "Jasper Furniss",
|
17
17
|
territory: "PHL",
|
18
|
-
title: "
|
18
|
+
title: "Senior UX Engineer",
|
19
19
|
id: "jasper-furniss",
|
20
20
|
status: "Offline"
|
21
21
|
},
|
@@ -28,18 +28,18 @@ const DropdownWithCustomDisplay = (props) => {
|
|
28
28
|
status: "Away"
|
29
29
|
},
|
30
30
|
{
|
31
|
-
label: "
|
32
|
-
value: "
|
31
|
+
label: "Jason Cypret",
|
32
|
+
value: "Jason Cypret",
|
33
33
|
territory: "PHL",
|
34
|
-
title: "
|
35
|
-
id: "
|
34
|
+
title: "VP of User Experience",
|
35
|
+
id: "jason-cypret",
|
36
36
|
status: "Online"
|
37
37
|
},
|
38
38
|
{
|
39
39
|
label: "Courtney Long",
|
40
40
|
value: "Courtney Long",
|
41
41
|
territory: "PHL",
|
42
|
-
title: "
|
42
|
+
title: "UX Design Mentor",
|
43
43
|
id: "courtney-long",
|
44
44
|
status: "Online"
|
45
45
|
}
|
@@ -1,10 +1,10 @@
|
|
1
1
|
<%
|
2
|
-
|
2
|
+
options = [
|
3
3
|
{
|
4
4
|
label: "Jasper Furniss",
|
5
5
|
value: "Jasper Furniss",
|
6
6
|
territory: "PHL",
|
7
|
-
title: "
|
7
|
+
title: "Senior UX Engineer",
|
8
8
|
id: "jasper-furniss",
|
9
9
|
status: "Offline"
|
10
10
|
},
|
@@ -17,22 +17,22 @@
|
|
17
17
|
status: "Away"
|
18
18
|
},
|
19
19
|
{
|
20
|
-
label: "
|
21
|
-
value: "
|
20
|
+
label: "Jason Cypret",
|
21
|
+
value: "Jason Cypret",
|
22
22
|
territory: "PHL",
|
23
|
-
title: "
|
24
|
-
id: "
|
23
|
+
title: "VP of User Experience",
|
24
|
+
id: "jason-cypret",
|
25
25
|
status: "Online"
|
26
26
|
},
|
27
27
|
{
|
28
28
|
label: "Courtney Long",
|
29
29
|
value: "Courtney Long",
|
30
30
|
territory: "PHL",
|
31
|
-
title: "
|
31
|
+
title: "UX Design Mentor",
|
32
32
|
id: "courtney-long",
|
33
33
|
status: "Online"
|
34
34
|
}
|
35
|
-
]
|
35
|
+
]
|
36
36
|
|
37
37
|
%>
|
38
38
|
|
@@ -95,7 +95,7 @@ test('generated customDisplay for trigger', () => {
|
|
95
95
|
|
96
96
|
const kit = screen.getByTestId(testId)
|
97
97
|
const trigger = kit.querySelector('.pb_dropdown_trigger')
|
98
|
-
const customDisplay = trigger.querySelector('.
|
98
|
+
const customDisplay = trigger.querySelector('.fa-flag.pb_icon_kit.fa-fw')
|
99
99
|
expect(customDisplay).toBeInTheDocument()
|
100
100
|
})
|
101
101
|
|
@@ -170,7 +170,7 @@ test('generated custom Trigger', () => {
|
|
170
170
|
options={options}
|
171
171
|
>
|
172
172
|
<Dropdown.Trigger>
|
173
|
-
<Icon icon="
|
173
|
+
<Icon icon="elephant" />
|
174
174
|
</Dropdown.Trigger>
|
175
175
|
{options.map((option) => (
|
176
176
|
<Dropdown.Option key={option.id}
|
@@ -182,7 +182,7 @@ test('generated custom Trigger', () => {
|
|
182
182
|
|
183
183
|
const kit = screen.getByTestId(testId)
|
184
184
|
const trigger = kit.querySelector('.pb_dropdown_trigger')
|
185
|
-
const customTrigger = trigger.querySelector('.
|
185
|
+
const customTrigger = trigger.querySelector('.fa-elephant.pb_icon_kit.fa-fw')
|
186
186
|
expect(customTrigger).toBeInTheDocument()
|
187
187
|
})
|
188
188
|
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import React from 'react'
|
2
|
-
import {
|
2
|
+
import { map } from 'lodash'
|
3
|
+
import { isEmpty, omitBy } from '../../utilities/object'
|
3
4
|
|
4
5
|
import Body from '../../pb_body/_body'
|
5
6
|
import Caption from '../../pb_caption/_caption'
|
@@ -45,12 +46,12 @@ const CurrentFilters = ({ dark, filters }: CurrentFiltersProps): React.ReactElem
|
|
45
46
|
dark={dark}
|
46
47
|
size={4}
|
47
48
|
tag="h4"
|
48
|
-
text={
|
49
|
+
text={name}
|
49
50
|
/> :
|
50
51
|
<div>
|
51
52
|
<Caption
|
52
53
|
dark={dark}
|
53
|
-
text={
|
54
|
+
text={name}
|
54
55
|
/>
|
55
56
|
<Title
|
56
57
|
dark={dark}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import React, { useState } from 'react'
|
2
|
-
import {
|
2
|
+
import { map } from 'lodash'
|
3
|
+
import { find, partial } from '../../utilities/object'
|
3
4
|
|
4
5
|
import Button from '../../pb_button/_button'
|
5
6
|
import Icon from '../../pb_icon/_icon'
|
@@ -26,7 +27,7 @@ const directionIcon = (dir: Direction) => (
|
|
26
27
|
|
27
28
|
const renderOptions = (options: SortOptions, value: SortValue[], handleChange: (arg0: SortValue) => void) => (
|
28
29
|
map(options, (label, name) => {
|
29
|
-
const next = nextValue(value,
|
30
|
+
const next = nextValue(value, name)
|
30
31
|
return (
|
31
32
|
<ListItem key={`option-${next.name}-${next.dir}`}>
|
32
33
|
<Button
|
@@ -205,26 +205,4 @@
|
|
205
205
|
border-top-left-radius: 0;
|
206
206
|
}
|
207
207
|
}
|
208
|
-
|
209
|
-
.pb_text_input_kit.error {
|
210
|
-
.text_input_wrapper {
|
211
|
-
input:focus {
|
212
|
-
outline: none;
|
213
|
-
}
|
214
|
-
}
|
215
|
-
|
216
|
-
& + * input,
|
217
|
-
& + * select {
|
218
|
-
border-left-color: $red;
|
219
|
-
}
|
220
|
-
}
|
221
|
-
|
222
|
-
.pb_text_input_kit:not(.error):focus-within + .error,
|
223
|
-
.pb_text_input_kit:not(.error):focus-within + .pb_select .error {
|
224
|
-
input,
|
225
|
-
select {
|
226
|
-
border-left: none;
|
227
|
-
padding-left: calc(var(--iti-flag-width) + 1px);
|
228
|
-
}
|
229
|
-
}
|
230
208
|
}
|