playbook_ui 13.27.0.pre.alpha.PLAY888Cardkithighlightoverflowtooltiperror2930 → 13.27.0.pre.alpha.PLAY1122fixMultipleUserspaddingoverflow2844
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.html.erb +5 -1
- data/app/pb_kits/playbook/pb_advanced_table/table_body.html.erb +5 -1
- data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +5 -1
- data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +5 -1
- data/app/pb_kits/playbook/pb_avatar/Utilities/GetPlacementPropsHelper.tsx +0 -16
- data/app/pb_kits/playbook/pb_avatar/_avatar.scss +0 -16
- data/app/pb_kits/playbook/pb_avatar/avatar.html.erb +1 -1
- data/app/pb_kits/playbook/pb_avatar/avatar.rb +0 -4
- data/app/pb_kits/playbook/pb_avatar/avatar.test.js +0 -47
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_badge_component_overlay.html.erb +66 -46
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_badge_component_overlay.jsx +29 -8
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_circle_icon_component_overlay.html.erb +33 -13
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_circle_icon_component_overlay.jsx +67 -48
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_default.jsx +20 -0
- data/app/pb_kits/playbook/pb_avatar/docs/example.yml +2 -2
- data/app/pb_kits/playbook/pb_avatar_action_button/avatar_action_button.html.erb +6 -1
- data/app/pb_kits/playbook/pb_badge/badge.html.erb +6 -1
- data/app/pb_kits/playbook/pb_body/_body.scss +0 -3
- data/app/pb_kits/playbook/pb_body/_body_mixins.scss +1 -1
- data/app/pb_kits/playbook/pb_button/_button_mixins.scss +3 -4
- data/app/pb_kits/playbook/pb_button_toolbar/button_toolbar.html.erb +6 -1
- data/app/pb_kits/playbook/pb_caption/_caption_mixin.scss +1 -1
- data/app/pb_kits/playbook/pb_card/_card.scss +1 -1
- data/app/pb_kits/playbook/pb_card/_card_mixin.scss +0 -5
- data/app/pb_kits/playbook/pb_card/card.rb +1 -1
- data/app/pb_kits/playbook/pb_card/docs/_card_background.html.erb +0 -20
- data/app/pb_kits/playbook/pb_card/docs/_card_background.jsx +1 -41
- data/app/pb_kits/playbook/pb_card/docs/_card_background.md +1 -1
- data/app/pb_kits/playbook/pb_card/docs/_card_header.html.erb +1 -1
- data/app/pb_kits/playbook/pb_card/docs/_card_header.md +1 -1
- data/app/pb_kits/playbook/pb_card/docs/_card_highlight.md +1 -1
- data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.html.erb +6 -1
- data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +10 -21
- data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleMain.tsx +75 -3
- data/app/pb_kits/playbook/pb_collapsible/collapsible.html.erb +6 -1
- data/app/pb_kits/playbook/pb_collapsible/collapsible_content.html.erb +6 -1
- data/app/pb_kits/playbook/pb_collapsible/collapsible_main.html.erb +6 -1
- data/app/pb_kits/playbook/pb_collapsible/docs/example.yml +0 -7
- data/app/pb_kits/playbook/pb_collapsible/docs/index.js +1 -3
- data/app/pb_kits/playbook/pb_collapsible/index.js +6 -16
- data/app/pb_kits/playbook/pb_contact/contact.html.erb +6 -1
- data/app/pb_kits/playbook/pb_currency/currency.html.erb +6 -1
- data/app/pb_kits/playbook/pb_dashboard_value/dashboard_value.html.erb +6 -1
- data/app/pb_kits/playbook/pb_date/date.html.erb +6 -1
- data/app/pb_kits/playbook/pb_date_range_inline/date_range_inline.html.erb +5 -1
- data/app/pb_kits/playbook/pb_date_range_inline/docs/example.yml +1 -4
- data/app/pb_kits/playbook/pb_date_range_stacked/date_range_stacked.html.erb +5 -1
- data/app/pb_kits/playbook/pb_date_stacked/date_stacked.html.erb +5 -1
- data/app/pb_kits/playbook/pb_date_stacked/docs/example.yml +0 -7
- data/app/pb_kits/playbook/pb_date_time/date_time.html.erb +6 -1
- data/app/pb_kits/playbook/pb_date_time/docs/example.yml +0 -6
- data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.html.erb +6 -1
- data/app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.html.erb +5 -1
- data/app/pb_kits/playbook/pb_date_year_stacked/docs/example.yml +0 -4
- data/app/pb_kits/playbook/pb_detail/_detail_mixins.scss +1 -1
- data/app/pb_kits/playbook/pb_docs/kit_example.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +1 -6
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +6 -5
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default.md +1 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/{_dropdown_subcomponent_structure_rails.html.erb → _dropdown_subcomponent_structure.html.erb} +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subcomponent_structure.md +6 -5
- data/app/pb_kits/playbook/pb_dropdown/docs/{_dropdown_with_custom_display_rails.html.erb → _dropdown_with_custom_display.html.erb} +6 -11
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display.jsx +3 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display.md +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/{_dropdown_with_custom_options_rails.html.erb → _dropdown_with_custom_options.html.erb} +11 -16
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_options.jsx +2 -5
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_options.md +1 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_padding.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_padding.md +1 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/{_dropdown_with_custom_trigger_rails.html.erb → _dropdown_with_custom_trigger.html.erb} +11 -16
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_trigger.jsx +2 -5
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_trigger.md +1 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_label.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_label.md +1 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +6 -6
- data/app/pb_kits/playbook/pb_dropdown/dropdown.html.erb +0 -1
- data/app/pb_kits/playbook/pb_dropdown/dropdown.rb +0 -1
- data/app/pb_kits/playbook/pb_dropdown/dropdown.test.jsx +1 -1
- data/app/pb_kits/playbook/pb_dropdown/dropdown_option.html.erb +9 -3
- data/app/pb_kits/playbook/pb_dropdown/dropdown_option.rb +6 -2
- data/app/pb_kits/playbook/pb_dropdown/index.js +1 -2
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownOption.tsx +14 -6
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/example.yml +0 -9
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.html.erb +6 -1
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +1 -1
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +1 -1
- data/app/pb_kits/playbook/pb_form_group/_form_group.scss +0 -15
- data/app/pb_kits/playbook/pb_icon_circle/icon_circle.html.erb +6 -1
- data/app/pb_kits/playbook/pb_icon_stat_value/icon_stat_value.html.erb +6 -1
- data/app/pb_kits/playbook/pb_icon_value/icon_value.html.erb +6 -1
- data/app/pb_kits/playbook/pb_label_pill/label_pill.html.erb +6 -1
- data/app/pb_kits/playbook/pb_label_value/label_value.html.erb +6 -1
- data/app/pb_kits/playbook/pb_loading_inline/loading_inline.html.erb +5 -1
- data/app/pb_kits/playbook/pb_message/message_mention.html.erb +6 -6
- data/app/pb_kits/playbook/pb_multiple_users/multiple_users.html.erb +6 -1
- data/app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.html.erb +6 -1
- data/app/pb_kits/playbook/pb_pagination/_pagination.scss +1 -1
- data/app/pb_kits/playbook/pb_pagination/pagination.html.erb +6 -1
- data/app/pb_kits/playbook/pb_person/person.html.erb +6 -1
- data/app/pb_kits/playbook/pb_person_contact/person_contact.html.erb +6 -1
- data/app/pb_kits/playbook/pb_pill/pill.html.erb +6 -1
- data/app/pb_kits/playbook/pb_section_separator/section_separator.html.erb +6 -1
- data/app/pb_kits/playbook/pb_select/_select.scss +0 -8
- data/app/pb_kits/playbook/pb_source/source.html.erb +5 -1
- data/app/pb_kits/playbook/pb_stat_change/stat_change.html.erb +5 -1
- data/app/pb_kits/playbook/pb_stat_value/stat_value.html.erb +5 -1
- data/app/pb_kits/playbook/pb_text_input/_text_input.scss +0 -19
- data/app/pb_kits/playbook/pb_time_range_inline/time_range_inline.html.erb +5 -1
- data/app/pb_kits/playbook/pb_time_stacked/time_stacked.html.erb +5 -1
- data/app/pb_kits/playbook/pb_timeline/item.html.erb +5 -1
- data/app/pb_kits/playbook/pb_timeline/timeline.html.erb +5 -1
- data/app/pb_kits/playbook/pb_timestamp/timestamp.html.erb +6 -1
- data/app/pb_kits/playbook/pb_title/_title.scss +1 -5
- data/app/pb_kits/playbook/pb_title_count/title_count.html.erb +6 -1
- data/app/pb_kits/playbook/pb_title_detail/title_detail.html.erb +5 -1
- data/app/pb_kits/playbook/pb_tooltip/index.js +0 -1
- data/app/pb_kits/playbook/pb_weekday_stacked/weekday_stacked.html.erb +6 -1
- data/app/pb_kits/playbook/tokens/_titles.scss +1 -5
- data/dist/menu.yml +2 -2
- data/dist/playbook-rails.js +5 -5
- data/lib/playbook/forms/builder.rb +0 -1
- data/lib/playbook/kit_base.rb +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +6 -44
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_badge_component_overlay.md +0 -3
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_circle_icon_component_overlay.md +0 -3
- data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleIcon.tsx +0 -92
- data/app/pb_kits/playbook/pb_collapsible/collapsible_icon.html.erb +0 -15
- data/app/pb_kits/playbook/pb_collapsible/collapsible_icon.rb +0 -37
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_custom_main.jsx +0 -72
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_custom_main.md +0 -3
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_custom_main_rails.html.erb +0 -19
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_custom_main_rails.md +0 -3
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_custom_main_with_icon.jsx +0 -73
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_custom_main_with_icon.md +0 -3
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_custom_main_with_icon_rails.html.erb +0 -20
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_custom_main_with_icon_rails.md +0 -3
- data/app/pb_kits/playbook/pb_date_range_inline/docs/_date_range_inline_default_swift.md +0 -61
- data/app/pb_kits/playbook/pb_date_range_inline/docs/_date_range_inline_props_swift.md +0 -11
- data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_bold_swift.md +0 -32
- data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_default_swift.md +0 -17
- data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_not_current_year_swift.md +0 -19
- data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_props_swift.md +0 -10
- data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_reversed_swift.md +0 -17
- data/app/pb_kits/playbook/pb_date_time/docs/_date_time_alignment_swift.md +0 -39
- data/app/pb_kits/playbook/pb_date_time/docs/_date_time_default_swift.md +0 -39
- data/app/pb_kits/playbook/pb_date_time/docs/_date_time_props_swift.md +0 -15
- data/app/pb_kits/playbook/pb_date_time/docs/_date_time_size_swift.md +0 -78
- data/app/pb_kits/playbook/pb_date_year_stacked/docs/_date_year_stacked_default_swift.md +0 -20
- data/app/pb_kits/playbook/pb_date_year_stacked/docs/_date_year_stacked_props_swift.md +0 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subcomponent_structure_rails.md +0 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display_rails.md +0 -5
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_options_rails.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_trigger_rails.md +0 -1
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_children_swift.md +0 -23
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_close_swift.md +0 -7
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_default_swift.md +0 -9
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_dismiss_with_timer_swift.md +0 -22
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_multi_line_swift.md +0 -9
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_positions_swift.md +0 -62
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_props_swift.md +0 -8
- data/lib/playbook/forms/builder/phone_number_field.rb +0 -12
@@ -28,7 +28,6 @@ $pb_button_border_width: 0px;
|
|
28
28
|
font-size: $font_small;
|
29
29
|
font-weight: $bold;
|
30
30
|
text-align: center;
|
31
|
-
text-decoration: none;
|
32
31
|
vertical-align: middle;
|
33
32
|
text-transform: none;
|
34
33
|
border-width: $pb_button_border_width;
|
@@ -198,16 +197,16 @@ $pb_button_border_width: 0px;
|
|
198
197
|
|
199
198
|
// Dark Link =============
|
200
199
|
@mixin pb_button_link_dark {
|
201
|
-
@include pb_button_variant($transparent, $
|
200
|
+
@include pb_button_variant($transparent, $white);
|
202
201
|
|
203
202
|
@media (hover:hover) {
|
204
203
|
&:hover {
|
205
204
|
@include pb_button_hover($transparent);
|
206
|
-
color: rgba($
|
205
|
+
color: rgba($white, $opacity_6)
|
207
206
|
}
|
208
207
|
&:active {
|
209
208
|
transition: none;
|
210
|
-
@include pb_button_variant($transparent, $
|
209
|
+
@include pb_button_variant($transparent, $white);
|
211
210
|
}
|
212
211
|
}
|
213
212
|
}
|
@@ -17,11 +17,6 @@ $additional_colors: (
|
|
17
17
|
"light": $bg_light,
|
18
18
|
"white": $white,
|
19
19
|
"none": none,
|
20
|
-
"success_subtle": $success_subtle,
|
21
|
-
"warning_subtle": $warning_subtle,
|
22
|
-
"error_subtle": $error_subtle,
|
23
|
-
"info_subtle": $info_subtle,
|
24
|
-
"neutral_subtle": $neutral_subtle,
|
25
20
|
);
|
26
21
|
$background_colors: map-merge($product_colors, $additional_colors);
|
27
22
|
$pb_card_header_colors: map-merge(map-merge($product_colors, $additional_colors), $category_colors);
|
@@ -15,7 +15,7 @@ module Playbook
|
|
15
15
|
values: %w[xs sm md lg xl none rounded],
|
16
16
|
default: "md"
|
17
17
|
prop :background, type: Playbook::Props::Enum,
|
18
|
-
values: %w[white light dark product_1_background product_1_highlight product_2_background product_2_highlight product_3_background product_3_highlight product_4_background product_4_highlight product_5_background product_5_highlight product_6_background product_6_highlight product_7_background product_7_highlight product_8_background product_8_highlight product_9_background product_9_highlight product_10_background product_10_highlight windows siding doors solar roofing gutters insulation none
|
18
|
+
values: %w[white light dark product_1_background product_1_highlight product_2_background product_2_highlight product_3_background product_3_highlight product_4_background product_4_highlight product_5_background product_5_highlight product_6_background product_6_highlight product_7_background product_7_highlight product_8_background product_8_highlight product_9_background product_9_highlight product_10_background product_10_highlight windows siding doors solar roofing gutters insulation none],
|
19
19
|
default: "none"
|
20
20
|
|
21
21
|
def classname
|
@@ -42,23 +42,3 @@
|
|
42
42
|
dark: true
|
43
43
|
}) %>
|
44
44
|
<% end %>
|
45
|
-
|
46
|
-
<%= pb_rails("title", props: { text: "Subtle Status Colors", tag: "h4", size: 4, margin_bottom: "sm" }) %>
|
47
|
-
|
48
|
-
<%= pb_rails("card", props: { background: "success_subtle", margin_bottom: "sm" }) do %>
|
49
|
-
<%= pb_rails("body", props: {
|
50
|
-
text: "Success Subtle"
|
51
|
-
}) %>
|
52
|
-
<% end %>
|
53
|
-
|
54
|
-
<%= pb_rails("card", props: { background: "warning_subtle", margin_bottom: "sm" }) do %>
|
55
|
-
<%= pb_rails("body", props: {
|
56
|
-
text: "Warning Subtle"
|
57
|
-
}) %>
|
58
|
-
<% end %>
|
59
|
-
|
60
|
-
<%= pb_rails("card", props: { background: "info_subtle", margin_bottom: "sm" }) do %>
|
61
|
-
<%= pb_rails("body", props: {
|
62
|
-
text: "Info Subtle"
|
63
|
-
}) %>
|
64
|
-
<% end %>
|
@@ -90,47 +90,7 @@ const CardBackground = (props) => {
|
|
90
90
|
/>
|
91
91
|
</Card>
|
92
92
|
|
93
|
-
|
94
|
-
<Title
|
95
|
-
{...props}
|
96
|
-
marginBottom="sm"
|
97
|
-
size={4}
|
98
|
-
tag="h4"
|
99
|
-
text="Subtle Status Colors"
|
100
|
-
/>
|
101
|
-
|
102
|
-
<Card
|
103
|
-
background="success_subtle"
|
104
|
-
marginBottom="sm"
|
105
|
-
{...props}
|
106
|
-
>
|
107
|
-
<Body
|
108
|
-
text="Success Subtle"
|
109
|
-
{...props}
|
110
|
-
/>
|
111
|
-
</Card>
|
112
|
-
|
113
|
-
<Card
|
114
|
-
background="warning_subtle"
|
115
|
-
marginBottom="sm"
|
116
|
-
{...props}
|
117
|
-
>
|
118
|
-
<Body
|
119
|
-
text="Warning Subtle"
|
120
|
-
{...props}
|
121
|
-
/>
|
122
|
-
</Card>
|
123
|
-
|
124
|
-
<Card
|
125
|
-
background="info_subtle"
|
126
|
-
marginBottom="sm"
|
127
|
-
{...props}
|
128
|
-
>
|
129
|
-
<Body
|
130
|
-
text="Info Subtle"
|
131
|
-
{...props}
|
132
|
-
/>
|
133
|
-
</Card>
|
93
|
+
|
134
94
|
</div>
|
135
95
|
)
|
136
96
|
}
|
@@ -1 +1 @@
|
|
1
|
-
Add a background color by passing the color name to background. List of all colors can be viewed <a href="https://playbook.powerapp.cloud/visual_guidelines" target="_blank">here</a> under Product Colors
|
1
|
+
Add a background color by passing the color name to background. List of all colors can be viewed <a href="https://playbook.powerapp.cloud/visual_guidelines" target="_blank">here</a> under Product Colors.
|
@@ -1 +1 @@
|
|
1
|
-
Card headers pass category, product, and background colors only. List of all category, product, and background colors can be viewed <a href="https://playbook.powerapp.cloud/
|
1
|
+
Card headers pass category, product, and background colors only. List of all category, product, and background colors can be viewed <a href="https://playbook.powerapp.cloud/utilities" target="_blank">here</a>.
|
@@ -1 +1 @@
|
|
1
|
-
Card highlight can pass status, product, and category colors. List of all colors can be viewed <a href="https://playbook.powerapp.cloud/
|
1
|
+
Card highlight can pass status, product, and category colors. List of all colors can be viewed <a href="https://playbook.powerapp.cloud/utilities" target="_blank">here</a>.
|
@@ -1,4 +1,9 @@
|
|
1
|
-
<%=
|
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 %>
|
2
7
|
<%= pb_rails("button", props: {type: object.type, link: object.link, new_window:object.new_window, variant: object.variant, disabled: object.disabled, dark: object.dark}) do %>
|
3
8
|
<%= pb_rails("icon", props: {icon: object.icon, fixed_width: true, dark: object.dark}) %>
|
4
9
|
<% end %>
|
@@ -9,7 +9,6 @@ import CollapsibleContent from './child_kits/CollapsibleContent'
|
|
9
9
|
import CollapsibleMain from './child_kits/CollapsibleMain'
|
10
10
|
import CollapsibleContext from './context'
|
11
11
|
import { IconSizes } from "../pb_icon/_icon"
|
12
|
-
import CollapsibleIcon from './child_kits/CollapsibleIcon'
|
13
12
|
|
14
13
|
|
15
14
|
type CollapsibleProps = {
|
@@ -53,15 +52,12 @@ const Collapsible = ({
|
|
53
52
|
if (CollapsibleParent.length !== 2) {
|
54
53
|
throw new Error('Collapsible requires <CollapsibleMain> and <CollapsibleContent> to function properly.')
|
55
54
|
}
|
56
|
-
const FirstChild = CollapsibleParent[0]
|
57
|
-
const SecondChild = CollapsibleParent[1]
|
58
55
|
|
59
|
-
const Main =
|
60
|
-
const Content =
|
56
|
+
const Main = CollapsibleParent[0]
|
57
|
+
const Content = CollapsibleParent[1]
|
61
58
|
|
62
|
-
|
63
|
-
const { children:
|
64
|
-
const { children: contentChildren = null, ...contentProps } = Content ? Content.props : {}
|
59
|
+
const { children: mainChildren, ...mainProps } = Main.props
|
60
|
+
const { children: contentChildren, ...contentProps } = Content.props
|
65
61
|
const ariaProps = buildAriaProps(aria)
|
66
62
|
const dataProps = buildDataProps(data)
|
67
63
|
const htmlProps = buildHtmlProps(htmlOptions)
|
@@ -79,19 +75,13 @@ const Collapsible = ({
|
|
79
75
|
className={classes}
|
80
76
|
id={id}
|
81
77
|
>
|
82
|
-
{
|
83
|
-
|
84
|
-
|
85
|
-
</CollapsibleMain>
|
86
|
-
) : (
|
87
|
-
FirstChild
|
88
|
-
)}
|
78
|
+
<CollapsibleMain {...mainProps}>
|
79
|
+
{mainChildren}
|
80
|
+
</CollapsibleMain>
|
89
81
|
|
90
|
-
{
|
91
|
-
|
92
|
-
|
93
|
-
</CollapsibleContent>
|
94
|
-
)}
|
82
|
+
<CollapsibleContent {...contentProps}>
|
83
|
+
{contentChildren}
|
84
|
+
</CollapsibleContent>
|
95
85
|
</div>
|
96
86
|
</CollapsibleContext.Provider>
|
97
87
|
)
|
@@ -99,6 +89,5 @@ const Collapsible = ({
|
|
99
89
|
|
100
90
|
Collapsible.Main = CollapsibleMain
|
101
91
|
Collapsible.Content = CollapsibleContent
|
102
|
-
Collapsible.Icon = CollapsibleIcon
|
103
92
|
|
104
93
|
export default Collapsible
|
@@ -7,9 +7,27 @@ import { globalProps } from '../../utilities/globalProps'
|
|
7
7
|
|
8
8
|
import Flex from '../../pb_flex/_flex'
|
9
9
|
import FlexItem from '../../pb_flex/_flex_item'
|
10
|
-
import { IconSizes } from "../../pb_icon/_icon"
|
10
|
+
import Icon, { IconSizes } from "../../pb_icon/_icon"
|
11
11
|
import CollapsibleContext from '../context'
|
12
|
-
|
12
|
+
|
13
|
+
|
14
|
+
type colorMap = {
|
15
|
+
default: string,
|
16
|
+
light: string,
|
17
|
+
lighter: string,
|
18
|
+
link: string,
|
19
|
+
error: string,
|
20
|
+
success: string
|
21
|
+
}
|
22
|
+
|
23
|
+
const colorMap = {
|
24
|
+
default: "#242B42",
|
25
|
+
light: "#687887",
|
26
|
+
lighter: "#C1CDD6",
|
27
|
+
link: "#0056CF",
|
28
|
+
error: "#FF2229",
|
29
|
+
success: "#00CA74",
|
30
|
+
}
|
13
31
|
|
14
32
|
type CollapsibleMainProps = {
|
15
33
|
children: React.ReactNode[] | React.ReactNode,
|
@@ -20,6 +38,60 @@ type CollapsibleMainProps = {
|
|
20
38
|
}
|
21
39
|
type IconColors = "default" | "light" | "lighter" | "link" | "error" | "success"
|
22
40
|
|
41
|
+
type IconProps = {
|
42
|
+
collapsed: boolean | (()=> void)
|
43
|
+
icon?: string[] | string
|
44
|
+
iconColor?: IconColors
|
45
|
+
iconSize?: IconSizes
|
46
|
+
onIconClick?: ()=> void
|
47
|
+
}
|
48
|
+
|
49
|
+
const ToggleIcon = ({ collapsed, icon, iconSize, iconColor, onIconClick }: IconProps) => {
|
50
|
+
const color = colorMap[iconColor]
|
51
|
+
|
52
|
+
const showIcon = (icon: string |string[]) => {
|
53
|
+
if (typeof icon === "string") {
|
54
|
+
return [icon, icon]
|
55
|
+
}
|
56
|
+
return icon
|
57
|
+
}
|
58
|
+
|
59
|
+
const handleIconClick = (e: React.MouseEvent<HTMLElement>) => {
|
60
|
+
if (onIconClick) {
|
61
|
+
e.stopPropagation();
|
62
|
+
onIconClick()
|
63
|
+
}
|
64
|
+
}
|
65
|
+
|
66
|
+
return (
|
67
|
+
<>
|
68
|
+
{collapsed ? (
|
69
|
+
<div
|
70
|
+
className="icon_wrapper"
|
71
|
+
key={icon ? showIcon(icon)[0] : "chevron-down"}
|
72
|
+
onClick={(e)=> handleIconClick(e)}
|
73
|
+
style={{ verticalAlign: "middle", color: color }}
|
74
|
+
>
|
75
|
+
<Icon icon={icon ? showIcon(icon)[0] : "chevron-down"}
|
76
|
+
size={iconSize}
|
77
|
+
/>
|
78
|
+
</div>
|
79
|
+
) : (
|
80
|
+
<div
|
81
|
+
className="icon_wrapper"
|
82
|
+
key={icon ? showIcon(icon)[1] : "chevron-up"}
|
83
|
+
onClick={(e)=> handleIconClick(e)}
|
84
|
+
style={{ verticalAlign: "middle", color: color }}
|
85
|
+
>
|
86
|
+
<Icon icon={icon ? showIcon(icon)[1] : "chevron-up"}
|
87
|
+
size={iconSize}
|
88
|
+
/>
|
89
|
+
</div>
|
90
|
+
)}
|
91
|
+
</>
|
92
|
+
);
|
93
|
+
}
|
94
|
+
|
23
95
|
const CollapsibleMain = ({
|
24
96
|
children,
|
25
97
|
className,
|
@@ -48,7 +120,7 @@ const CollapsibleMain = ({
|
|
48
120
|
>
|
49
121
|
<FlexItem>{children}</FlexItem>
|
50
122
|
<FlexItem>
|
51
|
-
<
|
123
|
+
<ToggleIcon
|
52
124
|
collapsed={collapsed as () => void}
|
53
125
|
icon={icon as string[] | string}
|
54
126
|
iconColor={iconColor as IconColors}
|
@@ -1,4 +1,9 @@
|
|
1
|
-
<%=
|
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 %>
|
2
7
|
|
3
8
|
<%= pb_rails("flex", props: {vertical: "center", spacing: "between", cursor: "pointer"}) do %>
|
4
9
|
<%= pb_rails("flex/flex_item") do %>
|
@@ -7,9 +7,6 @@ examples:
|
|
7
7
|
- collapsible_icons: Custom Icons
|
8
8
|
- collapsible_external_controls: Toggle Collapsible With External Controls
|
9
9
|
- collapsible_external_controls_multiple: Toggle All Collapsibles With One Control
|
10
|
-
- collapsible_custom_main_rails: Custom Main Section
|
11
|
-
- collapsible_custom_main_with_icon_rails: Custom Main Section With Icon
|
12
|
-
|
13
10
|
|
14
11
|
react:
|
15
12
|
- collapsible_default: Default
|
@@ -17,10 +14,6 @@ examples:
|
|
17
14
|
- collapsible_color: Icon Color
|
18
15
|
- collapsible_icons: Custom Icons
|
19
16
|
- collapsible_state: useCollapsible Hook
|
20
|
-
- collapsible_custom_main: Custom Main Section
|
21
|
-
- collapsible_custom_main_with_icon: Custom Main Section With Icon
|
22
|
-
|
23
|
-
|
24
17
|
|
25
18
|
swift:
|
26
19
|
- collapsible_default_swift: Default
|
@@ -2,6 +2,4 @@ export { default as CollapsibleDefault } from './_collapsible_default.jsx'
|
|
2
2
|
export { default as CollapsibleSize } from './_collapsible_size.jsx'
|
3
3
|
export { default as CollapsibleColor } from './_collapsible_color.jsx'
|
4
4
|
export { default as CollapsibleIcons } from './_collapsible_icons.jsx'
|
5
|
-
export {
|
6
|
-
export { default as CollapsibleCustomMain } from './_collapsible_custom_main.jsx'
|
7
|
-
export { default as CollapsibleCustomMainWithIcon } from './_collapsible_custom_main_with_icon.jsx'
|
5
|
+
export {default as CollapsibleState } from './_collapsible_state.jsx'
|
@@ -75,23 +75,13 @@ export default class PbCollapsible extends PbEnhancedElement {
|
|
75
75
|
this.displayUpArrow()
|
76
76
|
}
|
77
77
|
|
78
|
-
toggleArrows(showDownArrow) {
|
79
|
-
const downArrow = this.element.querySelector(DOWN_ARROW_SELECTOR);
|
80
|
-
const upArrow = this.element.querySelector(UP_ARROW_SELECTOR);
|
81
|
-
|
82
|
-
if (downArrow) {
|
83
|
-
downArrow.style.display = showDownArrow ? 'inline-block' : 'none';
|
84
|
-
}
|
85
|
-
if (upArrow) {
|
86
|
-
upArrow.style.display = showDownArrow ? 'none' : 'inline-block';
|
87
|
-
}
|
88
|
-
}
|
89
|
-
|
90
78
|
displayDownArrow() {
|
91
|
-
this.
|
79
|
+
this.element.querySelector(DOWN_ARROW_SELECTOR).style.display = 'inline-block'
|
80
|
+
this.element.querySelector(UP_ARROW_SELECTOR).style.display = 'none'
|
92
81
|
}
|
93
|
-
|
82
|
+
|
94
83
|
displayUpArrow() {
|
95
|
-
this.
|
96
|
-
|
84
|
+
this.element.querySelector(UP_ARROW_SELECTOR).style.display = 'inline-block'
|
85
|
+
this.element.querySelector(DOWN_ARROW_SELECTOR).style.display = 'none'
|
86
|
+
}
|
97
87
|
}
|
@@ -1,4 +1,9 @@
|
|
1
|
-
<%=
|
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 %>
|
2
7
|
<%= pb_rails("caption", props: object.caption_props) %>
|
3
8
|
|
4
9
|
<div class=<%= "pb_currency_wrapper#{object.variant_class || object.emphasized_class}" %>>
|
@@ -1,4 +1,9 @@
|
|
1
|
-
<%=
|
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 %>
|
2
7
|
<% if object.stat_label.present? %>
|
3
8
|
<%= pb_rails("body", props: { color: "light", text: object.stat_label } ) %>
|
4
9
|
<% end %>
|
@@ -1,4 +1,8 @@
|
|
1
|
-
<%=
|
1
|
+
<%= content_tag(:div,
|
2
|
+
id: object.id,
|
3
|
+
data: object.data,
|
4
|
+
class: object.classname,
|
5
|
+
**combined_html_options) do %>
|
2
6
|
<div class="pb_date_range_inline_wrapper">
|
3
7
|
<% if object.icon == true %>
|
4
8
|
<%= pb_rails(object.text_kit, props: { tag: "span", dark: object.dark, color: object.icon_color, text: pb_rails("icon", props: { icon: "calendar-alt", fixed_width: true, size: object.size, classname: "pb_date_range_inline_icon" }) }) %>
|
@@ -15,10 +15,3 @@ examples:
|
|
15
15
|
- date_stacked_reverse: Day & Month Reverse
|
16
16
|
- date_stacked_sizes: Sizes
|
17
17
|
- date_stacked_bold: Bold
|
18
|
-
|
19
|
-
swift:
|
20
|
-
- date_stacked_default_swift: Default
|
21
|
-
- date_stacked_not_current_year_swift: Not Current Year
|
22
|
-
- date_stacked_reversed_swift: Day & Month Reverse
|
23
|
-
- date_stacked_bold_swift: Bold
|
24
|
-
- date_stacked_props_swift: ""
|
@@ -1,4 +1,9 @@
|
|
1
|
-
<%=
|
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 %>
|
2
7
|
|
3
8
|
<%= pb_rails("flex", props: {classname: "flex-container", vertical: "stretch"}) do %>
|
4
9
|
<%= pb_rails("body", props: {classname: "flex-item"}) do %>
|
@@ -1,4 +1,8 @@
|
|
1
|
-
<%=
|
1
|
+
<%= content_tag(:div,
|
2
|
+
id: object.id,
|
3
|
+
data: object.data,
|
4
|
+
class: object.classname,
|
5
|
+
**combined_html_options) do %>
|
2
6
|
<%= pb_rails("title", props: { text: object.day_month, size: 4, dark: object.dark }) %>
|
3
7
|
<%= pb_rails("body", props: { text: object.year, size: 4, color: "light", dark: object.dark }) %>
|
4
8
|
<% end %>
|
@@ -23,11 +23,11 @@
|
|
23
23
|
<ul>
|
24
24
|
<% hide_button = type == "rails" ? 'flex' : 'none' %>
|
25
25
|
<li>
|
26
|
-
<%= pb_rails("button", props: { id:"copy-html-#{example_key}", icon: "copy", text: "Copy HTML",
|
26
|
+
<%= pb_rails("button", props: { id:"copy-html-#{example_key}", icon: "copy", text: "Copy HTML", variant: "link", size: "sm", display: hide_button }) %>
|
27
27
|
</li>
|
28
28
|
<li>
|
29
|
-
<%= pb_rails("button", props: { icon: "code",
|
30
|
-
<%= pb_rails("button", props: { icon: "code",
|
29
|
+
<%= pb_rails("button", props: { icon: "code", id:"toggle-open-opened", text: "Close Code", variant: "link", size: "sm", display: "none" }) %>
|
30
|
+
<%= pb_rails("button", props: { icon: "code", id:"toggle-open-closed", text: "Show Code", variant: "link", size: "sm" }) %>
|
31
31
|
</li>
|
32
32
|
</ul>
|
33
33
|
</div>
|