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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b783164512f6b5e7e98483119372bb12b40995eb3e6d26e82b404adf26a087f5
4
- data.tar.gz: 95361abd82579e6d3ce4c721386b6939fd878d1d17c040294745b9a30ef9cf1c
3
+ metadata.gz: 0b0dee98ba9f1bca1aaece689189d13e7707261135705a0f55970414e38bdaee
4
+ data.tar.gz: 5bb3723be73e7f3c8471eb9b8dcd0bba2e63c9ed7bef2afb081634d64cb41b4a
5
5
  SHA512:
6
- metadata.gz: 1ec3ee8c3daaaa8a0efa2af68a2a25975d8c8a079b9b8da8cfe3f3e19464801cddcdf8507949cdb04d1cc24399ca29369345de0e05fc83494e515317293cb97b
7
- data.tar.gz: 3a0e4707bfd204588fc5b5559a8d4dc3bc6f628d901b8d8f36ec626ce9f226933583e47649b80a9f7b1fef729ddefafbdc8f146a18bd2e344fd9a53ebcbd297c
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. Use the [activeStyle](https://playbook.powerapp.cloud/kits/dropdown/react#custom-active-style-options) `backgroundColor` and `fontColor` props to create contrast between the Radio selection indicator and the Dropdown selection background indicator.
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 the Rails follow up to [PLAY-2146](https://runway.powerhrg.com/backlog_items/PLAY-2146) (remove this comment afterwards)
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 + compact_class + show_arrow_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 ? " inline " : " "
49
+ inline ? "inline" : ""
48
50
  end
49
51
 
50
52
  def compact_class