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.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.html.erb +10 -14
- data/app/pb_kits/playbook/pb_advanced_table/table_body.html.erb +5 -9
- data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +2 -6
- data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +2 -6
- data/app/pb_kits/playbook/pb_avatar_action_button/avatar_action_button.html.erb +1 -6
- data/app/pb_kits/playbook/pb_background/background.html.erb +2 -11
- data/app/pb_kits/playbook/pb_badge/badge.html.erb +1 -6
- data/app/pb_kits/playbook/pb_body/_body.tsx +1 -1
- data/app/pb_kits/playbook/pb_body/body.html.erb +1 -6
- data/app/pb_kits/playbook/pb_bread_crumbs/bread_crumb_item.html.erb +1 -6
- data/app/pb_kits/playbook/pb_bread_crumbs/bread_crumbs.html.erb +2 -7
- data/app/pb_kits/playbook/pb_button/button.html.erb +2 -3
- data/app/pb_kits/playbook/pb_button_toolbar/button_toolbar.html.erb +2 -7
- data/app/pb_kits/playbook/pb_caption/caption.html.erb +1 -6
- data/app/pb_kits/playbook/pb_card/card.html.erb +1 -7
- data/app/pb_kits/playbook/pb_card/card_body.html.erb +1 -6
- data/app/pb_kits/playbook/pb_card/card_header.html.erb +1 -6
- data/app/pb_kits/playbook/pb_checkbox/checkbox.html.erb +1 -6
- data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.html.erb +1 -6
- data/app/pb_kits/playbook/pb_collapsible/collapsible.html.erb +1 -6
- data/app/pb_kits/playbook/pb_collapsible/collapsible_content.html.erb +1 -6
- data/app/pb_kits/playbook/pb_collapsible/collapsible_main.html.erb +1 -7
- data/app/pb_kits/playbook/pb_contact/contact.html.erb +1 -6
- data/app/pb_kits/playbook/pb_currency/currency.html.erb +1 -6
- data/app/pb_kits/playbook/pb_currency/docs/_currency_alignment_swift.md +43 -0
- data/app/pb_kits/playbook/pb_currency/docs/_currency_props_swift.md +12 -0
- data/app/pb_kits/playbook/pb_currency/docs/_currency_size_swift.md +31 -0
- data/app/pb_kits/playbook/pb_currency/docs/example.yml +5 -0
- data/app/pb_kits/playbook/pb_dashboard_value/dashboard_value.html.erb +1 -6
- data/app/pb_kits/playbook/pb_date/date.html.erb +1 -6
- data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +2 -6
- data/app/pb_kits/playbook/pb_date_range_inline/date_range_inline.html.erb +1 -5
- data/app/pb_kits/playbook/pb_date_range_stacked/date_range_stacked.html.erb +1 -5
- data/app/pb_kits/playbook/pb_date_range_stacked/docs/_date_range_stacked_default_swift.md +14 -0
- data/app/pb_kits/playbook/pb_date_range_stacked/docs/_date_range_stacked_props_swift.md +9 -0
- data/app/pb_kits/playbook/pb_date_range_stacked/docs/example.yml +4 -0
- data/app/pb_kits/playbook/pb_date_stacked/date_stacked.html.erb +1 -5
- data/app/pb_kits/playbook/pb_date_time/date_time.html.erb +1 -6
- data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.html.erb +1 -7
- data/app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.html.erb +1 -5
- data/app/pb_kits/playbook/pb_detail/detail.html.erb +1 -6
- data/app/pb_kits/playbook/pb_dialog/_dialog.scss +4 -2
- data/app/pb_kits/playbook/pb_dialog/dialog.html.erb +1 -6
- data/app/pb_kits/playbook/pb_dialog/dialog_body.html.erb +2 -7
- data/app/pb_kits/playbook/pb_dialog/dialog_footer.html.erb +1 -5
- data/app/pb_kits/playbook/pb_dialog/dialog_header.html.erb +2 -6
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +14 -9
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +34 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default.jsx +5 -5
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default.md +0 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete.jsx +87 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete.md +1 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_and_custom_display.jsx +102 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_and_custom_display.md +1 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display.jsx +4 -2
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display.md +3 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_options.jsx +5 -5
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_options.md +1 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_padding.jsx +51 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_padding.md +1 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_trigger.jsx +5 -5
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_trigger.md +1 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +3 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/index.js +3 -0
- data/app/pb_kits/playbook/pb_dropdown/hooks/useHandleOnKeydown.tsx +11 -6
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownContainer.tsx +5 -0
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownOption.tsx +41 -24
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownTrigger.tsx +91 -47
- data/app/pb_kits/playbook/pb_file_upload/file_upload.html.erb +1 -6
- data/app/pb_kits/playbook/pb_filter/filter.html.erb +1 -5
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.html.erb +1 -6
- data/app/pb_kits/playbook/pb_flex/flex.html.erb +1 -5
- data/app/pb_kits/playbook/pb_flex/flex_item.html.erb +2 -6
- data/app/pb_kits/playbook/pb_form_group/form_group.html.erb +1 -6
- data/app/pb_kits/playbook/pb_form_pill/form_pill.html.erb +1 -1
- data/app/pb_kits/playbook/pb_hashtag/hashtag.html.erb +1 -6
- data/app/pb_kits/playbook/pb_highlight/highlight.html.erb +1 -5
- data/app/pb_kits/playbook/pb_home_address_street/home_address_street.html.erb +1 -5
- data/app/pb_kits/playbook/pb_icon_circle/icon_circle.html.erb +2 -7
- data/app/pb_kits/playbook/pb_icon_stat_value/icon_stat_value.html.erb +1 -6
- data/app/pb_kits/playbook/pb_icon_value/icon_value.html.erb +1 -6
- data/app/pb_kits/playbook/pb_label_pill/label_pill.html.erb +1 -6
- data/app/pb_kits/playbook/pb_label_value/label_value.html.erb +1 -6
- data/app/pb_kits/playbook/pb_layout/body.html.erb +1 -5
- data/app/pb_kits/playbook/pb_layout/footer.html.erb +1 -5
- data/app/pb_kits/playbook/pb_layout/header.html.erb +1 -5
- data/app/pb_kits/playbook/pb_layout/item.html.erb +1 -5
- data/app/pb_kits/playbook/pb_layout/layout.html.erb +1 -5
- data/app/pb_kits/playbook/pb_layout/sidebar.html.erb +1 -5
- data/app/pb_kits/playbook/pb_list/item.html.erb +2 -8
- data/app/pb_kits/playbook/pb_list/list.html.erb +2 -8
- data/app/pb_kits/playbook/pb_loading_inline/loading_inline.html.erb +1 -6
- data/app/pb_kits/playbook/pb_message/message.html.erb +1 -6
- data/app/pb_kits/playbook/pb_message/message_mention.html.erb +1 -6
- data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.html.erb +1 -6
- data/app/pb_kits/playbook/pb_multiple_users/multiple_users.html.erb +1 -6
- data/app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.html.erb +1 -6
- data/app/pb_kits/playbook/pb_nav/item.html.erb +3 -14
- data/app/pb_kits/playbook/pb_nav/nav.html.erb +1 -6
- data/app/pb_kits/playbook/pb_online_status/online_status.html.erb +2 -6
- data/app/pb_kits/playbook/pb_pagination/pagination.html.erb +1 -6
- data/app/pb_kits/playbook/pb_passphrase/passphrase.html.erb +1 -1
- data/app/pb_kits/playbook/pb_person/person.html.erb +7 -12
- data/app/pb_kits/playbook/pb_person_contact/person_contact.html.erb +1 -6
- data/app/pb_kits/playbook/pb_pill/pill.html.erb +1 -6
- data/app/pb_kits/playbook/pb_popover/popover.html.erb +1 -6
- data/app/pb_kits/playbook/pb_progress_pills/progress_pills.html.erb +2 -6
- data/app/pb_kits/playbook/pb_progress_simple/progress_simple.html.erb +3 -6
- data/app/pb_kits/playbook/pb_progress_step/progress_step.html.erb +1 -5
- data/app/pb_kits/playbook/pb_progress_step/progress_step_item.html.erb +1 -5
- data/app/pb_kits/playbook/pb_radio/radio.html.erb +2 -8
- data/app/pb_kits/playbook/pb_section_separator/_section_separator.scss +6 -2
- data/app/pb_kits/playbook/pb_section_separator/_section_separator_mixin.scss +11 -1
- data/app/pb_kits/playbook/pb_section_separator/section_separator.html.erb +1 -6
- data/app/pb_kits/playbook/pb_select/select.html.erb +1 -5
- data/app/pb_kits/playbook/pb_selectable_card/selectable_card.html.erb +1 -5
- data/app/pb_kits/playbook/pb_selectable_card_icon/selectable_card_icon.html.erb +1 -4
- data/app/pb_kits/playbook/pb_selectable_icon/selectable_icon.html.erb +1 -5
- data/app/pb_kits/playbook/pb_selectable_list/selectable_list.html.erb +1 -6
- data/app/pb_kits/playbook/pb_selectable_list/selectable_list_item.html.erb +1 -6
- data/app/pb_kits/playbook/pb_source/source.html.erb +1 -5
- data/app/pb_kits/playbook/pb_star_rating/star_rating.html.erb +1 -5
- data/app/pb_kits/playbook/pb_stat_change/stat_change.html.erb +1 -5
- data/app/pb_kits/playbook/pb_stat_value/stat_value.html.erb +1 -5
- data/app/pb_kits/playbook/pb_table/table.html.erb +2 -12
- data/app/pb_kits/playbook/pb_table/table_body.html.erb +6 -16
- data/app/pb_kits/playbook/pb_table/table_cell.html.erb +6 -16
- data/app/pb_kits/playbook/pb_table/table_head.html.erb +6 -16
- data/app/pb_kits/playbook/pb_table/table_header.html.erb +4 -13
- data/app/pb_kits/playbook/pb_table/table_row.html.erb +6 -16
- data/app/pb_kits/playbook/pb_textarea/textarea.html.erb +1 -5
- data/app/pb_kits/playbook/pb_time/time.html.erb +1 -5
- data/app/pb_kits/playbook/pb_time_range_inline/time_range_inline.html.erb +1 -5
- data/app/pb_kits/playbook/pb_time_stacked/time_stacked.html.erb +1 -5
- data/app/pb_kits/playbook/pb_timeline/item.html.erb +3 -7
- data/app/pb_kits/playbook/pb_timeline/timeline.html.erb +1 -5
- data/app/pb_kits/playbook/pb_timestamp/timestamp.html.erb +1 -6
- data/app/pb_kits/playbook/pb_title/title.html.erb +1 -6
- data/app/pb_kits/playbook/pb_title_count/title_count.html.erb +1 -6
- data/app/pb_kits/playbook/pb_title_detail/title_detail.html.erb +1 -5
- data/app/pb_kits/playbook/pb_toggle/toggle.html.erb +1 -6
- data/app/pb_kits/playbook/pb_tooltip/_tooltip.tsx +1 -1
- data/app/pb_kits/playbook/pb_tooltip/tooltip.html.erb +1 -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/app/pb_kits/playbook/pb_weekday_stacked/weekday_stacked.html.erb +1 -6
- data/dist/playbook-rails.js +4 -4
- data/lib/playbook/kit_base.rb +1 -1
- data/lib/playbook/version.rb +1 -1
- 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 {
|
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 {
|
31
|
-
|
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 =
|
40
|
-
|
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
|
-
|
45
|
-
|
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
|
59
|
-
{...
|
60
|
-
|
61
|
-
|
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="
|
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 {
|
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
|
106
|
+
<Flex
|
107
|
+
align="center"
|
69
108
|
borderRadius="lg"
|
70
|
-
className={
|
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
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
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
|
-
<%=
|
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
|
-
<%=
|
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
|
-
<%=
|
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,4 +1,4 @@
|
|
1
|
-
<%=
|
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
|
-
<%=
|
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
|
-
<%=
|
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
|
-
<%=
|
2
|
-
|
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
|
-
<%=
|
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
|
-
<%=
|
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
|
-
<%=
|
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,10 +1,4 @@
|
|
1
|
-
<%=
|
2
|
-
|
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
|
-
<%=
|
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
|
-
<%=
|
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
|
-
<%=
|
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
|
-
<%=
|
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 %>
|