playbook_ui 14.23.0.pre.alpha.PLAY2146dropdownactivestylesreact9141 → 14.23.0.pre.alpha.PLAY2148selectclassnamessinglespacesfix9144
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_dropdown/_dropdown.scss +1 -17
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +0 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_radio_options.jsx +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_radio_options_react.md +1 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +2 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_dropdown/dropdown.test.jsx +0 -24
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownOption.tsx +1 -11
- data/app/pb_kits/playbook/pb_select/select.rb +4 -2
- data/dist/chunks/{_weekday_stacked-DVbweLBJ.js → _weekday_stacked-DfH_cGOX.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/playbook-doc.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +3 -6
- data/app/pb_kits/playbook/pb_dropdown/_dropdown_mixin.scss +0 -36
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_active_style_options.jsx +0 -90
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_active_style_options_react.md +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b0dee98ba9f1bca1aaece689189d13e7707261135705a0f55970414e38bdaee
|
4
|
+
data.tar.gz: 5bb3723be73e7f3c8471eb9b8dcd0bba2e63c9ed7bef2afb081634d64cb41b4a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 636193294df1115b7401bf1a64dd158e49a4edf9b46bd8b8a9ee7c7dc289c54dd901a85144cc7057104800677c6e138ec96dd0f0b1e668a8270a39a5d55b54a7
|
7
|
+
data.tar.gz: '038ae63e9295efe8a2ad5acee53c0c323cd536f6f4be904f4345f96ab271456082207fbc17a6e05c80b9788401891dd35791f56b70129cf673e6cf78627959d8'
|
@@ -8,7 +8,6 @@
|
|
8
8
|
@import "../pb_textarea/textarea_mixin";
|
9
9
|
|
10
10
|
@import "./scss_partials/dropdown_animation";
|
11
|
-
@import "dropdown_mixin";
|
12
11
|
|
13
12
|
[class*="pb_dropdown"] {
|
14
13
|
.dropdown_wrapper {
|
@@ -99,23 +98,9 @@
|
|
99
98
|
[class^="pb_title_kit"], a {
|
100
99
|
color: $white !important;
|
101
100
|
}
|
102
|
-
border-bottom: 1px solid $border_light;
|
103
101
|
&:hover {
|
104
|
-
background-color: $product_1_background;
|
105
|
-
}
|
106
|
-
|
107
|
-
// activeStyle font color map
|
108
|
-
@each $name, $color in $font-colors {
|
109
|
-
&.font-#{$name} {
|
110
|
-
@include apply-font-color($color);
|
111
|
-
}
|
102
|
+
background-color: $product_1_background !important;
|
112
103
|
}
|
113
|
-
// activeStyle background color map (no difference between selected and selected+hover custom colors)
|
114
|
-
@each $name, $bg in $background-colors {
|
115
|
-
&.bg-#{$name} {
|
116
|
-
background-color: $bg;
|
117
|
-
}
|
118
|
-
}
|
119
104
|
}
|
120
105
|
}
|
121
106
|
|
@@ -282,7 +267,6 @@
|
|
282
267
|
}
|
283
268
|
&[class*="selected"] {
|
284
269
|
background-color: $primary;
|
285
|
-
border-bottom: rgba($white, 0.15);
|
286
270
|
}
|
287
271
|
}
|
288
272
|
}
|
@@ -39,10 +39,6 @@ type DropdownProps = {
|
|
39
39
|
options: GenericObject;
|
40
40
|
separators?: boolean;
|
41
41
|
variant?: "default" | "subtle";
|
42
|
-
activeStyle?: {
|
43
|
-
backgroundColor?: string;
|
44
|
-
fontColor?: string;
|
45
|
-
};
|
46
42
|
};
|
47
43
|
|
48
44
|
interface DropdownComponent
|
@@ -73,7 +69,6 @@ let Dropdown = (props: DropdownProps, ref: any): React.ReactElement | null => {
|
|
73
69
|
options,
|
74
70
|
separators = true,
|
75
71
|
variant = "default",
|
76
|
-
activeStyle,
|
77
72
|
} = props;
|
78
73
|
|
79
74
|
const ariaProps = buildAriaProps(aria);
|
@@ -256,7 +251,6 @@ let Dropdown = (props: DropdownProps, ref: any): React.ReactElement | null => {
|
|
256
251
|
>
|
257
252
|
<DropdownContext.Provider
|
258
253
|
value={{
|
259
|
-
activeStyle,
|
260
254
|
autocomplete,
|
261
255
|
dropdownContainerRef,
|
262
256
|
filteredOptions,
|
@@ -18,7 +18,6 @@ const DropdownCustomRadioOptions = (props) => {
|
|
18
18
|
return (
|
19
19
|
<div>
|
20
20
|
<Dropdown
|
21
|
-
activeStyle={{ backgroundColor: "bg_light", fontColor: "text_lt_default" }}
|
22
21
|
label="Select Item"
|
23
22
|
onSelect={(selectedItem) => setSelectedValue(selectedItem?.value)}
|
24
23
|
options={options}
|
@@ -1 +1 @@
|
|
1
|
-
Radio inputs can be used inside `Dropdown.Option` for a custom layout that mimics form-like selection within a dropdown.
|
1
|
+
Radio inputs can be used inside `Dropdown.Option` for a custom layout that mimics form-like selection within a dropdown.
|
@@ -16,7 +16,7 @@ examples:
|
|
16
16
|
- dropdown_with_search_rails: Custom Trigger Dropdown with Search
|
17
17
|
- dropdown_with_custom_padding: Custom Option Padding
|
18
18
|
- dropdown_with_custom_icon_options: Custom Icon Options
|
19
|
-
# - dropdown_with_custom_radio_options: Custom Radio Options # TODO: Update and publish doc ex in
|
19
|
+
# - dropdown_with_custom_radio_options: Custom Radio Options # TODO: Update and publish doc ex in [PLAY-2146](https://runway.powerhrg.com/backlog_items/PLAY-2146) (remove this comment afterwards)
|
20
20
|
- dropdown_error: Dropdown with Error
|
21
21
|
- dropdown_default_value: Default Value
|
22
22
|
- dropdown_multi_select_with_default: Multi Select Default Value
|
@@ -39,9 +39,8 @@ examples:
|
|
39
39
|
- dropdown_with_custom_trigger: Custom Trigger
|
40
40
|
- dropdown_with_search: Custom Trigger Dropdown with Search
|
41
41
|
- dropdown_with_custom_padding: Custom Option Padding
|
42
|
-
- dropdown_with_custom_active_style_options: Custom Active Style Options
|
43
42
|
- dropdown_with_custom_icon_options: Custom Icon Options
|
44
|
-
- dropdown_with_custom_radio_options: Custom Radio Options
|
43
|
+
# - dropdown_with_custom_radio_options: Custom Radio Options # TODO: Update and publish doc ex in [PLAY-2146](https://runway.powerhrg.com/backlog_items/PLAY-2146) (remove this comment afterwards)
|
45
44
|
- dropdown_error: Dropdown with Error
|
46
45
|
- dropdown_default_value: Default Value
|
47
46
|
- dropdown_multi_select_with_default: Multi Select Default Value
|
@@ -21,5 +21,4 @@ export { default as DropdownMultiSelectWithAutocomplete } from './_dropdown_mult
|
|
21
21
|
export { default as DropdownMultiSelectWithDefault } from './_dropdown_multi_select_with_default.jsx'
|
22
22
|
export { default as DropdownMultiSelectWithCustomOptions } from './_dropdown_multi_select_with_custom_options.jsx'
|
23
23
|
export {default as DropdownWithCustomIconOptions} from './_dropdown_with_custom_icon_options.jsx'
|
24
|
-
export {default as DropdownWithCustomRadioOptions} from './_dropdown_with_custom_radio_options.jsx'
|
25
|
-
export {default as DropdownWithCustomActiveStyleOptions} from './_dropdown_with_custom_active_style_options.jsx'
|
24
|
+
export {default as DropdownWithCustomRadioOptions} from './_dropdown_with_custom_radio_options.jsx'
|
@@ -369,28 +369,4 @@ test("defaultValue works with multiSelect", () => {
|
|
369
369
|
const option2 = Array.from(kit.querySelectorAll(".pb_dropdown_option_list"));
|
370
370
|
const firstOpt = options[0].label
|
371
371
|
expect(option2[0]).not.toHaveTextContent(firstOpt)
|
372
|
-
})
|
373
|
-
|
374
|
-
test("applies activeStyle backgroundColor and fontColor when selected", () => {
|
375
|
-
render(
|
376
|
-
<Dropdown
|
377
|
-
activeStyle={{
|
378
|
-
backgroundColor: "bg_light",
|
379
|
-
fontColor: "primary",
|
380
|
-
}}
|
381
|
-
data={{ testid: testId }}
|
382
|
-
options={options}
|
383
|
-
/>
|
384
|
-
)
|
385
|
-
|
386
|
-
const kit = screen.getByTestId(testId)
|
387
|
-
const option = kit.querySelectorAll(".pb_dropdown_option_list")[1]
|
388
|
-
|
389
|
-
fireEvent.click(option)
|
390
|
-
|
391
|
-
const selected = kit.querySelector(".pb_dropdown_option_selected")
|
392
|
-
|
393
|
-
expect(selected).toBeInTheDocument()
|
394
|
-
expect(selected).toHaveClass("bg-bg_light")
|
395
|
-
expect(selected).toHaveClass("font-primary")
|
396
372
|
})
|
@@ -41,7 +41,6 @@ const DropdownOption = (props: DropdownOptionProps) => {
|
|
41
41
|
} = props;
|
42
42
|
|
43
43
|
const {
|
44
|
-
activeStyle,
|
45
44
|
filteredOptions,
|
46
45
|
filterItem,
|
47
46
|
focusedOptionIndex,
|
@@ -60,6 +59,7 @@ const DropdownOption = (props: DropdownOptionProps) => {
|
|
60
59
|
? selected.some((item) => item.label === option?.label)
|
61
60
|
: (selected as GenericObject)?.label === option?.label;
|
62
61
|
|
62
|
+
|
63
63
|
if (!isItemMatchingFilter(option) || (multiSelect && isSelected)) {
|
64
64
|
return null;
|
65
65
|
}
|
@@ -70,14 +70,6 @@ const DropdownOption = (props: DropdownOptionProps) => {
|
|
70
70
|
|
71
71
|
const selectedClass = isSelected ? "selected" : "list";
|
72
72
|
|
73
|
-
|
74
|
-
const bgTokenClass = activeStyle?.backgroundColor
|
75
|
-
? `bg-${activeStyle.backgroundColor}`
|
76
|
-
: "";
|
77
|
-
const fontTokenClass = activeStyle?.fontColor
|
78
|
-
? `font-${activeStyle.fontColor}`
|
79
|
-
: "";
|
80
|
-
|
81
73
|
const ariaProps = buildAriaProps(aria);
|
82
74
|
const dataProps = buildDataProps(data);
|
83
75
|
const htmlProps = buildHtmlProps(htmlOptions);
|
@@ -87,8 +79,6 @@ const DropdownOption = (props: DropdownOptionProps) => {
|
|
87
79
|
selectedClass,
|
88
80
|
focusedClass,
|
89
81
|
),
|
90
|
-
bgTokenClass,
|
91
|
-
fontTokenClass,
|
92
82
|
globalProps(props),
|
93
83
|
className
|
94
84
|
);
|
@@ -24,7 +24,9 @@ module Playbook
|
|
24
24
|
prop :validation_message, type: Playbook::Props::String, default: ""
|
25
25
|
|
26
26
|
def classnames
|
27
|
-
classname + inline_class
|
27
|
+
([classname] + [inline_class, compact_class, show_arrow_class])
|
28
|
+
.reject(&:empty?)
|
29
|
+
.join(" ")
|
28
30
|
end
|
29
31
|
|
30
32
|
def all_attributes
|
@@ -44,7 +46,7 @@ module Playbook
|
|
44
46
|
end
|
45
47
|
|
46
48
|
def inline_class
|
47
|
-
inline ? "
|
49
|
+
inline ? "inline" : ""
|
48
50
|
end
|
49
51
|
|
50
52
|
def compact_class
|