playbook_ui 13.25.0.pre.alpha.PLAY761globalpaddingpropsbuttons2713 → 13.25.0.pre.alpha.PLAY1249fixTooltipswrappingformelementscausingmisalignment2785

Sign up to get free protection for your applications and to get access to all the features.
Files changed (151) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.html.erb +10 -14
  3. data/app/pb_kits/playbook/pb_advanced_table/table_body.html.erb +5 -9
  4. data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +2 -6
  5. data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +2 -6
  6. data/app/pb_kits/playbook/pb_avatar_action_button/avatar_action_button.html.erb +1 -6
  7. data/app/pb_kits/playbook/pb_background/background.html.erb +2 -11
  8. data/app/pb_kits/playbook/pb_badge/badge.html.erb +1 -6
  9. data/app/pb_kits/playbook/pb_body/_body.tsx +1 -1
  10. data/app/pb_kits/playbook/pb_body/body.html.erb +1 -6
  11. data/app/pb_kits/playbook/pb_bread_crumbs/bread_crumb_item.html.erb +1 -6
  12. data/app/pb_kits/playbook/pb_bread_crumbs/bread_crumbs.html.erb +2 -7
  13. data/app/pb_kits/playbook/pb_button/button.html.erb +2 -3
  14. data/app/pb_kits/playbook/pb_button_toolbar/button_toolbar.html.erb +2 -7
  15. data/app/pb_kits/playbook/pb_caption/caption.html.erb +1 -6
  16. data/app/pb_kits/playbook/pb_card/card.html.erb +1 -7
  17. data/app/pb_kits/playbook/pb_card/card_body.html.erb +1 -6
  18. data/app/pb_kits/playbook/pb_card/card_header.html.erb +1 -6
  19. data/app/pb_kits/playbook/pb_checkbox/checkbox.html.erb +1 -6
  20. data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.html.erb +1 -6
  21. data/app/pb_kits/playbook/pb_collapsible/collapsible.html.erb +1 -6
  22. data/app/pb_kits/playbook/pb_collapsible/collapsible_content.html.erb +1 -6
  23. data/app/pb_kits/playbook/pb_collapsible/collapsible_main.html.erb +1 -7
  24. data/app/pb_kits/playbook/pb_contact/contact.html.erb +1 -6
  25. data/app/pb_kits/playbook/pb_currency/currency.html.erb +1 -6
  26. data/app/pb_kits/playbook/pb_currency/docs/_currency_alignment_swift.md +43 -0
  27. data/app/pb_kits/playbook/pb_currency/docs/_currency_props_swift.md +12 -0
  28. data/app/pb_kits/playbook/pb_currency/docs/_currency_size_swift.md +31 -0
  29. data/app/pb_kits/playbook/pb_currency/docs/example.yml +5 -0
  30. data/app/pb_kits/playbook/pb_dashboard_value/dashboard_value.html.erb +1 -6
  31. data/app/pb_kits/playbook/pb_date/date.html.erb +1 -6
  32. data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +2 -6
  33. data/app/pb_kits/playbook/pb_date_range_inline/date_range_inline.html.erb +1 -5
  34. data/app/pb_kits/playbook/pb_date_range_stacked/date_range_stacked.html.erb +1 -5
  35. data/app/pb_kits/playbook/pb_date_range_stacked/docs/_date_range_stacked_default_swift.md +14 -0
  36. data/app/pb_kits/playbook/pb_date_range_stacked/docs/_date_range_stacked_props_swift.md +9 -0
  37. data/app/pb_kits/playbook/pb_date_range_stacked/docs/example.yml +4 -0
  38. data/app/pb_kits/playbook/pb_date_stacked/date_stacked.html.erb +1 -5
  39. data/app/pb_kits/playbook/pb_date_time/date_time.html.erb +1 -6
  40. data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.html.erb +1 -7
  41. data/app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.html.erb +1 -5
  42. data/app/pb_kits/playbook/pb_detail/detail.html.erb +1 -6
  43. data/app/pb_kits/playbook/pb_dialog/_dialog.scss +4 -2
  44. data/app/pb_kits/playbook/pb_dialog/dialog.html.erb +1 -6
  45. data/app/pb_kits/playbook/pb_dialog/dialog_body.html.erb +2 -7
  46. data/app/pb_kits/playbook/pb_dialog/dialog_footer.html.erb +1 -5
  47. data/app/pb_kits/playbook/pb_dialog/dialog_header.html.erb +2 -6
  48. data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +14 -9
  49. data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +34 -6
  50. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default.jsx +5 -5
  51. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default.md +0 -0
  52. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete.jsx +87 -0
  53. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete.md +1 -0
  54. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_and_custom_display.jsx +102 -0
  55. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_and_custom_display.md +1 -0
  56. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display.jsx +4 -2
  57. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display.md +3 -0
  58. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_options.jsx +5 -5
  59. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_options.md +1 -0
  60. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_padding.jsx +51 -0
  61. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_padding.md +1 -0
  62. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_trigger.jsx +5 -5
  63. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_trigger.md +1 -0
  64. data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +3 -0
  65. data/app/pb_kits/playbook/pb_dropdown/docs/index.js +3 -0
  66. data/app/pb_kits/playbook/pb_dropdown/hooks/useHandleOnKeydown.tsx +11 -6
  67. data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownContainer.tsx +5 -0
  68. data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownOption.tsx +41 -24
  69. data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownTrigger.tsx +91 -47
  70. data/app/pb_kits/playbook/pb_file_upload/file_upload.html.erb +1 -6
  71. data/app/pb_kits/playbook/pb_filter/filter.html.erb +1 -5
  72. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.html.erb +1 -6
  73. data/app/pb_kits/playbook/pb_flex/flex.html.erb +1 -5
  74. data/app/pb_kits/playbook/pb_flex/flex_item.html.erb +2 -6
  75. data/app/pb_kits/playbook/pb_form_group/form_group.html.erb +1 -6
  76. data/app/pb_kits/playbook/pb_form_pill/form_pill.html.erb +1 -1
  77. data/app/pb_kits/playbook/pb_hashtag/hashtag.html.erb +1 -6
  78. data/app/pb_kits/playbook/pb_highlight/highlight.html.erb +1 -5
  79. data/app/pb_kits/playbook/pb_home_address_street/home_address_street.html.erb +1 -5
  80. data/app/pb_kits/playbook/pb_icon_circle/icon_circle.html.erb +2 -7
  81. data/app/pb_kits/playbook/pb_icon_stat_value/icon_stat_value.html.erb +1 -6
  82. data/app/pb_kits/playbook/pb_icon_value/icon_value.html.erb +1 -6
  83. data/app/pb_kits/playbook/pb_label_pill/label_pill.html.erb +1 -6
  84. data/app/pb_kits/playbook/pb_label_value/label_value.html.erb +1 -6
  85. data/app/pb_kits/playbook/pb_layout/body.html.erb +1 -5
  86. data/app/pb_kits/playbook/pb_layout/footer.html.erb +1 -5
  87. data/app/pb_kits/playbook/pb_layout/header.html.erb +1 -5
  88. data/app/pb_kits/playbook/pb_layout/item.html.erb +1 -5
  89. data/app/pb_kits/playbook/pb_layout/layout.html.erb +1 -5
  90. data/app/pb_kits/playbook/pb_layout/sidebar.html.erb +1 -5
  91. data/app/pb_kits/playbook/pb_list/item.html.erb +2 -8
  92. data/app/pb_kits/playbook/pb_list/list.html.erb +2 -8
  93. data/app/pb_kits/playbook/pb_loading_inline/loading_inline.html.erb +1 -6
  94. data/app/pb_kits/playbook/pb_message/message.html.erb +1 -6
  95. data/app/pb_kits/playbook/pb_message/message_mention.html.erb +1 -6
  96. data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.html.erb +1 -6
  97. data/app/pb_kits/playbook/pb_multiple_users/multiple_users.html.erb +1 -6
  98. data/app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.html.erb +1 -6
  99. data/app/pb_kits/playbook/pb_nav/item.html.erb +3 -14
  100. data/app/pb_kits/playbook/pb_nav/nav.html.erb +1 -6
  101. data/app/pb_kits/playbook/pb_online_status/online_status.html.erb +2 -6
  102. data/app/pb_kits/playbook/pb_pagination/pagination.html.erb +1 -6
  103. data/app/pb_kits/playbook/pb_passphrase/passphrase.html.erb +1 -1
  104. data/app/pb_kits/playbook/pb_person/person.html.erb +7 -12
  105. data/app/pb_kits/playbook/pb_person_contact/person_contact.html.erb +1 -6
  106. data/app/pb_kits/playbook/pb_pill/pill.html.erb +1 -6
  107. data/app/pb_kits/playbook/pb_popover/popover.html.erb +1 -6
  108. data/app/pb_kits/playbook/pb_progress_pills/progress_pills.html.erb +2 -6
  109. data/app/pb_kits/playbook/pb_progress_simple/progress_simple.html.erb +3 -6
  110. data/app/pb_kits/playbook/pb_progress_step/progress_step.html.erb +1 -5
  111. data/app/pb_kits/playbook/pb_progress_step/progress_step_item.html.erb +1 -5
  112. data/app/pb_kits/playbook/pb_radio/radio.html.erb +2 -8
  113. data/app/pb_kits/playbook/pb_section_separator/_section_separator.scss +6 -2
  114. data/app/pb_kits/playbook/pb_section_separator/_section_separator_mixin.scss +11 -1
  115. data/app/pb_kits/playbook/pb_section_separator/section_separator.html.erb +1 -6
  116. data/app/pb_kits/playbook/pb_select/select.html.erb +1 -5
  117. data/app/pb_kits/playbook/pb_selectable_card/selectable_card.html.erb +1 -5
  118. data/app/pb_kits/playbook/pb_selectable_card_icon/selectable_card_icon.html.erb +1 -4
  119. data/app/pb_kits/playbook/pb_selectable_icon/selectable_icon.html.erb +1 -5
  120. data/app/pb_kits/playbook/pb_selectable_list/selectable_list.html.erb +1 -6
  121. data/app/pb_kits/playbook/pb_selectable_list/selectable_list_item.html.erb +1 -6
  122. data/app/pb_kits/playbook/pb_source/source.html.erb +1 -5
  123. data/app/pb_kits/playbook/pb_star_rating/star_rating.html.erb +1 -5
  124. data/app/pb_kits/playbook/pb_stat_change/stat_change.html.erb +1 -5
  125. data/app/pb_kits/playbook/pb_stat_value/stat_value.html.erb +1 -5
  126. data/app/pb_kits/playbook/pb_table/table.html.erb +2 -12
  127. data/app/pb_kits/playbook/pb_table/table_body.html.erb +6 -16
  128. data/app/pb_kits/playbook/pb_table/table_cell.html.erb +6 -16
  129. data/app/pb_kits/playbook/pb_table/table_head.html.erb +6 -16
  130. data/app/pb_kits/playbook/pb_table/table_header.html.erb +4 -13
  131. data/app/pb_kits/playbook/pb_table/table_row.html.erb +6 -16
  132. data/app/pb_kits/playbook/pb_textarea/textarea.html.erb +1 -5
  133. data/app/pb_kits/playbook/pb_time/time.html.erb +1 -5
  134. data/app/pb_kits/playbook/pb_time_range_inline/time_range_inline.html.erb +1 -5
  135. data/app/pb_kits/playbook/pb_time_stacked/time_stacked.html.erb +1 -5
  136. data/app/pb_kits/playbook/pb_timeline/item.html.erb +3 -7
  137. data/app/pb_kits/playbook/pb_timeline/timeline.html.erb +1 -5
  138. data/app/pb_kits/playbook/pb_timestamp/timestamp.html.erb +1 -6
  139. data/app/pb_kits/playbook/pb_title/title.html.erb +1 -6
  140. data/app/pb_kits/playbook/pb_title_count/title_count.html.erb +1 -6
  141. data/app/pb_kits/playbook/pb_title_detail/title_detail.html.erb +1 -5
  142. data/app/pb_kits/playbook/pb_toggle/toggle.html.erb +1 -6
  143. data/app/pb_kits/playbook/pb_tooltip/_tooltip.tsx +1 -1
  144. data/app/pb_kits/playbook/pb_tooltip/tooltip.html.erb +1 -5
  145. data/app/pb_kits/playbook/pb_user/user.html.erb +1 -6
  146. data/app/pb_kits/playbook/pb_user_badge/user_badge.html.erb +1 -6
  147. data/app/pb_kits/playbook/pb_weekday_stacked/weekday_stacked.html.erb +1 -6
  148. data/dist/playbook-rails.js +4 -4
  149. data/lib/playbook/kit_base.rb +1 -1
  150. data/lib/playbook/version.rb +1 -1
  151. metadata +17 -2
@@ -4,8 +4,9 @@ import {
4
4
  buildAriaProps,
5
5
  buildCss,
6
6
  buildDataProps,
7
+ buildHtmlProps,
7
8
  } from "../../utilities/props";
8
- import { globalProps } from "../../utilities/globalProps";
9
+ import { globalProps, GlobalProps } from "../../utilities/globalProps";
9
10
 
10
11
  import DropdownContext from "../context";
11
12
 
@@ -19,16 +20,33 @@ type DropdownOptionProps = {
19
20
  className?: string;
20
21
  children?: React.ReactChild[] | React.ReactChild;
21
22
  data?: { [key: string]: string };
23
+ htmlOptions?: { [key: string]: string | number | boolean | (() => void) };
22
24
  id?: string;
23
25
  option?: GenericObject;
24
26
  key?: string;
25
- };
27
+ padding?: string;
28
+ } & GlobalProps;
26
29
 
27
30
  const DropdownOption = (props: DropdownOptionProps) => {
28
- const { aria = {}, className, children, data = {}, id, option, key } = props;
31
+ const {
32
+ aria = {},
33
+ className,
34
+ children,
35
+ data = {},
36
+ htmlOptions = {},
37
+ id,
38
+ option,
39
+ key,
40
+ padding = "xs",
41
+ } = props;
29
42
 
30
- const { handleOptionClick, selected, filterItem, filteredOptions, focusedOptionIndex } =
31
- useContext(DropdownContext);
43
+ const {
44
+ handleOptionClick,
45
+ selected,
46
+ filterItem,
47
+ filteredOptions,
48
+ focusedOptionIndex,
49
+ } = useContext(DropdownContext);
32
50
 
33
51
  const isItemMatchingFilter = (option: GenericObject) =>
34
52
  option?.label.toLowerCase().includes(filterItem.toLowerCase());
@@ -36,37 +54,42 @@ const DropdownOption = (props: DropdownOptionProps) => {
36
54
  if (!isItemMatchingFilter(option)) {
37
55
  return null;
38
56
  }
39
- const isFocused = focusedOptionIndex >= 0 && filteredOptions[focusedOptionIndex].label === option.label
40
- const focusedClass = isFocused && "dropdown_option_focused"
57
+ const isFocused =
58
+ focusedOptionIndex >= 0 &&
59
+ filteredOptions[focusedOptionIndex].label === option.label;
60
+ const focusedClass = isFocused && "dropdown_option_focused";
41
61
 
42
62
  const selectedClass = `${
43
63
  selected.label === option.label
44
- ? "dropdown_option_selected"
45
- : "dropdown_option_list"
46
- }`
64
+ ? "dropdown_option_selected"
65
+ : "dropdown_option_list"
66
+ }`;
47
67
  const ariaProps = buildAriaProps(aria);
48
68
  const dataProps = buildDataProps(data);
69
+ const htmlProps = buildHtmlProps(htmlOptions);
49
70
  const classes = classnames(
50
71
  buildCss("pb_dropdown_option"),
51
72
  selectedClass,
52
73
  focusedClass,
53
- globalProps(props),
74
+ globalProps(props, {padding}),
54
75
  className
55
76
  );
56
77
 
57
78
  return (
58
- <div {...ariaProps}
59
- {...dataProps}
60
- className={classes}
61
- id={id}
79
+ <div
80
+ {...ariaProps}
81
+ {...dataProps}
82
+ {...htmlProps}
83
+ className={classes}
84
+ id={id}
62
85
  key={key}
86
+ onClick= {() => handleOptionClick(option)}
63
87
  >
64
88
  <ListItem
65
89
  cursor="pointer"
66
90
  data-name={option.value}
67
- htmlOptions={{ onClick: () => handleOptionClick(option) }}
68
91
  key={option.label}
69
- padding="xs"
92
+ padding="none"
70
93
  >
71
94
  <Flex
72
95
  align="center"
@@ -75,13 +98,7 @@ const DropdownOption = (props: DropdownOptionProps) => {
75
98
  paddingX="sm"
76
99
  paddingY="xxs"
77
100
  >
78
- {
79
- children ? (
80
- children
81
- ) : (
82
- <Body text={option.label}/>
83
- )
84
- }
101
+ {children ? children : <Body text={option.label} />}
85
102
  </Flex>
86
103
  </ListItem>
87
104
  </div>
@@ -4,6 +4,7 @@ import {
4
4
  buildAriaProps,
5
5
  buildCss,
6
6
  buildDataProps,
7
+ buildHtmlProps
7
8
  } from "../../utilities/props";
8
9
  import { globalProps } from "../../utilities/globalProps";
9
10
  import { useHandleOnKeyDown } from "../hooks/useHandleOnKeydown";
@@ -21,11 +22,22 @@ type DropdownTriggerProps = {
21
22
  className?: string;
22
23
  customDisplay?: React.ReactChild[] | React.ReactChild;
23
24
  data?: { [key: string]: string };
25
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
24
26
  id?: string;
27
+ placeholder?: string;
25
28
  };
26
29
 
27
30
  const DropdownTrigger = (props: DropdownTriggerProps) => {
28
- const { aria = {}, className, children, customDisplay, data = {}, id } = props;
31
+ const {
32
+ aria = {},
33
+ className,
34
+ children,
35
+ customDisplay,
36
+ data = {},
37
+ htmlOptions = {},
38
+ id,
39
+ placeholder,
40
+ } = props;
29
41
 
30
42
  const {
31
43
  autocomplete,
@@ -37,87 +49,119 @@ const DropdownTrigger = (props: DropdownTriggerProps) => {
37
49
  isDropDownClosed,
38
50
  inputRef,
39
51
  isInputFocused,
40
- setIsInputFocused
52
+ setIsInputFocused,
41
53
  } = useContext(DropdownContext);
42
-
54
+
43
55
  const handleKeyDown = useHandleOnKeyDown();
44
56
 
45
57
  const ariaProps = buildAriaProps(aria);
46
58
  const dataProps = buildDataProps(data);
59
+ const htmlProps = buildHtmlProps(htmlOptions);
47
60
  const classes = classnames(
48
61
  buildCss("pb_dropdown_trigger"),
49
62
  globalProps(props),
50
63
  className
51
64
  );
52
65
 
66
+ const triggerWrapperClasses = `dropdown_trigger_wrapper ${
67
+ isInputFocused && "dropdown_trigger_wrapper_focus"
68
+ } ${!autocomplete && "dropdown_trigger_wrapper_select_only"}`;
69
+
70
+ const customDisplayPlaceholder = selected.label ? (
71
+ <b>{selected.label}</b>
72
+ ) : autocomplete ? (
73
+ ""
74
+ ) : placeholder ? (
75
+ placeholder
76
+ ) : (
77
+ "Select..."
78
+ );
79
+
80
+ const defaultDisplayPlaceholder = selected.label
81
+ ? selected.label
82
+ : autocomplete
83
+ ? ""
84
+ : placeholder
85
+ ? placeholder
86
+ : "Select...";
87
+
53
88
  return (
54
89
  <div {...ariaProps}
55
90
  {...dataProps}
91
+ {...htmlProps}
56
92
  className={classes}
57
93
  id={id}
58
94
  >
59
95
  {children ? (
60
96
  <div
61
97
  onClick={() => toggleDropdown()}
98
+ onKeyDown= {handleKeyDown}
62
99
  style={{ display: "inline-block" }}
100
+ tabIndex= {0}
63
101
  >
64
102
  {children}
65
103
  </div>
66
104
  ) : (
67
105
  <>
68
- <Flex align="center"
106
+ <Flex
107
+ align="center"
69
108
  borderRadius="lg"
70
- className={`dropdown_trigger_wrapper ${isInputFocused && 'dropdown_trigger_wrapper_focus'}`}
71
- cursor="pointer"
72
- htmlOptions={{
73
- onClick: () => handleWrapperClick(),
109
+ className={triggerWrapperClasses}
110
+ cursor={`${autocomplete ? "text" : "pointer"}`}
111
+ htmlOptions={{
112
+ onClick: () => handleWrapperClick(),
74
113
  onKeyDown: handleKeyDown,
75
- tabIndex:"0",
114
+ tabIndex: "0",
76
115
  }}
77
116
  justify="between"
78
117
  paddingX="sm"
79
118
  paddingY="xs"
80
119
  >
81
120
  <FlexItem>
82
- <Flex align="center">
83
- {customDisplay ? (
84
- <Flex align="center">
85
- {customDisplay}
86
- <Body paddingLeft={`${selected.label ? "xs" : "none"}`}>
87
- {selected.label ? <b>{selected.label}</b> : autocomplete ? "" : "Select..." }
88
- </Body>
89
- </Flex>
90
- ) : (
91
- <Body text={selected.label ? selected.label : autocomplete ? "" : "Select..."} />
92
- )
93
- }
94
- {
95
- autocomplete && (
96
- <input
97
- className="dropdown_input"
98
- onChange={handleChange}
99
- onClick={() => toggleDropdown()}
100
- onFocus={() => setIsInputFocused(true)}
101
- onKeyDown={handleKeyDown}
102
- placeholder={selected.label ? "" : "Select..."}
103
- ref={inputRef}
104
- value={filterItem}
105
- />
106
- )
107
- }
108
-
109
- </Flex>
110
- </FlexItem>
111
- <FlexItem>
112
- <Body display="flex"
113
- key={`${isDropDownClosed ? "chevron-down" : 'chevron-up'}`}
114
- >
115
- <Icon cursor="pointer"
116
- icon={`${isDropDownClosed ? "chevron-down" : 'chevron-up'}`}
117
- size="sm"
118
- />
119
- </Body>
121
+ <Flex align="center">
122
+ {customDisplay ? (
123
+ <Flex align="center">
124
+ {customDisplay}
125
+ <Body paddingLeft={`${selected.label ? "xs" : "none"}`}>
126
+ {customDisplayPlaceholder}
127
+ </Body>
128
+ </Flex>
129
+ ) : (
130
+ <Body text={defaultDisplayPlaceholder} />
131
+ )}
132
+ {autocomplete && (
133
+ <input
134
+ className="dropdown_input"
135
+ onChange={handleChange}
136
+ onClick={() => toggleDropdown()}
137
+ onFocus={() => setIsInputFocused(true)}
138
+ onKeyDown={handleKeyDown}
139
+ placeholder={
140
+ selected.label
141
+ ? ""
142
+ : placeholder
143
+ ? placeholder
144
+ : "Select..."
145
+ }
146
+ ref={inputRef}
147
+ value={filterItem}
148
+ />
149
+ )}
150
+ </Flex>
120
151
  </FlexItem>
152
+ <Body
153
+ display="flex"
154
+ htmlOptions={{
155
+ onClick: (e: Event) => {e.stopPropagation();handleWrapperClick()}
156
+ }}
157
+ key={`${isDropDownClosed ? "chevron-down" : "chevron-up"}`}
158
+ >
159
+ <Icon
160
+ cursor="pointer"
161
+ icon={`${isDropDownClosed ? "chevron-down" : "chevron-up"}`}
162
+ size="sm"
163
+ />
164
+ </Body>
121
165
  </Flex>
122
166
  </>
123
167
  )}
@@ -1,9 +1,4 @@
1
- <%= content_tag("div",
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
  <%= pb_rails("form_group", props: {cursor: "pointer", full_width: object.full_width}) do %>
8
3
  <label for="upload-<%= object.id %>" class="pb_button_kit_secondary_inline_enabled"><%= "#{object.label}" %></label>
9
4
  <%= pb_rails("text_input", props: {
@@ -1,8 +1,4 @@
1
- <%= content_tag(:div,
2
- id: object.id,
3
- data: object.data,
4
- class: object.classname,
5
- **combined_html_options) do %>
1
+ <%= pb_content_tag do %>
6
2
  <%= object.wrapper do %>
7
3
  <%= pb_rails("flex", props: { orientation: "row", padding_right: "lg", vertical: "center" }) do %>
8
4
  <% if (object.template != "sort_only") %>
@@ -1,9 +1,4 @@
1
- <%= content_tag(:div,
2
- aria: object.aria,
3
- id: object.id,
4
- data: object.data,
5
- class: object.classname,
6
- **combined_html_options) do %>
1
+ <%= pb_content_tag do %>
7
2
  <%= pb_rails("icon", props: { icon: object.icon_value, classname: "pb_icon", fixed_width: true }) %>
8
3
 
9
4
  <% if content %>
@@ -1,7 +1,3 @@
1
- <%= content_tag(:div,
2
- id: object.id,
3
- data: object.data,
4
- class: object.classname,
5
- **combined_html_options) do %>
1
+ <%= pb_content_tag do %>
6
2
  <%= content.presence %>
7
3
  <% end %>
@@ -1,8 +1,4 @@
1
- <%= content_tag(:div,
2
- id: object.id,
3
- data: object.data,
4
- class: object.classname,
5
- style: object.style_value,
6
- **combined_html_options) do %>
1
+ <%= pb_content_tag(:div,
2
+ style: object.style_value) do %>
7
3
  <%= content.presence %>
8
4
  <% end %>
@@ -1,8 +1,3 @@
1
- <%= content_tag(:div,
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
  <%= content.presence %>
8
3
  <% end %>
@@ -1,4 +1,4 @@
1
- <%= content_tag(:div, id: object.id, data: object.data, class: object.classname + object.size_class, **combined_html_options) do %>
1
+ <%= pb_content_tag(:div, class: object.classname + object.size_class) do %>
2
2
  <% if object.name.present? %>
3
3
  <%= pb_rails("avatar", props: { name: object.name, image_url: object.avatar_url, size: "xs" }) %>
4
4
  <%= pb_rails("title", props: { text: object.name, size: 4, classname: "pb_form_pill_text" }) %>
@@ -1,9 +1,4 @@
1
- <%= content_tag(:span,
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(:span) do %>
7
2
  <%= link_to object.url, target: object.link_option do %>
8
3
  <%= pb_rails("badge", props: { dark: object.dark, variant: "primary", text: object.hashtag_text }) %>
9
4
  <% end %>
@@ -1,8 +1,4 @@
1
- <%= content_tag(:span,
2
- id: object.id,
3
- data: object.data,
4
- class: object.classname,
5
- **combined_html_options) do %>
1
+ <%= pb_content_tag(:span) do %>
6
2
  <mark>
7
3
  <%= content.presence || object.text %>
8
4
  </mark>
@@ -1,8 +1,4 @@
1
- <%= content_tag(:div,
2
- id: object.id,
3
- data: object.data,
4
- class: object.classname,
5
- **combined_html_options) do %>
1
+ <%= pb_content_tag do %>
6
2
  <%= pb_rails("home_address_street/#{emphasis}_emphasis", props: object.send("#{emphasis}_emphasis_props")) %>
7
3
  <% end %>
8
4
 
@@ -1,8 +1,3 @@
1
- <%= 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
- <%= pb_rails("icon", props: { dark: object.dark, icon: object.icon, fixed_width: true }) %>
1
+ <%= pb_content_tag do %>
2
+ <%= pb_rails("icon", props: { dark: object.dark, icon: object.icon, fixed_width: true }) %>
8
3
  <% end %>
@@ -1,9 +1,4 @@
1
- <%= content_tag(:div,
2
- aria: object.aria,
3
- id: object.id,
4
- data: object.data,
5
- class: object.classname,
6
- **combined_html_options) do %>
1
+ <%= pb_content_tag do %>
7
2
 
8
3
  <%= pb_rails("icon_circle", props: {
9
4
  dark: object.dark,
@@ -1,9 +1,4 @@
1
- <%= content_tag(:div,
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
  <%= pb_rails("body", props: { color: "light", dark: object.dark }) do %>
8
3
  <%= pb_rails("icon", props: { icon: object.icon, fixed_width: true }) %>
9
4
  <%= object.text %>
@@ -1,9 +1,4 @@
1
- <%= content_tag(:div,
2
- aria: object.aria,
3
- id: object.id,
4
- data: object.data,
5
- class: object.classname,
6
- **combined_html_options) do %>
1
+ <%= pb_content_tag do %>
7
2
  <%= pb_rails("caption", props: { text: object.label, classname: "pb_label_pill_label"}) %>
8
3
  <%= pb_rails("pill", props: { text: object.pill_value, variant: object.variant, classname: "pb_label_pill_pill" }) %>
9
4
  <% end %>
@@ -1,9 +1,4 @@
1
- <%= content_tag(:div,
2
- aria: object.aria,
3
- id: object.id,
4
- data: object.data,
5
- class: object.classname,
6
- **combined_html_options) do %>
1
+ <%= pb_content_tag do %>
7
2
  <%= pb_rails("caption", props: { text: object.label, dark: object.dark }) %>
8
3
  <% if object.variant == "details" %>
9
4
  <%= pb_rails("flex", props: {inline: true, vertical: "center"}) do %>
@@ -1,7 +1,3 @@
1
- <%= content_tag(object.tag,
2
- id: object.id,
3
- data: object.data,
4
- class: object.classname,
5
- **combined_html_options) do %>
1
+ <%= pb_content_tag(object.tag) do %>
6
2
  <%= content.presence %>
7
3
  <% end %>
@@ -1,7 +1,3 @@
1
- <%= content_tag(object.tag,
2
- id: object.id,
3
- data: object.data,
4
- class: object.classname,
5
- **combined_html_options) do %>
1
+ <%= pb_content_tag(object.tag) do %>
6
2
  <%= content.presence %>
7
3
  <% end %>
@@ -1,7 +1,3 @@
1
- <%= content_tag(object.tag,
2
- id: object.id,
3
- data: object.data,
4
- class: object.classname,
5
- **combined_html_options) do %>
1
+ <%= pb_content_tag(object.tag) do %>
6
2
  <%= content.presence %>
7
3
  <% end %>
@@ -1,7 +1,3 @@
1
- <%= content_tag(:div,
2
- id: object.id,
3
- data: object.data,
4
- class: object.classname,
5
- **combined_html_options) do %>
1
+ <%= pb_content_tag do %>
6
2
  <%= content %>
7
3
  <% end %>
@@ -1,7 +1,3 @@
1
- <%= content_tag(:div,
2
- id: object.id,
3
- data: object.data,
4
- class: object.classname,
5
- **combined_html_options) do %>
1
+ <%= pb_content_tag do %>
6
2
  <%= content.presence %>
7
3
  <% end %>
@@ -1,7 +1,3 @@
1
- <%= content_tag(:div,
2
- id: object.id,
3
- data: object.data,
4
- class: object.classname,
5
- **combined_html_options) do %>
1
+ <%= pb_content_tag do %>
6
2
  <%= content.presence %>
7
3
  <% end %>
@@ -1,10 +1,4 @@
1
- <%= content_tag(:li,
2
- aria: object.aria,
3
- class: object.classname,
4
- data: object.data,
5
- id: object.id,
6
- tabindex: object.tabindex,
7
- **combined_html_options
8
- ) do %>
1
+ <%= pb_content_tag(:li,
2
+ tabindex: object.tabindex) do %>
9
3
  <%= content.presence %>
10
4
  <% end %>
@@ -1,13 +1,7 @@
1
1
  <%= content_tag(:div, class: object.list_classname) do %>
2
- <%= content_tag(:"#{object.ordered_class}",
3
- aria: object.aria,
4
- class: object.classname,
5
- data: object.data,
6
- id: object.id,
2
+ <%= pb_content_tag(:"#{object.ordered_class}",
7
3
  role: object.role,
8
- tabindex: object.tabindex,
9
- **combined_html_options
10
- ) do %>
4
+ tabindex: object.tabindex) do %>
11
5
  <%= content.presence %>
12
6
  <% end %>
13
7
  <% end %>
@@ -1,9 +1,4 @@
1
- <%= content_tag(:div,
2
- id: object.id,
3
- data: object.data,
4
- class: object.classname,
5
- **combined_html_options) do %>
6
-
1
+ <%= pb_content_tag do %>
7
2
  <%= pb_rails("body", props: { color: "light", dark: object.dark }) do %>
8
3
  <%= pb_rails("icon", props: { aria: { label: "loading icon" }, fixed_width: true, icon: "spinner", pulse: true }) %> Loading
9
4
  <% end %>
@@ -1,9 +1,4 @@
1
- <%= content_tag(:div,
2
- aria: object.aria,
3
- id: object.id,
4
- data: object.data,
5
- class: object.classname,
6
- **combined_html_options) do %>
1
+ <%= pb_content_tag do %>
7
2
  <% if object.valid? %>
8
3
  <%= pb_rails("avatar", props: {
9
4
  name: object.avatar_name,
@@ -1,8 +1,3 @@
1
- <%= content_tag(:div,
2
- id: object.id,
3
- data: object.data,
4
- class: object.classname,
5
- aria: object.aria,
6
- **combined_html_options) do %>
1
+ <%= pb_content_tag do %>
7
2
  <%= content %>
8
3
  <% end %>
@@ -1,8 +1,3 @@
1
- <%= content_tag(:div,
2
- aria: object.aria,
3
- data: object.data,
4
- id: object.id,
5
- class: object.classname,
6
- **combined_html_options) do %>
1
+ <%= pb_content_tag do %>
7
2
  <%= react_component("MultiLevelSelect", object.multi_level_select_options) %>
8
3
  <% end %>
@@ -1,9 +1,4 @@
1
- <%= content_tag(:div,
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
  <% object.users.take(object.display_count).each do |user| %>
8
3
  <%= pb_rails("avatar", props: user.merge({size: object.size, classname: "pb_multiple_users_item", dark: object.dark}) ) %>
9
4
  <% end %>
@@ -1,9 +1,4 @@
1
- <%= content_tag(:div,
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
  <%= pb_rails("avatar", props: object.users[0].merge({size: "xs", classname: "pb_multiple_users_stacked_item", dark: object.dark}) ) %>
8
3
 
9
4
  <% unless object.only_one %>