playbook_ui 14.16.0.pre.alpha.play1964tablekitheadertextstylefix7023 → 14.16.0.pre.alpha.play1964tablekitheadertextstylefix7091
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/advanced_table.test.jsx +5 -5
- data/app/pb_kits/playbook/pb_collapsible/__snapshots__/collapsible.test.js.snap +14 -7
- data/app/pb_kits/playbook/pb_contact/contact.test.js +7 -7
- 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 +58 -17
- data/app/pb_kits/playbook/pb_draggable/draggable.test.jsx +3 -3
- data/app/pb_kits/playbook/pb_dropdown/dropdown.test.jsx +3 -3
- data/app/pb_kits/playbook/pb_form_group/_form_group.scss +22 -0
- 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_link/link.test.jsx +2 -2
- data/app/pb_kits/playbook/pb_nav/_nav_item.test.js +5 -3
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_vertical.md +1 -0
- data/app/pb_kits/playbook/pb_stat_change/stat_change.test.js +8 -4
- data/app/pb_kits/playbook/pb_table/styles/_headers.scss +10 -2
- data/app/pb_kits/playbook/pb_tooltip/tooltip.html.erb +2 -5
- data/app/pb_kits/playbook/pb_typeahead/typeahead.html.erb +2 -5
- data/app/pb_kits/playbook/pb_user/user.html.erb +1 -6
- data/app/pb_kits/playbook/pb_user_badge/user_badge.html.erb +1 -6
- data/dist/chunks/{_typeahead-Djo6qCne.js → _typeahead-7W5Ha5Td.js} +1 -1
- data/dist/chunks/{_weekday_stacked-BV8x7Ogy.js → _weekday_stacked-DSKatW3m.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 +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54d0fea32b7f3d4e5aba4900e63c7c5d3c3fa2fde7eb40023db9161ce687b59b
|
4
|
+
data.tar.gz: b150e8eb3b1a4e3e58c815cacbac0caff8c4b24f98e7eb25ebe0b86564090a2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4b1941d8d6c8473f8061f329012a8571328556829ed46bf1e7ac9da918b18b5f78f2841d015893bcb23f0250d9a7d30ae6fa2730e88430f4ed0ec633b583d28
|
7
|
+
data.tar.gz: 0c5967fdd0a1fd7af31ecde3f26f82daff27f46b360b0f1a1fc9fa3f0d53ef4c90c9d57dfdc8a8de9625ac07376f77bc6dc8711a906cca86d4486a06a3883534
|
@@ -338,8 +338,8 @@ test("enableExpansionIcon changes icon", () => {
|
|
338
338
|
|
339
339
|
const kit = screen.getByTestId(testId)
|
340
340
|
const tableHead = kit.querySelector('table')
|
341
|
-
const toggleIcon= tableHead.querySelector(".
|
342
|
-
expect(toggleIcon).
|
341
|
+
const toggleIcon = tableHead.querySelector(".pb_custom_icon")
|
342
|
+
expect(toggleIcon).toBeInTheDocument()
|
343
343
|
})
|
344
344
|
|
345
345
|
test("sortIcon changes icon", () => {
|
@@ -360,8 +360,8 @@ test("sortIcon changes icon", () => {
|
|
360
360
|
|
361
361
|
const kit = screen.getByTestId(testId)
|
362
362
|
const sortIcon = kit.querySelector('.sort-button-icon')
|
363
|
-
const icon= sortIcon.querySelector(".
|
364
|
-
expect(icon).
|
363
|
+
const icon = sortIcon.querySelector(".pb_custom_icon")
|
364
|
+
expect(icon).toBeInTheDocument()
|
365
365
|
})
|
366
366
|
|
367
367
|
test("Sort icon renders with enableSorting + sortControl works as expected", () => {
|
@@ -452,7 +452,7 @@ test("inlineRowLoading prop renders inline loading if true", () => {
|
|
452
452
|
const rowButton = kit.querySelector(".gray-icon.expand-toggle-icon")
|
453
453
|
expect(rowButton).toBeInTheDocument()
|
454
454
|
rowButton.click()
|
455
|
-
const inlineLoading = kit.querySelector(".
|
455
|
+
const inlineLoading = kit.querySelector(".pb_custom_icon")
|
456
456
|
expect(inlineLoading).toBeInTheDocument()
|
457
457
|
})
|
458
458
|
|
@@ -27,13 +27,20 @@ exports[`html structure is correct 1`] = `
|
|
27
27
|
class="icon_wrapper"
|
28
28
|
style="vertical-align: middle; color: rgb(193, 205, 214);"
|
29
29
|
>
|
30
|
-
<
|
31
|
-
class="
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
30
|
+
<svg
|
31
|
+
class="pb_custom_icon svg-inline--fa svg_lg svg_fw"
|
32
|
+
color="currentColor"
|
33
|
+
fill="none"
|
34
|
+
height="auto"
|
35
|
+
viewBox="0 0 30 25"
|
36
|
+
width="auto"
|
37
|
+
xmlns="http://www.w3.org/2000/svg"
|
38
|
+
>
|
39
|
+
<path
|
40
|
+
d="M14.203 19.297l-9-9c-.469-.422-.469-1.125 0-1.594.422-.422 1.125-.422 1.594 0L15 16.953l8.203-8.203c.422-.469 1.125-.469 1.594 0a1.103 1.103 0 010 1.547l-9.047 9a1.027 1.027 0 01-1.547 0z"
|
41
|
+
fill="#242B42"
|
42
|
+
/>
|
43
|
+
</svg>
|
37
44
|
</div>
|
38
45
|
</div>
|
39
46
|
</div>
|
@@ -75,15 +75,15 @@ test('returns correct icon', () => {
|
|
75
75
|
</>
|
76
76
|
)
|
77
77
|
|
78
|
-
expect(screen.getByTestId('test-cell').querySelector('.
|
79
|
-
expect(screen.getByTestId('test-home').querySelector('.
|
78
|
+
expect(screen.getByTestId('test-cell').querySelector('.pb_custom_icon')).toBeInTheDocument()
|
79
|
+
expect(screen.getByTestId('test-home').querySelector('.pb_custom_icon')).toBeInTheDocument()
|
80
80
|
expect(screen.getByTestId('test-work').querySelector('.pb_icon_kit')).toHaveClass('fa-phone-office')
|
81
|
-
expect(screen.getByTestId('test-work-cell').querySelector('.
|
82
|
-
expect(screen.getByTestId('test-email').querySelector('.pb_custom_icon')).
|
83
|
-
expect(screen.getByTestId('test-wrong-phone').querySelector('.
|
84
|
-
expect(screen.getByTestId('test-wrong-type').querySelector('.
|
81
|
+
expect(screen.getByTestId('test-work-cell').querySelector('.pb_custom_icon')).toBeInTheDocument()
|
82
|
+
expect(screen.getByTestId('test-email').querySelector('.pb_custom_icon')).toBeInTheDocument()
|
83
|
+
expect(screen.getByTestId('test-wrong-phone').querySelector('.pb_custom_icon')).toBeInTheDocument()
|
84
|
+
expect(screen.getByTestId('test-wrong-type').querySelector('.pb_custom_icon')).toBeInTheDocument()
|
85
85
|
expect(screen.getByTestId('test-extension').querySelector('.pb_icon_kit')).toHaveClass('fa-phone-plus')
|
86
|
-
expect(screen.getByTestId('test-empty').querySelector('.
|
86
|
+
expect(screen.getByTestId('test-empty').querySelector('.pb_custom_icon')).toBeInTheDocument()
|
87
87
|
})
|
88
88
|
|
89
89
|
test("not compliant values return null in phone related contact types", () => {
|
@@ -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_custom_icon')
|
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_custom_icon')
|
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_custom_icon')
|
62
62
|
expect(arrowicon).toBeInTheDocument()
|
63
63
|
})
|
64
64
|
|
@@ -1,11 +1,11 @@
|
|
1
|
-
import React, { createContext, useReducer, useContext, useEffect, useMemo } from "react";
|
1
|
+
import React, { createContext, useReducer, useContext, useEffect, useMemo, useRef, useState } 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,9 +31,23 @@ 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
|
34
|
+
const targetItem = newItems.find(item => item.id === targetId);
|
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);
|
35
45
|
const targetIndex = newItems.findIndex(item => item.id === targetId);
|
36
46
|
|
47
|
+
if (draggedIndex === -1 || targetIndex === -1) {
|
48
|
+
return state;
|
49
|
+
}
|
50
|
+
|
37
51
|
newItems.splice(draggedIndex, 1);
|
38
52
|
newItems.splice(targetIndex, 0, draggedItem);
|
39
53
|
|
@@ -48,7 +62,11 @@ const reducer = (state: InitialStateType, action: ActionType) => {
|
|
48
62
|
const DragContext = createContext<any>({});
|
49
63
|
|
50
64
|
export const DraggableContext = () => {
|
51
|
-
|
65
|
+
const context = useContext(DragContext);
|
66
|
+
if (context === undefined) {
|
67
|
+
throw new Error('DraggableContext must be used within a DraggableProvider');
|
68
|
+
}
|
69
|
+
return context;
|
52
70
|
};
|
53
71
|
|
54
72
|
export const DraggableProvider = ({
|
@@ -63,7 +81,11 @@ export const DraggableProvider = ({
|
|
63
81
|
dropZone = { type: 'ghost', color: 'neutral', direction: 'vertical' }
|
64
82
|
}: DraggableProviderType) => {
|
65
83
|
const [state, dispatch] = useReducer(reducer, initialState);
|
66
|
-
|
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
|
+
|
67
89
|
// Parse dropZone prop - handle both string format (backward compatibility) and object format
|
68
90
|
let dropZoneType = 'ghost';
|
69
91
|
let dropZoneColor = 'neutral';
|
@@ -86,45 +108,64 @@ export const DraggableProvider = ({
|
|
86
108
|
|
87
109
|
useEffect(() => {
|
88
110
|
dispatch({ type: 'SET_ITEMS', payload: initialItems });
|
111
|
+
initialItemsRef.current = initialItems;
|
89
112
|
}, [initialItems]);
|
90
113
|
|
91
114
|
useEffect(() => {
|
92
|
-
onReorder
|
93
|
-
|
115
|
+
if (onReorder) {
|
116
|
+
onReorder(state.items);
|
117
|
+
}
|
118
|
+
}, [state.items, onReorder]);
|
94
119
|
|
95
120
|
const handleDragStart = (id: string, container: string) => {
|
96
|
-
|
121
|
+
setIsDragging(true);
|
122
|
+
dispatch({ type: 'SET_DRAG_DATA', payload: { id, initialGroup: container } });
|
97
123
|
dispatch({ type: 'SET_IS_DRAGGING', payload: id });
|
124
|
+
dispatch({ type: 'SET_ACTIVE_CONTAINER', payload: container });
|
98
125
|
if (onDragStart) onDragStart(id, container);
|
99
126
|
};
|
100
127
|
|
101
128
|
const handleDragEnter = (id: string, container: string) => {
|
102
|
-
if (
|
103
|
-
|
104
|
-
|
129
|
+
if (!isDragging || container !== state.activeContainer) return;
|
130
|
+
|
131
|
+
if (state.dragData.id === id) return;
|
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;
|
105
138
|
}
|
139
|
+
|
140
|
+
dispatch({ type: 'REORDER_ITEMS', payload: { dragId: state.dragData.id, targetId: id } });
|
141
|
+
|
106
142
|
if (onDragEnter) onDragEnter(id, container);
|
107
143
|
};
|
108
144
|
|
109
145
|
const handleDragEnd = () => {
|
146
|
+
setIsDragging(false);
|
110
147
|
dispatch({ type: 'SET_IS_DRAGGING', payload: "" });
|
111
148
|
dispatch({ type: 'SET_ACTIVE_CONTAINER', payload: "" });
|
112
149
|
if (onDragEnd) onDragEnd();
|
113
150
|
};
|
114
151
|
|
115
|
-
const changeCategory = (itemId: string, container: string) => {
|
116
|
-
dispatch({ type: 'CHANGE_CATEGORY', payload: { itemId, container } });
|
117
|
-
};
|
118
|
-
|
119
152
|
const handleDrop = (container: string) => {
|
153
|
+
const draggedItem = state.items.find(item => item.id === state.dragData.id);
|
154
|
+
|
155
|
+
if (draggedItem && draggedItem.container !== container) {
|
156
|
+
dispatch({ type: 'CHANGE_CATEGORY', payload: { itemId: state.dragData.id, container } });
|
157
|
+
}
|
158
|
+
|
120
159
|
dispatch({ type: 'SET_IS_DRAGGING', payload: "" });
|
121
160
|
dispatch({ type: 'SET_ACTIVE_CONTAINER', payload: "" });
|
122
|
-
|
161
|
+
|
162
|
+
setIsDragging(false);
|
123
163
|
if (onDrop) onDrop(container);
|
124
164
|
};
|
125
165
|
|
126
166
|
const handleDragOver = (e: Event, container: string) => {
|
127
167
|
e.preventDefault();
|
168
|
+
e.stopPropagation();
|
128
169
|
dispatch({ type: 'SET_ACTIVE_CONTAINER', payload: container });
|
129
170
|
if (onDragOver) onDragOver(e, container);
|
130
171
|
};
|
@@ -144,7 +185,7 @@ export const DraggableProvider = ({
|
|
144
185
|
handleDragEnd,
|
145
186
|
handleDrop,
|
146
187
|
handleDragOver
|
147
|
-
}), [state, dropZoneType, dropZoneColor, dropZoneDirection]);
|
188
|
+
}), [state, dropZoneType, dropZoneColor, dropZoneDirection, handleDragStart, handleDragEnter, handleDragEnd, handleDrop, handleDragOver]);
|
148
189
|
|
149
190
|
return (
|
150
191
|
<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(".pb_custom_icon");
|
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(".pb_custom_icon");
|
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(".pb_custom_icon");
|
189
189
|
expect(dragHandle).toBeInTheDocument();
|
190
190
|
});
|
@@ -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('.pb_custom_icon')
|
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="flag" />
|
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('.pb_custom_icon')
|
186
186
|
expect(customTrigger).toBeInTheDocument()
|
187
187
|
})
|
188
188
|
|
@@ -205,4 +205,26 @@
|
|
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
|
+
}
|
208
230
|
}
|
@@ -16,7 +16,7 @@ describe("Icon Kit", () => {
|
|
16
16
|
)
|
17
17
|
|
18
18
|
const kit = screen.getByTestId(testId)
|
19
|
-
expect(kit).toHaveClass("
|
19
|
+
expect(kit).toHaveClass("pb_custom_icon svg-inline--fa svg_fw")
|
20
20
|
})
|
21
21
|
|
22
22
|
test("renders rotate prop", () => {[
|
@@ -31,7 +31,7 @@ describe("Icon Kit", () => {
|
|
31
31
|
)
|
32
32
|
|
33
33
|
const kit = screen.getByTestId(testId)
|
34
|
-
expect(kit).toHaveClass(`
|
34
|
+
expect(kit).toHaveClass(`pb_custom_icon svg-inline--fa rotate_${rotateProp} svg_fw`)
|
35
35
|
|
36
36
|
cleanup()
|
37
37
|
})
|
@@ -48,7 +48,7 @@ describe("Icon Kit", () => {
|
|
48
48
|
)
|
49
49
|
|
50
50
|
const kit = screen.getByTestId(testId)
|
51
|
-
expect(kit).toHaveClass("
|
51
|
+
expect(kit).toHaveClass("pb_custom_icon svg-inline--fa flip_horizontal svg_fw")
|
52
52
|
})
|
53
53
|
|
54
54
|
|
@@ -63,7 +63,7 @@ describe("Icon Kit", () => {
|
|
63
63
|
)
|
64
64
|
|
65
65
|
const kit = screen.getByTestId(testId)
|
66
|
-
expect(kit).toHaveClass("
|
66
|
+
expect(kit).toHaveClass("pb_custom_icon svg-inline--fa spin svg_fw")
|
67
67
|
})
|
68
68
|
|
69
69
|
test("renders pull icon", () => {
|
@@ -77,7 +77,7 @@ describe("Icon Kit", () => {
|
|
77
77
|
)
|
78
78
|
|
79
79
|
const kit = screen.getByTestId(testId)
|
80
|
-
expect(kit).toHaveClass("
|
80
|
+
expect(kit).toHaveClass("pb_custom_icon svg-inline--fa svg_fw pull_left")
|
81
81
|
})
|
82
82
|
|
83
83
|
test("renders pull icon", () => {
|
@@ -91,7 +91,7 @@ describe("Icon Kit", () => {
|
|
91
91
|
)
|
92
92
|
|
93
93
|
const kit = screen.getByTestId(testId)
|
94
|
-
expect(kit).toHaveClass("
|
94
|
+
expect(kit).toHaveClass("pb_custom_icon svg-inline--fa svg_fw pull_left")
|
95
95
|
})
|
96
96
|
|
97
97
|
test("renders border around icon", () => {
|
@@ -105,7 +105,7 @@ describe("Icon Kit", () => {
|
|
105
105
|
)
|
106
106
|
|
107
107
|
const kit = screen.getByTestId(testId)
|
108
|
-
expect(kit).toHaveClass("
|
108
|
+
expect(kit).toHaveClass("pb_custom_icon svg-inline--fa svg_border svg_fw")
|
109
109
|
})
|
110
110
|
|
111
111
|
test("renders size prop", () => {
|
@@ -132,7 +132,7 @@ describe("Icon Kit", () => {
|
|
132
132
|
)
|
133
133
|
|
134
134
|
const kit = screen.getByTestId(testId)
|
135
|
-
expect(kit).toHaveClass(`
|
135
|
+
expect(kit).toHaveClass(`pb_custom_icon svg-inline--fa svg_${sizeProp} svg_fw`)
|
136
136
|
|
137
137
|
cleanup()
|
138
138
|
})
|
@@ -149,7 +149,7 @@ describe("Icon Kit", () => {
|
|
149
149
|
)
|
150
150
|
|
151
151
|
const kit = screen.getByTestId(testId)
|
152
|
-
expect(kit).toHaveClass("
|
152
|
+
expect(kit).toHaveClass("pb_custom_icon svg-inline--fa svg_fw")
|
153
153
|
})
|
154
154
|
|
155
155
|
test("renders with color prop", () => {
|
@@ -73,7 +73,7 @@ test('adds icon', () => {
|
|
73
73
|
|
74
74
|
const kit = screen.getByTestId('icon-test')
|
75
75
|
|
76
|
-
const icon = kit.querySelector('.
|
76
|
+
const icon = kit.querySelector('.pb_custom_icon')
|
77
77
|
expect(icon).toBeInTheDocument();
|
78
78
|
})
|
79
79
|
|
@@ -87,7 +87,7 @@ test('adds icon right', () => {
|
|
87
87
|
|
88
88
|
const kit = screen.getByTestId('icon-right-test')
|
89
89
|
|
90
|
-
const icon = kit.querySelector('.
|
90
|
+
const icon = kit.querySelector('.pb_custom_icon')
|
91
91
|
expect(icon).toBeInTheDocument();
|
92
92
|
})
|
93
93
|
|
@@ -95,11 +95,13 @@ test('should not have a left border', () => {
|
|
95
95
|
test('should have a right icon', () => {
|
96
96
|
render(<NavDefault iconRight="angle-down" />)
|
97
97
|
const kit = screen.getByTestId(itemTestId)
|
98
|
-
|
98
|
+
const icon = kit.querySelector(".pb_custom_icon.pb_nav_list_item_icon_right")
|
99
|
+
expect(icon).toBeInTheDocument()
|
99
100
|
})
|
100
101
|
|
101
102
|
test('should have a left icon', () => {
|
102
|
-
render(<NavDefault iconLeft="
|
103
|
+
render(<NavDefault iconLeft="angle-up" />)
|
103
104
|
const kit = screen.getByTestId(itemTestId)
|
104
|
-
|
105
|
+
const icon = kit.querySelector(".pb_custom_icon.pb_nav_list_item_icon_left")
|
106
|
+
expect(icon).toBeInTheDocument()
|
105
107
|
})
|
@@ -0,0 +1 @@
|
|
1
|
+
To guarantee the vertical section separator displays properly, please add the `vertical: "stretch"`/`vertical="stretch"` property to the parent container (which is commonly a Flex container). This will stretch the container’s child elements vertically and ensure the section separator appears as expected.
|
@@ -19,23 +19,27 @@ test('it renders preset icon', () => {
|
|
19
19
|
render(
|
20
20
|
<StatChange
|
21
21
|
change="increase"
|
22
|
+
id="preset-icon"
|
22
23
|
value="28.4"
|
23
24
|
/>
|
24
25
|
)
|
25
26
|
|
26
|
-
const kit =
|
27
|
-
|
27
|
+
const kit = document.querySelector('#preset-icon')
|
28
|
+
const icon = kit.querySelector(".pb_custom_icon")
|
29
|
+
expect(icon).toBeInTheDocument()
|
28
30
|
})
|
29
31
|
|
30
32
|
test('it renders custom icon', () => {
|
31
33
|
render(
|
32
34
|
<StatChange
|
33
35
|
icon="chart-line-down"
|
36
|
+
id="custom-icon"
|
34
37
|
value={6.1}
|
35
38
|
/>
|
36
39
|
|
37
40
|
)
|
38
41
|
|
39
|
-
const kit =
|
40
|
-
|
42
|
+
const kit = document.querySelector('#custom-icon')
|
43
|
+
const icon = kit.querySelector(".pb_custom_icon")
|
44
|
+
expect(icon).toBeInTheDocument()
|
41
45
|
})
|
@@ -6,8 +6,16 @@
|
|
6
6
|
&.table-lg {
|
7
7
|
thead, .pb_table_thead {
|
8
8
|
tr, .pb_table_tr {
|
9
|
-
th:not(:has(
|
10
|
-
|
9
|
+
th:not(:has(
|
10
|
+
[class*="pb_body_kit"],
|
11
|
+
[class*="pb_detail_kit"],
|
12
|
+
[class*="pb_title_kit"]
|
13
|
+
)),
|
14
|
+
.pb_table_th:not(:has(
|
15
|
+
[class*="pb_body_kit"],
|
16
|
+
[class*="pb_detail_kit"],
|
17
|
+
[class*="pb_title_kit"]
|
18
|
+
)) {
|
11
19
|
@include caption;
|
12
20
|
}
|
13
21
|
|
@@ -1,11 +1,8 @@
|
|
1
|
-
<%=
|
2
|
-
id: object.id,
|
3
|
-
data: object.data,
|
4
|
-
class: object.classname,
|
1
|
+
<%= pb_content_tag(:div,
|
5
2
|
style: remove_height_properties(combined_html_options[:style]) || "",
|
6
3
|
**combined_html_options.except(:style)) do %>
|
7
4
|
<div class="tooltip_tooltip" id="<%= object.tooltip_id %>" role="tooltip" style="<%= object.height_and_width_helper %>">
|
8
5
|
<%= content.presence %>
|
9
6
|
<div class="arrow" id="<%= object.tooltip_id %>-arrow"></div>
|
10
7
|
</div>
|
11
|
-
<% end %>
|
8
|
+
<% end %>
|
@@ -1,11 +1,8 @@
|
|
1
1
|
<% if object.is_react? %>
|
2
2
|
<%= react_component('Typeahead', object.typeahead_react_options) %>
|
3
3
|
<% else %>
|
4
|
-
<%=
|
5
|
-
|
6
|
-
data: object.data,
|
7
|
-
class: object.classname + object.inline_class,
|
8
|
-
**combined_html_options) do %>
|
4
|
+
<%= pb_content_tag(:div,
|
5
|
+
class: object.classname + object.inline_class) do %>
|
9
6
|
<div class="pb_typeahead_wrapper">
|
10
7
|
<div class="pb_typeahead_loading_indicator" data-pb-typeahead-kit-loading-indicator>
|
11
8
|
<%= pb_rails("icon", props: {
|
@@ -1,9 +1,4 @@
|
|
1
|
-
<%=
|
2
|
-
aria: object.aria,
|
3
|
-
class: object.classname,
|
4
|
-
data: object.data,
|
5
|
-
id: object.id,
|
6
|
-
**combined_html_options) do %>
|
1
|
+
<%= pb_content_tag do %>
|
7
2
|
<% if object.avatar_url.present? || object.avatar %>
|
8
3
|
<%= pb_rails("avatar", props: {
|
9
4
|
name: object.name,
|